@marimo-team/frontend 0.19.8-dev4 → 0.19.8-dev40

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 (342) hide show
  1. package/dist/assets/{CellStatus-CTtb89yx.js → CellStatus-D-CCv4h6.js} +1 -1
  2. package/dist/assets/{Combination-C_mRvd_Z.js → Combination-izwufzWe.js} +1 -1
  3. package/dist/assets/{ConnectedDataExplorerComponent-CX7YQX42.js → ConnectedDataExplorerComponent-C1BlkUlk.js} +1 -1
  4. package/dist/assets/{DeferredRequestRegistry-CO2AyNfd.js → DeferredRequestRegistry-tv0PqJZ0.js} +1 -1
  5. package/dist/assets/{ErrorBoundary-ChCiwl15.js → ErrorBoundary-B9Ifj8Jf.js} +1 -1
  6. package/dist/assets/{ImageComparisonComponent-BVBGmVcA.js → ImageComparisonComponent-BVXYpigZ.js} +1 -1
  7. package/dist/assets/{ImperativeModal-CKeCkc1k.js → ImperativeModal-DZr52ffu.js} +1 -1
  8. package/dist/assets/{Inputs-CBxLLWdV.js → Inputs-CbenuziM.js} +1 -1
  9. package/dist/assets/{JsonOutput-BTBD86gT.js → JsonOutput-CU0ad2LH.js} +11 -11
  10. package/dist/assets/{LazyAnyLanguageCodeMirror-Be7SB10I.js → LazyAnyLanguageCodeMirror-BqosdyZU.js} +2 -2
  11. package/dist/assets/MarimoErrorOutput-BydcsyYP.js +7 -0
  12. package/dist/assets/{RenderHTML-IBhB_MjX.js → RenderHTML-3amWMGgo.js} +1 -1
  13. package/dist/assets/{SSRProvider-DBS9qs3r.js → SSRProvider-DrpctNAg.js} +1 -1
  14. package/dist/assets/__vite-browser-external-D-ioOGDE.js +1 -0
  15. package/dist/assets/__vite-browser-external-DBckR0WR.js +1 -0
  16. package/dist/assets/{add-cell-with-ai-DsiiVErB.js → add-cell-with-ai-B07D0AiE.js} +6 -6
  17. package/dist/assets/{add-database-form-B1frIn24.js → add-database-form-BnEY6X5s.js} +3 -3
  18. package/dist/assets/{agent-panel-B_Ur2utx.js → agent-panel-C1O0Y8Bi.js} +5 -5
  19. package/dist/assets/{ai-model-dropdown-Dix8JIRc.js → ai-model-dropdown-Cugcw6NV.js} +4 -4
  20. package/dist/assets/{alert-adkp2Qj8.js → alert-Cx8eFRUM.js} +1 -1
  21. package/dist/assets/{alert-dialog-CordKci7.js → alert-dialog-Ctz24SMn.js} +1 -1
  22. package/dist/assets/{any-language-editor-Z9d2XKUM.js → any-language-editor-DyXJSyeK.js} +1 -1
  23. package/dist/assets/{app-config-button-CYFJH9oz.js → app-config-button-66OSct-U.js} +1 -1
  24. package/dist/assets/{architectureDiagram-VXUJARFQ-B-zQV2Ro.js → architectureDiagram-VXUJARFQ-B8zMpJcM.js} +1 -1
  25. package/dist/assets/{arrow-left-Cb_73j1f.js → arrow-left-VDC1u5rq.js} +1 -1
  26. package/dist/assets/{badge-Ce8wRjuQ.js → badge-D4keL3YC.js} +1 -1
  27. package/dist/assets/blob-Bgnx1kuY.js +1 -0
  28. package/dist/assets/{blockDiagram-VD42YOAC-B7BRAty8.js → blockDiagram-VD42YOAC-CF1a-_t0.js} +1 -1
  29. package/dist/assets/{bundle.esm-B-jCcPJK.js → bundle.esm-CBAPjfrh.js} +1 -1
  30. package/dist/assets/{button-YC1gW_kJ.js → button-CZ3Cs4qb.js} +1 -1
  31. package/dist/assets/{c4Diagram-YG6GDRKO-C5JyC9v_.js → c4Diagram-YG6GDRKO-YIsEsUdQ.js} +1 -1
  32. package/dist/assets/{cache-panel-BfCxvTOh.js → cache-panel-C_9WDApV.js} +1 -1
  33. package/dist/assets/{card-BAxUmnnT.js → card-DdlNjkEA.js} +1 -1
  34. package/dist/assets/{cell-editor-BQ5bBOiS.js → cell-editor-DZgQrVMs.js} +14 -14
  35. package/dist/assets/{cell-link-DW0zobk9.js → cell-link-B37i0WNz.js} +1 -1
  36. package/dist/assets/{cells-BcMpgRWV.js → cells-B0XKj2oa.js} +32 -32
  37. package/dist/assets/channel-CXFsg7SH.js +1 -0
  38. package/dist/assets/{chart-no-axes-column-W42b2ZIs.js → chart-no-axes-column-qvVRjhv1.js} +1 -1
  39. package/dist/assets/{chat-components-BpIX7pUp.js → chat-components-BNjAKvAv.js} +1 -1
  40. package/dist/assets/{chat-display-CVXM0cmr.js → chat-display-q9RdcWB-.js} +1 -1
  41. package/dist/assets/chat-panel-viPqlAXC.js +3 -0
  42. package/dist/assets/check-Dr3SxUsb.js +1 -0
  43. package/dist/assets/{chevron-right-DwagBitu.js → chevron-right--18M_6o9.js} +1 -1
  44. package/dist/assets/{chunk-5FQGJX7Z-Bmb7yu_c.js → chunk-5FQGJX7Z-T2jyw7ZD.js} +3 -3
  45. package/dist/assets/{chunk-ABZYJK2D-Coo5qi7b.js → chunk-ABZYJK2D-D1A06qKo.js} +3 -3
  46. package/dist/assets/{chunk-ATLVNIR6-C0ULYreM.js → chunk-ATLVNIR6-C5FWd1qN.js} +1 -1
  47. package/dist/assets/{chunk-B4BG7PRW-D6Q5lT5Z.js → chunk-B4BG7PRW-BEayfxv_.js} +1 -1
  48. package/dist/assets/{chunk-DI55MBZ5-BUUtkB-8.js → chunk-DI55MBZ5-BSrtupT8.js} +1 -1
  49. package/dist/assets/{chunk-EXTU4WIE-DQy5cN5X.js → chunk-EXTU4WIE-wi_fHsHN.js} +1 -1
  50. package/dist/assets/{chunk-JA3XYJ7Z-99Y1UR46.js → chunk-JA3XYJ7Z-tKDxhnhw.js} +1 -1
  51. package/dist/assets/{chunk-JZLCHNYA-DRGkEV50.js → chunk-JZLCHNYA-DtvI9B9X.js} +1 -1
  52. package/dist/assets/{chunk-N4CR4FBY-DHFG9ldR.js → chunk-N4CR4FBY-BQcJpHO7.js} +2 -2
  53. package/dist/assets/{chunk-QN33PNHL-DB8FgLRd.js → chunk-QN33PNHL-BboKw3W6.js} +1 -1
  54. package/dist/assets/{chunk-QXUST7PY-_zxuSm7L.js → chunk-QXUST7PY-C4Ihfbmy.js} +1 -1
  55. package/dist/assets/{chunk-S3R3BYOJ-PVCoxQeQ.js → chunk-S3R3BYOJ-D1UiABQX.js} +1 -1
  56. package/dist/assets/{chunk-TZMSLE5B-KYGSDxPK.js → chunk-TZMSLE5B-BjrxQwUX.js} +1 -1
  57. package/dist/assets/{circle-check-C57eOpl0.js → circle-check-DquVD4wZ.js} +1 -1
  58. package/dist/assets/{circle-play-BuOtSgid.js → circle-play-EowqxNIC.js} +1 -1
  59. package/dist/assets/{circle-plus-CnWl9uZo.js → circle-plus-haI9GLDP.js} +1 -1
  60. package/dist/assets/classDiagram-2ON5EDUG-BHD5dOKT.js +1 -0
  61. package/dist/assets/classDiagram-v2-WZHVMYZB-VYd80hrd.js +1 -0
  62. package/dist/assets/{clear-button-CF0iBcV9.js → clear-button-DI7_bdOB.js} +1 -1
  63. package/dist/assets/{click-outside-container-B12FHFHm.js → click-outside-container-Npdlddni.js} +1 -1
  64. package/dist/assets/{clipboard-paste-BiDF-cqm.js → clipboard-paste-CpyPR-HZ.js} +1 -1
  65. package/dist/assets/{code-block-37QAKDTI-D5PRUB7R.js → code-block-37QAKDTI-FUPT3-7o.js} +1 -1
  66. package/dist/assets/{code-xml-XLwHyDBr.js → code-xml-CgN_Yig7.js} +1 -1
  67. package/dist/assets/{column-preview-v3J210SK.js → column-preview-DrmYyyvE.js} +1 -1
  68. package/dist/assets/{command-DOzj5zu3.js → command-DTFQw11F.js} +1 -1
  69. package/dist/assets/{command-palette-B94wuFEk.js → command-palette-CrOe4bpD.js} +1 -1
  70. package/dist/assets/{common-DHF6uQdA.js → common-C0Pspoza.js} +1 -1
  71. package/dist/assets/compiler-runtime-B3qBwwSJ.js +1 -0
  72. package/dist/assets/{config-C3-Nti03.js → config-D2-Bw6QC.js} +1 -1
  73. package/dist/assets/{context-CJp-B2dx.js → context-Ga_vV5mE.js} +1 -1
  74. package/dist/assets/{copy-CQ15EONK.js → copy-D-8y6iMN.js} +1 -1
  75. package/dist/assets/{copy-icon-C1fNHY3M.js → copy-icon-C9v8EtBA.js} +1 -1
  76. package/dist/assets/createLucideIcon-BCdY6lG5.js +1 -0
  77. package/dist/assets/{createReducer-Dnna-AUO.js → createReducer-B3rBsy4P.js} +1 -1
  78. package/dist/assets/{dagre-6UL2VRFP-khPiqbzB.js → dagre-6UL2VRFP-CX3NGWnu.js} +1 -1
  79. package/dist/assets/{data-grid-overlay-editor-Ca1ELXWD.js → data-grid-overlay-editor-BTyw6887.js} +1 -1
  80. package/dist/assets/{database-zap-B9y7063w.js → database-zap-k4ePIFAU.js} +1 -1
  81. package/dist/assets/{datasource-BZ3O2HG1.js → datasource-2_-ICoTV.js} +1 -1
  82. package/dist/assets/{dates-Cx863TsG.js → dates-CT5PUuFo.js} +1 -1
  83. package/dist/assets/{dependency-graph-panel-s45LIDec.js → dependency-graph-panel-z8kf8Tus.js} +4 -4
  84. package/dist/assets/{diagram-PSM6KHXK-C7-DZLOE.js → diagram-PSM6KHXK-C0Sfgs1J.js} +1 -1
  85. package/dist/assets/{diagram-QEK2KX5R-Ct2_XsRV.js → diagram-QEK2KX5R-DYSkW6Ju.js} +1 -1
  86. package/dist/assets/{diagram-S2PKOQOG-C82IZoPA.js → diagram-S2PKOQOG-CfHqQVo3.js} +1 -1
  87. package/dist/assets/{dialog-Dstm3Ubn.js → dialog-tQELcltn.js} +1 -1
  88. package/dist/assets/{dist-oarhZoo6.js → dist-BMEHQAhk.js} +1 -1
  89. package/dist/assets/{dist-PT7WsOdN.js → dist-DDGMbl6p.js} +1 -1
  90. package/dist/assets/{dist-BhLw_JdQ.js → dist-h1RhtzUB.js} +1 -1
  91. package/dist/assets/{documentation-panel-DRqbOPwM.js → documentation-panel-DIp1L-6Y.js} +1 -1
  92. package/dist/assets/{download-zuPzhwvm.js → download-CxmzcjnR.js} +1 -1
  93. package/dist/assets/{download-B9SUL40m.js → download-Dg7clfkc.js} +1 -1
  94. package/dist/assets/{dropdown-menu-D8v7RjW8.js → dropdown-menu-BUgFWmX1.js} +1 -1
  95. package/dist/assets/{edit-page-Dlr4v1eI.js → edit-page-DRwTenyP.js} +7 -7
  96. package/dist/assets/{ellipsis-5ip-qDfN.js → ellipsis-DfDsMPvA.js} +1 -1
  97. package/dist/assets/{ellipsis-vertical-C7jYiLCo.js → ellipsis-vertical-J1F7_WS9.js} +1 -1
  98. package/dist/assets/{empty-state-BAGXXrn8.js → empty-state-DrmGF88A.js} +1 -1
  99. package/dist/assets/{en-US-XLBup7bs.js → en-US-DU2jJCpg.js} +1 -1
  100. package/dist/assets/{erDiagram-Q2GNP2WA-Ftt2qDiM.js → erDiagram-Q2GNP2WA-BfRyUS6D.js} +1 -1
  101. package/dist/assets/{error-banner-JIexM8h5.js → error-banner-w4pz2qUB.js} +1 -1
  102. package/dist/assets/{error-panel-TqjIx6nC.js → error-panel-Cz3rrpG9.js} +1 -1
  103. package/dist/assets/{errors-B5AI4nf5.js → errors-CPlNr33a.js} +1 -1
  104. package/dist/assets/{es-CPSXxuS6.js → es-GXAIFcot.js} +5 -5
  105. package/dist/assets/{esm-BbNm2fB0.js → esm-BK6tLEHQ.js} +1 -1
  106. package/dist/assets/{eye-off-BhExYOph.js → eye-off-AK_9uodG.js} +1 -1
  107. package/dist/assets/{field-1uCBX4j4.js → field-D9jE8HEt.js} +1 -1
  108. package/dist/assets/{file-Cs1JbsV6.js → file-Ch78NKWp.js} +1 -1
  109. package/dist/assets/{file-explorer-panel-jku_uMQn.js → file-explorer-panel-BJWXa6fg.js} +1 -1
  110. package/dist/assets/{file-plus-corner-Da9I6dgU.js → file-plus-corner-CvAy4H5W.js} +1 -1
  111. package/dist/assets/{file-video-camera-DW3v07j2.js → file-video-camera-C3wGzBnE.js} +1 -1
  112. package/dist/assets/{floating-outline-CZbF47gm.js → floating-outline-BSd7WV6r.js} +1 -1
  113. package/dist/assets/{flowDiagram-NV44I4VS-Ca9aZp-3.js → flowDiagram-NV44I4VS-DKkZCUwG.js} +1 -1
  114. package/dist/assets/{focus-BxGelf2n.js → focus-CZLCQiuh.js} +1 -1
  115. package/dist/assets/{form-DQt-Ldr4.js → form-BQhIjeKF.js} +1 -1
  116. package/dist/assets/{formats-CobRswjh.js → formats-DGZwRUPy.js} +1 -1
  117. package/dist/assets/gallery-page-1AmSypJ6.js +1 -0
  118. package/dist/assets/{ganttDiagram-JELNMOA3-PYFPdyuJ.js → ganttDiagram-JELNMOA3-J8yLTqxn.js} +1 -1
  119. package/dist/assets/{gitGraphDiagram-NY62KEGX-CfGWoYOo.js → gitGraphDiagram-NY62KEGX-DXw3a-uS.js} +1 -1
  120. package/dist/assets/{glide-data-editor-8ek3zzAO.js → glide-data-editor-Cw8eE9Xn.js} +4 -4
  121. package/dist/assets/globals-DvWD0xHx.js +1 -0
  122. package/dist/assets/{home-page-xDhfcHL1.js → home-page-BaZhe30b.js} +1 -1
  123. package/dist/assets/{hooks-MQa8CSUr.js → hooks-B2h7NTXb.js} +1 -1
  124. package/dist/assets/{house-DhFkiXz7.js → house-BI81AWSn.js} +1 -1
  125. package/dist/assets/{html-to-image-DKqpcM7V.js → html-to-image-Cc7t14sm.js} +1 -1
  126. package/dist/assets/{icons-Dw4USSvE.js → icons-DjR3qLG_.js} +1 -1
  127. package/dist/assets/{index-DuqUGjtK.js → index-CQQ-Toaw.js} +18 -18
  128. package/dist/assets/index-GcHhnSIR.css +2 -0
  129. package/dist/assets/{infoDiagram-WHAUD3N6-Csbwq6Ks.js → infoDiagram-WHAUD3N6-32du45zK.js} +1 -1
  130. package/dist/assets/{input-DcAGg_4_.js → input-DHHmNa19.js} +1 -1
  131. package/dist/assets/{isValid-BLB2jskA.js → isValid-DpSSOU5z.js} +1 -1
  132. package/dist/assets/{journeyDiagram-XKPGCS4Q-DArwMxlY.js → journeyDiagram-XKPGCS4Q-Bmx7dA25.js} +1 -1
  133. package/dist/assets/{kanban-definition-3W4ZIXB7-CPjBJiO_.js → kanban-definition-3W4ZIXB7-DJzhLwsl.js} +1 -1
  134. package/dist/assets/{katex-DYp6oq7P.js → katex-CbllUrnh.js} +1 -1
  135. package/dist/assets/katex-axIMlGRc.js +1 -0
  136. package/dist/assets/{kbd-uRyPZ9w_.js → kbd-k3Sn_RwW.js} +1 -1
  137. package/dist/assets/kiosk-mode-S90PbrZr.js +1 -0
  138. package/dist/assets/{label-CL9Xfexh.js → label-C--1sWU6.js} +1 -1
  139. package/dist/assets/{layout-D-YPCWvX.js → layout-BRVYycwo.js} +4 -4
  140. package/dist/assets/{linear-BxhToEEF.js → linear-DWpCiijk.js} +1 -1
  141. package/dist/assets/{link-BsTPF7B0.js → link-DxicfMbs.js} +1 -1
  142. package/dist/assets/{links-BhgWpHdU.js → links-fh_IXIKE.js} +1 -1
  143. package/dist/assets/{logs-panel-DKSJRyF4.js → logs-panel-DU1PTK6I.js} +1 -1
  144. package/dist/assets/{loro_wasm_bg-BnAHSQ7o.js → loro_wasm_bg-CdafknAX.js} +2 -2
  145. package/dist/assets/loro_wasm_bg-WKwciKJa.wasm +0 -0
  146. package/dist/assets/{loro_wasm_bg-CKQGJrH5.js → loro_wasm_bg-aCueZs8k.js} +1 -1
  147. package/dist/assets/{maps-t9yNKYA8.js → maps-D2_Mq1pZ.js} +1 -1
  148. package/dist/assets/markdown-renderer-Y3WEBmX7.js +10 -0
  149. package/dist/assets/{menu-items-NblnuU_B.js → menu-items-vwmjPhjW.js} +1 -1
  150. package/dist/assets/mermaid-4DMBBIKO-Dn0v3H8Z.js +1 -0
  151. package/dist/assets/{mermaid-Bzaf_nA9.js → mermaid-dAaJQU1M.js} +3 -3
  152. package/dist/assets/{mhchem-DLDYYsJK.js → mhchem-2XRJK9de.js} +1 -1
  153. package/dist/assets/{mindmap-definition-VGOIOE7T-DVB4z5Yy.js → mindmap-definition-VGOIOE7T-whTFv8Zv.js} +1 -1
  154. package/dist/assets/{mode-CevBiFCd.js → mode-CTf4rB7H.js} +1 -1
  155. package/dist/assets/{multi-icon-CLzAg610.js → multi-icon-BWLbAXq5.js} +1 -1
  156. package/dist/assets/{multi-map-W4zci54U.js → multi-map-A4XNra08.js} +1 -1
  157. package/dist/assets/{name-cell-input-DwvdP1Ck.js → name-cell-input-Bmq-KdJ-.js} +1 -1
  158. package/dist/assets/{number-overlay-editor-CvIcqV0W.js → number-overlay-editor-65UcMR52.js} +1 -1
  159. package/dist/assets/{outline-panel-Bg_CP1WV.js → outline-panel-Cfpy5BTW.js} +1 -1
  160. package/dist/assets/{packages-panel-DBgrbk-q.js → packages-panel-C2SNGD_P.js} +1 -1
  161. package/dist/assets/{panel-context-C-UJlFyL.js → panel-context-2mVKaSYm.js} +1 -1
  162. package/dist/assets/panels-D47UNcb0.js +1 -0
  163. package/dist/assets/{pieDiagram-ADFJNKIX-vwwb5uL8.js → pieDiagram-ADFJNKIX-4n07I4VV.js} +1 -1
  164. package/dist/assets/{play-BPIh-ZEU.js → play-GLWQQs7F.js} +1 -1
  165. package/dist/assets/{plus-BD5o34_i.js → plus-B7DF33lD.js} +1 -1
  166. package/dist/assets/{popover-BZZFx3Q8.js → popover-B-131r4d.js} +1 -1
  167. package/dist/assets/{precisionRound-CU2C3Vxx.js → precisionRound-C3fmBb6j.js} +1 -1
  168. package/dist/assets/{process-output-Cl2N-HlT.js → process-output-CdIpMer6.js} +1 -1
  169. package/dist/assets/{quadrantDiagram-AYHSOK5B-Y8bEZ32G.js → quadrantDiagram-AYHSOK5B-CNm24EC2.js} +1 -1
  170. package/dist/assets/{react-BGmjiNul.js → react-Bj1aDYRI.js} +1 -1
  171. package/dist/assets/{react-dom-C9fstfnp.js → react-dom-CSu739Rf.js} +1 -1
  172. package/dist/assets/{react-plotly-CZMBCa5P.js → react-plotly-OyYr93y7.js} +1 -1
  173. package/dist/assets/{react-resizable-panels.browser.esm-BFvP7Upm.js → react-resizable-panels.browser.esm-Mq45xjWt.js} +1 -1
  174. package/dist/assets/{react-vega-BCDifxTe.js → react-vega-BEiHA2e9.js} +1 -1
  175. package/dist/assets/react-vega-BrNLU7si.js +1 -0
  176. package/dist/assets/readonly-python-code-o3TsTcFg.js +1 -0
  177. package/dist/assets/{refresh-ccw-DLEiQDS3.js → refresh-ccw-DN_xCV6A.js} +1 -1
  178. package/dist/assets/{refresh-cw-CQd-1kjx.js → refresh-cw-Dx8TEWFP.js} +1 -1
  179. package/dist/assets/{renderShortcut-zxgoVTeP.js → renderShortcut-Xr6z-RjZ.js} +1 -1
  180. package/dist/assets/request-registry-BWqkV683.js +1 -0
  181. package/dist/assets/{requests-BsVD4CdD.js → requests-B4FYHTZl.js} +1 -1
  182. package/dist/assets/requests-BQkjRazP.js +1 -0
  183. package/dist/assets/{requirementDiagram-UZGBJVZJ-ChckaTrX.js → requirementDiagram-UZGBJVZJ-B7BwuJGh.js} +1 -1
  184. package/dist/assets/{rotate-ccw-B_yU4f05.js → rotate-ccw-DPbJxVVN.js} +1 -1
  185. package/dist/assets/run-page-BRiD7IM8.js +1 -0
  186. package/dist/assets/{runs-X54OGDTq.js → runs-DyBOFmAK.js} +1 -1
  187. package/dist/assets/{sankeyDiagram-TZEHDZUN-DtU4O0-i.js → sankeyDiagram-TZEHDZUN-C8KpmdhC.js} +1 -1
  188. package/dist/assets/{save-PMHbdtqc.js → save-DZodxFnE.js} +1 -1
  189. package/dist/assets/{save-worker-DtF6B3PS.js → save-worker-CtJsIYIM.js} +3 -3
  190. package/dist/assets/{scratchpad-panel-CIxZIJ-1.js → scratchpad-panel-9Nh-KCKz.js} +1 -1
  191. package/dist/assets/{secrets-panel-TwfjwIVv.js → secrets-panel-CEMSgQv5.js} +1 -1
  192. package/dist/assets/{select-CX1Yi8J8.js → select-B7bfltkI.js} +1 -1
  193. package/dist/assets/{sequenceDiagram-WL72ISMW-BGXrTemh.js → sequenceDiagram-WL72ISMW-D0_AcPzd.js} +1 -1
  194. package/dist/assets/{session-panel-CNeWVmTR.js → session-panel-9cibvZIi.js} +1 -1
  195. package/dist/assets/{settings-DOXWMfVd.js → settings-OBbrbhij.js} +1 -1
  196. package/dist/assets/{share-Ba-pHZtq.js → share-rXkgGlhr.js} +1 -1
  197. package/dist/assets/{slides-component-CGMJm_kL.js → slides-component-C0UAH9QZ.js} +1 -1
  198. package/dist/assets/{snippets-panel-DMN_ZSXA.js → snippets-panel-BLiaEg0s.js} +1 -1
  199. package/dist/assets/{spec-D1kBp3jX.js → spec-Ch0xnJY4.js} +1 -1
  200. package/dist/assets/{spinner-DaIKav-i.js → spinner-DA8-7wQv.js} +1 -1
  201. package/dist/assets/{square-C8Tw_XXG.js → square-DPZjfUaq.js} +1 -1
  202. package/dist/assets/{square-function-CqXXKtIq.js → square-function-B6mgCeFJ.js} +1 -1
  203. package/dist/assets/{state-n1Xz9vt7.js → state-DAl4qLSi.js} +1 -1
  204. package/dist/assets/{state-BLsnFVwy.js → state-Q32Iqos3.js} +1 -1
  205. package/dist/assets/{stateDiagram-FKZM4ZOC-BwSf7RIr.js → stateDiagram-FKZM4ZOC-Dz_iVJd6.js} +1 -1
  206. package/dist/assets/stateDiagram-v2-4FDKWEC3-CupainMB.js +1 -0
  207. package/dist/assets/{switch-CfRu5JBF.js → switch-D5W4wgWK.js} +1 -1
  208. package/dist/assets/{table-qbh6Daed.js → table-BOsFCeLh.js} +1 -1
  209. package/dist/assets/{table-DZR6ewbN.js → table-CfDbAm78.js} +1 -1
  210. package/dist/assets/{terminal-C0fH4d_0.js → terminal-BLSSaFMR.js} +1 -1
  211. package/dist/assets/{textarea-3ZXdUni1.js → textarea-UfsPtSW1.js} +1 -1
  212. package/dist/assets/{time-EL4bnqqQ.js → time-CSCsAxXS.js} +1 -1
  213. package/dist/assets/{timeline-definition-IT6M3QCI-BZakpQwy.js → timeline-definition-IT6M3QCI-DPXEeoSm.js} +1 -1
  214. package/dist/assets/{toDate-CgbKQM5E.js → toDate-DETS9bBd.js} +1 -1
  215. package/dist/assets/{toggle-CWS-iCmF.js → toggle-CriARMQK.js} +1 -1
  216. package/dist/assets/{tooltip-DH6k_bBY.js → tooltip-C_WgOOcZ.js} +1 -1
  217. package/dist/assets/{tooltip-DxKBXCGp.js → tooltip-DqsDDLgU.js} +1 -1
  218. package/dist/assets/{tracing-zzjDz6Hy.js → tracing-BqFhwuOc.js} +1 -1
  219. package/dist/assets/tracing-panel-R9i0TrmX.js +2 -0
  220. package/dist/assets/{trash-2-CyqGun26.js → trash-2-B8SQYdQq.js} +1 -1
  221. package/dist/assets/{trash-DMqDgJ5r.js → trash-Cv0yH8fs.js} +1 -1
  222. package/dist/assets/{tree-DHpFOpHo.js → tree-Hg81oJmp.js} +1 -1
  223. package/dist/assets/{triangle-alert-B65rDESJ.js → triangle-alert-U93NZYDl.js} +1 -1
  224. package/dist/assets/{types-CS34eOZi.js → types-C1UhS3qM.js} +1 -1
  225. package/dist/assets/{types-CW-zyy80.js → types-DIb0tcCO.js} +1 -1
  226. package/dist/assets/{use-toast-rmUWldD_.js → use-toast-T0_cQDma.js} +1 -1
  227. package/dist/assets/useAddCell-CXRk4Ma4.js +1 -0
  228. package/dist/assets/{useAsyncData-BAVCkkQP.js → useAsyncData-CgmD3hjw.js} +1 -1
  229. package/dist/assets/{useBoolean-BjVFTMam.js → useBoolean-IZsSX_XF.js} +1 -1
  230. package/dist/assets/useCellActionButton-Du-bZZ06.js +1 -0
  231. package/dist/assets/{useDateFormatter-D89e9xZY.js → useDateFormatter-CieT0-H-.js} +1 -1
  232. package/dist/assets/{useDebounce-CU_caGaU.js → useDebounce-B28kFfrM.js} +1 -1
  233. package/dist/assets/{useDeepCompareMemoize-DiyglPgJ.js → useDeepCompareMemoize-CFtQU7An.js} +1 -1
  234. package/dist/assets/{useDeleteCell-B8CxYiji.js → useDeleteCell-D0DAGwMP.js} +1 -1
  235. package/dist/assets/{useDependencyPanelTab-YtWR0xDK.js → useDependencyPanelTab-CN5-nxOy.js} +1 -1
  236. package/dist/assets/useEvent-BhXAndur.js +1 -0
  237. package/dist/assets/{useEventListener-DIUKKfEy.js → useEventListener-Cb-RVVEn.js} +1 -1
  238. package/dist/assets/{useIframeCapabilities-DzIlROXe.js → useIframeCapabilities-CC8VH6kZ.js} +1 -1
  239. package/dist/assets/{useInstallPackage-C-gjrVjb.js → useInstallPackage-Co79H1lQ.js} +1 -1
  240. package/dist/assets/{useInterval-y9MtYlSD.js → useInterval-BNfubus2.js} +1 -1
  241. package/dist/assets/{useLifecycle-D35CBukS.js → useLifecycle-ClI_npeg.js} +1 -1
  242. package/dist/assets/{useNonce-_Aax6sXd.js → useNonce-CS26E0hA.js} +1 -1
  243. package/dist/assets/{useNotebookActions-Dfh_7NPm.js → useNotebookActions--9xrGXss.js} +1 -1
  244. package/dist/assets/{useNumberFormatter-CTkflual.js → useNumberFormatter-BX4DTYtT.js} +1 -1
  245. package/dist/assets/{usePress-CoEeT5jq.js → usePress-3CRs0fQg.js} +1 -1
  246. package/dist/assets/{useRunCells-rjrIgU8v.js → useRunCells-DaW_oMnr.js} +1 -1
  247. package/dist/assets/{useSplitCell-fcjSuBNO.js → useSplitCell-Cjr7nuBc.js} +1 -1
  248. package/dist/assets/{useTheme-EGf2UOFo.js → useTheme-CTORu22_.js} +1 -1
  249. package/dist/assets/utilities.esm-CME5sKpT.js +3 -0
  250. package/dist/assets/{utils-DXvhzCGS.js → utils-YqBXNpsM.js} +1 -1
  251. package/dist/assets/{vega-component-DAJbxD47.js → vega-component-7jd4fFCJ.js} +1 -1
  252. package/dist/assets/{vega-loader.browser-DXARUlxo.js → vega-loader.browser-BegSZk0G.js} +1 -1
  253. package/dist/assets/{worker-CUL1lW-N.js → worker-CyCdlLVf.js} +3 -3
  254. package/dist/assets/{workflow-CMjI9cxl.js → workflow-B12dAR4X.js} +1 -1
  255. package/dist/assets/{write-secret-modal-CgAvgY9w.js → write-secret-modal-DO-EOoNO.js} +1 -1
  256. package/dist/assets/{x-CoXDX2vQ.js → x-ZP5cObgf.js} +1 -1
  257. package/dist/assets/{xychartDiagram-PRI3JC2R-CAHFvN1H.js → xychartDiagram-PRI3JC2R-DINfGlOV.js} +1 -1
  258. package/dist/assets/{youtube-8p26v8EM.js → youtube--tNPNRy6.js} +1 -1
  259. package/dist/assets/zod-H_cgTO0M.js +40 -0
  260. package/dist/index.html +139 -139
  261. package/package.json +18 -18
  262. package/src/components/app-config/ai-config.tsx +11 -2
  263. package/src/components/app-config/user-config-form.tsx +0 -54
  264. package/src/components/chat/acp/__tests__/state.test.ts +69 -0
  265. package/src/components/chat/acp/state.ts +6 -6
  266. package/src/components/chat/chat-panel.tsx +47 -30
  267. package/src/components/data-table/__tests__/data-table.test.tsx +94 -2
  268. package/src/components/editor/actions/useCellActionButton.tsx +14 -1
  269. package/src/components/editor/cell/CreateCellButton.tsx +2 -1
  270. package/src/components/editor/cell/code/cell-editor.tsx +12 -0
  271. package/src/components/editor/database/__tests__/__snapshots__/as-code.test.ts.snap +15 -0
  272. package/src/components/editor/database/__tests__/as-code.test.ts +8 -0
  273. package/src/components/editor/database/as-code.ts +3 -0
  274. package/src/components/editor/database/schemas.ts +9 -0
  275. package/src/components/editor/renderers/cell-array.tsx +2 -1
  276. package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +12 -0
  277. package/src/components/pages/gallery-page.tsx +37 -6
  278. package/src/core/MarimoApp.tsx +12 -8
  279. package/src/core/ai/context/providers/file.ts +1 -1
  280. package/src/core/cells/__tests__/cells.test.ts +120 -0
  281. package/src/core/cells/__tests__/session.test.ts +37 -1
  282. package/src/core/cells/cells.ts +14 -0
  283. package/src/core/cells/session.ts +20 -8
  284. package/src/core/codemirror/language/languages/markdown.ts +7 -0
  285. package/src/core/config/feature-flag.tsx +0 -4
  286. package/src/core/dom/uiregistry.ts +4 -1
  287. package/src/core/run-app.tsx +11 -4
  288. package/src/core/static/__tests__/files.test.ts +195 -1
  289. package/src/core/static/files.ts +39 -9
  290. package/src/plugins/core/registerReactComponent.tsx +9 -1
  291. package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +164 -0
  292. package/src/plugins/impl/anywidget/AnyWidgetPlugin.tsx +7 -1
  293. package/src/utils/__tests__/blob.test.ts +3 -3
  294. package/src/utils/__tests__/id-tree.test.ts +22 -7
  295. package/src/utils/__tests__/mime-types.test.ts +8 -10
  296. package/src/utils/__tests__/url-parser.test.ts +22 -0
  297. package/src/utils/blob.ts +14 -27
  298. package/src/utils/id-tree.tsx +11 -19
  299. package/src/utils/mime-types.ts +5 -5
  300. package/src/utils/url-parser.ts +1 -1
  301. package/dist/assets/MarimoErrorOutput-DuaUr0W-.js +0 -7
  302. package/dist/assets/__vite-browser-external-BkzFKOxE.js +0 -1
  303. package/dist/assets/__vite-browser-external-CPyDqUtZ.js +0 -1
  304. package/dist/assets/blob-t6qcPM7K.js +0 -1
  305. package/dist/assets/channel-ownMsSXG.js +0 -1
  306. package/dist/assets/chat-panel-FiDMP_Qr.js +0 -3
  307. package/dist/assets/check-DdfN0k2d.js +0 -1
  308. package/dist/assets/classDiagram-2ON5EDUG-CSgD2v8F.js +0 -1
  309. package/dist/assets/classDiagram-v2-WZHVMYZB-YTETTIT0.js +0 -1
  310. package/dist/assets/compiler-runtime-DeeZ7FnK.js +0 -1
  311. package/dist/assets/createLucideIcon-CnW3RofX.js +0 -1
  312. package/dist/assets/gallery-page-D_5X4kKx.js +0 -1
  313. package/dist/assets/globals-D4t_HyAp.js +0 -1
  314. package/dist/assets/index-CikhHYAB.css +0 -2
  315. package/dist/assets/katex-BZrXWsTs.js +0 -1
  316. package/dist/assets/kiosk-mode-C9XznhoS.js +0 -1
  317. package/dist/assets/loro_wasm_bg-DV7Kb4_M.wasm +0 -0
  318. package/dist/assets/markdown-renderer-Bu12gPyJ.js +0 -10
  319. package/dist/assets/mermaid-4DMBBIKO-RE7Z6-fl.js +0 -1
  320. package/dist/assets/panels-CaoDGKmF.js +0 -1
  321. package/dist/assets/react-vega-DkHO4e2L.js +0 -1
  322. package/dist/assets/readonly-python-code-H1kzT-lB.js +0 -1
  323. package/dist/assets/request-registry-CjZcQuTP.js +0 -1
  324. package/dist/assets/requests-BSPGoGJL.js +0 -1
  325. package/dist/assets/run-page-BmTC7uxn.js +0 -1
  326. package/dist/assets/stateDiagram-v2-4FDKWEC3-SWMI9LKY.js +0 -1
  327. package/dist/assets/tracing-panel-DogOVTzf.js +0 -2
  328. package/dist/assets/useAddCell-mkD8zurm.js +0 -1
  329. package/dist/assets/useCellActionButton-BZ46_Pdt.js +0 -1
  330. package/dist/assets/useEvent-DO6uJBas.js +0 -1
  331. package/dist/assets/utilities.esm-CkqwfzLw.js +0 -3
  332. package/dist/assets/zod-Cg4WLWh2.js +0 -40
  333. /package/dist/assets/{copy-DHrHayPa.js → copy-BaRrAFL-.js} +0 -0
  334. /package/dist/assets/{defaultLocale-BLne0bXb.js → defaultLocale-B6z1Qyqt.js} +0 -0
  335. /package/dist/assets/{defaultLocale-JieDVWC_.js → defaultLocale-YteS-k_t.js} +0 -0
  336. /package/dist/assets/{emotion-is-prop-valid.esm-C59xfSYt.js → emotion-is-prop-valid.esm-Dangy3Bv.js} +0 -0
  337. /package/dist/assets/{extends-BiFDv3jB.js → extends-Dqvpuc10.js} +0 -0
  338. /package/dist/assets/{objectWithoutPropertiesLoose-DfWeGRFv.js → objectWithoutPropertiesLoose-DoKw85w0.js} +0 -0
  339. /package/dist/assets/{ordinal-C93T4L8H.js → ordinal-DAqJmfoU.js} +0 -0
  340. /package/dist/assets/{prop-types-DaaA-ptl.js → prop-types-DVDiRdwc.js} +0 -0
  341. /package/dist/assets/{purify.es-DZrAQFIu.js → purify.es-B-nzWya6.js} +0 -0
  342. /package/dist/assets/{range-1DwpgXvM.js → range-7fnH_zLA.js} +0 -0
@@ -1,23 +1,23 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./esm-DvGqZhsW.js","./chunk-LvLJmgfZ.js","./dist-Z4EybR_c.js","./dist-Gqv0jSNr.js","./dist-ChS0Dc_R.js","./dist-DBwNzi3C.js","./dist-BuwU3nUf.js","./dist-BZe-2kC9.js","./dist-B407S7D_.js","./dist-BIKFl48f.js","./dist-h7FGpi6W.js","./dist-Bpsss9Eu.js","./dist-BSxIk2Vq.js","./dist-TiFCI16_.js","./dist-B0VqT_4z.js","./dist-8LCoAaYJ.js","./dist-qIIHXwC_.js","./dist-SpkGM8op.js","./dist-DzjeKTWA.js","./dist-BcotcL0h.js","./dist-BwcKpTZt.js","./dist-OZngTf6n.js","./dist-B6bNYRJb.js","./dist-B1CD4nG7.js","./dist-YQMqR1ri.js","./dist-BtUqLXS9.js","./dist-DstaRs6N.js","./dist-Cayq-K1c.js","./dist-1nstYXhq.js","./dist-DGPkGdD2.js","./dist-Cip4Ndtd.js","./dist-BYyu59D8.js","./dist-BKMynip3.js","./dist-DLCy1STk.js","./dist-BP1tfplb.js","./dist-CNknMFYG.js","./dist-DrFRlZJz.js","./dist-Bx6F_B1m.js","./dist-DXT0W0hS.js","./dist-DsxhNXOv.js","./dist-2qScxWoK.js","./dist-rT8uZk_k.js","./apl-DpOiWl6J.js","./apl-CpVTW0fY.js","./asciiarmor-DVIuYySe.js","./asciiarmor-qDK46YPd.js","./asn1-CWHjZJq6.js","./asn1-s2ZJql-T.js","./brainfuck-CIKJewgG.js","./brainfuck-5fD7ZBSv.js","./cobol-Dw9T4cw-.js","./cobol-CKARYRbQ.js","./clike-wo4CVrJj.js","./clike-D58k-9vu.js","./clojure-CTxjMkBI.js","./clojure-Dkfjc-Fr.js","./css-BJsW3aHa.js","./css-Bmqfl4iE.js","./cmake-aJ0aGjat.js","./cmake-ffkxaUPf.js","./coffeescript-B5HCKl_0.js","./coffeescript-Dz_r13Pd.js","./commonlisp-C578hhl1.js","./commonlisp-EavL1_-N.js","./cypher-DBO3MHmN.js","./cypher-BKXIqXpT.js","./python-D4S7tVrv.js","./python-C7HNB5A8.js","./crystal-D84c1nzD.js","./crystal-BQ8grXRY.js","./d-KvHiAR3H.js","./d-DRfFJaS4.js","./diff-BmUpKGx-.js","./diff-BWk1g4qN.js","./dockerfile-BPCA7-hu.js","./simple-mode-BtxX-F6Z.js","./dtd-Dwf-AbUl.js","./dtd-C1gvGnbI.js","./dylan-VHUB-7ez.js","./dylan-D26gjyBo.js","./ecl-DvGrObaA.js","./ecl-D_pghsRW.js","./eiffel-CUYga93e.js","./eiffel-CQeRT5l7.js","./elm-BhMhmEP6.js","./elm-BMJejWwJ.js","./erlang-D4xbdJFD.js","./erlang-DTDt7sE1.js","./factor-C0grrWrC.js","./factor-Ccw_GUUV.js","./forth-CSTdXn4A.js","./forth-DLug1Uos.js","./fortran-fENQO2l9.js","./fortran-CfPd9x83.js","./mllike-BtxCpmpf.js","./mllike-VhUq11ot.js","./gas-CPJMP4zj.js","./gas-C1vwqe1-.js","./gherkin-CiUmN4EE.js","./gherkin-DxFhlJYL.js","./groovy-DMooZA1X.js","./groovy-AqjvKzmp.js","./haskell-sDlThg6u.js","./haskell-B9BMJXS_.js","./haxe-Do80ITri.js","./haxe-CFd4aFZH.js","./idl-DFPg6k4F.js","./idl-DKlFwAHI.js","./javascript-BGc4iHiT.js","./javascript-BMuus-3E.js","./julia-BHNHVraD.js","./julia-DGv2rboF.js","./livescript-Bv2FpOTI.js","./livescript-51GCvdcX.js","./lua-BysKHKPZ.js","./lua-BwsAaftY.js","./mirc-D5fMSrXQ.js","./mirc-CvS1f8zr.js","./mathematica-BBTHoTvM.js","./mathematica-Du4amQ2X.js","./modelica-CRQcZpK6.js","./modelica-CjlHUZat.js","./mumps-g7ooySbl.js","./mumps-4o8IRFVU.js","./mbox-DeT9_lvk.js","./mbox-DKL-l6mb.js","./nsis-BtyCmCHZ.js","./nsis-CzZqoCdu.js","./ntriples-DLyxF-NO.js","./ntriples-D0zMsGJ-.js","./octave-CFXP_zzr.js","./octave-CpJ40RVG.js","./oz-CrQbC0N_.js","./oz-W9l5CbXg.js","./pascal-CCSZgYZH.js","./pascal-BZtdYBm4.js","./perl-Bc1MycMl.js","./perl-Q79ziUtd.js","./pig-CDr04RdE.js","./pig-Dn9ueYxG.js","./powershell-DcvrUwmh.js","./powershell-DfXPJ56g.js","./properties-Y8OgFJMt.js","./properties-DRrw--9g.js","./protobuf-Dyx-ENis.js","./protobuf-5jBh6Y7Q.js","./pug-T7qjkmFh.js","./pug-BqLMXh-D.js","./puppet-BzYSg90u.js","./puppet-Bql5dDjm.js","./q-YpqabiSl.js","./q-CW9lnZXb.js","./r-DzpuVbmQ.js","./r-DmuxMz9j.js","./rpm-DlmAEsH3.js","./rpm-2BQZRXYJ.js","./ruby-BHSBK3B4.js","./ruby-B-FyRKB2.js","./sas-DmQmrPAn.js","./sas-Q-94el51.js","./scheme-CZHvt0eC.js","./scheme-By445Ne_.js","./shell-BJzvpTMz.js","./shell-CezKrT5T.js","./sieve-DGjPhm-6.js","./sieve-MRWdUbX3.js","./smalltalk-DaG60CSr.js","./smalltalk-C0KZrhPl.js","./sparql-CN49rXKB.js","./sparql-CIMoBhOL.js","./stylus-CzHZ_0CL.js","./stylus-BxV1gbJN.js","./swift-5fr5bTbW.js","./swift-C7ozIpB2.js","./stex-D6sqtveI.js","./stex-CtmkcLz7.js","./verilog-hsHogyKv.js","./verilog-CixbCKyb.js","./tcl-D5oaR_GS.js","./tcl-D9BrnXdg.js","./textile-CJ5e8-7o.js","./textile-8cDJUs1C.js","./toml-D9QwsDZO.js","./toml-Dtc3-sql.js","./troff-DlwQJbfr.js","./troff-CxUT34rC.js","./ttcn-DUvoO9Vo.js","./ttcn-BiVwbsr5.js","./ttcn-cfg-Cj-t-B3M.js","./ttcn-cfg-BLBfLtVM.js","./turtle-DzvxCIjc.js","./turtle-DqTQI7WU.js","./webidl-CqjZNx5V.js","./webidl-DAqkXtNt.js","./vb-Caf126uo.js","./vb-D-mN5USJ.js","./vbscript-BgRl-LR8.js","./vbscript-BHlqX42l.js","./velocity-CpvfwasF.js","./velocity-BX6395is.js","./vhdl-FciHazR1.js","./vhdl-CofOR-02.js","./xquery-DpTaL2IT.js","./xquery-wPbfv0-o.js","./yacas-D6bbkHsk.js","./yacas-B5Zk1avC.js","./z80-MlujNizn.js","./z80-C0HuDTqd.js","./mscgen-BfscU11q.js","./mscgen-26STiUsc.js","./dist-QPLTo43F.js","./dist-GCDTTvNx.js","./dist-C0QU3Oay.js","./node-sql-parser-UQ9Ur_LP.js"])))=>i.map(i=>d[i]);
2
- var QR=Object.defineProperty;var GR=(Ki,Yr,Na)=>Yr in Ki?QR(Ki,Yr,{enumerable:!0,configurable:!0,writable:!0,value:Na}):Ki[Yr]=Na;var ke=(Ki,Yr,Na)=>GR(Ki,typeof Yr!="symbol"?Yr+"":Yr,Na);import{a as Tu,n as U2,o as JR,r as XR,s as gh,t as Ee}from"./chunk-LvLJmgfZ.js";import{c as K2,i as lt,l as Q2,p as ze,r as YR,s as ZR,u as Zn}from"./useEvent-DO6uJBas.js";import{t as Ru}from"./react-BGmjiNul.js";import{t as e4}from"./react-dom-C9fstfnp.js";import{B as t4,N as n4,P as G2,R as J2,T as X2,k as r4,w as i4}from"./zod-Cg4WLWh2.js";import{t as Jr}from"./compiler-runtime-DeeZ7FnK.js";import{f as a4}from"./_Uint8Array-BGESiCQL.js";import{n as o4}from"./toString-DlRqgfqz.js";import{t as s4}from"./toInteger-CDcO32Gx.js";import{d as l4}from"./_baseIsEqual-B9N9Mw_N.js";import{n as c4,u as u4}from"./merge-BBX6ug-N.js";import{n as _s}from"./assertNever-CBU83Y6o.js";import{a as yh,i as d4,o as f4,r as p4,s as h4,t as m4}from"./useLifecycle-D35CBukS.js";import{t as g4}from"./_baseProperty-NKyJO2oh.js";import{t as Y2}from"./debounce-B3mjKxHe.js";import{a as ui,d as Se,o as Z2,s as y4}from"./hotkeys-BHHWjLlp.js";import{t as In}from"./invariant-CAG_dYON.js";import{f as ew,t as v4}from"./utils-DXvhzCGS.js";import{S as vh,r as b4,y as w4}from"./config-C3-Nti03.js";import{r as tw}from"./useEventListener-DIUKKfEy.js";import{t as _4}from"./jsx-runtime-ZmTK25f3.js";import{t as nw}from"./button-YC1gW_kJ.js";import{t as Du}from"./cn-BKtXLv3a.js";import{A as x4,At as k4,Bt as S4,C as C4,D as E4,Et as rw,Gt as iw,H as aw,Ht as ow,I as sw,J as Ou,Jt as xs,Ot as ks,Pt as T4,Rt as Pu,S as R4,St as Ra,T as lw,U as D4,Ut as Mu,Vt as Dl,W as O4,Wt as P4,Xt as Ss,Yt as vo,_t as M4,at as Kt,b as cw,ct as Ol,f as uw,it as L4,k as N4,kt as bh,l as le,mt as I4,nt as dw,ot as A4,p as q4,qt as Bi,rt as Hi,u as fw,ut as j4,xt as wh,z as pw,zt as mn}from"./dist-DBwNzi3C.js";import{A as z4,E as F4,S as B4,T as H4,_ as V4,b as $4,d as hw,f as W4,h as U4,m as K4,n as Q4,o as _h,p as G4,s as J4,t as X4,u as Y4,v as Z4,w as eD,x as tD}from"./dist-CtsanegT.js";import{a as mw,i as nD,n as di,o as gw,p as xh,s as Pl}from"./once-Bul8mtFs.js";import{t as rD}from"./capabilities-MM7JYRxj.js";import{t as iD}from"./cjs-CH5Rj0g8.js";import{t as Ml}from"./createReducer-Dnna-AUO.js";import{d as yw,l as vw,n as aD,o as bw,p as oD,r as Lu}from"./dist-ChS0Dc_R.js";import{i as kh,r as Sh}from"./main-U5Goe76G.js";import{n as ww,t as sD}from"./useNonce-_Aax6sXd.js";import{t as Vi}from"./requests-BsVD4CdD.js";import{a as lD,c as cD,d as uD,f as _w,i as dD,l as fD,n as pD,o as Ch,r as hD,s as Eh,t as mD,u as gD}from"./dist-Gqv0jSNr.js";import{t as Tt}from"./createLucideIcon-CnW3RofX.js";import{t as yD}from"./check-DdfN0k2d.js";import{t as vD,u as bD}from"./toDate-CgbKQM5E.js";import{t as wD}from"./database-zap-B9y7063w.js";import{n as _D,t as Nu}from"./DeferredRequestRegistry-CO2AyNfd.js";import{t as mr}from"./badge-Ce8wRjuQ.js";import{t as ce}from"./preload-helper-DItdS47A.js";import{a as xw,s as xD}from"./dist-Cayq-K1c.js";import{a as kD,i as Th,n as SD,r as kw,t as CD}from"./dist-BYyu59D8.js";import{n as ED}from"./stex-CtmkcLz7.js";import{t as Ll}from"./use-toast-rmUWldD_.js";import{n as Rh}from"./paths-Dfii2bN8.js";import{n as TD}from"./useTheme-EGf2UOFo.js";import{E as RD,S as DD,_ as Dh,w as Sw,x as OD}from"./Combination-C_mRvd_Z.js";import{a as PD,c as MD,i as Oh,m as LD,n as ND,o as Cw,r as ID,s as AD,t as qD}from"./select-CX1Yi8J8.js";import{l as jD}from"./dist-PT7WsOdN.js";import{i as zD,t as Ph}from"./tooltip-DH6k_bBY.js";let Ew,Tw,Rw,Iu,Dw,Nl,Il,Ow,Pw,Au,Mw,Mh,Lw,Nw,qu,gr,Iw,Aw,Lh,qw,jw,Da,ju,zw,Pr,Nh,Ih,Ah,qh,jh,Fw,$i,zh,zu,Bw,Hw,Mr,Fh,Bh,Hh,Vh,$h,Vw,$w,Ww,Wh,Cs,Al,Uw,Uh,Kh,Qh,Kw,Gh,ql,fi,Qw,bo,Oa,Fu,Gw,Bu,jl,Jh,Jw,Xh,Xw,Hu,Yh,Zh,Yw,Zw,e_,em,Pa,t_,n_,zl,tm,Fl,r_,i_,wo,a_,o_,Es,Vu,s_,l_,nm,rm,c_,im,am,Ts,u_,d_,om,Bl,sm,lm,cm,Hl,um,dm,fm,$u,Wu,f_,p_,pm,h_,Uu,yr,Ku,Qu,_o,m_,Gu,hm,mm,g_,gm,y_,v_,Lr,b_,ym,w_,__,vm,bm,x_,Ju,Xu,Yu,wm,k_,S_,_m,C_,E_,Wi,Zu,T_,Vl,Pt,R_,ed,Rs,xm,D_,Xr,O_,km,td,nd,P_,M_,$l,Sm,L_,N_,Wl,I_,A_,rd,q_,xo,Cm,id,j_,ad,z_,Em,F_,od,Tm,B_,H_,V_,sd,Ul,Ui,Rm,ld,Dm,Wn,$_,W_,er,cd,U_,Om,K_,Q_,G_,J_,X_,Y_,Ma,Z_,ko,ex,Pm,tx,nx,Kl,ud,rx,La,Mm,ix,ax,dd,ox,fd,sx,Lm,lx,Nm,bt,cx,ux,dx,Im,So,Ql,Am,FD=(async()=>{var zr,bf,$a;let Ki,Yr,Na,jm;Ki=Ee((e=>{function n(re,se){var Q=re.length;re.push(se);e:for(;0<Q;){var Le=Q-1>>>1,Fe=re[Le];if(0<s(Fe,se))re[Le]=se,re[Q]=Fe,Q=Le;else break e}}function i(re){return re.length===0?null:re[0]}function o(re){if(re.length===0)return null;var se=re[0],Q=re.pop();if(Q!==se){re[0]=Q;e:for(var Le=0,Fe=re.length,et=Fe>>>1;Le<et;){var Be=2*(Le+1)-1,je=re[Be],Pe=Be+1,Ae=re[Pe];if(0>s(je,Q))Pe<Fe&&0>s(Ae,je)?(re[Le]=Ae,re[Pe]=Q,Le=Pe):(re[Le]=je,re[Be]=Q,Le=Be);else if(Pe<Fe&&0>s(Ae,Q))re[Le]=Ae,re[Pe]=Q,Le=Pe;else break e}}return se}function s(re,se){var Q=re.sortIndex-se.sortIndex;return Q===0?re.id-se.id:Q}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var p=[],y=[],w=1,_=null,C=3,E=!1,T=!1,I=!1,$=!1,V=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function K(re){for(var se=i(y);se!==null;){if(se.callback===null)o(y);else if(se.startTime<=re)o(y),se.sortIndex=se.expirationTime,n(p,se);else break;se=i(y)}}function pe(re){if(I=!1,K(re),!T)if(i(p)!==null)T=!0,P||(P=!0,J());else{var se=i(y);se!==null&&Z(pe,se.startTime-re)}}var P=!1,A=-1,W=5,de=-1;function fe(){return $?!0:!(e.unstable_now()-de<W)}function we(){if($=!1,P){var re=e.unstable_now();de=re;var se=!0;try{e:{T=!1,I&&(I=!1,F(A),A=-1),E=!0;var Q=C;try{t:{for(K(re),_=i(p);_!==null&&!(_.expirationTime>re&&fe());){var Le=_.callback;if(typeof Le=="function"){_.callback=null,C=_.priorityLevel;var Fe=Le(_.expirationTime<=re);if(re=e.unstable_now(),typeof Fe=="function"){_.callback=Fe,K(re),se=!0;break t}_===i(p)&&o(p),K(re)}else o(p);_=i(p)}if(_!==null)se=!0;else{var et=i(y);et!==null&&Z(pe,et.startTime-re),se=!1}}break e}finally{_=null,C=Q,E=!1}se=void 0}}finally{se?J():P=!1}}}var J;if(typeof N=="function")J=function(){N(we)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,Ce=be.port2;be.port1.onmessage=we,J=function(){Ce.postMessage(null)}}else J=function(){V(we,0)};function Z(re,se){A=V(function(){re(e.unstable_now())},se)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(re){re.callback=null},e.unstable_forceFrameRate=function(re){0>re||125<re?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<re?Math.floor(1e3/re):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(re){switch(C){case 1:case 2:case 3:var se=3;break;default:se=C}var Q=C;C=se;try{return re()}finally{C=Q}},e.unstable_requestPaint=function(){$=!0},e.unstable_runWithPriority=function(re,se){switch(re){case 1:case 2:case 3:case 4:case 5:break;default:re=3}var Q=C;C=re;try{return se()}finally{C=Q}},e.unstable_scheduleCallback=function(re,se,Q){var Le=e.unstable_now();switch(typeof Q=="object"&&Q?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?Le+Q:Le):Q=Le,re){case 1:var Fe=-1;break;case 2:Fe=250;break;case 5:Fe=1073741823;break;case 4:Fe=1e4;break;default:Fe=5e3}return Fe=Q+Fe,re={id:w++,callback:se,priorityLevel:re,startTime:Q,expirationTime:Fe,sortIndex:-1},Q>Le?(re.sortIndex=Q,n(y,re),i(p)===null&&re===i(y)&&(I?(F(A),A=-1):I=!0,Z(pe,Q-Le))):(re.sortIndex=Fe,n(p,re),T||E||(T=!0,P||(P=!0,J()))),re},e.unstable_shouldYield=fe,e.unstable_wrapCallback=function(re){var se=C;return function(){var Q=C;C=se;try{return re.apply(this,arguments)}finally{C=Q}}}})),Yr=Ee(((e,n)=>{n.exports=Ki()})),Na=Ee((e=>{var n=Yr(),i=Ru(),o=e4();function s(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function d(t){var r=t,a=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,r.flags&4098&&(a=r.return),t=r.return;while(t)}return r.tag===3?a:null}function f(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function p(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function y(t){if(d(t)!==t)throw Error(s(188))}function w(t){var r=t.alternate;if(!r){if(r=d(t),r===null)throw Error(s(188));return r===t?t:null}for(var a=t,l=r;;){var h=a.return;if(h===null)break;var g=h.alternate;if(g===null){if(l=h.return,l!==null){a=l;continue}break}if(h.child===g.child){for(g=h.child;g;){if(g===a)return y(h),t;if(g===l)return y(h),r;g=g.sibling}throw Error(s(188))}if(a.return!==l.return)a=h,l=g;else{for(var S=!1,D=h.child;D;){if(D===a){S=!0,a=h,l=g;break}if(D===l){S=!0,l=h,a=g;break}D=D.sibling}if(!S){for(D=g.child;D;){if(D===a){S=!0,a=g,l=h;break}if(D===l){S=!0,l=g,a=h;break}D=D.sibling}if(!S)throw Error(s(189))}}if(a.alternate!==l)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?t:r}function _(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=_(t),r!==null)return r;t=t.sibling}return null}var C=Object.assign,E=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),K=Symbol.for("react.context"),pe=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),de=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),we=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function be(t){return typeof t!="object"||!t?null:(t=J&&t[J]||t["@@iterator"],typeof t=="function"?t:null)}var Ce=Symbol.for("react.client.reference");function Z(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Ce?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case $:return"Fragment";case F:return"Profiler";case V:return"StrictMode";case P:return"Suspense";case A:return"SuspenseList";case fe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case I:return"Portal";case K:return t.displayName||"Context";case N:return(t._context.displayName||"Context")+".Consumer";case pe:var r=t.render;return t=t.displayName,t||(t=(t=r.displayName||r.name||"",t===""?"ForwardRef":"ForwardRef("+t+")")),t;case W:return r=t.displayName||null,r===null?Z(t.type)||"Memo":r;case de:r=t._payload,t=t._init;try{return Z(t(r))}catch{}}return null}var re=Array.isArray,se=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Le={pending:!1,data:null,method:null,action:null},Fe=[],et=-1;function Be(t){return{current:t}}function je(t){0>et||(t.current=Fe[et],Fe[et]=null,et--)}function Pe(t,r){et++,Fe[et]=t.current,t.current=r}var Ae=Be(null),ft=Be(null),mt=Be(null),Dn=Be(null);function un(t,r){switch(Pe(mt,r),Pe(ft,t),Pe(Ae,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?v2(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=v2(r),t=b2(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}je(Ae),Pe(Ae,t)}function We(){je(Ae),je(ft),je(mt)}function tn(t){t.memoizedState!==null&&Pe(Dn,t);var r=Ae.current,a=b2(r,t.type);r!==a&&(Pe(ft,t),Pe(Ae,a))}function wt(t){ft.current===t&&(je(Ae),je(ft)),Dn.current===t&&(je(Dn),Cl._currentValue=Le)}var vn,vr;function pt(t){if(vn===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);vn=r&&r[1]||"",vr=-1<a.stack.indexOf(`
2
+ var QR=Object.defineProperty;var GR=(Ki,Yr,Na)=>Yr in Ki?QR(Ki,Yr,{enumerable:!0,configurable:!0,writable:!0,value:Na}):Ki[Yr]=Na;var ke=(Ki,Yr,Na)=>GR(Ki,typeof Yr!="symbol"?Yr+"":Yr,Na);import{a as Eu,n as U2,o as JR,r as XR,s as gh,t as Ee}from"./chunk-LvLJmgfZ.js";import{c as K2,i as lt,l as Q2,p as ze,r as YR,s as ZR,u as Zn}from"./useEvent-BhXAndur.js";import{t as Tu}from"./react-Bj1aDYRI.js";import{t as e4}from"./react-dom-CSu739Rf.js";import{B as t4,N as n4,P as G2,R as J2,T as X2,k as r4,w as i4}from"./zod-H_cgTO0M.js";import{t as Jr}from"./compiler-runtime-B3qBwwSJ.js";import{f as a4}from"./_Uint8Array-BGESiCQL.js";import{n as o4}from"./toString-DlRqgfqz.js";import{t as s4}from"./toInteger-CDcO32Gx.js";import{d as l4}from"./_baseIsEqual-B9N9Mw_N.js";import{n as c4,u as u4}from"./merge-BBX6ug-N.js";import{n as _s}from"./assertNever-CBU83Y6o.js";import{a as yh,i as d4,o as f4,r as p4,s as h4,t as m4}from"./useLifecycle-ClI_npeg.js";import{t as g4}from"./_baseProperty-NKyJO2oh.js";import{t as Y2}from"./debounce-B3mjKxHe.js";import{a as ui,d as Se,o as Z2,s as y4}from"./hotkeys-BHHWjLlp.js";import{t as In}from"./invariant-CAG_dYON.js";import{f as ew,t as v4}from"./utils-YqBXNpsM.js";import{S as vh,r as b4,y as w4}from"./config-D2-Bw6QC.js";import{r as tw}from"./useEventListener-Cb-RVVEn.js";import{t as _4}from"./jsx-runtime-ZmTK25f3.js";import{t as nw}from"./button-CZ3Cs4qb.js";import{t as Ru}from"./cn-BKtXLv3a.js";import{A as x4,At as k4,Bt as S4,C as C4,D as E4,Et as rw,Gt as iw,H as aw,Ht as ow,I as sw,J as Du,Jt as xs,Ot as ks,Pt as T4,Rt as Ou,S as R4,St as Ra,T as lw,U as D4,Ut as Pu,Vt as Dl,W as O4,Wt as P4,Xt as Ss,Yt as vo,_t as M4,at as Kt,b as cw,ct as Ol,f as uw,it as L4,k as N4,kt as bh,l as le,mt as I4,nt as dw,ot as A4,p as q4,qt as Bi,rt as Hi,u as fw,ut as j4,xt as wh,z as pw,zt as mn}from"./dist-DBwNzi3C.js";import{A as z4,E as F4,S as B4,T as H4,_ as V4,b as $4,d as hw,f as W4,h as U4,m as K4,n as Q4,o as _h,p as G4,s as J4,t as X4,u as Y4,v as Z4,w as eD,x as tD}from"./dist-CtsanegT.js";import{a as mw,i as nD,n as di,o as gw,p as xh,s as Pl}from"./once-Bul8mtFs.js";import{t as rD}from"./capabilities-MM7JYRxj.js";import{t as iD}from"./cjs-CH5Rj0g8.js";import{t as Ml}from"./createReducer-B3rBsy4P.js";import{d as yw,l as vw,n as aD,o as bw,p as oD,r as Mu}from"./dist-ChS0Dc_R.js";import{i as kh,r as Sh}from"./main-U5Goe76G.js";import{n as ww,t as sD}from"./useNonce-CS26E0hA.js";import{t as Vi}from"./requests-B4FYHTZl.js";import{a as lD,c as cD,d as uD,f as _w,i as dD,l as fD,n as pD,o as Ch,r as hD,s as Eh,t as mD,u as gD}from"./dist-Gqv0jSNr.js";import{t as Tt}from"./createLucideIcon-BCdY6lG5.js";import{t as yD}from"./check-Dr3SxUsb.js";import{t as vD,u as bD}from"./toDate-DETS9bBd.js";import{t as wD}from"./database-zap-k4ePIFAU.js";import{n as _D,t as Lu}from"./DeferredRequestRegistry-tv0PqJZ0.js";import{t as mr}from"./badge-D4keL3YC.js";import{t as ce}from"./preload-helper-DItdS47A.js";import{a as xw,s as xD}from"./dist-Cayq-K1c.js";import{a as kD,i as Th,n as SD,r as kw,t as CD}from"./dist-BYyu59D8.js";import{n as ED}from"./stex-CtmkcLz7.js";import{t as Ll}from"./use-toast-T0_cQDma.js";import{n as Rh}from"./paths-Dfii2bN8.js";import{n as TD}from"./useTheme-CTORu22_.js";import{E as RD,S as DD,_ as Dh,w as Sw,x as OD}from"./Combination-izwufzWe.js";import{a as PD,c as MD,i as Oh,m as LD,n as ND,o as Cw,r as ID,s as AD,t as qD}from"./select-B7bfltkI.js";import{l as jD}from"./dist-DDGMbl6p.js";import{i as zD,t as Ph}from"./tooltip-C_WgOOcZ.js";let Ew,Tw,Rw,Dw,Ow,Nl,Il,Pw,Mw,Nu,Lw,Mh,Nw,Iw,Iu,gr,Aw,qw,Lh,jw,zw,Da,Au,Fw,Pr,Nh,Ih,qu,Ah,qh,Bw,Hw,jh,ju,Vw,$w,Mr,zh,Fh,Bh,Hh,Vh,Ww,Uw,Kw,$h,Cs,$i,Qw,Wh,Uh,Kh,Gw,Qh,Al,zu,Jw,bo,Oa,fi,Xw,Fu,ql,Gh,Yw,Jh,Zw,Bu,Xh,Yh,e_,Hu,t_,Zh,Pa,em,n_,jl,tm,zl,r_,i_,wo,a_,o_,Es,Vu,s_,l_,nm,rm,im,am,om,Ts,c_,u_,sm,Fl,lm,cm,um,Bl,d_,dm,fm,$u,pm,f_,p_,hm,h_,Wu,yr,mm,Uu,_o,m_,Ku,gm,ym,g_,vm,y_,v_,Lr,b_,bm,w_,__,wm,_m,Qu,Gu,Ju,Xu,xm,x_,k_,km,S_,C_,Wi,Yu,E_,Hl,Pt,T_,Zu,Rs,ed,R_,Xr,D_,Sm,td,O_,P_,M_,Vl,Cm,L_,N_,I_,A_,q_,nd,j_,xo,Em,rd,z_,F_,B_,Tm,H_,id,ad,V_,$_,W_,od,sd,Ui,Rm,ld,Dm,Wn,$l,U_,er,cd,K_,Om,Q_,G_,Pm,J_,X_,Y_,Ma,Z_,ko,ex,Mm,tx,Wl,Ul,ud,nx,La,Lm,rx,ix,dd,ax,fd,ox,Nm,sx,Im,bt,lx,cx,ux,Am,So,Kl,dx,FD=(async()=>{var zr,bf,$a;let Ki,Yr,Na,jm;Ki=Ee((e=>{function n(re,se){var Q=re.length;re.push(se);e:for(;0<Q;){var Le=Q-1>>>1,Fe=re[Le];if(0<s(Fe,se))re[Le]=se,re[Q]=Fe,Q=Le;else break e}}function i(re){return re.length===0?null:re[0]}function o(re){if(re.length===0)return null;var se=re[0],Q=re.pop();if(Q!==se){re[0]=Q;e:for(var Le=0,Fe=re.length,et=Fe>>>1;Le<et;){var Be=2*(Le+1)-1,je=re[Be],Pe=Be+1,Ae=re[Pe];if(0>s(je,Q))Pe<Fe&&0>s(Ae,je)?(re[Le]=Ae,re[Pe]=Q,Le=Pe):(re[Le]=je,re[Be]=Q,Le=Be);else if(Pe<Fe&&0>s(Ae,Q))re[Le]=Ae,re[Pe]=Q,Le=Pe;else break e}}return se}function s(re,se){var Q=re.sortIndex-se.sortIndex;return Q===0?re.id-se.id:Q}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var p=[],y=[],w=1,_=null,C=3,E=!1,T=!1,I=!1,$=!1,V=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function K(re){for(var se=i(y);se!==null;){if(se.callback===null)o(y);else if(se.startTime<=re)o(y),se.sortIndex=se.expirationTime,n(p,se);else break;se=i(y)}}function pe(re){if(I=!1,K(re),!T)if(i(p)!==null)T=!0,P||(P=!0,J());else{var se=i(y);se!==null&&Z(pe,se.startTime-re)}}var P=!1,A=-1,W=5,de=-1;function fe(){return $?!0:!(e.unstable_now()-de<W)}function we(){if($=!1,P){var re=e.unstable_now();de=re;var se=!0;try{e:{T=!1,I&&(I=!1,F(A),A=-1),E=!0;var Q=C;try{t:{for(K(re),_=i(p);_!==null&&!(_.expirationTime>re&&fe());){var Le=_.callback;if(typeof Le=="function"){_.callback=null,C=_.priorityLevel;var Fe=Le(_.expirationTime<=re);if(re=e.unstable_now(),typeof Fe=="function"){_.callback=Fe,K(re),se=!0;break t}_===i(p)&&o(p),K(re)}else o(p);_=i(p)}if(_!==null)se=!0;else{var et=i(y);et!==null&&Z(pe,et.startTime-re),se=!1}}break e}finally{_=null,C=Q,E=!1}se=void 0}}finally{se?J():P=!1}}}var J;if(typeof N=="function")J=function(){N(we)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,Ce=be.port2;be.port1.onmessage=we,J=function(){Ce.postMessage(null)}}else J=function(){V(we,0)};function Z(re,se){A=V(function(){re(e.unstable_now())},se)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(re){re.callback=null},e.unstable_forceFrameRate=function(re){0>re||125<re?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<re?Math.floor(1e3/re):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(re){switch(C){case 1:case 2:case 3:var se=3;break;default:se=C}var Q=C;C=se;try{return re()}finally{C=Q}},e.unstable_requestPaint=function(){$=!0},e.unstable_runWithPriority=function(re,se){switch(re){case 1:case 2:case 3:case 4:case 5:break;default:re=3}var Q=C;C=re;try{return se()}finally{C=Q}},e.unstable_scheduleCallback=function(re,se,Q){var Le=e.unstable_now();switch(typeof Q=="object"&&Q?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?Le+Q:Le):Q=Le,re){case 1:var Fe=-1;break;case 2:Fe=250;break;case 5:Fe=1073741823;break;case 4:Fe=1e4;break;default:Fe=5e3}return Fe=Q+Fe,re={id:w++,callback:se,priorityLevel:re,startTime:Q,expirationTime:Fe,sortIndex:-1},Q>Le?(re.sortIndex=Q,n(y,re),i(p)===null&&re===i(y)&&(I?(F(A),A=-1):I=!0,Z(pe,Q-Le))):(re.sortIndex=Fe,n(p,re),T||E||(T=!0,P||(P=!0,J()))),re},e.unstable_shouldYield=fe,e.unstable_wrapCallback=function(re){var se=C;return function(){var Q=C;C=se;try{return re.apply(this,arguments)}finally{C=Q}}}})),Yr=Ee(((e,n)=>{n.exports=Ki()})),Na=Ee((e=>{var n=Yr(),i=Tu(),o=e4();function s(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function d(t){var r=t,a=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,r.flags&4098&&(a=r.return),t=r.return;while(t)}return r.tag===3?a:null}function f(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function p(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function y(t){if(d(t)!==t)throw Error(s(188))}function w(t){var r=t.alternate;if(!r){if(r=d(t),r===null)throw Error(s(188));return r===t?t:null}for(var a=t,l=r;;){var h=a.return;if(h===null)break;var g=h.alternate;if(g===null){if(l=h.return,l!==null){a=l;continue}break}if(h.child===g.child){for(g=h.child;g;){if(g===a)return y(h),t;if(g===l)return y(h),r;g=g.sibling}throw Error(s(188))}if(a.return!==l.return)a=h,l=g;else{for(var S=!1,D=h.child;D;){if(D===a){S=!0,a=h,l=g;break}if(D===l){S=!0,l=h,a=g;break}D=D.sibling}if(!S){for(D=g.child;D;){if(D===a){S=!0,a=g,l=h;break}if(D===l){S=!0,l=g,a=h;break}D=D.sibling}if(!S)throw Error(s(189))}}if(a.alternate!==l)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?t:r}function _(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=_(t),r!==null)return r;t=t.sibling}return null}var C=Object.assign,E=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),K=Symbol.for("react.context"),pe=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),de=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),we=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function be(t){return typeof t!="object"||!t?null:(t=J&&t[J]||t["@@iterator"],typeof t=="function"?t:null)}var Ce=Symbol.for("react.client.reference");function Z(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Ce?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case $:return"Fragment";case F:return"Profiler";case V:return"StrictMode";case P:return"Suspense";case A:return"SuspenseList";case fe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case I:return"Portal";case K:return t.displayName||"Context";case N:return(t._context.displayName||"Context")+".Consumer";case pe:var r=t.render;return t=t.displayName,t||(t=(t=r.displayName||r.name||"",t===""?"ForwardRef":"ForwardRef("+t+")")),t;case W:return r=t.displayName||null,r===null?Z(t.type)||"Memo":r;case de:r=t._payload,t=t._init;try{return Z(t(r))}catch{}}return null}var re=Array.isArray,se=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Le={pending:!1,data:null,method:null,action:null},Fe=[],et=-1;function Be(t){return{current:t}}function je(t){0>et||(t.current=Fe[et],Fe[et]=null,et--)}function Pe(t,r){et++,Fe[et]=t.current,t.current=r}var Ae=Be(null),ft=Be(null),mt=Be(null),Dn=Be(null);function un(t,r){switch(Pe(mt,r),Pe(ft,t),Pe(Ae,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?v2(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=v2(r),t=b2(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}je(Ae),Pe(Ae,t)}function We(){je(Ae),je(ft),je(mt)}function tn(t){t.memoizedState!==null&&Pe(Dn,t);var r=Ae.current,a=b2(r,t.type);r!==a&&(Pe(ft,t),Pe(Ae,a))}function wt(t){ft.current===t&&(je(Ae),je(ft)),Dn.current===t&&(je(Dn),Cl._currentValue=Le)}var vn,vr;function pt(t){if(vn===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);vn=r&&r[1]||"",vr=-1<a.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
4
4
  `+vn+t+vr}var Fr=!1;function nn(t,r){if(!t||Fr)return"";Fr=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(r){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(ue){var ae=ue}Reflect.construct(t,[],ge)}else{try{ge.call()}catch(ue){ae=ue}t.call(ge.prototype)}}else{try{throw Error()}catch(ue){ae=ue}(ge=t())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(ue){if(ue&&ae&&typeof ue.stack=="string")return[ue.stack,ae.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=l.DetermineComponentFrameRoot(),S=g[0],D=g[1];if(S&&D){var H=S.split(`
5
5
  `),ne=D.split(`
6
6
  `);for(h=l=0;l<H.length&&!H[l].includes("DetermineComponentFrameRoot");)l++;for(;h<ne.length&&!ne[h].includes("DetermineComponentFrameRoot");)h++;if(l===H.length||h===ne.length)for(l=H.length-1,h=ne.length-1;1<=l&&0<=h&&H[l]!==ne[h];)h--;for(;1<=l&&0<=h;l--,h--)if(H[l]!==ne[h]){if(l!==1||h!==1)do if(l--,h--,0>h||H[l]!==ne[h]){var he=`
7
7
  `+H[l].replace(" at new "," at ");return t.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",t.displayName)),he}while(1<=l&&0<=h);break}}}finally{Fr=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?pt(a):""}function mi(t,r){switch(t.tag){case 26:case 27:case 5:return pt(t.type);case 16:return pt("Lazy");case 13:return t.child!==r&&r!==null?pt("Suspense Fallback"):pt("Suspense");case 19:return pt("SuspenseList");case 0:case 15:return nn(t.type,!1);case 11:return nn(t.type.render,!1);case 1:return nn(t.type,!0);case 31:return pt("Activity");default:return""}}function On(t){try{var r="",a=null;do r+=mi(t,a),a=t,t=t.return;while(t);return r}catch(l){return`
8
8
  Error generating stack: `+l.message+`
9
- `+l.stack}}var br=Object.prototype.hasOwnProperty,Pn=n.unstable_scheduleCallback,dn=n.unstable_cancelCallback,ta=n.unstable_shouldYield,gi=n.unstable_requestPaint,Ut=n.unstable_now,yi=n.unstable_getCurrentPriorityLevel,fn=n.unstable_ImmediatePriority,ni=n.unstable_UserBlockingPriority,zt=n.unstable_NormalPriority,Br=n.unstable_LowPriority,_t=n.unstable_IdlePriority,vi=n.log,na=n.unstable_setDisableYieldValue,wr=null,Jt=null;function Ge(t){if(typeof vi=="function"&&na(t),Jt&&typeof Jt.setStrictMode=="function")try{Jt.setStrictMode(wr,t)}catch{}}var gt=Math.clz32?Math.clz32:zn,xt=Math.log,kt=Math.LN2;function zn(t){return t>>>=0,t===0?32:31-(xt(t)/kt|0)|0}var _r=256,St=262144,ir=4194304;function Mn(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Hr(t,r,a){var l=t.pendingLanes;if(l===0)return 0;var h=0,g=t.suspendedLanes,S=t.pingedLanes;t=t.warmLanes;var D=l&134217727;return D===0?(D=l&~g,D===0?S===0?a||(a=l&~t,a!==0&&(h=Mn(a))):h=Mn(S):h=Mn(D)):(l=D&~g,l===0?(S&=D,S===0?a||(a=D&~t,a!==0&&(h=Mn(a))):h=Mn(S)):h=Mn(l)),h===0?0:r!==0&&r!==h&&(r&g)===0&&(g=h&-h,a=r&-r,g>=a||g===32&&a&4194048)?r:h}function bn(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function ar(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function bi(){var t=ir;return ir<<=1,!(ir&62914560)&&(ir=4194304),t}function ri(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function Ln(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function wi(t,r,a,l,h,g){var S=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var D=t.entanglements,H=t.expirationTimes,ne=t.hiddenUpdates;for(a=S&~a;0<a;){var he=31-gt(a),ge=1<<he;D[he]=0,H[he]=-1;var ae=ne[he];if(ae!==null)for(ne[he]=null,he=0;he<ae.length;he++){var ue=ae[he];ue!==null&&(ue.lane&=-536870913)}a&=~ge}l!==0&&Fn(t,l,0),g!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=g&~(S&~r))}function Fn(t,r,a){t.pendingLanes|=r,t.suspendedLanes&=~r;var l=31-gt(r);t.entangledLanes|=r,t.entanglements[l]=t.entanglements[l]|1073741824|a&261930}function or(t,r){var a=t.entangledLanes|=r;for(t=t.entanglements;a;){var l=31-gt(a),h=1<<l;h&r|t[l]&r&&(t[l]|=r),a&=~h}}function M(t,r){var a=r&-r;return a=a&42?1:Ye(a),(a&(t.suspendedLanes|r))===0?a:0}function Ye(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function j(t){return t&=-t,2<t?8<t?t&134217727?32:268435456:8:2}function te(){var t=Q.p;return t===0?(t=window.event,t===void 0?32:F2(t.type)):t}function ve(t,r){var a=Q.p;try{return Q.p=t,r()}finally{Q.p=a}}var Te=Math.random().toString(36).slice(2),He="__reactFiber$"+Te,Ve="__reactProps$"+Te,ot="__reactContainer$"+Te,Mt="__reactEvents$"+Te,Ze="__reactListeners$"+Te,Lt="__reactHandles$"+Te,rt="__reactResources$"+Te,ut="__reactMarker$"+Te;function wn(t){delete t[He],delete t[Ve],delete t[Mt],delete t[Ze],delete t[Lt]}function sr(t){var r=t[He];if(r)return r;for(var a=t.parentNode;a;){if(r=a[ot]||a[He]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=E2(t);t!==null;){if(a=t[He])return a;t=E2(t)}return r}t=a,a=t.parentNode}return null}function ii(t){if(t=t[He]||t[ot]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function Bn(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(s(33))}function ra(t){var r=t[rt];return r||(r=t[rt]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Xt(t){t[ut]=!0}var zs=new Set,hc={};function ai(t,r){ia(t,r),ia(t+"Capture",r)}function ia(t,r){for(hc[t]=r,t=0;t<r.length;t++)zs.add(r[t])}var wf=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Kn={},mc={};function _f(t){return br.call(mc,t)?!0:br.call(Kn,t)?!1:wf.test(t)?mc[t]=!0:(Kn[t]=!0,!1)}function Wa(t,r,a){if(_f(r))if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var l=r.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+a)}}function Ua(t,r,a){if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+a)}}function Vr(t,r,a,l){if(l===null)t.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(r,a,""+l)}}function Hn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function gc(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function yc(t,r,a){var l=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&l!==void 0&&typeof l.get=="function"&&typeof l.set=="function"){var h=l.get,g=l.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return h.call(this)},set:function(S){a=""+S,g.call(this,S)}}),Object.defineProperty(t,r,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(S){a=""+S},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function Fs(t){if(!t._valueTracker){var r=gc(t)?"checked":"value";t._valueTracker=yc(t,r,""+t[r])}}function Bs(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var a=r.getValue(),l="";return t&&(l=gc(t)?t.checked?"true":"false":t.value),t=l,t===a?!1:(r.setValue(t),!0)}function Nn(t){if(t||(t=typeof document<"u"?document:void 0),t===void 0)return null;try{return t.activeElement||t.body}catch{return t.body}}var ct=/[\n"\\]/g;function lr(t){return t.replace(ct,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function aa(t,r,a,l,h,g,S,D){t.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.type=S:t.removeAttribute("type"),r==null?S!=="submit"&&S!=="reset"||t.removeAttribute("value"):S==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Hn(r)):t.value!==""+Hn(r)&&(t.value=""+Hn(r)),r==null?a==null?l!=null&&t.removeAttribute("value"):_i(t,S,Hn(a)):_i(t,S,Hn(r)),h==null&&g!=null&&(t.defaultChecked=!!g),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?t.name=""+Hn(D):t.removeAttribute("name")}function vc(t,r,a,l,h,g,S,D){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.type=g),r!=null||a!=null){if(!(g!=="submit"&&g!=="reset"||r!=null)){Fs(t);return}a=a==null?"":""+Hn(a),r=r==null?a:""+Hn(r),D||r===t.value||(t.value=r),t.defaultValue=r}l??(l=h),l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=D?t.checked:!!l,t.defaultChecked=!!l,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.name=S),Fs(t)}function _i(t,r,a){r==="number"&&Nn(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function oa(t,r,a,l){if(t=t.options,r){r={};for(var h=0;h<a.length;h++)r["$"+a[h]]=!0;for(a=0;a<t.length;a++)h=r.hasOwnProperty("$"+t[a].value),t[a].selected!==h&&(t[a].selected=h),h&&l&&(t[a].defaultSelected=!0)}else{for(a=""+Hn(a),r=null,h=0;h<t.length;h++){if(t[h].value===a){t[h].selected=!0,l&&(t[h].defaultSelected=!0);return}r!==null||t[h].disabled||(r=t[h])}r!==null&&(r.selected=!0)}}function sa(t,r,a){if(r!=null&&(r=""+Hn(r),r!==t.value&&(t.value=r),a==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=a==null?"":""+Hn(a)}function Bo(t,r,a,l){if(r==null){if(l!=null){if(a!=null)throw Error(s(92));if(re(l)){if(1<l.length)throw Error(s(93));l=l[0]}a=l}a??(a=""),r=a}a=Hn(r),t.defaultValue=a,l=t.textContent,l===a&&l!==""&&l!==null&&(t.value=l),Fs(t)}function xi(t,r){if(r){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=r;return}}t.textContent=r}var xf=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function ki(t,r,a){var l=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":l?t.setProperty(r,a):typeof a!="number"||a===0||xf.has(r)?r==="float"?t.cssFloat=a:t[r]=(""+a).trim():t[r]=a+"px"}function bc(t,r,a){if(r!=null&&typeof r!="object")throw Error(s(62));if(t=t.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="");for(var h in r)l=r[h],r.hasOwnProperty(h)&&a[h]!==l&&ki(t,h,l)}else for(var g in r)r.hasOwnProperty(g)&&ki(t,g,r[g])}function Ka(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ho=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),wc=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Vo(t){return wc.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function xr(){}var _n=null;function Hs(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Vn=null,oi=null;function _c(t){var r=ii(t);if(r&&(t=r.stateNode)){var a=t[Ve]||null;e:switch(t=r.stateNode,r.type){case"input":if(aa(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+lr(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var l=a[r];if(l!==t&&l.form===t.form){var h=l[Ve]||null;if(!h)throw Error(s(90));aa(l,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(r=0;r<a.length;r++)l=a[r],l.form===t.form&&Bs(l)}break e;case"textarea":sa(t,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&oa(t,!!a.multiple,r,!1)}}}var Vs=!1;function xc(t,r,a){if(Vs)return t(r,a);Vs=!0;try{return t(r)}finally{if(Vs=!1,(Vn!==null||oi!==null)&&(ou(),Vn&&(r=Vn,t=oi,oi=Vn=null,_c(r),t)))for(r=0;r<t.length;r++)_c(t[r])}}function Qa(t,r){var a=t.stateNode;if(a===null)return null;var l=a[Ve]||null;if(l===null)return null;a=l[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(s(231,r,typeof a));return a}var $r=!(typeof window>"u"||window.document===void 0||window.document.createElement===void 0),$s=!1;if($r)try{var Ga={};Object.defineProperty(Ga,"passive",{get:function(){$s=!0}}),window.addEventListener("test",Ga,Ga),window.removeEventListener("test",Ga,Ga)}catch{$s=!1}var Wr=null,$o=null,Ja=null;function Ws(){if(Ja)return Ja;var t,r=$o,a=r.length,l,h="value"in Wr?Wr.value:Wr.textContent,g=h.length;for(t=0;t<a&&r[t]===h[t];t++);var S=a-t;for(l=1;l<=S&&r[a-l]===h[g-l];l++);return Ja=h.slice(t,1<l?1-l:void 0)}function Xa(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function Ya(){return!0}function Us(){return!1}function xn(t){function r(a,l,h,g,S){for(var D in this._reactName=a,this._targetInst=h,this.type=l,this.nativeEvent=g,this.target=S,this.currentTarget=null,t)t.hasOwnProperty(D)&&(a=t[D],this[D]=a?a(g):g[D]);return this.isDefaultPrevented=(g.defaultPrevented==null?g.returnValue===!1:g.defaultPrevented)?Ya:Us,this.isPropagationStopped=Us,this}return C(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Ya)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Ya)},persist:function(){},isPersistent:Ya}),r}var Si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},u=xn(Si),m=C({},Si,{view:0,detail:0}),v=xn(m),b,x,k,R=C({},m,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qe,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==k&&(k&&t.type==="mousemove"?(b=t.screenX-k.screenX,x=t.screenY-k.screenY):x=b=0,k=t),b)},movementY:function(t){return"movementY"in t?t.movementY:x}}),O=xn(R),L=xn(C({},R,{dataTransfer:0})),z=xn(C({},m,{relatedTarget:0})),q=xn(C({},Si,{animationName:0,elapsedTime:0,pseudoElement:0})),oe=xn(C({},Si,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}})),ie=xn(C({},Si,{data:0})),X={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Y={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},xe={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _e(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=xe[t])?!!r[t]:!1}function qe(){return _e}var Re=xn(C({},m,{key:function(t){if(t.key){var r=X[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Xa(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Y[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qe,charCode:function(t){return t.type==="keypress"?Xa(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Xa(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}})),Ne=xn(C({},R,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),dt=xn(C({},m,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qe})),Je=xn(C({},Si,{propertyName:0,elapsedTime:0,pseudoElement:0})),Nt=xn(C({},R,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0})),Ft=xn(C({},Si,{newState:0,oldState:0})),Ue=[9,13,27,32],$e=$r&&"CompositionEvent"in window,$t=null;$r&&"documentMode"in document&&($t=document.documentMode);var rn=$r&&"TextEvent"in window&&!$t,pn=$r&&(!$e||$t&&8<$t&&11>=$t),Za=" ",kc=!1;function Sc(t,r){switch(t){case"keyup":return Ue.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wo(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Uo=!1;function hT(t,r){switch(t){case"compositionend":return Wo(r);case"keypress":return r.which===32?(kc=!0,Za):null;case"textInput":return t=r.data,t===Za&&kc?null:t;default:return null}}function mT(t,r){if(Uo)return t==="compositionend"||!$e&&Sc(t,r)?(t=Ws(),Ja=$o=Wr=null,Uo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return pn&&r.locale!=="ko"?null:r.data;default:return null}}var gT={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Pv(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!gT[t.type]:r==="textarea"}function Mv(t,r,a,l){Vn?oi?oi.push(l):oi=[l]:Vn=l,r=pu(r,"onChange"),0<r.length&&(a=new u("onChange","change",null,a,l),t.push({event:a,listeners:r}))}var Ks=null,Qs=null;function yT(t){d2(t,0)}function Cc(t){if(Bs(Bn(t)))return t}function Lv(t,r){if(t==="change")return r}var Nv=!1;if($r){var kf;if($r){var Sf="oninput"in document;if(!Sf){var Iv=document.createElement("div");Iv.setAttribute("oninput","return;"),Sf=typeof Iv.oninput=="function"}kf=Sf}else kf=!1;Nv=kf&&(!document.documentMode||9<document.documentMode)}function Av(){Ks&&(Ks.detachEvent("onpropertychange",qv),Qs=Ks=null)}function qv(t){if(t.propertyName==="value"&&Cc(Qs)){var r=[];Mv(r,Qs,t,Hs(t)),xc(yT,r)}}function vT(t,r,a){t==="focusin"?(Av(),Ks=r,Qs=a,Ks.attachEvent("onpropertychange",qv)):t==="focusout"&&Av()}function bT(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Cc(Qs)}function wT(t,r){if(t==="click")return Cc(r)}function _T(t,r){if(t==="input"||t==="change")return Cc(r)}function xT(t,r){return t===r&&(t!==0||1/t==1/r)||t!==t&&r!==r}var cr=typeof Object.is=="function"?Object.is:xT;function Gs(t,r){if(cr(t,r))return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var a=Object.keys(t),l=Object.keys(r);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var h=a[l];if(!br.call(r,h)||!cr(t[h],r[h]))return!1}return!0}function jv(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function zv(t,r){var a=jv(t);t=0;for(var l;a;){if(a.nodeType===3){if(l=t+a.textContent.length,t<=r&&l>=r)return{node:a,offset:r-t};t=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=jv(a)}}function Fv(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?Fv(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Bv(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Nn(t.document);r instanceof t.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)t=r.contentWindow;else break;r=Nn(t.document)}return r}function Cf(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var kT=$r&&"documentMode"in document&&11>=document.documentMode,Ko=null,Ef=null,Js=null,Tf=!1;function Hv(t,r,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Tf||Ko==null||Ko!==Nn(l)||(l=Ko,"selectionStart"in l&&Cf(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Js&&Gs(Js,l)||(Js=l,l=pu(Ef,"onSelect"),0<l.length&&(r=new u("onSelect","select",null,r,a),t.push({event:r,listeners:l}),r.target=Ko)))}function eo(t,r){var a={};return a[t.toLowerCase()]=r.toLowerCase(),a["Webkit"+t]="webkit"+r,a["Moz"+t]="moz"+r,a}var Qo={animationend:eo("Animation","AnimationEnd"),animationiteration:eo("Animation","AnimationIteration"),animationstart:eo("Animation","AnimationStart"),transitionrun:eo("Transition","TransitionRun"),transitionstart:eo("Transition","TransitionStart"),transitioncancel:eo("Transition","TransitionCancel"),transitionend:eo("Transition","TransitionEnd")},Rf={},Vv={};$r&&(Vv=document.createElement("div").style,"AnimationEvent"in window||(delete Qo.animationend.animation,delete Qo.animationiteration.animation,delete Qo.animationstart.animation),"TransitionEvent"in window||delete Qo.transitionend.transition);function to(t){if(Rf[t])return Rf[t];if(!Qo[t])return t;var r=Qo[t],a;for(a in r)if(r.hasOwnProperty(a)&&a in Vv)return Rf[t]=r[a];return t}var $v=to("animationend"),Wv=to("animationiteration"),Uv=to("animationstart"),ST=to("transitionrun"),CT=to("transitionstart"),ET=to("transitioncancel"),Kv=to("transitionend"),Qv=new Map,Df="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Df.push("scrollEnd");function Ur(t,r){Qv.set(t,r),ai(r,[t])}var Ec=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},kr=[],Go=0,Of=0;function Tc(){for(var t=Go,r=Of=Go=0;r<t;){var a=kr[r];kr[r++]=null;var l=kr[r];kr[r++]=null;var h=kr[r];kr[r++]=null;var g=kr[r];if(kr[r++]=null,l!==null&&h!==null){var S=l.pending;S===null?h.next=h:(h.next=S.next,S.next=h),l.pending=h}g!==0&&Gv(a,h,g)}}function Rc(t,r,a,l){kr[Go++]=t,kr[Go++]=r,kr[Go++]=a,kr[Go++]=l,Of|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function Pf(t,r,a,l){return Rc(t,r,a,l),Dc(t)}function no(t,r){return Rc(t,null,null,r),Dc(t)}function Gv(t,r,a){t.lanes|=a;var l=t.alternate;l!==null&&(l.lanes|=a);for(var h=!1,g=t.return;g!==null;)g.childLanes|=a,l=g.alternate,l!==null&&(l.childLanes|=a),g.tag===22&&(t=g.stateNode,t===null||t._visibility&1||(h=!0)),t=g,g=g.return;return t.tag===3?(g=t.stateNode,h&&r!==null&&(h=31-gt(a),t=g.hiddenUpdates,l=t[h],l===null?t[h]=[r]:l.push(r),r.lane=a|536870912),g):null}function Dc(t){if(50<vl)throw vl=0,Fp=null,Error(s(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var Jo={};function TT(t,r,a,l){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ur(t,r,a,l){return new TT(t,r,a,l)}function Mf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ci(t,r){var a=t.alternate;return a===null?(a=ur(t.tag,r,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=r,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,r=t.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function Jv(t,r){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,r=a.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function Oc(t,r,a,l,h,g){var S=0;if(l=t,typeof t=="function")Mf(t)&&(S=1);else if(typeof t=="string")S=LR(t,a,Ae.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case fe:return t=ur(31,a,r,h),t.elementType=fe,t.lanes=g,t;case $:return ro(a.children,h,g,r);case V:S=8,h|=24;break;case F:return t=ur(12,a,r,h|2),t.elementType=F,t.lanes=g,t;case P:return t=ur(13,a,r,h),t.elementType=P,t.lanes=g,t;case A:return t=ur(19,a,r,h),t.elementType=A,t.lanes=g,t;default:if(typeof t=="object"&&t)switch(t.$$typeof){case K:S=10;break e;case N:S=9;break e;case pe:S=11;break e;case W:S=14;break e;case de:S=16,l=null;break e}S=29,a=Error(s(130,t===null?"null":typeof t,"")),l=null}return r=ur(S,a,r,h),r.elementType=t,r.type=l,r.lanes=g,r}function ro(t,r,a,l){return t=ur(7,t,l,r),t.lanes=a,t}function Lf(t,r,a){return t=ur(6,t,null,r),t.lanes=a,t}function Xv(t){var r=ur(18,null,null,0);return r.stateNode=t,r}function Nf(t,r,a){return r=ur(4,t.children===null?[]:t.children,t.key,r),r.lanes=a,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var Yv=new WeakMap;function Sr(t,r){if(typeof t=="object"&&t){var a=Yv.get(t);return a===void 0?(r={value:t,source:r,stack:On(r)},Yv.set(t,r),r):a}return{value:t,source:r,stack:On(r)}}var Xo=[],Yo=0,Pc=null,Xs=0,Cr=[],Er=0,la=null,si=1,li="";function Ei(t,r){Xo[Yo++]=Xs,Xo[Yo++]=Pc,Pc=t,Xs=r}function Zv(t,r,a){Cr[Er++]=si,Cr[Er++]=li,Cr[Er++]=la,la=t;var l=si;t=li;var h=32-gt(l)-1;l&=~(1<<h),a+=1;var g=32-gt(r)+h;if(30<g){var S=h-h%5;g=(l&(1<<S)-1).toString(32),l>>=S,h-=S,si=1<<32-gt(r)+h|a<<h|l,li=g+t}else si=1<<g|a<<h|l,li=t}function If(t){t.return!==null&&(Ei(t,1),Zv(t,1,0))}function Af(t){for(;t===Pc;)Pc=Xo[--Yo],Xo[Yo]=null,Xs=Xo[--Yo],Xo[Yo]=null;for(;t===la;)la=Cr[--Er],Cr[Er]=null,li=Cr[--Er],Cr[Er]=null,si=Cr[--Er],Cr[Er]=null}function e1(t,r){Cr[Er++]=si,Cr[Er++]=li,Cr[Er++]=la,si=r.id,li=r.overflow,la=t}var Sn=null,Bt=null,st=!1,ca=null,Tr=!1,qf=Error(s(519));function ua(t){throw Ys(Sr(Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML","")),t)),qf}function t1(t){var r=t.stateNode,a=t.type,l=t.memoizedProps;switch(r[He]=t,r[Ve]=l,a){case"dialog":nt("cancel",r),nt("close",r);break;case"iframe":case"object":case"embed":nt("load",r);break;case"video":case"audio":for(a=0;a<wl.length;a++)nt(wl[a],r);break;case"source":nt("error",r);break;case"img":case"image":case"link":nt("error",r),nt("load",r);break;case"details":nt("toggle",r);break;case"input":nt("invalid",r),vc(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":nt("invalid",r);break;case"textarea":nt("invalid",r),Bo(r,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||l.suppressHydrationWarning===!0||g2(r.textContent,a)?(l.popover!=null&&(nt("beforetoggle",r),nt("toggle",r)),l.onScroll!=null&&nt("scroll",r),l.onScrollEnd!=null&&nt("scrollend",r),l.onClick!=null&&(r.onclick=xr),r=!0):r=!1,r||ua(t,!0)}function n1(t){for(Sn=t.return;Sn;)switch(Sn.tag){case 5:case 31:case 13:Tr=!1;return;case 27:case 3:Tr=!0;return;default:Sn=Sn.return}}function Zo(t){if(t!==Sn)return!1;if(!st)return n1(t),st=!0,!1;var r=t.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||eh(t.type,t.memoizedProps)),a=!a),a&&Bt&&ua(t),n1(t),r===13){if(t=t.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(317));Bt=C2(t)}else if(r===31){if(t=t.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(317));Bt=C2(t)}else r===27?(r=Bt,xa(t.type)?(t=ah,ah=null,Bt=t):Bt=r):Bt=Sn?Dr(t.stateNode.nextSibling):null;return!0}function io(){Bt=Sn=null,st=!1}function jf(){var t=ca;return t!==null&&(Xn===null?Xn=t:Xn.push.apply(Xn,t),ca=null),t}function Ys(t){ca===null?ca=[t]:ca.push(t)}var zf=Be(null),ao=null,Ti=null;function da(t,r,a){Pe(zf,r._currentValue),r._currentValue=a}function Ri(t){t._currentValue=zf.current,je(zf)}function Ff(t,r,a){for(;t!==null;){var l=t.alternate;if((t.childLanes&r)===r?l!==null&&(l.childLanes&r)!==r&&(l.childLanes|=r):(t.childLanes|=r,l!==null&&(l.childLanes|=r)),t===a)break;t=t.return}}function Bf(t,r,a,l){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var g=h.dependencies;if(g!==null){var S=h.child;g=g.firstContext;e:for(;g!==null;){var D=g;g=h;for(var H=0;H<r.length;H++)if(D.context===r[H]){g.lanes|=a,D=g.alternate,D!==null&&(D.lanes|=a),Ff(g.return,a,t),l||(S=null);break e}g=D.next}}else if(h.tag===18){if(S=h.return,S===null)throw Error(s(341));S.lanes|=a,g=S.alternate,g!==null&&(g.lanes|=a),Ff(S,a,t),S=null}else S=h.child;if(S!==null)S.return=h;else for(S=h;S!==null;){if(S===t){S=null;break}if(h=S.sibling,h!==null){h.return=S.return,S=h;break}S=S.return}h=S}}function es(t,r,a,l){t=null;for(var h=r,g=!1;h!==null;){if(!g){if(h.flags&524288)g=!0;else if(h.flags&262144)break}if(h.tag===10){var S=h.alternate;if(S===null)throw Error(s(387));if(S=S.memoizedProps,S!==null){var D=h.type;cr(h.pendingProps.value,S.value)||(t===null?t=[D]:t.push(D))}}else if(h===Dn.current){if(S=h.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t===null?t=[Cl]:t.push(Cl))}h=h.return}t!==null&&Bf(r,t,a,l),r.flags|=262144}function Mc(t){for(t=t.firstContext;t!==null;){if(!cr(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function oo(t){ao=t,Ti=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Cn(t){return r1(ao,t)}function Lc(t,r){return ao===null&&oo(t),r1(t,r)}function r1(t,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},Ti===null){if(t===null)throw Error(s(308));Ti=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else Ti=Ti.next=r;return a}var RT=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(a,l){t.push(l)}};this.abort=function(){r.aborted=!0,t.forEach(function(a){return a()})}},DT=n.unstable_scheduleCallback,OT=n.unstable_NormalPriority,an={$$typeof:K,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hf(){return{controller:new RT,data:new Map,refCount:0}}function Zs(t){t.refCount--,t.refCount===0&&DT(OT,function(){t.controller.abort()})}var el=null,Vf=0,ts=0,ns=null;function PT(t,r){if(el===null){var a=el=[];Vf=0,ts=Up(),ns={status:"pending",value:void 0,then:function(l){a.push(l)}}}return Vf++,r.then(i1,i1),r}function i1(){if(--Vf===0&&el!==null){ns!==null&&(ns.status="fulfilled");var t=el;el=null,ts=0,ns=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function MT(t,r){var a=[],l={status:"pending",value:null,reason:null,then:function(h){a.push(h)}};return t.then(function(){l.status="fulfilled",l.value=r;for(var h=0;h<a.length;h++)(0,a[h])(r)},function(h){for(l.status="rejected",l.reason=h,h=0;h<a.length;h++)(0,a[h])(void 0)}),l}var a1=se.S;se.S=function(t,r){zb=Ut(),typeof r=="object"&&r&&typeof r.then=="function"&&PT(t,r),a1!==null&&a1(t,r)};var so=Be(null);function $f(){var t=so.current;return t===null?It.pooledCache:t}function Nc(t,r){r===null?Pe(so,so.current):Pe(so,r.pool)}function o1(){var t=$f();return t===null?null:{parent:an._currentValue,pool:t}}var rs=Error(s(460)),Wf=Error(s(474)),Ic=Error(s(542)),Ac={then:function(){}};function s1(t){return t=t.status,t==="fulfilled"||t==="rejected"}function l1(t,r,a){switch(a=t[a],a===void 0?t.push(r):a!==r&&(r.then(xr,xr),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,u1(t),t;default:if(typeof r.status=="string")r.then(xr,xr);else{if(t=It,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=r,t.status="pending",t.then(function(l){if(r.status==="pending"){var h=r;h.status="fulfilled",h.value=l}},function(l){if(r.status==="pending"){var h=r;h.status="rejected",h.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,u1(t),t}throw co=r,rs}}function lo(t){try{var r=t._init;return r(t._payload)}catch(a){throw typeof a=="object"&&a&&typeof a.then=="function"?(co=a,rs):a}}var co=null;function c1(){if(co===null)throw Error(s(459));var t=co;return co=null,t}function u1(t){if(t===rs||t===Ic)throw Error(s(483))}var is=null,tl=0;function qc(t){var r=tl;return tl+=1,is===null&&(is=[]),l1(is,t,r)}function nl(t,r){r=r.props.ref,t.ref=r===void 0?null:r}function jc(t,r){throw r.$$typeof===E?Error(s(525)):(t=Object.prototype.toString.call(r),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function d1(t){function r(G,U){if(t){var ee=G.deletions;ee===null?(G.deletions=[U],G.flags|=16):ee.push(U)}}function a(G,U){if(!t)return null;for(;U!==null;)r(G,U),U=U.sibling;return null}function l(G){for(var U=new Map;G!==null;)G.key===null?U.set(G.index,G):U.set(G.key,G),G=G.sibling;return U}function h(G,U){return G=Ci(G,U),G.index=0,G.sibling=null,G}function g(G,U,ee){return G.index=ee,t?(ee=G.alternate,ee===null?(G.flags|=67108866,U):(ee=ee.index,ee<U?(G.flags|=67108866,U):ee)):(G.flags|=1048576,U)}function S(G){return t&&G.alternate===null&&(G.flags|=67108866),G}function D(G,U,ee,me){return U===null||U.tag!==6?(U=Lf(ee,G.mode,me),U.return=G,U):(U=h(U,ee),U.return=G,U)}function H(G,U,ee,me){var Me=ee.type;return Me===$?he(G,U,ee.props.children,me,ee.key):U!==null&&(U.elementType===Me||typeof Me=="object"&&Me&&Me.$$typeof===de&&lo(Me)===U.type)?(U=h(U,ee.props),nl(U,ee),U.return=G,U):(U=Oc(ee.type,ee.key,ee.props,null,G.mode,me),nl(U,ee),U.return=G,U)}function ne(G,U,ee,me){return U===null||U.tag!==4||U.stateNode.containerInfo!==ee.containerInfo||U.stateNode.implementation!==ee.implementation?(U=Nf(ee,G.mode,me),U.return=G,U):(U=h(U,ee.children||[]),U.return=G,U)}function he(G,U,ee,me,Me){return U===null||U.tag!==7?(U=ro(ee,G.mode,me,Me),U.return=G,U):(U=h(U,ee),U.return=G,U)}function ge(G,U,ee){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=Lf(""+U,G.mode,ee),U.return=G,U;if(typeof U=="object"&&U){switch(U.$$typeof){case T:return ee=Oc(U.type,U.key,U.props,null,G.mode,ee),nl(ee,U),ee.return=G,ee;case I:return U=Nf(U,G.mode,ee),U.return=G,U;case de:return U=lo(U),ge(G,U,ee)}if(re(U)||be(U))return U=ro(U,G.mode,ee,null),U.return=G,U;if(typeof U.then=="function")return ge(G,qc(U),ee);if(U.$$typeof===K)return ge(G,Lc(G,U),ee);jc(G,U)}return null}function ae(G,U,ee,me){var Me=U===null?null:U.key;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Me===null?D(G,U,""+ee,me):null;if(typeof ee=="object"&&ee){switch(ee.$$typeof){case T:return ee.key===Me?H(G,U,ee,me):null;case I:return ee.key===Me?ne(G,U,ee,me):null;case de:return ee=lo(ee),ae(G,U,ee,me)}if(re(ee)||be(ee))return Me===null?he(G,U,ee,me,null):null;if(typeof ee.then=="function")return ae(G,U,qc(ee),me);if(ee.$$typeof===K)return ae(G,U,Lc(G,ee),me);jc(G,ee)}return null}function ue(G,U,ee,me,Me){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return G=G.get(ee)||null,D(U,G,""+me,Me);if(typeof me=="object"&&me){switch(me.$$typeof){case T:return G=G.get(me.key===null?ee:me.key)||null,H(U,G,me,Me);case I:return G=G.get(me.key===null?ee:me.key)||null,ne(U,G,me,Me);case de:return me=lo(me),ue(G,U,ee,me,Me)}if(re(me)||be(me))return G=G.get(ee)||null,he(U,G,me,Me,null);if(typeof me.then=="function")return ue(G,U,ee,qc(me),Me);if(me.$$typeof===K)return ue(G,U,ee,Lc(U,me),Me);jc(U,me)}return null}function De(G,U,ee,me){for(var Me=null,vt=null,Oe=U,Qe=U=0,at=null;Oe!==null&&Qe<ee.length;Qe++){Oe.index>Qe?(at=Oe,Oe=null):at=Oe.sibling;var ht=ae(G,Oe,ee[Qe],me);if(ht===null){Oe===null&&(Oe=at);break}t&&Oe&&ht.alternate===null&&r(G,Oe),U=g(ht,U,Qe),vt===null?Me=ht:vt.sibling=ht,vt=ht,Oe=at}if(Qe===ee.length)return a(G,Oe),st&&Ei(G,Qe),Me;if(Oe===null){for(;Qe<ee.length;Qe++)Oe=ge(G,ee[Qe],me),Oe!==null&&(U=g(Oe,U,Qe),vt===null?Me=Oe:vt.sibling=Oe,vt=Oe);return st&&Ei(G,Qe),Me}for(Oe=l(Oe);Qe<ee.length;Qe++)at=ue(Oe,G,Qe,ee[Qe],me),at!==null&&(t&&at.alternate!==null&&Oe.delete(at.key===null?Qe:at.key),U=g(at,U,Qe),vt===null?Me=at:vt.sibling=at,vt=at);return t&&Oe.forEach(function(Ta){return r(G,Ta)}),st&&Ei(G,Qe),Me}function Ie(G,U,ee,me){if(ee==null)throw Error(s(151));for(var Me=null,vt=null,Oe=U,Qe=U=0,at=null,ht=ee.next();Oe!==null&&!ht.done;Qe++,ht=ee.next()){Oe.index>Qe?(at=Oe,Oe=null):at=Oe.sibling;var Ta=ae(G,Oe,ht.value,me);if(Ta===null){Oe===null&&(Oe=at);break}t&&Oe&&Ta.alternate===null&&r(G,Oe),U=g(Ta,U,Qe),vt===null?Me=Ta:vt.sibling=Ta,vt=Ta,Oe=at}if(ht.done)return a(G,Oe),st&&Ei(G,Qe),Me;if(Oe===null){for(;!ht.done;Qe++,ht=ee.next())ht=ge(G,ht.value,me),ht!==null&&(U=g(ht,U,Qe),vt===null?Me=ht:vt.sibling=ht,vt=ht);return st&&Ei(G,Qe),Me}for(Oe=l(Oe);!ht.done;Qe++,ht=ee.next())ht=ue(Oe,G,Qe,ht.value,me),ht!==null&&(t&&ht.alternate!==null&&Oe.delete(ht.key===null?Qe:ht.key),U=g(ht,U,Qe),vt===null?Me=ht:vt.sibling=ht,vt=ht);return t&&Oe.forEach(function(KR){return r(G,KR)}),st&&Ei(G,Qe),Me}function Ot(G,U,ee,me){if(typeof ee=="object"&&ee&&ee.type===$&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee){switch(ee.$$typeof){case T:e:{for(var Me=ee.key;U!==null;){if(U.key===Me){if(Me=ee.type,Me===$){if(U.tag===7){a(G,U.sibling),me=h(U,ee.props.children),me.return=G,G=me;break e}}else if(U.elementType===Me||typeof Me=="object"&&Me&&Me.$$typeof===de&&lo(Me)===U.type){a(G,U.sibling),me=h(U,ee.props),nl(me,ee),me.return=G,G=me;break e}a(G,U);break}else r(G,U);U=U.sibling}ee.type===$?(me=ro(ee.props.children,G.mode,me,ee.key),me.return=G,G=me):(me=Oc(ee.type,ee.key,ee.props,null,G.mode,me),nl(me,ee),me.return=G,G=me)}return S(G);case I:e:{for(Me=ee.key;U!==null;){if(U.key===Me)if(U.tag===4&&U.stateNode.containerInfo===ee.containerInfo&&U.stateNode.implementation===ee.implementation){a(G,U.sibling),me=h(U,ee.children||[]),me.return=G,G=me;break e}else{a(G,U);break}else r(G,U);U=U.sibling}me=Nf(ee,G.mode,me),me.return=G,G=me}return S(G);case de:return ee=lo(ee),Ot(G,U,ee,me)}if(re(ee))return De(G,U,ee,me);if(be(ee)){if(Me=be(ee),typeof Me!="function")throw Error(s(150));return ee=Me.call(ee),Ie(G,U,ee,me)}if(typeof ee.then=="function")return Ot(G,U,qc(ee),me);if(ee.$$typeof===K)return Ot(G,U,Lc(G,ee),me);jc(G,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,U!==null&&U.tag===6?(a(G,U.sibling),me=h(U,ee),me.return=G,G=me):(a(G,U),me=Lf(ee,G.mode,me),me.return=G,G=me),S(G)):a(G,U)}return function(G,U,ee,me){try{tl=0;var Me=Ot(G,U,ee,me);return is=null,Me}catch(Oe){if(Oe===rs||Oe===Ic)throw Oe;var vt=ur(29,Oe,null,G.mode);return vt.lanes=me,vt.return=G,vt}}}var uo=d1(!0),f1=d1(!1),fa=!1;function Uf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kf(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function fo(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function po(t,r,a){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,yt&2){var h=l.pending;return h===null?r.next=r:(r.next=h.next,h.next=r),l.pending=r,r=Dc(t),Gv(t,null,a),r}return Rc(t,l,r,a),Dc(t)}function rl(t,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,a&4194048)){var l=r.lanes;l&=t.pendingLanes,a|=l,r.lanes=a,or(t,a)}}function Qf(t,r){var a=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var h=null,g=null;if(a=a.firstBaseUpdate,a!==null){do{var S={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};g===null?h=g=S:g=g.next=S,a=a.next}while(a!==null);g===null?h=g=r:g=g.next=r}else h=g=r;a={baseState:l.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:l.shared,callbacks:l.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=r:t.next=r,a.lastBaseUpdate=r}var Gf=!1;function il(){if(Gf){var t=ns;if(t!==null)throw t}}function al(t,r,a,l){Gf=!1;var h=t.updateQueue;fa=!1;var g=h.firstBaseUpdate,S=h.lastBaseUpdate,D=h.shared.pending;if(D!==null){h.shared.pending=null;var H=D,ne=H.next;H.next=null,S===null?g=ne:S.next=ne,S=H;var he=t.alternate;he!==null&&(he=he.updateQueue,D=he.lastBaseUpdate,D!==S&&(D===null?he.firstBaseUpdate=ne:D.next=ne,he.lastBaseUpdate=H))}if(g!==null){var ge=h.baseState;S=0,he=ne=H=null,D=g;do{var ae=D.lane&-536870913,ue=ae!==D.lane;if(ue?(it&ae)===ae:(l&ae)===ae){ae!==0&&ae===ts&&(Gf=!0),he!==null&&(he=he.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var De=t,Ie=D;ae=r;var Ot=a;switch(Ie.tag){case 1:if(De=Ie.payload,typeof De=="function"){ge=De.call(Ot,ge,ae);break e}ge=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Ie.payload,ae=typeof De=="function"?De.call(Ot,ge,ae):De,ae==null)break e;ge=C({},ge,ae);break e;case 2:fa=!0}}ae=D.callback,ae!==null&&(t.flags|=64,ue&&(t.flags|=8192),ue=h.callbacks,ue===null?h.callbacks=[ae]:ue.push(ae))}else ue={lane:ae,tag:D.tag,payload:D.payload,callback:D.callback,next:null},he===null?(ne=he=ue,H=ge):he=he.next=ue,S|=ae;if(D=D.next,D===null){if(D=h.shared.pending,D===null)break;ue=D,D=ue.next,ue.next=null,h.lastBaseUpdate=ue,h.shared.pending=null}}while(!0);he===null&&(H=ge),h.baseState=H,h.firstBaseUpdate=ne,h.lastBaseUpdate=he,g===null&&(h.shared.lanes=0),ya|=S,t.lanes=S,t.memoizedState=ge}}function p1(t,r){if(typeof t!="function")throw Error(s(191,t));t.call(r)}function h1(t,r){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)p1(a[t],r)}var as=Be(null),zc=Be(0);function m1(t,r){t=qi,Pe(zc,t),Pe(as,r),qi=t|r.baseLanes}function Jf(){Pe(zc,qi),Pe(as,as.current)}function Xf(){qi=zc.current,je(as),je(zc)}var dr=Be(null),Kr=null;function pa(t){var r=t.alternate;Pe(Yt,Yt.current&1),Pe(dr,t),Kr===null&&(r===null||as.current!==null||r.memoizedState!==null)&&(Kr=t)}function Yf(t){Pe(Yt,Yt.current),Pe(dr,t),Kr===null&&(Kr=t)}function g1(t){t.tag===22?(Pe(Yt,Yt.current),Pe(dr,t),Kr===null&&(Kr=t)):ha(t)}function ha(){Pe(Yt,Yt.current),Pe(dr,dr.current)}function fr(t){je(dr),Kr===t&&(Kr=null),je(Yt)}var Yt=Be(0);function Fc(t){for(var r=t;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||rh(a)||ih(a)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if(r.flags&128)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Di=0,Ke=null,Rt=null,on=null,Bc=!1,os=!1,ho=!1,Hc=0,ol=0,ss=null,LT=0;function Qt(){throw Error(s(321))}function Zf(t,r){if(r===null)return!1;for(var a=0;a<r.length&&a<t.length;a++)if(!cr(t[a],r[a]))return!1;return!0}function ep(t,r,a,l,h,g){return Di=g,Ke=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,se.H=t===null||t.memoizedState===null?Z1:mp,ho=!1,g=a(l,h),ho=!1,os&&(g=v1(r,a,l,h)),y1(t),g}function y1(t){se.H=cl;var r=Rt!==null&&Rt.next!==null;if(Di=0,on=Rt=Ke=null,Bc=!1,ol=0,ss=null,r)throw Error(s(300));t===null||sn||(t=t.dependencies,t!==null&&Mc(t)&&(sn=!0))}function v1(t,r,a,l){Ke=t;var h=0;do{if(os&&(ss=null),ol=0,os=!1,25<=h)throw Error(s(301));if(h+=1,on=Rt=null,t.updateQueue!=null){var g=t.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}se.H=eb,g=r(a,l)}while(os);return g}function NT(){var t=se.H,r=t.useState()[0];return r=typeof r.then=="function"?sl(r):r,t=t.useState()[0],(Rt===null?null:Rt.memoizedState)!==t&&(Ke.flags|=1024),r}function tp(){var t=Hc!==0;return Hc=0,t}function np(t,r,a){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~a}function rp(t){if(Bc){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}Bc=!1}Di=0,on=Rt=Ke=null,os=!1,ol=Hc=0,ss=null}function $n(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?Ke.memoizedState=on=t:on=on.next=t,on}function Zt(){if(Rt===null){var t=Ke.alternate;t=t===null?null:t.memoizedState}else t=Rt.next;var r=on===null?Ke.memoizedState:on.next;if(r!==null)on=r,Rt=t;else{if(t===null)throw Ke.alternate===null?Error(s(467)):Error(s(310));Rt=t,t={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},on===null?Ke.memoizedState=on=t:on=on.next=t}return on}function Vc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function sl(t){var r=ol;return ol+=1,ss===null&&(ss=[]),t=l1(ss,t,r),r=Ke,(on===null?r.memoizedState:on.next)===null&&(r=r.alternate,se.H=r===null||r.memoizedState===null?Z1:mp),t}function $c(t){if(typeof t=="object"&&t){if(typeof t.then=="function")return sl(t);if(t.$$typeof===K)return Cn(t)}throw Error(s(438,String(t)))}function ip(t){var r=null,a=Ke.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var l=Ke.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(h){return h.slice()}),index:0})))}if(r??(r={data:[],index:0}),a===null&&(a=Vc(),Ke.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(t),l=0;l<t;l++)a[l]=we;return r.index++,a}function Oi(t,r){return typeof r=="function"?r(t):r}function Wc(t){return ap(Zt(),Rt,t)}function ap(t,r,a){var l=t.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=a;var h=t.baseQueue,g=l.pending;if(g!==null){if(h!==null){var S=h.next;h.next=g.next,g.next=S}r.baseQueue=h=g,l.pending=null}if(g=t.baseState,h===null)t.memoizedState=g;else{r=h.next;var D=S=null,H=null,ne=r,he=!1;do{var ge=ne.lane&-536870913;if(ge===ne.lane?(Di&ge)===ge:(it&ge)===ge){var ae=ne.revertLane;if(ae===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),ge===ts&&(he=!0);else if((Di&ae)===ae){ne=ne.next,ae===ts&&(he=!0);continue}else ge={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},H===null?(D=H=ge,S=g):H=H.next=ge,Ke.lanes|=ae,ya|=ae;ge=ne.action,ho&&a(g,ge),g=ne.hasEagerState?ne.eagerState:a(g,ge)}else ae={lane:ge,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},H===null?(D=H=ae,S=g):H=H.next=ae,Ke.lanes|=ge,ya|=ge;ne=ne.next}while(ne!==null&&ne!==r);if(H===null?S=g:H.next=D,!cr(g,t.memoizedState)&&(sn=!0,he&&(a=ns,a!==null)))throw a;t.memoizedState=g,t.baseState=S,t.baseQueue=H,l.lastRenderedState=g}return h===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function op(t){var r=Zt(),a=r.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=t;var l=a.dispatch,h=a.pending,g=r.memoizedState;if(h!==null){a.pending=null;var S=h=h.next;do g=t(g,S.action),S=S.next;while(S!==h);cr(g,r.memoizedState)||(sn=!0),r.memoizedState=g,r.baseQueue===null&&(r.baseState=g),a.lastRenderedState=g}return[g,l]}function b1(t,r,a){var l=Ke,h=Zt(),g=st;if(g){if(a===void 0)throw Error(s(407));a=a()}else a=r();var S=!cr((Rt||h).memoizedState,a);if(S&&(h.memoizedState=a,sn=!0),h=h.queue,cp(x1.bind(null,l,h,t),[t]),h.getSnapshot!==r||S||on!==null&&on.memoizedState.tag&1){if(l.flags|=2048,ls(9,{destroy:void 0},_1.bind(null,l,h,a,r),null),It===null)throw Error(s(349));g||Di&127||w1(l,r,a)}return a}function w1(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=Ke.updateQueue,r===null?(r=Vc(),Ke.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function _1(t,r,a,l){r.value=a,r.getSnapshot=l,k1(r)&&S1(t)}function x1(t,r,a){return a(function(){k1(r)&&S1(t)})}function k1(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!cr(t,a)}catch{return!0}}function S1(t){var r=no(t,2);r!==null&&Yn(r,t,2)}function sp(t){var r=$n();if(typeof t=="function"){var a=t;if(t=a(),ho){Ge(!0);try{a()}finally{Ge(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oi,lastRenderedState:t},r}function C1(t,r,a,l){return t.baseState=a,ap(t,Rt,typeof l=="function"?l:Oi)}function IT(t,r,a,l,h){if(Qc(t))throw Error(s(485));if(t=r.action,t!==null){var g={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){g.listeners.push(S)}};se.T===null?g.isTransition=!1:a(!0),l(g),a=r.pending,a===null?(g.next=r.pending=g,E1(r,g)):(g.next=a.next,r.pending=a.next=g)}}function E1(t,r){var a=r.action,l=r.payload,h=t.state;if(r.isTransition){var g=se.T,S={};se.T=S;try{var D=a(h,l),H=se.S;H!==null&&H(S,D),T1(t,r,D)}catch(ne){lp(t,r,ne)}finally{g!==null&&S.types!==null&&(g.types=S.types),se.T=g}}else try{g=a(h,l),T1(t,r,g)}catch(ne){lp(t,r,ne)}}function T1(t,r,a){typeof a=="object"&&a&&typeof a.then=="function"?a.then(function(l){R1(t,r,l)},function(l){return lp(t,r,l)}):R1(t,r,a)}function R1(t,r,a){r.status="fulfilled",r.value=a,D1(r),t.state=a,r=t.pending,r!==null&&(a=r.next,a===r?t.pending=null:(a=a.next,r.next=a,E1(t,a)))}function lp(t,r,a){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=a,D1(r),r=r.next;while(r!==l)}t.action=null}function D1(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function O1(t,r){return r}function P1(t,r){if(st){var a=It.formState;if(a!==null){e:{var l=Ke;if(st){if(Bt){t:{for(var h=Bt,g=Tr;h.nodeType!==8;){if(!g){h=null;break t}if(h=Dr(h.nextSibling),h===null){h=null;break t}}g=h.data,h=g==="F!"||g==="F"?h:null}if(h){Bt=Dr(h.nextSibling),l=h.data==="F!";break e}}ua(l)}l=!1}l&&(r=a[0])}}return a=$n(),a.memoizedState=a.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:O1,lastRenderedState:r},a.queue=l,a=J1.bind(null,Ke,l),l.dispatch=a,l=sp(!1),g=hp.bind(null,Ke,!1,l.queue),l=$n(),h={state:r,dispatch:null,action:t,pending:null},l.queue=h,a=IT.bind(null,Ke,h,g,a),h.dispatch=a,l.memoizedState=t,[r,a,!1]}function M1(t){return L1(Zt(),Rt,t)}function L1(t,r,a){if(r=ap(t,r,O1)[0],t=Wc(Oi)[0],typeof r=="object"&&r&&typeof r.then=="function")try{var l=sl(r)}catch(S){throw S===rs?Ic:S}else l=r;r=Zt();var h=r.queue,g=h.dispatch;return a!==r.memoizedState&&(Ke.flags|=2048,ls(9,{destroy:void 0},AT.bind(null,h,a),null)),[l,g,t]}function AT(t,r){t.action=r}function N1(t){var r=Zt(),a=Rt;if(a!==null)return L1(r,a,t);Zt(),r=r.memoizedState,a=Zt();var l=a.queue.dispatch;return a.memoizedState=t,[r,l,!1]}function ls(t,r,a,l){return t={tag:t,create:a,deps:l,inst:r,next:null},r=Ke.updateQueue,r===null&&(r=Vc(),Ke.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=t.next=t:(l=a.next,a.next=t,t.next=l,r.lastEffect=t),t}function I1(){return Zt().memoizedState}function Uc(t,r,a,l){var h=$n();Ke.flags|=t,h.memoizedState=ls(1|r,{destroy:void 0},a,l===void 0?null:l)}function Kc(t,r,a,l){var h=Zt();l=l===void 0?null:l;var g=h.memoizedState.inst;Rt!==null&&l!==null&&Zf(l,Rt.memoizedState.deps)?h.memoizedState=ls(r,g,a,l):(Ke.flags|=t,h.memoizedState=ls(1|r,g,a,l))}function A1(t,r){Uc(8390656,8,t,r)}function cp(t,r){Kc(2048,8,t,r)}function qT(t){Ke.flags|=4;var r=Ke.updateQueue;if(r===null)r=Vc(),Ke.updateQueue=r,r.events=[t];else{var a=r.events;a===null?r.events=[t]:a.push(t)}}function q1(t){var r=Zt().memoizedState;return qT({ref:r,nextImpl:t}),function(){if(yt&2)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function j1(t,r){return Kc(4,2,t,r)}function z1(t,r){return Kc(4,4,t,r)}function F1(t,r){if(typeof r=="function"){t=t();var a=r(t);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function B1(t,r,a){a=a==null?null:a.concat([t]),Kc(4,4,F1.bind(null,r,t),a)}function up(){}function H1(t,r){var a=Zt();r=r===void 0?null:r;var l=a.memoizedState;return r!==null&&Zf(r,l[1])?l[0]:(a.memoizedState=[t,r],t)}function V1(t,r){var a=Zt();r=r===void 0?null:r;var l=a.memoizedState;if(r!==null&&Zf(r,l[1]))return l[0];if(l=t(),ho){Ge(!0);try{t()}finally{Ge(!1)}}return a.memoizedState=[l,r],l}function dp(t,r,a){return a===void 0||Di&1073741824&&!(it&261930)?t.memoizedState=r:(t.memoizedState=a,t=Bb(),Ke.lanes|=t,ya|=t,a)}function $1(t,r,a,l){return cr(a,r)?a:as.current===null?!(Di&42)||Di&1073741824&&!(it&261930)?(sn=!0,t.memoizedState=a):(t=Bb(),Ke.lanes|=t,ya|=t,r):(t=dp(t,a,l),cr(t,r)||(sn=!0),t)}function W1(t,r,a,l,h){var g=Q.p;Q.p=g!==0&&8>g?g:8;var S=se.T,D={};se.T=D,hp(t,!1,r,a);try{var H=h(),ne=se.S;ne!==null&&ne(D,H),typeof H=="object"&&H&&typeof H.then=="function"?ll(t,r,MT(H,l),Rr(t)):ll(t,r,l,Rr(t))}catch(he){ll(t,r,{then:function(){},status:"rejected",reason:he},Rr())}finally{Q.p=g,S!==null&&D.types!==null&&(S.types=D.types),se.T=S}}function jT(){}function fp(t,r,a,l){if(t.tag!==5)throw Error(s(476));var h=U1(t).queue;W1(t,h,r,Le,a===null?jT:function(){return K1(t),a(l)})}function U1(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Le,baseState:Le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oi,lastRenderedState:Le},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oi,lastRenderedState:a},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function K1(t){var r=U1(t);r.next===null&&(r=t.alternate.memoizedState),ll(t,r.next.queue,{},Rr())}function pp(){return Cn(Cl)}function Q1(){return Zt().memoizedState}function G1(){return Zt().memoizedState}function zT(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var a=Rr();t=fo(a);var l=po(r,t,a);l!==null&&(Yn(l,r,a),rl(l,r,a)),r={cache:Hf()},t.payload=r;return}r=r.return}}function FT(t,r,a){var l=Rr();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Qc(t)?X1(r,a):(a=Pf(t,r,a,l),a!==null&&(Yn(a,t,l),Y1(a,r,l)))}function J1(t,r,a){ll(t,r,a,Rr())}function ll(t,r,a,l){var h={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Qc(t))X1(r,h);else{var g=t.alternate;if(t.lanes===0&&(g===null||g.lanes===0)&&(g=r.lastRenderedReducer,g!==null))try{var S=r.lastRenderedState,D=g(S,a);if(h.hasEagerState=!0,h.eagerState=D,cr(D,S))return Rc(t,r,h,0),It===null&&Tc(),!1}catch{}if(a=Pf(t,r,h,l),a!==null)return Yn(a,t,l),Y1(a,r,l),!0}return!1}function hp(t,r,a,l){if(l={lane:2,revertLane:Up(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Qc(t)){if(r)throw Error(s(479))}else r=Pf(t,a,l,2),r!==null&&Yn(r,t,2)}function Qc(t){var r=t.alternate;return t===Ke||r!==null&&r===Ke}function X1(t,r){os=Bc=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function Y1(t,r,a){if(a&4194048){var l=r.lanes;l&=t.pendingLanes,a|=l,r.lanes=a,or(t,a)}}var cl={readContext:Cn,use:$c,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useLayoutEffect:Qt,useInsertionEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useSyncExternalStore:Qt,useId:Qt,useHostTransitionStatus:Qt,useFormState:Qt,useActionState:Qt,useOptimistic:Qt,useMemoCache:Qt,useCacheRefresh:Qt};cl.useEffectEvent=Qt;var Z1={readContext:Cn,use:$c,useCallback:function(t,r){return $n().memoizedState=[t,r===void 0?null:r],t},useContext:Cn,useEffect:A1,useImperativeHandle:function(t,r,a){a=a==null?null:a.concat([t]),Uc(4194308,4,F1.bind(null,r,t),a)},useLayoutEffect:function(t,r){return Uc(4194308,4,t,r)},useInsertionEffect:function(t,r){Uc(4,2,t,r)},useMemo:function(t,r){var a=$n();r=r===void 0?null:r;var l=t();if(ho){Ge(!0);try{t()}finally{Ge(!1)}}return a.memoizedState=[l,r],l},useReducer:function(t,r,a){var l=$n();if(a!==void 0){var h=a(r);if(ho){Ge(!0);try{a(r)}finally{Ge(!1)}}}else h=r;return l.memoizedState=l.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},l.queue=t,t=t.dispatch=FT.bind(null,Ke,t),[l.memoizedState,t]},useRef:function(t){var r=$n();return t={current:t},r.memoizedState=t},useState:function(t){t=sp(t);var r=t.queue,a=J1.bind(null,Ke,r);return r.dispatch=a,[t.memoizedState,a]},useDebugValue:up,useDeferredValue:function(t,r){return dp($n(),t,r)},useTransition:function(){var t=sp(!1);return t=W1.bind(null,Ke,t.queue,!0,!1),$n().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,a){var l=Ke,h=$n();if(st){if(a===void 0)throw Error(s(407));a=a()}else{if(a=r(),It===null)throw Error(s(349));it&127||w1(l,r,a)}h.memoizedState=a;var g={value:a,getSnapshot:r};return h.queue=g,A1(x1.bind(null,l,g,t),[t]),l.flags|=2048,ls(9,{destroy:void 0},_1.bind(null,l,g,a,r),null),a},useId:function(){var t=$n(),r=It.identifierPrefix;if(st){var a=li,l=si;a=(l&~(1<<32-gt(l)-1)).toString(32)+a,r="_"+r+"R_"+a,a=Hc++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=LT++,r="_"+r+"r_"+a.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:pp,useFormState:P1,useActionState:P1,useOptimistic:function(t){var r=$n();r.memoizedState=r.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=hp.bind(null,Ke,!0,a),a.dispatch=r,[t,r]},useMemoCache:ip,useCacheRefresh:function(){return $n().memoizedState=zT.bind(null,Ke)},useEffectEvent:function(t){var r=$n(),a={impl:t};return r.memoizedState=a,function(){if(yt&2)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},mp={readContext:Cn,use:$c,useCallback:H1,useContext:Cn,useEffect:cp,useImperativeHandle:B1,useInsertionEffect:j1,useLayoutEffect:z1,useMemo:V1,useReducer:Wc,useRef:I1,useState:function(){return Wc(Oi)},useDebugValue:up,useDeferredValue:function(t,r){return $1(Zt(),Rt.memoizedState,t,r)},useTransition:function(){var t=Wc(Oi)[0],r=Zt().memoizedState;return[typeof t=="boolean"?t:sl(t),r]},useSyncExternalStore:b1,useId:Q1,useHostTransitionStatus:pp,useFormState:M1,useActionState:M1,useOptimistic:function(t,r){return C1(Zt(),Rt,t,r)},useMemoCache:ip,useCacheRefresh:G1};mp.useEffectEvent=q1;var eb={readContext:Cn,use:$c,useCallback:H1,useContext:Cn,useEffect:cp,useImperativeHandle:B1,useInsertionEffect:j1,useLayoutEffect:z1,useMemo:V1,useReducer:op,useRef:I1,useState:function(){return op(Oi)},useDebugValue:up,useDeferredValue:function(t,r){var a=Zt();return Rt===null?dp(a,t,r):$1(a,Rt.memoizedState,t,r)},useTransition:function(){var t=op(Oi)[0],r=Zt().memoizedState;return[typeof t=="boolean"?t:sl(t),r]},useSyncExternalStore:b1,useId:Q1,useHostTransitionStatus:pp,useFormState:N1,useActionState:N1,useOptimistic:function(t,r){var a=Zt();return Rt===null?(a.baseState=t,[t,a.queue.dispatch]):C1(a,Rt,t,r)},useMemoCache:ip,useCacheRefresh:G1};eb.useEffectEvent=q1;function gp(t,r,a,l){r=t.memoizedState,a=a(l,r),a=a==null?r:C({},r,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var yp={enqueueSetState:function(t,r,a){t=t._reactInternals;var l=Rr(),h=fo(l);h.payload=r,a!=null&&(h.callback=a),r=po(t,h,l),r!==null&&(Yn(r,t,l),rl(r,t,l))},enqueueReplaceState:function(t,r,a){t=t._reactInternals;var l=Rr(),h=fo(l);h.tag=1,h.payload=r,a!=null&&(h.callback=a),r=po(t,h,l),r!==null&&(Yn(r,t,l),rl(r,t,l))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var a=Rr(),l=fo(a);l.tag=2,r!=null&&(l.callback=r),r=po(t,l,a),r!==null&&(Yn(r,t,a),rl(r,t,a))}};function tb(t,r,a,l,h,g,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,g,S):r.prototype&&r.prototype.isPureReactComponent?!Gs(a,l)||!Gs(h,g):!0}function nb(t,r,a,l){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,l),r.state!==t&&yp.enqueueReplaceState(r,r.state,null)}function mo(t,r){var a=r;if("ref"in r)for(var l in a={},r)l!=="ref"&&(a[l]=r[l]);if(t=t.defaultProps)for(var h in a===r&&(a=C({},a)),t)a[h]===void 0&&(a[h]=t[h]);return a}function BT(t){Ec(t)}function HT(t){console.error(t)}function VT(t){Ec(t)}function Gc(t,r){try{var a=t.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function rb(t,r,a){try{var l=t.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function vp(t,r,a){return a=fo(a),a.tag=3,a.payload={element:null},a.callback=function(){Gc(t,r)},a}function ib(t){return t=fo(t),t.tag=3,t}function ab(t,r,a,l){var h=a.type.getDerivedStateFromError;if(typeof h=="function"){var g=l.value;t.payload=function(){return h(g)},t.callback=function(){rb(r,a,l)}}var S=a.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){rb(r,a,l),typeof h!="function"&&(va===null?va=new Set([this]):va.add(this));var D=l.stack;this.componentDidCatch(l.value,{componentStack:D===null?"":D})})}function $T(t,r,a,l,h){if(a.flags|=32768,typeof l=="object"&&l&&typeof l.then=="function"){if(r=a.alternate,r!==null&&es(r,a,h,!0),a=dr.current,a!==null){switch(a.tag){case 31:case 13:return Kr===null?su():a.alternate===null&&Gt===0&&(Gt=3),a.flags&=-257,a.flags|=65536,a.lanes=h,l===Ac?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([l]):r.add(l),Vp(t,l,h)),!1;case 22:return a.flags|=65536,l===Ac?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([l]):a.add(l)),Vp(t,l,h)),!1}throw Error(s(435,a.tag))}return Vp(t,l,h),su(),!1}if(st)return r=dr.current,r===null?(l!==qf&&(r=Error(s(423),{cause:l}),Ys(Sr(r,a))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,l=Sr(l,a),h=vp(t.stateNode,l,h),Qf(t,h),Gt!==4&&(Gt=2)):(!(r.flags&65536)&&(r.flags|=256),r.flags|=65536,r.lanes=h,l!==qf&&(t=Error(s(422),{cause:l}),Ys(Sr(t,a)))),!1;var g=Error(s(520),{cause:l});if(g=Sr(g,a),yl===null?yl=[g]:yl.push(g),Gt!==4&&(Gt=2),r===null)return!0;l=Sr(l,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,t=h&-h,a.lanes|=t,t=vp(a.stateNode,l,t),Qf(a,t),!1;case 1:if(r=a.type,g=a.stateNode,!(a.flags&128)&&(typeof r.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(va===null||!va.has(g))))return a.flags|=65536,h&=-h,a.lanes|=h,h=ib(h),ab(h,t,a,l),Qf(a,h),!1}a=a.return}while(a!==null);return!1}var bp=Error(s(461)),sn=!1;function En(t,r,a,l){r.child=t===null?f1(r,null,a,l):uo(r,t.child,a,l)}function ob(t,r,a,l,h){a=a.render;var g=r.ref;if("ref"in l){var S={};for(var D in l)D!=="ref"&&(S[D]=l[D])}else S=l;return oo(r),l=ep(t,r,a,S,g,h),D=tp(),t!==null&&!sn?(np(t,r,h),Pi(t,r,h)):(st&&D&&If(r),r.flags|=1,En(t,r,l,h),r.child)}function sb(t,r,a,l,h){if(t===null){var g=a.type;return typeof g=="function"&&!Mf(g)&&g.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=g,lb(t,r,g,l,h)):(t=Oc(a.type,null,l,r,r.mode,h),t.ref=r.ref,t.return=r,r.child=t)}if(g=t.child,!Tp(t,h)){var S=g.memoizedProps;if(a=a.compare,a=a===null?Gs:a,a(S,l)&&t.ref===r.ref)return Pi(t,r,h)}return r.flags|=1,t=Ci(g,l),t.ref=r.ref,t.return=r,r.child=t}function lb(t,r,a,l,h){if(t!==null){var g=t.memoizedProps;if(Gs(g,l)&&t.ref===r.ref)if(sn=!1,r.pendingProps=l=g,Tp(t,h))t.flags&131072&&(sn=!0);else return r.lanes=t.lanes,Pi(t,r,h)}return wp(t,r,a,l,h)}function cb(t,r,a,l){var h=l.children,g=t===null?null:t.memoizedState;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if(r.flags&128){if(g=g===null?a:g.baseLanes|a,t!==null){for(l=r.child=t.child,h=0;l!==null;)h=h|l.lanes|l.childLanes,l=l.sibling;l=h&~g}else l=0,r.child=null;return ub(t,r,g,a,l)}if(a&536870912)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Nc(r,g===null?null:g.cachePool),g===null?Jf():m1(r,g),g1(r);else return l=r.lanes=536870912,ub(t,r,g===null?a:g.baseLanes|a,a,l)}else g===null?(t!==null&&Nc(r,null),Jf(),ha(r)):(Nc(r,g.cachePool),m1(r,g),ha(r),r.memoizedState=null);return En(t,r,h,a),r.child}function ul(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function ub(t,r,a,l,h){var g=$f();return g=g===null?null:{parent:an._currentValue,pool:g},r.memoizedState={baseLanes:a,cachePool:g},t!==null&&Nc(r,null),Jf(),g1(r),t!==null&&es(t,r,l,!0),r.childLanes=h,null}function Jc(t,r){return r=Yc({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function db(t,r,a){return uo(r,t.child,null,a),t=Jc(r,r.pendingProps),t.flags|=2,fr(r),r.memoizedState=null,t}function WT(t,r,a){var l=r.pendingProps,h=(r.flags&128)!=0;if(r.flags&=-129,t===null){if(st){if(l.mode==="hidden")return t=Jc(r,l),r.lanes=536870912,ul(null,t);if(Yf(r),(t=Bt)?(t=S2(t,Tr),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:la===null?null:{id:si,overflow:li},retryLane:536870912,hydrationErrors:null},a=Xv(t),a.return=r,r.child=a,Sn=r,Bt=null)):t=null,t===null)throw ua(r);return r.lanes=536870912,null}return Jc(r,l)}var g=t.memoizedState;if(g!==null){var S=g.dehydrated;if(Yf(r),h)if(r.flags&256)r.flags&=-257,r=db(t,r,a);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(s(558));else if(sn||es(t,r,a,!1),h=(a&t.childLanes)!==0,sn||h){if(l=It,l!==null&&(S=M(l,a),S!==0&&S!==g.retryLane))throw g.retryLane=S,no(t,S),Yn(l,t,S),bp;su(),r=db(t,r,a)}else t=g.treeContext,Bt=Dr(S.nextSibling),Sn=r,st=!0,ca=null,Tr=!1,t!==null&&e1(r,t),r=Jc(r,l),r.flags|=4096;return r}return t=Ci(t.child,{mode:l.mode,children:l.children}),t.ref=r.ref,r.child=t,t.return=r,t}function Xc(t,r){var a=r.ref;if(a===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(t===null||t.ref!==a)&&(r.flags|=4194816)}}function wp(t,r,a,l,h){return oo(r),a=ep(t,r,a,l,void 0,h),l=tp(),t!==null&&!sn?(np(t,r,h),Pi(t,r,h)):(st&&l&&If(r),r.flags|=1,En(t,r,a,h),r.child)}function fb(t,r,a,l,h,g){return oo(r),r.updateQueue=null,a=v1(r,l,a,h),y1(t),l=tp(),t!==null&&!sn?(np(t,r,g),Pi(t,r,g)):(st&&l&&If(r),r.flags|=1,En(t,r,a,g),r.child)}function pb(t,r,a,l,h){if(oo(r),r.stateNode===null){var g=Jo,S=a.contextType;typeof S=="object"&&S&&(g=Cn(S)),g=new a(l,g),r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=yp,r.stateNode=g,g._reactInternals=r,g=r.stateNode,g.props=l,g.state=r.memoizedState,g.refs={},Uf(r),S=a.contextType,g.context=typeof S=="object"&&S?Cn(S):Jo,g.state=r.memoizedState,S=a.getDerivedStateFromProps,typeof S=="function"&&(gp(r,a,S,l),g.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(S=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),S!==g.state&&yp.enqueueReplaceState(g,g.state,null),al(r,l,g,h),il(),g.state=r.memoizedState),typeof g.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(t===null){g=r.stateNode;var D=r.memoizedProps,H=mo(a,D);g.props=H;var ne=g.context,he=a.contextType;S=Jo,typeof he=="object"&&he&&(S=Cn(he));var ge=a.getDerivedStateFromProps;he=typeof ge=="function"||typeof g.getSnapshotBeforeUpdate=="function",D=r.pendingProps!==D,he||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(D||ne!==S)&&nb(r,g,l,S),fa=!1;var ae=r.memoizedState;g.state=ae,al(r,l,g,h),il(),ne=r.memoizedState,D||ae!==ne||fa?(typeof ge=="function"&&(gp(r,a,ge,l),ne=r.memoizedState),(H=fa||tb(r,a,H,l,ae,ne,S))?(he||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(r.flags|=4194308)):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=ne),g.props=l,g.state=ne,g.context=S,l=H):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{g=r.stateNode,Kf(t,r),S=r.memoizedProps,he=mo(a,S),g.props=he,ge=r.pendingProps,ae=g.context,ne=a.contextType,H=Jo,typeof ne=="object"&&ne&&(H=Cn(ne)),D=a.getDerivedStateFromProps,(ne=typeof D=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(S!==ge||ae!==H)&&nb(r,g,l,H),fa=!1,ae=r.memoizedState,g.state=ae,al(r,l,g,h),il();var ue=r.memoizedState;S!==ge||ae!==ue||fa||t!==null&&t.dependencies!==null&&Mc(t.dependencies)?(typeof D=="function"&&(gp(r,a,D,l),ue=r.memoizedState),(he=fa||tb(r,a,he,l,ae,ue,H)||t!==null&&t.dependencies!==null&&Mc(t.dependencies))?(ne||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(l,ue,H),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(l,ue,H)),typeof g.componentDidUpdate=="function"&&(r.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof g.componentDidUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=ue),g.props=l,g.state=ue,g.context=H,l=he):(typeof g.componentDidUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=1024),l=!1)}return g=l,Xc(t,r),l=(r.flags&128)!=0,g||l?(g=r.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:g.render(),r.flags|=1,t!==null&&l?(r.child=uo(r,t.child,null,h),r.child=uo(r,null,a,h)):En(t,r,a,h),r.memoizedState=g.state,t=r.child):t=Pi(t,r,h),t}function hb(t,r,a,l){return io(),r.flags|=256,En(t,r,a,l),r.child}var _p={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xp(t){return{baseLanes:t,cachePool:o1()}}function kp(t,r,a){return t=t===null?0:t.childLanes&~a,r&&(t|=hr),t}function mb(t,r,a){var l=r.pendingProps,h=!1,g=(r.flags&128)!=0,S;if((S=g)||(S=t!==null&&t.memoizedState===null?!1:(Yt.current&2)!=0),S&&(h=!0,r.flags&=-129),S=(r.flags&32)!=0,r.flags&=-33,t===null){if(st){if(h?pa(r):ha(r),(t=Bt)?(t=S2(t,Tr),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:la===null?null:{id:si,overflow:li},retryLane:536870912,hydrationErrors:null},a=Xv(t),a.return=r,r.child=a,Sn=r,Bt=null)):t=null,t===null)throw ua(r);return ih(t)?r.lanes=32:r.lanes=536870912,null}var D=l.children;return l=l.fallback,h?(ha(r),h=r.mode,D=Yc({mode:"hidden",children:D},h),l=ro(l,h,a,null),D.return=r,l.return=r,D.sibling=l,r.child=D,l=r.child,l.memoizedState=xp(a),l.childLanes=kp(t,S,a),r.memoizedState=_p,ul(null,l)):(pa(r),Sp(r,D))}var H=t.memoizedState;if(H!==null&&(D=H.dehydrated,D!==null)){if(g)r.flags&256?(pa(r),r.flags&=-257,r=Cp(t,r,a)):r.memoizedState===null?(ha(r),D=l.fallback,h=r.mode,l=Yc({mode:"visible",children:l.children},h),D=ro(D,h,a,null),D.flags|=2,l.return=r,D.return=r,l.sibling=D,r.child=l,uo(r,t.child,null,a),l=r.child,l.memoizedState=xp(a),l.childLanes=kp(t,S,a),r.memoizedState=_p,r=ul(null,l)):(ha(r),r.child=t.child,r.flags|=128,r=null);else if(pa(r),ih(D)){if(S=D.nextSibling&&D.nextSibling.dataset,S)var ne=S.dgst;S=ne,l=Error(s(419)),l.stack="",l.digest=S,Ys({value:l,source:null,stack:null}),r=Cp(t,r,a)}else if(sn||es(t,r,a,!1),S=(a&t.childLanes)!==0,sn||S){if(S=It,S!==null&&(l=M(S,a),l!==0&&l!==H.retryLane))throw H.retryLane=l,no(t,l),Yn(S,t,l),bp;rh(D)||su(),r=Cp(t,r,a)}else rh(D)?(r.flags|=192,r.child=t.child,r=null):(t=H.treeContext,Bt=Dr(D.nextSibling),Sn=r,st=!0,ca=null,Tr=!1,t!==null&&e1(r,t),r=Sp(r,l.children),r.flags|=4096);return r}return h?(ha(r),D=l.fallback,h=r.mode,H=t.child,ne=H.sibling,l=Ci(H,{mode:"hidden",children:l.children}),l.subtreeFlags=H.subtreeFlags&65011712,ne===null?(D=ro(D,h,a,null),D.flags|=2):D=Ci(ne,D),D.return=r,l.return=r,l.sibling=D,r.child=l,ul(null,l),l=r.child,D=t.child.memoizedState,D===null?D=xp(a):(h=D.cachePool,h===null?h=o1():(H=an._currentValue,h=h.parent===H?h:{parent:H,pool:H}),D={baseLanes:D.baseLanes|a,cachePool:h}),l.memoizedState=D,l.childLanes=kp(t,S,a),r.memoizedState=_p,ul(t.child,l)):(pa(r),a=t.child,t=a.sibling,a=Ci(a,{mode:"visible",children:l.children}),a.return=r,a.sibling=null,t!==null&&(S=r.deletions,S===null?(r.deletions=[t],r.flags|=16):S.push(t)),r.child=a,r.memoizedState=null,a)}function Sp(t,r){return r=Yc({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function Yc(t,r){return t=ur(22,t,null,r),t.lanes=0,t}function Cp(t,r,a){return uo(r,t.child,null,a),t=Sp(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function gb(t,r,a){t.lanes|=r;var l=t.alternate;l!==null&&(l.lanes|=r),Ff(t.return,r,a)}function Ep(t,r,a,l,h,g){var S=t.memoizedState;S===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:h,treeForkCount:g}:(S.isBackwards=r,S.rendering=null,S.renderingStartTime=0,S.last=l,S.tail=a,S.tailMode=h,S.treeForkCount=g)}function yb(t,r,a){var l=r.pendingProps,h=l.revealOrder,g=l.tail;l=l.children;var S=Yt.current,D=(S&2)!=0;if(D?(S=S&1|2,r.flags|=128):S&=1,Pe(Yt,S),En(t,r,l,a),l=st?Xs:0,!D&&t!==null&&t.flags&128)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&gb(t,a,r);else if(t.tag===19)gb(t,a,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(h){case"forwards":for(a=r.child,h=null;a!==null;)t=a.alternate,t!==null&&Fc(t)===null&&(h=a),a=a.sibling;a=h,a===null?(h=r.child,r.child=null):(h=a.sibling,a.sibling=null),Ep(r,!1,h,a,g,l);break;case"backwards":case"unstable_legacy-backwards":for(a=null,h=r.child,r.child=null;h!==null;){if(t=h.alternate,t!==null&&Fc(t)===null){r.child=h;break}t=h.sibling,h.sibling=a,a=h,h=t}Ep(r,!0,a,null,g,l);break;case"together":Ep(r,!1,null,null,void 0,l);break;default:r.memoizedState=null}return r.child}function Pi(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),ya|=r.lanes,(a&r.childLanes)===0)if(t!==null){if(es(t,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(s(153));if(r.child!==null){for(t=r.child,a=Ci(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=Ci(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function Tp(t,r){return(t.lanes&r)===0?(t=t.dependencies,!!(t!==null&&Mc(t))):!0}function UT(t,r,a){switch(r.tag){case 3:un(r,r.stateNode.containerInfo),da(r,an,t.memoizedState.cache),io();break;case 27:case 5:tn(r);break;case 4:un(r,r.stateNode.containerInfo);break;case 10:da(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Yf(r),null;break;case 13:var l=r.memoizedState;if(l!==null)return l.dehydrated===null?(a&r.child.childLanes)===0?(pa(r),t=Pi(t,r,a),t===null?null:t.sibling):mb(t,r,a):(pa(r),r.flags|=128,null);pa(r);break;case 19:var h=(t.flags&128)!=0;if(l=(a&r.childLanes)!==0,l||(l=(es(t,r,a,!1),(a&r.childLanes)!==0)),h){if(l)return yb(t,r,a);r.flags|=128}if(h=r.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),Pe(Yt,Yt.current),l)break;return null;case 22:return r.lanes=0,cb(t,r,a,r.pendingProps);case 24:da(r,an,t.memoizedState.cache)}return Pi(t,r,a)}function vb(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps)sn=!0;else{if(!Tp(t,a)&&!(r.flags&128))return sn=!1,UT(t,r,a);sn=!!(t.flags&131072)}else sn=!1,st&&r.flags&1048576&&Zv(r,Xs,r.index);switch(r.lanes=0,r.tag){case 16:e:{var l=r.pendingProps;if(t=lo(r.elementType),r.type=t,typeof t=="function")Mf(t)?(l=mo(t,l),r.tag=1,r=pb(null,r,t,l,a)):(r.tag=0,r=wp(null,r,t,l,a));else{if(t!=null){var h=t.$$typeof;if(h===pe){r.tag=11,r=ob(null,r,t,l,a);break e}else if(h===W){r.tag=14,r=sb(null,r,t,l,a);break e}}throw r=Z(t)||t,Error(s(306,r,""))}}return r;case 0:return wp(t,r,r.type,r.pendingProps,a);case 1:return l=r.type,h=mo(l,r.pendingProps),pb(t,r,l,h,a);case 3:e:{if(un(r,r.stateNode.containerInfo),t===null)throw Error(s(387));l=r.pendingProps;var g=r.memoizedState;h=g.element,Kf(t,r),al(r,l,null,a);var S=r.memoizedState;if(l=S.cache,da(r,an,l),l!==g.cache&&Bf(r,[an],a,!0),il(),l=S.element,g.isDehydrated)if(g={element:l,isDehydrated:!1,cache:S.cache},r.updateQueue.baseState=g,r.memoizedState=g,r.flags&256){r=hb(t,r,l,a);break e}else if(l!==h){h=Sr(Error(s(424)),r),Ys(h),r=hb(t,r,l,a);break e}else for((t=r.stateNode.containerInfo,t.nodeType)===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Bt=Dr(t.firstChild),Sn=r,st=!0,ca=null,Tr=!0,a=f1(r,null,l,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(io(),l===h){r=Pi(t,r,a);break e}En(t,r,l,a)}r=r.child}return r;case 26:return Xc(t,r),t===null?(a=O2(r.type,null,r.pendingProps,null))?r.memoizedState=a:st||(a=r.type,t=r.pendingProps,l=hu(mt.current).createElement(a),l[He]=r,l[Ve]=t,Tn(l,a,t),Xt(l),r.stateNode=l):r.memoizedState=O2(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return tn(r),t===null&&st&&(l=r.stateNode=T2(r.type,r.pendingProps,mt.current),Sn=r,Tr=!0,h=Bt,xa(r.type)?(ah=h,Bt=Dr(l.firstChild)):Bt=h),En(t,r,r.pendingProps.children,a),Xc(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&st&&((h=l=Bt)&&(l=wR(l,r.type,r.pendingProps,Tr),l===null?h=!1:(r.stateNode=l,Sn=r,Bt=Dr(l.firstChild),Tr=!1,h=!0)),h||ua(r)),tn(r),h=r.type,g=r.pendingProps,S=t===null?null:t.memoizedProps,l=g.children,eh(h,g)?l=null:S!==null&&eh(h,S)&&(r.flags|=32),r.memoizedState!==null&&(h=ep(t,r,NT,null,null,a),Cl._currentValue=h),Xc(t,r),En(t,r,l,a),r.child;case 6:return t===null&&st&&((t=a=Bt)&&(a=_R(a,r.pendingProps,Tr),a===null?t=!1:(r.stateNode=a,Sn=r,Bt=null,t=!0)),t||ua(r)),null;case 13:return mb(t,r,a);case 4:return un(r,r.stateNode.containerInfo),l=r.pendingProps,t===null?r.child=uo(r,null,l,a):En(t,r,l,a),r.child;case 11:return ob(t,r,r.type,r.pendingProps,a);case 7:return En(t,r,r.pendingProps,a),r.child;case 8:return En(t,r,r.pendingProps.children,a),r.child;case 12:return En(t,r,r.pendingProps.children,a),r.child;case 10:return l=r.pendingProps,da(r,r.type,l.value),En(t,r,l.children,a),r.child;case 9:return h=r.type._context,l=r.pendingProps.children,oo(r),h=Cn(h),l=l(h),r.flags|=1,En(t,r,l,a),r.child;case 14:return sb(t,r,r.type,r.pendingProps,a);case 15:return lb(t,r,r.type,r.pendingProps,a);case 19:return yb(t,r,a);case 31:return WT(t,r,a);case 22:return cb(t,r,a,r.pendingProps);case 24:return oo(r),l=Cn(an),t===null?(h=$f(),h===null&&(h=It,g=Hf(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=a),h=g),r.memoizedState={parent:l,cache:h},Uf(r),da(r,an,h)):((t.lanes&a)!==0&&(Kf(t,r),al(r,null,null,a),il()),h=t.memoizedState,g=r.memoizedState,h.parent===l?(l=g.cache,da(r,an,l),l!==h.cache&&Bf(r,[an],a,!0)):(h={parent:l,cache:l},r.memoizedState=h,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=h),da(r,an,l))),En(t,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Mi(t){t.flags|=4}function Rp(t,r,a,l,h){if((r=(t.mode&32)!=0)&&(r=!1),r){if(t.flags|=16777216,(h&335544128)===h)if(t.stateNode.complete)t.flags|=8192;else if(Wb())t.flags|=8192;else throw co=Ac,Wf}else t.flags&=-16777217}function bb(t,r){if(r.type!=="stylesheet"||r.state.loading&4)t.flags&=-16777217;else if(t.flags|=16777216,!I2(r))if(Wb())t.flags|=8192;else throw co=Ac,Wf}function Zc(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag===22?536870912:bi(),t.lanes|=r,fs|=r)}function dl(t,r){if(!st)switch(t.tailMode){case"hidden":r=t.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function Ht(t){var r=t.alternate!==null&&t.alternate.child===t.child,a=0,l=0;if(r)for(var h=t.child;h!==null;)a|=h.lanes|h.childLanes,l|=h.subtreeFlags&65011712,l|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)a|=h.lanes|h.childLanes,l|=h.subtreeFlags,l|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=l,t.childLanes=a,r}function KT(t,r,a){var l=r.pendingProps;switch(Af(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ht(r),null;case 1:return Ht(r),null;case 3:return a=r.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),Ri(an),We(),a.pendingContext&&(a.pendingContext=(a.context=a.pendingContext,null)),(t===null||t.child===null)&&(Zo(r)?Mi(r):t===null||t.memoizedState.isDehydrated&&!(r.flags&256)||(r.flags|=1024,jf())),Ht(r),null;case 26:var h=r.type,g=r.memoizedState;return t===null?(Mi(r),g===null?(Ht(r),Rp(r,h,null,l,a)):(Ht(r),bb(r,g))):g?g===t.memoizedState?(Ht(r),r.flags&=-16777217):(Mi(r),Ht(r),bb(r,g)):(t=t.memoizedProps,t!==l&&Mi(r),Ht(r),Rp(r,h,t,l,a)),null;case 27:if(wt(r),a=mt.current,h=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Mi(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Ht(r),null}t=Ae.current,Zo(r)?t1(r,t):(t=T2(h,l,a),r.stateNode=t,Mi(r))}return Ht(r),null;case 5:if(wt(r),h=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Mi(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Ht(r),null}if(g=Ae.current,Zo(r))t1(r,g);else{var S=hu(mt.current);switch(g){case 1:g=S.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:g=S.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":g=S.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":g=S.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":g=S.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof l.is=="string"?S.createElement("select",{is:l.is}):S.createElement("select"),l.multiple?g.multiple=!0:l.size&&(g.size=l.size);break;default:g=typeof l.is=="string"?S.createElement(h,{is:l.is}):S.createElement(h)}}g[He]=r,g[Ve]=l;e:for(S=r.child;S!==null;){if(S.tag===5||S.tag===6)g.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===r)break e;for(;S.sibling===null;){if(S.return===null||S.return===r)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}r.stateNode=g;e:switch(Tn(g,h,l),h){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Mi(r)}}return Ht(r),Rp(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,a),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==l&&Mi(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(t=mt.current,Zo(r)){if(t=r.stateNode,a=r.memoizedProps,l=null,h=Sn,h!==null)switch(h.tag){case 27:case 5:l=h.memoizedProps}t[He]=r,t=!!(t.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||g2(t.nodeValue,a)),t||ua(r,!0)}else t=hu(t).createTextNode(l),t[He]=r,r.stateNode=t}return Ht(r),null;case 31:if(a=r.memoizedState,t===null||t.memoizedState!==null){if(l=Zo(r),a!==null){if(t===null){if(!l)throw Error(s(318));if(t=r.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(557));t[He]=r}else io(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;Ht(r),t=!1}else a=jf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return r.flags&256?(fr(r),r):(fr(r),null);if(r.flags&128)throw Error(s(558))}return Ht(r),null;case 13:if(l=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=Zo(r),l!==null&&l.dehydrated!==null){if(t===null){if(!h)throw Error(s(318));if(h=r.memoizedState,h=h===null?null:h.dehydrated,!h)throw Error(s(317));h[He]=r}else io(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;Ht(r),h=!1}else h=jf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return r.flags&256?(fr(r),r):(fr(r),null)}return fr(r),r.flags&128?(r.lanes=a,r):(a=l!==null,t=t!==null&&t.memoizedState!==null,a&&(l=r.child,h=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(h=l.alternate.memoizedState.cachePool.pool),g=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==h&&(l.flags|=2048)),a!==t&&a&&(r.child.flags|=8192),Zc(r,r.updateQueue),Ht(r),null);case 4:return We(),t===null&&f2(r.stateNode.containerInfo),Ht(r),null;case 10:return Ri(r.type),Ht(r),null;case 19:if(je(Yt),l=r.memoizedState,l===null)return Ht(r),null;if(h=(r.flags&128)!=0,g=l.rendering,g===null)if(h)dl(l,!1);else{if(Gt!==0||t!==null&&t.flags&128)for(t=r.child;t!==null;){if(g=Fc(t),g!==null){for(r.flags|=128,dl(l,!1),t=g.updateQueue,r.updateQueue=t,Zc(r,t),r.subtreeFlags=0,t=a,a=r.child;a!==null;)Jv(a,t),a=a.sibling;return Pe(Yt,Yt.current&1|2),st&&Ei(r,l.treeForkCount),r.child}t=t.sibling}l.tail!==null&&Ut()>iu&&(r.flags|=128,h=!0,dl(l,!1),r.lanes=4194304)}else{if(!h)if(t=Fc(g),t!==null){if(r.flags|=128,h=!0,t=t.updateQueue,r.updateQueue=t,Zc(r,t),dl(l,!0),l.tail===null&&l.tailMode==="hidden"&&!g.alternate&&!st)return Ht(r),null}else 2*Ut()-l.renderingStartTime>iu&&a!==536870912&&(r.flags|=128,h=!0,dl(l,!1),r.lanes=4194304);l.isBackwards?(g.sibling=r.child,r.child=g):(t=l.last,t===null?r.child=g:t.sibling=g,l.last=g)}return l.tail===null?(Ht(r),null):(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Ut(),t.sibling=null,a=Yt.current,Pe(Yt,h?a&1|2:a&1),st&&Ei(r,l.treeForkCount),t);case 22:case 23:return fr(r),Xf(),l=r.memoizedState!==null,t===null?l&&(r.flags|=8192):t.memoizedState!==null!==l&&(r.flags|=8192),l?a&536870912&&!(r.flags&128)&&(Ht(r),r.subtreeFlags&6&&(r.flags|=8192)):Ht(r),a=r.updateQueue,a!==null&&Zc(r,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==a&&(r.flags|=2048),t!==null&&je(so),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),Ri(an),Ht(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function QT(t,r){switch(Af(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Ri(an),We(),t=r.flags,t&65536&&!(t&128)?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return wt(r),null;case 31:if(r.memoizedState!==null){if(fr(r),r.alternate===null)throw Error(s(340));io()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(fr(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(s(340));io()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return je(Yt),null;case 4:return We(),null;case 10:return Ri(r.type),null;case 22:case 23:return fr(r),Xf(),t!==null&&je(so),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return Ri(an),null;case 25:return null;default:return null}}function wb(t,r){switch(Af(r),r.tag){case 3:Ri(an),We();break;case 26:case 27:case 5:wt(r);break;case 4:We();break;case 31:r.memoizedState!==null&&fr(r);break;case 13:fr(r);break;case 19:je(Yt);break;case 10:Ri(r.type);break;case 22:case 23:fr(r),Xf(),t!==null&&je(so);break;case 24:Ri(an)}}function fl(t,r){try{var a=r.updateQueue,l=a===null?null:a.lastEffect;if(l!==null){var h=l.next;a=h;do{if((a.tag&t)===t){l=void 0;var g=a.create,S=a.inst;l=g(),S.destroy=l}a=a.next}while(a!==h)}}catch(D){Et(r,r.return,D)}}function ma(t,r,a){try{var l=r.updateQueue,h=l===null?null:l.lastEffect;if(h!==null){var g=h.next;l=g;do{if((l.tag&t)===t){var S=l.inst,D=S.destroy;if(D!==void 0){S.destroy=void 0,h=r;var H=a,ne=D;try{ne()}catch(he){Et(h,H,he)}}}l=l.next}while(l!==g)}}catch(he){Et(r,r.return,he)}}function _b(t){var r=t.updateQueue;if(r!==null){var a=t.stateNode;try{h1(r,a)}catch(l){Et(t,t.return,l)}}}function xb(t,r,a){a.props=mo(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(l){Et(t,r,l)}}function pl(t,r){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof a=="function"?t.refCleanup=a(l):a.current=l}}catch(h){Et(t,r,h)}}function ci(t,r){var a=t.ref,l=t.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(h){Et(t,r,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(h){Et(t,r,h)}else a.current=null}function kb(t){var r=t.type,a=t.memoizedProps,l=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(h){Et(t,t.return,h)}}function Dp(t,r,a){try{var l=t.stateNode;hR(l,t.type,a,r),l[Ve]=r}catch(h){Et(t,t.return,h)}}function Sb(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&xa(t.type)||t.tag===4}function Op(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Sb(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&xa(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Pp(t,r,a){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(t),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=xr));else if(l!==4&&(l===27&&xa(t.type)&&(a=t.stateNode,r=null),t=t.child,t!==null))for(Pp(t,r,a),t=t.sibling;t!==null;)Pp(t,r,a),t=t.sibling}function eu(t,r,a){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?a.insertBefore(t,r):a.appendChild(t);else if(l!==4&&(l===27&&xa(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(eu(t,r,a),t=t.sibling;t!==null;)eu(t,r,a),t=t.sibling}function Cb(t){var r=t.stateNode,a=t.memoizedProps;try{for(var l=t.type,h=r.attributes;h.length;)r.removeAttributeNode(h[0]);Tn(r,l,a),r[He]=t,r[Ve]=a}catch(g){Et(t,t.return,g)}}var Li=!1,ln=!1,Mp=!1,Eb=typeof WeakSet=="function"?WeakSet:Set,kn=null;function GT(t,r){if(t=t.containerInfo,Yp=_u,t=Bv(t),Cf(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var h=l.anchorOffset,g=l.focusNode;l=l.focusOffset;try{a.nodeType,g.nodeType}catch{a=null;break e}var S=0,D=-1,H=-1,ne=0,he=0,ge=t,ae=null;t:for(;;){for(var ue;ge!==a||h!==0&&ge.nodeType!==3||(D=S+h),ge!==g||l!==0&&ge.nodeType!==3||(H=S+l),ge.nodeType===3&&(S+=ge.nodeValue.length),(ue=ge.firstChild)!==null;)ae=ge,ge=ue;for(;;){if(ge===t)break t;if(ae===a&&++ne===h&&(D=S),ae===g&&++he===l&&(H=S),(ue=ge.nextSibling)!==null)break;ge=ae,ae=ge.parentNode}ge=ue}a=D===-1||H===-1?null:{start:D,end:H}}else a=null}a||(a={start:0,end:0})}else a=null;for(Zp={focusedElem:t,selectionRange:a},_u=!1,kn=r;kn!==null;)if(r=kn,t=r.child,r.subtreeFlags&1028&&t!==null)t.return=r,kn=t;else for(;kn!==null;){switch(r=kn,g=r.alternate,t=r.flags,r.tag){case 0:if(t&4&&(t=r.updateQueue,t=t===null?null:t.events,t!==null))for(a=0;a<t.length;a++)h=t[a],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if(t&1024&&g!==null){t=void 0,a=r,h=g.memoizedProps,g=g.memoizedState,l=a.stateNode;try{var De=mo(a.type,h);t=l.getSnapshotBeforeUpdate(De,g),l.__reactInternalSnapshotBeforeUpdate=t}catch(Ie){Et(a,a.return,Ie)}}break;case 3:if(t&1024){if(t=r.stateNode.containerInfo,a=t.nodeType,a===9)nh(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":nh(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(t&1024)throw Error(s(163))}if(t=r.sibling,t!==null){t.return=r.return,kn=t;break}kn=r.return}}function Tb(t,r,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:Ii(t,a),l&4&&fl(5,a);break;case 1:if(Ii(t,a),l&4)if(t=a.stateNode,r===null)try{t.componentDidMount()}catch(S){Et(a,a.return,S)}else{var h=mo(a.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(h,r,t.__reactInternalSnapshotBeforeUpdate)}catch(S){Et(a,a.return,S)}}l&64&&_b(a),l&512&&pl(a,a.return);break;case 3:if(Ii(t,a),l&64&&(t=a.updateQueue,t!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{h1(t,r)}catch(S){Et(a,a.return,S)}}break;case 27:r===null&&l&4&&Cb(a);case 26:case 5:Ii(t,a),r===null&&l&4&&kb(a),l&512&&pl(a,a.return);break;case 12:Ii(t,a);break;case 31:Ii(t,a),l&4&&Ob(t,a);break;case 13:Ii(t,a),l&4&&Pb(t,a),l&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=iR.bind(null,a),xR(t,a))));break;case 22:if(l=a.memoizedState!==null||Li,!l){r=r!==null&&r.memoizedState!==null||ln,h=Li;var g=ln;Li=l,(ln=r)&&!g?Ai(t,a,(a.subtreeFlags&8772)!=0):Ii(t,a),Li=h,ln=g}break;case 30:break;default:Ii(t,a)}}function Rb(t){var r=t.alternate;r!==null&&(t.alternate=null,Rb(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&wn(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Wt=null,Qn=!1;function Ni(t,r,a){for(a=a.child;a!==null;)Db(t,r,a),a=a.sibling}function Db(t,r,a){if(Jt&&typeof Jt.onCommitFiberUnmount=="function")try{Jt.onCommitFiberUnmount(wr,a)}catch{}switch(a.tag){case 26:ln||ci(a,r),Ni(t,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ln||ci(a,r);var l=Wt,h=Qn;xa(a.type)&&(Wt=a.stateNode,Qn=!1),Ni(t,r,a),xl(a.stateNode),Wt=l,Qn=h;break;case 5:ln||ci(a,r);case 6:if(l=Wt,h=Qn,Wt=null,Ni(t,r,a),Wt=l,Qn=h,Wt!==null)if(Qn)try{(Wt.nodeType===9?Wt.body:Wt.nodeName==="HTML"?Wt.ownerDocument.body:Wt).removeChild(a.stateNode)}catch(g){Et(a,r,g)}else try{Wt.removeChild(a.stateNode)}catch(g){Et(a,r,g)}break;case 18:Wt!==null&&(Qn?(t=Wt,x2(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),ws(t)):x2(Wt,a.stateNode));break;case 4:l=Wt,h=Qn,Wt=a.stateNode.containerInfo,Qn=!0,Ni(t,r,a),Wt=l,Qn=h;break;case 0:case 11:case 14:case 15:ma(2,a,r),ln||ma(4,a,r),Ni(t,r,a);break;case 1:ln||(ci(a,r),l=a.stateNode,typeof l.componentWillUnmount=="function"&&xb(a,r,l)),Ni(t,r,a);break;case 21:Ni(t,r,a);break;case 22:ln=(l=ln)||a.memoizedState!==null,Ni(t,r,a),ln=l;break;default:Ni(t,r,a)}}function Ob(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ws(t)}catch(a){Et(r,r.return,a)}}}function Pb(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ws(t)}catch(a){Et(r,r.return,a)}}function JT(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new Eb),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new Eb),r;default:throw Error(s(435,t.tag))}}function tu(t,r){var a=JT(t);r.forEach(function(l){if(!a.has(l)){a.add(l);var h=aR.bind(null,t,l);l.then(h,h)}})}function Gn(t,r){var a=r.deletions;if(a!==null)for(var l=0;l<a.length;l++){var h=a[l],g=t,S=r,D=S;e:for(;D!==null;){switch(D.tag){case 27:if(xa(D.type)){Wt=D.stateNode,Qn=!1;break e}break;case 5:Wt=D.stateNode,Qn=!1;break e;case 3:case 4:Wt=D.stateNode.containerInfo,Qn=!0;break e}D=D.return}if(Wt===null)throw Error(s(160));Db(g,S,h),Wt=null,Qn=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Mb(r,t),r=r.sibling}var Qr=null;function Mb(t,r){var a=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Gn(r,t),Jn(t),l&4&&(ma(3,t,t.return),fl(3,t),ma(5,t,t.return));break;case 1:Gn(r,t),Jn(t),l&512&&(ln||a===null||ci(a,a.return)),l&64&&Li&&(t=t.updateQueue,t!==null&&(l=t.callbacks,l!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var h=Qr;if(Gn(r,t),Jn(t),l&512&&(ln||a===null||ci(a,a.return)),l&4){var g=a===null?null:a.memoizedState;if(l=t.memoizedState,a===null)if(l===null)if(t.stateNode===null){e:{l=t.type,a=t.memoizedProps,h=h.ownerDocument||h;t:switch(l){case"title":g=h.getElementsByTagName("title")[0],(!g||g[ut]||g[He]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=h.createElement(l),h.head.insertBefore(g,h.querySelector("head > title"))),Tn(g,l,a),g[He]=t,Xt(g),l=g;break e;case"link":var S=L2("link","href",h).get(l+(a.href||""));if(S){for(var D=0;D<S.length;D++)if(g=S[D],g.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&g.getAttribute("rel")===(a.rel==null?null:a.rel)&&g.getAttribute("title")===(a.title==null?null:a.title)&&g.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){S.splice(D,1);break t}}g=h.createElement(l),Tn(g,l,a),h.head.appendChild(g);break;case"meta":if(S=L2("meta","content",h).get(l+(a.content||""))){for(D=0;D<S.length;D++)if(g=S[D],g.getAttribute("content")===(a.content==null?null:""+a.content)&&g.getAttribute("name")===(a.name==null?null:a.name)&&g.getAttribute("property")===(a.property==null?null:a.property)&&g.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&g.getAttribute("charset")===(a.charSet==null?null:a.charSet)){S.splice(D,1);break t}}g=h.createElement(l),Tn(g,l,a),h.head.appendChild(g);break;default:throw Error(s(468,l))}g[He]=t,Xt(g),l=g}t.stateNode=l}else N2(h,t.type,t.stateNode);else t.stateNode=M2(h,l,t.memoizedProps);else g===l?l===null&&t.stateNode!==null&&Dp(t,t.memoizedProps,a.memoizedProps):(g===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):g.count--,l===null?N2(h,t.type,t.stateNode):M2(h,l,t.memoizedProps))}break;case 27:Gn(r,t),Jn(t),l&512&&(ln||a===null||ci(a,a.return)),a!==null&&l&4&&Dp(t,t.memoizedProps,a.memoizedProps);break;case 5:if(Gn(r,t),Jn(t),l&512&&(ln||a===null||ci(a,a.return)),t.flags&32){h=t.stateNode;try{xi(h,"")}catch(De){Et(t,t.return,De)}}l&4&&t.stateNode!=null&&(h=t.memoizedProps,Dp(t,h,a===null?h:a.memoizedProps)),l&1024&&(Mp=!0);break;case 6:if(Gn(r,t),Jn(t),l&4){if(t.stateNode===null)throw Error(s(162));l=t.memoizedProps,a=t.stateNode;try{a.nodeValue=l}catch(De){Et(t,t.return,De)}}break;case 3:if(yu=null,h=Qr,Qr=mu(r.containerInfo),Gn(r,t),Qr=h,Jn(t),l&4&&a!==null&&a.memoizedState.isDehydrated)try{ws(r.containerInfo)}catch(De){Et(t,t.return,De)}Mp&&(Mp=!1,Lb(t));break;case 4:l=Qr,Qr=mu(t.stateNode.containerInfo),Gn(r,t),Jn(t),Qr=l;break;case 12:Gn(r,t),Jn(t);break;case 31:Gn(r,t),Jn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,tu(t,l)));break;case 13:Gn(r,t),Jn(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(ru=Ut()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,tu(t,l)));break;case 22:h=t.memoizedState!==null;var H=a!==null&&a.memoizedState!==null,ne=Li,he=ln;if(Li=ne||h,ln=he||H,Gn(r,t),ln=he,Li=ne,Jn(t),l&8192)e:for(r=t.stateNode,r._visibility=h?r._visibility&-2:r._visibility|1,h&&(a===null||H||Li||ln||go(t)),a=null,r=t;;){if(r.tag===5||r.tag===26){if(a===null){H=a=r;try{if(g=H.stateNode,h)S=g.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{D=H.stateNode;var ge=H.memoizedProps.style,ae=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;D.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(De){Et(H,H.return,De)}}}else if(r.tag===6){if(a===null){H=r;try{H.stateNode.nodeValue=h?"":H.memoizedProps}catch(De){Et(H,H.return,De)}}}else if(r.tag===18){if(a===null){H=r;try{var ue=H.stateNode;h?k2(ue,!0):k2(H.stateNode,!1)}catch(De){Et(H,H.return,De)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;a===r&&(a=null),r=r.return}a===r&&(a=null),r.sibling.return=r.return,r=r.sibling}l&4&&(l=t.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,tu(t,a))));break;case 19:Gn(r,t),Jn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,tu(t,l)));break;case 30:break;case 21:break;default:Gn(r,t),Jn(t)}}function Jn(t){var r=t.flags;if(r&2){try{for(var a,l=t.return;l!==null;){if(Sb(l)){a=l;break}l=l.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var h=a.stateNode;eu(t,Op(t),h);break;case 5:var g=a.stateNode;a.flags&32&&(xi(g,""),a.flags&=-33),eu(t,Op(t),g);break;case 3:case 4:var S=a.stateNode.containerInfo;Pp(t,Op(t),S);break;default:throw Error(s(161))}}catch(D){Et(t,t.return,D)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function Lb(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;Lb(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Ii(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Tb(t,r.alternate,r),r=r.sibling}function go(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:ma(4,r,r.return),go(r);break;case 1:ci(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&xb(r,r.return,a),go(r);break;case 27:xl(r.stateNode);case 26:case 5:ci(r,r.return),go(r);break;case 22:r.memoizedState===null&&go(r);break;case 30:go(r);break;default:go(r)}t=t.sibling}}function Ai(t,r,a){for(a&&(a=(r.subtreeFlags&8772)!=0),r=r.child;r!==null;){var l=r.alternate,h=t,g=r,S=g.flags;switch(g.tag){case 0:case 11:case 15:Ai(h,g,a),fl(4,g);break;case 1:if(Ai(h,g,a),l=g,h=l.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(ne){Et(l,l.return,ne)}if(l=g,h=l.updateQueue,h!==null){var D=l.stateNode;try{var H=h.shared.hiddenCallbacks;if(H!==null)for(h.shared.hiddenCallbacks=null,h=0;h<H.length;h++)p1(H[h],D)}catch(ne){Et(l,l.return,ne)}}a&&S&64&&_b(g),pl(g,g.return);break;case 27:Cb(g);case 26:case 5:Ai(h,g,a),a&&l===null&&S&4&&kb(g),pl(g,g.return);break;case 12:Ai(h,g,a);break;case 31:Ai(h,g,a),a&&S&4&&Ob(h,g);break;case 13:Ai(h,g,a),a&&S&4&&Pb(h,g);break;case 22:g.memoizedState===null&&Ai(h,g,a),pl(g,g.return);break;case 30:break;default:Ai(h,g,a)}r=r.sibling}}function Lp(t,r){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&Zs(a))}function Np(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Zs(t))}function Gr(t,r,a,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Nb(t,r,a,l),r=r.sibling}function Nb(t,r,a,l){var h=r.flags;switch(r.tag){case 0:case 11:case 15:Gr(t,r,a,l),h&2048&&fl(9,r);break;case 1:Gr(t,r,a,l);break;case 3:Gr(t,r,a,l),h&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Zs(t)));break;case 12:if(h&2048){Gr(t,r,a,l),t=r.stateNode;try{var g=r.memoizedProps,S=g.id,D=g.onPostCommit;typeof D=="function"&&D(S,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(H){Et(r,r.return,H)}}else Gr(t,r,a,l);break;case 31:Gr(t,r,a,l);break;case 13:Gr(t,r,a,l);break;case 23:break;case 22:g=r.stateNode,S=r.alternate,r.memoizedState===null?g._visibility&2?Gr(t,r,a,l):(g._visibility|=2,cs(t,r,a,l,(r.subtreeFlags&10256)!=0||!1)):g._visibility&2?Gr(t,r,a,l):hl(t,r),h&2048&&Lp(S,r);break;case 24:Gr(t,r,a,l),h&2048&&Np(r.alternate,r);break;default:Gr(t,r,a,l)}}function cs(t,r,a,l,h){for(h&&(h=(r.subtreeFlags&10256)!=0||!1),r=r.child;r!==null;){var g=t,S=r,D=a,H=l,ne=S.flags;switch(S.tag){case 0:case 11:case 15:cs(g,S,D,H,h),fl(8,S);break;case 23:break;case 22:var he=S.stateNode;S.memoizedState===null?(he._visibility|=2,cs(g,S,D,H,h)):he._visibility&2?cs(g,S,D,H,h):hl(g,S),h&&ne&2048&&Lp(S.alternate,S);break;case 24:cs(g,S,D,H,h),h&&ne&2048&&Np(S.alternate,S);break;default:cs(g,S,D,H,h)}r=r.sibling}}function hl(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=t,l=r,h=l.flags;switch(l.tag){case 22:hl(a,l),h&2048&&Lp(l.alternate,l);break;case 24:hl(a,l),h&2048&&Np(l.alternate,l);break;default:hl(a,l)}r=r.sibling}}var ml=8192;function us(t,r,a){if(t.subtreeFlags&ml)for(t=t.child;t!==null;)Ib(t,r,a),t=t.sibling}function Ib(t,r,a){switch(t.tag){case 26:us(t,r,a),t.flags&ml&&t.memoizedState!==null&&NR(a,Qr,t.memoizedState,t.memoizedProps);break;case 5:us(t,r,a);break;case 3:case 4:var l=Qr;Qr=mu(t.stateNode.containerInfo),us(t,r,a),Qr=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=ml,ml=16777216,us(t,r,a),ml=l):us(t,r,a));break;default:us(t,r,a)}}function Ab(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function gl(t){var r=t.deletions;if(t.flags&16){if(r!==null)for(var a=0;a<r.length;a++){var l=r[a];kn=l,jb(l,t)}Ab(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)qb(t),t=t.sibling}function qb(t){switch(t.tag){case 0:case 11:case 15:gl(t),t.flags&2048&&ma(9,t,t.return);break;case 3:gl(t);break;case 12:gl(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,nu(t)):gl(t);break;default:gl(t)}}function nu(t){var r=t.deletions;if(t.flags&16){if(r!==null)for(var a=0;a<r.length;a++){var l=r[a];kn=l,jb(l,t)}Ab(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:ma(8,r,r.return),nu(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,nu(r));break;default:nu(r)}t=t.sibling}}function jb(t,r){for(;kn!==null;){var a=kn;switch(a.tag){case 0:case 11:case 15:ma(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Zs(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,kn=l;else e:for(a=t;kn!==null;){l=kn;var h=l.sibling,g=l.return;if(Rb(l),l===a){kn=null;break e}if(h!==null){h.return=g,kn=h;break e}kn=g}}}var XT={getCacheForType:function(t){var r=Cn(an),a=r.data.get(t);return a===void 0&&(a=t(),r.data.set(t,a)),a},cacheSignal:function(){return Cn(an).controller.signal}},YT=typeof WeakMap=="function"?WeakMap:Map,yt=0,It=null,tt=null,it=0,Ct=0,pr=null,ga=!1,ds=!1,Ip=!1,qi=0,Gt=0,ya=0,yo=0,Ap=0,hr=0,fs=0,yl=null,Xn=null,qp=!1,ru=0,zb=0,iu=1/0,au=null,va=null,hn=0,ba=null,ps=null,ji=0,jp=0,zp=null,Fb=null,vl=0,Fp=null;function Rr(){return yt&2&&it!==0?it&-it:se.T===null?te():Up()}function Bb(){if(hr===0)if(!(it&536870912)||st){var t=St;St<<=1,!(St&3932160)&&(St=262144),hr=t}else hr=536870912;return t=dr.current,t!==null&&(t.flags|=32),hr}function Yn(t,r,a){(t===It&&(Ct===2||Ct===9)||t.cancelPendingCommit!==null)&&(hs(t,0),wa(t,it,hr,!1)),Ln(t,a),(!(yt&2)||t!==It)&&(t===It&&(!(yt&2)&&(yo|=a),Gt===4&&wa(t,it,hr,!1)),zi(t))}function Hb(t,r,a){if(yt&6)throw Error(s(327));var l=!a&&(r&127)==0&&(r&t.expiredLanes)===0||bn(t,r),h=l?tR(t,r):Hp(t,r,!0),g=l;do{if(h===0){ds&&!l&&wa(t,r,0,!1);break}else{if(a=t.current.alternate,g&&!ZT(a)){h=Hp(t,r,!1),g=!1;continue}if(h===2){if(g=r,t.errorRecoveryDisabledLanes&g)var S=0;else S=t.pendingLanes&-536870913,S=S===0?S&536870912?536870912:0:S;if(S!==0){r=S;e:{var D=t;h=yl;var H=D.current.memoizedState.isDehydrated;if(H&&(hs(D,S).flags|=256),S=Hp(D,S,!1),S!==2){if(Ip&&!H){D.errorRecoveryDisabledLanes|=g,yo|=g,h=4;break e}g=Xn,Xn=h,g!==null&&(Xn===null?Xn=g:Xn.push.apply(Xn,g))}h=S}if(g=!1,h!==2)continue}}if(h===1){hs(t,0),wa(t,r,0,!0);break}e:{switch(l=t,g=h,g){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:wa(l,r,hr,!ga);break e;case 2:Xn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(h=ru+300-Ut(),10<h)){if(wa(l,r,hr,!ga),Hr(l,0,!0)!==0)break e;ji=r,l.timeoutHandle=w2(Vb.bind(null,l,a,Xn,au,qp,r,hr,yo,fs,ga,g,"Throttled",-0,0),h);break e}Vb(l,a,Xn,au,qp,r,hr,yo,fs,ga,g,null,-0,0)}}break}while(!0);zi(t)}function Vb(t,r,a,l,h,g,S,D,H,ne,he,ge,ae,ue){if(t.timeoutHandle=-1,ge=r.subtreeFlags,ge&8192||(ge&16785408)==16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xr},Ib(r,g,ge);var De=(g&62914560)===g?ru-Ut():(g&4194048)===g?zb-Ut():0;if(De=IR(ge,De),De!==null){ji=g,t.cancelPendingCommit=De(Xb.bind(null,t,r,g,a,l,h,S,D,H,he,ge,null,ae,ue)),wa(t,g,S,!ne);return}}Xb(t,r,g,a,l,h,S,D,H)}function ZT(t){for(var r=t;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var h=a[l],g=h.getSnapshot;h=h.value;try{if(!cr(g(),h))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function wa(t,r,a,l){r&=~Ap,r&=~yo,t.suspendedLanes|=r,t.pingedLanes&=~r,l&&(t.warmLanes|=r),l=t.expirationTimes;for(var h=r;0<h;){var g=31-gt(h),S=1<<g;l[g]=-1,h&=~S}a!==0&&Fn(t,a,r)}function ou(){return yt&6?!0:(bl(0,!1),!1)}function Bp(){if(tt!==null){if(Ct===0)var t=tt.return;else t=tt,Ti=ao=null,rp(t),is=null,tl=0,t=tt;for(;t!==null;)wb(t.alternate,t),t=t.return;tt=null}}function hs(t,r){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,yR(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),ji=0,Bp(),It=t,tt=a=Ci(t.current,null),it=r,Ct=0,pr=null,ga=!1,ds=bn(t,r),Ip=!1,fs=hr=Ap=yo=ya=Gt=0,Xn=yl=null,qp=!1,r&8&&(r|=r&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=r;0<l;){var h=31-gt(l),g=1<<h;r|=t[h],l&=~g}return qi=r,Tc(),a}function $b(t,r){Ke=null,se.H=cl,r===rs||r===Ic?(r=c1(),Ct=3):r===Wf?(r=c1(),Ct=4):Ct=r===bp?8:typeof r=="object"&&r&&typeof r.then=="function"?6:1,pr=r,tt===null&&(Gt=1,Gc(t,Sr(r,t.current)))}function Wb(){var t=dr.current;return t===null?!0:(it&4194048)===it?Kr===null:(it&62914560)===it||it&536870912?t===Kr:!1}function Ub(){var t=se.H;return se.H=cl,t===null?cl:t}function Kb(){var t=se.A;return se.A=XT,t}function su(){Gt=4,ga||(it&4194048)!==it&&dr.current!==null||(ds=!0),!(ya&134217727)&&!(yo&134217727)||It===null||wa(It,it,hr,!1)}function Hp(t,r,a){var l=yt;yt|=2;var h=Ub(),g=Kb();(It!==t||it!==r)&&(au=null,hs(t,r)),r=!1;var S=Gt;e:do try{if(Ct!==0&&tt!==null){var D=tt,H=pr;switch(Ct){case 8:Bp(),S=6;break e;case 3:case 2:case 9:case 6:dr.current===null&&(r=!0);var ne=Ct;if(Ct=0,pr=null,ms(t,D,H,ne),a&&ds){S=0;break e}break;default:ne=Ct,Ct=0,pr=null,ms(t,D,H,ne)}}eR(),S=Gt;break}catch(he){$b(t,he)}while(!0);return r&&t.shellSuspendCounter++,Ti=ao=null,yt=l,se.H=h,se.A=g,tt===null&&(It=null,it=0,Tc()),S}function eR(){for(;tt!==null;)Qb(tt)}function tR(t,r){var a=yt;yt|=2;var l=Ub(),h=Kb();It!==t||it!==r?(au=null,iu=Ut()+500,hs(t,r)):ds=bn(t,r);e:do try{if(Ct!==0&&tt!==null){r=tt;var g=pr;t:switch(Ct){case 1:Ct=0,pr=null,ms(t,r,g,1);break;case 2:case 9:if(s1(g)){Ct=0,pr=null,Gb(r);break}r=function(){Ct!==2&&Ct!==9||It!==t||(Ct=7),zi(t)},g.then(r,r);break e;case 3:Ct=7;break e;case 4:Ct=5;break e;case 7:s1(g)?(Ct=0,pr=null,Gb(r)):(Ct=0,pr=null,ms(t,r,g,7));break;case 5:var S=null;switch(tt.tag){case 26:S=tt.memoizedState;case 5:case 27:var D=tt;if(S?I2(S):D.stateNode.complete){Ct=0,pr=null;var H=D.sibling;if(H!==null)tt=H;else{var ne=D.return;ne===null?tt=null:(tt=ne,lu(ne))}break t}}Ct=0,pr=null,ms(t,r,g,5);break;case 6:Ct=0,pr=null,ms(t,r,g,6);break;case 8:Bp(),Gt=6;break e;default:throw Error(s(462))}}nR();break}catch(he){$b(t,he)}while(!0);return Ti=ao=null,se.H=l,se.A=h,yt=a,tt===null?(It=null,it=0,Tc(),Gt):0}function nR(){for(;tt!==null&&!ta();)Qb(tt)}function Qb(t){var r=vb(t.alternate,t,qi);t.memoizedProps=t.pendingProps,r===null?lu(t):tt=r}function Gb(t){var r=t,a=r.alternate;switch(r.tag){case 15:case 0:r=fb(a,r,r.pendingProps,r.type,void 0,it);break;case 11:r=fb(a,r,r.pendingProps,r.type.render,r.ref,it);break;case 5:rp(r);default:wb(a,r),r=tt=Jv(r,qi),r=vb(a,r,qi)}t.memoizedProps=t.pendingProps,r===null?lu(t):tt=r}function ms(t,r,a,l){Ti=ao=null,rp(r),is=null,tl=0;var h=r.return;try{if($T(t,h,r,a,it)){Gt=1,Gc(t,Sr(a,t.current)),tt=null;return}}catch(g){if(h!==null)throw tt=h,g;Gt=1,Gc(t,Sr(a,t.current)),tt=null;return}r.flags&32768?(st||l===1?t=!0:ds||it&536870912?t=!1:(ga=t=!0,(l===2||l===9||l===3||l===6)&&(l=dr.current,l!==null&&l.tag===13&&(l.flags|=16384))),Jb(r,t)):lu(r)}function lu(t){var r=t;do{if(r.flags&32768){Jb(r,ga);return}t=r.return;var a=KT(r.alternate,r,qi);if(a!==null){tt=a;return}if(r=r.sibling,r!==null){tt=r;return}tt=r=t}while(r!==null);Gt===0&&(Gt=5)}function Jb(t,r){do{var a=QT(t.alternate,t);if(a!==null){a.flags&=32767,tt=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(t=t.sibling,t!==null)){tt=t;return}tt=t=a}while(t!==null);Gt=6,tt=null}function Xb(t,r,a,l,h,g,S,D,H){t.cancelPendingCommit=null;do cu();while(hn!==0);if(yt&6)throw Error(s(327));if(r!==null){if(r===t.current)throw Error(s(177));if(g=r.lanes|r.childLanes,g|=Of,wi(t,a,g,S,D,H),t===It&&(tt=It=null,it=0),ps=r,ba=t,ji=a,jp=g,zp=h,Fb=l,r.subtreeFlags&10256||r.flags&10256?(t.callbackNode=null,t.callbackPriority=0,oR(zt,function(){return n2(),null})):(t.callbackNode=null,t.callbackPriority=0),l=(r.flags&13878)!=0,r.subtreeFlags&13878||l){l=se.T,se.T=null,h=Q.p,Q.p=2,S=yt,yt|=4;try{GT(t,r,a)}finally{yt=S,Q.p=h,se.T=l}}hn=1,Yb(),Zb(),e2()}}function Yb(){if(hn===1){hn=0;var t=ba,r=ps,a=(r.flags&13878)!=0;if(r.subtreeFlags&13878||a){a=se.T,se.T=null;var l=Q.p;Q.p=2;var h=yt;yt|=4;try{Mb(r,t);var g=Zp,S=Bv(t.containerInfo),D=g.focusedElem,H=g.selectionRange;if(S!==D&&D&&D.ownerDocument&&Fv(D.ownerDocument.documentElement,D)){if(H!==null&&Cf(D)){var ne=H.start,he=H.end;if(he===void 0&&(he=ne),"selectionStart"in D)D.selectionStart=ne,D.selectionEnd=Math.min(he,D.value.length);else{var ge=D.ownerDocument||document,ae=ge&&ge.defaultView||window;if(ae.getSelection){var ue=ae.getSelection(),De=D.textContent.length,Ie=Math.min(H.start,De),Ot=H.end===void 0?Ie:Math.min(H.end,De);!ue.extend&&Ie>Ot&&(S=Ot,Ot=Ie,Ie=S);var G=zv(D,Ie),U=zv(D,Ot);if(G&&U&&(ue.rangeCount!==1||ue.anchorNode!==G.node||ue.anchorOffset!==G.offset||ue.focusNode!==U.node||ue.focusOffset!==U.offset)){var ee=ge.createRange();ee.setStart(G.node,G.offset),ue.removeAllRanges(),Ie>Ot?(ue.addRange(ee),ue.extend(U.node,U.offset)):(ee.setEnd(U.node,U.offset),ue.addRange(ee))}}}}for(ge=[],ue=D;ue=ue.parentNode;)ue.nodeType===1&&ge.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<ge.length;D++){var me=ge[D];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}_u=!!Yp,Zp=Yp=null}finally{yt=h,Q.p=l,se.T=a}}t.current=r,hn=2}}function Zb(){if(hn===2){hn=0;var t=ba,r=ps,a=(r.flags&8772)!=0;if(r.subtreeFlags&8772||a){a=se.T,se.T=null;var l=Q.p;Q.p=2;var h=yt;yt|=4;try{Tb(t,r.alternate,r)}finally{yt=h,Q.p=l,se.T=a}}hn=3}}function e2(){if(hn===4||hn===3){hn=0,gi();var t=ba,r=ps,a=ji,l=Fb;r.subtreeFlags&10256||r.flags&10256?hn=5:(hn=0,ps=ba=null,t2(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(va=null),j(a),r=r.stateNode,Jt&&typeof Jt.onCommitFiberRoot=="function")try{Jt.onCommitFiberRoot(wr,r,void 0,(r.current.flags&128)==128)}catch{}if(l!==null){r=se.T,h=Q.p,Q.p=2,se.T=null;try{for(var g=t.onRecoverableError,S=0;S<l.length;S++){var D=l[S];g(D.value,{componentStack:D.stack})}}finally{se.T=r,Q.p=h}}ji&3&&cu(),zi(t),h=t.pendingLanes,a&261930&&h&42?t===Fp?vl++:(vl=0,Fp=t):vl=0,bl(0,!1)}}function t2(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Zs(r)))}function cu(){return Yb(),Zb(),e2(),n2()}function n2(){if(hn!==5)return!1;var t=ba,r=jp;jp=0;var a=j(ji),l=se.T,h=Q.p;try{Q.p=32>a?32:a,se.T=null,a=zp,zp=null;var g=ba,S=ji;if(hn=0,ps=ba=null,ji=0,yt&6)throw Error(s(331));var D=yt;if(yt|=4,qb(g.current),Nb(g,g.current,S,a),yt=D,bl(0,!1),Jt&&typeof Jt.onPostCommitFiberRoot=="function")try{Jt.onPostCommitFiberRoot(wr,g)}catch{}return!0}finally{Q.p=h,se.T=l,t2(t,r)}}function r2(t,r,a){r=Sr(a,r),r=vp(t.stateNode,r,2),t=po(t,r,2),t!==null&&(Ln(t,2),zi(t))}function Et(t,r,a){if(t.tag===3)r2(t,t,a);else for(;r!==null;){if(r.tag===3){r2(r,t,a);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(va===null||!va.has(l))){t=Sr(a,t),a=ib(2),l=po(r,a,2),l!==null&&(ab(a,l,r,t),Ln(l,2),zi(l));break}}r=r.return}}function Vp(t,r,a){var l=t.pingCache;if(l===null){l=t.pingCache=new YT;var h=new Set;l.set(r,h)}else h=l.get(r),h===void 0&&(h=new Set,l.set(r,h));h.has(a)||(Ip=!0,h.add(a),t=rR.bind(null,t,r,a),r.then(t,t))}function rR(t,r,a){var l=t.pingCache;l!==null&&l.delete(r),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,It===t&&(it&a)===a&&(Gt===4||Gt===3&&(it&62914560)===it&&300>Ut()-ru?!(yt&2)&&hs(t,0):Ap|=a,fs===it&&(fs=0)),zi(t)}function i2(t,r){r===0&&(r=bi()),t=no(t,r),t!==null&&(Ln(t,r),zi(t))}function iR(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),i2(t,a)}function aR(t,r){var a=0;switch(t.tag){case 31:case 13:var l=t.stateNode,h=t.memoizedState;h!==null&&(a=h.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(r),i2(t,a)}function oR(t,r){return Pn(t,r)}var uu=null,gs=null,$p=!1,du=!1,Wp=!1,_a=0;function zi(t){t!==gs&&t.next===null&&(gs===null?uu=gs=t:gs=gs.next=t),du=!0,$p||($p=!0,lR())}function bl(t,r){if(!Wp&&du){Wp=!0;do for(var a=!1,l=uu;l!==null;){if(!r)if(t!==0){var h=l.pendingLanes;if(h===0)var g=0;else{var S=l.suspendedLanes,D=l.pingedLanes;g=(1<<31-gt(42|t)+1)-1,g&=h&~(S&~D),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(a=!0,l2(l,g))}else g=it,g=Hr(l,l===It?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),!(g&3)||bn(l,g)||(a=!0,l2(l,g));l=l.next}while(a);Wp=!1}}function sR(){a2()}function a2(){du=$p=!1;var t=0;_a!==0&&gR()&&(t=_a);for(var r=Ut(),a=null,l=uu;l!==null;){var h=l.next,g=o2(l,r);g===0?(l.next=null,a===null?uu=h:a.next=h,h===null&&(gs=a)):(a=l,(t!==0||g&3)&&(du=!0)),l=h}hn!==0&&hn!==5||bl(t,!1),_a!==0&&(_a=0)}function o2(t,r){for(var a=t.suspendedLanes,l=t.pingedLanes,h=t.expirationTimes,g=t.pendingLanes&-62914561;0<g;){var S=31-gt(g),D=1<<S,H=h[S];H===-1?((D&a)===0||(D&l)!==0)&&(h[S]=ar(D,r)):H<=r&&(t.expiredLanes|=D),g&=~D}if(r=It,a=it,a=Hr(t,t===r?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,a===0||t===r&&(Ct===2||Ct===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&dn(l),t.callbackNode=null,t.callbackPriority=0;if(!(a&3)||bn(t,a)){if(r=a&-a,r===t.callbackPriority)return r;switch(l!==null&&dn(l),j(a)){case 2:case 8:a=ni;break;case 32:a=zt;break;case 268435456:a=_t;break;default:a=zt}return l=s2.bind(null,t),a=Pn(a,l),t.callbackPriority=r,t.callbackNode=a,r}return l!==null&&l!==null&&dn(l),t.callbackPriority=2,t.callbackNode=null,2}function s2(t,r){if(hn!==0&&hn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(cu()&&t.callbackNode!==a)return null;var l=it;return l=Hr(t,t===It?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(Hb(t,l,r),o2(t,Ut()),t.callbackNode!=null&&t.callbackNode===a?s2.bind(null,t):null)}function l2(t,r){if(cu())return null;Hb(t,r,!0)}function lR(){vR(function(){yt&6?Pn(fn,sR):a2()})}function Up(){if(_a===0){var t=ts;t===0&&(t=_r,_r<<=1,!(_r&261888)&&(_r=256)),_a=t}return _a}function c2(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Vo(""+t)}function u2(t,r){var a=r.ownerDocument.createElement("input");return a.name=r.name,a.value=r.value,t.id&&a.setAttribute("form",t.id),r.parentNode.insertBefore(a,r),t=new FormData(t),a.parentNode.removeChild(a),t}function cR(t,r,a,l,h){if(r==="submit"&&a&&a.stateNode===h){var g=c2((h[Ve]||null).action),S=l.submitter;S&&(r=(r=S[Ve]||null)?c2(r.formAction):S.getAttribute("formAction"),r!==null&&(g=r,S=null));var D=new u("action","action",null,l,h);t.push({event:D,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(_a!==0){var H=S?u2(h,S):new FormData(h);fp(a,{pending:!0,data:H,method:h.method,action:g},null,H)}}else typeof g=="function"&&(D.preventDefault(),H=S?u2(h,S):new FormData(h),fp(a,{pending:!0,data:H,method:h.method,action:g},g,H))},currentTarget:h}]})}}for(var Kp=0;Kp<Df.length;Kp++){var Qp=Df[Kp];Ur(Qp.toLowerCase(),"on"+(Qp[0].toUpperCase()+Qp.slice(1)))}Ur($v,"onAnimationEnd"),Ur(Wv,"onAnimationIteration"),Ur(Uv,"onAnimationStart"),Ur("dblclick","onDoubleClick"),Ur("focusin","onFocus"),Ur("focusout","onBlur"),Ur(ST,"onTransitionRun"),Ur(CT,"onTransitionStart"),Ur(ET,"onTransitionCancel"),Ur(Kv,"onTransitionEnd"),ia("onMouseEnter",["mouseout","mouseover"]),ia("onMouseLeave",["mouseout","mouseover"]),ia("onPointerEnter",["pointerout","pointerover"]),ia("onPointerLeave",["pointerout","pointerover"]),ai("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ai("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ai("onBeforeInput",["compositionend","keypress","textInput","paste"]),ai("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ai("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ai("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),uR=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wl));function d2(t,r){r=(r&4)!=0;for(var a=0;a<t.length;a++){var l=t[a],h=l.event;l=l.listeners;e:{var g=void 0;if(r)for(var S=l.length-1;0<=S;S--){var D=l[S],H=D.instance,ne=D.currentTarget;if(D=D.listener,H!==g&&h.isPropagationStopped())break e;g=D,h.currentTarget=ne;try{g(h)}catch(he){Ec(he)}h.currentTarget=null,g=H}else for(S=0;S<l.length;S++){if(D=l[S],H=D.instance,ne=D.currentTarget,D=D.listener,H!==g&&h.isPropagationStopped())break e;g=D,h.currentTarget=ne;try{g(h)}catch(he){Ec(he)}h.currentTarget=null,g=H}}}}function nt(t,r){var a=r[Mt];a===void 0&&(a=r[Mt]=new Set);var l=t+"__bubble";a.has(l)||(p2(r,t,2,!1),a.add(l))}function Gp(t,r,a){var l=0;r&&(l|=4),p2(a,t,l,r)}var fu="_reactListening"+Math.random().toString(36).slice(2);function f2(t){if(!t[fu]){t[fu]=!0,zs.forEach(function(a){a!=="selectionchange"&&(uR.has(a)||Gp(a,!1,t),Gp(a,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[fu]||(r[fu]=!0,Gp("selectionchange",!1,r))}}function p2(t,r,a,l){switch(F2(r)){case 2:var h=FR;break;case 8:h=BR;break;default:h=uh}a=h.bind(null,r,a,t),h=void 0,!$s||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(h=!0),l?h===void 0?t.addEventListener(r,a,!0):t.addEventListener(r,a,{capture:!0,passive:h}):h===void 0?t.addEventListener(r,a,!1):t.addEventListener(r,a,{passive:h})}function Jp(t,r,a,l,h){var g=l;if(!(r&1)&&!(r&2)&&l!==null)e:for(;;){if(l===null)return;var S=l.tag;if(S===3||S===4){var D=l.stateNode.containerInfo;if(D===h)break;if(S===4)for(S=l.return;S!==null;){var H=S.tag;if((H===3||H===4)&&S.stateNode.containerInfo===h)return;S=S.return}for(;D!==null;){if(S=sr(D),S===null)return;if(H=S.tag,H===5||H===6||H===26||H===27){l=g=S;continue e}D=D.parentNode}}l=l.return}xc(function(){var ne=g,he=Hs(a),ge=[];e:{var ae=Qv.get(t);if(ae!==void 0){var ue=u,De=t;switch(t){case"keypress":if(Xa(a)===0)break e;case"keydown":case"keyup":ue=Re;break;case"focusin":De="focus",ue=z;break;case"focusout":De="blur",ue=z;break;case"beforeblur":case"afterblur":ue=z;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=O;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=L;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=dt;break;case $v:case Wv:case Uv:ue=q;break;case Kv:ue=Je;break;case"scroll":case"scrollend":ue=v;break;case"wheel":ue=Nt;break;case"copy":case"cut":case"paste":ue=oe;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=Ne;break;case"toggle":case"beforetoggle":ue=Ft}var Ie=(r&4)!=0,Ot=!Ie&&(t==="scroll"||t==="scrollend"),G=Ie?ae===null?null:ae+"Capture":ae;Ie=[];for(var U=ne,ee;U!==null;){var me=U;if(ee=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||ee===null||G===null||(me=Qa(U,G),me!=null&&Ie.push(_l(U,me,ee))),Ot)break;U=U.return}0<Ie.length&&(ae=new ue(ae,De,null,a,he),ge.push({event:ae,listeners:Ie}))}}if(!(r&7)){e:{if(ae=t==="mouseover"||t==="pointerover",ue=t==="mouseout"||t==="pointerout",ae&&a!==_n&&(De=a.relatedTarget||a.fromElement)&&(sr(De)||De[ot]))break e;if((ue||ae)&&(ae=he.window===he?he:(ae=he.ownerDocument)?ae.defaultView||ae.parentWindow:window,ue?(De=a.relatedTarget||a.toElement,ue=ne,De=De?sr(De):null,De!==null&&(Ot=d(De),Ie=De.tag,De!==Ot||Ie!==5&&Ie!==27&&Ie!==6)&&(De=null)):(ue=null,De=ne),ue!==De)){if(Ie=O,me="onMouseLeave",G="onMouseEnter",U="mouse",(t==="pointerout"||t==="pointerover")&&(Ie=Ne,me="onPointerLeave",G="onPointerEnter",U="pointer"),Ot=ue==null?ae:Bn(ue),ee=De==null?ae:Bn(De),ae=new Ie(me,U+"leave",ue,a,he),ae.target=Ot,ae.relatedTarget=ee,me=null,sr(he)===ne&&(Ie=new Ie(G,U+"enter",De,a,he),Ie.target=ee,Ie.relatedTarget=Ot,me=Ie),Ot=me,ue&&De)t:{for(Ie=dR,G=ue,U=De,ee=0,me=G;me;me=Ie(me))ee++;me=0;for(var Me=U;Me;Me=Ie(Me))me++;for(;0<ee-me;)G=Ie(G),ee--;for(;0<me-ee;)U=Ie(U),me--;for(;ee--;){if(G===U||U!==null&&G===U.alternate){Ie=G;break t}G=Ie(G),U=Ie(U)}Ie=null}else Ie=null;ue!==null&&h2(ge,ae,ue,Ie,!1),De!==null&&Ot!==null&&h2(ge,Ot,De,Ie,!0)}}e:{if(ae=ne?Bn(ne):window,ue=ae.nodeName&&ae.nodeName.toLowerCase(),ue==="select"||ue==="input"&&ae.type==="file")var vt=Lv;else if(Pv(ae))if(Nv)vt=_T;else{vt=bT;var Oe=vT}else ue=ae.nodeName,!ue||ue.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?ne&&Ka(ne.elementType)&&(vt=Lv):vt=wT;if(vt&&(vt=vt(t,ne))){Mv(ge,vt,a,he);break e}Oe&&Oe(t,ae,ne),t==="focusout"&&ne&&ae.type==="number"&&ne.memoizedProps.value!=null&&_i(ae,"number",ae.value)}switch(Oe=ne?Bn(ne):window,t){case"focusin":(Pv(Oe)||Oe.contentEditable==="true")&&(Ko=Oe,Ef=ne,Js=null);break;case"focusout":Js=Ef=Ko=null;break;case"mousedown":Tf=!0;break;case"contextmenu":case"mouseup":case"dragend":Tf=!1,Hv(ge,a,he);break;case"selectionchange":if(kT)break;case"keydown":case"keyup":Hv(ge,a,he)}var Qe;if($e)e:{switch(t){case"compositionstart":var at="onCompositionStart";break e;case"compositionend":at="onCompositionEnd";break e;case"compositionupdate":at="onCompositionUpdate";break e}at=void 0}else Uo?Sc(t,a)&&(at="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(at="onCompositionStart");at&&(pn&&a.locale!=="ko"&&(Uo||at!=="onCompositionStart"?at==="onCompositionEnd"&&Uo&&(Qe=Ws()):(Wr=he,$o="value"in Wr?Wr.value:Wr.textContent,Uo=!0)),Oe=pu(ne,at),0<Oe.length&&(at=new ie(at,t,null,a,he),ge.push({event:at,listeners:Oe}),Qe?at.data=Qe:(Qe=Wo(a),Qe!==null&&(at.data=Qe)))),(Qe=rn?hT(t,a):mT(t,a))&&(at=pu(ne,"onBeforeInput"),0<at.length&&(Oe=new ie("onBeforeInput","beforeinput",null,a,he),ge.push({event:Oe,listeners:at}),Oe.data=Qe)),cR(ge,t,ne,a,he)}d2(ge,r)})}function _l(t,r,a){return{instance:t,listener:r,currentTarget:a}}function pu(t,r){for(var a=r+"Capture",l=[];t!==null;){var h=t,g=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||g===null||(h=Qa(t,a),h!=null&&l.unshift(_l(t,h,g)),h=Qa(t,r),h!=null&&l.push(_l(t,h,g))),t.tag===3)return l;t=t.return}return[]}function dR(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function h2(t,r,a,l,h){for(var g=r._reactName,S=[];a!==null&&a!==l;){var D=a,H=D.alternate,ne=D.stateNode;if(D=D.tag,H!==null&&H===l)break;D!==5&&D!==26&&D!==27||ne===null||(H=ne,h?(ne=Qa(a,g),ne!=null&&S.unshift(_l(a,ne,H))):h||(ne=Qa(a,g),ne!=null&&S.push(_l(a,ne,H)))),a=a.return}S.length!==0&&t.push({event:r,listeners:S})}var fR=/\r\n?/g,pR=/\u0000|\uFFFD/g;function m2(t){return(typeof t=="string"?t:""+t).replace(fR,`
10
- `).replace(pR,"")}function g2(t,r){return r=m2(r),m2(t)===r}function Dt(t,r,a,l,h,g){switch(a){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||xi(t,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&xi(t,""+l);break;case"className":Ua(t,"class",l);break;case"tabIndex":Ua(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Ua(t,a,l);break;case"style":bc(t,l,g);break;case"data":if(r!=="object"){Ua(t,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||a!=="href")){t.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(a);break}l=Vo(""+l),t.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){t.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof g=="function"&&(a==="formAction"?(r!=="input"&&Dt(t,r,"name",h.name,h,null),Dt(t,r,"formEncType",h.formEncType,h,null),Dt(t,r,"formMethod",h.formMethod,h,null),Dt(t,r,"formTarget",h.formTarget,h,null)):(Dt(t,r,"encType",h.encType,h,null),Dt(t,r,"method",h.method,h,null),Dt(t,r,"target",h.target,h,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(a);break}l=Vo(""+l),t.setAttribute(a,l);break;case"onClick":l!=null&&(t.onclick=xr);break;case"onScroll":l!=null&&nt("scroll",t);break;case"onScrollEnd":l!=null&&nt("scrollend",t);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(h.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"multiple":t.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":t.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){t.removeAttribute("xlink:href");break}a=Vo(""+l),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,""+l):t.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":l===!0?t.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,l):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(a,l):t.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(a):t.setAttribute(a,l);break;case"popover":nt("beforetoggle",t),nt("toggle",t),Wa(t,"popover",l);break;case"xlinkActuate":Vr(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Vr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Vr(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Vr(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Vr(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Vr(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Vr(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Vr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Vr(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Wa(t,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Ho.get(a)||a,Wa(t,a,l))}}function Xp(t,r,a,l,h,g){switch(a){case"style":bc(t,l,g);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(h.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"children":typeof l=="string"?xi(t,l):(typeof l=="number"||typeof l=="bigint")&&xi(t,""+l);break;case"onScroll":l!=null&&nt("scroll",t);break;case"onScrollEnd":l!=null&&nt("scrollend",t);break;case"onClick":l!=null&&(t.onclick=xr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!hc.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(h=a.endsWith("Capture"),r=a.slice(2,h?a.length-7:void 0),g=t[Ve]||null,g=g==null?null:g[a],typeof g=="function"&&t.removeEventListener(r,g,h),typeof l=="function")){typeof g!="function"&&g!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(r,l,h);break e}a in t?t[a]=l:l===!0?t.setAttribute(a,""):Wa(t,a,l)}}}function Tn(t,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":nt("error",t),nt("load",t);var l=!1,h=!1,g;for(g in a)if(a.hasOwnProperty(g)){var S=a[g];if(S!=null)switch(g){case"src":l=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Dt(t,r,g,S,a,null)}}h&&Dt(t,r,"srcSet",a.srcSet,a,null),l&&Dt(t,r,"src",a.src,a,null);return;case"input":nt("invalid",t);var D=g=S=h=null,H=null,ne=null;for(l in a)if(a.hasOwnProperty(l)){var he=a[l];if(he!=null)switch(l){case"name":h=he;break;case"type":S=he;break;case"checked":H=he;break;case"defaultChecked":ne=he;break;case"value":g=he;break;case"defaultValue":D=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(s(137,r));break;default:Dt(t,r,l,he,a,null)}}vc(t,g,D,H,ne,S,h,!1);return;case"select":for(h in nt("invalid",t),l=S=g=null,a)if(a.hasOwnProperty(h)&&(D=a[h],D!=null))switch(h){case"value":g=D;break;case"defaultValue":S=D;break;case"multiple":l=D;default:Dt(t,r,h,D,a,null)}r=g,a=S,t.multiple=!!l,r==null?a!=null&&oa(t,!!l,a,!0):oa(t,!!l,r,!1);return;case"textarea":for(S in nt("invalid",t),g=h=l=null,a)if(a.hasOwnProperty(S)&&(D=a[S],D!=null))switch(S){case"value":l=D;break;case"defaultValue":h=D;break;case"children":g=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(s(91));break;default:Dt(t,r,S,D,a,null)}Bo(t,l,h,g);return;case"option":for(H in a)a.hasOwnProperty(H)&&(l=a[H],l!=null)&&(H==="selected"?t.selected=l&&typeof l!="function"&&typeof l!="symbol":Dt(t,r,H,l,a,null));return;case"dialog":nt("beforetoggle",t),nt("toggle",t),nt("cancel",t),nt("close",t);break;case"iframe":case"object":nt("load",t);break;case"video":case"audio":for(l=0;l<wl.length;l++)nt(wl[l],t);break;case"image":nt("error",t),nt("load",t);break;case"details":nt("toggle",t);break;case"embed":case"source":case"link":nt("error",t),nt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ne in a)if(a.hasOwnProperty(ne)&&(l=a[ne],l!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Dt(t,r,ne,l,a,null)}return;default:if(Ka(r)){for(he in a)a.hasOwnProperty(he)&&(l=a[he],l!==void 0&&Xp(t,r,he,l,a,void 0));return}}for(D in a)a.hasOwnProperty(D)&&(l=a[D],l!=null&&Dt(t,r,D,l,a,null))}function hR(t,r,a,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,g=null,S=null,D=null,H=null,ne=null,he=null;for(ue in a){var ge=a[ue];if(a.hasOwnProperty(ue)&&ge!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":H=ge;default:l.hasOwnProperty(ue)||Dt(t,r,ue,null,l,ge)}}for(var ae in l){var ue=l[ae];if(ge=a[ae],l.hasOwnProperty(ae)&&(ue!=null||ge!=null))switch(ae){case"type":g=ue;break;case"name":h=ue;break;case"checked":ne=ue;break;case"defaultChecked":he=ue;break;case"value":S=ue;break;case"defaultValue":D=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(s(137,r));break;default:ue!==ge&&Dt(t,r,ae,ue,l,ge)}}aa(t,S,D,H,ne,he,g,h);return;case"select":for(g in ue=S=D=ae=null,a)if(H=a[g],a.hasOwnProperty(g)&&H!=null)switch(g){case"value":break;case"multiple":ue=H;default:l.hasOwnProperty(g)||Dt(t,r,g,null,l,H)}for(h in l)if(g=l[h],H=a[h],l.hasOwnProperty(h)&&(g!=null||H!=null))switch(h){case"value":ae=g;break;case"defaultValue":D=g;break;case"multiple":S=g;default:g!==H&&Dt(t,r,h,g,l,H)}r=D,a=S,l=ue,ae==null?!!l!=!!a&&(r==null?oa(t,!!a,a?[]:"",!1):oa(t,!!a,r,!0)):oa(t,!!a,ae,!1);return;case"textarea":for(D in ue=ae=null,a)if(h=a[D],a.hasOwnProperty(D)&&h!=null&&!l.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:Dt(t,r,D,null,l,h)}for(S in l)if(h=l[S],g=a[S],l.hasOwnProperty(S)&&(h!=null||g!=null))switch(S){case"value":ae=h;break;case"defaultValue":ue=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(s(91));break;default:h!==g&&Dt(t,r,S,h,l,g)}sa(t,ae,ue);return;case"option":for(var De in a)ae=a[De],a.hasOwnProperty(De)&&ae!=null&&!l.hasOwnProperty(De)&&(De==="selected"?t.selected=!1:Dt(t,r,De,null,l,ae));for(H in l)ae=l[H],ue=a[H],l.hasOwnProperty(H)&&ae!==ue&&(ae!=null||ue!=null)&&(H==="selected"?t.selected=ae&&typeof ae!="function"&&typeof ae!="symbol":Dt(t,r,H,ae,l,ue));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ie in a)ae=a[Ie],a.hasOwnProperty(Ie)&&ae!=null&&!l.hasOwnProperty(Ie)&&Dt(t,r,Ie,null,l,ae);for(ne in l)if(ae=l[ne],ue=a[ne],l.hasOwnProperty(ne)&&ae!==ue&&(ae!=null||ue!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(s(137,r));break;default:Dt(t,r,ne,ae,l,ue)}return;default:if(Ka(r)){for(var Ot in a)ae=a[Ot],a.hasOwnProperty(Ot)&&ae!==void 0&&!l.hasOwnProperty(Ot)&&Xp(t,r,Ot,void 0,l,ae);for(he in l)ae=l[he],ue=a[he],!l.hasOwnProperty(he)||ae===ue||ae===void 0&&ue===void 0||Xp(t,r,he,ae,l,ue);return}}for(var G in a)ae=a[G],a.hasOwnProperty(G)&&ae!=null&&!l.hasOwnProperty(G)&&Dt(t,r,G,null,l,ae);for(ge in l)ae=l[ge],ue=a[ge],!l.hasOwnProperty(ge)||ae===ue||ae==null&&ue==null||Dt(t,r,ge,ae,l,ue)}function y2(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function mR(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var h=a[l],g=h.transferSize,S=h.initiatorType,D=h.duration;if(g&&D&&y2(S)){for(S=0,D=h.responseEnd,l+=1;l<a.length;l++){var H=a[l],ne=H.startTime;if(ne>D)break;var he=H.transferSize,ge=H.initiatorType;he&&y2(ge)&&(H=H.responseEnd,S+=he*(H<D?1:(D-ne)/(H-ne)))}if(--l,r+=8*(g+S)/(h.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Yp=null,Zp=null;function hu(t){return t.nodeType===9?t:t.ownerDocument}function v2(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function b2(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function eh(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var th=null;function gR(){var t=window.event;return t&&t.type==="popstate"?t===th?!1:(th=t,!0):(th=null,!1)}var w2=typeof setTimeout=="function"?setTimeout:void 0,yR=typeof clearTimeout=="function"?clearTimeout:void 0,_2=typeof Promise=="function"?Promise:void 0,vR=typeof queueMicrotask=="function"?queueMicrotask:_2===void 0?w2:function(t){return _2.resolve(null).then(t).catch(bR)};function bR(t){setTimeout(function(){throw t})}function xa(t){return t==="head"}function x2(t,r){var a=r,l=0;do{var h=a.nextSibling;if(t.removeChild(a),h&&h.nodeType===8)if(a=h.data,a==="/$"||a==="/&"){if(l===0){t.removeChild(h),ws(r);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")xl(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,xl(a);for(var g=a.firstChild;g;){var S=g.nextSibling,D=g.nodeName;g[ut]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&g.rel.toLowerCase()==="stylesheet"||a.removeChild(g),g=S}}else a==="body"&&xl(t.ownerDocument.body);a=h}while(a);ws(r)}function k2(t,r){var a=t;t=0;do{var l=a.nextSibling;if(a.nodeType===1?r?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(r?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=l}while(a)}function nh(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":nh(a),wn(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function wR(t,r,a,l){for(;t.nodeType===1;){var h=a;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[ut])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(g=t.getAttribute("rel"),g==="stylesheet"&&t.hasAttribute("data-precedence")||g!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(g=t.getAttribute("src"),(g!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&g&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var g=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===g)return t}else return t;if(t=Dr(t.nextSibling),t===null)break}return null}function _R(t,r,a){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Dr(t.nextSibling),t===null))return null;return t}function S2(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Dr(t.nextSibling),t===null))return null;return t}function rh(t){return t.data==="$?"||t.data==="$~"}function ih(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function xR(t,r){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||a.readyState!=="loading")r();else{var l=function(){r(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function Dr(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var ah=null;function C2(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(r===0)return Dr(t.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}t=t.nextSibling}return null}function E2(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(r===0)return t;r--}else a!=="/$"&&a!=="/&"||r++}t=t.previousSibling}return null}function T2(t,r,a){switch(r=hu(a),t){case"html":if(t=r.documentElement,!t)throw Error(s(452));return t;case"head":if(t=r.head,!t)throw Error(s(453));return t;case"body":if(t=r.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function xl(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);wn(t)}var Or=new Map,R2=new Set;function mu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Fi=Q.d;Q.d={f:kR,r:SR,D:CR,C:ER,L:TR,m:RR,X:OR,S:DR,M:PR};function kR(){var t=Fi.f(),r=ou();return t||r}function SR(t){var r=ii(t);r!==null&&r.tag===5&&r.type==="form"?K1(r):Fi.r(t)}var ys=typeof document>"u"?null:document;function D2(t,r,a){var l=ys;if(l&&typeof r=="string"&&r){var h=lr(r);h='link[rel="'+t+'"][href="'+h+'"]',typeof a=="string"&&(h+='[crossorigin="'+a+'"]'),R2.has(h)||(R2.add(h),t={rel:t,crossOrigin:a,href:r},l.querySelector(h)===null&&(r=l.createElement("link"),Tn(r,"link",t),Xt(r),l.head.appendChild(r)))}}function CR(t){Fi.D(t),D2("dns-prefetch",t,null)}function ER(t,r){Fi.C(t,r),D2("preconnect",t,r)}function TR(t,r,a){Fi.L(t,r,a);var l=ys;if(l&&t&&r){var h='link[rel="preload"][as="'+lr(r)+'"]';r==="image"&&a&&a.imageSrcSet?(h+='[imagesrcset="'+lr(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(h+='[imagesizes="'+lr(a.imageSizes)+'"]')):h+='[href="'+lr(t)+'"]';var g=h;switch(r){case"style":g=vs(t);break;case"script":g=bs(t)}Or.has(g)||(t=C({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:t,as:r},a),Or.set(g,t),l.querySelector(h)!==null||r==="style"&&l.querySelector(kl(g))||r==="script"&&l.querySelector(Sl(g))||(r=l.createElement("link"),Tn(r,"link",t),Xt(r),l.head.appendChild(r)))}}function RR(t,r){Fi.m(t,r);var a=ys;if(a&&t){var l=r&&typeof r.as=="string"?r.as:"script",h='link[rel="modulepreload"][as="'+lr(l)+'"][href="'+lr(t)+'"]',g=h;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=bs(t)}if(!Or.has(g)&&(t=C({rel:"modulepreload",href:t},r),Or.set(g,t),a.querySelector(h)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Sl(g)))return}l=a.createElement("link"),Tn(l,"link",t),Xt(l),a.head.appendChild(l)}}}function DR(t,r,a){Fi.S(t,r,a);var l=ys;if(l&&t){var h=ra(l).hoistableStyles,g=vs(t);r||(r="default");var S=h.get(g);if(!S){var D={loading:0,preload:null};if(S=l.querySelector(kl(g)))D.loading=5;else{t=C({rel:"stylesheet",href:t,"data-precedence":r},a),(a=Or.get(g))&&oh(t,a);var H=S=l.createElement("link");Xt(H),Tn(H,"link",t),H._p=new Promise(function(ne,he){H.onload=ne,H.onerror=he}),H.addEventListener("load",function(){D.loading|=1}),H.addEventListener("error",function(){D.loading|=2}),D.loading|=4,gu(S,r,l)}S={type:"stylesheet",instance:S,count:1,state:D},h.set(g,S)}}}function OR(t,r){Fi.X(t,r);var a=ys;if(a&&t){var l=ra(a).hoistableScripts,h=bs(t),g=l.get(h);g||(g=a.querySelector(Sl(h)),g||(t=C({src:t,async:!0},r),(r=Or.get(h))&&sh(t,r),g=a.createElement("script"),Xt(g),Tn(g,"link",t),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(h,g))}}function PR(t,r){Fi.M(t,r);var a=ys;if(a&&t){var l=ra(a).hoistableScripts,h=bs(t),g=l.get(h);g||(g=a.querySelector(Sl(h)),g||(t=C({src:t,async:!0,type:"module"},r),(r=Or.get(h))&&sh(t,r),g=a.createElement("script"),Xt(g),Tn(g,"link",t),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(h,g))}}function O2(t,r,a,l){var h=(h=mt.current)?mu(h):null;if(!h)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(r=vs(a.href),a=ra(h).hoistableStyles,l=a.get(r),l||(l={type:"style",instance:null,count:0,state:null},a.set(r,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=vs(a.href);var g=ra(h).hoistableStyles,S=g.get(t);if(S||(h=h.ownerDocument||h,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(t,S),(g=h.querySelector(kl(t)))&&!g._p&&(S.instance=g,S.state.loading=5),Or.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Or.set(t,a),g||MR(h,t,a,S.state))),r&&l===null)throw Error(s(528,""));return S}if(r&&l!==null)throw Error(s(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=bs(a),a=ra(h).hoistableScripts,l=a.get(r),l||(l={type:"script",instance:null,count:0,state:null},a.set(r,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function vs(t){return'href="'+lr(t)+'"'}function kl(t){return'link[rel="stylesheet"]['+t+"]"}function P2(t){return C({},t,{"data-precedence":t.precedence,precedence:null})}function MR(t,r,a,l){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?l.loading=1:(r=t.createElement("link"),l.preload=r,r.addEventListener("load",function(){return l.loading|=1}),r.addEventListener("error",function(){return l.loading|=2}),Tn(r,"link",a),Xt(r),t.head.appendChild(r))}function bs(t){return'[src="'+lr(t)+'"]'}function Sl(t){return"script[async]"+t}function M2(t,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var l=t.querySelector('style[data-href~="'+lr(a.href)+'"]');if(l)return r.instance=l,Xt(l),l;var h=C({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Xt(l),Tn(l,"style",h),gu(l,a.precedence,t),r.instance=l;case"stylesheet":h=vs(a.href);var g=t.querySelector(kl(h));if(g)return r.state.loading|=4,r.instance=g,Xt(g),g;l=P2(a),(h=Or.get(h))&&oh(l,h),g=(t.ownerDocument||t).createElement("link"),Xt(g);var S=g;return S._p=new Promise(function(D,H){S.onload=D,S.onerror=H}),Tn(g,"link",l),r.state.loading|=4,gu(g,a.precedence,t),r.instance=g;case"script":return g=bs(a.src),(h=t.querySelector(Sl(g)))?(r.instance=h,Xt(h),h):(l=a,(h=Or.get(g))&&(l=C({},a),sh(l,h)),t=t.ownerDocument||t,h=t.createElement("script"),Xt(h),Tn(h,"link",l),t.head.appendChild(h),r.instance=h);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&!(r.state.loading&4)&&(l=r.instance,r.state.loading|=4,gu(l,a.precedence,t));return r.instance}function gu(t,r,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=l.length?l[l.length-1]:null,g=h,S=0;S<l.length;S++){var D=l[S];if(D.dataset.precedence===r)g=D;else if(g!==h)break}g?g.parentNode.insertBefore(t,g.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(t,r.firstChild))}function oh(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.title??(t.title=r.title)}function sh(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.integrity??(t.integrity=r.integrity)}var yu=null;function L2(t,r,a){if(yu===null){var l=new Map,h=yu=new Map;h.set(a,l)}else h=yu,l=h.get(a),l||(l=new Map,h.set(a,l));if(l.has(t))return l;for(l.set(t,null),a=a.getElementsByTagName(t),h=0;h<a.length;h++){var g=a[h];if(!(g[ut]||g[He]||t==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var S=g.getAttribute(r)||"";S=t+S;var D=l.get(S);D?D.push(g):l.set(S,[g])}}return l}function N2(t,r,a){t=t.ownerDocument||t,t.head.insertBefore(a,r==="title"?t.querySelector("head > title"):null)}function LR(t,r,a){if(a===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(t=r.disabled,typeof r.precedence=="string"&&t==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function I2(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}function NR(t,r,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&!(a.state.loading&4)){if(a.instance===null){var h=vs(l.href),g=r.querySelector(kl(h));if(g){r=g._p,typeof r=="object"&&r&&typeof r.then=="function"&&(t.count++,t=vu.bind(t),r.then(t,t)),a.state.loading|=4,a.instance=g,Xt(g);return}g=r.ownerDocument||r,l=P2(l),(h=Or.get(h))&&oh(l,h),g=g.createElement("link"),Xt(g);var S=g;S._p=new Promise(function(D,H){S.onload=D,S.onerror=H}),Tn(g,"link",l),a.instance=g}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,r),(r=a.state.preload)&&!(a.state.loading&3)&&(t.count++,a=vu.bind(t),r.addEventListener("load",a),r.addEventListener("error",a))}}var lh=0;function IR(t,r){return t.stylesheets&&t.count===0&&wu(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var l=setTimeout(function(){if(t.stylesheets&&wu(t,t.stylesheets),t.unsuspend){var g=t.unsuspend;t.unsuspend=null,g()}},6e4+r);0<t.imgBytes&&lh===0&&(lh=62500*mR());var h=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&wu(t,t.stylesheets),t.unsuspend)){var g=t.unsuspend;t.unsuspend=null,g()}},(t.imgBytes>lh?50:800)+r);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(h)}}:null}function vu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)wu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var bu=null;function wu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,bu=new Map,r.forEach(AR,t),bu=null,vu.call(t))}function AR(t,r){if(!(r.state.loading&4)){var a=bu.get(t);if(a)var l=a.get(null);else{a=new Map,bu.set(t,a);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<h.length;g++){var S=h[g];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(a.set(S.dataset.precedence,S),l=S)}l&&a.set(null,l)}h=r.instance,S=h.getAttribute("data-precedence"),g=a.get(S)||l,g===l&&a.set(null,h),a.set(S,h),this.count++,l=vu.bind(this),h.addEventListener("load",l),h.addEventListener("error",l),g?g.parentNode.insertBefore(h,g.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),r.state.loading|=4}}var Cl={$$typeof:K,Provider:null,Consumer:null,_currentValue:Le,_currentValue2:Le,_threadCount:0};function qR(t,r,a,l,h,g,S,D,H){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ri(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ri(0),this.hiddenUpdates=ri(null),this.identifierPrefix=l,this.onUncaughtError=h,this.onCaughtError=g,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function jR(t,r,a,l,h,g,S,D,H,ne,he,ge){return t=new qR(t,r,a,S,H,ne,he,ge,D),r=1,g===!0&&(r|=24),g=ur(3,null,null,r),t.current=g,g.stateNode=t,r=Hf(),r.refCount++,t.pooledCache=r,r.refCount++,g.memoizedState={element:l,isDehydrated:a,cache:r},Uf(g),t}function zR(t){return t?(t=Jo,t):Jo}function A2(t,r,a,l,h,g){h=zR(h),l.context===null?l.context=h:l.pendingContext=h,l=fo(r),l.payload={element:a},g=g===void 0?null:g,g!==null&&(l.callback=g),a=po(t,l,r),a!==null&&(Yn(a,t,r),rl(a,t,r))}function q2(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function ch(t,r){q2(t,r),(t=t.alternate)&&q2(t,r)}function j2(t){if(t.tag===13||t.tag===31){var r=no(t,67108864);r!==null&&Yn(r,t,67108864),ch(t,67108864)}}function z2(t){if(t.tag===13||t.tag===31){var r=Rr();r=Ye(r);var a=no(t,r);a!==null&&Yn(a,t,r),ch(t,r)}}var _u=!0;function FR(t,r,a,l){var h=se.T;se.T=null;var g=Q.p;try{Q.p=2,uh(t,r,a,l)}finally{Q.p=g,se.T=h}}function BR(t,r,a,l){var h=se.T;se.T=null;var g=Q.p;try{Q.p=8,uh(t,r,a,l)}finally{Q.p=g,se.T=h}}function uh(t,r,a,l){if(_u){var h=dh(l);if(h===null)Jp(t,r,l,xu,a),B2(t,l);else if(VR(h,t,r,a,l))l.stopPropagation();else if(B2(t,l),r&4&&-1<HR.indexOf(t)){for(;h!==null;){var g=ii(h);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var S=Mn(g.pendingLanes);if(S!==0){var D=g;for(D.pendingLanes|=2,D.entangledLanes|=2;S;){var H=1<<31-gt(S);D.entanglements[1]|=H,S&=~H}zi(g),!(yt&6)&&(iu=Ut()+500,bl(0,!1))}}break;case 31:case 13:D=no(g,2),D!==null&&Yn(D,g,2),ou(),ch(g,2)}if(g=dh(l),g===null&&Jp(t,r,l,xu,a),g===h)break;h=g}h!==null&&l.stopPropagation()}else Jp(t,r,l,null,a)}}function dh(t){return t=Hs(t),fh(t)}var xu=null;function fh(t){if(xu=null,t=sr(t),t!==null){var r=d(t);if(r===null)t=null;else{var a=r.tag;if(a===13){if(t=f(r),t!==null)return t;t=null}else if(a===31){if(t=p(r),t!==null)return t;t=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return xu=t,null}function F2(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(yi()){case fn:return 2;case ni:return 8;case zt:case Br:return 32;case _t:return 268435456;default:return 32}default:return 32}}var ph=!1,ka=null,Sa=null,Ca=null,El=new Map,Tl=new Map,Ea=[],HR="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function B2(t,r){switch(t){case"focusin":case"focusout":ka=null;break;case"dragenter":case"dragleave":Sa=null;break;case"mouseover":case"mouseout":Ca=null;break;case"pointerover":case"pointerout":El.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Tl.delete(r.pointerId)}}function Rl(t,r,a,l,h,g){return t===null||t.nativeEvent!==g?(t={blockedOn:r,domEventName:a,eventSystemFlags:l,nativeEvent:g,targetContainers:[h]},r!==null&&(r=ii(r),r!==null&&j2(r)),t):(t.eventSystemFlags|=l,r=t.targetContainers,h!==null&&r.indexOf(h)===-1&&r.push(h),t)}function VR(t,r,a,l,h){switch(r){case"focusin":return ka=Rl(ka,t,r,a,l,h),!0;case"dragenter":return Sa=Rl(Sa,t,r,a,l,h),!0;case"mouseover":return Ca=Rl(Ca,t,r,a,l,h),!0;case"pointerover":var g=h.pointerId;return El.set(g,Rl(El.get(g)||null,t,r,a,l,h)),!0;case"gotpointercapture":return g=h.pointerId,Tl.set(g,Rl(Tl.get(g)||null,t,r,a,l,h)),!0}return!1}function H2(t){var r=sr(t.target);if(r!==null){var a=d(r);if(a!==null){if(r=a.tag,r===13){if(r=f(a),r!==null){t.blockedOn=r,ve(t.priority,function(){z2(a)});return}}else if(r===31){if(r=p(a),r!==null){t.blockedOn=r,ve(t.priority,function(){z2(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function ku(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var a=dh(t.nativeEvent);if(a===null){a=t.nativeEvent;var l=new a.constructor(a.type,a);_n=l,a.target.dispatchEvent(l),_n=null}else return r=ii(a),r!==null&&j2(r),t.blockedOn=a,!1;r.shift()}return!0}function V2(t,r,a){ku(t)&&a.delete(r)}function $R(){ph=!1,ka!==null&&ku(ka)&&(ka=null),Sa!==null&&ku(Sa)&&(Sa=null),Ca!==null&&ku(Ca)&&(Ca=null),El.forEach(V2),Tl.forEach(V2)}function Su(t,r){t.blockedOn===r&&(t.blockedOn=null,ph||(ph=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,$R)))}var Cu=null;function $2(t){Cu!==t&&(Cu=t,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Cu===t&&(Cu=null);for(var r=0;r<t.length;r+=3){var a=t[r],l=t[r+1],h=t[r+2];if(typeof l!="function"){if(fh(l||a)===null)continue;break}var g=ii(a);g!==null&&(t.splice(r,3),r-=3,fp(g,{pending:!0,data:h,method:a.method,action:l},l,h))}}))}function ws(t){function r(H){return Su(H,t)}ka!==null&&Su(ka,t),Sa!==null&&Su(Sa,t),Ca!==null&&Su(Ca,t),El.forEach(r),Tl.forEach(r);for(var a=0;a<Ea.length;a++){var l=Ea[a];l.blockedOn===t&&(l.blockedOn=null)}for(;0<Ea.length&&(a=Ea[0],a.blockedOn===null);)H2(a),a.blockedOn===null&&Ea.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var h=a[l],g=a[l+1],S=h[Ve]||null;if(typeof g=="function")S||$2(a);else if(S){var D=null;if(g&&g.hasAttribute("formAction")){if(h=g,S=g[Ve]||null)D=S.formAction;else if(fh(h)!==null)continue}else D=S.action;typeof D=="function"?a[l+1]=D:(a.splice(l,3),l-=3),$2(a)}}}function WR(){function t(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(S){return h=S})},focusReset:"manual",scroll:"manual"})}function r(){h!==null&&(h(),h=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,h=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),h!==null&&(h(),h=null)}}}function hh(t){this._internalRoot=t}mh.prototype.render=hh.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(s(409));var a=r.current;A2(a,Rr(),t,r,null,null)},mh.prototype.unmount=hh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;A2(t.current,2,null,t,null,null),ou(),r[ot]=null}};function mh(t){this._internalRoot=t}mh.prototype.unstable_scheduleHydration=function(t){if(t){var r=te();t={blockedOn:null,target:t,priority:r};for(var a=0;a<Ea.length&&r!==0&&r<Ea[a].priority;a++);Ea.splice(a,0,t),a===0&&H2(t)}};var W2=i.version;if(W2!=="19.2.3")throw Error(s(527,W2,"19.2.3"));Q.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=w(r),t=t===null?null:_(t),t=t===null?null:t.stateNode,t};var UR={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:se,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Eu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Eu.isDisabled&&Eu.supportsFiber)try{wr=Eu.inject(UR),Jt=Eu}catch{}}e.createRoot=function(t,r){if(!c(t))throw Error(s(299));var a=!1,l="",h=BT,g=HT,S=VT;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(g=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError)),r=jR(t,1,!1,null,null,a,l,null,h,g,S,WR),t[ot]=r.current,f2(t),new hh(r)}})),sd=Ee(((e,n)=>{function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(o){console.error(o)}}i(),n.exports=Na()})),jm="Expected a function";function bx(e,n){var i;if(typeof n!="function")throw TypeError(jm);return e=s4(e),function(){return--e>0&&(i=n.apply(this,arguments)),e<=1&&(n=void 0),i}}var wx=bx;function _x(e){return wx(2,e)}let zm;wm=_x,zm=Math.max;function xx(e){if(!(e&&e.length))return[];var n=0;return e=l4(e,function(i){if(c4(i))return n=zm(i.length,n),!0}),a4(n,function(i){return o4(e,g4(i))})}var kx=u4(xx);ym=function(e,n){if(e==null)throw Error(n||`Expected value but got ${e}`)},BigInt.prototype.toJSON=function(){return JSON.rawJSON(this.toString())},gm=function(e){try{return JSON.parse(e,(n,i)=>md(i))}catch{}if(e==null||e==="")return{};try{return e??(e=""),e=e.replaceAll(new RegExp(`(?<=\\s|^|\\[|,|:)(NaN|-Infinity|Infinity)(?=(?:[^"'\\\\]*(\\\\.|'([^'\\\\]*\\\\.)*[^'\\\\]*'|"([^"\\\\]*\\\\.)*[^"\\\\]*"))*[^"']*$)`,"g"),'"\u25D0$1\u25D0"'),JSON.parse(e,(n,i)=>typeof i=="string"?i==="\u25D0NaN\u25D0"?NaN:i==="\u25D0Infinity\u25D0"?1/0:i==="\u25D0-Infinity\u25D0"?-1/0:md(i):md(i))}catch{return{}}};function Sx(e,n){return e==null?"":typeof e=="number"&&!Number.isNaN(e)?e.toLocaleString(n,{useGrouping:!1,maximumFractionDigits:20}):String(e)}tx=function(e,n){if(e.length===0)return"";let i=Object.keys(e[0]),o=e.map(s=>i.map(c=>Sx(s[c],n)).join(" "));return`${i.join(" ")}
9
+ `+l.stack}}var br=Object.prototype.hasOwnProperty,Pn=n.unstable_scheduleCallback,dn=n.unstable_cancelCallback,ta=n.unstable_shouldYield,gi=n.unstable_requestPaint,Ut=n.unstable_now,yi=n.unstable_getCurrentPriorityLevel,fn=n.unstable_ImmediatePriority,ni=n.unstable_UserBlockingPriority,zt=n.unstable_NormalPriority,Br=n.unstable_LowPriority,_t=n.unstable_IdlePriority,vi=n.log,na=n.unstable_setDisableYieldValue,wr=null,Jt=null;function Ge(t){if(typeof vi=="function"&&na(t),Jt&&typeof Jt.setStrictMode=="function")try{Jt.setStrictMode(wr,t)}catch{}}var gt=Math.clz32?Math.clz32:zn,xt=Math.log,kt=Math.LN2;function zn(t){return t>>>=0,t===0?32:31-(xt(t)/kt|0)|0}var _r=256,St=262144,ir=4194304;function Mn(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Hr(t,r,a){var l=t.pendingLanes;if(l===0)return 0;var h=0,g=t.suspendedLanes,S=t.pingedLanes;t=t.warmLanes;var D=l&134217727;return D===0?(D=l&~g,D===0?S===0?a||(a=l&~t,a!==0&&(h=Mn(a))):h=Mn(S):h=Mn(D)):(l=D&~g,l===0?(S&=D,S===0?a||(a=D&~t,a!==0&&(h=Mn(a))):h=Mn(S)):h=Mn(l)),h===0?0:r!==0&&r!==h&&(r&g)===0&&(g=h&-h,a=r&-r,g>=a||g===32&&a&4194048)?r:h}function bn(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function ar(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function bi(){var t=ir;return ir<<=1,!(ir&62914560)&&(ir=4194304),t}function ri(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function Ln(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function wi(t,r,a,l,h,g){var S=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var D=t.entanglements,H=t.expirationTimes,ne=t.hiddenUpdates;for(a=S&~a;0<a;){var he=31-gt(a),ge=1<<he;D[he]=0,H[he]=-1;var ae=ne[he];if(ae!==null)for(ne[he]=null,he=0;he<ae.length;he++){var ue=ae[he];ue!==null&&(ue.lane&=-536870913)}a&=~ge}l!==0&&Fn(t,l,0),g!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=g&~(S&~r))}function Fn(t,r,a){t.pendingLanes|=r,t.suspendedLanes&=~r;var l=31-gt(r);t.entangledLanes|=r,t.entanglements[l]=t.entanglements[l]|1073741824|a&261930}function or(t,r){var a=t.entangledLanes|=r;for(t=t.entanglements;a;){var l=31-gt(a),h=1<<l;h&r|t[l]&r&&(t[l]|=r),a&=~h}}function M(t,r){var a=r&-r;return a=a&42?1:Ye(a),(a&(t.suspendedLanes|r))===0?a:0}function Ye(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function j(t){return t&=-t,2<t?8<t?t&134217727?32:268435456:8:2}function te(){var t=Q.p;return t===0?(t=window.event,t===void 0?32:F2(t.type)):t}function ve(t,r){var a=Q.p;try{return Q.p=t,r()}finally{Q.p=a}}var Te=Math.random().toString(36).slice(2),He="__reactFiber$"+Te,Ve="__reactProps$"+Te,ot="__reactContainer$"+Te,Mt="__reactEvents$"+Te,Ze="__reactListeners$"+Te,Lt="__reactHandles$"+Te,rt="__reactResources$"+Te,ut="__reactMarker$"+Te;function wn(t){delete t[He],delete t[Ve],delete t[Mt],delete t[Ze],delete t[Lt]}function sr(t){var r=t[He];if(r)return r;for(var a=t.parentNode;a;){if(r=a[ot]||a[He]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=E2(t);t!==null;){if(a=t[He])return a;t=E2(t)}return r}t=a,a=t.parentNode}return null}function ii(t){if(t=t[He]||t[ot]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function Bn(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(s(33))}function ra(t){var r=t[rt];return r||(r=t[rt]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Xt(t){t[ut]=!0}var zs=new Set,pc={};function ai(t,r){ia(t,r),ia(t+"Capture",r)}function ia(t,r){for(pc[t]=r,t=0;t<r.length;t++)zs.add(r[t])}var wf=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Kn={},hc={};function _f(t){return br.call(hc,t)?!0:br.call(Kn,t)?!1:wf.test(t)?hc[t]=!0:(Kn[t]=!0,!1)}function Wa(t,r,a){if(_f(r))if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var l=r.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+a)}}function Ua(t,r,a){if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+a)}}function Vr(t,r,a,l){if(l===null)t.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(r,a,""+l)}}function Hn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function mc(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function gc(t,r,a){var l=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&l!==void 0&&typeof l.get=="function"&&typeof l.set=="function"){var h=l.get,g=l.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return h.call(this)},set:function(S){a=""+S,g.call(this,S)}}),Object.defineProperty(t,r,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(S){a=""+S},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function Fs(t){if(!t._valueTracker){var r=mc(t)?"checked":"value";t._valueTracker=gc(t,r,""+t[r])}}function Bs(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var a=r.getValue(),l="";return t&&(l=mc(t)?t.checked?"true":"false":t.value),t=l,t===a?!1:(r.setValue(t),!0)}function Nn(t){if(t||(t=typeof document<"u"?document:void 0),t===void 0)return null;try{return t.activeElement||t.body}catch{return t.body}}var ct=/[\n"\\]/g;function lr(t){return t.replace(ct,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function aa(t,r,a,l,h,g,S,D){t.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.type=S:t.removeAttribute("type"),r==null?S!=="submit"&&S!=="reset"||t.removeAttribute("value"):S==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Hn(r)):t.value!==""+Hn(r)&&(t.value=""+Hn(r)),r==null?a==null?l!=null&&t.removeAttribute("value"):_i(t,S,Hn(a)):_i(t,S,Hn(r)),h==null&&g!=null&&(t.defaultChecked=!!g),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?t.name=""+Hn(D):t.removeAttribute("name")}function yc(t,r,a,l,h,g,S,D){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.type=g),r!=null||a!=null){if(!(g!=="submit"&&g!=="reset"||r!=null)){Fs(t);return}a=a==null?"":""+Hn(a),r=r==null?a:""+Hn(r),D||r===t.value||(t.value=r),t.defaultValue=r}l??(l=h),l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=D?t.checked:!!l,t.defaultChecked=!!l,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.name=S),Fs(t)}function _i(t,r,a){r==="number"&&Nn(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function oa(t,r,a,l){if(t=t.options,r){r={};for(var h=0;h<a.length;h++)r["$"+a[h]]=!0;for(a=0;a<t.length;a++)h=r.hasOwnProperty("$"+t[a].value),t[a].selected!==h&&(t[a].selected=h),h&&l&&(t[a].defaultSelected=!0)}else{for(a=""+Hn(a),r=null,h=0;h<t.length;h++){if(t[h].value===a){t[h].selected=!0,l&&(t[h].defaultSelected=!0);return}r!==null||t[h].disabled||(r=t[h])}r!==null&&(r.selected=!0)}}function sa(t,r,a){if(r!=null&&(r=""+Hn(r),r!==t.value&&(t.value=r),a==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=a==null?"":""+Hn(a)}function Bo(t,r,a,l){if(r==null){if(l!=null){if(a!=null)throw Error(s(92));if(re(l)){if(1<l.length)throw Error(s(93));l=l[0]}a=l}a??(a=""),r=a}a=Hn(r),t.defaultValue=a,l=t.textContent,l===a&&l!==""&&l!==null&&(t.value=l),Fs(t)}function xi(t,r){if(r){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=r;return}}t.textContent=r}var xf=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function ki(t,r,a){var l=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":l?t.setProperty(r,a):typeof a!="number"||a===0||xf.has(r)?r==="float"?t.cssFloat=a:t[r]=(""+a).trim():t[r]=a+"px"}function vc(t,r,a){if(r!=null&&typeof r!="object")throw Error(s(62));if(t=t.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="");for(var h in r)l=r[h],r.hasOwnProperty(h)&&a[h]!==l&&ki(t,h,l)}else for(var g in r)r.hasOwnProperty(g)&&ki(t,g,r[g])}function Ka(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ho=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),bc=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Vo(t){return bc.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function xr(){}var _n=null;function Hs(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Vn=null,oi=null;function wc(t){var r=ii(t);if(r&&(t=r.stateNode)){var a=t[Ve]||null;e:switch(t=r.stateNode,r.type){case"input":if(aa(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+lr(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var l=a[r];if(l!==t&&l.form===t.form){var h=l[Ve]||null;if(!h)throw Error(s(90));aa(l,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(r=0;r<a.length;r++)l=a[r],l.form===t.form&&Bs(l)}break e;case"textarea":sa(t,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&oa(t,!!a.multiple,r,!1)}}}var Vs=!1;function _c(t,r,a){if(Vs)return t(r,a);Vs=!0;try{return t(r)}finally{if(Vs=!1,(Vn!==null||oi!==null)&&(au(),Vn&&(r=Vn,t=oi,oi=Vn=null,wc(r),t)))for(r=0;r<t.length;r++)wc(t[r])}}function Qa(t,r){var a=t.stateNode;if(a===null)return null;var l=a[Ve]||null;if(l===null)return null;a=l[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(s(231,r,typeof a));return a}var $r=!(typeof window>"u"||window.document===void 0||window.document.createElement===void 0),$s=!1;if($r)try{var Ga={};Object.defineProperty(Ga,"passive",{get:function(){$s=!0}}),window.addEventListener("test",Ga,Ga),window.removeEventListener("test",Ga,Ga)}catch{$s=!1}var Wr=null,$o=null,Ja=null;function Ws(){if(Ja)return Ja;var t,r=$o,a=r.length,l,h="value"in Wr?Wr.value:Wr.textContent,g=h.length;for(t=0;t<a&&r[t]===h[t];t++);var S=a-t;for(l=1;l<=S&&r[a-l]===h[g-l];l++);return Ja=h.slice(t,1<l?1-l:void 0)}function Xa(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function Ya(){return!0}function Us(){return!1}function xn(t){function r(a,l,h,g,S){for(var D in this._reactName=a,this._targetInst=h,this.type=l,this.nativeEvent=g,this.target=S,this.currentTarget=null,t)t.hasOwnProperty(D)&&(a=t[D],this[D]=a?a(g):g[D]);return this.isDefaultPrevented=(g.defaultPrevented==null?g.returnValue===!1:g.defaultPrevented)?Ya:Us,this.isPropagationStopped=Us,this}return C(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Ya)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Ya)},persist:function(){},isPersistent:Ya}),r}var Si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},u=xn(Si),m=C({},Si,{view:0,detail:0}),v=xn(m),b,x,k,R=C({},m,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qe,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==k&&(k&&t.type==="mousemove"?(b=t.screenX-k.screenX,x=t.screenY-k.screenY):x=b=0,k=t),b)},movementY:function(t){return"movementY"in t?t.movementY:x}}),O=xn(R),L=xn(C({},R,{dataTransfer:0})),z=xn(C({},m,{relatedTarget:0})),q=xn(C({},Si,{animationName:0,elapsedTime:0,pseudoElement:0})),oe=xn(C({},Si,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}})),ie=xn(C({},Si,{data:0})),X={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Y={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},xe={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _e(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=xe[t])?!!r[t]:!1}function qe(){return _e}var Re=xn(C({},m,{key:function(t){if(t.key){var r=X[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Xa(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Y[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qe,charCode:function(t){return t.type==="keypress"?Xa(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Xa(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}})),Ne=xn(C({},R,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),dt=xn(C({},m,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qe})),Je=xn(C({},Si,{propertyName:0,elapsedTime:0,pseudoElement:0})),Nt=xn(C({},R,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0})),Ft=xn(C({},Si,{newState:0,oldState:0})),Ue=[9,13,27,32],$e=$r&&"CompositionEvent"in window,$t=null;$r&&"documentMode"in document&&($t=document.documentMode);var rn=$r&&"TextEvent"in window&&!$t,pn=$r&&(!$e||$t&&8<$t&&11>=$t),Za=" ",xc=!1;function kc(t,r){switch(t){case"keyup":return Ue.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wo(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Uo=!1;function hT(t,r){switch(t){case"compositionend":return Wo(r);case"keypress":return r.which===32?(xc=!0,Za):null;case"textInput":return t=r.data,t===Za&&xc?null:t;default:return null}}function mT(t,r){if(Uo)return t==="compositionend"||!$e&&kc(t,r)?(t=Ws(),Ja=$o=Wr=null,Uo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return pn&&r.locale!=="ko"?null:r.data;default:return null}}var gT={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Pv(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!gT[t.type]:r==="textarea"}function Mv(t,r,a,l){Vn?oi?oi.push(l):oi=[l]:Vn=l,r=fu(r,"onChange"),0<r.length&&(a=new u("onChange","change",null,a,l),t.push({event:a,listeners:r}))}var Ks=null,Qs=null;function yT(t){d2(t,0)}function Sc(t){if(Bs(Bn(t)))return t}function Lv(t,r){if(t==="change")return r}var Nv=!1;if($r){var kf;if($r){var Sf="oninput"in document;if(!Sf){var Iv=document.createElement("div");Iv.setAttribute("oninput","return;"),Sf=typeof Iv.oninput=="function"}kf=Sf}else kf=!1;Nv=kf&&(!document.documentMode||9<document.documentMode)}function Av(){Ks&&(Ks.detachEvent("onpropertychange",qv),Qs=Ks=null)}function qv(t){if(t.propertyName==="value"&&Sc(Qs)){var r=[];Mv(r,Qs,t,Hs(t)),_c(yT,r)}}function vT(t,r,a){t==="focusin"?(Av(),Ks=r,Qs=a,Ks.attachEvent("onpropertychange",qv)):t==="focusout"&&Av()}function bT(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Sc(Qs)}function wT(t,r){if(t==="click")return Sc(r)}function _T(t,r){if(t==="input"||t==="change")return Sc(r)}function xT(t,r){return t===r&&(t!==0||1/t==1/r)||t!==t&&r!==r}var cr=typeof Object.is=="function"?Object.is:xT;function Gs(t,r){if(cr(t,r))return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var a=Object.keys(t),l=Object.keys(r);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var h=a[l];if(!br.call(r,h)||!cr(t[h],r[h]))return!1}return!0}function jv(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function zv(t,r){var a=jv(t);t=0;for(var l;a;){if(a.nodeType===3){if(l=t+a.textContent.length,t<=r&&l>=r)return{node:a,offset:r-t};t=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=jv(a)}}function Fv(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?Fv(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Bv(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Nn(t.document);r instanceof t.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)t=r.contentWindow;else break;r=Nn(t.document)}return r}function Cf(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var kT=$r&&"documentMode"in document&&11>=document.documentMode,Ko=null,Ef=null,Js=null,Tf=!1;function Hv(t,r,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Tf||Ko==null||Ko!==Nn(l)||(l=Ko,"selectionStart"in l&&Cf(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Js&&Gs(Js,l)||(Js=l,l=fu(Ef,"onSelect"),0<l.length&&(r=new u("onSelect","select",null,r,a),t.push({event:r,listeners:l}),r.target=Ko)))}function eo(t,r){var a={};return a[t.toLowerCase()]=r.toLowerCase(),a["Webkit"+t]="webkit"+r,a["Moz"+t]="moz"+r,a}var Qo={animationend:eo("Animation","AnimationEnd"),animationiteration:eo("Animation","AnimationIteration"),animationstart:eo("Animation","AnimationStart"),transitionrun:eo("Transition","TransitionRun"),transitionstart:eo("Transition","TransitionStart"),transitioncancel:eo("Transition","TransitionCancel"),transitionend:eo("Transition","TransitionEnd")},Rf={},Vv={};$r&&(Vv=document.createElement("div").style,"AnimationEvent"in window||(delete Qo.animationend.animation,delete Qo.animationiteration.animation,delete Qo.animationstart.animation),"TransitionEvent"in window||delete Qo.transitionend.transition);function to(t){if(Rf[t])return Rf[t];if(!Qo[t])return t;var r=Qo[t],a;for(a in r)if(r.hasOwnProperty(a)&&a in Vv)return Rf[t]=r[a];return t}var $v=to("animationend"),Wv=to("animationiteration"),Uv=to("animationstart"),ST=to("transitionrun"),CT=to("transitionstart"),ET=to("transitioncancel"),Kv=to("transitionend"),Qv=new Map,Df="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Df.push("scrollEnd");function Ur(t,r){Qv.set(t,r),ai(r,[t])}var Cc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},kr=[],Go=0,Of=0;function Ec(){for(var t=Go,r=Of=Go=0;r<t;){var a=kr[r];kr[r++]=null;var l=kr[r];kr[r++]=null;var h=kr[r];kr[r++]=null;var g=kr[r];if(kr[r++]=null,l!==null&&h!==null){var S=l.pending;S===null?h.next=h:(h.next=S.next,S.next=h),l.pending=h}g!==0&&Gv(a,h,g)}}function Tc(t,r,a,l){kr[Go++]=t,kr[Go++]=r,kr[Go++]=a,kr[Go++]=l,Of|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function Pf(t,r,a,l){return Tc(t,r,a,l),Rc(t)}function no(t,r){return Tc(t,null,null,r),Rc(t)}function Gv(t,r,a){t.lanes|=a;var l=t.alternate;l!==null&&(l.lanes|=a);for(var h=!1,g=t.return;g!==null;)g.childLanes|=a,l=g.alternate,l!==null&&(l.childLanes|=a),g.tag===22&&(t=g.stateNode,t===null||t._visibility&1||(h=!0)),t=g,g=g.return;return t.tag===3?(g=t.stateNode,h&&r!==null&&(h=31-gt(a),t=g.hiddenUpdates,l=t[h],l===null?t[h]=[r]:l.push(r),r.lane=a|536870912),g):null}function Rc(t){if(50<vl)throw vl=0,Fp=null,Error(s(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var Jo={};function TT(t,r,a,l){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ur(t,r,a,l){return new TT(t,r,a,l)}function Mf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ci(t,r){var a=t.alternate;return a===null?(a=ur(t.tag,r,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=r,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,r=t.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function Jv(t,r){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,r=a.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function Dc(t,r,a,l,h,g){var S=0;if(l=t,typeof t=="function")Mf(t)&&(S=1);else if(typeof t=="string")S=LR(t,a,Ae.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case fe:return t=ur(31,a,r,h),t.elementType=fe,t.lanes=g,t;case $:return ro(a.children,h,g,r);case V:S=8,h|=24;break;case F:return t=ur(12,a,r,h|2),t.elementType=F,t.lanes=g,t;case P:return t=ur(13,a,r,h),t.elementType=P,t.lanes=g,t;case A:return t=ur(19,a,r,h),t.elementType=A,t.lanes=g,t;default:if(typeof t=="object"&&t)switch(t.$$typeof){case K:S=10;break e;case N:S=9;break e;case pe:S=11;break e;case W:S=14;break e;case de:S=16,l=null;break e}S=29,a=Error(s(130,t===null?"null":typeof t,"")),l=null}return r=ur(S,a,r,h),r.elementType=t,r.type=l,r.lanes=g,r}function ro(t,r,a,l){return t=ur(7,t,l,r),t.lanes=a,t}function Lf(t,r,a){return t=ur(6,t,null,r),t.lanes=a,t}function Xv(t){var r=ur(18,null,null,0);return r.stateNode=t,r}function Nf(t,r,a){return r=ur(4,t.children===null?[]:t.children,t.key,r),r.lanes=a,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var Yv=new WeakMap;function Sr(t,r){if(typeof t=="object"&&t){var a=Yv.get(t);return a===void 0?(r={value:t,source:r,stack:On(r)},Yv.set(t,r),r):a}return{value:t,source:r,stack:On(r)}}var Xo=[],Yo=0,Oc=null,Xs=0,Cr=[],Er=0,la=null,si=1,li="";function Ei(t,r){Xo[Yo++]=Xs,Xo[Yo++]=Oc,Oc=t,Xs=r}function Zv(t,r,a){Cr[Er++]=si,Cr[Er++]=li,Cr[Er++]=la,la=t;var l=si;t=li;var h=32-gt(l)-1;l&=~(1<<h),a+=1;var g=32-gt(r)+h;if(30<g){var S=h-h%5;g=(l&(1<<S)-1).toString(32),l>>=S,h-=S,si=1<<32-gt(r)+h|a<<h|l,li=g+t}else si=1<<g|a<<h|l,li=t}function If(t){t.return!==null&&(Ei(t,1),Zv(t,1,0))}function Af(t){for(;t===Oc;)Oc=Xo[--Yo],Xo[Yo]=null,Xs=Xo[--Yo],Xo[Yo]=null;for(;t===la;)la=Cr[--Er],Cr[Er]=null,li=Cr[--Er],Cr[Er]=null,si=Cr[--Er],Cr[Er]=null}function e1(t,r){Cr[Er++]=si,Cr[Er++]=li,Cr[Er++]=la,si=r.id,li=r.overflow,la=t}var Sn=null,Bt=null,st=!1,ca=null,Tr=!1,qf=Error(s(519));function ua(t){throw Ys(Sr(Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML","")),t)),qf}function t1(t){var r=t.stateNode,a=t.type,l=t.memoizedProps;switch(r[He]=t,r[Ve]=l,a){case"dialog":nt("cancel",r),nt("close",r);break;case"iframe":case"object":case"embed":nt("load",r);break;case"video":case"audio":for(a=0;a<wl.length;a++)nt(wl[a],r);break;case"source":nt("error",r);break;case"img":case"image":case"link":nt("error",r),nt("load",r);break;case"details":nt("toggle",r);break;case"input":nt("invalid",r),yc(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":nt("invalid",r);break;case"textarea":nt("invalid",r),Bo(r,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||l.suppressHydrationWarning===!0||g2(r.textContent,a)?(l.popover!=null&&(nt("beforetoggle",r),nt("toggle",r)),l.onScroll!=null&&nt("scroll",r),l.onScrollEnd!=null&&nt("scrollend",r),l.onClick!=null&&(r.onclick=xr),r=!0):r=!1,r||ua(t,!0)}function n1(t){for(Sn=t.return;Sn;)switch(Sn.tag){case 5:case 31:case 13:Tr=!1;return;case 27:case 3:Tr=!0;return;default:Sn=Sn.return}}function Zo(t){if(t!==Sn)return!1;if(!st)return n1(t),st=!0,!1;var r=t.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||eh(t.type,t.memoizedProps)),a=!a),a&&Bt&&ua(t),n1(t),r===13){if(t=t.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(317));Bt=C2(t)}else if(r===31){if(t=t.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(317));Bt=C2(t)}else r===27?(r=Bt,xa(t.type)?(t=ah,ah=null,Bt=t):Bt=r):Bt=Sn?Dr(t.stateNode.nextSibling):null;return!0}function io(){Bt=Sn=null,st=!1}function jf(){var t=ca;return t!==null&&(Xn===null?Xn=t:Xn.push.apply(Xn,t),ca=null),t}function Ys(t){ca===null?ca=[t]:ca.push(t)}var zf=Be(null),ao=null,Ti=null;function da(t,r,a){Pe(zf,r._currentValue),r._currentValue=a}function Ri(t){t._currentValue=zf.current,je(zf)}function Ff(t,r,a){for(;t!==null;){var l=t.alternate;if((t.childLanes&r)===r?l!==null&&(l.childLanes&r)!==r&&(l.childLanes|=r):(t.childLanes|=r,l!==null&&(l.childLanes|=r)),t===a)break;t=t.return}}function Bf(t,r,a,l){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var g=h.dependencies;if(g!==null){var S=h.child;g=g.firstContext;e:for(;g!==null;){var D=g;g=h;for(var H=0;H<r.length;H++)if(D.context===r[H]){g.lanes|=a,D=g.alternate,D!==null&&(D.lanes|=a),Ff(g.return,a,t),l||(S=null);break e}g=D.next}}else if(h.tag===18){if(S=h.return,S===null)throw Error(s(341));S.lanes|=a,g=S.alternate,g!==null&&(g.lanes|=a),Ff(S,a,t),S=null}else S=h.child;if(S!==null)S.return=h;else for(S=h;S!==null;){if(S===t){S=null;break}if(h=S.sibling,h!==null){h.return=S.return,S=h;break}S=S.return}h=S}}function es(t,r,a,l){t=null;for(var h=r,g=!1;h!==null;){if(!g){if(h.flags&524288)g=!0;else if(h.flags&262144)break}if(h.tag===10){var S=h.alternate;if(S===null)throw Error(s(387));if(S=S.memoizedProps,S!==null){var D=h.type;cr(h.pendingProps.value,S.value)||(t===null?t=[D]:t.push(D))}}else if(h===Dn.current){if(S=h.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t===null?t=[Cl]:t.push(Cl))}h=h.return}t!==null&&Bf(r,t,a,l),r.flags|=262144}function Pc(t){for(t=t.firstContext;t!==null;){if(!cr(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function oo(t){ao=t,Ti=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Cn(t){return r1(ao,t)}function Mc(t,r){return ao===null&&oo(t),r1(t,r)}function r1(t,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},Ti===null){if(t===null)throw Error(s(308));Ti=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else Ti=Ti.next=r;return a}var RT=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(a,l){t.push(l)}};this.abort=function(){r.aborted=!0,t.forEach(function(a){return a()})}},DT=n.unstable_scheduleCallback,OT=n.unstable_NormalPriority,an={$$typeof:K,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hf(){return{controller:new RT,data:new Map,refCount:0}}function Zs(t){t.refCount--,t.refCount===0&&DT(OT,function(){t.controller.abort()})}var el=null,Vf=0,ts=0,ns=null;function PT(t,r){if(el===null){var a=el=[];Vf=0,ts=Up(),ns={status:"pending",value:void 0,then:function(l){a.push(l)}}}return Vf++,r.then(i1,i1),r}function i1(){if(--Vf===0&&el!==null){ns!==null&&(ns.status="fulfilled");var t=el;el=null,ts=0,ns=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function MT(t,r){var a=[],l={status:"pending",value:null,reason:null,then:function(h){a.push(h)}};return t.then(function(){l.status="fulfilled",l.value=r;for(var h=0;h<a.length;h++)(0,a[h])(r)},function(h){for(l.status="rejected",l.reason=h,h=0;h<a.length;h++)(0,a[h])(void 0)}),l}var a1=se.S;se.S=function(t,r){zb=Ut(),typeof r=="object"&&r&&typeof r.then=="function"&&PT(t,r),a1!==null&&a1(t,r)};var so=Be(null);function $f(){var t=so.current;return t===null?It.pooledCache:t}function Lc(t,r){r===null?Pe(so,so.current):Pe(so,r.pool)}function o1(){var t=$f();return t===null?null:{parent:an._currentValue,pool:t}}var rs=Error(s(460)),Wf=Error(s(474)),Nc=Error(s(542)),Ic={then:function(){}};function s1(t){return t=t.status,t==="fulfilled"||t==="rejected"}function l1(t,r,a){switch(a=t[a],a===void 0?t.push(r):a!==r&&(r.then(xr,xr),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,u1(t),t;default:if(typeof r.status=="string")r.then(xr,xr);else{if(t=It,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=r,t.status="pending",t.then(function(l){if(r.status==="pending"){var h=r;h.status="fulfilled",h.value=l}},function(l){if(r.status==="pending"){var h=r;h.status="rejected",h.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,u1(t),t}throw co=r,rs}}function lo(t){try{var r=t._init;return r(t._payload)}catch(a){throw typeof a=="object"&&a&&typeof a.then=="function"?(co=a,rs):a}}var co=null;function c1(){if(co===null)throw Error(s(459));var t=co;return co=null,t}function u1(t){if(t===rs||t===Nc)throw Error(s(483))}var is=null,tl=0;function Ac(t){var r=tl;return tl+=1,is===null&&(is=[]),l1(is,t,r)}function nl(t,r){r=r.props.ref,t.ref=r===void 0?null:r}function qc(t,r){throw r.$$typeof===E?Error(s(525)):(t=Object.prototype.toString.call(r),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function d1(t){function r(G,U){if(t){var ee=G.deletions;ee===null?(G.deletions=[U],G.flags|=16):ee.push(U)}}function a(G,U){if(!t)return null;for(;U!==null;)r(G,U),U=U.sibling;return null}function l(G){for(var U=new Map;G!==null;)G.key===null?U.set(G.index,G):U.set(G.key,G),G=G.sibling;return U}function h(G,U){return G=Ci(G,U),G.index=0,G.sibling=null,G}function g(G,U,ee){return G.index=ee,t?(ee=G.alternate,ee===null?(G.flags|=67108866,U):(ee=ee.index,ee<U?(G.flags|=67108866,U):ee)):(G.flags|=1048576,U)}function S(G){return t&&G.alternate===null&&(G.flags|=67108866),G}function D(G,U,ee,me){return U===null||U.tag!==6?(U=Lf(ee,G.mode,me),U.return=G,U):(U=h(U,ee),U.return=G,U)}function H(G,U,ee,me){var Me=ee.type;return Me===$?he(G,U,ee.props.children,me,ee.key):U!==null&&(U.elementType===Me||typeof Me=="object"&&Me&&Me.$$typeof===de&&lo(Me)===U.type)?(U=h(U,ee.props),nl(U,ee),U.return=G,U):(U=Dc(ee.type,ee.key,ee.props,null,G.mode,me),nl(U,ee),U.return=G,U)}function ne(G,U,ee,me){return U===null||U.tag!==4||U.stateNode.containerInfo!==ee.containerInfo||U.stateNode.implementation!==ee.implementation?(U=Nf(ee,G.mode,me),U.return=G,U):(U=h(U,ee.children||[]),U.return=G,U)}function he(G,U,ee,me,Me){return U===null||U.tag!==7?(U=ro(ee,G.mode,me,Me),U.return=G,U):(U=h(U,ee),U.return=G,U)}function ge(G,U,ee){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=Lf(""+U,G.mode,ee),U.return=G,U;if(typeof U=="object"&&U){switch(U.$$typeof){case T:return ee=Dc(U.type,U.key,U.props,null,G.mode,ee),nl(ee,U),ee.return=G,ee;case I:return U=Nf(U,G.mode,ee),U.return=G,U;case de:return U=lo(U),ge(G,U,ee)}if(re(U)||be(U))return U=ro(U,G.mode,ee,null),U.return=G,U;if(typeof U.then=="function")return ge(G,Ac(U),ee);if(U.$$typeof===K)return ge(G,Mc(G,U),ee);qc(G,U)}return null}function ae(G,U,ee,me){var Me=U===null?null:U.key;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Me===null?D(G,U,""+ee,me):null;if(typeof ee=="object"&&ee){switch(ee.$$typeof){case T:return ee.key===Me?H(G,U,ee,me):null;case I:return ee.key===Me?ne(G,U,ee,me):null;case de:return ee=lo(ee),ae(G,U,ee,me)}if(re(ee)||be(ee))return Me===null?he(G,U,ee,me,null):null;if(typeof ee.then=="function")return ae(G,U,Ac(ee),me);if(ee.$$typeof===K)return ae(G,U,Mc(G,ee),me);qc(G,ee)}return null}function ue(G,U,ee,me,Me){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return G=G.get(ee)||null,D(U,G,""+me,Me);if(typeof me=="object"&&me){switch(me.$$typeof){case T:return G=G.get(me.key===null?ee:me.key)||null,H(U,G,me,Me);case I:return G=G.get(me.key===null?ee:me.key)||null,ne(U,G,me,Me);case de:return me=lo(me),ue(G,U,ee,me,Me)}if(re(me)||be(me))return G=G.get(ee)||null,he(U,G,me,Me,null);if(typeof me.then=="function")return ue(G,U,ee,Ac(me),Me);if(me.$$typeof===K)return ue(G,U,ee,Mc(U,me),Me);qc(U,me)}return null}function De(G,U,ee,me){for(var Me=null,vt=null,Oe=U,Qe=U=0,at=null;Oe!==null&&Qe<ee.length;Qe++){Oe.index>Qe?(at=Oe,Oe=null):at=Oe.sibling;var ht=ae(G,Oe,ee[Qe],me);if(ht===null){Oe===null&&(Oe=at);break}t&&Oe&&ht.alternate===null&&r(G,Oe),U=g(ht,U,Qe),vt===null?Me=ht:vt.sibling=ht,vt=ht,Oe=at}if(Qe===ee.length)return a(G,Oe),st&&Ei(G,Qe),Me;if(Oe===null){for(;Qe<ee.length;Qe++)Oe=ge(G,ee[Qe],me),Oe!==null&&(U=g(Oe,U,Qe),vt===null?Me=Oe:vt.sibling=Oe,vt=Oe);return st&&Ei(G,Qe),Me}for(Oe=l(Oe);Qe<ee.length;Qe++)at=ue(Oe,G,Qe,ee[Qe],me),at!==null&&(t&&at.alternate!==null&&Oe.delete(at.key===null?Qe:at.key),U=g(at,U,Qe),vt===null?Me=at:vt.sibling=at,vt=at);return t&&Oe.forEach(function(Ta){return r(G,Ta)}),st&&Ei(G,Qe),Me}function Ie(G,U,ee,me){if(ee==null)throw Error(s(151));for(var Me=null,vt=null,Oe=U,Qe=U=0,at=null,ht=ee.next();Oe!==null&&!ht.done;Qe++,ht=ee.next()){Oe.index>Qe?(at=Oe,Oe=null):at=Oe.sibling;var Ta=ae(G,Oe,ht.value,me);if(Ta===null){Oe===null&&(Oe=at);break}t&&Oe&&Ta.alternate===null&&r(G,Oe),U=g(Ta,U,Qe),vt===null?Me=Ta:vt.sibling=Ta,vt=Ta,Oe=at}if(ht.done)return a(G,Oe),st&&Ei(G,Qe),Me;if(Oe===null){for(;!ht.done;Qe++,ht=ee.next())ht=ge(G,ht.value,me),ht!==null&&(U=g(ht,U,Qe),vt===null?Me=ht:vt.sibling=ht,vt=ht);return st&&Ei(G,Qe),Me}for(Oe=l(Oe);!ht.done;Qe++,ht=ee.next())ht=ue(Oe,G,Qe,ht.value,me),ht!==null&&(t&&ht.alternate!==null&&Oe.delete(ht.key===null?Qe:ht.key),U=g(ht,U,Qe),vt===null?Me=ht:vt.sibling=ht,vt=ht);return t&&Oe.forEach(function(KR){return r(G,KR)}),st&&Ei(G,Qe),Me}function Ot(G,U,ee,me){if(typeof ee=="object"&&ee&&ee.type===$&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee){switch(ee.$$typeof){case T:e:{for(var Me=ee.key;U!==null;){if(U.key===Me){if(Me=ee.type,Me===$){if(U.tag===7){a(G,U.sibling),me=h(U,ee.props.children),me.return=G,G=me;break e}}else if(U.elementType===Me||typeof Me=="object"&&Me&&Me.$$typeof===de&&lo(Me)===U.type){a(G,U.sibling),me=h(U,ee.props),nl(me,ee),me.return=G,G=me;break e}a(G,U);break}else r(G,U);U=U.sibling}ee.type===$?(me=ro(ee.props.children,G.mode,me,ee.key),me.return=G,G=me):(me=Dc(ee.type,ee.key,ee.props,null,G.mode,me),nl(me,ee),me.return=G,G=me)}return S(G);case I:e:{for(Me=ee.key;U!==null;){if(U.key===Me)if(U.tag===4&&U.stateNode.containerInfo===ee.containerInfo&&U.stateNode.implementation===ee.implementation){a(G,U.sibling),me=h(U,ee.children||[]),me.return=G,G=me;break e}else{a(G,U);break}else r(G,U);U=U.sibling}me=Nf(ee,G.mode,me),me.return=G,G=me}return S(G);case de:return ee=lo(ee),Ot(G,U,ee,me)}if(re(ee))return De(G,U,ee,me);if(be(ee)){if(Me=be(ee),typeof Me!="function")throw Error(s(150));return ee=Me.call(ee),Ie(G,U,ee,me)}if(typeof ee.then=="function")return Ot(G,U,Ac(ee),me);if(ee.$$typeof===K)return Ot(G,U,Mc(G,ee),me);qc(G,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,U!==null&&U.tag===6?(a(G,U.sibling),me=h(U,ee),me.return=G,G=me):(a(G,U),me=Lf(ee,G.mode,me),me.return=G,G=me),S(G)):a(G,U)}return function(G,U,ee,me){try{tl=0;var Me=Ot(G,U,ee,me);return is=null,Me}catch(Oe){if(Oe===rs||Oe===Nc)throw Oe;var vt=ur(29,Oe,null,G.mode);return vt.lanes=me,vt.return=G,vt}}}var uo=d1(!0),f1=d1(!1),fa=!1;function Uf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kf(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function fo(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function po(t,r,a){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,yt&2){var h=l.pending;return h===null?r.next=r:(r.next=h.next,h.next=r),l.pending=r,r=Rc(t),Gv(t,null,a),r}return Tc(t,l,r,a),Rc(t)}function rl(t,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,a&4194048)){var l=r.lanes;l&=t.pendingLanes,a|=l,r.lanes=a,or(t,a)}}function Qf(t,r){var a=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var h=null,g=null;if(a=a.firstBaseUpdate,a!==null){do{var S={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};g===null?h=g=S:g=g.next=S,a=a.next}while(a!==null);g===null?h=g=r:g=g.next=r}else h=g=r;a={baseState:l.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:l.shared,callbacks:l.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=r:t.next=r,a.lastBaseUpdate=r}var Gf=!1;function il(){if(Gf){var t=ns;if(t!==null)throw t}}function al(t,r,a,l){Gf=!1;var h=t.updateQueue;fa=!1;var g=h.firstBaseUpdate,S=h.lastBaseUpdate,D=h.shared.pending;if(D!==null){h.shared.pending=null;var H=D,ne=H.next;H.next=null,S===null?g=ne:S.next=ne,S=H;var he=t.alternate;he!==null&&(he=he.updateQueue,D=he.lastBaseUpdate,D!==S&&(D===null?he.firstBaseUpdate=ne:D.next=ne,he.lastBaseUpdate=H))}if(g!==null){var ge=h.baseState;S=0,he=ne=H=null,D=g;do{var ae=D.lane&-536870913,ue=ae!==D.lane;if(ue?(it&ae)===ae:(l&ae)===ae){ae!==0&&ae===ts&&(Gf=!0),he!==null&&(he=he.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var De=t,Ie=D;ae=r;var Ot=a;switch(Ie.tag){case 1:if(De=Ie.payload,typeof De=="function"){ge=De.call(Ot,ge,ae);break e}ge=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Ie.payload,ae=typeof De=="function"?De.call(Ot,ge,ae):De,ae==null)break e;ge=C({},ge,ae);break e;case 2:fa=!0}}ae=D.callback,ae!==null&&(t.flags|=64,ue&&(t.flags|=8192),ue=h.callbacks,ue===null?h.callbacks=[ae]:ue.push(ae))}else ue={lane:ae,tag:D.tag,payload:D.payload,callback:D.callback,next:null},he===null?(ne=he=ue,H=ge):he=he.next=ue,S|=ae;if(D=D.next,D===null){if(D=h.shared.pending,D===null)break;ue=D,D=ue.next,ue.next=null,h.lastBaseUpdate=ue,h.shared.pending=null}}while(!0);he===null&&(H=ge),h.baseState=H,h.firstBaseUpdate=ne,h.lastBaseUpdate=he,g===null&&(h.shared.lanes=0),ya|=S,t.lanes=S,t.memoizedState=ge}}function p1(t,r){if(typeof t!="function")throw Error(s(191,t));t.call(r)}function h1(t,r){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)p1(a[t],r)}var as=Be(null),jc=Be(0);function m1(t,r){t=qi,Pe(jc,t),Pe(as,r),qi=t|r.baseLanes}function Jf(){Pe(jc,qi),Pe(as,as.current)}function Xf(){qi=jc.current,je(as),je(jc)}var dr=Be(null),Kr=null;function pa(t){var r=t.alternate;Pe(Yt,Yt.current&1),Pe(dr,t),Kr===null&&(r===null||as.current!==null||r.memoizedState!==null)&&(Kr=t)}function Yf(t){Pe(Yt,Yt.current),Pe(dr,t),Kr===null&&(Kr=t)}function g1(t){t.tag===22?(Pe(Yt,Yt.current),Pe(dr,t),Kr===null&&(Kr=t)):ha(t)}function ha(){Pe(Yt,Yt.current),Pe(dr,dr.current)}function fr(t){je(dr),Kr===t&&(Kr=null),je(Yt)}var Yt=Be(0);function zc(t){for(var r=t;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||rh(a)||ih(a)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if(r.flags&128)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Di=0,Ke=null,Rt=null,on=null,Fc=!1,os=!1,ho=!1,Bc=0,ol=0,ss=null,LT=0;function Qt(){throw Error(s(321))}function Zf(t,r){if(r===null)return!1;for(var a=0;a<r.length&&a<t.length;a++)if(!cr(t[a],r[a]))return!1;return!0}function ep(t,r,a,l,h,g){return Di=g,Ke=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,se.H=t===null||t.memoizedState===null?Z1:mp,ho=!1,g=a(l,h),ho=!1,os&&(g=v1(r,a,l,h)),y1(t),g}function y1(t){se.H=cl;var r=Rt!==null&&Rt.next!==null;if(Di=0,on=Rt=Ke=null,Fc=!1,ol=0,ss=null,r)throw Error(s(300));t===null||sn||(t=t.dependencies,t!==null&&Pc(t)&&(sn=!0))}function v1(t,r,a,l){Ke=t;var h=0;do{if(os&&(ss=null),ol=0,os=!1,25<=h)throw Error(s(301));if(h+=1,on=Rt=null,t.updateQueue!=null){var g=t.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}se.H=eb,g=r(a,l)}while(os);return g}function NT(){var t=se.H,r=t.useState()[0];return r=typeof r.then=="function"?sl(r):r,t=t.useState()[0],(Rt===null?null:Rt.memoizedState)!==t&&(Ke.flags|=1024),r}function tp(){var t=Bc!==0;return Bc=0,t}function np(t,r,a){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~a}function rp(t){if(Fc){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}Fc=!1}Di=0,on=Rt=Ke=null,os=!1,ol=Bc=0,ss=null}function $n(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?Ke.memoizedState=on=t:on=on.next=t,on}function Zt(){if(Rt===null){var t=Ke.alternate;t=t===null?null:t.memoizedState}else t=Rt.next;var r=on===null?Ke.memoizedState:on.next;if(r!==null)on=r,Rt=t;else{if(t===null)throw Ke.alternate===null?Error(s(467)):Error(s(310));Rt=t,t={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},on===null?Ke.memoizedState=on=t:on=on.next=t}return on}function Hc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function sl(t){var r=ol;return ol+=1,ss===null&&(ss=[]),t=l1(ss,t,r),r=Ke,(on===null?r.memoizedState:on.next)===null&&(r=r.alternate,se.H=r===null||r.memoizedState===null?Z1:mp),t}function Vc(t){if(typeof t=="object"&&t){if(typeof t.then=="function")return sl(t);if(t.$$typeof===K)return Cn(t)}throw Error(s(438,String(t)))}function ip(t){var r=null,a=Ke.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var l=Ke.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(h){return h.slice()}),index:0})))}if(r??(r={data:[],index:0}),a===null&&(a=Hc(),Ke.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(t),l=0;l<t;l++)a[l]=we;return r.index++,a}function Oi(t,r){return typeof r=="function"?r(t):r}function $c(t){return ap(Zt(),Rt,t)}function ap(t,r,a){var l=t.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=a;var h=t.baseQueue,g=l.pending;if(g!==null){if(h!==null){var S=h.next;h.next=g.next,g.next=S}r.baseQueue=h=g,l.pending=null}if(g=t.baseState,h===null)t.memoizedState=g;else{r=h.next;var D=S=null,H=null,ne=r,he=!1;do{var ge=ne.lane&-536870913;if(ge===ne.lane?(Di&ge)===ge:(it&ge)===ge){var ae=ne.revertLane;if(ae===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),ge===ts&&(he=!0);else if((Di&ae)===ae){ne=ne.next,ae===ts&&(he=!0);continue}else ge={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},H===null?(D=H=ge,S=g):H=H.next=ge,Ke.lanes|=ae,ya|=ae;ge=ne.action,ho&&a(g,ge),g=ne.hasEagerState?ne.eagerState:a(g,ge)}else ae={lane:ge,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},H===null?(D=H=ae,S=g):H=H.next=ae,Ke.lanes|=ge,ya|=ge;ne=ne.next}while(ne!==null&&ne!==r);if(H===null?S=g:H.next=D,!cr(g,t.memoizedState)&&(sn=!0,he&&(a=ns,a!==null)))throw a;t.memoizedState=g,t.baseState=S,t.baseQueue=H,l.lastRenderedState=g}return h===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function op(t){var r=Zt(),a=r.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=t;var l=a.dispatch,h=a.pending,g=r.memoizedState;if(h!==null){a.pending=null;var S=h=h.next;do g=t(g,S.action),S=S.next;while(S!==h);cr(g,r.memoizedState)||(sn=!0),r.memoizedState=g,r.baseQueue===null&&(r.baseState=g),a.lastRenderedState=g}return[g,l]}function b1(t,r,a){var l=Ke,h=Zt(),g=st;if(g){if(a===void 0)throw Error(s(407));a=a()}else a=r();var S=!cr((Rt||h).memoizedState,a);if(S&&(h.memoizedState=a,sn=!0),h=h.queue,cp(x1.bind(null,l,h,t),[t]),h.getSnapshot!==r||S||on!==null&&on.memoizedState.tag&1){if(l.flags|=2048,ls(9,{destroy:void 0},_1.bind(null,l,h,a,r),null),It===null)throw Error(s(349));g||Di&127||w1(l,r,a)}return a}function w1(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=Ke.updateQueue,r===null?(r=Hc(),Ke.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function _1(t,r,a,l){r.value=a,r.getSnapshot=l,k1(r)&&S1(t)}function x1(t,r,a){return a(function(){k1(r)&&S1(t)})}function k1(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!cr(t,a)}catch{return!0}}function S1(t){var r=no(t,2);r!==null&&Yn(r,t,2)}function sp(t){var r=$n();if(typeof t=="function"){var a=t;if(t=a(),ho){Ge(!0);try{a()}finally{Ge(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oi,lastRenderedState:t},r}function C1(t,r,a,l){return t.baseState=a,ap(t,Rt,typeof l=="function"?l:Oi)}function IT(t,r,a,l,h){if(Kc(t))throw Error(s(485));if(t=r.action,t!==null){var g={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){g.listeners.push(S)}};se.T===null?g.isTransition=!1:a(!0),l(g),a=r.pending,a===null?(g.next=r.pending=g,E1(r,g)):(g.next=a.next,r.pending=a.next=g)}}function E1(t,r){var a=r.action,l=r.payload,h=t.state;if(r.isTransition){var g=se.T,S={};se.T=S;try{var D=a(h,l),H=se.S;H!==null&&H(S,D),T1(t,r,D)}catch(ne){lp(t,r,ne)}finally{g!==null&&S.types!==null&&(g.types=S.types),se.T=g}}else try{g=a(h,l),T1(t,r,g)}catch(ne){lp(t,r,ne)}}function T1(t,r,a){typeof a=="object"&&a&&typeof a.then=="function"?a.then(function(l){R1(t,r,l)},function(l){return lp(t,r,l)}):R1(t,r,a)}function R1(t,r,a){r.status="fulfilled",r.value=a,D1(r),t.state=a,r=t.pending,r!==null&&(a=r.next,a===r?t.pending=null:(a=a.next,r.next=a,E1(t,a)))}function lp(t,r,a){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=a,D1(r),r=r.next;while(r!==l)}t.action=null}function D1(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function O1(t,r){return r}function P1(t,r){if(st){var a=It.formState;if(a!==null){e:{var l=Ke;if(st){if(Bt){t:{for(var h=Bt,g=Tr;h.nodeType!==8;){if(!g){h=null;break t}if(h=Dr(h.nextSibling),h===null){h=null;break t}}g=h.data,h=g==="F!"||g==="F"?h:null}if(h){Bt=Dr(h.nextSibling),l=h.data==="F!";break e}}ua(l)}l=!1}l&&(r=a[0])}}return a=$n(),a.memoizedState=a.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:O1,lastRenderedState:r},a.queue=l,a=J1.bind(null,Ke,l),l.dispatch=a,l=sp(!1),g=hp.bind(null,Ke,!1,l.queue),l=$n(),h={state:r,dispatch:null,action:t,pending:null},l.queue=h,a=IT.bind(null,Ke,h,g,a),h.dispatch=a,l.memoizedState=t,[r,a,!1]}function M1(t){return L1(Zt(),Rt,t)}function L1(t,r,a){if(r=ap(t,r,O1)[0],t=$c(Oi)[0],typeof r=="object"&&r&&typeof r.then=="function")try{var l=sl(r)}catch(S){throw S===rs?Nc:S}else l=r;r=Zt();var h=r.queue,g=h.dispatch;return a!==r.memoizedState&&(Ke.flags|=2048,ls(9,{destroy:void 0},AT.bind(null,h,a),null)),[l,g,t]}function AT(t,r){t.action=r}function N1(t){var r=Zt(),a=Rt;if(a!==null)return L1(r,a,t);Zt(),r=r.memoizedState,a=Zt();var l=a.queue.dispatch;return a.memoizedState=t,[r,l,!1]}function ls(t,r,a,l){return t={tag:t,create:a,deps:l,inst:r,next:null},r=Ke.updateQueue,r===null&&(r=Hc(),Ke.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=t.next=t:(l=a.next,a.next=t,t.next=l,r.lastEffect=t),t}function I1(){return Zt().memoizedState}function Wc(t,r,a,l){var h=$n();Ke.flags|=t,h.memoizedState=ls(1|r,{destroy:void 0},a,l===void 0?null:l)}function Uc(t,r,a,l){var h=Zt();l=l===void 0?null:l;var g=h.memoizedState.inst;Rt!==null&&l!==null&&Zf(l,Rt.memoizedState.deps)?h.memoizedState=ls(r,g,a,l):(Ke.flags|=t,h.memoizedState=ls(1|r,g,a,l))}function A1(t,r){Wc(8390656,8,t,r)}function cp(t,r){Uc(2048,8,t,r)}function qT(t){Ke.flags|=4;var r=Ke.updateQueue;if(r===null)r=Hc(),Ke.updateQueue=r,r.events=[t];else{var a=r.events;a===null?r.events=[t]:a.push(t)}}function q1(t){var r=Zt().memoizedState;return qT({ref:r,nextImpl:t}),function(){if(yt&2)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function j1(t,r){return Uc(4,2,t,r)}function z1(t,r){return Uc(4,4,t,r)}function F1(t,r){if(typeof r=="function"){t=t();var a=r(t);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function B1(t,r,a){a=a==null?null:a.concat([t]),Uc(4,4,F1.bind(null,r,t),a)}function up(){}function H1(t,r){var a=Zt();r=r===void 0?null:r;var l=a.memoizedState;return r!==null&&Zf(r,l[1])?l[0]:(a.memoizedState=[t,r],t)}function V1(t,r){var a=Zt();r=r===void 0?null:r;var l=a.memoizedState;if(r!==null&&Zf(r,l[1]))return l[0];if(l=t(),ho){Ge(!0);try{t()}finally{Ge(!1)}}return a.memoizedState=[l,r],l}function dp(t,r,a){return a===void 0||Di&1073741824&&!(it&261930)?t.memoizedState=r:(t.memoizedState=a,t=Bb(),Ke.lanes|=t,ya|=t,a)}function $1(t,r,a,l){return cr(a,r)?a:as.current===null?!(Di&42)||Di&1073741824&&!(it&261930)?(sn=!0,t.memoizedState=a):(t=Bb(),Ke.lanes|=t,ya|=t,r):(t=dp(t,a,l),cr(t,r)||(sn=!0),t)}function W1(t,r,a,l,h){var g=Q.p;Q.p=g!==0&&8>g?g:8;var S=se.T,D={};se.T=D,hp(t,!1,r,a);try{var H=h(),ne=se.S;ne!==null&&ne(D,H),typeof H=="object"&&H&&typeof H.then=="function"?ll(t,r,MT(H,l),Rr(t)):ll(t,r,l,Rr(t))}catch(he){ll(t,r,{then:function(){},status:"rejected",reason:he},Rr())}finally{Q.p=g,S!==null&&D.types!==null&&(S.types=D.types),se.T=S}}function jT(){}function fp(t,r,a,l){if(t.tag!==5)throw Error(s(476));var h=U1(t).queue;W1(t,h,r,Le,a===null?jT:function(){return K1(t),a(l)})}function U1(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Le,baseState:Le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oi,lastRenderedState:Le},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oi,lastRenderedState:a},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function K1(t){var r=U1(t);r.next===null&&(r=t.alternate.memoizedState),ll(t,r.next.queue,{},Rr())}function pp(){return Cn(Cl)}function Q1(){return Zt().memoizedState}function G1(){return Zt().memoizedState}function zT(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var a=Rr();t=fo(a);var l=po(r,t,a);l!==null&&(Yn(l,r,a),rl(l,r,a)),r={cache:Hf()},t.payload=r;return}r=r.return}}function FT(t,r,a){var l=Rr();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Kc(t)?X1(r,a):(a=Pf(t,r,a,l),a!==null&&(Yn(a,t,l),Y1(a,r,l)))}function J1(t,r,a){ll(t,r,a,Rr())}function ll(t,r,a,l){var h={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Kc(t))X1(r,h);else{var g=t.alternate;if(t.lanes===0&&(g===null||g.lanes===0)&&(g=r.lastRenderedReducer,g!==null))try{var S=r.lastRenderedState,D=g(S,a);if(h.hasEagerState=!0,h.eagerState=D,cr(D,S))return Tc(t,r,h,0),It===null&&Ec(),!1}catch{}if(a=Pf(t,r,h,l),a!==null)return Yn(a,t,l),Y1(a,r,l),!0}return!1}function hp(t,r,a,l){if(l={lane:2,revertLane:Up(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Kc(t)){if(r)throw Error(s(479))}else r=Pf(t,a,l,2),r!==null&&Yn(r,t,2)}function Kc(t){var r=t.alternate;return t===Ke||r!==null&&r===Ke}function X1(t,r){os=Fc=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function Y1(t,r,a){if(a&4194048){var l=r.lanes;l&=t.pendingLanes,a|=l,r.lanes=a,or(t,a)}}var cl={readContext:Cn,use:Vc,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useLayoutEffect:Qt,useInsertionEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useSyncExternalStore:Qt,useId:Qt,useHostTransitionStatus:Qt,useFormState:Qt,useActionState:Qt,useOptimistic:Qt,useMemoCache:Qt,useCacheRefresh:Qt};cl.useEffectEvent=Qt;var Z1={readContext:Cn,use:Vc,useCallback:function(t,r){return $n().memoizedState=[t,r===void 0?null:r],t},useContext:Cn,useEffect:A1,useImperativeHandle:function(t,r,a){a=a==null?null:a.concat([t]),Wc(4194308,4,F1.bind(null,r,t),a)},useLayoutEffect:function(t,r){return Wc(4194308,4,t,r)},useInsertionEffect:function(t,r){Wc(4,2,t,r)},useMemo:function(t,r){var a=$n();r=r===void 0?null:r;var l=t();if(ho){Ge(!0);try{t()}finally{Ge(!1)}}return a.memoizedState=[l,r],l},useReducer:function(t,r,a){var l=$n();if(a!==void 0){var h=a(r);if(ho){Ge(!0);try{a(r)}finally{Ge(!1)}}}else h=r;return l.memoizedState=l.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},l.queue=t,t=t.dispatch=FT.bind(null,Ke,t),[l.memoizedState,t]},useRef:function(t){var r=$n();return t={current:t},r.memoizedState=t},useState:function(t){t=sp(t);var r=t.queue,a=J1.bind(null,Ke,r);return r.dispatch=a,[t.memoizedState,a]},useDebugValue:up,useDeferredValue:function(t,r){return dp($n(),t,r)},useTransition:function(){var t=sp(!1);return t=W1.bind(null,Ke,t.queue,!0,!1),$n().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,a){var l=Ke,h=$n();if(st){if(a===void 0)throw Error(s(407));a=a()}else{if(a=r(),It===null)throw Error(s(349));it&127||w1(l,r,a)}h.memoizedState=a;var g={value:a,getSnapshot:r};return h.queue=g,A1(x1.bind(null,l,g,t),[t]),l.flags|=2048,ls(9,{destroy:void 0},_1.bind(null,l,g,a,r),null),a},useId:function(){var t=$n(),r=It.identifierPrefix;if(st){var a=li,l=si;a=(l&~(1<<32-gt(l)-1)).toString(32)+a,r="_"+r+"R_"+a,a=Bc++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=LT++,r="_"+r+"r_"+a.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:pp,useFormState:P1,useActionState:P1,useOptimistic:function(t){var r=$n();r.memoizedState=r.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=hp.bind(null,Ke,!0,a),a.dispatch=r,[t,r]},useMemoCache:ip,useCacheRefresh:function(){return $n().memoizedState=zT.bind(null,Ke)},useEffectEvent:function(t){var r=$n(),a={impl:t};return r.memoizedState=a,function(){if(yt&2)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},mp={readContext:Cn,use:Vc,useCallback:H1,useContext:Cn,useEffect:cp,useImperativeHandle:B1,useInsertionEffect:j1,useLayoutEffect:z1,useMemo:V1,useReducer:$c,useRef:I1,useState:function(){return $c(Oi)},useDebugValue:up,useDeferredValue:function(t,r){return $1(Zt(),Rt.memoizedState,t,r)},useTransition:function(){var t=$c(Oi)[0],r=Zt().memoizedState;return[typeof t=="boolean"?t:sl(t),r]},useSyncExternalStore:b1,useId:Q1,useHostTransitionStatus:pp,useFormState:M1,useActionState:M1,useOptimistic:function(t,r){return C1(Zt(),Rt,t,r)},useMemoCache:ip,useCacheRefresh:G1};mp.useEffectEvent=q1;var eb={readContext:Cn,use:Vc,useCallback:H1,useContext:Cn,useEffect:cp,useImperativeHandle:B1,useInsertionEffect:j1,useLayoutEffect:z1,useMemo:V1,useReducer:op,useRef:I1,useState:function(){return op(Oi)},useDebugValue:up,useDeferredValue:function(t,r){var a=Zt();return Rt===null?dp(a,t,r):$1(a,Rt.memoizedState,t,r)},useTransition:function(){var t=op(Oi)[0],r=Zt().memoizedState;return[typeof t=="boolean"?t:sl(t),r]},useSyncExternalStore:b1,useId:Q1,useHostTransitionStatus:pp,useFormState:N1,useActionState:N1,useOptimistic:function(t,r){var a=Zt();return Rt===null?(a.baseState=t,[t,a.queue.dispatch]):C1(a,Rt,t,r)},useMemoCache:ip,useCacheRefresh:G1};eb.useEffectEvent=q1;function gp(t,r,a,l){r=t.memoizedState,a=a(l,r),a=a==null?r:C({},r,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var yp={enqueueSetState:function(t,r,a){t=t._reactInternals;var l=Rr(),h=fo(l);h.payload=r,a!=null&&(h.callback=a),r=po(t,h,l),r!==null&&(Yn(r,t,l),rl(r,t,l))},enqueueReplaceState:function(t,r,a){t=t._reactInternals;var l=Rr(),h=fo(l);h.tag=1,h.payload=r,a!=null&&(h.callback=a),r=po(t,h,l),r!==null&&(Yn(r,t,l),rl(r,t,l))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var a=Rr(),l=fo(a);l.tag=2,r!=null&&(l.callback=r),r=po(t,l,a),r!==null&&(Yn(r,t,a),rl(r,t,a))}};function tb(t,r,a,l,h,g,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,g,S):r.prototype&&r.prototype.isPureReactComponent?!Gs(a,l)||!Gs(h,g):!0}function nb(t,r,a,l){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,l),r.state!==t&&yp.enqueueReplaceState(r,r.state,null)}function mo(t,r){var a=r;if("ref"in r)for(var l in a={},r)l!=="ref"&&(a[l]=r[l]);if(t=t.defaultProps)for(var h in a===r&&(a=C({},a)),t)a[h]===void 0&&(a[h]=t[h]);return a}function BT(t){Cc(t)}function HT(t){console.error(t)}function VT(t){Cc(t)}function Qc(t,r){try{var a=t.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function rb(t,r,a){try{var l=t.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function vp(t,r,a){return a=fo(a),a.tag=3,a.payload={element:null},a.callback=function(){Qc(t,r)},a}function ib(t){return t=fo(t),t.tag=3,t}function ab(t,r,a,l){var h=a.type.getDerivedStateFromError;if(typeof h=="function"){var g=l.value;t.payload=function(){return h(g)},t.callback=function(){rb(r,a,l)}}var S=a.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){rb(r,a,l),typeof h!="function"&&(va===null?va=new Set([this]):va.add(this));var D=l.stack;this.componentDidCatch(l.value,{componentStack:D===null?"":D})})}function $T(t,r,a,l,h){if(a.flags|=32768,typeof l=="object"&&l&&typeof l.then=="function"){if(r=a.alternate,r!==null&&es(r,a,h,!0),a=dr.current,a!==null){switch(a.tag){case 31:case 13:return Kr===null?ou():a.alternate===null&&Gt===0&&(Gt=3),a.flags&=-257,a.flags|=65536,a.lanes=h,l===Ic?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([l]):r.add(l),Vp(t,l,h)),!1;case 22:return a.flags|=65536,l===Ic?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([l]):a.add(l)),Vp(t,l,h)),!1}throw Error(s(435,a.tag))}return Vp(t,l,h),ou(),!1}if(st)return r=dr.current,r===null?(l!==qf&&(r=Error(s(423),{cause:l}),Ys(Sr(r,a))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,l=Sr(l,a),h=vp(t.stateNode,l,h),Qf(t,h),Gt!==4&&(Gt=2)):(!(r.flags&65536)&&(r.flags|=256),r.flags|=65536,r.lanes=h,l!==qf&&(t=Error(s(422),{cause:l}),Ys(Sr(t,a)))),!1;var g=Error(s(520),{cause:l});if(g=Sr(g,a),yl===null?yl=[g]:yl.push(g),Gt!==4&&(Gt=2),r===null)return!0;l=Sr(l,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,t=h&-h,a.lanes|=t,t=vp(a.stateNode,l,t),Qf(a,t),!1;case 1:if(r=a.type,g=a.stateNode,!(a.flags&128)&&(typeof r.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(va===null||!va.has(g))))return a.flags|=65536,h&=-h,a.lanes|=h,h=ib(h),ab(h,t,a,l),Qf(a,h),!1}a=a.return}while(a!==null);return!1}var bp=Error(s(461)),sn=!1;function En(t,r,a,l){r.child=t===null?f1(r,null,a,l):uo(r,t.child,a,l)}function ob(t,r,a,l,h){a=a.render;var g=r.ref;if("ref"in l){var S={};for(var D in l)D!=="ref"&&(S[D]=l[D])}else S=l;return oo(r),l=ep(t,r,a,S,g,h),D=tp(),t!==null&&!sn?(np(t,r,h),Pi(t,r,h)):(st&&D&&If(r),r.flags|=1,En(t,r,l,h),r.child)}function sb(t,r,a,l,h){if(t===null){var g=a.type;return typeof g=="function"&&!Mf(g)&&g.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=g,lb(t,r,g,l,h)):(t=Dc(a.type,null,l,r,r.mode,h),t.ref=r.ref,t.return=r,r.child=t)}if(g=t.child,!Tp(t,h)){var S=g.memoizedProps;if(a=a.compare,a=a===null?Gs:a,a(S,l)&&t.ref===r.ref)return Pi(t,r,h)}return r.flags|=1,t=Ci(g,l),t.ref=r.ref,t.return=r,r.child=t}function lb(t,r,a,l,h){if(t!==null){var g=t.memoizedProps;if(Gs(g,l)&&t.ref===r.ref)if(sn=!1,r.pendingProps=l=g,Tp(t,h))t.flags&131072&&(sn=!0);else return r.lanes=t.lanes,Pi(t,r,h)}return wp(t,r,a,l,h)}function cb(t,r,a,l){var h=l.children,g=t===null?null:t.memoizedState;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if(r.flags&128){if(g=g===null?a:g.baseLanes|a,t!==null){for(l=r.child=t.child,h=0;l!==null;)h=h|l.lanes|l.childLanes,l=l.sibling;l=h&~g}else l=0,r.child=null;return ub(t,r,g,a,l)}if(a&536870912)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Lc(r,g===null?null:g.cachePool),g===null?Jf():m1(r,g),g1(r);else return l=r.lanes=536870912,ub(t,r,g===null?a:g.baseLanes|a,a,l)}else g===null?(t!==null&&Lc(r,null),Jf(),ha(r)):(Lc(r,g.cachePool),m1(r,g),ha(r),r.memoizedState=null);return En(t,r,h,a),r.child}function ul(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function ub(t,r,a,l,h){var g=$f();return g=g===null?null:{parent:an._currentValue,pool:g},r.memoizedState={baseLanes:a,cachePool:g},t!==null&&Lc(r,null),Jf(),g1(r),t!==null&&es(t,r,l,!0),r.childLanes=h,null}function Gc(t,r){return r=Xc({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function db(t,r,a){return uo(r,t.child,null,a),t=Gc(r,r.pendingProps),t.flags|=2,fr(r),r.memoizedState=null,t}function WT(t,r,a){var l=r.pendingProps,h=(r.flags&128)!=0;if(r.flags&=-129,t===null){if(st){if(l.mode==="hidden")return t=Gc(r,l),r.lanes=536870912,ul(null,t);if(Yf(r),(t=Bt)?(t=S2(t,Tr),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:la===null?null:{id:si,overflow:li},retryLane:536870912,hydrationErrors:null},a=Xv(t),a.return=r,r.child=a,Sn=r,Bt=null)):t=null,t===null)throw ua(r);return r.lanes=536870912,null}return Gc(r,l)}var g=t.memoizedState;if(g!==null){var S=g.dehydrated;if(Yf(r),h)if(r.flags&256)r.flags&=-257,r=db(t,r,a);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(s(558));else if(sn||es(t,r,a,!1),h=(a&t.childLanes)!==0,sn||h){if(l=It,l!==null&&(S=M(l,a),S!==0&&S!==g.retryLane))throw g.retryLane=S,no(t,S),Yn(l,t,S),bp;ou(),r=db(t,r,a)}else t=g.treeContext,Bt=Dr(S.nextSibling),Sn=r,st=!0,ca=null,Tr=!1,t!==null&&e1(r,t),r=Gc(r,l),r.flags|=4096;return r}return t=Ci(t.child,{mode:l.mode,children:l.children}),t.ref=r.ref,r.child=t,t.return=r,t}function Jc(t,r){var a=r.ref;if(a===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(t===null||t.ref!==a)&&(r.flags|=4194816)}}function wp(t,r,a,l,h){return oo(r),a=ep(t,r,a,l,void 0,h),l=tp(),t!==null&&!sn?(np(t,r,h),Pi(t,r,h)):(st&&l&&If(r),r.flags|=1,En(t,r,a,h),r.child)}function fb(t,r,a,l,h,g){return oo(r),r.updateQueue=null,a=v1(r,l,a,h),y1(t),l=tp(),t!==null&&!sn?(np(t,r,g),Pi(t,r,g)):(st&&l&&If(r),r.flags|=1,En(t,r,a,g),r.child)}function pb(t,r,a,l,h){if(oo(r),r.stateNode===null){var g=Jo,S=a.contextType;typeof S=="object"&&S&&(g=Cn(S)),g=new a(l,g),r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=yp,r.stateNode=g,g._reactInternals=r,g=r.stateNode,g.props=l,g.state=r.memoizedState,g.refs={},Uf(r),S=a.contextType,g.context=typeof S=="object"&&S?Cn(S):Jo,g.state=r.memoizedState,S=a.getDerivedStateFromProps,typeof S=="function"&&(gp(r,a,S,l),g.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(S=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),S!==g.state&&yp.enqueueReplaceState(g,g.state,null),al(r,l,g,h),il(),g.state=r.memoizedState),typeof g.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(t===null){g=r.stateNode;var D=r.memoizedProps,H=mo(a,D);g.props=H;var ne=g.context,he=a.contextType;S=Jo,typeof he=="object"&&he&&(S=Cn(he));var ge=a.getDerivedStateFromProps;he=typeof ge=="function"||typeof g.getSnapshotBeforeUpdate=="function",D=r.pendingProps!==D,he||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(D||ne!==S)&&nb(r,g,l,S),fa=!1;var ae=r.memoizedState;g.state=ae,al(r,l,g,h),il(),ne=r.memoizedState,D||ae!==ne||fa?(typeof ge=="function"&&(gp(r,a,ge,l),ne=r.memoizedState),(H=fa||tb(r,a,H,l,ae,ne,S))?(he||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(r.flags|=4194308)):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=ne),g.props=l,g.state=ne,g.context=S,l=H):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{g=r.stateNode,Kf(t,r),S=r.memoizedProps,he=mo(a,S),g.props=he,ge=r.pendingProps,ae=g.context,ne=a.contextType,H=Jo,typeof ne=="object"&&ne&&(H=Cn(ne)),D=a.getDerivedStateFromProps,(ne=typeof D=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(S!==ge||ae!==H)&&nb(r,g,l,H),fa=!1,ae=r.memoizedState,g.state=ae,al(r,l,g,h),il();var ue=r.memoizedState;S!==ge||ae!==ue||fa||t!==null&&t.dependencies!==null&&Pc(t.dependencies)?(typeof D=="function"&&(gp(r,a,D,l),ue=r.memoizedState),(he=fa||tb(r,a,he,l,ae,ue,H)||t!==null&&t.dependencies!==null&&Pc(t.dependencies))?(ne||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(l,ue,H),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(l,ue,H)),typeof g.componentDidUpdate=="function"&&(r.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof g.componentDidUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=ue),g.props=l,g.state=ue,g.context=H,l=he):(typeof g.componentDidUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=1024),l=!1)}return g=l,Jc(t,r),l=(r.flags&128)!=0,g||l?(g=r.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:g.render(),r.flags|=1,t!==null&&l?(r.child=uo(r,t.child,null,h),r.child=uo(r,null,a,h)):En(t,r,a,h),r.memoizedState=g.state,t=r.child):t=Pi(t,r,h),t}function hb(t,r,a,l){return io(),r.flags|=256,En(t,r,a,l),r.child}var _p={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xp(t){return{baseLanes:t,cachePool:o1()}}function kp(t,r,a){return t=t===null?0:t.childLanes&~a,r&&(t|=hr),t}function mb(t,r,a){var l=r.pendingProps,h=!1,g=(r.flags&128)!=0,S;if((S=g)||(S=t!==null&&t.memoizedState===null?!1:(Yt.current&2)!=0),S&&(h=!0,r.flags&=-129),S=(r.flags&32)!=0,r.flags&=-33,t===null){if(st){if(h?pa(r):ha(r),(t=Bt)?(t=S2(t,Tr),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:la===null?null:{id:si,overflow:li},retryLane:536870912,hydrationErrors:null},a=Xv(t),a.return=r,r.child=a,Sn=r,Bt=null)):t=null,t===null)throw ua(r);return ih(t)?r.lanes=32:r.lanes=536870912,null}var D=l.children;return l=l.fallback,h?(ha(r),h=r.mode,D=Xc({mode:"hidden",children:D},h),l=ro(l,h,a,null),D.return=r,l.return=r,D.sibling=l,r.child=D,l=r.child,l.memoizedState=xp(a),l.childLanes=kp(t,S,a),r.memoizedState=_p,ul(null,l)):(pa(r),Sp(r,D))}var H=t.memoizedState;if(H!==null&&(D=H.dehydrated,D!==null)){if(g)r.flags&256?(pa(r),r.flags&=-257,r=Cp(t,r,a)):r.memoizedState===null?(ha(r),D=l.fallback,h=r.mode,l=Xc({mode:"visible",children:l.children},h),D=ro(D,h,a,null),D.flags|=2,l.return=r,D.return=r,l.sibling=D,r.child=l,uo(r,t.child,null,a),l=r.child,l.memoizedState=xp(a),l.childLanes=kp(t,S,a),r.memoizedState=_p,r=ul(null,l)):(ha(r),r.child=t.child,r.flags|=128,r=null);else if(pa(r),ih(D)){if(S=D.nextSibling&&D.nextSibling.dataset,S)var ne=S.dgst;S=ne,l=Error(s(419)),l.stack="",l.digest=S,Ys({value:l,source:null,stack:null}),r=Cp(t,r,a)}else if(sn||es(t,r,a,!1),S=(a&t.childLanes)!==0,sn||S){if(S=It,S!==null&&(l=M(S,a),l!==0&&l!==H.retryLane))throw H.retryLane=l,no(t,l),Yn(S,t,l),bp;rh(D)||ou(),r=Cp(t,r,a)}else rh(D)?(r.flags|=192,r.child=t.child,r=null):(t=H.treeContext,Bt=Dr(D.nextSibling),Sn=r,st=!0,ca=null,Tr=!1,t!==null&&e1(r,t),r=Sp(r,l.children),r.flags|=4096);return r}return h?(ha(r),D=l.fallback,h=r.mode,H=t.child,ne=H.sibling,l=Ci(H,{mode:"hidden",children:l.children}),l.subtreeFlags=H.subtreeFlags&65011712,ne===null?(D=ro(D,h,a,null),D.flags|=2):D=Ci(ne,D),D.return=r,l.return=r,l.sibling=D,r.child=l,ul(null,l),l=r.child,D=t.child.memoizedState,D===null?D=xp(a):(h=D.cachePool,h===null?h=o1():(H=an._currentValue,h=h.parent===H?h:{parent:H,pool:H}),D={baseLanes:D.baseLanes|a,cachePool:h}),l.memoizedState=D,l.childLanes=kp(t,S,a),r.memoizedState=_p,ul(t.child,l)):(pa(r),a=t.child,t=a.sibling,a=Ci(a,{mode:"visible",children:l.children}),a.return=r,a.sibling=null,t!==null&&(S=r.deletions,S===null?(r.deletions=[t],r.flags|=16):S.push(t)),r.child=a,r.memoizedState=null,a)}function Sp(t,r){return r=Xc({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function Xc(t,r){return t=ur(22,t,null,r),t.lanes=0,t}function Cp(t,r,a){return uo(r,t.child,null,a),t=Sp(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function gb(t,r,a){t.lanes|=r;var l=t.alternate;l!==null&&(l.lanes|=r),Ff(t.return,r,a)}function Ep(t,r,a,l,h,g){var S=t.memoizedState;S===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:h,treeForkCount:g}:(S.isBackwards=r,S.rendering=null,S.renderingStartTime=0,S.last=l,S.tail=a,S.tailMode=h,S.treeForkCount=g)}function yb(t,r,a){var l=r.pendingProps,h=l.revealOrder,g=l.tail;l=l.children;var S=Yt.current,D=(S&2)!=0;if(D?(S=S&1|2,r.flags|=128):S&=1,Pe(Yt,S),En(t,r,l,a),l=st?Xs:0,!D&&t!==null&&t.flags&128)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&gb(t,a,r);else if(t.tag===19)gb(t,a,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(h){case"forwards":for(a=r.child,h=null;a!==null;)t=a.alternate,t!==null&&zc(t)===null&&(h=a),a=a.sibling;a=h,a===null?(h=r.child,r.child=null):(h=a.sibling,a.sibling=null),Ep(r,!1,h,a,g,l);break;case"backwards":case"unstable_legacy-backwards":for(a=null,h=r.child,r.child=null;h!==null;){if(t=h.alternate,t!==null&&zc(t)===null){r.child=h;break}t=h.sibling,h.sibling=a,a=h,h=t}Ep(r,!0,a,null,g,l);break;case"together":Ep(r,!1,null,null,void 0,l);break;default:r.memoizedState=null}return r.child}function Pi(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),ya|=r.lanes,(a&r.childLanes)===0)if(t!==null){if(es(t,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(s(153));if(r.child!==null){for(t=r.child,a=Ci(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=Ci(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function Tp(t,r){return(t.lanes&r)===0?(t=t.dependencies,!!(t!==null&&Pc(t))):!0}function UT(t,r,a){switch(r.tag){case 3:un(r,r.stateNode.containerInfo),da(r,an,t.memoizedState.cache),io();break;case 27:case 5:tn(r);break;case 4:un(r,r.stateNode.containerInfo);break;case 10:da(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Yf(r),null;break;case 13:var l=r.memoizedState;if(l!==null)return l.dehydrated===null?(a&r.child.childLanes)===0?(pa(r),t=Pi(t,r,a),t===null?null:t.sibling):mb(t,r,a):(pa(r),r.flags|=128,null);pa(r);break;case 19:var h=(t.flags&128)!=0;if(l=(a&r.childLanes)!==0,l||(l=(es(t,r,a,!1),(a&r.childLanes)!==0)),h){if(l)return yb(t,r,a);r.flags|=128}if(h=r.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),Pe(Yt,Yt.current),l)break;return null;case 22:return r.lanes=0,cb(t,r,a,r.pendingProps);case 24:da(r,an,t.memoizedState.cache)}return Pi(t,r,a)}function vb(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps)sn=!0;else{if(!Tp(t,a)&&!(r.flags&128))return sn=!1,UT(t,r,a);sn=!!(t.flags&131072)}else sn=!1,st&&r.flags&1048576&&Zv(r,Xs,r.index);switch(r.lanes=0,r.tag){case 16:e:{var l=r.pendingProps;if(t=lo(r.elementType),r.type=t,typeof t=="function")Mf(t)?(l=mo(t,l),r.tag=1,r=pb(null,r,t,l,a)):(r.tag=0,r=wp(null,r,t,l,a));else{if(t!=null){var h=t.$$typeof;if(h===pe){r.tag=11,r=ob(null,r,t,l,a);break e}else if(h===W){r.tag=14,r=sb(null,r,t,l,a);break e}}throw r=Z(t)||t,Error(s(306,r,""))}}return r;case 0:return wp(t,r,r.type,r.pendingProps,a);case 1:return l=r.type,h=mo(l,r.pendingProps),pb(t,r,l,h,a);case 3:e:{if(un(r,r.stateNode.containerInfo),t===null)throw Error(s(387));l=r.pendingProps;var g=r.memoizedState;h=g.element,Kf(t,r),al(r,l,null,a);var S=r.memoizedState;if(l=S.cache,da(r,an,l),l!==g.cache&&Bf(r,[an],a,!0),il(),l=S.element,g.isDehydrated)if(g={element:l,isDehydrated:!1,cache:S.cache},r.updateQueue.baseState=g,r.memoizedState=g,r.flags&256){r=hb(t,r,l,a);break e}else if(l!==h){h=Sr(Error(s(424)),r),Ys(h),r=hb(t,r,l,a);break e}else for((t=r.stateNode.containerInfo,t.nodeType)===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Bt=Dr(t.firstChild),Sn=r,st=!0,ca=null,Tr=!0,a=f1(r,null,l,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(io(),l===h){r=Pi(t,r,a);break e}En(t,r,l,a)}r=r.child}return r;case 26:return Jc(t,r),t===null?(a=O2(r.type,null,r.pendingProps,null))?r.memoizedState=a:st||(a=r.type,t=r.pendingProps,l=pu(mt.current).createElement(a),l[He]=r,l[Ve]=t,Tn(l,a,t),Xt(l),r.stateNode=l):r.memoizedState=O2(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return tn(r),t===null&&st&&(l=r.stateNode=T2(r.type,r.pendingProps,mt.current),Sn=r,Tr=!0,h=Bt,xa(r.type)?(ah=h,Bt=Dr(l.firstChild)):Bt=h),En(t,r,r.pendingProps.children,a),Jc(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&st&&((h=l=Bt)&&(l=wR(l,r.type,r.pendingProps,Tr),l===null?h=!1:(r.stateNode=l,Sn=r,Bt=Dr(l.firstChild),Tr=!1,h=!0)),h||ua(r)),tn(r),h=r.type,g=r.pendingProps,S=t===null?null:t.memoizedProps,l=g.children,eh(h,g)?l=null:S!==null&&eh(h,S)&&(r.flags|=32),r.memoizedState!==null&&(h=ep(t,r,NT,null,null,a),Cl._currentValue=h),Jc(t,r),En(t,r,l,a),r.child;case 6:return t===null&&st&&((t=a=Bt)&&(a=_R(a,r.pendingProps,Tr),a===null?t=!1:(r.stateNode=a,Sn=r,Bt=null,t=!0)),t||ua(r)),null;case 13:return mb(t,r,a);case 4:return un(r,r.stateNode.containerInfo),l=r.pendingProps,t===null?r.child=uo(r,null,l,a):En(t,r,l,a),r.child;case 11:return ob(t,r,r.type,r.pendingProps,a);case 7:return En(t,r,r.pendingProps,a),r.child;case 8:return En(t,r,r.pendingProps.children,a),r.child;case 12:return En(t,r,r.pendingProps.children,a),r.child;case 10:return l=r.pendingProps,da(r,r.type,l.value),En(t,r,l.children,a),r.child;case 9:return h=r.type._context,l=r.pendingProps.children,oo(r),h=Cn(h),l=l(h),r.flags|=1,En(t,r,l,a),r.child;case 14:return sb(t,r,r.type,r.pendingProps,a);case 15:return lb(t,r,r.type,r.pendingProps,a);case 19:return yb(t,r,a);case 31:return WT(t,r,a);case 22:return cb(t,r,a,r.pendingProps);case 24:return oo(r),l=Cn(an),t===null?(h=$f(),h===null&&(h=It,g=Hf(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=a),h=g),r.memoizedState={parent:l,cache:h},Uf(r),da(r,an,h)):((t.lanes&a)!==0&&(Kf(t,r),al(r,null,null,a),il()),h=t.memoizedState,g=r.memoizedState,h.parent===l?(l=g.cache,da(r,an,l),l!==h.cache&&Bf(r,[an],a,!0)):(h={parent:l,cache:l},r.memoizedState=h,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=h),da(r,an,l))),En(t,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Mi(t){t.flags|=4}function Rp(t,r,a,l,h){if((r=(t.mode&32)!=0)&&(r=!1),r){if(t.flags|=16777216,(h&335544128)===h)if(t.stateNode.complete)t.flags|=8192;else if(Wb())t.flags|=8192;else throw co=Ic,Wf}else t.flags&=-16777217}function bb(t,r){if(r.type!=="stylesheet"||r.state.loading&4)t.flags&=-16777217;else if(t.flags|=16777216,!I2(r))if(Wb())t.flags|=8192;else throw co=Ic,Wf}function Yc(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag===22?536870912:bi(),t.lanes|=r,fs|=r)}function dl(t,r){if(!st)switch(t.tailMode){case"hidden":r=t.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function Ht(t){var r=t.alternate!==null&&t.alternate.child===t.child,a=0,l=0;if(r)for(var h=t.child;h!==null;)a|=h.lanes|h.childLanes,l|=h.subtreeFlags&65011712,l|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)a|=h.lanes|h.childLanes,l|=h.subtreeFlags,l|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=l,t.childLanes=a,r}function KT(t,r,a){var l=r.pendingProps;switch(Af(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ht(r),null;case 1:return Ht(r),null;case 3:return a=r.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),Ri(an),We(),a.pendingContext&&(a.pendingContext=(a.context=a.pendingContext,null)),(t===null||t.child===null)&&(Zo(r)?Mi(r):t===null||t.memoizedState.isDehydrated&&!(r.flags&256)||(r.flags|=1024,jf())),Ht(r),null;case 26:var h=r.type,g=r.memoizedState;return t===null?(Mi(r),g===null?(Ht(r),Rp(r,h,null,l,a)):(Ht(r),bb(r,g))):g?g===t.memoizedState?(Ht(r),r.flags&=-16777217):(Mi(r),Ht(r),bb(r,g)):(t=t.memoizedProps,t!==l&&Mi(r),Ht(r),Rp(r,h,t,l,a)),null;case 27:if(wt(r),a=mt.current,h=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Mi(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Ht(r),null}t=Ae.current,Zo(r)?t1(r,t):(t=T2(h,l,a),r.stateNode=t,Mi(r))}return Ht(r),null;case 5:if(wt(r),h=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Mi(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Ht(r),null}if(g=Ae.current,Zo(r))t1(r,g);else{var S=pu(mt.current);switch(g){case 1:g=S.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:g=S.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":g=S.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":g=S.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":g=S.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof l.is=="string"?S.createElement("select",{is:l.is}):S.createElement("select"),l.multiple?g.multiple=!0:l.size&&(g.size=l.size);break;default:g=typeof l.is=="string"?S.createElement(h,{is:l.is}):S.createElement(h)}}g[He]=r,g[Ve]=l;e:for(S=r.child;S!==null;){if(S.tag===5||S.tag===6)g.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===r)break e;for(;S.sibling===null;){if(S.return===null||S.return===r)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}r.stateNode=g;e:switch(Tn(g,h,l),h){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Mi(r)}}return Ht(r),Rp(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,a),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==l&&Mi(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(t=mt.current,Zo(r)){if(t=r.stateNode,a=r.memoizedProps,l=null,h=Sn,h!==null)switch(h.tag){case 27:case 5:l=h.memoizedProps}t[He]=r,t=!!(t.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||g2(t.nodeValue,a)),t||ua(r,!0)}else t=pu(t).createTextNode(l),t[He]=r,r.stateNode=t}return Ht(r),null;case 31:if(a=r.memoizedState,t===null||t.memoizedState!==null){if(l=Zo(r),a!==null){if(t===null){if(!l)throw Error(s(318));if(t=r.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(557));t[He]=r}else io(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;Ht(r),t=!1}else a=jf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return r.flags&256?(fr(r),r):(fr(r),null);if(r.flags&128)throw Error(s(558))}return Ht(r),null;case 13:if(l=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=Zo(r),l!==null&&l.dehydrated!==null){if(t===null){if(!h)throw Error(s(318));if(h=r.memoizedState,h=h===null?null:h.dehydrated,!h)throw Error(s(317));h[He]=r}else io(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;Ht(r),h=!1}else h=jf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return r.flags&256?(fr(r),r):(fr(r),null)}return fr(r),r.flags&128?(r.lanes=a,r):(a=l!==null,t=t!==null&&t.memoizedState!==null,a&&(l=r.child,h=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(h=l.alternate.memoizedState.cachePool.pool),g=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==h&&(l.flags|=2048)),a!==t&&a&&(r.child.flags|=8192),Yc(r,r.updateQueue),Ht(r),null);case 4:return We(),t===null&&f2(r.stateNode.containerInfo),Ht(r),null;case 10:return Ri(r.type),Ht(r),null;case 19:if(je(Yt),l=r.memoizedState,l===null)return Ht(r),null;if(h=(r.flags&128)!=0,g=l.rendering,g===null)if(h)dl(l,!1);else{if(Gt!==0||t!==null&&t.flags&128)for(t=r.child;t!==null;){if(g=zc(t),g!==null){for(r.flags|=128,dl(l,!1),t=g.updateQueue,r.updateQueue=t,Yc(r,t),r.subtreeFlags=0,t=a,a=r.child;a!==null;)Jv(a,t),a=a.sibling;return Pe(Yt,Yt.current&1|2),st&&Ei(r,l.treeForkCount),r.child}t=t.sibling}l.tail!==null&&Ut()>ru&&(r.flags|=128,h=!0,dl(l,!1),r.lanes=4194304)}else{if(!h)if(t=zc(g),t!==null){if(r.flags|=128,h=!0,t=t.updateQueue,r.updateQueue=t,Yc(r,t),dl(l,!0),l.tail===null&&l.tailMode==="hidden"&&!g.alternate&&!st)return Ht(r),null}else 2*Ut()-l.renderingStartTime>ru&&a!==536870912&&(r.flags|=128,h=!0,dl(l,!1),r.lanes=4194304);l.isBackwards?(g.sibling=r.child,r.child=g):(t=l.last,t===null?r.child=g:t.sibling=g,l.last=g)}return l.tail===null?(Ht(r),null):(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Ut(),t.sibling=null,a=Yt.current,Pe(Yt,h?a&1|2:a&1),st&&Ei(r,l.treeForkCount),t);case 22:case 23:return fr(r),Xf(),l=r.memoizedState!==null,t===null?l&&(r.flags|=8192):t.memoizedState!==null!==l&&(r.flags|=8192),l?a&536870912&&!(r.flags&128)&&(Ht(r),r.subtreeFlags&6&&(r.flags|=8192)):Ht(r),a=r.updateQueue,a!==null&&Yc(r,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==a&&(r.flags|=2048),t!==null&&je(so),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),Ri(an),Ht(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function QT(t,r){switch(Af(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Ri(an),We(),t=r.flags,t&65536&&!(t&128)?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return wt(r),null;case 31:if(r.memoizedState!==null){if(fr(r),r.alternate===null)throw Error(s(340));io()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(fr(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(s(340));io()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return je(Yt),null;case 4:return We(),null;case 10:return Ri(r.type),null;case 22:case 23:return fr(r),Xf(),t!==null&&je(so),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return Ri(an),null;case 25:return null;default:return null}}function wb(t,r){switch(Af(r),r.tag){case 3:Ri(an),We();break;case 26:case 27:case 5:wt(r);break;case 4:We();break;case 31:r.memoizedState!==null&&fr(r);break;case 13:fr(r);break;case 19:je(Yt);break;case 10:Ri(r.type);break;case 22:case 23:fr(r),Xf(),t!==null&&je(so);break;case 24:Ri(an)}}function fl(t,r){try{var a=r.updateQueue,l=a===null?null:a.lastEffect;if(l!==null){var h=l.next;a=h;do{if((a.tag&t)===t){l=void 0;var g=a.create,S=a.inst;l=g(),S.destroy=l}a=a.next}while(a!==h)}}catch(D){Et(r,r.return,D)}}function ma(t,r,a){try{var l=r.updateQueue,h=l===null?null:l.lastEffect;if(h!==null){var g=h.next;l=g;do{if((l.tag&t)===t){var S=l.inst,D=S.destroy;if(D!==void 0){S.destroy=void 0,h=r;var H=a,ne=D;try{ne()}catch(he){Et(h,H,he)}}}l=l.next}while(l!==g)}}catch(he){Et(r,r.return,he)}}function _b(t){var r=t.updateQueue;if(r!==null){var a=t.stateNode;try{h1(r,a)}catch(l){Et(t,t.return,l)}}}function xb(t,r,a){a.props=mo(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(l){Et(t,r,l)}}function pl(t,r){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof a=="function"?t.refCleanup=a(l):a.current=l}}catch(h){Et(t,r,h)}}function ci(t,r){var a=t.ref,l=t.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(h){Et(t,r,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(h){Et(t,r,h)}else a.current=null}function kb(t){var r=t.type,a=t.memoizedProps,l=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(h){Et(t,t.return,h)}}function Dp(t,r,a){try{var l=t.stateNode;hR(l,t.type,a,r),l[Ve]=r}catch(h){Et(t,t.return,h)}}function Sb(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&xa(t.type)||t.tag===4}function Op(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Sb(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&xa(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Pp(t,r,a){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(t),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=xr));else if(l!==4&&(l===27&&xa(t.type)&&(a=t.stateNode,r=null),t=t.child,t!==null))for(Pp(t,r,a),t=t.sibling;t!==null;)Pp(t,r,a),t=t.sibling}function Zc(t,r,a){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?a.insertBefore(t,r):a.appendChild(t);else if(l!==4&&(l===27&&xa(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Zc(t,r,a),t=t.sibling;t!==null;)Zc(t,r,a),t=t.sibling}function Cb(t){var r=t.stateNode,a=t.memoizedProps;try{for(var l=t.type,h=r.attributes;h.length;)r.removeAttributeNode(h[0]);Tn(r,l,a),r[He]=t,r[Ve]=a}catch(g){Et(t,t.return,g)}}var Li=!1,ln=!1,Mp=!1,Eb=typeof WeakSet=="function"?WeakSet:Set,kn=null;function GT(t,r){if(t=t.containerInfo,Yp=wu,t=Bv(t),Cf(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var h=l.anchorOffset,g=l.focusNode;l=l.focusOffset;try{a.nodeType,g.nodeType}catch{a=null;break e}var S=0,D=-1,H=-1,ne=0,he=0,ge=t,ae=null;t:for(;;){for(var ue;ge!==a||h!==0&&ge.nodeType!==3||(D=S+h),ge!==g||l!==0&&ge.nodeType!==3||(H=S+l),ge.nodeType===3&&(S+=ge.nodeValue.length),(ue=ge.firstChild)!==null;)ae=ge,ge=ue;for(;;){if(ge===t)break t;if(ae===a&&++ne===h&&(D=S),ae===g&&++he===l&&(H=S),(ue=ge.nextSibling)!==null)break;ge=ae,ae=ge.parentNode}ge=ue}a=D===-1||H===-1?null:{start:D,end:H}}else a=null}a||(a={start:0,end:0})}else a=null;for(Zp={focusedElem:t,selectionRange:a},wu=!1,kn=r;kn!==null;)if(r=kn,t=r.child,r.subtreeFlags&1028&&t!==null)t.return=r,kn=t;else for(;kn!==null;){switch(r=kn,g=r.alternate,t=r.flags,r.tag){case 0:if(t&4&&(t=r.updateQueue,t=t===null?null:t.events,t!==null))for(a=0;a<t.length;a++)h=t[a],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if(t&1024&&g!==null){t=void 0,a=r,h=g.memoizedProps,g=g.memoizedState,l=a.stateNode;try{var De=mo(a.type,h);t=l.getSnapshotBeforeUpdate(De,g),l.__reactInternalSnapshotBeforeUpdate=t}catch(Ie){Et(a,a.return,Ie)}}break;case 3:if(t&1024){if(t=r.stateNode.containerInfo,a=t.nodeType,a===9)nh(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":nh(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(t&1024)throw Error(s(163))}if(t=r.sibling,t!==null){t.return=r.return,kn=t;break}kn=r.return}}function Tb(t,r,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:Ii(t,a),l&4&&fl(5,a);break;case 1:if(Ii(t,a),l&4)if(t=a.stateNode,r===null)try{t.componentDidMount()}catch(S){Et(a,a.return,S)}else{var h=mo(a.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(h,r,t.__reactInternalSnapshotBeforeUpdate)}catch(S){Et(a,a.return,S)}}l&64&&_b(a),l&512&&pl(a,a.return);break;case 3:if(Ii(t,a),l&64&&(t=a.updateQueue,t!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{h1(t,r)}catch(S){Et(a,a.return,S)}}break;case 27:r===null&&l&4&&Cb(a);case 26:case 5:Ii(t,a),r===null&&l&4&&kb(a),l&512&&pl(a,a.return);break;case 12:Ii(t,a);break;case 31:Ii(t,a),l&4&&Ob(t,a);break;case 13:Ii(t,a),l&4&&Pb(t,a),l&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=iR.bind(null,a),xR(t,a))));break;case 22:if(l=a.memoizedState!==null||Li,!l){r=r!==null&&r.memoizedState!==null||ln,h=Li;var g=ln;Li=l,(ln=r)&&!g?Ai(t,a,(a.subtreeFlags&8772)!=0):Ii(t,a),Li=h,ln=g}break;case 30:break;default:Ii(t,a)}}function Rb(t){var r=t.alternate;r!==null&&(t.alternate=null,Rb(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&wn(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Wt=null,Qn=!1;function Ni(t,r,a){for(a=a.child;a!==null;)Db(t,r,a),a=a.sibling}function Db(t,r,a){if(Jt&&typeof Jt.onCommitFiberUnmount=="function")try{Jt.onCommitFiberUnmount(wr,a)}catch{}switch(a.tag){case 26:ln||ci(a,r),Ni(t,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ln||ci(a,r);var l=Wt,h=Qn;xa(a.type)&&(Wt=a.stateNode,Qn=!1),Ni(t,r,a),xl(a.stateNode),Wt=l,Qn=h;break;case 5:ln||ci(a,r);case 6:if(l=Wt,h=Qn,Wt=null,Ni(t,r,a),Wt=l,Qn=h,Wt!==null)if(Qn)try{(Wt.nodeType===9?Wt.body:Wt.nodeName==="HTML"?Wt.ownerDocument.body:Wt).removeChild(a.stateNode)}catch(g){Et(a,r,g)}else try{Wt.removeChild(a.stateNode)}catch(g){Et(a,r,g)}break;case 18:Wt!==null&&(Qn?(t=Wt,x2(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),ws(t)):x2(Wt,a.stateNode));break;case 4:l=Wt,h=Qn,Wt=a.stateNode.containerInfo,Qn=!0,Ni(t,r,a),Wt=l,Qn=h;break;case 0:case 11:case 14:case 15:ma(2,a,r),ln||ma(4,a,r),Ni(t,r,a);break;case 1:ln||(ci(a,r),l=a.stateNode,typeof l.componentWillUnmount=="function"&&xb(a,r,l)),Ni(t,r,a);break;case 21:Ni(t,r,a);break;case 22:ln=(l=ln)||a.memoizedState!==null,Ni(t,r,a),ln=l;break;default:Ni(t,r,a)}}function Ob(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ws(t)}catch(a){Et(r,r.return,a)}}}function Pb(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ws(t)}catch(a){Et(r,r.return,a)}}function JT(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new Eb),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new Eb),r;default:throw Error(s(435,t.tag))}}function eu(t,r){var a=JT(t);r.forEach(function(l){if(!a.has(l)){a.add(l);var h=aR.bind(null,t,l);l.then(h,h)}})}function Gn(t,r){var a=r.deletions;if(a!==null)for(var l=0;l<a.length;l++){var h=a[l],g=t,S=r,D=S;e:for(;D!==null;){switch(D.tag){case 27:if(xa(D.type)){Wt=D.stateNode,Qn=!1;break e}break;case 5:Wt=D.stateNode,Qn=!1;break e;case 3:case 4:Wt=D.stateNode.containerInfo,Qn=!0;break e}D=D.return}if(Wt===null)throw Error(s(160));Db(g,S,h),Wt=null,Qn=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Mb(r,t),r=r.sibling}var Qr=null;function Mb(t,r){var a=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Gn(r,t),Jn(t),l&4&&(ma(3,t,t.return),fl(3,t),ma(5,t,t.return));break;case 1:Gn(r,t),Jn(t),l&512&&(ln||a===null||ci(a,a.return)),l&64&&Li&&(t=t.updateQueue,t!==null&&(l=t.callbacks,l!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var h=Qr;if(Gn(r,t),Jn(t),l&512&&(ln||a===null||ci(a,a.return)),l&4){var g=a===null?null:a.memoizedState;if(l=t.memoizedState,a===null)if(l===null)if(t.stateNode===null){e:{l=t.type,a=t.memoizedProps,h=h.ownerDocument||h;t:switch(l){case"title":g=h.getElementsByTagName("title")[0],(!g||g[ut]||g[He]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=h.createElement(l),h.head.insertBefore(g,h.querySelector("head > title"))),Tn(g,l,a),g[He]=t,Xt(g),l=g;break e;case"link":var S=L2("link","href",h).get(l+(a.href||""));if(S){for(var D=0;D<S.length;D++)if(g=S[D],g.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&g.getAttribute("rel")===(a.rel==null?null:a.rel)&&g.getAttribute("title")===(a.title==null?null:a.title)&&g.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){S.splice(D,1);break t}}g=h.createElement(l),Tn(g,l,a),h.head.appendChild(g);break;case"meta":if(S=L2("meta","content",h).get(l+(a.content||""))){for(D=0;D<S.length;D++)if(g=S[D],g.getAttribute("content")===(a.content==null?null:""+a.content)&&g.getAttribute("name")===(a.name==null?null:a.name)&&g.getAttribute("property")===(a.property==null?null:a.property)&&g.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&g.getAttribute("charset")===(a.charSet==null?null:a.charSet)){S.splice(D,1);break t}}g=h.createElement(l),Tn(g,l,a),h.head.appendChild(g);break;default:throw Error(s(468,l))}g[He]=t,Xt(g),l=g}t.stateNode=l}else N2(h,t.type,t.stateNode);else t.stateNode=M2(h,l,t.memoizedProps);else g===l?l===null&&t.stateNode!==null&&Dp(t,t.memoizedProps,a.memoizedProps):(g===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):g.count--,l===null?N2(h,t.type,t.stateNode):M2(h,l,t.memoizedProps))}break;case 27:Gn(r,t),Jn(t),l&512&&(ln||a===null||ci(a,a.return)),a!==null&&l&4&&Dp(t,t.memoizedProps,a.memoizedProps);break;case 5:if(Gn(r,t),Jn(t),l&512&&(ln||a===null||ci(a,a.return)),t.flags&32){h=t.stateNode;try{xi(h,"")}catch(De){Et(t,t.return,De)}}l&4&&t.stateNode!=null&&(h=t.memoizedProps,Dp(t,h,a===null?h:a.memoizedProps)),l&1024&&(Mp=!0);break;case 6:if(Gn(r,t),Jn(t),l&4){if(t.stateNode===null)throw Error(s(162));l=t.memoizedProps,a=t.stateNode;try{a.nodeValue=l}catch(De){Et(t,t.return,De)}}break;case 3:if(gu=null,h=Qr,Qr=hu(r.containerInfo),Gn(r,t),Qr=h,Jn(t),l&4&&a!==null&&a.memoizedState.isDehydrated)try{ws(r.containerInfo)}catch(De){Et(t,t.return,De)}Mp&&(Mp=!1,Lb(t));break;case 4:l=Qr,Qr=hu(t.stateNode.containerInfo),Gn(r,t),Jn(t),Qr=l;break;case 12:Gn(r,t),Jn(t);break;case 31:Gn(r,t),Jn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,eu(t,l)));break;case 13:Gn(r,t),Jn(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(nu=Ut()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,eu(t,l)));break;case 22:h=t.memoizedState!==null;var H=a!==null&&a.memoizedState!==null,ne=Li,he=ln;if(Li=ne||h,ln=he||H,Gn(r,t),ln=he,Li=ne,Jn(t),l&8192)e:for(r=t.stateNode,r._visibility=h?r._visibility&-2:r._visibility|1,h&&(a===null||H||Li||ln||go(t)),a=null,r=t;;){if(r.tag===5||r.tag===26){if(a===null){H=a=r;try{if(g=H.stateNode,h)S=g.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{D=H.stateNode;var ge=H.memoizedProps.style,ae=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;D.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(De){Et(H,H.return,De)}}}else if(r.tag===6){if(a===null){H=r;try{H.stateNode.nodeValue=h?"":H.memoizedProps}catch(De){Et(H,H.return,De)}}}else if(r.tag===18){if(a===null){H=r;try{var ue=H.stateNode;h?k2(ue,!0):k2(H.stateNode,!1)}catch(De){Et(H,H.return,De)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;a===r&&(a=null),r=r.return}a===r&&(a=null),r.sibling.return=r.return,r=r.sibling}l&4&&(l=t.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,eu(t,a))));break;case 19:Gn(r,t),Jn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,eu(t,l)));break;case 30:break;case 21:break;default:Gn(r,t),Jn(t)}}function Jn(t){var r=t.flags;if(r&2){try{for(var a,l=t.return;l!==null;){if(Sb(l)){a=l;break}l=l.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var h=a.stateNode;Zc(t,Op(t),h);break;case 5:var g=a.stateNode;a.flags&32&&(xi(g,""),a.flags&=-33),Zc(t,Op(t),g);break;case 3:case 4:var S=a.stateNode.containerInfo;Pp(t,Op(t),S);break;default:throw Error(s(161))}}catch(D){Et(t,t.return,D)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function Lb(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;Lb(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Ii(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Tb(t,r.alternate,r),r=r.sibling}function go(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:ma(4,r,r.return),go(r);break;case 1:ci(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&xb(r,r.return,a),go(r);break;case 27:xl(r.stateNode);case 26:case 5:ci(r,r.return),go(r);break;case 22:r.memoizedState===null&&go(r);break;case 30:go(r);break;default:go(r)}t=t.sibling}}function Ai(t,r,a){for(a&&(a=(r.subtreeFlags&8772)!=0),r=r.child;r!==null;){var l=r.alternate,h=t,g=r,S=g.flags;switch(g.tag){case 0:case 11:case 15:Ai(h,g,a),fl(4,g);break;case 1:if(Ai(h,g,a),l=g,h=l.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(ne){Et(l,l.return,ne)}if(l=g,h=l.updateQueue,h!==null){var D=l.stateNode;try{var H=h.shared.hiddenCallbacks;if(H!==null)for(h.shared.hiddenCallbacks=null,h=0;h<H.length;h++)p1(H[h],D)}catch(ne){Et(l,l.return,ne)}}a&&S&64&&_b(g),pl(g,g.return);break;case 27:Cb(g);case 26:case 5:Ai(h,g,a),a&&l===null&&S&4&&kb(g),pl(g,g.return);break;case 12:Ai(h,g,a);break;case 31:Ai(h,g,a),a&&S&4&&Ob(h,g);break;case 13:Ai(h,g,a),a&&S&4&&Pb(h,g);break;case 22:g.memoizedState===null&&Ai(h,g,a),pl(g,g.return);break;case 30:break;default:Ai(h,g,a)}r=r.sibling}}function Lp(t,r){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&Zs(a))}function Np(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Zs(t))}function Gr(t,r,a,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Nb(t,r,a,l),r=r.sibling}function Nb(t,r,a,l){var h=r.flags;switch(r.tag){case 0:case 11:case 15:Gr(t,r,a,l),h&2048&&fl(9,r);break;case 1:Gr(t,r,a,l);break;case 3:Gr(t,r,a,l),h&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Zs(t)));break;case 12:if(h&2048){Gr(t,r,a,l),t=r.stateNode;try{var g=r.memoizedProps,S=g.id,D=g.onPostCommit;typeof D=="function"&&D(S,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(H){Et(r,r.return,H)}}else Gr(t,r,a,l);break;case 31:Gr(t,r,a,l);break;case 13:Gr(t,r,a,l);break;case 23:break;case 22:g=r.stateNode,S=r.alternate,r.memoizedState===null?g._visibility&2?Gr(t,r,a,l):(g._visibility|=2,cs(t,r,a,l,(r.subtreeFlags&10256)!=0||!1)):g._visibility&2?Gr(t,r,a,l):hl(t,r),h&2048&&Lp(S,r);break;case 24:Gr(t,r,a,l),h&2048&&Np(r.alternate,r);break;default:Gr(t,r,a,l)}}function cs(t,r,a,l,h){for(h&&(h=(r.subtreeFlags&10256)!=0||!1),r=r.child;r!==null;){var g=t,S=r,D=a,H=l,ne=S.flags;switch(S.tag){case 0:case 11:case 15:cs(g,S,D,H,h),fl(8,S);break;case 23:break;case 22:var he=S.stateNode;S.memoizedState===null?(he._visibility|=2,cs(g,S,D,H,h)):he._visibility&2?cs(g,S,D,H,h):hl(g,S),h&&ne&2048&&Lp(S.alternate,S);break;case 24:cs(g,S,D,H,h),h&&ne&2048&&Np(S.alternate,S);break;default:cs(g,S,D,H,h)}r=r.sibling}}function hl(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=t,l=r,h=l.flags;switch(l.tag){case 22:hl(a,l),h&2048&&Lp(l.alternate,l);break;case 24:hl(a,l),h&2048&&Np(l.alternate,l);break;default:hl(a,l)}r=r.sibling}}var ml=8192;function us(t,r,a){if(t.subtreeFlags&ml)for(t=t.child;t!==null;)Ib(t,r,a),t=t.sibling}function Ib(t,r,a){switch(t.tag){case 26:us(t,r,a),t.flags&ml&&t.memoizedState!==null&&NR(a,Qr,t.memoizedState,t.memoizedProps);break;case 5:us(t,r,a);break;case 3:case 4:var l=Qr;Qr=hu(t.stateNode.containerInfo),us(t,r,a),Qr=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=ml,ml=16777216,us(t,r,a),ml=l):us(t,r,a));break;default:us(t,r,a)}}function Ab(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function gl(t){var r=t.deletions;if(t.flags&16){if(r!==null)for(var a=0;a<r.length;a++){var l=r[a];kn=l,jb(l,t)}Ab(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)qb(t),t=t.sibling}function qb(t){switch(t.tag){case 0:case 11:case 15:gl(t),t.flags&2048&&ma(9,t,t.return);break;case 3:gl(t);break;case 12:gl(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,tu(t)):gl(t);break;default:gl(t)}}function tu(t){var r=t.deletions;if(t.flags&16){if(r!==null)for(var a=0;a<r.length;a++){var l=r[a];kn=l,jb(l,t)}Ab(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:ma(8,r,r.return),tu(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,tu(r));break;default:tu(r)}t=t.sibling}}function jb(t,r){for(;kn!==null;){var a=kn;switch(a.tag){case 0:case 11:case 15:ma(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Zs(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,kn=l;else e:for(a=t;kn!==null;){l=kn;var h=l.sibling,g=l.return;if(Rb(l),l===a){kn=null;break e}if(h!==null){h.return=g,kn=h;break e}kn=g}}}var XT={getCacheForType:function(t){var r=Cn(an),a=r.data.get(t);return a===void 0&&(a=t(),r.data.set(t,a)),a},cacheSignal:function(){return Cn(an).controller.signal}},YT=typeof WeakMap=="function"?WeakMap:Map,yt=0,It=null,tt=null,it=0,Ct=0,pr=null,ga=!1,ds=!1,Ip=!1,qi=0,Gt=0,ya=0,yo=0,Ap=0,hr=0,fs=0,yl=null,Xn=null,qp=!1,nu=0,zb=0,ru=1/0,iu=null,va=null,hn=0,ba=null,ps=null,ji=0,jp=0,zp=null,Fb=null,vl=0,Fp=null;function Rr(){return yt&2&&it!==0?it&-it:se.T===null?te():Up()}function Bb(){if(hr===0)if(!(it&536870912)||st){var t=St;St<<=1,!(St&3932160)&&(St=262144),hr=t}else hr=536870912;return t=dr.current,t!==null&&(t.flags|=32),hr}function Yn(t,r,a){(t===It&&(Ct===2||Ct===9)||t.cancelPendingCommit!==null)&&(hs(t,0),wa(t,it,hr,!1)),Ln(t,a),(!(yt&2)||t!==It)&&(t===It&&(!(yt&2)&&(yo|=a),Gt===4&&wa(t,it,hr,!1)),zi(t))}function Hb(t,r,a){if(yt&6)throw Error(s(327));var l=!a&&(r&127)==0&&(r&t.expiredLanes)===0||bn(t,r),h=l?tR(t,r):Hp(t,r,!0),g=l;do{if(h===0){ds&&!l&&wa(t,r,0,!1);break}else{if(a=t.current.alternate,g&&!ZT(a)){h=Hp(t,r,!1),g=!1;continue}if(h===2){if(g=r,t.errorRecoveryDisabledLanes&g)var S=0;else S=t.pendingLanes&-536870913,S=S===0?S&536870912?536870912:0:S;if(S!==0){r=S;e:{var D=t;h=yl;var H=D.current.memoizedState.isDehydrated;if(H&&(hs(D,S).flags|=256),S=Hp(D,S,!1),S!==2){if(Ip&&!H){D.errorRecoveryDisabledLanes|=g,yo|=g,h=4;break e}g=Xn,Xn=h,g!==null&&(Xn===null?Xn=g:Xn.push.apply(Xn,g))}h=S}if(g=!1,h!==2)continue}}if(h===1){hs(t,0),wa(t,r,0,!0);break}e:{switch(l=t,g=h,g){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:wa(l,r,hr,!ga);break e;case 2:Xn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(h=nu+300-Ut(),10<h)){if(wa(l,r,hr,!ga),Hr(l,0,!0)!==0)break e;ji=r,l.timeoutHandle=w2(Vb.bind(null,l,a,Xn,iu,qp,r,hr,yo,fs,ga,g,"Throttled",-0,0),h);break e}Vb(l,a,Xn,iu,qp,r,hr,yo,fs,ga,g,null,-0,0)}}break}while(!0);zi(t)}function Vb(t,r,a,l,h,g,S,D,H,ne,he,ge,ae,ue){if(t.timeoutHandle=-1,ge=r.subtreeFlags,ge&8192||(ge&16785408)==16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xr},Ib(r,g,ge);var De=(g&62914560)===g?nu-Ut():(g&4194048)===g?zb-Ut():0;if(De=IR(ge,De),De!==null){ji=g,t.cancelPendingCommit=De(Xb.bind(null,t,r,g,a,l,h,S,D,H,he,ge,null,ae,ue)),wa(t,g,S,!ne);return}}Xb(t,r,g,a,l,h,S,D,H)}function ZT(t){for(var r=t;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var h=a[l],g=h.getSnapshot;h=h.value;try{if(!cr(g(),h))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function wa(t,r,a,l){r&=~Ap,r&=~yo,t.suspendedLanes|=r,t.pingedLanes&=~r,l&&(t.warmLanes|=r),l=t.expirationTimes;for(var h=r;0<h;){var g=31-gt(h),S=1<<g;l[g]=-1,h&=~S}a!==0&&Fn(t,a,r)}function au(){return yt&6?!0:(bl(0,!1),!1)}function Bp(){if(tt!==null){if(Ct===0)var t=tt.return;else t=tt,Ti=ao=null,rp(t),is=null,tl=0,t=tt;for(;t!==null;)wb(t.alternate,t),t=t.return;tt=null}}function hs(t,r){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,yR(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),ji=0,Bp(),It=t,tt=a=Ci(t.current,null),it=r,Ct=0,pr=null,ga=!1,ds=bn(t,r),Ip=!1,fs=hr=Ap=yo=ya=Gt=0,Xn=yl=null,qp=!1,r&8&&(r|=r&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=r;0<l;){var h=31-gt(l),g=1<<h;r|=t[h],l&=~g}return qi=r,Ec(),a}function $b(t,r){Ke=null,se.H=cl,r===rs||r===Nc?(r=c1(),Ct=3):r===Wf?(r=c1(),Ct=4):Ct=r===bp?8:typeof r=="object"&&r&&typeof r.then=="function"?6:1,pr=r,tt===null&&(Gt=1,Qc(t,Sr(r,t.current)))}function Wb(){var t=dr.current;return t===null?!0:(it&4194048)===it?Kr===null:(it&62914560)===it||it&536870912?t===Kr:!1}function Ub(){var t=se.H;return se.H=cl,t===null?cl:t}function Kb(){var t=se.A;return se.A=XT,t}function ou(){Gt=4,ga||(it&4194048)!==it&&dr.current!==null||(ds=!0),!(ya&134217727)&&!(yo&134217727)||It===null||wa(It,it,hr,!1)}function Hp(t,r,a){var l=yt;yt|=2;var h=Ub(),g=Kb();(It!==t||it!==r)&&(iu=null,hs(t,r)),r=!1;var S=Gt;e:do try{if(Ct!==0&&tt!==null){var D=tt,H=pr;switch(Ct){case 8:Bp(),S=6;break e;case 3:case 2:case 9:case 6:dr.current===null&&(r=!0);var ne=Ct;if(Ct=0,pr=null,ms(t,D,H,ne),a&&ds){S=0;break e}break;default:ne=Ct,Ct=0,pr=null,ms(t,D,H,ne)}}eR(),S=Gt;break}catch(he){$b(t,he)}while(!0);return r&&t.shellSuspendCounter++,Ti=ao=null,yt=l,se.H=h,se.A=g,tt===null&&(It=null,it=0,Ec()),S}function eR(){for(;tt!==null;)Qb(tt)}function tR(t,r){var a=yt;yt|=2;var l=Ub(),h=Kb();It!==t||it!==r?(iu=null,ru=Ut()+500,hs(t,r)):ds=bn(t,r);e:do try{if(Ct!==0&&tt!==null){r=tt;var g=pr;t:switch(Ct){case 1:Ct=0,pr=null,ms(t,r,g,1);break;case 2:case 9:if(s1(g)){Ct=0,pr=null,Gb(r);break}r=function(){Ct!==2&&Ct!==9||It!==t||(Ct=7),zi(t)},g.then(r,r);break e;case 3:Ct=7;break e;case 4:Ct=5;break e;case 7:s1(g)?(Ct=0,pr=null,Gb(r)):(Ct=0,pr=null,ms(t,r,g,7));break;case 5:var S=null;switch(tt.tag){case 26:S=tt.memoizedState;case 5:case 27:var D=tt;if(S?I2(S):D.stateNode.complete){Ct=0,pr=null;var H=D.sibling;if(H!==null)tt=H;else{var ne=D.return;ne===null?tt=null:(tt=ne,su(ne))}break t}}Ct=0,pr=null,ms(t,r,g,5);break;case 6:Ct=0,pr=null,ms(t,r,g,6);break;case 8:Bp(),Gt=6;break e;default:throw Error(s(462))}}nR();break}catch(he){$b(t,he)}while(!0);return Ti=ao=null,se.H=l,se.A=h,yt=a,tt===null?(It=null,it=0,Ec(),Gt):0}function nR(){for(;tt!==null&&!ta();)Qb(tt)}function Qb(t){var r=vb(t.alternate,t,qi);t.memoizedProps=t.pendingProps,r===null?su(t):tt=r}function Gb(t){var r=t,a=r.alternate;switch(r.tag){case 15:case 0:r=fb(a,r,r.pendingProps,r.type,void 0,it);break;case 11:r=fb(a,r,r.pendingProps,r.type.render,r.ref,it);break;case 5:rp(r);default:wb(a,r),r=tt=Jv(r,qi),r=vb(a,r,qi)}t.memoizedProps=t.pendingProps,r===null?su(t):tt=r}function ms(t,r,a,l){Ti=ao=null,rp(r),is=null,tl=0;var h=r.return;try{if($T(t,h,r,a,it)){Gt=1,Qc(t,Sr(a,t.current)),tt=null;return}}catch(g){if(h!==null)throw tt=h,g;Gt=1,Qc(t,Sr(a,t.current)),tt=null;return}r.flags&32768?(st||l===1?t=!0:ds||it&536870912?t=!1:(ga=t=!0,(l===2||l===9||l===3||l===6)&&(l=dr.current,l!==null&&l.tag===13&&(l.flags|=16384))),Jb(r,t)):su(r)}function su(t){var r=t;do{if(r.flags&32768){Jb(r,ga);return}t=r.return;var a=KT(r.alternate,r,qi);if(a!==null){tt=a;return}if(r=r.sibling,r!==null){tt=r;return}tt=r=t}while(r!==null);Gt===0&&(Gt=5)}function Jb(t,r){do{var a=QT(t.alternate,t);if(a!==null){a.flags&=32767,tt=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(t=t.sibling,t!==null)){tt=t;return}tt=t=a}while(t!==null);Gt=6,tt=null}function Xb(t,r,a,l,h,g,S,D,H){t.cancelPendingCommit=null;do lu();while(hn!==0);if(yt&6)throw Error(s(327));if(r!==null){if(r===t.current)throw Error(s(177));if(g=r.lanes|r.childLanes,g|=Of,wi(t,a,g,S,D,H),t===It&&(tt=It=null,it=0),ps=r,ba=t,ji=a,jp=g,zp=h,Fb=l,r.subtreeFlags&10256||r.flags&10256?(t.callbackNode=null,t.callbackPriority=0,oR(zt,function(){return n2(),null})):(t.callbackNode=null,t.callbackPriority=0),l=(r.flags&13878)!=0,r.subtreeFlags&13878||l){l=se.T,se.T=null,h=Q.p,Q.p=2,S=yt,yt|=4;try{GT(t,r,a)}finally{yt=S,Q.p=h,se.T=l}}hn=1,Yb(),Zb(),e2()}}function Yb(){if(hn===1){hn=0;var t=ba,r=ps,a=(r.flags&13878)!=0;if(r.subtreeFlags&13878||a){a=se.T,se.T=null;var l=Q.p;Q.p=2;var h=yt;yt|=4;try{Mb(r,t);var g=Zp,S=Bv(t.containerInfo),D=g.focusedElem,H=g.selectionRange;if(S!==D&&D&&D.ownerDocument&&Fv(D.ownerDocument.documentElement,D)){if(H!==null&&Cf(D)){var ne=H.start,he=H.end;if(he===void 0&&(he=ne),"selectionStart"in D)D.selectionStart=ne,D.selectionEnd=Math.min(he,D.value.length);else{var ge=D.ownerDocument||document,ae=ge&&ge.defaultView||window;if(ae.getSelection){var ue=ae.getSelection(),De=D.textContent.length,Ie=Math.min(H.start,De),Ot=H.end===void 0?Ie:Math.min(H.end,De);!ue.extend&&Ie>Ot&&(S=Ot,Ot=Ie,Ie=S);var G=zv(D,Ie),U=zv(D,Ot);if(G&&U&&(ue.rangeCount!==1||ue.anchorNode!==G.node||ue.anchorOffset!==G.offset||ue.focusNode!==U.node||ue.focusOffset!==U.offset)){var ee=ge.createRange();ee.setStart(G.node,G.offset),ue.removeAllRanges(),Ie>Ot?(ue.addRange(ee),ue.extend(U.node,U.offset)):(ee.setEnd(U.node,U.offset),ue.addRange(ee))}}}}for(ge=[],ue=D;ue=ue.parentNode;)ue.nodeType===1&&ge.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<ge.length;D++){var me=ge[D];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}wu=!!Yp,Zp=Yp=null}finally{yt=h,Q.p=l,se.T=a}}t.current=r,hn=2}}function Zb(){if(hn===2){hn=0;var t=ba,r=ps,a=(r.flags&8772)!=0;if(r.subtreeFlags&8772||a){a=se.T,se.T=null;var l=Q.p;Q.p=2;var h=yt;yt|=4;try{Tb(t,r.alternate,r)}finally{yt=h,Q.p=l,se.T=a}}hn=3}}function e2(){if(hn===4||hn===3){hn=0,gi();var t=ba,r=ps,a=ji,l=Fb;r.subtreeFlags&10256||r.flags&10256?hn=5:(hn=0,ps=ba=null,t2(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(va=null),j(a),r=r.stateNode,Jt&&typeof Jt.onCommitFiberRoot=="function")try{Jt.onCommitFiberRoot(wr,r,void 0,(r.current.flags&128)==128)}catch{}if(l!==null){r=se.T,h=Q.p,Q.p=2,se.T=null;try{for(var g=t.onRecoverableError,S=0;S<l.length;S++){var D=l[S];g(D.value,{componentStack:D.stack})}}finally{se.T=r,Q.p=h}}ji&3&&lu(),zi(t),h=t.pendingLanes,a&261930&&h&42?t===Fp?vl++:(vl=0,Fp=t):vl=0,bl(0,!1)}}function t2(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Zs(r)))}function lu(){return Yb(),Zb(),e2(),n2()}function n2(){if(hn!==5)return!1;var t=ba,r=jp;jp=0;var a=j(ji),l=se.T,h=Q.p;try{Q.p=32>a?32:a,se.T=null,a=zp,zp=null;var g=ba,S=ji;if(hn=0,ps=ba=null,ji=0,yt&6)throw Error(s(331));var D=yt;if(yt|=4,qb(g.current),Nb(g,g.current,S,a),yt=D,bl(0,!1),Jt&&typeof Jt.onPostCommitFiberRoot=="function")try{Jt.onPostCommitFiberRoot(wr,g)}catch{}return!0}finally{Q.p=h,se.T=l,t2(t,r)}}function r2(t,r,a){r=Sr(a,r),r=vp(t.stateNode,r,2),t=po(t,r,2),t!==null&&(Ln(t,2),zi(t))}function Et(t,r,a){if(t.tag===3)r2(t,t,a);else for(;r!==null;){if(r.tag===3){r2(r,t,a);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(va===null||!va.has(l))){t=Sr(a,t),a=ib(2),l=po(r,a,2),l!==null&&(ab(a,l,r,t),Ln(l,2),zi(l));break}}r=r.return}}function Vp(t,r,a){var l=t.pingCache;if(l===null){l=t.pingCache=new YT;var h=new Set;l.set(r,h)}else h=l.get(r),h===void 0&&(h=new Set,l.set(r,h));h.has(a)||(Ip=!0,h.add(a),t=rR.bind(null,t,r,a),r.then(t,t))}function rR(t,r,a){var l=t.pingCache;l!==null&&l.delete(r),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,It===t&&(it&a)===a&&(Gt===4||Gt===3&&(it&62914560)===it&&300>Ut()-nu?!(yt&2)&&hs(t,0):Ap|=a,fs===it&&(fs=0)),zi(t)}function i2(t,r){r===0&&(r=bi()),t=no(t,r),t!==null&&(Ln(t,r),zi(t))}function iR(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),i2(t,a)}function aR(t,r){var a=0;switch(t.tag){case 31:case 13:var l=t.stateNode,h=t.memoizedState;h!==null&&(a=h.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(r),i2(t,a)}function oR(t,r){return Pn(t,r)}var cu=null,gs=null,$p=!1,uu=!1,Wp=!1,_a=0;function zi(t){t!==gs&&t.next===null&&(gs===null?cu=gs=t:gs=gs.next=t),uu=!0,$p||($p=!0,lR())}function bl(t,r){if(!Wp&&uu){Wp=!0;do for(var a=!1,l=cu;l!==null;){if(!r)if(t!==0){var h=l.pendingLanes;if(h===0)var g=0;else{var S=l.suspendedLanes,D=l.pingedLanes;g=(1<<31-gt(42|t)+1)-1,g&=h&~(S&~D),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(a=!0,l2(l,g))}else g=it,g=Hr(l,l===It?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),!(g&3)||bn(l,g)||(a=!0,l2(l,g));l=l.next}while(a);Wp=!1}}function sR(){a2()}function a2(){uu=$p=!1;var t=0;_a!==0&&gR()&&(t=_a);for(var r=Ut(),a=null,l=cu;l!==null;){var h=l.next,g=o2(l,r);g===0?(l.next=null,a===null?cu=h:a.next=h,h===null&&(gs=a)):(a=l,(t!==0||g&3)&&(uu=!0)),l=h}hn!==0&&hn!==5||bl(t,!1),_a!==0&&(_a=0)}function o2(t,r){for(var a=t.suspendedLanes,l=t.pingedLanes,h=t.expirationTimes,g=t.pendingLanes&-62914561;0<g;){var S=31-gt(g),D=1<<S,H=h[S];H===-1?((D&a)===0||(D&l)!==0)&&(h[S]=ar(D,r)):H<=r&&(t.expiredLanes|=D),g&=~D}if(r=It,a=it,a=Hr(t,t===r?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,a===0||t===r&&(Ct===2||Ct===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&dn(l),t.callbackNode=null,t.callbackPriority=0;if(!(a&3)||bn(t,a)){if(r=a&-a,r===t.callbackPriority)return r;switch(l!==null&&dn(l),j(a)){case 2:case 8:a=ni;break;case 32:a=zt;break;case 268435456:a=_t;break;default:a=zt}return l=s2.bind(null,t),a=Pn(a,l),t.callbackPriority=r,t.callbackNode=a,r}return l!==null&&l!==null&&dn(l),t.callbackPriority=2,t.callbackNode=null,2}function s2(t,r){if(hn!==0&&hn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(lu()&&t.callbackNode!==a)return null;var l=it;return l=Hr(t,t===It?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(Hb(t,l,r),o2(t,Ut()),t.callbackNode!=null&&t.callbackNode===a?s2.bind(null,t):null)}function l2(t,r){if(lu())return null;Hb(t,r,!0)}function lR(){vR(function(){yt&6?Pn(fn,sR):a2()})}function Up(){if(_a===0){var t=ts;t===0&&(t=_r,_r<<=1,!(_r&261888)&&(_r=256)),_a=t}return _a}function c2(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Vo(""+t)}function u2(t,r){var a=r.ownerDocument.createElement("input");return a.name=r.name,a.value=r.value,t.id&&a.setAttribute("form",t.id),r.parentNode.insertBefore(a,r),t=new FormData(t),a.parentNode.removeChild(a),t}function cR(t,r,a,l,h){if(r==="submit"&&a&&a.stateNode===h){var g=c2((h[Ve]||null).action),S=l.submitter;S&&(r=(r=S[Ve]||null)?c2(r.formAction):S.getAttribute("formAction"),r!==null&&(g=r,S=null));var D=new u("action","action",null,l,h);t.push({event:D,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(_a!==0){var H=S?u2(h,S):new FormData(h);fp(a,{pending:!0,data:H,method:h.method,action:g},null,H)}}else typeof g=="function"&&(D.preventDefault(),H=S?u2(h,S):new FormData(h),fp(a,{pending:!0,data:H,method:h.method,action:g},g,H))},currentTarget:h}]})}}for(var Kp=0;Kp<Df.length;Kp++){var Qp=Df[Kp];Ur(Qp.toLowerCase(),"on"+(Qp[0].toUpperCase()+Qp.slice(1)))}Ur($v,"onAnimationEnd"),Ur(Wv,"onAnimationIteration"),Ur(Uv,"onAnimationStart"),Ur("dblclick","onDoubleClick"),Ur("focusin","onFocus"),Ur("focusout","onBlur"),Ur(ST,"onTransitionRun"),Ur(CT,"onTransitionStart"),Ur(ET,"onTransitionCancel"),Ur(Kv,"onTransitionEnd"),ia("onMouseEnter",["mouseout","mouseover"]),ia("onMouseLeave",["mouseout","mouseover"]),ia("onPointerEnter",["pointerout","pointerover"]),ia("onPointerLeave",["pointerout","pointerover"]),ai("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ai("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ai("onBeforeInput",["compositionend","keypress","textInput","paste"]),ai("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ai("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ai("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),uR=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wl));function d2(t,r){r=(r&4)!=0;for(var a=0;a<t.length;a++){var l=t[a],h=l.event;l=l.listeners;e:{var g=void 0;if(r)for(var S=l.length-1;0<=S;S--){var D=l[S],H=D.instance,ne=D.currentTarget;if(D=D.listener,H!==g&&h.isPropagationStopped())break e;g=D,h.currentTarget=ne;try{g(h)}catch(he){Cc(he)}h.currentTarget=null,g=H}else for(S=0;S<l.length;S++){if(D=l[S],H=D.instance,ne=D.currentTarget,D=D.listener,H!==g&&h.isPropagationStopped())break e;g=D,h.currentTarget=ne;try{g(h)}catch(he){Cc(he)}h.currentTarget=null,g=H}}}}function nt(t,r){var a=r[Mt];a===void 0&&(a=r[Mt]=new Set);var l=t+"__bubble";a.has(l)||(p2(r,t,2,!1),a.add(l))}function Gp(t,r,a){var l=0;r&&(l|=4),p2(a,t,l,r)}var du="_reactListening"+Math.random().toString(36).slice(2);function f2(t){if(!t[du]){t[du]=!0,zs.forEach(function(a){a!=="selectionchange"&&(uR.has(a)||Gp(a,!1,t),Gp(a,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[du]||(r[du]=!0,Gp("selectionchange",!1,r))}}function p2(t,r,a,l){switch(F2(r)){case 2:var h=FR;break;case 8:h=BR;break;default:h=uh}a=h.bind(null,r,a,t),h=void 0,!$s||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(h=!0),l?h===void 0?t.addEventListener(r,a,!0):t.addEventListener(r,a,{capture:!0,passive:h}):h===void 0?t.addEventListener(r,a,!1):t.addEventListener(r,a,{passive:h})}function Jp(t,r,a,l,h){var g=l;if(!(r&1)&&!(r&2)&&l!==null)e:for(;;){if(l===null)return;var S=l.tag;if(S===3||S===4){var D=l.stateNode.containerInfo;if(D===h)break;if(S===4)for(S=l.return;S!==null;){var H=S.tag;if((H===3||H===4)&&S.stateNode.containerInfo===h)return;S=S.return}for(;D!==null;){if(S=sr(D),S===null)return;if(H=S.tag,H===5||H===6||H===26||H===27){l=g=S;continue e}D=D.parentNode}}l=l.return}_c(function(){var ne=g,he=Hs(a),ge=[];e:{var ae=Qv.get(t);if(ae!==void 0){var ue=u,De=t;switch(t){case"keypress":if(Xa(a)===0)break e;case"keydown":case"keyup":ue=Re;break;case"focusin":De="focus",ue=z;break;case"focusout":De="blur",ue=z;break;case"beforeblur":case"afterblur":ue=z;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=O;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=L;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=dt;break;case $v:case Wv:case Uv:ue=q;break;case Kv:ue=Je;break;case"scroll":case"scrollend":ue=v;break;case"wheel":ue=Nt;break;case"copy":case"cut":case"paste":ue=oe;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=Ne;break;case"toggle":case"beforetoggle":ue=Ft}var Ie=(r&4)!=0,Ot=!Ie&&(t==="scroll"||t==="scrollend"),G=Ie?ae===null?null:ae+"Capture":ae;Ie=[];for(var U=ne,ee;U!==null;){var me=U;if(ee=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||ee===null||G===null||(me=Qa(U,G),me!=null&&Ie.push(_l(U,me,ee))),Ot)break;U=U.return}0<Ie.length&&(ae=new ue(ae,De,null,a,he),ge.push({event:ae,listeners:Ie}))}}if(!(r&7)){e:{if(ae=t==="mouseover"||t==="pointerover",ue=t==="mouseout"||t==="pointerout",ae&&a!==_n&&(De=a.relatedTarget||a.fromElement)&&(sr(De)||De[ot]))break e;if((ue||ae)&&(ae=he.window===he?he:(ae=he.ownerDocument)?ae.defaultView||ae.parentWindow:window,ue?(De=a.relatedTarget||a.toElement,ue=ne,De=De?sr(De):null,De!==null&&(Ot=d(De),Ie=De.tag,De!==Ot||Ie!==5&&Ie!==27&&Ie!==6)&&(De=null)):(ue=null,De=ne),ue!==De)){if(Ie=O,me="onMouseLeave",G="onMouseEnter",U="mouse",(t==="pointerout"||t==="pointerover")&&(Ie=Ne,me="onPointerLeave",G="onPointerEnter",U="pointer"),Ot=ue==null?ae:Bn(ue),ee=De==null?ae:Bn(De),ae=new Ie(me,U+"leave",ue,a,he),ae.target=Ot,ae.relatedTarget=ee,me=null,sr(he)===ne&&(Ie=new Ie(G,U+"enter",De,a,he),Ie.target=ee,Ie.relatedTarget=Ot,me=Ie),Ot=me,ue&&De)t:{for(Ie=dR,G=ue,U=De,ee=0,me=G;me;me=Ie(me))ee++;me=0;for(var Me=U;Me;Me=Ie(Me))me++;for(;0<ee-me;)G=Ie(G),ee--;for(;0<me-ee;)U=Ie(U),me--;for(;ee--;){if(G===U||U!==null&&G===U.alternate){Ie=G;break t}G=Ie(G),U=Ie(U)}Ie=null}else Ie=null;ue!==null&&h2(ge,ae,ue,Ie,!1),De!==null&&Ot!==null&&h2(ge,Ot,De,Ie,!0)}}e:{if(ae=ne?Bn(ne):window,ue=ae.nodeName&&ae.nodeName.toLowerCase(),ue==="select"||ue==="input"&&ae.type==="file")var vt=Lv;else if(Pv(ae))if(Nv)vt=_T;else{vt=bT;var Oe=vT}else ue=ae.nodeName,!ue||ue.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?ne&&Ka(ne.elementType)&&(vt=Lv):vt=wT;if(vt&&(vt=vt(t,ne))){Mv(ge,vt,a,he);break e}Oe&&Oe(t,ae,ne),t==="focusout"&&ne&&ae.type==="number"&&ne.memoizedProps.value!=null&&_i(ae,"number",ae.value)}switch(Oe=ne?Bn(ne):window,t){case"focusin":(Pv(Oe)||Oe.contentEditable==="true")&&(Ko=Oe,Ef=ne,Js=null);break;case"focusout":Js=Ef=Ko=null;break;case"mousedown":Tf=!0;break;case"contextmenu":case"mouseup":case"dragend":Tf=!1,Hv(ge,a,he);break;case"selectionchange":if(kT)break;case"keydown":case"keyup":Hv(ge,a,he)}var Qe;if($e)e:{switch(t){case"compositionstart":var at="onCompositionStart";break e;case"compositionend":at="onCompositionEnd";break e;case"compositionupdate":at="onCompositionUpdate";break e}at=void 0}else Uo?kc(t,a)&&(at="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(at="onCompositionStart");at&&(pn&&a.locale!=="ko"&&(Uo||at!=="onCompositionStart"?at==="onCompositionEnd"&&Uo&&(Qe=Ws()):(Wr=he,$o="value"in Wr?Wr.value:Wr.textContent,Uo=!0)),Oe=fu(ne,at),0<Oe.length&&(at=new ie(at,t,null,a,he),ge.push({event:at,listeners:Oe}),Qe?at.data=Qe:(Qe=Wo(a),Qe!==null&&(at.data=Qe)))),(Qe=rn?hT(t,a):mT(t,a))&&(at=fu(ne,"onBeforeInput"),0<at.length&&(Oe=new ie("onBeforeInput","beforeinput",null,a,he),ge.push({event:Oe,listeners:at}),Oe.data=Qe)),cR(ge,t,ne,a,he)}d2(ge,r)})}function _l(t,r,a){return{instance:t,listener:r,currentTarget:a}}function fu(t,r){for(var a=r+"Capture",l=[];t!==null;){var h=t,g=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||g===null||(h=Qa(t,a),h!=null&&l.unshift(_l(t,h,g)),h=Qa(t,r),h!=null&&l.push(_l(t,h,g))),t.tag===3)return l;t=t.return}return[]}function dR(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function h2(t,r,a,l,h){for(var g=r._reactName,S=[];a!==null&&a!==l;){var D=a,H=D.alternate,ne=D.stateNode;if(D=D.tag,H!==null&&H===l)break;D!==5&&D!==26&&D!==27||ne===null||(H=ne,h?(ne=Qa(a,g),ne!=null&&S.unshift(_l(a,ne,H))):h||(ne=Qa(a,g),ne!=null&&S.push(_l(a,ne,H)))),a=a.return}S.length!==0&&t.push({event:r,listeners:S})}var fR=/\r\n?/g,pR=/\u0000|\uFFFD/g;function m2(t){return(typeof t=="string"?t:""+t).replace(fR,`
10
+ `).replace(pR,"")}function g2(t,r){return r=m2(r),m2(t)===r}function Dt(t,r,a,l,h,g){switch(a){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||xi(t,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&xi(t,""+l);break;case"className":Ua(t,"class",l);break;case"tabIndex":Ua(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Ua(t,a,l);break;case"style":vc(t,l,g);break;case"data":if(r!=="object"){Ua(t,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||a!=="href")){t.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(a);break}l=Vo(""+l),t.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){t.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof g=="function"&&(a==="formAction"?(r!=="input"&&Dt(t,r,"name",h.name,h,null),Dt(t,r,"formEncType",h.formEncType,h,null),Dt(t,r,"formMethod",h.formMethod,h,null),Dt(t,r,"formTarget",h.formTarget,h,null)):(Dt(t,r,"encType",h.encType,h,null),Dt(t,r,"method",h.method,h,null),Dt(t,r,"target",h.target,h,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(a);break}l=Vo(""+l),t.setAttribute(a,l);break;case"onClick":l!=null&&(t.onclick=xr);break;case"onScroll":l!=null&&nt("scroll",t);break;case"onScrollEnd":l!=null&&nt("scrollend",t);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(h.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"multiple":t.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":t.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){t.removeAttribute("xlink:href");break}a=Vo(""+l),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,""+l):t.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":l===!0?t.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,l):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(a,l):t.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(a):t.setAttribute(a,l);break;case"popover":nt("beforetoggle",t),nt("toggle",t),Wa(t,"popover",l);break;case"xlinkActuate":Vr(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Vr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Vr(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Vr(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Vr(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Vr(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Vr(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Vr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Vr(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Wa(t,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Ho.get(a)||a,Wa(t,a,l))}}function Xp(t,r,a,l,h,g){switch(a){case"style":vc(t,l,g);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(h.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"children":typeof l=="string"?xi(t,l):(typeof l=="number"||typeof l=="bigint")&&xi(t,""+l);break;case"onScroll":l!=null&&nt("scroll",t);break;case"onScrollEnd":l!=null&&nt("scrollend",t);break;case"onClick":l!=null&&(t.onclick=xr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!pc.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(h=a.endsWith("Capture"),r=a.slice(2,h?a.length-7:void 0),g=t[Ve]||null,g=g==null?null:g[a],typeof g=="function"&&t.removeEventListener(r,g,h),typeof l=="function")){typeof g!="function"&&g!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(r,l,h);break e}a in t?t[a]=l:l===!0?t.setAttribute(a,""):Wa(t,a,l)}}}function Tn(t,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":nt("error",t),nt("load",t);var l=!1,h=!1,g;for(g in a)if(a.hasOwnProperty(g)){var S=a[g];if(S!=null)switch(g){case"src":l=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Dt(t,r,g,S,a,null)}}h&&Dt(t,r,"srcSet",a.srcSet,a,null),l&&Dt(t,r,"src",a.src,a,null);return;case"input":nt("invalid",t);var D=g=S=h=null,H=null,ne=null;for(l in a)if(a.hasOwnProperty(l)){var he=a[l];if(he!=null)switch(l){case"name":h=he;break;case"type":S=he;break;case"checked":H=he;break;case"defaultChecked":ne=he;break;case"value":g=he;break;case"defaultValue":D=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(s(137,r));break;default:Dt(t,r,l,he,a,null)}}yc(t,g,D,H,ne,S,h,!1);return;case"select":for(h in nt("invalid",t),l=S=g=null,a)if(a.hasOwnProperty(h)&&(D=a[h],D!=null))switch(h){case"value":g=D;break;case"defaultValue":S=D;break;case"multiple":l=D;default:Dt(t,r,h,D,a,null)}r=g,a=S,t.multiple=!!l,r==null?a!=null&&oa(t,!!l,a,!0):oa(t,!!l,r,!1);return;case"textarea":for(S in nt("invalid",t),g=h=l=null,a)if(a.hasOwnProperty(S)&&(D=a[S],D!=null))switch(S){case"value":l=D;break;case"defaultValue":h=D;break;case"children":g=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(s(91));break;default:Dt(t,r,S,D,a,null)}Bo(t,l,h,g);return;case"option":for(H in a)a.hasOwnProperty(H)&&(l=a[H],l!=null)&&(H==="selected"?t.selected=l&&typeof l!="function"&&typeof l!="symbol":Dt(t,r,H,l,a,null));return;case"dialog":nt("beforetoggle",t),nt("toggle",t),nt("cancel",t),nt("close",t);break;case"iframe":case"object":nt("load",t);break;case"video":case"audio":for(l=0;l<wl.length;l++)nt(wl[l],t);break;case"image":nt("error",t),nt("load",t);break;case"details":nt("toggle",t);break;case"embed":case"source":case"link":nt("error",t),nt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ne in a)if(a.hasOwnProperty(ne)&&(l=a[ne],l!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Dt(t,r,ne,l,a,null)}return;default:if(Ka(r)){for(he in a)a.hasOwnProperty(he)&&(l=a[he],l!==void 0&&Xp(t,r,he,l,a,void 0));return}}for(D in a)a.hasOwnProperty(D)&&(l=a[D],l!=null&&Dt(t,r,D,l,a,null))}function hR(t,r,a,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,g=null,S=null,D=null,H=null,ne=null,he=null;for(ue in a){var ge=a[ue];if(a.hasOwnProperty(ue)&&ge!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":H=ge;default:l.hasOwnProperty(ue)||Dt(t,r,ue,null,l,ge)}}for(var ae in l){var ue=l[ae];if(ge=a[ae],l.hasOwnProperty(ae)&&(ue!=null||ge!=null))switch(ae){case"type":g=ue;break;case"name":h=ue;break;case"checked":ne=ue;break;case"defaultChecked":he=ue;break;case"value":S=ue;break;case"defaultValue":D=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(s(137,r));break;default:ue!==ge&&Dt(t,r,ae,ue,l,ge)}}aa(t,S,D,H,ne,he,g,h);return;case"select":for(g in ue=S=D=ae=null,a)if(H=a[g],a.hasOwnProperty(g)&&H!=null)switch(g){case"value":break;case"multiple":ue=H;default:l.hasOwnProperty(g)||Dt(t,r,g,null,l,H)}for(h in l)if(g=l[h],H=a[h],l.hasOwnProperty(h)&&(g!=null||H!=null))switch(h){case"value":ae=g;break;case"defaultValue":D=g;break;case"multiple":S=g;default:g!==H&&Dt(t,r,h,g,l,H)}r=D,a=S,l=ue,ae==null?!!l!=!!a&&(r==null?oa(t,!!a,a?[]:"",!1):oa(t,!!a,r,!0)):oa(t,!!a,ae,!1);return;case"textarea":for(D in ue=ae=null,a)if(h=a[D],a.hasOwnProperty(D)&&h!=null&&!l.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:Dt(t,r,D,null,l,h)}for(S in l)if(h=l[S],g=a[S],l.hasOwnProperty(S)&&(h!=null||g!=null))switch(S){case"value":ae=h;break;case"defaultValue":ue=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(s(91));break;default:h!==g&&Dt(t,r,S,h,l,g)}sa(t,ae,ue);return;case"option":for(var De in a)ae=a[De],a.hasOwnProperty(De)&&ae!=null&&!l.hasOwnProperty(De)&&(De==="selected"?t.selected=!1:Dt(t,r,De,null,l,ae));for(H in l)ae=l[H],ue=a[H],l.hasOwnProperty(H)&&ae!==ue&&(ae!=null||ue!=null)&&(H==="selected"?t.selected=ae&&typeof ae!="function"&&typeof ae!="symbol":Dt(t,r,H,ae,l,ue));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ie in a)ae=a[Ie],a.hasOwnProperty(Ie)&&ae!=null&&!l.hasOwnProperty(Ie)&&Dt(t,r,Ie,null,l,ae);for(ne in l)if(ae=l[ne],ue=a[ne],l.hasOwnProperty(ne)&&ae!==ue&&(ae!=null||ue!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(s(137,r));break;default:Dt(t,r,ne,ae,l,ue)}return;default:if(Ka(r)){for(var Ot in a)ae=a[Ot],a.hasOwnProperty(Ot)&&ae!==void 0&&!l.hasOwnProperty(Ot)&&Xp(t,r,Ot,void 0,l,ae);for(he in l)ae=l[he],ue=a[he],!l.hasOwnProperty(he)||ae===ue||ae===void 0&&ue===void 0||Xp(t,r,he,ae,l,ue);return}}for(var G in a)ae=a[G],a.hasOwnProperty(G)&&ae!=null&&!l.hasOwnProperty(G)&&Dt(t,r,G,null,l,ae);for(ge in l)ae=l[ge],ue=a[ge],!l.hasOwnProperty(ge)||ae===ue||ae==null&&ue==null||Dt(t,r,ge,ae,l,ue)}function y2(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function mR(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var h=a[l],g=h.transferSize,S=h.initiatorType,D=h.duration;if(g&&D&&y2(S)){for(S=0,D=h.responseEnd,l+=1;l<a.length;l++){var H=a[l],ne=H.startTime;if(ne>D)break;var he=H.transferSize,ge=H.initiatorType;he&&y2(ge)&&(H=H.responseEnd,S+=he*(H<D?1:(D-ne)/(H-ne)))}if(--l,r+=8*(g+S)/(h.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Yp=null,Zp=null;function pu(t){return t.nodeType===9?t:t.ownerDocument}function v2(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function b2(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function eh(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var th=null;function gR(){var t=window.event;return t&&t.type==="popstate"?t===th?!1:(th=t,!0):(th=null,!1)}var w2=typeof setTimeout=="function"?setTimeout:void 0,yR=typeof clearTimeout=="function"?clearTimeout:void 0,_2=typeof Promise=="function"?Promise:void 0,vR=typeof queueMicrotask=="function"?queueMicrotask:_2===void 0?w2:function(t){return _2.resolve(null).then(t).catch(bR)};function bR(t){setTimeout(function(){throw t})}function xa(t){return t==="head"}function x2(t,r){var a=r,l=0;do{var h=a.nextSibling;if(t.removeChild(a),h&&h.nodeType===8)if(a=h.data,a==="/$"||a==="/&"){if(l===0){t.removeChild(h),ws(r);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")xl(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,xl(a);for(var g=a.firstChild;g;){var S=g.nextSibling,D=g.nodeName;g[ut]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&g.rel.toLowerCase()==="stylesheet"||a.removeChild(g),g=S}}else a==="body"&&xl(t.ownerDocument.body);a=h}while(a);ws(r)}function k2(t,r){var a=t;t=0;do{var l=a.nextSibling;if(a.nodeType===1?r?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(r?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=l}while(a)}function nh(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":nh(a),wn(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function wR(t,r,a,l){for(;t.nodeType===1;){var h=a;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[ut])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(g=t.getAttribute("rel"),g==="stylesheet"&&t.hasAttribute("data-precedence")||g!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(g=t.getAttribute("src"),(g!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&g&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var g=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===g)return t}else return t;if(t=Dr(t.nextSibling),t===null)break}return null}function _R(t,r,a){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Dr(t.nextSibling),t===null))return null;return t}function S2(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Dr(t.nextSibling),t===null))return null;return t}function rh(t){return t.data==="$?"||t.data==="$~"}function ih(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function xR(t,r){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||a.readyState!=="loading")r();else{var l=function(){r(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function Dr(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var ah=null;function C2(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(r===0)return Dr(t.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}t=t.nextSibling}return null}function E2(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(r===0)return t;r--}else a!=="/$"&&a!=="/&"||r++}t=t.previousSibling}return null}function T2(t,r,a){switch(r=pu(a),t){case"html":if(t=r.documentElement,!t)throw Error(s(452));return t;case"head":if(t=r.head,!t)throw Error(s(453));return t;case"body":if(t=r.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function xl(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);wn(t)}var Or=new Map,R2=new Set;function hu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Fi=Q.d;Q.d={f:kR,r:SR,D:CR,C:ER,L:TR,m:RR,X:OR,S:DR,M:PR};function kR(){var t=Fi.f(),r=au();return t||r}function SR(t){var r=ii(t);r!==null&&r.tag===5&&r.type==="form"?K1(r):Fi.r(t)}var ys=typeof document>"u"?null:document;function D2(t,r,a){var l=ys;if(l&&typeof r=="string"&&r){var h=lr(r);h='link[rel="'+t+'"][href="'+h+'"]',typeof a=="string"&&(h+='[crossorigin="'+a+'"]'),R2.has(h)||(R2.add(h),t={rel:t,crossOrigin:a,href:r},l.querySelector(h)===null&&(r=l.createElement("link"),Tn(r,"link",t),Xt(r),l.head.appendChild(r)))}}function CR(t){Fi.D(t),D2("dns-prefetch",t,null)}function ER(t,r){Fi.C(t,r),D2("preconnect",t,r)}function TR(t,r,a){Fi.L(t,r,a);var l=ys;if(l&&t&&r){var h='link[rel="preload"][as="'+lr(r)+'"]';r==="image"&&a&&a.imageSrcSet?(h+='[imagesrcset="'+lr(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(h+='[imagesizes="'+lr(a.imageSizes)+'"]')):h+='[href="'+lr(t)+'"]';var g=h;switch(r){case"style":g=vs(t);break;case"script":g=bs(t)}Or.has(g)||(t=C({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:t,as:r},a),Or.set(g,t),l.querySelector(h)!==null||r==="style"&&l.querySelector(kl(g))||r==="script"&&l.querySelector(Sl(g))||(r=l.createElement("link"),Tn(r,"link",t),Xt(r),l.head.appendChild(r)))}}function RR(t,r){Fi.m(t,r);var a=ys;if(a&&t){var l=r&&typeof r.as=="string"?r.as:"script",h='link[rel="modulepreload"][as="'+lr(l)+'"][href="'+lr(t)+'"]',g=h;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=bs(t)}if(!Or.has(g)&&(t=C({rel:"modulepreload",href:t},r),Or.set(g,t),a.querySelector(h)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Sl(g)))return}l=a.createElement("link"),Tn(l,"link",t),Xt(l),a.head.appendChild(l)}}}function DR(t,r,a){Fi.S(t,r,a);var l=ys;if(l&&t){var h=ra(l).hoistableStyles,g=vs(t);r||(r="default");var S=h.get(g);if(!S){var D={loading:0,preload:null};if(S=l.querySelector(kl(g)))D.loading=5;else{t=C({rel:"stylesheet",href:t,"data-precedence":r},a),(a=Or.get(g))&&oh(t,a);var H=S=l.createElement("link");Xt(H),Tn(H,"link",t),H._p=new Promise(function(ne,he){H.onload=ne,H.onerror=he}),H.addEventListener("load",function(){D.loading|=1}),H.addEventListener("error",function(){D.loading|=2}),D.loading|=4,mu(S,r,l)}S={type:"stylesheet",instance:S,count:1,state:D},h.set(g,S)}}}function OR(t,r){Fi.X(t,r);var a=ys;if(a&&t){var l=ra(a).hoistableScripts,h=bs(t),g=l.get(h);g||(g=a.querySelector(Sl(h)),g||(t=C({src:t,async:!0},r),(r=Or.get(h))&&sh(t,r),g=a.createElement("script"),Xt(g),Tn(g,"link",t),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(h,g))}}function PR(t,r){Fi.M(t,r);var a=ys;if(a&&t){var l=ra(a).hoistableScripts,h=bs(t),g=l.get(h);g||(g=a.querySelector(Sl(h)),g||(t=C({src:t,async:!0,type:"module"},r),(r=Or.get(h))&&sh(t,r),g=a.createElement("script"),Xt(g),Tn(g,"link",t),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(h,g))}}function O2(t,r,a,l){var h=(h=mt.current)?hu(h):null;if(!h)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(r=vs(a.href),a=ra(h).hoistableStyles,l=a.get(r),l||(l={type:"style",instance:null,count:0,state:null},a.set(r,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=vs(a.href);var g=ra(h).hoistableStyles,S=g.get(t);if(S||(h=h.ownerDocument||h,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(t,S),(g=h.querySelector(kl(t)))&&!g._p&&(S.instance=g,S.state.loading=5),Or.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Or.set(t,a),g||MR(h,t,a,S.state))),r&&l===null)throw Error(s(528,""));return S}if(r&&l!==null)throw Error(s(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=bs(a),a=ra(h).hoistableScripts,l=a.get(r),l||(l={type:"script",instance:null,count:0,state:null},a.set(r,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function vs(t){return'href="'+lr(t)+'"'}function kl(t){return'link[rel="stylesheet"]['+t+"]"}function P2(t){return C({},t,{"data-precedence":t.precedence,precedence:null})}function MR(t,r,a,l){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?l.loading=1:(r=t.createElement("link"),l.preload=r,r.addEventListener("load",function(){return l.loading|=1}),r.addEventListener("error",function(){return l.loading|=2}),Tn(r,"link",a),Xt(r),t.head.appendChild(r))}function bs(t){return'[src="'+lr(t)+'"]'}function Sl(t){return"script[async]"+t}function M2(t,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var l=t.querySelector('style[data-href~="'+lr(a.href)+'"]');if(l)return r.instance=l,Xt(l),l;var h=C({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Xt(l),Tn(l,"style",h),mu(l,a.precedence,t),r.instance=l;case"stylesheet":h=vs(a.href);var g=t.querySelector(kl(h));if(g)return r.state.loading|=4,r.instance=g,Xt(g),g;l=P2(a),(h=Or.get(h))&&oh(l,h),g=(t.ownerDocument||t).createElement("link"),Xt(g);var S=g;return S._p=new Promise(function(D,H){S.onload=D,S.onerror=H}),Tn(g,"link",l),r.state.loading|=4,mu(g,a.precedence,t),r.instance=g;case"script":return g=bs(a.src),(h=t.querySelector(Sl(g)))?(r.instance=h,Xt(h),h):(l=a,(h=Or.get(g))&&(l=C({},a),sh(l,h)),t=t.ownerDocument||t,h=t.createElement("script"),Xt(h),Tn(h,"link",l),t.head.appendChild(h),r.instance=h);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&!(r.state.loading&4)&&(l=r.instance,r.state.loading|=4,mu(l,a.precedence,t));return r.instance}function mu(t,r,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=l.length?l[l.length-1]:null,g=h,S=0;S<l.length;S++){var D=l[S];if(D.dataset.precedence===r)g=D;else if(g!==h)break}g?g.parentNode.insertBefore(t,g.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(t,r.firstChild))}function oh(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.title??(t.title=r.title)}function sh(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.integrity??(t.integrity=r.integrity)}var gu=null;function L2(t,r,a){if(gu===null){var l=new Map,h=gu=new Map;h.set(a,l)}else h=gu,l=h.get(a),l||(l=new Map,h.set(a,l));if(l.has(t))return l;for(l.set(t,null),a=a.getElementsByTagName(t),h=0;h<a.length;h++){var g=a[h];if(!(g[ut]||g[He]||t==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var S=g.getAttribute(r)||"";S=t+S;var D=l.get(S);D?D.push(g):l.set(S,[g])}}return l}function N2(t,r,a){t=t.ownerDocument||t,t.head.insertBefore(a,r==="title"?t.querySelector("head > title"):null)}function LR(t,r,a){if(a===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(t=r.disabled,typeof r.precedence=="string"&&t==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function I2(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}function NR(t,r,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&!(a.state.loading&4)){if(a.instance===null){var h=vs(l.href),g=r.querySelector(kl(h));if(g){r=g._p,typeof r=="object"&&r&&typeof r.then=="function"&&(t.count++,t=yu.bind(t),r.then(t,t)),a.state.loading|=4,a.instance=g,Xt(g);return}g=r.ownerDocument||r,l=P2(l),(h=Or.get(h))&&oh(l,h),g=g.createElement("link"),Xt(g);var S=g;S._p=new Promise(function(D,H){S.onload=D,S.onerror=H}),Tn(g,"link",l),a.instance=g}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,r),(r=a.state.preload)&&!(a.state.loading&3)&&(t.count++,a=yu.bind(t),r.addEventListener("load",a),r.addEventListener("error",a))}}var lh=0;function IR(t,r){return t.stylesheets&&t.count===0&&bu(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var l=setTimeout(function(){if(t.stylesheets&&bu(t,t.stylesheets),t.unsuspend){var g=t.unsuspend;t.unsuspend=null,g()}},6e4+r);0<t.imgBytes&&lh===0&&(lh=62500*mR());var h=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&bu(t,t.stylesheets),t.unsuspend)){var g=t.unsuspend;t.unsuspend=null,g()}},(t.imgBytes>lh?50:800)+r);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(h)}}:null}function yu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)bu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var vu=null;function bu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,vu=new Map,r.forEach(AR,t),vu=null,yu.call(t))}function AR(t,r){if(!(r.state.loading&4)){var a=vu.get(t);if(a)var l=a.get(null);else{a=new Map,vu.set(t,a);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<h.length;g++){var S=h[g];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(a.set(S.dataset.precedence,S),l=S)}l&&a.set(null,l)}h=r.instance,S=h.getAttribute("data-precedence"),g=a.get(S)||l,g===l&&a.set(null,h),a.set(S,h),this.count++,l=yu.bind(this),h.addEventListener("load",l),h.addEventListener("error",l),g?g.parentNode.insertBefore(h,g.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),r.state.loading|=4}}var Cl={$$typeof:K,Provider:null,Consumer:null,_currentValue:Le,_currentValue2:Le,_threadCount:0};function qR(t,r,a,l,h,g,S,D,H){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ri(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ri(0),this.hiddenUpdates=ri(null),this.identifierPrefix=l,this.onUncaughtError=h,this.onCaughtError=g,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function jR(t,r,a,l,h,g,S,D,H,ne,he,ge){return t=new qR(t,r,a,S,H,ne,he,ge,D),r=1,g===!0&&(r|=24),g=ur(3,null,null,r),t.current=g,g.stateNode=t,r=Hf(),r.refCount++,t.pooledCache=r,r.refCount++,g.memoizedState={element:l,isDehydrated:a,cache:r},Uf(g),t}function zR(t){return t?(t=Jo,t):Jo}function A2(t,r,a,l,h,g){h=zR(h),l.context===null?l.context=h:l.pendingContext=h,l=fo(r),l.payload={element:a},g=g===void 0?null:g,g!==null&&(l.callback=g),a=po(t,l,r),a!==null&&(Yn(a,t,r),rl(a,t,r))}function q2(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function ch(t,r){q2(t,r),(t=t.alternate)&&q2(t,r)}function j2(t){if(t.tag===13||t.tag===31){var r=no(t,67108864);r!==null&&Yn(r,t,67108864),ch(t,67108864)}}function z2(t){if(t.tag===13||t.tag===31){var r=Rr();r=Ye(r);var a=no(t,r);a!==null&&Yn(a,t,r),ch(t,r)}}var wu=!0;function FR(t,r,a,l){var h=se.T;se.T=null;var g=Q.p;try{Q.p=2,uh(t,r,a,l)}finally{Q.p=g,se.T=h}}function BR(t,r,a,l){var h=se.T;se.T=null;var g=Q.p;try{Q.p=8,uh(t,r,a,l)}finally{Q.p=g,se.T=h}}function uh(t,r,a,l){if(wu){var h=dh(l);if(h===null)Jp(t,r,l,_u,a),B2(t,l);else if(VR(h,t,r,a,l))l.stopPropagation();else if(B2(t,l),r&4&&-1<HR.indexOf(t)){for(;h!==null;){var g=ii(h);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var S=Mn(g.pendingLanes);if(S!==0){var D=g;for(D.pendingLanes|=2,D.entangledLanes|=2;S;){var H=1<<31-gt(S);D.entanglements[1]|=H,S&=~H}zi(g),!(yt&6)&&(ru=Ut()+500,bl(0,!1))}}break;case 31:case 13:D=no(g,2),D!==null&&Yn(D,g,2),au(),ch(g,2)}if(g=dh(l),g===null&&Jp(t,r,l,_u,a),g===h)break;h=g}h!==null&&l.stopPropagation()}else Jp(t,r,l,null,a)}}function dh(t){return t=Hs(t),fh(t)}var _u=null;function fh(t){if(_u=null,t=sr(t),t!==null){var r=d(t);if(r===null)t=null;else{var a=r.tag;if(a===13){if(t=f(r),t!==null)return t;t=null}else if(a===31){if(t=p(r),t!==null)return t;t=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return _u=t,null}function F2(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(yi()){case fn:return 2;case ni:return 8;case zt:case Br:return 32;case _t:return 268435456;default:return 32}default:return 32}}var ph=!1,ka=null,Sa=null,Ca=null,El=new Map,Tl=new Map,Ea=[],HR="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function B2(t,r){switch(t){case"focusin":case"focusout":ka=null;break;case"dragenter":case"dragleave":Sa=null;break;case"mouseover":case"mouseout":Ca=null;break;case"pointerover":case"pointerout":El.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Tl.delete(r.pointerId)}}function Rl(t,r,a,l,h,g){return t===null||t.nativeEvent!==g?(t={blockedOn:r,domEventName:a,eventSystemFlags:l,nativeEvent:g,targetContainers:[h]},r!==null&&(r=ii(r),r!==null&&j2(r)),t):(t.eventSystemFlags|=l,r=t.targetContainers,h!==null&&r.indexOf(h)===-1&&r.push(h),t)}function VR(t,r,a,l,h){switch(r){case"focusin":return ka=Rl(ka,t,r,a,l,h),!0;case"dragenter":return Sa=Rl(Sa,t,r,a,l,h),!0;case"mouseover":return Ca=Rl(Ca,t,r,a,l,h),!0;case"pointerover":var g=h.pointerId;return El.set(g,Rl(El.get(g)||null,t,r,a,l,h)),!0;case"gotpointercapture":return g=h.pointerId,Tl.set(g,Rl(Tl.get(g)||null,t,r,a,l,h)),!0}return!1}function H2(t){var r=sr(t.target);if(r!==null){var a=d(r);if(a!==null){if(r=a.tag,r===13){if(r=f(a),r!==null){t.blockedOn=r,ve(t.priority,function(){z2(a)});return}}else if(r===31){if(r=p(a),r!==null){t.blockedOn=r,ve(t.priority,function(){z2(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function xu(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var a=dh(t.nativeEvent);if(a===null){a=t.nativeEvent;var l=new a.constructor(a.type,a);_n=l,a.target.dispatchEvent(l),_n=null}else return r=ii(a),r!==null&&j2(r),t.blockedOn=a,!1;r.shift()}return!0}function V2(t,r,a){xu(t)&&a.delete(r)}function $R(){ph=!1,ka!==null&&xu(ka)&&(ka=null),Sa!==null&&xu(Sa)&&(Sa=null),Ca!==null&&xu(Ca)&&(Ca=null),El.forEach(V2),Tl.forEach(V2)}function ku(t,r){t.blockedOn===r&&(t.blockedOn=null,ph||(ph=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,$R)))}var Su=null;function $2(t){Su!==t&&(Su=t,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Su===t&&(Su=null);for(var r=0;r<t.length;r+=3){var a=t[r],l=t[r+1],h=t[r+2];if(typeof l!="function"){if(fh(l||a)===null)continue;break}var g=ii(a);g!==null&&(t.splice(r,3),r-=3,fp(g,{pending:!0,data:h,method:a.method,action:l},l,h))}}))}function ws(t){function r(H){return ku(H,t)}ka!==null&&ku(ka,t),Sa!==null&&ku(Sa,t),Ca!==null&&ku(Ca,t),El.forEach(r),Tl.forEach(r);for(var a=0;a<Ea.length;a++){var l=Ea[a];l.blockedOn===t&&(l.blockedOn=null)}for(;0<Ea.length&&(a=Ea[0],a.blockedOn===null);)H2(a),a.blockedOn===null&&Ea.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var h=a[l],g=a[l+1],S=h[Ve]||null;if(typeof g=="function")S||$2(a);else if(S){var D=null;if(g&&g.hasAttribute("formAction")){if(h=g,S=g[Ve]||null)D=S.formAction;else if(fh(h)!==null)continue}else D=S.action;typeof D=="function"?a[l+1]=D:(a.splice(l,3),l-=3),$2(a)}}}function WR(){function t(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(S){return h=S})},focusReset:"manual",scroll:"manual"})}function r(){h!==null&&(h(),h=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,h=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),h!==null&&(h(),h=null)}}}function hh(t){this._internalRoot=t}mh.prototype.render=hh.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(s(409));var a=r.current;A2(a,Rr(),t,r,null,null)},mh.prototype.unmount=hh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;A2(t.current,2,null,t,null,null),au(),r[ot]=null}};function mh(t){this._internalRoot=t}mh.prototype.unstable_scheduleHydration=function(t){if(t){var r=te();t={blockedOn:null,target:t,priority:r};for(var a=0;a<Ea.length&&r!==0&&r<Ea[a].priority;a++);Ea.splice(a,0,t),a===0&&H2(t)}};var W2=i.version;if(W2!=="19.2.4")throw Error(s(527,W2,"19.2.4"));Q.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=w(r),t=t===null?null:_(t),t=t===null?null:t.stateNode,t};var UR={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:se,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Cu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Cu.isDisabled&&Cu.supportsFiber)try{wr=Cu.inject(UR),Jt=Cu}catch{}}e.createRoot=function(t,r){if(!c(t))throw Error(s(299));var a=!1,l="",h=BT,g=HT,S=VT;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(g=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError)),r=jR(t,1,!1,null,null,a,l,null,h,g,S,WR),t[ot]=r.current,f2(t),new hh(r)}})),od=Ee(((e,n)=>{function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(o){console.error(o)}}i(),n.exports=Na()})),jm="Expected a function";function bx(e,n){var i;if(typeof n!="function")throw TypeError(jm);return e=s4(e),function(){return--e>0&&(i=n.apply(this,arguments)),e<=1&&(n=void 0),i}}var wx=bx;function _x(e){return wx(2,e)}let zm;xm=_x,zm=Math.max;function xx(e){if(!(e&&e.length))return[];var n=0;return e=l4(e,function(i){if(c4(i))return n=zm(i.length,n),!0}),a4(n,function(i){return o4(e,g4(i))})}var kx=u4(xx);bm=function(e,n){if(e==null)throw Error(n||`Expected value but got ${e}`)},BigInt.prototype.toJSON=function(){return JSON.rawJSON(this.toString())},vm=function(e){try{return JSON.parse(e,(n,i)=>md(i))}catch{}if(e==null||e==="")return{};try{return e??(e=""),e=e.replaceAll(new RegExp(`(?<=\\s|^|\\[|,|:)(NaN|-Infinity|Infinity)(?=(?:[^"'\\\\]*(\\\\.|'([^'\\\\]*\\\\.)*[^'\\\\]*'|"([^"\\\\]*\\\\.)*[^"\\\\]*"))*[^"']*$)`,"g"),'"\u25D0$1\u25D0"'),JSON.parse(e,(n,i)=>typeof i=="string"?i==="\u25D0NaN\u25D0"?NaN:i==="\u25D0Infinity\u25D0"?1/0:i==="\u25D0-Infinity\u25D0"?-1/0:md(i):md(i))}catch{return{}}};function Sx(e,n){return e==null?"":typeof e=="number"&&!Number.isNaN(e)?e.toLocaleString(n,{useGrouping:!1,maximumFractionDigits:20}):String(e)}tx=function(e,n){if(e.length===0)return"";let i=Object.keys(e[0]),o=e.map(s=>i.map(c=>Sx(s[c],n)).join(" "));return`${i.join(" ")}
11
11
  ${o.join(`
12
12
  `)}`},N_=function(e){if(e.length===0)return"";let n=Object.keys(e[0]);return[`| ${n.join(" | ")} |`,`|${n.map(()=>"---").join("|")}|`,...e.map(i=>`| ${n.map(o=>Cx(i[o])).join(" | ")} |`)].join(`
13
13
  `)};function Cx(e){if(e==null)return"";if(Array.isArray(e)||typeof e=="object")return Fm(JSON.stringify(e));let n=String(e),i=/\[([^\]]+)]\((https?:\/\/[^)]+)\)/g,o=new Map,s=0;n=n.replaceAll(i,c=>{let d=`__MDLINK_${s++}__`;return o.set(d,c),d}),n=n.replaceAll(/(https?:\/\/\S+)/g,"[$1]($1)");for(let[c,d]of o)n=n.replace(c,d);return Fm(n)}function Fm(e){return e.replaceAll("\\","\\\\").replaceAll("|","\\|").replaceAll(`
14
- `," ").replaceAll("\r","")}function md(e){return typeof e=="object"&&e&&"$bigint"in e&&typeof e.$bigint=="string"?BigInt(e.$bigint):e}var Bm="abcdefghijklmnopqrstuvwxyz",Hm=Bm+Bm.toUpperCase(),Vm=new Set;Rs="__scratch__",yr="setup",Ma={create(){let e=0,n;do{let i="";for(let o=0;o<4;o++)i+=Hm[Math.floor(Math.random()*Hm.length)];n=i,e++}while(Vm.has(n)&&e<100);if(e>=100)throw Error("Failed to generate unique CellId after 100 attempts");return Vm.add(n),n}},er={create(e){return In(e!=null,"cellId is required"),`cell-${e}`},parse(e){return e.slice(5)},findElement(e){return e.closest('div[id^="cell-"]')},findElementThroughShadowDOMs(e){let n=e;for(;n;){let i=er.findElement(n);if(i)return i;let o=n.getRootNode();if(n=o instanceof ShadowRoot?o.host:n.parentElement,n===o)break}return null}},Q_=function(e){let n=null,i=er.findElementThroughShadowDOMs(e);return i&&(n=er.parse(i.id)),n},od={parse(e){return e.getAttribute("object-id")},parseOrThrow(e){let n=od.parse(e);return In(n,"<marimo-ui-element/> missing object-id attribute"),n}},j_={create(e){return`output-${e}`}},bm=new class{getFilename(){return this.getSearchParam("filename")}setFilename(e){this.setSearchParam("filename",e)}getCodeFromSearchParam(){return this.getSearchParam("code")}getCodeFromHash(){let e=window.location.hash;return e.startsWith("#code/")?e.slice(6):null}setCodeForHash(e){window.location.hash=`#code/${e}`}setSearchParam(e,n){let i=new URL(window.location.href);i.searchParams.set(e,n),window.history.replaceState({},"",i.toString())}getSearchParam(e){return new URL(window.location.href).searchParams.get(e)}},$u=function(e){return gm(e??"")},Yw=function(e){return ui.mapValues(e.dataset,n=>typeof n=="string"?$u(n):n)},Rw=function(e,n){let i=e.parentElement?od.parse(e.parentElement):void 0;return i&&n.has(i)?n.lookupValue(i):$u(e.dataset.initialValue)},Bl=function(){if(v4())return document.title||null;if(vh()){let i=bm.getFilename();if(i)return i}let e=document.querySelector("marimo-filename");ym(e,"marimo-filename tag not found");let n=e.innerHTML;return n.length===0?null:n};var Ex=Symbol("");Vw=function(e,n){return ze(e,function(i,o,s){o(this,n(i(this),s))})};function gd(e,n){let i=null,o=new Map,s=new Set,c=f=>{let p;if(n===void 0)p=o.get(f);else for(let[w,_]of o)if(n(w,f)){p=_;break}if(p!==void 0)if(i!=null&&i(p[1],f))c.remove(f);else return p[0];let y=e(f);return o.set(f,[y,Date.now()]),d("CREATE",f,y),y},d=(f,p,y)=>{for(let w of s)w({type:f,param:p,atom:y})};return c.unstable_listen=f=>(s.add(f),()=>{s.delete(f)}),c.getParams=()=>o.keys(),c.remove=f=>{if(n===void 0){if(!o.has(f))return;let[p]=o.get(f);o.delete(f),d("REMOVE",f,p)}else for(let[p,[y]]of o)if(n(p,f)){o.delete(p),d("REMOVE",p,y);break}},c.setShouldRemove=f=>{if(i=f,i)for(let[p,[y,w]]of o)i(w,p)&&(o.delete(p),d("REMOVE",p,y))},c}var yd=(e,n,i)=>(n.has(i)?n:n.set(i,e())).get(i),Tx=new WeakMap,Rx=(e,n,i,o)=>yd(e,yd(()=>new WeakMap,yd(()=>new WeakMap,Tx,n),i),o);function Dx(e,n,i=Object.is){return Rx(()=>{let o=Symbol(),s=([d,f])=>{if(f===o)return n(d);let p=n(d,f);return i(f,p)?f:p},c=ze(d=>{let f=d(c);return s([d(e),f])});return c.init=o,c},e,n,i)}var $m=(e,n,i)=>(n.has(i)?n:n.set(i,e())).get(i),Ox=new WeakMap,Px=(e,n,i)=>$m(e,$m(()=>new WeakMap,Ox,n),i),Mx={},Wm=e=>!!e.write,Lx=e=>typeof e=="function";function Nx(e,n){return Px(()=>{let i=new WeakMap,o=(d,f)=>{let p=i.get(d);if(p)return p;let y=f&&i.get(f),w=[],_=[];return d.forEach((C,E)=>{let T=n?n(C):E;_[E]=T;let I=y&&y.atomList[y.keyList.indexOf(T)];if(I){w[E]=I;return}let $=V=>{let F=V(s),N=V(e),K=o(N,F==null?void 0:F.arr).keyList.indexOf(T);if(K<0||K>=N.length){let pe=d[o(d).keyList.indexOf(T)];if(pe)return pe;throw Error("splitAtom: index out of bounds for read")}return N[K]};w[E]=Wm(e)?ze($,(V,F,N)=>{let K=V(s),pe=V(e),P=o(pe,K==null?void 0:K.arr).keyList.indexOf(T);if(P<0||P>=pe.length)throw Error("splitAtom: index out of bounds for write");let A=Lx(N)?N(pe[P]):N;Object.is(pe[P],A)||F(e,[...pe.slice(0,P),A,...pe.slice(P+1)])}):ze($)}),p=y&&y.keyList.length===_.length&&y.keyList.every((C,E)=>C===_[E])?y:{arr:d,atomList:w,keyList:_},i.set(d,p),p},s=ze(d=>{let f=d(s);return o(d(e),f==null?void 0:f.arr)});s.init=void 0;let c=Wm(e)?ze(d=>d(s).atomList,(d,f,p)=>{switch(p.type){case"remove":{let y=d(c).indexOf(p.atom);if(y>=0){let w=d(e);f(e,[...w.slice(0,y),...w.slice(y+1)])}break}case"insert":{let y=p.before?d(c).indexOf(p.before):d(c).length;if(y>=0){let w=d(e);f(e,[...w.slice(0,y),p.value,...w.slice(y)])}break}case"move":{let y=d(c).indexOf(p.atom),w=p.before?d(c).indexOf(p.before):d(c).length;if(y>=0&&w>=0){let _=d(e);y<w?f(e,[..._.slice(0,y),..._.slice(y+1,w),_[y],..._.slice(w)]):f(e,[..._.slice(0,w),_[y],..._.slice(w,y),..._.slice(y+1)])}break}}}):ze(d=>d(s).atomList);return c},e,n||Mx)}var Um=e=>typeof(e==null?void 0:e.then)=="function";function Km(e=()=>{try{return window.localStorage}catch{return}},n){var f;let i,o,s={getItem:(p,y)=>{var C;let w=E=>{if(E||(E=""),i!==E){try{o=JSON.parse(E,n==null?void 0:n.reviver)}catch{return y}i=E}return o},_=((C=e())==null?void 0:C.getItem(p))??null;return Um(_)?_.then(w):w(_)},setItem:(p,y)=>{var w;return(w=e())==null?void 0:w.setItem(p,JSON.stringify(y,n==null?void 0:n.replacer))},removeItem:p=>{var y;return(y=e())==null?void 0:y.removeItem(p)}},c=p=>(y,w,_)=>p(y,C=>{let E;try{E=JSON.parse(C||"")}catch{E=_}w(E)}),d;try{d=(f=e())==null?void 0:f.subscribe}catch{}return!d&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(d=(p,y)=>{if(!(e()instanceof window.Storage))return()=>{};let w=_=>{_.storageArea===e()&&_.key===p&&y(_.newValue)};return window.addEventListener("storage",w),()=>{window.removeEventListener("storage",w)}}),d&&(s.subscribe=c(d)),s}var Ix=Km();Hl=function(e,n,i=Ix,o){let s=ze(o!=null&&o.getOnInit?i.getItem(e,n):n);return s.onMount=c=>{c(i.getItem(e,n));let d;return i.subscribe&&(d=i.subscribe(e,c,n)),d},ze(c=>c(s),(c,d,f)=>{let p=typeof f=="function"?f(c(s)):f;return p===Ex?(d(s,n),i.removeItem(e)):Um(p)?p.then(y=>(d(s,y),i.setItem(e,y))):(d(s,p),i.setItem(e,p))})},Wn=function(e){let n,i,o;return typeof e=="object"?(n=e.hashFunction,i=e.expiring,o=e.tags):n=e,(s,c,d)=>{if(d.value!=null)d.value=Qm(d.value,n,i,o);else if(d.get!=null)d.get=Qm(d.get,n,i,o);else throw"Only put a Memoize() decorator on a method or get accessor."}};var vd=new Map;function Qm(e,n,i=0,o){let s=Symbol("__memoized_map__");return function(...c){let d;this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let f=this[s];if(Array.isArray(o))for(let p of o)vd.has(p)?vd.get(p).push(f):vd.set(p,[f]);if(n||c.length>0||i>0){let p;p=n===!0?c.map(_=>_.toString()).join("!"):n?n.apply(this,c):c[0];let y=`${p}__timestamp`,w=!1;if(i>0)if(!f.has(y))w=!0;else{let _=f.get(y);w=Date.now()-_>i}f.has(p)&&!w?d=f.get(p):(d=e.apply(this,c),f.set(p,d),i>0&&f.set(y,Date.now()))}else{let p=this;f.has(p)?d=f.get(p):(d=e.apply(this,c),f.set(p,d))}return d}}Cs=ze(Bl()),Fw=ze(void 0);var Ax=class{constructor(){ke(this,"store",new Map)}get length(){return this.store.size}clear(){this.store.clear()}getItem(e){return this.store.get(e)||null}key(e){return[...this.store.keys()][e]||null}removeItem(e){this.store.delete(e)}setItem(e,n){this.store.set(e,n)}};function qx(){let{hasLocalStorage:e,hasSessionStorage:n}=rD();return e?window.localStorage:n?window.sessionStorage:new Ax}Ts=qx();let Qi;Bw=class{constructor(e,n=Ts){this.defaultValue=e,this.storage=n}get(e){try{let n=this.storage.getItem(e);return n?JSON.parse(n):this.defaultValue}catch{return this.defaultValue}}set(e,n){this.storage.setItem(e,JSON.stringify(n))}remove(e){this.storage.removeItem(e)}},Vu=class{constructor(e,n,i=Ts){this.schema=e,this.getDefaultValue=n,this.storage=i}get(e){try{let n=this.storage.getItem(e);if(n==null)return this.getDefaultValue();let i=this.schema.safeParse(JSON.parse(n));return i.success?i.data:(Se.warn("Error parsing zod local storage",i.error),this.getDefaultValue())}catch(n){return Se.warn("Error getting zod local storage",n),this.getDefaultValue()}}set(e,n){this.storage.setItem(e,JSON.stringify(n))}remove(e){this.storage.removeItem(e)}},rm=class extends Vu{constructor(e,n,i){let o=lt.get(Cs);super(n,i),this.filename=o;try{this.unsubscribeFromFilename=lt.sub(Cs,()=>{let s=lt.get(Cs);this.handleFilenameChange(e,s)})}catch{this.unsubscribeFromFilename=null}}get(e){return super.get(this.createScopedKey(e,this.filename))}set(e,n){super.set(this.createScopedKey(e,this.filename),n)}remove(e){super.remove(this.createScopedKey(e,this.filename))}createScopedKey(e,n){return n?`${e}:${n}`:e}handleFilenameChange(e,n){if(n&&n!==this.filename){let i=this.get(e);this.remove(e),this.filename=n,this.set(e,i)}}dispose(){this.unsubscribeFromFilename&&(this.unsubscribeFromFilename=(this.unsubscribeFromFilename(),null))}},Qi="marimo:notebook-col-sizes";function jx(){return{widths:[]}}var Eo=new rm(Qi,G2({widths:i4(t4([n4(),r4("contentWidth")]).default("contentWidth"))}),jx);Mw={getColumnWidth:e=>Eo.get(Qi).widths[e]??"contentWidth",saveColumnWidth:(e,n)=>{let i=Eo.get(Qi).widths;if(i[e])i[e]=n;else{for(;i.length<=e;)i.push("contentWidth");i[e]=n}Eo.set(Qi,{widths:i})},clearStorage:()=>{Eo.remove(Qi)}};function zx(e,n){let i=Eo.get(Qi).widths,o=Pl(i,e,n);Eo.set(Qi,{widths:o})}var Gm,Jm,Xm,Nr,Ym,Zm,e0,t0,Un,n0,r0,i0,a0,o0,s0,en;function tr(e,n,i,o,s){var c={};return Object.keys(o).forEach(function(d){c[d]=o[d]}),c.enumerable=!!c.enumerable,c.configurable=!!c.configurable,("value"in c||c.initializer)&&(c.writable=!0),c=i.slice().reverse().reduce(function(d,f){return f(e,n,d)||d},c),s&&c.initializer!==void 0&&(c.value=c.initializer?c.initializer.call(s):void 0,c.initializer=void 0),c.initializer===void 0?(Object.defineProperty(e,n,c),null):c}let Ia=(Gm=Wn(),Jm=Wn(),Xm=Wn(),Nr=class{constructor(e,n,i){this.value=e,this.isCollapsed=n,this.children=i}geDescendantCount(){let e=0,n=[...this.children];for(;n.length>0;){let i=n.pop();e++;for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}return e}getDescendants(){let e=[],n=[...this.children];for(;n.length>0;){let i=n.pop();e.push(i.value);for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}return e}get inOrderIds(){let e=[],n=i=>{e.push(i.value);for(let o of i.children)n(o)};for(let i of this.children)n(i);return e}toString(){return this.isCollapsed?`${this.value} (collapsed)`:String(this.value)}equals(e){return this.value===e.value}},tr(Nr.prototype,"geDescendantCount",[Gm],Object.getOwnPropertyDescriptor(Nr.prototype,"geDescendantCount"),Nr.prototype),tr(Nr.prototype,"getDescendants",[Jm],Object.getOwnPropertyDescriptor(Nr.prototype,"getDescendants"),Nr.prototype),tr(Nr.prototype,"inOrderIds",[Xm],Object.getOwnPropertyDescriptor(Nr.prototype,"inOrderIds"),Nr.prototype),Nr);var Fx=0;let To;To=(Ym=Wn(),Zm=Wn(),e0=Wn(),t0=Wn(),Un=class Co{constructor(n,i){this.nodes=n,this.id=i}static from(n){let i=`tree_${Fx++}`;return new Co(n.map(o=>new Ia(o,!1,[])),i)}static fromWithPreviousShape(n,i){var c;if(!i)return Co.from(n);let o=i.id,s=new Co(n.map(d=>new Ia(d,!1,[])),o);for(let d of n)if(i.isCollapsed(d)){let f=((c=i._nodeMap.get(d))==null?void 0:c.children)??[];for(let p=f.length-1;p>=0;p--){let y=f[p];if(s._nodeMap.has(y.value)){s=s.collapse(d,y.value);break}}}return s}withNodes(n){return new Co(n,this.id)}get topLevelIds(){return this.nodes.map(n=>n.value)}get inOrderIds(){return this.nodes.flatMap(n=>[n.value,...n.inOrderIds])}get idSet(){return new Set(this.inOrderIds)}get length(){return this.nodes.length}get _nodeMap(){let n=new Map;for(let i of this.nodes)n.set(i.value,i);return n}getDescendants(n){let i=this._nodeMap.get(n);return i?i.getDescendants():(Se.warn(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`),[])}isCollapsed(n){let i=this._nodeMap.get(n);return i?i.isCollapsed:(Se.warn(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`),!1)}indexOfOrThrow(n){let i=this.nodes.findIndex(o=>o.value===n);if(i===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);return i}slice(n,i){return this.nodes.slice(n,i).map(o=>o.value)}moveToFront(n){let i=this.indexOfOrThrow(n);return this.withNodes(Pl(this.nodes,i,0))}moveToBack(n){let i=this.indexOfOrThrow(n);return this.withNodes(Pl(this.nodes,i,this.nodes.length-1))}collapse(n,i){let o=this.nodes.findIndex(p=>p.value===n);if(o===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);let s=i===void 0?this.nodes.length:this.nodes.findIndex(p=>p.value===i);if(s===-1)throw Error(`Node ${i} not found in tree`);if(s<o)throw Error(`Node ${i} is before node ${n}`);let c=[...this.nodes],d=c[o];if(d.isCollapsed)throw Error(`Node ${n} is already collapsed`);let f=c.splice(o+1,s-o);return c[o]=new Ia(d.value,!0,f),this.withNodes(c)}collapseAll(n){let i=[...this.nodes];if(n.length===0)throw Error("No collapse ranges provided");if(n.length!==i.length)throw Error(`Collapse ranges length ${n.length} does not match tree length ${i.length}`);let o=i.length-1;for(;o>=0;){let s=i[o],c=n[o];if(!s.isCollapsed&&c){let{id:d,until:f}=c;if(d!==s.value)throw Error(`Node ${s.value} does not match collapse range id ${d}`);let p=f===void 0?i.length:i.findIndex(w=>w.value===f);if(p===-1)throw Error(`Node ${f} not found in tree`);if(p<o)throw Error(`Node ${f} is before node ${d}`);let y=i.splice(o+1,p-o);i[o]=new Ia(s.value,!0,y),o--}else o--}return this.withNodes(i)}expand(n){let i=this.nodes.findIndex(c=>c.value===n);if(i===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);let o=[...this.nodes],s=o[i];if(!s.isCollapsed)throw Error(`Node ${n} is already expanded`);return o[i]=new Ia(s.value,!1,[]),o=gw(o,i+1,s.children),this.withNodes(o)}expandAll(){let n=[...this.nodes],i=0;for(;i<n.length;){let o=n[i];o.isCollapsed&&(n[i]=new Ia(o.value,!1,[]),n=gw(n,i+1,o.children)),i++}return this.withNodes(n)}move(n,i){return this.withNodes(Pl(this.nodes,n,i))}at(n){var i;return(i=this.nodes.at(n))==null?void 0:i.value}atOrThrow(n){let i=this.nodes.at(n);if(i===void 0)throw Error(`Node at index ${n} not found in tree`);return i.value}first(){return this.atOrThrow(0)}last(){return this.atOrThrow(this.nodes.length-1)}after(n){let i=this.indexOfOrThrow(n);if(i!==this.nodes.length-1)return this.at(i+1)}before(n){let i=this.indexOfOrThrow(n);if(i!==0)return this.at(i-1)}insert(n,i){return this.withNodes(mw(this.nodes,i,new Ia(n,!1,[])))}insertAtEnd(n){return this.insert(n,this.nodes.length)}insertAtStart(n){return this.insert(n,0)}deleteAtIndex(n){let i=this.atOrThrow(n),o=this.withNodes(this.nodes);try{o=o.expand(i)}catch{}return this.withNodes(nD(o.nodes,n))}delete(n){let i=this.indexOfOrThrow(n);return this.deleteAtIndex(i)}getCount(n){var i;return((i=this._nodeMap.get(n))==null?void 0:i.geDescendantCount())??0}findAndExpandDeep(n){let i=this.find(n);if(i.length===0)return this;let o=this.withNodes(this.nodes);for(let s of i)try{o=o.expand(s)}catch{}return o}find(n){function i(o,s){for(let c of o){if(c.value===n)return[...s,n];let d=i(c.children,[...s,c.value]);if(d.length>0)return d}return[]}return i(this.nodes,[])}split(n){let i=this.nodes.findIndex(c=>c.value===n);if(i===-1)throw Error(`Node ${n} not found in tree`);let o=this.nodes.slice(0,i),s=this.nodes.slice(i);return o.length===0?[Co.from([]),this.withNodes(s)]:[this.withNodes(o),Co.from([]).withNodes(s)]}equals(n){return this.nodes.length===n.nodes.length&&this.nodes.every((i,o)=>i.value===n.nodes[o].value)}toString(){let n=0,i="",o=s=>{for(let c of s)i+=`${" ".repeat(n*2)}${c.toString()}
15
- `,n+=1,o(c.children),--n};return o(this.nodes),i}},tr(Un.prototype,"topLevelIds",[Ym],Object.getOwnPropertyDescriptor(Un.prototype,"topLevelIds"),Un.prototype),tr(Un.prototype,"inOrderIds",[Zm],Object.getOwnPropertyDescriptor(Un.prototype,"inOrderIds"),Un.prototype),tr(Un.prototype,"idSet",[e0],Object.getOwnPropertyDescriptor(Un.prototype,"idSet"),Un.prototype),tr(Un.prototype,"_nodeMap",[t0],Object.getOwnPropertyDescriptor(Un.prototype,"_nodeMap"),Un.prototype),Un),Ql=(n0=Wn(),r0=Wn(),i0=Wn(),a0=Wn(),o0=Wn(),s0=Wn(),en=class An{constructor(n){this.columns=n,n.length===0&&(this.columns=[To.from([])])}static from(n){return new An(n.map(i=>To.from(i)))}static fromWithPreviousShape(n,i){if(!i)return An.from([n]);let o=i.getColumns(),s=Array.from({length:o.length},()=>[]),c=0;for(let d of n){let f=o.findIndex(p=>p.idSet.has(d));f===-1?s[c].push(d):(c=f,s[f].push(d))}return new An(s.map((d,f)=>To.fromWithPreviousShape(d,o[f])))}isEmpty(){return this.columns.length===0?!0:this.columns.every(n=>n.nodes.length===0)}static fromIdsAndColumns(n){let i=Math.max(1,...n.map(([,c])=>(c??0)+1)),o=Array.from({length:i},()=>[]),s=0;for(let[c,d]of n)d==null||d<0?o[s].push(c):(o[d].push(c),s=d);return An.from(o)}get topLevelIds(){return this.columns.map(n=>n.topLevelIds)}get iterateTopLevelIds(){let n=this.columns;function*i(){for(let o of n)for(let s of o.topLevelIds)yield s}return i()}get inOrderIds(){return this.columns.flatMap(n=>n.inOrderIds)}get colLength(){return this.columns.length}get idLength(){return this.columns.reduce((n,i)=>n+i.nodes.length,0)}get _columnMap(){return new Map(this.columns.map(n=>[n.id,n]))}at(n){return this.columns[n]}get(n){return this._columnMap.get(n)}atOrThrow(n){let i=this.columns[n];if(!i)throw Error(`Column ${n} not found`);return i}hasOnlyOneColumn(){return this.columns.length===1}getColumns(){return this.columns}hasOnlyOneId(){return this.idLength===1}getColumnIds(){return this.columns.map(n=>n.id)}indexOf(n){return this.columns.indexOf(n)}addColumn(n,i=[]){return new An(this.columns.flatMap(o=>o.id===n?[o,To.from(i)]:[o]))}insertBreakpoint(n){let i=this.findWithId(n),[o,s]=i.split(n);return new An(this.columns.flatMap(c=>c===i?[o,s].filter(Boolean):[c]))}delete(n){if(this.columns.length<=1)return this;let i=this.indexOfOrThrow(n),o=i===0?1:i-1,s=[...this.columns],c=s[i];return s[o]=c.withNodes([...s[o].nodes,...c.nodes]),s.splice(i,1),new An(s)}mergeAllColumns(){if(this.columns.length<=1)return this;let n=this.columns.flatMap(o=>o.nodes),i=this.columns[0];return new An([i.withNodes(n)])}moveWithinColumn(n,i,o){return this.transform(n,s=>s.move(i,o))}moveAcrossColumns(n,i,o,s){let c=this.indexOfOrThrow(n),d=this.indexOfOrThrow(o),f=[...this.columns],p=f[c],y=p.nodes.findIndex(C=>C.value===i);if(y===-1)throw Error(`Node ${i} not found in column ${n}`);let w=p.nodes[y];f[c]=p.withNodes(p.nodes.filter((C,E)=>E!==y));let _=f[d];if(s){let C=_.indexOfOrThrow(s);f[d]=_.withNodes(mw(_.nodes,C,w))}else f[d]=_.withNodes([w,..._.nodes]);return new An(f)}indexOfOrThrow(n){let i=this.columns.findIndex(o=>o.id===n);if(i===-1)throw Error(`Column ${n} not found. Possible values: ${this.getColumnIds().join(", ")}`);return i}moveColumn(n,i){if(n===i)return this;let o=this.indexOfOrThrow(n),s=i==="_left_"?o-1:i==="_right_"?o+1:this.indexOfOrThrow(i);return zx(o,s),new An(Pl([...this.columns],o,s))}moveToNewColumn(n){let i=this.findWithId(n),o=this.columns.map(c=>c.id===i.id?c.delete(n):c),s=To.from([n]);return new An([...o,s])}findWithId(n){let i=this.columns.find(o=>o.inOrderIds.includes(n));if(!i)throw Se.log(`Possible values: ${this.columns.map(o=>o.inOrderIds).join(", ")}`),Error(`Cell ${n} not found in any column`);return i}transformWithCellId(n,i){let o=!1,s=this.columns.map(c=>{if(c.inOrderIds.includes(n)){let d=i(c);return c!==d&&(o=!0),d}return c});return o?new An(s):this}setupCellExists(){return this.columns.some(n=>n.topLevelIds.includes(yr))}insertId(n,i,o){return this.transform(i,s=>s.insert(n,o))}deleteById(n){return this.transformWithCellId(n,i=>i.delete(n))}compact(){return this.columns.length===1||!this.columns.some(n=>n.nodes.length===0)?this:new An(this.columns.filter(n=>n.nodes.length>0))}transform(n,i){let o=this._columnMap.get(n);if(!o)return Se.warn(`Column ${n} not found`),this;let s=i(o);return o===s?this:new An(this.columns.map(c=>c.id===n?s:c))}transformAll(n){let i=!1,o=this.columns.map(s=>{let c=n(s);return s.equals(c)||(i=!0),c});return i?new An(o):this}},tr(en.prototype,"isEmpty",[n0],Object.getOwnPropertyDescriptor(en.prototype,"isEmpty"),en.prototype),tr(en.prototype,"topLevelIds",[r0],Object.getOwnPropertyDescriptor(en.prototype,"topLevelIds"),en.prototype),tr(en.prototype,"inOrderIds",[i0],Object.getOwnPropertyDescriptor(en.prototype,"inOrderIds"),en.prototype),tr(en.prototype,"idLength",[a0],Object.getOwnPropertyDescriptor(en.prototype,"idLength"),en.prototype),tr(en.prototype,"_columnMap",[o0],Object.getOwnPropertyDescriptor(en.prototype,"_columnMap"),en.prototype),tr(en.prototype,"getColumnIds",[s0],Object.getOwnPropertyDescriptor(en.prototype,"getColumnIds"),en.prototype),en);let bd,wd,_d,l0,xd,c0,u0,d0,f0,kd,Sd,p0,Cd,Ed;bd=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Doctype=e.CDATA=e.Tag=e.Style=e.Script=e.Comment=e.Directive=e.Text=e.Root=e.isTag=e.ElementType=void 0;var n;(function(o){o.Root="root",o.Text="text",o.Directive="directive",o.Comment="comment",o.Script="script",o.Style="style",o.Tag="tag",o.CDATA="cdata",o.Doctype="doctype"})(n=e.ElementType||(e.ElementType={}));function i(o){return o.type===n.Tag||o.type===n.Script||o.type===n.Style}e.isTag=i,e.Root=n.Root,e.Text=n.Text,e.Directive=n.Directive,e.Comment=n.Comment,e.Script=n.Script,e.Style=n.Style,e.Tag=n.Tag,e.CDATA=n.CDATA,e.Doctype=n.Doctype})),wd=Ee((e=>{var n=e&&e.__extends||(function(){var P=function(A,W){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(de,fe){de.__proto__=fe}||function(de,fe){for(var we in fe)Object.prototype.hasOwnProperty.call(fe,we)&&(de[we]=fe[we])},P(A,W)};return function(A,W){if(typeof W!="function"&&W!==null)throw TypeError("Class extends value "+String(W)+" is not a constructor or null");P(A,W);function de(){this.constructor=A}A.prototype=W===null?Object.create(W):(de.prototype=W.prototype,new de)}})(),i=e&&e.__assign||function(){return i=Object.assign||function(P){for(var A,W=1,de=arguments.length;W<de;W++)for(var fe in A=arguments[W],A)Object.prototype.hasOwnProperty.call(A,fe)&&(P[fe]=A[fe]);return P},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.cloneNode=e.hasChildren=e.isDocument=e.isDirective=e.isComment=e.isText=e.isCDATA=e.isTag=e.Element=e.Document=e.CDATA=e.NodeWithChildren=e.ProcessingInstruction=e.Comment=e.Text=e.DataNode=e.Node=void 0;var o=bd(),s=(function(){function P(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(P.prototype,"parentNode",{get:function(){return this.parent},set:function(A){this.parent=A},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"previousSibling",{get:function(){return this.prev},set:function(A){this.prev=A},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"nextSibling",{get:function(){return this.next},set:function(A){this.next=A},enumerable:!1,configurable:!0}),P.prototype.cloneNode=function(A){return A===void 0&&(A=!1),K(this,A)},P})();e.Node=s;var c=(function(P){n(A,P);function A(W){var de=P.call(this)||this;return de.data=W,de}return Object.defineProperty(A.prototype,"nodeValue",{get:function(){return this.data},set:function(W){this.data=W},enumerable:!1,configurable:!0}),A})(s);e.DataNode=c;var d=(function(P){n(A,P);function A(){var W=P!==null&&P.apply(this,arguments)||this;return W.type=o.ElementType.Text,W}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),A})(c);e.Text=d;var f=(function(P){n(A,P);function A(){var W=P!==null&&P.apply(this,arguments)||this;return W.type=o.ElementType.Comment,W}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),A})(c);e.Comment=f;var p=(function(P){n(A,P);function A(W,de){var fe=P.call(this,de)||this;return fe.name=W,fe.type=o.ElementType.Directive,fe}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),A})(c);e.ProcessingInstruction=p;var y=(function(P){n(A,P);function A(W){var de=P.call(this)||this;return de.children=W,de}return Object.defineProperty(A.prototype,"firstChild",{get:function(){return this.children[0]??null},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"childNodes",{get:function(){return this.children},set:function(W){this.children=W},enumerable:!1,configurable:!0}),A})(s);e.NodeWithChildren=y;var w=(function(P){n(A,P);function A(){var W=P!==null&&P.apply(this,arguments)||this;return W.type=o.ElementType.CDATA,W}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),A})(y);e.CDATA=w;var _=(function(P){n(A,P);function A(){var W=P!==null&&P.apply(this,arguments)||this;return W.type=o.ElementType.Root,W}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),A})(y);e.Document=_;var C=(function(P){n(A,P);function A(W,de,fe,we){fe===void 0&&(fe=[]),we===void 0&&(we=W==="script"?o.ElementType.Script:W==="style"?o.ElementType.Style:o.ElementType.Tag);var J=P.call(this,fe)||this;return J.name=W,J.attribs=de,J.type=we,J}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"tagName",{get:function(){return this.name},set:function(W){this.name=W},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"attributes",{get:function(){var W=this;return Object.keys(this.attribs).map(function(de){var fe,we;return{name:de,value:W.attribs[de],namespace:(fe=W["x-attribsNamespace"])==null?void 0:fe[de],prefix:(we=W["x-attribsPrefix"])==null?void 0:we[de]}})},enumerable:!1,configurable:!0}),A})(y);e.Element=C;function E(P){return(0,o.isTag)(P)}e.isTag=E;function T(P){return P.type===o.ElementType.CDATA}e.isCDATA=T;function I(P){return P.type===o.ElementType.Text}e.isText=I;function $(P){return P.type===o.ElementType.Comment}e.isComment=$;function V(P){return P.type===o.ElementType.Directive}e.isDirective=V;function F(P){return P.type===o.ElementType.Root}e.isDocument=F;function N(P){return Object.prototype.hasOwnProperty.call(P,"children")}e.hasChildren=N;function K(P,A){A===void 0&&(A=!1);var W;if(I(P))W=new d(P.data);else if($(P))W=new f(P.data);else if(E(P)){var de=A?pe(P.children):[],fe=new C(P.name,i({},P.attribs),de);de.forEach(function(Ce){return Ce.parent=fe}),P.namespace!=null&&(fe.namespace=P.namespace),P["x-attribsNamespace"]&&(fe["x-attribsNamespace"]=i({},P["x-attribsNamespace"])),P["x-attribsPrefix"]&&(fe["x-attribsPrefix"]=i({},P["x-attribsPrefix"])),W=fe}else if(T(P)){var de=A?pe(P.children):[],we=new w(de);de.forEach(function(Z){return Z.parent=we}),W=we}else if(F(P)){var de=A?pe(P.children):[],J=new _(de);de.forEach(function(Z){return Z.parent=J}),P["x-mode"]&&(J["x-mode"]=P["x-mode"]),W=J}else if(V(P)){var be=new p(P.name,P.data);P["x-name"]!=null&&(be["x-name"]=P["x-name"],be["x-publicId"]=P["x-publicId"],be["x-systemId"]=P["x-systemId"]),W=be}else throw Error(`Not implemented yet: ${P.type}`);return W.startIndex=P.startIndex,W.endIndex=P.endIndex,P.sourceCodeLocation!=null&&(W.sourceCodeLocation=P.sourceCodeLocation),W}e.cloneNode=K;function pe(P){for(var A=P.map(function(de){return K(de,!0)}),W=1;W<A.length;W++)A[W].prev=A[W-1],A[W-1].next=A[W];return A}})),_d=Ee((e=>{var n=e&&e.__createBinding||(Object.create?(function(f,p,y,w){w===void 0&&(w=y);var _=Object.getOwnPropertyDescriptor(p,y);(!_||("get"in _?!p.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return p[y]}}),Object.defineProperty(f,w,_)}):(function(f,p,y,w){w===void 0&&(w=y),f[w]=p[y]})),i=e&&e.__exportStar||function(f,p){for(var y in f)y!=="default"&&!Object.prototype.hasOwnProperty.call(p,y)&&n(p,f,y)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var o=bd(),s=wd();i(wd(),e);var c={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},d=(function(){function f(p,y,w){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof y=="function"&&(w=y,y=c),typeof p=="object"&&(y=p,p=void 0),this.callback=p??null,this.options=y??c,this.elementCB=w??null}return f.prototype.onparserinit=function(p){this.parser=p},f.prototype.onreset=function(){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},f.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},f.prototype.onerror=function(p){this.handleCallback(p)},f.prototype.onclosetag=function(){this.lastNode=null;var p=this.tagStack.pop();this.options.withEndIndices&&(p.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(p)},f.prototype.onopentag=function(p,y){var w=this.options.xmlMode?o.ElementType.Tag:void 0,_=new s.Element(p,y,void 0,w);this.addNode(_),this.tagStack.push(_)},f.prototype.ontext=function(p){var y=this.lastNode;if(y&&y.type===o.ElementType.Text)y.data+=p,this.options.withEndIndices&&(y.endIndex=this.parser.endIndex);else{var w=new s.Text(p);this.addNode(w),this.lastNode=w}},f.prototype.oncomment=function(p){if(this.lastNode&&this.lastNode.type===o.ElementType.Comment){this.lastNode.data+=p;return}var y=new s.Comment(p);this.addNode(y),this.lastNode=y},f.prototype.oncommentend=function(){this.lastNode=null},f.prototype.oncdatastart=function(){var p=new s.Text(""),y=new s.CDATA([p]);this.addNode(y),p.parent=y,this.lastNode=p},f.prototype.oncdataend=function(){this.lastNode=null},f.prototype.onprocessinginstruction=function(p,y){var w=new s.ProcessingInstruction(p,y);this.addNode(w)},f.prototype.handleCallback=function(p){if(typeof this.callback=="function")this.callback(p,this.dom);else if(p)throw p},f.prototype.addNode=function(p){var y=this.tagStack[this.tagStack.length-1],w=y.children[y.children.length-1];this.options.withStartIndices&&(p.startIndex=this.parser.startIndex),this.options.withEndIndices&&(p.endIndex=this.parser.endIndex),y.children.push(p),w&&(p.prev=w,w.next=p),p.parent=y,this.lastNode=null},f})();e.DomHandler=d,e.default=d})),l0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=e.CARRIAGE_RETURN_PLACEHOLDER=e.CARRIAGE_RETURN_REGEX=e.CARRIAGE_RETURN=e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES=void 0,e.CASE_SENSITIVE_TAG_NAMES="animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.linearGradient.radialGradient.textPath".split("."),e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES.reduce(function(n,i){return n[i.toLowerCase()]=i,n},{}),e.CARRIAGE_RETURN="\r",e.CARRIAGE_RETURN_REGEX=new RegExp(e.CARRIAGE_RETURN,"g"),e.CARRIAGE_RETURN_PLACEHOLDER=`__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_${Date.now()}__`,e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(e.CARRIAGE_RETURN_PLACEHOLDER,"g")})),xd=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatAttributes=s,e.escapeSpecialCharacters=d,e.revertEscapedCharacters=f,e.formatDOM=p;var n=_d(),i=l0();function o(y){return i.CASE_SENSITIVE_TAG_NAMES_MAP[y]}function s(y){for(var w={},_=0,C=y.length;_<C;_++){var E=y[_];w[E.name]=E.value}return w}function c(y){return y=y.toLowerCase(),o(y)||y}function d(y){return y.replace(i.CARRIAGE_RETURN_REGEX,i.CARRIAGE_RETURN_PLACEHOLDER)}function f(y){return y.replace(i.CARRIAGE_RETURN_PLACEHOLDER_REGEX,i.CARRIAGE_RETURN)}function p(y,w,_){w===void 0&&(w=null);for(var C=[],E,T=0,I=y.length;T<I;T++){var $=y[T];switch($.nodeType){case 1:var V=c($.nodeName);E=new n.Element(V,s($.attributes)),E.children=p(V==="template"?$.content.childNodes:$.childNodes,E);break;case 3:E=new n.Text(f($.nodeValue));break;case 8:E=new n.Comment($.nodeValue);break;default:continue}var F=C[T-1]||null;F&&(F.next=E),E.parent=w,E.prev=F,E.next=null,C.push(E)}return _&&(E=new n.ProcessingInstruction(_.substring(0,_.indexOf(" ")).toLowerCase(),_),E.next=C[0]||null,E.parent=w,C.unshift(E),C[1]&&(C[1].prev=C[0])),C}})),c0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=$;var n=xd(),i="html",o="head",s="body",c=/<([a-zA-Z]+[0-9]?)/,d=/<head[^]*>/i,f=/<body[^]*>/i,p=function(V,F){throw Error("This browser does not support `document.implementation.createHTMLDocument`")},y=function(V,F){throw Error("This browser does not support `DOMParser.prototype.parseFromString`")},w=typeof window=="object"&&window.DOMParser;if(typeof w=="function"){var _=new w,C="text/html";y=function(V,F){return F&&(V=`<${F}>${V}</${F}>`),_.parseFromString(V,C)},p=y}if(typeof document=="object"&&document.implementation){var E=document.implementation.createHTMLDocument();p=function(V,F){if(F){var N=E.documentElement.querySelector(F);return N&&(N.innerHTML=V),E}return E.documentElement.innerHTML=V,E}}var T=typeof document=="object"&&document.createElement("template"),I;T&&T.content&&(I=function(V){return T.innerHTML=V,T.content.childNodes});function $(V){var F,N;V=(0,n.escapeSpecialCharacters)(V);var K=V.match(c),pe=K&&K[1]?K[1].toLowerCase():"";switch(pe){case i:var P=y(V);if(!d.test(V)){var W=P.querySelector(o);(F=W==null?void 0:W.parentNode)==null||F.removeChild(W)}if(!f.test(V)){var W=P.querySelector(s);(N=W==null?void 0:W.parentNode)==null||N.removeChild(W)}return P.querySelectorAll(i);case o:case s:var A=p(V).querySelectorAll(pe);return f.test(V)&&d.test(V)?A[0].parentNode.childNodes:A;default:if(I)return I(V);var W=p(V,s).querySelector(s);return W.childNodes}}})),u0=Ee((e=>{var n=e&&e.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var i=n(c0()),o=xd(),s=/<(![a-zA-Z\s]+)>/;function c(d){if(typeof d!="string")throw TypeError("First argument must be a string");if(!d)return[];var f=d.match(s),p=f?f[1]:void 0;return(0,o.formatDOM)((0,i.default)(d),null,p)}})),d0=Ee((e=>{e.SAME=0,e.CAMELCASE=1,e.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}})),f0=Ee((e=>{var n=0,i=1,o=2,s=3,c=4,d=5,f=6;function p(N){return w.hasOwnProperty(N)?w[N]:null}function y(N,K,pe,P,A,W,de){this.acceptsBooleans=K===o||K===s||K===c,this.attributeName=P,this.attributeNamespace=A,this.mustUseProperty=pe,this.propertyName=N,this.type=K,this.sanitizeURL=W,this.removeEmptyString=de}var w={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(N=>{w[N]=new y(N,n,!1,N,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([N,K])=>{w[N]=new y(N,i,!1,K,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(N=>{w[N]=new y(N,o,!1,N.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(N=>{w[N]=new y(N,o,!1,N,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(N=>{w[N]=new y(N,s,!1,N.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(N=>{w[N]=new y(N,s,!0,N,null,!1,!1)}),["capture","download"].forEach(N=>{w[N]=new y(N,c,!1,N,null,!1,!1)}),["cols","rows","size","span"].forEach(N=>{w[N]=new y(N,f,!1,N,null,!1,!1)}),["rowSpan","start"].forEach(N=>{w[N]=new y(N,d,!1,N.toLowerCase(),null,!1,!1)});var _=/[\-\:]([a-z])/g,C=N=>N[1].toUpperCase();"accent-height.alignment-baseline.arabic-form.baseline-shift.cap-height.clip-path.clip-rule.color-interpolation.color-interpolation-filters.color-profile.color-rendering.dominant-baseline.enable-background.fill-opacity.fill-rule.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.glyph-name.glyph-orientation-horizontal.glyph-orientation-vertical.horiz-adv-x.horiz-origin-x.image-rendering.letter-spacing.lighting-color.marker-end.marker-mid.marker-start.overline-position.overline-thickness.paint-order.panose-1.pointer-events.rendering-intent.shape-rendering.stop-color.stop-opacity.strikethrough-position.strikethrough-thickness.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.text-anchor.text-decoration.text-rendering.underline-position.underline-thickness.unicode-bidi.unicode-range.units-per-em.v-alphabetic.v-hanging.v-ideographic.v-mathematical.vector-effect.vert-adv-y.vert-origin-x.vert-origin-y.word-spacing.writing-mode.xmlns:xlink.x-height".split(".").forEach(N=>{let K=N.replace(_,C);w[K]=new y(K,i,!1,N,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(N=>{let K=N.replace(_,C);w[K]=new y(K,i,!1,N,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(N=>{let K=N.replace(_,C);w[K]=new y(K,i,!1,N,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(N=>{w[N]=new y(N,i,!1,N.toLowerCase(),null,!1,!1)});var E="xlinkHref";w[E]=new y("xlinkHref",i,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(N=>{w[N]=new y(N,i,!1,N.toLowerCase(),null,!0,!0)});var{CAMELCASE:T,SAME:I,possibleStandardNames:$}=d0(),V=RegExp.prototype.test.bind(RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),F=Object.keys($).reduce((N,K)=>{let pe=$[K];return pe===I?N[K]=K:pe===T?N[K.toLowerCase()]=K:N[K]=pe,N},{});e.BOOLEAN=s,e.BOOLEANISH_STRING=o,e.NUMERIC=d,e.OVERLOADED_BOOLEAN=c,e.POSITIVE_NUMERIC=f,e.RESERVED=n,e.STRING=i,e.getPropertyInfo=p,e.isCustomAttribute=V,e.possibleStandardNames=F})),kd=Ee((e=>{var n=e&&e.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.returnFirstArg=e.canTextBeChildOfNode=e.ELEMENTS_WITH_NO_TEXT_CHILDREN=e.PRESERVE_CUSTOM_ATTRIBUTES=void 0,e.isCustomComponent=c,e.setStyleProp=f;var i=Ru(),o=n(iD()),s=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function c(p,y){return p.includes("-")?!s.has(p):!!(y&&typeof y.is=="string")}var d={reactCompat:!0};function f(p,y){if(typeof p=="string"){if(!p.trim()){y.style={};return}try{y.style=(0,o.default)(p,d)}catch{y.style={}}}}e.PRESERVE_CUSTOM_ATTRIBUTES=Number(i.version.split(".")[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]),e.canTextBeChildOfNode=function(p){return!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(p.name)},e.returnFirstArg=function(p){return p}})),Sd=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var n=f0(),i=kd(),o=["checked","value"],s=["input","select","textarea"],c={reset:!0,submit:!0};function d(p,y){p===void 0&&(p={});var w={},_=!!(p.type&&c[p.type]);for(var C in p){var E=p[C];if((0,n.isCustomAttribute)(C)){w[C]=E;continue}var T=C.toLowerCase(),I=f(T);if(I){var $=(0,n.getPropertyInfo)(I);switch(o.includes(I)&&s.includes(y)&&!_&&(I=f("default"+T)),w[I]=E,$&&$.type){case n.BOOLEAN:w[I]=!0;break;case n.OVERLOADED_BOOLEAN:E===""&&(w[I]=!0);break}continue}i.PRESERVE_CUSTOM_ATTRIBUTES&&(w[C]=E)}return(0,i.setStyleProp)(p.style,w),w}function f(p){return n.possibleStandardNames[p]}})),p0=Ee((e=>{var n=e&&e.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var i=Ru(),o=n(Sd()),s=kd(),c={cloneElement:i.cloneElement,createElement:i.createElement,isValidElement:i.isValidElement};function d(p,y){y===void 0&&(y={});for(var w=[],_=typeof y.replace=="function",C=y.transform||s.returnFirstArg,E=y.library||c,T=E.cloneElement,I=E.createElement,$=E.isValidElement,V=p.length,F=0;F<V;F++){var N=p[F];if(_){var K=y.replace(N,F);if($(K)){V>1&&(K=T(K,{key:K.key||F})),w.push(C(K,N,F));continue}}if(N.type==="text"){var pe=!N.data.trim().length;if(pe&&N.parent&&!(0,s.canTextBeChildOfNode)(N.parent)||y.trim&&pe)continue;w.push(C(N.data,N,F));continue}var P=N,A={};f(P)?((0,s.setStyleProp)(P.attribs.style,P.attribs),A=P.attribs):P.attribs&&(A=(0,o.default)(P.attribs,P.name));var W=void 0;switch(N.type){case"script":case"style":N.children[0]&&(A.dangerouslySetInnerHTML={__html:N.children[0].data});break;case"tag":N.name==="textarea"&&N.children[0]?A.defaultValue=N.children[0].data:N.children&&N.children.length&&(W=d(N.children,y));break;default:continue}V>1&&(A.key=F),w.push(C(I(N.name,A,W),N,F))}return w.length===1?w[0]:w}function f(p){return s.PRESERVE_CUSTOM_ATTRIBUTES&&p.type==="tag"&&(0,s.isCustomComponent)(p.name,p.attribs)}})),Cd=Ee((e=>{var n=e&&e.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToDOM=e.domToReact=e.attributesToProps=e.Text=e.ProcessingInstruction=e.Element=e.Comment=void 0,e.default=d;var i=n(u0());e.htmlToDOM=i.default,e.attributesToProps=n(Sd()).default;var o=n(p0());e.domToReact=o.default;var s=_d();Object.defineProperty(e,"Comment",{enumerable:!0,get:function(){return s.Comment}}),Object.defineProperty(e,"Element",{enumerable:!0,get:function(){return s.Element}}),Object.defineProperty(e,"ProcessingInstruction",{enumerable:!0,get:function(){return s.ProcessingInstruction}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return s.Text}});var c={lowerCaseAttributeNames:!1};function d(f,p){if(typeof f!="string")throw TypeError("First argument must be a string");return f?(0,o.default)((0,i.default)(f,(p==null?void 0:p.htmlparser2)||c),p):[]}})),Ed=gh(Cd(),1),Pa=Cd(),Kh=Ed.default.default||Ed.default;let Gl;Gl=(e,n)=>{let[i,...o]=n.split("."),s=(e.attribs.class||"").split(" ");return e.tagName===i&&o.every(c=>s.includes(c))},Xw=e=>{var n;return e&&Gl(e,"span.nb")&&e.firstChild instanceof Pa.Text&&((n=e.firstChild.nodeValue)==null?void 0:n.includes("__marimo__"))},Bh=function(e){var n,i,o;if(e instanceof Pa.Element&&e.firstChild instanceof Pa.Text&&Gl(e,"span.nb")){let s=e.next;if(s&&s instanceof Pa.Text){let c=s.next;if(c&&c instanceof Pa.Element&&c.firstChild instanceof Pa.Text&&Gl(c,"span.m")){let d=Number.parseInt(c.firstChild.nodeValue||"0",10);if((n=e.firstChild.nodeValue)!=null&&n.includes("__marimo__")){let f=(i=/__marimo__cell_(\w+)_/.exec(e.firstChild.nodeValue))==null?void 0:i[1];if(f&&d)return{kind:"cell",cellId:f,lineNumber:d}}else{let f=(o=/"(.+?)"/.exec(e.firstChild.nodeValue))==null?void 0:o[1];if(f&&d)return{kind:"file",filePath:f,lineNumber:d}}}}}return null},Ih=function(e){let n=[];return Kh(e,{replace:i=>{let o=Bh(i);if(o)return n.push(o),"dummy"}}),n};function h0(e){return n=>{let i=!1;for(let o of n)o&&(i=e(o)||i);return i}}const Bx=h0(R4),Hx=h0(D4);let Td,m0,Ro,g0,Do,y0;Td=Ee(((e,n)=>{var i=typeof Reflect=="object"?Reflect:null,o=i&&typeof i.apply=="function"?i.apply:function(P,A,W){return Function.prototype.apply.call(P,A,W)},s=i&&typeof i.ownKeys=="function"?i.ownKeys:Object.getOwnPropertySymbols?function(P){return Object.getOwnPropertyNames(P).concat(Object.getOwnPropertySymbols(P))}:function(P){return Object.getOwnPropertyNames(P)};function c(P){console&&console.warn&&console.warn(P)}var d=Number.isNaN||function(P){return P!==P};function f(){f.init.call(this)}n.exports=f,n.exports.once=N,f.EventEmitter=f,f.prototype._events=void 0,f.prototype._eventsCount=0,f.prototype._maxListeners=void 0;var p=10;function y(P){if(typeof P!="function")throw TypeError('The "listener" argument must be of type Function. Received type '+typeof P)}Object.defineProperty(f,"defaultMaxListeners",{enumerable:!0,get:function(){return p},set:function(P){if(typeof P!="number"||P<0||d(P))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+P+".");p=P}}),f.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},f.prototype.setMaxListeners=function(P){if(typeof P!="number"||P<0||d(P))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+P+".");return this._maxListeners=P,this};function w(P){return P._maxListeners===void 0?f.defaultMaxListeners:P._maxListeners}f.prototype.getMaxListeners=function(){return w(this)},f.prototype.emit=function(P){for(var A=[],W=1;W<arguments.length;W++)A.push(arguments[W]);var de=P==="error",fe=this._events;if(fe!==void 0)de&&(de=fe.error===void 0);else if(!de)return!1;if(de){var we;if(A.length>0&&(we=A[0]),we instanceof Error)throw we;var J=Error("Unhandled error."+(we?" ("+we.message+")":""));throw J.context=we,J}var be=fe[P];if(be===void 0)return!1;if(typeof be=="function")o(be,this,A);else for(var Ce=be.length,Z=$(be,Ce),W=0;W<Ce;++W)o(Z[W],this,A);return!0};function _(P,A,W,de){var fe,we,J;if(y(W),we=P._events,we===void 0?(we=P._events=Object.create(null),P._eventsCount=0):(we.newListener!==void 0&&(P.emit("newListener",A,W.listener?W.listener:W),we=P._events),J=we[A]),J===void 0)J=we[A]=W,++P._eventsCount;else if(typeof J=="function"?J=we[A]=de?[W,J]:[J,W]:de?J.unshift(W):J.push(W),fe=w(P),fe>0&&J.length>fe&&!J.warned){J.warned=!0;var be=Error("Possible EventEmitter memory leak detected. "+J.length+" "+String(A)+" listeners added. Use emitter.setMaxListeners() to increase limit");be.name="MaxListenersExceededWarning",be.emitter=P,be.type=A,be.count=J.length,c(be)}return P}f.prototype.addListener=function(P,A){return _(this,P,A,!1)},f.prototype.on=f.prototype.addListener,f.prototype.prependListener=function(P,A){return _(this,P,A,!0)};function C(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function E(P,A,W){var de={fired:!1,wrapFn:void 0,target:P,type:A,listener:W},fe=C.bind(de);return fe.listener=W,de.wrapFn=fe,fe}f.prototype.once=function(P,A){return y(A),this.on(P,E(this,P,A)),this},f.prototype.prependOnceListener=function(P,A){return y(A),this.prependListener(P,E(this,P,A)),this},f.prototype.removeListener=function(P,A){var W,de,fe,we,J;if(y(A),de=this._events,de===void 0||(W=de[P],W===void 0))return this;if(W===A||W.listener===A)--this._eventsCount===0?this._events=Object.create(null):(delete de[P],de.removeListener&&this.emit("removeListener",P,W.listener||A));else if(typeof W!="function"){for(fe=-1,we=W.length-1;we>=0;we--)if(W[we]===A||W[we].listener===A){J=W[we].listener,fe=we;break}if(fe<0)return this;fe===0?W.shift():V(W,fe),W.length===1&&(de[P]=W[0]),de.removeListener!==void 0&&this.emit("removeListener",P,J||A)}return this},f.prototype.off=f.prototype.removeListener,f.prototype.removeAllListeners=function(P){var A,W=this._events,de;if(W===void 0)return this;if(W.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):W[P]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete W[P]),this;if(arguments.length===0){var fe=Object.keys(W),we;for(de=0;de<fe.length;++de)we=fe[de],we!=="removeListener"&&this.removeAllListeners(we);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(A=W[P],typeof A=="function")this.removeListener(P,A);else if(A!==void 0)for(de=A.length-1;de>=0;de--)this.removeListener(P,A[de]);return this};function T(P,A,W){var de=P._events;if(de===void 0)return[];var fe=de[A];return fe===void 0?[]:typeof fe=="function"?W?[fe.listener||fe]:[fe]:W?F(fe):$(fe,fe.length)}f.prototype.listeners=function(P){return T(this,P,!0)},f.prototype.rawListeners=function(P){return T(this,P,!1)},f.listenerCount=function(P,A){return typeof P.listenerCount=="function"?P.listenerCount(A):I.call(P,A)},f.prototype.listenerCount=I;function I(P){var A=this._events;if(A!==void 0){var W=A[P];if(typeof W=="function")return 1;if(W!==void 0)return W.length}return 0}f.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]};function $(P,A){for(var W=Array(A),de=0;de<A;++de)W[de]=P[de];return W}function V(P,A){for(;A+1<P.length;A++)P[A]=P[A+1];P.pop()}function F(P){for(var A=Array(P.length),W=0;W<A.length;++W)A[W]=P[W].listener||P[W];return A}function N(P,A){return new Promise(function(W,de){function fe(J){P.removeListener(A,we),de(J)}function we(){typeof P.removeListener=="function"&&P.removeListener("error",fe),W([].slice.call(arguments))}pe(P,A,we,{once:!0}),A!=="error"&&K(P,fe,{once:!0})})}function K(P,A,W){typeof P.on=="function"&&pe(P,"error",A,W)}function pe(P,A,W,de){if(typeof P.on=="function")de.once?P.once(A,W):P.on(A,W);else if(typeof P.addEventListener=="function")P.addEventListener(A,function fe(we){de.once&&P.removeEventListener(A,fe),W(we)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof P)}})),m0=Ee((e=>{var n=e&&e.__awaiter||function(s,c,d,f){function p(y){return y instanceof d?y:new d(function(w){w(y)})}return new(d||(d=Promise))(function(y,w){function _(T){try{E(f.next(T))}catch(I){w(I)}}function C(T){try{E(f.throw(T))}catch(I){w(I)}}function E(T){T.done?y(T.value):p(T.value).then(_,C)}E((f=f.apply(s,c||[])).next())})},i=e&&e.__generator||function(s,c){var d={label:0,sent:function(){if(y[0]&1)throw y[1];return y[1]},trys:[],ops:[]},f,p,y,w;return w={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(w[Symbol.iterator]=function(){return this}),w;function _(E){return function(T){return C([E,T])}}function C(E){if(f)throw TypeError("Generator is already executing.");for(;d;)try{if(f=1,p&&(y=E[0]&2?p.return:E[0]?p.throw||((y=p.return)&&y.call(p),0):p.next)&&!(y=y.call(p,E[1])).done)return y;switch(p=0,y&&(E=[E[0]&2,y.value]),E[0]){case 0:case 1:y=E;break;case 4:return d.label++,{value:E[1],done:!1};case 5:d.label++,p=E[1],E=[0];continue;case 7:E=d.ops.pop(),d.trys.pop();continue;default:if(y=d.trys,!(y=y.length>0&&y[y.length-1])&&(E[0]===6||E[0]===2)){d=0;continue}if(E[0]===3&&(!y||E[1]>y[0]&&E[1]<y[3])){d.label=E[1];break}if(E[0]===6&&d.label<y[1]){d.label=y[1],y=E;break}if(y&&d.label<y[2]){d.label=y[2],d.ops.push(E);break}y[2]&&d.ops.pop(),d.trys.pop();continue}E=c.call(s,d)}catch(T){E=[6,T],p=0}finally{f=y=0}if(E[0]&5)throw E[1];return{value:E[0]?E[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.defaultNextRequest=void 0;var o=Td();e.defaultNextRequest=function(){var s=-1;return function(){return++s}},e.default=(function(){function s(c,d){d===void 0&&(d=e.defaultNextRequest()),this.batch=[],this.batchStarted=!1,this.lastId=-1,this.transports=c,this.requests={},this.connectPromise=this.connect(),this.requestChannel=new o.EventEmitter,this.nextID=d}return s.prototype.connect=function(){var c=this;return Promise.all(this.transports.map(function(d){return n(c,void 0,void 0,function(){return i(this,function(f){switch(f.label){case 0:return d.subscribe("error",this.handleError.bind(this)),d.subscribe("notification",this.handleNotification.bind(this)),[4,d.connect()];case 1:return f.sent(),[2]}})})}))},s.prototype.getPrimaryTransport=function(){return this.transports[0]},s.prototype.request=function(c,d,f){return d===void 0&&(d=!1),n(this,void 0,void 0,function(){var p,y,w,_,C=this;return i(this,function(E){return p=this.nextID().toString(),y=d?null:p,w={request:this.makeRequest(c.method,c.params||[],y),internalID:p},this.batchStarted?(_=new Promise(function(T,I){C.batch.push({resolve:T,reject:I,request:w})}),[2,_]):[2,this.getPrimaryTransport().sendData(w,f)]})})},s.prototype.close=function(){this.requestChannel.removeAllListeners(),this.transports.forEach(function(c){c.unsubscribe(),c.close()})},s.prototype.startBatch=function(){this.batchStarted=!0},s.prototype.stopBatch=function(){if(this.batchStarted===!1)throw Error("cannot end that which has never started");if(this.batch.length===0){this.batchStarted=!1;return}this.getPrimaryTransport().sendData(this.batch),this.batch=[],this.batchStarted=!1},s.prototype.makeRequest=function(c,d,f){return f?{jsonrpc:"2.0",id:f,method:c,params:d}:{jsonrpc:"2.0",method:c,params:d}},s.prototype.handleError=function(c){this.requestChannel.emit("error",c)},s.prototype.handleNotification=function(c){this.requestChannel.emit("notification",c)},s})()})),Ro=Ee((e=>{var n=e&&e.__extends||(function(){var o=function(s,c){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var p in f)f.hasOwnProperty(p)&&(d[p]=f[p])},o(s,c)};return function(s,c){o(s,c);function d(){this.constructor=s}s.prototype=c===null?Object.create(c):(d.prototype=c.prototype,new d)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.convertJSONToRPCError=e.JSONRPCError=e.ERR_UNKNOWN=e.ERR_MISSIING_ID=e.ERR_TIMEOUT=void 0,e.ERR_TIMEOUT=7777,e.ERR_MISSIING_ID=7878,e.ERR_UNKNOWN=7979;var i=(function(o){n(s,o);function s(c,d,f){var p=this.constructor,y=o.call(this,c)||this;return y.message=c,y.code=d,y.data=f,Object.setPrototypeOf(y,p.prototype),y}return s})(Error);e.JSONRPCError=i,e.convertJSONToRPCError=function(o){if(o.error){var s=o.error,c=s.message,d=s.code,f=s.data;return new i(c,d,f)}return new i("Unknown error",e.ERR_UNKNOWN,o)}})),g0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TransportRequestManager=void 0;var n=Td(),i=Ro();e.TransportRequestManager=(function(){function o(){this.pendingRequest={},this.pendingBatchRequest={},this.transportEventChannel=new n.EventEmitter}return o.prototype.addRequest=function(s,c){return this.transportEventChannel.emit("pending",s),s instanceof Array?(this.addBatchReq(s,c),Promise.resolve()):this.addReq(s.internalID,c)},o.prototype.settlePendingRequest=function(s,c){var d=this;s.forEach(function(f){var p=d.pendingRequest[f.internalID];if(delete d.pendingBatchRequest[f.internalID],p!==void 0){if(c){p.reject(c);return}p.resolve(),(f.request.id===null||f.request.id===void 0)&&delete d.pendingRequest[f.internalID]}})},o.prototype.isPendingRequest=function(s){return this.pendingRequest.hasOwnProperty(s)},o.prototype.resolveResponse=function(s,c){c===void 0&&(c=!0);var d=s;try{return d=JSON.parse(s),this.checkJSONRPC(d)===!1?void 0:d instanceof Array?this.resolveBatch(d,c):this.resolveRes(d,c)}catch{var f=new i.JSONRPCError("Bad response format",i.ERR_UNKNOWN,s);return c&&this.transportEventChannel.emit("error",f),f}},o.prototype.addBatchReq=function(s,c){var d=this;return s.forEach(function(f){var p=f.resolve,y=f.reject,w=f.request.internalID;d.pendingBatchRequest[w]=!0,d.pendingRequest[w]={resolve:p,reject:y}}),Promise.resolve()},o.prototype.addReq=function(s,c){var d=this;return new Promise(function(f,p){c!==null&&c&&d.setRequestTimeout(s,c,p),d.pendingRequest[s]={resolve:f,reject:p}})},o.prototype.checkJSONRPC=function(s){var c=[s];return s instanceof Array&&(c=s),c.every(function(d){return d.result!==void 0||d.error!==void 0||d.method!==void 0})},o.prototype.processResult=function(s,c){if(s.error){var d=i.convertJSONToRPCError(s);c.reject(d);return}c.resolve(s.result)},o.prototype.resolveBatch=function(s,c){var d=this,f=s.map(function(p){return d.resolveRes(p,c)}).filter(function(p){return p});if(f.length>0)return f[0]},o.prototype.resolveRes=function(s,c){var d=s.id,f=s.error,p=this.pendingRequest[d];if(p){delete this.pendingRequest[d],this.processResult(s,p),this.transportEventChannel.emit("response",s);return}if(d===void 0&&f===void 0){this.transportEventChannel.emit("notification",s);return}var y;return f&&(y=i.convertJSONToRPCError(s)),c&&f&&y&&this.transportEventChannel.emit("error",y),y},o.prototype.setRequestTimeout=function(s,c,d){var f=this;setTimeout(function(){delete f.pendingRequest[s],d(new i.JSONRPCError("Request timeout request took longer than "+c+" ms to resolve",i.ERR_TIMEOUT))},c)},o})()})),Oa=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Transport=void 0;var n=g0();e.Transport=(function(){function i(){this.transportRequestManager=new n.TransportRequestManager,this.transportRequestManager.transportEventChannel.on("error",function(){})}return i.prototype.subscribe=function(o,s){this.transportRequestManager.transportEventChannel.addListener(o,s)},i.prototype.unsubscribe=function(o,s){if(!o)return this.transportRequestManager.transportEventChannel.removeAllListeners();o&&s&&this.transportRequestManager.transportEventChannel.removeListener(o,s)},i.prototype.parseData=function(o){return o instanceof Array?o.map(function(s){return s.request.request}):o.request},i})()})),Do=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getNotifications=e.getBatchRequests=e.isNotification=void 0,e.isNotification=function(n){return n.request.id===void 0||n.request.id===null},e.getBatchRequests=function(n){return n instanceof Array?n.filter(function(i){return i.request.request.id!=null}).map(function(i){return i.request}):[]},e.getNotifications=function(n){return n instanceof Array?n.filter(function(i){return e.isNotification(i.request)}).map(function(i){return i.request}):e.isNotification(n)?[n]:[]}})),y0=Ee((e=>{var n=e&&e.__extends||(function(){var c=function(d,f){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,y){p.__proto__=y}||function(p,y){for(var w in y)y.hasOwnProperty(w)&&(p[w]=y[w])},c(d,f)};return function(d,f){c(d,f);function p(){this.constructor=d}d.prototype=f===null?Object.create(f):(p.prototype=f.prototype,new p)}})();Object.defineProperty(e,"__esModule",{value:!0});var i=Oa(),o=Do(),s=Ro();e.default=(function(c){n(d,c);function d(f,p,y){var w=c.call(this)||this;return w.connection=f,w.reqUri=p,w.resUri=y,w}return d.prototype.connect=function(){var f=this;return this.connection.on(this.resUri,function(p){f.transportRequestManager.resolveResponse(p)}),Promise.resolve()},d.prototype.sendData=function(f,p){p===void 0&&(p=null);var y=this.transportRequestManager.addRequest(f,p),w=o.getNotifications(f),_=this.parseData(f);try{return this.connection.emit(this.reqUri,_),this.transportRequestManager.settlePendingRequest(w),y}catch(E){var C=new s.JSONRPCError(E.message,s.ERR_UNKNOWN,E);return this.transportRequestManager.settlePendingRequest(w,C),Promise.reject(C)}},d.prototype.close=function(){this.connection.removeAllListeners()},d})(i.Transport)}));function Vx(e){return e&&DataView.prototype.isPrototypeOf(e)}function Oo(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Rd(e){return typeof e!="string"&&(e=String(e)),e}function Dd(e){var n={next:function(){var i=e.shift();return{done:i===void 0,value:i}}};return Rn.iterable&&(n[Symbol.iterator]=function(){return n}),n}function cn(e){this.map={},e instanceof cn?e.forEach(function(n,i){this.append(i,n)},this):Array.isArray(e)?e.forEach(function(n){if(n.length!=2)throw TypeError("Headers constructor: expected name/value pair to be length 2, found"+n.length);this.append(n[0],n[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(n){this.append(n,e[n])},this)}function Od(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}}function v0(e){return new Promise(function(n,i){e.onload=function(){n(e.result)},e.onerror=function(){i(e.error)}})}function $x(e){var n=new FileReader,i=v0(n);return n.readAsArrayBuffer(e),i}function Wx(e){var n=new FileReader,i=v0(n),o=/charset=([A-Za-z0-9_-]+)/.exec(e.type),s=o?o[1]:"utf-8";return n.readAsText(e,s),i}function Ux(e){for(var n=new Uint8Array(e),i=Array(n.length),o=0;o<n.length;o++)i[o]=String.fromCharCode(n[o]);return i.join("")}function b0(e){if(e.slice)return e.slice(0);var n=new Uint8Array(e.byteLength);return n.set(new Uint8Array(e)),n.buffer}function w0(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:Rn.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Rn.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Rn.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Rn.arrayBuffer&&Rn.blob&&Vx(e)?(this._bodyArrayBuffer=b0(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Rn.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||k0(e))?this._bodyArrayBuffer=b0(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Rn.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Rn.blob&&(this.blob=function(){var e=Od(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return Od(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(Rn.blob)return this.blob().then($x);throw Error("could not read as ArrayBuffer")},this.text=function(){var e=Od(this);if(e)return e;if(this._bodyBlob)return Wx(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Ux(this._bodyArrayBuffer));if(this._bodyFormData)throw Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Rn.formData&&(this.formData=function(){return this.text().then(Qx)}),this.json=function(){return this.text().then(JSON.parse)},this}function Kx(e){var n=e.toUpperCase();return S0.indexOf(n)>-1?n:e}function Aa(e,n){if(!(this instanceof Aa))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');n||(n={});var i=n.body;if(e instanceof Aa){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,n.headers||(this.headers=new cn(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!i&&e._bodyInit!=null&&(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=n.credentials||this.credentials||"same-origin",(n.headers||!this.headers)&&(this.headers=new cn(n.headers)),this.method=Kx(n.method||this.method||"GET"),this.mode=n.mode||this.mode||null,this.signal=n.signal||this.signal||(function(){if("AbortController"in gn)return new AbortController().signal})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&i)throw TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),(this.method==="GET"||this.method==="HEAD")&&(n.cache==="no-store"||n.cache==="no-cache")){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function Qx(e){var n=new FormData;return e.trim().split("&").forEach(function(i){if(i){var o=i.split("="),s=o.shift().replace(/\+/g," "),c=o.join("=").replace(/\+/g," ");n.append(decodeURIComponent(s),decodeURIComponent(c))}}),n}function Gx(e){var n=new cn;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(i){return i.indexOf(`
16
- `)===0?i.substr(1,i.length):i}).forEach(function(i){var o=i.split(":"),s=o.shift().trim();if(s){var c=o.join(":").trim();try{n.append(s,c)}catch(d){console.warn("Response "+d.message)}}}),n}function Zr(e,n){if(!(this instanceof Zr))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(n||(n={}),this.type="default",this.status=n.status===void 0?200:n.status,this.status<200||this.status>599)throw RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=n.statusText===void 0?"":""+n.statusText,this.headers=new cn(n.headers),this.url=n.url||"",this._initBody(e)}function _0(e,n){return new Promise(function(i,o){var s=new Aa(e,n);if(s.signal&&s.signal.aborted)return o(new Gi("Aborted","AbortError"));var c=new XMLHttpRequest;function d(){c.abort()}c.onload=function(){var y={statusText:c.statusText,headers:Gx(c.getAllResponseHeaders()||"")};s.url.indexOf("file://")===0&&(c.status<200||c.status>599)?y.status=200:y.status=c.status,y.url="responseURL"in c?c.responseURL:y.headers.get("X-Request-URL");var w="response"in c?c.response:c.responseText;setTimeout(function(){i(new Zr(w,y))},0)},c.onerror=function(){setTimeout(function(){o(TypeError("Network request failed"))},0)},c.ontimeout=function(){setTimeout(function(){o(TypeError("Network request timed out"))},0)},c.onabort=function(){setTimeout(function(){o(new Gi("Aborted","AbortError"))},0)};function f(y){try{return y===""&&gn.location.href?gn.location.href:y}catch{return y}}if(c.open(s.method,f(s.url),!0),s.credentials==="include"?c.withCredentials=!0:s.credentials==="omit"&&(c.withCredentials=!1),"responseType"in c&&(Rn.blob?c.responseType="blob":Rn.arrayBuffer&&(c.responseType="arraybuffer")),n&&typeof n.headers=="object"&&!(n.headers instanceof cn||gn.Headers&&n.headers instanceof gn.Headers)){var p=[];Object.getOwnPropertyNames(n.headers).forEach(function(y){p.push(Oo(y)),c.setRequestHeader(y,Rd(n.headers[y]))}),s.headers.forEach(function(y,w){p.indexOf(w)===-1&&c.setRequestHeader(w,y)})}else s.headers.forEach(function(y,w){c.setRequestHeader(w,y)});s.signal&&(s.signal.addEventListener("abort",d),c.onreadystatechange=function(){c.readyState===4&&s.signal.removeEventListener("abort",d)}),c.send(s._bodyInit===void 0?null:s._bodyInit)})}let gn,Rn,x0,k0,S0,C0,Gi,E0,T0,R0,D0,qa,O0,P0,M0,L0,N0,I0,Po,Pd,Md,A0,Ji,Mo,Jl,q0,Ld,j0,z0,F0,B0,Xl,H0,ja,Nd,Vt,Yl,V0,$0,W0,U0,K0,Q0,G0,J0,X0,Y0,Z0,eg,tg,ng,rg,ig,ag,og,sg,lg,cg,ug,dg,fg;E0=U2((()=>{gn=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},Rn={searchParams:"URLSearchParams"in gn,iterable:"Symbol"in gn&&"iterator"in Symbol,blob:"FileReader"in gn&&"Blob"in gn&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in gn,arrayBuffer:"ArrayBuffer"in gn},Rn.arrayBuffer&&(x0=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],k0=ArrayBuffer.isView||function(e){return e&&x0.indexOf(Object.prototype.toString.call(e))>-1}),cn.prototype.append=function(e,n){e=Oo(e),n=Rd(n);var i=this.map[e];this.map[e]=i?i+", "+n:n},cn.prototype.delete=function(e){delete this.map[Oo(e)]},cn.prototype.get=function(e){return e=Oo(e),this.has(e)?this.map[e]:null},cn.prototype.has=function(e){return this.map.hasOwnProperty(Oo(e))},cn.prototype.set=function(e,n){this.map[Oo(e)]=Rd(n)},cn.prototype.forEach=function(e,n){for(var i in this.map)this.map.hasOwnProperty(i)&&e.call(n,this.map[i],i,this)},cn.prototype.keys=function(){var e=[];return this.forEach(function(n,i){e.push(i)}),Dd(e)},cn.prototype.values=function(){var e=[];return this.forEach(function(n){e.push(n)}),Dd(e)},cn.prototype.entries=function(){var e=[];return this.forEach(function(n,i){e.push([i,n])}),Dd(e)},Rn.iterable&&(cn.prototype[Symbol.iterator]=cn.prototype.entries),S0=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"],Aa.prototype.clone=function(){return new Aa(this,{body:this._bodyInit})},w0.call(Aa.prototype),w0.call(Zr.prototype),Zr.prototype.clone=function(){return new Zr(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new cn(this.headers),url:this.url})},Zr.error=function(){var e=new Zr(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e},C0=[301,302,303,307,308],Zr.redirect=function(e,n){if(C0.indexOf(n)===-1)throw RangeError("Invalid status code");return new Zr(null,{status:n,headers:{location:e}})},Gi=gn.DOMException;try{new Gi}catch{Gi=function(e,n){this.message=e,this.name=n,this.stack=Error(e).stack},Gi.prototype=Object.create(Error.prototype),Gi.prototype.constructor=Gi}_0.polyfill=!0,gn.fetch||(gn.fetch=_0,gn.Headers=cn,gn.Request=Aa,gn.Response=Zr)})),T0=Ee(((e,n)=>{E0(),n.exports=self.fetch.bind(self)})),R0=Ee((e=>{var n=e&&e.__extends||(function(){var w=function(_,C){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,T){E.__proto__=T}||function(E,T){for(var I in T)T.hasOwnProperty(I)&&(E[I]=T[I])},w(_,C)};return function(_,C){w(_,C);function E(){this.constructor=_}_.prototype=C===null?Object.create(C):(E.prototype=C.prototype,new E)}})(),i=e&&e.__awaiter||function(w,_,C,E){function T(I){return I instanceof C?I:new C(function($){$(I)})}return new(C||(C=Promise))(function(I,$){function V(K){try{N(E.next(K))}catch(pe){$(pe)}}function F(K){try{N(E.throw(K))}catch(pe){$(pe)}}function N(K){K.done?I(K.value):T(K.value).then(V,F)}N((E=E.apply(w,_||[])).next())})},o=e&&e.__generator||function(w,_){var C={label:0,sent:function(){if(I[0]&1)throw I[1];return I[1]},trys:[],ops:[]},E,T,I,$;return $={next:V(0),throw:V(1),return:V(2)},typeof Symbol=="function"&&($[Symbol.iterator]=function(){return this}),$;function V(N){return function(K){return F([N,K])}}function F(N){if(E)throw TypeError("Generator is already executing.");for(;C;)try{if(E=1,T&&(I=N[0]&2?T.return:N[0]?T.throw||((I=T.return)&&I.call(T),0):T.next)&&!(I=I.call(T,N[1])).done)return I;switch(T=0,I&&(N=[N[0]&2,I.value]),N[0]){case 0:case 1:I=N;break;case 4:return C.label++,{value:N[1],done:!1};case 5:C.label++,T=N[1],N=[0];continue;case 7:N=C.ops.pop(),C.trys.pop();continue;default:if(I=C.trys,!(I=I.length>0&&I[I.length-1])&&(N[0]===6||N[0]===2)){C=0;continue}if(N[0]===3&&(!I||N[1]>I[0]&&N[1]<I[3])){C.label=N[1];break}if(N[0]===6&&C.label<I[1]){C.label=I[1],I=N;break}if(I&&C.label<I[2]){C.label=I[2],C.ops.push(N);break}I[2]&&C.ops.pop(),C.trys.pop();continue}N=_.call(w,C)}catch(K){N=[6,K],T=0}finally{E=I=0}if(N[0]&5)throw N[1];return{value:N[0]?N[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTTPTransport=void 0;var c=s(T0()),d=Oa(),f=Do(),p=Ro(),y=(function(w){n(_,w);function _(C,E){var T=w.call(this)||this;return T.onlyNotifications=function(I){return I instanceof Array?I.every(function($){return $.request.request.id===null||$.request.request.id===void 0}):I.request.id===null||I.request.id===void 0},T.uri=C,T.credentials=E&&E.credentials,T.headers=_.setupHeaders(E&&E.headers),T.injectedFetcher=E==null?void 0:E.fetcher,T}return _.prototype.connect=function(){return Promise.resolve()},_.prototype.sendData=function(C,E){return E===void 0&&(E=null),i(this,void 0,void 0,function(){var T,I,$,V,F,N,pe,K,pe;return o(this,function(P){switch(P.label){case 0:T=this.transportRequestManager.addRequest(C,E),I=f.getNotifications(C),$=f.getBatchRequests(C),V=this.injectedFetcher||c.default,P.label=1;case 1:return P.trys.push([1,4,,5]),[4,V(this.uri,{method:"POST",headers:this.headers,body:JSON.stringify(this.parseData(C)),credentials:this.credentials})];case 2:return F=P.sent(),this.transportRequestManager.settlePendingRequest(I),this.onlyNotifications(C)?[2,Promise.resolve()]:[4,F.text()];case 3:return N=P.sent(),pe=this.transportRequestManager.resolveResponse(N),pe?(this.transportRequestManager.settlePendingRequest($,pe),[2,Promise.reject(pe)]):[3,5];case 4:return K=P.sent(),pe=new p.JSONRPCError(K.message,p.ERR_UNKNOWN,K),this.transportRequestManager.settlePendingRequest(I,pe),this.transportRequestManager.settlePendingRequest(f.getBatchRequests(C),pe),[2,Promise.reject(pe)];case 5:return[2,T]}})})},_.prototype.close=function(){},_.setupHeaders=function(C){var E=new Headers(C);return E.set("Content-Type","application/json"),E},_})(d.Transport);e.HTTPTransport=y,e.default=y})),D0=XR({default:()=>O0},1),P0=U2((()=>{qa=null,typeof WebSocket<"u"?qa=WebSocket:typeof MozWebSocket<"u"?qa=MozWebSocket:typeof global<"u"?qa=global.WebSocket||global.MozWebSocket:typeof window<"u"?qa=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(qa=self.WebSocket||self.MozWebSocket),O0=qa})),M0=Ee((e=>{var n=e&&e.__extends||(function(){var y=function(w,_){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,E){C.__proto__=E}||function(C,E){for(var T in E)E.hasOwnProperty(T)&&(C[T]=E[T])},y(w,_)};return function(w,_){y(w,_);function C(){this.constructor=w}w.prototype=_===null?Object.create(_):(C.prototype=_.prototype,new C)}})(),i=e&&e.__awaiter||function(y,w,_,C){function E(T){return T instanceof _?T:new _(function(I){I(T)})}return new(_||(_=Promise))(function(T,I){function $(N){try{F(C.next(N))}catch(K){I(K)}}function V(N){try{F(C.throw(N))}catch(K){I(K)}}function F(N){N.done?T(N.value):E(N.value).then($,V)}F((C=C.apply(y,w||[])).next())})},o=e&&e.__generator||function(y,w){var _={label:0,sent:function(){if(T[0]&1)throw T[1];return T[1]},trys:[],ops:[]},C,E,T,I;return I={next:$(0),throw:$(1),return:$(2)},typeof Symbol=="function"&&(I[Symbol.iterator]=function(){return this}),I;function $(F){return function(N){return V([F,N])}}function V(F){if(C)throw TypeError("Generator is already executing.");for(;_;)try{if(C=1,E&&(T=F[0]&2?E.return:F[0]?E.throw||((T=E.return)&&T.call(E),0):E.next)&&!(T=T.call(E,F[1])).done)return T;switch(E=0,T&&(F=[F[0]&2,T.value]),F[0]){case 0:case 1:T=F;break;case 4:return _.label++,{value:F[1],done:!1};case 5:_.label++,E=F[1],F=[0];continue;case 7:F=_.ops.pop(),_.trys.pop();continue;default:if(T=_.trys,!(T=T.length>0&&T[T.length-1])&&(F[0]===6||F[0]===2)){_=0;continue}if(F[0]===3&&(!T||F[1]>T[0]&&F[1]<T[3])){_.label=F[1];break}if(F[0]===6&&_.label<T[1]){_.label=T[1],T=F;break}if(T&&_.label<T[2]){_.label=T[2],_.ops.push(F);break}T[2]&&_.ops.pop(),_.trys.pop();continue}F=w.call(y,_)}catch(N){F=[6,N],E=0}finally{C=T=0}if(F[0]&5)throw F[1];return{value:F[0]?F[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(e,"__esModule",{value:!0});var c=s((P0(),Tu(D0))),d=Oa(),f=Do(),p=Ro();e.default=(function(y){n(w,y);function w(_){var C=y.call(this)||this;return C.uri=_,C.connection=new c.default(_),C}return w.prototype.connect=function(){var _=this;return new Promise(function(C,E){var T=function(){_.connection.removeEventListener("open",T),C()};_.connection.addEventListener("open",T),_.connection.addEventListener("message",function(I){var $=I.data;_.transportRequestManager.resolveResponse($)})})},w.prototype.sendData=function(_,C){return C===void 0&&(C=5e3),i(this,void 0,void 0,function(){var E,T,I;return o(this,function($){E=this.transportRequestManager.addRequest(_,C),T=f.getNotifications(_);try{this.connection.send(JSON.stringify(this.parseData(_))),this.transportRequestManager.settlePendingRequest(T)}catch(V){I=new p.JSONRPCError(V.message,p.ERR_UNKNOWN,V),this.transportRequestManager.settlePendingRequest(T,I),this.transportRequestManager.settlePendingRequest(f.getBatchRequests(_),I),E=Promise.reject(I)}return[2,E]})})},w.prototype.close=function(){this.connection.close()},w})(d.Transport)})),L0=Ee((e=>{var n=e&&e.__extends||(function(){var f=function(p,y){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,_){w.__proto__=_}||function(w,_){for(var C in _)_.hasOwnProperty(C)&&(w[C]=_[C])},f(p,y)};return function(p,y){f(p,y);function w(){this.constructor=p}p.prototype=y===null?Object.create(y):(w.prototype=y.prototype,new w)}})(),i=e&&e.__awaiter||function(f,p,y,w){function _(C){return C instanceof y?C:new y(function(E){E(C)})}return new(y||(y=Promise))(function(C,E){function T(V){try{$(w.next(V))}catch(F){E(F)}}function I(V){try{$(w.throw(V))}catch(F){E(F)}}function $(V){V.done?C(V.value):_(V.value).then(T,I)}$((w=w.apply(f,p||[])).next())})},o=e&&e.__generator||function(f,p){var y={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},w,_,C,E;return E={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function T($){return function(V){return I([$,V])}}function I($){if(w)throw TypeError("Generator is already executing.");for(;y;)try{if(w=1,_&&(C=$[0]&2?_.return:$[0]?_.throw||((C=_.return)&&C.call(_),0):_.next)&&!(C=C.call(_,$[1])).done)return C;switch(_=0,C&&($=[$[0]&2,C.value]),$[0]){case 0:case 1:C=$;break;case 4:return y.label++,{value:$[1],done:!1};case 5:y.label++,_=$[1],$=[0];continue;case 7:$=y.ops.pop(),y.trys.pop();continue;default:if(C=y.trys,!(C=C.length>0&&C[C.length-1])&&($[0]===6||$[0]===2)){y=0;continue}if($[0]===3&&(!C||$[1]>C[0]&&$[1]<C[3])){y.label=$[1];break}if($[0]===6&&y.label<C[1]){y.label=C[1],C=$;break}if(C&&y.label<C[2]){y.label=C[2],y.ops.push($);break}C[2]&&y.ops.pop(),y.trys.pop();continue}$=p.call(f,y)}catch(V){$=[6,V],_=0}finally{w=C=0}if($[0]&5)throw $[1];return{value:$[0]?$[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=Oa(),c=Do(),d=function(f){var p=400,y=window.screen.height;return window.open(f,"inspector:popup","left=0,top=0,width="+p+",height="+y+",resizable,scrollbars=yes,status=1")};e.default=(function(f){n(p,f);function p(y){var w=f.call(this)||this;return w.messageHandler=function(_){w.transportRequestManager.resolveResponse(JSON.stringify(_.data))},w.uri=y,w.postMessageID="post-message-transport-"+Math.random(),w}return p.prototype.createWindow=function(y){return new Promise(function(w,_){var C=d(y);setTimeout(function(){w(C)},3e3)})},p.prototype.connect=function(){var y=this,w=/^(http|https):\/\/.*$/;return new Promise(function(_,C){return i(y,void 0,void 0,function(){var E;return o(this,function(T){switch(T.label){case 0:return w.test(this.uri)||C(Error("Bad URI")),E=this,[4,this.createWindow(this.uri)];case 1:return E.frame=T.sent(),window.addEventListener("message",this.messageHandler),_(),[2]}})})})},p.prototype.sendData=function(y,w){return w===void 0&&(w=5e3),i(this,void 0,void 0,function(){var _,C;return o(this,function(E){return _=this.transportRequestManager.addRequest(y,null),C=c.getNotifications(y),this.frame&&(this.frame.postMessage(y.request,this.uri),this.transportRequestManager.settlePendingRequest(C)),[2,_]})})},p.prototype.close=function(){this.frame&&(window.removeEventListener("message",this.messageHandler),this.frame.close())},p})(s.Transport)})),N0=Ee((e=>{var n=e&&e.__extends||(function(){var d=function(f,p){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,w){y.__proto__=w}||function(y,w){for(var _ in w)w.hasOwnProperty(_)&&(y[_]=w[_])},d(f,p)};return function(f,p){d(f,p);function y(){this.constructor=f}f.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}})(),i=e&&e.__awaiter||function(d,f,p,y){function w(_){return _ instanceof p?_:new p(function(C){C(_)})}return new(p||(p=Promise))(function(_,C){function E($){try{I(y.next($))}catch(V){C(V)}}function T($){try{I(y.throw($))}catch(V){C(V)}}function I($){$.done?_($.value):w($.value).then(E,T)}I((y=y.apply(d,f||[])).next())})},o=e&&e.__generator||function(d,f){var p={label:0,sent:function(){if(_[0]&1)throw _[1];return _[1]},trys:[],ops:[]},y,w,_,C;return C={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function E(I){return function($){return T([I,$])}}function T(I){if(y)throw TypeError("Generator is already executing.");for(;p;)try{if(y=1,w&&(_=I[0]&2?w.return:I[0]?w.throw||((_=w.return)&&_.call(w),0):w.next)&&!(_=_.call(w,I[1])).done)return _;switch(w=0,_&&(I=[I[0]&2,_.value]),I[0]){case 0:case 1:_=I;break;case 4:return p.label++,{value:I[1],done:!1};case 5:p.label++,w=I[1],I=[0];continue;case 7:I=p.ops.pop(),p.trys.pop();continue;default:if(_=p.trys,!(_=_.length>0&&_[_.length-1])&&(I[0]===6||I[0]===2)){p=0;continue}if(I[0]===3&&(!_||I[1]>_[0]&&I[1]<_[3])){p.label=I[1];break}if(I[0]===6&&p.label<_[1]){p.label=_[1],_=I;break}if(_&&p.label<_[2]){p.label=_[2],p.ops.push(I);break}_[2]&&p.ops.pop(),p.trys.pop();continue}I=f.call(d,p)}catch($){I=[6,$],w=0}finally{y=_=0}if(I[0]&5)throw I[1];return{value:I[0]?I[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=Oa(),c=Do();e.default=(function(d){n(f,d);function f(p){var y=d.call(this)||this;return y.messageHandler=function(w){y.transportRequestManager.resolveResponse(JSON.stringify(w.data))},y.uri=p,y.postMessageID="post-message-transport-"+Math.random(),y}return f.prototype.createWindow=function(p){var y=this;return new Promise(function(w,_){var C,E=document.createElement("iframe");E.setAttribute("id",y.postMessageID),E.setAttribute("width","0px"),E.setAttribute("height","0px"),E.setAttribute("style","visiblity:hidden;border:none;outline:none;"),E.addEventListener("load",function(){w(C)}),E.setAttribute("src",p),window.document.body.appendChild(E),C=E.contentWindow})},f.prototype.connect=function(){var p=this,y=/^(http|https):\/\/.*$/;return new Promise(function(w,_){return i(p,void 0,void 0,function(){var C;return o(this,function(E){switch(E.label){case 0:return y.test(this.uri)||_(Error("Bad URI")),C=this,[4,this.createWindow(this.uri)];case 1:return C.frame=E.sent(),window.addEventListener("message",this.messageHandler),w(),[2]}})})})},f.prototype.sendData=function(p,y){return y===void 0&&(y=5e3),i(this,void 0,void 0,function(){var w,_;return o(this,function(C){return w=this.transportRequestManager.addRequest(p,null),_=c.getNotifications(p),this.frame&&(this.frame.postMessage(p.request,"*"),this.transportRequestManager.settlePendingRequest(_)),[2,w]})})},f.prototype.close=function(){var p;(p=document.getElementById(this.postMessageID))==null||p.remove(),window.removeEventListener("message",this.messageHandler)},f})(s.Transport)})),I0=Ee((e=>{var n=e&&e.__awaiter||function(o,s,c,d){function f(p){return p instanceof c?p:new c(function(y){y(p)})}return new(c||(c=Promise))(function(p,y){function w(E){try{C(d.next(E))}catch(T){y(T)}}function _(E){try{C(d.throw(E))}catch(T){y(T)}}function C(E){E.done?p(E.value):f(E.value).then(w,_)}C((d=d.apply(o,s||[])).next())})},i=e&&e.__generator||function(o,s){var c={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},d,f,p,y;return y={next:w(0),throw:w(1),return:w(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function w(C){return function(E){return _([C,E])}}function _(C){if(d)throw TypeError("Generator is already executing.");for(;c;)try{if(d=1,f&&(p=C[0]&2?f.return:C[0]?f.throw||((p=f.return)&&p.call(f),0):f.next)&&!(p=p.call(f,C[1])).done)return p;switch(f=0,p&&(C=[C[0]&2,p.value]),C[0]){case 0:case 1:p=C;break;case 4:return c.label++,{value:C[1],done:!1};case 5:c.label++,f=C[1],C=[0];continue;case 7:C=c.ops.pop(),c.trys.pop();continue;default:if(p=c.trys,!(p=p.length>0&&p[p.length-1])&&(C[0]===6||C[0]===2)){c=0;continue}if(C[0]===3&&(!p||C[1]>p[0]&&C[1]<p[3])){c.label=C[1];break}if(C[0]===6&&c.label<p[1]){c.label=p[1],p=C;break}if(p&&c.label<p[2]){c.label=p[2],c.ops.push(C);break}p[2]&&c.ops.pop(),c.trys.pop();continue}C=s.call(o,c)}catch(E){C=[6,E],f=0}finally{d=p=0}if(C[0]&5)throw C[1];return{value:C[0]?C[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=(function(){function o(s){this.requestManager=s}return o.prototype.startBatch=function(){return this.requestManager.startBatch()},o.prototype.stopBatch=function(){return this.requestManager.stopBatch()},o.prototype.request=function(s,c){return n(this,void 0,void 0,function(){return i(this,function(d){switch(d.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:d.sent(),d.label=2;case 2:return[2,this.requestManager.request(s,!1,c)]}})})},o.prototype.notify=function(s){return n(this,void 0,void 0,function(){return i(this,function(c){switch(c.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:c.sent(),c.label=2;case 2:return[2,this.requestManager.request(s,!0,null)]}})})},o.prototype.onNotification=function(s){this.requestManager.requestChannel.addListener("notification",s)},o.prototype.onError=function(s){this.requestManager.requestChannel.addListener("error",s)},o.prototype.close=function(){this.requestManager.close()},o})()})),ql=Ee((e=>{var n=e&&e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.PostMessageIframeTransport=e.PostMessageWindowTransport=e.JSONRPCError=e.WebSocketTransport=e.EventEmitterTransport=e.HTTPTransport=e.RequestManager=e.Client=void 0,e.RequestManager=n(m0()).default,e.EventEmitterTransport=n(y0()).default,e.HTTPTransport=n(R0()).default,e.WebSocketTransport=n(M0()).default,e.PostMessageWindowTransport=n(L0()).default,e.PostMessageIframeTransport=n(N0()).default;var i=Ro();Object.defineProperty(e,"JSONRPCError",{enumerable:!0,get:function(){return i.JSONRPCError}});var o=n(I0());e.Client=o.default,e.default=o.default})),Po=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function n(p){return p===!0||p===!1}e.boolean=n;function i(p){return typeof p=="string"||p instanceof String}e.string=i;function o(p){return typeof p=="number"||p instanceof Number}e.number=o;function s(p){return p instanceof Error}e.error=s;function c(p){return typeof p=="function"}e.func=c;function d(p){return Array.isArray(p)}e.array=d;function f(p){return d(p)&&p.every(y=>i(y))}e.stringArray=f})),Pd=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;var n=Po(),i;(function(d){d.ParseError=-32700,d.InvalidRequest=-32600,d.MethodNotFound=-32601,d.InvalidParams=-32602,d.InternalError=-32603,d.jsonrpcReservedErrorRangeStart=-32099,d.serverErrorStart=-32099,d.MessageWriteError=-32099,d.MessageReadError=-32098,d.PendingResponseRejected=-32097,d.ConnectionInactive=-32096,d.ServerNotInitialized=-32002,d.UnknownErrorCode=-32001,d.jsonrpcReservedErrorRangeEnd=-32e3,d.serverErrorEnd=-32e3})(i||(e.ErrorCodes=i={})),e.ResponseError=class fx extends Error{constructor(f,p,y){super(p),this.code=n.number(f)?f:i.UnknownErrorCode,this.data=y,Object.setPrototypeOf(this,fx.prototype)}toJson(){let f={code:this.code,message:this.message};return this.data!==void 0&&(f.data=this.data),f}};var o=class pd{constructor(f){this.kind=f}static is(f){return f===pd.auto||f===pd.byName||f===pd.byPosition}toString(){return this.kind}};e.ParameterStructures=o,o.auto=new o("auto"),o.byPosition=new o("byPosition"),o.byName=new o("byName");var s=class{constructor(d,f){this.method=d,this.numberOfParams=f}get parameterStructures(){return o.auto}};e.AbstractMessageSignature=s,e.RequestType0=class extends s{constructor(d){super(d,0)}},e.RequestType=class extends s{constructor(d,f=o.auto){super(d,1),this._parameterStructures=f}get parameterStructures(){return this._parameterStructures}},e.RequestType1=class extends s{constructor(d,f=o.auto){super(d,1),this._parameterStructures=f}get parameterStructures(){return this._parameterStructures}},e.RequestType2=class extends s{constructor(d){super(d,2)}},e.RequestType3=class extends s{constructor(d){super(d,3)}},e.RequestType4=class extends s{constructor(d){super(d,4)}},e.RequestType5=class extends s{constructor(d){super(d,5)}},e.RequestType6=class extends s{constructor(d){super(d,6)}},e.RequestType7=class extends s{constructor(d){super(d,7)}},e.RequestType8=class extends s{constructor(d){super(d,8)}},e.RequestType9=class extends s{constructor(d){super(d,9)}},e.NotificationType=class extends s{constructor(d,f=o.auto){super(d,1),this._parameterStructures=f}get parameterStructures(){return this._parameterStructures}},e.NotificationType0=class extends s{constructor(d){super(d,0)}},e.NotificationType1=class extends s{constructor(d,f=o.auto){super(d,1),this._parameterStructures=f}get parameterStructures(){return this._parameterStructures}},e.NotificationType2=class extends s{constructor(d){super(d,2)}},e.NotificationType3=class extends s{constructor(d){super(d,3)}},e.NotificationType4=class extends s{constructor(d){super(d,4)}},e.NotificationType5=class extends s{constructor(d){super(d,5)}},e.NotificationType6=class extends s{constructor(d){super(d,6)}},e.NotificationType7=class extends s{constructor(d){super(d,7)}},e.NotificationType8=class extends s{constructor(d){super(d,8)}},e.NotificationType9=class extends s{constructor(d){super(d,9)}};var c;(function(d){function f(w){let _=w;return _&&n.string(_.method)&&(n.string(_.id)||n.number(_.id))}d.isRequest=f;function p(w){let _=w;return _&&n.string(_.method)&&w.id===void 0}d.isNotification=p;function y(w){let _=w;return _&&(_.result!==void 0||!!_.error)&&(n.string(_.id)||n.number(_.id)||_.id===null)}d.isResponse=y})(c||(e.Message=c={}))})),Md=Ee((e=>{var n;Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var i;(function(s){s.None=0,s.First=1,s.AsOld=s.First,s.Last=2,s.AsNew=s.Last})(i||(e.Touch=i={}));var o=class{constructor(){this[n]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var s;return(s=this._head)==null?void 0:s.value}get last(){var s;return(s=this._tail)==null?void 0:s.value}has(s){return this._map.has(s)}get(s,c=i.None){let d=this._map.get(s);if(d)return c!==i.None&&this.touch(d,c),d.value}set(s,c,d=i.None){let f=this._map.get(s);if(f)f.value=c,d!==i.None&&this.touch(f,d);else{switch(f={key:s,value:c,next:void 0,previous:void 0},d){case i.None:this.addItemLast(f);break;case i.First:this.addItemFirst(f);break;case i.Last:this.addItemLast(f);break;default:this.addItemLast(f);break}this._map.set(s,f),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){let c=this._map.get(s);if(c)return this._map.delete(s),this.removeItem(c),this._size--,c.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error("Invalid list");let s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,c){let d=this._state,f=this._head;for(;f;){if(c?s.bind(c)(f.value,f.key,this):s(f.value,f.key,this),this._state!==d)throw Error("LinkedMap got modified during iteration.");f=f.next}}keys(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let f={value:c.key,done:!1};return c=c.next,f}else return{value:void 0,done:!0}}};return d}values(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let f={value:c.value,done:!1};return c=c.next,f}else return{value:void 0,done:!0}}};return d}entries(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let f={value:[c.key,c.value],done:!1};return c=c.next,f}else return{value:void 0,done:!0}}};return d}[(n=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let c=this._head,d=this.size;for(;c&&d>s;)this._map.delete(c.key),c=c.next,d--;this._head=c,this._size=d,c&&(c.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{let c=s.next,d=s.previous;if(!c||!d)throw Error("Invalid list");c.previous=d,d.next=c}s.next=void 0,s.previous=void 0,this._state++}touch(s,c){if(!this._head||!this._tail)throw Error("Invalid list");if(!(c!==i.First&&c!==i.Last)){if(c===i.First){if(s===this._head)return;let d=s.next,f=s.previous;s===this._tail?(f.next=void 0,this._tail=f):(d.previous=f,f.next=d),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(c===i.Last){if(s===this._tail)return;let d=s.next,f=s.previous;s===this._head?(d.previous=void 0,this._head=d):(d.previous=f,f.next=d),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){let s=[];return this.forEach((c,d)=>{s.push([d,c])}),s}fromJSON(s){this.clear();for(let[c,d]of s)this.set(c,d)}};e.LinkedMap=o,e.LRUCache=class extends o{constructor(s,c=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,c),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,c=i.AsNew){return super.get(s,c)}peek(s){return super.get(s,i.None)}set(s,c){return super.set(s,c,i.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}})),A0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Disposable=void 0;var n;(function(i){function o(s){return{dispose:s}}i.create=o})(n||(e.Disposable=n={}))})),Ji=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n;function i(){if(n===void 0)throw Error("No runtime abstraction layer installed");return n}(function(o){function s(c){if(c===void 0)throw Error("No runtime abstraction layer provided");n=c}o.install=s})(i||(i={})),e.default=i})),Mo=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;var n=Ji(),i;(function(c){let d={dispose(){}};c.None=function(){return d}})(i||(e.Event=i={}));var o=class{add(c,d=null,f){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(c),this._contexts.push(d),Array.isArray(f)&&f.push({dispose:()=>this.remove(c,d)})}remove(c,d=null){if(!this._callbacks)return;let f=!1;for(let p=0,y=this._callbacks.length;p<y;p++)if(this._callbacks[p]===c)if(this._contexts[p]===d){this._callbacks.splice(p,1),this._contexts.splice(p,1);return}else f=!0;if(f)throw Error("When adding a listener with a context, you should remove it with the same context")}invoke(...c){if(!this._callbacks)return[];let d=[],f=this._callbacks.slice(0),p=this._contexts.slice(0);for(let y=0,w=f.length;y<w;y++)try{d.push(f[y].apply(p[y],c))}catch(_){(0,n.default)().console.error(_)}return d}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},s=class px{constructor(d){this._options=d}get event(){return this._event||(this._event=(d,f,p)=>{this._callbacks||(this._callbacks=new o),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(d,f);let y={dispose:()=>{this._callbacks&&(this._callbacks.remove(d,f),y.dispose=px._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(p)&&p.push(y),y}),this._event}fire(d){this._callbacks&&this._callbacks.invoke.call(this._callbacks,d)}dispose(){this._callbacks&&(this._callbacks=(this._callbacks.dispose(),void 0))}};e.Emitter=s,s._noop=function(){}})),Jl=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;var n=Ji(),i=Po(),o=Mo(),s;(function(f){f.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:o.Event.None}),f.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:o.Event.None});function p(y){let w=y;return w&&(w===f.None||w===f.Cancelled||i.boolean(w.isCancellationRequested)&&!!w.onCancellationRequested)}f.is=p})(s||(e.CancellationToken=s={}));var c=Object.freeze(function(f,p){let y=(0,n.default)().timer.setTimeout(f.bind(p),0);return{dispose(){y.dispose()}}}),d=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?c:(this._emitter||(this._emitter=new o.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter=(this._emitter.dispose(),void 0))}};e.CancellationTokenSource=class{get token(){return this._token||(this._token=new d),this._token}cancel(){this._token?this._token.cancel():this._token=s.Cancelled}dispose(){this._token?this._token instanceof d&&this._token.dispose():this._token=s.None}}})),q0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;var n=Jl(),i;(function(c){c.Continue=0,c.Cancelled=1})(i||(i={})),e.SharedArraySenderStrategy=class{constructor(){this.buffers=new Map}enableCancellation(c){if(c.id===null)return;let d=new SharedArrayBuffer(4),f=new Int32Array(d,0,1);f[0]=i.Continue,this.buffers.set(c.id,d),c.$cancellationData=d}async sendCancellation(c,d){let f=this.buffers.get(d);if(f===void 0)return;let p=new Int32Array(f,0,1);Atomics.store(p,0,i.Cancelled)}cleanup(c){this.buffers.delete(c)}dispose(){this.buffers.clear()}};var o=class{constructor(c){this.data=new Int32Array(c,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===i.Cancelled}get onCancellationRequested(){throw Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},s=class{constructor(c){this.token=new o(c)}cancel(){}dispose(){}};e.SharedArrayReceiverStrategy=class{constructor(){this.kind="request"}createCancellationTokenSource(c){let d=c.$cancellationData;return d===void 0?new n.CancellationTokenSource:new s(d)}}})),Ld=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;var n=Ji();e.Semaphore=class{constructor(i=1){if(i<=0)throw Error("Capacity must be greater than 0");this._capacity=i,this._active=0,this._waiting=[]}lock(i){return new Promise((o,s)=>{this._waiting.push({thunk:i,resolve:o,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,n.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let i=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error("To many thunks active");try{let o=i.thunk();o instanceof Promise?o.then(s=>{this._active--,i.resolve(s),this.runNext()},s=>{this._active--,i.reject(s),this.runNext()}):(this._active--,i.resolve(o),this.runNext())}catch(o){this._active--,i.reject(o),this.runNext()}}}})),j0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;var n=Ji(),i=Po(),o=Mo(),s=Ld(),c;(function(p){function y(w){let _=w;return _&&i.func(_.listen)&&i.func(_.dispose)&&i.func(_.onError)&&i.func(_.onClose)&&i.func(_.onPartialMessage)}p.is=y})(c||(e.MessageReader=c={}));var d=class{constructor(){this.errorEmitter=new o.Emitter,this.closeEmitter=new o.Emitter,this.partialMessageEmitter=new o.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(p){this.errorEmitter.fire(this.asError(p))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(p){this.partialMessageEmitter.fire(p)}asError(p){return p instanceof Error?p:Error(`Reader received error. Reason: ${i.string(p.message)?p.message:"unknown"}`)}};e.AbstractMessageReader=d;var f;(function(p){function y(w){let _,C,E=new Map,T,I=new Map;if(w===void 0||typeof w=="string")_=w??"utf-8";else{if(_=w.charset??"utf-8",w.contentDecoder!==void 0&&(C=w.contentDecoder,E.set(C.name,C)),w.contentDecoders!==void 0)for(let $ of w.contentDecoders)E.set($.name,$);if(w.contentTypeDecoder!==void 0&&(T=w.contentTypeDecoder,I.set(T.name,T)),w.contentTypeDecoders!==void 0)for(let $ of w.contentTypeDecoders)I.set($.name,$)}return T===void 0&&(T=(0,n.default)().applicationJson.decoder,I.set(T.name,T)),{charset:_,contentDecoder:C,contentDecoders:E,contentTypeDecoder:T,contentTypeDecoders:I}}p.fromOptions=y})(f||(f={})),e.ReadableStreamMessageReader=class extends d{constructor(p,y){super(),this.readable=p,this.options=f.fromOptions(y),this.buffer=(0,n.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new s.Semaphore(1)}set partialMessageTimeout(p){this._partialMessageTimeout=p}get partialMessageTimeout(){return this._partialMessageTimeout}listen(p){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=p;let y=this.readable.onData(w=>{this.onData(w)});return this.readable.onError(w=>this.fireError(w)),this.readable.onClose(()=>this.fireClose()),y}onData(p){try{for(this.buffer.append(p);;){if(this.nextMessageLength===-1){let w=this.buffer.tryReadHeaders(!0);if(!w)return;let _=w.get("content-length");if(!_){this.fireError(Error(`Header must provide a Content-Length property.
14
+ `," ").replaceAll("\r","")}function md(e){return typeof e=="object"&&e&&"$bigint"in e&&typeof e.$bigint=="string"?BigInt(e.$bigint):e}var Bm="abcdefghijklmnopqrstuvwxyz",Hm=Bm+Bm.toUpperCase(),Vm=new Set;Rs="__scratch__",yr="setup",Ma={create(){let e=0,n;do{let i="";for(let o=0;o<4;o++)i+=Hm[Math.floor(Math.random()*Hm.length)];n=i,e++}while(Vm.has(n)&&e<100);if(e>=100)throw Error("Failed to generate unique CellId after 100 attempts");return Vm.add(n),n}},er={create(e){return In(e!=null,"cellId is required"),`cell-${e}`},parse(e){return e.slice(5)},findElement(e){return e.closest('div[id^="cell-"]')},findElementThroughShadowDOMs(e){let n=e;for(;n;){let i=er.findElement(n);if(i)return i;let o=n.getRootNode();if(n=o instanceof ShadowRoot?o.host:n.parentElement,n===o)break}return null}},G_=function(e){let n=null,i=er.findElementThroughShadowDOMs(e);return i&&(n=er.parse(i.id)),n},id={parse(e){return e.getAttribute("object-id")},parseOrThrow(e){let n=id.parse(e);return In(n,"<marimo-ui-element/> missing object-id attribute"),n}},z_={create(e){return`output-${e}`}},_m=new class{getFilename(){return this.getSearchParam("filename")}setFilename(e){this.setSearchParam("filename",e)}getCodeFromSearchParam(){return this.getSearchParam("code")}getCodeFromHash(){let e=window.location.hash;return e.startsWith("#code/")?e.slice(6):null}setCodeForHash(e){window.location.hash=`#code/${e}`}setSearchParam(e,n){let i=new URL(window.location.href);i.searchParams.set(e,n),window.history.replaceState({},"",i.toString())}getSearchParam(e){return new URL(window.location.href).searchParams.get(e)}},$u=function(e){return vm(e??"")},e_=function(e){return ui.mapValues(e.dataset,n=>typeof n=="string"?$u(n):n)},Rw=function(e,n){let i=e.parentElement?id.parse(e.parentElement):void 0;return i&&n.has(i)?n.lookupValue(i):$u(e.dataset.initialValue)},Fl=function(){if(v4())return document.title||null;if(vh()){let i=_m.getFilename();if(i)return i}let e=document.querySelector("marimo-filename");bm(e,"marimo-filename tag not found");let n=e.innerHTML;return n.length===0?null:n};var Ex=Symbol("");Ww=function(e,n){return ze(e,function(i,o,s){o(this,n(i(this),s))})};function gd(e,n){let i=null,o=new Map,s=new Set,c=f=>{let p;if(n===void 0)p=o.get(f);else for(let[w,_]of o)if(n(w,f)){p=_;break}if(p!==void 0)if(i!=null&&i(p[1],f))c.remove(f);else return p[0];let y=e(f);return o.set(f,[y,Date.now()]),d("CREATE",f,y),y},d=(f,p,y)=>{for(let w of s)w({type:f,param:p,atom:y})};return c.unstable_listen=f=>(s.add(f),()=>{s.delete(f)}),c.getParams=()=>o.keys(),c.remove=f=>{if(n===void 0){if(!o.has(f))return;let[p]=o.get(f);o.delete(f),d("REMOVE",f,p)}else for(let[p,[y]]of o)if(n(p,f)){o.delete(p),d("REMOVE",p,y);break}},c.setShouldRemove=f=>{if(i=f,i)for(let[p,[y,w]]of o)i(w,p)&&(o.delete(p),d("REMOVE",p,y))},c}var yd=(e,n,i)=>(n.has(i)?n:n.set(i,e())).get(i),Tx=new WeakMap,Rx=(e,n,i,o)=>yd(e,yd(()=>new WeakMap,yd(()=>new WeakMap,Tx,n),i),o);function Dx(e,n,i=Object.is){return Rx(()=>{let o=Symbol(),s=([d,f])=>{if(f===o)return n(d);let p=n(d,f);return i(f,p)?f:p},c=ze(d=>{let f=d(c);return s([d(e),f])});return c.init=o,c},e,n,i)}var $m=(e,n,i)=>(n.has(i)?n:n.set(i,e())).get(i),Ox=new WeakMap,Px=(e,n,i)=>$m(e,$m(()=>new WeakMap,Ox,n),i),Mx={},Wm=e=>!!e.write,Lx=e=>typeof e=="function";function Nx(e,n){return Px(()=>{let i=new WeakMap,o=(d,f)=>{let p=i.get(d);if(p)return p;let y=f&&i.get(f),w=[],_=[];return d.forEach((C,E)=>{let T=n?n(C):E;_[E]=T;let I=y&&y.atomList[y.keyList.indexOf(T)];if(I){w[E]=I;return}let $=V=>{let F=V(s),N=V(e),K=o(N,F==null?void 0:F.arr).keyList.indexOf(T);if(K<0||K>=N.length){let pe=d[o(d).keyList.indexOf(T)];if(pe)return pe;throw Error("splitAtom: index out of bounds for read")}return N[K]};w[E]=Wm(e)?ze($,(V,F,N)=>{let K=V(s),pe=V(e),P=o(pe,K==null?void 0:K.arr).keyList.indexOf(T);if(P<0||P>=pe.length)throw Error("splitAtom: index out of bounds for write");let A=Lx(N)?N(pe[P]):N;Object.is(pe[P],A)||F(e,[...pe.slice(0,P),A,...pe.slice(P+1)])}):ze($)}),p=y&&y.keyList.length===_.length&&y.keyList.every((C,E)=>C===_[E])?y:{arr:d,atomList:w,keyList:_},i.set(d,p),p},s=ze(d=>{let f=d(s);return o(d(e),f==null?void 0:f.arr)});s.init=void 0;let c=Wm(e)?ze(d=>d(s).atomList,(d,f,p)=>{switch(p.type){case"remove":{let y=d(c).indexOf(p.atom);if(y>=0){let w=d(e);f(e,[...w.slice(0,y),...w.slice(y+1)])}break}case"insert":{let y=p.before?d(c).indexOf(p.before):d(c).length;if(y>=0){let w=d(e);f(e,[...w.slice(0,y),p.value,...w.slice(y)])}break}case"move":{let y=d(c).indexOf(p.atom),w=p.before?d(c).indexOf(p.before):d(c).length;if(y>=0&&w>=0){let _=d(e);y<w?f(e,[..._.slice(0,y),..._.slice(y+1,w),_[y],..._.slice(w)]):f(e,[..._.slice(0,w),_[y],..._.slice(w,y),..._.slice(y+1)])}break}}}):ze(d=>d(s).atomList);return c},e,n||Mx)}var Um=e=>typeof(e==null?void 0:e.then)=="function";function Km(e=()=>{try{return window.localStorage}catch{return}},n){var f;let i,o,s={getItem:(p,y)=>{var C;let w=E=>{if(E||(E=""),i!==E){try{o=JSON.parse(E,n==null?void 0:n.reviver)}catch{return y}i=E}return o},_=((C=e())==null?void 0:C.getItem(p))??null;return Um(_)?_.then(w):w(_)},setItem:(p,y)=>{var w;return(w=e())==null?void 0:w.setItem(p,JSON.stringify(y,n==null?void 0:n.replacer))},removeItem:p=>{var y;return(y=e())==null?void 0:y.removeItem(p)}},c=p=>(y,w,_)=>p(y,C=>{let E;try{E=JSON.parse(C||"")}catch{E=_}w(E)}),d;try{d=(f=e())==null?void 0:f.subscribe}catch{}return!d&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(d=(p,y)=>{if(!(e()instanceof window.Storage))return()=>{};let w=_=>{_.storageArea===e()&&_.key===p&&y(_.newValue)};return window.addEventListener("storage",w),()=>{window.removeEventListener("storage",w)}}),d&&(s.subscribe=c(d)),s}var Ix=Km();Bl=function(e,n,i=Ix,o){let s=ze(o!=null&&o.getOnInit?i.getItem(e,n):n);return s.onMount=c=>{c(i.getItem(e,n));let d;return i.subscribe&&(d=i.subscribe(e,c,n)),d},ze(c=>c(s),(c,d,f)=>{let p=typeof f=="function"?f(c(s)):f;return p===Ex?(d(s,n),i.removeItem(e)):Um(p)?p.then(y=>(d(s,y),i.setItem(e,y))):(d(s,p),i.setItem(e,p))})},Wn=function(e){let n,i,o;return typeof e=="object"?(n=e.hashFunction,i=e.expiring,o=e.tags):n=e,(s,c,d)=>{if(d.value!=null)d.value=Qm(d.value,n,i,o);else if(d.get!=null)d.get=Qm(d.get,n,i,o);else throw"Only put a Memoize() decorator on a method or get accessor."}};var vd=new Map;function Qm(e,n,i=0,o){let s=Symbol("__memoized_map__");return function(...c){let d;this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let f=this[s];if(Array.isArray(o))for(let p of o)vd.has(p)?vd.get(p).push(f):vd.set(p,[f]);if(n||c.length>0||i>0){let p;p=n===!0?c.map(_=>_.toString()).join("!"):n?n.apply(this,c):c[0];let y=`${p}__timestamp`,w=!1;if(i>0)if(!f.has(y))w=!0;else{let _=f.get(y);w=Date.now()-_>i}f.has(p)&&!w?d=f.get(p):(d=e.apply(this,c),f.set(p,d),i>0&&f.set(y,Date.now()))}else{let p=this;f.has(p)?d=f.get(p):(d=e.apply(this,c),f.set(p,d))}return d}}Cs=ze(Fl()),Bw=ze(void 0);var Ax=class{constructor(){ke(this,"store",new Map)}get length(){return this.store.size}clear(){this.store.clear()}getItem(e){return this.store.get(e)||null}key(e){return[...this.store.keys()][e]||null}removeItem(e){this.store.delete(e)}setItem(e,n){this.store.set(e,n)}};function qx(){let{hasLocalStorage:e,hasSessionStorage:n}=rD();return e?window.localStorage:n?window.sessionStorage:new Ax}Ts=qx();let Qi;Vw=class{constructor(e,n=Ts){this.defaultValue=e,this.storage=n}get(e){try{let n=this.storage.getItem(e);return n?JSON.parse(n):this.defaultValue}catch{return this.defaultValue}}set(e,n){this.storage.setItem(e,JSON.stringify(n))}remove(e){this.storage.removeItem(e)}},Vu=class{constructor(e,n,i=Ts){this.schema=e,this.getDefaultValue=n,this.storage=i}get(e){try{let n=this.storage.getItem(e);if(n==null)return this.getDefaultValue();let i=this.schema.safeParse(JSON.parse(n));return i.success?i.data:(Se.warn("Error parsing zod local storage",i.error),this.getDefaultValue())}catch(n){return Se.warn("Error getting zod local storage",n),this.getDefaultValue()}}set(e,n){this.storage.setItem(e,JSON.stringify(n))}remove(e){this.storage.removeItem(e)}},rm=class extends Vu{constructor(e,n,i){let o=lt.get(Cs);super(n,i),this.filename=o;try{this.unsubscribeFromFilename=lt.sub(Cs,()=>{let s=lt.get(Cs);this.handleFilenameChange(e,s)})}catch{this.unsubscribeFromFilename=null}}get(e){return super.get(this.createScopedKey(e,this.filename))}set(e,n){super.set(this.createScopedKey(e,this.filename),n)}remove(e){super.remove(this.createScopedKey(e,this.filename))}createScopedKey(e,n){return n?`${e}:${n}`:e}handleFilenameChange(e,n){if(n&&n!==this.filename){let i=this.get(e);this.remove(e),this.filename=n,this.set(e,i)}}dispose(){this.unsubscribeFromFilename&&(this.unsubscribeFromFilename=(this.unsubscribeFromFilename(),null))}},Qi="marimo:notebook-col-sizes";function jx(){return{widths:[]}}var Eo=new rm(Qi,G2({widths:i4(t4([n4(),r4("contentWidth")]).default("contentWidth"))}),jx);Lw={getColumnWidth:e=>Eo.get(Qi).widths[e]??"contentWidth",saveColumnWidth:(e,n)=>{let i=Eo.get(Qi).widths;if(i[e])i[e]=n;else{for(;i.length<=e;)i.push("contentWidth");i[e]=n}Eo.set(Qi,{widths:i})},clearStorage:()=>{Eo.remove(Qi)}};function zx(e,n){let i=Eo.get(Qi).widths,o=Pl(i,e,n);Eo.set(Qi,{widths:o})}var Gm,Jm,Xm,Nr,Ym,Zm,e0,t0,Un,n0,r0,i0,a0,o0,s0,en;function tr(e,n,i,o,s){var c={};return Object.keys(o).forEach(function(d){c[d]=o[d]}),c.enumerable=!!c.enumerable,c.configurable=!!c.configurable,("value"in c||c.initializer)&&(c.writable=!0),c=i.slice().reverse().reduce(function(d,f){return f(e,n,d)||d},c),s&&c.initializer!==void 0&&(c.value=c.initializer?c.initializer.call(s):void 0,c.initializer=void 0),c.initializer===void 0?(Object.defineProperty(e,n,c),null):c}let Ia=(Gm=Wn(),Jm=Wn(),Xm=Wn(),Nr=class{constructor(e,n,i){this.value=e,this.isCollapsed=n,this.children=i}geDescendantCount(){let e=0,n=[...this.children];for(;n.length>0;){let i=n.pop();e++;for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}return e}getDescendants(){let e=[],n=[...this.children];for(;n.length>0;){let i=n.pop();e.push(i.value);for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}return e}get inOrderIds(){let e=[],n=i=>{e.push(i.value);for(let o of i.children)n(o)};for(let i of this.children)n(i);return e}toString(){return this.isCollapsed?`${this.value} (collapsed)`:String(this.value)}equals(e){return this.value===e.value}},tr(Nr.prototype,"geDescendantCount",[Gm],Object.getOwnPropertyDescriptor(Nr.prototype,"geDescendantCount"),Nr.prototype),tr(Nr.prototype,"getDescendants",[Jm],Object.getOwnPropertyDescriptor(Nr.prototype,"getDescendants"),Nr.prototype),tr(Nr.prototype,"inOrderIds",[Xm],Object.getOwnPropertyDescriptor(Nr.prototype,"inOrderIds"),Nr.prototype),Nr);var Fx=0;let To;To=(Ym=Wn(),Zm=Wn(),e0=Wn(),t0=Wn(),Un=class Co{constructor(n,i){this.nodes=n,this.id=i}static from(n){let i=`tree_${Fx++}`;return new Co(n.map(o=>new Ia(o,!1,[])),i)}static fromWithPreviousShape(n,i){var c;if(!i)return Co.from(n);let o=i.id,s=new Co(n.map(d=>new Ia(d,!1,[])),o);for(let d of n)if(i.isCollapsed(d)){let f=((c=i._nodeMap.get(d))==null?void 0:c.children)??[];for(let p=f.length-1;p>=0;p--){let y=f[p];if(s._nodeMap.has(y.value)){s=s.collapse(d,y.value);break}}}return s}withNodes(n){return new Co(n,this.id)}get topLevelIds(){return this.nodes.map(n=>n.value)}get inOrderIds(){return this.nodes.flatMap(n=>[n.value,...n.inOrderIds])}get idSet(){return new Set(this.inOrderIds)}get length(){return this.nodes.length}get _nodeMap(){let n=new Map;for(let i of this.nodes)n.set(i.value,i);return n}getDescendants(n){let i=this._nodeMap.get(n);return i?i.getDescendants():(Se.warn(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`),[])}isCollapsed(n){let i=this._nodeMap.get(n);return i?i.isCollapsed:(Se.warn(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`),!1)}indexOfOrThrow(n){let i=this.nodes.findIndex(o=>o.value===n);if(i===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);return i}slice(n,i){return this.nodes.slice(n,i).map(o=>o.value)}moveToFront(n){let i=this.indexOfOrThrow(n);return this.withNodes(Pl(this.nodes,i,0))}moveToBack(n){let i=this.indexOfOrThrow(n);return this.withNodes(Pl(this.nodes,i,this.nodes.length-1))}collapse(n,i){let o=this.nodes.findIndex(p=>p.value===n);if(o===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);let s=i===void 0?this.nodes.length:this.nodes.findIndex(p=>p.value===i);if(s===-1)throw Error(`Node ${i} not found in tree`);if(s<o)throw Error(`Node ${i} is before node ${n}`);let c=[...this.nodes],d=c[o];if(d.isCollapsed)throw Error(`Node ${n} is already collapsed`);let f=c.splice(o+1,s-o);return c[o]=new Ia(d.value,!0,f),this.withNodes(c)}collapseAll(n){let i=[...this.nodes];if(n.length===0)throw Error("No collapse ranges provided");if(n.length!==i.length)throw Error(`Collapse ranges length ${n.length} does not match tree length ${i.length}`);let o=i.length-1;for(;o>=0;){let s=i[o],c=n[o];if(!s.isCollapsed&&c){let{id:d,until:f}=c;if(d!==s.value)throw Error(`Node ${s.value} does not match collapse range id ${d}`);let p=f===void 0?i.length:i.findIndex(w=>w.value===f);if(p===-1)throw Error(`Node ${f} not found in tree`);if(p<o)throw Error(`Node ${f} is before node ${d}`);let y=i.splice(o+1,p-o);i[o]=new Ia(s.value,!0,y),o--}else o--}return this.withNodes(i)}expand(n){let i=this.nodes.findIndex(c=>c.value===n);if(i===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);let o=[...this.nodes],s=o[i];return s.isCollapsed?(o[i]=new Ia(s.value,!1,[]),o=gw(o,i+1,s.children),this.withNodes(o)):this}expandAll(){let n=[...this.nodes],i=0;for(;i<n.length;){let o=n[i];o.isCollapsed&&(n[i]=new Ia(o.value,!1,[]),n=gw(n,i+1,o.children)),i++}return this.withNodes(n)}move(n,i){return this.withNodes(Pl(this.nodes,n,i))}at(n){var i;return(i=this.nodes.at(n))==null?void 0:i.value}atOrThrow(n){let i=this.nodes.at(n);if(i===void 0)throw Error(`Node at index ${n} not found in tree`);return i.value}first(){return this.atOrThrow(0)}last(){return this.atOrThrow(this.nodes.length-1)}after(n){let i=this.indexOfOrThrow(n);if(i!==this.nodes.length-1)return this.at(i+1)}before(n){let i=this.indexOfOrThrow(n);if(i!==0)return this.at(i-1)}insert(n,i){return this.withNodes(mw(this.nodes,i,new Ia(n,!1,[])))}insertAtEnd(n){return this.insert(n,this.nodes.length)}insertAtStart(n){return this.insert(n,0)}deleteAtIndex(n){let i=this.atOrThrow(n),o=this.expand(i);return o.withNodes(nD(o.nodes,n))}delete(n){let i=this.indexOfOrThrow(n);return this.deleteAtIndex(i)}getCount(n){var i;return((i=this._nodeMap.get(n))==null?void 0:i.geDescendantCount())??0}findAndExpandDeep(n){let i=this.find(n);return i.length===0?this:i.reduce((o,s)=>o.expand(s),this)}find(n){function i(o,s){for(let c of o){if(c.value===n)return[...s,n];let d=i(c.children,[...s,c.value]);if(d.length>0)return d}return[]}return i(this.nodes,[])}split(n){let i=this.nodes.findIndex(c=>c.value===n);if(i===-1)throw Error(`Node ${n} not found in tree`);let o=this.nodes.slice(0,i),s=this.nodes.slice(i);return o.length===0?[Co.from([]),this.withNodes(s)]:[this.withNodes(o),Co.from([]).withNodes(s)]}equals(n){return this.nodes.length===n.nodes.length&&this.nodes.every((i,o)=>i.value===n.nodes[o].value)}toString(){let n=0,i="",o=s=>{for(let c of s)i+=`${" ".repeat(n*2)}${c.toString()}
15
+ `,n+=1,o(c.children),--n};return o(this.nodes),i}},tr(Un.prototype,"topLevelIds",[Ym],Object.getOwnPropertyDescriptor(Un.prototype,"topLevelIds"),Un.prototype),tr(Un.prototype,"inOrderIds",[Zm],Object.getOwnPropertyDescriptor(Un.prototype,"inOrderIds"),Un.prototype),tr(Un.prototype,"idSet",[e0],Object.getOwnPropertyDescriptor(Un.prototype,"idSet"),Un.prototype),tr(Un.prototype,"_nodeMap",[t0],Object.getOwnPropertyDescriptor(Un.prototype,"_nodeMap"),Un.prototype),Un),Kl=(n0=Wn(),r0=Wn(),i0=Wn(),a0=Wn(),o0=Wn(),s0=Wn(),en=class An{constructor(n){this.columns=n,n.length===0&&(this.columns=[To.from([])])}static from(n){return new An(n.map(i=>To.from(i)))}static fromWithPreviousShape(n,i){if(!i)return An.from([n]);let o=i.getColumns(),s=Array.from({length:o.length},()=>[]),c=0;for(let d of n){let f=o.findIndex(p=>p.idSet.has(d));f===-1?s[c].push(d):(c=f,s[f].push(d))}return new An(s.map((d,f)=>To.fromWithPreviousShape(d,o[f])))}isEmpty(){return this.columns.length===0?!0:this.columns.every(n=>n.nodes.length===0)}static fromIdsAndColumns(n){let i=Math.max(1,...n.map(([,c])=>(c??0)+1)),o=Array.from({length:i},()=>[]),s=0;for(let[c,d]of n)d==null||d<0?o[s].push(c):(o[d].push(c),s=d);return An.from(o)}get topLevelIds(){return this.columns.map(n=>n.topLevelIds)}get iterateTopLevelIds(){let n=this.columns;function*i(){for(let o of n)for(let s of o.topLevelIds)yield s}return i()}get inOrderIds(){return this.columns.flatMap(n=>n.inOrderIds)}get colLength(){return this.columns.length}get idLength(){return this.columns.reduce((n,i)=>n+i.nodes.length,0)}get _columnMap(){return new Map(this.columns.map(n=>[n.id,n]))}at(n){return this.columns[n]}get(n){return this._columnMap.get(n)}atOrThrow(n){let i=this.columns[n];if(!i)throw Error(`Column ${n} not found`);return i}hasOnlyOneColumn(){return this.columns.length===1}getColumns(){return this.columns}hasOnlyOneId(){return this.idLength===1}getColumnIds(){return this.columns.map(n=>n.id)}indexOf(n){return this.columns.indexOf(n)}addColumn(n,i=[]){return new An(this.columns.flatMap(o=>o.id===n?[o,To.from(i)]:[o]))}insertBreakpoint(n){let i=this.findWithId(n),[o,s]=i.split(n);return new An(this.columns.flatMap(c=>c===i?[o,s].filter(Boolean):[c]))}delete(n){if(this.columns.length<=1)return this;let i=this.indexOfOrThrow(n),o=i===0?1:i-1,s=[...this.columns],c=s[i];return s[o]=c.withNodes([...s[o].nodes,...c.nodes]),s.splice(i,1),new An(s)}mergeAllColumns(){if(this.columns.length<=1)return this;let n=this.columns.flatMap(o=>o.nodes),i=this.columns[0];return new An([i.withNodes(n)])}moveWithinColumn(n,i,o){return this.transform(n,s=>s.move(i,o))}moveAcrossColumns(n,i,o,s){let c=this.indexOfOrThrow(n),d=this.indexOfOrThrow(o),f=[...this.columns],p=f[c],y=p.nodes.findIndex(C=>C.value===i);if(y===-1)throw Error(`Node ${i} not found in column ${n}`);let w=p.nodes[y];f[c]=p.withNodes(p.nodes.filter((C,E)=>E!==y));let _=f[d];if(s){let C=_.indexOfOrThrow(s);f[d]=_.withNodes(mw(_.nodes,C,w))}else f[d]=_.withNodes([w,..._.nodes]);return new An(f)}indexOfOrThrow(n){let i=this.columns.findIndex(o=>o.id===n);if(i===-1)throw Error(`Column ${n} not found. Possible values: ${this.getColumnIds().join(", ")}`);return i}moveColumn(n,i){if(n===i)return this;let o=this.indexOfOrThrow(n),s=i==="_left_"?o-1:i==="_right_"?o+1:this.indexOfOrThrow(i);return zx(o,s),new An(Pl([...this.columns],o,s))}moveToNewColumn(n){let i=this.findWithId(n),o=this.columns.map(c=>c.id===i.id?c.delete(n):c),s=To.from([n]);return new An([...o,s])}findWithId(n){let i=this.columns.find(o=>o.inOrderIds.includes(n));if(!i)throw Se.log(`Possible values: ${this.columns.map(o=>o.inOrderIds).join(", ")}`),Error(`Cell ${n} not found in any column`);return i}transformWithCellId(n,i){let o=!1,s=this.columns.map(c=>{if(c.inOrderIds.includes(n)){let d=i(c);return c!==d&&(o=!0),d}return c});return o?new An(s):this}setupCellExists(){return this.columns.some(n=>n.topLevelIds.includes(yr))}insertId(n,i,o){return this.transform(i,s=>s.insert(n,o))}deleteById(n){return this.transformWithCellId(n,i=>i.delete(n))}compact(){return this.columns.length===1||!this.columns.some(n=>n.nodes.length===0)?this:new An(this.columns.filter(n=>n.nodes.length>0))}transform(n,i){let o=this._columnMap.get(n);if(!o)return Se.warn(`Column ${n} not found`),this;let s=i(o);return o===s?this:new An(this.columns.map(c=>c.id===n?s:c))}transformAll(n){let i=!1,o=this.columns.map(s=>{let c=n(s);return s.equals(c)||(i=!0),c});return i?new An(o):this}},tr(en.prototype,"isEmpty",[n0],Object.getOwnPropertyDescriptor(en.prototype,"isEmpty"),en.prototype),tr(en.prototype,"topLevelIds",[r0],Object.getOwnPropertyDescriptor(en.prototype,"topLevelIds"),en.prototype),tr(en.prototype,"inOrderIds",[i0],Object.getOwnPropertyDescriptor(en.prototype,"inOrderIds"),en.prototype),tr(en.prototype,"idLength",[a0],Object.getOwnPropertyDescriptor(en.prototype,"idLength"),en.prototype),tr(en.prototype,"_columnMap",[o0],Object.getOwnPropertyDescriptor(en.prototype,"_columnMap"),en.prototype),tr(en.prototype,"getColumnIds",[s0],Object.getOwnPropertyDescriptor(en.prototype,"getColumnIds"),en.prototype),en);let bd,wd,_d,l0,xd,c0,u0,d0,f0,kd,Sd,p0,Cd,Ed;bd=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Doctype=e.CDATA=e.Tag=e.Style=e.Script=e.Comment=e.Directive=e.Text=e.Root=e.isTag=e.ElementType=void 0;var n;(function(o){o.Root="root",o.Text="text",o.Directive="directive",o.Comment="comment",o.Script="script",o.Style="style",o.Tag="tag",o.CDATA="cdata",o.Doctype="doctype"})(n=e.ElementType||(e.ElementType={}));function i(o){return o.type===n.Tag||o.type===n.Script||o.type===n.Style}e.isTag=i,e.Root=n.Root,e.Text=n.Text,e.Directive=n.Directive,e.Comment=n.Comment,e.Script=n.Script,e.Style=n.Style,e.Tag=n.Tag,e.CDATA=n.CDATA,e.Doctype=n.Doctype})),wd=Ee((e=>{var n=e&&e.__extends||(function(){var P=function(A,W){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(de,fe){de.__proto__=fe}||function(de,fe){for(var we in fe)Object.prototype.hasOwnProperty.call(fe,we)&&(de[we]=fe[we])},P(A,W)};return function(A,W){if(typeof W!="function"&&W!==null)throw TypeError("Class extends value "+String(W)+" is not a constructor or null");P(A,W);function de(){this.constructor=A}A.prototype=W===null?Object.create(W):(de.prototype=W.prototype,new de)}})(),i=e&&e.__assign||function(){return i=Object.assign||function(P){for(var A,W=1,de=arguments.length;W<de;W++)for(var fe in A=arguments[W],A)Object.prototype.hasOwnProperty.call(A,fe)&&(P[fe]=A[fe]);return P},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.cloneNode=e.hasChildren=e.isDocument=e.isDirective=e.isComment=e.isText=e.isCDATA=e.isTag=e.Element=e.Document=e.CDATA=e.NodeWithChildren=e.ProcessingInstruction=e.Comment=e.Text=e.DataNode=e.Node=void 0;var o=bd(),s=(function(){function P(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(P.prototype,"parentNode",{get:function(){return this.parent},set:function(A){this.parent=A},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"previousSibling",{get:function(){return this.prev},set:function(A){this.prev=A},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"nextSibling",{get:function(){return this.next},set:function(A){this.next=A},enumerable:!1,configurable:!0}),P.prototype.cloneNode=function(A){return A===void 0&&(A=!1),K(this,A)},P})();e.Node=s;var c=(function(P){n(A,P);function A(W){var de=P.call(this)||this;return de.data=W,de}return Object.defineProperty(A.prototype,"nodeValue",{get:function(){return this.data},set:function(W){this.data=W},enumerable:!1,configurable:!0}),A})(s);e.DataNode=c;var d=(function(P){n(A,P);function A(){var W=P!==null&&P.apply(this,arguments)||this;return W.type=o.ElementType.Text,W}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),A})(c);e.Text=d;var f=(function(P){n(A,P);function A(){var W=P!==null&&P.apply(this,arguments)||this;return W.type=o.ElementType.Comment,W}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),A})(c);e.Comment=f;var p=(function(P){n(A,P);function A(W,de){var fe=P.call(this,de)||this;return fe.name=W,fe.type=o.ElementType.Directive,fe}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),A})(c);e.ProcessingInstruction=p;var y=(function(P){n(A,P);function A(W){var de=P.call(this)||this;return de.children=W,de}return Object.defineProperty(A.prototype,"firstChild",{get:function(){return this.children[0]??null},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"childNodes",{get:function(){return this.children},set:function(W){this.children=W},enumerable:!1,configurable:!0}),A})(s);e.NodeWithChildren=y;var w=(function(P){n(A,P);function A(){var W=P!==null&&P.apply(this,arguments)||this;return W.type=o.ElementType.CDATA,W}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),A})(y);e.CDATA=w;var _=(function(P){n(A,P);function A(){var W=P!==null&&P.apply(this,arguments)||this;return W.type=o.ElementType.Root,W}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),A})(y);e.Document=_;var C=(function(P){n(A,P);function A(W,de,fe,we){fe===void 0&&(fe=[]),we===void 0&&(we=W==="script"?o.ElementType.Script:W==="style"?o.ElementType.Style:o.ElementType.Tag);var J=P.call(this,fe)||this;return J.name=W,J.attribs=de,J.type=we,J}return Object.defineProperty(A.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"tagName",{get:function(){return this.name},set:function(W){this.name=W},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"attributes",{get:function(){var W=this;return Object.keys(this.attribs).map(function(de){var fe,we;return{name:de,value:W.attribs[de],namespace:(fe=W["x-attribsNamespace"])==null?void 0:fe[de],prefix:(we=W["x-attribsPrefix"])==null?void 0:we[de]}})},enumerable:!1,configurable:!0}),A})(y);e.Element=C;function E(P){return(0,o.isTag)(P)}e.isTag=E;function T(P){return P.type===o.ElementType.CDATA}e.isCDATA=T;function I(P){return P.type===o.ElementType.Text}e.isText=I;function $(P){return P.type===o.ElementType.Comment}e.isComment=$;function V(P){return P.type===o.ElementType.Directive}e.isDirective=V;function F(P){return P.type===o.ElementType.Root}e.isDocument=F;function N(P){return Object.prototype.hasOwnProperty.call(P,"children")}e.hasChildren=N;function K(P,A){A===void 0&&(A=!1);var W;if(I(P))W=new d(P.data);else if($(P))W=new f(P.data);else if(E(P)){var de=A?pe(P.children):[],fe=new C(P.name,i({},P.attribs),de);de.forEach(function(Ce){return Ce.parent=fe}),P.namespace!=null&&(fe.namespace=P.namespace),P["x-attribsNamespace"]&&(fe["x-attribsNamespace"]=i({},P["x-attribsNamespace"])),P["x-attribsPrefix"]&&(fe["x-attribsPrefix"]=i({},P["x-attribsPrefix"])),W=fe}else if(T(P)){var de=A?pe(P.children):[],we=new w(de);de.forEach(function(Z){return Z.parent=we}),W=we}else if(F(P)){var de=A?pe(P.children):[],J=new _(de);de.forEach(function(Z){return Z.parent=J}),P["x-mode"]&&(J["x-mode"]=P["x-mode"]),W=J}else if(V(P)){var be=new p(P.name,P.data);P["x-name"]!=null&&(be["x-name"]=P["x-name"],be["x-publicId"]=P["x-publicId"],be["x-systemId"]=P["x-systemId"]),W=be}else throw Error(`Not implemented yet: ${P.type}`);return W.startIndex=P.startIndex,W.endIndex=P.endIndex,P.sourceCodeLocation!=null&&(W.sourceCodeLocation=P.sourceCodeLocation),W}e.cloneNode=K;function pe(P){for(var A=P.map(function(de){return K(de,!0)}),W=1;W<A.length;W++)A[W].prev=A[W-1],A[W-1].next=A[W];return A}})),_d=Ee((e=>{var n=e&&e.__createBinding||(Object.create?(function(f,p,y,w){w===void 0&&(w=y);var _=Object.getOwnPropertyDescriptor(p,y);(!_||("get"in _?!p.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return p[y]}}),Object.defineProperty(f,w,_)}):(function(f,p,y,w){w===void 0&&(w=y),f[w]=p[y]})),i=e&&e.__exportStar||function(f,p){for(var y in f)y!=="default"&&!Object.prototype.hasOwnProperty.call(p,y)&&n(p,f,y)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var o=bd(),s=wd();i(wd(),e);var c={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},d=(function(){function f(p,y,w){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof y=="function"&&(w=y,y=c),typeof p=="object"&&(y=p,p=void 0),this.callback=p??null,this.options=y??c,this.elementCB=w??null}return f.prototype.onparserinit=function(p){this.parser=p},f.prototype.onreset=function(){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},f.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},f.prototype.onerror=function(p){this.handleCallback(p)},f.prototype.onclosetag=function(){this.lastNode=null;var p=this.tagStack.pop();this.options.withEndIndices&&(p.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(p)},f.prototype.onopentag=function(p,y){var w=this.options.xmlMode?o.ElementType.Tag:void 0,_=new s.Element(p,y,void 0,w);this.addNode(_),this.tagStack.push(_)},f.prototype.ontext=function(p){var y=this.lastNode;if(y&&y.type===o.ElementType.Text)y.data+=p,this.options.withEndIndices&&(y.endIndex=this.parser.endIndex);else{var w=new s.Text(p);this.addNode(w),this.lastNode=w}},f.prototype.oncomment=function(p){if(this.lastNode&&this.lastNode.type===o.ElementType.Comment){this.lastNode.data+=p;return}var y=new s.Comment(p);this.addNode(y),this.lastNode=y},f.prototype.oncommentend=function(){this.lastNode=null},f.prototype.oncdatastart=function(){var p=new s.Text(""),y=new s.CDATA([p]);this.addNode(y),p.parent=y,this.lastNode=p},f.prototype.oncdataend=function(){this.lastNode=null},f.prototype.onprocessinginstruction=function(p,y){var w=new s.ProcessingInstruction(p,y);this.addNode(w)},f.prototype.handleCallback=function(p){if(typeof this.callback=="function")this.callback(p,this.dom);else if(p)throw p},f.prototype.addNode=function(p){var y=this.tagStack[this.tagStack.length-1],w=y.children[y.children.length-1];this.options.withStartIndices&&(p.startIndex=this.parser.startIndex),this.options.withEndIndices&&(p.endIndex=this.parser.endIndex),y.children.push(p),w&&(p.prev=w,w.next=p),p.parent=y,this.lastNode=null},f})();e.DomHandler=d,e.default=d})),l0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=e.CARRIAGE_RETURN_PLACEHOLDER=e.CARRIAGE_RETURN_REGEX=e.CARRIAGE_RETURN=e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES=void 0,e.CASE_SENSITIVE_TAG_NAMES="animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.linearGradient.radialGradient.textPath".split("."),e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES.reduce(function(n,i){return n[i.toLowerCase()]=i,n},{}),e.CARRIAGE_RETURN="\r",e.CARRIAGE_RETURN_REGEX=new RegExp(e.CARRIAGE_RETURN,"g"),e.CARRIAGE_RETURN_PLACEHOLDER=`__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_${Date.now()}__`,e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(e.CARRIAGE_RETURN_PLACEHOLDER,"g")})),xd=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatAttributes=s,e.escapeSpecialCharacters=d,e.revertEscapedCharacters=f,e.formatDOM=p;var n=_d(),i=l0();function o(y){return i.CASE_SENSITIVE_TAG_NAMES_MAP[y]}function s(y){for(var w={},_=0,C=y.length;_<C;_++){var E=y[_];w[E.name]=E.value}return w}function c(y){return y=y.toLowerCase(),o(y)||y}function d(y){return y.replace(i.CARRIAGE_RETURN_REGEX,i.CARRIAGE_RETURN_PLACEHOLDER)}function f(y){return y.replace(i.CARRIAGE_RETURN_PLACEHOLDER_REGEX,i.CARRIAGE_RETURN)}function p(y,w,_){w===void 0&&(w=null);for(var C=[],E,T=0,I=y.length;T<I;T++){var $=y[T];switch($.nodeType){case 1:var V=c($.nodeName);E=new n.Element(V,s($.attributes)),E.children=p(V==="template"?$.content.childNodes:$.childNodes,E);break;case 3:E=new n.Text(f($.nodeValue));break;case 8:E=new n.Comment($.nodeValue);break;default:continue}var F=C[T-1]||null;F&&(F.next=E),E.parent=w,E.prev=F,E.next=null,C.push(E)}return _&&(E=new n.ProcessingInstruction(_.substring(0,_.indexOf(" ")).toLowerCase(),_),E.next=C[0]||null,E.parent=w,C.unshift(E),C[1]&&(C[1].prev=C[0])),C}})),c0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=$;var n=xd(),i="html",o="head",s="body",c=/<([a-zA-Z]+[0-9]?)/,d=/<head[^]*>/i,f=/<body[^]*>/i,p=function(V,F){throw Error("This browser does not support `document.implementation.createHTMLDocument`")},y=function(V,F){throw Error("This browser does not support `DOMParser.prototype.parseFromString`")},w=typeof window=="object"&&window.DOMParser;if(typeof w=="function"){var _=new w,C="text/html";y=function(V,F){return F&&(V=`<${F}>${V}</${F}>`),_.parseFromString(V,C)},p=y}if(typeof document=="object"&&document.implementation){var E=document.implementation.createHTMLDocument();p=function(V,F){if(F){var N=E.documentElement.querySelector(F);return N&&(N.innerHTML=V),E}return E.documentElement.innerHTML=V,E}}var T=typeof document=="object"&&document.createElement("template"),I;T&&T.content&&(I=function(V){return T.innerHTML=V,T.content.childNodes});function $(V){var F,N;V=(0,n.escapeSpecialCharacters)(V);var K=V.match(c),pe=K&&K[1]?K[1].toLowerCase():"";switch(pe){case i:var P=y(V);if(!d.test(V)){var W=P.querySelector(o);(F=W==null?void 0:W.parentNode)==null||F.removeChild(W)}if(!f.test(V)){var W=P.querySelector(s);(N=W==null?void 0:W.parentNode)==null||N.removeChild(W)}return P.querySelectorAll(i);case o:case s:var A=p(V).querySelectorAll(pe);return f.test(V)&&d.test(V)?A[0].parentNode.childNodes:A;default:if(I)return I(V);var W=p(V,s).querySelector(s);return W.childNodes}}})),u0=Ee((e=>{var n=e&&e.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var i=n(c0()),o=xd(),s=/<(![a-zA-Z\s]+)>/;function c(d){if(typeof d!="string")throw TypeError("First argument must be a string");if(!d)return[];var f=d.match(s),p=f?f[1]:void 0;return(0,o.formatDOM)((0,i.default)(d),null,p)}})),d0=Ee((e=>{e.SAME=0,e.CAMELCASE=1,e.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}})),f0=Ee((e=>{var n=0,i=1,o=2,s=3,c=4,d=5,f=6;function p(N){return w.hasOwnProperty(N)?w[N]:null}function y(N,K,pe,P,A,W,de){this.acceptsBooleans=K===o||K===s||K===c,this.attributeName=P,this.attributeNamespace=A,this.mustUseProperty=pe,this.propertyName=N,this.type=K,this.sanitizeURL=W,this.removeEmptyString=de}var w={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(N=>{w[N]=new y(N,n,!1,N,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([N,K])=>{w[N]=new y(N,i,!1,K,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(N=>{w[N]=new y(N,o,!1,N.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(N=>{w[N]=new y(N,o,!1,N,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(N=>{w[N]=new y(N,s,!1,N.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(N=>{w[N]=new y(N,s,!0,N,null,!1,!1)}),["capture","download"].forEach(N=>{w[N]=new y(N,c,!1,N,null,!1,!1)}),["cols","rows","size","span"].forEach(N=>{w[N]=new y(N,f,!1,N,null,!1,!1)}),["rowSpan","start"].forEach(N=>{w[N]=new y(N,d,!1,N.toLowerCase(),null,!1,!1)});var _=/[\-\:]([a-z])/g,C=N=>N[1].toUpperCase();"accent-height.alignment-baseline.arabic-form.baseline-shift.cap-height.clip-path.clip-rule.color-interpolation.color-interpolation-filters.color-profile.color-rendering.dominant-baseline.enable-background.fill-opacity.fill-rule.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.glyph-name.glyph-orientation-horizontal.glyph-orientation-vertical.horiz-adv-x.horiz-origin-x.image-rendering.letter-spacing.lighting-color.marker-end.marker-mid.marker-start.overline-position.overline-thickness.paint-order.panose-1.pointer-events.rendering-intent.shape-rendering.stop-color.stop-opacity.strikethrough-position.strikethrough-thickness.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.text-anchor.text-decoration.text-rendering.underline-position.underline-thickness.unicode-bidi.unicode-range.units-per-em.v-alphabetic.v-hanging.v-ideographic.v-mathematical.vector-effect.vert-adv-y.vert-origin-x.vert-origin-y.word-spacing.writing-mode.xmlns:xlink.x-height".split(".").forEach(N=>{let K=N.replace(_,C);w[K]=new y(K,i,!1,N,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(N=>{let K=N.replace(_,C);w[K]=new y(K,i,!1,N,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(N=>{let K=N.replace(_,C);w[K]=new y(K,i,!1,N,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(N=>{w[N]=new y(N,i,!1,N.toLowerCase(),null,!1,!1)});var E="xlinkHref";w[E]=new y("xlinkHref",i,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(N=>{w[N]=new y(N,i,!1,N.toLowerCase(),null,!0,!0)});var{CAMELCASE:T,SAME:I,possibleStandardNames:$}=d0(),V=RegExp.prototype.test.bind(RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),F=Object.keys($).reduce((N,K)=>{let pe=$[K];return pe===I?N[K]=K:pe===T?N[K.toLowerCase()]=K:N[K]=pe,N},{});e.BOOLEAN=s,e.BOOLEANISH_STRING=o,e.NUMERIC=d,e.OVERLOADED_BOOLEAN=c,e.POSITIVE_NUMERIC=f,e.RESERVED=n,e.STRING=i,e.getPropertyInfo=p,e.isCustomAttribute=V,e.possibleStandardNames=F})),kd=Ee((e=>{var n=e&&e.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.returnFirstArg=e.canTextBeChildOfNode=e.ELEMENTS_WITH_NO_TEXT_CHILDREN=e.PRESERVE_CUSTOM_ATTRIBUTES=void 0,e.isCustomComponent=c,e.setStyleProp=f;var i=Tu(),o=n(iD()),s=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function c(p,y){return p.includes("-")?!s.has(p):!!(y&&typeof y.is=="string")}var d={reactCompat:!0};function f(p,y){if(typeof p=="string"){if(!p.trim()){y.style={};return}try{y.style=(0,o.default)(p,d)}catch{y.style={}}}}e.PRESERVE_CUSTOM_ATTRIBUTES=Number(i.version.split(".")[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]),e.canTextBeChildOfNode=function(p){return!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(p.name)},e.returnFirstArg=function(p){return p}})),Sd=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var n=f0(),i=kd(),o=["checked","value"],s=["input","select","textarea"],c={reset:!0,submit:!0};function d(p,y){p===void 0&&(p={});var w={},_=!!(p.type&&c[p.type]);for(var C in p){var E=p[C];if((0,n.isCustomAttribute)(C)){w[C]=E;continue}var T=C.toLowerCase(),I=f(T);if(I){var $=(0,n.getPropertyInfo)(I);switch(o.includes(I)&&s.includes(y)&&!_&&(I=f("default"+T)),w[I]=E,$&&$.type){case n.BOOLEAN:w[I]=!0;break;case n.OVERLOADED_BOOLEAN:E===""&&(w[I]=!0);break}continue}i.PRESERVE_CUSTOM_ATTRIBUTES&&(w[C]=E)}return(0,i.setStyleProp)(p.style,w),w}function f(p){return n.possibleStandardNames[p]}})),p0=Ee((e=>{var n=e&&e.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var i=Tu(),o=n(Sd()),s=kd(),c={cloneElement:i.cloneElement,createElement:i.createElement,isValidElement:i.isValidElement};function d(p,y){y===void 0&&(y={});for(var w=[],_=typeof y.replace=="function",C=y.transform||s.returnFirstArg,E=y.library||c,T=E.cloneElement,I=E.createElement,$=E.isValidElement,V=p.length,F=0;F<V;F++){var N=p[F];if(_){var K=y.replace(N,F);if($(K)){V>1&&(K=T(K,{key:K.key||F})),w.push(C(K,N,F));continue}}if(N.type==="text"){var pe=!N.data.trim().length;if(pe&&N.parent&&!(0,s.canTextBeChildOfNode)(N.parent)||y.trim&&pe)continue;w.push(C(N.data,N,F));continue}var P=N,A={};f(P)?((0,s.setStyleProp)(P.attribs.style,P.attribs),A=P.attribs):P.attribs&&(A=(0,o.default)(P.attribs,P.name));var W=void 0;switch(N.type){case"script":case"style":N.children[0]&&(A.dangerouslySetInnerHTML={__html:N.children[0].data});break;case"tag":N.name==="textarea"&&N.children[0]?A.defaultValue=N.children[0].data:N.children&&N.children.length&&(W=d(N.children,y));break;default:continue}V>1&&(A.key=F),w.push(C(I(N.name,A,W),N,F))}return w.length===1?w[0]:w}function f(p){return s.PRESERVE_CUSTOM_ATTRIBUTES&&p.type==="tag"&&(0,s.isCustomComponent)(p.name,p.attribs)}})),Cd=Ee((e=>{var n=e&&e.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToDOM=e.domToReact=e.attributesToProps=e.Text=e.ProcessingInstruction=e.Element=e.Comment=void 0,e.default=d;var i=n(u0());e.htmlToDOM=i.default,e.attributesToProps=n(Sd()).default;var o=n(p0());e.domToReact=o.default;var s=_d();Object.defineProperty(e,"Comment",{enumerable:!0,get:function(){return s.Comment}}),Object.defineProperty(e,"Element",{enumerable:!0,get:function(){return s.Element}}),Object.defineProperty(e,"ProcessingInstruction",{enumerable:!0,get:function(){return s.ProcessingInstruction}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return s.Text}});var c={lowerCaseAttributeNames:!1};function d(f,p){if(typeof f!="string")throw TypeError("First argument must be a string");return f?(0,o.default)((0,i.default)(f,(p==null?void 0:p.htmlparser2)||c),p):[]}})),Ed=gh(Cd(),1),Pa=Cd(),Uh=Ed.default.default||Ed.default;let Ql;Ql=(e,n)=>{let[i,...o]=n.split("."),s=(e.attribs.class||"").split(" ");return e.tagName===i&&o.every(c=>s.includes(c))},Zw=e=>{var n;return e&&Ql(e,"span.nb")&&e.firstChild instanceof Pa.Text&&((n=e.firstChild.nodeValue)==null?void 0:n.includes("__marimo__"))},Fh=function(e){var n,i,o;if(e instanceof Pa.Element&&e.firstChild instanceof Pa.Text&&Ql(e,"span.nb")){let s=e.next;if(s&&s instanceof Pa.Text){let c=s.next;if(c&&c instanceof Pa.Element&&c.firstChild instanceof Pa.Text&&Ql(c,"span.m")){let d=Number.parseInt(c.firstChild.nodeValue||"0",10);if((n=e.firstChild.nodeValue)!=null&&n.includes("__marimo__")){let f=(i=/__marimo__cell_(\w+)_/.exec(e.firstChild.nodeValue))==null?void 0:i[1];if(f&&d)return{kind:"cell",cellId:f,lineNumber:d}}else{let f=(o=/"(.+?)"/.exec(e.firstChild.nodeValue))==null?void 0:o[1];if(f&&d)return{kind:"file",filePath:f,lineNumber:d}}}}}return null},Ih=function(e){let n=[];return Uh(e,{replace:i=>{let o=Fh(i);if(o)return n.push(o),"dummy"}}),n};function h0(e){return n=>{let i=!1;for(let o of n)o&&(i=e(o)||i);return i}}const Bx=h0(R4),Hx=h0(D4);let Td,m0,Ro,g0,Do,y0;Td=Ee(((e,n)=>{var i=typeof Reflect=="object"?Reflect:null,o=i&&typeof i.apply=="function"?i.apply:function(P,A,W){return Function.prototype.apply.call(P,A,W)},s=i&&typeof i.ownKeys=="function"?i.ownKeys:Object.getOwnPropertySymbols?function(P){return Object.getOwnPropertyNames(P).concat(Object.getOwnPropertySymbols(P))}:function(P){return Object.getOwnPropertyNames(P)};function c(P){console&&console.warn&&console.warn(P)}var d=Number.isNaN||function(P){return P!==P};function f(){f.init.call(this)}n.exports=f,n.exports.once=N,f.EventEmitter=f,f.prototype._events=void 0,f.prototype._eventsCount=0,f.prototype._maxListeners=void 0;var p=10;function y(P){if(typeof P!="function")throw TypeError('The "listener" argument must be of type Function. Received type '+typeof P)}Object.defineProperty(f,"defaultMaxListeners",{enumerable:!0,get:function(){return p},set:function(P){if(typeof P!="number"||P<0||d(P))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+P+".");p=P}}),f.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},f.prototype.setMaxListeners=function(P){if(typeof P!="number"||P<0||d(P))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+P+".");return this._maxListeners=P,this};function w(P){return P._maxListeners===void 0?f.defaultMaxListeners:P._maxListeners}f.prototype.getMaxListeners=function(){return w(this)},f.prototype.emit=function(P){for(var A=[],W=1;W<arguments.length;W++)A.push(arguments[W]);var de=P==="error",fe=this._events;if(fe!==void 0)de&&(de=fe.error===void 0);else if(!de)return!1;if(de){var we;if(A.length>0&&(we=A[0]),we instanceof Error)throw we;var J=Error("Unhandled error."+(we?" ("+we.message+")":""));throw J.context=we,J}var be=fe[P];if(be===void 0)return!1;if(typeof be=="function")o(be,this,A);else for(var Ce=be.length,Z=$(be,Ce),W=0;W<Ce;++W)o(Z[W],this,A);return!0};function _(P,A,W,de){var fe,we,J;if(y(W),we=P._events,we===void 0?(we=P._events=Object.create(null),P._eventsCount=0):(we.newListener!==void 0&&(P.emit("newListener",A,W.listener?W.listener:W),we=P._events),J=we[A]),J===void 0)J=we[A]=W,++P._eventsCount;else if(typeof J=="function"?J=we[A]=de?[W,J]:[J,W]:de?J.unshift(W):J.push(W),fe=w(P),fe>0&&J.length>fe&&!J.warned){J.warned=!0;var be=Error("Possible EventEmitter memory leak detected. "+J.length+" "+String(A)+" listeners added. Use emitter.setMaxListeners() to increase limit");be.name="MaxListenersExceededWarning",be.emitter=P,be.type=A,be.count=J.length,c(be)}return P}f.prototype.addListener=function(P,A){return _(this,P,A,!1)},f.prototype.on=f.prototype.addListener,f.prototype.prependListener=function(P,A){return _(this,P,A,!0)};function C(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function E(P,A,W){var de={fired:!1,wrapFn:void 0,target:P,type:A,listener:W},fe=C.bind(de);return fe.listener=W,de.wrapFn=fe,fe}f.prototype.once=function(P,A){return y(A),this.on(P,E(this,P,A)),this},f.prototype.prependOnceListener=function(P,A){return y(A),this.prependListener(P,E(this,P,A)),this},f.prototype.removeListener=function(P,A){var W,de,fe,we,J;if(y(A),de=this._events,de===void 0||(W=de[P],W===void 0))return this;if(W===A||W.listener===A)--this._eventsCount===0?this._events=Object.create(null):(delete de[P],de.removeListener&&this.emit("removeListener",P,W.listener||A));else if(typeof W!="function"){for(fe=-1,we=W.length-1;we>=0;we--)if(W[we]===A||W[we].listener===A){J=W[we].listener,fe=we;break}if(fe<0)return this;fe===0?W.shift():V(W,fe),W.length===1&&(de[P]=W[0]),de.removeListener!==void 0&&this.emit("removeListener",P,J||A)}return this},f.prototype.off=f.prototype.removeListener,f.prototype.removeAllListeners=function(P){var A,W=this._events,de;if(W===void 0)return this;if(W.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):W[P]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete W[P]),this;if(arguments.length===0){var fe=Object.keys(W),we;for(de=0;de<fe.length;++de)we=fe[de],we!=="removeListener"&&this.removeAllListeners(we);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(A=W[P],typeof A=="function")this.removeListener(P,A);else if(A!==void 0)for(de=A.length-1;de>=0;de--)this.removeListener(P,A[de]);return this};function T(P,A,W){var de=P._events;if(de===void 0)return[];var fe=de[A];return fe===void 0?[]:typeof fe=="function"?W?[fe.listener||fe]:[fe]:W?F(fe):$(fe,fe.length)}f.prototype.listeners=function(P){return T(this,P,!0)},f.prototype.rawListeners=function(P){return T(this,P,!1)},f.listenerCount=function(P,A){return typeof P.listenerCount=="function"?P.listenerCount(A):I.call(P,A)},f.prototype.listenerCount=I;function I(P){var A=this._events;if(A!==void 0){var W=A[P];if(typeof W=="function")return 1;if(W!==void 0)return W.length}return 0}f.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]};function $(P,A){for(var W=Array(A),de=0;de<A;++de)W[de]=P[de];return W}function V(P,A){for(;A+1<P.length;A++)P[A]=P[A+1];P.pop()}function F(P){for(var A=Array(P.length),W=0;W<A.length;++W)A[W]=P[W].listener||P[W];return A}function N(P,A){return new Promise(function(W,de){function fe(J){P.removeListener(A,we),de(J)}function we(){typeof P.removeListener=="function"&&P.removeListener("error",fe),W([].slice.call(arguments))}pe(P,A,we,{once:!0}),A!=="error"&&K(P,fe,{once:!0})})}function K(P,A,W){typeof P.on=="function"&&pe(P,"error",A,W)}function pe(P,A,W,de){if(typeof P.on=="function")de.once?P.once(A,W):P.on(A,W);else if(typeof P.addEventListener=="function")P.addEventListener(A,function fe(we){de.once&&P.removeEventListener(A,fe),W(we)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof P)}})),m0=Ee((e=>{var n=e&&e.__awaiter||function(s,c,d,f){function p(y){return y instanceof d?y:new d(function(w){w(y)})}return new(d||(d=Promise))(function(y,w){function _(T){try{E(f.next(T))}catch(I){w(I)}}function C(T){try{E(f.throw(T))}catch(I){w(I)}}function E(T){T.done?y(T.value):p(T.value).then(_,C)}E((f=f.apply(s,c||[])).next())})},i=e&&e.__generator||function(s,c){var d={label:0,sent:function(){if(y[0]&1)throw y[1];return y[1]},trys:[],ops:[]},f,p,y,w;return w={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(w[Symbol.iterator]=function(){return this}),w;function _(E){return function(T){return C([E,T])}}function C(E){if(f)throw TypeError("Generator is already executing.");for(;d;)try{if(f=1,p&&(y=E[0]&2?p.return:E[0]?p.throw||((y=p.return)&&y.call(p),0):p.next)&&!(y=y.call(p,E[1])).done)return y;switch(p=0,y&&(E=[E[0]&2,y.value]),E[0]){case 0:case 1:y=E;break;case 4:return d.label++,{value:E[1],done:!1};case 5:d.label++,p=E[1],E=[0];continue;case 7:E=d.ops.pop(),d.trys.pop();continue;default:if(y=d.trys,!(y=y.length>0&&y[y.length-1])&&(E[0]===6||E[0]===2)){d=0;continue}if(E[0]===3&&(!y||E[1]>y[0]&&E[1]<y[3])){d.label=E[1];break}if(E[0]===6&&d.label<y[1]){d.label=y[1],y=E;break}if(y&&d.label<y[2]){d.label=y[2],d.ops.push(E);break}y[2]&&d.ops.pop(),d.trys.pop();continue}E=c.call(s,d)}catch(T){E=[6,T],p=0}finally{f=y=0}if(E[0]&5)throw E[1];return{value:E[0]?E[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.defaultNextRequest=void 0;var o=Td();e.defaultNextRequest=function(){var s=-1;return function(){return++s}},e.default=(function(){function s(c,d){d===void 0&&(d=e.defaultNextRequest()),this.batch=[],this.batchStarted=!1,this.lastId=-1,this.transports=c,this.requests={},this.connectPromise=this.connect(),this.requestChannel=new o.EventEmitter,this.nextID=d}return s.prototype.connect=function(){var c=this;return Promise.all(this.transports.map(function(d){return n(c,void 0,void 0,function(){return i(this,function(f){switch(f.label){case 0:return d.subscribe("error",this.handleError.bind(this)),d.subscribe("notification",this.handleNotification.bind(this)),[4,d.connect()];case 1:return f.sent(),[2]}})})}))},s.prototype.getPrimaryTransport=function(){return this.transports[0]},s.prototype.request=function(c,d,f){return d===void 0&&(d=!1),n(this,void 0,void 0,function(){var p,y,w,_,C=this;return i(this,function(E){return p=this.nextID().toString(),y=d?null:p,w={request:this.makeRequest(c.method,c.params||[],y),internalID:p},this.batchStarted?(_=new Promise(function(T,I){C.batch.push({resolve:T,reject:I,request:w})}),[2,_]):[2,this.getPrimaryTransport().sendData(w,f)]})})},s.prototype.close=function(){this.requestChannel.removeAllListeners(),this.transports.forEach(function(c){c.unsubscribe(),c.close()})},s.prototype.startBatch=function(){this.batchStarted=!0},s.prototype.stopBatch=function(){if(this.batchStarted===!1)throw Error("cannot end that which has never started");if(this.batch.length===0){this.batchStarted=!1;return}this.getPrimaryTransport().sendData(this.batch),this.batch=[],this.batchStarted=!1},s.prototype.makeRequest=function(c,d,f){return f?{jsonrpc:"2.0",id:f,method:c,params:d}:{jsonrpc:"2.0",method:c,params:d}},s.prototype.handleError=function(c){this.requestChannel.emit("error",c)},s.prototype.handleNotification=function(c){this.requestChannel.emit("notification",c)},s})()})),Ro=Ee((e=>{var n=e&&e.__extends||(function(){var o=function(s,c){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var p in f)f.hasOwnProperty(p)&&(d[p]=f[p])},o(s,c)};return function(s,c){o(s,c);function d(){this.constructor=s}s.prototype=c===null?Object.create(c):(d.prototype=c.prototype,new d)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.convertJSONToRPCError=e.JSONRPCError=e.ERR_UNKNOWN=e.ERR_MISSIING_ID=e.ERR_TIMEOUT=void 0,e.ERR_TIMEOUT=7777,e.ERR_MISSIING_ID=7878,e.ERR_UNKNOWN=7979;var i=(function(o){n(s,o);function s(c,d,f){var p=this.constructor,y=o.call(this,c)||this;return y.message=c,y.code=d,y.data=f,Object.setPrototypeOf(y,p.prototype),y}return s})(Error);e.JSONRPCError=i,e.convertJSONToRPCError=function(o){if(o.error){var s=o.error,c=s.message,d=s.code,f=s.data;return new i(c,d,f)}return new i("Unknown error",e.ERR_UNKNOWN,o)}})),g0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TransportRequestManager=void 0;var n=Td(),i=Ro();e.TransportRequestManager=(function(){function o(){this.pendingRequest={},this.pendingBatchRequest={},this.transportEventChannel=new n.EventEmitter}return o.prototype.addRequest=function(s,c){return this.transportEventChannel.emit("pending",s),s instanceof Array?(this.addBatchReq(s,c),Promise.resolve()):this.addReq(s.internalID,c)},o.prototype.settlePendingRequest=function(s,c){var d=this;s.forEach(function(f){var p=d.pendingRequest[f.internalID];if(delete d.pendingBatchRequest[f.internalID],p!==void 0){if(c){p.reject(c);return}p.resolve(),(f.request.id===null||f.request.id===void 0)&&delete d.pendingRequest[f.internalID]}})},o.prototype.isPendingRequest=function(s){return this.pendingRequest.hasOwnProperty(s)},o.prototype.resolveResponse=function(s,c){c===void 0&&(c=!0);var d=s;try{return d=JSON.parse(s),this.checkJSONRPC(d)===!1?void 0:d instanceof Array?this.resolveBatch(d,c):this.resolveRes(d,c)}catch{var f=new i.JSONRPCError("Bad response format",i.ERR_UNKNOWN,s);return c&&this.transportEventChannel.emit("error",f),f}},o.prototype.addBatchReq=function(s,c){var d=this;return s.forEach(function(f){var p=f.resolve,y=f.reject,w=f.request.internalID;d.pendingBatchRequest[w]=!0,d.pendingRequest[w]={resolve:p,reject:y}}),Promise.resolve()},o.prototype.addReq=function(s,c){var d=this;return new Promise(function(f,p){c!==null&&c&&d.setRequestTimeout(s,c,p),d.pendingRequest[s]={resolve:f,reject:p}})},o.prototype.checkJSONRPC=function(s){var c=[s];return s instanceof Array&&(c=s),c.every(function(d){return d.result!==void 0||d.error!==void 0||d.method!==void 0})},o.prototype.processResult=function(s,c){if(s.error){var d=i.convertJSONToRPCError(s);c.reject(d);return}c.resolve(s.result)},o.prototype.resolveBatch=function(s,c){var d=this,f=s.map(function(p){return d.resolveRes(p,c)}).filter(function(p){return p});if(f.length>0)return f[0]},o.prototype.resolveRes=function(s,c){var d=s.id,f=s.error,p=this.pendingRequest[d];if(p){delete this.pendingRequest[d],this.processResult(s,p),this.transportEventChannel.emit("response",s);return}if(d===void 0&&f===void 0){this.transportEventChannel.emit("notification",s);return}var y;return f&&(y=i.convertJSONToRPCError(s)),c&&f&&y&&this.transportEventChannel.emit("error",y),y},o.prototype.setRequestTimeout=function(s,c,d){var f=this;setTimeout(function(){delete f.pendingRequest[s],d(new i.JSONRPCError("Request timeout request took longer than "+c+" ms to resolve",i.ERR_TIMEOUT))},c)},o})()})),Oa=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Transport=void 0;var n=g0();e.Transport=(function(){function i(){this.transportRequestManager=new n.TransportRequestManager,this.transportRequestManager.transportEventChannel.on("error",function(){})}return i.prototype.subscribe=function(o,s){this.transportRequestManager.transportEventChannel.addListener(o,s)},i.prototype.unsubscribe=function(o,s){if(!o)return this.transportRequestManager.transportEventChannel.removeAllListeners();o&&s&&this.transportRequestManager.transportEventChannel.removeListener(o,s)},i.prototype.parseData=function(o){return o instanceof Array?o.map(function(s){return s.request.request}):o.request},i})()})),Do=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getNotifications=e.getBatchRequests=e.isNotification=void 0,e.isNotification=function(n){return n.request.id===void 0||n.request.id===null},e.getBatchRequests=function(n){return n instanceof Array?n.filter(function(i){return i.request.request.id!=null}).map(function(i){return i.request}):[]},e.getNotifications=function(n){return n instanceof Array?n.filter(function(i){return e.isNotification(i.request)}).map(function(i){return i.request}):e.isNotification(n)?[n]:[]}})),y0=Ee((e=>{var n=e&&e.__extends||(function(){var c=function(d,f){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,y){p.__proto__=y}||function(p,y){for(var w in y)y.hasOwnProperty(w)&&(p[w]=y[w])},c(d,f)};return function(d,f){c(d,f);function p(){this.constructor=d}d.prototype=f===null?Object.create(f):(p.prototype=f.prototype,new p)}})();Object.defineProperty(e,"__esModule",{value:!0});var i=Oa(),o=Do(),s=Ro();e.default=(function(c){n(d,c);function d(f,p,y){var w=c.call(this)||this;return w.connection=f,w.reqUri=p,w.resUri=y,w}return d.prototype.connect=function(){var f=this;return this.connection.on(this.resUri,function(p){f.transportRequestManager.resolveResponse(p)}),Promise.resolve()},d.prototype.sendData=function(f,p){p===void 0&&(p=null);var y=this.transportRequestManager.addRequest(f,p),w=o.getNotifications(f),_=this.parseData(f);try{return this.connection.emit(this.reqUri,_),this.transportRequestManager.settlePendingRequest(w),y}catch(E){var C=new s.JSONRPCError(E.message,s.ERR_UNKNOWN,E);return this.transportRequestManager.settlePendingRequest(w,C),Promise.reject(C)}},d.prototype.close=function(){this.connection.removeAllListeners()},d})(i.Transport)}));function Vx(e){return e&&DataView.prototype.isPrototypeOf(e)}function Oo(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Rd(e){return typeof e!="string"&&(e=String(e)),e}function Dd(e){var n={next:function(){var i=e.shift();return{done:i===void 0,value:i}}};return Rn.iterable&&(n[Symbol.iterator]=function(){return n}),n}function cn(e){this.map={},e instanceof cn?e.forEach(function(n,i){this.append(i,n)},this):Array.isArray(e)?e.forEach(function(n){if(n.length!=2)throw TypeError("Headers constructor: expected name/value pair to be length 2, found"+n.length);this.append(n[0],n[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(n){this.append(n,e[n])},this)}function Od(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}}function v0(e){return new Promise(function(n,i){e.onload=function(){n(e.result)},e.onerror=function(){i(e.error)}})}function $x(e){var n=new FileReader,i=v0(n);return n.readAsArrayBuffer(e),i}function Wx(e){var n=new FileReader,i=v0(n),o=/charset=([A-Za-z0-9_-]+)/.exec(e.type),s=o?o[1]:"utf-8";return n.readAsText(e,s),i}function Ux(e){for(var n=new Uint8Array(e),i=Array(n.length),o=0;o<n.length;o++)i[o]=String.fromCharCode(n[o]);return i.join("")}function b0(e){if(e.slice)return e.slice(0);var n=new Uint8Array(e.byteLength);return n.set(new Uint8Array(e)),n.buffer}function w0(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:Rn.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Rn.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Rn.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Rn.arrayBuffer&&Rn.blob&&Vx(e)?(this._bodyArrayBuffer=b0(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Rn.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||k0(e))?this._bodyArrayBuffer=b0(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Rn.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Rn.blob&&(this.blob=function(){var e=Od(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return Od(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(Rn.blob)return this.blob().then($x);throw Error("could not read as ArrayBuffer")},this.text=function(){var e=Od(this);if(e)return e;if(this._bodyBlob)return Wx(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Ux(this._bodyArrayBuffer));if(this._bodyFormData)throw Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Rn.formData&&(this.formData=function(){return this.text().then(Qx)}),this.json=function(){return this.text().then(JSON.parse)},this}function Kx(e){var n=e.toUpperCase();return S0.indexOf(n)>-1?n:e}function Aa(e,n){if(!(this instanceof Aa))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');n||(n={});var i=n.body;if(e instanceof Aa){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,n.headers||(this.headers=new cn(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!i&&e._bodyInit!=null&&(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=n.credentials||this.credentials||"same-origin",(n.headers||!this.headers)&&(this.headers=new cn(n.headers)),this.method=Kx(n.method||this.method||"GET"),this.mode=n.mode||this.mode||null,this.signal=n.signal||this.signal||(function(){if("AbortController"in gn)return new AbortController().signal})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&i)throw TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),(this.method==="GET"||this.method==="HEAD")&&(n.cache==="no-store"||n.cache==="no-cache")){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function Qx(e){var n=new FormData;return e.trim().split("&").forEach(function(i){if(i){var o=i.split("="),s=o.shift().replace(/\+/g," "),c=o.join("=").replace(/\+/g," ");n.append(decodeURIComponent(s),decodeURIComponent(c))}}),n}function Gx(e){var n=new cn;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(i){return i.indexOf(`
16
+ `)===0?i.substr(1,i.length):i}).forEach(function(i){var o=i.split(":"),s=o.shift().trim();if(s){var c=o.join(":").trim();try{n.append(s,c)}catch(d){console.warn("Response "+d.message)}}}),n}function Zr(e,n){if(!(this instanceof Zr))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(n||(n={}),this.type="default",this.status=n.status===void 0?200:n.status,this.status<200||this.status>599)throw RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=n.statusText===void 0?"":""+n.statusText,this.headers=new cn(n.headers),this.url=n.url||"",this._initBody(e)}function _0(e,n){return new Promise(function(i,o){var s=new Aa(e,n);if(s.signal&&s.signal.aborted)return o(new Gi("Aborted","AbortError"));var c=new XMLHttpRequest;function d(){c.abort()}c.onload=function(){var y={statusText:c.statusText,headers:Gx(c.getAllResponseHeaders()||"")};s.url.indexOf("file://")===0&&(c.status<200||c.status>599)?y.status=200:y.status=c.status,y.url="responseURL"in c?c.responseURL:y.headers.get("X-Request-URL");var w="response"in c?c.response:c.responseText;setTimeout(function(){i(new Zr(w,y))},0)},c.onerror=function(){setTimeout(function(){o(TypeError("Network request failed"))},0)},c.ontimeout=function(){setTimeout(function(){o(TypeError("Network request timed out"))},0)},c.onabort=function(){setTimeout(function(){o(new Gi("Aborted","AbortError"))},0)};function f(y){try{return y===""&&gn.location.href?gn.location.href:y}catch{return y}}if(c.open(s.method,f(s.url),!0),s.credentials==="include"?c.withCredentials=!0:s.credentials==="omit"&&(c.withCredentials=!1),"responseType"in c&&(Rn.blob?c.responseType="blob":Rn.arrayBuffer&&(c.responseType="arraybuffer")),n&&typeof n.headers=="object"&&!(n.headers instanceof cn||gn.Headers&&n.headers instanceof gn.Headers)){var p=[];Object.getOwnPropertyNames(n.headers).forEach(function(y){p.push(Oo(y)),c.setRequestHeader(y,Rd(n.headers[y]))}),s.headers.forEach(function(y,w){p.indexOf(w)===-1&&c.setRequestHeader(w,y)})}else s.headers.forEach(function(y,w){c.setRequestHeader(w,y)});s.signal&&(s.signal.addEventListener("abort",d),c.onreadystatechange=function(){c.readyState===4&&s.signal.removeEventListener("abort",d)}),c.send(s._bodyInit===void 0?null:s._bodyInit)})}let gn,Rn,x0,k0,S0,C0,Gi,E0,T0,R0,D0,qa,O0,P0,M0,L0,N0,I0,Po,Pd,Md,A0,Ji,Mo,Gl,q0,Ld,j0,z0,F0,B0,Jl,H0,ja,Nd,Vt,Xl,V0,$0,W0,U0,K0,Q0,G0,J0,X0,Y0,Z0,eg,tg,ng,rg,ig,ag,og,sg,lg,cg,ug,dg,fg;E0=U2((()=>{gn=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},Rn={searchParams:"URLSearchParams"in gn,iterable:"Symbol"in gn&&"iterator"in Symbol,blob:"FileReader"in gn&&"Blob"in gn&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in gn,arrayBuffer:"ArrayBuffer"in gn},Rn.arrayBuffer&&(x0=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],k0=ArrayBuffer.isView||function(e){return e&&x0.indexOf(Object.prototype.toString.call(e))>-1}),cn.prototype.append=function(e,n){e=Oo(e),n=Rd(n);var i=this.map[e];this.map[e]=i?i+", "+n:n},cn.prototype.delete=function(e){delete this.map[Oo(e)]},cn.prototype.get=function(e){return e=Oo(e),this.has(e)?this.map[e]:null},cn.prototype.has=function(e){return this.map.hasOwnProperty(Oo(e))},cn.prototype.set=function(e,n){this.map[Oo(e)]=Rd(n)},cn.prototype.forEach=function(e,n){for(var i in this.map)this.map.hasOwnProperty(i)&&e.call(n,this.map[i],i,this)},cn.prototype.keys=function(){var e=[];return this.forEach(function(n,i){e.push(i)}),Dd(e)},cn.prototype.values=function(){var e=[];return this.forEach(function(n){e.push(n)}),Dd(e)},cn.prototype.entries=function(){var e=[];return this.forEach(function(n,i){e.push([i,n])}),Dd(e)},Rn.iterable&&(cn.prototype[Symbol.iterator]=cn.prototype.entries),S0=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"],Aa.prototype.clone=function(){return new Aa(this,{body:this._bodyInit})},w0.call(Aa.prototype),w0.call(Zr.prototype),Zr.prototype.clone=function(){return new Zr(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new cn(this.headers),url:this.url})},Zr.error=function(){var e=new Zr(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e},C0=[301,302,303,307,308],Zr.redirect=function(e,n){if(C0.indexOf(n)===-1)throw RangeError("Invalid status code");return new Zr(null,{status:n,headers:{location:e}})},Gi=gn.DOMException;try{new Gi}catch{Gi=function(e,n){this.message=e,this.name=n,this.stack=Error(e).stack},Gi.prototype=Object.create(Error.prototype),Gi.prototype.constructor=Gi}_0.polyfill=!0,gn.fetch||(gn.fetch=_0,gn.Headers=cn,gn.Request=Aa,gn.Response=Zr)})),T0=Ee(((e,n)=>{E0(),n.exports=self.fetch.bind(self)})),R0=Ee((e=>{var n=e&&e.__extends||(function(){var w=function(_,C){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,T){E.__proto__=T}||function(E,T){for(var I in T)T.hasOwnProperty(I)&&(E[I]=T[I])},w(_,C)};return function(_,C){w(_,C);function E(){this.constructor=_}_.prototype=C===null?Object.create(C):(E.prototype=C.prototype,new E)}})(),i=e&&e.__awaiter||function(w,_,C,E){function T(I){return I instanceof C?I:new C(function($){$(I)})}return new(C||(C=Promise))(function(I,$){function V(K){try{N(E.next(K))}catch(pe){$(pe)}}function F(K){try{N(E.throw(K))}catch(pe){$(pe)}}function N(K){K.done?I(K.value):T(K.value).then(V,F)}N((E=E.apply(w,_||[])).next())})},o=e&&e.__generator||function(w,_){var C={label:0,sent:function(){if(I[0]&1)throw I[1];return I[1]},trys:[],ops:[]},E,T,I,$;return $={next:V(0),throw:V(1),return:V(2)},typeof Symbol=="function"&&($[Symbol.iterator]=function(){return this}),$;function V(N){return function(K){return F([N,K])}}function F(N){if(E)throw TypeError("Generator is already executing.");for(;C;)try{if(E=1,T&&(I=N[0]&2?T.return:N[0]?T.throw||((I=T.return)&&I.call(T),0):T.next)&&!(I=I.call(T,N[1])).done)return I;switch(T=0,I&&(N=[N[0]&2,I.value]),N[0]){case 0:case 1:I=N;break;case 4:return C.label++,{value:N[1],done:!1};case 5:C.label++,T=N[1],N=[0];continue;case 7:N=C.ops.pop(),C.trys.pop();continue;default:if(I=C.trys,!(I=I.length>0&&I[I.length-1])&&(N[0]===6||N[0]===2)){C=0;continue}if(N[0]===3&&(!I||N[1]>I[0]&&N[1]<I[3])){C.label=N[1];break}if(N[0]===6&&C.label<I[1]){C.label=I[1],I=N;break}if(I&&C.label<I[2]){C.label=I[2],C.ops.push(N);break}I[2]&&C.ops.pop(),C.trys.pop();continue}N=_.call(w,C)}catch(K){N=[6,K],T=0}finally{E=I=0}if(N[0]&5)throw N[1];return{value:N[0]?N[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTTPTransport=void 0;var c=s(T0()),d=Oa(),f=Do(),p=Ro(),y=(function(w){n(_,w);function _(C,E){var T=w.call(this)||this;return T.onlyNotifications=function(I){return I instanceof Array?I.every(function($){return $.request.request.id===null||$.request.request.id===void 0}):I.request.id===null||I.request.id===void 0},T.uri=C,T.credentials=E&&E.credentials,T.headers=_.setupHeaders(E&&E.headers),T.injectedFetcher=E==null?void 0:E.fetcher,T}return _.prototype.connect=function(){return Promise.resolve()},_.prototype.sendData=function(C,E){return E===void 0&&(E=null),i(this,void 0,void 0,function(){var T,I,$,V,F,N,pe,K,pe;return o(this,function(P){switch(P.label){case 0:T=this.transportRequestManager.addRequest(C,E),I=f.getNotifications(C),$=f.getBatchRequests(C),V=this.injectedFetcher||c.default,P.label=1;case 1:return P.trys.push([1,4,,5]),[4,V(this.uri,{method:"POST",headers:this.headers,body:JSON.stringify(this.parseData(C)),credentials:this.credentials})];case 2:return F=P.sent(),this.transportRequestManager.settlePendingRequest(I),this.onlyNotifications(C)?[2,Promise.resolve()]:[4,F.text()];case 3:return N=P.sent(),pe=this.transportRequestManager.resolveResponse(N),pe?(this.transportRequestManager.settlePendingRequest($,pe),[2,Promise.reject(pe)]):[3,5];case 4:return K=P.sent(),pe=new p.JSONRPCError(K.message,p.ERR_UNKNOWN,K),this.transportRequestManager.settlePendingRequest(I,pe),this.transportRequestManager.settlePendingRequest(f.getBatchRequests(C),pe),[2,Promise.reject(pe)];case 5:return[2,T]}})})},_.prototype.close=function(){},_.setupHeaders=function(C){var E=new Headers(C);return E.set("Content-Type","application/json"),E},_})(d.Transport);e.HTTPTransport=y,e.default=y})),D0=XR({default:()=>O0},1),P0=U2((()=>{qa=null,typeof WebSocket<"u"?qa=WebSocket:typeof MozWebSocket<"u"?qa=MozWebSocket:typeof global<"u"?qa=global.WebSocket||global.MozWebSocket:typeof window<"u"?qa=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(qa=self.WebSocket||self.MozWebSocket),O0=qa})),M0=Ee((e=>{var n=e&&e.__extends||(function(){var y=function(w,_){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,E){C.__proto__=E}||function(C,E){for(var T in E)E.hasOwnProperty(T)&&(C[T]=E[T])},y(w,_)};return function(w,_){y(w,_);function C(){this.constructor=w}w.prototype=_===null?Object.create(_):(C.prototype=_.prototype,new C)}})(),i=e&&e.__awaiter||function(y,w,_,C){function E(T){return T instanceof _?T:new _(function(I){I(T)})}return new(_||(_=Promise))(function(T,I){function $(N){try{F(C.next(N))}catch(K){I(K)}}function V(N){try{F(C.throw(N))}catch(K){I(K)}}function F(N){N.done?T(N.value):E(N.value).then($,V)}F((C=C.apply(y,w||[])).next())})},o=e&&e.__generator||function(y,w){var _={label:0,sent:function(){if(T[0]&1)throw T[1];return T[1]},trys:[],ops:[]},C,E,T,I;return I={next:$(0),throw:$(1),return:$(2)},typeof Symbol=="function"&&(I[Symbol.iterator]=function(){return this}),I;function $(F){return function(N){return V([F,N])}}function V(F){if(C)throw TypeError("Generator is already executing.");for(;_;)try{if(C=1,E&&(T=F[0]&2?E.return:F[0]?E.throw||((T=E.return)&&T.call(E),0):E.next)&&!(T=T.call(E,F[1])).done)return T;switch(E=0,T&&(F=[F[0]&2,T.value]),F[0]){case 0:case 1:T=F;break;case 4:return _.label++,{value:F[1],done:!1};case 5:_.label++,E=F[1],F=[0];continue;case 7:F=_.ops.pop(),_.trys.pop();continue;default:if(T=_.trys,!(T=T.length>0&&T[T.length-1])&&(F[0]===6||F[0]===2)){_=0;continue}if(F[0]===3&&(!T||F[1]>T[0]&&F[1]<T[3])){_.label=F[1];break}if(F[0]===6&&_.label<T[1]){_.label=T[1],T=F;break}if(T&&_.label<T[2]){_.label=T[2],_.ops.push(F);break}T[2]&&_.ops.pop(),_.trys.pop();continue}F=w.call(y,_)}catch(N){F=[6,N],E=0}finally{C=T=0}if(F[0]&5)throw F[1];return{value:F[0]?F[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(e,"__esModule",{value:!0});var c=s((P0(),Eu(D0))),d=Oa(),f=Do(),p=Ro();e.default=(function(y){n(w,y);function w(_){var C=y.call(this)||this;return C.uri=_,C.connection=new c.default(_),C}return w.prototype.connect=function(){var _=this;return new Promise(function(C,E){var T=function(){_.connection.removeEventListener("open",T),C()};_.connection.addEventListener("open",T),_.connection.addEventListener("message",function(I){var $=I.data;_.transportRequestManager.resolveResponse($)})})},w.prototype.sendData=function(_,C){return C===void 0&&(C=5e3),i(this,void 0,void 0,function(){var E,T,I;return o(this,function($){E=this.transportRequestManager.addRequest(_,C),T=f.getNotifications(_);try{this.connection.send(JSON.stringify(this.parseData(_))),this.transportRequestManager.settlePendingRequest(T)}catch(V){I=new p.JSONRPCError(V.message,p.ERR_UNKNOWN,V),this.transportRequestManager.settlePendingRequest(T,I),this.transportRequestManager.settlePendingRequest(f.getBatchRequests(_),I),E=Promise.reject(I)}return[2,E]})})},w.prototype.close=function(){this.connection.close()},w})(d.Transport)})),L0=Ee((e=>{var n=e&&e.__extends||(function(){var f=function(p,y){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,_){w.__proto__=_}||function(w,_){for(var C in _)_.hasOwnProperty(C)&&(w[C]=_[C])},f(p,y)};return function(p,y){f(p,y);function w(){this.constructor=p}p.prototype=y===null?Object.create(y):(w.prototype=y.prototype,new w)}})(),i=e&&e.__awaiter||function(f,p,y,w){function _(C){return C instanceof y?C:new y(function(E){E(C)})}return new(y||(y=Promise))(function(C,E){function T(V){try{$(w.next(V))}catch(F){E(F)}}function I(V){try{$(w.throw(V))}catch(F){E(F)}}function $(V){V.done?C(V.value):_(V.value).then(T,I)}$((w=w.apply(f,p||[])).next())})},o=e&&e.__generator||function(f,p){var y={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},w,_,C,E;return E={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function T($){return function(V){return I([$,V])}}function I($){if(w)throw TypeError("Generator is already executing.");for(;y;)try{if(w=1,_&&(C=$[0]&2?_.return:$[0]?_.throw||((C=_.return)&&C.call(_),0):_.next)&&!(C=C.call(_,$[1])).done)return C;switch(_=0,C&&($=[$[0]&2,C.value]),$[0]){case 0:case 1:C=$;break;case 4:return y.label++,{value:$[1],done:!1};case 5:y.label++,_=$[1],$=[0];continue;case 7:$=y.ops.pop(),y.trys.pop();continue;default:if(C=y.trys,!(C=C.length>0&&C[C.length-1])&&($[0]===6||$[0]===2)){y=0;continue}if($[0]===3&&(!C||$[1]>C[0]&&$[1]<C[3])){y.label=$[1];break}if($[0]===6&&y.label<C[1]){y.label=C[1],C=$;break}if(C&&y.label<C[2]){y.label=C[2],y.ops.push($);break}C[2]&&y.ops.pop(),y.trys.pop();continue}$=p.call(f,y)}catch(V){$=[6,V],_=0}finally{w=C=0}if($[0]&5)throw $[1];return{value:$[0]?$[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=Oa(),c=Do(),d=function(f){var p=400,y=window.screen.height;return window.open(f,"inspector:popup","left=0,top=0,width="+p+",height="+y+",resizable,scrollbars=yes,status=1")};e.default=(function(f){n(p,f);function p(y){var w=f.call(this)||this;return w.messageHandler=function(_){w.transportRequestManager.resolveResponse(JSON.stringify(_.data))},w.uri=y,w.postMessageID="post-message-transport-"+Math.random(),w}return p.prototype.createWindow=function(y){return new Promise(function(w,_){var C=d(y);setTimeout(function(){w(C)},3e3)})},p.prototype.connect=function(){var y=this,w=/^(http|https):\/\/.*$/;return new Promise(function(_,C){return i(y,void 0,void 0,function(){var E;return o(this,function(T){switch(T.label){case 0:return w.test(this.uri)||C(Error("Bad URI")),E=this,[4,this.createWindow(this.uri)];case 1:return E.frame=T.sent(),window.addEventListener("message",this.messageHandler),_(),[2]}})})})},p.prototype.sendData=function(y,w){return w===void 0&&(w=5e3),i(this,void 0,void 0,function(){var _,C;return o(this,function(E){return _=this.transportRequestManager.addRequest(y,null),C=c.getNotifications(y),this.frame&&(this.frame.postMessage(y.request,this.uri),this.transportRequestManager.settlePendingRequest(C)),[2,_]})})},p.prototype.close=function(){this.frame&&(window.removeEventListener("message",this.messageHandler),this.frame.close())},p})(s.Transport)})),N0=Ee((e=>{var n=e&&e.__extends||(function(){var d=function(f,p){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,w){y.__proto__=w}||function(y,w){for(var _ in w)w.hasOwnProperty(_)&&(y[_]=w[_])},d(f,p)};return function(f,p){d(f,p);function y(){this.constructor=f}f.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}})(),i=e&&e.__awaiter||function(d,f,p,y){function w(_){return _ instanceof p?_:new p(function(C){C(_)})}return new(p||(p=Promise))(function(_,C){function E($){try{I(y.next($))}catch(V){C(V)}}function T($){try{I(y.throw($))}catch(V){C(V)}}function I($){$.done?_($.value):w($.value).then(E,T)}I((y=y.apply(d,f||[])).next())})},o=e&&e.__generator||function(d,f){var p={label:0,sent:function(){if(_[0]&1)throw _[1];return _[1]},trys:[],ops:[]},y,w,_,C;return C={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function E(I){return function($){return T([I,$])}}function T(I){if(y)throw TypeError("Generator is already executing.");for(;p;)try{if(y=1,w&&(_=I[0]&2?w.return:I[0]?w.throw||((_=w.return)&&_.call(w),0):w.next)&&!(_=_.call(w,I[1])).done)return _;switch(w=0,_&&(I=[I[0]&2,_.value]),I[0]){case 0:case 1:_=I;break;case 4:return p.label++,{value:I[1],done:!1};case 5:p.label++,w=I[1],I=[0];continue;case 7:I=p.ops.pop(),p.trys.pop();continue;default:if(_=p.trys,!(_=_.length>0&&_[_.length-1])&&(I[0]===6||I[0]===2)){p=0;continue}if(I[0]===3&&(!_||I[1]>_[0]&&I[1]<_[3])){p.label=I[1];break}if(I[0]===6&&p.label<_[1]){p.label=_[1],_=I;break}if(_&&p.label<_[2]){p.label=_[2],p.ops.push(I);break}_[2]&&p.ops.pop(),p.trys.pop();continue}I=f.call(d,p)}catch($){I=[6,$],w=0}finally{y=_=0}if(I[0]&5)throw I[1];return{value:I[0]?I[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=Oa(),c=Do();e.default=(function(d){n(f,d);function f(p){var y=d.call(this)||this;return y.messageHandler=function(w){y.transportRequestManager.resolveResponse(JSON.stringify(w.data))},y.uri=p,y.postMessageID="post-message-transport-"+Math.random(),y}return f.prototype.createWindow=function(p){var y=this;return new Promise(function(w,_){var C,E=document.createElement("iframe");E.setAttribute("id",y.postMessageID),E.setAttribute("width","0px"),E.setAttribute("height","0px"),E.setAttribute("style","visiblity:hidden;border:none;outline:none;"),E.addEventListener("load",function(){w(C)}),E.setAttribute("src",p),window.document.body.appendChild(E),C=E.contentWindow})},f.prototype.connect=function(){var p=this,y=/^(http|https):\/\/.*$/;return new Promise(function(w,_){return i(p,void 0,void 0,function(){var C;return o(this,function(E){switch(E.label){case 0:return y.test(this.uri)||_(Error("Bad URI")),C=this,[4,this.createWindow(this.uri)];case 1:return C.frame=E.sent(),window.addEventListener("message",this.messageHandler),w(),[2]}})})})},f.prototype.sendData=function(p,y){return y===void 0&&(y=5e3),i(this,void 0,void 0,function(){var w,_;return o(this,function(C){return w=this.transportRequestManager.addRequest(p,null),_=c.getNotifications(p),this.frame&&(this.frame.postMessage(p.request,"*"),this.transportRequestManager.settlePendingRequest(_)),[2,w]})})},f.prototype.close=function(){var p;(p=document.getElementById(this.postMessageID))==null||p.remove(),window.removeEventListener("message",this.messageHandler)},f})(s.Transport)})),I0=Ee((e=>{var n=e&&e.__awaiter||function(o,s,c,d){function f(p){return p instanceof c?p:new c(function(y){y(p)})}return new(c||(c=Promise))(function(p,y){function w(E){try{C(d.next(E))}catch(T){y(T)}}function _(E){try{C(d.throw(E))}catch(T){y(T)}}function C(E){E.done?p(E.value):f(E.value).then(w,_)}C((d=d.apply(o,s||[])).next())})},i=e&&e.__generator||function(o,s){var c={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},d,f,p,y;return y={next:w(0),throw:w(1),return:w(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function w(C){return function(E){return _([C,E])}}function _(C){if(d)throw TypeError("Generator is already executing.");for(;c;)try{if(d=1,f&&(p=C[0]&2?f.return:C[0]?f.throw||((p=f.return)&&p.call(f),0):f.next)&&!(p=p.call(f,C[1])).done)return p;switch(f=0,p&&(C=[C[0]&2,p.value]),C[0]){case 0:case 1:p=C;break;case 4:return c.label++,{value:C[1],done:!1};case 5:c.label++,f=C[1],C=[0];continue;case 7:C=c.ops.pop(),c.trys.pop();continue;default:if(p=c.trys,!(p=p.length>0&&p[p.length-1])&&(C[0]===6||C[0]===2)){c=0;continue}if(C[0]===3&&(!p||C[1]>p[0]&&C[1]<p[3])){c.label=C[1];break}if(C[0]===6&&c.label<p[1]){c.label=p[1],p=C;break}if(p&&c.label<p[2]){c.label=p[2],c.ops.push(C);break}p[2]&&c.ops.pop(),c.trys.pop();continue}C=s.call(o,c)}catch(E){C=[6,E],f=0}finally{d=p=0}if(C[0]&5)throw C[1];return{value:C[0]?C[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=(function(){function o(s){this.requestManager=s}return o.prototype.startBatch=function(){return this.requestManager.startBatch()},o.prototype.stopBatch=function(){return this.requestManager.stopBatch()},o.prototype.request=function(s,c){return n(this,void 0,void 0,function(){return i(this,function(d){switch(d.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:d.sent(),d.label=2;case 2:return[2,this.requestManager.request(s,!1,c)]}})})},o.prototype.notify=function(s){return n(this,void 0,void 0,function(){return i(this,function(c){switch(c.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:c.sent(),c.label=2;case 2:return[2,this.requestManager.request(s,!0,null)]}})})},o.prototype.onNotification=function(s){this.requestManager.requestChannel.addListener("notification",s)},o.prototype.onError=function(s){this.requestManager.requestChannel.addListener("error",s)},o.prototype.close=function(){this.requestManager.close()},o})()})),Al=Ee((e=>{var n=e&&e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.PostMessageIframeTransport=e.PostMessageWindowTransport=e.JSONRPCError=e.WebSocketTransport=e.EventEmitterTransport=e.HTTPTransport=e.RequestManager=e.Client=void 0,e.RequestManager=n(m0()).default,e.EventEmitterTransport=n(y0()).default,e.HTTPTransport=n(R0()).default,e.WebSocketTransport=n(M0()).default,e.PostMessageWindowTransport=n(L0()).default,e.PostMessageIframeTransport=n(N0()).default;var i=Ro();Object.defineProperty(e,"JSONRPCError",{enumerable:!0,get:function(){return i.JSONRPCError}});var o=n(I0());e.Client=o.default,e.default=o.default})),Po=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function n(p){return p===!0||p===!1}e.boolean=n;function i(p){return typeof p=="string"||p instanceof String}e.string=i;function o(p){return typeof p=="number"||p instanceof Number}e.number=o;function s(p){return p instanceof Error}e.error=s;function c(p){return typeof p=="function"}e.func=c;function d(p){return Array.isArray(p)}e.array=d;function f(p){return d(p)&&p.every(y=>i(y))}e.stringArray=f})),Pd=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;var n=Po(),i;(function(d){d.ParseError=-32700,d.InvalidRequest=-32600,d.MethodNotFound=-32601,d.InvalidParams=-32602,d.InternalError=-32603,d.jsonrpcReservedErrorRangeStart=-32099,d.serverErrorStart=-32099,d.MessageWriteError=-32099,d.MessageReadError=-32098,d.PendingResponseRejected=-32097,d.ConnectionInactive=-32096,d.ServerNotInitialized=-32002,d.UnknownErrorCode=-32001,d.jsonrpcReservedErrorRangeEnd=-32e3,d.serverErrorEnd=-32e3})(i||(e.ErrorCodes=i={})),e.ResponseError=class fx extends Error{constructor(f,p,y){super(p),this.code=n.number(f)?f:i.UnknownErrorCode,this.data=y,Object.setPrototypeOf(this,fx.prototype)}toJson(){let f={code:this.code,message:this.message};return this.data!==void 0&&(f.data=this.data),f}};var o=class pd{constructor(f){this.kind=f}static is(f){return f===pd.auto||f===pd.byName||f===pd.byPosition}toString(){return this.kind}};e.ParameterStructures=o,o.auto=new o("auto"),o.byPosition=new o("byPosition"),o.byName=new o("byName");var s=class{constructor(d,f){this.method=d,this.numberOfParams=f}get parameterStructures(){return o.auto}};e.AbstractMessageSignature=s,e.RequestType0=class extends s{constructor(d){super(d,0)}},e.RequestType=class extends s{constructor(d,f=o.auto){super(d,1),this._parameterStructures=f}get parameterStructures(){return this._parameterStructures}},e.RequestType1=class extends s{constructor(d,f=o.auto){super(d,1),this._parameterStructures=f}get parameterStructures(){return this._parameterStructures}},e.RequestType2=class extends s{constructor(d){super(d,2)}},e.RequestType3=class extends s{constructor(d){super(d,3)}},e.RequestType4=class extends s{constructor(d){super(d,4)}},e.RequestType5=class extends s{constructor(d){super(d,5)}},e.RequestType6=class extends s{constructor(d){super(d,6)}},e.RequestType7=class extends s{constructor(d){super(d,7)}},e.RequestType8=class extends s{constructor(d){super(d,8)}},e.RequestType9=class extends s{constructor(d){super(d,9)}},e.NotificationType=class extends s{constructor(d,f=o.auto){super(d,1),this._parameterStructures=f}get parameterStructures(){return this._parameterStructures}},e.NotificationType0=class extends s{constructor(d){super(d,0)}},e.NotificationType1=class extends s{constructor(d,f=o.auto){super(d,1),this._parameterStructures=f}get parameterStructures(){return this._parameterStructures}},e.NotificationType2=class extends s{constructor(d){super(d,2)}},e.NotificationType3=class extends s{constructor(d){super(d,3)}},e.NotificationType4=class extends s{constructor(d){super(d,4)}},e.NotificationType5=class extends s{constructor(d){super(d,5)}},e.NotificationType6=class extends s{constructor(d){super(d,6)}},e.NotificationType7=class extends s{constructor(d){super(d,7)}},e.NotificationType8=class extends s{constructor(d){super(d,8)}},e.NotificationType9=class extends s{constructor(d){super(d,9)}};var c;(function(d){function f(w){let _=w;return _&&n.string(_.method)&&(n.string(_.id)||n.number(_.id))}d.isRequest=f;function p(w){let _=w;return _&&n.string(_.method)&&w.id===void 0}d.isNotification=p;function y(w){let _=w;return _&&(_.result!==void 0||!!_.error)&&(n.string(_.id)||n.number(_.id)||_.id===null)}d.isResponse=y})(c||(e.Message=c={}))})),Md=Ee((e=>{var n;Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var i;(function(s){s.None=0,s.First=1,s.AsOld=s.First,s.Last=2,s.AsNew=s.Last})(i||(e.Touch=i={}));var o=class{constructor(){this[n]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var s;return(s=this._head)==null?void 0:s.value}get last(){var s;return(s=this._tail)==null?void 0:s.value}has(s){return this._map.has(s)}get(s,c=i.None){let d=this._map.get(s);if(d)return c!==i.None&&this.touch(d,c),d.value}set(s,c,d=i.None){let f=this._map.get(s);if(f)f.value=c,d!==i.None&&this.touch(f,d);else{switch(f={key:s,value:c,next:void 0,previous:void 0},d){case i.None:this.addItemLast(f);break;case i.First:this.addItemFirst(f);break;case i.Last:this.addItemLast(f);break;default:this.addItemLast(f);break}this._map.set(s,f),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){let c=this._map.get(s);if(c)return this._map.delete(s),this.removeItem(c),this._size--,c.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error("Invalid list");let s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,c){let d=this._state,f=this._head;for(;f;){if(c?s.bind(c)(f.value,f.key,this):s(f.value,f.key,this),this._state!==d)throw Error("LinkedMap got modified during iteration.");f=f.next}}keys(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let f={value:c.key,done:!1};return c=c.next,f}else return{value:void 0,done:!0}}};return d}values(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let f={value:c.value,done:!1};return c=c.next,f}else return{value:void 0,done:!0}}};return d}entries(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let f={value:[c.key,c.value],done:!1};return c=c.next,f}else return{value:void 0,done:!0}}};return d}[(n=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let c=this._head,d=this.size;for(;c&&d>s;)this._map.delete(c.key),c=c.next,d--;this._head=c,this._size=d,c&&(c.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{let c=s.next,d=s.previous;if(!c||!d)throw Error("Invalid list");c.previous=d,d.next=c}s.next=void 0,s.previous=void 0,this._state++}touch(s,c){if(!this._head||!this._tail)throw Error("Invalid list");if(!(c!==i.First&&c!==i.Last)){if(c===i.First){if(s===this._head)return;let d=s.next,f=s.previous;s===this._tail?(f.next=void 0,this._tail=f):(d.previous=f,f.next=d),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(c===i.Last){if(s===this._tail)return;let d=s.next,f=s.previous;s===this._head?(d.previous=void 0,this._head=d):(d.previous=f,f.next=d),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){let s=[];return this.forEach((c,d)=>{s.push([d,c])}),s}fromJSON(s){this.clear();for(let[c,d]of s)this.set(c,d)}};e.LinkedMap=o,e.LRUCache=class extends o{constructor(s,c=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,c),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,c=i.AsNew){return super.get(s,c)}peek(s){return super.get(s,i.None)}set(s,c){return super.set(s,c,i.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}})),A0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Disposable=void 0;var n;(function(i){function o(s){return{dispose:s}}i.create=o})(n||(e.Disposable=n={}))})),Ji=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n;function i(){if(n===void 0)throw Error("No runtime abstraction layer installed");return n}(function(o){function s(c){if(c===void 0)throw Error("No runtime abstraction layer provided");n=c}o.install=s})(i||(i={})),e.default=i})),Mo=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;var n=Ji(),i;(function(c){let d={dispose(){}};c.None=function(){return d}})(i||(e.Event=i={}));var o=class{add(c,d=null,f){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(c),this._contexts.push(d),Array.isArray(f)&&f.push({dispose:()=>this.remove(c,d)})}remove(c,d=null){if(!this._callbacks)return;let f=!1;for(let p=0,y=this._callbacks.length;p<y;p++)if(this._callbacks[p]===c)if(this._contexts[p]===d){this._callbacks.splice(p,1),this._contexts.splice(p,1);return}else f=!0;if(f)throw Error("When adding a listener with a context, you should remove it with the same context")}invoke(...c){if(!this._callbacks)return[];let d=[],f=this._callbacks.slice(0),p=this._contexts.slice(0);for(let y=0,w=f.length;y<w;y++)try{d.push(f[y].apply(p[y],c))}catch(_){(0,n.default)().console.error(_)}return d}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},s=class px{constructor(d){this._options=d}get event(){return this._event||(this._event=(d,f,p)=>{this._callbacks||(this._callbacks=new o),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(d,f);let y={dispose:()=>{this._callbacks&&(this._callbacks.remove(d,f),y.dispose=px._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(p)&&p.push(y),y}),this._event}fire(d){this._callbacks&&this._callbacks.invoke.call(this._callbacks,d)}dispose(){this._callbacks&&(this._callbacks=(this._callbacks.dispose(),void 0))}};e.Emitter=s,s._noop=function(){}})),Gl=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;var n=Ji(),i=Po(),o=Mo(),s;(function(f){f.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:o.Event.None}),f.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:o.Event.None});function p(y){let w=y;return w&&(w===f.None||w===f.Cancelled||i.boolean(w.isCancellationRequested)&&!!w.onCancellationRequested)}f.is=p})(s||(e.CancellationToken=s={}));var c=Object.freeze(function(f,p){let y=(0,n.default)().timer.setTimeout(f.bind(p),0);return{dispose(){y.dispose()}}}),d=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?c:(this._emitter||(this._emitter=new o.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter=(this._emitter.dispose(),void 0))}};e.CancellationTokenSource=class{get token(){return this._token||(this._token=new d),this._token}cancel(){this._token?this._token.cancel():this._token=s.Cancelled}dispose(){this._token?this._token instanceof d&&this._token.dispose():this._token=s.None}}})),q0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;var n=Gl(),i;(function(c){c.Continue=0,c.Cancelled=1})(i||(i={})),e.SharedArraySenderStrategy=class{constructor(){this.buffers=new Map}enableCancellation(c){if(c.id===null)return;let d=new SharedArrayBuffer(4),f=new Int32Array(d,0,1);f[0]=i.Continue,this.buffers.set(c.id,d),c.$cancellationData=d}async sendCancellation(c,d){let f=this.buffers.get(d);if(f===void 0)return;let p=new Int32Array(f,0,1);Atomics.store(p,0,i.Cancelled)}cleanup(c){this.buffers.delete(c)}dispose(){this.buffers.clear()}};var o=class{constructor(c){this.data=new Int32Array(c,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===i.Cancelled}get onCancellationRequested(){throw Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},s=class{constructor(c){this.token=new o(c)}cancel(){}dispose(){}};e.SharedArrayReceiverStrategy=class{constructor(){this.kind="request"}createCancellationTokenSource(c){let d=c.$cancellationData;return d===void 0?new n.CancellationTokenSource:new s(d)}}})),Ld=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;var n=Ji();e.Semaphore=class{constructor(i=1){if(i<=0)throw Error("Capacity must be greater than 0");this._capacity=i,this._active=0,this._waiting=[]}lock(i){return new Promise((o,s)=>{this._waiting.push({thunk:i,resolve:o,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,n.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let i=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error("To many thunks active");try{let o=i.thunk();o instanceof Promise?o.then(s=>{this._active--,i.resolve(s),this.runNext()},s=>{this._active--,i.reject(s),this.runNext()}):(this._active--,i.resolve(o),this.runNext())}catch(o){this._active--,i.reject(o),this.runNext()}}}})),j0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;var n=Ji(),i=Po(),o=Mo(),s=Ld(),c;(function(p){function y(w){let _=w;return _&&i.func(_.listen)&&i.func(_.dispose)&&i.func(_.onError)&&i.func(_.onClose)&&i.func(_.onPartialMessage)}p.is=y})(c||(e.MessageReader=c={}));var d=class{constructor(){this.errorEmitter=new o.Emitter,this.closeEmitter=new o.Emitter,this.partialMessageEmitter=new o.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(p){this.errorEmitter.fire(this.asError(p))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(p){this.partialMessageEmitter.fire(p)}asError(p){return p instanceof Error?p:Error(`Reader received error. Reason: ${i.string(p.message)?p.message:"unknown"}`)}};e.AbstractMessageReader=d;var f;(function(p){function y(w){let _,C,E=new Map,T,I=new Map;if(w===void 0||typeof w=="string")_=w??"utf-8";else{if(_=w.charset??"utf-8",w.contentDecoder!==void 0&&(C=w.contentDecoder,E.set(C.name,C)),w.contentDecoders!==void 0)for(let $ of w.contentDecoders)E.set($.name,$);if(w.contentTypeDecoder!==void 0&&(T=w.contentTypeDecoder,I.set(T.name,T)),w.contentTypeDecoders!==void 0)for(let $ of w.contentTypeDecoders)I.set($.name,$)}return T===void 0&&(T=(0,n.default)().applicationJson.decoder,I.set(T.name,T)),{charset:_,contentDecoder:C,contentDecoders:E,contentTypeDecoder:T,contentTypeDecoders:I}}p.fromOptions=y})(f||(f={})),e.ReadableStreamMessageReader=class extends d{constructor(p,y){super(),this.readable=p,this.options=f.fromOptions(y),this.buffer=(0,n.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new s.Semaphore(1)}set partialMessageTimeout(p){this._partialMessageTimeout=p}get partialMessageTimeout(){return this._partialMessageTimeout}listen(p){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=p;let y=this.readable.onData(w=>{this.onData(w)});return this.readable.onError(w=>this.fireError(w)),this.readable.onClose(()=>this.fireClose()),y}onData(p){try{for(this.buffer.append(p);;){if(this.nextMessageLength===-1){let w=this.buffer.tryReadHeaders(!0);if(!w)return;let _=w.get("content-length");if(!_){this.fireError(Error(`Header must provide a Content-Length property.
17
17
  ${JSON.stringify(Object.fromEntries(w))}`));return}let C=parseInt(_);if(isNaN(C)){this.fireError(Error(`Content-Length value must be a number. Got ${_}`));return}this.nextMessageLength=C}let y=this.buffer.tryReadBody(this.nextMessageLength);if(y===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let w=this.options.contentDecoder===void 0?y:await this.options.contentDecoder.decode(y),_=await this.options.contentTypeDecoder.decode(w,this.options);this.callback(_)}).catch(w=>{this.fireError(w)})}}catch(y){this.fireError(y)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer=(this.partialMessageTimer.dispose(),void 0))}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,n.default)().timer.setTimeout((p,y)=>{this.partialMessageTimer=void 0,p===this.messageToken&&(this.firePartialMessage({messageToken:p,waitingTime:y}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}})),z0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;var n=Ji(),i=Po(),o=Ld(),s=Mo(),c="Content-Length: ",d=`\r
18
18
  `,f;(function(w){function _(C){let E=C;return E&&i.func(E.dispose)&&i.func(E.onClose)&&i.func(E.onError)&&i.func(E.write)}w.is=_})(f||(e.MessageWriter=f={}));var p=class{constructor(){this.errorEmitter=new s.Emitter,this.closeEmitter=new s.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(w,_,C){this.errorEmitter.fire([this.asError(w),_,C])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(w){return w instanceof Error?w:Error(`Writer received error. Reason: ${i.string(w.message)?w.message:"unknown"}`)}};e.AbstractMessageWriter=p;var y;(function(w){function _(C){return C===void 0||typeof C=="string"?{charset:C??"utf-8",contentTypeEncoder:(0,n.default)().applicationJson.encoder}:{charset:C.charset??"utf-8",contentEncoder:C.contentEncoder,contentTypeEncoder:C.contentTypeEncoder??(0,n.default)().applicationJson.encoder}}w.fromOptions=_})(y||(y={})),e.WriteableStreamMessageWriter=class extends p{constructor(w,_){super(),this.writable=w,this.options=y.fromOptions(_),this.errorCount=0,this.writeSemaphore=new o.Semaphore(1),this.writable.onError(C=>this.fireError(C)),this.writable.onClose(()=>this.fireClose())}async write(w){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(w,this.options).then(_=>this.options.contentEncoder===void 0?_:this.options.contentEncoder.encode(_)).then(_=>{let C=[];return C.push(c,_.byteLength.toString(),d),C.push(d),this.doWrite(w,C,_)},_=>{throw this.fireError(_),_}))}async doWrite(w,_,C){try{return await this.writable.write(_.join(""),"ascii"),this.writable.write(C)}catch(E){return this.handleError(E,w),Promise.reject(E)}}handleError(w,_){this.errorCount++,this.fireError(w,_,this.errorCount)}end(){this.writable.end()}}})),F0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractMessageBuffer=void 0;var n=13,i=10,o=`\r
19
19
  `;e.AbstractMessageBuffer=class{constructor(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){let c=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(c),this._totalLength+=c.byteLength}tryReadHeaders(s=!1){if(this._chunks.length===0)return;let c=0,d=0,f=0,p=0;e:for(;d<this._chunks.length;){let C=this._chunks[d];for(f=0;f<C.length;){switch(C[f]){case n:switch(c){case 0:c=1;break;case 2:c=3;break;default:c=0}break;case i:switch(c){case 1:c=2;break;case 3:c=4,f++;break e;default:c=0}break;default:c=0}f++}p+=C.byteLength,d++}if(c!==4)return;let y=this._read(p+f),w=new Map,_=this.toString(y,"ascii").split(o);if(_.length<2)return w;for(let C=0;C<_.length-2;C++){let E=_[C],T=E.indexOf(":");if(T===-1)throw Error(`Message header must separate key and value using ':'
20
- ${E}`);let I=E.substr(0,T),$=E.substr(T+1).trim();w.set(s?I.toLowerCase():I,$)}return w}tryReadBody(s){if(!(this._totalLength<s))return this._read(s)}get numberOfBytes(){return this._totalLength}_read(s){if(s===0)return this.emptyBuffer();if(s>this._totalLength)throw Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){let f=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(f)}if(this._chunks[0].byteLength>s){let f=this._chunks[0],p=this.asNative(f,s);return this._chunks[0]=f.slice(s),this._totalLength-=s,p}let c=this.allocNative(s),d=0;for(;s>0;){let f=this._chunks[0];if(f.byteLength>s){let p=f.slice(0,s);c.set(p,d),d+=s,this._chunks[0]=f.slice(s),this._totalLength-=s,s-=s}else c.set(f,d),d+=f.byteLength,this._chunks.shift(),this._totalLength-=f.byteLength,s-=f.byteLength}return c}}})),B0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;var n=Ji(),i=Po(),o=Pd(),s=Md(),c=Mo(),d=Jl(),f;(function(J){J.type=new o.NotificationType("$/cancelRequest")})(f||(f={}));var p;(function(J){function be(Ce){return typeof Ce=="string"||typeof Ce=="number"}J.is=be})(p||(e.ProgressToken=p={}));var y;(function(J){J.type=new o.NotificationType("$/progress")})(y||(y={})),e.ProgressType=class{constructor(){}};var w;(function(J){function be(Ce){return i.func(Ce)}J.is=be})(w||(w={})),e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var _;(function(J){J[J.Off=0]="Off",J[J.Messages=1]="Messages",J[J.Compact=2]="Compact",J[J.Verbose=3]="Verbose"})(_||(e.Trace=_={}));var C;(function(J){J.Off="off",J.Messages="messages",J.Compact="compact",J.Verbose="verbose"})(C||(e.TraceValues=C={})),(function(J){function be(Z){if(!i.string(Z))return J.Off;switch(Z=Z.toLowerCase(),Z){case"off":return J.Off;case"messages":return J.Messages;case"compact":return J.Compact;case"verbose":return J.Verbose;default:return J.Off}}J.fromString=be;function Ce(Z){switch(Z){case J.Off:return"off";case J.Messages:return"messages";case J.Compact:return"compact";case J.Verbose:return"verbose";default:return"off"}}J.toString=Ce})(_||(e.Trace=_={}));var E;(function(J){J.Text="text",J.JSON="json"})(E||(e.TraceFormat=E={})),(function(J){function be(Ce){return i.string(Ce)?(Ce=Ce.toLowerCase(),Ce==="json"?J.JSON:J.Text):J.Text}J.fromString=be})(E||(e.TraceFormat=E={}));var T;(function(J){J.type=new o.NotificationType("$/setTrace")})(T||(e.SetTraceNotification=T={}));var I;(function(J){J.type=new o.NotificationType("$/logTrace")})(I||(e.LogTraceNotification=I={}));var $;(function(J){J[J.Closed=1]="Closed",J[J.Disposed=2]="Disposed",J[J.AlreadyListening=3]="AlreadyListening"})($||(e.ConnectionErrors=$={}));var V=class hx extends Error{constructor(be,Ce){super(Ce),this.code=be,Object.setPrototypeOf(this,hx.prototype)}};e.ConnectionError=V;var F;(function(J){function be(Ce){let Z=Ce;return Z&&i.func(Z.cancelUndispatched)}J.is=be})(F||(e.ConnectionStrategy=F={}));var N;(function(J){function be(Ce){let Z=Ce;return Z&&(Z.kind===void 0||Z.kind==="id")&&i.func(Z.createCancellationTokenSource)&&(Z.dispose===void 0||i.func(Z.dispose))}J.is=be})(N||(e.IdCancellationReceiverStrategy=N={}));var K;(function(J){function be(Ce){let Z=Ce;return Z&&Z.kind==="request"&&i.func(Z.createCancellationTokenSource)&&(Z.dispose===void 0||i.func(Z.dispose))}J.is=be})(K||(e.RequestCancellationReceiverStrategy=K={}));var pe;(function(J){J.Message=Object.freeze({createCancellationTokenSource(Ce){return new d.CancellationTokenSource}});function be(Ce){return N.is(Ce)||K.is(Ce)}J.is=be})(pe||(e.CancellationReceiverStrategy=pe={}));var P;(function(J){J.Message=Object.freeze({sendCancellation(Ce,Z){return Ce.sendNotification(f.type,{id:Z})},cleanup(Ce){}});function be(Ce){let Z=Ce;return Z&&i.func(Z.sendCancellation)&&i.func(Z.cleanup)}J.is=be})(P||(e.CancellationSenderStrategy=P={}));var A;(function(J){J.Message=Object.freeze({receiver:pe.Message,sender:P.Message});function be(Ce){let Z=Ce;return Z&&pe.is(Z.receiver)&&P.is(Z.sender)}J.is=be})(A||(e.CancellationStrategy=A={}));var W;(function(J){function be(Ce){let Z=Ce;return Z&&i.func(Z.handleMessage)}J.is=be})(W||(e.MessageStrategy=W={}));var de;(function(J){function be(Ce){let Z=Ce;return Z&&(A.is(Z.cancellationStrategy)||F.is(Z.connectionStrategy)||W.is(Z.messageStrategy))}J.is=be})(de||(e.ConnectionOptions=de={}));var fe;(function(J){J[J.New=1]="New",J[J.Listening=2]="Listening",J[J.Closed=3]="Closed",J[J.Disposed=4]="Disposed"})(fe||(fe={}));function we(J,be,Ce,Z){let re=Ce===void 0?e.NullLogger:Ce,se=0,Q=0,Le=0,Fe,et=new Map,Be,je=new Map,Pe=new Map,Ae,ft=new s.LinkedMap,mt=new Map,Dn=new Set,un=new Map,We=_.Off,tn=E.Text,wt,vn=fe.New,vr=new c.Emitter,pt=new c.Emitter,Fr=new c.Emitter,nn=new c.Emitter,mi=new c.Emitter,On=Z&&Z.cancellationStrategy?Z.cancellationStrategy:A.Message;function br(j){if(j===null)throw Error("Can't send requests with id null since the response can't be correlated.");return"req-"+j.toString()}function Pn(j){return j===null?"res-unknown-"+(++Le).toString():"res-"+j.toString()}function dn(){return"not-"+(++Q).toString()}function ta(j,te){o.Message.isRequest(te)?j.set(br(te.id),te):o.Message.isResponse(te)?j.set(Pn(te.id),te):j.set(dn(),te)}function gi(j){}function Ut(){return vn===fe.Listening}function yi(){return vn===fe.Closed}function fn(){return vn===fe.Disposed}function ni(){(vn===fe.New||vn===fe.Listening)&&(vn=fe.Closed,pt.fire(void 0))}function zt(j){vr.fire([j,void 0,void 0])}function Br(j){vr.fire(j)}J.onClose(ni),J.onError(zt),be.onClose(ni),be.onError(Br);function _t(){Ae||ft.size===0||(Ae=(0,n.default)().timer.setImmediate(()=>{Ae=void 0,na()}))}function vi(j){o.Message.isRequest(j)?Jt(j):o.Message.isNotification(j)?gt(j):o.Message.isResponse(j)?Ge(j):xt(j)}function na(){if(ft.size===0)return;let j=ft.shift();try{let te=Z==null?void 0:Z.messageStrategy;W.is(te)?te.handleMessage(j,vi):vi(j)}finally{_t()}}let wr=j=>{try{if(o.Message.isNotification(j)&&j.method===f.type.method){let te=j.params.id,ve=br(te),Te=ft.get(ve);if(o.Message.isRequest(Te)){let Ve=Z==null?void 0:Z.connectionStrategy,ot=Ve&&Ve.cancelUndispatched?Ve.cancelUndispatched(Te,gi):void 0;if(ot&&(ot.error!==void 0||ot.result!==void 0)){ft.delete(ve),un.delete(te),ot.id=Te.id,St(ot,j.method,Date.now()),be.write(ot).catch(()=>re.error("Sending response for canceled message failed."));return}}let He=un.get(te);if(He!==void 0){He.cancel(),Mn(j);return}else Dn.add(te)}ta(ft,j)}finally{_t()}};function Jt(j){if(fn())return;function te(Ze,Lt,rt){let ut={jsonrpc:"2.0",id:j.id};Ze instanceof o.ResponseError?ut.error=Ze.toJson():ut.result=Ze===void 0?null:Ze,St(ut,Lt,rt),be.write(ut).catch(()=>re.error("Sending response failed."))}function ve(Ze,Lt,rt){let ut={jsonrpc:"2.0",id:j.id,error:Ze.toJson()};St(ut,Lt,rt),be.write(ut).catch(()=>re.error("Sending response failed."))}function Te(Ze,Lt,rt){Ze===void 0&&(Ze=null);let ut={jsonrpc:"2.0",id:j.id,result:Ze};St(ut,Lt,rt),be.write(ut).catch(()=>re.error("Sending response failed."))}ir(j);let He=et.get(j.method),Ve,ot;He&&(Ve=He.type,ot=He.handler);let Mt=Date.now();if(ot||Fe){let Ze=j.id??String(Date.now()),Lt=N.is(On.receiver)?On.receiver.createCancellationTokenSource(Ze):On.receiver.createCancellationTokenSource(j);j.id!==null&&Dn.has(j.id)&&Lt.cancel(),j.id!==null&&un.set(Ze,Lt);try{let rt;if(ot)if(j.params===void 0){if(Ve!==void 0&&Ve.numberOfParams!==0){ve(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${j.method} defines ${Ve.numberOfParams} params but received none.`),j.method,Mt);return}rt=ot(Lt.token)}else if(Array.isArray(j.params)){if(Ve!==void 0&&Ve.parameterStructures===o.ParameterStructures.byName){ve(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${j.method} defines parameters by name but received parameters by position`),j.method,Mt);return}rt=ot(...j.params,Lt.token)}else{if(Ve!==void 0&&Ve.parameterStructures===o.ParameterStructures.byPosition){ve(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${j.method} defines parameters by position but received parameters by name`),j.method,Mt);return}rt=ot(j.params,Lt.token)}else Fe&&(rt=Fe(j.method,j.params,Lt.token));let ut=rt;rt?ut.then?ut.then(wn=>{un.delete(Ze),te(wn,j.method,Mt)},wn=>{un.delete(Ze),wn instanceof o.ResponseError?ve(wn,j.method,Mt):wn&&i.string(wn.message)?ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed with message: ${wn.message}`),j.method,Mt):ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed unexpectedly without providing any details.`),j.method,Mt)}):(un.delete(Ze),te(rt,j.method,Mt)):(un.delete(Ze),Te(rt,j.method,Mt))}catch(rt){un.delete(Ze),rt instanceof o.ResponseError?te(rt,j.method,Mt):rt&&i.string(rt.message)?ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed with message: ${rt.message}`),j.method,Mt):ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed unexpectedly without providing any details.`),j.method,Mt)}}else ve(new o.ResponseError(o.ErrorCodes.MethodNotFound,`Unhandled method ${j.method}`),j.method,Mt)}function Ge(j){if(!fn())if(j.id===null)j.error?re.error(`Received response message without id: Error is:
20
+ ${E}`);let I=E.substr(0,T),$=E.substr(T+1).trim();w.set(s?I.toLowerCase():I,$)}return w}tryReadBody(s){if(!(this._totalLength<s))return this._read(s)}get numberOfBytes(){return this._totalLength}_read(s){if(s===0)return this.emptyBuffer();if(s>this._totalLength)throw Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){let f=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(f)}if(this._chunks[0].byteLength>s){let f=this._chunks[0],p=this.asNative(f,s);return this._chunks[0]=f.slice(s),this._totalLength-=s,p}let c=this.allocNative(s),d=0;for(;s>0;){let f=this._chunks[0];if(f.byteLength>s){let p=f.slice(0,s);c.set(p,d),d+=s,this._chunks[0]=f.slice(s),this._totalLength-=s,s-=s}else c.set(f,d),d+=f.byteLength,this._chunks.shift(),this._totalLength-=f.byteLength,s-=f.byteLength}return c}}})),B0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;var n=Ji(),i=Po(),o=Pd(),s=Md(),c=Mo(),d=Gl(),f;(function(J){J.type=new o.NotificationType("$/cancelRequest")})(f||(f={}));var p;(function(J){function be(Ce){return typeof Ce=="string"||typeof Ce=="number"}J.is=be})(p||(e.ProgressToken=p={}));var y;(function(J){J.type=new o.NotificationType("$/progress")})(y||(y={})),e.ProgressType=class{constructor(){}};var w;(function(J){function be(Ce){return i.func(Ce)}J.is=be})(w||(w={})),e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var _;(function(J){J[J.Off=0]="Off",J[J.Messages=1]="Messages",J[J.Compact=2]="Compact",J[J.Verbose=3]="Verbose"})(_||(e.Trace=_={}));var C;(function(J){J.Off="off",J.Messages="messages",J.Compact="compact",J.Verbose="verbose"})(C||(e.TraceValues=C={})),(function(J){function be(Z){if(!i.string(Z))return J.Off;switch(Z=Z.toLowerCase(),Z){case"off":return J.Off;case"messages":return J.Messages;case"compact":return J.Compact;case"verbose":return J.Verbose;default:return J.Off}}J.fromString=be;function Ce(Z){switch(Z){case J.Off:return"off";case J.Messages:return"messages";case J.Compact:return"compact";case J.Verbose:return"verbose";default:return"off"}}J.toString=Ce})(_||(e.Trace=_={}));var E;(function(J){J.Text="text",J.JSON="json"})(E||(e.TraceFormat=E={})),(function(J){function be(Ce){return i.string(Ce)?(Ce=Ce.toLowerCase(),Ce==="json"?J.JSON:J.Text):J.Text}J.fromString=be})(E||(e.TraceFormat=E={}));var T;(function(J){J.type=new o.NotificationType("$/setTrace")})(T||(e.SetTraceNotification=T={}));var I;(function(J){J.type=new o.NotificationType("$/logTrace")})(I||(e.LogTraceNotification=I={}));var $;(function(J){J[J.Closed=1]="Closed",J[J.Disposed=2]="Disposed",J[J.AlreadyListening=3]="AlreadyListening"})($||(e.ConnectionErrors=$={}));var V=class hx extends Error{constructor(be,Ce){super(Ce),this.code=be,Object.setPrototypeOf(this,hx.prototype)}};e.ConnectionError=V;var F;(function(J){function be(Ce){let Z=Ce;return Z&&i.func(Z.cancelUndispatched)}J.is=be})(F||(e.ConnectionStrategy=F={}));var N;(function(J){function be(Ce){let Z=Ce;return Z&&(Z.kind===void 0||Z.kind==="id")&&i.func(Z.createCancellationTokenSource)&&(Z.dispose===void 0||i.func(Z.dispose))}J.is=be})(N||(e.IdCancellationReceiverStrategy=N={}));var K;(function(J){function be(Ce){let Z=Ce;return Z&&Z.kind==="request"&&i.func(Z.createCancellationTokenSource)&&(Z.dispose===void 0||i.func(Z.dispose))}J.is=be})(K||(e.RequestCancellationReceiverStrategy=K={}));var pe;(function(J){J.Message=Object.freeze({createCancellationTokenSource(Ce){return new d.CancellationTokenSource}});function be(Ce){return N.is(Ce)||K.is(Ce)}J.is=be})(pe||(e.CancellationReceiverStrategy=pe={}));var P;(function(J){J.Message=Object.freeze({sendCancellation(Ce,Z){return Ce.sendNotification(f.type,{id:Z})},cleanup(Ce){}});function be(Ce){let Z=Ce;return Z&&i.func(Z.sendCancellation)&&i.func(Z.cleanup)}J.is=be})(P||(e.CancellationSenderStrategy=P={}));var A;(function(J){J.Message=Object.freeze({receiver:pe.Message,sender:P.Message});function be(Ce){let Z=Ce;return Z&&pe.is(Z.receiver)&&P.is(Z.sender)}J.is=be})(A||(e.CancellationStrategy=A={}));var W;(function(J){function be(Ce){let Z=Ce;return Z&&i.func(Z.handleMessage)}J.is=be})(W||(e.MessageStrategy=W={}));var de;(function(J){function be(Ce){let Z=Ce;return Z&&(A.is(Z.cancellationStrategy)||F.is(Z.connectionStrategy)||W.is(Z.messageStrategy))}J.is=be})(de||(e.ConnectionOptions=de={}));var fe;(function(J){J[J.New=1]="New",J[J.Listening=2]="Listening",J[J.Closed=3]="Closed",J[J.Disposed=4]="Disposed"})(fe||(fe={}));function we(J,be,Ce,Z){let re=Ce===void 0?e.NullLogger:Ce,se=0,Q=0,Le=0,Fe,et=new Map,Be,je=new Map,Pe=new Map,Ae,ft=new s.LinkedMap,mt=new Map,Dn=new Set,un=new Map,We=_.Off,tn=E.Text,wt,vn=fe.New,vr=new c.Emitter,pt=new c.Emitter,Fr=new c.Emitter,nn=new c.Emitter,mi=new c.Emitter,On=Z&&Z.cancellationStrategy?Z.cancellationStrategy:A.Message;function br(j){if(j===null)throw Error("Can't send requests with id null since the response can't be correlated.");return"req-"+j.toString()}function Pn(j){return j===null?"res-unknown-"+(++Le).toString():"res-"+j.toString()}function dn(){return"not-"+(++Q).toString()}function ta(j,te){o.Message.isRequest(te)?j.set(br(te.id),te):o.Message.isResponse(te)?j.set(Pn(te.id),te):j.set(dn(),te)}function gi(j){}function Ut(){return vn===fe.Listening}function yi(){return vn===fe.Closed}function fn(){return vn===fe.Disposed}function ni(){(vn===fe.New||vn===fe.Listening)&&(vn=fe.Closed,pt.fire(void 0))}function zt(j){vr.fire([j,void 0,void 0])}function Br(j){vr.fire(j)}J.onClose(ni),J.onError(zt),be.onClose(ni),be.onError(Br);function _t(){Ae||ft.size===0||(Ae=(0,n.default)().timer.setImmediate(()=>{Ae=void 0,na()}))}function vi(j){o.Message.isRequest(j)?Jt(j):o.Message.isNotification(j)?gt(j):o.Message.isResponse(j)?Ge(j):xt(j)}function na(){if(ft.size===0)return;let j=ft.shift();try{let te=Z==null?void 0:Z.messageStrategy;W.is(te)?te.handleMessage(j,vi):vi(j)}finally{_t()}}let wr=j=>{try{if(o.Message.isNotification(j)&&j.method===f.type.method){let te=j.params.id,ve=br(te),Te=ft.get(ve);if(o.Message.isRequest(Te)){let Ve=Z==null?void 0:Z.connectionStrategy,ot=Ve&&Ve.cancelUndispatched?Ve.cancelUndispatched(Te,gi):void 0;if(ot&&(ot.error!==void 0||ot.result!==void 0)){ft.delete(ve),un.delete(te),ot.id=Te.id,St(ot,j.method,Date.now()),be.write(ot).catch(()=>re.error("Sending response for canceled message failed."));return}}let He=un.get(te);if(He!==void 0){He.cancel(),Mn(j);return}else Dn.add(te)}ta(ft,j)}finally{_t()}};function Jt(j){if(fn())return;function te(Ze,Lt,rt){let ut={jsonrpc:"2.0",id:j.id};Ze instanceof o.ResponseError?ut.error=Ze.toJson():ut.result=Ze===void 0?null:Ze,St(ut,Lt,rt),be.write(ut).catch(()=>re.error("Sending response failed."))}function ve(Ze,Lt,rt){let ut={jsonrpc:"2.0",id:j.id,error:Ze.toJson()};St(ut,Lt,rt),be.write(ut).catch(()=>re.error("Sending response failed."))}function Te(Ze,Lt,rt){Ze===void 0&&(Ze=null);let ut={jsonrpc:"2.0",id:j.id,result:Ze};St(ut,Lt,rt),be.write(ut).catch(()=>re.error("Sending response failed."))}ir(j);let He=et.get(j.method),Ve,ot;He&&(Ve=He.type,ot=He.handler);let Mt=Date.now();if(ot||Fe){let Ze=j.id??String(Date.now()),Lt=N.is(On.receiver)?On.receiver.createCancellationTokenSource(Ze):On.receiver.createCancellationTokenSource(j);j.id!==null&&Dn.has(j.id)&&Lt.cancel(),j.id!==null&&un.set(Ze,Lt);try{let rt;if(ot)if(j.params===void 0){if(Ve!==void 0&&Ve.numberOfParams!==0){ve(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${j.method} defines ${Ve.numberOfParams} params but received none.`),j.method,Mt);return}rt=ot(Lt.token)}else if(Array.isArray(j.params)){if(Ve!==void 0&&Ve.parameterStructures===o.ParameterStructures.byName){ve(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${j.method} defines parameters by name but received parameters by position`),j.method,Mt);return}rt=ot(...j.params,Lt.token)}else{if(Ve!==void 0&&Ve.parameterStructures===o.ParameterStructures.byPosition){ve(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${j.method} defines parameters by position but received parameters by name`),j.method,Mt);return}rt=ot(j.params,Lt.token)}else Fe&&(rt=Fe(j.method,j.params,Lt.token));let ut=rt;rt?ut.then?ut.then(wn=>{un.delete(Ze),te(wn,j.method,Mt)},wn=>{un.delete(Ze),wn instanceof o.ResponseError?ve(wn,j.method,Mt):wn&&i.string(wn.message)?ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed with message: ${wn.message}`),j.method,Mt):ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed unexpectedly without providing any details.`),j.method,Mt)}):(un.delete(Ze),te(rt,j.method,Mt)):(un.delete(Ze),Te(rt,j.method,Mt))}catch(rt){un.delete(Ze),rt instanceof o.ResponseError?te(rt,j.method,Mt):rt&&i.string(rt.message)?ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed with message: ${rt.message}`),j.method,Mt):ve(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${j.method} failed unexpectedly without providing any details.`),j.method,Mt)}}else ve(new o.ResponseError(o.ErrorCodes.MethodNotFound,`Unhandled method ${j.method}`),j.method,Mt)}function Ge(j){if(!fn())if(j.id===null)j.error?re.error(`Received response message without id: Error is:
21
21
  ${JSON.stringify(j.error,void 0,4)}`):re.error("Received response message without id. No further error information provided.");else{let te=j.id,ve=mt.get(te);if(Hr(j,ve),ve!==void 0){mt.delete(te);try{if(j.error){let Te=j.error;ve.reject(new o.ResponseError(Te.code,Te.message,Te.data))}else if(j.result!==void 0)ve.resolve(j.result);else throw Error("Should never happen.")}catch(Te){Te.message?re.error(`Response handler '${ve.method}' failed with message: ${Te.message}`):re.error(`Response handler '${ve.method}' failed unexpectedly.`)}}}}function gt(j){if(fn())return;let te,ve;if(j.method===f.type.method){let Te=j.params.id;Dn.delete(Te),Mn(j);return}else{let Te=je.get(j.method);Te&&(ve=Te.handler,te=Te.type)}if(ve||Be)try{if(Mn(j),ve)if(j.params===void 0)te!==void 0&&te.numberOfParams!==0&&te.parameterStructures!==o.ParameterStructures.byName&&re.error(`Notification ${j.method} defines ${te.numberOfParams} params but received none.`),ve();else if(Array.isArray(j.params)){let Te=j.params;j.method===y.type.method&&Te.length===2&&p.is(Te[0])?ve({token:Te[0],value:Te[1]}):(te!==void 0&&(te.parameterStructures===o.ParameterStructures.byName&&re.error(`Notification ${j.method} defines parameters by name but received parameters by position`),te.numberOfParams!==j.params.length&&re.error(`Notification ${j.method} defines ${te.numberOfParams} params but received ${Te.length} arguments`)),ve(...Te))}else te!==void 0&&te.parameterStructures===o.ParameterStructures.byPosition&&re.error(`Notification ${j.method} defines parameters by position but received parameters by name`),ve(j.params);else Be&&Be(j.method,j.params)}catch(Te){Te.message?re.error(`Notification handler '${j.method}' failed with message: ${Te.message}`):re.error(`Notification handler '${j.method}' failed unexpectedly.`)}else Fr.fire(j)}function xt(j){if(!j){re.error("Received empty message.");return}re.error(`Received message which is neither a response nor a notification message:
22
22
  ${JSON.stringify(j,null,4)}`);let te=j;if(i.string(te.id)||i.number(te.id)){let ve=te.id,Te=mt.get(ve);Te&&Te.reject(Error("The received response has neither a result nor an error property."))}}function kt(j){if(j!=null)switch(We){case _.Verbose:return JSON.stringify(j,null,4);case _.Compact:return JSON.stringify(j);default:return}}function zn(j){if(!(We===_.Off||!wt))if(tn===E.Text){let te;(We===_.Verbose||We===_.Compact)&&j.params&&(te=`Params: ${kt(j.params)}
23
23
 
@@ -43,7 +43,7 @@ ${JSON.stringify(j,null,4)}`);let te=j;if(i.string(te.id)||i.number(te.id)){let
43
43
 
44
44
  `:j.error===void 0&&(ve=`No result returned.
45
45
 
46
- `)),te){let Te=j.error?` Request failed: ${j.error.message} (${j.error.code}).`:"";wt.log(`Received response '${te.method} - (${j.id})' in ${Date.now()-te.timerStart}ms.${Te}`,ve)}else wt.log(`Received response ${j.id} without active response promise.`,ve)}else bn("receive-response",j)}function bn(j,te){if(!wt||We===_.Off)return;let ve={isLSPMessage:!0,type:j,message:te,timestamp:Date.now()};wt.log(ve)}function ar(){if(yi())throw new V($.Closed,"Connection is closed.");if(fn())throw new V($.Disposed,"Connection is disposed.")}function bi(){if(Ut())throw new V($.AlreadyListening,"Connection is already listening")}function ri(){if(!Ut())throw Error("Call listen() first.")}function Ln(j){return j===void 0?null:j}function wi(j){if(j!==null)return j}function Fn(j){return j!=null&&!Array.isArray(j)&&typeof j=="object"}function or(j,te){switch(j){case o.ParameterStructures.auto:return Fn(te)?wi(te):[Ln(te)];case o.ParameterStructures.byName:if(!Fn(te))throw Error("Received parameters by name but param is not an object literal.");return wi(te);case o.ParameterStructures.byPosition:return[Ln(te)];default:throw Error(`Unknown parameter structure ${j.toString()}`)}}function M(j,te){let ve,Te=j.numberOfParams;switch(Te){case 0:ve=void 0;break;case 1:ve=or(j.parameterStructures,te[0]);break;default:ve=[];for(let He=0;He<te.length&&He<Te;He++)ve.push(Ln(te[He]));if(te.length<Te)for(let He=te.length;He<Te;He++)ve.push(null);break}return ve}let Ye={sendNotification:(j,...te)=>{ar();let ve,Te;if(i.string(j)){ve=j;let Ve=te[0],ot=0,Mt=o.ParameterStructures.auto;o.ParameterStructures.is(Ve)&&(ot=1,Mt=Ve);let Ze=te.length,Lt=Ze-ot;switch(Lt){case 0:Te=void 0;break;case 1:Te=or(Mt,te[ot]);break;default:if(Mt===o.ParameterStructures.byName)throw Error(`Received ${Lt} parameters for 'by Name' notification parameter structure.`);Te=te.slice(ot,Ze).map(rt=>Ln(rt));break}}else{let Ve=te;ve=j.method,Te=M(j,Ve)}let He={jsonrpc:"2.0",method:ve,params:Te};return _r(He),be.write(He).catch(Ve=>{throw re.error("Sending notification failed."),Ve})},onNotification:(j,te)=>{ar();let ve;return i.func(j)?Be=j:te&&(i.string(j)?(ve=j,je.set(j,{type:void 0,handler:te})):(ve=j.method,je.set(j.method,{type:j,handler:te}))),{dispose:()=>{ve===void 0?Be=void 0:je.delete(ve)}}},onProgress:(j,te,ve)=>{if(Pe.has(te))throw Error(`Progress handler for token ${te} already registered`);return Pe.set(te,ve),{dispose:()=>{Pe.delete(te)}}},sendProgress:(j,te,ve)=>Ye.sendNotification(y.type,{token:te,value:ve}),onUnhandledProgress:nn.event,sendRequest:(j,...te)=>{ar(),ri();let ve,Te,He;if(i.string(j)){ve=j;let Ze=te[0],Lt=te[te.length-1],rt=0,ut=o.ParameterStructures.auto;o.ParameterStructures.is(Ze)&&(rt=1,ut=Ze);let wn=te.length;d.CancellationToken.is(Lt)&&(--wn,He=Lt);let sr=wn-rt;switch(sr){case 0:Te=void 0;break;case 1:Te=or(ut,te[rt]);break;default:if(ut===o.ParameterStructures.byName)throw Error(`Received ${sr} parameters for 'by Name' request parameter structure.`);Te=te.slice(rt,wn).map(ii=>Ln(ii));break}}else{let Ze=te;ve=j.method,Te=M(j,Ze);let Lt=j.numberOfParams;He=d.CancellationToken.is(Ze[Lt])?Ze[Lt]:void 0}let Ve=se++,ot;He&&(ot=He.onCancellationRequested(()=>{let Ze=On.sender.sendCancellation(Ye,Ve);return Ze===void 0?(re.log(`Received no promise from cancellation strategy when cancelling id ${Ve}`),Promise.resolve()):Ze.catch(()=>{re.log(`Sending cancellation messages for id ${Ve} failed`)})}));let Mt={jsonrpc:"2.0",id:Ve,method:ve,params:Te};return zn(Mt),typeof On.sender.enableCancellation=="function"&&On.sender.enableCancellation(Mt),new Promise(async(Ze,Lt)=>{let rt={method:ve,timerStart:Date.now(),resolve:ut=>{Ze(ut),On.sender.cleanup(Ve),ot==null||ot.dispose()},reject:ut=>{Lt(ut),On.sender.cleanup(Ve),ot==null||ot.dispose()}};try{await be.write(Mt),mt.set(Ve,rt)}catch(ut){throw re.error("Sending request failed."),rt.reject(new o.ResponseError(o.ErrorCodes.MessageWriteError,ut.message?ut.message:"Unknown reason")),ut}})},onRequest:(j,te)=>{ar();let ve=null;return w.is(j)?(ve=void 0,Fe=j):i.string(j)?(ve=null,te!==void 0&&(ve=j,et.set(j,{handler:te,type:void 0}))):te!==void 0&&(ve=j.method,et.set(j.method,{type:j,handler:te})),{dispose:()=>{ve!==null&&(ve===void 0?Fe=void 0:et.delete(ve))}}},hasPendingResponse:()=>mt.size>0,trace:async(j,te,ve)=>{let Te=!1,He=E.Text;ve!==void 0&&(i.boolean(ve)?Te=ve:(Te=ve.sendNotification||!1,He=ve.traceFormat||E.Text)),We=j,tn=He,wt=We===_.Off?void 0:te,Te&&!yi()&&!fn()&&await Ye.sendNotification(T.type,{value:_.toString(j)})},onError:vr.event,onClose:pt.event,onUnhandledNotification:Fr.event,onDispose:mi.event,end:()=>{be.end()},dispose:()=>{if(fn())return;vn=fe.Disposed,mi.fire(void 0);let j=new o.ResponseError(o.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let te of mt.values())te.reject(j);mt=new Map,un=new Map,Dn=new Set,ft=new s.LinkedMap,i.func(be.dispose)&&be.dispose(),i.func(J.dispose)&&J.dispose()},listen:()=>{ar(),bi(),vn=fe.Listening,J.listen(wr)},inspect:()=>{(0,n.default)().console.log("inspect")}};return Ye.onNotification(I.type,j=>{if(We===_.Off||!wt)return;let te=We===_.Verbose||We===_.Compact;wt.log(j.message,te?j.verbose:void 0)}),Ye.onNotification(y.type,j=>{let te=Pe.get(j.token);te?te(j.value):nn.fire(j)}),Ye}e.createMessageConnection=we})),Xl=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;var n=Pd();Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return n.Message}}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:function(){return n.RequestType}}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:function(){return n.RequestType0}}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:function(){return n.RequestType1}}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:function(){return n.RequestType2}}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:function(){return n.RequestType3}}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:function(){return n.RequestType4}}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:function(){return n.RequestType5}}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:function(){return n.RequestType6}}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:function(){return n.RequestType7}}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:function(){return n.RequestType8}}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:function(){return n.RequestType9}}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:function(){return n.ResponseError}}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:function(){return n.ErrorCodes}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return n.NotificationType}}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:function(){return n.NotificationType0}}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:function(){return n.NotificationType1}}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:function(){return n.NotificationType2}}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:function(){return n.NotificationType3}}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:function(){return n.NotificationType4}}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:function(){return n.NotificationType5}}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:function(){return n.NotificationType6}}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:function(){return n.NotificationType7}}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:function(){return n.NotificationType8}}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:function(){return n.NotificationType9}}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:function(){return n.ParameterStructures}});var i=Md();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:function(){return i.LinkedMap}}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:function(){return i.LRUCache}}),Object.defineProperty(e,"Touch",{enumerable:!0,get:function(){return i.Touch}});var o=A0();Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return o.Disposable}});var s=Mo();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return s.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return s.Emitter}});var c=Jl();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return c.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return c.CancellationToken}});var d=q0();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return d.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return d.SharedArrayReceiverStrategy}});var f=j0();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return f.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return f.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return f.ReadableStreamMessageReader}});var p=z0();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return p.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return p.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return p.WriteableStreamMessageWriter}});var y=F0();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return y.AbstractMessageBuffer}});var w=B0();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:function(){return w.ConnectionStrategy}}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:function(){return w.ConnectionOptions}}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:function(){return w.NullLogger}}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:function(){return w.createMessageConnection}}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:function(){return w.ProgressToken}}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:function(){return w.ProgressType}}),Object.defineProperty(e,"Trace",{enumerable:!0,get:function(){return w.Trace}}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:function(){return w.TraceValues}}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:function(){return w.TraceFormat}}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:function(){return w.SetTraceNotification}}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:function(){return w.LogTraceNotification}}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:function(){return w.ConnectionErrors}}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:function(){return w.ConnectionError}}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return w.CancellationReceiverStrategy}}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:function(){return w.CancellationSenderStrategy}}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:function(){return w.CancellationStrategy}}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:function(){return w.MessageStrategy}}),e.RAL=Ji().default})),H0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=Xl(),i=class mx extends n.AbstractMessageBuffer{constructor(y="utf-8"){super(y),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return mx.emptyBuffer}fromString(y,w){return new TextEncoder().encode(y)}toString(y,w){return w==="ascii"?this.asciiDecoder.decode(y):new TextDecoder(w).decode(y)}asNative(y,w){return w===void 0?y:y.slice(0,w)}allocNative(y){return new Uint8Array(y)}};i.emptyBuffer=new Uint8Array;var o=class{constructor(p){this.socket=p,this._onData=new n.Emitter,this._messageListener=y=>{y.data.arrayBuffer().then(w=>{this._onData.fire(new Uint8Array(w))},()=>{(0,n.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(p){return this.socket.addEventListener("close",p),n.Disposable.create(()=>this.socket.removeEventListener("close",p))}onError(p){return this.socket.addEventListener("error",p),n.Disposable.create(()=>this.socket.removeEventListener("error",p))}onEnd(p){return this.socket.addEventListener("end",p),n.Disposable.create(()=>this.socket.removeEventListener("end",p))}onData(p){return this._onData.event(p)}},s=class{constructor(p){this.socket=p}onClose(p){return this.socket.addEventListener("close",p),n.Disposable.create(()=>this.socket.removeEventListener("close",p))}onError(p){return this.socket.addEventListener("error",p),n.Disposable.create(()=>this.socket.removeEventListener("error",p))}onEnd(p){return this.socket.addEventListener("end",p),n.Disposable.create(()=>this.socket.removeEventListener("end",p))}write(p,y){if(typeof p=="string"){if(y!==void 0&&y!=="utf-8")throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${y}`);this.socket.send(p)}else this.socket.send(p);return Promise.resolve()}end(){this.socket.close()}},c=new TextEncoder,d=Object.freeze({messageBuffer:Object.freeze({create:p=>new i(p)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(p,y)=>{if(y.charset!=="utf-8")throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${y.charset}`);return Promise.resolve(c.encode(JSON.stringify(p,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(p,y)=>{if(!(p instanceof Uint8Array))throw Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(y.charset).decode(p)))}})}),stream:Object.freeze({asReadableStream:p=>new o(p),asWritableStream:p=>new s(p)}),console,timer:Object.freeze({setTimeout(p,y,...w){let _=setTimeout(p,y,...w);return{dispose:()=>clearTimeout(_)}},setImmediate(p,...y){let w=setTimeout(p,0,...y);return{dispose:()=>clearTimeout(w)}},setInterval(p,y,...w){let _=setInterval(p,y,...w);return{dispose:()=>clearInterval(_)}}})});function f(){return d}(function(p){function y(){n.RAL.install(d)}p.install=y})(f||(f={})),e.default=f})),ja=Ee((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,f,p){p===void 0&&(p=f);var y=Object.getOwnPropertyDescriptor(d,f);(!y||("get"in y?!d.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(c,p,y)}):(function(c,d,f,p){p===void 0&&(p=f),c[p]=d[f]})),i=e&&e.__exportStar||function(c,d){for(var f in c)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&n(d,c,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0,H0().default.install();var o=Xl();i(Xl(),e),e.BrowserMessageReader=class extends o.AbstractMessageReader{constructor(c){super(),this._onData=new o.Emitter,this._messageListener=d=>{this._onData.fire(d.data)},c.addEventListener("error",d=>this.fireError(d)),c.onmessage=this._messageListener}listen(c){return this._onData.event(c)}},e.BrowserMessageWriter=class extends o.AbstractMessageWriter{constructor(c){super(),this.port=c,this.errorCount=0,c.addEventListener("error",d=>this.fireError(d))}write(c){try{return this.port.postMessage(c),Promise.resolve()}catch(d){return this.handleError(d,c),Promise.reject(d)}}handleError(c,d){this.errorCount++,this.fireError(c,d,this.errorCount)}end(){}};function s(c,d,f,p){return f===void 0&&(f=o.NullLogger),o.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,o.createMessageConnection)(c,d,f,p)}e.createMessageConnection=s})),Nd=Ee(((e,n)=>{n.exports=ja()})),Vt=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;var n=ja(),i;(function(o){o.clientToServer="clientToServer",o.serverToClient="serverToClient",o.both="both"})(i||(e.MessageDirection=i={})),e.RegistrationType=class{constructor(o){this.method=o}},e.ProtocolRequestType0=class extends n.RequestType0{constructor(o){super(o)}},e.ProtocolRequestType=class extends n.RequestType{constructor(o){super(o,n.ParameterStructures.byName)}},e.ProtocolNotificationType0=class extends n.NotificationType0{constructor(o){super(o)}},e.ProtocolNotificationType=class extends n.NotificationType{constructor(o){super(o,n.ParameterStructures.byName)}}})),Yl=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.objectLiteral=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function n(w){return w===!0||w===!1}e.boolean=n;function i(w){return typeof w=="string"||w instanceof String}e.string=i;function o(w){return typeof w=="number"||w instanceof Number}e.number=o;function s(w){return w instanceof Error}e.error=s;function c(w){return typeof w=="function"}e.func=c;function d(w){return Array.isArray(w)}e.array=d;function f(w){return d(w)&&w.every(_=>i(_))}e.stringArray=f;function p(w,_){return Array.isArray(w)&&w.every(_)}e.typedArray=p;function y(w){return typeof w=="object"&&!!w}e.objectLiteral=y})),V0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/implementation",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ImplementationRequest=i={}))})),$0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/typeDefinition",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.TypeDefinitionRequest=i={}))})),W0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;var n=Vt(),i;(function(s){s.method="workspace/workspaceFolders",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(i||(e.WorkspaceFoldersRequest=i={}));var o;(function(s){s.method="workspace/didChangeWorkspaceFolders",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolNotificationType(s.method)})(o||(e.DidChangeWorkspaceFoldersNotification=o={}))})),U0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;var n=Vt(),i;(function(o){o.method="workspace/configuration",o.messageDirection=n.MessageDirection.serverToClient,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ConfigurationRequest=i={}))})),K0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;var n=Vt(),i;(function(s){s.method="textDocument/documentColor",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.DocumentColorRequest=i={}));var o;(function(s){s.method="textDocument/colorPresentation",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(o||(e.ColorPresentationRequest=o={}))})),Q0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;var n=Vt(),i;(function(s){s.method="textDocument/foldingRange",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.FoldingRangeRequest=i={}));var o;(function(s){s.method="workspace/foldingRange/refresh",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(o||(e.FoldingRangeRefreshRequest=o={}))})),G0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/declaration",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.DeclarationRequest=i={}))})),J0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/selectionRange",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.SelectionRangeRequest=i={}))})),X0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;var n=ja(),i=Vt(),o;(function(d){d.type=new n.ProgressType;function f(p){return p===d.type}d.is=f})(o||(e.WorkDoneProgress=o={}));var s;(function(d){d.method="window/workDoneProgress/create",d.messageDirection=i.MessageDirection.serverToClient,d.type=new i.ProtocolRequestType(d.method)})(s||(e.WorkDoneProgressCreateRequest=s={}));var c;(function(d){d.method="window/workDoneProgress/cancel",d.messageDirection=i.MessageDirection.clientToServer,d.type=new i.ProtocolNotificationType(d.method)})(c||(e.WorkDoneProgressCancelNotification=c={}))})),Y0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;var n=Vt(),i;(function(c){c.method="textDocument/prepareCallHierarchy",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.CallHierarchyPrepareRequest=i={}));var o;(function(c){c.method="callHierarchy/incomingCalls",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(o||(e.CallHierarchyIncomingCallsRequest=o={}));var s;(function(c){c.method="callHierarchy/outgoingCalls",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.CallHierarchyOutgoingCallsRequest=s={}))})),Z0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;var n=Vt(),i;(function(p){p.Relative="relative"})(i||(e.TokenFormat=i={}));var o;(function(p){p.method="textDocument/semanticTokens",p.type=new n.RegistrationType(p.method)})(o||(e.SemanticTokensRegistrationType=o={}));var s;(function(p){p.method="textDocument/semanticTokens/full",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolRequestType(p.method),p.registrationMethod=o.method})(s||(e.SemanticTokensRequest=s={}));var c;(function(p){p.method="textDocument/semanticTokens/full/delta",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolRequestType(p.method),p.registrationMethod=o.method})(c||(e.SemanticTokensDeltaRequest=c={}));var d;(function(p){p.method="textDocument/semanticTokens/range",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolRequestType(p.method),p.registrationMethod=o.method})(d||(e.SemanticTokensRangeRequest=d={}));var f;(function(p){p.method="workspace/semanticTokens/refresh",p.messageDirection=n.MessageDirection.serverToClient,p.type=new n.ProtocolRequestType0(p.method)})(f||(e.SemanticTokensRefreshRequest=f={}))})),eg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;var n=Vt(),i;(function(o){o.method="window/showDocument",o.messageDirection=n.MessageDirection.serverToClient,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ShowDocumentRequest=i={}))})),tg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/linkedEditingRange",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.LinkedEditingRangeRequest=i={}))})),ng=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;var n=Vt(),i;(function(y){y.file="file",y.folder="folder"})(i||(e.FileOperationPatternKind=i={}));var o;(function(y){y.method="workspace/willCreateFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolRequestType(y.method)})(o||(e.WillCreateFilesRequest=o={}));var s;(function(y){y.method="workspace/didCreateFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolNotificationType(y.method)})(s||(e.DidCreateFilesNotification=s={}));var c;(function(y){y.method="workspace/willRenameFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolRequestType(y.method)})(c||(e.WillRenameFilesRequest=c={}));var d;(function(y){y.method="workspace/didRenameFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolNotificationType(y.method)})(d||(e.DidRenameFilesNotification=d={}));var f;(function(y){y.method="workspace/didDeleteFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolNotificationType(y.method)})(f||(e.DidDeleteFilesNotification=f={}));var p;(function(y){y.method="workspace/willDeleteFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolRequestType(y.method)})(p||(e.WillDeleteFilesRequest=p={}))})),rg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;var n=Vt(),i;(function(c){c.document="document",c.project="project",c.group="group",c.scheme="scheme",c.global="global"})(i||(e.UniquenessLevel=i={}));var o;(function(c){c.$import="import",c.$export="export",c.local="local"})(o||(e.MonikerKind=o={}));var s;(function(c){c.method="textDocument/moniker",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.MonikerRequest=s={}))})),ig=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;var n=Vt(),i;(function(c){c.method="textDocument/prepareTypeHierarchy",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.TypeHierarchyPrepareRequest=i={}));var o;(function(c){c.method="typeHierarchy/supertypes",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(o||(e.TypeHierarchySupertypesRequest=o={}));var s;(function(c){c.method="typeHierarchy/subtypes",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.TypeHierarchySubtypesRequest=s={}))})),ag=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;var n=Vt(),i;(function(s){s.method="textDocument/inlineValue",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.InlineValueRequest=i={}));var o;(function(s){s.method="workspace/inlineValue/refresh",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(o||(e.InlineValueRefreshRequest=o={}))})),og=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;var n=Vt(),i;(function(c){c.method="textDocument/inlayHint",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.InlayHintRequest=i={}));var o;(function(c){c.method="inlayHint/resolve",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(o||(e.InlayHintResolveRequest=o={}));var s;(function(c){c.method="workspace/inlayHint/refresh",c.messageDirection=n.MessageDirection.serverToClient,c.type=new n.ProtocolRequestType0(c.method)})(s||(e.InlayHintRefreshRequest=s={}))})),sg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;var n=ja(),i=Yl(),o=Vt(),s;(function(y){function w(_){let C=_;return C&&i.boolean(C.retriggerRequest)}y.is=w})(s||(e.DiagnosticServerCancellationData=s={}));var c;(function(y){y.Full="full",y.Unchanged="unchanged"})(c||(e.DocumentDiagnosticReportKind=c={}));var d;(function(y){y.method="textDocument/diagnostic",y.messageDirection=o.MessageDirection.clientToServer,y.type=new o.ProtocolRequestType(y.method),y.partialResult=new n.ProgressType})(d||(e.DocumentDiagnosticRequest=d={}));var f;(function(y){y.method="workspace/diagnostic",y.messageDirection=o.MessageDirection.clientToServer,y.type=new o.ProtocolRequestType(y.method),y.partialResult=new n.ProgressType})(f||(e.WorkspaceDiagnosticRequest=f={}));var p;(function(y){y.method="workspace/diagnostic/refresh",y.messageDirection=o.MessageDirection.serverToClient,y.type=new o.ProtocolRequestType0(y.method)})(p||(e.DiagnosticRefreshRequest=p={}))})),lg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;var n=(Sh(),Tu(kh)),i=Yl(),o=Vt(),s;(function(T){T.Markup=1,T.Code=2;function I($){return $===1||$===2}T.is=I})(s||(e.NotebookCellKind=s={}));var c;(function(T){function I(F,N){let K={executionOrder:F};return(N===!0||N===!1)&&(K.success=N),K}T.create=I;function $(F){let N=F;return i.objectLiteral(N)&&n.uinteger.is(N.executionOrder)&&(N.success===void 0||i.boolean(N.success))}T.is=$;function V(F,N){return F===N?!0:F==null||N==null?!1:F.executionOrder===N.executionOrder&&F.success===N.success}T.equals=V})(c||(e.ExecutionSummary=c={}));var d;(function(T){function I(N,K){return{kind:N,document:K}}T.create=I;function $(N){let K=N;return i.objectLiteral(K)&&s.is(K.kind)&&n.DocumentUri.is(K.document)&&(K.metadata===void 0||i.objectLiteral(K.metadata))}T.is=$;function V(N,K){let pe=new Set;return N.document!==K.document&&pe.add("document"),N.kind!==K.kind&&pe.add("kind"),N.executionSummary!==K.executionSummary&&pe.add("executionSummary"),(N.metadata!==void 0||K.metadata!==void 0)&&!F(N.metadata,K.metadata)&&pe.add("metadata"),(N.executionSummary!==void 0||K.executionSummary!==void 0)&&!c.equals(N.executionSummary,K.executionSummary)&&pe.add("executionSummary"),pe}T.diff=V;function F(N,K){if(N===K)return!0;if(N==null||K==null||typeof N!=typeof K||typeof N!="object")return!1;let pe=Array.isArray(N),P=Array.isArray(K);if(pe!==P)return!1;if(pe&&P){if(N.length!==K.length)return!1;for(let A=0;A<N.length;A++)if(!F(N[A],K[A]))return!1}if(i.objectLiteral(N)&&i.objectLiteral(K)){let A=Object.keys(N),W=Object.keys(K);if(A.length!==W.length||(A.sort(),W.sort(),!F(A,W)))return!1;for(let de=0;de<A.length;de++){let fe=A[de];if(!F(N[fe],K[fe]))return!1}}return!0}})(d||(e.NotebookCell=d={}));var f;(function(T){function I(V,F,N,K){return{uri:V,notebookType:F,version:N,cells:K}}T.create=I;function $(V){let F=V;return i.objectLiteral(F)&&i.string(F.uri)&&n.integer.is(F.version)&&i.typedArray(F.cells,d.is)}T.is=$})(f||(e.NotebookDocument=f={}));var p;(function(T){T.method="notebookDocument/sync",T.messageDirection=o.MessageDirection.clientToServer,T.type=new o.RegistrationType(T.method)})(p||(e.NotebookDocumentSyncRegistrationType=p={}));var y;(function(T){T.method="notebookDocument/didOpen",T.messageDirection=o.MessageDirection.clientToServer,T.type=new o.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(y||(e.DidOpenNotebookDocumentNotification=y={}));var w;(function(T){function I(V){let F=V;return i.objectLiteral(F)&&n.uinteger.is(F.start)&&n.uinteger.is(F.deleteCount)&&(F.cells===void 0||i.typedArray(F.cells,d.is))}T.is=I;function $(V,F,N){let K={start:V,deleteCount:F};return N!==void 0&&(K.cells=N),K}T.create=$})(w||(e.NotebookCellArrayChange=w={}));var _;(function(T){T.method="notebookDocument/didChange",T.messageDirection=o.MessageDirection.clientToServer,T.type=new o.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(_||(e.DidChangeNotebookDocumentNotification=_={}));var C;(function(T){T.method="notebookDocument/didSave",T.messageDirection=o.MessageDirection.clientToServer,T.type=new o.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(C||(e.DidSaveNotebookDocumentNotification=C={}));var E;(function(T){T.method="notebookDocument/didClose",T.messageDirection=o.MessageDirection.clientToServer,T.type=new o.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(E||(e.DidCloseNotebookDocumentNotification=E={}))})),cg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineCompletionRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/inlineCompletion",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.InlineCompletionRequest=i={}))})),ug=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceSymbolRequest=e.CodeActionResolveRequest=e.CodeActionRequest=e.DocumentSymbolRequest=e.DocumentHighlightRequest=e.ReferencesRequest=e.DefinitionRequest=e.SignatureHelpRequest=e.SignatureHelpTriggerKind=e.HoverRequest=e.CompletionResolveRequest=e.CompletionRequest=e.CompletionTriggerKind=e.PublishDiagnosticsNotification=e.WatchKind=e.RelativePattern=e.FileChangeType=e.DidChangeWatchedFilesNotification=e.WillSaveTextDocumentWaitUntilRequest=e.WillSaveTextDocumentNotification=e.TextDocumentSaveReason=e.DidSaveTextDocumentNotification=e.DidCloseTextDocumentNotification=e.DidChangeTextDocumentNotification=e.TextDocumentContentChangeEvent=e.DidOpenTextDocumentNotification=e.TextDocumentSyncKind=e.TelemetryEventNotification=e.LogMessageNotification=e.ShowMessageRequest=e.ShowMessageNotification=e.MessageType=e.DidChangeConfigurationNotification=e.ExitNotification=e.ShutdownRequest=e.InitializedNotification=e.InitializeErrorCodes=e.InitializeRequest=e.WorkDoneProgressOptions=e.TextDocumentRegistrationOptions=e.StaticRegistrationOptions=e.PositionEncodingKind=e.FailureHandlingKind=e.ResourceOperationKind=e.UnregistrationRequest=e.RegistrationRequest=e.DocumentSelector=e.NotebookCellTextDocumentFilter=e.NotebookDocumentFilter=e.TextDocumentFilter=void 0,e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.WillRenameFilesRequest=e.DidRenameFilesNotification=e.WillCreateFilesRequest=e.DidCreateFilesNotification=e.FileOperationPatternKind=e.LinkedEditingRangeRequest=e.ShowDocumentRequest=e.SemanticTokensRegistrationType=e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.TokenFormat=e.CallHierarchyPrepareRequest=e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=e.SelectionRangeRequest=e.DeclarationRequest=e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=e.ColorPresentationRequest=e.DocumentColorRequest=e.ConfigurationRequest=e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=e.TypeDefinitionRequest=e.ImplementationRequest=e.ApplyWorkspaceEditRequest=e.ExecuteCommandRequest=e.PrepareRenameRequest=e.RenameRequest=e.PrepareSupportDefaultBehavior=e.DocumentOnTypeFormattingRequest=e.DocumentRangesFormattingRequest=e.DocumentRangeFormattingRequest=e.DocumentFormattingRequest=e.DocumentLinkResolveRequest=e.DocumentLinkRequest=e.CodeLensRefreshRequest=e.CodeLensResolveRequest=e.CodeLensRequest=e.WorkspaceSymbolResolveRequest=void 0,e.InlineCompletionRequest=e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=e.InlineValueRefreshRequest=e.InlineValueRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchySubtypesRequest=e.TypeHierarchyPrepareRequest=void 0;var n=Vt(),i=(Sh(),Tu(kh)),o=Yl(),s=V0();Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return s.ImplementationRequest}});var c=$0();Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return c.TypeDefinitionRequest}});var d=W0();Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return d.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return d.DidChangeWorkspaceFoldersNotification}});var f=U0();Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return f.ConfigurationRequest}});var p=K0();Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return p.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return p.ColorPresentationRequest}});var y=Q0();Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return y.FoldingRangeRequest}}),Object.defineProperty(e,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return y.FoldingRangeRefreshRequest}});var w=G0();Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return w.DeclarationRequest}});var _=J0();Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return _.SelectionRangeRequest}});var C=X0();Object.defineProperty(e,"WorkDoneProgress",{enumerable:!0,get:function(){return C.WorkDoneProgress}}),Object.defineProperty(e,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return C.WorkDoneProgressCreateRequest}}),Object.defineProperty(e,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return C.WorkDoneProgressCancelNotification}});var E=Y0();Object.defineProperty(e,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return E.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(e,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return E.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(e,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return E.CallHierarchyPrepareRequest}});var T=Z0();Object.defineProperty(e,"TokenFormat",{enumerable:!0,get:function(){return T.TokenFormat}}),Object.defineProperty(e,"SemanticTokensRequest",{enumerable:!0,get:function(){return T.SemanticTokensRequest}}),Object.defineProperty(e,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return T.SemanticTokensDeltaRequest}}),Object.defineProperty(e,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return T.SemanticTokensRangeRequest}}),Object.defineProperty(e,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return T.SemanticTokensRefreshRequest}}),Object.defineProperty(e,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return T.SemanticTokensRegistrationType}});var I=eg();Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return I.ShowDocumentRequest}});var $=tg();Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return $.LinkedEditingRangeRequest}});var V=ng();Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:function(){return V.FileOperationPatternKind}}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:function(){return V.DidCreateFilesNotification}}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:function(){return V.WillCreateFilesRequest}}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:function(){return V.DidRenameFilesNotification}}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:function(){return V.WillRenameFilesRequest}}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return V.DidDeleteFilesNotification}}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return V.WillDeleteFilesRequest}});var F=rg();Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return F.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return F.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return F.MonikerRequest}});var N=ig();Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return N.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return N.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return N.TypeHierarchySupertypesRequest}});var K=ag();Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return K.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return K.InlineValueRefreshRequest}});var pe=og();Object.defineProperty(e,"InlayHintRequest",{enumerable:!0,get:function(){return pe.InlayHintRequest}}),Object.defineProperty(e,"InlayHintResolveRequest",{enumerable:!0,get:function(){return pe.InlayHintResolveRequest}}),Object.defineProperty(e,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return pe.InlayHintRefreshRequest}});var P=sg();Object.defineProperty(e,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return P.DiagnosticServerCancellationData}}),Object.defineProperty(e,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return P.DocumentDiagnosticReportKind}}),Object.defineProperty(e,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return P.DocumentDiagnosticRequest}}),Object.defineProperty(e,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return P.WorkspaceDiagnosticRequest}}),Object.defineProperty(e,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return P.DiagnosticRefreshRequest}});var A=lg();Object.defineProperty(e,"NotebookCellKind",{enumerable:!0,get:function(){return A.NotebookCellKind}}),Object.defineProperty(e,"ExecutionSummary",{enumerable:!0,get:function(){return A.ExecutionSummary}}),Object.defineProperty(e,"NotebookCell",{enumerable:!0,get:function(){return A.NotebookCell}}),Object.defineProperty(e,"NotebookDocument",{enumerable:!0,get:function(){return A.NotebookDocument}}),Object.defineProperty(e,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return A.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(e,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return A.DidOpenNotebookDocumentNotification}}),Object.defineProperty(e,"NotebookCellArrayChange",{enumerable:!0,get:function(){return A.NotebookCellArrayChange}}),Object.defineProperty(e,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return A.DidChangeNotebookDocumentNotification}}),Object.defineProperty(e,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return A.DidSaveNotebookDocumentNotification}}),Object.defineProperty(e,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return A.DidCloseNotebookDocumentNotification}});var W=cg();Object.defineProperty(e,"InlineCompletionRequest",{enumerable:!0,get:function(){return W.InlineCompletionRequest}});var de;(function(M){function Ye(j){let te=j;return o.string(te)||o.string(te.language)||o.string(te.scheme)||o.string(te.pattern)}M.is=Ye})(de||(e.TextDocumentFilter=de={}));var fe;(function(M){function Ye(j){let te=j;return o.objectLiteral(te)&&(o.string(te.notebookType)||o.string(te.scheme)||o.string(te.pattern))}M.is=Ye})(fe||(e.NotebookDocumentFilter=fe={}));var we;(function(M){function Ye(j){let te=j;return o.objectLiteral(te)&&(o.string(te.notebook)||fe.is(te.notebook))&&(te.language===void 0||o.string(te.language))}M.is=Ye})(we||(e.NotebookCellTextDocumentFilter=we={}));var J;(function(M){function Ye(j){if(!Array.isArray(j))return!1;for(let te of j)if(!o.string(te)&&!de.is(te)&&!we.is(te))return!1;return!0}M.is=Ye})(J||(e.DocumentSelector=J={}));var be;(function(M){M.method="client/registerCapability",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType(M.method)})(be||(e.RegistrationRequest=be={}));var Ce;(function(M){M.method="client/unregisterCapability",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType(M.method)})(Ce||(e.UnregistrationRequest=Ce={}));var Z;(function(M){M.Create="create",M.Rename="rename",M.Delete="delete"})(Z||(e.ResourceOperationKind=Z={}));var re;(function(M){M.Abort="abort",M.Transactional="transactional",M.TextOnlyTransactional="textOnlyTransactional",M.Undo="undo"})(re||(e.FailureHandlingKind=re={}));var se;(function(M){M.UTF8="utf-8",M.UTF16="utf-16",M.UTF32="utf-32"})(se||(e.PositionEncodingKind=se={}));var Q;(function(M){function Ye(j){let te=j;return te&&o.string(te.id)&&te.id.length>0}M.hasId=Ye})(Q||(e.StaticRegistrationOptions=Q={}));var Le;(function(M){function Ye(j){let te=j;return te&&(te.documentSelector===null||J.is(te.documentSelector))}M.is=Ye})(Le||(e.TextDocumentRegistrationOptions=Le={}));var Fe;(function(M){function Ye(te){let ve=te;return o.objectLiteral(ve)&&(ve.workDoneProgress===void 0||o.boolean(ve.workDoneProgress))}M.is=Ye;function j(te){let ve=te;return ve&&o.boolean(ve.workDoneProgress)}M.hasWorkDoneProgress=j})(Fe||(e.WorkDoneProgressOptions=Fe={}));var et;(function(M){M.method="initialize",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(et||(e.InitializeRequest=et={}));var Be;(function(M){M.unknownProtocolVersion=1})(Be||(e.InitializeErrorCodes=Be={}));var je;(function(M){M.method="initialized",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(je||(e.InitializedNotification=je={}));var Pe;(function(M){M.method="shutdown",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType0(M.method)})(Pe||(e.ShutdownRequest=Pe={}));var Ae;(function(M){M.method="exit",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType0(M.method)})(Ae||(e.ExitNotification=Ae={}));var ft;(function(M){M.method="workspace/didChangeConfiguration",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(ft||(e.DidChangeConfigurationNotification=ft={}));var mt;(function(M){M.Error=1,M.Warning=2,M.Info=3,M.Log=4,M.Debug=5})(mt||(e.MessageType=mt={}));var Dn;(function(M){M.method="window/showMessage",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolNotificationType(M.method)})(Dn||(e.ShowMessageNotification=Dn={}));var un;(function(M){M.method="window/showMessageRequest",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType(M.method)})(un||(e.ShowMessageRequest=un={}));var We;(function(M){M.method="window/logMessage",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolNotificationType(M.method)})(We||(e.LogMessageNotification=We={}));var tn;(function(M){M.method="telemetry/event",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolNotificationType(M.method)})(tn||(e.TelemetryEventNotification=tn={}));var wt;(function(M){M.None=0,M.Full=1,M.Incremental=2})(wt||(e.TextDocumentSyncKind=wt={}));var vn;(function(M){M.method="textDocument/didOpen",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(vn||(e.DidOpenTextDocumentNotification=vn={}));var vr;(function(M){function Ye(te){let ve=te;return ve!=null&&typeof ve.text=="string"&&ve.range!==void 0&&(ve.rangeLength===void 0||typeof ve.rangeLength=="number")}M.isIncremental=Ye;function j(te){let ve=te;return ve!=null&&typeof ve.text=="string"&&ve.range===void 0&&ve.rangeLength===void 0}M.isFull=j})(vr||(e.TextDocumentContentChangeEvent=vr={}));var pt;(function(M){M.method="textDocument/didChange",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(pt||(e.DidChangeTextDocumentNotification=pt={}));var Fr;(function(M){M.method="textDocument/didClose",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(Fr||(e.DidCloseTextDocumentNotification=Fr={}));var nn;(function(M){M.method="textDocument/didSave",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(nn||(e.DidSaveTextDocumentNotification=nn={}));var mi;(function(M){M.Manual=1,M.AfterDelay=2,M.FocusOut=3})(mi||(e.TextDocumentSaveReason=mi={}));var On;(function(M){M.method="textDocument/willSave",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(On||(e.WillSaveTextDocumentNotification=On={}));var br;(function(M){M.method="textDocument/willSaveWaitUntil",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(br||(e.WillSaveTextDocumentWaitUntilRequest=br={}));var Pn;(function(M){M.method="workspace/didChangeWatchedFiles",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(Pn||(e.DidChangeWatchedFilesNotification=Pn={}));var dn;(function(M){M.Created=1,M.Changed=2,M.Deleted=3})(dn||(e.FileChangeType=dn={}));var ta;(function(M){function Ye(j){let te=j;return o.objectLiteral(te)&&(i.URI.is(te.baseUri)||i.WorkspaceFolder.is(te.baseUri))&&o.string(te.pattern)}M.is=Ye})(ta||(e.RelativePattern=ta={}));var gi;(function(M){M.Create=1,M.Change=2,M.Delete=4})(gi||(e.WatchKind=gi={}));var Ut;(function(M){M.method="textDocument/publishDiagnostics",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolNotificationType(M.method)})(Ut||(e.PublishDiagnosticsNotification=Ut={}));var yi;(function(M){M.Invoked=1,M.TriggerCharacter=2,M.TriggerForIncompleteCompletions=3})(yi||(e.CompletionTriggerKind=yi={}));var fn;(function(M){M.method="textDocument/completion",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(fn||(e.CompletionRequest=fn={}));var ni;(function(M){M.method="completionItem/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(ni||(e.CompletionResolveRequest=ni={}));var zt;(function(M){M.method="textDocument/hover",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(zt||(e.HoverRequest=zt={}));var Br;(function(M){M.Invoked=1,M.TriggerCharacter=2,M.ContentChange=3})(Br||(e.SignatureHelpTriggerKind=Br={}));var _t;(function(M){M.method="textDocument/signatureHelp",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(_t||(e.SignatureHelpRequest=_t={}));var vi;(function(M){M.method="textDocument/definition",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(vi||(e.DefinitionRequest=vi={}));var na;(function(M){M.method="textDocument/references",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(na||(e.ReferencesRequest=na={}));var wr;(function(M){M.method="textDocument/documentHighlight",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(wr||(e.DocumentHighlightRequest=wr={}));var Jt;(function(M){M.method="textDocument/documentSymbol",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Jt||(e.DocumentSymbolRequest=Jt={}));var Ge;(function(M){M.method="textDocument/codeAction",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Ge||(e.CodeActionRequest=Ge={}));var gt;(function(M){M.method="codeAction/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(gt||(e.CodeActionResolveRequest=gt={}));var xt;(function(M){M.method="workspace/symbol",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(xt||(e.WorkspaceSymbolRequest=xt={}));var kt;(function(M){M.method="workspaceSymbol/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(kt||(e.WorkspaceSymbolResolveRequest=kt={}));var zn;(function(M){M.method="textDocument/codeLens",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(zn||(e.CodeLensRequest=zn={}));var _r;(function(M){M.method="codeLens/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(_r||(e.CodeLensResolveRequest=_r={}));var St;(function(M){M.method="workspace/codeLens/refresh",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType0(M.method)})(St||(e.CodeLensRefreshRequest=St={}));var ir;(function(M){M.method="textDocument/documentLink",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(ir||(e.DocumentLinkRequest=ir={}));var Mn;(function(M){M.method="documentLink/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Mn||(e.DocumentLinkResolveRequest=Mn={}));var Hr;(function(M){M.method="textDocument/formatting",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Hr||(e.DocumentFormattingRequest=Hr={}));var bn;(function(M){M.method="textDocument/rangeFormatting",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(bn||(e.DocumentRangeFormattingRequest=bn={}));var ar;(function(M){M.method="textDocument/rangesFormatting",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(ar||(e.DocumentRangesFormattingRequest=ar={}));var bi;(function(M){M.method="textDocument/onTypeFormatting",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(bi||(e.DocumentOnTypeFormattingRequest=bi={}));var ri;(function(M){M.Identifier=1})(ri||(e.PrepareSupportDefaultBehavior=ri={}));var Ln;(function(M){M.method="textDocument/rename",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Ln||(e.RenameRequest=Ln={}));var wi;(function(M){M.method="textDocument/prepareRename",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(wi||(e.PrepareRenameRequest=wi={}));var Fn;(function(M){M.method="workspace/executeCommand",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Fn||(e.ExecuteCommandRequest=Fn={}));var or;(function(M){M.method="workspace/applyEdit",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType("workspace/applyEdit")})(or||(e.ApplyWorkspaceEditRequest=or={}))})),dg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var n=ja();function i(o,s,c,d){return n.ConnectionStrategy.is(d)&&(d={connectionStrategy:d}),(0,n.createMessageConnection)(o,s,c,d)}e.createProtocolConnection=i})),fg=Ee((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,f,p){p===void 0&&(p=f);var y=Object.getOwnPropertyDescriptor(d,f);(!y||("get"in y?!d.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(c,p,y)}):(function(c,d,f,p){p===void 0&&(p=f),c[p]=d[f]})),i=e&&e.__exportStar||function(c,d){for(var f in c)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&n(d,c,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,i(ja(),e),i((Sh(),Tu(kh)),e),i(Vt(),e),i(ug(),e);var o=dg();Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:function(){return o.createProtocolConnection}});var s;(function(c){c.lspReservedErrorRangeStart=-32899,c.RequestFailed=-32803,c.ServerCancelled=-32802,c.ContentModified=-32801,c.RequestCancelled=-32800,c.lspReservedErrorRangeEnd=-32800})(s||(e.LSPErrorCodes=s={}))})),td=Ee((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,f,p){p===void 0&&(p=f);var y=Object.getOwnPropertyDescriptor(d,f);(!y||("get"in y?!d.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(c,p,y)}):(function(c,d,f,p){p===void 0&&(p=f),c[p]=d[f]})),i=e&&e.__exportStar||function(c,d){for(var f in c)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&n(d,c,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var o=Nd();i(Nd(),e),i(fg(),e);function s(c,d,f,p){return(0,o.createMessageConnection)(c,d,f,p)}e.createProtocolConnection=s}));function yn(e,n){if(n.line>=e.lines)return n.character===0?e.length:void 0;let i=e.line(n.line+1).from+n.character;if(!(i>e.length))return i}function Ir(e,n){return yn(e,n)||0}function Xi(e,n){let i=e.lineAt(n);return{character:n-i.from,line:i.number-1}}var Zl=new ww.Renderer,Jx=Zl.code;Zl.code=e=>e.text.trim()?Jx.call(Zl,e):"";function pg(e){return ww(e,{async:!1,gfm:!0,breaks:!0,renderer:Zl})}function Ar(e,n=pg){if(!e)return"";if(ek(e)){let i=e.value;return e.kind==="markdown"&&(i=n(i.trim())),i}return Array.isArray(e)?e.map(i=>Ar(i,n)).filter(Boolean).join(`
46
+ `)),te){let Te=j.error?` Request failed: ${j.error.message} (${j.error.code}).`:"";wt.log(`Received response '${te.method} - (${j.id})' in ${Date.now()-te.timerStart}ms.${Te}`,ve)}else wt.log(`Received response ${j.id} without active response promise.`,ve)}else bn("receive-response",j)}function bn(j,te){if(!wt||We===_.Off)return;let ve={isLSPMessage:!0,type:j,message:te,timestamp:Date.now()};wt.log(ve)}function ar(){if(yi())throw new V($.Closed,"Connection is closed.");if(fn())throw new V($.Disposed,"Connection is disposed.")}function bi(){if(Ut())throw new V($.AlreadyListening,"Connection is already listening")}function ri(){if(!Ut())throw Error("Call listen() first.")}function Ln(j){return j===void 0?null:j}function wi(j){if(j!==null)return j}function Fn(j){return j!=null&&!Array.isArray(j)&&typeof j=="object"}function or(j,te){switch(j){case o.ParameterStructures.auto:return Fn(te)?wi(te):[Ln(te)];case o.ParameterStructures.byName:if(!Fn(te))throw Error("Received parameters by name but param is not an object literal.");return wi(te);case o.ParameterStructures.byPosition:return[Ln(te)];default:throw Error(`Unknown parameter structure ${j.toString()}`)}}function M(j,te){let ve,Te=j.numberOfParams;switch(Te){case 0:ve=void 0;break;case 1:ve=or(j.parameterStructures,te[0]);break;default:ve=[];for(let He=0;He<te.length&&He<Te;He++)ve.push(Ln(te[He]));if(te.length<Te)for(let He=te.length;He<Te;He++)ve.push(null);break}return ve}let Ye={sendNotification:(j,...te)=>{ar();let ve,Te;if(i.string(j)){ve=j;let Ve=te[0],ot=0,Mt=o.ParameterStructures.auto;o.ParameterStructures.is(Ve)&&(ot=1,Mt=Ve);let Ze=te.length,Lt=Ze-ot;switch(Lt){case 0:Te=void 0;break;case 1:Te=or(Mt,te[ot]);break;default:if(Mt===o.ParameterStructures.byName)throw Error(`Received ${Lt} parameters for 'by Name' notification parameter structure.`);Te=te.slice(ot,Ze).map(rt=>Ln(rt));break}}else{let Ve=te;ve=j.method,Te=M(j,Ve)}let He={jsonrpc:"2.0",method:ve,params:Te};return _r(He),be.write(He).catch(Ve=>{throw re.error("Sending notification failed."),Ve})},onNotification:(j,te)=>{ar();let ve;return i.func(j)?Be=j:te&&(i.string(j)?(ve=j,je.set(j,{type:void 0,handler:te})):(ve=j.method,je.set(j.method,{type:j,handler:te}))),{dispose:()=>{ve===void 0?Be=void 0:je.delete(ve)}}},onProgress:(j,te,ve)=>{if(Pe.has(te))throw Error(`Progress handler for token ${te} already registered`);return Pe.set(te,ve),{dispose:()=>{Pe.delete(te)}}},sendProgress:(j,te,ve)=>Ye.sendNotification(y.type,{token:te,value:ve}),onUnhandledProgress:nn.event,sendRequest:(j,...te)=>{ar(),ri();let ve,Te,He;if(i.string(j)){ve=j;let Ze=te[0],Lt=te[te.length-1],rt=0,ut=o.ParameterStructures.auto;o.ParameterStructures.is(Ze)&&(rt=1,ut=Ze);let wn=te.length;d.CancellationToken.is(Lt)&&(--wn,He=Lt);let sr=wn-rt;switch(sr){case 0:Te=void 0;break;case 1:Te=or(ut,te[rt]);break;default:if(ut===o.ParameterStructures.byName)throw Error(`Received ${sr} parameters for 'by Name' request parameter structure.`);Te=te.slice(rt,wn).map(ii=>Ln(ii));break}}else{let Ze=te;ve=j.method,Te=M(j,Ze);let Lt=j.numberOfParams;He=d.CancellationToken.is(Ze[Lt])?Ze[Lt]:void 0}let Ve=se++,ot;He&&(ot=He.onCancellationRequested(()=>{let Ze=On.sender.sendCancellation(Ye,Ve);return Ze===void 0?(re.log(`Received no promise from cancellation strategy when cancelling id ${Ve}`),Promise.resolve()):Ze.catch(()=>{re.log(`Sending cancellation messages for id ${Ve} failed`)})}));let Mt={jsonrpc:"2.0",id:Ve,method:ve,params:Te};return zn(Mt),typeof On.sender.enableCancellation=="function"&&On.sender.enableCancellation(Mt),new Promise(async(Ze,Lt)=>{let rt={method:ve,timerStart:Date.now(),resolve:ut=>{Ze(ut),On.sender.cleanup(Ve),ot==null||ot.dispose()},reject:ut=>{Lt(ut),On.sender.cleanup(Ve),ot==null||ot.dispose()}};try{await be.write(Mt),mt.set(Ve,rt)}catch(ut){throw re.error("Sending request failed."),rt.reject(new o.ResponseError(o.ErrorCodes.MessageWriteError,ut.message?ut.message:"Unknown reason")),ut}})},onRequest:(j,te)=>{ar();let ve=null;return w.is(j)?(ve=void 0,Fe=j):i.string(j)?(ve=null,te!==void 0&&(ve=j,et.set(j,{handler:te,type:void 0}))):te!==void 0&&(ve=j.method,et.set(j.method,{type:j,handler:te})),{dispose:()=>{ve!==null&&(ve===void 0?Fe=void 0:et.delete(ve))}}},hasPendingResponse:()=>mt.size>0,trace:async(j,te,ve)=>{let Te=!1,He=E.Text;ve!==void 0&&(i.boolean(ve)?Te=ve:(Te=ve.sendNotification||!1,He=ve.traceFormat||E.Text)),We=j,tn=He,wt=We===_.Off?void 0:te,Te&&!yi()&&!fn()&&await Ye.sendNotification(T.type,{value:_.toString(j)})},onError:vr.event,onClose:pt.event,onUnhandledNotification:Fr.event,onDispose:mi.event,end:()=>{be.end()},dispose:()=>{if(fn())return;vn=fe.Disposed,mi.fire(void 0);let j=new o.ResponseError(o.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let te of mt.values())te.reject(j);mt=new Map,un=new Map,Dn=new Set,ft=new s.LinkedMap,i.func(be.dispose)&&be.dispose(),i.func(J.dispose)&&J.dispose()},listen:()=>{ar(),bi(),vn=fe.Listening,J.listen(wr)},inspect:()=>{(0,n.default)().console.log("inspect")}};return Ye.onNotification(I.type,j=>{if(We===_.Off||!wt)return;let te=We===_.Verbose||We===_.Compact;wt.log(j.message,te?j.verbose:void 0)}),Ye.onNotification(y.type,j=>{let te=Pe.get(j.token);te?te(j.value):nn.fire(j)}),Ye}e.createMessageConnection=we})),Jl=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;var n=Pd();Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return n.Message}}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:function(){return n.RequestType}}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:function(){return n.RequestType0}}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:function(){return n.RequestType1}}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:function(){return n.RequestType2}}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:function(){return n.RequestType3}}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:function(){return n.RequestType4}}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:function(){return n.RequestType5}}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:function(){return n.RequestType6}}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:function(){return n.RequestType7}}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:function(){return n.RequestType8}}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:function(){return n.RequestType9}}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:function(){return n.ResponseError}}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:function(){return n.ErrorCodes}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return n.NotificationType}}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:function(){return n.NotificationType0}}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:function(){return n.NotificationType1}}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:function(){return n.NotificationType2}}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:function(){return n.NotificationType3}}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:function(){return n.NotificationType4}}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:function(){return n.NotificationType5}}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:function(){return n.NotificationType6}}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:function(){return n.NotificationType7}}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:function(){return n.NotificationType8}}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:function(){return n.NotificationType9}}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:function(){return n.ParameterStructures}});var i=Md();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:function(){return i.LinkedMap}}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:function(){return i.LRUCache}}),Object.defineProperty(e,"Touch",{enumerable:!0,get:function(){return i.Touch}});var o=A0();Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return o.Disposable}});var s=Mo();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return s.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return s.Emitter}});var c=Gl();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return c.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return c.CancellationToken}});var d=q0();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return d.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return d.SharedArrayReceiverStrategy}});var f=j0();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return f.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return f.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return f.ReadableStreamMessageReader}});var p=z0();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return p.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return p.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return p.WriteableStreamMessageWriter}});var y=F0();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return y.AbstractMessageBuffer}});var w=B0();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:function(){return w.ConnectionStrategy}}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:function(){return w.ConnectionOptions}}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:function(){return w.NullLogger}}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:function(){return w.createMessageConnection}}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:function(){return w.ProgressToken}}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:function(){return w.ProgressType}}),Object.defineProperty(e,"Trace",{enumerable:!0,get:function(){return w.Trace}}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:function(){return w.TraceValues}}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:function(){return w.TraceFormat}}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:function(){return w.SetTraceNotification}}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:function(){return w.LogTraceNotification}}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:function(){return w.ConnectionErrors}}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:function(){return w.ConnectionError}}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return w.CancellationReceiverStrategy}}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:function(){return w.CancellationSenderStrategy}}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:function(){return w.CancellationStrategy}}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:function(){return w.MessageStrategy}}),e.RAL=Ji().default})),H0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=Jl(),i=class mx extends n.AbstractMessageBuffer{constructor(y="utf-8"){super(y),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return mx.emptyBuffer}fromString(y,w){return new TextEncoder().encode(y)}toString(y,w){return w==="ascii"?this.asciiDecoder.decode(y):new TextDecoder(w).decode(y)}asNative(y,w){return w===void 0?y:y.slice(0,w)}allocNative(y){return new Uint8Array(y)}};i.emptyBuffer=new Uint8Array;var o=class{constructor(p){this.socket=p,this._onData=new n.Emitter,this._messageListener=y=>{y.data.arrayBuffer().then(w=>{this._onData.fire(new Uint8Array(w))},()=>{(0,n.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(p){return this.socket.addEventListener("close",p),n.Disposable.create(()=>this.socket.removeEventListener("close",p))}onError(p){return this.socket.addEventListener("error",p),n.Disposable.create(()=>this.socket.removeEventListener("error",p))}onEnd(p){return this.socket.addEventListener("end",p),n.Disposable.create(()=>this.socket.removeEventListener("end",p))}onData(p){return this._onData.event(p)}},s=class{constructor(p){this.socket=p}onClose(p){return this.socket.addEventListener("close",p),n.Disposable.create(()=>this.socket.removeEventListener("close",p))}onError(p){return this.socket.addEventListener("error",p),n.Disposable.create(()=>this.socket.removeEventListener("error",p))}onEnd(p){return this.socket.addEventListener("end",p),n.Disposable.create(()=>this.socket.removeEventListener("end",p))}write(p,y){if(typeof p=="string"){if(y!==void 0&&y!=="utf-8")throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${y}`);this.socket.send(p)}else this.socket.send(p);return Promise.resolve()}end(){this.socket.close()}},c=new TextEncoder,d=Object.freeze({messageBuffer:Object.freeze({create:p=>new i(p)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(p,y)=>{if(y.charset!=="utf-8")throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${y.charset}`);return Promise.resolve(c.encode(JSON.stringify(p,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(p,y)=>{if(!(p instanceof Uint8Array))throw Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(y.charset).decode(p)))}})}),stream:Object.freeze({asReadableStream:p=>new o(p),asWritableStream:p=>new s(p)}),console,timer:Object.freeze({setTimeout(p,y,...w){let _=setTimeout(p,y,...w);return{dispose:()=>clearTimeout(_)}},setImmediate(p,...y){let w=setTimeout(p,0,...y);return{dispose:()=>clearTimeout(w)}},setInterval(p,y,...w){let _=setInterval(p,y,...w);return{dispose:()=>clearInterval(_)}}})});function f(){return d}(function(p){function y(){n.RAL.install(d)}p.install=y})(f||(f={})),e.default=f})),ja=Ee((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,f,p){p===void 0&&(p=f);var y=Object.getOwnPropertyDescriptor(d,f);(!y||("get"in y?!d.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(c,p,y)}):(function(c,d,f,p){p===void 0&&(p=f),c[p]=d[f]})),i=e&&e.__exportStar||function(c,d){for(var f in c)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&n(d,c,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0,H0().default.install();var o=Jl();i(Jl(),e),e.BrowserMessageReader=class extends o.AbstractMessageReader{constructor(c){super(),this._onData=new o.Emitter,this._messageListener=d=>{this._onData.fire(d.data)},c.addEventListener("error",d=>this.fireError(d)),c.onmessage=this._messageListener}listen(c){return this._onData.event(c)}},e.BrowserMessageWriter=class extends o.AbstractMessageWriter{constructor(c){super(),this.port=c,this.errorCount=0,c.addEventListener("error",d=>this.fireError(d))}write(c){try{return this.port.postMessage(c),Promise.resolve()}catch(d){return this.handleError(d,c),Promise.reject(d)}}handleError(c,d){this.errorCount++,this.fireError(c,d,this.errorCount)}end(){}};function s(c,d,f,p){return f===void 0&&(f=o.NullLogger),o.ConnectionStrategy.is(p)&&(p={connectionStrategy:p}),(0,o.createMessageConnection)(c,d,f,p)}e.createMessageConnection=s})),Nd=Ee(((e,n)=>{n.exports=ja()})),Vt=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;var n=ja(),i;(function(o){o.clientToServer="clientToServer",o.serverToClient="serverToClient",o.both="both"})(i||(e.MessageDirection=i={})),e.RegistrationType=class{constructor(o){this.method=o}},e.ProtocolRequestType0=class extends n.RequestType0{constructor(o){super(o)}},e.ProtocolRequestType=class extends n.RequestType{constructor(o){super(o,n.ParameterStructures.byName)}},e.ProtocolNotificationType0=class extends n.NotificationType0{constructor(o){super(o)}},e.ProtocolNotificationType=class extends n.NotificationType{constructor(o){super(o,n.ParameterStructures.byName)}}})),Xl=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.objectLiteral=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function n(w){return w===!0||w===!1}e.boolean=n;function i(w){return typeof w=="string"||w instanceof String}e.string=i;function o(w){return typeof w=="number"||w instanceof Number}e.number=o;function s(w){return w instanceof Error}e.error=s;function c(w){return typeof w=="function"}e.func=c;function d(w){return Array.isArray(w)}e.array=d;function f(w){return d(w)&&w.every(_=>i(_))}e.stringArray=f;function p(w,_){return Array.isArray(w)&&w.every(_)}e.typedArray=p;function y(w){return typeof w=="object"&&!!w}e.objectLiteral=y})),V0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/implementation",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ImplementationRequest=i={}))})),$0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/typeDefinition",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.TypeDefinitionRequest=i={}))})),W0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;var n=Vt(),i;(function(s){s.method="workspace/workspaceFolders",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(i||(e.WorkspaceFoldersRequest=i={}));var o;(function(s){s.method="workspace/didChangeWorkspaceFolders",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolNotificationType(s.method)})(o||(e.DidChangeWorkspaceFoldersNotification=o={}))})),U0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;var n=Vt(),i;(function(o){o.method="workspace/configuration",o.messageDirection=n.MessageDirection.serverToClient,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ConfigurationRequest=i={}))})),K0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;var n=Vt(),i;(function(s){s.method="textDocument/documentColor",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.DocumentColorRequest=i={}));var o;(function(s){s.method="textDocument/colorPresentation",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(o||(e.ColorPresentationRequest=o={}))})),Q0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;var n=Vt(),i;(function(s){s.method="textDocument/foldingRange",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.FoldingRangeRequest=i={}));var o;(function(s){s.method="workspace/foldingRange/refresh",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(o||(e.FoldingRangeRefreshRequest=o={}))})),G0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/declaration",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.DeclarationRequest=i={}))})),J0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/selectionRange",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.SelectionRangeRequest=i={}))})),X0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;var n=ja(),i=Vt(),o;(function(d){d.type=new n.ProgressType;function f(p){return p===d.type}d.is=f})(o||(e.WorkDoneProgress=o={}));var s;(function(d){d.method="window/workDoneProgress/create",d.messageDirection=i.MessageDirection.serverToClient,d.type=new i.ProtocolRequestType(d.method)})(s||(e.WorkDoneProgressCreateRequest=s={}));var c;(function(d){d.method="window/workDoneProgress/cancel",d.messageDirection=i.MessageDirection.clientToServer,d.type=new i.ProtocolNotificationType(d.method)})(c||(e.WorkDoneProgressCancelNotification=c={}))})),Y0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;var n=Vt(),i;(function(c){c.method="textDocument/prepareCallHierarchy",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.CallHierarchyPrepareRequest=i={}));var o;(function(c){c.method="callHierarchy/incomingCalls",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(o||(e.CallHierarchyIncomingCallsRequest=o={}));var s;(function(c){c.method="callHierarchy/outgoingCalls",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.CallHierarchyOutgoingCallsRequest=s={}))})),Z0=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;var n=Vt(),i;(function(p){p.Relative="relative"})(i||(e.TokenFormat=i={}));var o;(function(p){p.method="textDocument/semanticTokens",p.type=new n.RegistrationType(p.method)})(o||(e.SemanticTokensRegistrationType=o={}));var s;(function(p){p.method="textDocument/semanticTokens/full",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolRequestType(p.method),p.registrationMethod=o.method})(s||(e.SemanticTokensRequest=s={}));var c;(function(p){p.method="textDocument/semanticTokens/full/delta",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolRequestType(p.method),p.registrationMethod=o.method})(c||(e.SemanticTokensDeltaRequest=c={}));var d;(function(p){p.method="textDocument/semanticTokens/range",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolRequestType(p.method),p.registrationMethod=o.method})(d||(e.SemanticTokensRangeRequest=d={}));var f;(function(p){p.method="workspace/semanticTokens/refresh",p.messageDirection=n.MessageDirection.serverToClient,p.type=new n.ProtocolRequestType0(p.method)})(f||(e.SemanticTokensRefreshRequest=f={}))})),eg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;var n=Vt(),i;(function(o){o.method="window/showDocument",o.messageDirection=n.MessageDirection.serverToClient,o.type=new n.ProtocolRequestType(o.method)})(i||(e.ShowDocumentRequest=i={}))})),tg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/linkedEditingRange",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.LinkedEditingRangeRequest=i={}))})),ng=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;var n=Vt(),i;(function(y){y.file="file",y.folder="folder"})(i||(e.FileOperationPatternKind=i={}));var o;(function(y){y.method="workspace/willCreateFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolRequestType(y.method)})(o||(e.WillCreateFilesRequest=o={}));var s;(function(y){y.method="workspace/didCreateFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolNotificationType(y.method)})(s||(e.DidCreateFilesNotification=s={}));var c;(function(y){y.method="workspace/willRenameFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolRequestType(y.method)})(c||(e.WillRenameFilesRequest=c={}));var d;(function(y){y.method="workspace/didRenameFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolNotificationType(y.method)})(d||(e.DidRenameFilesNotification=d={}));var f;(function(y){y.method="workspace/didDeleteFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolNotificationType(y.method)})(f||(e.DidDeleteFilesNotification=f={}));var p;(function(y){y.method="workspace/willDeleteFiles",y.messageDirection=n.MessageDirection.clientToServer,y.type=new n.ProtocolRequestType(y.method)})(p||(e.WillDeleteFilesRequest=p={}))})),rg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;var n=Vt(),i;(function(c){c.document="document",c.project="project",c.group="group",c.scheme="scheme",c.global="global"})(i||(e.UniquenessLevel=i={}));var o;(function(c){c.$import="import",c.$export="export",c.local="local"})(o||(e.MonikerKind=o={}));var s;(function(c){c.method="textDocument/moniker",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.MonikerRequest=s={}))})),ig=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;var n=Vt(),i;(function(c){c.method="textDocument/prepareTypeHierarchy",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.TypeHierarchyPrepareRequest=i={}));var o;(function(c){c.method="typeHierarchy/supertypes",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(o||(e.TypeHierarchySupertypesRequest=o={}));var s;(function(c){c.method="typeHierarchy/subtypes",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.TypeHierarchySubtypesRequest=s={}))})),ag=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;var n=Vt(),i;(function(s){s.method="textDocument/inlineValue",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.InlineValueRequest=i={}));var o;(function(s){s.method="workspace/inlineValue/refresh",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(o||(e.InlineValueRefreshRequest=o={}))})),og=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;var n=Vt(),i;(function(c){c.method="textDocument/inlayHint",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.InlayHintRequest=i={}));var o;(function(c){c.method="inlayHint/resolve",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(o||(e.InlayHintResolveRequest=o={}));var s;(function(c){c.method="workspace/inlayHint/refresh",c.messageDirection=n.MessageDirection.serverToClient,c.type=new n.ProtocolRequestType0(c.method)})(s||(e.InlayHintRefreshRequest=s={}))})),sg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;var n=ja(),i=Xl(),o=Vt(),s;(function(y){function w(_){let C=_;return C&&i.boolean(C.retriggerRequest)}y.is=w})(s||(e.DiagnosticServerCancellationData=s={}));var c;(function(y){y.Full="full",y.Unchanged="unchanged"})(c||(e.DocumentDiagnosticReportKind=c={}));var d;(function(y){y.method="textDocument/diagnostic",y.messageDirection=o.MessageDirection.clientToServer,y.type=new o.ProtocolRequestType(y.method),y.partialResult=new n.ProgressType})(d||(e.DocumentDiagnosticRequest=d={}));var f;(function(y){y.method="workspace/diagnostic",y.messageDirection=o.MessageDirection.clientToServer,y.type=new o.ProtocolRequestType(y.method),y.partialResult=new n.ProgressType})(f||(e.WorkspaceDiagnosticRequest=f={}));var p;(function(y){y.method="workspace/diagnostic/refresh",y.messageDirection=o.MessageDirection.serverToClient,y.type=new o.ProtocolRequestType0(y.method)})(p||(e.DiagnosticRefreshRequest=p={}))})),lg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;var n=(Sh(),Eu(kh)),i=Xl(),o=Vt(),s;(function(T){T.Markup=1,T.Code=2;function I($){return $===1||$===2}T.is=I})(s||(e.NotebookCellKind=s={}));var c;(function(T){function I(F,N){let K={executionOrder:F};return(N===!0||N===!1)&&(K.success=N),K}T.create=I;function $(F){let N=F;return i.objectLiteral(N)&&n.uinteger.is(N.executionOrder)&&(N.success===void 0||i.boolean(N.success))}T.is=$;function V(F,N){return F===N?!0:F==null||N==null?!1:F.executionOrder===N.executionOrder&&F.success===N.success}T.equals=V})(c||(e.ExecutionSummary=c={}));var d;(function(T){function I(N,K){return{kind:N,document:K}}T.create=I;function $(N){let K=N;return i.objectLiteral(K)&&s.is(K.kind)&&n.DocumentUri.is(K.document)&&(K.metadata===void 0||i.objectLiteral(K.metadata))}T.is=$;function V(N,K){let pe=new Set;return N.document!==K.document&&pe.add("document"),N.kind!==K.kind&&pe.add("kind"),N.executionSummary!==K.executionSummary&&pe.add("executionSummary"),(N.metadata!==void 0||K.metadata!==void 0)&&!F(N.metadata,K.metadata)&&pe.add("metadata"),(N.executionSummary!==void 0||K.executionSummary!==void 0)&&!c.equals(N.executionSummary,K.executionSummary)&&pe.add("executionSummary"),pe}T.diff=V;function F(N,K){if(N===K)return!0;if(N==null||K==null||typeof N!=typeof K||typeof N!="object")return!1;let pe=Array.isArray(N),P=Array.isArray(K);if(pe!==P)return!1;if(pe&&P){if(N.length!==K.length)return!1;for(let A=0;A<N.length;A++)if(!F(N[A],K[A]))return!1}if(i.objectLiteral(N)&&i.objectLiteral(K)){let A=Object.keys(N),W=Object.keys(K);if(A.length!==W.length||(A.sort(),W.sort(),!F(A,W)))return!1;for(let de=0;de<A.length;de++){let fe=A[de];if(!F(N[fe],K[fe]))return!1}}return!0}})(d||(e.NotebookCell=d={}));var f;(function(T){function I(V,F,N,K){return{uri:V,notebookType:F,version:N,cells:K}}T.create=I;function $(V){let F=V;return i.objectLiteral(F)&&i.string(F.uri)&&n.integer.is(F.version)&&i.typedArray(F.cells,d.is)}T.is=$})(f||(e.NotebookDocument=f={}));var p;(function(T){T.method="notebookDocument/sync",T.messageDirection=o.MessageDirection.clientToServer,T.type=new o.RegistrationType(T.method)})(p||(e.NotebookDocumentSyncRegistrationType=p={}));var y;(function(T){T.method="notebookDocument/didOpen",T.messageDirection=o.MessageDirection.clientToServer,T.type=new o.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(y||(e.DidOpenNotebookDocumentNotification=y={}));var w;(function(T){function I(V){let F=V;return i.objectLiteral(F)&&n.uinteger.is(F.start)&&n.uinteger.is(F.deleteCount)&&(F.cells===void 0||i.typedArray(F.cells,d.is))}T.is=I;function $(V,F,N){let K={start:V,deleteCount:F};return N!==void 0&&(K.cells=N),K}T.create=$})(w||(e.NotebookCellArrayChange=w={}));var _;(function(T){T.method="notebookDocument/didChange",T.messageDirection=o.MessageDirection.clientToServer,T.type=new o.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(_||(e.DidChangeNotebookDocumentNotification=_={}));var C;(function(T){T.method="notebookDocument/didSave",T.messageDirection=o.MessageDirection.clientToServer,T.type=new o.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(C||(e.DidSaveNotebookDocumentNotification=C={}));var E;(function(T){T.method="notebookDocument/didClose",T.messageDirection=o.MessageDirection.clientToServer,T.type=new o.ProtocolNotificationType(T.method),T.registrationMethod=p.method})(E||(e.DidCloseNotebookDocumentNotification=E={}))})),cg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineCompletionRequest=void 0;var n=Vt(),i;(function(o){o.method="textDocument/inlineCompletion",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolRequestType(o.method)})(i||(e.InlineCompletionRequest=i={}))})),ug=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceSymbolRequest=e.CodeActionResolveRequest=e.CodeActionRequest=e.DocumentSymbolRequest=e.DocumentHighlightRequest=e.ReferencesRequest=e.DefinitionRequest=e.SignatureHelpRequest=e.SignatureHelpTriggerKind=e.HoverRequest=e.CompletionResolveRequest=e.CompletionRequest=e.CompletionTriggerKind=e.PublishDiagnosticsNotification=e.WatchKind=e.RelativePattern=e.FileChangeType=e.DidChangeWatchedFilesNotification=e.WillSaveTextDocumentWaitUntilRequest=e.WillSaveTextDocumentNotification=e.TextDocumentSaveReason=e.DidSaveTextDocumentNotification=e.DidCloseTextDocumentNotification=e.DidChangeTextDocumentNotification=e.TextDocumentContentChangeEvent=e.DidOpenTextDocumentNotification=e.TextDocumentSyncKind=e.TelemetryEventNotification=e.LogMessageNotification=e.ShowMessageRequest=e.ShowMessageNotification=e.MessageType=e.DidChangeConfigurationNotification=e.ExitNotification=e.ShutdownRequest=e.InitializedNotification=e.InitializeErrorCodes=e.InitializeRequest=e.WorkDoneProgressOptions=e.TextDocumentRegistrationOptions=e.StaticRegistrationOptions=e.PositionEncodingKind=e.FailureHandlingKind=e.ResourceOperationKind=e.UnregistrationRequest=e.RegistrationRequest=e.DocumentSelector=e.NotebookCellTextDocumentFilter=e.NotebookDocumentFilter=e.TextDocumentFilter=void 0,e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.WillRenameFilesRequest=e.DidRenameFilesNotification=e.WillCreateFilesRequest=e.DidCreateFilesNotification=e.FileOperationPatternKind=e.LinkedEditingRangeRequest=e.ShowDocumentRequest=e.SemanticTokensRegistrationType=e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.TokenFormat=e.CallHierarchyPrepareRequest=e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=e.SelectionRangeRequest=e.DeclarationRequest=e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=e.ColorPresentationRequest=e.DocumentColorRequest=e.ConfigurationRequest=e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=e.TypeDefinitionRequest=e.ImplementationRequest=e.ApplyWorkspaceEditRequest=e.ExecuteCommandRequest=e.PrepareRenameRequest=e.RenameRequest=e.PrepareSupportDefaultBehavior=e.DocumentOnTypeFormattingRequest=e.DocumentRangesFormattingRequest=e.DocumentRangeFormattingRequest=e.DocumentFormattingRequest=e.DocumentLinkResolveRequest=e.DocumentLinkRequest=e.CodeLensRefreshRequest=e.CodeLensResolveRequest=e.CodeLensRequest=e.WorkspaceSymbolResolveRequest=void 0,e.InlineCompletionRequest=e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=e.InlineValueRefreshRequest=e.InlineValueRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchySubtypesRequest=e.TypeHierarchyPrepareRequest=void 0;var n=Vt(),i=(Sh(),Eu(kh)),o=Xl(),s=V0();Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return s.ImplementationRequest}});var c=$0();Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return c.TypeDefinitionRequest}});var d=W0();Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return d.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return d.DidChangeWorkspaceFoldersNotification}});var f=U0();Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return f.ConfigurationRequest}});var p=K0();Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return p.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return p.ColorPresentationRequest}});var y=Q0();Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return y.FoldingRangeRequest}}),Object.defineProperty(e,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return y.FoldingRangeRefreshRequest}});var w=G0();Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return w.DeclarationRequest}});var _=J0();Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return _.SelectionRangeRequest}});var C=X0();Object.defineProperty(e,"WorkDoneProgress",{enumerable:!0,get:function(){return C.WorkDoneProgress}}),Object.defineProperty(e,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return C.WorkDoneProgressCreateRequest}}),Object.defineProperty(e,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return C.WorkDoneProgressCancelNotification}});var E=Y0();Object.defineProperty(e,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return E.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(e,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return E.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(e,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return E.CallHierarchyPrepareRequest}});var T=Z0();Object.defineProperty(e,"TokenFormat",{enumerable:!0,get:function(){return T.TokenFormat}}),Object.defineProperty(e,"SemanticTokensRequest",{enumerable:!0,get:function(){return T.SemanticTokensRequest}}),Object.defineProperty(e,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return T.SemanticTokensDeltaRequest}}),Object.defineProperty(e,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return T.SemanticTokensRangeRequest}}),Object.defineProperty(e,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return T.SemanticTokensRefreshRequest}}),Object.defineProperty(e,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return T.SemanticTokensRegistrationType}});var I=eg();Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return I.ShowDocumentRequest}});var $=tg();Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return $.LinkedEditingRangeRequest}});var V=ng();Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:function(){return V.FileOperationPatternKind}}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:function(){return V.DidCreateFilesNotification}}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:function(){return V.WillCreateFilesRequest}}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:function(){return V.DidRenameFilesNotification}}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:function(){return V.WillRenameFilesRequest}}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return V.DidDeleteFilesNotification}}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return V.WillDeleteFilesRequest}});var F=rg();Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return F.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return F.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return F.MonikerRequest}});var N=ig();Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return N.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return N.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return N.TypeHierarchySupertypesRequest}});var K=ag();Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return K.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return K.InlineValueRefreshRequest}});var pe=og();Object.defineProperty(e,"InlayHintRequest",{enumerable:!0,get:function(){return pe.InlayHintRequest}}),Object.defineProperty(e,"InlayHintResolveRequest",{enumerable:!0,get:function(){return pe.InlayHintResolveRequest}}),Object.defineProperty(e,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return pe.InlayHintRefreshRequest}});var P=sg();Object.defineProperty(e,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return P.DiagnosticServerCancellationData}}),Object.defineProperty(e,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return P.DocumentDiagnosticReportKind}}),Object.defineProperty(e,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return P.DocumentDiagnosticRequest}}),Object.defineProperty(e,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return P.WorkspaceDiagnosticRequest}}),Object.defineProperty(e,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return P.DiagnosticRefreshRequest}});var A=lg();Object.defineProperty(e,"NotebookCellKind",{enumerable:!0,get:function(){return A.NotebookCellKind}}),Object.defineProperty(e,"ExecutionSummary",{enumerable:!0,get:function(){return A.ExecutionSummary}}),Object.defineProperty(e,"NotebookCell",{enumerable:!0,get:function(){return A.NotebookCell}}),Object.defineProperty(e,"NotebookDocument",{enumerable:!0,get:function(){return A.NotebookDocument}}),Object.defineProperty(e,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return A.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(e,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return A.DidOpenNotebookDocumentNotification}}),Object.defineProperty(e,"NotebookCellArrayChange",{enumerable:!0,get:function(){return A.NotebookCellArrayChange}}),Object.defineProperty(e,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return A.DidChangeNotebookDocumentNotification}}),Object.defineProperty(e,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return A.DidSaveNotebookDocumentNotification}}),Object.defineProperty(e,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return A.DidCloseNotebookDocumentNotification}});var W=cg();Object.defineProperty(e,"InlineCompletionRequest",{enumerable:!0,get:function(){return W.InlineCompletionRequest}});var de;(function(M){function Ye(j){let te=j;return o.string(te)||o.string(te.language)||o.string(te.scheme)||o.string(te.pattern)}M.is=Ye})(de||(e.TextDocumentFilter=de={}));var fe;(function(M){function Ye(j){let te=j;return o.objectLiteral(te)&&(o.string(te.notebookType)||o.string(te.scheme)||o.string(te.pattern))}M.is=Ye})(fe||(e.NotebookDocumentFilter=fe={}));var we;(function(M){function Ye(j){let te=j;return o.objectLiteral(te)&&(o.string(te.notebook)||fe.is(te.notebook))&&(te.language===void 0||o.string(te.language))}M.is=Ye})(we||(e.NotebookCellTextDocumentFilter=we={}));var J;(function(M){function Ye(j){if(!Array.isArray(j))return!1;for(let te of j)if(!o.string(te)&&!de.is(te)&&!we.is(te))return!1;return!0}M.is=Ye})(J||(e.DocumentSelector=J={}));var be;(function(M){M.method="client/registerCapability",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType(M.method)})(be||(e.RegistrationRequest=be={}));var Ce;(function(M){M.method="client/unregisterCapability",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType(M.method)})(Ce||(e.UnregistrationRequest=Ce={}));var Z;(function(M){M.Create="create",M.Rename="rename",M.Delete="delete"})(Z||(e.ResourceOperationKind=Z={}));var re;(function(M){M.Abort="abort",M.Transactional="transactional",M.TextOnlyTransactional="textOnlyTransactional",M.Undo="undo"})(re||(e.FailureHandlingKind=re={}));var se;(function(M){M.UTF8="utf-8",M.UTF16="utf-16",M.UTF32="utf-32"})(se||(e.PositionEncodingKind=se={}));var Q;(function(M){function Ye(j){let te=j;return te&&o.string(te.id)&&te.id.length>0}M.hasId=Ye})(Q||(e.StaticRegistrationOptions=Q={}));var Le;(function(M){function Ye(j){let te=j;return te&&(te.documentSelector===null||J.is(te.documentSelector))}M.is=Ye})(Le||(e.TextDocumentRegistrationOptions=Le={}));var Fe;(function(M){function Ye(te){let ve=te;return o.objectLiteral(ve)&&(ve.workDoneProgress===void 0||o.boolean(ve.workDoneProgress))}M.is=Ye;function j(te){let ve=te;return ve&&o.boolean(ve.workDoneProgress)}M.hasWorkDoneProgress=j})(Fe||(e.WorkDoneProgressOptions=Fe={}));var et;(function(M){M.method="initialize",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(et||(e.InitializeRequest=et={}));var Be;(function(M){M.unknownProtocolVersion=1})(Be||(e.InitializeErrorCodes=Be={}));var je;(function(M){M.method="initialized",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(je||(e.InitializedNotification=je={}));var Pe;(function(M){M.method="shutdown",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType0(M.method)})(Pe||(e.ShutdownRequest=Pe={}));var Ae;(function(M){M.method="exit",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType0(M.method)})(Ae||(e.ExitNotification=Ae={}));var ft;(function(M){M.method="workspace/didChangeConfiguration",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(ft||(e.DidChangeConfigurationNotification=ft={}));var mt;(function(M){M.Error=1,M.Warning=2,M.Info=3,M.Log=4,M.Debug=5})(mt||(e.MessageType=mt={}));var Dn;(function(M){M.method="window/showMessage",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolNotificationType(M.method)})(Dn||(e.ShowMessageNotification=Dn={}));var un;(function(M){M.method="window/showMessageRequest",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType(M.method)})(un||(e.ShowMessageRequest=un={}));var We;(function(M){M.method="window/logMessage",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolNotificationType(M.method)})(We||(e.LogMessageNotification=We={}));var tn;(function(M){M.method="telemetry/event",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolNotificationType(M.method)})(tn||(e.TelemetryEventNotification=tn={}));var wt;(function(M){M.None=0,M.Full=1,M.Incremental=2})(wt||(e.TextDocumentSyncKind=wt={}));var vn;(function(M){M.method="textDocument/didOpen",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(vn||(e.DidOpenTextDocumentNotification=vn={}));var vr;(function(M){function Ye(te){let ve=te;return ve!=null&&typeof ve.text=="string"&&ve.range!==void 0&&(ve.rangeLength===void 0||typeof ve.rangeLength=="number")}M.isIncremental=Ye;function j(te){let ve=te;return ve!=null&&typeof ve.text=="string"&&ve.range===void 0&&ve.rangeLength===void 0}M.isFull=j})(vr||(e.TextDocumentContentChangeEvent=vr={}));var pt;(function(M){M.method="textDocument/didChange",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(pt||(e.DidChangeTextDocumentNotification=pt={}));var Fr;(function(M){M.method="textDocument/didClose",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(Fr||(e.DidCloseTextDocumentNotification=Fr={}));var nn;(function(M){M.method="textDocument/didSave",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(nn||(e.DidSaveTextDocumentNotification=nn={}));var mi;(function(M){M.Manual=1,M.AfterDelay=2,M.FocusOut=3})(mi||(e.TextDocumentSaveReason=mi={}));var On;(function(M){M.method="textDocument/willSave",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(On||(e.WillSaveTextDocumentNotification=On={}));var br;(function(M){M.method="textDocument/willSaveWaitUntil",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(br||(e.WillSaveTextDocumentWaitUntilRequest=br={}));var Pn;(function(M){M.method="workspace/didChangeWatchedFiles",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolNotificationType(M.method)})(Pn||(e.DidChangeWatchedFilesNotification=Pn={}));var dn;(function(M){M.Created=1,M.Changed=2,M.Deleted=3})(dn||(e.FileChangeType=dn={}));var ta;(function(M){function Ye(j){let te=j;return o.objectLiteral(te)&&(i.URI.is(te.baseUri)||i.WorkspaceFolder.is(te.baseUri))&&o.string(te.pattern)}M.is=Ye})(ta||(e.RelativePattern=ta={}));var gi;(function(M){M.Create=1,M.Change=2,M.Delete=4})(gi||(e.WatchKind=gi={}));var Ut;(function(M){M.method="textDocument/publishDiagnostics",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolNotificationType(M.method)})(Ut||(e.PublishDiagnosticsNotification=Ut={}));var yi;(function(M){M.Invoked=1,M.TriggerCharacter=2,M.TriggerForIncompleteCompletions=3})(yi||(e.CompletionTriggerKind=yi={}));var fn;(function(M){M.method="textDocument/completion",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(fn||(e.CompletionRequest=fn={}));var ni;(function(M){M.method="completionItem/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(ni||(e.CompletionResolveRequest=ni={}));var zt;(function(M){M.method="textDocument/hover",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(zt||(e.HoverRequest=zt={}));var Br;(function(M){M.Invoked=1,M.TriggerCharacter=2,M.ContentChange=3})(Br||(e.SignatureHelpTriggerKind=Br={}));var _t;(function(M){M.method="textDocument/signatureHelp",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(_t||(e.SignatureHelpRequest=_t={}));var vi;(function(M){M.method="textDocument/definition",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(vi||(e.DefinitionRequest=vi={}));var na;(function(M){M.method="textDocument/references",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(na||(e.ReferencesRequest=na={}));var wr;(function(M){M.method="textDocument/documentHighlight",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(wr||(e.DocumentHighlightRequest=wr={}));var Jt;(function(M){M.method="textDocument/documentSymbol",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Jt||(e.DocumentSymbolRequest=Jt={}));var Ge;(function(M){M.method="textDocument/codeAction",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Ge||(e.CodeActionRequest=Ge={}));var gt;(function(M){M.method="codeAction/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(gt||(e.CodeActionResolveRequest=gt={}));var xt;(function(M){M.method="workspace/symbol",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(xt||(e.WorkspaceSymbolRequest=xt={}));var kt;(function(M){M.method="workspaceSymbol/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(kt||(e.WorkspaceSymbolResolveRequest=kt={}));var zn;(function(M){M.method="textDocument/codeLens",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(zn||(e.CodeLensRequest=zn={}));var _r;(function(M){M.method="codeLens/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(_r||(e.CodeLensResolveRequest=_r={}));var St;(function(M){M.method="workspace/codeLens/refresh",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType0(M.method)})(St||(e.CodeLensRefreshRequest=St={}));var ir;(function(M){M.method="textDocument/documentLink",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(ir||(e.DocumentLinkRequest=ir={}));var Mn;(function(M){M.method="documentLink/resolve",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Mn||(e.DocumentLinkResolveRequest=Mn={}));var Hr;(function(M){M.method="textDocument/formatting",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Hr||(e.DocumentFormattingRequest=Hr={}));var bn;(function(M){M.method="textDocument/rangeFormatting",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(bn||(e.DocumentRangeFormattingRequest=bn={}));var ar;(function(M){M.method="textDocument/rangesFormatting",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(ar||(e.DocumentRangesFormattingRequest=ar={}));var bi;(function(M){M.method="textDocument/onTypeFormatting",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(bi||(e.DocumentOnTypeFormattingRequest=bi={}));var ri;(function(M){M.Identifier=1})(ri||(e.PrepareSupportDefaultBehavior=ri={}));var Ln;(function(M){M.method="textDocument/rename",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Ln||(e.RenameRequest=Ln={}));var wi;(function(M){M.method="textDocument/prepareRename",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(wi||(e.PrepareRenameRequest=wi={}));var Fn;(function(M){M.method="workspace/executeCommand",M.messageDirection=n.MessageDirection.clientToServer,M.type=new n.ProtocolRequestType(M.method)})(Fn||(e.ExecuteCommandRequest=Fn={}));var or;(function(M){M.method="workspace/applyEdit",M.messageDirection=n.MessageDirection.serverToClient,M.type=new n.ProtocolRequestType("workspace/applyEdit")})(or||(e.ApplyWorkspaceEditRequest=or={}))})),dg=Ee((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var n=ja();function i(o,s,c,d){return n.ConnectionStrategy.is(d)&&(d={connectionStrategy:d}),(0,n.createMessageConnection)(o,s,c,d)}e.createProtocolConnection=i})),fg=Ee((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,f,p){p===void 0&&(p=f);var y=Object.getOwnPropertyDescriptor(d,f);(!y||("get"in y?!d.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(c,p,y)}):(function(c,d,f,p){p===void 0&&(p=f),c[p]=d[f]})),i=e&&e.__exportStar||function(c,d){for(var f in c)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&n(d,c,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,i(ja(),e),i((Sh(),Eu(kh)),e),i(Vt(),e),i(ug(),e);var o=dg();Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:function(){return o.createProtocolConnection}});var s;(function(c){c.lspReservedErrorRangeStart=-32899,c.RequestFailed=-32803,c.ServerCancelled=-32802,c.ContentModified=-32801,c.RequestCancelled=-32800,c.lspReservedErrorRangeEnd=-32800})(s||(e.LSPErrorCodes=s={}))})),td=Ee((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,f,p){p===void 0&&(p=f);var y=Object.getOwnPropertyDescriptor(d,f);(!y||("get"in y?!d.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(c,p,y)}):(function(c,d,f,p){p===void 0&&(p=f),c[p]=d[f]})),i=e&&e.__exportStar||function(c,d){for(var f in c)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&n(d,c,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var o=Nd();i(Nd(),e),i(fg(),e);function s(c,d,f,p){return(0,o.createMessageConnection)(c,d,f,p)}e.createProtocolConnection=s}));function yn(e,n){if(n.line>=e.lines)return n.character===0?e.length:void 0;let i=e.line(n.line+1).from+n.character;if(!(i>e.length))return i}function Ir(e,n){return yn(e,n)||0}function Xi(e,n){let i=e.lineAt(n);return{character:n-i.from,line:i.number-1}}var Yl=new ww.Renderer,Jx=Yl.code;Yl.code=e=>e.text.trim()?Jx.call(Yl,e):"";function pg(e){return ww(e,{async:!1,gfm:!0,breaks:!0,renderer:Yl})}function Ar(e,n=pg){if(!e)return"";if(ek(e)){let i=e.value;return e.kind==="markdown"&&(i=n(i.trim())),i}return Array.isArray(e)?e.map(i=>Ar(i,n)).filter(Boolean).join(`
47
47
 
48
48
  `):typeof e=="string"?e:""}function Xx(e){if(e.length===0)return"";if(e.length===1)return e[0]||"";e.sort();let n=e[0]||"",i=e[e.length-1]||"",o=0;for(;o<n.length&&n[o]===i[o];)o++;return n.substring(0,o)}function Yx(e){if(e.length===0)return;let n=Xx(e.map(s=>{var c;return((c=s.textEdit)==null?void 0:c.newText)||s.label}));if(n==="")return;let i=[];for(let s=0;s<n.length;s++){let c=n.slice(0,s+1);if(c.length>0){let d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");i.push(d)}}let o=i.join("|");return RegExp(`(${o})$`)}function Zx(e){return(e==null?void 0:e.range)!==void 0}function ek(e){return e.kind!==void 0}function nr(e,n){let i=document.createElement("div");i.className="cm-error-message",i.style.cssText=`
49
49
  position: absolute;
@@ -56,24 +56,24 @@ ${JSON.stringify(j,null,4)}`);let te=j;if(i.string(te.id)||i.number(te.id)){let
56
56
  z-index: 100;
57
57
  max-width: 300px;
58
58
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
59
- `,i.textContent=n;let o=e.coordsAtPos(e.state.selection.main.head);o&&(i.style.left=`${o.left}px`,i.style.top=`${o.bottom+5}px`),document.body.appendChild(i),setTimeout(()=>{i.style.opacity="0",i.style.transition="opacity 0.2s",setTimeout(()=>i.remove(),200)},3e3)}function ec(e){if(e==null)return!0;if(Array.isArray(e))return e.length===0||e.every(ec);if(typeof e=="string")return hg(e);let n=e.value;return typeof n=="string"?hg(n):!1}function hg(e){return e==null?!0:typeof e=="string"?e.trim()===""||/^[\s\n`]*$/.test(e):!1}function tk(e,n){let i=[];return n.iterChanges((o,s,c,d,f)=>{let p=f.toString();if(o===0&&s===e.length){i.push({text:p});return}let y=Xi(e,o),w=Xi(e,s);i.push({range:{start:y,end:w},text:p})}),i.sort((o,s)=>{if(!o.range)return 1;if(!s.range)return-1;let c=o.range.start.line??-1,d=s.range.start.line??-1;if(c!==d)return d-c;let f=o.range.start.character??-1;return(s.range.start.character??-1)-f}),i}var nk=td(),rk=Object.fromEntries(Object.entries(nk.CompletionItemKind).map(([e,n])=>[n,e])),mg;(function(e){e.PlainText=1,e.Snippet=2})(mg||(mg={}));function ik(e){return e.replaceAll(/\\\\/g,"").replaceAll(/(\$(\d+))/g,(n,i,o)=>"${"+o+"}")}function ak(e,n){let{detail:i,labelDetails:o,label:s,kind:c,textEdit:d,insertText:f,documentation:p,additionalTextEdits:y,insertTextFormat:w}=e,_={label:s,detail:(o==null?void 0:o.detail)||i,apply(C,E,T,I){if(d&&Zx(d)?C.dispatch(yw(C.state,d.newText,Ir(C.state.doc,d.range.start),Ir(C.state.doc,d.range.end))):f&&w===mg.Snippet&&n.useSnippetOnCompletion?oD(ik(f))(C,null,T,I):C.dispatch(yw(C.state,f||s,T,I)),!y)return;let $=y.sort(({range:{end:V}},{range:{end:F}})=>Ir(C.state.doc,V)<Ir(C.state.doc,F)?1:Ir(C.state.doc,V)>Ir(C.state.doc,F)?-1:0);for(let V of $)C.dispatch(C.state.update({changes:{from:Ir(C.state.doc,V.range.start),to:yn(C.state.doc,V.range.end),insert:V.newText}}))},type:c&&rk[c].toLowerCase()};return n.hasResolveProvider&&n.resolveItem?_.info=async()=>{var C;try{let E=await((C=n.resolveItem)==null?void 0:C.call(n,e)),T=document.createElement("div");T.classList.add("documentation");let I=(E==null?void 0:E.documentation)||p;return!I||ec(I)?null:(n.allowHTMLContent?T.innerHTML=Ar(I,n.markdownRenderer):T.textContent=Ar(I,n.markdownRenderer),T)}catch(E){if(console.error("Failed to resolve completion item:",E),ec(p))return null;if(p){let T=document.createElement("div");return T.classList.add("documentation"),n.allowHTMLContent?T.innerHTML=Ar(p,n.markdownRenderer):T.textContent=Ar(p,n.markdownRenderer),T}return null}}:p&&(_.info=()=>{let C=document.createElement("div");return C.classList.add("documentation"),n.allowHTMLContent?C.innerHTML=Ar(p,n.markdownRenderer):C.textContent=Ar(p,n.markdownRenderer),C}),_}function ok(e,n,i){let o=[n?sk(n):lk,i==="python"?ck:void 0].filter(Boolean),s=e;if(n){let c=n.toLowerCase();/^\w+$/.test(c)&&(s=s.filter(({label:d,filterText:f})=>(f??d).toLowerCase().startsWith(c)))}for(let c of o)s.sort(c);return s}function sk(e){return(n,i)=>{let o=n.sortText??n.label,s=i.sortText??i.label;switch(!0){case(o.startsWith(e)&&!s.startsWith(e)):return-1;case(!o.startsWith(e)&&s.startsWith(e)):return 1}return o.localeCompare(s)}}function lk(e,n){let i=e.sortText??e.label,o=n.sortText??n.label;return i.localeCompare(o)}function ck(e,n){let i=e.label.endsWith("="),o=n.label.endsWith("=");return i&&!o?-1:!i&&o?1:0}function gg(e){let n=new Proxy({},{get(){throw Error(e)}});return function(i){return i.at(-1)??n}}const yg=Dl.define({combine:gg("No document URI provided. Either pass a one into the extension or use documentUri.of().")}),uk=Dl.define({combine:gg("No language ID provided. Either pass a one into the extension or use languageId.of().")});let Id,vg;Id=ql(),vg=1e4,Il=class{constructor({rootUri:e,workspaceFolders:n,transport:i,initializationOptions:o,capabilities:s,timeout:c=vg,getWorkspaceConfiguration:d}){ke(this,"ready");ke(this,"capabilities");ke(this,"initializePromise");ke(this,"rootUri");ke(this,"workspaceFolders");ke(this,"timeout");ke(this,"transport");ke(this,"requestManager");ke(this,"client");ke(this,"initializationOptions");ke(this,"clientCapabilities");ke(this,"notificationListeners",new Set);this.rootUri=e,this.workspaceFolders=n,this.transport=i,this.initializationOptions=o,this.clientCapabilities=s,this.timeout=c,this.ready=!1,this.capabilities=null,this.requestManager=new Id.RequestManager([this.transport]),this.client=new Id.Client(this.requestManager),this.client.onNotification(p=>{this.processNotification(p)});let f=this.transport;f!=null&&f.connection&&f.connection.addEventListener("message",p=>{let y=JSON.parse(p.data);y.method==="workspace/configuration"&&d?f.connection.send(JSON.stringify({jsonrpc:"2.0",id:y.id,result:d(y.params)})):y.method&&y.id&&f.connection.send(JSON.stringify({jsonrpc:"2.0",id:y.id,result:null}))}),this.initializePromise=this.initialize()}getInitializationOptions(){let e={textDocument:{hover:{dynamicRegistration:!0,contentFormat:["markdown","plaintext"]},moniker:{},synchronization:{dynamicRegistration:!0,willSave:!1,didSave:!1,willSaveWaitUntil:!1},codeAction:{dynamicRegistration:!0,codeActionLiteralSupport:{codeActionKind:{valueSet:["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},resolveSupport:{properties:["edit"]}},completion:{dynamicRegistration:!0,completionItem:{snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:["markdown","plaintext"],deprecatedSupport:!1,preselectSupport:!1},contextSupport:!1},signatureHelp:{dynamicRegistration:!0,signatureInformation:{documentationFormat:["markdown","plaintext"]}},declaration:{dynamicRegistration:!0,linkSupport:!0},definition:{dynamicRegistration:!0,linkSupport:!0},typeDefinition:{dynamicRegistration:!0,linkSupport:!0},implementation:{dynamicRegistration:!0,linkSupport:!0},rename:{dynamicRegistration:!0,prepareSupport:!0}},workspace:{didChangeConfiguration:{dynamicRegistration:!0}}};return{capabilities:this.clientCapabilities?typeof this.clientCapabilities=="function"?this.clientCapabilities(e):this.clientCapabilities:e,initializationOptions:this.initializationOptions,processId:null,rootUri:this.rootUri,workspaceFolders:this.workspaceFolders}}async initialize(){let{capabilities:e}=await this.request("initialize",this.getInitializationOptions(),this.timeout*3);this.capabilities=e,this.notify("initialized",{}),this.ready=!0}close(){this.client.close()}textDocumentDidOpen(e){return this.notify("textDocument/didOpen",e)}textDocumentDidChange(e){return this.notify("textDocument/didChange",e)}async textDocumentHover(e){return await this.request("textDocument/hover",e,this.timeout)}async textDocumentCompletion(e){return await this.request("textDocument/completion",e,this.timeout)}async completionItemResolve(e){return await this.request("completionItem/resolve",e,this.timeout)}async textDocumentDefinition(e){return await this.request("textDocument/definition",e,this.timeout)}async textDocumentCodeAction(e){return await this.request("textDocument/codeAction",e,this.timeout)}async textDocumentRename(e){return await this.request("textDocument/rename",e,this.timeout)}async textDocumentPrepareRename(e){return await this.request("textDocument/prepareRename",e,this.timeout)}async textDocumentSignatureHelp(e){return await this.request("textDocument/signatureHelp",e,this.timeout)}onNotification(e){return this.notificationListeners.add(e),()=>this.notificationListeners.delete(e)}request(e,n,i){return this.client.request({method:e,params:n},i)}notify(e,n){return this.client.notify({method:e,params:n})}processNotification(e){this.notificationListeners.forEach(n=>n(e))}},ql();var Yi=td(),bg=console.log;function dk(){return String(Date.now()+Math.random())}let Ad;jl=Bi.define(),$l=xs.define({create:()=>null,update(e,n){for(let i of n.effects)if(i.is(jl))return i.value;if(e&&n.docChanged){let i=n.changes.mapPos(e.pos),o=e.end==null?void 0:n.changes.mapPos(e.end);return{...e,pos:i,end:o}}return e},provide:e=>k4.from(e)}),Ad=T4.define();var fk=20,pk=class{constructor(e){ke(this,"documentVersion");ke(this,"pluginId");ke(this,"client");ke(this,"documentUri");ke(this,"languageId");ke(this,"view");ke(this,"allowHTMLContent");ke(this,"useSnippetOnCompletion");ke(this,"sendIncrementalChanges");ke(this,"featureOptions");ke(this,"onGoToDefinition");ke(this,"markdownRenderer");ke(this,"disposeListener");ke(this,"lastSeenDiagnosticsVersion",0);let{client:n,documentUri:i,languageId:o,view:s,featureOptions:c,sendIncrementalChanges:d=!0,allowHTMLContent:f=!1,useSnippetOnCompletion:p=!1,onGoToDefinition:y,markdownRenderer:w=pg}=e;this.documentVersion=0,this.pluginId=dk(),this.client=n,this.documentUri=i,this.languageId=o,this.view=s,this.allowHTMLContent=f,this.useSnippetOnCompletion=p,this.sendIncrementalChanges=d,this.featureOptions=c,this.onGoToDefinition=y,this.markdownRenderer=w,this.disposeListener=n.onNotification(this.processNotification.bind(this)),this.initialize({documentText:this.view.state.doc.toString()})}update({state:e,docChanged:n,startState:{doc:i},changes:o}){n&&(this.sendIncrementalChanges?this.sendChanges(tk(i,o)):this.sendChanges([{text:e.doc.toString()}]))}destroy(){var e;(e=this.disposeListener)==null||e.call(this)}async initialize({documentText:e}){this.client.initializePromise&&await this.client.initializePromise,await this.client.textDocumentDidOpen({textDocument:{uri:this.documentUri,languageId:this.languageId,text:e,version:this.documentVersion}})}async sendChanges(e){if(this.client.ready)try{await this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:++this.documentVersion},contentChanges:e})}catch(n){console.error(n)}}requestDiagnostics(e){this.sendChanges([{text:e.state.doc.toString()}])}async requestHoverTooltip(e,{line:n,character:i}){var y;if(!this.featureOptions.hoverEnabled||!(this.client.ready&&((y=this.client.capabilities)!=null&&y.hoverProvider)))return null;let o=await this.client.textDocumentHover({textDocument:{uri:this.documentUri},position:{line:n,character:i}});if(!o)return null;let{contents:s,range:c}=o,d=yn(e.state.doc,{line:n,character:i}),f;if(c&&(d=yn(e.state.doc,c.start),f=yn(e.state.doc,c.end)),d==null||ec(s))return null;let p=document.createElement("div");return p.classList.add("documentation","cm-lsp-hover-tooltip"),this.allowHTMLContent?p.innerHTML=Ar(s,this.markdownRenderer):p.textContent=Ar(s,this.markdownRenderer),{pos:d,end:f,create:w=>({dom:p}),above:!0}}async requestCompletion(e,{line:n,character:i},{triggerKind:o,triggerCharacter:s}){var C;if(!this.featureOptions.completionEnabled||!(this.client.ready&&((C=this.client.capabilities)!=null&&C.completionProvider)))return null;let c=await this.client.textDocumentCompletion({textDocument:{uri:this.documentUri},position:{line:n,character:i},context:{triggerKind:o,triggerCharacter:s}});if(!c)return null;let d="items"in c?c.items:c,f=Yx(d),p=f?e.matchBefore(f):e.matchBefore(/[a-zA-Z0-9]+/),{pos:y}=e,w=ok(d,p==null?void 0:p.text,this.languageId);p&&(y=p.from);let _=w.map(E=>{var T,I;return ak(E,{allowHTMLContent:this.allowHTMLContent,useSnippetOnCompletion:this.useSnippetOnCompletion,hasResolveProvider:((I=(T=this.client.capabilities)==null?void 0:T.completionProvider)==null?void 0:I.resolveProvider)??!1,resolveItem:this.client.completionItemResolve.bind(this.client)})});return{from:y,options:_,filter:!1}}async requestDefinition(e,{line:n,character:i}){var w;if(!this.featureOptions.definitionEnabled||!(this.client.ready&&((w=this.client.capabilities)!=null&&w.definitionProvider)))return;let o=await this.client.textDocumentDefinition({textDocument:{uri:this.documentUri},position:{line:n,character:i}});if(!o)return;let s=Array.isArray(o)?o:[o];if(s.length===0)return;let c=s[0];if(!c)return;let d="uri"in c?c.uri:c.targetUri,f="range"in c?c.range:c.targetRange,p=d!==this.documentUri,y={uri:d,range:f,isExternalDocument:p};return p||e.dispatch(e.state.update({selection:{anchor:Ir(e.state.doc,f.start),head:yn(e.state.doc,f.end)}})),this.onGoToDefinition&&this.onGoToDefinition(y),y}processNotification(e){try{e.method==="textDocument/publishDiagnostics"&&this.processDiagnostics(e.params)}catch(n){bg(n)}}async processDiagnostics(e){if(e.uri!==this.documentUri)return;if(e.version!=null&&e.version>this.lastSeenDiagnosticsVersion&&(this.lastSeenDiagnosticsVersion=e.version,this.clearDiagnostics()),!this.featureOptions.diagnosticsEnabled){this.clearDiagnostics();return}let n={[Yi.DiagnosticSeverity.Error]:"error",[Yi.DiagnosticSeverity.Warning]:"warning",[Yi.DiagnosticSeverity.Information]:"info",[Yi.DiagnosticSeverity.Hint]:"info"},i=e.diagnostics.map(async({range:s,message:c,severity:d,code:f,source:p})=>{var w;let y=(w=await this.requestCodeActions(s,[f]))==null?void 0:w.map(_=>{var C;return{name:"command"in _&&typeof _.command=="object"&&((C=_.command)==null?void 0:C.title)||_.title,apply:async()=>{var E;if("edit"in _&&((E=_.edit)!=null&&E.changes)){let T=_.edit.changes[this.documentUri];if(!T)return;for(let I of T)this.view.dispatch(this.view.state.update({changes:{from:Ir(this.view.state.doc,I.range.start),to:yn(this.view.state.doc,I.range.end),insert:I.newText}}))}"command"in _&&_.command&&bg("Executing command:",_.command)}}});return{from:Ir(this.view.state.doc,s.start),to:Ir(this.view.state.doc,s.end),severity:n[d??Yi.DiagnosticSeverity.Error],message:c,renderMessage:()=>{let _=document.createElement("div");return _.innerHTML=this.markdownRenderer(c),_},source:p||this.languageId,markClass:this.pluginId,actions:y}}),o=await Promise.all(i);this.addDiagnostics(o)}addDiagnostics(e){if(e.length===0)return;let n=this.view.state,i=[];J4(n,c=>(i.push(c),!0));let o=new Set(e.map(c=>c.source).filter(Boolean)),s=e.filter(c=>!o.has(c.source));this.view.dispatch(hw(n,[...s,...e]))}clearDiagnostics(){this.view.dispatch(hw(this.view.state,[]))}async requestCodeActions(e,n){var i;return!this.featureOptions.codeActionsEnabled||!(this.client.ready&&((i=this.client.capabilities)!=null&&i.codeActionProvider))?null:await this.client.textDocumentCodeAction({textDocument:{uri:this.documentUri},range:e,context:{diagnostics:[{range:e,code:n[0],source:this.languageId,message:""}]}})}async requestRename(e,{line:n,character:i}){var o;if(this.featureOptions.renameEnabled){if(!this.client.ready){nr(e,"Language server not ready");return}if(!((o=this.client.capabilities)!=null&&o.renameProvider)){nr(e,"Rename not supported by language server");return}try{let s=await this.client.textDocumentPrepareRename({textDocument:{uri:this.documentUri},position:{line:n,character:i}}).catch(()=>this.prepareRenameFallback(e,{line:n,character:i}));if(!s||"defaultBehavior"in s){nr(e,"Cannot rename this symbol");return}let c=document.createElement("div");c.className="cm-rename-popup",c.style.cssText="position: absolute; padding: 4px; background: white; border: 1px solid #ddd; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 99;";let d=document.createElement("input");d.type="text",d.style.cssText="width: 200px; padding: 4px; border: 1px solid #ddd;";let f="range"in s?s.range:s,p=yn(e.state.doc,f.start);if(p==null)return;let y=yn(e.state.doc,f.end);d.value=e.state.doc.sliceString(p,y),c.appendChild(d);let w=e.coordsAtPos(p);if(!w)return;c.style.left=`${w.left}px`,c.style.top=`${w.bottom+5}px`;let _=async()=>{let E=d.value.trim();if(!E){nr(e,"New name cannot be empty"),c.remove();return}if(E===d.defaultValue){c.remove();return}try{let T=await this.client.textDocumentRename({textDocument:{uri:this.documentUri},position:{line:n,character:i},newName:E});await this.applyRenameEdit(e,T)}catch(T){nr(e,`Rename failed: ${T instanceof Error?T.message:"Unknown error"}`)}finally{c.remove()}};d.addEventListener("keydown",E=>{E.key==="Enter"?_():E.key==="Escape"&&c.remove(),E.stopPropagation()});let C=E=>{c.contains(E.target)||(c.remove(),document.removeEventListener("mousedown",C))};document.addEventListener("mousedown",C),document.body.appendChild(c),d.focus(),d.select()}catch(s){nr(e,`Rename failed: ${s instanceof Error?s.message:"Unknown error"}`)}}}async requestSignatureHelp(e,{line:n,character:i},o=void 0){var s,c,d;if(!(this.featureOptions.signatureHelpEnabled&&this.client.ready&&((s=this.client.capabilities)!=null&&s.signatureHelpProvider)))return null;try{let f=await this.client.textDocumentSignatureHelp({textDocument:{uri:this.documentUri},position:{line:n,character:i},context:{isRetrigger:!1,triggerKind:1,triggerCharacter:o}});if(!(f!=null&&f.signatures)||f.signatures.length===0)return null;let p=this.createTooltipContainer(),y=f.activeSignature??0,w=f.signatures[y]||f.signatures[0];if(!w)return null;let _=f.activeParameter??w.activeParameter??0,C=this.createSignatureElement(w,_);p.appendChild(C),w.documentation&&p.appendChild(this.createDocumentationElement(w.documentation));let E=(c=w.parameters)==null?void 0:c[_];E!=null&&E.documentation&&p.appendChild(this.createParameterDocElement(E.documentation));let T=yn(e.state.doc,{line:n,character:i});return T==null?null:{pos:T,end:T,create:I=>({dom:p}),above:((d=this.featureOptions.signatureHelpOptions)==null?void 0:d.position)==="above"}}catch(f){return console.error("Signature help error:",f),null}}async showSignatureHelpTooltip(e,n,i){let o=await this.requestSignatureHelp(e,Xi(e.state.doc,n),i);e.dispatch({effects:jl.of(o)})}createTooltipContainer(){let e=document.createElement("div");return e.classList.add("cm-signature-help"),e.style.cssText="padding: 6px; max-width: 400px;",e}createSignatureElement(e,n){let i=document.createElement("div");if(i.classList.add("cm-signature"),i.style.cssText="font-family: monospace; margin-bottom: 4px;",!e.label||typeof e.label!="string")return i.textContent="Signature information unavailable",i;let o=e.label,s=e.parameters||[];if(s.length===0||!s[n])return i.textContent=o,i;let c=s[n].label;return typeof c=="string"?this.allowHTMLContent?i.innerHTML=o.replace(c,`<strong class="cm-signature-active-param">${c}</strong>`):i.textContent=o.replace(c,`\xAB${c}\xBB`):Array.isArray(c)&&c.length===2?this.applyRangeHighlighting(i,o,c[0],c[1]):i.textContent=o,i}applyRangeHighlighting(e,n,i,o){e.textContent="";let s=n.substring(0,i),c=n.substring(i,o),d=n.substring(o);e.appendChild(document.createTextNode(s));let f=document.createElement("span");f.classList.add("cm-signature-active-param"),f.style.cssText="font-weight: bold; text-decoration: underline;",f.textContent=c,e.appendChild(f),e.appendChild(document.createTextNode(d))}createDocumentationElement(e){let n=document.createElement("div");n.classList.add("cm-signature-docs"),n.style.cssText="margin-top: 4px; color: #666;";let i=Ar(e,this.markdownRenderer);return this.allowHTMLContent?n.innerHTML=i:n.textContent=i,n}createParameterDocElement(e){let n=document.createElement("div");n.classList.add("cm-parameter-docs"),n.style.cssText="margin-top: 4px; font-style: italic; border-top: 1px solid #eee; padding-top: 4px;";let i=Ar(e,this.markdownRenderer);return this.allowHTMLContent?n.innerHTML=i:n.textContent=i,n}prepareRenameFallback(e,{line:n,character:i}){let o=e.state.doc.line(n+1).text,s=/\w+/g,c,d=i,f=i;for(;(c=s.exec(o))!==null;){let p=c.index,y=c.index+c[0].length;if(i>=p&&i<=y){d=p,f=y;break}}return d===i&&f===i?null:{range:{start:{line:n,character:d},end:{line:n,character:f}},placeholder:o.slice(d,f)}}async applyRenameEdit(e,n){if(!n)return nr(e,"No edit returned from language server"),!1;let i=n.changes??{},o=n.documentChanges??[];if(Object.keys(i).length===0&&o.length===0)return nr(e,"No changes to apply"),!1;if(o.length>0)for(let s of o){if("textDocument"in s){if(s.textDocument.uri!==this.documentUri){nr(e,"Multi-file rename not supported yet");continue}let c=s.edits.sort((d,f)=>{let p=yn(e.state.doc,d.range.start);return(yn(e.state.doc,f.range.start)??0)-(p??0)}).map(d=>({from:yn(e.state.doc,d.range.start)??0,to:yn(e.state.doc,d.range.end)??0,insert:d.newText}));return e.dispatch(e.state.update({changes:c})),!0}return nr(e,"File creation, deletion, or renaming operations not supported yet"),!1}else if(Object.keys(i).length>0)for(let[s,c]of Object.entries(i)){if(s!==this.documentUri){nr(e,"Multi-file rename not supported yet");continue}let d=c.sort((f,p)=>{let y=yn(e.state.doc,f.range.start);return(yn(e.state.doc,p.range.start)??0)-(y??0)}).map(f=>({from:yn(e.state.doc,f.range.start)??0,to:yn(e.state.doc,f.range.end)??0,insert:f.newText}));e.dispatch(e.state.update({changes:d}))}return!1}};Lh=function(e){var d;let n=null,i={rename:"F2",goToDefinition:"F12",signatureHelp:"Mod-Shift-Space",...e.keyboardShortcuts},o=e.client,s={diagnosticsEnabled:!0,hoverEnabled:!0,completionEnabled:!0,definitionEnabled:!0,renameEnabled:!0,codeActionsEnabled:!0,signatureHelpEnabled:!0,signatureActivateOnTyping:!1,signatureHelpOptions:{position:"below"},...e},c=[Ol.define(f=>(n=new pk({client:o,documentUri:e.documentUri??f.state.facet(yg),languageId:e.languageId??f.state.facet(uk),view:f,featureOptions:s,sendIncrementalChanges:e.sendIncrementalChanges,allowHTMLContent:e.allowHTMLContent,useSnippetOnCompletion:e.useSnippetOnCompletion,onGoToDefinition:e.onGoToDefinition,markdownRenderer:e.markdownRenderer}),n))];if(c.push(Ra.of([{key:i.signatureHelp,run:f=>{if(!(n&&s.signatureHelpEnabled))return!1;let p=f.state.selection.main.head;return n.showSignatureHelpTooltip(f,p),!0}},{key:i.rename,run:f=>{if(!(n&&s.renameEnabled))return!1;let p=f.state.selection.main.head;return n.requestRename(f,Xi(f.state.doc,p)),!0}},{key:i.goToDefinition,run:f=>{if(!(n&&s.definitionEnabled))return!1;let p=f.state.selection.main.head;return n.requestDefinition(f,Xi(f.state.doc,p)).catch(y=>nr(f,`Go to definition failed: ${y instanceof Error?y.message:"Unknown error"}`)),!0}}])),s.hoverEnabled&&c.push(wh((f,p)=>n==null?null:n.requestHoverTooltip(f,Xi(f.state.doc,p)),e.hoverConfig)),s.signatureHelpEnabled){c.push($l);let f=p=>p.state.field($l)?(p.dispatch({effects:jl.of(null)}),!0):!1;c.push(Kt.domEventHandlers({mousedown:(p,y)=>(f(y),!1)})),c.push(Ra.of([{key:")",run:p=>(f(p),!1)},{key:"Escape",run:p=>f(p)}])),c.push(Kt.updateListener.of(p=>{if(!(n&&s.signatureActivateOnTyping)||!p.state.field($l)||!(p.selectionSet||p.docChanged))return;let y=p.state.selection.main.head;yk(p.state.doc,y)||f(p.view)})),c.push(Kt.updateListener.of(async p=>{var E;if(!(n&&p.docChanged)||p.transactions.some(T=>T.annotation(Ad))||!((E=n.client.capabilities)!=null&&E.signatureHelpProvider)||!s.signatureActivateOnTyping)return;let y=n.client.capabilities.signatureHelpProvider.triggerCharacters||["(",","],w=p.changes,_=-1,C;w.iterChanges((T,I,$,V,F)=>{if(_>=0)return;let N=mk(F.toString(),$,y);N&&(_=N.triggerPos,C=N.triggerCharacter)}),_>=0&&n.showSignatureHelpTooltip(p.view,_,C)}))}return s.completionEnabled&&c.push(Lu({...e.completionConfig,override:[async f=>{var _,C;if(n==null)return null;let{state:p,pos:y}=f,w=hk(f,((C=(_=n.client.capabilities)==null?void 0:_.completionProvider)==null?void 0:C.triggerCharacters)??[],e.completionMatchBefore);return w==null?null:await n.requestCompletion(f,Xi(p.doc,y),w)},...((d=e.completionConfig)==null?void 0:d.override)||[]]})),c.push(Kt.domEventHandlers({click:(f,p)=>{if(s.definitionEnabled&&i.goToDefinition==="ctrlcmd"&&(f.ctrlKey||f.metaKey)){let y=p.posAtCoords({x:f.clientX,y:f.clientY});y&&n&&(n.requestDefinition(p,Xi(p.state.doc,y)).catch(w=>nr(p,`Go to definition failed: ${w instanceof Error?w.message:"Unknown error"}`)),f.preventDefault())}}})),c};function hk(e,n,i){let{state:o,pos:s,explicit:c}=e,d=o.doc.lineAt(s),f=Yi.CompletionTriggerKind.Invoked,p,y=d.text[s-d.from-1]||"",w=n==null?void 0:n.includes(y);return!c&&w&&(f=Yi.CompletionTriggerKind.TriggerCharacter,p=y),f===Yi.CompletionTriggerKind.Invoked&&!e.matchBefore(i||/(\w+|\w+\.|\/|,)$/)?null:{triggerKind:f,triggerCharacter:p}}function mk(e,n,i){if(!e)return null;for(let o of i){let s=e.indexOf(o);if(s!==-1)return{triggerPos:n+s+1,triggerCharacter:o}}return null}function gk(e){let n=0;for(let i of e)i==="("?n++:i===")"&&n--;return n}function yk(e,n,i=fk){let o=e.lineAt(n),s=Math.max(1,o.number-i),c=e.line(s).from;return gk(e.sliceString(c,n))>0}ju=function(e,n,i={}){let{preserveCursor:o=!0,effects:s,userEvent:c}=i,d=e.state.doc;if(d.toString()!==n)if(o&&e.hasFocus){let f=e.state.selection.main.head,p=d.lineAt(f),y=p.number,w=f-p.from,_=e.state.update({changes:{from:0,to:d.length,insert:n}}).state.doc,C;if(y<=_.lines){let E=_.line(y),T=E.length;C=E.from+Math.min(w,T)}else C=_.line(_.lines).to;e.dispatch({changes:{from:0,to:d.length,insert:n},annotations:Ad.of(!0),selection:{anchor:C},effects:s,userEvent:c})}else e.dispatch({changes:{from:0,to:d.length,insert:n},effects:s,userEvent:c})},wo=function(){return Dl.define({combine:e=>e.find(n=>n!==void 0)})};const wg=wo(),_g=wo(),qd=wo(),tc=wo(),xg=wo();ox=function({cellId:e,completionConfig:n,hotkeys:i,placeholderType:o,lspConfig:s,diagnosticsConfig:c}){return[tc.of(e),wg.of(n),_g.of(i),qd.of(o),xg.of({...s,diagnostics:c})]},qu=new Pu;function vk(e){return Object.values(e.cellRuntime).some(n=>n.status==="running")}function bk(e){return Object.values(e.cellRuntime).filter(n=>n.status==="running"||n.status==="queued").length}function wk(e){return tm(e).length>0}lx=function(e){return e.cellIds.inOrderIds.map(n=>e.cellData[n])};function _k({cellHandles:e}){let n={};for(let[i,o]of ui.entries(e))o.current&&(n[i]=o.current.editorView);return n}pm=function(e){let{cellIds:n,cellData:i}=e,o=[];for(let s of n.inOrderIds)i[s].config.disabled&&o.push(s);return o},Mm=function(e){let{cellIds:n,cellData:i}=e,o=[];for(let s of n.inOrderIds)i[s].config.disabled||o.push(s);return o};function xk(e){return e.history.length>0}ux=function(e,n){let i=e.cellIds.findWithId(n).getDescendants(n);return{stale:i.some(o=>{var s,c;return((s=e.cellRuntime[o])==null?void 0:s.staleInputs)||((c=e.cellData[o])==null?void 0:c.edited)}),errored:i.some(o=>{var s;return(s=e.cellRuntime[o])==null?void 0:s.errored}),runningOrQueued:i.some(o=>{var s,c;return((s=e.cellRuntime[o])==null?void 0:s.status)==="running"||((c=e.cellRuntime[o])==null?void 0:c.status)==="queued"})}},tm=function(e){let{cellIds:n,cellData:i,cellRuntime:o}=e;return n.inOrderIds.filter(s=>hm({executionTime:o[s].runElapsedTimeMs??i[s].lastExecutionTime,status:o[s].status,errored:o[s].errored,interrupted:o[s].interrupted,stopped:o[s].stopped})||i[s].edited||o[s].interrupted||o[s].staleInputs&&!(o[s].status==="disabled-transitively"||i[s].config.disabled))},hm=function({executionTime:e,status:n,errored:i,interrupted:o,stopped:s}){return e===null&&n!=="queued"&&n!=="running"&&!(i||o||s)},Pt=Dl.define({combine:e=>e[0]}),Wi=Dl.define({combine:e=>e[0]});var kk={...Ch,caseInsensitiveIdentifiers:!0,identifierQuotes:"`"};const kg=Eh.define(kk),Sg=Eh.define({charSetCasts:!0,doubleQuotedStrings:!1,unquotedBitLiterals:!0,hashComments:!1,spaceAfterDashes:!1,specialVar:"@?",identifierQuotes:'"',caseInsensitiveIdentifiers:!0,keywords:"percentile_cont row_number rank dense_rank rank_dense percent_rank cume_dist ntile lag lead first_value last_value nth_value !__postfix !~~ !~~* % & && * ** + - ->> / // <-> << <=> <@ >> @ @> Calendar JSON TimeZone ^ ^@ abort abs absolute access access_mode acos acosh action add add_parquet_key admin after age aggregate alias all all_profiling_output allow_community_extensions allow_extensions_metadata_mismatch allow_persistent_secrets allow_unredacted_secrets allow_unsigned_extensions allowed_directories allowed_paths also alter always analyse analyze and anti any any_value apply approx_count_distinct approx_quantile approx_top_k arbitrary arg_max arg_max_null arg_min arg_min_null argmax argmin array array_agg array_aggr array_aggregate array_append array_apply array_cat array_concat array_contains array_cosine_distance array_cosine_similarity array_cross_product array_distance array_distinct array_dot_product array_extract array_filter array_grade_up array_has array_has_all array_has_any array_indexof array_inner_product array_intersect array_length array_negative_dot_product array_negative_inner_product array_pop_back array_pop_front array_position array_prepend array_push_back array_push_front array_reduce array_resize array_reverse array_reverse_sort array_select array_slice array_sort array_to_json array_to_string array_to_string_comma_default array_transform array_unique array_value array_where array_zip arrow_large_buffer_size arrow_lossless_conversion arrow_output_list_view arrow_output_version arrow_scan arrow_scan_dumb as asc ascii asin asinh asof asof_loop_join_threshold assertion assignment asymmetric at atan atan2 atanh attach attribute authorization autoinstall_extension_repository autoinstall_known_extensions autoload_known_extensions avg backward bar base64 before begin between bigint bin binary binary_as_string bit bit_and bit_count bit_length bit_or bit_position bit_xor bitstring bitstring_agg blob bool bool_and bool_or boolean both bpchar by bytea cache call called can_cast_implicitly cardinality cascade cascaded case cast cast_to_type catalog catalog_error_max_schemas cbrt ceil ceiling centuries century chain char char_length character character_length characteristics check checkpoint checkpoint_threshold chr class close cluster coalesce col_description collate collation collations column columns combine comment comments commit committed compression concat concat_ws concurrently configuration conflict connection constant_or_null constraint constraints contains content continue conversion copy copy_database corr cos cosh cost cot count count_if count_star countif covar_pop covar_samp create create_sort_key cross csv cube current current_catalog current_connection_id current_database current_date current_localtime current_localtimestamp current_query current_query_id current_role current_schema current_schemas current_setting current_transaction_id current_user currval cursor custom_extension_repository custom_profiling_settings custom_user_agent cycle damerau_levenshtein data database database_list database_size date date_add date_diff date_part date_sub date_trunc datediff datepart datesub datetime datetrunc day dayname dayofmonth dayofweek dayofyear days deallocate debug_asof_iejoin debug_checkpoint_abort debug_force_external debug_force_no_cross_product debug_skip_checkpoint_on_commit debug_verify_vector debug_window_mode dec decade decades decimal declare decode default default_block_size default_collation default_null_order default_order default_secret_storage defaults deferrable deferred definer degrees delete delimiter delimiters depends desc describe detach dictionary disable disable_checkpoint_on_shutdown disable_logging disable_object_cache disable_optimizer disable_parquet_prefetching disable_print_progress_bar disable_profile disable_profiling disable_progress_bar disable_timestamptz_casts disable_verification disable_verify_external disable_verify_fetch_row disable_verify_parallelism disable_verify_serializer disabled_compression_methods disabled_filesystems disabled_log_types disabled_optimizers discard distinct divide do document domain double drop duckdb_api duckdb_columns duckdb_constraints duckdb_databases duckdb_dependencies duckdb_extensions duckdb_external_file_cache duckdb_functions duckdb_indexes duckdb_keywords duckdb_log_contexts duckdb_logs duckdb_logs_parsed duckdb_memory duckdb_optimizers duckdb_prepared_statements duckdb_schemas duckdb_secret_types duckdb_secrets duckdb_sequences duckdb_settings duckdb_table_sample duckdb_tables duckdb_temporary_files duckdb_types duckdb_variables duckdb_views dynamic_or_filter_threshold each editdist3 element_at else enable enable_checkpoint_on_shutdown enable_external_access enable_external_file_cache enable_fsst_vectors enable_geoparquet_conversion enable_http_logging enable_http_metadata_cache enable_logging enable_macro_dependencies enable_object_cache enable_optimizer enable_print_progress_bar enable_profile enable_profiling enable_progress_bar enable_progress_bar_print enable_verification enable_view_dependencies enabled_log_types encode encoding encrypted end ends_with entropy enum enum_code enum_first enum_last enum_range enum_range_boundary epoch epoch_ms epoch_ns epoch_us equi_width_bins era error errors_as_json escape even event except exclude excluding exclusive execute exists exp explain explain_output export export_state extension extension_directory extension_versions extensions external external_threads extract factorial false family favg fdiv fetch file_search_path filter finalize first flatten float float4 float8 floor fmod following for force force_bitpacking_mode force_checkpoint force_compression foreign format formatReadableDecimalSize formatReadableSize format_bytes format_pg_type format_type forward freeze from from_base64 from_binary from_hex from_json from_json_strict fsum full function functions gamma gcd gen_random_uuid generate_series generate_subscripts generated geomean geometric_mean get_bit get_block_size get_current_time get_current_timestamp getvariable glob global grade_up grant granted greatest greatest_common_divisor group group_concat grouping grouping_id groups guid hamming handler having header hex histogram histogram_exact histogram_values hold home_directory hour hours http_logging_output http_proxy http_proxy_password http_proxy_username hugeint identity ieee_floating_point_ops if ignore ilike ilike_escape immediate immediate_transaction_mode immutable implicit import import_database in in_search_path include including increment index index_scan_max_count index_scan_percentage indexes inet_client_addr inet_client_port inet_server_addr inet_server_port inherit inherits initially inline inner inout input insensitive insert install instead instr int int1 int128 int16 int2 int32 int4 int64 int8 integer integer_division integral intersect interval into invoker is is_histogram_other_bin isfinite isinf isnan isnull isodow isolation isoyear jaccard jaro_similarity jaro_winkler_similarity join json json_array json_array_length json_contains json_deserialize_sql json_each json_execute_serialized_sql json_exists json_extract json_extract_path json_extract_path_text json_extract_string json_group_array json_group_object json_group_structure json_keys json_merge_patch json_object json_pretty json_quote json_serialize_plan json_serialize_sql json_structure json_transform json_transform_strict json_tree json_type json_valid json_value julian kahan_sum key kurtosis kurtosis_pop label lambda lambda_syntax language large last last_day late_materialization_max_rows lateral lcase lcm leading leakproof least least_common_multiple left left_grapheme len length length_grapheme level levenshtein lgamma like like_escape limit list list_aggr list_aggregate list_any_value list_append list_apply list_approx_count_distinct list_avg list_bit_and list_bit_or list_bit_xor list_bool_and list_bool_or list_cat list_concat list_contains list_cosine_distance list_cosine_similarity list_count list_distance list_distinct list_dot_product list_element list_entropy list_extract list_filter list_first list_grade_up list_has list_has_all list_has_any list_histogram list_indexof list_inner_product list_intersect list_kurtosis list_kurtosis_pop list_last list_mad list_max list_median list_min list_mode list_negative_dot_product list_negative_inner_product list_pack list_position list_prepend list_product list_reduce list_resize list_reverse list_reverse_sort list_select list_sem list_skewness list_slice list_sort list_stddev_pop list_stddev_samp list_string_agg list_sum list_transform list_unique list_value list_var_pop list_var_samp list_where list_zip listagg listen ln load local location lock lock_configuration locked log log10 log2 log_query_path logged logging_level logging_mode logging_storage logical long lower lpad ltrim macro mad make_date make_time make_timestamp make_timestamp_ns make_timestamptz map map_concat map_contains map_contains_entry map_contains_value map_entries map_extract map_extract_value map_from_entries map_keys map_to_pg_oid map_values mapping match materialized max max_by max_expression_depth max_memory max_temp_directory_size max_vacuum_tasks maxvalue md5 md5_number md5_number_lower md5_number_upper mean median memory_limit merge_join_threshold metadata_info method microsecond microseconds millennia millennium millisecond milliseconds min min_by minute minutes minvalue mismatches mod mode month monthname months move multiply name names nanosecond national natural nchar nested_loop_join_threshold new next nextafter nextval nfc_normalize no none normalized_interval not not_ilike_escape not_like_escape nothing notify notnull now nowait null null_order nullif nulls numeric nvarchar obj_description object octet_length of off offset oid oids old old_implicit_casting on only operator option options or ord order order_by_non_integer_literal ordered_aggregate_threshold ordinality others out outer over overlaps overlay overriding owned owner pandas_analyze_sample pandas_scan parallel parquet_bloom_probe parquet_file_metadata parquet_kv_metadata parquet_metadata parquet_metadata_cache parquet_scan parquet_schema parse_dirname parse_dirpath parse_duckdb_log_message parse_filename parse_path parser partial partition partitioned partitioned_write_flush_threshold partitioned_write_max_open_files passing password percent perfect_ht_threshold persistent pi pivot pivot_filter_threshold pivot_limit pivot_longer pivot_wider placing plans platform policy position positional pow power pragma pragma_collations pragma_database_size pragma_metadata_info pragma_platform pragma_show pragma_storage_info pragma_table_info pragma_user_agent pragma_version preceding precision prefer_range_joins prefetch_all_parquet_files prefix prepare prepared preserve preserve_identifier_case preserve_insertion_order primary printf prior privileges procedural procedure produce_arrow_string_view product profile_output profiling_mode profiling_output program progress_bar_time publication python_enable_replacements python_map_function python_scan_all_frames qualify quantile quantile_cont quantile_disc quarter quarters query query_table quote radians random range read read_blob read_csv read_csv_auto read_json read_json_auto read_json_objects read_json_objects_auto read_ndjson read_ndjson_auto read_ndjson_objects read_parquet read_text real reassign recheck recursive reduce ref references referencing refresh regexp_escape regexp_extract regexp_extract_all regexp_full_match regexp_matches regexp_replace regexp_split_to_array regexp_split_to_table regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release remap_struct rename repeat repeat_row repeatable replace replica reservoir_quantile reset respect restart restrict returning returns reverse revoke right right_grapheme role rollback rollup round round_even roundbankers row row_to_json rows rpad rtrim rule sample savepoint scalar_subquery_error_on_multiple_rows scheduler_process_partial schema schemas scope scroll search search_path second seconds secret secret_directory security select sem semi seq_scan sequence sequences serializable server session session_user set set_bit setof sets setseed sha1 sha256 share shobj_description short show show_databases show_tables show_tables_expanded sign signbit signed similar simple sin sinh skewness skip smallint snapshot sniff_csv some sorted split split_part sql sqrt stable standalone start starts_with statement statistics stats stddev stddev_pop stddev_samp stdin stdout storage storage_compatibility_version storage_info stored str_split str_split_regex streaming_buffer_size strftime strict string string_agg string_split string_split_regex string_to_array strip strip_accents strlen strpos strptime struct struct_concat struct_extract struct_extract_at struct_insert struct_pack subscription substr substring substring_grapheme subtract suffix sum sum_no_overflow sumkahan summarize summary symmetric sysid system table table_info tables tablesample tablespace tan tanh temp temp_directory template temporary test_all_types test_vector_types text then threads ties time time_bucket timestamp timestamp_ms timestamp_ns timestamp_s timestamp_us timestamptz timetz timetz_byte_comparable timezone timezone_hour timezone_minute tinyint to to_base to_base64 to_binary to_centuries to_days to_decades to_hex to_hours to_json to_microseconds to_millennia to_milliseconds to_minutes to_months to_quarters to_seconds to_timestamp to_weeks to_years today trailing transaction transaction_timestamp transform translate treat trigger trim true trunc truncate truncate_duckdb_logs trusted try_cast try_strptime txid_current type typeof types ubigint ucase uhugeint uint128 uint16 uint32 uint64 uint8 uinteger unbin unbounded uncommitted unencrypted unhex unicode union union_extract union_tag union_value unique unknown unlisten unlogged unnest unpack unpivot unpivot_list until update upper url_decode url_encode use user user_agent username using usmallint utinyint uuid uuid_extract_timestamp uuid_extract_version uuidv4 uuidv7 vacuum valid validate validator value values var_pop var_samp varbinary varchar variable variadic variance varint varying vector_type verbose verify_external verify_fetch_row verify_parallelism verify_serializer version view views virtual volatile wal_autocheckpoint wavg week weekday weekofyear weeks weighted_avg when where which_secret whitespace window with within without work worker_threads wrapper write write_log xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlnamespaces xmlparse xmlpi xmlroot xmlserialize xmltable xor year years yearweek yes zone zstd_min_string_length | || ~ ~~ ~~* ~~~",types:"JSON bigint binary bit bitstring blob bool boolean bpchar bytea char date datetime dec decimal double enum float float4 float8 guid hugeint int int1 int128 int16 int2 int32 int4 int64 int8 integer integral interval list logical long map null numeric nvarchar oid real row short signed smallint string struct text time timestamp timestamp_ms timestamp_ns timestamp_s timestamp_us timestamptz timetz tinyint ubigint uhugeint uint128 uint16 uint32 uint64 uint8 uinteger union usmallint utinyint uuid varbinary varchar varint"});var Sk=new Set("postgresql.postgres.couchbase.db2.db2i.tidb.mysql.sqlite.mssql.sqlserver.duckdb.mariadb.cassandra.noql.spark.awsathena.athena.bigquery.hive.redshift.snowflake.flink.mongodb.trino.oracle.oracledb.singlestoredb.timescaledb.databricks.datafusion.microsoft sql server".split("."));function nc(e){return Sk.has(e)}function Cg(e){let n=e.dialect;if(!nc(n))return Se.debug("Unknown dialect",{dialect:n}),Ds;switch(n){case"postgresql":case"postgres":return Ch;case"mysql":return dD;case"sqlite":return cD;case"mssql":case"sqlserver":case"microsoft sql server":return pD;case"duckdb":return Sg;case"mariadb":return hD;case"cassandra":return mD;case"oracledb":case"oracle":return lD;case"bigquery":return kg;case"timescaledb":return Ch;case"awsathena":case"athena":case"db2i":case"db2":case"hive":case"redshift":case"snowflake":case"flink":case"mongodb":case"noql":case"couchbase":case"trino":case"tidb":case"singlestoredb":case"spark":case"databricks":case"datafusion":return Se.debug("Unsupported dialect",{dialect:n}),Ds;default:return _s(n),Ds}}var Ck={...fD,caseInsensitiveIdentifiers:!0,identifierQuotes:"'"};let Ds;Ds=Eh.define(Ck),Ui="__marimo_duckdb",xo=new Set([Ui]),S_="memory",Kl=function(e){return e===""};var Os={formatTableName:e=>e,formatSelectClause:(e,n)=>`SELECT ${e} FROM ${n} LIMIT 100`};function Ek(e){if(e=e.toLowerCase(),!nc(e))return Os;switch(e){case"bigquery":{let n=kg.spec.identifierQuotes;return{formatTableName:i=>`${n}${i}${n}`,formatSelectClause:Os.formatSelectClause}}case"mssql":case"sqlserver":case"microsoft sql server":return{formatTableName:Os.formatTableName,formatSelectClause:(n,i)=>`SELECT TOP 100 ${n} FROM ${i}`};case"timescaledb":case"postgres":case"postgresql":case"duckdb":return{formatTableName:n=>n.split(".").map(i=>`"${i}"`).join("."),formatSelectClause:(n,i)=>`SELECT ${n==="*"?"*":`"${n}"`} FROM ${i} LIMIT 100`};case"db2":case"db2i":case"mysql":case"sqlite":case"mariadb":case"cassandra":case"noql":case"awsathena":case"athena":case"hive":case"redshift":case"snowflake":case"flink":case"mongodb":case"oracle":case"oracledb":case"couchbase":case"tidb":case"spark":case"trino":case"singlestoredb":case"databricks":case"datafusion":return Os;default:return _s(e),Os}}__=function({table:e,columnName:n,sqlTableContext:i}){if(i){let{engine:o,schema:s,defaultSchema:c,defaultDatabase:d,database:f,dialect:p}=i,y=e.name;Kl(s)?y=f===d?y:`${f}.${y}`:(s!==c&&(y=`${s}.${y}`),f!==d&&(y=`${f}.${y}`));let w=Ek(p),_=w.formatTableName(y),C=w.formatSelectClause(n,_);return o==="__marimo_duckdb"?`_df = mo.sql(f"""
59
+ `,i.textContent=n;let o=e.coordsAtPos(e.state.selection.main.head);o&&(i.style.left=`${o.left}px`,i.style.top=`${o.bottom+5}px`),document.body.appendChild(i),setTimeout(()=>{i.style.opacity="0",i.style.transition="opacity 0.2s",setTimeout(()=>i.remove(),200)},3e3)}function Zl(e){if(e==null)return!0;if(Array.isArray(e))return e.length===0||e.every(Zl);if(typeof e=="string")return hg(e);let n=e.value;return typeof n=="string"?hg(n):!1}function hg(e){return e==null?!0:typeof e=="string"?e.trim()===""||/^[\s\n`]*$/.test(e):!1}function tk(e,n){let i=[];return n.iterChanges((o,s,c,d,f)=>{let p=f.toString();if(o===0&&s===e.length){i.push({text:p});return}let y=Xi(e,o),w=Xi(e,s);i.push({range:{start:y,end:w},text:p})}),i.sort((o,s)=>{if(!o.range)return 1;if(!s.range)return-1;let c=o.range.start.line??-1,d=s.range.start.line??-1;if(c!==d)return d-c;let f=o.range.start.character??-1;return(s.range.start.character??-1)-f}),i}var nk=td(),rk=Object.fromEntries(Object.entries(nk.CompletionItemKind).map(([e,n])=>[n,e])),mg;(function(e){e.PlainText=1,e.Snippet=2})(mg||(mg={}));function ik(e){return e.replaceAll(/\\\\/g,"").replaceAll(/(\$(\d+))/g,(n,i,o)=>"${"+o+"}")}function ak(e,n){let{detail:i,labelDetails:o,label:s,kind:c,textEdit:d,insertText:f,documentation:p,additionalTextEdits:y,insertTextFormat:w}=e,_={label:s,detail:(o==null?void 0:o.detail)||i,apply(C,E,T,I){if(d&&Zx(d)?C.dispatch(yw(C.state,d.newText,Ir(C.state.doc,d.range.start),Ir(C.state.doc,d.range.end))):f&&w===mg.Snippet&&n.useSnippetOnCompletion?oD(ik(f))(C,null,T,I):C.dispatch(yw(C.state,f||s,T,I)),!y)return;let $=y.sort(({range:{end:V}},{range:{end:F}})=>Ir(C.state.doc,V)<Ir(C.state.doc,F)?1:Ir(C.state.doc,V)>Ir(C.state.doc,F)?-1:0);for(let V of $)C.dispatch(C.state.update({changes:{from:Ir(C.state.doc,V.range.start),to:yn(C.state.doc,V.range.end),insert:V.newText}}))},type:c&&rk[c].toLowerCase()};return n.hasResolveProvider&&n.resolveItem?_.info=async()=>{var C;try{let E=await((C=n.resolveItem)==null?void 0:C.call(n,e)),T=document.createElement("div");T.classList.add("documentation");let I=(E==null?void 0:E.documentation)||p;return!I||Zl(I)?null:(n.allowHTMLContent?T.innerHTML=Ar(I,n.markdownRenderer):T.textContent=Ar(I,n.markdownRenderer),T)}catch(E){if(console.error("Failed to resolve completion item:",E),Zl(p))return null;if(p){let T=document.createElement("div");return T.classList.add("documentation"),n.allowHTMLContent?T.innerHTML=Ar(p,n.markdownRenderer):T.textContent=Ar(p,n.markdownRenderer),T}return null}}:p&&(_.info=()=>{let C=document.createElement("div");return C.classList.add("documentation"),n.allowHTMLContent?C.innerHTML=Ar(p,n.markdownRenderer):C.textContent=Ar(p,n.markdownRenderer),C}),_}function ok(e,n,i){let o=[n?sk(n):lk,i==="python"?ck:void 0].filter(Boolean),s=e;if(n){let c=n.toLowerCase();/^\w+$/.test(c)&&(s=s.filter(({label:d,filterText:f})=>(f??d).toLowerCase().startsWith(c)))}for(let c of o)s.sort(c);return s}function sk(e){return(n,i)=>{let o=n.sortText??n.label,s=i.sortText??i.label;switch(!0){case(o.startsWith(e)&&!s.startsWith(e)):return-1;case(!o.startsWith(e)&&s.startsWith(e)):return 1}return o.localeCompare(s)}}function lk(e,n){let i=e.sortText??e.label,o=n.sortText??n.label;return i.localeCompare(o)}function ck(e,n){let i=e.label.endsWith("="),o=n.label.endsWith("=");return i&&!o?-1:!i&&o?1:0}function gg(e){let n=new Proxy({},{get(){throw Error(e)}});return function(i){return i.at(-1)??n}}const yg=Dl.define({combine:gg("No document URI provided. Either pass a one into the extension or use documentUri.of().")}),uk=Dl.define({combine:gg("No language ID provided. Either pass a one into the extension or use languageId.of().")});let Id,vg;Id=Al(),vg=1e4,Il=class{constructor({rootUri:e,workspaceFolders:n,transport:i,initializationOptions:o,capabilities:s,timeout:c=vg,getWorkspaceConfiguration:d}){ke(this,"ready");ke(this,"capabilities");ke(this,"initializePromise");ke(this,"rootUri");ke(this,"workspaceFolders");ke(this,"timeout");ke(this,"transport");ke(this,"requestManager");ke(this,"client");ke(this,"initializationOptions");ke(this,"clientCapabilities");ke(this,"notificationListeners",new Set);this.rootUri=e,this.workspaceFolders=n,this.transport=i,this.initializationOptions=o,this.clientCapabilities=s,this.timeout=c,this.ready=!1,this.capabilities=null,this.requestManager=new Id.RequestManager([this.transport]),this.client=new Id.Client(this.requestManager),this.client.onNotification(p=>{this.processNotification(p)});let f=this.transport;f!=null&&f.connection&&f.connection.addEventListener("message",p=>{let y=JSON.parse(p.data);y.method==="workspace/configuration"&&d?f.connection.send(JSON.stringify({jsonrpc:"2.0",id:y.id,result:d(y.params)})):y.method&&y.id&&f.connection.send(JSON.stringify({jsonrpc:"2.0",id:y.id,result:null}))}),this.initializePromise=this.initialize()}getInitializationOptions(){let e={textDocument:{hover:{dynamicRegistration:!0,contentFormat:["markdown","plaintext"]},moniker:{},synchronization:{dynamicRegistration:!0,willSave:!1,didSave:!1,willSaveWaitUntil:!1},codeAction:{dynamicRegistration:!0,codeActionLiteralSupport:{codeActionKind:{valueSet:["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},resolveSupport:{properties:["edit"]}},completion:{dynamicRegistration:!0,completionItem:{snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:["markdown","plaintext"],deprecatedSupport:!1,preselectSupport:!1},contextSupport:!1},signatureHelp:{dynamicRegistration:!0,signatureInformation:{documentationFormat:["markdown","plaintext"]}},declaration:{dynamicRegistration:!0,linkSupport:!0},definition:{dynamicRegistration:!0,linkSupport:!0},typeDefinition:{dynamicRegistration:!0,linkSupport:!0},implementation:{dynamicRegistration:!0,linkSupport:!0},rename:{dynamicRegistration:!0,prepareSupport:!0}},workspace:{didChangeConfiguration:{dynamicRegistration:!0}}};return{capabilities:this.clientCapabilities?typeof this.clientCapabilities=="function"?this.clientCapabilities(e):this.clientCapabilities:e,initializationOptions:this.initializationOptions,processId:null,rootUri:this.rootUri,workspaceFolders:this.workspaceFolders}}async initialize(){let{capabilities:e}=await this.request("initialize",this.getInitializationOptions(),this.timeout*3);this.capabilities=e,this.notify("initialized",{}),this.ready=!0}close(){this.client.close()}textDocumentDidOpen(e){return this.notify("textDocument/didOpen",e)}textDocumentDidChange(e){return this.notify("textDocument/didChange",e)}async textDocumentHover(e){return await this.request("textDocument/hover",e,this.timeout)}async textDocumentCompletion(e){return await this.request("textDocument/completion",e,this.timeout)}async completionItemResolve(e){return await this.request("completionItem/resolve",e,this.timeout)}async textDocumentDefinition(e){return await this.request("textDocument/definition",e,this.timeout)}async textDocumentCodeAction(e){return await this.request("textDocument/codeAction",e,this.timeout)}async textDocumentRename(e){return await this.request("textDocument/rename",e,this.timeout)}async textDocumentPrepareRename(e){return await this.request("textDocument/prepareRename",e,this.timeout)}async textDocumentSignatureHelp(e){return await this.request("textDocument/signatureHelp",e,this.timeout)}onNotification(e){return this.notificationListeners.add(e),()=>this.notificationListeners.delete(e)}request(e,n,i){return this.client.request({method:e,params:n},i)}notify(e,n){return this.client.notify({method:e,params:n})}processNotification(e){this.notificationListeners.forEach(n=>n(e))}},Al();var Yi=td(),bg=console.log;function dk(){return String(Date.now()+Math.random())}let Ad;ql=Bi.define(),Vl=xs.define({create:()=>null,update(e,n){for(let i of n.effects)if(i.is(ql))return i.value;if(e&&n.docChanged){let i=n.changes.mapPos(e.pos),o=e.end==null?void 0:n.changes.mapPos(e.end);return{...e,pos:i,end:o}}return e},provide:e=>k4.from(e)}),Ad=T4.define();var fk=20,pk=class{constructor(e){ke(this,"documentVersion");ke(this,"pluginId");ke(this,"client");ke(this,"documentUri");ke(this,"languageId");ke(this,"view");ke(this,"allowHTMLContent");ke(this,"useSnippetOnCompletion");ke(this,"sendIncrementalChanges");ke(this,"featureOptions");ke(this,"onGoToDefinition");ke(this,"markdownRenderer");ke(this,"disposeListener");ke(this,"lastSeenDiagnosticsVersion",0);let{client:n,documentUri:i,languageId:o,view:s,featureOptions:c,sendIncrementalChanges:d=!0,allowHTMLContent:f=!1,useSnippetOnCompletion:p=!1,onGoToDefinition:y,markdownRenderer:w=pg}=e;this.documentVersion=0,this.pluginId=dk(),this.client=n,this.documentUri=i,this.languageId=o,this.view=s,this.allowHTMLContent=f,this.useSnippetOnCompletion=p,this.sendIncrementalChanges=d,this.featureOptions=c,this.onGoToDefinition=y,this.markdownRenderer=w,this.disposeListener=n.onNotification(this.processNotification.bind(this)),this.initialize({documentText:this.view.state.doc.toString()})}update({state:e,docChanged:n,startState:{doc:i},changes:o}){n&&(this.sendIncrementalChanges?this.sendChanges(tk(i,o)):this.sendChanges([{text:e.doc.toString()}]))}destroy(){var e;(e=this.disposeListener)==null||e.call(this)}async initialize({documentText:e}){this.client.initializePromise&&await this.client.initializePromise,await this.client.textDocumentDidOpen({textDocument:{uri:this.documentUri,languageId:this.languageId,text:e,version:this.documentVersion}})}async sendChanges(e){if(this.client.ready)try{await this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:++this.documentVersion},contentChanges:e})}catch(n){console.error(n)}}requestDiagnostics(e){this.sendChanges([{text:e.state.doc.toString()}])}async requestHoverTooltip(e,{line:n,character:i}){var y;if(!this.featureOptions.hoverEnabled||!(this.client.ready&&((y=this.client.capabilities)!=null&&y.hoverProvider)))return null;let o=await this.client.textDocumentHover({textDocument:{uri:this.documentUri},position:{line:n,character:i}});if(!o)return null;let{contents:s,range:c}=o,d=yn(e.state.doc,{line:n,character:i}),f;if(c&&(d=yn(e.state.doc,c.start),f=yn(e.state.doc,c.end)),d==null||Zl(s))return null;let p=document.createElement("div");return p.classList.add("documentation","cm-lsp-hover-tooltip"),this.allowHTMLContent?p.innerHTML=Ar(s,this.markdownRenderer):p.textContent=Ar(s,this.markdownRenderer),{pos:d,end:f,create:w=>({dom:p}),above:!0}}async requestCompletion(e,{line:n,character:i},{triggerKind:o,triggerCharacter:s}){var C;if(!this.featureOptions.completionEnabled||!(this.client.ready&&((C=this.client.capabilities)!=null&&C.completionProvider)))return null;let c=await this.client.textDocumentCompletion({textDocument:{uri:this.documentUri},position:{line:n,character:i},context:{triggerKind:o,triggerCharacter:s}});if(!c)return null;let d="items"in c?c.items:c,f=Yx(d),p=f?e.matchBefore(f):e.matchBefore(/[a-zA-Z0-9]+/),{pos:y}=e,w=ok(d,p==null?void 0:p.text,this.languageId);p&&(y=p.from);let _=w.map(E=>{var T,I;return ak(E,{allowHTMLContent:this.allowHTMLContent,useSnippetOnCompletion:this.useSnippetOnCompletion,hasResolveProvider:((I=(T=this.client.capabilities)==null?void 0:T.completionProvider)==null?void 0:I.resolveProvider)??!1,resolveItem:this.client.completionItemResolve.bind(this.client)})});return{from:y,options:_,filter:!1}}async requestDefinition(e,{line:n,character:i}){var w;if(!this.featureOptions.definitionEnabled||!(this.client.ready&&((w=this.client.capabilities)!=null&&w.definitionProvider)))return;let o=await this.client.textDocumentDefinition({textDocument:{uri:this.documentUri},position:{line:n,character:i}});if(!o)return;let s=Array.isArray(o)?o:[o];if(s.length===0)return;let c=s[0];if(!c)return;let d="uri"in c?c.uri:c.targetUri,f="range"in c?c.range:c.targetRange,p=d!==this.documentUri,y={uri:d,range:f,isExternalDocument:p};return p||e.dispatch(e.state.update({selection:{anchor:Ir(e.state.doc,f.start),head:yn(e.state.doc,f.end)}})),this.onGoToDefinition&&this.onGoToDefinition(y),y}processNotification(e){try{e.method==="textDocument/publishDiagnostics"&&this.processDiagnostics(e.params)}catch(n){bg(n)}}async processDiagnostics(e){if(e.uri!==this.documentUri)return;if(e.version!=null&&e.version>this.lastSeenDiagnosticsVersion&&(this.lastSeenDiagnosticsVersion=e.version,this.clearDiagnostics()),!this.featureOptions.diagnosticsEnabled){this.clearDiagnostics();return}let n={[Yi.DiagnosticSeverity.Error]:"error",[Yi.DiagnosticSeverity.Warning]:"warning",[Yi.DiagnosticSeverity.Information]:"info",[Yi.DiagnosticSeverity.Hint]:"info"},i=e.diagnostics.map(async({range:s,message:c,severity:d,code:f,source:p})=>{var w;let y=(w=await this.requestCodeActions(s,[f]))==null?void 0:w.map(_=>{var C;return{name:"command"in _&&typeof _.command=="object"&&((C=_.command)==null?void 0:C.title)||_.title,apply:async()=>{var E;if("edit"in _&&((E=_.edit)!=null&&E.changes)){let T=_.edit.changes[this.documentUri];if(!T)return;for(let I of T)this.view.dispatch(this.view.state.update({changes:{from:Ir(this.view.state.doc,I.range.start),to:yn(this.view.state.doc,I.range.end),insert:I.newText}}))}"command"in _&&_.command&&bg("Executing command:",_.command)}}});return{from:Ir(this.view.state.doc,s.start),to:Ir(this.view.state.doc,s.end),severity:n[d??Yi.DiagnosticSeverity.Error],message:c,renderMessage:()=>{let _=document.createElement("div");return _.innerHTML=this.markdownRenderer(c),_},source:p||this.languageId,markClass:this.pluginId,actions:y}}),o=await Promise.all(i);this.addDiagnostics(o)}addDiagnostics(e){if(e.length===0)return;let n=this.view.state,i=[];J4(n,c=>(i.push(c),!0));let o=new Set(e.map(c=>c.source).filter(Boolean)),s=e.filter(c=>!o.has(c.source));this.view.dispatch(hw(n,[...s,...e]))}clearDiagnostics(){this.view.dispatch(hw(this.view.state,[]))}async requestCodeActions(e,n){var i;return!this.featureOptions.codeActionsEnabled||!(this.client.ready&&((i=this.client.capabilities)!=null&&i.codeActionProvider))?null:await this.client.textDocumentCodeAction({textDocument:{uri:this.documentUri},range:e,context:{diagnostics:[{range:e,code:n[0],source:this.languageId,message:""}]}})}async requestRename(e,{line:n,character:i}){var o;if(this.featureOptions.renameEnabled){if(!this.client.ready){nr(e,"Language server not ready");return}if(!((o=this.client.capabilities)!=null&&o.renameProvider)){nr(e,"Rename not supported by language server");return}try{let s=await this.client.textDocumentPrepareRename({textDocument:{uri:this.documentUri},position:{line:n,character:i}}).catch(()=>this.prepareRenameFallback(e,{line:n,character:i}));if(!s||"defaultBehavior"in s){nr(e,"Cannot rename this symbol");return}let c=document.createElement("div");c.className="cm-rename-popup",c.style.cssText="position: absolute; padding: 4px; background: white; border: 1px solid #ddd; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 99;";let d=document.createElement("input");d.type="text",d.style.cssText="width: 200px; padding: 4px; border: 1px solid #ddd;";let f="range"in s?s.range:s,p=yn(e.state.doc,f.start);if(p==null)return;let y=yn(e.state.doc,f.end);d.value=e.state.doc.sliceString(p,y),c.appendChild(d);let w=e.coordsAtPos(p);if(!w)return;c.style.left=`${w.left}px`,c.style.top=`${w.bottom+5}px`;let _=async()=>{let E=d.value.trim();if(!E){nr(e,"New name cannot be empty"),c.remove();return}if(E===d.defaultValue){c.remove();return}try{let T=await this.client.textDocumentRename({textDocument:{uri:this.documentUri},position:{line:n,character:i},newName:E});await this.applyRenameEdit(e,T)}catch(T){nr(e,`Rename failed: ${T instanceof Error?T.message:"Unknown error"}`)}finally{c.remove()}};d.addEventListener("keydown",E=>{E.key==="Enter"?_():E.key==="Escape"&&c.remove(),E.stopPropagation()});let C=E=>{c.contains(E.target)||(c.remove(),document.removeEventListener("mousedown",C))};document.addEventListener("mousedown",C),document.body.appendChild(c),d.focus(),d.select()}catch(s){nr(e,`Rename failed: ${s instanceof Error?s.message:"Unknown error"}`)}}}async requestSignatureHelp(e,{line:n,character:i},o=void 0){var s,c,d;if(!(this.featureOptions.signatureHelpEnabled&&this.client.ready&&((s=this.client.capabilities)!=null&&s.signatureHelpProvider)))return null;try{let f=await this.client.textDocumentSignatureHelp({textDocument:{uri:this.documentUri},position:{line:n,character:i},context:{isRetrigger:!1,triggerKind:1,triggerCharacter:o}});if(!(f!=null&&f.signatures)||f.signatures.length===0)return null;let p=this.createTooltipContainer(),y=f.activeSignature??0,w=f.signatures[y]||f.signatures[0];if(!w)return null;let _=f.activeParameter??w.activeParameter??0,C=this.createSignatureElement(w,_);p.appendChild(C),w.documentation&&p.appendChild(this.createDocumentationElement(w.documentation));let E=(c=w.parameters)==null?void 0:c[_];E!=null&&E.documentation&&p.appendChild(this.createParameterDocElement(E.documentation));let T=yn(e.state.doc,{line:n,character:i});return T==null?null:{pos:T,end:T,create:I=>({dom:p}),above:((d=this.featureOptions.signatureHelpOptions)==null?void 0:d.position)==="above"}}catch(f){return console.error("Signature help error:",f),null}}async showSignatureHelpTooltip(e,n,i){let o=await this.requestSignatureHelp(e,Xi(e.state.doc,n),i);e.dispatch({effects:ql.of(o)})}createTooltipContainer(){let e=document.createElement("div");return e.classList.add("cm-signature-help"),e.style.cssText="padding: 6px; max-width: 400px;",e}createSignatureElement(e,n){let i=document.createElement("div");if(i.classList.add("cm-signature"),i.style.cssText="font-family: monospace; margin-bottom: 4px;",!e.label||typeof e.label!="string")return i.textContent="Signature information unavailable",i;let o=e.label,s=e.parameters||[];if(s.length===0||!s[n])return i.textContent=o,i;let c=s[n].label;return typeof c=="string"?this.allowHTMLContent?i.innerHTML=o.replace(c,`<strong class="cm-signature-active-param">${c}</strong>`):i.textContent=o.replace(c,`\xAB${c}\xBB`):Array.isArray(c)&&c.length===2?this.applyRangeHighlighting(i,o,c[0],c[1]):i.textContent=o,i}applyRangeHighlighting(e,n,i,o){e.textContent="";let s=n.substring(0,i),c=n.substring(i,o),d=n.substring(o);e.appendChild(document.createTextNode(s));let f=document.createElement("span");f.classList.add("cm-signature-active-param"),f.style.cssText="font-weight: bold; text-decoration: underline;",f.textContent=c,e.appendChild(f),e.appendChild(document.createTextNode(d))}createDocumentationElement(e){let n=document.createElement("div");n.classList.add("cm-signature-docs"),n.style.cssText="margin-top: 4px; color: #666;";let i=Ar(e,this.markdownRenderer);return this.allowHTMLContent?n.innerHTML=i:n.textContent=i,n}createParameterDocElement(e){let n=document.createElement("div");n.classList.add("cm-parameter-docs"),n.style.cssText="margin-top: 4px; font-style: italic; border-top: 1px solid #eee; padding-top: 4px;";let i=Ar(e,this.markdownRenderer);return this.allowHTMLContent?n.innerHTML=i:n.textContent=i,n}prepareRenameFallback(e,{line:n,character:i}){let o=e.state.doc.line(n+1).text,s=/\w+/g,c,d=i,f=i;for(;(c=s.exec(o))!==null;){let p=c.index,y=c.index+c[0].length;if(i>=p&&i<=y){d=p,f=y;break}}return d===i&&f===i?null:{range:{start:{line:n,character:d},end:{line:n,character:f}},placeholder:o.slice(d,f)}}async applyRenameEdit(e,n){if(!n)return nr(e,"No edit returned from language server"),!1;let i=n.changes??{},o=n.documentChanges??[];if(Object.keys(i).length===0&&o.length===0)return nr(e,"No changes to apply"),!1;if(o.length>0)for(let s of o){if("textDocument"in s){if(s.textDocument.uri!==this.documentUri){nr(e,"Multi-file rename not supported yet");continue}let c=s.edits.sort((d,f)=>{let p=yn(e.state.doc,d.range.start);return(yn(e.state.doc,f.range.start)??0)-(p??0)}).map(d=>({from:yn(e.state.doc,d.range.start)??0,to:yn(e.state.doc,d.range.end)??0,insert:d.newText}));return e.dispatch(e.state.update({changes:c})),!0}return nr(e,"File creation, deletion, or renaming operations not supported yet"),!1}else if(Object.keys(i).length>0)for(let[s,c]of Object.entries(i)){if(s!==this.documentUri){nr(e,"Multi-file rename not supported yet");continue}let d=c.sort((f,p)=>{let y=yn(e.state.doc,f.range.start);return(yn(e.state.doc,p.range.start)??0)-(y??0)}).map(f=>({from:yn(e.state.doc,f.range.start)??0,to:yn(e.state.doc,f.range.end)??0,insert:f.newText}));e.dispatch(e.state.update({changes:d}))}return!1}};Lh=function(e){var d;let n=null,i={rename:"F2",goToDefinition:"F12",signatureHelp:"Mod-Shift-Space",...e.keyboardShortcuts},o=e.client,s={diagnosticsEnabled:!0,hoverEnabled:!0,completionEnabled:!0,definitionEnabled:!0,renameEnabled:!0,codeActionsEnabled:!0,signatureHelpEnabled:!0,signatureActivateOnTyping:!1,signatureHelpOptions:{position:"below"},...e},c=[Ol.define(f=>(n=new pk({client:o,documentUri:e.documentUri??f.state.facet(yg),languageId:e.languageId??f.state.facet(uk),view:f,featureOptions:s,sendIncrementalChanges:e.sendIncrementalChanges,allowHTMLContent:e.allowHTMLContent,useSnippetOnCompletion:e.useSnippetOnCompletion,onGoToDefinition:e.onGoToDefinition,markdownRenderer:e.markdownRenderer}),n))];if(c.push(Ra.of([{key:i.signatureHelp,run:f=>{if(!(n&&s.signatureHelpEnabled))return!1;let p=f.state.selection.main.head;return n.showSignatureHelpTooltip(f,p),!0}},{key:i.rename,run:f=>{if(!(n&&s.renameEnabled))return!1;let p=f.state.selection.main.head;return n.requestRename(f,Xi(f.state.doc,p)),!0}},{key:i.goToDefinition,run:f=>{if(!(n&&s.definitionEnabled))return!1;let p=f.state.selection.main.head;return n.requestDefinition(f,Xi(f.state.doc,p)).catch(y=>nr(f,`Go to definition failed: ${y instanceof Error?y.message:"Unknown error"}`)),!0}}])),s.hoverEnabled&&c.push(wh((f,p)=>n==null?null:n.requestHoverTooltip(f,Xi(f.state.doc,p)),e.hoverConfig)),s.signatureHelpEnabled){c.push(Vl);let f=p=>p.state.field(Vl)?(p.dispatch({effects:ql.of(null)}),!0):!1;c.push(Kt.domEventHandlers({mousedown:(p,y)=>(f(y),!1)})),c.push(Ra.of([{key:")",run:p=>(f(p),!1)},{key:"Escape",run:p=>f(p)}])),c.push(Kt.updateListener.of(p=>{if(!(n&&s.signatureActivateOnTyping)||!p.state.field(Vl)||!(p.selectionSet||p.docChanged))return;let y=p.state.selection.main.head;yk(p.state.doc,y)||f(p.view)})),c.push(Kt.updateListener.of(async p=>{var E;if(!(n&&p.docChanged)||p.transactions.some(T=>T.annotation(Ad))||!((E=n.client.capabilities)!=null&&E.signatureHelpProvider)||!s.signatureActivateOnTyping)return;let y=n.client.capabilities.signatureHelpProvider.triggerCharacters||["(",","],w=p.changes,_=-1,C;w.iterChanges((T,I,$,V,F)=>{if(_>=0)return;let N=mk(F.toString(),$,y);N&&(_=N.triggerPos,C=N.triggerCharacter)}),_>=0&&n.showSignatureHelpTooltip(p.view,_,C)}))}return s.completionEnabled&&c.push(Mu({...e.completionConfig,override:[async f=>{var _,C;if(n==null)return null;let{state:p,pos:y}=f,w=hk(f,((C=(_=n.client.capabilities)==null?void 0:_.completionProvider)==null?void 0:C.triggerCharacters)??[],e.completionMatchBefore);return w==null?null:await n.requestCompletion(f,Xi(p.doc,y),w)},...((d=e.completionConfig)==null?void 0:d.override)||[]]})),c.push(Kt.domEventHandlers({click:(f,p)=>{if(s.definitionEnabled&&i.goToDefinition==="ctrlcmd"&&(f.ctrlKey||f.metaKey)){let y=p.posAtCoords({x:f.clientX,y:f.clientY});y&&n&&(n.requestDefinition(p,Xi(p.state.doc,y)).catch(w=>nr(p,`Go to definition failed: ${w instanceof Error?w.message:"Unknown error"}`)),f.preventDefault())}}})),c};function hk(e,n,i){let{state:o,pos:s,explicit:c}=e,d=o.doc.lineAt(s),f=Yi.CompletionTriggerKind.Invoked,p,y=d.text[s-d.from-1]||"",w=n==null?void 0:n.includes(y);return!c&&w&&(f=Yi.CompletionTriggerKind.TriggerCharacter,p=y),f===Yi.CompletionTriggerKind.Invoked&&!e.matchBefore(i||/(\w+|\w+\.|\/|,)$/)?null:{triggerKind:f,triggerCharacter:p}}function mk(e,n,i){if(!e)return null;for(let o of i){let s=e.indexOf(o);if(s!==-1)return{triggerPos:n+s+1,triggerCharacter:o}}return null}function gk(e){let n=0;for(let i of e)i==="("?n++:i===")"&&n--;return n}function yk(e,n,i=fk){let o=e.lineAt(n),s=Math.max(1,o.number-i),c=e.line(s).from;return gk(e.sliceString(c,n))>0}Au=function(e,n,i={}){let{preserveCursor:o=!0,effects:s,userEvent:c}=i,d=e.state.doc;if(d.toString()!==n)if(o&&e.hasFocus){let f=e.state.selection.main.head,p=d.lineAt(f),y=p.number,w=f-p.from,_=e.state.update({changes:{from:0,to:d.length,insert:n}}).state.doc,C;if(y<=_.lines){let E=_.line(y),T=E.length;C=E.from+Math.min(w,T)}else C=_.line(_.lines).to;e.dispatch({changes:{from:0,to:d.length,insert:n},annotations:Ad.of(!0),selection:{anchor:C},effects:s,userEvent:c})}else e.dispatch({changes:{from:0,to:d.length,insert:n},effects:s,userEvent:c})},wo=function(){return Dl.define({combine:e=>e.find(n=>n!==void 0)})};const wg=wo(),_g=wo(),qd=wo(),ec=wo(),xg=wo();ax=function({cellId:e,completionConfig:n,hotkeys:i,placeholderType:o,lspConfig:s,diagnosticsConfig:c}){return[ec.of(e),wg.of(n),_g.of(i),qd.of(o),xg.of({...s,diagnostics:c})]},Iu=new Ou;function vk(e){return Object.values(e.cellRuntime).some(n=>n.status==="running")}function bk(e){return Object.values(e.cellRuntime).filter(n=>n.status==="running"||n.status==="queued").length}function wk(e){return tm(e).length>0}sx=function(e){return e.cellIds.inOrderIds.map(n=>e.cellData[n])};function _k({cellHandles:e}){let n={};for(let[i,o]of ui.entries(e))o.current&&(n[i]=o.current.editorView);return n}hm=function(e){let{cellIds:n,cellData:i}=e,o=[];for(let s of n.inOrderIds)i[s].config.disabled&&o.push(s);return o},Lm=function(e){let{cellIds:n,cellData:i}=e,o=[];for(let s of n.inOrderIds)i[s].config.disabled||o.push(s);return o};function xk(e){return e.history.length>0}cx=function(e,n){let i=e.cellIds.findWithId(n).getDescendants(n);return{stale:i.some(o=>{var s,c;return((s=e.cellRuntime[o])==null?void 0:s.staleInputs)||((c=e.cellData[o])==null?void 0:c.edited)}),errored:i.some(o=>{var s;return(s=e.cellRuntime[o])==null?void 0:s.errored}),runningOrQueued:i.some(o=>{var s,c;return((s=e.cellRuntime[o])==null?void 0:s.status)==="running"||((c=e.cellRuntime[o])==null?void 0:c.status)==="queued"})}},tm=function(e){let{cellIds:n,cellData:i,cellRuntime:o}=e;return n.inOrderIds.filter(s=>gm({executionTime:o[s].runElapsedTimeMs??i[s].lastExecutionTime,status:o[s].status,errored:o[s].errored,interrupted:o[s].interrupted,stopped:o[s].stopped})||i[s].edited||o[s].interrupted||o[s].staleInputs&&!(o[s].status==="disabled-transitively"||i[s].config.disabled))},gm=function({executionTime:e,status:n,errored:i,interrupted:o,stopped:s}){return e===null&&n!=="queued"&&n!=="running"&&!(i||o||s)},Pt=Dl.define({combine:e=>e[0]}),Wi=Dl.define({combine:e=>e[0]});var kk={...Ch,caseInsensitiveIdentifiers:!0,identifierQuotes:"`"};const kg=Eh.define(kk),Sg=Eh.define({charSetCasts:!0,doubleQuotedStrings:!1,unquotedBitLiterals:!0,hashComments:!1,spaceAfterDashes:!1,specialVar:"@?",identifierQuotes:'"',caseInsensitiveIdentifiers:!0,keywords:"percentile_cont row_number rank dense_rank rank_dense percent_rank cume_dist ntile lag lead first_value last_value nth_value !__postfix !~~ !~~* % & && * ** + - ->> / // <-> << <=> <@ >> @ @> Calendar JSON TimeZone ^ ^@ abort abs absolute access access_mode acos acosh action add add_parquet_key admin after age aggregate alias all all_profiling_output allow_community_extensions allow_extensions_metadata_mismatch allow_persistent_secrets allow_unredacted_secrets allow_unsigned_extensions allowed_directories allowed_paths also alter always analyse analyze and anti any any_value apply approx_count_distinct approx_quantile approx_top_k arbitrary arg_max arg_max_null arg_min arg_min_null argmax argmin array array_agg array_aggr array_aggregate array_append array_apply array_cat array_concat array_contains array_cosine_distance array_cosine_similarity array_cross_product array_distance array_distinct array_dot_product array_extract array_filter array_grade_up array_has array_has_all array_has_any array_indexof array_inner_product array_intersect array_length array_negative_dot_product array_negative_inner_product array_pop_back array_pop_front array_position array_prepend array_push_back array_push_front array_reduce array_resize array_reverse array_reverse_sort array_select array_slice array_sort array_to_json array_to_string array_to_string_comma_default array_transform array_unique array_value array_where array_zip arrow_large_buffer_size arrow_lossless_conversion arrow_output_list_view arrow_output_version arrow_scan arrow_scan_dumb as asc ascii asin asinh asof asof_loop_join_threshold assertion assignment asymmetric at atan atan2 atanh attach attribute authorization autoinstall_extension_repository autoinstall_known_extensions autoload_known_extensions avg backward bar base64 before begin between bigint bin binary binary_as_string bit bit_and bit_count bit_length bit_or bit_position bit_xor bitstring bitstring_agg blob bool bool_and bool_or boolean both bpchar by bytea cache call called can_cast_implicitly cardinality cascade cascaded case cast cast_to_type catalog catalog_error_max_schemas cbrt ceil ceiling centuries century chain char char_length character character_length characteristics check checkpoint checkpoint_threshold chr class close cluster coalesce col_description collate collation collations column columns combine comment comments commit committed compression concat concat_ws concurrently configuration conflict connection constant_or_null constraint constraints contains content continue conversion copy copy_database corr cos cosh cost cot count count_if count_star countif covar_pop covar_samp create create_sort_key cross csv cube current current_catalog current_connection_id current_database current_date current_localtime current_localtimestamp current_query current_query_id current_role current_schema current_schemas current_setting current_transaction_id current_user currval cursor custom_extension_repository custom_profiling_settings custom_user_agent cycle damerau_levenshtein data database database_list database_size date date_add date_diff date_part date_sub date_trunc datediff datepart datesub datetime datetrunc day dayname dayofmonth dayofweek dayofyear days deallocate debug_asof_iejoin debug_checkpoint_abort debug_force_external debug_force_no_cross_product debug_skip_checkpoint_on_commit debug_verify_vector debug_window_mode dec decade decades decimal declare decode default default_block_size default_collation default_null_order default_order default_secret_storage defaults deferrable deferred definer degrees delete delimiter delimiters depends desc describe detach dictionary disable disable_checkpoint_on_shutdown disable_logging disable_object_cache disable_optimizer disable_parquet_prefetching disable_print_progress_bar disable_profile disable_profiling disable_progress_bar disable_timestamptz_casts disable_verification disable_verify_external disable_verify_fetch_row disable_verify_parallelism disable_verify_serializer disabled_compression_methods disabled_filesystems disabled_log_types disabled_optimizers discard distinct divide do document domain double drop duckdb_api duckdb_columns duckdb_constraints duckdb_databases duckdb_dependencies duckdb_extensions duckdb_external_file_cache duckdb_functions duckdb_indexes duckdb_keywords duckdb_log_contexts duckdb_logs duckdb_logs_parsed duckdb_memory duckdb_optimizers duckdb_prepared_statements duckdb_schemas duckdb_secret_types duckdb_secrets duckdb_sequences duckdb_settings duckdb_table_sample duckdb_tables duckdb_temporary_files duckdb_types duckdb_variables duckdb_views dynamic_or_filter_threshold each editdist3 element_at else enable enable_checkpoint_on_shutdown enable_external_access enable_external_file_cache enable_fsst_vectors enable_geoparquet_conversion enable_http_logging enable_http_metadata_cache enable_logging enable_macro_dependencies enable_object_cache enable_optimizer enable_print_progress_bar enable_profile enable_profiling enable_progress_bar enable_progress_bar_print enable_verification enable_view_dependencies enabled_log_types encode encoding encrypted end ends_with entropy enum enum_code enum_first enum_last enum_range enum_range_boundary epoch epoch_ms epoch_ns epoch_us equi_width_bins era error errors_as_json escape even event except exclude excluding exclusive execute exists exp explain explain_output export export_state extension extension_directory extension_versions extensions external external_threads extract factorial false family favg fdiv fetch file_search_path filter finalize first flatten float float4 float8 floor fmod following for force force_bitpacking_mode force_checkpoint force_compression foreign format formatReadableDecimalSize formatReadableSize format_bytes format_pg_type format_type forward freeze from from_base64 from_binary from_hex from_json from_json_strict fsum full function functions gamma gcd gen_random_uuid generate_series generate_subscripts generated geomean geometric_mean get_bit get_block_size get_current_time get_current_timestamp getvariable glob global grade_up grant granted greatest greatest_common_divisor group group_concat grouping grouping_id groups guid hamming handler having header hex histogram histogram_exact histogram_values hold home_directory hour hours http_logging_output http_proxy http_proxy_password http_proxy_username hugeint identity ieee_floating_point_ops if ignore ilike ilike_escape immediate immediate_transaction_mode immutable implicit import import_database in in_search_path include including increment index index_scan_max_count index_scan_percentage indexes inet_client_addr inet_client_port inet_server_addr inet_server_port inherit inherits initially inline inner inout input insensitive insert install instead instr int int1 int128 int16 int2 int32 int4 int64 int8 integer integer_division integral intersect interval into invoker is is_histogram_other_bin isfinite isinf isnan isnull isodow isolation isoyear jaccard jaro_similarity jaro_winkler_similarity join json json_array json_array_length json_contains json_deserialize_sql json_each json_execute_serialized_sql json_exists json_extract json_extract_path json_extract_path_text json_extract_string json_group_array json_group_object json_group_structure json_keys json_merge_patch json_object json_pretty json_quote json_serialize_plan json_serialize_sql json_structure json_transform json_transform_strict json_tree json_type json_valid json_value julian kahan_sum key kurtosis kurtosis_pop label lambda lambda_syntax language large last last_day late_materialization_max_rows lateral lcase lcm leading leakproof least least_common_multiple left left_grapheme len length length_grapheme level levenshtein lgamma like like_escape limit list list_aggr list_aggregate list_any_value list_append list_apply list_approx_count_distinct list_avg list_bit_and list_bit_or list_bit_xor list_bool_and list_bool_or list_cat list_concat list_contains list_cosine_distance list_cosine_similarity list_count list_distance list_distinct list_dot_product list_element list_entropy list_extract list_filter list_first list_grade_up list_has list_has_all list_has_any list_histogram list_indexof list_inner_product list_intersect list_kurtosis list_kurtosis_pop list_last list_mad list_max list_median list_min list_mode list_negative_dot_product list_negative_inner_product list_pack list_position list_prepend list_product list_reduce list_resize list_reverse list_reverse_sort list_select list_sem list_skewness list_slice list_sort list_stddev_pop list_stddev_samp list_string_agg list_sum list_transform list_unique list_value list_var_pop list_var_samp list_where list_zip listagg listen ln load local location lock lock_configuration locked log log10 log2 log_query_path logged logging_level logging_mode logging_storage logical long lower lpad ltrim macro mad make_date make_time make_timestamp make_timestamp_ns make_timestamptz map map_concat map_contains map_contains_entry map_contains_value map_entries map_extract map_extract_value map_from_entries map_keys map_to_pg_oid map_values mapping match materialized max max_by max_expression_depth max_memory max_temp_directory_size max_vacuum_tasks maxvalue md5 md5_number md5_number_lower md5_number_upper mean median memory_limit merge_join_threshold metadata_info method microsecond microseconds millennia millennium millisecond milliseconds min min_by minute minutes minvalue mismatches mod mode month monthname months move multiply name names nanosecond national natural nchar nested_loop_join_threshold new next nextafter nextval nfc_normalize no none normalized_interval not not_ilike_escape not_like_escape nothing notify notnull now nowait null null_order nullif nulls numeric nvarchar obj_description object octet_length of off offset oid oids old old_implicit_casting on only operator option options or ord order order_by_non_integer_literal ordered_aggregate_threshold ordinality others out outer over overlaps overlay overriding owned owner pandas_analyze_sample pandas_scan parallel parquet_bloom_probe parquet_file_metadata parquet_kv_metadata parquet_metadata parquet_metadata_cache parquet_scan parquet_schema parse_dirname parse_dirpath parse_duckdb_log_message parse_filename parse_path parser partial partition partitioned partitioned_write_flush_threshold partitioned_write_max_open_files passing password percent perfect_ht_threshold persistent pi pivot pivot_filter_threshold pivot_limit pivot_longer pivot_wider placing plans platform policy position positional pow power pragma pragma_collations pragma_database_size pragma_metadata_info pragma_platform pragma_show pragma_storage_info pragma_table_info pragma_user_agent pragma_version preceding precision prefer_range_joins prefetch_all_parquet_files prefix prepare prepared preserve preserve_identifier_case preserve_insertion_order primary printf prior privileges procedural procedure produce_arrow_string_view product profile_output profiling_mode profiling_output program progress_bar_time publication python_enable_replacements python_map_function python_scan_all_frames qualify quantile quantile_cont quantile_disc quarter quarters query query_table quote radians random range read read_blob read_csv read_csv_auto read_json read_json_auto read_json_objects read_json_objects_auto read_ndjson read_ndjson_auto read_ndjson_objects read_parquet read_text real reassign recheck recursive reduce ref references referencing refresh regexp_escape regexp_extract regexp_extract_all regexp_full_match regexp_matches regexp_replace regexp_split_to_array regexp_split_to_table regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release remap_struct rename repeat repeat_row repeatable replace replica reservoir_quantile reset respect restart restrict returning returns reverse revoke right right_grapheme role rollback rollup round round_even roundbankers row row_to_json rows rpad rtrim rule sample savepoint scalar_subquery_error_on_multiple_rows scheduler_process_partial schema schemas scope scroll search search_path second seconds secret secret_directory security select sem semi seq_scan sequence sequences serializable server session session_user set set_bit setof sets setseed sha1 sha256 share shobj_description short show show_databases show_tables show_tables_expanded sign signbit signed similar simple sin sinh skewness skip smallint snapshot sniff_csv some sorted split split_part sql sqrt stable standalone start starts_with statement statistics stats stddev stddev_pop stddev_samp stdin stdout storage storage_compatibility_version storage_info stored str_split str_split_regex streaming_buffer_size strftime strict string string_agg string_split string_split_regex string_to_array strip strip_accents strlen strpos strptime struct struct_concat struct_extract struct_extract_at struct_insert struct_pack subscription substr substring substring_grapheme subtract suffix sum sum_no_overflow sumkahan summarize summary symmetric sysid system table table_info tables tablesample tablespace tan tanh temp temp_directory template temporary test_all_types test_vector_types text then threads ties time time_bucket timestamp timestamp_ms timestamp_ns timestamp_s timestamp_us timestamptz timetz timetz_byte_comparable timezone timezone_hour timezone_minute tinyint to to_base to_base64 to_binary to_centuries to_days to_decades to_hex to_hours to_json to_microseconds to_millennia to_milliseconds to_minutes to_months to_quarters to_seconds to_timestamp to_weeks to_years today trailing transaction transaction_timestamp transform translate treat trigger trim true trunc truncate truncate_duckdb_logs trusted try_cast try_strptime txid_current type typeof types ubigint ucase uhugeint uint128 uint16 uint32 uint64 uint8 uinteger unbin unbounded uncommitted unencrypted unhex unicode union union_extract union_tag union_value unique unknown unlisten unlogged unnest unpack unpivot unpivot_list until update upper url_decode url_encode use user user_agent username using usmallint utinyint uuid uuid_extract_timestamp uuid_extract_version uuidv4 uuidv7 vacuum valid validate validator value values var_pop var_samp varbinary varchar variable variadic variance varint varying vector_type verbose verify_external verify_fetch_row verify_parallelism verify_serializer version view views virtual volatile wal_autocheckpoint wavg week weekday weekofyear weeks weighted_avg when where which_secret whitespace window with within without work worker_threads wrapper write write_log xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlnamespaces xmlparse xmlpi xmlroot xmlserialize xmltable xor year years yearweek yes zone zstd_min_string_length | || ~ ~~ ~~* ~~~",types:"JSON bigint binary bit bitstring blob bool boolean bpchar bytea char date datetime dec decimal double enum float float4 float8 guid hugeint int int1 int128 int16 int2 int32 int4 int64 int8 integer integral interval list logical long map null numeric nvarchar oid real row short signed smallint string struct text time timestamp timestamp_ms timestamp_ns timestamp_s timestamp_us timestamptz timetz tinyint ubigint uhugeint uint128 uint16 uint32 uint64 uint8 uinteger union usmallint utinyint uuid varbinary varchar varint"});var Sk=new Set("postgresql.postgres.couchbase.db2.db2i.tidb.mysql.sqlite.mssql.sqlserver.duckdb.mariadb.cassandra.noql.spark.awsathena.athena.bigquery.hive.redshift.snowflake.flink.mongodb.trino.oracle.oracledb.singlestoredb.timescaledb.databricks.datafusion.microsoft sql server".split("."));function tc(e){return Sk.has(e)}function Cg(e){let n=e.dialect;if(!tc(n))return Se.debug("Unknown dialect",{dialect:n}),Ds;switch(n){case"postgresql":case"postgres":return Ch;case"mysql":return dD;case"sqlite":return cD;case"mssql":case"sqlserver":case"microsoft sql server":return pD;case"duckdb":return Sg;case"mariadb":return hD;case"cassandra":return mD;case"oracledb":case"oracle":return lD;case"bigquery":return kg;case"timescaledb":return Ch;case"awsathena":case"athena":case"db2i":case"db2":case"hive":case"redshift":case"snowflake":case"flink":case"mongodb":case"noql":case"couchbase":case"trino":case"tidb":case"singlestoredb":case"spark":case"databricks":case"datafusion":return Se.debug("Unsupported dialect",{dialect:n}),Ds;default:return _s(n),Ds}}var Ck={...fD,caseInsensitiveIdentifiers:!0,identifierQuotes:"'"};let Ds;Ds=Eh.define(Ck),Ui="__marimo_duckdb",xo=new Set([Ui]),k_="memory",Ul=function(e){return e===""};var Os={formatTableName:e=>e,formatSelectClause:(e,n)=>`SELECT ${e} FROM ${n} LIMIT 100`};function Ek(e){if(e=e.toLowerCase(),!tc(e))return Os;switch(e){case"bigquery":{let n=kg.spec.identifierQuotes;return{formatTableName:i=>`${n}${i}${n}`,formatSelectClause:Os.formatSelectClause}}case"mssql":case"sqlserver":case"microsoft sql server":return{formatTableName:Os.formatTableName,formatSelectClause:(n,i)=>`SELECT TOP 100 ${n} FROM ${i}`};case"timescaledb":case"postgres":case"postgresql":case"duckdb":return{formatTableName:n=>n.split(".").map(i=>`"${i}"`).join("."),formatSelectClause:(n,i)=>`SELECT ${n==="*"?"*":`"${n}"`} FROM ${i} LIMIT 100`};case"db2":case"db2i":case"mysql":case"sqlite":case"mariadb":case"cassandra":case"noql":case"awsathena":case"athena":case"hive":case"redshift":case"snowflake":case"flink":case"mongodb":case"oracle":case"oracledb":case"couchbase":case"tidb":case"spark":case"trino":case"singlestoredb":case"databricks":case"datafusion":return Os;default:return _s(e),Os}}__=function({table:e,columnName:n,sqlTableContext:i}){if(i){let{engine:o,schema:s,defaultSchema:c,defaultDatabase:d,database:f,dialect:p}=i,y=e.name;Ul(s)?y=f===d?y:`${f}.${y}`:(s!==c&&(y=`${s}.${y}`),f!==d&&(y=`${f}.${y}`));let w=Ek(p),_=w.formatTableName(y),C=w.formatSelectClause(n,_);return o==="__marimo_duckdb"?`_df = mo.sql(f"""
60
60
  ${C}
61
61
  """)`:`_df = mo.sql(f"""
62
62
  ${C}
63
- """, engine=${o})`}return`_df = mo.sql(f'SELECT "${n}" FROM ${e.name} LIMIT 100')`},I_=function(e,n){if(n==="date"||n==="datetime"||n==="time"){if(e==="min")return"Earliest";if(e==="max")return"Latest"}return e};function Tk(){return{tables:[],expandedTables:new Set,expandedColumns:new Set,columnsPreviews:new Map}}var{reducer:BD,createActions:HD,valueAtom:Eg,useActions:Rk}=Ml(Tk,{addDatasets:(e,n)=>{let{previewDatasetColumn:i}=Vi();for(let f of n.tables)for(let p of f.columns){let y=`${f.name}:${p.name}`;e.expandedColumns.has(y)&&i({tableName:f.name,columnName:p.name,source:f.source,sourceType:f.source_type})}let o=e.tables;n.clear_channel&&(o=o.filter(f=>f.source!==n.clear_channel));let s=[...n.tables,...o],c=new Set,d=s.filter(f=>{let p=`${f.name}:${f.source}`;return c.has(p)?!1:(c.add(p),!0)}).sort((f,p)=>f.name.localeCompare(p.name));return{...e,tables:d}},filterDatasetsFromVariables:(e,n)=>{let i=new Set(n),o=e.tables.filter(s=>s.variable_name?i.has(s.variable_name):!0);return{...e,tables:o}},toggleTable:(e,n)=>{let i=new Set(e.expandedTables);return i.has(n)?i.delete(n):i.add(n),{...e,expandedTables:i}},toggleColumn:(e,n)=>{let i=`${n.table}:${n.column}`,o=new Set(e.expandedColumns);return o.has(i)?o.delete(i):o.add(i),{...e,expandedColumns:o}},closeAllColumns:e=>({...e,expandedColumns:new Set}),addColumnPreview:(e,n)=>{let i=`${n.table_name}:${n.column_name}`,o=new Map(e.columnsPreviews);return o.set(i,n),{...e,columnsPreviews:o}}});J_=()=>Zn(Eg),Qu=ze(e=>e(Eg).tables),B_=ze(new Set),D_=ze(!1),v_=function(){return Rk()};var Dk=new Map([[Ui,{name:Ui,dialect:"duckdb",source:"duckdb",display_name:"DuckDB (In-Memory)",databases:[]}]]);function Ok(){return{latestEngineSelected:Ui,connectionsMap:Dk}}let Pk,Mk;({reducer:Pk,createActions:Mk,valueAtom:ko,useActions:U_}=Ml(Ok,{addDataSourceConnection:(e,n)=>{if(n.connections.length===0)return e;let{latestEngineSelected:i,connectionsMap:o}=e,s=new Map(o);for(let c of n.connections)s.set(c.name,c);return{latestEngineSelected:i,connectionsMap:s}},filterDataSourcesFromVariables:(e,n)=>{let{latestEngineSelected:i,connectionsMap:o}=e,s=new Set(n),c=new Map([...o].filter(([d])=>xo.has(d)?!0:s.has(d)));return{latestEngineSelected:c.has(i)?i:Ui,connectionsMap:c}},clearDataSourceConnections:()=>({latestEngineSelected:Ui,connectionsMap:new Map}),removeDataSourceConnection:(e,n)=>{let{latestEngineSelected:i,connectionsMap:o}=e,s=new Map(o);return s.delete(n),{latestEngineSelected:s.has(i)?i:Ui,connectionsMap:s}},addTableList:(e,n)=>{let{tables:i,sqlTableContext:o}=n,{connectionsMap:s,latestEngineSelected:c}=e,d=o.engine,f=s.get(d);if(!f)return e;let p=new Map(s),y={...f,databases:f.databases.map(w=>w.name===o.database?{...w,schemas:w.schemas.map(_=>_.name===o.schema?{..._,tables:i}:_)}:w)};return p.set(d,y),{latestEngineSelected:c,connectionsMap:p}},addTable:(e,n)=>{let{table:i,sqlTableContext:o}=n,{connectionsMap:s,latestEngineSelected:c}=e,d=o.engine,f=i.name,p=s.get(d);if(!p)return e;let y=new Map(s),w={...p,databases:p.databases.map(_=>_.name===o.database?{..._,schemas:_.schemas.map(C=>{if(C.name!==o.schema)return C;let E=C.tables.length===0?[i]:C.tables.map(T=>T.name===f?i:T);return{...C,tables:E}})}:_)};return y.set(d,w),{latestEngineSelected:c,connectionsMap:y}}})),Ju=ze(e=>e(ko).connectionsMap);function Tg(e){let n=lt.get(ko);n.connectionsMap.has(e)&&lt.set(ko,{...n,latestEngineSelected:e})}Tw=ze(e=>{let n=lt.get(Qu),i=e(ko).connectionsMap,o=new Map;for(let s of n)o.set(s.name,s);for(let s of i.values())for(let c of s.databases){let d=c.name===s.default_database||s.databases.length===1;for(let f of c.schemas){let p=f.name===s.default_schema,y=Kl(f.name);for(let w of f.tables){let _;if(_=w.name,y){_=d?w.name:`${c.name}.${w.name}`,o.has(_)?Se.warn(`Table name collision for ${_}. Skipping.`):o.set(_,w);continue}if(d&&p&&!o.has(_)){o.set(_,w);continue}if(_=`${f.name}.${w.name}`,d&&!o.has(_)){o.set(_,w);continue}_=`${c.name}.${f.name}.${w.name}`,o.has(_)?Se.warn(`Table name collision for ${_}. Skipping.`):o.set(_,w)}}}return o}),z_=function(e){return e.variable_name?"dataframe":"table"};let rc,jd,Rg,zd,Dg,Og,Fd,Pg;rc=class{constructor(e,n={}){ke(this,"cache",new Map);this.maxSize=e,this.options=n}getOrCreate(e){In(this.options.create,"create function is required");let n=this.cache.get(e);if(n!==void 0)return n;let i=this.options.create(e);return this.cache.set(e,i),i}get(e){let n=this.cache.get(e);return n!==void 0&&(this.cache.delete(e),this.cache.set(e,n)),n}set(e,n){if(this.cache.has(e)&&this.cache.delete(e),this.cache.set(e,n),this.cache.size>this.maxSize){let i=this.cache.keys().next().value;i!==void 0&&this.cache.delete(i)}}keys(){return this.cache.keys()}values(){return this.cache.values()}entries(){return this.cache.entries()}delete(e){this.cache.delete(e)}},Zh=Tt("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),fm=Tt("book-marked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]),om=Tt("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),cm=Tt("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]),$h=Tt("braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]),jd=Tt("calendar-clock",[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]),Dm=Tt("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),Wh=Tt("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),jh=Tt("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Rg=Tt("cog",[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]]),am=Tt("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]),zd=Tt("database-backup",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 12a9 3 0 0 0 5 2.69",key:"1ui2ym"}],["path",{d:"M21 9.3V5",key:"6k6cib"}],["path",{d:"M3 5v14a9 3 0 0 0 6.47 2.88",key:"i62tjy"}],["path",{d:"M12 12v4h4",key:"1bxaet"}],["path",{d:"M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16",key:"1f4ei9"}]]),Es=Tt("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),zu=Tt("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),nm=Tt("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),Dg=Tt("folder-tree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]),Au=Tt("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Og=Tt("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]),So=Tt("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),em=Tt("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),Uh=Tt("notebook-pen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]]),Fh=Tt("paint-roller",[["rect",{width:"16",height:"6",x:"2",y:"2",rx:"2",key:"jcyz7m"}],["path",{d:"M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2",key:"1b9h7c"}],["rect",{width:"4",height:"6",x:"8",y:"16",rx:"1",key:"d6e7yl"}]]),Nh=Tt("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),Fd=Tt("search-check",[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),Pg=Tt("square-dashed-bottom-code",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"M14 21h1",key:"v9vybs"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["path",{d:"M5 21a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2",key:"as5y1o"}],["path",{d:"M9 21h1",key:"15o7lz"}]]),Xh=Tt("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]),bo=Tt("table-2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]),Gh=Tt("text-search",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M10 12H3",key:"1ulcyk"}],["path",{d:"M10 19H3",key:"108z41"}],["circle",{cx:"17",cy:"15",r:"3",key:"1upz2a"}],["path",{d:"m21 19-1.9-1.9",key:"dwi7p8"}]]),km=Tt("variable",[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]]),Nl=function(e){switch(e){case"duckdb":return"DuckDB";case"motherduck":return"MotherDuck";case"sqlite":return"SQLite";case"postgres":case"postgresql":return"PostgreSQL";case"mysql":return"MySQL";case"mariadb":return"MariaDB";case"mssql":case"microsoft sql server":return"Microsoft SQL Server";case"oracle":return"Oracle";case"redshift":return"Amazon Redshift";case"snowflake":return"Snowflake";case"bigquery":return"Google BigQuery";case"clickhouse":return"ClickHouse";case"timeplus":return"Timeplus";case"databricks":return"Databricks";case"db2":return"IBM Db2";case"hive":return"Apache Hive";case"impala":return"Apache Impala";case"presto":return"Presto";case"trino":return"Trino";case"cockroachdb":return"CockroachDB";case"timescaledb":return"TimescaleDB";case"singlestore":return"SingleStore";case"cassandra":return"Apache Cassandra";case"mongodb":return"MongoDB";case"iceberg":return"Apache Iceberg";default:return e}};function Mg(e){let[n,i]=e.split(" ");return i?`${Nl(n)} ${i}`:Nl(e)}Bu={boolean:d4,date:f4,time:jh,datetime:jd,temporal:jd,number:yh,string:p4,integer:yh,unknown:$h},M_=function(e){switch(e){case"boolean":return"bg-(--orange-4)";case"date":case"time":case"datetime":case"temporal":return"bg-(--grass-4) dark:bg-(--grass-5)";case"number":case"integer":return"bg-(--purple-4)";case"string":return"bg-(--blue-4)";case"unknown":return"bg-(--slate-4) dark:bg-(--slate-6)";default:return _s(e),"bg-(--slate-4) dark:bg-(--slate-6)"}};let Ps,B,Lg,Bd,Ng,Lo,Ig,Ag,qg,jg,zg,No,ei,za,pi,Hd;Da=class{constructor(e,n){this.singular=e,this._plural=n}pluralize(e){return e===1?this.singular:this.plural}get plural(){return this._plural??`${this.singular}s`}},Aw=class gx{constructor(n){this.words=n}static of(...n){return new gx(n.map(i=>typeof i=="string"?new Da(i):i))}join(n,i){return this.words.map(o=>o.pluralize(i)).join(n)}},Ps=Jr(),B=gh(_4(),1),Lg=5,Bd={boolean:"bg-[var(--orange-4)] text-[var(--orange-11)]",date:"bg-[var(--grass-4)] text-[var(--grass-11)]",time:"bg-[var(--grass-4)] text-[var(--grass-11)]",datetime:"bg-[var(--grass-4)] text-[var(--grass-11)]",number:"bg-[var(--purple-4)] text-[var(--purple-11)]",integer:"bg-[var(--purple-4)] text-[var(--purple-11)]",string:"bg-[var(--blue-4)] text-[var(--blue-11)]",unknown:"bg-[var(--slate-4)] text-[var(--slate-11)]"},Ng={local:"bg-[var(--blue-4)] text-[var(--blue-11)]",duckdb:"bg-[var(--amber-4)] text-[var(--amber-11)]",connection:"bg-[var(--green-4)] text-[var(--green-11)]",catalog:"bg-[var(--purple-4)] text-[var(--purple-11)]"},Lo="p-3 min-w-[250px] flex flex-col divide-y",Ig=new Da("column","columns"),Ag=new Da("row","rows"),qg=new Da("schema","schemas"),jg=new Da("table","tables"),zg=new Da("database","databases"),No=e=>{let n=(0,Ps.c)(6),{icon:i,title:o,badge:s}=e,c;n[0]===o?c=n[1]:(c=(0,B.jsx)("h3",{className:"font-semibold text-sm",children:o}),n[0]=o,n[1]=c);let d;return n[2]!==s||n[3]!==i||n[4]!==c?(d=(0,B.jsxs)("div",{className:"flex items-center gap-2 pb-2",children:[i,c,s]}),n[2]=s,n[3]=i,n[4]=c,n[5]=d):d=n[5],d},ei=e=>{let n=(0,Ps.c)(5),{label:i,value:o}=e,s;n[0]===i?s=n[1]:(s=(0,B.jsxs)("span",{className:"text-[var(--slate-11)]",children:[i,":"]}),n[0]=i,n[1]=s);let c;return n[2]!==s||n[3]!==o?(c=(0,B.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[s,o]}),n[2]=s,n[3]=o,n[4]=c):c=n[4],c},za=e=>{let n=(0,Ps.c)(5),{icon:i,text:o}=e,s;n[0]===o?s=n[1]:(s=(0,B.jsx)("span",{className:"text-xs text-[var(--slate-11)]",children:o}),n[0]=o,n[1]=s);let c;return n[2]!==i||n[3]!==s?(c=(0,B.jsxs)("div",{className:"flex items-center gap-1",children:[i,s]}),n[2]=i,n[3]=s,n[4]=c):c=n[4],c},pi=e=>{let n=(0,Ps.c)(15),{title:i,items:o,totalCount:s,limit:c}=e,d=i===void 0?"":i,f=c===void 0?Lg:c;if(o.length===0)return null;let p;n[0]!==o||n[1]!==f?(p=o.slice(0,f),n[0]=o,n[1]=f,n[2]=p):p=n[2];let y=p,w=s>f,_;n[3]===d?_=n[4]:(_=d&&(0,B.jsxs)("h4",{className:"text-xs font-medium text-[var(--slate-11)] mb-2",children:[d,":"]}),n[3]=d,n[4]=_);let C;n[5]!==w||n[6]!==f||n[7]!==s?(C=w&&(0,B.jsxs)("div",{className:"text-xs text-[var(--slate-10)] text-center py-1",children:["... and ",s-f," more"]}),n[5]=w,n[6]=f,n[7]=s,n[8]=C):C=n[8];let E;n[9]!==C||n[10]!==y?(E=(0,B.jsxs)("div",{className:"flex flex-col gap-1 overflow-y-auto",children:[y,C]}),n[9]=C,n[10]=y,n[11]=E):E=n[11];let T;return n[12]!==_||n[13]!==E?(T=(0,B.jsxs)("div",{className:"py-2",children:[_,E]}),n[12]=_,n[13]=E,n[14]=T):T=n[14],T},Hd=e=>Bd[e]||Bd.unknown;const Lk=e=>{var d,f;let n=e.type==="view"?(0,B.jsx)(zu,{className:"w-4 h-4 text-[var(--blue-9)]"}):(0,B.jsx)(bo,{className:"w-4 h-4 text-[var(--green-9)]"}),i=(0,B.jsx)(mr,{variant:"secondary",className:`text-xs ${e.type==="view"?"bg-[var(--blue-4)] text-[var(--blue-11)]":"bg-[var(--green-4)] text-[var(--green-11)]"}`,children:e.type}),o=e.columns.map(p=>{let y=Bu[p.type];return(0,B.jsxs)("div",{className:"flex items-center justify-between text-xs rounded",children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(y,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,B.jsx)("span",{className:"font-mono",children:p.name})]}),(0,B.jsx)(mr,{variant:"outline",className:`text-xs ${Hd(p.type)}`,children:p.type})]},p.name)}),s=e.primary_keys&&e.primary_keys.length>0,c=e.indexes&&e.indexes.length>0;return(0,B.jsxs)("div",{className:`${Lo} min-w-[300px]`,children:[(0,B.jsx)(No,{icon:n,title:e.name,badge:i}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,B.jsx)(ei,{label:"Source",value:(0,B.jsx)(mr,{variant:"outline",className:`text-xs ${Ng[e.source_type]}`,children:e.source})}),e.variable_name&&(0,B.jsx)(ei,{label:"Variable",value:(0,B.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.variable_name})}),e.engine&&(0,B.jsx)(ei,{label:"Engine",value:(0,B.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.engine})})]}),(e.num_columns!=null||e.num_rows!=null)&&(0,B.jsxs)("div",{className:"grid grid-cols-2 gap-2 py-2",children:[e.num_columns!=null&&(0,B.jsx)(za,{icon:(0,B.jsx)(am,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_columns} ${Ig.pluralize(e.num_columns)}`}),e.num_rows!=null&&(0,B.jsx)(za,{icon:(0,B.jsx)(yh,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_rows} ${Ag.pluralize(e.num_rows)}`})]}),e.columns.length===0&&ic("column"),(s||c)&&(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[s&&(0,B.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,B.jsxs)("div",{className:"flex items-center gap-1",children:[(0,B.jsx)(_D,{className:"w-3 h-3 text-[var(--amber-9)]"}),(0,B.jsx)("span",{className:"text-xs font-medium text-[var(--slate-11)]",children:"Primary Keys:"})]}),(d=e.primary_keys)==null?void 0:d.map(p=>(0,B.jsx)(mr,{variant:"outline",className:"text-xs text-[var(--slate-11)]",children:p},p))]}),c&&(0,B.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,B.jsxs)("div",{className:"flex items-center gap-1 mb-1",children:[(0,B.jsx)(fm,{className:"w-3 h-3 text-[var(--purple-9)]"}),(0,B.jsx)("span",{className:"text-xs font-medium text-[var(--slate-11)]",children:"Indexes:"})]}),(f=e.indexes)==null?void 0:f.map(p=>(0,B.jsx)(mr,{variant:"outline",className:"text-xs text-[var(--slate-11)]",children:p},p))]})]}),e.columns.length>0&&(0,B.jsx)(pi,{items:o,totalCount:e.columns.length})]})},Nk=e=>{var s;let n=Bu[e.type],i=(0,B.jsx)(mr,{variant:"outline",className:`text-xs ${Hd(e.type)}`,children:e.type}),o=((s=e.sample_values)==null?void 0:s.map((c,d)=>(0,B.jsx)("div",{className:"text-xs bg-[var(--slate-3)] rounded font-mono",children:c==null?"null":String(c)},d)))||[];return(0,B.jsxs)("div",{className:Lo,children:[(0,B.jsx)(No,{icon:(0,B.jsx)(n,{className:"w-4 h-4 text-[var(--slate-9)]"}),title:e.name,badge:i}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 mt-2",children:[(0,B.jsx)(ei,{label:"Type",value:(0,B.jsx)("span",{className:"font-medium",children:e.type})}),(0,B.jsx)(ei,{label:"External Type",value:(0,B.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.external_type})})]}),e.sample_values&&e.sample_values.length>0&&(0,B.jsx)(pi,{title:"Sample Values",items:o,totalCount:e.sample_values.length})]})},Ik=e=>{let n=(0,B.jsx)(mr,{variant:"outline",className:"text-xs bg-[var(--blue-4)] text-[var(--blue-11)]",children:e.dialect}),i=e.schemas.map(o=>(0,B.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-[var(--slate-3)]",children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(So,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,B.jsx)("span",{children:o.name})]}),(0,B.jsxs)(mr,{variant:"outline",className:"text-xs",children:[o.tables.length," ",jg.pluralize(o.tables.length)]})]},o.name));return(0,B.jsxs)("div",{className:Lo,children:[(0,B.jsx)(No,{icon:(0,B.jsx)(Es,{className:"w-4 h-4 text-[var(--blue-9)]"}),title:e.name,badge:n}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,B.jsx)(ei,{label:"Dialect",value:(0,B.jsx)("span",{className:"font-medium",children:e.dialect})}),e.engine&&(0,B.jsx)(ei,{label:"Engine",value:(0,B.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.engine})})]}),(0,B.jsx)("div",{className:"py-2",children:(0,B.jsx)(za,{icon:(0,B.jsx)(So,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.schemas.length} schema${e.schemas.length===1?"":"s"}`})}),e.schemas.length===0&&ic("schema"),e.schemas.length>0&&(0,B.jsx)(pi,{title:"Schemas",items:i,totalCount:e.schemas.length})]})},Ak=e=>{let n=(0,B.jsx)(mr,{variant:"outline",className:"text-xs bg-[var(--green-4)] text-[var(--green-11)]",children:"Schema"}),i=e.tables.map(o=>(0,B.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-[var(--slate-3)]",children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[o.type==="view"?(0,B.jsx)(zu,{className:"w-3 h-3 text-[var(--blue-9)]"}):(0,B.jsx)(bo,{className:"w-3 h-3 text-[var(--green-9)]"}),(0,B.jsx)("span",{children:o.name})]}),(0,B.jsx)(mr,{variant:"outline",className:`text-xs ${o.type==="view"?"bg-[var(--blue-4)] text-[var(--blue-11)]":"bg-[var(--green-4)] text-[var(--green-11)]"}`,children:o.type})]},o.name));return(0,B.jsxs)("div",{className:Lo,children:[(0,B.jsx)(No,{icon:(0,B.jsx)(So,{className:"w-4 h-4 text-[var(--green-9)]"}),title:e.name,badge:n}),(0,B.jsx)("div",{className:"py-2",children:(0,B.jsx)(za,{icon:(0,B.jsx)(bo,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.tables.length} table${e.tables.length===1?"":"s"}`})}),e.tables.length===0&&ic("table"),e.tables.length>0&&(0,B.jsx)(pi,{title:"Tables",items:i,totalCount:e.tables.length})]})};var Fg=(0,B.jsx)(mr,{variant:"outline",children:"default"}),qk=8,Bg=3;let ic;i_=(e,n)=>{let i=e.databases.length,o=e.databases.reduce((p,y)=>p+y.schemas.length,0),s=(p,y)=>{if(p.tables.length===0)return null;let w=p.name===e.default_schema&&y,_=[];return o<qk&&(_=p.tables.slice(0,Bg+1).map(C=>(0,B.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,B.jsx)(bo,{className:"w-3 h-3 text-[var(--green-9)]"}),(0,B.jsx)("span",{className:"text-xs",children:C.name})]},C.name))),(0,B.jsxs)("div",{children:[(0,B.jsxs)("div",{className:"flex items-center gap-2 text-xs rounded hover:bg-[var(--slate-3)] ml-2",children:[(0,B.jsx)(So,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,B.jsx)("span",{children:p.name}),w&&Fg,(0,B.jsxs)(mr,{variant:"outline",className:"text-xs ml-auto",children:[p.tables.length," tables"]})]}),(0,B.jsx)(pi,{items:_,totalCount:p.tables.length,limit:Bg})]},p.name)},c=e.databases.map(p=>{let y=p.name===e.default_database||e.databases.length===1,w=p.schemas.map(_=>s(_,y));return(0,B.jsxs)("div",{children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(Es,{className:"w-3 h-3 text-[var(--blue-9)]"}),(0,B.jsx)("span",{className:"text-xs",children:p.name}),y&&Fg]}),w&&(0,B.jsx)(pi,{items:w,totalCount:p.schemas.length})]},p.name)}),d=e.name;xo.has(e.name)&&(d="In-Memory");let f=n==null?void 0:n.map(p=>(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(bo,{className:"w-3 h-3 text-[var(--blue-9)]"}),(0,B.jsx)("span",{className:"text-xs",children:p.name})]},p.name));return(0,B.jsxs)("div",{className:`${Lo} px-1`,children:[(0,B.jsx)(No,{icon:(0,B.jsx)(Rg,{className:"w-4 h-4 text-[var(--purple-9)]"}),title:d}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,B.jsx)(ei,{label:"Dialect",value:(0,B.jsx)("span",{className:"font-medium",children:Nl(e.dialect)})}),(0,B.jsx)(ei,{label:"Source",value:(0,B.jsx)(mr,{variant:"outline",className:"text-xs bg-[var(--green-4)] text-[var(--green-11)]",children:e.source})})]}),(0,B.jsxs)("div",{className:"flex flex-row justify-between py-2",children:[(0,B.jsx)(za,{icon:(0,B.jsx)(Es,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${i} ${zg.pluralize(i)}`}),(0,B.jsx)(za,{icon:(0,B.jsx)(So,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${o} ${qg.pluralize(o)}`})]}),i>0&&(0,B.jsx)(pi,{items:c,totalCount:i}),f&&f.length>0&&(0,B.jsx)(pi,{title:"Dataframes",items:f,totalCount:f.length})]})},ic=e=>(0,B.jsxs)("div",{className:"flex items-start gap-2 mt-3",children:[(0,B.jsx)(Au,{size:10,className:"mt-1 text-[var(--slate-10)] shrink-0"}),(0,B.jsxs)("span",{className:"text-xs text-[var(--slate-11)]",children:["No ",e," information available.",`
64
- `,(0,B.jsx)("span",{className:"text-[var(--blue-10)]",children:"Introspect to see more details."})]})]});var ac=sd(),Hg=class{constructor(){ke(this,"schema",{})}addTable(e,n){let i={self:zk({table:n}),children:n.columns.map(o=>jk({column:o}))};return this.setAt([...e,n.name],i),this}addSchema(e,n){let i={self:Fk({namespace:n,path:e}),children:{}};return this.setAt(e,i),this}addDatabase(e,n){let i={self:Bk({namespace:n,path:e}),children:{}};return this.setAt(e,i),this}setAt(e,n){let i=this.schema;for(let o of e.slice(0,-1))i[o]||(i[o]={children:{}}),i=i[o].children;i[e[e.length-1]]=n}build(){return this.schema}reset(){return this.schema={},this}};function jk(e){return{label:e.column.name,type:"column",info:()=>{let n=document.createElement("div");return(0,ac.createRoot)(n).render(Nk(e.column)),{dom:n}}}}function zk(e){return{label:e.table.name,type:"table",info:()=>{let n=document.createElement("div");return(0,ac.createRoot)(n).render(Lk(e.table)),{dom:n}}}}function Fk(e){return{label:e.namespace.name,detail:e.path.join("."),type:"schema",info:()=>{let n=document.createElement("div");return(0,ac.createRoot)(n).render(Ak(e.namespace)),{dom:n}}}}function Bk(e){return{label:e.namespace.name,detail:e.path.join("."),type:"database",info:()=>{let n=document.createElement("div");return(0,ac.createRoot)(n).render(Ik(e.namespace)),{dom:n}}}}var Hk=ze(e=>{let n=e(Qu),i=new Hg;for(let o of n)i.addTable([],o);return i.build()}),Vk=class{constructor(){this.cache=new rc(10,{create:e=>this.getConnectionSchema(e)})}getConnection(e){return lt.get(Ju).get(e)}getConnectionSchema(e){var d;let{default_database:n,databases:i,default_schema:o}=e,s=new Hg,c=i.find(f=>f.name===n||i.length===1);if(((d=c??i[0])==null?void 0:d.schemas.some(f=>Kl(f.name)))??!1){for(let f of i){let p=f.name===(c==null?void 0:c.name),y=f.schemas.flatMap(w=>w.tables);s.addDatabase([f.name],f);for(let w of y)p?s.addTable([],w):s.addTable([f.name],w)}return{shouldAddLocalTables:!1,schema:s.build(),defaultSchema:c==null?void 0:c.name}}if(c)for(let f of c.schemas){s.addSchema([f.name],f);for(let p of f.tables)s.addTable([f.name],p)}for(let f of i){s.addDatabase([f.name],f);for(let p of f.schemas){s.addSchema([f.name,p.name],p);for(let y of p.tables)s.addTable([f.name,p.name],y)}}return{shouldAddLocalTables:!0,schema:s.build(),defaultSchema:o??void 0}}getInternalDialect(e){let n=this.getConnection(e);return n?n.dialect.toLowerCase():null}getDialect(e){let n=this.getConnection(e);return n?Cg(n):Ds}getCompletionSource(e){let n=this.getConnection(e);if(!n)return null;let i=()=>lt.get(Hk),o=this.cache.getOrCreate(n);return{dialect:Cg(n),schema:o.shouldAddLocalTables?{...o.schema,...i()}:o.schema,defaultSchema:o.defaultSchema,defaultTable:$k(n)}}};function $k(e){if(e.databases.length!==1)return;let n=e.databases[0];if(n.schemas.length!==1)return;let i=n.schemas[0];if(i.tables.length===1)return i.tables[0].name}const Fa=new Vk,Ms=Bi.define();dd=async function(e){let{sendFormat:n}=Vi(),i=ui.mapValues(e,s=>Xr(s)),o=await n({codes:i,lineLength:ew().formatting.line_length});for(let[s,c]of ui.entries(o.codes)){let d=s,f=i[d],p=e[d];p&&c!==f&&(p.state.facet(Pt).updateCellCode({cellId:d,code:c,formattingChange:!0}),_o(p,c))}},Nw=function(){return dd(_k(rd()))};async function Wk(e,n){let{formatDialect:i}=await ce(async()=>{let{formatDialect:_}=await import("./esm-DvGqZhsW.js").then(async C=>(await C.__tla,C));return{formatDialect:_}},__vite__mapDeps([0,1]),import.meta.url),o=await Uk(Fa.getInternalDialect(n)),s=e.state.field(Lr),c=x4(e.state);if(s.type!=="sql"){Se.error("Language adapter is not SQL");return}let d=e.state.doc.toString(),f;try{f=i(d,{dialect:o,tabWidth:c,useTabs:!1})}catch(_){Se.error("Error formatting SQL",{error:_});return}let p=s.transformIn(f)[0],y=e.state.facet(Pt),w=e.state.facet(tc);y.updateCellCode({cellId:w,code:p,formattingChange:!0}),ju(e,f,{effects:[Ms.of(!0)]})}async function Uk(e){let{bigquery:n,db2:i,db2i:o,duckdb:s,hive:c,mariadb:d,mysql:f,tidb:p,n1ql:y,plsql:w,postgresql:_,redshift:C,spark:E,sqlite:T,sql:I,trino:$,transactsql:V,singlestoredb:F,snowflake:N}=await ce(async()=>{let{bigquery:pe,db2:P,db2i:A,duckdb:W,hive:de,mariadb:fe,mysql:we,tidb:J,n1ql:be,plsql:Ce,postgresql:Z,redshift:re,spark:se,sqlite:Q,sql:Le,trino:Fe,transactsql:et,singlestoredb:Be,snowflake:je}=await import("./esm-DvGqZhsW.js").then(async Pe=>(await Pe.__tla,Pe));return{bigquery:pe,db2:P,db2i:A,duckdb:W,hive:de,mariadb:fe,mysql:we,tidb:J,n1ql:be,plsql:Ce,postgresql:Z,redshift:re,spark:se,sqlite:Q,sql:Le,trino:Fe,transactsql:et,singlestoredb:Be,snowflake:je}},__vite__mapDeps([0,1]),import.meta.url),K=I;if(!e||!nc(e))return K;switch(e){case"mysql":return f;case"mariadb":return d;case"postgres":case"postgresql":return _;case"sqlite":return T;case"db2":return i;case"db2i":return o;case"hive":return c;case"redshift":return C;case"snowflake":return N;case"trino":return $;case"tidb":return p;case"oracle":case"oracledb":return w;case"spark":return E;case"singlestoredb":return F;case"couchbase":return y;case"bigquery":return n;case"duckdb":return s;case"mssql":case"sqlserver":case"microsoft sql server":return V;case"athena":case"awsathena":case"cassandra":case"noql":case"flink":case"mongodb":case"timescaledb":case"datafusion":return I;case"databricks":return E;default:return _s(e),K}}var Kk=sd();function Qk(e,n){let i=document.createElement("div"),o;return{dom:i,mount(){o=(0,Kk.createRoot)(i),o.render((0,B.jsx)(K2,{store:lt,children:(0,B.jsx)(n,{view:e})}))},update(){o==null||o.render((0,B.jsx)(K2,{store:lt,children:(0,B.jsx)(n,{view:e})}))},destroy(){o==null||o.unmount()}}}function ye(e){return new fw(uw.define(e))}function Zi(e){return ce(()=>import("./dist-Z4EybR_c.js").then(async n=>(await n.__tla,n)),__vite__mapDeps([2,3,4,5]),import.meta.url).then(n=>n.sql({dialect:n[e]}))}var Gk=[le.of({name:"C",extensions:["c","h","ino"],load(){return ce(()=>import("./dist-BuwU3nUf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,5]),import.meta.url).then(e=>e.cpp())}}),le.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return ce(()=>import("./dist-BuwU3nUf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,5]),import.meta.url).then(e=>e.cpp())}}),le.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Zi("Cassandra")}}),le.of({name:"CSS",extensions:["css"],load(){return ce(()=>import("./dist-B407S7D_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([8,9,5]),import.meta.url).then(e=>e.css())}}),le.of({name:"Go",extensions:["go"],load(){return ce(()=>import("./dist-h7FGpi6W.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([10,11,4,5]),import.meta.url).then(e=>e.go())}}),le.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return ce(()=>import("./dist-BSxIk2Vq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([12,9,5,13,14,4]),import.meta.url).then(e=>e.html())}}),le.of({name:"Java",extensions:["java"],load(){return ce(()=>import("./dist-8LCoAaYJ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([15,16,5]),import.meta.url).then(e=>e.java())}}),le.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return ce(()=>import("./dist-SpkGM8op.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript())}}),le.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return ce(()=>import("./dist-DzjeKTWA.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([18,9,5,13,14,4,19]),import.meta.url).then(e=>e.jinja())}}),le.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return ce(()=>import("./dist-BwcKpTZt.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([20,21,5]),import.meta.url).then(e=>e.json())}}),le.of({name:"JSX",extensions:["jsx"],load(){return ce(()=>import("./dist-SpkGM8op.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({jsx:!0}))}}),le.of({name:"LESS",extensions:["less"],load(){return ce(()=>import("./dist-B6bNYRJb.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([22,9,5,23]),import.meta.url).then(e=>e.less())}}),le.of({name:"Liquid",extensions:["liquid"],load(){return ce(()=>import("./dist-YQMqR1ri.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([24,9,5,13,14,4,25]),import.meta.url).then(e=>e.liquid())}}),le.of({name:"MariaDB SQL",load(){return Zi("MariaSQL")}}),le.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return ce(()=>import("./dist-DstaRs6N.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([26,9,5,13,14,4,27]),import.meta.url).then(e=>e.markdown())}}),le.of({name:"MS SQL",load(){return Zi("MSSQL")}}),le.of({name:"MySQL",load(){return Zi("MySQL")}}),le.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return ce(()=>import("./dist-1nstYXhq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([28,9,5,13,14,4,29]),import.meta.url).then(e=>e.php())}}),le.of({name:"PLSQL",extensions:["pls"],load(){return Zi("PLSQL")}}),le.of({name:"PostgreSQL",load(){return Zi("PostgreSQL")}}),le.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return ce(()=>import("./dist-Cip4Ndtd.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([30,31,4,5]),import.meta.url).then(e=>e.python())}}),le.of({name:"Rust",extensions:["rs"],load(){return ce(()=>import("./dist-BKMynip3.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([32,33,5]),import.meta.url).then(e=>e.rust())}}),le.of({name:"Sass",extensions:["sass"],load(){return ce(()=>import("./dist-BP1tfplb.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,9,5,35]),import.meta.url).then(e=>e.sass({indented:!0}))}}),le.of({name:"SCSS",extensions:["scss"],load(){return ce(()=>import("./dist-BP1tfplb.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,9,5,35]),import.meta.url).then(e=>e.sass())}}),le.of({name:"SQL",extensions:["sql"],load(){return Zi("StandardSQL")}}),le.of({name:"SQLite",load(){return Zi("SQLite")}}),le.of({name:"TSX",extensions:["tsx"],load(){return ce(()=>import("./dist-SpkGM8op.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),le.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return ce(()=>import("./dist-SpkGM8op.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({typescript:!0}))}}),le.of({name:"WebAssembly",extensions:["wat","wast"],load(){return ce(()=>import("./dist-DrFRlZJz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([36,37,5]),import.meta.url).then(e=>e.wast())}}),le.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return ce(()=>import("./dist-DXT0W0hS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([38,39,5]),import.meta.url).then(e=>e.xml())}}),le.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return ce(()=>import("./dist-2qScxWoK.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([40,41,5]),import.meta.url).then(e=>e.yaml())}}),le.of({name:"APL",extensions:["dyalog","apl"],load(){return ce(()=>import("./apl-DpOiWl6J.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([42,43]),import.meta.url).then(e=>ye(e.apl))}}),le.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return ce(()=>import("./asciiarmor-DVIuYySe.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([44,45]),import.meta.url).then(e=>ye(e.asciiArmor))}}),le.of({name:"ASN.1",extensions:["asn","asn1"],load(){return ce(()=>import("./asn1-CWHjZJq6.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([46,47]),import.meta.url).then(e=>ye(e.asn1({})))}}),le.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return ce(()=>import("./asterisk-Cy-53Fu-.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.asterisk))}}),le.of({name:"Brainfuck",extensions:["b","bf"],load(){return ce(()=>import("./brainfuck-CIKJewgG.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([48,49]),import.meta.url).then(e=>ye(e.brainfuck))}}),le.of({name:"Cobol",extensions:["cob","cpy"],load(){return ce(()=>import("./cobol-Dw9T4cw-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>ye(e.cobol))}}),le.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return ce(()=>import("./clike-wo4CVrJj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.csharp))}}),le.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return ce(()=>import("./clojure-CTxjMkBI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>ye(e.clojure))}}),le.of({name:"ClojureScript",extensions:["cljs"],load(){return ce(()=>import("./clojure-CTxjMkBI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>ye(e.clojure))}}),le.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return ce(()=>import("./css-BJsW3aHa.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([56,57]),import.meta.url).then(e=>ye(e.gss))}}),le.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return ce(()=>import("./cmake-aJ0aGjat.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([58,59]),import.meta.url).then(e=>ye(e.cmake))}}),le.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return ce(()=>import("./coffeescript-B5HCKl_0.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([60,61]),import.meta.url).then(e=>ye(e.coffeeScript))}}),le.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return ce(()=>import("./commonlisp-C578hhl1.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([62,63]),import.meta.url).then(e=>ye(e.commonLisp))}}),le.of({name:"Cypher",extensions:["cyp","cypher"],load(){return ce(()=>import("./cypher-DBO3MHmN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([64,65]),import.meta.url).then(e=>ye(e.cypher))}}),le.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return ce(()=>import("./python-D4S7tVrv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([66,67]),import.meta.url).then(e=>ye(e.cython))}}),le.of({name:"Crystal",extensions:["cr"],load(){return ce(()=>import("./crystal-D84c1nzD.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([68,69]),import.meta.url).then(e=>ye(e.crystal))}}),le.of({name:"D",extensions:["d"],load(){return ce(()=>import("./d-KvHiAR3H.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([70,71]),import.meta.url).then(e=>ye(e.d))}}),le.of({name:"Dart",extensions:["dart"],load(){return ce(()=>import("./clike-wo4CVrJj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.dart))}}),le.of({name:"diff",extensions:["diff","patch"],load(){return ce(()=>import("./diff-BmUpKGx-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([72,73]),import.meta.url).then(e=>ye(e.diff))}}),le.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return ce(()=>import("./dockerfile-BPCA7-hu.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([74,75]),import.meta.url).then(e=>ye(e.dockerFile))}}),le.of({name:"DTD",extensions:["dtd"],load(){return ce(()=>import("./dtd-Dwf-AbUl.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([76,77]),import.meta.url).then(e=>ye(e.dtd))}}),le.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return ce(()=>import("./dylan-VHUB-7ez.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([78,79]),import.meta.url).then(e=>ye(e.dylan))}}),le.of({name:"EBNF",load(){return ce(()=>import("./ebnf-BdwTqLUx.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.ebnf))}}),le.of({name:"ECL",extensions:["ecl"],load(){return ce(()=>import("./ecl-DvGrObaA.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([80,81]),import.meta.url).then(e=>ye(e.ecl))}}),le.of({name:"edn",extensions:["edn"],load(){return ce(()=>import("./clojure-CTxjMkBI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>ye(e.clojure))}}),le.of({name:"Eiffel",extensions:["e"],load(){return ce(()=>import("./eiffel-CUYga93e.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([82,83]),import.meta.url).then(e=>ye(e.eiffel))}}),le.of({name:"Elm",extensions:["elm"],load(){return ce(()=>import("./elm-BhMhmEP6.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([84,85]),import.meta.url).then(e=>ye(e.elm))}}),le.of({name:"Erlang",extensions:["erl"],load(){return ce(()=>import("./erlang-D4xbdJFD.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([86,87]),import.meta.url).then(e=>ye(e.erlang))}}),le.of({name:"Esper",load(){return ce(()=>import("./sql-BNnXxKXA.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.esper))}}),le.of({name:"Factor",extensions:["factor"],load(){return ce(()=>import("./factor-C0grrWrC.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([88,89,75]),import.meta.url).then(e=>ye(e.factor))}}),le.of({name:"FCL",load(){return ce(()=>import("./fcl-BFWIADMy.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.fcl))}}),le.of({name:"Forth",extensions:["forth","fth","4th"],load(){return ce(()=>import("./forth-CSTdXn4A.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([90,91]),import.meta.url).then(e=>ye(e.forth))}}),le.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return ce(()=>import("./fortran-fENQO2l9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([92,93]),import.meta.url).then(e=>ye(e.fortran))}}),le.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return ce(()=>import("./mllike-BtxCpmpf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>ye(e.fSharp))}}),le.of({name:"Gas",extensions:["s"],load(){return ce(()=>import("./gas-CPJMP4zj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([96,97]),import.meta.url).then(e=>ye(e.gas))}}),le.of({name:"Gherkin",extensions:["feature"],load(){return ce(()=>import("./gherkin-CiUmN4EE.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([98,99]),import.meta.url).then(e=>ye(e.gherkin))}}),le.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return ce(()=>import("./groovy-DMooZA1X.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([100,101]),import.meta.url).then(e=>ye(e.groovy))}}),le.of({name:"Haskell",extensions:["hs"],load(){return ce(()=>import("./haskell-sDlThg6u.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([102,103]),import.meta.url).then(e=>ye(e.haskell))}}),le.of({name:"Haxe",extensions:["hx"],load(){return ce(()=>import("./haxe-Do80ITri.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>ye(e.haxe))}}),le.of({name:"HXML",extensions:["hxml"],load(){return ce(()=>import("./haxe-Do80ITri.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>ye(e.hxml))}}),le.of({name:"HTTP",load(){return ce(()=>import("./http-CgzOAOXj.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.http))}}),le.of({name:"IDL",extensions:["pro"],load(){return ce(()=>import("./idl-DFPg6k4F.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([106,107]),import.meta.url).then(e=>ye(e.idl))}}),le.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return ce(()=>import("./javascript-BGc4iHiT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([108,109]),import.meta.url).then(e=>ye(e.jsonld))}}),le.of({name:"Julia",extensions:["jl"],load(){return ce(()=>import("./julia-BHNHVraD.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([110,111]),import.meta.url).then(e=>ye(e.julia))}}),le.of({name:"Kotlin",extensions:["kt","kts"],load(){return ce(()=>import("./clike-wo4CVrJj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.kotlin))}}),le.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return ce(()=>import("./livescript-Bv2FpOTI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([112,113]),import.meta.url).then(e=>ye(e.liveScript))}}),le.of({name:"Lua",extensions:["lua"],load(){return ce(()=>import("./lua-BysKHKPZ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([114,115]),import.meta.url).then(e=>ye(e.lua))}}),le.of({name:"mIRC",extensions:["mrc"],load(){return ce(()=>import("./mirc-D5fMSrXQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([116,117]),import.meta.url).then(e=>ye(e.mirc))}}),le.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return ce(()=>import("./mathematica-BBTHoTvM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([118,119]),import.meta.url).then(e=>ye(e.mathematica))}}),le.of({name:"Modelica",extensions:["mo"],load(){return ce(()=>import("./modelica-CRQcZpK6.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([120,121]),import.meta.url).then(e=>ye(e.modelica))}}),le.of({name:"MUMPS",extensions:["mps"],load(){return ce(()=>import("./mumps-g7ooySbl.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([122,123]),import.meta.url).then(e=>ye(e.mumps))}}),le.of({name:"Mbox",extensions:["mbox"],load(){return ce(()=>import("./mbox-DeT9_lvk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([124,125]),import.meta.url).then(e=>ye(e.mbox))}}),le.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return ce(()=>import("./nginx-CFpObAqg.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.nginx))}}),le.of({name:"NSIS",extensions:["nsh","nsi"],load(){return ce(()=>import("./nsis-BtyCmCHZ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([126,127,75]),import.meta.url).then(e=>ye(e.nsis))}}),le.of({name:"NTriples",extensions:["nt","nq"],load(){return ce(()=>import("./ntriples-DLyxF-NO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([128,129]),import.meta.url).then(e=>ye(e.ntriples))}}),le.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return ce(()=>import("./clike-wo4CVrJj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.objectiveC))}}),le.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return ce(()=>import("./clike-wo4CVrJj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.objectiveCpp))}}),le.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return ce(()=>import("./mllike-BtxCpmpf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>ye(e.oCaml))}}),le.of({name:"Octave",extensions:["m"],load(){return ce(()=>import("./octave-CFXP_zzr.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([130,131]),import.meta.url).then(e=>ye(e.octave))}}),le.of({name:"Oz",extensions:["oz"],load(){return ce(()=>import("./oz-CrQbC0N_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([132,133]),import.meta.url).then(e=>ye(e.oz))}}),le.of({name:"Pascal",extensions:["p","pas"],load(){return ce(()=>import("./pascal-CCSZgYZH.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([134,135]),import.meta.url).then(e=>ye(e.pascal))}}),le.of({name:"Perl",extensions:["pl","pm"],load(){return ce(()=>import("./perl-Bc1MycMl.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([136,137]),import.meta.url).then(e=>ye(e.perl))}}),le.of({name:"Pig",extensions:["pig"],load(){return ce(()=>import("./pig-CDr04RdE.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([138,139]),import.meta.url).then(e=>ye(e.pig))}}),le.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return ce(()=>import("./powershell-DcvrUwmh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([140,141]),import.meta.url).then(e=>ye(e.powerShell))}}),le.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return ce(()=>import("./properties-Y8OgFJMt.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([142,143]),import.meta.url).then(e=>ye(e.properties))}}),le.of({name:"ProtoBuf",extensions:["proto"],load(){return ce(()=>import("./protobuf-Dyx-ENis.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([144,145]),import.meta.url).then(e=>ye(e.protobuf))}}),le.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return ce(()=>import("./pug-T7qjkmFh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([146,147,109]),import.meta.url).then(e=>ye(e.pug))}}),le.of({name:"Puppet",extensions:["pp"],load(){return ce(()=>import("./puppet-BzYSg90u.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([148,149]),import.meta.url).then(e=>ye(e.puppet))}}),le.of({name:"Q",extensions:["q"],load(){return ce(()=>import("./q-YpqabiSl.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([150,151]),import.meta.url).then(e=>ye(e.q))}}),le.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return ce(()=>import("./r-DzpuVbmQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([152,153]),import.meta.url).then(e=>ye(e.r))}}),le.of({name:"RPM Changes",load(){return ce(()=>import("./rpm-DlmAEsH3.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>ye(e.rpmChanges))}}),le.of({name:"RPM Spec",extensions:["spec"],load(){return ce(()=>import("./rpm-DlmAEsH3.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>ye(e.rpmSpec))}}),le.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return ce(()=>import("./ruby-BHSBK3B4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([156,157]),import.meta.url).then(e=>ye(e.ruby))}}),le.of({name:"SAS",extensions:["sas"],load(){return ce(()=>import("./sas-DmQmrPAn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([158,159]),import.meta.url).then(e=>ye(e.sas))}}),le.of({name:"Scala",extensions:["scala"],load(){return ce(()=>import("./clike-wo4CVrJj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.scala))}}),le.of({name:"Scheme",extensions:["scm","ss"],load(){return ce(()=>import("./scheme-CZHvt0eC.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([160,161]),import.meta.url).then(e=>ye(e.scheme))}}),le.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return ce(()=>import("./shell-BJzvpTMz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([162,163]),import.meta.url).then(e=>ye(e.shell))}}),le.of({name:"Sieve",extensions:["siv","sieve"],load(){return ce(()=>import("./sieve-DGjPhm-6.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([164,165]),import.meta.url).then(e=>ye(e.sieve))}}),le.of({name:"Smalltalk",extensions:["st"],load(){return ce(()=>import("./smalltalk-DaG60CSr.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([166,167]),import.meta.url).then(e=>ye(e.smalltalk))}}),le.of({name:"Solr",load(){return ce(()=>import("./solr-BkyoAXqg.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.solr))}}),le.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return ce(()=>import("./mllike-BtxCpmpf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>ye(e.sml))}}),le.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return ce(()=>import("./sparql-CN49rXKB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([168,169]),import.meta.url).then(e=>ye(e.sparql))}}),le.of({name:"Spreadsheet",alias:["excel","formula"],load(){return ce(()=>import("./spreadsheet-7FZkhkVo.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.spreadsheet))}}),le.of({name:"Squirrel",extensions:["nut"],load(){return ce(()=>import("./clike-wo4CVrJj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.squirrel))}}),le.of({name:"Stylus",extensions:["styl"],load(){return ce(()=>import("./stylus-CzHZ_0CL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([170,171]),import.meta.url).then(e=>ye(e.stylus))}}),le.of({name:"Swift",extensions:["swift"],load(){return ce(()=>import("./swift-5fr5bTbW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([172,173]),import.meta.url).then(e=>ye(e.swift))}}),le.of({name:"sTeX",load(){return ce(()=>import("./stex-D6sqtveI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>ye(e.stex))}}),le.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return ce(()=>import("./stex-D6sqtveI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>ye(e.stex))}}),le.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return ce(()=>import("./verilog-hsHogyKv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>ye(e.verilog))}}),le.of({name:"Tcl",extensions:["tcl"],load(){return ce(()=>import("./tcl-D5oaR_GS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([178,179]),import.meta.url).then(e=>ye(e.tcl))}}),le.of({name:"Textile",extensions:["textile"],load(){return ce(()=>import("./textile-CJ5e8-7o.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([180,181]),import.meta.url).then(e=>ye(e.textile))}}),le.of({name:"TiddlyWiki",load(){return ce(()=>import("./tiddlywiki-DE5lnTl3.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.tiddlyWiki))}}),le.of({name:"Tiki wiki",load(){return ce(()=>import("./tiki-Dt9oCY2i.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.tiki))}}),le.of({name:"TOML",extensions:["toml"],load(){return ce(()=>import("./toml-D9QwsDZO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([182,183]),import.meta.url).then(e=>ye(e.toml))}}),le.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return ce(()=>import("./troff-DlwQJbfr.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([184,185]),import.meta.url).then(e=>ye(e.troff))}}),le.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return ce(()=>import("./ttcn-DUvoO9Vo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([186,187]),import.meta.url).then(e=>ye(e.ttcn))}}),le.of({name:"TTCN_CFG",extensions:["cfg"],load(){return ce(()=>import("./ttcn-cfg-Cj-t-B3M.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([188,189]),import.meta.url).then(e=>ye(e.ttcnCfg))}}),le.of({name:"Turtle",extensions:["ttl"],load(){return ce(()=>import("./turtle-DzvxCIjc.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([190,191]),import.meta.url).then(e=>ye(e.turtle))}}),le.of({name:"Web IDL",extensions:["webidl"],load(){return ce(()=>import("./webidl-CqjZNx5V.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([192,193]),import.meta.url).then(e=>ye(e.webIDL))}}),le.of({name:"VB.NET",extensions:["vb"],load(){return ce(()=>import("./vb-Caf126uo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([194,195]),import.meta.url).then(e=>ye(e.vb))}}),le.of({name:"VBScript",extensions:["vbs"],load(){return ce(()=>import("./vbscript-BgRl-LR8.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([196,197]),import.meta.url).then(e=>ye(e.vbScript))}}),le.of({name:"Velocity",extensions:["vtl"],load(){return ce(()=>import("./velocity-CpvfwasF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([198,199]),import.meta.url).then(e=>ye(e.velocity))}}),le.of({name:"Verilog",extensions:["v"],load(){return ce(()=>import("./verilog-hsHogyKv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>ye(e.verilog))}}),le.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return ce(()=>import("./vhdl-FciHazR1.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([200,201]),import.meta.url).then(e=>ye(e.vhdl))}}),le.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return ce(()=>import("./xquery-DpTaL2IT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([202,203]),import.meta.url).then(e=>ye(e.xQuery))}}),le.of({name:"Yacas",extensions:["ys"],load(){return ce(()=>import("./yacas-D6bbkHsk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([204,205]),import.meta.url).then(e=>ye(e.yacas))}}),le.of({name:"Z80",extensions:["z80"],load(){return ce(()=>import("./z80-MlujNizn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([206,207]),import.meta.url).then(e=>ye(e.z80))}}),le.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return ce(()=>import("./mscgen-BfscU11q.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>ye(e.mscgen))}}),le.of({name:"X\xF9",extensions:["xu"],load(){return ce(()=>import("./mscgen-BfscU11q.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>ye(e.xu))}}),le.of({name:"MsGenny",extensions:["msgenny"],load(){return ce(()=>import("./mscgen-BfscU11q.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>ye(e.msgenny))}}),le.of({name:"Vue",extensions:["vue"],load(){return ce(()=>import("./dist-QPLTo43F.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([210,9,5,13,14,4,211]),import.meta.url).then(e=>e.vue())}}),le.of({name:"Angular Template",load(){return ce(()=>import("./dist-C0QU3Oay.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([212,9,5,13,14,4]),import.meta.url).then(e=>e.angular())}})],Vg=new WeakMap,Jk=/(\n|\r\n?|\u2028|\u2029)/g,Xk=/^\s*/,Yk=/\S/,Zk=Array.prototype.slice,Vd=48,$g=57,Wg=97,eS=102,Ug=65,tS=70;zl=function(e){if(typeof e=="string")return Gg([e])[0];if(typeof e=="function")return function(){let o=Zk.call(arguments);return o[0]=Qg(o[0]),e.apply(this,o)};let n=Qg(e),i=Kg(n,0);for(let o=1;o<n.length;o++)i+=arguments[o]+Kg(n,o);return i};function Kg(e,n){let i=e[n];if(i===void 0)throw TypeError(`invalid cooked string at index ${n}`);return i}function Qg(e){let n=Vg.get(e);if(n)return n;let i=Gg(e.raw),o=i.map(rS);return Object.defineProperty(o,"raw",{value:Object.freeze(i)}),Object.freeze(o),Vg.set(e,o),o}function Gg(e){let n=e.map(s=>s.split(Jk)),i;for(let s=0;s<n.length;s++){let c=n[s],d=s===0,f=s+1===n.length;if(d){if(c.length===1||c[0].length>0)throw Error("invalid content on opening line");c[1]=""}if(f){if(c.length===1||Yk.test(c[c.length-1]))throw Error("invalid content on closing line");c[c.length-2]="",c[c.length-1]=""}for(let p=2;p<c.length;p+=2){let y=c[p],w=p+1===c.length&&!f,_=Xk.exec(y)[0];if(!w&&_.length===y.length){c[p]="";continue}i=nS(_,i)}}let o=i?i.length:0;return n.map(s=>{let c=s[0];for(let d=1;d<s.length;d+=2){let f=s[d],p=s[d+1];c+=f+p.slice(o)}return c})}function nS(e,n){if(n===void 0||e===n)return e;let i=0;for(let o=Math.min(e.length,n.length);i<o&&e[i]===n[i];i++);return e.slice(0,i)}function rS(e){let n="",i=0,o=0;for(;(o=e.indexOf("\\",o))>-1;){if(n+=e.slice(i,o),++o===e.length)return;let s=e[o++];switch(s){case"b":n+="\b";break;case"t":n+=" ";break;case"n":n+=`
63
+ """, engine=${o})`}return`_df = mo.sql(f'SELECT "${n}" FROM ${e.name} LIMIT 100')`},A_=function(e,n){if(n==="date"||n==="datetime"||n==="time"){if(e==="min")return"Earliest";if(e==="max")return"Latest"}return e};function Tk(){return{tables:[],expandedTables:new Set,expandedColumns:new Set,columnsPreviews:new Map}}var{reducer:BD,createActions:HD,valueAtom:Eg,useActions:Rk}=Ml(Tk,{addDatasets:(e,n)=>{let{previewDatasetColumn:i}=Vi();for(let f of n.tables)for(let p of f.columns){let y=`${f.name}:${p.name}`;e.expandedColumns.has(y)&&i({tableName:f.name,columnName:p.name,source:f.source,sourceType:f.source_type})}let o=e.tables;n.clear_channel&&(o=o.filter(f=>f.source!==n.clear_channel));let s=[...n.tables,...o],c=new Set,d=s.filter(f=>{let p=`${f.name}:${f.source}`;return c.has(p)?!1:(c.add(p),!0)}).sort((f,p)=>f.name.localeCompare(p.name));return{...e,tables:d}},filterDatasetsFromVariables:(e,n)=>{let i=new Set(n),o=e.tables.filter(s=>s.variable_name?i.has(s.variable_name):!0);return{...e,tables:o}},toggleTable:(e,n)=>{let i=new Set(e.expandedTables);return i.has(n)?i.delete(n):i.add(n),{...e,expandedTables:i}},toggleColumn:(e,n)=>{let i=`${n.table}:${n.column}`,o=new Set(e.expandedColumns);return o.has(i)?o.delete(i):o.add(i),{...e,expandedColumns:o}},closeAllColumns:e=>({...e,expandedColumns:new Set}),addColumnPreview:(e,n)=>{let i=`${n.table_name}:${n.column_name}`,o=new Map(e.columnsPreviews);return o.set(i,n),{...e,columnsPreviews:o}}});J_=()=>Zn(Eg),Uu=ze(e=>e(Eg).tables),V_=ze(new Set),R_=ze(!1),v_=function(){return Rk()};var Dk=new Map([[Ui,{name:Ui,dialect:"duckdb",source:"duckdb",display_name:"DuckDB (In-Memory)",databases:[]}]]);function Ok(){return{latestEngineSelected:Ui,connectionsMap:Dk}}let Pk,Mk;({reducer:Pk,createActions:Mk,valueAtom:ko,useActions:K_}=Ml(Ok,{addDataSourceConnection:(e,n)=>{if(n.connections.length===0)return e;let{latestEngineSelected:i,connectionsMap:o}=e,s=new Map(o);for(let c of n.connections)s.set(c.name,c);return{latestEngineSelected:i,connectionsMap:s}},filterDataSourcesFromVariables:(e,n)=>{let{latestEngineSelected:i,connectionsMap:o}=e,s=new Set(n),c=new Map([...o].filter(([d])=>xo.has(d)?!0:s.has(d)));return{latestEngineSelected:c.has(i)?i:Ui,connectionsMap:c}},clearDataSourceConnections:()=>({latestEngineSelected:Ui,connectionsMap:new Map}),removeDataSourceConnection:(e,n)=>{let{latestEngineSelected:i,connectionsMap:o}=e,s=new Map(o);return s.delete(n),{latestEngineSelected:s.has(i)?i:Ui,connectionsMap:s}},addTableList:(e,n)=>{let{tables:i,sqlTableContext:o}=n,{connectionsMap:s,latestEngineSelected:c}=e,d=o.engine,f=s.get(d);if(!f)return e;let p=new Map(s),y={...f,databases:f.databases.map(w=>w.name===o.database?{...w,schemas:w.schemas.map(_=>_.name===o.schema?{..._,tables:i}:_)}:w)};return p.set(d,y),{latestEngineSelected:c,connectionsMap:p}},addTable:(e,n)=>{let{table:i,sqlTableContext:o}=n,{connectionsMap:s,latestEngineSelected:c}=e,d=o.engine,f=i.name,p=s.get(d);if(!p)return e;let y=new Map(s),w={...p,databases:p.databases.map(_=>_.name===o.database?{..._,schemas:_.schemas.map(C=>{if(C.name!==o.schema)return C;let E=C.tables.length===0?[i]:C.tables.map(T=>T.name===f?i:T);return{...C,tables:E}})}:_)};return y.set(d,w),{latestEngineSelected:c,connectionsMap:y}}})),Gu=ze(e=>e(ko).connectionsMap);function Tg(e){let n=lt.get(ko);n.connectionsMap.has(e)&&lt.set(ko,{...n,latestEngineSelected:e})}Tw=ze(e=>{let n=lt.get(Uu),i=e(ko).connectionsMap,o=new Map;for(let s of n)o.set(s.name,s);for(let s of i.values())for(let c of s.databases){let d=c.name===s.default_database||s.databases.length===1;for(let f of c.schemas){let p=f.name===s.default_schema,y=Ul(f.name);for(let w of f.tables){let _;if(_=w.name,y){_=d?w.name:`${c.name}.${w.name}`,o.has(_)?Se.warn(`Table name collision for ${_}. Skipping.`):o.set(_,w);continue}if(d&&p&&!o.has(_)){o.set(_,w);continue}if(_=`${f.name}.${w.name}`,d&&!o.has(_)){o.set(_,w);continue}_=`${c.name}.${f.name}.${w.name}`,o.has(_)?Se.warn(`Table name collision for ${_}. Skipping.`):o.set(_,w)}}}return o}),B_=function(e){return e.variable_name?"dataframe":"table"};let nc,jd,Rg,zd,Dg,Og,Fd,Pg;nc=class{constructor(e,n={}){ke(this,"cache",new Map);this.maxSize=e,this.options=n}getOrCreate(e){In(this.options.create,"create function is required");let n=this.cache.get(e);if(n!==void 0)return n;let i=this.options.create(e);return this.cache.set(e,i),i}get(e){let n=this.cache.get(e);return n!==void 0&&(this.cache.delete(e),this.cache.set(e,n)),n}set(e,n){if(this.cache.has(e)&&this.cache.delete(e),this.cache.set(e,n),this.cache.size>this.maxSize){let i=this.cache.keys().next().value;i!==void 0&&this.cache.delete(i)}}keys(){return this.cache.keys()}values(){return this.cache.values()}entries(){return this.cache.entries()}delete(e){this.cache.delete(e)}},Yh=Tt("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),fm=Tt("book-marked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]),sm=Tt("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),um=Tt("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]),Vh=Tt("braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]),jd=Tt("calendar-clock",[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]),Dm=Tt("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),$h=Tt("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),qh=Tt("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Rg=Tt("cog",[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]]),om=Tt("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]),zd=Tt("database-backup",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 12a9 3 0 0 0 5 2.69",key:"1ui2ym"}],["path",{d:"M21 9.3V5",key:"6k6cib"}],["path",{d:"M3 5v14a9 3 0 0 0 6.47 2.88",key:"i62tjy"}],["path",{d:"M12 12v4h4",key:"1bxaet"}],["path",{d:"M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16",key:"1f4ei9"}]]),Es=Tt("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),ju=Tt("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),nm=Tt("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),Dg=Tt("folder-tree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]),Nu=Tt("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Og=Tt("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]),So=Tt("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),Zh=Tt("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),Wh=Tt("notebook-pen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]]),zh=Tt("paint-roller",[["rect",{width:"16",height:"6",x:"2",y:"2",rx:"2",key:"jcyz7m"}],["path",{d:"M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2",key:"1b9h7c"}],["rect",{width:"4",height:"6",x:"8",y:"16",rx:"1",key:"d6e7yl"}]]),Nh=Tt("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),Fd=Tt("search-check",[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),Pg=Tt("square-dashed-bottom-code",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"M14 21h1",key:"v9vybs"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["path",{d:"M5 21a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2",key:"as5y1o"}],["path",{d:"M9 21h1",key:"15o7lz"}]]),Jh=Tt("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]),bo=Tt("table-2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]),Qh=Tt("text-search",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M10 12H3",key:"1ulcyk"}],["path",{d:"M10 19H3",key:"108z41"}],["circle",{cx:"17",cy:"15",r:"3",key:"1upz2a"}],["path",{d:"m21 19-1.9-1.9",key:"dwi7p8"}]]),Sm=Tt("variable",[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]]),Nl=function(e){switch(e){case"duckdb":return"DuckDB";case"motherduck":return"MotherDuck";case"sqlite":return"SQLite";case"postgres":case"postgresql":return"PostgreSQL";case"mysql":return"MySQL";case"mariadb":return"MariaDB";case"mssql":case"microsoft sql server":return"Microsoft SQL Server";case"oracle":return"Oracle";case"redshift":return"Amazon Redshift";case"snowflake":return"Snowflake";case"bigquery":return"Google BigQuery";case"clickhouse":return"ClickHouse";case"timeplus":return"Timeplus";case"databricks":return"Databricks";case"db2":return"IBM Db2";case"hive":return"Apache Hive";case"impala":return"Apache Impala";case"presto":return"Presto";case"trino":return"Trino";case"cockroachdb":return"CockroachDB";case"timescaledb":return"TimescaleDB";case"singlestore":return"SingleStore";case"cassandra":return"Apache Cassandra";case"mongodb":return"MongoDB";case"iceberg":return"Apache Iceberg";default:return e}};function Mg(e){let[n,i]=e.split(" ");return i?`${Nl(n)} ${i}`:Nl(e)}Fu={boolean:d4,date:f4,time:qh,datetime:jd,temporal:jd,number:yh,string:p4,integer:yh,unknown:Vh},M_=function(e){switch(e){case"boolean":return"bg-(--orange-4)";case"date":case"time":case"datetime":case"temporal":return"bg-(--grass-4) dark:bg-(--grass-5)";case"number":case"integer":return"bg-(--purple-4)";case"string":return"bg-(--blue-4)";case"unknown":return"bg-(--slate-4) dark:bg-(--slate-6)";default:return _s(e),"bg-(--slate-4) dark:bg-(--slate-6)"}};let Ps,B,Lg,Bd,Ng,Lo,Ig,Ag,qg,jg,zg,No,ei,za,pi,Hd;Da=class{constructor(e,n){this.singular=e,this._plural=n}pluralize(e){return e===1?this.singular:this.plural}get plural(){return this._plural??`${this.singular}s`}},qw=class gx{constructor(n){this.words=n}static of(...n){return new gx(n.map(i=>typeof i=="string"?new Da(i):i))}join(n,i){return this.words.map(o=>o.pluralize(i)).join(n)}},Ps=Jr(),B=gh(_4(),1),Lg=5,Bd={boolean:"bg-[var(--orange-4)] text-[var(--orange-11)]",date:"bg-[var(--grass-4)] text-[var(--grass-11)]",time:"bg-[var(--grass-4)] text-[var(--grass-11)]",datetime:"bg-[var(--grass-4)] text-[var(--grass-11)]",number:"bg-[var(--purple-4)] text-[var(--purple-11)]",integer:"bg-[var(--purple-4)] text-[var(--purple-11)]",string:"bg-[var(--blue-4)] text-[var(--blue-11)]",unknown:"bg-[var(--slate-4)] text-[var(--slate-11)]"},Ng={local:"bg-[var(--blue-4)] text-[var(--blue-11)]",duckdb:"bg-[var(--amber-4)] text-[var(--amber-11)]",connection:"bg-[var(--green-4)] text-[var(--green-11)]",catalog:"bg-[var(--purple-4)] text-[var(--purple-11)]"},Lo="p-3 min-w-[250px] flex flex-col divide-y",Ig=new Da("column","columns"),Ag=new Da("row","rows"),qg=new Da("schema","schemas"),jg=new Da("table","tables"),zg=new Da("database","databases"),No=e=>{let n=(0,Ps.c)(6),{icon:i,title:o,badge:s}=e,c;n[0]===o?c=n[1]:(c=(0,B.jsx)("h3",{className:"font-semibold text-sm",children:o}),n[0]=o,n[1]=c);let d;return n[2]!==s||n[3]!==i||n[4]!==c?(d=(0,B.jsxs)("div",{className:"flex items-center gap-2 pb-2",children:[i,c,s]}),n[2]=s,n[3]=i,n[4]=c,n[5]=d):d=n[5],d},ei=e=>{let n=(0,Ps.c)(5),{label:i,value:o}=e,s;n[0]===i?s=n[1]:(s=(0,B.jsxs)("span",{className:"text-[var(--slate-11)]",children:[i,":"]}),n[0]=i,n[1]=s);let c;return n[2]!==s||n[3]!==o?(c=(0,B.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[s,o]}),n[2]=s,n[3]=o,n[4]=c):c=n[4],c},za=e=>{let n=(0,Ps.c)(5),{icon:i,text:o}=e,s;n[0]===o?s=n[1]:(s=(0,B.jsx)("span",{className:"text-xs text-[var(--slate-11)]",children:o}),n[0]=o,n[1]=s);let c;return n[2]!==i||n[3]!==s?(c=(0,B.jsxs)("div",{className:"flex items-center gap-1",children:[i,s]}),n[2]=i,n[3]=s,n[4]=c):c=n[4],c},pi=e=>{let n=(0,Ps.c)(15),{title:i,items:o,totalCount:s,limit:c}=e,d=i===void 0?"":i,f=c===void 0?Lg:c;if(o.length===0)return null;let p;n[0]!==o||n[1]!==f?(p=o.slice(0,f),n[0]=o,n[1]=f,n[2]=p):p=n[2];let y=p,w=s>f,_;n[3]===d?_=n[4]:(_=d&&(0,B.jsxs)("h4",{className:"text-xs font-medium text-[var(--slate-11)] mb-2",children:[d,":"]}),n[3]=d,n[4]=_);let C;n[5]!==w||n[6]!==f||n[7]!==s?(C=w&&(0,B.jsxs)("div",{className:"text-xs text-[var(--slate-10)] text-center py-1",children:["... and ",s-f," more"]}),n[5]=w,n[6]=f,n[7]=s,n[8]=C):C=n[8];let E;n[9]!==C||n[10]!==y?(E=(0,B.jsxs)("div",{className:"flex flex-col gap-1 overflow-y-auto",children:[y,C]}),n[9]=C,n[10]=y,n[11]=E):E=n[11];let T;return n[12]!==_||n[13]!==E?(T=(0,B.jsxs)("div",{className:"py-2",children:[_,E]}),n[12]=_,n[13]=E,n[14]=T):T=n[14],T},Hd=e=>Bd[e]||Bd.unknown;const Lk=e=>{var d,f;let n=e.type==="view"?(0,B.jsx)(ju,{className:"w-4 h-4 text-[var(--blue-9)]"}):(0,B.jsx)(bo,{className:"w-4 h-4 text-[var(--green-9)]"}),i=(0,B.jsx)(mr,{variant:"secondary",className:`text-xs ${e.type==="view"?"bg-[var(--blue-4)] text-[var(--blue-11)]":"bg-[var(--green-4)] text-[var(--green-11)]"}`,children:e.type}),o=e.columns.map(p=>{let y=Fu[p.type];return(0,B.jsxs)("div",{className:"flex items-center justify-between text-xs rounded",children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(y,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,B.jsx)("span",{className:"font-mono",children:p.name})]}),(0,B.jsx)(mr,{variant:"outline",className:`text-xs ${Hd(p.type)}`,children:p.type})]},p.name)}),s=e.primary_keys&&e.primary_keys.length>0,c=e.indexes&&e.indexes.length>0;return(0,B.jsxs)("div",{className:`${Lo} min-w-[300px]`,children:[(0,B.jsx)(No,{icon:n,title:e.name,badge:i}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,B.jsx)(ei,{label:"Source",value:(0,B.jsx)(mr,{variant:"outline",className:`text-xs ${Ng[e.source_type]}`,children:e.source})}),e.variable_name&&(0,B.jsx)(ei,{label:"Variable",value:(0,B.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.variable_name})}),e.engine&&(0,B.jsx)(ei,{label:"Engine",value:(0,B.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.engine})})]}),(e.num_columns!=null||e.num_rows!=null)&&(0,B.jsxs)("div",{className:"grid grid-cols-2 gap-2 py-2",children:[e.num_columns!=null&&(0,B.jsx)(za,{icon:(0,B.jsx)(om,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_columns} ${Ig.pluralize(e.num_columns)}`}),e.num_rows!=null&&(0,B.jsx)(za,{icon:(0,B.jsx)(yh,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_rows} ${Ag.pluralize(e.num_rows)}`})]}),e.columns.length===0&&rc("column"),(s||c)&&(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[s&&(0,B.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,B.jsxs)("div",{className:"flex items-center gap-1",children:[(0,B.jsx)(_D,{className:"w-3 h-3 text-[var(--amber-9)]"}),(0,B.jsx)("span",{className:"text-xs font-medium text-[var(--slate-11)]",children:"Primary Keys:"})]}),(d=e.primary_keys)==null?void 0:d.map(p=>(0,B.jsx)(mr,{variant:"outline",className:"text-xs text-[var(--slate-11)]",children:p},p))]}),c&&(0,B.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,B.jsxs)("div",{className:"flex items-center gap-1 mb-1",children:[(0,B.jsx)(fm,{className:"w-3 h-3 text-[var(--purple-9)]"}),(0,B.jsx)("span",{className:"text-xs font-medium text-[var(--slate-11)]",children:"Indexes:"})]}),(f=e.indexes)==null?void 0:f.map(p=>(0,B.jsx)(mr,{variant:"outline",className:"text-xs text-[var(--slate-11)]",children:p},p))]})]}),e.columns.length>0&&(0,B.jsx)(pi,{items:o,totalCount:e.columns.length})]})},Nk=e=>{var s;let n=Fu[e.type],i=(0,B.jsx)(mr,{variant:"outline",className:`text-xs ${Hd(e.type)}`,children:e.type}),o=((s=e.sample_values)==null?void 0:s.map((c,d)=>(0,B.jsx)("div",{className:"text-xs bg-[var(--slate-3)] rounded font-mono",children:c==null?"null":String(c)},d)))||[];return(0,B.jsxs)("div",{className:Lo,children:[(0,B.jsx)(No,{icon:(0,B.jsx)(n,{className:"w-4 h-4 text-[var(--slate-9)]"}),title:e.name,badge:i}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 mt-2",children:[(0,B.jsx)(ei,{label:"Type",value:(0,B.jsx)("span",{className:"font-medium",children:e.type})}),(0,B.jsx)(ei,{label:"External Type",value:(0,B.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.external_type})})]}),e.sample_values&&e.sample_values.length>0&&(0,B.jsx)(pi,{title:"Sample Values",items:o,totalCount:e.sample_values.length})]})},Ik=e=>{let n=(0,B.jsx)(mr,{variant:"outline",className:"text-xs bg-[var(--blue-4)] text-[var(--blue-11)]",children:e.dialect}),i=e.schemas.map(o=>(0,B.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-[var(--slate-3)]",children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(So,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,B.jsx)("span",{children:o.name})]}),(0,B.jsxs)(mr,{variant:"outline",className:"text-xs",children:[o.tables.length," ",jg.pluralize(o.tables.length)]})]},o.name));return(0,B.jsxs)("div",{className:Lo,children:[(0,B.jsx)(No,{icon:(0,B.jsx)(Es,{className:"w-4 h-4 text-[var(--blue-9)]"}),title:e.name,badge:n}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,B.jsx)(ei,{label:"Dialect",value:(0,B.jsx)("span",{className:"font-medium",children:e.dialect})}),e.engine&&(0,B.jsx)(ei,{label:"Engine",value:(0,B.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.engine})})]}),(0,B.jsx)("div",{className:"py-2",children:(0,B.jsx)(za,{icon:(0,B.jsx)(So,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.schemas.length} schema${e.schemas.length===1?"":"s"}`})}),e.schemas.length===0&&rc("schema"),e.schemas.length>0&&(0,B.jsx)(pi,{title:"Schemas",items:i,totalCount:e.schemas.length})]})},Ak=e=>{let n=(0,B.jsx)(mr,{variant:"outline",className:"text-xs bg-[var(--green-4)] text-[var(--green-11)]",children:"Schema"}),i=e.tables.map(o=>(0,B.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-[var(--slate-3)]",children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[o.type==="view"?(0,B.jsx)(ju,{className:"w-3 h-3 text-[var(--blue-9)]"}):(0,B.jsx)(bo,{className:"w-3 h-3 text-[var(--green-9)]"}),(0,B.jsx)("span",{children:o.name})]}),(0,B.jsx)(mr,{variant:"outline",className:`text-xs ${o.type==="view"?"bg-[var(--blue-4)] text-[var(--blue-11)]":"bg-[var(--green-4)] text-[var(--green-11)]"}`,children:o.type})]},o.name));return(0,B.jsxs)("div",{className:Lo,children:[(0,B.jsx)(No,{icon:(0,B.jsx)(So,{className:"w-4 h-4 text-[var(--green-9)]"}),title:e.name,badge:n}),(0,B.jsx)("div",{className:"py-2",children:(0,B.jsx)(za,{icon:(0,B.jsx)(bo,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.tables.length} table${e.tables.length===1?"":"s"}`})}),e.tables.length===0&&rc("table"),e.tables.length>0&&(0,B.jsx)(pi,{title:"Tables",items:i,totalCount:e.tables.length})]})};var Fg=(0,B.jsx)(mr,{variant:"outline",children:"default"}),qk=8,Bg=3;let rc;i_=(e,n)=>{let i=e.databases.length,o=e.databases.reduce((p,y)=>p+y.schemas.length,0),s=(p,y)=>{if(p.tables.length===0)return null;let w=p.name===e.default_schema&&y,_=[];return o<qk&&(_=p.tables.slice(0,Bg+1).map(C=>(0,B.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,B.jsx)(bo,{className:"w-3 h-3 text-[var(--green-9)]"}),(0,B.jsx)("span",{className:"text-xs",children:C.name})]},C.name))),(0,B.jsxs)("div",{children:[(0,B.jsxs)("div",{className:"flex items-center gap-2 text-xs rounded hover:bg-[var(--slate-3)] ml-2",children:[(0,B.jsx)(So,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,B.jsx)("span",{children:p.name}),w&&Fg,(0,B.jsxs)(mr,{variant:"outline",className:"text-xs ml-auto",children:[p.tables.length," tables"]})]}),(0,B.jsx)(pi,{items:_,totalCount:p.tables.length,limit:Bg})]},p.name)},c=e.databases.map(p=>{let y=p.name===e.default_database||e.databases.length===1,w=p.schemas.map(_=>s(_,y));return(0,B.jsxs)("div",{children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(Es,{className:"w-3 h-3 text-[var(--blue-9)]"}),(0,B.jsx)("span",{className:"text-xs",children:p.name}),y&&Fg]}),w&&(0,B.jsx)(pi,{items:w,totalCount:p.schemas.length})]},p.name)}),d=e.name;xo.has(e.name)&&(d="In-Memory");let f=n==null?void 0:n.map(p=>(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(bo,{className:"w-3 h-3 text-[var(--blue-9)]"}),(0,B.jsx)("span",{className:"text-xs",children:p.name})]},p.name));return(0,B.jsxs)("div",{className:`${Lo} px-1`,children:[(0,B.jsx)(No,{icon:(0,B.jsx)(Rg,{className:"w-4 h-4 text-[var(--purple-9)]"}),title:d}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,B.jsx)(ei,{label:"Dialect",value:(0,B.jsx)("span",{className:"font-medium",children:Nl(e.dialect)})}),(0,B.jsx)(ei,{label:"Source",value:(0,B.jsx)(mr,{variant:"outline",className:"text-xs bg-[var(--green-4)] text-[var(--green-11)]",children:e.source})})]}),(0,B.jsxs)("div",{className:"flex flex-row justify-between py-2",children:[(0,B.jsx)(za,{icon:(0,B.jsx)(Es,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${i} ${zg.pluralize(i)}`}),(0,B.jsx)(za,{icon:(0,B.jsx)(So,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${o} ${qg.pluralize(o)}`})]}),i>0&&(0,B.jsx)(pi,{items:c,totalCount:i}),f&&f.length>0&&(0,B.jsx)(pi,{title:"Dataframes",items:f,totalCount:f.length})]})},rc=e=>(0,B.jsxs)("div",{className:"flex items-start gap-2 mt-3",children:[(0,B.jsx)(Nu,{size:10,className:"mt-1 text-[var(--slate-10)] shrink-0"}),(0,B.jsxs)("span",{className:"text-xs text-[var(--slate-11)]",children:["No ",e," information available.",`
64
+ `,(0,B.jsx)("span",{className:"text-[var(--blue-10)]",children:"Introspect to see more details."})]})]});var ic=od(),Hg=class{constructor(){ke(this,"schema",{})}addTable(e,n){let i={self:zk({table:n}),children:n.columns.map(o=>jk({column:o}))};return this.setAt([...e,n.name],i),this}addSchema(e,n){let i={self:Fk({namespace:n,path:e}),children:{}};return this.setAt(e,i),this}addDatabase(e,n){let i={self:Bk({namespace:n,path:e}),children:{}};return this.setAt(e,i),this}setAt(e,n){let i=this.schema;for(let o of e.slice(0,-1))i[o]||(i[o]={children:{}}),i=i[o].children;i[e[e.length-1]]=n}build(){return this.schema}reset(){return this.schema={},this}};function jk(e){return{label:e.column.name,type:"column",info:()=>{let n=document.createElement("div");return(0,ic.createRoot)(n).render(Nk(e.column)),{dom:n}}}}function zk(e){return{label:e.table.name,type:"table",info:()=>{let n=document.createElement("div");return(0,ic.createRoot)(n).render(Lk(e.table)),{dom:n}}}}function Fk(e){return{label:e.namespace.name,detail:e.path.join("."),type:"schema",info:()=>{let n=document.createElement("div");return(0,ic.createRoot)(n).render(Ak(e.namespace)),{dom:n}}}}function Bk(e){return{label:e.namespace.name,detail:e.path.join("."),type:"database",info:()=>{let n=document.createElement("div");return(0,ic.createRoot)(n).render(Ik(e.namespace)),{dom:n}}}}var Hk=ze(e=>{let n=e(Uu),i=new Hg;for(let o of n)i.addTable([],o);return i.build()}),Vk=class{constructor(){this.cache=new nc(10,{create:e=>this.getConnectionSchema(e)})}getConnection(e){return lt.get(Gu).get(e)}getConnectionSchema(e){var d;let{default_database:n,databases:i,default_schema:o}=e,s=new Hg,c=i.find(f=>f.name===n||i.length===1);if(((d=c??i[0])==null?void 0:d.schemas.some(f=>Ul(f.name)))??!1){for(let f of i){let p=f.name===(c==null?void 0:c.name),y=f.schemas.flatMap(w=>w.tables);s.addDatabase([f.name],f);for(let w of y)p?s.addTable([],w):s.addTable([f.name],w)}return{shouldAddLocalTables:!1,schema:s.build(),defaultSchema:c==null?void 0:c.name}}if(c)for(let f of c.schemas){s.addSchema([f.name],f);for(let p of f.tables)s.addTable([f.name],p)}for(let f of i){s.addDatabase([f.name],f);for(let p of f.schemas){s.addSchema([f.name,p.name],p);for(let y of p.tables)s.addTable([f.name,p.name],y)}}return{shouldAddLocalTables:!0,schema:s.build(),defaultSchema:o??void 0}}getInternalDialect(e){let n=this.getConnection(e);return n?n.dialect.toLowerCase():null}getDialect(e){let n=this.getConnection(e);return n?Cg(n):Ds}getCompletionSource(e){let n=this.getConnection(e);if(!n)return null;let i=()=>lt.get(Hk),o=this.cache.getOrCreate(n);return{dialect:Cg(n),schema:o.shouldAddLocalTables?{...o.schema,...i()}:o.schema,defaultSchema:o.defaultSchema,defaultTable:$k(n)}}};function $k(e){if(e.databases.length!==1)return;let n=e.databases[0];if(n.schemas.length!==1)return;let i=n.schemas[0];if(i.tables.length===1)return i.tables[0].name}const Fa=new Vk,Ms=Bi.define();dd=async function(e){let{sendFormat:n}=Vi(),i=ui.mapValues(e,s=>Xr(s)),o=await n({codes:i,lineLength:ew().formatting.line_length});for(let[s,c]of ui.entries(o.codes)){let d=s,f=i[d],p=e[d];p&&c!==f&&(p.state.facet(Pt).updateCellCode({cellId:d,code:c,formattingChange:!0}),_o(p,c))}},Iw=function(){return dd(_k(nd()))};async function Wk(e,n){let{formatDialect:i}=await ce(async()=>{let{formatDialect:_}=await import("./esm-DvGqZhsW.js").then(async C=>(await C.__tla,C));return{formatDialect:_}},__vite__mapDeps([0,1]),import.meta.url),o=await Uk(Fa.getInternalDialect(n)),s=e.state.field(Lr),c=x4(e.state);if(s.type!=="sql"){Se.error("Language adapter is not SQL");return}let d=e.state.doc.toString(),f;try{f=i(d,{dialect:o,tabWidth:c,useTabs:!1})}catch(_){Se.error("Error formatting SQL",{error:_});return}let p=s.transformIn(f)[0],y=e.state.facet(Pt),w=e.state.facet(ec);y.updateCellCode({cellId:w,code:p,formattingChange:!0}),Au(e,f,{effects:[Ms.of(!0)]})}async function Uk(e){let{bigquery:n,db2:i,db2i:o,duckdb:s,hive:c,mariadb:d,mysql:f,tidb:p,n1ql:y,plsql:w,postgresql:_,redshift:C,spark:E,sqlite:T,sql:I,trino:$,transactsql:V,singlestoredb:F,snowflake:N}=await ce(async()=>{let{bigquery:pe,db2:P,db2i:A,duckdb:W,hive:de,mariadb:fe,mysql:we,tidb:J,n1ql:be,plsql:Ce,postgresql:Z,redshift:re,spark:se,sqlite:Q,sql:Le,trino:Fe,transactsql:et,singlestoredb:Be,snowflake:je}=await import("./esm-DvGqZhsW.js").then(async Pe=>(await Pe.__tla,Pe));return{bigquery:pe,db2:P,db2i:A,duckdb:W,hive:de,mariadb:fe,mysql:we,tidb:J,n1ql:be,plsql:Ce,postgresql:Z,redshift:re,spark:se,sqlite:Q,sql:Le,trino:Fe,transactsql:et,singlestoredb:Be,snowflake:je}},__vite__mapDeps([0,1]),import.meta.url),K=I;if(!e||!tc(e))return K;switch(e){case"mysql":return f;case"mariadb":return d;case"postgres":case"postgresql":return _;case"sqlite":return T;case"db2":return i;case"db2i":return o;case"hive":return c;case"redshift":return C;case"snowflake":return N;case"trino":return $;case"tidb":return p;case"oracle":case"oracledb":return w;case"spark":return E;case"singlestoredb":return F;case"couchbase":return y;case"bigquery":return n;case"duckdb":return s;case"mssql":case"sqlserver":case"microsoft sql server":return V;case"athena":case"awsathena":case"cassandra":case"noql":case"flink":case"mongodb":case"timescaledb":case"datafusion":return I;case"databricks":return E;default:return _s(e),K}}var Kk=od();function Qk(e,n){let i=document.createElement("div"),o;return{dom:i,mount(){o=(0,Kk.createRoot)(i),o.render((0,B.jsx)(K2,{store:lt,children:(0,B.jsx)(n,{view:e})}))},update(){o==null||o.render((0,B.jsx)(K2,{store:lt,children:(0,B.jsx)(n,{view:e})}))},destroy(){o==null||o.unmount()}}}function ye(e){return new fw(uw.define(e))}function Zi(e){return ce(()=>import("./dist-Z4EybR_c.js").then(async n=>(await n.__tla,n)),__vite__mapDeps([2,3,4,5]),import.meta.url).then(n=>n.sql({dialect:n[e]}))}var Gk=[le.of({name:"C",extensions:["c","h","ino"],load(){return ce(()=>import("./dist-BuwU3nUf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,5]),import.meta.url).then(e=>e.cpp())}}),le.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return ce(()=>import("./dist-BuwU3nUf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,5]),import.meta.url).then(e=>e.cpp())}}),le.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Zi("Cassandra")}}),le.of({name:"CSS",extensions:["css"],load(){return ce(()=>import("./dist-B407S7D_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([8,9,5]),import.meta.url).then(e=>e.css())}}),le.of({name:"Go",extensions:["go"],load(){return ce(()=>import("./dist-h7FGpi6W.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([10,11,4,5]),import.meta.url).then(e=>e.go())}}),le.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return ce(()=>import("./dist-BSxIk2Vq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([12,9,5,13,14,4]),import.meta.url).then(e=>e.html())}}),le.of({name:"Java",extensions:["java"],load(){return ce(()=>import("./dist-8LCoAaYJ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([15,16,5]),import.meta.url).then(e=>e.java())}}),le.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return ce(()=>import("./dist-SpkGM8op.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript())}}),le.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return ce(()=>import("./dist-DzjeKTWA.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([18,9,5,13,14,4,19]),import.meta.url).then(e=>e.jinja())}}),le.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return ce(()=>import("./dist-BwcKpTZt.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([20,21,5]),import.meta.url).then(e=>e.json())}}),le.of({name:"JSX",extensions:["jsx"],load(){return ce(()=>import("./dist-SpkGM8op.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({jsx:!0}))}}),le.of({name:"LESS",extensions:["less"],load(){return ce(()=>import("./dist-B6bNYRJb.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([22,9,5,23]),import.meta.url).then(e=>e.less())}}),le.of({name:"Liquid",extensions:["liquid"],load(){return ce(()=>import("./dist-YQMqR1ri.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([24,9,5,13,14,4,25]),import.meta.url).then(e=>e.liquid())}}),le.of({name:"MariaDB SQL",load(){return Zi("MariaSQL")}}),le.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return ce(()=>import("./dist-DstaRs6N.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([26,9,5,13,14,4,27]),import.meta.url).then(e=>e.markdown())}}),le.of({name:"MS SQL",load(){return Zi("MSSQL")}}),le.of({name:"MySQL",load(){return Zi("MySQL")}}),le.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return ce(()=>import("./dist-1nstYXhq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([28,9,5,13,14,4,29]),import.meta.url).then(e=>e.php())}}),le.of({name:"PLSQL",extensions:["pls"],load(){return Zi("PLSQL")}}),le.of({name:"PostgreSQL",load(){return Zi("PostgreSQL")}}),le.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return ce(()=>import("./dist-Cip4Ndtd.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([30,31,4,5]),import.meta.url).then(e=>e.python())}}),le.of({name:"Rust",extensions:["rs"],load(){return ce(()=>import("./dist-BKMynip3.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([32,33,5]),import.meta.url).then(e=>e.rust())}}),le.of({name:"Sass",extensions:["sass"],load(){return ce(()=>import("./dist-BP1tfplb.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,9,5,35]),import.meta.url).then(e=>e.sass({indented:!0}))}}),le.of({name:"SCSS",extensions:["scss"],load(){return ce(()=>import("./dist-BP1tfplb.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,9,5,35]),import.meta.url).then(e=>e.sass())}}),le.of({name:"SQL",extensions:["sql"],load(){return Zi("StandardSQL")}}),le.of({name:"SQLite",load(){return Zi("SQLite")}}),le.of({name:"TSX",extensions:["tsx"],load(){return ce(()=>import("./dist-SpkGM8op.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),le.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return ce(()=>import("./dist-SpkGM8op.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({typescript:!0}))}}),le.of({name:"WebAssembly",extensions:["wat","wast"],load(){return ce(()=>import("./dist-DrFRlZJz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([36,37,5]),import.meta.url).then(e=>e.wast())}}),le.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return ce(()=>import("./dist-DXT0W0hS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([38,39,5]),import.meta.url).then(e=>e.xml())}}),le.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return ce(()=>import("./dist-2qScxWoK.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([40,41,5]),import.meta.url).then(e=>e.yaml())}}),le.of({name:"APL",extensions:["dyalog","apl"],load(){return ce(()=>import("./apl-DpOiWl6J.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([42,43]),import.meta.url).then(e=>ye(e.apl))}}),le.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return ce(()=>import("./asciiarmor-DVIuYySe.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([44,45]),import.meta.url).then(e=>ye(e.asciiArmor))}}),le.of({name:"ASN.1",extensions:["asn","asn1"],load(){return ce(()=>import("./asn1-CWHjZJq6.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([46,47]),import.meta.url).then(e=>ye(e.asn1({})))}}),le.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return ce(()=>import("./asterisk-Cy-53Fu-.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.asterisk))}}),le.of({name:"Brainfuck",extensions:["b","bf"],load(){return ce(()=>import("./brainfuck-CIKJewgG.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([48,49]),import.meta.url).then(e=>ye(e.brainfuck))}}),le.of({name:"Cobol",extensions:["cob","cpy"],load(){return ce(()=>import("./cobol-Dw9T4cw-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>ye(e.cobol))}}),le.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return ce(()=>import("./clike-wo4CVrJj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.csharp))}}),le.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return ce(()=>import("./clojure-CTxjMkBI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>ye(e.clojure))}}),le.of({name:"ClojureScript",extensions:["cljs"],load(){return ce(()=>import("./clojure-CTxjMkBI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>ye(e.clojure))}}),le.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return ce(()=>import("./css-BJsW3aHa.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([56,57]),import.meta.url).then(e=>ye(e.gss))}}),le.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return ce(()=>import("./cmake-aJ0aGjat.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([58,59]),import.meta.url).then(e=>ye(e.cmake))}}),le.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return ce(()=>import("./coffeescript-B5HCKl_0.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([60,61]),import.meta.url).then(e=>ye(e.coffeeScript))}}),le.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return ce(()=>import("./commonlisp-C578hhl1.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([62,63]),import.meta.url).then(e=>ye(e.commonLisp))}}),le.of({name:"Cypher",extensions:["cyp","cypher"],load(){return ce(()=>import("./cypher-DBO3MHmN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([64,65]),import.meta.url).then(e=>ye(e.cypher))}}),le.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return ce(()=>import("./python-D4S7tVrv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([66,67]),import.meta.url).then(e=>ye(e.cython))}}),le.of({name:"Crystal",extensions:["cr"],load(){return ce(()=>import("./crystal-D84c1nzD.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([68,69]),import.meta.url).then(e=>ye(e.crystal))}}),le.of({name:"D",extensions:["d"],load(){return ce(()=>import("./d-KvHiAR3H.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([70,71]),import.meta.url).then(e=>ye(e.d))}}),le.of({name:"Dart",extensions:["dart"],load(){return ce(()=>import("./clike-wo4CVrJj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.dart))}}),le.of({name:"diff",extensions:["diff","patch"],load(){return ce(()=>import("./diff-BmUpKGx-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([72,73]),import.meta.url).then(e=>ye(e.diff))}}),le.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return ce(()=>import("./dockerfile-BPCA7-hu.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([74,75]),import.meta.url).then(e=>ye(e.dockerFile))}}),le.of({name:"DTD",extensions:["dtd"],load(){return ce(()=>import("./dtd-Dwf-AbUl.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([76,77]),import.meta.url).then(e=>ye(e.dtd))}}),le.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return ce(()=>import("./dylan-VHUB-7ez.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([78,79]),import.meta.url).then(e=>ye(e.dylan))}}),le.of({name:"EBNF",load(){return ce(()=>import("./ebnf-BdwTqLUx.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.ebnf))}}),le.of({name:"ECL",extensions:["ecl"],load(){return ce(()=>import("./ecl-DvGrObaA.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([80,81]),import.meta.url).then(e=>ye(e.ecl))}}),le.of({name:"edn",extensions:["edn"],load(){return ce(()=>import("./clojure-CTxjMkBI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>ye(e.clojure))}}),le.of({name:"Eiffel",extensions:["e"],load(){return ce(()=>import("./eiffel-CUYga93e.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([82,83]),import.meta.url).then(e=>ye(e.eiffel))}}),le.of({name:"Elm",extensions:["elm"],load(){return ce(()=>import("./elm-BhMhmEP6.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([84,85]),import.meta.url).then(e=>ye(e.elm))}}),le.of({name:"Erlang",extensions:["erl"],load(){return ce(()=>import("./erlang-D4xbdJFD.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([86,87]),import.meta.url).then(e=>ye(e.erlang))}}),le.of({name:"Esper",load(){return ce(()=>import("./sql-BNnXxKXA.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.esper))}}),le.of({name:"Factor",extensions:["factor"],load(){return ce(()=>import("./factor-C0grrWrC.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([88,89,75]),import.meta.url).then(e=>ye(e.factor))}}),le.of({name:"FCL",load(){return ce(()=>import("./fcl-BFWIADMy.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.fcl))}}),le.of({name:"Forth",extensions:["forth","fth","4th"],load(){return ce(()=>import("./forth-CSTdXn4A.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([90,91]),import.meta.url).then(e=>ye(e.forth))}}),le.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return ce(()=>import("./fortran-fENQO2l9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([92,93]),import.meta.url).then(e=>ye(e.fortran))}}),le.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return ce(()=>import("./mllike-BtxCpmpf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>ye(e.fSharp))}}),le.of({name:"Gas",extensions:["s"],load(){return ce(()=>import("./gas-CPJMP4zj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([96,97]),import.meta.url).then(e=>ye(e.gas))}}),le.of({name:"Gherkin",extensions:["feature"],load(){return ce(()=>import("./gherkin-CiUmN4EE.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([98,99]),import.meta.url).then(e=>ye(e.gherkin))}}),le.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return ce(()=>import("./groovy-DMooZA1X.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([100,101]),import.meta.url).then(e=>ye(e.groovy))}}),le.of({name:"Haskell",extensions:["hs"],load(){return ce(()=>import("./haskell-sDlThg6u.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([102,103]),import.meta.url).then(e=>ye(e.haskell))}}),le.of({name:"Haxe",extensions:["hx"],load(){return ce(()=>import("./haxe-Do80ITri.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>ye(e.haxe))}}),le.of({name:"HXML",extensions:["hxml"],load(){return ce(()=>import("./haxe-Do80ITri.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>ye(e.hxml))}}),le.of({name:"HTTP",load(){return ce(()=>import("./http-CgzOAOXj.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.http))}}),le.of({name:"IDL",extensions:["pro"],load(){return ce(()=>import("./idl-DFPg6k4F.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([106,107]),import.meta.url).then(e=>ye(e.idl))}}),le.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return ce(()=>import("./javascript-BGc4iHiT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([108,109]),import.meta.url).then(e=>ye(e.jsonld))}}),le.of({name:"Julia",extensions:["jl"],load(){return ce(()=>import("./julia-BHNHVraD.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([110,111]),import.meta.url).then(e=>ye(e.julia))}}),le.of({name:"Kotlin",extensions:["kt","kts"],load(){return ce(()=>import("./clike-wo4CVrJj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.kotlin))}}),le.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return ce(()=>import("./livescript-Bv2FpOTI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([112,113]),import.meta.url).then(e=>ye(e.liveScript))}}),le.of({name:"Lua",extensions:["lua"],load(){return ce(()=>import("./lua-BysKHKPZ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([114,115]),import.meta.url).then(e=>ye(e.lua))}}),le.of({name:"mIRC",extensions:["mrc"],load(){return ce(()=>import("./mirc-D5fMSrXQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([116,117]),import.meta.url).then(e=>ye(e.mirc))}}),le.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return ce(()=>import("./mathematica-BBTHoTvM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([118,119]),import.meta.url).then(e=>ye(e.mathematica))}}),le.of({name:"Modelica",extensions:["mo"],load(){return ce(()=>import("./modelica-CRQcZpK6.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([120,121]),import.meta.url).then(e=>ye(e.modelica))}}),le.of({name:"MUMPS",extensions:["mps"],load(){return ce(()=>import("./mumps-g7ooySbl.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([122,123]),import.meta.url).then(e=>ye(e.mumps))}}),le.of({name:"Mbox",extensions:["mbox"],load(){return ce(()=>import("./mbox-DeT9_lvk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([124,125]),import.meta.url).then(e=>ye(e.mbox))}}),le.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return ce(()=>import("./nginx-CFpObAqg.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.nginx))}}),le.of({name:"NSIS",extensions:["nsh","nsi"],load(){return ce(()=>import("./nsis-BtyCmCHZ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([126,127,75]),import.meta.url).then(e=>ye(e.nsis))}}),le.of({name:"NTriples",extensions:["nt","nq"],load(){return ce(()=>import("./ntriples-DLyxF-NO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([128,129]),import.meta.url).then(e=>ye(e.ntriples))}}),le.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return ce(()=>import("./clike-wo4CVrJj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.objectiveC))}}),le.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return ce(()=>import("./clike-wo4CVrJj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.objectiveCpp))}}),le.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return ce(()=>import("./mllike-BtxCpmpf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>ye(e.oCaml))}}),le.of({name:"Octave",extensions:["m"],load(){return ce(()=>import("./octave-CFXP_zzr.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([130,131]),import.meta.url).then(e=>ye(e.octave))}}),le.of({name:"Oz",extensions:["oz"],load(){return ce(()=>import("./oz-CrQbC0N_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([132,133]),import.meta.url).then(e=>ye(e.oz))}}),le.of({name:"Pascal",extensions:["p","pas"],load(){return ce(()=>import("./pascal-CCSZgYZH.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([134,135]),import.meta.url).then(e=>ye(e.pascal))}}),le.of({name:"Perl",extensions:["pl","pm"],load(){return ce(()=>import("./perl-Bc1MycMl.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([136,137]),import.meta.url).then(e=>ye(e.perl))}}),le.of({name:"Pig",extensions:["pig"],load(){return ce(()=>import("./pig-CDr04RdE.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([138,139]),import.meta.url).then(e=>ye(e.pig))}}),le.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return ce(()=>import("./powershell-DcvrUwmh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([140,141]),import.meta.url).then(e=>ye(e.powerShell))}}),le.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return ce(()=>import("./properties-Y8OgFJMt.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([142,143]),import.meta.url).then(e=>ye(e.properties))}}),le.of({name:"ProtoBuf",extensions:["proto"],load(){return ce(()=>import("./protobuf-Dyx-ENis.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([144,145]),import.meta.url).then(e=>ye(e.protobuf))}}),le.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return ce(()=>import("./pug-T7qjkmFh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([146,147,109]),import.meta.url).then(e=>ye(e.pug))}}),le.of({name:"Puppet",extensions:["pp"],load(){return ce(()=>import("./puppet-BzYSg90u.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([148,149]),import.meta.url).then(e=>ye(e.puppet))}}),le.of({name:"Q",extensions:["q"],load(){return ce(()=>import("./q-YpqabiSl.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([150,151]),import.meta.url).then(e=>ye(e.q))}}),le.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return ce(()=>import("./r-DzpuVbmQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([152,153]),import.meta.url).then(e=>ye(e.r))}}),le.of({name:"RPM Changes",load(){return ce(()=>import("./rpm-DlmAEsH3.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>ye(e.rpmChanges))}}),le.of({name:"RPM Spec",extensions:["spec"],load(){return ce(()=>import("./rpm-DlmAEsH3.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>ye(e.rpmSpec))}}),le.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return ce(()=>import("./ruby-BHSBK3B4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([156,157]),import.meta.url).then(e=>ye(e.ruby))}}),le.of({name:"SAS",extensions:["sas"],load(){return ce(()=>import("./sas-DmQmrPAn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([158,159]),import.meta.url).then(e=>ye(e.sas))}}),le.of({name:"Scala",extensions:["scala"],load(){return ce(()=>import("./clike-wo4CVrJj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.scala))}}),le.of({name:"Scheme",extensions:["scm","ss"],load(){return ce(()=>import("./scheme-CZHvt0eC.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([160,161]),import.meta.url).then(e=>ye(e.scheme))}}),le.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return ce(()=>import("./shell-BJzvpTMz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([162,163]),import.meta.url).then(e=>ye(e.shell))}}),le.of({name:"Sieve",extensions:["siv","sieve"],load(){return ce(()=>import("./sieve-DGjPhm-6.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([164,165]),import.meta.url).then(e=>ye(e.sieve))}}),le.of({name:"Smalltalk",extensions:["st"],load(){return ce(()=>import("./smalltalk-DaG60CSr.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([166,167]),import.meta.url).then(e=>ye(e.smalltalk))}}),le.of({name:"Solr",load(){return ce(()=>import("./solr-BkyoAXqg.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.solr))}}),le.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return ce(()=>import("./mllike-BtxCpmpf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>ye(e.sml))}}),le.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return ce(()=>import("./sparql-CN49rXKB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([168,169]),import.meta.url).then(e=>ye(e.sparql))}}),le.of({name:"Spreadsheet",alias:["excel","formula"],load(){return ce(()=>import("./spreadsheet-7FZkhkVo.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.spreadsheet))}}),le.of({name:"Squirrel",extensions:["nut"],load(){return ce(()=>import("./clike-wo4CVrJj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ye(e.squirrel))}}),le.of({name:"Stylus",extensions:["styl"],load(){return ce(()=>import("./stylus-CzHZ_0CL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([170,171]),import.meta.url).then(e=>ye(e.stylus))}}),le.of({name:"Swift",extensions:["swift"],load(){return ce(()=>import("./swift-5fr5bTbW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([172,173]),import.meta.url).then(e=>ye(e.swift))}}),le.of({name:"sTeX",load(){return ce(()=>import("./stex-D6sqtveI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>ye(e.stex))}}),le.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return ce(()=>import("./stex-D6sqtveI.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>ye(e.stex))}}),le.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return ce(()=>import("./verilog-hsHogyKv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>ye(e.verilog))}}),le.of({name:"Tcl",extensions:["tcl"],load(){return ce(()=>import("./tcl-D5oaR_GS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([178,179]),import.meta.url).then(e=>ye(e.tcl))}}),le.of({name:"Textile",extensions:["textile"],load(){return ce(()=>import("./textile-CJ5e8-7o.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([180,181]),import.meta.url).then(e=>ye(e.textile))}}),le.of({name:"TiddlyWiki",load(){return ce(()=>import("./tiddlywiki-DE5lnTl3.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.tiddlyWiki))}}),le.of({name:"Tiki wiki",load(){return ce(()=>import("./tiki-Dt9oCY2i.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ye(e.tiki))}}),le.of({name:"TOML",extensions:["toml"],load(){return ce(()=>import("./toml-D9QwsDZO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([182,183]),import.meta.url).then(e=>ye(e.toml))}}),le.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return ce(()=>import("./troff-DlwQJbfr.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([184,185]),import.meta.url).then(e=>ye(e.troff))}}),le.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return ce(()=>import("./ttcn-DUvoO9Vo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([186,187]),import.meta.url).then(e=>ye(e.ttcn))}}),le.of({name:"TTCN_CFG",extensions:["cfg"],load(){return ce(()=>import("./ttcn-cfg-Cj-t-B3M.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([188,189]),import.meta.url).then(e=>ye(e.ttcnCfg))}}),le.of({name:"Turtle",extensions:["ttl"],load(){return ce(()=>import("./turtle-DzvxCIjc.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([190,191]),import.meta.url).then(e=>ye(e.turtle))}}),le.of({name:"Web IDL",extensions:["webidl"],load(){return ce(()=>import("./webidl-CqjZNx5V.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([192,193]),import.meta.url).then(e=>ye(e.webIDL))}}),le.of({name:"VB.NET",extensions:["vb"],load(){return ce(()=>import("./vb-Caf126uo.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([194,195]),import.meta.url).then(e=>ye(e.vb))}}),le.of({name:"VBScript",extensions:["vbs"],load(){return ce(()=>import("./vbscript-BgRl-LR8.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([196,197]),import.meta.url).then(e=>ye(e.vbScript))}}),le.of({name:"Velocity",extensions:["vtl"],load(){return ce(()=>import("./velocity-CpvfwasF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([198,199]),import.meta.url).then(e=>ye(e.velocity))}}),le.of({name:"Verilog",extensions:["v"],load(){return ce(()=>import("./verilog-hsHogyKv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>ye(e.verilog))}}),le.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return ce(()=>import("./vhdl-FciHazR1.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([200,201]),import.meta.url).then(e=>ye(e.vhdl))}}),le.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return ce(()=>import("./xquery-DpTaL2IT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([202,203]),import.meta.url).then(e=>ye(e.xQuery))}}),le.of({name:"Yacas",extensions:["ys"],load(){return ce(()=>import("./yacas-D6bbkHsk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([204,205]),import.meta.url).then(e=>ye(e.yacas))}}),le.of({name:"Z80",extensions:["z80"],load(){return ce(()=>import("./z80-MlujNizn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([206,207]),import.meta.url).then(e=>ye(e.z80))}}),le.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return ce(()=>import("./mscgen-BfscU11q.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>ye(e.mscgen))}}),le.of({name:"X\xF9",extensions:["xu"],load(){return ce(()=>import("./mscgen-BfscU11q.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>ye(e.xu))}}),le.of({name:"MsGenny",extensions:["msgenny"],load(){return ce(()=>import("./mscgen-BfscU11q.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>ye(e.msgenny))}}),le.of({name:"Vue",extensions:["vue"],load(){return ce(()=>import("./dist-QPLTo43F.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([210,9,5,13,14,4,211]),import.meta.url).then(e=>e.vue())}}),le.of({name:"Angular Template",load(){return ce(()=>import("./dist-C0QU3Oay.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([212,9,5,13,14,4]),import.meta.url).then(e=>e.angular())}})],Vg=new WeakMap,Jk=/(\n|\r\n?|\u2028|\u2029)/g,Xk=/^\s*/,Yk=/\S/,Zk=Array.prototype.slice,Vd=48,$g=57,Wg=97,eS=102,Ug=65,tS=70;jl=function(e){if(typeof e=="string")return Gg([e])[0];if(typeof e=="function")return function(){let o=Zk.call(arguments);return o[0]=Qg(o[0]),e.apply(this,o)};let n=Qg(e),i=Kg(n,0);for(let o=1;o<n.length;o++)i+=arguments[o]+Kg(n,o);return i};function Kg(e,n){let i=e[n];if(i===void 0)throw TypeError(`invalid cooked string at index ${n}`);return i}function Qg(e){let n=Vg.get(e);if(n)return n;let i=Gg(e.raw),o=i.map(rS);return Object.defineProperty(o,"raw",{value:Object.freeze(i)}),Object.freeze(o),Vg.set(e,o),o}function Gg(e){let n=e.map(s=>s.split(Jk)),i;for(let s=0;s<n.length;s++){let c=n[s],d=s===0,f=s+1===n.length;if(d){if(c.length===1||c[0].length>0)throw Error("invalid content on opening line");c[1]=""}if(f){if(c.length===1||Yk.test(c[c.length-1]))throw Error("invalid content on closing line");c[c.length-2]="",c[c.length-1]=""}for(let p=2;p<c.length;p+=2){let y=c[p],w=p+1===c.length&&!f,_=Xk.exec(y)[0];if(!w&&_.length===y.length){c[p]="";continue}i=nS(_,i)}}let o=i?i.length:0;return n.map(s=>{let c=s[0];for(let d=1;d<s.length;d+=2){let f=s[d],p=s[d+1];c+=f+p.slice(o)}return c})}function nS(e,n){if(n===void 0||e===n)return e;let i=0;for(let o=Math.min(e.length,n.length);i<o&&e[i]===n[i];i++);return e.slice(0,i)}function rS(e){let n="",i=0,o=0;for(;(o=e.indexOf("\\",o))>-1;){if(n+=e.slice(i,o),++o===e.length)return;let s=e[o++];switch(s){case"b":n+="\b";break;case"t":n+=" ";break;case"n":n+=`
65
65
  `;break;case"v":n+="\v";break;case"f":n+="\f";break;case"r":n+="\r";break;case"\r":o<e.length&&e[o]===`
66
66
  `&&++o;case`
67
- `:case"\u2028":case"\u2029":break;case"0":if(Jg(e,o))return;n+="\0";break;case"x":{let c=$d(e,o,o+2);if(c===-1)return;o+=2,n+=String.fromCharCode(c);break}case"u":{let c;if(o<e.length&&e[o]==="{"){let d=e.indexOf("}",++o);if(d===-1)return;c=$d(e,o,d),o=d+1}else c=$d(e,o,o+4),o+=4;if(c===-1||c>1114111)return;n+=String.fromCodePoint(c);break}default:if(Jg(s,0))return;n+=s}i=o}return n+e.slice(i)}function Jg(e,n){let i=e.charCodeAt(n);return i>=Vd&&i<=$g}function $d(e,n,i){if(i>=e.length)return-1;let o=0;for(;n<i;n++){let s=iS(e.charCodeAt(n));if(s===-1)return-1;o=o*16+s}return o}function iS(e){return e>=Vd&&e<=$g?e-Vd:e>=Wg&&e<=eS?e-Wg+10:e>=Ug&&e<=tS?e-Ug+10:-1}const Xg=["","f","r","fr","rf"];function aS(e){try{return zl(`
67
+ `:case"\u2028":case"\u2029":break;case"0":if(Jg(e,o))return;n+="\0";break;case"x":{let c=$d(e,o,o+2);if(c===-1)return;o+=2,n+=String.fromCharCode(c);break}case"u":{let c;if(o<e.length&&e[o]==="{"){let d=e.indexOf("}",++o);if(d===-1)return;c=$d(e,o,d),o=d+1}else c=$d(e,o,o+4),o+=4;if(c===-1||c>1114111)return;n+=String.fromCodePoint(c);break}default:if(Jg(s,0))return;n+=s}i=o}return n+e.slice(i)}function Jg(e,n){let i=e.charCodeAt(n);return i>=Vd&&i<=$g}function $d(e,n,i){if(i>=e.length)return-1;let o=0;for(;n<i;n++){let s=iS(e.charCodeAt(n));if(s===-1)return-1;o=o*16+s}return o}function iS(e){return e>=Vd&&e<=$g?e-Vd:e>=Wg&&e<=eS?e-Wg+10:e>=Ug&&e<=tS?e-Ug+10:-1}const Xg=["","f","r","fr","rf"];function aS(e){try{return jl(`
68
68
  ${e}
69
69
  `).trim()}catch{return e}}function oS(e){return kD.parse(e)}var sS=new Set(["(","[","{",",",")","]","}"]);function lS(e,n){return e.name==="ArgList"?{args:cS(e),kwargs:uS(e,n)}:(console.warn(`Not an ArgList, name: ${e.name}`),{args:[],kwargs:[]})}function cS(e){var o;e.firstChild();let n=[],i=e.name;do if(i=e.name,!sS.has(i)){if(i==="VariableName"&&((o=e.node.nextSibling)==null?void 0:o.name)==="AssignOp"){e.prev();break}n.push(e.node)}while(e.nextSibling());return n}function uS(e,n){let i=[],o=e.name;do if(o=e.name,o==="VariableName"){let s=n.slice(e.from,e.to),c=e.node.nextSibling;if(!c||c.name!=="AssignOp")continue;let d=c.nextSibling;if(!d)continue;let f=n.slice(d.from,d.to).trim();i.push({key:s,value:f})}while(e.nextSibling());return i}function dS(e,n){if(e.name==="String"){let i=n.slice(e.from,e.to);return i.startsWith('r"""')||i.startsWith("r'''")?i.slice(4,-3):i.startsWith('"""')||i.startsWith("'''")?i.slice(3,-3):i.startsWith('r"')||i.startsWith("r'")?i.slice(2,-1):i.slice(1,-1)}if(e.name==="FormatString"){let i=n.slice(e.from,e.to);return i.startsWith('f"""')||i.startsWith("f'''")?i.slice(4,-3):i.startsWith('rf"""')||i.startsWith("rf'''")||i.startsWith('fr"""')||i.startsWith("fr'''")?i.slice(5,-3):i.startsWith('r"""')||i.startsWith("r'''")?i.slice(4,-3):i.startsWith('f"')||i.startsWith("f'")?i.slice(2,-1):i.startsWith('rf"')||i.startsWith("rf'")||i.startsWith('fr"')||i.startsWith("fr'")?i.slice(3,-1):(i.startsWith('r"')||i.startsWith("r'"),i.slice(2,-1))}return null}function fS(e){return e===""?0:e.startsWith('rf"""')||e.startsWith("rf'''")||e.startsWith('fr"""')||e.startsWith("fr'''")?5:e.startsWith('f"""')||e.startsWith("f'''")||e.startsWith('r"""')||e.startsWith("r'''")?4:e.startsWith('"""')||e.startsWith("'''")||e.startsWith("rf'")||e.startsWith('rf"')||e.startsWith("fr'")||e.startsWith('fr"')?3:e.startsWith("f'")||e.startsWith('f"')||e.startsWith("r'")||e.startsWith('r"')?2:e.startsWith("'")||e.startsWith('"')?1:0}function pS(e){let n=[...Xg].sort((i,o)=>o.length-i.length);for(let i of n)if(e.startsWith(i))return[i,e.slice(i.length)];return["",e]}function hS(e,n){return e.replaceAll(`\\${n}`,n)}var mS=[['"""','"""'],["'''","'''"],['"','"'],["'","'"]],gS=Xg.flatMap(e=>mS.map(([n,i])=>[e+n,i])).map(([e,n])=>[e,RegExp(`^mo\\.md\\(\\s*${Yg(e)}(.*)${Yg(n)}\\s*\\)$`,"s")]);function Yg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Zg=class{constructor(){ke(this,"type","markdown");ke(this,"defaultCode",`mo.md(r"""
70
70
  """)`);ke(this,"defaultMetadata",{quotePrefix:"r"})}static fromMarkdown(e){return`mo.md(r"""
71
71
  ${e}
72
- """)`}transformIn(e){e=e.trim();let n={...this.defaultMetadata};if(e==="")return{code:"",offset:0,metadata:n};for(let[i,o]of gS){let s=e.match(o);if(s){let c=s[1],[d,f]=pS(i);n.quotePrefix=d;let p=hS(c,f),y=e.indexOf(c);return{code:zl(`
72
+ """)`}transformIn(e){e=e.trim();let n={...this.defaultMetadata};if(e==="")return{code:"",offset:0,metadata:n};for(let[i,o]of gS){let s=e.match(o);if(s){let c=s[1],[d,f]=pS(i);n.quotePrefix=d;let p=hS(c,f),y=e.indexOf(c);return{code:jl(`
73
73
  ${p}
74
74
  `).trim(),offset:y,metadata:n}}}return{code:e,offset:0,metadata:n}}transformOut(e,n){e===""&&(e=" ");let{quotePrefix:i}=n,o=e.replaceAll('""',String.raw`"\"`),s=`mo.md(${i}"""
75
75
  `;return{code:s+o+`
76
- """)`,offset:s.length+1}}isSupported(e){if(e=e.trim(),e==="")return!0;if(!e.startsWith("mo.md("))return!1;if(e==="mo.md()")return!0;let n=Th.parser.parse(e),i=[{match:"Script"},{match:"ExpressionStatement"},{match:"CallExpression"},{match:"MemberExpression"},{match:"VariableName"},{match:"."},{match:"PropertyName"},{match:"ArgList"},{match:"("},{match:/String|FormatString/,stop:!0},{match:")"}],o=!0;return n.iterate({enter:s=>{let c=i.shift();if(c===void 0)return o=!1,!1;let d=c.match;return typeof d=="string"?(o&&(o=d===s.name),o&&!c.stop):(d.test(s.name)||(o=!1),o&&!c.stop)}}),o}},yS=class{constructor(){ke(this,"type","python");ke(this,"defaultCode","");ke(this,"defaultMetadata",{})}transformIn(e){return{code:e,offset:0,metadata:{}}}transformOut(e,n){return{code:e,offset:0}}isSupported(e){return!0}},Wd="__marimo_duckdb",ey=class{constructor(){ke(this,"type","sql");ke(this,"defaultMetadata",{dataframeName:"_df",quotePrefix:"f",commentLines:[],showOutput:!0,engine:Wd})}get defaultCode(){return'_df = mo.sql(f"""SELECT * FROM """)'}static fromQuery(e){return`_df = mo.sql(f"""${e.trim()}""")`}transformIn(e){e=e.trim();let n={...this.defaultMetadata,commentLines:this.extractCommentLines(e)};if(!this.isSupported(e))return{code:e,offset:0,metadata:n};if(e==="")return{code:"",offset:0,metadata:n};let i=ty(e);return i?(n.dataframeName=i.dfName,n.showOutput=i.output??!0,n.engine=i.engine??Wd,{code:zl(`
76
+ """)`,offset:s.length+1}}isSupported(e){if(e=e.trim(),e==="")return!0;if(!e.startsWith("mo.md("))return!1;if(e==="mo.md()")return!0;let n=Th.parser.parse(e),i=[{match:"Script"},{match:"ExpressionStatement"},{match:"CallExpression"},{match:"MemberExpression"},{match:"VariableName"},{match:"."},{match:"PropertyName"},{match:"ArgList"},{match:"("},{match:/String|FormatString/,stop:!0},{match:")"}],o=!0;return n.iterate({enter:s=>{let c=i.shift();if(c===void 0)return o=!1,!1;let d=c.match;return typeof d=="string"?(o&&(o=d===s.name),o&&!c.stop):(d.test(s.name)||(o=!1),o&&!c.stop)}}),o}},yS=class{constructor(){ke(this,"type","python");ke(this,"defaultCode","");ke(this,"defaultMetadata",{})}transformIn(e){return{code:e,offset:0,metadata:{}}}transformOut(e,n){return{code:e,offset:0}}isSupported(e){return!0}},Wd="__marimo_duckdb",ey=class{constructor(){ke(this,"type","sql");ke(this,"defaultMetadata",{dataframeName:"_df",quotePrefix:"f",commentLines:[],showOutput:!0,engine:Wd})}get defaultCode(){return'_df = mo.sql(f"""SELECT * FROM """)'}static fromQuery(e){return`_df = mo.sql(f"""${e.trim()}""")`}transformIn(e){e=e.trim();let n={...this.defaultMetadata,commentLines:this.extractCommentLines(e)};if(!this.isSupported(e))return{code:e,offset:0,metadata:n};if(e==="")return{code:"",offset:0,metadata:n};let i=ty(e);return i?(n.dataframeName=i.dfName,n.showOutput=i.output??!0,n.engine=i.engine??Wd,{code:jl(`
77
77
  ${i.sqlString}
78
78
  `).trim(),offset:i.startPosition,metadata:n}):{code:e,offset:0,metadata:n}}transformOut(e,n){let{quotePrefix:i,commentLines:o,showOutput:s,engine:c,dataframeName:d}=n,f=`${d} = mo.sql(
79
79
  ${i}"""
@@ -85,14 +85,14 @@ ${i.sqlString}
85
85
  `)+bS(p)+y,offset:f.length+1}}isSupported(e){return e.trim()===""?!0:!e.includes("mo.sql")||e.split("mo.sql").length>2?!1:ty(e)!==null}extractCommentLines(e){let n=e.split(`
86
86
  `),i=[];for(let o of n)if(o!=null&&o.startsWith("#"))i.push(o);else break;return i}};function vS(e){do{if(e.name==="AssignStatement")return e.node;if(e.name!=="Comment")return null}while(e.next());return null}function ty(e){try{let n=oS(e).cursor();n.name==="Script"&&n.next();let i=vS(n);if(!i||e.slice(i.to).trim().length>0)return null;let o=null,s=null,c,d,f=0,p=i.cursor();if(p.firstChild(),p.name==="VariableName"&&(o=e.slice(p.from,p.to)),!o)return null;let y=!1,w=null;for(;p.nextSibling();)if(p.name==="AssignOp")y=!0;else if(y&&!w){w=p.node;break}if(!w||w.name==="ConditionalExpression"||w.name==="BinaryExpression"||w.name==="UnaryExpression")return null;let _=w.cursor(),C=null;if(_.name==="CallExpression")C=_.node;else{_.firstChild();do if(_.name==="CallExpression"){C=_.node;break}while(_.nextSibling())}if(C){let E=C.cursor(),T=!1;if(E.firstChild(),E.name==="MemberExpression"&&(T=e.slice(E.from,E.to)==="mo.sql"),T){for(;E.next();)if(E.name==="ArgList"){let{args:I,kwargs:$}=lS(E.node.cursor(),e);I.length===1&&(s=dS(I[0],e),f=I[0].from+fS(e.slice(I[0].from,I[0].to)));for(let{key:V,value:F}of $)switch(V){case"engine":c=F;break;case"output":d=F==="True";break}if(s==="")return{dfName:o,sqlString:"",engine:c,output:d,startPosition:f};break}}}return!o||!s?null:{dfName:o,sqlString:aS(s),engine:c,output:d,startPosition:f}}catch(n){return console.warn("Failed to parse SQL statement",n),null}}function bS(e){return e.split(`
87
87
  `).map(n=>n!=null&&n.trim()?` ${n}`:n).join(`
88
- `)}function wS(e,n){return{get:()=>n.get(e),sub:i=>n.sub(e,()=>i(n.get(e)))}}function _S(e,{offset:n,body:i=window,behavior:o="smooth"}){let s=(n==null?void 0:n.top)??0,c=(n==null?void 0:n.bottom)??0,d=e.getBoundingClientRect();if(d.top<s){i.scrollBy({top:d.top-s,behavior:o});return}if(d.bottom>window.innerHeight-c){i.scrollBy({top:d.bottom-window.innerHeight+c,behavior:o});return}}Gu=function(e){return e?e.state.field(Lr).type:"python"};function xS(e,n){return!e||Gu(e)===n?!1:e.state.doc.toString().trim()===""?!0:gr[n].isSupported(Xr(e))}Lm=function(e,n,i={}){return!i.force&&!xS(e,n)?!1:(vm(e,{language:n}),n)};function kS(e){return Ra.of([{key:e.getHotkey("cell.format").key,preventDefault:!0,run:n=>(dd({[n.state.facet(Wi)]:n}),!0)},{key:e.getHotkey("cell.viewAsMarkdown").key,preventDefault:!0,run:n=>{let i=Gu(n);if(i!=="markdown"&&i!=="python")return!1;let o=Lm(n,i==="python"?"markdown":"python",{force:!0});return o==="markdown"&&n.state.facet(Pt).afterToggleMarkdown(),o!==!1}}])}cx=function(){return Kt.updateListener.of(e=>{if(e.view.hasFocus&&e.heightChanged&&e.docChanged){if(e.transactions.some(n=>n.effects.some(i=>i.is(Ms))))return;ny(e.view,{behavior:"smooth"})}})};function ny(e,n){let i=e.dom.getElementsByClassName("cm-activeLine cm-line");if(i.length===1){let o=i[0],s=document.getElementById("App");In(s,"App not found"),_S(o,{offset:{top:30,bottom:150},body:s,behavior:n.behavior})}}function SS(){return{}}let CS,ES,ry;({reducer:CS,createActions:ES,valueAtom:La,useActions:ry}=Ml(SS,{setVariables:(e,n)=>{let i={...e},o={};for(let s of n)o[s.name]={...i[s.name],...s};return o},addVariables:(e,n)=>{let i={...e};for(let o of n)i[o.name]={...i[o.name],...o};return i},setMetadata:(e,n)=>{let i={...e};for(let{name:o,value:s,dataType:c}of n)i[o]&&(i[o]={...i[o],value:s,dataType:c});return i}})),E_=()=>Zn(La),p_=function(){return ry()},q_=function(e){let n=e.storage||Ts;return{getItem(i,o){try{let s=n.getItem(i);if(!s)return o;let c=JSON.parse(s);return e.fromSerializable(c)}catch(s){return Se.warn(`Error getting ${i} from storage`,s),o}},setItem:(i,o)=>{n.setItem(i,JSON.stringify(e.toSerializable(o)))},removeItem:i=>{n.removeItem(i)}}},Vl=Km(()=>Ts);function TS(e,n){if(typeof window>"u")return;let i=`__marimo__${n}`;window[i]&&Se.warn(`Overwriting existing debug object ${i}`),window[i]=e}var RS={markdown:!0,wasm_layouts:!1,rtc_v2:!1,performant_table_charts:!1,chat_modes:!1,cache_panel:!1,external_agents:!1,server_side_pdf_export:!0};Ul=function(e){var n,i;return((i=(n=ew())==null?void 0:n.experimental)==null?void 0:i[e])??RS[e]};function DS(e,n){Vi().saveUserConfig({config:{experimental:{[e]:n}}})}k_=({feature:e,children:n})=>Ul(e)?n:null,TS(DS,"setFeatureFlag"),Wl=[{type:"files",Icon:Dg,label:"Files",tooltip:"View files",defaultSection:"sidebar"},{type:"variables",Icon:km,label:"Variables",tooltip:"Explore variables and data sources",defaultSection:"sidebar"},{type:"packages",Icon:cm,label:"Packages",tooltip:"Manage packages",defaultSection:"sidebar"},{type:"ai",Icon:om,label:"AI",tooltip:"Chat & Agents",defaultSection:"sidebar"},{type:"outline",Icon:Nh,label:"Outline",tooltip:"View outline",defaultSection:"sidebar"},{type:"documentation",Icon:Gh,label:"Docs",tooltip:"View live docs",defaultSection:"sidebar"},{type:"dependencies",Icon:em,label:"Dependencies",tooltip:"Explore dependencies",defaultSection:"sidebar"},{type:"errors",Icon:Wh,label:"Errors",tooltip:"View errors",defaultSection:"developer-panel"},{type:"scratchpad",Icon:Uh,label:"Scratchpad",tooltip:"Scratchpad",defaultSection:"developer-panel"},{type:"tracing",Icon:Zh,label:"Tracing",tooltip:"View tracing",defaultSection:"developer-panel"},{type:"secrets",Icon:Og,label:"Secrets",tooltip:"Manage secrets",defaultSection:"developer-panel",hidden:vh()},{type:"logs",Icon:nm,label:"Logs",tooltip:"View logs",defaultSection:"developer-panel"},{type:"terminal",Icon:Xh,label:"Terminal",tooltip:"Terminal",hidden:vh(),defaultSection:"developer-panel",requiredCapability:"terminal"},{type:"snippets",Icon:Pg,label:"Snippets",tooltip:"Snippets",defaultSection:"developer-panel"},{type:"cache",Icon:wD,label:"Cache",tooltip:"View cache",defaultSection:"developer-panel",hidden:!Ul("cache_panel")}],nx=new Map(Wl.map(e=>[e.type,e])),w_=function(e,n){return!!(e.hidden||e.requiredCapability&&!n[e.requiredCapability])};var OS=Jr();Tm=Hl("marimo:panel-layout",{sidebar:Wl.filter(e=>!e.hidden&&e.defaultSection==="sidebar").map(e=>e.type),developerPanel:Wl.filter(e=>!e.hidden&&e.defaultSection==="developer-panel").map(e=>e.type)},Vl,{getOnInit:!0});function iy(e){let n=lt.get(Tm);return n.sidebar.includes(e)?"sidebar":n.developerPanel.includes(e)?"developer-panel":null}var ay="marimo:sidebar",oy=new Vu(G2({selectedPanel:J2().optional().transform(e=>e),isSidebarOpen:X2(),isDeveloperPanelOpen:X2().optional().default(!1),selectedDeveloperPanelTab:J2().optional().default("errors").transform(e=>e)}),PS);function PS(){return{selectedPanel:"variables",isSidebarOpen:!1,isDeveloperPanelOpen:!1,selectedDeveloperPanelTab:"errors"}}let MS,LS,sy;({reducer:MS,createActions:LS,valueAtom:Ku,useActions:sy}=Ml(()=>oy.get(ay),{openApplication:(e,n)=>{let i=iy(n);return i==="sidebar"?{...e,selectedPanel:n,isSidebarOpen:!0}:i==="developer-panel"?{...e,selectedDeveloperPanelTab:n,isDeveloperPanelOpen:!0}:e},toggleApplication:(e,n)=>{let i=iy(n);return i==="sidebar"?{...e,selectedPanel:n,isSidebarOpen:e.isSidebarOpen?e.selectedPanel!==n:!0}:i==="developer-panel"?{...e,selectedDeveloperPanelTab:n,isDeveloperPanelOpen:e.isDeveloperPanelOpen?e.selectedDeveloperPanelTab!==n:!0}:e},toggleSidebarPanel:e=>({...e,isSidebarOpen:!e.isSidebarOpen}),setIsSidebarOpen:(e,n)=>({...e,isSidebarOpen:n}),toggleDeveloperPanel:e=>({...e,isDeveloperPanelOpen:!e.isDeveloperPanelOpen}),setIsDeveloperPanelOpen:(e,n)=>({...e,isDeveloperPanelOpen:n})},[(e,n)=>oy.set(ay,n)])),y_=()=>{let e=(0,OS.c)(2),n=Zn(Ku);if(n.isSidebarOpen)return n;let i;return e[0]===n?i=e[1]:(i={...n,selectedPanel:void 0},e[0]=n,e[1]=i),i},G_=function(){return sy()},xm=ze({terminal:!1,pylsp:!1,basedpyright:!1,ty:!1});function oc(e){var n;return((n=lt.get(xm))==null?void 0:n[e])??!1}cd=ze({documentation:null});var ly=new Set(["FunctionDefinition","LambdaExpression","ArrayComprehensionExpression","SetComprehension","DictionaryComprehensionExpression","ComprehensionExpression","ClassDefinition"]);function NS(e){let n=aw(e.state);if(!n||qS(n))return[];let i=new Set(Object.keys(e.variables).filter(E=>{let T=e.variables[E];return T.dataType!=="module"&&!T.declaredBy.includes("setup")&&!T.declaredBy.includes(e.cellId)}));if(i.size===0)return[];let o=[],s=new Map,c=new Map,d=new Map;function f(E,T){var K,pe,P,A,W,de,fe,we,J,be,Ce;let I=E.cursor(),$=I.name,V=I.from,F=ly.has($),N=T;switch(F&&(N=[...T,V],s.set(V,new Set),c.set(V,$)),$){case"FunctionDefinition":{let Z=E.cursor();Z.firstChild();do if(Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to),Q=T[T.length-1]??-1;s.has(Q)||s.set(Q,new Set),(K=s.get(Q))==null||K.add(se);break}while(Z.nextSibling());let re=E.cursor();re.firstChild();do if(re.name==="ParamList"){let se=re.node.cursor();se.firstChild();do if(se.name==="VariableName"){let Q=e.state.doc.sliceString(se.from,se.to);(pe=s.get(V))==null||pe.add(Q)}while(se.nextSibling())}while(re.nextSibling());break}case"LambdaExpression":{let Z=E.cursor();Z.firstChild();do if(Z.name==="ParamList"){let re=Z.node.cursor();re.firstChild();do if(re.name==="VariableName"){let se=e.state.doc.sliceString(re.from,re.to);(P=s.get(V))==null||P.add(se)}while(re.nextSibling())}while(Z.nextSibling());break}case"ArrayComprehensionExpression":case"DictionaryComprehensionExpression":case"SetComprehension":case"ComprehensionExpression":{let Z=E.cursor();Z.firstChild();let re=!1;do if(Z.name==="for")re=!0;else if(re&&Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to);(A=s.get(V))==null||A.add(se)}else if(re&&Z.name==="TupleExpression"){let se=Z.node.cursor();se.firstChild();do if(se.name==="VariableName"){let Q=e.state.doc.sliceString(se.from,se.to);(W=s.get(V))==null||W.add(Q)}while(se.nextSibling())}else re&&Z.name==="in"&&(re=!1);while(Z.nextSibling());break}case"ClassDefinition":{let Z=E.cursor();Z.firstChild();do if(Z.name==="VariableName"){let re=e.state.doc.sliceString(Z.from,Z.to),se=T[T.length-1]??-1;s.has(se)||s.set(se,new Set),(de=s.get(se))==null||de.add(re);break}while(Z.nextSibling());d.set(V,[]);break}case"AssignStatement":{let Z=E.cursor(),re=[];Z.firstChild();do Z.name==="AssignOp"&&re.push(Z.from);while(Z.nextSibling());let se=re[re.length-1],Q=E.cursor();Q.firstChild();let Le=N[N.length-1]??-1;do Q.from<se&&Ud(Q,{currentScope:Le,state:e.state,allDeclarations:s,scopeTypes:c,classLevelDeclarations:d,assignmentPosition:I.to});while(Q.nextSibling());break}case"ForStatement":{let Z=E.cursor();Z.firstChild();let re=!1;do if(Z.name==="for")re=!0;else if(re&&Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to),Q=N[N.length-1]??-1;s.has(Q)||s.set(Q,new Set),(fe=s.get(Q))==null||fe.add(se)}else re&&Z.name==="in"&&(re=!1);while(Z.nextSibling());break}case"ImportStatement":{let Z=E.cursor();Z.firstChild();do if(Z.name==="VariableName"){let re=e.state.doc.sliceString(Z.from,Z.to),se=N[N.length-1]??-1;s.has(se)||s.set(se,new Set),(we=s.get(se))==null||we.add(re)}while(Z.nextSibling());break}case"ImportFromStatement":{let Z=E.cursor();Z.firstChild();let re=!1;do if(Z.name==="import")re=!0;else if(re&&Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to),Q=N[N.length-1]??-1;s.has(Q)||s.set(Q,new Set),(J=s.get(Q))==null||J.add(se)}while(Z.nextSibling());break}case"TryStatement":{let Z=E.cursor();Z.firstChild();let re=!1;do if(Z.name==="as")re=!0;else if(re&&Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to),Q=N[N.length-1]??-1;s.has(Q)||s.set(Q,new Set),(be=s.get(Q))==null||be.add(se),re=!1}while(Z.nextSibling());break}case"WithStatement":{let Z=E.cursor();Z.firstChild();let re=!1;do if(Z.name==="as")re=!0;else if(re&&Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to),Q=N[N.length-1]??-1;s.has(Q)||s.set(Q,new Set),(Ce=s.get(Q))==null||Ce.add(se),re=!1}while(Z.nextSibling());break}}C(I,Z=>{f(Z,N)})}function p(E,T,I){let $=d.get(T);return $?$.some(([V,F])=>V===E&&F<I):!1}function y(E,T,I){var $,V;for(let F of T)if(c.get(F)==="ClassDefinition"){if(p(E,F,I))return!0}else if(($=s.get(F))!=null&&$.has(E))return!0;return((V=s.get(-1))==null?void 0:V.has(E))??!1}function w(E,T){let I=E.cursor(),$=I.name,V=I.from,F=ly.has($),N=T;if(F&&(N=[...T,V]),$==="VariableName"){let K=e.state.doc.sliceString(I.from,I.to);_(K,I)&&(y(K,N,I.from)||o.push({from:I.from,to:I.to,variableName:K}))}C(I,K=>{w(K,N)})}function _(E,T){return i.has(E)&&!IS(T)&&!AS(T)}function C(E,T){if(E.firstChild())do T(E.node);while(E.nextSibling())}return f(n,[]),w(n,[]),o}function IS(e){let n=e.node.cursor();if(n.moveTo(e.from),n.parent()&&n.name==="CallExpression"&&n.firstChild())do if(n.name==="ArgList"&&n.firstChild()){do if(n.from===e.from&&n.to===e.to)return n.nextSibling()&&n.name==="AssignOp";while(n.nextSibling());break}while(n.nextSibling());return!1}function AS(e){let n=e.node.cursor();if(n.parent()&&n.name==="AssignStatement"){let i=n.node.cursor();i.firstChild();let o=-1;do if(i.name==="AssignOp"){o=i.from;break}while(i.nextSibling());return o!==-1&&e.from<o}return!1}function qS(e){let n=e.cursor();do if(n.name==="\u26A0"||n.type.isError)return!0;while(n.next());return!1}function Ud(e,n){var i;switch(e.name){case"VariableName":{let o=n.state.doc.sliceString(e.from,e.to);if(n.currentScope!==-1&&n.scopeTypes.get(n.currentScope)==="ClassDefinition"){let s=n.classLevelDeclarations.get(n.currentScope);s&&s.push([o,n.assignmentPosition])}else n.allDeclarations.has(n.currentScope)||n.allDeclarations.set(n.currentScope,new Set),(i=n.allDeclarations.get(n.currentScope))==null||i.add(o);break}case"TupleExpression":{let o=e.node.cursor();o.firstChild();do Ud(o,n);while(o.nextSibling());break}case"ArrayExpression":{let o=e.node.cursor();o.firstChild();do Ud(o,n);while(o.nextSibling());break}}}var jS=Hi.mark({class:"mo-cm-reactive-reference"});x_=Hi.mark({class:"mo-cm-reactive-reference-hover"});var cy=Bi.define(),zS=class{constructor(e,n){ke(this,"highlightDebounceMs",300);this.view=e,this.cellId=n,this.scheduleHighlighting=Y2(()=>{this.runHighlighting()},this.highlightDebounceMs),this.variablesUnsubscribe=lt.sub(La,()=>{this.scheduleHighlighting()}),this.scheduleHighlighting()}update(e){(e.docChanged||e.focusChanged)&&this.scheduleHighlighting()}destroy(){this.scheduleHighlighting.cancel(),this.variablesUnsubscribe()}runHighlighting(){let e=NS({state:this.view.state,cellId:this.cellId,variables:lt.get(La)});e.length>0&&Se.debug(`Found ${e.length} reactive variables in cell ${this.cellId}`),queueMicrotask(()=>{this.view.dispatch({effects:cy.of(e)})})}};ad=xs.define({create(){return{decorations:Hi.none,ranges:[]}},update(e,n){let i={decorations:e.decorations.map(n.changes),ranges:e.ranges};for(let o of n.effects)o.is(cy)&&(i={decorations:Hi.set(o.value.map(s=>jS.range(s.from,s.to))),ranges:o.value});return i},provide:e=>Kt.decorations.from(e,n=>n.decorations)});function FS(e){return[ad,Ol.define(n=>new zS(n,e))]}Z_=function(e,n){return n?FS(e):[]};function uy(e,n=!1){if(!e)return null;let i=document.createElement("span");if(i.classList.add("mo-cm-tooltip"),i.classList.add("docs-documentation"),n&&i.classList.add("cm-tooltip-section"),i.style.display="flex",i.style.flexDirection="column",i.style.gap=".8rem",i.innerHTML=e,n){let o=document.createElement("div");o.classList.add("text-xs","text-muted-foreground","font-medium","pt-1","-mt-2","border-t","border-border");let s=document.createElement("kbd");s.className="ml-1 rounded-md bg-muted/40 px-2 text-[0.75rem] font-prose center border border-foreground/20 text-muted-foreground inline whitespace-nowrap",s.textContent=y4()?"\u2318":"Ctrl",o.append(document.createTextNode("Jump to defining cell ")),o.append(s),o.append(document.createTextNode(" + Click")),i.append(o)}return i}Iu=new Nu("autocomplete-result",async(e,n)=>{let{sendCodeCompletionRequest:i}=Vi();await i({id:e,...n})});var BS={param:3,property:2};const Kd={asCompletionResult(e,n){return{from:e-n.prefix_length,options:n.options.map(i=>({label:i.name,type:i.type,boost:BS[i.type]??1,info:()=>uy(i.completion_info)})),validFor:/^\w*$/}},asHoverTooltip({position:e,message:n,limitToType:i,excludeTypes:o,exactName:s,showGoToDefinitionHint:c=!1}){let d=HS(n.options,s);if(!d)return;let f=e-n.prefix_length,p=uy(d.completion_info,c);if(p&&!(i&&d.type!==i)&&!(o!=null&&o.includes(d.type)))return{pos:f,html:d.completion_info,end:f+d.name.length,above:!0,create:()=>({dom:p,resize:!1})}}};function HS(e,n){if(e.length!==0){if(e.length===1)return e[0];if(n)return e.find(i=>i.name===n)}}Zw=function(e){var n;return[(n=e==null?void 0:e.pylsp)!=null&&n.enabled&&oc("pylsp")?[]:wh(async(i,o)=>{let s=await dy({view:i,pos:o,excludeTypes:["tooltip"]});return s===null||s==="cancelled"?null:s},{hideOnChange:!0}),WS]};async function dy({view:e,pos:n,excludeTypes:i}){var w;let o=er.findElement(e.dom);if(!o)return Se.error("Failed to find active cell."),null;let s=er.parse(o.id),{startToken:c,endToken:d}=Qd(e.state.doc,n),f=((w=e.state.field(ad,!1))==null?void 0:w.ranges.some(_=>n>=_.from&&n<=_.to))??!1,p=await Iu.request({document:e.state.doc.slice(0,d).toString(),cellId:s});if(!p)return"cancelled";let y=e.state.doc.slice(c,d).toString();return Kd.asHoverTooltip({position:d,message:p,exactName:y,excludeTypes:i,showGoToDefinitionHint:f})??null}function Qd(e,n){let i=n,o=i>0?e.sliceString(i-1,i):"",s=i<e.length?e.sliceString(i,i+1):"";o==="("&&s===")"&&--i;let c=i,d=i;for(;c>0;){let f=e.sliceString(c-1,c);if(!/\w/.test(f))break;c--}for(;d<e.length;){let f=e.sliceString(d,d+1);if(!/\w/.test(f))break;d++}return{startToken:c,endToken:d}}function VS(e){let{head:n}=e.selection.main,i=e.doc.sliceString(n-1,n);return/\w/.test(i)}var $S=Y2(async(e,n)=>{if(lt.get(Ku).selectedPanel!=="documentation")return;let i=await dy({view:e,pos:n});i!=="cancelled"&&lt.set(cd,{documentation:(i==null?void 0:i.html)??null})},300),WS=Kt.updateListener.of(e=>{if(e.selectionSet&&VS(e.state)){let n=e.state.selection.main.head;$S(e.view,n)}});function fy(e,n){e.focus(),requestAnimationFrame(()=>{e.dispatch({selection:{anchor:n,head:n},effects:Kt.scrollIntoView(n,{y:"center"})})})}Wu=function(e,n){let{state:i}=e,o=aw(i),s=!1,c=0;return o.iterate({enter:d=>{if(s)return!1;if(d.name==="VariableName"&&i.doc.sliceString(d.from,d.to)===n)return c=d.from,s=!0,!1;if(d.name==="Comment"||d.name==="String")return!1}}),s?(fy(e,c),!0):!1};function US(e,n){return fy(e,e.state.doc.line(n).from),!0}function KS(e){let{from:n,to:i}=e.selection.main;if(n===i){let{startToken:o,endToken:s}=Qd(e.doc,n);return e.doc.sliceString(o,s)}return e.doc.sliceString(n,i)}function QS(e,n){if(!n)return null;let i=e[n];return!i||i.declaredBy.length===0?null:i.declaredBy[0]}function GS(e){return e.startsWith("_")}sm=function(e){let{state:n}=e,i=KS(n);return i?(bw(e),e.dispatch({effects:j4}),um(e,i)):!1},um=function(e,n){let i=JS(e,n);return i?Wu(i,n):!1},$w=function(e,n){let i=py(e);return i?US(i,n):!1};function JS(e,n){if(GS(n))return e;let i=QS(lt.get(La),n);return i?py(i):null}function py(e){var n;return((n=lt.get(bt).cellHandles[e].current)==null?void 0:n.editorView)??null}function XS(e){var n=e.Pos;function i(u,m,v){if(m.line===v.line&&m.ch>=v.ch-1){var b=u.getLine(m.line).charCodeAt(m.ch);55296<=b&&b<=55551&&(v.ch+=1)}return{start:m,end:v}}var o=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"g<Up>",type:"keyToKey",toKeys:"gk"},{keys:"g<Down>",type:"keyToKey",toKeys:"gj"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h"},{keys:"<Del>",type:"keyToKey",toKeys:"x"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"keyToKey",toKeys:"i",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"g$",type:"motion",motion:"moveToEndOfDisplayLine"},{keys:"g^",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"g0",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{keys:"gq",type:"operator",operator:"hardWrap"},{keys:"gw",type:"operator",operator:"hardWrap",operatorArgs:{keepCursor:!0}},{keys:"g?",type:"operator",operator:"rot13"},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-u>",type:"operatorMotion",operator:"delete",motion:"moveToStartOfLine",context:"insert"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<register>",type:"action",action:"replayMacro"},{keys:"q<register>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<register>",type:"action",action:"setMark"},{keys:'"<register>',type:"action",action:"setRegister"},{keys:"<C-r><register>",type:"action",action:"insertRegister",context:"insert",isEdit:!0},{keys:"<C-o>",type:"action",action:"oneNormalCommand",context:"insert"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<register>",type:"motion",motion:"textObjectManipulation"},{keys:"i<register>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],s=Object.create(null),c=o.length,d=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"omap",shortName:"om"},{name:"noremap",shortName:"no"},{name:"nnoremap",shortName:"nn"},{name:"vnoremap",shortName:"vn"},{name:"inoremap",shortName:"ino"},{name:"onoremap",shortName:"ono"},{name:"unmap"},{name:"mapclear",shortName:"mapc"},{name:"nmapclear",shortName:"nmapc"},{name:"vmapclear",shortName:"vmapc"},{name:"imapclear",shortName:"imapc"},{name:"omapclear",shortName:"omapc"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"startinsert",shortName:"start"},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"marks",excludeFromCommandHistory:!0},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"vglobal",shortName:"v"},{name:"delete",shortName:"d"},{name:"join",shortName:"j"},{name:"normal",shortName:"norm"},{name:"global",shortName:"g"}],f=vn("");function p(u){u.setOption("disableInput",!0),u.setOption("showCursorWhenSelecting",!1),e.signal(u,"vim-mode-change",{mode:"normal"}),u.on("cursorActivity",$o),se(u),e.on(u.getInputField(),"paste",w(u))}function y(u){u.setOption("disableInput",!1),u.off("cursorActivity",$o),e.off(u.getInputField(),"paste",w(u)),u.state.vim=null,sa&&clearTimeout(sa)}function w(u){var m=u.state.vim;return m.onPasteFn||(m.onPasteFn=function(){m.insertMode||(u.setCursor(_t(u.getCursor(),0,1)),fn.enterInsertMode(u,{},m))}),m.onPasteFn}var _=/[\d]/,C=[e.isWordChar,function(u){return u&&!e.isWordChar(u)&&!/\s/.test(u)}],E=[function(u){return/\S/.test(u)}],T=["<",">"],I=["-",'"',".",":","_","/","+"],$=/^\w$/,V=/^[A-Z]$/;try{V=RegExp("^[\\p{Lu}]$","u")}catch{}function F(u,m){return m>=u.firstLine()&&m<=u.lastLine()}function N(u){return/^[a-z]$/.test(u)}function K(u){return"()[]{}".indexOf(u)!=-1}function pe(u){return _.test(u)}function P(u){return V.test(u)}function A(u){return/^\s*$/.test(u)}function W(u){return".?!".indexOf(u)!=-1}function de(u,m){for(var v=0;v<m.length;v++)if(m[v]==u)return!0;return!1}var fe={};function we(u,m,v,b,x){if(m===void 0&&!x)throw Error("defaultValue is required unless callback is provided");if(v||(v="string"),fe[u]={type:v,defaultValue:m,callback:x},b)for(var k=0;k<b.length;k++)fe[b[k]]=fe[u];m&&J(u,m)}function J(u,m,v,b){var x=fe[u];b||(b={});var k=b.scope;if(!x)return Error("Unknown option: "+u);if(x.type=="boolean"){if(m&&m!==!0)return Error("Invalid argument: "+u+"="+m);m!==!1&&(m=!0)}x.callback?(k!=="local"&&x.callback(m,void 0),k!=="global"&&v&&x.callback(m,v)):(k!=="local"&&(x.value=x.type=="boolean"?!!m:m),k!=="global"&&v&&(v.state.vim.options[u]={value:m}))}function be(u,m,v){var b=fe[u];v||(v={});var x=v.scope;if(!b)return Error("Unknown option: "+u);if(b.callback){let k=m&&b.callback(void 0,m);return x!=="global"&&k!==void 0?k:x==="local"?void 0:b.callback()}else return(x!=="global"&&m&&m.state.vim.options[u]||x!=="local"&&b||{}).value}we("filetype",void 0,"string",["ft"],function(u,m){if(m!==void 0)if(u===void 0){let v=m.getOption("mode");return v=="null"?"":v}else{let v=u==""?"null":u;m.setOption("mode",v)}}),we("textwidth",80,"number",["tw"],function(u,m){if(m!==void 0){if(u===void 0)return m.getOption("textwidth");var v=Math.round(u);v>1&&m.setOption("textwidth",v)}});var Ce=function(){var u=100,m=-1,v=0,b=0,x=Array(u);function k(L,z,q){var oe=x[m%u];function ie(Y){var xe=++m%u,_e=x[xe];_e&&_e.clear(),x[xe]=L.setBookmark(Y)}if(oe){var X=oe.find();X&&!gt(X,z)&&ie(z)}else ie(z);ie(q),v=m,b=m-u+1,b<0&&(b=0)}function R(L,z){m+=z,m>v?m=v:m<b&&(m=b);var q=x[(u+m)%u];if(q&&!q.find()){var oe=z>0?1:-1,ie,X=L.getCursor();do if(m+=oe,q=x[(u+m)%u],q&&(ie=q.find())&&!gt(X,ie))break;while(m<v&&m>b)}return q}function O(L,z){var q=m,oe=R(L,z);return m=q,oe&&oe.find()}return{cachedCursor:void 0,add:k,find:O,move:R}},Z=function(u){return u?{changes:u.changes,expectCursorActivityForChange:u.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class re{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=Z()}exitMacroRecordMode(){var m=Q.macroModeState;m.onRecordingDone&&m.onRecordingDone(),m.onRecordingDone=void 0,m.isRecording=!1}enterMacroRecordMode(m,v){var b=Q.registerController.getRegister(v);if(b){if(b.clear(),this.latestRegister=v,m.openDialog){var x=Nn("span",{class:"cm-vim-message"},"recording @"+v);this.onRecordingDone=m.openDialog(x,function(){},{bottom:!0})}this.isRecording=!0}}}function se(u){return u.state.vim||(u.state.vim={inputState:new vr,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeReturn:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:void 0,sel:{anchor:new n(0,0),head:new n(0,0)},options:{},expectLiteralNext:!1,status:""}),u.state.vim}var Q;function Le(){for(var u in Q={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:Ce(),macroModeState:new re,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new On({}),searchHistoryController:new br,exCommandHistoryController:new br},fe){var m=fe[u];m.value=m.defaultValue}}class Fe{constructor(m,v){this.keyName=m,this.key=v.key,this.ctrlKey=v.ctrlKey,this.altKey=v.altKey,this.metaKey=v.metaKey,this.shiftKey=v.shiftKey}}var et,Be={enterVimMode:p,leaveVimMode:y,buildKeyMap:function(){},getRegisterController:function(){return Q.registerController},resetVimGlobalState_:Le,getVimGlobalState_:function(){return Q},maybeInitVimState_:se,suppressErrorLogging:!1,InsertModeKey:Fe,map:function(u,m,v){_n.map(u,m,v)},unmap:function(u,m){return _n.unmap(u,m)},noremap:function(u,m,v){_n.map(u,m,v,!0)},mapclear:function(u){var m=o.length,v=c,b=o.slice(0,m-v);if(o=o.slice(m-v),u)for(var x=b.length-1;x>=0;x--){var k=b[x];if(u!==k.context)if(k.context)this._mapCommand(k);else{var R=["normal","insert","visual"];for(var O in R)if(R[O]!==u){var L=Object.assign({},k);L.context=R[O],this._mapCommand(L)}}}},langmap:wt,vimKeyFromEvent:tn,setOption:J,getOption:be,defineOption:we,defineEx:function(u,m,v){if(!m)m=u;else if(u.indexOf(m)!==0)throw Error('(Vim.defineEx) "'+m+'" is not a prefix of "'+u+'", command not registered');xr[u]=v,_n.commandMap_[m]={name:u,shortName:m,type:"api"}},handleKey:function(u,m,v){var b=this.findKey(u,m,v);if(typeof b=="function")return b()},multiSelectHandleKey:Si,findKey:function(u,m,v){var b=se(u),x=u;function k(){var q=Q.macroModeState;if(q.isRecording){if(m=="q")return q.exitMacroRecordMode(),pt(x),!0;v!="mapping"&&$r(q,m)}}function R(){if(m=="<Esc>"){if(b.visualMode)Ye(x);else if(b.insertMode)Vn(x);else return;return pt(x),!0}}function O(){if(R())return!0;b.inputState.keyBuffer.push(m);var q=b.inputState.keyBuffer.join(""),oe=m.length==1,ie=Pn.matchCommand(q,o,b.inputState,"insert"),X=b.inputState.changeQueue;if(ie.type=="none")return pt(x),!1;if(ie.type=="partial"){if(ie.expectLiteralNext&&(b.expectLiteralNext=!0),et&&window.clearTimeout(et),et=oe&&window.setTimeout(function(){b.insertMode&&b.inputState.keyBuffer.length&&pt(x)},be("insertModeEscKeysTimeout")),oe){var Y=x.listSelections();(!X||X.removed.length!=Y.length)&&(X=b.inputState.changeQueue=new Fr),X.inserted+=m;for(var xe=0;xe<Y.length;xe++){var _e=kt(Y[xe].anchor,Y[xe].head),qe=zn(Y[xe].anchor,Y[xe].head),Re=x.getRange(_e,x.state.overwrite?_t(qe,0,1):qe);X.removed[xe]=(X.removed[xe]||"")+Re}}return!oe}else ie.type=="full"&&(b.inputState.keyBuffer.length=0);if(b.expectLiteralNext=!1,et&&window.clearTimeout(et),ie.command&&X){for(var Y=x.listSelections(),xe=0;xe<Y.length;xe++){var Ne=Y[xe].head;x.replaceRange(X.removed[xe]||"",_t(Ne,0,-X.inserted.length),Ne,"+input")}Q.macroModeState.lastInsertModeChanges.changes.pop()}return ie.command||pt(x),ie.command}function L(){if(k()||R())return!0;b.inputState.keyBuffer.push(m);var q=b.inputState.keyBuffer.join("");if(/^[1-9]\d*$/.test(q))return!0;var oe=/^(\d*)(.*)$/.exec(q);if(!oe)return pt(x),!1;var ie=b.visualMode?"visual":"normal",X=oe[2]||oe[1];b.inputState.operatorShortcut&&b.inputState.operatorShortcut.slice(-1)==X&&(X=b.inputState.operatorShortcut);var Y=Pn.matchCommand(X,o,b.inputState,ie);return Y.type=="none"?(pt(x),!1):Y.type=="partial"?(Y.expectLiteralNext&&(b.expectLiteralNext=!0),!0):Y.type=="clear"?(pt(x),!0):(b.expectLiteralNext=!1,b.inputState.keyBuffer.length=0,oe=/^(\d*)(.*)$/.exec(q),oe&&oe[1]&&oe[1]!="0"&&b.inputState.pushRepeatDigit(oe[1]),Y.command)}var z=b.insertMode?O():L();if(z===!1)return!b.insertMode&&(m.length===1||e.isMac&&/<A-.>/.test(m))?function(){return!0}:void 0;if(z===!0)return function(){return!0};if(z)return function(){return x.operation(function(){x.curOp.isVimOp=!0;try{if(typeof z!="object")return;z.type=="keyToKey"?mt(x,z.toKeys,z):Pn.processCommand(x,b,z)}catch(q){throw x.state.vim=void 0,se(x),Be.suppressErrorLogging||console.log(q),q}return!0})}},handleEx:function(u,m){_n.processCommand(u,m)},defineMotion:ta,defineAction:ni,defineOperator:yi,mapCommand:xc,_mapCommand:oi,defineRegister:mi,exitVisualMode:Ye,exitInsertMode:Vn},je=[],Pe=!1,Ae;function ft(u){if(!Ae)throw Error("No prompt to send key to");if(u[0]=="<"){var m=u.toLowerCase().slice(1,-1);if(m=m.split("-").pop()||"",m=="lt")u="<";else if(m=="space")u=" ";else if(m=="cr")u=`
88
+ `)}function wS(e,n){return{get:()=>n.get(e),sub:i=>n.sub(e,()=>i(n.get(e)))}}function _S(e,{offset:n,body:i=window,behavior:o="smooth"}){let s=(n==null?void 0:n.top)??0,c=(n==null?void 0:n.bottom)??0,d=e.getBoundingClientRect();if(d.top<s){i.scrollBy({top:d.top-s,behavior:o});return}if(d.bottom>window.innerHeight-c){i.scrollBy({top:d.bottom-window.innerHeight+c,behavior:o});return}}Ku=function(e){return e?e.state.field(Lr).type:"python"};function xS(e,n){return!e||Ku(e)===n?!1:e.state.doc.toString().trim()===""?!0:gr[n].isSupported(Xr(e))}Nm=function(e,n,i={}){return!i.force&&!xS(e,n)?!1:(wm(e,{language:n}),n)};function kS(e){return Ra.of([{key:e.getHotkey("cell.format").key,preventDefault:!0,run:n=>(dd({[n.state.facet(Wi)]:n}),!0)},{key:e.getHotkey("cell.viewAsMarkdown").key,preventDefault:!0,run:n=>{let i=Ku(n);if(i!=="markdown"&&i!=="python")return!1;let o=Nm(n,i==="python"?"markdown":"python",{force:!0});return o==="markdown"&&n.state.facet(Pt).afterToggleMarkdown(),o!==!1}}])}lx=function(){return Kt.updateListener.of(e=>{if(e.view.hasFocus&&e.heightChanged&&e.docChanged){if(e.transactions.some(n=>n.effects.some(i=>i.is(Ms))))return;ny(e.view,{behavior:"smooth"})}})};function ny(e,n){let i=e.dom.getElementsByClassName("cm-activeLine cm-line");if(i.length===1){let o=i[0],s=document.getElementById("App");In(s,"App not found"),_S(o,{offset:{top:30,bottom:150},body:s,behavior:n.behavior})}}function SS(){return{}}let CS,ES,ry;({reducer:CS,createActions:ES,valueAtom:La,useActions:ry}=Ml(SS,{setVariables:(e,n)=>{let i={...e},o={};for(let s of n)o[s.name]={...i[s.name],...s};return o},addVariables:(e,n)=>{let i={...e};for(let o of n)i[o.name]={...i[o.name],...o};return i},setMetadata:(e,n)=>{let i={...e};for(let{name:o,value:s,dataType:c}of n)i[o]&&(i[o]={...i[o],value:s,dataType:c});return i}})),C_=()=>Zn(La),p_=function(){return ry()},j_=function(e){let n=e.storage||Ts;return{getItem(i,o){try{let s=n.getItem(i);if(!s)return o;let c=JSON.parse(s);return e.fromSerializable(c)}catch(s){return Se.warn(`Error getting ${i} from storage`,s),o}},setItem:(i,o)=>{n.setItem(i,JSON.stringify(e.toSerializable(o)))},removeItem:i=>{n.removeItem(i)}}},Hl=Km(()=>Ts);function TS(e,n){if(typeof window>"u")return;let i=`__marimo__${n}`;window[i]&&Se.warn(`Overwriting existing debug object ${i}`),window[i]=e}var RS={markdown:!0,wasm_layouts:!1,rtc_v2:!1,cache_panel:!1,external_agents:!1,server_side_pdf_export:!0};sd=function(e){var n,i;return((i=(n=ew())==null?void 0:n.experimental)==null?void 0:i[e])??RS[e]};function DS(e,n){Vi().saveUserConfig({config:{experimental:{[e]:n}}})}TS(DS,"setFeatureFlag"),Wl=[{type:"files",Icon:Dg,label:"Files",tooltip:"View files",defaultSection:"sidebar"},{type:"variables",Icon:Sm,label:"Variables",tooltip:"Explore variables and data sources",defaultSection:"sidebar"},{type:"packages",Icon:um,label:"Packages",tooltip:"Manage packages",defaultSection:"sidebar"},{type:"ai",Icon:sm,label:"AI",tooltip:"Chat & Agents",defaultSection:"sidebar"},{type:"outline",Icon:Nh,label:"Outline",tooltip:"View outline",defaultSection:"sidebar"},{type:"documentation",Icon:Qh,label:"Docs",tooltip:"View live docs",defaultSection:"sidebar"},{type:"dependencies",Icon:Zh,label:"Dependencies",tooltip:"Explore dependencies",defaultSection:"sidebar"},{type:"errors",Icon:$h,label:"Errors",tooltip:"View errors",defaultSection:"developer-panel"},{type:"scratchpad",Icon:Wh,label:"Scratchpad",tooltip:"Scratchpad",defaultSection:"developer-panel"},{type:"tracing",Icon:Yh,label:"Tracing",tooltip:"View tracing",defaultSection:"developer-panel"},{type:"secrets",Icon:Og,label:"Secrets",tooltip:"Manage secrets",defaultSection:"developer-panel",hidden:vh()},{type:"logs",Icon:nm,label:"Logs",tooltip:"View logs",defaultSection:"developer-panel"},{type:"terminal",Icon:Jh,label:"Terminal",tooltip:"Terminal",hidden:vh(),defaultSection:"developer-panel",requiredCapability:"terminal"},{type:"snippets",Icon:Pg,label:"Snippets",tooltip:"Snippets",defaultSection:"developer-panel"},{type:"cache",Icon:wD,label:"Cache",tooltip:"View cache",defaultSection:"developer-panel",hidden:!sd("cache_panel")}],w_=new Map(Wl.map(e=>[e.type,e])),x_=function(e,n){return!!(e.hidden||e.requiredCapability&&!n[e.requiredCapability])};var OS=Jr();Pm=Bl("marimo:panel-layout",{sidebar:Wl.filter(e=>!e.hidden&&e.defaultSection==="sidebar").map(e=>e.type),developerPanel:Wl.filter(e=>!e.hidden&&e.defaultSection==="developer-panel").map(e=>e.type)},Hl,{getOnInit:!0});function iy(e){let n=lt.get(Pm);return n.sidebar.includes(e)?"sidebar":n.developerPanel.includes(e)?"developer-panel":null}var ay="marimo:sidebar",oy=new Vu(G2({selectedPanel:J2().optional().transform(e=>e),isSidebarOpen:X2(),isDeveloperPanelOpen:X2().optional().default(!1),selectedDeveloperPanelTab:J2().optional().default("errors").transform(e=>e)}),PS);function PS(){return{selectedPanel:"variables",isSidebarOpen:!1,isDeveloperPanelOpen:!1,selectedDeveloperPanelTab:"errors"}}let MS,LS,sy;({reducer:MS,createActions:LS,valueAtom:ad,useActions:sy}=Ml(()=>oy.get(ay),{openApplication:(e,n)=>{let i=iy(n);return i==="sidebar"?{...e,selectedPanel:n,isSidebarOpen:!0}:i==="developer-panel"?{...e,selectedDeveloperPanelTab:n,isDeveloperPanelOpen:!0}:e},toggleApplication:(e,n)=>{let i=iy(n);return i==="sidebar"?{...e,selectedPanel:n,isSidebarOpen:e.isSidebarOpen?e.selectedPanel!==n:!0}:i==="developer-panel"?{...e,selectedDeveloperPanelTab:n,isDeveloperPanelOpen:e.isDeveloperPanelOpen?e.selectedDeveloperPanelTab!==n:!0}:e},toggleSidebarPanel:e=>({...e,isSidebarOpen:!e.isSidebarOpen}),setIsSidebarOpen:(e,n)=>({...e,isSidebarOpen:n}),toggleDeveloperPanel:e=>({...e,isDeveloperPanelOpen:!e.isDeveloperPanelOpen}),setIsDeveloperPanelOpen:(e,n)=>({...e,isDeveloperPanelOpen:n})},[(e,n)=>oy.set(ay,n)])),I_=()=>{let e=(0,OS.c)(2),n=Zn(ad);if(n.isSidebarOpen)return n;let i;return e[0]===n?i=e[1]:(i={...n,selectedPanel:void 0},e[0]=n,e[1]=i),i},y_=function(){return sy()},mm=ze({terminal:!1,pylsp:!1,basedpyright:!1,ty:!1});function ac(e){var n;return((n=lt.get(mm))==null?void 0:n[e])??!1}ed=ze({documentation:null});var ly=new Set(["FunctionDefinition","LambdaExpression","ArrayComprehensionExpression","SetComprehension","DictionaryComprehensionExpression","ComprehensionExpression","ClassDefinition"]);function NS(e){let n=aw(e.state);if(!n||qS(n))return[];let i=new Set(Object.keys(e.variables).filter(E=>{let T=e.variables[E];return T.dataType!=="module"&&!T.declaredBy.includes("setup")&&!T.declaredBy.includes(e.cellId)}));if(i.size===0)return[];let o=[],s=new Map,c=new Map,d=new Map;function f(E,T){var K,pe,P,A,W,de,fe,we,J,be,Ce;let I=E.cursor(),$=I.name,V=I.from,F=ly.has($),N=T;switch(F&&(N=[...T,V],s.set(V,new Set),c.set(V,$)),$){case"FunctionDefinition":{let Z=E.cursor();Z.firstChild();do if(Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to),Q=T[T.length-1]??-1;s.has(Q)||s.set(Q,new Set),(K=s.get(Q))==null||K.add(se);break}while(Z.nextSibling());let re=E.cursor();re.firstChild();do if(re.name==="ParamList"){let se=re.node.cursor();se.firstChild();do if(se.name==="VariableName"){let Q=e.state.doc.sliceString(se.from,se.to);(pe=s.get(V))==null||pe.add(Q)}while(se.nextSibling())}while(re.nextSibling());break}case"LambdaExpression":{let Z=E.cursor();Z.firstChild();do if(Z.name==="ParamList"){let re=Z.node.cursor();re.firstChild();do if(re.name==="VariableName"){let se=e.state.doc.sliceString(re.from,re.to);(P=s.get(V))==null||P.add(se)}while(re.nextSibling())}while(Z.nextSibling());break}case"ArrayComprehensionExpression":case"DictionaryComprehensionExpression":case"SetComprehension":case"ComprehensionExpression":{let Z=E.cursor();Z.firstChild();let re=!1;do if(Z.name==="for")re=!0;else if(re&&Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to);(A=s.get(V))==null||A.add(se)}else if(re&&Z.name==="TupleExpression"){let se=Z.node.cursor();se.firstChild();do if(se.name==="VariableName"){let Q=e.state.doc.sliceString(se.from,se.to);(W=s.get(V))==null||W.add(Q)}while(se.nextSibling())}else re&&Z.name==="in"&&(re=!1);while(Z.nextSibling());break}case"ClassDefinition":{let Z=E.cursor();Z.firstChild();do if(Z.name==="VariableName"){let re=e.state.doc.sliceString(Z.from,Z.to),se=T[T.length-1]??-1;s.has(se)||s.set(se,new Set),(de=s.get(se))==null||de.add(re);break}while(Z.nextSibling());d.set(V,[]);break}case"AssignStatement":{let Z=E.cursor(),re=[];Z.firstChild();do Z.name==="AssignOp"&&re.push(Z.from);while(Z.nextSibling());let se=re[re.length-1],Q=E.cursor();Q.firstChild();let Le=N[N.length-1]??-1;do Q.from<se&&Ud(Q,{currentScope:Le,state:e.state,allDeclarations:s,scopeTypes:c,classLevelDeclarations:d,assignmentPosition:I.to});while(Q.nextSibling());break}case"ForStatement":{let Z=E.cursor();Z.firstChild();let re=!1;do if(Z.name==="for")re=!0;else if(re&&Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to),Q=N[N.length-1]??-1;s.has(Q)||s.set(Q,new Set),(fe=s.get(Q))==null||fe.add(se)}else re&&Z.name==="in"&&(re=!1);while(Z.nextSibling());break}case"ImportStatement":{let Z=E.cursor();Z.firstChild();do if(Z.name==="VariableName"){let re=e.state.doc.sliceString(Z.from,Z.to),se=N[N.length-1]??-1;s.has(se)||s.set(se,new Set),(we=s.get(se))==null||we.add(re)}while(Z.nextSibling());break}case"ImportFromStatement":{let Z=E.cursor();Z.firstChild();let re=!1;do if(Z.name==="import")re=!0;else if(re&&Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to),Q=N[N.length-1]??-1;s.has(Q)||s.set(Q,new Set),(J=s.get(Q))==null||J.add(se)}while(Z.nextSibling());break}case"TryStatement":{let Z=E.cursor();Z.firstChild();let re=!1;do if(Z.name==="as")re=!0;else if(re&&Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to),Q=N[N.length-1]??-1;s.has(Q)||s.set(Q,new Set),(be=s.get(Q))==null||be.add(se),re=!1}while(Z.nextSibling());break}case"WithStatement":{let Z=E.cursor();Z.firstChild();let re=!1;do if(Z.name==="as")re=!0;else if(re&&Z.name==="VariableName"){let se=e.state.doc.sliceString(Z.from,Z.to),Q=N[N.length-1]??-1;s.has(Q)||s.set(Q,new Set),(Ce=s.get(Q))==null||Ce.add(se),re=!1}while(Z.nextSibling());break}}C(I,Z=>{f(Z,N)})}function p(E,T,I){let $=d.get(T);return $?$.some(([V,F])=>V===E&&F<I):!1}function y(E,T,I){var $,V;for(let F of T)if(c.get(F)==="ClassDefinition"){if(p(E,F,I))return!0}else if(($=s.get(F))!=null&&$.has(E))return!0;return((V=s.get(-1))==null?void 0:V.has(E))??!1}function w(E,T){let I=E.cursor(),$=I.name,V=I.from,F=ly.has($),N=T;if(F&&(N=[...T,V]),$==="VariableName"){let K=e.state.doc.sliceString(I.from,I.to);_(K,I)&&(y(K,N,I.from)||o.push({from:I.from,to:I.to,variableName:K}))}C(I,K=>{w(K,N)})}function _(E,T){return i.has(E)&&!IS(T)&&!AS(T)}function C(E,T){if(E.firstChild())do T(E.node);while(E.nextSibling())}return f(n,[]),w(n,[]),o}function IS(e){let n=e.node.cursor();if(n.moveTo(e.from),n.parent()&&n.name==="CallExpression"&&n.firstChild())do if(n.name==="ArgList"&&n.firstChild()){do if(n.from===e.from&&n.to===e.to)return n.nextSibling()&&n.name==="AssignOp";while(n.nextSibling());break}while(n.nextSibling());return!1}function AS(e){let n=e.node.cursor();if(n.parent()&&n.name==="AssignStatement"){let i=n.node.cursor();i.firstChild();let o=-1;do if(i.name==="AssignOp"){o=i.from;break}while(i.nextSibling());return o!==-1&&e.from<o}return!1}function qS(e){let n=e.cursor();do if(n.name==="\u26A0"||n.type.isError)return!0;while(n.next());return!1}function Ud(e,n){var i;switch(e.name){case"VariableName":{let o=n.state.doc.sliceString(e.from,e.to);if(n.currentScope!==-1&&n.scopeTypes.get(n.currentScope)==="ClassDefinition"){let s=n.classLevelDeclarations.get(n.currentScope);s&&s.push([o,n.assignmentPosition])}else n.allDeclarations.has(n.currentScope)||n.allDeclarations.set(n.currentScope,new Set),(i=n.allDeclarations.get(n.currentScope))==null||i.add(o);break}case"TupleExpression":{let o=e.node.cursor();o.firstChild();do Ud(o,n);while(o.nextSibling());break}case"ArrayExpression":{let o=e.node.cursor();o.firstChild();do Ud(o,n);while(o.nextSibling());break}}}var jS=Hi.mark({class:"mo-cm-reactive-reference"});Z_=Hi.mark({class:"mo-cm-reactive-reference-hover"});var cy=Bi.define(),zS=class{constructor(e,n){ke(this,"highlightDebounceMs",300);this.view=e,this.cellId=n,this.scheduleHighlighting=Y2(()=>{this.runHighlighting()},this.highlightDebounceMs),this.variablesUnsubscribe=lt.sub(La,()=>{this.scheduleHighlighting()}),this.scheduleHighlighting()}update(e){(e.docChanged||e.focusChanged)&&this.scheduleHighlighting()}destroy(){this.scheduleHighlighting.cancel(),this.variablesUnsubscribe()}runHighlighting(){let e=NS({state:this.view.state,cellId:this.cellId,variables:lt.get(La)});e.length>0&&Se.debug(`Found ${e.length} reactive variables in cell ${this.cellId}`),queueMicrotask(()=>{this.view.dispatch({effects:cy.of(e)})})}};cd=xs.define({create(){return{decorations:Hi.none,ranges:[]}},update(e,n){let i={decorations:e.decorations.map(n.changes),ranges:e.ranges};for(let o of n.effects)o.is(cy)&&(i={decorations:Hi.set(o.value.map(s=>jS.range(s.from,s.to))),ranges:o.value});return i},provide:e=>Kt.decorations.from(e,n=>n.decorations)});function FS(e){return[cd,Ol.define(n=>new zS(n,e))]}F_=function(e,n){return n?FS(e):[]};function uy(e,n=!1){if(!e)return null;let i=document.createElement("span");if(i.classList.add("mo-cm-tooltip"),i.classList.add("docs-documentation"),n&&i.classList.add("cm-tooltip-section"),i.style.display="flex",i.style.flexDirection="column",i.style.gap=".8rem",i.innerHTML=e,n){let o=document.createElement("div");o.classList.add("text-xs","text-muted-foreground","font-medium","pt-1","-mt-2","border-t","border-border");let s=document.createElement("kbd");s.className="ml-1 rounded-md bg-muted/40 px-2 text-[0.75rem] font-prose center border border-foreground/20 text-muted-foreground inline whitespace-nowrap",s.textContent=y4()?"\u2318":"Ctrl",o.append(document.createTextNode("Jump to defining cell ")),o.append(s),o.append(document.createTextNode(" + Click")),i.append(o)}return i}Qu=new Lu("autocomplete-result",async(e,n)=>{let{sendCodeCompletionRequest:i}=Vi();await i({id:e,...n})});var BS={param:3,property:2};const Kd={asCompletionResult(e,n){return{from:e-n.prefix_length,options:n.options.map(i=>({label:i.name,type:i.type,boost:BS[i.type]??1,info:()=>uy(i.completion_info)})),validFor:/^\w*$/}},asHoverTooltip({position:e,message:n,limitToType:i,excludeTypes:o,exactName:s,showGoToDefinitionHint:c=!1}){let d=HS(n.options,s);if(!d)return;let f=e-n.prefix_length,p=uy(d.completion_info,c);if(p&&!(i&&d.type!==i)&&!(o!=null&&o.includes(d.type)))return{pos:f,html:d.completion_info,end:f+d.name.length,above:!0,create:()=>({dom:p,resize:!1})}}};function HS(e,n){if(e.length!==0){if(e.length===1)return e[0];if(n)return e.find(i=>i.name===n)}}Dw=function(e){var n;return[(n=e==null?void 0:e.pylsp)!=null&&n.enabled&&ac("pylsp")?[]:wh(async(i,o)=>{let s=await dy({view:i,pos:o,excludeTypes:["tooltip"]});return s===null||s==="cancelled"?null:s},{hideOnChange:!0}),WS]};async function dy({view:e,pos:n,excludeTypes:i}){var w;let o=er.findElement(e.dom);if(!o)return Se.error("Failed to find active cell."),null;let s=er.parse(o.id),{startToken:c,endToken:d}=Qd(e.state.doc,n),f=((w=e.state.field(cd,!1))==null?void 0:w.ranges.some(_=>n>=_.from&&n<=_.to))??!1,p=await Qu.request({document:e.state.doc.slice(0,d).toString(),cellId:s});if(!p)return"cancelled";let y=e.state.doc.slice(c,d).toString();return Kd.asHoverTooltip({position:d,message:p,exactName:y,excludeTypes:i,showGoToDefinitionHint:f})??null}function Qd(e,n){let i=n,o=i>0?e.sliceString(i-1,i):"",s=i<e.length?e.sliceString(i,i+1):"";o==="("&&s===")"&&--i;let c=i,d=i;for(;c>0;){let f=e.sliceString(c-1,c);if(!/\w/.test(f))break;c--}for(;d<e.length;){let f=e.sliceString(d,d+1);if(!/\w/.test(f))break;d++}return{startToken:c,endToken:d}}function VS(e){let{head:n}=e.selection.main,i=e.doc.sliceString(n-1,n);return/\w/.test(i)}var $S=Y2(async(e,n)=>{if(lt.get(ad).selectedPanel!=="documentation")return;let i=await dy({view:e,pos:n});i!=="cancelled"&&lt.set(ed,{documentation:(i==null?void 0:i.html)??null})},300),WS=Kt.updateListener.of(e=>{if(e.selectionSet&&VS(e.state)){let n=e.state.selection.main.head;$S(e.view,n)}});function fy(e,n){e.focus(),requestAnimationFrame(()=>{e.dispatch({selection:{anchor:n,head:n},effects:Kt.scrollIntoView(n,{y:"center"})})})}Hu=function(e,n){let{state:i}=e,o=aw(i),s=!1,c=0;return o.iterate({enter:d=>{if(s)return!1;if(d.name==="VariableName"&&i.doc.sliceString(d.from,d.to)===n)return c=d.from,s=!0,!1;if(d.name==="Comment"||d.name==="String")return!1}}),s?(fy(e,c),!0):!1};function US(e,n){return fy(e,e.state.doc.line(n).from),!0}function KS(e){let{from:n,to:i}=e.selection.main;if(n===i){let{startToken:o,endToken:s}=Qd(e.doc,n);return e.doc.sliceString(o,s)}return e.doc.sliceString(n,i)}function QS(e,n){if(!n)return null;let i=e[n];return!i||i.declaredBy.length===0?null:i.declaredBy[0]}function GS(e){return e.startsWith("_")}pm=function(e){let{state:n}=e,i=KS(n);return i?(bw(e),e.dispatch({effects:j4}),lm(e,i)):!1},lm=function(e,n){let i=JS(e,n);return i?Hu(i,n):!1},d_=function(e,n){let i=py(e);return i?US(i,n):!1};function JS(e,n){if(GS(n))return e;let i=QS(lt.get(La),n);return i?py(i):null}function py(e){var n;return((n=lt.get(bt).cellHandles[e].current)==null?void 0:n.editorView)??null}function XS(e){var n=e.Pos;function i(u,m,v){if(m.line===v.line&&m.ch>=v.ch-1){var b=u.getLine(m.line).charCodeAt(m.ch);55296<=b&&b<=55551&&(v.ch+=1)}return{start:m,end:v}}var o=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"g<Up>",type:"keyToKey",toKeys:"gk"},{keys:"g<Down>",type:"keyToKey",toKeys:"gj"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h"},{keys:"<Del>",type:"keyToKey",toKeys:"x"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"keyToKey",toKeys:"i",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"g$",type:"motion",motion:"moveToEndOfDisplayLine"},{keys:"g^",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"g0",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{keys:"gq",type:"operator",operator:"hardWrap"},{keys:"gw",type:"operator",operator:"hardWrap",operatorArgs:{keepCursor:!0}},{keys:"g?",type:"operator",operator:"rot13"},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-u>",type:"operatorMotion",operator:"delete",motion:"moveToStartOfLine",context:"insert"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<register>",type:"action",action:"replayMacro"},{keys:"q<register>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<register>",type:"action",action:"setMark"},{keys:'"<register>',type:"action",action:"setRegister"},{keys:"<C-r><register>",type:"action",action:"insertRegister",context:"insert",isEdit:!0},{keys:"<C-o>",type:"action",action:"oneNormalCommand",context:"insert"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<register>",type:"motion",motion:"textObjectManipulation"},{keys:"i<register>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],s=Object.create(null),c=o.length,d=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"omap",shortName:"om"},{name:"noremap",shortName:"no"},{name:"nnoremap",shortName:"nn"},{name:"vnoremap",shortName:"vn"},{name:"inoremap",shortName:"ino"},{name:"onoremap",shortName:"ono"},{name:"unmap"},{name:"mapclear",shortName:"mapc"},{name:"nmapclear",shortName:"nmapc"},{name:"vmapclear",shortName:"vmapc"},{name:"imapclear",shortName:"imapc"},{name:"omapclear",shortName:"omapc"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"startinsert",shortName:"start"},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"marks",excludeFromCommandHistory:!0},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"vglobal",shortName:"v"},{name:"delete",shortName:"d"},{name:"join",shortName:"j"},{name:"normal",shortName:"norm"},{name:"global",shortName:"g"}],f=vn("");function p(u){u.setOption("disableInput",!0),u.setOption("showCursorWhenSelecting",!1),e.signal(u,"vim-mode-change",{mode:"normal"}),u.on("cursorActivity",$o),se(u),e.on(u.getInputField(),"paste",w(u))}function y(u){u.setOption("disableInput",!1),u.off("cursorActivity",$o),e.off(u.getInputField(),"paste",w(u)),u.state.vim=null,sa&&clearTimeout(sa)}function w(u){var m=u.state.vim;return m.onPasteFn||(m.onPasteFn=function(){m.insertMode||(u.setCursor(_t(u.getCursor(),0,1)),fn.enterInsertMode(u,{},m))}),m.onPasteFn}var _=/[\d]/,C=[e.isWordChar,function(u){return u&&!e.isWordChar(u)&&!/\s/.test(u)}],E=[function(u){return/\S/.test(u)}],T=["<",">"],I=["-",'"',".",":","_","/","+"],$=/^\w$/,V=/^[A-Z]$/;try{V=RegExp("^[\\p{Lu}]$","u")}catch{}function F(u,m){return m>=u.firstLine()&&m<=u.lastLine()}function N(u){return/^[a-z]$/.test(u)}function K(u){return"()[]{}".indexOf(u)!=-1}function pe(u){return _.test(u)}function P(u){return V.test(u)}function A(u){return/^\s*$/.test(u)}function W(u){return".?!".indexOf(u)!=-1}function de(u,m){for(var v=0;v<m.length;v++)if(m[v]==u)return!0;return!1}var fe={};function we(u,m,v,b,x){if(m===void 0&&!x)throw Error("defaultValue is required unless callback is provided");if(v||(v="string"),fe[u]={type:v,defaultValue:m,callback:x},b)for(var k=0;k<b.length;k++)fe[b[k]]=fe[u];m&&J(u,m)}function J(u,m,v,b){var x=fe[u];b||(b={});var k=b.scope;if(!x)return Error("Unknown option: "+u);if(x.type=="boolean"){if(m&&m!==!0)return Error("Invalid argument: "+u+"="+m);m!==!1&&(m=!0)}x.callback?(k!=="local"&&x.callback(m,void 0),k!=="global"&&v&&x.callback(m,v)):(k!=="local"&&(x.value=x.type=="boolean"?!!m:m),k!=="global"&&v&&(v.state.vim.options[u]={value:m}))}function be(u,m,v){var b=fe[u];v||(v={});var x=v.scope;if(!b)return Error("Unknown option: "+u);if(b.callback){let k=m&&b.callback(void 0,m);return x!=="global"&&k!==void 0?k:x==="local"?void 0:b.callback()}else return(x!=="global"&&m&&m.state.vim.options[u]||x!=="local"&&b||{}).value}we("filetype",void 0,"string",["ft"],function(u,m){if(m!==void 0)if(u===void 0){let v=m.getOption("mode");return v=="null"?"":v}else{let v=u==""?"null":u;m.setOption("mode",v)}}),we("textwidth",80,"number",["tw"],function(u,m){if(m!==void 0){if(u===void 0)return m.getOption("textwidth");var v=Math.round(u);v>1&&m.setOption("textwidth",v)}});var Ce=function(){var u=100,m=-1,v=0,b=0,x=Array(u);function k(L,z,q){var oe=x[m%u];function ie(Y){var xe=++m%u,_e=x[xe];_e&&_e.clear(),x[xe]=L.setBookmark(Y)}if(oe){var X=oe.find();X&&!gt(X,z)&&ie(z)}else ie(z);ie(q),v=m,b=m-u+1,b<0&&(b=0)}function R(L,z){m+=z,m>v?m=v:m<b&&(m=b);var q=x[(u+m)%u];if(q&&!q.find()){var oe=z>0?1:-1,ie,X=L.getCursor();do if(m+=oe,q=x[(u+m)%u],q&&(ie=q.find())&&!gt(X,ie))break;while(m<v&&m>b)}return q}function O(L,z){var q=m,oe=R(L,z);return m=q,oe&&oe.find()}return{cachedCursor:void 0,add:k,find:O,move:R}},Z=function(u){return u?{changes:u.changes,expectCursorActivityForChange:u.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class re{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=Z()}exitMacroRecordMode(){var m=Q.macroModeState;m.onRecordingDone&&m.onRecordingDone(),m.onRecordingDone=void 0,m.isRecording=!1}enterMacroRecordMode(m,v){var b=Q.registerController.getRegister(v);if(b){if(b.clear(),this.latestRegister=v,m.openDialog){var x=Nn("span",{class:"cm-vim-message"},"recording @"+v);this.onRecordingDone=m.openDialog(x,function(){},{bottom:!0})}this.isRecording=!0}}}function se(u){return u.state.vim||(u.state.vim={inputState:new vr,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeReturn:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:void 0,sel:{anchor:new n(0,0),head:new n(0,0)},options:{},expectLiteralNext:!1,status:""}),u.state.vim}var Q;function Le(){for(var u in Q={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:Ce(),macroModeState:new re,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new On({}),searchHistoryController:new br,exCommandHistoryController:new br},fe){var m=fe[u];m.value=m.defaultValue}}class Fe{constructor(m,v){this.keyName=m,this.key=v.key,this.ctrlKey=v.ctrlKey,this.altKey=v.altKey,this.metaKey=v.metaKey,this.shiftKey=v.shiftKey}}var et,Be={enterVimMode:p,leaveVimMode:y,buildKeyMap:function(){},getRegisterController:function(){return Q.registerController},resetVimGlobalState_:Le,getVimGlobalState_:function(){return Q},maybeInitVimState_:se,suppressErrorLogging:!1,InsertModeKey:Fe,map:function(u,m,v){_n.map(u,m,v)},unmap:function(u,m){return _n.unmap(u,m)},noremap:function(u,m,v){_n.map(u,m,v,!0)},mapclear:function(u){var m=o.length,v=c,b=o.slice(0,m-v);if(o=o.slice(m-v),u)for(var x=b.length-1;x>=0;x--){var k=b[x];if(u!==k.context)if(k.context)this._mapCommand(k);else{var R=["normal","insert","visual"];for(var O in R)if(R[O]!==u){var L=Object.assign({},k);L.context=R[O],this._mapCommand(L)}}}},langmap:wt,vimKeyFromEvent:tn,setOption:J,getOption:be,defineOption:we,defineEx:function(u,m,v){if(!m)m=u;else if(u.indexOf(m)!==0)throw Error('(Vim.defineEx) "'+m+'" is not a prefix of "'+u+'", command not registered');xr[u]=v,_n.commandMap_[m]={name:u,shortName:m,type:"api"}},handleKey:function(u,m,v){var b=this.findKey(u,m,v);if(typeof b=="function")return b()},multiSelectHandleKey:Si,findKey:function(u,m,v){var b=se(u),x=u;function k(){var q=Q.macroModeState;if(q.isRecording){if(m=="q")return q.exitMacroRecordMode(),pt(x),!0;v!="mapping"&&$r(q,m)}}function R(){if(m=="<Esc>"){if(b.visualMode)Ye(x);else if(b.insertMode)Vn(x);else return;return pt(x),!0}}function O(){if(R())return!0;b.inputState.keyBuffer.push(m);var q=b.inputState.keyBuffer.join(""),oe=m.length==1,ie=Pn.matchCommand(q,o,b.inputState,"insert"),X=b.inputState.changeQueue;if(ie.type=="none")return pt(x),!1;if(ie.type=="partial"){if(ie.expectLiteralNext&&(b.expectLiteralNext=!0),et&&window.clearTimeout(et),et=oe&&window.setTimeout(function(){b.insertMode&&b.inputState.keyBuffer.length&&pt(x)},be("insertModeEscKeysTimeout")),oe){var Y=x.listSelections();(!X||X.removed.length!=Y.length)&&(X=b.inputState.changeQueue=new Fr),X.inserted+=m;for(var xe=0;xe<Y.length;xe++){var _e=kt(Y[xe].anchor,Y[xe].head),qe=zn(Y[xe].anchor,Y[xe].head),Re=x.getRange(_e,x.state.overwrite?_t(qe,0,1):qe);X.removed[xe]=(X.removed[xe]||"")+Re}}return!oe}else ie.type=="full"&&(b.inputState.keyBuffer.length=0);if(b.expectLiteralNext=!1,et&&window.clearTimeout(et),ie.command&&X){for(var Y=x.listSelections(),xe=0;xe<Y.length;xe++){var Ne=Y[xe].head;x.replaceRange(X.removed[xe]||"",_t(Ne,0,-X.inserted.length),Ne,"+input")}Q.macroModeState.lastInsertModeChanges.changes.pop()}return ie.command||pt(x),ie.command}function L(){if(k()||R())return!0;b.inputState.keyBuffer.push(m);var q=b.inputState.keyBuffer.join("");if(/^[1-9]\d*$/.test(q))return!0;var oe=/^(\d*)(.*)$/.exec(q);if(!oe)return pt(x),!1;var ie=b.visualMode?"visual":"normal",X=oe[2]||oe[1];b.inputState.operatorShortcut&&b.inputState.operatorShortcut.slice(-1)==X&&(X=b.inputState.operatorShortcut);var Y=Pn.matchCommand(X,o,b.inputState,ie);return Y.type=="none"?(pt(x),!1):Y.type=="partial"?(Y.expectLiteralNext&&(b.expectLiteralNext=!0),!0):Y.type=="clear"?(pt(x),!0):(b.expectLiteralNext=!1,b.inputState.keyBuffer.length=0,oe=/^(\d*)(.*)$/.exec(q),oe&&oe[1]&&oe[1]!="0"&&b.inputState.pushRepeatDigit(oe[1]),Y.command)}var z=b.insertMode?O():L();if(z===!1)return!b.insertMode&&(m.length===1||e.isMac&&/<A-.>/.test(m))?function(){return!0}:void 0;if(z===!0)return function(){return!0};if(z)return function(){return x.operation(function(){x.curOp.isVimOp=!0;try{if(typeof z!="object")return;z.type=="keyToKey"?mt(x,z.toKeys,z):Pn.processCommand(x,b,z)}catch(q){throw x.state.vim=void 0,se(x),Be.suppressErrorLogging||console.log(q),q}return!0})}},handleEx:function(u,m){_n.processCommand(u,m)},defineMotion:ta,defineAction:ni,defineOperator:yi,mapCommand:_c,_mapCommand:oi,defineRegister:mi,exitVisualMode:Ye,exitInsertMode:Vn},je=[],Pe=!1,Ae;function ft(u){if(!Ae)throw Error("No prompt to send key to");if(u[0]=="<"){var m=u.toLowerCase().slice(1,-1);if(m=m.split("-").pop()||"",m=="lt")u="<";else if(m=="space")u=" ";else if(m=="cr")u=`
89
89
  `;else if(We[m]){var v=Ae.value||"",b={key:We[m],target:{value:v,selectionEnd:v.length,selectionStart:v.length}};Ae.onKeyDown&&Ae.onKeyDown(b,Ae.value,k),Ae&&Ae.onKeyUp&&Ae.onKeyUp(b,Ae.value,k);return}}if(u==`
90
90
  `){var x=Ae;Ae=null,x.onClose&&x.onClose(x.value)}else Ae.value=(Ae.value||"")+u;function k(R){Ae&&(typeof R=="string"?Ae.value=R:Ae=null)}}function mt(u,m,v){var b=Pe;if(v){if(je.indexOf(v)!=-1)return;je.push(v),Pe=v.noremap!=0}try{for(var x=se(u),k=/<(?:[CSMA]-)*\w+>|./gi,R;R=k.exec(m);){var O=R[0],L=x.insertMode;if(Ae){ft(O);continue}if(!Be.handleKey(u,O,"mapping")&&L&&x.insertMode){if(O[0]=="<"){var z=O.toLowerCase().slice(1,-1);if(z=z.split("-").pop()||"",z=="lt")O="<";else if(z=="space")O=" ";else if(z=="cr")O=`
91
91
  `;else if(We.hasOwnProperty(z)){O=We[z],Ya(u,O);continue}else O=O[0],k.lastIndex=R.index+1}u.replaceSelection(O)}}}finally{if(je.pop(),Pe=je.length?b:!1,!je.length&&Ae){var q=Ae;Ae=null,aa(u,q)}}}var Dn={Return:"CR",Backspace:"BS",Delete:"Del",Escape:"Esc",Insert:"Ins",ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"CR"," ":"Space"},un={Shift:1,Alt:1,Command:1,Control:1,CapsLock:1,AltGraph:1,Dead:1,Unidentified:1},We={};"Left|Right|Up|Down|End|Home".split("|").concat(Object.keys(Dn)).forEach(function(u){We[(Dn[u]||"").toLowerCase()]=We[u.toLowerCase()]=u});function tn(u,m){var k;var v=u.key;if(!un[v]){v.length>1&&v[0]=="n"&&(v=v.replace("Numpad","")),v=Dn[v]||v;var b="";if(u.ctrlKey&&(b+="C-"),u.altKey&&(b+="A-"),u.metaKey&&(b+="M-"),e.isMac&&b=="A-"&&v.length==1&&(b=b.slice(2)),(b||v.length>1)&&u.shiftKey&&(b+="S-"),m&&!m.expectLiteralNext&&v.length==1){if(f.keymap&&v in f.keymap)(f.remapCtrl!=0||!b)&&(v=f.keymap[v]);else if(v.charCodeAt(0)>128&&!s[v]){var x=((k=u.code)==null?void 0:k.slice(-1))||"";u.shiftKey||(x=x.toLowerCase()),x&&(v=x,!b&&u.altKey&&(b="A-"))}}return b+=v,b.length>1&&(b="<"+b+">"),b}}function wt(u,m){f.string!==u&&(f=vn(u)),f.remapCtrl=m}function vn(u){let m={};if(!u)return{keymap:m,string:""};function v(b){return b.split(/\\?(.)/).filter(Boolean)}return u.split(/((?:[^\\,]|\\.)+),/).map(b=>{if(!b)return;let x=b.split(/((?:[^\\;]|\\.)+);/);if(x.length==3){let k=v(x[1]),R=v(x[2]);if(k.length!==R.length)return;for(let O=0;O<k.length;++O)m[k[O]]=R[O]}else if(x.length==1){let k=v(b);if(k.length%2!=0)return;for(let R=0;R<k.length;R+=2)m[k[R]]=k[R+1]}}),{keymap:m,string:u}}we("langmap",void 0,"string",["lmap"],function(u,m){if(u===void 0)return f.string;wt(u)});class vr{constructor(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=void 0,this.changeQueue=null}pushRepeatDigit(m){this.operator?this.motionRepeat=this.motionRepeat.concat(m):this.prefixRepeat=this.prefixRepeat.concat(m)}getRepeat(){var m=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(m=1,this.prefixRepeat.length>0&&(m*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(m*=parseInt(this.motionRepeat.join(""),10))),m}}function pt(u,m){u.state.vim.inputState=new vr,u.state.vim.expectLiteralNext=!1,e.signal(u,"vim-command-done",m)}function Fr(){this.removed=[],this.inserted=""}class nn{constructor(m,v,b){this.clear(),this.keyBuffer=[m||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!v,this.blockwise=!!b}setText(m,v,b){this.keyBuffer=[m||""],this.linewise=!!v,this.blockwise=!!b}pushText(m,v){v&&(this.linewise||this.keyBuffer.push(`
92
92
  `),this.linewise=!0),this.keyBuffer.push(m)}pushInsertModeChanges(m){this.insertModeChanges.push(Z(m))}pushSearchQuery(m){this.searchQueries.push(m)}clear(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1}toString(){return this.keyBuffer.join("")}}function mi(u,m){var v=Q.registerController.registers;if(!u||u.length!=1)throw Error("Register name must be 1 character");if(v[u])throw Error("Register already defined "+u);v[u]=m,I.push(u)}class On{constructor(m){this.registers=m,this.unnamedRegister=m['"']=new nn,m["."]=new nn,m[":"]=new nn,m["/"]=new nn,m["+"]=new nn}pushText(m,v,b,x,k){if(m!=="_"){x&&b.charAt(b.length-1)!==`
93
93
  `&&(b+=`
94
94
  `);var R=this.isValidRegister(m)?this.getRegister(m):null;if(!R||!m){switch(v){case"yank":this.registers[0]=new nn(b,x,k);break;case"delete":case"change":b.indexOf(`
95
- `)==-1?this.registers["-"]=new nn(b,x):(this.shiftNumericRegisters_(),this.registers[1]=new nn(b,x));break}this.unnamedRegister.setText(b,x,k);return}P(m)?R.pushText(b,x):R.setText(b,x,k),m==="+"&&navigator.clipboard.writeText(b),this.unnamedRegister.setText(R.toString(),x)}}getRegister(m){return this.isValidRegister(m)?(m=m.toLowerCase(),this.registers[m]||(this.registers[m]=new nn),this.registers[m]):this.unnamedRegister}isValidRegister(m){return m&&(de(m,I)||$.test(m))}shiftNumericRegisters_(){for(var m=9;m>=2;m--)this.registers[m]=this.getRegister(""+(m-1))}}class br{constructor(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}nextMatch(m,v){var b=this.historyBuffer,x=v?-1:1;this.initialPrefix===null&&(this.initialPrefix=m);for(var k=this.iterator+x;v?k>=0:k<b.length;k+=x)for(var R=b[k],O=0;O<=R.length;O++)if(this.initialPrefix==R.substring(0,O))return this.iterator=k,R;if(k>=b.length)return this.iterator=b.length,this.initialPrefix;if(k<0)return m}pushInput(m){var v=this.historyBuffer.indexOf(m);v>-1&&this.historyBuffer.splice(v,1),m.length&&this.historyBuffer.push(m)}reset(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}}var Pn={matchCommand:function(u,m,v,b){var x=vi(u,m,b,v),k=x.full[0];if(!k)return x.partial.length?{type:"partial",expectLiteralNext:x.partial.length==1&&x.partial[0].keys.slice(-11)=="<character>"}:{type:"none"};if(k.keys.slice(-11)=="<character>"||k.keys.slice(-10)=="<register>"){var R=wr(u);if(!R||R.length>1)return{type:"clear"};v.selectedCharacter=R}return{type:"full",command:k}},processCommand:function(u,m,v){switch(m.inputState.repeatOverride=v.repeatOverride,v.type){case"motion":this.processMotion(u,m,v);break;case"operator":this.processOperator(u,m,v);break;case"operatorMotion":this.processOperatorMotion(u,m,v);break;case"action":this.processAction(u,m,v);break;case"search":this.processSearch(u,m,v);break;case"ex":case"keyToEx":this.processEx(u,m,v);break}},processMotion:function(u,m,v){m.inputState.motion=v.motion,m.inputState.motionArgs=Br(v.motionArgs),this.evalInput(u,m)},processOperator:function(u,m,v){var b=m.inputState;if(b.operator)if(b.operator==v.operator){b.motion="expandToLine",b.motionArgs={linewise:!0,repeat:1},this.evalInput(u,m);return}else pt(u);b.operator=v.operator,b.operatorArgs=Br(v.operatorArgs),v.keys.length>1&&(b.operatorShortcut=v.keys),v.exitVisualBlock&&(m.visualBlock=!1,Fn(u)),m.visualMode&&this.evalInput(u,m)},processOperatorMotion:function(u,m,v){var b=m.visualMode,x=Br(v.operatorMotionArgs);x&&b&&x.visualLine&&(m.visualLine=!0),this.processOperator(u,m,v),b||this.processMotion(u,m,v)},processAction:function(u,m,v){var b=m.inputState,x=b.getRepeat(),k=!!x,R=Br(v.actionArgs)||{repeat:1};b.selectedCharacter&&(R.selectedCharacter=b.selectedCharacter),v.operator&&this.processOperator(u,m,v),v.motion&&this.processMotion(u,m,v),(v.motion||v.operator)&&this.evalInput(u,m),R.repeat=x||1,R.repeatIsExplicit=k,R.registerName=b.registerName,pt(u),m.lastMotion=null,v.isEdit&&this.recordLastEdit(m,b,v),fn[v.action](u,R,m)},processSearch:function(u,m,v){if(!u.getSearchCursor)return;var b=v.searchArgs.forward,x=v.searchArgs.wholeWordOnly;Kn(u).setReversed(!b);var k=b?"/":"?",R=Kn(u).getQuery(),O=u.getScrollInfo(),L="";function z(Re,Ne,dt){Q.searchHistoryController.pushInput(Re),Q.searchHistoryController.reset();try{_i(u,Re,Ne,dt)}catch{ct(u,"Invalid regex: "+Re),pt(u);return}Pn.processMotion(u,m,{keys:"",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:v.searchArgs.toJumplist}})}function q(Re){u.scrollTo(O.left,O.top),z(Re,!0,!0);var Ne=Q.macroModeState;Ne.isRecording&&Ga(Ne,Re)}function oe(){return be("pcre")?"(JavaScript regexp: set pcre)":"(Vim regexp: set nopcre)"}function ie(Re,Ne,dt){var Je=tn(Re),Nt,Ft;Je=="<Up>"||Je=="<Down>"?(Nt=Je=="<Up>",Ft=Re.target?Re.target.selectionEnd:0,Ne=Q.searchHistoryController.nextMatch(Ne,Nt)||"",dt(Ne),Ft&&Re.target&&(Re.target.selectionEnd=Re.target.selectionStart=Math.min(Ft,Re.target.value.length))):Je&&Je!="<Left>"&&Je!="<Right>"&&Q.searchHistoryController.reset(),L=Ne,X()}function X(){var Re;try{Re=_i(u,L,!0,!0)}catch{}Re?u.scrollIntoView(xi(u,!b,Re),30):(ki(u),u.scrollTo(O.left,O.top))}function Y(Re,Ne,dt){var Je=tn(Re);Je=="<Esc>"||Je=="<C-c>"||Je=="<C-[>"||Je=="<BS>"&&Ne==""?(Q.searchHistoryController.pushInput(Ne),Q.searchHistoryController.reset(),_i(u,(R==null?void 0:R.source)||""),ki(u),u.scrollTo(O.left,O.top),e.e_stop(Re),pt(u),dt(),u.focus()):Je=="<Up>"||Je=="<Down>"?e.e_stop(Re):Je=="<C-u>"&&(e.e_stop(Re),dt(""))}switch(v.searchArgs.querySrc){case"prompt":var xe=Q.macroModeState;xe.isPlaying?z(xe.replaySearchQueries.shift()||"",!0,!1):aa(u,{onClose:q,prefix:k,desc:Nn("span",{$cursor:"pointer",onmousedown:function(Ne){Ne.preventDefault(),J("pcre",!be("pcre")),this.textContent=oe(),X()}},oe()),onKeyUp:ie,onKeyDown:Y});break;case"wordUnderCursor":var _e=Te(u,{noSymbol:!0}),qe=!0;if(_e||(_e=Te(u,{noSymbol:!1}),qe=!1),!_e){ct(u,"No word under cursor"),pt(u);return}let Re=u.getLine(_e.start.line).substring(_e.start.ch,_e.end.ch);Re=qe&&x?"\\b"+Re+"\\b":Mn(Re),Q.jumpList.cachedCursor=u.getCursor(),u.setCursor(_e.start),z(Re,!0,!1);break}},processEx:function(u,m,v){function b(O){Q.exCommandHistoryController.pushInput(O),Q.exCommandHistoryController.reset(),_n.processCommand(u,O),u.state.vim&&pt(u),ki(u)}function x(O,L,z){var q=tn(O),oe,ie;(q=="<Esc>"||q=="<C-c>"||q=="<C-[>"||q=="<BS>"&&L=="")&&(Q.exCommandHistoryController.pushInput(L),Q.exCommandHistoryController.reset(),e.e_stop(O),pt(u),ki(u),z(),u.focus()),q=="<Up>"||q=="<Down>"?(e.e_stop(O),oe=q=="<Up>",ie=O.target?O.target.selectionEnd:0,L=Q.exCommandHistoryController.nextMatch(L,oe)||"",z(L),ie&&O.target&&(O.target.selectionEnd=O.target.selectionStart=Math.min(ie,O.target.value.length))):q=="<C-u>"?(e.e_stop(O),z("")):q&&q!="<Left>"&&q!="<Right>"&&Q.exCommandHistoryController.reset()}function k(O,L){var z=new e.StringStream(L),q={};try{if(_n.parseInput_(u,z,q),q.commandName!="s"){ki(u);return}var oe=_n.matchCommand_(q.commandName);if(!oe||(_n.parseCommandArgs_(z,q,oe),!q.argString))return;var ie=Bs(q.argString.slice(1),!0,!0);ie&&Bo(u,ie)}catch{}}if(v.type=="keyToEx")_n.processCommand(u,v.exArgs.input);else{var R={onClose:b,onKeyDown:x,onKeyUp:k,prefix:":"};m.visualMode&&(R.value="'<,'>",R.selectValueOnOpen=!1),aa(u,R)}},evalInput:function(u,m){var v=m.inputState,b=v.motion,x=v.motionArgs||{repeat:1},k=v.operator,R=v.operatorArgs||{},O=v.registerName,L=m.sel,z=Ge(m.visualMode?zt(u,L.head):u.getCursor("head")),q=Ge(m.visualMode?zt(u,L.anchor):u.getCursor("anchor")),oe=Ge(z),ie=Ge(q),X,Y,xe;if(k&&this.recordLastEdit(m,v),xe=v.repeatOverride===void 0?v.getRepeat():v.repeatOverride,xe>0&&x.explicitRepeat?x.repeatIsExplicit=!0:(x.noRepeat||!x.explicitRepeat&&xe===0)&&(xe=1,x.repeatIsExplicit=!1),v.selectedCharacter&&(x.selectedCharacter=R.selectedCharacter=v.selectedCharacter),x.repeat=xe,pt(u),b){var _e=dn[b](u,z,x,m,v);if(m.lastMotion=dn[b],!_e)return;if(x.toJumplist){var qe=Q.jumpList,Re=qe.cachedCursor;Re?(Ve(u,Re,_e),delete qe.cachedCursor):Ve(u,z,_e)}_e instanceof Array?(Y=_e[0],X=_e[1]):X=_e,X||(X=Ge(z)),m.visualMode?(m.visualBlock&&X.ch===1/0||(X=zt(u,X,oe)),Y&&(Y=zt(u,Y)),Y||(Y=ie),L.anchor=Y,L.head=X,Fn(u),Bn(u,m,"<",xt(Y,X)?Y:X),Bn(u,m,">",xt(Y,X)?X:Y)):k||(X=zt(u,X,oe),u.setCursor(X.line,X.ch))}if(k){if(R.lastSel){Y=ie;var Ne=R.lastSel,dt=Math.abs(Ne.head.line-Ne.anchor.line),Je=Math.abs(Ne.head.ch-Ne.anchor.ch);X=Ne.visualLine?new n(ie.line+dt,ie.ch):Ne.visualBlock?new n(ie.line+dt,ie.ch+Je):Ne.head.line==Ne.anchor.line?new n(ie.line,ie.ch+Je):new n(ie.line+dt,ie.ch),m.visualMode=!0,m.visualLine=Ne.visualLine,m.visualBlock=Ne.visualBlock,L=m.sel={anchor:Y,head:X},Fn(u)}else m.visualMode&&(R.lastSel={anchor:Ge(L.anchor),head:Ge(L.head),visualBlock:m.visualBlock,visualLine:m.visualLine});var Nt,Ft,Ue,$e,$t;if(m.visualMode){Nt=kt(L.head,L.anchor),Ft=zn(L.head,L.anchor),Ue=m.visualLine||R.linewise,$e=m.visualBlock?"block":Ue?"line":"char";var rn=i(u,Nt,Ft);if($t=or(u,{anchor:rn.start,head:rn.end},$e),Ue){var pn=$t.ranges;if($e=="block")for(var Za=0;Za<pn.length;Za++)pn[Za].head.ch=St(u,pn[Za].head.line);else $e=="line"&&(pn[0].head=new n(pn[0].head.line+1,0))}}else{if(Nt=Ge(Y||ie),Ft=Ge(X||oe),xt(Ft,Nt)){var kc=Nt;Nt=Ft,Ft=kc}Ue=x.linewise||R.linewise,Ue?te(u,Nt,Ft):x.forward&&j(u,Nt,Ft),$e="char";var Sc=!x.inclusive||Ue,rn=i(u,Nt,Ft);$t=or(u,{anchor:rn.start,head:rn.end},$e,Sc)}u.setSelections($t.ranges,$t.primary),m.lastMotion=null,R.repeat=xe,R.registerName=O,R.linewise=Ue;var Wo=Ut[k](u,R,$t.ranges,ie,X);m.visualMode&&Ye(u,Wo!=null),Wo&&u.setCursor(Wo)}},recordLastEdit:function(u,m,v){var b=Q.macroModeState;b.isPlaying||(u.lastEditInputState=m,u.lastEditActionCommand=v,b.lastInsertModeChanges.changes=[],b.lastInsertModeChanges.expectCursorActivityForChange=!1,b.lastInsertModeChanges.visualBlock=u.visualBlock?u.sel.head.line-u.sel.anchor.line:0)}},dn={moveToTopLine:function(u,m,v){var b=Ka(u).top+v.repeat-1;return new n(b,ve(u.getLine(b)))},moveToMiddleLine:function(u){var m=Ka(u),v=Math.floor((m.top+m.bottom)*.5);return new n(v,ve(u.getLine(v)))},moveToBottomLine:function(u,m,v){var b=Ka(u).bottom-v.repeat+1;return new n(b,ve(u.getLine(b)))},expandToLine:function(u,m,v){return new n(m.line+v.repeat-1,1/0)},findNext:function(u,m,v){var b=Kn(u),x=b.getQuery();if(x){var k=!v.forward;k=b.isReversed()?!k:k,Bo(u,x);var R=xi(u,k,x,v.repeat);return R||ct(u,"No match found "+x+(be("pcre")?" (set nopcre to use Vim regexps)":"")),R}},findAndSelectNextInclusive:function(u,m,v,b,x){var k=Kn(u),R=k.getQuery();if(R){var O=!v.forward;O=k.isReversed()?!O:O;var L=xf(u,O,R,v.repeat,b);if(L){if(x.operator)return L;var z=L[0],q=new n(L[1].line,L[1].ch-1);if(b.visualMode){(b.visualLine||b.visualBlock)&&(b.visualLine=!1,b.visualBlock=!1,e.signal(u,"vim-mode-change",{mode:"visual",subMode:""}));var oe=b.sel.anchor;if(oe)return k.isReversed()?v.forward?[oe,z]:[oe,q]:v.forward?[oe,q]:[oe,z]}else b.visualMode=!0,b.visualLine=!1,b.visualBlock=!1,e.signal(u,"vim-mode-change",{mode:"visual",subMode:""});return O?[q,z]:[z,q]}}},goToMark:function(u,m,v,b){var x=Ho(u,b,v.selectedCharacter||"");return x?v.linewise?{line:x.line,ch:ve(u.getLine(x.line))}:x:null},moveToOtherHighlightedEnd:function(u,m,v,b){var x=b.sel;return b.visualBlock&&v.sameLine?[zt(u,new n(x.anchor.line,x.head.ch)),zt(u,new n(x.head.line,x.anchor.ch))]:[x.head,x.anchor]},jumpToMark:function(u,m,v,b){for(var x=m,k=0;k<v.repeat;k++){var R=x;for(var O in b.marks)if(N(O)){var L=b.marks[O].find();if(!(v.forward?xt(L,R):xt(R,L))&&!(v.linewise&&L.line==R.line)){var z=gt(R,x),q=v.forward?_r(R,L,x):_r(x,L,R);(z||q)&&(x=L)}}}return v.linewise&&(x=new n(x.line,ve(u.getLine(x.line)))),x},moveByCharacters:function(u,m,v){var b=m,x=v.repeat,k=v.forward?b.ch+x:b.ch-x;return new n(b.line,k)},moveByLines:function(u,m,v,b){var x=m,k=x.ch;switch(b.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:k=b.lastHPos;break;default:b.lastHPos=k}var R=v.repeat+(v.repeatOffset||0),O=v.forward?x.line+R:x.line-R,L=u.firstLine(),z=u.lastLine(),q=u.findPosV(x,v.forward?R:-R,"line",b.lastHSPos);return(v.forward?q.line>O:q.line<O)&&(O=q.line,k=q.ch),O<L&&x.line==L?this.moveToStartOfLine(u,m,v,b):O>z&&x.line==z?wn(u,m,v,b,!0):(v.toFirstChar&&(k=ve(u.getLine(O)),b.lastHPos=k),b.lastHSPos=u.charCoords(new n(O,k),"div").left,new n(O,k))},moveByDisplayLines:function(u,m,v,b){var x=m;switch(b.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:b.lastHSPos=u.charCoords(x,"div").left}var k=v.repeat,R=u.findPosV(x,v.forward?k:-k,"line",b.lastHSPos);if(R.hitSide)if(v.forward){var O={top:u.charCoords(R,"div").top+8,left:b.lastHSPos};R=u.coordsChar(O,"div")}else{var L=u.charCoords(new n(u.firstLine(),0),"div");L.left=b.lastHSPos,R=u.coordsChar(L,"div")}return b.lastHPos=R.ch,R},moveByPage:function(u,m,v){var b=m,x=v.repeat;return u.findPosV(b,v.forward?x:-x,"page")},moveByParagraph:function(u,m,v){var b=v.forward?1:-1;return Xt(u,m,v.repeat,b).start},moveBySentence:function(u,m,v){var b=v.forward?1:-1;return hc(u,m,v.repeat,b)},moveByScroll:function(u,m,v,b){var x=u.getScrollInfo(),k=null,R=v.repeat;R||(R=x.clientHeight/(2*u.defaultTextHeight()));var O=u.charCoords(m,"local");if(v.repeat=R,k=dn.moveByDisplayLines(u,m,v,b),!k)return null;var L=u.charCoords(k,"local");return u.scrollTo(null,x.top+L.top-O.top),k},moveByWords:function(u,m,v){return ut(u,m,v.repeat,!!v.forward,!!v.wordEnd,!!v.bigWord)},moveTillCharacter:function(u,m,v){var b=v.repeat,x=sr(u,b,v.forward,v.selectedCharacter,m),k=v.forward?-1:1;return ot(k,v),x?(x.ch+=k,x):null},moveToCharacter:function(u,m,v){var b=v.repeat;return ot(0,v),sr(u,b,v.forward,v.selectedCharacter,m)||m},moveToSymbol:function(u,m,v){var b=v.repeat;return v.selectedCharacter&&Lt(u,b,v.forward,v.selectedCharacter)||m},moveToColumn:function(u,m,v,b){var x=v.repeat;return b.lastHPos=x-1,b.lastHSPos=u.charCoords(m,"div").left,ii(u,x)},moveToEol:function(u,m,v,b){return wn(u,m,v,b,!1)},moveToFirstNonWhiteSpaceCharacter:function(u,m){var v=m;return new n(v.line,ve(u.getLine(v.line)))},moveToMatchedSymbol:function(u,m){for(var v=m,b=v.line,x=v.ch,k=u.getLine(b),R;x<k.length;x++)if(R=k.charAt(x),R&&K(R)){var O=u.getTokenTypeAt(new n(b,x+1));if(O!=="string"&&O!=="comment")break}if(x<k.length){var L=R==="<"||R===">"?/[(){}[\]<>]/:/[(){}[\]]/;return u.findMatchingBracket(new n(b,x),{bracketRegex:L}).to}else return v},moveToStartOfLine:function(u,m){return new n(m.line,0)},moveToLineOrEdgeOfDocument:function(u,m,v){var b=v.forward?u.lastLine():u.firstLine();return v.repeatIsExplicit&&(b=v.repeat-u.getOption("firstLineNumber")),new n(b,ve(u.getLine(b)))},moveToStartOfDisplayLine:function(u){return u.execCommand("goLineLeft"),u.getCursor()},moveToEndOfDisplayLine:function(u){u.execCommand("goLineRight");var m=u.getCursor();return m.sticky=="before"&&m.ch--,m},textObjectManipulation:function(u,m,v,b){var x={"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"},k={"'":!0,'"':!0,"`":!0},R=v.selectedCharacter||"";R=="b"?R="(":R=="B"&&(R="{");var O=!v.textObjectInner,L,z;if(x[R]){if(z=!0,L=ai(u,m,R,O),!L){var q=u.getSearchCursor(RegExp("\\"+R,"g"),m);q.find()&&(L=ai(u,q.from(),R,O))}}else if(k[R])z=!0,L=ia(u,m,R,O);else if(R==="W"||R==="w")for(var oe=v.repeat||1;oe-- >0;){var ie=Te(u,{inclusive:O,innerWord:!O,bigWord:R==="W",noSymbol:R==="W",multiline:!0},L&&L.end);ie&&(L||(L=ie),L.end=ie.end)}else if(R==="p")if(L=Xt(u,m,v.repeat,0,O),v.linewise=!0,b.visualMode)b.visualLine||(b.visualLine=!0);else{var X=b.inputState.operatorArgs;X&&(X.linewise=!0),L.end.line--}else if(R==="t")L=He(u,m,O);else if(R==="s"){var Y=u.getLine(m.line);m.ch>0&&W(Y[m.ch])&&--m.ch;var xe=zs(u,m,v.repeat,1,O),_e=zs(u,m,v.repeat,-1,O);A(u.getLine(_e.line)[_e.ch])&&A(u.getLine(xe.line)[xe.ch-1])&&(_e={line:_e.line,ch:_e.ch+1}),L={start:_e,end:xe}}return L?u.state.vim.visualMode?wi(u,L.start,L.end,z):[L.start,L.end]:null},repeatLastCharacterSearch:function(u,m,v){var b=Q.lastCharacterSearch,x=v.repeat,k=v.forward===b.forward,R=(b.increment?1:0)*(k?-1:1);u.moveH(-R,"char"),v.inclusive=!!k;var O=sr(u,x,k,b.selectedCharacter);return O?(O.ch+=R,O):(u.moveH(R,"char"),m)}};function ta(u,m){dn[u]=m}function gi(u,m){for(var v=[],b=0;b<m;b++)v.push(u);return v}var Ut={change:function(u,m,v){var b,x,k=u.state.vim,R=v[0].anchor,O=v[0].head;if(k.visualMode)if(m.fullLine)O.ch=Number.MAX_VALUE,O.line--,u.setSelection(R,O),x=u.getSelection(),u.replaceSelection(""),b=R;else{x=u.getSelection();var L=gi("",v.length);u.replaceSelections(L),b=kt(v[0].head,v[0].anchor)}else{x=u.getRange(R,O);var z=k.lastEditInputState;if((z==null?void 0:z.motion)=="moveByWords"&&!A(x)){var q=/\s+$/.exec(x);q&&z.motionArgs&&z.motionArgs.forward&&(O=_t(O,0,-q[0].length),x=x.slice(0,-q[0].length))}m.linewise&&(R=new n(R.line,ve(u.getLine(R.line))),O.line>R.line&&(O=new n(O.line-1,Number.MAX_VALUE))),u.replaceRange("",R,O),b=R}Q.registerController.pushText(m.registerName,"change",x,m.linewise,v.length>1),fn.enterInsertMode(u,{head:b},u.state.vim)},delete:function(u,m,v){var b,x,k=u.state.vim;if(k.visualBlock){x=u.getSelection();var R=gi("",v.length);u.replaceSelections(R),b=kt(v[0].head,v[0].anchor)}else{var O=v[0].anchor,L=v[0].head;m.linewise&&L.line!=u.firstLine()&&O.line==u.lastLine()&&O.line==L.line-1&&(O.line==u.firstLine()?O.ch=0:O=new n(O.line-1,St(u,O.line-1))),x=u.getRange(O,L),u.replaceRange("",O,L),b=O,m.linewise&&(b=dn.moveToFirstNonWhiteSpaceCharacter(u,O))}return Q.registerController.pushText(m.registerName,"delete",x,m.linewise,k.visualBlock),zt(u,b)},indent:function(u,m,v){var b=u.state.vim,x=b.visualMode&&m.repeat||1;if(b.visualBlock){for(var k=u.getOption("tabSize"),R=u.getOption("indentWithTabs")?" ":" ".repeat(k),O,L=v.length-1;L>=0;L--)if(O=kt(v[L].anchor,v[L].head),m.indentRight)u.replaceRange(R.repeat(x),O,O);else{for(var z=u.getLine(O.line),q=0,oe=0;oe<x;oe++){var ie=z[O.ch+q];if(ie==" ")q++;else if(ie==" "){q++;for(var X=1;X<R.length&&(ie=z[O.ch+q],ie===" ");X++)q++}else break}u.replaceRange("",O,_t(O,0,q))}return O}else if(u.indentMore)for(var oe=0;oe<x;oe++)m.indentRight?u.indentMore():u.indentLess();else{var Y=v[0].anchor.line,xe=b.visualBlock?v[v.length-1].anchor.line:v[0].head.line;m.linewise&&xe--;for(var L=Y;L<=xe;L++)for(var oe=0;oe<x;oe++)u.indentLine(L,m.indentRight)}return dn.moveToFirstNonWhiteSpaceCharacter(u,v[0].anchor)},indentAuto:function(u,m,v){return u.execCommand("indentAuto"),dn.moveToFirstNonWhiteSpaceCharacter(u,v[0].anchor)},hardWrap:function(u,m,v,b){if(u.hardWrap){var x=v[0].anchor.line,k=v[0].head.line;m.linewise&&k--;var R=u.hardWrap({from:x,to:k});return R>x&&m.linewise&&R--,m.keepCursor?b:new n(R,0)}},changeCase:function(u,m,v,b,x){for(var k=u.getSelections(),R=[],O=m.toLower,L=0;L<k.length;L++){var z=k[L],q="";if(O===!0)q=z.toLowerCase();else if(O===!1)q=z.toUpperCase();else for(var oe=0;oe<z.length;oe++){var ie=z.charAt(oe);q+=P(ie)?ie.toLowerCase():ie.toUpperCase()}R.push(q)}return u.replaceSelections(R),m.shouldMoveCursor?x:!u.state.vim.visualMode&&m.linewise&&v[0].anchor.line+1==v[0].head.line?dn.moveToFirstNonWhiteSpaceCharacter(u,b):m.linewise?b:kt(v[0].anchor,v[0].head)},yank:function(u,m,v,b){var x=u.state.vim,k=u.getSelection(),R=x.visualMode?kt(x.sel.anchor,x.sel.head,v[0].head,v[0].anchor):b;return Q.registerController.pushText(m.registerName,"yank",k,m.linewise,x.visualBlock),R},rot13:function(u,m,v,b,x){for(var k=u.getSelections(),R=[],O=0;O<k.length;O++){let L=k[O].split("").map(z=>{let q=z.charCodeAt(0);return q>=65&&q<=90?String.fromCharCode(65+(q-65+13)%26):q>=97&&q<=122?String.fromCharCode(97+(q-97+13)%26):z}).join("");R.push(L)}return u.replaceSelections(R),m.shouldMoveCursor?x:!u.state.vim.visualMode&&m.linewise&&v[0].anchor.line+1==v[0].head.line?dn.moveToFirstNonWhiteSpaceCharacter(u,b):m.linewise?b:kt(v[0].anchor,v[0].head)}};function yi(u,m){Ut[u]=m}var fn={jumpListWalk:function(u,m,v){if(!v.visualMode){var b=m.repeat||1,x=m.forward,k=Q.jumpList.move(u,x?b:-b),R=k?k.find():void 0;R||(R=u.getCursor()),u.setCursor(R)}},scroll:function(u,m,v){if(!v.visualMode){var b=m.repeat||1,x=u.defaultTextHeight(),k=u.getScrollInfo().top,R=x*b,O=m.forward?k+R:k-R,L=Ge(u.getCursor()),z=u.charCoords(L,"local");if(m.forward)O>z.top?(L.line+=(O-z.top)/x,L.line=Math.ceil(L.line),u.setCursor(L),z=u.charCoords(L,"local"),u.scrollTo(null,z.top)):u.scrollTo(null,O);else{var q=O+u.getScrollInfo().clientHeight;q<z.bottom?(L.line-=(z.bottom-q)/x,L.line=Math.floor(L.line),u.setCursor(L),z=u.charCoords(L,"local"),u.scrollTo(null,z.bottom-u.getScrollInfo().clientHeight)):u.scrollTo(null,O)}}},scrollToCursor:function(u,m){var v=u.getCursor().line,b=u.charCoords(new n(v,0),"local"),x=u.getScrollInfo().clientHeight,k=b.top;switch(m.position){case"center":k=b.bottom-x/2;break;case"bottom":var R=new n(v,u.getLine(v).length-1),O=u.charCoords(R,"local").bottom-k;k=k-x+O;break}u.scrollTo(null,k)},replayMacro:function(u,m,v){var b=m.selectedCharacter||"",x=m.repeat||1,k=Q.macroModeState;for(b=="@"?b=k.latestRegister||"":k.latestRegister=b;x--;)Qa(u,v,k,b)},enterMacroRecordMode:function(u,m){var v=Q.macroModeState,b=m.selectedCharacter;Q.registerController.isValidRegister(b)&&v.enterMacroRecordMode(u,b)},toggleOverwrite:function(u){u.state.overwrite?(u.toggleOverwrite(!1),u.setOption("keyMap","vim-insert"),e.signal(u,"vim-mode-change",{mode:"insert"})):(u.toggleOverwrite(!0),u.setOption("keyMap","vim-replace"),e.signal(u,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(u,m,v){if(!u.getOption("readOnly")){v.insertMode=!0,v.insertModeRepeat=m&&m.repeat||1;var b=m?m.insertAt:null,x=v.sel,k=m.head||u.getCursor("head"),R=u.listSelections().length;if(b=="eol")k=new n(k.line,St(u,k.line));else if(b=="bol")k=new n(k.line,0);else if(b=="charAfter"){var O=i(u,k,_t(k,0,1));k=O.end}else if(b=="firstNonBlank"){var O=i(u,k,dn.moveToFirstNonWhiteSpaceCharacter(u,k));k=O.end}else if(b=="startOfSelectedArea"){if(!v.visualMode)return;v.visualBlock?(k=new n(Math.min(x.head.line,x.anchor.line),Math.min(x.head.ch,x.anchor.ch)),R=Math.abs(x.head.line-x.anchor.line)+1):k=x.head.line<x.anchor.line?x.head:new n(x.anchor.line,0)}else if(b=="endOfSelectedArea"){if(!v.visualMode)return;v.visualBlock?(k=new n(Math.min(x.head.line,x.anchor.line),Math.max(x.head.ch,x.anchor.ch)+1),R=Math.abs(x.head.line-x.anchor.line)+1):k=x.head.line>=x.anchor.line?_t(x.head,0,1):new n(x.anchor.line,0)}else if(b=="inplace"){if(v.visualMode)return}else b=="lastEdit"&&(k=wc(u)||k);u.setOption("disableInput",!1),m&&m.replace?(u.toggleOverwrite(!0),u.setOption("keyMap","vim-replace"),e.signal(u,"vim-mode-change",{mode:"replace"})):(u.toggleOverwrite(!1),u.setOption("keyMap","vim-insert"),e.signal(u,"vim-mode-change",{mode:"insert"})),Q.macroModeState.isPlaying||(u.on("change",Wr),v.insertEnd&&v.insertEnd.clear(),v.insertEnd=u.setBookmark(k,{insertLeft:!0}),e.on(u.getInputField(),"keydown",Ws)),v.visualMode&&Ye(u),ar(u,k,R)}},toggleVisualMode:function(u,m,v){var b=m.repeat,x=u.getCursor(),k;if(v.visualMode)v.visualLine!=!!m.linewise||v.visualBlock!=!!m.blockwise?(v.visualLine=!!m.linewise,v.visualBlock=!!m.blockwise,e.signal(u,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""}),Fn(u)):Ye(u);else{v.visualMode=!0,v.visualLine=!!m.linewise,v.visualBlock=!!m.blockwise,k=zt(u,new n(x.line,x.ch+b-1));var R=i(u,x,k);v.sel={anchor:R.start,head:R.end},e.signal(u,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""}),Fn(u),Bn(u,v,"<",kt(x,k)),Bn(u,v,">",zn(x,k))}},reselectLastSelection:function(u,m,v){var b=v.lastSelection;if(v.visualMode&&Ln(u,v),b){var x=b.anchorMark.find(),k=b.headMark.find();if(!x||!k)return;v.sel={anchor:x,head:k},v.visualMode=!0,v.visualLine=b.visualLine,v.visualBlock=b.visualBlock,Fn(u),Bn(u,v,"<",kt(x,k)),Bn(u,v,">",zn(x,k)),e.signal(u,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""})}},joinLines:function(u,m,v){var b,x;if(v.visualMode){if(b=u.getCursor("anchor"),x=u.getCursor("head"),xt(x,b)){var k=x;x=b,b=k}x.ch=St(u,x.line)-1}else{var R=Math.max(m.repeat,2);b=u.getCursor(),x=zt(u,new n(b.line+R-1,1/0))}for(var O=0,L=b.line;L<x.line;L++){O=St(u,b.line);var z="",q=0;if(!m.keepSpaces){var oe=u.getLine(b.line+1);q=oe.search(/\S/),q==-1?q=oe.length:z=" "}u.replaceRange(z,new n(b.line,O),new n(b.line+1,q))}var ie=zt(u,new n(b.line,O));v.visualMode&&Ye(u,!1),u.setCursor(ie)},newLineAndEnterInsertMode:function(u,m,v){v.insertMode=!0;var b=Ge(u.getCursor());b.line===u.firstLine()&&!m.after?(u.replaceRange(`
95
+ `)==-1?this.registers["-"]=new nn(b,x):(this.shiftNumericRegisters_(),this.registers[1]=new nn(b,x));break}this.unnamedRegister.setText(b,x,k);return}P(m)?R.pushText(b,x):R.setText(b,x,k),m==="+"&&navigator.clipboard.writeText(b),this.unnamedRegister.setText(R.toString(),x)}}getRegister(m){return this.isValidRegister(m)?(m=m.toLowerCase(),this.registers[m]||(this.registers[m]=new nn),this.registers[m]):this.unnamedRegister}isValidRegister(m){return m&&(de(m,I)||$.test(m))}shiftNumericRegisters_(){for(var m=9;m>=2;m--)this.registers[m]=this.getRegister(""+(m-1))}}class br{constructor(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}nextMatch(m,v){var b=this.historyBuffer,x=v?-1:1;this.initialPrefix===null&&(this.initialPrefix=m);for(var k=this.iterator+x;v?k>=0:k<b.length;k+=x)for(var R=b[k],O=0;O<=R.length;O++)if(this.initialPrefix==R.substring(0,O))return this.iterator=k,R;if(k>=b.length)return this.iterator=b.length,this.initialPrefix;if(k<0)return m}pushInput(m){var v=this.historyBuffer.indexOf(m);v>-1&&this.historyBuffer.splice(v,1),m.length&&this.historyBuffer.push(m)}reset(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}}var Pn={matchCommand:function(u,m,v,b){var x=vi(u,m,b,v),k=x.full[0];if(!k)return x.partial.length?{type:"partial",expectLiteralNext:x.partial.length==1&&x.partial[0].keys.slice(-11)=="<character>"}:{type:"none"};if(k.keys.slice(-11)=="<character>"||k.keys.slice(-10)=="<register>"){var R=wr(u);if(!R||R.length>1)return{type:"clear"};v.selectedCharacter=R}return{type:"full",command:k}},processCommand:function(u,m,v){switch(m.inputState.repeatOverride=v.repeatOverride,v.type){case"motion":this.processMotion(u,m,v);break;case"operator":this.processOperator(u,m,v);break;case"operatorMotion":this.processOperatorMotion(u,m,v);break;case"action":this.processAction(u,m,v);break;case"search":this.processSearch(u,m,v);break;case"ex":case"keyToEx":this.processEx(u,m,v);break}},processMotion:function(u,m,v){m.inputState.motion=v.motion,m.inputState.motionArgs=Br(v.motionArgs),this.evalInput(u,m)},processOperator:function(u,m,v){var b=m.inputState;if(b.operator)if(b.operator==v.operator){b.motion="expandToLine",b.motionArgs={linewise:!0,repeat:1},this.evalInput(u,m);return}else pt(u);b.operator=v.operator,b.operatorArgs=Br(v.operatorArgs),v.keys.length>1&&(b.operatorShortcut=v.keys),v.exitVisualBlock&&(m.visualBlock=!1,Fn(u)),m.visualMode&&this.evalInput(u,m)},processOperatorMotion:function(u,m,v){var b=m.visualMode,x=Br(v.operatorMotionArgs);x&&b&&x.visualLine&&(m.visualLine=!0),this.processOperator(u,m,v),b||this.processMotion(u,m,v)},processAction:function(u,m,v){var b=m.inputState,x=b.getRepeat(),k=!!x,R=Br(v.actionArgs)||{repeat:1};b.selectedCharacter&&(R.selectedCharacter=b.selectedCharacter),v.operator&&this.processOperator(u,m,v),v.motion&&this.processMotion(u,m,v),(v.motion||v.operator)&&this.evalInput(u,m),R.repeat=x||1,R.repeatIsExplicit=k,R.registerName=b.registerName,pt(u),m.lastMotion=null,v.isEdit&&this.recordLastEdit(m,b,v),fn[v.action](u,R,m)},processSearch:function(u,m,v){if(!u.getSearchCursor)return;var b=v.searchArgs.forward,x=v.searchArgs.wholeWordOnly;Kn(u).setReversed(!b);var k=b?"/":"?",R=Kn(u).getQuery(),O=u.getScrollInfo(),L="";function z(Re,Ne,dt){Q.searchHistoryController.pushInput(Re),Q.searchHistoryController.reset();try{_i(u,Re,Ne,dt)}catch{ct(u,"Invalid regex: "+Re),pt(u);return}Pn.processMotion(u,m,{keys:"",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:v.searchArgs.toJumplist}})}function q(Re){u.scrollTo(O.left,O.top),z(Re,!0,!0);var Ne=Q.macroModeState;Ne.isRecording&&Ga(Ne,Re)}function oe(){return be("pcre")?"(JavaScript regexp: set pcre)":"(Vim regexp: set nopcre)"}function ie(Re,Ne,dt){var Je=tn(Re),Nt,Ft;Je=="<Up>"||Je=="<Down>"?(Nt=Je=="<Up>",Ft=Re.target?Re.target.selectionEnd:0,Ne=Q.searchHistoryController.nextMatch(Ne,Nt)||"",dt(Ne),Ft&&Re.target&&(Re.target.selectionEnd=Re.target.selectionStart=Math.min(Ft,Re.target.value.length))):Je&&Je!="<Left>"&&Je!="<Right>"&&Q.searchHistoryController.reset(),L=Ne,X()}function X(){var Re;try{Re=_i(u,L,!0,!0)}catch{}Re?u.scrollIntoView(xi(u,!b,Re),30):(ki(u),u.scrollTo(O.left,O.top))}function Y(Re,Ne,dt){var Je=tn(Re);Je=="<Esc>"||Je=="<C-c>"||Je=="<C-[>"||Je=="<BS>"&&Ne==""?(Q.searchHistoryController.pushInput(Ne),Q.searchHistoryController.reset(),_i(u,(R==null?void 0:R.source)||""),ki(u),u.scrollTo(O.left,O.top),e.e_stop(Re),pt(u),dt(),u.focus()):Je=="<Up>"||Je=="<Down>"?e.e_stop(Re):Je=="<C-u>"&&(e.e_stop(Re),dt(""))}switch(v.searchArgs.querySrc){case"prompt":var xe=Q.macroModeState;xe.isPlaying?z(xe.replaySearchQueries.shift()||"",!0,!1):aa(u,{onClose:q,prefix:k,desc:Nn("span",{$cursor:"pointer",onmousedown:function(Ne){Ne.preventDefault(),J("pcre",!be("pcre")),this.textContent=oe(),X()}},oe()),onKeyUp:ie,onKeyDown:Y});break;case"wordUnderCursor":var _e=Te(u,{noSymbol:!0}),qe=!0;if(_e||(_e=Te(u,{noSymbol:!1}),qe=!1),!_e){ct(u,"No word under cursor"),pt(u);return}let Re=u.getLine(_e.start.line).substring(_e.start.ch,_e.end.ch);Re=qe&&x?"\\b"+Re+"\\b":Mn(Re),Q.jumpList.cachedCursor=u.getCursor(),u.setCursor(_e.start),z(Re,!0,!1);break}},processEx:function(u,m,v){function b(O){Q.exCommandHistoryController.pushInput(O),Q.exCommandHistoryController.reset(),_n.processCommand(u,O),u.state.vim&&pt(u),ki(u)}function x(O,L,z){var q=tn(O),oe,ie;(q=="<Esc>"||q=="<C-c>"||q=="<C-[>"||q=="<BS>"&&L=="")&&(Q.exCommandHistoryController.pushInput(L),Q.exCommandHistoryController.reset(),e.e_stop(O),pt(u),ki(u),z(),u.focus()),q=="<Up>"||q=="<Down>"?(e.e_stop(O),oe=q=="<Up>",ie=O.target?O.target.selectionEnd:0,L=Q.exCommandHistoryController.nextMatch(L,oe)||"",z(L),ie&&O.target&&(O.target.selectionEnd=O.target.selectionStart=Math.min(ie,O.target.value.length))):q=="<C-u>"?(e.e_stop(O),z("")):q&&q!="<Left>"&&q!="<Right>"&&Q.exCommandHistoryController.reset()}function k(O,L){var z=new e.StringStream(L),q={};try{if(_n.parseInput_(u,z,q),q.commandName!="s"){ki(u);return}var oe=_n.matchCommand_(q.commandName);if(!oe||(_n.parseCommandArgs_(z,q,oe),!q.argString))return;var ie=Bs(q.argString.slice(1),!0,!0);ie&&Bo(u,ie)}catch{}}if(v.type=="keyToEx")_n.processCommand(u,v.exArgs.input);else{var R={onClose:b,onKeyDown:x,onKeyUp:k,prefix:":"};m.visualMode&&(R.value="'<,'>",R.selectValueOnOpen=!1),aa(u,R)}},evalInput:function(u,m){var v=m.inputState,b=v.motion,x=v.motionArgs||{repeat:1},k=v.operator,R=v.operatorArgs||{},O=v.registerName,L=m.sel,z=Ge(m.visualMode?zt(u,L.head):u.getCursor("head")),q=Ge(m.visualMode?zt(u,L.anchor):u.getCursor("anchor")),oe=Ge(z),ie=Ge(q),X,Y,xe;if(k&&this.recordLastEdit(m,v),xe=v.repeatOverride===void 0?v.getRepeat():v.repeatOverride,xe>0&&x.explicitRepeat?x.repeatIsExplicit=!0:(x.noRepeat||!x.explicitRepeat&&xe===0)&&(xe=1,x.repeatIsExplicit=!1),v.selectedCharacter&&(x.selectedCharacter=R.selectedCharacter=v.selectedCharacter),x.repeat=xe,pt(u),b){var _e=dn[b](u,z,x,m,v);if(m.lastMotion=dn[b],!_e)return;if(x.toJumplist){var qe=Q.jumpList,Re=qe.cachedCursor;Re?(Ve(u,Re,_e),delete qe.cachedCursor):Ve(u,z,_e)}_e instanceof Array?(Y=_e[0],X=_e[1]):X=_e,X||(X=Ge(z)),m.visualMode?(m.visualBlock&&X.ch===1/0||(X=zt(u,X,oe)),Y&&(Y=zt(u,Y)),Y||(Y=ie),L.anchor=Y,L.head=X,Fn(u),Bn(u,m,"<",xt(Y,X)?Y:X),Bn(u,m,">",xt(Y,X)?X:Y)):k||(X=zt(u,X,oe),u.setCursor(X.line,X.ch))}if(k){if(R.lastSel){Y=ie;var Ne=R.lastSel,dt=Math.abs(Ne.head.line-Ne.anchor.line),Je=Math.abs(Ne.head.ch-Ne.anchor.ch);X=Ne.visualLine?new n(ie.line+dt,ie.ch):Ne.visualBlock?new n(ie.line+dt,ie.ch+Je):Ne.head.line==Ne.anchor.line?new n(ie.line,ie.ch+Je):new n(ie.line+dt,ie.ch),m.visualMode=!0,m.visualLine=Ne.visualLine,m.visualBlock=Ne.visualBlock,L=m.sel={anchor:Y,head:X},Fn(u)}else m.visualMode&&(R.lastSel={anchor:Ge(L.anchor),head:Ge(L.head),visualBlock:m.visualBlock,visualLine:m.visualLine});var Nt,Ft,Ue,$e,$t;if(m.visualMode){Nt=kt(L.head,L.anchor),Ft=zn(L.head,L.anchor),Ue=m.visualLine||R.linewise,$e=m.visualBlock?"block":Ue?"line":"char";var rn=i(u,Nt,Ft);if($t=or(u,{anchor:rn.start,head:rn.end},$e),Ue){var pn=$t.ranges;if($e=="block")for(var Za=0;Za<pn.length;Za++)pn[Za].head.ch=St(u,pn[Za].head.line);else $e=="line"&&(pn[0].head=new n(pn[0].head.line+1,0))}}else{if(Nt=Ge(Y||ie),Ft=Ge(X||oe),xt(Ft,Nt)){var xc=Nt;Nt=Ft,Ft=xc}Ue=x.linewise||R.linewise,Ue?te(u,Nt,Ft):x.forward&&j(u,Nt,Ft),$e="char";var kc=!x.inclusive||Ue,rn=i(u,Nt,Ft);$t=or(u,{anchor:rn.start,head:rn.end},$e,kc)}u.setSelections($t.ranges,$t.primary),m.lastMotion=null,R.repeat=xe,R.registerName=O,R.linewise=Ue;var Wo=Ut[k](u,R,$t.ranges,ie,X);m.visualMode&&Ye(u,Wo!=null),Wo&&u.setCursor(Wo)}},recordLastEdit:function(u,m,v){var b=Q.macroModeState;b.isPlaying||(u.lastEditInputState=m,u.lastEditActionCommand=v,b.lastInsertModeChanges.changes=[],b.lastInsertModeChanges.expectCursorActivityForChange=!1,b.lastInsertModeChanges.visualBlock=u.visualBlock?u.sel.head.line-u.sel.anchor.line:0)}},dn={moveToTopLine:function(u,m,v){var b=Ka(u).top+v.repeat-1;return new n(b,ve(u.getLine(b)))},moveToMiddleLine:function(u){var m=Ka(u),v=Math.floor((m.top+m.bottom)*.5);return new n(v,ve(u.getLine(v)))},moveToBottomLine:function(u,m,v){var b=Ka(u).bottom-v.repeat+1;return new n(b,ve(u.getLine(b)))},expandToLine:function(u,m,v){return new n(m.line+v.repeat-1,1/0)},findNext:function(u,m,v){var b=Kn(u),x=b.getQuery();if(x){var k=!v.forward;k=b.isReversed()?!k:k,Bo(u,x);var R=xi(u,k,x,v.repeat);return R||ct(u,"No match found "+x+(be("pcre")?" (set nopcre to use Vim regexps)":"")),R}},findAndSelectNextInclusive:function(u,m,v,b,x){var k=Kn(u),R=k.getQuery();if(R){var O=!v.forward;O=k.isReversed()?!O:O;var L=xf(u,O,R,v.repeat,b);if(L){if(x.operator)return L;var z=L[0],q=new n(L[1].line,L[1].ch-1);if(b.visualMode){(b.visualLine||b.visualBlock)&&(b.visualLine=!1,b.visualBlock=!1,e.signal(u,"vim-mode-change",{mode:"visual",subMode:""}));var oe=b.sel.anchor;if(oe)return k.isReversed()?v.forward?[oe,z]:[oe,q]:v.forward?[oe,q]:[oe,z]}else b.visualMode=!0,b.visualLine=!1,b.visualBlock=!1,e.signal(u,"vim-mode-change",{mode:"visual",subMode:""});return O?[q,z]:[z,q]}}},goToMark:function(u,m,v,b){var x=Ho(u,b,v.selectedCharacter||"");return x?v.linewise?{line:x.line,ch:ve(u.getLine(x.line))}:x:null},moveToOtherHighlightedEnd:function(u,m,v,b){var x=b.sel;return b.visualBlock&&v.sameLine?[zt(u,new n(x.anchor.line,x.head.ch)),zt(u,new n(x.head.line,x.anchor.ch))]:[x.head,x.anchor]},jumpToMark:function(u,m,v,b){for(var x=m,k=0;k<v.repeat;k++){var R=x;for(var O in b.marks)if(N(O)){var L=b.marks[O].find();if(!(v.forward?xt(L,R):xt(R,L))&&!(v.linewise&&L.line==R.line)){var z=gt(R,x),q=v.forward?_r(R,L,x):_r(x,L,R);(z||q)&&(x=L)}}}return v.linewise&&(x=new n(x.line,ve(u.getLine(x.line)))),x},moveByCharacters:function(u,m,v){var b=m,x=v.repeat,k=v.forward?b.ch+x:b.ch-x;return new n(b.line,k)},moveByLines:function(u,m,v,b){var x=m,k=x.ch;switch(b.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:k=b.lastHPos;break;default:b.lastHPos=k}var R=v.repeat+(v.repeatOffset||0),O=v.forward?x.line+R:x.line-R,L=u.firstLine(),z=u.lastLine(),q=u.findPosV(x,v.forward?R:-R,"line",b.lastHSPos);return(v.forward?q.line>O:q.line<O)&&(O=q.line,k=q.ch),O<L&&x.line==L?this.moveToStartOfLine(u,m,v,b):O>z&&x.line==z?wn(u,m,v,b,!0):(v.toFirstChar&&(k=ve(u.getLine(O)),b.lastHPos=k),b.lastHSPos=u.charCoords(new n(O,k),"div").left,new n(O,k))},moveByDisplayLines:function(u,m,v,b){var x=m;switch(b.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:b.lastHSPos=u.charCoords(x,"div").left}var k=v.repeat,R=u.findPosV(x,v.forward?k:-k,"line",b.lastHSPos);if(R.hitSide)if(v.forward){var O={top:u.charCoords(R,"div").top+8,left:b.lastHSPos};R=u.coordsChar(O,"div")}else{var L=u.charCoords(new n(u.firstLine(),0),"div");L.left=b.lastHSPos,R=u.coordsChar(L,"div")}return b.lastHPos=R.ch,R},moveByPage:function(u,m,v){var b=m,x=v.repeat;return u.findPosV(b,v.forward?x:-x,"page")},moveByParagraph:function(u,m,v){var b=v.forward?1:-1;return Xt(u,m,v.repeat,b).start},moveBySentence:function(u,m,v){var b=v.forward?1:-1;return pc(u,m,v.repeat,b)},moveByScroll:function(u,m,v,b){var x=u.getScrollInfo(),k=null,R=v.repeat;R||(R=x.clientHeight/(2*u.defaultTextHeight()));var O=u.charCoords(m,"local");if(v.repeat=R,k=dn.moveByDisplayLines(u,m,v,b),!k)return null;var L=u.charCoords(k,"local");return u.scrollTo(null,x.top+L.top-O.top),k},moveByWords:function(u,m,v){return ut(u,m,v.repeat,!!v.forward,!!v.wordEnd,!!v.bigWord)},moveTillCharacter:function(u,m,v){var b=v.repeat,x=sr(u,b,v.forward,v.selectedCharacter,m),k=v.forward?-1:1;return ot(k,v),x?(x.ch+=k,x):null},moveToCharacter:function(u,m,v){var b=v.repeat;return ot(0,v),sr(u,b,v.forward,v.selectedCharacter,m)||m},moveToSymbol:function(u,m,v){var b=v.repeat;return v.selectedCharacter&&Lt(u,b,v.forward,v.selectedCharacter)||m},moveToColumn:function(u,m,v,b){var x=v.repeat;return b.lastHPos=x-1,b.lastHSPos=u.charCoords(m,"div").left,ii(u,x)},moveToEol:function(u,m,v,b){return wn(u,m,v,b,!1)},moveToFirstNonWhiteSpaceCharacter:function(u,m){var v=m;return new n(v.line,ve(u.getLine(v.line)))},moveToMatchedSymbol:function(u,m){for(var v=m,b=v.line,x=v.ch,k=u.getLine(b),R;x<k.length;x++)if(R=k.charAt(x),R&&K(R)){var O=u.getTokenTypeAt(new n(b,x+1));if(O!=="string"&&O!=="comment")break}if(x<k.length){var L=R==="<"||R===">"?/[(){}[\]<>]/:/[(){}[\]]/;return u.findMatchingBracket(new n(b,x),{bracketRegex:L}).to}else return v},moveToStartOfLine:function(u,m){return new n(m.line,0)},moveToLineOrEdgeOfDocument:function(u,m,v){var b=v.forward?u.lastLine():u.firstLine();return v.repeatIsExplicit&&(b=v.repeat-u.getOption("firstLineNumber")),new n(b,ve(u.getLine(b)))},moveToStartOfDisplayLine:function(u){return u.execCommand("goLineLeft"),u.getCursor()},moveToEndOfDisplayLine:function(u){u.execCommand("goLineRight");var m=u.getCursor();return m.sticky=="before"&&m.ch--,m},textObjectManipulation:function(u,m,v,b){var x={"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"},k={"'":!0,'"':!0,"`":!0},R=v.selectedCharacter||"";R=="b"?R="(":R=="B"&&(R="{");var O=!v.textObjectInner,L,z;if(x[R]){if(z=!0,L=ai(u,m,R,O),!L){var q=u.getSearchCursor(RegExp("\\"+R,"g"),m);q.find()&&(L=ai(u,q.from(),R,O))}}else if(k[R])z=!0,L=ia(u,m,R,O);else if(R==="W"||R==="w")for(var oe=v.repeat||1;oe-- >0;){var ie=Te(u,{inclusive:O,innerWord:!O,bigWord:R==="W",noSymbol:R==="W",multiline:!0},L&&L.end);ie&&(L||(L=ie),L.end=ie.end)}else if(R==="p")if(L=Xt(u,m,v.repeat,0,O),v.linewise=!0,b.visualMode)b.visualLine||(b.visualLine=!0);else{var X=b.inputState.operatorArgs;X&&(X.linewise=!0),L.end.line--}else if(R==="t")L=He(u,m,O);else if(R==="s"){var Y=u.getLine(m.line);m.ch>0&&W(Y[m.ch])&&--m.ch;var xe=zs(u,m,v.repeat,1,O),_e=zs(u,m,v.repeat,-1,O);A(u.getLine(_e.line)[_e.ch])&&A(u.getLine(xe.line)[xe.ch-1])&&(_e={line:_e.line,ch:_e.ch+1}),L={start:_e,end:xe}}return L?u.state.vim.visualMode?wi(u,L.start,L.end,z):[L.start,L.end]:null},repeatLastCharacterSearch:function(u,m,v){var b=Q.lastCharacterSearch,x=v.repeat,k=v.forward===b.forward,R=(b.increment?1:0)*(k?-1:1);u.moveH(-R,"char"),v.inclusive=!!k;var O=sr(u,x,k,b.selectedCharacter);return O?(O.ch+=R,O):(u.moveH(R,"char"),m)}};function ta(u,m){dn[u]=m}function gi(u,m){for(var v=[],b=0;b<m;b++)v.push(u);return v}var Ut={change:function(u,m,v){var b,x,k=u.state.vim,R=v[0].anchor,O=v[0].head;if(k.visualMode)if(m.fullLine)O.ch=Number.MAX_VALUE,O.line--,u.setSelection(R,O),x=u.getSelection(),u.replaceSelection(""),b=R;else{x=u.getSelection();var L=gi("",v.length);u.replaceSelections(L),b=kt(v[0].head,v[0].anchor)}else{x=u.getRange(R,O);var z=k.lastEditInputState;if((z==null?void 0:z.motion)=="moveByWords"&&!A(x)){var q=/\s+$/.exec(x);q&&z.motionArgs&&z.motionArgs.forward&&(O=_t(O,0,-q[0].length),x=x.slice(0,-q[0].length))}m.linewise&&(R=new n(R.line,ve(u.getLine(R.line))),O.line>R.line&&(O=new n(O.line-1,Number.MAX_VALUE))),u.replaceRange("",R,O),b=R}Q.registerController.pushText(m.registerName,"change",x,m.linewise,v.length>1),fn.enterInsertMode(u,{head:b},u.state.vim)},delete:function(u,m,v){var b,x,k=u.state.vim;if(k.visualBlock){x=u.getSelection();var R=gi("",v.length);u.replaceSelections(R),b=kt(v[0].head,v[0].anchor)}else{var O=v[0].anchor,L=v[0].head;m.linewise&&L.line!=u.firstLine()&&O.line==u.lastLine()&&O.line==L.line-1&&(O.line==u.firstLine()?O.ch=0:O=new n(O.line-1,St(u,O.line-1))),x=u.getRange(O,L),u.replaceRange("",O,L),b=O,m.linewise&&(b=dn.moveToFirstNonWhiteSpaceCharacter(u,O))}return Q.registerController.pushText(m.registerName,"delete",x,m.linewise,k.visualBlock),zt(u,b)},indent:function(u,m,v){var b=u.state.vim,x=b.visualMode&&m.repeat||1;if(b.visualBlock){for(var k=u.getOption("tabSize"),R=u.getOption("indentWithTabs")?" ":" ".repeat(k),O,L=v.length-1;L>=0;L--)if(O=kt(v[L].anchor,v[L].head),m.indentRight)u.replaceRange(R.repeat(x),O,O);else{for(var z=u.getLine(O.line),q=0,oe=0;oe<x;oe++){var ie=z[O.ch+q];if(ie==" ")q++;else if(ie==" "){q++;for(var X=1;X<R.length&&(ie=z[O.ch+q],ie===" ");X++)q++}else break}u.replaceRange("",O,_t(O,0,q))}return O}else if(u.indentMore)for(var oe=0;oe<x;oe++)m.indentRight?u.indentMore():u.indentLess();else{var Y=v[0].anchor.line,xe=b.visualBlock?v[v.length-1].anchor.line:v[0].head.line;m.linewise&&xe--;for(var L=Y;L<=xe;L++)for(var oe=0;oe<x;oe++)u.indentLine(L,m.indentRight)}return dn.moveToFirstNonWhiteSpaceCharacter(u,v[0].anchor)},indentAuto:function(u,m,v){return u.execCommand("indentAuto"),dn.moveToFirstNonWhiteSpaceCharacter(u,v[0].anchor)},hardWrap:function(u,m,v,b){if(u.hardWrap){var x=v[0].anchor.line,k=v[0].head.line;m.linewise&&k--;var R=u.hardWrap({from:x,to:k});return R>x&&m.linewise&&R--,m.keepCursor?b:new n(R,0)}},changeCase:function(u,m,v,b,x){for(var k=u.getSelections(),R=[],O=m.toLower,L=0;L<k.length;L++){var z=k[L],q="";if(O===!0)q=z.toLowerCase();else if(O===!1)q=z.toUpperCase();else for(var oe=0;oe<z.length;oe++){var ie=z.charAt(oe);q+=P(ie)?ie.toLowerCase():ie.toUpperCase()}R.push(q)}return u.replaceSelections(R),m.shouldMoveCursor?x:!u.state.vim.visualMode&&m.linewise&&v[0].anchor.line+1==v[0].head.line?dn.moveToFirstNonWhiteSpaceCharacter(u,b):m.linewise?b:kt(v[0].anchor,v[0].head)},yank:function(u,m,v,b){var x=u.state.vim,k=u.getSelection(),R=x.visualMode?kt(x.sel.anchor,x.sel.head,v[0].head,v[0].anchor):b;return Q.registerController.pushText(m.registerName,"yank",k,m.linewise,x.visualBlock),R},rot13:function(u,m,v,b,x){for(var k=u.getSelections(),R=[],O=0;O<k.length;O++){let L=k[O].split("").map(z=>{let q=z.charCodeAt(0);return q>=65&&q<=90?String.fromCharCode(65+(q-65+13)%26):q>=97&&q<=122?String.fromCharCode(97+(q-97+13)%26):z}).join("");R.push(L)}return u.replaceSelections(R),m.shouldMoveCursor?x:!u.state.vim.visualMode&&m.linewise&&v[0].anchor.line+1==v[0].head.line?dn.moveToFirstNonWhiteSpaceCharacter(u,b):m.linewise?b:kt(v[0].anchor,v[0].head)}};function yi(u,m){Ut[u]=m}var fn={jumpListWalk:function(u,m,v){if(!v.visualMode){var b=m.repeat||1,x=m.forward,k=Q.jumpList.move(u,x?b:-b),R=k?k.find():void 0;R||(R=u.getCursor()),u.setCursor(R)}},scroll:function(u,m,v){if(!v.visualMode){var b=m.repeat||1,x=u.defaultTextHeight(),k=u.getScrollInfo().top,R=x*b,O=m.forward?k+R:k-R,L=Ge(u.getCursor()),z=u.charCoords(L,"local");if(m.forward)O>z.top?(L.line+=(O-z.top)/x,L.line=Math.ceil(L.line),u.setCursor(L),z=u.charCoords(L,"local"),u.scrollTo(null,z.top)):u.scrollTo(null,O);else{var q=O+u.getScrollInfo().clientHeight;q<z.bottom?(L.line-=(z.bottom-q)/x,L.line=Math.floor(L.line),u.setCursor(L),z=u.charCoords(L,"local"),u.scrollTo(null,z.bottom-u.getScrollInfo().clientHeight)):u.scrollTo(null,O)}}},scrollToCursor:function(u,m){var v=u.getCursor().line,b=u.charCoords(new n(v,0),"local"),x=u.getScrollInfo().clientHeight,k=b.top;switch(m.position){case"center":k=b.bottom-x/2;break;case"bottom":var R=new n(v,u.getLine(v).length-1),O=u.charCoords(R,"local").bottom-k;k=k-x+O;break}u.scrollTo(null,k)},replayMacro:function(u,m,v){var b=m.selectedCharacter||"",x=m.repeat||1,k=Q.macroModeState;for(b=="@"?b=k.latestRegister||"":k.latestRegister=b;x--;)Qa(u,v,k,b)},enterMacroRecordMode:function(u,m){var v=Q.macroModeState,b=m.selectedCharacter;Q.registerController.isValidRegister(b)&&v.enterMacroRecordMode(u,b)},toggleOverwrite:function(u){u.state.overwrite?(u.toggleOverwrite(!1),u.setOption("keyMap","vim-insert"),e.signal(u,"vim-mode-change",{mode:"insert"})):(u.toggleOverwrite(!0),u.setOption("keyMap","vim-replace"),e.signal(u,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(u,m,v){if(!u.getOption("readOnly")){v.insertMode=!0,v.insertModeRepeat=m&&m.repeat||1;var b=m?m.insertAt:null,x=v.sel,k=m.head||u.getCursor("head"),R=u.listSelections().length;if(b=="eol")k=new n(k.line,St(u,k.line));else if(b=="bol")k=new n(k.line,0);else if(b=="charAfter"){var O=i(u,k,_t(k,0,1));k=O.end}else if(b=="firstNonBlank"){var O=i(u,k,dn.moveToFirstNonWhiteSpaceCharacter(u,k));k=O.end}else if(b=="startOfSelectedArea"){if(!v.visualMode)return;v.visualBlock?(k=new n(Math.min(x.head.line,x.anchor.line),Math.min(x.head.ch,x.anchor.ch)),R=Math.abs(x.head.line-x.anchor.line)+1):k=x.head.line<x.anchor.line?x.head:new n(x.anchor.line,0)}else if(b=="endOfSelectedArea"){if(!v.visualMode)return;v.visualBlock?(k=new n(Math.min(x.head.line,x.anchor.line),Math.max(x.head.ch,x.anchor.ch)+1),R=Math.abs(x.head.line-x.anchor.line)+1):k=x.head.line>=x.anchor.line?_t(x.head,0,1):new n(x.anchor.line,0)}else if(b=="inplace"){if(v.visualMode)return}else b=="lastEdit"&&(k=bc(u)||k);u.setOption("disableInput",!1),m&&m.replace?(u.toggleOverwrite(!0),u.setOption("keyMap","vim-replace"),e.signal(u,"vim-mode-change",{mode:"replace"})):(u.toggleOverwrite(!1),u.setOption("keyMap","vim-insert"),e.signal(u,"vim-mode-change",{mode:"insert"})),Q.macroModeState.isPlaying||(u.on("change",Wr),v.insertEnd&&v.insertEnd.clear(),v.insertEnd=u.setBookmark(k,{insertLeft:!0}),e.on(u.getInputField(),"keydown",Ws)),v.visualMode&&Ye(u),ar(u,k,R)}},toggleVisualMode:function(u,m,v){var b=m.repeat,x=u.getCursor(),k;if(v.visualMode)v.visualLine!=!!m.linewise||v.visualBlock!=!!m.blockwise?(v.visualLine=!!m.linewise,v.visualBlock=!!m.blockwise,e.signal(u,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""}),Fn(u)):Ye(u);else{v.visualMode=!0,v.visualLine=!!m.linewise,v.visualBlock=!!m.blockwise,k=zt(u,new n(x.line,x.ch+b-1));var R=i(u,x,k);v.sel={anchor:R.start,head:R.end},e.signal(u,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""}),Fn(u),Bn(u,v,"<",kt(x,k)),Bn(u,v,">",zn(x,k))}},reselectLastSelection:function(u,m,v){var b=v.lastSelection;if(v.visualMode&&Ln(u,v),b){var x=b.anchorMark.find(),k=b.headMark.find();if(!x||!k)return;v.sel={anchor:x,head:k},v.visualMode=!0,v.visualLine=b.visualLine,v.visualBlock=b.visualBlock,Fn(u),Bn(u,v,"<",kt(x,k)),Bn(u,v,">",zn(x,k)),e.signal(u,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""})}},joinLines:function(u,m,v){var b,x;if(v.visualMode){if(b=u.getCursor("anchor"),x=u.getCursor("head"),xt(x,b)){var k=x;x=b,b=k}x.ch=St(u,x.line)-1}else{var R=Math.max(m.repeat,2);b=u.getCursor(),x=zt(u,new n(b.line+R-1,1/0))}for(var O=0,L=b.line;L<x.line;L++){O=St(u,b.line);var z="",q=0;if(!m.keepSpaces){var oe=u.getLine(b.line+1);q=oe.search(/\S/),q==-1?q=oe.length:z=" "}u.replaceRange(z,new n(b.line,O),new n(b.line+1,q))}var ie=zt(u,new n(b.line,O));v.visualMode&&Ye(u,!1),u.setCursor(ie)},newLineAndEnterInsertMode:function(u,m,v){v.insertMode=!0;var b=Ge(u.getCursor());b.line===u.firstLine()&&!m.after?(u.replaceRange(`
96
96
  `,new n(u.firstLine(),0)),u.setCursor(u.firstLine(),0)):(b.line=m.after?b.line:b.line-1,b.ch=St(u,b.line),u.setCursor(b),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(u)),this.enterInsertMode(u,{repeat:m.repeat},v)},paste:function(u,m,v){var b=Q.registerController.getRegister(m.registerName);if(m.registerName==="+")navigator.clipboard.readText().then(k=>{this.continuePaste(u,m,v,k,b)});else{var x=b.toString();this.continuePaste(u,m,v,x,b)}},continuePaste:function(u,m,v,b,x){var k=Ge(u.getCursor());if(b){if(m.matchIndent){var R=u.getOption("tabSize"),O=function($t){var rn=$t.split(" ").length-1,pn=$t.split(" ").length-1;return rn*R+pn*1},L=O(u.getLine(u.getCursor().line).match(/^\s*/)[0]),z=b.replace(/\n$/,""),q=b!==z,oe=O(b.match(/^\s*/)[0]),b=z.replace(/^\s*/gm,function($t){var rn=L+(O($t)-oe);if(rn<0)return"";if(u.getOption("indentWithTabs")){var pn=Math.floor(rn/R);return Array(pn+1).join(" ")}else return Array(rn+1).join(" ")});b+=q?`
97
97
  `:""}m.repeat>1&&(b=Array(m.repeat+1).join(b));var ie=x.linewise,X=x.blockwise,Y=X?b.split(`
98
98
  `):void 0;if(Y){ie&&Y.pop();for(var xe=0;xe<Y.length;xe++)Y[xe]=Y[xe]==""?" ":Y[xe];k.ch+=m.after?1:0,k.ch=Math.min(St(u,k.line),k.ch)}else ie?v.visualMode?b=v.visualLine?b.slice(0,-1):`
@@ -103,9 +103,9 @@ ${i.sqlString}
103
103
  `)v.visualMode||u.replaceRange("",x,R),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(u);else{var q=u.getRange(x,R);if(q=q.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b),q=q.replace(/[^\n]/g,b),v.visualBlock){var oe=Array(u.getOption("tabSize")+1).join(" ");q=u.getSelection(),q=q.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b);var ie=q.replace(/\t/g,oe).replace(/[^\n]/g,b).split(`
104
104
  `);u.replaceSelections(ie)}else u.replaceRange(q,x,R);v.visualMode?(x=xt(O[0].anchor,O[0].head)?O[0].anchor:O[0].head,u.setCursor(x),Ye(u,!1)):u.setCursor(_t(R,0,-1))}},incrementNumberToken:function(u,m){for(var v=u.getCursor(),b=u.getLine(v.line),x=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,k,R,O,L;(k=x.exec(b))!==null&&(R=k.index,O=R+k[0].length,!(v.ch<O)););if(!(!m.backtrack&&O<=v.ch)){if(k){var z=k[2]||k[4],q=k[3]||k[5],oe=m.increase?1:-1,ie={"0b":2,0:8,"":10,"0x":16}[z.toLowerCase()];L=(parseInt(k[1]+q,ie)+oe*m.repeat).toString(ie);var X=z?Array(q.length-L.length+1+k[1].length).join("0"):"";L=L.charAt(0)==="-"?"-"+z+X+L.substr(1):z+X+L;var Y=new n(v.line,R),xe=new n(v.line,O);u.replaceRange(L,Y,xe)}else return;u.setCursor(new n(v.line,R+L.length-1))}},repeatLastEdit:function(u,m,v){var b=v.lastEditInputState;if(b){var x=m.repeat;x&&m.repeatIsExplicit?b.repeatOverride=x:x=b.repeatOverride||x,Xa(u,v,x,!1)}},indent:function(u,m){u.indentLine(u.getCursor().line,m.indentRight)},exitInsertMode:function(u,m){Vn(u)}};function ni(u,m){fn[u]=m}function zt(u,m,v){var b=u.state.vim,x=b.insertMode||b.visualMode,k=Math.min(Math.max(u.firstLine(),m.line),u.lastLine()),R=u.getLine(k),O=R.length-1+ +!!x,L=Math.min(Math.max(0,m.ch),O),z=R.charCodeAt(L);if(56320<=z&&z<=57343){var q=1;v&&v.line==k&&v.ch>L&&(q=-1),L+=q,L>O&&(L-=2)}return new n(k,L)}function Br(u){var m={};for(var v in u)Object.prototype.hasOwnProperty.call(u,v)&&(m[v]=u[v]);return m}function _t(u,m,v){return typeof m=="object"&&(v=m.ch,m=m.line),new n(u.line+m,u.ch+v)}function vi(u,m,v,b){b.operator&&(v="operatorPending");for(var x,k=[],R=[],O=Pe?m.length-c:0;O<m.length;O++){var L=m[O];v=="insert"&&L.context!="insert"||L.context&&L.context!=v||b.operator&&L.type=="action"||!(x=na(u,L.keys))||(x=="partial"&&k.push(L),x=="full"&&R.push(L))}return{partial:k,full:R}}function na(u,m){let v=m.slice(-11)=="<character>",b=m.slice(-10)=="<register>";if(v||b){var x=m.length-(v?11:10),k=u.slice(0,x),R=m.slice(0,x);return k==R&&u.length>x?"full":R.indexOf(k)==0?"partial":!1}else return u==m?"full":m.indexOf(u)==0?"partial":!1}function wr(u){var m=/^.*(<[^>]+>)$/.exec(u),v=m?m[1]:u.slice(-1);if(v.length>1)switch(v){case"<CR>":case"<S-CR>":v=`
105
105
  `;break;case"<Space>":case"<S-Space>":v=" ";break;default:v="";break}return v}function Jt(u,m,v){return function(){for(var b=0;b<v;b++)m(u)}}function Ge(u){return new n(u.line,u.ch)}function gt(u,m){return u.ch==m.ch&&u.line==m.line}function xt(u,m){return u.line<m.line||u.line==m.line&&u.ch<m.ch}function kt(u,m){return arguments.length>2&&(m=kt.apply(void 0,Array.prototype.slice.call(arguments,1))),xt(u,m)?u:m}function zn(u,m){return arguments.length>2&&(m=zn.apply(void 0,Array.prototype.slice.call(arguments,1))),xt(u,m)?m:u}function _r(u,m,v){var b=xt(u,m),x=xt(m,v);return b&&x}function St(u,m){return u.getLine(m).length}function ir(u){return u.trim?u.trim():u.replace(/^\s+|\s+$/g,"")}function Mn(u){return u.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function Hr(u,m,v){var b=St(u,m),x=Array(v-b+1).join(" ");u.setCursor(new n(m,b)),u.replaceRange(x,u.getCursor())}function bn(u,m){var v=[],b=u.listSelections(),x=Ge(u.clipPos(m)),k=!gt(m,x),R=bi(b,u.getCursor("head")),O=gt(b[R].head,b[R].anchor),L=b.length-1,z=L-R>R?L:0,q=b[z].anchor,oe=Math.min(q.line,x.line),ie=Math.max(q.line,x.line),X=q.ch,Y=x.ch,xe=b[z].head.ch-X,_e=Y-X;xe>0&&_e<=0?(X++,k||Y--):xe<0&&_e>=0?(X--,O||Y++):xe<0&&_e==-1&&(X--,Y++);for(var qe=oe;qe<=ie;qe++){var Re={anchor:new n(qe,X),head:new n(qe,Y)};v.push(Re)}return u.setSelections(v),m.ch=Y,q.ch=X,q}function ar(u,m,v){for(var b=[],x=0;x<v;x++){var k=_t(m,x,0);b.push({anchor:k,head:k})}u.setSelections(b,0)}function bi(u,m,v){for(var b=0;b<u.length;b++){var x=gt(u[b].anchor,m),k=gt(u[b].head,m);if(x||k)return b}return-1}function ri(u,m){var v=u.listSelections(),b=v[0],x=v[v.length-1];return[xt(b.anchor,b.head)?b.anchor:b.head,xt(x.anchor,x.head)?x.head:x.anchor]}function Ln(u,m){var v=m.sel.anchor,b=m.sel.head;m.lastPastedText&&(m.lastPastedText=(b=u.posFromIndex(u.indexFromPos(v)+m.lastPastedText.length),void 0)),m.lastSelection={anchorMark:u.setBookmark(v),headMark:u.setBookmark(b),anchor:Ge(v),head:Ge(b),visualMode:m.visualMode,visualLine:m.visualLine,visualBlock:m.visualBlock}}function wi(u,m,v,b){var x=u.state.vim.sel,k=b?m:x.head,R=b?m:x.anchor,O;return xt(v,m)&&(O=v,v=m,m=O),xt(k,R)?(k=kt(m,k),R=zn(R,v)):(R=kt(m,R),k=zn(k,v),k=_t(k,0,-1),k.ch==-1&&k.line!=u.firstLine()&&(k=new n(k.line-1,St(u,k.line-1)))),[R,k]}function Fn(u,m,v){var b=u.state.vim;m||(m=b.sel),v||(v=b.visualLine?"line":b.visualBlock?"block":"char");var x=or(u,m,v);u.setSelections(x.ranges,x.primary)}function or(u,m,v,b){var x=Ge(m.head),k=Ge(m.anchor);if(v=="char"){var R=!b&&!xt(m.head,m.anchor)?1:0,O=xt(m.head,m.anchor)?1:0;return x=_t(m.head,0,R),k=_t(m.anchor,0,O),{ranges:[{anchor:k,head:x}],primary:0}}else if(v=="line"){if(xt(m.head,m.anchor))x.ch=0,k.ch=St(u,k.line);else{k.ch=0;var L=u.lastLine();x.line>L&&(x.line=L),x.ch=St(u,x.line)}return{ranges:[{anchor:k,head:x}],primary:0}}else if(v=="block"){var z=Math.min(k.line,x.line),q=k.ch,oe=Math.max(k.line,x.line),ie=x.ch;q<ie?ie+=1:q+=1;for(var X=oe-z+1,Y=x.line==z?0:X-1,xe=[],_e=0;_e<X;_e++)xe.push({anchor:new n(z+_e,q),head:new n(z+_e,ie)});return{ranges:xe,primary:Y}}throw"never happens"}function M(u){var m=u.getCursor("head");return u.getSelection().length==1&&(m=kt(m,u.getCursor("anchor"))),m}function Ye(u,m){var v=u.state.vim;m!==!1&&u.setCursor(zt(u,v.sel.head)),Ln(u,v),v.visualMode=!1,v.visualLine=!1,v.visualBlock=!1,v.insertMode||e.signal(u,"vim-mode-change",{mode:"normal"})}function j(u,m,v){var b=u.getRange(m,v);if(/\n\s*$/.test(b)){var x=b.split(`
106
- `);x.pop();for(var k=x.pop();x.length>0&&k&&A(k);k=x.pop())v.line--,v.ch=0;k?(v.line--,v.ch=St(u,v.line)):v.ch=0}}function te(u,m,v){m.ch=0,v.ch=0,v.line++}function ve(u){if(!u)return 0;var m=u.search(/\S/);return m==-1?u.length:m}function Te(u,{inclusive:m,innerWord:v,bigWord:b,noSymbol:x,multiline:k},R){var O=R||M(u),L=u.getLine(O.line),z=L,q=O.line,oe=q,ie=O.ch,X,Y=x?C[0]:E[0];if(v&&/\s/.test(L.charAt(ie)))Y=function(dt){return/\s/.test(dt)};else{for(;!Y(L.charAt(ie));)if(ie++,ie>=L.length){if(!k)return null;ie--,X=rt(u,O,!0,b,!0);break}b?Y=E[0]:(Y=C[0],Y(L.charAt(ie))||(Y=C[1]))}for(var xe=ie,_e=ie;Y(L.charAt(_e))&&_e>=0;)_e--;if(_e++,X)xe=X.to,oe=X.line,z=u.getLine(oe),!z&&xe==0&&xe++;else for(;Y(L.charAt(xe))&&xe<L.length;)xe++;if(m){var qe=xe,Re=O.ch<=_e&&/\s/.test(L.charAt(O.ch));if(!Re)for(;/\s/.test(z.charAt(xe))&&xe<z.length;)xe++;if(qe==xe||Re){for(var Ne=_e;/\s/.test(L.charAt(_e-1))&&_e>0;)_e--;!_e&&!Re&&(_e=Ne)}}return{start:new n(q,_e),end:new n(oe,xe)}}function He(u,m,v){var b=m;if(!e.findMatchingTag||!e.findEnclosingTag)return{start:b,end:b};var x=e.findMatchingTag(u,m)||e.findEnclosingTag(u,m);return!x||!x.open||!x.close?{start:b,end:b}:v?{start:x.open.from,end:x.close.to}:{start:x.open.to,end:x.close.from}}function Ve(u,m,v){gt(m,v)||Q.jumpList.add(u,m,v)}function ot(u,m){Q.lastCharacterSearch.increment=u,Q.lastCharacterSearch.forward=m.forward,Q.lastCharacterSearch.selectedCharacter=m.selectedCharacter}var Mt={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},Ze={bracket:{isComplete:function(u){if(u.nextCh===u.symb){if(u.depth++,u.depth>=1)return!0}else u.nextCh===u.reverseSymb&&u.depth--;return!1}},section:{init:function(u){u.curMoveThrough=!0,u.symb=(u.forward?"]":"[")===u.symb?"{":"}"},isComplete:function(u){return u.index===0&&u.nextCh===u.symb}},comment:{isComplete:function(u){var m=u.lastCh==="*"&&u.nextCh==="/";return u.lastCh=u.nextCh,m}},method:{init:function(u){u.symb=u.symb==="m"?"{":"}",u.reverseSymb=u.symb==="{"?"}":"{"},isComplete:function(u){return u.nextCh===u.symb}},preprocess:{init:function(u){u.index=0},isComplete:function(u){var v;if(u.nextCh==="#"){var m=(v=u.lineText.match(/^#(\w+)/))==null?void 0:v[1];if(m==="endif"){if(u.forward&&u.depth===0)return!0;u.depth++}else if(m==="if"){if(!u.forward&&u.depth===0)return!0;u.depth--}if(m==="else"&&u.depth===0)return!0}return!1}}};function Lt(u,m,v,b){var x=Ge(u.getCursor()),k=v?1:-1,R=v?u.lineCount():-1,O=x.ch,L=x.line,z=u.getLine(L),q={lineText:z,nextCh:z.charAt(O),lastCh:null,index:O,symb:b,reverseSymb:(v?{")":"(","}":"{"}:{"(":")","{":"}"})[b],forward:v,depth:0,curMoveThrough:!1},oe=Mt[b];if(!oe)return x;var ie=Ze[oe].init,X=Ze[oe].isComplete;for(ie&&ie(q);L!==R&&m;){if(q.index+=k,q.nextCh=q.lineText.charAt(q.index),!q.nextCh){if(L+=k,q.lineText=u.getLine(L)||"",k>0)q.index=0;else{var Y=q.lineText.length;q.index=Y>0?Y-1:0}q.nextCh=q.lineText.charAt(q.index)}X(q)&&(x.line=L,x.ch=q.index,m--)}return q.nextCh||q.curMoveThrough?new n(L,q.index):x}function rt(u,m,v,b,x){var k=m.line,R=m.ch,O=u.getLine(k),L=v?1:-1,z=b?E:C;if(x&&O==""){if(k+=L,O=u.getLine(k),!F(u,k))return null;R=v?0:O.length}for(;;){if(x&&O=="")return{from:0,to:0,line:k};for(var q=L>0?O.length:-1,oe=q,ie=q;R!=q;){for(var X=!1,Y=0;Y<z.length&&!X;++Y)if(z[Y](O.charAt(R))){for(oe=R;R!=q&&z[Y](O.charAt(R));)R+=L;if(ie=R,X=oe!=ie,oe==m.ch&&k==m.line&&ie==oe+L)continue;return{from:Math.min(oe,ie+1),to:Math.max(oe,ie),line:k}}X||(R+=L)}if(k+=L,!F(u,k))return null;O=u.getLine(k),R=L>0?0:O.length}}function ut(u,m,v,b,x,k){var R=Ge(m),O=[];(b&&!x||!b&&x)&&v++;for(var L=!(b&&x),z=0;z<v;z++){var q=rt(u,m,b,k,L);if(!q){var oe=St(u,u.lastLine());O.push(b?{line:u.lastLine(),from:oe,to:oe}:{line:0,from:0,to:0});break}O.push(q),m=new n(q.line,b?q.to-1:q.from)}var ie=O.length!=v,X=O[0],Y=O.pop();return b&&!x?(!ie&&(X.from!=R.ch||X.line!=R.line)&&(Y=O.pop()),Y&&new n(Y.line,Y.from)):b&&x?Y&&new n(Y.line,Y.to-1):!b&&x?(!ie&&(X.to!=R.ch||X.line!=R.line)&&(Y=O.pop()),Y&&new n(Y.line,Y.to)):Y&&new n(Y.line,Y.from)}function wn(u,m,v,b,x){var k=new n(m.line+v.repeat-1,1/0),R=u.clipPos(k);return R.ch--,x||(b.lastHPos=1/0,b.lastHSPos=u.charCoords(R,"div").left),k}function sr(u,m,v,b,x){if(b){for(var k=x||u.getCursor(),R=k.ch,O,L=0;L<m;L++){var z=u.getLine(k.line);if(O=ra(R,z,b,v),O==-1)return;R=O}if(O!=null)return new n(u.getCursor().line,O)}}function ii(u,m){var v=u.getCursor().line;return zt(u,new n(v,m-1))}function Bn(u,m,v,b){!de(v,T)&&!$.test(v)||(m.marks[v]&&m.marks[v].clear(),m.marks[v]=u.setBookmark(b))}function ra(u,m,v,b,x){return b?m.indexOf(v,u+1):m.lastIndexOf(v,u-1)}function Xt(u,m,v,b,x){var k=m.line,R=u.firstLine(),O=u.lastLine(),L,z,q=k;function oe(_e){return!u.getLine(_e)}function ie(_e,qe,Re){return Re?oe(_e)!=oe(_e+qe):!oe(_e)&&oe(_e+qe)}if(b){for(;R<=q&&q<=O&&v>0;)ie(q,b)&&v--,q+=b;return{start:new n(q,0),end:m}}var X=u.state.vim;if(X.visualLine&&ie(k,1,!0)){var Y=X.sel.anchor;ie(Y.line,-1,!0)&&(!x||Y.line!=k)&&(k+=1)}var xe=oe(k);for(q=k;q<=O&&v;q++)ie(q,1,!0)&&(!x||oe(q)!=xe)&&v--;for(z=new n(q,0),q>O&&!xe?xe=!0:x=!1,q=k;q>R&&!((!x||oe(q)==xe||q==k)&&ie(q,-1,!0));q--);return L=new n(q,0),{start:L,end:z}}function zs(u,m,v,b,x){function k(z){z.line!==null&&(z.pos+z.dir<0||z.pos+z.dir>=z.line.length?z.line=null:z.pos+=z.dir)}function R(z,q,oe,ie){var X={line:z.getLine(q),ln:q,pos:oe,dir:ie};if(X.line==="")return{ln:X.ln,pos:X.pos};var Y=X.pos;for(k(X);X.line!==null;){if(Y=X.pos,W(X.line[X.pos]))if(x){for(k(X);X.line!==null&&A(X.line[X.pos]);)Y=X.pos,k(X);return{ln:X.ln,pos:Y+1}}else return{ln:X.ln,pos:X.pos+1};k(X)}return{ln:X.ln,pos:Y+1}}function O(z,q,oe,ie){var X=z.getLine(q),Y={line:X,ln:q,pos:oe,dir:ie};if(Y.line==="")return{ln:Y.ln,pos:Y.pos};var xe=Y.pos;for(k(Y);Y.line!==null;){if(!A(Y.line[Y.pos])&&!W(Y.line[Y.pos]))xe=Y.pos;else if(W(Y.line[Y.pos]))return x&&A(Y.line[Y.pos+1])?{ln:Y.ln,pos:Y.pos+1}:{ln:Y.ln,pos:xe};k(Y)}return Y.line=X,x&&A(Y.line[Y.pos])?{ln:Y.ln,pos:Y.pos}:{ln:Y.ln,pos:xe}}for(var L={ln:m.line,pos:m.ch};v>0;)L=b<0?O(u,L.ln,L.pos,b):R(u,L.ln,L.pos,b),v--;return new n(L.ln,L.pos)}function hc(u,m,v,b){function x(L,z){if(z.line!==null)if(z.pos+z.dir<0||z.pos+z.dir>=z.line.length){if(z.ln+=z.dir,!F(L,z.ln)){z.line=null;return}z.line=L.getLine(z.ln),z.pos=z.dir>0?0:z.line.length-1}else z.pos+=z.dir}function k(L,z,q,oe){var _e=L.getLine(z),ie=_e==="",X={line:_e,ln:z,pos:q,dir:oe},Y={ln:X.ln,pos:X.pos},xe=X.line==="";for(x(L,X);X.line!==null;){if(Y.ln=X.ln,Y.pos=X.pos,X.line===""&&!xe||ie&&X.line!==""&&!A(X.line[X.pos]))return{ln:X.ln,pos:X.pos};W(X.line[X.pos])&&!ie&&(X.pos===X.line.length-1||A(X.line[X.pos+1]))&&(ie=!0),x(L,X)}var _e=L.getLine(Y.ln);Y.pos=0;for(var qe=_e.length-1;qe>=0;--qe)if(!A(_e[qe])){Y.pos=qe;break}return Y}function R(L,z,q,oe){var _e=L.getLine(z),ie={line:_e,ln:z,pos:q,dir:oe},X=ie.ln,Y=null,xe=ie.line==="";for(x(L,ie);ie.line!==null;){if(ie.line===""&&!xe)return Y===null?{ln:ie.ln,pos:ie.pos}:{ln:X,pos:Y};if(W(ie.line[ie.pos])&&Y!==null&&!(ie.ln===X&&ie.pos+1===Y))return{ln:X,pos:Y};ie.line!==""&&!A(ie.line[ie.pos])&&(xe=!1,X=ie.ln,Y=ie.pos),x(L,ie)}var _e=L.getLine(X);Y=0;for(var qe=0;qe<_e.length;++qe)if(!A(_e[qe])){Y=qe;break}return{ln:X,pos:Y}}for(var O={ln:m.line,pos:m.ch};v>0;)O=b<0?R(u,O.ln,O.pos,b):k(u,O.ln,O.pos,b),v--;return new n(O.ln,O.pos)}function ai(u,m,v,b){var x=m,k={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[v],R={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[v],O=u.getLine(x.line).charAt(x.ch)===R?1:0,L=u.scanForBracket(new n(x.line,x.ch+O),-1,void 0,{bracketRegex:k}),z=u.scanForBracket(new n(x.line,x.ch+O),1,void 0,{bracketRegex:k});if(!L||!z)return null;var q=L.pos,oe=z.pos;if(q.line==oe.line&&q.ch>oe.ch||q.line>oe.line){var ie=q;q=oe,oe=ie}return b?oe.ch+=1:q.ch+=1,{start:q,end:oe}}function ia(u,m,v,b){var x=Ge(m),k=u.getLine(x.line).split(""),R,O,L,z,q=k.indexOf(v);if(x.ch<q)x.ch=q;else if(q<x.ch&&k[x.ch]==v){var oe=/string/.test(u.getTokenTypeAt(_t(m,0,1))),ie=/string/.test(u.getTokenTypeAt(m));oe&&!ie||(O=x.ch,--x.ch)}if(k[x.ch]==v&&!O)R=x.ch+1;else for(L=x.ch;L>-1&&!R;L--)k[L]==v&&(R=L+1);if(R&&!O)for(L=R,z=k.length;L<z&&!O;L++)k[L]==v&&(O=L);return!R||!O?{start:x,end:x}:(b&&(--R,++O),{start:new n(x.line,R),end:new n(x.line,O)})}we("pcre",!0,"boolean");class wf{constructor(){this.highlightTimeout}getQuery(){return Q.query}setQuery(m){Q.query=m}getOverlay(){return this.searchOverlay}setOverlay(m){this.searchOverlay=m}isReversed(){return Q.isReversed}setReversed(m){Q.isReversed=m}getScrollbarAnnotate(){return this.annotate}setScrollbarAnnotate(m){this.annotate=m}}function Kn(u){var m=u.state.vim;return m.searchState_||(m.searchState_=new wf)}function mc(u){return Wa(u,"/")}function _f(u){return Ua(u,"/")}function Wa(u,m){var v=Ua(u,m)||[];if(!v.length)return[];var b=[];if(v[0]===0){for(var x=0;x<v.length;x++)typeof v[x]=="number"&&b.push(u.substring(v[x]+1,v[x+1]));return b}}function Ua(u,m){m||(m="/");for(var v=!1,b=[],x=0;x<u.length;x++){var k=u.charAt(x);!v&&k==m&&b.push(x),v=!v&&k=="\\"}return b}function Vr(u){var m={V:"|(){+?*.[$^",M:"|(){+?*.[",m:"|(){+?",v:"<>"},v={">":"(?<=[\\w])(?=[^\\w]|$)","<":"(?<=[^\\w]|^)(?=[\\w])"},b=m.m,x=u.replace(/\\.|[\[|(){+*?.$^<>]/g,function(R){if(R[0]==="\\"){var O=R[1];return O==="}"||b.indexOf(O)!=-1?O:O in m?(b=m[O],""):O in v?v[O]:R}else return b.indexOf(R)==-1?R:v[R]||"\\"+R}),k=x.indexOf("\\zs");return k!=-1&&(x="(?<="+x.slice(0,k)+")"+x.slice(k+3)),k=x.indexOf("\\ze"),k!=-1&&(x=x.slice(0,k)+"(?="+x.slice(k+3)+")"),x}var Hn={"\\n":`
107
- `,"\\r":"\r","\\t":" "};function gc(u){for(var m=!1,v=[],b=-1;b<u.length;b++){var x=u.charAt(b)||"",k=u.charAt(b+1)||"";Hn[x+k]?(v.push(Hn[x+k]),b++):m?(v.push(x),m=!1):x==="\\"?(m=!0,pe(k)||k==="$"?v.push("$"):k!=="/"&&k!=="\\"&&v.push("\\")):(x==="$"&&v.push("$"),v.push(x),k==="/"&&v.push("\\"))}return v.join("")}var yc={"\\/":"/","\\\\":"\\","\\n":`
108
- `,"\\r":"\r","\\t":" ","\\&":"&"};function Fs(u){for(var m=new e.StringStream(u),v=[];!m.eol();){for(;m.peek()&&m.peek()!="\\";)v.push(m.next());var b=!1;for(var x in yc)if(m.match(x,!0)){b=!0,v.push(yc[x]);break}b||v.push(m.next())}return v.join("")}function Bs(u,m,v){Q.registerController.getRegister("/").setText(u);var b=_f(u),x,k;return b.length?(x=u.substring(0,b[0]),k=u.substring(b[0]).indexOf("i")!=-1):x=u,x?(be("pcre")||(x=Vr(x)),v&&(m=/^[^A-Z]*$/.test(x)),new RegExp(x,m||k?"im":"m")):null}function Nn(u){typeof u=="string"&&(u=document.createElement(u));for(var m=1;m<arguments.length;m++){var v=arguments[m];if(v)if(typeof v!="object"&&(v=document.createTextNode(v)),v.nodeType)u.appendChild(v);else for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(b[0]==="$"?u.style[b.slice(1)]=v[b]:typeof v[b]=="function"?u[b]=v[b]:u.setAttribute(b,v[b]))}return u}function ct(u,m,v){var b=Nn("div",{$color:"red",$whiteSpace:"pre",class:"cm-vim-message"},m);u.openNotification?v?(b=Nn("div",{},b,Nn("div",{},"Press ENTER or type command to continue")),u.state.closeVimNotification&&u.state.closeVimNotification(),u.state.closeVimNotification=u.openNotification(b,{bottom:!0,duration:0})):u.openNotification(b,{bottom:!0,duration:15e3}):alert(b.innerText)}function lr(u,m){return Nn("div",{$display:"flex",$flex:1},Nn("span",{$fontFamily:"monospace",$whiteSpace:"pre",$flex:1,$display:"flex"},u,Nn("input",{type:"text",autocorrect:"off",autocapitalize:"off",spellcheck:"false",$flex:1})),m&&Nn("span",{$color:"#888"},m))}function aa(u,m){var x;if(je.length){m.value||(m.value=""),Ae=m;return}var v=lr(m.prefix,m.desc);if(u.openDialog)u.openDialog(v,m.onClose,{onKeyDown:m.onKeyDown,onKeyUp:m.onKeyUp,bottom:!0,selectValueOnOpen:!1,value:m.value});else{var b="";typeof m.prefix!="string"&&m.prefix&&(b+=m.prefix.textContent),m.desc&&(b+=" "+m.desc),(x=m.onClose)==null||x.call(m,prompt(b,""))}}function vc(u,m){return u instanceof RegExp&&m instanceof RegExp?u.flags==m.flags&&u.source==m.source:!1}function _i(u,m,v,b){if(m){var x=Kn(u),k=Bs(m,!!v,!!b);if(k)return Bo(u,k),vc(k,x.getQuery())||x.setQuery(k),k}}function oa(u){if(u.source.charAt(0)=="^")var m=!0;return{token:function(v){if(m&&!v.sol()){v.skipToEnd();return}var b=v.match(u,!1);if(b)return b[0].length==0?(v.next(),"searching"):!v.sol()&&(v.backUp(1),!u.exec(v.next()+b[0]))?(v.next(),null):(v.match(u),"searching");for(;!v.eol()&&(v.next(),!v.match(u,!1)););},query:u}}var sa=0;function Bo(u,m){clearTimeout(sa);var v=Kn(u);v.highlightTimeout=sa,sa=setTimeout(function(){if(u.state.vim){var b=Kn(u);b.highlightTimeout=void 0;var x=b.getOverlay();(!x||m!=x.query)&&(x&&u.removeOverlay(x),x=oa(m),u.addOverlay(x),u.showMatchesOnScrollbar&&(b.getScrollbarAnnotate()&&b.getScrollbarAnnotate().clear(),b.setScrollbarAnnotate(u.showMatchesOnScrollbar(m))),b.setOverlay(x))}},50)}function xi(u,m,v,b){return u.operation(function(){b===void 0&&(b=1);for(var x=u.getCursor(),k=u.getSearchCursor(v,x),R=0;R<b;R++){var O=k.find(m);if(R==0&&O&&gt(k.from(),x)){var L=m?k.from():k.to();O=k.find(m),O&&!O[0]&&gt(k.from(),L)&&u.getLine(L.line).length==L.ch&&(O=k.find(m))}if(!O&&(k=u.getSearchCursor(v,m?new n(u.lastLine()):new n(u.firstLine(),0)),!k.find(m)))return}return k.from()})}function xf(u,m,v,b,x){return u.operation(function(){b===void 0&&(b=1);var k=u.getCursor(),R=u.getSearchCursor(v,k),O=R.find(!m);!x.visualMode&&O&&gt(R.from(),k)&&R.find(!m);for(var L=0;L<b;L++)if(O=R.find(m),!O&&(R=u.getSearchCursor(v,m?new n(u.lastLine()):new n(u.firstLine(),0)),!R.find(m)))return;var z=R.from(),q=R.to();return z&&q&&[z,q]})}function ki(u){var m=Kn(u);m.highlightTimeout&&(m.highlightTimeout=(clearTimeout(m.highlightTimeout),void 0)),u.removeOverlay(Kn(u).getOverlay()),m.setOverlay(null),m.getScrollbarAnnotate()&&(m.getScrollbarAnnotate().clear(),m.setScrollbarAnnotate(null))}function bc(u,m,v){return typeof u!="number"&&(u=u.line),m instanceof Array?de(u,m):typeof v=="number"?u>=m&&u<=v:u==m}function Ka(u){var m=u.getScrollInfo(),v=6,b=10,x=u.coordsChar({left:0,top:v+m.top},"local"),k=m.clientHeight-b+m.top,R=u.coordsChar({left:0,top:k},"local");return{top:x.line,bottom:R.line}}function Ho(u,m,v){if(v=="'"||v=="`")return Q.jumpList.find(u,-1)||new n(0,0);if(v==".")return wc(u);var b=m.marks[v];return b&&b.find()}function wc(u){if(u.getLastEditEnd)return u.getLastEditEnd();for(var m=u.doc.history.done,v=m.length;v--;)if(m[v].changes)return Ge(m[v].changes[0].to)}class Vo{constructor(){this.commandMap_,this.buildCommandMap_()}processCommand(m,v,b){var x=this;m.operation(function(){m.curOp&&(m.curOp.isVimOp=!0),x._processCommand(m,v,b)})}_processCommand(m,v,b){var x=m.state.vim,k=Q.registerController.getRegister(":"),R=k.toString(),O=new e.StringStream(v);k.setText(v);var L=b||{};L.input=v;try{this.parseInput_(m,O,L)}catch(oe){throw ct(m,oe+""),oe}x.visualMode&&Ye(m);var z,q;if(!L.commandName)L.line!==void 0&&(q="move");else if(z=this.matchCommand_(L.commandName),z){if(q=z.name,z.excludeFromCommandHistory&&k.setText(R),this.parseCommandArgs_(O,L,z),z.type=="exToKey"){mt(m,z.toKeys||"",z);return}else if(z.type=="exToEx"){this.processCommand(m,z.toInput||"");return}}if(!q){ct(m,'Not an editor command ":'+v+'"');return}try{xr[q](m,L),(!z||!z.possiblyAsync)&&L.callback&&L.callback()}catch(oe){throw ct(m,oe+""),oe}}parseInput_(m,v,b){var k,R;v.eatWhile(":"),v.eat("%")?(b.line=m.firstLine(),b.lineEnd=m.lastLine()):(b.line=this.parseLineSpec_(m,v),b.line!==void 0&&v.eat(",")&&(b.lineEnd=this.parseLineSpec_(m,v))),b.line==null?m.state.vim.visualMode?(b.selectionLine=(k=Ho(m,m.state.vim,"<"))==null?void 0:k.line,b.selectionLineEnd=(R=Ho(m,m.state.vim,">"))==null?void 0:R.line):b.selectionLine=m.getCursor().line:(b.selectionLine=b.line,b.selectionLineEnd=b.lineEnd);var x=v.match(/^(\w+|!!|@@|[!#&*<=>@~])/);return x?b.commandName=x[1]:b.commandName=(v.match(/.*/)||[""])[0],b}parseLineSpec_(m,v){var b=v.match(/^(\d+)/);if(b)return parseInt(b[1],10)-1;switch(v.next()){case".":return this.parseLineSpecOffset_(v,m.getCursor().line);case"$":return this.parseLineSpecOffset_(v,m.lastLine());case"'":var x=v.next()||"",k=Ho(m,m.state.vim,x);if(!k)throw Error("Mark not set");return this.parseLineSpecOffset_(v,k.line);case"-":case"+":return v.backUp(1),this.parseLineSpecOffset_(v,m.getCursor().line);default:v.backUp(1);return}}parseLineSpecOffset_(m,v){var b=m.match(/^([+-])?(\d+)/);if(b){var x=parseInt(b[2],10);b[1]=="-"?v-=x:v+=x}return v}parseCommandArgs_(m,v,b){var R;if(!m.eol()){v.argString=(R=m.match(/.*/))==null?void 0:R[0];var x=b.argDelimiter||/\s+/,k=ir(v.argString||"").split(x);k.length&&k[0]&&(v.args=k)}}matchCommand_(m){for(var v=m.length;v>0;v--){var b=m.substring(0,v);if(this.commandMap_[b]){var x=this.commandMap_[b];if(x.name.indexOf(m)===0)return x}}}buildCommandMap_(){this.commandMap_={};for(var m=0;m<d.length;m++){var v=d[m],b=v.shortName||v.name;this.commandMap_[b]=v}}map(m,v,b,x){if(m!=":"&&m.charAt(0)==":"){if(b)throw Error("Mode not supported for ex mappings");var k=m.substring(1);v!=":"&&v.charAt(0)==":"?this.commandMap_[k]={name:k,type:"exToEx",toInput:v.substring(1),user:!0}:this.commandMap_[k]={name:k,type:"exToKey",toKeys:v,user:!0}}else{var R={keys:m,type:"keyToKey",toKeys:v,noremap:!!x};b&&(R.context=b),oi(R)}}unmap(m,v){if(m!=":"&&m.charAt(0)==":"){if(v)throw Error("Mode not supported for ex mappings");var b=m.substring(1);if(this.commandMap_[b]&&this.commandMap_[b].user)return delete this.commandMap_[b],!0}else for(var x=m,k=0;k<o.length;k++)if(x==o[k].keys&&o[k].context===v)return o.splice(k,1),Vs(x),!0}}var xr={colorscheme:function(u,m){if(!m.args||m.args.length<1){ct(u,u.getOption("theme"));return}u.setOption("theme",m.args[0])},map:function(u,m,v,b){var x=m.args;if(!x||x.length<2){u&&ct(u,"Invalid mapping: "+m.input);return}_n.map(x[0],x[1],v,b)},imap:function(u,m){this.map(u,m,"insert")},nmap:function(u,m){this.map(u,m,"normal")},vmap:function(u,m){this.map(u,m,"visual")},omap:function(u,m){this.map(u,m,"operatorPending")},noremap:function(u,m){this.map(u,m,void 0,!0)},inoremap:function(u,m){this.map(u,m,"insert",!0)},nnoremap:function(u,m){this.map(u,m,"normal",!0)},vnoremap:function(u,m){this.map(u,m,"visual",!0)},onoremap:function(u,m){this.map(u,m,"operatorPending",!0)},unmap:function(u,m,v){var b=m.args;(!b||b.length<1||!_n.unmap(b[0],v))&&u&&ct(u,"No such mapping: "+m.input)},mapclear:function(u,m){Be.mapclear()},imapclear:function(u,m){Be.mapclear("insert")},nmapclear:function(u,m){Be.mapclear("normal")},vmapclear:function(u,m){Be.mapclear("visual")},omapclear:function(u,m){Be.mapclear("operatorPending")},move:function(u,m){Pn.processCommand(u,u.state.vim,{keys:"",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:m.line+1})},set:function(u,m){var v=m.args,b=m.setCfg||{};if(!v||v.length<1){u&&ct(u,"Invalid mapping: "+m.input);return}var x=v[0].split("="),k=x.shift()||"",R=x.length>0?x.join("="):void 0,O=!1,L=!1;if(k.charAt(k.length-1)=="?"){if(R)throw Error("Trailing characters: "+m.argString);k=k.substring(0,k.length-1),O=!0}else k.charAt(k.length-1)=="!"&&(k=k.substring(0,k.length-1),L=!0);R===void 0&&k.substring(0,2)=="no"&&(k=k.substring(2),R=!1);var z=fe[k]&&fe[k].type=="boolean";if(z&&(L?R=!be(k,u,b):R??(R=!0)),!z&&R===void 0||O){var q=be(k,u,b);q instanceof Error?ct(u,q.message):q===!0||q===!1?ct(u," "+(q?"":"no")+k):ct(u," "+k+"="+q)}else{var oe=J(k,R,u,b);oe instanceof Error&&ct(u,oe.message)}},setlocal:function(u,m){m.setCfg={scope:"local"},this.set(u,m)},setglobal:function(u,m){m.setCfg={scope:"global"},this.set(u,m)},registers:function(u,m){var v=m.args,b=Q.registerController.registers,x=`----------Registers----------
106
+ `);x.pop();for(var k=x.pop();x.length>0&&k&&A(k);k=x.pop())v.line--,v.ch=0;k?(v.line--,v.ch=St(u,v.line)):v.ch=0}}function te(u,m,v){m.ch=0,v.ch=0,v.line++}function ve(u){if(!u)return 0;var m=u.search(/\S/);return m==-1?u.length:m}function Te(u,{inclusive:m,innerWord:v,bigWord:b,noSymbol:x,multiline:k},R){var O=R||M(u),L=u.getLine(O.line),z=L,q=O.line,oe=q,ie=O.ch,X,Y=x?C[0]:E[0];if(v&&/\s/.test(L.charAt(ie)))Y=function(dt){return/\s/.test(dt)};else{for(;!Y(L.charAt(ie));)if(ie++,ie>=L.length){if(!k)return null;ie--,X=rt(u,O,!0,b,!0);break}b?Y=E[0]:(Y=C[0],Y(L.charAt(ie))||(Y=C[1]))}for(var xe=ie,_e=ie;Y(L.charAt(_e))&&_e>=0;)_e--;if(_e++,X)xe=X.to,oe=X.line,z=u.getLine(oe),!z&&xe==0&&xe++;else for(;Y(L.charAt(xe))&&xe<L.length;)xe++;if(m){var qe=xe,Re=O.ch<=_e&&/\s/.test(L.charAt(O.ch));if(!Re)for(;/\s/.test(z.charAt(xe))&&xe<z.length;)xe++;if(qe==xe||Re){for(var Ne=_e;/\s/.test(L.charAt(_e-1))&&_e>0;)_e--;!_e&&!Re&&(_e=Ne)}}return{start:new n(q,_e),end:new n(oe,xe)}}function He(u,m,v){var b=m;if(!e.findMatchingTag||!e.findEnclosingTag)return{start:b,end:b};var x=e.findMatchingTag(u,m)||e.findEnclosingTag(u,m);return!x||!x.open||!x.close?{start:b,end:b}:v?{start:x.open.from,end:x.close.to}:{start:x.open.to,end:x.close.from}}function Ve(u,m,v){gt(m,v)||Q.jumpList.add(u,m,v)}function ot(u,m){Q.lastCharacterSearch.increment=u,Q.lastCharacterSearch.forward=m.forward,Q.lastCharacterSearch.selectedCharacter=m.selectedCharacter}var Mt={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},Ze={bracket:{isComplete:function(u){if(u.nextCh===u.symb){if(u.depth++,u.depth>=1)return!0}else u.nextCh===u.reverseSymb&&u.depth--;return!1}},section:{init:function(u){u.curMoveThrough=!0,u.symb=(u.forward?"]":"[")===u.symb?"{":"}"},isComplete:function(u){return u.index===0&&u.nextCh===u.symb}},comment:{isComplete:function(u){var m=u.lastCh==="*"&&u.nextCh==="/";return u.lastCh=u.nextCh,m}},method:{init:function(u){u.symb=u.symb==="m"?"{":"}",u.reverseSymb=u.symb==="{"?"}":"{"},isComplete:function(u){return u.nextCh===u.symb}},preprocess:{init:function(u){u.index=0},isComplete:function(u){var v;if(u.nextCh==="#"){var m=(v=u.lineText.match(/^#(\w+)/))==null?void 0:v[1];if(m==="endif"){if(u.forward&&u.depth===0)return!0;u.depth++}else if(m==="if"){if(!u.forward&&u.depth===0)return!0;u.depth--}if(m==="else"&&u.depth===0)return!0}return!1}}};function Lt(u,m,v,b){var x=Ge(u.getCursor()),k=v?1:-1,R=v?u.lineCount():-1,O=x.ch,L=x.line,z=u.getLine(L),q={lineText:z,nextCh:z.charAt(O),lastCh:null,index:O,symb:b,reverseSymb:(v?{")":"(","}":"{"}:{"(":")","{":"}"})[b],forward:v,depth:0,curMoveThrough:!1},oe=Mt[b];if(!oe)return x;var ie=Ze[oe].init,X=Ze[oe].isComplete;for(ie&&ie(q);L!==R&&m;){if(q.index+=k,q.nextCh=q.lineText.charAt(q.index),!q.nextCh){if(L+=k,q.lineText=u.getLine(L)||"",k>0)q.index=0;else{var Y=q.lineText.length;q.index=Y>0?Y-1:0}q.nextCh=q.lineText.charAt(q.index)}X(q)&&(x.line=L,x.ch=q.index,m--)}return q.nextCh||q.curMoveThrough?new n(L,q.index):x}function rt(u,m,v,b,x){var k=m.line,R=m.ch,O=u.getLine(k),L=v?1:-1,z=b?E:C;if(x&&O==""){if(k+=L,O=u.getLine(k),!F(u,k))return null;R=v?0:O.length}for(;;){if(x&&O=="")return{from:0,to:0,line:k};for(var q=L>0?O.length:-1,oe=q,ie=q;R!=q;){for(var X=!1,Y=0;Y<z.length&&!X;++Y)if(z[Y](O.charAt(R))){for(oe=R;R!=q&&z[Y](O.charAt(R));)R+=L;if(ie=R,X=oe!=ie,oe==m.ch&&k==m.line&&ie==oe+L)continue;return{from:Math.min(oe,ie+1),to:Math.max(oe,ie),line:k}}X||(R+=L)}if(k+=L,!F(u,k))return null;O=u.getLine(k),R=L>0?0:O.length}}function ut(u,m,v,b,x,k){var R=Ge(m),O=[];(b&&!x||!b&&x)&&v++;for(var L=!(b&&x),z=0;z<v;z++){var q=rt(u,m,b,k,L);if(!q){var oe=St(u,u.lastLine());O.push(b?{line:u.lastLine(),from:oe,to:oe}:{line:0,from:0,to:0});break}O.push(q),m=new n(q.line,b?q.to-1:q.from)}var ie=O.length!=v,X=O[0],Y=O.pop();return b&&!x?(!ie&&(X.from!=R.ch||X.line!=R.line)&&(Y=O.pop()),Y&&new n(Y.line,Y.from)):b&&x?Y&&new n(Y.line,Y.to-1):!b&&x?(!ie&&(X.to!=R.ch||X.line!=R.line)&&(Y=O.pop()),Y&&new n(Y.line,Y.to)):Y&&new n(Y.line,Y.from)}function wn(u,m,v,b,x){var k=new n(m.line+v.repeat-1,1/0),R=u.clipPos(k);return R.ch--,x||(b.lastHPos=1/0,b.lastHSPos=u.charCoords(R,"div").left),k}function sr(u,m,v,b,x){if(b){for(var k=x||u.getCursor(),R=k.ch,O,L=0;L<m;L++){var z=u.getLine(k.line);if(O=ra(R,z,b,v),O==-1)return;R=O}if(O!=null)return new n(u.getCursor().line,O)}}function ii(u,m){var v=u.getCursor().line;return zt(u,new n(v,m-1))}function Bn(u,m,v,b){!de(v,T)&&!$.test(v)||(m.marks[v]&&m.marks[v].clear(),m.marks[v]=u.setBookmark(b))}function ra(u,m,v,b,x){return b?m.indexOf(v,u+1):m.lastIndexOf(v,u-1)}function Xt(u,m,v,b,x){var k=m.line,R=u.firstLine(),O=u.lastLine(),L,z,q=k;function oe(_e){return!u.getLine(_e)}function ie(_e,qe,Re){return Re?oe(_e)!=oe(_e+qe):!oe(_e)&&oe(_e+qe)}if(b){for(;R<=q&&q<=O&&v>0;)ie(q,b)&&v--,q+=b;return{start:new n(q,0),end:m}}var X=u.state.vim;if(X.visualLine&&ie(k,1,!0)){var Y=X.sel.anchor;ie(Y.line,-1,!0)&&(!x||Y.line!=k)&&(k+=1)}var xe=oe(k);for(q=k;q<=O&&v;q++)ie(q,1,!0)&&(!x||oe(q)!=xe)&&v--;for(z=new n(q,0),q>O&&!xe?xe=!0:x=!1,q=k;q>R&&!((!x||oe(q)==xe||q==k)&&ie(q,-1,!0));q--);return L=new n(q,0),{start:L,end:z}}function zs(u,m,v,b,x){function k(z){z.line!==null&&(z.pos+z.dir<0||z.pos+z.dir>=z.line.length?z.line=null:z.pos+=z.dir)}function R(z,q,oe,ie){var X={line:z.getLine(q),ln:q,pos:oe,dir:ie};if(X.line==="")return{ln:X.ln,pos:X.pos};var Y=X.pos;for(k(X);X.line!==null;){if(Y=X.pos,W(X.line[X.pos]))if(x){for(k(X);X.line!==null&&A(X.line[X.pos]);)Y=X.pos,k(X);return{ln:X.ln,pos:Y+1}}else return{ln:X.ln,pos:X.pos+1};k(X)}return{ln:X.ln,pos:Y+1}}function O(z,q,oe,ie){var X=z.getLine(q),Y={line:X,ln:q,pos:oe,dir:ie};if(Y.line==="")return{ln:Y.ln,pos:Y.pos};var xe=Y.pos;for(k(Y);Y.line!==null;){if(!A(Y.line[Y.pos])&&!W(Y.line[Y.pos]))xe=Y.pos;else if(W(Y.line[Y.pos]))return x&&A(Y.line[Y.pos+1])?{ln:Y.ln,pos:Y.pos+1}:{ln:Y.ln,pos:xe};k(Y)}return Y.line=X,x&&A(Y.line[Y.pos])?{ln:Y.ln,pos:Y.pos}:{ln:Y.ln,pos:xe}}for(var L={ln:m.line,pos:m.ch};v>0;)L=b<0?O(u,L.ln,L.pos,b):R(u,L.ln,L.pos,b),v--;return new n(L.ln,L.pos)}function pc(u,m,v,b){function x(L,z){if(z.line!==null)if(z.pos+z.dir<0||z.pos+z.dir>=z.line.length){if(z.ln+=z.dir,!F(L,z.ln)){z.line=null;return}z.line=L.getLine(z.ln),z.pos=z.dir>0?0:z.line.length-1}else z.pos+=z.dir}function k(L,z,q,oe){var _e=L.getLine(z),ie=_e==="",X={line:_e,ln:z,pos:q,dir:oe},Y={ln:X.ln,pos:X.pos},xe=X.line==="";for(x(L,X);X.line!==null;){if(Y.ln=X.ln,Y.pos=X.pos,X.line===""&&!xe||ie&&X.line!==""&&!A(X.line[X.pos]))return{ln:X.ln,pos:X.pos};W(X.line[X.pos])&&!ie&&(X.pos===X.line.length-1||A(X.line[X.pos+1]))&&(ie=!0),x(L,X)}var _e=L.getLine(Y.ln);Y.pos=0;for(var qe=_e.length-1;qe>=0;--qe)if(!A(_e[qe])){Y.pos=qe;break}return Y}function R(L,z,q,oe){var _e=L.getLine(z),ie={line:_e,ln:z,pos:q,dir:oe},X=ie.ln,Y=null,xe=ie.line==="";for(x(L,ie);ie.line!==null;){if(ie.line===""&&!xe)return Y===null?{ln:ie.ln,pos:ie.pos}:{ln:X,pos:Y};if(W(ie.line[ie.pos])&&Y!==null&&!(ie.ln===X&&ie.pos+1===Y))return{ln:X,pos:Y};ie.line!==""&&!A(ie.line[ie.pos])&&(xe=!1,X=ie.ln,Y=ie.pos),x(L,ie)}var _e=L.getLine(X);Y=0;for(var qe=0;qe<_e.length;++qe)if(!A(_e[qe])){Y=qe;break}return{ln:X,pos:Y}}for(var O={ln:m.line,pos:m.ch};v>0;)O=b<0?R(u,O.ln,O.pos,b):k(u,O.ln,O.pos,b),v--;return new n(O.ln,O.pos)}function ai(u,m,v,b){var x=m,k={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[v],R={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[v],O=u.getLine(x.line).charAt(x.ch)===R?1:0,L=u.scanForBracket(new n(x.line,x.ch+O),-1,void 0,{bracketRegex:k}),z=u.scanForBracket(new n(x.line,x.ch+O),1,void 0,{bracketRegex:k});if(!L||!z)return null;var q=L.pos,oe=z.pos;if(q.line==oe.line&&q.ch>oe.ch||q.line>oe.line){var ie=q;q=oe,oe=ie}return b?oe.ch+=1:q.ch+=1,{start:q,end:oe}}function ia(u,m,v,b){var x=Ge(m),k=u.getLine(x.line).split(""),R,O,L,z,q=k.indexOf(v);if(x.ch<q)x.ch=q;else if(q<x.ch&&k[x.ch]==v){var oe=/string/.test(u.getTokenTypeAt(_t(m,0,1))),ie=/string/.test(u.getTokenTypeAt(m));oe&&!ie||(O=x.ch,--x.ch)}if(k[x.ch]==v&&!O)R=x.ch+1;else for(L=x.ch;L>-1&&!R;L--)k[L]==v&&(R=L+1);if(R&&!O)for(L=R,z=k.length;L<z&&!O;L++)k[L]==v&&(O=L);return!R||!O?{start:x,end:x}:(b&&(--R,++O),{start:new n(x.line,R),end:new n(x.line,O)})}we("pcre",!0,"boolean");class wf{constructor(){this.highlightTimeout}getQuery(){return Q.query}setQuery(m){Q.query=m}getOverlay(){return this.searchOverlay}setOverlay(m){this.searchOverlay=m}isReversed(){return Q.isReversed}setReversed(m){Q.isReversed=m}getScrollbarAnnotate(){return this.annotate}setScrollbarAnnotate(m){this.annotate=m}}function Kn(u){var m=u.state.vim;return m.searchState_||(m.searchState_=new wf)}function hc(u){return Wa(u,"/")}function _f(u){return Ua(u,"/")}function Wa(u,m){var v=Ua(u,m)||[];if(!v.length)return[];var b=[];if(v[0]===0){for(var x=0;x<v.length;x++)typeof v[x]=="number"&&b.push(u.substring(v[x]+1,v[x+1]));return b}}function Ua(u,m){m||(m="/");for(var v=!1,b=[],x=0;x<u.length;x++){var k=u.charAt(x);!v&&k==m&&b.push(x),v=!v&&k=="\\"}return b}function Vr(u){var m={V:"|(){+?*.[$^",M:"|(){+?*.[",m:"|(){+?",v:"<>"},v={">":"(?<=[\\w])(?=[^\\w]|$)","<":"(?<=[^\\w]|^)(?=[\\w])"},b=m.m,x=u.replace(/\\.|[\[|(){+*?.$^<>]/g,function(R){if(R[0]==="\\"){var O=R[1];return O==="}"||b.indexOf(O)!=-1?O:O in m?(b=m[O],""):O in v?v[O]:R}else return b.indexOf(R)==-1?R:v[R]||"\\"+R}),k=x.indexOf("\\zs");return k!=-1&&(x="(?<="+x.slice(0,k)+")"+x.slice(k+3)),k=x.indexOf("\\ze"),k!=-1&&(x=x.slice(0,k)+"(?="+x.slice(k+3)+")"),x}var Hn={"\\n":`
107
+ `,"\\r":"\r","\\t":" "};function mc(u){for(var m=!1,v=[],b=-1;b<u.length;b++){var x=u.charAt(b)||"",k=u.charAt(b+1)||"";Hn[x+k]?(v.push(Hn[x+k]),b++):m?(v.push(x),m=!1):x==="\\"?(m=!0,pe(k)||k==="$"?v.push("$"):k!=="/"&&k!=="\\"&&v.push("\\")):(x==="$"&&v.push("$"),v.push(x),k==="/"&&v.push("\\"))}return v.join("")}var gc={"\\/":"/","\\\\":"\\","\\n":`
108
+ `,"\\r":"\r","\\t":" ","\\&":"&"};function Fs(u){for(var m=new e.StringStream(u),v=[];!m.eol();){for(;m.peek()&&m.peek()!="\\";)v.push(m.next());var b=!1;for(var x in gc)if(m.match(x,!0)){b=!0,v.push(gc[x]);break}b||v.push(m.next())}return v.join("")}function Bs(u,m,v){Q.registerController.getRegister("/").setText(u);var b=_f(u),x,k;return b.length?(x=u.substring(0,b[0]),k=u.substring(b[0]).indexOf("i")!=-1):x=u,x?(be("pcre")||(x=Vr(x)),v&&(m=/^[^A-Z]*$/.test(x)),new RegExp(x,m||k?"im":"m")):null}function Nn(u){typeof u=="string"&&(u=document.createElement(u));for(var m=1;m<arguments.length;m++){var v=arguments[m];if(v)if(typeof v!="object"&&(v=document.createTextNode(v)),v.nodeType)u.appendChild(v);else for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(b[0]==="$"?u.style[b.slice(1)]=v[b]:typeof v[b]=="function"?u[b]=v[b]:u.setAttribute(b,v[b]))}return u}function ct(u,m,v){var b=Nn("div",{$color:"red",$whiteSpace:"pre",class:"cm-vim-message"},m);u.openNotification?v?(b=Nn("div",{},b,Nn("div",{},"Press ENTER or type command to continue")),u.state.closeVimNotification&&u.state.closeVimNotification(),u.state.closeVimNotification=u.openNotification(b,{bottom:!0,duration:0})):u.openNotification(b,{bottom:!0,duration:15e3}):alert(b.innerText)}function lr(u,m){return Nn("div",{$display:"flex",$flex:1},Nn("span",{$fontFamily:"monospace",$whiteSpace:"pre",$flex:1,$display:"flex"},u,Nn("input",{type:"text",autocorrect:"off",autocapitalize:"off",spellcheck:"false",$flex:1})),m&&Nn("span",{$color:"#888"},m))}function aa(u,m){var x;if(je.length){m.value||(m.value=""),Ae=m;return}var v=lr(m.prefix,m.desc);if(u.openDialog)u.openDialog(v,m.onClose,{onKeyDown:m.onKeyDown,onKeyUp:m.onKeyUp,bottom:!0,selectValueOnOpen:!1,value:m.value});else{var b="";typeof m.prefix!="string"&&m.prefix&&(b+=m.prefix.textContent),m.desc&&(b+=" "+m.desc),(x=m.onClose)==null||x.call(m,prompt(b,""))}}function yc(u,m){return u instanceof RegExp&&m instanceof RegExp?u.flags==m.flags&&u.source==m.source:!1}function _i(u,m,v,b){if(m){var x=Kn(u),k=Bs(m,!!v,!!b);if(k)return Bo(u,k),yc(k,x.getQuery())||x.setQuery(k),k}}function oa(u){if(u.source.charAt(0)=="^")var m=!0;return{token:function(v){if(m&&!v.sol()){v.skipToEnd();return}var b=v.match(u,!1);if(b)return b[0].length==0?(v.next(),"searching"):!v.sol()&&(v.backUp(1),!u.exec(v.next()+b[0]))?(v.next(),null):(v.match(u),"searching");for(;!v.eol()&&(v.next(),!v.match(u,!1)););},query:u}}var sa=0;function Bo(u,m){clearTimeout(sa);var v=Kn(u);v.highlightTimeout=sa,sa=setTimeout(function(){if(u.state.vim){var b=Kn(u);b.highlightTimeout=void 0;var x=b.getOverlay();(!x||m!=x.query)&&(x&&u.removeOverlay(x),x=oa(m),u.addOverlay(x),u.showMatchesOnScrollbar&&(b.getScrollbarAnnotate()&&b.getScrollbarAnnotate().clear(),b.setScrollbarAnnotate(u.showMatchesOnScrollbar(m))),b.setOverlay(x))}},50)}function xi(u,m,v,b){return u.operation(function(){b===void 0&&(b=1);for(var x=u.getCursor(),k=u.getSearchCursor(v,x),R=0;R<b;R++){var O=k.find(m);if(R==0&&O&&gt(k.from(),x)){var L=m?k.from():k.to();O=k.find(m),O&&!O[0]&&gt(k.from(),L)&&u.getLine(L.line).length==L.ch&&(O=k.find(m))}if(!O&&(k=u.getSearchCursor(v,m?new n(u.lastLine()):new n(u.firstLine(),0)),!k.find(m)))return}return k.from()})}function xf(u,m,v,b,x){return u.operation(function(){b===void 0&&(b=1);var k=u.getCursor(),R=u.getSearchCursor(v,k),O=R.find(!m);!x.visualMode&&O&&gt(R.from(),k)&&R.find(!m);for(var L=0;L<b;L++)if(O=R.find(m),!O&&(R=u.getSearchCursor(v,m?new n(u.lastLine()):new n(u.firstLine(),0)),!R.find(m)))return;var z=R.from(),q=R.to();return z&&q&&[z,q]})}function ki(u){var m=Kn(u);m.highlightTimeout&&(m.highlightTimeout=(clearTimeout(m.highlightTimeout),void 0)),u.removeOverlay(Kn(u).getOverlay()),m.setOverlay(null),m.getScrollbarAnnotate()&&(m.getScrollbarAnnotate().clear(),m.setScrollbarAnnotate(null))}function vc(u,m,v){return typeof u!="number"&&(u=u.line),m instanceof Array?de(u,m):typeof v=="number"?u>=m&&u<=v:u==m}function Ka(u){var m=u.getScrollInfo(),v=6,b=10,x=u.coordsChar({left:0,top:v+m.top},"local"),k=m.clientHeight-b+m.top,R=u.coordsChar({left:0,top:k},"local");return{top:x.line,bottom:R.line}}function Ho(u,m,v){if(v=="'"||v=="`")return Q.jumpList.find(u,-1)||new n(0,0);if(v==".")return bc(u);var b=m.marks[v];return b&&b.find()}function bc(u){if(u.getLastEditEnd)return u.getLastEditEnd();for(var m=u.doc.history.done,v=m.length;v--;)if(m[v].changes)return Ge(m[v].changes[0].to)}class Vo{constructor(){this.commandMap_,this.buildCommandMap_()}processCommand(m,v,b){var x=this;m.operation(function(){m.curOp&&(m.curOp.isVimOp=!0),x._processCommand(m,v,b)})}_processCommand(m,v,b){var x=m.state.vim,k=Q.registerController.getRegister(":"),R=k.toString(),O=new e.StringStream(v);k.setText(v);var L=b||{};L.input=v;try{this.parseInput_(m,O,L)}catch(oe){throw ct(m,oe+""),oe}x.visualMode&&Ye(m);var z,q;if(!L.commandName)L.line!==void 0&&(q="move");else if(z=this.matchCommand_(L.commandName),z){if(q=z.name,z.excludeFromCommandHistory&&k.setText(R),this.parseCommandArgs_(O,L,z),z.type=="exToKey"){mt(m,z.toKeys||"",z);return}else if(z.type=="exToEx"){this.processCommand(m,z.toInput||"");return}}if(!q){ct(m,'Not an editor command ":'+v+'"');return}try{xr[q](m,L),(!z||!z.possiblyAsync)&&L.callback&&L.callback()}catch(oe){throw ct(m,oe+""),oe}}parseInput_(m,v,b){var k,R;v.eatWhile(":"),v.eat("%")?(b.line=m.firstLine(),b.lineEnd=m.lastLine()):(b.line=this.parseLineSpec_(m,v),b.line!==void 0&&v.eat(",")&&(b.lineEnd=this.parseLineSpec_(m,v))),b.line==null?m.state.vim.visualMode?(b.selectionLine=(k=Ho(m,m.state.vim,"<"))==null?void 0:k.line,b.selectionLineEnd=(R=Ho(m,m.state.vim,">"))==null?void 0:R.line):b.selectionLine=m.getCursor().line:(b.selectionLine=b.line,b.selectionLineEnd=b.lineEnd);var x=v.match(/^(\w+|!!|@@|[!#&*<=>@~])/);return x?b.commandName=x[1]:b.commandName=(v.match(/.*/)||[""])[0],b}parseLineSpec_(m,v){var b=v.match(/^(\d+)/);if(b)return parseInt(b[1],10)-1;switch(v.next()){case".":return this.parseLineSpecOffset_(v,m.getCursor().line);case"$":return this.parseLineSpecOffset_(v,m.lastLine());case"'":var x=v.next()||"",k=Ho(m,m.state.vim,x);if(!k)throw Error("Mark not set");return this.parseLineSpecOffset_(v,k.line);case"-":case"+":return v.backUp(1),this.parseLineSpecOffset_(v,m.getCursor().line);default:v.backUp(1);return}}parseLineSpecOffset_(m,v){var b=m.match(/^([+-])?(\d+)/);if(b){var x=parseInt(b[2],10);b[1]=="-"?v-=x:v+=x}return v}parseCommandArgs_(m,v,b){var R;if(!m.eol()){v.argString=(R=m.match(/.*/))==null?void 0:R[0];var x=b.argDelimiter||/\s+/,k=ir(v.argString||"").split(x);k.length&&k[0]&&(v.args=k)}}matchCommand_(m){for(var v=m.length;v>0;v--){var b=m.substring(0,v);if(this.commandMap_[b]){var x=this.commandMap_[b];if(x.name.indexOf(m)===0)return x}}}buildCommandMap_(){this.commandMap_={};for(var m=0;m<d.length;m++){var v=d[m],b=v.shortName||v.name;this.commandMap_[b]=v}}map(m,v,b,x){if(m!=":"&&m.charAt(0)==":"){if(b)throw Error("Mode not supported for ex mappings");var k=m.substring(1);v!=":"&&v.charAt(0)==":"?this.commandMap_[k]={name:k,type:"exToEx",toInput:v.substring(1),user:!0}:this.commandMap_[k]={name:k,type:"exToKey",toKeys:v,user:!0}}else{var R={keys:m,type:"keyToKey",toKeys:v,noremap:!!x};b&&(R.context=b),oi(R)}}unmap(m,v){if(m!=":"&&m.charAt(0)==":"){if(v)throw Error("Mode not supported for ex mappings");var b=m.substring(1);if(this.commandMap_[b]&&this.commandMap_[b].user)return delete this.commandMap_[b],!0}else for(var x=m,k=0;k<o.length;k++)if(x==o[k].keys&&o[k].context===v)return o.splice(k,1),Vs(x),!0}}var xr={colorscheme:function(u,m){if(!m.args||m.args.length<1){ct(u,u.getOption("theme"));return}u.setOption("theme",m.args[0])},map:function(u,m,v,b){var x=m.args;if(!x||x.length<2){u&&ct(u,"Invalid mapping: "+m.input);return}_n.map(x[0],x[1],v,b)},imap:function(u,m){this.map(u,m,"insert")},nmap:function(u,m){this.map(u,m,"normal")},vmap:function(u,m){this.map(u,m,"visual")},omap:function(u,m){this.map(u,m,"operatorPending")},noremap:function(u,m){this.map(u,m,void 0,!0)},inoremap:function(u,m){this.map(u,m,"insert",!0)},nnoremap:function(u,m){this.map(u,m,"normal",!0)},vnoremap:function(u,m){this.map(u,m,"visual",!0)},onoremap:function(u,m){this.map(u,m,"operatorPending",!0)},unmap:function(u,m,v){var b=m.args;(!b||b.length<1||!_n.unmap(b[0],v))&&u&&ct(u,"No such mapping: "+m.input)},mapclear:function(u,m){Be.mapclear()},imapclear:function(u,m){Be.mapclear("insert")},nmapclear:function(u,m){Be.mapclear("normal")},vmapclear:function(u,m){Be.mapclear("visual")},omapclear:function(u,m){Be.mapclear("operatorPending")},move:function(u,m){Pn.processCommand(u,u.state.vim,{keys:"",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:m.line+1})},set:function(u,m){var v=m.args,b=m.setCfg||{};if(!v||v.length<1){u&&ct(u,"Invalid mapping: "+m.input);return}var x=v[0].split("="),k=x.shift()||"",R=x.length>0?x.join("="):void 0,O=!1,L=!1;if(k.charAt(k.length-1)=="?"){if(R)throw Error("Trailing characters: "+m.argString);k=k.substring(0,k.length-1),O=!0}else k.charAt(k.length-1)=="!"&&(k=k.substring(0,k.length-1),L=!0);R===void 0&&k.substring(0,2)=="no"&&(k=k.substring(2),R=!1);var z=fe[k]&&fe[k].type=="boolean";if(z&&(L?R=!be(k,u,b):R??(R=!0)),!z&&R===void 0||O){var q=be(k,u,b);q instanceof Error?ct(u,q.message):q===!0||q===!1?ct(u," "+(q?"":"no")+k):ct(u," "+k+"="+q)}else{var oe=J(k,R,u,b);oe instanceof Error&&ct(u,oe.message)}},setlocal:function(u,m){m.setCfg={scope:"local"},this.set(u,m)},setglobal:function(u,m){m.setCfg={scope:"global"},this.set(u,m)},registers:function(u,m){var v=m.args,b=Q.registerController.registers,x=`----------Registers----------
109
109
 
110
110
  `;if(v)for(var k=v.join(""),R=0;R<k.length;R++){var O=k.charAt(R);if(Q.registerController.isValidRegister(O)){var L=b[O]||new nn;x+='"'+O+" "+L.toString()+`
111
111
  `}}else for(var O in b){var z=b[O].toString();z.length&&(x+='"'+O+" "+z+`
@@ -116,24 +116,24 @@ mark line col
116
116
  `)}else for(var O in b){var L=b[O]&&b[O].find();L&&(x+=O+" "+L.line+" "+L.ch+`
117
117
  `)}ct(u,x,!0)},sort:function(u,m){var v,b,x,k,R;function O(){if(m.argString){var Ue=new e.StringStream(m.argString);if(Ue.eat("!")&&(v=!0),Ue.eol())return;if(!Ue.eatSpace())return"Invalid arguments";var $e=Ue.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!$e||!Ue.eol())return"Invalid arguments";if($e[1]){b=$e[1].indexOf("i")!=-1,x=$e[1].indexOf("u")!=-1;var $t=$e[1].indexOf("d")!=-1||$e[1].indexOf("n")!=-1,rn=$e[1].indexOf("x")!=-1,pn=$e[1].indexOf("o")!=-1;if(Number($t)+Number(rn)+Number(pn)>1)return"Invalid arguments";k=$t&&"decimal"||rn&&"hex"||pn&&"octal"}$e[2]&&(R=new RegExp($e[2].substr(1,$e[2].length-2),b?"i":""))}}var L=O();if(L){ct(u,L+": "+m.argString);return}var z=m.line||u.firstLine(),q=m.lineEnd||m.line||u.lastLine();if(z==q)return;var oe=new n(z,0),ie=new n(q,St(u,q)),X=u.getRange(oe,ie).split(`
118
118
  `),Y=k=="decimal"?/(-?)([\d]+)/:k=="hex"?/(-?)(?:0x)?([0-9a-f]+)/i:k=="octal"?/([0-7]+)/:null,xe=k=="decimal"?10:k=="hex"?16:k=="octal"?8:void 0,_e=[],qe=[];if(k||R)for(var Re=0;Re<X.length;Re++){var Ne=R?X[Re].match(R):null;Ne&&Ne[0]!=""?_e.push(Ne):Y&&Y.exec(X[Re])?_e.push(X[Re]):qe.push(X[Re])}else qe=X;function dt(Ue,$e){if(v){var $t=Ue;Ue=$e,$e=$t}b&&(Ue=Ue.toLowerCase(),$e=$e.toLowerCase());var rn=Y&&Y.exec(Ue),pn=Y&&Y.exec($e);return!rn||!pn?Ue<$e?-1:1:parseInt((rn[1]+rn[2]).toLowerCase(),xe)-parseInt((pn[1]+pn[2]).toLowerCase(),xe)}function Je(Ue,$e){if(v){var $t=Ue;Ue=$e,$e=$t}return b&&(Ue[0]=Ue[0].toLowerCase(),$e[0]=$e[0].toLowerCase()),Ue[0]<$e[0]?-1:1}if(_e.sort(R?Je:dt),R)for(var Re=0;Re<_e.length;Re++)_e[Re]=_e[Re].input;else k||qe.sort(dt);if(X=v?_e.concat(qe):qe.concat(_e),x){var Nt=X,Ft;X=[];for(var Re=0;Re<Nt.length;Re++)Nt[Re]!=Ft&&X.push(Nt[Re]),Ft=Nt[Re]}u.replaceRange(X.join(`
119
- `),oe,ie)},vglobal:function(u,m){this.global(u,m)},normal:function(u,m){var v=!1,b=m.argString;if(b&&b[0]=="!"&&(b=b.slice(1),v=!0),b=b.trimStart(),!b){ct(u,"Argument is required.");return}var x=m.line;if(typeof x=="number")for(var k=isNaN(m.lineEnd)?x:m.lineEnd,R=x;R<=k;R++)u.setCursor(R,0),mt(u,m.argString.trimStart(),{noremap:v}),u.state.vim.insertMode&&Vn(u,!0);else mt(u,m.argString.trimStart(),{noremap:v}),u.state.vim.insertMode&&Vn(u,!0)},global:function(u,m){var v=m.argString;if(!v){ct(u,"Regular Expression missing from global");return}var b=m.commandName[0]==="v";v[0]==="!"&&m.commandName[0]==="g"&&(b=!0,v=v.slice(1));var x=m.line===void 0?u.firstLine():m.line,k=m.lineEnd||m.line||u.lastLine(),R=mc(v),O=v,L="";if(R&&R.length&&(O=R[0],L=R.slice(1,R.length).join("/")),O)try{_i(u,O,!0,!0)}catch{ct(u,"Invalid regex: "+O);return}for(var z=Kn(u).getQuery(),q=[],oe=x;oe<=k;oe++){var ie=u.getLine(oe);z.test(ie)!==b&&q.push(L?u.getLineHandle(oe):ie)}if(!L){ct(u,q.join(`
120
- `));return}var X=0,Y=function(){if(X<q.length){var xe=q[X++],_e=u.getLineNumber(xe);if(_e==null){Y();return}var qe=_e+1+L;_n.processCommand(u,qe,{callback:Y})}else u.releaseLineHandles&&u.releaseLineHandles()};Y()},substitute:function(u,m){if(!u.getSearchCursor)throw Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var v=m.argString,b=v?Wa(v,v[0]):[],x="",k="",R,O,L,z=!1,q=!1;if(b&&b.length)x=b[0],be("pcre")&&x!==""&&(x=new RegExp(x).source),k=b[1],k!==void 0&&(k=be("pcre")?Fs(k.replace(/([^\\])&/g,"$1$$&")):gc(k),Q.lastSubstituteReplacePart=k),R=b[2]?b[2].split(" "):[];else if(v&&v.length){ct(u,"Substitutions should be of the form :s/pattern/replace/");return}if(R&&(O=R[0],L=parseInt(R[1]),O&&(O.indexOf("c")!=-1&&(z=!0),O.indexOf("g")!=-1&&(q=!0),x=be("pcre")?x+"/"+O:x.replace(/\//g,"\\/")+"/"+O)),x)try{_i(u,x,!0,!0)}catch{ct(u,"Invalid regex: "+x);return}if(k||(k=Q.lastSubstituteReplacePart),k===void 0){ct(u,"No previous substitute regular expression");return}var oe=Kn(u).getQuery(),ie=m.line===void 0?u.getCursor().line:m.line,X=m.lineEnd||ie;ie==u.firstLine()&&X==u.lastLine()&&(X=1/0),L&&(ie=X,X=ie+L-1);var Y=zt(u,new n(ie,0)),xe=u.getSearchCursor(oe,Y);Hs(u,z,q,ie,X,xe,oe,k,m.callback)},startinsert:function(u,m){mt(u,m.argString=="!"?"A":"i",{})},redo:e.commands.redo,undo:e.commands.undo,write:function(u){e.commands.save?e.commands.save(u):u.save&&u.save()},nohlsearch:function(u){ki(u)},yank:function(u){var m=Ge(u.getCursor()).line,v=u.getLine(m);Q.registerController.pushText("0","yank",v,!0,!0)},delete:function(u,m){var v=m.selectionLine,b=isNaN(m.selectionLineEnd)?v:m.selectionLineEnd;Ut.delete(u,{linewise:!0},[{anchor:new n(v,0),head:new n(b+1,0)}])},join:function(u,m){var v=m.selectionLine,b=isNaN(m.selectionLineEnd)?v:m.selectionLineEnd;u.setCursor(new n(v,0)),fn.joinLines(u,{repeat:b-v},u.state.vim)},delmarks:function(u,m){if(!m.argString||!ir(m.argString)){ct(u,"Argument required");return}for(var v=u.state.vim,b=new e.StringStream(ir(m.argString));!b.eol();){b.eatSpace();var x=b.pos;if(!b.match(/[a-zA-Z]/,!1)){ct(u,"Invalid argument: "+m.argString.substring(x));return}var k=b.next();if(b.match("-",!0)){if(!b.match(/[a-zA-Z]/,!1)){ct(u,"Invalid argument: "+m.argString.substring(x));return}var R=k,O=b.next();if(R&&O&&N(R)==N(O)){var L=R.charCodeAt(0),z=O.charCodeAt(0);if(L>=z){ct(u,"Invalid argument: "+m.argString.substring(x));return}for(var q=0;q<=z-L;q++){var oe=String.fromCharCode(L+q);delete v.marks[oe]}}else{ct(u,"Invalid argument: "+R+"-");return}}else k&&delete v.marks[k]}}},_n=new Vo;Be.defineEx("version","ve",u=>{ct(u,"Codemirror-vim version: 6.3.0")});function Hs(u,m,v,b,x,k,R,O,L){u.state.vim.exMode=!0;var z=!1,q=0,oe,ie,X;function Y(){u.operation(function(){for(;!z;)xe(),qe();Re()})}function xe(){var dt="",Je=k.match||k.pos&&k.pos.match;dt=Je?O.replace(/\$(\d{1,3}|[$&])/g,function(Ft,Ue){if(Ue=="$")return"$";if(Ue=="&")return Je[0];for(var $e=Ue;parseInt($e)>=Je.length&&$e.length>0;)$e=$e.slice(0,$e.length-1);return $e?Je[$e]+Ue.slice($e.length,Ue.length):Ft}):u.getRange(k.from(),k.to()).replace(R,O);var Nt=k.to().line;k.replace(dt),ie=k.to().line,x+=ie-Nt,X=ie<Nt}function _e(){var dt=oe&&Ge(k.to()),Je=k.findNext();return Je&&!Je[0]&&dt&&gt(k.from(),dt)&&(Je=k.findNext()),Je&&q++,Je}function qe(){for(;_e()&&bc(k.from(),b,x);)if(!(!v&&k.from().line==ie&&!X)){u.scrollIntoView(k.from(),30),u.setSelection(k.from(),k.to()),oe=k.from(),z=!1;return}z=!0}function Re(dt){if(dt&&dt(),u.focus(),oe){u.setCursor(oe);var Je=u.state.vim;Je.exMode=!1,Je.lastHPos=Je.lastHSPos=oe.ch}L?L():z&&ct(u,(q?"Found "+q+" matches":"No matches found")+" for pattern: "+R+(be("pcre")?" (set nopcre to use Vim regexps)":""))}function Ne(dt,Je,Nt){switch(e.e_stop(dt),tn(dt)){case"y":xe(),qe();break;case"n":qe();break;case"a":var Ft=L;L=void 0,u.operation(Y),L=Ft;break;case"l":xe();case"q":case"<Esc>":case"<C-c>":case"<C-[>":Re(Nt);break}return z&&Re(Nt),!0}if(qe(),z){ct(u,"No matches for "+R+(be("pcre")?" (set nopcre to use vim regexps)":""));return}if(!m){Y(),L&&L();return}aa(u,{prefix:Nn("span","replace with ",Nn("strong",O)," (y/n/a/q/l)"),onKeyDown:Ne})}function Vn(u,m){var v=u.state.vim,b=Q.macroModeState,x=Q.registerController.getRegister("."),k=b.isPlaying,R=b.lastInsertModeChanges;k||(u.off("change",Wr),v.insertEnd&&v.insertEnd.clear(),v.insertEnd=void 0,e.off(u.getInputField(),"keydown",Ws)),!k&&v.insertModeRepeat&&v.insertModeRepeat>1&&(Xa(u,v,v.insertModeRepeat-1,!0),v.lastEditInputState.repeatOverride=v.insertModeRepeat),delete v.insertModeRepeat,v.insertMode=!1,m||u.setCursor(u.getCursor().line,u.getCursor().ch-1),u.setOption("keyMap","vim"),u.setOption("disableInput",!0),u.toggleOverwrite(!1),x.setText(R.changes.join("")),e.signal(u,"vim-mode-change",{mode:"normal"}),b.isRecording&&$s(b)}function oi(u){o.unshift(u),u.keys&&_c(u.keys)}function _c(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(m){m&&(s[m]||(s[m]=0),s[m]++)})}function Vs(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(m){s[m]&&s[m]--})}function xc(u,m,v,b,x){var k={keys:u,type:m};for(var R in k[m]=v,k[m+"Args"]=b,x)k[R]=x[R];oi(k)}we("insertModeEscKeysTimeout",200,"number");function Qa(u,m,v,b){var x=Q.registerController.getRegister(b);if(b==":"){x.keyBuffer[0]&&_n.processCommand(u,x.keyBuffer[0]),v.isPlaying=!1;return}var k=x.keyBuffer,R=0;v.isPlaying=!0,v.replaySearchQueries=x.searchQueries.slice(0);for(var O=0;O<k.length;O++)for(var L=k[O],z,q,oe=/<(?:[CSMA]-)*\w+>|./gi;z=oe.exec(L);)if(q=z[0],Be.handleKey(u,q,"macro"),m.insertMode){var ie=x.insertModeChanges[R++].changes;Q.macroModeState.lastInsertModeChanges.changes=ie,Us(u,ie,1),Vn(u)}v.isPlaying=!1}function $r(u,m){if(!u.isPlaying){var v=u.latestRegister,b=Q.registerController.getRegister(v);b&&b.pushText(m)}}function $s(u){if(!u.isPlaying){var m=u.latestRegister,v=Q.registerController.getRegister(m);v&&v.pushInsertModeChanges&&v.pushInsertModeChanges(u.lastInsertModeChanges)}}function Ga(u,m){if(!u.isPlaying){var v=u.latestRegister,b=Q.registerController.getRegister(v);b&&b.pushSearchQuery&&b.pushSearchQuery(m)}}function Wr(u,m){var v=Q.macroModeState,b=v.lastInsertModeChanges;if(!v.isPlaying)for(var x=u.state.vim;m;){if(b.expectCursorActivityForChange=!0,b.ignoreCount>1)b.ignoreCount--;else if(m.origin=="+input"||m.origin=="paste"||m.origin===void 0){var k=u.listSelections().length;k>1&&(b.ignoreCount=k);var R=m.text.join(`
119
+ `),oe,ie)},vglobal:function(u,m){this.global(u,m)},normal:function(u,m){var v=!1,b=m.argString;if(b&&b[0]=="!"&&(b=b.slice(1),v=!0),b=b.trimStart(),!b){ct(u,"Argument is required.");return}var x=m.line;if(typeof x=="number")for(var k=isNaN(m.lineEnd)?x:m.lineEnd,R=x;R<=k;R++)u.setCursor(R,0),mt(u,m.argString.trimStart(),{noremap:v}),u.state.vim.insertMode&&Vn(u,!0);else mt(u,m.argString.trimStart(),{noremap:v}),u.state.vim.insertMode&&Vn(u,!0)},global:function(u,m){var v=m.argString;if(!v){ct(u,"Regular Expression missing from global");return}var b=m.commandName[0]==="v";v[0]==="!"&&m.commandName[0]==="g"&&(b=!0,v=v.slice(1));var x=m.line===void 0?u.firstLine():m.line,k=m.lineEnd||m.line||u.lastLine(),R=hc(v),O=v,L="";if(R&&R.length&&(O=R[0],L=R.slice(1,R.length).join("/")),O)try{_i(u,O,!0,!0)}catch{ct(u,"Invalid regex: "+O);return}for(var z=Kn(u).getQuery(),q=[],oe=x;oe<=k;oe++){var ie=u.getLine(oe);z.test(ie)!==b&&q.push(L?u.getLineHandle(oe):ie)}if(!L){ct(u,q.join(`
120
+ `));return}var X=0,Y=function(){if(X<q.length){var xe=q[X++],_e=u.getLineNumber(xe);if(_e==null){Y();return}var qe=_e+1+L;_n.processCommand(u,qe,{callback:Y})}else u.releaseLineHandles&&u.releaseLineHandles()};Y()},substitute:function(u,m){if(!u.getSearchCursor)throw Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var v=m.argString,b=v?Wa(v,v[0]):[],x="",k="",R,O,L,z=!1,q=!1;if(b&&b.length)x=b[0],be("pcre")&&x!==""&&(x=new RegExp(x).source),k=b[1],k!==void 0&&(k=be("pcre")?Fs(k.replace(/([^\\])&/g,"$1$$&")):mc(k),Q.lastSubstituteReplacePart=k),R=b[2]?b[2].split(" "):[];else if(v&&v.length){ct(u,"Substitutions should be of the form :s/pattern/replace/");return}if(R&&(O=R[0],L=parseInt(R[1]),O&&(O.indexOf("c")!=-1&&(z=!0),O.indexOf("g")!=-1&&(q=!0),x=be("pcre")?x+"/"+O:x.replace(/\//g,"\\/")+"/"+O)),x)try{_i(u,x,!0,!0)}catch{ct(u,"Invalid regex: "+x);return}if(k||(k=Q.lastSubstituteReplacePart),k===void 0){ct(u,"No previous substitute regular expression");return}var oe=Kn(u).getQuery(),ie=m.line===void 0?u.getCursor().line:m.line,X=m.lineEnd||ie;ie==u.firstLine()&&X==u.lastLine()&&(X=1/0),L&&(ie=X,X=ie+L-1);var Y=zt(u,new n(ie,0)),xe=u.getSearchCursor(oe,Y);Hs(u,z,q,ie,X,xe,oe,k,m.callback)},startinsert:function(u,m){mt(u,m.argString=="!"?"A":"i",{})},redo:e.commands.redo,undo:e.commands.undo,write:function(u){e.commands.save?e.commands.save(u):u.save&&u.save()},nohlsearch:function(u){ki(u)},yank:function(u){var m=Ge(u.getCursor()).line,v=u.getLine(m);Q.registerController.pushText("0","yank",v,!0,!0)},delete:function(u,m){var v=m.selectionLine,b=isNaN(m.selectionLineEnd)?v:m.selectionLineEnd;Ut.delete(u,{linewise:!0},[{anchor:new n(v,0),head:new n(b+1,0)}])},join:function(u,m){var v=m.selectionLine,b=isNaN(m.selectionLineEnd)?v:m.selectionLineEnd;u.setCursor(new n(v,0)),fn.joinLines(u,{repeat:b-v},u.state.vim)},delmarks:function(u,m){if(!m.argString||!ir(m.argString)){ct(u,"Argument required");return}for(var v=u.state.vim,b=new e.StringStream(ir(m.argString));!b.eol();){b.eatSpace();var x=b.pos;if(!b.match(/[a-zA-Z]/,!1)){ct(u,"Invalid argument: "+m.argString.substring(x));return}var k=b.next();if(b.match("-",!0)){if(!b.match(/[a-zA-Z]/,!1)){ct(u,"Invalid argument: "+m.argString.substring(x));return}var R=k,O=b.next();if(R&&O&&N(R)==N(O)){var L=R.charCodeAt(0),z=O.charCodeAt(0);if(L>=z){ct(u,"Invalid argument: "+m.argString.substring(x));return}for(var q=0;q<=z-L;q++){var oe=String.fromCharCode(L+q);delete v.marks[oe]}}else{ct(u,"Invalid argument: "+R+"-");return}}else k&&delete v.marks[k]}}},_n=new Vo;Be.defineEx("version","ve",u=>{ct(u,"Codemirror-vim version: 6.3.0")});function Hs(u,m,v,b,x,k,R,O,L){u.state.vim.exMode=!0;var z=!1,q=0,oe,ie,X;function Y(){u.operation(function(){for(;!z;)xe(),qe();Re()})}function xe(){var dt="",Je=k.match||k.pos&&k.pos.match;dt=Je?O.replace(/\$(\d{1,3}|[$&])/g,function(Ft,Ue){if(Ue=="$")return"$";if(Ue=="&")return Je[0];for(var $e=Ue;parseInt($e)>=Je.length&&$e.length>0;)$e=$e.slice(0,$e.length-1);return $e?Je[$e]+Ue.slice($e.length,Ue.length):Ft}):u.getRange(k.from(),k.to()).replace(R,O);var Nt=k.to().line;k.replace(dt),ie=k.to().line,x+=ie-Nt,X=ie<Nt}function _e(){var dt=oe&&Ge(k.to()),Je=k.findNext();return Je&&!Je[0]&&dt&&gt(k.from(),dt)&&(Je=k.findNext()),Je&&q++,Je}function qe(){for(;_e()&&vc(k.from(),b,x);)if(!(!v&&k.from().line==ie&&!X)){u.scrollIntoView(k.from(),30),u.setSelection(k.from(),k.to()),oe=k.from(),z=!1;return}z=!0}function Re(dt){if(dt&&dt(),u.focus(),oe){u.setCursor(oe);var Je=u.state.vim;Je.exMode=!1,Je.lastHPos=Je.lastHSPos=oe.ch}L?L():z&&ct(u,(q?"Found "+q+" matches":"No matches found")+" for pattern: "+R+(be("pcre")?" (set nopcre to use Vim regexps)":""))}function Ne(dt,Je,Nt){switch(e.e_stop(dt),tn(dt)){case"y":xe(),qe();break;case"n":qe();break;case"a":var Ft=L;L=void 0,u.operation(Y),L=Ft;break;case"l":xe();case"q":case"<Esc>":case"<C-c>":case"<C-[>":Re(Nt);break}return z&&Re(Nt),!0}if(qe(),z){ct(u,"No matches for "+R+(be("pcre")?" (set nopcre to use vim regexps)":""));return}if(!m){Y(),L&&L();return}aa(u,{prefix:Nn("span","replace with ",Nn("strong",O)," (y/n/a/q/l)"),onKeyDown:Ne})}function Vn(u,m){var v=u.state.vim,b=Q.macroModeState,x=Q.registerController.getRegister("."),k=b.isPlaying,R=b.lastInsertModeChanges;k||(u.off("change",Wr),v.insertEnd&&v.insertEnd.clear(),v.insertEnd=void 0,e.off(u.getInputField(),"keydown",Ws)),!k&&v.insertModeRepeat&&v.insertModeRepeat>1&&(Xa(u,v,v.insertModeRepeat-1,!0),v.lastEditInputState.repeatOverride=v.insertModeRepeat),delete v.insertModeRepeat,v.insertMode=!1,m||u.setCursor(u.getCursor().line,u.getCursor().ch-1),u.setOption("keyMap","vim"),u.setOption("disableInput",!0),u.toggleOverwrite(!1),x.setText(R.changes.join("")),e.signal(u,"vim-mode-change",{mode:"normal"}),b.isRecording&&$s(b)}function oi(u){o.unshift(u),u.keys&&wc(u.keys)}function wc(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(m){m&&(s[m]||(s[m]=0),s[m]++)})}function Vs(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(m){s[m]&&s[m]--})}function _c(u,m,v,b,x){var k={keys:u,type:m};for(var R in k[m]=v,k[m+"Args"]=b,x)k[R]=x[R];oi(k)}we("insertModeEscKeysTimeout",200,"number");function Qa(u,m,v,b){var x=Q.registerController.getRegister(b);if(b==":"){x.keyBuffer[0]&&_n.processCommand(u,x.keyBuffer[0]),v.isPlaying=!1;return}var k=x.keyBuffer,R=0;v.isPlaying=!0,v.replaySearchQueries=x.searchQueries.slice(0);for(var O=0;O<k.length;O++)for(var L=k[O],z,q,oe=/<(?:[CSMA]-)*\w+>|./gi;z=oe.exec(L);)if(q=z[0],Be.handleKey(u,q,"macro"),m.insertMode){var ie=x.insertModeChanges[R++].changes;Q.macroModeState.lastInsertModeChanges.changes=ie,Us(u,ie,1),Vn(u)}v.isPlaying=!1}function $r(u,m){if(!u.isPlaying){var v=u.latestRegister,b=Q.registerController.getRegister(v);b&&b.pushText(m)}}function $s(u){if(!u.isPlaying){var m=u.latestRegister,v=Q.registerController.getRegister(m);v&&v.pushInsertModeChanges&&v.pushInsertModeChanges(u.lastInsertModeChanges)}}function Ga(u,m){if(!u.isPlaying){var v=u.latestRegister,b=Q.registerController.getRegister(v);b&&b.pushSearchQuery&&b.pushSearchQuery(m)}}function Wr(u,m){var v=Q.macroModeState,b=v.lastInsertModeChanges;if(!v.isPlaying)for(var x=u.state.vim;m;){if(b.expectCursorActivityForChange=!0,b.ignoreCount>1)b.ignoreCount--;else if(m.origin=="+input"||m.origin=="paste"||m.origin===void 0){var k=u.listSelections().length;k>1&&(b.ignoreCount=k);var R=m.text.join(`
121
121
  `);if(b.maybeReset&&(b.maybeReset=(b.changes=[],!1)),R)if(u.state.overwrite&&!/\n/.test(R))b.changes.push([R]);else{if(R.length>1){var O=x&&x.insertEnd&&x.insertEnd.find(),L=u.getCursor();if(O&&O.line==L.line){var z=O.ch-L.ch;z>0&&z<R.length&&(b.changes.push([R,z]),R="")}}R&&b.changes.push(R)}}m=m.next}}function $o(u){var x;var m=u.state.vim;if(m.insertMode){var v=Q.macroModeState;if(v.isPlaying)return;var b=v.lastInsertModeChanges;b.expectCursorActivityForChange?b.expectCursorActivityForChange=!1:(b.maybeReset=!0,m.insertEnd&&m.insertEnd.clear(),m.insertEnd=u.setBookmark(u.getCursor(),{insertLeft:!0}))}else(x=u.curOp)!=null&&x.isVimOp||Ja(u,m)}function Ja(u,m){var v=u.getCursor("anchor"),b=u.getCursor("head");if(m.visualMode&&!u.somethingSelected()?Ye(u,!1):!m.visualMode&&!m.insertMode&&u.somethingSelected()&&(m.visualMode=!0,m.visualLine=!1,e.signal(u,"vim-mode-change",{mode:"visual"})),m.visualMode){var x=xt(b,v)?0:-1,k=xt(b,v)?-1:0;b=_t(b,0,x),v=_t(v,0,k),m.sel={anchor:v,head:b},Bn(u,m,"<",kt(b,v)),Bn(u,m,">",zn(b,v))}else m.insertMode||(m.lastHPos=u.getCursor().ch)}function Ws(u){var m=Q.macroModeState.lastInsertModeChanges,v=e.keyName?e.keyName(u):u.key;v&&(v.indexOf("Delete")!=-1||v.indexOf("Backspace")!=-1)&&(m.maybeReset&&(m.maybeReset=(m.changes=[],!1)),m.changes.push(new Fe(v,u)))}function Xa(u,m,v,b){var x=Q.macroModeState;x.isPlaying=!0;var k=m.lastEditActionCommand,R=m.inputState;function O(){k?Pn.processAction(u,m,k):Pn.evalInput(u,m)}function L(q){if(x.lastInsertModeChanges.changes.length>0){q=m.lastEditActionCommand?q:1;var oe=x.lastInsertModeChanges;Us(u,oe.changes,q)}}if(m.inputState=m.lastEditInputState,k&&k.interlaceInsertRepeat)for(var z=0;z<v;z++)O(),L(1);else b||O(),L(v);m.inputState=R,m.insertMode&&!b&&Vn(u),x.isPlaying=!1}function Ya(u,m){e.lookupKey(m,"vim-insert",function(v){return typeof v=="string"?e.commands[v](u):v(u),!0})}function Us(u,m,v){var b=u.getCursor("head"),x=Q.macroModeState.lastInsertModeChanges.visualBlock;x&&(ar(u,b,x+1),v=u.listSelections().length,u.setCursor(b));for(var k=0;k<v;k++){x&&u.setCursor(_t(b,k,0));for(var R=0;R<m.length;R++){var O=m[R];if(O instanceof Fe)Ya(u,O.keyName);else if(typeof O=="string")u.replaceSelection(O);else{var L=u.getCursor(),z=_t(L,0,O[0].length-(O[1]||0));u.replaceRange(O[0],L,O[1]?L:z),u.setCursor(z)}}}x&&u.setCursor(_t(b,0,1))}function xn(u){var m=new u.constructor;return Object.keys(u).forEach(function(v){if(v!="insertEnd"){var b=u[v];Array.isArray(b)?b=b.slice():b&&typeof b=="object"&&b.constructor!=Object&&(b=xn(b)),m[v]=b}}),u.sel&&(m.sel={head:u.sel.head&&Ge(u.sel.head),anchor:u.sel.anchor&&Ge(u.sel.anchor)}),m}function Si(u,m,v){var k=se(u),b=u,x=!1,k=Be.maybeInitVimState_(b),R=k.visualBlock||k.wasInVisualBlock;if(b.state.closeVimNotification){var O=b.state.closeVimNotification;if(b.state.closeVimNotification=null,O(),m=="<CR>")return pt(b),!0}var L=b.isInMultiSelectMode();if(k.wasInVisualBlock&&!L?k.wasInVisualBlock=!1:L&&k.visualBlock&&(k.wasInVisualBlock=!0),m=="<Esc>"&&!k.insertMode&&!k.visualMode&&L&&k.status=="<Esc>")pt(b);else if(R||!L||b.inVirtualSelectionMode)x=Be.handleKey(b,m,v);else{var z=xn(k),q=k.inputState.changeQueueList||[];b.operation(function(){var ie;b.curOp&&(b.curOp.isVimOp=!0);var oe=0;b.forEachSelection(function(){b.state.vim.inputState.changeQueue=q[oe];var X=b.getCursor("head"),Y=b.getCursor("anchor"),xe=xt(X,Y)?0:-1,_e=xt(X,Y)?-1:0;X=_t(X,0,xe),Y=_t(Y,0,_e),b.state.vim.sel.head=X,b.state.vim.sel.anchor=Y,x=Be.handleKey(b,m,v),b.virtualSelection&&(q[oe]=b.state.vim.inputState.changeQueue,b.state.vim=xn(z)),oe++}),(ie=b.curOp)!=null&&ie.cursorActivity&&!x&&(b.curOp.cursorActivity=!1),b.state.vim=k,k.inputState.changeQueueList=q,k.inputState.changeQueue=null},!0)}return x&&!k.visualMode&&!k.insertMode&&k.visualMode!=b.somethingSelected()&&Ja(b,k),x}return Le(),Be}function rr(e,n){var i=n.ch,o=n.line+1;o<1&&(o=1,i=0),o>e.lines&&(o=e.lines,i=Number.MAX_VALUE);var s=e.line(o);return Math.min(s.from+Math.max(0,i),s.to)}function qr(e,n){let i=e.lineAt(n);return{line:i.number-1,ch:n-i.from}}var ti=class{constructor(e,n){this.line=e,this.ch=n}};function hy(e,n,i){if(e.addEventListener)e.addEventListener(n,i,!1);else{var o=e._handlers||(e._handlers={});o[n]=(o[n]||[]).concat(i)}}function my(e,n,i){if(e.removeEventListener)e.removeEventListener(n,i,!1);else{var o=e._handlers,s=o&&o[n];if(s){var c=s.indexOf(i);c>-1&&(o[n]=s.slice(0,c).concat(s.slice(c+1)))}}}function gy(e,n,...i){var c;var o=(c=e._handlers)==null?void 0:c[n];if(o)for(var s=0;s<o.length;++s)o[s](...i)}function yy(e,...n){if(e)for(var i=0;i<e.length;++i)e[i](...n)}var Gd;try{Gd=RegExp("[\\w\\p{Alphabetic}\\p{Number}_]","u")}catch{Gd=/[\w]/}function Ls(e,n){var i=e.cm6;if(!i.state.readOnly){var o="input.type.compose";if(e.curOp&&(e.curOp.lastChange||(o="input.type.compose.start")),n.annotations)try{n.annotations.some(function(s){s.value=="input"&&(s.value=o)})}catch(s){console.error(s)}else n.userEvent=o;return i.dispatch(n)}}function vy(e,n){var o;e.curOp&&(e.curOp.$changeStart=void 0),(n?z4:F4)(e.cm6);let i=(o=e.curOp)==null?void 0:o.$changeStart;i!=null&&e.cm6.dispatch({selection:{anchor:i}})}var YS={Left:e=>ks(e.cm6,{key:"Left"},"editor"),Right:e=>ks(e.cm6,{key:"Right"},"editor"),Up:e=>ks(e.cm6,{key:"Up"},"editor"),Down:e=>ks(e.cm6,{key:"Down"},"editor"),Backspace:e=>ks(e.cm6,{key:"Backspace"},"editor"),Delete:e=>ks(e.cm6,{key:"Delete"},"editor")},Xe=class yx{openDialog(n,i,o){return eC(this,n,i,o)}openNotification(n,i){return ZS(this,n,i)}constructor(n){this.state={},this.marks=Object.create(null),this.$mid=0,this.options={},this._handlers={},this.$lastChangeEndOffset=0,this.virtualSelection=null,this.cm6=n,this.onChange=this.onChange.bind(this),this.onSelectionChange=this.onSelectionChange.bind(this)}on(n,i){hy(this,n,i)}off(n,i){my(this,n,i)}signal(n,i,o){gy(this,n,i,o)}indexFromPos(n){return rr(this.cm6.state.doc,n)}posFromIndex(n){return qr(this.cm6.state.doc,n)}foldCode(n){let i=this.cm6,o=i.state.selection.ranges,s=this.cm6.state.doc,c=rr(s,n),d=mn.create([mn.range(c,c)],0).ranges;i.state.selection.ranges=d,C4(i),i.state.selection.ranges=o}firstLine(){return 0}lastLine(){return this.cm6.state.doc.lines-1}lineCount(){return this.cm6.state.doc.lines}setCursor(n,i){typeof n=="object"&&(i=n.ch,n=n.line);var o=rr(this.cm6.state.doc,{line:n,ch:i||0});this.cm6.dispatch({selection:{anchor:o}},{scrollIntoView:!this.curOp}),this.curOp&&!this.curOp.isVimOp&&this.onBeforeEndOperation()}getCursor(n){var i=this.cm6.state.selection.main,o=n=="head"||!n?i.head:n=="anchor"?i.anchor:n=="start"?i.from:n=="end"?i.to:null;if(o==null)throw Error("Invalid cursor type");return this.posFromIndex(o)}listSelections(){var n=this.cm6.state.doc;return this.cm6.state.selection.ranges.map(i=>({anchor:qr(n,i.anchor),head:qr(n,i.head)}))}setSelections(n,i){var o=this.cm6.state.doc,s=n.map(c=>{var d=rr(o,c.head),f=rr(o,c.anchor);return d==f?mn.cursor(d,1):mn.range(f,d)});this.cm6.dispatch({selection:mn.create(s,i)})}setSelection(n,i,o){this.setSelections([{anchor:n,head:i}],0),o&&o.origin=="*mouse"&&this.onBeforeEndOperation()}getLine(n){var i=this.cm6.state.doc;return n<0||n>=i.lines?"":this.cm6.state.doc.line(n+1).text}getLineHandle(n){return this.$lineHandleChanges||(this.$lineHandleChanges=[]),{row:n,index:this.indexFromPos(new ti(n,0))}}getLineNumber(n){var i=this.$lineHandleChanges;if(!i)return null;for(var o=n.index,s=0;s<i.length;s++)if(o=i[s].changes.mapPos(o,1,ow.TrackAfter),o==null)return null;var c=this.posFromIndex(o);return c.ch==0?c.line:null}releaseLineHandles(){this.$lineHandleChanges=void 0}getRange(n,i){var o=this.cm6.state.doc;return this.cm6.state.sliceDoc(rr(o,n),rr(o,i))}replaceRange(n,i,o,s){o||(o=i);var c=this.cm6.state.doc,d=rr(c,i),f=rr(c,o);Ls(this,{changes:{from:d,to:f,insert:n}})}replaceSelection(n){Ls(this,this.cm6.state.replaceSelection(n))}replaceSelections(n){var i=this.cm6.state.selection.ranges.map((o,s)=>({from:o.from,to:o.to,insert:n[s]||""}));Ls(this,{changes:i})}getSelection(){return this.getSelections().join(`
122
122
  `)}getSelections(){var n=this.cm6;return n.state.selection.ranges.map(i=>n.state.sliceDoc(i.from,i.to))}somethingSelected(){return this.cm6.state.selection.ranges.some(n=>!n.empty)}getInputField(){return this.cm6.contentDOM}clipPos(n){var i=this.cm6.state.doc,o=n.ch,s=n.line+1;s<1&&(s=1,o=0),s>i.lines&&(s=i.lines,o=Number.MAX_VALUE);var c=i.line(s);return o=Math.min(Math.max(0,o),c.to-c.from),new ti(s-1,o)}getValue(){return this.cm6.state.doc.toString()}setValue(n){var i=this.cm6;return i.dispatch({changes:{from:0,to:i.state.doc.length,insert:n},selection:mn.range(0,0)})}focus(){return this.cm6.focus()}blur(){return this.cm6.contentDOM.blur()}defaultTextHeight(){return this.cm6.defaultLineHeight}findMatchingBracket(n,i){var o=this.cm6.state,s=rr(o.doc,n),c=pw(o,s+1,-1);return c&&c.end||(c=pw(o,s,1),c&&c.end)?{to:qr(o.doc,c.end.from)}:{to:void 0}}scanForBracket(n,i,o,s){return rC(this,n,i,o,s)}indentLine(n,i){i?this.indentMore():this.indentLess()}indentMore(){tD(this.cm6)}indentLess(){$4(this.cm6)}execCommand(n){if(n=="indentAuto")yx.commands.indentAuto(this);else if(n=="goLineLeft")K4(this.cm6);else if(n=="goLineRight"){U4(this.cm6);let i=this.cm6.state,o=i.selection.main.head;o<i.doc.length&&i.sliceDoc(o,o+1)!==`
123
123
  `&&W4(this.cm6)}else console.log(n+" is not implemented")}setBookmark(n,i){var o=i!=null&&i.insertLeft?1:-1,s=this.indexFromPos(n);return new oC(this,s,o)}addOverlay({query:n}){let i=new Q4({regexp:!0,search:n.source,caseSensitive:!/i/.test(n.flags)});if(i.valid){i.forVim=!0,this.cm6Query=i;let o=_h.of(i);return this.cm6.dispatch({effects:o}),i}}removeOverlay(n){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let i=_h.of(this.cm6Query);this.cm6.dispatch({effects:i})}getSearchCursor(n,i){var o=this,s=null,c=null,d=!1;i.ch??(i.ch=Number.MAX_VALUE);var f=rr(o.cm6.state.doc,i),p=n.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(E,T){return T||"\\"+E});function y(E,T=0,I=E.length){return new X4(E,p,{ignoreCase:n.ignoreCase},T,I)}function w(E){var T=o.cm6.state.doc;if(E>T.length)return null;let I=y(T,E).next();return I.done?null:I.value}var _=1e4;function C(E,T){var I=o.cm6.state.doc;for(let $=1;;$++){let V=Math.max(E,T-$*_),F=y(I,V,T),N=null;for(;!F.next().done;)N=F.value;if(N&&(V==E||N.from>V+10))return N;if(V==E)return null}}return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(E){var T=o.cm6.state.doc;return s=E?C(0,s?d?s.to-1:s.from:f):w(s?d?s.to+1:s.to:f),c=s&&{from:qr(T,s.from),to:qr(T,s.to),match:s.match},d=s?s.from==s.to:!1,s&&s.match},from:function(){return c==null?void 0:c.from},to:function(){return c==null?void 0:c.to},replace:function(E){s&&(Ls(o,{changes:{from:s.from,to:s.to,insert:E}}),s.to=s.from+E.length,c&&(c.to=qr(o.cm6.state.doc,s.to)))},get match(){return c&&c.match}}}findPosV(n,i,o,s){let{cm6:c}=this,d=c.state.doc,f=o=="page"?c.dom.clientHeight:0,p=rr(d,n),y=mn.cursor(p,1,void 0,s),w=Math.round(Math.abs(i));for(let C=0;C<w;C++)o=="page"?y=c.moveVertically(y,i>0,f):o=="line"&&(y=c.moveVertically(y,i>0));let _=qr(d,y.head);return(i<0&&y.head==0&&s!=0&&n.line==0&&n.ch!=0||i>0&&y.head==d.length&&_.ch!=s&&n.line==_.line)&&(_.hitSide=!0),_}charCoords(n,i){var o=this.cm6.contentDOM.getBoundingClientRect(),s=rr(this.cm6.state.doc,n),c=this.cm6.coordsAtPos(s),d=-o.top;return{left:((c==null?void 0:c.left)||0)-o.left,top:((c==null?void 0:c.top)||0)+d,bottom:((c==null?void 0:c.bottom)||0)+d}}coordsChar(n,i){var o=this.cm6.contentDOM.getBoundingClientRect(),s=this.cm6.posAtCoords({x:n.left+o.left,y:n.top+o.top})||0;return qr(this.cm6.state.doc,s)}getScrollInfo(){var n=this.cm6.scrollDOM;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight,width:n.scrollWidth,clientHeight:n.clientHeight,clientWidth:n.clientWidth}}scrollTo(n,i){n!=null&&(this.cm6.scrollDOM.scrollLeft=n),i!=null&&(this.cm6.scrollDOM.scrollTop=i)}scrollIntoView(n,i){if(n){var o=this.indexFromPos(n);this.cm6.dispatch({effects:Kt.scrollIntoView(o)})}else this.cm6.dispatch({scrollIntoView:!0,userEvent:"scroll"})}getWrapperElement(){return this.cm6.dom}getMode(){return{name:this.getOption("mode")}}setSize(n,i){this.cm6.dom.style.width=n+4+"px",this.cm6.dom.style.height=i+"px",this.refresh()}refresh(){this.cm6.measure()}destroy(){this.removeOverlay()}getLastEditEnd(){return this.posFromIndex(this.$lastChangeEndOffset)}onChange(n){for(let o in this.$lineHandleChanges&&this.$lineHandleChanges.push(n),this.marks)this.marks[o].update(n.changes);this.virtualSelection&&(this.virtualSelection.ranges=this.virtualSelection.ranges.map(o=>o.map(n.changes)));var i=this.curOp=this.curOp||{};n.changes.iterChanges((o,s,c,d,f)=>{(i.$changeStart==null||i.$changeStart>c)&&(i.$changeStart=c),this.$lastChangeEndOffset=d;var p={text:f.toJSON()};i.lastChange?i.lastChange.next=i.lastChange=p:i.lastChange=i.change=p},!0),i.changeHandlers||(i.changeHandlers=this._handlers.change&&this._handlers.change.slice())}onSelectionChange(){var n=this.curOp=this.curOp||{};n.cursorActivityHandlers||(n.cursorActivityHandlers=this._handlers.cursorActivity&&this._handlers.cursorActivity.slice()),this.curOp.cursorActivity=!0}operation(n,i){this.curOp||(this.curOp={$d:0}),this.curOp.$d++;try{var o=n()}finally{this.curOp&&(this.curOp.$d--,this.curOp.$d||this.onBeforeEndOperation())}return o}onBeforeEndOperation(){var n=this.curOp,i=!1;n&&(n.change&&yy(n.changeHandlers,this,n.change),n&&n.cursorActivity&&(yy(n.cursorActivityHandlers,this,null),n.isVimOp&&(i=!0)),this.curOp=null),i&&this.scrollIntoView()}moveH(n,i){if(i=="char"){var o=this.getCursor();this.setCursor(o.line,o.ch+n)}}setOption(n,i){switch(n){case"keyMap":this.state.keyMap=i;break;case"textwidth":this.state.textwidth=i;break}}getOption(n){switch(n){case"firstLineNumber":return 1;case"tabSize":return this.cm6.state.tabSize||4;case"readOnly":return this.cm6.state.readOnly;case"indentWithTabs":return this.cm6.state.facet(sw)==" ";case"indentUnit":return this.cm6.state.facet(sw).length||2;case"textwidth":return this.state.textwidth;case"keyMap":return this.state.keyMap||"vim"}}toggleOverwrite(n){this.state.overwrite=n}getTokenTypeAt(n){var s,c,d;var i=this.indexFromPos(n),o=((d=(c=(s=cw(this.cm6.state,i))==null?void 0:s.resolve(i))==null?void 0:c.type)==null?void 0:d.name)||"";return/comment/i.test(o)?"comment":/string/i.test(o)?"string":""}overWriteSelection(n){var i=this.cm6.state.doc,o=this.cm6.state.selection,s=o.ranges.map(c=>{if(c.empty){var d=c.to<i.length?i.sliceString(c.from,c.to+1):"";if(d&&!/\n/.test(d))return mn.range(c.from,c.to+1)}return c});this.cm6.dispatch({selection:mn.create(s,o.mainIndex)}),this.replaceSelection(n)}isInMultiSelectMode(){return this.cm6.state.selection.ranges.length>1}virtualSelectionMode(){return!!this.virtualSelection}forEachSelection(n){var i=this.cm6.state.selection;this.virtualSelection=mn.create(i.ranges,i.mainIndex);for(var o=0;o<this.virtualSelection.ranges.length;o++){var s=this.virtualSelection.ranges[o];s&&(this.cm6.dispatch({selection:mn.create([s])}),n(),this.virtualSelection.ranges[o]=this.cm6.state.selection.ranges[0])}this.cm6.dispatch({selection:this.virtualSelection}),this.virtualSelection=null}hardWrap(n){return sC(this,n)}};Xe.isMac=typeof navigator<"u"&&/Mac/.test(navigator.platform),Xe.Pos=ti,Xe.StringStream=q4,Xe.commands={cursorCharLeft:function(e){G4(e.cm6)},redo:function(e){vy(e,!1)},undo:function(e){vy(e,!0)},newlineAndIndent:function(e){eD({state:e.cm6.state,dispatch:n=>Ls(e,n)})},indentAuto:function(e){B4(e.cm6)},newlineAndIndentContinueComment:void 0,save:void 0},Xe.isWordChar=function(e){return Gd.test(e)},Xe.keys=YS,Xe.addClass=function(e,n){},Xe.rmClass=function(e,n){},Xe.e_preventDefault=function(e){e.preventDefault()},Xe.e_stop=function(e){var n,i;(n=e==null?void 0:e.stopPropagation)==null||n.call(e),(i=e==null?void 0:e.preventDefault)==null||i.call(e)},Xe.lookupKey=function(e,n,i){var o=Xe.keys[e];!o&&/^Arrow/.test(e)&&(o=Xe.keys[e.slice(5)]),o&&i(o)},Xe.on=hy,Xe.off=my,Xe.signal=gy,Xe.findMatchingTag=iC,Xe.findEnclosingTag=aC,Xe.keyName=void 0;function by(e,n,i){var o=document.createElement("div");return o.appendChild(n),o}function wy(e,n){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=n}function ZS(e,n,i){wy(e,f);var o=by(e,n,i&&i.bottom),s=!1,c,d=i&&i.duration!==void 0?i.duration:5e3;function f(){s||(s=!0,clearTimeout(c),o.remove(),xy(e,o))}return o.onclick=function(p){p.preventDefault(),f()},_y(e,o),d&&(c=setTimeout(f,d)),f}function _y(e,n){var i=e.state.dialog;e.state.dialog=n,n.style.flex="1",n&&i!==n&&(i&&i.contains(document.activeElement)&&e.focus(),i&&i.parentElement?i.parentElement.replaceChild(n,i):i&&i.remove(),Xe.signal(e,"dialog"))}function xy(e,n){e.state.dialog==n&&(e.state.dialog=null,Xe.signal(e,"dialog"))}function eC(e,n,i,o){o||(o={}),wy(e,void 0);var s=by(e,n,o.bottom),c=!1;_y(e,s);function d(p){if(typeof p=="string")f.value=p;else{if(c)return;c=!0,xy(e,s),e.state.dialog||e.focus(),o.onClose&&o.onClose(s)}}var f=s.getElementsByTagName("input")[0];return f&&(o.value&&(f.value=o.value,o.selectValueOnOpen!==!1&&f.select()),o.onInput&&Xe.on(f,"input",function(p){o.onInput(p,f.value,d)}),o.onKeyUp&&Xe.on(f,"keyup",function(p){o.onKeyUp(p,f.value,d)}),Xe.on(f,"keydown",function(p){o&&o.onKeyDown&&o.onKeyDown(p,f.value,d)||(p.keyCode==13&&i&&i(f.value),(p.keyCode==27||o.closeOnEnter!==!1&&p.keyCode==13)&&(f.blur(),Xe.e_stop(p),d()))}),o.closeOnBlur!==!1&&Xe.on(f,"blur",function(){setTimeout(function(){document.activeElement!==f&&d()})}),f.focus()),d}var tC={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function nC(e){return e&&e.bracketRegex||/[(){}[\]]/}function rC(e,n,i,o,s){for(var c=s&&s.maxScanLineLength||1e4,d=s&&s.maxScanLines||1e3,f=[],p=nC(s),y=i>0?Math.min(n.line+d,e.lastLine()+1):Math.max(e.firstLine()-1,n.line-d),w=n.line;w!=y;w+=i){var _=e.getLine(w);if(_){var C=i>0?0:_.length-1,E=i>0?_.length:-1;if(!(_.length>c))for(w==n.line&&(C=n.ch-(i<0?1:0));C!=E;C+=i){var T=_.charAt(C);if(p.test(T)){var I=tC[T];if(I&&I.charAt(1)==">"==i>0)f.push(T);else if(f.length)f.pop();else return{pos:new ti(w,C),ch:T}}}}}return w-i==(i>0?e.lastLine():e.firstLine())?!1:null}function iC(e,n){return null}function aC(e,n){var c,d,f;var i=e.cm6.state,o=e.indexFromPos(n);o<i.doc.length&&i.sliceDoc(o,o+1)=="<"&&o++;for(var s=((c=cw(i,o))==null?void 0:c.resolve(o))||null;s;){if(((d=s.firstChild)==null?void 0:d.type.name)=="OpenTag"&&((f=s.lastChild)==null?void 0:f.type.name)=="CloseTag")return{open:ky(i.doc,s.firstChild),close:ky(i.doc,s.lastChild)};s=s.parent}}function ky(e,n){return{from:qr(e,n.from),to:qr(e,n.to)}}var oC=class{constructor(e,n,i){this.cm=e,this.id=e.$mid++,this.offset=n,this.assoc=i,e.marks[this.id]=this}clear(){delete this.cm.marks[this.id]}find(){return this.offset==null?null:this.cm.posFromIndex(this.offset)}update(e){this.offset!=null&&(this.offset=e.mapPos(this.offset,this.assoc,ow.TrackDel))}};function sC(e,n){var T;for(var i=n.column||e.getOption("textwidth")||80,o=n.allowMerge!=0,s=Math.min(n.from,n.to),c=Math.max(n.from,n.to);s<=c;){var d=e.getLine(s);if(d.length>i){var f=E(d,i,5);if(f){var p=(T=/^\s*/.exec(d))==null?void 0:T[0];e.replaceRange(`
124
- `+p,new ti(s,f.start),new ti(s,f.end))}c++}else if(o&&/\S/.test(d)&&s!=c){var y=e.getLine(s+1);if(y&&/\S/.test(y)){var w=d.replace(/\s+$/,""),_=y.replace(/^\s+/,""),C=w+" "+_,f=E(C,i,5);f&&f.start>w.length||C.length<i?(e.replaceRange(" ",new ti(s,w.length),new ti(s+1,y.length-_.length)),s--,c--):w.length<d.length&&e.replaceRange("",new ti(s,w.length),new ti(s,d.length))}}s++}return s;function E(I,$,V){if(!(I.length<$)){var F=I.slice(0,$),N=I.slice($),K=/^(?:(\s+)|(\S+)(\s+))/.exec(N),pe=/(?:(\s+)|(\s+)(\S+))$/.exec(F),P=0,A=0;if(pe&&!pe[2]&&(P=$-pe[1].length,A=$),K&&!K[2]&&(P||(P=$),A=$+K[1].length),P)return{start:P,end:A};if(pe&&pe[2]&&pe.index>V)return{start:pe.index,end:pe.index+pe[2].length};if(K&&K[2])return P=$+K[2].length,{start:P,end:P+K[3].length}}}}var Jd=I4||(function(){let e={cursorBlinkRate:1200};return function(){return e}})(),lC=class{constructor(e,n,i,o,s,c,d,f,p,y){this.left=e,this.top=n,this.height=i,this.fontFamily=o,this.fontSize=s,this.fontWeight=c,this.color=d,this.className=f,this.letter=p,this.partial=y}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",e.style.height=this.height+"px",e.style.lineHeight=this.height+"px",e.style.fontFamily=this.fontFamily,e.style.fontSize=this.fontSize,e.style.fontWeight=this.fontWeight,e.style.color=this.partial?"transparent":this.color,e.className=this.className,e.textContent=this.letter}eq(e){return this.left==e.left&&this.top==e.top&&this.height==e.height&&this.fontFamily==e.fontFamily&&this.fontSize==e.fontSize&&this.fontWeight==e.fontWeight&&this.color==e.color&&this.className==e.className&&this.letter==e.letter}},cC=class{constructor(e,n){this.view=e,this.rangePieces=[],this.cursors=[],this.cm=n,this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.cursorLayer=e.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer cm-vimCursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),e.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){let e=Jd(this.cm.cm6.state).cursorBlinkRate;this.cursorLayer.style.animationDuration=e+"ms"}update(e){(e.selectionSet||e.geometryChanged||e.viewportChanged)&&(this.view.requestMeasure(this.measureReq),this.cursorLayer.style.animationName=this.cursorLayer.style.animationName=="cm-blink"?"cm-blink2":"cm-blink"),uC(e)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:e}=this.view,n=[];for(let i of e.selection.ranges){let o=i==e.selection.main,s=pC(this.cm,this.view,i,o);s&&n.push(s)}return{cursors:n}}drawSel({cursors:e}){if(e.length!=this.cursors.length||e.some((n,i)=>!n.eq(this.cursors[i]))){let n=this.cursorLayer.children;if(n.length!==e.length){this.cursorLayer.textContent="";for(let i of e)this.cursorLayer.appendChild(i.draw())}else e.forEach((i,o)=>i.adjust(n[o]));this.cursors=e}}destroy(){this.cursorLayer.remove()}};function uC(e){return Jd(e.startState)!=Jd(e.state)}var dC=Mu.highest(Kt.theme({".cm-vimMode .cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-fat-cursor":{position:"absolute",background:"#ff9696",border:"none",whiteSpace:"pre"},"&:not(.cm-focused) .cm-fat-cursor":{background:"none",outline:"solid 1px #ff9696",color:"transparent !important"}}));function fC(e){let n=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==L4.LTR?n.left:n.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft*e.scaleX,top:n.top-e.scrollDOM.scrollTop*e.scaleY}}function pC(e,n,i,o){var w,_,C;var s;let c=i.head,d=!1,f=1,p=e.state.vim;if(p&&(!p.insertMode||e.state.overwrite)){if(d=!0,p.visualBlock&&!o)return null;i.anchor<i.head&&(c<n.state.doc.length&&n.state.sliceDoc(c,c+1))!=`
124
+ `+p,new ti(s,f.start),new ti(s,f.end))}c++}else if(o&&/\S/.test(d)&&s!=c){var y=e.getLine(s+1);if(y&&/\S/.test(y)){var w=d.replace(/\s+$/,""),_=y.replace(/^\s+/,""),C=w+" "+_,f=E(C,i,5);f&&f.start>w.length||C.length<i?(e.replaceRange(" ",new ti(s,w.length),new ti(s+1,y.length-_.length)),s--,c--):w.length<d.length&&e.replaceRange("",new ti(s,w.length),new ti(s,d.length))}}s++}return s;function E(I,$,V){if(!(I.length<$)){var F=I.slice(0,$),N=I.slice($),K=/^(?:(\s+)|(\S+)(\s+))/.exec(N),pe=/(?:(\s+)|(\s+)(\S+))$/.exec(F),P=0,A=0;if(pe&&!pe[2]&&(P=$-pe[1].length,A=$),K&&!K[2]&&(P||(P=$),A=$+K[1].length),P)return{start:P,end:A};if(pe&&pe[2]&&pe.index>V)return{start:pe.index,end:pe.index+pe[2].length};if(K&&K[2])return P=$+K[2].length,{start:P,end:P+K[3].length}}}}var Jd=I4||(function(){let e={cursorBlinkRate:1200};return function(){return e}})(),lC=class{constructor(e,n,i,o,s,c,d,f,p,y){this.left=e,this.top=n,this.height=i,this.fontFamily=o,this.fontSize=s,this.fontWeight=c,this.color=d,this.className=f,this.letter=p,this.partial=y}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",e.style.height=this.height+"px",e.style.lineHeight=this.height+"px",e.style.fontFamily=this.fontFamily,e.style.fontSize=this.fontSize,e.style.fontWeight=this.fontWeight,e.style.color=this.partial?"transparent":this.color,e.className=this.className,e.textContent=this.letter}eq(e){return this.left==e.left&&this.top==e.top&&this.height==e.height&&this.fontFamily==e.fontFamily&&this.fontSize==e.fontSize&&this.fontWeight==e.fontWeight&&this.color==e.color&&this.className==e.className&&this.letter==e.letter}},cC=class{constructor(e,n){this.view=e,this.rangePieces=[],this.cursors=[],this.cm=n,this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.cursorLayer=e.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer cm-vimCursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),e.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){let e=Jd(this.cm.cm6.state).cursorBlinkRate;this.cursorLayer.style.animationDuration=e+"ms"}update(e){(e.selectionSet||e.geometryChanged||e.viewportChanged)&&(this.view.requestMeasure(this.measureReq),this.cursorLayer.style.animationName=this.cursorLayer.style.animationName=="cm-blink"?"cm-blink2":"cm-blink"),uC(e)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:e}=this.view,n=[];for(let i of e.selection.ranges){let o=i==e.selection.main,s=pC(this.cm,this.view,i,o);s&&n.push(s)}return{cursors:n}}drawSel({cursors:e}){if(e.length!=this.cursors.length||e.some((n,i)=>!n.eq(this.cursors[i]))){let n=this.cursorLayer.children;if(n.length!==e.length){this.cursorLayer.textContent="";for(let i of e)this.cursorLayer.appendChild(i.draw())}else e.forEach((i,o)=>i.adjust(n[o]));this.cursors=e}}destroy(){this.cursorLayer.remove()}};function uC(e){return Jd(e.startState)!=Jd(e.state)}var dC=Pu.highest(Kt.theme({".cm-vimMode .cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-fat-cursor":{position:"absolute",background:"#ff9696",border:"none",whiteSpace:"pre"},"&:not(.cm-focused) .cm-fat-cursor":{background:"none",outline:"solid 1px #ff9696",color:"transparent !important"}}));function fC(e){let n=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==L4.LTR?n.left:n.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft*e.scaleX,top:n.top-e.scrollDOM.scrollTop*e.scaleY}}function pC(e,n,i,o){var w,_,C;var s;let c=i.head,d=!1,f=1,p=e.state.vim;if(p&&(!p.insertMode||e.state.overwrite)){if(d=!0,p.visualBlock&&!o)return null;i.anchor<i.head&&(c<n.state.doc.length&&n.state.sliceDoc(c,c+1))!=`
125
125
  `&&c--,e.state.overwrite?f=.2:p.status&&(f=.5)}if(d){let E=c<n.state.doc.length&&n.state.sliceDoc(c,c+1);E&&/[\uDC00-\uDFFF]/.test(E)&&c>1&&(c--,E=n.state.sliceDoc(c,c+1));let T=n.coordsAtPos(c,1);if(!T)return null;let I=fC(n),$=n.domAtPos(c),V=$?$.node:n.contentDOM;for(V instanceof Text&&$.offset>=V.data.length&&((w=V.parentElement)==null?void 0:w.nextSibling)&&(V=(_=V.parentElement)==null?void 0:_.nextSibling,$={node:V,offset:0});$&&$.node instanceof HTMLElement;)V=$.node,$={node:$.node.childNodes[$.offset],offset:0};if(!(V instanceof HTMLElement)){if(!V.parentNode)return null;V=V.parentNode}let F=getComputedStyle(V),N=T.left,K=(C=(s=n).coordsForChar)==null?void 0:C.call(s,c);if(K&&(N=K.left),!E||E==`
126
- `||E=="\r")E="\xA0";else if(E==" "){E="\xA0";var y=n.coordsAtPos(c+1,-1);y&&(N=y.left-(y.left-T.left)/parseInt(F.tabSize))}else/[\uD800-\uDBFF]/.test(E)&&c<n.state.doc.length-1&&(E+=n.state.sliceDoc(c+1,c+2));let pe=T.bottom-T.top;return new lC((N-I.left)/n.scaleX,(T.top-I.top+pe*(1-f))/n.scaleY,pe*f/n.scaleY,F.fontFamily,F.fontSize,F.fontWeight,F.color,o?"cm-fat-cursor cm-cursor-primary":"cm-fat-cursor cm-cursor-secondary",E,f!=1)}else return null}let Sy,Cy,Ey,Ty;Sy=typeof navigator<"u"&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent),$i=XS(Xe),Cy=250,Ey=Kt.baseTheme({".cm-vimMode .cm-cursorLayer:not(.cm-vimCursorLayer)":{display:"none"},".cm-vim-panel":{padding:"0px 10px",fontFamily:"monospace",minHeight:"1.3em",display:"flex"},".cm-vim-panel input":{border:"none",outline:"none",backgroundColor:"inherit"},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"}}),Ty=Ol.fromClass(class{constructor(e){this.status="",this.query=null,this.decorations=Hi.none,this.waitForCopy=!1,this.lastKeydown="",this.useNextTextInput=!1,this.compositionText="",this.view=e;let n=this.cm=new Xe(e);$i.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new cC(e,n),this.updateClass(),this.cm.on("vim-command-done",()=>{n.state.vim&&(n.state.vim.status=""),this.blockCursor.scheduleRedraw(),this.updateStatus()}),this.cm.on("vim-mode-change",i=>{n.state.vim&&(n.state.vim.mode=i.mode,i.subMode&&(n.state.vim.mode+=" block"),n.state.vim.status="",this.blockCursor.scheduleRedraw(),this.updateClass(),this.updateStatus())}),this.cm.on("dialog",()=>{this.cm.state.statusbar?this.updateStatus():e.dispatch({effects:Ry.of(!!this.cm.state.dialog)})}),this.dom=document.createElement("span"),this.spacer=document.createElement("span"),this.spacer.style.flex="1",this.statusButton=document.createElement("span"),this.statusButton.onclick=i=>{$i.handleKey(this.cm,"<Esc>","user"),this.cm.focus()},this.statusButton.style.cssText="cursor: pointer"}update(e){var n;if((e.viewportChanged||e.docChanged)&&this.query&&this.highlight(this.query),e.docChanged&&this.cm.onChange(e),e.selectionSet&&this.cm.onSelectionChange(),e.viewportChanged,this.cm.curOp&&!this.cm.curOp.isVimOp&&this.cm.onBeforeEndOperation(),e.transactions){for(let i of e.transactions)for(let o of i.effects)if(o.is(_h))if(!((n=o.value)!=null&&n.forVim))this.highlight(null);else{let s=o.value.create();this.highlight(s)}}this.blockCursor.update(e)}updateClass(){let e=this.cm.state;!e.vim||e.vim.insertMode&&!e.overwrite?this.view.scrollDOM.classList.remove("cm-vimMode"):this.view.scrollDOM.classList.add("cm-vimMode")}updateStatus(){let e=this.cm.state.statusbar,n=this.cm.state.vim;if(!e||!n)return;let i=this.cm.state.dialog;if(i)i.parentElement!=e&&(e.textContent="",e.appendChild(i));else{e.textContent="";var o=(n.mode||"normal").toUpperCase();n.insertModeReturn&&(o+="(C-O)"),this.statusButton.textContent=`--${o}--`,e.appendChild(this.statusButton),e.appendChild(this.spacer)}this.dom.textContent=n.status,e.appendChild(this.dom)}destroy(){$i.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=Hi.none;let{view:n}=this,i=new iw;for(let o=0,s=n.visibleRanges,c=s.length;o<c;o++){let{from:d,to:f}=s[o];for(;o<c-1&&f>s[o+1].from-2*Cy;)f=s[++o].to;e.highlight(n.state,d,f,(p,y)=>{i.add(p,y,mC)})}return this.decorations=i.finish()}handleKey(e,n){let i=this.cm,o=i.state.vim;if(!o)return;let s=$i.vimKeyFromEvent(e,o);if(Xe.signal(this.cm,"inputEvent",{type:"handleKey",key:s}),!s)return;if(s=="<Esc>"&&!o.insertMode&&!o.visualMode&&this.query){let d=o.searchState_;d&&(i.removeOverlay(d.getOverlay()),d.setOverlay(null))}if(s==="<C-c>"&&!Xe.isMac&&i.somethingSelected())return this.waitForCopy=!0,!0;o.status=(o.status||"")+s;let c=$i.multiSelectHandleKey(i,s,"user");return o=$i.maybeInitVimState_(i),!c&&o.insertMode&&i.state.overwrite&&(e.key&&e.key.length==1&&!/\n/.test(e.key)?(c=!0,i.overWriteSelection(e.key)):e.key=="Backspace"&&(c=!0,Xe.commands.cursorCharLeft(i))),c&&(Xe.signal(this.cm,"vim-keypress",s),e.preventDefault(),e.stopPropagation(),this.blockCursor.scheduleRedraw()),this.updateStatus(),!!c}},{eventHandlers:{copy:function(e,n){this.waitForCopy&&(this.waitForCopy=!1,Promise.resolve().then(()=>{var i=this.cm,o=i.state.vim;o&&(o.insertMode?i.setSelection(i.getCursor(),i.getCursor()):i.operation(()=>{i.curOp&&(i.curOp.isVimOp=!0),$i.handleKey(i,"<Esc>","user")}))}))},compositionstart:function(e,n){this.useNextTextInput=!0,Xe.signal(this.cm,"inputEvent",e)},compositionupdate:function(e,n){Xe.signal(this.cm,"inputEvent",e)},compositionend:function(e,n){Xe.signal(this.cm,"inputEvent",e)},keypress:function(e,n){Xe.signal(this.cm,"inputEvent",e),this.lastKeydown=="Dead"&&this.handleKey(e,n)},keydown:function(e,n){Xe.signal(this.cm,"inputEvent",e),this.lastKeydown=e.key,this.lastKeydown=="Unidentified"||this.lastKeydown=="Process"||this.lastKeydown=="Dead"?this.useNextTextInput=!0:(this.useNextTextInput=!1,this.handleKey(e,n))}},provide:()=>[Kt.inputHandler.of((e,n,i,o)=>{var w,_;var s=Al(e);if(!s)return!1;var c=(w=s.state)==null?void 0:w.vim,d=s.state.vimPlugin;if(c&&!c.insertMode&&!((_=s.curOp)!=null&&_.isVimOp)){if(o==="\0\0")return!0;if(Xe.signal(s,"inputEvent",{type:"text",text:o,from:n,to:i}),o.length==1&&d.useNextTextInput){if(c.expectLiteralNext&&e.composing)return d.compositionText=o,!1;if(d.compositionText){var f=d.compositionText;d.compositionText="";var p=e.state.selection.main.head;if(f===e.state.sliceDoc(p-f.length,p)){var y=s.getCursor();s.replaceRange("",s.posFromIndex(p-f.length),y)}}return d.handleKey({key:o,preventDefault:()=>{},stopPropagation:()=>{}}),hC(e),!0}}return!1})],decorations:e=>e.decorations});function hC(e){var n=e.scrollDOM.parentElement;if(n){if(Sy){e.contentDOM.textContent="\0\0",e.contentDOM.dispatchEvent(new CustomEvent("compositionend"));return}var i=e.scrollDOM.nextSibling,o=window.getSelection(),s=o&&{anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset};e.scrollDOM.remove(),n.insertBefore(e.scrollDOM,i);try{s&&o&&(o.setPosition(s.anchorNode,s.anchorOffset),s.focusNode&&o.extend(s.focusNode,s.focusOffset))}catch(c){console.error(c)}e.focus(),e.contentDOM.dispatchEvent(new CustomEvent("compositionend"))}}var mC=Hi.mark({class:"cm-searchMatch"}),Ry=Bi.define(),gC=xs.define({create:()=>!1,update(e,n){for(let i of n.effects)i.is(Ry)&&(e=i.value);return e},provide:e=>bh.from(e,n=>n?yC:null)});function yC(e){let n=document.createElement("div");n.className="cm-vim-panel";let i=e.cm;return i.state.dialog&&n.appendChild(i.state.dialog),{top:!1,dom:n}}function vC(e){let n=document.createElement("div");n.className="cm-vim-panel";let i=e.cm;return i.state.statusbar=n,i.state.vimPlugin.updateStatus(),{dom:n}}$_=function(e={}){return[Ey,Ty,dC,e.status?bh.of(vC):gC]},Al=function(e){return e.cm||null},Mh=function(e){let n=e.state.selection.main;return n.from===0&&n.to===0},Am=function(e,n=!1){let i=e.state.selection.main,o=e.state.doc.length;return n&&i.from===o-1&&i.to===o-1?!0:i.from===o&&i.to===o},s_=function(e){e&&e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length}})},c_=function(e){var n;return((n=Al(e))==null?void 0:n.state.vim)!=null},Hw=function(e){var i;let n=(i=Al(e))==null?void 0:i.state.vim;return n?!n.mode&&!n.insertMode&&!n.visualMode?!0:n.mode==="normal":!1},u_=function(e){e&&e.dispatch({selection:{anchor:0,head:e.state.doc.length}})};function Dy(e,n){if(!(n!=null&&n.length))return Hi.none;let i=new iw,o=e.facet(Wi),s=n.filter(c=>c.kind==="cell"&&c.cellId===o).sort((c,d)=>c.lineNumber-d.lineNumber);for(let c of s)try{let d=e.doc.line(c.lineNumber),f=Hi.line({class:"cm-error-line"});i.add(d.from,d.from,f)}catch(d){Se.debug("Invalid line number in error decoration",{error:d})}return i.finish()}function Oy(e,n){if(!(n!=null&&n.length))return;let i=e.state.facet(Wi),o=n.filter(d=>d.kind==="cell"&&d.cellId===i);if(o.length===0)return;let s=N4(e.state),c=[];for(let d of o)try{let f=e.state.doc.line(d.lineNumber);s.between(f.from,f.to,(p,y)=>{c.push(O4.of({from:p,to:y}))})}catch(f){Se.debug("Invalid line numbers",{error:f})}c.length>0&&e.dispatch({effects:c})}var bC=class{constructor(e,n){let i=n.get();this.decorations=Dy(e.state,i),Oy(e,i),this.unsubscribe=n.sub(o=>{let s=this.decorations.size;this.decorations=Dy(e.state,o),Oy(e,o),s!==this.decorations.size&&e.dispatch({userEvent:"marimo.error-decoration-update"})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function wC(e){return Ol.define(n=>new bC(n,e),{decorations:n=>n.decorations})}function _C(e){return[wC(e),Kt.theme({".cm-error-line":{backgroundColor:"color-mix(in srgb, var(--red-4) 40%, transparent)"},"&.cm-focused .cm-error-line.cm-activeLine":{backgroundColor:"color-mix(in srgb, var(--red-6) 40%, transparent)"}})]}function xC({cellId:e,hotkeys:n}){let i=[];return i.push(...Z2({key:n.getHotkey("cell.run").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).onRun(),!0)}),{key:n.getHotkey("cell.runAndNewBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(Pt);return s.onRun(),e==="__scratch__"||(o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})),!0}},...Z2({key:n.getHotkey("cell.runAndNewAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(Pt);return s.onRun(),e==="__scratch__"||(o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!0})),!0}}),{key:n.getHotkey("cell.aiCompletion").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).aiCellCompletion()&&o.contentDOM.focus(),!0)}),e!=="__scratch__"&&i.push({key:n.getHotkey("cell.goToDefinition").key,preventDefault:!0,stopPropagation:!0,run:o=>(sm(o),!0)},{key:n.getHotkey("cell.delete").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.doc.length===0&&o.state.facet(Pt).deleteCell(),!0)},{key:n.getHotkey("cell.moveUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.moveDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveCell({cellId:e,before:!1}),!0)},{key:n.getHotkey("cell.moveLeft").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveCell({cellId:e,before:!0,direction:"left"}),!0)},{key:n.getHotkey("cell.moveRight").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveCell({cellId:e,before:!1,direction:"right"}),!0)},{key:"ArrowUp",preventDefault:!0,stopPropagation:!0,run:o=>vw(o.state)?!1:Mh(o)?(o.state.facet(Pt).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0):!1},{key:"ArrowDown",preventDefault:!0,stopPropagation:!0,run:o=>vw(o.state)?!1:Am(o)?(o.state.facet(Pt).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0):!1},{key:n.getHotkey("cell.focusDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0)},{key:n.getHotkey("cell.focusUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0)},{key:n.getHotkey("cell.sendToBottom").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).sendToBottom({cellId:e}),!0)},{key:n.getHotkey("cell.sendToTop").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).sendToTop({cellId:e}),!0)},{key:n.getHotkey("cell.createAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(Pt).createNewCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.createBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(Pt).createNewCell({cellId:e,before:!1}),!0)},{key:n.getHotkey("cell.hideCode").key,preventDefault:!0,stopPropagation:!0,run:o=>{var c;let s=o.state.facet(Pt).toggleHideCode();return bw(o),s?(o.contentDOM.blur(),(c=document.getElementById(er.create(e)))==null||c.focus()):o.contentDOM.focus(),!0}},{key:n.getHotkey("cell.splitCell").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(Pt);return s.splitCell({cellId:e}),s.moveToNextCell&&requestAnimationFrame(()=>{o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})}),!0}}),[Mu.high(Ra.of(i))]}function kC(e){return[Kt.updateListener.of(n=>{if(n.docChanged){let i=n.transactions.some(d=>d.effects.some(f=>f.is(Ms))),o=Xr(n.view),s=n.view.state.facet(Pt),c=n.view.state.facet(Wi);s.updateCellCode({cellId:c,code:o,formattingChange:i})}}),kS(e)]}function SC({predicate:e}){return Kt.updateListener.of(n=>{n.docChanged&&n.view.hasFocus&&e()&&(n.transactions.some(i=>i.effects.some(o=>o.is(Ms)))||n.view.state.facet(Pt).onRun())})}t_=function({cellId:e,hotkeys:n,cellActions:i}){return[Pt.of(i),Wi.of(e),xC({cellId:e,hotkeys:n}),kC(n),_C(wS(pT(e),lt))]};const Py=async e=>{let n=e.state.doc.sliceString(0,e.pos),i=document.activeElement,o=null;if(i!==null){let d=er.findElement(i);d!==null&&(o=er.parse(d.id))}if(o===null)return Se.error("Failed to find active cell."),null;let s=await Iu.request({document:n,cellId:o});if(!s)return null;let c=Kd.asHoverTooltip({position:e.pos,message:s,limitToType:"tooltip"});return c&&lt.set(cd,{documentation:c.html??null}),c?null:Kd.asCompletionResult(e.pos,s)};function CC(e){return n=>e.predicate(n.state)?e.completion(n):null}var EC=async e=>{let n=e.matchBefore(/:\w*$/);if(!e.explicit&&!n)return null;let i=await TC();return{from:(n==null?void 0:n.from)??e.pos,options:i,validFor:/^[\w:]*$/}},TC=di(async()=>{let e=await fetch("https://unpkg.com/emojilib@3.0.11/dist/emoji-en-US.json").then(n=>{if(!n.ok)throw Error("Failed to fetch emoji list");return n.json()}).catch(()=>({}));return Object.entries(e).map(([n,i])=>({shortcode:i[0],label:i.map(o=>`:${o}`).join(" "),emoji:n,displayLabel:`${n} ${i[0].replaceAll("_"," ")}`,apply:n,type:"emoji"}))}),RC=async e=>{let n=e.matchBefore(/::[\w-:]*$/);if(!e.explicit&&!n)return null;let i=await DC();return{from:(n==null?void 0:n.from)??e.pos,options:i,validFor:/^[\w-:]*$/}},DC=di(async()=>{let e=await fetch("https://unpkg.com/lucide-static@0.452.0/tags.json").then(i=>{if(!i.ok)throw Error("Failed to fetch Lucide icon list");return i.json()}).catch(()=>({})),n=i=>`https://cdn.jsdelivr.net/npm/lucide-static@0.452.0/icons/${i}.svg`;return Object.entries(e).map(([i,o])=>({label:`::${i}`,displayLabel:i,type:"lucide-icon",boost:10,apply:`::lucide:${i}::`,detail:o.join(", "),info:()=>{let s=document.createElement("img");return s.src=n(i),s.style.width="24px",s.style.height="24px",s}}))}),OC=e=>{let n=e.matchBefore(/\\\w*$/);return!e.explicit&&!n?null:{from:(n==null?void 0:n.from)??e.pos,options:PC(),validFor:/^[\w\\]*$/}},PC=di(()=>[["alpha","\u03B1","Greek small letter alpha"],["beta","\u03B2","Greek small letter beta"],["gamma","\u03B3","Greek small letter gamma"],["delta","\u03B4","Greek small letter delta"],["epsilon","\u03B5","Greek small letter epsilon"],["zeta","\u03B6","Greek small letter zeta"],["eta","\u03B7","Greek small letter eta"],["theta","\u03B8","Greek small letter theta"],["iota","\u03B9","Greek small letter iota"],["kappa","\u03BA","Greek small letter kappa"],["lambda","\u03BB","Greek small letter lambda"],["mu","\u03BC","Greek small letter mu"],["nu","\u03BD","Greek small letter nu"],["xi","\u03BE","Greek small letter xi"],["omicron","\u03BF","Greek small letter omicron"],["pi","\u03C0","Greek small letter pi"],["rho","\u03C1","Greek small letter rho"],["sigma","\u03C3","Greek small letter sigma"],["tau","\u03C4","Greek small letter tau"],["upsilon","\u03C5","Greek small letter upsilon"],["phi","\u03C6","Greek small letter phi"],["chi","\u03C7","Greek small letter chi"],["psi","\u03C8","Greek small letter psi"],["omega","\u03C9","Greek small letter omega"],["Gamma","\u0393","Greek capital letter gamma"],["Delta","\u0394","Greek capital letter delta"],["Theta","\u0398","Greek capital letter theta"],["Lambda","\u039B","Greek capital letter lambda"],["Xi","\u039E","Greek capital letter xi"],["Pi","\u03A0","Greek capital letter pi"],["Sigma","\u03A3","Greek capital letter sigma"],["Phi","\u03A6","Greek capital letter phi"],["Psi","\u03A8","Greek capital letter psi"],["Omega","\u03A9","Greek capital letter omega"],["pm","\xB1","Plus-minus sign"],["mp","\u2213","Minus-plus sign"],["times","\xD7","Multiplication sign"],["div","\xF7","Division sign"],["cdot","\u22C5","Dot operator"],["ast","\u2217","Asterisk operator"],["star","\u22C6","Star operator"],["circ","\u2218","Ring operator"],["bullet","\u2022","Bullet"],["cap","\u2229","Intersection"],["cup","\u222A","Union"],["uplus","\u228E","Multiset union"],["sqcap","\u2293","Square cap"],["sqcup","\u2294","Square cup"],["vee","\u2228","Logical or"],["wedge","\u2227","Logical and"],["setminus","\u2216","Set minus"],["oplus","\u2295","Circled plus"],["ominus","\u2296","Circled minus"],["otimes","\u2297","Circled times"],["oslash","\u2298","Circled division slash"],["odot","\u2299","Circled dot operator"],["leq","\u2264","Less than or equal to"],["geq","\u2265","Greater than or equal to"],["equiv","\u2261","Identical to"],["prec","\u227A","Precedes"],["succ","\u227B","Succeeds"],["sim","\u223C","Tilde operator"],["perp","\u22A5","Up tack"],["mid","\u2223","Divides"],["parallel","\u2225","Parallel to"],["subset","\u2282","Subset of"],["supset","\u2283","Superset of"],["subseteq","\u2286","Subset of or equal to"],["supseteq","\u2287","Superset of or equal to"],["cong","\u2245","Approximately equal to"],["approx","\u2248","Almost equal to"],["neq","\u2260","Not equal to"],["ne","\u2260","Not equal to"],["propto","\u221D","Proportional to"],["leftarrow","\u2190","Leftward arrow"],["rightarrow","\u2192","Rightward arrow"],["Leftarrow","\u21D0","Leftward double arrow"],["Rightarrow","\u21D2","Rightward double arrow"],["leftrightarrow","\u2194","Left right arrow"],["Leftrightarrow","\u21D4","Left right double arrow"],["uparrow","\u2191","Upward arrow"],["downarrow","\u2193","Downward arrow"],["Uparrow","\u21D1","Upward double arrow"],["Downarrow","\u21D3","Downward double arrow"],["infty","\u221E","Infinity"],["nabla","\u2207","Nabla"],["partial","\u2202","Partial differential"],["forall","\u2200","For all"],["exists","\u2203","There exists"],["nexists","\u2204","There does not exist"],["emptyset","\u2205","Empty set"],["in","\u2208","Element of"],["notin","\u2209","Not an element of"],["sum","\u2211","N-ary summation"],["prod","\u220F","N-ary product"],["int","\u222B","Integral"],["oint","\u222E","Contour integral"],["sqrt","\u221A","Square root"],["hbar","\u210F","Planck constant over 2pi"],["ldots","\u2026","Horizontal ellipsis"],["cdots","\u22EF","Midline horizontal ellipsis"],["vdots","\u22EE","Vertical ellipsis"],["ddots","\u22F1","Down right diagonal ellipsis"]].map(([e,n,i])=>({label:`\\${e} ${i}`,displayLabel:e,type:"latex-symbol",boost:10,apply:`\\${e}`,info:()=>{let o=document.createElement("div");return o.textContent=`${n} ${i}`,o},detail:n})));const MC=[EC,RC,OC];var LC=100;function Io(e){return!e.state.selection.main.empty}function Xd({view:e,selection:n,markup:i}){let o=[],s=!0;for(let c=n.from;c<=n.to;c++)if(!e.state.doc.lineAt(c).text.startsWith(i)){s=!1;break}for(let c=n.from;c<=n.to;){let d=e.state.doc.lineAt(c),f=d.text.startsWith(i);s?o.push({from:d.from,to:d.from+i.length,insert:vo.of([""])}):(f&&o.push({from:d.from,to:d.from+i.length,insert:vo.of([""])}),o.push({from:d.from,insert:vo.of([i])})),c=d.to+1}return o}function Yd({view:e,range:n,markupAfter:i,markupBefore:o}){if(n.empty){let y=e.state.wordAt(n.head);y&&(n=y)}let s=e.state.sliceDoc(n.from-o.length,n.from)===o,c=e.state.sliceDoc(n.to,n.to+i.length)===i,d=[];d.push(s?{from:n.from-o.length,to:n.from,insert:vo.of([""])}:{from:n.from,insert:vo.of(o.split(`
126
+ `||E=="\r")E="\xA0";else if(E==" "){E="\xA0";var y=n.coordsAtPos(c+1,-1);y&&(N=y.left-(y.left-T.left)/parseInt(F.tabSize))}else/[\uD800-\uDBFF]/.test(E)&&c<n.state.doc.length-1&&(E+=n.state.sliceDoc(c+1,c+2));let pe=T.bottom-T.top;return new lC((N-I.left)/n.scaleX,(T.top-I.top+pe*(1-f))/n.scaleY,pe*f/n.scaleY,F.fontFamily,F.fontSize,F.fontWeight,F.color,o?"cm-fat-cursor cm-cursor-primary":"cm-fat-cursor cm-cursor-secondary",E,f!=1)}else return null}let Sy,Cy,Ey,Ty;Sy=typeof navigator<"u"&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent),$i=XS(Xe),Cy=250,Ey=Kt.baseTheme({".cm-vimMode .cm-cursorLayer:not(.cm-vimCursorLayer)":{display:"none"},".cm-vim-panel":{padding:"0px 10px",fontFamily:"monospace",minHeight:"1.3em",display:"flex"},".cm-vim-panel input":{border:"none",outline:"none",backgroundColor:"inherit"},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"}}),Ty=Ol.fromClass(class{constructor(e){this.status="",this.query=null,this.decorations=Hi.none,this.waitForCopy=!1,this.lastKeydown="",this.useNextTextInput=!1,this.compositionText="",this.view=e;let n=this.cm=new Xe(e);$i.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new cC(e,n),this.updateClass(),this.cm.on("vim-command-done",()=>{n.state.vim&&(n.state.vim.status=""),this.blockCursor.scheduleRedraw(),this.updateStatus()}),this.cm.on("vim-mode-change",i=>{n.state.vim&&(n.state.vim.mode=i.mode,i.subMode&&(n.state.vim.mode+=" block"),n.state.vim.status="",this.blockCursor.scheduleRedraw(),this.updateClass(),this.updateStatus())}),this.cm.on("dialog",()=>{this.cm.state.statusbar?this.updateStatus():e.dispatch({effects:Ry.of(!!this.cm.state.dialog)})}),this.dom=document.createElement("span"),this.spacer=document.createElement("span"),this.spacer.style.flex="1",this.statusButton=document.createElement("span"),this.statusButton.onclick=i=>{$i.handleKey(this.cm,"<Esc>","user"),this.cm.focus()},this.statusButton.style.cssText="cursor: pointer"}update(e){var n;if((e.viewportChanged||e.docChanged)&&this.query&&this.highlight(this.query),e.docChanged&&this.cm.onChange(e),e.selectionSet&&this.cm.onSelectionChange(),e.viewportChanged,this.cm.curOp&&!this.cm.curOp.isVimOp&&this.cm.onBeforeEndOperation(),e.transactions){for(let i of e.transactions)for(let o of i.effects)if(o.is(_h))if(!((n=o.value)!=null&&n.forVim))this.highlight(null);else{let s=o.value.create();this.highlight(s)}}this.blockCursor.update(e)}updateClass(){let e=this.cm.state;!e.vim||e.vim.insertMode&&!e.overwrite?this.view.scrollDOM.classList.remove("cm-vimMode"):this.view.scrollDOM.classList.add("cm-vimMode")}updateStatus(){let e=this.cm.state.statusbar,n=this.cm.state.vim;if(!e||!n)return;let i=this.cm.state.dialog;if(i)i.parentElement!=e&&(e.textContent="",e.appendChild(i));else{e.textContent="";var o=(n.mode||"normal").toUpperCase();n.insertModeReturn&&(o+="(C-O)"),this.statusButton.textContent=`--${o}--`,e.appendChild(this.statusButton),e.appendChild(this.spacer)}this.dom.textContent=n.status,e.appendChild(this.dom)}destroy(){$i.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=Hi.none;let{view:n}=this,i=new iw;for(let o=0,s=n.visibleRanges,c=s.length;o<c;o++){let{from:d,to:f}=s[o];for(;o<c-1&&f>s[o+1].from-2*Cy;)f=s[++o].to;e.highlight(n.state,d,f,(p,y)=>{i.add(p,y,mC)})}return this.decorations=i.finish()}handleKey(e,n){let i=this.cm,o=i.state.vim;if(!o)return;let s=$i.vimKeyFromEvent(e,o);if(Xe.signal(this.cm,"inputEvent",{type:"handleKey",key:s}),!s)return;if(s=="<Esc>"&&!o.insertMode&&!o.visualMode&&this.query){let d=o.searchState_;d&&(i.removeOverlay(d.getOverlay()),d.setOverlay(null))}if(s==="<C-c>"&&!Xe.isMac&&i.somethingSelected())return this.waitForCopy=!0,!0;o.status=(o.status||"")+s;let c=$i.multiSelectHandleKey(i,s,"user");return o=$i.maybeInitVimState_(i),!c&&o.insertMode&&i.state.overwrite&&(e.key&&e.key.length==1&&!/\n/.test(e.key)?(c=!0,i.overWriteSelection(e.key)):e.key=="Backspace"&&(c=!0,Xe.commands.cursorCharLeft(i))),c&&(Xe.signal(this.cm,"vim-keypress",s),e.preventDefault(),e.stopPropagation(),this.blockCursor.scheduleRedraw()),this.updateStatus(),!!c}},{eventHandlers:{copy:function(e,n){this.waitForCopy&&(this.waitForCopy=!1,Promise.resolve().then(()=>{var i=this.cm,o=i.state.vim;o&&(o.insertMode?i.setSelection(i.getCursor(),i.getCursor()):i.operation(()=>{i.curOp&&(i.curOp.isVimOp=!0),$i.handleKey(i,"<Esc>","user")}))}))},compositionstart:function(e,n){this.useNextTextInput=!0,Xe.signal(this.cm,"inputEvent",e)},compositionupdate:function(e,n){Xe.signal(this.cm,"inputEvent",e)},compositionend:function(e,n){Xe.signal(this.cm,"inputEvent",e)},keypress:function(e,n){Xe.signal(this.cm,"inputEvent",e),this.lastKeydown=="Dead"&&this.handleKey(e,n)},keydown:function(e,n){Xe.signal(this.cm,"inputEvent",e),this.lastKeydown=e.key,this.lastKeydown=="Unidentified"||this.lastKeydown=="Process"||this.lastKeydown=="Dead"?this.useNextTextInput=!0:(this.useNextTextInput=!1,this.handleKey(e,n))}},provide:()=>[Kt.inputHandler.of((e,n,i,o)=>{var w,_;var s=$l(e);if(!s)return!1;var c=(w=s.state)==null?void 0:w.vim,d=s.state.vimPlugin;if(c&&!c.insertMode&&!((_=s.curOp)!=null&&_.isVimOp)){if(o==="\0\0")return!0;if(Xe.signal(s,"inputEvent",{type:"text",text:o,from:n,to:i}),o.length==1&&d.useNextTextInput){if(c.expectLiteralNext&&e.composing)return d.compositionText=o,!1;if(d.compositionText){var f=d.compositionText;d.compositionText="";var p=e.state.selection.main.head;if(f===e.state.sliceDoc(p-f.length,p)){var y=s.getCursor();s.replaceRange("",s.posFromIndex(p-f.length),y)}}return d.handleKey({key:o,preventDefault:()=>{},stopPropagation:()=>{}}),hC(e),!0}}return!1})],decorations:e=>e.decorations});function hC(e){var n=e.scrollDOM.parentElement;if(n){if(Sy){e.contentDOM.textContent="\0\0",e.contentDOM.dispatchEvent(new CustomEvent("compositionend"));return}var i=e.scrollDOM.nextSibling,o=window.getSelection(),s=o&&{anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset};e.scrollDOM.remove(),n.insertBefore(e.scrollDOM,i);try{s&&o&&(o.setPosition(s.anchorNode,s.anchorOffset),s.focusNode&&o.extend(s.focusNode,s.focusOffset))}catch(c){console.error(c)}e.focus(),e.contentDOM.dispatchEvent(new CustomEvent("compositionend"))}}var mC=Hi.mark({class:"cm-searchMatch"}),Ry=Bi.define(),gC=xs.define({create:()=>!1,update(e,n){for(let i of n.effects)i.is(Ry)&&(e=i.value);return e},provide:e=>bh.from(e,n=>n?yC:null)});function yC(e){let n=document.createElement("div");n.className="cm-vim-panel";let i=e.cm;return i.state.dialog&&n.appendChild(i.state.dialog),{top:!1,dom:n}}function vC(e){let n=document.createElement("div");n.className="cm-vim-panel";let i=e.cm;return i.state.statusbar=n,i.state.vimPlugin.updateStatus(),{dom:n}}Uw=function(e={}){return[Ey,Ty,dC,e.status?bh.of(vC):gC]},$l=function(e){return e.cm||null},im=function(e){let n=e.state.selection.main;return n.from===0&&n.to===0},Mh=function(e,n=!1){let i=e.state.selection.main,o=e.state.doc.length;return n&&i.from===o-1&&i.to===o-1?!0:i.from===o&&i.to===o},c_=function(e){e&&e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length}})},$w=function(e){var n;return((n=$l(e))==null?void 0:n.state.vim)!=null},s_=function(e){var i;let n=(i=$l(e))==null?void 0:i.state.vim;return n?!n.mode&&!n.insertMode&&!n.visualMode?!0:n.mode==="normal":!1},Hw=function(e){e&&e.dispatch({selection:{anchor:0,head:e.state.doc.length}})};function Dy(e,n){if(!(n!=null&&n.length))return Hi.none;let i=new iw,o=e.facet(Wi),s=n.filter(c=>c.kind==="cell"&&c.cellId===o).sort((c,d)=>c.lineNumber-d.lineNumber);for(let c of s)try{let d=e.doc.line(c.lineNumber),f=Hi.line({class:"cm-error-line"});i.add(d.from,d.from,f)}catch(d){Se.debug("Invalid line number in error decoration",{error:d})}return i.finish()}function Oy(e,n){if(!(n!=null&&n.length))return;let i=e.state.facet(Wi),o=n.filter(d=>d.kind==="cell"&&d.cellId===i);if(o.length===0)return;let s=N4(e.state),c=[];for(let d of o)try{let f=e.state.doc.line(d.lineNumber);s.between(f.from,f.to,(p,y)=>{c.push(O4.of({from:p,to:y}))})}catch(f){Se.debug("Invalid line numbers",{error:f})}c.length>0&&e.dispatch({effects:c})}var bC=class{constructor(e,n){let i=n.get();this.decorations=Dy(e.state,i),Oy(e,i),this.unsubscribe=n.sub(o=>{let s=this.decorations.size;this.decorations=Dy(e.state,o),Oy(e,o),s!==this.decorations.size&&e.dispatch({userEvent:"marimo.error-decoration-update"})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function wC(e){return Ol.define(n=>new bC(n,e),{decorations:n=>n.decorations})}function _C(e){return[wC(e),Kt.theme({".cm-error-line":{backgroundColor:"color-mix(in srgb, var(--red-4) 40%, transparent)"},"&.cm-focused .cm-error-line.cm-activeLine":{backgroundColor:"color-mix(in srgb, var(--red-6) 40%, transparent)"}})]}function xC({cellId:e,hotkeys:n}){let i=[];return i.push(...Z2({key:n.getHotkey("cell.run").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).onRun(),!0)}),{key:n.getHotkey("cell.runAndNewBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(Pt);return s.onRun(),e==="__scratch__"||(o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})),!0}},...Z2({key:n.getHotkey("cell.runAndNewAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(Pt);return s.onRun(),e==="__scratch__"||(o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!0})),!0}}),{key:n.getHotkey("cell.aiCompletion").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).aiCellCompletion()&&o.contentDOM.focus(),!0)}),e!=="__scratch__"&&i.push({key:n.getHotkey("cell.goToDefinition").key,preventDefault:!0,stopPropagation:!0,run:o=>(pm(o),!0)},{key:n.getHotkey("cell.delete").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.doc.length===0&&o.state.facet(Pt).deleteCell(),!0)},{key:n.getHotkey("cell.moveUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.moveDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveCell({cellId:e,before:!1}),!0)},{key:n.getHotkey("cell.moveLeft").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveCell({cellId:e,before:!0,direction:"left"}),!0)},{key:n.getHotkey("cell.moveRight").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveCell({cellId:e,before:!1,direction:"right"}),!0)},{key:"ArrowUp",preventDefault:!0,stopPropagation:!0,run:o=>vw(o.state)?!1:im(o)?(o.state.facet(Pt).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0):!1},{key:"ArrowDown",preventDefault:!0,stopPropagation:!0,run:o=>vw(o.state)?!1:Mh(o)?(o.state.facet(Pt).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0):!1},{key:n.getHotkey("cell.focusDown").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0)},{key:n.getHotkey("cell.focusUp").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0)},{key:n.getHotkey("cell.sendToBottom").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).sendToBottom({cellId:e}),!0)},{key:n.getHotkey("cell.sendToTop").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.state.facet(Pt).sendToTop({cellId:e}),!0)},{key:n.getHotkey("cell.createAbove").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(Pt).createNewCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.createBelow").key,preventDefault:!0,stopPropagation:!0,run:o=>(o.contentDOM.blur(),o.state.facet(Pt).createNewCell({cellId:e,before:!1}),!0)},{key:n.getHotkey("cell.hideCode").key,preventDefault:!0,stopPropagation:!0,run:o=>{var c;let s=o.state.facet(Pt).toggleHideCode();return bw(o),s?(o.contentDOM.blur(),(c=document.getElementById(er.create(e)))==null||c.focus()):o.contentDOM.focus(),!0}},{key:n.getHotkey("cell.splitCell").key,preventDefault:!0,stopPropagation:!0,run:o=>{let s=o.state.facet(Pt);return s.splitCell({cellId:e}),s.moveToNextCell&&requestAnimationFrame(()=>{o.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})}),!0}}),[Pu.high(Ra.of(i))]}function kC(e){return[Kt.updateListener.of(n=>{if(n.docChanged){let i=n.transactions.some(d=>d.effects.some(f=>f.is(Ms))),o=Xr(n.view),s=n.view.state.facet(Pt),c=n.view.state.facet(Wi);s.updateCellCode({cellId:c,code:o,formattingChange:i})}}),kS(e)]}function SC({predicate:e}){return Kt.updateListener.of(n=>{n.docChanged&&n.view.hasFocus&&e()&&(n.transactions.some(i=>i.effects.some(o=>o.is(Ms)))||n.view.state.facet(Pt).onRun())})}dx=function({cellId:e,hotkeys:n,cellActions:i}){return[Pt.of(i),Wi.of(e),xC({cellId:e,hotkeys:n}),kC(n),_C(wS(pT(e),lt))]};const Py=async e=>{let n=e.state.doc.sliceString(0,e.pos),i=document.activeElement,o=null;if(i!==null){let d=er.findElement(i);d!==null&&(o=er.parse(d.id))}if(o===null)return Se.error("Failed to find active cell."),null;let s=await Qu.request({document:n,cellId:o});if(!s)return null;let c=Kd.asHoverTooltip({position:e.pos,message:s,limitToType:"tooltip"});return c&&lt.set(ed,{documentation:c.html??null}),c?null:Kd.asCompletionResult(e.pos,s)};function CC(e){return n=>e.predicate(n.state)?e.completion(n):null}var EC=async e=>{let n=e.matchBefore(/:\w*$/);if(!e.explicit&&!n)return null;let i=await TC();return{from:(n==null?void 0:n.from)??e.pos,options:i,validFor:/^[\w:]*$/}},TC=di(async()=>{let e=await fetch("https://unpkg.com/emojilib@3.0.11/dist/emoji-en-US.json").then(n=>{if(!n.ok)throw Error("Failed to fetch emoji list");return n.json()}).catch(()=>({}));return Object.entries(e).map(([n,i])=>({shortcode:i[0],label:i.map(o=>`:${o}`).join(" "),emoji:n,displayLabel:`${n} ${i[0].replaceAll("_"," ")}`,apply:n,type:"emoji"}))}),RC=async e=>{let n=e.matchBefore(/::[\w-:]*$/);if(!e.explicit&&!n)return null;let i=await DC();return{from:(n==null?void 0:n.from)??e.pos,options:i,validFor:/^[\w-:]*$/}},DC=di(async()=>{let e=await fetch("https://unpkg.com/lucide-static@0.452.0/tags.json").then(i=>{if(!i.ok)throw Error("Failed to fetch Lucide icon list");return i.json()}).catch(()=>({})),n=i=>`https://cdn.jsdelivr.net/npm/lucide-static@0.452.0/icons/${i}.svg`;return Object.entries(e).map(([i,o])=>({label:`::${i}`,displayLabel:i,type:"lucide-icon",boost:10,apply:`::lucide:${i}::`,detail:o.join(", "),info:()=>{let s=document.createElement("img");return s.src=n(i),s.style.width="24px",s.style.height="24px",s}}))}),OC=e=>{let n=e.matchBefore(/\\\w*$/);return!e.explicit&&!n?null:{from:(n==null?void 0:n.from)??e.pos,options:PC(),validFor:/^[\w\\]*$/}},PC=di(()=>[["alpha","\u03B1","Greek small letter alpha"],["beta","\u03B2","Greek small letter beta"],["gamma","\u03B3","Greek small letter gamma"],["delta","\u03B4","Greek small letter delta"],["epsilon","\u03B5","Greek small letter epsilon"],["zeta","\u03B6","Greek small letter zeta"],["eta","\u03B7","Greek small letter eta"],["theta","\u03B8","Greek small letter theta"],["iota","\u03B9","Greek small letter iota"],["kappa","\u03BA","Greek small letter kappa"],["lambda","\u03BB","Greek small letter lambda"],["mu","\u03BC","Greek small letter mu"],["nu","\u03BD","Greek small letter nu"],["xi","\u03BE","Greek small letter xi"],["omicron","\u03BF","Greek small letter omicron"],["pi","\u03C0","Greek small letter pi"],["rho","\u03C1","Greek small letter rho"],["sigma","\u03C3","Greek small letter sigma"],["tau","\u03C4","Greek small letter tau"],["upsilon","\u03C5","Greek small letter upsilon"],["phi","\u03C6","Greek small letter phi"],["chi","\u03C7","Greek small letter chi"],["psi","\u03C8","Greek small letter psi"],["omega","\u03C9","Greek small letter omega"],["Gamma","\u0393","Greek capital letter gamma"],["Delta","\u0394","Greek capital letter delta"],["Theta","\u0398","Greek capital letter theta"],["Lambda","\u039B","Greek capital letter lambda"],["Xi","\u039E","Greek capital letter xi"],["Pi","\u03A0","Greek capital letter pi"],["Sigma","\u03A3","Greek capital letter sigma"],["Phi","\u03A6","Greek capital letter phi"],["Psi","\u03A8","Greek capital letter psi"],["Omega","\u03A9","Greek capital letter omega"],["pm","\xB1","Plus-minus sign"],["mp","\u2213","Minus-plus sign"],["times","\xD7","Multiplication sign"],["div","\xF7","Division sign"],["cdot","\u22C5","Dot operator"],["ast","\u2217","Asterisk operator"],["star","\u22C6","Star operator"],["circ","\u2218","Ring operator"],["bullet","\u2022","Bullet"],["cap","\u2229","Intersection"],["cup","\u222A","Union"],["uplus","\u228E","Multiset union"],["sqcap","\u2293","Square cap"],["sqcup","\u2294","Square cup"],["vee","\u2228","Logical or"],["wedge","\u2227","Logical and"],["setminus","\u2216","Set minus"],["oplus","\u2295","Circled plus"],["ominus","\u2296","Circled minus"],["otimes","\u2297","Circled times"],["oslash","\u2298","Circled division slash"],["odot","\u2299","Circled dot operator"],["leq","\u2264","Less than or equal to"],["geq","\u2265","Greater than or equal to"],["equiv","\u2261","Identical to"],["prec","\u227A","Precedes"],["succ","\u227B","Succeeds"],["sim","\u223C","Tilde operator"],["perp","\u22A5","Up tack"],["mid","\u2223","Divides"],["parallel","\u2225","Parallel to"],["subset","\u2282","Subset of"],["supset","\u2283","Superset of"],["subseteq","\u2286","Subset of or equal to"],["supseteq","\u2287","Superset of or equal to"],["cong","\u2245","Approximately equal to"],["approx","\u2248","Almost equal to"],["neq","\u2260","Not equal to"],["ne","\u2260","Not equal to"],["propto","\u221D","Proportional to"],["leftarrow","\u2190","Leftward arrow"],["rightarrow","\u2192","Rightward arrow"],["Leftarrow","\u21D0","Leftward double arrow"],["Rightarrow","\u21D2","Rightward double arrow"],["leftrightarrow","\u2194","Left right arrow"],["Leftrightarrow","\u21D4","Left right double arrow"],["uparrow","\u2191","Upward arrow"],["downarrow","\u2193","Downward arrow"],["Uparrow","\u21D1","Upward double arrow"],["Downarrow","\u21D3","Downward double arrow"],["infty","\u221E","Infinity"],["nabla","\u2207","Nabla"],["partial","\u2202","Partial differential"],["forall","\u2200","For all"],["exists","\u2203","There exists"],["nexists","\u2204","There does not exist"],["emptyset","\u2205","Empty set"],["in","\u2208","Element of"],["notin","\u2209","Not an element of"],["sum","\u2211","N-ary summation"],["prod","\u220F","N-ary product"],["int","\u222B","Integral"],["oint","\u222E","Contour integral"],["sqrt","\u221A","Square root"],["hbar","\u210F","Planck constant over 2pi"],["ldots","\u2026","Horizontal ellipsis"],["cdots","\u22EF","Midline horizontal ellipsis"],["vdots","\u22EE","Vertical ellipsis"],["ddots","\u22F1","Down right diagonal ellipsis"]].map(([e,n,i])=>({label:`\\${e} ${i}`,displayLabel:e,type:"latex-symbol",boost:10,apply:`\\${e}`,info:()=>{let o=document.createElement("div");return o.textContent=`${n} ${i}`,o},detail:n})));const MC=[EC,RC,OC];var LC=100;function Io(e){return!e.state.selection.main.empty}function Xd({view:e,selection:n,markup:i}){let o=[],s=!0;for(let c=n.from;c<=n.to;c++)if(!e.state.doc.lineAt(c).text.startsWith(i)){s=!1;break}for(let c=n.from;c<=n.to;){let d=e.state.doc.lineAt(c),f=d.text.startsWith(i);s?o.push({from:d.from,to:d.from+i.length,insert:vo.of([""])}):(f&&o.push({from:d.from,to:d.from+i.length,insert:vo.of([""])}),o.push({from:d.from,insert:vo.of([i])})),c=d.to+1}return o}function Yd({view:e,range:n,markupAfter:i,markupBefore:o}){if(n.empty){let y=e.state.wordAt(n.head);y&&(n=y)}let s=e.state.sliceDoc(n.from-o.length,n.from)===o,c=e.state.sliceDoc(n.to,n.to+i.length)===i,d=[];d.push(s?{from:n.from-o.length,to:n.from,insert:vo.of([""])}:{from:n.from,insert:vo.of(o.split(`
127
127
  `))},c?{from:n.to,to:n.to+i.length,insert:vo.of([""])}:{from:n.to,insert:vo.of(i.split(`
128
- `))});let f=s?-o.length:o.length,p=c?-i.length:i.length;return{changes:d,range:mn.range(n.from+f,n.to+p)}}function NC(e){if(!Io(e))return!1;let n=Xd({view:e,selection:e.state.selection.main,markup:"> "});return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function IC(e){if(!Io(e))return!1;let n=e.state.changeByRange(i=>{if(i.empty){let o=e.state.wordAt(i.head);o&&(i=o)}return Yd({view:e,range:i,markupBefore:"**",markupAfter:"**"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")})),e.focus(),!0}function My(e){if(!Io(e))return!1;let n=e.state.changeByRange(i=>{if(i.empty){let s=e.state.wordAt(i.head);s&&(i=s)}let o=e.state.doc.lineAt(i.from).number!==e.state.doc.lineAt(i.to).number;return Yd({view:e,range:i,markupBefore:o?"```\n":"`",markupAfter:o?"\n```":"`"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")})),e.focus(),!0}function AC(e){let n=e.state.changeByRange(i=>{if(i.empty){let o=e.state.wordAt(i.head);o&&(i=o)}return Yd({view:e,range:i,markupBefore:"_",markupAfter:"_"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")})),e.focus(),!0}function Ly(e,n="http://"){if(!Io(e))return!1;let i=e.state.changeByRange(s=>{let c=e.state.sliceDoc(s.from,s.to);return{changes:[{from:s.from,to:s.to,insert:`[${c}](${n})`}],range:s}});e.dispatch(e.state.update(i,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")}));let{to:o}=i.selection.main;try{e.dispatch({selection:mn.create([mn.range(o+3,o+3+n.length),mn.cursor(o+3+n.length)])})}catch{}return e.focus(),!0}Hh=async function(e,n){var f;let i=new FileReader,o=await new Promise(p=>{i.onload=()=>p(i.result),i.readAsDataURL(n)}),s;try{if(o.startsWith("data:")){let p=o.split(",")[1],y=prompt("We can save your image as a file. Enter a filename.",n.name),w=n.type.split("/")[1];if(y===null){let _=Math.round(o.length/1024);if(_>LC){Ll({title:"Content too large",description:`The content size is ${_} KB, which is too large to paste directly into the document.`});return}}else{y.trim()===""?y=n.name:y.endsWith(`.${w}`)||(y=`${y}.${w}`);let _=lt.get(Cs),C=_?Rh.dirname(_):null,E=C?`${C}/public`:"public",T=await Vi().sendCreateFileOrFolder({path:E,type:"file",name:y,contents:p});T.success?(s=(f=T.info)==null?void 0:f.path,s&&C&&s.startsWith(C)&&(s=Rh.rest(s,C)),Ll({title:"Image uploaded successfully",description:`We've uploaded your image at ${s}`})):Ll({title:"Failed to upload image. Using raw base64 string."})}}}catch{Ll({title:"Failed to upload image. Using raw base64 string."})}let c=e.state.changeByRange(p=>{let y=e.state.sliceDoc(p.from,p.to);return y.trim()===""&&(y="alt"),{changes:[{from:p.from,to:p.to,insert:`![${y}](${s??o})`}],range:p}});e.dispatch(e.state.update(c,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")}));let{to:d}=c.selection.main;try{e.dispatch({selection:mn.create([mn.range(d+4,d+4+o.length),mn.cursor(d+4+o.length)])})}catch{}return e.focus(),!0},Qh=async function(e,n){let i=await n.text(),o=e.state.changeByRange(s=>({changes:[{from:s.from,to:s.from,insert:i}],range:s}));return e.dispatch(e.state.update(o,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")})),e.focus(),!0};function qC(e){if(!Io(e))return!1;let{changes:n}=e.state.changeByRange(i=>({range:i,changes:Xd({view:e,selection:i,markup:e.state.sliceDoc(i.from,i.to+2).startsWith("* ")?"* ":"- "})}));return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function jC(e){if(!Io(e))return!1;let{changes:n}=e.state.changeByRange(i=>({range:i,changes:Xd({view:e,selection:i,markup:"1. "})}));return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function zC(e){return[Mu.highest(Ra.of([{key:e.getHotkey("markdown.bold").key,stopPropagation:!0,run:IC},{key:e.getHotkey("markdown.italic").key,stopPropagation:!0,run:AC},{key:e.getHotkey("markdown.link").key,stopPropagation:!0,run:n=>Ly(n)},{key:e.getHotkey("markdown.orderedList").key,run:jC},{key:e.getHotkey("markdown.unorderedList").key,run:qC},{key:e.getHotkey("markdown.blockquote").key,run:NC},{key:e.getHotkey("markdown.code").key,run:My},{key:"`",run:My}])),Kt.domEventHandlers({paste:(n,i)=>{var s;if(i.state.selection.main.empty)return!1;let o=(s=n.clipboardData)==null?void 0:s.getData("text/plain");o!=null&&o.startsWith("http")&&(n.preventDefault(),Ly(i,o))}}),Kt.domEventHandlers({paste:(n,i)=>{var s;let o=(s=n.clipboardData)==null?void 0:s.files[0];if(!o)return!1;if(o.type.startsWith("image/"))return n.preventDefault(),Hh(i,o),!0;if(o.type.startsWith("text/"))return n.preventDefault(),Qh(i,o),!0}})]}function FC(e,n,i=3,o=""){return Object.values(e).flatMap(s=>n.has(s.name)?[]:{label:`${o}${s.name}`,displayLabel:s.name,detail:s.dataType??"",boost:i,type:"variable",apply:`${o}${s.name}`,section:"Variable",info:()=>Ah(s)})}Ah=function(e){let n=document.createElement("div");n.classList.add("mo-cm-tooltip","docs-documentation","min-w-[200px]","flex","flex-col","gap-1","p-2");let i=document.createElement("div");i.classList.add("flex","items-center","gap-2");let o=document.createElement("span");if(o.classList.add("font-bold","text-base"),o.textContent=e.name,i.append(o),e.dataType){let s=document.createElement("span");s.classList.add("text-xs","px-1.5","py-0.5","rounded-full","bg-purple-100","text-purple-800","dark:bg-purple-900","dark:text-purple-200"),s.textContent=e.dataType,i.append(s)}if(n.append(i),e.value){let s=document.createElement("div");s.classList.add("flex","flex-col","gap-1");let c=document.createElement("div");c.classList.add("text-xs","text-muted-foreground"),c.textContent="Value:",s.append(c);let d=document.createElement("div");d.classList.add("text-xs","font-mono","bg-muted","p-2","rounded","overflow-auto","max-h-40"),d.textContent=e.value,s.append(d),n.append(s)}return n};var Ao="Python",Zd=123,Ny=125,ef=1,BC={mark:`${Ao}Mark`,resolve:Ao};function HC(e,n){return{defineNodes:[{name:Ao,style:Ou.emphasis},{name:`${Ao}Mark`,style:Ou.processingInstruction}],parseInline:[{name:Ao,parse(i,o,s){return!n()||o!==Zd&&o!==Ny||o===Zd&&i.slice(s-1,s)==="{"?-1:i.addDelimiter(BC,s,s+ef,o===Zd,o===Ny)}}],wrap:dw(i=>{if(!n()||i.type.name!==Ao)return null;let o=i.from+ef,s=i.to-ef;return o>=s||o<0||s<0?null:{parser:e,overlay:[{from:o,to:s}],extensions:[kw().support]}})}}const VC=e=>{let n=e.state.doc.sliceString(0,e.pos),i=n.lastIndexOf("{");if(n.at(i-1)==="{"||i===-1||n.indexOf("}",i)>i)return null;let o=e.matchBefore(/\w*$/);if(!o)return null;let s=FC(lt.get(La),new Set,99);return{from:o.from,options:s,validFor:/^\w*$/}};var sc="InlineMathDollar",qo="InlineMathBracket",lc="BlockMathDollar",jo="BlockMathBracket",Ba={[sc]:1,[qo]:3,[lc]:2,[jo]:3},At={DOLLAR:36,BACKSLASH:92,OPEN_PAREN:40,CLOSE_PAREN:41,OPEN_BRACKET:91,CLOSE_BRACKET:93},zo=Object.keys(Ba).reduce((e,n)=>(e[n]={mark:`${n}Mark`,resolve:n},e),{});function $C(e){let n=[];return Object.keys(Ba).forEach(i=>{n.push({name:i,style:Ou.emphasis},{name:`${i}Mark`,style:Ou.processingInstruction})}),{defineNodes:n,parseInline:[{name:lc,parse(i,o,s){return o!==At.DOLLAR||i.char(s+1)!==At.DOLLAR?-1:i.addDelimiter(zo[lc],s,s+Ba[lc],!0,!0)}},{name:sc,parse(i,o,s){return o!==At.DOLLAR||i.char(s+1)===At.DOLLAR?-1:i.addDelimiter(zo[sc],s,s+Ba[sc],!0,!0)}},{name:qo,before:"Escape",parse(i,o,s){return o!==At.BACKSLASH||i.char(s+1)!==At.BACKSLASH||![At.OPEN_PAREN,At.CLOSE_PAREN].includes(i.char(s+2))?-1:i.addDelimiter(zo[qo],s,s+Ba[qo],i.char(s+2)===At.OPEN_PAREN,i.char(s+2)===At.CLOSE_PAREN)}},{name:jo,before:"Escape",parse(i,o,s){return o!==At.BACKSLASH||i.char(s+1)!==At.BACKSLASH||![At.OPEN_BRACKET,At.CLOSE_BRACKET].includes(i.char(s+2))?-1:i.addDelimiter(zo[jo],s,s+Ba[jo],i.char(s+2)===At.OPEN_BRACKET,i.char(s+2)===At.CLOSE_BRACKET)}},{name:qo,before:"Escape",parse(i,o,s){return o!==At.BACKSLASH||![At.OPEN_PAREN,At.CLOSE_PAREN].includes(i.char(s+1))?-1:i.addDelimiter(zo[qo],s,s+2,i.char(s+1)===At.OPEN_PAREN,i.char(s+1)===At.CLOSE_PAREN)}},{name:jo,before:"Escape",parse(i,o,s){return o!==At.BACKSLASH||![At.OPEN_BRACKET,At.CLOSE_BRACKET].includes(i.char(s+1))?-1:i.addDelimiter(zo[jo],s,s+2,i.char(s+1)===At.OPEN_BRACKET,i.char(s+1)===At.CLOSE_BRACKET)}}],wrap:dw(i=>{let o=Ba[i.type.name];if(o){let s=i.from+o,c=i.to-o;return s>=c||s<0||c<0?null:{parser:e,overlay:[{from:s,to:c}]}}return null})}}Fu=Bi.define(),Hu=Bi.define(),fi=xs.define({create:()=>({}),update:(e,n)=>{for(let i of n.effects){if(i.is(Fu))return i.value;if(i.is(Hu))return{...e,...i.value}}return e}}),nd=class{constructor(){ke(this,"parser",new Zg);ke(this,"type","markdown");ke(this,"defaultCode",this.parser.defaultCode);ke(this,"defaultMetadata",this.parser.defaultMetadata)}static fromMarkdown(e){return Zg.fromMarkdown(e)}transformIn(e){let n=this.parser.transformIn(e);return[n.code,n.offset,n.metadata]}transformOut(e,n){let i=this.parser.transformOut(e,n);return[i.code,i.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,i,o){let s=xw().language.data,c,d=()=>{var p;if(!c)return!0;let f=c==null?void 0:c.state.field(fi);return f===void 0?!1:((p=f.quotePrefix)==null?void 0:p.includes("f"))??!1};return[Ol.define(f=>(c=f,{})),xw({base:xD,codeLanguages:Gk,extensions:[$C(uw.define(ED).parser),HC(Th.parser,d)]}),zC(i),MC.map(f=>s.of({autocomplete:f})),kw().language.data.of({autocomplete:CC({completion:Py,predicate:d})}),Lu({defaultKeymap:!1,activateOnTyping:!0}),SC({predicate:()=>!d()})]}};function Iy(){return`file://${Bl()??"/__marimo_notebook__.py"}`}function tf(){return`file://${Rh.dirname(Bl()??"/")}`}function WC(e){return ui.filter(e,n=>n!==!1&&n!==null)}function Ay(e){let n=e.map(WC);return Object.assign({},...n)}var UC=class{constructor(e){ke(this,"clients",[]);this.clients=e,this.documentUri=Iy()}onNotification(e){let n=[];for(let i of this.clients)n.push(i.onNotification(e));return()=>{for(let i of n)i();return!0}}get clientCapabilities(){return Ay(this.clients.map(e=>{if(e.clientCapabilities)return typeof e.clientCapabilities=="function"?e.clientCapabilities({}):e.clientCapabilities}).filter(e=>e!=null))}get ready(){return this.clients.some(e=>e.ready)}set ready(e){this.clients.forEach(n=>{n.ready=e})}get capabilities(){return Ay(this.clients.map(e=>e.capabilities).filter(e=>e!==null))}set capabilities(e){this.clients.forEach(n=>{n.capabilities=e})}get initializePromise(){return this.clients[0].initializePromise}set initializePromise(e){this.clients.forEach(n=>{n.initializePromise=e})}firstWithCapability(e){return this.clients.find(n=>{var i;return(i=n.capabilities)==null?void 0:i[e]})}clientsWithCapability(e){return this.clients.filter(n=>{var i;return(i=n.capabilities)==null?void 0:i[e]})}async initialize(){await Promise.all(this.clients.map(e=>e.initialize()))}async close(){await Promise.all(this.clients.map(e=>e.close()))}async textDocumentDidChange(e){return await Promise.all(this.clients.map(n=>n.textDocumentDidChange(e))),e}async completionItemResolve(e){let n=this.firstWithCapability("completionProvider");return n?n.completionItemResolve(e):e}async textDocumentCodeAction(e){let n=this.firstWithCapability("codeActionProvider");return n?n.textDocumentCodeAction(e):null}async textDocumentRename(e){let n=this.firstWithCapability("renameProvider");return n?n.textDocumentRename(e):null}async textDocumentPrepareRename(e){let n=this.firstWithCapability("renameProvider");return n?n.textDocumentPrepareRename(e):null}async textDocumentSignatureHelp(e){let n=this.firstWithCapability("signatureHelpProvider");return n?n.textDocumentSignatureHelp(e):null}async textDocumentCompletion(e){let n=this.clientsWithCapability("completionProvider");return KC(await Promise.allSettled(n.map(i=>i.textDocumentCompletion(e))))}async textDocumentDefinition(e){let n=this.firstWithCapability("definitionProvider");return n?n.textDocumentDefinition(e):null}async textDocumentDidOpen(e){return await Promise.all(this.clients.map(n=>n.textDocumentDidOpen(e))),e}async textDocumentHover(e){var n;for(let i of this.clients){if(!((n=i.capabilities)!=null&&n.hoverProvider))continue;let o=await i.textDocumentHover(e);if(o)return o}return{contents:[]}}};function KC(e){let n=[],i=!1;for(let o of e)if(o.status==="fulfilled"){let s=o.value;if(s==null)continue;Array.isArray(s)&&n.push(...s),"items"in s&&(n.push(...s.items),i||(i=s.isIncomplete))}return{items:n,isIncomplete:i}}Ow=function(e){return[...QC(e),e].join(`
129
- `)};function QC(e){return Pm().map(n=>{let i=Xr(n);return i===e?null:i}).filter(Boolean).sort((n,i)=>n.startsWith("import")&&!i.startsWith("import")?-1:!n.startsWith("import")&&i.startsWith("import")?1:0)}var GC=ze(e=>{let n=e(bt);return ui.fromEntries(n.cellIds.inOrderIds.map(i=>{let o=n.cellHandles[i];return[i,o!=null&&o.current?Xr(o.current.editorView):""]}))}),JC=ze(e=>e(bt).cellIds.inOrderIds),XC=ze(e=>ZC(e(JC),e(La)));const YC=ze(e=>({cellIds:e(XC),codes:e(GC)}));function ZC(e,n){var p,y;let i=new Map;e.forEach(w=>i.set(w,[]));let o=new Set(e),s=new Set(e);for(let{declaredBy:w,usedBy:_}of Object.values(n))for(let C of w){o.delete(C);for(let E of _)s.delete(E),E!==C&&((p=i.get(C))==null||p.push(E))}let c=new Map;e.forEach(w=>c.set(w,0)),i.forEach(w=>{w.forEach(_=>{c.set(_,(c.get(_)||0)+1)})});let d=[];c.forEach((w,_)=>{w===0&&d.push(_)});let f=[];for(;d.length>0;){let w=d.shift();if(!w)break;f.push(w),(y=i.get(w))==null||y.forEach(_=>{c.set(_,(c.get(_)||0)-1),c.get(_)===0&&d.push(_)})}return[...f.filter(w=>!o.has(w)),...o]}function eE(e,n){let i=new Map,o=0;e.forEach(d=>{i.set(d,o),o+=n[d].split(`
128
+ `))});let f=s?-o.length:o.length,p=c?-i.length:i.length;return{changes:d,range:mn.range(n.from+f,n.to+p)}}function NC(e){if(!Io(e))return!1;let n=Xd({view:e,selection:e.state.selection.main,markup:"> "});return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function IC(e){if(!Io(e))return!1;let n=e.state.changeByRange(i=>{if(i.empty){let o=e.state.wordAt(i.head);o&&(i=o)}return Yd({view:e,range:i,markupBefore:"**",markupAfter:"**"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")})),e.focus(),!0}function My(e){if(!Io(e))return!1;let n=e.state.changeByRange(i=>{if(i.empty){let s=e.state.wordAt(i.head);s&&(i=s)}let o=e.state.doc.lineAt(i.from).number!==e.state.doc.lineAt(i.to).number;return Yd({view:e,range:i,markupBefore:o?"```\n":"`",markupAfter:o?"\n```":"`"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")})),e.focus(),!0}function AC(e){let n=e.state.changeByRange(i=>{if(i.empty){let o=e.state.wordAt(i.head);o&&(i=o)}return Yd({view:e,range:i,markupBefore:"_",markupAfter:"_"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")})),e.focus(),!0}function Ly(e,n="http://"){if(!Io(e))return!1;let i=e.state.changeByRange(s=>{let c=e.state.sliceDoc(s.from,s.to);return{changes:[{from:s.from,to:s.to,insert:`[${c}](${n})`}],range:s}});e.dispatch(e.state.update(i,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")}));let{to:o}=i.selection.main;try{e.dispatch({selection:mn.create([mn.range(o+3,o+3+n.length),mn.cursor(o+3+n.length)])})}catch{}return e.focus(),!0}Kh=async function(e,n){var f;let i=new FileReader,o=await new Promise(p=>{i.onload=()=>p(i.result),i.readAsDataURL(n)}),s;try{if(o.startsWith("data:")){let p=o.split(",")[1],y=prompt("We can save your image as a file. Enter a filename.",n.name),w=n.type.split("/")[1];if(y===null){let _=Math.round(o.length/1024);if(_>LC){Ll({title:"Content too large",description:`The content size is ${_} KB, which is too large to paste directly into the document.`});return}}else{y.trim()===""?y=n.name:y.endsWith(`.${w}`)||(y=`${y}.${w}`);let _=lt.get(Cs),C=_?Rh.dirname(_):null,E=C?`${C}/public`:"public",T=await Vi().sendCreateFileOrFolder({path:E,type:"file",name:y,contents:p});T.success?(s=(f=T.info)==null?void 0:f.path,s&&C&&s.startsWith(C)&&(s=Rh.rest(s,C)),Ll({title:"Image uploaded successfully",description:`We've uploaded your image at ${s}`})):Ll({title:"Failed to upload image. Using raw base64 string."})}}}catch{Ll({title:"Failed to upload image. Using raw base64 string."})}let c=e.state.changeByRange(p=>{let y=e.state.sliceDoc(p.from,p.to);return y.trim()===""&&(y="alt"),{changes:[{from:p.from,to:p.to,insert:`![${y}](${s??o})`}],range:p}});e.dispatch(e.state.update(c,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")}));let{to:d}=c.selection.main;try{e.dispatch({selection:mn.create([mn.range(d+4,d+4+o.length),mn.cursor(d+4+o.length)])})}catch{}return e.focus(),!0},em=async function(e,n){let i=await n.text(),o=e.state.changeByRange(s=>({changes:[{from:s.from,to:s.from,insert:i}],range:s}));return e.dispatch(e.state.update(o,{scrollIntoView:!0,annotations:Ss.userEvent.of("input")})),e.focus(),!0};function qC(e){if(!Io(e))return!1;let{changes:n}=e.state.changeByRange(i=>({range:i,changes:Xd({view:e,selection:i,markup:e.state.sliceDoc(i.from,i.to+2).startsWith("* ")?"* ":"- "})}));return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function jC(e){if(!Io(e))return!1;let{changes:n}=e.state.changeByRange(i=>({range:i,changes:Xd({view:e,selection:i,markup:"1. "})}));return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function zC(e){return[Pu.highest(Ra.of([{key:e.getHotkey("markdown.bold").key,stopPropagation:!0,run:IC},{key:e.getHotkey("markdown.italic").key,stopPropagation:!0,run:AC},{key:e.getHotkey("markdown.link").key,stopPropagation:!0,run:n=>Ly(n)},{key:e.getHotkey("markdown.orderedList").key,run:jC},{key:e.getHotkey("markdown.unorderedList").key,run:qC},{key:e.getHotkey("markdown.blockquote").key,run:NC},{key:e.getHotkey("markdown.code").key,run:My},{key:"`",run:My}])),Kt.domEventHandlers({paste:(n,i)=>{var s;if(i.state.selection.main.empty)return!1;let o=(s=n.clipboardData)==null?void 0:s.getData("text/plain");o!=null&&o.startsWith("http")&&(n.preventDefault(),Ly(i,o))}}),Kt.domEventHandlers({paste:(n,i)=>{var s;let o=(s=n.clipboardData)==null?void 0:s.files[0];if(!o)return!1;if(o.type.startsWith("image/"))return n.preventDefault(),Kh(i,o),!0;if(o.type.startsWith("text/"))return n.preventDefault(),em(i,o),!0}})]}function FC(e,n,i=3,o=""){return Object.values(e).flatMap(s=>n.has(s.name)?[]:{label:`${o}${s.name}`,displayLabel:s.name,detail:s.dataType??"",boost:i,type:"variable",apply:`${o}${s.name}`,section:"Variable",info:()=>Bh(s)})}Bh=function(e){let n=document.createElement("div");n.classList.add("mo-cm-tooltip","docs-documentation","min-w-[200px]","flex","flex-col","gap-1","p-2");let i=document.createElement("div");i.classList.add("flex","items-center","gap-2");let o=document.createElement("span");if(o.classList.add("font-bold","text-base"),o.textContent=e.name,i.append(o),e.dataType){let s=document.createElement("span");s.classList.add("text-xs","px-1.5","py-0.5","rounded-full","bg-purple-100","text-purple-800","dark:bg-purple-900","dark:text-purple-200"),s.textContent=e.dataType,i.append(s)}if(n.append(i),e.value){let s=document.createElement("div");s.classList.add("flex","flex-col","gap-1");let c=document.createElement("div");c.classList.add("text-xs","text-muted-foreground"),c.textContent="Value:",s.append(c);let d=document.createElement("div");d.classList.add("text-xs","font-mono","bg-muted","p-2","rounded","overflow-auto","max-h-40"),d.textContent=e.value,s.append(d),n.append(s)}return n};var Ao="Python",Zd=123,Ny=125,ef=1,BC={mark:`${Ao}Mark`,resolve:Ao};function HC(e,n){return{defineNodes:[{name:Ao,style:Du.emphasis},{name:`${Ao}Mark`,style:Du.processingInstruction}],parseInline:[{name:Ao,parse(i,o,s){return!n()||o!==Zd&&o!==Ny||o===Zd&&i.slice(s-1,s)==="{"?-1:i.addDelimiter(BC,s,s+ef,o===Zd,o===Ny)}}],wrap:dw(i=>{if(!n()||i.type.name!==Ao)return null;let o=i.from+ef,s=i.to-ef;return o>=s||o<0||s<0?null:{parser:e,overlay:[{from:o,to:s}],extensions:[kw().support]}})}}const VC=e=>{let n=e.state.doc.sliceString(0,e.pos),i=n.lastIndexOf("{");if(n.at(i-1)==="{"||i===-1||n.indexOf("}",i)>i)return null;let o=e.matchBefore(/\w*$/);if(!o)return null;let s=FC(lt.get(La),new Set,99);return{from:o.from,options:s,validFor:/^\w*$/}};var oc="InlineMathDollar",qo="InlineMathBracket",sc="BlockMathDollar",jo="BlockMathBracket",Ba={[oc]:1,[qo]:3,[sc]:2,[jo]:3},At={DOLLAR:36,BACKSLASH:92,OPEN_PAREN:40,CLOSE_PAREN:41,OPEN_BRACKET:91,CLOSE_BRACKET:93},zo=Object.keys(Ba).reduce((e,n)=>(e[n]={mark:`${n}Mark`,resolve:n},e),{});function $C(e){let n=[];return Object.keys(Ba).forEach(i=>{n.push({name:i,style:Du.emphasis},{name:`${i}Mark`,style:Du.processingInstruction})}),{defineNodes:n,parseInline:[{name:sc,parse(i,o,s){return o!==At.DOLLAR||i.char(s+1)!==At.DOLLAR?-1:i.addDelimiter(zo[sc],s,s+Ba[sc],!0,!0)}},{name:oc,parse(i,o,s){return o!==At.DOLLAR||i.char(s+1)===At.DOLLAR?-1:i.addDelimiter(zo[oc],s,s+Ba[oc],!0,!0)}},{name:qo,before:"Escape",parse(i,o,s){return o!==At.BACKSLASH||i.char(s+1)!==At.BACKSLASH||![At.OPEN_PAREN,At.CLOSE_PAREN].includes(i.char(s+2))?-1:i.addDelimiter(zo[qo],s,s+Ba[qo],i.char(s+2)===At.OPEN_PAREN,i.char(s+2)===At.CLOSE_PAREN)}},{name:jo,before:"Escape",parse(i,o,s){return o!==At.BACKSLASH||i.char(s+1)!==At.BACKSLASH||![At.OPEN_BRACKET,At.CLOSE_BRACKET].includes(i.char(s+2))?-1:i.addDelimiter(zo[jo],s,s+Ba[jo],i.char(s+2)===At.OPEN_BRACKET,i.char(s+2)===At.CLOSE_BRACKET)}},{name:qo,before:"Escape",parse(i,o,s){return o!==At.BACKSLASH||![At.OPEN_PAREN,At.CLOSE_PAREN].includes(i.char(s+1))?-1:i.addDelimiter(zo[qo],s,s+2,i.char(s+1)===At.OPEN_PAREN,i.char(s+1)===At.CLOSE_PAREN)}},{name:jo,before:"Escape",parse(i,o,s){return o!==At.BACKSLASH||![At.OPEN_BRACKET,At.CLOSE_BRACKET].includes(i.char(s+1))?-1:i.addDelimiter(zo[jo],s,s+2,i.char(s+1)===At.OPEN_BRACKET,i.char(s+1)===At.CLOSE_BRACKET)}}],wrap:dw(i=>{let o=Ba[i.type.name];if(o){let s=i.from+o,c=i.to-o;return s>=c||s<0||c<0?null:{parser:e,overlay:[{from:s,to:c}]}}return null})}}Bu=Bi.define(),qu=Bi.define(),fi=xs.define({create:()=>({}),update:(e,n)=>{for(let i of n.effects){if(i.is(Bu))return i.value;if(i.is(qu))return{...e,...i.value}}return e}}),O_=!0,zu=class{constructor(){ke(this,"parser",new Zg);ke(this,"type","markdown");ke(this,"defaultCode",this.parser.defaultCode);ke(this,"defaultMetadata",this.parser.defaultMetadata)}static fromMarkdown(e){return Zg.fromMarkdown(e)}transformIn(e){let n=this.parser.transformIn(e);return[n.code,n.offset,n.metadata]}transformOut(e,n){let i=this.parser.transformOut(e,n);return[i.code,i.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,i,o){let s=xw().language.data,c,d=()=>{var p;if(!c)return!0;let f=c==null?void 0:c.state.field(fi);return f===void 0?!1:((p=f.quotePrefix)==null?void 0:p.includes("f"))??!1};return[Ol.define(f=>(c=f,{})),xw({base:xD,codeLanguages:Gk,extensions:[$C(uw.define(ED).parser),HC(Th.parser,d)]}),zC(i),MC.map(f=>s.of({autocomplete:f})),kw().language.data.of({autocomplete:CC({completion:Py,predicate:d})}),Mu({defaultKeymap:!1,activateOnTyping:!0}),SC({predicate:()=>!d()})]}};function Iy(){return`file://${Fl()??"/__marimo_notebook__.py"}`}function tf(){return`file://${Rh.dirname(Fl()??"/")}`}function WC(e){return ui.filter(e,n=>n!==!1&&n!==null)}function Ay(e){let n=e.map(WC);return Object.assign({},...n)}var UC=class{constructor(e){ke(this,"clients",[]);this.clients=e,this.documentUri=Iy()}onNotification(e){let n=[];for(let i of this.clients)n.push(i.onNotification(e));return()=>{for(let i of n)i();return!0}}get clientCapabilities(){return Ay(this.clients.map(e=>{if(e.clientCapabilities)return typeof e.clientCapabilities=="function"?e.clientCapabilities({}):e.clientCapabilities}).filter(e=>e!=null))}get ready(){return this.clients.some(e=>e.ready)}set ready(e){this.clients.forEach(n=>{n.ready=e})}get capabilities(){return Ay(this.clients.map(e=>e.capabilities).filter(e=>e!==null))}set capabilities(e){this.clients.forEach(n=>{n.capabilities=e})}get initializePromise(){return this.clients[0].initializePromise}set initializePromise(e){this.clients.forEach(n=>{n.initializePromise=e})}firstWithCapability(e){return this.clients.find(n=>{var i;return(i=n.capabilities)==null?void 0:i[e]})}clientsWithCapability(e){return this.clients.filter(n=>{var i;return(i=n.capabilities)==null?void 0:i[e]})}async initialize(){await Promise.all(this.clients.map(e=>e.initialize()))}async close(){await Promise.all(this.clients.map(e=>e.close()))}async textDocumentDidChange(e){return await Promise.all(this.clients.map(n=>n.textDocumentDidChange(e))),e}async completionItemResolve(e){let n=this.firstWithCapability("completionProvider");return n?n.completionItemResolve(e):e}async textDocumentCodeAction(e){let n=this.firstWithCapability("codeActionProvider");return n?n.textDocumentCodeAction(e):null}async textDocumentRename(e){let n=this.firstWithCapability("renameProvider");return n?n.textDocumentRename(e):null}async textDocumentPrepareRename(e){let n=this.firstWithCapability("renameProvider");return n?n.textDocumentPrepareRename(e):null}async textDocumentSignatureHelp(e){let n=this.firstWithCapability("signatureHelpProvider");return n?n.textDocumentSignatureHelp(e):null}async textDocumentCompletion(e){let n=this.clientsWithCapability("completionProvider");return KC(await Promise.allSettled(n.map(i=>i.textDocumentCompletion(e))))}async textDocumentDefinition(e){let n=this.firstWithCapability("definitionProvider");return n?n.textDocumentDefinition(e):null}async textDocumentDidOpen(e){return await Promise.all(this.clients.map(n=>n.textDocumentDidOpen(e))),e}async textDocumentHover(e){var n;for(let i of this.clients){if(!((n=i.capabilities)!=null&&n.hoverProvider))continue;let o=await i.textDocumentHover(e);if(o)return o}return{contents:[]}}};function KC(e){let n=[],i=!1;for(let o of e)if(o.status==="fulfilled"){let s=o.value;if(s==null)continue;Array.isArray(s)&&n.push(...s),"items"in s&&(n.push(...s.items),i||(i=s.isIncomplete))}return{items:n,isIncomplete:i}}Pw=function(e){return[...QC(e),e].join(`
129
+ `)};function QC(e){return Mm().map(n=>{let i=Xr(n);return i===e?null:i}).filter(Boolean).sort((n,i)=>n.startsWith("import")&&!i.startsWith("import")?-1:!n.startsWith("import")&&i.startsWith("import")?1:0)}var GC=ze(e=>{let n=e(bt);return ui.fromEntries(n.cellIds.inOrderIds.map(i=>{let o=n.cellHandles[i];return[i,o!=null&&o.current?Xr(o.current.editorView):""]}))}),JC=ze(e=>e(bt).cellIds.inOrderIds),XC=ze(e=>ZC(e(JC),e(La)));const YC=ze(e=>({cellIds:e(XC),codes:e(GC)}));function ZC(e,n){var p,y;let i=new Map;e.forEach(w=>i.set(w,[]));let o=new Set(e),s=new Set(e);for(let{declaredBy:w,usedBy:_}of Object.values(n))for(let C of w){o.delete(C);for(let E of _)s.delete(E),E!==C&&((p=i.get(C))==null||p.push(E))}let c=new Map;e.forEach(w=>c.set(w,0)),i.forEach(w=>{w.forEach(_=>{c.set(_,(c.get(_)||0)+1)})});let d=[];c.forEach((w,_)=>{w===0&&d.push(_)});let f=[];for(;d.length>0;){let w=d.shift();if(!w)break;f.push(w),(y=i.get(w))==null||y.forEach(_=>{c.set(_,(c.get(_)||0)-1),c.get(_)===0&&d.push(_)})}return[...f.filter(w=>!o.has(w)),...o]}function eE(e,n){let i=new Map,o=0;e.forEach(d=>{i.set(d,o),o+=n[d].split(`
130
130
  `).length});function s(d){return i.has(d)||Se.warn("[lsp] no cell line offsets for",d),i.get(d)??0}let c=e.map(d=>n[d]).join(`
131
131
  `);return{cellIds:e,mergedText:c,transformRange:(d,f)=>qy(d,s(f)),reverseRange:(d,f)=>qy(d,-s(f)),isInRange:(d,f)=>{let p=n[f].split(`
132
132
  `).length,y=i.get(f)||0,w=d.start.line-y,_=d.end.line-y,C=w>=0&&w<p,E=_>=0&&_<p;return C&&!E&&Se.warn("[lsp] Cross-cell diagnostic detected: range starts in cell but ends outside",{cellId:f,range:d,cellLines:p,offset:y}),C&&E},getEditsForNewText:d=>{let f=d.split(`
133
133
  `),p=c.split(`
134
134
  `);if(f.length!==p.length)throw Se.warn("[lsp] cannot apply rename with new lines",f,p),Error("Cannot apply rename when there are new lines");let y=[];for(let[w,_]of ui.entries(n)){if(!i.has(w))continue;let C=i.get(w)??0,E=_.split(`
135
135
  `).length,T=f.slice(C,C+E);y.push({cellId:w,text:T.join(`
136
- `)})}return y},transformPosition:(d,f)=>cc(d,s(f)),reversePosition:(d,f)=>cc(d,-s(f))}}function qy(e,n){return{start:cc(e.start,n),end:cc(e.end,n)}}function cc(e,n){return{line:e.line+n,character:e.character}}const qn={PREFIX:"file:///",of(e){return`${this.PREFIX}${e}`},is(e){return e.startsWith(this.PREFIX)},parse(e){return In(this.is(e),`Invalid cell document URI: ${e}`),e.slice(this.PREFIX.length)}};function jy(e){return"notify"in e}function tE(e){return e.startsWith("_")&&!e.startsWith("__")}var nE=class{constructor(e){ke(this,"documentVersion",0);ke(this,"lastSnapshot",null);this.getNotebookCode=e}snapshot(){var i;let e=this.getLens(),n=((i=this.lastSnapshot)==null?void 0:i.mergedText)!==e.mergedText;return n?(this.documentVersion++,this.lastSnapshot=e,{lens:e,didChange:n,version:this.documentVersion}):{lens:e,didChange:n,version:this.documentVersion}}getLatestSnapshot(){if(!this.lastSnapshot)throw Error("No snapshots");return{lens:this.lastSnapshot,version:this.documentVersion}}getLens(){let{cellIds:e,codes:n}=this.getNotebookCode();return eE(e,n)}},rE=()=>{let e=rd().cellHandles;return ui.mapValues(e,n=>{var i;return(i=n.current)==null?void 0:i.editorViewOrNull})},nf=(zr=class{constructor(n,i,o=rE){ke(this,"completionItemCache",new rc(10));this.documentUri=Iy(),this.getNotebookEditors=o,this.initialSettings=i,this.client=n,this.patchProcessNotification(),this.initializePromise.then(()=>{In(jy(this.client),"notify is not a method on the client"),this.client.notify("workspace/didChangeConfiguration",{settings:i})}),this.snapshotter=new nE(this.getNotebookCode.bind(this))}static pruneSeenCellUris(n){for(let i of zr.SEEN_CELL_DOCUMENT_URIS){let o=qn.parse(i);n.has(o)||zr.SEEN_CELL_DOCUMENT_URIS.delete(i)}}onNotification(n){return this.client.onNotification(n)}get ready(){return this.client.ready}set ready(n){this.client.ready=n}get capabilities(){return this.client.capabilities}set capabilities(n){this.client.capabilities=n}get initializePromise(){return this.client.initializePromise}set initializePromise(n){this.client.initializePromise=n}get clientCapabilities(){return this.client.clientCapabilities}async initialize(){await this.client.initialize()}close(){this.client.close()}async resyncAllDocuments(){In(jy(this.client),"notify is not a method on the client"),await this.client.initialize(),this.client.notify("workspace/didChangeConfiguration",{settings:this.initialSettings});let{lens:n,version:i}=this.snapshotter.snapshot();await this.client.textDocumentDidOpen({textDocument:{languageId:"python",text:n.mergedText,uri:this.documentUri,version:i}}),Se.log("[lsp] Document re-synchronization complete")}getNotebookCode(){return lt.get(YC)}assertCellDocumentUri(n){In(qn.is(n),"Execpted URI to be CellDocumentUri")}async textDocumentDidOpen(n){Se.debug("[lsp] textDocumentDidOpen",n);let i=n.textDocument.uri;this.assertCellDocumentUri(i);let{lens:o,version:s}=this.snapshotter.snapshot();zr.SEEN_CELL_DOCUMENT_URIS.add(i);let c=await this.client.textDocumentDidOpen({textDocument:{languageId:n.textDocument.languageId,text:o.mergedText,uri:this.documentUri,version:s}});return c?{...c,textDocument:{...c.textDocument,text:o.mergedText}}:n}async sync(){let{lens:n,version:i,didChange:o}=this.snapshotter.snapshot(),s={textDocument:{uri:this.documentUri,version:i},contentChanges:[{text:n.mergedText}]};return o&&await this.client.textDocumentDidChange(s),{params:s,lens:n}}async textDocumentDidChange(n){if(Se.debug("[lsp] textDocumentDidChange",n),n.contentChanges.length===1){let{params:i}=await this.sync();return i}return Se.warn("[lsp] Unhandled textDocumentDidChange",n),this.client.textDocumentDidChange(n)}async textDocumentDefinition(n){let i=n.textDocument.uri;if(!qn.is(i))return Se.warn("Invalid cell document URI",i),null;let{lens:o}=await this.sync(),s=qn.parse(i);return this.client.textDocumentDefinition({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})}async textDocumentSignatureHelp(n){let i=n.textDocument.uri;if(!qn.is(i))return Se.warn("Invalid cell document URI",i),null;let{lens:o}=await this.sync(),s=qn.parse(i);return await this.client.textDocumentSignatureHelp({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})||null}textDocumentCodeAction(n){return Promise.resolve(null)}async textDocumentRename(n){var $;let i=n.textDocument.uri;if(!qn.is(i))return Se.warn("Invalid cell document URI",i),null;let o=qn.parse(i),{lens:s}=await this.sync(),c=s.transformPosition(n.position,o),d=await this.client.textDocumentRename({...n,textDocument:{uri:this.documentUri},position:c});if(!d)return null;let f=($=d.documentChanges)==null?void 0:$.flatMap(V=>"edits"in V?V.edits:[]);if(!f||f.length!==1)return Se.warn("Expected exactly one edit",f),d;let p=f[0];if(!("newText"in p))return Se.warn("Expected newText in edit",p),d;let y=s.getEditsForNewText(p.newText),w=new Map(y.map(V=>[V.cellId,V.text])),_=this.getNotebookEditors(),C=_[o],E=!1;if(C){let V=C.state.doc.line(n.position.line+1).from+n.position.character,{startToken:F,endToken:N}=Qd(C.state.doc,V),K=C.state.doc.sliceString(F,N);E=tE(K),E&&Se.debug("[lsp] Private variable rename detected, limiting to current cell",K)}let T=[],I=0;for(let[V,F]of ui.entries(_)){if(E&&V!==o)continue;let N=w.get(V);if(N==null){Se.warn("[lsp] No new code for cell during rename",V),T.push(V);continue}if(!F){Se.warn("[lsp] No editor view for cell during rename",V),T.push(V);continue}Xr(F)!==N&&(_o(F,N),I++)}return T.length>0&&Se.error(`[lsp] Rename partially failed: could not update ${T.length} cell(s)`,T),Se.debug(`[lsp] Rename completed: updated ${I} cell(s)`),{...d,documentChanges:[{edits:[],textDocument:{uri:i,version:0}}]}}async completionItemResolve(n){let i=JSON.stringify(n),o=this.completionItemCache.get(i);if(o)return o;let s=this.client.completionItemResolve(n);return this.completionItemCache.set(i,s),s}async textDocumentPrepareRename(n){let i=n.textDocument.uri;if(!qn.is(i))return Se.warn("Invalid cell document URI",i),null;let{lens:o}=await this.sync(),s=qn.parse(i);return this.client.textDocumentPrepareRename({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})}async textDocumentHover(n){Se.debug("[lsp] textDocumentHover",n);let{lens:i}=await this.sync(),o=qn.parse(n.textDocument.uri),s=await this.client.textDocumentHover({...n,textDocument:{uri:this.documentUri},position:i.transformPosition(n.position,o)});return s?(typeof s.contents=="object"&&"kind"in s.contents&&(s.contents={kind:"markdown",value:s.contents.value}),s.contents===""?null:(s.range&&(s.range=i.reverseRange(s.range,o)),s)):(Se.debug("[lsp] no hover result"),s)}async textDocumentCompletion(n){let{lens:i}=this.snapshotter.getLatestSnapshot();if(!qn.is(n.textDocument.uri))return Se.error("[lsp] Invalid cell document URI in completion request",n.textDocument.uri),null;let o=qn.parse(n.textDocument.uri);if(!o||o==="undefined")return Se.error("[lsp] Invalid cellId 'undefined' in completion request",{cellId:o,uri:n.textDocument.uri,availableCellIds:i.cellIds}),null;i.cellIds.includes(o)||Se.warn("[lsp] CellId in completion request not found in current lens",{cellId:o,uri:n.textDocument.uri,availableCellIds:i.cellIds});let s=i.transformPosition(n.position,o);return this.client.textDocumentCompletion({...n,textDocument:{uri:this.documentUri},position:s})}patchProcessNotification(){In("processNotification"in this.client,"processNotification is not a method on the client");let n=this.client.processNotification.bind(this.client),i=o=>{if(o.method==="textDocument/publishDiagnostics"){Se.debug("[lsp] handling diagnostics",o);let s=this.snapshotter.getLatestSnapshot(),c=o.params.diagnostics,{lens:d,version:f}=s,p=new Map;for(let _ of c)for(let C of d.cellIds)if(d.isInRange(_.range,C)){p.has(C)||p.set(C,[]);let E={..._,range:d.reverseRange(_.range,C)};p.get(C).push(E);break}let y=new Set(d.cellIds);zr.pruneSeenCellUris(y);let w=new Set(zr.SEEN_CELL_DOCUMENT_URIS);for(let[_,C]of p.entries()){Se.debug("[lsp] diagnostics for cell",_,C);let E=qn.of(_);w.delete(E),n({...o,params:{...o.params,uri:E,version:f,diagnostics:C}})}if(w.size>0){Se.debug("[lsp] clearing diagnostics",w);for(let _ of w)n({method:"textDocument/publishDiagnostics",params:{uri:_,diagnostics:[]}})}return}return n(o)};this.client.processNotification=i}},ke(zr,"SEEN_CELL_DOCUMENT_URIS",new Set),zr),iE=ql(),aE=Oa(),oE=class extends aE.Transport{constructor(n){super();ke(this,"isClosed",!1);ke(this,"hasConnectedBefore",!1);ke(this,"pendingSubscriptions",[]);this.options=n,this.delegate=void 0}createDelegate(){if(this.delegate)try{this.delegate.close()}catch(n){Se.warn("Error closing old WebSocket delegate",n)}this.delegate=new iE.WebSocketTransport(this.options.getWsUrl());for(let{event:n,handler:i}of this.pendingSubscriptions)this.delegate.subscribe(n,i);return this.delegate}isDelegateClosedOrClosing(){if(!this.delegate)return!0;let n=this.delegate.connection;return n?n.readyState===WebSocket.CLOSING||n.readyState===WebSocket.CLOSED:!0}async connect(){if(this.isClosed)throw Error("Transport is closed");return this.connectionPromise||(this.connectionPromise=(async()=>{try{this.options.waitForConnection&&await this.options.waitForConnection();let n=this.delegate;(!n||this.isDelegateClosedOrClosing())&&(n=this.createDelegate()),await n.connect(),Se.log("WebSocket transport connected successfully");let i=this.hasConnectedBefore;this.hasConnectedBefore=!0,i&&this.options.onReconnect&&(Se.log("Calling onReconnect callback to re-synchronize state"),await this.options.onReconnect())}catch(n){throw Se.error("WebSocket transport connection failed",n),this.delegate=void 0,n}finally{this.connectionPromise=void 0}})()),this.connectionPromise}close(){var n;this.isClosed=!0,(n=this.delegate)==null||n.close(),this.delegate=void 0,this.connectionPromise=void 0}subscribe(...n){super.subscribe(...n);let[i,o]=n;this.pendingSubscriptions.push({event:i,handler:o}),this.delegate&&this.delegate.subscribe(i,o)}unsubscribe(...n){let i=super.unsubscribe(...n),[o,s]=n;return this.pendingSubscriptions=this.pendingSubscriptions.filter(c=>!(c.event===o&&c.handler===s)),this.delegate&&this.delegate.unsubscribe(o,s),i}async sendData(n,i){var o;if(this.isDelegateClosedOrClosing()){Se.warn("WebSocket is closed or closing, attempting to reconnect");try{await this.connect()}catch(s){throw Se.error("Failed to reconnect WebSocket",s),s}}return(o=this.delegate)==null?void 0:o.sendData(n,i)}};function rf(e,n){let i=b4();return new oE({getWsUrl:()=>i.getLSPURL(e).toString(),waitForConnection:async()=>{await w4()},onReconnect:n})}Bi.define(),new Pu;function sE(e){return e.facet(S4.readOnly)}function lE(e){return[rw(e),Ra.of([{key:"ArrowRight",preventDefault:!0,run:n=>zy(n,e)},{key:"Tab",preventDefault:!0,run:n=>zy(n,e)}])]}function zy(e,n){if(sE(e.state))return!1;let i=e.state.doc.length;return i===0?(e.dispatch({changes:{from:0,to:i,insert:n},selection:{head:n.length,anchor:n.length}}),!0):!1}function cE(e){let{beforeText:n,linkText:i,afterText:o,onClick:s}=e;return[rw(c=>{let d=document.createElement("span");d.append(document.createTextNode(n));let f=document.createElement("span");return f.textContent=i,f.classList.add("cm-clickable-placeholder"),f.onclick=p=>{p.stopPropagation(),s(c)},d.append(f),d.append(document.createTextNode(o)),d}),Kt.theme({".cm-placeholder":{color:"var(--slate-8)"},".cm-clickable-placeholder":{cursor:"pointer !important",pointerEvents:"auto",color:"var(--slate-9)",textDecoration:"underline",textUnderlineOffset:"0.2em"},".cm-clickable-placeholder:hover":{color:"var(--sky-11)"}})]}var uE=di(e=>{let n,i={transport:rf("pylsp",async()=>{await(n==null?void 0:n())}),rootUri:tf(),workspaceFolders:[]},o=e==null?void 0:e.pylsp,s=["D100","D103"],c=["W292","E402"],d=["B018","I001"],f={pylsp:{plugins:{marimo_plugin:{enabled:!0},jedi:{auto_import_modules:["numpy"]},jedi_completion:{include_params:!0,resolve_at_most:50},flake8:{enabled:o==null?void 0:o.enable_flake8,extendIgnore:c},pydocstyle:{enabled:o==null?void 0:o.enable_pydocstyle,ignore:s},pylint:{enabled:o==null?void 0:o.enable_pylint},pyflakes:{enabled:o==null?void 0:o.enable_pyflakes},pylsp_mypy:{enabled:o==null?void 0:o.enable_mypy,live_mode:!0},ruff:{enabled:o==null?void 0:o.enable_ruff,extendIgnore:[...c,...s,...d]},signature:{formatter:o!=null&&o.enable_ruff?"ruff":"black",line_length:88}}}},p=new nf(new Il({...i}),f);return n=()=>p.resyncAllDocuments(),p}),dE=di(e=>{let n,i=new nf(new Il({transport:rf("ty",async()=>{await(n==null?void 0:n())}),rootUri:tf(),workspaceFolders:[],getWorkspaceConfiguration:o=>[{disableLanguageServices:!0}]}),{});return n=()=>i.resyncAllDocuments(),i}),fE=di(e=>{let n,i=new nf(new Il({transport:rf("basedpyright",async()=>{await(n==null?void 0:n())}),rootUri:tf(),workspaceFolders:[]}),{});return n=()=>i.resyncAllDocuments(),i}),pE=class{constructor(){ke(this,"parser",new yS);ke(this,"type","python");ke(this,"defaultCode",this.parser.defaultCode);ke(this,"defaultMetadata",this.parser.defaultMetadata)}transformIn(e){let n=this.parser.transformIn(e);return[n.code,n.offset,n.metadata]}transformOut(e,n){let i=this.parser.transformOut(e,n);return[i.code,i.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,i,o,s){return[(()=>{var w,_,C,E;let c={defaultKeymap:!1,activateOnTyping:n.activate_on_typing,closeOnBlur:!1},d={hideOnChange:!0},f=[];(w=s==null?void 0:s.pylsp)!=null&&w.enabled&&oc("pylsp")&&f.push(uE(s)),(_=s==null?void 0:s.ty)!=null&&_.enabled&&oc("ty")&&f.push(dE(s)),(C=s==null?void 0:s.basedpyright)!=null&&C.enabled&&oc("basedpyright")&&f.push(fE(s));let p=n.signature_hint_on_typing,y=p?/(\w+|\w+\.|\/)$/:/(\w+|\w+\.|\(|\/|,)$/;if(f.length>0){let T=f.length===1?f[0]:new UC(f);return[Lh({client:T,languageId:"python",allowHTMLContent:!0,useSnippetOnCompletion:!0,hoverConfig:d,completionConfig:c,diagnosticsEnabled:((E=s.diagnostics)==null?void 0:E.enabled)??!1,sendIncrementalChanges:!1,signatureHelpEnabled:!0,signatureActivateOnTyping:p,signatureHelpOptions:{position:"above"},keyboardShortcuts:{signatureHelp:i.getHotkey("cell.signatureHelp").key,goToDefinition:i.getHotkey("cell.goToDefinition").key,rename:i.getHotkey("cell.renameSymbol").key},completionMatchBefore:y,onGoToDefinition:I=>{Se.debug("onGoToDefinition",I),T.documentUri!==I.uri&&Vi().openFile({path:I.uri.replace("file://","")})}}),yg.of(qn.of(e))]}return Lu({...c,override:[Py]})})(),Sm(),hE(o)]}};function hE(e){return e==="marimo-import"?Mu.highest(lE("import marimo as mo")):e==="ai"?cE({beforeText:"Start coding or ",linkText:"generate",afterText:" with AI.",onClick:n=>{n.state.facet(Pt).aiCellCompletion()}}):[]}var af=Th.configure({props:[E4.add({ParenthesizedExpression:lw,ArgList:lw})]});Sm=function(){return new fw(af,[af.data.of({autocomplete:SD}),af.data.of({autocomplete:CD})])};const mE=e=>{let n;return async()=>(n||(n=e()),await n)};var uc=class{constructor(e={}){ke(this,"opts");ke(this,"parser",null);ke(this,"offsetRecord",{});ke(this,"getParser",mE(async()=>{if(this.parser)return this.parser;let e=await ce(()=>import("./node-sql-parser-UQ9Ur_LP.js").then(async i=>(await i.__tla,i)).then(JR(1)),__vite__mapDeps([213,1]),import.meta.url),{Parser:n}=e.default||e;return this.parser=new n,this.parser}));this.opts=e}async parse(e,n){var s,c;this.offsetRecord={};let i=(c=(s=this.opts).getParserOptions)==null?void 0:c.call(s,n.state),o=await this.sanitizeSql(e,i);try{let d=await this.getParser();return(i==null?void 0:i.database)==="DuckDB"?this.parseWithDuckDBSupport(o,i):{success:!0,errors:[],ast:d.astify(o,i)}}catch(d){return{success:!1,errors:[this.extractErrorInfo(d,o)]}}}async sanitizeSql(e,n){if(n!=null&&n.ignoreBrackets){let{sql:i,offsetRecord:o}=vE(e);return this.offsetRecord=o,i}return e}async parseWithDuckDBSupport(e,n){let i=await this.getParser(),o=gE(e).trimStart().toLowerCase();if(o.startsWith("from")||o.includes("macro"))return{success:!0,errors:[]};let s=e;o.includes("create or replace table")&&(this.offsetRecord[e.indexOf("create or replace table")]=-11,s=e.replace(/create or replace table/i,"create table"));try{let c={...n,database:"PostgreSQL"};return{success:!0,errors:[],ast:i.astify(s,c)}}catch(c){return{success:!1,errors:[this.extractErrorInfo(c,e)]}}}extractErrorInfo(e,n){var d,f,p;let i=1,o=1,s=(e==null?void 0:e.message)||"SQL parsing error",c=e;if(c!=null&&c.location)i=((d=c.location.start)==null?void 0:d.line)||1,o=((f=c.location.start)==null?void 0:f.column)||1;else if(c!=null&&c.hash)i=c.hash.line||1,o=((p=c.hash.loc)==null?void 0:p.first_column)||1;else{let y=s.match(/line (\d+)/i),w=s.match(/column (\d+)/i);y!=null&&y[1]&&(i=parseInt(y[1],10)),w!=null&&w[1]&&(o=parseInt(w[1],10))}for(let[y,w]of Object.entries(this.offsetRecord))o>parseInt(y,10)&&(o-=w);return o>n.length&&(o=n.length),{message:this.cleanErrorMessage(s),line:Math.max(1,i),column:o,severity:"error"}}cleanErrorMessage(e){return e.replace(/^Error: /,"").replace(/Expected .* but .* found\./i,n=>n.replace(/but .* found/,"found unexpected token")).trim()}async validateSql(e,n){return(await this.parse(e,n)).errors}async extractTableReferences(e,n){var o,s;let i=n?(s=(o=this.opts).getParserOptions)==null?void 0:s.call(o,n.state):void 0;try{return(await this.getParser()).tableList(e,i).map(c=>{let d=c.split("::");return d[d.length-1]||c})}catch{return[]}}async extractColumnReferences(e,n){var o,s;let i=n!=null&&n.state?(s=(o=this.opts).getParserOptions)==null?void 0:s.call(o,n.state):void 0;try{return(await this.getParser()).columnList(e,i).map(c=>{let d=c.split("::");return d[d.length-1]||c})}catch{return[]}}};function gE(e,n=["/*","--"]){let i=[];if(n.includes("/*")&&i.push("/\\*[\\s\\S]*?\\*/"),n.includes("--")&&i.push("--[^\\n]*"),i.length===0)return e;let o=RegExp(`^\\s*(${i.join("|")})\\s*`,""),s=e,c="";for(;s!==c;)c=s,s=s.replace(o,"");return s}var yE=2;function vE(e){let n={};return{sql:e.replace(/("(?:[^"\\]|\\.)*")|('(?:[^'\\]|\\.)*')|(\{[^}]*\})/g,(i,o,s,c,d)=>o||s?i:c?(n[d]=yE,`'${c}'`):i),offsetRecord:n}}var bE=750;function wE(e,n){let i=n.line(e.line).from+Math.max(0,e.column-1);return{from:i,to:i+1,severity:e.severity,message:e.message,source:"sql-parser"}}function _E(e={}){let n=e.parser||new uc;return Y4(async i=>{let o=i.state.doc,s=o.toString();return s.trim()?(await n.validateSql(s,{state:i.state})).map(c=>wE(c,o)):[]},{delay:e.delay||bE})}function Ha(e){return typeof e=="object"&&!Array.isArray(e)&&!("self"in e)}function hi(e){return typeof e=="object"&&!Array.isArray(e)&&"self"in e&&"children"in e}function jr(e){return Array.isArray(e)}function jn(e,n,i,o){let s=e.length;if(n==="string"||n==="completion"&&o&&jr(o))return"column";if(n==="namespace"&&i){if(jr(i))return"table";if(Ha(i))return Object.values(i).some(c=>jr(c)||hi(c)&&jr(c.children))?s<=1?"database":"schema":s===0?"database":"namespace"}if(n==="completion"&&i)return jr(i)?"table":(Ha(i)&&Object.values(i).some(c=>jr(c)||hi(c)&&jr(c.children)),s<=1?"database":"schema");switch(s){case 0:return"database";case 1:return"schema";default:return"namespace"}}function Fy(e,n,i={}){let{maxDepth:o=10}=i;if(n===""&&hi(e)){let c=jn([],"completion",e.children);return{completion:e.self,path:[],type:"completion",semanticType:c,namespace:e.children}}let s=n.split(".").filter(c=>c.length>0);return s.length===0||s.length>o?null:of(e,s,[],i)}function of(e,n,i,o,s){if(n.length===0){if(hi(e)){let p=jn(i,"completion",e.children,s);return{completion:e.self,path:i,type:"completion",semanticType:p,namespace:e.children}}return{path:i,type:"namespace",semanticType:jn(i,"namespace",e,s),namespace:e}}let[c,...d]=n,{caseSensitive:f=!1}=o;if(!c)return null;if(Ha(e)){let p=f?Object.keys(e).find(y=>y===c):Object.keys(e).find(y=>y.toLowerCase()===c.toLowerCase());if(p){let y=e[p];if(y)return of(y,d,[...i,p],o,e)}}else{if(hi(e))return of(e.children,n,i,o,e);if(jr(e)){for(let p of e)if(typeof p=="string"){if((f?p===c:p.toLowerCase()===c.toLowerCase())&&d.length===0){let y=jn([...i,p],"string",void 0,e);return{value:p,path:[...i,p],type:"string",semanticType:y}}}else if((f?p.label===c:p.label.toLowerCase()===c.toLowerCase())&&d.length===0){let y=jn([...i,p.label],"completion",void 0,e);return{completion:p,path:[...i,p.label],type:"completion",semanticType:y}}}}return null}function xE(e,n,i={}){let o=[];if(n.includes(".")){let s=n.lastIndexOf("."),c=n.substring(0,s),d=n.substring(s+1),f=Fy(e,c,i);if(f!=null&&f.namespace)return sf(f.namespace,d,f.path,i)}else return sf(e,n,[],i);return o}function sf(e,n,i,o){let s=[],{caseSensitive:c=!1,allowPartialMatch:d=!0}=o;if(Ha(e)){for(let[f,p]of Object.entries(e))if(d?c?f.startsWith(n):f.toLowerCase().startsWith(n.toLowerCase()):c?f===n:f.toLowerCase()===n.toLowerCase())if(hi(p)){let y=jn([...i,f],"completion",p.children,e);s.push({completion:p.self,path:[...i,f],type:"completion",semanticType:y,namespace:p.children})}else{let y=jn([...i,f],"namespace",p,e);s.push({path:[...i,f],type:"namespace",semanticType:y,namespace:p})}}else if(hi(e)){if(d?c?e.self.label.startsWith(n):e.self.label.toLowerCase().startsWith(n.toLowerCase()):c?e.self.label===n:e.self.label.toLowerCase()===n.toLowerCase()){let f=jn([...i,e.self.label],"completion",e.children);s.push({completion:e.self,path:[...i,e.self.label],type:"completion",semanticType:f,namespace:e.children})}s.push(...sf(e.children,n,i,o))}else if(jr(e)){for(let f of e)if(typeof f=="string"){if(d?c?f.startsWith(n):f.toLowerCase().startsWith(n.toLowerCase()):c?f===n:f.toLowerCase()===n.toLowerCase()){let p=jn([...i,f],"string",void 0,e);s.push({value:f,path:[...i,f],type:"string",semanticType:p})}}else if(d?c?f.label.startsWith(n):f.label.toLowerCase().startsWith(n.toLowerCase()):c?f.label===n:f.label.toLowerCase()===n.toLowerCase()){let p=jn([...i,f.label],"completion",void 0,e);s.push({completion:f,path:[...i,f.label],type:"completion",semanticType:p})}}return s}function kE(e,n,i={}){let o=[],{maxDepth:s=10}=i;dc(e,[],o,s);let{caseSensitive:c=!1}=i;return o.filter(d=>d.path.some(f=>c?f===n:f.toLowerCase()===n.toLowerCase())).sort((d,f)=>{var w,_;let p=c?d.path[d.path.length-1]===n:((w=d.path[d.path.length-1])==null?void 0:w.toLowerCase())===n.toLowerCase(),y=c?f.path[f.path.length-1]===n:((_=f.path[f.path.length-1])==null?void 0:_.toLowerCase())===n.toLowerCase();return p&&!y?-1:!p&&y?1:d.path.length-f.path.length})}function dc(e,n,i,o){if(!(n.length>=o)){if(Ha(e))for(let[s,c]of Object.entries(e)){let d=[...n,s];if(hi(c)){let f=jn(d,"completion",c.children,e);i.push({completion:c.self,path:d,type:"completion",semanticType:f,namespace:c.children}),dc(c.children,d,i,o)}else{let f=jn(d,"namespace",c,e);i.push({path:d,type:"namespace",semanticType:f,namespace:c}),dc(c,d,i,o)}}else if(hi(e)){let s=jn(n,"completion",e.children);i.push({completion:e.self,path:n,type:"completion",semanticType:s,namespace:e.children}),dc(e.children,n,i,o)}else if(jr(e))for(let s of e)if(typeof s=="string"){let c=jn([...n,s],"string",void 0,e);i.push({value:s,path:[...n,s],type:"string",semanticType:c})}else{let c=jn([...n,s.label],"completion",void 0,e);i.push({completion:s,path:[...n,s.label],type:"completion",semanticType:c})}}}function By(e,n,i={}){let{enableFuzzySearch:o=!1}=i,s=Fy(e,n,i);if(s)return s;let c=xE(e,n,i);if(c.length>0)return c[0]||null;if(o){let d=kE(e,n,i);if(d.length>0)return d[0]||null}return null}function Hy(e,n){if(n.size===0)return{};if(Ha(e)){let i={};for(let[o,s]of Object.entries(e))if(Array.from(n).some(c=>c.toLowerCase()===o.toLowerCase()))i[o]=s;else if(Ha(s)){let c=Hy(s,n);Object.keys(c).length>0&&(i[o]=c)}return i}return e}function SE(e={}){let{schema:n={},keywords:i={},hoverTime:o=300,enableKeywords:s=!0,enableTables:c=!0,enableColumns:d=!0,enableFuzzySearch:f=!0,parser:p=new uc,tooltipRender:y,tooltipRenderers:w={}}=e,_=null;return wh(async(C,E,T)=>{let{from:I,to:$,text:V}=C.state.doc.lineAt(E),F=E,N=E;_===null&&(_=typeof i=="function"?i(C):Promise.resolve(i));let K=await _;for(;F>I&&/[\w.]/.test(V[F-I-1]??"");)F--;for(;N<$&&/[\w.]/.test(V[N-I]??"");)N++;if(F===E&&T<0||N===E&&T>0)return null;let pe=V.slice(F-I,N-I).toLowerCase();if(!pe||pe.length===0)return null;let P=typeof n=="function"?n(C):n,A=null;if(`${pe}`,!A&&s&&K[pe]&&(K[pe],A={word:pe,view:C,pos:E,tooltipType:"keyword",keywordData:{keyword:pe,info:K[pe]}}),!A&&(c||d)&&P){let W=C.state.doc.toString(),de=await p.extractTableReferences(W),fe=new Set(de.map(be=>be.toLowerCase())),we=Hy(P,fe),J=By(we,pe,{enableFuzzySearch:f});!J&&fe.size===0&&(J=By(P,pe,{enableFuzzySearch:f})),J&&(Array.from(fe),A={word:pe,view:C,pos:E,tooltipType:"namespace",namespaceData:{item:J,word:pe,resolvedSchema:fe.size>0?we:P}})}return A?{pos:F,end:N,above:!0,create(W){if(y){let we=y(pe,W,E);if(we)return{dom:we}}let de=null;if(A.tooltipType==="keyword"&&A.keywordData)de=w.keyword?w.keyword(A.keywordData):$y(A.keywordData);else if(A.tooltipType==="namespace"&&A.namespaceData){let we=A.namespaceData,{semanticType:J}=we.item;de=J==="table"&&w.table?w.table(we):J==="column"&&w.column?w.column(we):(J==="database"||J==="schema"||J==="namespace")&&w.namespace?w.namespace(we):Vy(we.item)}if(!de)return{dom:document.createElement("div")};let fe=document.createElement("div");return fe.className="cm-sql-hover-tooltip",fe.innerHTML=de,{dom:fe}}}:null},{hoverTime:o})}function Vy(e){var s,c,d,f,p,y,w;let n=e.path.join("."),i=((s=e.completion)==null?void 0:s.label)||e.value||e.path[e.path.length-1]||"unknown",o=`<div class="sql-hover-${e.semanticType}">`;switch(o+=`<div class="sql-hover-header"><strong>${i}</strong> <span class="sql-hover-type">${e.semanticType}</span></div>`,e.semanticType){case"database":if(o+=`<div class="sql-hover-description">Database${(c=e.completion)!=null&&c.detail?`: ${e.completion.detail}`:""}</div>`,e.namespace){let _=fc(e.namespace);_>0&&(o+=`<div class="sql-hover-children">Contains ${_} schema${_===1?"":"s"}</div>`)}break;case"schema":if(o+=`<div class="sql-hover-description">Schema${(d=e.completion)!=null&&d.detail?`: ${e.completion.detail}`:""}</div>`,n&&(o+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${n}</code></div>`),e.namespace){let _=fc(e.namespace);_>0&&(o+=`<div class="sql-hover-children">Contains ${_} table${_===1?"":"s"}</div>`)}break;case"table":if(o+=`<div class="sql-hover-description">Table${(f=e.completion)!=null&&f.detail?`: ${e.completion.detail}`:""}</div>`,n){let _=e.path;_.length>1&&(o+=`<div class="sql-hover-path"><strong>Schema:</strong> <code>${_.slice(0,-1).join(".")}</code></div>`)}if(e.namespace&&jr(e.namespace)){let _=e.namespace;if(_.length>0){o+=`<div class="sql-hover-columns"><strong>Columns (${_.length}):</strong><br>`;let C=_.slice(0,8).map(E=>typeof E=="string"?E:E.label);o+=C.map(E=>`<code>${E}</code>`).join(", "),_.length>8&&(o+=`, <em>and ${_.length-8} more...</em>`),o+="</div>"}}break;case"column":if(o+=`<div class="sql-hover-description">Column${(p=e.completion)!=null&&p.detail?`: ${e.completion.detail}`:""}</div>`,n){let _=e.path;_.length>1&&(o+=`<div class="sql-hover-path"><strong>Table:</strong> <code>${_.slice(0,-1).join(".")}</code></div>`)}break;default:if(o+=`<div class="sql-hover-description">Namespace${(y=e.completion)!=null&&y.detail?`: ${e.completion.detail}`:""}</div>`,n&&(o+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${n}</code></div>`),e.namespace){let _=fc(e.namespace);_>0&&(o+=`<div class="sql-hover-children">Contains ${_} item${_===1?"":"s"}</div>`)}break}return(w=e.completion)!=null&&w.info&&typeof e.completion.info=="string"&&(o+=`<div class="sql-hover-info">${e.completion.info}</div>`),o+="</div>",o}function fc(e){return Array.isArray(e)?e.length:typeof e=="object"&&e?"self"in e&&"children"in e?1+fc(e.children):Object.keys(e).length:0}function $y(e){let{keyword:n,info:i}=e,o='<div class="sql-hover-keyword">';if(o+=`<div class="sql-hover-header"><strong>${n.toUpperCase()}</strong> <span class="sql-hover-type">keyword</span></div>`,o+=`<div class="sql-hover-description">${i.description}</div>`,i.syntax&&(o+=`<div class="sql-hover-syntax"><strong>Syntax:</strong> <code>${i.syntax}</code></div>`),i.example&&(o+=`<div class="sql-hover-example"><strong>Example:</strong><br><code>${i.example}</code></div>`),i.metadata&&typeof i.metadata=="object"&&Object.keys(i.metadata).length>0){o+='<div class="sql-hover-metadata">';for(let[s,c]of Object.entries(i.metadata))o+=`<span class="sql-hover-tag" title="${s}">${c}</span> `;o+="</div>"}return o+="</div>",o}function CE(e){let{tableName:n,columns:i,metadata:o}=e,s='<div class="sql-hover-table">';if(s+=`<div class="sql-hover-header"><strong>${n}</strong> <span class="sql-hover-type">table</span></div>`,s+=`<div class="sql-hover-description">Table with ${i.length} column${i.length===1?"":"s"}</div>`,i.length>0){s+='<div class="sql-hover-columns"><strong>Columns:</strong><br>';let c=i.slice(0,10);s+=c.map(d=>`<code>${d}</code>`).join(", "),i.length>10&&(s+=`, <em>and ${i.length-10} more...</em>`),s+="</div>"}if(o&&typeof o=="object"&&Object.keys(o).length>0){s+='<div class="sql-hover-metadata">';for(let[c,d]of Object.entries(o))s+=`<span class="sql-hover-tag" title="${c}">${d}</span> `;s+="</div>"}return s+="</div>",s}function EE(e){let{tableName:n,columnName:i,schema:o,metadata:s}=e,c='<div class="sql-hover-column">';c+=`<div class="sql-hover-header"><strong>${i}</strong> <span class="sql-hover-type">column</span></div>`,c+=`<div class="sql-hover-description">Column in table <code>${n}</code></div>`;let d=o[n];if(d&&d.length>1){let f=d.filter(p=>p!==i);if(f.length>0){c+=`<div class="sql-hover-related"><strong>Other columns in ${n}:</strong><br>`;let p=f.slice(0,8);c+=p.map(y=>`<code>${y}</code>`).join(", "),f.length>8&&(c+=`, <em>and ${f.length-8} more...</em>`),c+="</div>"}}if(s&&typeof s=="object"&&Object.keys(s).length>0){c+='<div class="sql-hover-metadata">';for(let[f,p]of Object.entries(s))c+=`<span class="sql-hover-tag" title="${f}">${p}</span> `;c+="</div>"}return c+="</div>",c}const TE={keyword:$y,table:CE,column:EE,namespace:Vy},Wy=(e="light")=>{let n=e==="dark"?{tooltipBg:"#1f2937",tooltipBorder:"#374151",tooltipText:"#f9fafb",tooltipTypeBg:"#374151",tooltipTypeText:"#9ca3af",tooltipChildren:"#9ca3af",codeBg:"#374151",codeText:"#f3f4f6",strong:"#ffffff",em:"#9ca3af",header:"#ffffff",info:"#d1d5db",related:"#d1d5db",path:"#d1d5db",example:"#d1d5db",columns:"#d1d5db",syntax:"#d1d5db"}:{tooltipBg:"#ffffff",tooltipBorder:"#e5e7eb",tooltipText:"#374151",tooltipTypeBg:"#f3f4f6",tooltipTypeText:"#6b7280",tooltipChildren:"#6b7280",codeBg:"#f9fafb",codeText:"#1f2937",strong:"#111827",em:"#6b7280",header:"#111827",info:"#374151",related:"#374151",path:"#374151",example:"#374151",columns:"#374151",syntax:"#374151"};return Kt.theme({".cm-sql-hover-tooltip":{padding:"8px 12px",backgroundColor:n.tooltipBg,border:`1px solid ${n.tooltipBorder}`,borderRadius:"6px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",fontSize:"13px",lineHeight:"1.4",maxWidth:"320px",fontFamily:"system-ui, -apple-system, sans-serif",color:n.tooltipText},".cm-sql-hover-tooltip .sql-hover-header":{marginBottom:"6px",display:"flex",alignItems:"center",gap:"6px",color:n.header},".cm-sql-hover-tooltip .sql-hover-type":{fontSize:"11px",padding:"2px 6px",backgroundColor:n.tooltipTypeBg,color:n.tooltipTypeText,borderRadius:"4px",fontWeight:"500"},".cm-sql-hover-tooltip .sql-hover-description":{color:n.info,marginBottom:"8px"},".cm-sql-hover-tooltip .sql-hover-syntax":{marginBottom:"8px",color:n.syntax},".cm-sql-hover-tooltip .sql-hover-example":{marginBottom:"4px",color:n.example},".cm-sql-hover-tooltip .sql-hover-columns":{marginBottom:"4px",color:n.columns},".cm-sql-hover-tooltip .sql-hover-related":{marginBottom:"4px",color:n.related},".cm-sql-hover-tooltip .sql-hover-path":{marginBottom:"4px",color:n.path},".cm-sql-hover-tooltip .sql-hover-info":{marginBottom:"4px",color:n.info},".cm-sql-hover-tooltip .sql-hover-children":{marginBottom:"4px",color:n.tooltipChildren,fontSize:"12px"},".cm-sql-hover-tooltip code":{backgroundColor:n.codeBg,padding:"1px 4px",borderRadius:"3px",fontSize:"12px",fontFamily:"ui-monospace, 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace",color:n.codeText},".cm-sql-hover-tooltip strong":{fontWeight:"600",color:n.strong},".cm-sql-hover-tooltip em":{fontStyle:"italic",color:n.em}})};var RE=class{constructor(e){ke(this,"parser");ke(this,"cache",new Map);ke(this,"MAX_CACHE_SIZE",10);this.parser=e}async analyzeDocument(e){let n=e.doc.toString(),i=this.generateCacheKey(n),o=this.cache.get(i);if(o)return o;let s=await this.extractStatements(n,e);if(this.cache.set(i,s),this.cache.size>this.MAX_CACHE_SIZE){let c=this.cache.keys().next().value;c!==void 0&&this.cache.delete(c)}return s}async getStatementAtPosition(e,n){return(await this.analyzeDocument(e)).find(i=>n>=i.from&&n<=i.to)||null}async getStatementsInRange(e,n,i){return(await this.analyzeDocument(e)).filter(o=>o.from<=i&&o.to>=n)}async extractStatements(e,n){let i=[],o=this.splitByStatementSeparators(e),s=0;for(let c of o){let d=c.trim();if(d.length===0){s+=c.length;continue}let f=s+c.indexOf(d),p=f+d.length,y=n.doc.lineAt(f),w=n.doc.lineAt(p),_=this.stripComments(d);if(_.trim().length===0||_.trim()===";"){s+=c.length;continue}let C=await this.parser.parse(_,{state:n}),E=this.determineStatementType(_),T=_.endsWith(";")?_.slice(0,-1).trim():_.trim();i.push({from:f,to:p,lineFrom:y.number,lineTo:w.number,content:T,type:E,isValid:C.success}),s+=c.length}return i}splitByStatementSeparators(e){let n=[],i="",o=!1,s="",c=!1,d=!1,f=0;for(;f<e.length;){let p=e[f],y=e[f+1];if(!o&&!d&&p==="-"&&y==="-"){c=!0,i+=p+y,f+=2;continue}if(!o&&!c&&p==="/"&&y==="*"){d=!0,i+=p+y,f+=2;continue}if(d&&p==="*"&&y==="/"){d=!1,i+=p+y,f+=2;continue}if(c&&(p===`
136
+ `)})}return y},transformPosition:(d,f)=>lc(d,s(f)),reversePosition:(d,f)=>lc(d,-s(f))}}function qy(e,n){return{start:lc(e.start,n),end:lc(e.end,n)}}function lc(e,n){return{line:e.line+n,character:e.character}}const qn={PREFIX:"file:///",of(e){return`${this.PREFIX}${e}`},is(e){return e.startsWith(this.PREFIX)},parse(e){return In(this.is(e),`Invalid cell document URI: ${e}`),e.slice(this.PREFIX.length)}};function jy(e){return"notify"in e}function tE(e){return e.startsWith("_")&&!e.startsWith("__")}var nE=class{constructor(e){ke(this,"documentVersion",0);ke(this,"lastSnapshot",null);this.getNotebookCode=e}snapshot(){var i;let e=this.getLens(),n=((i=this.lastSnapshot)==null?void 0:i.mergedText)!==e.mergedText;return n?(this.documentVersion++,this.lastSnapshot=e,{lens:e,didChange:n,version:this.documentVersion}):{lens:e,didChange:n,version:this.documentVersion}}getLatestSnapshot(){if(!this.lastSnapshot)throw Error("No snapshots");return{lens:this.lastSnapshot,version:this.documentVersion}}getLens(){let{cellIds:e,codes:n}=this.getNotebookCode();return eE(e,n)}},rE=()=>{let e=nd().cellHandles;return ui.mapValues(e,n=>{var i;return(i=n.current)==null?void 0:i.editorViewOrNull})},nf=(zr=class{constructor(n,i,o=rE){ke(this,"completionItemCache",new nc(10));this.documentUri=Iy(),this.getNotebookEditors=o,this.initialSettings=i,this.client=n,this.patchProcessNotification(),this.initializePromise.then(()=>{In(jy(this.client),"notify is not a method on the client"),this.client.notify("workspace/didChangeConfiguration",{settings:i})}),this.snapshotter=new nE(this.getNotebookCode.bind(this))}static pruneSeenCellUris(n){for(let i of zr.SEEN_CELL_DOCUMENT_URIS){let o=qn.parse(i);n.has(o)||zr.SEEN_CELL_DOCUMENT_URIS.delete(i)}}onNotification(n){return this.client.onNotification(n)}get ready(){return this.client.ready}set ready(n){this.client.ready=n}get capabilities(){return this.client.capabilities}set capabilities(n){this.client.capabilities=n}get initializePromise(){return this.client.initializePromise}set initializePromise(n){this.client.initializePromise=n}get clientCapabilities(){return this.client.clientCapabilities}async initialize(){await this.client.initialize()}close(){this.client.close()}async resyncAllDocuments(){In(jy(this.client),"notify is not a method on the client"),await this.client.initialize(),this.client.notify("workspace/didChangeConfiguration",{settings:this.initialSettings});let{lens:n,version:i}=this.snapshotter.snapshot();await this.client.textDocumentDidOpen({textDocument:{languageId:"python",text:n.mergedText,uri:this.documentUri,version:i}}),Se.log("[lsp] Document re-synchronization complete")}getNotebookCode(){return lt.get(YC)}assertCellDocumentUri(n){In(qn.is(n),"Execpted URI to be CellDocumentUri")}async textDocumentDidOpen(n){Se.debug("[lsp] textDocumentDidOpen",n);let i=n.textDocument.uri;this.assertCellDocumentUri(i);let{lens:o,version:s}=this.snapshotter.snapshot();zr.SEEN_CELL_DOCUMENT_URIS.add(i);let c=await this.client.textDocumentDidOpen({textDocument:{languageId:n.textDocument.languageId,text:o.mergedText,uri:this.documentUri,version:s}});return c?{...c,textDocument:{...c.textDocument,text:o.mergedText}}:n}async sync(){let{lens:n,version:i,didChange:o}=this.snapshotter.snapshot(),s={textDocument:{uri:this.documentUri,version:i},contentChanges:[{text:n.mergedText}]};return o&&await this.client.textDocumentDidChange(s),{params:s,lens:n}}async textDocumentDidChange(n){if(Se.debug("[lsp] textDocumentDidChange",n),n.contentChanges.length===1){let{params:i}=await this.sync();return i}return Se.warn("[lsp] Unhandled textDocumentDidChange",n),this.client.textDocumentDidChange(n)}async textDocumentDefinition(n){let i=n.textDocument.uri;if(!qn.is(i))return Se.warn("Invalid cell document URI",i),null;let{lens:o}=await this.sync(),s=qn.parse(i);return this.client.textDocumentDefinition({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})}async textDocumentSignatureHelp(n){let i=n.textDocument.uri;if(!qn.is(i))return Se.warn("Invalid cell document URI",i),null;let{lens:o}=await this.sync(),s=qn.parse(i);return await this.client.textDocumentSignatureHelp({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})||null}textDocumentCodeAction(n){return Promise.resolve(null)}async textDocumentRename(n){var $;let i=n.textDocument.uri;if(!qn.is(i))return Se.warn("Invalid cell document URI",i),null;let o=qn.parse(i),{lens:s}=await this.sync(),c=s.transformPosition(n.position,o),d=await this.client.textDocumentRename({...n,textDocument:{uri:this.documentUri},position:c});if(!d)return null;let f=($=d.documentChanges)==null?void 0:$.flatMap(V=>"edits"in V?V.edits:[]);if(!f||f.length!==1)return Se.warn("Expected exactly one edit",f),d;let p=f[0];if(!("newText"in p))return Se.warn("Expected newText in edit",p),d;let y=s.getEditsForNewText(p.newText),w=new Map(y.map(V=>[V.cellId,V.text])),_=this.getNotebookEditors(),C=_[o],E=!1;if(C){let V=C.state.doc.line(n.position.line+1).from+n.position.character,{startToken:F,endToken:N}=Qd(C.state.doc,V),K=C.state.doc.sliceString(F,N);E=tE(K),E&&Se.debug("[lsp] Private variable rename detected, limiting to current cell",K)}let T=[],I=0;for(let[V,F]of ui.entries(_)){if(E&&V!==o)continue;let N=w.get(V);if(N==null){Se.warn("[lsp] No new code for cell during rename",V),T.push(V);continue}if(!F){Se.warn("[lsp] No editor view for cell during rename",V),T.push(V);continue}Xr(F)!==N&&(_o(F,N),I++)}return T.length>0&&Se.error(`[lsp] Rename partially failed: could not update ${T.length} cell(s)`,T),Se.debug(`[lsp] Rename completed: updated ${I} cell(s)`),{...d,documentChanges:[{edits:[],textDocument:{uri:i,version:0}}]}}async completionItemResolve(n){let i=JSON.stringify(n),o=this.completionItemCache.get(i);if(o)return o;let s=this.client.completionItemResolve(n);return this.completionItemCache.set(i,s),s}async textDocumentPrepareRename(n){let i=n.textDocument.uri;if(!qn.is(i))return Se.warn("Invalid cell document URI",i),null;let{lens:o}=await this.sync(),s=qn.parse(i);return this.client.textDocumentPrepareRename({...n,textDocument:{uri:this.documentUri},position:o.transformPosition(n.position,s)})}async textDocumentHover(n){Se.debug("[lsp] textDocumentHover",n);let{lens:i}=await this.sync(),o=qn.parse(n.textDocument.uri),s=await this.client.textDocumentHover({...n,textDocument:{uri:this.documentUri},position:i.transformPosition(n.position,o)});return s?(typeof s.contents=="object"&&"kind"in s.contents&&(s.contents={kind:"markdown",value:s.contents.value}),s.contents===""?null:(s.range&&(s.range=i.reverseRange(s.range,o)),s)):(Se.debug("[lsp] no hover result"),s)}async textDocumentCompletion(n){let{lens:i}=this.snapshotter.getLatestSnapshot();if(!qn.is(n.textDocument.uri))return Se.error("[lsp] Invalid cell document URI in completion request",n.textDocument.uri),null;let o=qn.parse(n.textDocument.uri);if(!o||o==="undefined")return Se.error("[lsp] Invalid cellId 'undefined' in completion request",{cellId:o,uri:n.textDocument.uri,availableCellIds:i.cellIds}),null;i.cellIds.includes(o)||Se.warn("[lsp] CellId in completion request not found in current lens",{cellId:o,uri:n.textDocument.uri,availableCellIds:i.cellIds});let s=i.transformPosition(n.position,o);return this.client.textDocumentCompletion({...n,textDocument:{uri:this.documentUri},position:s})}patchProcessNotification(){In("processNotification"in this.client,"processNotification is not a method on the client");let n=this.client.processNotification.bind(this.client),i=o=>{if(o.method==="textDocument/publishDiagnostics"){Se.debug("[lsp] handling diagnostics",o);let s=this.snapshotter.getLatestSnapshot(),c=o.params.diagnostics,{lens:d,version:f}=s,p=new Map;for(let _ of c)for(let C of d.cellIds)if(d.isInRange(_.range,C)){p.has(C)||p.set(C,[]);let E={..._,range:d.reverseRange(_.range,C)};p.get(C).push(E);break}let y=new Set(d.cellIds);zr.pruneSeenCellUris(y);let w=new Set(zr.SEEN_CELL_DOCUMENT_URIS);for(let[_,C]of p.entries()){Se.debug("[lsp] diagnostics for cell",_,C);let E=qn.of(_);w.delete(E),n({...o,params:{...o.params,uri:E,version:f,diagnostics:C}})}if(w.size>0){Se.debug("[lsp] clearing diagnostics",w);for(let _ of w)n({method:"textDocument/publishDiagnostics",params:{uri:_,diagnostics:[]}})}return}return n(o)};this.client.processNotification=i}},ke(zr,"SEEN_CELL_DOCUMENT_URIS",new Set),zr),iE=Al(),aE=Oa(),oE=class extends aE.Transport{constructor(n){super();ke(this,"isClosed",!1);ke(this,"hasConnectedBefore",!1);ke(this,"pendingSubscriptions",[]);this.options=n,this.delegate=void 0}createDelegate(){if(this.delegate)try{this.delegate.close()}catch(n){Se.warn("Error closing old WebSocket delegate",n)}this.delegate=new iE.WebSocketTransport(this.options.getWsUrl());for(let{event:n,handler:i}of this.pendingSubscriptions)this.delegate.subscribe(n,i);return this.delegate}isDelegateClosedOrClosing(){if(!this.delegate)return!0;let n=this.delegate.connection;return n?n.readyState===WebSocket.CLOSING||n.readyState===WebSocket.CLOSED:!0}async connect(){if(this.isClosed)throw Error("Transport is closed");return this.connectionPromise||(this.connectionPromise=(async()=>{try{this.options.waitForConnection&&await this.options.waitForConnection();let n=this.delegate;(!n||this.isDelegateClosedOrClosing())&&(n=this.createDelegate()),await n.connect(),Se.log("WebSocket transport connected successfully");let i=this.hasConnectedBefore;this.hasConnectedBefore=!0,i&&this.options.onReconnect&&(Se.log("Calling onReconnect callback to re-synchronize state"),await this.options.onReconnect())}catch(n){throw Se.error("WebSocket transport connection failed",n),this.delegate=void 0,n}finally{this.connectionPromise=void 0}})()),this.connectionPromise}close(){var n;this.isClosed=!0,(n=this.delegate)==null||n.close(),this.delegate=void 0,this.connectionPromise=void 0}subscribe(...n){super.subscribe(...n);let[i,o]=n;this.pendingSubscriptions.push({event:i,handler:o}),this.delegate&&this.delegate.subscribe(i,o)}unsubscribe(...n){let i=super.unsubscribe(...n),[o,s]=n;return this.pendingSubscriptions=this.pendingSubscriptions.filter(c=>!(c.event===o&&c.handler===s)),this.delegate&&this.delegate.unsubscribe(o,s),i}async sendData(n,i){var o;if(this.isDelegateClosedOrClosing()){Se.warn("WebSocket is closed or closing, attempting to reconnect");try{await this.connect()}catch(s){throw Se.error("Failed to reconnect WebSocket",s),s}}return(o=this.delegate)==null?void 0:o.sendData(n,i)}};function rf(e,n){let i=b4();return new oE({getWsUrl:()=>i.getLSPURL(e).toString(),waitForConnection:async()=>{await w4()},onReconnect:n})}Bi.define(),new Ou;function sE(e){return e.facet(S4.readOnly)}function lE(e){return[rw(e),Ra.of([{key:"ArrowRight",preventDefault:!0,run:n=>zy(n,e)},{key:"Tab",preventDefault:!0,run:n=>zy(n,e)}])]}function zy(e,n){if(sE(e.state))return!1;let i=e.state.doc.length;return i===0?(e.dispatch({changes:{from:0,to:i,insert:n},selection:{head:n.length,anchor:n.length}}),!0):!1}function cE(e){let{beforeText:n,linkText:i,afterText:o,onClick:s}=e;return[rw(c=>{let d=document.createElement("span");d.append(document.createTextNode(n));let f=document.createElement("span");return f.textContent=i,f.classList.add("cm-clickable-placeholder"),f.onclick=p=>{p.stopPropagation(),s(c)},d.append(f),d.append(document.createTextNode(o)),d}),Kt.theme({".cm-placeholder":{color:"var(--slate-8)"},".cm-clickable-placeholder":{cursor:"pointer !important",pointerEvents:"auto",color:"var(--slate-9)",textDecoration:"underline",textUnderlineOffset:"0.2em"},".cm-clickable-placeholder:hover":{color:"var(--sky-11)"}})]}var uE=di(e=>{let n,i={transport:rf("pylsp",async()=>{await(n==null?void 0:n())}),rootUri:tf(),workspaceFolders:[]},o=e==null?void 0:e.pylsp,s=["D100","D103"],c=["W292","E402"],d=["B018","I001"],f={pylsp:{plugins:{marimo_plugin:{enabled:!0},jedi:{auto_import_modules:["numpy"]},jedi_completion:{include_params:!0,resolve_at_most:50},flake8:{enabled:o==null?void 0:o.enable_flake8,extendIgnore:c},pydocstyle:{enabled:o==null?void 0:o.enable_pydocstyle,ignore:s},pylint:{enabled:o==null?void 0:o.enable_pylint},pyflakes:{enabled:o==null?void 0:o.enable_pyflakes},pylsp_mypy:{enabled:o==null?void 0:o.enable_mypy,live_mode:!0},ruff:{enabled:o==null?void 0:o.enable_ruff,extendIgnore:[...c,...s,...d]},signature:{formatter:o!=null&&o.enable_ruff?"ruff":"black",line_length:88}}}},p=new nf(new Il({...i}),f);return n=()=>p.resyncAllDocuments(),p}),dE=di(e=>{let n,i=new nf(new Il({transport:rf("ty",async()=>{await(n==null?void 0:n())}),rootUri:tf(),workspaceFolders:[],getWorkspaceConfiguration:o=>[{disableLanguageServices:!0}]}),{});return n=()=>i.resyncAllDocuments(),i}),fE=di(e=>{let n,i=new nf(new Il({transport:rf("basedpyright",async()=>{await(n==null?void 0:n())}),rootUri:tf(),workspaceFolders:[]}),{});return n=()=>i.resyncAllDocuments(),i}),pE=class{constructor(){ke(this,"parser",new yS);ke(this,"type","python");ke(this,"defaultCode",this.parser.defaultCode);ke(this,"defaultMetadata",this.parser.defaultMetadata)}transformIn(e){let n=this.parser.transformIn(e);return[n.code,n.offset,n.metadata]}transformOut(e,n){let i=this.parser.transformOut(e,n);return[i.code,i.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,i,o,s){return[(()=>{var w,_,C,E;let c={defaultKeymap:!1,activateOnTyping:n.activate_on_typing,closeOnBlur:!1},d={hideOnChange:!0},f=[];(w=s==null?void 0:s.pylsp)!=null&&w.enabled&&ac("pylsp")&&f.push(uE(s)),(_=s==null?void 0:s.ty)!=null&&_.enabled&&ac("ty")&&f.push(dE(s)),(C=s==null?void 0:s.basedpyright)!=null&&C.enabled&&ac("basedpyright")&&f.push(fE(s));let p=n.signature_hint_on_typing,y=p?/(\w+|\w+\.|\/)$/:/(\w+|\w+\.|\(|\/|,)$/;if(f.length>0){let T=f.length===1?f[0]:new UC(f);return[Lh({client:T,languageId:"python",allowHTMLContent:!0,useSnippetOnCompletion:!0,hoverConfig:d,completionConfig:c,diagnosticsEnabled:((E=s.diagnostics)==null?void 0:E.enabled)??!1,sendIncrementalChanges:!1,signatureHelpEnabled:!0,signatureActivateOnTyping:p,signatureHelpOptions:{position:"above"},keyboardShortcuts:{signatureHelp:i.getHotkey("cell.signatureHelp").key,goToDefinition:i.getHotkey("cell.goToDefinition").key,rename:i.getHotkey("cell.renameSymbol").key},completionMatchBefore:y,onGoToDefinition:I=>{Se.debug("onGoToDefinition",I),T.documentUri!==I.uri&&Vi().openFile({path:I.uri.replace("file://","")})}}),yg.of(qn.of(e))]}return Mu({...c,override:[Py]})})(),Cm(),hE(o)]}};function hE(e){return e==="marimo-import"?Pu.highest(lE("import marimo as mo")):e==="ai"?cE({beforeText:"Start coding or ",linkText:"generate",afterText:" with AI.",onClick:n=>{n.state.facet(Pt).aiCellCompletion()}}):[]}var af=Th.configure({props:[E4.add({ParenthesizedExpression:lw,ArgList:lw})]});Cm=function(){return new fw(af,[af.data.of({autocomplete:SD}),af.data.of({autocomplete:CD})])};const mE=e=>{let n;return async()=>(n||(n=e()),await n)};var cc=class{constructor(e={}){ke(this,"opts");ke(this,"parser",null);ke(this,"offsetRecord",{});ke(this,"getParser",mE(async()=>{if(this.parser)return this.parser;let e=await ce(()=>import("./node-sql-parser-UQ9Ur_LP.js").then(async i=>(await i.__tla,i)).then(JR(1)),__vite__mapDeps([213,1]),import.meta.url),{Parser:n}=e.default||e;return this.parser=new n,this.parser}));this.opts=e}async parse(e,n){var s,c;this.offsetRecord={};let i=(c=(s=this.opts).getParserOptions)==null?void 0:c.call(s,n.state),o=await this.sanitizeSql(e,i);try{let d=await this.getParser();return(i==null?void 0:i.database)==="DuckDB"?this.parseWithDuckDBSupport(o,i):{success:!0,errors:[],ast:d.astify(o,i)}}catch(d){return{success:!1,errors:[this.extractErrorInfo(d,o)]}}}async sanitizeSql(e,n){if(n!=null&&n.ignoreBrackets){let{sql:i,offsetRecord:o}=vE(e);return this.offsetRecord=o,i}return e}async parseWithDuckDBSupport(e,n){let i=await this.getParser(),o=gE(e).trimStart().toLowerCase();if(o.startsWith("from")||o.includes("macro"))return{success:!0,errors:[]};let s=e;o.includes("create or replace table")&&(this.offsetRecord[e.indexOf("create or replace table")]=-11,s=e.replace(/create or replace table/i,"create table"));try{let c={...n,database:"PostgreSQL"};return{success:!0,errors:[],ast:i.astify(s,c)}}catch(c){return{success:!1,errors:[this.extractErrorInfo(c,e)]}}}extractErrorInfo(e,n){var d,f,p;let i=1,o=1,s=(e==null?void 0:e.message)||"SQL parsing error",c=e;if(c!=null&&c.location)i=((d=c.location.start)==null?void 0:d.line)||1,o=((f=c.location.start)==null?void 0:f.column)||1;else if(c!=null&&c.hash)i=c.hash.line||1,o=((p=c.hash.loc)==null?void 0:p.first_column)||1;else{let y=s.match(/line (\d+)/i),w=s.match(/column (\d+)/i);y!=null&&y[1]&&(i=parseInt(y[1],10)),w!=null&&w[1]&&(o=parseInt(w[1],10))}for(let[y,w]of Object.entries(this.offsetRecord))o>parseInt(y,10)&&(o-=w);return o>n.length&&(o=n.length),{message:this.cleanErrorMessage(s),line:Math.max(1,i),column:o,severity:"error"}}cleanErrorMessage(e){return e.replace(/^Error: /,"").replace(/Expected .* but .* found\./i,n=>n.replace(/but .* found/,"found unexpected token")).trim()}async validateSql(e,n){return(await this.parse(e,n)).errors}async extractTableReferences(e,n){var o,s;let i=n?(s=(o=this.opts).getParserOptions)==null?void 0:s.call(o,n.state):void 0;try{return(await this.getParser()).tableList(e,i).map(c=>{let d=c.split("::");return d[d.length-1]||c})}catch{return[]}}async extractColumnReferences(e,n){var o,s;let i=n!=null&&n.state?(s=(o=this.opts).getParserOptions)==null?void 0:s.call(o,n.state):void 0;try{return(await this.getParser()).columnList(e,i).map(c=>{let d=c.split("::");return d[d.length-1]||c})}catch{return[]}}};function gE(e,n=["/*","--"]){let i=[];if(n.includes("/*")&&i.push("/\\*[\\s\\S]*?\\*/"),n.includes("--")&&i.push("--[^\\n]*"),i.length===0)return e;let o=RegExp(`^\\s*(${i.join("|")})\\s*`,""),s=e,c="";for(;s!==c;)c=s,s=s.replace(o,"");return s}var yE=2;function vE(e){let n={};return{sql:e.replace(/("(?:[^"\\]|\\.)*")|('(?:[^'\\]|\\.)*')|(\{[^}]*\})/g,(i,o,s,c,d)=>o||s?i:c?(n[d]=yE,`'${c}'`):i),offsetRecord:n}}var bE=750;function wE(e,n){let i=n.line(e.line).from+Math.max(0,e.column-1);return{from:i,to:i+1,severity:e.severity,message:e.message,source:"sql-parser"}}function _E(e={}){let n=e.parser||new cc;return Y4(async i=>{let o=i.state.doc,s=o.toString();return s.trim()?(await n.validateSql(s,{state:i.state})).map(c=>wE(c,o)):[]},{delay:e.delay||bE})}function Ha(e){return typeof e=="object"&&!Array.isArray(e)&&!("self"in e)}function hi(e){return typeof e=="object"&&!Array.isArray(e)&&"self"in e&&"children"in e}function jr(e){return Array.isArray(e)}function jn(e,n,i,o){let s=e.length;if(n==="string"||n==="completion"&&o&&jr(o))return"column";if(n==="namespace"&&i){if(jr(i))return"table";if(Ha(i))return Object.values(i).some(c=>jr(c)||hi(c)&&jr(c.children))?s<=1?"database":"schema":s===0?"database":"namespace"}if(n==="completion"&&i)return jr(i)?"table":(Ha(i)&&Object.values(i).some(c=>jr(c)||hi(c)&&jr(c.children)),s<=1?"database":"schema");switch(s){case 0:return"database";case 1:return"schema";default:return"namespace"}}function Fy(e,n,i={}){let{maxDepth:o=10}=i;if(n===""&&hi(e)){let c=jn([],"completion",e.children);return{completion:e.self,path:[],type:"completion",semanticType:c,namespace:e.children}}let s=n.split(".").filter(c=>c.length>0);return s.length===0||s.length>o?null:of(e,s,[],i)}function of(e,n,i,o,s){if(n.length===0){if(hi(e)){let p=jn(i,"completion",e.children,s);return{completion:e.self,path:i,type:"completion",semanticType:p,namespace:e.children}}return{path:i,type:"namespace",semanticType:jn(i,"namespace",e,s),namespace:e}}let[c,...d]=n,{caseSensitive:f=!1}=o;if(!c)return null;if(Ha(e)){let p=f?Object.keys(e).find(y=>y===c):Object.keys(e).find(y=>y.toLowerCase()===c.toLowerCase());if(p){let y=e[p];if(y)return of(y,d,[...i,p],o,e)}}else{if(hi(e))return of(e.children,n,i,o,e);if(jr(e)){for(let p of e)if(typeof p=="string"){if((f?p===c:p.toLowerCase()===c.toLowerCase())&&d.length===0){let y=jn([...i,p],"string",void 0,e);return{value:p,path:[...i,p],type:"string",semanticType:y}}}else if((f?p.label===c:p.label.toLowerCase()===c.toLowerCase())&&d.length===0){let y=jn([...i,p.label],"completion",void 0,e);return{completion:p,path:[...i,p.label],type:"completion",semanticType:y}}}}return null}function xE(e,n,i={}){let o=[];if(n.includes(".")){let s=n.lastIndexOf("."),c=n.substring(0,s),d=n.substring(s+1),f=Fy(e,c,i);if(f!=null&&f.namespace)return sf(f.namespace,d,f.path,i)}else return sf(e,n,[],i);return o}function sf(e,n,i,o){let s=[],{caseSensitive:c=!1,allowPartialMatch:d=!0}=o;if(Ha(e)){for(let[f,p]of Object.entries(e))if(d?c?f.startsWith(n):f.toLowerCase().startsWith(n.toLowerCase()):c?f===n:f.toLowerCase()===n.toLowerCase())if(hi(p)){let y=jn([...i,f],"completion",p.children,e);s.push({completion:p.self,path:[...i,f],type:"completion",semanticType:y,namespace:p.children})}else{let y=jn([...i,f],"namespace",p,e);s.push({path:[...i,f],type:"namespace",semanticType:y,namespace:p})}}else if(hi(e)){if(d?c?e.self.label.startsWith(n):e.self.label.toLowerCase().startsWith(n.toLowerCase()):c?e.self.label===n:e.self.label.toLowerCase()===n.toLowerCase()){let f=jn([...i,e.self.label],"completion",e.children);s.push({completion:e.self,path:[...i,e.self.label],type:"completion",semanticType:f,namespace:e.children})}s.push(...sf(e.children,n,i,o))}else if(jr(e)){for(let f of e)if(typeof f=="string"){if(d?c?f.startsWith(n):f.toLowerCase().startsWith(n.toLowerCase()):c?f===n:f.toLowerCase()===n.toLowerCase()){let p=jn([...i,f],"string",void 0,e);s.push({value:f,path:[...i,f],type:"string",semanticType:p})}}else if(d?c?f.label.startsWith(n):f.label.toLowerCase().startsWith(n.toLowerCase()):c?f.label===n:f.label.toLowerCase()===n.toLowerCase()){let p=jn([...i,f.label],"completion",void 0,e);s.push({completion:f,path:[...i,f.label],type:"completion",semanticType:p})}}return s}function kE(e,n,i={}){let o=[],{maxDepth:s=10}=i;uc(e,[],o,s);let{caseSensitive:c=!1}=i;return o.filter(d=>d.path.some(f=>c?f===n:f.toLowerCase()===n.toLowerCase())).sort((d,f)=>{var w,_;let p=c?d.path[d.path.length-1]===n:((w=d.path[d.path.length-1])==null?void 0:w.toLowerCase())===n.toLowerCase(),y=c?f.path[f.path.length-1]===n:((_=f.path[f.path.length-1])==null?void 0:_.toLowerCase())===n.toLowerCase();return p&&!y?-1:!p&&y?1:d.path.length-f.path.length})}function uc(e,n,i,o){if(!(n.length>=o)){if(Ha(e))for(let[s,c]of Object.entries(e)){let d=[...n,s];if(hi(c)){let f=jn(d,"completion",c.children,e);i.push({completion:c.self,path:d,type:"completion",semanticType:f,namespace:c.children}),uc(c.children,d,i,o)}else{let f=jn(d,"namespace",c,e);i.push({path:d,type:"namespace",semanticType:f,namespace:c}),uc(c,d,i,o)}}else if(hi(e)){let s=jn(n,"completion",e.children);i.push({completion:e.self,path:n,type:"completion",semanticType:s,namespace:e.children}),uc(e.children,n,i,o)}else if(jr(e))for(let s of e)if(typeof s=="string"){let c=jn([...n,s],"string",void 0,e);i.push({value:s,path:[...n,s],type:"string",semanticType:c})}else{let c=jn([...n,s.label],"completion",void 0,e);i.push({completion:s,path:[...n,s.label],type:"completion",semanticType:c})}}}function By(e,n,i={}){let{enableFuzzySearch:o=!1}=i,s=Fy(e,n,i);if(s)return s;let c=xE(e,n,i);if(c.length>0)return c[0]||null;if(o){let d=kE(e,n,i);if(d.length>0)return d[0]||null}return null}function Hy(e,n){if(n.size===0)return{};if(Ha(e)){let i={};for(let[o,s]of Object.entries(e))if(Array.from(n).some(c=>c.toLowerCase()===o.toLowerCase()))i[o]=s;else if(Ha(s)){let c=Hy(s,n);Object.keys(c).length>0&&(i[o]=c)}return i}return e}function SE(e={}){let{schema:n={},keywords:i={},hoverTime:o=300,enableKeywords:s=!0,enableTables:c=!0,enableColumns:d=!0,enableFuzzySearch:f=!0,parser:p=new cc,tooltipRender:y,tooltipRenderers:w={}}=e,_=null;return wh(async(C,E,T)=>{let{from:I,to:$,text:V}=C.state.doc.lineAt(E),F=E,N=E;_===null&&(_=typeof i=="function"?i(C):Promise.resolve(i));let K=await _;for(;F>I&&/[\w.]/.test(V[F-I-1]??"");)F--;for(;N<$&&/[\w.]/.test(V[N-I]??"");)N++;if(F===E&&T<0||N===E&&T>0)return null;let pe=V.slice(F-I,N-I).toLowerCase();if(!pe||pe.length===0)return null;let P=typeof n=="function"?n(C):n,A=null;if(`${pe}`,!A&&s&&K[pe]&&(K[pe],A={word:pe,view:C,pos:E,tooltipType:"keyword",keywordData:{keyword:pe,info:K[pe]}}),!A&&(c||d)&&P){let W=C.state.doc.toString(),de=await p.extractTableReferences(W),fe=new Set(de.map(be=>be.toLowerCase())),we=Hy(P,fe),J=By(we,pe,{enableFuzzySearch:f});!J&&fe.size===0&&(J=By(P,pe,{enableFuzzySearch:f})),J&&(Array.from(fe),A={word:pe,view:C,pos:E,tooltipType:"namespace",namespaceData:{item:J,word:pe,resolvedSchema:fe.size>0?we:P}})}return A?{pos:F,end:N,above:!0,create(W){if(y){let we=y(pe,W,E);if(we)return{dom:we}}let de=null;if(A.tooltipType==="keyword"&&A.keywordData)de=w.keyword?w.keyword(A.keywordData):$y(A.keywordData);else if(A.tooltipType==="namespace"&&A.namespaceData){let we=A.namespaceData,{semanticType:J}=we.item;de=J==="table"&&w.table?w.table(we):J==="column"&&w.column?w.column(we):(J==="database"||J==="schema"||J==="namespace")&&w.namespace?w.namespace(we):Vy(we.item)}if(!de)return{dom:document.createElement("div")};let fe=document.createElement("div");return fe.className="cm-sql-hover-tooltip",fe.innerHTML=de,{dom:fe}}}:null},{hoverTime:o})}function Vy(e){var s,c,d,f,p,y,w;let n=e.path.join("."),i=((s=e.completion)==null?void 0:s.label)||e.value||e.path[e.path.length-1]||"unknown",o=`<div class="sql-hover-${e.semanticType}">`;switch(o+=`<div class="sql-hover-header"><strong>${i}</strong> <span class="sql-hover-type">${e.semanticType}</span></div>`,e.semanticType){case"database":if(o+=`<div class="sql-hover-description">Database${(c=e.completion)!=null&&c.detail?`: ${e.completion.detail}`:""}</div>`,e.namespace){let _=dc(e.namespace);_>0&&(o+=`<div class="sql-hover-children">Contains ${_} schema${_===1?"":"s"}</div>`)}break;case"schema":if(o+=`<div class="sql-hover-description">Schema${(d=e.completion)!=null&&d.detail?`: ${e.completion.detail}`:""}</div>`,n&&(o+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${n}</code></div>`),e.namespace){let _=dc(e.namespace);_>0&&(o+=`<div class="sql-hover-children">Contains ${_} table${_===1?"":"s"}</div>`)}break;case"table":if(o+=`<div class="sql-hover-description">Table${(f=e.completion)!=null&&f.detail?`: ${e.completion.detail}`:""}</div>`,n){let _=e.path;_.length>1&&(o+=`<div class="sql-hover-path"><strong>Schema:</strong> <code>${_.slice(0,-1).join(".")}</code></div>`)}if(e.namespace&&jr(e.namespace)){let _=e.namespace;if(_.length>0){o+=`<div class="sql-hover-columns"><strong>Columns (${_.length}):</strong><br>`;let C=_.slice(0,8).map(E=>typeof E=="string"?E:E.label);o+=C.map(E=>`<code>${E}</code>`).join(", "),_.length>8&&(o+=`, <em>and ${_.length-8} more...</em>`),o+="</div>"}}break;case"column":if(o+=`<div class="sql-hover-description">Column${(p=e.completion)!=null&&p.detail?`: ${e.completion.detail}`:""}</div>`,n){let _=e.path;_.length>1&&(o+=`<div class="sql-hover-path"><strong>Table:</strong> <code>${_.slice(0,-1).join(".")}</code></div>`)}break;default:if(o+=`<div class="sql-hover-description">Namespace${(y=e.completion)!=null&&y.detail?`: ${e.completion.detail}`:""}</div>`,n&&(o+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${n}</code></div>`),e.namespace){let _=dc(e.namespace);_>0&&(o+=`<div class="sql-hover-children">Contains ${_} item${_===1?"":"s"}</div>`)}break}return(w=e.completion)!=null&&w.info&&typeof e.completion.info=="string"&&(o+=`<div class="sql-hover-info">${e.completion.info}</div>`),o+="</div>",o}function dc(e){return Array.isArray(e)?e.length:typeof e=="object"&&e?"self"in e&&"children"in e?1+dc(e.children):Object.keys(e).length:0}function $y(e){let{keyword:n,info:i}=e,o='<div class="sql-hover-keyword">';if(o+=`<div class="sql-hover-header"><strong>${n.toUpperCase()}</strong> <span class="sql-hover-type">keyword</span></div>`,o+=`<div class="sql-hover-description">${i.description}</div>`,i.syntax&&(o+=`<div class="sql-hover-syntax"><strong>Syntax:</strong> <code>${i.syntax}</code></div>`),i.example&&(o+=`<div class="sql-hover-example"><strong>Example:</strong><br><code>${i.example}</code></div>`),i.metadata&&typeof i.metadata=="object"&&Object.keys(i.metadata).length>0){o+='<div class="sql-hover-metadata">';for(let[s,c]of Object.entries(i.metadata))o+=`<span class="sql-hover-tag" title="${s}">${c}</span> `;o+="</div>"}return o+="</div>",o}function CE(e){let{tableName:n,columns:i,metadata:o}=e,s='<div class="sql-hover-table">';if(s+=`<div class="sql-hover-header"><strong>${n}</strong> <span class="sql-hover-type">table</span></div>`,s+=`<div class="sql-hover-description">Table with ${i.length} column${i.length===1?"":"s"}</div>`,i.length>0){s+='<div class="sql-hover-columns"><strong>Columns:</strong><br>';let c=i.slice(0,10);s+=c.map(d=>`<code>${d}</code>`).join(", "),i.length>10&&(s+=`, <em>and ${i.length-10} more...</em>`),s+="</div>"}if(o&&typeof o=="object"&&Object.keys(o).length>0){s+='<div class="sql-hover-metadata">';for(let[c,d]of Object.entries(o))s+=`<span class="sql-hover-tag" title="${c}">${d}</span> `;s+="</div>"}return s+="</div>",s}function EE(e){let{tableName:n,columnName:i,schema:o,metadata:s}=e,c='<div class="sql-hover-column">';c+=`<div class="sql-hover-header"><strong>${i}</strong> <span class="sql-hover-type">column</span></div>`,c+=`<div class="sql-hover-description">Column in table <code>${n}</code></div>`;let d=o[n];if(d&&d.length>1){let f=d.filter(p=>p!==i);if(f.length>0){c+=`<div class="sql-hover-related"><strong>Other columns in ${n}:</strong><br>`;let p=f.slice(0,8);c+=p.map(y=>`<code>${y}</code>`).join(", "),f.length>8&&(c+=`, <em>and ${f.length-8} more...</em>`),c+="</div>"}}if(s&&typeof s=="object"&&Object.keys(s).length>0){c+='<div class="sql-hover-metadata">';for(let[f,p]of Object.entries(s))c+=`<span class="sql-hover-tag" title="${f}">${p}</span> `;c+="</div>"}return c+="</div>",c}const TE={keyword:$y,table:CE,column:EE,namespace:Vy},Wy=(e="light")=>{let n=e==="dark"?{tooltipBg:"#1f2937",tooltipBorder:"#374151",tooltipText:"#f9fafb",tooltipTypeBg:"#374151",tooltipTypeText:"#9ca3af",tooltipChildren:"#9ca3af",codeBg:"#374151",codeText:"#f3f4f6",strong:"#ffffff",em:"#9ca3af",header:"#ffffff",info:"#d1d5db",related:"#d1d5db",path:"#d1d5db",example:"#d1d5db",columns:"#d1d5db",syntax:"#d1d5db"}:{tooltipBg:"#ffffff",tooltipBorder:"#e5e7eb",tooltipText:"#374151",tooltipTypeBg:"#f3f4f6",tooltipTypeText:"#6b7280",tooltipChildren:"#6b7280",codeBg:"#f9fafb",codeText:"#1f2937",strong:"#111827",em:"#6b7280",header:"#111827",info:"#374151",related:"#374151",path:"#374151",example:"#374151",columns:"#374151",syntax:"#374151"};return Kt.theme({".cm-sql-hover-tooltip":{padding:"8px 12px",backgroundColor:n.tooltipBg,border:`1px solid ${n.tooltipBorder}`,borderRadius:"6px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",fontSize:"13px",lineHeight:"1.4",maxWidth:"320px",fontFamily:"system-ui, -apple-system, sans-serif",color:n.tooltipText},".cm-sql-hover-tooltip .sql-hover-header":{marginBottom:"6px",display:"flex",alignItems:"center",gap:"6px",color:n.header},".cm-sql-hover-tooltip .sql-hover-type":{fontSize:"11px",padding:"2px 6px",backgroundColor:n.tooltipTypeBg,color:n.tooltipTypeText,borderRadius:"4px",fontWeight:"500"},".cm-sql-hover-tooltip .sql-hover-description":{color:n.info,marginBottom:"8px"},".cm-sql-hover-tooltip .sql-hover-syntax":{marginBottom:"8px",color:n.syntax},".cm-sql-hover-tooltip .sql-hover-example":{marginBottom:"4px",color:n.example},".cm-sql-hover-tooltip .sql-hover-columns":{marginBottom:"4px",color:n.columns},".cm-sql-hover-tooltip .sql-hover-related":{marginBottom:"4px",color:n.related},".cm-sql-hover-tooltip .sql-hover-path":{marginBottom:"4px",color:n.path},".cm-sql-hover-tooltip .sql-hover-info":{marginBottom:"4px",color:n.info},".cm-sql-hover-tooltip .sql-hover-children":{marginBottom:"4px",color:n.tooltipChildren,fontSize:"12px"},".cm-sql-hover-tooltip code":{backgroundColor:n.codeBg,padding:"1px 4px",borderRadius:"3px",fontSize:"12px",fontFamily:"ui-monospace, 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace",color:n.codeText},".cm-sql-hover-tooltip strong":{fontWeight:"600",color:n.strong},".cm-sql-hover-tooltip em":{fontStyle:"italic",color:n.em}})};var RE=class{constructor(e){ke(this,"parser");ke(this,"cache",new Map);ke(this,"MAX_CACHE_SIZE",10);this.parser=e}async analyzeDocument(e){let n=e.doc.toString(),i=this.generateCacheKey(n),o=this.cache.get(i);if(o)return o;let s=await this.extractStatements(n,e);if(this.cache.set(i,s),this.cache.size>this.MAX_CACHE_SIZE){let c=this.cache.keys().next().value;c!==void 0&&this.cache.delete(c)}return s}async getStatementAtPosition(e,n){return(await this.analyzeDocument(e)).find(i=>n>=i.from&&n<=i.to)||null}async getStatementsInRange(e,n,i){return(await this.analyzeDocument(e)).filter(o=>o.from<=i&&o.to>=n)}async extractStatements(e,n){let i=[],o=this.splitByStatementSeparators(e),s=0;for(let c of o){let d=c.trim();if(d.length===0){s+=c.length;continue}let f=s+c.indexOf(d),p=f+d.length,y=n.doc.lineAt(f),w=n.doc.lineAt(p),_=this.stripComments(d);if(_.trim().length===0||_.trim()===";"){s+=c.length;continue}let C=await this.parser.parse(_,{state:n}),E=this.determineStatementType(_),T=_.endsWith(";")?_.slice(0,-1).trim():_.trim();i.push({from:f,to:p,lineFrom:y.number,lineTo:w.number,content:T,type:E,isValid:C.success}),s+=c.length}return i}splitByStatementSeparators(e){let n=[],i="",o=!1,s="",c=!1,d=!1,f=0;for(;f<e.length;){let p=e[f],y=e[f+1];if(!o&&!d&&p==="-"&&y==="-"){c=!0,i+=p+y,f+=2;continue}if(!o&&!c&&p==="/"&&y==="*"){d=!0,i+=p+y,f+=2;continue}if(d&&p==="*"&&y==="/"){d=!1,i+=p+y,f+=2;continue}if(c&&(p===`
137
137
  `||p==="\r")){c=!1,i+=p,f++;continue}if(c||d){i+=p,f++;continue}if(!o&&(p==="'"||p==='"'||p==="`"))o=!0,s=p,i+=p;else if(o&&p===s){if(y===s){i+=p+y,f+=2;continue}o=!1,s="",i+=p}else!o&&p===";"?(i+=p,n.push(i),i=""):i+=p;f++}return i.trim()&&n.push(i),n}determineStatementType(e){let n=e.trim().toLowerCase();return n.startsWith("select")?"select":n.startsWith("insert")?"insert":n.startsWith("update")?"update":n.startsWith("delete")?"delete":n.startsWith("create")?"create":n.startsWith("drop")?"drop":n.startsWith("alter")?"alter":n.startsWith("use")?"use":"other"}stripComments(e){let n="",i=!1,o="",s=!1,c=!1,d=0;for(;d<e.length;){let f=e[d],p=e[d+1];if(!i&&!c&&f==="-"&&p==="-"){s=!0,d+=2;continue}if(!i&&!s&&f==="/"&&p==="*"){c=!0,d+=2;continue}if(c&&f==="*"&&p==="/"){c=!1,d+=2;continue}if(s&&(f===`
138
138
  `||f==="\r")){s=!1,n+=f,d++;continue}if(s||c){d++;continue}if(!i&&(f==="'"||f==='"'||f==="`"))i=!0,o=f,n+=f;else if(i&&f===o){if(p===o){n+=f+p,d+=2;continue}i=!1,o="",n+=f}else n+=f;d++}return n}generateCacheKey(e){let n=0;for(let i=0;i<e.length;i++){let o=e.charCodeAt(i);n=(n<<5)-n+o,n&=n}return n.toString()}clearCache(){this.cache.clear()}},Uy=Bi.define(),Ky=xs.define({create(){return{currentStatement:null,allStatements:[],cursorPosition:0,isFocused:!0}},update(e,n){for(let i of n.effects)if(i.is(Uy))return i.value;return e}}),DE=class extends A4{constructor(n,i,o=!0,s=!0){super();ke(this,"config");ke(this,"isCurrent");ke(this,"isValid");ke(this,"isFocused");this.config=n,this.isCurrent=i,this.isValid=o,this.isFocused=s}toDOM(){let n=document.createElement("div");n.className="cm-sql-gutter-marker";let i=this.config.backgroundColor||"#3b82f6";!this.isValid&&this.config.showInvalid!==!1&&(i=this.config.errorBackgroundColor||"#ef4444");let o;return o=this.isFocused?this.isCurrent?"1":(this.config.inactiveOpacity||"0.3").toString():this.config.unfocusedOpacity===void 0?this.config.hideWhenNotFocused?"0":this.isCurrent?"1":(this.config.inactiveOpacity||"0.3").toString():this.config.unfocusedOpacity.toString(),n.style.cssText=`
139
139
  background: ${i};
@@ -142,16 +142,16 @@ mark line col
142
142
  opacity: ${o};
143
143
  transition: opacity 150ms ease-in-out;
144
144
  border-radius: 1px;
145
- `,n}eq(n){return this.isCurrent===n.isCurrent&&this.isValid===n.isValid&&this.isFocused===n.isFocused&&this.config===n.config}};function OE(e,n){var f;let i=P4.empty;if((f=n.whenHide)!=null&&f.call(n,e))return i;let o=e.state.field(Ky,!1);if(!o)return i;let{currentStatement:s,allStatements:c,isFocused:d}=o;try{for(let p of c){let y=(s==null?void 0:s.from)===p.from&&(s==null?void 0:s.to)===p.to;if(!p.isValid&&n.showInvalid===!1)continue;let w=new DE(n,y,p.isValid,d);for(let _=p.lineFrom;_<=p.lineTo;_++)try{if(_<1||_>e.state.doc.lines)continue;let C=e.state.doc.line(_);i=i.update({add:[w.range(C.from)]})}catch(C){console.warn("SqlGutter: Invalid line number",_,C)}}}catch(p){console.warn("SqlGutter: Error creating markers",p)}return i}function PE(e){return Kt.updateListener.of(async n=>{if(!n.docChanged&&!n.selectionSet&&!n.focusChanged)return;let{state:i}=n.view,{main:o}=i.selection,s=o.head,c=await e.analyzeDocument(i),d={currentStatement:await e.getStatementAtPosition(i,s),allStatements:c,cursorPosition:s,isFocused:n.view.hasFocus};n.view.dispatch({effects:Uy.of(d)})})}function ME(e){let n=e.width||3;return Kt.baseTheme({".cm-sql-gutter":{width:`${n}px`,minWidth:`${n}px`},".cm-sql-gutter .cm-gutterElement":{width:`${n}px`,padding:"0",margin:"0"},".cm-sql-gutter-marker":{width:"100%",height:"100%",display:"block"},".cm-lineNumbers .cm-gutterElement":{paddingLeft:"8px",paddingRight:"8px"}})}function LE(e){return M4({class:`cm-sql-gutter ${e.className||""}`,markers:n=>OE(n,e)})}function NE(e={}){return[Ky,PE(new RE(e.parser||new uc)),ME(e),LE(e)]}function IE(e={}){let n=[],{enableLinting:i=!0,enableGutterMarkers:o=!0,enableHover:s=!0,linterConfig:c,gutterConfig:d,hoverConfig:f}=e;return i&&n.push(_E(c)),o&&n.push(NE(d)),s&&(n.push(SE(f)),f!=null&&f.theme?n.push(f.theme):n.push(Wy())),n}var AE=class vx{static jsonStringifySortKeys(){return n=>typeof n!="object"||!n?String(n):JSON.stringify(n,Object.keys(n).sort(),2)}constructor(n,i={}){this.delegate=n,this.toKey=i.toKey??vx.jsonStringifySortKeys(),this.cache=new rc(i.maxSize??128)}request(n){let i=this.toKey(n),o=this.cache.get(i);if(o!==void 0)return o;let s=this.delegate.request(n);return this.cache.set(i,s),s.catch(c=>{throw this.cache.delete(i),c})}resolve(n,i){this.delegate.resolve(n,i)}reject(n,i){this.delegate.reject(n,i)}};zw=new Nu("sql-table-preview",async(e,n)=>{await Vi().previewSQLTable({requestId:e,...n})}),qw=new Nu("sql-table-list-preview",async(e,n)=>{await Vi().previewSQLTableList({requestId:e,...n})}),Jh=new AE(new Nu("validate-sql",async(e,n)=>{await Vi().validateSQL({requestId:e,...n})}),{maxSize:3});var qE=Jr();let Va;Va=ze(new Map),a_=e=>{let n=(0,qE.c)(3),i=Zn(Va),o;return n[0]!==e||n[1]!==i?(o=i.get(e),n[0]=e,n[1]=i,n[2]=o):o=n[2],o};function Qy(e){let n=lt.get(Va),i=new Map(n);i.delete(e),lt.set(Va,i)}function jE(){lt.set(Va,new Map)}function zE({cellId:e,errorMessage:n,dialect:i}){let o=lt.get(Va),s=new Map(o),c=i==="DuckDB"?FE(n):Gy(n);s.set(e,c),lt.set(Va,s)}function FE(e){let{errorType:n,errorMessage:i}=Gy(e),o=i,s,c=i.indexOf("LINE ");return c!==-1&&(s=i.slice(Math.max(0,c)).trim(),o=i.slice(0,Math.max(0,c)).trim()),{errorType:n,errorMessage:o,codeblock:s}}function Gy(e){return{errorType:e.split(":")[0].trim(),errorMessage:e.split(":").slice(1).join(":").trim()}}function Jy(e){return e.field(fi)}function BE(){return e=>{let n=Jy(e.state).engine,i=Fa.getCompletionSource(n);return i&&uD(i)(e)||null}}function HE(){return e=>{let n=Jy(e.state).engine,i=Fa.getDialect(n);return e.matchBefore(/\.\w*/)?null:gD(i,!0,(o,s)=>({label:o,type:s,info:async()=>{let c=(await VE())[o.toLocaleLowerCase()];if(!c)return null;let d=document.createElement("div");return d.innerHTML=TE.keyword({keyword:o,info:c}),d}}))(e)}}var VE=di(async()=>{let e=await ce(()=>import("./common-keywords-CU-S2Vqm.js").then(async i=>(await i.__tla,i)),[],import.meta.url),n=await ce(()=>import("./duckdb-keywords-CR9f4wu5.js").then(async i=>(await i.__tla,i)),[],import.meta.url);return{...e.default.keywords,...n.default.keywords}}),$E=Jr(),Xy=Hl("marimo:notebook-sql-mode","default",Vl);function WE(){let e=(0,$E.c)(3),[n,i]=Q2(Xy),o;return e[0]!==i||e[1]!==n?(o={sqlMode:n,setSQLMode:i},e[0]=i,e[1]=n,e[2]=o):o=e[2],o}function Yy(){return lt.get(Xy)}var UE=Sg,KE="DuckDB",Zy=new Pu;function lf(){return lt.get(ko).latestEngineSelected}let ev;fd=(bf=class{constructor(){ke(this,"parser",new ey);ke(this,"type","sql");this.sqlModeEnabled=!0}get defaultMetadata(){return{...this.parser.defaultMetadata,engine:lf()||"__marimo_duckdb"}}get defaultCode(){let e=lf();return e&&e!=="__marimo_duckdb"?`_df = mo.sql(f"""SELECT * FROM """, engine=${e})`:this.parser.defaultCode}transformIn(e){this.parser.defaultMetadata.engine=lf()||"__marimo_duckdb";let n=this.parser.transformIn(e),i=n.metadata;return i.engine&&i.engine!=="__marimo_duckdb"&&Tg(i.engine),[n.code,n.offset,i]}transformOut(e,n){let i=this.parser.transformOut(e,n);return[i.code,i.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,i,o,s){var d;let c=[Zy.of(_w({dialect:UE})),Ra.of([{key:"Tab",run:f=>aD(f)||H4(f),preventDefault:!0}]),Lu({defaultKeymap:!1,activateOnTyping:!0,override:[BE(),VC,HE()]})];if(((d=s==null?void 0:s.diagnostics)==null?void 0:d.sql_linter)??!1){let f=lt.get(TD),p=new ev({getParserOptions:y=>({database:nv(y)??KE})});c.push(IE({enableLinting:!0,linterConfig:{delay:250,parser:p},enableGutterMarkers:!0,gutterConfig:{backgroundColor:"#3b82f6",errorBackgroundColor:"#ef4444",hideWhenNotFocused:!0,parser:p},hoverConfig:{schema:JE,hoverTime:300,enableKeywords:!0,enableTables:!0,enableColumns:!0,parser:p,theme:Wy(f)}}),Kt.updateListener.of(y=>{y.focusChanged&&p.setFocusState(y.view.hasFocus)}))}return this.sqlModeEnabled&&c.push(YE()),c}},ke(bf,"fromQuery",e=>ey.fromQuery(e)),bf),ev=class extends uc{constructor(){super(...arguments);ke(this,"validationTimeout",null);ke(this,"VALIDATION_DELAY_MS",300);ke(this,"isFocused",!1)}setFocusState(n){this.isFocused=n}async validateWithDelay(n,i,o){return this.validationTimeout&&window.clearTimeout(this.validationTimeout),new Promise(s=>{this.validationTimeout=window.setTimeout(async()=>{var c;if(!this.isFocused){s([]);return}try{let d=await iv(n,i,o,Yy());if(d.error){Se.error("Failed to validate SQL",{error:d.error}),s([]);return}s(((c=d.parse_result)==null?void 0:c.errors)??[])}catch(d){Se.error("Failed to validate SQL",{error:d}),s([])}},this.VALIDATION_DELAY_MS)})}async validateSql(n,i){let o=Fo(i.state);if(!this.isFocused)return[];if(!xo.has(o.engine))return super.validateSql(n,i);let s=nv(i.state);return this.validateWithDelay(n,o.engine,s)}async parse(n,i){return Fo(i.state).engine==="__marimo_duckdb"?{success:!0,errors:[]}:super.parse(n,i)}};function tv(e,n){e.dispatch({effects:Zy.reconfigure(_w({dialect:n}))})}function QE(e,n){tv(e,Fa.getDialect(n))}function GE(e){let n=Fo(e.state).engine;tv(e,Fa.getDialect(n))}function Fo(e){return e.field(fi)}function JE(e){let n=Fo(e.state).engine,i=Fa.getCompletionSource(n);return i!=null&&i.schema?i.schema:{}}function nv(e){let n=Fo(e).engine;return rv(n)}function rv(e){var i;let n=(i=Fa.getInternalDialect(e))==null?void 0:i.toLowerCase();if(!n||!nc(n))return null;switch(n){case"postgresql":case"postgres":return"PostgreSQL";case"db2":case"db2i":return"DB2";case"mysql":return"MySQL";case"sqlite":return"Sqlite";case"mssql":case"sqlserver":case"microsoft sql server":return"TransactSQL";case"duckdb":return"DuckDB";case"mariadb":return"MariaDB";case"cassandra":return"Noql";case"athena":case"awsathena":return"Athena";case"bigquery":return"BigQuery";case"hive":return"Hive";case"redshift":return"Redshift";case"snowflake":return"Snowflake";case"flink":return"FlinkSQL";case"mongodb":case"noql":return"Noql";case"oracle":case"oracledb":case"timescaledb":case"couchbase":case"trino":case"tidb":case"singlestoredb":case"spark":case"databricks":case"datafusion":return Se.debug("Unsupported dialect",{dialect:n}),null;default:return _s(n),null}}var XE=300;function YE(){let e,n=null;return Kt.updateListener.of(i=>{if(!i.docChanged)return;let o=Yy();if(o==="default")return;let s=Fo(i.state).engine;if(!xo.has(s))return;let c=i.state.doc.toString();e&&window.clearTimeout(e),e=window.setTimeout(async()=>{if(n===c)return;n=c;let d=i.view.state.facet(Wi);if(c===""){Qy(d);return}try{let f=rv(s),p=(await iv(c,s,f,o)).validate_result;p!=null&&p.error_message?zE({cellId:d,errorMessage:p.error_message,dialect:f}):Qy(d)}catch(f){Se.error("Failed to validate SQL",{error:f})}},XE)})}async function iv(e,n,i,o){let s=await Jh.request({onlyParse:o==="default",engine:n,dialect:i,query:e});if(s.error)throw Error(s.error);return s}var ZE=di(()=>new pE),e3=di(()=>new nd),t3=di(()=>new fd);gr={get python(){return ZE()},get markdown(){return e3()},get sql(){return t3()}};function n3(){return Object.values(gr)}var jt=gh(Ru(),1),pc="Checkbox",[r3,VD]=RD(pc),[i3,cf]=r3(pc);function a3(e){let{__scopeCheckbox:n,checked:i,children:o,defaultChecked:s,disabled:c,form:d,name:f,onCheckedChange:p,required:y,value:w="on",internal_do_not_use_render:_}=e,[C,E]=DD({prop:i,defaultProp:s??!1,onChange:p,caller:pc}),[T,I]=jt.useState(null),[$,V]=jt.useState(null),F=jt.useRef(!1),N=T?!!d||!!T.closest("form"):!0,K={checked:C,disabled:c,setChecked:E,control:T,setControl:I,name:f,form:d,value:w,hasConsumerStoppedPropagationRef:F,required:y,defaultChecked:ea(s)?!1:s,isFormControl:N,bubbleInput:$,setBubbleInput:V};return(0,B.jsx)(i3,{scope:n,...K,children:o3(_)?_(K):o})}var av="CheckboxTrigger",ov=jt.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:i,...o},s)=>{let{control:c,value:d,disabled:f,checked:p,required:y,setControl:w,setChecked:_,hasConsumerStoppedPropagationRef:C,isFormControl:E,bubbleInput:T}=cf(av,e),I=tw(s,w),$=jt.useRef(p);return jt.useEffect(()=>{let V=c==null?void 0:c.form;if(V){let F=()=>_($.current);return V.addEventListener("reset",F),()=>V.removeEventListener("reset",F)}},[c,_]),(0,B.jsx)(Dh.button,{type:"button",role:"checkbox","aria-checked":ea(p)?"mixed":p,"aria-required":y,"data-state":dv(p),"data-disabled":f?"":void 0,disabled:f,value:d,...o,ref:I,onKeyDown:Sw(n,V=>{V.key==="Enter"&&V.preventDefault()}),onClick:Sw(i,V=>{_(F=>ea(F)?!0:!F),T&&E&&(C.current=V.isPropagationStopped(),C.current||V.stopPropagation())})})});ov.displayName=av;var uf=jt.forwardRef((e,n)=>{let{__scopeCheckbox:i,name:o,checked:s,defaultChecked:c,required:d,disabled:f,value:p,onCheckedChange:y,form:w,..._}=e;return(0,B.jsx)(a3,{__scopeCheckbox:i,checked:s,defaultChecked:c,disabled:f,required:d,onCheckedChange:y,name:o,form:w,value:p,internal_do_not_use_render:({isFormControl:C})=>(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(ov,{..._,ref:n,__scopeCheckbox:i}),C&&(0,B.jsx)(uv,{__scopeCheckbox:i})]})})});uf.displayName=pc;var sv="CheckboxIndicator",lv=jt.forwardRef((e,n)=>{let{__scopeCheckbox:i,forceMount:o,...s}=e,c=cf(sv,i);return(0,B.jsx)(OD,{present:o||ea(c.checked)||c.checked===!0,children:(0,B.jsx)(Dh.span,{"data-state":dv(c.checked),"data-disabled":c.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...e.style}})})});lv.displayName=sv;var cv="CheckboxBubbleInput",uv=jt.forwardRef(({__scopeCheckbox:e,...n},i)=>{let{control:o,hasConsumerStoppedPropagationRef:s,checked:c,defaultChecked:d,required:f,disabled:p,name:y,value:w,form:_,bubbleInput:C,setBubbleInput:E}=cf(cv,e),T=tw(i,E),I=LD(c),$=jD(o);jt.useEffect(()=>{let F=C;if(!F)return;let N=window.HTMLInputElement.prototype,K=Object.getOwnPropertyDescriptor(N,"checked").set,pe=!s.current;if(I!==c&&K){let P=new Event("click",{bubbles:pe});F.indeterminate=ea(c),K.call(F,ea(c)?!1:c),F.dispatchEvent(P)}},[C,I,c,s]);let V=jt.useRef(ea(c)?!1:c);return(0,B.jsx)(Dh.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??V.current,required:f,disabled:p,name:y,value:w,form:_,...n,tabIndex:-1,ref:T,style:{...n.style,...$,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});uv.displayName=cv;function o3(e){return typeof e=="function"}function ea(e){return e==="indeterminate"}function dv(e){return ea(e)?"indeterminate":e?"checked":"unchecked"}let fv;fv=Jr(),Fl=jt.forwardRef((e,n)=>{let i=(0,fv.c)(10),o,s;i[0]===e?(o=i[1],s=i[2]):({className:o,...s}=e,i[0]=e,i[1]=o,i[2]=s);let c;i[3]===o?c=i[4]:(c=Du("flex items-center justify-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",o),i[3]=o,i[4]=c);let d;i[5]===Symbol.for("react.memo_cache_sentinel")?(d=(0,B.jsx)(lv,{className:Du("flex items-center justify-center text-current max-h-[14px] overflow-hidden"),children:(0,B.jsx)(yD,{className:"h-4 w-4"})}),i[5]=d):d=i[5];let f;return i[6]!==s||i[7]!==n||i[8]!==c?(f=(0,B.jsx)(uf,{ref:n,className:c,...s,children:d}),i[6]=s,i[7]=n,i[8]=c,i[9]=f):f=i[9],f}),Fl.displayName=uf.displayName,h_="_";var s3=new Set("__*.marimo.app.False.None.True.__peg_parser__.and.as.assert.async.await.break.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.nonlocal.not.or.pass.raise.return.try.while.with.yield.None.setup".split("."));Nm=function(e,n=!0){return e=e.trim(),e?(/^\d/.test(e)&&(e=`_${e}`),e=e.replaceAll(/\W/g,"_"),n?e.toLowerCase():e):"_"},dx=function(e,n){let i=new Set(n),o=e,s=d=>!i.has(d)&&!s3.has(d);if(s(e))return e;let c=1;for(;!s(o);)o=`${e}_${c}`,c++;return o},ix=function(e,n){return mm(e)?`cell-${n}`:e},mm=function(e){return e?e==="_"||e==="__":!0};var l3=Jr();function c3(e){let n=(0,l3.c)(15),{minWidth:i,padding:o}=e,s=i===void 0?70:i,c=o===void 0?15:o,[d,f]=(0,jt.useState)(50),p=(0,jt.useRef)(null),y=(0,jt.useRef)(null),w;n[0]===c?w=n[1]:(w=P=>{if(y.current&&p.current){let A=y.current;A.style.fontSize=window.getComputedStyle(p.current).fontSize,A.style.fontFamily=window.getComputedStyle(p.current).fontFamily,A.textContent=P;let W=A.offsetWidth;f(W+c)}},n[0]=c,n[1]=w);let _=w,C;n[2]===_?C=n[3]:(C=()=>{var P;_(((P=p.current)==null?void 0:P.value)??"")},n[2]=_,n[3]=C),m4(C);let E;n[4]===_?E=n[5]:(E=P=>{_(P.target.value)},n[4]=_,n[5]=E);let T=`${d}px`,I=`${s}px`,$;n[6]!==T||n[7]!==I?($={width:T,minWidth:I},n[6]=T,n[7]=I,n[8]=$):$=n[8];let V;n[9]!==E||n[10]!==$?(V={ref:p,type:"text",onChange:E,style:$},n[9]=E,n[10]=$,n[11]=V):V=n[11];let F=V,N;n[12]===Symbol.for("react.memo_cache_sentinel")?(N={ref:y,style:{visibility:"hidden",position:"absolute",whiteSpace:"pre"}},n[12]=N):N=n[12];let K=N,pe;return n[13]===F?pe=n[14]:(pe={inputProps:F,spanProps:K},n[13]=F,n[14]=pe),pe}var u3=Jr();function d3({currentQuotePrefix:e,checked:n,prefix:i}){let o=e;return n?e===""?o=i:e!=="rf"&&i!==e&&(o="rf"):e===i?o="":e==="rf"&&(o=i==="r"?"f":"r"),o}let pv;pv=()=>{let e=(0,u3.c)(2),n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,B.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,B.jsxs)("header",{className:"flex items-center gap-1",children:[(0,B.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"r"}),(0,B.jsx)("span",{className:"font-semibold",children:"Raw String"})]}),(0,B.jsx)("p",{className:"text-sm text-muted-foreground",children:"Write LaTeX without escaping special characters"}),(0,B.jsx)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:"\\alpha \\beta"})]}),e[0]=n):n=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=(0,B.jsxs)("div",{className:"flex flex-col gap-3.5",children:[n,(0,B.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,B.jsxs)("header",{className:"flex items-center gap-1",children:[(0,B.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"f"}),(0,B.jsx)("span",{className:"font-semibold",children:"Format String"})]}),(0,B.jsx)("p",{className:"text-sm text-muted-foreground",children:"Interpolate Python values"}),(0,B.jsxs)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:["Hello ","{name}","! \u{1F601}"]})]})]}),e[1]=i):i=e[1],i},Rm="data-cell-id",R_=function(e){return{[Rm]:e}},Cm="data-for-cell-id",Zu=function(e){return{[Cm]:e}};var f3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClickHouse%3c/title%3e%3cpath%20d='M21.333%2010H24v4h-2.667ZM16%201.335h2.667v21.33H16Zm-5.333%200h2.666v21.33h-2.666ZM0%2022.665V1.335h2.667v21.33zm5.333-21.33H8v21.33H5.333Z'/%3e%3c/svg%3e",p3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDatabricks%3c/title%3e%3cpath%20d='M.95%2014.184L12%2020.403l9.919-5.55v2.21L12%2022.662l-10.484-5.96-.565.308v.77L12%2024l11.05-6.218v-4.317l-.515-.309L12%2019.118l-9.867-5.653v-2.21L12%2016.805l11.05-6.218V6.32l-.515-.308L12%2011.974%202.647%206.681%2012%201.388l7.76%204.368.668-.411v-.566L12%200%20.95%206.27v.72L12%2013.207l9.919-5.55v2.26L12%2015.52%201.516%209.56l-.565.308Z'/%3e%3c/svg%3e",h3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAGcElEQVR4nNxZa2wcVxU+99557M6+vLazj6xjO6+maWVTl0YpLU1DU9KARNqooQhFVYJUqUWgiocqIVRESPlRoEhIqYoqgSiCItqQPkAEKUWQtlGSJtAY00R5mTjZTfze94x3HvdedMdZnKgS6s7O2kk/a7R3xvY933fOd874yhhucCyYAIWA9IOH2r+35/HUnjU96sBC8fAERQLpj0+mXjdeXM6rzy/no88uK6zolHu97EX8p/f/IWHAv38i9bsH+kIPo/ozhAJBgpR9J419je437xb62Zc7n/tcf+gRsebADYQAxLW2N/ApL/vNq4AdA7Ht2/piT4q15fAp1wEYAGEALYA18TzT1TXQ09O75qPuKbWS8NW4Lan27/pM4gWrBIgFnaIDvKZIpPPKt+nlgpMTi0q5PKqoqvZR950XAREZaz/fmHmFOFijwGHkDDu5PKGs1SlQ5gAAQ+S9U9Y/xM+Wy+WxRvaeFwE770z+OBNQbmYWwPlp63BPh3q7XQaCxAi50gP7Tldf87J3ywVszEQ2bumOf5WZAAajeWoDJjYOMM5BCECEw9miefxwduaol/1b2sQdCon/8BOZX3ETYWYiODFhvrNUC6ylFgJqzl27DxV+xD3GaGkFnl6deS4G8mJqAmRrtaGkoqxiJnazPpt9gPNVa3DvqfKrXmO0rAJ3RSLrHojHd4jMMwvBSMn+d1pSVrv37oXdz50Hx79JOXgtQGsqIAEiT8V7djtVzEiQ4w+K+t9uCmn3uNmX5rL/l8ullw5c1g80E6slFXgkuuixJVKw3y5jxEzExnV7pB3k7rr3hZDBiZl3njk+9u1mY/legSgm0cfiXbtcTziYHJmovNEXC99PZzAV41KMzaLtXGBVmaQltWfCdPLNxPNdwFdii58KYykhXM2AO5MGvTSAgw9aLnUx8zlomCxTKdeHdP14s/F8tdAiIie2RpPfAPcPNYAjRumNOwLRLZwL2rPgHAGnCF6aHPuJ5869Cr5WYFs0/S0ZkTDns9SK1BltI/JicYcEcXAX8L5R+vOblanf+hHTNwFtWGr7QiT9BAPklnWoVt5/qxrZILQI7wvyjHPrjKkfeL0y9QID76Pzavhmoa3RzNdkLMcYEKCA4aJtncjIgVs4oFnbCCGASDtRVrw3Uz7sV1xfBKiAlc2RJV+vkz9vWYMZWesTa1ER5vYEgot27YPvjJ/dXGBOwY+44JeAdaHkQxpRU9QVQGDIrPz1FjV+f/3eFcaRFcdKosicsh8x6/ClBzaEu7YLoqJNDUonVKR0UCTuRT9w9wshpAzb+qmcY2b9iFlH0xVow0r81sCiz9azfdCY3rNWSzw8a5/ZZ2ItPv9UmfiFP7Tn0HQFPhlMbuKIyOKkhThjNc4rBCtRJl5jrvO5W4mSY+beMib/4A/tOTQtYCCY2kTdszmHE7X8/tWBTtf7s7S528IYELxcuviMycWZzF80baHVgdT6/00fu3oso7Tdwa5Ypt7Aw5Zx7M1K7pf+UL4WTVWgQwqnQ5LWLexTpfblEFaT7Jrsc3GMLDw7+a9tFDj1j/YcmqpAWkn06yhERaYP6ZdeHtC6tl6deYPx4q7xY5+/YFfP+kf5WniqQELp6J6hNaNdia8s4TCojkmrjOYVHGin7qsLQdYqvb976uijk455yX/ac/AkYNLKZx9Nb/kNQkAsLJNBW9+/Uk3eJzI/ZlUG36qcfv6MXf3nmtjtO/ZO/v27/tOeA/L6iyu0pfdu7/riATF93s0fffq+toGdM5zmJ+ziuRgJpWSEgy/mXlk/Zk2f8ZfytfDcxOeM828XHH04TAIJjOTgDAlIiPNEmgQTw9Xh146UBn/aavLgVUAmkLk5IkdXFh09l62NHloaWblZjFGMONjMrsTUjqV5qzjuP90Pw9MUmrKms/2x276U0pbcO2Hlh9qUzj6GMJiclk/q5/b+Ovfqg+P29LD/dD+MhnsgSMLhnlDvPQVrOrcmfufjF2cuvI0BqVlj5GDBKmQZsJbMe9+BAZP1yU3fF+tloVV3LzSfhtEbXrWhO7Ri3ULz8PwmzoRXfTqr/+ddf+k0Dk8CEGBMOWccmC8H82bgSUAmfNO6S/q5Bc8+eBUQDXWtz1VP36gCMC4xnfPrZFw2/I9uLZi6u2aXs7ZdGWkNpcbQcAU0LX2XYYxeF/YBLwIYs0twndjnY4H/BgAA//95CrBYRwImwgAAAABJRU5ErkJggg==",m3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDuckDB%3c/title%3e%3cpath%20d='M12%200C5.363%200%200%205.363%200%2012s5.363%2012%2012%2012%2012-5.363%2012-12S18.637%200%2012%200zM9.502%207.03a4.974%204.974%200%200%201%204.97%204.97%204.974%204.974%200%200%201-4.97%204.97A4.974%204.974%200%200%201%204.532%2012a4.974%204.974%200%200%201%204.97-4.97zm6.563%203.183h2.351c.98%200%201.787.782%201.787%201.762s-.807%201.789-1.787%201.789h-2.351v-3.551z'/%3e%3c/svg%3e",g3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGoogle%20BigQuery%3c/title%3e%3cpath%20d='M5.676%2010.595h2.052v5.244a5.892%205.892%200%200%201-2.052-2.088v-3.156zm18.179%2010.836a.504.504%200%200%201%200%20.708l-1.716%201.716a.504.504%200%200%201-.708%200l-4.248-4.248a.206.206%200%200%201-.007-.007c-.02-.02-.028-.045-.043-.066a10.736%2010.736%200%200%201-6.334%202.065C4.835%2021.599%200%2016.764%200%2010.799S4.835%200%2010.8%200s10.799%204.835%2010.799%2010.8c0%202.369-.772%204.553-2.066%206.333.025.017.052.028.074.05l4.248%204.248zm-5.028-10.632a8.015%208.015%200%201%200-8.028%208.028h.024a8.016%208.016%200%200%200%208.004-8.028zm-4.86%204.98a6.002%206.002%200%200%200%202.04-2.184v-1.764h-2.04v3.948zm-4.5.948c.442.057.887.08%201.332.072.4.025.8.025%201.2%200V7.692H9.468v9.035z'/%3e%3c/svg%3e",y3=""+new URL("iceberg-COKYXo-A.png",import.meta.url).href,v3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMotherDuck%3c/title%3e%3cg%20transform='scale(0.85)%20translate(0,%202)'%3e%3cpath%20fill='%23ff9538'%20d='M1.71%2015.86s7.45%205.32%207.89%205.59c.44.27%201.08.33%201.64.11.56-.22.98-.71%201.11-1.21s1.85-9.49%201.85-9.49c.02-.12.07-.48-.13-.83-.27-.47-.86-.71-1.38-.57-.42.12-.64.44-.7.55-.09.17-.26.45-.57.7-.24.19-.47.3-.58.34-.96.38-2.02.06-2.61-.72-.38-.48-1.04-.67-1.64-.43-.6.24-.94.84-.89%201.45.11.98-.44%201.94-1.4%202.32-.51.21-1.06.21-1.54.05-.12-.03-.51-.12-.89.09-.48.26-.74.84-.61%201.37.09.39.38.62.48.69z'%20/%3e%3cpath%20fill='%23ff9538'%20d='M14.12%204.21s2.65%208.76%202.83%209.24c.19.48.66.92%201.23%201.09.58.16%201.21.03%201.62-.28.41-.31%207.25-6.39%207.25-6.39.09-.08.35-.34.4-.74.07-.53-.25-1.09-.75-1.29-.4-.16-.78-.04-.89%200-.18.08-.48.2-.88.2-.3.01-.55-.05-.67-.08-.99-.28-1.64-1.18-1.63-2.16-.01-.61-.42-1.17-1.04-1.35-.62-.18-1.26.09-1.59.6-.51.84-1.53%201.27-2.52.99-.53-.15-.96-.48-1.25-.91-.07-.09-.33-.4-.76-.48-.54-.09-1.1.22-1.32.71-.16.37-.08.72-.04.84z'%20/%3e%3c/g%3e%3c/svg%3e",b3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMySQL%3c/title%3e%3cpath%20d='M16.405%205.501c-.115%200-.193.014-.274.033v.013h.014c.054.104.146.18.214.273.054.107.1.214.154.32l.014-.015c.094-.066.14-.172.14-.333-.04-.047-.046-.094-.08-.14-.04-.067-.126-.1-.18-.153zM5.77%2018.695h-.927a50.854%2050.854%200%2000-.27-4.41h-.008l-1.41%204.41H2.45l-1.4-4.41h-.01a72.892%2072.892%200%2000-.195%204.41H0c.055-1.966.192-3.81.41-5.53h1.15l1.335%204.064h.008l1.347-4.064h1.095c.242%202.015.384%203.86.428%205.53zm4.017-4.08c-.378%202.045-.876%203.533-1.492%204.46-.482.716-1.01%201.073-1.583%201.073-.153%200-.34-.046-.566-.138v-.494c.11.017.24.026.386.026.268%200%20.483-.075.647-.222.197-.18.295-.382.295-.605%200-.155-.077-.47-.23-.944L6.23%2014.615h.91l.727%202.36c.164.536.233.91.205%201.123.4-1.064.678-2.227.835-3.483zm12.325%204.08h-2.63v-5.53h.885v4.85h1.745zm-3.32.135l-1.016-.5c.09-.076.177-.158.255-.25.433-.506.648-1.258.648-2.253%200-1.83-.718-2.746-2.155-2.746-.704%200-1.254.232-1.65.697-.43.508-.646%201.256-.646%202.245%200%20.972.19%201.686.574%202.14.35.41.877.615%201.583.615.264%200%20.506-.033.725-.098l1.325.772.36-.622zM15.5%2017.588c-.225-.36-.337-.94-.337-1.736%200-1.393.424-2.09%201.27-2.09.443%200%20.77.167.977.5.224.362.336.936.336%201.723%200%201.404-.424%202.108-1.27%202.108-.445%200-.77-.167-.978-.5zm-1.658-.425c0%20.47-.172.856-.516%201.156-.344.3-.803.45-1.384.45-.543%200-1.064-.172-1.573-.515l.237-.476c.438.22.833.328%201.19.328.332%200%20.593-.073.783-.22a.754.754%200%2000.3-.615c0-.33-.23-.61-.648-.845-.388-.213-1.163-.657-1.163-.657-.422-.307-.632-.636-.632-1.177%200-.45.157-.81.47-1.085.315-.278.72-.415%201.22-.415.512%200%20.98.136%201.4.41l-.213.476a2.726%202.726%200%2000-1.064-.23c-.283%200-.502.068-.654.206a.685.685%200%2000-.248.524c0%20.328.234.61.666.85.393.215%201.187.67%201.187.67.433.305.648.63.648%201.168zm9.382-5.852c-.535-.014-.95.04-1.297.188-.1.04-.26.04-.274.167.055.053.063.14.11.214.08.134.218.313.346.407.14.11.28.216.427.31.26.16.555.255.81.416.145.094.293.213.44.313.073.05.12.14.214.172v-.02c-.046-.06-.06-.147-.105-.214-.067-.067-.134-.127-.2-.193a3.223%203.223%200%2000-.695-.675c-.214-.146-.682-.35-.77-.595l-.013-.014c.146-.013.32-.066.46-.106.227-.06.435-.047.67-.106.106-.027.213-.06.32-.094v-.06c-.12-.12-.21-.283-.334-.395a8.867%208.867%200%2000-1.104-.823c-.21-.134-.476-.22-.697-.334-.08-.04-.214-.06-.26-.127-.12-.146-.19-.34-.275-.514a17.69%2017.69%200%2001-.547-1.163c-.12-.262-.193-.523-.34-.763-.69-1.137-1.437-1.826-2.586-2.5-.247-.14-.543-.2-.856-.274-.167-.008-.334-.02-.5-.027-.11-.047-.216-.174-.31-.235-.38-.24-1.364-.76-1.644-.072-.18.434.267.862.422%201.082.115.153.26.328.34.5.047.116.06.235.107.356.106.294.207.622.347.897.073.14.153.287.247.413.054.073.146.107.167.227-.094.136-.1.334-.154.5-.24.757-.146%201.693.194%202.25.107.166.362.534.703.393.3-.12.234-.5.32-.835.02-.08.007-.133.048-.187v.015c.094.188.188.367.274.555.206.328.566.668.867.895.16.12.287.328.487.402v-.02h-.015c-.043-.058-.1-.086-.154-.133a3.445%203.445%200%2001-.35-.4%208.76%208.76%200%2001-.747-1.218c-.11-.21-.202-.436-.29-.643-.04-.08-.04-.2-.107-.24-.1.146-.247.273-.32.453-.127.288-.14.642-.188%201.01-.027.007-.014%200-.027.014-.214-.052-.287-.274-.367-.46-.2-.475-.233-1.238-.06-1.785.047-.14.247-.582.167-.716-.042-.127-.174-.2-.247-.303a2.478%202.478%200%2001-.24-.427c-.16-.374-.24-.788-.414-1.162-.08-.173-.22-.354-.334-.513-.127-.18-.267-.307-.368-.52-.033-.073-.08-.194-.027-.274.014-.054.042-.075.094-.09.088-.072.335.022.422.062.247.1.455.194.662.334.094.066.195.193.315.226h.14c.214.047.455.014.655.073.355.114.675.28.962.46a5.953%205.953%200%20012.085%202.286c.08.154.115.295.188.455.14.33.313.663.455.982.14.315.275.636.476.897.1.14.502.213.682.286.133.06.34.115.46.188.23.14.454.3.67.454.11.076.443.243.463.378z'/%3e%3c/svg%3e",hv=""+new URL("postgresql-q8VEBKGg.svg",import.meta.url).href,w3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAmazon%20Redshift%3c/title%3e%3cpath%20d='M16.639%209.932a.822.822%200%200%201-.822-.82.823.823%200%200%201%201.645%200c0%20.452-.37.82-.823.82m-2.086%204.994a.823.823%200%200%201-.822-.822.822.822%200%200%201%201.645%200%20.822.822%200%200%201-.823.822m-5.004-.833a.822.822%200%201%201%20.002-1.644.822.822%200%200%201-.002%201.644m-2.083%204.578a.823.823%200%200%201-.823-.82.823.823%200%200%201%201.645%200c0%20.452-.37.82-.822.82m9.173-11.236a1.68%201.68%200%200%200-1.68%201.676c0%20.566.285%201.066.718%201.37l-.782%201.982a1.674%201.674%200%200%200-1.923%201.104l-1.753-.398a1.675%201.675%200%200%200-3.348.103c0%20.432.169.823.438%201.12l-.764%201.79c-.028-.001-.053-.008-.08-.008a1.68%201.68%200%200%200-1.68%201.676%201.68%201.68%200%200%200%203.36%200c0-.593-.312-1.112-.778-1.41l.674-1.579c.161.052.33.088.508.088.661%200%201.228-.386%201.502-.94l1.856.42a1.68%201.68%200%200%200%203.327-.325c0-.5-.224-.943-.574-1.25l.822-2.083c.053.005.104.016.157.016a1.68%201.68%200%200%200%201.68-1.676%201.68%201.68%200%200%200-1.68-1.676M12%2023.145c-4.17%200-7.286-1.252-7.286-2.37V4.79C6.14%205.938%209.131%206.547%2012%206.547c2.869%200%205.86-.609%207.286-1.756v15.983c0%201.12-3.116%202.37-7.286%202.37M12%20.856c4.293%200%207.286%201.274%207.286%202.419%200%201.143-2.993%202.418-7.286%202.418-4.293%200-7.286-1.275-7.286-2.418C4.714%202.129%207.707.855%2012%20.855m8.143%202.419C20.143%201.147%2015.947%200%2012%200%208.052%200%203.857%201.147%203.857%203.274l.002.01h-.002v17.49C3.857%2022.87%208.052%2024%2012%2024c3.947%200%208.143-1.13%208.143-3.226V3.284h-.002l.002-.01'/%3e%3c/svg%3e",_3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSnowflake%3c/title%3e%3cpath%20d='M24%203.459c0%20.646-.418%201.18-1.141%201.18-.723%200-1.142-.534-1.142-1.18%200-.647.419-1.18%201.142-1.18.723%200%201.141.533%201.141%201.18zm-.228%200c0-.533-.38-.951-.913-.951s-.913.38-.913.95c0%20.533.38.952.913.952.57%200%20.913-.419.913-.951zm-1.37-.533h.495c.266%200%20.456.152.456.38%200%20.153-.076.229-.19.305l.19.266v.038h-.266l-.19-.266h-.229v.266h-.266zm.495.228h-.229v.267h.229c.114%200%20.152-.038.152-.114.038-.077-.038-.153-.152-.153zM7.602%2012.4c.038-.151.076-.304.076-.456%200-.114-.038-.228-.038-.342-.114-.343-.304-.647-.646-.838l-4.87-2.777c-.685-.38-1.56-.152-1.94.533-.381.685-.153%201.56.532%201.94l2.701%201.56-2.701%201.56c-.685.38-.913%201.256-.533%201.94.38.685%201.256.914%201.94.533l4.832-2.777c.343-.267.571-.533.647-.876zm1.332%202.626c-.266-.038-.57.038-.837.19l-4.832%202.777c-.685.38-.913%201.256-.532%201.94.38.686%201.255.914%201.94.533l2.701-1.56v3.12c0%20.8.647%201.408%201.446%201.408.799%200%201.407-.647%201.407-1.408v-5.592c0-.761-.57-1.37-1.293-1.408zm4.946-6.088c.266.038.57-.038.837-.19l4.832-2.777c.685-.38.913-1.256.532-1.94-.38-.686-1.255-.914-1.94-.533l-2.701%201.56V1.975c0-.799-.647-1.408-1.446-1.408-.799%200-1.446.609-1.446%201.408V7.53c0%20.76.609%201.37%201.332%201.407zM3.265%205.97l4.832%202.777c.266.152.533.19.837.19.723-.038%201.331-.684%201.331-1.407V1.975c0-.799-.646-1.408-1.407-1.408-.799%200-1.446.647-1.446%201.408v3.12l-2.701-1.56c-.685-.38-1.56-.152-1.94.533-.419.646-.19%201.521.494%201.902zm9.093%206.011a.412.412%200%2000-.114-.266l-.57-.571a.346.346%200%2000-.267-.114.412.412%200%2000-.266.114l-.571.57a.411.411%200%2000-.114.267c0%20.076.038.19.114.267l.57.57a.345.345%200%2000.267.114c.076%200%20.19-.038.266-.114l.571-.57a.412.412%200%2000.114-.267zm1.598.533L11.94%2014.53c-.039.038-.153.114-.229.114h-.608a.411.411%200%2001-.267-.114L8.82%2012.514a.408.408%200%2001-.076-.229v-.608c0-.076.038-.19.114-.267l2.016-2.016a.41.41%200%2001.267-.114h.608a.41.41%200%2001.267.114l2.016%202.016a.347.347%200%2001.114.267v.608c-.076.077-.114.19-.19.229zm5.593%205.44l-4.832-2.777c-.266-.152-.57-.19-.837-.152-.723.038-1.332.684-1.332%201.408v5.554c0%20.8.647%201.408%201.408%201.408.799%200%201.446-.647%201.446-1.408v-3.12l2.7%201.56c.686.38%201.561.152%201.941-.533.419-.646.19-1.521-.494-1.94zm2.549-7.533l-2.701%201.56%202.7%201.56c.686.38.914%201.256.533%201.94-.38.685-1.255.913-1.94.533l-4.832-2.778a1.644%201.644%200%2001-.647-.798c-.037-.153-.076-.305-.076-.457%200-.114.039-.228.039-.342.114-.343.342-.647.646-.837l4.832-2.778c.685-.38%201.56-.152%201.94.533.457.609.19%201.484-.494%201.864'/%3e%3c/svg%3e",x3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eApache%20Spark%3c/title%3e%3cpath%20d='M10.812%200c-.425.013-.845.215-1.196.605a3.593%203.593%200%2000-.493.722c-.355.667-.425%201.415-.556%202.143a551.9%20551.9%200%2000-.726%204.087c-.027.16-.096.227-.244.273C5.83%208.386%204.06%208.94%202.3%209.514c-.387.125-.773.289-1.114.506-1.042.665-1.196%201.753-.415%202.71.346.422.79.715%201.284.936%201.1.49%202.202.976%203.3%201.47.019.01.036.013.053.019h-.004l1.306.535c0%20.023.002.045%200%20.073-.2%202.03-.39%204.063-.58%206.095-.04.419-.012.831.134%201.23.317.87%201.065%201.148%201.881.701.372-.204.666-.497.937-.818%201.372-1.623%202.746-3.244%204.113-4.872.111-.133.205-.15.363-.098.349.117.697.231%201.045.347h.001c.02.012.045.02.073.03l.142.042c1.248.416%202.68.775%203.929%201.19.4.132.622.164%201.045.098.311-.048.592-.062.828-.236.602-.33.995-.957.988-1.682-.005-.427-.154-.813-.35-1.186-.82-1.556-1.637-3.113-2.461-4.666-.078-.148-.076-.243.037-.375%201.381-1.615%202.756-3.236%204.133-4.855.272-.32.513-.658.653-1.058.308-.878-.09-1.57-1-1.741a2.783%202.783%200%2000-1.235.069c-1.974.521-3.947%201.041-5.918%201.57-.175.047-.26.015-.355-.144a353.08%20353.08%200%2000-2.421-4.018%204.61%204.61%200%2000-.652-.849c-.371-.37-.802-.549-1.227-.536zm.172%203.703a.592.592%200%2001.189.211c.87%201.446%201.742%202.89%202.609%204.338.07.118.135.16.277.121%201.525-.41%203.052-.813%204.579-1.217.367-.098.735-.193%201.103-.289a.399.399%200%2001-.1.2c-1.259%201.48-2.516%202.962-3.779%204.438-.11.13-.12.22-.04.37.937%201.803%201.768%203.309%202.498%204.76l-3.696-1.019c-.538-.18-1.077-.358-1.615-.539-.163-.055-.25-.03-.36.1-1.248%201.488-2.504%202.97-3.759%204.454a.398.398%200%2001-.18.132c.035-.378.068-.757.104-1.136.149-1.572.297-3.144.451-4.716-.03-.318.117-.405-.322-.545-1.493-.593-3.346-1.321-4.816-1.905a.595.595%200%2001.24-.134c1.797-.57%203.595-1.14%205.394-1.705.127-.04.199-.092.211-.233.013-.148.05-.294.076-.441.241-1.363.483-2.726.726-4.088.068-.386.14-.771.21-1.157z'/%3e%3c/svg%3e",k3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSQLite%3c/title%3e%3cpath%20d='M21.678.521c-1.032-.92-2.28-.55-3.513.544a8.71%208.71%200%200%200-.547.535c-2.109%202.237-4.066%206.38-4.674%209.544.237.48.422%201.093.544%201.561a13.044%2013.044%200%200%201%20.164.703s-.019-.071-.096-.296l-.05-.146a1.689%201.689%200%200%200-.033-.08c-.138-.32-.518-.995-.686-1.289-.143.423-.27.818-.376%201.176.484.884.778%202.4.778%202.4s-.025-.099-.147-.442c-.107-.303-.644-1.244-.772-1.464-.217.804-.304%201.346-.226%201.478.152.256.296.698.422%201.186.286%201.1.485%202.44.485%202.44l.017.224a22.41%2022.41%200%200%200%20.056%202.748c.095%201.146.273%202.13.5%202.657l.155-.084c-.334-1.038-.47-2.399-.41-3.967.09-2.398.642-5.29%201.661-8.304%201.723-4.55%204.113-8.201%206.3-9.945-1.993%201.8-4.692%207.63-5.5%209.788-.904%202.416-1.545%204.684-1.931%206.857.666-2.037%202.821-2.912%202.821-2.912s1.057-1.304%202.292-3.166c-.74.169-1.955.458-2.362.629-.6.251-.762.337-.762.337s1.945-1.184%203.613-1.72C21.695%207.9%2024.195%202.767%2021.678.521m-18.573.543A1.842%201.842%200%200%200%201.27%202.9v16.608a1.84%201.84%200%200%200%201.835%201.834h9.418a22.953%2022.953%200%200%201-.052-2.707c-.006-.062-.011-.141-.016-.2a27.01%2027.01%200%200%200-.473-2.378c-.121-.47-.275-.898-.369-1.057-.116-.197-.098-.31-.097-.432%200-.12.015-.245.037-.386a9.98%209.98%200%200%201%20.234-1.045l.217-.028c-.017-.035-.014-.065-.031-.097l-.041-.381a32.8%2032.8%200%200%201%20.382-1.194l.2-.019c-.008-.016-.01-.038-.018-.053l-.043-.316c.63-3.28%202.587-7.443%204.8-9.791.066-.069.133-.128.198-.194Z'/%3e%3c/svg%3e",S3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSupabase%3c/title%3e%3cpath%20d='M11.9%201.036c-.015-.986-1.26-1.41-1.874-.637L.764%2012.05C-.33%2013.427.65%2015.455%202.409%2015.455h9.579l.113%207.51c.014.985%201.259%201.408%201.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z'/%3e%3c/svg%3e",C3="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3c!--%20Generated%20by%20Pixelmator%20Pro%203.6.17%20--%3e%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Option2SymbolB'%3e%3cg%20id='Layer1-2'%3e%3cg%20id='Group'%20opacity='0.4'%3e%3cpath%20id='Path'%20fill='%23d53c97'%20stroke='none'%20d='M%2017.016802%2012.188573%20C%2017.016802%209.607646%2015.86018%207.293022%2014.039526%205.731081%20C%2013.942595%205.70038%2013.844628%205.671406%2013.745972%205.645189%20C%2013.131133%205.809095%2012.54265%206.059378%2011.998103%206.388559%20C%2013.964327%207.575191%2015.281006%209.730104%2015.281006%2012.188573%20C%2015.279476%2014.563734%2014.033739%2016.764488%2011.998103%2017.988243%20C%2012.542634%2018.317537%2013.131119%2018.567936%2013.745972%2018.731958%20C%2013.844628%2018.705742%2013.942595%2018.67642%2014.039526%2018.645721%20C%2015.86018%2017.084126%2017.016802%2014.769501%2017.016802%2012.188573%20Z'/%3e%3cpath%20id='path1'%20fill='%23d53c97'%20stroke='none'%20d='M%2013.897406%205.609659%20L%2013.894991%205.60759%20C%2013.844973%205.619663%2013.7953%205.631737%2013.745972%205.645189%20C%2013.79599%205.631737%2013.847043%205.622078%2013.897406%205.609659%20Z'/%3e%3cpath%20id='path2'%20fill='%23d53c97'%20stroke='none'%20d='M%201.735796%2012.188573%20C%201.735796%209.164728%203.728925%206.59622%206.470945%205.729357%20C%207.554634%204.797861%208.856011%204.155121%2010.254373%203.860756%20C%209.680216%203.740549%209.095179%203.679977%208.508574%203.68%20C%203.816888%203.68%20-0%207.496887%20-0%2012.188573%20C%20-0%2016.880259%203.816888%2020.697147%208.508574%2020.697147%20C%209.0952%2020.697229%209.680255%2020.636539%2010.254373%2020.516048%20C%208.855971%2020.221794%207.554568%2019.579041%206.470945%2018.647446%20C%203.728925%2017.780582%201.735796%2015.213453%201.735796%2012.188573%20Z'/%3e%3cpath%20id='path3'%20fill='%23d53c97'%20stroke='none'%20d='M%2013.745972%2018.731958%20C%2013.7953%2018.745068%2013.844973%2018.757484%2013.894991%2018.769558%20C%2013.894991%2018.769558%2013.896715%2018.769558%2013.897406%2018.767488%20C%2013.847043%2018.754379%2013.79599%2018.745411%2013.745972%2018.731958%20Z'/%3e%3c/g%3e%3cpath%20id='path4'%20fill='%23ff3b65'%20stroke='none'%20d='M%2020.508402%2012.188573%20C%2020.508402%209.606611%2019.351088%207.290262%2017.5294%205.729357%20C%2016.301817%205.342468%2014.989366%205.313629%2013.745972%205.646223%20C%2016.636665%206.418224%2018.772606%209.058484%2018.772606%2012.189609%20C%2018.772606%2015.320732%2016.636665%2017.960991%2013.745972%2018.731958%20C%2014.98947%2019.064316%2016.301983%2019.034998%2017.5294%2018.647446%20C%2019.419907%2017.034296%2020.508638%2014.673781%2020.508402%2012.188573%20Z'/%3e%3cpath%20id='path5'%20fill='%23ff3b65'%20stroke='none'%20d='M%209.962543%2018.647446%20C%207.220525%2017.780582%205.227395%2015.213453%205.227395%2012.188573%20C%205.227395%209.163693%207.220525%206.59622%209.962543%205.729357%20C%2011.046233%204.797861%2012.34761%204.155121%2013.745972%203.860756%20C%2013.171818%203.74053%2012.586779%203.679956%2012.000173%203.68%20C%207.308832%203.68%203.491599%207.496887%203.491599%2012.188573%20C%203.491599%2016.880259%207.308487%2020.697147%2012.000173%2020.697147%20C%2012.586799%2020.697247%2013.171857%2020.636557%2013.745972%2020.516048%20C%2012.34757%2020.221794%2011.046167%2019.579041%209.962543%2018.647446%20Z'/%3e%3cpath%20id='path6'%20fill='%23383838'%20stroke='none'%20d='M%2015.491772%203.68%20C%2010.800431%203.68%206.983198%207.496887%206.983198%2012.188573%20C%206.983198%2016.880259%2010.800086%2020.697147%2015.491772%2020.697147%20C%2020.183456%2020.697147%2024%2016.880259%2024%2012.188573%20C%2024%207.496887%2020.183456%203.68%2015.491772%203.68%20Z%20M%2022.264549%2012.188573%20C%2022.264549%2015.923018%2019.226215%2018.961351%2015.491772%2018.961351%20C%2011.757326%2018.961351%208.718994%2015.923018%208.718994%2012.188573%20C%208.718994%208.454128%2011.757326%205.415796%2015.491772%205.415796%20C%2019.226215%205.415796%2022.264549%208.454128%2022.264549%2012.188573%20Z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",E3=""+new URL("trino-DFsJbQoT.svg",import.meta.url).href,T3=Jr(),R3={sqlite:k3,duckdb:m3,motherduck:v3,postgres:hv,postgresql:hv,mysql:b3,snowflake:_3,databricks:p3,clickhouse:f3,timeplus:C3,bigquery:g3,trino:E3,iceberg:y3,datafusion:h3,pyspark:x3,redshift:w3,supabase:S3};_m=e=>{let n=(0,T3.c)(11),{name:i,className:o}=e,s=R3[i.toLowerCase()];if(!s){let f;n[0]===o?f=n[1]:(f=Du("mt-0.5",o),n[0]=o,n[1]=f);let p;return n[2]===f?p=n[3]:(p=(0,B.jsx)(Es,{className:f}),n[2]=f,n[3]=p),p}let c;n[4]!==o||n[5]!==s?(c=Du("invert-[.5] dark:invert-[.7]",o,s.endsWith(".png")&&"brightness-100 dark:brightness-100 invert-0 dark:invert-0"),n[4]=o,n[5]=s,n[6]=c):c=n[6];let d;return n[7]!==i||n[8]!==c||n[9]!==s?(d=(0,B.jsx)("img",{src:s,alt:i,className:c}),n[7]=i,n[8]=c,n[9]=s,n[10]=d):d=n[10],d};var df=Jr();const D3=e=>{let n=(0,df.c)(34),{selectedEngine:i,onChange:o,cellId:s}=e,c=Zn(Ju),d=[],f=[];for(let[Ce,Z]of c.entries())xo.has(Ce)?d.push(Z):f.push(Z);let p=sD(),y=i&&!c.has(i),w;n[0]!==c||n[1]!==o||n[2]!==p?(w=Ce=>{if(Ce===mv){window.open(gv,"_blank");return}let Z=c.get(Ce);Z&&(p(),o(Z.name),Tg(Z.name))},n[0]=c,n[1]=o,n[2]=p,n[3]=w):w=n[3];let _=w,C=N3,E=qD,T;n[4]===s?T=n[5]:(T=Zu(s),n[4]=s,n[5]=T);let I;n[6]===Symbol.for("react.memo_cache_sentinel")?(I=(0,B.jsx)(MD,{placeholder:"Select an engine"}),n[6]=I):I=n[6];let $;n[7]===T?$=n[8]:($=(0,B.jsx)(P3,{...T,children:I}),n[7]=T,n[8]=$);let V=ND,F;n[9]===s?F=n[10]:(F=Zu(s),n[9]=s,n[10]=F);let N=ID,K;n[11]===Symbol.for("react.memo_cache_sentinel")?(K=(0,B.jsx)(PD,{children:"Database connections"}),n[11]=K):K=n[11];let pe;n[12]!==y||n[13]!==i?(pe=y&&(0,B.jsx)(Oh,{value:i,children:(0,B.jsxs)("div",{className:"flex items-center gap-1 opacity-50",children:[(0,B.jsx)(Dm,{className:"h-3 w-3"}),(0,B.jsx)("span",{className:"truncate",children:Mg(i)})]})},i),n[12]=y,n[13]=i,n[14]=pe):pe=n[14];let P=C(f),A=f.length>0&&(0,B.jsx)(Cw,{}),W=C(d),de;n[15]===Symbol.for("react.memo_cache_sentinel")?(de=(0,B.jsx)(Cw,{}),n[15]=de):de=n[15];let fe;n[16]===Symbol.for("react.memo_cache_sentinel")?(fe=(0,B.jsx)(Oh,{className:"text-muted-foreground",value:mv,children:(0,B.jsxs)("a",{className:"flex items-center gap-1",href:gv,target:"_blank",rel:"noreferrer",children:[(0,B.jsx)(bD,{className:"h-3 w-3"}),(0,B.jsx)("span",{children:"How to add a database connection"})]})}),n[16]=fe):fe=n[16];let we;n[17]!==N||n[18]!==A||n[19]!==W||n[20]!==K||n[21]!==pe||n[22]!==P?(we=(0,B.jsxs)(N,{children:[K,pe,P,A,W,de,fe]}),n[17]=N,n[18]=A,n[19]=W,n[20]=K,n[21]=pe,n[22]=P,n[23]=we):we=n[23];let J;n[24]!==V||n[25]!==we||n[26]!==F?(J=(0,B.jsx)(V,{...F,children:we}),n[24]=V,n[25]=we,n[26]=F,n[27]=J):J=n[27];let be;return n[28]!==E||n[29]!==_||n[30]!==i||n[31]!==J||n[32]!==$?(be=(0,B.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,B.jsxs)(E,{value:i,onValueChange:_,children:[$,J]})}),n[28]=E,n[29]=_,n[30]=i,n[31]=J,n[32]=$,n[33]=be):be=n[33],be};var mv="__help__",gv="http://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database";const O3=()=>{let e=(0,df.c)(16),{sqlMode:n,setSQLMode:i}=WE(),o;e[0]!==i||e[1]!==n?(o=()=>{let E=n==="validate"?"default":"validate";E==="default"&&jE(),i(E)},e[0]=i,e[1]=n,e[2]=o):o=e[2];let s=o,c=I3,d=A3,f;e[3]===n?f=e[4]:(f=d(n),e[3]=n,e[4]=f);let p;e[5]===n?p=e[6]:(p=c(n),e[5]=n,e[6]=p);let y=n==="validate"?"Validate":"Default",w;e[7]===y?w=e[8]:(w=(0,B.jsx)("span",{className:"ml-1",children:y}),e[7]=y,e[8]=w);let _;e[9]!==s||e[10]!==p||e[11]!==w?(_=(0,B.jsxs)(nw,{variant:"ghost",size:"sm",onClick:s,className:"h-5 px-1.5 text-xs border-border shadow-none hover:bg-accent",children:[p,w]}),e[9]=s,e[10]=p,e[11]=w,e[12]=_):_=e[12];let C;return e[13]!==f||e[14]!==_?(C=(0,B.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,B.jsx)(Ph,{delayDuration:300,content:f,children:_})}),e[13]=f,e[14]=_,e[15]=C):C=e[15],C};var P3=e=>{let n=(0,df.c)(6),i,o;n[0]===e?(i=n[1],o=n[2]):({children:i,...o}=e,n[0]=e,n[1]=i,n[2]=o);let s;return n[3]!==i||n[4]!==o?(s=(0,B.jsx)(AD,{className:"text-xs border-border shadow-none! ring-0! h-5 px-1.5 hover:bg-accent transition-colors",...o,children:i}),n[3]=i,n[4]=o,n[5]=s):s=n[5],s};function M3(e){return e.source!=="iceberg"}function L3(e){return(0,B.jsx)(Oh,{value:e.name,children:(0,B.jsxs)("div",{className:"flex items-center gap-1",children:[(0,B.jsx)(_m,{className:"h-3 w-3",name:e.dialect}),(0,B.jsx)("span",{className:"truncate ml-0.5",children:Mg(e.display_name)})]})},e.name)}function N3(e){return e=e.filter(M3),e.map(L3)}function I3(e){return e==="validate"?(0,B.jsx)(Fd,{className:"h-3 w-3"}):(0,B.jsx)(zd,{className:"h-3 w-3"})}function A3(e){return e==="validate"?(0,B.jsxs)("div",{className:"text-xs",children:[(0,B.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,B.jsx)(Fd,{className:"h-3 w-3"}),"Validate Mode"]}),(0,B.jsx)("p",{children:"Queries are validated as you write them"})]}):(0,B.jsxs)("div",{className:"text-xs",children:[(0,B.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,B.jsx)(zd,{className:"h-3 w-3"}),"Default Mode"]}),(0,B.jsx)("p",{children:"Standard editing"})]})}var yv=Jr(),vv=()=>{let e=(0,yv.c)(1),n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,B.jsx)("div",{className:"h-4 border-r border-border"}),e[0]=n):n=e[0],n};const q3=e=>{let n=(0,yv.c)(102),{view:i}=e,o;n[0]===Symbol.for("react.memo_cache_sentinel")?(o={minWidth:50},n[0]=o):o=n[0];let{spanProps:s,inputProps:c}=c3(o),d;n[1]===i.state?d=n[2]:(d=i.state.field(Lr),n[1]=i.state,n[2]=d);let f=d,p;n[3]===i.state?p=n[4]:(p=i.state.facet(Wi),n[3]=i.state,n[4]=p);let y=p,w;n[5]===Symbol.for("react.memo_cache_sentinel")?(w=(0,B.jsx)("div",{}),n[5]=w):w=n[5];let _=w,C=!1,E;n[6]===i?E=n[7]:(E=V=>{i.dispatch({effects:Hu.of(V),changes:{from:0,to:i.state.doc.length,insert:i.state.doc.toString()}})},n[6]=i,n[7]=E);let T=E;if(f instanceof fd){let V;n[8]===i.state?V=n[9]:(V=i.state.field(fi),n[8]=i.state,n[9]=V);let F=V;C=!0;let N;n[10]===T?N=n[11]:(N=ft=>{let mt=Nm(ft.currentTarget.value,!1);ft.currentTarget.value=mt,T({dataframeName:mt})},n[10]=T,n[11]=N);let K=N,pe;n[12]!==T||n[13]!==i?(pe=ft=>{T({engine:ft}),QE(i,ft)},n[12]=T,n[13]=i,n[14]=pe):pe=n[14];let P=pe,A;n[15]===Symbol.for("react.memo_cache_sentinel")?(A=(0,B.jsx)("span",{className:"select-none",children:"Output variable: "}),n[15]=A):A=n[15];let W;n[16]===c?W=n[17]:(W=ft=>{var mt;(mt=c.onChange)==null||mt.call(c,ft)},n[16]=c,n[17]=W);let de;n[18]===K?de=n[19]:(de=ft=>{ft.key==="Enter"&&ft.shiftKey&&K(ft)},n[18]=K,n[19]=de);let fe;n[20]!==c||n[21]!==F.dataframeName||n[22]!==K||n[23]!==W||n[24]!==de?(fe=(0,B.jsx)("input",{...c,defaultValue:F.dataframeName,onChange:W,onBlur:K,onKeyDown:de,className:"min-w-14 w-auto border border-border rounded px-1 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring"}),n[20]=c,n[21]=F.dataframeName,n[22]=K,n[23]=W,n[24]=de,n[25]=fe):fe=n[25];let we;n[26]===s?we=n[27]:(we=(0,B.jsx)("span",{...s}),n[26]=s,n[27]=we);let J;n[28]!==fe||n[29]!==we?(J=(0,B.jsxs)("label",{className:"flex gap-2 items-center",children:[A,fe,we]}),n[28]=fe,n[29]=we,n[30]=J):J=n[30];let be;n[31]!==y||n[32]!==F.engine||n[33]!==P?(be=(0,B.jsx)(D3,{selectedEngine:F.engine,onChange:P,cellId:y}),n[31]=y,n[32]=F.engine,n[33]=P,n[34]=be):be=n[34];let Ce;n[35]===F.engine?Ce=n[36]:(Ce=F.engine==="__marimo_duckdb"&&(0,B.jsx)(O3,{}),n[35]=F.engine,n[36]=Ce);let Z;n[37]!==F.engine||n[38]!==i?(Z=async()=>{await Wk(i,F.engine)},n[37]=F.engine,n[38]=i,n[39]=Z):Z=n[39];let re;n[40]===Symbol.for("react.memo_cache_sentinel")?(re=(0,B.jsx)(Fh,{className:"h-3 w-3"}),n[40]=re):re=n[40];let se;n[41]===Z?se=n[42]:(se=(0,B.jsx)(Ph,{content:"Format SQL",children:(0,B.jsx)(nw,{variant:"text",size:"icon",onClick:Z,children:re})}),n[41]=Z,n[42]=se);let Q;n[43]===Symbol.for("react.memo_cache_sentinel")?(Q=(0,B.jsx)(vv,{}),n[43]=Q):Q=n[43];let Le;n[44]===T?Le=n[45]:(Le=ft=>{T({showOutput:!ft.target.checked})},n[44]=T,n[45]=Le);let Fe=!F.showOutput,et;n[46]!==Le||n[47]!==Fe?(et=(0,B.jsx)("input",{type:"checkbox",onChange:Le,checked:Fe}),n[46]=Le,n[47]=Fe,n[48]=et):et=n[48];let Be;n[49]===Symbol.for("react.memo_cache_sentinel")?(Be=(0,B.jsx)("span",{className:"select-none",children:"Hide output"}),n[49]=Be):Be=n[49];let je;n[50]===et?je=n[51]:(je=(0,B.jsxs)("label",{className:"flex items-center gap-2",children:[et,Be]}),n[50]=et,n[51]=je);let Pe;n[52]!==Ce||n[53]!==se||n[54]!==je?(Pe=(0,B.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[Ce,se,Q,je]}),n[52]=Ce,n[53]=se,n[54]=je,n[55]=Pe):Pe=n[55];let Ae;n[56]!==J||n[57]!==be||n[58]!==Pe?(Ae=(0,B.jsxs)("div",{className:"flex flex-1 gap-2 items-center",children:[J,be,Pe]}),n[56]=J,n[57]=be,n[58]=Pe,n[59]=Ae):Ae=n[59],_=Ae}if(f instanceof nd){C=!0;let V,F,N,K,pe,P,A,W,de,fe;if(n[60]!==T||n[61]!==i.state){let{quotePrefix:Le}=i.state.field(fi);F=Le,F===void 0&&(F="r",T({quotePrefix:F})),fe=(Fe,et)=>{typeof et=="boolean"&&T({quotePrefix:d3({currentQuotePrefix:F,checked:et,prefix:Fe})})},K="flex flex-row w-full justify-end gap-1.5 items-center",de="flex items-center gap-1.5",n[72]===Symbol.for("react.memo_cache_sentinel")?(N=(0,B.jsx)("span",{children:"r"}),n[72]=N):N=n[72],V=Fl,P="Toggle raw string",A="w-3 h-3",W=F.includes("r"),pe=Fe=>{fe("r",Fe)},n[60]=T,n[61]=i.state,n[62]=V,n[63]=F,n[64]=N,n[65]=K,n[66]=pe,n[67]=P,n[68]=A,n[69]=W,n[70]=de,n[71]=fe}else V=n[62],F=n[63],N=n[64],K=n[65],pe=n[66],P=n[67],A=n[68],W=n[69],de=n[70],fe=n[71];let we;n[73]!==V||n[74]!==pe||n[75]!==P||n[76]!==A||n[77]!==W?(we=(0,B.jsx)(V,{"aria-label":P,className:A,checked:W,onCheckedChange:pe}),n[73]=V,n[74]=pe,n[75]=P,n[76]=A,n[77]=W,n[78]=we):we=n[78];let J;n[79]!==N||n[80]!==we||n[81]!==de?(J=(0,B.jsxs)("div",{className:de,children:[N,we]}),n[79]=N,n[80]=we,n[81]=de,n[82]=J):J=n[82];let be;n[83]===Symbol.for("react.memo_cache_sentinel")?(be=(0,B.jsx)("span",{children:"f"}),n[83]=be):be=n[83];let Ce;n[84]===F?Ce=n[85]:(Ce=F.includes("f"),n[84]=F,n[85]=Ce);let Z;n[86]===fe?Z=n[87]:(Z=Le=>{fe("f",Le)},n[86]=fe,n[87]=Z);let re;n[88]!==Ce||n[89]!==Z?(re=(0,B.jsxs)("div",{className:"flex items-center gap-1.5",children:[be,(0,B.jsx)(Fl,{"aria-label":"Toggle f-string",className:"w-3 h-3",checked:Ce,onCheckedChange:Z})]}),n[88]=Ce,n[89]=Z,n[90]=re):re=n[90];let se;n[91]===Symbol.for("react.memo_cache_sentinel")?(se=(0,B.jsx)(Ph,{content:(0,B.jsx)(pv,{}),children:(0,B.jsx)(Au,{className:"w-3 h-3"})}),n[91]=se):se=n[91];let Q;n[92]!==K||n[93]!==J||n[94]!==re?(Q=(0,B.jsxs)("div",{className:K,children:[J,re,se]}),n[92]=K,n[93]=J,n[94]=re,n[95]=Q):Q=n[95],_=Q}let I;n[96]===C?I=n[97]:(I=C&&(0,B.jsx)(vv,{}),n[96]=C,n[97]=I);let $;return n[98]!==_||n[99]!==f.type||n[100]!==I?($=(0,B.jsx)(zD,{children:(0,B.jsxs)("div",{className:"flex justify-between items-center gap-4 pl-2 pt-2",children:[_,I,f.type]})}),n[98]=_,n[99]=f.type,n[100]=I,n[101]=$):$=n[101],$};var ff=new Pu;ud=Bi.define(),Lr=xs.define({create(){return gr.python},update(e,n){for(let i of n.effects)if(i.is(ud))return i.value;return e},provide:e=>bh.from(e,n=>n.type==="python"?null:i=>Qk(i,q3))});function j3(){let e=n3(),n=(i,o)=>{let s=e[o%e.length];return s.isSupported(i)?s:n(i,o+1)};return[Ra.of([{key:"F4",preventDefault:!0,run:i=>{let o=i.state.field(Lr),s=e.findIndex(d=>d.type===o.type),c=n(i.state.doc.toString(),s+1);return o===c?!1:(bv({view:i,nextLanguage:c,opts:{keepCodeAsIs:!1}}),!0)}}])]}function bv({view:e,nextLanguage:n,opts:i}){let o=e.state.field(Lr),s=e.state.doc.toString(),c=e.state.facet(wg),d=e.state.facet(_g),f=e.state.facet(qd),p=e.state.facet(tc),y=e.state.facet(xg),w=e.state.field(fi),_=e.state.selection.main.head,C;if(i.keepCodeAsIs)C=s,o.type!==n.type&&(w={...n.defaultMetadata});else{let[E,T]=o.transformOut(s,w),[I,$,V]=n.transformIn(E);_+=T,_-=$,_=xh(_,0,I.length),C=I,w=V}e.dispatch({effects:[ud.of(n),Fu.of(w),ff.reconfigure(n.getExtension(p,c,d,f,y)),qu.reconfigure([]),Ms.of(!0)],changes:i.keepCodeAsIs?void 0:{from:0,to:e.state.doc.length,insert:C},selection:i.keepCodeAsIs?void 0:mn.cursor(_)}),e.dispatch({effects:[qu.reconfigure([V4()])]}),n.type==="sql"&&GE(e)}H_=function(e){let{placeholderType:n,completionConfig:i,hotkeys:o,cellId:s,lspConfig:c}=e;return[j3(),ff.of(gr.python.getExtension(s,i,o,n,c)),Lr,fi]},X_=function(e){return z3(Xr({state:e}).trim())};function z3(e){return e?gr.markdown.isSupported(e)?gr.markdown:gr.sql.isSupported(e)?gr.sql:gr.python:gr.python}vm=function(e,n){e.state.field(Lr).type!==n.language&&bv({view:e,nextLanguage:gr[n.language],opts:{keepCodeAsIs:n.keepCodeAsIs??!1}})},A_=function(e,{completionConfig:n,hotkeysProvider:i,lspConfig:o}){let s=e.state.field(Lr),c=e.state.facet(qd),d=e.state.facet(tc);return d===void 0&&Se.error("Cell ID is undefined in reconfigureLanguageEffect"),c===void 0&&Se.error("Placeholder type is undefined in reconfigureLanguageEffect"),n===void 0&&Se.error("Completion config is undefined in reconfigureLanguageEffect"),ff.reconfigure(s.getExtension(d,n,i,c,o))},Xr=function(e,n,i){let o=e.state.field(Lr),s=e.state.field(fi),c=e.state.doc.toString();return n===void 0?o.transformOut(c,s)[0]:o.transformOut(c.slice(n,i),s)[0]},_o=function(e,n){let[i]=e.state.field(Lr).transformIn(n);return ju(e,i),i};function F3(e){let n=e.state.selection.main.head,i=e.state.doc.toString(),o=i.length>0&&i[n-1]===`
145
+ `,n}eq(n){return this.isCurrent===n.isCurrent&&this.isValid===n.isValid&&this.isFocused===n.isFocused&&this.config===n.config}};function OE(e,n){var f;let i=P4.empty;if((f=n.whenHide)!=null&&f.call(n,e))return i;let o=e.state.field(Ky,!1);if(!o)return i;let{currentStatement:s,allStatements:c,isFocused:d}=o;try{for(let p of c){let y=(s==null?void 0:s.from)===p.from&&(s==null?void 0:s.to)===p.to;if(!p.isValid&&n.showInvalid===!1)continue;let w=new DE(n,y,p.isValid,d);for(let _=p.lineFrom;_<=p.lineTo;_++)try{if(_<1||_>e.state.doc.lines)continue;let C=e.state.doc.line(_);i=i.update({add:[w.range(C.from)]})}catch(C){console.warn("SqlGutter: Invalid line number",_,C)}}}catch(p){console.warn("SqlGutter: Error creating markers",p)}return i}function PE(e){return Kt.updateListener.of(async n=>{if(!n.docChanged&&!n.selectionSet&&!n.focusChanged)return;let{state:i}=n.view,{main:o}=i.selection,s=o.head,c=await e.analyzeDocument(i),d={currentStatement:await e.getStatementAtPosition(i,s),allStatements:c,cursorPosition:s,isFocused:n.view.hasFocus};n.view.dispatch({effects:Uy.of(d)})})}function ME(e){let n=e.width||3;return Kt.baseTheme({".cm-sql-gutter":{width:`${n}px`,minWidth:`${n}px`},".cm-sql-gutter .cm-gutterElement":{width:`${n}px`,padding:"0",margin:"0"},".cm-sql-gutter-marker":{width:"100%",height:"100%",display:"block"},".cm-lineNumbers .cm-gutterElement":{paddingLeft:"8px",paddingRight:"8px"}})}function LE(e){return M4({class:`cm-sql-gutter ${e.className||""}`,markers:n=>OE(n,e)})}function NE(e={}){return[Ky,PE(new RE(e.parser||new cc)),ME(e),LE(e)]}function IE(e={}){let n=[],{enableLinting:i=!0,enableGutterMarkers:o=!0,enableHover:s=!0,linterConfig:c,gutterConfig:d,hoverConfig:f}=e;return i&&n.push(_E(c)),o&&n.push(NE(d)),s&&(n.push(SE(f)),f!=null&&f.theme?n.push(f.theme):n.push(Wy())),n}var AE=class vx{static jsonStringifySortKeys(){return n=>typeof n!="object"||!n?String(n):JSON.stringify(n,Object.keys(n).sort(),2)}constructor(n,i={}){this.delegate=n,this.toKey=i.toKey??vx.jsonStringifySortKeys(),this.cache=new nc(i.maxSize??128)}request(n){let i=this.toKey(n),o=this.cache.get(i);if(o!==void 0)return o;let s=this.delegate.request(n);return this.cache.set(i,s),s.catch(c=>{throw this.cache.delete(i),c})}resolve(n,i){this.delegate.resolve(n,i)}reject(n,i){this.delegate.reject(n,i)}};Fw=new Lu("sql-table-preview",async(e,n)=>{await Vi().previewSQLTable({requestId:e,...n})}),jw=new Lu("sql-table-list-preview",async(e,n)=>{await Vi().previewSQLTableList({requestId:e,...n})}),Gh=new AE(new Lu("validate-sql",async(e,n)=>{await Vi().validateSQL({requestId:e,...n})}),{maxSize:3});var qE=Jr();let Va;Va=ze(new Map),a_=e=>{let n=(0,qE.c)(3),i=Zn(Va),o;return n[0]!==e||n[1]!==i?(o=i.get(e),n[0]=e,n[1]=i,n[2]=o):o=n[2],o};function Qy(e){let n=lt.get(Va),i=new Map(n);i.delete(e),lt.set(Va,i)}function jE(){lt.set(Va,new Map)}function zE({cellId:e,errorMessage:n,dialect:i}){let o=lt.get(Va),s=new Map(o),c=i==="DuckDB"?FE(n):Gy(n);s.set(e,c),lt.set(Va,s)}function FE(e){let{errorType:n,errorMessage:i}=Gy(e),o=i,s,c=i.indexOf("LINE ");return c!==-1&&(s=i.slice(Math.max(0,c)).trim(),o=i.slice(0,Math.max(0,c)).trim()),{errorType:n,errorMessage:o,codeblock:s}}function Gy(e){return{errorType:e.split(":")[0].trim(),errorMessage:e.split(":").slice(1).join(":").trim()}}function Jy(e){return e.field(fi)}function BE(){return e=>{let n=Jy(e.state).engine,i=Fa.getCompletionSource(n);return i&&uD(i)(e)||null}}function HE(){return e=>{let n=Jy(e.state).engine,i=Fa.getDialect(n);return e.matchBefore(/\.\w*/)?null:gD(i,!0,(o,s)=>({label:o,type:s,info:async()=>{let c=(await VE())[o.toLocaleLowerCase()];if(!c)return null;let d=document.createElement("div");return d.innerHTML=TE.keyword({keyword:o,info:c}),d}}))(e)}}var VE=di(async()=>{let e=await ce(()=>import("./common-keywords-CU-S2Vqm.js").then(async i=>(await i.__tla,i)),[],import.meta.url),n=await ce(()=>import("./duckdb-keywords-CR9f4wu5.js").then(async i=>(await i.__tla,i)),[],import.meta.url);return{...e.default.keywords,...n.default.keywords}}),$E=Jr(),Xy=Bl("marimo:notebook-sql-mode","default",Hl);function WE(){let e=(0,$E.c)(3),[n,i]=Q2(Xy),o;return e[0]!==i||e[1]!==n?(o={sqlMode:n,setSQLMode:i},e[0]=i,e[1]=n,e[2]=o):o=e[2],o}function Yy(){return lt.get(Xy)}var UE=Sg,KE="DuckDB",Zy=new Ou;function lf(){return lt.get(ko).latestEngineSelected}let ev;fd=(bf=class{constructor(){ke(this,"parser",new ey);ke(this,"type","sql");this.sqlModeEnabled=!0}get defaultMetadata(){return{...this.parser.defaultMetadata,engine:lf()||"__marimo_duckdb"}}get defaultCode(){let e=lf();return e&&e!=="__marimo_duckdb"?`_df = mo.sql(f"""SELECT * FROM """, engine=${e})`:this.parser.defaultCode}transformIn(e){this.parser.defaultMetadata.engine=lf()||"__marimo_duckdb";let n=this.parser.transformIn(e),i=n.metadata;return i.engine&&i.engine!=="__marimo_duckdb"&&Tg(i.engine),[n.code,n.offset,i]}transformOut(e,n){let i=this.parser.transformOut(e,n);return[i.code,i.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,i,o,s){var d;let c=[Zy.of(_w({dialect:UE})),Ra.of([{key:"Tab",run:f=>aD(f)||H4(f),preventDefault:!0}]),Mu({defaultKeymap:!1,activateOnTyping:!0,override:[BE(),VC,HE()]})];if(((d=s==null?void 0:s.diagnostics)==null?void 0:d.sql_linter)??!1){let f=lt.get(TD),p=new ev({getParserOptions:y=>({database:nv(y)??KE})});c.push(IE({enableLinting:!0,linterConfig:{delay:250,parser:p},enableGutterMarkers:!0,gutterConfig:{backgroundColor:"#3b82f6",errorBackgroundColor:"#ef4444",hideWhenNotFocused:!0,parser:p},hoverConfig:{schema:JE,hoverTime:300,enableKeywords:!0,enableTables:!0,enableColumns:!0,parser:p,theme:Wy(f)}}),Kt.updateListener.of(y=>{y.focusChanged&&p.setFocusState(y.view.hasFocus)}))}return this.sqlModeEnabled&&c.push(YE()),c}},ke(bf,"fromQuery",e=>ey.fromQuery(e)),bf),ev=class extends cc{constructor(){super(...arguments);ke(this,"validationTimeout",null);ke(this,"VALIDATION_DELAY_MS",300);ke(this,"isFocused",!1)}setFocusState(n){this.isFocused=n}async validateWithDelay(n,i,o){return this.validationTimeout&&window.clearTimeout(this.validationTimeout),new Promise(s=>{this.validationTimeout=window.setTimeout(async()=>{var c;if(!this.isFocused){s([]);return}try{let d=await iv(n,i,o,Yy());if(d.error){Se.error("Failed to validate SQL",{error:d.error}),s([]);return}s(((c=d.parse_result)==null?void 0:c.errors)??[])}catch(d){Se.error("Failed to validate SQL",{error:d}),s([])}},this.VALIDATION_DELAY_MS)})}async validateSql(n,i){let o=Fo(i.state);if(!this.isFocused)return[];if(!xo.has(o.engine))return super.validateSql(n,i);let s=nv(i.state);return this.validateWithDelay(n,o.engine,s)}async parse(n,i){return Fo(i.state).engine==="__marimo_duckdb"?{success:!0,errors:[]}:super.parse(n,i)}};function tv(e,n){e.dispatch({effects:Zy.reconfigure(_w({dialect:n}))})}function QE(e,n){tv(e,Fa.getDialect(n))}function GE(e){let n=Fo(e.state).engine;tv(e,Fa.getDialect(n))}function Fo(e){return e.field(fi)}function JE(e){let n=Fo(e.state).engine,i=Fa.getCompletionSource(n);return i!=null&&i.schema?i.schema:{}}function nv(e){let n=Fo(e).engine;return rv(n)}function rv(e){var i;let n=(i=Fa.getInternalDialect(e))==null?void 0:i.toLowerCase();if(!n||!tc(n))return null;switch(n){case"postgresql":case"postgres":return"PostgreSQL";case"db2":case"db2i":return"DB2";case"mysql":return"MySQL";case"sqlite":return"Sqlite";case"mssql":case"sqlserver":case"microsoft sql server":return"TransactSQL";case"duckdb":return"DuckDB";case"mariadb":return"MariaDB";case"cassandra":return"Noql";case"athena":case"awsathena":return"Athena";case"bigquery":return"BigQuery";case"hive":return"Hive";case"redshift":return"Redshift";case"snowflake":return"Snowflake";case"flink":return"FlinkSQL";case"mongodb":case"noql":return"Noql";case"oracle":case"oracledb":case"timescaledb":case"couchbase":case"trino":case"tidb":case"singlestoredb":case"spark":case"databricks":case"datafusion":return Se.debug("Unsupported dialect",{dialect:n}),null;default:return _s(n),null}}var XE=300;function YE(){let e,n=null;return Kt.updateListener.of(i=>{if(!i.docChanged)return;let o=Yy();if(o==="default")return;let s=Fo(i.state).engine;if(!xo.has(s))return;let c=i.state.doc.toString();e&&window.clearTimeout(e),e=window.setTimeout(async()=>{if(n===c)return;n=c;let d=i.view.state.facet(Wi);if(c===""){Qy(d);return}try{let f=rv(s),p=(await iv(c,s,f,o)).validate_result;p!=null&&p.error_message?zE({cellId:d,errorMessage:p.error_message,dialect:f}):Qy(d)}catch(f){Se.error("Failed to validate SQL",{error:f})}},XE)})}async function iv(e,n,i,o){let s=await Gh.request({onlyParse:o==="default",engine:n,dialect:i,query:e});if(s.error)throw Error(s.error);return s}var ZE=di(()=>new pE),e3=di(()=>new zu),t3=di(()=>new fd);gr={get python(){return ZE()},get markdown(){return e3()},get sql(){return t3()}};function n3(){return Object.values(gr)}var jt=gh(Tu(),1),fc="Checkbox",[r3,VD]=RD(fc),[i3,cf]=r3(fc);function a3(e){let{__scopeCheckbox:n,checked:i,children:o,defaultChecked:s,disabled:c,form:d,name:f,onCheckedChange:p,required:y,value:w="on",internal_do_not_use_render:_}=e,[C,E]=DD({prop:i,defaultProp:s??!1,onChange:p,caller:fc}),[T,I]=jt.useState(null),[$,V]=jt.useState(null),F=jt.useRef(!1),N=T?!!d||!!T.closest("form"):!0,K={checked:C,disabled:c,setChecked:E,control:T,setControl:I,name:f,form:d,value:w,hasConsumerStoppedPropagationRef:F,required:y,defaultChecked:ea(s)?!1:s,isFormControl:N,bubbleInput:$,setBubbleInput:V};return(0,B.jsx)(i3,{scope:n,...K,children:o3(_)?_(K):o})}var av="CheckboxTrigger",ov=jt.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:i,...o},s)=>{let{control:c,value:d,disabled:f,checked:p,required:y,setControl:w,setChecked:_,hasConsumerStoppedPropagationRef:C,isFormControl:E,bubbleInput:T}=cf(av,e),I=tw(s,w),$=jt.useRef(p);return jt.useEffect(()=>{let V=c==null?void 0:c.form;if(V){let F=()=>_($.current);return V.addEventListener("reset",F),()=>V.removeEventListener("reset",F)}},[c,_]),(0,B.jsx)(Dh.button,{type:"button",role:"checkbox","aria-checked":ea(p)?"mixed":p,"aria-required":y,"data-state":dv(p),"data-disabled":f?"":void 0,disabled:f,value:d,...o,ref:I,onKeyDown:Sw(n,V=>{V.key==="Enter"&&V.preventDefault()}),onClick:Sw(i,V=>{_(F=>ea(F)?!0:!F),T&&E&&(C.current=V.isPropagationStopped(),C.current||V.stopPropagation())})})});ov.displayName=av;var uf=jt.forwardRef((e,n)=>{let{__scopeCheckbox:i,name:o,checked:s,defaultChecked:c,required:d,disabled:f,value:p,onCheckedChange:y,form:w,..._}=e;return(0,B.jsx)(a3,{__scopeCheckbox:i,checked:s,defaultChecked:c,disabled:f,required:d,onCheckedChange:y,name:o,form:w,value:p,internal_do_not_use_render:({isFormControl:C})=>(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(ov,{..._,ref:n,__scopeCheckbox:i}),C&&(0,B.jsx)(uv,{__scopeCheckbox:i})]})})});uf.displayName=fc;var sv="CheckboxIndicator",lv=jt.forwardRef((e,n)=>{let{__scopeCheckbox:i,forceMount:o,...s}=e,c=cf(sv,i);return(0,B.jsx)(OD,{present:o||ea(c.checked)||c.checked===!0,children:(0,B.jsx)(Dh.span,{"data-state":dv(c.checked),"data-disabled":c.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...e.style}})})});lv.displayName=sv;var cv="CheckboxBubbleInput",uv=jt.forwardRef(({__scopeCheckbox:e,...n},i)=>{let{control:o,hasConsumerStoppedPropagationRef:s,checked:c,defaultChecked:d,required:f,disabled:p,name:y,value:w,form:_,bubbleInput:C,setBubbleInput:E}=cf(cv,e),T=tw(i,E),I=LD(c),$=jD(o);jt.useEffect(()=>{let F=C;if(!F)return;let N=window.HTMLInputElement.prototype,K=Object.getOwnPropertyDescriptor(N,"checked").set,pe=!s.current;if(I!==c&&K){let P=new Event("click",{bubbles:pe});F.indeterminate=ea(c),K.call(F,ea(c)?!1:c),F.dispatchEvent(P)}},[C,I,c,s]);let V=jt.useRef(ea(c)?!1:c);return(0,B.jsx)(Dh.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??V.current,required:f,disabled:p,name:y,value:w,form:_,...n,tabIndex:-1,ref:T,style:{...n.style,...$,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});uv.displayName=cv;function o3(e){return typeof e=="function"}function ea(e){return e==="indeterminate"}function dv(e){return ea(e)?"indeterminate":e?"checked":"unchecked"}let fv;fv=Jr(),zl=jt.forwardRef((e,n)=>{let i=(0,fv.c)(10),o,s;i[0]===e?(o=i[1],s=i[2]):({className:o,...s}=e,i[0]=e,i[1]=o,i[2]=s);let c;i[3]===o?c=i[4]:(c=Ru("flex items-center justify-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",o),i[3]=o,i[4]=c);let d;i[5]===Symbol.for("react.memo_cache_sentinel")?(d=(0,B.jsx)(lv,{className:Ru("flex items-center justify-center text-current max-h-[14px] overflow-hidden"),children:(0,B.jsx)(yD,{className:"h-4 w-4"})}),i[5]=d):d=i[5];let f;return i[6]!==s||i[7]!==n||i[8]!==c?(f=(0,B.jsx)(uf,{ref:n,className:c,...s,children:d}),i[6]=s,i[7]=n,i[8]=c,i[9]=f):f=i[9],f}),zl.displayName=uf.displayName,h_="_";var s3=new Set("__*.marimo.app.False.None.True.__peg_parser__.and.as.assert.async.await.break.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.nonlocal.not.or.pass.raise.return.try.while.with.yield.None.setup".split("."));Im=function(e,n=!0){return e=e.trim(),e?(/^\d/.test(e)&&(e=`_${e}`),e=e.replaceAll(/\W/g,"_"),n?e.toLowerCase():e):"_"},ux=function(e,n){let i=new Set(n),o=e,s=d=>!i.has(d)&&!s3.has(d);if(s(e))return e;let c=1;for(;!s(o);)o=`${e}_${c}`,c++;return o},rx=function(e,n){return ym(e)?`cell-${n}`:e},ym=function(e){return e?e==="_"||e==="__":!0};var l3=Jr();function c3(e){let n=(0,l3.c)(15),{minWidth:i,padding:o}=e,s=i===void 0?70:i,c=o===void 0?15:o,[d,f]=(0,jt.useState)(50),p=(0,jt.useRef)(null),y=(0,jt.useRef)(null),w;n[0]===c?w=n[1]:(w=P=>{if(y.current&&p.current){let A=y.current;A.style.fontSize=window.getComputedStyle(p.current).fontSize,A.style.fontFamily=window.getComputedStyle(p.current).fontFamily,A.textContent=P;let W=A.offsetWidth;f(W+c)}},n[0]=c,n[1]=w);let _=w,C;n[2]===_?C=n[3]:(C=()=>{var P;_(((P=p.current)==null?void 0:P.value)??"")},n[2]=_,n[3]=C),m4(C);let E;n[4]===_?E=n[5]:(E=P=>{_(P.target.value)},n[4]=_,n[5]=E);let T=`${d}px`,I=`${s}px`,$;n[6]!==T||n[7]!==I?($={width:T,minWidth:I},n[6]=T,n[7]=I,n[8]=$):$=n[8];let V;n[9]!==E||n[10]!==$?(V={ref:p,type:"text",onChange:E,style:$},n[9]=E,n[10]=$,n[11]=V):V=n[11];let F=V,N;n[12]===Symbol.for("react.memo_cache_sentinel")?(N={ref:y,style:{visibility:"hidden",position:"absolute",whiteSpace:"pre"}},n[12]=N):N=n[12];let K=N,pe;return n[13]===F?pe=n[14]:(pe={inputProps:F,spanProps:K},n[13]=F,n[14]=pe),pe}var u3=Jr();function d3({currentQuotePrefix:e,checked:n,prefix:i}){let o=e;return n?e===""?o=i:e!=="rf"&&i!==e&&(o="rf"):e===i?o="":e==="rf"&&(o=i==="r"?"f":"r"),o}let pv;pv=()=>{let e=(0,u3.c)(2),n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,B.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,B.jsxs)("header",{className:"flex items-center gap-1",children:[(0,B.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"r"}),(0,B.jsx)("span",{className:"font-semibold",children:"Raw String"})]}),(0,B.jsx)("p",{className:"text-sm text-muted-foreground",children:"Write LaTeX without escaping special characters"}),(0,B.jsx)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:"\\alpha \\beta"})]}),e[0]=n):n=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=(0,B.jsxs)("div",{className:"flex flex-col gap-3.5",children:[n,(0,B.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,B.jsxs)("header",{className:"flex items-center gap-1",children:[(0,B.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"f"}),(0,B.jsx)("span",{className:"font-semibold",children:"Format String"})]}),(0,B.jsx)("p",{className:"text-sm text-muted-foreground",children:"Interpolate Python values"}),(0,B.jsxs)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:["Hello ","{name}","! \u{1F601}"]})]})]}),e[1]=i):i=e[1],i},Rm="data-cell-id",T_=function(e){return{[Rm]:e}},Em="data-for-cell-id",Yu=function(e){return{[Em]:e}};var f3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClickHouse%3c/title%3e%3cpath%20d='M21.333%2010H24v4h-2.667ZM16%201.335h2.667v21.33H16Zm-5.333%200h2.666v21.33h-2.666ZM0%2022.665V1.335h2.667v21.33zm5.333-21.33H8v21.33H5.333Z'/%3e%3c/svg%3e",p3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDatabricks%3c/title%3e%3cpath%20d='M.95%2014.184L12%2020.403l9.919-5.55v2.21L12%2022.662l-10.484-5.96-.565.308v.77L12%2024l11.05-6.218v-4.317l-.515-.309L12%2019.118l-9.867-5.653v-2.21L12%2016.805l11.05-6.218V6.32l-.515-.308L12%2011.974%202.647%206.681%2012%201.388l7.76%204.368.668-.411v-.566L12%200%20.95%206.27v.72L12%2013.207l9.919-5.55v2.26L12%2015.52%201.516%209.56l-.565.308Z'/%3e%3c/svg%3e",h3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAGcElEQVR4nNxZa2wcVxU+99557M6+vLazj6xjO6+maWVTl0YpLU1DU9KARNqooQhFVYJUqUWgiocqIVRESPlRoEhIqYoqgSiCItqQPkAEKUWQtlGSJtAY00R5mTjZTfze94x3HvdedMdZnKgS6s7O2kk/a7R3xvY933fOd874yhhucCyYAIWA9IOH2r+35/HUnjU96sBC8fAERQLpj0+mXjdeXM6rzy/no88uK6zolHu97EX8p/f/IWHAv38i9bsH+kIPo/ozhAJBgpR9J419je437xb62Zc7n/tcf+gRsebADYQAxLW2N/ApL/vNq4AdA7Ht2/piT4q15fAp1wEYAGEALYA18TzT1TXQ09O75qPuKbWS8NW4Lan27/pM4gWrBIgFnaIDvKZIpPPKt+nlgpMTi0q5PKqoqvZR950XAREZaz/fmHmFOFijwGHkDDu5PKGs1SlQ5gAAQ+S9U9Y/xM+Wy+WxRvaeFwE770z+OBNQbmYWwPlp63BPh3q7XQaCxAi50gP7Tldf87J3ywVszEQ2bumOf5WZAAajeWoDJjYOMM5BCECEw9miefxwduaol/1b2sQdCon/8BOZX3ETYWYiODFhvrNUC6ylFgJqzl27DxV+xD3GaGkFnl6deS4G8mJqAmRrtaGkoqxiJnazPpt9gPNVa3DvqfKrXmO0rAJ3RSLrHojHd4jMMwvBSMn+d1pSVrv37oXdz50Hx79JOXgtQGsqIAEiT8V7djtVzEiQ4w+K+t9uCmn3uNmX5rL/l8ullw5c1g80E6slFXgkuuixJVKw3y5jxEzExnV7pB3k7rr3hZDBiZl3njk+9u1mY/legSgm0cfiXbtcTziYHJmovNEXC99PZzAV41KMzaLtXGBVmaQltWfCdPLNxPNdwFdii58KYykhXM2AO5MGvTSAgw9aLnUx8zlomCxTKdeHdP14s/F8tdAiIie2RpPfAPcPNYAjRumNOwLRLZwL2rPgHAGnCF6aHPuJ5869Cr5WYFs0/S0ZkTDns9SK1BltI/JicYcEcXAX8L5R+vOblanf+hHTNwFtWGr7QiT9BAPklnWoVt5/qxrZILQI7wvyjHPrjKkfeL0y9QID76Pzavhmoa3RzNdkLMcYEKCA4aJtncjIgVs4oFnbCCGASDtRVrw3Uz7sV1xfBKiAlc2RJV+vkz9vWYMZWesTa1ER5vYEgot27YPvjJ/dXGBOwY+44JeAdaHkQxpRU9QVQGDIrPz1FjV+f/3eFcaRFcdKosicsh8x6/ClBzaEu7YLoqJNDUonVKR0UCTuRT9w9wshpAzb+qmcY2b9iFlH0xVow0r81sCiz9azfdCY3rNWSzw8a5/ZZ2ItPv9UmfiFP7Tn0HQFPhlMbuKIyOKkhThjNc4rBCtRJl5jrvO5W4mSY+beMib/4A/tOTQtYCCY2kTdszmHE7X8/tWBTtf7s7S528IYELxcuviMycWZzF80baHVgdT6/00fu3oso7Tdwa5Ypt7Aw5Zx7M1K7pf+UL4WTVWgQwqnQ5LWLexTpfblEFaT7Jrsc3GMLDw7+a9tFDj1j/YcmqpAWkn06yhERaYP6ZdeHtC6tl6deYPx4q7xY5+/YFfP+kf5WniqQELp6J6hNaNdia8s4TCojkmrjOYVHGin7qsLQdYqvb976uijk455yX/ac/AkYNLKZx9Nb/kNQkAsLJNBW9+/Uk3eJzI/ZlUG36qcfv6MXf3nmtjtO/ZO/v27/tOeA/L6iyu0pfdu7/riATF93s0fffq+toGdM5zmJ+ziuRgJpWSEgy/mXlk/Zk2f8ZfytfDcxOeM828XHH04TAIJjOTgDAlIiPNEmgQTw9Xh146UBn/aavLgVUAmkLk5IkdXFh09l62NHloaWblZjFGMONjMrsTUjqV5qzjuP90Pw9MUmrKms/2x276U0pbcO2Hlh9qUzj6GMJiclk/q5/b+Ovfqg+P29LD/dD+MhnsgSMLhnlDvPQVrOrcmfufjF2cuvI0BqVlj5GDBKmQZsJbMe9+BAZP1yU3fF+tloVV3LzSfhtEbXrWhO7Ri3ULz8PwmzoRXfTqr/+ddf+k0Dk8CEGBMOWccmC8H82bgSUAmfNO6S/q5Bc8+eBUQDXWtz1VP36gCMC4xnfPrZFw2/I9uLZi6u2aXs7ZdGWkNpcbQcAU0LX2XYYxeF/YBLwIYs0twndjnY4H/BgAA//95CrBYRwImwgAAAABJRU5ErkJggg==",m3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDuckDB%3c/title%3e%3cpath%20d='M12%200C5.363%200%200%205.363%200%2012s5.363%2012%2012%2012%2012-5.363%2012-12S18.637%200%2012%200zM9.502%207.03a4.974%204.974%200%200%201%204.97%204.97%204.974%204.974%200%200%201-4.97%204.97A4.974%204.974%200%200%201%204.532%2012a4.974%204.974%200%200%201%204.97-4.97zm6.563%203.183h2.351c.98%200%201.787.782%201.787%201.762s-.807%201.789-1.787%201.789h-2.351v-3.551z'/%3e%3c/svg%3e",g3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGoogle%20BigQuery%3c/title%3e%3cpath%20d='M5.676%2010.595h2.052v5.244a5.892%205.892%200%200%201-2.052-2.088v-3.156zm18.179%2010.836a.504.504%200%200%201%200%20.708l-1.716%201.716a.504.504%200%200%201-.708%200l-4.248-4.248a.206.206%200%200%201-.007-.007c-.02-.02-.028-.045-.043-.066a10.736%2010.736%200%200%201-6.334%202.065C4.835%2021.599%200%2016.764%200%2010.799S4.835%200%2010.8%200s10.799%204.835%2010.799%2010.8c0%202.369-.772%204.553-2.066%206.333.025.017.052.028.074.05l4.248%204.248zm-5.028-10.632a8.015%208.015%200%201%200-8.028%208.028h.024a8.016%208.016%200%200%200%208.004-8.028zm-4.86%204.98a6.002%206.002%200%200%200%202.04-2.184v-1.764h-2.04v3.948zm-4.5.948c.442.057.887.08%201.332.072.4.025.8.025%201.2%200V7.692H9.468v9.035z'/%3e%3c/svg%3e",y3=""+new URL("iceberg-COKYXo-A.png",import.meta.url).href,v3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMotherDuck%3c/title%3e%3cg%20transform='scale(0.85)%20translate(0,%202)'%3e%3cpath%20fill='%23ff9538'%20d='M1.71%2015.86s7.45%205.32%207.89%205.59c.44.27%201.08.33%201.64.11.56-.22.98-.71%201.11-1.21s1.85-9.49%201.85-9.49c.02-.12.07-.48-.13-.83-.27-.47-.86-.71-1.38-.57-.42.12-.64.44-.7.55-.09.17-.26.45-.57.7-.24.19-.47.3-.58.34-.96.38-2.02.06-2.61-.72-.38-.48-1.04-.67-1.64-.43-.6.24-.94.84-.89%201.45.11.98-.44%201.94-1.4%202.32-.51.21-1.06.21-1.54.05-.12-.03-.51-.12-.89.09-.48.26-.74.84-.61%201.37.09.39.38.62.48.69z'%20/%3e%3cpath%20fill='%23ff9538'%20d='M14.12%204.21s2.65%208.76%202.83%209.24c.19.48.66.92%201.23%201.09.58.16%201.21.03%201.62-.28.41-.31%207.25-6.39%207.25-6.39.09-.08.35-.34.4-.74.07-.53-.25-1.09-.75-1.29-.4-.16-.78-.04-.89%200-.18.08-.48.2-.88.2-.3.01-.55-.05-.67-.08-.99-.28-1.64-1.18-1.63-2.16-.01-.61-.42-1.17-1.04-1.35-.62-.18-1.26.09-1.59.6-.51.84-1.53%201.27-2.52.99-.53-.15-.96-.48-1.25-.91-.07-.09-.33-.4-.76-.48-.54-.09-1.1.22-1.32.71-.16.37-.08.72-.04.84z'%20/%3e%3c/g%3e%3c/svg%3e",b3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMySQL%3c/title%3e%3cpath%20d='M16.405%205.501c-.115%200-.193.014-.274.033v.013h.014c.054.104.146.18.214.273.054.107.1.214.154.32l.014-.015c.094-.066.14-.172.14-.333-.04-.047-.046-.094-.08-.14-.04-.067-.126-.1-.18-.153zM5.77%2018.695h-.927a50.854%2050.854%200%2000-.27-4.41h-.008l-1.41%204.41H2.45l-1.4-4.41h-.01a72.892%2072.892%200%2000-.195%204.41H0c.055-1.966.192-3.81.41-5.53h1.15l1.335%204.064h.008l1.347-4.064h1.095c.242%202.015.384%203.86.428%205.53zm4.017-4.08c-.378%202.045-.876%203.533-1.492%204.46-.482.716-1.01%201.073-1.583%201.073-.153%200-.34-.046-.566-.138v-.494c.11.017.24.026.386.026.268%200%20.483-.075.647-.222.197-.18.295-.382.295-.605%200-.155-.077-.47-.23-.944L6.23%2014.615h.91l.727%202.36c.164.536.233.91.205%201.123.4-1.064.678-2.227.835-3.483zm12.325%204.08h-2.63v-5.53h.885v4.85h1.745zm-3.32.135l-1.016-.5c.09-.076.177-.158.255-.25.433-.506.648-1.258.648-2.253%200-1.83-.718-2.746-2.155-2.746-.704%200-1.254.232-1.65.697-.43.508-.646%201.256-.646%202.245%200%20.972.19%201.686.574%202.14.35.41.877.615%201.583.615.264%200%20.506-.033.725-.098l1.325.772.36-.622zM15.5%2017.588c-.225-.36-.337-.94-.337-1.736%200-1.393.424-2.09%201.27-2.09.443%200%20.77.167.977.5.224.362.336.936.336%201.723%200%201.404-.424%202.108-1.27%202.108-.445%200-.77-.167-.978-.5zm-1.658-.425c0%20.47-.172.856-.516%201.156-.344.3-.803.45-1.384.45-.543%200-1.064-.172-1.573-.515l.237-.476c.438.22.833.328%201.19.328.332%200%20.593-.073.783-.22a.754.754%200%2000.3-.615c0-.33-.23-.61-.648-.845-.388-.213-1.163-.657-1.163-.657-.422-.307-.632-.636-.632-1.177%200-.45.157-.81.47-1.085.315-.278.72-.415%201.22-.415.512%200%20.98.136%201.4.41l-.213.476a2.726%202.726%200%2000-1.064-.23c-.283%200-.502.068-.654.206a.685.685%200%2000-.248.524c0%20.328.234.61.666.85.393.215%201.187.67%201.187.67.433.305.648.63.648%201.168zm9.382-5.852c-.535-.014-.95.04-1.297.188-.1.04-.26.04-.274.167.055.053.063.14.11.214.08.134.218.313.346.407.14.11.28.216.427.31.26.16.555.255.81.416.145.094.293.213.44.313.073.05.12.14.214.172v-.02c-.046-.06-.06-.147-.105-.214-.067-.067-.134-.127-.2-.193a3.223%203.223%200%2000-.695-.675c-.214-.146-.682-.35-.77-.595l-.013-.014c.146-.013.32-.066.46-.106.227-.06.435-.047.67-.106.106-.027.213-.06.32-.094v-.06c-.12-.12-.21-.283-.334-.395a8.867%208.867%200%2000-1.104-.823c-.21-.134-.476-.22-.697-.334-.08-.04-.214-.06-.26-.127-.12-.146-.19-.34-.275-.514a17.69%2017.69%200%2001-.547-1.163c-.12-.262-.193-.523-.34-.763-.69-1.137-1.437-1.826-2.586-2.5-.247-.14-.543-.2-.856-.274-.167-.008-.334-.02-.5-.027-.11-.047-.216-.174-.31-.235-.38-.24-1.364-.76-1.644-.072-.18.434.267.862.422%201.082.115.153.26.328.34.5.047.116.06.235.107.356.106.294.207.622.347.897.073.14.153.287.247.413.054.073.146.107.167.227-.094.136-.1.334-.154.5-.24.757-.146%201.693.194%202.25.107.166.362.534.703.393.3-.12.234-.5.32-.835.02-.08.007-.133.048-.187v.015c.094.188.188.367.274.555.206.328.566.668.867.895.16.12.287.328.487.402v-.02h-.015c-.043-.058-.1-.086-.154-.133a3.445%203.445%200%2001-.35-.4%208.76%208.76%200%2001-.747-1.218c-.11-.21-.202-.436-.29-.643-.04-.08-.04-.2-.107-.24-.1.146-.247.273-.32.453-.127.288-.14.642-.188%201.01-.027.007-.014%200-.027.014-.214-.052-.287-.274-.367-.46-.2-.475-.233-1.238-.06-1.785.047-.14.247-.582.167-.716-.042-.127-.174-.2-.247-.303a2.478%202.478%200%2001-.24-.427c-.16-.374-.24-.788-.414-1.162-.08-.173-.22-.354-.334-.513-.127-.18-.267-.307-.368-.52-.033-.073-.08-.194-.027-.274.014-.054.042-.075.094-.09.088-.072.335.022.422.062.247.1.455.194.662.334.094.066.195.193.315.226h.14c.214.047.455.014.655.073.355.114.675.28.962.46a5.953%205.953%200%20012.085%202.286c.08.154.115.295.188.455.14.33.313.663.455.982.14.315.275.636.476.897.1.14.502.213.682.286.133.06.34.115.46.188.23.14.454.3.67.454.11.076.443.243.463.378z'/%3e%3c/svg%3e",hv=""+new URL("postgresql-q8VEBKGg.svg",import.meta.url).href,w3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eAmazon%20Redshift%3c/title%3e%3cpath%20d='M16.639%209.932a.822.822%200%200%201-.822-.82.823.823%200%200%201%201.645%200c0%20.452-.37.82-.823.82m-2.086%204.994a.823.823%200%200%201-.822-.822.822.822%200%200%201%201.645%200%20.822.822%200%200%201-.823.822m-5.004-.833a.822.822%200%201%201%20.002-1.644.822.822%200%200%201-.002%201.644m-2.083%204.578a.823.823%200%200%201-.823-.82.823.823%200%200%201%201.645%200c0%20.452-.37.82-.822.82m9.173-11.236a1.68%201.68%200%200%200-1.68%201.676c0%20.566.285%201.066.718%201.37l-.782%201.982a1.674%201.674%200%200%200-1.923%201.104l-1.753-.398a1.675%201.675%200%200%200-3.348.103c0%20.432.169.823.438%201.12l-.764%201.79c-.028-.001-.053-.008-.08-.008a1.68%201.68%200%200%200-1.68%201.676%201.68%201.68%200%200%200%203.36%200c0-.593-.312-1.112-.778-1.41l.674-1.579c.161.052.33.088.508.088.661%200%201.228-.386%201.502-.94l1.856.42a1.68%201.68%200%200%200%203.327-.325c0-.5-.224-.943-.574-1.25l.822-2.083c.053.005.104.016.157.016a1.68%201.68%200%200%200%201.68-1.676%201.68%201.68%200%200%200-1.68-1.676M12%2023.145c-4.17%200-7.286-1.252-7.286-2.37V4.79C6.14%205.938%209.131%206.547%2012%206.547c2.869%200%205.86-.609%207.286-1.756v15.983c0%201.12-3.116%202.37-7.286%202.37M12%20.856c4.293%200%207.286%201.274%207.286%202.419%200%201.143-2.993%202.418-7.286%202.418-4.293%200-7.286-1.275-7.286-2.418C4.714%202.129%207.707.855%2012%20.855m8.143%202.419C20.143%201.147%2015.947%200%2012%200%208.052%200%203.857%201.147%203.857%203.274l.002.01h-.002v17.49C3.857%2022.87%208.052%2024%2012%2024c3.947%200%208.143-1.13%208.143-3.226V3.284h-.002l.002-.01'/%3e%3c/svg%3e",_3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSnowflake%3c/title%3e%3cpath%20d='M24%203.459c0%20.646-.418%201.18-1.141%201.18-.723%200-1.142-.534-1.142-1.18%200-.647.419-1.18%201.142-1.18.723%200%201.141.533%201.141%201.18zm-.228%200c0-.533-.38-.951-.913-.951s-.913.38-.913.95c0%20.533.38.952.913.952.57%200%20.913-.419.913-.951zm-1.37-.533h.495c.266%200%20.456.152.456.38%200%20.153-.076.229-.19.305l.19.266v.038h-.266l-.19-.266h-.229v.266h-.266zm.495.228h-.229v.267h.229c.114%200%20.152-.038.152-.114.038-.077-.038-.153-.152-.153zM7.602%2012.4c.038-.151.076-.304.076-.456%200-.114-.038-.228-.038-.342-.114-.343-.304-.647-.646-.838l-4.87-2.777c-.685-.38-1.56-.152-1.94.533-.381.685-.153%201.56.532%201.94l2.701%201.56-2.701%201.56c-.685.38-.913%201.256-.533%201.94.38.685%201.256.914%201.94.533l4.832-2.777c.343-.267.571-.533.647-.876zm1.332%202.626c-.266-.038-.57.038-.837.19l-4.832%202.777c-.685.38-.913%201.256-.532%201.94.38.686%201.255.914%201.94.533l2.701-1.56v3.12c0%20.8.647%201.408%201.446%201.408.799%200%201.407-.647%201.407-1.408v-5.592c0-.761-.57-1.37-1.293-1.408zm4.946-6.088c.266.038.57-.038.837-.19l4.832-2.777c.685-.38.913-1.256.532-1.94-.38-.686-1.255-.914-1.94-.533l-2.701%201.56V1.975c0-.799-.647-1.408-1.446-1.408-.799%200-1.446.609-1.446%201.408V7.53c0%20.76.609%201.37%201.332%201.407zM3.265%205.97l4.832%202.777c.266.152.533.19.837.19.723-.038%201.331-.684%201.331-1.407V1.975c0-.799-.646-1.408-1.407-1.408-.799%200-1.446.647-1.446%201.408v3.12l-2.701-1.56c-.685-.38-1.56-.152-1.94.533-.419.646-.19%201.521.494%201.902zm9.093%206.011a.412.412%200%2000-.114-.266l-.57-.571a.346.346%200%2000-.267-.114.412.412%200%2000-.266.114l-.571.57a.411.411%200%2000-.114.267c0%20.076.038.19.114.267l.57.57a.345.345%200%2000.267.114c.076%200%20.19-.038.266-.114l.571-.57a.412.412%200%2000.114-.267zm1.598.533L11.94%2014.53c-.039.038-.153.114-.229.114h-.608a.411.411%200%2001-.267-.114L8.82%2012.514a.408.408%200%2001-.076-.229v-.608c0-.076.038-.19.114-.267l2.016-2.016a.41.41%200%2001.267-.114h.608a.41.41%200%2001.267.114l2.016%202.016a.347.347%200%2001.114.267v.608c-.076.077-.114.19-.19.229zm5.593%205.44l-4.832-2.777c-.266-.152-.57-.19-.837-.152-.723.038-1.332.684-1.332%201.408v5.554c0%20.8.647%201.408%201.408%201.408.799%200%201.446-.647%201.446-1.408v-3.12l2.7%201.56c.686.38%201.561.152%201.941-.533.419-.646.19-1.521-.494-1.94zm2.549-7.533l-2.701%201.56%202.7%201.56c.686.38.914%201.256.533%201.94-.38.685-1.255.913-1.94.533l-4.832-2.778a1.644%201.644%200%2001-.647-.798c-.037-.153-.076-.305-.076-.457%200-.114.039-.228.039-.342.114-.343.342-.647.646-.837l4.832-2.778c.685-.38%201.56-.152%201.94.533.457.609.19%201.484-.494%201.864'/%3e%3c/svg%3e",x3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eApache%20Spark%3c/title%3e%3cpath%20d='M10.812%200c-.425.013-.845.215-1.196.605a3.593%203.593%200%2000-.493.722c-.355.667-.425%201.415-.556%202.143a551.9%20551.9%200%2000-.726%204.087c-.027.16-.096.227-.244.273C5.83%208.386%204.06%208.94%202.3%209.514c-.387.125-.773.289-1.114.506-1.042.665-1.196%201.753-.415%202.71.346.422.79.715%201.284.936%201.1.49%202.202.976%203.3%201.47.019.01.036.013.053.019h-.004l1.306.535c0%20.023.002.045%200%20.073-.2%202.03-.39%204.063-.58%206.095-.04.419-.012.831.134%201.23.317.87%201.065%201.148%201.881.701.372-.204.666-.497.937-.818%201.372-1.623%202.746-3.244%204.113-4.872.111-.133.205-.15.363-.098.349.117.697.231%201.045.347h.001c.02.012.045.02.073.03l.142.042c1.248.416%202.68.775%203.929%201.19.4.132.622.164%201.045.098.311-.048.592-.062.828-.236.602-.33.995-.957.988-1.682-.005-.427-.154-.813-.35-1.186-.82-1.556-1.637-3.113-2.461-4.666-.078-.148-.076-.243.037-.375%201.381-1.615%202.756-3.236%204.133-4.855.272-.32.513-.658.653-1.058.308-.878-.09-1.57-1-1.741a2.783%202.783%200%2000-1.235.069c-1.974.521-3.947%201.041-5.918%201.57-.175.047-.26.015-.355-.144a353.08%20353.08%200%2000-2.421-4.018%204.61%204.61%200%2000-.652-.849c-.371-.37-.802-.549-1.227-.536zm.172%203.703a.592.592%200%2001.189.211c.87%201.446%201.742%202.89%202.609%204.338.07.118.135.16.277.121%201.525-.41%203.052-.813%204.579-1.217.367-.098.735-.193%201.103-.289a.399.399%200%2001-.1.2c-1.259%201.48-2.516%202.962-3.779%204.438-.11.13-.12.22-.04.37.937%201.803%201.768%203.309%202.498%204.76l-3.696-1.019c-.538-.18-1.077-.358-1.615-.539-.163-.055-.25-.03-.36.1-1.248%201.488-2.504%202.97-3.759%204.454a.398.398%200%2001-.18.132c.035-.378.068-.757.104-1.136.149-1.572.297-3.144.451-4.716-.03-.318.117-.405-.322-.545-1.493-.593-3.346-1.321-4.816-1.905a.595.595%200%2001.24-.134c1.797-.57%203.595-1.14%205.394-1.705.127-.04.199-.092.211-.233.013-.148.05-.294.076-.441.241-1.363.483-2.726.726-4.088.068-.386.14-.771.21-1.157z'/%3e%3c/svg%3e",k3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSQLite%3c/title%3e%3cpath%20d='M21.678.521c-1.032-.92-2.28-.55-3.513.544a8.71%208.71%200%200%200-.547.535c-2.109%202.237-4.066%206.38-4.674%209.544.237.48.422%201.093.544%201.561a13.044%2013.044%200%200%201%20.164.703s-.019-.071-.096-.296l-.05-.146a1.689%201.689%200%200%200-.033-.08c-.138-.32-.518-.995-.686-1.289-.143.423-.27.818-.376%201.176.484.884.778%202.4.778%202.4s-.025-.099-.147-.442c-.107-.303-.644-1.244-.772-1.464-.217.804-.304%201.346-.226%201.478.152.256.296.698.422%201.186.286%201.1.485%202.44.485%202.44l.017.224a22.41%2022.41%200%200%200%20.056%202.748c.095%201.146.273%202.13.5%202.657l.155-.084c-.334-1.038-.47-2.399-.41-3.967.09-2.398.642-5.29%201.661-8.304%201.723-4.55%204.113-8.201%206.3-9.945-1.993%201.8-4.692%207.63-5.5%209.788-.904%202.416-1.545%204.684-1.931%206.857.666-2.037%202.821-2.912%202.821-2.912s1.057-1.304%202.292-3.166c-.74.169-1.955.458-2.362.629-.6.251-.762.337-.762.337s1.945-1.184%203.613-1.72C21.695%207.9%2024.195%202.767%2021.678.521m-18.573.543A1.842%201.842%200%200%200%201.27%202.9v16.608a1.84%201.84%200%200%200%201.835%201.834h9.418a22.953%2022.953%200%200%201-.052-2.707c-.006-.062-.011-.141-.016-.2a27.01%2027.01%200%200%200-.473-2.378c-.121-.47-.275-.898-.369-1.057-.116-.197-.098-.31-.097-.432%200-.12.015-.245.037-.386a9.98%209.98%200%200%201%20.234-1.045l.217-.028c-.017-.035-.014-.065-.031-.097l-.041-.381a32.8%2032.8%200%200%201%20.382-1.194l.2-.019c-.008-.016-.01-.038-.018-.053l-.043-.316c.63-3.28%202.587-7.443%204.8-9.791.066-.069.133-.128.198-.194Z'/%3e%3c/svg%3e",S3="data:image/svg+xml,%3csvg%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eSupabase%3c/title%3e%3cpath%20d='M11.9%201.036c-.015-.986-1.26-1.41-1.874-.637L.764%2012.05C-.33%2013.427.65%2015.455%202.409%2015.455h9.579l.113%207.51c.014.985%201.259%201.408%201.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z'/%3e%3c/svg%3e",C3="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3c!--%20Generated%20by%20Pixelmator%20Pro%203.6.17%20--%3e%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Option2SymbolB'%3e%3cg%20id='Layer1-2'%3e%3cg%20id='Group'%20opacity='0.4'%3e%3cpath%20id='Path'%20fill='%23d53c97'%20stroke='none'%20d='M%2017.016802%2012.188573%20C%2017.016802%209.607646%2015.86018%207.293022%2014.039526%205.731081%20C%2013.942595%205.70038%2013.844628%205.671406%2013.745972%205.645189%20C%2013.131133%205.809095%2012.54265%206.059378%2011.998103%206.388559%20C%2013.964327%207.575191%2015.281006%209.730104%2015.281006%2012.188573%20C%2015.279476%2014.563734%2014.033739%2016.764488%2011.998103%2017.988243%20C%2012.542634%2018.317537%2013.131119%2018.567936%2013.745972%2018.731958%20C%2013.844628%2018.705742%2013.942595%2018.67642%2014.039526%2018.645721%20C%2015.86018%2017.084126%2017.016802%2014.769501%2017.016802%2012.188573%20Z'/%3e%3cpath%20id='path1'%20fill='%23d53c97'%20stroke='none'%20d='M%2013.897406%205.609659%20L%2013.894991%205.60759%20C%2013.844973%205.619663%2013.7953%205.631737%2013.745972%205.645189%20C%2013.79599%205.631737%2013.847043%205.622078%2013.897406%205.609659%20Z'/%3e%3cpath%20id='path2'%20fill='%23d53c97'%20stroke='none'%20d='M%201.735796%2012.188573%20C%201.735796%209.164728%203.728925%206.59622%206.470945%205.729357%20C%207.554634%204.797861%208.856011%204.155121%2010.254373%203.860756%20C%209.680216%203.740549%209.095179%203.679977%208.508574%203.68%20C%203.816888%203.68%20-0%207.496887%20-0%2012.188573%20C%20-0%2016.880259%203.816888%2020.697147%208.508574%2020.697147%20C%209.0952%2020.697229%209.680255%2020.636539%2010.254373%2020.516048%20C%208.855971%2020.221794%207.554568%2019.579041%206.470945%2018.647446%20C%203.728925%2017.780582%201.735796%2015.213453%201.735796%2012.188573%20Z'/%3e%3cpath%20id='path3'%20fill='%23d53c97'%20stroke='none'%20d='M%2013.745972%2018.731958%20C%2013.7953%2018.745068%2013.844973%2018.757484%2013.894991%2018.769558%20C%2013.894991%2018.769558%2013.896715%2018.769558%2013.897406%2018.767488%20C%2013.847043%2018.754379%2013.79599%2018.745411%2013.745972%2018.731958%20Z'/%3e%3c/g%3e%3cpath%20id='path4'%20fill='%23ff3b65'%20stroke='none'%20d='M%2020.508402%2012.188573%20C%2020.508402%209.606611%2019.351088%207.290262%2017.5294%205.729357%20C%2016.301817%205.342468%2014.989366%205.313629%2013.745972%205.646223%20C%2016.636665%206.418224%2018.772606%209.058484%2018.772606%2012.189609%20C%2018.772606%2015.320732%2016.636665%2017.960991%2013.745972%2018.731958%20C%2014.98947%2019.064316%2016.301983%2019.034998%2017.5294%2018.647446%20C%2019.419907%2017.034296%2020.508638%2014.673781%2020.508402%2012.188573%20Z'/%3e%3cpath%20id='path5'%20fill='%23ff3b65'%20stroke='none'%20d='M%209.962543%2018.647446%20C%207.220525%2017.780582%205.227395%2015.213453%205.227395%2012.188573%20C%205.227395%209.163693%207.220525%206.59622%209.962543%205.729357%20C%2011.046233%204.797861%2012.34761%204.155121%2013.745972%203.860756%20C%2013.171818%203.74053%2012.586779%203.679956%2012.000173%203.68%20C%207.308832%203.68%203.491599%207.496887%203.491599%2012.188573%20C%203.491599%2016.880259%207.308487%2020.697147%2012.000173%2020.697147%20C%2012.586799%2020.697247%2013.171857%2020.636557%2013.745972%2020.516048%20C%2012.34757%2020.221794%2011.046167%2019.579041%209.962543%2018.647446%20Z'/%3e%3cpath%20id='path6'%20fill='%23383838'%20stroke='none'%20d='M%2015.491772%203.68%20C%2010.800431%203.68%206.983198%207.496887%206.983198%2012.188573%20C%206.983198%2016.880259%2010.800086%2020.697147%2015.491772%2020.697147%20C%2020.183456%2020.697147%2024%2016.880259%2024%2012.188573%20C%2024%207.496887%2020.183456%203.68%2015.491772%203.68%20Z%20M%2022.264549%2012.188573%20C%2022.264549%2015.923018%2019.226215%2018.961351%2015.491772%2018.961351%20C%2011.757326%2018.961351%208.718994%2015.923018%208.718994%2012.188573%20C%208.718994%208.454128%2011.757326%205.415796%2015.491772%205.415796%20C%2019.226215%205.415796%2022.264549%208.454128%2022.264549%2012.188573%20Z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",E3=""+new URL("trino-DFsJbQoT.svg",import.meta.url).href,T3=Jr(),R3={sqlite:k3,duckdb:m3,motherduck:v3,postgres:hv,postgresql:hv,mysql:b3,snowflake:_3,databricks:p3,clickhouse:f3,timeplus:C3,bigquery:g3,trino:E3,iceberg:y3,datafusion:h3,pyspark:x3,redshift:w3,supabase:S3};km=e=>{let n=(0,T3.c)(11),{name:i,className:o}=e,s=R3[i.toLowerCase()];if(!s){let f;n[0]===o?f=n[1]:(f=Ru("mt-0.5",o),n[0]=o,n[1]=f);let p;return n[2]===f?p=n[3]:(p=(0,B.jsx)(Es,{className:f}),n[2]=f,n[3]=p),p}let c;n[4]!==o||n[5]!==s?(c=Ru("invert-[.5] dark:invert-[.7]",o,s.endsWith(".png")&&"brightness-100 dark:brightness-100 invert-0 dark:invert-0"),n[4]=o,n[5]=s,n[6]=c):c=n[6];let d;return n[7]!==i||n[8]!==c||n[9]!==s?(d=(0,B.jsx)("img",{src:s,alt:i,className:c}),n[7]=i,n[8]=c,n[9]=s,n[10]=d):d=n[10],d};var df=Jr();const D3=e=>{let n=(0,df.c)(34),{selectedEngine:i,onChange:o,cellId:s}=e,c=Zn(Gu),d=[],f=[];for(let[Ce,Z]of c.entries())xo.has(Ce)?d.push(Z):f.push(Z);let p=sD(),y=i&&!c.has(i),w;n[0]!==c||n[1]!==o||n[2]!==p?(w=Ce=>{if(Ce===mv){window.open(gv,"_blank");return}let Z=c.get(Ce);Z&&(p(),o(Z.name),Tg(Z.name))},n[0]=c,n[1]=o,n[2]=p,n[3]=w):w=n[3];let _=w,C=N3,E=qD,T;n[4]===s?T=n[5]:(T=Yu(s),n[4]=s,n[5]=T);let I;n[6]===Symbol.for("react.memo_cache_sentinel")?(I=(0,B.jsx)(MD,{placeholder:"Select an engine"}),n[6]=I):I=n[6];let $;n[7]===T?$=n[8]:($=(0,B.jsx)(P3,{...T,children:I}),n[7]=T,n[8]=$);let V=ND,F;n[9]===s?F=n[10]:(F=Yu(s),n[9]=s,n[10]=F);let N=ID,K;n[11]===Symbol.for("react.memo_cache_sentinel")?(K=(0,B.jsx)(PD,{children:"Database connections"}),n[11]=K):K=n[11];let pe;n[12]!==y||n[13]!==i?(pe=y&&(0,B.jsx)(Oh,{value:i,children:(0,B.jsxs)("div",{className:"flex items-center gap-1 opacity-50",children:[(0,B.jsx)(Dm,{className:"h-3 w-3"}),(0,B.jsx)("span",{className:"truncate",children:Mg(i)})]})},i),n[12]=y,n[13]=i,n[14]=pe):pe=n[14];let P=C(f),A=f.length>0&&(0,B.jsx)(Cw,{}),W=C(d),de;n[15]===Symbol.for("react.memo_cache_sentinel")?(de=(0,B.jsx)(Cw,{}),n[15]=de):de=n[15];let fe;n[16]===Symbol.for("react.memo_cache_sentinel")?(fe=(0,B.jsx)(Oh,{className:"text-muted-foreground",value:mv,children:(0,B.jsxs)("a",{className:"flex items-center gap-1",href:gv,target:"_blank",rel:"noreferrer",children:[(0,B.jsx)(bD,{className:"h-3 w-3"}),(0,B.jsx)("span",{children:"How to add a database connection"})]})}),n[16]=fe):fe=n[16];let we;n[17]!==N||n[18]!==A||n[19]!==W||n[20]!==K||n[21]!==pe||n[22]!==P?(we=(0,B.jsxs)(N,{children:[K,pe,P,A,W,de,fe]}),n[17]=N,n[18]=A,n[19]=W,n[20]=K,n[21]=pe,n[22]=P,n[23]=we):we=n[23];let J;n[24]!==V||n[25]!==we||n[26]!==F?(J=(0,B.jsx)(V,{...F,children:we}),n[24]=V,n[25]=we,n[26]=F,n[27]=J):J=n[27];let be;return n[28]!==E||n[29]!==_||n[30]!==i||n[31]!==J||n[32]!==$?(be=(0,B.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,B.jsxs)(E,{value:i,onValueChange:_,children:[$,J]})}),n[28]=E,n[29]=_,n[30]=i,n[31]=J,n[32]=$,n[33]=be):be=n[33],be};var mv="__help__",gv="http://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database";const O3=()=>{let e=(0,df.c)(16),{sqlMode:n,setSQLMode:i}=WE(),o;e[0]!==i||e[1]!==n?(o=()=>{let E=n==="validate"?"default":"validate";E==="default"&&jE(),i(E)},e[0]=i,e[1]=n,e[2]=o):o=e[2];let s=o,c=I3,d=A3,f;e[3]===n?f=e[4]:(f=d(n),e[3]=n,e[4]=f);let p;e[5]===n?p=e[6]:(p=c(n),e[5]=n,e[6]=p);let y=n==="validate"?"Validate":"Default",w;e[7]===y?w=e[8]:(w=(0,B.jsx)("span",{className:"ml-1",children:y}),e[7]=y,e[8]=w);let _;e[9]!==s||e[10]!==p||e[11]!==w?(_=(0,B.jsxs)(nw,{variant:"ghost",size:"sm",onClick:s,className:"h-5 px-1.5 text-xs border-border shadow-none hover:bg-accent",children:[p,w]}),e[9]=s,e[10]=p,e[11]=w,e[12]=_):_=e[12];let C;return e[13]!==f||e[14]!==_?(C=(0,B.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,B.jsx)(Ph,{delayDuration:300,content:f,children:_})}),e[13]=f,e[14]=_,e[15]=C):C=e[15],C};var P3=e=>{let n=(0,df.c)(6),i,o;n[0]===e?(i=n[1],o=n[2]):({children:i,...o}=e,n[0]=e,n[1]=i,n[2]=o);let s;return n[3]!==i||n[4]!==o?(s=(0,B.jsx)(AD,{className:"text-xs border-border shadow-none! ring-0! h-5 px-1.5 hover:bg-accent transition-colors",...o,children:i}),n[3]=i,n[4]=o,n[5]=s):s=n[5],s};function M3(e){return e.source!=="iceberg"}function L3(e){return(0,B.jsx)(Oh,{value:e.name,children:(0,B.jsxs)("div",{className:"flex items-center gap-1",children:[(0,B.jsx)(km,{className:"h-3 w-3",name:e.dialect}),(0,B.jsx)("span",{className:"truncate ml-0.5",children:Mg(e.display_name)})]})},e.name)}function N3(e){return e=e.filter(M3),e.map(L3)}function I3(e){return e==="validate"?(0,B.jsx)(Fd,{className:"h-3 w-3"}):(0,B.jsx)(zd,{className:"h-3 w-3"})}function A3(e){return e==="validate"?(0,B.jsxs)("div",{className:"text-xs",children:[(0,B.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,B.jsx)(Fd,{className:"h-3 w-3"}),"Validate Mode"]}),(0,B.jsx)("p",{children:"Queries are validated as you write them"})]}):(0,B.jsxs)("div",{className:"text-xs",children:[(0,B.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,B.jsx)(zd,{className:"h-3 w-3"}),"Default Mode"]}),(0,B.jsx)("p",{children:"Standard editing"})]})}var yv=Jr(),vv=()=>{let e=(0,yv.c)(1),n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,B.jsx)("div",{className:"h-4 border-r border-border"}),e[0]=n):n=e[0],n};const q3=e=>{let n=(0,yv.c)(102),{view:i}=e,o;n[0]===Symbol.for("react.memo_cache_sentinel")?(o={minWidth:50},n[0]=o):o=n[0];let{spanProps:s,inputProps:c}=c3(o),d;n[1]===i.state?d=n[2]:(d=i.state.field(Lr),n[1]=i.state,n[2]=d);let f=d,p;n[3]===i.state?p=n[4]:(p=i.state.facet(Wi),n[3]=i.state,n[4]=p);let y=p,w;n[5]===Symbol.for("react.memo_cache_sentinel")?(w=(0,B.jsx)("div",{}),n[5]=w):w=n[5];let _=w,C=!1,E;n[6]===i?E=n[7]:(E=V=>{i.dispatch({effects:qu.of(V),changes:{from:0,to:i.state.doc.length,insert:i.state.doc.toString()}})},n[6]=i,n[7]=E);let T=E;if(f instanceof fd){let V;n[8]===i.state?V=n[9]:(V=i.state.field(fi),n[8]=i.state,n[9]=V);let F=V;C=!0;let N;n[10]===T?N=n[11]:(N=ft=>{let mt=Im(ft.currentTarget.value,!1);ft.currentTarget.value=mt,T({dataframeName:mt})},n[10]=T,n[11]=N);let K=N,pe;n[12]!==T||n[13]!==i?(pe=ft=>{T({engine:ft}),QE(i,ft)},n[12]=T,n[13]=i,n[14]=pe):pe=n[14];let P=pe,A;n[15]===Symbol.for("react.memo_cache_sentinel")?(A=(0,B.jsx)("span",{className:"select-none",children:"Output variable: "}),n[15]=A):A=n[15];let W;n[16]===c?W=n[17]:(W=ft=>{var mt;(mt=c.onChange)==null||mt.call(c,ft)},n[16]=c,n[17]=W);let de;n[18]===K?de=n[19]:(de=ft=>{ft.key==="Enter"&&ft.shiftKey&&K(ft)},n[18]=K,n[19]=de);let fe;n[20]!==c||n[21]!==F.dataframeName||n[22]!==K||n[23]!==W||n[24]!==de?(fe=(0,B.jsx)("input",{...c,defaultValue:F.dataframeName,onChange:W,onBlur:K,onKeyDown:de,className:"min-w-14 w-auto border border-border rounded px-1 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring"}),n[20]=c,n[21]=F.dataframeName,n[22]=K,n[23]=W,n[24]=de,n[25]=fe):fe=n[25];let we;n[26]===s?we=n[27]:(we=(0,B.jsx)("span",{...s}),n[26]=s,n[27]=we);let J;n[28]!==fe||n[29]!==we?(J=(0,B.jsxs)("label",{className:"flex gap-2 items-center",children:[A,fe,we]}),n[28]=fe,n[29]=we,n[30]=J):J=n[30];let be;n[31]!==y||n[32]!==F.engine||n[33]!==P?(be=(0,B.jsx)(D3,{selectedEngine:F.engine,onChange:P,cellId:y}),n[31]=y,n[32]=F.engine,n[33]=P,n[34]=be):be=n[34];let Ce;n[35]===F.engine?Ce=n[36]:(Ce=F.engine==="__marimo_duckdb"&&(0,B.jsx)(O3,{}),n[35]=F.engine,n[36]=Ce);let Z;n[37]!==F.engine||n[38]!==i?(Z=async()=>{await Wk(i,F.engine)},n[37]=F.engine,n[38]=i,n[39]=Z):Z=n[39];let re;n[40]===Symbol.for("react.memo_cache_sentinel")?(re=(0,B.jsx)(zh,{className:"h-3 w-3"}),n[40]=re):re=n[40];let se;n[41]===Z?se=n[42]:(se=(0,B.jsx)(Ph,{content:"Format SQL",children:(0,B.jsx)(nw,{variant:"text",size:"icon",onClick:Z,children:re})}),n[41]=Z,n[42]=se);let Q;n[43]===Symbol.for("react.memo_cache_sentinel")?(Q=(0,B.jsx)(vv,{}),n[43]=Q):Q=n[43];let Le;n[44]===T?Le=n[45]:(Le=ft=>{T({showOutput:!ft.target.checked})},n[44]=T,n[45]=Le);let Fe=!F.showOutput,et;n[46]!==Le||n[47]!==Fe?(et=(0,B.jsx)("input",{type:"checkbox",onChange:Le,checked:Fe}),n[46]=Le,n[47]=Fe,n[48]=et):et=n[48];let Be;n[49]===Symbol.for("react.memo_cache_sentinel")?(Be=(0,B.jsx)("span",{className:"select-none",children:"Hide output"}),n[49]=Be):Be=n[49];let je;n[50]===et?je=n[51]:(je=(0,B.jsxs)("label",{className:"flex items-center gap-2",children:[et,Be]}),n[50]=et,n[51]=je);let Pe;n[52]!==Ce||n[53]!==se||n[54]!==je?(Pe=(0,B.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[Ce,se,Q,je]}),n[52]=Ce,n[53]=se,n[54]=je,n[55]=Pe):Pe=n[55];let Ae;n[56]!==J||n[57]!==be||n[58]!==Pe?(Ae=(0,B.jsxs)("div",{className:"flex flex-1 gap-2 items-center",children:[J,be,Pe]}),n[56]=J,n[57]=be,n[58]=Pe,n[59]=Ae):Ae=n[59],_=Ae}if(f instanceof zu){C=!0;let V,F,N,K,pe,P,A,W,de,fe;if(n[60]!==T||n[61]!==i.state){let{quotePrefix:Le}=i.state.field(fi);F=Le,F===void 0&&(F="r",T({quotePrefix:F})),fe=(Fe,et)=>{typeof et=="boolean"&&T({quotePrefix:d3({currentQuotePrefix:F,checked:et,prefix:Fe})})},K="flex flex-row w-full justify-end gap-1.5 items-center",de="flex items-center gap-1.5",n[72]===Symbol.for("react.memo_cache_sentinel")?(N=(0,B.jsx)("span",{children:"r"}),n[72]=N):N=n[72],V=zl,P="Toggle raw string",A="w-3 h-3",W=F.includes("r"),pe=Fe=>{fe("r",Fe)},n[60]=T,n[61]=i.state,n[62]=V,n[63]=F,n[64]=N,n[65]=K,n[66]=pe,n[67]=P,n[68]=A,n[69]=W,n[70]=de,n[71]=fe}else V=n[62],F=n[63],N=n[64],K=n[65],pe=n[66],P=n[67],A=n[68],W=n[69],de=n[70],fe=n[71];let we;n[73]!==V||n[74]!==pe||n[75]!==P||n[76]!==A||n[77]!==W?(we=(0,B.jsx)(V,{"aria-label":P,className:A,checked:W,onCheckedChange:pe}),n[73]=V,n[74]=pe,n[75]=P,n[76]=A,n[77]=W,n[78]=we):we=n[78];let J;n[79]!==N||n[80]!==we||n[81]!==de?(J=(0,B.jsxs)("div",{className:de,children:[N,we]}),n[79]=N,n[80]=we,n[81]=de,n[82]=J):J=n[82];let be;n[83]===Symbol.for("react.memo_cache_sentinel")?(be=(0,B.jsx)("span",{children:"f"}),n[83]=be):be=n[83];let Ce;n[84]===F?Ce=n[85]:(Ce=F.includes("f"),n[84]=F,n[85]=Ce);let Z;n[86]===fe?Z=n[87]:(Z=Le=>{fe("f",Le)},n[86]=fe,n[87]=Z);let re;n[88]!==Ce||n[89]!==Z?(re=(0,B.jsxs)("div",{className:"flex items-center gap-1.5",children:[be,(0,B.jsx)(zl,{"aria-label":"Toggle f-string",className:"w-3 h-3",checked:Ce,onCheckedChange:Z})]}),n[88]=Ce,n[89]=Z,n[90]=re):re=n[90];let se;n[91]===Symbol.for("react.memo_cache_sentinel")?(se=(0,B.jsx)(Ph,{content:(0,B.jsx)(pv,{}),children:(0,B.jsx)(Nu,{className:"w-3 h-3"})}),n[91]=se):se=n[91];let Q;n[92]!==K||n[93]!==J||n[94]!==re?(Q=(0,B.jsxs)("div",{className:K,children:[J,re,se]}),n[92]=K,n[93]=J,n[94]=re,n[95]=Q):Q=n[95],_=Q}let I;n[96]===C?I=n[97]:(I=C&&(0,B.jsx)(vv,{}),n[96]=C,n[97]=I);let $;return n[98]!==_||n[99]!==f.type||n[100]!==I?($=(0,B.jsx)(zD,{children:(0,B.jsxs)("div",{className:"flex justify-between items-center gap-4 pl-2 pt-2",children:[_,I,f.type]})}),n[98]=_,n[99]=f.type,n[100]=I,n[101]=$):$=n[101],$};var ff=new Ou;ud=Bi.define(),Lr=xs.define({create(){return gr.python},update(e,n){for(let i of n.effects)if(i.is(ud))return i.value;return e},provide:e=>bh.from(e,n=>n.type==="python"?null:i=>Qk(i,q3))});function j3(){let e=n3(),n=(i,o)=>{let s=e[o%e.length];return s.isSupported(i)?s:n(i,o+1)};return[Ra.of([{key:"F4",preventDefault:!0,run:i=>{let o=i.state.field(Lr),s=e.findIndex(d=>d.type===o.type),c=n(i.state.doc.toString(),s+1);return o===c?!1:(bv({view:i,nextLanguage:c,opts:{keepCodeAsIs:!1}}),!0)}}])]}function bv({view:e,nextLanguage:n,opts:i}){let o=e.state.field(Lr),s=e.state.doc.toString(),c=e.state.facet(wg),d=e.state.facet(_g),f=e.state.facet(qd),p=e.state.facet(ec),y=e.state.facet(xg),w=e.state.field(fi),_=e.state.selection.main.head,C;if(i.keepCodeAsIs)C=s,o.type!==n.type&&(w={...n.defaultMetadata});else{let[E,T]=o.transformOut(s,w),[I,$,V]=n.transformIn(E);_+=T,_-=$,_=xh(_,0,I.length),C=I,w=V}e.dispatch({effects:[ud.of(n),Bu.of(w),ff.reconfigure(n.getExtension(p,c,d,f,y)),Iu.reconfigure([]),Ms.of(!0)],changes:i.keepCodeAsIs?void 0:{from:0,to:e.state.doc.length,insert:C},selection:i.keepCodeAsIs?void 0:mn.cursor(_)}),e.dispatch({effects:[Iu.reconfigure([V4()])]}),n.type==="sql"&&GE(e)}$_=function(e){let{placeholderType:n,completionConfig:i,hotkeys:o,cellId:s,lspConfig:c}=e;return[j3(),ff.of(gr.python.getExtension(s,i,o,n,c)),Lr,fi]},X_=function(e){return z3(Xr({state:e}).trim())};function z3(e){return e?gr.markdown.isSupported(e)?gr.markdown:gr.sql.isSupported(e)?gr.sql:gr.python:gr.python}wm=function(e,n){e.state.field(Lr).type!==n.language&&bv({view:e,nextLanguage:gr[n.language],opts:{keepCodeAsIs:n.keepCodeAsIs??!1}})},q_=function(e,{completionConfig:n,hotkeysProvider:i,lspConfig:o}){let s=e.state.field(Lr),c=e.state.facet(qd),d=e.state.facet(ec);return d===void 0&&Se.error("Cell ID is undefined in reconfigureLanguageEffect"),c===void 0&&Se.error("Placeholder type is undefined in reconfigureLanguageEffect"),n===void 0&&Se.error("Completion config is undefined in reconfigureLanguageEffect"),ff.reconfigure(s.getExtension(d,n,i,c,o))},Xr=function(e,n,i){let o=e.state.field(Lr),s=e.state.field(fi),c=e.state.doc.toString();return n===void 0?o.transformOut(c,s)[0]:o.transformOut(c.slice(n,i),s)[0]},_o=function(e,n){let[i]=e.state.field(Lr).transformIn(n);return Au(e,i),i};function F3(e){let n=e.state.selection.main.head,i=e.state.doc.toString(),o=i.length>0&&i[n-1]===`
146
146
  `,s=i.length>0&&i[n]===`
147
- `,c=o?n-1:n,d=s?n+1:n;return{beforeCursorCode:Xr(e,0,c),afterCursorCode:Xr(e,d)}}var B3=["marimo-carousel","marimo-tabs","marimo-accordion"],H3="h1, h2, h3, h4, h5, h6";function V3(e){if(typeof DOMParser>"u")return null;let n=[],i=new DOMParser().parseFromString(e,"text/html").querySelectorAll(H3);for(let o of Array.from(i)){let s=o.textContent;if(B3.some(d=>o.closest(d))||!s)continue;let c=Number.parseInt(o.tagName[1],10);n.push({name:s,level:c,by:Em(o)})}return{items:n}}Em=function(e){let n=e.id;if(n)return{id:n};let i=e.textContent;return{path:`//${e.tagName}[contains(., "${i}")]`}};function $3(e){return{items:e.filter(Boolean).flatMap(n=>n.items)}}Om=function(e){if(e==null||e.mimetype!=="text/html"&&e.mimetype!=="text/markdown"||e.data==null)return null;try{return In(typeof e.data=="string","expected string"),V3(e.data)}catch{return Se.error("Failed to parse outline"),null}},ex=function(e){return e==null?!1:e.items.some(n=>n.level<=3)};function wv(e,n){let i=d=>d.items.length===0?7:Math.min(...d.items.map(f=>f.level)),o=n[e];if(o==null||o.items.length===0)return Se.warn("Failed to find a starting outline"),null;let s=i(o),c=e+1;for(;c<n.length;){let d=n[c];if(d&&i(d)<=s)return[e,c-1];c++}return[e,n.length-1]}Xu=function(e){return e==="application/vnd.marimo+error"||e==="application/vnd.marimo+traceback"},Ew=Hl("marimo:rtc:username","",Vl),Yh=wm(()=>Ul("rtc_v2"));let pf,_v,hf,Ns;dm=class hd{static fromMilliseconds(n){return n==null?null:new hd(n)}static fromSeconds(n){return n==null?null:new hd(n*1e3)}static now(){return new hd(Date.now())}constructor(n){this.ms=n}toMilliseconds(){return this.ms}toSeconds(){return this.ms/1e3}},pf=($a=class{constructor(){ke(this,"lines",[""]);ke(this,"cursor",{row:0,col:0})}ensureLine(n){for(;this.lines.length<=n;)this.lines.push("")}moveCursor(n,i){let o=this.cursor.row;this.cursor.row=Math.max(0,this.cursor.row+n),this.cursor.col=Math.max(0,this.cursor.col+i),this.ensureLine(this.cursor.row),n<0&&this.cursor.row<o&&this.lines.splice(this.cursor.row+1)}setCursor(n,i){this.cursor.row=Math.max(0,n),this.cursor.col=Math.max(0,i),this.ensureLine(this.cursor.row)}writeChar(n){this.ensureLine(this.cursor.row);let i=this.lines[this.cursor.row].padEnd(this.cursor.col," ");this.lines[this.cursor.row]=i.slice(0,this.cursor.col)+n+i.slice(this.cursor.col+1),this.cursor.col++}writeString(n){if(n.length===0)return;this.ensureLine(this.cursor.row);let i=this.lines[this.cursor.row].padEnd(this.cursor.col," ");this.lines[this.cursor.row]=i.slice(0,this.cursor.col)+n+i.slice(this.cursor.col+n.length),this.cursor.col+=n.length}control(n){switch(n){case`
147
+ `,c=o?n-1:n,d=s?n+1:n;return{beforeCursorCode:Xr(e,0,c),afterCursorCode:Xr(e,d)}}var B3=["marimo-carousel","marimo-tabs","marimo-accordion"],H3="h1, h2, h3, h4, h5, h6";function V3(e){if(typeof DOMParser>"u")return null;let n=[],i=new DOMParser().parseFromString(e,"text/html").querySelectorAll(H3);for(let o of Array.from(i)){let s=o.textContent;if(B3.some(d=>o.closest(d))||!s)continue;let c=Number.parseInt(o.tagName[1],10);n.push({name:s,level:c,by:Tm(o)})}return{items:n}}Tm=function(e){let n=e.id;if(n)return{id:n};let i=e.textContent;return{path:`//${e.tagName}[contains(., "${i}")]`}};function $3(e){return{items:e.filter(Boolean).flatMap(n=>n.items)}}Om=function(e){if(e==null||e.mimetype!=="text/html"&&e.mimetype!=="text/markdown"||e.data==null)return null;try{return In(typeof e.data=="string","expected string"),V3(e.data)}catch{return Se.error("Failed to parse outline"),null}},ex=function(e){return e==null?!1:e.items.some(n=>n.level<=3)};function wv(e,n){let i=d=>d.items.length===0?7:Math.min(...d.items.map(f=>f.level)),o=n[e];if(o==null||o.items.length===0)return Se.warn("Failed to find a starting outline"),null;let s=i(o),c=e+1;for(;c<n.length;){let d=n[c];if(d&&i(d)<=s)return[e,c-1];c++}return[e,n.length-1]}Ju=function(e){return e==="application/vnd.marimo+error"||e==="application/vnd.marimo+traceback"},Ew=Bl("marimo:rtc:username","",Hl),Xh=xm(()=>sd("rtc_v2"));let pf,_v,hf,Ns;dm=class hd{static fromMilliseconds(n){return n==null?null:new hd(n)}static fromSeconds(n){return n==null?null:new hd(n*1e3)}static now(){return new hd(Date.now())}constructor(n){this.ms=n}toMilliseconds(){return this.ms}toSeconds(){return this.ms/1e3}},pf=($a=class{constructor(){ke(this,"lines",[""]);ke(this,"cursor",{row:0,col:0})}ensureLine(n){for(;this.lines.length<=n;)this.lines.push("")}moveCursor(n,i){let o=this.cursor.row;this.cursor.row=Math.max(0,this.cursor.row+n),this.cursor.col=Math.max(0,this.cursor.col+i),this.ensureLine(this.cursor.row),n<0&&this.cursor.row<o&&this.lines.splice(this.cursor.row+1)}setCursor(n,i){this.cursor.row=Math.max(0,n),this.cursor.col=Math.max(0,i),this.ensureLine(this.cursor.row)}writeChar(n){this.ensureLine(this.cursor.row);let i=this.lines[this.cursor.row].padEnd(this.cursor.col," ");this.lines[this.cursor.row]=i.slice(0,this.cursor.col)+n+i.slice(this.cursor.col+1),this.cursor.col++}writeString(n){if(n.length===0)return;this.ensureLine(this.cursor.row);let i=this.lines[this.cursor.row].padEnd(this.cursor.col," ");this.lines[this.cursor.row]=i.slice(0,this.cursor.col)+n+i.slice(this.cursor.col+n.length),this.cursor.col+=n.length}control(n){switch(n){case`
148
148
  `:this.cursor.row++,this.cursor.col=0,this.ensureLine(this.cursor.row);break;case"\r":this.cursor.col=0;break;case" ":this.writeChar(" ");break;case"\b":this.cursor.col=Math.max(0,this.cursor.col-1);break;case"\v":this.cursor.row++,this.ensureLine(this.cursor.row);break}}handleEscape(n){let i=$a.ESCAPE_REGEX.exec(n);if(!i){this.writeString(n);return}let o=i[1].split(";").map(s=>s===""?1:Number.parseInt(s,10));switch(i[2]){case"A":this.moveCursor(-o[0],0);break;case"B":this.moveCursor(o[0],0);break;case"C":this.moveCursor(0,o[0]);break;case"D":this.moveCursor(0,-o[0]);break;case"H":this.setCursor(o[0]-1||0,o[1]-1||0);break;case"J":o[0]===2&&(this.lines=[""],this.setCursor(0,0));break;case"K":switch(this.ensureLine(this.cursor.row),o[0]){case 0:this.lines[this.cursor.row]=this.lines[this.cursor.row].slice(0,this.cursor.col);break;case 1:{let s=this.lines[this.cursor.row].length;this.lines[this.cursor.row]=" ".repeat(this.cursor.col)+this.lines[this.cursor.row].slice(this.cursor.col,s);break}case 2:this.lines[this.cursor.row]="";break}break;default:this.writeString(n);break}}render(){return this.lines.join(`
149
149
  `)}},ke($a,"ESCAPE_REGEX",/\u001B\[([0-9;]*)([A-DJKH])/u),$a),_v=class{constructor(){ke(this,"ESC_REGEX",/\u001B(?:\[[0-9;]*[A-Za-z]|\([0-9A-Za-z])/gu)}parse(e){let n=[],i=0;for(let o of e.matchAll(this.ESC_REGEX)){let s=o.index??0;s>i&&n.push({type:"text",value:e.slice(i,s)}),n.push({type:"escape",value:o[0]}),i=s+o[0].length}return i<e.length&&n.push({type:"text",value:e.slice(i)}),n}},hf=class{constructor(){ke(this,"parser",new _v);ke(this,"buffer",new pf)}reduce(e){return this.reset(),this.append(e),this.render()}append(e){let n=this.parser.parse(e);if(n.length===1&&n[0].type==="text"){let i=n[0].value;if(!this.hasControlChars(i)){this.buffer.writeString(i);return}}for(let i of n)i.type==="text"?this.processText(i.value):this.buffer.handleEscape(i.value)}reset(){this.buffer=new pf}render(){return this.buffer.render()}hasControlChars(e){for(let n of e)if(n<" ")return!0;return!1}processText(e){let n=0,i=e.length;for(let o=0;o<i;o++){let s=e[o];if(s===`
150
150
  `||s==="\r"||s===" "||s==="\b"||s==="\v"){if(o>n){let c=e.slice(n,o),d=this.filterControlChars(c);d.length>0&&this.buffer.writeString(d)}this.buffer.control(s),n=o+1}else if(s<" "){if(o>n){let c=e.slice(n,o);c.length>0&&this.buffer.writeString(c)}n=o+1}}if(n<i){let o=e.slice(n),s=this.filterControlChars(o);s.length>0&&this.buffer.writeString(s)}}filterControlChars(e){let n=!1;for(let o of e)if(o<" "){n=!0;break}if(!n)return e;let i="";for(let o of e)o>=" "&&(i+=o);return i}},Ns=class qm{constructor(n,i,o,s){ke(this,"ansiReducer",new hf);this.mimetype=n,this.channel=i,this.timestamp=o,this.ansiReducer=s,this._data=this.ansiReducer.render()}get data(){return this._data}static create(n){let i=new hf;return i.append(n.data),new qm(n.mimetype,n.channel,n.timestamp,i)}appendData(n){return this.ansiReducer.append(n),new qm(this.mimetype,this.channel,this.timestamp,this.ansiReducer)}toJSON(){return{mimetype:this.mimetype,channel:this.channel,timestamp:this.timestamp,data:this.data}}};function W3(e,n=5e3){let i=[...e];if(i.length<2)return kv(i.map(K3),n);let o=i[i.length-1],s=i[i.length-2];return U3(o,s)&&(xv(o),xv(s),i[i.length-2]=Q3(s,o),i.pop()),kv(i,n)}function U3(e,n){let i=e.mimetype==="text/plain"&&n.mimetype==="text/plain";if(!i)return!1;let o=e.channel===n.channel,s=e.channel!=="stdin";return i&&o&&s}function K3(e){return e instanceof Ns?e:typeof e.data=="string"?Ns.create(e):e}function Q3(e,n){return e instanceof Ns?e.appendData(n.data):Ns.create(e).appendData(n.data)}function xv(e){In(typeof e.data=="string","expected string output")}function kv(e,n){let i=0,o;for(o=e.length-1;o>=0&&i<n;o--){let f=e[o];f.mimetype==="text/plain"?(In(typeof f.data=="string","expected string"),i+=f.data.split(`
151
151
  `).length):i++}if(i<n)return e;let s=o+1,c={channel:"stderr",mimetype:"text/html",data:`<pre>Streaming output truncated to last ${n} lines.
152
152
  </pre>`,timestamp:-1},d=e[s];if(d.mimetype==="text/plain"){In(typeof d.data=="string","expected string");let f=d.data.split(`
153
153
  `),p=n-(i-f.length);return[c,{...d,data:f.slice(-p).join(`
154
- `)},...e.slice(s+1)]}return[c,...e.slice(s+1)]}function G3(e,n){let i={...e};switch(n.status){case"queued":i.interrupted=!1,i.errored=!1,i.runElapsedTimeMs=null,i.debuggerActive=!1;break;case"running":i.interrupted=!1,e.stopped&&(i.output=null),i.status==="queued"&&(i.consoleOutputs=[]),i.stopped=!1,i.runStartTimestamp=n.timestamp,i.lastRunStartTimestamp=n.timestamp;break;case"idle":e.runStartTimestamp&&(i.runElapsedTimeMs=dm.fromSeconds((n.timestamp??0)-e.runStartTimestamp).toMilliseconds(),i.runStartTimestamp=null,i.staleInputs=!1),!e.lastRunStartTimestamp&&n.timestamp&&(i.lastRunStartTimestamp=n.timestamp),i.debuggerActive=!1;break;case null:break;case"disabled-transitively":break;case void 0:break;default:_s(n.status)}i.output=n.output??i.output,i.staleInputs=n.stale_inputs??i.staleInputs,i.status=n.status??i.status,i.serialization=n.serialization;let o=!1;n.output!=null&&n.output.mimetype==="application/vnd.marimo+error"&&((i.status==="queued"||i.status==="running")&&(i.status="idle"),In(Array.isArray(n.output.data),"Expected error output data to be an array"),n.output.data.some(f=>f.type==="interruption")?(i.interrupted=!0,o=!0):n.output.data.some(f=>f.type.includes("ancestor"))?i.stopped=!0:i.errored=!0);let s=e.consoleOutputs;o&&(i.debuggerActive=!1,s=s.map(f=>f.channel==="stdin"?{...f,response:f.response??""}:f));let c=n.console;c!=null&&(s=W3(Array.isArray(c)?c:[...s,c])),i.consoleOutputs=s,i.outline=Om(i.output);let d=[n.console].flat().filter(Boolean).filter(f=>f.channel==="pdb");return d.length>0&&d.some(f=>f.data==="start")&&(i.debuggerActive=!0),i}function J3(e){let n={...e};return e.status!=="disabled-transitively"&&(n.status="queued"),n.interrupted=!1,n.errored=!1,n.runElapsedTimeMs=null,n.debuggerActive=!1,n}lm=function(e){return e==="running"||e==="queued"},d_=function(e,n){let{status:i,output:o,runStartTimestamp:s,interrupted:c,staleInputs:d}=e;if(c)return!1;if(n)return!0;let f=lm(i),p=i==="running"&&o!==null&&s!==null&&(o.timestamp??0)>s;return f&&!p?!0:d};function X3(e,n){return vD(e*1e3,n==null?void 0:n.in)}var mf=function(e,n){return Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,e},qt;(function(e){e[e.EOS=0]="EOS",e[e.Text=1]="Text",e[e.Incomplete=2]="Incomplete",e[e.ESC=3]="ESC",e[e.Unknown=4]="Unknown",e[e.SGR=5]="SGR",e[e.OSCURL=6]="OSCURL"})(qt||(qt={})),Vh=class{constructor(){this.VERSION="6.0.6",this.setup_palettes(),this._use_classes=!1,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1,this.fg=this.bg=null,this._buffer="",this._url_allowlist={http:1,https:1},this._escape_html=!0,this.boldStyle="font-weight:bold",this.faintStyle="opacity:0.7",this.italicStyle="font-style:italic",this.underlineStyle="text-decoration:underline"}set use_classes(e){this._use_classes=e}get use_classes(){return this._use_classes}set url_allowlist(e){this._url_allowlist=e}get url_allowlist(){return this._url_allowlist}set escape_html(e){this._escape_html=e}get escape_html(){return this._escape_html}set boldStyle(e){this._boldStyle=e}get boldStyle(){return this._boldStyle}set faintStyle(e){this._faintStyle=e}get faintStyle(){return this._faintStyle}set italicStyle(e){this._italicStyle=e}get italicStyle(){return this._italicStyle}set underlineStyle(e){this._underlineStyle=e}get underlineStyle(){return this._underlineStyle}setup_palettes(){this.ansi_colors=[[{rgb:[0,0,0],class_name:"ansi-black"},{rgb:[187,0,0],class_name:"ansi-red"},{rgb:[0,187,0],class_name:"ansi-green"},{rgb:[187,187,0],class_name:"ansi-yellow"},{rgb:[0,0,187],class_name:"ansi-blue"},{rgb:[187,0,187],class_name:"ansi-magenta"},{rgb:[0,187,187],class_name:"ansi-cyan"},{rgb:[255,255,255],class_name:"ansi-white"}],[{rgb:[85,85,85],class_name:"ansi-bright-black"},{rgb:[255,85,85],class_name:"ansi-bright-red"},{rgb:[0,255,0],class_name:"ansi-bright-green"},{rgb:[255,255,85],class_name:"ansi-bright-yellow"},{rgb:[85,85,255],class_name:"ansi-bright-blue"},{rgb:[255,85,255],class_name:"ansi-bright-magenta"},{rgb:[85,255,255],class_name:"ansi-bright-cyan"},{rgb:[255,255,255],class_name:"ansi-bright-white"}]],this.palette_256=[],this.ansi_colors.forEach(i=>{i.forEach(o=>{this.palette_256.push(o)})});let e=[0,95,135,175,215,255];for(let i=0;i<6;++i)for(let o=0;o<6;++o)for(let s=0;s<6;++s){let c={rgb:[e[i],e[o],e[s]],class_name:"truecolor"};this.palette_256.push(c)}let n=8;for(let i=0;i<24;++i,n+=10){let o={rgb:[n,n,n],class_name:"truecolor"};this.palette_256.push(o)}}escape_txt_for_html(e){return this._escape_html?e.replace(/[&<>"']/gm,n=>{if(n==="&")return"&amp;";if(n==="<")return"&lt;";if(n===">")return"&gt;";if(n==='"')return"&quot;";if(n==="'")return"&#x27;"}):e}append_buffer(e){this._buffer+=e}get_next_packet(){var e={kind:qt.EOS,text:"",url:""},n=this._buffer.length;if(n==0)return e;var i=this._buffer.indexOf("\x1B");if(i==-1)return e.kind=qt.Text,e.text=this._buffer,this._buffer="",e;if(i>0)return e.kind=qt.Text,e.text=this._buffer.slice(0,i),this._buffer=this._buffer.slice(i),e;if(i==0){if(n<3)return e.kind=qt.Incomplete,e;var o=this._buffer.charAt(1);if(o!="["&&o!="]"&&o!="(")return e.kind=qt.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;if(o=="["){this._csi_regex||(this._csi_regex=Sv(Z3||(Z3=mf([`
154
+ `)},...e.slice(s+1)]}return[c,...e.slice(s+1)]}function G3(e,n){let i={...e};switch(n.status){case"queued":i.interrupted=!1,i.errored=!1,i.runElapsedTimeMs=null,i.debuggerActive=!1;break;case"running":i.interrupted=!1,e.stopped&&(i.output=null),i.status==="queued"&&(i.consoleOutputs=[]),i.stopped=!1,i.runStartTimestamp=n.timestamp,i.lastRunStartTimestamp=n.timestamp;break;case"idle":e.runStartTimestamp&&(i.runElapsedTimeMs=dm.fromSeconds((n.timestamp??0)-e.runStartTimestamp).toMilliseconds(),i.runStartTimestamp=null,i.staleInputs=!1),!e.lastRunStartTimestamp&&n.timestamp&&(i.lastRunStartTimestamp=n.timestamp),i.debuggerActive=!1;break;case null:break;case"disabled-transitively":break;case void 0:break;default:_s(n.status)}i.output=n.output??i.output,i.staleInputs=n.stale_inputs??i.staleInputs,i.status=n.status??i.status,i.serialization=n.serialization;let o=!1;n.output!=null&&n.output.mimetype==="application/vnd.marimo+error"&&((i.status==="queued"||i.status==="running")&&(i.status="idle"),In(Array.isArray(n.output.data),"Expected error output data to be an array"),n.output.data.some(f=>f.type==="interruption")?(i.interrupted=!0,o=!0):n.output.data.some(f=>f.type.includes("ancestor"))?i.stopped=!0:i.errored=!0);let s=e.consoleOutputs;o&&(i.debuggerActive=!1,s=s.map(f=>f.channel==="stdin"?{...f,response:f.response??""}:f));let c=n.console;c!=null&&(s=W3(Array.isArray(c)?c:[...s,c])),i.consoleOutputs=s,i.outline=Om(i.output);let d=[n.console].flat().filter(Boolean).filter(f=>f.channel==="pdb");return d.length>0&&d.some(f=>f.data==="start")&&(i.debuggerActive=!0),i}function J3(e){let n={...e};return e.status!=="disabled-transitively"&&(n.status="queued"),n.interrupted=!1,n.errored=!1,n.runElapsedTimeMs=null,n.debuggerActive=!1,n}cm=function(e){return e==="running"||e==="queued"},u_=function(e,n){let{status:i,output:o,runStartTimestamp:s,interrupted:c,staleInputs:d}=e;if(c)return!1;if(n)return!0;let f=cm(i),p=i==="running"&&o!==null&&s!==null&&(o.timestamp??0)>s;return f&&!p?!0:d};function X3(e,n){return vD(e*1e3,n==null?void 0:n.in)}var mf=function(e,n){return Object.defineProperty?Object.defineProperty(e,"raw",{value:n}):e.raw=n,e},qt;(function(e){e[e.EOS=0]="EOS",e[e.Text=1]="Text",e[e.Incomplete=2]="Incomplete",e[e.ESC=3]="ESC",e[e.Unknown=4]="Unknown",e[e.SGR=5]="SGR",e[e.OSCURL=6]="OSCURL"})(qt||(qt={})),Hh=class{constructor(){this.VERSION="6.0.6",this.setup_palettes(),this._use_classes=!1,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1,this.fg=this.bg=null,this._buffer="",this._url_allowlist={http:1,https:1},this._escape_html=!0,this.boldStyle="font-weight:bold",this.faintStyle="opacity:0.7",this.italicStyle="font-style:italic",this.underlineStyle="text-decoration:underline"}set use_classes(e){this._use_classes=e}get use_classes(){return this._use_classes}set url_allowlist(e){this._url_allowlist=e}get url_allowlist(){return this._url_allowlist}set escape_html(e){this._escape_html=e}get escape_html(){return this._escape_html}set boldStyle(e){this._boldStyle=e}get boldStyle(){return this._boldStyle}set faintStyle(e){this._faintStyle=e}get faintStyle(){return this._faintStyle}set italicStyle(e){this._italicStyle=e}get italicStyle(){return this._italicStyle}set underlineStyle(e){this._underlineStyle=e}get underlineStyle(){return this._underlineStyle}setup_palettes(){this.ansi_colors=[[{rgb:[0,0,0],class_name:"ansi-black"},{rgb:[187,0,0],class_name:"ansi-red"},{rgb:[0,187,0],class_name:"ansi-green"},{rgb:[187,187,0],class_name:"ansi-yellow"},{rgb:[0,0,187],class_name:"ansi-blue"},{rgb:[187,0,187],class_name:"ansi-magenta"},{rgb:[0,187,187],class_name:"ansi-cyan"},{rgb:[255,255,255],class_name:"ansi-white"}],[{rgb:[85,85,85],class_name:"ansi-bright-black"},{rgb:[255,85,85],class_name:"ansi-bright-red"},{rgb:[0,255,0],class_name:"ansi-bright-green"},{rgb:[255,255,85],class_name:"ansi-bright-yellow"},{rgb:[85,85,255],class_name:"ansi-bright-blue"},{rgb:[255,85,255],class_name:"ansi-bright-magenta"},{rgb:[85,255,255],class_name:"ansi-bright-cyan"},{rgb:[255,255,255],class_name:"ansi-bright-white"}]],this.palette_256=[],this.ansi_colors.forEach(i=>{i.forEach(o=>{this.palette_256.push(o)})});let e=[0,95,135,175,215,255];for(let i=0;i<6;++i)for(let o=0;o<6;++o)for(let s=0;s<6;++s){let c={rgb:[e[i],e[o],e[s]],class_name:"truecolor"};this.palette_256.push(c)}let n=8;for(let i=0;i<24;++i,n+=10){let o={rgb:[n,n,n],class_name:"truecolor"};this.palette_256.push(o)}}escape_txt_for_html(e){return this._escape_html?e.replace(/[&<>"']/gm,n=>{if(n==="&")return"&amp;";if(n==="<")return"&lt;";if(n===">")return"&gt;";if(n==='"')return"&quot;";if(n==="'")return"&#x27;"}):e}append_buffer(e){this._buffer+=e}get_next_packet(){var e={kind:qt.EOS,text:"",url:""},n=this._buffer.length;if(n==0)return e;var i=this._buffer.indexOf("\x1B");if(i==-1)return e.kind=qt.Text,e.text=this._buffer,this._buffer="",e;if(i>0)return e.kind=qt.Text,e.text=this._buffer.slice(0,i),this._buffer=this._buffer.slice(i),e;if(i==0){if(n<3)return e.kind=qt.Incomplete,e;var o=this._buffer.charAt(1);if(o!="["&&o!="]"&&o!="(")return e.kind=qt.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;if(o=="["){this._csi_regex||(this._csi_regex=Sv(Z3||(Z3=mf([`
155
155
  ^ # beginning of line
156
156
  #
157
157
  # First attempt
@@ -248,7 +248,7 @@ mark line col
248
248
  | # alternate
249
249
  (?:\\x07) # BEL (what xterm did)
250
250
  )
251
- `]))));let c=this._buffer.match(this._osc_regex);if(c===null)return e.kind=qt.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;e.kind=qt.OSCURL,e.url=c[1],e.text=c[2];var s=c[0].length;return this._buffer=this._buffer.slice(s),e}else if(o=="(")return e.kind=qt.Unknown,this._buffer=this._buffer.slice(3),e}}ansi_to_html(e){this.append_buffer(e);for(var n=[];;){var i=this.get_next_packet();if(i.kind==qt.EOS||i.kind==qt.Incomplete)break;i.kind==qt.ESC||i.kind==qt.Unknown||(i.kind==qt.Text?n.push(this.transform_to_html(this.with_state(i))):i.kind==qt.SGR?this.process_ansi(i):i.kind==qt.OSCURL&&n.push(this.process_hyperlink(i)))}return n.join("")}with_state(e){return{bold:this.bold,faint:this.faint,italic:this.italic,underline:this.underline,fg:this.fg,bg:this.bg,text:e.text}}process_ansi(e){let n=e.text.split(";");for(;n.length>0;){let i=n.shift(),o=parseInt(i,10);if(isNaN(o)||o===0)this.fg=null,this.bg=null,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1;else if(o===1)this.bold=!0;else if(o===2)this.faint=!0;else if(o===3)this.italic=!0;else if(o===4)this.underline=!0;else if(o===21)this.bold=!1;else if(o===22)this.faint=!1,this.bold=!1;else if(o===23)this.italic=!1;else if(o===24)this.underline=!1;else if(o===39)this.fg=null;else if(o===49)this.bg=null;else if(o>=30&&o<38)this.fg=this.ansi_colors[0][o-30];else if(o>=40&&o<48)this.bg=this.ansi_colors[0][o-40];else if(o>=90&&o<98)this.fg=this.ansi_colors[1][o-90];else if(o>=100&&o<108)this.bg=this.ansi_colors[1][o-100];else if((o===38||o===48)&&n.length>0){let s=o===38,c=n.shift();if(c==="5"&&n.length>0){let d=parseInt(n.shift(),10);d>=0&&d<=255&&(s?this.fg=this.palette_256[d]:this.bg=this.palette_256[d])}if(c==="2"&&n.length>2){let d=parseInt(n.shift(),10),f=parseInt(n.shift(),10),p=parseInt(n.shift(),10);if(d>=0&&d<=255&&f>=0&&f<=255&&p>=0&&p<=255){let y={rgb:[d,f,p],class_name:"truecolor"};s?this.fg=y:this.bg=y}}}}}transform_to_html(e){let n=e.text;if(n.length===0||(n=this.escape_txt_for_html(n),!e.bold&&!e.italic&&!e.faint&&!e.underline&&e.fg===null&&e.bg===null))return n;let i=[],o=[],s=e.fg,c=e.bg;e.bold&&i.push(this._boldStyle),e.faint&&i.push(this._faintStyle),e.italic&&i.push(this._italicStyle),e.underline&&i.push(this._underlineStyle),this._use_classes?(s&&(s.class_name==="truecolor"?i.push(`color:rgb(${s.rgb.join(",")})`):o.push(`${s.class_name}-fg`)),c&&(c.class_name==="truecolor"?i.push(`background-color:rgb(${c.rgb.join(",")})`):o.push(`${c.class_name}-bg`))):(s&&i.push(`color:rgb(${s.rgb.join(",")})`),c&&i.push(`background-color:rgb(${c.rgb})`));let d="",f="";return o.length&&(d=` class="${o.join(" ")}"`),i.length&&(f=` style="${i.join(";")}"`),`<span${f}${d}>${n}</span>`}process_hyperlink(e){let n=e.url.split(":");return n.length<1||!this._url_allowlist[n[0]]?"":`<a href="${this.escape_txt_for_html(e.url)}">${this.escape_txt_for_html(e.text)}</a>`}};function Sv(e,...n){let i=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(i)}function Y3(e,...n){let i=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(i,"g")}var Z3,eT,tT,nT=new Vh;ld=function(e){try{let n=document.createElement("div");return n.innerHTML=e,(n.textContent||n.innerText||"").split(`
251
+ `]))));let c=this._buffer.match(this._osc_regex);if(c===null)return e.kind=qt.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;e.kind=qt.OSCURL,e.url=c[1],e.text=c[2];var s=c[0].length;return this._buffer=this._buffer.slice(s),e}else if(o=="(")return e.kind=qt.Unknown,this._buffer=this._buffer.slice(3),e}}ansi_to_html(e){this.append_buffer(e);for(var n=[];;){var i=this.get_next_packet();if(i.kind==qt.EOS||i.kind==qt.Incomplete)break;i.kind==qt.ESC||i.kind==qt.Unknown||(i.kind==qt.Text?n.push(this.transform_to_html(this.with_state(i))):i.kind==qt.SGR?this.process_ansi(i):i.kind==qt.OSCURL&&n.push(this.process_hyperlink(i)))}return n.join("")}with_state(e){return{bold:this.bold,faint:this.faint,italic:this.italic,underline:this.underline,fg:this.fg,bg:this.bg,text:e.text}}process_ansi(e){let n=e.text.split(";");for(;n.length>0;){let i=n.shift(),o=parseInt(i,10);if(isNaN(o)||o===0)this.fg=null,this.bg=null,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1;else if(o===1)this.bold=!0;else if(o===2)this.faint=!0;else if(o===3)this.italic=!0;else if(o===4)this.underline=!0;else if(o===21)this.bold=!1;else if(o===22)this.faint=!1,this.bold=!1;else if(o===23)this.italic=!1;else if(o===24)this.underline=!1;else if(o===39)this.fg=null;else if(o===49)this.bg=null;else if(o>=30&&o<38)this.fg=this.ansi_colors[0][o-30];else if(o>=40&&o<48)this.bg=this.ansi_colors[0][o-40];else if(o>=90&&o<98)this.fg=this.ansi_colors[1][o-90];else if(o>=100&&o<108)this.bg=this.ansi_colors[1][o-100];else if((o===38||o===48)&&n.length>0){let s=o===38,c=n.shift();if(c==="5"&&n.length>0){let d=parseInt(n.shift(),10);d>=0&&d<=255&&(s?this.fg=this.palette_256[d]:this.bg=this.palette_256[d])}if(c==="2"&&n.length>2){let d=parseInt(n.shift(),10),f=parseInt(n.shift(),10),p=parseInt(n.shift(),10);if(d>=0&&d<=255&&f>=0&&f<=255&&p>=0&&p<=255){let y={rgb:[d,f,p],class_name:"truecolor"};s?this.fg=y:this.bg=y}}}}}transform_to_html(e){let n=e.text;if(n.length===0||(n=this.escape_txt_for_html(n),!e.bold&&!e.italic&&!e.faint&&!e.underline&&e.fg===null&&e.bg===null))return n;let i=[],o=[],s=e.fg,c=e.bg;e.bold&&i.push(this._boldStyle),e.faint&&i.push(this._faintStyle),e.italic&&i.push(this._italicStyle),e.underline&&i.push(this._underlineStyle),this._use_classes?(s&&(s.class_name==="truecolor"?i.push(`color:rgb(${s.rgb.join(",")})`):o.push(`${s.class_name}-fg`)),c&&(c.class_name==="truecolor"?i.push(`background-color:rgb(${c.rgb.join(",")})`):o.push(`${c.class_name}-bg`))):(s&&i.push(`color:rgb(${s.rgb.join(",")})`),c&&i.push(`background-color:rgb(${c.rgb})`));let d="",f="";return o.length&&(d=` class="${o.join(" ")}"`),i.length&&(f=` style="${i.join(";")}"`),`<span${f}${d}>${n}</span>`}process_hyperlink(e){let n=e.url.split(":");return n.length<1||!this._url_allowlist[n[0]]?"":`<a href="${this.escape_txt_for_html(e.url)}">${this.escape_txt_for_html(e.text)}</a>`}};function Sv(e,...n){let i=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(i)}function Y3(e,...n){let i=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(i,"g")}var Z3,eT,tT,nT=new Hh;ld=function(e){try{let n=document.createElement("div");return n.innerHTML=e,(n.textContent||n.innerText||"").split(`
252
252
  `).map(i=>i.trimEnd()).join(`
253
- `)}catch(n){return Se.error("Error parsing HTML content:",n),e}},Ww=function(e){if(!e)return"";try{return ld(nT.ansi_to_html(e))}catch(n){return Se.error("Error converting ANSI to plain text:",n),e}},qh={startCase:e=>{if(!e)return"";if(typeof e!="string")throw Se.error(e),TypeError(`Expected string, got ${typeof e}`);return/[A-Za-z]/.test(e)?h4(e):e},htmlEscape:e=>e&&e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#039;").replaceAll(`
254
- `," "),withTrailingSlash(e){return e.endsWith("/")?e:`${e}/`},withoutTrailingSlash(e){return e.endsWith("/")?e.slice(0,-1):e},withoutLeadingSlash(e){return e.startsWith("/")?e.slice(1):e},asString:e=>{if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}};var Cv=!1;function rT(e){var o;let n=[],i=[e.console].filter(Boolean).flat();for(let s of i){let c=s.mimetype==="text/plain",d=s.mimetype==="text/html"||s.mimetype==="application/vnd.marimo+traceback";if(c||d){let f=s.channel==="stderr"||s.channel==="marimo-error";switch(s.channel){case"stdout":case"stderr":case"marimo-error":{let p=qh.asString(s.data),y=d?ld(p):p;n.push({timestamp:s.timestamp||Date.now(),level:f?"stderr":"stdout",message:y,cellId:e.cell_id});break}default:break}}}if(n.forEach(Ev.log),i.length===0&&Xu((o=e.output)==null?void 0:o.mimetype)&&Array.isArray(e.output.data)){e.output.data.forEach(c=>{Ev.log({level:"stderr",cellId:e.cell_id,timestamp:e.timestamp??0,message:JSON.stringify(c)})});let s=e.output.data.some(c=>c.type==="internal");!Cv&&s&&(Cv=!0,Ll({title:"An internal error occurred",description:"See console for details.",className:"text-xs text-background bg-(--red-10) py-2 pl-3 *:flex *:gap-3"}))}return n}var Ev={log:e=>{let n=e.level==="stdout"?"gray":e.level==="stderr"?"red":"orange",i=e.level.toUpperCase();console.log(`%c[${i}]`,`color:${n}; padding:2px 0; border-radius:2px; font-weight:bold`,`[${im(e.timestamp)}]`,`(${e.cellId}) ${e.message}`)}};im=function(e){try{return X3(e).toLocaleTimeString(void 0,{hour12:!0,hour:"numeric",minute:"numeric",second:"numeric"})}catch{return""}},l_=function(e,n){let i=Yu(n);i?i.focus():Se.warn(`[CellFocusManager] focusCellEditor: element not found: ${n}`)},Pw=function(e){let n=document.getElementById(er.create(e));n?gf(n):Se.warn(`[CellFocusManager] focusCell: element not found: ${e}`)},o_=function(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})},zh=function(){return document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains("marimo-cell")};function gf(e){try{e.focus()}catch{Se.warn("[CellFocusManager] element may not be focusable",e)}}Im=function(e,n){let{retries:i,delay:o,initialDelay:s=0}=n,c=0,d=()=>{if(c<i){try{if(e())return}catch(f){Se.error(`Error executing function on attempt ${c+1}, retrying`,{error:f})}c++,setTimeout(d,o)}};s>0?setTimeout(d,s):d()};function Is({cellId:e,cell:n,isCodeHidden:i,codeFocus:o,variableName:s}){var d;if(!n)return;let c=document.getElementById(er.create(e));if(!c){Se.warn("scrollCellIntoView: element not found");return}if(zh()){gf(c);return}if(i)gf(c);else{let f=(d=n.current)==null?void 0:d.editorView;if(!f){Se.warn("scrollCellIntoView: editor not found",e);return}if(f.hasFocus||!document.hasFocus())return;if(Im(()=>(f.focus(),f.hasFocus),{retries:5,delay:20}),o==="top")f.dispatch({selection:{anchor:0,head:0}});else if(o==="bottom"){let p=f.state.doc.line(f.state.doc.lines);f.dispatch({selection:{anchor:p.from,head:p.from}})}else s&&Wu(f,s)}c.scrollIntoView({behavior:"smooth",block:"nearest"})}Uw=function(e){let n=document.getElementById(er.create(e));if(!n){Se.warn("scrollCellIntoView: element not found");return}n.classList.add("focus-outline"),setTimeout(()=>{n.classList.remove("focus-outline")},2e3),n.scrollIntoView({behavior:"smooth",block:"center"})};function iT(){let e=document.getElementById("App");e==null||e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}function aT(){var e;(e=document.getElementById("App"))==null||e.scrollTo({top:0,behavior:"smooth"})}e_=function(e){let n=Yu(e);if(n!=null&&n.hasFocus){ny(n,{behavior:"instant"});return}let i=document.getElementById(er.create(e));i?i.scrollIntoView({behavior:"instant",block:"nearest"}):Se.warn(`[CellFocusManager] scrollCellIntoView: element not found: ${e}`)},Pr=function({id:e,name:n="_",code:i="",lastCodeRun:o=null,lastExecutionTime:s=null,edited:c=!1,config:d,serializedEditorState:f=null}){return{id:e,config:d||{hide_code:!1,disabled:!1,column:null},name:n,code:i,edited:c,lastCodeRun:o,lastExecutionTime:s,serializedEditorState:f}};function oT(e){return{hide_code:!1,disabled:!1,column:null,...e}}Mr=function(e){return{outline:null,output:null,consoleOutputs:[],status:"idle",staleInputs:!1,interrupted:!1,errored:!1,stopped:!1,runElapsedTimeMs:null,runStartTimestamp:null,lastRunStartTimestamp:null,debuggerActive:!1,...e}};var yf=Jr();function Tv(e){let n={column:0,hide_code:!1,disabled:!1};return{...e,cellData:{[Rs]:Pr({id:Rs,config:n}),...e.cellData},cellRuntime:{[Rs]:Mr(),...e.cellRuntime},cellHandles:{[Rs]:(0,jt.createRef)(),...e.cellHandles}}}function sT(){return Tv({cellIds:Ql.from([]),cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set})}let lT,cT,Rv;({reducer:lT,createActions:cT,useActions:Rv,valueAtom:bt}=Ml(sT,{createNewCell:(e,n)=>{var T;let{cellId:i,before:o,code:s,lastCodeRun:c=null,lastExecutionTime:d=null,autoFocus:f=!0,skipIfCodeExists:p=!1,hideCode:y=!1}=n,w,_;if(p){for(let I of e.cellIds.inOrderIds)if(((T=e.cellData[I])==null?void 0:T.code)===s)return e}if(i==="__end__"){let I=e.cellIds.atOrThrow(0);w=I.id,_=I.length}else if(typeof i=="string"){let I=e.cellIds.findWithId(i);w=I.id,_=I.topLevelIds.indexOf(i)}else if(i.type==="__end__"){let I=e.cellIds.get(i.columnId)||e.cellIds.atOrThrow(0);w=I.id,_=I.length}else throw Error("Invalid cellId");let C=n.newCellId||Ma.create(),E=o?_:_+1;return{...e,cellIds:e.cellIds.insertId(C,w,E),cellData:{...e.cellData,[C]:Pr({id:C,code:s,lastCodeRun:c,config:oT({hide_code:y}),lastExecutionTime:d,edited:!!s&&s!==c})},cellRuntime:{...e.cellRuntime,[C]:Mr()},cellHandles:{...e.cellHandles,[C]:(0,jt.createRef)()},scrollKey:f?C:null,untouchedNewCells:y?new Set([...e.untouchedNewCells,C]):e.untouchedNewCells}},moveCell:(e,n)=>{let{cellId:i,before:o,direction:s}=n;if(o!==void 0&&s!==void 0&&Se.warn("Both before and direction specified for moveCell. Ignoring one."),s){let f=e.cellIds.findWithId(i),p=e.cellIds.indexOf(f),y=s==="left"?p-1:p+1,w=e.cellIds.at(y);return w?{...e,cellIds:e.cellIds.moveAcrossColumns(f.id,i,w.id,void 0),scrollKey:i}:e}let c=e.cellIds.findWithId(i),d=c.indexOfOrThrow(i);return o&&d===0?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,0),scrollKey:i}:!o&&d===c.length-1?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,c.length-1),scrollKey:i}:o?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,d-1),scrollKey:i}:{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,d+1),scrollKey:i}},dropCellOverCell:(e,n)=>{let{cellId:i,overCellId:o}=n,s=e.cellIds.findWithId(i),c=e.cellIds.findWithId(o),d=s.indexOfOrThrow(i),f=c.indexOfOrThrow(o);return s.id===c.id?d===f?e:{...e,cellIds:e.cellIds.moveWithinColumn(s.id,d,f),scrollKey:null}:{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,i,c.id,o),scrollKey:null}},dropCellOverColumn:(e,n)=>{let{cellId:i,columnId:o}=n,s=e.cellIds.findWithId(i);return{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,i,o,void 0)}},dropOverNewColumn:(e,n)=>{let{cellId:i}=n;return{...e,cellIds:e.cellIds.moveToNewColumn(i)}},moveColumn:(e,n)=>n.column===n.overColumn?e:{...e,cellIds:e.cellIds.moveColumn(n.column,n.overColumn)},focusCell:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,where:s}=n,c=i.indexOfOrThrow(o),d;d=s==="before"?xh(c-1,0,i.length-1):s==="after"?xh(c+1,0,i.length-1):c;let f=i.atOrThrow(d);return Is({cellId:f,cell:e.cellHandles[f],isCodeHidden:As(e,f),codeFocus:s==="after"?"top":"bottom",variableName:void 0}),e},focusTopCell:e=>{let n=e.cellIds.getColumns().at(0);if(n===void 0||n.length===0)return e;let i=n.first();return Is({cellId:i,cell:e.cellHandles[i],isCodeHidden:As(e,i),codeFocus:void 0,variableName:void 0}),aT(),e},focusBottomCell:e=>{let n=e.cellIds.getColumns().at(-1);if(n===void 0||n.length===0)return e;let i=n.last();return Is({cellId:i,cell:e.cellHandles[i],isCodeHidden:As(e,i),codeFocus:void 0,variableName:void 0}),iT(),e},sendToTop:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,scroll:s=!0}=n,c=i.indexOfOrThrow(o);return c===0?e:{...e,cellIds:e.cellIds.moveWithinColumn(i.id,c,0),scrollKey:s?o:null}},sendToBottom:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,scroll:s=!0}=n,c=i.indexOfOrThrow(o),d=i.length-1;return c===d?e:{...e,cellIds:e.cellIds.moveWithinColumn(i.id,c,d),scrollKey:s?o:null}},addColumn:(e,n)=>{let i=Ma.create();return{...e,cellIds:e.cellIds.addColumn(n.columnId,[i]),cellData:{...e.cellData,[i]:Pr({id:i})},cellRuntime:{...e.cellRuntime,[i]:Mr()},cellHandles:{...e.cellHandles,[i]:(0,jt.createRef)()},scrollKey:i}},addColumnBreakpoint:(e,n)=>{let{cellId:i}=n;return e.cellIds.getColumns()[0].inOrderIds[0]===i?e:{...e,cellIds:e.cellIds.insertBreakpoint(i)}},deleteColumn:(e,n)=>{let{columnId:i}=n;return{...e,cellIds:e.cellIds.delete(i)}},mergeAllColumns:e=>({...e,cellIds:e.cellIds.mergeAllColumns()}),compactColumns:e=>({...e,cellIds:e.cellIds.compact()}),deleteCell:(e,n)=>{var p,y;let i=n.cellId;if(e.cellIds.hasOnlyOneId())return e;let o=e.cellIds.findWithId(i),s=o.indexOfOrThrow(i),c=s===0?1:s-1,d=null;o.length>1&&(d=o.atOrThrow(c));let f=(y=(p=e.cellHandles[i].current)==null?void 0:p.editorView)==null?void 0:y.state.toJSON({history:Z4});return f.doc=e.cellData[i].code,fT(i),{...e,cellIds:e.cellIds.deleteById(i),history:[...e.history,{name:e.cellData[i].name,serializedEditorState:f,column:o.id,index:s,isSetupCell:i===yr}],scrollKey:d}},undoDeleteCell:e=>{if(e.history.length===0)return e;let{name:n,serializedEditorState:i={doc:""},column:o,index:s,isSetupCell:c}=e.history[e.history.length-1],d=c?yr:Ma.create(),f=Pr({id:d,name:n,code:i.doc,edited:i.doc.trim().length>0,serializedEditorState:i});return{...e,cellIds:e.cellIds.insertId(d,o,s),cellData:{...e.cellData,[d]:f},cellRuntime:{...e.cellRuntime,[d]:Mr()},cellHandles:{...e.cellHandles,[d]:(0,jt.createRef)()},history:e.history.slice(0,-1),scrollKey:d}},clearSerializedEditorState:(e,n)=>{let{cellId:i}=n;return js({state:e,cellId:i,cellReducer:o=>({...o,serializedEditorState:null})})},updateCellCode:(e,n)=>{let{cellId:i,code:o,formattingChange:s}=n;return e.cellData[i]?js({state:e,cellId:i,cellReducer:c=>s?{...c,code:o,lastCodeRun:c.edited?c.lastCodeRun:o}:{...c,code:o,edited:o.trim()!==c.lastCodeRun}}):e},updateCellName:(e,n)=>{let{cellId:i,name:o}=n;return js({state:e,cellId:i,cellReducer:s=>({...s,name:o})})},updateCellConfig:(e,n)=>{let{cellId:i,config:o}=n;return js({state:e,cellId:i,cellReducer:s=>({...s,config:{...s.config,...o}})})},prepareForRun:(e,n)=>js({state:qs({state:e,cellId:n.cellId,cellReducer:i=>J3(i)}),cellId:n.cellId,cellReducer:i=>({...i,edited:!1,lastCodeRun:i.code.trim()})}),handleCellMessage:(e,n)=>{let i=n.cell_id,o=qs({state:e,cellId:i,cellReducer:s=>G3(s,n)});return{...o,cellLogs:[...o.cellLogs,...rT(n)]}},setCellIds:(e,n)=>{if(ZR(e.cellIds.inOrderIds,n.cellIds))return e;let i={...e.cellData},o={...e.cellRuntime},s={...e.cellHandles};for(let c of n.cellIds)c in e.cellData||(i[c]=Pr({id:c})),c in e.cellRuntime||(o[c]=Mr()),c in e.cellHandles||(s[c]=(0,jt.createRef)());return{...e,cellIds:Ql.fromWithPreviousShape(n.cellIds,e.cellIds),cellData:i,cellRuntime:o,cellHandles:s}},setCellCodes:(e,n)=>{In(n.codes.length===n.ids.length,"Expected codes and ids to have the same length");let i={...e},o=({cell:s,code:c,cellId:d})=>{if(!s)return Pr({id:d,code:c,lastCodeRun:n.codeIsStale?null:c,edited:n.codeIsStale&&c.trim().length>0});let f=n.codeIsStale?s.lastCodeRun:c,p=f?f.trim()!==c.trim():!!c;if(s.code.trim()===c.trim())return{...s,code:c,edited:p,lastCodeRun:f};if(!Yh()){let y=i.cellHandles[d].current;y!=null&&y.editorViewOrNull&&_o(y.editorViewOrNull,c)}return{...s,code:c,edited:p,lastCodeRun:f}};for(let[s,c]of kx(n.ids,n.codes))s===void 0||c===void 0||(i={...i,cellData:{...i.cellData,[s]:o({cell:i.cellData[s],code:c,cellId:s})}});return i},setStdinResponse:(e,n)=>{let{cellId:i,response:o,outputIndex:s}=n;return qs({state:e,cellId:i,cellReducer:c=>{let d=[...c.consoleOutputs],f=d[s];return f.channel==="stdin"?(d[s]={channel:"stdin",mimetype:f.mimetype,data:f.data,timestamp:f.timestamp,response:o},{...c,interrupted:!1,consoleOutputs:d}):(Se.warn("Expected stdin output"),c)}})},setCells:(e,n)=>{let i=Object.fromEntries(n.map(s=>[s.id,s])),o=Object.fromEntries(n.map(s=>[s.id,Mr()]));return Tv({...e,cellIds:Ql.fromIdsAndColumns(n.map(s=>[s.id,s.config.column])),cellData:i,cellRuntime:o,cellHandles:Object.fromEntries(n.map(s=>[s.id,(0,jt.createRef)()]))})},moveToNextCell:(e,n)=>{let{cellId:i,before:o,noCreate:s=!1}=n;if(i==="__scratch__")return e;let c=e.cellIds.findWithId(i),d=c.indexOfOrThrow(i),f=o?d-1:d+1,p=f===c.length,y=f===-1;if(p&&!s){let w=Ma.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,f),cellData:{...e.cellData,[w]:Pr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Mr()},cellHandles:{...e.cellHandles,[w]:(0,jt.createRef)()},scrollKey:w}}if(y&&!s){let w=Ma.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,0),cellData:{...e.cellData,[w]:Pr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Mr()},cellHandles:{...e.cellHandles,[w]:(0,jt.createRef)()},scrollKey:w}}if((p||y)&&s)return e;if(f>=0&&f<c.length){let w=c.atOrThrow(f);Is({cellId:w,cell:e.cellHandles[w],isCodeHidden:As(e,w),codeFocus:o?"bottom":"top",variableName:void 0})}return e},markTouched:(e,n)=>{let{cellId:i}=n;if(e.untouchedNewCells.has(i)){let o=new Set(e.untouchedNewCells);return o.delete(i),{...e,untouchedNewCells:o}}return e},scrollToTarget:e=>{let n=e.scrollKey;if(n===null)return e;let i=e.cellIds.findWithId(n),o=i.indexOfOrThrow(n),s=o===i.length-1?i.last():i.atOrThrow(o);return Is({cellId:s,cell:e.cellHandles[s],isCodeHidden:As(e,s),codeFocus:void 0,variableName:void 0}),{...e,scrollKey:null}},foldAll:e=>(Bx(Object.values(e.cellHandles).map(n=>{var i;return(i=n.current)==null?void 0:i.editorView})),e),unfoldAll:e=>(Hx(Object.values(e.cellHandles).map(n=>{var i;return(i=n.current)==null?void 0:i.editorView})),e),clearLogs:e=>({...e,cellLogs:[]}),collapseCell:(e,n)=>{let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o.topLevelIds.map(f=>e.cellRuntime[f].outline),c=wv(o.indexOfOrThrow(i),s);if(!c)return e;let d=o.atOrThrow(c[1]);return{...e,cellIds:e.cellIds.transformWithCellId(i,f=>f.collapse(i,d)),scrollKey:i}},expandCell:(e,n)=>{let{cellId:i}=n;return{...e,cellIds:e.cellIds.transformWithCellId(i,o=>o.expand(i)),scrollKey:i}},collapseAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>{let i=n.topLevelIds.map(p=>e.cellRuntime[p].outline),o=[...n.nodes],s=[],c=[],d=o.length-1;for(;d>=0;){let p=wv(d,i);if(p){let y=d,w=p[1],_=s.find(T=>T.start<=w&&T.end===w);_&&(w=_.start),s.push({start:y,end:w});let C=n.atOrThrow(y),E=n.atOrThrow(w);c.push({id:C,until:E})}else c.push(null);d--}let f=c.reverse();return n.collapseAll(f)})}),expandAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>n.expandAll())}),showCellIfHidden:(e,n)=>{let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o,c=o.findAndExpandDeep(i);return c.equals(s)?e:{...e,cellIds:e.cellIds.transformWithCellId(i,()=>c)}},splitCell:(e,n)=>{var w;let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o.indexOfOrThrow(i),c=e.cellData[i],d=e.cellHandles[i].current;if((d==null?void 0:d.editorView)==null)return e;let{beforeCursorCode:f,afterCursorCode:p}=F3(d.editorView);_o(d.editorView,f);let y=Ma.create();return{...e,cellIds:e.cellIds.insertId(y,o.id,s+1),cellData:{...e.cellData,[i]:{...c,code:f,edited:!!f&&f.trim()!==((w=c.lastCodeRun)==null?void 0:w.trim())},[y]:Pr({id:y,code:p,edited:!!p})},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]},[y]:Mr()},cellHandles:{...e.cellHandles,[y]:(0,jt.createRef)()},scrollKey:y}},undoSplitCell:(e,n)=>{var d;let{cellId:i,snapshot:o}=n,s=e.cellData[i],c=e.cellHandles[i].current;return(c==null?void 0:c.editorView)==null?e:(_o(c.editorView,o),{...e,cellIds:e.cellIds.transformWithCellId(i,f=>{let p=f.indexOfOrThrow(i)+1;return f.deleteAtIndex(p)}),cellData:{...e.cellData,[i]:{...s,code:o,edited:!!o&&(o==null?void 0:o.trim())!==((d=s.lastCodeRun)==null?void 0:d.trim())}},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]}},cellHandles:{...e.cellHandles}})},clearCellOutput:(e,n)=>{let{cellId:i}=n;return qs({state:e,cellId:i,cellReducer:o=>({...o,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(e,n)=>{let{cellId:i}=n;return qs({state:e,cellId:i,cellReducer:o=>({...o,consoleOutputs:o.consoleOutputs.filter(s=>s.channel==="stdin"&&s.response==null)})})},clearAllCellOutputs:e=>{let n={...e.cellRuntime};for(let i of e.cellIds.inOrderIds)n[i]={...n[i],output:null,consoleOutputs:[]};return{...e,cellRuntime:n}},addSetupCellIfDoesntExist:(e,n)=>{let{code:i}=n;return e.cellIds.setupCellExists()?{...e,scrollKey:yr}:{...e,cellIds:e.cellIds.insertId(yr,e.cellIds.atOrThrow(0).id,0),cellData:{...e.cellData,[yr]:Pr({id:yr,name:yr,code:i,edited:!!i})},cellRuntime:{...e.cellRuntime,[yr]:Mr()},cellHandles:{...e.cellHandles,[yr]:(0,jt.createRef)()},scrollKey:yr}}}));function As(e,n){return!!e.cellData[n].config.hide_code&&!e.untouchedNewCells.has(n)}function qs({state:e,cellId:n,cellReducer:i}){return n in e.cellRuntime?{...e,cellRuntime:{...e.cellRuntime,[n]:i(e.cellRuntime[n])}}:(Se.warn(`Cell ${n} not found in state`),e)}function js({state:e,cellId:n,cellReducer:i}){return n in e.cellData?{...e,cellData:{...e.cellData,[n]:i(e.cellData[n])}}:(Se.warn(`Cell ${n} not found in state`),e)}b_=function(e){let n=e.cellData,i={column:null};return e.cellIds.getColumns().length>1?e.cellIds.getColumns().flatMap((o,s)=>o.inOrderIds.map((c,d)=>{let f={...i};return d===0&&(f.column=s),{...n[c].config,...f}})):e.cellIds.getColumns().flatMap(o=>o.inOrderIds.map(s=>({...n[s].config,...i})))},Uu=ze(e=>e(bt).cellIds),f_=ze(e=>e(Uu).hasOnlyOneId()),C_=ze(e=>pm(e(bt)).length>0),ze(e=>Mm(e(bt)).length>0);let Dv;Y_=ze(e=>xk(e(bt))),rx=ze(e=>wk(e(bt))),ed=ze(e=>{let{cellIds:n,cellRuntime:i,cellData:o}=e(bt);return n.inOrderIds.map(s=>{var f;let c=i[s],{name:d}=o[s];if(Xu((f=c.output)==null?void 0:f.mimetype)){In(Array.isArray(c.output.data),"Expected array data");let p=c.output.data.filter(y=>!y.type.includes("ancestor"));if(p.length>0)return{output:{...c.output,data:p},cellId:s,cellName:d}}return null}).filter(Boolean)}),sx=ze(e=>{let{cellIds:n,cellRuntime:i}=e(bt);return $3(n.inOrderIds.map(o=>i[o].outline))}),W_=ze(e=>e(ed).length),Dv=YR(ze(e=>{let{cellIds:n,cellData:i}=e(bt);return ui.fromEntries(n.inOrderIds.map(o=>{var s;return[o,(s=i[o])==null?void 0:s.name]}))}));var uT=ze(e=>e(bt).scrollKey);Qw=()=>Zn(bt),P_=()=>Zn(Uu),O_=()=>Zn(Dv),Iw=()=>Zn(ed),Dw=()=>Zn(bt).cellLogs,Jw=()=>Zn(uT),rd=()=>lt.get(bt),V_=()=>{let{cellIds:e,cellData:n}=lt.get(bt);return e.inOrderIds.map(i=>{var o;return(o=n[i])==null?void 0:o.name}).filter(Boolean)};var dT=Nx(Dx(bt,e=>e.cellIds.inOrderIds.map(n=>e.cellData[n])));jw=()=>Q2(dT),F_=ze(e=>e(bt).cellRuntime),m_=ze(e=>vk(e(bt))),n_=ze(e=>bk(e(bt))),Lw=ze(e=>e(bt).cellIds.colLength),T_=ze(e=>e(bt).cellIds.idLength>0),K_=ze(e=>e(bt).cellIds.getColumnIds()),id=gd(e=>ze(n=>n(bt).cellData[e]));var vf=gd(e=>ze(n=>n(bt).cellRuntime[e]));const Ov=gd(e=>ze(n=>n(bt).cellHandles[e]));function fT(e){id.remove(e),vf.remove(e),Ov.remove(e)}r_=e=>{let n=(0,yf.c)(2),i;return n[0]===e?i=n[1]:(i=id(e),n[0]=e,n[1]=i),Zn(i)},Kw=e=>{let n=(0,yf.c)(2),i;return n[0]===e?i=n[1]:(i=vf(e),n[0]=e,n[1]=i),Zn(i)},Gw=e=>{let n=(0,yf.c)(2),i;return n[0]===e?i=n[1]:(i=Ov(e),n[0]=e,n[1]=i),Zn(i)},Pm=()=>{let{cellIds:e,cellHandles:n}=lt.get(bt);return e.inOrderIds.map(i=>{var o,s;return(s=(o=n[i])==null?void 0:o.current)==null?void 0:s.editorViewOrNull}).filter(Boolean)},Yu=e=>{var i;let{cellHandles:n}=lt.get(bt);return(i=n[e].current)==null?void 0:i.editorView},L_=function(e){let{cellIds:n,cellData:i,cellRuntime:o}=e;return n.getColumns().flatMap(s=>s.topLevelIds.map(c=>({...i[c],...o[c]})))},g_=function(e){return ze(n=>n(bt).untouchedNewCells.has(e))};function pT(e){let n=vf(e);return ze(i=>{let o=i(n);if(!o||o.status==="queued"||o.status==="running")return;let s=[],c=o.consoleOutputs;if(c&&c.length>0){let f=c.find(p=>p.mimetype==="application/vnd.marimo+traceback");if(f){let p=f.data;s.push(...Ih(p))}}let d=o.output;if((d==null?void 0:d.mimetype)==="application/vnd.marimo+error"){let f=d.data;if(Array.isArray(f))for(let p of f)p.type==="syntax"&&p.lineno!=null&&s.push({kind:"cell",cellId:e,lineNumber:p.lineno}),p.type==="import-star"&&p.lineno!=null&&s.push({kind:"cell",cellId:e,lineNumber:p.lineno})}return s.length>0?s:void 0})}ax=function(){return Rv()}})();export{Ew as $,Tw as $n,Rw as $r,Iu as $t,Dw as A,Nl as An,Il as Ar,Ow as At,Pw as B,Au as Bn,Mw as Br,Mh as Bt,Lw as C,Nw as Cn,qu as Cr,gr as Ct,Iw as D,Aw as Dn,Lh as Dr,qw as Dt,jw as E,Da as En,ju as Er,zw as Et,Pr as F,Nh as Fn,Ih as Fr,Ah as Ft,qh as G,jh as Gn,Fw as Gr,$i as Gt,zh as H,zu as Hn,Bw as Hr,Hw as Ht,Mr as I,Fh as In,Bh as Ir,Hh as It,Vh as J,$h as Jn,Vw as Jr,$w as Jt,Ww as K,Wh as Kn,Cs as Kr,Al as Kt,Uw as L,Uh as Ln,Kh as Lr,Qh as Lt,Kw as M,Gh as Mn,ql as Mr,fi as Mt,Qw as N,bo as Nn,Oa as Nr,Fu as Nt,Gw as O,Bu as On,jl as Or,Jh as Ot,Jw as P,Xh as Pn,Xw as Pr,Hu as Pt,Yh as Q,Zh as Qn,Yw as Qr,Zw as Qt,e_ as R,em as Rn,Pa as Rr,t_ as Rt,n_ as S,zl as Sn,tm as Sr,Fl as St,r_ as T,i_ as Tn,wo as Tr,a_ as Tt,o_ as U,Es as Un,Vu as Ur,s_ as Ut,l_ as V,nm as Vn,rm as Vr,c_ as Vt,im as W,am as Wn,Ts as Wr,u_ as Wt,d_ as X,om as Xn,Bl as Xr,sm as Xt,lm as Y,cm as Yn,Hl as Yr,um as Yt,dm as Z,fm as Zn,$u as Zr,Wu as Zt,f_ as _,FD as __tla,p_ as _n,pm as _r,h_ as _t,Uu as a,yr as ai,Ku as an,Qu as ar,_o as at,m_ as b,Gu as bn,hm as br,mm as bt,g_ as c,gm as ci,y_ as cn,v_ as cr,Lr as ct,b_ as d,ym as di,w_ as dn,__ as dr,vm as dt,bm as ei,x_ as en,Ju as er,Xu as et,Yu as f,wm as fi,k_ as fn,S_ as fr,_m as ft,C_ as g,E_ as gn,Wi as gr,Zu as gt,T_ as h,Vl as hn,Pt as hr,R_ as ht,ed as i,Rs as ii,xm as in,D_ as ir,Xr as it,O_ as j,km as jn,td as jr,nd as jt,P_ as k,M_ as kn,$l as kr,Sm as kt,L_ as l,N_ as li,Wl as ln,I_ as lr,A_ as lt,rd as m,q_ as mn,xo as mr,Cm as mt,id as n,j_ as ni,ad as nn,z_ as nr,Em as nt,F_ as o,od as oi,Tm as on,B_ as or,H_ as ot,V_ as p,sd as pi,Ul as pn,Ui as pr,Rm as pt,ld as q,Dm as qn,Wn as qr,$_ as qt,W_ as r,er as ri,cd as rn,U_ as rr,Om as rt,K_ as s,Q_ as si,G_ as sn,J_ as sr,X_ as st,Y_ as t,Ma as ti,Z_ as tn,ko as tr,ex as tt,Pm as u,tx as ui,nx as un,Kl as ur,ud as ut,rx as v,La as vn,Mm as vr,ix as vt,ax as w,dd as wn,ox as wr,fd as wt,sx as x,Lm as xn,lx as xr,Nm as xt,bt as y,cx as yn,ux as yr,dx as yt,Im as z,So as zn,Ql as zr,Am as zt};
253
+ `)}catch(n){return Se.error("Error parsing HTML content:",n),e}},Kw=function(e){if(!e)return"";try{return ld(nT.ansi_to_html(e))}catch(n){return Se.error("Error converting ANSI to plain text:",n),e}},Ah={startCase:e=>{if(!e)return"";if(typeof e!="string")throw Se.error(e),TypeError(`Expected string, got ${typeof e}`);return/[A-Za-z]/.test(e)?h4(e):e},htmlEscape:e=>e&&e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#039;").replaceAll(`
254
+ `," "),withTrailingSlash(e){return e.endsWith("/")?e:`${e}/`},withoutTrailingSlash(e){return e.endsWith("/")?e.slice(0,-1):e},withoutLeadingSlash(e){return e.startsWith("/")?e.slice(1):e},asString:e=>{if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}};var Cv=!1;function rT(e){var o;let n=[],i=[e.console].filter(Boolean).flat();for(let s of i){let c=s.mimetype==="text/plain",d=s.mimetype==="text/html"||s.mimetype==="application/vnd.marimo+traceback";if(c||d){let f=s.channel==="stderr"||s.channel==="marimo-error";switch(s.channel){case"stdout":case"stderr":case"marimo-error":{let p=Ah.asString(s.data),y=d?ld(p):p;n.push({timestamp:s.timestamp||Date.now(),level:f?"stderr":"stdout",message:y,cellId:e.cell_id});break}default:break}}}if(n.forEach(Ev.log),i.length===0&&Ju((o=e.output)==null?void 0:o.mimetype)&&Array.isArray(e.output.data)){e.output.data.forEach(c=>{Ev.log({level:"stderr",cellId:e.cell_id,timestamp:e.timestamp??0,message:JSON.stringify(c)})});let s=e.output.data.some(c=>c.type==="internal");!Cv&&s&&(Cv=!0,Ll({title:"An internal error occurred",description:"See console for details.",className:"text-xs text-background bg-(--red-10) py-2 pl-3 *:flex *:gap-3"}))}return n}var Ev={log:e=>{let n=e.level==="stdout"?"gray":e.level==="stderr"?"red":"orange",i=e.level.toUpperCase();console.log(`%c[${i}]`,`color:${n}; padding:2px 0; border-radius:2px; font-weight:bold`,`[${am(e.timestamp)}]`,`(${e.cellId}) ${e.message}`)}};am=function(e){try{return X3(e).toLocaleTimeString(void 0,{hour12:!0,hour:"numeric",minute:"numeric",second:"numeric"})}catch{return""}},l_=function(e,n){let i=Xu(n);i?i.focus():Se.warn(`[CellFocusManager] focusCellEditor: element not found: ${n}`)},Mw=function(e){let n=document.getElementById(er.create(e));n?gf(n):Se.warn(`[CellFocusManager] focusCell: element not found: ${e}`)},o_=function(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})},jh=function(){return document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains("marimo-cell")};function gf(e){try{e.focus()}catch{Se.warn("[CellFocusManager] element may not be focusable",e)}}Am=function(e,n){let{retries:i,delay:o,initialDelay:s=0}=n,c=0,d=()=>{if(c<i){try{if(e())return}catch(f){Se.error(`Error executing function on attempt ${c+1}, retrying`,{error:f})}c++,setTimeout(d,o)}};s>0?setTimeout(d,s):d()};function Is({cellId:e,cell:n,isCodeHidden:i,codeFocus:o,variableName:s}){var d;if(!n)return;let c=document.getElementById(er.create(e));if(!c){Se.warn("scrollCellIntoView: element not found");return}if(jh()){gf(c);return}if(i)gf(c);else{let f=(d=n.current)==null?void 0:d.editorView;if(!f){Se.warn("scrollCellIntoView: editor not found",e);return}if(f.hasFocus||!document.hasFocus())return;if(Am(()=>(f.focus(),f.hasFocus),{retries:5,delay:20}),o==="top")f.dispatch({selection:{anchor:0,head:0}});else if(o==="bottom"){let p=f.state.doc.line(f.state.doc.lines);f.dispatch({selection:{anchor:p.from,head:p.from}})}else s&&Hu(f,s)}c.scrollIntoView({behavior:"smooth",block:"nearest"})}Qw=function(e){let n=document.getElementById(er.create(e));if(!n){Se.warn("scrollCellIntoView: element not found");return}n.classList.add("focus-outline"),setTimeout(()=>{n.classList.remove("focus-outline")},2e3),n.scrollIntoView({behavior:"smooth",block:"center"})};function iT(){let e=document.getElementById("App");e==null||e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}function aT(){var e;(e=document.getElementById("App"))==null||e.scrollTo({top:0,behavior:"smooth"})}t_=function(e){let n=Xu(e);if(n!=null&&n.hasFocus){ny(n,{behavior:"instant"});return}let i=document.getElementById(er.create(e));i?i.scrollIntoView({behavior:"instant",block:"nearest"}):Se.warn(`[CellFocusManager] scrollCellIntoView: element not found: ${e}`)},Pr=function({id:e,name:n="_",code:i="",lastCodeRun:o=null,lastExecutionTime:s=null,edited:c=!1,config:d,serializedEditorState:f=null}){return{id:e,config:d||{hide_code:!1,disabled:!1,column:null},name:n,code:i,edited:c,lastCodeRun:o,lastExecutionTime:s,serializedEditorState:f}};function oT(e){return{hide_code:!1,disabled:!1,column:null,...e}}Mr=function(e){return{outline:null,output:null,consoleOutputs:[],status:"idle",staleInputs:!1,interrupted:!1,errored:!1,stopped:!1,runElapsedTimeMs:null,runStartTimestamp:null,lastRunStartTimestamp:null,debuggerActive:!1,...e}};var yf=Jr();function Tv(e){let n={column:0,hide_code:!1,disabled:!1};return{...e,cellData:{[Rs]:Pr({id:Rs,config:n}),...e.cellData},cellRuntime:{[Rs]:Mr(),...e.cellRuntime},cellHandles:{[Rs]:(0,jt.createRef)(),...e.cellHandles}}}function sT(){return Tv({cellIds:Kl.from([]),cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set})}let lT,cT,Rv;({reducer:lT,createActions:cT,useActions:Rv,valueAtom:bt}=Ml(sT,{createNewCell:(e,n)=>{var T;let{cellId:i,before:o,code:s,lastCodeRun:c=null,lastExecutionTime:d=null,autoFocus:f=!0,skipIfCodeExists:p=!1,hideCode:y=!1}=n,w,_;if(p){for(let I of e.cellIds.inOrderIds)if(((T=e.cellData[I])==null?void 0:T.code)===s)return e}if(i==="__end__"){let I=e.cellIds.atOrThrow(0);w=I.id,_=I.length}else if(typeof i=="string"){let I=e.cellIds.findWithId(i);w=I.id,_=I.topLevelIds.indexOf(i)}else if(i.type==="__end__"){let I=e.cellIds.get(i.columnId)||e.cellIds.atOrThrow(0);w=I.id,_=I.length}else throw Error("Invalid cellId");let C=n.newCellId||Ma.create(),E=o?_:_+1;return{...e,cellIds:e.cellIds.insertId(C,w,E),cellData:{...e.cellData,[C]:Pr({id:C,code:s,lastCodeRun:c,config:oT({hide_code:y}),lastExecutionTime:d,edited:!!s&&s!==c})},cellRuntime:{...e.cellRuntime,[C]:Mr()},cellHandles:{...e.cellHandles,[C]:(0,jt.createRef)()},scrollKey:f?C:null,untouchedNewCells:y?new Set([...e.untouchedNewCells,C]):e.untouchedNewCells}},moveCell:(e,n)=>{let{cellId:i,before:o,direction:s}=n;if(o!==void 0&&s!==void 0&&Se.warn("Both before and direction specified for moveCell. Ignoring one."),s){let f=e.cellIds.findWithId(i),p=e.cellIds.indexOf(f),y=s==="left"?p-1:p+1,w=e.cellIds.at(y);return w?{...e,cellIds:e.cellIds.moveAcrossColumns(f.id,i,w.id,void 0),scrollKey:i}:e}let c=e.cellIds.findWithId(i),d=c.indexOfOrThrow(i);return o&&d===0?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,0),scrollKey:i}:!o&&d===c.length-1?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,c.length-1),scrollKey:i}:o?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,d-1),scrollKey:i}:{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,d+1),scrollKey:i}},dropCellOverCell:(e,n)=>{let{cellId:i,overCellId:o}=n,s=e.cellIds.findWithId(i),c=e.cellIds.findWithId(o),d=s.indexOfOrThrow(i),f=c.indexOfOrThrow(o);return s.id===c.id?d===f?e:{...e,cellIds:e.cellIds.moveWithinColumn(s.id,d,f),scrollKey:null}:{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,i,c.id,o),scrollKey:null}},dropCellOverColumn:(e,n)=>{let{cellId:i,columnId:o}=n,s=e.cellIds.findWithId(i);return{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,i,o,void 0)}},dropOverNewColumn:(e,n)=>{let{cellId:i}=n;return{...e,cellIds:e.cellIds.moveToNewColumn(i)}},moveColumn:(e,n)=>n.column===n.overColumn?e:{...e,cellIds:e.cellIds.moveColumn(n.column,n.overColumn)},focusCell:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,where:s}=n,c=i.indexOfOrThrow(o),d;d=s==="before"?xh(c-1,0,i.length-1):s==="after"?xh(c+1,0,i.length-1):c;let f=i.atOrThrow(d);return Is({cellId:f,cell:e.cellHandles[f],isCodeHidden:As(e,f),codeFocus:s==="after"?"top":"bottom",variableName:void 0}),e},focusTopCell:e=>{let n=e.cellIds.getColumns().at(0);if(n===void 0||n.length===0)return e;let i=n.first();return Is({cellId:i,cell:e.cellHandles[i],isCodeHidden:As(e,i),codeFocus:void 0,variableName:void 0}),aT(),e},focusBottomCell:e=>{let n=e.cellIds.getColumns().at(-1);if(n===void 0||n.length===0)return e;let i=n.last();return Is({cellId:i,cell:e.cellHandles[i],isCodeHidden:As(e,i),codeFocus:void 0,variableName:void 0}),iT(),e},sendToTop:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,scroll:s=!0}=n,c=i.indexOfOrThrow(o);return c===0?e:{...e,cellIds:e.cellIds.moveWithinColumn(i.id,c,0),scrollKey:s?o:null}},sendToBottom:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:o,scroll:s=!0}=n,c=i.indexOfOrThrow(o),d=i.length-1;return c===d?e:{...e,cellIds:e.cellIds.moveWithinColumn(i.id,c,d),scrollKey:s?o:null}},addColumn:(e,n)=>{let i=Ma.create();return{...e,cellIds:e.cellIds.addColumn(n.columnId,[i]),cellData:{...e.cellData,[i]:Pr({id:i})},cellRuntime:{...e.cellRuntime,[i]:Mr()},cellHandles:{...e.cellHandles,[i]:(0,jt.createRef)()},scrollKey:i}},addColumnBreakpoint:(e,n)=>{let{cellId:i}=n;return e.cellIds.getColumns()[0].inOrderIds[0]===i?e:{...e,cellIds:e.cellIds.insertBreakpoint(i)}},deleteColumn:(e,n)=>{let{columnId:i}=n;return{...e,cellIds:e.cellIds.delete(i)}},mergeAllColumns:e=>({...e,cellIds:e.cellIds.mergeAllColumns()}),compactColumns:e=>({...e,cellIds:e.cellIds.compact()}),deleteCell:(e,n)=>{var p,y;let i=n.cellId;if(e.cellIds.hasOnlyOneId())return e;let o=e.cellIds.findWithId(i),s=o.indexOfOrThrow(i),c=s===0?1:s-1,d=null;o.length>1&&(d=o.atOrThrow(c));let f=(y=(p=e.cellHandles[i].current)==null?void 0:p.editorView)==null?void 0:y.state.toJSON({history:Z4});return f.doc=e.cellData[i].code,fT(i),{...e,cellIds:e.cellIds.deleteById(i),history:[...e.history,{name:e.cellData[i].name,serializedEditorState:f,column:o.id,index:s,isSetupCell:i===yr}],scrollKey:d}},undoDeleteCell:e=>{if(e.history.length===0)return e;let{name:n,serializedEditorState:i={doc:""},column:o,index:s,isSetupCell:c}=e.history[e.history.length-1],d=c?yr:Ma.create(),f=Pr({id:d,name:n,code:i.doc,edited:i.doc.trim().length>0,serializedEditorState:i});return{...e,cellIds:e.cellIds.insertId(d,o,s),cellData:{...e.cellData,[d]:f},cellRuntime:{...e.cellRuntime,[d]:Mr()},cellHandles:{...e.cellHandles,[d]:(0,jt.createRef)()},history:e.history.slice(0,-1),scrollKey:d}},clearSerializedEditorState:(e,n)=>{let{cellId:i}=n;return js({state:e,cellId:i,cellReducer:o=>({...o,serializedEditorState:null})})},updateCellCode:(e,n)=>{let{cellId:i,code:o,formattingChange:s}=n;return e.cellData[i]?js({state:e,cellId:i,cellReducer:c=>s?{...c,code:o,lastCodeRun:c.edited?c.lastCodeRun:o}:{...c,code:o,edited:o.trim()!==c.lastCodeRun}}):e},updateCellName:(e,n)=>{let{cellId:i,name:o}=n;return js({state:e,cellId:i,cellReducer:s=>({...s,name:o})})},updateCellConfig:(e,n)=>{let{cellId:i,config:o}=n;return js({state:e,cellId:i,cellReducer:s=>({...s,config:{...s.config,...o}})})},prepareForRun:(e,n)=>js({state:qs({state:e,cellId:n.cellId,cellReducer:i=>J3(i)}),cellId:n.cellId,cellReducer:i=>({...i,edited:!1,lastCodeRun:i.code.trim()})}),handleCellMessage:(e,n)=>{let i=n.cell_id,o=qs({state:e,cellId:i,cellReducer:s=>G3(s,n)});return{...o,cellLogs:[...o.cellLogs,...rT(n)]}},setCellIds:(e,n)=>{if(ZR(e.cellIds.inOrderIds,n.cellIds))return e;let i={...e.cellData},o={...e.cellRuntime},s={...e.cellHandles};for(let c of n.cellIds)c in e.cellData||(i[c]=Pr({id:c})),c in e.cellRuntime||(o[c]=Mr()),c in e.cellHandles||(s[c]=(0,jt.createRef)());return{...e,cellIds:Kl.fromWithPreviousShape(n.cellIds,e.cellIds),cellData:i,cellRuntime:o,cellHandles:s}},setCellCodes:(e,n)=>{In(n.codes.length===n.ids.length,"Expected codes and ids to have the same length");let i={...e},o=({cell:s,code:c,cellId:d})=>{if(!s)return Pr({id:d,code:c,lastCodeRun:n.codeIsStale?null:c,edited:n.codeIsStale&&c.trim().length>0});let f=n.codeIsStale?s.lastCodeRun:c,p=f?f.trim()!==c.trim():!!c;if(s.code.trim()===c.trim())return{...s,code:c,edited:p,lastCodeRun:f};if(!Xh()){let y=i.cellHandles[d].current;y!=null&&y.editorViewOrNull&&_o(y.editorViewOrNull,c)}return{...s,code:c,edited:p,lastCodeRun:f}};for(let[s,c]of kx(n.ids,n.codes))s===void 0||c===void 0||(i={...i,cellData:{...i.cellData,[s]:o({cell:i.cellData[s],code:c,cellId:s})}});return i},setStdinResponse:(e,n)=>{let{cellId:i,response:o,outputIndex:s}=n;return qs({state:e,cellId:i,cellReducer:c=>{let d=[...c.consoleOutputs],f=d[s];return f.channel==="stdin"?(d[s]={channel:"stdin",mimetype:f.mimetype,data:f.data,timestamp:f.timestamp,response:o},{...c,interrupted:!1,consoleOutputs:d}):(Se.warn("Expected stdin output"),c)}})},setCells:(e,n)=>{let i=Object.fromEntries(n.map(s=>[s.id,s])),o=Object.fromEntries(n.map(s=>[s.id,Mr()]));return Tv({...e,cellIds:Kl.fromIdsAndColumns(n.map(s=>[s.id,s.config.column])),cellData:i,cellRuntime:o,cellHandles:Object.fromEntries(n.map(s=>[s.id,(0,jt.createRef)()]))})},moveToNextCell:(e,n)=>{let{cellId:i,before:o,noCreate:s=!1}=n;if(i==="__scratch__")return e;let c=e.cellIds.findWithId(i),d=c.indexOfOrThrow(i),f=o?d-1:d+1,p=f===c.length,y=f===-1;if(p&&!s){let w=Ma.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,f),cellData:{...e.cellData,[w]:Pr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Mr()},cellHandles:{...e.cellHandles,[w]:(0,jt.createRef)()},scrollKey:w}}if(y&&!s){let w=Ma.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,0),cellData:{...e.cellData,[w]:Pr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Mr()},cellHandles:{...e.cellHandles,[w]:(0,jt.createRef)()},scrollKey:w}}if((p||y)&&s)return e;if(f>=0&&f<c.length){let w=c.atOrThrow(f);Is({cellId:w,cell:e.cellHandles[w],isCodeHidden:As(e,w),codeFocus:o?"bottom":"top",variableName:void 0})}return e},markTouched:(e,n)=>{let{cellId:i}=n;if(e.untouchedNewCells.has(i)){let o=new Set(e.untouchedNewCells);return o.delete(i),{...e,untouchedNewCells:o}}return e},markUntouched:(e,n)=>{let{cellId:i}=n;if(!e.untouchedNewCells.has(i)){let o=new Set(e.untouchedNewCells);return o.add(i),{...e,untouchedNewCells:o}}return e},scrollToTarget:e=>{let n=e.scrollKey;if(n===null)return e;let i=e.cellIds.findWithId(n),o=i.indexOfOrThrow(n),s=o===i.length-1?i.last():i.atOrThrow(o);return Is({cellId:s,cell:e.cellHandles[s],isCodeHidden:As(e,s),codeFocus:void 0,variableName:void 0}),{...e,scrollKey:null}},foldAll:e=>(Bx(Object.values(e.cellHandles).map(n=>{var i;return(i=n.current)==null?void 0:i.editorView})),e),unfoldAll:e=>(Hx(Object.values(e.cellHandles).map(n=>{var i;return(i=n.current)==null?void 0:i.editorView})),e),clearLogs:e=>({...e,cellLogs:[]}),collapseCell:(e,n)=>{let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o.topLevelIds.map(f=>e.cellRuntime[f].outline),c=wv(o.indexOfOrThrow(i),s);if(!c)return e;let d=o.atOrThrow(c[1]);return{...e,cellIds:e.cellIds.transformWithCellId(i,f=>f.collapse(i,d)),scrollKey:i}},expandCell:(e,n)=>{let{cellId:i}=n;return{...e,cellIds:e.cellIds.transformWithCellId(i,o=>o.expand(i)),scrollKey:i}},collapseAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>{let i=n.topLevelIds.map(p=>e.cellRuntime[p].outline),o=[...n.nodes],s=[],c=[],d=o.length-1;for(;d>=0;){let p=wv(d,i);if(p){let y=d,w=p[1],_=s.find(T=>T.start<=w&&T.end===w);_&&(w=_.start),s.push({start:y,end:w});let C=n.atOrThrow(y),E=n.atOrThrow(w);c.push({id:C,until:E})}else c.push(null);d--}let f=c.reverse();return n.collapseAll(f)})}),expandAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>n.expandAll())}),showCellIfHidden:(e,n)=>{let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o,c=o.findAndExpandDeep(i);return c.equals(s)?e:{...e,cellIds:e.cellIds.transformWithCellId(i,()=>c)}},splitCell:(e,n)=>{var w;let{cellId:i}=n,o=e.cellIds.findWithId(i),s=o.indexOfOrThrow(i),c=e.cellData[i],d=e.cellHandles[i].current;if((d==null?void 0:d.editorView)==null)return e;let{beforeCursorCode:f,afterCursorCode:p}=F3(d.editorView);_o(d.editorView,f);let y=Ma.create();return{...e,cellIds:e.cellIds.insertId(y,o.id,s+1),cellData:{...e.cellData,[i]:{...c,code:f,edited:!!f&&f.trim()!==((w=c.lastCodeRun)==null?void 0:w.trim())},[y]:Pr({id:y,code:p,edited:!!p})},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]},[y]:Mr()},cellHandles:{...e.cellHandles,[y]:(0,jt.createRef)()},scrollKey:y}},undoSplitCell:(e,n)=>{var d;let{cellId:i,snapshot:o}=n,s=e.cellData[i],c=e.cellHandles[i].current;return(c==null?void 0:c.editorView)==null?e:(_o(c.editorView,o),{...e,cellIds:e.cellIds.transformWithCellId(i,f=>{let p=f.indexOfOrThrow(i)+1;return f.deleteAtIndex(p)}),cellData:{...e.cellData,[i]:{...s,code:o,edited:!!o&&(o==null?void 0:o.trim())!==((d=s.lastCodeRun)==null?void 0:d.trim())}},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]}},cellHandles:{...e.cellHandles}})},clearCellOutput:(e,n)=>{let{cellId:i}=n;return qs({state:e,cellId:i,cellReducer:o=>({...o,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(e,n)=>{let{cellId:i}=n;return qs({state:e,cellId:i,cellReducer:o=>({...o,consoleOutputs:o.consoleOutputs.filter(s=>s.channel==="stdin"&&s.response==null)})})},clearAllCellOutputs:e=>{let n={...e.cellRuntime};for(let i of e.cellIds.inOrderIds)n[i]={...n[i],output:null,consoleOutputs:[]};return{...e,cellRuntime:n}},addSetupCellIfDoesntExist:(e,n)=>{let{code:i}=n;return e.cellIds.setupCellExists()?{...e,scrollKey:yr}:{...e,cellIds:e.cellIds.insertId(yr,e.cellIds.atOrThrow(0).id,0),cellData:{...e.cellData,[yr]:Pr({id:yr,name:yr,code:i,edited:!!i})},cellRuntime:{...e.cellRuntime,[yr]:Mr()},cellHandles:{...e.cellHandles,[yr]:(0,jt.createRef)()},scrollKey:yr}}}));function As(e,n){return!!e.cellData[n].config.hide_code&&!e.untouchedNewCells.has(n)}function qs({state:e,cellId:n,cellReducer:i}){return n in e.cellRuntime?{...e,cellRuntime:{...e.cellRuntime,[n]:i(e.cellRuntime[n])}}:(Se.warn(`Cell ${n} not found in state`),e)}function js({state:e,cellId:n,cellReducer:i}){return n in e.cellData?{...e,cellData:{...e.cellData,[n]:i(e.cellData[n])}}:(Se.warn(`Cell ${n} not found in state`),e)}b_=function(e){let n=e.cellData,i={column:null};return e.cellIds.getColumns().length>1?e.cellIds.getColumns().flatMap((o,s)=>o.inOrderIds.map((c,d)=>{let f={...i};return d===0&&(f.column=s),{...n[c].config,...f}})):e.cellIds.getColumns().flatMap(o=>o.inOrderIds.map(s=>({...n[s].config,...i})))},Wu=ze(e=>e(bt).cellIds),f_=ze(e=>e(Wu).hasOnlyOneId()),S_=ze(e=>hm(e(bt)).length>0),ze(e=>Lm(e(bt)).length>0);let Dv;Y_=ze(e=>xk(e(bt))),nx=ze(e=>wk(e(bt))),Zu=ze(e=>{let{cellIds:n,cellRuntime:i,cellData:o}=e(bt);return n.inOrderIds.map(s=>{var f;let c=i[s],{name:d}=o[s];if(Ju((f=c.output)==null?void 0:f.mimetype)){In(Array.isArray(c.output.data),"Expected array data");let p=c.output.data.filter(y=>!y.type.includes("ancestor"));if(p.length>0)return{output:{...c.output,data:p},cellId:s,cellName:d}}return null}).filter(Boolean)}),ox=ze(e=>{let{cellIds:n,cellRuntime:i}=e(bt);return $3(n.inOrderIds.map(o=>i[o].outline))}),U_=ze(e=>e(Zu).length),Dv=YR(ze(e=>{let{cellIds:n,cellData:i}=e(bt);return ui.fromEntries(n.inOrderIds.map(o=>{var s;return[o,(s=i[o])==null?void 0:s.name]}))}));var uT=ze(e=>e(bt).scrollKey);Jw=()=>Zn(bt),P_=()=>Zn(Wu),D_=()=>Zn(Dv),Aw=()=>Zn(Zu),Ow=()=>Zn(bt).cellLogs,Yw=()=>Zn(uT),nd=()=>lt.get(bt),W_=()=>{let{cellIds:e,cellData:n}=lt.get(bt);return e.inOrderIds.map(i=>{var o;return(o=n[i])==null?void 0:o.name}).filter(Boolean)};var dT=Nx(Dx(bt,e=>e.cellIds.inOrderIds.map(n=>e.cellData[n])));zw=()=>Q2(dT),H_=ze(e=>e(bt).cellRuntime),m_=ze(e=>vk(e(bt))),n_=ze(e=>bk(e(bt))),Nw=ze(e=>e(bt).cellIds.colLength),E_=ze(e=>e(bt).cellIds.idLength>0),Q_=ze(e=>e(bt).cellIds.getColumnIds()),rd=gd(e=>ze(n=>n(bt).cellData[e]));var vf=gd(e=>ze(n=>n(bt).cellRuntime[e]));const Ov=gd(e=>ze(n=>n(bt).cellHandles[e]));function fT(e){rd.remove(e),vf.remove(e),Ov.remove(e)}r_=e=>{let n=(0,yf.c)(2),i;return n[0]===e?i=n[1]:(i=rd(e),n[0]=e,n[1]=i),Zn(i)},Gw=e=>{let n=(0,yf.c)(2),i;return n[0]===e?i=n[1]:(i=vf(e),n[0]=e,n[1]=i),Zn(i)},Xw=e=>{let n=(0,yf.c)(2),i;return n[0]===e?i=n[1]:(i=Ov(e),n[0]=e,n[1]=i),Zn(i)},Mm=()=>{let{cellIds:e,cellHandles:n}=lt.get(bt);return e.inOrderIds.map(i=>{var o,s;return(s=(o=n[i])==null?void 0:o.current)==null?void 0:s.editorViewOrNull}).filter(Boolean)},Xu=e=>{var i;let{cellHandles:n}=lt.get(bt);return(i=n[e].current)==null?void 0:i.editorView},L_=function(e){let{cellIds:n,cellData:i,cellRuntime:o}=e;return n.getColumns().flatMap(s=>s.topLevelIds.map(c=>({...i[c],...o[c]})))},g_=function(e){return ze(n=>n(bt).untouchedNewCells.has(e))};function pT(e){let n=vf(e);return ze(i=>{let o=i(n);if(!o||o.status==="queued"||o.status==="running")return;let s=[],c=o.consoleOutputs;if(c&&c.length>0){let f=c.find(p=>p.mimetype==="application/vnd.marimo+traceback");if(f){let p=f.data;s.push(...Ih(p))}}let d=o.output;if((d==null?void 0:d.mimetype)==="application/vnd.marimo+error"){let f=d.data;if(Array.isArray(f))for(let p of f)p.type==="syntax"&&p.lineno!=null&&s.push({kind:"cell",cellId:e,lineNumber:p.lineno}),p.type==="import-star"&&p.lineno!=null&&s.push({kind:"cell",cellId:e,lineNumber:p.lineno})}return s.length>0?s:void 0})}ix=function(){return Rv()}})();export{Ew as $,Tw as $n,Rw as $r,Dw as $t,Ow as A,Nl as An,Il as Ar,Pw as At,Mw as B,Nu as Bn,Lw as Br,Mh as Bt,Nw as C,Iw as Cn,Iu as Cr,gr as Ct,Aw as D,qw as Dn,Lh as Dr,jw as Dt,zw as E,Da as En,Au as Er,Fw as Et,Pr as F,Nh as Fn,Ih as Fr,qu as Ft,Ah as G,qh as Gn,Bw as Gr,Hw as Gt,jh as H,ju as Hn,Vw as Hr,$w as Ht,Mr as I,zh as In,Fh as Ir,Bh as It,Hh as J,Vh as Jn,Ww as Jr,Uw as Jt,Kw as K,$h as Kn,Cs as Kr,$i as Kt,Qw as L,Wh as Ln,Uh as Lr,Kh as Lt,Gw as M,Qh as Mn,Al as Mr,zu as Mt,Jw as N,bo as Nn,Oa as Nr,fi as Nt,Xw as O,Fu as On,ql as Or,Gh as Ot,Yw as P,Jh as Pn,Zw as Pr,Bu as Pt,Xh as Q,Yh as Qn,e_ as Qr,Hu as Qt,t_ as R,Zh as Rn,Pa as Rr,em as Rt,n_ as S,jl as Sn,tm as Sr,zl as St,r_ as T,i_ as Tn,wo as Tr,a_ as Tt,o_ as U,Es as Un,Vu as Ur,s_ as Ut,l_ as V,nm as Vn,rm as Vr,im as Vt,am as W,om as Wn,Ts as Wr,c_ as Wt,u_ as X,sm as Xn,Fl as Xr,lm as Xt,cm as Y,um as Yn,Bl as Yr,d_ as Yt,dm as Z,fm as Zn,$u as Zr,pm as Zt,f_ as _,FD as __tla,p_ as _n,hm as _r,h_ as _t,Wu as a,yr as ai,mm as an,Uu as ar,_o as at,m_ as b,Ku as bn,gm as br,ym as bt,g_ as c,vm as ci,y_ as cn,v_ as cr,Lr as ct,b_ as d,bm as di,w_ as dn,__ as dr,wm as dt,_m as ei,Qu as en,Gu as er,Ju as et,Xu as f,xm as fi,x_ as fn,k_ as fr,km as ft,S_ as g,C_ as gn,Wi as gr,Yu as gt,E_ as h,Hl as hn,Pt as hr,T_ as ht,Zu as i,Rs as ii,ed as in,R_ as ir,Xr as it,D_ as j,Sm as jn,td as jr,O_ as jt,P_ as k,M_ as kn,Vl as kr,Cm as kt,L_ as l,N_ as li,I_ as ln,A_ as lr,q_ as lt,nd as m,j_ as mn,xo as mr,Em as mt,rd as n,z_ as ni,F_ as nn,B_ as nr,Tm as nt,H_ as o,id as oi,ad as on,V_ as or,$_ as ot,W_ as p,od as pi,sd as pn,Ui as pr,Rm as pt,ld as q,Dm as qn,Wn as qr,$l as qt,U_ as r,er as ri,cd as rn,K_ as rr,Om as rt,Q_ as s,G_ as si,Pm as sn,J_ as sr,X_ as st,Y_ as t,Ma as ti,Z_ as tn,ko as tr,ex as tt,Mm as u,tx as ui,Wl as un,Ul as ur,ud as ut,nx as v,La as vn,Lm as vr,rx as vt,ix as w,dd as wn,ax as wr,fd as wt,ox as x,Nm as xn,sx as xr,Im as xt,bt as y,lx as yn,cx as yr,ux as yt,Am as z,So as zn,Kl as zr,dx as zt};