@marimo-team/frontend 0.23.16-dev9 → 0.23.17-dev0
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.
- package/dist/assets/{CellStatus-BwCqFeIT.js → CellStatus-BYH-DZdr.js} +1 -1
- package/dist/assets/{ConnectedDataExplorerComponent-CMaZapRd.js → ConnectedDataExplorerComponent-C4zEgCZh.js} +1 -1
- package/dist/assets/JsonOutput-D2UI9WX5.js +53 -0
- package/dist/assets/LazyAnyLanguageCodeMirror-A-Ant1Ad.js +2 -0
- package/dist/assets/{MarimoErrorOutput-2CXbNUBb.js → MarimoErrorOutput-Cu5WMawt.js} +4 -4
- package/dist/assets/RenderHTML-C1rWkDWe.js +1 -0
- package/dist/assets/{RunButton-DLoWn_Jd.js → RunButton-BO02PdVH.js} +1 -1
- package/dist/assets/__vite-browser-external-mTzvI0UM.js +1 -0
- package/dist/assets/{add-cell-with-ai-C1L7x0xr.js → add-cell-with-ai-PVABTCGt.js} +35 -35
- package/dist/assets/add-connection-dialog-GskQAyZw.js +178 -0
- package/dist/assets/{agent-panel-D3_CUvz_.js → agent-panel-BitNk-Gl.js} +5 -5
- package/dist/assets/ai-model-dropdown-DzobPTdx.js +5 -0
- package/dist/assets/{any-language-editor--tRHs8C_.js → any-language-editor-BIeaxtdD.js} +1 -1
- package/dist/assets/apl-BnIcQcjL.js +1 -0
- package/dist/assets/app-config-button-D_JaIWhO.js +1 -0
- package/dist/assets/{arc-CfUZAQDm.js → arc-DPwkj0YX.js} +1 -1
- package/dist/assets/{architecture-7HQA4BMR-Bvqj37EA.js → architecture-7HQA4BMR-CzgzqOCD.js} +1 -1
- package/dist/assets/{architectureDiagram-VXUJARFQ-sx_yisiZ.js → architectureDiagram-VXUJARFQ-BMZxefa_.js} +1 -1
- package/dist/assets/arrow-left-pVgT2h-8.js +1 -0
- package/dist/assets/asciiarmor-VNkYxCrW.js +1 -0
- package/dist/assets/asn1-DHaiamxN.js +1 -0
- package/dist/assets/blob-BNTWOaI9.js +1 -0
- package/dist/assets/{blockDiagram-VD42YOAC-KexI-fgH.js → blockDiagram-VD42YOAC-O9sd6I0b.js} +1 -1
- package/dist/assets/brainfuck-B7OQ4qXM.js +1 -0
- package/dist/assets/{c4Diagram-YG6GDRKO-d8NrlxRF.js → c4Diagram-YG6GDRKO-CJ4NJdbh.js} +1 -1
- package/dist/assets/{cache-panel-DcQUeUpg.js → cache-panel-B2B1ePao.js} +1 -1
- package/dist/assets/cell-editor-BuU4BDSk.js +27 -0
- package/dist/assets/cell-link-CWQ4BYr-.js +1 -0
- package/dist/assets/cells-CJLUCcQg.js +235 -0
- package/dist/assets/channel-DELDOomM.js +1 -0
- package/dist/assets/{chat-display-DomMe89U.js → chat-display-CfiA-GdA.js} +1 -1
- package/dist/assets/{chat-panel-DzLbxcWT.js → chat-panel-DghO5Y6C.js} +3 -3
- package/dist/assets/{chat-ui-BpWZ6JeY.js → chat-ui-CNXmMUI1.js} +1 -1
- package/dist/assets/{chunk-4BX2VUAB-fhh1HlXH.js → chunk-4BX2VUAB-BCgdxLTg.js} +1 -1
- package/dist/assets/chunk-55IACEB6-DnPXlz-P.js +1 -0
- package/dist/assets/{chunk-5FQGJX7Z-Cp0LZT-a.js → chunk-5FQGJX7Z-CYQpNADu.js} +2 -2
- package/dist/assets/{chunk-ABZYJK2D-BtK4zInQ.js → chunk-ABZYJK2D-M8yn2N69.js} +3 -3
- package/dist/assets/{chunk-ATLVNIR6-YZDenslF.js → chunk-ATLVNIR6-CY4Q_7DV.js} +1 -1
- package/dist/assets/{chunk-B4BG7PRW-DYIZwDbt.js → chunk-B4BG7PRW-0izjR6gH.js} +1 -1
- package/dist/assets/{chunk-CVBHYZKI-CIyHeK0Q.js → chunk-CVBHYZKI-Dtb0_R-R.js} +1 -1
- package/dist/assets/{chunk-DI55MBZ5-TodwBGEN.js → chunk-DI55MBZ5-CeYy94Hv.js} +1 -1
- package/dist/assets/{chunk-EXTU4WIE-C76bF1UD.js → chunk-EXTU4WIE-CZBftw0u.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-Yq65IDPA.js → chunk-FMBD7UC4-BTonlpoo.js} +1 -1
- package/dist/assets/{chunk-HN2XXSSU-CcbN4n6W.js → chunk-HN2XXSSU-Bqib0VeJ.js} +1 -1
- package/dist/assets/{chunk-JA3XYJ7Z-CPXEu7AX.js → chunk-JA3XYJ7Z-CMnBpyzd.js} +1 -1
- package/dist/assets/{chunk-JZLCHNYA-D8q1z6Py.js → chunk-JZLCHNYA-BWjnV_v7.js} +1 -1
- package/dist/assets/{chunk-MI3HLSF2-bmomnexd.js → chunk-MI3HLSF2-CA3zpyGZ.js} +1 -1
- package/dist/assets/{chunk-N4CR4FBY-BhsjB2qn.js → chunk-N4CR4FBY-CZmndviH.js} +2 -2
- package/dist/assets/{chunk-QN33PNHL-ngvPqyQ0.js → chunk-QN33PNHL-B5rSVblq.js} +1 -1
- package/dist/assets/{chunk-QXUST7PY-C4c0Sjmn.js → chunk-QXUST7PY-Cz8b__fX.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-CkbwBDOS.js → chunk-QZHKN3VN-B7nq9C0W.js} +1 -1
- package/dist/assets/{chunk-S3R3BYOJ-Bt2NnquF.js → chunk-S3R3BYOJ-CUGnLh1o.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-Dysko1OC.js → chunk-TZMSLE5B-CXQovw1I.js} +1 -1
- package/dist/assets/classDiagram-2ON5EDUG-B3IKXY7k.js +1 -0
- package/dist/assets/classDiagram-v2-WZHVMYZB-C0Db1CRa.js +1 -0
- package/dist/assets/{clike-DKPr2D1_.js → clike-CcPLlJ3-.js} +1 -1
- package/dist/assets/clojure-DK3HqqeG.js +1 -0
- package/dist/assets/cmake-Bnhxe81D.js +1 -0
- package/dist/assets/cobol-ISPch7J4.js +1 -0
- package/dist/assets/{code-block-37QAKDTI-DlENujeV.js → code-block-37QAKDTI-21cPxSHu.js} +1 -1
- package/dist/assets/coffeescript-B3cS2ooz.js +1 -0
- package/dist/assets/{column-preview-D5Btj8aG.js → column-preview-DREOGG_c.js} +1 -1
- package/dist/assets/{command-palette-CNp7T2c5.js → command-palette-C95r8rOd.js} +1 -1
- package/dist/assets/{common-BrPgvCtD.js → common-DCWeeUhr.js} +1 -1
- package/dist/assets/commonlisp-DH0yllOU.js +1 -0
- package/dist/assets/components-BGqqoLEG.js +1 -0
- package/dist/assets/components-K_Mi0vdC.js +1 -0
- package/dist/assets/config-B-Q7J_6d.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-BlMw4-M9.js → cose-bilkent-S5V4N54A-DK9gIUQX.js} +1 -1
- package/dist/assets/crystal-CfSxbewa.js +1 -0
- package/dist/assets/{css-DsUcFZz8.js → css-IVPzYP6l.js} +1 -1
- package/dist/assets/cypher-DqUctVOg.js +1 -0
- package/dist/assets/d-DYRkEHFy.js +1 -0
- package/dist/assets/{dagre-6UL2VRFP-kJ4x17JK.js → dagre-6UL2VRFP-DQFoIrK8.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-DbobQcVo.js → data-grid-overlay-editor-CVM5ufb4.js} +1 -1
- package/dist/assets/{datasource-wn1PTlXA.js → datasource-DbljozeY.js} +2 -2
- package/dist/assets/{dependency-graph-panel-B8Q8RQNh.js → dependency-graph-panel-Bg9bLMXq.js} +4 -4
- package/dist/assets/{diagram-PSM6KHXK-d-5aQNHk.js → diagram-PSM6KHXK-DIXxW5au.js} +1 -1
- package/dist/assets/{diagram-QEK2KX5R-CO-PXq75.js → diagram-QEK2KX5R-B8KoKZCY.js} +1 -1
- package/dist/assets/{diagram-S2PKOQOG-Dv7pcvYC.js → diagram-S2PKOQOG-D0bjlYXx.js} +1 -1
- package/dist/assets/diff-Cd5HBT58.js +1 -0
- package/dist/assets/dist-B99-E4qp.js +1 -0
- package/dist/assets/{dist-BsphJPAV.js → dist-BiwuSVkx.js} +1 -1
- package/dist/assets/{dist-CECF_J8y.js → dist-BrZjJXDA.js} +1 -1
- package/dist/assets/{dist-Du-wcJyR.js → dist-By4rFZwg.js} +1 -1
- package/dist/assets/dist-CaZf6AoY.js +1 -0
- package/dist/assets/{dist-BMOD2Pyh.js → dist-Cgoy5550.js} +1 -1
- package/dist/assets/{dist-6c4zOh78.js → dist-D6WgndTj.js} +1 -1
- package/dist/assets/dist-DcXy-1eJ.js +1 -0
- package/dist/assets/{dist-0QUuSoRx.js → dist-DtbtRAqz.js} +1 -1
- package/dist/assets/dist-I3qeQWuP.js +1 -0
- package/dist/assets/{dist-sPfKr-vH.js → dist-aeKlrIMv.js} +1 -1
- package/dist/assets/{dist-CDUl-YL4.js → dist-gDi2I7IJ.js} +1 -1
- package/dist/assets/{dist-CRrIf3gB.js → dist-miDa4-cz.js} +1 -1
- package/dist/assets/{dist-R1kU4nzJ.js → dist-nDEBxpL6.js} +1 -1
- package/dist/assets/{dist-DQNaXfK1.js → dist-oUL4XFdB.js} +1 -1
- package/dist/assets/{dockerfile-C2PznFWk.js → dockerfile-CLtE40Sb.js} +1 -1
- package/dist/assets/{documentation-panel-hFyikugH.js → documentation-panel-BhtY-lKF.js} +1 -1
- package/dist/assets/download-DwYUg-o4.js +9 -0
- package/dist/assets/dtd-C24SyIVW.js +1 -0
- package/dist/assets/dylan-CrkzDmc1.js +1 -0
- package/dist/assets/ecl-DSuYw2WY.js +1 -0
- package/dist/assets/{edit-page-jUsez4HZ.js → edit-page-D_hRRfNq.js} +6 -6
- package/dist/assets/eiffel-D60uMU52.js +1 -0
- package/dist/assets/elm-pYZdVh3P.js +1 -0
- package/dist/assets/{erDiagram-Q2GNP2WA-BQ8HfnRu.js → erDiagram-Q2GNP2WA-D7EuT99Y.js} +1 -1
- package/dist/assets/erlang-D9MlcoAb.js +1 -0
- package/dist/assets/error-entries-4LYRQSOP.js +8 -0
- package/dist/assets/{error-panel-DAseRhAS.js → error-panel-FG7tsVQ_.js} +1 -1
- package/dist/assets/{esm-Cmv0Nuxi.js → esm-BDGraAqp.js} +1 -1
- package/dist/assets/factor-gTHEdNEJ.js +1 -0
- package/dist/assets/{factor-DMrXrOH8.js → factor-xSp9WnN7.js} +1 -1
- package/dist/assets/file-explorer-panel-CpUlOt1N.js +26 -0
- package/dist/assets/{file-icons-Chripuk-.js → file-icons-CODNoWOy.js} +1 -1
- package/dist/assets/{file-name-input-B1NJd3KY.js → file-name-input-DyvZhLvk.js} +1 -1
- package/dist/assets/{fileToBase64-C2Yy-YXq.js → fileToBase64-hLJmVjNJ.js} +1 -1
- package/dist/assets/floating-outline-DBlzcHYf.js +1 -0
- package/dist/assets/{flowDiagram-NV44I4VS-xBOzhlfg.js → flowDiagram-NV44I4VS-Bz3PhSZq.js} +1 -1
- package/dist/assets/focus-B6HBbAwF.js +1 -0
- package/dist/assets/form-BYlqbYKI.js +2 -0
- package/dist/assets/form-W6ZZMHnc.js +1 -0
- package/dist/assets/forth-CWZXTLFs.js +1 -0
- package/dist/assets/fortran-B8kNpt8O.js +1 -0
- package/dist/assets/{gallery-page-CJ3ms1Hn.js → gallery-page-DbuxknAw.js} +1 -1
- package/dist/assets/{ganttDiagram-JELNMOA3-D2O_k-Zg.js → ganttDiagram-JELNMOA3-DaS60lKW.js} +1 -1
- package/dist/assets/gas-DxuMSeqj.js +1 -0
- package/dist/assets/gherkin-ZkKEDs6K.js +1 -0
- package/dist/assets/{gitGraph-G5XIXVHT-8HJwNcdU.js → gitGraph-G5XIXVHT-Cd5ecvAE.js} +1 -1
- package/dist/assets/{gitGraphDiagram-V2S2FVAM-Nk4Ll9GY.js → gitGraphDiagram-V2S2FVAM-D7jUmjBw.js} +1 -1
- package/dist/assets/{glide-data-editor-j2igs9Y_.js → glide-data-editor-CejKKgnN.js} +4 -4
- package/dist/assets/globe-Dwo3iXzC.js +1 -0
- package/dist/assets/groovy-CqQZm41C.js +1 -0
- package/dist/assets/haskell-DWF-arrK.js +1 -0
- package/dist/assets/haxe-LmdIWMMr.js +1 -0
- package/dist/assets/home-page-DYaHMq8Q.js +4 -0
- package/dist/assets/{html-to-image-B-nAUvDC.js → html-to-image-CN9yTa5s.js} +2 -2
- package/dist/assets/idl-DEd51qv-.js +1 -0
- package/dist/assets/index-8Nlyq3mV.css +2 -0
- package/dist/assets/index-Gv23EHlE.js +38 -0
- package/dist/assets/{info-VBDWY6EO-rfe3WPvd.js → info-VBDWY6EO-BTT52JaO.js} +1 -1
- package/dist/assets/infoDiagram-HS3SLOUP-GkG80Qxa.js +2 -0
- package/dist/assets/javascript-BFIOGZ-j.js +1 -0
- package/dist/assets/{journeyDiagram-XKPGCS4Q-D61FGivn.js → journeyDiagram-XKPGCS4Q-DwL-PxSb.js} +1 -1
- package/dist/assets/julia-Chs3F4Sv.js +1 -0
- package/dist/assets/{kanban-definition-3W4ZIXB7-Bnv0X0Tu.js → kanban-definition-3W4ZIXB7-DiBaV6eK.js} +1 -1
- package/dist/assets/katex-12J11HuB.js +1 -0
- package/dist/assets/kiosk-mode-Di-gTPu2.js +1 -0
- package/dist/assets/{layout-1Z2AhO6k.js → layout-B6D_84rz.js} +5 -5
- package/dist/assets/{line-DNm2phYo.js → line-BDmwHhfs.js} +1 -1
- package/dist/assets/{linear-CTQqNbVX.js → linear-BPv4krGt.js} +1 -1
- package/dist/assets/livescript-CZOCkk31.js +1 -0
- package/dist/assets/logs-panel-V4PsZD48.js +1 -0
- package/dist/assets/{loro_wasm_bg-Duqr-kJ2.js → loro_wasm_bg-CjrUicyy.js} +1 -1
- package/dist/assets/lua-DK4FKJLN.js +1 -0
- package/dist/assets/{markdown-renderer-Cs1sISb9.js → markdown-renderer-CzJx-MnJ.js} +3 -3
- package/dist/assets/mathematica-BoEJU8On.js +1 -0
- package/dist/assets/mbox-1WJcoGln.js +1 -0
- package/dist/assets/{mermaid-4DMBBIKO-CDGmT6YQ.js → mermaid-4DMBBIKO-3ntkrgCA.js} +1 -1
- package/dist/assets/{mermaid-CYN0wOyG.js → mermaid-B8gNHyGy.js} +3 -3
- package/dist/assets/{mermaid-parser.core-Dz2GMGqQ.js → mermaid-parser.core-Ddjs6Jmy.js} +2 -2
- package/dist/assets/{mhchem-CIWniJp4.js → mhchem-Cnt1CrAX.js} +1 -1
- package/dist/assets/{mindmap-definition-VGOIOE7T-C-YaKmEU.js → mindmap-definition-VGOIOE7T-DKJd1wuU.js} +1 -1
- package/dist/assets/mirc-OXxqihhx.js +1 -0
- package/dist/assets/mllike-fFPa49Ft.js +1 -0
- package/dist/assets/modelica-B2hOO40U.js +1 -0
- package/dist/assets/mscgen-BUm8DSPh.js +1 -0
- package/dist/assets/mumps-BUUE1QKi.js +1 -0
- package/dist/assets/{name-cell-input-2sM8a_OS.js → name-cell-input-Bq1sljc2.js} +1 -1
- package/dist/assets/node-sql-parser-CAudyJSw.js +68 -0
- package/dist/assets/nsis-CQPY661e.js +1 -0
- package/dist/assets/{nsis-Ccvd1gbp.js → nsis-SCfsPq8M.js} +1 -1
- package/dist/assets/ntriples-CtWbsB7O.js +1 -0
- package/dist/assets/{number-overlay-editor-BQ9P6yP7.js → number-overlay-editor-KHf1PkHr.js} +1 -1
- package/dist/assets/octave-D4HWE405.js +1 -0
- package/dist/assets/{ordinal-DyTNGK17.js → ordinal-BSXHDD5k.js} +1 -1
- package/dist/assets/{outline-panel-BXWCkGu_.js → outline-panel-Tn3DVuNl.js} +1 -1
- package/dist/assets/oz-Cp-6fXH5.js +1 -0
- package/dist/assets/{packages-panel-CJfHGfax.js → packages-panel-er2ghj4m.js} +1 -1
- package/dist/assets/{packet-DYOGHKS2-DTVloLa7.js → packet-DYOGHKS2-pYSTMj1G.js} +1 -1
- package/dist/assets/pair-with-agent-modal-CVYH-Guh.js +4 -0
- package/dist/assets/panel-accordion-state-DN1hLusu.js +1 -0
- package/dist/assets/panels-oc6cK0j0.js +4 -0
- package/dist/assets/pascal-B2F20-Dq.js +1 -0
- package/dist/assets/perl-C8I4my72.js +1 -0
- package/dist/assets/{pie-VRWISCQL-Bmght6JF.js → pie-VRWISCQL-BtGe15Zk.js} +1 -1
- package/dist/assets/{pieDiagram-ADFJNKIX-DlFYL0BN.js → pieDiagram-ADFJNKIX-BdWIv6Xr.js} +1 -1
- package/dist/assets/pig-Dg7z9udE.js +1 -0
- package/dist/assets/powershell-BjupwEXi.js +1 -0
- package/dist/assets/process-output-DXnqTuGm.js +1 -0
- package/dist/assets/properties-CWyPUxmr.js +1 -0
- package/dist/assets/protobuf-B2dHC-BL.js +1 -0
- package/dist/assets/pug-B-MnYZUt.js +1 -0
- package/dist/assets/{pug-BtXi5KiX.js → pug-D81S7inS.js} +1 -1
- package/dist/assets/puppet-CeBQQ4Li.js +1 -0
- package/dist/assets/python-DgHNYu_r.js +1 -0
- package/dist/assets/q-wSguJrTU.js +1 -0
- package/dist/assets/{quadrantDiagram-AYHSOK5B-BpJug2BH.js → quadrantDiagram-AYHSOK5B-DJuGB95-.js} +1 -1
- package/dist/assets/r-BoIJ2Zve.js +1 -0
- package/dist/assets/{radar-ZZBFDIW7-CYwWzRgW.js → radar-ZZBFDIW7-DyFu57RV.js} +1 -1
- package/dist/assets/{radio-group-PT0_zVHo.js → radio-group-CcU5wNVj.js} +1 -1
- package/dist/assets/{react-vega-TNCk_eWj.js → react-vega-BLc5RhC7.js} +1 -1
- package/dist/assets/{readonly-code-display-CFbCSGms.js → readonly-code-display-DoQFa0ET.js} +1 -1
- package/dist/assets/{readonly-python-code-DB23yd7T.js → readonly-python-code-CYfbPYQ0.js} +1 -1
- package/dist/assets/{requirementDiagram-UZGBJVZJ-Bd-1eny8.js → requirementDiagram-UZGBJVZJ-aWGJtWy2.js} +1 -1
- package/dist/assets/{reveal-component-fwTDxf5N.js → reveal-component-CZgRCMe1.js} +42 -42
- package/dist/assets/rpm-DmyUNIkv.js +1 -0
- package/dist/assets/{ecl-B6UC4tME.js → ruby-Djlw6kjU.js} +1 -1
- package/dist/assets/run-page-Dxm4ltqq.js +1 -0
- package/dist/assets/{sankeyDiagram-TZEHDZUN-CDWAE6GV.js → sankeyDiagram-TZEHDZUN-nJIZ3_NQ.js} +1 -1
- package/dist/assets/sas-B8AwxLVS.js +1 -0
- package/dist/assets/scheme-o4lPnt7c.js +1 -0
- package/dist/assets/{scratchpad-panel-BLC2oQ_3.js → scratchpad-panel-pQP0zGxD.js} +1 -1
- package/dist/assets/{secrets-panel-6J6wcuVR.js → secrets-panel-Cz17_MLf.js} +1 -1
- package/dist/assets/{sequenceDiagram-WL72ISMW-B6hjDGBF.js → sequenceDiagram-WL72ISMW-Bvkxl3m4.js} +1 -1
- package/dist/assets/session-panel-C-y42nqB.js +1 -0
- package/dist/assets/shell-DJuOhLmg.js +1 -0
- package/dist/assets/sieve-BBDbJOX3.js +1 -0
- package/dist/assets/{skeleton-xuR254Kw.js → skeleton-Bd78PcP9.js} +1 -1
- package/dist/assets/slides-DkEgzTJB.css +1 -0
- package/dist/assets/smalltalk-CmTnbqu4.js +1 -0
- package/dist/assets/{snippets-panel-DwAjNUqR.js → snippets-panel-BRtH_9R3.js} +1 -1
- package/dist/assets/sparql-BQuPdHqO.js +1 -0
- package/dist/assets/{src-CIOdyciO.js → src-xYaLe_3f.js} +1 -1
- package/dist/assets/state-C4kiwedg.js +1 -0
- package/dist/assets/state-CsGOoEZv.js +3 -0
- package/dist/assets/{state-Tc7pRohh.js → state-Rxc-B11B.js} +1 -1
- package/dist/assets/{stateDiagram-FKZM4ZOC-Bzv6j99z.js → stateDiagram-FKZM4ZOC-CVF8M4di.js} +1 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-Dj-G9wuu.js +1 -0
- package/dist/assets/{step-CDlhJj9-.js → step-DkIPWA0m.js} +1 -1
- package/dist/assets/stylus-DrNz1BCZ.js +1 -0
- package/dist/assets/swift-UQ24LctC.js +1 -0
- package/dist/assets/switch-OVajJBPR.js +1 -0
- package/dist/assets/tcl-BBEwSttz.js +1 -0
- package/dist/assets/{terminal-DaLxAnKx.js → terminal-Cdd3rO1L.js} +1 -1
- package/dist/assets/textarea-DtCcemo9.js +1 -0
- package/dist/assets/textile-CYG_qV_5.js +1 -0
- package/dist/assets/{time-BuRlxEhE.js → time-p47i6wvp.js} +1 -1
- package/dist/assets/{timeline-definition-IT6M3QCI-DXwdU1og.js → timeline-definition-IT6M3QCI-D1XRbH5P.js} +1 -1
- package/dist/assets/toml-DB6lKkvi.js +1 -0
- package/dist/assets/{tracing-BmBBYynL.js → tracing-CdeezhIN.js} +1 -1
- package/dist/assets/{tracing-panel-AReiFUol.js → tracing-panel-Dl3MlGyG.js} +2 -2
- package/dist/assets/{tree-actions-Bz3fJ7p-.js → tree-actions-BiQ4VzX-.js} +1 -1
- package/dist/assets/{treemap-GDKQZRPO-4Cm6HMmj.js → treemap-GDKQZRPO-Z4m-KHQY.js} +1 -1
- package/dist/assets/troff-WrtaE-DW.js +1 -0
- package/dist/assets/ttcn-DNOLsGjD.js +1 -0
- package/dist/assets/ttcn-cfg-D2oRz-8W.js +1 -0
- package/dist/assets/turtle-hoYUNcbl.js +1 -0
- package/dist/assets/{useBoolean-CA7K8rap.js → useBoolean-CFj86iac.js} +1 -1
- package/dist/assets/useCellActionButton-B5wkKtv1.js +1 -0
- package/dist/assets/{useDeleteCell-DQP-NBq2.js → useDeleteCell-BfKWOHfk.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-BrkWlCTP.js → useDependencyPanelTab-BTipqN67.js} +1 -1
- package/dist/assets/useNotebookActions-CCwjICU_.js +12 -0
- package/dist/assets/useRunCells-DZ4glj3f.js +1 -0
- package/dist/assets/{useSplitCell-jH70A2Sz.js → useSplitCell-DXzfZTCe.js} +1 -1
- package/dist/assets/vb-CSArj0Ox.js +1 -0
- package/dist/assets/vbscript-Cy_b6RxB.js +1 -0
- package/dist/assets/{vega-component-DSvWLXIy.js → vega-component-VDedA5Cd.js} +1 -1
- package/dist/assets/{vega-embed-container-hDAVOOba.js → vega-embed-container-DxSqUOCK.js} +1 -1
- package/dist/assets/velocity-8fvVYgdA.js +1 -0
- package/dist/assets/verilog-BPXnWs06.js +1 -0
- package/dist/assets/vhdl-C4JSE7Sd.js +1 -0
- package/dist/assets/webidl-uP8WR81M.js +1 -0
- package/dist/assets/{worker-BQo2bijx.js → worker-BM73L67p.js} +3 -6
- package/dist/assets/write-secret-modal-Dtm66yVf.js +2 -0
- package/dist/assets/xquery-C8ppAT5Z.js +1 -0
- package/dist/assets/{xychartDiagram-PRI3JC2R-Cb0exSKs.js → xychartDiagram-PRI3JC2R-B8A0hi-Q.js} +1 -1
- package/dist/assets/yacas-CnXhtfs7.js +1 -0
- package/dist/assets/z80-B0aL_Tnf.js +1 -0
- package/dist/index.html +36 -34
- package/package.json +3 -4
- package/src/__mocks__/requests.ts +56 -4
- package/src/components/data-table/__tests__/__snapshots__/chart-spec-model.test.ts.snap +174 -21
- package/src/components/data-table/__tests__/chart-spec-model.test.ts +102 -1
- package/src/components/data-table/__tests__/columns.test.tsx +9 -1
- package/src/components/data-table/column-summary/chart-spec-model.tsx +163 -103
- package/src/components/data-table/column-summary/legacy-chart-spec.ts +15 -7
- package/src/components/data-table/column-summary/utils.ts +26 -7
- package/src/components/data-table/columns.tsx +11 -1
- package/src/components/data-table/types.ts +1 -1
- package/src/components/editor/__tests__/viewer-banner.test.tsx +14 -0
- package/src/components/editor/actions/__tests__/pair-with-agent-commands.test.ts +99 -18
- package/src/components/editor/actions/__tests__/pdf-export.test.ts +32 -13
- package/src/components/editor/actions/pair-with-agent-commands.ts +21 -10
- package/src/components/editor/actions/pair-with-agent-modal.tsx +2 -2
- package/src/components/editor/actions/pdf-export.ts +11 -14
- package/src/components/editor/actions/useNotebookActions.tsx +28 -19
- package/src/components/editor/cell/code/__tests__/cell-editor-activity-lifecycle.test.ts +250 -0
- package/src/components/editor/cell/code/cell-editor.tsx +13 -7
- package/src/components/editor/chrome/__tests__/state.test.ts +7 -1
- package/src/components/editor/chrome/panels/__tests__/logs-panel.test.tsx +25 -0
- package/src/components/editor/chrome/panels/__tests__/panel-accordion-state.test.ts +42 -0
- package/src/components/editor/chrome/panels/file-explorer-panel.tsx +6 -17
- package/src/components/editor/chrome/panels/logs-panel.tsx +12 -2
- package/src/components/editor/chrome/panels/panel-accordion-state.ts +51 -0
- package/src/components/editor/chrome/panels/session-panel.tsx +5 -16
- package/src/components/editor/chrome/panels/write-secret-modal.tsx +40 -12
- package/src/components/editor/chrome/state.ts +10 -0
- package/src/components/editor/connections/__tests__/json-credentials.test.ts +114 -0
- package/src/components/editor/connections/__tests__/paths.test.ts +39 -0
- package/src/components/editor/connections/__tests__/quick-add-data-sources.test.tsx +113 -0
- package/src/components/editor/connections/add-connection-dialog.tsx +2 -0
- package/src/components/editor/connections/components.tsx +6 -2
- package/src/components/editor/connections/database/__tests__/__snapshots__/as-code.test.ts.snap +27 -5
- package/src/components/editor/connections/database/__tests__/as-code.test.ts +33 -0
- package/src/components/editor/connections/database/as-code.ts +37 -13
- package/src/components/editor/connections/database/schemas.ts +6 -5
- package/src/components/editor/connections/form-renderers.tsx +99 -1
- package/src/components/editor/connections/json-credentials.ts +57 -0
- package/src/components/editor/connections/paths.ts +21 -0
- package/src/components/editor/connections/quick-add-data-sources.tsx +106 -0
- package/src/components/editor/connections/secret-combobox.tsx +41 -20
- package/src/components/editor/connections/storage/__tests__/__snapshots__/as-code.test.ts.snap +88 -2
- package/src/components/editor/connections/storage/__tests__/as-code.test.ts +128 -8
- package/src/components/editor/connections/storage/as-code.ts +79 -36
- package/src/components/editor/connections/storage/schemas.ts +85 -44
- package/src/components/editor/file-tree/__tests__/renderers.test.ts +31 -0
- package/src/components/editor/file-tree/file-viewer.tsx +11 -7
- package/src/components/editor/file-tree/renderers.tsx +21 -0
- package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +2 -2
- package/src/components/editor/viewer-banner.tsx +6 -1
- package/src/components/forms/form.tsx +59 -24
- package/src/components/forms/options.ts +2 -1
- package/src/components/slides/__tests__/cell-output-block.test.tsx +40 -0
- package/src/components/slides/__tests__/slide-cell-view.test.tsx +33 -0
- package/src/components/slides/reveal-component.tsx +22 -17
- package/src/components/slides/slide-cell-view.tsx +1 -1
- package/src/components/slides/slides.css +4 -2
- package/src/components/static-html/share-modal.tsx +1 -1
- package/src/core/ai/context/providers/file.ts +8 -29
- package/src/core/cells/__tests__/cells.test.ts +12 -2
- package/src/core/cells/__tests__/logs.test.ts +5 -5
- package/src/core/cells/cells.ts +17 -4
- package/src/core/cells/document-changes.ts +1 -0
- package/src/core/cells/logs.ts +14 -4
- package/src/core/codemirror/cm.ts +3 -0
- package/src/core/codemirror/code-lens/__tests__/actions.test.ts +68 -0
- package/src/core/codemirror/code-lens/__tests__/analyzer.test.ts +224 -0
- package/src/core/codemirror/code-lens/__tests__/entities.test.ts +175 -0
- package/src/core/codemirror/code-lens/__tests__/extension.test.ts +325 -0
- package/src/core/codemirror/code-lens/__tests__/perf.test.ts +121 -0
- package/src/core/codemirror/code-lens/__tests__/popover.test.ts +93 -0
- package/src/core/codemirror/code-lens/actions.ts +33 -0
- package/src/core/codemirror/code-lens/analyzer.ts +284 -0
- package/src/core/codemirror/code-lens/entities.ts +123 -0
- package/src/core/codemirror/code-lens/extension.ts +298 -0
- package/src/core/codemirror/code-lens/icons.ts +36 -0
- package/src/core/codemirror/code-lens/popover.tsx +240 -0
- package/src/core/codemirror/copilot/__tests__/language-server.test.ts +396 -100
- package/src/core/codemirror/copilot/__tests__/transport.test.ts +128 -540
- package/src/core/codemirror/copilot/language-server.ts +182 -70
- package/src/core/codemirror/copilot/transport.ts +15 -207
- package/src/core/codemirror/copilot/types.ts +9 -2
- package/src/core/codemirror/find-replace/__tests__/navigate.test.ts +42 -30
- package/src/core/codemirror/find-replace/navigate.ts +2 -0
- package/src/core/codemirror/go-to-definition/__tests__/commands.test.ts +24 -3
- package/src/core/codemirror/go-to-definition/commands.ts +93 -90
- package/src/core/codemirror/language/__tests__/sql.test.ts +627 -61
- package/src/core/codemirror/language/languages/python.ts +23 -11
- package/src/core/codemirror/language/languages/sql/completion-store.ts +5 -1
- package/src/core/codemirror/language/languages/sql/renderers.tsx +3 -3
- package/src/core/codemirror/language/languages/sql/sql.ts +251 -16
- package/src/core/codemirror/lsp/__tests__/federated-lsp.test.ts +161 -0
- package/src/core/codemirror/lsp/__tests__/log-messages.test.ts +53 -0
- package/src/core/codemirror/lsp/__tests__/normalize-markdown-math.test.ts +25 -0
- package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +598 -156
- package/src/core/codemirror/lsp/__tests__/transports.test.ts +112 -0
- package/src/core/codemirror/lsp/federated-lsp.ts +76 -23
- package/src/core/codemirror/lsp/log-messages.ts +37 -0
- package/src/core/codemirror/lsp/normalize-markdown-math.ts +8 -4
- package/src/core/codemirror/lsp/notebook-lsp.ts +220 -56
- package/src/core/codemirror/lsp/transports.ts +8 -1
- package/src/core/codemirror/lsp/types.ts +68 -8
- package/src/core/codemirror/lsp/utils.ts +14 -0
- package/src/core/codemirror/python-node-names.ts +90 -0
- package/src/core/codemirror/reactive-references/analyzer.ts +52 -57
- package/src/core/codemirror/utils.ts +28 -0
- package/src/core/config/feature-flag.tsx +3 -1
- package/src/core/datasets/data-source-discovery.ts +5 -0
- package/src/core/datasets/request-registry.ts +11 -0
- package/src/core/edit-app.tsx +1 -2
- package/src/core/export/__tests__/hooks.test.ts +2 -4
- package/src/core/export/hooks.ts +4 -3
- package/src/core/islands/__tests__/bridge.test.ts +107 -0
- package/src/core/islands/bootstrap.ts +1 -0
- package/src/core/islands/bridge.ts +18 -0
- package/src/core/kernel/messages.ts +2 -0
- package/src/core/lsp/__tests__/transport.test.ts +509 -337
- package/src/core/lsp/transport.ts +304 -132
- package/src/core/mode.ts +10 -0
- package/src/core/network/__tests__/api.test.ts +42 -0
- package/src/core/network/__tests__/connection.test.ts +45 -0
- package/src/core/network/__tests__/requests-lazy.test.ts +47 -1
- package/src/core/network/__tests__/requests-network.test.ts +48 -0
- package/src/core/network/api.ts +27 -0
- package/src/core/network/connection.ts +15 -0
- package/src/core/network/requests-lazy.ts +3 -0
- package/src/core/network/requests-network.ts +31 -8
- package/src/core/network/requests-static.ts +3 -0
- package/src/core/network/requests-toasting.tsx +3 -0
- package/src/core/network/types.ts +27 -6
- package/src/core/rtc/state.ts +9 -0
- package/src/core/static/download-html.ts +5 -14
- package/src/core/wasm/__tests__/bridge.test.ts +99 -5
- package/src/core/wasm/bridge.ts +42 -9
- package/src/core/wasm/worker/types.ts +10 -3
- package/src/core/wasm/worker/worker.ts +7 -8
- package/src/core/websocket/useMarimoKernelConnection.tsx +4 -0
- package/src/css/app/codemirror.css +16 -2
- package/src/hooks/__tests__/useDataSourceDiscovery.test.ts +80 -0
- package/src/hooks/useDataSourceDiscovery.ts +18 -0
- package/src/plugins/impl/DataTablePlugin.tsx +4 -1
- package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +158 -0
- package/src/plugins/impl/anywidget/__tests__/model.test.ts +55 -0
- package/src/plugins/impl/anywidget/model.ts +20 -5
- package/src/plugins/impl/data-frames/forms/__tests__/__snapshots__/form.test.tsx.snap +33 -21
- package/src/plugins/impl/data-frames/forms/renderers.tsx +11 -8
- package/src/stories/log-viewer.stories.tsx +12 -6
- package/src/utils/__tests__/blob.test.ts +27 -1
- package/src/utils/__tests__/download.test.tsx +44 -4
- package/src/utils/blob.ts +24 -1
- package/src/utils/download.ts +14 -15
- package/dist/assets/JsonOutput-B0aYK7up.js +0 -53
- package/dist/assets/LazyAnyLanguageCodeMirror-B2JvSXP-.js +0 -2
- package/dist/assets/RenderHTML-uBc4LkCP.js +0 -1
- package/dist/assets/__vite-browser-external-BkrtI7wJ.js +0 -1
- package/dist/assets/add-connection-dialog-BgQ7HuWu.js +0 -170
- package/dist/assets/ai-model-dropdown-C7iiWBqP.js +0 -5
- package/dist/assets/apl-DTwRFDps.js +0 -1
- package/dist/assets/app-config-button-DhmeKMjL.js +0 -1
- package/dist/assets/asciiarmor-CiqkDK0s.js +0 -1
- package/dist/assets/asn1-RTvH5MEs.js +0 -1
- package/dist/assets/blob-C3EfaMOb.js +0 -1
- package/dist/assets/brainfuck-szH_VGzd.js +0 -1
- package/dist/assets/cell-editor-DD0zaU_N.js +0 -27
- package/dist/assets/cell-link-C0hhYyNu.js +0 -1
- package/dist/assets/cells-aqfX084m.js +0 -229
- package/dist/assets/channel-D-k8o3T1.js +0 -1
- package/dist/assets/chunk-55IACEB6-xhaY4LU6.js +0 -1
- package/dist/assets/classDiagram-2ON5EDUG-C-rIg7EQ.js +0 -1
- package/dist/assets/classDiagram-v2-WZHVMYZB-MBAsRLae.js +0 -1
- package/dist/assets/clojure-CyEbLmch.js +0 -1
- package/dist/assets/cmake-Dk8f7QuI.js +0 -1
- package/dist/assets/cobol-BJJRqW1D.js +0 -1
- package/dist/assets/coffeescript-BDuWJ9WO.js +0 -1
- package/dist/assets/commonlisp-CVHm2VSp.js +0 -1
- package/dist/assets/components-1i9OlkxM.js +0 -1
- package/dist/assets/config-CR3KxW53.js +0 -1
- package/dist/assets/crystal-C2Fgr79A.js +0 -1
- package/dist/assets/cypher-CUlCm6vR.js +0 -1
- package/dist/assets/d-4ANEHA6q.js +0 -1
- package/dist/assets/diff-C-W-5V8L.js +0 -1
- package/dist/assets/dist-CCAhuqF-.js +0 -1
- package/dist/assets/dist-DGhK0kPE.js +0 -1
- package/dist/assets/dist-SVDIDTM2.js +0 -1
- package/dist/assets/dist-xSLg7wNV.js +0 -1
- package/dist/assets/download-CkMUlfM3.js +0 -9
- package/dist/assets/dtd-D9h-tL8G.js +0 -1
- package/dist/assets/dylan-D3MC56xy.js +0 -1
- package/dist/assets/eiffel-CjvEov4k.js +0 -1
- package/dist/assets/elm-DvSbvRWe.js +0 -1
- package/dist/assets/erlang-DJYaGXyq.js +0 -1
- package/dist/assets/error-entries-NXVkubuN.js +0 -8
- package/dist/assets/factor-CUQCrkTo.js +0 -1
- package/dist/assets/file-explorer-panel-D7VHUIPp.js +0 -26
- package/dist/assets/floating-outline-BOqWJRw_.js +0 -1
- package/dist/assets/focus-tOmGbv38.js +0 -1
- package/dist/assets/form-CIXAzTfC.js +0 -2
- package/dist/assets/forth-D9xegiCO.js +0 -1
- package/dist/assets/fortran-B0Oe0U8s.js +0 -1
- package/dist/assets/gas-jLjj-PIq.js +0 -1
- package/dist/assets/gherkin-3Ig8Crit.js +0 -1
- package/dist/assets/groovy-NKpNVJ-n.js +0 -1
- package/dist/assets/haskell-OPE4bAjk.js +0 -1
- package/dist/assets/haxe-DEAZF8L3.js +0 -1
- package/dist/assets/home-page-DO_MqQAB.js +0 -4
- package/dist/assets/idl-BM6265Xl.js +0 -1
- package/dist/assets/index-wLUfvfaV.js +0 -38
- package/dist/assets/index-xs-zSSrX.css +0 -2
- package/dist/assets/infoDiagram-HS3SLOUP-DQnMjKYJ.js +0 -2
- package/dist/assets/javascript-CZ9vDpAy.js +0 -1
- package/dist/assets/julia-BrY9TQnt.js +0 -1
- package/dist/assets/katex-C-lfa1AM.js +0 -1
- package/dist/assets/kiosk-mode-QsYGYiC8.js +0 -1
- package/dist/assets/livescript-CNahkUp5.js +0 -1
- package/dist/assets/logs-panel-B6AfYQb6.js +0 -1
- package/dist/assets/lua-Skr4TVu_.js +0 -1
- package/dist/assets/mathematica-BXxhrpeY.js +0 -1
- package/dist/assets/mbox-BRrQCVe9.js +0 -1
- package/dist/assets/mirc-CffYPE4R.js +0 -1
- package/dist/assets/mllike-C1DLZhEI.js +0 -1
- package/dist/assets/modelica-CvAyRRNV.js +0 -1
- package/dist/assets/mscgen-uMZWtMZv.js +0 -1
- package/dist/assets/mumps-DFJehEx7.js +0 -1
- package/dist/assets/node-sql-parser-BWgUjcfV.js +0 -68
- package/dist/assets/nsis-BVI9YULz.js +0 -1
- package/dist/assets/ntriples-Bcdh7b2H.js +0 -1
- package/dist/assets/octave-CdAKz6YS.js +0 -1
- package/dist/assets/oz-DSySeR-W.js +0 -1
- package/dist/assets/pair-with-agent-modal-C9nKHvCp.js +0 -4
- package/dist/assets/panels-Ch_sUzTx.js +0 -4
- package/dist/assets/pascal-DefziIUN.js +0 -1
- package/dist/assets/perl-BOOloBPk.js +0 -1
- package/dist/assets/pig-f0nBb-5x.js +0 -1
- package/dist/assets/powershell-DToQjbK9.js +0 -1
- package/dist/assets/process-output-BFSCpqNt.js +0 -1
- package/dist/assets/properties-BRob-nyj.js +0 -1
- package/dist/assets/protobuf-DZyC6051.js +0 -1
- package/dist/assets/pug-pVoM8FRt.js +0 -1
- package/dist/assets/puppet-9fuYG07F.js +0 -1
- package/dist/assets/python-_Mr8fyXP.js +0 -1
- package/dist/assets/q-D73s4Y77.js +0 -1
- package/dist/assets/r-BOEjz92e.js +0 -1
- package/dist/assets/rpm-LpXWTM5t.js +0 -1
- package/dist/assets/ruby-DodgSDfF.js +0 -1
- package/dist/assets/run-page-D9-9chbw.js +0 -1
- package/dist/assets/sas-D9KCtUmL.js +0 -1
- package/dist/assets/scheme-p8UJxmJw.js +0 -1
- package/dist/assets/session-panel-Dz-DQDeV.js +0 -1
- package/dist/assets/shell-BWdqyqwL.js +0 -1
- package/dist/assets/sieve-CLwJmtiQ.js +0 -1
- package/dist/assets/slides-MCbMDtlY.css +0 -1
- package/dist/assets/smalltalk-D3KV-Qah.js +0 -1
- package/dist/assets/sparql-D9Jz2mBw.js +0 -1
- package/dist/assets/state-BpkJVsmT.js +0 -3
- package/dist/assets/state-DDag0B_B.js +0 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-CA1l0rNa.js +0 -1
- package/dist/assets/stylus-ClN4l_XO.js +0 -1
- package/dist/assets/swift-Dvd_9xBv.js +0 -1
- package/dist/assets/switch-DLGijIXN.js +0 -1
- package/dist/assets/tcl-DR2p8cyi.js +0 -1
- package/dist/assets/textarea-aocYW9hl.js +0 -1
- package/dist/assets/textile-D6S27_J2.js +0 -1
- package/dist/assets/toml-B-YuQ2Id.js +0 -1
- package/dist/assets/troff-HSk8AoRF.js +0 -1
- package/dist/assets/ttcn-CehzlVdx.js +0 -1
- package/dist/assets/ttcn-cfg-CLEPwk1s.js +0 -1
- package/dist/assets/turtle-DQLHkbOu.js +0 -1
- package/dist/assets/useCellActionButton-BG7n5b0H.js +0 -1
- package/dist/assets/useNotebookActions-COdGI2fR.js +0 -12
- package/dist/assets/useRunCells-BtSwerrU.js +0 -1
- package/dist/assets/vb-o1EHrS4z.js +0 -1
- package/dist/assets/vbscript-BS8yUFpf.js +0 -1
- package/dist/assets/velocity-u_oGPFaA.js +0 -1
- package/dist/assets/verilog-CSmDH7su.js +0 -1
- package/dist/assets/vhdl-BCaWLcjw.js +0 -1
- package/dist/assets/webidl-Bf6dokXM.js +0 -1
- package/dist/assets/write-secret-modal-3-v-dHVj.js +0 -1
- package/dist/assets/xquery-Di0kkiXg.js +0 -1
- package/dist/assets/yacas-DB8tPtyp.js +0 -1
- package/dist/assets/z80-DFUvlWxk.js +0 -1
- /package/dist/assets/{ImageComparisonComponent-Cz3xVDLH.js → ImageComparisonComponent-COvcNAUu.js} +0 -0
- /package/dist/assets/{Inputs-B8-VCb_j.js → Inputs-BmtHnGKp.js} +0 -0
- /package/dist/assets/{Plot-X2G47XHf.js → Plot-CB_5AR7d.js} +0 -0
- /package/dist/assets/{apl-DVqFAlEd.js → apl-Cp4QYSh2.js} +0 -0
- /package/dist/assets/{array-Ddg9CgJT.js → array-BuhHwWF4.js} +0 -0
- /package/dist/assets/{asciiarmor-B45BhOLj.js → asciiarmor-BUxo-e6o.js} +0 -0
- /package/dist/assets/{asn1-C4T2ctU6.js → asn1-Cp_b5sxr.js} +0 -0
- /package/dist/assets/{asterisk-9U_4Kgke.js → asterisk-BKEE609E.js} +0 -0
- /package/dist/assets/{azure-nN8APleF.js → azure-t5-hyIQ1.js} +0 -0
- /package/dist/assets/{brainfuck-kVh8Eud4.js → brainfuck-DmRCaE-Q.js} +0 -0
- /package/dist/assets/{card-VUBaYDpT.js → card-P_NJTnTd.js} +0 -0
- /package/dist/assets/{chunk-4F5CHEZ2-ClSh5rxG.js → chunk-4F5CHEZ2-D6n-cT3v.js} +0 -0
- /package/dist/assets/{chunk-B2363JML-cit0ouFv.js → chunk-B2363JML-kkXnm2Yp.js} +0 -0
- /package/dist/assets/{chunk-DR5Q36YT-Bsu9Glc0.js → chunk-DR5Q36YT-DZQANAzH.js} +0 -0
- /package/dist/assets/{chunk-FRFDVMJY--Re1QfFE.js → chunk-FRFDVMJY-MdHMrSks.js} +0 -0
- /package/dist/assets/{chunk-PL6DKKU2-CAwRAr-p.js → chunk-PL6DKKU2-BPi2wKR3.js} +0 -0
- /package/dist/assets/{chunk-SJTYNZTY-G1spWesO.js → chunk-SJTYNZTY-BcV9dsih.js} +0 -0
- /package/dist/assets/{chunk-TQ3KTPDO-DBwra5xv.js → chunk-TQ3KTPDO-XDjkQ8Xj.js} +0 -0
- /package/dist/assets/{chunk-UMXZTB3W-A5RvYDPE.js → chunk-UMXZTB3W-C-xu4f6g.js} +0 -0
- /package/dist/assets/{clear-button-DQtvx6eq.js → clear-button-clPKQb-5.js} +0 -0
- /package/dist/assets/{click-outside-container-CrWZsAF5.js → click-outside-container-BU5ChL3W.js} +0 -0
- /package/dist/assets/{clike-O0gwXilc.js → clike--wVFVJzz.js} +0 -0
- /package/dist/assets/{clojure-CsbMWxp9.js → clojure-xvpMtcD1.js} +0 -0
- /package/dist/assets/{cmake-FpJvOdyj.js → cmake-ChD_WVwL.js} +0 -0
- /package/dist/assets/{cobol-Duxbpsru.js → cobol-B5K8KXv5.js} +0 -0
- /package/dist/assets/{coffeescript-D-Unz9IP.js → coffeescript-EMaA6sFP.js} +0 -0
- /package/dist/assets/{colors-C_0lIznd.js → colors-CQfhPUa2.js} +0 -0
- /package/dist/assets/{common-keywords-PqH2GDfH.js → common-keywords-DdCmdKox.js} +0 -0
- /package/dist/assets/{commonlisp-_nR12oc7.js → commonlisp-BTUt7Wms.js} +0 -0
- /package/dist/assets/{crystal-dj3W4b1A.js → crystal-CaYGQjnj.js} +0 -0
- /package/dist/assets/{css-0BG6A_BC.js → css-Ci5CSFmt.js} +0 -0
- /package/dist/assets/{cypher-CKPokaoH.js → cypher-Bt0cHBYq.js} +0 -0
- /package/dist/assets/{cytoscape.esm-DzUNSF80.js → cytoscape.esm-CbUmcCyd.js} +0 -0
- /package/dist/assets/{d-BrbqzVa2.js → d-Y6y0yT7l.js} +0 -0
- /package/dist/assets/{diff-BmdR9FsO.js → diff-DWzGHZfz.js} +0 -0
- /package/dist/assets/{dist-CpbbK4-I.js → dist-8SH6SWEG.js} +0 -0
- /package/dist/assets/{dist-DzAAhYcW.js → dist-9o0Xjd5v.js} +0 -0
- /package/dist/assets/{dist-DNGKAtWk.js → dist-BKgHjzML.js} +0 -0
- /package/dist/assets/{dist-98K4fusX.js → dist-BP4hpPAE.js} +0 -0
- /package/dist/assets/{dist-D35OyUMQ.js → dist-C-3FVUQA.js} +0 -0
- /package/dist/assets/{dist-OgwOt8T2.js → dist-C6_DArtj.js} +0 -0
- /package/dist/assets/{dist-O5-NiN3f.js → dist-CLyRge8R.js} +0 -0
- /package/dist/assets/{dist-D5ToCtv8.js → dist-CZvbHnyT.js} +0 -0
- /package/dist/assets/{dist-DrtRBAn8.js → dist-CrKffqgx.js} +0 -0
- /package/dist/assets/{dist-B8g3pNYJ.js → dist-Cros4IAo.js} +0 -0
- /package/dist/assets/{dist-3N7-WLqi.js → dist-D47O3FBX.js} +0 -0
- /package/dist/assets/{dist-BaKJ0-Tb.js → dist-DJuRuTXr.js} +0 -0
- /package/dist/assets/{dist-CM-lWxt3.js → dist-DQl27SFq.js} +0 -0
- /package/dist/assets/{dist-DokId-qM.js → dist-DeJBvhAc.js} +0 -0
- /package/dist/assets/{dist-C5kf6g-d.js → dist-fLBYOt9R.js} +0 -0
- /package/dist/assets/{dist-56ul6-mm.js → dist-kLs0VbW_.js} +0 -0
- /package/dist/assets/{dist-ByK00N0T.js → dist-l4RTzHX-.js} +0 -0
- /package/dist/assets/{dist-D9sE1udr.js → dist-ut5UbaRH.js} +0 -0
- /package/dist/assets/{dtd-DbCXDVgi.js → dtd-CkphQXbR.js} +0 -0
- /package/dist/assets/{duckdb-keywords-mPlR0SxW.js → duckdb-keywords-D9ZiGTTc.js} +0 -0
- /package/dist/assets/{dylan-CLLzL2Js.js → dylan-CPyS5Usd.js} +0 -0
- /package/dist/assets/{ebnf-Cnws41cu.js → ebnf-C4SDYpAu.js} +0 -0
- /package/dist/assets/{ecl-BC7x2nzk.js → ecl-Dy8k_w5N.js} +0 -0
- /package/dist/assets/{eiffel-CDU836rz.js → eiffel-DZMtnEo6.js} +0 -0
- /package/dist/assets/{elm-D-_bXARs.js → elm-CkuOc7z-.js} +0 -0
- /package/dist/assets/{empty-state-CqJvEFRk.js → empty-state-JOk_hLQe.js} +0 -0
- /package/dist/assets/{erlang-CwDZk2zM.js → erlang-CSyJ5dU6.js} +0 -0
- /package/dist/assets/{esm-D6WfbcL3.js → esm-7r3G8FZG.js} +0 -0
- /package/dist/assets/{fcl-CwkPc-_9.js → fcl-Px-Zskiw.js} +0 -0
- /package/dist/assets/{formatting-CDf6w1Kt.js → formatting-COz4XEaB.js} +0 -0
- /package/dist/assets/{forth-D6FsO_8x.js → forth-HHM4VU-4.js} +0 -0
- /package/dist/assets/{fortran-D4BMbIkG.js → fortran-D_hdoGUs.js} +0 -0
- /package/dist/assets/{gas-JFjzcgdY.js → gas-DwXUGevO.js} +0 -0
- /package/dist/assets/{gherkin-Cyu-qGaF.js → gherkin-6UjduaeQ.js} +0 -0
- /package/dist/assets/{github-_JH-0hIO.js → github-A_zUd4Uj.js} +0 -0
- /package/dist/assets/{groovy-CZaE9eN-.js → groovy-BMSTiLIi.js} +0 -0
- /package/dist/assets/{haskell-Dc6o0IGr.js → haskell-CwQPWeas.js} +0 -0
- /package/dist/assets/{haxe-Bsf0tzqs.js → haxe-BwgB7edi.js} +0 -0
- /package/dist/assets/{http-BQNSD-HR.js → http-CqevOCDe.js} +0 -0
- /package/dist/assets/{idl-1W91kQ8_.js → idl-DaVQAS85.js} +0 -0
- /package/dist/assets/{init-nx27Zb9l.js → init-D5qG588s.js} +0 -0
- /package/dist/assets/{javascript-BZ81-2rO.js → javascript-DgYFgf02.js} +0 -0
- /package/dist/assets/{julia-BZOsq0r_.js → julia-ZzackTsi.js} +0 -0
- /package/dist/assets/{katex-CvZ3kCGk.js → katex-Di-siZEY.js} +0 -0
- /package/dist/assets/{links-CZr5bjvo.js → links-ClNQSIal.js} +0 -0
- /package/dist/assets/{livescript-CNZfmikk.js → livescript-fyjJd0Zu.js} +0 -0
- /package/dist/assets/{loro_wasm_bg-RNUly1SE.js → loro_wasm_bg-BPjF1TWb.js} +0 -0
- /package/dist/assets/{lua-DXGRliwd.js → lua-Cx9isc8d.js} +0 -0
- /package/dist/assets/{marimo-icons-C_nFooxr.js → marimo-icons-yD_pAOm9.js} +0 -0
- /package/dist/assets/{math-CLO4uoaP.js → math-7EMdGNhR.js} +0 -0
- /package/dist/assets/{mathematica-BoUj8M7D.js → mathematica-BJvaPi1-.js} +0 -0
- /package/dist/assets/{mbox-DLVP8LAe.js → mbox-43z3jriT.js} +0 -0
- /package/dist/assets/{mirc-kI4d5fMu.js → mirc-B1ZSd8Bn.js} +0 -0
- /package/dist/assets/{mllike-CD9vBc_2.js → mllike-DZwCuWJi.js} +0 -0
- /package/dist/assets/{modelica-DgfsLJuF.js → modelica-DJJ2ie2z.js} +0 -0
- /package/dist/assets/{mscgen-B1HDwshJ.js → mscgen-CKYpxNp_.js} +0 -0
- /package/dist/assets/{multi-icon-nrKPWjDU.js → multi-icon-DVD1luis.js} +0 -0
- /package/dist/assets/{mumps-D_-b9TZD.js → mumps-DYGlTYd1.js} +0 -0
- /package/dist/assets/{nginx-Cm282mo8.js → nginx-D6Zlgok6.js} +0 -0
- /package/dist/assets/{ntriples-COX9JFZ8.js → ntriples-DizNPLuO.js} +0 -0
- /package/dist/assets/{octave-BejycR79.js → octave-DdwI7gwd.js} +0 -0
- /package/dist/assets/{oz-CFFivrGn.js → oz-DMPAJRti.js} +0 -0
- /package/dist/assets/{panel-context-CH75ubGG.js → panel-context-CckkyW-1.js} +0 -0
- /package/dist/assets/{pascal-B_p9jkCs.js → pascal-Do0zihr_.js} +0 -0
- /package/dist/assets/{path-Bz_hIzg5.js → path-WJo29M9I.js} +0 -0
- /package/dist/assets/{pathUtils-Bfcp5m-a.js → pathUtils-icFgkNy9.js} +0 -0
- /package/dist/assets/{perl-C-SFBTly.js → perl-t4XY-5wj.js} +0 -0
- /package/dist/assets/{pig-BhxDMp2k.js → pig-CgweiC6M.js} +0 -0
- /package/dist/assets/{powershell-c59M-9N2.js → powershell-OQGwpWeH.js} +0 -0
- /package/dist/assets/{properties-D1JNwCKy.js → properties-BU4KenKz.js} +0 -0
- /package/dist/assets/{protobuf-DQS7ex8R.js → protobuf--IbBPde2.js} +0 -0
- /package/dist/assets/{puppet-DaQvhvew.js → puppet-DkR_zpq4.js} +0 -0
- /package/dist/assets/{python-XHl3eRTS.js → python-PdpM9cxt.js} +0 -0
- /package/dist/assets/{q-DppnoRE3.js → q-BmGsZsKc.js} +0 -0
- /package/dist/assets/{r-D8-F_FWj.js → r-D1cPebaP.js} +0 -0
- /package/dist/assets/{request-registry-DHocQ_4I.js → request-registry-Dpk9hQrX.js} +0 -0
- /package/dist/assets/{requests-DYeT4CEe.js → requests-BMphPdzB.js} +0 -0
- /package/dist/assets/{rpm-CegJhNNO.js → rpm-CG3vlu2-.js} +0 -0
- /package/dist/assets/{ruby-YMIxufV1.js → ruby-BU2XuRQM.js} +0 -0
- /package/dist/assets/{runs-DBTXqJHS.js → runs-s9t2f_Tg.js} +0 -0
- /package/dist/assets/{sas-wTtX9UIQ.js → sas-ig9j_2iC.js} +0 -0
- /package/dist/assets/{scheme-BGenom3k.js → scheme-9DZXzBKN.js} +0 -0
- /package/dist/assets/{semaphore-DtBYRzWS.js → semaphore-C-Nli4KG.js} +0 -0
- /package/dist/assets/{shell-Bu1sLaiP.js → shell-BtigxJqY.js} +0 -0
- /package/dist/assets/{sieve-ffe6rUQh.js → sieve-DJ-mn8HY.js} +0 -0
- /package/dist/assets/{simple-mode-DBSzUJLA.js → simple-mode-lTjyt9i9.js} +0 -0
- /package/dist/assets/{smalltalk-NU5EGjHp.js → smalltalk-Bn53uNk6.js} +0 -0
- /package/dist/assets/{solr-ptw1yIqO.js → solr-BenHzQuB.js} +0 -0
- /package/dist/assets/{sparql-uqVktnwO.js → sparql-mdFRPSSw.js} +0 -0
- /package/dist/assets/{spreadsheet-VEzeu_mb.js → spreadsheet-CIIID0RN.js} +0 -0
- /package/dist/assets/{sql-tYjnWETe.js → sql-BJS8pfHr.js} +0 -0
- /package/dist/assets/{src-BshXgZd4.js → src-C042FyXq.js} +0 -0
- /package/dist/assets/{state-D10U2MwA.js → state-DCtLlFJq.js} +0 -0
- /package/dist/assets/{stylus-B2E6Ulaz.js → stylus-CUXYXPeL.js} +0 -0
- /package/dist/assets/{swift-Rmnn7ATv.js → swift-BgwlI0GN.js} +0 -0
- /package/dist/assets/{swiper-component-Che9MNs4.js → swiper-component-DXW8snlt.js} +0 -0
- /package/dist/assets/{tcl-ZPWCn2nn.js → tcl-B8Khjzwl.js} +0 -0
- /package/dist/assets/{textile-uhA33kFk.js → textile-DmfgOrXO.js} +0 -0
- /package/dist/assets/{tiddlywiki-CPkGLyXH.js → tiddlywiki-mgaN9k7_.js} +0 -0
- /package/dist/assets/{tiki-BtjLo8OF.js → tiki-B8Sxh4ZA.js} +0 -0
- /package/dist/assets/{timer-VYMLXPue.js → timer-Bt8Z3SQI.js} +0 -0
- /package/dist/assets/{toml-BFZv2Mv7.js → toml-CPrwnn25.js} +0 -0
- /package/dist/assets/{treemap-Bca0xNNq.js → treemap-CshYMgJw.js} +0 -0
- /package/dist/assets/{troff-B5eayHop.js → troff-Cb-2hp0t.js} +0 -0
- /package/dist/assets/{ttcn-cfg-CfbkL3Q_.js → ttcn-cfg-O0cle81j.js} +0 -0
- /package/dist/assets/{ttcn-BM0Yp8NY.js → ttcn-mp3DV9SP.js} +0 -0
- /package/dist/assets/{turtle-DvetLxrv.js → turtle-Bo_IjRT-.js} +0 -0
- /package/dist/assets/{types-Da7lA5YC.js → types-Bn-E0Dh-.js} +0 -0
- /package/dist/assets/{use-vega-container-remeasure-CbKTb_jy.js → use-vega-container-remeasure-C52OJt1l.js} +0 -0
- /package/dist/assets/{useInterval-CWBTUy5W.js → useInterval-CnQfyMa9.js} +0 -0
- /package/dist/assets/{vb-i5Z8scch.js → vb-B84py4l9.js} +0 -0
- /package/dist/assets/{vbscript-BiPYgIyi.js → vbscript-DCWGTF8B.js} +0 -0
- /package/dist/assets/{velocity-Dw3R3YoX.js → velocity-COls9qbE.js} +0 -0
- /package/dist/assets/{verilog-B8FhJcX6.js → verilog-Dn4JRpb3.js} +0 -0
- /package/dist/assets/{vhdl-BqPEoXdJ.js → vhdl-DxQ-aNCu.js} +0 -0
- /package/dist/assets/{web-vitals-CwE0GGzl.js → web-vitals-DBq6CjRf.js} +0 -0
- /package/dist/assets/{webidl-mMO-qW5Q.js → webidl-IlD_Nbdp.js} +0 -0
- /package/dist/assets/{ws-BmTnbVEi.js → ws-Dj1iZVFK.js} +0 -0
- /package/dist/assets/{xquery-DvqNwq7L.js → xquery-DwkwsYYE.js} +0 -0
- /package/dist/assets/{yacas-Dku9Z6Kf.js → yacas-CR27GINL.js} +0 -0
- /package/dist/assets/{z80-DvazU5Tr.js → z80-DDujbhXi.js} +0 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./esm-7r3G8FZG.js","./chunk-LvLJmgfZ.js","./dist-D6Iobl3P.js","./dist-DI1-Z60I.js","./dist-DYEuVkEX.js","./dist-12S8I4CH.js","./dist-CaZf6AoY.js","./dist-CZvbHnyT.js","./dist-Bfm9U3vp.js","./dist-BJZAIIze.js","./dist-BrZjJXDA.js","./dist-C-3FVUQA.js","./dist-Csf5i4KY.js","./dist-DnjsPBRJ.js","./dist-aRc_dRed.js","./dist-I3qeQWuP.js","./dist-l4RTzHX-.js","./dist-DrBqBDHF.js","./dist-Cgoy5550.js","./dist-DeJBvhAc.js","./dist-gDi2I7IJ.js","./dist-fLBYOt9R.js","./dist-aeKlrIMv.js","./dist-BP4hpPAE.js","./dist-miDa4-cz.js","./dist-C6_DArtj.js","./dist-CvWC93qL.js","./dist-DcwTQG1A.js","./dist-nDEBxpL6.js","./dist-DJuRuTXr.js","./dist-DsfPGbgk.js","./dist-CPjTeT8p.js","./dist-B99-E4qp.js","./dist-BKgHjzML.js","./dist-DtbtRAqz.js","./dist-kLs0VbW_.js","./dist-DcXy-1eJ.js","./dist-8SH6SWEG.js","./dist-BiwuSVkx.js","./dist-D47O3FBX.js","./dist-D6WgndTj.js","./dist-DQl27SFq.js","./apl-BnIcQcjL.js","./apl-Cp4QYSh2.js","./asciiarmor-VNkYxCrW.js","./asciiarmor-BUxo-e6o.js","./asn1-DHaiamxN.js","./asn1-Cp_b5sxr.js","./brainfuck-B7OQ4qXM.js","./brainfuck-DmRCaE-Q.js","./cobol-ISPch7J4.js","./cobol-B5K8KXv5.js","./clike-CcPLlJ3-.js","./clike--wVFVJzz.js","./clojure-DK3HqqeG.js","./clojure-xvpMtcD1.js","./css-IVPzYP6l.js","./css-Ci5CSFmt.js","./cmake-Bnhxe81D.js","./cmake-ChD_WVwL.js","./coffeescript-B3cS2ooz.js","./coffeescript-EMaA6sFP.js","./commonlisp-DH0yllOU.js","./commonlisp-BTUt7Wms.js","./cypher-DqUctVOg.js","./cypher-Bt0cHBYq.js","./python-DgHNYu_r.js","./python-PdpM9cxt.js","./crystal-CfSxbewa.js","./crystal-CaYGQjnj.js","./d-DYRkEHFy.js","./d-Y6y0yT7l.js","./diff-Cd5HBT58.js","./diff-DWzGHZfz.js","./dockerfile-CLtE40Sb.js","./simple-mode-lTjyt9i9.js","./dtd-C24SyIVW.js","./dtd-CkphQXbR.js","./dylan-CrkzDmc1.js","./dylan-CPyS5Usd.js","./ecl-DSuYw2WY.js","./ecl-Dy8k_w5N.js","./eiffel-D60uMU52.js","./eiffel-DZMtnEo6.js","./elm-pYZdVh3P.js","./elm-CkuOc7z-.js","./erlang-D9MlcoAb.js","./erlang-CSyJ5dU6.js","./factor-gTHEdNEJ.js","./factor-xSp9WnN7.js","./forth-CWZXTLFs.js","./forth-HHM4VU-4.js","./fortran-B8kNpt8O.js","./fortran-D_hdoGUs.js","./mllike-fFPa49Ft.js","./mllike-DZwCuWJi.js","./gas-DxuMSeqj.js","./gas-DwXUGevO.js","./gherkin-ZkKEDs6K.js","./gherkin-6UjduaeQ.js","./groovy-CqQZm41C.js","./groovy-BMSTiLIi.js","./haskell-DWF-arrK.js","./haskell-CwQPWeas.js","./haxe-LmdIWMMr.js","./haxe-BwgB7edi.js","./idl-DEd51qv-.js","./idl-DaVQAS85.js","./javascript-BFIOGZ-j.js","./javascript-DgYFgf02.js","./julia-Chs3F4Sv.js","./julia-ZzackTsi.js","./livescript-CZOCkk31.js","./livescript-fyjJd0Zu.js","./lua-DK4FKJLN.js","./lua-Cx9isc8d.js","./mirc-OXxqihhx.js","./mirc-B1ZSd8Bn.js","./mathematica-BoEJU8On.js","./mathematica-BJvaPi1-.js","./modelica-B2hOO40U.js","./modelica-DJJ2ie2z.js","./mumps-BUUE1QKi.js","./mumps-DYGlTYd1.js","./mbox-1WJcoGln.js","./mbox-43z3jriT.js","./nsis-CQPY661e.js","./nsis-SCfsPq8M.js","./ntriples-CtWbsB7O.js","./ntriples-DizNPLuO.js","./octave-D4HWE405.js","./octave-DdwI7gwd.js","./oz-Cp-6fXH5.js","./oz-DMPAJRti.js","./pascal-B2F20-Dq.js","./pascal-Do0zihr_.js","./perl-C8I4my72.js","./perl-t4XY-5wj.js","./pig-Dg7z9udE.js","./pig-CgweiC6M.js","./powershell-BjupwEXi.js","./powershell-OQGwpWeH.js","./properties-CWyPUxmr.js","./properties-BU4KenKz.js","./protobuf-B2dHC-BL.js","./protobuf--IbBPde2.js","./pug-B-MnYZUt.js","./pug-D81S7inS.js","./puppet-CeBQQ4Li.js","./puppet-DkR_zpq4.js","./q-wSguJrTU.js","./q-BmGsZsKc.js","./r-BoIJ2Zve.js","./r-D1cPebaP.js","./rpm-DmyUNIkv.js","./rpm-CG3vlu2-.js","./ruby-Djlw6kjU.js","./ruby-BU2XuRQM.js","./sas-B8AwxLVS.js","./sas-ig9j_2iC.js","./scheme-o4lPnt7c.js","./scheme-9DZXzBKN.js","./shell-DJuOhLmg.js","./shell-BtigxJqY.js","./sieve-BBDbJOX3.js","./sieve-DJ-mn8HY.js","./smalltalk-CmTnbqu4.js","./smalltalk-Bn53uNk6.js","./sparql-BQuPdHqO.js","./sparql-mdFRPSSw.js","./stylus-DrNz1BCZ.js","./stylus-CUXYXPeL.js","./swift-UQ24LctC.js","./swift-BgwlI0GN.js","./stex-pjf-hOob.js","./stex-FMMSUPAS.js","./verilog-BPXnWs06.js","./verilog-Dn4JRpb3.js","./tcl-BBEwSttz.js","./tcl-B8Khjzwl.js","./textile-CYG_qV_5.js","./textile-DmfgOrXO.js","./toml-DB6lKkvi.js","./toml-CPrwnn25.js","./troff-WrtaE-DW.js","./troff-Cb-2hp0t.js","./ttcn-DNOLsGjD.js","./ttcn-mp3DV9SP.js","./ttcn-cfg-D2oRz-8W.js","./ttcn-cfg-O0cle81j.js","./turtle-hoYUNcbl.js","./turtle-Bo_IjRT-.js","./webidl-uP8WR81M.js","./webidl-IlD_Nbdp.js","./vb-CSArj0Ox.js","./vb-B84py4l9.js","./vbscript-Cy_b6RxB.js","./vbscript-DCWGTF8B.js","./velocity-8fvVYgdA.js","./velocity-COls9qbE.js","./vhdl-C4JSE7Sd.js","./vhdl-DxQ-aNCu.js","./xquery-C8ppAT5Z.js","./xquery-DwkwsYYE.js","./yacas-CnXhtfs7.js","./yacas-CR27GINL.js","./z80-B0aL_Tnf.js","./z80-DDujbhXi.js","./mscgen-BUm8DSPh.js","./mscgen-CKYpxNp_.js","./dist-oUL4XFdB.js","./dist-Cros4IAo.js","./dist-9o0Xjd5v.js","./node-sql-parser-CAudyJSw.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var m8=Object.defineProperty;var h8=(va,Tr,di)=>Tr in va?m8(va,Tr,{enumerable:!0,configurable:!0,writable:!0,value:di}):va[Tr]=di;var ae=(va,Tr,di)=>h8(va,typeof Tr!="symbol"?Tr+"":Tr,di);import{o as g8,s as sd,t as on}from"./chunk-LvLJmgfZ.js";import{c as a_,i as Te,l as i_,p as Ie,r as y8,s as v8,u as un}from"./useEvent-D91BmmQi.js";import{t as cd}from"./react-Bj1aDYRI.js";import{t as o_}from"./react-dom-CSu739Rf.js";import{B as b8,N as w8,P as l_,R as s_,T as c_,k as x8,w as _8}from"./zod-H_cgTO0M.js";import{t as Wn}from"./compiler-runtime-B3qBwwSJ.js";import{t as Mh}from"./debounce-OiXznToA.js";import{d as u_,f as k8,g as be,o as ud}from"./useEventListener-C0195JsF.js";import{t as zr}from"./objects-BlG0ZrO0.js";import{t as dn}from"./invariant-CkiqGLcK.js";import{b as C8,g as S8,h as d_,t as E8}from"./utils-BWBBpCkT.js";import{D as T8,M as dd,N as I8,O as A8,S as L8,r as D8}from"./config-B-Q7J_6d.js";import{n as O8,t as Fr}from"./cn-DYvqRARy.js";import{t as M8}from"./jsx-runtime-Blw4afVn.js";import{C as f_,T as R8,b as P8,d as N8,g as fd,h as j8,p as z8,v as p_,w as pa,x as ur,y as m_}from"./fullscreen-CTDqNQr6.js";import{l as h_,o as F8}from"./dist-BLN8PNJV.js";import{d as q8}from"./menu-items-CCi6aOPm.js";import{a as $8,c as V8,i as Rh,m as B8,n as H8,o as g_,r as W8,s as U8,t as K8}from"./select-BP75_5jJ.js";import{i as Q8,t as Ph}from"./tooltip-4bZlU7jl.js";import{t as y_}from"./button-DDGiD1NW.js";import{$t as eo,A as G8,C as X8,D as Y8,Gt as hl,H as Nh,Ht as pd,I as v_,Jt as b_,K as J8,Kt as w_,Nt as jh,Pt as x_,Qt as Cr,Rt as __,S as Z8,T as k_,Tt as qr,U as eD,Ut as Kt,W as tD,Wt as nD,X as md,Yt as Bs,Zt as Ln,_t as rD,at as St,b as C_,bt as S_,ct as E_,dt as aD,en as gl,f as T_,it as I_,jt as yl,k as iD,kt as A_,l as ee,ot as oD,p as lD,pt as sD,q as cD,qt as hd,st as ot,u as L_,ut as Un,wt as zh,z as D_}from"./dist-12S8I4CH.js";import{A as uD,C as dD,D as fD,E as pD,S as mD,T as hD,_ as gD,d as yD,h as vD,j as bD,k as wD,m as xD,n as _D,o as Fh,s as O_,t as kD,u as M_,v as CD,z as SD}from"./dist-CiVShZKM.js";import{a as Hs,i as qh,n as ED,p as $h,r as R_}from"./arrays-DbOq36rN.js";import{n as dr}from"./once-CGKw_kwj.js";import{t as TD}from"./capabilities-DoEg0XwL.js";import{t as ID}from"./cjs-D5tzp-Y6.js";import{t as vl}from"./createReducer-DGx5Af-C.js";import{d as AD,l as P_,n as LD,o as N_,p as DD,r as gd}from"./dist-DYEuVkEX.js";import{t as j_}from"./main-BNL5rxQw.js";import{n as yd,t as OD}from"./useNonce-CbdaHKzX.js";import{i as bl,r as MD,t as RD}from"./strings--BknHX9C.js";import{t as Kn}from"./requests-9-v2bhoi.js";import{a as PD,c as ND,d as jD,f as z_,i as zD,l as FD,n as qD,o as Vh,r as $D,s as vd,t as VD,u as BD}from"./dist-DI1-Z60I.js";import{t as lt}from"./createLucideIcon-w-Qo9n0R.js";import{a as Bh,i as HD,o as WD,r as UD,t as KD}from"./useLifecycle-lLOBhc-1.js";import{t as QD}from"./check-rzLRd0j9.js";import{t as GD}from"./x-C-Eq0ag8.js";import{t as XD,u as YD}from"./toDate-Ct2FT81-.js";import{t as Hh}from"./database-zap-CKO8g4BU.js";import{n as JD,t as wl}from"./DeferredRequestRegistry-C8EV1PoE.js";import{t as Qn}from"./badge-B92a4ePY.js";import{t as ne}from"./preload-helper-TXkS1QI3.js";import{a as F_,s as ZD}from"./dist-DcwTQG1A.js";import{a as q_,i as Wh,n as eO,r as $_,t as tO}from"./dist-CPjTeT8p.js";import{n as nO}from"./stex-FMMSUPAS.js";import{t as Ws}from"./use-toast-BwJoaaDM.js";import{n as V_}from"./paths-BKO-pHK6.js";import{n as rO}from"./useTheme-Bxv9B31g.js";import{t as Uh}from"./purify.es-CWmnYhGI.js";let Kh,Us,xl,bd,Qh,B_,Gh,Xh,Yh,H_,W_,Jh,U_,Zh,K_,Q_,e0,Ks,Qs,t0,G_,n0,X_,r0,wd,Y_,J_,xd,to,Z_,ek,a0,_d,i0,kd,o0,tk,l0,s0,nk,c0,u0,Gs,d0,f0,rk,Xs,p0,Cd,ak,m0,Sd,ik,Ed,Td,ok,h0,Id,g0,ma,fr,Ys,Js,_l,lk,sk,ck,yn,y0,v0,uk,no,we,ro,Zs,dk,ec,fk,b0,pk,mk,Ad,kl,Ld,Gn,hk,Cl,Dd,gk,w0,Xn,Sl,yk,x0,vk,bk,_0,ha,wk,Od,xk,_k,kk,k0,C0,Ck,oi,Sk,S0,E0,T0,I0,Ek,A0,L0,Tk,El,Ik,D0,Ak,O0,Lk,Dk,Ok,Md,M0,Tl,li,ao,$r,R0,Mk,tc,Rk,Rd,Pk,P0,Nk,jk,nc,zk,Fk,qk,N0,j0,$k,Vk,Bk,z0,F0,Hk,Wk,Uk,si,Pd,Kk,Nd,q0,jd,io,Qk,zd,Gk,Xk,vn,Yk,$0,V0,B0,Jk,Yn,Zk,eC,Fd,H0,tC,nC,ga,W0,rC,oo,aC,U0,st,K0,lo,Sr,rc,qd,Q0,G0,$d,X0,iC,Vd,oC,Y0,J0,lC,Z0,Bd,eg,sC,tg,cC,uC,ng,Hd,rg,Wd,dC,so,fC,Er,ag,Ud,ac,pC,Kd,mC,hC,gC,yC,vC,bC,wC,ig,xC,Qd,ya,ic,co,og,lg,_C,kC,CC,SC,EC,sg,cg,TC,ug,Gd,IC,dg,oc,AC,LC,DC,OC,MC,RC,PC,ci,fg,NC,Dn,jC,zC,lc,FC,qC,$C,VC,BC,pg,HC,WC,UC,KC,mg,hg,QC,GC,XC,Xd,Yd,Je,Jd,gg,yg,ui,Jn,YC,JC,vg,bg,ZC,aO=(async()=>{var xi,Vr,Ap,_i;let va,Tr,di;va=on((e=>{function t(ie,le){var K=ie.length;ie.push(le);e:for(;0<K;){var Le=K-1>>>1,Pe=ie[Le];if(0<l(Pe,le))ie[Le]=le,ie[K]=Pe,K=Le;else break e}}function r(ie){return ie.length===0?null:ie[0]}function i(ie){if(ie.length===0)return null;var le=ie[0],K=ie.pop();if(K!==le){ie[0]=K;e:for(var Le=0,Pe=ie.length,Ke=Pe>>>1;Le<Ke;){var Ve=2*(Le+1)-1,je=ie[Ve],De=Ve+1,ze=ie[De];if(0>l(je,K))De<Pe&&0>l(ze,je)?(ie[Le]=ze,ie[De]=K,Le=De):(ie[Le]=je,ie[Ve]=K,Le=Ve);else if(De<Pe&&0>l(ze,K))ie[Le]=ze,ie[De]=K,Le=De;else break e}}return le}function l(ie,le){var K=ie.sortIndex-le.sortIndex;return K===0?ie.id-le.id:K}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 h=[],b=[],x=1,C=null,S=3,E=!1,A=!1,R=!1,j=!1,q=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;function X(ie){for(var le=r(b);le!==null;){if(le.callback===null)i(b);else if(le.startTime<=ie)i(b),le.sortIndex=le.expirationTime,t(h,le);else break;le=r(b)}}function fe(ie){if(R=!1,X(ie),!A)if(r(h)!==null)A=!0,F||(F=!0,ke());else{var le=r(b);le!==null&&ye(fe,le.startTime-ie)}}var F=!1,H=-1,te=5,me=-1;function ve(){return j?!0:!(e.unstable_now()-me<te)}function _e(){if(j=!1,F){var ie=e.unstable_now();me=ie;var le=!0;try{e:{A=!1,R&&(R=!1,V(H),H=-1),E=!0;var K=S;try{t:{for(X(ie),C=r(h);C!==null&&!(C.expirationTime>ie&&ve());){var Le=C.callback;if(typeof Le=="function"){C.callback=null,S=C.priorityLevel;var Pe=Le(C.expirationTime<=ie);if(ie=e.unstable_now(),typeof Pe=="function"){C.callback=Pe,X(ie),le=!0;break t}C===r(h)&&i(h),X(ie)}else i(h);C=r(h)}if(C!==null)le=!0;else{var Ke=r(b);Ke!==null&&ye(fe,Ke.startTime-ie),le=!1}}break e}finally{C=null,S=K,E=!1}le=void 0}}finally{le?ke():F=!1}}}var ke;if(typeof z=="function")ke=function(){z(_e)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,ce=oe.port2;oe.port1.onmessage=_e,ke=function(){ce.postMessage(null)}}else ke=function(){q(_e,0)};function ye(ie,le){H=q(function(){ie(e.unstable_now())},le)}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(ie){ie.callback=null},e.unstable_forceFrameRate=function(ie){0>ie||125<ie?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):te=0<ie?Math.floor(1e3/ie):5},e.unstable_getCurrentPriorityLevel=function(){return S},e.unstable_next=function(ie){switch(S){case 1:case 2:case 3:var le=3;break;default:le=S}var K=S;S=le;try{return ie()}finally{S=K}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(ie,le){switch(ie){case 1:case 2:case 3:case 4:case 5:break;default:ie=3}var K=S;S=ie;try{return le()}finally{S=K}},e.unstable_scheduleCallback=function(ie,le,K){var Le=e.unstable_now();switch(typeof K=="object"&&K?(K=K.delay,K=typeof K=="number"&&0<K?Le+K:Le):K=Le,ie){case 1:var Pe=-1;break;case 2:Pe=250;break;case 5:Pe=1073741823;break;case 4:Pe=1e4;break;default:Pe=5e3}return Pe=K+Pe,ie={id:x++,callback:le,priorityLevel:ie,startTime:K,expirationTime:Pe,sortIndex:-1},K>Le?(ie.sortIndex=K,t(b,ie),r(h)===null&&ie===r(b)&&(R?(V(H),H=-1):R=!0,ye(fe,K-Le))):(ie.sortIndex=Pe,t(h,ie),A||E||(A=!0,F||(F=!0,ke()))),ie},e.unstable_shouldYield=ve,e.unstable_wrapCallback=function(ie){var le=S;return function(){var K=S;S=le;try{return ie.apply(this,arguments)}finally{S=K}}}})),Tr=on(((e,t)=>{t.exports=va()})),di=on((e=>{var t=Tr(),r=cd(),i=o_();function l(n){var a="https://react.dev/errors/"+n;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)a+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+n+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function d(n){var a=n,o=n;if(n.alternate)for(;a.return;)a=a.return;else{n=a;do a=n,a.flags&4098&&(o=a.return),n=a.return;while(n)}return a.tag===3?o:null}function f(n){if(n.tag===13){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function h(n){if(n.tag===31){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function b(n){if(d(n)!==n)throw Error(l(188))}function x(n){var a=n.alternate;if(!a){if(a=d(n),a===null)throw Error(l(188));return a===n?n:null}for(var o=n,s=a;;){var p=o.return;if(p===null)break;var g=p.alternate;if(g===null){if(s=p.return,s!==null){o=s;continue}break}if(p.child===g.child){for(g=p.child;g;){if(g===o)return b(p),n;if(g===s)return b(p),a;g=g.sibling}throw Error(l(188))}if(o.return!==s.return)o=p,s=g;else{for(var k=!1,I=p.child;I;){if(I===o){k=!0,o=p,s=g;break}if(I===s){k=!0,s=p,o=g;break}I=I.sibling}if(!k){for(I=g.child;I;){if(I===o){k=!0,o=g,s=p;break}if(I===s){k=!0,s=g,o=p;break}I=I.sibling}if(!k)throw Error(l(189))}}if(o.alternate!==s)throw Error(l(190))}if(o.tag!==3)throw Error(l(188));return o.stateNode.current===o?n:a}function C(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n;for(n=n.child;n!==null;){if(a=C(n),a!==null)return a;n=n.sibling}return null}var S=Object.assign,E=Symbol.for("react.element"),A=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),X=Symbol.for("react.context"),fe=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),me=Symbol.for("react.lazy"),ve=Symbol.for("react.activity"),_e=Symbol.for("react.memo_cache_sentinel"),ke=Symbol.iterator;function oe(n){return typeof n!="object"||!n?null:(n=ke&&n[ke]||n["@@iterator"],typeof n=="function"?n:null)}var ce=Symbol.for("react.client.reference");function ye(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===ce?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case j:return"Fragment";case V:return"Profiler";case q:return"StrictMode";case F:return"Suspense";case H:return"SuspenseList";case ve:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case R:return"Portal";case X:return n.displayName||"Context";case z:return(n._context.displayName||"Context")+".Consumer";case fe:var a=n.render;return n=n.displayName,n||(n=(n=a.displayName||a.name||"",n===""?"ForwardRef":"ForwardRef("+n+")")),n;case te:return a=n.displayName||null,a===null?ye(n.type)||"Memo":a;case me:a=n._payload,n=n._init;try{return ye(n(a))}catch{}}return null}var ie=Array.isArray,le=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Le={pending:!1,data:null,method:null,action:null},Pe=[],Ke=-1;function Ve(n){return{current:n}}function je(n){0>Ke||(n.current=Pe[Ke],Pe[Ke]=null,Ke--)}function De(n,a){Ke++,Pe[Ke]=n.current,n.current=a}var ze=Ve(null),Dt=Ve(null),jt=Ve(null),La=Ve(null);function Io(n,a){switch(De(jt,a),De(Dt,n),De(ze,null),a.nodeType){case 9:case 11:n=(n=a.documentElement)&&(n=n.namespaceURI)?Lx(n):0;break;default:if(n=a.tagName,a=a.namespaceURI)a=Lx(a),n=Dx(a,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}je(ze),De(ze,n)}function Pn(){je(ze),je(Dt),je(jt)}function Br(n){n.memoizedState!==null&&De(La,n);var a=ze.current,o=Dx(a,n.type);a!==o&&(De(Dt,n),De(ze,o))}function ki(n){Dt.current===n&&(je(ze),je(Dt)),La.current===n&&(je(La),Fs._currentValue=Le)}var Ao,Kl;function gt(n){if(Ao===void 0)try{throw Error()}catch(o){var a=o.stack.trim().match(/\n( *(at )?)/);Ao=a&&a[1]||"",Kl=-1<o.stack.indexOf(`
|
|
3
|
+
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
+
`+Ao+n+Kl}var Ql=!1;function _n(n,a){if(!n||Ql)return"";Ql=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(a){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(re){var J=re}Reflect.construct(n,[],de)}else{try{de.call()}catch(re){J=re}n.call(de.prototype)}}else{try{throw Error()}catch(re){J=re}(de=n())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(re){if(re&&J&&typeof re.stack=="string")return[re.stack,J.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=s.DetermineComponentFrameRoot(),k=g[0],I=g[1];if(k&&I){var N=k.split(`
|
|
5
|
+
`),G=I.split(`
|
|
6
|
+
`);for(p=s=0;s<N.length&&!N[s].includes("DetermineComponentFrameRoot");)s++;for(;p<G.length&&!G[p].includes("DetermineComponentFrameRoot");)p++;if(s===N.length||p===G.length)for(s=N.length-1,p=G.length-1;1<=s&&0<=p&&N[s]!==G[p];)p--;for(;1<=s&&0<=p;s--,p--)if(N[s]!==G[p]){if(s!==1||p!==1)do if(s--,p--,0>p||N[s]!==G[p]){var se=`
|
|
7
|
+
`+N[s].replace(" at new "," at ");return n.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",n.displayName)),se}while(1<=s&&0<=p);break}}}finally{Ql=!1,Error.prepareStackTrace=o}return(o=n?n.displayName||n.name:"")?gt(o):""}function Lp(n,a){switch(n.tag){case 26:case 27:case 5:return gt(n.type);case 16:return gt("Lazy");case 13:return n.child!==a&&a!==null?gt("Suspense Fallback"):gt("Suspense");case 19:return gt("SuspenseList");case 0:case 15:return _n(n.type,!1);case 11:return _n(n.type.render,!1);case 1:return _n(n.type,!0);case 31:return gt("Activity");default:return""}}function $c(n){try{var a="",o=null;do a+=Lp(n,o),o=n,n=n.return;while(n);return a}catch(s){return`
|
|
8
|
+
Error generating stack: `+s.message+`
|
|
9
|
+
`+s.stack}}var Lo=Object.prototype.hasOwnProperty,gr=t.unstable_scheduleCallback,kn=t.unstable_cancelCallback,Dp=t.unstable_shouldYield,Vc=t.unstable_requestPaint,Jt=t.unstable_now,Op=t.unstable_getCurrentPriorityLevel,Hr=t.unstable_ImmediatePriority,Bc=t.unstable_UserBlockingPriority,zt=t.unstable_NormalPriority,Do=t.unstable_LowPriority,Tt=t.unstable_IdlePriority,Mp=t.log,Rp=t.unstable_setDisableYieldValue,Ci=null,sn=null;function Xe(n){if(typeof Mp=="function"&&Rp(n),sn&&typeof sn.setStrictMode=="function")try{sn.setStrictMode(Ci,n)}catch{}}var yt=Math.clz32?Math.clz32:Dr,_t=Math.log,Zt=Math.LN2;function Dr(n){return n>>>=0,n===0?32:31-(_t(n)/Zt|0)|0}var Si=256,Ot=262144,Da=4194304;function Wr(n){var a=n&42;if(a!==0)return a;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Oo(n,a,o){var s=n.pendingLanes;if(s===0)return 0;var p=0,g=n.suspendedLanes,k=n.pingedLanes;n=n.warmLanes;var I=s&134217727;return I===0?(I=s&~g,I===0?k===0?o||(o=s&~n,o!==0&&(p=Wr(o))):p=Wr(k):p=Wr(I)):(s=I&~g,s===0?(k&=I,k===0?o||(o=I&~n,o!==0&&(p=Wr(o))):p=Wr(k)):p=Wr(s)),p===0?0:a!==0&&a!==p&&(a&g)===0&&(g=p&-p,o=a&-a,g>=o||g===32&&o&4194048)?a:p}function Oa(n,a){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&a)===0}function Hc(n,a){switch(n){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 Wc(){var n=Da;return Da<<=1,!(Da&62914560)&&(Da=4194304),n}function Gl(n){for(var a=[],o=0;31>o;o++)a.push(n);return a}function Ei(n,a){n.pendingLanes|=a,a!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Pp(n,a,o,s,p,g){var k=n.pendingLanes;n.pendingLanes=o,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=o,n.entangledLanes&=o,n.errorRecoveryDisabledLanes&=o,n.shellSuspendCounter=0;var I=n.entanglements,N=n.expirationTimes,G=n.hiddenUpdates;for(o=k&~o;0<o;){var se=31-yt(o),de=1<<se;I[se]=0,N[se]=-1;var J=G[se];if(J!==null)for(G[se]=null,se=0;se<J.length;se++){var re=J[se];re!==null&&(re.lane&=-536870913)}o&=~de}s!==0&&Ur(n,s,0),g!==0&&p===0&&n.tag!==0&&(n.suspendedLanes|=g&~(k&~a))}function Ur(n,a,o){n.pendingLanes|=a,n.suspendedLanes&=~a;var s=31-yt(a);n.entangledLanes|=a,n.entanglements[s]=n.entanglements[s]|1073741824|o&261930}function Mo(n,a){var o=n.entangledLanes|=a;for(n=n.entanglements;o;){var s=31-yt(o),p=1<<s;p&a|n[s]&a&&(n[s]|=a),o&=~p}}function Uc(n,a){var o=a&-a;return o=o&42?1:Nn(o),(o&(n.suspendedLanes|a))===0?o:0}function Nn(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Xl(n){return n&=-n,2<n?8<n?n&134217727?32:268435456:8:2}function Kc(){var n=K.p;return n===0?(n=window.event,n===void 0?32:Jx(n.type)):n}function jn(n,a){var o=K.p;try{return K.p=n,a()}finally{K.p=o}}var er=Math.random().toString(36).slice(2),Ht="__reactFiber$"+er,en="__reactProps$"+er,Ma="__reactContainer$"+er,Yl="__reactEvents$"+er,Qc="__reactListeners$"+er,Np="__reactHandles$"+er,Jl="__reactResources$"+er,Ti="__reactMarker$"+er;function Ro(n){delete n[Ht],delete n[en],delete n[Yl],delete n[Qc],delete n[Np]}function Or(n){var a=n[Ht];if(a)return a;for(var o=n.parentNode;o;){if(a=o[Ma]||o[Ht]){if(o=a.alternate,a.child!==null||o!==null&&o.child!==null)for(n=zx(n);n!==null;){if(o=n[Ht])return o;n=zx(n)}return a}n=o,o=n.parentNode}return null}function Ra(n){if(n=n[Ht]||n[Ma]){var a=n.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return n}return null}function pn(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n.stateNode;throw Error(l(33))}function Pa(n){var a=n[Jl];return a||(a=n[Jl]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Mt(n){n[Ti]=!0}var Zl=new Set,Gc={};function Mr(n,a){Na(n,a),Na(n+"Capture",a)}function Na(n,a){for(Gc[n]=a,n=0;n<a.length;n++)Zl.add(a[n])}var jp=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]*$"),Cn={},Xc={};function zp(n){return Lo.call(Xc,n)?!0:Lo.call(Cn,n)?!1:jp.test(n)?Xc[n]=!0:(Cn[n]=!0,!1)}function Ii(n,a,o){if(zp(a))if(o===null)n.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":n.removeAttribute(a);return;case"boolean":var s=a.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){n.removeAttribute(a);return}}n.setAttribute(a,""+o)}}function Ai(n,a,o){if(o===null)n.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(a);return}n.setAttribute(a,""+o)}}function yr(n,a,o,s){if(s===null)n.removeAttribute(o);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(o);return}n.setAttributeNS(a,o,""+s)}}function mn(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Yc(n){var a=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Jc(n,a,o){var s=Object.getOwnPropertyDescriptor(n.constructor.prototype,a);if(!n.hasOwnProperty(a)&&s!==void 0&&typeof s.get=="function"&&typeof s.set=="function"){var p=s.get,g=s.set;return Object.defineProperty(n,a,{configurable:!0,get:function(){return p.call(this)},set:function(k){o=""+k,g.call(this,k)}}),Object.defineProperty(n,a,{enumerable:s.enumerable}),{getValue:function(){return o},setValue:function(k){o=""+k},stopTracking:function(){n._valueTracker=null,delete n[a]}}}}function es(n){if(!n._valueTracker){var a=Yc(n)?"checked":"value";n._valueTracker=Jc(n,a,""+n[a])}}function ts(n){if(!n)return!1;var a=n._valueTracker;if(!a)return!0;var o=a.getValue(),s="";return n&&(s=Yc(n)?n.checked?"true":"false":n.value),n=s,n===o?!1:(a.setValue(n),!0)}function cn(n){if(n||(n=typeof document<"u"?document:void 0),n===void 0)return null;try{return n.activeElement||n.body}catch{return n.body}}var Ze=/[\n"\\]/g;function zn(n){return n.replace(Ze,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function ja(n,a,o,s,p,g,k,I){n.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?n.type=k:n.removeAttribute("type"),a==null?k!=="submit"&&k!=="reset"||n.removeAttribute("value"):k==="number"?(a===0&&n.value===""||n.value!=a)&&(n.value=""+mn(a)):n.value!==""+mn(a)&&(n.value=""+mn(a)),a==null?o==null?s!=null&&n.removeAttribute("value"):Kr(n,k,mn(o)):Kr(n,k,mn(a)),p==null&&g!=null&&(n.defaultChecked=!!g),p!=null&&(n.checked=p&&typeof p!="function"&&typeof p!="symbol"),I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?n.name=""+mn(I):n.removeAttribute("name")}function Zc(n,a,o,s,p,g,k,I){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.type=g),a!=null||o!=null){if(!(g!=="submit"&&g!=="reset"||a!=null)){es(n);return}o=o==null?"":""+mn(o),a=a==null?o:""+mn(a),I||a===n.value||(n.value=a),n.defaultValue=a}s??(s=p),s=typeof s!="function"&&typeof s!="symbol"&&!!s,n.checked=I?n.checked:!!s,n.defaultChecked=!!s,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(n.name=k),es(n)}function Kr(n,a,o){a==="number"&&cn(n.ownerDocument)===n||n.defaultValue===""+o||(n.defaultValue=""+o)}function za(n,a,o,s){if(n=n.options,a){a={};for(var p=0;p<o.length;p++)a["$"+o[p]]=!0;for(o=0;o<n.length;o++)p=a.hasOwnProperty("$"+n[o].value),n[o].selected!==p&&(n[o].selected=p),p&&s&&(n[o].defaultSelected=!0)}else{for(o=""+mn(o),a=null,p=0;p<n.length;p++){if(n[p].value===o){n[p].selected=!0,s&&(n[p].defaultSelected=!0);return}a!==null||n[p].disabled||(a=n[p])}a!==null&&(a.selected=!0)}}function Fa(n,a,o){if(a!=null&&(a=""+mn(a),a!==n.value&&(n.value=a),o==null)){n.defaultValue!==a&&(n.defaultValue=a);return}n.defaultValue=o==null?"":""+mn(o)}function Po(n,a,o,s){if(a==null){if(s!=null){if(o!=null)throw Error(l(92));if(ie(s)){if(1<s.length)throw Error(l(93));s=s[0]}o=s}o??(o=""),a=o}o=mn(a),n.defaultValue=o,s=n.textContent,s===o&&s!==""&&s!==null&&(n.value=s),es(n)}function Qr(n,a){if(a){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=a;return}}n.textContent=a}var Fp=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 Gr(n,a,o){var s=a.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?s?n.setProperty(a,""):a==="float"?n.cssFloat="":n[a]="":s?n.setProperty(a,o):typeof o!="number"||o===0||Fp.has(a)?a==="float"?n.cssFloat=o:n[a]=(""+o).trim():n[a]=o+"px"}function eu(n,a,o){if(a!=null&&typeof a!="object")throw Error(l(62));if(n=n.style,o!=null){for(var s in o)!o.hasOwnProperty(s)||a!=null&&a.hasOwnProperty(s)||(s.indexOf("--")===0?n.setProperty(s,""):s==="float"?n.cssFloat="":n[s]="");for(var p in a)s=a[p],a.hasOwnProperty(p)&&o[p]!==s&&Gr(n,p,s)}else for(var g in a)a.hasOwnProperty(g)&&Gr(n,g,a[g])}function Li(n){if(n.indexOf("-")===-1)return!1;switch(n){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 No=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"]]),tu=/^[\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 jo(n){return tu.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function tr(){}var Gt=null;function ns(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var hn=null,Rr=null;function nu(n){var a=Ra(n);if(a&&(n=a.stateNode)){var o=n[en]||null;e:switch(n=a.stateNode,a.type){case"input":if(ja(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),a=o.name,o.type==="radio"&&a!=null){for(o=n;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+zn(""+a)+'"][type="radio"]'),a=0;a<o.length;a++){var s=o[a];if(s!==n&&s.form===n.form){var p=s[en]||null;if(!p)throw Error(l(90));ja(s,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(a=0;a<o.length;a++)s=o[a],s.form===n.form&&ts(s)}break e;case"textarea":Fa(n,o.value,o.defaultValue);break e;case"select":a=o.value,a!=null&&za(n,!!o.multiple,a,!1)}}}var rs=!1;function ru(n,a,o){if(rs)return n(a,o);rs=!0;try{return n(a)}finally{if(rs=!1,(hn!==null||Rr!==null)&&($u(),hn&&(a=hn,n=Rr,Rr=hn=null,nu(a),n)))for(a=0;a<n.length;a++)nu(n[a])}}function Di(n,a){var o=n.stateNode;if(o===null)return null;var s=o[en]||null;if(s===null)return null;o=s[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(n=n.type,s=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!s;break e;default:n=!1}if(n)return null;if(o&&typeof o!="function")throw Error(l(231,a,typeof o));return o}var vr=!(typeof window>"u"||window.document===void 0||window.document.createElement===void 0),as=!1;if(vr)try{var Oi={};Object.defineProperty(Oi,"passive",{get:function(){as=!0}}),window.addEventListener("test",Oi,Oi),window.removeEventListener("test",Oi,Oi)}catch{as=!1}var br=null,zo=null,Mi=null;function is(){if(Mi)return Mi;var n,a=zo,o=a.length,s,p="value"in br?br.value:br.textContent,g=p.length;for(n=0;n<o&&a[n]===p[n];n++);var k=o-n;for(s=1;s<=k&&a[o-s]===p[g-s];s++);return Mi=p.slice(n,1<s?1-s:void 0)}function Ri(n){var a=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&a===13&&(n=13)):n=a,n===10&&(n=13),32<=n||n===13?n:0}function Pi(){return!0}function os(){return!1}function Xt(n){function a(o,s,p,g,k){for(var I in this._reactName=o,this._targetInst=p,this.type=s,this.nativeEvent=g,this.target=k,this.currentTarget=null,n)n.hasOwnProperty(I)&&(o=n[I],this[I]=o?o(g):g[I]);return this.isDefaultPrevented=(g.defaultPrevented==null?g.returnValue===!1:g.defaultPrevented)?Pi:os,this.isPropagationStopped=os,this}return S(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Pi)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Pi)},persist:function(){},isPersistent:Pi}),a}var Xr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},u=Xt(Xr),m=S({},Xr,{view:0,detail:0}),y=Xt(m),v,w,_,T=S({},m,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Re,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==_&&(_&&n.type==="mousemove"?(v=n.screenX-_.screenX,w=n.screenY-_.screenY):w=v=0,_=n),v)},movementY:function(n){return"movementY"in n?n.movementY:w}}),L=Xt(T),D=Xt(S({},T,{dataTransfer:0})),P=Xt(S({},m,{relatedTarget:0})),M=Xt(S({},Xr,{animationName:0,elapsedTime:0,pseudoElement:0})),Z=Xt(S({},Xr,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}})),Y=Xt(S({},Xr,{data:0})),W={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},U={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"},ge={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function he(n){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(n):(n=ge[n])?!!a[n]:!1}function Re(){return he}var Ce=Xt(S({},m,{key:function(n){if(n.key){var a=W[n.key]||n.key;if(a!=="Unidentified")return a}return n.type==="keypress"?(n=Ri(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?U[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Re,charCode:function(n){return n.type==="keypress"?Ri(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Ri(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}})),Oe=Xt(S({},T,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),et=Xt(S({},m,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Re})),Be=Xt(S({},Xr,{propertyName:0,elapsedTime:0,pseudoElement:0})),ft=Xt(S({},T,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0})),vt=Xt(S({},Xr,{newState:0,oldState:0})),Fe=[9,13,27,32],Ne=vr&&"CompositionEvent"in window,kt=null;vr&&"documentMode"in document&&(kt=document.documentMode);var Ft=vr&&"TextEvent"in window&&!kt,Wt=vr&&(!Ne||kt&&8<kt&&11>=kt),Ni=" ",au=!1;function iu(n,a){switch(n){case"keyup":return Fe.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fo(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var qo=!1;function RA(n,a){switch(n){case"compositionend":return Fo(a);case"keypress":return a.which===32?(au=!0,Ni):null;case"textInput":return n=a.data,n===Ni&&au?null:n;default:return null}}function PA(n,a){if(qo)return n==="compositionend"||!Ne&&iu(n,a)?(n=is(),Mi=zo=br=null,qo=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Wt&&a.locale!=="ko"?null:a.data;default:return null}}var NA={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 Bb(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a==="input"?!!NA[n.type]:a==="textarea"}function Hb(n,a,o,s){hn?Rr?Rr.push(s):Rr=[s]:hn=s,a=Qu(a,"onChange"),0<a.length&&(o=new u("onChange","change",null,o,s),n.push({event:o,listeners:a}))}var ls=null,ss=null;function jA(n){kx(n,0)}function ou(n){if(ts(pn(n)))return n}function Wb(n,a){if(n==="change")return a}var Ub=!1;if(vr){var qp;if(vr){var $p="oninput"in document;if(!$p){var Kb=document.createElement("div");Kb.setAttribute("oninput","return;"),$p=typeof Kb.oninput=="function"}qp=$p}else qp=!1;Ub=qp&&(!document.documentMode||9<document.documentMode)}function Qb(){ls&&(ls.detachEvent("onpropertychange",Gb),ss=ls=null)}function Gb(n){if(n.propertyName==="value"&&ou(ss)){var a=[];Hb(a,ss,n,ns(n)),ru(jA,a)}}function zA(n,a,o){n==="focusin"?(Qb(),ls=a,ss=o,ls.attachEvent("onpropertychange",Gb)):n==="focusout"&&Qb()}function FA(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return ou(ss)}function qA(n,a){if(n==="click")return ou(a)}function $A(n,a){if(n==="input"||n==="change")return ou(a)}function VA(n,a){return n===a&&(n!==0||1/n==1/a)||n!==n&&a!==a}var Fn=typeof Object.is=="function"?Object.is:VA;function cs(n,a){if(Fn(n,a))return!0;if(typeof n!="object"||!n||typeof a!="object"||!a)return!1;var o=Object.keys(n),s=Object.keys(a);if(o.length!==s.length)return!1;for(s=0;s<o.length;s++){var p=o[s];if(!Lo.call(a,p)||!Fn(n[p],a[p]))return!1}return!0}function Xb(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Yb(n,a){var o=Xb(n);n=0;for(var s;o;){if(o.nodeType===3){if(s=n+o.textContent.length,n<=a&&s>=a)return{node:o,offset:a-n};n=s}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Xb(o)}}function Jb(n,a){return n&&a?n===a?!0:n&&n.nodeType===3?!1:a&&a.nodeType===3?Jb(n,a.parentNode):"contains"in n?n.contains(a):n.compareDocumentPosition?!!(n.compareDocumentPosition(a)&16):!1:!1}function Zb(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var a=cn(n.document);a instanceof n.HTMLIFrameElement;){try{var o=typeof a.contentWindow.location.href=="string"}catch{o=!1}if(o)n=a.contentWindow;else break;a=cn(n.document)}return a}function Vp(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a&&(a==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||a==="textarea"||n.contentEditable==="true")}var BA=vr&&"documentMode"in document&&11>=document.documentMode,$o=null,Bp=null,us=null,Hp=!1;function e2(n,a,o){var s=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Hp||$o==null||$o!==cn(s)||(s=$o,"selectionStart"in s&&Vp(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),us&&cs(us,s)||(us=s,s=Qu(Bp,"onSelect"),0<s.length&&(a=new u("onSelect","select",null,a,o),n.push({event:a,listeners:s}),a.target=$o)))}function ji(n,a){var o={};return o[n.toLowerCase()]=a.toLowerCase(),o["Webkit"+n]="webkit"+a,o["Moz"+n]="moz"+a,o}var Vo={animationend:ji("Animation","AnimationEnd"),animationiteration:ji("Animation","AnimationIteration"),animationstart:ji("Animation","AnimationStart"),transitionrun:ji("Transition","TransitionRun"),transitionstart:ji("Transition","TransitionStart"),transitioncancel:ji("Transition","TransitionCancel"),transitionend:ji("Transition","TransitionEnd")},Wp={},t2={};vr&&(t2=document.createElement("div").style,"AnimationEvent"in window||(delete Vo.animationend.animation,delete Vo.animationiteration.animation,delete Vo.animationstart.animation),"TransitionEvent"in window||delete Vo.transitionend.transition);function zi(n){if(Wp[n])return Wp[n];if(!Vo[n])return n;var a=Vo[n],o;for(o in a)if(a.hasOwnProperty(o)&&o in t2)return Wp[n]=a[o];return n}var n2=zi("animationend"),r2=zi("animationiteration"),a2=zi("animationstart"),HA=zi("transitionrun"),WA=zi("transitionstart"),UA=zi("transitioncancel"),i2=zi("transitionend"),o2=new Map,Up="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(" ");Up.push("scrollEnd");function wr(n,a){o2.set(n,a),Mr(a,[n])}var lu=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},nr=[],Bo=0,Kp=0;function su(){for(var n=Bo,a=Kp=Bo=0;a<n;){var o=nr[a];nr[a++]=null;var s=nr[a];nr[a++]=null;var p=nr[a];nr[a++]=null;var g=nr[a];if(nr[a++]=null,s!==null&&p!==null){var k=s.pending;k===null?p.next=p:(p.next=k.next,k.next=p),s.pending=p}g!==0&&l2(o,p,g)}}function cu(n,a,o,s){nr[Bo++]=n,nr[Bo++]=a,nr[Bo++]=o,nr[Bo++]=s,Kp|=s,n.lanes|=s,n=n.alternate,n!==null&&(n.lanes|=s)}function Qp(n,a,o,s){return cu(n,a,o,s),uu(n)}function Fi(n,a){return cu(n,null,null,a),uu(n)}function l2(n,a,o){n.lanes|=o;var s=n.alternate;s!==null&&(s.lanes|=o);for(var p=!1,g=n.return;g!==null;)g.childLanes|=o,s=g.alternate,s!==null&&(s.childLanes|=o),g.tag===22&&(n=g.stateNode,n===null||n._visibility&1||(p=!0)),n=g,g=g.return;return n.tag===3?(g=n.stateNode,p&&a!==null&&(p=31-yt(o),n=g.hiddenUpdates,s=n[p],s===null?n[p]=[a]:s.push(a),a.lane=o|536870912),g):null}function uu(n){if(50<Os)throw Os=0,rh=null,Error(l(185));for(var a=n.return;a!==null;)n=a,a=n.return;return n.tag===3?n.stateNode:null}var Ho={};function KA(n,a,o,s){this.tag=n,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qn(n,a,o,s){return new KA(n,a,o,s)}function Gp(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Yr(n,a){var o=n.alternate;return o===null?(o=qn(n.tag,a,n.key,n.mode),o.elementType=n.elementType,o.type=n.type,o.stateNode=n.stateNode,o.alternate=n,n.alternate=o):(o.pendingProps=a,o.type=n.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=n.flags&65011712,o.childLanes=n.childLanes,o.lanes=n.lanes,o.child=n.child,o.memoizedProps=n.memoizedProps,o.memoizedState=n.memoizedState,o.updateQueue=n.updateQueue,a=n.dependencies,o.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},o.sibling=n.sibling,o.index=n.index,o.ref=n.ref,o.refCleanup=n.refCleanup,o}function s2(n,a){n.flags&=65011714;var o=n.alternate;return o===null?(n.childLanes=0,n.lanes=a,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=o.childLanes,n.lanes=o.lanes,n.child=o.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=o.memoizedProps,n.memoizedState=o.memoizedState,n.updateQueue=o.updateQueue,n.type=o.type,a=o.dependencies,n.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),n}function du(n,a,o,s,p,g){var k=0;if(s=n,typeof n=="function")Gp(n)&&(k=1);else if(typeof n=="string")k=ZL(n,o,ze.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case ve:return n=qn(31,o,a,p),n.elementType=ve,n.lanes=g,n;case j:return qi(o.children,p,g,a);case q:k=8,p|=24;break;case V:return n=qn(12,o,a,p|2),n.elementType=V,n.lanes=g,n;case F:return n=qn(13,o,a,p),n.elementType=F,n.lanes=g,n;case H:return n=qn(19,o,a,p),n.elementType=H,n.lanes=g,n;default:if(typeof n=="object"&&n)switch(n.$$typeof){case X:k=10;break e;case z:k=9;break e;case fe:k=11;break e;case te:k=14;break e;case me:k=16,s=null;break e}k=29,o=Error(l(130,n===null?"null":typeof n,"")),s=null}return a=qn(k,o,a,p),a.elementType=n,a.type=s,a.lanes=g,a}function qi(n,a,o,s){return n=qn(7,n,s,a),n.lanes=o,n}function Xp(n,a,o){return n=qn(6,n,null,a),n.lanes=o,n}function c2(n){var a=qn(18,null,null,0);return a.stateNode=n,a}function Yp(n,a,o){return a=qn(4,n.children===null?[]:n.children,n.key,a),a.lanes=o,a.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},a}var u2=new WeakMap;function rr(n,a){if(typeof n=="object"&&n){var o=u2.get(n);return o===void 0?(a={value:n,source:a,stack:$c(a)},u2.set(n,a),a):o}return{value:n,source:a,stack:$c(a)}}var Wo=[],Uo=0,fu=null,ds=0,ar=[],ir=0,qa=null,Pr=1,Nr="";function Jr(n,a){Wo[Uo++]=ds,Wo[Uo++]=fu,fu=n,ds=a}function d2(n,a,o){ar[ir++]=Pr,ar[ir++]=Nr,ar[ir++]=qa,qa=n;var s=Pr;n=Nr;var p=32-yt(s)-1;s&=~(1<<p),o+=1;var g=32-yt(a)+p;if(30<g){var k=p-p%5;g=(s&(1<<k)-1).toString(32),s>>=k,p-=k,Pr=1<<32-yt(a)+p|o<<p|s,Nr=g+n}else Pr=1<<g|o<<p|s,Nr=n}function Jp(n){n.return!==null&&(Jr(n,1),d2(n,1,0))}function Zp(n){for(;n===fu;)fu=Wo[--Uo],Wo[Uo]=null,ds=Wo[--Uo],Wo[Uo]=null;for(;n===qa;)qa=ar[--ir],ar[ir]=null,Nr=ar[--ir],ar[ir]=null,Pr=ar[--ir],ar[ir]=null}function f2(n,a){ar[ir++]=Pr,ar[ir++]=Nr,ar[ir++]=qa,Pr=a.id,Nr=a.overflow,qa=n}var tn=null,bt=null,Ye=!1,$a=null,or=!1,em=Error(l(519));function Va(n){throw fs(rr(Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML","")),n)),em}function p2(n){var a=n.stateNode,o=n.type,s=n.memoizedProps;switch(a[Ht]=n,a[en]=s,o){case"dialog":Ue("cancel",a),Ue("close",a);break;case"iframe":case"object":case"embed":Ue("load",a);break;case"video":case"audio":for(o=0;o<Rs.length;o++)Ue(Rs[o],a);break;case"source":Ue("error",a);break;case"img":case"image":case"link":Ue("error",a),Ue("load",a);break;case"details":Ue("toggle",a);break;case"input":Ue("invalid",a),Zc(a,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Ue("invalid",a);break;case"textarea":Ue("invalid",a),Po(a,s.value,s.defaultValue,s.children)}o=s.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||a.textContent===""+o||s.suppressHydrationWarning===!0||Ix(a.textContent,o)?(s.popover!=null&&(Ue("beforetoggle",a),Ue("toggle",a)),s.onScroll!=null&&Ue("scroll",a),s.onScrollEnd!=null&&Ue("scrollend",a),s.onClick!=null&&(a.onclick=tr),a=!0):a=!1,a||Va(n,!0)}function m2(n){for(tn=n.return;tn;)switch(tn.tag){case 5:case 31:case 13:or=!1;return;case 27:case 3:or=!0;return;default:tn=tn.return}}function Ko(n){if(n!==tn)return!1;if(!Ye)return m2(n),Ye=!0,!1;var a=n.tag,o;if((o=a!==3&&a!==27)&&((o=a===5)&&(o=n.type,o=!(o!=="form"&&o!=="button")||yh(n.type,n.memoizedProps)),o=!o),o&&bt&&Va(n),m2(n),a===13){if(n=n.memoizedState,n=n===null?null:n.dehydrated,!n)throw Error(l(317));bt=jx(n)}else if(a===31){if(n=n.memoizedState,n=n===null?null:n.dehydrated,!n)throw Error(l(317));bt=jx(n)}else a===27?(a=bt,ei(n.type)?(n=_h,_h=null,bt=n):bt=a):bt=tn?sr(n.stateNode.nextSibling):null;return!0}function $i(){bt=tn=null,Ye=!1}function tm(){var n=$a;return n!==null&&(In===null?In=n:In.push.apply(In,n),$a=null),n}function fs(n){$a===null?$a=[n]:$a.push(n)}var nm=Ve(null),Vi=null,Zr=null;function Ba(n,a,o){De(nm,a._currentValue),a._currentValue=o}function ea(n){n._currentValue=nm.current,je(nm)}function rm(n,a,o){for(;n!==null;){var s=n.alternate;if((n.childLanes&a)===a?s!==null&&(s.childLanes&a)!==a&&(s.childLanes|=a):(n.childLanes|=a,s!==null&&(s.childLanes|=a)),n===o)break;n=n.return}}function am(n,a,o,s){var p=n.child;for(p!==null&&(p.return=n);p!==null;){var g=p.dependencies;if(g!==null){var k=p.child;g=g.firstContext;e:for(;g!==null;){var I=g;g=p;for(var N=0;N<a.length;N++)if(I.context===a[N]){g.lanes|=o,I=g.alternate,I!==null&&(I.lanes|=o),rm(g.return,o,n),s||(k=null);break e}g=I.next}}else if(p.tag===18){if(k=p.return,k===null)throw Error(l(341));k.lanes|=o,g=k.alternate,g!==null&&(g.lanes|=o),rm(k,o,n),k=null}else k=p.child;if(k!==null)k.return=p;else for(k=p;k!==null;){if(k===n){k=null;break}if(p=k.sibling,p!==null){p.return=k.return,k=p;break}k=k.return}p=k}}function Qo(n,a,o,s){n=null;for(var p=a,g=!1;p!==null;){if(!g){if(p.flags&524288)g=!0;else if(p.flags&262144)break}if(p.tag===10){var k=p.alternate;if(k===null)throw Error(l(387));if(k=k.memoizedProps,k!==null){var I=p.type;Fn(p.pendingProps.value,k.value)||(n===null?n=[I]:n.push(I))}}else if(p===La.current){if(k=p.alternate,k===null)throw Error(l(387));k.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(n===null?n=[Fs]:n.push(Fs))}p=p.return}n!==null&&am(a,n,o,s),a.flags|=262144}function pu(n){for(n=n.firstContext;n!==null;){if(!Fn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Bi(n){Vi=n,Zr=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function nn(n){return h2(Vi,n)}function mu(n,a){return Vi===null&&Bi(n),h2(n,a)}function h2(n,a){var o=a._currentValue;if(a={context:a,memoizedValue:o,next:null},Zr===null){if(n===null)throw Error(l(308));Zr=a,n.dependencies={lanes:0,firstContext:a},n.flags|=524288}else Zr=Zr.next=a;return o}var QA=typeof AbortController<"u"?AbortController:function(){var n=[],a=this.signal={aborted:!1,addEventListener:function(o,s){n.push(s)}};this.abort=function(){a.aborted=!0,n.forEach(function(o){return o()})}},GA=t.unstable_scheduleCallback,XA=t.unstable_NormalPriority,qt={$$typeof:X,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function im(){return{controller:new QA,data:new Map,refCount:0}}function ps(n){n.refCount--,n.refCount===0&&GA(XA,function(){n.controller.abort()})}var ms=null,om=0,Go=0,Xo=null;function YA(n,a){if(ms===null){var o=ms=[];om=0,Go=ch(),Xo={status:"pending",value:void 0,then:function(s){o.push(s)}}}return om++,a.then(g2,g2),a}function g2(){if(--om===0&&ms!==null){Xo!==null&&(Xo.status="fulfilled");var n=ms;ms=null,Go=0,Xo=null;for(var a=0;a<n.length;a++)(0,n[a])()}}function JA(n,a){var o=[],s={status:"pending",value:null,reason:null,then:function(p){o.push(p)}};return n.then(function(){s.status="fulfilled",s.value=a;for(var p=0;p<o.length;p++)(0,o[p])(a)},function(p){for(s.status="rejected",s.reason=p,p=0;p<o.length;p++)(0,o[p])(void 0)}),s}var y2=le.S;le.S=function(n,a){Yw=Jt(),typeof a=="object"&&a&&typeof a.then=="function"&&YA(n,a),y2!==null&&y2(n,a)};var Hi=Ve(null);function lm(){var n=Hi.current;return n===null?pt.pooledCache:n}function hu(n,a){a===null?De(Hi,Hi.current):De(Hi,a.pool)}function v2(){var n=lm();return n===null?null:{parent:qt._currentValue,pool:n}}var Yo=Error(l(460)),sm=Error(l(474)),gu=Error(l(542)),yu={then:function(){}};function b2(n){return n=n.status,n==="fulfilled"||n==="rejected"}function w2(n,a,o){switch(o=n[o],o===void 0?n.push(a):o!==a&&(a.then(tr,tr),a=o),a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,_2(n),n;default:if(typeof a.status=="string")a.then(tr,tr);else{if(n=pt,n!==null&&100<n.shellSuspendCounter)throw Error(l(482));n=a,n.status="pending",n.then(function(s){if(a.status==="pending"){var p=a;p.status="fulfilled",p.value=s}},function(s){if(a.status==="pending"){var p=a;p.status="rejected",p.reason=s}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,_2(n),n}throw Ui=a,Yo}}function Wi(n){try{var a=n._init;return a(n._payload)}catch(o){throw typeof o=="object"&&o&&typeof o.then=="function"?(Ui=o,Yo):o}}var Ui=null;function x2(){if(Ui===null)throw Error(l(459));var n=Ui;return Ui=null,n}function _2(n){if(n===Yo||n===gu)throw Error(l(483))}var Jo=null,hs=0;function vu(n){var a=hs;return hs+=1,Jo===null&&(Jo=[]),w2(Jo,n,a)}function gs(n,a){a=a.props.ref,n.ref=a===void 0?null:a}function bu(n,a){throw a.$$typeof===E?Error(l(525)):(n=Object.prototype.toString.call(a),Error(l(31,n==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":n)))}function k2(n){function a(B,$){if(n){var Q=B.deletions;Q===null?(B.deletions=[$],B.flags|=16):Q.push($)}}function o(B,$){if(!n)return null;for(;$!==null;)a(B,$),$=$.sibling;return null}function s(B){for(var $=new Map;B!==null;)B.key===null?$.set(B.index,B):$.set(B.key,B),B=B.sibling;return $}function p(B,$){return B=Yr(B,$),B.index=0,B.sibling=null,B}function g(B,$,Q){return B.index=Q,n?(Q=B.alternate,Q===null?(B.flags|=67108866,$):(Q=Q.index,Q<$?(B.flags|=67108866,$):Q)):(B.flags|=1048576,$)}function k(B){return n&&B.alternate===null&&(B.flags|=67108866),B}function I(B,$,Q,ue){return $===null||$.tag!==6?($=Xp(Q,B.mode,ue),$.return=B,$):($=p($,Q),$.return=B,$)}function N(B,$,Q,ue){var Ae=Q.type;return Ae===j?se(B,$,Q.props.children,ue,Q.key):$!==null&&($.elementType===Ae||typeof Ae=="object"&&Ae&&Ae.$$typeof===me&&Wi(Ae)===$.type)?($=p($,Q.props),gs($,Q),$.return=B,$):($=du(Q.type,Q.key,Q.props,null,B.mode,ue),gs($,Q),$.return=B,$)}function G(B,$,Q,ue){return $===null||$.tag!==4||$.stateNode.containerInfo!==Q.containerInfo||$.stateNode.implementation!==Q.implementation?($=Yp(Q,B.mode,ue),$.return=B,$):($=p($,Q.children||[]),$.return=B,$)}function se(B,$,Q,ue,Ae){return $===null||$.tag!==7?($=qi(Q,B.mode,ue,Ae),$.return=B,$):($=p($,Q),$.return=B,$)}function de(B,$,Q){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Xp(""+$,B.mode,Q),$.return=B,$;if(typeof $=="object"&&$){switch($.$$typeof){case A:return Q=du($.type,$.key,$.props,null,B.mode,Q),gs(Q,$),Q.return=B,Q;case R:return $=Yp($,B.mode,Q),$.return=B,$;case me:return $=Wi($),de(B,$,Q)}if(ie($)||oe($))return $=qi($,B.mode,Q,null),$.return=B,$;if(typeof $.then=="function")return de(B,vu($),Q);if($.$$typeof===X)return de(B,mu(B,$),Q);bu(B,$)}return null}function J(B,$,Q,ue){var Ae=$===null?null:$.key;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ae===null?I(B,$,""+Q,ue):null;if(typeof Q=="object"&&Q){switch(Q.$$typeof){case A:return Q.key===Ae?N(B,$,Q,ue):null;case R:return Q.key===Ae?G(B,$,Q,ue):null;case me:return Q=Wi(Q),J(B,$,Q,ue)}if(ie(Q)||oe(Q))return Ae===null?se(B,$,Q,ue,null):null;if(typeof Q.then=="function")return J(B,$,vu(Q),ue);if(Q.$$typeof===X)return J(B,$,mu(B,Q),ue);bu(B,Q)}return null}function re(B,$,Q,ue,Ae){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return B=B.get(Q)||null,I($,B,""+ue,Ae);if(typeof ue=="object"&&ue){switch(ue.$$typeof){case A:return B=B.get(ue.key===null?Q:ue.key)||null,N($,B,ue,Ae);case R:return B=B.get(ue.key===null?Q:ue.key)||null,G($,B,ue,Ae);case me:return ue=Wi(ue),re(B,$,Q,ue,Ae)}if(ie(ue)||oe(ue))return B=B.get(Q)||null,se($,B,ue,Ae,null);if(typeof ue.then=="function")return re(B,$,Q,vu(ue),Ae);if(ue.$$typeof===X)return re(B,$,Q,mu($,ue),Ae);bu($,ue)}return null}function Se(B,$,Q,ue){for(var Ae=null,rt=null,Ee=$,$e=$=0,Ge=null;Ee!==null&&$e<Q.length;$e++){Ee.index>$e?(Ge=Ee,Ee=null):Ge=Ee.sibling;var tt=J(B,Ee,Q[$e],ue);if(tt===null){Ee===null&&(Ee=Ge);break}n&&Ee&&tt.alternate===null&&a(B,Ee),$=g(tt,$,$e),rt===null?Ae=tt:rt.sibling=tt,rt=tt,Ee=Ge}if($e===Q.length)return o(B,Ee),Ye&&Jr(B,$e),Ae;if(Ee===null){for(;$e<Q.length;$e++)Ee=de(B,Q[$e],ue),Ee!==null&&($=g(Ee,$,$e),rt===null?Ae=Ee:rt.sibling=Ee,rt=Ee);return Ye&&Jr(B,$e),Ae}for(Ee=s(Ee);$e<Q.length;$e++)Ge=re(Ee,B,$e,Q[$e],ue),Ge!==null&&(n&&Ge.alternate!==null&&Ee.delete(Ge.key===null?$e:Ge.key),$=g(Ge,$,$e),rt===null?Ae=Ge:rt.sibling=Ge,rt=Ge);return n&&Ee.forEach(function(ii){return a(B,ii)}),Ye&&Jr(B,$e),Ae}function Me(B,$,Q,ue){if(Q==null)throw Error(l(151));for(var Ae=null,rt=null,Ee=$,$e=$=0,Ge=null,tt=Q.next();Ee!==null&&!tt.done;$e++,tt=Q.next()){Ee.index>$e?(Ge=Ee,Ee=null):Ge=Ee.sibling;var ii=J(B,Ee,tt.value,ue);if(ii===null){Ee===null&&(Ee=Ge);break}n&&Ee&&ii.alternate===null&&a(B,Ee),$=g(ii,$,$e),rt===null?Ae=ii:rt.sibling=ii,rt=ii,Ee=Ge}if(tt.done)return o(B,Ee),Ye&&Jr(B,$e),Ae;if(Ee===null){for(;!tt.done;$e++,tt=Q.next())tt=de(B,tt.value,ue),tt!==null&&($=g(tt,$,$e),rt===null?Ae=tt:rt.sibling=tt,rt=tt);return Ye&&Jr(B,$e),Ae}for(Ee=s(Ee);!tt.done;$e++,tt=Q.next())tt=re(Ee,B,$e,tt.value,ue),tt!==null&&(n&&tt.alternate!==null&&Ee.delete(tt.key===null?$e:tt.key),$=g(tt,$,$e),rt===null?Ae=tt:rt.sibling=tt,rt=tt);return n&&Ee.forEach(function(p8){return a(B,p8)}),Ye&&Jr(B,$e),Ae}function dt(B,$,Q,ue){if(typeof Q=="object"&&Q&&Q.type===j&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q){switch(Q.$$typeof){case A:e:{for(var Ae=Q.key;$!==null;){if($.key===Ae){if(Ae=Q.type,Ae===j){if($.tag===7){o(B,$.sibling),ue=p($,Q.props.children),ue.return=B,B=ue;break e}}else if($.elementType===Ae||typeof Ae=="object"&&Ae&&Ae.$$typeof===me&&Wi(Ae)===$.type){o(B,$.sibling),ue=p($,Q.props),gs(ue,Q),ue.return=B,B=ue;break e}o(B,$);break}else a(B,$);$=$.sibling}Q.type===j?(ue=qi(Q.props.children,B.mode,ue,Q.key),ue.return=B,B=ue):(ue=du(Q.type,Q.key,Q.props,null,B.mode,ue),gs(ue,Q),ue.return=B,B=ue)}return k(B);case R:e:{for(Ae=Q.key;$!==null;){if($.key===Ae)if($.tag===4&&$.stateNode.containerInfo===Q.containerInfo&&$.stateNode.implementation===Q.implementation){o(B,$.sibling),ue=p($,Q.children||[]),ue.return=B,B=ue;break e}else{o(B,$);break}else a(B,$);$=$.sibling}ue=Yp(Q,B.mode,ue),ue.return=B,B=ue}return k(B);case me:return Q=Wi(Q),dt(B,$,Q,ue)}if(ie(Q))return Se(B,$,Q,ue);if(oe(Q)){if(Ae=oe(Q),typeof Ae!="function")throw Error(l(150));return Q=Ae.call(Q),Me(B,$,Q,ue)}if(typeof Q.then=="function")return dt(B,$,vu(Q),ue);if(Q.$$typeof===X)return dt(B,$,mu(B,Q),ue);bu(B,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,$!==null&&$.tag===6?(o(B,$.sibling),ue=p($,Q),ue.return=B,B=ue):(o(B,$),ue=Xp(Q,B.mode,ue),ue.return=B,B=ue),k(B)):o(B,$)}return function(B,$,Q,ue){try{hs=0;var Ae=dt(B,$,Q,ue);return Jo=null,Ae}catch(Ee){if(Ee===Yo||Ee===gu)throw Ee;var rt=qn(29,Ee,null,B.mode);return rt.lanes=ue,rt.return=B,rt}}}var Ki=k2(!0),C2=k2(!1),Ha=!1;function cm(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function um(n,a){n=n.updateQueue,a.updateQueue===n&&(a.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Qi(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Gi(n,a,o){var s=n.updateQueue;if(s===null)return null;if(s=s.shared,nt&2){var p=s.pending;return p===null?a.next=a:(a.next=p.next,p.next=a),s.pending=a,a=uu(n),l2(n,null,o),a}return cu(n,s,a,o),uu(n)}function ys(n,a,o){if(a=a.updateQueue,a!==null&&(a=a.shared,o&4194048)){var s=a.lanes;s&=n.pendingLanes,o|=s,a.lanes=o,Mo(n,o)}}function dm(n,a){var o=n.updateQueue,s=n.alternate;if(s!==null&&(s=s.updateQueue,o===s)){var p=null,g=null;if(o=o.firstBaseUpdate,o!==null){do{var k={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};g===null?p=g=k:g=g.next=k,o=o.next}while(o!==null);g===null?p=g=a:g=g.next=a}else p=g=a;o={baseState:s.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:s.shared,callbacks:s.callbacks},n.updateQueue=o;return}n=o.lastBaseUpdate,n===null?o.firstBaseUpdate=a:n.next=a,o.lastBaseUpdate=a}var fm=!1;function vs(){if(fm){var n=Xo;if(n!==null)throw n}}function bs(n,a,o,s){fm=!1;var p=n.updateQueue;Ha=!1;var g=p.firstBaseUpdate,k=p.lastBaseUpdate,I=p.shared.pending;if(I!==null){p.shared.pending=null;var N=I,G=N.next;N.next=null,k===null?g=G:k.next=G,k=N;var se=n.alternate;se!==null&&(se=se.updateQueue,I=se.lastBaseUpdate,I!==k&&(I===null?se.firstBaseUpdate=G:I.next=G,se.lastBaseUpdate=N))}if(g!==null){var de=p.baseState;k=0,se=G=N=null,I=g;do{var J=I.lane&-536870913,re=J!==I.lane;if(re?(Qe&J)===J:(s&J)===J){J!==0&&J===Go&&(fm=!0),se!==null&&(se=se.next={lane:0,tag:I.tag,payload:I.payload,callback:null,next:null});e:{var Se=n,Me=I;J=a;var dt=o;switch(Me.tag){case 1:if(Se=Me.payload,typeof Se=="function"){de=Se.call(dt,de,J);break e}de=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Me.payload,J=typeof Se=="function"?Se.call(dt,de,J):Se,J==null)break e;de=S({},de,J);break e;case 2:Ha=!0}}J=I.callback,J!==null&&(n.flags|=64,re&&(n.flags|=8192),re=p.callbacks,re===null?p.callbacks=[J]:re.push(J))}else re={lane:J,tag:I.tag,payload:I.payload,callback:I.callback,next:null},se===null?(G=se=re,N=de):se=se.next=re,k|=J;if(I=I.next,I===null){if(I=p.shared.pending,I===null)break;re=I,I=re.next,re.next=null,p.lastBaseUpdate=re,p.shared.pending=null}}while(!0);se===null&&(N=de),p.baseState=N,p.firstBaseUpdate=G,p.lastBaseUpdate=se,g===null&&(p.shared.lanes=0),Ga|=k,n.lanes=k,n.memoizedState=de}}function S2(n,a){if(typeof n!="function")throw Error(l(191,n));n.call(a)}function E2(n,a){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)S2(o[n],a)}var Zo=Ve(null),wu=Ve(0);function T2(n,a){n=ca,De(wu,n),De(Zo,a),ca=n|a.baseLanes}function pm(){De(wu,ca),De(Zo,Zo.current)}function mm(){ca=wu.current,je(Zo),je(wu)}var $n=Ve(null),xr=null;function Wa(n){var a=n.alternate;De(Rt,Rt.current&1),De($n,n),xr===null&&(a===null||Zo.current!==null||a.memoizedState!==null)&&(xr=n)}function hm(n){De(Rt,Rt.current),De($n,n),xr===null&&(xr=n)}function I2(n){n.tag===22?(De(Rt,Rt.current),De($n,n),xr===null&&(xr=n)):Ua(n)}function Ua(){De(Rt,Rt.current),De($n,$n.current)}function Vn(n){je($n),xr===n&&(xr=null),je(Rt)}var Rt=Ve(0);function xu(n){for(var a=n;a!==null;){if(a.tag===13){var o=a.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||wh(o)||xh(o)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if(a.flags&128)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===n)break;for(;a.sibling===null;){if(a.return===null||a.return===n)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var ta=0,qe=null,ct=null,$t=null,_u=!1,el=!1,Xi=!1,ku=0,ws=0,tl=null,ZA=0;function It(){throw Error(l(321))}function gm(n,a){if(a===null)return!1;for(var o=0;o<a.length&&o<n.length;o++)if(!Fn(n[o],a[o]))return!1;return!0}function ym(n,a,o,s,p,g){return ta=g,qe=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,le.H=n===null||n.memoizedState===null?dw:Om,Xi=!1,g=o(s,p),Xi=!1,el&&(g=L2(a,o,s,p)),A2(n),g}function A2(n){le.H=ks;var a=ct!==null&&ct.next!==null;if(ta=0,$t=ct=qe=null,_u=!1,ws=0,tl=null,a)throw Error(l(300));n===null||Vt||(n=n.dependencies,n!==null&&pu(n)&&(Vt=!0))}function L2(n,a,o,s){qe=n;var p=0;do{if(el&&(tl=null),ws=0,el=!1,25<=p)throw Error(l(301));if(p+=1,$t=ct=null,n.updateQueue!=null){var g=n.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}le.H=fw,g=a(o,s)}while(el);return g}function eL(){var n=le.H,a=n.useState()[0];return a=typeof a.then=="function"?xs(a):a,n=n.useState()[0],(ct===null?null:ct.memoizedState)!==n&&(qe.flags|=1024),a}function vm(){var n=ku!==0;return ku=0,n}function bm(n,a,o){a.updateQueue=n.updateQueue,a.flags&=-2053,n.lanes&=~o}function wm(n){if(_u){for(n=n.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}_u=!1}ta=0,$t=ct=qe=null,el=!1,ws=ku=0,tl=null}function gn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?qe.memoizedState=$t=n:$t=$t.next=n,$t}function Pt(){if(ct===null){var n=qe.alternate;n=n===null?null:n.memoizedState}else n=ct.next;var a=$t===null?qe.memoizedState:$t.next;if(a!==null)$t=a,ct=n;else{if(n===null)throw qe.alternate===null?Error(l(467)):Error(l(310));ct=n,n={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},$t===null?qe.memoizedState=$t=n:$t=$t.next=n}return $t}function Cu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xs(n){var a=ws;return ws+=1,tl===null&&(tl=[]),n=w2(tl,n,a),a=qe,($t===null?a.memoizedState:$t.next)===null&&(a=a.alternate,le.H=a===null||a.memoizedState===null?dw:Om),n}function Su(n){if(typeof n=="object"&&n){if(typeof n.then=="function")return xs(n);if(n.$$typeof===X)return nn(n)}throw Error(l(438,String(n)))}function xm(n){var a=null,o=qe.updateQueue;if(o!==null&&(a=o.memoCache),a==null){var s=qe.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(a={data:s.data.map(function(p){return p.slice()}),index:0})))}if(a??(a={data:[],index:0}),o===null&&(o=Cu(),qe.updateQueue=o),o.memoCache=a,o=a.data[a.index],o===void 0)for(o=a.data[a.index]=Array(n),s=0;s<n;s++)o[s]=_e;return a.index++,o}function na(n,a){return typeof a=="function"?a(n):a}function Eu(n){return _m(Pt(),ct,n)}function _m(n,a,o){var s=n.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=o;var p=n.baseQueue,g=s.pending;if(g!==null){if(p!==null){var k=p.next;p.next=g.next,g.next=k}a.baseQueue=p=g,s.pending=null}if(g=n.baseState,p===null)n.memoizedState=g;else{a=p.next;var I=k=null,N=null,G=a,se=!1;do{var de=G.lane&-536870913;if(de===G.lane?(ta&de)===de:(Qe&de)===de){var J=G.revertLane;if(J===0)N!==null&&(N=N.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),de===Go&&(se=!0);else if((ta&J)===J){G=G.next,J===Go&&(se=!0);continue}else de={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},N===null?(I=N=de,k=g):N=N.next=de,qe.lanes|=J,Ga|=J;de=G.action,Xi&&o(g,de),g=G.hasEagerState?G.eagerState:o(g,de)}else J={lane:de,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},N===null?(I=N=J,k=g):N=N.next=J,qe.lanes|=de,Ga|=de;G=G.next}while(G!==null&&G!==a);if(N===null?k=g:N.next=I,!Fn(g,n.memoizedState)&&(Vt=!0,se&&(o=Xo,o!==null)))throw o;n.memoizedState=g,n.baseState=k,n.baseQueue=N,s.lastRenderedState=g}return p===null&&(s.lanes=0),[n.memoizedState,s.dispatch]}function km(n){var a=Pt(),o=a.queue;if(o===null)throw Error(l(311));o.lastRenderedReducer=n;var s=o.dispatch,p=o.pending,g=a.memoizedState;if(p!==null){o.pending=null;var k=p=p.next;do g=n(g,k.action),k=k.next;while(k!==p);Fn(g,a.memoizedState)||(Vt=!0),a.memoizedState=g,a.baseQueue===null&&(a.baseState=g),o.lastRenderedState=g}return[g,s]}function D2(n,a,o){var s=qe,p=Pt(),g=Ye;if(g){if(o===void 0)throw Error(l(407));o=o()}else o=a();var k=!Fn((ct||p).memoizedState,o);if(k&&(p.memoizedState=o,Vt=!0),p=p.queue,Em(R2.bind(null,s,p,n),[n]),p.getSnapshot!==a||k||$t!==null&&$t.memoizedState.tag&1){if(s.flags|=2048,nl(9,{destroy:void 0},M2.bind(null,s,p,o,a),null),pt===null)throw Error(l(349));g||ta&127||O2(s,a,o)}return o}function O2(n,a,o){n.flags|=16384,n={getSnapshot:a,value:o},a=qe.updateQueue,a===null?(a=Cu(),qe.updateQueue=a,a.stores=[n]):(o=a.stores,o===null?a.stores=[n]:o.push(n))}function M2(n,a,o,s){a.value=o,a.getSnapshot=s,P2(a)&&N2(n)}function R2(n,a,o){return o(function(){P2(a)&&N2(n)})}function P2(n){var a=n.getSnapshot;n=n.value;try{var o=a();return!Fn(n,o)}catch{return!0}}function N2(n){var a=Fi(n,2);a!==null&&An(a,n,2)}function Cm(n){var a=gn();if(typeof n=="function"){var o=n;if(n=o(),Xi){Xe(!0);try{o()}finally{Xe(!1)}}}return a.memoizedState=a.baseState=n,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:n},a}function j2(n,a,o,s){return n.baseState=o,_m(n,ct,typeof s=="function"?s:na)}function tL(n,a,o,s,p){if(Au(n))throw Error(l(485));if(n=a.action,n!==null){var g={payload:p,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){g.listeners.push(k)}};le.T===null?g.isTransition=!1:o(!0),s(g),o=a.pending,o===null?(g.next=a.pending=g,z2(a,g)):(g.next=o.next,a.pending=o.next=g)}}function z2(n,a){var o=a.action,s=a.payload,p=n.state;if(a.isTransition){var g=le.T,k={};le.T=k;try{var I=o(p,s),N=le.S;N!==null&&N(k,I),F2(n,a,I)}catch(G){Sm(n,a,G)}finally{g!==null&&k.types!==null&&(g.types=k.types),le.T=g}}else try{g=o(p,s),F2(n,a,g)}catch(G){Sm(n,a,G)}}function F2(n,a,o){typeof o=="object"&&o&&typeof o.then=="function"?o.then(function(s){q2(n,a,s)},function(s){return Sm(n,a,s)}):q2(n,a,o)}function q2(n,a,o){a.status="fulfilled",a.value=o,$2(a),n.state=o,a=n.pending,a!==null&&(o=a.next,o===a?n.pending=null:(o=o.next,a.next=o,z2(n,o)))}function Sm(n,a,o){var s=n.pending;if(n.pending=null,s!==null){s=s.next;do a.status="rejected",a.reason=o,$2(a),a=a.next;while(a!==s)}n.action=null}function $2(n){n=n.listeners;for(var a=0;a<n.length;a++)(0,n[a])()}function V2(n,a){return a}function B2(n,a){if(Ye){var o=pt.formState;if(o!==null){e:{var s=qe;if(Ye){if(bt){t:{for(var p=bt,g=or;p.nodeType!==8;){if(!g){p=null;break t}if(p=sr(p.nextSibling),p===null){p=null;break t}}g=p.data,p=g==="F!"||g==="F"?p:null}if(p){bt=sr(p.nextSibling),s=p.data==="F!";break e}}Va(s)}s=!1}s&&(a=o[0])}}return o=gn(),o.memoizedState=o.baseState=a,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:V2,lastRenderedState:a},o.queue=s,o=sw.bind(null,qe,s),s.dispatch=o,s=Cm(!1),g=Dm.bind(null,qe,!1,s.queue),s=gn(),p={state:a,dispatch:null,action:n,pending:null},s.queue=p,o=tL.bind(null,qe,p,g,o),p.dispatch=o,s.memoizedState=n,[a,o,!1]}function H2(n){return W2(Pt(),ct,n)}function W2(n,a,o){if(a=_m(n,a,V2)[0],n=Eu(na)[0],typeof a=="object"&&a&&typeof a.then=="function")try{var s=xs(a)}catch(k){throw k===Yo?gu:k}else s=a;a=Pt();var p=a.queue,g=p.dispatch;return o!==a.memoizedState&&(qe.flags|=2048,nl(9,{destroy:void 0},nL.bind(null,p,o),null)),[s,g,n]}function nL(n,a){n.action=a}function U2(n){var a=Pt(),o=ct;if(o!==null)return W2(a,o,n);Pt(),a=a.memoizedState,o=Pt();var s=o.queue.dispatch;return o.memoizedState=n,[a,s,!1]}function nl(n,a,o,s){return n={tag:n,create:o,deps:s,inst:a,next:null},a=qe.updateQueue,a===null&&(a=Cu(),qe.updateQueue=a),o=a.lastEffect,o===null?a.lastEffect=n.next=n:(s=o.next,o.next=n,n.next=s,a.lastEffect=n),n}function K2(){return Pt().memoizedState}function Tu(n,a,o,s){var p=gn();qe.flags|=n,p.memoizedState=nl(1|a,{destroy:void 0},o,s===void 0?null:s)}function Iu(n,a,o,s){var p=Pt();s=s===void 0?null:s;var g=p.memoizedState.inst;ct!==null&&s!==null&&gm(s,ct.memoizedState.deps)?p.memoizedState=nl(a,g,o,s):(qe.flags|=n,p.memoizedState=nl(1|a,g,o,s))}function Q2(n,a){Tu(8390656,8,n,a)}function Em(n,a){Iu(2048,8,n,a)}function rL(n){qe.flags|=4;var a=qe.updateQueue;if(a===null)a=Cu(),qe.updateQueue=a,a.events=[n];else{var o=a.events;o===null?a.events=[n]:o.push(n)}}function G2(n){var a=Pt().memoizedState;return rL({ref:a,nextImpl:n}),function(){if(nt&2)throw Error(l(440));return a.impl.apply(void 0,arguments)}}function X2(n,a){return Iu(4,2,n,a)}function Y2(n,a){return Iu(4,4,n,a)}function J2(n,a){if(typeof a=="function"){n=n();var o=a(n);return function(){typeof o=="function"?o():a(null)}}if(a!=null)return n=n(),a.current=n,function(){a.current=null}}function Z2(n,a,o){o=o==null?null:o.concat([n]),Iu(4,4,J2.bind(null,a,n),o)}function Tm(){}function ew(n,a){var o=Pt();a=a===void 0?null:a;var s=o.memoizedState;return a!==null&&gm(a,s[1])?s[0]:(o.memoizedState=[n,a],n)}function tw(n,a){var o=Pt();a=a===void 0?null:a;var s=o.memoizedState;if(a!==null&&gm(a,s[1]))return s[0];if(s=n(),Xi){Xe(!0);try{n()}finally{Xe(!1)}}return o.memoizedState=[s,a],s}function Im(n,a,o){return o===void 0||ta&1073741824&&!(Qe&261930)?n.memoizedState=a:(n.memoizedState=o,n=Zw(),qe.lanes|=n,Ga|=n,o)}function nw(n,a,o,s){return Fn(o,a)?o:Zo.current===null?!(ta&42)||ta&1073741824&&!(Qe&261930)?(Vt=!0,n.memoizedState=o):(n=Zw(),qe.lanes|=n,Ga|=n,a):(n=Im(n,o,s),Fn(n,a)||(Vt=!0),n)}function rw(n,a,o,s,p){var g=K.p;K.p=g!==0&&8>g?g:8;var k=le.T,I={};le.T=I,Dm(n,!1,a,o);try{var N=p(),G=le.S;G!==null&&G(I,N),typeof N=="object"&&N&&typeof N.then=="function"?_s(n,a,JA(N,s),lr(n)):_s(n,a,s,lr(n))}catch(se){_s(n,a,{then:function(){},status:"rejected",reason:se},lr())}finally{K.p=g,k!==null&&I.types!==null&&(k.types=I.types),le.T=k}}function aL(){}function Am(n,a,o,s){if(n.tag!==5)throw Error(l(476));var p=aw(n).queue;rw(n,p,a,Le,o===null?aL:function(){return iw(n),o(s)})}function aw(n){var a=n.memoizedState;if(a!==null)return a;a={memoizedState:Le,baseState:Le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:Le},next:null};var o={};return a.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:na,lastRenderedState:o},next:null},n.memoizedState=a,n=n.alternate,n!==null&&(n.memoizedState=a),a}function iw(n){var a=aw(n);a.next===null&&(a=n.alternate.memoizedState),_s(n,a.next.queue,{},lr())}function Lm(){return nn(Fs)}function ow(){return Pt().memoizedState}function lw(){return Pt().memoizedState}function iL(n){for(var a=n.return;a!==null;){switch(a.tag){case 24:case 3:var o=lr();n=Qi(o);var s=Gi(a,n,o);s!==null&&(An(s,a,o),ys(s,a,o)),a={cache:im()},n.payload=a;return}a=a.return}}function oL(n,a,o){var s=lr();o={lane:s,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Au(n)?cw(a,o):(o=Qp(n,a,o,s),o!==null&&(An(o,n,s),uw(o,a,s)))}function sw(n,a,o){_s(n,a,o,lr())}function _s(n,a,o,s){var p={lane:s,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Au(n))cw(a,p);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=a.lastRenderedReducer,g!==null))try{var k=a.lastRenderedState,I=g(k,o);if(p.hasEagerState=!0,p.eagerState=I,Fn(I,k))return cu(n,a,p,0),pt===null&&su(),!1}catch{}if(o=Qp(n,a,p,s),o!==null)return An(o,n,s),uw(o,a,s),!0}return!1}function Dm(n,a,o,s){if(s={lane:2,revertLane:ch(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Au(n)){if(a)throw Error(l(479))}else a=Qp(n,o,s,2),a!==null&&An(a,n,2)}function Au(n){var a=n.alternate;return n===qe||a!==null&&a===qe}function cw(n,a){el=_u=!0;var o=n.pending;o===null?a.next=a:(a.next=o.next,o.next=a),n.pending=a}function uw(n,a,o){if(o&4194048){var s=a.lanes;s&=n.pendingLanes,o|=s,a.lanes=o,Mo(n,o)}}var ks={readContext:nn,use:Su,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It};ks.useEffectEvent=It;var dw={readContext:nn,use:Su,useCallback:function(n,a){return gn().memoizedState=[n,a===void 0?null:a],n},useContext:nn,useEffect:Q2,useImperativeHandle:function(n,a,o){o=o==null?null:o.concat([n]),Tu(4194308,4,J2.bind(null,a,n),o)},useLayoutEffect:function(n,a){return Tu(4194308,4,n,a)},useInsertionEffect:function(n,a){Tu(4,2,n,a)},useMemo:function(n,a){var o=gn();a=a===void 0?null:a;var s=n();if(Xi){Xe(!0);try{n()}finally{Xe(!1)}}return o.memoizedState=[s,a],s},useReducer:function(n,a,o){var s=gn();if(o!==void 0){var p=o(a);if(Xi){Xe(!0);try{o(a)}finally{Xe(!1)}}}else p=a;return s.memoizedState=s.baseState=p,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:p},s.queue=n,n=n.dispatch=oL.bind(null,qe,n),[s.memoizedState,n]},useRef:function(n){var a=gn();return n={current:n},a.memoizedState=n},useState:function(n){n=Cm(n);var a=n.queue,o=sw.bind(null,qe,a);return a.dispatch=o,[n.memoizedState,o]},useDebugValue:Tm,useDeferredValue:function(n,a){return Im(gn(),n,a)},useTransition:function(){var n=Cm(!1);return n=rw.bind(null,qe,n.queue,!0,!1),gn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,a,o){var s=qe,p=gn();if(Ye){if(o===void 0)throw Error(l(407));o=o()}else{if(o=a(),pt===null)throw Error(l(349));Qe&127||O2(s,a,o)}p.memoizedState=o;var g={value:o,getSnapshot:a};return p.queue=g,Q2(R2.bind(null,s,g,n),[n]),s.flags|=2048,nl(9,{destroy:void 0},M2.bind(null,s,g,o,a),null),o},useId:function(){var n=gn(),a=pt.identifierPrefix;if(Ye){var o=Nr,s=Pr;o=(s&~(1<<32-yt(s)-1)).toString(32)+o,a="_"+a+"R_"+o,o=ku++,0<o&&(a+="H"+o.toString(32)),a+="_"}else o=ZA++,a="_"+a+"r_"+o.toString(32)+"_";return n.memoizedState=a},useHostTransitionStatus:Lm,useFormState:B2,useActionState:B2,useOptimistic:function(n){var a=gn();a.memoizedState=a.baseState=n;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=o,a=Dm.bind(null,qe,!0,o),o.dispatch=a,[n,a]},useMemoCache:xm,useCacheRefresh:function(){return gn().memoizedState=iL.bind(null,qe)},useEffectEvent:function(n){var a=gn(),o={impl:n};return a.memoizedState=o,function(){if(nt&2)throw Error(l(440));return o.impl.apply(void 0,arguments)}}},Om={readContext:nn,use:Su,useCallback:ew,useContext:nn,useEffect:Em,useImperativeHandle:Z2,useInsertionEffect:X2,useLayoutEffect:Y2,useMemo:tw,useReducer:Eu,useRef:K2,useState:function(){return Eu(na)},useDebugValue:Tm,useDeferredValue:function(n,a){return nw(Pt(),ct.memoizedState,n,a)},useTransition:function(){var n=Eu(na)[0],a=Pt().memoizedState;return[typeof n=="boolean"?n:xs(n),a]},useSyncExternalStore:D2,useId:ow,useHostTransitionStatus:Lm,useFormState:H2,useActionState:H2,useOptimistic:function(n,a){return j2(Pt(),ct,n,a)},useMemoCache:xm,useCacheRefresh:lw};Om.useEffectEvent=G2;var fw={readContext:nn,use:Su,useCallback:ew,useContext:nn,useEffect:Em,useImperativeHandle:Z2,useInsertionEffect:X2,useLayoutEffect:Y2,useMemo:tw,useReducer:km,useRef:K2,useState:function(){return km(na)},useDebugValue:Tm,useDeferredValue:function(n,a){var o=Pt();return ct===null?Im(o,n,a):nw(o,ct.memoizedState,n,a)},useTransition:function(){var n=km(na)[0],a=Pt().memoizedState;return[typeof n=="boolean"?n:xs(n),a]},useSyncExternalStore:D2,useId:ow,useHostTransitionStatus:Lm,useFormState:U2,useActionState:U2,useOptimistic:function(n,a){var o=Pt();return ct===null?(o.baseState=n,[n,o.queue.dispatch]):j2(o,ct,n,a)},useMemoCache:xm,useCacheRefresh:lw};fw.useEffectEvent=G2;function Mm(n,a,o,s){a=n.memoizedState,o=o(s,a),o=o==null?a:S({},a,o),n.memoizedState=o,n.lanes===0&&(n.updateQueue.baseState=o)}var Rm={enqueueSetState:function(n,a,o){n=n._reactInternals;var s=lr(),p=Qi(s);p.payload=a,o!=null&&(p.callback=o),a=Gi(n,p,s),a!==null&&(An(a,n,s),ys(a,n,s))},enqueueReplaceState:function(n,a,o){n=n._reactInternals;var s=lr(),p=Qi(s);p.tag=1,p.payload=a,o!=null&&(p.callback=o),a=Gi(n,p,s),a!==null&&(An(a,n,s),ys(a,n,s))},enqueueForceUpdate:function(n,a){n=n._reactInternals;var o=lr(),s=Qi(o);s.tag=2,a!=null&&(s.callback=a),a=Gi(n,s,o),a!==null&&(An(a,n,o),ys(a,n,o))}};function pw(n,a,o,s,p,g,k){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(s,g,k):a.prototype&&a.prototype.isPureReactComponent?!cs(o,s)||!cs(p,g):!0}function mw(n,a,o,s){n=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(o,s),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(o,s),a.state!==n&&Rm.enqueueReplaceState(a,a.state,null)}function Yi(n,a){var o=a;if("ref"in a)for(var s in o={},a)s!=="ref"&&(o[s]=a[s]);if(n=n.defaultProps)for(var p in o===a&&(o=S({},o)),n)o[p]===void 0&&(o[p]=n[p]);return o}function lL(n){lu(n)}function sL(n){console.error(n)}function cL(n){lu(n)}function Lu(n,a){try{var o=n.onUncaughtError;o(a.value,{componentStack:a.stack})}catch(s){setTimeout(function(){throw s})}}function hw(n,a,o){try{var s=n.onCaughtError;s(o.value,{componentStack:o.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Pm(n,a,o){return o=Qi(o),o.tag=3,o.payload={element:null},o.callback=function(){Lu(n,a)},o}function gw(n){return n=Qi(n),n.tag=3,n}function yw(n,a,o,s){var p=o.type.getDerivedStateFromError;if(typeof p=="function"){var g=s.value;n.payload=function(){return p(g)},n.callback=function(){hw(a,o,s)}}var k=o.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(n.callback=function(){hw(a,o,s),typeof p!="function"&&(Xa===null?Xa=new Set([this]):Xa.add(this));var I=s.stack;this.componentDidCatch(s.value,{componentStack:I===null?"":I})})}function uL(n,a,o,s,p){if(o.flags|=32768,typeof s=="object"&&s&&typeof s.then=="function"){if(a=o.alternate,a!==null&&Qo(a,o,p,!0),o=$n.current,o!==null){switch(o.tag){case 31:case 13:return xr===null?Vu():o.alternate===null&&At===0&&(At=3),o.flags&=-257,o.flags|=65536,o.lanes=p,s===yu?o.flags|=16384:(a=o.updateQueue,a===null?o.updateQueue=new Set([s]):a.add(s),oh(n,s,p)),!1;case 22:return o.flags|=65536,s===yu?o.flags|=16384:(a=o.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([s])},o.updateQueue=a):(o=a.retryQueue,o===null?a.retryQueue=new Set([s]):o.add(s)),oh(n,s,p)),!1}throw Error(l(435,o.tag))}return oh(n,s,p),Vu(),!1}if(Ye)return a=$n.current,a===null?(s!==em&&(a=Error(l(423),{cause:s}),fs(rr(a,o))),n=n.current.alternate,n.flags|=65536,p&=-p,n.lanes|=p,s=rr(s,o),p=Pm(n.stateNode,s,p),dm(n,p),At!==4&&(At=2)):(!(a.flags&65536)&&(a.flags|=256),a.flags|=65536,a.lanes=p,s!==em&&(n=Error(l(422),{cause:s}),fs(rr(n,o)))),!1;var g=Error(l(520),{cause:s});if(g=rr(g,o),Ds===null?Ds=[g]:Ds.push(g),At!==4&&(At=2),a===null)return!0;s=rr(s,o),o=a;do{switch(o.tag){case 3:return o.flags|=65536,n=p&-p,o.lanes|=n,n=Pm(o.stateNode,s,n),dm(o,n),!1;case 1:if(a=o.type,g=o.stateNode,!(o.flags&128)&&(typeof a.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Xa===null||!Xa.has(g))))return o.flags|=65536,p&=-p,o.lanes|=p,p=gw(p),yw(p,n,o,s),dm(o,p),!1}o=o.return}while(o!==null);return!1}var Nm=Error(l(461)),Vt=!1;function rn(n,a,o,s){a.child=n===null?C2(a,null,o,s):Ki(a,n.child,o,s)}function vw(n,a,o,s,p){o=o.render;var g=a.ref;if("ref"in s){var k={};for(var I in s)I!=="ref"&&(k[I]=s[I])}else k=s;return Bi(a),s=ym(n,a,o,k,g,p),I=vm(),n!==null&&!Vt?(bm(n,a,p),ra(n,a,p)):(Ye&&I&&Jp(a),a.flags|=1,rn(n,a,s,p),a.child)}function bw(n,a,o,s,p){if(n===null){var g=o.type;return typeof g=="function"&&!Gp(g)&&g.defaultProps===void 0&&o.compare===null?(a.tag=15,a.type=g,ww(n,a,g,s,p)):(n=du(o.type,null,s,a,a.mode,p),n.ref=a.ref,n.return=a,a.child=n)}if(g=n.child,!Hm(n,p)){var k=g.memoizedProps;if(o=o.compare,o=o===null?cs:o,o(k,s)&&n.ref===a.ref)return ra(n,a,p)}return a.flags|=1,n=Yr(g,s),n.ref=a.ref,n.return=a,a.child=n}function ww(n,a,o,s,p){if(n!==null){var g=n.memoizedProps;if(cs(g,s)&&n.ref===a.ref)if(Vt=!1,a.pendingProps=s=g,Hm(n,p))n.flags&131072&&(Vt=!0);else return a.lanes=n.lanes,ra(n,a,p)}return jm(n,a,o,s,p)}function xw(n,a,o,s){var p=s.children,g=n===null?null:n.memoizedState;if(n===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if(a.flags&128){if(g=g===null?o:g.baseLanes|o,n!==null){for(s=a.child=n.child,p=0;s!==null;)p=p|s.lanes|s.childLanes,s=s.sibling;s=p&~g}else s=0,a.child=null;return _w(n,a,g,o,s)}if(o&536870912)a.memoizedState={baseLanes:0,cachePool:null},n!==null&&hu(a,g===null?null:g.cachePool),g===null?pm():T2(a,g),I2(a);else return s=a.lanes=536870912,_w(n,a,g===null?o:g.baseLanes|o,o,s)}else g===null?(n!==null&&hu(a,null),pm(),Ua(a)):(hu(a,g.cachePool),T2(a,g),Ua(a),a.memoizedState=null);return rn(n,a,p,o),a.child}function Cs(n,a){return n!==null&&n.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function _w(n,a,o,s,p){var g=lm();return g=g===null?null:{parent:qt._currentValue,pool:g},a.memoizedState={baseLanes:o,cachePool:g},n!==null&&hu(a,null),pm(),I2(a),n!==null&&Qo(n,a,s,!0),a.childLanes=p,null}function Du(n,a){return a=Mu({mode:a.mode,children:a.children},n.mode),a.ref=n.ref,n.child=a,a.return=n,a}function kw(n,a,o){return Ki(a,n.child,null,o),n=Du(a,a.pendingProps),n.flags|=2,Vn(a),a.memoizedState=null,n}function dL(n,a,o){var s=a.pendingProps,p=(a.flags&128)!=0;if(a.flags&=-129,n===null){if(Ye){if(s.mode==="hidden")return n=Du(a,s),a.lanes=536870912,Cs(null,n);if(hm(a),(n=bt)?(n=Nx(n,or),n=n!==null&&n.data==="&"?n:null,n!==null&&(a.memoizedState={dehydrated:n,treeContext:qa===null?null:{id:Pr,overflow:Nr},retryLane:536870912,hydrationErrors:null},o=c2(n),o.return=a,a.child=o,tn=a,bt=null)):n=null,n===null)throw Va(a);return a.lanes=536870912,null}return Du(a,s)}var g=n.memoizedState;if(g!==null){var k=g.dehydrated;if(hm(a),p)if(a.flags&256)a.flags&=-257,a=kw(n,a,o);else if(a.memoizedState!==null)a.child=n.child,a.flags|=128,a=null;else throw Error(l(558));else if(Vt||Qo(n,a,o,!1),p=(o&n.childLanes)!==0,Vt||p){if(s=pt,s!==null&&(k=Uc(s,o),k!==0&&k!==g.retryLane))throw g.retryLane=k,Fi(n,k),An(s,n,k),Nm;Vu(),a=kw(n,a,o)}else n=g.treeContext,bt=sr(k.nextSibling),tn=a,Ye=!0,$a=null,or=!1,n!==null&&f2(a,n),a=Du(a,s),a.flags|=4096;return a}return n=Yr(n.child,{mode:s.mode,children:s.children}),n.ref=a.ref,a.child=n,n.return=a,n}function Ou(n,a){var o=a.ref;if(o===null)n!==null&&n.ref!==null&&(a.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(l(284));(n===null||n.ref!==o)&&(a.flags|=4194816)}}function jm(n,a,o,s,p){return Bi(a),o=ym(n,a,o,s,void 0,p),s=vm(),n!==null&&!Vt?(bm(n,a,p),ra(n,a,p)):(Ye&&s&&Jp(a),a.flags|=1,rn(n,a,o,p),a.child)}function Cw(n,a,o,s,p,g){return Bi(a),a.updateQueue=null,o=L2(a,s,o,p),A2(n),s=vm(),n!==null&&!Vt?(bm(n,a,g),ra(n,a,g)):(Ye&&s&&Jp(a),a.flags|=1,rn(n,a,o,g),a.child)}function Sw(n,a,o,s,p){if(Bi(a),a.stateNode===null){var g=Ho,k=o.contextType;typeof k=="object"&&k&&(g=nn(k)),g=new o(s,g),a.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Rm,a.stateNode=g,g._reactInternals=a,g=a.stateNode,g.props=s,g.state=a.memoizedState,g.refs={},cm(a),k=o.contextType,g.context=typeof k=="object"&&k?nn(k):Ho,g.state=a.memoizedState,k=o.getDerivedStateFromProps,typeof k=="function"&&(Mm(a,o,k,s),g.state=a.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(k=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),k!==g.state&&Rm.enqueueReplaceState(g,g.state,null),bs(a,s,g,p),vs(),g.state=a.memoizedState),typeof g.componentDidMount=="function"&&(a.flags|=4194308),s=!0}else if(n===null){g=a.stateNode;var I=a.memoizedProps,N=Yi(o,I);g.props=N;var G=g.context,se=o.contextType;k=Ho,typeof se=="object"&&se&&(k=nn(se));var de=o.getDerivedStateFromProps;se=typeof de=="function"||typeof g.getSnapshotBeforeUpdate=="function",I=a.pendingProps!==I,se||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(I||G!==k)&&mw(a,g,s,k),Ha=!1;var J=a.memoizedState;g.state=J,bs(a,s,g,p),vs(),G=a.memoizedState,I||J!==G||Ha?(typeof de=="function"&&(Mm(a,o,de,s),G=a.memoizedState),(N=Ha||pw(a,o,N,s,J,G,k))?(se||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"&&(a.flags|=4194308)):(typeof g.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=s,a.memoizedState=G),g.props=s,g.state=G,g.context=k,s=N):(typeof g.componentDidMount=="function"&&(a.flags|=4194308),s=!1)}else{g=a.stateNode,um(n,a),k=a.memoizedProps,se=Yi(o,k),g.props=se,de=a.pendingProps,J=g.context,G=o.contextType,N=Ho,typeof G=="object"&&G&&(N=nn(G)),I=o.getDerivedStateFromProps,(G=typeof I=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(k!==de||J!==N)&&mw(a,g,s,N),Ha=!1,J=a.memoizedState,g.state=J,bs(a,s,g,p),vs();var re=a.memoizedState;k!==de||J!==re||Ha||n!==null&&n.dependencies!==null&&pu(n.dependencies)?(typeof I=="function"&&(Mm(a,o,I,s),re=a.memoizedState),(se=Ha||pw(a,o,se,s,J,re,N)||n!==null&&n.dependencies!==null&&pu(n.dependencies))?(G||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(s,re,N),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(s,re,N)),typeof g.componentDidUpdate=="function"&&(a.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof g.componentDidUpdate!="function"||k===n.memoizedProps&&J===n.memoizedState||(a.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||k===n.memoizedProps&&J===n.memoizedState||(a.flags|=1024),a.memoizedProps=s,a.memoizedState=re),g.props=s,g.state=re,g.context=N,s=se):(typeof g.componentDidUpdate!="function"||k===n.memoizedProps&&J===n.memoizedState||(a.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||k===n.memoizedProps&&J===n.memoizedState||(a.flags|=1024),s=!1)}return g=s,Ou(n,a),s=(a.flags&128)!=0,g||s?(g=a.stateNode,o=s&&typeof o.getDerivedStateFromError!="function"?null:g.render(),a.flags|=1,n!==null&&s?(a.child=Ki(a,n.child,null,p),a.child=Ki(a,null,o,p)):rn(n,a,o,p),a.memoizedState=g.state,n=a.child):n=ra(n,a,p),n}function Ew(n,a,o,s){return $i(),a.flags|=256,rn(n,a,o,s),a.child}var zm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Fm(n){return{baseLanes:n,cachePool:v2()}}function qm(n,a,o){return n=n===null?0:n.childLanes&~o,a&&(n|=Hn),n}function Tw(n,a,o){var s=a.pendingProps,p=!1,g=(a.flags&128)!=0,k;if((k=g)||(k=n!==null&&n.memoizedState===null?!1:(Rt.current&2)!=0),k&&(p=!0,a.flags&=-129),k=(a.flags&32)!=0,a.flags&=-33,n===null){if(Ye){if(p?Wa(a):Ua(a),(n=bt)?(n=Nx(n,or),n=n!==null&&n.data!=="&"?n:null,n!==null&&(a.memoizedState={dehydrated:n,treeContext:qa===null?null:{id:Pr,overflow:Nr},retryLane:536870912,hydrationErrors:null},o=c2(n),o.return=a,a.child=o,tn=a,bt=null)):n=null,n===null)throw Va(a);return xh(n)?a.lanes=32:a.lanes=536870912,null}var I=s.children;return s=s.fallback,p?(Ua(a),p=a.mode,I=Mu({mode:"hidden",children:I},p),s=qi(s,p,o,null),I.return=a,s.return=a,I.sibling=s,a.child=I,s=a.child,s.memoizedState=Fm(o),s.childLanes=qm(n,k,o),a.memoizedState=zm,Cs(null,s)):(Wa(a),$m(a,I))}var N=n.memoizedState;if(N!==null&&(I=N.dehydrated,I!==null)){if(g)a.flags&256?(Wa(a),a.flags&=-257,a=Vm(n,a,o)):a.memoizedState===null?(Ua(a),I=s.fallback,p=a.mode,s=Mu({mode:"visible",children:s.children},p),I=qi(I,p,o,null),I.flags|=2,s.return=a,I.return=a,s.sibling=I,a.child=s,Ki(a,n.child,null,o),s=a.child,s.memoizedState=Fm(o),s.childLanes=qm(n,k,o),a.memoizedState=zm,a=Cs(null,s)):(Ua(a),a.child=n.child,a.flags|=128,a=null);else if(Wa(a),xh(I)){if(k=I.nextSibling&&I.nextSibling.dataset,k)var G=k.dgst;k=G,s=Error(l(419)),s.stack="",s.digest=k,fs({value:s,source:null,stack:null}),a=Vm(n,a,o)}else if(Vt||Qo(n,a,o,!1),k=(o&n.childLanes)!==0,Vt||k){if(k=pt,k!==null&&(s=Uc(k,o),s!==0&&s!==N.retryLane))throw N.retryLane=s,Fi(n,s),An(k,n,s),Nm;wh(I)||Vu(),a=Vm(n,a,o)}else wh(I)?(a.flags|=192,a.child=n.child,a=null):(n=N.treeContext,bt=sr(I.nextSibling),tn=a,Ye=!0,$a=null,or=!1,n!==null&&f2(a,n),a=$m(a,s.children),a.flags|=4096);return a}return p?(Ua(a),I=s.fallback,p=a.mode,N=n.child,G=N.sibling,s=Yr(N,{mode:"hidden",children:s.children}),s.subtreeFlags=N.subtreeFlags&65011712,G===null?(I=qi(I,p,o,null),I.flags|=2):I=Yr(G,I),I.return=a,s.return=a,s.sibling=I,a.child=s,Cs(null,s),s=a.child,I=n.child.memoizedState,I===null?I=Fm(o):(p=I.cachePool,p===null?p=v2():(N=qt._currentValue,p=p.parent===N?p:{parent:N,pool:N}),I={baseLanes:I.baseLanes|o,cachePool:p}),s.memoizedState=I,s.childLanes=qm(n,k,o),a.memoizedState=zm,Cs(n.child,s)):(Wa(a),o=n.child,n=o.sibling,o=Yr(o,{mode:"visible",children:s.children}),o.return=a,o.sibling=null,n!==null&&(k=a.deletions,k===null?(a.deletions=[n],a.flags|=16):k.push(n)),a.child=o,a.memoizedState=null,o)}function $m(n,a){return a=Mu({mode:"visible",children:a},n.mode),a.return=n,n.child=a}function Mu(n,a){return n=qn(22,n,null,a),n.lanes=0,n}function Vm(n,a,o){return Ki(a,n.child,null,o),n=$m(a,a.pendingProps.children),n.flags|=2,a.memoizedState=null,n}function Iw(n,a,o){n.lanes|=a;var s=n.alternate;s!==null&&(s.lanes|=a),rm(n.return,a,o)}function Bm(n,a,o,s,p,g){var k=n.memoizedState;k===null?n.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:s,tail:o,tailMode:p,treeForkCount:g}:(k.isBackwards=a,k.rendering=null,k.renderingStartTime=0,k.last=s,k.tail=o,k.tailMode=p,k.treeForkCount=g)}function Aw(n,a,o){var s=a.pendingProps,p=s.revealOrder,g=s.tail;s=s.children;var k=Rt.current,I=(k&2)!=0;if(I?(k=k&1|2,a.flags|=128):k&=1,De(Rt,k),rn(n,a,s,o),s=Ye?ds:0,!I&&n!==null&&n.flags&128)e:for(n=a.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Iw(n,o,a);else if(n.tag===19)Iw(n,o,a);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===a)break e;for(;n.sibling===null;){if(n.return===null||n.return===a)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(p){case"forwards":for(o=a.child,p=null;o!==null;)n=o.alternate,n!==null&&xu(n)===null&&(p=o),o=o.sibling;o=p,o===null?(p=a.child,a.child=null):(p=o.sibling,o.sibling=null),Bm(a,!1,p,o,g,s);break;case"backwards":case"unstable_legacy-backwards":for(o=null,p=a.child,a.child=null;p!==null;){if(n=p.alternate,n!==null&&xu(n)===null){a.child=p;break}n=p.sibling,p.sibling=o,o=p,p=n}Bm(a,!0,o,null,g,s);break;case"together":Bm(a,!1,null,null,void 0,s);break;default:a.memoizedState=null}return a.child}function ra(n,a,o){if(n!==null&&(a.dependencies=n.dependencies),Ga|=a.lanes,(o&a.childLanes)===0)if(n!==null){if(Qo(n,a,o,!1),(o&a.childLanes)===0)return null}else return null;if(n!==null&&a.child!==n.child)throw Error(l(153));if(a.child!==null){for(n=a.child,o=Yr(n,n.pendingProps),a.child=o,o.return=a;n.sibling!==null;)n=n.sibling,o=o.sibling=Yr(n,n.pendingProps),o.return=a;o.sibling=null}return a.child}function Hm(n,a){return(n.lanes&a)===0?(n=n.dependencies,!!(n!==null&&pu(n))):!0}function fL(n,a,o){switch(a.tag){case 3:Io(a,a.stateNode.containerInfo),Ba(a,qt,n.memoizedState.cache),$i();break;case 27:case 5:Br(a);break;case 4:Io(a,a.stateNode.containerInfo);break;case 10:Ba(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,hm(a),null;break;case 13:var s=a.memoizedState;if(s!==null)return s.dehydrated===null?(o&a.child.childLanes)===0?(Wa(a),n=ra(n,a,o),n===null?null:n.sibling):Tw(n,a,o):(Wa(a),a.flags|=128,null);Wa(a);break;case 19:var p=(n.flags&128)!=0;if(s=(o&a.childLanes)!==0,s||(s=(Qo(n,a,o,!1),(o&a.childLanes)!==0)),p){if(s)return Aw(n,a,o);a.flags|=128}if(p=a.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),De(Rt,Rt.current),s)break;return null;case 22:return a.lanes=0,xw(n,a,o,a.pendingProps);case 24:Ba(a,qt,n.memoizedState.cache)}return ra(n,a,o)}function Lw(n,a,o){if(n!==null)if(n.memoizedProps!==a.pendingProps)Vt=!0;else{if(!Hm(n,o)&&!(a.flags&128))return Vt=!1,fL(n,a,o);Vt=!!(n.flags&131072)}else Vt=!1,Ye&&a.flags&1048576&&d2(a,ds,a.index);switch(a.lanes=0,a.tag){case 16:e:{var s=a.pendingProps;if(n=Wi(a.elementType),a.type=n,typeof n=="function")Gp(n)?(s=Yi(n,s),a.tag=1,a=Sw(null,a,n,s,o)):(a.tag=0,a=jm(null,a,n,s,o));else{if(n!=null){var p=n.$$typeof;if(p===fe){a.tag=11,a=vw(null,a,n,s,o);break e}else if(p===te){a.tag=14,a=bw(null,a,n,s,o);break e}}throw a=ye(n)||n,Error(l(306,a,""))}}return a;case 0:return jm(n,a,a.type,a.pendingProps,o);case 1:return s=a.type,p=Yi(s,a.pendingProps),Sw(n,a,s,p,o);case 3:e:{if(Io(a,a.stateNode.containerInfo),n===null)throw Error(l(387));s=a.pendingProps;var g=a.memoizedState;p=g.element,um(n,a),bs(a,s,null,o);var k=a.memoizedState;if(s=k.cache,Ba(a,qt,s),s!==g.cache&&am(a,[qt],o,!0),vs(),s=k.element,g.isDehydrated)if(g={element:s,isDehydrated:!1,cache:k.cache},a.updateQueue.baseState=g,a.memoizedState=g,a.flags&256){a=Ew(n,a,s,o);break e}else if(s!==p){p=rr(Error(l(424)),a),fs(p),a=Ew(n,a,s,o);break e}else for((n=a.stateNode.containerInfo,n.nodeType)===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,bt=sr(n.firstChild),tn=a,Ye=!0,$a=null,or=!0,o=C2(a,null,s,o),a.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if($i(),s===p){a=ra(n,a,o);break e}rn(n,a,s,o)}a=a.child}return a;case 26:return Ou(n,a),n===null?(o=Vx(a.type,null,a.pendingProps,null))?a.memoizedState=o:Ye||(o=a.type,n=a.pendingProps,s=Gu(jt.current).createElement(o),s[Ht]=a,s[en]=n,an(s,o,n),Mt(s),a.stateNode=s):a.memoizedState=Vx(a.type,n.memoizedProps,a.pendingProps,n.memoizedState),null;case 27:return Br(a),n===null&&Ye&&(s=a.stateNode=Fx(a.type,a.pendingProps,jt.current),tn=a,or=!0,p=bt,ei(a.type)?(_h=p,bt=sr(s.firstChild)):bt=p),rn(n,a,a.pendingProps.children,o),Ou(n,a),n===null&&(a.flags|=4194304),a.child;case 5:return n===null&&Ye&&((p=s=bt)&&(s=qL(s,a.type,a.pendingProps,or),s===null?p=!1:(a.stateNode=s,tn=a,bt=sr(s.firstChild),or=!1,p=!0)),p||Va(a)),Br(a),p=a.type,g=a.pendingProps,k=n===null?null:n.memoizedProps,s=g.children,yh(p,g)?s=null:k!==null&&yh(p,k)&&(a.flags|=32),a.memoizedState!==null&&(p=ym(n,a,eL,null,null,o),Fs._currentValue=p),Ou(n,a),rn(n,a,s,o),a.child;case 6:return n===null&&Ye&&((n=o=bt)&&(o=$L(o,a.pendingProps,or),o===null?n=!1:(a.stateNode=o,tn=a,bt=null,n=!0)),n||Va(a)),null;case 13:return Tw(n,a,o);case 4:return Io(a,a.stateNode.containerInfo),s=a.pendingProps,n===null?a.child=Ki(a,null,s,o):rn(n,a,s,o),a.child;case 11:return vw(n,a,a.type,a.pendingProps,o);case 7:return rn(n,a,a.pendingProps,o),a.child;case 8:return rn(n,a,a.pendingProps.children,o),a.child;case 12:return rn(n,a,a.pendingProps.children,o),a.child;case 10:return s=a.pendingProps,Ba(a,a.type,s.value),rn(n,a,s.children,o),a.child;case 9:return p=a.type._context,s=a.pendingProps.children,Bi(a),p=nn(p),s=s(p),a.flags|=1,rn(n,a,s,o),a.child;case 14:return bw(n,a,a.type,a.pendingProps,o);case 15:return ww(n,a,a.type,a.pendingProps,o);case 19:return Aw(n,a,o);case 31:return dL(n,a,o);case 22:return xw(n,a,o,a.pendingProps);case 24:return Bi(a),s=nn(qt),n===null?(p=lm(),p===null&&(p=pt,g=im(),p.pooledCache=g,g.refCount++,g!==null&&(p.pooledCacheLanes|=o),p=g),a.memoizedState={parent:s,cache:p},cm(a),Ba(a,qt,p)):((n.lanes&o)!==0&&(um(n,a),bs(a,null,null,o),vs()),p=n.memoizedState,g=a.memoizedState,p.parent===s?(s=g.cache,Ba(a,qt,s),s!==p.cache&&am(a,[qt],o,!0)):(p={parent:s,cache:s},a.memoizedState=p,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=p),Ba(a,qt,s))),rn(n,a,a.pendingProps.children,o),a.child;case 29:throw a.pendingProps}throw Error(l(156,a.tag))}function aa(n){n.flags|=4}function Wm(n,a,o,s,p){if((a=(n.mode&32)!=0)&&(a=!1),a){if(n.flags|=16777216,(p&335544128)===p)if(n.stateNode.complete)n.flags|=8192;else if(rx())n.flags|=8192;else throw Ui=yu,sm}else n.flags&=-16777217}function Dw(n,a){if(a.type!=="stylesheet"||a.state.loading&4)n.flags&=-16777217;else if(n.flags|=16777216,!Kx(a))if(rx())n.flags|=8192;else throw Ui=yu,sm}function Ru(n,a){a!==null&&(n.flags|=4),n.flags&16384&&(a=n.tag===22?536870912:Wc(),n.lanes|=a,ol|=a)}function Ss(n,a){if(!Ye)switch(n.tailMode){case"hidden":a=n.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?n.tail=null:o.sibling=null;break;case"collapsed":o=n.tail;for(var s=null;o!==null;)o.alternate!==null&&(s=o),o=o.sibling;s===null?a||n.tail===null?n.tail=null:n.tail.sibling=null:s.sibling=null}}function wt(n){var a=n.alternate!==null&&n.alternate.child===n.child,o=0,s=0;if(a)for(var p=n.child;p!==null;)o|=p.lanes|p.childLanes,s|=p.subtreeFlags&65011712,s|=p.flags&65011712,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)o|=p.lanes|p.childLanes,s|=p.subtreeFlags,s|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=s,n.childLanes=o,a}function pL(n,a,o){var s=a.pendingProps;switch(Zp(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wt(a),null;case 1:return wt(a),null;case 3:return o=a.stateNode,s=null,n!==null&&(s=n.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),ea(qt),Pn(),o.pendingContext&&(o.pendingContext=(o.context=o.pendingContext,null)),(n===null||n.child===null)&&(Ko(a)?aa(a):n===null||n.memoizedState.isDehydrated&&!(a.flags&256)||(a.flags|=1024,tm())),wt(a),null;case 26:var p=a.type,g=a.memoizedState;return n===null?(aa(a),g===null?(wt(a),Wm(a,p,null,s,o)):(wt(a),Dw(a,g))):g?g===n.memoizedState?(wt(a),a.flags&=-16777217):(aa(a),wt(a),Dw(a,g)):(n=n.memoizedProps,n!==s&&aa(a),wt(a),Wm(a,p,n,s,o)),null;case 27:if(ki(a),o=jt.current,p=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==s&&aa(a);else{if(!s){if(a.stateNode===null)throw Error(l(166));return wt(a),null}n=ze.current,Ko(a)?p2(a,n):(n=Fx(p,s,o),a.stateNode=n,aa(a))}return wt(a),null;case 5:if(ki(a),p=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==s&&aa(a);else{if(!s){if(a.stateNode===null)throw Error(l(166));return wt(a),null}if(g=ze.current,Ko(a))p2(a,g);else{var k=Gu(jt.current);switch(g){case 1:g=k.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:g=k.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":g=k.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":g=k.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":g=k.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof s.is=="string"?k.createElement("select",{is:s.is}):k.createElement("select"),s.multiple?g.multiple=!0:s.size&&(g.size=s.size);break;default:g=typeof s.is=="string"?k.createElement(p,{is:s.is}):k.createElement(p)}}g[Ht]=a,g[en]=s;e:for(k=a.child;k!==null;){if(k.tag===5||k.tag===6)g.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===a)break e;for(;k.sibling===null;){if(k.return===null||k.return===a)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}a.stateNode=g;e:switch(an(g,p,s),p){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&aa(a)}}return wt(a),Wm(a,a.type,n===null?null:n.memoizedProps,a.pendingProps,o),null;case 6:if(n&&a.stateNode!=null)n.memoizedProps!==s&&aa(a);else{if(typeof s!="string"&&a.stateNode===null)throw Error(l(166));if(n=jt.current,Ko(a)){if(n=a.stateNode,o=a.memoizedProps,s=null,p=tn,p!==null)switch(p.tag){case 27:case 5:s=p.memoizedProps}n[Ht]=a,n=!!(n.nodeValue===o||s!==null&&s.suppressHydrationWarning===!0||Ix(n.nodeValue,o)),n||Va(a,!0)}else n=Gu(n).createTextNode(s),n[Ht]=a,a.stateNode=n}return wt(a),null;case 31:if(o=a.memoizedState,n===null||n.memoizedState!==null){if(s=Ko(a),o!==null){if(n===null){if(!s)throw Error(l(318));if(n=a.memoizedState,n=n===null?null:n.dehydrated,!n)throw Error(l(557));n[Ht]=a}else $i(),!(a.flags&128)&&(a.memoizedState=null),a.flags|=4;wt(a),n=!1}else o=tm(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=o),n=!0;if(!n)return a.flags&256?(Vn(a),a):(Vn(a),null);if(a.flags&128)throw Error(l(558))}return wt(a),null;case 13:if(s=a.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(p=Ko(a),s!==null&&s.dehydrated!==null){if(n===null){if(!p)throw Error(l(318));if(p=a.memoizedState,p=p===null?null:p.dehydrated,!p)throw Error(l(317));p[Ht]=a}else $i(),!(a.flags&128)&&(a.memoizedState=null),a.flags|=4;wt(a),p=!1}else p=tm(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=p),p=!0;if(!p)return a.flags&256?(Vn(a),a):(Vn(a),null)}return Vn(a),a.flags&128?(a.lanes=o,a):(o=s!==null,n=n!==null&&n.memoizedState!==null,o&&(s=a.child,p=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(p=s.alternate.memoizedState.cachePool.pool),g=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(g=s.memoizedState.cachePool.pool),g!==p&&(s.flags|=2048)),o!==n&&o&&(a.child.flags|=8192),Ru(a,a.updateQueue),wt(a),null);case 4:return Pn(),n===null&&Cx(a.stateNode.containerInfo),wt(a),null;case 10:return ea(a.type),wt(a),null;case 19:if(je(Rt),s=a.memoizedState,s===null)return wt(a),null;if(p=(a.flags&128)!=0,g=s.rendering,g===null)if(p)Ss(s,!1);else{if(At!==0||n!==null&&n.flags&128)for(n=a.child;n!==null;){if(g=xu(n),g!==null){for(a.flags|=128,Ss(s,!1),n=g.updateQueue,a.updateQueue=n,Ru(a,n),a.subtreeFlags=0,n=o,o=a.child;o!==null;)s2(o,n),o=o.sibling;return De(Rt,Rt.current&1|2),Ye&&Jr(a,s.treeForkCount),a.child}n=n.sibling}s.tail!==null&&Jt()>Fu&&(a.flags|=128,p=!0,Ss(s,!1),a.lanes=4194304)}else{if(!p)if(n=xu(g),n!==null){if(a.flags|=128,p=!0,n=n.updateQueue,a.updateQueue=n,Ru(a,n),Ss(s,!0),s.tail===null&&s.tailMode==="hidden"&&!g.alternate&&!Ye)return wt(a),null}else 2*Jt()-s.renderingStartTime>Fu&&o!==536870912&&(a.flags|=128,p=!0,Ss(s,!1),a.lanes=4194304);s.isBackwards?(g.sibling=a.child,a.child=g):(n=s.last,n===null?a.child=g:n.sibling=g,s.last=g)}return s.tail===null?(wt(a),null):(n=s.tail,s.rendering=n,s.tail=n.sibling,s.renderingStartTime=Jt(),n.sibling=null,o=Rt.current,De(Rt,p?o&1|2:o&1),Ye&&Jr(a,s.treeForkCount),n);case 22:case 23:return Vn(a),mm(),s=a.memoizedState!==null,n===null?s&&(a.flags|=8192):n.memoizedState!==null!==s&&(a.flags|=8192),s?o&536870912&&!(a.flags&128)&&(wt(a),a.subtreeFlags&6&&(a.flags|=8192)):wt(a),o=a.updateQueue,o!==null&&Ru(a,o.retryQueue),o=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),s=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(s=a.memoizedState.cachePool.pool),s!==o&&(a.flags|=2048),n!==null&&je(Hi),null;case 24:return o=null,n!==null&&(o=n.memoizedState.cache),a.memoizedState.cache!==o&&(a.flags|=2048),ea(qt),wt(a),null;case 25:return null;case 30:return null}throw Error(l(156,a.tag))}function mL(n,a){switch(Zp(a),a.tag){case 1:return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 3:return ea(qt),Pn(),n=a.flags,n&65536&&!(n&128)?(a.flags=n&-65537|128,a):null;case 26:case 27:case 5:return ki(a),null;case 31:if(a.memoizedState!==null){if(Vn(a),a.alternate===null)throw Error(l(340));$i()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 13:if(Vn(a),n=a.memoizedState,n!==null&&n.dehydrated!==null){if(a.alternate===null)throw Error(l(340));$i()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 19:return je(Rt),null;case 4:return Pn(),null;case 10:return ea(a.type),null;case 22:case 23:return Vn(a),mm(),n!==null&&je(Hi),n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 24:return ea(qt),null;case 25:return null;default:return null}}function Ow(n,a){switch(Zp(a),a.tag){case 3:ea(qt),Pn();break;case 26:case 27:case 5:ki(a);break;case 4:Pn();break;case 31:a.memoizedState!==null&&Vn(a);break;case 13:Vn(a);break;case 19:je(Rt);break;case 10:ea(a.type);break;case 22:case 23:Vn(a),mm(),n!==null&&je(Hi);break;case 24:ea(qt)}}function Es(n,a){try{var o=a.updateQueue,s=o===null?null:o.lastEffect;if(s!==null){var p=s.next;o=p;do{if((o.tag&n)===n){s=void 0;var g=o.create,k=o.inst;s=g(),k.destroy=s}o=o.next}while(o!==p)}}catch(I){it(a,a.return,I)}}function Ka(n,a,o){try{var s=a.updateQueue,p=s===null?null:s.lastEffect;if(p!==null){var g=p.next;s=g;do{if((s.tag&n)===n){var k=s.inst,I=k.destroy;if(I!==void 0){k.destroy=void 0,p=a;var N=o,G=I;try{G()}catch(se){it(p,N,se)}}}s=s.next}while(s!==g)}}catch(se){it(a,a.return,se)}}function Mw(n){var a=n.updateQueue;if(a!==null){var o=n.stateNode;try{E2(a,o)}catch(s){it(n,n.return,s)}}}function Rw(n,a,o){o.props=Yi(n.type,n.memoizedProps),o.state=n.memoizedState;try{o.componentWillUnmount()}catch(s){it(n,a,s)}}function Ts(n,a){try{var o=n.ref;if(o!==null){switch(n.tag){case 26:case 27:case 5:var s=n.stateNode;break;case 30:s=n.stateNode;break;default:s=n.stateNode}typeof o=="function"?n.refCleanup=o(s):o.current=s}}catch(p){it(n,a,p)}}function jr(n,a){var o=n.ref,s=n.refCleanup;if(o!==null)if(typeof s=="function")try{s()}catch(p){it(n,a,p)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(p){it(n,a,p)}else o.current=null}function Pw(n){var a=n.type,o=n.memoizedProps,s=n.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":o.autoFocus&&s.focus();break e;case"img":o.src?s.src=o.src:o.srcSet&&(s.srcset=o.srcSet)}}catch(p){it(n,n.return,p)}}function Um(n,a,o){try{var s=n.stateNode;RL(s,n.type,o,a),s[en]=a}catch(p){it(n,n.return,p)}}function Nw(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&ei(n.type)||n.tag===4}function Km(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Nw(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&ei(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Qm(n,a,o){var s=n.tag;if(s===5||s===6)n=n.stateNode,a?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(n,a):(a=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,a.appendChild(n),o=o._reactRootContainer,o!=null||a.onclick!==null||(a.onclick=tr));else if(s!==4&&(s===27&&ei(n.type)&&(o=n.stateNode,a=null),n=n.child,n!==null))for(Qm(n,a,o),n=n.sibling;n!==null;)Qm(n,a,o),n=n.sibling}function Pu(n,a,o){var s=n.tag;if(s===5||s===6)n=n.stateNode,a?o.insertBefore(n,a):o.appendChild(n);else if(s!==4&&(s===27&&ei(n.type)&&(o=n.stateNode),n=n.child,n!==null))for(Pu(n,a,o),n=n.sibling;n!==null;)Pu(n,a,o),n=n.sibling}function jw(n){var a=n.stateNode,o=n.memoizedProps;try{for(var s=n.type,p=a.attributes;p.length;)a.removeAttributeNode(p[0]);an(a,s,o),a[Ht]=n,a[en]=o}catch(g){it(n,n.return,g)}}var ia=!1,Bt=!1,Gm=!1,zw=typeof WeakSet=="function"?WeakSet:Set,Yt=null;function hL(n,a){if(n=n.containerInfo,hh=nd,n=Zb(n),Vp(n)){if("selectionStart"in n)var o={start:n.selectionStart,end:n.selectionEnd};else e:{o=(o=n.ownerDocument)&&o.defaultView||window;var s=o.getSelection&&o.getSelection();if(s&&s.rangeCount!==0){o=s.anchorNode;var p=s.anchorOffset,g=s.focusNode;s=s.focusOffset;try{o.nodeType,g.nodeType}catch{o=null;break e}var k=0,I=-1,N=-1,G=0,se=0,de=n,J=null;t:for(;;){for(var re;de!==o||p!==0&&de.nodeType!==3||(I=k+p),de!==g||s!==0&&de.nodeType!==3||(N=k+s),de.nodeType===3&&(k+=de.nodeValue.length),(re=de.firstChild)!==null;)J=de,de=re;for(;;){if(de===n)break t;if(J===o&&++G===p&&(I=k),J===g&&++se===s&&(N=k),(re=de.nextSibling)!==null)break;de=J,J=de.parentNode}de=re}o=I===-1||N===-1?null:{start:I,end:N}}else o=null}o||(o={start:0,end:0})}else o=null;for(gh={focusedElem:n,selectionRange:o},nd=!1,Yt=a;Yt!==null;)if(a=Yt,n=a.child,a.subtreeFlags&1028&&n!==null)n.return=a,Yt=n;else for(;Yt!==null;){switch(a=Yt,g=a.alternate,n=a.flags,a.tag){case 0:if(n&4&&(n=a.updateQueue,n=n===null?null:n.events,n!==null))for(o=0;o<n.length;o++)p=n[o],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if(n&1024&&g!==null){n=void 0,o=a,p=g.memoizedProps,g=g.memoizedState,s=o.stateNode;try{var Se=Yi(o.type,p);n=s.getSnapshotBeforeUpdate(Se,g),s.__reactInternalSnapshotBeforeUpdate=n}catch(Me){it(o,o.return,Me)}}break;case 3:if(n&1024){if(n=a.stateNode.containerInfo,o=n.nodeType,o===9)bh(n);else if(o===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":bh(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(n&1024)throw Error(l(163))}if(n=a.sibling,n!==null){n.return=a.return,Yt=n;break}Yt=a.return}}function Fw(n,a,o){var s=o.flags;switch(o.tag){case 0:case 11:case 15:la(n,o),s&4&&Es(5,o);break;case 1:if(la(n,o),s&4)if(n=o.stateNode,a===null)try{n.componentDidMount()}catch(k){it(o,o.return,k)}else{var p=Yi(o.type,a.memoizedProps);a=a.memoizedState;try{n.componentDidUpdate(p,a,n.__reactInternalSnapshotBeforeUpdate)}catch(k){it(o,o.return,k)}}s&64&&Mw(o),s&512&&Ts(o,o.return);break;case 3:if(la(n,o),s&64&&(n=o.updateQueue,n!==null)){if(a=null,o.child!==null)switch(o.child.tag){case 27:case 5:a=o.child.stateNode;break;case 1:a=o.child.stateNode}try{E2(n,a)}catch(k){it(o,o.return,k)}}break;case 27:a===null&&s&4&&jw(o);case 26:case 5:la(n,o),a===null&&s&4&&Pw(o),s&512&&Ts(o,o.return);break;case 12:la(n,o);break;case 31:la(n,o),s&4&&Vw(n,o);break;case 13:la(n,o),s&4&&Bw(n,o),s&64&&(n=o.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(o=CL.bind(null,o),VL(n,o))));break;case 22:if(s=o.memoizedState!==null||ia,!s){a=a!==null&&a.memoizedState!==null||Bt,p=ia;var g=Bt;ia=s,(Bt=a)&&!g?sa(n,o,(o.subtreeFlags&8772)!=0):la(n,o),ia=p,Bt=g}break;case 30:break;default:la(n,o)}}function qw(n){var a=n.alternate;a!==null&&(n.alternate=null,qw(a)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(a=n.stateNode,a!==null&&Ro(a)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var Ct=null,Sn=!1;function oa(n,a,o){for(o=o.child;o!==null;)$w(n,a,o),o=o.sibling}function $w(n,a,o){if(sn&&typeof sn.onCommitFiberUnmount=="function")try{sn.onCommitFiberUnmount(Ci,o)}catch{}switch(o.tag){case 26:Bt||jr(o,a),oa(n,a,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Bt||jr(o,a);var s=Ct,p=Sn;ei(o.type)&&(Ct=o.stateNode,Sn=!1),oa(n,a,o),Ns(o.stateNode),Ct=s,Sn=p;break;case 5:Bt||jr(o,a);case 6:if(s=Ct,p=Sn,Ct=null,oa(n,a,o),Ct=s,Sn=p,Ct!==null)if(Sn)try{(Ct.nodeType===9?Ct.body:Ct.nodeName==="HTML"?Ct.ownerDocument.body:Ct).removeChild(o.stateNode)}catch(g){it(o,a,g)}else try{Ct.removeChild(o.stateNode)}catch(g){it(o,a,g)}break;case 18:Ct!==null&&(Sn?(n=Ct,Rx(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,o.stateNode),ml(n)):Rx(Ct,o.stateNode));break;case 4:s=Ct,p=Sn,Ct=o.stateNode.containerInfo,Sn=!0,oa(n,a,o),Ct=s,Sn=p;break;case 0:case 11:case 14:case 15:Ka(2,o,a),Bt||Ka(4,o,a),oa(n,a,o);break;case 1:Bt||(jr(o,a),s=o.stateNode,typeof s.componentWillUnmount=="function"&&Rw(o,a,s)),oa(n,a,o);break;case 21:oa(n,a,o);break;case 22:Bt=(s=Bt)||o.memoizedState!==null,oa(n,a,o),Bt=s;break;default:oa(n,a,o)}}function Vw(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{ml(n)}catch(o){it(a,a.return,o)}}}function Bw(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{ml(n)}catch(o){it(a,a.return,o)}}function gL(n){switch(n.tag){case 31:case 13:case 19:var a=n.stateNode;return a===null&&(a=n.stateNode=new zw),a;case 22:return n=n.stateNode,a=n._retryCache,a===null&&(a=n._retryCache=new zw),a;default:throw Error(l(435,n.tag))}}function Nu(n,a){var o=gL(n);a.forEach(function(s){if(!o.has(s)){o.add(s);var p=SL.bind(null,n,s);s.then(p,p)}})}function En(n,a){var o=a.deletions;if(o!==null)for(var s=0;s<o.length;s++){var p=o[s],g=n,k=a,I=k;e:for(;I!==null;){switch(I.tag){case 27:if(ei(I.type)){Ct=I.stateNode,Sn=!1;break e}break;case 5:Ct=I.stateNode,Sn=!1;break e;case 3:case 4:Ct=I.stateNode.containerInfo,Sn=!0;break e}I=I.return}if(Ct===null)throw Error(l(160));$w(g,k,p),Ct=null,Sn=!1,g=p.alternate,g!==null&&(g.return=null),p.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)Hw(a,n),a=a.sibling}var _r=null;function Hw(n,a){var o=n.alternate,s=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:En(a,n),Tn(n),s&4&&(Ka(3,n,n.return),Es(3,n),Ka(5,n,n.return));break;case 1:En(a,n),Tn(n),s&512&&(Bt||o===null||jr(o,o.return)),s&64&&ia&&(n=n.updateQueue,n!==null&&(s=n.callbacks,s!==null&&(o=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=o===null?s:o.concat(s))));break;case 26:var p=_r;if(En(a,n),Tn(n),s&512&&(Bt||o===null||jr(o,o.return)),s&4){var g=o===null?null:o.memoizedState;if(s=n.memoizedState,o===null)if(s===null)if(n.stateNode===null){e:{s=n.type,o=n.memoizedProps,p=p.ownerDocument||p;t:switch(s){case"title":g=p.getElementsByTagName("title")[0],(!g||g[Ti]||g[Ht]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=p.createElement(s),p.head.insertBefore(g,p.querySelector("head > title"))),an(g,s,o),g[Ht]=n,Mt(g),s=g;break e;case"link":var k=Wx("link","href",p).get(s+(o.href||""));if(k){for(var I=0;I<k.length;I++)if(g=k[I],g.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&g.getAttribute("rel")===(o.rel==null?null:o.rel)&&g.getAttribute("title")===(o.title==null?null:o.title)&&g.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){k.splice(I,1);break t}}g=p.createElement(s),an(g,s,o),p.head.appendChild(g);break;case"meta":if(k=Wx("meta","content",p).get(s+(o.content||""))){for(I=0;I<k.length;I++)if(g=k[I],g.getAttribute("content")===(o.content==null?null:""+o.content)&&g.getAttribute("name")===(o.name==null?null:o.name)&&g.getAttribute("property")===(o.property==null?null:o.property)&&g.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&g.getAttribute("charset")===(o.charSet==null?null:o.charSet)){k.splice(I,1);break t}}g=p.createElement(s),an(g,s,o),p.head.appendChild(g);break;default:throw Error(l(468,s))}g[Ht]=n,Mt(g),s=g}n.stateNode=s}else Ux(p,n.type,n.stateNode);else n.stateNode=Hx(p,s,n.memoizedProps);else g===s?s===null&&n.stateNode!==null&&Um(n,n.memoizedProps,o.memoizedProps):(g===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):g.count--,s===null?Ux(p,n.type,n.stateNode):Hx(p,s,n.memoizedProps))}break;case 27:En(a,n),Tn(n),s&512&&(Bt||o===null||jr(o,o.return)),o!==null&&s&4&&Um(n,n.memoizedProps,o.memoizedProps);break;case 5:if(En(a,n),Tn(n),s&512&&(Bt||o===null||jr(o,o.return)),n.flags&32){p=n.stateNode;try{Qr(p,"")}catch(Se){it(n,n.return,Se)}}s&4&&n.stateNode!=null&&(p=n.memoizedProps,Um(n,p,o===null?p:o.memoizedProps)),s&1024&&(Gm=!0);break;case 6:if(En(a,n),Tn(n),s&4){if(n.stateNode===null)throw Error(l(162));s=n.memoizedProps,o=n.stateNode;try{o.nodeValue=s}catch(Se){it(n,n.return,Se)}}break;case 3:if(Ju=null,p=_r,_r=Xu(a.containerInfo),En(a,n),_r=p,Tn(n),s&4&&o!==null&&o.memoizedState.isDehydrated)try{ml(a.containerInfo)}catch(Se){it(n,n.return,Se)}Gm&&(Gm=!1,Ww(n));break;case 4:s=_r,_r=Xu(n.stateNode.containerInfo),En(a,n),Tn(n),_r=s;break;case 12:En(a,n),Tn(n);break;case 31:En(a,n),Tn(n),s&4&&(s=n.updateQueue,s!==null&&(n.updateQueue=null,Nu(n,s)));break;case 13:En(a,n),Tn(n),n.child.flags&8192&&n.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(zu=Jt()),s&4&&(s=n.updateQueue,s!==null&&(n.updateQueue=null,Nu(n,s)));break;case 22:p=n.memoizedState!==null;var N=o!==null&&o.memoizedState!==null,G=ia,se=Bt;if(ia=G||p,Bt=se||N,En(a,n),Bt=se,ia=G,Tn(n),s&8192)e:for(a=n.stateNode,a._visibility=p?a._visibility&-2:a._visibility|1,p&&(o===null||N||ia||Bt||Ji(n)),o=null,a=n;;){if(a.tag===5||a.tag===26){if(o===null){N=o=a;try{if(g=N.stateNode,p)k=g.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{I=N.stateNode;var de=N.memoizedProps.style,J=de!=null&&de.hasOwnProperty("display")?de.display:null;I.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(Se){it(N,N.return,Se)}}}else if(a.tag===6){if(o===null){N=a;try{N.stateNode.nodeValue=p?"":N.memoizedProps}catch(Se){it(N,N.return,Se)}}}else if(a.tag===18){if(o===null){N=a;try{var re=N.stateNode;p?Px(re,!0):Px(N.stateNode,!1)}catch(Se){it(N,N.return,Se)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===n)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===n)break e;for(;a.sibling===null;){if(a.return===null||a.return===n)break e;o===a&&(o=null),a=a.return}o===a&&(o=null),a.sibling.return=a.return,a=a.sibling}s&4&&(s=n.updateQueue,s!==null&&(o=s.retryQueue,o!==null&&(s.retryQueue=null,Nu(n,o))));break;case 19:En(a,n),Tn(n),s&4&&(s=n.updateQueue,s!==null&&(n.updateQueue=null,Nu(n,s)));break;case 30:break;case 21:break;default:En(a,n),Tn(n)}}function Tn(n){var a=n.flags;if(a&2){try{for(var o,s=n.return;s!==null;){if(Nw(s)){o=s;break}s=s.return}if(o==null)throw Error(l(160));switch(o.tag){case 27:var p=o.stateNode;Pu(n,Km(n),p);break;case 5:var g=o.stateNode;o.flags&32&&(Qr(g,""),o.flags&=-33),Pu(n,Km(n),g);break;case 3:case 4:var k=o.stateNode.containerInfo;Qm(n,Km(n),k);break;default:throw Error(l(161))}}catch(I){it(n,n.return,I)}n.flags&=-3}a&4096&&(n.flags&=-4097)}function Ww(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var a=n;Ww(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),n=n.sibling}}function la(n,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)Fw(n,a.alternate,a),a=a.sibling}function Ji(n){for(n=n.child;n!==null;){var a=n;switch(a.tag){case 0:case 11:case 14:case 15:Ka(4,a,a.return),Ji(a);break;case 1:jr(a,a.return);var o=a.stateNode;typeof o.componentWillUnmount=="function"&&Rw(a,a.return,o),Ji(a);break;case 27:Ns(a.stateNode);case 26:case 5:jr(a,a.return),Ji(a);break;case 22:a.memoizedState===null&&Ji(a);break;case 30:Ji(a);break;default:Ji(a)}n=n.sibling}}function sa(n,a,o){for(o&&(o=(a.subtreeFlags&8772)!=0),a=a.child;a!==null;){var s=a.alternate,p=n,g=a,k=g.flags;switch(g.tag){case 0:case 11:case 15:sa(p,g,o),Es(4,g);break;case 1:if(sa(p,g,o),s=g,p=s.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(G){it(s,s.return,G)}if(s=g,p=s.updateQueue,p!==null){var I=s.stateNode;try{var N=p.shared.hiddenCallbacks;if(N!==null)for(p.shared.hiddenCallbacks=null,p=0;p<N.length;p++)S2(N[p],I)}catch(G){it(s,s.return,G)}}o&&k&64&&Mw(g),Ts(g,g.return);break;case 27:jw(g);case 26:case 5:sa(p,g,o),o&&s===null&&k&4&&Pw(g),Ts(g,g.return);break;case 12:sa(p,g,o);break;case 31:sa(p,g,o),o&&k&4&&Vw(p,g);break;case 13:sa(p,g,o),o&&k&4&&Bw(p,g);break;case 22:g.memoizedState===null&&sa(p,g,o),Ts(g,g.return);break;case 30:break;default:sa(p,g,o)}a=a.sibling}}function Xm(n,a){var o=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),n=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(n=a.memoizedState.cachePool.pool),n!==o&&(n!=null&&n.refCount++,o!=null&&ps(o))}function Ym(n,a){n=null,a.alternate!==null&&(n=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==n&&(a.refCount++,n!=null&&ps(n))}function kr(n,a,o,s){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Uw(n,a,o,s),a=a.sibling}function Uw(n,a,o,s){var p=a.flags;switch(a.tag){case 0:case 11:case 15:kr(n,a,o,s),p&2048&&Es(9,a);break;case 1:kr(n,a,o,s);break;case 3:kr(n,a,o,s),p&2048&&(n=null,a.alternate!==null&&(n=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==n&&(a.refCount++,n!=null&&ps(n)));break;case 12:if(p&2048){kr(n,a,o,s),n=a.stateNode;try{var g=a.memoizedProps,k=g.id,I=g.onPostCommit;typeof I=="function"&&I(k,a.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(N){it(a,a.return,N)}}else kr(n,a,o,s);break;case 31:kr(n,a,o,s);break;case 13:kr(n,a,o,s);break;case 23:break;case 22:g=a.stateNode,k=a.alternate,a.memoizedState===null?g._visibility&2?kr(n,a,o,s):(g._visibility|=2,rl(n,a,o,s,(a.subtreeFlags&10256)!=0||!1)):g._visibility&2?kr(n,a,o,s):Is(n,a),p&2048&&Xm(k,a);break;case 24:kr(n,a,o,s),p&2048&&Ym(a.alternate,a);break;default:kr(n,a,o,s)}}function rl(n,a,o,s,p){for(p&&(p=(a.subtreeFlags&10256)!=0||!1),a=a.child;a!==null;){var g=n,k=a,I=o,N=s,G=k.flags;switch(k.tag){case 0:case 11:case 15:rl(g,k,I,N,p),Es(8,k);break;case 23:break;case 22:var se=k.stateNode;k.memoizedState===null?(se._visibility|=2,rl(g,k,I,N,p)):se._visibility&2?rl(g,k,I,N,p):Is(g,k),p&&G&2048&&Xm(k.alternate,k);break;case 24:rl(g,k,I,N,p),p&&G&2048&&Ym(k.alternate,k);break;default:rl(g,k,I,N,p)}a=a.sibling}}function Is(n,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var o=n,s=a,p=s.flags;switch(s.tag){case 22:Is(o,s),p&2048&&Xm(s.alternate,s);break;case 24:Is(o,s),p&2048&&Ym(s.alternate,s);break;default:Is(o,s)}a=a.sibling}}var As=8192;function al(n,a,o){if(n.subtreeFlags&As)for(n=n.child;n!==null;)Kw(n,a,o),n=n.sibling}function Kw(n,a,o){switch(n.tag){case 26:al(n,a,o),n.flags&As&&n.memoizedState!==null&&e8(o,_r,n.memoizedState,n.memoizedProps);break;case 5:al(n,a,o);break;case 3:case 4:var s=_r;_r=Xu(n.stateNode.containerInfo),al(n,a,o),_r=s;break;case 22:n.memoizedState===null&&(s=n.alternate,s!==null&&s.memoizedState!==null?(s=As,As=16777216,al(n,a,o),As=s):al(n,a,o));break;default:al(n,a,o)}}function Qw(n){var a=n.alternate;if(a!==null&&(n=a.child,n!==null)){a.child=null;do a=n.sibling,n.sibling=null,n=a;while(n!==null)}}function Ls(n){var a=n.deletions;if(n.flags&16){if(a!==null)for(var o=0;o<a.length;o++){var s=a[o];Yt=s,Xw(s,n)}Qw(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Gw(n),n=n.sibling}function Gw(n){switch(n.tag){case 0:case 11:case 15:Ls(n),n.flags&2048&&Ka(9,n,n.return);break;case 3:Ls(n);break;case 12:Ls(n);break;case 22:var a=n.stateNode;n.memoizedState!==null&&a._visibility&2&&(n.return===null||n.return.tag!==13)?(a._visibility&=-3,ju(n)):Ls(n);break;default:Ls(n)}}function ju(n){var a=n.deletions;if(n.flags&16){if(a!==null)for(var o=0;o<a.length;o++){var s=a[o];Yt=s,Xw(s,n)}Qw(n)}for(n=n.child;n!==null;){switch(a=n,a.tag){case 0:case 11:case 15:Ka(8,a,a.return),ju(a);break;case 22:o=a.stateNode,o._visibility&2&&(o._visibility&=-3,ju(a));break;default:ju(a)}n=n.sibling}}function Xw(n,a){for(;Yt!==null;){var o=Yt;switch(o.tag){case 0:case 11:case 15:Ka(8,o,a);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var s=o.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:ps(o.memoizedState.cache)}if(s=o.child,s!==null)s.return=o,Yt=s;else e:for(o=n;Yt!==null;){s=Yt;var p=s.sibling,g=s.return;if(qw(s),s===o){Yt=null;break e}if(p!==null){p.return=g,Yt=p;break e}Yt=g}}}var yL={getCacheForType:function(n){var a=nn(qt),o=a.data.get(n);return o===void 0&&(o=n(),a.data.set(n,o)),o},cacheSignal:function(){return nn(qt).controller.signal}},vL=typeof WeakMap=="function"?WeakMap:Map,nt=0,pt=null,We=null,Qe=0,at=0,Bn=null,Qa=!1,il=!1,Jm=!1,ca=0,At=0,Ga=0,Zi=0,Zm=0,Hn=0,ol=0,Ds=null,In=null,eh=!1,zu=0,Yw=0,Fu=1/0,qu=null,Xa=null,Ut=0,Ya=null,ll=null,ua=0,th=0,nh=null,Jw=null,Os=0,rh=null;function lr(){return nt&2&&Qe!==0?Qe&-Qe:le.T===null?Kc():ch()}function Zw(){if(Hn===0)if(!(Qe&536870912)||Ye){var n=Ot;Ot<<=1,!(Ot&3932160)&&(Ot=262144),Hn=n}else Hn=536870912;return n=$n.current,n!==null&&(n.flags|=32),Hn}function An(n,a,o){(n===pt&&(at===2||at===9)||n.cancelPendingCommit!==null)&&(sl(n,0),Ja(n,Qe,Hn,!1)),Ei(n,o),(!(nt&2)||n!==pt)&&(n===pt&&(!(nt&2)&&(Zi|=o),At===4&&Ja(n,Qe,Hn,!1)),da(n))}function ex(n,a,o){if(nt&6)throw Error(l(327));var s=!o&&(a&127)==0&&(a&n.expiredLanes)===0||Oa(n,a),p=s?xL(n,a):ih(n,a,!0),g=s;do{if(p===0){il&&!s&&Ja(n,a,0,!1);break}else{if(o=n.current.alternate,g&&!bL(o)){p=ih(n,a,!1),g=!1;continue}if(p===2){if(g=a,n.errorRecoveryDisabledLanes&g)var k=0;else k=n.pendingLanes&-536870913,k=k===0?k&536870912?536870912:0:k;if(k!==0){a=k;e:{var I=n;p=Ds;var N=I.current.memoizedState.isDehydrated;if(N&&(sl(I,k).flags|=256),k=ih(I,k,!1),k!==2){if(Jm&&!N){I.errorRecoveryDisabledLanes|=g,Zi|=g,p=4;break e}g=In,In=p,g!==null&&(In===null?In=g:In.push.apply(In,g))}p=k}if(g=!1,p!==2)continue}}if(p===1){sl(n,0),Ja(n,a,0,!0);break}e:{switch(s=n,g=p,g){case 0:case 1:throw Error(l(345));case 4:if((a&4194048)!==a)break;case 6:Ja(s,a,Hn,!Qa);break e;case 2:In=null;break;case 3:case 5:break;default:throw Error(l(329))}if((a&62914560)===a&&(p=zu+300-Jt(),10<p)){if(Ja(s,a,Hn,!Qa),Oo(s,0,!0)!==0)break e;ua=a,s.timeoutHandle=Ox(tx.bind(null,s,o,In,qu,eh,a,Hn,Zi,ol,Qa,g,"Throttled",-0,0),p);break e}tx(s,o,In,qu,eh,a,Hn,Zi,ol,Qa,g,null,-0,0)}}break}while(!0);da(n)}function tx(n,a,o,s,p,g,k,I,N,G,se,de,J,re){if(n.timeoutHandle=-1,de=a.subtreeFlags,de&8192||(de&16785408)==16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:tr},Kw(a,g,de);var Se=(g&62914560)===g?zu-Jt():(g&4194048)===g?Yw-Jt():0;if(Se=t8(de,Se),Se!==null){ua=g,n.cancelPendingCommit=Se(cx.bind(null,n,a,g,o,s,p,k,I,N,se,de,null,J,re)),Ja(n,g,k,!G);return}}cx(n,a,g,o,s,p,k,I,N)}function bL(n){for(var a=n;;){var o=a.tag;if((o===0||o===11||o===15)&&a.flags&16384&&(o=a.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var s=0;s<o.length;s++){var p=o[s],g=p.getSnapshot;p=p.value;try{if(!Fn(g(),p))return!1}catch{return!1}}if(o=a.child,a.subtreeFlags&16384&&o!==null)o.return=a,a=o;else{if(a===n)break;for(;a.sibling===null;){if(a.return===null||a.return===n)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Ja(n,a,o,s){a&=~Zm,a&=~Zi,n.suspendedLanes|=a,n.pingedLanes&=~a,s&&(n.warmLanes|=a),s=n.expirationTimes;for(var p=a;0<p;){var g=31-yt(p),k=1<<g;s[g]=-1,p&=~k}o!==0&&Ur(n,o,a)}function $u(){return nt&6?!0:(Ms(0,!1),!1)}function ah(){if(We!==null){if(at===0)var n=We.return;else n=We,Zr=Vi=null,wm(n),Jo=null,hs=0,n=We;for(;n!==null;)Ow(n.alternate,n),n=n.return;We=null}}function sl(n,a){var o=n.timeoutHandle;o!==-1&&(n.timeoutHandle=-1,jL(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),ua=0,ah(),pt=n,We=o=Yr(n.current,null),Qe=a,at=0,Bn=null,Qa=!1,il=Oa(n,a),Jm=!1,ol=Hn=Zm=Zi=Ga=At=0,In=Ds=null,eh=!1,a&8&&(a|=a&32);var s=n.entangledLanes;if(s!==0)for(n=n.entanglements,s&=a;0<s;){var p=31-yt(s),g=1<<p;a|=n[p],s&=~g}return ca=a,su(),o}function nx(n,a){qe=null,le.H=ks,a===Yo||a===gu?(a=x2(),at=3):a===sm?(a=x2(),at=4):at=a===Nm?8:typeof a=="object"&&a&&typeof a.then=="function"?6:1,Bn=a,We===null&&(At=1,Lu(n,rr(a,n.current)))}function rx(){var n=$n.current;return n===null?!0:(Qe&4194048)===Qe?xr===null:(Qe&62914560)===Qe||Qe&536870912?n===xr:!1}function ax(){var n=le.H;return le.H=ks,n===null?ks:n}function ix(){var n=le.A;return le.A=yL,n}function Vu(){At=4,Qa||(Qe&4194048)!==Qe&&$n.current!==null||(il=!0),!(Ga&134217727)&&!(Zi&134217727)||pt===null||Ja(pt,Qe,Hn,!1)}function ih(n,a,o){var s=nt;nt|=2;var p=ax(),g=ix();(pt!==n||Qe!==a)&&(qu=null,sl(n,a)),a=!1;var k=At;e:do try{if(at!==0&&We!==null){var I=We,N=Bn;switch(at){case 8:ah(),k=6;break e;case 3:case 2:case 9:case 6:$n.current===null&&(a=!0);var G=at;if(at=0,Bn=null,cl(n,I,N,G),o&&il){k=0;break e}break;default:G=at,at=0,Bn=null,cl(n,I,N,G)}}wL(),k=At;break}catch(se){nx(n,se)}while(!0);return a&&n.shellSuspendCounter++,Zr=Vi=null,nt=s,le.H=p,le.A=g,We===null&&(pt=null,Qe=0,su()),k}function wL(){for(;We!==null;)ox(We)}function xL(n,a){var o=nt;nt|=2;var s=ax(),p=ix();pt!==n||Qe!==a?(qu=null,Fu=Jt()+500,sl(n,a)):il=Oa(n,a);e:do try{if(at!==0&&We!==null){a=We;var g=Bn;t:switch(at){case 1:at=0,Bn=null,cl(n,a,g,1);break;case 2:case 9:if(b2(g)){at=0,Bn=null,lx(a);break}a=function(){at!==2&&at!==9||pt!==n||(at=7),da(n)},g.then(a,a);break e;case 3:at=7;break e;case 4:at=5;break e;case 7:b2(g)?(at=0,Bn=null,lx(a)):(at=0,Bn=null,cl(n,a,g,7));break;case 5:var k=null;switch(We.tag){case 26:k=We.memoizedState;case 5:case 27:var I=We;if(k?Kx(k):I.stateNode.complete){at=0,Bn=null;var N=I.sibling;if(N!==null)We=N;else{var G=I.return;G===null?We=null:(We=G,Bu(G))}break t}}at=0,Bn=null,cl(n,a,g,5);break;case 6:at=0,Bn=null,cl(n,a,g,6);break;case 8:ah(),At=6;break e;default:throw Error(l(462))}}_L();break}catch(se){nx(n,se)}while(!0);return Zr=Vi=null,le.H=s,le.A=p,nt=o,We===null?(pt=null,Qe=0,su(),At):0}function _L(){for(;We!==null&&!Dp();)ox(We)}function ox(n){var a=Lw(n.alternate,n,ca);n.memoizedProps=n.pendingProps,a===null?Bu(n):We=a}function lx(n){var a=n,o=a.alternate;switch(a.tag){case 15:case 0:a=Cw(o,a,a.pendingProps,a.type,void 0,Qe);break;case 11:a=Cw(o,a,a.pendingProps,a.type.render,a.ref,Qe);break;case 5:wm(a);default:Ow(o,a),a=We=s2(a,ca),a=Lw(o,a,ca)}n.memoizedProps=n.pendingProps,a===null?Bu(n):We=a}function cl(n,a,o,s){Zr=Vi=null,wm(a),Jo=null,hs=0;var p=a.return;try{if(uL(n,p,a,o,Qe)){At=1,Lu(n,rr(o,n.current)),We=null;return}}catch(g){if(p!==null)throw We=p,g;At=1,Lu(n,rr(o,n.current)),We=null;return}a.flags&32768?(Ye||s===1?n=!0:il||Qe&536870912?n=!1:(Qa=n=!0,(s===2||s===9||s===3||s===6)&&(s=$n.current,s!==null&&s.tag===13&&(s.flags|=16384))),sx(a,n)):Bu(a)}function Bu(n){var a=n;do{if(a.flags&32768){sx(a,Qa);return}n=a.return;var o=pL(a.alternate,a,ca);if(o!==null){We=o;return}if(a=a.sibling,a!==null){We=a;return}We=a=n}while(a!==null);At===0&&(At=5)}function sx(n,a){do{var o=mL(n.alternate,n);if(o!==null){o.flags&=32767,We=o;return}if(o=n.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!a&&(n=n.sibling,n!==null)){We=n;return}We=n=o}while(n!==null);At=6,We=null}function cx(n,a,o,s,p,g,k,I,N){n.cancelPendingCommit=null;do Hu();while(Ut!==0);if(nt&6)throw Error(l(327));if(a!==null){if(a===n.current)throw Error(l(177));if(g=a.lanes|a.childLanes,g|=Kp,Pp(n,o,g,k,I,N),n===pt&&(We=pt=null,Qe=0),ll=a,Ya=n,ua=o,th=g,nh=p,Jw=s,a.subtreeFlags&10256||a.flags&10256?(n.callbackNode=null,n.callbackPriority=0,EL(zt,function(){return mx(),null})):(n.callbackNode=null,n.callbackPriority=0),s=(a.flags&13878)!=0,a.subtreeFlags&13878||s){s=le.T,le.T=null,p=K.p,K.p=2,k=nt,nt|=4;try{hL(n,a,o)}finally{nt=k,K.p=p,le.T=s}}Ut=1,ux(),dx(),fx()}}function ux(){if(Ut===1){Ut=0;var n=Ya,a=ll,o=(a.flags&13878)!=0;if(a.subtreeFlags&13878||o){o=le.T,le.T=null;var s=K.p;K.p=2;var p=nt;nt|=4;try{Hw(a,n);var g=gh,k=Zb(n.containerInfo),I=g.focusedElem,N=g.selectionRange;if(k!==I&&I&&I.ownerDocument&&Jb(I.ownerDocument.documentElement,I)){if(N!==null&&Vp(I)){var G=N.start,se=N.end;if(se===void 0&&(se=G),"selectionStart"in I)I.selectionStart=G,I.selectionEnd=Math.min(se,I.value.length);else{var de=I.ownerDocument||document,J=de&&de.defaultView||window;if(J.getSelection){var re=J.getSelection(),Se=I.textContent.length,Me=Math.min(N.start,Se),dt=N.end===void 0?Me:Math.min(N.end,Se);!re.extend&&Me>dt&&(k=dt,dt=Me,Me=k);var B=Yb(I,Me),$=Yb(I,dt);if(B&&$&&(re.rangeCount!==1||re.anchorNode!==B.node||re.anchorOffset!==B.offset||re.focusNode!==$.node||re.focusOffset!==$.offset)){var Q=de.createRange();Q.setStart(B.node,B.offset),re.removeAllRanges(),Me>dt?(re.addRange(Q),re.extend($.node,$.offset)):(Q.setEnd($.node,$.offset),re.addRange(Q))}}}}for(de=[],re=I;re=re.parentNode;)re.nodeType===1&&de.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof I.focus=="function"&&I.focus(),I=0;I<de.length;I++){var ue=de[I];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}nd=!!hh,gh=hh=null}finally{nt=p,K.p=s,le.T=o}}n.current=a,Ut=2}}function dx(){if(Ut===2){Ut=0;var n=Ya,a=ll,o=(a.flags&8772)!=0;if(a.subtreeFlags&8772||o){o=le.T,le.T=null;var s=K.p;K.p=2;var p=nt;nt|=4;try{Fw(n,a.alternate,a)}finally{nt=p,K.p=s,le.T=o}}Ut=3}}function fx(){if(Ut===4||Ut===3){Ut=0,Vc();var n=Ya,a=ll,o=ua,s=Jw;a.subtreeFlags&10256||a.flags&10256?Ut=5:(Ut=0,ll=Ya=null,px(n,n.pendingLanes));var p=n.pendingLanes;if(p===0&&(Xa=null),Xl(o),a=a.stateNode,sn&&typeof sn.onCommitFiberRoot=="function")try{sn.onCommitFiberRoot(Ci,a,void 0,(a.current.flags&128)==128)}catch{}if(s!==null){a=le.T,p=K.p,K.p=2,le.T=null;try{for(var g=n.onRecoverableError,k=0;k<s.length;k++){var I=s[k];g(I.value,{componentStack:I.stack})}}finally{le.T=a,K.p=p}}ua&3&&Hu(),da(n),p=n.pendingLanes,o&261930&&p&42?n===rh?Os++:(Os=0,rh=n):Os=0,Ms(0,!1)}}function px(n,a){(n.pooledCacheLanes&=a)===0&&(a=n.pooledCache,a!=null&&(n.pooledCache=null,ps(a)))}function Hu(){return ux(),dx(),fx(),mx()}function mx(){if(Ut!==5)return!1;var n=Ya,a=th;th=0;var o=Xl(ua),s=le.T,p=K.p;try{K.p=32>o?32:o,le.T=null,o=nh,nh=null;var g=Ya,k=ua;if(Ut=0,ll=Ya=null,ua=0,nt&6)throw Error(l(331));var I=nt;if(nt|=4,Gw(g.current),Uw(g,g.current,k,o),nt=I,Ms(0,!1),sn&&typeof sn.onPostCommitFiberRoot=="function")try{sn.onPostCommitFiberRoot(Ci,g)}catch{}return!0}finally{K.p=p,le.T=s,px(n,a)}}function hx(n,a,o){a=rr(o,a),a=Pm(n.stateNode,a,2),n=Gi(n,a,2),n!==null&&(Ei(n,2),da(n))}function it(n,a,o){if(n.tag===3)hx(n,n,o);else for(;a!==null;){if(a.tag===3){hx(a,n,o);break}else if(a.tag===1){var s=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Xa===null||!Xa.has(s))){n=rr(o,n),o=gw(2),s=Gi(a,o,2),s!==null&&(yw(o,s,a,n),Ei(s,2),da(s));break}}a=a.return}}function oh(n,a,o){var s=n.pingCache;if(s===null){s=n.pingCache=new vL;var p=new Set;s.set(a,p)}else p=s.get(a),p===void 0&&(p=new Set,s.set(a,p));p.has(o)||(Jm=!0,p.add(o),n=kL.bind(null,n,a,o),a.then(n,n))}function kL(n,a,o){var s=n.pingCache;s!==null&&s.delete(a),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,pt===n&&(Qe&o)===o&&(At===4||At===3&&(Qe&62914560)===Qe&&300>Jt()-zu?!(nt&2)&&sl(n,0):Zm|=o,ol===Qe&&(ol=0)),da(n)}function gx(n,a){a===0&&(a=Wc()),n=Fi(n,a),n!==null&&(Ei(n,a),da(n))}function CL(n){var a=n.memoizedState,o=0;a!==null&&(o=a.retryLane),gx(n,o)}function SL(n,a){var o=0;switch(n.tag){case 31:case 13:var s=n.stateNode,p=n.memoizedState;p!==null&&(o=p.retryLane);break;case 19:s=n.stateNode;break;case 22:s=n.stateNode._retryCache;break;default:throw Error(l(314))}s!==null&&s.delete(a),gx(n,o)}function EL(n,a){return gr(n,a)}var Wu=null,ul=null,lh=!1,Uu=!1,sh=!1,Za=0;function da(n){n!==ul&&n.next===null&&(ul===null?Wu=ul=n:ul=ul.next=n),Uu=!0,lh||(lh=!0,IL())}function Ms(n,a){if(!sh&&Uu){sh=!0;do for(var o=!1,s=Wu;s!==null;){if(!a)if(n!==0){var p=s.pendingLanes;if(p===0)var g=0;else{var k=s.suspendedLanes,I=s.pingedLanes;g=(1<<31-yt(42|n)+1)-1,g&=p&~(k&~I),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(o=!0,wx(s,g))}else g=Qe,g=Oo(s,s===pt?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),!(g&3)||Oa(s,g)||(o=!0,wx(s,g));s=s.next}while(o);sh=!1}}function TL(){yx()}function yx(){Uu=lh=!1;var n=0;Za!==0&&NL()&&(n=Za);for(var a=Jt(),o=null,s=Wu;s!==null;){var p=s.next,g=vx(s,a);g===0?(s.next=null,o===null?Wu=p:o.next=p,p===null&&(ul=o)):(o=s,(n!==0||g&3)&&(Uu=!0)),s=p}Ut!==0&&Ut!==5||Ms(n,!1),Za!==0&&(Za=0)}function vx(n,a){for(var o=n.suspendedLanes,s=n.pingedLanes,p=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var k=31-yt(g),I=1<<k,N=p[k];N===-1?((I&o)===0||(I&s)!==0)&&(p[k]=Hc(I,a)):N<=a&&(n.expiredLanes|=I),g&=~I}if(a=pt,o=Qe,o=Oo(n,n===a?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),s=n.callbackNode,o===0||n===a&&(at===2||at===9)||n.cancelPendingCommit!==null)return s!==null&&s!==null&&kn(s),n.callbackNode=null,n.callbackPriority=0;if(!(o&3)||Oa(n,o)){if(a=o&-o,a===n.callbackPriority)return a;switch(s!==null&&kn(s),Xl(o)){case 2:case 8:o=Bc;break;case 32:o=zt;break;case 268435456:o=Tt;break;default:o=zt}return s=bx.bind(null,n),o=gr(o,s),n.callbackPriority=a,n.callbackNode=o,a}return s!==null&&s!==null&&kn(s),n.callbackPriority=2,n.callbackNode=null,2}function bx(n,a){if(Ut!==0&&Ut!==5)return n.callbackNode=null,n.callbackPriority=0,null;var o=n.callbackNode;if(Hu()&&n.callbackNode!==o)return null;var s=Qe;return s=Oo(n,n===pt?s:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),s===0?null:(ex(n,s,a),vx(n,Jt()),n.callbackNode!=null&&n.callbackNode===o?bx.bind(null,n):null)}function wx(n,a){if(Hu())return null;ex(n,a,!0)}function IL(){zL(function(){nt&6?gr(Hr,TL):yx()})}function ch(){if(Za===0){var n=Go;n===0&&(n=Si,Si<<=1,!(Si&261888)&&(Si=256)),Za=n}return Za}function xx(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:jo(""+n)}function _x(n,a){var o=a.ownerDocument.createElement("input");return o.name=a.name,o.value=a.value,n.id&&o.setAttribute("form",n.id),a.parentNode.insertBefore(o,a),n=new FormData(n),o.parentNode.removeChild(o),n}function AL(n,a,o,s,p){if(a==="submit"&&o&&o.stateNode===p){var g=xx((p[en]||null).action),k=s.submitter;k&&(a=(a=k[en]||null)?xx(a.formAction):k.getAttribute("formAction"),a!==null&&(g=a,k=null));var I=new u("action","action",null,s,p);n.push({event:I,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Za!==0){var N=k?_x(p,k):new FormData(p);Am(o,{pending:!0,data:N,method:p.method,action:g},null,N)}}else typeof g=="function"&&(I.preventDefault(),N=k?_x(p,k):new FormData(p),Am(o,{pending:!0,data:N,method:p.method,action:g},g,N))},currentTarget:p}]})}}for(var uh=0;uh<Up.length;uh++){var dh=Up[uh];wr(dh.toLowerCase(),"on"+(dh[0].toUpperCase()+dh.slice(1)))}wr(n2,"onAnimationEnd"),wr(r2,"onAnimationIteration"),wr(a2,"onAnimationStart"),wr("dblclick","onDoubleClick"),wr("focusin","onFocus"),wr("focusout","onBlur"),wr(HA,"onTransitionRun"),wr(WA,"onTransitionStart"),wr(UA,"onTransitionCancel"),wr(i2,"onTransitionEnd"),Na("onMouseEnter",["mouseout","mouseover"]),Na("onMouseLeave",["mouseout","mouseover"]),Na("onPointerEnter",["pointerout","pointerover"]),Na("onPointerLeave",["pointerout","pointerover"]),Mr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Mr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Mr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Mr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Mr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Mr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rs="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(" "),LL=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Rs));function kx(n,a){a=(a&4)!=0;for(var o=0;o<n.length;o++){var s=n[o],p=s.event;s=s.listeners;e:{var g=void 0;if(a)for(var k=s.length-1;0<=k;k--){var I=s[k],N=I.instance,G=I.currentTarget;if(I=I.listener,N!==g&&p.isPropagationStopped())break e;g=I,p.currentTarget=G;try{g(p)}catch(se){lu(se)}p.currentTarget=null,g=N}else for(k=0;k<s.length;k++){if(I=s[k],N=I.instance,G=I.currentTarget,I=I.listener,N!==g&&p.isPropagationStopped())break e;g=I,p.currentTarget=G;try{g(p)}catch(se){lu(se)}p.currentTarget=null,g=N}}}}function Ue(n,a){var o=a[Yl];o===void 0&&(o=a[Yl]=new Set);var s=n+"__bubble";o.has(s)||(Sx(a,n,2,!1),o.add(s))}function fh(n,a,o){var s=0;a&&(s|=4),Sx(o,n,s,a)}var Ku="_reactListening"+Math.random().toString(36).slice(2);function Cx(n){if(!n[Ku]){n[Ku]=!0,Zl.forEach(function(o){o!=="selectionchange"&&(LL.has(o)||fh(o,!1,n),fh(o,!0,n))});var a=n.nodeType===9?n:n.ownerDocument;a===null||a[Ku]||(a[Ku]=!0,fh("selectionchange",!1,a))}}function Sx(n,a,o,s){switch(Jx(a)){case 2:var p=o8;break;case 8:p=l8;break;default:p=Th}o=p.bind(null,a,o,n),p=void 0,!as||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(p=!0),s?p===void 0?n.addEventListener(a,o,!0):n.addEventListener(a,o,{capture:!0,passive:p}):p===void 0?n.addEventListener(a,o,!1):n.addEventListener(a,o,{passive:p})}function ph(n,a,o,s,p){var g=s;if(!(a&1)&&!(a&2)&&s!==null)e:for(;;){if(s===null)return;var k=s.tag;if(k===3||k===4){var I=s.stateNode.containerInfo;if(I===p)break;if(k===4)for(k=s.return;k!==null;){var N=k.tag;if((N===3||N===4)&&k.stateNode.containerInfo===p)return;k=k.return}for(;I!==null;){if(k=Or(I),k===null)return;if(N=k.tag,N===5||N===6||N===26||N===27){s=g=k;continue e}I=I.parentNode}}s=s.return}ru(function(){var G=g,se=ns(o),de=[];e:{var J=o2.get(n);if(J!==void 0){var re=u,Se=n;switch(n){case"keypress":if(Ri(o)===0)break e;case"keydown":case"keyup":re=Ce;break;case"focusin":Se="focus",re=P;break;case"focusout":Se="blur",re=P;break;case"beforeblur":case"afterblur":re=P;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=L;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=D;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=et;break;case n2:case r2:case a2:re=M;break;case i2:re=Be;break;case"scroll":case"scrollend":re=y;break;case"wheel":re=ft;break;case"copy":case"cut":case"paste":re=Z;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=Oe;break;case"toggle":case"beforetoggle":re=vt}var Me=(a&4)!=0,dt=!Me&&(n==="scroll"||n==="scrollend"),B=Me?J===null?null:J+"Capture":J;Me=[];for(var $=G,Q;$!==null;){var ue=$;if(Q=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||Q===null||B===null||(ue=Di($,B),ue!=null&&Me.push(Ps($,ue,Q))),dt)break;$=$.return}0<Me.length&&(J=new re(J,Se,null,o,se),de.push({event:J,listeners:Me}))}}if(!(a&7)){e:{if(J=n==="mouseover"||n==="pointerover",re=n==="mouseout"||n==="pointerout",J&&o!==Gt&&(Se=o.relatedTarget||o.fromElement)&&(Or(Se)||Se[Ma]))break e;if((re||J)&&(J=se.window===se?se:(J=se.ownerDocument)?J.defaultView||J.parentWindow:window,re?(Se=o.relatedTarget||o.toElement,re=G,Se=Se?Or(Se):null,Se!==null&&(dt=d(Se),Me=Se.tag,Se!==dt||Me!==5&&Me!==27&&Me!==6)&&(Se=null)):(re=null,Se=G),re!==Se)){if(Me=L,ue="onMouseLeave",B="onMouseEnter",$="mouse",(n==="pointerout"||n==="pointerover")&&(Me=Oe,ue="onPointerLeave",B="onPointerEnter",$="pointer"),dt=re==null?J:pn(re),Q=Se==null?J:pn(Se),J=new Me(ue,$+"leave",re,o,se),J.target=dt,J.relatedTarget=Q,ue=null,Or(se)===G&&(Me=new Me(B,$+"enter",Se,o,se),Me.target=Q,Me.relatedTarget=dt,ue=Me),dt=ue,re&&Se)t:{for(Me=DL,B=re,$=Se,Q=0,ue=B;ue;ue=Me(ue))Q++;ue=0;for(var Ae=$;Ae;Ae=Me(Ae))ue++;for(;0<Q-ue;)B=Me(B),Q--;for(;0<ue-Q;)$=Me($),ue--;for(;Q--;){if(B===$||$!==null&&B===$.alternate){Me=B;break t}B=Me(B),$=Me($)}Me=null}else Me=null;re!==null&&Ex(de,J,re,Me,!1),Se!==null&&dt!==null&&Ex(de,dt,Se,Me,!0)}}e:{if(J=G?pn(G):window,re=J.nodeName&&J.nodeName.toLowerCase(),re==="select"||re==="input"&&J.type==="file")var rt=Wb;else if(Bb(J))if(Ub)rt=$A;else{rt=FA;var Ee=zA}else re=J.nodeName,!re||re.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?G&&Li(G.elementType)&&(rt=Wb):rt=qA;if(rt&&(rt=rt(n,G))){Hb(de,rt,o,se);break e}Ee&&Ee(n,J,G),n==="focusout"&&G&&J.type==="number"&&G.memoizedProps.value!=null&&Kr(J,"number",J.value)}switch(Ee=G?pn(G):window,n){case"focusin":(Bb(Ee)||Ee.contentEditable==="true")&&($o=Ee,Bp=G,us=null);break;case"focusout":us=Bp=$o=null;break;case"mousedown":Hp=!0;break;case"contextmenu":case"mouseup":case"dragend":Hp=!1,e2(de,o,se);break;case"selectionchange":if(BA)break;case"keydown":case"keyup":e2(de,o,se)}var $e;if(Ne)e:{switch(n){case"compositionstart":var Ge="onCompositionStart";break e;case"compositionend":Ge="onCompositionEnd";break e;case"compositionupdate":Ge="onCompositionUpdate";break e}Ge=void 0}else qo?iu(n,o)&&(Ge="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&(Ge="onCompositionStart");Ge&&(Wt&&o.locale!=="ko"&&(qo||Ge!=="onCompositionStart"?Ge==="onCompositionEnd"&&qo&&($e=is()):(br=se,zo="value"in br?br.value:br.textContent,qo=!0)),Ee=Qu(G,Ge),0<Ee.length&&(Ge=new Y(Ge,n,null,o,se),de.push({event:Ge,listeners:Ee}),$e?Ge.data=$e:($e=Fo(o),$e!==null&&(Ge.data=$e)))),($e=Ft?RA(n,o):PA(n,o))&&(Ge=Qu(G,"onBeforeInput"),0<Ge.length&&(Ee=new Y("onBeforeInput","beforeinput",null,o,se),de.push({event:Ee,listeners:Ge}),Ee.data=$e)),AL(de,n,G,o,se)}kx(de,a)})}function Ps(n,a,o){return{instance:n,listener:a,currentTarget:o}}function Qu(n,a){for(var o=a+"Capture",s=[];n!==null;){var p=n,g=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||g===null||(p=Di(n,o),p!=null&&s.unshift(Ps(n,p,g)),p=Di(n,a),p!=null&&s.push(Ps(n,p,g))),n.tag===3)return s;n=n.return}return[]}function DL(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function Ex(n,a,o,s,p){for(var g=a._reactName,k=[];o!==null&&o!==s;){var I=o,N=I.alternate,G=I.stateNode;if(I=I.tag,N!==null&&N===s)break;I!==5&&I!==26&&I!==27||G===null||(N=G,p?(G=Di(o,g),G!=null&&k.unshift(Ps(o,G,N))):p||(G=Di(o,g),G!=null&&k.push(Ps(o,G,N)))),o=o.return}k.length!==0&&n.push({event:a,listeners:k})}var OL=/\r\n?/g,ML=/\u0000|\uFFFD/g;function Tx(n){return(typeof n=="string"?n:""+n).replace(OL,`
|
|
10
|
+
`).replace(ML,"")}function Ix(n,a){return a=Tx(a),Tx(n)===a}function ut(n,a,o,s,p,g){switch(o){case"children":typeof s=="string"?a==="body"||a==="textarea"&&s===""||Qr(n,s):(typeof s=="number"||typeof s=="bigint")&&a!=="body"&&Qr(n,""+s);break;case"className":Ai(n,"class",s);break;case"tabIndex":Ai(n,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Ai(n,o,s);break;case"style":eu(n,s,g);break;case"data":if(a!=="object"){Ai(n,"data",s);break}case"src":case"href":if(s===""&&(a!=="a"||o!=="href")){n.removeAttribute(o);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){n.removeAttribute(o);break}s=jo(""+s),n.setAttribute(o,s);break;case"action":case"formAction":if(typeof s=="function"){n.setAttribute(o,"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"&&(o==="formAction"?(a!=="input"&&ut(n,a,"name",p.name,p,null),ut(n,a,"formEncType",p.formEncType,p,null),ut(n,a,"formMethod",p.formMethod,p,null),ut(n,a,"formTarget",p.formTarget,p,null)):(ut(n,a,"encType",p.encType,p,null),ut(n,a,"method",p.method,p,null),ut(n,a,"target",p.target,p,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){n.removeAttribute(o);break}s=jo(""+s),n.setAttribute(o,s);break;case"onClick":s!=null&&(n.onclick=tr);break;case"onScroll":s!=null&&Ue("scroll",n);break;case"onScrollEnd":s!=null&&Ue("scrollend",n);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(o=s.__html,o!=null){if(p.children!=null)throw Error(l(60));n.innerHTML=o}}break;case"multiple":n.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":n.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){n.removeAttribute("xlink:href");break}o=jo(""+s),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?n.setAttribute(o,""+s):n.removeAttribute(o);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":s&&typeof s!="function"&&typeof s!="symbol"?n.setAttribute(o,""):n.removeAttribute(o);break;case"capture":case"download":s===!0?n.setAttribute(o,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?n.setAttribute(o,s):n.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?n.setAttribute(o,s):n.removeAttribute(o);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?n.removeAttribute(o):n.setAttribute(o,s);break;case"popover":Ue("beforetoggle",n),Ue("toggle",n),Ii(n,"popover",s);break;case"xlinkActuate":yr(n,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":yr(n,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":yr(n,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":yr(n,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":yr(n,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":yr(n,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":yr(n,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":yr(n,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":yr(n,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Ii(n,"is",s);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=No.get(o)||o,Ii(n,o,s))}}function mh(n,a,o,s,p,g){switch(o){case"style":eu(n,s,g);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(o=s.__html,o!=null){if(p.children!=null)throw Error(l(60));n.innerHTML=o}}break;case"children":typeof s=="string"?Qr(n,s):(typeof s=="number"||typeof s=="bigint")&&Qr(n,""+s);break;case"onScroll":s!=null&&Ue("scroll",n);break;case"onScrollEnd":s!=null&&Ue("scrollend",n);break;case"onClick":s!=null&&(n.onclick=tr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Gc.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(p=o.endsWith("Capture"),a=o.slice(2,p?o.length-7:void 0),g=n[en]||null,g=g==null?null:g[o],typeof g=="function"&&n.removeEventListener(a,g,p),typeof s=="function")){typeof g!="function"&&g!==null&&(o in n?n[o]=null:n.hasAttribute(o)&&n.removeAttribute(o)),n.addEventListener(a,s,p);break e}o in n?n[o]=s:s===!0?n.setAttribute(o,""):Ii(n,o,s)}}}function an(n,a,o){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ue("error",n),Ue("load",n);var s=!1,p=!1,g;for(g in o)if(o.hasOwnProperty(g)){var k=o[g];if(k!=null)switch(g){case"src":s=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,a));default:ut(n,a,g,k,o,null)}}p&&ut(n,a,"srcSet",o.srcSet,o,null),s&&ut(n,a,"src",o.src,o,null);return;case"input":Ue("invalid",n);var I=g=k=p=null,N=null,G=null;for(s in o)if(o.hasOwnProperty(s)){var se=o[s];if(se!=null)switch(s){case"name":p=se;break;case"type":k=se;break;case"checked":N=se;break;case"defaultChecked":G=se;break;case"value":g=se;break;case"defaultValue":I=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(l(137,a));break;default:ut(n,a,s,se,o,null)}}Zc(n,g,I,N,G,k,p,!1);return;case"select":for(p in Ue("invalid",n),s=k=g=null,o)if(o.hasOwnProperty(p)&&(I=o[p],I!=null))switch(p){case"value":g=I;break;case"defaultValue":k=I;break;case"multiple":s=I;default:ut(n,a,p,I,o,null)}a=g,o=k,n.multiple=!!s,a==null?o!=null&&za(n,!!s,o,!0):za(n,!!s,a,!1);return;case"textarea":for(k in Ue("invalid",n),g=p=s=null,o)if(o.hasOwnProperty(k)&&(I=o[k],I!=null))switch(k){case"value":s=I;break;case"defaultValue":p=I;break;case"children":g=I;break;case"dangerouslySetInnerHTML":if(I!=null)throw Error(l(91));break;default:ut(n,a,k,I,o,null)}Po(n,s,p,g);return;case"option":for(N in o)o.hasOwnProperty(N)&&(s=o[N],s!=null)&&(N==="selected"?n.selected=s&&typeof s!="function"&&typeof s!="symbol":ut(n,a,N,s,o,null));return;case"dialog":Ue("beforetoggle",n),Ue("toggle",n),Ue("cancel",n),Ue("close",n);break;case"iframe":case"object":Ue("load",n);break;case"video":case"audio":for(s=0;s<Rs.length;s++)Ue(Rs[s],n);break;case"image":Ue("error",n),Ue("load",n);break;case"details":Ue("toggle",n);break;case"embed":case"source":case"link":Ue("error",n),Ue("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(G in o)if(o.hasOwnProperty(G)&&(s=o[G],s!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,a));default:ut(n,a,G,s,o,null)}return;default:if(Li(a)){for(se in o)o.hasOwnProperty(se)&&(s=o[se],s!==void 0&&mh(n,a,se,s,o,void 0));return}}for(I in o)o.hasOwnProperty(I)&&(s=o[I],s!=null&&ut(n,a,I,s,o,null))}function RL(n,a,o,s){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,g=null,k=null,I=null,N=null,G=null,se=null;for(re in o){var de=o[re];if(o.hasOwnProperty(re)&&de!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":N=de;default:s.hasOwnProperty(re)||ut(n,a,re,null,s,de)}}for(var J in s){var re=s[J];if(de=o[J],s.hasOwnProperty(J)&&(re!=null||de!=null))switch(J){case"type":g=re;break;case"name":p=re;break;case"checked":G=re;break;case"defaultChecked":se=re;break;case"value":k=re;break;case"defaultValue":I=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(l(137,a));break;default:re!==de&&ut(n,a,J,re,s,de)}}ja(n,k,I,N,G,se,g,p);return;case"select":for(g in re=k=I=J=null,o)if(N=o[g],o.hasOwnProperty(g)&&N!=null)switch(g){case"value":break;case"multiple":re=N;default:s.hasOwnProperty(g)||ut(n,a,g,null,s,N)}for(p in s)if(g=s[p],N=o[p],s.hasOwnProperty(p)&&(g!=null||N!=null))switch(p){case"value":J=g;break;case"defaultValue":I=g;break;case"multiple":k=g;default:g!==N&&ut(n,a,p,g,s,N)}a=I,o=k,s=re,J==null?!!s!=!!o&&(a==null?za(n,!!o,o?[]:"",!1):za(n,!!o,a,!0)):za(n,!!o,J,!1);return;case"textarea":for(I in re=J=null,o)if(p=o[I],o.hasOwnProperty(I)&&p!=null&&!s.hasOwnProperty(I))switch(I){case"value":break;case"children":break;default:ut(n,a,I,null,s,p)}for(k in s)if(p=s[k],g=o[k],s.hasOwnProperty(k)&&(p!=null||g!=null))switch(k){case"value":J=p;break;case"defaultValue":re=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(l(91));break;default:p!==g&&ut(n,a,k,p,s,g)}Fa(n,J,re);return;case"option":for(var Se in o)J=o[Se],o.hasOwnProperty(Se)&&J!=null&&!s.hasOwnProperty(Se)&&(Se==="selected"?n.selected=!1:ut(n,a,Se,null,s,J));for(N in s)J=s[N],re=o[N],s.hasOwnProperty(N)&&J!==re&&(J!=null||re!=null)&&(N==="selected"?n.selected=J&&typeof J!="function"&&typeof J!="symbol":ut(n,a,N,J,s,re));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 Me in o)J=o[Me],o.hasOwnProperty(Me)&&J!=null&&!s.hasOwnProperty(Me)&&ut(n,a,Me,null,s,J);for(G in s)if(J=s[G],re=o[G],s.hasOwnProperty(G)&&J!==re&&(J!=null||re!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(l(137,a));break;default:ut(n,a,G,J,s,re)}return;default:if(Li(a)){for(var dt in o)J=o[dt],o.hasOwnProperty(dt)&&J!==void 0&&!s.hasOwnProperty(dt)&&mh(n,a,dt,void 0,s,J);for(se in s)J=s[se],re=o[se],!s.hasOwnProperty(se)||J===re||J===void 0&&re===void 0||mh(n,a,se,J,s,re);return}}for(var B in o)J=o[B],o.hasOwnProperty(B)&&J!=null&&!s.hasOwnProperty(B)&&ut(n,a,B,null,s,J);for(de in s)J=s[de],re=o[de],!s.hasOwnProperty(de)||J===re||J==null&&re==null||ut(n,a,de,J,s,re)}function Ax(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function PL(){if(typeof performance.getEntriesByType=="function"){for(var n=0,a=0,o=performance.getEntriesByType("resource"),s=0;s<o.length;s++){var p=o[s],g=p.transferSize,k=p.initiatorType,I=p.duration;if(g&&I&&Ax(k)){for(k=0,I=p.responseEnd,s+=1;s<o.length;s++){var N=o[s],G=N.startTime;if(G>I)break;var se=N.transferSize,de=N.initiatorType;se&&Ax(de)&&(N=N.responseEnd,k+=se*(N<I?1:(I-G)/(N-G)))}if(--s,a+=8*(g+k)/(p.duration/1e3),n++,10<n)break}}if(0<n)return a/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var hh=null,gh=null;function Gu(n){return n.nodeType===9?n:n.ownerDocument}function Lx(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Dx(n,a){if(n===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&a==="foreignObject"?0:n}function yh(n,a){return n==="textarea"||n==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var vh=null;function NL(){var n=window.event;return n&&n.type==="popstate"?n===vh?!1:(vh=n,!0):(vh=null,!1)}var Ox=typeof setTimeout=="function"?setTimeout:void 0,jL=typeof clearTimeout=="function"?clearTimeout:void 0,Mx=typeof Promise=="function"?Promise:void 0,zL=typeof queueMicrotask=="function"?queueMicrotask:Mx===void 0?Ox:function(n){return Mx.resolve(null).then(n).catch(FL)};function FL(n){setTimeout(function(){throw n})}function ei(n){return n==="head"}function Rx(n,a){var o=a,s=0;do{var p=o.nextSibling;if(n.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"||o==="/&"){if(s===0){n.removeChild(p),ml(a);return}s--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")s++;else if(o==="html")Ns(n.ownerDocument.documentElement);else if(o==="head"){o=n.ownerDocument.head,Ns(o);for(var g=o.firstChild;g;){var k=g.nextSibling,I=g.nodeName;g[Ti]||I==="SCRIPT"||I==="STYLE"||I==="LINK"&&g.rel.toLowerCase()==="stylesheet"||o.removeChild(g),g=k}}else o==="body"&&Ns(n.ownerDocument.body);o=p}while(o);ml(a)}function Px(n,a){var o=n;n=0;do{var s=o.nextSibling;if(o.nodeType===1?a?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(a?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),s&&s.nodeType===8)if(o=s.data,o==="/$"){if(n===0)break;n--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||n++;o=s}while(o)}function bh(n){var a=n.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var o=a;switch(a=a.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":bh(o),Ro(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function qL(n,a,o,s){for(;n.nodeType===1;){var p=o;if(n.nodeName.toLowerCase()!==a.toLowerCase()){if(!s&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(s){if(!n[Ti])switch(a){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(g=n.getAttribute("rel"),g==="stylesheet"&&n.hasAttribute("data-precedence")||g!==p.rel||n.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||n.getAttribute("title")!==(p.title==null?null:p.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(g=n.getAttribute("src"),(g!==(p.src==null?null:p.src)||n.getAttribute("type")!==(p.type==null?null:p.type)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&g&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(a==="input"&&n.type==="hidden"){var g=p.name==null?null:""+p.name;if(p.type==="hidden"&&n.getAttribute("name")===g)return n}else return n;if(n=sr(n.nextSibling),n===null)break}return null}function $L(n,a,o){if(a==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=sr(n.nextSibling),n===null))return null;return n}function Nx(n,a){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!a||(n=sr(n.nextSibling),n===null))return null;return n}function wh(n){return n.data==="$?"||n.data==="$~"}function xh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function VL(n,a){var o=n.ownerDocument;if(n.data==="$~")n._reactRetry=a;else if(n.data!=="$?"||o.readyState!=="loading")a();else{var s=function(){a(),o.removeEventListener("DOMContentLoaded",s)};o.addEventListener("DOMContentLoaded",s),n._reactRetry=s}}function sr(n){for(;n!=null;n=n.nextSibling){var a=n.nodeType;if(a===1||a===3)break;if(a===8){if(a=n.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return n}var _h=null;function jx(n){n=n.nextSibling;for(var a=0;n;){if(n.nodeType===8){var o=n.data;if(o==="/$"||o==="/&"){if(a===0)return sr(n.nextSibling);a--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||a++}n=n.nextSibling}return null}function zx(n){n=n.previousSibling;for(var a=0;n;){if(n.nodeType===8){var o=n.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(a===0)return n;a--}else o!=="/$"&&o!=="/&"||a++}n=n.previousSibling}return null}function Fx(n,a,o){switch(a=Gu(o),n){case"html":if(n=a.documentElement,!n)throw Error(l(452));return n;case"head":if(n=a.head,!n)throw Error(l(453));return n;case"body":if(n=a.body,!n)throw Error(l(454));return n;default:throw Error(l(451))}}function Ns(n){for(var a=n.attributes;a.length;)n.removeAttributeNode(a[0]);Ro(n)}var cr=new Map,qx=new Set;function Xu(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var fa=K.d;K.d={f:BL,r:HL,D:WL,C:UL,L:KL,m:QL,X:XL,S:GL,M:YL};function BL(){var n=fa.f(),a=$u();return n||a}function HL(n){var a=Ra(n);a!==null&&a.tag===5&&a.type==="form"?iw(a):fa.r(n)}var dl=typeof document>"u"?null:document;function $x(n,a,o){var s=dl;if(s&&typeof a=="string"&&a){var p=zn(a);p='link[rel="'+n+'"][href="'+p+'"]',typeof o=="string"&&(p+='[crossorigin="'+o+'"]'),qx.has(p)||(qx.add(p),n={rel:n,crossOrigin:o,href:a},s.querySelector(p)===null&&(a=s.createElement("link"),an(a,"link",n),Mt(a),s.head.appendChild(a)))}}function WL(n){fa.D(n),$x("dns-prefetch",n,null)}function UL(n,a){fa.C(n,a),$x("preconnect",n,a)}function KL(n,a,o){fa.L(n,a,o);var s=dl;if(s&&n&&a){var p='link[rel="preload"][as="'+zn(a)+'"]';a==="image"&&o&&o.imageSrcSet?(p+='[imagesrcset="'+zn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(p+='[imagesizes="'+zn(o.imageSizes)+'"]')):p+='[href="'+zn(n)+'"]';var g=p;switch(a){case"style":g=fl(n);break;case"script":g=pl(n)}cr.has(g)||(n=S({rel:"preload",href:a==="image"&&o&&o.imageSrcSet?void 0:n,as:a},o),cr.set(g,n),s.querySelector(p)!==null||a==="style"&&s.querySelector(js(g))||a==="script"&&s.querySelector(zs(g))||(a=s.createElement("link"),an(a,"link",n),Mt(a),s.head.appendChild(a)))}}function QL(n,a){fa.m(n,a);var o=dl;if(o&&n){var s=a&&typeof a.as=="string"?a.as:"script",p='link[rel="modulepreload"][as="'+zn(s)+'"][href="'+zn(n)+'"]',g=p;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=pl(n)}if(!cr.has(g)&&(n=S({rel:"modulepreload",href:n},a),cr.set(g,n),o.querySelector(p)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(zs(g)))return}s=o.createElement("link"),an(s,"link",n),Mt(s),o.head.appendChild(s)}}}function GL(n,a,o){fa.S(n,a,o);var s=dl;if(s&&n){var p=Pa(s).hoistableStyles,g=fl(n);a||(a="default");var k=p.get(g);if(!k){var I={loading:0,preload:null};if(k=s.querySelector(js(g)))I.loading=5;else{n=S({rel:"stylesheet",href:n,"data-precedence":a},o),(o=cr.get(g))&&kh(n,o);var N=k=s.createElement("link");Mt(N),an(N,"link",n),N._p=new Promise(function(G,se){N.onload=G,N.onerror=se}),N.addEventListener("load",function(){I.loading|=1}),N.addEventListener("error",function(){I.loading|=2}),I.loading|=4,Yu(k,a,s)}k={type:"stylesheet",instance:k,count:1,state:I},p.set(g,k)}}}function XL(n,a){fa.X(n,a);var o=dl;if(o&&n){var s=Pa(o).hoistableScripts,p=pl(n),g=s.get(p);g||(g=o.querySelector(zs(p)),g||(n=S({src:n,async:!0},a),(a=cr.get(p))&&Ch(n,a),g=o.createElement("script"),Mt(g),an(g,"link",n),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},s.set(p,g))}}function YL(n,a){fa.M(n,a);var o=dl;if(o&&n){var s=Pa(o).hoistableScripts,p=pl(n),g=s.get(p);g||(g=o.querySelector(zs(p)),g||(n=S({src:n,async:!0,type:"module"},a),(a=cr.get(p))&&Ch(n,a),g=o.createElement("script"),Mt(g),an(g,"link",n),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},s.set(p,g))}}function Vx(n,a,o,s){var p=(p=jt.current)?Xu(p):null;if(!p)throw Error(l(446));switch(n){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(a=fl(o.href),o=Pa(p).hoistableStyles,s=o.get(a),s||(s={type:"style",instance:null,count:0,state:null},o.set(a,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){n=fl(o.href);var g=Pa(p).hoistableStyles,k=g.get(n);if(k||(p=p.ownerDocument||p,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,k),(g=p.querySelector(js(n)))&&!g._p&&(k.instance=g,k.state.loading=5),cr.has(n)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},cr.set(n,o),g||JL(p,n,o,k.state))),a&&s===null)throw Error(l(528,""));return k}if(a&&s!==null)throw Error(l(529,""));return null;case"script":return a=o.async,o=o.src,typeof o=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=pl(o),o=Pa(p).hoistableScripts,s=o.get(a),s||(s={type:"script",instance:null,count:0,state:null},o.set(a,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,n))}}function fl(n){return'href="'+zn(n)+'"'}function js(n){return'link[rel="stylesheet"]['+n+"]"}function Bx(n){return S({},n,{"data-precedence":n.precedence,precedence:null})}function JL(n,a,o,s){n.querySelector('link[rel="preload"][as="style"]['+a+"]")?s.loading=1:(a=n.createElement("link"),s.preload=a,a.addEventListener("load",function(){return s.loading|=1}),a.addEventListener("error",function(){return s.loading|=2}),an(a,"link",o),Mt(a),n.head.appendChild(a))}function pl(n){return'[src="'+zn(n)+'"]'}function zs(n){return"script[async]"+n}function Hx(n,a,o){if(a.count++,a.instance===null)switch(a.type){case"style":var s=n.querySelector('style[data-href~="'+zn(o.href)+'"]');if(s)return a.instance=s,Mt(s),s;var p=S({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return s=(n.ownerDocument||n).createElement("style"),Mt(s),an(s,"style",p),Yu(s,o.precedence,n),a.instance=s;case"stylesheet":p=fl(o.href);var g=n.querySelector(js(p));if(g)return a.state.loading|=4,a.instance=g,Mt(g),g;s=Bx(o),(p=cr.get(p))&&kh(s,p),g=(n.ownerDocument||n).createElement("link"),Mt(g);var k=g;return k._p=new Promise(function(I,N){k.onload=I,k.onerror=N}),an(g,"link",s),a.state.loading|=4,Yu(g,o.precedence,n),a.instance=g;case"script":return g=pl(o.src),(p=n.querySelector(zs(g)))?(a.instance=p,Mt(p),p):(s=o,(p=cr.get(g))&&(s=S({},o),Ch(s,p)),n=n.ownerDocument||n,p=n.createElement("script"),Mt(p),an(p,"link",s),n.head.appendChild(p),a.instance=p);case"void":return null;default:throw Error(l(443,a.type))}else a.type==="stylesheet"&&!(a.state.loading&4)&&(s=a.instance,a.state.loading|=4,Yu(s,o.precedence,n));return a.instance}function Yu(n,a,o){for(var s=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=s.length?s[s.length-1]:null,g=p,k=0;k<s.length;k++){var I=s[k];if(I.dataset.precedence===a)g=I;else if(g!==p)break}g?g.parentNode.insertBefore(n,g.nextSibling):(a=o.nodeType===9?o.head:o,a.insertBefore(n,a.firstChild))}function kh(n,a){n.crossOrigin??(n.crossOrigin=a.crossOrigin),n.referrerPolicy??(n.referrerPolicy=a.referrerPolicy),n.title??(n.title=a.title)}function Ch(n,a){n.crossOrigin??(n.crossOrigin=a.crossOrigin),n.referrerPolicy??(n.referrerPolicy=a.referrerPolicy),n.integrity??(n.integrity=a.integrity)}var Ju=null;function Wx(n,a,o){if(Ju===null){var s=new Map,p=Ju=new Map;p.set(o,s)}else p=Ju,s=p.get(o),s||(s=new Map,p.set(o,s));if(s.has(n))return s;for(s.set(n,null),o=o.getElementsByTagName(n),p=0;p<o.length;p++){var g=o[p];if(!(g[Ti]||g[Ht]||n==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var k=g.getAttribute(a)||"";k=n+k;var I=s.get(k);I?I.push(g):s.set(k,[g])}}return s}function Ux(n,a,o){n=n.ownerDocument||n,n.head.insertBefore(o,a==="title"?n.querySelector("head > title"):null)}function ZL(n,a,o){if(o===1||a.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(n=a.disabled,typeof a.precedence=="string"&&n==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function Kx(n){return!(n.type==="stylesheet"&&!(n.state.loading&3))}function e8(n,a,o,s){if(o.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&!(o.state.loading&4)){if(o.instance===null){var p=fl(s.href),g=a.querySelector(js(p));if(g){a=g._p,typeof a=="object"&&a&&typeof a.then=="function"&&(n.count++,n=Zu.bind(n),a.then(n,n)),o.state.loading|=4,o.instance=g,Mt(g);return}g=a.ownerDocument||a,s=Bx(s),(p=cr.get(p))&&kh(s,p),g=g.createElement("link"),Mt(g);var k=g;k._p=new Promise(function(I,N){k.onload=I,k.onerror=N}),an(g,"link",s),o.instance=g}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(o,a),(a=o.state.preload)&&!(o.state.loading&3)&&(n.count++,o=Zu.bind(n),a.addEventListener("load",o),a.addEventListener("error",o))}}var Sh=0;function t8(n,a){return n.stylesheets&&n.count===0&&td(n,n.stylesheets),0<n.count||0<n.imgCount?function(o){var s=setTimeout(function(){if(n.stylesheets&&td(n,n.stylesheets),n.unsuspend){var g=n.unsuspend;n.unsuspend=null,g()}},6e4+a);0<n.imgBytes&&Sh===0&&(Sh=62500*PL());var p=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&td(n,n.stylesheets),n.unsuspend)){var g=n.unsuspend;n.unsuspend=null,g()}},(n.imgBytes>Sh?50:800)+a);return n.unsuspend=o,function(){n.unsuspend=null,clearTimeout(s),clearTimeout(p)}}:null}function Zu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)td(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var ed=null;function td(n,a){n.stylesheets=null,n.unsuspend!==null&&(n.count++,ed=new Map,a.forEach(n8,n),ed=null,Zu.call(n))}function n8(n,a){if(!(a.state.loading&4)){var o=ed.get(n);if(o)var s=o.get(null);else{o=new Map,ed.set(n,o);for(var p=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<p.length;g++){var k=p[g];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(o.set(k.dataset.precedence,k),s=k)}s&&o.set(null,s)}p=a.instance,k=p.getAttribute("data-precedence"),g=o.get(k)||s,g===s&&o.set(null,p),o.set(k,p),this.count++,s=Zu.bind(this),p.addEventListener("load",s),p.addEventListener("error",s),g?g.parentNode.insertBefore(p,g.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(p,n.firstChild)),a.state.loading|=4}}var Fs={$$typeof:X,Provider:null,Consumer:null,_currentValue:Le,_currentValue2:Le,_threadCount:0};function r8(n,a,o,s,p,g,k,I,N){this.tag=1,this.containerInfo=n,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=Gl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gl(0),this.hiddenUpdates=Gl(null),this.identifierPrefix=s,this.onUncaughtError=p,this.onCaughtError=g,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function a8(n,a,o,s,p,g,k,I,N,G,se,de){return n=new r8(n,a,o,k,N,G,se,de,I),a=1,g===!0&&(a|=24),g=qn(3,null,null,a),n.current=g,g.stateNode=n,a=im(),a.refCount++,n.pooledCache=a,a.refCount++,g.memoizedState={element:s,isDehydrated:o,cache:a},cm(g),n}function i8(n){return n?(n=Ho,n):Ho}function Qx(n,a,o,s,p,g){p=i8(p),s.context===null?s.context=p:s.pendingContext=p,s=Qi(a),s.payload={element:o},g=g===void 0?null:g,g!==null&&(s.callback=g),o=Gi(n,s,a),o!==null&&(An(o,n,a),ys(o,n,a))}function Gx(n,a){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var o=n.retryLane;n.retryLane=o!==0&&o<a?o:a}}function Eh(n,a){Gx(n,a),(n=n.alternate)&&Gx(n,a)}function Xx(n){if(n.tag===13||n.tag===31){var a=Fi(n,67108864);a!==null&&An(a,n,67108864),Eh(n,67108864)}}function Yx(n){if(n.tag===13||n.tag===31){var a=lr();a=Nn(a);var o=Fi(n,a);o!==null&&An(o,n,a),Eh(n,a)}}var nd=!0;function o8(n,a,o,s){var p=le.T;le.T=null;var g=K.p;try{K.p=2,Th(n,a,o,s)}finally{K.p=g,le.T=p}}function l8(n,a,o,s){var p=le.T;le.T=null;var g=K.p;try{K.p=8,Th(n,a,o,s)}finally{K.p=g,le.T=p}}function Th(n,a,o,s){if(nd){var p=Ih(s);if(p===null)ph(n,a,s,rd,o),Zx(n,s);else if(c8(p,n,a,o,s))s.stopPropagation();else if(Zx(n,s),a&4&&-1<s8.indexOf(n)){for(;p!==null;){var g=Ra(p);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var k=Wr(g.pendingLanes);if(k!==0){var I=g;for(I.pendingLanes|=2,I.entangledLanes|=2;k;){var N=1<<31-yt(k);I.entanglements[1]|=N,k&=~N}da(g),!(nt&6)&&(Fu=Jt()+500,Ms(0,!1))}}break;case 31:case 13:I=Fi(g,2),I!==null&&An(I,g,2),$u(),Eh(g,2)}if(g=Ih(s),g===null&&ph(n,a,s,rd,o),g===p)break;p=g}p!==null&&s.stopPropagation()}else ph(n,a,s,null,o)}}function Ih(n){return n=ns(n),Ah(n)}var rd=null;function Ah(n){if(rd=null,n=Or(n),n!==null){var a=d(n);if(a===null)n=null;else{var o=a.tag;if(o===13){if(n=f(a),n!==null)return n;n=null}else if(o===31){if(n=h(a),n!==null)return n;n=null}else if(o===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;n=null}else a!==n&&(n=null)}}return rd=n,null}function Jx(n){switch(n){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(Op()){case Hr:return 2;case Bc:return 8;case zt:case Do:return 32;case Tt:return 268435456;default:return 32}default:return 32}}var Lh=!1,ti=null,ni=null,ri=null,qs=new Map,$s=new Map,ai=[],s8="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 Zx(n,a){switch(n){case"focusin":case"focusout":ti=null;break;case"dragenter":case"dragleave":ni=null;break;case"mouseover":case"mouseout":ri=null;break;case"pointerover":case"pointerout":qs.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":$s.delete(a.pointerId)}}function Vs(n,a,o,s,p,g){return n===null||n.nativeEvent!==g?(n={blockedOn:a,domEventName:o,eventSystemFlags:s,nativeEvent:g,targetContainers:[p]},a!==null&&(a=Ra(a),a!==null&&Xx(a)),n):(n.eventSystemFlags|=s,a=n.targetContainers,p!==null&&a.indexOf(p)===-1&&a.push(p),n)}function c8(n,a,o,s,p){switch(a){case"focusin":return ti=Vs(ti,n,a,o,s,p),!0;case"dragenter":return ni=Vs(ni,n,a,o,s,p),!0;case"mouseover":return ri=Vs(ri,n,a,o,s,p),!0;case"pointerover":var g=p.pointerId;return qs.set(g,Vs(qs.get(g)||null,n,a,o,s,p)),!0;case"gotpointercapture":return g=p.pointerId,$s.set(g,Vs($s.get(g)||null,n,a,o,s,p)),!0}return!1}function e_(n){var a=Or(n.target);if(a!==null){var o=d(a);if(o!==null){if(a=o.tag,a===13){if(a=f(o),a!==null){n.blockedOn=a,jn(n.priority,function(){Yx(o)});return}}else if(a===31){if(a=h(o),a!==null){n.blockedOn=a,jn(n.priority,function(){Yx(o)});return}}else if(a===3&&o.stateNode.current.memoizedState.isDehydrated){n.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}n.blockedOn=null}function ad(n){if(n.blockedOn!==null)return!1;for(var a=n.targetContainers;0<a.length;){var o=Ih(n.nativeEvent);if(o===null){o=n.nativeEvent;var s=new o.constructor(o.type,o);Gt=s,o.target.dispatchEvent(s),Gt=null}else return a=Ra(o),a!==null&&Xx(a),n.blockedOn=o,!1;a.shift()}return!0}function t_(n,a,o){ad(n)&&o.delete(a)}function u8(){Lh=!1,ti!==null&&ad(ti)&&(ti=null),ni!==null&&ad(ni)&&(ni=null),ri!==null&&ad(ri)&&(ri=null),qs.forEach(t_),$s.forEach(t_)}function id(n,a){n.blockedOn===a&&(n.blockedOn=null,Lh||(Lh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,u8)))}var od=null;function n_(n){od!==n&&(od=n,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){od===n&&(od=null);for(var a=0;a<n.length;a+=3){var o=n[a],s=n[a+1],p=n[a+2];if(typeof s!="function"){if(Ah(s||o)===null)continue;break}var g=Ra(o);g!==null&&(n.splice(a,3),a-=3,Am(g,{pending:!0,data:p,method:o.method,action:s},s,p))}}))}function ml(n){function a(N){return id(N,n)}ti!==null&&id(ti,n),ni!==null&&id(ni,n),ri!==null&&id(ri,n),qs.forEach(a),$s.forEach(a);for(var o=0;o<ai.length;o++){var s=ai[o];s.blockedOn===n&&(s.blockedOn=null)}for(;0<ai.length&&(o=ai[0],o.blockedOn===null);)e_(o),o.blockedOn===null&&ai.shift();if(o=(n.ownerDocument||n).$$reactFormReplay,o!=null)for(s=0;s<o.length;s+=3){var p=o[s],g=o[s+1],k=p[en]||null;if(typeof g=="function")k||n_(o);else if(k){var I=null;if(g&&g.hasAttribute("formAction")){if(p=g,k=g[en]||null)I=k.formAction;else if(Ah(p)!==null)continue}else I=k.action;typeof I=="function"?o[s+1]=I:(o.splice(s,3),s-=3),n_(o)}}}function d8(){function n(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(k){return p=k})},focusReset:"manual",scroll:"manual"})}function a(){p!==null&&(p(),p=null),s||setTimeout(o,20)}function o(){if(!s&&!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 s=!1,p=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(o,100),function(){s=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),p!==null&&(p(),p=null)}}}function Dh(n){this._internalRoot=n}Oh.prototype.render=Dh.prototype.render=function(n){var a=this._internalRoot;if(a===null)throw Error(l(409));var o=a.current;Qx(o,lr(),n,a,null,null)},Oh.prototype.unmount=Dh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var a=n.containerInfo;Qx(n.current,2,null,n,null,null),$u(),a[Ma]=null}};function Oh(n){this._internalRoot=n}Oh.prototype.unstable_scheduleHydration=function(n){if(n){var a=Kc();n={blockedOn:null,target:n,priority:a};for(var o=0;o<ai.length&&a!==0&&a<ai[o].priority;o++);ai.splice(o,0,n),o===0&&e_(n)}};var r_=r.version;if(r_!=="19.2.4")throw Error(l(527,r_,"19.2.4"));K.findDOMNode=function(n){var a=n._reactInternals;if(a===void 0)throw typeof n.render=="function"?Error(l(188)):(n=Object.keys(n).join(","),Error(l(268,n)));return n=x(a),n=n===null?null:C(n),n=n===null?null:n.stateNode,n};var f8={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:le,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ld=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ld.isDisabled&&ld.supportsFiber)try{Ci=ld.inject(f8),sn=ld}catch{}}e.createRoot=function(n,a){if(!c(n))throw Error(l(299));var o=!1,s="",p=lL,g=sL,k=cL;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(s=a.identifierPrefix),a.onUncaughtError!==void 0&&(p=a.onUncaughtError),a.onCaughtError!==void 0&&(g=a.onCaughtError),a.onRecoverableError!==void 0&&(k=a.onRecoverableError)),a=a8(n,1,!1,null,null,o,s,null,p,g,k,d8),n[Ma]=a.current,Cx(n),new Dh(a)}})),Jd=on(((e,t)=>{function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(i){console.error(i)}}r(),t.exports=di()})),BigInt.prototype.toJSON=function(){return JSON.rawJSON(this.toString())},P0=function(e){try{return JSON.parse(e,(t,r)=>ef(r))}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,(t,r)=>typeof r=="string"?r==="\u25D0NaN\u25D0"?NaN:r==="\u25D0Infinity\u25D0"?1/0:r==="\u25D0-Infinity\u25D0"?-1/0:ef(r):ef(r))}catch{return{}}},$C=function(e){if(e.length===0)return"";let t=Object.keys(e[0]);return[`| ${t.join(" | ")} |`,`|${t.map(()=>"---").join("|")}|`,...e.map(r=>`| ${t.map(i=>rS(r[i])).join(" | ")} |`)].join(`
|
|
11
|
+
`)};function rS(e){if(e==null)return"";if(Array.isArray(e)||typeof e=="object")return xg(JSON.stringify(e));let t=String(e),r=/\[([^\]]+)]\((https?:\/\/[^)]+)\)/g,i=new Map,l=0;t=t.replaceAll(r,c=>{let d=`__MDLINK_${l++}__`;return i.set(d,c),d}),t=t.replaceAll(/(https?:\/\/\S+)/g,"[$1]($1)");for(let[c,d]of i)t=t.replace(c,d);return xg(t)}function xg(e){return e.replaceAll("\\","\\\\").replaceAll("|","\\|").replaceAll(`
|
|
12
|
+
`," ").replaceAll("\r","")}function ef(e){return typeof e=="object"&&e&&"$bigint"in e&&typeof e.$bigint=="string"?BigInt(e.$bigint):e}U0="object-id",nC="random-id";var _g="abcdefghijklmnopqrstuvwxyz",kg=_g+_g.toUpperCase(),Cg=new Set;io="__scratch__",Yn="setup",si={create(){let e=0,t;do{let r="";for(let i=0;i<4;i++)r+=kg[Math.floor(Math.random()*kg.length)];t=r,e++}while(Cg.has(t)&&e<100);if(e>=100)throw Error("Failed to generate unique CellId after 100 attempts");return Cg.add(t),t}},Dn={create(e){return dn(e!=null,"cellId is required"),`cell-${e}`},parse(e){return e.slice(5)},findElement(e){return e.closest('div[id^="cell-"]')},findElementThroughShadowDOMs(e){let t=e;for(;t;){let r=Dn.findElement(t);if(r)return r;let i=t.getRootNode();if(t=i instanceof ShadowRoot?i.host:t.parentElement,t===i)break}return null}},dC=function(e){let t=null,r=Dn.findElementThroughShadowDOMs(e);return r&&(t=Dn.parse(r.id)),t},Qd={parse(e){return e.getAttribute(U0)},parseOrThrow(e){let t=Qd.parse(e);return dn(t,"<marimo-ui-element/> missing object-id attribute"),t}},cC={create(e){return`output-${e}`}},dg=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,t){let r=new URL(window.location.href);r.searchParams.set(e,t),window.history.replaceState({},"",r.toString())}getSearchParam(e){return new URL(window.location.href).searchParams.get(e)}},qd=function(e){return P0(e??"")},qk=function(e){return zr.mapValues(e.dataset,t=>typeof t=="string"?qd(t):t)},yC=function(e,t){let r=e.parentElement?Qd.parse(e.parentElement):void 0;return r&&t.has(r)?t.lookupValue(r):qd(e.dataset.initialValue)},sg=function(){if(E8())return document.title||null;if(dd()){let r=dg.getFilename();if(r)return r}let e=document.querySelector("marimo-filename");I8(e,"marimo-filename tag not found");let t=e.innerHTML;return t.length===0?null:t};var xe=sd(cd(),1),O=sd(M8(),1),sc="Checkbox",[aS,iO]=f_(sc),[iS,tf]=aS(sc);function oS(e){let{__scopeCheckbox:t,checked:r,children:i,defaultChecked:l,disabled:c,form:d,name:f,onCheckedChange:h,required:b,value:x="on",internal_do_not_use_render:C}=e,[S,E]=m_({prop:r,defaultProp:l??!1,onChange:h,caller:sc}),[A,R]=xe.useState(null),[j,q]=xe.useState(null),V=xe.useRef(!1),z=A?!!d||!!A.closest("form"):!0,X={checked:S,disabled:c,setChecked:E,control:A,setControl:R,name:f,form:d,value:x,hasConsumerStoppedPropagationRef:V,required:b,defaultChecked:ba(l)?!1:l,isFormControl:z,bubbleInput:j,setBubbleInput:q};return(0,O.jsx)(iS,{scope:t,...X,children:lS(C)?C(X):i})}var Sg="CheckboxTrigger",Eg=xe.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...i},l)=>{let{control:c,value:d,disabled:f,checked:h,required:b,setControl:x,setChecked:C,hasConsumerStoppedPropagationRef:S,isFormControl:E,bubbleInput:A}=tf(Sg,e),R=ud(l,x),j=xe.useRef(h);return xe.useEffect(()=>{let q=c==null?void 0:c.form;if(q){let V=()=>C(j.current);return q.addEventListener("reset",V),()=>q.removeEventListener("reset",V)}},[c,C]),(0,O.jsx)(pa.button,{type:"button",role:"checkbox","aria-checked":ba(h)?"mixed":h,"aria-required":b,"data-state":Dg(h),"data-disabled":f?"":void 0,disabled:f,value:d,...i,ref:R,onKeyDown:ur(t,q=>{q.key==="Enter"&&q.preventDefault()}),onClick:ur(r,q=>{C(V=>ba(V)?!0:!V),A&&E&&(S.current=q.isPropagationStopped(),S.current||q.stopPropagation())})})});Eg.displayName=Sg;var nf=xe.forwardRef((e,t)=>{let{__scopeCheckbox:r,name:i,checked:l,defaultChecked:c,required:d,disabled:f,value:h,onCheckedChange:b,form:x,...C}=e;return(0,O.jsx)(oS,{__scopeCheckbox:r,checked:l,defaultChecked:c,disabled:f,required:d,onCheckedChange:b,name:i,form:x,value:h,internal_do_not_use_render:({isFormControl:S})=>(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Eg,{...C,ref:t,__scopeCheckbox:r}),S&&(0,O.jsx)(Lg,{__scopeCheckbox:r})]})})});nf.displayName=sc;var Tg="CheckboxIndicator",Ig=xe.forwardRef((e,t)=>{let{__scopeCheckbox:r,forceMount:i,...l}=e,c=tf(Tg,r);return(0,O.jsx)(p_,{present:i||ba(c.checked)||c.checked===!0,children:(0,O.jsx)(pa.span,{"data-state":Dg(c.checked),"data-disabled":c.disabled?"":void 0,...l,ref:t,style:{pointerEvents:"none",...e.style}})})});Ig.displayName=Tg;var Ag="CheckboxBubbleInput",Lg=xe.forwardRef(({__scopeCheckbox:e,...t},r)=>{let{control:i,hasConsumerStoppedPropagationRef:l,checked:c,defaultChecked:d,required:f,disabled:h,name:b,value:x,form:C,bubbleInput:S,setBubbleInput:E}=tf(Ag,e),A=ud(r,E),R=B8(c),j=F8(i);xe.useEffect(()=>{let V=S;if(!V)return;let z=window.HTMLInputElement.prototype,X=Object.getOwnPropertyDescriptor(z,"checked").set,fe=!l.current;if(R!==c&&X){let F=new Event("click",{bubbles:fe});V.indeterminate=ba(c),X.call(V,ba(c)?!1:c),V.dispatchEvent(F)}},[S,R,c,l]);let q=xe.useRef(ba(c)?!1:c);return(0,O.jsx)(pa.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??q.current,required:f,disabled:h,name:b,value:x,form:C,...t,tabIndex:-1,ref:A,style:{...t.style,...j,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Lg.displayName=Ag;function lS(e){return typeof e=="function"}function ba(e){return e==="indeterminate"}function Dg(e){return ba(e)?"indeterminate":e?"checked":"unchecked"}var sS=sd(o_(),1),rf="ToastProvider",[af,cS,uS]=q8("Toast"),[Og,oO]=f_("Toast",[uS]),[dS,cc]=Og(rf),Mg=e=>{let{__scopeToast:t,label:r="Notification",duration:i=5e3,swipeDirection:l="right",swipeThreshold:c=50,children:d}=e,[f,h]=xe.useState(null),[b,x]=xe.useState(0),C=xe.useRef(!1),S=xe.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${rf}\`. Expected non-empty \`string\`.`),(0,O.jsx)(af.Provider,{scope:t,children:(0,O.jsx)(dS,{scope:t,label:r,duration:i,swipeDirection:l,swipeThreshold:c,toastCount:b,viewport:f,onViewportChange:h,onToastAdd:xe.useCallback(()=>x(E=>E+1),[]),onToastRemove:xe.useCallback(()=>x(E=>E-1),[]),isFocusedToastEscapeKeyDownRef:C,isClosePausedRef:S,children:d})})};Mg.displayName=rf;var Rg="ToastViewport",fS=["F8"],of="toast.viewportPause",lf="toast.viewportResume",Pg=xe.forwardRef((e,t)=>{let{__scopeToast:r,hotkey:i=fS,label:l="Notifications ({hotkey})",...c}=e,d=cc(Rg,r),f=cS(r),h=xe.useRef(null),b=xe.useRef(null),x=xe.useRef(null),C=xe.useRef(null),S=ud(t,C,d.onViewportChange),E=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),A=d.toastCount>0;xe.useEffect(()=>{let j=q=>{var V;i.length!==0&&i.every(z=>q[z]||q.code===z)&&((V=C.current)==null||V.focus())};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[i]),xe.useEffect(()=>{let j=h.current,q=C.current;if(A&&j&&q){let V=()=>{if(!d.isClosePausedRef.current){let F=new CustomEvent(of);q.dispatchEvent(F),d.isClosePausedRef.current=!0}},z=()=>{if(d.isClosePausedRef.current){let F=new CustomEvent(lf);q.dispatchEvent(F),d.isClosePausedRef.current=!1}},X=F=>{j.contains(F.relatedTarget)||z()},fe=()=>{j.contains(document.activeElement)||z()};return j.addEventListener("focusin",V),j.addEventListener("focusout",X),j.addEventListener("pointermove",V),j.addEventListener("pointerleave",fe),window.addEventListener("blur",V),window.addEventListener("focus",z),()=>{j.removeEventListener("focusin",V),j.removeEventListener("focusout",X),j.removeEventListener("pointermove",V),j.removeEventListener("pointerleave",fe),window.removeEventListener("blur",V),window.removeEventListener("focus",z)}}},[A,d.isClosePausedRef]);let R=xe.useCallback(({tabbingDirection:j})=>{let q=f().map(V=>{let z=V.ref.current,X=[z,...SS(z)];return j==="forwards"?X:X.reverse()});return(j==="forwards"?q.reverse():q).flat()},[f]);return xe.useEffect(()=>{let j=C.current;if(j){let q=V=>{var X,fe,F;let z=V.altKey||V.ctrlKey||V.metaKey;if(V.key==="Tab"&&!z){let H=document.activeElement,te=V.shiftKey;if(V.target===j&&te){(X=b.current)==null||X.focus();return}let me=R({tabbingDirection:te?"backwards":"forwards"}),ve=me.findIndex(_e=>_e===H);uf(me.slice(ve+1))?V.preventDefault():te?(fe=b.current)==null||fe.focus():(F=x.current)==null||F.focus()}};return j.addEventListener("keydown",q),()=>j.removeEventListener("keydown",q)}},[f,R]),(0,O.jsxs)(z8,{ref:h,role:"region","aria-label":l.replace("{hotkey}",E),tabIndex:-1,style:{pointerEvents:A?void 0:"none"},children:[A&&(0,O.jsx)(sf,{ref:b,onFocusFromOutsideViewport:()=>{uf(R({tabbingDirection:"forwards"}))}}),(0,O.jsx)(af.Slot,{scope:r,children:(0,O.jsx)(pa.ol,{tabIndex:-1,...c,ref:S})}),A&&(0,O.jsx)(sf,{ref:x,onFocusFromOutsideViewport:()=>{uf(R({tabbingDirection:"backwards"}))}})]})});Pg.displayName=Rg;var Ng="ToastFocusProxy",sf=xe.forwardRef((e,t)=>{let{__scopeToast:r,onFocusFromOutsideViewport:i,...l}=e,c=cc(Ng,r);return(0,O.jsx)(h_,{tabIndex:0,...l,ref:t,style:{position:"fixed"},onFocus:d=>{var h;let f=d.relatedTarget;(h=c.viewport)!=null&&h.contains(f)||i()}})});sf.displayName=Ng;var Il="Toast",pS="toast.swipeStart",mS="toast.swipeMove",hS="toast.swipeCancel",gS="toast.swipeEnd",jg=xe.forwardRef((e,t)=>{let{forceMount:r,open:i,defaultOpen:l,onOpenChange:c,...d}=e,[f,h]=m_({prop:i,defaultProp:l??!0,onChange:c,caller:Il});return(0,O.jsx)(p_,{present:r||f,children:(0,O.jsx)(bS,{open:f,...d,ref:t,onClose:()=>h(!1),onPause:fd(e.onPause),onResume:fd(e.onResume),onSwipeStart:ur(e.onSwipeStart,b=>{b.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ur(e.onSwipeMove,b=>{let{x,y:C}=b.detail.delta;b.currentTarget.setAttribute("data-swipe","move"),b.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${x}px`),b.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${C}px`)}),onSwipeCancel:ur(e.onSwipeCancel,b=>{b.currentTarget.setAttribute("data-swipe","cancel"),b.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),b.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),b.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),b.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ur(e.onSwipeEnd,b=>{let{x,y:C}=b.detail.delta;b.currentTarget.setAttribute("data-swipe","end"),b.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),b.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),b.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${x}px`),b.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${C}px`),h(!1)})})})});jg.displayName=Il;var[yS,vS]=Og(Il,{onClose(){}}),bS=xe.forwardRef((e,t)=>{let{__scopeToast:r,type:i="foreground",duration:l,open:c,onClose:d,onEscapeKeyDown:f,onPause:h,onResume:b,onSwipeStart:x,onSwipeMove:C,onSwipeCancel:S,onSwipeEnd:E,...A}=e,R=cc(Il,r),[j,q]=xe.useState(null),V=ud(t,ce=>q(ce)),z=xe.useRef(null),X=xe.useRef(null),fe=l||R.duration,F=xe.useRef(0),H=xe.useRef(fe),te=xe.useRef(0),{onToastAdd:me,onToastRemove:ve}=R,_e=fd(()=>{var ce;j!=null&&j.contains(document.activeElement)&&((ce=R.viewport)==null||ce.focus()),d()}),ke=xe.useCallback(ce=>{!ce||ce===1/0||(window.clearTimeout(te.current),F.current=new Date().getTime(),te.current=window.setTimeout(_e,ce))},[_e]);xe.useEffect(()=>{let ce=R.viewport;if(ce){let ye=()=>{ke(H.current),b==null||b()},ie=()=>{let le=new Date().getTime()-F.current;H.current-=le,window.clearTimeout(te.current),h==null||h()};return ce.addEventListener(of,ie),ce.addEventListener(lf,ye),()=>{ce.removeEventListener(of,ie),ce.removeEventListener(lf,ye)}}},[R.viewport,fe,h,b,ke]),xe.useEffect(()=>{c&&!R.isClosePausedRef.current&&ke(fe)},[c,fe,R.isClosePausedRef,ke]),xe.useEffect(()=>(me(),()=>ve()),[me,ve]);let oe=xe.useMemo(()=>j?Hg(j):null,[j]);return R.viewport?(0,O.jsxs)(O.Fragment,{children:[oe&&(0,O.jsx)(wS,{__scopeToast:r,role:"status","aria-live":i==="foreground"?"assertive":"polite",children:oe}),(0,O.jsx)(yS,{scope:r,onClose:_e,children:sS.createPortal((0,O.jsx)(af.ItemSlot,{scope:r,children:(0,O.jsx)(j8,{asChild:!0,onEscapeKeyDown:ur(f,()=>{R.isFocusedToastEscapeKeyDownRef.current||_e(),R.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,O.jsx)(pa.li,{tabIndex:0,"data-state":c?"open":"closed","data-swipe-direction":R.swipeDirection,...A,ref:V,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ur(e.onKeyDown,ce=>{ce.key==="Escape"&&(f==null||f(ce.nativeEvent),ce.nativeEvent.defaultPrevented||(R.isFocusedToastEscapeKeyDownRef.current=!0,_e()))}),onPointerDown:ur(e.onPointerDown,ce=>{ce.button===0&&(z.current={x:ce.clientX,y:ce.clientY})}),onPointerMove:ur(e.onPointerMove,ce=>{if(!z.current)return;let ye=ce.clientX-z.current.x,ie=ce.clientY-z.current.y,le=!!X.current,K=["left","right"].includes(R.swipeDirection),Le=["left","up"].includes(R.swipeDirection)?Math.min:Math.max,Pe=K?Le(0,ye):0,Ke=K?0:Le(0,ie),Ve=ce.pointerType==="touch"?10:2,je={x:Pe,y:Ke},De={originalEvent:ce,delta:je};le?(X.current=je,uc(mS,C,De,{discrete:!1})):Wg(je,R.swipeDirection,Ve)?(X.current=je,uc(pS,x,De,{discrete:!1}),ce.target.setPointerCapture(ce.pointerId)):(Math.abs(ye)>Ve||Math.abs(ie)>Ve)&&(z.current=null)}),onPointerUp:ur(e.onPointerUp,ce=>{let ye=X.current,ie=ce.target;if(ie.hasPointerCapture(ce.pointerId)&&ie.releasePointerCapture(ce.pointerId),X.current=null,z.current=null,ye){let le=ce.currentTarget,K={originalEvent:ce,delta:ye};Wg(ye,R.swipeDirection,R.swipeThreshold)?uc(gS,E,K,{discrete:!0}):uc(hS,S,K,{discrete:!0}),le.addEventListener("click",Le=>Le.preventDefault(),{once:!0})}})})})}),R.viewport)})]}):null}),wS=e=>{let{__scopeToast:t,children:r,...i}=e,l=cc(Il,t),[c,d]=xe.useState(!1),[f,h]=xe.useState(!1);return kS(()=>d(!0)),xe.useEffect(()=>{let b=window.setTimeout(()=>h(!0),1e3);return()=>window.clearTimeout(b)},[]),f?null:(0,O.jsx)(N8,{asChild:!0,children:(0,O.jsx)(h_,{...i,children:c&&(0,O.jsxs)(O.Fragment,{children:[l.label," ",r]})})})},xS="ToastTitle",zg=xe.forwardRef((e,t)=>{let{__scopeToast:r,...i}=e;return(0,O.jsx)(pa.div,{...i,ref:t})});zg.displayName=xS;var _S="ToastDescription",Fg=xe.forwardRef((e,t)=>{let{__scopeToast:r,...i}=e;return(0,O.jsx)(pa.div,{...i,ref:t})});Fg.displayName=_S;var qg="ToastAction",$g=xe.forwardRef((e,t)=>{let{altText:r,...i}=e;return r.trim()?(0,O.jsx)(Bg,{altText:r,asChild:!0,children:(0,O.jsx)(cf,{...i,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${qg}\`. Expected non-empty \`string\`.`),null)});$g.displayName=qg;var Vg="ToastClose",cf=xe.forwardRef((e,t)=>{let{__scopeToast:r,...i}=e,l=vS(Vg,r);return(0,O.jsx)(Bg,{asChild:!0,children:(0,O.jsx)(pa.button,{type:"button",...i,ref:t,onClick:ur(e.onClick,l.onClose)})})});cf.displayName=Vg;var Bg=xe.forwardRef((e,t)=>{let{__scopeToast:r,altText:i,...l}=e;return(0,O.jsx)(pa.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":i||void 0,...l,ref:t})});function Hg(e){let t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),CS(r)){let i=r.ariaHidden||r.hidden||r.style.display==="none",l=r.dataset.radixToastAnnounceExclude==="";if(!i)if(l){let c=r.dataset.radixToastAnnounceAlt;c&&t.push(c)}else t.push(...Hg(r))}}),t}function uc(e,t,r,{discrete:i}){let l=r.originalEvent.currentTarget,c=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&l.addEventListener(e,t,{once:!0}),i?R8(l,c):l.dispatchEvent(c)}var Wg=(e,t,r=0)=>{let i=Math.abs(e.x),l=Math.abs(e.y),c=i>l;return t==="left"||t==="right"?c&&i>r:!c&&l>r};function kS(e=()=>{}){let t=fd(e);P8(()=>{let r=0,i=0;return r=window.requestAnimationFrame(()=>i=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(i)}},[t])}function CS(e){return e.nodeType===e.ELEMENT_NODE}function SS(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{let l=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||l?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function uf(e){let t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var ES=Mg,Ug=Pg,Kg=jg,Qg=zg,Gg=Fg,Xg=$g,Yg=cf,TS=Symbol("");MC=function(e,t){return Ie(e,function(r,i,l){i(this,t(r(this),l))})};function df(e,t){let r=null,i=new Map,l=new Set,c=f=>{let h;if(t===void 0)h=i.get(f);else for(let[x,C]of i)if(t(x,f)){h=C;break}if(h!==void 0)if(r!=null&&r(h[1],f))c.remove(f);else return h[0];let b=e(f);return i.set(f,[b,Date.now()]),d("CREATE",f,b),b},d=(f,h,b)=>{for(let x of l)x({type:f,param:h,atom:b})};return c.unstable_listen=f=>(l.add(f),()=>{l.delete(f)}),c.getParams=()=>i.keys(),c.remove=f=>{if(t===void 0){if(!i.has(f))return;let[h]=i.get(f);i.delete(f),d("REMOVE",f,h)}else for(let[h,[b]]of i)if(t(h,f)){i.delete(h),d("REMOVE",h,b);break}},c.setShouldRemove=f=>{if(r=f,r)for(let[h,[b,x]]of i)r(x,h)&&(i.delete(h),d("REMOVE",h,b))},c}var ff=(e,t,r)=>(t.has(r)?t:t.set(r,e())).get(r),IS=new WeakMap,AS=(e,t,r,i)=>ff(e,ff(()=>new WeakMap,ff(()=>new WeakMap,IS,t),r),i);function LS(e,t,r=Object.is){return AS(()=>{let i=Symbol(),l=([d,f])=>{if(f===i)return t(d);let h=t(d,f);return r(f,h)?f:h},c=Ie(d=>{let f=d(c);return l([d(e),f])});return c.init=i,c},e,t,r)}var Jg=(e,t,r)=>(t.has(r)?t:t.set(r,e())).get(r),DS=new WeakMap,OS=(e,t,r)=>Jg(e,Jg(()=>new WeakMap,DS,t),r),MS={},Zg=e=>!!e.write,RS=e=>typeof e=="function";function PS(e,t){return OS(()=>{let r=new WeakMap,i=(d,f)=>{let h=r.get(d);if(h)return h;let b=f&&r.get(f),x=[],C=[];return d.forEach((S,E)=>{let A=t?t(S):E;C[E]=A;let R=b&&b.atomList[b.keyList.indexOf(A)];if(R){x[E]=R;return}let j=q=>{let V=q(l),z=q(e),X=i(z,V==null?void 0:V.arr).keyList.indexOf(A);if(X<0||X>=z.length){let fe=d[i(d).keyList.indexOf(A)];if(fe)return fe;throw Error("splitAtom: index out of bounds for read")}return z[X]};x[E]=Zg(e)?Ie(j,(q,V,z)=>{let X=q(l),fe=q(e),F=i(fe,X==null?void 0:X.arr).keyList.indexOf(A);if(F<0||F>=fe.length)throw Error("splitAtom: index out of bounds for write");let H=RS(z)?z(fe[F]):z;Object.is(fe[F],H)||V(e,[...fe.slice(0,F),H,...fe.slice(F+1)])}):Ie(j)}),h=b&&b.keyList.length===C.length&&b.keyList.every((S,E)=>S===C[E])?b:{arr:d,atomList:x,keyList:C},r.set(d,h),h},l=Ie(d=>{let f=d(l);return i(d(e),f==null?void 0:f.arr)});l.init=void 0;let c=Zg(e)?Ie(d=>d(l).atomList,(d,f,h)=>{switch(h.type){case"remove":{let b=d(c).indexOf(h.atom);if(b>=0){let x=d(e);f(e,[...x.slice(0,b),...x.slice(b+1)])}break}case"insert":{let b=h.before?d(c).indexOf(h.before):d(c).length;if(b>=0){let x=d(e);f(e,[...x.slice(0,b),h.value,...x.slice(b)])}break}case"move":{let b=d(c).indexOf(h.atom),x=h.before?d(c).indexOf(h.before):d(c).length;if(b>=0&&x>=0){let C=d(e);b<x?f(e,[...C.slice(0,b),...C.slice(b+1,x),C[b],...C.slice(x)]):f(e,[...C.slice(0,x),C[b],...C.slice(x,b),...C.slice(b+1)])}break}}}):Ie(d=>d(l).atomList);return c},e,t||MS)}var ey=e=>typeof(e==null?void 0:e.then)=="function";function ty(e=()=>{try{return window.localStorage}catch{return}},t){var f;let r,i,l={getItem:(h,b)=>{var S;let x=E=>{if(E||(E=""),r!==E){try{i=JSON.parse(E,t==null?void 0:t.reviver)}catch{return b}r=E}return i},C=((S=e())==null?void 0:S.getItem(h))??null;return ey(C)?C.then(x):x(C)},setItem:(h,b)=>{var x;return(x=e())==null?void 0:x.setItem(h,JSON.stringify(b,t==null?void 0:t.replacer))},removeItem:h=>{var b;return(b=e())==null?void 0:b.removeItem(h)}},c=h=>(b,x,C)=>h(b,S=>{let E;try{E=JSON.parse(S||"")}catch{E=C}x(E)}),d;try{d=(f=e())==null?void 0:f.subscribe}catch{}return!d&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(d=(h,b)=>{if(!(e()instanceof window.Storage))return()=>{};let x=C=>{C.storageArea===e()&&C.key===h&&b(C.newValue)};return window.addEventListener("storage",x),()=>{window.removeEventListener("storage",x)}}),d&&(l.subscribe=c(d)),l}var NS=ty();ac=function(e,t,r=NS,i){let l=Ie(i!=null&&i.getOnInit?r.getItem(e,t):t);return l.onMount=c=>{c(r.getItem(e,t));let d;return r.subscribe&&(d=r.subscribe(e,c,t)),d},Ie(c=>c(l),(c,d,f)=>{let h=typeof f=="function"?f(c(l)):f;return h===TS?(d(l,t),r.removeItem(e)):ey(h)?h.then(b=>(d(l,b),r.setItem(e,b))):(d(l,h),r.setItem(e,h))})},vn=function(e){let t,r,i;return typeof e=="object"?(t=e.hashFunction,r=e.expiring,i=e.tags):t=e,(l,c,d)=>{if(d.value!=null)d.value=ny(d.value,t,r,i);else if(d.get!=null)d.get=ny(d.get,t,r,i);else throw"Only put a Memoize() decorator on a method or get accessor."}};var pf=new Map;function ny(e,t,r=0,i){let l=Symbol("__memoized_map__");return function(...c){let d;this.hasOwnProperty(l)||Object.defineProperty(this,l,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let f=this[l];if(Array.isArray(i))for(let h of i)pf.has(h)?pf.get(h).push(f):pf.set(h,[f]);if(t||c.length>0||r>0){let h;h=t===!0?c.map(C=>C.toString()).join("!"):t?t.apply(this,c):c[0];let b=`${h}__timestamp`,x=!1;if(r>0)if(!f.has(b))x=!0;else{let C=f.get(b);x=Date.now()-C>r}f.has(h)&&!x?d=f.get(h):(d=e.apply(this,c),f.set(h,d),r>0&&f.set(b,Date.now()))}else{let h=this;f.has(h)?d=f.get(h):(d=e.apply(this,c),f.set(h,d))}return d}}Cl=Ie(sg()),Mk=Ie(null),Us=Ie(null),Lk=Ie(void 0);var jS=class{constructor(){ae(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,t){this.store.set(e,t)}};function zS(){let{hasLocalStorage:e,hasSessionStorage:t}=TD();return e?window.localStorage:t?window.sessionStorage:new jS}Tl=zS();let wa;_C=class{constructor(e,t=Tl){this.defaultValue=e,this.storage=t}get(e){try{let t=this.storage.getItem(e);return t?JSON.parse(t):this.defaultValue}catch{return this.defaultValue}}set(e,t){this.storage.setItem(e,JSON.stringify(t))}remove(e){this.storage.removeItem(e)}},Sd=class{constructor(e,t,r=Tl){this.schema=e,this.getDefaultValue=t,this.storage=r}get(e){try{let t=this.storage.getItem(e);if(t==null)return this.getDefaultValue();let r=this.schema.safeParse(JSON.parse(t));return r.success?r.data:(be.warn("Error parsing zod local storage",r.error),this.getDefaultValue())}catch(t){return be.warn("Error getting zod local storage",t),this.getDefaultValue()}}set(e,t){this.storage.setItem(e,JSON.stringify(t))}remove(e){this.storage.removeItem(e)}},h0=class extends Sd{constructor(e,t,r){let i=Te.get(Cl);super(t,r),this.filename=i;try{this.unsubscribeFromFilename=Te.sub(Cl,()=>{let l=Te.get(Cl);this.handleFilenameChange(e,l)})}catch{this.unsubscribeFromFilename=null}}get(e){return super.get(this.createScopedKey(e,this.filename))}set(e,t){super.set(this.createScopedKey(e,this.filename),t)}remove(e){super.remove(this.createScopedKey(e,this.filename))}createScopedKey(e,t){return t?`${e}:${t}`:e}handleFilenameChange(e,t){if(t&&t!==this.filename){let r=this.get(e);this.remove(e),this.filename=t,this.set(e,r)}}dispose(){this.unsubscribeFromFilename&&(this.unsubscribeFromFilename=(this.unsubscribeFromFilename(),null))}},wa="marimo:notebook-col-sizes";function FS(){return{widths:[]}}var fo=new h0(wa,l_({widths:_8(b8([w8(),x8("contentWidth")]).default("contentWidth"))}),FS);tk={getColumnWidth:e=>fo.get(wa).widths[e]??"contentWidth",saveColumnWidth:(e,t)=>{let r=fo.get(wa).widths;if(r[e])r[e]=t;else{for(;r.length<=e;)r.push("contentWidth");r[e]=t}fo.set(wa,{widths:r})},clearStorage:()=>{fo.remove(wa)}};function qS(e,t){let r=fo.get(wa).widths,i=Hs(r,e,t);fo.set(wa,{widths:i})}var ry,ay,iy,pr,oy,ly,sy,cy,bn,uy,dy,fy,py,my,hy,Nt;function On(e,t,r,i,l){var c={};return Object.keys(i).forEach(function(d){c[d]=i[d]}),c.enumerable=!!c.enumerable,c.configurable=!!c.configurable,("value"in c||c.initializer)&&(c.writable=!0),c=r.slice().reverse().reduce(function(d,f){return f(e,t,d)||d},c),l&&c.initializer!==void 0&&(c.value=c.initializer?c.initializer.call(l):void 0,c.initializer=void 0),c.initializer===void 0?(Object.defineProperty(e,t,c),null):c}let fi=(ry=vn(),ay=vn(),iy=vn(),pr=class{constructor(e,t,r){this.value=e,this.isCollapsed=t,this.children=r}geDescendantCount(){let e=0,t=[...this.children];for(;t.length>0;){let r=t.pop();e++;for(let i=r.children.length-1;i>=0;i--)t.push(r.children[i])}return e}getDescendants(){let e=[],t=[...this.children];for(;t.length>0;){let r=t.pop();e.push(r.value);for(let i=r.children.length-1;i>=0;i--)t.push(r.children[i])}return e}get inOrderIds(){let e=[],t=r=>{e.push(r.value);for(let i of r.children)t(i)};for(let r of this.children)t(r);return e}toString(){return this.isCollapsed?`${this.value} (collapsed)`:String(this.value)}equals(e){return this.value===e.value}},On(pr.prototype,"geDescendantCount",[ry],Object.getOwnPropertyDescriptor(pr.prototype,"geDescendantCount"),pr.prototype),On(pr.prototype,"getDescendants",[ay],Object.getOwnPropertyDescriptor(pr.prototype,"getDescendants"),pr.prototype),On(pr.prototype,"inOrderIds",[iy],Object.getOwnPropertyDescriptor(pr.prototype,"inOrderIds"),pr.prototype),pr);var $S=0;let po;po=(oy=vn(),ly=vn(),sy=vn(),cy=vn(),bn=class uo{constructor(t,r){this.nodes=t,this.id=r}static from(t){let r=`tree_${$S++}`;return new uo(t.map(i=>new fi(i,!1,[])),r)}static fromWithPreviousShape(t,r){var c;if(!r)return uo.from(t);let i=r.id,l=new uo(t.map(d=>new fi(d,!1,[])),i);for(let d of t)if(r.isCollapsed(d)){let f=((c=r._nodeMap.get(d))==null?void 0:c.children)??[];for(let h=f.length-1;h>=0;h--){let b=f[h];if(l._nodeMap.has(b.value)){l=l.collapse(d,b.value);break}}}return l}withNodes(t){return new uo(t,this.id)}get topLevelIds(){return this.nodes.map(t=>t.value)}get inOrderIds(){return this.nodes.flatMap(t=>[t.value,...t.inOrderIds])}get idSet(){return new Set(this.inOrderIds)}get length(){return this.nodes.length}get _nodeMap(){let t=new Map;for(let r of this.nodes)t.set(r.value,r);return t}getDescendants(t){let r=this._nodeMap.get(t);return r?r.getDescendants():(be.warn(`Node ${t} not found in tree. Valid ids: ${this.topLevelIds}`),[])}isCollapsed(t){let r=this._nodeMap.get(t);return r?r.isCollapsed:(be.warn(`Node ${t} not found in tree. Valid ids: ${this.topLevelIds}`),!1)}indexOfOrThrow(t){let r=this.nodes.findIndex(i=>i.value===t);if(r===-1)throw Error(`Node ${t} not found in tree. Valid ids: ${this.topLevelIds}`);return r}slice(t,r){return this.nodes.slice(t,r).map(i=>i.value)}moveToFront(t){let r=this.indexOfOrThrow(t);return this.withNodes(Hs(this.nodes,r,0))}moveToBack(t){let r=this.indexOfOrThrow(t);return this.withNodes(Hs(this.nodes,r,this.nodes.length-1))}collapse(t,r){let i=this.nodes.findIndex(h=>h.value===t);if(i===-1)throw Error(`Node ${t} not found in tree. Valid ids: ${this.topLevelIds}`);let l=r===void 0?this.nodes.length:this.nodes.findIndex(h=>h.value===r);if(l===-1)throw Error(`Node ${r} not found in tree`);if(l<i)throw Error(`Node ${r} is before node ${t}`);let c=[...this.nodes],d=c[i];if(d.isCollapsed)throw Error(`Node ${t} is already collapsed`);let f=c.splice(i+1,l-i);return c[i]=new fi(d.value,!0,f),this.withNodes(c)}collapseAll(t){let r=[...this.nodes];if(t.length===0)throw Error("No collapse ranges provided");if(t.length!==r.length)throw Error(`Collapse ranges length ${t.length} does not match tree length ${r.length}`);let i=r.length-1;for(;i>=0;){let l=r[i],c=t[i];if(!l.isCollapsed&&c){let{id:d,until:f}=c;if(d!==l.value)throw Error(`Node ${l.value} does not match collapse range id ${d}`);let h=f===void 0?r.length:r.findIndex(x=>x.value===f);if(h===-1)throw Error(`Node ${f} not found in tree`);if(h<i)throw Error(`Node ${f} is before node ${d}`);let b=r.splice(i+1,h-i);r[i]=new fi(l.value,!0,b),i--}else i--}return this.withNodes(r)}expand(t){let r=this.nodes.findIndex(c=>c.value===t);if(r===-1)throw Error(`Node ${t} not found in tree. Valid ids: ${this.topLevelIds}`);let i=[...this.nodes],l=i[r];return l.isCollapsed?(i[r]=new fi(l.value,!1,[]),i=qh(i,r+1,l.children),this.withNodes(i)):this}expandAll(){let t=[...this.nodes],r=0;for(;r<t.length;){let i=t[r];i.isCollapsed&&(t[r]=new fi(i.value,!1,[]),t=qh(t,r+1,i.children)),r++}return this.withNodes(t)}move(t,r){return this.withNodes(Hs(this.nodes,t,r))}at(t){var r;return(r=this.nodes.at(t))==null?void 0:r.value}atOrThrow(t){let r=this.nodes.at(t);if(r===void 0)throw Error(`Node at index ${t} not found in tree`);return r.value}first(){return this.atOrThrow(0)}last(){return this.atOrThrow(this.nodes.length-1)}after(t){let r=this.indexOfOrThrow(t);if(r!==this.nodes.length-1)return this.at(r+1)}before(t){let r=this.indexOfOrThrow(t);if(r!==0)return this.at(r-1)}insert(t,r){return this.withNodes(R_(this.nodes,r,new fi(t,!1,[])))}insertAtEnd(t){return this.insert(t,this.nodes.length)}insertAtStart(t){return this.insert(t,0)}deleteAtIndex(t){let r=this.atOrThrow(t),i=this.expand(r);return i.withNodes(ED(i.nodes,t))}delete(t){let r=this.indexOfOrThrow(t);return this.deleteAtIndex(r)}getCount(t){var r;return((r=this._nodeMap.get(t))==null?void 0:r.geDescendantCount())??0}findAndExpandDeep(t){let r=this.find(t);return r.length===0?this:r.reduce((i,l)=>i.expand(l),this)}find(t){function r(i,l){for(let c of i){if(c.value===t)return[...l,t];let d=r(c.children,[...l,c.value]);if(d.length>0)return d}return[]}return r(this.nodes,[])}split(t){let r=this.nodes.findIndex(c=>c.value===t);if(r===-1)throw Error(`Node ${t} not found in tree`);let i=this.nodes.slice(0,r),l=this.nodes.slice(r);return i.length===0?[uo.from([]),this.withNodes(l)]:[this.withNodes(i),uo.from([]).withNodes(l)]}equals(t){return this.nodes.length===t.nodes.length&&this.nodes.every((r,i)=>r.value===t.nodes[i].value)}toString(){let t=0,r="",i=l=>{for(let c of l)r+=`${" ".repeat(t*2)}${c.toString()}
|
|
13
|
+
`,t+=1,i(c.children),--t};return i(this.nodes),r}},On(bn.prototype,"topLevelIds",[oy],Object.getOwnPropertyDescriptor(bn.prototype,"topLevelIds"),bn.prototype),On(bn.prototype,"inOrderIds",[ly],Object.getOwnPropertyDescriptor(bn.prototype,"inOrderIds"),bn.prototype),On(bn.prototype,"idSet",[sy],Object.getOwnPropertyDescriptor(bn.prototype,"idSet"),bn.prototype),On(bn.prototype,"_nodeMap",[cy],Object.getOwnPropertyDescriptor(bn.prototype,"_nodeMap"),bn.prototype),bn),El=(uy=vn(),dy=vn(),fy=vn(),py=vn(),my=vn(),hy=vn(),Nt=class ln{constructor(t){this.columns=t,t.length===0&&(this.columns=[po.from([])])}static from(t){return new ln(t.map(r=>po.from(r)))}static fromWithPreviousShape(t,r){if(!r)return ln.from([t]);let i=r.getColumns(),l=Array.from({length:i.length},()=>[]),c=0;for(let d of t){let f=i.findIndex(h=>h.idSet.has(d));f===-1?l[c].push(d):(c=f,l[f].push(d))}return new ln(l.map((d,f)=>po.fromWithPreviousShape(d,i[f])))}isEmpty(){return this.columns.length===0?!0:this.columns.every(t=>t.nodes.length===0)}static fromIdsAndColumns(t){let r=Math.max(1,...t.map(([,c])=>(c??0)+1)),i=Array.from({length:r},()=>[]),l=0;for(let[c,d]of t)d==null||d<0?i[l].push(c):(i[d].push(c),l=d);return ln.from(i)}get topLevelIds(){return this.columns.map(t=>t.topLevelIds)}get iterateTopLevelIds(){let t=this.columns;function*r(){for(let i of t)for(let l of i.topLevelIds)yield l}return r()}get inOrderIds(){return this.columns.flatMap(t=>t.inOrderIds)}get colLength(){return this.columns.length}get idLength(){return this.columns.reduce((t,r)=>t+r.nodes.length,0)}get _columnMap(){return new Map(this.columns.map(t=>[t.id,t]))}at(t){return this.columns[t]}get(t){return this._columnMap.get(t)}atOrThrow(t){let r=this.columns[t];if(!r)throw Error(`Column ${t} not found`);return r}hasOnlyOneColumn(){return this.columns.length===1}getColumns(){return this.columns}hasOnlyOneId(){return this.idLength===1}getColumnIds(){return this.columns.map(t=>t.id)}indexOf(t){return this.columns.indexOf(t)}addColumn(t,r=[]){return new ln(this.columns.flatMap(i=>i.id===t?[i,po.from(r)]:[i]))}insertBreakpoint(t){let r=this.findWithId(t),[i,l]=r.split(t);return new ln(this.columns.flatMap(c=>c===r?[i,l].filter(Boolean):[c]))}delete(t){if(this.columns.length<=1)return this;let r=this.indexOfOrThrow(t),i=r===0?1:r-1,l=[...this.columns],c=l[r];return l[i]=c.withNodes([...l[i].nodes,...c.nodes]),l.splice(r,1),new ln(l)}mergeAllColumns(){if(this.columns.length<=1)return this;let t=this.columns.flatMap(i=>i.nodes),r=this.columns[0];return new ln([r.withNodes(t)])}moveWithinColumn(t,r,i){return this.transform(t,l=>l.move(r,i))}moveAcrossColumns(t,r,i,l){let c=this.indexOfOrThrow(t),d=this.indexOfOrThrow(i),f=[...this.columns],h=f[c],b=h.nodes.findIndex(S=>S.value===r);if(b===-1)throw Error(`Node ${r} not found in column ${t}`);let x=h.nodes[b];f[c]=h.withNodes(h.nodes.filter((S,E)=>E!==b));let C=f[d];if(l){let S=C.indexOfOrThrow(l);f[d]=C.withNodes(R_(C.nodes,S,x))}else f[d]=C.withNodes([x,...C.nodes]);return new ln(f)}moveCellsRelativeTo(t,r,i){if(t.length===0)return this;let l=new Set(t),c=this.findWithId(r),d=this.indexOfOrThrow(c.id),f=[];for(let S of t){let E=this.findWithId(S),A=E.nodes.find(R=>R.value===S);if(!A)throw Error(`Node ${S} not found in column ${E.id}`);f.push(A)}let h=this.columns.map(S=>S.withNodes(S.nodes.filter(E=>!l.has(E.value)))),b=h[d],x=b.nodes.findIndex(S=>S.value===r);x===-1?x=b.nodes.length:i==="after"&&(x+=1);let C=qh(b.nodes,x,f);return h[d]=b.withNodes(C),new ln(h)}indexOfOrThrow(t){let r=this.columns.findIndex(i=>i.id===t);if(r===-1)throw Error(`Column ${t} not found. Possible values: ${this.getColumnIds().join(", ")}`);return r}moveColumn(t,r){if(t===r)return this;let i=this.indexOfOrThrow(t),l=r==="_left_"?i-1:r==="_right_"?i+1:this.indexOfOrThrow(r);return qS(i,l),new ln(Hs([...this.columns],i,l))}moveToNewColumn(t){let r=this.findWithId(t),i=this.columns.map(c=>c.id===r.id?c.delete(t):c),l=po.from([t]);return new ln([...i,l])}findWithId(t){let r=this.columns.find(i=>i.inOrderIds.includes(t));if(!r)throw be.log(`Possible values: ${this.columns.map(i=>i.inOrderIds).join(", ")}`),Error(`Cell ${t} not found in any column`);return r}transformWithCellId(t,r){let i=!1,l=this.columns.map(c=>{if(c.inOrderIds.includes(t)){let d=r(c);return c!==d&&(i=!0),d}return c});return i?new ln(l):this}setupCellExists(){return this.columns.some(t=>t.topLevelIds.includes(Yn))}insertId(t,r,i){return this.transform(r,l=>l.insert(t,i))}deleteById(t){return this.transformWithCellId(t,r=>r.delete(t))}placeCells(t){if(t.length===0)return this;let r=this.deleteById(t[0].id);for(let{id:l}of t.slice(1))r=r.deleteById(l);let i=[...t].toSorted((l,c)=>l.columnId===c.columnId?l.index-c.index:l.columnId.localeCompare(c.columnId));for(let{id:l,columnId:c,index:d}of i)r=r.insertId(l,c,d);return r}compact(){return this.columns.length===1||!this.columns.some(t=>t.nodes.length===0)?this:new ln(this.columns.filter(t=>t.nodes.length>0))}transform(t,r){let i=this._columnMap.get(t);if(!i)return be.warn(`Column ${t} not found`),this;let l=r(i);return i===l?this:new ln(this.columns.map(c=>c.id===t?l:c))}transformAll(t){let r=!1,i=this.columns.map(l=>{let c=t(l);return l.equals(c)||(r=!0),c});return r?new ln(i):this}},On(Nt.prototype,"isEmpty",[uy],Object.getOwnPropertyDescriptor(Nt.prototype,"isEmpty"),Nt.prototype),On(Nt.prototype,"topLevelIds",[dy],Object.getOwnPropertyDescriptor(Nt.prototype,"topLevelIds"),Nt.prototype),On(Nt.prototype,"inOrderIds",[fy],Object.getOwnPropertyDescriptor(Nt.prototype,"inOrderIds"),Nt.prototype),On(Nt.prototype,"idLength",[py],Object.getOwnPropertyDescriptor(Nt.prototype,"idLength"),Nt.prototype),On(Nt.prototype,"_columnMap",[my],Object.getOwnPropertyDescriptor(Nt.prototype,"_columnMap"),Nt.prototype),On(Nt.prototype,"getColumnIds",[hy],Object.getOwnPropertyDescriptor(Nt.prototype,"getColumnIds"),Nt.prototype),Nt);let mf,hf,gf,gy,yf,yy,vy,by,wy,vf,bf,xy,wf,xf;mf=on((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 t;(function(i){i.Root="root",i.Text="text",i.Directive="directive",i.Comment="comment",i.Script="script",i.Style="style",i.Tag="tag",i.CDATA="cdata",i.Doctype="doctype"})(t=e.ElementType||(e.ElementType={}));function r(i){return i.type===t.Tag||i.type===t.Script||i.type===t.Style}e.isTag=r,e.Root=t.Root,e.Text=t.Text,e.Directive=t.Directive,e.Comment=t.Comment,e.Script=t.Script,e.Style=t.Style,e.Tag=t.Tag,e.CDATA=t.CDATA,e.Doctype=t.Doctype})),hf=on((e=>{var t=e&&e.__extends||(function(){var F=function(H,te){return F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(me,ve){me.__proto__=ve}||function(me,ve){for(var _e in ve)Object.prototype.hasOwnProperty.call(ve,_e)&&(me[_e]=ve[_e])},F(H,te)};return function(H,te){if(typeof te!="function"&&te!==null)throw TypeError("Class extends value "+String(te)+" is not a constructor or null");F(H,te);function me(){this.constructor=H}H.prototype=te===null?Object.create(te):(me.prototype=te.prototype,new me)}})(),r=e&&e.__assign||function(){return r=Object.assign||function(F){for(var H,te=1,me=arguments.length;te<me;te++)for(var ve in H=arguments[te],H)Object.prototype.hasOwnProperty.call(H,ve)&&(F[ve]=H[ve]);return F},r.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 i=mf(),l=(function(){function F(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(F.prototype,"parentNode",{get:function(){return this.parent},set:function(H){this.parent=H},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"previousSibling",{get:function(){return this.prev},set:function(H){this.prev=H},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"nextSibling",{get:function(){return this.next},set:function(H){this.next=H},enumerable:!1,configurable:!0}),F.prototype.cloneNode=function(H){return H===void 0&&(H=!1),X(this,H)},F})();e.Node=l;var c=(function(F){t(H,F);function H(te){var me=F.call(this)||this;return me.data=te,me}return Object.defineProperty(H.prototype,"nodeValue",{get:function(){return this.data},set:function(te){this.data=te},enumerable:!1,configurable:!0}),H})(l);e.DataNode=c;var d=(function(F){t(H,F);function H(){var te=F!==null&&F.apply(this,arguments)||this;return te.type=i.ElementType.Text,te}return Object.defineProperty(H.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),H})(c);e.Text=d;var f=(function(F){t(H,F);function H(){var te=F!==null&&F.apply(this,arguments)||this;return te.type=i.ElementType.Comment,te}return Object.defineProperty(H.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),H})(c);e.Comment=f;var h=(function(F){t(H,F);function H(te,me){var ve=F.call(this,me)||this;return ve.name=te,ve.type=i.ElementType.Directive,ve}return Object.defineProperty(H.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),H})(c);e.ProcessingInstruction=h;var b=(function(F){t(H,F);function H(te){var me=F.call(this)||this;return me.children=te,me}return Object.defineProperty(H.prototype,"firstChild",{get:function(){return this.children[0]??null},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"childNodes",{get:function(){return this.children},set:function(te){this.children=te},enumerable:!1,configurable:!0}),H})(l);e.NodeWithChildren=b;var x=(function(F){t(H,F);function H(){var te=F!==null&&F.apply(this,arguments)||this;return te.type=i.ElementType.CDATA,te}return Object.defineProperty(H.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),H})(b);e.CDATA=x;var C=(function(F){t(H,F);function H(){var te=F!==null&&F.apply(this,arguments)||this;return te.type=i.ElementType.Root,te}return Object.defineProperty(H.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),H})(b);e.Document=C;var S=(function(F){t(H,F);function H(te,me,ve,_e){ve===void 0&&(ve=[]),_e===void 0&&(_e=te==="script"?i.ElementType.Script:te==="style"?i.ElementType.Style:i.ElementType.Tag);var ke=F.call(this,ve)||this;return ke.name=te,ke.attribs=me,ke.type=_e,ke}return Object.defineProperty(H.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"tagName",{get:function(){return this.name},set:function(te){this.name=te},enumerable:!1,configurable:!0}),Object.defineProperty(H.prototype,"attributes",{get:function(){var te=this;return Object.keys(this.attribs).map(function(me){var ve,_e;return{name:me,value:te.attribs[me],namespace:(ve=te["x-attribsNamespace"])==null?void 0:ve[me],prefix:(_e=te["x-attribsPrefix"])==null?void 0:_e[me]}})},enumerable:!1,configurable:!0}),H})(b);e.Element=S;function E(F){return(0,i.isTag)(F)}e.isTag=E;function A(F){return F.type===i.ElementType.CDATA}e.isCDATA=A;function R(F){return F.type===i.ElementType.Text}e.isText=R;function j(F){return F.type===i.ElementType.Comment}e.isComment=j;function q(F){return F.type===i.ElementType.Directive}e.isDirective=q;function V(F){return F.type===i.ElementType.Root}e.isDocument=V;function z(F){return Object.prototype.hasOwnProperty.call(F,"children")}e.hasChildren=z;function X(F,H){H===void 0&&(H=!1);var te;if(R(F))te=new d(F.data);else if(j(F))te=new f(F.data);else if(E(F)){var me=H?fe(F.children):[],ve=new S(F.name,r({},F.attribs),me);me.forEach(function(ce){return ce.parent=ve}),F.namespace!=null&&(ve.namespace=F.namespace),F["x-attribsNamespace"]&&(ve["x-attribsNamespace"]=r({},F["x-attribsNamespace"])),F["x-attribsPrefix"]&&(ve["x-attribsPrefix"]=r({},F["x-attribsPrefix"])),te=ve}else if(A(F)){var me=H?fe(F.children):[],_e=new x(me);me.forEach(function(ye){return ye.parent=_e}),te=_e}else if(V(F)){var me=H?fe(F.children):[],ke=new C(me);me.forEach(function(ye){return ye.parent=ke}),F["x-mode"]&&(ke["x-mode"]=F["x-mode"]),te=ke}else if(q(F)){var oe=new h(F.name,F.data);F["x-name"]!=null&&(oe["x-name"]=F["x-name"],oe["x-publicId"]=F["x-publicId"],oe["x-systemId"]=F["x-systemId"]),te=oe}else throw Error(`Not implemented yet: ${F.type}`);return te.startIndex=F.startIndex,te.endIndex=F.endIndex,F.sourceCodeLocation!=null&&(te.sourceCodeLocation=F.sourceCodeLocation),te}e.cloneNode=X;function fe(F){for(var H=F.map(function(me){return X(me,!0)}),te=1;te<H.length;te++)H[te].prev=H[te-1],H[te-1].next=H[te];return H}})),gf=on((e=>{var t=e&&e.__createBinding||(Object.create?(function(f,h,b,x){x===void 0&&(x=b);var C=Object.getOwnPropertyDescriptor(h,b);(!C||("get"in C?!h.__esModule:C.writable||C.configurable))&&(C={enumerable:!0,get:function(){return h[b]}}),Object.defineProperty(f,x,C)}):(function(f,h,b,x){x===void 0&&(x=b),f[x]=h[b]})),r=e&&e.__exportStar||function(f,h){for(var b in f)b!=="default"&&!Object.prototype.hasOwnProperty.call(h,b)&&t(h,f,b)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var i=mf(),l=hf();r(hf(),e);var c={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},d=(function(){function f(h,b,x){this.dom=[],this.root=new l.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof b=="function"&&(x=b,b=c),typeof h=="object"&&(b=h,h=void 0),this.callback=h??null,this.options=b??c,this.elementCB=x??null}return f.prototype.onparserinit=function(h){this.parser=h},f.prototype.onreset=function(){this.dom=[],this.root=new l.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(h){this.handleCallback(h)},f.prototype.onclosetag=function(){this.lastNode=null;var h=this.tagStack.pop();this.options.withEndIndices&&(h.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(h)},f.prototype.onopentag=function(h,b){var x=this.options.xmlMode?i.ElementType.Tag:void 0,C=new l.Element(h,b,void 0,x);this.addNode(C),this.tagStack.push(C)},f.prototype.ontext=function(h){var b=this.lastNode;if(b&&b.type===i.ElementType.Text)b.data+=h,this.options.withEndIndices&&(b.endIndex=this.parser.endIndex);else{var x=new l.Text(h);this.addNode(x),this.lastNode=x}},f.prototype.oncomment=function(h){if(this.lastNode&&this.lastNode.type===i.ElementType.Comment){this.lastNode.data+=h;return}var b=new l.Comment(h);this.addNode(b),this.lastNode=b},f.prototype.oncommentend=function(){this.lastNode=null},f.prototype.oncdatastart=function(){var h=new l.Text(""),b=new l.CDATA([h]);this.addNode(b),h.parent=b,this.lastNode=h},f.prototype.oncdataend=function(){this.lastNode=null},f.prototype.onprocessinginstruction=function(h,b){var x=new l.ProcessingInstruction(h,b);this.addNode(x)},f.prototype.handleCallback=function(h){if(typeof this.callback=="function")this.callback(h,this.dom);else if(h)throw h},f.prototype.addNode=function(h){var b=this.tagStack[this.tagStack.length-1],x=b.children[b.children.length-1];this.options.withStartIndices&&(h.startIndex=this.parser.startIndex),this.options.withEndIndices&&(h.endIndex=this.parser.endIndex),b.children.push(h),x&&(h.prev=x,x.next=h),h.parent=b,this.lastNode=null},f})();e.DomHandler=d,e.default=d})),gy=on((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(t,r){return t[r.toLowerCase()]=r,t},{}),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")})),yf=on((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatAttributes=l,e.escapeSpecialCharacters=d,e.revertEscapedCharacters=f,e.formatDOM=h;var t=gf(),r=gy();function i(b){return r.CASE_SENSITIVE_TAG_NAMES_MAP[b]}function l(b){for(var x={},C=0,S=b.length;C<S;C++){var E=b[C];x[E.name]=E.value}return x}function c(b){return b=b.toLowerCase(),i(b)||b}function d(b){return b.replace(r.CARRIAGE_RETURN_REGEX,r.CARRIAGE_RETURN_PLACEHOLDER)}function f(b){return b.replace(r.CARRIAGE_RETURN_PLACEHOLDER_REGEX,r.CARRIAGE_RETURN)}function h(b,x,C){x===void 0&&(x=null);for(var S=[],E,A=0,R=b.length;A<R;A++){var j=b[A];switch(j.nodeType){case 1:var q=c(j.nodeName);E=new t.Element(q,l(j.attributes)),E.children=h(q==="template"?j.content.childNodes:j.childNodes,E);break;case 3:E=new t.Text(f(j.nodeValue));break;case 8:E=new t.Comment(j.nodeValue);break;default:continue}var V=S[A-1]||null;V&&(V.next=E),E.parent=x,E.prev=V,E.next=null,S.push(E)}return C&&(E=new t.ProcessingInstruction(C.substring(0,C.indexOf(" ")).toLowerCase(),C),E.next=S[0]||null,E.parent=x,S.unshift(E),S[1]&&(S[1].prev=S[0])),S}})),yy=on((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=j;var t=yf(),r="html",i="head",l="body",c=/<([a-zA-Z]+[0-9]?)/,d=/<head[^]*>/i,f=/<body[^]*>/i,h=function(q,V){throw Error("This browser does not support `document.implementation.createHTMLDocument`")},b=function(q,V){throw Error("This browser does not support `DOMParser.prototype.parseFromString`")},x=typeof window=="object"&&window.DOMParser;if(typeof x=="function"){var C=new x,S="text/html";b=function(q,V){return V&&(q=`<${V}>${q}</${V}>`),C.parseFromString(q,S)},h=b}if(typeof document=="object"&&document.implementation){var E=document.implementation.createHTMLDocument();h=function(q,V){if(V){var z=E.documentElement.querySelector(V);return z&&(z.innerHTML=q),E}return E.documentElement.innerHTML=q,E}}var A=typeof document=="object"&&document.createElement("template"),R;A&&A.content&&(R=function(q){return A.innerHTML=q,A.content.childNodes});function j(q){var V,z;q=(0,t.escapeSpecialCharacters)(q);var X=q.match(c),fe=X&&X[1]?X[1].toLowerCase():"";switch(fe){case r:var F=b(q);if(!d.test(q)){var te=F.querySelector(i);(V=te==null?void 0:te.parentNode)==null||V.removeChild(te)}if(!f.test(q)){var te=F.querySelector(l);(z=te==null?void 0:te.parentNode)==null||z.removeChild(te)}return F.querySelectorAll(r);case i:case l:var H=h(q).querySelectorAll(fe);return f.test(q)&&d.test(q)?H[0].parentNode.childNodes:H;default:if(R)return R(q);var te=h(q,l).querySelector(l);return te.childNodes}}})),vy=on((e=>{var t=e&&e.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var r=t(yy()),i=yf(),l=/<(![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(l),h=f?f[1]:void 0;return(0,i.formatDOM)((0,r.default)(d),null,h)}})),by=on((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}})),wy=on((e=>{var t=0,r=1,i=2,l=3,c=4,d=5,f=6;function h(z){return x.hasOwnProperty(z)?x[z]:null}function b(z,X,fe,F,H,te,me){this.acceptsBooleans=X===i||X===l||X===c,this.attributeName=F,this.attributeNamespace=H,this.mustUseProperty=fe,this.propertyName=z,this.type=X,this.sanitizeURL=te,this.removeEmptyString=me}var x={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(z=>{x[z]=new b(z,t,!1,z,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([z,X])=>{x[z]=new b(z,r,!1,X,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(z=>{x[z]=new b(z,i,!1,z.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(z=>{x[z]=new b(z,i,!1,z,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(z=>{x[z]=new b(z,l,!1,z.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(z=>{x[z]=new b(z,l,!0,z,null,!1,!1)}),["capture","download"].forEach(z=>{x[z]=new b(z,c,!1,z,null,!1,!1)}),["cols","rows","size","span"].forEach(z=>{x[z]=new b(z,f,!1,z,null,!1,!1)}),["rowSpan","start"].forEach(z=>{x[z]=new b(z,d,!1,z.toLowerCase(),null,!1,!1)});var C=/[\-\:]([a-z])/g,S=z=>z[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(z=>{let X=z.replace(C,S);x[X]=new b(X,r,!1,z,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(z=>{let X=z.replace(C,S);x[X]=new b(X,r,!1,z,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(z=>{let X=z.replace(C,S);x[X]=new b(X,r,!1,z,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(z=>{x[z]=new b(z,r,!1,z.toLowerCase(),null,!1,!1)});var E="xlinkHref";x[E]=new b("xlinkHref",r,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(z=>{x[z]=new b(z,r,!1,z.toLowerCase(),null,!0,!0)});var{CAMELCASE:A,SAME:R,possibleStandardNames:j}=by(),q=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]*$")),V=Object.keys(j).reduce((z,X)=>{let fe=j[X];return fe===R?z[X]=X:fe===A?z[X.toLowerCase()]=X:z[X]=fe,z},{});e.BOOLEAN=l,e.BOOLEANISH_STRING=i,e.NUMERIC=d,e.OVERLOADED_BOOLEAN=c,e.POSITIVE_NUMERIC=f,e.RESERVED=t,e.STRING=r,e.getPropertyInfo=h,e.isCustomAttribute=q,e.possibleStandardNames=V})),vf=on((e=>{var t=e&&e.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};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 r=cd(),i=t(ID()),l=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function c(h,b){return h.includes("-")?!l.has(h):!!(b&&typeof b.is=="string")}var d={reactCompat:!0};function f(h,b){if(typeof h=="string"){if(!h.trim()){b.style={};return}try{b.style=(0,i.default)(h,d)}catch{b.style={}}}}e.PRESERVE_CUSTOM_ATTRIBUTES=Number(r.version.split(".")[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]),e.canTextBeChildOfNode=function(h){return!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(h.name)},e.returnFirstArg=function(h){return h}})),bf=on((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var t=wy(),r=vf(),i=["checked","value"],l=["input","select","textarea"],c={reset:!0,submit:!0};function d(h,b){h===void 0&&(h={});var x={},C=!!(h.type&&c[h.type]);for(var S in h){var E=h[S];if((0,t.isCustomAttribute)(S)){x[S]=E;continue}var A=S.toLowerCase(),R=f(A);if(R){var j=(0,t.getPropertyInfo)(R);switch(i.includes(R)&&l.includes(b)&&!C&&(R=f("default"+A)),x[R]=E,j&&j.type){case t.BOOLEAN:x[R]=!0;break;case t.OVERLOADED_BOOLEAN:E===""&&(x[R]=!0);break}continue}r.PRESERVE_CUSTOM_ATTRIBUTES&&(x[S]=E)}return(0,r.setStyleProp)(h.style,x),x}function f(h){return t.possibleStandardNames[h]}})),xy=on((e=>{var t=e&&e.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var r=cd(),i=t(bf()),l=vf(),c={cloneElement:r.cloneElement,createElement:r.createElement,isValidElement:r.isValidElement};function d(h,b){b===void 0&&(b={});for(var x=[],C=typeof b.replace=="function",S=b.transform||l.returnFirstArg,E=b.library||c,A=E.cloneElement,R=E.createElement,j=E.isValidElement,q=h.length,V=0;V<q;V++){var z=h[V];if(C){var X=b.replace(z,V);if(j(X)){q>1&&(X=A(X,{key:X.key||V})),x.push(S(X,z,V));continue}}if(z.type==="text"){var fe=!z.data.trim().length;if(fe&&z.parent&&!(0,l.canTextBeChildOfNode)(z.parent)||b.trim&&fe)continue;x.push(S(z.data,z,V));continue}var F=z,H={};f(F)?((0,l.setStyleProp)(F.attribs.style,F.attribs),H=F.attribs):F.attribs&&(H=(0,i.default)(F.attribs,F.name));var te=void 0;switch(z.type){case"script":case"style":z.children[0]&&(H.dangerouslySetInnerHTML={__html:z.children[0].data});break;case"tag":z.name==="textarea"&&z.children[0]?H.defaultValue=z.children[0].data:z.children&&z.children.length&&(te=d(z.children,b));break;default:continue}q>1&&(H.key=V),x.push(S(R(z.name,H,te),z,V))}return x.length===1?x[0]:x}function f(h){return l.PRESERVE_CUSTOM_ATTRIBUTES&&h.type==="tag"&&(0,l.isCustomComponent)(h.name,h.attribs)}})),wf=on((e=>{var t=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 r=t(vy());e.htmlToDOM=r.default,e.attributesToProps=t(bf()).default;var i=t(xy());e.domToReact=i.default;var l=gf();Object.defineProperty(e,"Comment",{enumerable:!0,get:function(){return l.Comment}}),Object.defineProperty(e,"Element",{enumerable:!0,get:function(){return l.Element}}),Object.defineProperty(e,"ProcessingInstruction",{enumerable:!0,get:function(){return l.ProcessingInstruction}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return l.Text}});var c={lowerCaseAttributeNames:!1};function d(f,h){if(typeof f!="string")throw TypeError("First argument must be a string");return f?(0,i.default)((0,r.default)(f,(h==null?void 0:h.htmlparser2)||c),h):[]}})),xf=sd(wf(),1),oi=wf(),u0=xf.default.default||xf.default;let dc;dc=(e,t)=>{let[r,...i]=t.split("."),l=(e.attribs.class||"").split(" ");return e.tagName===r&&i.every(c=>l.includes(c))},JC=e=>{var t;return e&&dc(e,"span.nb")&&e.firstChild instanceof oi.Text&&((t=e.firstChild.nodeValue)==null?void 0:t.includes("__marimo__"))},I0=function(e){var t,r,i;if(e instanceof oi.Element&&e.firstChild instanceof oi.Text&&dc(e,"span.nb")){let l=e.next;if(l&&l instanceof oi.Text){let c=l.next;if(c&&c instanceof oi.Element&&c.firstChild instanceof oi.Text&&dc(c,"span.m")){let d=Number.parseInt(c.firstChild.nodeValue||"0",10);if((t=e.firstChild.nodeValue)!=null&&t.includes("__marimo__")){let f=(r=/__marimo__cell_(\w+)_/.exec(e.firstChild.nodeValue))==null?void 0:r[1];if(f&&d)return{kind:"cell",cellId:f,lineNumber:d}}else{let f=(i=/"(.+?)"/.exec(e.firstChild.nodeValue))==null?void 0:i[1];if(f&&d)return{kind:"file",filePath:f,lineNumber:d}}}}}return null},Jh=function(e){let t=[];return u0(e,{replace:r=>{let i=I0(r);if(i)return t.push(i),"dummy"}}),t};function _y(e){return t=>{let r=!1;for(let i of t)i&&(r=e(i)||r);return r}}const VS=_y(Z8),BS=_y(eD);function xt(e,t){if(!(Number.isInteger(t.line)&&Number.isInteger(t.character))||t.line<0||t.character<0)return;if(t.line>=e.lines)return t.line===e.lines&&t.character===0?e.length:void 0;let r=e.line(t.line+1);return Math.min(r.from+t.character,r.to)}function Mn(e,t){let r=Number.isFinite(t)?Math.max(0,Math.min(t,e.length)):0,i=e.lineAt(r);return{character:r-i.from,line:i.number-1}}var fc=new yd.Renderer,HS=fc.code;fc.code=e=>e.text.trim()?HS.call(fc,e):"";function ky(e){return yd(e,{async:!1,gfm:!0,breaks:!0,renderer:fc})}function _f(e){return e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]??t)}function Cy(e){let t=e.trim();if(t.startsWith("//"))return!1;try{let r=new URL(t,"https://codemirror.invalid/");return r.protocol==="http:"||r.protocol==="https:"||r.protocol==="mailto:"}catch{return!1}}var WS=5;function US(e,t){let r=e;for(let i=0;i<WS;i++){let l=r;for(let c of t)l=l.replace(c,"");if(l===r)return{html:r,stable:!0};r=l}return{html:r,stable:!1}}function KS(e){if(typeof document>"u"){let{html:r,stable:i}=US(e,[/<\s*\/?\s*(?:script|style|iframe|object|embed|img)\b[^>]*>/gi,/\s+on[a-z]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,/\s+srcdoc\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi]);return i?r.replace(/\s+((?:xlink:)?href|src)\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,(l,c,d)=>Cy(d[0]==='"'||d[0]==="'"?d.slice(1,-1):d)?l:` ${c}=""`):_f(e)}let t=document.createElement("template");t.innerHTML=e;for(let r of t.content.querySelectorAll("script, style, iframe, object, embed, img"))r.remove();for(let r of t.content.querySelectorAll("*"))for(let i of[...r.attributes]){let l=i.name.toLowerCase();(l.startsWith("on")||l==="srcdoc"||(l==="href"||l==="src"||l==="xlink:href")&&!Cy(i.value))&&r.removeAttribute(i.name)}return t.innerHTML}function QS(e,t=ky){return Sy(e,t,new WeakSet)}function Sy(e,t,r){if(!e)return"";if(typeof e=="object"){if(r.has(e))return"";r.add(e)}if(Ty(e)){let i=e.value;if(typeof i!="string")return"";let l=_f(i);return e.kind==="markdown"&&(l=t(i.trim())),l}return Array.isArray(e)?e.map(i=>Sy(i,t,r)).filter(Boolean).join(`
|
|
14
|
+
|
|
15
|
+
`):typeof e=="string"?_f(e):Ay(e)?t(`\`\`\`${typeof e.language=="string"?e.language.replace(/[^\w+-]/g,""):""}
|
|
16
|
+
${e.value??""}
|
|
17
|
+
\`\`\``):""}function Ey(e){return e?Ty(e)?e.value:Array.isArray(e)?e.map(t=>Ey(t)).filter(Boolean).join(`
|
|
18
|
+
|
|
19
|
+
`):typeof e=="string"?e:Ay(e)?e.value:"":""}function Al(e,t,r){r.allowHTMLContent?e.innerHTML=KS(QS(t,r.markdownRenderer)):e.textContent=Ey(t)}function GS(e){if(e.length===0)return"";if(e.length===1)return e[0]||"";let t=[...e].sort(),r=t[0]||"",i=t[t.length-1]||"",l=0;for(;l<r.length&&r[l]===i[l];)l++;return r.substring(0,l)}function XS(e){if(e.length===0)return;let t=GS(e.map(l=>{var c;return((c=l.textEdit)==null?void 0:c.newText)??l.label}));if(t==="")return;let r=[];for(let l=0;l<t.length;l++){let c=t.slice(0,l+1);if(c.length>0){let d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");r.push(d)}}let i=r.join("|");return RegExp(`(${i})$`)}function YS(e){return(e==null?void 0:e.range)!==void 0}function JS(e){return!Array.isArray(e)}function ZS(e){return(e==null?void 0:e.insert)!==void 0&&(e==null?void 0:e.replace)!==void 0}function Ty(e){return typeof e=="object"&&!!e&&!Array.isArray(e)&&"kind"in e}function Iy(e){return typeof e=="string"?e:e.value}function Ay(e){return typeof e=="object"&&!!e&&"language"in e&&"value"in e}function Et(e,t){let r=document.createElement("div");r.className="cm-error-message",r.style.cssText=`
|
|
20
|
+
position: absolute;
|
|
21
|
+
padding: 8px;
|
|
22
|
+
background: #fee;
|
|
23
|
+
border: 1px solid #fcc;
|
|
24
|
+
border-radius: 4px;
|
|
25
|
+
color: #c00;
|
|
26
|
+
font-size: 14px;
|
|
27
|
+
z-index: 100;
|
|
28
|
+
max-width: 300px;
|
|
29
|
+
box-shadow: 0 2px 8px rgba(0,0,0,.15);
|
|
30
|
+
`,r.textContent=t;let i=e.coordsAtPos(e.state.selection.main.head);i&&(r.style.left=`${i.left}px`,r.style.top=`${i.bottom+5}px`),document.body.appendChild(r),setTimeout(()=>{r.style.opacity="0",r.style.transition="opacity 0.2s",setTimeout(()=>r.remove(),200)},3e3)}function kf(e){return Ly(e,new WeakSet)}function Ly(e,t){if(e==null)return!0;if(Array.isArray(e))return t.has(e)?!0:(t.add(e),e.length===0||e.every(i=>Ly(i,t)));if(typeof e=="string")return Dy(e);let r=e.value;return typeof r=="string"?Dy(r):!0}function Dy(e){return e==null?!0:typeof e=="string"?e.trim()===""||/^[\s\n`]*$/.test(e):!1}function e3(e,t){let r=[];return t.iterChanges((i,l,c,d,f)=>{let h=f.toString();if(i===0&&l===e.length){r.push({text:h});return}let b=Mn(e,i),x=Mn(e,l);r.push({range:{start:b,end:x},text:h})}),r.sort((i,l)=>{if(!i.range)return 1;if(!l.range)return-1;let c=i.range.start.line??-1,d=l.range.start.line??-1;if(c!==d)return d-c;let f=i.range.start.character??-1;return(l.range.start.character??-1)-f}),r}var Oy=j_(),t3=Object.fromEntries(Object.entries(Oy.CompletionItemKind).map(([e,t])=>[t,e]));function n3(e){var t;return!!(e.deprecated||(t=e.tags)!=null&&t.includes(Oy.CompletionItemTag.Deprecated))}function r3(e){return e.deprecated?"cm-deprecated":""}function a3(e){return"insert"in e}function i3(e,t){if(!t)return e;let r={...e};if(r.commitCharacters??(r.commitCharacters=t.commitCharacters),r.insertTextFormat??(r.insertTextFormat=t.insertTextFormat),r.insertTextMode??(r.insertTextMode=t.insertTextMode),r.data===void 0&&(r.data=t.data),r.textEdit==null&&t.editRange){let i=r.textEditText??r.insertText??r.label;r.textEdit=a3(t.editRange)?{newText:i,insert:t.editRange.insert,replace:t.editRange.replace}:{newText:i,range:t.editRange}}return r}function o3(e,t,r,i){let{textEdit:l,insertText:c,label:d}=t,f=r,h=i,b=c||d;if(l){let x=YS(l)?l.range:ZS(l)?l.replace:void 0;if(x){b=l.newText;let C=xt(e,x.start),S=xt(e,x.end);C!=null&&S!=null&&C<=S&&(f=C,h=S)}}return{from:f,to:h,newText:b}}function My(e,t,r,i){let l=[];for(let c of t){let d=xt(e,c.range.start),f=xt(e,c.range.end);d==null||f==null||d>f||f>r&&d<i||l.push({from:d,to:f,insert:c.newText})}return l}function l3(e,t,r){return i=>i<=e?i:i-(t-e)+r}function s3(e){let{view:t,originalDoc:r,mainFrom:i,mainTo:l,insertedLength:c,resolveItem:d}=e,f=t.state.doc,h=l3(i,l,c);d().then(b=>{let x=b==null?void 0:b.additionalTextEdits;if(!(x!=null&&x.length)||t.state.doc!==f)return;let C=My(r,x,i,l).map(S=>({...S,from:h(S.from),to:h(S.to)}));C.length!==0&&t.dispatch({changes:C,userEvent:"input.complete"})}).catch(b=>{console.error("Failed to resolve completion item:",b)})}var Cf;(function(e){e.PlainText=1,e.Snippet=2})(Cf||(Cf={}));var c3=/^\$\{(\d+)\|((?:\\.|[^\\}])*)\|\}/,u3=/^\$\{([A-Za-z_][A-Za-z0-9_]*)(?::([^}]*))?\}/,d3=/^\$[A-Za-z_][A-Za-z0-9_]*/,f3=/^(?:\\.|[^,])*/,p3=/^\{0(?=[:}])/;function Ry(e,t){var l;let r="",i=0;for(;i<e.length;){let c=e[i];if(c==="\\"&&i+1<e.length){r+=e.slice(i,i+2),i+=2;continue}if(c==="$"){let d=e.slice(i),f=c3.exec(d);if(f){let x=((l=f3.exec(f[2]??""))==null?void 0:l[0])??"";r+=t(f[1]??"",x),i+=f[0].length;continue}let h=u3.exec(d);if(h){r+=h[2]??"",i+=h[0].length;continue}let b=d3.exec(d);if(b){i+=b[0].length;continue}}r+=c,i+=1}return r}function m3(e){let t=0;for(let r of e.matchAll(/\$\{?(\d+)/g))t=Math.max(t,Number(r[1]));return String(t+1)}function h3(e){let t=Ry(e,(c,d)=>`\${${c}:${d}}`),r=m3(t),i="",l=0;for(;l<t.length;){let c=t[l];if(c==="\\"&&l+1<t.length){let d=t[l+1];d==="$"?t[l+2]==="{"?(i+="$\\{",l+=3):(i+="$",l+=2):d==="{"||d==="}"?(i+=`\\${d}`,l+=2):d==="\\"?(i+="\\",l+=2):(i+=d,l+=2)}else if(c==="$"){let d=t.slice(l+1),f=p3.exec(d),h=/^\d+/.exec(d);if(f)i+=`\${${r}`,l+=1+f[0].length;else if(h){let b=h[0]==="0"?r:h[0];i+=`\${${b}}`,l+=1+h[0].length}else i+=c,l+=1}else c==="#"&&t[l+1]==="{"?(i+="#\\{",l+=2):(i+=c,l+=1)}return i}function g3(e){let t=Ry(e,(l,c)=>c),r="",i=0;for(;i<t.length;){let l=t[i];if(l==="\\"&&i+1<t.length)r+=t[i+1],i+=2;else if(l==="$"){let c=/^\{(\d+)(?::([^}]*))?\}/.exec(t.slice(i+1));if(c)r+=c[2]??"",i+=1+c[0].length;else{let d=/^\d+/.exec(t.slice(i+1));d?i+=1+d[0].length:(r+=l,i+=1)}}else r+=l,i+=1}return r}function y3(e,t){var j;let{detail:r,labelDetails:i,label:l,kind:c,documentation:d,additionalTextEdits:f,insertTextFormat:h,commitCharacters:b,filterText:x}=e,C=typeof l=="string"?l:"",S=null,E=()=>(S??(S=t.resolveItem(e)),S),A={label:C,detail:(i==null?void 0:i.detail)||r,apply(q,V,z,X){let fe=q.state,{from:F,to:H,newText:te}=o3(fe.doc,e,z,X);(F>X||H<X)&&(F=z,H=X);let me=te,ve=My(fe.doc,f??[],F,H),_e=oe=>{f||!t.hasResolveProvider||s3({view:q,originalDoc:fe.doc,mainFrom:F,mainTo:H,insertedLength:oe,resolveItem:E})};if(h===Cf.Snippet&&t.useSnippetOnCompletion){let oe=F,ce=H;if(ve.length>0){let ie=fe.changes(ve);q.dispatch({changes:ie}),oe=ie.mapPos(oe,1),ce=ie.mapPos(ce,1)}let ye=q.state.doc.length;DD(h3(me))(q,null,oe,ce),_e(q.state.doc.length-ye+(ce-oe));return}if(h===Cf.Snippet&&(me=g3(me)),ve.length===0){q.dispatch(AD(fe,me,F,H)),_e(me.length);return}let ke=fe.changes([{from:F,to:H,insert:me},...ve]);q.dispatch({changes:ke,selection:{anchor:ke.mapPos(F,-1)+me.length},userEvent:"input.complete"})},type:c?(j=t3[c])==null?void 0:j.toLowerCase():void 0};x!=null&&x!==C&&(A.label=x,A.displayLabel=C),b!=null&&b.length&&(A.commitCharacters=b),n3(e)&&(A.deprecated=!0);let R=q=>{let V=document.createElement("div");return V.classList.add("documentation"),Al(V,q,{allowHTMLContent:t.allowHTMLContent,markdownRenderer:t.markdownRenderer}),V};return t.hasResolveProvider?A.info=async()=>{var q;try{let V=((q=await E())==null?void 0:q.documentation)||d;return!V||kf(V)?null:R(V)}catch(V){return console.error("Failed to resolve completion item:",V),!d||kf(d)?null:R(d)}}:d&&(A.info=()=>R(d)),A}function v3(e,t,r,i=!0){let l=[t?b3(t):w3,r==="python"?x3:void 0].filter(Boolean),c=[...e];if(t&&i){let d=t.toLowerCase();/^\w+$/.test(d)&&(c=c.filter(({label:f,filterText:h})=>(typeof h=="string"?h:xa(f)).toLowerCase().startsWith(d)))}for(let d of l)c.sort(d);return c}function b3(e){return(t,r)=>{let i=Py(t).startsWith(e),l=Py(r).startsWith(e);if(i&&!l)return-1;if(!i&&l)return 1;let c=typeof t.sortText=="string"?t.sortText:xa(t.label),d=typeof r.sortText=="string"?r.sortText:xa(r.label);return c.localeCompare(d)}}function w3(e,t){let r=typeof e.sortText=="string"?e.sortText:xa(e.label),i=typeof t.sortText=="string"?t.sortText:xa(t.label);return r.localeCompare(i)}function x3(e,t){let r=xa(e.label).endsWith("="),i=xa(t.label).endsWith("=");return r&&!i?-1:!r&&i?1:0}function Py(e){return typeof e.filterText=="string"?e.filterText:xa(e.label)}function xa(e){return typeof e=="string"?e:""}function Ny(e){let t=new Proxy({},{get(){throw Error(e)}});return function(r){return r[0]??t}}var jy=Ny("No document URI provided. Pass one to the extension or use documentUri.of()."),zy=Ny("No language ID provided. Pass one to the extension or use languageId.of().");function _3(e){if(e!==e.trim())return!1;try{return!!new URL(e).protocol}catch{return!1}}const Fy=hl.define({combine(e){if(e.length===0)return jy(e);let t=jy(e);if(!(t&&_3(t)))throw Error("Document URI must be a non-empty absolute URI");return t}}),k3=hl.define({combine(e){if(e.length===0)return zy(e);let t=zy(e);if(!t.trim())throw Error("Language ID must be a non-empty string");return t}}),_a={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,RequestTimeout:-32001};var pi=class extends Error{constructor(t,r,i){super(r);ae(this,"code");ae(this,"data");this.name="RPCError",this.code=t,this.data=i}},C3=1e4;function qy(e){return e.id!=null}function Sf(e){return e instanceof Error?e:new pi(_a.InternalError,String(e))}let $y,Vy,By,Hy,Ef,Wy,Lt,Ll,Uy;$y=class{constructor(e){ae(this,"transport");ae(this,"pending",new Map);ae(this,"disconnect");ae(this,"disconnectClose");ae(this,"connected");ae(this,"nextId",0);ae(this,"closed",!1);ae(this,"isConnected",!1);ae(this,"closeError");ae(this,"notificationHandler");ae(this,"requestHandler");var t;this.transport=e,this.disconnect=e.onMessage(r=>this.receive(r)),this.disconnectClose=(t=e.onClose)==null?void 0:t.call(e,r=>{this.closeError??(this.closeError=r);for(let i of[...this.pending.keys()])this.settle(i,l=>l.reject(r))}),this.connected=e.connect(),this.connected.then(()=>{this.isConnected=!0},()=>{}),this.connected.catch(()=>{})}onNotification(e){this.notificationHandler=e}onRequest(e){this.requestHandler=e}request(e,t,r=C3){if(this.closed)return Promise.reject(new pi(_a.InternalError,"Client closed"));if(this.closeError)return Promise.reject(this.closeError);let i=this.nextId++;return new Promise((l,c)=>{let d=setTimeout(()=>{this.pending.delete(i),c(new pi(_a.RequestTimeout,`Request "${e}" timed out after ${r}ms`))},r);this.pending.set(i,{resolve:l,reject:c,timer:d});let f=()=>{if(this.pending.has(i))try{this.transport.send({jsonrpc:"2.0",id:i,method:e,params:t})}catch(h){this.settle(i,b=>b.reject(Sf(h)))}};if(this.isConnected){f();return}this.connected.then(f,h=>this.settle(i,b=>b.reject(Sf(h))))})}notify(e,t){let r=this.dispatch({jsonrpc:"2.0",method:e,params:t});return r.catch(()=>{}),r}respond(e){return this.dispatch(e)}close(){var e;if(!this.closed){this.closed=!0;for(let t of this.pending.values())clearTimeout(t.timer),t.reject(new pi(_a.InternalError,"Client closed"));this.pending.clear(),this.disconnect(),(e=this.disconnectClose)==null||e.call(this),this.transport.close()}}dispatch(e){if(this.closed)return Promise.resolve();if(this.isConnected)try{return this.transport.send(e),Promise.resolve()}catch(t){return Promise.reject(Sf(t))}return this.connected.then(()=>{this.closed||this.transport.send(e)})}settle(e,t){let r=this.pending.get(e);r&&(clearTimeout(r.timer),this.pending.delete(e),t(r))}receive(e){var i,l;if(this.closed||typeof e!="object"||!e||Array.isArray(e)||e.jsonrpc!=="2.0")return;if(typeof e.method=="string"){qy(e)?(i=this.requestHandler)==null||i.call(this,e):(l=this.notificationHandler)==null||l.call(this,e);return}if(!qy(e))return;let t=e,r=t.id;if(typeof r=="string"&&!this.pending.has(r)&&/^\d+$/.test(r)){let c=Number(r);this.pending.has(c)&&(r=c)}this.settle(r,c=>{if("error"in t){let d=t.error;if(typeof d!="object"||!d||typeof d.code!="number"||typeof d.message!="string"){c.reject(new pi(_a.InvalidRequest,"Malformed JSON-RPC error response",d));return}c.reject(new pi(d.code,d.message,d.data))}else"result"in t?c.resolve(t.result):c.reject(new pi(_a.InvalidRequest,"Malformed JSON-RPC response: missing result or error"))})}},Vy=1e4,By=2048,Hy="Language server: ",Ef={"textDocument/hover":"hoverProvider","textDocument/completion":"completionProvider","textDocument/definition":"definitionProvider","textDocument/declaration":"declarationProvider","textDocument/typeDefinition":"typeDefinitionProvider","textDocument/implementation":"implementationProvider","textDocument/references":"referencesProvider","textDocument/documentHighlight":"documentHighlightProvider","textDocument/documentSymbol":"documentSymbolProvider","textDocument/codeAction":"codeActionProvider","textDocument/codeLens":"codeLensProvider","textDocument/documentLink":"documentLinkProvider","textDocument/formatting":"documentFormattingProvider","textDocument/rangeFormatting":"documentRangeFormattingProvider","textDocument/onTypeFormatting":"documentOnTypeFormattingProvider","textDocument/rename":"renameProvider","textDocument/prepareRename":"renameProvider","textDocument/signatureHelp":"signatureHelpProvider","textDocument/foldingRange":"foldingRangeProvider","textDocument/selectionRange":"selectionRangeProvider","workspace/symbol":"workspaceSymbolProvider","workspace/executeCommand":"executeCommandProvider"},Sl=class{constructor({rootUri:e,workspaceFolders:t,transport:r,initializationOptions:i,capabilities:l,timeout:c=Vy,getWorkspaceConfiguration:d}){ae(this,"ready");ae(this,"capabilities");ae(this,"advertisedCapabilities");ae(this,"initializePromise");ae(this,"rootUri");ae(this,"workspaceFolders");ae(this,"timeout");ae(this,"client");ae(this,"initializationOptions");ae(this,"clientCapabilities");ae(this,"notificationListeners",new Set);ae(this,"documentOpenCounts",new Map);ae(this,"serverRequestHandlers",new Map);ae(this,"dynamicCapabilities",new Map);ae(this,"isClosed",!1);if(!e)throw Error("rootUri must be a non-empty URI");this.rootUri=e,this.workspaceFolders=t,this.initializationOptions=i,this.clientCapabilities=l,this.timeout=c,this.ready=!1,this.capabilities=null,this.client=new $y(r),this.client.onNotification(f=>{this.processNotification(f)}),this.client.onRequest(f=>{this.handleServerRequest(f)}),this.onRequest("workspace/configuration",f=>d?d(f):((f==null?void 0:f.items)??[]).map(()=>null)),this.onRequest("client/registerCapability",f=>{let h=f==null?void 0:f.registrations;if(!Array.isArray(h))return null;for(let b of h)!b||typeof b.id!="string"||b.id.length===0||typeof b.method!="string"||this.dynamicCapabilities.has(b.id)||this.dynamicCapabilities.set(b.id,b);return null}),this.onRequest("client/unregisterCapability",f=>{let h=f==null?void 0:f.unregisterations;if(!Array.isArray(h))return null;for(let b of h)this.dynamicCapabilities.delete(b.id);return null}),this.onRequest("workspace/applyEdit",()=>({applied:!1,failureReason:"workspace/applyEdit is not supported"})),this.onRequest("window/showMessageRequest",f=>{if(f!=null&&f.message){let h=String(f.message).replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g,"").slice(0,By-17);console.info(`${Hy}${h}`)}return null}),this.onRequest("window/workDoneProgress/create",()=>null),this.initializePromise=this.initialize(),this.initializePromise.catch(f=>{console.error("Language server initialization failed",f)})}getInitializationOptions(){let e={textDocument:{hover:{dynamicRegistration:!0,contentFormat:["markdown","plaintext"]},moniker:{},synchronization:{dynamicRegistration:!1,willSave:!0,didSave:!0,willSaveWaitUntil:!0},codeAction:{dynamicRegistration:!0,codeActionLiteralSupport:{codeActionKind:{valueSet:["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},resolveSupport:{properties:["edit"]}},completion:{dynamicRegistration:!1,completionItem:{snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:["markdown","plaintext"],deprecatedSupport:!0,preselectSupport:!1,insertReplaceSupport:!0,tagSupport:{valueSet:[1]},resolveSupport:{properties:["documentation","detail","additionalTextEdits"]}},completionList:{itemDefaults:["commitCharacters","editRange","insertTextFormat","insertTextMode","data"]},contextSupport:!1},signatureHelp:{dynamicRegistration:!1,signatureInformation:{documentationFormat:["markdown","plaintext"]}},declaration:{dynamicRegistration:!1,linkSupport:!0},definition:{dynamicRegistration:!0,linkSupport:!0},typeDefinition:{dynamicRegistration:!1,linkSupport:!0},implementation:{dynamicRegistration:!1,linkSupport:!0},rename:{dynamicRegistration:!0,prepareSupport:!0},publishDiagnostics:{relatedInformation:!0,tagSupport:{valueSet:[1,2]},versionSupport:!0,codeDescriptionSupport:!0,dataSupport:!0}},workspace:{didChangeConfiguration:{dynamicRegistration:!1}}};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 e=this.getInitializationOptions();this.advertisedCapabilities=e==null?void 0:e.capabilities;let t=await this.request("initialize",e,this.timeout*3);if(!t||typeof t!="object"||!("capabilities"in t)||typeof t.capabilities!="object"||t.capabilities===null)throw Error("Invalid initialize response: missing server capabilities");this.isClosed||(this.capabilities=t.capabilities,this.notify("initialized",{}),this.ready=!0)}close(){if(!this.isClosed){if(this.isClosed=!0,this.ready=!1,this.notificationListeners.clear(),this.serverRequestHandlers.clear(),this.dynamicCapabilities.clear(),this.documentOpenCounts.clear(),this.capabilities){this.client.request("shutdown",null,this.timeout).catch(()=>{}).then(()=>{this.client.notify("exit",void 0).catch(()=>{}),this.client.close()});return}this.client.close()}}onRequest(e,t){return this.serverRequestHandlers.set(e,t),()=>{this.serverRequestHandlers.get(e)===t&&this.serverRequestHandlers.delete(e)}}mayRegisterDynamically(e){var i,l,c;let[t,r]=e.split("/");return t!=="textDocument"||!r?!1:((c=(l=(i=this.advertisedCapabilities)==null?void 0:i.textDocument)==null?void 0:l[r])==null?void 0:c.dynamicRegistration)===!0}hasCapability(e){var r;for(let i of this.dynamicCapabilities.values())if(i.method===e)return!0;let t=Ef[e];return t?!!((r=this.capabilities)!=null&&r[t]):!1}async handleServerRequest(e){let t=this.serverRequestHandlers.get(e.method),r;if(!t)r={jsonrpc:"2.0",id:e.id,error:{code:_a.MethodNotFound,message:`Method not found: ${e.method}`}};else try{let i=await t(e.params);r={jsonrpc:"2.0",id:e.id,result:i===void 0?null:i}}catch(i){r={jsonrpc:"2.0",id:e.id,error:{code:_a.InternalError,message:i instanceof Error?i.message:String(i)}}}this.isClosed||this.client.respond(r).catch(()=>{})}textDocumentDidOpen(e){let t=e.textDocument.uri,r=this.documentOpenCounts.get(t)??0;return this.documentOpenCounts.set(t,r+1),r>0?Promise.resolve(!1):this.notify("textDocument/didOpen",e).then(()=>!0)}textDocumentDidChange(e){return this.notify("textDocument/didChange",e)}textDocumentDidClose(e){let t=e.textDocument.uri,r=this.documentOpenCounts.get(t)??0;return r>1?(this.documentOpenCounts.set(t,r-1),Promise.resolve(void 0)):(this.documentOpenCounts.delete(t),this.notify("textDocument/didClose",e))}textDocumentWillSave(e){return this.notify("textDocument/willSave",e)}async textDocumentWillSaveWaitUntil(e){return await this.request("textDocument/willSaveWaitUntil",e,this.timeout)}textDocumentDidSave(e){return this.notify("textDocument/didSave",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 codeActionResolve(e){return await this.request("codeAction/resolve",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,t,r){if(e==="initialize")return this.client.request(e,t,r);let i=this.hasCapability(e),l=!(this.ready||this.capabilities)&&this.mayRegisterDynamically(e);return this.initializePromise.then(()=>{if(this.isClosed)throw Error("Language server client is closed");if(Ef[e]&&!l&&!(i||this.hasCapability(e)))throw Error(`Language server does not support method ${e}`);return this.client.request(e,t,r)})}notify(e,t){return this.client.notify(e,t)}processNotification(e){for(let t of this.notificationListeners)try{Promise.resolve(t(e)).catch(r=>{console.error("Notification listener failed",r)})}catch(r){console.error("Notification listener failed",r)}}},Wy=(xi=class{constructor(t,r){ae(this,"url");ae(this,"protocols");ae(this,"socket");ae(this,"opened",!1);ae(this,"closed",!1);ae(this,"rejectConnect");ae(this,"handlers",new Set);ae(this,"closeHandlers",new Set);ae(this,"outbox",[]);this.url=t,this.protocols=r}connect(){var t,r;return/^wss?:\/\//i.test(this.url)?(this.url.toLowerCase().startsWith("ws://")&&typeof location<"u"&&location.protocol==="https:"&&console.warn(`Insecure WebSocket ${this.url} may be blocked from an HTTPS page`),(t=this.rejectConnect)==null||t.call(this,Error(`WebSocket connection to ${this.url} was replaced`)),this.rejectConnect=void 0,(r=this.socket)==null||r.close(),this.opened=!1,this.closed=!1,new Promise((i,l)=>{let c=new WebSocket(this.url,this.protocols);this.socket=c,this.rejectConnect=l,c.addEventListener("open",()=>{if(this.socket===c){this.opened=!0,this.rejectConnect=void 0;for(let d of this.outbox)c.send(d);this.outbox=[],i()}}),c.addEventListener("message",d=>{this.socket===c&&this.receiveFrame(d.data,c)}),c.addEventListener("error",()=>{if(this.socket!==c)return;let d=Error(`WebSocket connection to ${this.url} failed`);this.opened?this.emitClose(d):l(d)}),c.addEventListener("close",()=>{this.socket===c&&(this.opened?this.closed||this.emitClose(Error(`WebSocket connection to ${this.url} closed`)):l(Error(`WebSocket to ${this.url} closed before opening`)))})})):Promise.reject(Error(`Invalid WebSocket URL: ${this.url||"(empty)"}`))}send(t){if(this.closed)return;let r=JSON.stringify(t);this.socket&&this.socket.readyState===WebSocket.OPEN?this.socket.send(r):this.outbox.length<xi.OUTBOX_LIMIT&&this.outbox.push(r)}onMessage(t){return this.handlers.add(t),()=>{this.handlers.delete(t)}}onClose(t){return this.closeHandlers.add(t),()=>{this.closeHandlers.delete(t)}}close(){var t,r;(t=this.rejectConnect)==null||t.call(this,Error(`WebSocket to ${this.url} closed`)),this.rejectConnect=void 0,this.closed=!0,this.opened=!1,this.handlers.clear(),this.closeHandlers.clear(),this.outbox=[],(r=this.socket)==null||r.close(),this.socket=void 0}receiveFrame(t,r){if(t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]"){this.dispatchFrame(new TextDecoder().decode(t));return}if(typeof Blob<"u"&&t instanceof Blob){t.text().then(i=>{this.socket===r&&this.dispatchFrame(i)});return}this.dispatchFrame(String(t))}dispatchFrame(t){if(this.closed)return;let r;try{r=JSON.parse(t)}catch{return}if(typeof r!="object"||!r||Array.isArray(r))return;let i=r;for(let l of this.handlers)try{l(i)}catch(c){console.error("WebSocket message handler failed",c)}}emitClose(t){this.opened=!1,this.closed=!0;for(let r of this.closeHandlers)try{r(t)}catch(i){console.error("WebSocket close handler failed",i)}}},ae(xi,"OUTBOX_LIMIT",1e3),xi),Lt=j_(),Ll=console.log,Uy=2**31-1;function S3(){return String(Date.now()+Math.random())}function Dl(e){return e!=null&&typeof e.command=="string"}function ka(e,t){return e.line===t.line?e.character-t.character:e.line-t.line}function E3(e,t){let r=ka(e.start,e.end)===0,i=ka(t.start,t.end)===0;return r||i?ka(e.start,t.end)<=0&&ka(t.start,e.end)<=0:ka(e.start,t.end)<0&&ka(t.start,e.end)<0}function T3(e,t){if(Dl(e))return!0;let r=e.diagnostics;return!r||r.length===0?!0:r.some(i=>E3(i.range,t.range))}function I3(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"||t.protocol==="mailto:"}var Tf=Ln.define();let pc,If;pc=Cr.define({create:()=>new Map,update(e,t){let r=e;for(let i of t.effects)if(i.is(Tf)){r===e&&(r=new Map(e));for(let l of[...r.keys()])l.startsWith(`${i.value.pluginId}:`)&&r.delete(l);for(let[l,c]of i.value.anchors)r.set(l,c)}if(t.docChanged&&r.size>0){r===e&&(r=new Map(e));for(let[i,l]of r)r.set(i,{from:t.changes.mapPos(l.from,1),to:t.changes.mapPos(l.to,l.from===l.to?1:-1)})}return r}}),Xs=Ln.define(),Ys=Cr.define({create:()=>null,update(e,t){for(let r of t.effects)if(r.is(Xs))return r.value;if(e&&t.docChanged){let r=t.changes.mapPos(e.pos),i=e.end==null?void 0:t.changes.mapPos(e.end);return{...e,pos:r,end:i}}return e},provide:e=>x_.from(e)}),If=__.define();var A3=20,mc=new WeakMap;function L3(e,t){let r=mc.get(e);r?r.push(t):mc.set(e,[t])}function D3(e,t){let r=mc.get(e);if(!r)return;let i=r.indexOf(t);i!==-1&&r.splice(i,1),r.length===0&&mc.delete(e)}var O3=class{constructor(e){ae(this,"documentVersion");ae(this,"pluginId");ae(this,"pendingDocumentChanges",new Set);ae(this,"client");ae(this,"documentUri");ae(this,"languageId");ae(this,"view");ae(this,"allowHTMLContent");ae(this,"useSnippetOnCompletion");ae(this,"clientSideFiltering");ae(this,"sendIncrementalChanges");ae(this,"featureOptions");ae(this,"onGoToDefinition");ae(this,"onShowLocation");ae(this,"markdownRenderer");ae(this,"codeActionsConfig");ae(this,"disposeListener");ae(this,"destroyed",!1);ae(this,"documentOpened",!1);ae(this,"documentTextSnapshotted",!1);ae(this,"documentOpenCarriedText",!0);ae(this,"documentReady");ae(this,"signatureHelpRequestId",0);ae(this,"closeCodeActionMenu");ae(this,"closeRenamePopup");ae(this,"lastSeenDiagnosticsVersion",null);let{client:t,documentUri:r,languageId:i,view:l,featureOptions:c,sendIncrementalChanges:d=!0,allowHTMLContent:f=!1,useSnippetOnCompletion:h=!1,clientSideFiltering:b=!1,onGoToDefinition:x,onShowLocation:C,markdownRenderer:S=ky,codeActionsConfig:E}=e;this.documentVersion=0,this.pluginId=S3(),this.client=t,this.documentUri=r,this.languageId=i,this.view=l,this.allowHTMLContent=f,this.useSnippetOnCompletion=h,this.clientSideFiltering=b,this.sendIncrementalChanges=d,this.featureOptions=c,this.onGoToDefinition=x,this.onShowLocation=C,this.markdownRenderer=S,this.codeActionsConfig=E,L3(l,this),this.disposeListener=t.onNotification(this.processNotification.bind(this)),this.documentReady=this.initialize().catch(A=>{console.error("Language server initialization failed",A)})}update({state:e,docChanged:t,startState:{doc:r},changes:i}){if(!t)return;let l=this.resolveTextDocumentSyncKind();l!==Lt.TextDocumentSyncKind.None&&(this.sendIncrementalChanges&&l===Lt.TextDocumentSyncKind.Incremental?this.trackDocumentChanges(e3(r,i)):this.trackDocumentChanges([{text:e.doc.toString()}]))}trackDocumentChanges(e){let t=this.sendChanges(e);this.pendingDocumentChanges.add(t),t.finally(()=>this.pendingDocumentChanges.delete(t))}destroy(){var e,t,r;this.destroyed=!0,(e=this.disposeListener)==null||e.call(this),this.disposeListener=void 0,(t=this.closeCodeActionMenu)==null||t.call(this),(r=this.closeRenamePopup)==null||r.call(this),this.view.state.field(pc,!1)&&this.view.dispatch({effects:Tf.of({pluginId:this.pluginId,anchors:new Map})}),D3(this.view,this),this.closeDocument()}closeDocument(){this.documentOpened&&this.client.ready&&(this.documentOpened=!1,Promise.resolve(this.client.textDocumentDidClose({textDocument:{uri:this.documentUri}})).catch(e=>{console.error("Failed to send didClose",e)}))}async initialize({documentText:e}={}){if(this.client.initializePromise&&await this.client.initializePromise,this.destroyed)return;let t=e??this.view.state.doc.toString();this.documentTextSnapshotted=!0,this.documentOpenCarriedText=await this.client.textDocumentDidOpen({textDocument:{uri:this.documentUri,languageId:this.languageId,text:t,version:this.documentVersion}})!==!1,this.documentOpened=!0,this.destroyed&&this.closeDocument()}resolveTextDocumentSyncKind(){var t;let e=(t=this.client.capabilities)==null?void 0:t.textDocumentSync;return e==null?this.sendIncrementalChanges?Lt.TextDocumentSyncKind.Incremental:Lt.TextDocumentSyncKind.Full:typeof e=="number"?e:e.change??Lt.TextDocumentSyncKind.None}async sendChanges(e){let t=this.documentTextSnapshotted;if(!(!this.documentOpened&&(await this.documentReady,!t&&this.documentOpenCarriedText))&&this.client.ready)try{await this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:++this.documentVersion},contentChanges:e})}catch(r){console.error(r)}}async documentDidSave(e=Lt.TextDocumentSaveReason.Manual){var c;if(!this.client.ready||(await Promise.all(this.pendingDocumentChanges),this.destroyed||!this.client.ready))return;let t=(c=this.client.capabilities)==null?void 0:c.textDocumentSync,r=typeof t=="object"&&t?t:void 0;if(r!=null&&r.willSave){try{await this.client.textDocumentWillSave({textDocument:{uri:this.documentUri},reason:e})}catch(d){console.error("Failed to send willSave",d)}if(this.destroyed||!this.client.ready)return}if(r!=null&&r.willSaveWaitUntil){try{let d=await this.client.textDocumentWillSaveWaitUntil({textDocument:{uri:this.documentUri},reason:e});d&&d.length>0&&!this.destroyed&&(this.applyEdits(this.view,d),await Promise.all(this.pendingDocumentChanges))}catch(d){console.error("Failed during willSaveWaitUntil",d)}if(this.destroyed||!this.client.ready)return}let i=r==null?void 0:r.save;if(i==null||i===!1)return;let l=typeof i=="object"&&i.includeText;try{await this.client.textDocumentDidSave({textDocument:{uri:this.documentUri},text:l?this.view.state.doc.toString():void 0})}catch(d){console.error("Failed to send didSave",d)}}requestDiagnostics(e){this.sendChanges([{text:e.state.doc.toString()}])}async requestHoverTooltip(e,{line:t,character:r}){if(!this.featureOptions.hoverEnabled||!(this.client.ready&&this.client.hasCapability("textDocument/hover")))return null;let i;try{i=await this.client.textDocumentHover({textDocument:{uri:this.documentUri},position:{line:t,character:r}})}catch{return null}if(!i)return null;let{contents:l,range:c}=i,d=xt(e.state.doc,{line:t,character:r}),f;if(c&&(d=xt(e.state.doc,c.start),f=xt(e.state.doc,c.end)),d==null||kf(l))return null;let h=document.createElement("div");return h.classList.add("documentation","cm-lsp-hover-tooltip"),Al(h,l,{allowHTMLContent:this.allowHTMLContent,markdownRenderer:this.markdownRenderer}),{pos:d,end:f,create:b=>({dom:h}),above:!0}}async requestCompletion(e,{line:t,character:r},{triggerKind:i,triggerCharacter:l}){if(!this.featureOptions.completionEnabled||(await Promise.all(this.pendingDocumentChanges),!(this.client.ready&&this.client.hasCapability("textDocument/completion"))))return null;let c;try{c=await this.client.textDocumentCompletion({textDocument:{uri:this.documentUri},position:{line:t,character:r},context:{triggerKind:i,triggerCharacter:l}})}catch{return null}if(!c)return null;let d=JS(c)?c:{isIncomplete:!1,items:c};if(!Array.isArray(d.items))return null;let f=d.items.map(A=>i3(A,d.itemDefaults)),h=this.clientSideFiltering&&!d.isIncomplete,b=XS(f),x=b?e.matchBefore(b)??e.matchBefore(/[a-zA-Z0-9_]+/):e.matchBefore(/[a-zA-Z0-9_]+/),{pos:C}=e,S=v3(f,x==null?void 0:x.text,this.languageId,!h);x&&(C=x.from);let E=S.map(A=>{var R,j;return y3(A,{allowHTMLContent:this.allowHTMLContent,useSnippetOnCompletion:this.useSnippetOnCompletion,hasResolveProvider:((j=(R=this.client.capabilities)==null?void 0:R.completionProvider)==null?void 0:j.resolveProvider)??!1,resolveItem:this.client.completionItemResolve.bind(this.client)})});return h?{from:C,options:E,validFor:/^\w*$/}:{from:C,options:E,filter:!1}}async requestDefinition(e,{line:t,character:r}){if(!this.featureOptions.definitionEnabled||!(this.client.ready&&this.client.hasCapability("textDocument/definition")))return;let i;try{i=await this.client.textDocumentDefinition({textDocument:{uri:this.documentUri},position:{line:t,character:r}})}catch{return}if(!i||this.destroyed)return;let l=Array.isArray(i)?i:[i];if(l.length===0)return;let c=l[0];if(!c||typeof c!="object")return;let d="uri"in c&&typeof c.uri=="string"?c.uri:"targetUri"in c&&typeof c.targetUri=="string"?c.targetUri:void 0,f="range"in c?c.range:"targetRange"in c?c.targetRange:void 0;if(!(d&&(f!=null&&f.start)&&f.end))return;let h=d!==this.documentUri,b={uri:d,range:f,isExternalDocument:h};if(!h){let x=xt(e.state.doc,f.start),C=xt(e.state.doc,f.end);if(x==null||C==null||x>C)return;e.dispatch(e.state.update({selection:{anchor:x,head:C}}))}return this.onGoToDefinition&&this.onGoToDefinition(b),b}processNotification(e){try{e.method==="textDocument/publishDiagnostics"&&e.params&&this.processDiagnostics(e.params).catch(t=>Ll(t))}catch(t){Ll(t)}}async processDiagnostics(e){if(!e||e.uri!==this.documentUri||!Array.isArray(e.diagnostics))return;if(e.version!=null){if(typeof e.version!="number"||!Number.isInteger(e.version)||e.version<0||e.version>Uy||this.lastSeenDiagnosticsVersion!=null&&e.version<this.lastSeenDiagnosticsVersion)return;this.lastSeenDiagnosticsVersion=e.version}else if(this.lastSeenDiagnosticsVersion!=null)return;if(!this.featureOptions.diagnosticsEnabled){this.clearDiagnostics();return}let t={[Lt.DiagnosticSeverity.Error]:"error",[Lt.DiagnosticSeverity.Warning]:"warning",[Lt.DiagnosticSeverity.Information]:"info",[Lt.DiagnosticSeverity.Hint]:"hint"},r=this.view.state.doc,i=e.diagnostics.filter(f=>{if(!f||typeof f!="object"||!f.range||typeof f.message!="string"&&(typeof f.message!="object"||f.message===null||typeof f.message.value!="string"))return!1;let h=xt(r,f.range.start),b=xt(r,f.range.end);return h!=null&&b!=null&&h<=b});if(e.diagnostics.length>0&&i.length===0)return;let l=[];try{l=await this.requestCodeActionsForDiagnostics(i)??[]}catch(f){console.error("Failed to fetch code actions",f)}if(this.destroyed||e.version!=null&&this.lastSeenDiagnosticsVersion!=null&&e.version<this.lastSeenDiagnosticsVersion||this.view.state.doc!==r)return;let c=new Map,d=i.map((f,h)=>{var fe;let{range:b,message:x,severity:C,code:S,source:E,tags:A}=f,R=xt(r,b.start),j=xt(r,b.end);if(R==null||j==null||R>j)return null;(fe=f.relatedInformation)==null||fe.forEach((F,H)=>{if(F.location.uri!==this.documentUri)return;let te=xt(r,F.location.range.start),me=xt(r,F.location.range.end);te==null||me==null||c.set(`${this.pluginId}:${h}:${H}`,{from:te,to:me})});let q=l.filter(F=>T3(F,f)).map(F=>{var H;return{name:"command"in F&&typeof F.command=="object"&&((H=F.command)==null?void 0:H.title)||F.title,apply:()=>{this.applyCodeAction(F)}}}),V=E||this.languageId,z=S!=null&&S!==""?`${V}(${S})`:V,X=[this.pluginId];return A!=null&&A.includes(Lt.DiagnosticTag.Unnecessary)&&X.push("cm-lsp-unnecessary"),A!=null&&A.includes(Lt.DiagnosticTag.Deprecated)&&X.push("cm-lsp-deprecated"),{from:R,to:j,severity:t[C??Lt.DiagnosticSeverity.Error]??"error",message:Iy(x),renderMessage:F=>this.renderDiagnosticMessage(F,f,h),source:z,markClass:X.join(" "),actions:q.length>0?q:void 0,lspDiagnostic:f}});this.setOwnDiagnostics(d.filter(f=>f!=null),c)}setOwnDiagnostics(e,t=new Map){let r=this.view.state,i=[];O_(r,(f,h,b)=>{this.ownsDiagnostic(f)||i.push({...f,from:h,to:b})});let l=yD(r,[...i,...e]),c=l.effects,d=Array.isArray(c)?[...c]:c?[c]:[];d.push(Tf.of({pluginId:this.pluginId,anchors:t})),this.view.dispatch({...l,effects:d})}ownsDiagnostic(e){var t;return((t=e.markClass)==null?void 0:t.split(" ").includes(this.pluginId))??!1}renderDiagnosticMessage(e,t,r){let{message:i,code:l,source:c,codeDescription:d,relatedInformation:f}=t,h=document.createElement("div");h.classList.add("cm-lsp-diagnostic-message");let b=document.createElement("div");if(Al(b,{kind:"markdown",value:Iy(i)},{allowHTMLContent:this.allowHTMLContent,markdownRenderer:this.markdownRenderer}),h.appendChild(b),(d==null?void 0:d.href)&&I3(d.href)){let x=c||this.languageId,C=l!=null&&l!==""?`${x}(${l})`:x,S=document.createElement("a");S.className="cm-diagnostic-code-link",S.href=d.href,S.target="_blank",S.rel="noopener noreferrer",S.textContent=C,h.appendChild(S)}if(f&&f.length>0){let x=document.createElement("div");x.className="cm-diagnostic-related",f.forEach((C,S)=>{x.appendChild(this.renderRelatedInformation(e,C,`${this.pluginId}:${r}:${S}`))}),h.appendChild(x)}return h}renderRelatedInformation(e,t,r){let{location:i,message:l}=t,{uri:c,range:d}=i,f=c!==this.documentUri,h=()=>{var j;if(f)return null;let A=(j=e.state.field(pc,!1))==null?void 0:j.get(r);if(A)return A;let R=xt(e.state.doc,d.start);return R==null?null:{from:R,to:xt(e.state.doc,d.end)??R}},b=document.createElement("div");b.className="cm-diagnostic-related-item";let x=document.createElement("span");x.className="cm-diagnostic-related-message",x.textContent=l,b.appendChild(x);let C=h(),S=C&&!f?Mn(e.state.doc,C.from):d.start,E=document.createElement("span");if(E.className="cm-diagnostic-related-location",E.textContent=` ${c}:${S.line+1}:${S.character+1}`,b.appendChild(E),!f||this.onShowLocation){b.classList.add("cm-diagnostic-related-clickable"),b.setAttribute("role","button"),b.tabIndex=0;let A=()=>{var j;if(f){(j=this.onShowLocation)==null||j.call(this,{uri:c,range:d,isExternalDocument:f});return}let R=h();R!=null&&e.dispatch({selection:{anchor:R.from,head:R.to},scrollIntoView:!0})};b.addEventListener("click",A),b.addEventListener("keydown",R=>{(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),A())})}return b}clearDiagnostics(){this.setOwnDiagnostics([])}async requestCodeActionsForDiagnostics(e){let t=e[0];if(!t||!this.featureOptions.codeActionsEnabled||!(this.client.ready&&this.client.hasCapability("textDocument/codeAction")))return null;let r=t.range.start,i=t.range.end;for(let l of e)ka(l.range.start,r)<0&&(r=l.range.start),ka(l.range.end,i)>0&&(i=l.range.end);return await this.client.textDocumentCodeAction({textDocument:{uri:this.documentUri},range:{start:r,end:i},context:{diagnostics:e}})}async requestCodeActions(e,t,r){return!this.featureOptions.codeActionsEnabled||!(this.client.ready&&this.client.hasCapability("textDocument/codeAction"))?null:await this.client.textDocumentCodeAction({textDocument:{uri:this.documentUri},range:t,context:{diagnostics:this.diagnosticsInRange(e,t),...r?{only:r}:{}}})}async requestCodeActionsAtSelection(e){let{from:t,to:r}=e.state.selection.main;return await this.requestCodeActions(e,{start:Mn(e.state.doc,t),end:Mn(e.state.doc,r)})}diagnosticsInRange(e,t){let r=e.state.doc,i=xt(r,t.start),l=xt(r,t.end);if(i==null||l==null)return[];let c={error:Lt.DiagnosticSeverity.Error,warning:Lt.DiagnosticSeverity.Warning,info:Lt.DiagnosticSeverity.Information,hint:Lt.DiagnosticSeverity.Hint},d=[];return O_(e.state,(f,h,b)=>{if(h>l||b<i)return;let x={start:Mn(r,h),end:Mn(r,b)},C=f.lspDiagnostic;C?d.push({...C,range:x}):d.push({range:x,message:f.message,severity:c[f.severity],source:f.source})}),d}async applyCodeAction(e){let t=await this.resolveCodeAction(e);if(!this.destroyed){if(Dl(t)){Ll("Executing command:",t);return}t.edit&&await this.applyWorkspaceEdit(this.view,t.edit),t.command?Ll("Executing command:",t.command):t.edit||Et(this.view,`Code action "${e.title}" has nothing to apply`)}}async resolveCodeAction(e){if(Dl(e)||e.edit||e.command||!this.serverSupportsCodeActionResolve())return e;try{return await this.client.codeActionResolve(e)??e}catch(t){return console.error("Failed to resolve code action",t),e}}serverSupportsCodeActionResolve(){var t,r;let e=(t=this.client.capabilities)==null?void 0:t.codeActionProvider;if(typeof e=="object"&&e.resolveProvider)return!0;for(let i of this.client.dynamicCapabilities.values())if(i.method==="textDocument/codeAction"&&((r=i.registerOptions)!=null&&r.resolveProvider))return!0;return!1}async showCodeActionsMenu(e){var l;let t=e.state,r=await this.requestCodeActionsAtSelection(e);if(this.destroyed||e.state.doc!==t.doc||!e.state.selection.main.eq(t.selection.main))return!1;if(!r||r.length===0)return Et(e,"No code actions available"),!1;let i=async c=>{await this.applyCodeAction(c)};return(l=this.codeActionsConfig)!=null&&l.renderMenu?(this.codeActionsConfig.renderMenu(r,i),!0):(this.showDefaultCodeActionsMenu(e,r,i),!0)}showDefaultCodeActionsMenu(e,t,r){var C;(C=this.closeCodeActionMenu)==null||C.call(this);let i=document.createElement("div");i.className="cm-code-action-menu",i.setAttribute("role","listbox"),i.style.cssText="position: absolute; display: flex; flex-direction: column; padding: 2px; background: white; border: 1px solid #ddd; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 99;";let l=S=>{i.contains(S.target)||c()},c=()=>{this.closeCodeActionMenu===c&&(this.closeCodeActionMenu=void 0),i.remove(),document.removeEventListener("mousedown",l)};this.closeCodeActionMenu=c;let d=t.map(S=>{let E=document.createElement("button");E.type="button",E.className="cm-code-action-item",E.style.cssText="display: flex; gap: 8px; align-items: baseline; padding: 4px 8px; border: none; background: none; text-align: left; cursor: pointer; font: inherit;";let A=document.createElement("span");if(A.textContent=S.title,E.appendChild(A),!Dl(S)&&S.kind){let R=document.createElement("span");R.className="cm-code-action-kind",R.style.cssText="color: #888; font-size: 85%; margin-left: auto;",R.textContent=S.kind,E.appendChild(R)}return!Dl(S)&&S.disabled&&(E.disabled=!0,E.title=S.disabled.reason,E.style.opacity="0.5",E.style.cursor="default"),E.addEventListener("click",()=>{c(),e.focus(),r(S)}),i.appendChild(E),E}),f=d.findIndex(S=>!S.disabled),h=S=>{var E;f=S,(E=d[S])==null||E.focus()},b=S=>{var E;for(let A=f+S;A>=0&&A<d.length;A+=S)if(!((E=d[A])!=null&&E.disabled)){h(A);return}};i.tabIndex=-1,i.addEventListener("keydown",S=>{if(S.key==="Escape")c(),e.focus();else if(S.key==="ArrowDown")b(1);else if(S.key==="ArrowUp")b(-1);else if(S.key==="Enter"){let E=d[f];E&&!E.disabled&&E.click()}else return;S.preventDefault(),S.stopPropagation()});let x=e.coordsAtPos(e.state.selection.main.from);x&&(i.style.left=`${x.left+window.scrollX}px`,i.style.top=`${x.bottom+window.scrollY+5}px`),document.addEventListener("mousedown",l),document.body.appendChild(i),f===-1?i.focus():h(f)}async requestRename(e,{line:t,character:r}){var i;if(this.featureOptions.renameEnabled){if(!this.client.ready){Et(e,"Language server not ready");return}if(!this.client.hasCapability("textDocument/rename")){Et(e,"Rename not supported by language server");return}try{let l=await this.client.textDocumentPrepareRename({textDocument:{uri:this.documentUri},position:{line:t,character:r}}).catch(()=>this.prepareRenameFallback(e,{line:t,character:r}));if(!l){Et(e,"Cannot rename this symbol");return}let c;if("defaultBehavior"in l){if(!l.defaultBehavior){Et(e,"Cannot rename this symbol");return}let j=this.prepareRenameFallback(e,{line:t,character:r});if(!j){Et(e,"Cannot rename this symbol");return}c=j}else c=l;let d=document.createElement("div");d.className="cm-rename-popup",d.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 f=document.createElement("input");f.type="text",f.style.cssText="width: 200px; padding: 4px; border: 1px solid #ddd;";let h="range"in c?c.range:c,b=xt(e.state.doc,h.start);if(b==null)return;let x=xt(e.state.doc,h.end);f.value="placeholder"in c?c.placeholder:x==null?"":e.state.doc.sliceString(b,x);let C=f.value;d.appendChild(f);let S=e.coordsAtPos(b);if(!S)return;d.style.left=`${S.left}px`,d.style.top=`${S.bottom+5}px`;let E=j=>{d.contains(j.target)||A()},A=()=>{d.remove(),document.removeEventListener("mousedown",E),this.closeRenamePopup===A&&(this.closeRenamePopup=void 0)},R=async()=>{let j=f.value.trim();if(!j){Et(e,"New name cannot be empty"),A();return}if(/[\r\n]/.test(j)){Et(e,"New name must be a single line"),A();return}if(j===C){A();return}try{let q=e.state.doc,V=await this.client.textDocumentRename({textDocument:{uri:this.documentUri},position:{line:t,character:r},newName:j});if(this.destroyed||e.state.doc!==q)return;await this.applyRenameEdit(e,V)}catch(q){Et(e,`Rename failed: ${q instanceof Error?q.message:"Unknown error"}`)}finally{A()}};f.addEventListener("keydown",j=>{j.key==="Enter"?R():j.key==="Escape"&&A(),j.stopPropagation()}),(i=this.closeRenamePopup)==null||i.call(this),this.closeRenamePopup=A,document.addEventListener("mousedown",E),document.body.appendChild(d),f.focus(),f.select()}catch(l){Et(e,`Rename failed: ${l instanceof Error?l.message:"Unknown error"}`)}}}async requestSignatureHelp(e,{line:t,character:r},i=void 0){var l,c;if(!(this.featureOptions.signatureHelpEnabled&&this.client.ready&&this.client.hasCapability("textDocument/signatureHelp")))return null;try{let d=await this.client.textDocumentSignatureHelp({textDocument:{uri:this.documentUri},position:{line:t,character:r},context:{isRetrigger:!1,triggerKind:1,triggerCharacter:i}});if(!(d!=null&&d.signatures)||d.signatures.length===0)return null;let f=this.createTooltipContainer(),h=d.activeSignature??0,b=d.signatures[h]||d.signatures[0];if(!b)return null;let x=d.activeParameter??b.activeParameter??0,C=this.createSignatureElement(b,x);f.appendChild(C),b.documentation&&f.appendChild(this.createDocumentationElement(b.documentation));let S=(l=b.parameters)==null?void 0:l[x];S!=null&&S.documentation&&f.appendChild(this.createParameterDocElement(S.documentation));let E=xt(e.state.doc,{line:t,character:r});return E==null?null:{pos:E,end:E,create:A=>({dom:f}),above:((c=this.featureOptions.signatureHelpOptions)==null?void 0:c.position)==="above"}}catch(d){return console.error("Signature help error:",d),null}}async showSignatureHelpTooltip(e,t,r){let i=++this.signatureHelpRequestId,l=await this.requestSignatureHelp(e,Mn(e.state.doc,t),r);this.destroyed||i!==this.signatureHelpRequestId||e.dispatch({effects:Xs.of(l)})}createTooltipContainer(){let e=document.createElement("div");return e.classList.add("cm-signature-help"),e.style.cssText="padding: 6px; max-width: 400px;",e}createSignatureElement(e,t){var d;let r=document.createElement("div");if(r.classList.add("cm-signature"),r.style.cssText="font-family: monospace; margin-bottom: 4px;",!e.label||typeof e.label!="string")return r.textContent="Signature information unavailable",r;let i=e.label,l=e.parameters||[];if(l.length===0||!l[t])return r.textContent=i,r;let c=l[t].label;if(typeof c=="string"){let f=i.indexOf("(")+1;for(let b=0;b<t;b++){let x=(d=l[b])==null?void 0:d.label;if(typeof x=="string"){let C=i.indexOf(x,f);C!==-1&&(f=C+x.length)}}let h=i.indexOf(c,f);h===-1?r.textContent=i:this.applyRangeHighlighting(r,i,h,h+c.length)}else Array.isArray(c)&&c.length===2?this.applyRangeHighlighting(r,i,c[0],c[1]):r.textContent=i;return r}applyRangeHighlighting(e,t,r,i){if(!(Number.isInteger(r)&&Number.isInteger(i))||r<0||i<0||r>t.length||i>t.length){e.textContent=t;return}let l=Math.min(r,i),c=Math.max(r,i);if(l===c){e.textContent=t;return}e.textContent="";let d=t.substring(0,l),f=t.substring(l,c),h=t.substring(c);e.appendChild(document.createTextNode(d));let b=document.createElement("span");b.classList.add("cm-signature-active-param"),b.style.cssText="font-weight: bold; text-decoration: underline;",b.textContent=f,e.appendChild(b),e.appendChild(document.createTextNode(h))}createDocumentationElement(e){let t=document.createElement("div");return t.classList.add("cm-signature-docs"),t.style.cssText="margin-top: 4px; color: #666;",Al(t,e,{allowHTMLContent:this.allowHTMLContent,markdownRenderer:this.markdownRenderer}),t}createParameterDocElement(e){let t=document.createElement("div");return t.classList.add("cm-parameter-docs"),t.style.cssText="margin-top: 4px; font-style: italic; border-top: 1px solid #eee; padding-top: 4px;",Al(t,e,{allowHTMLContent:this.allowHTMLContent,markdownRenderer:this.markdownRenderer}),t}prepareRenameFallback(e,{line:t,character:r}){let i=e.state.doc.line(t+1).text,l=/\w+/g,c,d=r,f=r;for(;(c=l.exec(i))!==null;){let h=c.index,b=c.index+c[0].length;if(r>=h&&r<=b){d=h,f=b;break}}return d===r&&f===r?null:{range:{start:{line:t,character:d},end:{line:t,character:f}},placeholder:i.slice(d,f)}}applyEdits(e,t){let r=e.state.doc,i=[];for(let c of t){if(!c||typeof c!="object"||!c.range||typeof c.newText!="string")return!1;let d=xt(r,c.range.start),f=xt(r,c.range.end);if(d==null||f==null||d>f)return!1;i.push({from:d,to:f,insert:c.newText})}if(i.length===0)return!1;let l=[...i].sort((c,d)=>c.from-d.from||c.to-d.to);for(let c=1;c<l.length;c++){let d=l[c-1],f=l[c];if(d&&f&&(f.from<d.to||f.from===f.to&&d.from===d.to&&f.from===d.from))return Et(e,"Workspace edit ranges overlap"),!1}return e.dispatch(e.state.update({changes:i})),!0}async applyWorkspaceEdit(e,t){var d;if(!t)return Et(e,"No edit returned from language server"),!1;let r=t.changes&&typeof t.changes=="object"?t.changes:{},i=Array.isArray(t.documentChanges)?t.documentChanges:[];if(Object.keys(r).length===0&&i.length===0)return Et(e,"No changes to apply"),!1;if(i.length>0){let f=[];for(let h of i){if(typeof h!="object"||!h||!("textDocument"in h))return Et(e,"File creation, deletion, or renaming operations not supported yet"),!1;if(typeof h.textDocument!="object"||h.textDocument===null)return Et(e,"Malformed workspace edit"),!1;if(h.textDocument.uri!==this.documentUri)return Et(e,"Multi-file edits not supported yet"),!1;if(h.textDocument.version!=null&&h.textDocument.version!==this.documentVersion)return Et(e,"Workspace edit is stale because the document changed"),!1;if(!Array.isArray(h.edits))return!1;for(let b of h.edits){if(typeof b!="object"||!b||!("newText"in b))return Et(e,"Snippet edits not supported yet"),!1;f.push(b)}}return f.length===0?!1:this.applyEdits(e,f)}let l=Object.entries(r);if(l.some(([f])=>f!==this.documentUri))return Et(e,"Multi-file edits not supported yet"),!1;let c=(d=l[0])==null?void 0:d[1];return Array.isArray(c)?this.applyEdits(e,c):!1}async applyRenameEdit(e,t){return this.applyWorkspaceEdit(e,t)}};a0=function(e){var f,h;let t={rename:"F2",goToDefinition:"F12",signatureHelp:"Mod-Shift-Space",codeActions:"Mod-.",...e.keyboardShortcuts},r=e.client,i={diagnosticsEnabled:!0,hoverEnabled:!0,completionEnabled:!0,definitionEnabled:!0,renameEnabled:!0,codeActionsEnabled:!0,signatureHelpEnabled:!0,signatureActivateOnTyping:!1,signatureHelpOptions:{position:"below"},...e},l=Un.define(b=>new O3({client:r,documentUri:e.documentUri??b.state.facet(Fy),languageId:e.languageId??b.state.facet(k3),view:b,featureOptions:i,sendIncrementalChanges:e.sendIncrementalChanges,allowHTMLContent:e.allowHTMLContent,useSnippetOnCompletion:e.useSnippetOnCompletion,clientSideFiltering:e.clientSideFiltering,onGoToDefinition:e.onGoToDefinition,onShowLocation:e.onShowLocation,markdownRenderer:e.markdownRenderer,codeActionsConfig:e.codeActionsConfig})),c=b=>b.plugin(l),d=[l];if(i.diagnosticsEnabled&&d.push(pc,ot.baseTheme({".cm-lsp-unnecessary":{opacity:"0.6"},".cm-lsp-deprecated":{textDecoration:"line-through"},".cm-diagnostic-related":{marginTop:"4px",display:"flex",flexDirection:"column",gap:"2px"},".cm-diagnostic-related-clickable":{cursor:"pointer"},".cm-diagnostic-related-location":{opacity:"0.7"},".cm-diagnostic-code-link":{display:"inline-block",marginTop:"4px"}})),d.push(qr.of([{key:t.signatureHelp,run:b=>{let x=c(b);if(!(x&&i.signatureHelpEnabled))return!1;let C=b.state.selection.main.head;return x.showSignatureHelpTooltip(b,C),!0}},{key:t.rename,run:b=>{let x=c(b);if(!(x&&i.renameEnabled))return!1;let C=b.state.selection.main.head;return x.requestRename(b,Mn(b.state.doc,C)),!0}},{key:t.codeActions,run:b=>{let x=c(b);return x&&i.codeActionsEnabled?(x.showCodeActionsMenu(b).catch(C=>Et(b,`Code actions failed: ${C instanceof Error?C.message:"Unknown error"}`)),!0):!1}},{key:t.goToDefinition,run:b=>{let x=c(b);if(!(x&&i.definitionEnabled))return!1;let C=b.state.selection.main.head;return x.requestDefinition(b,Mn(b.state.doc,C)).catch(S=>Et(b,`Go to definition failed: ${S instanceof Error?S.message:"Unknown error"}`)),!0}}])),i.hoverEnabled&&d.push(zh((b,x)=>{let C=c(b);return C==null?null:C.requestHoverTooltip(b,Mn(b.state.doc,x))},e.hoverConfig)),i.signatureHelpEnabled){d.push(Ys);let b=x=>x.state.field(Ys)?(x.dispatch({effects:Xs.of(null)}),!0):!1;d.push(ot.domEventHandlers({mousedown:(x,C)=>(b(C),!1)})),d.push(qr.of([{key:")",run:x=>(b(x),!1)},{key:"Escape",run:x=>b(x)}])),d.push(ot.updateListener.of(x=>{if(!(c(x.view)&&i.signatureActivateOnTyping)||!x.state.field(Ys)||!(x.selectionSet||x.docChanged))return;let C=x.state.selection.main.head;N3(x.state.doc,C)||queueMicrotask(()=>{b(x.view)})})),d.push(ot.updateListener.of(async x=>{var j,q;let C=c(x.view);if(!(C&&x.docChanged)||x.transactions.some(V=>V.annotation(If))||!C.client.hasCapability("textDocument/signatureHelp")||!i.signatureActivateOnTyping)return;let S=((q=(j=C.client.capabilities)==null?void 0:j.signatureHelpProvider)==null?void 0:q.triggerCharacters)||["(",","],E=x.changes,A=-1,R;E.iterChanges((V,z,X,fe,F)=>{if(A>=0)return;let H=R3(F.toString(),X,S);H&&(A=H.triggerPos,R=H.triggerCharacter)}),A>=0&&C.showSignatureHelpTooltip(x.view,A,R)}))}if(i.completionEnabled){let b=(f=e.completionConfig)==null?void 0:f.optionClass;d.push(ot.baseTheme({".cm-tooltip-autocomplete li.cm-deprecated .cm-completionLabel":{textDecoration:"line-through"}}),gd({...e.completionConfig,optionClass:x=>[r3(x),(b==null?void 0:b(x))??""].filter(Boolean).join(" "),override:[async x=>{var R,j;let C=x.view?c(x.view):null;if(C==null)return null;let{state:S,pos:E}=x,A=M3(x,((j=(R=C.client.capabilities)==null?void 0:R.completionProvider)==null?void 0:j.triggerCharacters)??[],e.completionMatchBefore);return A==null?null:await C.requestCompletion(x,Mn(S.doc,E),A)},...((h=e.completionConfig)==null?void 0:h.override)||[]]}))}return d.push(ot.domEventHandlers({click:(b,x)=>{if(i.definitionEnabled&&t.goToDefinition==="ctrlcmd"&&(b.ctrlKey||b.metaKey)){let C=x.posAtCoords({x:b.clientX,y:b.clientY}),S=c(x);C&&S&&(S.requestDefinition(x,Mn(x.state.doc,C)).catch(E=>Et(x,`Go to definition failed: ${E instanceof Error?E.message:"Unknown error"}`)),b.preventDefault())}}})),d};function M3(e,t,r){let{state:i,pos:l,explicit:c}=e,d=i.doc.lineAt(l),f=Lt.CompletionTriggerKind.Invoked,h,b=d.text[l-d.from-1]||"",x=t==null?void 0:t.includes(b);return!c&&x&&(f=Lt.CompletionTriggerKind.TriggerCharacter,h=b),!c&&f===Lt.CompletionTriggerKind.Invoked&&!e.matchBefore(r||/(\w+|\w+\.|\/|,)$/)?null:{triggerKind:f,triggerCharacter:h}}function R3(e,t,r){if(!e)return null;for(let i of r){let l=e.indexOf(i);if(l!==-1)return{triggerPos:t+l+1,triggerCharacter:i}}return null}function P3(e){let t=0;for(let r of e)r==="("?t++:r===")"&&t--;return t}function N3(e,t,r=A3){let i=e.lineAt(t),l=Math.max(1,i.number-r),c=e.line(l).from;return P3(e.sliceString(c,t))>0}Ad=function(e,t,r={}){let{preserveCursor:i=!0,effects:l,userEvent:c}=r,d=e.state.doc;if(d.toString()!==t)if(i&&e.hasFocus){let f=e.state.selection.main.head,h=d.lineAt(f),b=h.number,x=f-h.from,C=e.state.update({changes:{from:0,to:d.length,insert:t}}).state.doc,S;if(b<=C.lines){let E=C.line(b),A=E.length;S=E.from+Math.min(x,A)}else S=C.line(C.lines).to;e.dispatch({changes:{from:0,to:d.length,insert:t},annotations:If.of(!0),selection:{anchor:S},effects:l,userEvent:c})}else e.dispatch({changes:{from:0,to:d.length,insert:t},effects:l,userEvent:c})},no=function(){return hl.define({combine:e=>e.find(t=>t!==void 0)})};const Ky=no(),Qy=no(),Af=no(),hc=no(),Gy=no();ck=function({cellId:e,completionConfig:t,hotkeys:r,placeholderType:i,lspConfig:l,diagnosticsConfig:c}){return[hc.of(e),Ky.of(t),Qy.of(r),Af.of(i),Gy.of({...l,diagnostics:c})]},Vd=new pd,Z0=function(e){return e==="application/vnd.marimo+error"},Gh=function(e){return e==="application/vnd.marimo+traceback"},ec=function(e){return Z0(e)||Gh(e)};function j3(e){return Object.values(e.cellRuntime).some(t=>t.status==="running")}function z3(e){return Object.values(e.cellRuntime).filter(t=>t.status==="running"||t.status==="queued").length}function F3(e){return n0(e).length>0}UC=function(e){return e.cellIds.inOrderIds.map(t=>e.cellData[t])},e0=function({cellHandles:e}){var r;let t={};for(let[i,l]of zr.entries(e))(r=l.current)!=null&&r.editorView&&(t[i]=l.current.editorView);return t},gg=function(e){let{cellIds:t,cellData:r}=e,i=[];for(let l of t.inOrderIds)r[l].config.disabled&&i.push(l);return i},z0=function(e){let{cellIds:t,cellData:r}=e,i=[];for(let l of t.inOrderIds)r[l].config.disabled||i.push(l);return i};function q3(e){return e.history.length>0}function $3(e){let t=e.history[e.history.length-1];return t&&t.type==="move"?"Undo move":"Undo cell deletion"}GC=function(e,t){let r=e.cellIds.findWithId(t).getDescendants(t);return{stale:r.some(i=>{var l,c;return((l=e.cellRuntime[i])==null?void 0:l.staleInputs)||((c=e.cellData[i])==null?void 0:c.edited)}),errored:r.some(i=>{var l;return(l=e.cellRuntime[i])==null?void 0:l.errored}),runningOrQueued:r.some(i=>{var l,c;return((l=e.cellRuntime[i])==null?void 0:l.status)==="running"||((c=e.cellRuntime[i])==null?void 0:c.status)==="queued"})}},n0=function(e){let{cellIds:t,cellData:r,cellRuntime:i}=e;return t.inOrderIds.filter(l=>_0({executionTime:i[l].runElapsedTimeMs??r[l].lastExecutionTime,status:i[l].status,errored:i[l].errored,interrupted:i[l].interrupted,stopped:i[l].stopped})||r[l].edited||i[l].interrupted||i[l].staleInputs&&!(i[l].status==="disabled-transitively"||r[l].config.disabled))},_0=function({executionTime:e,status:t,errored:r,interrupted:i,stopped:l}){return e===null&&t!=="queued"&&t!=="running"&&!(r||i||l)},Nk=function({edited:e,interrupted:t,staleInputs:r,disabled:i,status:l}){return e||t||r&&!(i||l==="disabled-transitively")},VC=function({needsRun:e,errored:t,stopped:r,disabled:i,status:l}){return{"needs-run":e,"has-error":t,stopped:r,disabled:i??!1,stale:l==="disabled-transitively"}},_k=function({errored:e,stopped:t}){return{published:!0,"has-error":e,stopped:t}},J_=function({errored:e,interrupted:t,stopped:r,output:i,showErrorTracebacks:l}){let c=ec(i==null?void 0:i.mimetype),d=l&&c&&Array.isArray(i==null?void 0:i.data)&&i.data.some(f=>f.type==="exception"&&"traceback"in f&&f.traceback);return(e||t||r||c)&&!d},st=hl.define({combine:e=>e[0]}),ga=hl.define({combine:e=>e[0]});var V3={...Vh,caseInsensitiveIdentifiers:!0,identifierQuotes:"`"};const Xy=vd.define(V3),B3=vd.define({doubleQuotedStrings:!1,hashComments:!1,spaceAfterDashes:!1,identifierQuotes:'"',caseInsensitiveIdentifiers:!0,keywords:"abs access acos aes_decrypt aggregate all allocate allow alter analyze and any approx_count_distinct approx_percentile are array array_avg array_cat array_compact array_contains array_generate_range array_max array_max_cardinality array_min array_position array_remove array_remove_at array_size array_sum array_to_string arrow as ascii asensitive asin assign asymmetric at atan atan2 atomic authorization auto avg avoid base64 batch begin begin_frame begin_partition between bigint bin bin_pack binary binary_string bit bit_and bit_length bit_or bitwise_and bitwise_not bitwise_or bitwise_xor blob bool_and bool_or boolean both branch bround btrim by cache call called cardinality cascaded case cast catalog cbrt ceil ceiling change char char_length character character_length check chr classifier clob close cloud coalesce col_like collate collect column columns commit commits_older_than compute concat concat_ws condition connect constraint contains convert convert_from convert_replaceutf8 convert_timezone convert_to copy corr corresponding cos cosh cot count covar_pop covar_samp crc32 create cross cube cume_dist current current_catalog current_date current_date_utc current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cycle data databases datasets date date_add date_diff date_format date_part date_sub date_trunc datediff datetype day dayofmonth dayofweek dayofyear deallocate dec decimal declare dedupe_lookback_period default define degrees delete dense_rank deref describe deterministic dimensions disallow disconnect display distinct double drop dynamic e each element else empty empty_as_null encode end end-exec end_frame end_partition ends_with engine equals escape escape_char every except exec execute exists exp expire explain extend external extract factorial false fetch field field_delimiter file_format files filter first_value flatten float floor folder for foreign frame_row free from from_hex full function fusion geo_beyond geo_distance geo_nearby get global grant grants greatest group grouping groups hash hash64 having hex history hold hour identity if ilike imindir import in include indicator initcap initial inner inout insensitive insert instr int integer intersect intersection interval into is is_bigint is_int is_member is_substr is_utf8 is_varchar isdate isnumeric job join json_array json_arrayagg json_exists json_object json_objectagg json_query json_value lag language large last_day last_query_id last_value lateral lazy lcase lead leading least left length levenshtein like like_regex limit listagg ln local localsort localtime localtimestamp locate log log10 logs lower lpad lshift ltrim manifests map_keys map_values mask mask_first_n mask_hash mask_last_n mask_show_first_n mask_show_last_n masking match match_number match_recognize matches max max_file_size_mb maxdir md5 measures median member merge metadata method min min_file_size_mb min_input_files mindir minus minute missing mod modifies module monitor month months_between more multiset national natural nchar nclob ndv new next next_day no none normalize normalize_string not notification_provider notification_queue_reference now nth_value ntile null null_if nullif numeric nvl occurrences_regex octet_length of offset old older_than omit on one only open operate optimize or order orphan out outer over overlaps overlay ownership parameter parse_url partition partitions pattern per percent percent_rank percentile_cont percentile_disc period permute pi pivot pmod policy portion position position_regex pow power precedes precision prepare prev primary procedure project promotion qualify quarter query query_user quote quote_char radians random range rank raw reads real record_delimiter recursive ref reference references referencing reflection reflections refresh regex regexp_col_like regexp_extract regexp_like regexp_matches regexp_replace regexp_split regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxy regr_syy release remove rename repeat repeatstr replace reset result retain_last retain_last_commits retain_last_snapshots return returns reverse revoke rewrite right role rollback rollup round route row row_number rows rpad rshift rtrim running savepoint schemas scope scroll search second seek select sensitive session_user set sha sha1 sha256 sha512 show sign similar similar_to sin sinh size skip smallint snapshot snapshots snapshots_older_than some soundex specific specifictype split_part sql sqlexception sqlstate sqlwarning sqrt st_fromgeohash st_geohash start starts_with static statistics stddev stddev_pop stddev_samp stream string_binary strpos submultiset subset substr substring substring_index substring_regex succeeds sum symmetric system system_time system_user table tables tablesample tag tan tanh target_file_size_mb tblproperties then time time_format timestamp timestamp_format timestampadd timestampdiff timestamptype timezone_hour timezone_minute tinyint to to_char to_date to_hex to_number to_time to_timestamp toascii trailing transaction_timestamp translate translate_regex translation treat trigger trim trim_array trim_space true truncate typeof ucase uescape unbase64 unhex union unique unix_timestamp unknown unnest unpivot unset update upper upsert usage use user using vacuum value value_of values var_pop var_samp varbinary varchar varying versioning view views week weekofyear when whenever where width_bucket window with within without write xor year",types:"array bigint binary boolean char character date dec decimal double float int integer interval map numeric struct time timestamp uuid varbinary varchar variant"}),Yy=vd.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 H3=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.dremio".split("."));function gc(e){return H3.has(e)}function Jy(e){let t=e.dialect;if(!gc(t))return be.debug("Unknown dialect",{dialect:t}),Ol;switch(t){case"postgresql":case"postgres":return Vh;case"mysql":return zD;case"sqlite":return ND;case"mssql":case"sqlserver":case"microsoft sql server":return qD;case"duckdb":return Yy;case"mariadb":return $D;case"cassandra":return VD;case"oracledb":case"oracle":return PD;case"bigquery":return Xy;case"dremio":return B3;case"timescaledb":return Vh;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 be.debug("Unsupported dialect",{dialect:t}),Ol;default:return bl(t),Ol}}var W3={...FD,caseInsensitiveIdentifiers:!0,identifierQuotes:"'"};let Ol;Ol=vd.define(W3),ya="__marimo_duckdb",so=new Set([ya]),Zk="memory",Qk=function(e,t){var i;if(!e)return t;let r=((i=e.schemaPath)!=null&&i.length?e.schemaPath:[e.schema]).filter(Boolean);return[e.database,...r,t].join(".")},oc=function(e){return e===""},Q0=function(e){return e.schemas_resolved!==!1},N0=function(e){return e.tables_resolved!==!1},cg=function(e){return e.child_schemas_resolved!==!1},Pd=function(e,t){let r=t==null?void 0:t.trim().toLowerCase();return r?N0(e)&&e.tables.some(i=>i.name.toLowerCase().includes(r))?!0:cg(e)?(e.child_schemas??[]).some(i=>Pd(i,r)):!1:!1},uC=function(e,t){return!(t!=null&&t.trim())||!Q0(e)?!1:e.schemas.some(r=>Pd(r,t))};var Ml={formatTablePath:e=>e.join("."),formatSelectClause:(e,t)=>`SELECT ${e} FROM ${t} LIMIT 100`};function U3(e){if(e=e.toLowerCase(),!gc(e))return Ml;switch(e){case"bigquery":{let t=Xy.spec.identifierQuotes;return{formatTablePath:r=>`${t}${r.join(".")}${t}`,formatSelectClause:Ml.formatSelectClause}}case"mssql":case"sqlserver":case"microsoft sql server":return{formatTablePath:Ml.formatTablePath,formatSelectClause:(t,r)=>`SELECT TOP 100 ${t} FROM ${r}`};case"timescaledb":case"postgres":case"postgresql":case"duckdb":case"dremio":return{formatTablePath:t=>t.map(r=>`"${r}"`).join("."),formatSelectClause:(t,r)=>`SELECT ${t==="*"?"*":`"${t}"`} FROM ${r} 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 Ml;default:return bl(e),Ml}}jC=function({table:e,columnName:t,sqlTableContext:r}){if(r){let{engine:i,schema:l,defaultSchema:c,defaultDatabase:d,database:f,dialect:h}=r,b=[e.name];oc(l)||l!==c&&b.unshift(l),f!==d&&b.unshift(f);let x=U3(h),C=x.formatTablePath(b),S=x.formatSelectClause(t,C);return i==="__marimo_duckdb"?`_df = mo.sql(f"""
|
|
31
|
+
${S}
|
|
32
|
+
""")`:`_df = mo.sql(f"""
|
|
33
|
+
${S}
|
|
34
|
+
""", engine=${i})`}return`_df = mo.sql(f'SELECT "${t}" FROM ${e.name} LIMIT 100')`},vC=function(e,t){if(t==="date"||t==="datetime"||t==="time"){if(e==="min")return"Earliest";if(e==="max")return"Latest"}return e};function K3(){return{tables:[],expandedTables:new Set,expandedColumns:new Set,columnsPreviews:new Map}}var{reducer:lO,createActions:sO,valueAtom:Zy,useActions:Q3}=vl(K3,{addDatasets:(e,t)=>{let{previewDatasetColumn:r}=Kn();for(let f of t.tables)for(let h of f.columns){let b=`${f.name}:${h.name}`;e.expandedColumns.has(b)&&r({tableName:f.name,columnName:h.name,source:f.source,sourceType:f.source_type})}let i=e.tables;t.clear_channel&&(i=i.filter(f=>f.source!==t.clear_channel));let l=[...t.tables,...i],c=new Set,d=l.filter(f=>{let h=`${f.name}:${f.source}`;return c.has(h)?!1:(c.add(h),!0)}).toSorted((f,h)=>f.name.localeCompare(h.name));return{...e,tables:d}},filterDatasetsFromVariables:(e,t)=>{let r=new Set(t),i=e.tables.filter(l=>l.variable_name?r.has(l.variable_name):!0);return{...e,tables:i}},toggleTable:(e,t)=>{let r=new Set(e.expandedTables);return r.has(t)?r.delete(t):r.add(t),{...e,expandedTables:r}},toggleColumn:(e,t)=>{let r=`${t.table}:${t.column}`,i=new Set(e.expandedColumns);return i.has(r)?i.delete(r):i.add(r),{...e,expandedColumns:i}},closeAllColumns:e=>({...e,expandedColumns:new Set}),addColumnPreview:(e,t)=>{let r=`${t.table_name}:${t.column_name}`,i=new Map(e.columnsPreviews);return i.set(r,t),{...e,columnsPreviews:i}}});RC=()=>un(Zy),bd=Ie(e=>e(Zy).tables),Yk=Ie(new Set),gk=Ie(!1),pC=function(){return Q3()};var G3=new Map([[ya,{name:ya,dialect:"duckdb",source:"duckdb",display_name:"DuckDB (In-Memory)",databases:[]}]]);function yc(e,t,r){if(t.length===0)return e;let[i,...l]=t;return e.map(c=>c.name===i?l.length===0?r(c):{...c,child_schemas:yc(c.child_schemas??[],l,r)}:c)}function e1(e){let{schemaPath:t,schema:r}=e;return t&&t.length>0?t:[r]}function X3(){return{latestEngineSelected:ya,connectionsMap:G3}}let Y3,J3;({reducer:Y3,createActions:J3,valueAtom:ao,useActions:Rk}=vl(X3,{addDataSourceConnection:(e,t)=>{if(t.connections.length===0)return e;let{latestEngineSelected:r,connectionsMap:i}=e,l=new Map(i);for(let c of t.connections)l.set(c.name,c);return{latestEngineSelected:r,connectionsMap:l}},filterDataSourcesFromVariables:(e,t)=>{let{latestEngineSelected:r,connectionsMap:i}=e,l=new Set(t),c=new Map([...i].filter(([d])=>so.has(d)?!0:l.has(d)));return{latestEngineSelected:c.has(r)?r:ya,connectionsMap:c}},clearDataSourceConnections:()=>({latestEngineSelected:ya,connectionsMap:new Map}),removeDataSourceConnection:(e,t)=>{let{latestEngineSelected:r,connectionsMap:i}=e,l=new Map(i);return l.delete(t),{latestEngineSelected:l.has(r)?r:ya,connectionsMap:l}},addSchemaList:(e,t)=>{let{schemas:r,sqlSchemaContext:i}=t,{connectionsMap:l,latestEngineSelected:c}=e,d=i.engine,f=l.get(d);if(!f)return e;let h=i.schemaPath??[],b=new Map(l),x={...f,databases:f.databases.map(C=>C.name===i.database?h.length===0?{...C,schemas:r,schemas_resolved:!0}:{...C,schemas:yc(C.schemas,h,S=>({...S,child_schemas:r,child_schemas_resolved:!0}))}:C)};return b.set(d,x),{latestEngineSelected:c,connectionsMap:b}},addTableList:(e,t)=>{let{tables:r,sqlTableContext:i}=t,{connectionsMap:l,latestEngineSelected:c}=e,d=i.engine,f=l.get(d);if(!f)return e;let h=e1(i),b=new Map(l),x={...f,databases:f.databases.map(C=>C.name===i.database?{...C,schemas:yc(C.schemas,h,S=>({...S,tables:r,tables_resolved:!0}))}:C)};return b.set(d,x),{latestEngineSelected:c,connectionsMap:b}},addTable:(e,t)=>{let{table:r,sqlTableContext:i}=t,{connectionsMap:l,latestEngineSelected:c}=e,d=i.engine,f=r.name,h=l.get(d);if(!h)return e;let b=e1(i),x=new Map(l),C={...h,databases:h.databases.map(S=>S.name===i.database?{...S,schemas:yc(S.schemas,b,E=>{let A=E.tables.length===0?[r]:E.tables.map(R=>R.name===f?r:R);return{...E,tables:A}})}:S)};return x.set(d,C),{latestEngineSelected:c,connectionsMap:x}}})),Ed=Ie(e=>e(ao).connectionsMap);function t1(e){let t=Te.get(ao);t.connectionsMap.has(e)&&Te.set(ao,{...t,latestEngineSelected:e})}CC=Ie(e=>{let t=Te.get(bd),r=e(ao).connectionsMap,i=new Map;for(let l of t)i.set(l.name,l);for(let l of r.values())for(let c of l.databases){let d=c.name===l.default_database||l.databases.length===1,f=(h,b)=>{let x=b.length===0,C=b.length===1&&b[0]===l.default_schema,S=b.join(".");for(let E of h.tables){let A;if(A=E.name,x){A=d?E.name:`${c.name}.${E.name}`,i.has(A)?be.warn(`Table name collision for ${A}. Skipping.`):i.set(A,E);continue}if(d&&C&&!i.has(A)){i.set(A,E);continue}if(A=`${S}.${E.name}`,d&&!i.has(A)){i.set(A,E);continue}A=`${c.name}.${S}.${E.name}`,i.has(A)?be.warn(`Table name collision for ${A}. Skipping.`):i.set(A,E)}for(let E of h.child_schemas??[])f(E,[...b,E.name])};for(let h of c.schemas)f(h,oc(h.name)?[]:[h.name])}return i}),Ok=function(e){return e.variable_name?"dataframe":"table"};let vc,Lf,n1,r1,a1,Df,i1;vc=class{constructor(e,t={}){ae(this,"cache",new Map);this.maxSize=e,this.options=t}getOrCreate(e){dn(this.options.create,"create function is required");let t=this.cache.get(e);if(t!==void 0)return t;let r=this.options.create(e);return this.cache.set(e,r),r}get(e){let t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e)&&this.cache.delete(e),this.cache.set(e,t),this.cache.size>this.maxSize){let r=this.cache.keys().next().value;r!==void 0&&this.cache.delete(r)}}keys(){return this.cache.keys()}values(){return this.cache.values()}entries(){return this.cache.entries()}delete(e){this.cache.delete(e)}},g0=lt("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"}]]),s0=lt("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"}]]),D0=lt("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"}]]),S0=lt("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"}]]),d0=lt("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"}]]),Lf=lt("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"}]]),A0=lt("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"}]]),Zh=lt("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"}]]),bg=lt("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),n1=lt("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"}]]),x0=lt("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]),_l=lt("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"}]]),Cd=lt("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"}]]),i0=lt("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"}]]),r1=lt("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"}]]),Ld=lt("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),a1=lt("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"}]]),ro=lt("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"}]]),y0=lt("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),Y0=lt("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"}]]),Yh=lt("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"}]]),eg=lt("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"}]]),b0=lt("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"}]]),Df=lt("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"}]]),i1=lt("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"}]]),r0=lt("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"}]]),to=lt("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"}]]),k0=lt("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"}]]),mg=lt("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"}]]),Qs=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";case"dremio":return"Dremio";default:return e}};function o1(e){let[t,r]=e.split(" ");return r?`${Qs(t)} ${r}`:Qs(e)}Xd={boolean:HD,date:WD,time:bg,datetime:Lf,temporal:Lf,number:Bh,string:UD,integer:Bh,unknown:d0},wk=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 bl(e),"bg-(--slate-4) dark:bg-(--slate-6)"}};let Rl,l1,Of,s1;ui=class{constructor(e,t){this.singular=e,this._plural=t}pluralize(e){return e===1?this.singular:this.plural}get plural(){return this._plural??`${this.singular}s`}},Hk=class eS{constructor(t){this.words=t}static of(...t){return new eS(t.map(r=>typeof r=="string"?new ui(r):r))}join(t,r){return this.words.map(i=>i.pluralize(r)).join(t)}},Rl=Wn(),l1=5,Of={boolean:"bg-(--orange-4) text-(--orange-11)",date:"bg-(--grass-4) text-(--grass-11)",time:"bg-(--grass-4) text-(--grass-11)",datetime:"bg-(--grass-4) text-(--grass-11)",number:"bg-(--purple-4) text-(--purple-11)",integer:"bg-(--purple-4) text-(--purple-11)",string:"bg-(--blue-4) text-(--blue-11)",unknown:"bg-(--slate-4) text-(--slate-11)"},s1={local:"bg-(--blue-4) text-(--blue-11)",duckdb:"bg-(--amber-4) text-(--amber-11)",connection:"bg-(--green-4) text-(--green-11)",catalog:"bg-(--purple-4) text-(--purple-11)"},co="p-3 min-w-[250px] flex flex-col divide-y";var Z3=new ui("column","columns"),eE=new ui("row","rows"),tE=new ui("schema","schemas"),nE=new ui("table","tables"),rE=new ui("database","databases");lo=e=>{let t=(0,Rl.c)(6),{icon:r,title:i,badge:l}=e,c;t[0]===i?c=t[1]:(c=(0,O.jsx)("h3",{className:"font-semibold text-sm",children:i}),t[0]=i,t[1]=c);let d;return t[2]!==l||t[3]!==r||t[4]!==c?(d=(0,O.jsxs)("div",{className:"flex items-center gap-2 pb-2",children:[r,c,l]}),t[2]=l,t[3]=r,t[4]=c,t[5]=d):d=t[5],d},Er=e=>{let t=(0,Rl.c)(5),{label:r,value:i}=e,l;t[0]===r?l=t[1]:(l=(0,O.jsxs)("span",{className:"text-(--slate-11)",children:[r,":"]}),t[0]=r,t[1]=l);let c;return t[2]!==l||t[3]!==i?(c=(0,O.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[l,i]}),t[2]=l,t[3]=i,t[4]=c):c=t[4],c};var mo=e=>{let t=(0,Rl.c)(5),{icon:r,text:i}=e,l;t[0]===i?l=t[1]:(l=(0,O.jsx)("span",{className:"text-xs text-(--slate-11)",children:i}),t[0]=i,t[1]=l);let c;return t[2]!==r||t[3]!==l?(c=(0,O.jsxs)("div",{className:"flex items-center gap-1",children:[r,l]}),t[2]=r,t[3]=l,t[4]=c):c=t[4],c},Ca=e=>{let t=(0,Rl.c)(15),{title:r,items:i,totalCount:l,limit:c}=e,d=r===void 0?"":r,f=c===void 0?l1:c;if(i.length===0)return null;let h;t[0]!==i||t[1]!==f?(h=i.slice(0,f),t[0]=i,t[1]=f,t[2]=h):h=t[2];let b=h,x=l>f,C;t[3]===d?C=t[4]:(C=d&&(0,O.jsxs)("h4",{className:"text-xs font-medium text-(--slate-11) mb-2",children:[d,":"]}),t[3]=d,t[4]=C);let S;t[5]!==x||t[6]!==f||t[7]!==l?(S=x&&(0,O.jsxs)("div",{className:"text-xs text-(--slate-10) text-center py-1",children:["... and ",l-f," more"]}),t[5]=x,t[6]=f,t[7]=l,t[8]=S):S=t[8];let E;t[9]!==S||t[10]!==b?(E=(0,O.jsxs)("div",{className:"flex flex-col gap-1 overflow-y-auto",children:[b,S]}),t[9]=S,t[10]=b,t[11]=E):E=t[11];let A;return t[12]!==C||t[13]!==E?(A=(0,O.jsxs)("div",{className:"py-2",children:[C,E]}),t[12]=C,t[13]=E,t[14]=A):A=t[14],A},c1=e=>Of[e]||Of.unknown;let u1,d1,f1;pg=e=>{var d,f;let t=e.type==="view"?(0,O.jsx)(Cd,{className:"w-4 h-4 text-(--blue-9)"}):(0,O.jsx)(to,{className:"w-4 h-4 text-(--green-9)"}),r=(0,O.jsx)(Qn,{variant:"secondary",className:`text-xs ${e.type==="view"?"bg-(--blue-4) text-(--blue-11)":"bg-(--green-4) text-(--green-11)"}`,children:e.type}),i=e.columns.map(h=>{let b=Xd[h.type];return(0,O.jsxs)("div",{className:"flex items-center justify-between text-xs rounded",children:[(0,O.jsxs)("div",{className:"flex items-center gap-2",children:[(0,O.jsx)(b,{className:"w-3 h-3 text-(--slate-9)"}),(0,O.jsx)("span",{className:"font-mono",children:h.name})]}),(0,O.jsx)(Qn,{variant:"outline",className:`text-xs ${c1(h.type)}`,children:h.type})]},h.name)}),l=e.primary_keys&&e.primary_keys.length>0,c=e.indexes&&e.indexes.length>0;return(0,O.jsxs)("div",{className:`${co} min-w-[300px]`,children:[(0,O.jsx)(lo,{icon:t,title:e.name,badge:r}),(0,O.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,O.jsx)(Er,{label:"Source",value:(0,O.jsx)(Qn,{variant:"outline",className:`text-xs ${s1[e.source_type]}`,children:e.source})}),e.variable_name&&(0,O.jsx)(Er,{label:"Variable",value:(0,O.jsx)("code",{className:"text-xs bg-(--slate-4) px-1 rounded",children:e.variable_name})}),e.engine&&(0,O.jsx)(Er,{label:"Engine",value:(0,O.jsx)("code",{className:"text-xs bg-(--slate-4) px-1 rounded",children:e.engine})})]}),(e.num_columns!=null||e.num_rows!=null)&&(0,O.jsxs)("div",{className:"grid grid-cols-2 gap-2 py-2",children:[e.num_columns!=null&&(0,O.jsx)(mo,{icon:(0,O.jsx)(x0,{className:"w-3 h-3 text-(--slate-9)"}),text:`${e.num_columns} ${Z3.pluralize(e.num_columns)}`}),e.num_rows!=null&&(0,O.jsx)(mo,{icon:(0,O.jsx)(Bh,{className:"w-3 h-3 text-(--slate-9)"}),text:`${e.num_rows} ${eE.pluralize(e.num_rows)}`})]}),e.columns.length===0&&nc("column"),(l||c)&&(0,O.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[l&&(0,O.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,O.jsxs)("div",{className:"flex items-center gap-1",children:[(0,O.jsx)(JD,{className:"w-3 h-3 text-(--amber-9)"}),(0,O.jsx)("span",{className:"text-xs font-medium text-(--slate-11)",children:"Primary Keys:"})]}),(d=e.primary_keys)==null?void 0:d.map(h=>(0,O.jsx)(Qn,{variant:"outline",className:"text-xs text-(--slate-11)",children:h},h))]}),c&&(0,O.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,O.jsxs)("div",{className:"flex items-center gap-1 mb-1",children:[(0,O.jsx)(s0,{className:"w-3 h-3 text-(--purple-9)"}),(0,O.jsx)("span",{className:"text-xs font-medium text-(--slate-11)",children:"Indexes:"})]}),(f=e.indexes)==null?void 0:f.map(h=>(0,O.jsx)(Qn,{variant:"outline",className:"text-xs text-(--slate-11)",children:h},h))]})]}),e.columns.length>0&&(0,O.jsx)(Ca,{items:i,totalCount:e.columns.length})]})},u1=e=>{var l;let t=Xd[e.type],r=(0,O.jsx)(Qn,{variant:"outline",className:`text-xs ${c1(e.type)}`,children:e.type}),i=((l=e.sample_values)==null?void 0:l.map((c,d)=>(0,O.jsx)("div",{className:"text-xs bg-(--slate-3) rounded font-mono",children:c==null?"null":String(c)},d)))||[];return(0,O.jsxs)("div",{className:co,children:[(0,O.jsx)(lo,{icon:(0,O.jsx)(t,{className:"w-4 h-4 text-(--slate-9)"}),title:e.name,badge:r}),(0,O.jsxs)("div",{className:"flex flex-col gap-2 mt-2",children:[(0,O.jsx)(Er,{label:"Type",value:(0,O.jsx)("span",{className:"font-medium",children:e.type})}),(0,O.jsx)(Er,{label:"External Type",value:(0,O.jsx)("code",{className:"text-xs bg-(--slate-4) px-1 rounded",children:e.external_type})})]}),e.sample_values&&e.sample_values.length>0&&(0,O.jsx)(Ca,{title:"Sample Values",items:i,totalCount:e.sample_values.length})]})},d1=e=>{let t=(0,O.jsx)(Qn,{variant:"outline",className:"text-xs bg-(--blue-4) text-(--blue-11)",children:e.dialect}),r=e.schemas.map(i=>(0,O.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-(--slate-3)",children:[(0,O.jsxs)("div",{className:"flex items-center gap-2",children:[(0,O.jsx)(ro,{className:"w-3 h-3 text-(--slate-9)"}),(0,O.jsx)("span",{children:i.name})]}),(0,O.jsxs)(Qn,{variant:"outline",className:"text-xs",children:[i.tables.length," ",nE.pluralize(i.tables.length)]})]},i.name));return(0,O.jsxs)("div",{className:co,children:[(0,O.jsx)(lo,{icon:(0,O.jsx)(_l,{className:"w-4 h-4 text-(--blue-9)"}),title:e.name,badge:t}),(0,O.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,O.jsx)(Er,{label:"Dialect",value:(0,O.jsx)("span",{className:"font-medium",children:e.dialect})}),e.engine&&(0,O.jsx)(Er,{label:"Engine",value:(0,O.jsx)("code",{className:"text-xs bg-(--slate-4) px-1 rounded",children:e.engine})})]}),(0,O.jsx)("div",{className:"py-2",children:(0,O.jsx)(mo,{icon:(0,O.jsx)(ro,{className:"w-3 h-3 text-(--slate-9)"}),text:`${e.schemas.length} schema${e.schemas.length===1?"":"s"}`})}),e.schemas.length===0&&nc("schema"),e.schemas.length>0&&(0,O.jsx)(Ca,{title:"Schemas",items:r,totalCount:e.schemas.length})]})},f1=e=>{let t=(0,O.jsx)(Qn,{variant:"outline",className:"text-xs bg-(--green-4) text-(--green-11)",children:"Schema"}),r=e.tables.map(i=>(0,O.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-(--slate-3)",children:[(0,O.jsxs)("div",{className:"flex items-center gap-2",children:[i.type==="view"?(0,O.jsx)(Cd,{className:"w-3 h-3 text-(--blue-9)"}):(0,O.jsx)(to,{className:"w-3 h-3 text-(--green-9)"}),(0,O.jsx)("span",{children:i.name})]}),(0,O.jsx)(Qn,{variant:"outline",className:`text-xs ${i.type==="view"?"bg-(--blue-4) text-(--blue-11)":"bg-(--green-4) text-(--green-11)"}`,children:i.type})]},i.name));return(0,O.jsxs)("div",{className:co,children:[(0,O.jsx)(lo,{icon:(0,O.jsx)(ro,{className:"w-4 h-4 text-(--green-9)"}),title:e.name,badge:t}),(0,O.jsx)("div",{className:"py-2",children:(0,O.jsx)(mo,{icon:(0,O.jsx)(to,{className:"w-3 h-3 text-(--slate-9)"}),text:`${e.tables.length} table${e.tables.length===1?"":"s"}`})}),e.tables.length===0&&nc("table"),e.tables.length>0&&(0,O.jsx)(Ca,{title:"Tables",items:r,totalCount:e.tables.length})]})};var p1=(0,O.jsx)(Qn,{variant:"outline",children:"default"}),aE=8,m1=3;rC=(e,t)=>{let r=e.databases.length,i=e.databases.reduce((h,b)=>h+b.schemas.length,0),l=(h,b)=>{if(h.tables.length===0)return null;let x=h.name===e.default_schema&&b,C=[];return i<aE&&(C=h.tables.slice(0,m1+1).map(S=>(0,O.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,O.jsx)(to,{className:"w-3 h-3 text-(--green-9)"}),(0,O.jsx)("span",{className:"text-xs",children:S.name})]},S.name))),(0,O.jsxs)("div",{children:[(0,O.jsxs)("div",{className:"flex items-center gap-2 text-xs rounded hover:bg-(--slate-3) ml-2",children:[(0,O.jsx)(ro,{className:"w-3 h-3 text-(--slate-9)"}),(0,O.jsx)("span",{children:h.name}),x&&p1,(0,O.jsxs)(Qn,{variant:"outline",className:"text-xs ml-auto",children:[h.tables.length," tables"]})]}),(0,O.jsx)(Ca,{items:C,totalCount:h.tables.length,limit:m1})]},h.name)},c=e.databases.map(h=>{let b=h.name===e.default_database||e.databases.length===1,x=h.schemas.map(C=>l(C,b));return(0,O.jsxs)("div",{children:[(0,O.jsxs)("div",{className:"flex items-center gap-2",children:[(0,O.jsx)(_l,{className:"w-3 h-3 text-(--blue-9)"}),(0,O.jsx)("span",{className:"text-xs",children:h.name}),b&&p1]}),x&&(0,O.jsx)(Ca,{items:x,totalCount:h.schemas.length})]},h.name)}),d=e.name;so.has(e.name)&&(d="In-Memory");let f=t==null?void 0:t.map(h=>(0,O.jsxs)("div",{className:"flex items-center gap-2",children:[(0,O.jsx)(to,{className:"w-3 h-3 text-(--blue-9)"}),(0,O.jsx)("span",{className:"text-xs",children:h.name})]},h.name));return(0,O.jsxs)("div",{className:`${co} px-1`,children:[(0,O.jsx)(lo,{icon:(0,O.jsx)(n1,{className:"w-4 h-4 text-(--purple-9)"}),title:d}),(0,O.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,O.jsx)(Er,{label:"Dialect",value:(0,O.jsx)("span",{className:"font-medium",children:Qs(e.dialect)})}),(0,O.jsx)(Er,{label:"Source",value:(0,O.jsx)(Qn,{variant:"outline",className:"text-xs bg-(--green-4) text-(--green-11)",children:e.source})})]}),(0,O.jsxs)("div",{className:"flex flex-row justify-between py-2",children:[(0,O.jsx)(mo,{icon:(0,O.jsx)(_l,{className:"w-3 h-3 text-(--slate-9)"}),text:`${r} ${rE.pluralize(r)}`}),(0,O.jsx)(mo,{icon:(0,O.jsx)(ro,{className:"w-3 h-3 text-(--slate-9)"}),text:`${i} ${tE.pluralize(i)}`})]}),r>0&&(0,O.jsx)(Ca,{items:c,totalCount:r}),f&&f.length>0&&(0,O.jsx)(Ca,{title:"Dataframes",items:f,totalCount:f.length})]})},nc=e=>(0,O.jsxs)("div",{className:"flex items-start gap-2 mt-3",children:[(0,O.jsx)(Ld,{size:10,className:"mt-1 text-(--slate-10) shrink-0"}),(0,O.jsxs)("span",{className:"text-xs text-(--slate-11)",children:["No ",e," information available.",`
|
|
35
|
+
`,(0,O.jsx)("span",{className:"text-(--blue-10)",children:"Introspect to see more details."})]})]});var bc=Jd(),h1=class{constructor(){ae(this,"schema",{})}addTable(e,t){let r={self:oE({table:t}),children:t.columns.map(i=>iE({column:i}))};return this.setAt([...e,t.name],r),this}addSchema(e,t){let r={self:lE({namespace:t,path:e}),children:{}};return this.setAt(e,r),this}addDatabase(e,t){let r={self:sE({namespace:t,path:e}),children:{}};return this.setAt(e,r),this}setAt(e,t){let r=this.schema;for(let i of e.slice(0,-1))r[i]||(r[i]={children:{}}),r=r[i].children;r[e[e.length-1]]=t}build(){return this.schema}reset(){return this.schema={},this}};function iE(e){return{label:e.column.name,type:"column",info:()=>{let t=document.createElement("div");return(0,bc.createRoot)(t).render(u1(e.column)),{dom:t}}}}function oE(e){return{label:e.table.name,type:"table",info:()=>{let t=document.createElement("div");return(0,bc.createRoot)(t).render(pg(e.table)),{dom:t}}}}function lE(e){return{label:e.namespace.name,detail:e.path.join("."),type:"schema",info:()=>{let t=document.createElement("div");return(0,bc.createRoot)(t).render(f1(e.namespace)),{dom:t}}}}function sE(e){return{label:e.namespace.name,detail:e.path.join("."),type:"database",info:()=>{let t=document.createElement("div");return(0,bc.createRoot)(t).render(d1(e.namespace)),{dom:t}}}}var cE=Ie(e=>{let t=e(bd),r=new h1;for(let i of t)r.addTable([],i);return r.build()}),uE=class{constructor(){this.cache=new vc(10,{create:e=>this.getConnectionSchema(e)})}getConnection(e){return Te.get(Ed).get(e)}getConnectionSchema(e){var d,f;let{default_database:t,databases:r,default_schema:i}=e,l=new h1,c=r.find(h=>h.name===t||r.length===1);if(((d=c??r[0])==null?void 0:d.schemas.some(h=>oc(h.name)))??!1){for(let h of r){let b=h.name===(c==null?void 0:c.name),x=h.schemas.flatMap(C=>C.tables);l.addDatabase([h.name],h);for(let C of x)b?l.addTable([],C):l.addTable([h.name],C)}return{shouldAddLocalTables:!1,schema:l.build(),defaultSchema:c==null?void 0:c.name}}if(c)for(let h of c.schemas){l.addSchema([h.name],h);for(let b of h.tables)l.addTable([h.name],b)}for(let h of r){l.addDatabase([h.name],h);for(let b of h.schemas){l.addSchema([h.name,b.name],b);for(let x of b.tables)l.addTable([h.name,b.name],x)}}return{shouldAddLocalTables:!0,schema:l.build(),defaultSchema:i??((c==null?void 0:c.schemas.length)===1?(f=c.schemas[0])==null?void 0:f.name:void 0)}}getInternalDialect(e){let t=this.getConnection(e);return t?t.dialect.toLowerCase():null}getDialect(e){let t=this.getConnection(e);return t?Jy(t):Ol}getCompletionSource(e){let t=this.getConnection(e);if(!t)return null;let r=()=>Te.get(cE),i=this.cache.getOrCreate(t);return{dialect:Jy(t),schema:i.shouldAddLocalTables?{...i.schema,...r()}:i.schema,defaultSchema:i.defaultSchema,defaultTable:dE(t)}}};function dE(e){if(e.databases.length!==1)return;let t=e.databases[0];if(t.schemas.length!==1)return;let r=t.schemas[0];if(r.tables.length===1)return r.tables[0].name}const mi=new uE,Pl=Ln.define();Fd=async function(e){let{sendFormat:t}=Kn(),r=zr.mapValues(e,l=>Sr(l)),i=await t({codes:r,lineLength:d_().formatting.line_length});for(let[l,c]of zr.entries(i.codes)){let d=l,f=r[d],h=e[d];h&&c!==f&&(h.state.facet(st).updateCellCode({cellId:d,code:c,formattingChange:!0}),oo(h,c))}},Gk=function(){return Fd(e0(Wd()))};async function fE(e,t){let{formatDialect:r}=await ne(async()=>{let{formatDialect:C}=await import("./esm-7r3G8FZG.js").then(async S=>(await S.__tla,S));return{formatDialect:C}},__vite__mapDeps([0,1]),import.meta.url),i=await pE(mi.getInternalDialect(t)),l=e.state.field(Jn),c=G8(e.state);if(l.type!=="sql"){be.error("Language adapter is not SQL");return}let d=e.state.doc.toString(),f;try{f=r(d,{dialect:i,tabWidth:c,useTabs:!1})}catch(C){be.error("Error formatting SQL",{error:C});return}let h=l.transformIn(f)[0],b=e.state.facet(st),x=e.state.facet(hc);b.updateCellCode({cellId:x,code:h,formattingChange:!0}),Ad(e,f,{effects:[Pl.of(!0)]})}async function pE(e){let{bigquery:t,db2:r,db2i:i,duckdb:l,hive:c,mariadb:d,mysql:f,tidb:h,n1ql:b,plsql:x,postgresql:C,redshift:S,spark:E,sqlite:A,sql:R,trino:j,transactsql:q,singlestoredb:V,snowflake:z}=await ne(async()=>{let{bigquery:fe,db2:F,db2i:H,duckdb:te,hive:me,mariadb:ve,mysql:_e,tidb:ke,n1ql:oe,plsql:ce,postgresql:ye,redshift:ie,spark:le,sqlite:K,sql:Le,trino:Pe,transactsql:Ke,singlestoredb:Ve,snowflake:je}=await import("./esm-7r3G8FZG.js").then(async De=>(await De.__tla,De));return{bigquery:fe,db2:F,db2i:H,duckdb:te,hive:me,mariadb:ve,mysql:_e,tidb:ke,n1ql:oe,plsql:ce,postgresql:ye,redshift:ie,spark:le,sqlite:K,sql:Le,trino:Pe,transactsql:Ke,singlestoredb:Ve,snowflake:je}},__vite__mapDeps([0,1]),import.meta.url),X=R;if(!e||!gc(e))return X;switch(e){case"mysql":return f;case"mariadb":return d;case"postgres":case"postgresql":return C;case"sqlite":return A;case"db2":return r;case"db2i":return i;case"hive":return c;case"redshift":return S;case"snowflake":return z;case"trino":return j;case"tidb":return h;case"oracle":case"oracledb":return x;case"spark":return E;case"singlestoredb":return V;case"couchbase":return b;case"bigquery":return t;case"duckdb":return l;case"mssql":case"sqlserver":case"microsoft sql server":return q;case"athena":case"awsathena":case"cassandra":case"noql":case"flink":case"mongodb":case"timescaledb":case"datafusion":case"dremio":return R;case"databricks":return E;default:return bl(e),X}}var mE=Jd();function hE(e,t){let r=document.createElement("div"),i;return{dom:r,mount(){i=(0,mE.createRoot)(r),i.render((0,O.jsx)(a_,{store:Te,children:(0,O.jsx)(t,{view:e})}))},update(){i==null||i.render((0,O.jsx)(a_,{store:Te,children:(0,O.jsx)(t,{view:e})}))},destroy(){i==null||i.unmount()}}}function pe(e){return new L_(T_.define(e))}function Sa(e){return ne(()=>import("./dist-D6Iobl3P.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([2,3,4,5]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}var gE=[ee.of({name:"C",extensions:["c","h","ino"],load(){return ne(()=>import("./dist-CaZf6AoY.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,5]),import.meta.url).then(e=>e.cpp())}}),ee.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return ne(()=>import("./dist-CaZf6AoY.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,5]),import.meta.url).then(e=>e.cpp())}}),ee.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Sa("Cassandra")}}),ee.of({name:"CSS",extensions:["css"],load(){return ne(()=>import("./dist-Bfm9U3vp.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([8,9,5]),import.meta.url).then(e=>e.css())}}),ee.of({name:"Go",extensions:["go"],load(){return ne(()=>import("./dist-BrZjJXDA.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([10,11,4,5]),import.meta.url).then(e=>e.go())}}),ee.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return ne(()=>import("./dist-Csf5i4KY.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([12,9,5,13,14,4]),import.meta.url).then(e=>e.html())}}),ee.of({name:"Java",extensions:["java"],load(){return ne(()=>import("./dist-I3qeQWuP.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([15,16,5]),import.meta.url).then(e=>e.java())}}),ee.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return ne(()=>import("./dist-DrBqBDHF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript())}}),ee.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return ne(()=>import("./dist-Cgoy5550.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([18,9,5,13,14,4,19]),import.meta.url).then(e=>e.jinja())}}),ee.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return ne(()=>import("./dist-gDi2I7IJ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([20,21,5]),import.meta.url).then(e=>e.json())}}),ee.of({name:"JSX",extensions:["jsx"],load(){return ne(()=>import("./dist-DrBqBDHF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({jsx:!0}))}}),ee.of({name:"LESS",extensions:["less"],load(){return ne(()=>import("./dist-aeKlrIMv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([22,9,5,23]),import.meta.url).then(e=>e.less())}}),ee.of({name:"Liquid",extensions:["liquid"],load(){return ne(()=>import("./dist-miDa4-cz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([24,9,5,13,14,4,25]),import.meta.url).then(e=>e.liquid())}}),ee.of({name:"MariaDB SQL",load(){return Sa("MariaSQL")}}),ee.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return ne(()=>import("./dist-CvWC93qL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([26,9,5,13,14,4,27]),import.meta.url).then(e=>e.markdown())}}),ee.of({name:"MS SQL",load(){return Sa("MSSQL")}}),ee.of({name:"MySQL",load(){return Sa("MySQL")}}),ee.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return ne(()=>import("./dist-nDEBxpL6.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([28,9,5,13,14,4,29]),import.meta.url).then(e=>e.php())}}),ee.of({name:"PLSQL",extensions:["pls"],load(){return Sa("PLSQL")}}),ee.of({name:"PostgreSQL",load(){return Sa("PostgreSQL")}}),ee.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return ne(()=>import("./dist-DsfPGbgk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([30,31,4,5]),import.meta.url).then(e=>e.python())}}),ee.of({name:"Rust",extensions:["rs"],load(){return ne(()=>import("./dist-B99-E4qp.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([32,33,5]),import.meta.url).then(e=>e.rust())}}),ee.of({name:"Sass",extensions:["sass"],load(){return ne(()=>import("./dist-DtbtRAqz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,9,5,35]),import.meta.url).then(e=>e.sass({indented:!0}))}}),ee.of({name:"SCSS",extensions:["scss"],load(){return ne(()=>import("./dist-DtbtRAqz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,9,5,35]),import.meta.url).then(e=>e.sass())}}),ee.of({name:"SQL",extensions:["sql"],load(){return Sa("StandardSQL")}}),ee.of({name:"SQLite",load(){return Sa("SQLite")}}),ee.of({name:"TSX",extensions:["tsx"],load(){return ne(()=>import("./dist-DrBqBDHF.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}))}}),ee.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return ne(()=>import("./dist-DrBqBDHF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,14,4,5]),import.meta.url).then(e=>e.javascript({typescript:!0}))}}),ee.of({name:"WebAssembly",extensions:["wat","wast"],load(){return ne(()=>import("./dist-DcXy-1eJ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([36,37,5]),import.meta.url).then(e=>e.wast())}}),ee.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return ne(()=>import("./dist-BiwuSVkx.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([38,39,5]),import.meta.url).then(e=>e.xml())}}),ee.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return ne(()=>import("./dist-D6WgndTj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([40,41,5]),import.meta.url).then(e=>e.yaml())}}),ee.of({name:"APL",extensions:["dyalog","apl"],load(){return ne(()=>import("./apl-BnIcQcjL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([42,43]),import.meta.url).then(e=>pe(e.apl))}}),ee.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return ne(()=>import("./asciiarmor-VNkYxCrW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([44,45]),import.meta.url).then(e=>pe(e.asciiArmor))}}),ee.of({name:"ASN.1",extensions:["asn","asn1"],load(){return ne(()=>import("./asn1-DHaiamxN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([46,47]),import.meta.url).then(e=>pe(e.asn1({})))}}),ee.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return ne(()=>import("./asterisk-BKEE609E.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.asterisk))}}),ee.of({name:"Brainfuck",extensions:["b","bf"],load(){return ne(()=>import("./brainfuck-B7OQ4qXM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([48,49]),import.meta.url).then(e=>pe(e.brainfuck))}}),ee.of({name:"Cobol",extensions:["cob","cpy"],load(){return ne(()=>import("./cobol-ISPch7J4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>pe(e.cobol))}}),ee.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return ne(()=>import("./clike-CcPLlJ3-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>pe(e.csharp))}}),ee.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return ne(()=>import("./clojure-DK3HqqeG.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>pe(e.clojure))}}),ee.of({name:"ClojureScript",extensions:["cljs"],load(){return ne(()=>import("./clojure-DK3HqqeG.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>pe(e.clojure))}}),ee.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return ne(()=>import("./css-IVPzYP6l.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([56,57]),import.meta.url).then(e=>pe(e.gss))}}),ee.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return ne(()=>import("./cmake-Bnhxe81D.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([58,59]),import.meta.url).then(e=>pe(e.cmake))}}),ee.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return ne(()=>import("./coffeescript-B3cS2ooz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([60,61]),import.meta.url).then(e=>pe(e.coffeeScript))}}),ee.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return ne(()=>import("./commonlisp-DH0yllOU.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([62,63]),import.meta.url).then(e=>pe(e.commonLisp))}}),ee.of({name:"Cypher",extensions:["cyp","cypher"],load(){return ne(()=>import("./cypher-DqUctVOg.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([64,65]),import.meta.url).then(e=>pe(e.cypher))}}),ee.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return ne(()=>import("./python-DgHNYu_r.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([66,67]),import.meta.url).then(e=>pe(e.cython))}}),ee.of({name:"Crystal",extensions:["cr"],load(){return ne(()=>import("./crystal-CfSxbewa.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([68,69]),import.meta.url).then(e=>pe(e.crystal))}}),ee.of({name:"D",extensions:["d"],load(){return ne(()=>import("./d-DYRkEHFy.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([70,71]),import.meta.url).then(e=>pe(e.d))}}),ee.of({name:"Dart",extensions:["dart"],load(){return ne(()=>import("./clike-CcPLlJ3-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>pe(e.dart))}}),ee.of({name:"diff",extensions:["diff","patch"],load(){return ne(()=>import("./diff-Cd5HBT58.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([72,73]),import.meta.url).then(e=>pe(e.diff))}}),ee.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return ne(()=>import("./dockerfile-CLtE40Sb.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([74,75]),import.meta.url).then(e=>pe(e.dockerFile))}}),ee.of({name:"DTD",extensions:["dtd"],load(){return ne(()=>import("./dtd-C24SyIVW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([76,77]),import.meta.url).then(e=>pe(e.dtd))}}),ee.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return ne(()=>import("./dylan-CrkzDmc1.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([78,79]),import.meta.url).then(e=>pe(e.dylan))}}),ee.of({name:"EBNF",load(){return ne(()=>import("./ebnf-C4SDYpAu.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.ebnf))}}),ee.of({name:"ECL",extensions:["ecl"],load(){return ne(()=>import("./ecl-DSuYw2WY.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([80,81]),import.meta.url).then(e=>pe(e.ecl))}}),ee.of({name:"edn",extensions:["edn"],load(){return ne(()=>import("./clojure-DK3HqqeG.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>pe(e.clojure))}}),ee.of({name:"Eiffel",extensions:["e"],load(){return ne(()=>import("./eiffel-D60uMU52.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([82,83]),import.meta.url).then(e=>pe(e.eiffel))}}),ee.of({name:"Elm",extensions:["elm"],load(){return ne(()=>import("./elm-pYZdVh3P.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([84,85]),import.meta.url).then(e=>pe(e.elm))}}),ee.of({name:"Erlang",extensions:["erl"],load(){return ne(()=>import("./erlang-D9MlcoAb.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([86,87]),import.meta.url).then(e=>pe(e.erlang))}}),ee.of({name:"Esper",load(){return ne(()=>import("./sql-BJS8pfHr.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.esper))}}),ee.of({name:"Factor",extensions:["factor"],load(){return ne(()=>import("./factor-gTHEdNEJ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([88,89,75]),import.meta.url).then(e=>pe(e.factor))}}),ee.of({name:"FCL",load(){return ne(()=>import("./fcl-Px-Zskiw.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.fcl))}}),ee.of({name:"Forth",extensions:["forth","fth","4th"],load(){return ne(()=>import("./forth-CWZXTLFs.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([90,91]),import.meta.url).then(e=>pe(e.forth))}}),ee.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return ne(()=>import("./fortran-B8kNpt8O.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([92,93]),import.meta.url).then(e=>pe(e.fortran))}}),ee.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return ne(()=>import("./mllike-fFPa49Ft.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>pe(e.fSharp))}}),ee.of({name:"Gas",extensions:["s"],load(){return ne(()=>import("./gas-DxuMSeqj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([96,97]),import.meta.url).then(e=>pe(e.gas))}}),ee.of({name:"Gherkin",extensions:["feature"],load(){return ne(()=>import("./gherkin-ZkKEDs6K.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([98,99]),import.meta.url).then(e=>pe(e.gherkin))}}),ee.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return ne(()=>import("./groovy-CqQZm41C.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([100,101]),import.meta.url).then(e=>pe(e.groovy))}}),ee.of({name:"Haskell",extensions:["hs"],load(){return ne(()=>import("./haskell-DWF-arrK.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([102,103]),import.meta.url).then(e=>pe(e.haskell))}}),ee.of({name:"Haxe",extensions:["hx"],load(){return ne(()=>import("./haxe-LmdIWMMr.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>pe(e.haxe))}}),ee.of({name:"HXML",extensions:["hxml"],load(){return ne(()=>import("./haxe-LmdIWMMr.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>pe(e.hxml))}}),ee.of({name:"HTTP",load(){return ne(()=>import("./http-CqevOCDe.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.http))}}),ee.of({name:"IDL",extensions:["pro"],load(){return ne(()=>import("./idl-DEd51qv-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([106,107]),import.meta.url).then(e=>pe(e.idl))}}),ee.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return ne(()=>import("./javascript-BFIOGZ-j.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([108,109]),import.meta.url).then(e=>pe(e.jsonld))}}),ee.of({name:"Julia",extensions:["jl"],load(){return ne(()=>import("./julia-Chs3F4Sv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([110,111]),import.meta.url).then(e=>pe(e.julia))}}),ee.of({name:"Kotlin",extensions:["kt","kts"],load(){return ne(()=>import("./clike-CcPLlJ3-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>pe(e.kotlin))}}),ee.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return ne(()=>import("./livescript-CZOCkk31.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([112,113]),import.meta.url).then(e=>pe(e.liveScript))}}),ee.of({name:"Lua",extensions:["lua"],load(){return ne(()=>import("./lua-DK4FKJLN.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([114,115]),import.meta.url).then(e=>pe(e.lua))}}),ee.of({name:"mIRC",extensions:["mrc"],load(){return ne(()=>import("./mirc-OXxqihhx.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([116,117]),import.meta.url).then(e=>pe(e.mirc))}}),ee.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return ne(()=>import("./mathematica-BoEJU8On.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([118,119]),import.meta.url).then(e=>pe(e.mathematica))}}),ee.of({name:"Modelica",extensions:["mo"],load(){return ne(()=>import("./modelica-B2hOO40U.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([120,121]),import.meta.url).then(e=>pe(e.modelica))}}),ee.of({name:"MUMPS",extensions:["mps"],load(){return ne(()=>import("./mumps-BUUE1QKi.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([122,123]),import.meta.url).then(e=>pe(e.mumps))}}),ee.of({name:"Mbox",extensions:["mbox"],load(){return ne(()=>import("./mbox-1WJcoGln.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([124,125]),import.meta.url).then(e=>pe(e.mbox))}}),ee.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return ne(()=>import("./nginx-D6Zlgok6.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.nginx))}}),ee.of({name:"NSIS",extensions:["nsh","nsi"],load(){return ne(()=>import("./nsis-CQPY661e.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([126,127,75]),import.meta.url).then(e=>pe(e.nsis))}}),ee.of({name:"NTriples",extensions:["nt","nq"],load(){return ne(()=>import("./ntriples-CtWbsB7O.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([128,129]),import.meta.url).then(e=>pe(e.ntriples))}}),ee.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return ne(()=>import("./clike-CcPLlJ3-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>pe(e.objectiveC))}}),ee.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return ne(()=>import("./clike-CcPLlJ3-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>pe(e.objectiveCpp))}}),ee.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return ne(()=>import("./mllike-fFPa49Ft.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>pe(e.oCaml))}}),ee.of({name:"Octave",extensions:["m"],load(){return ne(()=>import("./octave-D4HWE405.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([130,131]),import.meta.url).then(e=>pe(e.octave))}}),ee.of({name:"Oz",extensions:["oz"],load(){return ne(()=>import("./oz-Cp-6fXH5.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([132,133]),import.meta.url).then(e=>pe(e.oz))}}),ee.of({name:"Pascal",extensions:["p","pas"],load(){return ne(()=>import("./pascal-B2F20-Dq.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([134,135]),import.meta.url).then(e=>pe(e.pascal))}}),ee.of({name:"Perl",extensions:["pl","pm"],load(){return ne(()=>import("./perl-C8I4my72.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([136,137]),import.meta.url).then(e=>pe(e.perl))}}),ee.of({name:"Pig",extensions:["pig"],load(){return ne(()=>import("./pig-Dg7z9udE.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([138,139]),import.meta.url).then(e=>pe(e.pig))}}),ee.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return ne(()=>import("./powershell-BjupwEXi.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([140,141]),import.meta.url).then(e=>pe(e.powerShell))}}),ee.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return ne(()=>import("./properties-CWyPUxmr.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([142,143]),import.meta.url).then(e=>pe(e.properties))}}),ee.of({name:"ProtoBuf",extensions:["proto"],load(){return ne(()=>import("./protobuf-B2dHC-BL.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([144,145]),import.meta.url).then(e=>pe(e.protobuf))}}),ee.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return ne(()=>import("./pug-B-MnYZUt.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([146,147,109]),import.meta.url).then(e=>pe(e.pug))}}),ee.of({name:"Puppet",extensions:["pp"],load(){return ne(()=>import("./puppet-CeBQQ4Li.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([148,149]),import.meta.url).then(e=>pe(e.puppet))}}),ee.of({name:"Q",extensions:["q"],load(){return ne(()=>import("./q-wSguJrTU.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([150,151]),import.meta.url).then(e=>pe(e.q))}}),ee.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return ne(()=>import("./r-BoIJ2Zve.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([152,153]),import.meta.url).then(e=>pe(e.r))}}),ee.of({name:"RPM Changes",load(){return ne(()=>import("./rpm-DmyUNIkv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>pe(e.rpmChanges))}}),ee.of({name:"RPM Spec",extensions:["spec"],load(){return ne(()=>import("./rpm-DmyUNIkv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>pe(e.rpmSpec))}}),ee.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return ne(()=>import("./ruby-Djlw6kjU.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([156,157]),import.meta.url).then(e=>pe(e.ruby))}}),ee.of({name:"SAS",extensions:["sas"],load(){return ne(()=>import("./sas-B8AwxLVS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([158,159]),import.meta.url).then(e=>pe(e.sas))}}),ee.of({name:"Scala",extensions:["scala"],load(){return ne(()=>import("./clike-CcPLlJ3-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>pe(e.scala))}}),ee.of({name:"Scheme",extensions:["scm","ss"],load(){return ne(()=>import("./scheme-o4lPnt7c.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([160,161]),import.meta.url).then(e=>pe(e.scheme))}}),ee.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return ne(()=>import("./shell-DJuOhLmg.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([162,163]),import.meta.url).then(e=>pe(e.shell))}}),ee.of({name:"Sieve",extensions:["siv","sieve"],load(){return ne(()=>import("./sieve-BBDbJOX3.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([164,165]),import.meta.url).then(e=>pe(e.sieve))}}),ee.of({name:"Smalltalk",extensions:["st"],load(){return ne(()=>import("./smalltalk-CmTnbqu4.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([166,167]),import.meta.url).then(e=>pe(e.smalltalk))}}),ee.of({name:"Solr",load(){return ne(()=>import("./solr-BenHzQuB.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.solr))}}),ee.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return ne(()=>import("./mllike-fFPa49Ft.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>pe(e.sml))}}),ee.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return ne(()=>import("./sparql-BQuPdHqO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([168,169]),import.meta.url).then(e=>pe(e.sparql))}}),ee.of({name:"Spreadsheet",alias:["excel","formula"],load(){return ne(()=>import("./spreadsheet-CIIID0RN.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.spreadsheet))}}),ee.of({name:"Squirrel",extensions:["nut"],load(){return ne(()=>import("./clike-CcPLlJ3-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>pe(e.squirrel))}}),ee.of({name:"Stylus",extensions:["styl"],load(){return ne(()=>import("./stylus-DrNz1BCZ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([170,171]),import.meta.url).then(e=>pe(e.stylus))}}),ee.of({name:"Swift",extensions:["swift"],load(){return ne(()=>import("./swift-UQ24LctC.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([172,173]),import.meta.url).then(e=>pe(e.swift))}}),ee.of({name:"sTeX",load(){return ne(()=>import("./stex-pjf-hOob.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>pe(e.stex))}}),ee.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return ne(()=>import("./stex-pjf-hOob.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>pe(e.stex))}}),ee.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return ne(()=>import("./verilog-BPXnWs06.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>pe(e.verilog))}}),ee.of({name:"Tcl",extensions:["tcl"],load(){return ne(()=>import("./tcl-BBEwSttz.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([178,179]),import.meta.url).then(e=>pe(e.tcl))}}),ee.of({name:"Textile",extensions:["textile"],load(){return ne(()=>import("./textile-CYG_qV_5.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([180,181]),import.meta.url).then(e=>pe(e.textile))}}),ee.of({name:"TiddlyWiki",load(){return ne(()=>import("./tiddlywiki-mgaN9k7_.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.tiddlyWiki))}}),ee.of({name:"Tiki wiki",load(){return ne(()=>import("./tiki-B8Sxh4ZA.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>pe(e.tiki))}}),ee.of({name:"TOML",extensions:["toml"],load(){return ne(()=>import("./toml-DB6lKkvi.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([182,183]),import.meta.url).then(e=>pe(e.toml))}}),ee.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return ne(()=>import("./troff-WrtaE-DW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([184,185]),import.meta.url).then(e=>pe(e.troff))}}),ee.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return ne(()=>import("./ttcn-DNOLsGjD.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([186,187]),import.meta.url).then(e=>pe(e.ttcn))}}),ee.of({name:"TTCN_CFG",extensions:["cfg"],load(){return ne(()=>import("./ttcn-cfg-D2oRz-8W.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([188,189]),import.meta.url).then(e=>pe(e.ttcnCfg))}}),ee.of({name:"Turtle",extensions:["ttl"],load(){return ne(()=>import("./turtle-hoYUNcbl.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([190,191]),import.meta.url).then(e=>pe(e.turtle))}}),ee.of({name:"Web IDL",extensions:["webidl"],load(){return ne(()=>import("./webidl-uP8WR81M.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([192,193]),import.meta.url).then(e=>pe(e.webIDL))}}),ee.of({name:"VB.NET",extensions:["vb"],load(){return ne(()=>import("./vb-CSArj0Ox.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([194,195]),import.meta.url).then(e=>pe(e.vb))}}),ee.of({name:"VBScript",extensions:["vbs"],load(){return ne(()=>import("./vbscript-Cy_b6RxB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([196,197]),import.meta.url).then(e=>pe(e.vbScript))}}),ee.of({name:"Velocity",extensions:["vtl"],load(){return ne(()=>import("./velocity-8fvVYgdA.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([198,199]),import.meta.url).then(e=>pe(e.velocity))}}),ee.of({name:"Verilog",extensions:["v"],load(){return ne(()=>import("./verilog-BPXnWs06.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>pe(e.verilog))}}),ee.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return ne(()=>import("./vhdl-C4JSE7Sd.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([200,201]),import.meta.url).then(e=>pe(e.vhdl))}}),ee.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return ne(()=>import("./xquery-C8ppAT5Z.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([202,203]),import.meta.url).then(e=>pe(e.xQuery))}}),ee.of({name:"Yacas",extensions:["ys"],load(){return ne(()=>import("./yacas-CnXhtfs7.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([204,205]),import.meta.url).then(e=>pe(e.yacas))}}),ee.of({name:"Z80",extensions:["z80"],load(){return ne(()=>import("./z80-B0aL_Tnf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([206,207]),import.meta.url).then(e=>pe(e.z80))}}),ee.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return ne(()=>import("./mscgen-BUm8DSPh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>pe(e.mscgen))}}),ee.of({name:"X\xF9",extensions:["xu"],load(){return ne(()=>import("./mscgen-BUm8DSPh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>pe(e.xu))}}),ee.of({name:"MsGenny",extensions:["msgenny"],load(){return ne(()=>import("./mscgen-BUm8DSPh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>pe(e.msgenny))}}),ee.of({name:"Vue",extensions:["vue"],load(){return ne(()=>import("./dist-oUL4XFdB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([210,9,5,13,14,4,211]),import.meta.url).then(e=>e.vue())}}),ee.of({name:"Angular Template",load(){return ne(()=>import("./dist-9o0Xjd5v.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([212,9,5,13,14,4]),import.meta.url).then(e=>e.angular())}})],g1=new WeakMap,yE=/(\n|\r\n?|\u2028|\u2029)/g,vE=/^\s*/,bE=/\S/,wE=Array.prototype.slice,Mf=48,y1=57,v1=97,xE=102,b1=65,_E=70;lc=function(e){if(typeof e=="string")return _1([e])[0];if(typeof e=="function")return function(){let i=wE.call(arguments);return i[0]=x1(i[0]),e.apply(this,i)};let t=x1(e),r=w1(t,0);for(let i=1;i<t.length;i++)r+=arguments[i]+w1(t,i);return r};function w1(e,t){let r=e[t];if(r===void 0)throw TypeError(`invalid cooked string at index ${t}`);return r}function x1(e){let t=g1.get(e);if(t)return t;let r=_1(e.raw),i=r.map(CE);return Object.defineProperty(i,"raw",{value:Object.freeze(r)}),Object.freeze(i),g1.set(e,i),i}function _1(e){let t=e.map(l=>l.split(yE)),r;for(let l=0;l<t.length;l++){let c=t[l],d=l===0,f=l+1===t.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||bE.test(c[c.length-1]))throw Error("invalid content on closing line");c[c.length-2]="",c[c.length-1]=""}for(let h=2;h<c.length;h+=2){let b=c[h],x=h+1===c.length&&!f,C=vE.exec(b)[0];if(!x&&C.length===b.length){c[h]="";continue}r=kE(C,r)}}let i=r?r.length:0;return t.map(l=>{let c=l[0];for(let d=1;d<l.length;d+=2){let f=l[d],h=l[d+1];c+=f+h.slice(i)}return c})}function kE(e,t){if(t===void 0||e===t)return e;let r=0;for(let i=Math.min(e.length,t.length);r<i&&e[r]===t[r];r++);return e.slice(0,r)}function CE(e){let t="",r=0,i=0;for(;(i=e.indexOf("\\",i))>-1;){if(t+=e.slice(r,i),++i===e.length)return;let l=e[i++];switch(l){case"b":t+="\b";break;case"t":t+=" ";break;case"n":t+=`
|
|
36
|
+
`;break;case"v":t+="\v";break;case"f":t+="\f";break;case"r":t+="\r";break;case"\r":i<e.length&&e[i]===`
|
|
37
|
+
`&&++i;case`
|
|
38
|
+
`:case"\u2028":case"\u2029":break;case"0":if(k1(e,i))return;t+="\0";break;case"x":{let c=Rf(e,i,i+2);if(c===-1)return;i+=2,t+=String.fromCharCode(c);break}case"u":{let c;if(i<e.length&&e[i]==="{"){let d=e.indexOf("}",++i);if(d===-1)return;c=Rf(e,i,d),i=d+1}else c=Rf(e,i,i+4),i+=4;if(c===-1||c>1114111)return;t+=String.fromCodePoint(c);break}default:if(k1(l,0))return;t+=l}r=i}return t+e.slice(r)}function k1(e,t){let r=e.charCodeAt(t);return r>=Mf&&r<=y1}function Rf(e,t,r){if(r>=e.length)return-1;let i=0;for(;t<r;t++){let l=SE(e.charCodeAt(t));if(l===-1)return-1;i=i*16+l}return i}function SE(e){return e>=Mf&&e<=y1?e-Mf:e>=v1&&e<=xE?e-v1+10:e>=b1&&e<=_E?e-b1+10:-1}const C1=["","f","r","fr","rf"];function EE(e){try{return lc(`
|
|
39
|
+
${e}
|
|
40
|
+
`).trim()}catch{return e}}function TE(e){return q_.parse(e)}var IE=new Set(["(","[","{",",",")","]","}"]);function AE(e,t){return e.name==="ArgList"?{args:LE(e),kwargs:DE(e,t)}:(console.warn(`Not an ArgList, name: ${e.name}`),{args:[],kwargs:[]})}function LE(e){var i;e.firstChild();let t=[],r=e.name;do if(r=e.name,!IE.has(r)){if(r==="VariableName"&&((i=e.node.nextSibling)==null?void 0:i.name)==="AssignOp"){e.prev();break}t.push(e.node)}while(e.nextSibling());return t}function DE(e,t){let r=[],i=e.name;do if(i=e.name,i==="VariableName"){let l=t.slice(e.from,e.to),c=e.node.nextSibling;if(!c||c.name!=="AssignOp")continue;let d=c.nextSibling;if(!d)continue;let f=t.slice(d.from,d.to).trim();r.push({key:l,value:f})}while(e.nextSibling());return r}function OE(e,t){if(e.name==="String"){let r=t.slice(e.from,e.to);return r.startsWith('r"""')||r.startsWith("r'''")?r.slice(4,-3):r.startsWith('"""')||r.startsWith("'''")?r.slice(3,-3):r.startsWith('r"')||r.startsWith("r'")?r.slice(2,-1):r.slice(1,-1)}if(e.name==="FormatString"){let r=t.slice(e.from,e.to);return r.startsWith('f"""')||r.startsWith("f'''")?r.slice(4,-3):r.startsWith('rf"""')||r.startsWith("rf'''")||r.startsWith('fr"""')||r.startsWith("fr'''")?r.slice(5,-3):r.startsWith('r"""')||r.startsWith("r'''")?r.slice(4,-3):r.startsWith('f"')||r.startsWith("f'")?r.slice(2,-1):r.startsWith('rf"')||r.startsWith("rf'")||r.startsWith('fr"')||r.startsWith("fr'")?r.slice(3,-1):(r.startsWith('r"')||r.startsWith("r'"),r.slice(2,-1))}return null}function ME(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 RE(e){let t=[...C1].sort((r,i)=>i.length-r.length);for(let r of t)if(e.startsWith(r))return[r,e.slice(r.length)];return["",e]}function PE(e,t){return e.replaceAll(`\\${t}`,t)}var NE=[['"""','"""'],["'''","'''"],['"','"'],["'","'"]],jE=C1.flatMap(e=>NE.map(([t,r])=>[e+t,r])).map(([e,t])=>[e,RegExp(`^mo\\.md\\(\\s*${S1(e)}(.*)${S1(t)}\\s*\\)$`,"s")]);function S1(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}let E1,wc;Hd=class{constructor(){ae(this,"type","markdown");ae(this,"defaultCode",`mo.md(r"""
|
|
41
|
+
""")`);ae(this,"defaultMetadata",{quotePrefix:"r"})}static fromMarkdown(e){return`mo.md(r"""
|
|
42
|
+
${e}
|
|
43
|
+
""")`}transformIn(e){e=e.trim();let t={...this.defaultMetadata};if(e==="")return{code:"",offset:0,metadata:t};for(let[r,i]of jE){let l=e.match(i);if(l){let c=l[1],[d,f]=RE(r);t.quotePrefix=d;let h=PE(c,f),b=e.indexOf(c);return{code:lc(`
|
|
44
|
+
${h}
|
|
45
|
+
`).trim(),offset:b,metadata:t}}}return{code:e,offset:0,metadata:t}}transformOut(e,t){e===""&&(e=" ");let{quotePrefix:r}=t,i=e.replaceAll('""',String.raw`"\"`),l=`mo.md(${r}"""
|
|
46
|
+
`;return{code:l+i+`
|
|
47
|
+
""")`,offset:l.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 t=Wh.parser.parse(e),r=[{match:"Script"},{match:"ExpressionStatement"},{match:"CallExpression"},{match:"MemberExpression"},{match:"VariableName"},{match:"."},{match:"PropertyName"},{match:"ArgList"},{match:"("},{match:/String|FormatString/,stop:!0},{match:")"}],i=!0;return t.iterate({enter:l=>{let c=r.shift();if(c===void 0)return i=!1,!1;let d=c.match;return typeof d=="string"?(i&&(i=d===l.name),i&&!c.stop):(d.test(l.name)||(i=!1),i&&!c.stop)}}),i}},E1=class{constructor(){ae(this,"type","python");ae(this,"defaultCode","");ae(this,"defaultMetadata",{})}transformIn(e){return{code:e,offset:0,metadata:{}}}transformOut(e,t){return{code:e,offset:0}}isSupported(e){return!0}},wc="__marimo_duckdb",Nd=class{constructor(){ae(this,"type","sql");ae(this,"defaultMetadata",{dataframeName:"_df",quotePrefix:"f",commentLines:[],showOutput:!0,engine:wc})}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 t={...this.defaultMetadata,commentLines:this.extractCommentLines(e)};if(!this.isSupported(e))return{code:e,offset:0,metadata:t};if(e==="")return{code:"",offset:0,metadata:t};let r=T1(e);return r?(t.dataframeName=r.dfName,t.showOutput=r.output??!0,t.engine=r.engine??wc,{code:lc(`
|
|
48
|
+
${r.sqlString}
|
|
49
|
+
`).trim(),offset:r.startPosition,metadata:t}):{code:e,offset:0,metadata:t}}transformOut(e,t){let{quotePrefix:r,commentLines:i,showOutput:l,engine:c,dataframeName:d}=t,f=`${d} = mo.sql(
|
|
50
|
+
${r}"""
|
|
51
|
+
`,h=e.replaceAll('"""',String.raw`\"""`),b=`
|
|
52
|
+
"""${l?"":`,
|
|
53
|
+
output=False`}${c===wc?"":`,
|
|
54
|
+
engine=${c}`}
|
|
55
|
+
)`;return{code:[...i,f].join(`
|
|
56
|
+
`)+FE(h)+b,offset:f.length+1}}isSupported(e){return e.trim()===""?!0:!e.includes("mo.sql")||e.split("mo.sql").length>2?!1:T1(e)!==null}extractCommentLines(e){let t=e.split(`
|
|
57
|
+
`),r=[];for(let i of t)if(i!=null&&i.startsWith("#"))r.push(i);else break;return r}};function zE(e){do{if(e.name==="AssignStatement")return e.node;if(e.name!=="Comment")return null}while(e.next());return null}function T1(e){try{let t=TE(e).cursor();t.name==="Script"&&t.next();let r=zE(t);if(!r||e.slice(r.to).trim().length>0)return null;let i=null,l=null,c,d,f=0,h=r.cursor();if(h.firstChild(),h.name==="VariableName"&&(i=e.slice(h.from,h.to)),!i)return null;let b=!1,x=null;for(;h.nextSibling();)if(h.name==="AssignOp")b=!0;else if(b&&!x){x=h.node;break}if(!x||x.name==="ConditionalExpression"||x.name==="BinaryExpression"||x.name==="UnaryExpression")return null;let C=x.cursor(),S=null;if(C.name==="CallExpression")S=C.node;else{C.firstChild();do if(C.name==="CallExpression"){S=C.node;break}while(C.nextSibling())}if(S){let E=S.cursor(),A=!1;if(E.firstChild(),E.name==="MemberExpression"&&(A=e.slice(E.from,E.to)==="mo.sql"),A){for(;E.next();)if(E.name==="ArgList"){let{args:R,kwargs:j}=AE(E.node.cursor(),e);R.length===1&&(l=OE(R[0],e),f=R[0].from+ME(e.slice(R[0].from,R[0].to)));for(let{key:q,value:V}of j)switch(q){case"engine":c=V;break;case"output":d=V==="True";break}if(l==="")return{dfName:i,sqlString:"",engine:c,output:d,startPosition:f};break}}}return!i||!l?null:{dfName:i,sqlString:EE(l),engine:c,output:d,startPosition:f}}catch(t){return console.warn("Failed to parse SQL statement",t),null}}function FE(e){return e.split(`
|
|
58
|
+
`).map(t=>t!=null&&t.trim()?` ${t}`:t).join(`
|
|
59
|
+
`)}var qE=Wn(),Pf=()=>({cellIds:new Set}),{valueAtom:Nf,useActions:$E}=vl(Pf,{markForCut:(e,t)=>({cellIds:new Set(t.cellIds)}),clear:()=>Pf()});$d=Ie(e=>e(Nf).cellIds),ug=Ie(null,(e,t)=>{t(Nf,Pf())}),wC=function(){return $E()},$k=function(e){let t=(0,qE.c)(3),r=un($d),i;return t[0]!==e||t[1]!==r?(i=r.has(e),t[0]=e,t[1]=r,t[2]=i):i=t[2],i},LC=function(){return un(Nf)},mC=(e,t,r)=>Un.define(i=>new VE(i,e,t,r)),ci=__.define();var VE=class{constructor(e,t,r,i){ae(this,"isInitDispatch",!1);ae(this,"onRemoteUpdate",e=>{if(e.by!=="local"){if(e.by==="checkout"){this.view.dispatch({changes:[{from:0,to:this.view.state.doc.length,insert:this.getTextFromDoc(this.doc).toString()}],annotations:[ci.of(this)]});return}if(e.by==="import"){let t=[],r=0;for(let{diff:i,path:l}of e.events){if(l.join("/")!==this.docPath.join("/")||i.type!=="text")continue;let c=i.diff;for(let d of c)d.insert?t.push({from:r,to:r,insert:d.insert}):d.delete?(t.push({from:r,to:r+d.delete}),r+=d.delete):d.retain!=null&&(r+=d.retain);t.length>0&&this.view.dispatch({changes:t,annotations:[ci.of(this)]})}}}});this.view=e,this.doc=t,this.docPath=r,this.getTextFromDoc=i,this.sub=t.subscribe(this.onRemoteUpdate),Promise.resolve().then(()=>{this.isInitDispatch=!0;let l=this.view.state.doc.toString(),c=this.getTextFromDoc(this.doc);l!==c.toString()&&e.dispatch({changes:[{from:0,to:this.view.state.doc.length,insert:c.toString()}],annotations:[ci.of(this)]})})}update(e){if(this.isInitDispatch){this.isInitDispatch=!1;return}if(!e.docChanged||e.transactions.length>0&&(e.transactions[0].annotation(ci)===this||e.transactions[0].annotation(ci)==="undo"))return;let t=0;e.changes.iterChanges((r,i,l,c,d)=>{let f=d.sliceString(0,d.length,`
|
|
60
|
+
`);r!==i&&this.getTextFromDoc(this.doc).delete(r+t,i-r),f.length>0&&this.getTextFromDoc(this.doc).insert(r+t,f),t+=f.length-(i-r)}),this.doc.commit()}destroy(){var e;(e=this.sub)==null||e.call(this),this.sub=void 0}};V0=function(e,t){if(typeof window>"u")return;let r=`__marimo__${t}`;window[r]&&be.warn(`Overwriting existing debug object ${r}`),window[r]=e};var BE={markdown:!0,wasm_layouts:!1,rtc_v2:!1,cache_panel:!1,external_agents:!1,debugger:!1,line_timing:!1,editor_code_lens:!1};xl=function(e){var t,r;return((r=(t=d_())==null?void 0:t.experimental)==null?void 0:r[e])??BE[e]};function HE(e,t){Kn().saveUserConfig({config:{experimental:{[e]:t}}})}V0(HE,"setFeatureFlag");function xc(e,t){return{get:()=>t.get(e),sub:r=>t.sub(e,()=>r(t.get(e)))}}function WE(e,{offset:t,body:r=window,behavior:i="smooth"}){let l=(t==null?void 0:t.top)??0,c=(t==null?void 0:t.bottom)??0,d=e.getBoundingClientRect();if(d.top<l){r.scrollBy({top:d.top-l,behavior:i});return}if(d.bottom>window.innerHeight-c){r.scrollBy({top:d.bottom-window.innerHeight+c,behavior:i});return}}tc=function(e){return e?e.state.field(Jn).type:"python"};function UE(e,t){return!e||tc(e)===t?!1:e.state.doc.toString().trim()===""?!0:Gn[t].isSupported(Sr(e))}Dd=function(e,t,r={}){return!r.force&&!UE(e,t)?!1:(Od(e,{language:t}),t)};function KE(e){return qr.of([{key:e.getHotkey("cell.format").key,preventDefault:!0,run:t=>(Fd({[t.state.facet(ga)]:t}),!0)},{key:e.getHotkey("cell.viewAsMarkdown").key,preventDefault:!0,run:t=>{let r=Dd(t,tc(t)==="markdown"?"python":"markdown",{force:!0});return r==="markdown"&&t.state.facet(st).afterToggleMarkdown(),r!==!1}},{key:e.getHotkey("cell.viewAsSQL").key,preventDefault:!0,run:t=>{let r=Dd(t,tc(t)==="sql"?"python":"sql",{force:!0});return r==="sql"&&t.state.facet(st).afterToggleSQL(),r!==!1}}])}Dk=function(){return ot.updateListener.of(e=>{if(e.view.hasFocus&&e.heightChanged&&e.docChanged){if(e.transactions.some(t=>t.effects.some(r=>r.is(Pl))))return;I1(e.view,{behavior:"smooth"})}})};function I1(e,t){let r=e.dom.getElementsByClassName("cm-activeLine cm-line");if(r.length===1){let i=r[0],l=document.getElementById("App");dn(l,"App not found"),WE(i,{offset:{top:30,bottom:150},body:l,behavior:t.behavior})}}function QE(){return{}}let GE,XE,A1;({reducer:GE,createActions:XE,valueAtom:li,useActions:A1}=vl(QE,{setVariables:(e,t)=>{let r={...e},i={};for(let l of t)i[l.name]={...r[l.name],...l};return i},addVariables:(e,t)=>{let r={...e};for(let i of t)r[i.name]={...r[i.name],...i};return r},setMetadata:(e,t)=>{let r={...e};for(let{name:i,value:l,dataType:c}of t)r[i]&&(r[i]={...r[i],value:l,dataType:c});return r}})),kC=()=>un(li),ik=function(){return A1()},l0=function(e){let t=e.storage||Tl;return{getItem(r,i){try{let l=t.getItem(r);if(!l)return i;let c=JSON.parse(l);return e.fromSerializable(c)}catch(l){return be.warn(`Error getting ${r} from storage`,l),i}},setItem:(r,i)=>{t.setItem(r,JSON.stringify(e.toSerializable(i)))},removeItem:r=>{t.removeItem(r)}}},Id=ty(()=>Tl),Gs=[{type:"files",Icon:r1,label:"Files",tooltip:"View files",defaultSection:"sidebar",additionalKeywords:["explorer","browser","directory"]},{type:"variables",Icon:mg,label:"Variables",tooltip:"Explore variables and data sources",defaultSection:"sidebar",additionalKeywords:["state","scope","inspector"]},{type:"packages",Icon:S0,label:"Packages",tooltip:"Manage packages",defaultSection:"sidebar",additionalKeywords:["dependencies","pip","install"]},{type:"ai",Icon:D0,label:"AI",tooltip:"Chat & Agents",defaultSection:"sidebar",additionalKeywords:["chat","copilot","assistant"]},{type:"outline",Icon:b0,label:"Outline",tooltip:"View outline",defaultSection:"sidebar",additionalKeywords:["toc","structure","headings"]},{type:"documentation",Icon:k0,label:"Docs",tooltip:"View live docs",defaultSection:"sidebar",additionalKeywords:["reference","api"]},{type:"dependencies",Icon:Y0,label:"Dependencies",tooltip:"Explore dependencies",defaultSection:"sidebar",additionalKeywords:["graph","imports"]},{type:"errors",Icon:Zh,label:"Errors",tooltip:"View errors",defaultSection:"developer-panel",additionalKeywords:["exceptions","problems","diagnostics"]},{type:"scratchpad",Icon:Yh,label:"Scratchpad",tooltip:"Scratchpad",defaultSection:"developer-panel",additionalKeywords:["scratch","draft","playground"]},{type:"tracing",Icon:g0,label:"Tracing",tooltip:"View tracing",defaultSection:"developer-panel",additionalKeywords:["profiling","performance"]},{type:"secrets",Icon:a1,label:"Secrets",tooltip:"Manage secrets",defaultSection:"developer-panel",hidden:dd(),additionalKeywords:["env","environment","keys","credentials"]},{type:"logs",Icon:i0,label:"Logs",tooltip:"View logs",defaultSection:"developer-panel",additionalKeywords:["console","stdout"]},{type:"terminal",Icon:r0,label:"Terminal",tooltip:"Terminal",hidden:dd(),defaultSection:"developer-panel",requiredCapability:"terminal",additionalKeywords:["shell","console","bash","command"]},{type:"snippets",Icon:i1,label:"Snippets",tooltip:"Snippets",defaultSection:"developer-panel",additionalKeywords:["templates","examples"]},{type:"cache",Icon:Hh,label:"Cache",tooltip:"View cache",defaultSection:"developer-panel",hidden:!xl("cache_panel"),additionalKeywords:["memory","memoize"]}],Sk=new Map(Gs.map(e=>[e.type,e])),Ik=function({panel:e,capabilities:t,aiEnabled:r}){return!!(e.hidden||e.type==="ai"&&!r||e.requiredCapability&&!t[e.requiredCapability])};var YE=Wn(),jf={sidebar:Gs.filter(e=>!e.hidden&&e.defaultSection==="sidebar").map(e=>e.type),developerPanel:Gs.filter(e=>!e.hidden&&e.defaultSection==="developer-panel").map(e=>e.type)};function JE(e){let t=new Set([...e.sidebar,...e.developerPanel]);return{sidebar:[...e.sidebar,...jf.sidebar.filter(r=>!t.has(r))],developerPanel:[...e.developerPanel,...jf.developerPanel.filter(r=>!t.has(r))]}}vg=ac("marimo:panel-layout",jf,l0({toSerializable:e=>e,fromSerializable:e=>JE(e)}),{getOnInit:!0});function L1(e){let t=Te.get(vg);return t.sidebar.includes(e)?"sidebar":t.developerPanel.includes(e)?"developer-panel":null}var D1="marimo:sidebar",O1=new Sd(l_({selectedPanel:s_().optional().transform(e=>e),isSidebarOpen:c_(),isDeveloperPanelOpen:c_().optional().default(!1),selectedDeveloperPanelTab:s_().optional().default("errors").transform(e=>e)}),ZE);function ZE(){return{selectedPanel:"variables",isSidebarOpen:!1,isDeveloperPanelOpen:!1,selectedDeveloperPanelTab:"errors"}}let M1,e4,R1;({reducer:M1,createActions:e4,valueAtom:Js,useActions:R1}=vl(()=>O1.get(D1),{openApplication:(e,t)=>{let r=L1(t);return r==="sidebar"?{...e,selectedPanel:t,isSidebarOpen:!0}:r==="developer-panel"?{...e,selectedDeveloperPanelTab:t,isDeveloperPanelOpen:!0}:e},toggleApplication:(e,t)=>{let r=L1(t);return r==="sidebar"?{...e,selectedPanel:t,isSidebarOpen:e.isSidebarOpen?e.selectedPanel!==t:!0}:r==="developer-panel"?{...e,selectedDeveloperPanelTab:t,isDeveloperPanelOpen:e.isDeveloperPanelOpen?e.selectedDeveloperPanelTab!==t:!0}:e},toggleSidebarPanel:e=>({...e,isSidebarOpen:!e.isSidebarOpen}),setIsSidebarOpen:(e,t)=>({...e,isSidebarOpen:t}),toggleDeveloperPanel:e=>({...e,isDeveloperPanelOpen:!e.isDeveloperPanelOpen}),setIsDeveloperPanelOpen:(e,t)=>({...e,isDeveloperPanelOpen:t})},[(e,t)=>O1.set(D1,t)])),Ek=()=>{let e=(0,YE.c)(2),t=un(Js);if(t.isSidebarOpen)return t;let r;return e[0]===t?r=e[1]:(r={...t,selectedPanel:void 0},e[0]=t,e[1]=r),r},U_=function(){return R1()},yk=function(e){Te.set(Js,t=>M1(t,{type:"openApplication",payload:e}))},p0=Ie({terminal:!1,pylsp:!1,basedpyright:!1,ty:!1,pyrefly:!1});function Ea(e){var t;return((t=Te.get(p0))==null?void 0:t[e])??!1}_d=Ie({documentation:null}),we={VariableName:"VariableName",FunctionDefinition:"FunctionDefinition",ClassDefinition:"ClassDefinition",LambdaExpression:"LambdaExpression",ParamList:"ParamList",Decorator:"Decorator",AssignStatement:"AssignStatement",ForStatement:"ForStatement",ImportStatement:"ImportStatement",TryStatement:"TryStatement",WithStatement:"WithStatement",TupleExpression:"TupleExpression",ArrayExpression:"ArrayExpression",ParenthesizedExpression:"ParenthesizedExpression",CallExpression:"CallExpression",ArgList:"ArgList",AssignOp:"AssignOp",ArrayComprehensionExpression:"ArrayComprehensionExpression",SetComprehensionExpression:"SetComprehensionExpression",DictionaryComprehensionExpression:"DictionaryComprehensionExpression",ComprehensionExpression:"ComprehensionExpression",Comment:"Comment",String:"String",FormatString:"FormatString"},yn={For:"for",In:"in",As:"as",Import:"import"},kl=new Set([we.FunctionDefinition,we.LambdaExpression,we.ArrayComprehensionExpression,we.SetComprehensionExpression,we.DictionaryComprehensionExpression,we.ComprehensionExpression,we.ClassDefinition]),oC=new Set([we.Comment,we.String,we.FormatString]);function t4(e){let t=Nh(e.state);if(!t||Xh(t))return[];let r=new Set(Object.keys(e.variables).filter(E=>{let A=e.variables[E];return A.dataType!=="module"&&!A.declaredBy.includes("setup")&&!A.declaredBy.includes(e.cellId)}));if(r.size===0)return[];let i=[],l=new Map,c=new Map,d=new Map;function f(E,A){var X,fe,F,H,te,me,ve,_e,ke;let R=E.cursor(),j=R.name,q=R.from,V=kl.has(j),z=A;switch(V&&(z=[...A,q],l.set(q,new Set),c.set(q,j)),j){case we.FunctionDefinition:{let oe=E.cursor();oe.firstChild();do if(oe.name===we.VariableName){let ye=e.state.doc.sliceString(oe.from,oe.to),ie=A[A.length-1]??-1;l.has(ie)||l.set(ie,new Set),(X=l.get(ie))==null||X.add(ye);break}while(oe.nextSibling());let ce=E.cursor();ce.firstChild();do if(ce.name===we.ParamList){let ye=ce.node.cursor();ye.firstChild();do if(ye.name===we.VariableName){let ie=e.state.doc.sliceString(ye.from,ye.to);(fe=l.get(q))==null||fe.add(ie)}while(ye.nextSibling())}while(ce.nextSibling());break}case we.LambdaExpression:{let oe=E.cursor();oe.firstChild();do if(oe.name===we.ParamList){let ce=oe.node.cursor();ce.firstChild();do if(ce.name===we.VariableName){let ye=e.state.doc.sliceString(ce.from,ce.to);(F=l.get(q))==null||F.add(ye)}while(ce.nextSibling())}while(oe.nextSibling());break}case we.ArrayComprehensionExpression:case we.DictionaryComprehensionExpression:case we.SetComprehensionExpression:case we.ComprehensionExpression:{let oe=E.cursor();oe.firstChild();let ce=!1;do if(oe.name===yn.For)ce=!0;else if(ce&&oe.name===we.VariableName){let ye=e.state.doc.sliceString(oe.from,oe.to);(H=l.get(q))==null||H.add(ye)}else if(ce&&oe.name===we.TupleExpression){let ye=oe.node.cursor();ye.firstChild();do if(ye.name===we.VariableName){let ie=e.state.doc.sliceString(ye.from,ye.to);(te=l.get(q))==null||te.add(ie)}while(ye.nextSibling())}else ce&&oe.name===yn.In&&(ce=!1);while(oe.nextSibling());break}case we.ClassDefinition:{let oe=E.cursor();oe.firstChild();do if(oe.name===we.VariableName){let ce=e.state.doc.sliceString(oe.from,oe.to),ye=A[A.length-1]??-1;l.has(ye)||l.set(ye,new Set),(me=l.get(ye))==null||me.add(ce);break}while(oe.nextSibling());d.set(q,[]);break}case we.AssignStatement:{let oe=E.cursor(),ce=[];oe.firstChild();do oe.name===we.AssignOp&&ce.push(oe.from);while(oe.nextSibling());let ye=ce[ce.length-1],ie=E.cursor();ie.firstChild();let le=z[z.length-1]??-1;do ie.from<ye&&zf(ie,{currentScope:le,state:e.state,allDeclarations:l,scopeTypes:c,classLevelDeclarations:d,assignmentPosition:R.to});while(ie.nextSibling());break}case we.ForStatement:{let oe=E.cursor();oe.firstChild();let ce=!1;do if(oe.name===yn.For)ce=!0;else if(ce&&oe.name===we.VariableName){let ye=e.state.doc.sliceString(oe.from,oe.to),ie=z[z.length-1]??-1;l.has(ie)||l.set(ie,new Set),(ve=l.get(ie))==null||ve.add(ye)}else ce&&oe.name===yn.In&&(ce=!1);while(oe.nextSibling());break}case we.ImportStatement:{let oe=E.cursor();oe.firstChild();let ce=z[z.length-1]??-1;l.has(ce)||l.set(ce,new Set);let ye=l.get(ce),ie=!1,le=null,K=()=>{le!==null&&(ye==null||ye.add(le)),le=null};do{if(oe.name===yn.Import){ie=!0;continue}if(ie){if(oe.name===yn.As){le=null;continue}oe.name===we.VariableName?(K(),le=e.state.doc.sliceString(oe.from,oe.to)):oe.name===","&&K()}}while(oe.nextSibling());K();break}case we.TryStatement:{let oe=E.cursor();oe.firstChild();let ce=!1;do if(oe.name===yn.As)ce=!0;else if(ce&&oe.name===we.VariableName){let ye=e.state.doc.sliceString(oe.from,oe.to),ie=z[z.length-1]??-1;l.has(ie)||l.set(ie,new Set),(_e=l.get(ie))==null||_e.add(ye),ce=!1}while(oe.nextSibling());break}case we.WithStatement:{let oe=E.cursor();oe.firstChild();let ce=!1;do if(oe.name===yn.As)ce=!0;else if(ce&&oe.name===we.VariableName){let ye=e.state.doc.sliceString(oe.from,oe.to),ie=z[z.length-1]??-1;l.has(ie)||l.set(ie,new Set),(ke=l.get(ie))==null||ke.add(ye),ce=!1}while(oe.nextSibling());break}}S(R,oe=>{f(oe,z)})}function h(E,A,R){let j=d.get(A);return j?j.some(([q,V])=>q===E&&V<R):!1}function b(E,A,R){var j,q;for(let V of A)if(c.get(V)===we.ClassDefinition){if(h(E,V,R))return!0}else if((j=l.get(V))!=null&&j.has(E))return!0;return((q=l.get(-1))==null?void 0:q.has(E))??!1}function x(E,A){let R=E.cursor(),j=R.name,q=R.from;if(j===we.ImportStatement)return;let V=kl.has(j),z=A;if(V&&(z=[...A,q]),j===we.VariableName){let X=e.state.doc.sliceString(R.from,R.to);C(X,R)&&(b(X,z,R.from)||i.push({from:R.from,to:R.to,variableName:X}))}S(R,X=>{x(X,z)})}function C(E,A){return r.has(E)&&!a4(A)&&!n4(A)&&!r4(A)}function S(E,A){if(E.firstChild())do A(E.node);while(E.nextSibling())}return f(t,[]),x(t,[]),i}function n4(e){let t=e.node.cursor();if(t.moveTo(e.from),t.parent()&&t.name===we.CallExpression&&t.firstChild())do if(t.name===we.ArgList&&t.firstChild()){do if(t.from===e.from&&t.to===e.to)return t.nextSibling()&&t.name===we.AssignOp;while(t.nextSibling());break}while(t.nextSibling());return!1}function r4(e){let t=e.node.cursor();if(t.parent()&&t.name===we.AssignStatement){let r=t.node.cursor();r.firstChild();let i=-1;do if(r.name===we.AssignOp){i=r.from;break}while(r.nextSibling());return i!==-1&&e.from<i}return!1}function a4(e){let t=e.node.cursor();return!!(t.prevSibling()&&t.name===".")}Xh=function(e){let t=e.cursor();do if(t.name==="\u26A0"||t.type.isError)return!0;while(t.next());return!1};function zf(e,t){var r;switch(e.name){case we.VariableName:{let i=t.state.doc.sliceString(e.from,e.to);if(t.currentScope!==-1&&t.scopeTypes.get(t.currentScope)===we.ClassDefinition){let l=t.classLevelDeclarations.get(t.currentScope);l&&l.push([i,t.assignmentPosition])}else t.allDeclarations.has(t.currentScope)||t.allDeclarations.set(t.currentScope,new Set),(r=t.allDeclarations.get(t.currentScope))==null||r.add(i);break}case we.TupleExpression:{let i=e.node.cursor();i.firstChild();do zf(i,t);while(i.nextSibling());break}case we.ArrayExpression:{let i=e.node.cursor();i.firstChild();do zf(i,t);while(i.nextSibling());break}}}var i4=St.mark({class:"mo-cm-reactive-reference"});X_=St.mark({class:"mo-cm-reactive-reference-hover"});var P1=Ln.define(),o4=class{constructor(e,t){ae(this,"highlightDebounceMs",300);this.view=e,this.cellId=t,this.scheduleHighlighting=Mh(()=>{this.runHighlighting()},this.highlightDebounceMs),this.variablesUnsubscribe=Te.sub(li,()=>{this.scheduleHighlighting()}),this.scheduleHighlighting()}update(e){(e.docChanged||e.focusChanged)&&this.scheduleHighlighting()}destroy(){this.scheduleHighlighting.cancel(),this.variablesUnsubscribe()}runHighlighting(){let e=t4({state:this.view.state,cellId:this.cellId,variables:Te.get(li)});e.length>0&&be.debug(`Found ${e.length} reactive variables in cell ${this.cellId}`),queueMicrotask(()=>{this.view.dispatch({effects:P1.of(e)})})}};Bd=Cr.define({create(){return{decorations:St.none,ranges:[]}},update(e,t){let r={decorations:e.decorations.map(t.changes),ranges:e.ranges};for(let i of t.effects)i.is(P1)&&(r={decorations:St.set(i.value.map(l=>i4.range(l.from,l.to))),ranges:i.value});return r},provide:e=>ot.decorations.from(e,t=>t.decorations)});function l4(e){return[Bd,Un.define(t=>new o4(t,e))]}fk=function(e,t){return t?l4(e):[]};function N1(e,t=!1){if(!e)return null;let r=document.createElement("span");if(r.classList.add("mo-cm-tooltip"),r.classList.add("docs-documentation"),t&&r.classList.add("cm-tooltip-section"),r.style.display="flex",r.style.flexDirection="column",r.style.gap=".8rem",r.innerHTML=e,t){let i=document.createElement("div");i.classList.add("text-xs","text-muted-foreground","font-medium","pt-1","-mt-2","border-t","border-border");let l=document.createElement("kbd");l.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",l.textContent=k8()?"\u2318":"Ctrl",i.append(document.createTextNode("Jump to defining cell ")),i.append(l),i.append(document.createTextNode(" + Click")),r.append(i)}return r}xd=new wl("autocomplete-result",async(e,t)=>{let{sendCodeCompletionRequest:r}=Kn();await r({id:e,...t})});var s4={param:3,property:2};const Ff={asCompletionResult(e,t){return{from:e-t.prefix_length,options:t.options.map(r=>({label:r.name,type:r.type,boost:s4[r.type]??1,info:()=>N1(r.completion_info)})),validFor:/^\w*$/}},asHoverTooltip({position:e,message:t,limitToType:r,excludeTypes:i,exactName:l,showGoToDefinitionHint:c=!1}){let d=c4(t.options,l);if(!d)return;let f=e-t.prefix_length,h=N1(d.completion_info,c);if(h&&!(r&&d.type!==r)&&!(i!=null&&i.includes(d.type)))return{pos:f,html:d.completion_info,end:f+d.name.length,above:!0,create:()=>({dom:h,resize:!1})}}};function c4(e,t){if(e.length!==0){if(e.length===1)return e[0];if(t)return e.find(r=>r.name===t)}}kk=function(e){var t,r,i,l;return[(t=e==null?void 0:e.pylsp)!=null&&t.enabled&&Ea("pylsp")||(r=e==null?void 0:e.ty)!=null&&r.enabled&&Ea("ty")||(i=e==null?void 0:e.pyrefly)!=null&&i.enabled&&Ea("pyrefly")||(l=e==null?void 0:e.basedpyright)!=null&&l.enabled&&Ea("basedpyright")?[]:zh(async(c,d)=>{let f=await j1({view:c,pos:d,excludeTypes:["tooltip"]});return f===null||f==="cancelled"?null:f},{hideOnChange:!0}),f4]};async function j1({view:e,pos:t,excludeTypes:r}){var x;let i=Dn.findElement(e.dom);if(!i)return be.error("Failed to find active cell."),null;let l=Dn.parse(i.id),{startToken:c,endToken:d}=qf(e.state.doc,t),f=((x=e.state.field(Bd,!1))==null?void 0:x.ranges.some(C=>t>=C.from&&t<=C.to))??!1,h=await xd.request({document:e.state.doc.slice(0,d).toString(),cellId:l});if(!h)return"cancelled";let b=e.state.doc.slice(c,d).toString();return Ff.asHoverTooltip({position:d,message:h,exactName:b,excludeTypes:r,showGoToDefinitionHint:f})??null}function qf(e,t){let r=t,i=r>0?e.sliceString(r-1,r):"",l=r<e.length?e.sliceString(r,r+1):"";i==="("&&l===")"&&--r;let c=r,d=r;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 u4(e){let{head:t}=e.selection.main,r=e.doc.sliceString(t-1,t);return/\w/.test(r)}var d4=Mh(async(e,t)=>{if(Te.get(Js).selectedPanel!=="documentation")return;let r=await j1({view:e,pos:t});r!=="cancelled"&&Te.set(_d,{documentation:(r==null?void 0:r.html)??null})},300),f4=ot.updateListener.of(e=>{if(e.selectionSet&&u4(e.state)){let t=e.state.selection.main.head;d4(e.view,t)}});function p4(e){var t=e.Pos;function r(u,m,y){if(m.line===y.line&&m.ch>=y.ch-1){var v=u.getLine(m.line).charCodeAt(m.ch);55296<=v&&v<=55551&&(y.ch+=1)}return{start:m,end:y}}var i=[{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"}],l=Object.create(null),c=i.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=Ao("");function h(u){u.setOption("disableInput",!0),u.setOption("showCursorWhenSelecting",!1),e.signal(u,"vim-mode-change",{mode:"normal"}),u.on("cursorActivity",zo),le(u),e.on(u.getInputField(),"paste",x(u))}function b(u){u.setOption("disableInput",!1),u.off("cursorActivity",zo),e.off(u.getInputField(),"paste",x(u)),u.state.vim=null,Fa&&clearTimeout(Fa)}function x(u){var m=u.state.vim;return m.onPasteFn||(m.onPasteFn=function(){m.insertMode||(u.setCursor(Tt(u.getCursor(),0,1)),Hr.enterInsertMode(u,{},m))}),m.onPasteFn}var C=/[\d]/,S=[e.isWordChar,function(u){return u&&!e.isWordChar(u)&&!/\s/.test(u)}],E=[function(u){return/\S/.test(u)}],A=["<",">"],R=["-",'"',".",":","_","/","+"],j=/^\w$/,q=/^[A-Z]$/;try{q=RegExp("^[\\p{Lu}]$","u")}catch{}function V(u,m){return m>=u.firstLine()&&m<=u.lastLine()}function z(u){return/^[a-z]$/.test(u)}function X(u){return"()[]{}".indexOf(u)!=-1}function fe(u){return C.test(u)}function F(u){return q.test(u)}function H(u){return/^\s*$/.test(u)}function te(u){return".?!".indexOf(u)!=-1}function me(u,m){for(var y=0;y<m.length;y++)if(m[y]==u)return!0;return!1}var ve={};function _e(u,m,y,v,w){if(m===void 0&&!w)throw Error("defaultValue is required unless callback is provided");if(y||(y="string"),ve[u]={type:y,defaultValue:m,callback:w},v)for(var _=0;_<v.length;_++)ve[v[_]]=ve[u];m&&ke(u,m)}function ke(u,m,y,v){var w=ve[u];v||(v={});var _=v.scope;if(!w)return Error("Unknown option: "+u);if(w.type=="boolean"){if(m&&m!==!0)return Error("Invalid argument: "+u+"="+m);m!==!1&&(m=!0)}w.callback?(_!=="local"&&w.callback(m,void 0),_!=="global"&&y&&w.callback(m,y)):(_!=="local"&&(w.value=w.type=="boolean"?!!m:m),_!=="global"&&y&&(y.state.vim.options[u]={value:m}))}function oe(u,m,y){var v=ve[u];y||(y={});var w=y.scope;if(!v)return Error("Unknown option: "+u);if(v.callback){let _=m&&v.callback(void 0,m);return w!=="global"&&_!==void 0?_:w==="local"?void 0:v.callback()}else return(w!=="global"&&m&&m.state.vim.options[u]||w!=="local"&&v||{}).value}_e("filetype",void 0,"string",["ft"],function(u,m){if(m!==void 0)if(u===void 0){let y=m.getOption("mode");return y=="null"?"":y}else{let y=u==""?"null":u;m.setOption("mode",y)}}),_e("textwidth",80,"number",["tw"],function(u,m){if(m!==void 0){if(u===void 0)return m.getOption("textwidth");var y=Math.round(u);y>1&&m.setOption("textwidth",y)}});var ce=function(){var u=100,m=-1,y=0,v=0,w=Array(u);function _(D,P,M){var Z=w[m%u];function Y(U){var ge=++m%u,he=w[ge];he&&he.clear(),w[ge]=D.setBookmark(U)}if(Z){var W=Z.find();W&&!yt(W,P)&&Y(P)}else Y(P);Y(M),y=m,v=m-u+1,v<0&&(v=0)}function T(D,P){m+=P,m>y?m=y:m<v&&(m=v);var M=w[(u+m)%u];if(M&&!M.find()){var Z=P>0?1:-1,Y,W=D.getCursor();do if(m+=Z,M=w[(u+m)%u],M&&(Y=M.find())&&!yt(W,Y))break;while(m<y&&m>v)}return M}function L(D,P){var M=m,Z=T(D,P);return m=M,Z&&Z.find()}return{cachedCursor:void 0,add:_,find:L,move:T}},ye=function(u){return u?{changes:u.changes,expectCursorActivityForChange:u.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class ie{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=ye()}exitMacroRecordMode(){var m=K.macroModeState;m.onRecordingDone&&m.onRecordingDone(),m.onRecordingDone=void 0,m.isRecording=!1}enterMacroRecordMode(m,y){var v=K.registerController.getRegister(y);if(v){if(v.clear(),this.latestRegister=y,m.openDialog){var w=cn("span",{class:"cm-vim-message"},"recording @"+y);this.onRecordingDone=m.openDialog(w,function(){},{bottom:!0})}this.isRecording=!0}}}function le(u){return u.state.vim||(u.state.vim={inputState:new Kl,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 t(0,0),head:new t(0,0)},options:{},expectLiteralNext:!1,status:""}),u.state.vim}var K;function Le(){for(var u in K={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:ce(),macroModeState:new ie,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new $c({}),searchHistoryController:new Lo,exCommandHistoryController:new Lo},ve){var m=ve[u];m.value=m.defaultValue}}class Pe{constructor(m,y){this.keyName=m,this.key=y.key,this.ctrlKey=y.ctrlKey,this.altKey=y.altKey,this.metaKey=y.metaKey,this.shiftKey=y.shiftKey}}var Ke,Ve={enterVimMode:h,leaveVimMode:b,buildKeyMap:function(){},getRegisterController:function(){return K.registerController},resetVimGlobalState_:Le,getVimGlobalState_:function(){return K},maybeInitVimState_:le,suppressErrorLogging:!1,InsertModeKey:Pe,map:function(u,m,y){Gt.map(u,m,y)},unmap:function(u,m){return Gt.unmap(u,m)},noremap:function(u,m,y){Gt.map(u,m,y,!0)},mapclear:function(u){var m=i.length,y=c,v=i.slice(0,m-y);if(i=i.slice(m-y),u)for(var w=v.length-1;w>=0;w--){var _=v[w];if(u!==_.context)if(_.context)this._mapCommand(_);else{var T=["normal","insert","visual"];for(var L in T)if(T[L]!==u){var D=Object.assign({},_);D.context=T[L],this._mapCommand(D)}}}},langmap:ki,vimKeyFromEvent:Br,setOption:ke,getOption:oe,defineOption:_e,defineEx:function(u,m,y){if(!m)m=u;else if(u.indexOf(m)!==0)throw Error('(Vim.defineEx) "'+m+'" is not a prefix of "'+u+'", command not registered');tr[u]=y,Gt.commandMap_[m]={name:u,shortName:m,type:"api"}},handleKey:function(u,m,y){var v=this.findKey(u,m,y);if(typeof v=="function")return v()},multiSelectHandleKey:Xr,findKey:function(u,m,y){var v=le(u),w=u;function _(){var M=K.macroModeState;if(M.isRecording){if(m=="q")return M.exitMacroRecordMode(),gt(w),!0;y!="mapping"&&vr(M,m)}}function T(){if(m=="<Esc>"){if(v.visualMode)Nn(w);else if(v.insertMode)hn(w);else return;return gt(w),!0}}function L(){if(T())return!0;v.inputState.keyBuffer.push(m);var M=v.inputState.keyBuffer.join(""),Z=m.length==1,Y=gr.matchCommand(M,i,v.inputState,"insert"),W=v.inputState.changeQueue;if(Y.type=="none")return gt(w),!1;if(Y.type=="partial"){if(Y.expectLiteralNext&&(v.expectLiteralNext=!0),Ke&&window.clearTimeout(Ke),Ke=Z&&window.setTimeout(function(){v.insertMode&&v.inputState.keyBuffer.length&>(w)},oe("insertModeEscKeysTimeout")),Z){var U=w.listSelections();(!W||W.removed.length!=U.length)&&(W=v.inputState.changeQueue=new Ql),W.inserted+=m;for(var ge=0;ge<U.length;ge++){var he=Zt(U[ge].anchor,U[ge].head),Re=Dr(U[ge].anchor,U[ge].head),Ce=w.getRange(he,w.state.overwrite?Tt(Re,0,1):Re);W.removed[ge]=(W.removed[ge]||"")+Ce}}return!Z}else Y.type=="full"&&(v.inputState.keyBuffer.length=0);if(v.expectLiteralNext=!1,Ke&&window.clearTimeout(Ke),Y.command&&W){for(var U=w.listSelections(),ge=0;ge<U.length;ge++){var Oe=U[ge].head;w.replaceRange(W.removed[ge]||"",Tt(Oe,0,-W.inserted.length),Oe,"+input")}K.macroModeState.lastInsertModeChanges.changes.pop()}return Y.command||gt(w),Y.command}function D(){if(_()||T())return!0;v.inputState.keyBuffer.push(m);var M=v.inputState.keyBuffer.join("");if(/^[1-9]\d*$/.test(M))return!0;var Z=/^(\d*)(.*)$/.exec(M);if(!Z)return gt(w),!1;var Y=v.visualMode?"visual":"normal",W=Z[2]||Z[1];v.inputState.operatorShortcut&&v.inputState.operatorShortcut.slice(-1)==W&&(W=v.inputState.operatorShortcut);var U=gr.matchCommand(W,i,v.inputState,Y);return U.type=="none"?(gt(w),!1):U.type=="partial"?(U.expectLiteralNext&&(v.expectLiteralNext=!0),!0):U.type=="clear"?(gt(w),!0):(v.expectLiteralNext=!1,v.inputState.keyBuffer.length=0,Z=/^(\d*)(.*)$/.exec(M),Z&&Z[1]&&Z[1]!="0"&&v.inputState.pushRepeatDigit(Z[1]),U.command)}var P=v.insertMode?L():D();if(P===!1)return!v.insertMode&&(m.length===1||e.isMac&&/<A-.>/.test(m))?function(){return!0}:void 0;if(P===!0)return function(){return!0};if(P)return function(){return w.operation(function(){w.curOp.isVimOp=!0;try{if(typeof P!="object")return;P.type=="keyToKey"?jt(w,P.toKeys,P):gr.processCommand(w,v,P)}catch(M){throw w.state.vim=void 0,le(w),Ve.suppressErrorLogging||console.log(M),M}return!0})}},handleEx:function(u,m){Gt.processCommand(u,m)},defineMotion:Dp,defineAction:Bc,defineOperator:Op,mapCommand:ru,_mapCommand:Rr,defineRegister:Lp,exitVisualMode:Nn,exitInsertMode:hn},je=[],De=!1,ze;function Dt(u){if(!ze)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=`
|
|
61
|
+
`;else if(Pn[m]){var y=ze.value||"",v={key:Pn[m],target:{value:y,selectionEnd:y.length,selectionStart:y.length}};ze.onKeyDown&&ze.onKeyDown(v,ze.value,_),ze&&ze.onKeyUp&&ze.onKeyUp(v,ze.value,_);return}}if(u==`
|
|
62
|
+
`){var w=ze;ze=null,w.onClose&&w.onClose(w.value)}else ze.value=(ze.value||"")+u;function _(T){ze&&(typeof T=="string"?ze.value=T:ze=null)}}function jt(u,m,y){var v=De;if(y){if(je.indexOf(y)!=-1)return;je.push(y),De=y.noremap!=0}try{for(var w=le(u),_=/<(?:[CSMA]-)*\w+>|./gi,T;T=_.exec(m);){var L=T[0],D=w.insertMode;if(ze){Dt(L);continue}if(!Ve.handleKey(u,L,"mapping")&&D&&w.insertMode){if(L[0]=="<"){var P=L.toLowerCase().slice(1,-1);if(P=P.split("-").pop()||"",P=="lt")L="<";else if(P=="space")L=" ";else if(P=="cr")L=`
|
|
63
|
+
`;else if(Pn.hasOwnProperty(P)){L=Pn[P],Pi(u,L);continue}else L=L[0],_.lastIndex=T.index+1}u.replaceSelection(L)}}}finally{if(je.pop(),De=je.length?v:!1,!je.length&&ze){var M=ze;ze=null,ja(u,M)}}}var La={Return:"CR",Backspace:"BS",Delete:"Del",Escape:"Esc",Insert:"Ins",ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"CR"," ":"Space"},Io={Shift:1,Alt:1,Command:1,Control:1,CapsLock:1,AltGraph:1,Dead:1,Unidentified:1},Pn={};"Left|Right|Up|Down|End|Home".split("|").concat(Object.keys(La)).forEach(function(u){Pn[(La[u]||"").toLowerCase()]=Pn[u.toLowerCase()]=u});function Br(u,m){var _;var y=u.key;if(!Io[y]){y.length>1&&y[0]=="n"&&(y=y.replace("Numpad","")),y=La[y]||y;var v="";if(u.ctrlKey&&(v+="C-"),u.altKey&&(v+="A-"),u.metaKey&&(v+="M-"),e.isMac&&v=="A-"&&y.length==1&&(v=v.slice(2)),(v||y.length>1)&&u.shiftKey&&(v+="S-"),m&&!m.expectLiteralNext&&y.length==1){if(f.keymap&&y in f.keymap)(f.remapCtrl!=0||!v)&&(y=f.keymap[y]);else if(y.charCodeAt(0)>128&&!l[y]){var w=((_=u.code)==null?void 0:_.slice(-1))||"";u.shiftKey||(w=w.toLowerCase()),w&&(y=w,!v&&u.altKey&&(v="A-"))}}return v+=y,v.length>1&&(v="<"+v+">"),v}}function ki(u,m){f.string!==u&&(f=Ao(u)),f.remapCtrl=m}function Ao(u){let m={};if(!u)return{keymap:m,string:""};function y(v){return v.split(/\\?(.)/).filter(Boolean)}return u.split(/((?:[^\\,]|\\.)+),/).map(v=>{if(!v)return;let w=v.split(/((?:[^\\;]|\\.)+);/);if(w.length==3){let _=y(w[1]),T=y(w[2]);if(_.length!==T.length)return;for(let L=0;L<_.length;++L)m[_[L]]=T[L]}else if(w.length==1){let _=y(v);if(_.length%2!=0)return;for(let T=0;T<_.length;T+=2)m[_[T]]=_[T+1]}}),{keymap:m,string:u}}_e("langmap",void 0,"string",["lmap"],function(u,m){if(u===void 0)return f.string;ki(u)});class Kl{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 gt(u,m){u.state.vim.inputState=new Kl,u.state.vim.expectLiteralNext=!1,e.signal(u,"vim-command-done",m)}function Ql(){this.removed=[],this.inserted=""}class _n{constructor(m,y,v){this.clear(),this.keyBuffer=[m||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!y,this.blockwise=!!v}setText(m,y,v){this.keyBuffer=[m||""],this.linewise=!!y,this.blockwise=!!v}pushText(m,y){y&&(this.linewise||this.keyBuffer.push(`
|
|
64
|
+
`),this.linewise=!0),this.keyBuffer.push(m)}pushInsertModeChanges(m){this.insertModeChanges.push(ye(m))}pushSearchQuery(m){this.searchQueries.push(m)}clear(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1}toString(){return this.keyBuffer.join("")}}function Lp(u,m){var y=K.registerController.registers;if(!u||u.length!=1)throw Error("Register name must be 1 character");if(y[u])throw Error("Register already defined "+u);y[u]=m,R.push(u)}class $c{constructor(m){this.registers=m,this.unnamedRegister=m['"']=new _n,m["."]=new _n,m[":"]=new _n,m["/"]=new _n,m["+"]=new _n}pushText(m,y,v,w,_){if(m!=="_"){w&&v.charAt(v.length-1)!==`
|
|
65
|
+
`&&(v+=`
|
|
66
|
+
`);var T=this.isValidRegister(m)?this.getRegister(m):null;if(!T||!m){switch(y){case"yank":this.registers[0]=new _n(v,w,_);break;case"delete":case"change":v.indexOf(`
|
|
67
|
+
`)==-1?this.registers["-"]=new _n(v,w):(this.shiftNumericRegisters_(),this.registers[1]=new _n(v,w));break}this.unnamedRegister.setText(v,w,_);return}F(m)?T.pushText(v,w):T.setText(v,w,_),m==="+"&&navigator.clipboard.writeText(v),this.unnamedRegister.setText(T.toString(),w)}}getRegister(m){return this.isValidRegister(m)?(m=m.toLowerCase(),this.registers[m]||(this.registers[m]=new _n),this.registers[m]):this.unnamedRegister}isValidRegister(m){return m&&(me(m,R)||j.test(m))}shiftNumericRegisters_(){for(var m=9;m>=2;m--)this.registers[m]=this.getRegister(""+(m-1))}}class Lo{constructor(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}nextMatch(m,y){var v=this.historyBuffer,w=y?-1:1;this.initialPrefix===null&&(this.initialPrefix=m);for(var _=this.iterator+w;y?_>=0:_<v.length;_+=w)for(var T=v[_],L=0;L<=T.length;L++)if(this.initialPrefix==T.substring(0,L))return this.iterator=_,T;if(_>=v.length)return this.iterator=v.length,this.initialPrefix;if(_<0)return m}pushInput(m){var y=this.historyBuffer.indexOf(m);y>-1&&this.historyBuffer.splice(y,1),m.length&&this.historyBuffer.push(m)}reset(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}}var gr={matchCommand:function(u,m,y,v){var w=Mp(u,m,v,y),_=w.full[0];if(!_)return w.partial.length?{type:"partial",expectLiteralNext:w.partial.length==1&&w.partial[0].keys.slice(-11)=="<character>"}:{type:"none"};if(_.keys.slice(-11)=="<character>"||_.keys.slice(-10)=="<register>"){var T=Ci(u);if(!T||T.length>1)return{type:"clear"};y.selectedCharacter=T}return{type:"full",command:_}},processCommand:function(u,m,y){switch(m.inputState.repeatOverride=y.repeatOverride,y.type){case"motion":this.processMotion(u,m,y);break;case"operator":this.processOperator(u,m,y);break;case"operatorMotion":this.processOperatorMotion(u,m,y);break;case"action":this.processAction(u,m,y);break;case"search":this.processSearch(u,m,y);break;case"ex":case"keyToEx":this.processEx(u,m,y);break}},processMotion:function(u,m,y){m.inputState.motion=y.motion,m.inputState.motionArgs=Do(y.motionArgs),this.evalInput(u,m)},processOperator:function(u,m,y){var v=m.inputState;if(v.operator)if(v.operator==y.operator){v.motion="expandToLine",v.motionArgs={linewise:!0,repeat:1},this.evalInput(u,m);return}else gt(u);v.operator=y.operator,v.operatorArgs=Do(y.operatorArgs),y.keys.length>1&&(v.operatorShortcut=y.keys),y.exitVisualBlock&&(m.visualBlock=!1,Ur(u)),m.visualMode&&this.evalInput(u,m)},processOperatorMotion:function(u,m,y){var v=m.visualMode,w=Do(y.operatorMotionArgs);w&&v&&w.visualLine&&(m.visualLine=!0),this.processOperator(u,m,y),v||this.processMotion(u,m,y)},processAction:function(u,m,y){var v=m.inputState,w=v.getRepeat(),_=!!w,T=Do(y.actionArgs)||{repeat:1};v.selectedCharacter&&(T.selectedCharacter=v.selectedCharacter),y.operator&&this.processOperator(u,m,y),y.motion&&this.processMotion(u,m,y),(y.motion||y.operator)&&this.evalInput(u,m),T.repeat=w||1,T.repeatIsExplicit=_,T.registerName=v.registerName,gt(u),m.lastMotion=null,y.isEdit&&this.recordLastEdit(m,v,y),Hr[y.action](u,T,m)},processSearch:function(u,m,y){if(!u.getSearchCursor)return;var v=y.searchArgs.forward,w=y.searchArgs.wholeWordOnly;Cn(u).setReversed(!v);var _=v?"/":"?",T=Cn(u).getQuery(),L=u.getScrollInfo(),D="";function P(Ce,Oe,et){K.searchHistoryController.pushInput(Ce),K.searchHistoryController.reset();try{Kr(u,Ce,Oe,et)}catch{Ze(u,"Invalid regex: "+Ce),gt(u);return}gr.processMotion(u,m,{keys:"",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:y.searchArgs.toJumplist}})}function M(Ce){u.scrollTo(L.left,L.top),P(Ce,!0,!0);var Oe=K.macroModeState;Oe.isRecording&&Oi(Oe,Ce)}function Z(){return oe("pcre")?"(JavaScript regexp: set pcre)":"(Vim regexp: set nopcre)"}function Y(Ce,Oe,et){var Be=Br(Ce),ft,vt;Be=="<Up>"||Be=="<Down>"?(ft=Be=="<Up>",vt=Ce.target?Ce.target.selectionEnd:0,Oe=K.searchHistoryController.nextMatch(Oe,ft)||"",et(Oe),vt&&Ce.target&&(Ce.target.selectionEnd=Ce.target.selectionStart=Math.min(vt,Ce.target.value.length))):Be&&Be!="<Left>"&&Be!="<Right>"&&K.searchHistoryController.reset(),D=Oe,W()}function W(){var Ce;try{Ce=Kr(u,D,!0,!0)}catch{}Ce?u.scrollIntoView(Qr(u,!v,Ce),30):(Gr(u),u.scrollTo(L.left,L.top))}function U(Ce,Oe,et){var Be=Br(Ce);Be=="<Esc>"||Be=="<C-c>"||Be=="<C-[>"||Be=="<BS>"&&Oe==""?(K.searchHistoryController.pushInput(Oe),K.searchHistoryController.reset(),Kr(u,(T==null?void 0:T.source)||""),Gr(u),u.scrollTo(L.left,L.top),e.e_stop(Ce),gt(u),et(),u.focus()):Be=="<Up>"||Be=="<Down>"?e.e_stop(Ce):Be=="<C-u>"&&(e.e_stop(Ce),et(""))}switch(y.searchArgs.querySrc){case"prompt":var ge=K.macroModeState;ge.isPlaying?P(ge.replaySearchQueries.shift()||"",!0,!1):ja(u,{onClose:M,prefix:_,desc:cn("span",{$cursor:"pointer",onmousedown:function(Oe){Oe.preventDefault(),ke("pcre",!oe("pcre")),this.textContent=Z(),W()}},Z()),onKeyUp:Y,onKeyDown:U});break;case"wordUnderCursor":var he=er(u,{noSymbol:!0}),Re=!0;if(he||(he=er(u,{noSymbol:!1}),Re=!1),!he){Ze(u,"No word under cursor"),gt(u);return}let Ce=u.getLine(he.start.line).substring(he.start.ch,he.end.ch);Ce=Re&&w?"\\b"+Ce+"\\b":Wr(Ce),K.jumpList.cachedCursor=u.getCursor(),u.setCursor(he.start),P(Ce,!0,!1);break}},processEx:function(u,m,y){function v(L){K.exCommandHistoryController.pushInput(L),K.exCommandHistoryController.reset(),Gt.processCommand(u,L),u.state.vim&>(u),Gr(u)}function w(L,D,P){var M=Br(L),Z,Y;(M=="<Esc>"||M=="<C-c>"||M=="<C-[>"||M=="<BS>"&&D=="")&&(K.exCommandHistoryController.pushInput(D),K.exCommandHistoryController.reset(),e.e_stop(L),gt(u),Gr(u),P(),u.focus()),M=="<Up>"||M=="<Down>"?(e.e_stop(L),Z=M=="<Up>",Y=L.target?L.target.selectionEnd:0,D=K.exCommandHistoryController.nextMatch(D,Z)||"",P(D),Y&&L.target&&(L.target.selectionEnd=L.target.selectionStart=Math.min(Y,L.target.value.length))):M=="<C-u>"?(e.e_stop(L),P("")):M&&M!="<Left>"&&M!="<Right>"&&K.exCommandHistoryController.reset()}function _(L,D){var P=new e.StringStream(D),M={};try{if(Gt.parseInput_(u,P,M),M.commandName!="s"){Gr(u);return}var Z=Gt.matchCommand_(M.commandName);if(!Z||(Gt.parseCommandArgs_(P,M,Z),!M.argString))return;var Y=ts(M.argString.slice(1),!0,!0);Y&&Po(u,Y)}catch{}}if(y.type=="keyToEx")Gt.processCommand(u,y.exArgs.input);else{var T={onClose:v,onKeyDown:w,onKeyUp:_,prefix:":"};m.visualMode&&(T.value="'<,'>",T.selectValueOnOpen=!1),ja(u,T)}},evalInput:function(u,m){var y=m.inputState,v=y.motion,w=y.motionArgs||{repeat:1},_=y.operator,T=y.operatorArgs||{},L=y.registerName,D=m.sel,P=Xe(m.visualMode?zt(u,D.head):u.getCursor("head")),M=Xe(m.visualMode?zt(u,D.anchor):u.getCursor("anchor")),Z=Xe(P),Y=Xe(M),W,U,ge;if(_&&this.recordLastEdit(m,y),ge=y.repeatOverride===void 0?y.getRepeat():y.repeatOverride,ge>0&&w.explicitRepeat?w.repeatIsExplicit=!0:(w.noRepeat||!w.explicitRepeat&&ge===0)&&(ge=1,w.repeatIsExplicit=!1),y.selectedCharacter&&(w.selectedCharacter=T.selectedCharacter=y.selectedCharacter),w.repeat=ge,gt(u),v){var he=kn[v](u,P,w,m,y);if(m.lastMotion=kn[v],!he)return;if(w.toJumplist){var Re=K.jumpList,Ce=Re.cachedCursor;Ce?(en(u,Ce,he),delete Re.cachedCursor):en(u,P,he)}he instanceof Array?(U=he[0],W=he[1]):W=he,W||(W=Xe(P)),m.visualMode?(m.visualBlock&&W.ch===1/0||(W=zt(u,W,Z)),U&&(U=zt(u,U)),U||(U=Y),D.anchor=U,D.head=W,Ur(u),pn(u,m,"<",_t(U,W)?U:W),pn(u,m,">",_t(U,W)?W:U)):_||(W=zt(u,W,Z),u.setCursor(W.line,W.ch))}if(_){if(T.lastSel){U=Y;var Oe=T.lastSel,et=Math.abs(Oe.head.line-Oe.anchor.line),Be=Math.abs(Oe.head.ch-Oe.anchor.ch);W=Oe.visualLine?new t(Y.line+et,Y.ch):Oe.visualBlock?new t(Y.line+et,Y.ch+Be):Oe.head.line==Oe.anchor.line?new t(Y.line,Y.ch+Be):new t(Y.line+et,Y.ch),m.visualMode=!0,m.visualLine=Oe.visualLine,m.visualBlock=Oe.visualBlock,D=m.sel={anchor:U,head:W},Ur(u)}else m.visualMode&&(T.lastSel={anchor:Xe(D.anchor),head:Xe(D.head),visualBlock:m.visualBlock,visualLine:m.visualLine});var ft,vt,Fe,Ne,kt;if(m.visualMode){ft=Zt(D.head,D.anchor),vt=Dr(D.head,D.anchor),Fe=m.visualLine||T.linewise,Ne=m.visualBlock?"block":Fe?"line":"char";var Ft=r(u,ft,vt);if(kt=Mo(u,{anchor:Ft.start,head:Ft.end},Ne),Fe){var Wt=kt.ranges;if(Ne=="block")for(var Ni=0;Ni<Wt.length;Ni++)Wt[Ni].head.ch=Ot(u,Wt[Ni].head.line);else Ne=="line"&&(Wt[0].head=new t(Wt[0].head.line+1,0))}}else{if(ft=Xe(U||Y),vt=Xe(W||Z),_t(vt,ft)){var au=ft;ft=vt,vt=au}Fe=w.linewise||T.linewise,Fe?Kc(u,ft,vt):w.forward&&Xl(u,ft,vt),Ne="char";var iu=!w.inclusive||Fe,Ft=r(u,ft,vt);kt=Mo(u,{anchor:Ft.start,head:Ft.end},Ne,iu)}u.setSelections(kt.ranges,kt.primary),m.lastMotion=null,T.repeat=ge,T.registerName=L,T.linewise=Fe;var Fo=Jt[_](u,T,kt.ranges,Y,W);m.visualMode&&Nn(u,Fo!=null),Fo&&u.setCursor(Fo)}},recordLastEdit:function(u,m,y){var v=K.macroModeState;v.isPlaying||(u.lastEditInputState=m,u.lastEditActionCommand=y,v.lastInsertModeChanges.changes=[],v.lastInsertModeChanges.expectCursorActivityForChange=!1,v.lastInsertModeChanges.visualBlock=u.visualBlock?u.sel.head.line-u.sel.anchor.line:0)}},kn={moveToTopLine:function(u,m,y){var v=Li(u).top+y.repeat-1;return new t(v,jn(u.getLine(v)))},moveToMiddleLine:function(u){var m=Li(u),y=Math.floor((m.top+m.bottom)*.5);return new t(y,jn(u.getLine(y)))},moveToBottomLine:function(u,m,y){var v=Li(u).bottom-y.repeat+1;return new t(v,jn(u.getLine(v)))},expandToLine:function(u,m,y){return new t(m.line+y.repeat-1,1/0)},findNext:function(u,m,y){var v=Cn(u),w=v.getQuery();if(w){var _=!y.forward;_=v.isReversed()?!_:_,Po(u,w);var T=Qr(u,_,w,y.repeat);return T||Ze(u,"No match found "+w+(oe("pcre")?" (set nopcre to use Vim regexps)":"")),T}},findAndSelectNextInclusive:function(u,m,y,v,w){var _=Cn(u),T=_.getQuery();if(T){var L=!y.forward;L=_.isReversed()?!L:L;var D=Fp(u,L,T,y.repeat,v);if(D){if(w.operator)return D;var P=D[0],M=new t(D[1].line,D[1].ch-1);if(v.visualMode){(v.visualLine||v.visualBlock)&&(v.visualLine=!1,v.visualBlock=!1,e.signal(u,"vim-mode-change",{mode:"visual",subMode:""}));var Z=v.sel.anchor;if(Z)return _.isReversed()?y.forward?[Z,P]:[Z,M]:y.forward?[Z,M]:[Z,P]}else v.visualMode=!0,v.visualLine=!1,v.visualBlock=!1,e.signal(u,"vim-mode-change",{mode:"visual",subMode:""});return L?[M,P]:[P,M]}}},goToMark:function(u,m,y,v){var w=No(u,v,y.selectedCharacter||"");return w?y.linewise?{line:w.line,ch:jn(u.getLine(w.line))}:w:null},moveToOtherHighlightedEnd:function(u,m,y,v){var w=v.sel;return v.visualBlock&&y.sameLine?[zt(u,new t(w.anchor.line,w.head.ch)),zt(u,new t(w.head.line,w.anchor.ch))]:[w.head,w.anchor]},jumpToMark:function(u,m,y,v){for(var w=m,_=0;_<y.repeat;_++){var T=w;for(var L in v.marks)if(z(L)){var D=v.marks[L].find();if(!(y.forward?_t(D,T):_t(T,D))&&!(y.linewise&&D.line==T.line)){var P=yt(T,w),M=y.forward?Si(T,D,w):Si(w,D,T);(P||M)&&(w=D)}}}return y.linewise&&(w=new t(w.line,jn(u.getLine(w.line)))),w},moveByCharacters:function(u,m,y){var v=m,w=y.repeat,_=y.forward?v.ch+w:v.ch-w;return new t(v.line,_)},moveByLines:function(u,m,y,v){var w=m,_=w.ch;switch(v.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:_=v.lastHPos;break;default:v.lastHPos=_}var T=y.repeat+(y.repeatOffset||0),L=y.forward?w.line+T:w.line-T,D=u.firstLine(),P=u.lastLine(),M=u.findPosV(w,y.forward?T:-T,"line",v.lastHSPos);return(y.forward?M.line>L:M.line<L)&&(L=M.line,_=M.ch),L<D&&w.line==D?this.moveToStartOfLine(u,m,y,v):L>P&&w.line==P?Ro(u,m,y,v,!0):(y.toFirstChar&&(_=jn(u.getLine(L)),v.lastHPos=_),v.lastHSPos=u.charCoords(new t(L,_),"div").left,new t(L,_))},moveByDisplayLines:function(u,m,y,v){var w=m;switch(v.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:v.lastHSPos=u.charCoords(w,"div").left}var _=y.repeat,T=u.findPosV(w,y.forward?_:-_,"line",v.lastHSPos);if(T.hitSide)if(y.forward){var L={top:u.charCoords(T,"div").top+8,left:v.lastHSPos};T=u.coordsChar(L,"div")}else{var D=u.charCoords(new t(u.firstLine(),0),"div");D.left=v.lastHSPos,T=u.coordsChar(D,"div")}return v.lastHPos=T.ch,T},moveByPage:function(u,m,y){var v=m,w=y.repeat;return u.findPosV(v,y.forward?w:-w,"page")},moveByParagraph:function(u,m,y){var v=y.forward?1:-1;return Mt(u,m,y.repeat,v).start},moveBySentence:function(u,m,y){var v=y.forward?1:-1;return Gc(u,m,y.repeat,v)},moveByScroll:function(u,m,y,v){var w=u.getScrollInfo(),_=null,T=y.repeat;T||(T=w.clientHeight/(2*u.defaultTextHeight()));var L=u.charCoords(m,"local");if(y.repeat=T,_=kn.moveByDisplayLines(u,m,y,v),!_)return null;var D=u.charCoords(_,"local");return u.scrollTo(null,w.top+D.top-L.top),_},moveByWords:function(u,m,y){return Ti(u,m,y.repeat,!!y.forward,!!y.wordEnd,!!y.bigWord)},moveTillCharacter:function(u,m,y){var v=y.repeat,w=Or(u,v,y.forward,y.selectedCharacter,m),_=y.forward?-1:1;return Ma(_,y),w?(w.ch+=_,w):null},moveToCharacter:function(u,m,y){var v=y.repeat;return Ma(0,y),Or(u,v,y.forward,y.selectedCharacter,m)||m},moveToSymbol:function(u,m,y){var v=y.repeat;return y.selectedCharacter&&Np(u,v,y.forward,y.selectedCharacter)||m},moveToColumn:function(u,m,y,v){var w=y.repeat;return v.lastHPos=w-1,v.lastHSPos=u.charCoords(m,"div").left,Ra(u,w)},moveToEol:function(u,m,y,v){return Ro(u,m,y,v,!1)},moveToFirstNonWhiteSpaceCharacter:function(u,m){var y=m;return new t(y.line,jn(u.getLine(y.line)))},moveToMatchedSymbol:function(u,m){for(var y=m,v=y.line,w=y.ch,_=u.getLine(v),T;w<_.length;w++)if(T=_.charAt(w),T&&X(T)){var L=u.getTokenTypeAt(new t(v,w+1));if(L!=="string"&&L!=="comment")break}if(w<_.length){var D=T==="<"||T===">"?/[(){}[\]<>]/:/[(){}[\]]/;return u.findMatchingBracket(new t(v,w),{bracketRegex:D}).to}else return y},moveToStartOfLine:function(u,m){return new t(m.line,0)},moveToLineOrEdgeOfDocument:function(u,m,y){var v=y.forward?u.lastLine():u.firstLine();return y.repeatIsExplicit&&(v=y.repeat-u.getOption("firstLineNumber")),new t(v,jn(u.getLine(v)))},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,y,v){var w={"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"},_={"'":!0,'"':!0,"`":!0},T=y.selectedCharacter||"";T=="b"?T="(":T=="B"&&(T="{");var L=!y.textObjectInner,D,P;if(w[T]){if(P=!0,D=Mr(u,m,T,L),!D){var M=u.getSearchCursor(RegExp("\\"+T,"g"),m);M.find()&&(D=Mr(u,M.from(),T,L))}}else if(_[T])P=!0,D=Na(u,m,T,L);else if(T==="W"||T==="w")for(var Z=y.repeat||1;Z-- >0;){var Y=er(u,{inclusive:L,innerWord:!L,bigWord:T==="W",noSymbol:T==="W",multiline:!0},D&&D.end);Y&&(D||(D=Y),D.end=Y.end)}else if(T==="p")if(D=Mt(u,m,y.repeat,0,L),y.linewise=!0,v.visualMode)v.visualLine||(v.visualLine=!0);else{var W=v.inputState.operatorArgs;W&&(W.linewise=!0),D.end.line--}else if(T==="t")D=Ht(u,m,L);else if(T==="s"){var U=u.getLine(m.line);m.ch>0&&te(U[m.ch])&&--m.ch;var ge=Zl(u,m,y.repeat,1,L),he=Zl(u,m,y.repeat,-1,L);H(u.getLine(he.line)[he.ch])&&H(u.getLine(ge.line)[ge.ch-1])&&(he={line:he.line,ch:he.ch+1}),D={start:he,end:ge}}return D?u.state.vim.visualMode?Pp(u,D.start,D.end,P):[D.start,D.end]:null},repeatLastCharacterSearch:function(u,m,y){var v=K.lastCharacterSearch,w=y.repeat,_=y.forward===v.forward,T=(v.increment?1:0)*(_?-1:1);u.moveH(-T,"char"),y.inclusive=!!_;var L=Or(u,w,_,v.selectedCharacter);return L?(L.ch+=T,L):(u.moveH(T,"char"),m)}};function Dp(u,m){kn[u]=m}function Vc(u,m){for(var y=[],v=0;v<m;v++)y.push(u);return y}var Jt={change:function(u,m,y){var v,w,_=u.state.vim,T=y[0].anchor,L=y[0].head;if(_.visualMode)if(m.fullLine)L.ch=Number.MAX_VALUE,L.line--,u.setSelection(T,L),w=u.getSelection(),u.replaceSelection(""),v=T;else{w=u.getSelection();var D=Vc("",y.length);u.replaceSelections(D),v=Zt(y[0].head,y[0].anchor)}else{w=u.getRange(T,L);var P=_.lastEditInputState;if((P==null?void 0:P.motion)=="moveByWords"&&!H(w)){var M=/\s+$/.exec(w);M&&P.motionArgs&&P.motionArgs.forward&&(L=Tt(L,0,-M[0].length),w=w.slice(0,-M[0].length))}m.linewise&&(T=new t(T.line,jn(u.getLine(T.line))),L.line>T.line&&(L=new t(L.line-1,Number.MAX_VALUE))),u.replaceRange("",T,L),v=T}K.registerController.pushText(m.registerName,"change",w,m.linewise,y.length>1),Hr.enterInsertMode(u,{head:v},u.state.vim)},delete:function(u,m,y){var v,w,_=u.state.vim;if(_.visualBlock){w=u.getSelection();var T=Vc("",y.length);u.replaceSelections(T),v=Zt(y[0].head,y[0].anchor)}else{var L=y[0].anchor,D=y[0].head;m.linewise&&D.line!=u.firstLine()&&L.line==u.lastLine()&&L.line==D.line-1&&(L.line==u.firstLine()?L.ch=0:L=new t(L.line-1,Ot(u,L.line-1))),w=u.getRange(L,D),u.replaceRange("",L,D),v=L,m.linewise&&(v=kn.moveToFirstNonWhiteSpaceCharacter(u,L))}return K.registerController.pushText(m.registerName,"delete",w,m.linewise,_.visualBlock),zt(u,v)},indent:function(u,m,y){var v=u.state.vim,w=v.visualMode&&m.repeat||1;if(v.visualBlock){for(var _=u.getOption("tabSize"),T=u.getOption("indentWithTabs")?" ":" ".repeat(_),L,D=y.length-1;D>=0;D--)if(L=Zt(y[D].anchor,y[D].head),m.indentRight)u.replaceRange(T.repeat(w),L,L);else{for(var P=u.getLine(L.line),M=0,Z=0;Z<w;Z++){var Y=P[L.ch+M];if(Y==" ")M++;else if(Y==" "){M++;for(var W=1;W<T.length&&(Y=P[L.ch+M],Y===" ");W++)M++}else break}u.replaceRange("",L,Tt(L,0,M))}return L}else if(u.indentMore)for(var Z=0;Z<w;Z++)m.indentRight?u.indentMore():u.indentLess();else{var U=y[0].anchor.line,ge=v.visualBlock?y[y.length-1].anchor.line:y[0].head.line;m.linewise&&ge--;for(var D=U;D<=ge;D++)for(var Z=0;Z<w;Z++)u.indentLine(D,m.indentRight)}return kn.moveToFirstNonWhiteSpaceCharacter(u,y[0].anchor)},indentAuto:function(u,m,y){return u.execCommand("indentAuto"),kn.moveToFirstNonWhiteSpaceCharacter(u,y[0].anchor)},hardWrap:function(u,m,y,v){if(u.hardWrap){var w=y[0].anchor.line,_=y[0].head.line;m.linewise&&_--;var T=u.hardWrap({from:w,to:_});return T>w&&m.linewise&&T--,m.keepCursor?v:new t(T,0)}},changeCase:function(u,m,y,v,w){for(var _=u.getSelections(),T=[],L=m.toLower,D=0;D<_.length;D++){var P=_[D],M="";if(L===!0)M=P.toLowerCase();else if(L===!1)M=P.toUpperCase();else for(var Z=0;Z<P.length;Z++){var Y=P.charAt(Z);M+=F(Y)?Y.toLowerCase():Y.toUpperCase()}T.push(M)}return u.replaceSelections(T),m.shouldMoveCursor?w:!u.state.vim.visualMode&&m.linewise&&y[0].anchor.line+1==y[0].head.line?kn.moveToFirstNonWhiteSpaceCharacter(u,v):m.linewise?v:Zt(y[0].anchor,y[0].head)},yank:function(u,m,y,v){var w=u.state.vim,_=u.getSelection(),T=w.visualMode?Zt(w.sel.anchor,w.sel.head,y[0].head,y[0].anchor):v;return K.registerController.pushText(m.registerName,"yank",_,m.linewise,w.visualBlock),T},rot13:function(u,m,y,v,w){for(var _=u.getSelections(),T=[],L=0;L<_.length;L++){let D=_[L].split("").map(P=>{let M=P.charCodeAt(0);return M>=65&&M<=90?String.fromCharCode(65+(M-65+13)%26):M>=97&&M<=122?String.fromCharCode(97+(M-97+13)%26):P}).join("");T.push(D)}return u.replaceSelections(T),m.shouldMoveCursor?w:!u.state.vim.visualMode&&m.linewise&&y[0].anchor.line+1==y[0].head.line?kn.moveToFirstNonWhiteSpaceCharacter(u,v):m.linewise?v:Zt(y[0].anchor,y[0].head)}};function Op(u,m){Jt[u]=m}var Hr={jumpListWalk:function(u,m,y){if(!y.visualMode){var v=m.repeat||1,w=m.forward,_=K.jumpList.move(u,w?v:-v),T=_?_.find():void 0;T||(T=u.getCursor()),u.setCursor(T)}},scroll:function(u,m,y){if(!y.visualMode){var v=m.repeat||1,w=u.defaultTextHeight(),_=u.getScrollInfo().top,T=w*v,L=m.forward?_+T:_-T,D=Xe(u.getCursor()),P=u.charCoords(D,"local");if(m.forward)L>P.top?(D.line+=(L-P.top)/w,D.line=Math.ceil(D.line),u.setCursor(D),P=u.charCoords(D,"local"),u.scrollTo(null,P.top)):u.scrollTo(null,L);else{var M=L+u.getScrollInfo().clientHeight;M<P.bottom?(D.line-=(P.bottom-M)/w,D.line=Math.floor(D.line),u.setCursor(D),P=u.charCoords(D,"local"),u.scrollTo(null,P.bottom-u.getScrollInfo().clientHeight)):u.scrollTo(null,L)}}},scrollToCursor:function(u,m){var y=u.getCursor().line,v=u.charCoords(new t(y,0),"local"),w=u.getScrollInfo().clientHeight,_=v.top;switch(m.position){case"center":_=v.bottom-w/2;break;case"bottom":var T=new t(y,u.getLine(y).length-1),L=u.charCoords(T,"local").bottom-_;_=_-w+L;break}u.scrollTo(null,_)},replayMacro:function(u,m,y){var v=m.selectedCharacter||"",w=m.repeat||1,_=K.macroModeState;for(v=="@"?v=_.latestRegister||"":_.latestRegister=v;w--;)Di(u,y,_,v)},enterMacroRecordMode:function(u,m){var y=K.macroModeState,v=m.selectedCharacter;K.registerController.isValidRegister(v)&&y.enterMacroRecordMode(u,v)},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,y){if(!u.getOption("readOnly")){y.insertMode=!0,y.insertModeRepeat=m&&m.repeat||1;var v=m?m.insertAt:null,w=y.sel,_=m.head||u.getCursor("head"),T=u.listSelections().length;if(v=="eol")_=new t(_.line,Ot(u,_.line));else if(v=="bol")_=new t(_.line,0);else if(v=="charAfter"){var L=r(u,_,Tt(_,0,1));_=L.end}else if(v=="firstNonBlank"){var L=r(u,_,kn.moveToFirstNonWhiteSpaceCharacter(u,_));_=L.end}else if(v=="startOfSelectedArea"){if(!y.visualMode)return;y.visualBlock?(_=new t(Math.min(w.head.line,w.anchor.line),Math.min(w.head.ch,w.anchor.ch)),T=Math.abs(w.head.line-w.anchor.line)+1):_=w.head.line<w.anchor.line?w.head:new t(w.anchor.line,0)}else if(v=="endOfSelectedArea"){if(!y.visualMode)return;y.visualBlock?(_=new t(Math.min(w.head.line,w.anchor.line),Math.max(w.head.ch,w.anchor.ch)+1),T=Math.abs(w.head.line-w.anchor.line)+1):_=w.head.line>=w.anchor.line?Tt(w.head,0,1):new t(w.anchor.line,0)}else if(v=="inplace"){if(y.visualMode)return}else v=="lastEdit"&&(_=tu(u)||_);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"})),K.macroModeState.isPlaying||(u.on("change",br),y.insertEnd&&y.insertEnd.clear(),y.insertEnd=u.setBookmark(_,{insertLeft:!0}),e.on(u.getInputField(),"keydown",is)),y.visualMode&&Nn(u),Hc(u,_,T)}},toggleVisualMode:function(u,m,y){var v=m.repeat,w=u.getCursor(),_;if(y.visualMode)y.visualLine!=!!m.linewise||y.visualBlock!=!!m.blockwise?(y.visualLine=!!m.linewise,y.visualBlock=!!m.blockwise,e.signal(u,"vim-mode-change",{mode:"visual",subMode:y.visualLine?"linewise":y.visualBlock?"blockwise":""}),Ur(u)):Nn(u);else{y.visualMode=!0,y.visualLine=!!m.linewise,y.visualBlock=!!m.blockwise,_=zt(u,new t(w.line,w.ch+v-1));var T=r(u,w,_);y.sel={anchor:T.start,head:T.end},e.signal(u,"vim-mode-change",{mode:"visual",subMode:y.visualLine?"linewise":y.visualBlock?"blockwise":""}),Ur(u),pn(u,y,"<",Zt(w,_)),pn(u,y,">",Dr(w,_))}},reselectLastSelection:function(u,m,y){var v=y.lastSelection;if(y.visualMode&&Ei(u,y),v){var w=v.anchorMark.find(),_=v.headMark.find();if(!w||!_)return;y.sel={anchor:w,head:_},y.visualMode=!0,y.visualLine=v.visualLine,y.visualBlock=v.visualBlock,Ur(u),pn(u,y,"<",Zt(w,_)),pn(u,y,">",Dr(w,_)),e.signal(u,"vim-mode-change",{mode:"visual",subMode:y.visualLine?"linewise":y.visualBlock?"blockwise":""})}},joinLines:function(u,m,y){var v,w;if(y.visualMode){if(v=u.getCursor("anchor"),w=u.getCursor("head"),_t(w,v)){var _=w;w=v,v=_}w.ch=Ot(u,w.line)-1}else{var T=Math.max(m.repeat,2);v=u.getCursor(),w=zt(u,new t(v.line+T-1,1/0))}for(var L=0,D=v.line;D<w.line;D++){L=Ot(u,v.line);var P="",M=0;if(!m.keepSpaces){var Z=u.getLine(v.line+1);M=Z.search(/\S/),M==-1?M=Z.length:P=" "}u.replaceRange(P,new t(v.line,L),new t(v.line+1,M))}var Y=zt(u,new t(v.line,L));y.visualMode&&Nn(u,!1),u.setCursor(Y)},newLineAndEnterInsertMode:function(u,m,y){y.insertMode=!0;var v=Xe(u.getCursor());v.line===u.firstLine()&&!m.after?(u.replaceRange(`
|
|
68
|
+
`,new t(u.firstLine(),0)),u.setCursor(u.firstLine(),0)):(v.line=m.after?v.line:v.line-1,v.ch=Ot(u,v.line),u.setCursor(v),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(u)),this.enterInsertMode(u,{repeat:m.repeat},y)},paste:function(u,m,y){var v=K.registerController.getRegister(m.registerName);if(m.registerName==="+")navigator.clipboard.readText().then(_=>{this.continuePaste(u,m,y,_,v)});else{var w=v.toString();this.continuePaste(u,m,y,w,v)}},continuePaste:function(u,m,y,v,w){var _=Xe(u.getCursor());if(v){if(m.matchIndent){var T=u.getOption("tabSize"),L=function(kt){var Ft=kt.split(" ").length-1,Wt=kt.split(" ").length-1;return Ft*T+Wt*1},D=L(u.getLine(u.getCursor().line).match(/^\s*/)[0]),P=v.replace(/\n$/,""),M=v!==P,Z=L(v.match(/^\s*/)[0]),v=P.replace(/^\s*/gm,function(kt){var Ft=D+(L(kt)-Z);if(Ft<0)return"";if(u.getOption("indentWithTabs")){var Wt=Math.floor(Ft/T);return Array(Wt+1).join(" ")}else return Array(Ft+1).join(" ")});v+=M?`
|
|
69
|
+
`:""}m.repeat>1&&(v=Array(m.repeat+1).join(v));var Y=w.linewise,W=w.blockwise,U=W?v.split(`
|
|
70
|
+
`):void 0;if(U){Y&&U.pop();for(var ge=0;ge<U.length;ge++)U[ge]=U[ge]==""?" ":U[ge];_.ch+=m.after?1:0,_.ch=Math.min(Ot(u,_.line),_.ch)}else Y?y.visualMode?v=y.visualLine?v.slice(0,-1):`
|
|
71
|
+
`+v.slice(0,v.length-1)+`
|
|
72
|
+
`:m.after?(v=`
|
|
73
|
+
`+v.slice(0,v.length-1),_.ch=Ot(u,_.line)):_.ch=0:_.ch+=m.after?1:0;var he;if(y.visualMode){y.lastPastedText=v;var Re,Ce=Gl(u),Oe=Ce[0],et=Ce[1],Be=u.getSelection(),ft=u.listSelections(),vt=Array(ft.length).join("1").split("1");y.lastSelection&&(Re=y.lastSelection.headMark.find()),K.registerController.unnamedRegister.setText(Be),W?(u.replaceSelections(vt),et=new t(Oe.line+v.length-1,Oe.ch),u.setCursor(Oe),Oa(u,et),u.replaceSelections(v),he=Oe):y.visualBlock?(u.replaceSelections(vt),u.setCursor(Oe),u.replaceRange(v,Oe,Oe),he=Oe):(u.replaceRange(v,Oe,et),he=u.posFromIndex(u.indexFromPos(Oe)+v.length-1)),Re&&(y.lastSelection.headMark=u.setBookmark(Re)),Y&&(he.ch=0)}else if(W&&U){u.setCursor(_);for(var ge=0;ge<U.length;ge++){var Fe=_.line+ge;Fe>u.lastLine()&&u.replaceRange(`
|
|
74
|
+
`,new t(Fe,0)),Ot(u,Fe)<_.ch&&Oo(u,Fe,_.ch)}u.setCursor(_),Oa(u,new t(_.line+U.length-1,_.ch)),u.replaceSelections(U),he=_}else if(u.replaceRange(v,_),Y){var Fe=m.after?_.line+1:_.line;he=new t(Fe,jn(u.getLine(Fe)))}else he=Xe(_),/\n/.test(v)||(he.ch+=v.length-(m.after?1:0));y.visualMode&&Nn(u,!1),u.setCursor(he)}},undo:function(u,m){u.operation(function(){sn(u,e.commands.undo,m.repeat)(),u.setCursor(zt(u,u.getCursor("start")))})},redo:function(u,m){sn(u,e.commands.redo,m.repeat)()},setRegister:function(u,m,y){y.inputState.registerName=m.selectedCharacter},insertRegister:function(u,m,y){var v=m.selectedCharacter,w=K.registerController.getRegister(v),_=w&&w.toString();_&&u.replaceSelection(_)},oneNormalCommand:function(u,m,y){hn(u,!0),y.insertModeReturn=!0,e.on(u,"vim-command-done",function v(){y.visualMode||(y.insertModeReturn&&(y.insertModeReturn=!1,y.insertMode||Hr.enterInsertMode(u,{},y)),e.off(u,"vim-command-done",v))})},setMark:function(u,m,y){var v=m.selectedCharacter;v&&pn(u,y,v,u.getCursor())},replace:function(u,m,y){var v=m.selectedCharacter||"",w=u.getCursor(),_,T,L=u.listSelections();if(y.visualMode)w=u.getCursor("start"),T=u.getCursor("end");else{var D=u.getLine(w.line);_=w.ch+m.repeat,_>D.length&&(_=D.length),T=new t(w.line,_)}var P=r(u,w,T);if(w=P.start,T=P.end,v==`
|
|
75
|
+
`)y.visualMode||u.replaceRange("",w,T),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(u);else{var M=u.getRange(w,T);if(M=M.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,v),M=M.replace(/[^\n]/g,v),y.visualBlock){var Z=Array(u.getOption("tabSize")+1).join(" ");M=u.getSelection(),M=M.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,v);var Y=M.replace(/\t/g,Z).replace(/[^\n]/g,v).split(`
|
|
76
|
+
`);u.replaceSelections(Y)}else u.replaceRange(M,w,T);y.visualMode?(w=_t(L[0].anchor,L[0].head)?L[0].anchor:L[0].head,u.setCursor(w),Nn(u,!1)):u.setCursor(Tt(T,0,-1))}},incrementNumberToken:function(u,m){for(var y=u.getCursor(),v=u.getLine(y.line),w=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,_,T,L,D;(_=w.exec(v))!==null&&(T=_.index,L=T+_[0].length,!(y.ch<L)););if(!(!m.backtrack&&L<=y.ch)){if(_){var P=_[2]||_[4],M=_[3]||_[5],Z=m.increase?1:-1,Y={"0b":2,0:8,"":10,"0x":16}[P.toLowerCase()];D=(parseInt(_[1]+M,Y)+Z*m.repeat).toString(Y);var W=P?Array(M.length-D.length+1+_[1].length).join("0"):"";D=D.charAt(0)==="-"?"-"+P+W+D.substr(1):P+W+D;var U=new t(y.line,T),ge=new t(y.line,L);u.replaceRange(D,U,ge)}else return;u.setCursor(new t(y.line,T+D.length-1))}},repeatLastEdit:function(u,m,y){var v=y.lastEditInputState;if(v){var w=m.repeat;w&&m.repeatIsExplicit?v.repeatOverride=w:w=v.repeatOverride||w,Ri(u,y,w,!1)}},indent:function(u,m){u.indentLine(u.getCursor().line,m.indentRight)},exitInsertMode:function(u,m){hn(u)}};function Bc(u,m){Hr[u]=m}function zt(u,m,y){var v=u.state.vim,w=v.insertMode||v.visualMode,_=Math.min(Math.max(u.firstLine(),m.line),u.lastLine()),T=u.getLine(_),L=T.length-1+ +!!w,D=Math.min(Math.max(0,m.ch),L),P=T.charCodeAt(D);if(56320<=P&&P<=57343){var M=1;y&&y.line==_&&y.ch>D&&(M=-1),D+=M,D>L&&(D-=2)}return new t(_,D)}function Do(u){var m={};for(var y in u)Object.prototype.hasOwnProperty.call(u,y)&&(m[y]=u[y]);return m}function Tt(u,m,y){return typeof m=="object"&&(y=m.ch,m=m.line),new t(u.line+m,u.ch+y)}function Mp(u,m,y,v){v.operator&&(y="operatorPending");for(var w,_=[],T=[],L=De?m.length-c:0;L<m.length;L++){var D=m[L];y=="insert"&&D.context!="insert"||D.context&&D.context!=y||v.operator&&D.type=="action"||!(w=Rp(u,D.keys))||(w=="partial"&&_.push(D),w=="full"&&T.push(D))}return{partial:_,full:T}}function Rp(u,m){let y=m.slice(-11)=="<character>",v=m.slice(-10)=="<register>";if(y||v){var w=m.length-(y?11:10),_=u.slice(0,w),T=m.slice(0,w);return _==T&&u.length>w?"full":T.indexOf(_)==0?"partial":!1}else return u==m?"full":m.indexOf(u)==0?"partial":!1}function Ci(u){var m=/^.*(<[^>]+>)$/.exec(u),y=m?m[1]:u.slice(-1);if(y.length>1)switch(y){case"<CR>":case"<S-CR>":y=`
|
|
77
|
+
`;break;case"<Space>":case"<S-Space>":y=" ";break;default:y="";break}return y}function sn(u,m,y){return function(){for(var v=0;v<y;v++)m(u)}}function Xe(u){return new t(u.line,u.ch)}function yt(u,m){return u.ch==m.ch&&u.line==m.line}function _t(u,m){return u.line<m.line||u.line==m.line&&u.ch<m.ch}function Zt(u,m){return arguments.length>2&&(m=Zt.apply(void 0,Array.prototype.slice.call(arguments,1))),_t(u,m)?u:m}function Dr(u,m){return arguments.length>2&&(m=Dr.apply(void 0,Array.prototype.slice.call(arguments,1))),_t(u,m)?m:u}function Si(u,m,y){var v=_t(u,m),w=_t(m,y);return v&&w}function Ot(u,m){return u.getLine(m).length}function Da(u){return u.trim?u.trim():u.replace(/^\s+|\s+$/g,"")}function Wr(u){return u.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function Oo(u,m,y){var v=Ot(u,m),w=Array(y-v+1).join(" ");u.setCursor(new t(m,v)),u.replaceRange(w,u.getCursor())}function Oa(u,m){var y=[],v=u.listSelections(),w=Xe(u.clipPos(m)),_=!yt(m,w),T=Wc(v,u.getCursor("head")),L=yt(v[T].head,v[T].anchor),D=v.length-1,P=D-T>T?D:0,M=v[P].anchor,Z=Math.min(M.line,w.line),Y=Math.max(M.line,w.line),W=M.ch,U=w.ch,ge=v[P].head.ch-W,he=U-W;ge>0&&he<=0?(W++,_||U--):ge<0&&he>=0?(W--,L||U++):ge<0&&he==-1&&(W--,U++);for(var Re=Z;Re<=Y;Re++){var Ce={anchor:new t(Re,W),head:new t(Re,U)};y.push(Ce)}return u.setSelections(y),m.ch=U,M.ch=W,M}function Hc(u,m,y){for(var v=[],w=0;w<y;w++){var _=Tt(m,w,0);v.push({anchor:_,head:_})}u.setSelections(v,0)}function Wc(u,m,y){for(var v=0;v<u.length;v++){var w=yt(u[v].anchor,m),_=yt(u[v].head,m);if(w||_)return v}return-1}function Gl(u,m){var y=u.listSelections(),v=y[0],w=y[y.length-1];return[_t(v.anchor,v.head)?v.anchor:v.head,_t(w.anchor,w.head)?w.head:w.anchor]}function Ei(u,m){var y=m.sel.anchor,v=m.sel.head;m.lastPastedText&&(m.lastPastedText=(v=u.posFromIndex(u.indexFromPos(y)+m.lastPastedText.length),void 0)),m.lastSelection={anchorMark:u.setBookmark(y),headMark:u.setBookmark(v),anchor:Xe(y),head:Xe(v),visualMode:m.visualMode,visualLine:m.visualLine,visualBlock:m.visualBlock}}function Pp(u,m,y,v){var w=u.state.vim.sel,_=v?m:w.head,T=v?m:w.anchor,L;return _t(y,m)&&(L=y,y=m,m=L),_t(_,T)?(_=Zt(m,_),T=Dr(T,y)):(T=Zt(m,T),_=Dr(_,y),_=Tt(_,0,-1),_.ch==-1&&_.line!=u.firstLine()&&(_=new t(_.line-1,Ot(u,_.line-1)))),[T,_]}function Ur(u,m,y){var v=u.state.vim;m||(m=v.sel),y||(y=v.visualLine?"line":v.visualBlock?"block":"char");var w=Mo(u,m,y);u.setSelections(w.ranges,w.primary)}function Mo(u,m,y,v){var w=Xe(m.head),_=Xe(m.anchor);if(y=="char"){var T=!v&&!_t(m.head,m.anchor)?1:0,L=_t(m.head,m.anchor)?1:0;return w=Tt(m.head,0,T),_=Tt(m.anchor,0,L),{ranges:[{anchor:_,head:w}],primary:0}}else if(y=="line"){if(_t(m.head,m.anchor))w.ch=0,_.ch=Ot(u,_.line);else{_.ch=0;var D=u.lastLine();w.line>D&&(w.line=D),w.ch=Ot(u,w.line)}return{ranges:[{anchor:_,head:w}],primary:0}}else if(y=="block"){var P=Math.min(_.line,w.line),M=_.ch,Z=Math.max(_.line,w.line),Y=w.ch;M<Y?Y+=1:M+=1;for(var W=Z-P+1,U=w.line==P?0:W-1,ge=[],he=0;he<W;he++)ge.push({anchor:new t(P+he,M),head:new t(P+he,Y)});return{ranges:ge,primary:U}}throw"never happens"}function Uc(u){var m=u.getCursor("head");return u.getSelection().length==1&&(m=Zt(m,u.getCursor("anchor"))),m}function Nn(u,m){var y=u.state.vim;m!==!1&&u.setCursor(zt(u,y.sel.head)),Ei(u,y),y.visualMode=!1,y.visualLine=!1,y.visualBlock=!1,y.insertMode||e.signal(u,"vim-mode-change",{mode:"normal"})}function Xl(u,m,y){var v=u.getRange(m,y);if(/\n\s*$/.test(v)){var w=v.split(`
|
|
78
|
+
`);w.pop();for(var _=w.pop();w.length>0&&_&&H(_);_=w.pop())y.line--,y.ch=0;_?(y.line--,y.ch=Ot(u,y.line)):y.ch=0}}function Kc(u,m,y){m.ch=0,y.ch=0,y.line++}function jn(u){if(!u)return 0;var m=u.search(/\S/);return m==-1?u.length:m}function er(u,{inclusive:m,innerWord:y,bigWord:v,noSymbol:w,multiline:_},T){var L=T||Uc(u),D=u.getLine(L.line),P=D,M=L.line,Z=M,Y=L.ch,W,U=w?S[0]:E[0];if(y&&/\s/.test(D.charAt(Y)))U=function(et){return/\s/.test(et)};else{for(;!U(D.charAt(Y));)if(Y++,Y>=D.length){if(!_)return null;Y--,W=Jl(u,L,!0,v,!0);break}v?U=E[0]:(U=S[0],U(D.charAt(Y))||(U=S[1]))}for(var ge=Y,he=Y;U(D.charAt(he))&&he>=0;)he--;if(he++,W)ge=W.to,Z=W.line,P=u.getLine(Z),!P&&ge==0&&ge++;else for(;U(D.charAt(ge))&&ge<D.length;)ge++;if(m){var Re=ge,Ce=L.ch<=he&&/\s/.test(D.charAt(L.ch));if(!Ce)for(;/\s/.test(P.charAt(ge))&&ge<P.length;)ge++;if(Re==ge||Ce){for(var Oe=he;/\s/.test(D.charAt(he-1))&&he>0;)he--;!he&&!Ce&&(he=Oe)}}return{start:new t(M,he),end:new t(Z,ge)}}function Ht(u,m,y){var v=m;if(!e.findMatchingTag||!e.findEnclosingTag)return{start:v,end:v};var w=e.findMatchingTag(u,m)||e.findEnclosingTag(u,m);return!w||!w.open||!w.close?{start:v,end:v}:y?{start:w.open.from,end:w.close.to}:{start:w.open.to,end:w.close.from}}function en(u,m,y){yt(m,y)||K.jumpList.add(u,m,y)}function Ma(u,m){K.lastCharacterSearch.increment=u,K.lastCharacterSearch.forward=m.forward,K.lastCharacterSearch.selectedCharacter=m.selectedCharacter}var Yl={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},Qc={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 y;if(u.nextCh==="#"){var m=(y=u.lineText.match(/^#(\w+)/))==null?void 0:y[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 Np(u,m,y,v){var w=Xe(u.getCursor()),_=y?1:-1,T=y?u.lineCount():-1,L=w.ch,D=w.line,P=u.getLine(D),M={lineText:P,nextCh:P.charAt(L),lastCh:null,index:L,symb:v,reverseSymb:(y?{")":"(","}":"{"}:{"(":")","{":"}"})[v],forward:y,depth:0,curMoveThrough:!1},Z=Yl[v];if(!Z)return w;var Y=Qc[Z].init,W=Qc[Z].isComplete;for(Y&&Y(M);D!==T&&m;){if(M.index+=_,M.nextCh=M.lineText.charAt(M.index),!M.nextCh){if(D+=_,M.lineText=u.getLine(D)||"",_>0)M.index=0;else{var U=M.lineText.length;M.index=U>0?U-1:0}M.nextCh=M.lineText.charAt(M.index)}W(M)&&(w.line=D,w.ch=M.index,m--)}return M.nextCh||M.curMoveThrough?new t(D,M.index):w}function Jl(u,m,y,v,w){var _=m.line,T=m.ch,L=u.getLine(_),D=y?1:-1,P=v?E:S;if(w&&L==""){if(_+=D,L=u.getLine(_),!V(u,_))return null;T=y?0:L.length}for(;;){if(w&&L=="")return{from:0,to:0,line:_};for(var M=D>0?L.length:-1,Z=M,Y=M;T!=M;){for(var W=!1,U=0;U<P.length&&!W;++U)if(P[U](L.charAt(T))){for(Z=T;T!=M&&P[U](L.charAt(T));)T+=D;if(Y=T,W=Z!=Y,Z==m.ch&&_==m.line&&Y==Z+D)continue;return{from:Math.min(Z,Y+1),to:Math.max(Z,Y),line:_}}W||(T+=D)}if(_+=D,!V(u,_))return null;L=u.getLine(_),T=D>0?0:L.length}}function Ti(u,m,y,v,w,_){var T=Xe(m),L=[];(v&&!w||!v&&w)&&y++;for(var D=!(v&&w),P=0;P<y;P++){var M=Jl(u,m,v,_,D);if(!M){var Z=Ot(u,u.lastLine());L.push(v?{line:u.lastLine(),from:Z,to:Z}:{line:0,from:0,to:0});break}L.push(M),m=new t(M.line,v?M.to-1:M.from)}var Y=L.length!=y,W=L[0],U=L.pop();return v&&!w?(!Y&&(W.from!=T.ch||W.line!=T.line)&&(U=L.pop()),U&&new t(U.line,U.from)):v&&w?U&&new t(U.line,U.to-1):!v&&w?(!Y&&(W.to!=T.ch||W.line!=T.line)&&(U=L.pop()),U&&new t(U.line,U.to)):U&&new t(U.line,U.from)}function Ro(u,m,y,v,w){var _=new t(m.line+y.repeat-1,1/0),T=u.clipPos(_);return T.ch--,w||(v.lastHPos=1/0,v.lastHSPos=u.charCoords(T,"div").left),_}function Or(u,m,y,v,w){if(v){for(var _=w||u.getCursor(),T=_.ch,L,D=0;D<m;D++){var P=u.getLine(_.line);if(L=Pa(T,P,v,y),L==-1)return;T=L}if(L!=null)return new t(u.getCursor().line,L)}}function Ra(u,m){var y=u.getCursor().line;return zt(u,new t(y,m-1))}function pn(u,m,y,v){!me(y,A)&&!j.test(y)||(m.marks[y]&&m.marks[y].clear(),m.marks[y]=u.setBookmark(v))}function Pa(u,m,y,v,w){return v?m.indexOf(y,u+1):m.lastIndexOf(y,u-1)}function Mt(u,m,y,v,w){var _=m.line,T=u.firstLine(),L=u.lastLine(),D,P,M=_;function Z(he){return!u.getLine(he)}function Y(he,Re,Ce){return Ce?Z(he)!=Z(he+Re):!Z(he)&&Z(he+Re)}if(v){for(;T<=M&&M<=L&&y>0;)Y(M,v)&&y--,M+=v;return{start:new t(M,0),end:m}}var W=u.state.vim;if(W.visualLine&&Y(_,1,!0)){var U=W.sel.anchor;Y(U.line,-1,!0)&&(!w||U.line!=_)&&(_+=1)}var ge=Z(_);for(M=_;M<=L&&y;M++)Y(M,1,!0)&&(!w||Z(M)!=ge)&&y--;for(P=new t(M,0),M>L&&!ge?ge=!0:w=!1,M=_;M>T&&!((!w||Z(M)==ge||M==_)&&Y(M,-1,!0));M--);return D=new t(M,0),{start:D,end:P}}function Zl(u,m,y,v,w){function _(P){P.line!==null&&(P.pos+P.dir<0||P.pos+P.dir>=P.line.length?P.line=null:P.pos+=P.dir)}function T(P,M,Z,Y){var W={line:P.getLine(M),ln:M,pos:Z,dir:Y};if(W.line==="")return{ln:W.ln,pos:W.pos};var U=W.pos;for(_(W);W.line!==null;){if(U=W.pos,te(W.line[W.pos]))if(w){for(_(W);W.line!==null&&H(W.line[W.pos]);)U=W.pos,_(W);return{ln:W.ln,pos:U+1}}else return{ln:W.ln,pos:W.pos+1};_(W)}return{ln:W.ln,pos:U+1}}function L(P,M,Z,Y){var W=P.getLine(M),U={line:W,ln:M,pos:Z,dir:Y};if(U.line==="")return{ln:U.ln,pos:U.pos};var ge=U.pos;for(_(U);U.line!==null;){if(!H(U.line[U.pos])&&!te(U.line[U.pos]))ge=U.pos;else if(te(U.line[U.pos]))return w&&H(U.line[U.pos+1])?{ln:U.ln,pos:U.pos+1}:{ln:U.ln,pos:ge};_(U)}return U.line=W,w&&H(U.line[U.pos])?{ln:U.ln,pos:U.pos}:{ln:U.ln,pos:ge}}for(var D={ln:m.line,pos:m.ch};y>0;)D=v<0?L(u,D.ln,D.pos,v):T(u,D.ln,D.pos,v),y--;return new t(D.ln,D.pos)}function Gc(u,m,y,v){function w(D,P){if(P.line!==null)if(P.pos+P.dir<0||P.pos+P.dir>=P.line.length){if(P.ln+=P.dir,!V(D,P.ln)){P.line=null;return}P.line=D.getLine(P.ln),P.pos=P.dir>0?0:P.line.length-1}else P.pos+=P.dir}function _(D,P,M,Z){var he=D.getLine(P),Y=he==="",W={line:he,ln:P,pos:M,dir:Z},U={ln:W.ln,pos:W.pos},ge=W.line==="";for(w(D,W);W.line!==null;){if(U.ln=W.ln,U.pos=W.pos,W.line===""&&!ge||Y&&W.line!==""&&!H(W.line[W.pos]))return{ln:W.ln,pos:W.pos};te(W.line[W.pos])&&!Y&&(W.pos===W.line.length-1||H(W.line[W.pos+1]))&&(Y=!0),w(D,W)}var he=D.getLine(U.ln);U.pos=0;for(var Re=he.length-1;Re>=0;--Re)if(!H(he[Re])){U.pos=Re;break}return U}function T(D,P,M,Z){var he=D.getLine(P),Y={line:he,ln:P,pos:M,dir:Z},W=Y.ln,U=null,ge=Y.line==="";for(w(D,Y);Y.line!==null;){if(Y.line===""&&!ge)return U===null?{ln:Y.ln,pos:Y.pos}:{ln:W,pos:U};if(te(Y.line[Y.pos])&&U!==null&&!(Y.ln===W&&Y.pos+1===U))return{ln:W,pos:U};Y.line!==""&&!H(Y.line[Y.pos])&&(ge=!1,W=Y.ln,U=Y.pos),w(D,Y)}var he=D.getLine(W);U=0;for(var Re=0;Re<he.length;++Re)if(!H(he[Re])){U=Re;break}return{ln:W,pos:U}}for(var L={ln:m.line,pos:m.ch};y>0;)L=v<0?T(u,L.ln,L.pos,v):_(u,L.ln,L.pos,v),y--;return new t(L.ln,L.pos)}function Mr(u,m,y,v){var w=m,_={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[y],T={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[y],L=u.getLine(w.line).charAt(w.ch)===T?1:0,D=u.scanForBracket(new t(w.line,w.ch+L),-1,void 0,{bracketRegex:_}),P=u.scanForBracket(new t(w.line,w.ch+L),1,void 0,{bracketRegex:_});if(!D||!P)return null;var M=D.pos,Z=P.pos;if(M.line==Z.line&&M.ch>Z.ch||M.line>Z.line){var Y=M;M=Z,Z=Y}return v?Z.ch+=1:M.ch+=1,{start:M,end:Z}}function Na(u,m,y,v){var w=Xe(m),_=u.getLine(w.line).split(""),T,L,D,P,M=_.indexOf(y);if(w.ch<M)w.ch=M;else if(M<w.ch&&_[w.ch]==y){var Z=/string/.test(u.getTokenTypeAt(Tt(m,0,1))),Y=/string/.test(u.getTokenTypeAt(m));Z&&!Y||(L=w.ch,--w.ch)}if(_[w.ch]==y&&!L)T=w.ch+1;else for(D=w.ch;D>-1&&!T;D--)_[D]==y&&(T=D+1);if(T&&!L)for(D=T,P=_.length;D<P&&!L;D++)_[D]==y&&(L=D);return!T||!L?{start:w,end:w}:(v&&(--T,++L),{start:new t(w.line,T),end:new t(w.line,L)})}_e("pcre",!0,"boolean");class jp{constructor(){this.highlightTimeout}getQuery(){return K.query}setQuery(m){K.query=m}getOverlay(){return this.searchOverlay}setOverlay(m){this.searchOverlay=m}isReversed(){return K.isReversed}setReversed(m){K.isReversed=m}getScrollbarAnnotate(){return this.annotate}setScrollbarAnnotate(m){this.annotate=m}}function Cn(u){var m=u.state.vim;return m.searchState_||(m.searchState_=new jp)}function Xc(u){return Ii(u,"/")}function zp(u){return Ai(u,"/")}function Ii(u,m){var y=Ai(u,m)||[];if(!y.length)return[];var v=[];if(y[0]===0){for(var w=0;w<y.length;w++)typeof y[w]=="number"&&v.push(u.substring(y[w]+1,y[w+1]));return v}}function Ai(u,m){m||(m="/");for(var y=!1,v=[],w=0;w<u.length;w++){var _=u.charAt(w);!y&&_==m&&v.push(w),y=!y&&_=="\\"}return v}function yr(u){var m={V:"|(){+?*.[$^",M:"|(){+?*.[",m:"|(){+?",v:"<>"},y={">":"(?<=[\\w])(?=[^\\w]|$)","<":"(?<=[^\\w]|^)(?=[\\w])"},v=m.m,w=u.replace(/\\.|[\[|(){+*?.$^<>]/g,function(T){if(T[0]==="\\"){var L=T[1];return L==="}"||v.indexOf(L)!=-1?L:L in m?(v=m[L],""):L in y?y[L]:T}else return v.indexOf(T)==-1?T:y[T]||"\\"+T}),_=w.indexOf("\\zs");return _!=-1&&(w="(?<="+w.slice(0,_)+")"+w.slice(_+3)),_=w.indexOf("\\ze"),_!=-1&&(w=w.slice(0,_)+"(?="+w.slice(_+3)+")"),w}var mn={"\\n":`
|
|
79
|
+
`,"\\r":"\r","\\t":" "};function Yc(u){for(var m=!1,y=[],v=-1;v<u.length;v++){var w=u.charAt(v)||"",_=u.charAt(v+1)||"";mn[w+_]?(y.push(mn[w+_]),v++):m?(y.push(w),m=!1):w==="\\"?(m=!0,fe(_)||_==="$"?y.push("$"):_!=="/"&&_!=="\\"&&y.push("\\")):(w==="$"&&y.push("$"),y.push(w),_==="/"&&y.push("\\"))}return y.join("")}var Jc={"\\/":"/","\\\\":"\\","\\n":`
|
|
80
|
+
`,"\\r":"\r","\\t":" ","\\&":"&"};function es(u){for(var m=new e.StringStream(u),y=[];!m.eol();){for(;m.peek()&&m.peek()!="\\";)y.push(m.next());var v=!1;for(var w in Jc)if(m.match(w,!0)){v=!0,y.push(Jc[w]);break}v||y.push(m.next())}return y.join("")}function ts(u,m,y){K.registerController.getRegister("/").setText(u);var v=zp(u),w,_;return v.length?(w=u.substring(0,v[0]),_=u.substring(v[0]).indexOf("i")!=-1):w=u,w?(oe("pcre")||(w=yr(w)),y&&(m=/^[^A-Z]*$/.test(w)),new RegExp(w,m||_?"im":"m")):null}function cn(u){typeof u=="string"&&(u=document.createElement(u));for(var m=1;m<arguments.length;m++){var y=arguments[m];if(y)if(typeof y!="object"&&(y=document.createTextNode(y)),y.nodeType)u.appendChild(y);else for(var v in y)Object.prototype.hasOwnProperty.call(y,v)&&(v[0]==="$"?u.style[v.slice(1)]=y[v]:typeof y[v]=="function"?u[v]=y[v]:u.setAttribute(v,y[v]))}return u}function Ze(u,m,y){var v=cn("div",{$color:"red",$whiteSpace:"pre",class:"cm-vim-message"},m);u.openNotification?y?(v=cn("div",{},v,cn("div",{},"Press ENTER or type command to continue")),u.state.closeVimNotification&&u.state.closeVimNotification(),u.state.closeVimNotification=u.openNotification(v,{bottom:!0,duration:0})):u.openNotification(v,{bottom:!0,duration:15e3}):alert(v.innerText)}function zn(u,m){return cn("div",{$display:"flex",$flex:1},cn("span",{$fontFamily:"monospace",$whiteSpace:"pre",$flex:1,$display:"flex"},u,cn("input",{type:"text",autocorrect:"off",autocapitalize:"off",spellcheck:"false",$flex:1})),m&&cn("span",{$color:"#888"},m))}function ja(u,m){var w;if(je.length){m.value||(m.value=""),ze=m;return}var y=zn(m.prefix,m.desc);if(u.openDialog)u.openDialog(y,m.onClose,{onKeyDown:m.onKeyDown,onKeyUp:m.onKeyUp,bottom:!0,selectValueOnOpen:!1,value:m.value});else{var v="";typeof m.prefix!="string"&&m.prefix&&(v+=m.prefix.textContent),m.desc&&(v+=" "+m.desc),(w=m.onClose)==null||w.call(m,prompt(v,""))}}function Zc(u,m){return u instanceof RegExp&&m instanceof RegExp?u.flags==m.flags&&u.source==m.source:!1}function Kr(u,m,y,v){if(m){var w=Cn(u),_=ts(m,!!y,!!v);if(_)return Po(u,_),Zc(_,w.getQuery())||w.setQuery(_),_}}function za(u){if(u.source.charAt(0)=="^")var m=!0;return{token:function(y){if(m&&!y.sol()){y.skipToEnd();return}var v=y.match(u,!1);if(v)return v[0].length==0?(y.next(),"searching"):!y.sol()&&(y.backUp(1),!u.exec(y.next()+v[0]))?(y.next(),null):(y.match(u),"searching");for(;!y.eol()&&(y.next(),!y.match(u,!1)););},query:u}}var Fa=0;function Po(u,m){clearTimeout(Fa);var y=Cn(u);y.highlightTimeout=Fa,Fa=setTimeout(function(){if(u.state.vim){var v=Cn(u);v.highlightTimeout=void 0;var w=v.getOverlay();(!w||m!=w.query)&&(w&&u.removeOverlay(w),w=za(m),u.addOverlay(w),u.showMatchesOnScrollbar&&(v.getScrollbarAnnotate()&&v.getScrollbarAnnotate().clear(),v.setScrollbarAnnotate(u.showMatchesOnScrollbar(m))),v.setOverlay(w))}},50)}function Qr(u,m,y,v){return u.operation(function(){v===void 0&&(v=1);for(var w=u.getCursor(),_=u.getSearchCursor(y,w),T=0;T<v;T++){var L=_.find(m);if(T==0&&L&&yt(_.from(),w)){var D=m?_.from():_.to();L=_.find(m),L&&!L[0]&&yt(_.from(),D)&&u.getLine(D.line).length==D.ch&&(L=_.find(m))}if(!L&&(_=u.getSearchCursor(y,m?new t(u.lastLine()):new t(u.firstLine(),0)),!_.find(m)))return}return _.from()})}function Fp(u,m,y,v,w){return u.operation(function(){v===void 0&&(v=1);var _=u.getCursor(),T=u.getSearchCursor(y,_),L=T.find(!m);!w.visualMode&&L&&yt(T.from(),_)&&T.find(!m);for(var D=0;D<v;D++)if(L=T.find(m),!L&&(T=u.getSearchCursor(y,m?new t(u.lastLine()):new t(u.firstLine(),0)),!T.find(m)))return;var P=T.from(),M=T.to();return P&&M&&[P,M]})}function Gr(u){var m=Cn(u);m.highlightTimeout&&(m.highlightTimeout=(clearTimeout(m.highlightTimeout),void 0)),u.removeOverlay(Cn(u).getOverlay()),m.setOverlay(null),m.getScrollbarAnnotate()&&(m.getScrollbarAnnotate().clear(),m.setScrollbarAnnotate(null))}function eu(u,m,y){return typeof u!="number"&&(u=u.line),m instanceof Array?me(u,m):typeof y=="number"?u>=m&&u<=y:u==m}function Li(u){var m=u.getScrollInfo(),y=6,v=10,w=u.coordsChar({left:0,top:y+m.top},"local"),_=m.clientHeight-v+m.top,T=u.coordsChar({left:0,top:_},"local");return{top:w.line,bottom:T.line}}function No(u,m,y){if(y=="'"||y=="`")return K.jumpList.find(u,-1)||new t(0,0);if(y==".")return tu(u);var v=m.marks[y];return v&&v.find()}function tu(u){if(u.getLastEditEnd)return u.getLastEditEnd();for(var m=u.doc.history.done,y=m.length;y--;)if(m[y].changes)return Xe(m[y].changes[0].to)}class jo{constructor(){this.commandMap_,this.buildCommandMap_()}processCommand(m,y,v){var w=this;m.operation(function(){m.curOp&&(m.curOp.isVimOp=!0),w._processCommand(m,y,v)})}_processCommand(m,y,v){var w=m.state.vim,_=K.registerController.getRegister(":"),T=_.toString(),L=new e.StringStream(y);_.setText(y);var D=v||{};D.input=y;try{this.parseInput_(m,L,D)}catch(Z){throw Ze(m,Z+""),Z}w.visualMode&&Nn(m);var P,M;if(!D.commandName)D.line!==void 0&&(M="move");else if(P=this.matchCommand_(D.commandName),P){if(M=P.name,P.excludeFromCommandHistory&&_.setText(T),this.parseCommandArgs_(L,D,P),P.type=="exToKey"){jt(m,P.toKeys||"",P);return}else if(P.type=="exToEx"){this.processCommand(m,P.toInput||"");return}}if(!M){Ze(m,'Not an editor command ":'+y+'"');return}try{tr[M](m,D),(!P||!P.possiblyAsync)&&D.callback&&D.callback()}catch(Z){throw Ze(m,Z+""),Z}}parseInput_(m,y,v){var _,T;y.eatWhile(":"),y.eat("%")?(v.line=m.firstLine(),v.lineEnd=m.lastLine()):(v.line=this.parseLineSpec_(m,y),v.line!==void 0&&y.eat(",")&&(v.lineEnd=this.parseLineSpec_(m,y))),v.line==null?m.state.vim.visualMode?(v.selectionLine=(_=No(m,m.state.vim,"<"))==null?void 0:_.line,v.selectionLineEnd=(T=No(m,m.state.vim,">"))==null?void 0:T.line):v.selectionLine=m.getCursor().line:(v.selectionLine=v.line,v.selectionLineEnd=v.lineEnd);var w=y.match(/^(\w+|!!|@@|[!#&*<=>@~])/);return w?v.commandName=w[1]:v.commandName=(y.match(/.*/)||[""])[0],v}parseLineSpec_(m,y){var v=y.match(/^(\d+)/);if(v)return parseInt(v[1],10)-1;switch(y.next()){case".":return this.parseLineSpecOffset_(y,m.getCursor().line);case"$":return this.parseLineSpecOffset_(y,m.lastLine());case"'":var w=y.next()||"",_=No(m,m.state.vim,w);if(!_)throw Error("Mark not set");return this.parseLineSpecOffset_(y,_.line);case"-":case"+":return y.backUp(1),this.parseLineSpecOffset_(y,m.getCursor().line);default:y.backUp(1);return}}parseLineSpecOffset_(m,y){var v=m.match(/^([+-])?(\d+)/);if(v){var w=parseInt(v[2],10);v[1]=="-"?y-=w:y+=w}return y}parseCommandArgs_(m,y,v){var T;if(!m.eol()){y.argString=(T=m.match(/.*/))==null?void 0:T[0];var w=v.argDelimiter||/\s+/,_=Da(y.argString||"").split(w);_.length&&_[0]&&(y.args=_)}}matchCommand_(m){for(var y=m.length;y>0;y--){var v=m.substring(0,y);if(this.commandMap_[v]){var w=this.commandMap_[v];if(w.name.indexOf(m)===0)return w}}}buildCommandMap_(){this.commandMap_={};for(var m=0;m<d.length;m++){var y=d[m],v=y.shortName||y.name;this.commandMap_[v]=y}}map(m,y,v,w){if(m!=":"&&m.charAt(0)==":"){if(v)throw Error("Mode not supported for ex mappings");var _=m.substring(1);y!=":"&&y.charAt(0)==":"?this.commandMap_[_]={name:_,type:"exToEx",toInput:y.substring(1),user:!0}:this.commandMap_[_]={name:_,type:"exToKey",toKeys:y,user:!0}}else{var T={keys:m,type:"keyToKey",toKeys:y,noremap:!!w};v&&(T.context=v),Rr(T)}}unmap(m,y){if(m!=":"&&m.charAt(0)==":"){if(y)throw Error("Mode not supported for ex mappings");var v=m.substring(1);if(this.commandMap_[v]&&this.commandMap_[v].user)return delete this.commandMap_[v],!0}else for(var w=m,_=0;_<i.length;_++)if(w==i[_].keys&&i[_].context===y)return i.splice(_,1),rs(w),!0}}var tr={colorscheme:function(u,m){if(!m.args||m.args.length<1){Ze(u,u.getOption("theme"));return}u.setOption("theme",m.args[0])},map:function(u,m,y,v){var w=m.args;if(!w||w.length<2){u&&Ze(u,"Invalid mapping: "+m.input);return}Gt.map(w[0],w[1],y,v)},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,y){var v=m.args;(!v||v.length<1||!Gt.unmap(v[0],y))&&u&&Ze(u,"No such mapping: "+m.input)},mapclear:function(u,m){Ve.mapclear()},imapclear:function(u,m){Ve.mapclear("insert")},nmapclear:function(u,m){Ve.mapclear("normal")},vmapclear:function(u,m){Ve.mapclear("visual")},omapclear:function(u,m){Ve.mapclear("operatorPending")},move:function(u,m){gr.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 y=m.args,v=m.setCfg||{};if(!y||y.length<1){u&&Ze(u,"Invalid mapping: "+m.input);return}var w=y[0].split("="),_=w.shift()||"",T=w.length>0?w.join("="):void 0,L=!1,D=!1;if(_.charAt(_.length-1)=="?"){if(T)throw Error("Trailing characters: "+m.argString);_=_.substring(0,_.length-1),L=!0}else _.charAt(_.length-1)=="!"&&(_=_.substring(0,_.length-1),D=!0);T===void 0&&_.substring(0,2)=="no"&&(_=_.substring(2),T=!1);var P=ve[_]&&ve[_].type=="boolean";if(P&&(D?T=!oe(_,u,v):T??(T=!0)),!P&&T===void 0||L){var M=oe(_,u,v);M instanceof Error?Ze(u,M.message):M===!0||M===!1?Ze(u," "+(M?"":"no")+_):Ze(u," "+_+"="+M)}else{var Z=ke(_,T,u,v);Z instanceof Error&&Ze(u,Z.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 y=m.args,v=K.registerController.registers,w=`----------Registers----------
|
|
81
|
+
|
|
82
|
+
`;if(y)for(var _=y.join(""),T=0;T<_.length;T++){var L=_.charAt(T);if(K.registerController.isValidRegister(L)){var D=v[L]||new _n;w+='"'+L+" "+D.toString()+`
|
|
83
|
+
`}}else for(var L in v){var P=v[L].toString();P.length&&(w+='"'+L+" "+P+`
|
|
84
|
+
`)}Ze(u,w,!0)},marks:function(u,m){var y=m.args,v=u.state.vim.marks,w=`-----------Marks-----------
|
|
85
|
+
mark line col
|
|
86
|
+
|
|
87
|
+
`;if(y)for(var _=y.join(""),T=0;T<_.length;T++){var L=_.charAt(T),D=v[L]&&v[L].find();D&&(w+=L+" "+D.line+" "+D.ch+`
|
|
88
|
+
`)}else for(var L in v){var D=v[L]&&v[L].find();D&&(w+=L+" "+D.line+" "+D.ch+`
|
|
89
|
+
`)}Ze(u,w,!0)},sort:function(u,m){var y,v,w,_,T;function L(){if(m.argString){var Fe=new e.StringStream(m.argString);if(Fe.eat("!")&&(y=!0),Fe.eol())return;if(!Fe.eatSpace())return"Invalid arguments";var Ne=Fe.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!Ne||!Fe.eol())return"Invalid arguments";if(Ne[1]){v=Ne[1].indexOf("i")!=-1,w=Ne[1].indexOf("u")!=-1;var kt=Ne[1].indexOf("d")!=-1||Ne[1].indexOf("n")!=-1,Ft=Ne[1].indexOf("x")!=-1,Wt=Ne[1].indexOf("o")!=-1;if(Number(kt)+Number(Ft)+Number(Wt)>1)return"Invalid arguments";_=kt&&"decimal"||Ft&&"hex"||Wt&&"octal"}Ne[2]&&(T=new RegExp(Ne[2].substr(1,Ne[2].length-2),v?"i":""))}}var D=L();if(D){Ze(u,D+": "+m.argString);return}var P=m.line||u.firstLine(),M=m.lineEnd||m.line||u.lastLine();if(P==M)return;var Z=new t(P,0),Y=new t(M,Ot(u,M)),W=u.getRange(Z,Y).split(`
|
|
90
|
+
`),U=_=="decimal"?/(-?)([\d]+)/:_=="hex"?/(-?)(?:0x)?([0-9a-f]+)/i:_=="octal"?/([0-7]+)/:null,ge=_=="decimal"?10:_=="hex"?16:_=="octal"?8:void 0,he=[],Re=[];if(_||T)for(var Ce=0;Ce<W.length;Ce++){var Oe=T?W[Ce].match(T):null;Oe&&Oe[0]!=""?he.push(Oe):U&&U.exec(W[Ce])?he.push(W[Ce]):Re.push(W[Ce])}else Re=W;function et(Fe,Ne){if(y){var kt=Fe;Fe=Ne,Ne=kt}v&&(Fe=Fe.toLowerCase(),Ne=Ne.toLowerCase());var Ft=U&&U.exec(Fe),Wt=U&&U.exec(Ne);return!Ft||!Wt?Fe<Ne?-1:1:parseInt((Ft[1]+Ft[2]).toLowerCase(),ge)-parseInt((Wt[1]+Wt[2]).toLowerCase(),ge)}function Be(Fe,Ne){if(y){var kt=Fe;Fe=Ne,Ne=kt}return v&&(Fe[0]=Fe[0].toLowerCase(),Ne[0]=Ne[0].toLowerCase()),Fe[0]<Ne[0]?-1:1}if(he.sort(T?Be:et),T)for(var Ce=0;Ce<he.length;Ce++)he[Ce]=he[Ce].input;else _||Re.sort(et);if(W=y?he.concat(Re):Re.concat(he),w){var ft=W,vt;W=[];for(var Ce=0;Ce<ft.length;Ce++)ft[Ce]!=vt&&W.push(ft[Ce]),vt=ft[Ce]}u.replaceRange(W.join(`
|
|
91
|
+
`),Z,Y)},vglobal:function(u,m){this.global(u,m)},normal:function(u,m){var y=!1,v=m.argString;if(v&&v[0]=="!"&&(v=v.slice(1),y=!0),v=v.trimStart(),!v){Ze(u,"Argument is required.");return}var w=m.line;if(typeof w=="number")for(var _=isNaN(m.lineEnd)?w:m.lineEnd,T=w;T<=_;T++)u.setCursor(T,0),jt(u,m.argString.trimStart(),{noremap:y}),u.state.vim.insertMode&&hn(u,!0);else jt(u,m.argString.trimStart(),{noremap:y}),u.state.vim.insertMode&&hn(u,!0)},global:function(u,m){var y=m.argString;if(!y){Ze(u,"Regular Expression missing from global");return}var v=m.commandName[0]==="v";y[0]==="!"&&m.commandName[0]==="g"&&(v=!0,y=y.slice(1));var w=m.line===void 0?u.firstLine():m.line,_=m.lineEnd||m.line||u.lastLine(),T=Xc(y),L=y,D="";if(T&&T.length&&(L=T[0],D=T.slice(1,T.length).join("/")),L)try{Kr(u,L,!0,!0)}catch{Ze(u,"Invalid regex: "+L);return}for(var P=Cn(u).getQuery(),M=[],Z=w;Z<=_;Z++){var Y=u.getLine(Z);P.test(Y)!==v&&M.push(D?u.getLineHandle(Z):Y)}if(!D){Ze(u,M.join(`
|
|
92
|
+
`));return}var W=0,U=function(){if(W<M.length){var ge=M[W++],he=u.getLineNumber(ge);if(he==null){U();return}var Re=he+1+D;Gt.processCommand(u,Re,{callback:U})}else u.releaseLineHandles&&u.releaseLineHandles()};U()},substitute:function(u,m){if(!u.getSearchCursor)throw Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var y=m.argString,v=y?Ii(y,y[0]):[],w="",_="",T,L,D,P=!1,M=!1;if(v&&v.length)w=v[0],oe("pcre")&&w!==""&&(w=new RegExp(w).source),_=v[1],_!==void 0&&(_=oe("pcre")?es(_.replace(/([^\\])&/g,"$1$$&")):Yc(_),K.lastSubstituteReplacePart=_),T=v[2]?v[2].split(" "):[];else if(y&&y.length){Ze(u,"Substitutions should be of the form :s/pattern/replace/");return}if(T&&(L=T[0],D=parseInt(T[1]),L&&(L.indexOf("c")!=-1&&(P=!0),L.indexOf("g")!=-1&&(M=!0),w=oe("pcre")?w+"/"+L:w.replace(/\//g,"\\/")+"/"+L)),w)try{Kr(u,w,!0,!0)}catch{Ze(u,"Invalid regex: "+w);return}if(_||(_=K.lastSubstituteReplacePart),_===void 0){Ze(u,"No previous substitute regular expression");return}var Z=Cn(u).getQuery(),Y=m.line===void 0?u.getCursor().line:m.line,W=m.lineEnd||Y;Y==u.firstLine()&&W==u.lastLine()&&(W=1/0),D&&(Y=W,W=Y+D-1);var U=zt(u,new t(Y,0)),ge=u.getSearchCursor(Z,U);ns(u,P,M,Y,W,ge,Z,_,m.callback)},startinsert:function(u,m){jt(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){Gr(u)},yank:function(u){var m=Xe(u.getCursor()).line,y=u.getLine(m);K.registerController.pushText("0","yank",y,!0,!0)},delete:function(u,m){var y=m.selectionLine,v=isNaN(m.selectionLineEnd)?y:m.selectionLineEnd;Jt.delete(u,{linewise:!0},[{anchor:new t(y,0),head:new t(v+1,0)}])},join:function(u,m){var y=m.selectionLine,v=isNaN(m.selectionLineEnd)?y:m.selectionLineEnd;u.setCursor(new t(y,0)),Hr.joinLines(u,{repeat:v-y},u.state.vim)},delmarks:function(u,m){if(!m.argString||!Da(m.argString)){Ze(u,"Argument required");return}for(var y=u.state.vim,v=new e.StringStream(Da(m.argString));!v.eol();){v.eatSpace();var w=v.pos;if(!v.match(/[a-zA-Z]/,!1)){Ze(u,"Invalid argument: "+m.argString.substring(w));return}var _=v.next();if(v.match("-",!0)){if(!v.match(/[a-zA-Z]/,!1)){Ze(u,"Invalid argument: "+m.argString.substring(w));return}var T=_,L=v.next();if(T&&L&&z(T)==z(L)){var D=T.charCodeAt(0),P=L.charCodeAt(0);if(D>=P){Ze(u,"Invalid argument: "+m.argString.substring(w));return}for(var M=0;M<=P-D;M++){var Z=String.fromCharCode(D+M);delete y.marks[Z]}}else{Ze(u,"Invalid argument: "+T+"-");return}}else _&&delete y.marks[_]}}},Gt=new jo;Ve.defineEx("version","ve",u=>{Ze(u,"Codemirror-vim version: 6.3.0")});function ns(u,m,y,v,w,_,T,L,D){u.state.vim.exMode=!0;var P=!1,M=0,Z,Y,W;function U(){u.operation(function(){for(;!P;)ge(),Re();Ce()})}function ge(){var et="",Be=_.match||_.pos&&_.pos.match;et=Be?L.replace(/\$(\d{1,3}|[$&])/g,function(vt,Fe){if(Fe=="$")return"$";if(Fe=="&")return Be[0];for(var Ne=Fe;parseInt(Ne)>=Be.length&&Ne.length>0;)Ne=Ne.slice(0,Ne.length-1);return Ne?Be[Ne]+Fe.slice(Ne.length,Fe.length):vt}):u.getRange(_.from(),_.to()).replace(T,L);var ft=_.to().line;_.replace(et),Y=_.to().line,w+=Y-ft,W=Y<ft}function he(){var et=Z&&Xe(_.to()),Be=_.findNext();return Be&&!Be[0]&&et&&yt(_.from(),et)&&(Be=_.findNext()),Be&&M++,Be}function Re(){for(;he()&&eu(_.from(),v,w);)if(!(!y&&_.from().line==Y&&!W)){u.scrollIntoView(_.from(),30),u.setSelection(_.from(),_.to()),Z=_.from(),P=!1;return}P=!0}function Ce(et){if(et&&et(),u.focus(),Z){u.setCursor(Z);var Be=u.state.vim;Be.exMode=!1,Be.lastHPos=Be.lastHSPos=Z.ch}D?D():P&&Ze(u,(M?"Found "+M+" matches":"No matches found")+" for pattern: "+T+(oe("pcre")?" (set nopcre to use Vim regexps)":""))}function Oe(et,Be,ft){switch(e.e_stop(et),Br(et)){case"y":ge(),Re();break;case"n":Re();break;case"a":var vt=D;D=void 0,u.operation(U),D=vt;break;case"l":ge();case"q":case"<Esc>":case"<C-c>":case"<C-[>":Ce(ft);break}return P&&Ce(ft),!0}if(Re(),P){Ze(u,"No matches for "+T+(oe("pcre")?" (set nopcre to use vim regexps)":""));return}if(!m){U(),D&&D();return}ja(u,{prefix:cn("span","replace with ",cn("strong",L)," (y/n/a/q/l)"),onKeyDown:Oe})}function hn(u,m){var y=u.state.vim,v=K.macroModeState,w=K.registerController.getRegister("."),_=v.isPlaying,T=v.lastInsertModeChanges;_||(u.off("change",br),y.insertEnd&&y.insertEnd.clear(),y.insertEnd=void 0,e.off(u.getInputField(),"keydown",is)),!_&&y.insertModeRepeat&&y.insertModeRepeat>1&&(Ri(u,y,y.insertModeRepeat-1,!0),y.lastEditInputState.repeatOverride=y.insertModeRepeat),delete y.insertModeRepeat,y.insertMode=!1,m||u.setCursor(u.getCursor().line,u.getCursor().ch-1),u.setOption("keyMap","vim"),u.setOption("disableInput",!0),u.toggleOverwrite(!1),w.setText(T.changes.join("")),e.signal(u,"vim-mode-change",{mode:"normal"}),v.isRecording&&as(v)}function Rr(u){i.unshift(u),u.keys&&nu(u.keys)}function nu(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(m){m&&(l[m]||(l[m]=0),l[m]++)})}function rs(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(m){l[m]&&l[m]--})}function ru(u,m,y,v,w){var _={keys:u,type:m};for(var T in _[m]=y,_[m+"Args"]=v,w)_[T]=w[T];Rr(_)}_e("insertModeEscKeysTimeout",200,"number");function Di(u,m,y,v){var w=K.registerController.getRegister(v);if(v==":"){w.keyBuffer[0]&&Gt.processCommand(u,w.keyBuffer[0]),y.isPlaying=!1;return}var _=w.keyBuffer,T=0;y.isPlaying=!0,y.replaySearchQueries=w.searchQueries.slice(0);for(var L=0;L<_.length;L++)for(var D=_[L],P,M,Z=/<(?:[CSMA]-)*\w+>|./gi;P=Z.exec(D);)if(M=P[0],Ve.handleKey(u,M,"macro"),m.insertMode){var Y=w.insertModeChanges[T++].changes;K.macroModeState.lastInsertModeChanges.changes=Y,os(u,Y,1),hn(u)}y.isPlaying=!1}function vr(u,m){if(!u.isPlaying){var y=u.latestRegister,v=K.registerController.getRegister(y);v&&v.pushText(m)}}function as(u){if(!u.isPlaying){var m=u.latestRegister,y=K.registerController.getRegister(m);y&&y.pushInsertModeChanges&&y.pushInsertModeChanges(u.lastInsertModeChanges)}}function Oi(u,m){if(!u.isPlaying){var y=u.latestRegister,v=K.registerController.getRegister(y);v&&v.pushSearchQuery&&v.pushSearchQuery(m)}}function br(u,m){var y=K.macroModeState,v=y.lastInsertModeChanges;if(!y.isPlaying)for(var w=u.state.vim;m;){if(v.expectCursorActivityForChange=!0,v.ignoreCount>1)v.ignoreCount--;else if(m.origin=="+input"||m.origin=="paste"||m.origin===void 0){var _=u.listSelections().length;_>1&&(v.ignoreCount=_);var T=m.text.join(`
|
|
93
|
+
`);if(v.maybeReset&&(v.maybeReset=(v.changes=[],!1)),T)if(u.state.overwrite&&!/\n/.test(T))v.changes.push([T]);else{if(T.length>1){var L=w&&w.insertEnd&&w.insertEnd.find(),D=u.getCursor();if(L&&L.line==D.line){var P=L.ch-D.ch;P>0&&P<T.length&&(v.changes.push([T,P]),T="")}}T&&v.changes.push(T)}}m=m.next}}function zo(u){var w;var m=u.state.vim;if(m.insertMode){var y=K.macroModeState;if(y.isPlaying)return;var v=y.lastInsertModeChanges;v.expectCursorActivityForChange?v.expectCursorActivityForChange=!1:(v.maybeReset=!0,m.insertEnd&&m.insertEnd.clear(),m.insertEnd=u.setBookmark(u.getCursor(),{insertLeft:!0}))}else(w=u.curOp)!=null&&w.isVimOp||Mi(u,m)}function Mi(u,m){var y=u.getCursor("anchor"),v=u.getCursor("head");if(m.visualMode&&!u.somethingSelected()?Nn(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 w=_t(v,y)?0:-1,_=_t(v,y)?-1:0;v=Tt(v,0,w),y=Tt(y,0,_),m.sel={anchor:y,head:v},pn(u,m,"<",Zt(v,y)),pn(u,m,">",Dr(v,y))}else m.insertMode||(m.lastHPos=u.getCursor().ch)}function is(u){var m=K.macroModeState.lastInsertModeChanges,y=e.keyName?e.keyName(u):u.key;y&&(y.indexOf("Delete")!=-1||y.indexOf("Backspace")!=-1)&&(m.maybeReset&&(m.maybeReset=(m.changes=[],!1)),m.changes.push(new Pe(y,u)))}function Ri(u,m,y,v){var w=K.macroModeState;w.isPlaying=!0;var _=m.lastEditActionCommand,T=m.inputState;function L(){_?gr.processAction(u,m,_):gr.evalInput(u,m)}function D(M){if(w.lastInsertModeChanges.changes.length>0){M=m.lastEditActionCommand?M:1;var Z=w.lastInsertModeChanges;os(u,Z.changes,M)}}if(m.inputState=m.lastEditInputState,_&&_.interlaceInsertRepeat)for(var P=0;P<y;P++)L(),D(1);else v||L(),D(y);m.inputState=T,m.insertMode&&!v&&hn(u),w.isPlaying=!1}function Pi(u,m){e.lookupKey(m,"vim-insert",function(y){return typeof y=="string"?e.commands[y](u):y(u),!0})}function os(u,m,y){var v=u.getCursor("head"),w=K.macroModeState.lastInsertModeChanges.visualBlock;w&&(Hc(u,v,w+1),y=u.listSelections().length,u.setCursor(v));for(var _=0;_<y;_++){w&&u.setCursor(Tt(v,_,0));for(var T=0;T<m.length;T++){var L=m[T];if(L instanceof Pe)Pi(u,L.keyName);else if(typeof L=="string")u.replaceSelection(L);else{var D=u.getCursor(),P=Tt(D,0,L[0].length-(L[1]||0));u.replaceRange(L[0],D,L[1]?D:P),u.setCursor(P)}}}w&&u.setCursor(Tt(v,0,1))}function Xt(u){var m=new u.constructor;return Object.keys(u).forEach(function(y){if(y!="insertEnd"){var v=u[y];Array.isArray(v)?v=v.slice():v&&typeof v=="object"&&v.constructor!=Object&&(v=Xt(v)),m[y]=v}}),u.sel&&(m.sel={head:u.sel.head&&Xe(u.sel.head),anchor:u.sel.anchor&&Xe(u.sel.anchor)}),m}function Xr(u,m,y){var _=le(u),v=u,w=!1,_=Ve.maybeInitVimState_(v),T=_.visualBlock||_.wasInVisualBlock;if(v.state.closeVimNotification){var L=v.state.closeVimNotification;if(v.state.closeVimNotification=null,L(),m=="<CR>")return gt(v),!0}var D=v.isInMultiSelectMode();if(_.wasInVisualBlock&&!D?_.wasInVisualBlock=!1:D&&_.visualBlock&&(_.wasInVisualBlock=!0),m=="<Esc>"&&!_.insertMode&&!_.visualMode&&D&&_.status=="<Esc>")gt(v);else if(T||!D||v.inVirtualSelectionMode)w=Ve.handleKey(v,m,y);else{var P=Xt(_),M=_.inputState.changeQueueList||[];v.operation(function(){var Y;v.curOp&&(v.curOp.isVimOp=!0);var Z=0;v.forEachSelection(function(){v.state.vim.inputState.changeQueue=M[Z];var W=v.getCursor("head"),U=v.getCursor("anchor"),ge=_t(W,U)?0:-1,he=_t(W,U)?-1:0;W=Tt(W,0,ge),U=Tt(U,0,he),v.state.vim.sel.head=W,v.state.vim.sel.anchor=U,w=Ve.handleKey(v,m,y),v.virtualSelection&&(M[Z]=v.state.vim.inputState.changeQueue,v.state.vim=Xt(P)),Z++}),(Y=v.curOp)!=null&&Y.cursorActivity&&!w&&(v.curOp.cursorActivity=!1),v.state.vim=_,_.inputState.changeQueueList=M,_.inputState.changeQueue=null},!0)}return w&&!_.visualMode&&!_.insertMode&&_.visualMode!=v.somethingSelected()&&Mi(v,_),w}return Le(),Ve}function Rn(e,t){var r=t.ch,i=t.line+1;i<1&&(i=1,r=0),i>e.lines&&(i=e.lines,r=Number.MAX_VALUE);var l=e.line(i);return Math.min(l.from+Math.max(0,r),l.to)}function mr(e,t){let r=e.lineAt(t);return{line:r.number-1,ch:t-r.from}}var Ir=class{constructor(e,t){this.line=e,this.ch=t}};function z1(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||[]).concat(r)}}function F1(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else{var i=e._handlers,l=i&&i[t];if(l){var c=l.indexOf(r);c>-1&&(i[t]=l.slice(0,c).concat(l.slice(c+1)))}}}function q1(e,t,...r){var c;var i=(c=e._handlers)==null?void 0:c[t];if(i)for(var l=0;l<i.length;++l)i[l](...r)}function $1(e,...t){if(e)for(var r=0;r<e.length;++r)e[r](...t)}var $f;try{$f=RegExp("[\\w\\p{Alphabetic}\\p{Number}_]","u")}catch{$f=/[\w]/}function Nl(e,t){var r=e.cm6;if(!r.state.readOnly){var i="input.type.compose";if(e.curOp&&(e.curOp.lastChange||(i="input.type.compose.start")),t.annotations)try{t.annotations.some(function(l){l.value=="input"&&(l.value=i)})}catch(l){console.error(l)}else t.userEvent=i;return r.dispatch(t)}}function V1(e,t){var i;e.curOp&&(e.curOp.$changeStart=void 0),(t?SD:bD)(e.cm6);let r=(i=e.curOp)==null?void 0:i.$changeStart;r!=null&&e.cm6.dispatch({selection:{anchor:r}})}var m4={Left:e=>yl(e.cm6,{key:"Left"},"editor"),Right:e=>yl(e.cm6,{key:"Right"},"editor"),Up:e=>yl(e.cm6,{key:"Up"},"editor"),Down:e=>yl(e.cm6,{key:"Down"},"editor"),Backspace:e=>yl(e.cm6,{key:"Backspace"},"editor"),Delete:e=>yl(e.cm6,{key:"Delete"},"editor")},He=class tS{openDialog(t,r,i){return g4(this,t,r,i)}openNotification(t,r){return h4(this,t,r)}constructor(t){this.state={},this.marks=Object.create(null),this.$mid=0,this.options={},this._handlers={},this.$lastChangeEndOffset=0,this.virtualSelection=null,this.cm6=t,this.onChange=this.onChange.bind(this),this.onSelectionChange=this.onSelectionChange.bind(this)}on(t,r){z1(this,t,r)}off(t,r){F1(this,t,r)}signal(t,r,i){q1(this,t,r,i)}indexFromPos(t){return Rn(this.cm6.state.doc,t)}posFromIndex(t){return mr(this.cm6.state.doc,t)}foldCode(t){let r=this.cm6,i=r.state.selection.ranges,l=this.cm6.state.doc,c=Rn(l,t),d=Kt.create([Kt.range(c,c)],0).ranges;r.state.selection.ranges=d,X8(r),r.state.selection.ranges=i}firstLine(){return 0}lastLine(){return this.cm6.state.doc.lines-1}lineCount(){return this.cm6.state.doc.lines}setCursor(t,r){typeof t=="object"&&(r=t.ch,t=t.line);var i=Rn(this.cm6.state.doc,{line:t,ch:r||0});this.cm6.dispatch({selection:{anchor:i}},{scrollIntoView:!this.curOp}),this.curOp&&!this.curOp.isVimOp&&this.onBeforeEndOperation()}getCursor(t){var r=this.cm6.state.selection.main,i=t=="head"||!t?r.head:t=="anchor"?r.anchor:t=="start"?r.from:t=="end"?r.to:null;if(i==null)throw Error("Invalid cursor type");return this.posFromIndex(i)}listSelections(){var t=this.cm6.state.doc;return this.cm6.state.selection.ranges.map(r=>({anchor:mr(t,r.anchor),head:mr(t,r.head)}))}setSelections(t,r){var i=this.cm6.state.doc,l=t.map(c=>{var d=Rn(i,c.head),f=Rn(i,c.anchor);return d==f?Kt.cursor(d,1):Kt.range(f,d)});this.cm6.dispatch({selection:Kt.create(l,r)})}setSelection(t,r,i){this.setSelections([{anchor:t,head:r}],0),i&&i.origin=="*mouse"&&this.onBeforeEndOperation()}getLine(t){var r=this.cm6.state.doc;return t<0||t>=r.lines?"":this.cm6.state.doc.line(t+1).text}getLineHandle(t){return this.$lineHandleChanges||(this.$lineHandleChanges=[]),{row:t,index:this.indexFromPos(new Ir(t,0))}}getLineNumber(t){var r=this.$lineHandleChanges;if(!r)return null;for(var i=t.index,l=0;l<r.length;l++)if(i=r[l].changes.mapPos(i,1,w_.TrackAfter),i==null)return null;var c=this.posFromIndex(i);return c.ch==0?c.line:null}releaseLineHandles(){this.$lineHandleChanges=void 0}getRange(t,r){var i=this.cm6.state.doc;return this.cm6.state.sliceDoc(Rn(i,t),Rn(i,r))}replaceRange(t,r,i,l){i||(i=r);var c=this.cm6.state.doc,d=Rn(c,r),f=Rn(c,i);Nl(this,{changes:{from:d,to:f,insert:t}})}replaceSelection(t){Nl(this,this.cm6.state.replaceSelection(t))}replaceSelections(t){var r=this.cm6.state.selection.ranges.map((i,l)=>({from:i.from,to:i.to,insert:t[l]||""}));Nl(this,{changes:r})}getSelection(){return this.getSelections().join(`
|
|
94
|
+
`)}getSelections(){var t=this.cm6;return t.state.selection.ranges.map(r=>t.state.sliceDoc(r.from,r.to))}somethingSelected(){return this.cm6.state.selection.ranges.some(t=>!t.empty)}getInputField(){return this.cm6.contentDOM}clipPos(t){var r=this.cm6.state.doc,i=t.ch,l=t.line+1;l<1&&(l=1,i=0),l>r.lines&&(l=r.lines,i=Number.MAX_VALUE);var c=r.line(l);return i=Math.min(Math.max(0,i),c.to-c.from),new Ir(l-1,i)}getValue(){return this.cm6.state.doc.toString()}setValue(t){var r=this.cm6;return r.dispatch({changes:{from:0,to:r.state.doc.length,insert:t},selection:Kt.range(0,0)})}focus(){return this.cm6.focus()}blur(){return this.cm6.contentDOM.blur()}defaultTextHeight(){return this.cm6.defaultLineHeight}findMatchingBracket(t,r){var i=this.cm6.state,l=Rn(i.doc,t),c=D_(i,l+1,-1);return c&&c.end||(c=D_(i,l,1),c&&c.end)?{to:mr(i.doc,c.end.from)}:{to:void 0}}scanForBracket(t,r,i,l){return b4(this,t,r,i,l)}indentLine(t,r){r?this.indentMore():this.indentLess()}indentMore(){pD(this.cm6)}indentLess(){hD(this.cm6)}execCommand(t){if(t=="indentAuto")tS.commands.indentAuto(this);else if(t=="goLineLeft")gD(this.cm6);else if(t=="goLineRight"){CD(this.cm6);let r=this.cm6.state,i=r.selection.main.head;i<r.doc.length&&r.sliceDoc(i,i+1)!==`
|
|
95
|
+
`&&xD(this.cm6)}else console.log(t+" is not implemented")}setBookmark(t,r){var i=r!=null&&r.insertLeft?1:-1,l=this.indexFromPos(t);return new _4(this,l,i)}addOverlay({query:t}){let r=new _D({regexp:!0,search:t.source,caseSensitive:!/i/.test(t.flags)});if(r.valid){r.forVim=!0,this.cm6Query=r;let i=Fh.of(r);return this.cm6.dispatch({effects:i}),r}}removeOverlay(t){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let r=Fh.of(this.cm6Query);this.cm6.dispatch({effects:r})}getSearchCursor(t,r){var i=this,l=null,c=null,d=!1;r.ch??(r.ch=Number.MAX_VALUE);var f=Rn(i.cm6.state.doc,r),h=t.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(E,A){return A||"\\"+E});function b(E,A=0,R=E.length){return new kD(E,h,{ignoreCase:t.ignoreCase},A,R)}function x(E){var A=i.cm6.state.doc;if(E>A.length)return null;let R=b(A,E).next();return R.done?null:R.value}var C=1e4;function S(E,A){var R=i.cm6.state.doc;for(let j=1;;j++){let q=Math.max(E,A-j*C),V=b(R,q,A),z=null;for(;!V.next().done;)z=V.value;if(z&&(q==E||z.from>q+10))return z;if(q==E)return null}}return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(E){var A=i.cm6.state.doc;return l=E?S(0,l?d?l.to-1:l.from:f):x(l?d?l.to+1:l.to:f),c=l&&{from:mr(A,l.from),to:mr(A,l.to),match:l.match},d=l?l.from==l.to:!1,l&&l.match},from:function(){return c==null?void 0:c.from},to:function(){return c==null?void 0:c.to},replace:function(E){l&&(Nl(i,{changes:{from:l.from,to:l.to,insert:E}}),l.to=l.from+E.length,c&&(c.to=mr(i.cm6.state.doc,l.to)))},get match(){return c&&c.match}}}findPosV(t,r,i,l){let{cm6:c}=this,d=c.state.doc,f=i=="page"?c.dom.clientHeight:0,h=Rn(d,t),b=Kt.cursor(h,1,void 0,l),x=Math.round(Math.abs(r));for(let S=0;S<x;S++)i=="page"?b=c.moveVertically(b,r>0,f):i=="line"&&(b=c.moveVertically(b,r>0));let C=mr(d,b.head);return(r<0&&b.head==0&&l!=0&&t.line==0&&t.ch!=0||r>0&&b.head==d.length&&C.ch!=l&&t.line==C.line)&&(C.hitSide=!0),C}charCoords(t,r){var i=this.cm6.contentDOM.getBoundingClientRect(),l=Rn(this.cm6.state.doc,t),c=this.cm6.coordsAtPos(l),d=-i.top;return{left:((c==null?void 0:c.left)||0)-i.left,top:((c==null?void 0:c.top)||0)+d,bottom:((c==null?void 0:c.bottom)||0)+d}}coordsChar(t,r){var i=this.cm6.contentDOM.getBoundingClientRect(),l=this.cm6.posAtCoords({x:t.left+i.left,y:t.top+i.top})||0;return mr(this.cm6.state.doc,l)}getScrollInfo(){var t=this.cm6.scrollDOM;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight,width:t.scrollWidth,clientHeight:t.clientHeight,clientWidth:t.clientWidth}}scrollTo(t,r){t!=null&&(this.cm6.scrollDOM.scrollLeft=t),r!=null&&(this.cm6.scrollDOM.scrollTop=r)}scrollIntoView(t,r){if(t){var i=this.indexFromPos(t);this.cm6.dispatch({effects:ot.scrollIntoView(i)})}else this.cm6.dispatch({scrollIntoView:!0,userEvent:"scroll"})}getWrapperElement(){return this.cm6.dom}getMode(){return{name:this.getOption("mode")}}setSize(t,r){this.cm6.dom.style.width=t+4+"px",this.cm6.dom.style.height=r+"px",this.refresh()}refresh(){this.cm6.measure()}destroy(){this.removeOverlay()}getLastEditEnd(){return this.posFromIndex(this.$lastChangeEndOffset)}onChange(t){for(let i in this.$lineHandleChanges&&this.$lineHandleChanges.push(t),this.marks)this.marks[i].update(t.changes);this.virtualSelection&&(this.virtualSelection.ranges=this.virtualSelection.ranges.map(i=>i.map(t.changes)));var r=this.curOp=this.curOp||{};t.changes.iterChanges((i,l,c,d,f)=>{(r.$changeStart==null||r.$changeStart>c)&&(r.$changeStart=c),this.$lastChangeEndOffset=d;var h={text:f.toJSON()};r.lastChange?r.lastChange.next=r.lastChange=h:r.lastChange=r.change=h},!0),r.changeHandlers||(r.changeHandlers=this._handlers.change&&this._handlers.change.slice())}onSelectionChange(){var t=this.curOp=this.curOp||{};t.cursorActivityHandlers||(t.cursorActivityHandlers=this._handlers.cursorActivity&&this._handlers.cursorActivity.slice()),this.curOp.cursorActivity=!0}operation(t,r){this.curOp||(this.curOp={$d:0}),this.curOp.$d++;try{var i=t()}finally{this.curOp&&(this.curOp.$d--,this.curOp.$d||this.onBeforeEndOperation())}return i}onBeforeEndOperation(){var t=this.curOp,r=!1;t&&(t.change&&$1(t.changeHandlers,this,t.change),t&&t.cursorActivity&&($1(t.cursorActivityHandlers,this,null),t.isVimOp&&(r=!0)),this.curOp=null),r&&this.scrollIntoView()}moveH(t,r){if(r=="char"){var i=this.getCursor();this.setCursor(i.line,i.ch+t)}}setOption(t,r){switch(t){case"keyMap":this.state.keyMap=r;break;case"textwidth":this.state.textwidth=r;break}}getOption(t){switch(t){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(v_)==" ";case"indentUnit":return this.cm6.state.facet(v_).length||2;case"textwidth":return this.state.textwidth;case"keyMap":return this.state.keyMap||"vim"}}toggleOverwrite(t){this.state.overwrite=t}getTokenTypeAt(t){var l,c,d;var r=this.indexFromPos(t),i=((d=(c=(l=C_(this.cm6.state,r))==null?void 0:l.resolve(r))==null?void 0:c.type)==null?void 0:d.name)||"";return/comment/i.test(i)?"comment":/string/i.test(i)?"string":""}overWriteSelection(t){var r=this.cm6.state.doc,i=this.cm6.state.selection,l=i.ranges.map(c=>{if(c.empty){var d=c.to<r.length?r.sliceString(c.from,c.to+1):"";if(d&&!/\n/.test(d))return Kt.range(c.from,c.to+1)}return c});this.cm6.dispatch({selection:Kt.create(l,i.mainIndex)}),this.replaceSelection(t)}isInMultiSelectMode(){return this.cm6.state.selection.ranges.length>1}virtualSelectionMode(){return!!this.virtualSelection}forEachSelection(t){var r=this.cm6.state.selection;this.virtualSelection=Kt.create(r.ranges,r.mainIndex);for(var i=0;i<this.virtualSelection.ranges.length;i++){var l=this.virtualSelection.ranges[i];l&&(this.cm6.dispatch({selection:Kt.create([l])}),t(),this.virtualSelection.ranges[i]=this.cm6.state.selection.ranges[0])}this.cm6.dispatch({selection:this.virtualSelection}),this.virtualSelection=null}hardWrap(t){return k4(this,t)}};He.isMac=typeof navigator<"u"&&/Mac/.test(navigator.platform),He.Pos=Ir,He.StringStream=lD,He.commands={cursorCharLeft:function(e){vD(e.cm6)},redo:function(e){V1(e,!1)},undo:function(e){V1(e,!0)},newlineAndIndent:function(e){wD({state:e.cm6.state,dispatch:t=>Nl(e,t)})},indentAuto:function(e){fD(e.cm6)},newlineAndIndentContinueComment:void 0,save:void 0},He.isWordChar=function(e){return $f.test(e)},He.keys=m4,He.addClass=function(e,t){},He.rmClass=function(e,t){},He.e_preventDefault=function(e){e.preventDefault()},He.e_stop=function(e){var t,r;(t=e==null?void 0:e.stopPropagation)==null||t.call(e),(r=e==null?void 0:e.preventDefault)==null||r.call(e)},He.lookupKey=function(e,t,r){var i=He.keys[e];!i&&/^Arrow/.test(e)&&(i=He.keys[e.slice(5)]),i&&r(i)},He.on=z1,He.off=F1,He.signal=q1,He.findMatchingTag=w4,He.findEnclosingTag=x4,He.keyName=void 0;function B1(e,t,r){var i=document.createElement("div");return i.appendChild(t),i}function H1(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}function h4(e,t,r){H1(e,f);var i=B1(e,t,r&&r.bottom),l=!1,c,d=r&&r.duration!==void 0?r.duration:5e3;function f(){l||(l=!0,clearTimeout(c),i.remove(),U1(e,i))}return i.onclick=function(h){h.preventDefault(),f()},W1(e,i),d&&(c=setTimeout(f,d)),f}function W1(e,t){var r=e.state.dialog;e.state.dialog=t,t.style.flex="1",t&&r!==t&&(r&&r.contains(document.activeElement)&&e.focus(),r&&r.parentElement?r.parentElement.replaceChild(t,r):r&&r.remove(),He.signal(e,"dialog"))}function U1(e,t){e.state.dialog==t&&(e.state.dialog=null,He.signal(e,"dialog"))}function g4(e,t,r,i){i||(i={}),H1(e,void 0);var l=B1(e,t,i.bottom),c=!1;W1(e,l);function d(h){if(typeof h=="string")f.value=h;else{if(c)return;c=!0,U1(e,l),e.state.dialog||e.focus(),i.onClose&&i.onClose(l)}}var f=l.getElementsByTagName("input")[0];return f&&(i.value&&(f.value=i.value,i.selectValueOnOpen!==!1&&f.select()),i.onInput&&He.on(f,"input",function(h){i.onInput(h,f.value,d)}),i.onKeyUp&&He.on(f,"keyup",function(h){i.onKeyUp(h,f.value,d)}),He.on(f,"keydown",function(h){i&&i.onKeyDown&&i.onKeyDown(h,f.value,d)||(h.keyCode==13&&r&&r(f.value),(h.keyCode==27||i.closeOnEnter!==!1&&h.keyCode==13)&&(f.blur(),He.e_stop(h),d()))}),i.closeOnBlur!==!1&&He.on(f,"blur",function(){setTimeout(function(){document.activeElement!==f&&d()})}),f.focus()),d}var y4={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function v4(e){return e&&e.bracketRegex||/[(){}[\]]/}function b4(e,t,r,i,l){for(var c=l&&l.maxScanLineLength||1e4,d=l&&l.maxScanLines||1e3,f=[],h=v4(l),b=r>0?Math.min(t.line+d,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-d),x=t.line;x!=b;x+=r){var C=e.getLine(x);if(C){var S=r>0?0:C.length-1,E=r>0?C.length:-1;if(!(C.length>c))for(x==t.line&&(S=t.ch-(r<0?1:0));S!=E;S+=r){var A=C.charAt(S);if(h.test(A)){var R=y4[A];if(R&&R.charAt(1)==">"==r>0)f.push(A);else if(f.length)f.pop();else return{pos:new Ir(x,S),ch:A}}}}}return x-r==(r>0?e.lastLine():e.firstLine())?!1:null}function w4(e,t){return null}function x4(e,t){var c,d,f;var r=e.cm6.state,i=e.indexFromPos(t);i<r.doc.length&&r.sliceDoc(i,i+1)=="<"&&i++;for(var l=((c=C_(r,i))==null?void 0:c.resolve(i))||null;l;){if(((d=l.firstChild)==null?void 0:d.type.name)=="OpenTag"&&((f=l.lastChild)==null?void 0:f.type.name)=="CloseTag")return{open:K1(r.doc,l.firstChild),close:K1(r.doc,l.lastChild)};l=l.parent}}function K1(e,t){return{from:mr(e,t.from),to:mr(e,t.to)}}var _4=class{constructor(e,t,r){this.cm=e,this.id=e.$mid++,this.offset=t,this.assoc=r,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,w_.TrackDel))}};function k4(e,t){var A;for(var r=t.column||e.getOption("textwidth")||80,i=t.allowMerge!=0,l=Math.min(t.from,t.to),c=Math.max(t.from,t.to);l<=c;){var d=e.getLine(l);if(d.length>r){var f=E(d,r,5);if(f){var h=(A=/^\s*/.exec(d))==null?void 0:A[0];e.replaceRange(`
|
|
96
|
+
`+h,new Ir(l,f.start),new Ir(l,f.end))}c++}else if(i&&/\S/.test(d)&&l!=c){var b=e.getLine(l+1);if(b&&/\S/.test(b)){var x=d.replace(/\s+$/,""),C=b.replace(/^\s+/,""),S=x+" "+C,f=E(S,r,5);f&&f.start>x.length||S.length<r?(e.replaceRange(" ",new Ir(l,x.length),new Ir(l+1,b.length-C.length)),l--,c--):x.length<d.length&&e.replaceRange("",new Ir(l,x.length),new Ir(l,d.length))}}l++}return l;function E(R,j,q){if(!(R.length<j)){var V=R.slice(0,j),z=R.slice(j),X=/^(?:(\s+)|(\S+)(\s+))/.exec(z),fe=/(?:(\s+)|(\s+)(\S+))$/.exec(V),F=0,H=0;if(fe&&!fe[2]&&(F=j-fe[1].length,H=j),X&&!X[2]&&(F||(F=j),H=j+X[1].length),F)return{start:F,end:H};if(fe&&fe[2]&&fe.index>q)return{start:fe.index,end:fe.index+fe[2].length};if(X&&X[2])return F=j+X[2].length,{start:F,end:F+X[3].length}}}}var Vf=rD||(function(){let e={cursorBlinkRate:1200};return function(){return e}})(),C4=class{constructor(e,t,r,i,l,c,d,f,h,b){this.left=e,this.top=t,this.height=r,this.fontFamily=i,this.fontSize=l,this.fontWeight=c,this.color=d,this.className=f,this.letter=h,this.partial=b}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}},S4=class{constructor(e,t){this.view=e,this.rangePieces=[],this.cursors=[],this.cm=t,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=Vf(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"),E4(e)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:e}=this.view,t=[];for(let r of e.selection.ranges){let i=r==e.selection.main,l=A4(this.cm,this.view,r,i);l&&t.push(l)}return{cursors:t}}drawSel({cursors:e}){if(e.length!=this.cursors.length||e.some((t,r)=>!t.eq(this.cursors[r]))){let t=this.cursorLayer.children;if(t.length!==e.length){this.cursorLayer.textContent="";for(let r of e)this.cursorLayer.appendChild(r.draw())}else e.forEach((r,i)=>r.adjust(t[i]));this.cursors=e}}destroy(){this.cursorLayer.remove()}};function E4(e){return Vf(e.startState)!=Vf(e.state)}var T4=hd.highest(ot.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 I4(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==oD.LTR?t.left:t.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function A4(e,t,r,i){var x,C,S;var l;let c=r.head,d=!1,f=1,h=e.state.vim;if(h&&(!h.insertMode||e.state.overwrite)){if(d=!0,h.visualBlock&&!i)return null;r.anchor<r.head&&(c<t.state.doc.length&&t.state.sliceDoc(c,c+1))!=`
|
|
97
|
+
`&&c--,e.state.overwrite?f=.2:h.status&&(f=.5)}if(d){let E=c<t.state.doc.length&&t.state.sliceDoc(c,c+1);E&&/[\uDC00-\uDFFF]/.test(E)&&c>1&&(c--,E=t.state.sliceDoc(c,c+1));let A=t.coordsAtPos(c,1);if(!A)return null;let R=I4(t),j=t.domAtPos(c),q=j?j.node:t.contentDOM;for(q instanceof Text&&j.offset>=q.data.length&&((x=q.parentElement)==null?void 0:x.nextSibling)&&(q=(C=q.parentElement)==null?void 0:C.nextSibling,j={node:q,offset:0});j&&j.node instanceof HTMLElement;)q=j.node,j={node:j.node.childNodes[j.offset],offset:0};if(!(q instanceof HTMLElement)){if(!q.parentNode)return null;q=q.parentNode}let V=getComputedStyle(q),z=A.left,X=(S=(l=t).coordsForChar)==null?void 0:S.call(l,c);if(X&&(z=X.left),!E||E==`
|
|
98
|
+
`||E=="\r")E="\xA0";else if(E==" "){E="\xA0";var b=t.coordsAtPos(c+1,-1);b&&(z=b.left-(b.left-A.left)/parseInt(V.tabSize))}else/[\uD800-\uDBFF]/.test(E)&&c<t.state.doc.length-1&&(E+=t.state.sliceDoc(c+1,c+2));let fe=A.bottom-A.top;return new C4((z-R.left)/t.scaleX,(A.top-R.top+fe*(1-f))/t.scaleY,fe*f/t.scaleY,V.fontFamily,V.fontSize,V.fontWeight,V.color,i?"cm-fat-cursor cm-cursor-primary":"cm-fat-cursor cm-cursor-secondary",E,f!=1)}else return null}let Q1,G1,X1,Y1;Q1=typeof navigator<"u"&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent),ha=p4(He),G1=250,X1=ot.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"}}),Y1=Un.fromClass(class{constructor(e){this.status="",this.query=null,this.decorations=St.none,this.waitForCopy=!1,this.lastKeydown="",this.useNextTextInput=!1,this.compositionText="",this.view=e;let t=this.cm=new He(e);ha.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new S4(e,t),this.updateClass(),this.cm.on("vim-command-done",()=>{t.state.vim&&(t.state.vim.status=""),this.blockCursor.scheduleRedraw(),this.updateStatus()}),this.cm.on("vim-mode-change",r=>{t.state.vim&&(t.state.vim.mode=r.mode,r.subMode&&(t.state.vim.mode+=" block"),t.state.vim.status="",this.blockCursor.scheduleRedraw(),this.updateClass(),this.updateStatus())}),this.cm.on("dialog",()=>{this.cm.state.statusbar?this.updateStatus():e.dispatch({effects:J1.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=r=>{ha.handleKey(this.cm,"<Esc>","user"),this.cm.focus()},this.statusButton.style.cssText="cursor: pointer"}update(e){var t;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 r of e.transactions)for(let i of r.effects)if(i.is(Fh))if(!((t=i.value)!=null&&t.forVim))this.highlight(null);else{let l=i.value.create();this.highlight(l)}}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,t=this.cm.state.vim;if(!e||!t)return;let r=this.cm.state.dialog;if(r)r.parentElement!=e&&(e.textContent="",e.appendChild(r));else{e.textContent="";var i=(t.mode||"normal").toUpperCase();t.insertModeReturn&&(i+="(C-O)"),this.statusButton.textContent=`--${i}--`,e.appendChild(this.statusButton),e.appendChild(this.spacer)}this.dom.textContent=t.status,e.appendChild(this.dom)}destroy(){ha.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=St.none;let{view:t}=this,r=new Bs;for(let i=0,l=t.visibleRanges,c=l.length;i<c;i++){let{from:d,to:f}=l[i];for(;i<c-1&&f>l[i+1].from-2*G1;)f=l[++i].to;e.highlight(t.state,d,f,(h,b)=>{r.add(h,b,D4)})}return this.decorations=r.finish()}handleKey(e,t){let r=this.cm,i=r.state.vim;if(!i)return;let l=ha.vimKeyFromEvent(e,i);if(He.signal(this.cm,"inputEvent",{type:"handleKey",key:l}),!l)return;if(l=="<Esc>"&&!i.insertMode&&!i.visualMode&&this.query){let d=i.searchState_;d&&(r.removeOverlay(d.getOverlay()),d.setOverlay(null))}if(l==="<C-c>"&&!He.isMac&&r.somethingSelected())return this.waitForCopy=!0,!0;i.status=(i.status||"")+l;let c=ha.multiSelectHandleKey(r,l,"user");return i=ha.maybeInitVimState_(r),!c&&i.insertMode&&r.state.overwrite&&(e.key&&e.key.length==1&&!/\n/.test(e.key)?(c=!0,r.overWriteSelection(e.key)):e.key=="Backspace"&&(c=!0,He.commands.cursorCharLeft(r))),c&&(He.signal(this.cm,"vim-keypress",l),e.preventDefault(),e.stopPropagation(),this.blockCursor.scheduleRedraw()),this.updateStatus(),!!c}},{eventHandlers:{copy:function(e,t){this.waitForCopy&&(this.waitForCopy=!1,Promise.resolve().then(()=>{var r=this.cm,i=r.state.vim;i&&(i.insertMode?r.setSelection(r.getCursor(),r.getCursor()):r.operation(()=>{r.curOp&&(r.curOp.isVimOp=!0),ha.handleKey(r,"<Esc>","user")}))}))},compositionstart:function(e,t){this.useNextTextInput=!0,He.signal(this.cm,"inputEvent",e)},compositionupdate:function(e,t){He.signal(this.cm,"inputEvent",e)},compositionend:function(e,t){He.signal(this.cm,"inputEvent",e)},keypress:function(e,t){He.signal(this.cm,"inputEvent",e),this.lastKeydown=="Dead"&&this.handleKey(e,t)},keydown:function(e,t){He.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,t))}},provide:()=>[ot.inputHandler.of((e,t,r,i)=>{var x,C;var l=Ks(e);if(!l)return!1;var c=(x=l.state)==null?void 0:x.vim,d=l.state.vimPlugin;if(c&&!c.insertMode&&!((C=l.curOp)!=null&&C.isVimOp)){if(i==="\0\0")return!0;if(He.signal(l,"inputEvent",{type:"text",text:i,from:t,to:r}),i.length==1&&d.useNextTextInput){if(c.expectLiteralNext&&e.composing)return d.compositionText=i,!1;if(d.compositionText){var f=d.compositionText;d.compositionText="";var h=e.state.selection.main.head;if(f===e.state.sliceDoc(h-f.length,h)){var b=l.getCursor();l.replaceRange("",l.posFromIndex(h-f.length),b)}}return d.handleKey({key:i,preventDefault:()=>{},stopPropagation:()=>{}}),L4(e),!0}}return!1})],decorations:e=>e.decorations});function L4(e){var t=e.scrollDOM.parentElement;if(t){if(Q1){e.contentDOM.textContent="\0\0",e.contentDOM.dispatchEvent(new CustomEvent("compositionend"));return}var r=e.scrollDOM.nextSibling,i=window.getSelection(),l=i&&{anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset};e.scrollDOM.remove(),t.insertBefore(e.scrollDOM,r);try{l&&i&&(i.setPosition(l.anchorNode,l.anchorOffset),l.focusNode&&i.extend(l.focusNode,l.focusOffset))}catch(c){console.error(c)}e.focus(),e.contentDOM.dispatchEvent(new CustomEvent("compositionend"))}}var D4=St.mark({class:"cm-searchMatch"}),J1=Ln.define(),O4=Cr.define({create:()=>!1,update(e,t){for(let r of t.effects)r.is(J1)&&(e=r.value);return e},provide:e=>jh.from(e,t=>t?M4:null)});function M4(e){let t=document.createElement("div");t.className="cm-vim-panel";let r=e.cm;return r.state.dialog&&t.appendChild(r.state.dialog),{top:!1,dom:t}}function R4(e){let t=document.createElement("div");t.className="cm-vim-panel";let r=e.cm;return r.state.statusbar=t,r.state.vimPlugin.updateStatus(),{dom:t}}KC=function(e={}){return[X1,Y1,T4,e.status?jh.of(R4):O4]},Ks=function(e){return e.cm||null},W0=function(e){let t=e.state.selection.main;return t.from===0&&t.to===0},K0=function(e,t=!1){let r=e.state.selection.main,i=e.state.doc.length;return t&&r.from===i-1&&r.to===i-1?!0:r.from===i&&r.to===i},yg=function(e){e&&e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length}})},fC=function(e){requestAnimationFrame(()=>{var r;let t=(r=e.current)==null?void 0:r.view;t&&(t.focus(),yg(t))})},F0=function(e){let t=e.dom.closest(".marimo-cell");t&&requestAnimationFrame(()=>{t.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"})})},jk=function(e){var t;return((t=Ks(e))==null?void 0:t.state.vim)!=null},BC=function(e){var r;let t=(r=Ks(e))==null?void 0:r.state.vim;return t?!t.mode&&!t.insertMode&&!t.visualMode?!0:t.mode==="normal":!1},XC=function(e){e&&e.dispatch({selection:{anchor:0,head:e.state.doc.length}})};var P4=new Set([we.ClassDefinition]);function Z1(e,t){requestAnimationFrame(()=>{e.focus(),e.dispatch({selection:{anchor:t,head:t},effects:ot.scrollIntoView(t,{y:"center"})})}),F0(e)}function N4(e,t){let r=Nh(e),i=null;return r.iterate({enter:l=>{if(i!==null)return!1;if(l.name===we.VariableName&&e.doc.sliceString(l.from,l.to)===t)return i=l.from,!1;if(l.name===we.Comment||l.name===we.String)return!1}}),i}function j4(e,t){let r=[],i=e.resolveInner(t,0);for(;i;)kl.has(i.name)&&(r.some(l=>l.type===we.FunctionDefinition||l.type===we.LambdaExpression)&&i.name===we.ClassDefinition||r.push({id:i.from,type:i.name})),i=i.parent;return r.push({id:-1,type:"global"}),r}function jl(e,t,r){e.push({scopeId:t,from:r})}function z4(e,t){if(e.firstChild())do t(e.node);while(e.nextSibling())}function Bf(e,t){let{state:r,variableName:i,scopeId:l,declarations:c}=t;switch(e.name){case we.VariableName:r.doc.sliceString(e.from,e.to)===i&&jl(c,l,e.from);break;case we.TupleExpression:case we.ArrayExpression:{let d=e.node.cursor();d.firstChild();do Bf(d,t);while(d.nextSibling());break}default:break}}function ev(e,t){let{state:r,variableName:i,scopeId:l,declarations:c}=t,d=e.cursor();d.firstChild();do{if(d.name!==we.ParamList)continue;let f=d.node.cursor();f.firstChild();do f.name===we.VariableName&&r.doc.sliceString(f.from,f.to)===i&&jl(c,l,f.from);while(f.nextSibling())}while(d.nextSibling())}function F4(e,t){let r=e.cursor();r.firstChild();let i=!1;do if(r.name===yn.For)i=!0;else{if(i&&r.name===yn.In)break;i&&Bf(r,t)}while(r.nextSibling())}function tv(e,t){let{state:r,variableName:i,scopeStack:l,declarations:c}=t,d=e.cursor(),f=d.name,h=d.from,b=kl.has(f)?[...l,h]:l,x=b[b.length-1]??-1;switch(f){case we.FunctionDefinition:case we.ClassDefinition:{let C=e.cursor();C.firstChild();do if(C.name===we.VariableName&&r.doc.sliceString(C.from,C.to)===i){jl(c,l[l.length-1]??-1,C.from);break}while(C.nextSibling());f===we.FunctionDefinition&&ev(e,{state:r,variableName:i,scopeId:h,declarations:c});break}case we.LambdaExpression:ev(e,{state:r,variableName:i,scopeId:h,declarations:c});break;case we.ArrayComprehensionExpression:case we.DictionaryComprehensionExpression:case we.SetComprehensionExpression:case we.ComprehensionExpression:case we.ForStatement:F4(e,{state:r,variableName:i,scopeId:x,declarations:c});break;case we.AssignStatement:{let C=[],S=e.cursor();S.firstChild();do S.name===we.AssignOp&&C.push(S.from);while(S.nextSibling());let E=C[C.length-1];if(E===void 0)break;let A=e.cursor();A.firstChild();do A.from<E&&Bf(A,{state:r,variableName:i,scopeId:x,declarations:c});while(A.nextSibling());break}case we.ImportStatement:{let C=e.cursor();C.firstChild();let S=!1,E=null,A=()=>{E!=null&&E.matches&&jl(c,x,E.from),E=null};do{if(C.name===yn.Import){S=!0;continue}if(S){if(C.name===yn.As){E=null;continue}C.name===we.VariableName?(A(),E={from:C.from,matches:r.doc.sliceString(C.from,C.to)===i}):C.name===","&&A()}}while(C.nextSibling());A();break}case we.TryStatement:case we.WithStatement:{let C=e.cursor();C.firstChild();let S=!1;do C.name===yn.As?S=!0:S&&C.name===we.VariableName&&r.doc.sliceString(C.from,C.to)===i&&(jl(c,x,C.from),S=!1);while(C.nextSibling());break}default:break}z4(d,C=>{tv(C,{state:r,variableName:i,scopeStack:b,declarations:c})})}function q4(e,t,r){let i=Nh(e),l=[];tv(i,{state:e,variableName:t,scopeStack:[],declarations:l});let c=Math.max(0,Math.min(r,e.doc.length));for(let d of j4(i,c)){let f=l.filter(h=>h.scopeId===d.id).filter(h=>P4.has(d.type)?h.from<=c:!0).toSorted((h,b)=>h.from-b.from)[0];if(f)return f.from}return null}ic=function(e,t,r){let{state:i}=e,l=r===void 0?N4(i,t):q4(i,t,r);return l===null?!1:(Z1(e,l),!0)};function $4(e,t){return Z1(e,e.state.doc.line(t).from),!0}function V4(e,t){let r=Te.get(C8);return(r==="mac"?e.mac??e.key:r==="windows"?e.win??e.key:e.linux??e.key)===t}function B4(e){let{from:t,to:r}=e.selection.main;if(t===r){let{startToken:i,endToken:l}=qf(e.doc,t);return{position:i,word:e.doc.sliceString(i,l)}}return{position:t,word:e.doc.sliceString(t,r)}}function H4(e,t){if(!t)return null;let r=e[t];return!r||r.declaredBy.length===0?null:r.declaredBy[0]}function W4(e){return e.startsWith("_")}zd=function(e){let{state:t}=e,{position:r,word:i}=B4(t);return i?(N_(e),e.dispatch({effects:sD}),K4(e,i,r)):!1};function U4(e,t=Te.get(S8).getHotkey("cell.goToDefinition").key){var r;for(let i of e.state.facet(qr).flat())if(V4(i,t)&&((r=i.run)!=null&&r.call(i,e)))return!0;return!1}eC=function(e){return zd(e)?!0:U4(e)};function K4(e,t,r){if(r!==void 0&&ic(e,t,r))return!0;let i=Q4(e,t);return i?ic(i,t):!1}zC=function(e,t){let r=nv(e);return r?$4(r,t):!1};function Q4(e,t){if(W4(t))return e;let r=H4(Te.get(li),t);return r?nv(r):null}function nv(e){var t;return((t=Te.get(Je).cellHandles[e].current)==null?void 0:t.editorView)??null}const zl=Ie(null);Kk=function(e){let t=Te.get(zl);if(e===null){Te.set(zl,null);return}(t==null?void 0:t.cellId)===e.cellId&&t.line===e.line||Te.set(zl,{...e,startedAtMs:Date.now()})};const ho=Ie(new Map);var G4=new Set;function X4(e){return Ie(t=>{let r=t(zl);return(r==null?void 0:r.cellId)===e?r.line:null})}function Y4(e){return Ie(t=>{let r=t(zl);return(r==null?void 0:r.cellId)===e?{line:r.line,startedAtMs:r.startedAtMs}:null})}function J4(e){return Ie(t=>t(ho).get(e)??G4)}function Hf(e){let t={};for(let[r,i]of e)i.size>0&&(t[r]=[...i].toSorted((l,c)=>l-c));Kn().sendSetBreakpoints({breakpoints:t}).catch(r=>{be.debug("Failed to sync breakpoints to kernel",{error:r})})}bC=function(e){let t=Te.get(ho);if(!t.has(e))return;let r=new Map(t);r.delete(e),Te.set(ho,r),Hf(r)},AC=function(){let e=Te.get(ho);e.size>0&&Hf(e)},ng=function(e,t){let r=Te.get(ho),i=new Map(r),l=new Set(i.get(e)??[]);l.has(t)?l.delete(t):l.add(t),l.size>0?i.set(e,l):i.delete(e),Te.set(ho,i),Hf(i)};function rv(e,t){if(t==null||t<1||t>e.doc.lines)return St.none;let r=new Bs;try{let i=e.doc.line(t);r.add(i.from,i.from,St.line({class:"cm-debugger-current-line"}))}catch(i){be.debug("Invalid debugger line",{error:i})}return r.finish()}var Z4=class{constructor(e,t){this.decorations=rv(e.state,t.get()),this.unsubscribe=t.sub(r=>{this.decorations=rv(e.state,r),e.dispatch({userEvent:"marimo.debugger-line-update"})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function eT(e){return[Un.define(t=>new Z4(t,e),{decorations:t=>t.decorations}),ot.theme({".cm-debugger-current-line":{backgroundColor:"color-mix(in srgb, var(--amber-4) 50%, transparent)"}})]}var av=new class extends E_{toDOM(){let e=document.createElement("div");return e.className="cm-breakpoint-marker",e}},iv=Ln.define(),ov=Cr.define({create:()=>new Set,update(e,t){for(let r of t.effects)if(r.is(iv))return r.value;return e}});function tT(e){let t=e.field(ov);if(t.size===0)return b_.empty;let r=new Bs;for(let i of[...t].toSorted((l,c)=>l-c))if(i>=1&&i<=e.doc.lines){let l=e.doc.line(i);r.add(l.from,l.from,av)}return r.finish()}var nT=class{constructor(e,t){let r=i=>{e.dispatch({effects:iv.of(i)})};t.get().size>0&&queueMicrotask(()=>r(t.get())),this.unsubscribe=t.sub(r)}destroy(){this.unsubscribe()}};function rT(e,t){return[ov,Un.define(r=>new nT(r,t)),S_({class:"cm-breakpoint-gutter",markers:r=>tT(r.state),initialSpacer:()=>av,domEventHandlers:{mousedown:(r,i)=>{let l=r.state.doc.lineAt(i.from).number;return ng(e,l),!0}}}),ot.theme({".cm-breakpoint-gutter":{width:"14px",cursor:"pointer"},".cm-breakpoint-marker":{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"var(--red-9)",margin:"4px auto"}})]}G0=class Zd{static fromMilliseconds(t){return t==null?null:new Zd(t)}static fromSeconds(t){return t==null?null:new Zd(t*1e3)}static now(){return new Zd(Date.now())}constructor(t){this.ms=t}toMilliseconds(){return this.ms}toSeconds(){return this.ms/1e3}},j0=function(e){if(e===null)return"";let t=e,r=t/1e3;return r>=60?`${Math.floor(r/60)}m${Math.floor(r%60)}s`:r>=1?`${r.toFixed(2).toString()}s`:`${t.toFixed(0).toString()}ms`};var aT=500,iT=250,oT=(Vr=class extends aD{constructor(t){super(),this.startedAtMs=t}eq(t){return t.startedAtMs===this.startedAtMs}toDOM(){let t=document.createElement("span");t.className="cm-line-timer",t.setAttribute("aria-hidden","true");let r=()=>{let i=Date.now()-this.startedAtMs;t.textContent=i>=aT?j0(i):""};return r(),Vr.intervals.set(t,window.setInterval(r,iT)),t}destroy(t){let r=Vr.intervals.get(t);r!==void 0&&(window.clearInterval(r),Vr.intervals.delete(t))}ignoreEvent(){return!0}},ae(Vr,"intervals",new WeakMap),Vr);function lv(e,t){if(t===null||t.line<1||t.line>e.doc.lines)return St.none;let r=new Bs;try{let i=e.doc.line(t.line);r.add(i.from,i.from,St.line({class:"cm-timing-current-line"})),r.add(i.to,i.to,St.widget({widget:new oT(t.startedAtMs),side:1}))}catch(i){be.debug("Invalid timing line",{error:i})}return r.finish()}var lT=class{constructor(e,t){this.decorations=lv(e.state,t.get()),this.unsubscribe=t.sub(r=>{this.decorations=lv(e.state,r),e.dispatch({userEvent:"marimo.timing-line-update"})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function sT(e){return[Un.define(t=>new lT(t,e),{decorations:t=>t.decorations}),ot.theme({".cm-timing-current-line":{backgroundColor:"color-mix(in srgb, var(--grass-4) 50%, transparent)"},".cm-line-timer":{color:"var(--grass-11)",fontSize:"0.85em",marginLeft:"1.5ch",pointerEvents:"none"}})]}function sv(e,t){if(!(t!=null&&t.length))return St.none;let r=new Bs,i=e.facet(ga),l=t.filter(c=>c.kind==="cell"&&c.cellId===i).toSorted((c,d)=>c.lineNumber-d.lineNumber);for(let c of l)try{let d=e.doc.line(c.lineNumber),f=St.line({class:"cm-error-line"});r.add(d.from,d.from,f)}catch(d){be.debug("Invalid line number in error decoration",{error:d})}return r.finish()}function cv(e,t){if(!(t!=null&&t.length))return;let r=e.state.facet(ga),i=t.filter(d=>d.kind==="cell"&&d.cellId===r);if(i.length===0)return;let l=iD(e.state),c=[];for(let d of i)try{let f=e.state.doc.line(d.lineNumber);l.between(f.from,f.to,(h,b)=>{c.push(tD.of({from:h,to:b}))})}catch(f){be.debug("Invalid line numbers",{error:f})}c.length>0&&e.dispatch({effects:c})}var cT=class{constructor(e,t){let r=t.get();this.decorations=sv(e.state,r),cv(e,r),this.unsubscribe=t.sub(i=>{let l=this.decorations.size;this.decorations=sv(e.state,i),cv(e,i),l!==this.decorations.size&&e.dispatch({userEvent:"marimo.error-decoration-update"})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function uT(e){return Un.define(t=>new cT(t,e),{decorations:t=>t.decorations})}function dT(e){return[uT(e),ot.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-5) 40%, transparent)"}})]}function fT({cellId:e,hotkeys:t}){let r=[];return r.push(...u_({key:t.getHotkey("cell.run").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(st).onRun(),!0)}),{key:t.getHotkey("cell.runAndNewBelow").key,preventDefault:!0,stopPropagation:!0,run:i=>{let l=i.state.facet(st);return l.onRun(),e==="__scratch__"||(i.contentDOM.blur(),l.moveToNextCell({cellId:e,before:!1})),!0}},...u_({key:t.getHotkey("cell.runAndNewAbove").key,preventDefault:!0,stopPropagation:!0,run:i=>{let l=i.state.facet(st);return l.onRun(),e==="__scratch__"||(i.contentDOM.blur(),l.moveToNextCell({cellId:e,before:!0})),!0}}),{key:t.getHotkey("cell.aiCompletion").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(st).aiCellCompletion()&&i.contentDOM.focus(),!0)}),e!=="__scratch__"&&r.push({key:t.getHotkey("cell.goToDefinition").key,run:i=>zd(i)},{key:t.getHotkey("cell.delete").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.doc.length===0&&i.state.facet(st).deleteCell(),!0)},{key:t.getHotkey("cell.moveUp").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(st).moveCell({cellId:e,before:!0}),!0)},{key:t.getHotkey("cell.moveDown").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(st).moveCell({cellId:e,before:!1}),!0)},{key:t.getHotkey("cell.moveLeft").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(st).moveCell({cellId:e,before:!0,direction:"left"}),!0)},{key:t.getHotkey("cell.moveRight").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(st).moveCell({cellId:e,before:!1,direction:"right"}),!0)},{key:"ArrowUp",run:i=>P_(i.state)?!1:W0(i)?(i.state.facet(st).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0):!1},{key:"ArrowDown",run:i=>P_(i.state)?!1:K0(i)?(i.state.facet(st).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0):!1},{key:t.getHotkey("cell.focusDown").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(st).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0)},{key:t.getHotkey("cell.focusUp").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(st).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0)},{key:t.getHotkey("cell.sendToBottom").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(st).sendToBottom({cellId:e}),!0)},{key:t.getHotkey("cell.sendToTop").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.state.facet(st).sendToTop({cellId:e}),!0)},{key:t.getHotkey("cell.createAbove").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.contentDOM.blur(),i.state.facet(st).createNewCell({cellId:e,before:!0}),!0)},{key:t.getHotkey("cell.createBelow").key,preventDefault:!0,stopPropagation:!0,run:i=>(i.contentDOM.blur(),i.state.facet(st).createNewCell({cellId:e,before:!1}),!0)},{key:t.getHotkey("cell.hideCode").key,preventDefault:!0,stopPropagation:!0,run:i=>{var c;let l=i.state.facet(st).toggleHideCode();return N_(i),l?(i.contentDOM.blur(),(c=document.getElementById(Dn.create(e)))==null||c.focus()):i.contentDOM.focus(),!0}},{key:t.getHotkey("cell.splitCell").key,preventDefault:!0,stopPropagation:!0,run:i=>{let l=i.state.facet(st);return l.splitCell({cellId:e}),l.moveToNextCell&&requestAnimationFrame(()=>{i.contentDOM.blur(),l.moveToNextCell({cellId:e,before:!1})}),!0}}),[hd.high(qr.of(r))]}function pT(e){return[ot.updateListener.of(t=>{if(t.docChanged){let r=t.transactions.some(d=>d.effects.some(f=>f.is(Pl))),i=Sr(t.view),l=t.view.state.facet(st),c=t.view.state.facet(ga);l.updateCellCode({cellId:c,code:i,formattingChange:r}),Te.get($d).has(c)&&Te.set(ug)}}),KE(e)]}var mT=["input","delete","undo","redo"];function hT({docChanged:e,transactions:t,predicate:r=()=>!0,hasFocus:i=!1}){return!e||!r()||t.some(l=>l.effects.some(c=>c.is(Pl)))?!1:t.some(l=>l.annotation(ci)===void 0?mT.some(c=>l.isUserEvent(c))||i:!1)}function gT({predicate:e}){return ot.updateListener.of(t=>{hT({docChanged:t.docChanged,transactions:t.transactions,predicate:e,hasFocus:t.view.hasFocus})&&t.view.state.facet(st).onRun()})}TC=function({cellId:e,hotkeys:t,cellActions:r}){let i=xl("debugger"),l=xl("line_timing");return[st.of(r),ga.of(e),fT({cellId:e,hotkeys:t}),pT(t),dT(xc(MA(e),Te)),i?rT(e,xc(J4(e),Te)):[],l?sT(xc(Y4(e),Te)):i?eT(xc(X4(e),Te)):[]]};const _c=Ln.define();var yT=20;function vT(e){let{state:t,anchor:r,head:i}=e;if(i<r)return!1;let l=t.doc.lineAt(i).number,c=t.doc.lineAt(r).number,d=Math.max(c,l-yT+1),f=Math.max(r,t.doc.line(d).from),h=f>r,b=h?1:0,x=t.doc.iterRange(f,i);for(;;){let{value:C,done:S}=x.next();if(S)break;for(let E of C)if(E==="(")b++;else if(E===")"&&(b--,h?b<=0:b<0))return!1}return!0}function bT(e){return{...e,create:t=>{let{dom:r,...i}=e.create(t),l=document.createElement("div");return l.classList.add("mo-cm-tooltip"),l.append(r),{...i,dom:l}}}}Kd=Cr.define({create:()=>null,update(e,t){for(let r of t.effects)if(r.is(_c))return r.value;if(!e||t.selection&&!t.docChanged)return null;if(t.docChanged){let r=t.changes.mapPos(e.pos);return vT({state:t.state,anchor:r,head:t.state.selection.main.head})?{...e,pos:r}:null}return e},provide:e=>x_.from(e)}),PC=function(e){return e.state.field(Kd,!1)?(e.dispatch({effects:_c.of(null)}),!0):!1};const uv=async e=>{var d,f;let t=e.state.doc.sliceString(0,e.pos),r=document.activeElement,i=null;if(r!==null){let h=Dn.findElement(r);h!==null&&(i=Dn.parse(h.id))}if(i===null)return be.error("Failed to find active cell."),null;let l=await xd.request({document:t,cellId:i});if(!l)return(d=e.view)==null||d.dispatch({effects:_c.of(null)}),null;let c=Ff.asHoverTooltip({position:e.pos,message:l,limitToType:"tooltip"});return c&&Te.set(_d,{documentation:c.html??null}),(f=e.view)==null||f.dispatch({effects:_c.of(c?bT(c):null)}),c?null:Ff.asCompletionResult(e.pos,l)};function wT(e){return t=>e.predicate(t.state)?e.completion(t):null}var xT=async e=>{let t=e.matchBefore(/:\w*$/);if(!e.explicit&&!t)return null;let r=await _T();return{from:(t==null?void 0:t.from)??e.pos,options:r,validFor:/^[\w:]*$/}},_T=dr(async()=>{let e=await fetch("https://unpkg.com/emojilib@3.0.11/dist/emoji-en-US.json").then(t=>{if(!t.ok)throw Error("Failed to fetch emoji list");return t.json()}).catch(()=>({}));return Object.entries(e).map(([t,r])=>({shortcode:r[0],label:r.map(i=>`:${i}`).join(" "),emoji:t,displayLabel:`${t} ${r[0].replaceAll("_"," ")}`,apply:t,type:"emoji"}))}),kT=async e=>{let t=e.matchBefore(/::[\w-:]*$/);if(!e.explicit&&!t)return null;let r=await CT();return{from:(t==null?void 0:t.from)??e.pos,options:r,validFor:/^[\w-:]*$/}},CT=dr(async()=>{let e=await fetch("https://unpkg.com/lucide-static@0.452.0/tags.json").then(r=>{if(!r.ok)throw Error("Failed to fetch Lucide icon list");return r.json()}).catch(()=>({})),t=r=>`https://cdn.jsdelivr.net/npm/lucide-static@0.452.0/icons/${r}.svg`;return Object.entries(e).map(([r,i])=>({label:`::${r}`,displayLabel:r,type:"lucide-icon",boost:10,apply:`::lucide:${r}::`,detail:i.join(", "),info:()=>{let l=document.createElement("img");return l.src=t(r),l.style.width="24px",l.style.height="24px",l}}))}),ST=e=>{let t=e.matchBefore(/\\\w*$/);return!e.explicit&&!t?null:{from:(t==null?void 0:t.from)??e.pos,options:ET(),validFor:/^[\w\\]*$/}},ET=dr(()=>[["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,t,r])=>({label:`\\${e} ${r}`,displayLabel:e,type:"latex-symbol",boost:10,apply:`\\${e}`,info:()=>{let i=document.createElement("div");return i.textContent=`${t} ${r}`,i},detail:t})));const TT=[xT,kT,ST];var IT=100;function go(e){return!e.state.selection.main.empty}function Wf({view:e,selection:t,markup:r}){let i=[],l=!0;for(let c=t.from;c<=t.to;c++)if(!e.state.doc.lineAt(c).text.startsWith(r)){l=!1;break}for(let c=t.from;c<=t.to;){let d=e.state.doc.lineAt(c),f=d.text.startsWith(r);l?i.push({from:d.from,to:d.from+r.length,insert:eo.of([""])}):(f&&i.push({from:d.from,to:d.from+r.length,insert:eo.of([""])}),i.push({from:d.from,insert:eo.of([r])})),c=d.to+1}return i}function Uf({view:e,range:t,markupAfter:r,markupBefore:i}){if(t.empty){let b=e.state.wordAt(t.head);b&&(t=b)}let l=e.state.sliceDoc(t.from-i.length,t.from)===i,c=e.state.sliceDoc(t.to,t.to+r.length)===r,d=[];d.push(l?{from:t.from-i.length,to:t.from,insert:eo.of([""])}:{from:t.from,insert:eo.of(i.split(`
|
|
99
|
+
`))},c?{from:t.to,to:t.to+r.length,insert:eo.of([""])}:{from:t.to,insert:eo.of(r.split(`
|
|
100
|
+
`))});let f=l?-i.length:i.length,h=c?-r.length:r.length;return{changes:d,range:Kt.range(t.from+f,t.to+h)}}function AT(e){if(!go(e))return!1;let t=Wf({view:e,selection:e.state.selection.main,markup:"> "});return t.length>0&&e.dispatch(e.state.update({changes:t,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function LT(e){if(!go(e))return!1;let t=e.state.changeByRange(r=>{if(r.empty){let i=e.state.wordAt(r.head);i&&(r=i)}return Uf({view:e,range:r,markupBefore:"**",markupAfter:"**"})});return e.dispatch(e.state.update(t,{scrollIntoView:!0,annotations:gl.userEvent.of("input")})),e.focus(),!0}function dv(e){if(!go(e))return!1;let t=e.state.changeByRange(r=>{if(r.empty){let l=e.state.wordAt(r.head);l&&(r=l)}let i=e.state.doc.lineAt(r.from).number!==e.state.doc.lineAt(r.to).number;return Uf({view:e,range:r,markupBefore:i?"```\n":"`",markupAfter:i?"\n```":"`"})});return e.dispatch(e.state.update(t,{scrollIntoView:!0,annotations:gl.userEvent.of("input")})),e.focus(),!0}function DT(e){let t=e.state.changeByRange(r=>{if(r.empty){let i=e.state.wordAt(r.head);i&&(r=i)}return Uf({view:e,range:r,markupBefore:"_",markupAfter:"_"})});return e.dispatch(e.state.update(t,{scrollIntoView:!0,annotations:gl.userEvent.of("input")})),e.focus(),!0}function fv(e,t="http://"){if(!go(e))return!1;let r=e.state.changeByRange(l=>{let c=e.state.sliceDoc(l.from,l.to);return{changes:[{from:l.from,to:l.to,insert:`[${c}](${t})`}],range:l}});e.dispatch(e.state.update(r,{scrollIntoView:!0,annotations:gl.userEvent.of("input")}));let{to:i}=r.selection.main;try{e.dispatch({selection:Kt.create([Kt.range(i+3,i+3+t.length),Kt.cursor(i+3+t.length)])})}catch{}return e.focus(),!0}Qh=async function(e,t){var f;let r=new FileReader,i=await new Promise(h=>{r.onload=()=>h(r.result),r.readAsDataURL(t)}),l;try{if(i.startsWith("data:")){let h=prompt("We can save your image as a file. Enter a filename.",t.name),b=t.type.split("/")[1];if(h===null){let x=Math.round(i.length/1024);if(x>IT){Ws({title:"Content too large",description:`The content size is ${x} KB, which is too large to paste directly into the document.`});return}}else{h.trim()===""?h=t.name:h.endsWith(`.${b}`)||(h=`${h}.${b}`);let x=Te.get(Cl),C=x?V_.dirname(x):null,S=C?`${C}/public`:"public",E=await Kn().sendCreateFileOrFolder({path:S,type:"file",name:h,file:t});E.success?(l=(f=E.info)==null?void 0:f.path,l&&C&&l.startsWith(C)&&(l=V_.rest(l,C).replaceAll("\\","/")),Ws({title:"Image uploaded successfully",description:`We've uploaded your image at ${l}`})):Ws({title:"Failed to upload image. Using raw base64 string."})}}}catch{Ws({title:"Failed to upload image. Using raw base64 string."})}let c=e.state.changeByRange(h=>{let b=e.state.sliceDoc(h.from,h.to);return b.trim()===""&&(b="alt"),{changes:[{from:h.from,to:h.to,insert:``}],range:h}});e.dispatch(e.state.update(c,{scrollIntoView:!0,annotations:gl.userEvent.of("input")}));let{to:d}=c.selection.main;try{e.dispatch({selection:Kt.create([Kt.range(d+4,d+4+i.length),Kt.cursor(d+4+i.length)])})}catch{}return e.focus(),!0},$0=async function(e,t){let r=await t.text(),i=e.state.changeByRange(l=>({changes:[{from:l.from,to:l.from,insert:r}],range:l}));return e.dispatch(e.state.update(i,{scrollIntoView:!0,annotations:gl.userEvent.of("input")})),e.focus(),!0};function OT(e){if(!go(e))return!1;let{changes:t}=e.state.changeByRange(r=>({range:r,changes:Wf({view:e,selection:r,markup:e.state.sliceDoc(r.from,r.to+2).startsWith("* ")?"* ":"- "})}));return t.length>0&&e.dispatch(e.state.update({changes:t,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function MT(e){if(!go(e))return!1;let{changes:t}=e.state.changeByRange(r=>({range:r,changes:Wf({view:e,selection:r,markup:"1. "})}));return t.length>0&&e.dispatch(e.state.update({changes:t,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function RT(e){return[hd.highest(qr.of([{key:e.getHotkey("markdown.bold").key,stopPropagation:!0,run:LT},{key:e.getHotkey("markdown.italic").key,stopPropagation:!0,run:DT},{key:e.getHotkey("markdown.link").key,stopPropagation:!0,run:t=>fv(t)},{key:e.getHotkey("markdown.orderedList").key,run:MT},{key:e.getHotkey("markdown.unorderedList").key,run:OT},{key:e.getHotkey("markdown.blockquote").key,run:AT},{key:e.getHotkey("markdown.code").key,run:dv},{key:"`",run:dv}])),ot.domEventHandlers({paste:(t,r)=>{var l;if(r.state.selection.main.empty)return!1;let i=(l=t.clipboardData)==null?void 0:l.getData("text/plain");i!=null&&i.startsWith("http")&&(t.preventDefault(),fv(r,i))}}),ot.domEventHandlers({paste:(t,r)=>{var l;let i=(l=t.clipboardData)==null?void 0:l.files[0];if(!i)return!1;if(i.type.startsWith("image/"))return t.preventDefault(),Qh(r,i),!0;if(i.type.startsWith("text/"))return t.preventDefault(),$0(r,i),!0}})]}function PT(e,t,r=3,i=""){return Object.values(e).flatMap(l=>t.has(l.name)?[]:{label:`${i}${l.name}`,displayLabel:l.name,detail:l.dataType??"",boost:r,type:"variable",apply:`${i}${l.name}`,section:"Variable",info:()=>w0(l)})}w0=function(e){let t=document.createElement("div");t.classList.add("mo-cm-tooltip","docs-documentation","min-w-[200px]","flex","flex-col","gap-1","p-2");let r=document.createElement("div");r.classList.add("flex","items-center","gap-2");let i=document.createElement("span");if(i.classList.add("font-bold","text-base"),i.textContent=e.name,r.append(i),e.dataType){let l=document.createElement("span");l.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"),l.textContent=e.dataType,r.append(l)}if(t.append(r),e.value){let l=document.createElement("div");l.classList.add("flex","flex-col","gap-1");let c=document.createElement("div");c.classList.add("text-xs","text-muted-foreground"),c.textContent="Value:",l.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,l.append(d),t.append(l)}return t};var yo="Python",Kf=123,pv=125,Qf=1,NT={mark:`${yo}Mark`,resolve:yo};function jT(e,t){return{defineNodes:[{name:yo,style:md.emphasis},{name:`${yo}Mark`,style:md.processingInstruction}],parseInline:[{name:yo,parse(r,i,l){return!t()||i!==Kf&&i!==pv||i===Kf&&r.slice(l-1,l)==="{"?-1:r.addDelimiter(NT,l,l+Qf,i===Kf,i===pv)}}],wrap:I_(r=>{if(!t()||r.type.name!==yo)return null;let i=r.from+Qf,l=r.to-Qf;return i>=l||i<0||l<0?null:{parser:e,overlay:[{from:i,to:l}],extensions:[$_().support]}})}}const zT=e=>{let t=e.state.doc.sliceString(0,e.pos),r=t.lastIndexOf("{");if(t.at(r-1)==="{"||r===-1||t.indexOf("}",r)>r)return null;let i=e.matchBefore(/\w*$/);if(!i)return null;let l=PT(Te.get(li),new Set,99);return{from:i.from,options:l,validFor:/^\w*$/}};var kc="InlineMathDollar",vo="InlineMathBracket",Cc="BlockMathDollar",bo="BlockMathBracket",hi={[kc]:1,[vo]:3,[Cc]:2,[bo]:3},mt={DOLLAR:36,BACKSLASH:92,OPEN_PAREN:40,CLOSE_PAREN:41,OPEN_BRACKET:91,CLOSE_BRACKET:93},wo=Object.keys(hi).reduce((e,t)=>(e[t]={mark:`${t}Mark`,resolve:t},e),{});function FT(e){let t=[];return Object.keys(hi).forEach(r=>{t.push({name:r,style:md.emphasis},{name:`${r}Mark`,style:md.processingInstruction})}),{defineNodes:t,parseInline:[{name:Cc,parse(r,i,l){return i!==mt.DOLLAR||r.char(l+1)!==mt.DOLLAR?-1:r.addDelimiter(wo[Cc],l,l+hi[Cc],!0,!0)}},{name:kc,parse(r,i,l){return i!==mt.DOLLAR||r.char(l+1)===mt.DOLLAR?-1:r.addDelimiter(wo[kc],l,l+hi[kc],!0,!0)}},{name:vo,before:"Escape",parse(r,i,l){return i!==mt.BACKSLASH||r.char(l+1)!==mt.BACKSLASH||![mt.OPEN_PAREN,mt.CLOSE_PAREN].includes(r.char(l+2))?-1:r.addDelimiter(wo[vo],l,l+hi[vo],r.char(l+2)===mt.OPEN_PAREN,r.char(l+2)===mt.CLOSE_PAREN)}},{name:bo,before:"Escape",parse(r,i,l){return i!==mt.BACKSLASH||r.char(l+1)!==mt.BACKSLASH||![mt.OPEN_BRACKET,mt.CLOSE_BRACKET].includes(r.char(l+2))?-1:r.addDelimiter(wo[bo],l,l+hi[bo],r.char(l+2)===mt.OPEN_BRACKET,r.char(l+2)===mt.CLOSE_BRACKET)}},{name:vo,before:"Escape",parse(r,i,l){return i!==mt.BACKSLASH||![mt.OPEN_PAREN,mt.CLOSE_PAREN].includes(r.char(l+1))?-1:r.addDelimiter(wo[vo],l,l+2,r.char(l+1)===mt.OPEN_PAREN,r.char(l+1)===mt.CLOSE_PAREN)}},{name:bo,before:"Escape",parse(r,i,l){return i!==mt.BACKSLASH||![mt.OPEN_BRACKET,mt.CLOSE_BRACKET].includes(r.char(l+1))?-1:r.addDelimiter(wo[bo],l,l+2,r.char(l+1)===mt.OPEN_BRACKET,r.char(l+1)===mt.CLOSE_BRACKET)}}],wrap:I_(r=>{let i=hi[r.type.name];if(i){let l=r.from+i,c=r.to-i;return l>=c||l<0||c<0?null:{parser:e,overlay:[{from:l,to:c}]}}return null})}}Md=Ln.define(),Rd=Ln.define(),$r=Cr.define({create:()=>({}),update:(e,t)=>{for(let r of t.effects){if(r.is(Md))return r.value;if(r.is(Rd))return{...e,...r.value}}return e}}),SC=!0,Td=class{constructor(){ae(this,"parser",new Hd);ae(this,"type","markdown");ae(this,"defaultCode",this.parser.defaultCode);ae(this,"defaultMetadata",this.parser.defaultMetadata)}static fromMarkdown(e){return Hd.fromMarkdown(e)}transformIn(e){let t=this.parser.transformIn(e);return[t.code,t.offset,t.metadata]}transformOut(e,t){let r=this.parser.transformOut(e,t);return[r.code,r.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,t,r,i){let l=F_().language.data,c,d=()=>{var h;if(!c)return!0;let f=c==null?void 0:c.state.field($r);return f===void 0?!1:((h=f.quotePrefix)==null?void 0:h.includes("f"))??!1};return[Un.define(f=>(c=f,{})),F_({base:ZD,codeLanguages:gE,extensions:[FT(T_.define(nO).parser),jT(Wh.parser,d)]}),RT(r),TT.map(f=>l.of({autocomplete:f})),$_().language.data.of({autocomplete:wT({completion:uv,predicate:d})}),gd({defaultKeymap:!1,activateOnTyping:!0}),gT({predicate:()=>!d()})]}};const Qt={PREFIX:"file:///",of(e){return`${this.PREFIX}${e}`},is(e){return e.startsWith(this.PREFIX)},parse(e){return dn(this.is(e),`Invalid cell document URI: ${e}`),e.slice(this.PREFIX.length)}};function mv(e){return"notify"in e&&typeof e.notify=="function"}function qT(e){return"processNotification"in e&&typeof e.processNotification=="function"}function $T(e){return Qt.is(e)?Te.get(rc).inOrderIds.includes(Qt.parse(e)):!1}function Sc(){var e;return((e=Te.get(Us))==null?void 0:e.rootUri)??"file:///"}function Ec(){var t;let e=(t=Te.get(Us))==null?void 0:t.rootUri;return e?[{uri:e,name:"marimo"}]:[]}function hv(){var e;return((e=Te.get(Us))==null?void 0:e.documentUri)??"file:///__marimo_notebook__.py"}function VT(e){return zr.filter(e,t=>t!==!1&&t!==null)}function gv(e){let t=e.map(VT);return Object.assign({},...t)}var BT=class{constructor(e){ae(this,"clients",[]);this.clients=e,this.documentUri=hv()}onNotification(e){let t=[];for(let r of this.clients)t.push(r.onNotification(e));return()=>{for(let r of t)r();return!0}}get clientCapabilities(){return gv(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(t=>{t.ready=e})}get capabilities(){return gv(this.clients.map(e=>e.capabilities).filter(e=>e!==null))}set capabilities(e){this.clients.forEach(t=>{t.capabilities=e})}get initializePromise(){return this.clients[0].initializePromise}set initializePromise(e){this.clients.forEach(t=>{t.initializePromise=e})}firstWithMethod(e){return this.clients.find(t=>t.hasCapability(e))}clientsWithMethod(e){return this.clients.filter(t=>t.hasCapability(e))}hasCapability(e){return this.clients.some(t=>t.hasCapability(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){await Promise.all(this.clients.map(t=>t.textDocumentDidChange(e)))}async completionItemResolve(e){let t=this.firstWithMethod("textDocument/completion");return t?t.completionItemResolve(e):e}async textDocumentCodeAction(e){let t=this.firstWithMethod("textDocument/codeAction");return t?t.textDocumentCodeAction(e):null}async codeActionResolve(e){let t=this.firstWithMethod("textDocument/codeAction");return t?t.codeActionResolve(e):e}async textDocumentRename(e){let t=this.firstWithMethod("textDocument/rename");return t?t.textDocumentRename(e):null}async textDocumentPrepareRename(e){let t=this.firstWithMethod("textDocument/prepareRename");return t?t.textDocumentPrepareRename(e):null}async textDocumentSignatureHelp(e){let t=this.firstWithMethod("textDocument/signatureHelp");return t?t.textDocumentSignatureHelp(e):null}async textDocumentCompletion(e){let t=this.clientsWithMethod("textDocument/completion");return HT(await Promise.allSettled(t.map(r=>r.textDocumentCompletion(e))))}async textDocumentDefinition(e){let t=this.firstWithMethod("textDocument/definition");return t?t.textDocumentDefinition(e):null}async textDocumentDidOpen(e){return(await Promise.all(this.clients.map(t=>t.textDocumentDidOpen(e)))).some(t=>t!==!1)}async textDocumentDidClose(e){await Promise.all(this.clients.map(t=>t.textDocumentDidClose(e)))}async textDocumentWillSave(e){await Promise.all(this.clients.map(t=>t.textDocumentWillSave(e)))}async textDocumentWillSaveWaitUntil(e){var r;let t=await Promise.allSettled(this.clients.map(i=>i.textDocumentWillSaveWaitUntil(e)));for(let i of t)if(i.status==="fulfilled"&&((r=i.value)!=null&&r.length))return i.value;return null}async textDocumentDidSave(e){await Promise.all(this.clients.map(t=>t.textDocumentDidSave(e)))}async textDocumentHover(e){for(let t of this.clients){if(!t.hasCapability("textDocument/hover"))continue;let r=await t.textDocumentHover(e);if(r)return r}return{contents:[]}}};function HT(e){let t=[],r=!1;for(let i of e)if(i.status==="fulfilled"){let l=i.value;if(l==null)continue;Array.isArray(l)&&t.push(...l),"items"in l&&(t.push(...l.items),r||(r=l.isIncomplete))}return{items:t,isIncomplete:r}}function WT(e){let t=q_.parse(e),r="";return cD(e,t,J8,(i,l)=>{let c=i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");r+=l?`<span class="${l}">${c}</span>`:c},()=>{r+=`
|
|
101
|
+
`}),r}function UT(){let e=new yd.Renderer,t=e.code.bind(e);return e.code=r=>{let{text:i,lang:l}=r;return i.trim()?l==="python"||l==="py"?`<pre><code class="language-python">${WT(i)}</code></pre>
|
|
102
|
+
`:t(r):""},r=>yd(r,{async:!1,gfm:!0,breaks:!0,renderer:e})}ma=function(e){return typeof e=="object"&&!!e&&!Array.isArray(e)},nk=function(e,t){return typeof e[t]=="function"},Ak=function(e){return[...KT(e),e].join(`
|
|
103
|
+
`)};function KT(e){return tg().map(t=>{let r=Sr(t);return r===e?null:r}).filter(Boolean).toSorted((t,r)=>t.startsWith("import")&&!r.startsWith("import")?-1:!t.startsWith("import")&&r.startsWith("import")?1:0)}var QT=Ie(e=>{let t=e(Je);return zr.fromEntries(t.cellIds.inOrderIds.map(r=>{var l;let i=t.cellHandles[r];return[r,(l=i==null?void 0:i.current)!=null&&l.editorView?Sr(i.current.editorView):""]}))}),GT=Ie(e=>e(Je).cellIds.inOrderIds),XT=Ie(e=>JT(e(GT),e(li)));const YT=Ie(e=>({cellIds:e(XT),codes:e(QT)}));function JT(e,t){var h,b;let r=new Map;e.forEach(x=>r.set(x,[]));let i=new Set(e),l=new Set(e);for(let{declaredBy:x,usedBy:C}of Object.values(t))for(let S of x){i.delete(S);for(let E of C)l.delete(E),E!==S&&((h=r.get(S))==null||h.push(E))}let c=new Map;e.forEach(x=>c.set(x,0)),r.forEach(x=>{x.forEach(C=>{c.set(C,(c.get(C)||0)+1)})});let d=[];c.forEach((x,C)=>{x===0&&d.push(C)});let f=[];for(;d.length>0;){let x=d.shift();if(!x)break;f.push(x),(b=r.get(x))==null||b.forEach(C=>{c.set(C,(c.get(C)||0)-1),c.get(C)===0&&d.push(C)})}return[...f.filter(x=>!i.has(x)),...i]}function ZT(e,t){let r=new Map,i=0;e.forEach(d=>{r.set(d,i),i+=t[d].split(`
|
|
104
|
+
`).length});function l(d){return r.has(d)||be.warn("[lsp] no cell line offsets for",d),r.get(d)??0}let c=e.map(d=>t[d]).join(`
|
|
105
|
+
`);return{cellIds:e,mergedText:c,transformRange:(d,f)=>yv(d,l(f)),reverseRange:(d,f)=>yv(d,-l(f)),isInRange:(d,f)=>{let h=t[f].split(`
|
|
106
|
+
`).length,b=r.get(f)||0,x=d.start.line-b,C=d.end.line-b,S=x>=0&&x<h,E=C>=0&&C<h;return S&&!E&&be.warn("[lsp] Cross-cell diagnostic detected: range starts in cell but ends outside",{cellId:f,range:d,cellLines:h,offset:b}),S&&E},getEditsForNewText:d=>{let f=d.split(`
|
|
107
|
+
`),h=c.split(`
|
|
108
|
+
`);if(f.length!==h.length)throw be.warn("[lsp] cannot apply rename with new lines",f,h),Error("Cannot apply rename when there are new lines");let b=[];for(let[x,C]of zr.entries(t)){if(!r.has(x))continue;let S=r.get(x)??0,E=C.split(`
|
|
109
|
+
`).length,A=f.slice(S,S+E);b.push({cellId:x,text:A.join(`
|
|
110
|
+
`)})}return b},transformPosition:(d,f)=>Tc(d,l(f)),reversePosition:(d,f)=>Tc(d,-l(f))}}function yv(e,t){return{start:Tc(e.start,t),end:Tc(e.end,t)}}function Tc(e,t){return{line:e.line+t,character:e.character}}var e5=new RegExp("(?<!`):math:`([^\\n`]+)`","g"),t5=/:math:\s*<code>(.+?)<\/code>/gs,n5=new RegExp("(?<!\\S)\\\\\\[(.+?)\\\\]","gs"),r5=/\\\((.+?)\\\)/gs,a5=new RegExp("(?<!\\\\)\\$\\$(.+?)(?<!\\\\)\\$\\$","gs"),i5=new RegExp("(?<![$\\\\])\\$(?!\\$)([^\\n$]+?)(?<!\\\\)\\$(?!\\$)","g");function Fl(e){return wv(e)?l5(e).map(t=>t.isFenced?t.text:s5(t.text.replaceAll(e5,(r,i)=>Ic(i)).replaceAll(t5,(r,i)=>Ic(i))).map(r=>r.isInlineCode?r.text:c5(r.text)).join("")).join(`
|
|
111
|
+
`):e}function vv(e){return e==null?e:Array.isArray(e)?e.map(t=>bv(t)):typeof e=="string"?Fl(e):o5(e)?e.kind==="markdown"?{...e,value:Fl(e.value)}:wv(e.value)?{kind:"markdown",value:Fl(e.value)}:e:bv(e)}function bv(e){return typeof e=="string"?Fl(e):e.language!=="markdown"&&e.language!=="md"?e:{...e,value:Fl(e.value)}}function o5(e){return typeof e=="object"&&"kind"in e&&"value"in e}function wv(e){return e.includes(".. math::")||e.includes(":math:`")||new RegExp("(?<!\\S)\\\\\\[[\\S\\s]+?\\\\]").test(e)||/\\\([\S\s]+?\\\)/.test(e)||new RegExp("(?<!\\\\)\\$\\$[\\S\\s]+?(?<!\\\\)\\$\\$").test(e)||new RegExp("(?<![$\\\\])\\$(?!\\$)[^\\n$]+?(?<!\\\\)\\$(?!\\$)").test(e)||/:math:\s*<code>[\S\s]+?<\/code>/.test(e)}function l5(e){let t=e.split(`
|
|
112
|
+
`),r=[],i=[],l=!1,c="",d=0,f=h=>{i.length!==0&&(r.push({text:i.join(`
|
|
113
|
+
`),isFenced:h}),i=[])};for(let h of t){let b=h.match(/^[\t ]*(`{3,}|~{3,})/);if(b){let x=b[1],C=x[0],S=x.length;if(!l){f(!1),l=!0,c=C,d=S,i.push(h);continue}if(C===c&&S>=d){i.push(h),f(!0),l=!1,c="",d=0;continue}}i.push(h)}return f(l),r}function s5(e){let t=[],r="",i=!1,l="",c=0;for(;c<e.length;){if(e[c]==="`"){let d=c;for(;d<e.length&&e[d]==="`";)d+=1;let f=e.slice(c,d);if(i&&f===l){r+=f,t.push({text:r,isInlineCode:!0}),r="",i=!1,l="",c=d;continue}if(!i){r&&(r=(t.push({text:r,isInlineCode:!1}),"")),i=!0,l=f,r+=f,c=d;continue}}r+=e[c],c+=1}return r&&t.push({text:r,isInlineCode:i}),t}function c5(e){let t=u5(e);return t=t.replaceAll(n5,(r,i)=>Gf(i)),t=t.replaceAll(r5,(r,i)=>Ic(i)),t=t.replaceAll(a5,(r,i)=>Gf(i)),t=t.replaceAll(i5,(r,i)=>Ic(i)),t}function xo(e){var t;return((t=e.match(/^[\t ]*/))==null?void 0:t[0].replaceAll(" "," ").length)??0}function u5(e){var l;let t=e.split(`
|
|
114
|
+
`);if(t.length===0)return e;let r=[],i=0;for(;i<t.length;){let c=t[i],d=c.match(/^[\t ]*\.\.\s+math::(.*)$/);if(!d){r.push(c),i+=1;continue}let f=((l=d[1])==null?void 0:l.trim())??"",h=xo(c);i+=1;let b=[],x=f.includes("\\begin");if(f)b.push(f);else{for(;i<t.length;){let A=t[i];if(!A.trim()){i+=1;continue}if(!(xo(A)>h&&A.trim().startsWith(":")))break;i+=1}if(i<t.length){let A=t[i];x=!!A.trim()&&xo(A)<=h&&A.trimStart().startsWith("\\")}}if(x)for(;i<t.length&&t[i].trim();)b.push(t[i]),i+=1;else for(;i<t.length;){let A=t[i];if(!A.trim()){b.push(""),i+=1;continue}if(xo(A)<=h)break;b.push(A),i+=1}let C=b.filter(A=>!!A.trim());if(C.length===0){r.push(c);continue}let S=Math.min(...C.map(A=>xo(A))),E=b.map(A=>{if(!A)return"";let R=Math.min(S,xo(A));return A.slice(R)}).join(`
|
|
115
|
+
`).trim();r.push(Gf(E))}return r.join(`
|
|
116
|
+
`)}function Ic(e){return`<marimo-tex class="arithmatex">||(${e.trim()}||)</marimo-tex>`}function Gf(e){return`<marimo-tex class="arithmatex">||[${e.trim()}||]</marimo-tex>`}function d5(e){return e.startsWith("_")&&!e.startsWith("__")}var f5=class{constructor(e){ae(this,"documentVersion",0);ae(this,"lastSnapshot",null);this.getNotebookCode=e}snapshot(){var r;let e=this.getLens(),t=((r=this.lastSnapshot)==null?void 0:r.mergedText)!==e.mergedText;return t?(this.documentVersion++,this.lastSnapshot=e,{lens:e,didChange:t,version:this.documentVersion}):{lens:e,didChange:t,version:this.documentVersion}}getLatestSnapshot(){if(!this.lastSnapshot)throw Error("No snapshots");return{lens:this.lastSnapshot,version:this.documentVersion}}getLens(){let{cellIds:e,codes:t}=this.getNotebookCode();return ZT(e,t)}},p5=()=>{let e=Wd().cellHandles;return zr.mapValues(e,t=>{var r;return(r=t.current)==null?void 0:r.editorViewOrNull})};function Xf(e){let t=vv(e);return Array.isArray(t)?e:t}function Yf(e){return{...e,documentation:Xf(e.documentation)}}function m5(e){return e==null?null:Array.isArray(e)?e.map(t=>Yf(t)):{...e,items:e.items.map(t=>Yf(t))}}function h5(e){return{...e,signatures:e.signatures.map(t=>{var r;return{...t,documentation:Xf(t.documentation),parameters:(r=t.parameters)==null?void 0:r.map(i=>({...i,documentation:Xf(i.documentation)}))}})}}function xv(e){return ma(e)&&typeof e.line=="number"&&typeof e.character=="number"}function _v(e){return ma(e)&&xv(e.start)&&xv(e.end)}function g5(e){return ma(e)&&typeof e.message=="string"&&_v(e.range)}function y5(e){if(e.method!=="textDocument/publishDiagnostics"||!ma(e.params))return!1;let{uri:t,version:r,diagnostics:i}=e.params;return typeof t=="string"&&(r===void 0||typeof r=="number")&&Array.isArray(i)&&i.every(g5)}let ql,Ac,kv,Cv,Sv;ql=class{constructor(e,t,r=p5){ae(this,"seenCellDocumentUris",new Set);ae(this,"completionItemCache",new vc(10));ae(this,"openCellDocumentCounts",new Map);ae(this,"latestDiagnosticsVersion",null);ae(this,"forwardedDiagnosticsVersion",0);this.documentUri=hv(),this.getNotebookEditors=r,this.initialSettings=t,this.client=e,this.patchProcessNotification(),this.initializePromise.then(()=>{dn(mv(this.client),"notify is not a method on the client"),this.client.notify("workspace/didChangeConfiguration",{settings:t})}),this.snapshotter=new f5(this.getNotebookCode.bind(this))}pruneSeenCellUris(e){for(let t of this.seenCellDocumentUris){let r=Qt.parse(t);e.has(r)||this.seenCellDocumentUris.delete(t)}}onNotification(e){return this.client.onNotification(e)}get ready(){return this.client.ready}set ready(e){this.client.ready=e}get capabilities(){return this.client.capabilities}set capabilities(e){this.client.capabilities=e}get initializePromise(){return this.client.initializePromise}set initializePromise(e){this.client.initializePromise=e}get clientCapabilities(){return this.client.clientCapabilities}async initialize(){await this.client.initialize()}close(){this.openCellDocumentCounts.clear(),this.client.close()}hasCapability(e){return this.client.hasCapability(e)}async resyncAllDocuments(){dn(mv(this.client),"notify is not a method on the client"),await this.client.initialize(),await this.client.notify("workspace/didChangeConfiguration",{settings:this.initialSettings});let{lens:e,version:t}=this.snapshotter.snapshot();this.latestDiagnosticsVersion=null,this.forwardedDiagnosticsVersion=0,this.openCellDocumentCounts.size>0&&await this.client.notify("textDocument/didOpen",{textDocument:{languageId:"python",text:e.mergedText,uri:this.documentUri,version:t}}),be.log("[lsp] Document re-synchronization complete")}getNotebookCode(){return Te.get(YT)}assertCellDocumentUri(e){dn(Qt.is(e),"Execpted URI to be CellDocumentUri")}async textDocumentDidOpen(e){be.debug("[lsp] textDocumentDidOpen",e);let t=e.textDocument.uri;this.assertCellDocumentUri(t);let{lens:r,version:i}=this.snapshotter.snapshot(),l=this.openCellDocumentCounts.get(t)??0;this.openCellDocumentCounts.set(t,l+1);try{let c=await this.client.textDocumentDidOpen({textDocument:{languageId:e.textDocument.languageId,text:r.mergedText,uri:this.documentUri,version:i}});return this.seenCellDocumentUris.add(t),c!==!1}catch(c){let d=this.openCellDocumentCounts.get(t)??0;throw d<=1?this.openCellDocumentCounts.delete(t):this.openCellDocumentCounts.set(t,d-1),c}}async textDocumentDidClose(e){let t=e.textDocument.uri;this.assertCellDocumentUri(t);let r=this.openCellDocumentCounts.get(t)??0;if(r===0){be.warn("[lsp] textDocumentDidClose with no tracked open",t);return}r<=1?this.openCellDocumentCounts.delete(t):this.openCellDocumentCounts.set(t,r-1),await this.client.textDocumentDidClose({textDocument:{uri:this.documentUri}})}async sync(){let{lens:e,version:t,didChange:r}=this.snapshotter.snapshot(),i={textDocument:{uri:this.documentUri,version:t},contentChanges:[{text:e.mergedText}]};return r&&await this.client.textDocumentDidChange(i),{params:i,lens:e}}async textDocumentDidChange(e){if(be.debug("[lsp] textDocumentDidChange",e),e.contentChanges.length===1){await this.sync();return}be.warn("[lsp] Unhandled textDocumentDidChange",e),await this.client.textDocumentDidChange(e)}async textDocumentWillSave(e){this.assertCellDocumentUri(e.textDocument.uri),await this.client.textDocumentWillSave({...e,textDocument:{uri:this.documentUri}})}async textDocumentWillSaveWaitUntil(e){return this.assertCellDocumentUri(e.textDocument.uri),be.debug("[lsp] willSaveWaitUntil edits are disabled for notebook documents"),null}async textDocumentDidSave(e){this.assertCellDocumentUri(e.textDocument.uri);let{lens:t}=this.snapshotter.snapshot();await this.client.textDocumentDidSave({textDocument:{uri:this.documentUri},text:e.text===void 0?void 0:t.mergedText})}async textDocumentDefinition(e){let t=e.textDocument.uri;if(!Qt.is(t))return be.warn("Invalid cell document URI",t),null;let{lens:r}=await this.sync(),i=Qt.parse(t);return this.client.textDocumentDefinition({...e,textDocument:{uri:this.documentUri},position:r.transformPosition(e.position,i)})}async textDocumentSignatureHelp(e){let t=e.textDocument.uri;if(!Qt.is(t))return be.warn("Invalid cell document URI",t),null;let{lens:r}=await this.sync(),i=Qt.parse(t),l=await this.client.textDocumentSignatureHelp({...e,textDocument:{uri:this.documentUri},position:r.transformPosition(e.position,i)});return l?h5(l):null}textDocumentCodeAction(e){return Promise.resolve(null)}codeActionResolve(e){return Promise.resolve(e)}reverseRelatedInformation(e,t){if(e)return e.map(r=>{if(!ma(r)||!ma(r.location)||r.location.uri!==this.documentUri||!_v(r.location.range))return r;let i=t.cellIds.find(l=>t.isInRange(r.location.range,l));return i===void 0?r:{...r,location:{uri:Qt.of(i),range:t.reverseRange(r.location.range,i)}}})}async textDocumentRename(e){var R;let t=e.textDocument.uri;if(!Qt.is(t))return be.warn("Invalid cell document URI",t),null;let r=Qt.parse(t),{lens:i}=await this.sync(),l=i.transformPosition(e.position,r),c=await this.client.textDocumentRename({...e,textDocument:{uri:this.documentUri},position:l});if(!c)return null;let d=(R=c.documentChanges)==null?void 0:R.flatMap(j=>"edits"in j?j.edits:[]);if(!d||d.length!==1)return be.warn("Expected exactly one edit",d),c;let f=d[0];if(!("newText"in f))return be.warn("Expected newText in edit",f),c;let h=i.getEditsForNewText(f.newText),b=new Map(h.map(j=>[j.cellId,j.text])),x=this.getNotebookEditors(),C=x[r],S=!1;if(C){let j=C.state.doc.line(e.position.line+1).from+e.position.character,{startToken:q,endToken:V}=qf(C.state.doc,j),z=C.state.doc.sliceString(q,V);S=d5(z),S&&be.debug("[lsp] Private variable rename detected, limiting to current cell",z)}let E=[],A=0;for(let[j,q]of zr.entries(x)){if(S&&j!==r)continue;let V=b.get(j);if(V==null){be.warn("[lsp] No new code for cell during rename",j),E.push(j);continue}if(!q){be.warn("[lsp] No editor view for cell during rename",j),E.push(j);continue}Sr(q)!==V&&(oo(q,V),A++)}return E.length>0&&be.error(`[lsp] Rename partially failed: could not update ${E.length} cell(s)`,E),be.debug(`[lsp] Rename completed: updated ${A} cell(s)`),{...c,documentChanges:[{edits:[],textDocument:{uri:t,version:0}}]}}async completionItemResolve(e){let t=JSON.stringify(e),r=this.completionItemCache.get(t);if(r)return r;let i=this.client.completionItemResolve(e).then(l=>Yf(l));return this.completionItemCache.set(t,i),i}async textDocumentPrepareRename(e){let t=e.textDocument.uri;if(!Qt.is(t))return be.warn("Invalid cell document URI",t),null;let{lens:r}=await this.sync(),i=Qt.parse(t);return this.client.textDocumentPrepareRename({...e,textDocument:{uri:this.documentUri},position:r.transformPosition(e.position,i)})}async textDocumentHover(e){be.debug("[lsp] textDocumentHover",e);let{lens:t}=await this.sync(),r=Qt.parse(e.textDocument.uri),i=await this.client.textDocumentHover({...e,textDocument:{uri:this.documentUri},position:t.transformPosition(e.position,r)});return i?(typeof i.contents=="object"&&"kind"in i.contents&&(i.contents={kind:"markdown",value:i.contents.value}),i.contents=vv(i.contents)??i.contents,i.contents===""?null:(i.range&&(i.range=t.reverseRange(i.range,r)),i)):(be.debug("[lsp] no hover result"),i)}async textDocumentCompletion(e){let{lens:t}=this.snapshotter.getLatestSnapshot();if(!Qt.is(e.textDocument.uri))return be.error("[lsp] Invalid cell document URI in completion request",e.textDocument.uri),null;let r=Qt.parse(e.textDocument.uri);if(!r||r==="undefined")return be.error("[lsp] Invalid cellId 'undefined' in completion request",{cellId:r,uri:e.textDocument.uri,availableCellIds:t.cellIds}),null;t.cellIds.includes(r)||be.warn("[lsp] CellId in completion request not found in current lens",{cellId:r,uri:e.textDocument.uri,availableCellIds:t.cellIds});let i=t.transformPosition(e.position,r);return m5(await this.client.textDocumentCompletion({...e,textDocument:{uri:this.documentUri},position:i}))}patchProcessNotification(){dn(qT(this.client),"processNotification is not a method on the client");let e=this.client.processNotification.bind(this.client),t=r=>{var i;if(y5(r)){let l=r.params.version;if(l!=null){let S=this.latestDiagnosticsVersion;if(S!==null&&Number.isFinite(l)&&l<S){be.debug("[lsp] dropping stale diagnostics notification",r);return}this.latestDiagnosticsVersion=l}be.debug("[lsp] handling diagnostics",r);let c=this.snapshotter.getLatestSnapshot(),d=r.params.diagnostics,{lens:f}=c,h=++this.forwardedDiagnosticsVersion,b=new Map;for(let S of d)for(let E of f.cellIds)if(f.isInRange(S.range,E)){b.has(E)||b.set(E,[]);let A=this.reverseRelatedInformation(S.relatedInformation,f),R={...S,range:f.reverseRange(S.range,E),...A?{relatedInformation:A}:{}};(i=b.get(E))==null||i.push(R);break}let x=new Set(f.cellIds);this.pruneSeenCellUris(x);let C=new Set(this.seenCellDocumentUris);for(let[S,E]of b.entries()){be.debug("[lsp] diagnostics for cell",S,E);let A=Qt.of(S);C.delete(A),e({...r,params:{...r.params,uri:A,version:h,diagnostics:E}})}if(C.size>0){be.debug("[lsp] clearing diagnostics",C);for(let S of C)e({method:"textDocument/publishDiagnostics",params:{uri:S,version:h,diagnostics:[]}})}return}return e(r)};this.client.processNotification=t}},Ac=1e3,kv=new Set(["textDocument/didOpen","textDocument/didChange","textDocument/didClose"]),Cv=new Set(["initialize","initialized","workspace/didChangeConfiguration","textDocument/didOpen"]),E0=class{constructor(e){ae(this,"isDelegateConnected",!1);ae(this,"connectionGeneration",0);ae(this,"isClosed",!1);ae(this,"hasConnectedBefore",!1);ae(this,"messageHandlers",new Set);ae(this,"pendingMessages",[]);ae(this,"hasLoggedQueueOverflow",!1);this.options={...e,retries:e.retries??1,retryDelayMs:e.retryDelayMs??1e3},this.onReconnect=e.onReconnect}async connect(){if(this.isClosed)throw Error("Transport is closed");if(this.isDelegateConnected)return;if(this.connectionPromise)return this.connectionPromise;let e=++this.connectionGeneration,t=this.connectWithRetries(e).finally(()=>{this.connectionPromise===t&&(this.connectionPromise=void 0)});return this.connectionPromise=t,t}isStale(e){return this.isClosed||e!==this.connectionGeneration}send(e){if(!this.isClosed){if(this.delegate&&this.isDelegateConnected&&(this.restoringGeneration===void 0||this.canSendWhileRestoring(e))){this.delegate.send(e);return}this.pendingMessages.length<Ac?this.pendingMessages.push(e):this.hasLoggedQueueOverflow||(this.hasLoggedQueueOverflow=!0,be.error(`LSP reconnect queue is full (${Ac}); dropping messages until it drains`)),this.reconnect()}}onMessage(e){return this.messageHandlers.add(e),()=>{this.messageHandlers.delete(e)}}close(){var e;this.isClosed||(this.isClosed=!0,this.isDelegateConnected=!1,this.restoringGeneration=void 0,this.connectionGeneration++,this.connectionPromise=void 0,this.pendingMessages=[],this.inFlightBacklog=void 0,this.messageHandlers.clear(),this.disposeDelegate(),(e=this.delegate)==null||e.close(),this.delegate=void 0)}async connectWithRetries(e){var i,l;let t;for(let c=1;c<=this.options.retries;c++)try{await this.connectDelegate(e);return}catch(d){if(t=d instanceof Error?d:Error(String(d)),this.isStale(e))throw t;this.invalidateDelegate(),be.warn(`WebSocket connection attempt ${c}/${this.options.retries} failed`,t),c<this.options.retries&&await new Promise(f=>setTimeout(f,this.options.retryDelayMs))}let r=t??Error("WebSocket connection failed");throw(l=(i=this.options).onConnectionFailure)==null||l.call(i,r),r}async connectDelegate(e){var c,d,f;if(await((d=(c=this.options).waitForConnection)==null?void 0:d.call(c)),this.isStale(e))throw Error("Connection attempt abandoned");let t=this.createDelegate();if(await t.connect(),this.isStale(e)||this.delegate!==t)throw t.close(),Error("Transport closed while connecting");this.isDelegateConnected=!0;let r=this.hasConnectedBefore;this.hasConnectedBefore=!0;let i=this.detachPendingMessages();this.inFlightBacklog=i;try{if(r){this.restoringGeneration=e;try{await((f=this.onReconnect)==null?void 0:f.call(this))}finally{this.restoringGeneration===e&&(this.restoringGeneration=void 0)}}if(this.isStale(e)||this.delegate!==t||!this.isDelegateConnected)throw Error("WebSocket closed while restoring LSP state")}catch(h){throw this.isStale(e)||this.reclaimInFlightBacklog(),h}let l=r&&this.onReconnect?i.filter(h=>!("method"in h&&kv.has(h.method))):i;this.inFlightBacklog=void 0;for(let h of[...l,...this.detachPendingMessages()])t.send(h);be.log("WebSocket transport connected successfully")}detachPendingMessages(){let e=this.pendingMessages;return this.pendingMessages=[],this.hasLoggedQueueOverflow=!1,e}reclaimInFlightBacklog(){this.inFlightBacklog&&(this.inFlightBacklog=(this.pendingMessages=[...this.inFlightBacklog,...this.pendingMessages].slice(0,Ac),void 0))}canSendWhileRestoring(e){return!("method"in e)||Cv.has(e.method)}createDelegate(){this.invalidateDelegate();let e=new Wy(this.options.getWsUrl());return this.delegate=e,this.disposeDelegateMessage=e.onMessage(t=>{for(let r of this.messageHandlers)try{r(t)}catch(i){be.error("LSP message handler failed",i)}}),this.disposeDelegateClose=e.onClose(t=>{this.delegate!==e||this.isClosed||(be.warn("WebSocket transport connection closed",t),this.isDelegateConnected=!1,this.disposeDelegate(),this.delegate=void 0,this.restoringGeneration=void 0,this.reclaimInFlightBacklog(),this.connectionPromise=void 0,queueMicrotask(()=>this.reconnect()))}),e}reconnect(){this.connect().catch(e=>{be.error("WebSocket transport reconnection failed",e)})}invalidateDelegate(){var e;this.isDelegateConnected=!1,this.restoringGeneration=void 0,this.disposeDelegate(),(e=this.delegate)==null||e.close(),this.delegate=void 0}disposeDelegate(){var e,t;(e=this.disposeDelegateMessage)==null||e.call(this),this.disposeDelegateMessage=void 0,(t=this.disposeDelegateClose)==null||t.call(this),this.disposeDelegateClose=void 0}},Sv=new Set([1,2]);function v5(e,t){if(!("method"in t)||t.method!=="window/logMessage")return;let r=t.params;!ma(r)||typeof r.message!="string"||qb({logs:[{timestamp:Date.now()/1e3,level:Sv.has(r.type)?"stderr":"stdout",message:r.message,source:{type:"lsp",name:e}}]})}function Lc(e,t){let r=D8(),i=new E0({getWsUrl:()=>r.getLSPURL(e).toString(),waitForConnection:async()=>{await L8()},onReconnect:t});return i.onMessage(l=>v5(e,l)),i}Ln.define(),new pd;function b5(e){return e.facet(nD.readOnly)}function w5(e){return[A_(e),qr.of([{key:"ArrowRight",preventDefault:!0,run:t=>Ev(t,e)},{key:"Tab",preventDefault:!0,run:t=>Ev(t,e)}])]}function Ev(e,t){if(b5(e.state))return!1;let r=e.state.doc.length;return r===0?(e.dispatch({changes:{from:0,to:r,insert:t},selection:{head:t.length,anchor:t.length}}),!0):!1}function x5(e){let{beforeText:t,linkText:r,afterText:i,onClick:l}=e;return[A_(c=>{let d=document.createElement("span");d.append(document.createTextNode(t));let f=document.createElement("span");return f.textContent=r,f.classList.add("cm-clickable-placeholder"),f.onclick=h=>{h.stopPropagation(),l(c)},d.append(f),d.append(document.createTextNode(i)),d}),ot.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 _5=dr(e=>{let t,r={transport:Lc("pylsp",async()=>{await(t==null?void 0:t())}),rootUri:Sc(),workspaceFolders:Ec()},i=e==null?void 0:e.pylsp,l=["D100","D103"],c=["W292","E402","E302","E305"],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:i==null?void 0:i.enable_flake8,extendIgnore:c},pydocstyle:{enabled:i==null?void 0:i.enable_pydocstyle,ignore:l},pylint:{enabled:i==null?void 0:i.enable_pylint},pyflakes:{enabled:i==null?void 0:i.enable_pyflakes},pylsp_mypy:{enabled:i==null?void 0:i.enable_mypy,live_mode:!0},ruff:{enabled:i==null?void 0:i.enable_ruff,extendIgnore:[...c,...l,...d]},signature:{formatter:i!=null&&i.enable_ruff?"ruff":"black",line_length:88}}}},h=new ql(new Sl({...r}),f);return t=()=>h.resyncAllDocuments(),h}),k5=dr(e=>{let t,r=new ql(new Sl({transport:Lc("ty",async()=>{await(t==null?void 0:t())}),rootUri:Sc(),workspaceFolders:Ec(),getWorkspaceConfiguration:i=>[{disableLanguageServices:!0}]}),{});return t=()=>r.resyncAllDocuments(),r}),C5=dr(e=>{var i;let t,r=new ql(new Sl({transport:Lc("pyrefly",async()=>{await(t==null?void 0:t())}),rootUri:Sc(),workspaceFolders:Ec(),initializationOptions:{pyrefly:{displayTypeErrors:((i=e.diagnostics)==null?void 0:i.enabled)??!1?"force-on":"force-off"}}}),{});return t=()=>r.resyncAllDocuments(),r}),S5=dr(e=>{let t,r=new ql(new Sl({transport:Lc("basedpyright",async()=>{await(t==null?void 0:t())}),rootUri:Sc(),workspaceFolders:Ec()}),{});return t=()=>r.resyncAllDocuments(),r}),E5=class{constructor(){ae(this,"parser",new E1);ae(this,"type","python");ae(this,"defaultCode",this.parser.defaultCode);ae(this,"defaultMetadata",this.parser.defaultMetadata)}transformIn(e){let t=this.parser.transformIn(e);return[t.code,t.offset,t.metadata]}transformOut(e,t){let r=this.parser.transformOut(e,t);return[r.code,r.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,t,r,i,l){return[(()=>{var x,C,S,E,A;let c={defaultKeymap:!1,activateOnTyping:t.activate_on_typing,closeOnBlur:!1},d={hideOnChange:!0},f=[];(x=l==null?void 0:l.pylsp)!=null&&x.enabled&&Ea("pylsp")&&f.push(_5(l)),(C=l==null?void 0:l.ty)!=null&&C.enabled&&Ea("ty")&&f.push(k5(l)),(S=l==null?void 0:l.pyrefly)!=null&&S.enabled&&Ea("pyrefly")&&f.push(C5(l)),(E=l==null?void 0:l.basedpyright)!=null&&E.enabled&&Ea("basedpyright")&&f.push(S5(l));let h=t.signature_hint_on_typing,b=h?/(\w+|\w+\.|\/)$/:/(\w+|\w+\.|\(|\/|,)$/;if(f.length>0){let R=f.length===1?f[0]:new BT(f),j=q=>{be.debug("openExternalLocation",q),!(R.documentUri===q.uri||$T(q.uri))&&Kn().openFile({path:q.uri.replace("file://","")})};return[a0({client:R,languageId:"python",allowHTMLContent:!0,markdownRenderer:UT(),useSnippetOnCompletion:!0,clientSideFiltering:!0,hoverConfig:d,completionConfig:c,diagnosticsEnabled:((A=l.diagnostics)==null?void 0:A.enabled)??!1,sendIncrementalChanges:!1,signatureHelpEnabled:!0,signatureActivateOnTyping:h,signatureHelpOptions:{position:"above"},keyboardShortcuts:{signatureHelp:r.getHotkey("cell.signatureHelp").key,goToDefinition:r.getHotkey("cell.goToDefinition").key,rename:r.getHotkey("cell.renameSymbol").key},completionMatchBefore:b,onGoToDefinition:j,onShowLocation:j}),Fy.of(Qt.of(e))]}return[gd({...c,override:[uv]}),Kd]})(),f0(),T5(i)]}};function T5(e){return e==="marimo-import"?hd.highest(w5("import marimo as mo")):e==="ai"?x5({beforeText:"Start coding or ",linkText:"generate",afterText:" with AI.",onClick:t=>{t.state.facet(st).aiCellCompletion()}}):[]}var Jf=Wh.configure({props:[Y8.add({ParenthesizedExpression:k_,ArgList:k_})]});f0=function(){return new L_(Jf,[Jf.data.of({autocomplete:eO}),Jf.data.of({autocomplete:tO})])};function Ta(e){return typeof e=="object"&&!Array.isArray(e)&&!Zn(e)}function Zn(e){if(typeof e!="object"||Array.isArray(e)||!("self"in e)||!("children"in e))return!1;let t=e.self;return typeof t=="object"&&!!t&&!Array.isArray(t)&&typeof t.label=="string"}function wn(e){return Array.isArray(e)}function fn(e,t,r,i){let l=e.length;if(t==="string"||t==="completion"&&i&&wn(i))return"column";if(t==="namespace"&&r){if(wn(r))return"table";if(Ta(r))return Object.values(r).some(c=>wn(c)||Zn(c)&&wn(c.children))?l<=1?"database":"schema":l===0?"database":"namespace"}if(t==="completion"&&r)return wn(r)?"table":(Ta(r)&&Object.values(r).some(c=>wn(c)||Zn(c)&&wn(c.children)),l<=1?"database":"schema");switch(l){case 0:return"database";case 1:return"schema";default:return"namespace"}}function Dc(e,t,r={}){let{maxDepth:i=10}=r;if((typeof t=="string"?t==="":t.length===0)&&Zn(e)){let c=fn([],"completion",e.children);return{completion:e.self,path:[],type:"completion",semanticType:c,namespace:e.children}}let l=(typeof t=="string"?t.split("."):t).filter(c=>c.length>0);return l.length===0||l.length>i?null:Zf(e,l,[],r)}function Zf(e,t,r,i,l){if(t.length===0){if(Zn(e)){let h=fn(r,"completion",e.children,l);return{completion:e.self,path:r,type:"completion",semanticType:h,namespace:e.children}}return{path:r,type:"namespace",semanticType:fn(r,"namespace",e,l),namespace:e}}let[c,...d]=t,{caseSensitive:f=!1}=i;if(!c)return null;if(Ta(e)){let h=f?Object.keys(e).find(b=>b===c):Object.keys(e).find(b=>b.toLowerCase()===c.toLowerCase());if(h){let b=e[h];if(b)return Zf(b,d,[...r,h],i,e)}}else{if(Zn(e))return Zf(e.children,t,r,i,e);if(wn(e)){for(let h of e)if(typeof h=="string"){if((f?h===c:h.toLowerCase()===c.toLowerCase())&&d.length===0){let b=fn([...r,h],"string",void 0,e);return{value:h,path:[...r,h],type:"string",semanticType:b}}}else if((f?h.label===c:h.label.toLowerCase()===c.toLowerCase())&&d.length===0){let b=fn([...r,h.label],"completion",void 0,e);return{completion:h,path:[...r,h.label],type:"completion",semanticType:b}}}}return null}function I5(e,t,r={}){let i=[];if(t.includes(".")){let l=t.lastIndexOf("."),c=t.substring(0,l),d=t.substring(l+1),f=Dc(e,c,r);if(f!=null&&f.namespace)return ep(f.namespace,d,f.path,r)}else return ep(e,t,[],r);return i}function ep(e,t,r,i){let l=[],{caseSensitive:c=!1,allowPartialMatch:d=!0}=i;if(Ta(e)){for(let[f,h]of Object.entries(e))if(d?c?f.startsWith(t):f.toLowerCase().startsWith(t.toLowerCase()):c?f===t:f.toLowerCase()===t.toLowerCase())if(Zn(h)){let b=fn([...r,f],"completion",h.children,e);l.push({completion:h.self,path:[...r,f],type:"completion",semanticType:b,namespace:h.children})}else{let b=fn([...r,f],"namespace",h,e);l.push({path:[...r,f],type:"namespace",semanticType:b,namespace:h})}}else if(Zn(e)){if(d?c?e.self.label.startsWith(t):e.self.label.toLowerCase().startsWith(t.toLowerCase()):c?e.self.label===t:e.self.label.toLowerCase()===t.toLowerCase()){let f=fn([...r,e.self.label],"completion",e.children);l.push({completion:e.self,path:[...r,e.self.label],type:"completion",semanticType:f,namespace:e.children})}l.push(...ep(e.children,t,r,i))}else if(wn(e)){for(let f of e)if(typeof f=="string"){if(d?c?f.startsWith(t):f.toLowerCase().startsWith(t.toLowerCase()):c?f===t:f.toLowerCase()===t.toLowerCase()){let h=fn([...r,f],"string",void 0,e);l.push({value:f,path:[...r,f],type:"string",semanticType:h})}}else if(d?c?f.label.startsWith(t):f.label.toLowerCase().startsWith(t.toLowerCase()):c?f.label===t:f.label.toLowerCase()===t.toLowerCase()){let h=fn([...r,f.label],"completion",void 0,e);l.push({completion:f,path:[...r,f.label],type:"completion",semanticType:h})}}return l}function tp(e,t,r={}){let i=[],{maxDepth:l=10}=r;Oc(e,[],i,l);let{caseSensitive:c=!1}=r;return i.filter(d=>d.path.some(f=>c?f===t:f.toLowerCase()===t.toLowerCase())).sort((d,f)=>{var x,C;let h=c?d.path[d.path.length-1]===t:((x=d.path[d.path.length-1])==null?void 0:x.toLowerCase())===t.toLowerCase(),b=c?f.path[f.path.length-1]===t:((C=f.path[f.path.length-1])==null?void 0:C.toLowerCase())===t.toLowerCase();return h&&!b?-1:!h&&b?1:d.path.length-f.path.length})}function Oc(e,t,r,i){if(!(t.length>=i)){if(Ta(e))for(let[l,c]of Object.entries(e)){let d=[...t,l];if(Zn(c)){let f=fn(d,"completion",c.children,e);r.push({completion:c.self,path:d,type:"completion",semanticType:f,namespace:c.children}),Oc(c.children,d,r,i)}else{let f=fn(d,"namespace",c,e);r.push({path:d,type:"namespace",semanticType:f,namespace:c}),Oc(c,d,r,i)}}else if(Zn(e)){let l=fn(t,"completion",e.children);r.push({completion:e.self,path:t,type:"completion",semanticType:l,namespace:e.children}),Oc(e.children,t,r,i)}else if(wn(e))for(let l of e)if(typeof l=="string"){let c=fn([...t,l],"string",void 0,e);r.push({value:l,path:[...t,l],type:"string",semanticType:c})}else{let c=fn([...t,l.label],"completion",void 0,e);r.push({completion:l,path:[...t,l.label],type:"completion",semanticType:c})}}}function Tv(e,t,r={}){let{enableFuzzySearch:i=!1}=r,l=Dc(e,t,r);if(l)return l;let c=I5(e,t,r);if(c.length>0)return c[0]||null;if(i){let d=tp(e,t,r);if(d.length>0)return d[0]||null}return null}const np=hl.define({combine:e=>e[0]??null});function Iv(e,t){let r=e??t.state.facet(np);return r==null?null:typeof r=="function"?r(t):r}function Av(e,t){let r=e??t.state.facet(np);return r==null?null:typeof r=="function"?t.view?r(t.view):null:r}function rp(e){if(e==null)return null;let t=Zn(e)?e.children:e;return wn(t)?t:null}function Lv(e,t){var d,f;let r=rp((d=Dc(e,t,{caseSensitive:!1}))==null?void 0:d.namespace);if(r)return r;let i=(typeof t=="string"?t.split("."):t).map(h=>h.toLowerCase()),l=i[i.length-1];if(!l)return null;let c=tp(e,l).filter(h=>{if(rp(h.namespace)===null||h.path.length<i.length)return!1;let b=h.path.slice(-i.length).map(x=>x.toLowerCase());return i.every((x,C)=>b[C]===x)});return c.length===1?rp((f=c[0])==null?void 0:f.namespace):null}function Dv(e,t,r){if(typeof e=="string")return r===void 0?{label:e,type:"property",detail:t}:{label:e,type:"property",detail:t,boost:r};let i={...e,type:"property",detail:e.detail??t};return r!==void 0&&i.boost===void 0&&(i.boost=r),i}const A5=e=>{let t;return async()=>(t||(t=e()),await t)};var hr=class{constructor(e={}){ae(this,"opts");ae(this,"parser",null);ae(this,"offsetRecord",{});ae(this,"getParser",A5(async()=>{if(this.parser)return this.parser;let e=await ne(()=>import("./node-sql-parser-CAudyJSw.js").then(async r=>(await r.__tla,r)).then(g8(1)),__vite__mapDeps([213,1]),import.meta.url),{Parser:t}=e.default||e;return this.parser=new t,this.parser}));this.opts=e}async parse(e,t){var l,c;this.offsetRecord={};let r=(c=(l=this.opts).getParserOptions)==null?void 0:c.call(l,t.state),i=await this.sanitizeSql(e,r);try{let d=await this.getParser();return(r==null?void 0:r.database)==="DuckDB"?this.parseWithDuckDBSupport(i,r):{success:!0,errors:[],ast:d.astify(i,r)}}catch(d){return{success:!1,errors:[this.extractErrorInfo(d,i)]}}}async sanitizeSql(e,t){if(t!=null&&t.ignoreBrackets){let{sql:r,offsetRecord:i}=O5(e);return this.offsetRecord=i,r}return e}async parseWithDuckDBSupport(e,t){let r=await this.getParser(),i=L5(e).trimStart().toLowerCase();if(i.startsWith("from")||i.includes("macro"))return{success:!0,errors:[]};let l=e;i.includes("create or replace table")&&(this.offsetRecord[e.indexOf("create or replace table")]=-11,l=e.replace(/create or replace table/i,"create table"));try{let c={...t,database:"PostgreSQL"};return{success:!0,errors:[],ast:r.astify(l,c)}}catch(c){return{success:!1,errors:[this.extractErrorInfo(c,e)]}}}extractErrorInfo(e,t){var h,b,x,C;let r=1,i=1,l=(e==null?void 0:e.message)||"SQL parsing error",c=e;if(c!=null&&c.location)r=((h=c.location.start)==null?void 0:h.line)||1,i=((b=c.location.start)==null?void 0:b.column)||1;else if(c!=null&&c.hash)r=c.hash.line||1,i=((x=c.hash.loc)==null?void 0:x.first_column)||1;else{let S=l.match(/line (\d+)/i),E=l.match(/column (\d+)/i);S!=null&&S[1]&&(r=parseInt(S[1],10)),E!=null&&E[1]&&(i=parseInt(E[1],10))}let d=Object.entries(this.offsetRecord).map(([S,E])=>({position:parseInt(S,10),offset:E})).sort((S,E)=>S.position-E.position),f=0;for(let{position:S,offset:E}of d){let A=S+f;f+=E;let R=t.slice(0,A),j=(((C=R.match(/\n/g))==null?void 0:C.length)??0)+1,q=A-R.lastIndexOf(`
|
|
117
|
+
`);r===j&&i>q&&(i-=E)}return i>t.length&&(i=t.length),{message:this.cleanErrorMessage(l),line:Math.max(1,r),column:Math.max(1,i),severity:"error"}}cleanErrorMessage(e){return e.replace(/^Error: /,"").replace(/Expected .* but .* found\./i,t=>t.replace(/but .* found/,"found unexpected token")).trim()}async validateSql(e,t){return(await this.parse(e,t)).errors}async extractTableReferences(e,t){var i,l;let r=t?(l=(i=this.opts).getParserOptions)==null?void 0:l.call(i,t.state):void 0;try{return(await this.getParser()).tableList(e,r).map(c=>{let d=c.split("::");return d[d.length-1]||c})}catch{return[]}}async extractColumnReferences(e,t){var i,l;let r=t!=null&&t.state?(l=(i=this.opts).getParserOptions)==null?void 0:l.call(i,t.state):void 0;try{return(await this.getParser()).columnList(e,r).map(c=>{let d=c.split("::");return d[d.length-1]||c})}catch{return[]}}};function L5(e,t=["/*","--"]){let r=[];if(t.includes("/*")&&r.push("/\\*[\\s\\S]*?\\*/"),t.includes("--")&&r.push("--[^\\n]*"),r.length===0)return e;let i=RegExp(`^\\s*(${r.join("|")})\\s*`,""),l=e,c="";for(;l!==c;)c=l,l=l.replace(i,"");return l}var D5=2;function O5(e){let t={};return{sql:e.replace(/("[^"\\]*(?:\\.[^"\\]*)*")|('[^'\\]*(?:\\.[^'\\]*)*')|(\{[^}]*\})/g,(r,i,l,c,d)=>i||l?r:c?(t[d]=D5,`'${c}'`):r),offsetRecord:t}}function M5(){return{tables:[],ctes:[],aliases:new Map,selectAliases:[]}}function Ia(e){return typeof e=="object"&&!!e&&!Array.isArray(e)}function $l(e){return Array.isArray(e)?e:[]}function xn(e){let t=e[0],r=e[e.length-1];return e.length>=2&&(t==='"'&&r==='"'||t==="'"&&r==="'"||t==="`"&&r==="`"||t==="["&&r==="]")?e.slice(1,-1):e}function ap(e){return typeof e=="string"?e:Ia(e)&&typeof e.value=="string"?e.value:null}function Ov(e){if(!Ia(e)||e.type!=="column_ref")return null;let t=e.column;if(typeof t=="string")return t;if(Ia(t)){let r=t.expr,i=Ia(r)?r.value:t.value;if(typeof i=="string")return i}return null}function R5(e){let t=$l(e.columns).map(c=>ap(c)??Ov(c)??ap(c.column)).filter(c=>typeof c=="string");if(t.length>0)return t;let r=e.stmt,i=Ia(r)?r.ast??r:null;if(!Ia(i)||i.type!=="select")return[];let l=[];for(let c of $l(i.columns))if(typeof c.as=="string")l.push(c.as);else{let d=Ov(c.expr);d&&d!=="*"&&l.push(d)}return l}function P5(e,t){if(typeof e.table!="string"||e.table.length===0)return;let r=[e.db??e.catalog,e.schema,e.table].filter(c=>typeof c=="string"&&c.length>0).map(xn),i=typeof e.as=="string"?xn(e.as):void 0,l=`${r.join(".").toLowerCase()}::${(i==null?void 0:i.toLowerCase())??""}`;t.seenTables.has(l)||(t.seenTables.add(l),t.tables.push({name:xn(e.table),path:r,...i?{alias:i}:{}}))}function ip(e,t,r){if(Array.isArray(e)){for(let i of e)ip(i,t,r);return}if(!(!Ia(e)||r.has(e))){r.add(e);for(let i of $l(e.with)){let l=ap(i.name);l&&!t.seenCtes.has(l.toLowerCase())&&(t.seenCtes.add(l.toLowerCase()),t.ctes.push({name:xn(l),columns:R5(i).map(xn),from:-1,to:-1}))}for(let i of["from","table"])for(let l of $l(e[i]))P5(l,t);for(let[i,l]of Object.entries(e))i==="loc"||i==="tableList"||i==="columnList"||ip(l,t,r)}}function N5(e,t){if(e.type==="select")for(let r of $l(e.columns))typeof r.as=="string"&&t.selectAliases.push(xn(r.as))}function j5(e,t){let r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=`(?:"${r}"|\`${r}\`|\\[${r}\\]|\\b${r})`,l=RegExp(`(${i})\\s*(?:\\([^)]*\\)\\s*)?AS\\s*\\(`,"i").exec(e);return!l||l.index<0||!l[1]?{from:-1,to:-1}:{from:l.index,to:l.index+l[1].length}}var Mv=new Set("as.on.using.where.join.inner.left.right.full.cross.outer.natural.lateral.group.order.limit.offset.having.union.intersect.except.select.set.values.when.then.and.or.not.in.is.asc.desc.fetch.window.qualify.returning.with".split(".")),Vl=String.raw`(?:[\w$]+|"[^"]+"|\`[^\`]+\`|\[[^\]]+\])`,z5=`(?!(?:${[...Mv].join("|")})\\b)`,op=new RegExp(String.raw`\b(?:from|join)\s+(${Vl}(?:\.${Vl})*)(?:\s+(?:as\s+)?${z5}(${Vl}))?`,"gi");function Mc(e){let t=e.split(""),r=0;for(;r<e.length;){let i=e[r],l=e[r+1];if(i==="-"&&l==="-"){for(;r<e.length&&e[r]!==`
|
|
118
|
+
`;)t[r]=" ",r++;continue}if(i==="/"&&l==="*"){for(t[r]=" ",t[r+1]=" ",r+=2;r<e.length&&!(e[r]==="*"&&e[r+1]==="/");)t[r]=" ",r++;r<e.length&&(t[r]=" ",t[r+1]=" ",r+=2);continue}if(i==='"'||i==="`"||i==="["){let c=i==="["?"]":i;for(r++;r<e.length&&e[r]!==c;)r++;r++;continue}if(i==="'"){for(t[r]=" ",r++;r<e.length;){if(e[r]==="'"){if(t[r]=" ",e[r+1]==="'"){t[r+1]=" ",r+=2;continue}r++;break}t[r]=" ",r++}continue}r++}return t.join("")}function Rv(e){let t={tables:[],ctes:[],selectAliases:[],seenTables:new Set,seenCtes:new Set},r=Mc(e);F5(r,t),op.lastIndex=0;let i=op.exec(r);for(;i!==null;){let l=i[1],c=i[2];if(l){let d=l.split(".").map(xn),f=d[d.length-1]??"",h=c&&!Mv.has(c.toLowerCase())?xn(c):void 0,b=`${d.join(".").toLowerCase()}::${(h==null?void 0:h.toLowerCase())??""}`;f&&!t.seenTables.has(b)&&(t.seenTables.add(b),t.tables.push({name:f,path:d,...h?{alias:h}:{}}))}i=op.exec(r)}return Pv(t)}function F5(e,t){let r=/\bWITH\s+(?:RECURSIVE\s+)?/gi,i=new RegExp(String.raw`^(${Vl})\s*(?:\(([^)]*)\)\s*)?AS\s*\(`,"i"),l=r.exec(e);for(;l!==null;){let c=l.index+l[0].length;for(;;){let d=i.exec(e.slice(c)),f=d==null?void 0:d[1],h=f?xn(f):void 0;if(!d||!f||!h)break;let b=c+d[0].length,x=b,C=1;for(;x<e.length&&C>0;)e[x]==="("?C++:e[x]===")"&&C--,x++;if(!t.seenCtes.has(h.toLowerCase())){t.seenCtes.add(h.toLowerCase());let E=(d[2]??"").split(",").map(A=>xn(A.trim())).filter(A=>A.length>0);t.ctes.push({name:h,columns:E.length>0?E:$5(e.slice(b,Math.max(b,x-1))),from:c,to:c+f.length})}let S=/^\s*,\s*/.exec(e.slice(x));if(!S)break;c=x+S[0].length}l=r.exec(e)}}function q5(e){let t=[],r=0,i="";for(let l of e)l==="("?r++:l===")"&&(r=Math.max(0,r-1)),l===","&&r===0?(t.push(i),i=""):i+=l;return t.push(i),t}function $5(e){let t=/^\s*SELECT\s+(?:DISTINCT\s+)?([\s\S]*?)\s+FROM\s/i.exec(e);if(!t||!t[1])return[];let r=[];for(let i of q5(t[1])){let l=i.trim(),c=new RegExp(String.raw`\s+AS\s+(${Vl})$`,"i").exec(l);if(c!=null&&c[1]){r.push(xn(c[1]));continue}if(/^(?:[\w$]+\.)*[\w$]+$/.test(l)){let d=l.split("."),f=d[d.length-1];f&&f!=="*"&&r.push(f)}}return r}function Pv(e){let t=new Map;for(let r of e.tables)if(r.alias){let i=r.alias.toLowerCase();t.has(i)||t.set(i,r.path.join("."))}return{tables:e.tables,ctes:e.ctes,aliases:t,selectAliases:e.selectAliases}}async function V5(e,t,r){if(!e.trim())return M5();let i=null;try{let l=await t.parse(e,r);l.success&&l.ast!=null&&(i=l.ast)}catch{}if(i==null)return Rv(e);try{let l={tables:[],ctes:[],selectAliases:[],seenTables:new Set,seenCtes:new Set},c=Array.isArray(i)?i:[i];for(let f of c)Ia(f)&&N5(f,l);ip(i,l,new Set);let d=Mc(e);for(let f of l.ctes){let h=j5(d,f.name);f.from=h.from,f.to=h.to}return Pv(l)}catch{return Rv(e)}}var gi=class{constructor(e=new hr){ae(this,"parser");ae(this,"cache",new Map);ae(this,"MAX_CACHE_SIZE",20);this.parser=e}async getContext(e,t){let r=this.cache.get(e);if(r)return r;let i=await V5(e,this.parser,t);if(this.cache.set(e,i),this.cache.size>this.MAX_CACHE_SIZE){let l=this.cache.keys().next().value;l!==void 0&&this.cache.delete(l)}return i}clearCache(){this.cache.clear()}},Ar=class{constructor(e){ae(this,"parser");ae(this,"cache",new Map);ae(this,"MAX_CACHE_SIZE",10);this.parser=e}async analyzeDocument(e){let t=e.doc.toString(),r=this.cache.get(t);if(r)return r;let i=await this.extractStatements(t,e);if(this.cache.set(t,i),this.cache.size>this.MAX_CACHE_SIZE){let l=this.cache.keys().next().value;l!==void 0&&this.cache.delete(l)}return i}async getStatementAtPosition(e,t){return(await this.analyzeDocument(e)).find(r=>t>=r.from&&t<=r.to)||null}async getStatementsInRange(e,t,r){return(await this.analyzeDocument(e)).filter(i=>i.from<=r&&i.to>=t)}async extractStatements(e,t){let r=[],i=this.splitByStatementSeparators(e),l=0;for(let c of i){let d=c.trim();if(d.length===0){l+=c.length;continue}let f=l+c.indexOf(d),h=f+d.length,b=t.doc.lineAt(f),x=t.doc.lineAt(h),C=this.stripComments(d);if(C.trim().length===0||C.trim()===";"){l+=c.length;continue}let S=await this.parser.parse(d,{state:t}),E=this.determineStatementType(C),A=C.endsWith(";")?C.slice(0,-1).trim():C.trim();r.push({from:f,to:h,lineFrom:b.number,lineTo:x.number,content:A,type:E,isValid:S.success,errors:S.errors??[]}),l+=c.length}return r}splitByStatementSeparators(e){let t=[],r="",i=!1,l="",c=!1,d=!1,f=0;for(;f<e.length;){let h=e[f],b=e[f+1];if(!i&&!d&&h==="-"&&b==="-"){c=!0,r+=h+b,f+=2;continue}if(!i&&!c&&h==="/"&&b==="*"){d=!0,r+=h+b,f+=2;continue}if(d&&h==="*"&&b==="/"){d=!1,r+=h+b,f+=2;continue}if(c&&(h===`
|
|
119
|
+
`||h==="\r")){c=!1,r+=h,f++;continue}if(c||d){r+=h,f++;continue}if(!i&&(h==="'"||h==='"'||h==="`"))i=!0,l=h,r+=h;else if(i&&h===l){if(b===l){r+=h+b,f+=2;continue}i=!1,l="",r+=h}else!i&&h===";"?(r+=h,t.push(r),r=""):r+=h;f++}return r.trim()&&t.push(r),t}determineStatementType(e){let t=e.trim().toLowerCase();return t.startsWith("select")?"select":t.startsWith("insert")?"insert":t.startsWith("update")?"update":t.startsWith("delete")?"delete":t.startsWith("create")?"create":t.startsWith("drop")?"drop":t.startsWith("alter")?"alter":t.startsWith("use")?"use":"other"}stripComments(e){let t="",r=!1,i="",l=!1,c=!1,d=0;for(;d<e.length;){let f=e[d],h=e[d+1];if(!r&&!c&&f==="-"&&h==="-"){l=!0,d+=2;continue}if(!r&&!l&&f==="/"&&h==="*"){c=!0,d+=2;continue}if(c&&f==="*"&&h==="/"){c=!1,d+=2;continue}if(l&&(f===`
|
|
120
|
+
`||f==="\r")){l=!1,t+=f,d++;continue}if(l||c){d++;continue}if(!r&&(f==="'"||f==='"'||f==="`"))r=!0,i=f,t+=f;else if(r&&f===i){if(h===i){t+=f+h,d+=2;continue}r=!1,i="",t+=f}else t+=f;d++}return t}clearCache(){this.cache.clear()}};function B5(e={}){let t=e.parser??new hr,r=e.contextAnalyzer??new gi(t),i=new Ar(t);return async l=>{let c=l.matchBefore(/(?:[\w$]+|"[^"]+"|`[^`]+`|\[[^\]]+\])\.[\w$]*/);if(!c||l.state.sliceDoc(Math.max(0,c.from-1),c.from)===".")return null;let d=c.text.lastIndexOf("."),f=xn(c.text.slice(0,d)),h=await i.getStatementAtPosition(l.state,l.pos),b=h?l.state.sliceDoc(h.from,h.to):l.state.doc.toString(),x=await r.getContext(b,{state:l.state}),C=x.aliases.get(f.toLowerCase());if(!C)return null;let S=null,E=x.ctes.find(R=>R.name.toLowerCase()===C.toLowerCase());if(E&&E.columns.length>0)S=E.columns;else if(!E){let R=Av(e.schema,l);R!=null&&(S=Lv(R,C))}if(!S||S.length===0)return null;let A=`column of ${C}`;return{from:c.from+d+1,options:S.map(R=>Dv(R,A)),validFor:/^[\w$]*$/}}}var H5=1,W5=/\b(?:from|join|into|update|table)\s+$/i,U5=/\bfrom\s+[\w$."`[\]]+(?:\s+(?:as\s+)?[\w$"`[\]]+)?(?:\s*,\s*[\w$."`[\]]+(?:\s+(?:as\s+)?[\w$"`[\]]+)?)*\s*,\s*$/i;function K5(e={}){let t=e.parser??new hr,r=e.contextAnalyzer??new gi(t),i=new Ar(t);return async l=>{let c=l.matchBefore(/[\w$]*/);if(!c||c.from===c.to&&!l.explicit||l.state.sliceDoc(Math.max(0,c.from-1),c.from)===".")return null;let d=l.state.sliceDoc(Math.max(0,c.from-256),c.from);if(W5.test(d)||U5.test(d))return null;let f=await i.getStatementAtPosition(l.state,l.pos),h=(f==null?void 0:f.from)??0,b=f?l.state.sliceDoc(f.from,f.to):l.state.doc.toString(),x=Mc(b),C=Math.max(h,c.from-1)-h,S=c.to-h;if(x.slice(C,S)!==b.slice(C,S))return null;let E=await r.getContext(b,{state:l.state});if(E.tables.length===0)return null;let A=Av(e.schema,l),R=[],j=new Set,q=new Set;for(let V of E.tables){let z=V.path.join(".").toLowerCase();if(q.has(z))continue;q.add(z);let X=E.ctes.find(H=>H.name.toLowerCase()===V.name.toLowerCase()),fe=null;if(X?fe=X.columns.length>0?X.columns:null:A!=null&&(fe=Lv(A,V.path)),!fe)continue;let F=`column of ${V.name}`;for(let H of fe){let te=(typeof H=="string"?H:H.label).toLowerCase();j.has(te)||(j.add(te),R.push(Dv(H,F,H5)))}}return R.length===0?null:{from:c.from,options:R,validFor:/^[\w$]*$/}}}var lp=/[\w$]/,sp=/"[^"]*"|`[^`]*`|\[[^\]]*\]/g;function Nv(e,t){let r=e.doc.lineAt(t),i=r.text,l=t-r.from;sp.lastIndex=0;let c=sp.exec(i);for(;c!==null&&c.index<=l;){let h=c.index+c[0].length;if(l<=h)return{from:r.from+c.index,to:r.from+h,text:xn(c[0])};c=sp.exec(i)}let d=l,f=l;for(;d>0&&lp.test(i[d-1]??"");)d--;for(;f<i.length&&lp.test(i[f]??"");)f++;return d===f?null:{from:r.from+d,to:r.from+f,text:i.slice(d,f)}}async function jv(e,t,r){let i=await e.analyzeDocument(t),l=null;for(let c of i){if(r>=c.from&&r<=c.to)return c;c.from<=r&&(l=c)}return l}function Q5(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Rc(e,t={}){let r=Q5(e);return`(?:"${r}"|\`${r}\`|\\[${r}\\]|${t.allowLeadingDot?"(?<![\\w$])":"(?<![\\w$.])"}${r}(?![\\w$]))`}function cp(e,t,r={}){let i=new RegExp(Rc(t),"gi"),l=[],c=i.exec(e);for(;c!==null;){let d=c.index+c[0].length;(!r.followedByDot||e[d]===".")&&l.push({from:c.index,to:d}),c=i.exec(e)}return l}function G5(e){let t=[],r=0;for(let i=0;i<e.length;i++)e[i]===")"&&(r=Math.max(0,r-1)),t[i]=r,e[i]==="("&&r++;return t}var up=/\b(select|from|where|having|qualify|on|set|values|by|join|limit|offset|union|intersect|except|window)\b/gi;function X5(e){up.lastIndex=0;let t=null,r=up.exec(e);for(;r!==null;)t=(r[1]??"").toLowerCase(),r=up.exec(e);return t}function zv(e,t){var l,c;let r=t-1;for(;;){for(;r>=0&&/\s/.test(e[r]??"");)r--;if(r>=0&&e[r]==="."){for(r--;r>=0&&/\s/.test(e[r]??"");)r--;let d=e[r];if(d==='"'||d==="`"||d==="]"){let f=d==="]"?"[":d;for(r--;r>=0&&e[r]!==f;)r--;r--}else for(;r>=0&&lp.test(e[r]??"");)r--;continue}break}if(r<0)return!1;if(e[r]===",")return X5(e.slice(0,r))==="from";let i=(c=(l=/([A-Za-z_]+)$/.exec(e.slice(0,r+1)))==null?void 0:l[1])==null?void 0:c.toLowerCase();return i==="from"||i==="join"}function dp(e){let t=new Map;for(let r of e)t.has(r.from)||t.set(r.from,r);return[...t.values()].sort((r,i)=>r.from-i.from)}function fp(e,t){return e.some(r=>r.from<=t.from&&t.to<=r.to)}function Y5(e,t,r){var h;let i=Mc(e),l=r.text.toLowerCase(),c=t.selectAliases.some(b=>b.toLowerCase()===l),d=t.ctes.find(b=>b.name.toLowerCase()===l);if(d){let b=t.aliases.get(l);if(b&&b.toLowerCase()!==l||c||d.from<0)return null;let x={from:d.from,to:d.to},C=dp([x,...cp(i,d.name).filter(S=>i[S.to]==="."||zv(i,S.from))]);return fp(C,r)?{kind:"cte",name:d.name,definition:x,references:C}:null}if(t.aliases.has(l)){if(c)return null;let b=t.tables.filter(q=>{var V;return((V=q.alias)==null?void 0:V.toLowerCase())===l});if(b.length!==1||!b[0])return null;let x=b[0],C=x.alias??r.text,S=Rc(x.name,{allowLeadingDot:!0}),E=RegExp(`${S}\\s+(?:AS\\s+)?(${Rc(C)})`,"gi"),A=E.exec(i);for(;A!==null&&!zv(i,A.index);)A=E.exec(i);if(!A||A[1]==null)return null;let R={from:A.index+A[0].length-A[1].length,to:A.index+A[0].length},j=dp([R,...cp(i,C,{followedByDot:!0})]);return fp(j,r)?{kind:"table-alias",name:C,definition:R,references:j}:null}let f=t.selectAliases.find(b=>b.toLowerCase()===l);if(f){let b=G5(i),x=z=>b[z]===0,C=J5(i,/\bFROM\b/gi,x),S=C?C.index:i.length,E=RegExp(`\\bAS\\s+(${Rc(f)})`,"gi"),A=null,R=E.exec(i);for(;R!==null;){let z=R.index+R[0].length-(((h=R[1])==null?void 0:h.length)??0);if(x(R.index)&&z<S){A={from:z,to:R.index+R[0].length};break}R=E.exec(i)}if(!A)return null;let j=Z5(i,x),q=cp(i,f).filter(z=>j.some(X=>z.from>=X.from&&z.to<=X.to)),V=dp([A,...q]);return fp(V,r)?{kind:"select-alias",name:f,definition:A,references:V}:null}return null}function J5(e,t,r){let i=t.exec(e);for(;i!==null;){if(r(i.index))return i;i=t.exec(e)}return null}var pp=/\b(?:GROUP\s+BY|ORDER\s+BY|HAVING|QUALIFY)\b/gi,mp=/\b(?:GROUP\s+BY|ORDER\s+BY|HAVING|QUALIFY|LIMIT|OFFSET|FETCH|WINDOW|UNION|INTERSECT|EXCEPT)\b/gi;function Z5(e,t){let r=[];pp.lastIndex=0;let i=pp.exec(e);for(;i!==null;){if(t(i.index)){let l=i.index+i[0].length;mp.lastIndex=l;let c=e.length,d=mp.exec(e);for(;d!==null;){if(t(d.index)){c=d.index;break}d=mp.exec(e)}r.push({from:l,to:c})}i=pp.exec(e)}return r}var e6=class{constructor(e={}){ae(this,"structureAnalyzer");ae(this,"contextAnalyzer");let t=e.parser??new hr;this.structureAnalyzer=e.structureAnalyzer??new Ar(t),this.contextAnalyzer=e.contextAnalyzer??new gi(t)}async resolve(e,t){let r=Nv(e,t);if(!r)return null;let i=await jv(this.structureAnalyzer,e,t);if(!i||r.from<i.from||r.to>i.to)return null;let l=e.sliceDoc(i.from,i.to),c=Y5(l,await this.contextAnalyzer.getContext(l,{state:e}),{from:r.from-i.from,to:r.to-i.from,text:r.text});if(!c)return null;let d=f=>({from:f.from+i.from,to:f.to+i.from});return{...c,definition:d(c.definition),references:c.references.map(d)}}},t6=/([\w$]+|"[^"]+"|`[^`]+`|\[[^\]]+\])$/;function n6(e){return/\b(?:from|join)\s+$/i.test(e)}function Fv(e){return/^[A-Za-z_][\w$]*$/.test(e)}function r6(e){return{label:e.name,type:"variable",info:`Common Table Expression: ${e.name}`,boost:10,...Fv(e.name)?{}:{apply:`"${e.name}"`}}}function qv(e){return e.columns.map(t=>({label:t,type:"property",detail:`column of ${e.name}`,boost:5,...Fv(t)?{}:{apply:`"${t}"`}}))}function $v(e={}){let t=e.parser??new hr,r=e.contextAnalyzer??new gi(t),i=e.structureAnalyzer??new Ar(t);return async l=>{let c=l.matchBefore(/[\w$]*/);if(!c)return null;let d=l.state.sliceDoc(Math.max(0,c.from-1),c.from)===".";if(c.from===c.to&&!l.explicit&&!d)return null;let f=await jv(i,l.state,l.pos),h=f?l.state.sliceDoc(f.from,f.to):l.state.doc.toString(),b=await r.getContext(h,{state:l.state});if(b.ctes.length===0)return null;if(d){let C=l.state.doc.lineAt(c.from),S=l.state.sliceDoc(C.from,c.from-1),E=t6.exec(S);if(!E||!E[1]||S.slice(0,S.length-E[1].length).endsWith("."))return null;let A=xn(E[1]).toLowerCase(),R=b.ctes.find(j=>j.name.toLowerCase()===A);return!R||R.columns.length===0?null:{from:c.from,options:qv(R),validFor:/^[\w$]*$/}}let x=b.ctes.map(r6);if(!n6(l.state.sliceDoc(Math.max(0,c.from-64),c.from))){let C=new Set(b.tables.map(E=>E.name.toLowerCase())),S=new Set;for(let E of b.ctes)if(C.has(E.name.toLowerCase()))for(let A of qv(E)){let R=A.label.toLowerCase();S.has(R)||(S.add(R),x.push(A))}}return{from:c.from,options:x,validFor:/^[\w$]*$/}}}var a6=750;function Vv(e,t){if(t>=e.length)return e.length;let r=e.lineAt(t),i=r.text.slice(t-r.from).match(/^[\w"'`.]+/);return i?t+i[0].length:Math.min(t+1,e.length)}function i6(e,t){let r=t.line(Math.min(e.line,t.lines)),i=Math.min(r.from+Math.max(0,e.column-1),t.length);return{from:i,to:Vv(t,i),severity:e.severity,message:e.message,source:"sql-parser"}}function o6(e,t,r){let i;return i=e.line<=1?t.from+Math.max(0,e.column-1):r.line(Math.min(t.lineFrom+e.line-1,r.lines)).from+Math.max(0,e.column-1),i=Math.max(t.from,Math.min(i,t.to)),{from:i,to:Math.max(i,Math.min(Vv(r,i),t.to)),severity:e.severity,message:e.message,source:"sql-parser"}}function l6(e={}){return M_(s6(e),{delay:e.delay||a6})}function s6(e={}){let t=e.parser||new hr,r=e.perStatement!==!1,i=e.structureAnalyzer||new Ar(t);return async l=>{let c=l.state.doc,d=c.toString();return d.trim()?r?(await i.analyzeDocument(l.state)).flatMap(f=>f.errors.map(h=>o6(h,f,c))):(await t.validateSql(d,{state:l.state})).map(f=>i6(f,c)):[]}}function Bv(e,t){if(t.size===0)return{};if(Ta(e)){let r={};for(let[i,l]of Object.entries(e))if(Array.from(t).some(c=>c.toLowerCase()===i.toLowerCase()))r[i]=l;else if(Ta(l)){let c=Bv(l,t);Object.keys(c).length>0&&(r[i]=c)}return r}return e}function c6(e={}){let{schema:t,keywords:r={},enableKeywords:i=!0,enableTables:l=!0,enableColumns:c=!0,enableFuzzySearch:d=!0,parser:f=new hr,tooltipRender:h,tooltipRenderers:b={}}=e,x=new Ar(f),C=e.contextAnalyzer??new gi(f),S=null;return async(E,A,R)=>{let{from:j,to:q,text:V}=E.state.doc.lineAt(A),z=A,X=A;S===null&&(S=typeof r=="function"?r(E):Promise.resolve(r));let fe;try{fe=await S}catch{S=null,fe={}}for(;z>j&&/[\w.]/.test(V[z-j-1]??"");)z--;for(;X<q&&/[\w.]/.test(V[X-j]??"");)X++;if(z===A&&R<0||X===A&&R>0)return null;let F=V.slice(z-j,X-j).toLowerCase();if(!F||F.length===0)return null;let H=Iv(t,E)??{},te=null;`${F}`;let me=Object.hasOwn(fe,F)?fe[F]:void 0;if(!te&&i&&me&&(te={word:F,view:E,pos:A,tooltipType:"keyword",keywordData:{keyword:F,info:me}}),!te&&(l||c)&&H){let _e=await x.getStatementAtPosition(E.state,A),ke=_e?E.state.doc.sliceString(_e.from,_e.to):E.state.doc.toString(),oe=await C.getContext(ke,{state:E.state}),[ce="",...ye]=F.split("."),ie=oe.aliases.get(ce),le=ie?[ie,...ye].join(".").toLowerCase():F,K=new Set(oe.tables.map(Ke=>Ke.name.toLowerCase())),Le=Bv(H,K),Pe=Tv(Le,le,{enableFuzzySearch:d});if(!Pe&&K.size===0&&(Pe=Tv(H,le,{enableFuzzySearch:d})),Pe){let{semanticType:Ke}=Pe;(Ke==="table"&&!l||Ke==="column"&&!c)&&(Pe=null)}Pe&&(Array.from(K),te={word:F,view:E,pos:A,tooltipType:"namespace",namespaceData:{item:Pe,word:F,resolvedSchema:K.size>0?Le:H,...ie?{aliasFor:ie}:{}}})}if(!te)return null;let ve=te;return{pos:z,end:X,above:!0,create(_e){if(h){let ce=h(F,_e,A);if(ce)return{dom:ce}}let ke=null;if(ve.tooltipType==="keyword"&&ve.keywordData)ke=b.keyword?b.keyword(ve.keywordData):Uv(ve.keywordData);else if(ve.tooltipType==="namespace"&&ve.namespaceData){let ce=ve.namespaceData,{semanticType:ye}=ce.item;ye==="table"&&b.table?ke=b.table(ce):ye==="column"&&b.column?ke=b.column(ce):(ye==="database"||ye==="schema"||ye==="namespace")&&b.namespace?ke=b.namespace(ce):(ke=Wv(ce.item),ce.aliasFor&&(ke=`<div class="sql-hover-alias"><code>${Hv(ce.word.split(".")[0]??"")}</code> is an alias for <code>${Hv(ce.aliasFor)}</code></div>`+ke))}if(!ke)return{dom:document.createElement("div")};let oe=document.createElement("div");return oe.className="cm-sql-hover-tooltip",oe.innerHTML=ke,{dom:oe}}}}}function u6(e={}){let{hoverTime:t=300}=e;return zh(c6(e),{hoverTime:t})}function Hv(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Wv(e){var l,c,d,f,h,b,x;let t=e.path.join("."),r=((l=e.completion)==null?void 0:l.label)||e.value||e.path[e.path.length-1]||"unknown",i=`<div class="sql-hover-${e.semanticType}">`;switch(i+=`<div class="sql-hover-header"><strong>${r}</strong> <span class="sql-hover-type">${e.semanticType}</span></div>`,e.semanticType){case"database":if(i+=`<div class="sql-hover-description">Database${(c=e.completion)!=null&&c.detail?`: ${e.completion.detail}`:""}</div>`,e.namespace){let C=Pc(e.namespace);C>0&&(i+=`<div class="sql-hover-children">Contains ${C} schema${C===1?"":"s"}</div>`)}break;case"schema":if(i+=`<div class="sql-hover-description">Schema${(d=e.completion)!=null&&d.detail?`: ${e.completion.detail}`:""}</div>`,t&&(i+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${t}</code></div>`),e.namespace){let C=Pc(e.namespace);C>0&&(i+=`<div class="sql-hover-children">Contains ${C} table${C===1?"":"s"}</div>`)}break;case"table":if(i+=`<div class="sql-hover-description">Table${(f=e.completion)!=null&&f.detail?`: ${e.completion.detail}`:""}</div>`,t){let C=e.path;C.length>1&&(i+=`<div class="sql-hover-path"><strong>Schema:</strong> <code>${C.slice(0,-1).join(".")}</code></div>`)}if(e.namespace&&wn(e.namespace)){let C=e.namespace;if(C.length>0){i+=`<div class="sql-hover-columns"><strong>Columns (${C.length}):</strong><br>`;let S=C.slice(0,8).map(E=>typeof E=="string"?E:E.label);i+=S.map(E=>`<code>${E}</code>`).join(", "),C.length>8&&(i+=`, <em>and ${C.length-8} more...</em>`),i+="</div>"}}break;case"column":if(i+=`<div class="sql-hover-description">Column${(h=e.completion)!=null&&h.detail?`: ${e.completion.detail}`:""}</div>`,t){let C=e.path;C.length>1&&(i+=`<div class="sql-hover-path"><strong>Table:</strong> <code>${C.slice(0,-1).join(".")}</code></div>`)}break;default:if(i+=`<div class="sql-hover-description">Namespace${(b=e.completion)!=null&&b.detail?`: ${e.completion.detail}`:""}</div>`,t&&(i+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${t}</code></div>`),e.namespace){let C=Pc(e.namespace);C>0&&(i+=`<div class="sql-hover-children">Contains ${C} item${C===1?"":"s"}</div>`)}break}return(x=e.completion)!=null&&x.info&&typeof e.completion.info=="string"&&(i+=`<div class="sql-hover-info">${e.completion.info}</div>`),i+="</div>",i}function Pc(e){return Array.isArray(e)?e.length:typeof e=="object"&&e?"self"in e&&"children"in e?1+Pc(e.children):Object.keys(e).length:0}function Uv(e){let{keyword:t,info:r}=e,i='<div class="sql-hover-keyword">';if(i+=`<div class="sql-hover-header"><strong>${t.toUpperCase()}</strong> <span class="sql-hover-type">keyword</span></div>`,i+=`<div class="sql-hover-description">${r.description}</div>`,r.syntax&&(i+=`<div class="sql-hover-syntax"><strong>Syntax:</strong> <code>${r.syntax}</code></div>`),r.example&&(i+=`<div class="sql-hover-example"><strong>Example:</strong><br><code>${r.example}</code></div>`),r.metadata&&typeof r.metadata=="object"&&Object.keys(r.metadata).length>0){i+='<div class="sql-hover-metadata">';for(let[l,c]of Object.entries(r.metadata))i+=`<span class="sql-hover-tag" title="${l}">${c}</span> `;i+="</div>"}return i+="</div>",i}function d6(e){let{tableName:t,columns:r,metadata:i}=e,l='<div class="sql-hover-table">';if(l+=`<div class="sql-hover-header"><strong>${t}</strong> <span class="sql-hover-type">table</span></div>`,l+=`<div class="sql-hover-description">Table with ${r.length} column${r.length===1?"":"s"}</div>`,r.length>0){l+='<div class="sql-hover-columns"><strong>Columns:</strong><br>';let c=r.slice(0,10);l+=c.map(d=>`<code>${d}</code>`).join(", "),r.length>10&&(l+=`, <em>and ${r.length-10} more...</em>`),l+="</div>"}if(i&&typeof i=="object"&&Object.keys(i).length>0){l+='<div class="sql-hover-metadata">';for(let[c,d]of Object.entries(i))l+=`<span class="sql-hover-tag" title="${c}">${d}</span> `;l+="</div>"}return l+="</div>",l}function f6(e){let{tableName:t,columnName:r,schema:i,metadata:l}=e,c='<div class="sql-hover-column">';c+=`<div class="sql-hover-header"><strong>${r}</strong> <span class="sql-hover-type">column</span></div>`,c+=`<div class="sql-hover-description">Column in table <code>${t}</code></div>`;let d=i[t];if(d&&d.length>1){let f=d.filter(h=>h!==r);if(f.length>0){c+=`<div class="sql-hover-related"><strong>Other columns in ${t}:</strong><br>`;let h=f.slice(0,8);c+=h.map(b=>`<code>${b}</code>`).join(", "),f.length>8&&(c+=`, <em>and ${f.length-8} more...</em>`),c+="</div>"}}if(l&&typeof l=="object"&&Object.keys(l).length>0){c+='<div class="sql-hover-metadata">';for(let[f,h]of Object.entries(l))c+=`<span class="sql-hover-tag" title="${f}">${h}</span> `;c+="</div>"}return c+="</div>",c}const p6={keyword:Uv,table:d6,column:f6,namespace:Wv},Kv=(e="light")=>{let t=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 ot.theme({".cm-sql-hover-tooltip":{padding:"8px 12px",backgroundColor:t.tooltipBg,border:`1px solid ${t.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:t.tooltipText},".cm-sql-hover-tooltip .sql-hover-header":{marginBottom:"6px",display:"flex",alignItems:"center",gap:"6px",color:t.header},".cm-sql-hover-tooltip .sql-hover-type":{fontSize:"11px",padding:"2px 6px",backgroundColor:t.tooltipTypeBg,color:t.tooltipTypeText,borderRadius:"4px",fontWeight:"500"},".cm-sql-hover-tooltip .sql-hover-description":{color:t.info,marginBottom:"8px"},".cm-sql-hover-tooltip .sql-hover-syntax":{marginBottom:"8px",color:t.syntax},".cm-sql-hover-tooltip .sql-hover-example":{marginBottom:"4px",color:t.example},".cm-sql-hover-tooltip .sql-hover-columns":{marginBottom:"4px",color:t.columns},".cm-sql-hover-tooltip .sql-hover-related":{marginBottom:"4px",color:t.related},".cm-sql-hover-tooltip .sql-hover-path":{marginBottom:"4px",color:t.path},".cm-sql-hover-tooltip .sql-hover-info":{marginBottom:"4px",color:t.info},".cm-sql-hover-tooltip .sql-hover-alias":{marginBottom:"6px",color:t.tooltipChildren,fontSize:"12px"},".cm-sql-hover-tooltip .sql-hover-children":{marginBottom:"4px",color:t.tooltipChildren,fontSize:"12px"},".cm-sql-hover-tooltip code":{backgroundColor:t.codeBg,padding:"1px 4px",borderRadius:"3px",fontSize:"12px",fontFamily:"ui-monospace, 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace",color:t.codeText},".cm-sql-hover-tooltip strong":{fontWeight:"600",color:t.strong},".cm-sql-hover-tooltip em":{fontStyle:"italic",color:t.em}})};function _o(e){return e.resolver??new e6(e)}var Qv=ot.baseTheme({".cm-sqlReference":{backgroundColor:"rgba(96, 165, 250, 0.18)"},".cm-sqlReference.cm-sqlDefinition":{backgroundColor:"rgba(96, 165, 250, 0.35)"},".cm-sqlGotoTarget":{textDecoration:"underline",cursor:"pointer"}}),m6=St.mark({class:"cm-sqlReference"}),h6=St.mark({class:"cm-sqlReference cm-sqlDefinition"}),g6=St.mark({class:"cm-sqlGotoTarget"});function y6(e){return St.set(e.references.map(t=>(t.from===e.definition.from?h6:m6).range(t.from,t.to)),!0)}var Gv=Ln.define(),Xv=Cr.define({create:()=>St.none,update(e,t){for(let r of t.effects)if(r.is(Gv))return r.value;return t.docChanged?e.map(t.changes):e},provide:e=>ot.decorations.from(e)});function v6(e={}){let t=_o(e),r=e.highlightDelay??150;return[Xv,Un.fromClass(class{constructor(i){ae(this,"view");ae(this,"timer",null);ae(this,"generation",0);this.view=i,this.schedule()}update(i){(i.selectionSet||i.docChanged)&&this.schedule()}schedule(){this.generation++,this.timer!=null&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.timer=null,this.run()},r)}async run(){let i=this.generation,l=this.view.state,c=l.selection.main,d=St.none;if(c.empty)try{let h=await t.resolve(l,c.head);h&&(d=y6(h))}catch{}if(i!==this.generation)return;let f=this.view.state.field(Xv,!1);d.size===0&&(f==null||f.size===0)||this.view.dispatch({effects:Gv.of(d)})}destroy(){this.generation++,this.timer!=null&&clearTimeout(this.timer)}}),Qv]}async function b6(e,t,r={}){let i=e.state,l=t??i.selection.main.head,c=await _o(r).resolve(i,l);return!c||e.state!==i?!1:(e.dispatch({selection:{anchor:c.definition.from,head:c.definition.to},scrollIntoView:!0,userEvent:"select"}),!0)}var hp=Ln.define(),Yv=Cr.define({create:()=>St.none,update(e,t){for(let r of t.effects)if(r.is(hp))return r.value;return t.docChanged?e.map(t.changes):e},provide:e=>ot.decorations.from(e)});function w6(e={}){let t=_o(e);return[Yv,Un.fromClass(class{constructor(r){ae(this,"view");ae(this,"hovered",null);this.view=r}update(r){r.docChanged&&(this.hovered=null)}resultAt(r){return this.hovered&&r>=this.hovered.from&&r<=this.hovered.to?this.hovered.result:null}clear(){if(this.hovered){this.hovered=null;let r=this.view.state.field(Yv,!1);r&&r.size>0&&this.view.dispatch({effects:hp.of(St.none)})}}async hover(r){let i=Nv(this.view.state,r);if(!i){this.clear();return}if(this.hovered&&this.hovered.from===i.from&&this.hovered.to===i.to)return;let l={from:i.from,to:i.to,result:null};this.hovered=l;let c=this.view.state;try{let d=await t.resolve(c,r);if(this.hovered!==l||this.view.state!==c)return;l.result=d,this.view.dispatch({effects:hp.of(d?St.set([g6.range(i.from,i.to)]):St.none)})}catch{}}destroy(){this.hovered=null}},{eventHandlers:{mousemove(r,i){if(!(r.metaKey||r.ctrlKey)){this.clear();return}let l=i.posAtCoords({x:r.clientX,y:r.clientY});if(l==null){this.clear();return}this.hover(l)},mousedown(r,i){if(!(r.metaKey||r.ctrlKey)||r.button!==0)return!1;let l=i.posAtCoords({x:r.clientX,y:r.clientY});if(l==null)return!1;let c=this.resultAt(l);return c?(i.dispatch({selection:{anchor:c.definition.from,head:c.definition.to},scrollIntoView:!0,userEvent:"select.pointer"}),!0):!1}}}),Qv]}var x6=e=>typeof window<"u"&&typeof window.prompt=="function"?window.prompt(`Rename '${e}' to:`,e):null,_6=/^[A-Za-z_][\w$]*$/,k6=new Set("all.and.as.asc.between.by.case.cross.delete.desc.distinct.else.end.except.exists.fetch.from.full.group.having.in.inner.insert.intersect.into.is.join.lateral.left.like.limit.natural.not.null.offset.on.or.order.outer.qualify.recursive.right.select.set.table.then.union.update.using.values.when.where.window.with".split("."));async function C6(e,t={}){let r=e.state,i=await _o(t).resolve(r,r.selection.main.head);if(!i)return!1;let l=await(t.prompt??x6)(i.name);return!l||l===i.name||!_6.test(l)||k6.has(l.toLowerCase())||e.state!==r?!1:(e.dispatch({changes:i.references.map(c=>({from:c.from,to:c.to,insert:l})),userEvent:"rename"}),!0)}function S6(e={}){let t={...e,resolver:_o(e)},r=e.gotoDefinitionKeys??["F12","Mod-b"],i=e.renameKey??"F2";return qr.of([...r.map(l=>({key:l,run:c=>(b6(c,void 0,t),!0)})),{key:i,run:l=>(C6(l,t),!0)}])}function E6(e={}){let t={...e,resolver:_o(e)},r=[v6(t),w6(t)];return e.keymap&&r.push(S6(t)),r}var T6=750;function ko(e){return typeof e=="object"&&!!e&&!Array.isArray(e)&&e.type==="select"}function Aa(e){return Array.isArray(e)?e:[]}function Co(e){return{sources:[],columnRefs:[],selectAliases:new Set,checkUnqualified:e,hasUsingJoin:!1}}function Nc(e,t,r){let i=Aa(e.with);for(let l of i){let c=l.name,d=typeof c=="string"?c:c==null?void 0:c.value;typeof d=="string"&&t.add(d.toLowerCase())}for(let l of i){let c=l.stmt,d=(c==null?void 0:c.ast)??c;ko(d)&&yi(d,t,r,!1)}}function Bl(e,t,r,i){e.using!=null&&(t.hasUsingJoin=!0),typeof e.join=="string"&&e.join.toLowerCase().includes("natural")&&(t.hasUsingJoin=!0),e.on!=null&&Lr(e.on,t,r,i);let l=e.expr;if(l!=null){let c=l.ast??l;ko(c)&&yi(c,r,i,!1),t.sources.push({path:"",name:"",alias:typeof e.as=="string"?e.as:null,isCte:!1,opaque:!0});return}if(typeof e.table=="string"){let c=[e.db??e.catalog,e.schema,e.table].filter(d=>typeof d=="string"&&d.length>0);t.sources.push({path:c.join("."),name:e.table,alias:typeof e.as=="string"?e.as:null,isCte:c.length===1&&r.has(e.table.toLowerCase()),opaque:!1})}}function Lr(e,t,r,i){if(typeof e!="object"||!e)return;if(Array.isArray(e)){for(let c of e)Lr(c,t,r,i);return}let l=e;if(l.type==="column_ref"){t.columnRefs.push(l);return}if(ko(l)){yi(l,r,i,!0);return}if(ko(l.ast)){yi(l.ast,r,i,!0);return}for(let[c,d]of Object.entries(l))c==="loc"||c==="tableList"||c==="columnList"||Lr(d,t,r,i)}function yi(e,t,r,i){let l=new Set(t);Nc(e,l,r);let c=Co(!i);r.push(c);for(let d of Aa(e.from))Bl(d,c,l,r);for(let d of Aa(e.columns))typeof d.as=="string"&&c.selectAliases.add(d.as.toLowerCase());for(let[d,f]of Object.entries(e))d==="with"||d==="from"||d==="loc"||Lr(f,c,l,r)}function I6(e,t){let r=new Set;switch(e.type){case"select":yi(e,r,t,!1);return;case"update":{Nc(e,r,t);let i=Co(!0);t.push(i);for(let l of Aa(e.table))Bl(l,i,r,t);for(let l of Aa(e.from))Bl(l,i,r,t);for(let l of Aa(e.set))l.column!=null&&i.columnRefs.push({type:"column_ref",table:l.table??null,column:l.column}),Lr(l.value,i,r,t);for(let[l,c]of Object.entries(e))l==="with"||l==="table"||l==="from"||l==="set"||l==="loc"||Lr(c,i,r,t);return}case"delete":{Nc(e,r,t);let i=Co(!0);t.push(i);for(let l of Aa(e.from))Bl(l,i,r,t);for(let[l,c]of Object.entries(e))l==="with"||l==="table"||l==="from"||l==="loc"||Lr(c,i,r,t);return}case"insert":case"replace":{Nc(e,r,t);let i=Co(!1);t.push(i);for(let l of Aa(e.table))Bl(l,i,r,t);for(let[l,c]of Object.entries(e))l==="with"||l==="table"||l==="columns"||l==="loc"||(ko(c)?yi(c,r,t,!1):Lr(c,i,r,t));return}case"create":case"alter":case"drop":{let i=Co(!1);t.push(i);for(let[l,c]of Object.entries(e))l==="table"||l==="loc"||(ko(c)?yi(c,r,t,!1):Lr(c,i,r,t));return}default:{let i=Co(!1);t.push(i);for(let[l,c]of Object.entries(e))l!=="loc"&&Lr(c,i,r,t)}}}function A6(e){var r;let t=e.column;if(typeof t=="string")return t;if(typeof t=="object"&&t){let i=((r=t.expr)==null?void 0:r.value)??t.value;if(typeof i=="string")return i}return null}function L6(e){return typeof e.table!="string"||e.table.length===0?null:typeof e.db=="string"&&e.db.length>0?`${e.db}.${e.table}`:e.table}function gp(e){if(e==null)return null;let t=Zn(e)?e.children:e;return wn(t)?t.map(r=>typeof r=="string"?r:r.label):null}function D6(e,t){var d;let r=Dc(e,t,{caseSensitive:!1});if(r)return{exists:!0,columns:gp(r.namespace)};let i=t.split(".").map(f=>f.toLowerCase()),l=i[i.length-1];if(!l)return{exists:!1,columns:null};let c=tp(e,l).filter(f=>{if(gp(f.namespace)===null||f.path.length<i.length)return!1;let h=f.path.slice(-i.length).map(b=>b.toLowerCase());return i.every((b,x)=>h[x]===b)});return c.length===0?{exists:!1,columns:null}:{exists:!0,columns:c.length===1?gp((d=c[0])==null?void 0:d.namespace):null}}function Jv(e,t){let r=t.toLowerCase();return e.some(i=>i.toLowerCase()===r)}function O6(e,t){let r=[];I6(e,r);let i=new Map,l=c=>{let d=`${c.kind}::${c.identifier.toLowerCase()}`;i.has(d)||i.set(d,c)};for(let c of r){let d=c.sources.map(f=>{if(f.opaque||f.isCte)return{source:f,exists:!0,columns:null};let h=D6(t,f.path);return{source:f,exists:h.exists,columns:h.columns}});for(let{source:f,exists:h}of d)!f.opaque&&!f.isCte&&!h&&l({kind:"unknownTable",identifier:f.name,message:`Unknown table '${f.path}'`});for(let f of c.columnRefs){let h=A6(f);if(!h||h==="*")continue;let b=L6(f);if(b){let S=b.toLowerCase(),E=d.find(A=>{var R;return((R=A.source.alias)==null?void 0:R.toLowerCase())===S})??d.find(A=>A.source.name.toLowerCase()===S||A.source.path.toLowerCase()===S);E!=null&&E.columns&&!Jv(E.columns,h)&&l({kind:"unknownColumn",identifier:h,message:`Column '${h}' not found in table '${E.source.path||b}'`});continue}if(!c.checkUnqualified||c.selectAliases.has(h.toLowerCase()))continue;let x=d.filter(S=>S.columns!==null&&Jv(S.columns,h));if(x.length>=2&&!c.hasUsingJoin){l({kind:"ambiguousColumn",identifier:h,message:`Column '${h}' is ambiguous; it exists in ${x.map(S=>S.source.name).join(", ")}`});continue}let C=d.length===1?d[0]:void 0;C&&C.columns!==null&&x.length===0&&l({kind:"unknownColumn",identifier:h,message:`Column '${h}' not found in table '${C.source.path}'`})}}return[...i.values()]}function M6(e,t){let r=e.toLowerCase(),i=t.toLowerCase(),l=r.indexOf(i);for(;l!==-1;){let c=l>0?r[l-1]??"":"",d=r[l+i.length]??"";if(!/[\w$]/.test(c)&&!/[\w$]/.test(d))return l;l=r.indexOf(i,l+1)}return-1}function R6(e,t,r,i){var f;let l=r.sliceString(t.from,t.to),c=M6(l,e.identifier),d=c===-1?t.from:t.from+c;return{from:d,to:Math.min(c===-1?t.from+(((f=l.match(/^[\w"'`.]+/))==null?void 0:f[0].length)??1):d+e.identifier.length,t.to),severity:i,message:e.message,source:"sql-schema"}}function P6(e){return wn(e)?e.length===0:Ta(e)?Object.keys(e).length===0:!1}function N6(e={}){var l,c,d;let t=e.parser||new hr,r=e.structureAnalyzer||new Ar(t),i={unknownTable:((l=e.severity)==null?void 0:l.unknownTable)??"warning",unknownColumn:((c=e.severity)==null?void 0:c.unknownColumn)??"warning",ambiguousColumn:((d=e.severity)==null?void 0:d.ambiguousColumn)??"warning"};return async f=>{let h=Iv(e.schema,f);if(h==null||P6(h))return[];let b=f.state.doc;if(!b.toString().trim())return[];let x=[],C=await r.analyzeDocument(f.state);for(let S of C){if(!S.isValid)continue;let E=await t.parse(S.content,{state:f.state});if(!E.success||E.ast==null)continue;let A=Array.isArray(E.ast)?E.ast:[E.ast];for(let R of A)for(let j of O6(R,h)){let q=i[j.kind];q!=="off"&&x.push(R6(j,S,b,q))}}return x}}function j6(e={}){return M_(N6(e),{delay:e.delay||T6})}var Zv=Ln.define(),eb=Cr.define({create(){return{currentStatement:null,allStatements:[],cursorPosition:0,isFocused:!0}},update(e,t){for(let r of t.effects)if(r.is(Zv))return r.value;return e}});function z6(e,t){let{isCurrent:r,isValid:i,isFocused:l}=t,c=e.backgroundColor||"#3b82f6";!i&&e.showInvalid!==!1&&(c=e.errorBackgroundColor||"#ef4444");let d=r?"1":(e.inactiveOpacity??.3).toString(),f;return f=l?d:e.unfocusedOpacity===void 0?e.hideWhenNotFocused?"0":d:e.unfocusedOpacity.toString(),{backgroundColor:c,opacity:f}}var F6=class extends E_{constructor(t,r,i=!0,l=!0){super();ae(this,"config");ae(this,"isCurrent");ae(this,"isValid");ae(this,"isFocused");this.config=t,this.isCurrent=r,this.isValid=i,this.isFocused=l}toDOM(){let t=document.createElement("div");t.className="cm-sql-gutter-marker";let{backgroundColor:r,opacity:i}=z6(this.config,{isCurrent:this.isCurrent,isValid:this.isValid,isFocused:this.isFocused});return t.style.cssText=`
|
|
121
|
+
background: ${r};
|
|
122
|
+
height: 100%;
|
|
123
|
+
width: 100%;
|
|
124
|
+
opacity: ${i};
|
|
125
|
+
transition: opacity 150ms ease-in-out;
|
|
126
|
+
border-radius: 1px;
|
|
127
|
+
`,t}eq(t){return this.isCurrent===t.isCurrent&&this.isValid===t.isValid&&this.isFocused===t.isFocused&&this.config===t.config}};function q6(e,t){var f;let r=b_.empty;if((f=t.whenHide)!=null&&f.call(t,e))return r;let i=e.state.field(eb,!1);if(!i)return r;let{currentStatement:l,allStatements:c,isFocused:d}=i;try{let h=e.state.doc.lineAt(e.viewport.from).number,b=e.state.doc.lineAt(e.viewport.to).number;for(let x of c){if(x.lineTo<h||x.lineFrom>b)continue;let C=(l==null?void 0:l.from)===x.from&&(l==null?void 0:l.to)===x.to;if(!x.isValid&&t.showInvalid===!1)continue;let S=new F6(t,C,x.isValid,d),E=Math.max(x.lineFrom,h),A=Math.min(x.lineTo,b);for(let R=E;R<=A;R++)try{if(R<1||R>e.state.doc.lines)continue;let j=e.state.doc.line(R);r=r.update({add:[S.range(j.from)]})}catch(j){console.warn("SqlGutter: Invalid line number",R,j)}}}catch(h){console.warn("SqlGutter: Error creating markers",h)}return r}async function tb(e,t){let{state:r}=e,i=r.selection.main.head,l=await t.analyzeDocument(r),c={currentStatement:await t.getStatementAtPosition(r,i),allStatements:l,cursorPosition:i,isFocused:e.hasFocus};e.dispatch({effects:Zv.of(c)})}function $6(e){return Un.define(t=>(tb(t,e),{update(r){!r.docChanged&&!r.selectionSet&&!r.focusChanged||tb(r.view,e)}}))}function V6(e){let t=e.width||3;return ot.baseTheme({".cm-sql-gutter":{width:`${t}px`,minWidth:`${t}px`},".cm-sql-gutter .cm-gutterElement":{width:`${t}px`,padding:"0",margin:"0"},".cm-sql-gutter-marker":{width:"100%",height:"100%",display:"block"},".cm-lineNumbers .cm-gutterElement":{paddingLeft:"8px",paddingRight:"8px"}})}function B6(e){return S_({class:`cm-sql-gutter ${e.className||""}`,markers:t=>q6(t,e)})}function H6(e={}){return[eb,$6(new Ar(e.parser||new hr)),V6(e),B6(e)]}function W6(e={}){let t=[],{schema:r,enableLinting:i=!0,enableSemanticLinting:l=!0,enableGutterMarkers:c=!0,enableHover:d=!0,enableNavigation:f=!0,linterConfig:h,semanticLinterConfig:b,gutterConfig:x,hoverConfig:C,navigationConfig:S}=e;if(r!=null&&t.push(np.of(r)),i&&t.push(l6(h)),l){let E=(b==null?void 0:b.parser)??(h==null?void 0:h.parser),A=(b==null?void 0:b.structureAnalyzer)??((b==null?void 0:b.parser)==null?h==null?void 0:h.structureAnalyzer:void 0);t.push(j6({...b,parser:E,structureAnalyzer:A}))}if(c&&t.push(H6(x)),d&&(t.push(u6(C)),t.push((C==null?void 0:C.theme)??Kv())),f){let E=(S==null?void 0:S.parser)??(h==null?void 0:h.parser),A=(S==null?void 0:S.structureAnalyzer)??((S==null?void 0:S.parser)==null?h==null?void 0:h.structureAnalyzer:void 0);t.push(...E6({...S,parser:E,structureAnalyzer:A}))}return t}var U6=class nS{static jsonStringifySortKeys(){return t=>typeof t!="object"||!t?String(t):JSON.stringify(t,Object.keys(t).toSorted(),2)}constructor(t,r={}){this.delegate=t,this.toKey=r.toKey??nS.jsonStringifySortKeys(),this.cache=new vc(r.maxSize??128)}request(t){let r=this.toKey(t),i=this.cache.get(r);if(i!==void 0)return i;let l=this.delegate.request(t);return this.cache.set(r,l),l.catch(c=>{throw this.cache.delete(r),c})}resolve(t,r){this.delegate.resolve(t,r)}reject(t,r){this.delegate.reject(t,r)}};lk=new wl("data-source-discovery-result",async e=>{await Kn().discoverDataSources({requestId:e})}),ZC=new wl("sql-table-preview",async(e,t)=>{await Kn().previewSQLTable({requestId:e,...t})}),vk=new wl("sql-schema-list-preview",async(e,t)=>{await Kn().previewSQLSchemaList({requestId:e,...t})}),K_=new wl("sql-table-list-preview",async(e,t)=>{await Kn().previewSQLTableList({requestId:e,...t})}),L0=new U6(new wl("validate-sql",async(e,t)=>{await Kn().validateSQL({requestId:e,...t})}),{maxSize:3});var K6=Wn();let vi;vi=Ie(new Map),ak=e=>{let t=(0,K6.c)(3),r=un(vi),i;return t[0]!==e||t[1]!==r?(i=r.get(e),t[0]=e,t[1]=r,t[2]=i):i=t[2],i};function yp(e){let t=Te.get(vi),r=new Map(t);r.delete(e),Te.set(vi,r)}function Q6(){Te.set(vi,new Map)}function G6({cellId:e,errorMessage:t,dialect:r}){let i=Te.get(vi),l=new Map(i),c=r==="DuckDB"?X6(t):nb(t);l.set(e,c),Te.set(vi,l)}function X6(e){let{errorType:t,errorMessage:r}=nb(e),i=r,l,c=r.indexOf("LINE ");return c!==-1&&(l=r.slice(Math.max(0,c)).trim(),i=r.slice(0,Math.max(0,c)).trim()),{errorType:t,errorMessage:i,codeblock:l}}function nb(e){return{errorType:e.split(":")[0].trim(),errorMessage:e.split(":").slice(1).join(":").trim()}}function rb(e){return e.field($r)}function Y6(){return e=>{let t=rb(e.state).engine,r=mi.getCompletionSource(t);return r&&jD(r)(e)||null}}function J6(){return e=>{let t=rb(e.state).engine,r=mi.getDialect(t);return e.matchBefore(/\.\w*/)?null:BD(r,!0,(i,l)=>({label:i,type:l,info:async()=>{let c=(await Z6())[i.toLocaleLowerCase()];if(!c)return null;let d=document.createElement("div");return d.innerHTML=p6.keyword({keyword:i,info:c}),d}}))(e)}}var Z6=dr(async()=>{let e=await ne(()=>import("./common-keywords-DdCmdKox.js").then(async r=>(await r.__tla,r)),[],import.meta.url),t=await ne(()=>import("./duckdb-keywords-D9ZiGTTc.js").then(async r=>(await r.__tla,r)),[],import.meta.url);return{...e.default.keywords,...t.default.keywords}}),eI=Wn(),ab=ac("marimo:notebook-sql-mode","default",Id);function tI(){let e=(0,eI.c)(3),[t,r]=i_(ab),i;return e[0]!==r||e[1]!==t?(i={sqlMode:t,setSQLMode:r},e[0]=r,e[1]=t,e[2]=i):i=e[2],i}function ib(){return Te.get(ab)}var nI=Yy,vp="DuckDB",ob=new pd;function bp(){return Te.get(ao).latestEngineSelected}kd=(Ap=class{constructor(){ae(this,"parser",new Nd);ae(this,"type","sql");this.sqlModeEnabled=!0}get defaultMetadata(){return{...this.parser.defaultMetadata,engine:bp()||"__marimo_duckdb"}}get defaultCode(){let e=bp();return e&&e!=="__marimo_duckdb"?`_df = mo.sql(f"""SELECT * FROM """, engine=${e})`:this.parser.defaultCode}transformIn(e){this.parser.defaultMetadata.engine=bp()||"__marimo_duckdb";let t=this.parser.transformIn(e),r=t.metadata;return r.engine&&r.engine!=="__marimo_duckdb"&&t1(r.engine),[t.code,t.offset,r]}transformOut(e,t){let r=this.parser.transformOut(e,t);return[r.code,r.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,t,r,i,l){var f;let c=rI(),d=[ob.of(z_({dialect:nI})),qr.of([{key:"Tab",run:h=>LD(h)||uD(h),preventDefault:!0}]),gd({defaultKeymap:!1,activateOnTyping:!0,override:[Y6(),zT,J6(),c.cteCompletionSource,c.aliasCompletionSource,c.columnCompletionSource]})];if(((f=l==null?void 0:l.diagnostics)==null?void 0:f.sql_linter)??!1){let h=Te.get(rO),b=new oI({getParserOptions:x=>({database:ub(x)??vp})});d.push(W6({schema:xp,enableLinting:!0,linterConfig:{delay:250,parser:b,perStatement:!1},enableSemanticLinting:!0,semanticLinterConfig:{parser:c.parser,structureAnalyzer:c.structureAnalyzer,severity:{unknownTable:"off",unknownColumn:"warning",ambiguousColumn:"warning"}},enableGutterMarkers:!0,gutterConfig:{backgroundColor:"#3b82f6",errorBackgroundColor:"#ef4444",hideWhenNotFocused:!0,parser:b},hoverConfig:{hoverTime:300,enableKeywords:!0,enableTables:!0,enableColumns:!0,parser:c.parser,contextAnalyzer:c.contextAnalyzer,theme:Kv(h)},enableNavigation:!0,navigationConfig:{contextAnalyzer:c.contextAnalyzer,keymap:!1,parser:c.parser,structureAnalyzer:c.structureAnalyzer}}),ot.updateListener.of(x=>{x.focusChanged&&b.setFocusState(x.view.hasFocus)}))}return this.sqlModeEnabled&&d.push(uI()),d}},ae(Ap,"fromQuery",e=>Nd.fromQuery(e)),Ap);function rI(){let e=new hr({getParserOptions:i=>({database:wp(i)})}),t=new aI(e),r=new iI(e);return{parser:e,contextAnalyzer:t,structureAnalyzer:r,cteCompletionSource:$v({parser:e,contextAnalyzer:t,structureAnalyzer:r}),aliasCompletionSource:B5({schema:xp,parser:e,contextAnalyzer:t}),columnCompletionSource:K5({schema:xp,parser:e,contextAnalyzer:t})}}function wp(e){return ub(e)??vp}var aI=class extends gi{constructor(t){super(t);ae(this,"analyzers",new Map);this.analysisParser=t}getContext(t,r){return this.getAnalyzer(r.state).getContext(t,r)}clearCache(){for(let t of this.analyzers.values())t.clearCache()}getAnalyzer(t){let r=wp(t),i=this.analyzers.get(r);return i||(i=new gi(this.analysisParser),this.analyzers.set(r,i)),i}},iI=class extends Ar{constructor(t){super(t);ae(this,"analyzers",new Map);this.analysisParser=t}analyzeDocument(t){return this.getAnalyzer(t).analyzeDocument(t)}getStatementAtPosition(t,r){return this.getAnalyzer(t).getStatementAtPosition(t,r)}getStatementsInRange(t,r,i){return this.getAnalyzer(t).getStatementsInRange(t,r,i)}clearCache(){for(let t of this.analyzers.values())t.clearCache()}getAnalyzer(t){let r=wp(t),i=this.analyzers.get(r);return i||(i=new Ar(this.analysisParser),this.analyzers.set(r,i)),i}},oI=class extends hr{constructor(){super(...arguments);ae(this,"validationTimeout",null);ae(this,"pendingValidationResolve",null);ae(this,"VALIDATION_DELAY_MS",300);ae(this,"isFocused",!1)}setFocusState(t){this.isFocused=t}resolvePendingValidation(t){var r;(r=this.pendingValidationResolve)==null||r.call(this,t),this.pendingValidationResolve=null}async validateWithDelay(t,r,i){return this.validationTimeout&&(window.clearTimeout(this.validationTimeout),this.resolvePendingValidation([])),new Promise(l=>{this.pendingValidationResolve=l,this.validationTimeout=window.setTimeout(async()=>{var c;if(this.validationTimeout=null,!this.isFocused){this.resolvePendingValidation([]);return}try{let d=await db(t,r,i,so.has(r)?ib():"default");if(d.error){be.error("Failed to validate SQL",{error:d.error}),this.resolvePendingValidation([]);return}this.resolvePendingValidation(((c=d.parse_result)==null?void 0:c.errors)??[])}catch(d){be.error("Failed to validate SQL",{error:d}),this.resolvePendingValidation([])}},this.VALIDATION_DELAY_MS)})}async validateSql(t,r){let i=So(r.state),l=jc(i.engine);return this.isFocused?lb(i.engine,l)?this.validateWithDelay(t,i.engine,l??vp):super.validateSql(t,r):[]}async parse(t,r){let i=So(r.state).engine;return lb(i,jc(i))?{success:!0,errors:[]}:super.parse(t,r)}};function lb(e,t){return e==="__marimo_duckdb"||t==="DuckDB"}function sb(e,t){e.dispatch({effects:ob.reconfigure(z_({dialect:t}))})}function lI(e,t){sb(e,mi.getDialect(t))}function sI(e){let t=So(e.state).engine;sb(e,mi.getDialect(t))}function So(e){return e.field($r)}function xp(e){let t=So(e.state).engine,r=mi.getCompletionSource(t);if(!(r!=null&&r.schema))return{};let i=r.schema;if(!cb(i))return i;let l=r.defaultSchema,c=l?i[l]:void 0;return c&&!Array.isArray(c)&&typeof c=="object"&&"children"in c&&cb(c.children)?{...i,...Object.fromEntries(Object.entries(c.children).filter(([d])=>!Object.hasOwn(i,d)))}:i}function cb(e){if(Array.isArray(e))return!1;if(!("self"in e)||!("children"in e))return!0;let t=e.self;return!(typeof t=="object"&&t&&!Array.isArray(t)&&"label"in t&&typeof t.label=="string")}function ub(e){let t=So(e).engine;return jc(t)}function jc(e){var r;let t=(r=mi.getInternalDialect(e))==null?void 0:r.toLowerCase();if(!t||!gc(t))return null;switch(t){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":case"dremio":return be.debug("Unsupported dialect",{dialect:t}),null;default:return bl(t),null}}var cI=300;function uI(){return Un.define(e=>{let t,r=null,i=e.state.facet(ga);return{update(l){if(!l.docChanged)return;let c=ib();if(c==="default")return;let d=So(l.state).engine;if(!so.has(d))return;let f=l.state.doc.toString();t&&window.clearTimeout(t),t=window.setTimeout(async()=>{if(r!==f){if(r=f,f===""){yp(i);return}try{let h=jc(d),b=(await db(f,d,h,c)).validate_result;b!=null&&b.error_message?G6({cellId:i,errorMessage:b.error_message,dialect:h}):yp(i)}catch(h){be.error("Failed to validate SQL",{error:h})}}},cI)},destroy(){t&&window.clearTimeout(t),yp(i)}}})}async function db(e,t,r,i){let l=await L0.request({onlyParse:i==="default",engine:t,dialect:r,query:e});if(l.error)throw Error(l.error);return l}var dI=dr(()=>new E5),fI=dr(()=>new Td),pI=dr(()=>new kd);Gn={get python(){return dI()},get markdown(){return fI()},get sql(){return pI()}};function mI(){return Object.values(Gn)}let fb;fb=Wn(),Zs=xe.forwardRef((e,t)=>{let r=(0,fb.c)(13),i,l;r[0]===e?(i=r[1],l=r[2]):({className:i,...l}=e,r[0]=e,r[1]=i,r[2]=l);let c;r[3]===i?c=r[4]:(c=Fr("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 data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground",i),r[3]=i,r[4]=c);let d;r[5]===Symbol.for("react.memo_cache_sentinel")?(d=Fr("flex items-center justify-center text-current max-h-[14px] overflow-hidden"),r[5]=d):d=r[5];let f;r[6]===l.checked?f=r[7]:(f=(0,O.jsx)(Ig,{className:d,children:l.checked==="indeterminate"?(0,O.jsx)(y0,{className:"h-4 w-4"}):(0,O.jsx)(QD,{className:"h-4 w-4"})}),r[6]=l.checked,r[7]=f);let h;return r[8]!==l||r[9]!==t||r[10]!==c||r[11]!==f?(h=(0,O.jsx)(nf,{ref:t,className:c,...l,children:f}),r[8]=l,r[9]=t,r[10]=c,r[11]=f,r[12]=h):h=r[12],h}),Zs.displayName=nf.displayName,pk="_";var hI=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("."));v0=function(e,t=!0){return e=e.trim(),e?(/^\d/.test(e)&&(e=`_${e}`),e=e.replaceAll(/\W/g,"_"),t?e.toLowerCase():e):"_"},H_=function(e,t){let r=new Set(t),i=e,l=d=>!r.has(d)&&!hI.has(d);if(l(e))return e;let c=1;for(;!l(i);)i=`${e}_${c}`,c++;return i},sC=function(e,t){return J0(e)?`cell-${t}`:e},J0=function(e){return e?e==="_"||e==="__":!0};var gI=Wn();function yI(e){let t=(0,gI.c)(15),{minWidth:r,padding:i}=e,l=r===void 0?70:r,c=i===void 0?15:i,[d,f]=(0,xe.useState)(50),h=(0,xe.useRef)(null),b=(0,xe.useRef)(null),x;t[0]===c?x=t[1]:(x=F=>{if(b.current&&h.current){let H=b.current;H.style.fontSize=window.getComputedStyle(h.current).fontSize,H.style.fontFamily=window.getComputedStyle(h.current).fontFamily,H.textContent=F;let te=H.offsetWidth;f(te+c)}},t[0]=c,t[1]=x);let C=x,S;t[2]===C?S=t[3]:(S=()=>{var F;C(((F=h.current)==null?void 0:F.value)??"")},t[2]=C,t[3]=S),KD(S);let E;t[4]===C?E=t[5]:(E=F=>{C(F.target.value)},t[4]=C,t[5]=E);let A=`${d}px`,R=`${l}px`,j;t[6]!==A||t[7]!==R?(j={width:A,minWidth:R},t[6]=A,t[7]=R,t[8]=j):j=t[8];let q;t[9]!==E||t[10]!==j?(q={ref:h,type:"text",onChange:E,style:j},t[9]=E,t[10]=j,t[11]=q):q=t[11];let V=q,z;t[12]===Symbol.for("react.memo_cache_sentinel")?(z={ref:b,style:{visibility:"hidden",position:"absolute",whiteSpace:"pre"}},t[12]=z):z=t[12];let X=z,fe;return t[13]===V?fe=t[14]:(fe={inputProps:V,spanProps:X},t[13]=V,t[14]=fe),fe}var vI=Wn();function bI({currentQuotePrefix:e,checked:t,prefix:r}){let i=e;return t?e===""?i=r:e!=="rf"&&r!==e&&(i="rf"):e===r?i="":e==="rf"&&(i=r==="r"?"f":"r"),i}let pb;pb=()=>{let e=(0,vI.c)(2),t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,O.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,O.jsxs)("header",{className:"flex items-center gap-1",children:[(0,O.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"r"}),(0,O.jsx)("span",{className:"font-semibold",children:"Raw String"})]}),(0,O.jsx)("p",{className:"text-sm text-muted-foreground",children:"Write LaTeX without escaping special characters"}),(0,O.jsx)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:"\\alpha \\beta"})]}),e[0]=t):t=e[0];let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,O.jsxs)("div",{className:"flex flex-col gap-3.5",children:[t,(0,O.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,O.jsxs)("header",{className:"flex items-center gap-1",children:[(0,O.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"f"}),(0,O.jsx)("span",{className:"font-semibold",children:"Format String"})]}),(0,O.jsx)("p",{className:"text-sm text-muted-foreground",children:"Interpolate Python values"}),(0,O.jsxs)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:["Hello ","{name}","! \u{1F601}"]})]})]}),e[1]=r):r=e[1],r},hg="data-cell-id",Z_=function(e){return{[hg]:e}},C0="data-for-cell-id",wd=function(e){return{[C0]:e}};var wI="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",xI="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",_I="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==",kI="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",CI="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",SI=""+new URL("iceberg-COKYXo-A.png",import.meta.url).href,EI="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",TI="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",mb=""+new URL("postgresql-q8VEBKGg.svg",import.meta.url).href,II="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",AI="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",LI="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",DI="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",OI="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",MI="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",RI=""+new URL("trino-DFsJbQoT.svg",import.meta.url).href,PI=Wn(),NI={sqlite:DI,duckdb:kI,motherduck:EI,postgres:mb,postgresql:mb,mysql:TI,snowflake:AI,databricks:xI,clickhouse:wI,timeplus:MI,bigquery:CI,trino:RI,iceberg:SI,datafusion:_I,pyspark:LI,redshift:II,supabase:OI};t0=e=>{let t=(0,PI.c)(11),{name:r,className:i}=e,l=NI[r.toLowerCase()];if(!l){let f;t[0]===i?f=t[1]:(f=Fr("mt-0.5",i),t[0]=i,t[1]=f);let h;return t[2]===f?h=t[3]:(h=(0,O.jsx)(_l,{className:f}),t[2]=f,t[3]=h),h}let c;t[4]!==i||t[5]!==l?(c=Fr("invert-[.5] dark:invert-[.7]",i,l.endsWith(".png")&&"brightness-100 dark:brightness-100 invert-0 dark:invert-0"),t[4]=i,t[5]=l,t[6]=c):c=t[6];let d;return t[7]!==r||t[8]!==c||t[9]!==l?(d=(0,O.jsx)("img",{src:l,alt:r,className:c}),t[7]=r,t[8]=c,t[9]=l,t[10]=d):d=t[10],d};var _p=Wn();const jI=e=>{let t=(0,_p.c)(34),{selectedEngine:r,onChange:i,cellId:l}=e,c=un(Ed),d=[],f=[];for(let[ce,ye]of c.entries())so.has(ce)?d.push(ye):f.push(ye);let h=OD(),b=r&&!c.has(r),x;t[0]!==c||t[1]!==i||t[2]!==h?(x=ce=>{if(ce===hb){window.open(gb,"_blank");return}let ye=c.get(ce);ye&&(h(),i(ye.name),t1(ye.name))},t[0]=c,t[1]=i,t[2]=h,t[3]=x):x=t[3];let C=x,S=VI,E=K8,A;t[4]===l?A=t[5]:(A=wd(l),t[4]=l,t[5]=A);let R;t[6]===Symbol.for("react.memo_cache_sentinel")?(R=(0,O.jsx)(V8,{placeholder:"Select an engine"}),t[6]=R):R=t[6];let j;t[7]===A?j=t[8]:(j=(0,O.jsx)(FI,{...A,children:R}),t[7]=A,t[8]=j);let q=H8,V;t[9]===l?V=t[10]:(V=wd(l),t[9]=l,t[10]=V);let z=W8,X;t[11]===Symbol.for("react.memo_cache_sentinel")?(X=(0,O.jsx)($8,{children:"Database connections"}),t[11]=X):X=t[11];let fe;t[12]!==b||t[13]!==r?(fe=b&&(0,O.jsx)(Rh,{value:r,children:(0,O.jsxs)("div",{className:"flex items-center gap-1 opacity-50",children:[(0,O.jsx)(A0,{className:"h-3 w-3"}),(0,O.jsx)("span",{className:"truncate",children:o1(r)})]})},r),t[12]=b,t[13]=r,t[14]=fe):fe=t[14];let F=S(f),H=f.length>0&&(0,O.jsx)(g_,{}),te=S(d),me;t[15]===Symbol.for("react.memo_cache_sentinel")?(me=(0,O.jsx)(g_,{}),t[15]=me):me=t[15];let ve;t[16]===Symbol.for("react.memo_cache_sentinel")?(ve=(0,O.jsx)(Rh,{className:"text-muted-foreground",value:hb,children:(0,O.jsxs)("a",{className:"flex items-center gap-1",href:gb,target:"_blank",rel:"noreferrer",children:[(0,O.jsx)(YD,{className:"h-3 w-3"}),(0,O.jsx)("span",{children:"How to add a database connection"})]})}),t[16]=ve):ve=t[16];let _e;t[17]!==z||t[18]!==H||t[19]!==te||t[20]!==X||t[21]!==fe||t[22]!==F?(_e=(0,O.jsxs)(z,{children:[X,fe,F,H,te,me,ve]}),t[17]=z,t[18]=H,t[19]=te,t[20]=X,t[21]=fe,t[22]=F,t[23]=_e):_e=t[23];let ke;t[24]!==q||t[25]!==_e||t[26]!==V?(ke=(0,O.jsx)(q,{...V,children:_e}),t[24]=q,t[25]=_e,t[26]=V,t[27]=ke):ke=t[27];let oe;return t[28]!==E||t[29]!==C||t[30]!==r||t[31]!==ke||t[32]!==j?(oe=(0,O.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,O.jsxs)(E,{value:r,onValueChange:C,children:[j,ke]})}),t[28]=E,t[29]=C,t[30]=r,t[31]=ke,t[32]=j,t[33]=oe):oe=t[33],oe};var hb="__help__",gb="http://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database";const zI=()=>{let e=(0,_p.c)(16),{sqlMode:t,setSQLMode:r}=tI(),i;e[0]!==r||e[1]!==t?(i=()=>{let E=t==="validate"?"default":"validate";E==="default"&&Q6(),r(E)},e[0]=r,e[1]=t,e[2]=i):i=e[2];let l=i,c=BI,d=HI,f;e[3]===t?f=e[4]:(f=d(t),e[3]=t,e[4]=f);let h;e[5]===t?h=e[6]:(h=c(t),e[5]=t,e[6]=h);let b=t==="validate"?"Validate":"Default",x;e[7]===b?x=e[8]:(x=(0,O.jsx)("span",{className:"ml-1",children:b}),e[7]=b,e[8]=x);let C;e[9]!==l||e[10]!==h||e[11]!==x?(C=(0,O.jsxs)(y_,{variant:"ghost",size:"sm",onClick:l,className:"h-5 px-1.5 text-xs border-border shadow-none hover:bg-accent",children:[h,x]}),e[9]=l,e[10]=h,e[11]=x,e[12]=C):C=e[12];let S;return e[13]!==f||e[14]!==C?(S=(0,O.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,O.jsx)(Ph,{delayDuration:300,content:f,children:C})}),e[13]=f,e[14]=C,e[15]=S):S=e[15],S};var FI=e=>{let t=(0,_p.c)(6),r,i;t[0]===e?(r=t[1],i=t[2]):({children:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let l;return t[3]!==r||t[4]!==i?(l=(0,O.jsx)(U8,{className:"text-xs border-border shadow-none! ring-0! h-5 px-1.5 hover:bg-accent transition-colors",...i,children:r}),t[3]=r,t[4]=i,t[5]=l):l=t[5],l};function qI(e){return e.source!=="iceberg"}function $I(e){return(0,O.jsx)(Rh,{value:e.name,children:(0,O.jsxs)("div",{className:"flex items-center gap-1",children:[(0,O.jsx)(t0,{className:"h-3 w-3",name:e.dialect}),(0,O.jsx)("span",{className:"truncate ml-0.5",children:o1(e.display_name)})]})},e.name)}function VI(e){return e=e.filter(qI),e.map($I)}function BI(e){return e==="validate"?(0,O.jsx)(Df,{className:"h-3 w-3"}):(0,O.jsx)(Hh,{className:"h-3 w-3"})}function HI(e){return e==="validate"?(0,O.jsxs)("div",{className:"text-xs",children:[(0,O.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,O.jsx)(Df,{className:"h-3 w-3"}),"Validate Mode"]}),(0,O.jsx)("p",{children:"Queries are validated as you write them"})]}):(0,O.jsxs)("div",{className:"text-xs",children:[(0,O.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,O.jsx)(Hh,{className:"h-3 w-3"}),"Default Mode"]}),(0,O.jsx)("p",{children:"Standard editing"})]})}var yb=Wn(),vb=()=>{let e=(0,yb.c)(1),t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,O.jsx)("div",{className:"h-4 border-r border-border"}),e[0]=t):t=e[0],t};const WI=e=>{let t=(0,yb.c)(102),{view:r}=e,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={minWidth:50},t[0]=i):i=t[0];let{spanProps:l,inputProps:c}=yI(i),d;t[1]===r.state?d=t[2]:(d=r.state.field(Jn),t[1]=r.state,t[2]=d);let f=d,h;t[3]===r.state?h=t[4]:(h=r.state.facet(ga),t[3]=r.state,t[4]=h);let b=h,x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=(0,O.jsx)("div",{}),t[5]=x):x=t[5];let C=x,S=!1,E;t[6]===r?E=t[7]:(E=q=>{r.dispatch({effects:Rd.of(q),changes:{from:0,to:r.state.doc.length,insert:r.state.doc.toString()}})},t[6]=r,t[7]=E);let A=E;if(f instanceof kd){let q;t[8]===r.state?q=t[9]:(q=r.state.field($r),t[8]=r.state,t[9]=q);let V=q;S=!0;let z;t[10]===A?z=t[11]:(z=Dt=>{let jt=v0(Dt.currentTarget.value,!1);Dt.currentTarget.value=jt,A({dataframeName:jt})},t[10]=A,t[11]=z);let X=z,fe;t[12]!==A||t[13]!==r?(fe=Dt=>{A({engine:Dt}),lI(r,Dt)},t[12]=A,t[13]=r,t[14]=fe):fe=t[14];let F=fe,H;t[15]===Symbol.for("react.memo_cache_sentinel")?(H=(0,O.jsx)("span",{className:"select-none",children:"Output variable: "}),t[15]=H):H=t[15];let te;t[16]===c?te=t[17]:(te=Dt=>{var jt;(jt=c.onChange)==null||jt.call(c,Dt)},t[16]=c,t[17]=te);let me;t[18]===X?me=t[19]:(me=Dt=>{Dt.key==="Enter"&&Dt.shiftKey&&X(Dt)},t[18]=X,t[19]=me);let ve;t[20]!==c||t[21]!==V.dataframeName||t[22]!==X||t[23]!==te||t[24]!==me?(ve=(0,O.jsx)("input",{...c,defaultValue:V.dataframeName,onChange:te,onBlur:X,onKeyDown:me,className:"min-w-14 w-auto border border-border rounded px-1 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring"}),t[20]=c,t[21]=V.dataframeName,t[22]=X,t[23]=te,t[24]=me,t[25]=ve):ve=t[25];let _e;t[26]===l?_e=t[27]:(_e=(0,O.jsx)("span",{...l}),t[26]=l,t[27]=_e);let ke;t[28]!==ve||t[29]!==_e?(ke=(0,O.jsxs)("label",{className:"flex gap-2 items-center",children:[H,ve,_e]}),t[28]=ve,t[29]=_e,t[30]=ke):ke=t[30];let oe;t[31]!==b||t[32]!==V.engine||t[33]!==F?(oe=(0,O.jsx)(jI,{selectedEngine:V.engine,onChange:F,cellId:b}),t[31]=b,t[32]=V.engine,t[33]=F,t[34]=oe):oe=t[34];let ce;t[35]===V.engine?ce=t[36]:(ce=V.engine==="__marimo_duckdb"&&(0,O.jsx)(zI,{}),t[35]=V.engine,t[36]=ce);let ye;t[37]!==V.engine||t[38]!==r?(ye=async()=>{await fE(r,V.engine)},t[37]=V.engine,t[38]=r,t[39]=ye):ye=t[39];let ie;t[40]===Symbol.for("react.memo_cache_sentinel")?(ie=(0,O.jsx)(eg,{className:"h-3 w-3"}),t[40]=ie):ie=t[40];let le;t[41]===ye?le=t[42]:(le=(0,O.jsx)(Ph,{content:"Format SQL",children:(0,O.jsx)(y_,{variant:"text",size:"icon",onClick:ye,children:ie})}),t[41]=ye,t[42]=le);let K;t[43]===Symbol.for("react.memo_cache_sentinel")?(K=(0,O.jsx)(vb,{}),t[43]=K):K=t[43];let Le;t[44]===A?Le=t[45]:(Le=Dt=>{A({showOutput:!Dt.target.checked})},t[44]=A,t[45]=Le);let Pe=!V.showOutput,Ke;t[46]!==Le||t[47]!==Pe?(Ke=(0,O.jsx)("input",{type:"checkbox",onChange:Le,checked:Pe}),t[46]=Le,t[47]=Pe,t[48]=Ke):Ke=t[48];let Ve;t[49]===Symbol.for("react.memo_cache_sentinel")?(Ve=(0,O.jsx)("span",{className:"select-none",children:"Hide output"}),t[49]=Ve):Ve=t[49];let je;t[50]===Ke?je=t[51]:(je=(0,O.jsxs)("label",{className:"flex items-center gap-2",children:[Ke,Ve]}),t[50]=Ke,t[51]=je);let De;t[52]!==ce||t[53]!==le||t[54]!==je?(De=(0,O.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[ce,le,K,je]}),t[52]=ce,t[53]=le,t[54]=je,t[55]=De):De=t[55];let ze;t[56]!==ke||t[57]!==oe||t[58]!==De?(ze=(0,O.jsxs)("div",{className:"flex flex-1 gap-2 items-center",children:[ke,oe,De]}),t[56]=ke,t[57]=oe,t[58]=De,t[59]=ze):ze=t[59],C=ze}if(f instanceof Td){S=!0;let q,V,z,X,fe,F,H,te,me,ve;if(t[60]!==A||t[61]!==r.state){let{quotePrefix:Le}=r.state.field($r);V=Le,V===void 0&&(V="r",A({quotePrefix:V})),ve=(Pe,Ke)=>{typeof Ke=="boolean"&&A({quotePrefix:bI({currentQuotePrefix:V,checked:Ke,prefix:Pe})})},X="flex flex-row w-full justify-end gap-1.5 items-center",me="flex items-center gap-1.5",t[72]===Symbol.for("react.memo_cache_sentinel")?(z=(0,O.jsx)("span",{children:"r"}),t[72]=z):z=t[72],q=Zs,F="Toggle raw string",H="w-3 h-3",te=V.includes("r"),fe=Pe=>{ve("r",Pe)},t[60]=A,t[61]=r.state,t[62]=q,t[63]=V,t[64]=z,t[65]=X,t[66]=fe,t[67]=F,t[68]=H,t[69]=te,t[70]=me,t[71]=ve}else q=t[62],V=t[63],z=t[64],X=t[65],fe=t[66],F=t[67],H=t[68],te=t[69],me=t[70],ve=t[71];let _e;t[73]!==q||t[74]!==fe||t[75]!==F||t[76]!==H||t[77]!==te?(_e=(0,O.jsx)(q,{"aria-label":F,className:H,checked:te,onCheckedChange:fe}),t[73]=q,t[74]=fe,t[75]=F,t[76]=H,t[77]=te,t[78]=_e):_e=t[78];let ke;t[79]!==z||t[80]!==_e||t[81]!==me?(ke=(0,O.jsxs)("div",{className:me,children:[z,_e]}),t[79]=z,t[80]=_e,t[81]=me,t[82]=ke):ke=t[82];let oe;t[83]===Symbol.for("react.memo_cache_sentinel")?(oe=(0,O.jsx)("span",{children:"f"}),t[83]=oe):oe=t[83];let ce;t[84]===V?ce=t[85]:(ce=V.includes("f"),t[84]=V,t[85]=ce);let ye;t[86]===ve?ye=t[87]:(ye=Le=>{ve("f",Le)},t[86]=ve,t[87]=ye);let ie;t[88]!==ce||t[89]!==ye?(ie=(0,O.jsxs)("div",{className:"flex items-center gap-1.5",children:[oe,(0,O.jsx)(Zs,{"aria-label":"Toggle f-string",className:"w-3 h-3",checked:ce,onCheckedChange:ye})]}),t[88]=ce,t[89]=ye,t[90]=ie):ie=t[90];let le;t[91]===Symbol.for("react.memo_cache_sentinel")?(le=(0,O.jsx)(Ph,{content:(0,O.jsx)(pb,{}),children:(0,O.jsx)(Ld,{className:"w-3 h-3"})}),t[91]=le):le=t[91];let K;t[92]!==X||t[93]!==ke||t[94]!==ie?(K=(0,O.jsxs)("div",{className:X,children:[ke,ie,le]}),t[92]=X,t[93]=ke,t[94]=ie,t[95]=K):K=t[95],C=K}let R;t[96]===S?R=t[97]:(R=S&&(0,O.jsx)(vb,{}),t[96]=S,t[97]=R);let j;return t[98]!==C||t[99]!==f.type||t[100]!==R?(j=(0,O.jsx)(Q8,{children:(0,O.jsxs)("div",{className:"flex justify-between items-center gap-4 pl-2 pt-2",children:[C,R,f.type]})}),t[98]=C,t[99]=f.type,t[100]=R,t[101]=j):j=t[101],j};var kp=new pd;Yd=Ln.define(),Jn=Cr.define({create(){return Gn.python},update(e,t){for(let r of t.effects)if(r.is(Yd))return r.value;return e},provide:e=>jh.from(e,t=>t.type==="python"?null:r=>hE(r,WI))});function UI(){let e=mI(),t=(r,i)=>{let l=e[i%e.length];return l.isSupported(r)?l:t(r,i+1)};return[qr.of([{key:"F4",preventDefault:!0,run:r=>{let i=r.state.field(Jn),l=e.findIndex(d=>d.type===i.type),c=t(r.state.doc.toString(),l+1);return i===c?!1:(bb({view:r,nextLanguage:c,opts:{keepCodeAsIs:!1}}),!0)}}])]}function bb({view:e,nextLanguage:t,opts:r}){let i=e.state.field(Jn),l=e.state.doc.toString(),c=e.state.facet(Ky),d=e.state.facet(Qy),f=e.state.facet(Af),h=e.state.facet(hc),b=e.state.facet(Gy),x=e.state.field($r),C=e.state.selection.main.head,S;if(r.keepCodeAsIs)S=l,i.type!==t.type&&(x={...t.defaultMetadata});else{let[E,A]=i.transformOut(l,x),[R,j,q]=t.transformIn(E);C+=A,C-=j,C=$h(C,0,R.length),S=R,x=q}e.dispatch({effects:[Yd.of(t),Md.of(x),kp.reconfigure(t.getExtension(h,c,d,f,b)),Vd.reconfigure([]),Pl.of(!0)],changes:r.keepCodeAsIs?void 0:{from:0,to:e.state.doc.length,insert:S},selection:r.keepCodeAsIs?void 0:Kt.cursor(C)}),e.dispatch({effects:[Vd.reconfigure([mD()])]}),t.type==="sql"&&sI(e)}zk=function(e){let{placeholderType:t,completionConfig:r,hotkeys:i,cellId:l,lspConfig:c}=e;return[UI(),kp.of(Gn.python.getExtension(l,r,i,t,c)),Jn,$r]},HC=function(e){return wb(Sr({state:e}).trim())};function wb(e){return e?Gn.markdown.isSupported(e)?Gn.markdown:Gn.sql.isSupported(e)?Gn.sql:Gn.python:Gn.python}Od=function(e,t){e.state.field(Jn).type!==t.language&&bb({view:e,nextLanguage:Gn[t.language],opts:{keepCodeAsIs:t.keepCodeAsIs??!1}})},Wk=function(e,{completionConfig:t,hotkeysProvider:r,lspConfig:i}){let l=e.state.field(Jn),c=e.state.facet(Af),d=e.state.facet(hc);return d===void 0&&be.error("Cell ID is undefined in reconfigureLanguageEffect"),c===void 0&&be.error("Placeholder type is undefined in reconfigureLanguageEffect"),t===void 0&&be.error("Completion config is undefined in reconfigureLanguageEffect"),kp.reconfigure(l.getExtension(d,t,r,c,i))},Sr=function(e,t,r){let i=e.state.field(Jn),l=e.state.field($r),c=e.state.doc.toString();return t===void 0?i.transformOut(c,l)[0]:i.transformOut(c.slice(t,r),l)[0]},oo=function(e,t){let r=e.state.field(Jn),i=wb(t);i.type!==r.type&&Od(e,{language:i.type,keepCodeAsIs:!0});let[l]=e.state.field(Jn).transformIn(t);return Ad(e,l),l};function KI(e){let t=e.state.selection.main.head,r=e.state.doc.toString(),i=r.length>0&&r[t-1]===`
|
|
128
|
+
`,l=r.length>0&&r[t]===`
|
|
129
|
+
`,c=i?t-1:t,d=l?t+1:t;return{beforeCursorCode:Sr(e,0,c),afterCursorCode:Sr(e,d)}}if(typeof document<"u"){let e="data-temp-href-target";Uh.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&(t.hasAttribute("target")||t.setAttribute("target","_self"),t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")||""))}),Uh.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)||""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener noreferrer"))})}ag=function(e){let t={USE_PROFILES:{html:!0,svg:!0,mathMl:!0},ADD_TAGS:["use"],ADD_ATTR:["href","xlink:href"],FORCE_BODY:!0,CUSTOM_ELEMENT_HANDLING:{tagNameCheck:/^(marimo-[A-Za-z][\w-]*|iconify-icon)$/,attributeNameCheck:/^[A-Za-z][\w-]*$/},SAFE_FOR_XML:!e.includes("marimo-mermaid")};return Uh.sanitize(e,t)};var QI=["marimo-carousel","marimo-tabs","marimo-accordion","marimo-sidebar"],GI="h1, h2, h3, h4, h5, h6";function XI(e){if(typeof DOMParser>"u")return null;let t=[],r=new DOMParser().parseFromString(e,"text/html").querySelectorAll(GI);for(let i of Array.from(r)){let l=i.textContent;if(QI.some(h=>i.closest(h))||!l)continue;let c=Number.parseInt(i.tagName[1],10),d=i.innerHTML,f={name:l,level:c,by:H0(i)};d!==l&&(f.html=ag(d)),t.push(f)}return{items:t}}H0=function(e){let t=e.id;if(t)return{id:t};let r=e.textContent;return{path:`//${e.tagName}[contains(., "${r}")]`}};function YI(e){return{items:e.filter(Boolean).flatMap(t=>t.items)}}og=function(e){if(e==null||e.mimetype!=="text/html"&&e.mimetype!=="text/markdown"||e.data==null)return null;try{return dn(typeof e.data=="string","expected string"),XI(e.data)}catch{return be.error("Failed to parse outline"),null}},Xk=function(e){return e==null?!1:e.items.some(t=>t.level<=3)};function xb(e,t){let r=d=>d.items.length===0?7:Math.min(...d.items.map(f=>f.level)),i=t[e];if(i==null||i.items.length===0)return be.warn("Failed to find a starting outline"),null;let l=r(i),c=e+1;for(;c<t.length;){let d=t[c];if(d&&r(d)<=l)return[e,c-1];c++}return[e,t.length-1]}FC=ac("marimo:rtc:username","",Id),rg=dr(()=>xl("rtc_v2")),q0=function(e){return e!==io};var _b=(_i=class{constructor(){ae(this,"lines",[""]);ae(this,"cursor",{row:0,col:0})}ensureLine(t){for(;this.lines.length<=t;)this.lines.push("")}moveCursor(t,r){let i=this.cursor.row;this.cursor.row=Math.max(0,this.cursor.row+t),this.cursor.col=Math.max(0,this.cursor.col+r),this.ensureLine(this.cursor.row),t<0&&this.cursor.row<i&&this.lines.splice(this.cursor.row+1)}setCursor(t,r){this.cursor.row=Math.max(0,t),this.cursor.col=Math.max(0,r),this.ensureLine(this.cursor.row)}writeChar(t){this.ensureLine(this.cursor.row);let r=this.lines[this.cursor.row].padEnd(this.cursor.col," ");this.lines[this.cursor.row]=r.slice(0,this.cursor.col)+t+r.slice(this.cursor.col+1),this.cursor.col++}writeString(t){if(t.length===0)return;this.ensureLine(this.cursor.row);let r=this.lines[this.cursor.row].padEnd(this.cursor.col," ");this.lines[this.cursor.row]=r.slice(0,this.cursor.col)+t+r.slice(this.cursor.col+t.length),this.cursor.col+=t.length}control(t){switch(t){case`
|
|
130
|
+
`: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(t){let r=_i.ESCAPE_REGEX.exec(t);if(!r){this.writeString(t);return}let i=r[1].split(";").map(l=>l===""?1:Number.parseInt(l,10));switch(r[2]){case"A":this.moveCursor(-i[0],0);break;case"B":this.moveCursor(i[0],0);break;case"C":this.moveCursor(0,i[0]);break;case"D":this.moveCursor(0,-i[0]);break;case"H":this.setCursor(i[0]-1||0,i[1]-1||0);break;case"J":i[0]===2&&(this.lines=[""],this.setCursor(0,0));break;case"K":switch(this.ensureLine(this.cursor.row),i[0]){case 0:this.lines[this.cursor.row]=this.lines[this.cursor.row].slice(0,this.cursor.col);break;case 1:{let l=this.lines[this.cursor.row].length;this.lines[this.cursor.row]=" ".repeat(this.cursor.col)+this.lines[this.cursor.row].slice(this.cursor.col,l);break}case 2:this.lines[this.cursor.row]="";break}break;default:this.writeString(t);break}}render(){return this.lines.join(`
|
|
131
|
+
`)}},ae(_i,"ESCAPE_REGEX",/\u001B\[([0-9;]*)([A-DJKH])/u),_i),JI=class{constructor(){ae(this,"ESC_REGEX",/\u001B(?:\[[0-9;]*[A-Za-z]|\([0-9A-Za-z])/gu)}parse(e){let t=[],r=0;for(let i of e.matchAll(this.ESC_REGEX)){let l=i.index??0;l>r&&t.push({type:"text",value:e.slice(r,l)}),t.push({type:"escape",value:i[0]}),r=l+i[0].length}return r<e.length&&t.push({type:"text",value:e.slice(r)}),t}},kb=class{constructor(){ae(this,"parser",new JI);ae(this,"buffer",new _b)}reduce(e){return this.reset(),this.append(e),this.render()}append(e){let t=this.parser.parse(e);if(t.length===1&&t[0].type==="text"){let r=t[0].value;if(!this.hasControlChars(r)){this.buffer.writeString(r);return}}for(let r of t)r.type==="text"?this.processText(r.value):this.buffer.handleEscape(r.value)}reset(){this.buffer=new _b}render(){return this.buffer.render()}hasControlChars(e){for(let t of e)if(t<" ")return!0;return!1}processText(e){let t=0,r=e.length;for(let i=0;i<r;i++){let l=e[i];if(l===`
|
|
132
|
+
`||l==="\r"||l===" "||l==="\b"||l==="\v"){if(i>t){let c=e.slice(t,i),d=this.filterControlChars(c);d.length>0&&this.buffer.writeString(d)}this.buffer.control(l),t=i+1}else if(l<" "){if(i>t){let c=e.slice(t,i);c.length>0&&this.buffer.writeString(c)}t=i+1}}if(t<r){let i=e.slice(t),l=this.filterControlChars(i);l.length>0&&this.buffer.writeString(l)}}filterControlChars(e){let t=!1;for(let i of e)if(i<" "){t=!0;break}if(!t)return e;let r="";for(let i of e)i>=" "&&(r+=i);return r}},zc=class wg{constructor(t,r,i,l){ae(this,"ansiReducer",new kb);this.mimetype=t,this.channel=r,this.timestamp=i,this.ansiReducer=l,this._data=this.ansiReducer.render()}get data(){return this._data}static create(t){let r=new kb;return r.append(t.data),new wg(t.mimetype,t.channel,t.timestamp,r)}appendData(t){return this.ansiReducer.append(t),new wg(this.mimetype,this.channel,this.timestamp,this.ansiReducer)}toJSON(){return{mimetype:this.mimetype,channel:this.channel,timestamp:this.timestamp,data:this.data}}};function ZI(e,t=5e3){let r=[...e];if(r.length<2)return Sb(r.map(tA),t);let i=r[r.length-1],l=r[r.length-2];return eA(i,l)&&(Cb(i),Cb(l),r[r.length-2]=nA(l,i),r.pop()),Sb(r,t)}function eA(e,t){let r=e.mimetype==="text/plain"&&t.mimetype==="text/plain";if(!r)return!1;let i=e.channel===t.channel,l=e.channel!=="stdin";return r&&i&&l}function tA(e){return e instanceof zc?e:typeof e.data=="string"?zc.create(e):e}function nA(e,t){return e instanceof zc?e.appendData(t.data):zc.create(e).appendData(t.data)}function Cb(e){dn(typeof e.data=="string","expected string output")}function Sb(e,t){let r=0,i;for(i=e.length-1;i>=0&&r<t;i--){let f=e[i];f.mimetype==="text/plain"?(dn(typeof f.data=="string","expected string"),r+=f.data.split(`
|
|
133
|
+
`).length):r++}if(r<t)return e;let l=i+1,c={channel:"stderr",mimetype:"text/html",data:`<pre>Streaming output truncated to last ${t} lines.
|
|
134
|
+
</pre>`,timestamp:-1},d=e[l];if(d==null)return[c,...e.slice(l+1)];if(d.mimetype==="text/plain"){dn(typeof d.data=="string","expected string");let f=d.data.split(`
|
|
135
|
+
`),h=t-(r-f.length);return[c,{...d,data:f.slice(-h).join(`
|
|
136
|
+
`)},...e.slice(l+1)]}return[c,...e.slice(l+1)]}function rA(e,t){let r={...e};switch(t.status){case"queued":r.interrupted=!1,r.errored=!1,r.runElapsedTimeMs=null,r.debuggerActive=!1;break;case"running":r.interrupted=!1,e.stopped&&(r.output=null),r.status==="queued"&&(r.consoleOutputs=[]),r.stopped=!1,r.runStartTimestamp=t.timestamp,r.lastRunStartTimestamp=t.timestamp;break;case"idle":e.runStartTimestamp&&(r.runElapsedTimeMs=G0.fromSeconds((t.timestamp??0)-e.runStartTimestamp).toMilliseconds(),r.runStartTimestamp=null,r.staleInputs=!1),!e.lastRunStartTimestamp&&t.timestamp&&(r.lastRunStartTimestamp=t.timestamp),r.debuggerActive=!1;break;case null:break;case"disabled-transitively":break;case void 0:break;default:bl(t.status)}r.output=t.output??r.output,r.staleInputs=t.stale_inputs??r.staleInputs,r.status=t.status??r.status,t.serialization!==void 0&&(r.serialization=t.serialization);let i=!1;t.output!=null&&t.output.mimetype==="application/vnd.marimo+error"&&((r.status==="queued"||r.status==="running")&&(r.status="idle"),dn(Array.isArray(t.output.data),"Expected error output data to be an array"),t.output.data.some(f=>f.type==="interruption")?(r.interrupted=!0,i=!0):t.output.data.some(f=>f.type.includes("ancestor"))?r.stopped=!0:r.errored=!0);let l=e.consoleOutputs;(i||t.status==="idle")&&(r.debuggerActive=!1,l=l.map(f=>f.channel==="stdin"?{...f,response:f.response??""}:f));let c=t.console;c!=null&&(l=ZI(Array.isArray(c)?c:[...l,c])),r.consoleOutputs=l,r.outline=og(r.output);let d=[t.console].flat().filter(Boolean).filter(f=>f.channel==="pdb");return d.length>0&&d.some(f=>f.data==="start")&&(r.debuggerActive=!0),r}function aA(e){let t={...e};return e.status!=="disabled-transitively"&&(t.status="queued"),t.interrupted=!1,t.errored=!1,t.runElapsedTimeMs=null,t.debuggerActive=!1,t}ig=function(e){return e==="running"||e==="queued"},DC=function(e,t){let{status:r,output:i,runStartTimestamp:l,interrupted:c,staleInputs:d}=e;if(c)return!1;if(t)return!0;let f=ig(r),h=r==="running"&&i!==null&&l!==null&&(i.timestamp??0)>l;return f&&!h?!0:d};function bi(e,t){if(!e){be.warn("getCell: cellId is undefined");return}let r=t.cellData[e];if(!r){be.warn(`getCell: cell ${e} not found in state`);return}return r}function Eb(e,t){let r=t.cellIds.inOrderIds,i=r.indexOf(e);if(i>0)return{after:r[i-1]};if(i===0&&r.length>1)return{before:r[1]}}function Tb(e){let t=new Map,r=e.cellIds.getColumns();for(let[i,l]of r.entries())for(let c of l.inOrderIds)t.set(c,i);return t}function Eo(e,t){let r=new Set(e.cellIds.inOrderIds),i=[];for(let l of t.cellIds.inOrderIds)if(!r.has(l)){let c=bi(l,t);c&&i.push({type:"create-cell",cellId:c.id,code:c.code,name:c.name,config:c.config,...Eb(c.id,t)})}return i}function iA(e,t){let r=new Set(t.cellIds.inOrderIds),i=[];for(let l of e.cellIds.inOrderIds)r.has(l)||i.push({type:"delete-cell",cellId:l});return i}function Fc(e,t){let r=Tb(e),i=Tb(t),l=[];for(let[c,d]of i)if(r.get(c)!==d){let f=bi(c,t);l.push({type:"set-config",cellId:c,column:d,disabled:(f==null?void 0:f.config.disabled)??!1,hideCode:(f==null?void 0:f.config.hide_code)??!1})}return l.push({type:"reorder-cells",cellIds:t.cellIds.inOrderIds}),l}function oA(e,t,r){switch(r.type){case"createNewCell":return Eo(e,t);case"deleteCell":return[{type:"delete-cell",cellId:r.payload.cellId}];case"moveCell":case"sendToTop":case"sendToBottom":{let{cellId:i}=r.payload;return[{type:"move-cell",cellId:i,...Eb(i,t)}]}case"dropCellOverCell":case"dropCellOverColumn":case"moveCellToIndex":case"moveCellsRelativeTo":return Fc(e,t);case"updateCellCode":{let i=bi(r.payload.cellId,t);return i?[{type:"set-code",cellId:i.id,code:i.code}]:[]}case"updateCellName":{let i=bi(r.payload.cellId,t);return i?[{type:"set-name",cellId:i.id,name:i.name}]:[]}case"updateCellConfig":{let{cellId:i}=r.payload,l=bi(i,t);return l?[{type:"set-config",cellId:i,column:l.config.column??null,disabled:l.config.disabled??!1,hideCode:l.config.hide_code??!1}]:[]}case"dropOverNewColumn":case"moveColumn":case"addColumnBreakpoint":case"deleteColumn":case"mergeAllColumns":case"compactColumns":return Fc(e,t);case"addColumn":return[...Eo(e,t),...Fc(e,t)];case"undoDeleteCell":{let i=Eo(e,t),l=Fc(e,t);return i.length===0?l:l.length>1?[...i,...l]:i}case"splitCell":{let{cellId:i}=r.payload,l=bi(i,t);return l?[{type:"set-code",cellId:i,code:l.code},...Eo(e,t)]:[]}case"undoSplitCell":{let{cellId:i}=r.payload,l=bi(i,t);return l?[{type:"set-code",cellId:i,code:l.code},...iA(e,t)]:[]}case"moveToNextCell":return Eo(e,t);case"addSetupCellIfDoesntExist":return Eo(e,t);case"focusCell":case"focusTopCell":case"focusBottomCell":case"scrollToTarget":case"showCellIfHidden":case"markTouched":case"markUntouched":return[];case"prepareForRun":case"handleCellMessage":case"setCellIds":case"rebuildCellColumns":case"setCellCodes":case"setCells":case"setStdinResponse":case"clearSerializedEditorState":case"clearCellOutput":case"clearCellConsoleOutput":case"clearAllCellOutputs":case"clearLogs":case"addLogs":return[];case"foldAll":case"unfoldAll":case"collapseCell":case"expandCell":case"collapseAllCells":case"expandAllCells":return[];default:MD(r)}}function lA(e){let t=new Set,r=new Set;for(let i of e)i.type==="create-cell"?t.add(i.cellId):i.type==="delete-cell"&&r.add(i.cellId);return t.intersection(r)}function sA(e,t){var i,l,c;let r=[];for(let d of e)switch(d.type){case"create-cell":{let f="__end__",h=!1;d.after?(f=d.after,h=!1):d.before&&(f=d.before,h=!0),r.push({type:"createNewCell",payload:{cellId:f,before:h,code:d.code,newCellId:d.cellId,autoFocus:!1,hideCode:((i=d.config)==null?void 0:i.hide_code)??!1}}),d.name&&r.push({type:"updateCellName",payload:{cellId:d.cellId,name:d.name}}),(((l=d.config)==null?void 0:l.disabled)!=null||((c=d.config)==null?void 0:c.column)!=null)&&r.push({type:"updateCellConfig",payload:{cellId:d.cellId,config:{...d.config.disabled!=null&&{disabled:d.config.disabled},...d.config.column!=null&&{column:d.config.column}}}});break}case"delete-cell":r.push({type:"deleteCell",payload:{cellId:d.cellId}});break;case"move-cell":{let f=[...t()],h=d.cellId,b=f.indexOf(h);if(b<0)break;if(f.splice(b,1),d.after){let x=f.indexOf(d.after);x>=0?f.splice(x+1,0,h):f.push(h)}else if(d.before){let x=f.indexOf(d.before);x>=0?f.splice(x,0,h):f.unshift(h)}else f.push(h);r.push({type:"setCellIds",payload:{cellIds:f}});break}case"reorder-cells":r.push({type:"setCellIds",payload:{cellIds:d.cellIds}});break;case"set-code":r.push({type:"setCellCodes",payload:{ids:[d.cellId],codes:[d.code],codeIsStale:!0}});break;case"set-name":r.push({type:"updateCellName",payload:{cellId:d.cellId,name:d.name}});break;case"set-config":r.push({type:"updateCellConfig",payload:{cellId:d.cellId,config:{column:d.column,disabled:d.disabled,hide_code:d.hideCode}}});break}return r}var Ib=new Set(["set-code","set-name","set-config"]),cA=new Set(["set-code","set-name","set-config","move-cell"]);function uA(e){let t=new Set;for(let l of e)l.type==="delete-cell"&&t.add(l.cellId);let r=e.filter(l=>!(cA.has(l.type)&&"cellId"in l&&t.has(l.cellId))),i=new Map;return r.forEach((l,c)=>{Ib.has(l.type)&&"cellId"in l&&i.set(`${l.type}:${l.cellId}`,c)}),r.filter((l,c)=>Ib.has(l.type)&&"cellId"in l?i.get(`${l.type}:${l.cellId}`)===c:!0)}var Cp=[],dA=Mh(()=>{let e=uA(Cp);Cp=[],e.length!==0&&Kn().sendDocumentTransaction({changes:e})},400);function fA(e){return"cellId"in e&&e.cellId==="__scratch__"}function pA(e){Te.get(A8)||fA(e)||(Cp.push(e),dA())}function mA(e,t,r){for(let i of oA(e,t,r))pA(i)}Vk=function(e,t,r){var f;let i=lA(e),l=[...e.filter(h=>h.type!=="set-config"),...e.filter(h=>h.type==="set-config")],c=!1,d=null;for(let h of l)if(!(i.size>0&&"cellId"in h&&i.has(h.cellId))){h.type==="set-config"&&(c=!0),h.type==="create-cell"&&((f=h.config)==null?void 0:f.column)!=null&&(c=!0),h.type==="reorder-cells"&&(d=h.cellIds);for(let b of sA([h],r))t[b.type](b.payload)}c&&t.rebuildCellColumns({cellIds:d??r()})};function hA(e,t){return XD(e*1e3,t==null?void 0:t.in)}var Sp=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},ht;(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"})(ht||(ht={})),X0=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(r=>{r.forEach(i=>{this.palette_256.push(i)})});let e=[0,95,135,175,215,255];for(let r=0;r<6;++r)for(let i=0;i<6;++i)for(let l=0;l<6;++l){let c={rgb:[e[r],e[i],e[l]],class_name:"truecolor"};this.palette_256.push(c)}let t=8;for(let r=0;r<24;++r,t+=10){let i={rgb:[t,t,t],class_name:"truecolor"};this.palette_256.push(i)}}escape_txt_for_html(e){return this._escape_html?e.replace(/[&<>"']/gm,t=>{if(t==="&")return"&";if(t==="<")return"<";if(t===">")return">";if(t==='"')return""";if(t==="'")return"'"}):e}append_buffer(e){this._buffer+=e}get_next_packet(){var e={kind:ht.EOS,text:"",url:""},t=this._buffer.length;if(t==0)return e;var r=this._buffer.indexOf("\x1B");if(r==-1)return e.kind=ht.Text,e.text=this._buffer,this._buffer="",e;if(r>0)return e.kind=ht.Text,e.text=this._buffer.slice(0,r),this._buffer=this._buffer.slice(r),e;if(r==0){if(t<3)return e.kind=ht.Incomplete,e;var i=this._buffer.charAt(1);if(i!="["&&i!="]"&&i!="(")return e.kind=ht.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;if(i=="["){this._csi_regex||(this._csi_regex=Ab(yA||(yA=Sp([`
|
|
137
|
+
^ # beginning of line
|
|
138
|
+
#
|
|
139
|
+
# First attempt
|
|
140
|
+
(?: # legal sequence
|
|
141
|
+
\x1B[ # CSI
|
|
142
|
+
([<-?]?) # private-mode char
|
|
143
|
+
([d;]*) # any digits or semicolons
|
|
144
|
+
([ -/]? # an intermediate modifier
|
|
145
|
+
[@-~]) # the command
|
|
146
|
+
)
|
|
147
|
+
| # alternate (second attempt)
|
|
148
|
+
(?: # illegal sequence
|
|
149
|
+
\x1B[ # CSI
|
|
150
|
+
[ -~]* # anything legal
|
|
151
|
+
([\0-:]) # anything illegal
|
|
152
|
+
)
|
|
153
|
+
`],[`
|
|
154
|
+
^ # beginning of line
|
|
155
|
+
#
|
|
156
|
+
# First attempt
|
|
157
|
+
(?: # legal sequence
|
|
158
|
+
\\x1b\\[ # CSI
|
|
159
|
+
([\\x3c-\\x3f]?) # private-mode char
|
|
160
|
+
([\\d;]*) # any digits or semicolons
|
|
161
|
+
([\\x20-\\x2f]? # an intermediate modifier
|
|
162
|
+
[\\x40-\\x7e]) # the command
|
|
163
|
+
)
|
|
164
|
+
| # alternate (second attempt)
|
|
165
|
+
(?: # illegal sequence
|
|
166
|
+
\\x1b\\[ # CSI
|
|
167
|
+
[\\x20-\\x7e]* # anything legal
|
|
168
|
+
([\\x00-\\x1f:]) # anything illegal
|
|
169
|
+
)
|
|
170
|
+
`]))));let c=this._buffer.match(this._csi_regex);if(c===null)return e.kind=ht.Incomplete,e;if(c[4])return e.kind=ht.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;c[1]!=""||c[3]!="m"?e.kind=ht.Unknown:e.kind=ht.SGR,e.text=c[2];var l=c[0].length;return this._buffer=this._buffer.slice(l),e}else if(i=="]"){if(t<4)return e.kind=ht.Incomplete,e;if(this._buffer.charAt(2)!="8"||this._buffer.charAt(3)!=";")return e.kind=ht.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;this._osc_st||(this._osc_st=gA(vA||(vA=Sp([`
|
|
171
|
+
(?: # legal sequence
|
|
172
|
+
(\x1B) # ESC | # alternate
|
|
173
|
+
(\x07) # BEL (what xterm did)
|
|
174
|
+
)
|
|
175
|
+
| # alternate (second attempt)
|
|
176
|
+
( # illegal sequence
|
|
177
|
+
[\0-] # anything illegal
|
|
178
|
+
| # alternate
|
|
179
|
+
[\b-] # anything illegal
|
|
180
|
+
| # alternate
|
|
181
|
+
[-] # anything illegal
|
|
182
|
+
)
|
|
183
|
+
`],[`
|
|
184
|
+
(?: # legal sequence
|
|
185
|
+
(\\x1b\\\\) # ESC \\
|
|
186
|
+
| # alternate
|
|
187
|
+
(\\x07) # BEL (what xterm did)
|
|
188
|
+
)
|
|
189
|
+
| # alternate (second attempt)
|
|
190
|
+
( # illegal sequence
|
|
191
|
+
[\\x00-\\x06] # anything illegal
|
|
192
|
+
| # alternate
|
|
193
|
+
[\\x08-\\x1a] # anything illegal
|
|
194
|
+
| # alternate
|
|
195
|
+
[\\x1c-\\x1f] # anything illegal
|
|
196
|
+
)
|
|
197
|
+
`])))),this._osc_st.lastIndex=0;{let f=this._osc_st.exec(this._buffer);if(f===null)return e.kind=ht.Incomplete,e;if(f[3])return e.kind=ht.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e}{let f=this._osc_st.exec(this._buffer);if(f===null)return e.kind=ht.Incomplete,e;if(f[3])return e.kind=ht.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e}this._osc_regex||(this._osc_regex=Ab(bA||(bA=Sp([`
|
|
198
|
+
^ # beginning of line
|
|
199
|
+
#
|
|
200
|
+
\x1B]8; # OSC Hyperlink
|
|
201
|
+
[ -:<-~]* # params (excluding ;)
|
|
202
|
+
; # end of params
|
|
203
|
+
([!-~]{0,512}) # URL capture
|
|
204
|
+
(?: # ST
|
|
205
|
+
(?:\x1B) # ESC | # alternate
|
|
206
|
+
(?:\x07) # BEL (what xterm did)
|
|
207
|
+
)
|
|
208
|
+
([ -~]+) # TEXT capture
|
|
209
|
+
\x1B]8;; # OSC Hyperlink End
|
|
210
|
+
(?: # ST
|
|
211
|
+
(?:\x1B) # ESC | # alternate
|
|
212
|
+
(?:\x07) # BEL (what xterm did)
|
|
213
|
+
)
|
|
214
|
+
`],[`
|
|
215
|
+
^ # beginning of line
|
|
216
|
+
#
|
|
217
|
+
\\x1b\\]8; # OSC Hyperlink
|
|
218
|
+
[\\x20-\\x3a\\x3c-\\x7e]* # params (excluding ;)
|
|
219
|
+
; # end of params
|
|
220
|
+
([\\x21-\\x7e]{0,512}) # URL capture
|
|
221
|
+
(?: # ST
|
|
222
|
+
(?:\\x1b\\\\) # ESC \\
|
|
223
|
+
| # alternate
|
|
224
|
+
(?:\\x07) # BEL (what xterm did)
|
|
225
|
+
)
|
|
226
|
+
([\\x20-\\x7e]+) # TEXT capture
|
|
227
|
+
\\x1b\\]8;; # OSC Hyperlink End
|
|
228
|
+
(?: # ST
|
|
229
|
+
(?:\\x1b\\\\) # ESC \\
|
|
230
|
+
| # alternate
|
|
231
|
+
(?:\\x07) # BEL (what xterm did)
|
|
232
|
+
)
|
|
233
|
+
`]))));let c=this._buffer.match(this._osc_regex);if(c===null)return e.kind=ht.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;e.kind=ht.OSCURL,e.url=c[1],e.text=c[2];var l=c[0].length;return this._buffer=this._buffer.slice(l),e}else if(i=="(")return e.kind=ht.Unknown,this._buffer=this._buffer.slice(3),e}}ansi_to_html(e){this.append_buffer(e);for(var t=[];;){var r=this.get_next_packet();if(r.kind==ht.EOS||r.kind==ht.Incomplete)break;r.kind==ht.ESC||r.kind==ht.Unknown||(r.kind==ht.Text?t.push(this.transform_to_html(this.with_state(r))):r.kind==ht.SGR?this.process_ansi(r):r.kind==ht.OSCURL&&t.push(this.process_hyperlink(r)))}return t.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 t=e.text.split(";");for(;t.length>0;){let r=t.shift(),i=parseInt(r,10);if(isNaN(i)||i===0)this.fg=null,this.bg=null,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1;else if(i===1)this.bold=!0;else if(i===2)this.faint=!0;else if(i===3)this.italic=!0;else if(i===4)this.underline=!0;else if(i===21)this.bold=!1;else if(i===22)this.faint=!1,this.bold=!1;else if(i===23)this.italic=!1;else if(i===24)this.underline=!1;else if(i===39)this.fg=null;else if(i===49)this.bg=null;else if(i>=30&&i<38)this.fg=this.ansi_colors[0][i-30];else if(i>=40&&i<48)this.bg=this.ansi_colors[0][i-40];else if(i>=90&&i<98)this.fg=this.ansi_colors[1][i-90];else if(i>=100&&i<108)this.bg=this.ansi_colors[1][i-100];else if((i===38||i===48)&&t.length>0){let l=i===38,c=t.shift();if(c==="5"&&t.length>0){let d=parseInt(t.shift(),10);d>=0&&d<=255&&(l?this.fg=this.palette_256[d]:this.bg=this.palette_256[d])}if(c==="2"&&t.length>2){let d=parseInt(t.shift(),10),f=parseInt(t.shift(),10),h=parseInt(t.shift(),10);if(d>=0&&d<=255&&f>=0&&f<=255&&h>=0&&h<=255){let b={rgb:[d,f,h],class_name:"truecolor"};l?this.fg=b:this.bg=b}}}}}transform_to_html(e){let t=e.text;if(t.length===0||(t=this.escape_txt_for_html(t),!e.bold&&!e.italic&&!e.faint&&!e.underline&&e.fg===null&&e.bg===null))return t;let r=[],i=[],l=e.fg,c=e.bg;e.bold&&r.push(this._boldStyle),e.faint&&r.push(this._faintStyle),e.italic&&r.push(this._italicStyle),e.underline&&r.push(this._underlineStyle),this._use_classes?(l&&(l.class_name==="truecolor"?r.push(`color:rgb(${l.rgb.join(",")})`):i.push(`${l.class_name}-fg`)),c&&(c.class_name==="truecolor"?r.push(`background-color:rgb(${c.rgb.join(",")})`):i.push(`${c.class_name}-bg`))):(l&&r.push(`color:rgb(${l.rgb.join(",")})`),c&&r.push(`background-color:rgb(${c.rgb})`));let d="",f="";return i.length&&(d=` class="${i.join(" ")}"`),r.length&&(f=` style="${r.join(";")}"`),`<span${f}${d}>${t}</span>`}process_hyperlink(e){let t=e.url.split(":");return t.length<1||!this._url_allowlist[t[0]]?"":`<a href="${this.escape_txt_for_html(e.url)}">${this.escape_txt_for_html(e.text)}</a>`}};function Ab(e,...t){let r=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(r)}function gA(e,...t){let r=e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,"");return new RegExp(r,"g")}var yA,vA,bA,wA=new X0;Gd=function(e){try{let t=document.createElement("div");return t.innerHTML=e,(t.textContent||t.innerText||"").split(`
|
|
234
|
+
`).map(r=>r.trimEnd()).join(`
|
|
235
|
+
`)}catch(t){return be.error("Error parsing HTML content:",t),e}},hC=function(e){if(!e)return"";try{return Gd(wA.ansi_to_html(e))}catch(t){return be.error("Error converting ANSI to plain text:",t),e}},fg=Ie(null);let wi;wi=Wn(),hk=ES,B0=xe.forwardRef((e,t)=>{let r=(0,wi.c)(9),i,l;r[0]===e?(i=r[1],l=r[2]):({className:i,...l}=e,r[0]=e,r[1]=i,r[2]=l);let c;r[3]===i?c=r[4]:(c=Fr("fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:w-fit md:max-w-[420px]","print:hidden",i),r[3]=i,r[4]=c);let d;return r[5]!==l||r[6]!==t||r[7]!==c?(d=(0,O.jsx)(Ug,{ref:t,className:c,...l}),r[5]=l,r[6]=t,r[7]=c,r[8]=d):d=r[8],d}),B0.displayName=Ug.displayName;var Lb={default:"bg-background border",danger:"group destructive text-error border-destructive bg-(--red-1) shadow-md-solid shadow-error"},xA=O8("data-[swipe=move]:transition-none group relative pointer-events-auto flex w-full items-start justify-between gap-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=move]:translate-x-(--radix-toast-swipe-move-x) data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-(--radix-toast-swipe-end-x) data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full data-[state=closed]:slide-out-to-right-full",{variants:{variant:Lb},defaultVariants:{variant:"default"}});function _A(e){return typeof e=="string"&&e in Lb}M0=xe.forwardRef((e,t)=>{let r=(0,wi.c)(11),i,l,c;r[0]===e?(i=r[1],l=r[2],c=r[3]):({className:i,variant:c,...l}=e,r[0]=e,r[1]=i,r[2]=l,r[3]=c);let d=_A(c)?c:"default",f;r[4]!==i||r[5]!==d?(f=Fr(xA({variant:d}),"print:hidden",i),r[4]=i,r[5]=d,r[6]=f):f=r[6];let h;return r[7]!==l||r[8]!==t||r[9]!==f?(h=(0,O.jsx)(Kg,{ref:t,className:f,...l}),r[7]=l,r[8]=t,r[9]=f,r[10]=h):h=r[10],h}),M0.displayName=Kg.displayName;var Db=xe.forwardRef((e,t)=>{let r=(0,wi.c)(9),i,l;r[0]===e?(i=r[1],l=r[2]):({className:i,...l}=e,r[0]=e,r[1]=i,r[2]=l);let c;r[3]===i?c=r[4]:(c=Fr("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-destructive/30 hover:group-[.destructive]:border-destructive/30 hover:group-[.destructive]:bg-destructive hover:group-[.destructive]:text-destructive-foreground focus:group-[.destructive]:ring-destructive",i),r[3]=i,r[4]=c);let d;return r[5]!==l||r[6]!==t||r[7]!==c?(d=(0,O.jsx)(Xg,{ref:t,className:c,...l}),r[5]=l,r[6]=t,r[7]=c,r[8]=d):d=r[8],d});Db.displayName=Xg.displayName,O0=xe.forwardRef((e,t)=>{let r=(0,wi.c)(10),i,l;r[0]===e?(i=r[1],l=r[2]):({className:i,...l}=e,r[0]=e,r[1]=i,r[2]=l);let c;r[3]===i?c=r[4]:(c=Fr("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-hidden focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 hover:group-[.destructive]:text-red-500 focus:group-[.destructive]:ring-red-400 focus:group-[.destructive]:ring-offset-red-600",i),r[3]=i,r[4]=c);let d;r[5]===Symbol.for("react.memo_cache_sentinel")?(d=(0,O.jsx)(GD,{className:"h-4 w-4"}),r[5]=d):d=r[5];let f;return r[6]!==l||r[7]!==t||r[8]!==c?(f=(0,O.jsx)(Yg,{ref:t,className:c,"toast-close":"",...l,children:d}),r[6]=l,r[7]=t,r[8]=c,r[9]=f):f=r[9],f}),O0.displayName=Yg.displayName,Kh=xe.forwardRef((e,t)=>{let r=(0,wi.c)(9),i,l;r[0]===e?(i=r[1],l=r[2]):({className:i,...l}=e,r[0]=e,r[1]=i,r[2]=l);let c;r[3]===i?c=r[4]:(c=Fr("text-sm font-semibold",i),r[3]=i,r[4]=c);let d;return r[5]!==l||r[6]!==t||r[7]!==c?(d=(0,O.jsx)(Qg,{ref:t,className:c,...l}),r[5]=l,r[6]=t,r[7]=c,r[8]=d):d=r[8],d}),Kh.displayName=Qg.displayName,R0=xe.forwardRef((e,t)=>{let r=(0,wi.c)(13),i,l,c;r[0]===e?(i=r[1],l=r[2],c=r[3]):({className:i,onPointerDown:l,...c}=e,r[0]=e,r[1]=i,r[2]=l,r[3]=c);let d;r[4]===i?d=r[5]:(d=Fr("max-h-48 overflow-auto text-sm opacity-90 whitespace-pre-wrap wrap-break-word select-text cursor-text",i),r[4]=i,r[5]=d);let f;r[6]===l?f=r[7]:(f=b=>{b.stopPropagation(),l==null||l(b)},r[6]=l,r[7]=f);let h;return r[8]!==c||r[9]!==t||r[10]!==d||r[11]!==f?(h=(0,O.jsx)(Gg,{ref:t,className:d,onPointerDown:f,...c}),r[8]=c,r[9]=t,r[10]=d,r[11]=f,r[12]=h):h=r[12],h}),R0.displayName=Gg.displayName,m0=function(e){return e.type==="cell"?e.cellId:`lsp:${e.name}`};var Ob=!1;function kA(e){var i;let t=[],r=[e.console].filter(Boolean).flat();for(let l of r){let c=l.mimetype==="text/plain",d=l.mimetype==="text/html"||l.mimetype==="application/vnd.marimo+traceback";if(c||d){let f=l.channel==="stderr"||l.channel==="marimo-error";switch(l.channel){case"stdout":case"stderr":case"marimo-error":{let h=RD.asString(l.data),b=d?Gd(h):h;t.push({timestamp:l.timestamp||Date.now(),level:f?"stderr":"stdout",message:b,source:{type:"cell",cellId:e.cell_id}});break}default:break}}}if(t.forEach(Mb.log),r.length===0&&ec((i=e.output)==null?void 0:i.mimetype)&&Array.isArray(e.output.data)){e.output.data.forEach(d=>{Mb.log({level:"stderr",source:{type:"cell",cellId:e.cell_id},timestamp:e.timestamp??0,message:JSON.stringify(d)})});let l=e.output.data.filter(d=>"type"in d&&d.type==="exception"||d.type==="internal"),c=Te.get(T8)==="read";if(l.length>0&&!Ob&&c){Ob=!0;let d=l.find(f=>f.traceback);Ws(d?{title:"An internal error occurred",description:d.msg||"Click 'View' to see traceback",variant:"danger",action:xe.createElement(Db,{altText:"View traceback",onClick:()=>{Te.set(fg,{traceback:d.traceback,errorMessage:d.msg||"An internal error occurred"})}},"View")}:{title:"An internal error occurred",description:"See console for details.",variant:"danger"})}}return t}var Mb={log:e=>{let t=e.level==="stdout"?"gray":e.level==="stderr"?"red":"orange",r=e.level.toUpperCase();console.log(`%c[${r}]`,`color:${t}; padding:2px 0; border-radius:2px; font-weight:bold`,`[${lg(e.timestamp)}]`,`(${m0(e.source)}) ${e.message}`)}};lg=function(e){try{return hA(e).toLocaleTimeString(void 0,{hour12:!0,hour:"numeric",minute:"numeric",second:"numeric"})}catch{return""}},Tk=function(e,t){let r=jd(t);r?r.focus():be.warn(`[CellFocusManager] focusCellEditor: element not found: ${t}`)},Ck=function(e){let t=document.getElementById(Dn.create(e));t?Ep(t):be.warn(`[CellFocusManager] focusCell: element not found: ${e}`)},ok=function(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})},o0=function(){return document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains("marimo-cell")};function Ep(e){try{e.focus()}catch{be.warn("[CellFocusManager] element may not be focusable",e)}}c0=function(e,t){let{retries:r,delay:i,initialDelay:l=0}=t,c=0,d=()=>{if(c<r){try{if(e())return}catch(f){be.error(`Error executing function on attempt ${c+1}, retrying`,{error:f})}c++,setTimeout(d,i)}};l>0?setTimeout(d,l):d()};function CA(){let e=globalThis.scheduler;if(typeof(e==null?void 0:e.postTask)=="function")return t=>{e.postTask(t,{priority:"user-visible"}).catch(r=>{setTimeout(()=>{throw r})})};if(typeof MessageChannel=="function"){let t=[],r=new MessageChannel;return r.port1.onmessage=()=>{var i;(i=t.shift())==null||i()},i=>{t.push(i),r.port2.postMessage(null)}}return t=>{setTimeout(t,0)}}const SA=CA();function EA(e=SA){let t=new Map,r=new Set,i=!1;function l(){i||t.size===0||(i=!0,e(d))}function c(){for(let f of r){if(t.has(f))return f;r.delete(f)}return t.keys().next().value}function d(){i=!1;try{let f=c();if(f!==void 0){let h=t.get(f);t.delete(f),r.delete(f),h==null||h()}}finally{l()}}return{request(f,h){t.set(f,h),l()},promote(f){let h=t.get(f);h&&(t.delete(f),r.delete(f),h())},prioritize(f){t.has(f)&&r.add(f)},deprioritize(f){r.delete(f)},cancel(f){t.delete(f),r.delete(f)}}}T0=EA();function Hl({cellId:e,cell:t,isCodeHidden:r,codeFocus:i,variableName:l}){var d;if(!t)return;let c=document.getElementById(Dn.create(e));if(!c){be.warn("scrollCellIntoView: element not found");return}if(o0()){Ep(c);return}if(r)Ep(c);else{T0.promote(e);let f=(d=t.current)==null?void 0:d.editorView;if(!f){be.warn("scrollCellIntoView: editor not found",e);return}if(f.hasFocus||!document.hasFocus())return;if(c0(()=>(f.focus(),f.hasFocus),{retries:5,delay:20}),i==="top")f.dispatch({selection:{anchor:0,head:0}});else if(i==="bottom"){let h=f.state.doc.line(f.state.doc.lines);f.dispatch({selection:{anchor:h.from,head:h.from}})}else l&&ic(f,l)}c.scrollIntoView({behavior:"smooth",block:"nearest"})}YC=function(e){let t=document.getElementById(Dn.create(e));if(!t){be.warn("scrollCellIntoView: element not found");return}t.classList.add("focus-outline"),setTimeout(()=>{t.classList.remove("focus-outline")},2e3),t.scrollIntoView({behavior:"smooth",block:"center"})};function TA(){let e=document.getElementById("App");e==null||e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}function IA(){var e;(e=document.getElementById("App"))==null||e.scrollTo({top:0,behavior:"smooth"})}W_=function(e){let t=jd(e);if(t!=null&&t.hasFocus){I1(t,{behavior:"instant"});return}let r=document.getElementById(Dn.create(e));r?r.scrollIntoView({behavior:"instant",block:"nearest"}):be.warn(`[CellFocusManager] scrollCellIntoView: element not found: ${e}`)},fr=function({id:e,name:t="_",code:r="",lastCodeRun:i=null,lastExecutionTime:l=null,edited:c=!1,config:d,serializedEditorState:f=null}){return{id:e,config:d||{hide_code:!1,disabled:!1,column:null},name:t,code:r,edited:c,lastCodeRun:i,lastExecutionTime:l,serializedEditorState:f}};function Rb(e){return{hide_code:!1,disabled:!1,column:null,...e}}Xn=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 qc=Wn();function Pb(e){let t={column:0,hide_code:!1,disabled:!1};return{...e,cellData:{[io]:fr({id:io,config:t}),...e.cellData},cellRuntime:{[io]:Xn(),...e.cellRuntime},cellHandles:{[io]:(0,xe.createRef)(),...e.cellHandles}}}function AA(){return Pb({cellIds:El.from([]),cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set})}let Nb,jb,zb,Fb;({reducer:Nb,addMiddleware:jb,createActions:zb,useActions:Fb,valueAtom:Je}=vl(AA,{createNewCell:(e,t)=>{var j;let{cellId:r,before:i,code:l,name:c,config:d,lastCodeRun:f=null,lastExecutionTime:h=null,autoFocus:b=!0,skipIfCodeExists:x=!1,hideCode:C=void 0}=t,S,E;if(x){for(let q of e.cellIds.inOrderIds)if(((j=e.cellData[q])==null?void 0:j.code)===l)return e}if(r==="__end__"){let q=e.cellIds.atOrThrow(0);S=q.id,E=q.length}else if(typeof r=="string"){let q=e.cellIds.findWithId(r);S=q.id,E=q.topLevelIds.indexOf(r)}else if(r.type==="__end__"){let q=e.cellIds.get(r.columnId)||e.cellIds.atOrThrow(0);S=q.id,E=q.length}else throw Error("Invalid cellId");let A=t.newCellId||si.create(),R=i?E:E+1;return{...e,cellIds:e.cellIds.insertId(A,S,R),cellData:{...e.cellData,[A]:fr({id:A,code:l,name:c,lastCodeRun:f,config:Rb({...d,...C!=null&&{hide_code:C}}),lastExecutionTime:h,edited:!!l&&l!==f})},cellRuntime:{...e.cellRuntime,[A]:Xn()},cellHandles:{...e.cellHandles,[A]:(0,xe.createRef)()},scrollKey:b?A:null,untouchedNewCells:C&&b?new Set([...e.untouchedNewCells,A]):e.untouchedNewCells}},moveCell:(e,t)=>{let{cellId:r,before:i,direction:l}=t;if(i!==void 0&&l!==void 0&&be.warn("Both before and direction specified for moveCell. Ignoring one."),l){let f=e.cellIds.findWithId(r),h=e.cellIds.indexOf(f),b=l==="left"?h-1:h+1,x=e.cellIds.at(b);return x?{...e,cellIds:e.cellIds.moveAcrossColumns(f.id,r,x.id,void 0),scrollKey:r}:e}let c=e.cellIds.findWithId(r),d=c.indexOfOrThrow(r);return i&&d===0?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,0),scrollKey:r}:!i&&d===c.length-1?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,c.length-1),scrollKey:r}:i?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,d-1),scrollKey:r}:{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,d+1),scrollKey:r}},moveCellToIndex:(e,t)=>{let{cellId:r,columnId:i,index:l}=t,c=e.cellIds.findWithId(r),d=c.indexOfOrThrow(r),f=e.cellIds.get(i);if(!f)return e;let h=Math.max(0,Math.min(l,f.length)),b=c.id===i&&d<h?h-1:h;if(c.id===i&&d===b)return e;let x=e.cellIds.deleteById(r),C=x.get(i);return C?{...e,cellIds:x.insertId(r,i,Math.max(0,Math.min(b,C.length))),scrollKey:null}:e},dropCellOverCell:(e,t)=>{let{cellId:r,overCellId:i}=t,l=e.cellIds.findWithId(r),c=e.cellIds.findWithId(i),d=l.indexOfOrThrow(r),f=c.indexOfOrThrow(i);return l.id===c.id?d===f?e:{...e,cellIds:e.cellIds.moveWithinColumn(l.id,d,f),scrollKey:null}:{...e,cellIds:e.cellIds.moveAcrossColumns(l.id,r,c.id,i),scrollKey:null}},moveCellsRelativeTo:(e,t)=>{let{cellIds:r,targetCellId:i,position:l,previousPlacements:c}=t;if(r.length===0)return e;let d=e.cellIds.moveCellsRelativeTo(r,i,l),f=c&&c.length===r.length?[...e.history,{type:"move",cellIds:r,placements:c}]:e.history;return{...e,cellIds:d,history:f,scrollKey:null}},dropCellOverColumn:(e,t)=>{let{cellId:r,columnId:i}=t,l=e.cellIds.findWithId(r);return{...e,cellIds:e.cellIds.moveAcrossColumns(l.id,r,i,void 0)}},dropOverNewColumn:(e,t)=>{let{cellId:r}=t;return{...e,cellIds:e.cellIds.moveToNewColumn(r)}},moveColumn:(e,t)=>t.column===t.overColumn?e:{...e,cellIds:e.cellIds.moveColumn(t.column,t.overColumn)},focusCell:(e,t)=>{let r=e.cellIds.findWithId(t.cellId);if(r.length===0)return e;let{cellId:i,where:l}=t,c=r.indexOfOrThrow(i),d;d=l==="before"?$h(c-1,0,r.length-1):l==="after"?$h(c+1,0,r.length-1):c;let f=r.atOrThrow(d);return Hl({cellId:f,cell:e.cellHandles[f],isCodeHidden:Wl(e,f),codeFocus:l==="after"?"top":"bottom",variableName:void 0}),e},focusTopCell:e=>{let t=e.cellIds.getColumns().at(0);if(t===void 0||t.length===0)return e;let r=t.first();return Hl({cellId:r,cell:e.cellHandles[r],isCodeHidden:Wl(e,r),codeFocus:void 0,variableName:void 0}),IA(),e},focusBottomCell:e=>{let t=e.cellIds.getColumns().at(-1);if(t===void 0||t.length===0)return e;let r=t.last();return Hl({cellId:r,cell:e.cellHandles[r],isCodeHidden:Wl(e,r),codeFocus:void 0,variableName:void 0}),TA(),e},sendToTop:(e,t)=>{let r=e.cellIds.findWithId(t.cellId);if(r.length===0)return e;let{cellId:i,scroll:l=!0}=t,c=r.indexOfOrThrow(i);return c===0?e:{...e,cellIds:e.cellIds.moveWithinColumn(r.id,c,0),scrollKey:l?i:null}},sendToBottom:(e,t)=>{let r=e.cellIds.findWithId(t.cellId);if(r.length===0)return e;let{cellId:i,scroll:l=!0}=t,c=r.indexOfOrThrow(i),d=r.length-1;return c===d?e:{...e,cellIds:e.cellIds.moveWithinColumn(r.id,c,d),scrollKey:l?i:null}},addColumn:(e,t)=>{let r=si.create();return{...e,cellIds:e.cellIds.addColumn(t.columnId,[r]),cellData:{...e.cellData,[r]:fr({id:r})},cellRuntime:{...e.cellRuntime,[r]:Xn()},cellHandles:{...e.cellHandles,[r]:(0,xe.createRef)()},scrollKey:r}},addColumnBreakpoint:(e,t)=>{let{cellId:r}=t;return e.cellIds.getColumns()[0].inOrderIds[0]===r?e:{...e,cellIds:e.cellIds.insertBreakpoint(r)}},deleteColumn:(e,t)=>{let{columnId:r}=t;return{...e,cellIds:e.cellIds.delete(r)}},mergeAllColumns:e=>({...e,cellIds:e.cellIds.mergeAllColumns()}),compactColumns:e=>({...e,cellIds:e.cellIds.compact()}),deleteCell:(e,t)=>{var b,x;let r=t.cellId;if(e.cellIds.hasOnlyOneId())return e;let i;try{i=e.cellIds.findWithId(r)}catch(C){return be.warn("Skipping delete for missing cellId",{cellId:r,error:C}),e}let l=i.indexOfOrThrow(r),c=l===0?1:l-1,d=null;i.length>1&&(d=i.atOrThrow(c));let f=(x=(b=e.cellHandles[r].current)==null?void 0:b.editorView)==null?void 0:x.state.toJSON({history:dD});f&&(f.doc=e.cellData[r].code),OA(r);let h=e.cellData[r];return{...e,cellIds:e.cellIds.deleteById(r),history:[...e.history,{type:"delete",name:h.name,serializedEditorState:f,column:i.id,index:l,isSetupCell:r===Yn,config:h.config}],scrollKey:d}},undoDeleteCell:e=>{if(e.history.length===0)return e;let t=e.history[e.history.length-1];if(t.type==="move"){let{cellIds:x,placements:C}=t;if(x.length===0||C.length!==x.length||x.some(E=>!e.cellData[E]))return{...e,history:e.history.slice(0,-1)};let S=x.map((E,A)=>({id:E,columnId:C[A].columnId,index:C[A].index}));return{...e,cellIds:e.cellIds.placeCells(S),history:e.history.slice(0,-1),scrollKey:x[0]??null}}let{name:r,serializedEditorState:i={doc:""},column:l,index:c,isSetupCell:d,config:f}=t,h=d?Yn:si.create(),b=fr({id:h,name:r,code:i.doc,edited:i.doc.trim().length>0,serializedEditorState:i,config:f});return{...e,cellIds:e.cellIds.insertId(h,l,c),cellData:{...e.cellData,[h]:b},cellRuntime:{...e.cellRuntime,[h]:Xn()},cellHandles:{...e.cellHandles,[h]:(0,xe.createRef)()},history:e.history.slice(0,-1),scrollKey:h}},clearSerializedEditorState:(e,t)=>{let{cellId:r}=t;return To({state:e,cellId:r,cellReducer:i=>({...i,serializedEditorState:null})})},updateCellCode:(e,t)=>{let{cellId:r,code:i,formattingChange:l}=t;return e.cellData[r]?To({state:e,cellId:r,cellReducer:c=>l?{...c,code:i,lastCodeRun:c.edited?c.lastCodeRun:i}:{...c,code:i,edited:i.trim()!==c.lastCodeRun}}):e},updateCellName:(e,t)=>{let{cellId:r,name:i}=t;return To({state:e,cellId:r,cellReducer:l=>({...l,name:i})})},updateCellConfig:(e,t)=>{let{cellId:r,config:i}=t;return To({state:e,cellId:r,cellReducer:l=>({...l,config:Rb({...l.config,...i})})})},prepareForRun:(e,t)=>To({state:Ul({state:e,cellId:t.cellId,cellReducer:r=>aA(r)}),cellId:t.cellId,cellReducer:r=>({...r,edited:!1,lastCodeRun:r.code.trim()})}),handleCellMessage:(e,t)=>{let r=t.cell_id,i=Ul({state:e,cellId:r,cellReducer:l=>rA(l,t)});return t.status==="queued"&&(i=To({state:i,cellId:r,cellReducer:l=>({...l,lastCodeRun:l.code.trim(),edited:!1})})),{...i,cellLogs:[...i.cellLogs,...kA(t)]}},addLogs:(e,t)=>({...e,cellLogs:[...e.cellLogs,...t.logs]}),setCellIds:(e,t)=>{if(v8(e.cellIds.inOrderIds,t.cellIds))return e;let r={...e.cellData},i={...e.cellRuntime},l={...e.cellHandles};for(let c of t.cellIds)c in e.cellData||(r[c]=fr({id:c})),c in e.cellRuntime||(i[c]=Xn()),c in e.cellHandles||(l[c]=(0,xe.createRef)());return{...e,cellIds:El.fromWithPreviousShape(t.cellIds,e.cellIds),cellData:r,cellRuntime:i,cellHandles:l}},rebuildCellColumns:(e,t)=>{let r=El.fromIdsAndColumns(t.cellIds.map(i=>{var l;return[i,((l=e.cellData[i])==null?void 0:l.config.column)??null]}));return{...e,cellIds:r}},setCellCodes:(e,t)=>{var l,c;dn(t.codes.length===t.ids.length,"Expected codes and ids to have the same length");let r={...e},i=({cell:d,code:f,cellId:h,name:b,config:x})=>{if(!d)return fr({id:h,code:f,name:b,config:x,lastCodeRun:t.codeIsStale?null:f,edited:t.codeIsStale&&f.trim().length>0});let C=t.codeIsStale?d.lastCodeRun:f,S=C?C.trim()!==f.trim():!!f;if(d.code.trim()===f.trim())return{...d,code:f,edited:S,lastCodeRun:C,...b!==void 0&&{name:b},...x!==void 0&&{config:x}};if(!rg()||!q0(h)){let E=r.cellHandles[h].current;E!=null&&E.editorViewOrNull&&oo(E.editorViewOrNull,f)}return{...d,code:f,edited:S,lastCodeRun:C,...b!==void 0&&{name:b},...x!==void 0&&{config:x}}};for(let d=0;d<t.ids.length;d++){let f=t.ids[d],h=t.codes[d];if(f===void 0||h===void 0)continue;let b=(l=t.names)==null?void 0:l[d],x=(c=t.configs)==null?void 0:c[d];r={...r,cellData:{...r.cellData,[f]:i({cell:r.cellData[f],code:h,cellId:f,name:b,config:x})}}}return r},setStdinResponse:(e,t)=>{let{cellId:r,response:i,outputIndex:l}=t;return Ul({state:e,cellId:r,cellReducer:c=>{let d=[...c.consoleOutputs],f=d[l];return f==null||f.channel!=="stdin"?(be.warn("Expected stdin output"),c):(d[l]={channel:"stdin",mimetype:f.mimetype,data:f.data,timestamp:f.timestamp,response:i},{...c,interrupted:!1,consoleOutputs:d})}})},setCells:(e,t)=>{let r=Object.fromEntries(t.map(d=>[d.id,d])),i=dd(),l=d=>{if(!i)return Xn();let f=e.cellRuntime[d];return f&&(f.output!=null||f.consoleOutputs.length>0)?f:Xn()},c=Object.fromEntries(t.map(d=>[d.id,l(d.id)]));return Pb({...e,cellIds:El.fromIdsAndColumns(t.map(d=>[d.id,d.config.column])),cellData:r,cellRuntime:c,cellHandles:Object.fromEntries(t.map(d=>[d.id,(0,xe.createRef)()]))})},moveToNextCell:(e,t)=>{let{cellId:r,before:i,noCreate:l=!1}=t;if(r==="__scratch__")return e;let c=e.cellIds.findWithId(r),d=c.indexOfOrThrow(r),f=i?d-1:d+1,h=f===c.length,b=f===-1;if(h&&!l){let x=si.create();return{...e,cellIds:e.cellIds.insertId(x,c.id,f),cellData:{...e.cellData,[x]:fr({id:x})},cellRuntime:{...e.cellRuntime,[x]:Xn()},cellHandles:{...e.cellHandles,[x]:(0,xe.createRef)()},scrollKey:x}}if(b&&!l){let x=si.create();return{...e,cellIds:e.cellIds.insertId(x,c.id,0),cellData:{...e.cellData,[x]:fr({id:x})},cellRuntime:{...e.cellRuntime,[x]:Xn()},cellHandles:{...e.cellHandles,[x]:(0,xe.createRef)()},scrollKey:x}}if((h||b)&&l)return e;if(f>=0&&f<c.length){let x=c.atOrThrow(f);Hl({cellId:x,cell:e.cellHandles[x],isCodeHidden:Wl(e,x),codeFocus:i?"bottom":"top",variableName:void 0})}return e},markTouched:(e,t)=>{let{cellId:r}=t;if(e.untouchedNewCells.has(r)){let i=new Set(e.untouchedNewCells);return i.delete(r),{...e,untouchedNewCells:i}}return e},markUntouched:(e,t)=>{let{cellId:r}=t;if(!e.untouchedNewCells.has(r)){let i=new Set(e.untouchedNewCells);return i.add(r),{...e,untouchedNewCells:i}}return e},scrollToTarget:e=>{let t=e.scrollKey;if(t===null)return e;let r=e.cellIds.findWithId(t),i=r.indexOfOrThrow(t),l=i===r.length-1?r.last():r.atOrThrow(i);return Hl({cellId:l,cell:e.cellHandles[l],isCodeHidden:Wl(e,l),codeFocus:void 0,variableName:void 0}),{...e,scrollKey:null}},foldAll:e=>(VS(Object.values(e.cellHandles).map(t=>{var r;return(r=t.current)==null?void 0:r.editorView})),e),unfoldAll:e=>(BS(Object.values(e.cellHandles).map(t=>{var r;return(r=t.current)==null?void 0:r.editorView})),e),clearLogs:e=>({...e,cellLogs:[]}),collapseCell:(e,t)=>{let{cellId:r}=t,i=e.cellIds.findWithId(r),l=i.topLevelIds.map(f=>e.cellRuntime[f].outline),c=xb(i.indexOfOrThrow(r),l);if(!c)return e;let d=i.atOrThrow(c[1]);return{...e,cellIds:e.cellIds.transformWithCellId(r,f=>f.collapse(r,d)),scrollKey:r}},expandCell:(e,t)=>{let{cellId:r}=t;return{...e,cellIds:e.cellIds.transformWithCellId(r,i=>i.expand(r)),scrollKey:r}},collapseAllCells:e=>({...e,cellIds:e.cellIds.transformAll(t=>{let r=t.topLevelIds.map(h=>e.cellRuntime[h].outline),i=[...t.nodes],l=[],c=[],d=i.length-1;for(;d>=0;){let h=xb(d,r);if(h){let b=d,x=h[1],C=l.find(A=>A.start<=x&&A.end===x);C&&(x=C.start),l.push({start:b,end:x});let S=t.atOrThrow(b),E=t.atOrThrow(x);c.push({id:S,until:E})}else c.push(null);d--}let f=c.toReversed();return t.collapseAll(f)})}),expandAllCells:e=>({...e,cellIds:e.cellIds.transformAll(t=>t.expandAll())}),showCellIfHidden:(e,t)=>{let{cellId:r}=t,i=e.cellIds.findWithId(r),l=i,c=i.findAndExpandDeep(r);return c.equals(l)?e:{...e,cellIds:e.cellIds.transformWithCellId(r,()=>c)}},splitCell:(e,t)=>{var x;let{cellId:r}=t,i=e.cellIds.findWithId(r),l=i.indexOfOrThrow(r),c=e.cellData[r],d=e.cellHandles[r].current;if((d==null?void 0:d.editorView)==null)return e;let{beforeCursorCode:f,afterCursorCode:h}=KI(d.editorView);oo(d.editorView,f);let b=si.create();return{...e,cellIds:e.cellIds.insertId(b,i.id,l+1),cellData:{...e.cellData,[r]:{...c,code:f,edited:!!f&&f.trim()!==((x=c.lastCodeRun)==null?void 0:x.trim())},[b]:fr({id:b,code:h,edited:!!h})},cellRuntime:{...e.cellRuntime,[r]:{...e.cellRuntime[r],output:null,consoleOutputs:[]},[b]:Xn()},cellHandles:{...e.cellHandles,[b]:(0,xe.createRef)()},scrollKey:b}},undoSplitCell:(e,t)=>{var d;let{cellId:r,snapshot:i}=t,l=e.cellData[r],c=e.cellHandles[r].current;return(c==null?void 0:c.editorView)==null?e:(oo(c.editorView,i),{...e,cellIds:e.cellIds.transformWithCellId(r,f=>{let h=f.indexOfOrThrow(r)+1;return f.deleteAtIndex(h)}),cellData:{...e.cellData,[r]:{...l,code:i,edited:!!i&&(i==null?void 0:i.trim())!==((d=l.lastCodeRun)==null?void 0:d.trim())}},cellRuntime:{...e.cellRuntime,[r]:{...e.cellRuntime[r],output:null,consoleOutputs:[]}},cellHandles:{...e.cellHandles}})},clearCellOutput:(e,t)=>{let{cellId:r}=t;return Ul({state:e,cellId:r,cellReducer:i=>({...i,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(e,t)=>{let{cellId:r}=t;return Ul({state:e,cellId:r,cellReducer:i=>({...i,consoleOutputs:i.consoleOutputs.filter(l=>l.channel==="stdin"&&l.response==null)})})},clearAllCellOutputs:e=>{let t={...e.cellRuntime};for(let r of e.cellIds.inOrderIds)t[r]={...t[r],output:null,consoleOutputs:[]};return{...e,cellRuntime:t}},addSetupCellIfDoesntExist:(e,t)=>{let{code:r}=t;return e.cellIds.setupCellExists()?{...e,scrollKey:Yn}:{...e,cellIds:e.cellIds.insertId(Yn,e.cellIds.atOrThrow(0).id,0),cellData:{...e.cellData,[Yn]:fr({id:Yn,name:Yn,code:r,edited:!!r})},cellRuntime:{...e.cellRuntime,[Yn]:Xn()},cellHandles:{...e.cellHandles,[Yn]:(0,xe.createRef)()},scrollKey:Yn}}})),jb(mA);function Wl(e,t){return!!e.cellData[t].config.hide_code&&!e.untouchedNewCells.has(t)}function Ul({state:e,cellId:t,cellReducer:r}){return t in e.cellRuntime?{...e,cellRuntime:{...e.cellRuntime,[t]:r(e.cellRuntime[t])}}:(be.warn(`Cell ${t} not found in state`),e)}function To({state:e,cellId:t,cellReducer:r}){return t in e.cellData?{...e,cellData:{...e.cellData,[t]:r(e.cellData[t])}}:(be.warn(`Cell ${t} not found in state`),e)}NC=function(e){let t=e.cellData,r={column:null};return e.cellIds.getColumns().length>1?e.cellIds.getColumns().flatMap((i,l)=>i.inOrderIds.map((c,d)=>{let f={...r};return d===0&&(f.column=l),{...t[c].config,...f}})):e.cellIds.getColumns().flatMap(i=>i.inOrderIds.map(l=>({...t[l].config,...r})))};let qb;qb=zb(e=>{Te.set(Je,t=>Nb(t,e))}).addLogs,rc=Ie(e=>e(Je).cellIds),Pk=Ie(e=>e(rc).hasOnlyOneId()),tC=Ie(e=>gg(e(Je)).length>0),Ie(e=>z0(e(Je)).length>0);let Tp,$b;OC=Ie(e=>q3(e(Je))),xk=Ie(e=>$3(e(Je))),qC=Ie(e=>F3(e(Je))),Tp=Ie(e=>{let{cellIds:t,cellRuntime:r,cellData:i}=e(Je);return t.inOrderIds.map(l=>{var f;let c=r[l],{name:d}=i[l];if(ec((f=c.output)==null?void 0:f.mimetype)){dn(Array.isArray(c.output.data),"Expected array data");let h=c.output.data.filter(b=>!b.type.includes("ancestor"));if(h.length>0)return{output:{...c.output,data:h},cellId:l,cellName:d}}return null}).filter(Boolean)}),QC=Ie(e=>{let{cellIds:t,cellRuntime:r}=e(Je);return YI(t.inOrderIds.map(i=>r[i].outline))}),EC=Ie(e=>e(Tp).length),$b=y8(Ie(e=>{let{cellIds:t,cellData:r}=e(Je);return zr.fromEntries(t.inOrderIds.map(i=>{var l;return[i,(l=r[i])==null?void 0:l.name]}))}));var LA=Ie(e=>e(Je).scrollKey);ek=()=>un(Je),iC=()=>un(rc),uk=()=>un($b),lC=()=>un(Tp),sk=()=>un(Je).cellLogs,rk=()=>un(LA),Wd=()=>Te.get(Je),xC=()=>Te.get(Je).cellIds,Jk=()=>{let{cellIds:e,cellData:t}=Te.get(Je);return e.inOrderIds.map(r=>{var i;return(i=t[r])==null?void 0:i.name}).filter(Boolean)};var DA=PS(LS(Je,e=>e.cellIds.inOrderIds.map(t=>e.cellData[t])));dk=()=>i_(DA),Fk=Ie(e=>e(Je).cellRuntime),Bk=Ie(e=>j3(e(Je))),WC=Ie(e=>{let{cellRuntime:t}=e(Je);return Object.entries(t).every(([r,i])=>i.status!=="running"||r==="__scratch__")}),bk=Ie(e=>z3(e(Je))),Q_=Ie(e=>e(Je).cellIds.colLength),aC=Ie(e=>e(Je).cellIds.idLength>0),gC=Ie(e=>e(Je).cellIds.getColumnIds()),Ud=df(e=>Ie(t=>t(Je).cellData[e]));var Ip=df(e=>Ie(t=>t(Je).cellRuntime[e]));const Vb=df(e=>Ie(t=>t(Je).cellHandles[e]));function OA(e){Ud.remove(e),Ip.remove(e),Vb.remove(e)}G_=e=>{let t=(0,qc.c)(2),r;return t[0]===e?r=t[1]:(r=Ud(e),t[0]=e,t[1]=r),un(r)},mk=e=>{let t=(0,qc.c)(2),r;return t[0]===e?r=t[1]:(r=Ip(e),t[0]=e,t[1]=r),un(r)},B_=e=>{let t=(0,qc.c)(2),r;return t[0]===e?r=t[1]:(r=Vb(e),t[0]=e,t[1]=r),un(r)},tg=()=>{let{cellIds:e,cellHandles:t}=Te.get(Je);return e.inOrderIds.map(r=>{var i,l;return(l=(i=t[r])==null?void 0:i.current)==null?void 0:l.editorViewOrNull}).filter(Boolean)},jd=e=>{var r;let{cellHandles:t}=Te.get(Je);return(r=t[e].current)==null?void 0:r.editorView},Uk=function(e){let{cellIds:t,cellData:r,cellRuntime:i}=e;return t.getColumns().flatMap(l=>l.topLevelIds.map(c=>({...r[c],...i[c]})))},IC=function(e){return Ie(t=>t(Je).untouchedNewCells.has(e))};function MA(e){let t=Ip(e);return Ie(r=>{let i=r(t);if(!i||i.status==="queued"||i.status==="running")return;let l=[],c=i.consoleOutputs;if(c&&c.length>0){let f=c.find(h=>h.mimetype==="application/vnd.marimo+traceback");if(f){let h=f.data;l.push(...Jh(h))}}let d=i.output;if((d==null?void 0:d.mimetype)==="application/vnd.marimo+error"){let f=d.data;if(Array.isArray(f))for(let h of f)h.type==="syntax"&&h.lineno!=null&&l.push({kind:"cell",cellId:e,lineNumber:h.lineno}),h.type==="import-star"&&h.lineno!=null&&l.push({kind:"cell",cellId:e,lineNumber:h.lineno})}return l.length>0?l:void 0})}Y_=function(e){let t=(0,qc.c)(2),r;return t[0]===e?r=t[1]:(r=e===void 0?{}:e,t[0]=e,t[1]=r),Fb(r)}})();export{Kh as $,Us as $i,xl as $n,bd as $r,Qh as $t,B_ as A,Gh as Ai,Xh as An,Yh as Ar,H_ as At,W_ as B,Jh as Bi,U_ as Bn,Zh as Br,K_ as Bt,Q_ as C,e0 as Ci,Ks as Cn,Qs as Cr,t0 as Ct,G_ as D,n0 as Di,X_ as Dn,r0 as Dr,wd as Dt,Y_ as E,J_ as Ei,xd as En,to as Er,Z_ as Et,ek as F,a0 as Fi,_d as Fn,i0 as Fr,kd as Ft,o0 as G,tk as Gi,l0 as Gn,s0 as Gr,nk as Gt,c0 as H,u0 as Hi,Gs as Hn,d0 as Hr,f0 as Ht,rk as I,Xs as Ii,p0 as In,Cd as Ir,ak as It,m0 as J,Sd as Ji,ik as Jn,Ed as Jr,Td as Jt,ok as K,h0 as Ki,Id as Kn,g0 as Kr,ma as Kt,fr as L,Ys as Li,Js as Ln,_l as Lr,lk as Lt,sk as M,ck as Mi,yn as Mn,y0 as Mr,v0 as Mt,uk as N,no as Ni,we as Nn,ro as Nr,Zs as Nt,dk as O,ec as Oi,fk as On,b0 as Or,pk as Ot,mk as P,Ad as Pi,kl as Pn,Ld as Pr,Gn as Pt,hk as Q,Cl as Qi,Dd as Qn,gk as Qr,w0 as Qt,Xn as R,Sl as Ri,yk as Rn,x0 as Rr,vk as Rt,bk as S,_0 as Si,ha as Sn,wk as Sr,Od as St,xk as T,_k as Ti,kk as Tn,k0 as Tr,C0 as Tt,Ck as U,oi as Ui,Sk as Un,S0 as Ur,E0 as Ut,T0 as V,I0 as Vi,Ek as Vn,A0 as Vr,L0 as Vt,Tk as W,El as Wi,Ik as Wn,D0 as Wr,Ak as Wt,O0 as X,Lk as Xi,Dk as Xn,Ok as Xr,Md as Xt,M0 as Y,Tl as Yi,li as Yn,ao as Yr,$r as Yt,R0 as Z,Mk as Zi,tc as Zn,Rk as Zr,Rd as Zt,Pk as _,aO as __tla,P0 as _a,Nk as _i,jk as _n,nc as _r,zk as _t,Fk as a,qk as aa,N0 as ai,j0 as an,$k as ar,Vk as at,Bk as b,z0 as bi,F0 as bn,Hk as br,Wk as bt,Uk as c,si as ca,Pd as ci,Kk as cn,Nd as cr,q0 as ct,jd as d,io as da,Qk as di,zd as dn,Gk as dr,Xk as dt,vn as ea,Yk as ei,$0 as en,V0 as er,B0 as et,Jk as f,Yn as fa,Zk as fi,eC as fn,Fd as fr,H0 as ft,tC as g,nC as ga,ga as gi,W0 as gn,rC as gr,oo as gt,aC as h,U0 as ha,st as hi,K0 as hn,lo as hr,Sr as ht,rc as i,qd as ia,Q0 as ii,G0 as in,$d as ir,X0 as it,iC as j,Vd as ji,oC as jn,Y0 as jr,J0 as jt,lC as k,Z0 as ki,Bd as kn,eg as kr,sC as kt,tg as l,cC as la,uC as li,ng as ln,Hd as lr,rg as lt,Wd as m,dC as ma,so as mi,fC as mn,Er as mr,ag as mt,Ud as n,ac as na,pC as ni,Kd as nn,mC as nr,hC as nt,gC as o,yC as oa,vC as oi,bC as on,wC as or,ig as ot,xC as p,Qd as pa,ya as pi,ic as pn,co as pr,og as pt,lg as q,_C as qi,kC as qn,CC as qr,SC as qt,EC as r,sg as ra,cg as ri,TC as rn,ug as rr,Gd as rt,IC as s,dg as sa,oc as si,AC as sn,LC as sr,DC as st,OC as t,MC as ta,RC as ti,PC as tn,ci as tr,fg as tt,NC as u,Dn as ua,jC as ui,zC as un,lc as ur,FC as ut,qC as v,$C as va,VC as vi,BC as vn,pg as vr,HC as vt,WC as w,UC as wi,KC as wn,mg as wr,hg as wt,QC as x,GC as xi,XC as xn,Xd as xr,Yd as xt,Je as y,Jd as ya,gg as yi,yg as yn,ui as yr,Jn as yt,YC as z,JC as zi,vg as zn,bg as zr,ZC as zt};
|