@marimo-team/frontend 0.17.5 → 0.17.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/assets/{CellStatus-DjUtGUqj.js → CellStatus-CHA41gSk.js} +1 -1
  2. package/dist/assets/{ConnectedDataExplorerComponent-Bjfp6wiJ.js → ConnectedDataExplorerComponent-cTGPcGbT.js} +1 -1
  3. package/dist/assets/{ConsoleOutput-C4nRvbNL.js → ConsoleOutput-CcWTsPJI.js} +1 -1
  4. package/dist/assets/{LazyAnyLanguageCodeMirror-BzY5E2SR.js → LazyAnyLanguageCodeMirror-De4wCXx1.js} +2 -2
  5. package/dist/assets/{MarimoErrorOutput-DKtP9DfP.js → MarimoErrorOutput-ZIgqDBQe.js} +1 -1
  6. package/dist/assets/{Output-x6LACtkd.js → Output-BNpy6qAs.js} +1 -1
  7. package/dist/assets/{RenderHTML-B4Xlxz9Q.js → RenderHTML-BBVeCFEd.js} +1 -1
  8. package/dist/assets/{TinyCode-CgC7YtPL.js → TinyCode-CSwZ6pBr.js} +1 -1
  9. package/dist/assets/{add-cell-with-ai-D94Om7DS.js → add-cell-with-ai-DF_F9Sqz.js} +1 -1
  10. package/dist/assets/{add-database-form-BDX2uZCC.js → add-database-form-C6bWFcDu.js} +1 -1
  11. package/dist/assets/{add-missing-import-Cy6g_y6i.js → add-missing-import-pmcK06GU.js} +1 -1
  12. package/dist/assets/{agent-panel-DPCsTGPU.js → agent-panel-Cy7eGnp2.js} +1 -1
  13. package/dist/assets/{any-language-editor-CgFodhrt.js → any-language-editor-CtKaNSoA.js} +1 -1
  14. package/dist/assets/{app-config-button-C02qSaV5.js → app-config-button-DkPbZ9Gv.js} +1 -1
  15. package/dist/assets/{cell-actions-CNcpitg7.js → cell-actions-BwzVQ6Dx.js} +1 -1
  16. package/dist/assets/{cell-editor-oXchtd-2.js → cell-editor-HcAVCF81.js} +4 -4
  17. package/dist/assets/{cell-link-d9BMXpwm.js → cell-link-Bp_0p3CR.js} +1 -1
  18. package/dist/assets/cells-DV6dfoCq.js +142 -0
  19. package/dist/assets/{chat-components-u_00E1Iv.js → chat-components-laNRM4nR.js} +2 -2
  20. package/dist/assets/{chat-panel-BBQVqm6k.js → chat-panel-D0ofjONu.js} +1 -1
  21. package/dist/assets/{client-Co0Fvwib.js → client-CHkG9bdV.js} +2 -2
  22. package/dist/assets/{column-preview-BsCKvnq_.js → column-preview-BavQbx6K.js} +1 -1
  23. package/dist/assets/{command-palette-C9_cNlJc.js → command-palette-BeIRV-WM.js} +1 -1
  24. package/dist/assets/{common-BWlM0NQw.js → common-C3tRfmeF.js} +1 -1
  25. package/dist/assets/{datasources-panel-CRS3I41j.js → datasources-panel-MHkoQPff.js} +1 -1
  26. package/dist/assets/{dependency-graph-panel-PEDmfewV.js → dependency-graph-panel-qI_Vzr7L.js} +1 -1
  27. package/dist/assets/dist-Dv7WCK3M.js +2 -0
  28. package/dist/assets/{documentation-panel-Caz5K_OT.js → documentation-panel-BSLe420O.js} +1 -1
  29. package/dist/assets/{edit-page-DuRQ1eIB.js → edit-page-BWiHWYlZ.js} +3 -3
  30. package/dist/assets/{error-panel-D0ZJmprT.js → error-panel-BXZjD7vi.js} +1 -1
  31. package/dist/assets/{esm-D8ZMWeYP.js → esm-C1NahKuy.js} +1 -1
  32. package/dist/assets/{file-explorer-panel-Jnmw434H.js → file-explorer-panel-Dfhel-3W.js} +1 -1
  33. package/dist/assets/{floating-outline-BXSB3SQ6.js → floating-outline-CgxonLQ-.js} +1 -1
  34. package/dist/assets/{focus-CUS3ckCE.js → focus--Piy3rX5.js} +1 -1
  35. package/dist/assets/{form-nAUuUhu3.js → form-Cdn744fY.js} +1 -1
  36. package/dist/assets/{form-BlnK1x-p.js → form-q5HZfP0M.js} +1 -1
  37. package/dist/assets/{glide-data-editor-BFKn2tIP.js → glide-data-editor-DyfmOgFY.js} +1 -1
  38. package/dist/assets/{home-page-DIYkvTFf.js → home-page-CQvcO2-r.js} +1 -1
  39. package/dist/assets/{index-DsdBxblV.js → index-vG-gdKWq.js} +7 -7
  40. package/dist/assets/{kiosk-mode-CHVximkk.js → kiosk-mode-OsMWvXhW.js} +1 -1
  41. package/dist/assets/{layout-CRXL9551.js → layout-BaosNuEp.js} +1 -1
  42. package/dist/assets/{logs-panel-9HAqKVuS.js → logs-panel-DzPVobVI.js} +1 -1
  43. package/dist/assets/{mermaid-D4G-AG2G.js → mermaid-DEUZM6JF.js} +1 -1
  44. package/dist/assets/{mode-CtH3Xe58.js → mode-BK9SOQXS.js} +1 -1
  45. package/dist/assets/{name-cell-input-DZWpmHYT.js → name-cell-input-VEOAxqMs.js} +1 -1
  46. package/dist/assets/{outline-panel-D0DvfWbQ.js → outline-panel-h_xN2aCi.js} +1 -1
  47. package/dist/assets/{packages-panel-DmqfeORQ.js → packages-panel-MgK5SK20.js} +1 -1
  48. package/dist/assets/{readonly-python-code-Ba_IF_mK.js → readonly-python-code-ChK3PfU6.js} +1 -1
  49. package/dist/assets/{run-page-Dtlg4eqe.js → run-page-BGTVY0j4.js} +1 -1
  50. package/dist/assets/{scratchpad-panel-5EljtEkX.js → scratchpad-panel-DZbJOjct.js} +1 -1
  51. package/dist/assets/{snippets-panel-Cg9ksbKX.js → snippets-panel-BkDWOzb7.js} +1 -1
  52. package/dist/assets/{state-7Nd5UYc6.js → state-BHcVA2dC.js} +1 -1
  53. package/dist/assets/{state-BDyZ5-wH.js → state-CjZ41ddG.js} +1 -1
  54. package/dist/assets/{storage-DczTxxXy.js → storage-Q85CaPfH.js} +1 -1
  55. package/dist/assets/{tracing-CbAnhOdo.js → tracing-DZ3Q4ew0.js} +1 -1
  56. package/dist/assets/{tracing-panel-B3iny2EN.js → tracing-panel-cWcQ0_7O.js} +2 -2
  57. package/dist/assets/{types-h5wz3HYN.js → types--mPsPGF4.js} +1 -1
  58. package/dist/assets/{useAddCell-CWXmrhes.js → useAddCell-Ig4Te4YX.js} +1 -1
  59. package/dist/assets/{useCellActionButton-fVEGFa_R.js → useCellActionButton-Dxhr7c1D.js} +1 -1
  60. package/dist/assets/{useDeleteCell-Bg8Hgk6e.js → useDeleteCell-Ba4wqcnv.js} +1 -1
  61. package/dist/assets/{useNotebookActions-BurReKKo.js → useNotebookActions-ClgDTwuq.js} +1 -1
  62. package/dist/assets/{useRunCells-BiWuvMY1.js → useRunCells-WnlQjiPG.js} +1 -1
  63. package/dist/assets/{useSplitCell-DhhZ7xVP.js → useSplitCell-BDVxP5U-.js} +1 -1
  64. package/dist/assets/useTheme-CJkb1R7C.js +1 -0
  65. package/dist/assets/{utilities.esm-CCw2KKJk.js → utilities.esm-SfrtJjbv.js} +1 -1
  66. package/dist/assets/{variable-panel-Dkhq2h3W.js → variable-panel-1cBDHa5H.js} +1 -1
  67. package/dist/assets/{vega-component-CrZQsWq8.js → vega-component-DBpZ-MEj.js} +1 -1
  68. package/dist/index.html +27 -27
  69. package/package.json +1 -1
  70. package/src/components/app-config/data-form.tsx +3 -3
  71. package/src/core/codemirror/language/languages/sql/sql.ts +2 -1
  72. package/dist/assets/cells-CZmitpcp.js +0 -151
  73. package/dist/assets/dist-CzgFQFBf.js +0 -2
  74. package/dist/assets/node-sql-parser-B60nzzE3.js +0 -68
  75. package/dist/assets/useTheme-DcMAIbRt.js +0 -1
  76. /package/dist/assets/{esm-DuHka6En.js → esm-D3_a5hg-.js} +0 -0
  77. /package/dist/assets/{react-plotly-B5BZoChE.js → react-plotly-BedjJ4JE.js} +0 -0
  78. /package/dist/assets/{wasm-BU5edgJp.js → wasm-86TLpKv7.js} +0 -0
  79. /package/dist/assets/{web-vitals-DxEe-Gv6.js → web-vitals-DCCm3RCd.js} +0 -0
@@ -0,0 +1,142 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./esm-D3_a5hg-.js","./chunk-DZLz74EQ.js","./dist-DMBglXSO.js","./dist-DdXBxU_X.js","./dist-o3-gJN-A.js","./dist-dCpey1ug.js","./dist-CX9H6beB.js","./dist-bbz7Slba.js","./dist-DRRy7eBA.js","./dist-w3K5vvwl.js","./dist-Dgtvd9Kj.js","./dist-Duhp104c.js","./dist-ZWk4ZnCp.js","./dist-BOJjflZo.js","./dist-DXPWGCwf.js","./dist-BXRlb45H.js","./dist-CH5tSYom.js","./dist-yqUyuquW.js","./dist-CovgAoiO.js","./dist-Zii08NWl.js","./dist-BwNTJR-i.js","./dist-C27NmZjJ.js","./dist-Bkj6k_mR.js","./dist-DWvYBldG.js","./dist-Dwaup14P.js","./dist-ws1ADWL0.js","./dist-Bk5eZGhd.js","./dist-B309G_89.js","./dist-ueNDs5ZQ.js","./dist-BGbJQ9FV.js","./dist-InfVPyNM.js","./dist-5c-fdIcP.js","./dist-C0iIc35G.js","./dist-COzB_eCZ.js","./dist-D4zTBP8M.js","./dist-Z76N9TEr.js","./dist-BQrFKgQW.js","./dist-C3eCrV3K.js","./dist-B6J6eS8w.js","./dist-3nYEuz31.js","./apl-Ctz9K_CH.js","./apl-DOdxvsp7.js","./asciiarmor-B77uBk9M.js","./asciiarmor-iHsvYBsh.js","./asn1-C-iZGcpJ.js","./asn1-CjQdFpKC.js","./brainfuck-rSNzkqqO.js","./brainfuck-DtaPUQOb.js","./cobol-APDh3yqj.js","./cobol-B1NZRKFh.js","./clike-og00ojjO.js","./clike-CEj-3lIu.js","./clojure-CHy9PEib.js","./clojure-BoRNIjWi.js","./css-CUUUuuWv.js","./css-BOMeM4Jz.js","./cmake-k8VrEC8g.js","./cmake-BDPy65SJ.js","./coffeescript-B8KyBzJB.js","./coffeescript-C6u-3CUG.js","./commonlisp-08FCq9wE.js","./commonlisp-PnS0RzOo.js","./cypher-BTsj2L-h.js","./cypher-BNcNWKra.js","./python-boYXLLLW.js","./python-ChTwa-ru.js","./crystal-BgcbUMfj.js","./crystal-CmwgoX1x.js","./d-C25lQrYu.js","./d-BMO4C4Kr.js","./diff-DNrpXl2n.js","./diff-pLFk18zx.js","./dockerfile-BUeS7lwD.js","./simple-mode-CXCwEnyS.js","./dtd-Bf8uxNQM.js","./dtd-Cufzm3tN.js","./dylan-CLekIZ5m.js","./dylan-CohSy5uK.js","./ecl-Cuq-zYMt.js","./ecl-BhEt80nJ.js","./eiffel-Cherdoll.js","./eiffel-CKJVLfM7.js","./elm-Bgc2VrN3.js","./elm-ClkLCCoU.js","./erlang-DV-yOPHh.js","./erlang-D2TH4-Et.js","./factor-_pwpFL9V.js","./factor-6NmCZvh-.js","./forth-DPYzVsxk.js","./forth-DV7ZwZS0.js","./fortran-CHscrmjC.js","./fortran-C9_PuY2l.js","./mllike-CQVXuuVe.js","./mllike-ZkoLEmrh.js","./gas-DmfcW0jn.js","./gas-CGuyKmgF.js","./gherkin-nO90d6_0.js","./gherkin-BwmPTL6e.js","./groovy-BaG_xigU.js","./groovy-DJxiqoVo.js","./haskell-zquS0pmy.js","./haskell-DOcPZqkO.js","./haxe-jVHltQz8.js","./haxe-BVSsVSdX.js","./idl-Faqcof-8.js","./idl-D5drHePd.js","./javascript-DaU2Qx8h.js","./javascript-rI4fd75W.js","./jinja2-vOOqe5qU.js","./jinja2-BrZGqXAx.js","./julia-D_XPf6PQ.js","./julia-z0xq3uqV.js","./livescript-BcySDqVp.js","./livescript-BbVvVfSY.js","./lua-C2g4vKPW.js","./lua-CtEmKXsU.js","./mirc-m5tZSAj-.js","./mirc-Cyycx3am.js","./mathematica-CGC4E4mf.js","./mathematica-B-SjlQIm.js","./modelica-Df0Pzd3q.js","./modelica-DIZcE54y.js","./mumps-DIzXo46K.js","./mumps-Cnu1tNUa.js","./mbox-COMy3rAR.js","./mbox-BdnWvTJv.js","./nsis-BwaU6U7W.js","./nsis-CUebodQn.js","./ntriples-Di_qQuNU.js","./ntriples-2rre165b.js","./octave-d2UG6bxb.js","./octave-C7u5CeUZ.js","./oz-XuOfGqvG.js","./oz-D5aE2uST.js","./pascal-C_8pV97M.js","./pascal-DTApZM3o.js","./perl-D0yyvTB8.js","./perl-Ckgh9LJK.js","./pig-DdChm7J-.js","./pig-jAl9a1Kh.js","./powershell-BahaFAkM.js","./powershell-C_IKzlOl.js","./properties-B0UjS1mb.js","./properties-BdVxDpDJ.js","./protobuf-CIEUsgCC.js","./protobuf-DLu_SUI6.js","./pug-Y1U6OG_G.js","./pug-fgP-dIQ4.js","./puppet-CfWRrQAj.js","./puppet-CShRizHW.js","./q-BTop3Sb0.js","./q-D2OTJZH4.js","./r-Du4KfitP.js","./r-DRqIAgj1.js","./rpm-DVraFRLa.js","./rpm-BStFD27m.js","./ruby-CQkBK2a9.js","./ruby-C37hkPS4.js","./sas-DIYn6ybi.js","./sas-CCEIl8BG.js","./scheme-DQaXtNs_.js","./scheme-B0jflgrk.js","./shell-BKwxMNJ_.js","./shell-Cq7B0hFW.js","./sieve-BuFsd2gQ.js","./sieve-DS0lS4kt.js","./smalltalk-BRk1-XQy.js","./smalltalk-HHM53Uii.js","./sparql-DbKuGH6l.js","./sparql-BMqtnWzI.js","./stylus-CFOJzR7o.js","./stylus-Br2gMpMI.js","./swift-BUhTx6hv.js","./swift-BJ8qi_zI.js","./stex-wt8gHRbn.js","./stex-w1KpyykF.js","./verilog-BO-pDm62.js","./verilog-MmKxT9bW.js","./tcl-MP-B_vsS.js","./tcl-D0knbOX7.js","./textile-MTIaEDRe.js","./textile-DrRQSuh3.js","./toml-DY0cxrsl.js","./toml-C2kDGfZi.js","./troff-BIxIeW8s.js","./troff-2dFxqWQa.js","./ttcn-BE49dEYh.js","./ttcn-Cj4sIofh.js","./ttcn-cfg-BD8YYA5a.js","./ttcn-cfg-CBXajWEo.js","./turtle-BclFB0tn.js","./turtle-CDdPtp5F.js","./webidl-DHMC9GWF.js","./webidl-D9f20BkN.js","./vb-DsN-p1cU.js","./vb-CtEhAMYU.js","./vbscript-DCmHq9j7.js","./vbscript-B0nzdgzL.js","./velocity-DOhnCHS-.js","./velocity-DR7TSall.js","./vhdl-BN6ynKWP.js","./vhdl-0jJrpQNA.js","./xquery-P4k--790.js","./xquery-B0eSGN9q.js","./yacas-2Y6ARAKT.js","./yacas-BS613OH9.js","./z80-CoWNhP-u.js","./z80-CJYC52xh.js","./mscgen-ChgEFq6F.js","./mscgen-MISBZbzR.js","./dist-DItrHsm3.js","./dist-BMfw4eeq.js","./dist-BsZCBdqv.js"])))=>i.map(i=>d[i]);
2
+ var r3=Object.defineProperty;var i3=(Pi,Fr,yo)=>Fr in Pi?r3(Pi,Fr,{enumerable:!0,configurable:!0,writable:!0,value:yo}):Pi[Fr]=yo;var De=(Pi,Fr,yo)=>i3(Pi,typeof Fr!="symbol"?Fr+"":Fr,yo);import{a as lu,n as Bb,r as o3,s as Kt,t as ke}from"./chunk-DZLz74EQ.js";import{a as a3,c as Un,d as Fe,n as ct,o as Hb,s as Vb,t as s3}from"./jotai-BTnrNcC1.js";import{t as cu}from"./react-BcIddLXZ.js";import{t as l3}from"./react-dom-D6bRRS5R.js";import{A as c3,E as $b,F as Wb,P as u3,V as d3,w as f3,z as p3}from"./zod-U2NFpcFA.js";import{t as zr}from"./compiler-runtime-Cr9loedd.js";import{f as m3}from"./_Uint8Array-D5Z9rM2X.js";import{t as h3}from"./_arrayMap-DQI2GUNb.js";import{t as g3}from"./toInteger-Bor4StOs.js";import{d as y3,t as v3}from"./isArrayLikeObject-DKyJYtr8.js";import{u as b3}from"./_baseIsEqual-CVFfFJm2.js";import{t as w3}from"./_baseProperty-c4IQJQis.js";import{t as Ub}from"./debounce-BUM2losY.js";import{a as ei,o as _3,u as Pe}from"./hotkeys-ClCtr3_I.js";import{t as dn}from"./invariant-D5a0EE05.js";import{d as Qp,t as x3}from"./utils-BpjB6B-Y.js";import{g as k3,r as C3}from"./config-e9OVB2bJ.js";import{o as Kb}from"./useEventListener-D1FLsfmf.js";import{t as S3}from"./jsx-runtime-mwDPpfh_.js";import{t as uu}from"./cn-DEUt_IsG.js";import{t as Qb}from"./button-Zjtz1syG.js";import{Bt as Gb,C as E3,D as T3,Dt as Gp,Et as rs,F as Jb,Gt as ta,H as R3,It as du,Jt as is,K as fu,Kt as pu,Lt as fn,R as Xb,Rt as mu,S as D3,T as Yb,Ut as Zb,V as e2,Vt as hu,b as t2,bt as na,ct as O3,et as n2,f as r2,ft as P3,k as N3,l as ce,nt as M3,ot as ra,p as L3,qt as ia,rt as Tn,tt as Ti,u as i2,wt as o2,yt as a2,zt as kl}from"./dist-o3-gJN-A.js";import{C as A3,O as I3,T as j3,_ as q3,a as z3,b as F3,d as B3,f as H3,g as V3,i as s2,m as $3,o as W3,p as U3,t as K3,u as Jp,w as Q3,x as G3,y as J3}from"./dist-Dv7WCK3M.js";import{a as l2,i as X3,n as ti,o as c2,p as Xp,s as Cl}from"./once-3GsqimLM.js";import{t as Y3}from"./capabilities-CEL4hxAo.js";import{t as Sl}from"./createReducer-C6dJ71nW.js";import{t as Ri}from"./requests-DD3OWR81.js";import{t as ue}from"./preload-helper-DImqtvgl.js";import{d as u2,l as d2,n as Z3,o as f2,p as eR,r as gu}from"./dist-DdXBxU_X.js";import{i as p2,o as tR}from"./dist-ws1ADWL0.js";import{a as nR,i as Yp,n as rR,r as m2,t as iR}from"./dist-BGbJQ9FV.js";import{n as oR}from"./stex-w1KpyykF.js";import{n as yu,t as aR}from"./key-BOd4SjWu.js";import{t as vu}from"./use-toast-BPMVOfO3.js";import{i as Zp,r as em}from"./main-CCaZmKLi.js";import{t as h2}from"./marked.esm-BB_RKOA5.js";import{a as sR,s as ni,t as El}from"./connection-CsVOmbVi.js";import{a as lR,c as cR,d as uR,f as g2,i as dR,l as fR,n as pR,o as tm,r as mR,s as nm,t as hR,u as gR}from"./dist-dCpey1ug.js";import{i as Tl,t as yR}from"./useLifecycle-CxNbfWnk.js";import{t as qn}from"./createLucideIcon-CaU6_Jtx.js";import{i as vR,n as bR,r as rm,t as wR}from"./type-DVCC-93H.js";import{t as _R}from"./check-Dc7YCRim.js";import{a as xR,c as kR,i as im,m as CR,n as SR,o as y2,r as ER,s as TR,t as RR}from"./select-Di-JjADd.js";import{t as DR,u as OR}from"./toDate-CnvLb18a.js";import{t as lr}from"./badge-CxcKOiwY.js";import{C as PR,g as om,v as NR,x as v2,y as MR}from"./Combination-DWHMUa0d.js";import{l as LR}from"./dist-1ZdxNBaX.js";import{i as AR,t as am}from"./tooltip-CerBk_un.js";import{t as IR}from"./useNonce-CL3DrH5R.js";let b2,bu,Rl,w2,_2,zn,wu,sm,_u,cr,x2,k2,Dl,C2,S2,E2,lm,os,oa,T2,cm,xu,Ol,R2,D2,O2,um,dm,fm,pm,P2,N2,M2,L2,A2,I2,mm,j2,hm,gm,q2,ku,z2,Cu,ym,F2,kr,vm,bm,wm,B2,Di,Su,as,H2,Pl,Nl,_m,V2,$2,W2,xm,U2,K2,Eu,km,Tu,Q2,G2,Cr,Ru,fo,J2,X2,Cm,Ml,po,Y2,Z2,ew,tw,Sm,Du,Em,Ou,nw,rw,Pu,Tm,Rm,Nu,iw,aa,ow,aw,sw,lw,cw,uw,Mu,mo,dw,fw,ri,Dm,ur,pw,mw,sa,hw,gw,Om,ho,Lu,yw,Pm,vw,Au,Nm,Mm,Lm,bw,ww,Am,Im,_w,Ll,Iu,xw,kw,ju,Cw,Al,qu,go,zu,jm,Fu,qm,Dt,Sw,Ew,Tw,Rw,Bu,Dw,Ow,ss,la,Pw,Nw,zm,Fm,Mw,Il,ca,Bm,Sr,Oi,Lw,ii,Hu,Aw,Hm,Er,Iw,Vu,jw,qw,Vm,zw,$u,Fw,Bw,ls,Wu,cs,Uu,Ku,$m,Hw,us,Vw,jl,Wm,$w,Ww,Uw,Um,Kw,Qu,Km,Gu,Qw,Ju,Qm,Xu,ft,Gm,Jm,Gw,Jw,Yu,Xm,Xw,Yw,Zw,e_,t_,jR=(async()=>{var zi,tf;let Pi,Fr,yo,Zm;Pi=ke((e=>{function n(X,Q){var K=X.length;X.push(Q);e:for(;0<K;){var Ne=K-1>>>1,Qe=X[Ne];if(0<s(Qe,Q))X[Ne]=Q,X[K]=Qe,K=Ne;else break e}}function i(X){return X.length===0?null:X[0]}function a(X){if(X.length===0)return null;var Q=X[0],K=X.pop();if(K!==Q){X[0]=K;e:for(var Ne=0,Qe=X.length,ut=Qe>>>1;Ne<ut;){var Be=2*(Ne+1)-1,We=X[Be],Re=Be+1,Me=X[Re];if(0>s(We,K))Re<Qe&&0>s(Me,We)?(X[Ne]=Me,X[Re]=K,Ne=Re):(X[Ne]=We,X[Be]=K,Ne=Be);else if(Re<Qe&&0>s(Me,K))X[Ne]=Me,X[Re]=K,Ne=Re;else break e}}return Q}function s(X,Q){var K=X.sortIndex-Q.sortIndex;return K===0?X.id-Q.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,p=d.now();e.unstable_now=function(){return d.now()-p}}var h=[],v=[],w=1,_=null,C=3,E=!1,R=!1,A=!1,H=!1,V=typeof setTimeout=="function"?setTimeout:null,U=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function G(X){for(var Q=i(v);Q!==null;){if(Q.callback===null)a(v);else if(Q.startTime<=X)a(v),Q.sortIndex=Q.expirationTime,n(h,Q);else break;Q=i(v)}}function he(X){if(A=!1,G(X),!R)if(i(h)!==null)R=!0,N||(N=!0,te());else{var Q=i(v);Q!==null&&ie(he,Q.startTime-X)}}var N=!1,I=-1,$=5,de=-1;function fe(){return H?!0:!(e.unstable_now()-de<$)}function xe(){if(H=!1,N){var X=e.unstable_now();de=X;var Q=!0;try{e:{R=!1,A&&(A=!1,U(I),I=-1),E=!0;var K=C;try{t:{for(G(X),_=i(h);_!==null&&!(_.expirationTime>X&&fe());){var Ne=_.callback;if(typeof Ne=="function"){_.callback=null,C=_.priorityLevel;var Qe=Ne(_.expirationTime<=X);if(X=e.unstable_now(),typeof Qe=="function"){_.callback=Qe,G(X),Q=!0;break t}_===i(h)&&a(h),G(X)}else a(h);_=i(h)}if(_!==null)Q=!0;else{var ut=i(v);ut!==null&&ie(he,ut.startTime-X),Q=!1}}break e}finally{_=null,C=K,E=!1}Q=void 0}}finally{Q?te():N=!1}}}var te;if(typeof L=="function")te=function(){L(xe)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,Se=be.port2;be.port1.onmessage=xe,te=function(){Se.postMessage(null)}}else te=function(){V(xe,0)};function ie(X,Q){I=V(function(){X(e.unstable_now())},Q)}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(X){X.callback=null},e.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<X?Math.floor(1e3/X):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(X){switch(C){case 1:case 2:case 3:var Q=3;break;default:Q=C}var K=C;C=Q;try{return X()}finally{C=K}},e.unstable_requestPaint=function(){H=!0},e.unstable_runWithPriority=function(X,Q){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var K=C;C=X;try{return Q()}finally{C=K}},e.unstable_scheduleCallback=function(X,Q,K){var Ne=e.unstable_now();switch(typeof K=="object"&&K?(K=K.delay,K=typeof K=="number"&&0<K?Ne+K:Ne):K=Ne,X){case 1:var Qe=-1;break;case 2:Qe=250;break;case 5:Qe=1073741823;break;case 4:Qe=1e4;break;default:Qe=5e3}return Qe=K+Qe,X={id:w++,callback:Q,priorityLevel:X,startTime:K,expirationTime:Qe,sortIndex:-1},K>Ne?(X.sortIndex=K,n(v,X),i(h)===null&&X===i(v)&&(A?(U(I),I=-1):A=!0,ie(he,K-Ne))):(X.sortIndex=Qe,n(h,X),R||E||(R=!0,N||(N=!0,te()))),X},e.unstable_shouldYield=fe,e.unstable_wrapCallback=function(X){var Q=C;return function(){var K=C;C=Q;try{return X.apply(this,arguments)}finally{C=K}}}})),Fr=ke(((e,n)=>{n.exports=Pi()})),yo=ke((e=>{var n=Fr(),i=cu(),a=l3();function s(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)r+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function d(t){var r=t,o=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,r.flags&4098&&(o=r.return),t=r.return;while(t)}return r.tag===3?o:null}function p(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function h(t){if(d(t)!==t)throw Error(s(188))}function v(t){var r=t.alternate;if(!r){if(r=d(t),r===null)throw Error(s(188));return r===t?t:null}for(var o=t,l=r;;){var f=o.return;if(f===null)break;var g=f.alternate;if(g===null){if(l=f.return,l!==null){o=l;continue}break}if(f.child===g.child){for(g=f.child;g;){if(g===o)return h(f),t;if(g===l)return h(f),r;g=g.sibling}throw Error(s(188))}if(o.return!==l.return)o=f,l=g;else{for(var S=!1,D=f.child;D;){if(D===o){S=!0,o=f,l=g;break}if(D===l){S=!0,l=f,o=g;break}D=D.sibling}if(!S){for(D=g.child;D;){if(D===o){S=!0,o=g,l=f;break}if(D===l){S=!0,l=g,o=f;break}D=D.sibling}if(!S)throw Error(s(189))}}if(o.alternate!==l)throw Error(s(190))}if(o.tag!==3)throw Error(s(188));return o.stateNode.current===o?t:r}function w(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=w(t),r!==null)return r;t=t.sibling}return null}var _=Object.assign,C=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),U=Symbol.for("react.provider"),L=Symbol.for("react.consumer"),G=Symbol.for("react.context"),he=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),de=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),xe=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function be(t){return typeof t!="object"||!t?null:(t=te&&t[te]||t["@@iterator"],typeof t=="function"?t:null)}var Se=Symbol.for("react.client.reference");function ie(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Se?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case A:return"Fragment";case V:return"Profiler";case H:return"StrictMode";case N:return"Suspense";case I:return"SuspenseList";case fe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case R:return"Portal";case G:return(t.displayName||"Context")+".Provider";case L:return(t._context.displayName||"Context")+".Consumer";case he:var r=t.render;return t=t.displayName,t||(t=(t=r.displayName||r.name||"",t===""?"ForwardRef":"ForwardRef("+t+")")),t;case $:return r=t.displayName||null,r===null?ie(t.type)||"Memo":r;case de:r=t._payload,t=t._init;try{return ie(t(r))}catch{}}return null}var X=Array.isArray,Q=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ne={pending:!1,data:null,method:null,action:null},Qe=[],ut=-1;function Be(t){return{current:t}}function We(t){0>ut||(t.current=Qe[ut],Qe[ut]=null,ut--)}function Re(t,r){ut++,Qe[ut]=t.current,t.current=r}var Me=Be(null),hn=Be(null),It=Be(null),Dn=Be(null);function sn(t,r){switch(Re(It,r),Re(hn,t),Re(Me,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?yb(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=yb(r),t=vb(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}We(Me),Re(Me,t)}function Ue(){We(Me),We(hn),We(It)}function tn(t){t.memoizedState!==null&&Re(Dn,t);var r=Me.current,o=vb(r,t.type);r!==o&&(Re(hn,t),Re(Me,o))}function gt(t){hn.current===t&&(We(Me),We(hn)),Dn.current===t&&(We(Dn),vl._currentValue=Ne)}var gn=Object.prototype.hasOwnProperty,Xn=n.unstable_scheduleCallback,kt=n.unstable_cancelCallback,ai=n.unstable_shouldYield,yn=n.unstable_requestPaint,vn=n.unstable_now,Ln=n.unstable_getCurrentPriorityLevel,Pr=n.unstable_ImmediatePriority,An=n.unstable_UserBlockingPriority,nn=n.unstable_NormalPriority,Fi=n.unstable_LowPriority,$r=n.unstable_IdlePriority,Nr=n.log,si=n.unstable_setDisableYieldValue,Ht=null,Qt=null;function yt(t){if(typeof Nr=="function"&&si(t),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(Ht,t)}catch{}}var Ft=Math.clz32?Math.clz32:Bi,Ct=Math.log,li=Math.LN2;function Bi(t){return t>>>=0,t===0?32:31-(Ct(t)/li|0)|0}var Mr=256,dr=4194304;function Ge(t){var r=t&42;if(r!==0)return r;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Vt(t,r,o){var l=t.pendingLanes;if(l===0)return 0;var f=0,g=t.suspendedLanes,S=t.pingedLanes;t=t.warmLanes;var D=l&134217727;return D===0?(D=l&~g,D===0?S===0?o||(o=l&~t,o!==0&&(f=Ge(o))):f=Ge(S):f=Ge(D)):(l=D&~g,l===0?(S&=D,S===0?o||(o=D&~t,o!==0&&(f=Ge(o))):f=Ge(S)):f=Ge(l)),f===0?0:r!==0&&r!==f&&(r&g)===0&&(g=f&-f,o=r&-r,g>=o||g===32&&o&4194048)?r:f}function st(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function vt(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function On(){var t=Mr;return Mr<<=1,!(Mr&4194048)&&(Mr=256),t}function Wr(){var t=dr;return dr<<=1,!(dr&62914560)&&(dr=4194304),t}function St(t){for(var r=[],o=0;31>o;o++)r.push(t);return r}function Yn(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ur(t,r,o,l,f,g){var S=t.pendingLanes;t.pendingLanes=o,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=o,t.entangledLanes&=o,t.errorRecoveryDisabledLanes&=o,t.shellSuspendCounter=0;var D=t.entanglements,F=t.expirationTimes,re=t.hiddenUpdates;for(o=S&~o;0<o;){var pe=31-Ft(o),ve=1<<pe;D[pe]=0,F[pe]=-1;var ae=re[pe];if(ae!==null)for(re[pe]=null,pe=0;pe<ae.length;pe++){var le=ae[pe];le!==null&&(le.lane&=-536870913)}o&=~ve}l!==0&&ci(t,l,0),g!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=g&~(S&~r))}function ci(t,r,o){t.pendingLanes|=r,t.suspendedLanes&=~r;var l=31-Ft(r);t.entangledLanes|=r,t.entanglements[l]=t.entanglements[l]|1073741824|o&4194090}function In(t,r){var o=t.entangledLanes|=r;for(t=t.entanglements;o;){var l=31-Ft(o),f=1<<l;f&r|t[l]&r&&(t[l]|=r),o&=~f}}function Bn(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Kr(t){return t&=-t,2<t?8<t?t&134217727?32:268435456:8:2}function ui(){var t=K.p;return t===0?(t=window.event,t===void 0?32:Ab(t.type)):t}function Zn(t,r){var o=K.p;try{return K.p=t,r()}finally{K.p=o}}var Pn=Math.random().toString(36).slice(2),bt="__reactFiber$"+Pn,jt="__reactProps$"+Pn,P="__reactContainer$"+Pn,Je="__reactEvents$"+Pn,q="__reactListeners$"+Pn,ne="__reactHandles$"+Pn,ye="__reactResources$"+Pn,Ce="__reactMarker$"+Pn;function pt(t){delete t[bt],delete t[jt],delete t[Je],delete t[q],delete t[ne]}function tt(t){var r=t[bt];if(r)return r;for(var o=t.parentNode;o;){if(r=o[P]||o[bt]){if(o=r.alternate,r.child!==null||o!==null&&o.child!==null)for(t=xb(t);t!==null;){if(o=t[bt])return o;t=xb(t)}return r}t=o,o=t.parentNode}return null}function it(t){if(t=t[bt]||t[P]){var r=t.tag;if(r===5||r===6||r===13||r===26||r===27||r===3)return t}return null}function wt(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(s(33))}function $e(t){var r=t[ye];return r||(r=t[ye]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function He(t){t[Ce]=!0}var ot=new Set,ht={};function $t(t,r){er(t,r),er(t+"Capture",r)}function er(t,r){for(ht[t]=r,t=0;t<r.length;t++)ot.add(r[t])}var ws=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]*$"),fr={},Zl={};function ec(t){return gn.call(Zl,t)?!0:gn.call(fr,t)?!1:ws.test(t)?Zl[t]=!0:(fr[t]=!0,!1)}function So(t,r,o){if(ec(r))if(o===null)t.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var l=r.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+o)}}function Ea(t,r,o){if(o===null)t.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+o)}}function pr(t,r,o,l){if(l===null)t.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(o);return}t.setAttributeNS(r,o,""+l)}}var _s,tc;function bn(t){if(_s===void 0)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);_s=r&&r[1]||"",tc=-1<o.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+_s+t+tc}var xs=!1;function ks(t,r){if(!t||xs)return"";xs=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(r){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(le){var ae=le}Reflect.construct(t,[],ve)}else{try{ve.call()}catch(le){ae=le}t.call(ve.prototype)}}else{try{throw Error()}catch(le){ae=le}(ve=t())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(le){if(le&&ae&&typeof le.stack=="string")return[le.stack,ae.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=l.DetermineComponentFrameRoot(),S=g[0],D=g[1];if(S&&D){var F=S.split(`
5
+ `),re=D.split(`
6
+ `);for(f=l=0;l<F.length&&!F[l].includes("DetermineComponentFrameRoot");)l++;for(;f<re.length&&!re[f].includes("DetermineComponentFrameRoot");)f++;if(l===F.length||f===re.length)for(l=F.length-1,f=re.length-1;1<=l&&0<=f&&F[l]!==re[f];)f--;for(;1<=l&&0<=f;l--,f--)if(F[l]!==re[f]){if(l!==1||f!==1)do if(l--,f--,0>f||F[l]!==re[f]){var pe=`
7
+ `+F[l].replace(" at new "," at ");return t.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",t.displayName)),pe}while(1<=l&&0<=f);break}}}finally{xs=!1,Error.prepareStackTrace=o}return(o=t?t.displayName||t.name:"")?bn(o):""}function nc(t){switch(t.tag){case 26:case 27:case 5:return bn(t.type);case 16:return bn("Lazy");case 13:return bn("Suspense");case 19:return bn("SuspenseList");case 0:case 15:return ks(t.type,!1);case 11:return ks(t.type.render,!1);case 1:return ks(t.type,!0);case 31:return bn("Activity");default:return""}}function Cs(t){try{var r="";do r+=nc(t),t=t.return;while(t);return r}catch(o){return`
8
+ Error generating stack: `+o.message+`
9
+ `+o.stack}}function Hn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Ss(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function nf(t){var r=Ss(t)?"checked":"value",o=Object.getOwnPropertyDescriptor(t.constructor.prototype,r),l=""+t[r];if(!t.hasOwnProperty(r)&&o!==void 0&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,g=o.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return f.call(this)},set:function(S){l=""+S,g.call(this,S)}}),Object.defineProperty(t,r,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(S){l=""+S},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function Eo(t){t._valueTracker||(t._valueTracker=nf(t))}function rc(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var o=r.getValue(),l="";return t&&(l=Ss(t)?t.checked?"true":"false":t.value),t=l,t===o?!1:(r.setValue(t),!0)}function To(t){if(t||(t=typeof document<"u"?document:void 0),t===void 0)return null;try{return t.activeElement||t.body}catch{return t.body}}var tr=/[\n"\\]/g;function Ve(t){return t.replace(tr,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Es(t,r,o,l,f,g,S,D){t.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.type=S:t.removeAttribute("type"),r==null?S!=="submit"&&S!=="reset"||t.removeAttribute("value"):S==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Hn(r)):t.value!==""+Hn(r)&&(t.value=""+Hn(r)),r==null?o==null?l!=null&&t.removeAttribute("value"):Ts(t,S,Hn(o)):Ts(t,S,Hn(r)),f==null&&g!=null&&(t.defaultChecked=!!g),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?t.name=""+Hn(D):t.removeAttribute("name")}function Ro(t,r,o,l,f,g,S,D){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.type=g),r!=null||o!=null){if(!(g!=="submit"&&g!=="reset"||r!=null))return;o=o==null?"":""+Hn(o),r=r==null?o:""+Hn(r),D||r===t.value||(t.value=r),t.defaultValue=r}l??(l=f),l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=D?t.checked:!!l,t.defaultChecked=!!l,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.name=S)}function Ts(t,r,o){r==="number"&&To(t.ownerDocument)===t||t.defaultValue===""+o||(t.defaultValue=""+o)}function mr(t,r,o,l){if(t=t.options,r){r={};for(var f=0;f<o.length;f++)r["$"+o[f]]=!0;for(o=0;o<t.length;o++)f=r.hasOwnProperty("$"+t[o].value),t[o].selected!==f&&(t[o].selected=f),f&&l&&(t[o].defaultSelected=!0)}else{for(o=""+Hn(o),r=null,f=0;f<t.length;f++){if(t[f].value===o){t[f].selected=!0,l&&(t[f].defaultSelected=!0);return}r!==null||t[f].disabled||(r=t[f])}r!==null&&(r.selected=!0)}}function ic(t,r,o){if(r!=null&&(r=""+Hn(r),r!==t.value&&(t.value=r),o==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=o==null?"":""+Hn(o)}function Hi(t,r,o,l){if(r==null){if(l!=null){if(o!=null)throw Error(s(92));if(X(l)){if(1<l.length)throw Error(s(93));l=l[0]}o=l}o??(o=""),r=o}o=Hn(r),t.defaultValue=o,l=t.textContent,l===o&&l!==""&&l!==null&&(t.value=l)}function Qr(t,r){if(r){var o=t.firstChild;if(o&&o===t.lastChild&&o.nodeType===3){o.nodeValue=r;return}}t.textContent=r}var oc=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 ac(t,r,o){var l=r.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?l?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":l?t.setProperty(r,o):typeof o!="number"||o===0||oc.has(r)?r==="float"?t.cssFloat=o:t[r]=(""+o).trim():t[r]=o+"px"}function di(t,r,o){if(r!=null&&typeof r!="object")throw Error(s(62));if(t=t.style,o!=null){for(var l in o)!o.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="");for(var f in r)l=r[f],r.hasOwnProperty(f)&&o[f]!==l&&ac(t,f,l)}else for(var g in r)r.hasOwnProperty(g)&&ac(t,g,r[g])}function Rs(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ds=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"]]),Ta=/^[\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 Do(t){return Ta.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var Os=null;function Ra(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Gt=null,Vi=null;function Lr(t){var r=it(t);if(r&&(t=r.stateNode)){var o=t[jt]||null;e:switch(t=r.stateNode,r.type){case"input":if(Es(t,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),r=o.name,o.type==="radio"&&r!=null){for(o=t;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Ve(""+r)+'"][type="radio"]'),r=0;r<o.length;r++){var l=o[r];if(l!==t&&l.form===t.form){var f=l[jt]||null;if(!f)throw Error(s(90));Es(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(r=0;r<o.length;r++)l=o[r],l.form===t.form&&rc(l)}break e;case"textarea":ic(t,o.value,o.defaultValue);break e;case"select":r=o.value,r!=null&&mr(t,!!o.multiple,r,!1)}}}var Oo=!1;function sc(t,r,o){if(Oo)return t(r,o);Oo=!0;try{return t(r)}finally{if(Oo=!1,(Gt!==null||Vi!==null)&&(Hc(),Gt&&(r=Gt,t=Vi,Vi=Gt=null,Lr(r),t)))for(r=0;r<t.length;r++)Lr(t[r])}}function Po(t,r){var o=t.stateNode;if(o===null)return null;var l=o[jt]||null;if(l===null)return null;o=l[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break e;default:t=!1}if(t)return null;if(o&&typeof o!="function")throw Error(s(231,r,typeof o));return o}var Ar=!(typeof window>"u"||window.document===void 0||window.document.createElement===void 0),Ps=!1;if(Ar)try{var No={};Object.defineProperty(No,"passive",{get:function(){Ps=!0}}),window.addEventListener("test",No,No),window.removeEventListener("test",No,No)}catch{Ps=!1}var Gr=null,Ns=null,Mo=null;function Ms(){if(Mo)return Mo;var t,r=Ns,o=r.length,l,f="value"in Gr?Gr.value:Gr.textContent,g=f.length;for(t=0;t<o&&r[t]===f[t];t++);var S=o-t;for(l=1;l<=S&&r[o-l]===f[g-l];l++);return Mo=f.slice(t,1<l?1-l:void 0)}function Lo(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function Ao(){return!0}function Ls(){return!1}function kn(t){function r(o,l,f,g,S){for(var D in this._reactName=o,this._targetInst=f,this.type=l,this.nativeEvent=g,this.target=S,this.currentTarget=null,t)t.hasOwnProperty(D)&&(o=t[D],this[D]=o?o(g):g[D]);return this.isDefaultPrevented=(g.defaultPrevented==null?g.returnValue===!1:g.defaultPrevented)?Ao:Ls,this.isPropagationStopped=Ls,this}return _(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Ao)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Ao)},persist:function(){},isPersistent:Ao}),r}var Jr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$i=kn(Jr),Io=_({},Jr,{view:0,detail:0}),u=kn(Io),m,y,b,x=_({},Io,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:we,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==b&&(b&&t.type==="mousemove"?(m=t.screenX-b.screenX,y=t.screenY-b.screenY):y=m=0,b=t),m)},movementY:function(t){return"movementY"in t?t.movementY:y}}),k=kn(x),T=kn(_({},x,{dataTransfer:0})),O=kn(_({},Io,{relatedTarget:0})),M=kn(_({},Jr,{animationName:0,elapsedTime:0,pseudoElement:0})),z=kn(_({},Jr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}})),j=kn(_({},Jr,{data:0})),se={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oe={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"},Y={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Z(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=Y[t])?!!r[t]:!1}function we(){return Z}var _e=kn(_({},Io,{key:function(t){if(t.key){var r=se[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Lo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?oe[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:we,charCode:function(t){return t.type==="keypress"?Lo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Lo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}})),je=kn(_({},x,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Ee=kn(_({},Io,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:we})),Ie=kn(_({},Jr,{propertyName:0,elapsedTime:0,pseudoElement:0})),lt=kn(_({},x,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0})),Xe=kn(_({},Jr,{newState:0,oldState:0})),Ot=[9,13,27,32],Pt=Ar&&"CompositionEvent"in window,ze=null;Ar&&"documentMode"in document&&(ze=document.documentMode);var Ke=Ar&&"TextEvent"in window&&!ze,Jt=Ar&&(!Pt||ze&&8<ze&&11>=ze),Xt=" ",ln=!1;function jo(t,r){switch(t){case"keyup":return Ot.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lc(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Wi=!1;function As(t,r){switch(t){case"compositionend":return lc(r);case"keypress":return r.which===32?(ln=!0,Xt):null;case"textInput":return t=r.data,t===Xt&&ln?null:t;default:return null}}function TE(t,r){if(Wi)return t==="compositionend"||!Pt&&jo(t,r)?(t=Ms(),Mo=Ns=Gr=null,Wi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Jt&&r.locale!=="ko"?null:r.data;default:return null}}var RE={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 My(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!RE[t.type]:r==="textarea"}function Ly(t,r,o,l){Gt?Vi?Vi.push(l):Vi=[l]:Gt=l,r=Qc(r,"onChange"),0<r.length&&(o=new $i("onChange","change",null,o,l),t.push({event:o,listeners:r}))}var Is=null,js=null;function DE(t){db(t,0)}function cc(t){if(rc(wt(t)))return t}function Ay(t,r){if(t==="change")return r}var Iy=!1;if(Ar){var rf;if(Ar){var of="oninput"in document;if(!of){var jy=document.createElement("div");jy.setAttribute("oninput","return;"),of=typeof jy.oninput=="function"}rf=of}else rf=!1;Iy=rf&&(!document.documentMode||9<document.documentMode)}function qy(){Is&&(Is.detachEvent("onpropertychange",zy),js=Is=null)}function zy(t){if(t.propertyName==="value"&&cc(js)){var r=[];Ly(r,js,t,Ra(t)),sc(DE,r)}}function OE(t,r,o){t==="focusin"?(qy(),Is=r,js=o,Is.attachEvent("onpropertychange",zy)):t==="focusout"&&qy()}function PE(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return cc(js)}function NE(t,r){if(t==="click")return cc(r)}function ME(t,r){if(t==="input"||t==="change")return cc(r)}function LE(t,r){return t===r&&(t!==0||1/t==1/r)||t!==t&&r!==r}var nr=typeof Object.is=="function"?Object.is:LE;function qs(t,r){if(nr(t,r))return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var o=Object.keys(t),l=Object.keys(r);if(o.length!==l.length)return!1;for(l=0;l<o.length;l++){var f=o[l];if(!gn.call(r,f)||!nr(t[f],r[f]))return!1}return!0}function Fy(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function By(t,r){var o=Fy(t);t=0;for(var l;o;){if(o.nodeType===3){if(l=t+o.textContent.length,t<=r&&l>=r)return{node:o,offset:r-t};t=l}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Fy(o)}}function Hy(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?Hy(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Vy(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=To(t.document);r instanceof t.HTMLIFrameElement;){try{var o=typeof r.contentWindow.location.href=="string"}catch{o=!1}if(o)t=r.contentWindow;else break;r=To(t.document)}return r}function af(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var AE=Ar&&"documentMode"in document&&11>=document.documentMode,Da=null,sf=null,zs=null,lf=!1;function $y(t,r,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;lf||Da==null||Da!==To(l)||(l=Da,"selectionStart"in l&&af(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),zs&&qs(zs,l)||(zs=l,l=Qc(sf,"onSelect"),0<l.length&&(r=new $i("onSelect","select",null,r,o),t.push({event:r,listeners:l}),r.target=Da)))}function qo(t,r){var o={};return o[t.toLowerCase()]=r.toLowerCase(),o["Webkit"+t]="webkit"+r,o["Moz"+t]="moz"+r,o}var Oa={animationend:qo("Animation","AnimationEnd"),animationiteration:qo("Animation","AnimationIteration"),animationstart:qo("Animation","AnimationStart"),transitionrun:qo("Transition","TransitionRun"),transitionstart:qo("Transition","TransitionStart"),transitioncancel:qo("Transition","TransitionCancel"),transitionend:qo("Transition","TransitionEnd")},cf={},Wy={};Ar&&(Wy=document.createElement("div").style,"AnimationEvent"in window||(delete Oa.animationend.animation,delete Oa.animationiteration.animation,delete Oa.animationstart.animation),"TransitionEvent"in window||delete Oa.transitionend.transition);function zo(t){if(cf[t])return cf[t];if(!Oa[t])return t;var r=Oa[t],o;for(o in r)if(r.hasOwnProperty(o)&&o in Wy)return cf[t]=r[o];return t}var Uy=zo("animationend"),Ky=zo("animationiteration"),Qy=zo("animationstart"),IE=zo("transitionrun"),jE=zo("transitionstart"),qE=zo("transitioncancel"),Gy=zo("transitionend"),Jy=new Map,uf="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(" ");uf.push("scrollEnd");function Ir(t,r){Jy.set(t,r),$t(r,[t])}var Xy=new WeakMap;function hr(t,r){if(typeof t=="object"&&t){var o=Xy.get(t);return o===void 0?(r={value:t,source:r,stack:Cs(r)},Xy.set(t,r),r):o}return{value:t,source:r,stack:Cs(r)}}var gr=[],Pa=0,df=0;function uc(){for(var t=Pa,r=df=Pa=0;r<t;){var o=gr[r];gr[r++]=null;var l=gr[r];gr[r++]=null;var f=gr[r];gr[r++]=null;var g=gr[r];if(gr[r++]=null,l!==null&&f!==null){var S=l.pending;S===null?f.next=f:(f.next=S.next,S.next=f),l.pending=f}g!==0&&Yy(o,f,g)}}function dc(t,r,o,l){gr[Pa++]=t,gr[Pa++]=r,gr[Pa++]=o,gr[Pa++]=l,df|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function ff(t,r,o,l){return dc(t,r,o,l),fc(t)}function Na(t,r){return dc(t,null,null,r),fc(t)}function Yy(t,r,o){t.lanes|=o;var l=t.alternate;l!==null&&(l.lanes|=o);for(var f=!1,g=t.return;g!==null;)g.childLanes|=o,l=g.alternate,l!==null&&(l.childLanes|=o),g.tag===22&&(t=g.stateNode,t===null||t._visibility&1||(f=!0)),t=g,g=g.return;return t.tag===3?(g=t.stateNode,f&&r!==null&&(f=31-Ft(o),t=g.hiddenUpdates,l=t[f],l===null?t[f]=[r]:l.push(r),r.lane=o|536870912),g):null}function fc(t){if(50<ul)throw ul=0,vp=null,Error(s(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var Ma={};function zE(t,r,o,l){this.tag=t,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=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rr(t,r,o,l){return new zE(t,r,o,l)}function pf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function fi(t,r){var o=t.alternate;return o===null?(o=rr(t.tag,r,t.key,t.mode),o.elementType=t.elementType,o.type=t.type,o.stateNode=t.stateNode,o.alternate=t,t.alternate=o):(o.pendingProps=r,o.type=t.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=t.flags&65011712,o.childLanes=t.childLanes,o.lanes=t.lanes,o.child=t.child,o.memoizedProps=t.memoizedProps,o.memoizedState=t.memoizedState,o.updateQueue=t.updateQueue,r=t.dependencies,o.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},o.sibling=t.sibling,o.index=t.index,o.ref=t.ref,o.refCleanup=t.refCleanup,o}function Zy(t,r){t.flags&=65011714;var o=t.alternate;return o===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=o.childLanes,t.lanes=o.lanes,t.child=o.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=o.memoizedProps,t.memoizedState=o.memoizedState,t.updateQueue=o.updateQueue,t.type=o.type,r=o.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function pc(t,r,o,l,f,g){var S=0;if(l=t,typeof t=="function")pf(t)&&(S=1);else if(typeof t=="string")S=HT(t,o,Me.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case fe:return t=rr(31,o,r,f),t.elementType=fe,t.lanes=g,t;case A:return Fo(o.children,f,g,r);case H:S=8,f|=24;break;case V:return t=rr(12,o,r,f|2),t.elementType=V,t.lanes=g,t;case N:return t=rr(13,o,r,f),t.elementType=N,t.lanes=g,t;case I:return t=rr(19,o,r,f),t.elementType=I,t.lanes=g,t;default:if(typeof t=="object"&&t)switch(t.$$typeof){case U:case G:S=10;break e;case L:S=9;break e;case he:S=11;break e;case $:S=14;break e;case de:S=16,l=null;break e}S=29,o=Error(s(130,t===null?"null":typeof t,"")),l=null}return r=rr(S,o,r,f),r.elementType=t,r.type=l,r.lanes=g,r}function Fo(t,r,o,l){return t=rr(7,t,l,r),t.lanes=o,t}function mf(t,r,o){return t=rr(6,t,null,r),t.lanes=o,t}function hf(t,r,o){return r=rr(4,t.children===null?[]:t.children,t.key,r),r.lanes=o,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var La=[],Aa=0,mc=null,hc=0,yr=[],vr=0,Bo=null,pi=1,mi="";function Ho(t,r){La[Aa++]=hc,La[Aa++]=mc,mc=t,hc=r}function ev(t,r,o){yr[vr++]=pi,yr[vr++]=mi,yr[vr++]=Bo,Bo=t;var l=pi;t=mi;var f=32-Ft(l)-1;l&=~(1<<f),o+=1;var g=32-Ft(r)+f;if(30<g){var S=f-f%5;g=(l&(1<<S)-1).toString(32),l>>=S,f-=S,pi=1<<32-Ft(r)+f|o<<f|l,mi=g+t}else pi=1<<g|o<<f|l,mi=t}function gf(t){t.return!==null&&(Ho(t,1),ev(t,1,0))}function yf(t){for(;t===mc;)mc=La[--Aa],La[Aa]=null,hc=La[--Aa],La[Aa]=null;for(;t===Bo;)Bo=yr[--vr],yr[vr]=null,mi=yr[--vr],yr[vr]=null,pi=yr[--vr],yr[vr]=null}var jn=null,Wt=null,mt=!1,Vo=null,Xr=!1,vf=Error(s(519));function $o(t){throw Hs(hr(Error(s(418,"")),t)),vf}function tv(t){var r=t.stateNode,o=t.type,l=t.memoizedProps;switch(r[bt]=t,r[jt]=l,o){case"dialog":rt("cancel",r),rt("close",r);break;case"iframe":case"object":case"embed":rt("load",r);break;case"video":case"audio":for(o=0;o<fl.length;o++)rt(fl[o],r);break;case"source":rt("error",r);break;case"img":case"image":case"link":rt("error",r),rt("load",r);break;case"details":rt("toggle",r);break;case"input":rt("invalid",r),Ro(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0),Eo(r);break;case"select":rt("invalid",r);break;case"textarea":rt("invalid",r),Hi(r,l.value,l.defaultValue,l.children),Eo(r)}o=l.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||r.textContent===""+o||l.suppressHydrationWarning===!0||gb(r.textContent,o)?(l.popover!=null&&(rt("beforetoggle",r),rt("toggle",r)),l.onScroll!=null&&rt("scroll",r),l.onScrollEnd!=null&&rt("scrollend",r),l.onClick!=null&&(r.onclick=Gc),r=!0):r=!1,r||$o(t)}function nv(t){for(jn=t.return;jn;)switch(jn.tag){case 5:case 13:Xr=!1;return;case 27:case 3:Xr=!0;return;default:jn=jn.return}}function Fs(t){if(t!==jn)return!1;if(!mt)return nv(t),mt=!0,!1;var r=t.tag,o;if((o=r!==3&&r!==27)&&((o=r===5)&&(o=t.type,o=!(o!=="form"&&o!=="button")||Mp(t.type,t.memoizedProps)),o=!o),o&&Wt&&$o(t),nv(t),r===13){if(t=t.memoizedState,t=t===null?null:t.dehydrated,!t)throw Error(s(317));e:{for(t=t.nextSibling,r=0;t;){if(t.nodeType===8)if(o=t.data,o==="/$"){if(r===0){Wt=qr(t.nextSibling);break e}r--}else o!=="$"&&o!=="$!"&&o!=="$?"||r++;t=t.nextSibling}Wt=null}}else r===27?(r=Wt,oo(t.type)?(t=jp,jp=null,Wt=t):Wt=r):Wt=jn?qr(t.stateNode.nextSibling):null;return!0}function Bs(){Wt=jn=null,mt=!1}function rv(){var t=Vo;return t!==null&&(Wn===null?Wn=t:Wn.push.apply(Wn,t),Vo=null),t}function Hs(t){Vo===null?Vo=[t]:Vo.push(t)}var bf=Be(null),Wo=null,hi=null;function Ui(t,r,o){Re(bf,r._currentValue),r._currentValue=o}function gi(t){t._currentValue=bf.current,We(bf)}function wf(t,r,o){for(;t!==null;){var l=t.alternate;if((t.childLanes&r)===r?l!==null&&(l.childLanes&r)!==r&&(l.childLanes|=r):(t.childLanes|=r,l!==null&&(l.childLanes|=r)),t===o)break;t=t.return}}function _f(t,r,o,l){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var g=f.dependencies;if(g!==null){var S=f.child;g=g.firstContext;e:for(;g!==null;){var D=g;g=f;for(var F=0;F<r.length;F++)if(D.context===r[F]){g.lanes|=o,D=g.alternate,D!==null&&(D.lanes|=o),wf(g.return,o,t),l||(S=null);break e}g=D.next}}else if(f.tag===18){if(S=f.return,S===null)throw Error(s(341));S.lanes|=o,g=S.alternate,g!==null&&(g.lanes|=o),wf(S,o,t),S=null}else S=f.child;if(S!==null)S.return=f;else for(S=f;S!==null;){if(S===t){S=null;break}if(f=S.sibling,f!==null){f.return=S.return,S=f;break}S=S.return}f=S}}function Vs(t,r,o,l){t=null;for(var f=r,g=!1;f!==null;){if(!g){if(f.flags&524288)g=!0;else if(f.flags&262144)break}if(f.tag===10){var S=f.alternate;if(S===null)throw Error(s(387));if(S=S.memoizedProps,S!==null){var D=f.type;nr(f.pendingProps.value,S.value)||(t===null?t=[D]:t.push(D))}}else if(f===Dn.current){if(S=f.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t===null?t=[vl]:t.push(vl))}f=f.return}t!==null&&_f(r,t,o,l),r.flags|=262144}function gc(t){for(t=t.firstContext;t!==null;){if(!nr(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Uo(t){Wo=t,hi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Nn(t){return iv(Wo,t)}function yc(t,r){return Wo===null&&Uo(t),iv(t,r)}function iv(t,r){var o=r._currentValue;if(r={context:r,memoizedValue:o,next:null},hi===null){if(t===null)throw Error(s(308));hi=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else hi=hi.next=r;return o}var FE=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(o,l){t.push(l)}};this.abort=function(){r.aborted=!0,t.forEach(function(o){return o()})}},BE=n.unstable_scheduleCallback,HE=n.unstable_NormalPriority,cn={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function xf(){return{controller:new FE,data:new Map,refCount:0}}function $s(t){t.refCount--,t.refCount===0&&BE(HE,function(){t.controller.abort()})}var Ws=null,kf=0,Ia=0,ja=null;function VE(t,r){if(Ws===null){var o=Ws=[];kf=0,Ia=Sp(),ja={status:"pending",value:void 0,then:function(l){o.push(l)}}}return kf++,r.then(ov,ov),r}function ov(){if(--kf===0&&Ws!==null){ja!==null&&(ja.status="fulfilled");var t=Ws;Ws=null,Ia=0,ja=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function $E(t,r){var o=[],l={status:"pending",value:null,reason:null,then:function(f){o.push(f)}};return t.then(function(){l.status="fulfilled",l.value=r;for(var f=0;f<o.length;f++)(0,o[f])(r)},function(f){for(l.status="rejected",l.reason=f,f=0;f<o.length;f++)(0,o[f])(void 0)}),l}var av=Q.S;Q.S=function(t,r){typeof r=="object"&&r&&typeof r.then=="function"&&VE(t,r),av!==null&&av(t,r)};var Ko=Be(null);function Cf(){var t=Ko.current;return t===null?Lt.pooledCache:t}function vc(t,r){r===null?Re(Ko,Ko.current):Re(Ko,r.pool)}function sv(){var t=Cf();return t===null?null:{parent:cn._currentValue,pool:t}}var Us=Error(s(460)),lv=Error(s(474)),bc=Error(s(542)),Sf={then:function(){}};function cv(t){return t=t.status,t==="fulfilled"||t==="rejected"}function wc(){}function uv(t,r,o){switch(o=t[o],o===void 0?t.push(r):o!==r&&(r.then(wc,wc),r=o),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,fv(t),t;default:if(typeof r.status=="string")r.then(wc,wc);else{if(t=Lt,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=r,t.status="pending",t.then(function(l){if(r.status==="pending"){var f=r;f.status="fulfilled",f.value=l}},function(l){if(r.status==="pending"){var f=r;f.status="rejected",f.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,fv(t),t}throw Ks=r,Us}}var Ks=null;function dv(){if(Ks===null)throw Error(s(459));var t=Ks;return Ks=null,t}function fv(t){if(t===Us||t===bc)throw Error(s(483))}var Ki=!1;function Ef(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Tf(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Qo(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Go(t,r,o){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,_t&2){var f=l.pending;return f===null?r.next=r:(r.next=f.next,f.next=r),l.pending=r,r=fc(t),Yy(t,null,o),r}return dc(t,l,r,o),fc(t)}function Qs(t,r,o){if(r=r.updateQueue,r!==null&&(r=r.shared,o&4194048)){var l=r.lanes;l&=t.pendingLanes,o|=l,r.lanes=o,In(t,o)}}function Rf(t,r){var o=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var f=null,g=null;if(o=o.firstBaseUpdate,o!==null){do{var S={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};g===null?f=g=S:g=g.next=S,o=o.next}while(o!==null);g===null?f=g=r:g=g.next=r}else f=g=r;o={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:g,shared:l.shared,callbacks:l.callbacks},t.updateQueue=o;return}t=o.lastBaseUpdate,t===null?o.firstBaseUpdate=r:t.next=r,o.lastBaseUpdate=r}var Df=!1;function Gs(){if(Df){var t=ja;if(t!==null)throw t}}function Js(t,r,o,l){Df=!1;var f=t.updateQueue;Ki=!1;var g=f.firstBaseUpdate,S=f.lastBaseUpdate,D=f.shared.pending;if(D!==null){f.shared.pending=null;var F=D,re=F.next;F.next=null,S===null?g=re:S.next=re,S=F;var pe=t.alternate;pe!==null&&(pe=pe.updateQueue,D=pe.lastBaseUpdate,D!==S&&(D===null?pe.firstBaseUpdate=re:D.next=re,pe.lastBaseUpdate=F))}if(g!==null){var ve=f.baseState;S=0,pe=re=F=null,D=g;do{var ae=D.lane&-536870913,le=ae!==D.lane;if(le?(at&ae)===ae:(l&ae)===ae){ae!==0&&ae===Ia&&(Df=!0),pe!==null&&(pe=pe.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var qe=t,Le=D;ae=r;var Rt=o;switch(Le.tag){case 1:if(qe=Le.payload,typeof qe=="function"){ve=qe.call(Rt,ve,ae);break e}ve=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=Le.payload,ae=typeof qe=="function"?qe.call(Rt,ve,ae):qe,ae==null)break e;ve=_({},ve,ae);break e;case 2:Ki=!0}}ae=D.callback,ae!==null&&(t.flags|=64,le&&(t.flags|=8192),le=f.callbacks,le===null?f.callbacks=[ae]:le.push(ae))}else le={lane:ae,tag:D.tag,payload:D.payload,callback:D.callback,next:null},pe===null?(re=pe=le,F=ve):pe=pe.next=le,S|=ae;if(D=D.next,D===null){if(D=f.shared.pending,D===null)break;le=D,D=le.next,le.next=null,f.lastBaseUpdate=le,f.shared.pending=null}}while(!0);pe===null&&(F=ve),f.baseState=F,f.firstBaseUpdate=re,f.lastBaseUpdate=pe,g===null&&(f.shared.lanes=0),to|=S,t.lanes=S,t.memoizedState=ve}}function pv(t,r){if(typeof t!="function")throw Error(s(191,t));t.call(r)}function mv(t,r){var o=t.callbacks;if(o!==null)for(t.callbacks=null,t=0;t<o.length;t++)pv(o[t],r)}var qa=Be(null),_c=Be(0);function hv(t,r){t=Ci,Re(_c,t),Re(qa,r),Ci=t|r.baseLanes}function Of(){Re(_c,Ci),Re(qa,qa.current)}function Pf(){Ci=_c.current,We(qa),We(_c)}var Qi=0,Ye=null,Et=null,rn=null,xc=!1,za=!1,Jo=!1,kc=0,Xs=0,Fa=null,WE=0;function Yt(){throw Error(s(321))}function Nf(t,r){if(r===null)return!1;for(var o=0;o<r.length&&o<t.length;o++)if(!nr(t[o],r[o]))return!1;return!0}function Mf(t,r,o,l,f,g){return Qi=g,Ye=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,Q.H=t===null||t.memoizedState===null?Yv:Zv,Jo=!1,g=o(l,f),Jo=!1,za&&(g=yv(r,o,l,f)),gv(t),g}function gv(t){Q.H=Dc;var r=Et!==null&&Et.next!==null;if(Qi=0,rn=Et=Ye=null,xc=!1,Xs=0,Fa=null,r)throw Error(s(300));t===null||wn||(t=t.dependencies,t!==null&&gc(t)&&(wn=!0))}function yv(t,r,o,l){Ye=t;var f=0;do{if(za&&(Fa=null),Xs=0,za=!1,25<=f)throw Error(s(301));if(f+=1,rn=Et=null,t.updateQueue!=null){var g=t.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}Q.H=YE,g=r(o,l)}while(za);return g}function UE(){var t=Q.H,r=t.useState()[0];return r=typeof r.then=="function"?Ys(r):r,t=t.useState()[0],(Et===null?null:Et.memoizedState)!==t&&(Ye.flags|=1024),r}function Lf(){var t=kc!==0;return kc=0,t}function Af(t,r,o){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~o}function If(t){if(xc){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}xc=!1}Qi=0,rn=Et=Ye=null,za=!1,Xs=kc=0,Fa=null}function Vn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?Ye.memoizedState=rn=t:rn=rn.next=t,rn}function on(){if(Et===null){var t=Ye.alternate;t=t===null?null:t.memoizedState}else t=Et.next;var r=rn===null?Ye.memoizedState:rn.next;if(r!==null)rn=r,Et=t;else{if(t===null)throw Ye.alternate===null?Error(s(467)):Error(s(310));Et=t,t={memoizedState:Et.memoizedState,baseState:Et.baseState,baseQueue:Et.baseQueue,queue:Et.queue,next:null},rn===null?Ye.memoizedState=rn=t:rn=rn.next=t}return rn}function jf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ys(t){var r=Xs;return Xs+=1,Fa===null&&(Fa=[]),t=uv(Fa,t,r),r=Ye,(rn===null?r.memoizedState:rn.next)===null&&(r=r.alternate,Q.H=r===null||r.memoizedState===null?Yv:Zv),t}function Cc(t){if(typeof t=="object"&&t){if(typeof t.then=="function")return Ys(t);if(t.$$typeof===G)return Nn(t)}throw Error(s(438,String(t)))}function qf(t){var r=null,o=Ye.updateQueue;if(o!==null&&(r=o.memoCache),r==null){var l=Ye.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(f){return f.slice()}),index:0})))}if(r??(r={data:[],index:0}),o===null&&(o=jf(),Ye.updateQueue=o),o.memoCache=r,o=r.data[r.index],o===void 0)for(o=r.data[r.index]=Array(t),l=0;l<t;l++)o[l]=xe;return r.index++,o}function yi(t,r){return typeof r=="function"?r(t):r}function Sc(t){return zf(on(),Et,t)}function zf(t,r,o){var l=t.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=o;var f=t.baseQueue,g=l.pending;if(g!==null){if(f!==null){var S=f.next;f.next=g.next,g.next=S}r.baseQueue=f=g,l.pending=null}if(g=t.baseState,f===null)t.memoizedState=g;else{r=f.next;var D=S=null,F=null,re=r,pe=!1;do{var ve=re.lane&-536870913;if(ve===re.lane?(Qi&ve)===ve:(at&ve)===ve){var ae=re.revertLane;if(ae===0)F!==null&&(F=F.next={lane:0,revertLane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),ve===Ia&&(pe=!0);else if((Qi&ae)===ae){re=re.next,ae===Ia&&(pe=!0);continue}else ve={lane:0,revertLane:re.revertLane,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},F===null?(D=F=ve,S=g):F=F.next=ve,Ye.lanes|=ae,to|=ae;ve=re.action,Jo&&o(g,ve),g=re.hasEagerState?re.eagerState:o(g,ve)}else ae={lane:ve,revertLane:re.revertLane,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},F===null?(D=F=ae,S=g):F=F.next=ae,Ye.lanes|=ve,to|=ve;re=re.next}while(re!==null&&re!==r);if(F===null?S=g:F.next=D,!nr(g,t.memoizedState)&&(wn=!0,pe&&(o=ja,o!==null)))throw o;t.memoizedState=g,t.baseState=S,t.baseQueue=F,l.lastRenderedState=g}return f===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function Ff(t){var r=on(),o=r.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=t;var l=o.dispatch,f=o.pending,g=r.memoizedState;if(f!==null){o.pending=null;var S=f=f.next;do g=t(g,S.action),S=S.next;while(S!==f);nr(g,r.memoizedState)||(wn=!0),r.memoizedState=g,r.baseQueue===null&&(r.baseState=g),o.lastRenderedState=g}return[g,l]}function vv(t,r,o){var l=Ye,f=on(),g=mt;if(g){if(o===void 0)throw Error(s(407));o=o()}else o=r();var S=!nr((Et||f).memoizedState,o);if(S&&(f.memoizedState=o,wn=!0),f=f.queue,Zs(2048,8,_v.bind(null,l,f,t),[t]),f.getSnapshot!==r||S||rn!==null&&rn.memoizedState.tag&1){if(l.flags|=2048,Ba(9,Ec(),wv.bind(null,l,f,o,r),null),Lt===null)throw Error(s(349));g||Qi&124||bv(l,r,o)}return o}function bv(t,r,o){t.flags|=16384,t={getSnapshot:r,value:o},r=Ye.updateQueue,r===null?(r=jf(),Ye.updateQueue=r,r.stores=[t]):(o=r.stores,o===null?r.stores=[t]:o.push(t))}function wv(t,r,o,l){r.value=o,r.getSnapshot=l,xv(r)&&kv(t)}function _v(t,r,o){return o(function(){xv(r)&&kv(t)})}function xv(t){var r=t.getSnapshot;t=t.value;try{var o=r();return!nr(t,o)}catch{return!0}}function kv(t){var r=Na(t,2);r!==null&&sr(r,t,2)}function Bf(t){var r=Vn();if(typeof t=="function"){var o=t;if(t=o(),Jo){yt(!0);try{o()}finally{yt(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yi,lastRenderedState:t},r}function Cv(t,r,o,l){return t.baseState=o,zf(t,Et,typeof l=="function"?l:yi)}function KE(t,r,o,l,f){if(Rc(t))throw Error(s(485));if(t=r.action,t!==null){var g={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){g.listeners.push(S)}};Q.T===null?g.isTransition=!1:o(!0),l(g),o=r.pending,o===null?(g.next=r.pending=g,Sv(r,g)):(g.next=o.next,r.pending=o.next=g)}}function Sv(t,r){var o=r.action,l=r.payload,f=t.state;if(r.isTransition){var g=Q.T,S={};Q.T=S;try{var D=o(f,l),F=Q.S;F!==null&&F(S,D),Ev(t,r,D)}catch(re){Hf(t,r,re)}finally{Q.T=g}}else try{g=o(f,l),Ev(t,r,g)}catch(re){Hf(t,r,re)}}function Ev(t,r,o){typeof o=="object"&&o&&typeof o.then=="function"?o.then(function(l){Tv(t,r,l)},function(l){return Hf(t,r,l)}):Tv(t,r,o)}function Tv(t,r,o){r.status="fulfilled",r.value=o,Rv(r),t.state=o,r=t.pending,r!==null&&(o=r.next,o===r?t.pending=null:(o=o.next,r.next=o,Sv(t,o)))}function Hf(t,r,o){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=o,Rv(r),r=r.next;while(r!==l)}t.action=null}function Rv(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function Dv(t,r){return r}function Ov(t,r){if(mt){var o=Lt.formState;if(o!==null){e:{var l=Ye;if(mt){if(Wt){t:{for(var f=Wt,g=Xr;f.nodeType!==8;){if(!g){f=null;break t}if(f=qr(f.nextSibling),f===null){f=null;break t}}g=f.data,f=g==="F!"||g==="F"?f:null}if(f){Wt=qr(f.nextSibling),l=f.data==="F!";break e}}$o(l)}l=!1}l&&(r=o[0])}}return o=Vn(),o.memoizedState=o.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dv,lastRenderedState:r},o.queue=l,o=Gv.bind(null,Ye,l),l.dispatch=o,l=Bf(!1),g=Kf.bind(null,Ye,!1,l.queue),l=Vn(),f={state:r,dispatch:null,action:t,pending:null},l.queue=f,o=KE.bind(null,Ye,f,g,o),f.dispatch=o,l.memoizedState=t,[r,o,!1]}function Pv(t){return Nv(on(),Et,t)}function Nv(t,r,o){if(r=zf(t,r,Dv)[0],t=Sc(yi)[0],typeof r=="object"&&r&&typeof r.then=="function")try{var l=Ys(r)}catch(S){throw S===Us?bc:S}else l=r;r=on();var f=r.queue,g=f.dispatch;return o!==r.memoizedState&&(Ye.flags|=2048,Ba(9,Ec(),QE.bind(null,f,o),null)),[l,g,t]}function QE(t,r){t.action=r}function Mv(t){var r=on(),o=Et;if(o!==null)return Nv(r,o,t);on(),r=r.memoizedState,o=on();var l=o.queue.dispatch;return o.memoizedState=t,[r,l,!1]}function Ba(t,r,o,l){return t={tag:t,create:o,deps:l,inst:r,next:null},r=Ye.updateQueue,r===null&&(r=jf(),Ye.updateQueue=r),o=r.lastEffect,o===null?r.lastEffect=t.next=t:(l=o.next,o.next=t,t.next=l,r.lastEffect=t),t}function Ec(){return{destroy:void 0,resource:void 0}}function Lv(){return on().memoizedState}function Tc(t,r,o,l){var f=Vn();l=l===void 0?null:l,Ye.flags|=t,f.memoizedState=Ba(1|r,Ec(),o,l)}function Zs(t,r,o,l){var f=on();l=l===void 0?null:l;var g=f.memoizedState.inst;Et!==null&&l!==null&&Nf(l,Et.memoizedState.deps)?f.memoizedState=Ba(r,g,o,l):(Ye.flags|=t,f.memoizedState=Ba(1|r,g,o,l))}function Av(t,r){Tc(8390656,8,t,r)}function Iv(t,r){Zs(2048,8,t,r)}function jv(t,r){return Zs(4,2,t,r)}function qv(t,r){return Zs(4,4,t,r)}function zv(t,r){if(typeof r=="function"){t=t();var o=r(t);return function(){typeof o=="function"?o():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function Fv(t,r,o){o=o==null?null:o.concat([t]),Zs(4,4,zv.bind(null,r,t),o)}function Vf(){}function Bv(t,r){var o=on();r=r===void 0?null:r;var l=o.memoizedState;return r!==null&&Nf(r,l[1])?l[0]:(o.memoizedState=[t,r],t)}function Hv(t,r){var o=on();r=r===void 0?null:r;var l=o.memoizedState;if(r!==null&&Nf(r,l[1]))return l[0];if(l=t(),Jo){yt(!0);try{t()}finally{yt(!1)}}return o.memoizedState=[l,r],l}function $f(t,r,o){return o===void 0||Qi&1073741824?t.memoizedState=r:(t.memoizedState=o,t=H1(),Ye.lanes|=t,to|=t,o)}function Vv(t,r,o,l){return nr(o,r)?o:qa.current===null?Qi&42?(t=H1(),Ye.lanes|=t,to|=t,r):(wn=!0,t.memoizedState=o):(t=$f(t,o,l),nr(t,r)||(wn=!0),t)}function $v(t,r,o,l,f){var g=K.p;K.p=g!==0&&8>g?g:8;var S=Q.T,D={};Q.T=D,Kf(t,!1,r,o);try{var F=f(),re=Q.S;re!==null&&re(D,F),typeof F=="object"&&F&&typeof F.then=="function"?el(t,r,$E(F,l),_r(t)):el(t,r,l,_r(t))}catch(pe){el(t,r,{then:function(){},status:"rejected",reason:pe},_r())}finally{K.p=g,Q.T=S}}function GE(){}function Wf(t,r,o,l){if(t.tag!==5)throw Error(s(476));var f=Wv(t).queue;$v(t,f,r,Ne,o===null?GE:function(){return Uv(t),o(l)})}function Wv(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Ne,baseState:Ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yi,lastRenderedState:Ne},next:null};var o={};return r.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yi,lastRenderedState:o},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function Uv(t){var r=Wv(t).next.queue;el(t,r,{},_r())}function Uf(){return Nn(vl)}function Kv(){return on().memoizedState}function Qv(){return on().memoizedState}function JE(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var o=_r();t=Qo(o);var l=Go(r,t,o);l!==null&&(sr(l,r,o),Qs(l,r,o)),r={cache:xf()},t.payload=r;return}r=r.return}}function XE(t,r,o){var l=_r();o={lane:l,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},Rc(t)?Jv(r,o):(o=ff(t,r,o,l),o!==null&&(sr(o,t,l),Xv(o,r,l)))}function Gv(t,r,o){el(t,r,o,_r())}function el(t,r,o,l){var f={lane:l,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(Rc(t))Jv(r,f);else{var g=t.alternate;if(t.lanes===0&&(g===null||g.lanes===0)&&(g=r.lastRenderedReducer,g!==null))try{var S=r.lastRenderedState,D=g(S,o);if(f.hasEagerState=!0,f.eagerState=D,nr(D,S))return dc(t,r,f,0),Lt===null&&uc(),!1}catch{}if(o=ff(t,r,f,l),o!==null)return sr(o,t,l),Xv(o,r,l),!0}return!1}function Kf(t,r,o,l){if(l={lane:2,revertLane:Sp(),action:l,hasEagerState:!1,eagerState:null,next:null},Rc(t)){if(r)throw Error(s(479))}else r=ff(t,o,l,2),r!==null&&sr(r,t,2)}function Rc(t){var r=t.alternate;return t===Ye||r!==null&&r===Ye}function Jv(t,r){za=xc=!0;var o=t.pending;o===null?r.next=r:(r.next=o.next,o.next=r),t.pending=r}function Xv(t,r,o){if(o&4194048){var l=r.lanes;l&=t.pendingLanes,o|=l,r.lanes=o,In(t,o)}}var Dc={readContext:Nn,use:Cc,useCallback:Yt,useContext:Yt,useEffect:Yt,useImperativeHandle:Yt,useLayoutEffect:Yt,useInsertionEffect:Yt,useMemo:Yt,useReducer:Yt,useRef:Yt,useState:Yt,useDebugValue:Yt,useDeferredValue:Yt,useTransition:Yt,useSyncExternalStore:Yt,useId:Yt,useHostTransitionStatus:Yt,useFormState:Yt,useActionState:Yt,useOptimistic:Yt,useMemoCache:Yt,useCacheRefresh:Yt},Yv={readContext:Nn,use:Cc,useCallback:function(t,r){return Vn().memoizedState=[t,r===void 0?null:r],t},useContext:Nn,useEffect:Av,useImperativeHandle:function(t,r,o){o=o==null?null:o.concat([t]),Tc(4194308,4,zv.bind(null,r,t),o)},useLayoutEffect:function(t,r){return Tc(4194308,4,t,r)},useInsertionEffect:function(t,r){Tc(4,2,t,r)},useMemo:function(t,r){var o=Vn();r=r===void 0?null:r;var l=t();if(Jo){yt(!0);try{t()}finally{yt(!1)}}return o.memoizedState=[l,r],l},useReducer:function(t,r,o){var l=Vn();if(o!==void 0){var f=o(r);if(Jo){yt(!0);try{o(r)}finally{yt(!1)}}}else f=r;return l.memoizedState=l.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},l.queue=t,t=t.dispatch=XE.bind(null,Ye,t),[l.memoizedState,t]},useRef:function(t){var r=Vn();return t={current:t},r.memoizedState=t},useState:function(t){t=Bf(t);var r=t.queue,o=Gv.bind(null,Ye,r);return r.dispatch=o,[t.memoizedState,o]},useDebugValue:Vf,useDeferredValue:function(t,r){return $f(Vn(),t,r)},useTransition:function(){var t=Bf(!1);return t=$v.bind(null,Ye,t.queue,!0,!1),Vn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,o){var l=Ye,f=Vn();if(mt){if(o===void 0)throw Error(s(407));o=o()}else{if(o=r(),Lt===null)throw Error(s(349));at&124||bv(l,r,o)}f.memoizedState=o;var g={value:o,getSnapshot:r};return f.queue=g,Av(_v.bind(null,l,g,t),[t]),l.flags|=2048,Ba(9,Ec(),wv.bind(null,l,g,o,r),null),o},useId:function(){var t=Vn(),r=Lt.identifierPrefix;if(mt){var o=mi,l=pi;o=(l&~(1<<32-Ft(l)-1)).toString(32)+o,r="\xAB"+r+"R"+o,o=kc++,0<o&&(r+="H"+o.toString(32)),r+="\xBB"}else o=WE++,r="\xAB"+r+"r"+o.toString(32)+"\xBB";return t.memoizedState=r},useHostTransitionStatus:Uf,useFormState:Ov,useActionState:Ov,useOptimistic:function(t){var r=Vn();r.memoizedState=r.baseState=t;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=o,r=Kf.bind(null,Ye,!0,o),o.dispatch=r,[t,r]},useMemoCache:qf,useCacheRefresh:function(){return Vn().memoizedState=JE.bind(null,Ye)}},Zv={readContext:Nn,use:Cc,useCallback:Bv,useContext:Nn,useEffect:Iv,useImperativeHandle:Fv,useInsertionEffect:jv,useLayoutEffect:qv,useMemo:Hv,useReducer:Sc,useRef:Lv,useState:function(){return Sc(yi)},useDebugValue:Vf,useDeferredValue:function(t,r){return Vv(on(),Et.memoizedState,t,r)},useTransition:function(){var t=Sc(yi)[0],r=on().memoizedState;return[typeof t=="boolean"?t:Ys(t),r]},useSyncExternalStore:vv,useId:Kv,useHostTransitionStatus:Uf,useFormState:Pv,useActionState:Pv,useOptimistic:function(t,r){return Cv(on(),Et,t,r)},useMemoCache:qf,useCacheRefresh:Qv},YE={readContext:Nn,use:Cc,useCallback:Bv,useContext:Nn,useEffect:Iv,useImperativeHandle:Fv,useInsertionEffect:jv,useLayoutEffect:qv,useMemo:Hv,useReducer:Ff,useRef:Lv,useState:function(){return Ff(yi)},useDebugValue:Vf,useDeferredValue:function(t,r){var o=on();return Et===null?$f(o,t,r):Vv(o,Et.memoizedState,t,r)},useTransition:function(){var t=Ff(yi)[0],r=on().memoizedState;return[typeof t=="boolean"?t:Ys(t),r]},useSyncExternalStore:vv,useId:Kv,useHostTransitionStatus:Uf,useFormState:Mv,useActionState:Mv,useOptimistic:function(t,r){var o=on();return Et===null?(o.baseState=t,[t,o.queue.dispatch]):Cv(o,Et,t,r)},useMemoCache:qf,useCacheRefresh:Qv},Ha=null,tl=0;function Oc(t){var r=tl;return tl+=1,Ha===null&&(Ha=[]),uv(Ha,t,r)}function nl(t,r){r=r.props.ref,t.ref=r===void 0?null:r}function Pc(t,r){throw r.$$typeof===C?Error(s(525)):(t=Object.prototype.toString.call(r),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function e1(t){var r=t._init;return r(t._payload)}function t1(t){function r(J,W){if(t){var ee=J.deletions;ee===null?(J.deletions=[W],J.flags|=16):ee.push(W)}}function o(J,W){if(!t)return null;for(;W!==null;)r(J,W),W=W.sibling;return null}function l(J){for(var W=new Map;J!==null;)J.key===null?W.set(J.index,J):W.set(J.key,J),J=J.sibling;return W}function f(J,W){return J=fi(J,W),J.index=0,J.sibling=null,J}function g(J,W,ee){return J.index=ee,t?(ee=J.alternate,ee===null?(J.flags|=67108866,W):(ee=ee.index,ee<W?(J.flags|=67108866,W):ee)):(J.flags|=1048576,W)}function S(J){return t&&J.alternate===null&&(J.flags|=67108866),J}function D(J,W,ee,me){return W===null||W.tag!==6?(W=mf(ee,J.mode,me),W.return=J,W):(W=f(W,ee),W.return=J,W)}function F(J,W,ee,me){var Te=ee.type;return Te===A?pe(J,W,ee.props.children,me,ee.key):W!==null&&(W.elementType===Te||typeof Te=="object"&&Te&&Te.$$typeof===de&&e1(Te)===W.type)?(W=f(W,ee.props),nl(W,ee),W.return=J,W):(W=pc(ee.type,ee.key,ee.props,null,J.mode,me),nl(W,ee),W.return=J,W)}function re(J,W,ee,me){return W===null||W.tag!==4||W.stateNode.containerInfo!==ee.containerInfo||W.stateNode.implementation!==ee.implementation?(W=hf(ee,J.mode,me),W.return=J,W):(W=f(W,ee.children||[]),W.return=J,W)}function pe(J,W,ee,me,Te){return W===null||W.tag!==7?(W=Fo(ee,J.mode,me,Te),W.return=J,W):(W=f(W,ee),W.return=J,W)}function ve(J,W,ee){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return W=mf(""+W,J.mode,ee),W.return=J,W;if(typeof W=="object"&&W){switch(W.$$typeof){case E:return ee=pc(W.type,W.key,W.props,null,J.mode,ee),nl(ee,W),ee.return=J,ee;case R:return W=hf(W,J.mode,ee),W.return=J,W;case de:var me=W._init;return W=me(W._payload),ve(J,W,ee)}if(X(W)||be(W))return W=Fo(W,J.mode,ee,null),W.return=J,W;if(typeof W.then=="function")return ve(J,Oc(W),ee);if(W.$$typeof===G)return ve(J,yc(J,W),ee);Pc(J,W)}return null}function ae(J,W,ee,me){var Te=W===null?null:W.key;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Te===null?D(J,W,""+ee,me):null;if(typeof ee=="object"&&ee){switch(ee.$$typeof){case E:return ee.key===Te?F(J,W,ee,me):null;case R:return ee.key===Te?re(J,W,ee,me):null;case de:return Te=ee._init,ee=Te(ee._payload),ae(J,W,ee,me)}if(X(ee)||be(ee))return Te===null?pe(J,W,ee,me,null):null;if(typeof ee.then=="function")return ae(J,W,Oc(ee),me);if(ee.$$typeof===G)return ae(J,W,yc(J,ee),me);Pc(J,ee)}return null}function le(J,W,ee,me,Te){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return J=J.get(ee)||null,D(W,J,""+me,Te);if(typeof me=="object"&&me){switch(me.$$typeof){case E:return J=J.get(me.key===null?ee:me.key)||null,F(W,J,me,Te);case R:return J=J.get(me.key===null?ee:me.key)||null,re(W,J,me,Te);case de:var et=me._init;return me=et(me._payload),le(J,W,ee,me,Te)}if(X(me)||be(me))return J=J.get(ee)||null,pe(W,J,me,Te,null);if(typeof me.then=="function")return le(J,W,ee,Oc(me),Te);if(me.$$typeof===G)return le(J,W,ee,yc(W,me),Te);Pc(W,me)}return null}function qe(J,W,ee,me){for(var Te=null,et=null,Oe=W,Ae=W=0,xn=null;Oe!==null&&Ae<ee.length;Ae++){Oe.index>Ae?(xn=Oe,Oe=null):xn=Oe.sibling;var dt=ae(J,Oe,ee[Ae],me);if(dt===null){Oe===null&&(Oe=xn);break}t&&Oe&&dt.alternate===null&&r(J,Oe),W=g(dt,W,Ae),et===null?Te=dt:et.sibling=dt,et=dt,Oe=xn}if(Ae===ee.length)return o(J,Oe),mt&&Ho(J,Ae),Te;if(Oe===null){for(;Ae<ee.length;Ae++)Oe=ve(J,ee[Ae],me),Oe!==null&&(W=g(Oe,W,Ae),et===null?Te=Oe:et.sibling=Oe,et=Oe);return mt&&Ho(J,Ae),Te}for(Oe=l(Oe);Ae<ee.length;Ae++)xn=le(Oe,J,Ae,ee[Ae],me),xn!==null&&(t&&xn.alternate!==null&&Oe.delete(xn.key===null?Ae:xn.key),W=g(xn,W,Ae),et===null?Te=xn:et.sibling=xn,et=xn);return t&&Oe.forEach(function(uo){return r(J,uo)}),mt&&Ho(J,Ae),Te}function Le(J,W,ee,me){if(ee==null)throw Error(s(151));for(var Te=null,et=null,Oe=W,Ae=W=0,xn=null,dt=ee.next();Oe!==null&&!dt.done;Ae++,dt=ee.next()){Oe.index>Ae?(xn=Oe,Oe=null):xn=Oe.sibling;var uo=ae(J,Oe,dt.value,me);if(uo===null){Oe===null&&(Oe=xn);break}t&&Oe&&uo.alternate===null&&r(J,Oe),W=g(uo,W,Ae),et===null?Te=uo:et.sibling=uo,et=uo,Oe=xn}if(dt.done)return o(J,Oe),mt&&Ho(J,Ae),Te;if(Oe===null){for(;!dt.done;Ae++,dt=ee.next())dt=ve(J,dt.value,me),dt!==null&&(W=g(dt,W,Ae),et===null?Te=dt:et.sibling=dt,et=dt);return mt&&Ho(J,Ae),Te}for(Oe=l(Oe);!dt.done;Ae++,dt=ee.next())dt=le(Oe,J,Ae,dt.value,me),dt!==null&&(t&&dt.alternate!==null&&Oe.delete(dt.key===null?Ae:dt.key),W=g(dt,W,Ae),et===null?Te=dt:et.sibling=dt,et=dt);return t&&Oe.forEach(function(n3){return r(J,n3)}),mt&&Ho(J,Ae),Te}function Rt(J,W,ee,me){if(typeof ee=="object"&&ee&&ee.type===A&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee){switch(ee.$$typeof){case E:e:{for(var Te=ee.key;W!==null;){if(W.key===Te){if(Te=ee.type,Te===A){if(W.tag===7){o(J,W.sibling),me=f(W,ee.props.children),me.return=J,J=me;break e}}else if(W.elementType===Te||typeof Te=="object"&&Te&&Te.$$typeof===de&&e1(Te)===W.type){o(J,W.sibling),me=f(W,ee.props),nl(me,ee),me.return=J,J=me;break e}o(J,W);break}else r(J,W);W=W.sibling}ee.type===A?(me=Fo(ee.props.children,J.mode,me,ee.key),me.return=J,J=me):(me=pc(ee.type,ee.key,ee.props,null,J.mode,me),nl(me,ee),me.return=J,J=me)}return S(J);case R:e:{for(Te=ee.key;W!==null;){if(W.key===Te)if(W.tag===4&&W.stateNode.containerInfo===ee.containerInfo&&W.stateNode.implementation===ee.implementation){o(J,W.sibling),me=f(W,ee.children||[]),me.return=J,J=me;break e}else{o(J,W);break}else r(J,W);W=W.sibling}me=hf(ee,J.mode,me),me.return=J,J=me}return S(J);case de:return Te=ee._init,ee=Te(ee._payload),Rt(J,W,ee,me)}if(X(ee))return qe(J,W,ee,me);if(be(ee)){if(Te=be(ee),typeof Te!="function")throw Error(s(150));return ee=Te.call(ee),Le(J,W,ee,me)}if(typeof ee.then=="function")return Rt(J,W,Oc(ee),me);if(ee.$$typeof===G)return Rt(J,W,yc(J,ee),me);Pc(J,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,W!==null&&W.tag===6?(o(J,W.sibling),me=f(W,ee),me.return=J,J=me):(o(J,W),me=mf(ee,J.mode,me),me.return=J,J=me),S(J)):o(J,W)}return function(J,W,ee,me){try{tl=0;var Te=Rt(J,W,ee,me);return Ha=null,Te}catch(Oe){if(Oe===Us||Oe===bc)throw Oe;var et=rr(29,Oe,null,J.mode);return et.lanes=me,et.return=J,et}}}var Va=t1(!0),n1=t1(!1),br=Be(null),vi=null;function Gi(t){var r=t.alternate;Re(un,un.current&1),Re(br,t),vi===null&&(r===null||qa.current!==null||r.memoizedState!==null)&&(vi=t)}function r1(t){if(t.tag===22){if(Re(un,un.current),Re(br,t),vi===null){var r=t.alternate;r!==null&&r.memoizedState!==null&&(vi=t)}}else Ji(t)}function Ji(){Re(un,un.current),Re(br,br.current)}function bi(t){We(br),vi===t&&(vi=null),We(un)}var un=Be(0);function Nc(t){for(var r=t;r!==null;){if(r.tag===13){var o=r.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||Ip(o)))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if(r.flags&128)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}function Qf(t,r,o,l){r=t.memoizedState,o=o(l,r),o=o==null?r:_({},r,o),t.memoizedState=o,t.lanes===0&&(t.updateQueue.baseState=o)}var Gf={enqueueSetState:function(t,r,o){t=t._reactInternals;var l=_r(),f=Qo(l);f.payload=r,o!=null&&(f.callback=o),r=Go(t,f,l),r!==null&&(sr(r,t,l),Qs(r,t,l))},enqueueReplaceState:function(t,r,o){t=t._reactInternals;var l=_r(),f=Qo(l);f.tag=1,f.payload=r,o!=null&&(f.callback=o),r=Go(t,f,l),r!==null&&(sr(r,t,l),Qs(r,t,l))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var o=_r(),l=Qo(o);l.tag=2,r!=null&&(l.callback=r),r=Go(t,l,o),r!==null&&(sr(r,t,o),Qs(r,t,o))}};function i1(t,r,o,l,f,g,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,g,S):r.prototype&&r.prototype.isPureReactComponent?!qs(o,l)||!qs(f,g):!0}function o1(t,r,o,l){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(o,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(o,l),r.state!==t&&Gf.enqueueReplaceState(r,r.state,null)}function Xo(t,r){var o=r;if("ref"in r)for(var l in o={},r)l!=="ref"&&(o[l]=r[l]);if(t=t.defaultProps)for(var f in o===r&&(o=_({},o)),t)o[f]===void 0&&(o[f]=t[f]);return o}var Mc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function ZE(t){Mc(t)}function eT(t){console.error(t)}function tT(t){Mc(t)}function Lc(t,r){try{var o=t.onUncaughtError;o(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function a1(t,r,o){try{var l=t.onCaughtError;l(o.value,{componentStack:o.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Jf(t,r,o){return o=Qo(o),o.tag=3,o.payload={element:null},o.callback=function(){Lc(t,r)},o}function s1(t){return t=Qo(t),t.tag=3,t}function l1(t,r,o,l){var f=o.type.getDerivedStateFromError;if(typeof f=="function"){var g=l.value;t.payload=function(){return f(g)},t.callback=function(){a1(r,o,l)}}var S=o.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){a1(r,o,l),typeof f!="function"&&(no===null?no=new Set([this]):no.add(this));var D=l.stack;this.componentDidCatch(l.value,{componentStack:D===null?"":D})})}function nT(t,r,o,l,f){if(o.flags|=32768,typeof l=="object"&&l&&typeof l.then=="function"){if(r=o.alternate,r!==null&&Vs(r,o,f,!0),o=br.current,o!==null){switch(o.tag){case 13:return vi===null?wp():o.alternate===null&&Ut===0&&(Ut=3),o.flags&=-257,o.flags|=65536,o.lanes=f,l===Sf?o.flags|=16384:(r=o.updateQueue,r===null?o.updateQueue=new Set([l]):r.add(l),xp(t,l,f)),!1;case 22:return o.flags|=65536,l===Sf?o.flags|=16384:(r=o.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},o.updateQueue=r):(o=r.retryQueue,o===null?r.retryQueue=new Set([l]):o.add(l)),xp(t,l,f)),!1}throw Error(s(435,o.tag))}return xp(t,l,f),wp(),!1}if(mt)return r=br.current,r===null?(l!==vf&&(r=Error(s(423),{cause:l}),Hs(hr(r,o))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,l=hr(l,o),f=Jf(t.stateNode,l,f),Rf(t,f),Ut!==4&&(Ut=2)):(!(r.flags&65536)&&(r.flags|=256),r.flags|=65536,r.lanes=f,l!==vf&&(t=Error(s(422),{cause:l}),Hs(hr(t,o)))),!1;var g=Error(s(520),{cause:l});if(g=hr(g,o),cl===null?cl=[g]:cl.push(g),Ut!==4&&(Ut=2),r===null)return!0;l=hr(l,o),o=r;do{switch(o.tag){case 3:return o.flags|=65536,t=f&-f,o.lanes|=t,t=Jf(o.stateNode,l,t),Rf(o,t),!1;case 1:if(r=o.type,g=o.stateNode,!(o.flags&128)&&(typeof r.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(no===null||!no.has(g))))return o.flags|=65536,f&=-f,o.lanes|=f,f=s1(f),l1(f,t,o,l),Rf(o,f),!1}o=o.return}while(o!==null);return!1}var c1=Error(s(461)),wn=!1;function Cn(t,r,o,l){r.child=t===null?n1(r,null,o,l):Va(r,t.child,o,l)}function u1(t,r,o,l,f){o=o.render;var g=r.ref;if("ref"in l){var S={};for(var D in l)D!=="ref"&&(S[D]=l[D])}else S=l;return Uo(r),l=Mf(t,r,o,S,g,f),D=Lf(),t!==null&&!wn?(Af(t,r,f),wi(t,r,f)):(mt&&D&&gf(r),r.flags|=1,Cn(t,r,l,f),r.child)}function d1(t,r,o,l,f){if(t===null){var g=o.type;return typeof g=="function"&&!pf(g)&&g.defaultProps===void 0&&o.compare===null?(r.tag=15,r.type=g,f1(t,r,g,l,f)):(t=pc(o.type,null,l,r,r.mode,f),t.ref=r.ref,t.return=r,r.child=t)}if(g=t.child,!ip(t,f)){var S=g.memoizedProps;if(o=o.compare,o=o===null?qs:o,o(S,l)&&t.ref===r.ref)return wi(t,r,f)}return r.flags|=1,t=fi(g,l),t.ref=r.ref,t.return=r,r.child=t}function f1(t,r,o,l,f){if(t!==null){var g=t.memoizedProps;if(qs(g,l)&&t.ref===r.ref)if(wn=!1,r.pendingProps=l=g,ip(t,f))t.flags&131072&&(wn=!0);else return r.lanes=t.lanes,wi(t,r,f)}return Xf(t,r,o,l,f)}function p1(t,r,o){var l=r.pendingProps,f=l.children,g=t===null?null:t.memoizedState;if(l.mode==="hidden"){if(r.flags&128){if(l=g===null?o:g.baseLanes|o,t!==null){for(f=r.child=t.child,g=0;f!==null;)g=g|f.lanes|f.childLanes,f=f.sibling;r.childLanes=g&~l}else r.childLanes=0,r.child=null;return m1(t,r,l,o)}if(o&536870912)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&vc(r,g===null?null:g.cachePool),g===null?Of():hv(r,g),r1(r);else return r.lanes=r.childLanes=536870912,m1(t,r,g===null?o:g.baseLanes|o,o)}else g===null?(t!==null&&vc(r,null),Of(),Ji(r)):(vc(r,g.cachePool),hv(r,g),Ji(r),r.memoizedState=null);return Cn(t,r,f,o),r.child}function m1(t,r,o,l){var f=Cf();return f=f===null?null:{parent:cn._currentValue,pool:f},r.memoizedState={baseLanes:o,cachePool:f},t!==null&&vc(r,null),Of(),r1(r),t!==null&&Vs(t,r,l,!0),null}function Ac(t,r){var o=r.ref;if(o===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(s(284));(t===null||t.ref!==o)&&(r.flags|=4194816)}}function Xf(t,r,o,l,f){return Uo(r),o=Mf(t,r,o,l,void 0,f),l=Lf(),t!==null&&!wn?(Af(t,r,f),wi(t,r,f)):(mt&&l&&gf(r),r.flags|=1,Cn(t,r,o,f),r.child)}function h1(t,r,o,l,f,g){return Uo(r),r.updateQueue=null,o=yv(r,l,o,f),gv(t),l=Lf(),t!==null&&!wn?(Af(t,r,g),wi(t,r,g)):(mt&&l&&gf(r),r.flags|=1,Cn(t,r,o,g),r.child)}function g1(t,r,o,l,f){if(Uo(r),r.stateNode===null){var g=Ma,S=o.contextType;typeof S=="object"&&S&&(g=Nn(S)),g=new o(l,g),r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Gf,r.stateNode=g,g._reactInternals=r,g=r.stateNode,g.props=l,g.state=r.memoizedState,g.refs={},Ef(r),S=o.contextType,g.context=typeof S=="object"&&S?Nn(S):Ma,g.state=r.memoizedState,S=o.getDerivedStateFromProps,typeof S=="function"&&(Qf(r,o,S,l),g.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(S=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),S!==g.state&&Gf.enqueueReplaceState(g,g.state,null),Js(r,l,g,f),Gs(),g.state=r.memoizedState),typeof g.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(t===null){g=r.stateNode;var D=r.memoizedProps,F=Xo(o,D);g.props=F;var re=g.context,pe=o.contextType;S=Ma,typeof pe=="object"&&pe&&(S=Nn(pe));var ve=o.getDerivedStateFromProps;pe=typeof ve=="function"||typeof g.getSnapshotBeforeUpdate=="function",D=r.pendingProps!==D,pe||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(D||re!==S)&&o1(r,g,l,S),Ki=!1;var ae=r.memoizedState;g.state=ae,Js(r,l,g,f),Gs(),re=r.memoizedState,D||ae!==re||Ki?(typeof ve=="function"&&(Qf(r,o,ve,l),re=r.memoizedState),(F=Ki||i1(r,o,F,l,ae,re,S))?(pe||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(r.flags|=4194308)):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=re),g.props=l,g.state=re,g.context=S,l=F):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{g=r.stateNode,Tf(t,r),S=r.memoizedProps,pe=Xo(o,S),g.props=pe,ve=r.pendingProps,ae=g.context,re=o.contextType,F=Ma,typeof re=="object"&&re&&(F=Nn(re)),D=o.getDerivedStateFromProps,(re=typeof D=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(S!==ve||ae!==F)&&o1(r,g,l,F),Ki=!1,ae=r.memoizedState,g.state=ae,Js(r,l,g,f),Gs();var le=r.memoizedState;S!==ve||ae!==le||Ki||t!==null&&t.dependencies!==null&&gc(t.dependencies)?(typeof D=="function"&&(Qf(r,o,D,l),le=r.memoizedState),(pe=Ki||i1(r,o,pe,l,ae,le,F)||t!==null&&t.dependencies!==null&&gc(t.dependencies))?(re||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(l,le,F),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(l,le,F)),typeof g.componentDidUpdate=="function"&&(r.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof g.componentDidUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=le),g.props=l,g.state=le,g.context=F,l=pe):(typeof g.componentDidUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=1024),l=!1)}return g=l,Ac(t,r),l=(r.flags&128)!=0,g||l?(g=r.stateNode,o=l&&typeof o.getDerivedStateFromError!="function"?null:g.render(),r.flags|=1,t!==null&&l?(r.child=Va(r,t.child,null,f),r.child=Va(r,null,o,f)):Cn(t,r,o,f),r.memoizedState=g.state,t=r.child):t=wi(t,r,f),t}function y1(t,r,o,l){return Bs(),r.flags|=256,Cn(t,r,o,l),r.child}var Yf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zf(t){return{baseLanes:t,cachePool:sv()}}function ep(t,r,o){return t=t===null?0:t.childLanes&~o,r&&(t|=wr),t}function v1(t,r,o){var l=r.pendingProps,f=!1,g=(r.flags&128)!=0,S;if((S=g)||(S=t!==null&&t.memoizedState===null?!1:(un.current&2)!=0),S&&(f=!0,r.flags&=-129),S=(r.flags&32)!=0,r.flags&=-33,t===null){if(mt){if(f?Gi(r):Ji(r),mt){var D=Wt,F;if(F=D){e:{for(F=D,D=Xr;F.nodeType!==8;){if(!D){D=null;break e}if(F=qr(F.nextSibling),F===null){D=null;break e}}D=F}D===null?F=!1:(r.memoizedState={dehydrated:D,treeContext:Bo===null?null:{id:pi,overflow:mi},retryLane:536870912,hydrationErrors:null},F=rr(18,null,null,0),F.stateNode=D,F.return=r,r.child=F,jn=r,Wt=null,F=!0)}F||$o(r)}if(D=r.memoizedState,D!==null&&(D=D.dehydrated,D!==null))return Ip(D)?r.lanes=32:r.lanes=536870912,null;bi(r)}return D=l.children,l=l.fallback,f?(Ji(r),f=r.mode,D=Ic({mode:"hidden",children:D},f),l=Fo(l,f,o,null),D.return=r,l.return=r,D.sibling=l,r.child=D,f=r.child,f.memoizedState=Zf(o),f.childLanes=ep(t,S,o),r.memoizedState=Yf,l):(Gi(r),tp(r,D))}if(F=t.memoizedState,F!==null&&(D=F.dehydrated,D!==null)){if(g)r.flags&256?(Gi(r),r.flags&=-257,r=np(t,r,o)):r.memoizedState===null?(Ji(r),f=l.fallback,D=r.mode,l=Ic({mode:"visible",children:l.children},D),f=Fo(f,D,o,null),f.flags|=2,l.return=r,f.return=r,l.sibling=f,r.child=l,Va(r,t.child,null,o),l=r.child,l.memoizedState=Zf(o),l.childLanes=ep(t,S,o),r.memoizedState=Yf,r=f):(Ji(r),r.child=t.child,r.flags|=128,r=null);else if(Gi(r),Ip(D)){if(S=D.nextSibling&&D.nextSibling.dataset,S)var re=S.dgst;S=re,l=Error(s(419)),l.stack="",l.digest=S,Hs({value:l,source:null,stack:null}),r=np(t,r,o)}else if(wn||Vs(t,r,o,!1),S=(o&t.childLanes)!==0,wn||S){if(S=Lt,S!==null&&(l=o&-o,l=l&42?1:Bn(l),l=(l&(S.suspendedLanes|o))===0?l:0,l!==0&&l!==F.retryLane))throw F.retryLane=l,Na(t,l),sr(S,t,l),c1;D.data==="$?"||wp(),r=np(t,r,o)}else D.data==="$?"?(r.flags|=192,r.child=t.child,r=null):(t=F.treeContext,Wt=qr(D.nextSibling),jn=r,mt=!0,Vo=null,Xr=!1,t!==null&&(yr[vr++]=pi,yr[vr++]=mi,yr[vr++]=Bo,pi=t.id,mi=t.overflow,Bo=r),r=tp(r,l.children),r.flags|=4096);return r}return f?(Ji(r),f=l.fallback,D=r.mode,F=t.child,re=F.sibling,l=fi(F,{mode:"hidden",children:l.children}),l.subtreeFlags=F.subtreeFlags&65011712,re===null?(f=Fo(f,D,o,null),f.flags|=2):f=fi(re,f),f.return=r,l.return=r,l.sibling=f,r.child=l,l=f,f=r.child,D=t.child.memoizedState,D===null?D=Zf(o):(F=D.cachePool,F===null?F=sv():(re=cn._currentValue,F=F.parent===re?F:{parent:re,pool:re}),D={baseLanes:D.baseLanes|o,cachePool:F}),f.memoizedState=D,f.childLanes=ep(t,S,o),r.memoizedState=Yf,l):(Gi(r),o=t.child,t=o.sibling,o=fi(o,{mode:"visible",children:l.children}),o.return=r,o.sibling=null,t!==null&&(S=r.deletions,S===null?(r.deletions=[t],r.flags|=16):S.push(t)),r.child=o,r.memoizedState=null,o)}function tp(t,r){return r=Ic({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function Ic(t,r){return t=rr(22,t,null,r),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function np(t,r,o){return Va(r,t.child,null,o),t=tp(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function b1(t,r,o){t.lanes|=r;var l=t.alternate;l!==null&&(l.lanes|=r),wf(t.return,r,o)}function rp(t,r,o,l,f){var g=t.memoizedState;g===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:f}:(g.isBackwards=r,g.rendering=null,g.renderingStartTime=0,g.last=l,g.tail=o,g.tailMode=f)}function w1(t,r,o){var l=r.pendingProps,f=l.revealOrder,g=l.tail;if(Cn(t,r,l.children,o),l=un.current,l&2)l=l&1|2,r.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&b1(t,o,r);else if(t.tag===19)b1(t,o,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}l&=1}switch(Re(un,l),f){case"forwards":for(o=r.child,f=null;o!==null;)t=o.alternate,t!==null&&Nc(t)===null&&(f=o),o=o.sibling;o=f,o===null?(f=r.child,r.child=null):(f=o.sibling,o.sibling=null),rp(r,!1,f,o,g);break;case"backwards":for(o=null,f=r.child,r.child=null;f!==null;){if(t=f.alternate,t!==null&&Nc(t)===null){r.child=f;break}t=f.sibling,f.sibling=o,o=f,f=t}rp(r,!0,o,null,g);break;case"together":rp(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function wi(t,r,o){if(t!==null&&(r.dependencies=t.dependencies),to|=r.lanes,(o&r.childLanes)===0)if(t!==null){if(Vs(t,r,o,!1),(o&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(s(153));if(r.child!==null){for(t=r.child,o=fi(t,t.pendingProps),r.child=o,o.return=r;t.sibling!==null;)t=t.sibling,o=o.sibling=fi(t,t.pendingProps),o.return=r;o.sibling=null}return r.child}function ip(t,r){return(t.lanes&r)===0?(t=t.dependencies,!!(t!==null&&gc(t))):!0}function rT(t,r,o){switch(r.tag){case 3:sn(r,r.stateNode.containerInfo),Ui(r,cn,t.memoizedState.cache),Bs();break;case 27:case 5:tn(r);break;case 4:sn(r,r.stateNode.containerInfo);break;case 10:Ui(r,r.type,r.memoizedProps.value);break;case 13:var l=r.memoizedState;if(l!==null)return l.dehydrated===null?(o&r.child.childLanes)===0?(Gi(r),t=wi(t,r,o),t===null?null:t.sibling):v1(t,r,o):(Gi(r),r.flags|=128,null);Gi(r);break;case 19:var f=(t.flags&128)!=0;if(l=(o&r.childLanes)!==0,l||(l=(Vs(t,r,o,!1),(o&r.childLanes)!==0)),f){if(l)return w1(t,r,o);r.flags|=128}if(f=r.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Re(un,un.current),l)break;return null;case 22:case 23:return r.lanes=0,p1(t,r,o);case 24:Ui(r,cn,t.memoizedState.cache)}return wi(t,r,o)}function _1(t,r,o){if(t!==null)if(t.memoizedProps!==r.pendingProps)wn=!0;else{if(!ip(t,o)&&!(r.flags&128))return wn=!1,rT(t,r,o);wn=!!(t.flags&131072)}else wn=!1,mt&&r.flags&1048576&&ev(r,hc,r.index);switch(r.lanes=0,r.tag){case 16:e:{t=r.pendingProps;var l=r.elementType,f=l._init;if(l=f(l._payload),r.type=l,typeof l=="function")pf(l)?(t=Xo(l,t),r.tag=1,r=g1(null,r,l,t,o)):(r.tag=0,r=Xf(null,r,l,t,o));else{if(l!=null){if(f=l.$$typeof,f===he){r.tag=11,r=u1(null,r,l,t,o);break e}else if(f===$){r.tag=14,r=d1(null,r,l,t,o);break e}}throw r=ie(l)||l,Error(s(306,r,""))}}return r;case 0:return Xf(t,r,r.type,r.pendingProps,o);case 1:return l=r.type,f=Xo(l,r.pendingProps),g1(t,r,l,f,o);case 3:e:{if(sn(r,r.stateNode.containerInfo),t===null)throw Error(s(387));l=r.pendingProps;var g=r.memoizedState;f=g.element,Tf(t,r),Js(r,l,null,o);var S=r.memoizedState;if(l=S.cache,Ui(r,cn,l),l!==g.cache&&_f(r,[cn],o,!0),Gs(),l=S.element,g.isDehydrated)if(g={element:l,isDehydrated:!1,cache:S.cache},r.updateQueue.baseState=g,r.memoizedState=g,r.flags&256){r=y1(t,r,l,o);break e}else if(l!==f){f=hr(Error(s(424)),r),Hs(f),r=y1(t,r,l,o);break e}else{switch(t=r.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Wt=qr(t.firstChild),jn=r,mt=!0,Vo=null,Xr=!0,o=n1(r,null,l,o),r.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(Bs(),l===f){r=wi(t,r,o);break e}Cn(t,r,l,o)}r=r.child}return r;case 26:return Ac(t,r),t===null?(o=Eb(r.type,null,r.pendingProps,null))?r.memoizedState=o:mt||(o=r.type,t=r.pendingProps,l=Jc(It.current).createElement(o),l[bt]=r,l[jt]=t,En(l,o,t),He(l),r.stateNode=l):r.memoizedState=Eb(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return tn(r),t===null&&mt&&(l=r.stateNode=kb(r.type,r.pendingProps,It.current),jn=r,Xr=!0,f=Wt,oo(r.type)?(jp=f,Wt=qr(l.firstChild)):Wt=f),Cn(t,r,r.pendingProps.children,o),Ac(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&mt&&((f=l=Wt)&&(l=DT(l,r.type,r.pendingProps,Xr),l===null?f=!1:(r.stateNode=l,jn=r,Wt=qr(l.firstChild),Xr=!1,f=!0)),f||$o(r)),tn(r),f=r.type,g=r.pendingProps,S=t===null?null:t.memoizedProps,l=g.children,Mp(f,g)?l=null:S!==null&&Mp(f,S)&&(r.flags|=32),r.memoizedState!==null&&(f=Mf(t,r,UE,null,null,o),vl._currentValue=f),Ac(t,r),Cn(t,r,l,o),r.child;case 6:return t===null&&mt&&((t=o=Wt)&&(o=OT(o,r.pendingProps,Xr),o===null?t=!1:(r.stateNode=o,jn=r,Wt=null,t=!0)),t||$o(r)),null;case 13:return v1(t,r,o);case 4:return sn(r,r.stateNode.containerInfo),l=r.pendingProps,t===null?r.child=Va(r,null,l,o):Cn(t,r,l,o),r.child;case 11:return u1(t,r,r.type,r.pendingProps,o);case 7:return Cn(t,r,r.pendingProps,o),r.child;case 8:return Cn(t,r,r.pendingProps.children,o),r.child;case 12:return Cn(t,r,r.pendingProps.children,o),r.child;case 10:return l=r.pendingProps,Ui(r,r.type,l.value),Cn(t,r,l.children,o),r.child;case 9:return f=r.type._context,l=r.pendingProps.children,Uo(r),f=Nn(f),l=l(f),r.flags|=1,Cn(t,r,l,o),r.child;case 14:return d1(t,r,r.type,r.pendingProps,o);case 15:return f1(t,r,r.type,r.pendingProps,o);case 19:return w1(t,r,o);case 31:return l=r.pendingProps,o=r.mode,l={mode:l.mode,children:l.children},t===null?(o=Ic(l,o),o.ref=r.ref,r.child=o,o.return=r,r=o):(o=fi(t.child,l),o.ref=r.ref,r.child=o,o.return=r,r=o),r;case 22:return p1(t,r,o);case 24:return Uo(r),l=Nn(cn),t===null?(f=Cf(),f===null&&(f=Lt,g=xf(),f.pooledCache=g,g.refCount++,g!==null&&(f.pooledCacheLanes|=o),f=g),r.memoizedState={parent:l,cache:f},Ef(r),Ui(r,cn,f)):((t.lanes&o)!==0&&(Tf(t,r),Js(r,null,null,o),Gs()),f=t.memoizedState,g=r.memoizedState,f.parent===l?(l=g.cache,Ui(r,cn,l),l!==f.cache&&_f(r,[cn],o,!0)):(f={parent:l,cache:l},r.memoizedState=f,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=f),Ui(r,cn,l))),Cn(t,r,r.pendingProps.children,o),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function _i(t){t.flags|=4}function x1(t,r){if(r.type!=="stylesheet"||r.state.loading&4)t.flags&=-16777217;else if(t.flags|=16777216,!Pb(r)){if(r=br.current,r!==null&&((at&4194048)===at?vi!==null:(at&62914560)!==at&&!(at&536870912)||r!==vi))throw Ks=Sf,lv;t.flags|=8192}}function jc(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag===22?536870912:Wr(),t.lanes|=r,Ka|=r)}function rl(t,r){if(!mt)switch(t.tailMode){case"hidden":r=t.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?t.tail=null:o.sibling=null;break;case"collapsed":o=t.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function Bt(t){var r=t.alternate!==null&&t.alternate.child===t.child,o=0,l=0;if(r)for(var f=t.child;f!==null;)o|=f.lanes|f.childLanes,l|=f.subtreeFlags&65011712,l|=f.flags&65011712,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)o|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=l,t.childLanes=o,r}function iT(t,r,o){var l=r.pendingProps;switch(yf(r),r.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bt(r),null;case 1:return Bt(r),null;case 3:return o=r.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),gi(cn),Ue(),o.pendingContext&&(o.pendingContext=(o.context=o.pendingContext,null)),(t===null||t.child===null)&&(Fs(r)?_i(r):t===null||t.memoizedState.isDehydrated&&!(r.flags&256)||(r.flags|=1024,rv())),Bt(r),null;case 26:return o=r.memoizedState,t===null?(_i(r),o===null?(Bt(r),r.flags&=-16777217):(Bt(r),x1(r,o))):o?o===t.memoizedState?(Bt(r),r.flags&=-16777217):(_i(r),Bt(r),x1(r,o)):(t.memoizedProps!==l&&_i(r),Bt(r),r.flags&=-16777217),null;case 27:gt(r),o=It.current;var f=r.type;if(t!==null&&r.stateNode!=null)t.memoizedProps!==l&&_i(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Bt(r),null}t=Me.current,Fs(r)?tv(r,t):(t=kb(f,l,o),r.stateNode=t,_i(r))}return Bt(r),null;case 5:if(gt(r),o=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&_i(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Bt(r),null}if(t=Me.current,Fs(r))tv(r,t);else{switch(f=Jc(It.current),t){case 1:t=f.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:t=f.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":t=f.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":t=f.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":t=f.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof l.is=="string"?f.createElement("select",{is:l.is}):f.createElement("select"),l.multiple?t.multiple=!0:l.size&&(t.size=l.size);break;default:t=typeof l.is=="string"?f.createElement(o,{is:l.is}):f.createElement(o)}}t[bt]=r,t[jt]=l;e:for(f=r.child;f!==null;){if(f.tag===5||f.tag===6)t.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===r)break e;for(;f.sibling===null;){if(f.return===null||f.return===r)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}r.stateNode=t;e:switch(En(t,o,l),o){case"button":case"input":case"select":case"textarea":t=!!l.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&_i(r)}}return Bt(r),r.flags&=-16777217,null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==l&&_i(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(t=It.current,Fs(r)){if(t=r.stateNode,o=r.memoizedProps,l=null,f=jn,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}t[bt]=r,t=!!(t.nodeValue===o||l!==null&&l.suppressHydrationWarning===!0||gb(t.nodeValue,o)),t||$o(r)}else t=Jc(t).createTextNode(l),t[bt]=r,r.stateNode=t}return Bt(r),null;case 13:if(l=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=Fs(r),l!==null&&l.dehydrated!==null){if(t===null){if(!f)throw Error(s(318));if(f=r.memoizedState,f=f===null?null:f.dehydrated,!f)throw Error(s(317));f[bt]=r}else Bs(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;Bt(r),f=!1}else f=rv(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return r.flags&256?(bi(r),r):(bi(r),null)}if(bi(r),r.flags&128)return r.lanes=o,r;if(o=l!==null,t=t!==null&&t.memoizedState!==null,o){l=r.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool);var g=null;l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),g!==f&&(l.flags|=2048)}return o!==t&&o&&(r.child.flags|=8192),jc(r,r.updateQueue),Bt(r),null;case 4:return Ue(),t===null&&fb(r.stateNode.containerInfo),Bt(r),null;case 10:return gi(r.type),Bt(r),null;case 19:if(We(un),f=r.memoizedState,f===null)return Bt(r),null;if(l=(r.flags&128)!=0,g=f.rendering,g===null)if(l)rl(f,!1);else{if(Ut!==0||t!==null&&t.flags&128)for(t=r.child;t!==null;){if(g=Nc(t),g!==null){for(r.flags|=128,rl(f,!1),t=g.updateQueue,r.updateQueue=t,jc(r,t),r.subtreeFlags=0,t=o,o=r.child;o!==null;)Zy(o,t),o=o.sibling;return Re(un,un.current&1|2),r.child}t=t.sibling}f.tail!==null&&vn()>Fc&&(r.flags|=128,l=!0,rl(f,!1),r.lanes=4194304)}else{if(!l)if(t=Nc(g),t!==null){if(r.flags|=128,l=!0,t=t.updateQueue,r.updateQueue=t,jc(r,t),rl(f,!0),f.tail===null&&f.tailMode==="hidden"&&!g.alternate&&!mt)return Bt(r),null}else 2*vn()-f.renderingStartTime>Fc&&o!==536870912&&(r.flags|=128,l=!0,rl(f,!1),r.lanes=4194304);f.isBackwards?(g.sibling=r.child,r.child=g):(t=f.last,t===null?r.child=g:t.sibling=g,f.last=g)}return f.tail===null?(Bt(r),null):(r=f.tail,f.rendering=r,f.tail=r.sibling,f.renderingStartTime=vn(),r.sibling=null,t=un.current,Re(un,l?t&1|2:t&1),r);case 22:case 23:return bi(r),Pf(),l=r.memoizedState!==null,t===null?l&&(r.flags|=8192):t.memoizedState!==null!==l&&(r.flags|=8192),l?o&536870912&&!(r.flags&128)&&(Bt(r),r.subtreeFlags&6&&(r.flags|=8192)):Bt(r),o=r.updateQueue,o!==null&&jc(r,o.retryQueue),o=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==o&&(r.flags|=2048),t!==null&&We(Ko),null;case 24:return o=null,t!==null&&(o=t.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),gi(cn),Bt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function oT(t,r){switch(yf(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return gi(cn),Ue(),t=r.flags,t&65536&&!(t&128)?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return gt(r),null;case 13:if(bi(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Bs()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return We(un),null;case 4:return Ue(),null;case 10:return gi(r.type),null;case 22:case 23:return bi(r),Pf(),t!==null&&We(Ko),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return gi(cn),null;case 25:return null;default:return null}}function k1(t,r){switch(yf(r),r.tag){case 3:gi(cn),Ue();break;case 26:case 27:case 5:gt(r);break;case 4:Ue();break;case 13:bi(r);break;case 19:We(un);break;case 10:gi(r.type);break;case 22:case 23:bi(r),Pf(),t!==null&&We(Ko);break;case 24:gi(cn)}}function il(t,r){try{var o=r.updateQueue,l=o===null?null:o.lastEffect;if(l!==null){var f=l.next;o=f;do{if((o.tag&t)===t){l=void 0;var g=o.create,S=o.inst;l=g(),S.destroy=l}o=o.next}while(o!==f)}}catch(D){Nt(r,r.return,D)}}function Xi(t,r,o){try{var l=r.updateQueue,f=l===null?null:l.lastEffect;if(f!==null){var g=f.next;l=g;do{if((l.tag&t)===t){var S=l.inst,D=S.destroy;if(D!==void 0){S.destroy=void 0,f=r;var F=o,re=D;try{re()}catch(pe){Nt(f,F,pe)}}}l=l.next}while(l!==g)}}catch(pe){Nt(r,r.return,pe)}}function C1(t){var r=t.updateQueue;if(r!==null){var o=t.stateNode;try{mv(r,o)}catch(l){Nt(t,t.return,l)}}}function S1(t,r,o){o.props=Xo(t.type,t.memoizedProps),o.state=t.memoizedState;try{o.componentWillUnmount()}catch(l){Nt(t,r,l)}}function ol(t,r){try{var o=t.ref;if(o!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof o=="function"?t.refCleanup=o(l):o.current=l}}catch(f){Nt(t,r,f)}}function Yr(t,r){var o=t.ref,l=t.refCleanup;if(o!==null)if(typeof l=="function")try{l()}catch(f){Nt(t,r,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(f){Nt(t,r,f)}else o.current=null}function E1(t){var r=t.type,o=t.memoizedProps,l=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":o.autoFocus&&l.focus();break e;case"img":o.src?l.src=o.src:o.srcSet&&(l.srcset=o.srcSet)}}catch(f){Nt(t,t.return,f)}}function op(t,r,o){try{var l=t.stateNode;CT(l,t.type,o,r),l[jt]=r}catch(f){Nt(t,t.return,f)}}function T1(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&oo(t.type)||t.tag===4}function ap(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||T1(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&oo(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function sp(t,r,o){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(t,r):(r=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,r.appendChild(t),o=o._reactRootContainer,o!=null||r.onclick!==null||(r.onclick=Gc));else if(l!==4&&(l===27&&oo(t.type)&&(o=t.stateNode,r=null),t=t.child,t!==null))for(sp(t,r,o),t=t.sibling;t!==null;)sp(t,r,o),t=t.sibling}function qc(t,r,o){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?o.insertBefore(t,r):o.appendChild(t);else if(l!==4&&(l===27&&oo(t.type)&&(o=t.stateNode),t=t.child,t!==null))for(qc(t,r,o),t=t.sibling;t!==null;)qc(t,r,o),t=t.sibling}function R1(t){var r=t.stateNode,o=t.memoizedProps;try{for(var l=t.type,f=r.attributes;f.length;)r.removeAttributeNode(f[0]);En(r,l,o),r[bt]=t,r[jt]=o}catch(g){Nt(t,t.return,g)}}var xi=!1,Zt=!1,lp=!1,D1=typeof WeakSet=="function"?WeakSet:Set,_n=null;function aT(t,r){if(t=t.containerInfo,Pp=nu,t=Vy(t),af(t)){if("selectionStart"in t)var o={start:t.selectionStart,end:t.selectionEnd};else e:{o=(o=t.ownerDocument)&&o.defaultView||window;var l=o.getSelection&&o.getSelection();if(l&&l.rangeCount!==0){o=l.anchorNode;var f=l.anchorOffset,g=l.focusNode;l=l.focusOffset;try{o.nodeType,g.nodeType}catch{o=null;break e}var S=0,D=-1,F=-1,re=0,pe=0,ve=t,ae=null;t:for(;;){for(var le;ve!==o||f!==0&&ve.nodeType!==3||(D=S+f),ve!==g||l!==0&&ve.nodeType!==3||(F=S+l),ve.nodeType===3&&(S+=ve.nodeValue.length),(le=ve.firstChild)!==null;)ae=ve,ve=le;for(;;){if(ve===t)break t;if(ae===o&&++re===f&&(D=S),ae===g&&++pe===l&&(F=S),(le=ve.nextSibling)!==null)break;ve=ae,ae=ve.parentNode}ve=le}o=D===-1||F===-1?null:{start:D,end:F}}else o=null}o||(o={start:0,end:0})}else o=null;for(Np={focusedElem:t,selectionRange:o},nu=!1,_n=r;_n!==null;)if(r=_n,t=r.child,r.subtreeFlags&1024&&t!==null)t.return=r,_n=t;else for(;_n!==null;){switch(r=_n,g=r.alternate,t=r.flags,r.tag){case 0:break;case 11:case 15:break;case 1:if(t&1024&&g!==null){t=void 0,o=r,f=g.memoizedProps,g=g.memoizedState,l=o.stateNode;try{var qe=Xo(o.type,f,o.elementType===o.type);t=l.getSnapshotBeforeUpdate(qe,g),l.__reactInternalSnapshotBeforeUpdate=t}catch(Le){Nt(o,o.return,Le)}}break;case 3:if(t&1024){if(t=r.stateNode.containerInfo,o=t.nodeType,o===9)Ap(t);else if(o===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ap(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(t&1024)throw Error(s(163))}if(t=r.sibling,t!==null){t.return=r.return,_n=t;break}_n=r.return}}function O1(t,r,o){var l=o.flags;switch(o.tag){case 0:case 11:case 15:Yi(t,o),l&4&&il(5,o);break;case 1:if(Yi(t,o),l&4)if(t=o.stateNode,r===null)try{t.componentDidMount()}catch(S){Nt(o,o.return,S)}else{var f=Xo(o.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(f,r,t.__reactInternalSnapshotBeforeUpdate)}catch(S){Nt(o,o.return,S)}}l&64&&C1(o),l&512&&ol(o,o.return);break;case 3:if(Yi(t,o),l&64&&(t=o.updateQueue,t!==null)){if(r=null,o.child!==null)switch(o.child.tag){case 27:case 5:r=o.child.stateNode;break;case 1:r=o.child.stateNode}try{mv(t,r)}catch(S){Nt(o,o.return,S)}}break;case 27:r===null&&l&4&&R1(o);case 26:case 5:Yi(t,o),r===null&&l&4&&E1(o),l&512&&ol(o,o.return);break;case 12:Yi(t,o);break;case 13:Yi(t,o),l&4&&M1(t,o),l&64&&(t=o.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(o=hT.bind(null,o),PT(t,o))));break;case 22:if(l=o.memoizedState!==null||xi,!l){r=r!==null&&r.memoizedState!==null||Zt,f=xi;var g=Zt;xi=l,(Zt=r)&&!g?Zi(t,o,(o.subtreeFlags&8772)!=0):Yi(t,o),xi=f,Zt=g}break;case 30:break;default:Yi(t,o)}}function P1(t){var r=t.alternate;r!==null&&(t.alternate=null,P1(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&pt(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var zt=null,$n=!1;function ki(t,r,o){for(o=o.child;o!==null;)N1(t,r,o),o=o.sibling}function N1(t,r,o){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(Ht,o)}catch{}switch(o.tag){case 26:Zt||Yr(o,r),ki(t,r,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Zt||Yr(o,r);var l=zt,f=$n;oo(o.type)&&(zt=o.stateNode,$n=!1),ki(t,r,o),ml(o.stateNode),zt=l,$n=f;break;case 5:Zt||Yr(o,r);case 6:if(l=zt,f=$n,zt=null,ki(t,r,o),zt=l,$n=f,zt!==null)if($n)try{(zt.nodeType===9?zt.body:zt.nodeName==="HTML"?zt.ownerDocument.body:zt).removeChild(o.stateNode)}catch(g){Nt(o,r,g)}else try{zt.removeChild(o.stateNode)}catch(g){Nt(o,r,g)}break;case 18:zt!==null&&($n?(t=zt,_b(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,o.stateNode),xl(t)):_b(zt,o.stateNode));break;case 4:l=zt,f=$n,zt=o.stateNode.containerInfo,$n=!0,ki(t,r,o),zt=l,$n=f;break;case 0:case 11:case 14:case 15:Zt||Xi(2,o,r),Zt||Xi(4,o,r),ki(t,r,o);break;case 1:Zt||(Yr(o,r),l=o.stateNode,typeof l.componentWillUnmount=="function"&&S1(o,r,l)),ki(t,r,o);break;case 21:ki(t,r,o);break;case 22:Zt=(l=Zt)||o.memoizedState!==null,ki(t,r,o),Zt=l;break;default:ki(t,r,o)}}function M1(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{xl(t)}catch(o){Nt(r,r.return,o)}}function sT(t){switch(t.tag){case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new D1),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new D1),r;default:throw Error(s(435,t.tag))}}function cp(t,r){var o=sT(t);r.forEach(function(l){var f=gT.bind(null,t,l);o.has(l)||(o.add(l),l.then(f,f))})}function ir(t,r){var o=r.deletions;if(o!==null)for(var l=0;l<o.length;l++){var f=o[l],g=t,S=r,D=S;e:for(;D!==null;){switch(D.tag){case 27:if(oo(D.type)){zt=D.stateNode,$n=!1;break e}break;case 5:zt=D.stateNode,$n=!1;break e;case 3:case 4:zt=D.stateNode.containerInfo,$n=!0;break e}D=D.return}if(zt===null)throw Error(s(160));N1(g,S,f),zt=null,$n=!1,g=f.alternate,g!==null&&(g.return=null),f.return=null}if(r.subtreeFlags&13878)for(r=r.child;r!==null;)L1(r,t),r=r.sibling}var jr=null;function L1(t,r){var o=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:ir(r,t),or(t),l&4&&(Xi(3,t,t.return),il(3,t),Xi(5,t,t.return));break;case 1:ir(r,t),or(t),l&512&&(Zt||o===null||Yr(o,o.return)),l&64&&xi&&(t=t.updateQueue,t!==null&&(l=t.callbacks,l!==null&&(o=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=o===null?l:o.concat(l))));break;case 26:var f=jr;if(ir(r,t),or(t),l&512&&(Zt||o===null||Yr(o,o.return)),l&4){var g=o===null?null:o.memoizedState;if(l=t.memoizedState,o===null)if(l===null)if(t.stateNode===null){e:{l=t.type,o=t.memoizedProps,f=f.ownerDocument||f;t:switch(l){case"title":g=f.getElementsByTagName("title")[0],(!g||g[Ce]||g[bt]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=f.createElement(l),f.head.insertBefore(g,f.querySelector("head > title"))),En(g,l,o),g[bt]=t,He(g),l=g;break e;case"link":var S=Db("link","href",f).get(l+(o.href||""));if(S){for(var D=0;D<S.length;D++)if(g=S[D],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)){S.splice(D,1);break t}}g=f.createElement(l),En(g,l,o),f.head.appendChild(g);break;case"meta":if(S=Db("meta","content",f).get(l+(o.content||""))){for(D=0;D<S.length;D++)if(g=S[D],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)){S.splice(D,1);break t}}g=f.createElement(l),En(g,l,o),f.head.appendChild(g);break;default:throw Error(s(468,l))}g[bt]=t,He(g),l=g}t.stateNode=l}else Ob(f,t.type,t.stateNode);else t.stateNode=Rb(f,l,t.memoizedProps);else g===l?l===null&&t.stateNode!==null&&op(t,t.memoizedProps,o.memoizedProps):(g===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):g.count--,l===null?Ob(f,t.type,t.stateNode):Rb(f,l,t.memoizedProps))}break;case 27:ir(r,t),or(t),l&512&&(Zt||o===null||Yr(o,o.return)),o!==null&&l&4&&op(t,t.memoizedProps,o.memoizedProps);break;case 5:if(ir(r,t),or(t),l&512&&(Zt||o===null||Yr(o,o.return)),t.flags&32){f=t.stateNode;try{Qr(f,"")}catch(le){Nt(t,t.return,le)}}l&4&&t.stateNode!=null&&(f=t.memoizedProps,op(t,f,o===null?f:o.memoizedProps)),l&1024&&(lp=!0);break;case 6:if(ir(r,t),or(t),l&4){if(t.stateNode===null)throw Error(s(162));l=t.memoizedProps,o=t.stateNode;try{o.nodeValue=l}catch(le){Nt(t,t.return,le)}}break;case 3:if(Zc=null,f=jr,jr=Xc(r.containerInfo),ir(r,t),jr=f,or(t),l&4&&o!==null&&o.memoizedState.isDehydrated)try{xl(r.containerInfo)}catch(le){Nt(t,t.return,le)}lp&&(lp=!1,A1(t));break;case 4:l=jr,jr=Xc(t.stateNode.containerInfo),ir(r,t),or(t),jr=l;break;case 12:ir(r,t),or(t);break;case 13:ir(r,t),or(t),t.child.flags&8192&&t.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(hp=vn()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,cp(t,l)));break;case 22:f=t.memoizedState!==null;var F=o!==null&&o.memoizedState!==null,re=xi,pe=Zt;if(xi=re||f,Zt=pe||F,ir(r,t),Zt=pe,xi=re,or(t),l&8192)e:for(r=t.stateNode,r._visibility=f?r._visibility&-2:r._visibility|1,f&&(o===null||F||xi||Zt||Yo(t)),o=null,r=t;;){if(r.tag===5||r.tag===26){if(o===null){F=o=r;try{if(g=F.stateNode,f)S=g.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{D=F.stateNode;var ve=F.memoizedProps.style,ae=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;D.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(le){Nt(F,F.return,le)}}}else if(r.tag===6){if(o===null){F=r;try{F.stateNode.nodeValue=f?"":F.memoizedProps}catch(le){Nt(F,F.return,le)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;o===r&&(o=null),r=r.return}o===r&&(o=null),r.sibling.return=r.return,r=r.sibling}l&4&&(l=t.updateQueue,l!==null&&(o=l.retryQueue,o!==null&&(l.retryQueue=null,cp(t,o))));break;case 19:ir(r,t),or(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,cp(t,l)));break;case 30:break;case 21:break;default:ir(r,t),or(t)}}function or(t){var r=t.flags;if(r&2){try{for(var o,l=t.return;l!==null;){if(T1(l)){o=l;break}l=l.return}if(o==null)throw Error(s(160));switch(o.tag){case 27:var f=o.stateNode;qc(t,ap(t),f);break;case 5:var g=o.stateNode;o.flags&32&&(Qr(g,""),o.flags&=-33),qc(t,ap(t),g);break;case 3:case 4:var S=o.stateNode.containerInfo;sp(t,ap(t),S);break;default:throw Error(s(161))}}catch(D){Nt(t,t.return,D)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function A1(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;A1(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Yi(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)O1(t,r.alternate,r),r=r.sibling}function Yo(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:Xi(4,r,r.return),Yo(r);break;case 1:Yr(r,r.return);var o=r.stateNode;typeof o.componentWillUnmount=="function"&&S1(r,r.return,o),Yo(r);break;case 27:ml(r.stateNode);case 26:case 5:Yr(r,r.return),Yo(r);break;case 22:r.memoizedState===null&&Yo(r);break;case 30:Yo(r);break;default:Yo(r)}t=t.sibling}}function Zi(t,r,o){for(o&&(o=(r.subtreeFlags&8772)!=0),r=r.child;r!==null;){var l=r.alternate,f=t,g=r,S=g.flags;switch(g.tag){case 0:case 11:case 15:Zi(f,g,o),il(4,g);break;case 1:if(Zi(f,g,o),l=g,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(re){Nt(l,l.return,re)}if(l=g,f=l.updateQueue,f!==null){var D=l.stateNode;try{var F=f.shared.hiddenCallbacks;if(F!==null)for(f.shared.hiddenCallbacks=null,f=0;f<F.length;f++)pv(F[f],D)}catch(re){Nt(l,l.return,re)}}o&&S&64&&C1(g),ol(g,g.return);break;case 27:R1(g);case 26:case 5:Zi(f,g,o),o&&l===null&&S&4&&E1(g),ol(g,g.return);break;case 12:Zi(f,g,o);break;case 13:Zi(f,g,o),o&&S&4&&M1(f,g);break;case 22:g.memoizedState===null&&Zi(f,g,o),ol(g,g.return);break;case 30:break;default:Zi(f,g,o)}r=r.sibling}}function up(t,r){var o=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==o&&(t!=null&&t.refCount++,o!=null&&$s(o))}function dp(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&$s(t))}function Zr(t,r,o,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)I1(t,r,o,l),r=r.sibling}function I1(t,r,o,l){var f=r.flags;switch(r.tag){case 0:case 11:case 15:Zr(t,r,o,l),f&2048&&il(9,r);break;case 1:Zr(t,r,o,l);break;case 3:Zr(t,r,o,l),f&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&$s(t)));break;case 12:if(f&2048){Zr(t,r,o,l),t=r.stateNode;try{var g=r.memoizedProps,S=g.id,D=g.onPostCommit;typeof D=="function"&&D(S,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(F){Nt(r,r.return,F)}}else Zr(t,r,o,l);break;case 13:Zr(t,r,o,l);break;case 23:break;case 22:g=r.stateNode,S=r.alternate,r.memoizedState===null?g._visibility&2?Zr(t,r,o,l):(g._visibility|=2,$a(t,r,o,l,(r.subtreeFlags&10256)!=0)):g._visibility&2?Zr(t,r,o,l):al(t,r),f&2048&&up(S,r);break;case 24:Zr(t,r,o,l),f&2048&&dp(r.alternate,r);break;default:Zr(t,r,o,l)}}function $a(t,r,o,l,f){for(f&&(f=(r.subtreeFlags&10256)!=0),r=r.child;r!==null;){var g=t,S=r,D=o,F=l,re=S.flags;switch(S.tag){case 0:case 11:case 15:$a(g,S,D,F,f),il(8,S);break;case 23:break;case 22:var pe=S.stateNode;S.memoizedState===null?(pe._visibility|=2,$a(g,S,D,F,f)):pe._visibility&2?$a(g,S,D,F,f):al(g,S),f&&re&2048&&up(S.alternate,S);break;case 24:$a(g,S,D,F,f),f&&re&2048&&dp(S.alternate,S);break;default:$a(g,S,D,F,f)}r=r.sibling}}function al(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var o=t,l=r,f=l.flags;switch(l.tag){case 22:al(o,l),f&2048&&up(l.alternate,l);break;case 24:al(o,l),f&2048&&dp(l.alternate,l);break;default:al(o,l)}r=r.sibling}}var sl=8192;function Wa(t){if(t.subtreeFlags&sl)for(t=t.child;t!==null;)j1(t),t=t.sibling}function j1(t){switch(t.tag){case 26:Wa(t),t.flags&sl&&t.memoizedState!==null&&$T(jr,t.memoizedState,t.memoizedProps);break;case 5:Wa(t);break;case 3:case 4:var r=jr;jr=Xc(t.stateNode.containerInfo),Wa(t),jr=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=sl,sl=16777216,Wa(t),sl=r):Wa(t));break;default:Wa(t)}}function q1(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function ll(t){var r=t.deletions;if(t.flags&16){if(r!==null)for(var o=0;o<r.length;o++){var l=r[o];_n=l,F1(l,t)}q1(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)z1(t),t=t.sibling}function z1(t){switch(t.tag){case 0:case 11:case 15:ll(t),t.flags&2048&&Xi(9,t,t.return);break;case 3:ll(t);break;case 12:ll(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,zc(t)):ll(t);break;default:ll(t)}}function zc(t){var r=t.deletions;if(t.flags&16){if(r!==null)for(var o=0;o<r.length;o++){var l=r[o];_n=l,F1(l,t)}q1(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:Xi(8,r,r.return),zc(r);break;case 22:o=r.stateNode,o._visibility&2&&(o._visibility&=-3,zc(r));break;default:zc(r)}t=t.sibling}}function F1(t,r){for(;_n!==null;){var o=_n;switch(o.tag){case 0:case 11:case 15:Xi(8,o,r);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var l=o.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:$s(o.memoizedState.cache)}if(l=o.child,l!==null)l.return=o,_n=l;else e:for(o=t;_n!==null;){l=_n;var f=l.sibling,g=l.return;if(P1(l),l===o){_n=null;break e}if(f!==null){f.return=g,_n=f;break e}_n=g}}}var lT={getCacheForType:function(t){var r=Nn(cn),o=r.data.get(t);return o===void 0&&(o=t(),r.data.set(t,o)),o}},cT=typeof WeakMap=="function"?WeakMap:Map,_t=0,Lt=null,nt=null,at=0,xt=0,ar=null,eo=!1,Ua=!1,fp=!1,Ci=0,Ut=0,to=0,Zo=0,pp=0,wr=0,Ka=0,cl=null,Wn=null,mp=!1,hp=0,Fc=1/0,Bc=null,no=null,Sn=0,ro=null,Qa=null,Ga=0,gp=0,yp=null,B1=null,ul=0,vp=null;function _r(){if(_t&2&&at!==0)return at&-at;if(Q.T!==null){var t=Ia;return t===0?Sp():t}return ui()}function H1(){wr===0&&(wr=!(at&536870912)||mt?On():536870912);var t=br.current;return t!==null&&(t.flags|=32),wr}function sr(t,r,o){(t===Lt&&(xt===2||xt===9)||t.cancelPendingCommit!==null)&&(Ja(t,0),io(t,at,wr,!1)),Yn(t,o),(!(_t&2)||t!==Lt)&&(t===Lt&&(!(_t&2)&&(Zo|=o),Ut===4&&io(t,at,wr,!1)),Si(t))}function V1(t,r,o){if(_t&6)throw Error(s(327));var l=!o&&(r&124)==0&&(r&t.expiredLanes)===0||st(t,r),f=l?fT(t,r):_p(t,r,!0),g=l;do{if(f===0){Ua&&!l&&io(t,r,0,!1);break}else{if(o=t.current.alternate,g&&!uT(o)){f=_p(t,r,!1),g=!1;continue}if(f===2){if(g=r,t.errorRecoveryDisabledLanes&g)var S=0;else S=t.pendingLanes&-536870913,S=S===0?S&536870912?536870912:0:S;if(S!==0){r=S;e:{var D=t;f=cl;var F=D.current.memoizedState.isDehydrated;if(F&&(Ja(D,S).flags|=256),S=_p(D,S,!1),S!==2){if(fp&&!F){D.errorRecoveryDisabledLanes|=g,Zo|=g,f=4;break e}g=Wn,Wn=f,g!==null&&(Wn===null?Wn=g:Wn.push.apply(Wn,g))}f=S}if(g=!1,f!==2)continue}}if(f===1){Ja(t,0),io(t,r,0,!0);break}e:{switch(l=t,g=f,g){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:io(l,r,wr,!eo);break e;case 2:Wn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(f=hp+300-vn(),10<f)){if(io(l,r,wr,!eo),Vt(l,0,!0)!==0)break e;l.timeoutHandle=bb($1.bind(null,l,o,Wn,Bc,mp,r,wr,Zo,Ka,eo,g,2,-0,0),f);break e}$1(l,o,Wn,Bc,mp,r,wr,Zo,Ka,eo,g,0,-0,0)}}break}while(!0);Si(t)}function $1(t,r,o,l,f,g,S,D,F,re,pe,ve,ae,le){if(t.timeoutHandle=-1,ve=r.subtreeFlags,(ve&8192||(ve&16785408)==16785408)&&(yl={stylesheets:null,count:0,unsuspend:VT},j1(r),ve=WT(),ve!==null)){t.cancelPendingCommit=ve(X1.bind(null,t,r,g,o,l,f,S,D,F,pe,1,ae,le)),io(t,g,S,!re);return}X1(t,r,g,o,l,f,S,D,F)}function uT(t){for(var r=t;;){var o=r.tag;if((o===0||o===11||o===15)&&r.flags&16384&&(o=r.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var l=0;l<o.length;l++){var f=o[l],g=f.getSnapshot;f=f.value;try{if(!nr(g(),f))return!1}catch{return!1}}if(o=r.child,r.subtreeFlags&16384&&o!==null)o.return=r,r=o;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function io(t,r,o,l){r&=~pp,r&=~Zo,t.suspendedLanes|=r,t.pingedLanes&=~r,l&&(t.warmLanes|=r),l=t.expirationTimes;for(var f=r;0<f;){var g=31-Ft(f),S=1<<g;l[g]=-1,f&=~S}o!==0&&ci(t,o,r)}function Hc(){return _t&6?!0:(dl(0,!1),!1)}function bp(){if(nt!==null){if(xt===0)var t=nt.return;else t=nt,hi=Wo=null,If(t),Ha=null,tl=0,t=nt;for(;t!==null;)k1(t.alternate,t),t=t.return;nt=null}}function Ja(t,r){var o=t.timeoutHandle;o!==-1&&(t.timeoutHandle=-1,ET(o)),o=t.cancelPendingCommit,o!==null&&(t.cancelPendingCommit=null,o()),bp(),Lt=t,nt=o=fi(t.current,null),at=r,xt=0,ar=null,eo=!1,Ua=st(t,r),fp=!1,Ka=wr=pp=Zo=to=Ut=0,Wn=cl=null,mp=!1,r&8&&(r|=r&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=r;0<l;){var f=31-Ft(l),g=1<<f;r|=t[f],l&=~g}return Ci=r,uc(),o}function W1(t,r){Ye=null,Q.H=Dc,r===Us||r===bc?(r=dv(),xt=3):r===lv?(r=dv(),xt=4):xt=r===c1?8:typeof r=="object"&&r&&typeof r.then=="function"?6:1,ar=r,nt===null&&(Ut=1,Lc(t,hr(r,t.current)))}function U1(){var t=Q.H;return Q.H=Dc,t===null?Dc:t}function K1(){var t=Q.A;return Q.A=lT,t}function wp(){Ut=4,eo||(at&4194048)!==at&&br.current!==null||(Ua=!0),!(to&134217727)&&!(Zo&134217727)||Lt===null||io(Lt,at,wr,!1)}function _p(t,r,o){var l=_t;_t|=2;var f=U1(),g=K1();(Lt!==t||at!==r)&&(Bc=null,Ja(t,r)),r=!1;var S=Ut;e:do try{if(xt!==0&&nt!==null){var D=nt,F=ar;switch(xt){case 8:bp(),S=6;break e;case 3:case 2:case 9:case 6:br.current===null&&(r=!0);var re=xt;if(xt=0,ar=null,Xa(t,D,F,re),o&&Ua){S=0;break e}break;default:re=xt,xt=0,ar=null,Xa(t,D,F,re)}}dT(),S=Ut;break}catch(pe){W1(t,pe)}while(!0);return r&&t.shellSuspendCounter++,hi=Wo=null,_t=l,Q.H=f,Q.A=g,nt===null&&(Lt=null,at=0,uc()),S}function dT(){for(;nt!==null;)Q1(nt)}function fT(t,r){var o=_t;_t|=2;var l=U1(),f=K1();Lt!==t||at!==r?(Bc=null,Fc=vn()+500,Ja(t,r)):Ua=st(t,r);e:do try{if(xt!==0&&nt!==null){r=nt;var g=ar;t:switch(xt){case 1:xt=0,ar=null,Xa(t,r,g,1);break;case 2:case 9:if(cv(g)){xt=0,ar=null,G1(r);break}r=function(){xt!==2&&xt!==9||Lt!==t||(xt=7),Si(t)},g.then(r,r);break e;case 3:xt=7;break e;case 4:xt=5;break e;case 7:cv(g)?(xt=0,ar=null,G1(r)):(xt=0,ar=null,Xa(t,r,g,7));break;case 5:var S=null;switch(nt.tag){case 26:S=nt.memoizedState;case 5:case 27:var D=nt;if(!S||Pb(S)){xt=0,ar=null;var F=D.sibling;if(F!==null)nt=F;else{var re=D.return;re===null?nt=null:(nt=re,Vc(re))}break t}}xt=0,ar=null,Xa(t,r,g,5);break;case 6:xt=0,ar=null,Xa(t,r,g,6);break;case 8:bp(),Ut=6;break e;default:throw Error(s(462))}}pT();break}catch(pe){W1(t,pe)}while(!0);return hi=Wo=null,Q.H=l,Q.A=f,_t=o,nt===null?(Lt=null,at=0,uc(),Ut):0}function pT(){for(;nt!==null&&!ai();)Q1(nt)}function Q1(t){var r=_1(t.alternate,t,Ci);t.memoizedProps=t.pendingProps,r===null?Vc(t):nt=r}function G1(t){var r=t,o=r.alternate;switch(r.tag){case 15:case 0:r=h1(o,r,r.pendingProps,r.type,void 0,at);break;case 11:r=h1(o,r,r.pendingProps,r.type.render,r.ref,at);break;case 5:If(r);default:k1(o,r),r=nt=Zy(r,Ci),r=_1(o,r,Ci)}t.memoizedProps=t.pendingProps,r===null?Vc(t):nt=r}function Xa(t,r,o,l){hi=Wo=null,If(r),Ha=null,tl=0;var f=r.return;try{if(nT(t,f,r,o,at)){Ut=1,Lc(t,hr(o,t.current)),nt=null;return}}catch(g){if(f!==null)throw nt=f,g;Ut=1,Lc(t,hr(o,t.current)),nt=null;return}r.flags&32768?(mt||l===1?t=!0:Ua||at&536870912?t=!1:(eo=t=!0,(l===2||l===9||l===3||l===6)&&(l=br.current,l!==null&&l.tag===13&&(l.flags|=16384))),J1(r,t)):Vc(r)}function Vc(t){var r=t;do{if(r.flags&32768){J1(r,eo);return}t=r.return;var o=iT(r.alternate,r,Ci);if(o!==null){nt=o;return}if(r=r.sibling,r!==null){nt=r;return}nt=r=t}while(r!==null);Ut===0&&(Ut=5)}function J1(t,r){do{var o=oT(t.alternate,t);if(o!==null){o.flags&=32767,nt=o;return}if(o=t.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!r&&(t=t.sibling,t!==null)){nt=t;return}nt=t=o}while(t!==null);Ut=6,nt=null}function X1(t,r,o,l,f,g,S,D,F){t.cancelPendingCommit=null;do $c();while(Sn!==0);if(_t&6)throw Error(s(327));if(r!==null){if(r===t.current)throw Error(s(177));if(g=r.lanes|r.childLanes,g|=df,Ur(t,o,g,S,D,F),t===Lt&&(nt=Lt=null,at=0),Qa=r,ro=t,Ga=o,gp=g,yp=f,B1=l,r.subtreeFlags&10256||r.flags&10256?(t.callbackNode=null,t.callbackPriority=0,yT(nn,function(){return nb(!0),null})):(t.callbackNode=null,t.callbackPriority=0),l=(r.flags&13878)!=0,r.subtreeFlags&13878||l){l=Q.T,Q.T=null,f=K.p,K.p=2,S=_t,_t|=4;try{aT(t,r,o)}finally{_t=S,K.p=f,Q.T=l}}Sn=1,Y1(),Z1(),eb()}}function Y1(){if(Sn===1){Sn=0;var t=ro,r=Qa,o=(r.flags&13878)!=0;if(r.subtreeFlags&13878||o){o=Q.T,Q.T=null;var l=K.p;K.p=2;var f=_t;_t|=4;try{L1(r,t);var g=Np,S=Vy(t.containerInfo),D=g.focusedElem,F=g.selectionRange;if(S!==D&&D&&D.ownerDocument&&Hy(D.ownerDocument.documentElement,D)){if(F!==null&&af(D)){var re=F.start,pe=F.end;if(pe===void 0&&(pe=re),"selectionStart"in D)D.selectionStart=re,D.selectionEnd=Math.min(pe,D.value.length);else{var ve=D.ownerDocument||document,ae=ve&&ve.defaultView||window;if(ae.getSelection){var le=ae.getSelection(),qe=D.textContent.length,Le=Math.min(F.start,qe),Rt=F.end===void 0?Le:Math.min(F.end,qe);!le.extend&&Le>Rt&&(S=Rt,Rt=Le,Le=S);var J=By(D,Le),W=By(D,Rt);if(J&&W&&(le.rangeCount!==1||le.anchorNode!==J.node||le.anchorOffset!==J.offset||le.focusNode!==W.node||le.focusOffset!==W.offset)){var ee=ve.createRange();ee.setStart(J.node,J.offset),le.removeAllRanges(),Le>Rt?(le.addRange(ee),le.extend(W.node,W.offset)):(ee.setEnd(W.node,W.offset),le.addRange(ee))}}}}for(ve=[],le=D;le=le.parentNode;)le.nodeType===1&&ve.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<ve.length;D++){var me=ve[D];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}nu=!!Pp,Np=Pp=null}finally{_t=f,K.p=l,Q.T=o}}t.current=r,Sn=2}}function Z1(){if(Sn===2){Sn=0;var t=ro,r=Qa,o=(r.flags&8772)!=0;if(r.subtreeFlags&8772||o){o=Q.T,Q.T=null;var l=K.p;K.p=2;var f=_t;_t|=4;try{O1(t,r.alternate,r)}finally{_t=f,K.p=l,Q.T=o}}Sn=3}}function eb(){if(Sn===4||Sn===3){Sn=0,yn();var t=ro,r=Qa,o=Ga,l=B1;r.subtreeFlags&10256||r.flags&10256?Sn=5:(Sn=0,Qa=ro=null,tb(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(no=null),Kr(o),r=r.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(Ht,r,void 0,(r.current.flags&128)==128)}catch{}if(l!==null){r=Q.T,f=K.p,K.p=2,Q.T=null;try{for(var g=t.onRecoverableError,S=0;S<l.length;S++){var D=l[S];g(D.value,{componentStack:D.stack})}}finally{Q.T=r,K.p=f}}Ga&3&&$c(),Si(t),f=t.pendingLanes,o&4194090&&f&42?t===vp?ul++:(ul=0,vp=t):ul=0,dl(0,!1)}}function tb(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,$s(r)))}function $c(t){return Y1(),Z1(),eb(),nb(t)}function nb(){if(Sn!==5)return!1;var t=ro,r=gp;gp=0;var o=Kr(Ga),l=Q.T,f=K.p;try{K.p=32>o?32:o,Q.T=null,o=yp,yp=null;var g=ro,S=Ga;if(Sn=0,Qa=ro=null,Ga=0,_t&6)throw Error(s(331));var D=_t;if(_t|=4,z1(g.current),I1(g,g.current,S,o),_t=D,dl(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(Ht,g)}catch{}return!0}finally{K.p=f,Q.T=l,tb(t,r)}}function rb(t,r,o){r=hr(o,r),r=Jf(t.stateNode,r,2),t=Go(t,r,2),t!==null&&(Yn(t,2),Si(t))}function Nt(t,r,o){if(t.tag===3)rb(t,t,o);else for(;r!==null;){if(r.tag===3){rb(r,t,o);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(no===null||!no.has(l))){t=hr(o,t),o=s1(2),l=Go(r,o,2),l!==null&&(l1(o,l,r,t),Yn(l,2),Si(l));break}}r=r.return}}function xp(t,r,o){var l=t.pingCache;if(l===null){l=t.pingCache=new cT;var f=new Set;l.set(r,f)}else f=l.get(r),f===void 0&&(f=new Set,l.set(r,f));f.has(o)||(fp=!0,f.add(o),t=mT.bind(null,t,r,o),r.then(t,t))}function mT(t,r,o){var l=t.pingCache;l!==null&&l.delete(r),t.pingedLanes|=t.suspendedLanes&o,t.warmLanes&=~o,Lt===t&&(at&o)===o&&(Ut===4||Ut===3&&(at&62914560)===at&&300>vn()-hp?!(_t&2)&&Ja(t,0):pp|=o,Ka===at&&(Ka=0)),Si(t)}function ib(t,r){r===0&&(r=Wr()),t=Na(t,r),t!==null&&(Yn(t,r),Si(t))}function hT(t){var r=t.memoizedState,o=0;r!==null&&(o=r.retryLane),ib(t,o)}function gT(t,r){var o=0;switch(t.tag){case 13:var l=t.stateNode,f=t.memoizedState;f!==null&&(o=f.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(r),ib(t,o)}function yT(t,r){return Xn(t,r)}var Wc=null,Ya=null,kp=!1,Uc=!1,Cp=!1,ea=0;function Si(t){t!==Ya&&t.next===null&&(Ya===null?Wc=Ya=t:Ya=Ya.next=t),Uc=!0,kp||(kp=!0,bT())}function dl(t,r){if(!Cp&&Uc){Cp=!0;do for(var o=!1,l=Wc;l!==null;){if(!r)if(t!==0){var f=l.pendingLanes;if(f===0)var g=0;else{var S=l.suspendedLanes,D=l.pingedLanes;g=(1<<31-Ft(42|t)+1)-1,g&=f&~(S&~D),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(o=!0,lb(l,g))}else g=at,g=Vt(l,l===Lt?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),!(g&3)||st(l,g)||(o=!0,lb(l,g));l=l.next}while(o);Cp=!1}}function vT(){ob()}function ob(){Uc=kp=!1;var t=0;ea!==0&&(ST()&&(t=ea),ea=0);for(var r=vn(),o=null,l=Wc;l!==null;){var f=l.next,g=ab(l,r);g===0?(l.next=null,o===null?Wc=f:o.next=f,f===null&&(Ya=o)):(o=l,(t!==0||g&3)&&(Uc=!0)),l=f}dl(t,!1)}function ab(t,r){for(var o=t.suspendedLanes,l=t.pingedLanes,f=t.expirationTimes,g=t.pendingLanes&-62914561;0<g;){var S=31-Ft(g),D=1<<S,F=f[S];F===-1?((D&o)===0||(D&l)!==0)&&(f[S]=vt(D,r)):F<=r&&(t.expiredLanes|=D),g&=~D}if(r=Lt,o=at,o=Vt(t,t===r?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,o===0||t===r&&(xt===2||xt===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&kt(l),t.callbackNode=null,t.callbackPriority=0;if(!(o&3)||st(t,o)){if(r=o&-o,r===t.callbackPriority)return r;switch(l!==null&&kt(l),Kr(o)){case 2:case 8:o=An;break;case 32:o=nn;break;case 268435456:o=$r;break;default:o=nn}return l=sb.bind(null,t),o=Xn(o,l),t.callbackPriority=r,t.callbackNode=o,r}return l!==null&&l!==null&&kt(l),t.callbackPriority=2,t.callbackNode=null,2}function sb(t,r){if(Sn!==0&&Sn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var o=t.callbackNode;if($c(!0)&&t.callbackNode!==o)return null;var l=at;return l=Vt(t,t===Lt?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(V1(t,l,r),ab(t,vn()),t.callbackNode!=null&&t.callbackNode===o?sb.bind(null,t):null)}function lb(t,r){if($c())return null;V1(t,r,!0)}function bT(){TT(function(){_t&6?Xn(Pr,vT):ob()})}function Sp(){return ea===0&&(ea=On()),ea}function cb(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Do(""+t)}function ub(t,r){var o=r.ownerDocument.createElement("input");return o.name=r.name,o.value=r.value,t.id&&o.setAttribute("form",t.id),r.parentNode.insertBefore(o,r),t=new FormData(t),o.parentNode.removeChild(o),t}function wT(t,r,o,l,f){if(r==="submit"&&o&&o.stateNode===f){var g=cb((f[jt]||null).action),S=l.submitter;S&&(r=(r=S[jt]||null)?cb(r.formAction):S.getAttribute("formAction"),r!==null&&(g=r,S=null));var D=new $i("action","action",null,l,f);t.push({event:D,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(ea!==0){var F=S?ub(f,S):new FormData(f);Wf(o,{pending:!0,data:F,method:f.method,action:g},null,F)}}else typeof g=="function"&&(D.preventDefault(),F=S?ub(f,S):new FormData(f),Wf(o,{pending:!0,data:F,method:f.method,action:g},g,F))},currentTarget:f}]})}}for(var Ep=0;Ep<uf.length;Ep++){var Tp=uf[Ep];Ir(Tp.toLowerCase(),"on"+(Tp[0].toUpperCase()+Tp.slice(1)))}Ir(Uy,"onAnimationEnd"),Ir(Ky,"onAnimationIteration"),Ir(Qy,"onAnimationStart"),Ir("dblclick","onDoubleClick"),Ir("focusin","onFocus"),Ir("focusout","onBlur"),Ir(IE,"onTransitionRun"),Ir(jE,"onTransitionStart"),Ir(qE,"onTransitionCancel"),Ir(Gy,"onTransitionEnd"),er("onMouseEnter",["mouseout","mouseover"]),er("onMouseLeave",["mouseout","mouseover"]),er("onPointerEnter",["pointerout","pointerover"]),er("onPointerLeave",["pointerout","pointerover"]),$t("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$t("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$t("onBeforeInput",["compositionend","keypress","textInput","paste"]),$t("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$t("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$t("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fl="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(" "),_T=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fl));function db(t,r){r=(r&4)!=0;for(var o=0;o<t.length;o++){var l=t[o],f=l.event;l=l.listeners;e:{var g=void 0;if(r)for(var S=l.length-1;0<=S;S--){var D=l[S],F=D.instance,re=D.currentTarget;if(D=D.listener,F!==g&&f.isPropagationStopped())break e;g=D,f.currentTarget=re;try{g(f)}catch(pe){Mc(pe)}f.currentTarget=null,g=F}else for(S=0;S<l.length;S++){if(D=l[S],F=D.instance,re=D.currentTarget,D=D.listener,F!==g&&f.isPropagationStopped())break e;g=D,f.currentTarget=re;try{g(f)}catch(pe){Mc(pe)}f.currentTarget=null,g=F}}}}function rt(t,r){var o=r[Je];o===void 0&&(o=r[Je]=new Set);var l=t+"__bubble";o.has(l)||(pb(r,t,2,!1),o.add(l))}function Rp(t,r,o){var l=0;r&&(l|=4),pb(o,t,l,r)}var Kc="_reactListening"+Math.random().toString(36).slice(2);function fb(t){if(!t[Kc]){t[Kc]=!0,ot.forEach(function(o){o!=="selectionchange"&&(_T.has(o)||Rp(o,!1,t),Rp(o,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[Kc]||(r[Kc]=!0,Rp("selectionchange",!1,r))}}function pb(t,r,o,l){switch(Ab(r)){case 2:var f=JT;break;case 8:f=XT;break;default:f=Hp}o=f.bind(null,r,o,t),f=void 0,!Ps||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(f=!0),l?f===void 0?t.addEventListener(r,o,!0):t.addEventListener(r,o,{capture:!0,passive:f}):f===void 0?t.addEventListener(r,o,!1):t.addEventListener(r,o,{passive:f})}function Dp(t,r,o,l,f){var g=l;if(!(r&1)&&!(r&2)&&l!==null)e:for(;;){if(l===null)return;var S=l.tag;if(S===3||S===4){var D=l.stateNode.containerInfo;if(D===f)break;if(S===4)for(S=l.return;S!==null;){var F=S.tag;if((F===3||F===4)&&S.stateNode.containerInfo===f)return;S=S.return}for(;D!==null;){if(S=tt(D),S===null)return;if(F=S.tag,F===5||F===6||F===26||F===27){l=g=S;continue e}D=D.parentNode}}l=l.return}sc(function(){var re=g,pe=Ra(o),ve=[];e:{var ae=Jy.get(t);if(ae!==void 0){var le=$i,qe=t;switch(t){case"keypress":if(Lo(o)===0)break e;case"keydown":case"keyup":le=_e;break;case"focusin":qe="focus",le=O;break;case"focusout":qe="blur",le=O;break;case"beforeblur":case"afterblur":le=O;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":le=k;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=T;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=Ee;break;case Uy:case Ky:case Qy:le=M;break;case Gy:le=Ie;break;case"scroll":case"scrollend":le=u;break;case"wheel":le=lt;break;case"copy":case"cut":case"paste":le=z;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=je;break;case"toggle":case"beforetoggle":le=Xe}var Le=(r&4)!=0,Rt=!Le&&(t==="scroll"||t==="scrollend"),J=Le?ae===null?null:ae+"Capture":ae;Le=[];for(var W=re,ee;W!==null;){var me=W;if(ee=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||ee===null||J===null||(me=Po(W,J),me!=null&&Le.push(pl(W,me,ee))),Rt)break;W=W.return}0<Le.length&&(ae=new le(ae,qe,null,o,pe),ve.push({event:ae,listeners:Le}))}}if(!(r&7)){e:{if(ae=t==="mouseover"||t==="pointerover",le=t==="mouseout"||t==="pointerout",ae&&o!==Os&&(qe=o.relatedTarget||o.fromElement)&&(tt(qe)||qe[P]))break e;if((le||ae)&&(ae=pe.window===pe?pe:(ae=pe.ownerDocument)?ae.defaultView||ae.parentWindow:window,le?(qe=o.relatedTarget||o.toElement,le=re,qe=qe?tt(qe):null,qe!==null&&(Rt=d(qe),Le=qe.tag,qe!==Rt||Le!==5&&Le!==27&&Le!==6)&&(qe=null)):(le=null,qe=re),le!==qe)){if(Le=k,me="onMouseLeave",J="onMouseEnter",W="mouse",(t==="pointerout"||t==="pointerover")&&(Le=je,me="onPointerLeave",J="onPointerEnter",W="pointer"),Rt=le==null?ae:wt(le),ee=qe==null?ae:wt(qe),ae=new Le(me,W+"leave",le,o,pe),ae.target=Rt,ae.relatedTarget=ee,me=null,tt(pe)===re&&(Le=new Le(J,W+"enter",qe,o,pe),Le.target=ee,Le.relatedTarget=Rt,me=Le),Rt=me,le&&qe)t:{for(Le=le,J=qe,W=0,ee=Le;ee;ee=Za(ee))W++;for(ee=0,me=J;me;me=Za(me))ee++;for(;0<W-ee;)Le=Za(Le),W--;for(;0<ee-W;)J=Za(J),ee--;for(;W--;){if(Le===J||J!==null&&Le===J.alternate)break t;Le=Za(Le),J=Za(J)}Le=null}else Le=null;le!==null&&mb(ve,ae,le,Le,!1),qe!==null&&Rt!==null&&mb(ve,Rt,qe,Le,!0)}}e:{if(ae=re?wt(re):window,le=ae.nodeName&&ae.nodeName.toLowerCase(),le==="select"||le==="input"&&ae.type==="file")var Te=Ay;else if(My(ae))if(Iy)Te=ME;else{Te=PE;var et=OE}else le=ae.nodeName,!le||le.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?re&&Rs(re.elementType)&&(Te=Ay):Te=NE;if(Te&&(Te=Te(t,re))){Ly(ve,Te,o,pe);break e}et&&et(t,ae,re),t==="focusout"&&re&&ae.type==="number"&&re.memoizedProps.value!=null&&Ts(ae,"number",ae.value)}switch(et=re?wt(re):window,t){case"focusin":(My(et)||et.contentEditable==="true")&&(Da=et,sf=re,zs=null);break;case"focusout":zs=sf=Da=null;break;case"mousedown":lf=!0;break;case"contextmenu":case"mouseup":case"dragend":lf=!1,$y(ve,o,pe);break;case"selectionchange":if(AE)break;case"keydown":case"keyup":$y(ve,o,pe)}var Oe;if(Pt)e:{switch(t){case"compositionstart":var Ae="onCompositionStart";break e;case"compositionend":Ae="onCompositionEnd";break e;case"compositionupdate":Ae="onCompositionUpdate";break e}Ae=void 0}else Wi?jo(t,o)&&(Ae="onCompositionEnd"):t==="keydown"&&o.keyCode===229&&(Ae="onCompositionStart");Ae&&(Jt&&o.locale!=="ko"&&(Wi||Ae!=="onCompositionStart"?Ae==="onCompositionEnd"&&Wi&&(Oe=Ms()):(Gr=pe,Ns="value"in Gr?Gr.value:Gr.textContent,Wi=!0)),et=Qc(re,Ae),0<et.length&&(Ae=new j(Ae,t,null,o,pe),ve.push({event:Ae,listeners:et}),Oe?Ae.data=Oe:(Oe=lc(o),Oe!==null&&(Ae.data=Oe)))),(Oe=Ke?As(t,o):TE(t,o))&&(Ae=Qc(re,"onBeforeInput"),0<Ae.length&&(et=new j("onBeforeInput","beforeinput",null,o,pe),ve.push({event:et,listeners:Ae}),et.data=Oe)),wT(ve,t,re,o,pe)}db(ve,r)})}function pl(t,r,o){return{instance:t,listener:r,currentTarget:o}}function Qc(t,r){for(var o=r+"Capture",l=[];t!==null;){var f=t,g=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||g===null||(f=Po(t,o),f!=null&&l.unshift(pl(t,f,g)),f=Po(t,r),f!=null&&l.push(pl(t,f,g))),t.tag===3)return l;t=t.return}return[]}function Za(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function mb(t,r,o,l,f){for(var g=r._reactName,S=[];o!==null&&o!==l;){var D=o,F=D.alternate,re=D.stateNode;if(D=D.tag,F!==null&&F===l)break;D!==5&&D!==26&&D!==27||re===null||(F=re,f?(re=Po(o,g),re!=null&&S.unshift(pl(o,re,F))):f||(re=Po(o,g),re!=null&&S.push(pl(o,re,F)))),o=o.return}S.length!==0&&t.push({event:r,listeners:S})}var xT=/\r\n?/g,kT=/\u0000|\uFFFD/g;function hb(t){return(typeof t=="string"?t:""+t).replace(xT,`
10
+ `).replace(kT,"")}function gb(t,r){return r=hb(r),hb(t)===r}function Gc(){}function Tt(t,r,o,l,f,g){switch(o){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||Qr(t,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&Qr(t,""+l);break;case"className":Ea(t,"class",l);break;case"tabIndex":Ea(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Ea(t,o,l);break;case"style":di(t,l,g);break;case"data":if(r!=="object"){Ea(t,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||o!=="href")){t.removeAttribute(o);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(o);break}l=Do(""+l),t.setAttribute(o,l);break;case"action":case"formAction":if(typeof l=="function"){t.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"?(r!=="input"&&Tt(t,r,"name",f.name,f,null),Tt(t,r,"formEncType",f.formEncType,f,null),Tt(t,r,"formMethod",f.formMethod,f,null),Tt(t,r,"formTarget",f.formTarget,f,null)):(Tt(t,r,"encType",f.encType,f,null),Tt(t,r,"method",f.method,f,null),Tt(t,r,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(o);break}l=Do(""+l),t.setAttribute(o,l);break;case"onClick":l!=null&&(t.onclick=Gc);break;case"onScroll":l!=null&&rt("scroll",t);break;case"onScrollEnd":l!=null&&rt("scrollend",t);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(o=l.__html,o!=null){if(f.children!=null)throw Error(s(60));t.innerHTML=o}}break;case"multiple":t.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":t.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){t.removeAttribute("xlink:href");break}o=Do(""+l),t.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":l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(o,""+l):t.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":l&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(o,""):t.removeAttribute(o);break;case"capture":case"download":l===!0?t.setAttribute(o,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(o,l):t.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(o,l):t.removeAttribute(o);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(o):t.setAttribute(o,l);break;case"popover":rt("beforetoggle",t),rt("toggle",t),So(t,"popover",l);break;case"xlinkActuate":pr(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":pr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":pr(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":pr(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":pr(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":pr(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":pr(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":pr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":pr(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":So(t,"is",l);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=Ds.get(o)||o,So(t,o,l))}}function Op(t,r,o,l,f,g){switch(o){case"style":di(t,l,g);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(o=l.__html,o!=null){if(f.children!=null)throw Error(s(60));t.innerHTML=o}}break;case"children":typeof l=="string"?Qr(t,l):(typeof l=="number"||typeof l=="bigint")&&Qr(t,""+l);break;case"onScroll":l!=null&&rt("scroll",t);break;case"onScrollEnd":l!=null&&rt("scrollend",t);break;case"onClick":l!=null&&(t.onclick=Gc);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ht.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(f=o.endsWith("Capture"),r=o.slice(2,f?o.length-7:void 0),g=t[jt]||null,g=g==null?null:g[o],typeof g=="function"&&t.removeEventListener(r,g,f),typeof l=="function")){typeof g!="function"&&g!==null&&(o in t?t[o]=null:t.hasAttribute(o)&&t.removeAttribute(o)),t.addEventListener(r,l,f);break e}o in t?t[o]=l:l===!0?t.setAttribute(o,""):So(t,o,l)}}}function En(t,r,o){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":rt("error",t),rt("load",t);var l=!1,f=!1,g;for(g in o)if(o.hasOwnProperty(g)){var S=o[g];if(S!=null)switch(g){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Tt(t,r,g,S,o,null)}}f&&Tt(t,r,"srcSet",o.srcSet,o,null),l&&Tt(t,r,"src",o.src,o,null);return;case"input":rt("invalid",t);var D=g=S=f=null,F=null,re=null;for(l in o)if(o.hasOwnProperty(l)){var pe=o[l];if(pe!=null)switch(l){case"name":f=pe;break;case"type":S=pe;break;case"checked":F=pe;break;case"defaultChecked":re=pe;break;case"value":g=pe;break;case"defaultValue":D=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(s(137,r));break;default:Tt(t,r,l,pe,o,null)}}Ro(t,g,D,F,re,S,f,!1),Eo(t);return;case"select":for(f in rt("invalid",t),l=S=g=null,o)if(o.hasOwnProperty(f)&&(D=o[f],D!=null))switch(f){case"value":g=D;break;case"defaultValue":S=D;break;case"multiple":l=D;default:Tt(t,r,f,D,o,null)}r=g,o=S,t.multiple=!!l,r==null?o!=null&&mr(t,!!l,o,!0):mr(t,!!l,r,!1);return;case"textarea":for(S in rt("invalid",t),g=f=l=null,o)if(o.hasOwnProperty(S)&&(D=o[S],D!=null))switch(S){case"value":l=D;break;case"defaultValue":f=D;break;case"children":g=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(s(91));break;default:Tt(t,r,S,D,o,null)}Hi(t,l,f,g),Eo(t);return;case"option":for(F in o)if(o.hasOwnProperty(F)&&(l=o[F],l!=null))switch(F){case"selected":t.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Tt(t,r,F,l,o,null)}return;case"dialog":rt("beforetoggle",t),rt("toggle",t),rt("cancel",t),rt("close",t);break;case"iframe":case"object":rt("load",t);break;case"video":case"audio":for(l=0;l<fl.length;l++)rt(fl[l],t);break;case"image":rt("error",t),rt("load",t);break;case"details":rt("toggle",t);break;case"embed":case"source":case"link":rt("error",t),rt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(re in o)if(o.hasOwnProperty(re)&&(l=o[re],l!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Tt(t,r,re,l,o,null)}return;default:if(Rs(r)){for(pe in o)o.hasOwnProperty(pe)&&(l=o[pe],l!==void 0&&Op(t,r,pe,l,o,void 0));return}}for(D in o)o.hasOwnProperty(D)&&(l=o[D],l!=null&&Tt(t,r,D,l,o,null))}function CT(t,r,o,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,g=null,S=null,D=null,F=null,re=null,pe=null;for(le in o){var ve=o[le];if(o.hasOwnProperty(le)&&ve!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":F=ve;default:l.hasOwnProperty(le)||Tt(t,r,le,null,l,ve)}}for(var ae in l){var le=l[ae];if(ve=o[ae],l.hasOwnProperty(ae)&&(le!=null||ve!=null))switch(ae){case"type":g=le;break;case"name":f=le;break;case"checked":re=le;break;case"defaultChecked":pe=le;break;case"value":S=le;break;case"defaultValue":D=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(s(137,r));break;default:le!==ve&&Tt(t,r,ae,le,l,ve)}}Es(t,S,D,F,re,pe,g,f);return;case"select":for(g in le=S=D=ae=null,o)if(F=o[g],o.hasOwnProperty(g)&&F!=null)switch(g){case"value":break;case"multiple":le=F;default:l.hasOwnProperty(g)||Tt(t,r,g,null,l,F)}for(f in l)if(g=l[f],F=o[f],l.hasOwnProperty(f)&&(g!=null||F!=null))switch(f){case"value":ae=g;break;case"defaultValue":D=g;break;case"multiple":S=g;default:g!==F&&Tt(t,r,f,g,l,F)}r=D,o=S,l=le,ae==null?!!l!=!!o&&(r==null?mr(t,!!o,o?[]:"",!1):mr(t,!!o,r,!0)):mr(t,!!o,ae,!1);return;case"textarea":for(D in le=ae=null,o)if(f=o[D],o.hasOwnProperty(D)&&f!=null&&!l.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:Tt(t,r,D,null,l,f)}for(S in l)if(f=l[S],g=o[S],l.hasOwnProperty(S)&&(f!=null||g!=null))switch(S){case"value":ae=f;break;case"defaultValue":le=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(s(91));break;default:f!==g&&Tt(t,r,S,f,l,g)}ic(t,ae,le);return;case"option":for(var qe in o)if(ae=o[qe],o.hasOwnProperty(qe)&&ae!=null&&!l.hasOwnProperty(qe))switch(qe){case"selected":t.selected=!1;break;default:Tt(t,r,qe,null,l,ae)}for(F in l)if(ae=l[F],le=o[F],l.hasOwnProperty(F)&&ae!==le&&(ae!=null||le!=null))switch(F){case"selected":t.selected=ae&&typeof ae!="function"&&typeof ae!="symbol";break;default:Tt(t,r,F,ae,l,le)}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 Le in o)ae=o[Le],o.hasOwnProperty(Le)&&ae!=null&&!l.hasOwnProperty(Le)&&Tt(t,r,Le,null,l,ae);for(re in l)if(ae=l[re],le=o[re],l.hasOwnProperty(re)&&ae!==le&&(ae!=null||le!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(s(137,r));break;default:Tt(t,r,re,ae,l,le)}return;default:if(Rs(r)){for(var Rt in o)ae=o[Rt],o.hasOwnProperty(Rt)&&ae!==void 0&&!l.hasOwnProperty(Rt)&&Op(t,r,Rt,void 0,l,ae);for(pe in l)ae=l[pe],le=o[pe],!l.hasOwnProperty(pe)||ae===le||ae===void 0&&le===void 0||Op(t,r,pe,ae,l,le);return}}for(var J in o)ae=o[J],o.hasOwnProperty(J)&&ae!=null&&!l.hasOwnProperty(J)&&Tt(t,r,J,null,l,ae);for(ve in l)ae=l[ve],le=o[ve],!l.hasOwnProperty(ve)||ae===le||ae==null&&le==null||Tt(t,r,ve,ae,l,le)}var Pp=null,Np=null;function Jc(t){return t.nodeType===9?t:t.ownerDocument}function yb(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function vb(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function Mp(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Lp=null;function ST(){var t=window.event;return t&&t.type==="popstate"?t===Lp?!1:(Lp=t,!0):(Lp=null,!1)}var bb=typeof setTimeout=="function"?setTimeout:void 0,ET=typeof clearTimeout=="function"?clearTimeout:void 0,wb=typeof Promise=="function"?Promise:void 0,TT=typeof queueMicrotask=="function"?queueMicrotask:wb===void 0?bb:function(t){return wb.resolve(null).then(t).catch(RT)};function RT(t){setTimeout(function(){throw t})}function oo(t){return t==="head"}function _b(t,r){var o=r,l=0,f=0;do{var g=o.nextSibling;if(t.removeChild(o),g&&g.nodeType===8)if(o=g.data,o==="/$"){if(0<l&&8>l){o=l;var S=t.ownerDocument;if(o&1&&ml(S.documentElement),o&2&&ml(S.body),o&4)for(o=S.head,ml(o),S=o.firstChild;S;){var D=S.nextSibling,F=S.nodeName;S[Ce]||F==="SCRIPT"||F==="STYLE"||F==="LINK"&&S.rel.toLowerCase()==="stylesheet"||o.removeChild(S),S=D}}if(f===0){t.removeChild(g),xl(r);return}f--}else o==="$"||o==="$?"||o==="$!"?f++:l=o.charCodeAt(0)-48;else l=0;o=g}while(o);xl(r)}function Ap(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var o=r;switch(r=r.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Ap(o),pt(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}t.removeChild(o)}}function DT(t,r,o,l){for(;t.nodeType===1;){var f=o;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[Ce])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(g=t.getAttribute("rel"),g==="stylesheet"&&t.hasAttribute("data-precedence")||g!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(g=t.getAttribute("src"),(g!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&g&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var g=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===g)return t}else return t;if(t=qr(t.nextSibling),t===null)break}return null}function OT(t,r,o){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!o||(t=qr(t.nextSibling),t===null))return null;return t}function Ip(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function PT(t,r){var o=t.ownerDocument;if(t.data!=="$?"||o.readyState==="complete")r();else{var l=function(){r(),o.removeEventListener("DOMContentLoaded",l)};o.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function qr(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="F!"||r==="F")break;if(r==="/$")return null}}return t}var jp=null;function xb(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var o=t.data;if(o==="$"||o==="$!"||o==="$?"){if(r===0)return t;r--}else o==="/$"&&r++}t=t.previousSibling}return null}function kb(t,r,o){switch(r=Jc(o),t){case"html":if(t=r.documentElement,!t)throw Error(s(452));return t;case"head":if(t=r.head,!t)throw Error(s(453));return t;case"body":if(t=r.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function ml(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);pt(t)}var xr=new Map,Cb=new Set;function Xc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ei=K.d;K.d={f:NT,r:MT,D:LT,C:AT,L:IT,m:jT,X:zT,S:qT,M:FT};function NT(){var t=Ei.f(),r=Hc();return t||r}function MT(t){var r=it(t);r!==null&&r.tag===5&&r.type==="form"?Uv(r):Ei.r(t)}var es=typeof document>"u"?null:document;function Sb(t,r,o){var l=es;if(l&&typeof r=="string"&&r){var f=Ve(r);f='link[rel="'+t+'"][href="'+f+'"]',typeof o=="string"&&(f+='[crossorigin="'+o+'"]'),Cb.has(f)||(Cb.add(f),t={rel:t,crossOrigin:o,href:r},l.querySelector(f)===null&&(r=l.createElement("link"),En(r,"link",t),He(r),l.head.appendChild(r)))}}function LT(t){Ei.D(t),Sb("dns-prefetch",t,null)}function AT(t,r){Ei.C(t,r),Sb("preconnect",t,r)}function IT(t,r,o){Ei.L(t,r,o);var l=es;if(l&&t&&r){var f='link[rel="preload"][as="'+Ve(r)+'"]';r==="image"&&o&&o.imageSrcSet?(f+='[imagesrcset="'+Ve(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(f+='[imagesizes="'+Ve(o.imageSizes)+'"]')):f+='[href="'+Ve(t)+'"]';var g=f;switch(r){case"style":g=ts(t);break;case"script":g=ns(t)}xr.has(g)||(t=_({rel:"preload",href:r==="image"&&o&&o.imageSrcSet?void 0:t,as:r},o),xr.set(g,t),l.querySelector(f)!==null||r==="style"&&l.querySelector(hl(g))||r==="script"&&l.querySelector(gl(g))||(r=l.createElement("link"),En(r,"link",t),He(r),l.head.appendChild(r)))}}function jT(t,r){Ei.m(t,r);var o=es;if(o&&t){var l=r&&typeof r.as=="string"?r.as:"script",f='link[rel="modulepreload"][as="'+Ve(l)+'"][href="'+Ve(t)+'"]',g=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=ns(t)}if(!xr.has(g)&&(t=_({rel:"modulepreload",href:t},r),xr.set(g,t),o.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(gl(g)))return}l=o.createElement("link"),En(l,"link",t),He(l),o.head.appendChild(l)}}}function qT(t,r,o){Ei.S(t,r,o);var l=es;if(l&&t){var f=$e(l).hoistableStyles,g=ts(t);r||(r="default");var S=f.get(g);if(!S){var D={loading:0,preload:null};if(S=l.querySelector(hl(g)))D.loading=5;else{t=_({rel:"stylesheet",href:t,"data-precedence":r},o),(o=xr.get(g))&&qp(t,o);var F=S=l.createElement("link");He(F),En(F,"link",t),F._p=new Promise(function(re,pe){F.onload=re,F.onerror=pe}),F.addEventListener("load",function(){D.loading|=1}),F.addEventListener("error",function(){D.loading|=2}),D.loading|=4,Yc(S,r,l)}S={type:"stylesheet",instance:S,count:1,state:D},f.set(g,S)}}}function zT(t,r){Ei.X(t,r);var o=es;if(o&&t){var l=$e(o).hoistableScripts,f=ns(t),g=l.get(f);g||(g=o.querySelector(gl(f)),g||(t=_({src:t,async:!0},r),(r=xr.get(f))&&zp(t,r),g=o.createElement("script"),He(g),En(g,"link",t),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(f,g))}}function FT(t,r){Ei.M(t,r);var o=es;if(o&&t){var l=$e(o).hoistableScripts,f=ns(t),g=l.get(f);g||(g=o.querySelector(gl(f)),g||(t=_({src:t,async:!0,type:"module"},r),(r=xr.get(f))&&zp(t,r),g=o.createElement("script"),He(g),En(g,"link",t),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},l.set(f,g))}}function Eb(t,r,o,l){var f=(f=It.current)?Xc(f):null;if(!f)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(r=ts(o.href),o=$e(f).hoistableStyles,l=o.get(r),l||(l={type:"style",instance:null,count:0,state:null},o.set(r,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){t=ts(o.href);var g=$e(f).hoistableStyles,S=g.get(t);if(S||(f=f.ownerDocument||f,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(t,S),(g=f.querySelector(hl(t)))&&!g._p&&(S.instance=g,S.state.loading=5),xr.has(t)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},xr.set(t,o),g||BT(f,t,o,S.state))),r&&l===null)throw Error(s(528,""));return S}if(r&&l!==null)throw Error(s(529,""));return null;case"script":return r=o.async,o=o.src,typeof o=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=ns(o),o=$e(f).hoistableScripts,l=o.get(r),l||(l={type:"script",instance:null,count:0,state:null},o.set(r,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function ts(t){return'href="'+Ve(t)+'"'}function hl(t){return'link[rel="stylesheet"]['+t+"]"}function Tb(t){return _({},t,{"data-precedence":t.precedence,precedence:null})}function BT(t,r,o,l){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?l.loading=1:(r=t.createElement("link"),l.preload=r,r.addEventListener("load",function(){return l.loading|=1}),r.addEventListener("error",function(){return l.loading|=2}),En(r,"link",o),He(r),t.head.appendChild(r))}function ns(t){return'[src="'+Ve(t)+'"]'}function gl(t){return"script[async]"+t}function Rb(t,r,o){if(r.count++,r.instance===null)switch(r.type){case"style":var l=t.querySelector('style[data-href~="'+Ve(o.href)+'"]');if(l)return r.instance=l,He(l),l;var f=_({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),He(l),En(l,"style",f),Yc(l,o.precedence,t),r.instance=l;case"stylesheet":f=ts(o.href);var g=t.querySelector(hl(f));if(g)return r.state.loading|=4,r.instance=g,He(g),g;l=Tb(o),(f=xr.get(f))&&qp(l,f),g=(t.ownerDocument||t).createElement("link"),He(g);var S=g;return S._p=new Promise(function(D,F){S.onload=D,S.onerror=F}),En(g,"link",l),r.state.loading|=4,Yc(g,o.precedence,t),r.instance=g;case"script":return g=ns(o.src),(f=t.querySelector(gl(g)))?(r.instance=f,He(f),f):(l=o,(f=xr.get(g))&&(l=_({},o),zp(l,f)),t=t.ownerDocument||t,f=t.createElement("script"),He(f),En(f,"link",l),t.head.appendChild(f),r.instance=f);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&!(r.state.loading&4)&&(l=r.instance,r.state.loading|=4,Yc(l,o.precedence,t));return r.instance}function Yc(t,r,o){for(var l=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,g=f,S=0;S<l.length;S++){var D=l[S];if(D.dataset.precedence===r)g=D;else if(g!==f)break}g?g.parentNode.insertBefore(t,g.nextSibling):(r=o.nodeType===9?o.head:o,r.insertBefore(t,r.firstChild))}function qp(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.title??(t.title=r.title)}function zp(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.integrity??(t.integrity=r.integrity)}var Zc=null;function Db(t,r,o){if(Zc===null){var l=new Map,f=Zc=new Map;f.set(o,l)}else f=Zc,l=f.get(o),l||(l=new Map,f.set(o,l));if(l.has(t))return l;for(l.set(t,null),o=o.getElementsByTagName(t),f=0;f<o.length;f++){var g=o[f];if(!(g[Ce]||g[bt]||t==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var S=g.getAttribute(r)||"";S=t+S;var D=l.get(S);D?D.push(g):l.set(S,[g])}}return l}function Ob(t,r,o){t=t.ownerDocument||t,t.head.insertBefore(o,r==="title"?t.querySelector("head > title"):null)}function HT(t,r,o){if(o===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return t=r.disabled,typeof r.precedence=="string"&&t==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function Pb(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}var yl=null;function VT(){}function $T(t,r,o){if(yl===null)throw Error(s(475));var l=yl;if(r.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&!(r.state.loading&4)){if(r.instance===null){var f=ts(o.href),g=t.querySelector(hl(f));if(g){t=g._p,typeof t=="object"&&t&&typeof t.then=="function"&&(l.count++,l=eu.bind(l),t.then(l,l)),r.state.loading|=4,r.instance=g,He(g);return}g=t.ownerDocument||t,o=Tb(o),(f=xr.get(f))&&qp(o,f),g=g.createElement("link"),He(g);var S=g;S._p=new Promise(function(D,F){S.onload=D,S.onerror=F}),En(g,"link",o),r.instance=g}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(r,t),(t=r.state.preload)&&!(r.state.loading&3)&&(l.count++,r=eu.bind(l),t.addEventListener("load",r),t.addEventListener("error",r))}}function WT(){if(yl===null)throw Error(s(475));var t=yl;return t.stylesheets&&t.count===0&&Fp(t,t.stylesheets),0<t.count?function(r){var o=setTimeout(function(){if(t.stylesheets&&Fp(t,t.stylesheets),t.unsuspend){var l=t.unsuspend;t.unsuspend=null,l()}},6e4);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(o)}}:null}function eu(){if(this.count--,this.count===0){if(this.stylesheets)Fp(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var tu=null;function Fp(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,tu=new Map,r.forEach(UT,t),tu=null,eu.call(t))}function UT(t,r){if(!(r.state.loading&4)){var o=tu.get(t);if(o)var l=o.get(null);else{o=new Map,tu.set(t,o);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<f.length;g++){var S=f[g];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(o.set(S.dataset.precedence,S),l=S)}l&&o.set(null,l)}f=r.instance,S=f.getAttribute("data-precedence"),g=o.get(S)||l,g===l&&o.set(null,f),o.set(S,f),this.count++,l=eu.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),g?g.parentNode.insertBefore(f,g.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),r.state.loading|=4}}var vl={$$typeof:G,Provider:null,Consumer:null,_currentValue:Ne,_currentValue2:Ne,_threadCount:0};function KT(t,r,o,l,f,g,S,D){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=St(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=St(0),this.hiddenUpdates=St(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=g,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function QT(t,r,o,l,f,g,S,D,F,re,pe,ve){return t=new KT(t,r,o,S,D,F,re,ve),r=1,g===!0&&(r|=24),g=rr(3,null,null,r),t.current=g,g.stateNode=t,r=xf(),r.refCount++,t.pooledCache=r,r.refCount++,g.memoizedState={element:l,isDehydrated:o,cache:r},Ef(g),t}function GT(t){return t?(t=Ma,t):Ma}function Nb(t,r,o,l,f,g){f=GT(f),l.context===null?l.context=f:l.pendingContext=f,l=Qo(r),l.payload={element:o},g=g===void 0?null:g,g!==null&&(l.callback=g),o=Go(t,l,r),o!==null&&(sr(o,t,r),Qs(o,t,r))}function Mb(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var o=t.retryLane;t.retryLane=o!==0&&o<r?o:r}}function Bp(t,r){Mb(t,r),(t=t.alternate)&&Mb(t,r)}function Lb(t){if(t.tag===13){var r=Na(t,67108864);r!==null&&sr(r,t,67108864),Bp(t,67108864)}}var nu=!0;function JT(t,r,o,l){var f=Q.T;Q.T=null;var g=K.p;try{K.p=2,Hp(t,r,o,l)}finally{K.p=g,Q.T=f}}function XT(t,r,o,l){var f=Q.T;Q.T=null;var g=K.p;try{K.p=8,Hp(t,r,o,l)}finally{K.p=g,Q.T=f}}function Hp(t,r,o,l){if(nu){var f=Vp(l);if(f===null)Dp(t,r,l,ru,o),Ib(t,l);else if(ZT(f,t,r,o,l))l.stopPropagation();else if(Ib(t,l),r&4&&-1<YT.indexOf(t)){for(;f!==null;){var g=it(f);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var S=Ge(g.pendingLanes);if(S!==0){var D=g;for(D.pendingLanes|=2,D.entangledLanes|=2;S;){var F=1<<31-Ft(S);D.entanglements[1]|=F,S&=~F}Si(g),!(_t&6)&&(Fc=vn()+500,dl(0,!1))}}break;case 13:D=Na(g,2),D!==null&&sr(D,g,2),Hc(),Bp(g,2)}if(g=Vp(l),g===null&&Dp(t,r,l,ru,o),g===f)break;f=g}f!==null&&l.stopPropagation()}else Dp(t,r,l,null,o)}}function Vp(t){return t=Ra(t),$p(t)}var ru=null;function $p(t){if(ru=null,t=tt(t),t!==null){var r=d(t);if(r===null)t=null;else{var o=r.tag;if(o===13){if(t=p(r),t!==null)return t;t=null}else if(o===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return ru=t,null}function Ab(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ln()){case Pr:return 2;case An:return 8;case nn:case Fi:return 32;case $r:return 268435456;default:return 32}default:return 32}}var Wp=!1,ao=null,so=null,lo=null,bl=new Map,wl=new Map,co=[],YT="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 Ib(t,r){switch(t){case"focusin":case"focusout":ao=null;break;case"dragenter":case"dragleave":so=null;break;case"mouseover":case"mouseout":lo=null;break;case"pointerover":case"pointerout":bl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":wl.delete(r.pointerId)}}function _l(t,r,o,l,f,g){return t===null||t.nativeEvent!==g?(t={blockedOn:r,domEventName:o,eventSystemFlags:l,nativeEvent:g,targetContainers:[f]},r!==null&&(r=it(r),r!==null&&Lb(r)),t):(t.eventSystemFlags|=l,r=t.targetContainers,f!==null&&r.indexOf(f)===-1&&r.push(f),t)}function ZT(t,r,o,l,f){switch(r){case"focusin":return ao=_l(ao,t,r,o,l,f),!0;case"dragenter":return so=_l(so,t,r,o,l,f),!0;case"mouseover":return lo=_l(lo,t,r,o,l,f),!0;case"pointerover":var g=f.pointerId;return bl.set(g,_l(bl.get(g)||null,t,r,o,l,f)),!0;case"gotpointercapture":return g=f.pointerId,wl.set(g,_l(wl.get(g)||null,t,r,o,l,f)),!0}return!1}function jb(t){var r=tt(t.target);if(r!==null){var o=d(r);if(o!==null){if(r=o.tag,r===13){if(r=p(o),r!==null){t.blockedOn=r,Zn(t.priority,function(){if(o.tag===13){var l=_r();l=Bn(l);var f=Na(o,l);f!==null&&sr(f,o,l),Bp(o,l)}});return}}else if(r===3&&o.stateNode.current.memoizedState.isDehydrated){t.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}t.blockedOn=null}function iu(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var o=Vp(t.nativeEvent);if(o===null){o=t.nativeEvent;var l=new o.constructor(o.type,o);Os=l,o.target.dispatchEvent(l),Os=null}else return r=it(o),r!==null&&Lb(r),t.blockedOn=o,!1;r.shift()}return!0}function qb(t,r,o){iu(t)&&o.delete(r)}function e3(){Wp=!1,ao!==null&&iu(ao)&&(ao=null),so!==null&&iu(so)&&(so=null),lo!==null&&iu(lo)&&(lo=null),bl.forEach(qb),wl.forEach(qb)}function ou(t,r){t.blockedOn===r&&(t.blockedOn=null,Wp||(Wp=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,e3)))}var au=null;function zb(t){au!==t&&(au=t,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){au===t&&(au=null);for(var r=0;r<t.length;r+=3){var o=t[r],l=t[r+1],f=t[r+2];if(typeof l!="function"){if($p(l||o)===null)continue;break}var g=it(o);g!==null&&(t.splice(r,3),r-=3,Wf(g,{pending:!0,data:f,method:o.method,action:l},l,f))}}))}function xl(t){function r(F){return ou(F,t)}ao!==null&&ou(ao,t),so!==null&&ou(so,t),lo!==null&&ou(lo,t),bl.forEach(r),wl.forEach(r);for(var o=0;o<co.length;o++){var l=co[o];l.blockedOn===t&&(l.blockedOn=null)}for(;0<co.length&&(o=co[0],o.blockedOn===null);)jb(o),o.blockedOn===null&&co.shift();if(o=(t.ownerDocument||t).$$reactFormReplay,o!=null)for(l=0;l<o.length;l+=3){var f=o[l],g=o[l+1],S=f[jt]||null;if(typeof g=="function")S||zb(o);else if(S){var D=null;if(g&&g.hasAttribute("formAction")){if(f=g,S=g[jt]||null)D=S.formAction;else if($p(f)!==null)continue}else D=S.action;typeof D=="function"?o[l+1]=D:(o.splice(l,3),l-=3),zb(o)}}}function Up(t){this._internalRoot=t}Kp.prototype.render=Up.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(s(409));var o=r.current;Nb(o,_r(),t,r,null,null)},Kp.prototype.unmount=Up.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;Nb(t.current,2,null,t,null,null),Hc(),r[P]=null}};function Kp(t){this._internalRoot=t}Kp.prototype.unstable_scheduleHydration=function(t){if(t){var r=ui();t={blockedOn:null,target:t,priority:r};for(var o=0;o<co.length&&r!==0&&r<co[o].priority;o++);co.splice(o,0,t),o===0&&jb(t)}};var Fb=i.version;if(Fb!=="19.1.1")throw Error(s(527,Fb,"19.1.1"));K.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=v(r),t=t===null?null:w(t),t=t===null?null:t.stateNode,t};var t3={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:Q,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var su=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!su.isDisabled&&su.supportsFiber)try{Ht=su.inject(t3),Qt=su}catch{}}e.createRoot=function(t,r){if(!c(t))throw Error(s(299));var o=!1,l="",f=ZE,g=eT,S=tT,D=null;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(f=r.onUncaughtError),r.onCaughtError!==void 0&&(g=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError),r.unstable_transitionCallbacks!==void 0&&(D=r.unstable_transitionCallbacks)),r=QT(t,1,!1,null,null,o,l,f,g,S,D,null),t[P]=r.current,fb(t),new Up(r)}})),$u=ke(((e,n)=>{function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(a){console.error(a)}}i(),n.exports=yo()})),Zm="Expected a function";function c_(e,n){var i;if(typeof n!="function")throw TypeError(Zm);return e=g3(e),function(){return--e>0&&(i=n.apply(this,arguments)),e<=1&&(n=void 0),i}}var u_=c_;function d_(e){return u_(2,e)}let eh;ym=d_,eh=Math.max;function f_(e){if(!(e&&e.length))return[];var n=0;return e=b3(e,function(i){if(v3(i))return n=eh(i.length,n),!0}),m3(n,function(i){return h3(e,w3(i))})}var p_=y3(f_);pm=function(e,n){if(e==null)throw Error(n||`Expected value but got ${e}`)},BigInt.prototype.toJSON=function(){return JSON.rawJSON(this.toString())},Em=function(e){try{return JSON.parse(e,(n,i)=>td(i))}catch{}if(e==null||e==="")return{};try{return e??(e=""),e=e.replaceAll(new RegExp(`(?<=\\s|^|\\[|,|:)(NaN|-Infinity|Infinity)(?=(?:[^"'\\\\]*(\\\\.|'([^'\\\\]*\\\\.)*[^'\\\\]*'|"([^"\\\\]*\\\\.)*[^"\\\\]*"))*[^"']*$)`,"g"),'"\u25D0$1\u25D0"'),JSON.parse(e,(n,i)=>typeof i=="string"?i==="\u25D0NaN\u25D0"?NaN:i==="\u25D0Infinity\u25D0"?1/0:i==="\u25D0-Infinity\u25D0"?-1/0:td(i):td(i))}catch{return{}}},iw=function(e){if(e.length===0)return"";let n=Object.keys(e[0]),i=e.map(a=>n.map(s=>a[s]).join(" "));return`${n.join(" ")}
11
+ ${i.join(`
12
+ `)}`};function td(e){return typeof e=="object"&&e&&"$bigint"in e&&typeof e.$bigint=="string"?BigInt(e.$bigint):e}var th="abcdefghijklmnopqrstuvwxyz",nh=th+th.toUpperCase(),rh=new Set;fo={create(){let e=0,n;do{let i="";for(let a=0;a<4;a++)i+=nh[Math.floor(Math.random()*nh.length)];n=i,e++}while(rh.has(n)&&e<100);if(e>=100)throw Error("Failed to generate unique CellId after 100 attempts");return rh.add(n),n}},cr={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 n=e;for(;n;){let i=cr.findElement(n);if(i)return i;let a=n.getRootNode();if(n=a instanceof ShadowRoot?a.host:n.parentElement,n===a)break}return null}},L2=function(e){let n=null,i=cr.findElementThroughShadowDOMs(e);return i&&(n=cr.parse(i.id)),n},Pu={parse(e){return e.getAttribute("object-id")},parseOrThrow(e){let n=Pu.parse(e);return dn(n,"<marimo-ui-element/> missing object-id attribute"),n}},e_={create(e){return`output-${e}`}},bm=new class{getFilename(){return this.getSearchParam("filename")}setFilename(e){this.setSearchParam("filename",e)}getCodeFromSearchParam(){return this.getSearchParam("code")}getCodeFromHash(){let e=window.location.hash;return e.startsWith("#code/")?e.slice(6):null}setCodeForHash(e){window.location.hash=`#code/${e}`}setSearchParam(e,n){let i=new URL(window.location.href);i.searchParams.set(e,n),window.history.replaceState({},"",i.toString())}getSearchParam(e){return new URL(window.location.href).searchParams.get(e)}},Eu=function(e){return Em(e??"")},O2=function(e){return ei.mapValues(e.dataset,n=>typeof n=="string"?Eu(n):n)},j2=function(e,n){let i=e.parentElement?Pu.parse(e.parentElement):void 0;return i&&n.has(i)?n.lookupValue(i):Eu(e.dataset.initialValue)},Nl=function(){if(x3())return document.title||null;if(k3()){let i=bm.getFilename();if(i)return i}let e=document.querySelector("marimo-filename");pm(e,"marimo-filename tag not found");let n=e.innerHTML;return n.length===0?null:n};var m_=Symbol("");Rw=function(e,n){return Fe(e,function(i,a,s){a(this,n(i(this),s))})};function nd(e,n){let i=null,a=new Map,s=new Set,c=p=>{let h;if(n===void 0)h=a.get(p);else for(let[w,_]of a)if(n(w,p)){h=_;break}if(h!==void 0)if(i!=null&&i(h[1],p))c.remove(p);else return h[0];let v=e(p);return a.set(p,[v,Date.now()]),d("CREATE",p,v),v},d=(p,h,v)=>{for(let w of s)w({type:p,param:h,atom:v})};return c.unstable_listen=p=>(s.add(p),()=>{s.delete(p)}),c.getParams=()=>a.keys(),c.remove=p=>{if(n===void 0){if(!a.has(p))return;let[h]=a.get(p);a.delete(p),d("REMOVE",p,h)}else for(let[h,[v]]of a)if(n(h,p)){a.delete(h),d("REMOVE",h,v);break}},c.setShouldRemove=p=>{if(i=p,i)for(let[h,[v,w]]of a)i(w,h)&&(a.delete(h),d("REMOVE",h,v))},c}var rd=(e,n,i)=>(n.has(i)?n:n.set(i,e())).get(i),h_=new WeakMap,g_=(e,n,i,a)=>rd(e,rd(()=>new WeakMap,rd(()=>new WeakMap,h_,n),i),a);function y_(e,n,i=Object.is){return g_(()=>{let a=Symbol(),s=([d,p])=>{if(p===a)return n(d);let h=n(d,p);return i(p,h)?p:h},c=Fe(d=>{let p=d(c);return s([d(e),p])});return c.init=a,c},e,n,i)}var ih=(e,n,i)=>(n.has(i)?n:n.set(i,e())).get(i),v_=new WeakMap,b_=(e,n,i)=>ih(e,ih(()=>new WeakMap,v_,n),i),w_={},oh=e=>!!e.write,__=e=>typeof e=="function";function x_(e,n){return b_(()=>{let i=new WeakMap,a=(d,p)=>{let h=i.get(d);if(h)return h;let v=p&&i.get(p),w=[],_=[];return d.forEach((C,E)=>{let R=n?n(C):E;_[E]=R;let A=v&&v.atomList[v.keyList.indexOf(R)];if(A){w[E]=A;return}let H=V=>{let U=V(s),L=V(e),G=a(L,U==null?void 0:U.arr).keyList.indexOf(R);if(G<0||G>=L.length){let he=d[a(d).keyList.indexOf(R)];if(he)return he;throw Error("splitAtom: index out of bounds for read")}return L[G]};w[E]=oh(e)?Fe(H,(V,U,L)=>{let G=V(s),he=V(e),N=a(he,G==null?void 0:G.arr).keyList.indexOf(R);if(N<0||N>=he.length)throw Error("splitAtom: index out of bounds for write");let I=__(L)?L(he[N]):L;Object.is(he[N],I)||U(e,[...he.slice(0,N),I,...he.slice(N+1)])}):Fe(H)}),h=v&&v.keyList.length===_.length&&v.keyList.every((C,E)=>C===_[E])?v:{arr:d,atomList:w,keyList:_},i.set(d,h),h},s=Fe(d=>{let p=d(s);return a(d(e),p==null?void 0:p.arr)});s.init=void 0;let c=oh(e)?Fe(d=>d(s).atomList,(d,p,h)=>{switch(h.type){case"remove":{let v=d(c).indexOf(h.atom);if(v>=0){let w=d(e);p(e,[...w.slice(0,v),...w.slice(v+1)])}break}case"insert":{let v=h.before?d(c).indexOf(h.before):d(c).length;if(v>=0){let w=d(e);p(e,[...w.slice(0,v),h.value,...w.slice(v)])}break}case"move":{let v=d(c).indexOf(h.atom),w=h.before?d(c).indexOf(h.before):d(c).length;if(v>=0&&w>=0){let _=d(e);v<w?p(e,[..._.slice(0,v),..._.slice(v+1,w),_[v],..._.slice(w)]):p(e,[..._.slice(0,w),_[v],..._.slice(w,v),..._.slice(v+1)])}break}}}):Fe(d=>d(s).atomList);return c},e,n||w_)}var ah=e=>typeof(e==null?void 0:e.then)=="function";function sh(e=()=>{try{return window.localStorage}catch{return}},n){var p;let i,a,s={getItem:(h,v)=>{var C;let w=E=>{if(E||(E=""),i!==E){try{a=JSON.parse(E,n==null?void 0:n.reviver)}catch{return v}i=E}return a},_=((C=e())==null?void 0:C.getItem(h))??null;return ah(_)?_.then(w):w(_)},setItem:(h,v)=>{var w;return(w=e())==null?void 0:w.setItem(h,JSON.stringify(v,n==null?void 0:n.replacer))},removeItem:h=>{var v;return(v=e())==null?void 0:v.removeItem(h)}},c=h=>(v,w,_)=>h(v,C=>{let E;try{E=JSON.parse(C||"")}catch{E=_}w(E)}),d;try{d=(p=e())==null?void 0:p.subscribe}catch{}return!d&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(d=(h,v)=>{if(!(e()instanceof window.Storage))return()=>{};let w=_=>{_.storageArea===e()&&_.key===h&&v(_.newValue)};return window.addEventListener("storage",w),()=>{window.removeEventListener("storage",w)}}),d&&(s.subscribe=c(d)),s}var k_=sh();Su=function(e,n,i=k_,a){let s=Fe(a!=null&&a.getOnInit?i.getItem(e,n):n);return s.onMount=c=>{c(i.getItem(e,n));let d;return i.subscribe&&(d=i.subscribe(e,c,n)),d},Fe(c=>c(s),(c,d,p)=>{let h=typeof p=="function"?p(c(s)):p;return h===m_?(d(s,n),i.removeItem(e)):ah(h)?h.then(v=>(d(s,v),i.setItem(e,v))):(d(s,h),i.setItem(e,h))})},zn=function(e){let n,i,a;return typeof e=="object"?(n=e.hashFunction,i=e.expiring,a=e.tags):n=e,(s,c,d)=>{if(d.value!=null)d.value=lh(d.value,n,i,a);else if(d.get!=null)d.get=lh(d.get,n,i,a);else throw"Only put a Memoize() decorator on a method or get accessor."}};var id=new Map;function lh(e,n,i=0,a){let s=Symbol("__memoized_map__");return function(...c){let d;this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let p=this[s];if(Array.isArray(a))for(let h of a)id.has(h)?id.get(h).push(p):id.set(h,[p]);if(n||c.length>0||i>0){let h;h=n===!0?c.map(_=>_.toString()).join("!"):n?n.apply(this,c):c[0];let v=`${h}__timestamp`,w=!1;if(i>0)if(!p.has(v))w=!0;else{let _=p.get(v);w=Date.now()-_>i}p.has(h)&&!w?d=p.get(h):(d=e.apply(this,c),p.set(h,d),i>0&&p.set(v,Date.now()))}else{let h=this;p.has(h)?d=p.get(h):(d=e.apply(this,c),p.set(h,d))}return d}}ss=Fe(Nl()),W2=Fe(void 0);var C_=class{constructor(){De(this,"store",new Map)}get length(){return this.store.size}clear(){this.store.clear()}getItem(e){return this.store.get(e)||null}key(e){return[...this.store.keys()][e]||null}removeItem(e){this.store.delete(e)}setItem(e,n){this.store.set(e,n)}};function S_(){let{hasLocalStorage:e,hasSessionStorage:n}=Y3();return e?window.localStorage:n?window.sessionStorage:new C_}os=S_();let Ni;ew=class{constructor(e,n=os){this.defaultValue=e,this.storage=n}get(e){try{let n=this.storage.getItem(e);return n?JSON.parse(n):this.defaultValue}catch{return this.defaultValue}}set(e,n){this.storage.setItem(e,JSON.stringify(n))}remove(e){this.storage.removeItem(e)}},xu=class{constructor(e,n,i=os){this.schema=e,this.getDefaultValue=n,this.storage=i}get(e){try{let n=this.storage.getItem(e);if(n==null)return this.getDefaultValue();let i=this.schema.safeParse(JSON.parse(n));return i.success?i.data:(Pe.warn("Error parsing zod local storage",i.error),this.getDefaultValue())}catch(n){return Pe.warn("Error getting zod local storage",n),this.getDefaultValue()}}set(e,n){this.storage.setItem(e,JSON.stringify(n))}remove(e){this.storage.removeItem(e)}},Qm=class extends xu{constructor(e,n,i){let a=ct.get(ss);super(n,i),this.filename=a;try{this.unsubscribeFromFilename=ct.sub(ss,()=>{let s=ct.get(ss);this.handleFilenameChange(e,s)})}catch{this.unsubscribeFromFilename=null}}get(e){return super.get(this.createScopedKey(e,this.filename))}set(e,n){super.set(this.createScopedKey(e,this.filename),n)}remove(e){super.remove(this.createScopedKey(e,this.filename))}createScopedKey(e,n){return n?`${e}:${n}`:e}handleFilenameChange(e,n){if(n&&n!==this.filename){let i=this.get(e);this.remove(e),this.filename=n,this.set(e,i)}}dispose(){this.unsubscribeFromFilename&&(this.unsubscribeFromFilename=(this.unsubscribeFromFilename(),null))}},Ni="marimo:notebook-col-sizes";function E_(){return{widths:[]}}var da=new Qm(Ni,Wb({widths:f3(d3([u3(),c3("contentWidth")]).default("contentWidth"))}),E_);C2={getColumnWidth:e=>da.get(Ni).widths[e]??"contentWidth",saveColumnWidth:(e,n)=>{let i=da.get(Ni).widths;if(i[e])i[e]=n;else{for(;i.length<=e;)i.push("contentWidth");i[e]=n}da.set(Ni,{widths:i})},clearStorage:()=>{da.remove(Ni)}};function T_(e,n){let i=da.get(Ni).widths,a=Cl(i,e,n);da.set(Ni,{widths:a})}var ch,uh,dh,Tr,fh,ph,mh,hh,Fn,gh,yh,vh,bh,wh,_h,en;function Kn(e,n,i,a,s){var c={};return Object.keys(a).forEach(function(d){c[d]=a[d]}),c.enumerable=!!c.enumerable,c.configurable=!!c.configurable,("value"in c||c.initializer)&&(c.writable=!0),c=i.slice().reverse().reduce(function(d,p){return p(e,n,d)||d},c),s&&c.initializer!==void 0&&(c.value=c.initializer?c.initializer.call(s):void 0,c.initializer=void 0),c.initializer===void 0?(Object.defineProperty(e,n,c),null):c}let vo=(ch=zn(),uh=zn(),dh=zn(),Tr=class{constructor(e,n,i){this.value=e,this.isCollapsed=n,this.children=i}geDescendantCount(){let e=0,n=[...this.children];for(;n.length>0;){let i=n.pop();e++;for(let a=i.children.length-1;a>=0;a--)n.push(i.children[a])}return e}getDescendants(){let e=[],n=[...this.children];for(;n.length>0;){let i=n.pop();e.push(i.value);for(let a=i.children.length-1;a>=0;a--)n.push(i.children[a])}return e}get inOrderIds(){let e=[],n=i=>{e.push(i.value);for(let a of i.children)n(a)};for(let i of this.children)n(i);return e}toString(){return this.isCollapsed?`${this.value} (collapsed)`:String(this.value)}equals(e){return this.value===e.value}},Kn(Tr.prototype,"geDescendantCount",[ch],Object.getOwnPropertyDescriptor(Tr.prototype,"geDescendantCount"),Tr.prototype),Kn(Tr.prototype,"getDescendants",[uh],Object.getOwnPropertyDescriptor(Tr.prototype,"getDescendants"),Tr.prototype),Kn(Tr.prototype,"inOrderIds",[dh],Object.getOwnPropertyDescriptor(Tr.prototype,"inOrderIds"),Tr.prototype),Tr);var R_=0;let fa;fa=(fh=zn(),ph=zn(),mh=zn(),hh=zn(),Fn=class ua{constructor(n,i){this.nodes=n,this.id=i}static from(n){let i=`tree_${R_++}`;return new ua(n.map(a=>new vo(a,!1,[])),i)}static fromWithPreviousShape(n,i){var c;if(!i)return ua.from(n);let a=i.id,s=new ua(n.map(d=>new vo(d,!1,[])),a);for(let d of n)if(i.isCollapsed(d)){let p=((c=i._nodeMap.get(d))==null?void 0:c.children)??[];for(let h=p.length-1;h>=0;h--){let v=p[h];if(s._nodeMap.has(v.value)){s=s.collapse(d,v.value);break}}}return s}withNodes(n){return new ua(n,this.id)}get topLevelIds(){return this.nodes.map(n=>n.value)}get inOrderIds(){return this.nodes.flatMap(n=>[n.value,...n.inOrderIds])}get idSet(){return new Set(this.inOrderIds)}get length(){return this.nodes.length}get _nodeMap(){let n=new Map;for(let i of this.nodes)n.set(i.value,i);return n}getDescendants(n){let i=this._nodeMap.get(n);return i?i.getDescendants():(Pe.warn(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`),[])}isCollapsed(n){let i=this._nodeMap.get(n);return i?i.isCollapsed:(Pe.warn(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`),!1)}indexOfOrThrow(n){let i=this.nodes.findIndex(a=>a.value===n);if(i===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);return i}slice(n,i){return this.nodes.slice(n,i).map(a=>a.value)}moveToFront(n){let i=this.indexOfOrThrow(n);return this.withNodes(Cl(this.nodes,i,0))}moveToBack(n){let i=this.indexOfOrThrow(n);return this.withNodes(Cl(this.nodes,i,this.nodes.length-1))}collapse(n,i){let a=this.nodes.findIndex(h=>h.value===n);if(a===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);let s=i===void 0?this.nodes.length:this.nodes.findIndex(h=>h.value===i);if(s===-1)throw Error(`Node ${i} not found in tree`);if(s<a)throw Error(`Node ${i} is before node ${n}`);let c=[...this.nodes],d=c[a];if(d.isCollapsed)throw Error(`Node ${n} is already collapsed`);let p=c.splice(a+1,s-a);return c[a]=new vo(d.value,!0,p),this.withNodes(c)}collapseAll(n){let i=[...this.nodes];if(n.length===0)throw Error("No collapse ranges provided");if(n.length!==i.length)throw Error(`Collapse ranges length ${n.length} does not match tree length ${i.length}`);let a=i.length-1;for(;a>=0;){let s=i[a],c=n[a];if(!s.isCollapsed&&c){let{id:d,until:p}=c;if(d!==s.value)throw Error(`Node ${s.value} does not match collapse range id ${d}`);let h=p===void 0?i.length:i.findIndex(w=>w.value===p);if(h===-1)throw Error(`Node ${p} not found in tree`);if(h<a)throw Error(`Node ${p} is before node ${d}`);let v=i.splice(a+1,h-a);i[a]=new vo(s.value,!0,v),a--}else a--}return this.withNodes(i)}expand(n){let i=this.nodes.findIndex(c=>c.value===n);if(i===-1)throw Error(`Node ${n} not found in tree. Valid ids: ${this.topLevelIds}`);let a=[...this.nodes],s=a[i];if(!s.isCollapsed)throw Error(`Node ${n} is already expanded`);return a[i]=new vo(s.value,!1,[]),a=c2(a,i+1,s.children),this.withNodes(a)}expandAll(){let n=[...this.nodes],i=0;for(;i<n.length;){let a=n[i];a.isCollapsed&&(n[i]=new vo(a.value,!1,[]),n=c2(n,i+1,a.children)),i++}return this.withNodes(n)}move(n,i){return this.withNodes(Cl(this.nodes,n,i))}at(n){var i;return(i=this.nodes.at(n))==null?void 0:i.value}atOrThrow(n){let i=this.nodes.at(n);if(i===void 0)throw Error(`Node at index ${n} not found in tree`);return i.value}first(){return this.atOrThrow(0)}last(){return this.atOrThrow(this.nodes.length-1)}after(n){let i=this.indexOfOrThrow(n);if(i!==this.nodes.length-1)return this.at(i+1)}before(n){let i=this.indexOfOrThrow(n);if(i!==0)return this.at(i-1)}insert(n,i){return this.withNodes(l2(this.nodes,i,new vo(n,!1,[])))}insertAtEnd(n){return this.insert(n,this.nodes.length)}insertAtStart(n){return this.insert(n,0)}deleteAtIndex(n){let i=this.atOrThrow(n),a=this.withNodes(this.nodes);try{a=a.expand(i)}catch{}return this.withNodes(X3(a.nodes,n))}delete(n){let i=this.indexOfOrThrow(n);return this.deleteAtIndex(i)}getCount(n){var i;return((i=this._nodeMap.get(n))==null?void 0:i.geDescendantCount())??0}findAndExpandDeep(n){let i=this.find(n);if(i.length===0)return this;let a=this.withNodes(this.nodes);for(let s of i)try{a=a.expand(s)}catch{}return a}find(n){function i(a,s){for(let c of a){if(c.value===n)return[...s,n];let d=i(c.children,[...s,c.value]);if(d.length>0)return d}return[]}return i(this.nodes,[])}split(n){let i=this.nodes.findIndex(c=>c.value===n);if(i===-1)throw Error(`Node ${n} not found in tree`);let a=this.nodes.slice(0,i),s=this.nodes.slice(i);return a.length===0?[ua.from([]),this.withNodes(s)]:[this.withNodes(a),ua.from([]).withNodes(s)]}equals(n){return this.nodes.length===n.nodes.length&&this.nodes.every((i,a)=>i.value===n.nodes[a].value)}toString(){let n=0,i="",a=s=>{for(let c of s)i+=`${" ".repeat(n*2)}${c.toString()}
13
+ `,n+=1,a(c.children),--n};return a(this.nodes),i}},Kn(Fn.prototype,"topLevelIds",[fh],Object.getOwnPropertyDescriptor(Fn.prototype,"topLevelIds"),Fn.prototype),Kn(Fn.prototype,"inOrderIds",[ph],Object.getOwnPropertyDescriptor(Fn.prototype,"inOrderIds"),Fn.prototype),Kn(Fn.prototype,"idSet",[mh],Object.getOwnPropertyDescriptor(Fn.prototype,"idSet"),Fn.prototype),Kn(Fn.prototype,"_nodeMap",[hh],Object.getOwnPropertyDescriptor(Fn.prototype,"_nodeMap"),Fn.prototype),Fn),Ml=(gh=zn(),yh=zn(),vh=zn(),bh=zn(),wh=zn(),_h=zn(),en=class Mn{constructor(n){this.columns=n,n.length===0&&(this.columns=[fa.from([])])}static from(n){return new Mn(n.map(i=>fa.from(i)))}static fromWithPreviousShape(n,i){if(!i)return Mn.from([n]);let a=i.getColumns(),s=Array.from({length:a.length},()=>[]),c=0;for(let d of n){let p=a.findIndex(h=>h.idSet.has(d));p===-1?s[c].push(d):(c=p,s[p].push(d))}return new Mn(s.map((d,p)=>fa.fromWithPreviousShape(d,a[p])))}isEmpty(){return this.columns.length===0?!0:this.columns.every(n=>n.nodes.length===0)}static fromIdsAndColumns(n){let i=Math.max(1,...n.map(([,c])=>(c??0)+1)),a=Array.from({length:i},()=>[]),s=0;for(let[c,d]of n)d==null||d<0?a[s].push(c):(a[d].push(c),s=d);return Mn.from(a)}get topLevelIds(){return this.columns.map(n=>n.topLevelIds)}get iterateTopLevelIds(){let n=this.columns;function*i(){for(let a of n)for(let s of a.topLevelIds)yield s}return i()}get inOrderIds(){return this.columns.flatMap(n=>n.inOrderIds)}get colLength(){return this.columns.length}get idLength(){return this.columns.reduce((n,i)=>n+i.nodes.length,0)}get _columnMap(){return new Map(this.columns.map(n=>[n.id,n]))}at(n){return this.columns[n]}get(n){return this._columnMap.get(n)}atOrThrow(n){let i=this.columns[n];if(!i)throw Error(`Column ${n} not found`);return i}hasOnlyOneColumn(){return this.columns.length===1}getColumns(){return this.columns}hasOnlyOneId(){return this.idLength===1}getColumnIds(){return this.columns.map(n=>n.id)}indexOf(n){return this.columns.indexOf(n)}addColumn(n,i=[]){return new Mn(this.columns.flatMap(a=>a.id===n?[a,fa.from(i)]:[a]))}insertBreakpoint(n){let i=this.findWithId(n),[a,s]=i.split(n);return new Mn(this.columns.flatMap(c=>c===i?[a,s].filter(Boolean):[c]))}delete(n){if(this.columns.length<=1)return this;let i=this.indexOfOrThrow(n),a=i===0?1:i-1,s=[...this.columns],c=s[i];return s[a]=c.withNodes([...s[a].nodes,...c.nodes]),s.splice(i,1),new Mn(s)}mergeAllColumns(){if(this.columns.length<=1)return this;let n=this.columns.flatMap(a=>a.nodes),i=this.columns[0];return new Mn([i.withNodes(n)])}moveWithinColumn(n,i,a){return this.transform(n,s=>s.move(i,a))}moveAcrossColumns(n,i,a,s){let c=this.indexOfOrThrow(n),d=this.indexOfOrThrow(a),p=[...this.columns],h=p[c],v=h.nodes.findIndex(C=>C.value===i);if(v===-1)throw Error(`Node ${i} not found in column ${n}`);let w=h.nodes[v];p[c]=h.withNodes(h.nodes.filter((C,E)=>E!==v));let _=p[d];if(s){let C=_.indexOfOrThrow(s);p[d]=_.withNodes(l2(_.nodes,C,w))}else p[d]=_.withNodes([w,..._.nodes]);return new Mn(p)}indexOfOrThrow(n){let i=this.columns.findIndex(a=>a.id===n);if(i===-1)throw Error(`Column ${n} not found. Possible values: ${this.getColumnIds().join(", ")}`);return i}moveColumn(n,i){if(n===i)return this;let a=this.indexOfOrThrow(n),s=i==="_left_"?a-1:i==="_right_"?a+1:this.indexOfOrThrow(i);return T_(a,s),new Mn(Cl([...this.columns],a,s))}moveToNewColumn(n){let i=this.findWithId(n),a=this.columns.map(c=>c.id===i.id?c.delete(n):c),s=fa.from([n]);return new Mn([...a,s])}findWithId(n){let i=this.columns.find(a=>a.inOrderIds.includes(n));if(!i)throw Pe.log(`Possible values: ${this.columns.map(a=>a.inOrderIds).join(", ")}`),Error(`Cell ${n} not found in any column`);return i}transformWithCellId(n,i){let a=!1,s=this.columns.map(c=>{if(c.inOrderIds.includes(n)){let d=i(c);return c!==d&&(a=!0),d}return c});return a?new Mn(s):this}insertId(n,i,a){return this.transform(i,s=>s.insert(n,a))}deleteById(n){return this.transformWithCellId(n,i=>i.delete(n))}compact(){return this.columns.length===1||!this.columns.some(n=>n.nodes.length===0)?this:new Mn(this.columns.filter(n=>n.nodes.length>0))}transform(n,i){let a=this._columnMap.get(n);if(!a)return Pe.warn(`Column ${n} not found`),this;let s=i(a);return a===s?this:new Mn(this.columns.map(c=>c.id===n?s:c))}transformAll(n){let i=!1,a=this.columns.map(s=>{let c=n(s);return s.equals(c)||(i=!0),c});return i?new Mn(a):this}},Kn(en.prototype,"isEmpty",[gh],Object.getOwnPropertyDescriptor(en.prototype,"isEmpty"),en.prototype),Kn(en.prototype,"topLevelIds",[yh],Object.getOwnPropertyDescriptor(en.prototype,"topLevelIds"),en.prototype),Kn(en.prototype,"inOrderIds",[vh],Object.getOwnPropertyDescriptor(en.prototype,"inOrderIds"),en.prototype),Kn(en.prototype,"idLength",[bh],Object.getOwnPropertyDescriptor(en.prototype,"idLength"),en.prototype),Kn(en.prototype,"_columnMap",[wh],Object.getOwnPropertyDescriptor(en.prototype,"_columnMap"),en.prototype),Kn(en.prototype,"getColumnIds",[_h],Object.getOwnPropertyDescriptor(en.prototype,"getColumnIds"),en.prototype),en);let od,ad,sd,xh,ld,kh,Ch,Sh,Eh,Th,Rh,Dh,cd,ud,Oh,dd,fd;od=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Doctype=e.CDATA=e.Tag=e.Style=e.Script=e.Comment=e.Directive=e.Text=e.Root=e.isTag=e.ElementType=void 0;var n;(function(a){a.Root="root",a.Text="text",a.Directive="directive",a.Comment="comment",a.Script="script",a.Style="style",a.Tag="tag",a.CDATA="cdata",a.Doctype="doctype"})(n=e.ElementType||(e.ElementType={}));function i(a){return a.type===n.Tag||a.type===n.Script||a.type===n.Style}e.isTag=i,e.Root=n.Root,e.Text=n.Text,e.Directive=n.Directive,e.Comment=n.Comment,e.Script=n.Script,e.Style=n.Style,e.Tag=n.Tag,e.CDATA=n.CDATA,e.Doctype=n.Doctype})),ad=ke((e=>{var n=e&&e.__extends||(function(){var N=function(I,$){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(de,fe){de.__proto__=fe}||function(de,fe){for(var xe in fe)Object.prototype.hasOwnProperty.call(fe,xe)&&(de[xe]=fe[xe])},N(I,$)};return function(I,$){if(typeof $!="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");N(I,$);function de(){this.constructor=I}I.prototype=$===null?Object.create($):(de.prototype=$.prototype,new de)}})(),i=e&&e.__assign||function(){return i=Object.assign||function(N){for(var I,$=1,de=arguments.length;$<de;$++)for(var fe in I=arguments[$],I)Object.prototype.hasOwnProperty.call(I,fe)&&(N[fe]=I[fe]);return N},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.cloneNode=e.hasChildren=e.isDocument=e.isDirective=e.isComment=e.isText=e.isCDATA=e.isTag=e.Element=e.Document=e.CDATA=e.NodeWithChildren=e.ProcessingInstruction=e.Comment=e.Text=e.DataNode=e.Node=void 0;var a=od(),s=(function(){function N(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(N.prototype,"parentNode",{get:function(){return this.parent},set:function(I){this.parent=I},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"previousSibling",{get:function(){return this.prev},set:function(I){this.prev=I},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"nextSibling",{get:function(){return this.next},set:function(I){this.next=I},enumerable:!1,configurable:!0}),N.prototype.cloneNode=function(I){return I===void 0&&(I=!1),G(this,I)},N})();e.Node=s;var c=(function(N){n(I,N);function I($){var de=N.call(this)||this;return de.data=$,de}return Object.defineProperty(I.prototype,"nodeValue",{get:function(){return this.data},set:function($){this.data=$},enumerable:!1,configurable:!0}),I})(s);e.DataNode=c;var d=(function(N){n(I,N);function I(){var $=N!==null&&N.apply(this,arguments)||this;return $.type=a.ElementType.Text,$}return Object.defineProperty(I.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),I})(c);e.Text=d;var p=(function(N){n(I,N);function I(){var $=N!==null&&N.apply(this,arguments)||this;return $.type=a.ElementType.Comment,$}return Object.defineProperty(I.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),I})(c);e.Comment=p;var h=(function(N){n(I,N);function I($,de){var fe=N.call(this,de)||this;return fe.name=$,fe.type=a.ElementType.Directive,fe}return Object.defineProperty(I.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),I})(c);e.ProcessingInstruction=h;var v=(function(N){n(I,N);function I($){var de=N.call(this)||this;return de.children=$,de}return Object.defineProperty(I.prototype,"firstChild",{get:function(){return this.children[0]??null},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"childNodes",{get:function(){return this.children},set:function($){this.children=$},enumerable:!1,configurable:!0}),I})(s);e.NodeWithChildren=v;var w=(function(N){n(I,N);function I(){var $=N!==null&&N.apply(this,arguments)||this;return $.type=a.ElementType.CDATA,$}return Object.defineProperty(I.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),I})(v);e.CDATA=w;var _=(function(N){n(I,N);function I(){var $=N!==null&&N.apply(this,arguments)||this;return $.type=a.ElementType.Root,$}return Object.defineProperty(I.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),I})(v);e.Document=_;var C=(function(N){n(I,N);function I($,de,fe,xe){fe===void 0&&(fe=[]),xe===void 0&&(xe=$==="script"?a.ElementType.Script:$==="style"?a.ElementType.Style:a.ElementType.Tag);var te=N.call(this,fe)||this;return te.name=$,te.attribs=de,te.type=xe,te}return Object.defineProperty(I.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"tagName",{get:function(){return this.name},set:function($){this.name=$},enumerable:!1,configurable:!0}),Object.defineProperty(I.prototype,"attributes",{get:function(){var $=this;return Object.keys(this.attribs).map(function(de){var fe,xe;return{name:de,value:$.attribs[de],namespace:(fe=$["x-attribsNamespace"])==null?void 0:fe[de],prefix:(xe=$["x-attribsPrefix"])==null?void 0:xe[de]}})},enumerable:!1,configurable:!0}),I})(v);e.Element=C;function E(N){return(0,a.isTag)(N)}e.isTag=E;function R(N){return N.type===a.ElementType.CDATA}e.isCDATA=R;function A(N){return N.type===a.ElementType.Text}e.isText=A;function H(N){return N.type===a.ElementType.Comment}e.isComment=H;function V(N){return N.type===a.ElementType.Directive}e.isDirective=V;function U(N){return N.type===a.ElementType.Root}e.isDocument=U;function L(N){return Object.prototype.hasOwnProperty.call(N,"children")}e.hasChildren=L;function G(N,I){I===void 0&&(I=!1);var $;if(A(N))$=new d(N.data);else if(H(N))$=new p(N.data);else if(E(N)){var de=I?he(N.children):[],fe=new C(N.name,i({},N.attribs),de);de.forEach(function(Se){return Se.parent=fe}),N.namespace!=null&&(fe.namespace=N.namespace),N["x-attribsNamespace"]&&(fe["x-attribsNamespace"]=i({},N["x-attribsNamespace"])),N["x-attribsPrefix"]&&(fe["x-attribsPrefix"]=i({},N["x-attribsPrefix"])),$=fe}else if(R(N)){var de=I?he(N.children):[],xe=new w(de);de.forEach(function(ie){return ie.parent=xe}),$=xe}else if(U(N)){var de=I?he(N.children):[],te=new _(de);de.forEach(function(ie){return ie.parent=te}),N["x-mode"]&&(te["x-mode"]=N["x-mode"]),$=te}else if(V(N)){var be=new h(N.name,N.data);N["x-name"]!=null&&(be["x-name"]=N["x-name"],be["x-publicId"]=N["x-publicId"],be["x-systemId"]=N["x-systemId"]),$=be}else throw Error(`Not implemented yet: ${N.type}`);return $.startIndex=N.startIndex,$.endIndex=N.endIndex,N.sourceCodeLocation!=null&&($.sourceCodeLocation=N.sourceCodeLocation),$}e.cloneNode=G;function he(N){for(var I=N.map(function(de){return G(de,!0)}),$=1;$<I.length;$++)I[$].prev=I[$-1],I[$-1].next=I[$];return I}})),sd=ke((e=>{var n=e&&e.__createBinding||(Object.create?(function(p,h,v,w){w===void 0&&(w=v);var _=Object.getOwnPropertyDescriptor(h,v);(!_||("get"in _?!h.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return h[v]}}),Object.defineProperty(p,w,_)}):(function(p,h,v,w){w===void 0&&(w=v),p[w]=h[v]})),i=e&&e.__exportStar||function(p,h){for(var v in p)v!=="default"&&!Object.prototype.hasOwnProperty.call(h,v)&&n(h,p,v)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var a=od(),s=ad();i(ad(),e);var c={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},d=(function(){function p(h,v,w){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof v=="function"&&(w=v,v=c),typeof h=="object"&&(v=h,h=void 0),this.callback=h??null,this.options=v??c,this.elementCB=w??null}return p.prototype.onparserinit=function(h){this.parser=h},p.prototype.onreset=function(){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},p.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},p.prototype.onerror=function(h){this.handleCallback(h)},p.prototype.onclosetag=function(){this.lastNode=null;var h=this.tagStack.pop();this.options.withEndIndices&&(h.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(h)},p.prototype.onopentag=function(h,v){var w=this.options.xmlMode?a.ElementType.Tag:void 0,_=new s.Element(h,v,void 0,w);this.addNode(_),this.tagStack.push(_)},p.prototype.ontext=function(h){var v=this.lastNode;if(v&&v.type===a.ElementType.Text)v.data+=h,this.options.withEndIndices&&(v.endIndex=this.parser.endIndex);else{var w=new s.Text(h);this.addNode(w),this.lastNode=w}},p.prototype.oncomment=function(h){if(this.lastNode&&this.lastNode.type===a.ElementType.Comment){this.lastNode.data+=h;return}var v=new s.Comment(h);this.addNode(v),this.lastNode=v},p.prototype.oncommentend=function(){this.lastNode=null},p.prototype.oncdatastart=function(){var h=new s.Text(""),v=new s.CDATA([h]);this.addNode(v),h.parent=v,this.lastNode=h},p.prototype.oncdataend=function(){this.lastNode=null},p.prototype.onprocessinginstruction=function(h,v){var w=new s.ProcessingInstruction(h,v);this.addNode(w)},p.prototype.handleCallback=function(h){if(typeof this.callback=="function")this.callback(h,this.dom);else if(h)throw h},p.prototype.addNode=function(h){var v=this.tagStack[this.tagStack.length-1],w=v.children[v.children.length-1];this.options.withStartIndices&&(h.startIndex=this.parser.startIndex),this.options.withEndIndices&&(h.endIndex=this.parser.endIndex),v.children.push(h),w&&(h.prev=w,w.next=h),h.parent=v,this.lastNode=null},p})();e.DomHandler=d,e.default=d})),xh=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=e.CARRIAGE_RETURN_PLACEHOLDER=e.CARRIAGE_RETURN_REGEX=e.CARRIAGE_RETURN=e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES=void 0,e.CASE_SENSITIVE_TAG_NAMES="animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.linearGradient.radialGradient.textPath".split("."),e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES.reduce(function(n,i){return n[i.toLowerCase()]=i,n},{}),e.CARRIAGE_RETURN="\r",e.CARRIAGE_RETURN_REGEX=new RegExp(e.CARRIAGE_RETURN,"g"),e.CARRIAGE_RETURN_PLACEHOLDER=`__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_${Date.now()}__`,e.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(e.CARRIAGE_RETURN_PLACEHOLDER,"g")})),ld=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatAttributes=s,e.escapeSpecialCharacters=d,e.revertEscapedCharacters=p,e.formatDOM=h;var n=sd(),i=xh();function a(v){return i.CASE_SENSITIVE_TAG_NAMES_MAP[v]}function s(v){for(var w={},_=0,C=v.length;_<C;_++){var E=v[_];w[E.name]=E.value}return w}function c(v){return v=v.toLowerCase(),a(v)||v}function d(v){return v.replace(i.CARRIAGE_RETURN_REGEX,i.CARRIAGE_RETURN_PLACEHOLDER)}function p(v){return v.replace(i.CARRIAGE_RETURN_PLACEHOLDER_REGEX,i.CARRIAGE_RETURN)}function h(v,w,_){w===void 0&&(w=null);for(var C=[],E,R=0,A=v.length;R<A;R++){var H=v[R];switch(H.nodeType){case 1:var V=c(H.nodeName);E=new n.Element(V,s(H.attributes)),E.children=h(V==="template"?H.content.childNodes:H.childNodes,E);break;case 3:E=new n.Text(p(H.nodeValue));break;case 8:E=new n.Comment(H.nodeValue);break;default:continue}var U=C[R-1]||null;U&&(U.next=E),E.parent=w,E.prev=U,E.next=null,C.push(E)}return _&&(E=new n.ProcessingInstruction(_.substring(0,_.indexOf(" ")).toLowerCase(),_),E.next=C[0]||null,E.parent=w,C.unshift(E),C[1]&&(C[1].prev=C[0])),C}})),kh=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=H;var n=ld(),i="html",a="head",s="body",c=/<([a-zA-Z]+[0-9]?)/,d=/<head[^]*>/i,p=/<body[^]*>/i,h=function(V,U){throw Error("This browser does not support `document.implementation.createHTMLDocument`")},v=function(V,U){throw Error("This browser does not support `DOMParser.prototype.parseFromString`")},w=typeof window=="object"&&window.DOMParser;if(typeof w=="function"){var _=new w,C="text/html";v=function(V,U){return U&&(V=`<${U}>${V}</${U}>`),_.parseFromString(V,C)},h=v}if(typeof document=="object"&&document.implementation){var E=document.implementation.createHTMLDocument();h=function(V,U){if(U){var L=E.documentElement.querySelector(U);return L&&(L.innerHTML=V),E}return E.documentElement.innerHTML=V,E}}var R=typeof document=="object"&&document.createElement("template"),A;R&&R.content&&(A=function(V){return R.innerHTML=V,R.content.childNodes});function H(V){var U,L;V=(0,n.escapeSpecialCharacters)(V);var G=V.match(c),he=G&&G[1]?G[1].toLowerCase():"";switch(he){case i:var N=v(V);if(!d.test(V)){var $=N.querySelector(a);(U=$==null?void 0:$.parentNode)==null||U.removeChild($)}if(!p.test(V)){var $=N.querySelector(s);(L=$==null?void 0:$.parentNode)==null||L.removeChild($)}return N.querySelectorAll(i);case a:case s:var I=h(V).querySelectorAll(he);return p.test(V)&&d.test(V)?I[0].parentNode.childNodes:I;default:if(A)return A(V);var $=h(V,s).querySelector(s);return $.childNodes}}})),Ch=ke((e=>{var n=e&&e.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var i=n(kh()),a=ld(),s=/<(![a-zA-Z\s]+)>/;function c(d){if(typeof d!="string")throw TypeError("First argument must be a string");if(!d)return[];var p=d.match(s),h=p?p[1]:void 0;return(0,a.formatDOM)((0,i.default)(d),null,h)}})),Sh=ke((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}})),Eh=ke((e=>{var n=0,i=1,a=2,s=3,c=4,d=5,p=6;function h(L){return w.hasOwnProperty(L)?w[L]:null}function v(L,G,he,N,I,$,de){this.acceptsBooleans=G===a||G===s||G===c,this.attributeName=N,this.attributeNamespace=I,this.mustUseProperty=he,this.propertyName=L,this.type=G,this.sanitizeURL=$,this.removeEmptyString=de}var w={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(L=>{w[L]=new v(L,n,!1,L,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([L,G])=>{w[L]=new v(L,i,!1,G,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(L=>{w[L]=new v(L,a,!1,L.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(L=>{w[L]=new v(L,a,!1,L,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(L=>{w[L]=new v(L,s,!1,L.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(L=>{w[L]=new v(L,s,!0,L,null,!1,!1)}),["capture","download"].forEach(L=>{w[L]=new v(L,c,!1,L,null,!1,!1)}),["cols","rows","size","span"].forEach(L=>{w[L]=new v(L,p,!1,L,null,!1,!1)}),["rowSpan","start"].forEach(L=>{w[L]=new v(L,d,!1,L.toLowerCase(),null,!1,!1)});var _=/[\-\:]([a-z])/g,C=L=>L[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(L=>{let G=L.replace(_,C);w[G]=new v(G,i,!1,L,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(L=>{let G=L.replace(_,C);w[G]=new v(G,i,!1,L,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(L=>{let G=L.replace(_,C);w[G]=new v(G,i,!1,L,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(L=>{w[L]=new v(L,i,!1,L.toLowerCase(),null,!1,!1)});var E="xlinkHref";w[E]=new v("xlinkHref",i,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(L=>{w[L]=new v(L,i,!1,L.toLowerCase(),null,!0,!0)});var{CAMELCASE:R,SAME:A,possibleStandardNames:H}=Sh(),V=RegExp.prototype.test.bind(RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),U=Object.keys(H).reduce((L,G)=>{let he=H[G];return he===A?L[G]=G:he===R?L[G.toLowerCase()]=G:L[G]=he,L},{});e.BOOLEAN=s,e.BOOLEANISH_STRING=a,e.NUMERIC=d,e.OVERLOADED_BOOLEAN=c,e.POSITIVE_NUMERIC=p,e.RESERVED=n,e.STRING=i,e.getPropertyInfo=h,e.isCustomAttribute=V,e.possibleStandardNames=U})),Th=ke(((e,n)=>{var i=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,a=/\n/g,s=/^\s*/,c=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d=/^:\s*/,p=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,h=/^[;\s]*/,v=/^\s+|\s+$/g,w=`
14
+ `,_="/",C="*",E="",R="comment",A="declaration";n.exports=function(V,U){if(typeof V!="string")throw TypeError("First argument must be a string");if(!V)return[];U||(U={});var L=1,G=1;function he(X){var Q=X.match(a);Q&&(L+=Q.length);var K=X.lastIndexOf(w);G=~K?X.length-K:G+X.length}function N(){var X={line:L,column:G};return function(Q){return Q.position=new I(X),xe(),Q}}function I(X){this.start=X,this.end={line:L,column:G},this.source=U.source}I.prototype.content=V;var $=[];function de(X){var Q=Error(U.source+":"+L+":"+G+": "+X);if(Q.reason=X,Q.filename=U.source,Q.line=L,Q.column=G,Q.source=V,U.silent)$.push(Q);else throw Q}function fe(X){var Q=X.exec(V);if(Q){var K=Q[0];return he(K),V=V.slice(K.length),Q}}function xe(){fe(s)}function te(X){var Q;for(X||(X=[]);Q=be();)Q!==!1&&X.push(Q);return X}function be(){var X=N();if(!(_!=V.charAt(0)||C!=V.charAt(1))){for(var Q=2;E!=V.charAt(Q)&&(C!=V.charAt(Q)||_!=V.charAt(Q+1));)++Q;if(Q+=2,E===V.charAt(Q-1))return de("End of comment missing");var K=V.slice(2,Q-2);return G+=2,he(K),V=V.slice(Q),G+=2,X({type:R,comment:K})}}function Se(){var X=N(),Q=fe(c);if(Q){if(be(),!fe(d))return de("property missing ':'");var K=fe(p),Ne=X({type:A,property:H(Q[0].replace(i,E)),value:K?H(K[0].replace(i,E)):E});return fe(h),Ne}}function ie(){var X=[];te(X);for(var Q;Q=Se();)Q!==!1&&(X.push(Q),te(X));return X}return xe(),ie()};function H(V){return V?V.replace(v,E):E}})),Rh=ke((e=>{var n=e&&e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=n(Th());function a(s,c){var d=null;if(!s||typeof s!="string")return d;var p=(0,i.default)(s),h=typeof c=="function";return p.forEach(function(v){if(v.type==="declaration"){var w=v.property,_=v.value;h?c(w,_,v):_&&(d||(d={}),d[w]=_)}}),d}})),Dh=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,a=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,c=/^-(ms)-/,d=function(v){return!v||a.test(v)||n.test(v)},p=function(v,w){return w.toUpperCase()},h=function(v,w){return`${w}-`};e.camelCase=function(v,w){return w===void 0&&(w={}),d(v)?v:(v=v.toLowerCase(),v=w.reactCompat?v.replace(c,h):v.replace(s,h),v.replace(i,p))}})),Jm=ke(((e,n)=>{var i=(e&&e.__importDefault||function(c){return c&&c.__esModule?c:{default:c}})(Rh()),a=Dh();function s(c,d){var p={};return!c||typeof c!="string"||(0,i.default)(c,function(h,v){h&&v&&(p[(0,a.camelCase)(h,d)]=v)}),p}s.default=s,n.exports=s})),cd=ke((e=>{var n=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=p;var i=cu(),a=n(Jm()),s=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function c(h,v){return h.includes("-")?!s.has(h):!!(v&&typeof v.is=="string")}var d={reactCompat:!0};function p(h,v){if(typeof h=="string"){if(!h.trim()){v.style={};return}try{v.style=(0,a.default)(h,d)}catch{v.style={}}}}e.PRESERVE_CUSTOM_ATTRIBUTES=Number(i.version.split(".")[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]),e.canTextBeChildOfNode=function(h){return!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(h.name)},e.returnFirstArg=function(h){return h}})),ud=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var n=Eh(),i=cd(),a=["checked","value"],s=["input","select","textarea"],c={reset:!0,submit:!0};function d(h,v){h===void 0&&(h={});var w={},_=!!(h.type&&c[h.type]);for(var C in h){var E=h[C];if((0,n.isCustomAttribute)(C)){w[C]=E;continue}var R=C.toLowerCase(),A=p(R);if(A){var H=(0,n.getPropertyInfo)(A);switch(a.includes(A)&&s.includes(v)&&!_&&(A=p("default"+R)),w[A]=E,H&&H.type){case n.BOOLEAN:w[A]=!0;break;case n.OVERLOADED_BOOLEAN:E===""&&(w[A]=!0);break}continue}i.PRESERVE_CUSTOM_ATTRIBUTES&&(w[C]=E)}return(0,i.setStyleProp)(h.style,w),w}function p(h){return n.possibleStandardNames[h]}})),Oh=ke((e=>{var n=e&&e.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var i=cu(),a=n(ud()),s=cd(),c={cloneElement:i.cloneElement,createElement:i.createElement,isValidElement:i.isValidElement};function d(h,v){v===void 0&&(v={});for(var w=[],_=typeof v.replace=="function",C=v.transform||s.returnFirstArg,E=v.library||c,R=E.cloneElement,A=E.createElement,H=E.isValidElement,V=h.length,U=0;U<V;U++){var L=h[U];if(_){var G=v.replace(L,U);if(H(G)){V>1&&(G=R(G,{key:G.key||U})),w.push(C(G,L,U));continue}}if(L.type==="text"){var he=!L.data.trim().length;if(he&&L.parent&&!(0,s.canTextBeChildOfNode)(L.parent)||v.trim&&he)continue;w.push(C(L.data,L,U));continue}var N=L,I={};p(N)?((0,s.setStyleProp)(N.attribs.style,N.attribs),I=N.attribs):N.attribs&&(I=(0,a.default)(N.attribs,N.name));var $=void 0;switch(L.type){case"script":case"style":L.children[0]&&(I.dangerouslySetInnerHTML={__html:L.children[0].data});break;case"tag":L.name==="textarea"&&L.children[0]?I.defaultValue=L.children[0].data:L.children&&L.children.length&&($=d(L.children,v));break;default:continue}V>1&&(I.key=U),w.push(C(A(L.name,I,$),L,U))}return w.length===1?w[0]:w}function p(h){return s.PRESERVE_CUSTOM_ATTRIBUTES&&h.type==="tag"&&(0,s.isCustomComponent)(h.name,h.attribs)}})),dd=ke((e=>{var n=e&&e.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToDOM=e.domToReact=e.attributesToProps=e.Text=e.ProcessingInstruction=e.Element=e.Comment=void 0,e.default=d;var i=n(Ch());e.htmlToDOM=i.default,e.attributesToProps=n(ud()).default;var a=n(Oh());e.domToReact=a.default;var s=sd();Object.defineProperty(e,"Comment",{enumerable:!0,get:function(){return s.Comment}}),Object.defineProperty(e,"Element",{enumerable:!0,get:function(){return s.Element}}),Object.defineProperty(e,"ProcessingInstruction",{enumerable:!0,get:function(){return s.ProcessingInstruction}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return s.Text}});var c={lowerCaseAttributeNames:!1};function d(p,h){if(typeof p!="string")throw TypeError("First argument must be a string");return p?(0,a.default)((0,i.default)(p,(h==null?void 0:h.htmlparser2)||c),h):[]}})),fd=Kt(dd(),1),ho=Kt(dd(),1),Xm=fd.default.default||fd.default;let ql;ql=(e,n)=>{let[i,...a]=n.split("."),s=(e.attribs.class||"").split(" ");return e.tagName===i&&a.every(c=>s.includes(c))},Cw=e=>{var n;return e&&ql(e,"span.nb")&&e.firstChild instanceof ho.Text&&((n=e.firstChild.nodeValue)==null?void 0:n.includes("__marimo__"))},Km=function(e){var n,i,a;if(e instanceof ho.Element&&e.firstChild instanceof ho.Text&&ql(e,"span.nb")){let s=e.next;if(s&&s instanceof ho.Text){let c=s.next;if(c&&c instanceof ho.Element&&c.firstChild instanceof ho.Text&&ql(c,"span.m")){let d=Number.parseInt(c.firstChild.nodeValue||"0",10);if((n=e.firstChild.nodeValue)!=null&&n.includes("__marimo__")){let p=(i=/__marimo__cell_(\w+)_/.exec(e.firstChild.nodeValue))==null?void 0:i[1];if(p&&d)return{kind:"cell",cellId:p,lineNumber:d}}else{let p=(a=/"(.+?)"/.exec(e.firstChild.nodeValue))==null?void 0:a[1];if(p&&d)return{kind:"file",filePath:p,lineNumber:d}}}}}return null},Dm=function(e){let n=[];return Xm(e,{replace:i=>{let a=Km(i);if(a)return n.push(a),"dummy"}}),n};function Ph(e){return n=>{let i=!1;for(let a of n)a&&(i=e(a)||i);return i}}const D_=Ph(D3),O_=Ph(R3);zu=function(e,n,i={}){let{preserveCursor:a=!0,effects:s,userEvent:c}=i,d=e.state.doc;if(d.toString()!==n)if(a&&e.hasFocus){let p=e.state.selection.main.head,h=d.lineAt(p),v=h.number,w=p-h.from,_=e.state.update({changes:{from:0,to:d.length,insert:n}}).state.doc,C;if(v<=_.lines){let E=_.line(v),R=E.length;C=E.from+Math.min(w,R)}else C=_.line(_.lines).to;e.dispatch({changes:{from:0,to:d.length,insert:n},selection:{anchor:C},effects:s,userEvent:c})}else e.dispatch({changes:{from:0,to:d.length,insert:n},effects:s,userEvent:c})},ca=function(){return kl.define({combine:e=>e[0]})};const Nh=ca(),Mh=ca(),pd=ca(),md=ca(),Lh=ca();jw=function({completionConfig:e,hotkeys:n,placeholderType:i,lspConfig:a,diagnosticsConfig:s}){return[Nh.of(e),Mh.of(n),pd.of(i),Lh.of({...a,diagnostics:s})]},Iu=new du;function P_(e){return Object.values(e.cellRuntime).some(n=>n.status==="running")}function N_(e){return Object.values(e.cellRuntime).filter(n=>n.status==="running"||n.status==="queued").length}function M_(e){return Lm(e).length>0}Uw=function(e){return e.cellIds.inOrderIds.map(n=>e.cellData[n])};function L_({cellHandles:e}){let n={};for(let[i,a]of ei.entries(e))a.current&&(n[i]=a.current.editorView);return n}Hm=function(e){let{cellIds:n,cellData:i}=e,a=[];for(let s of n.inOrderIds)i[s].config.disabled&&a.push(s);return a},$m=function(e){let{cellIds:n,cellData:i}=e,a=[];for(let s of n.inOrderIds)i[s].config.disabled||a.push(s);return a};function A_(e){return e.history.length>0}vw=function(e,n){let i=e.cellIds.findWithId(n).getDescendants(n);return{stale:i.some(a=>{var s,c;return((s=e.cellRuntime[a])==null?void 0:s.staleInputs)||((c=e.cellData[a])==null?void 0:c.edited)}),errored:i.some(a=>{var s;return(s=e.cellRuntime[a])==null?void 0:s.errored}),runningOrQueued:i.some(a=>{var s,c;return((s=e.cellRuntime[a])==null?void 0:s.status)==="running"||((c=e.cellRuntime[a])==null?void 0:c.status)==="queued"})}},Lm=function(e){let{cellIds:n,cellData:i,cellRuntime:a}=e;return n.inOrderIds.filter(s=>zm({executionTime:a[s].runElapsedTimeMs??i[s].lastExecutionTime,status:a[s].status,errored:a[s].errored,interrupted:a[s].interrupted,stopped:a[s].stopped})||i[s].edited||a[s].interrupted||a[s].staleInputs&&!(a[s].status==="disabled-transitively"||i[s].config.disabled))},zm=function({executionTime:e,status:n,errored:i,interrupted:a,stopped:s}){return e===null&&n!=="queued"&&n!=="running"&&!(i||a||s)};let pa;Dt=kl.define({combine:e=>e[0]}),sa=kl.define({combine:e=>e[0]}),pa=ta.define(),Wu=async function(e){let{sendFormat:n}=Ri(),i=ei.mapValues(e,s=>ii(s)),a=await n({codes:i,lineLength:Qp().formatting.line_length});for(let[s,c]of ei.entries(a.codes)){let d=s,p=i[d],h=e[d];h&&c!==p&&(h.state.facet(Dt).updateCellCode({cellId:d,code:c,formattingChange:!0}),cs(h,c))}},Lw=function(){return Wu(L_(qu()))};async function I_(e){let{formatDialect:n,duckdb:i}=await ue(async()=>{let{formatDialect:v,duckdb:w}=await import("./esm-D3_a5hg-.js").then(async _=>(await _.__tla,_));return{formatDialect:v,duckdb:w}},__vite__mapDeps([0,1]),import.meta.url),a=e.state.field(Er),s=N3(e.state);if(a.type!=="sql"){Pe.error("Language adapter is not SQL");return}let c=n(e.state.doc.toString(),{dialect:i,tabWidth:s,useTabs:!1}),d=a.transformIn(c)[0],p=e.state.facet(Dt),h=e.state.facet(md);p.updateCellCode({cellId:h,code:d,formattingChange:!0}),zu(e,c,{effects:[pa.of(!0)]})}var j_=Kt($u(),1),B=Kt(S3(),1);function q_(e,n){let i=document.createElement("div"),a;return{dom:i,mount(){a=(0,j_.createRoot)(i),a.render((0,B.jsx)(Hb,{store:ct,children:(0,B.jsx)(n,{view:e})}))},update(){a==null||a.render((0,B.jsx)(Hb,{store:ct,children:(0,B.jsx)(n,{view:e})}))},destroy(){a==null||a.unmount()}}}function ge(e){return new i2(r2.define(e))}function Mi(e){return ue(()=>import("./dist-DMBglXSO.js").then(async n=>(await n.__tla,n)),__vite__mapDeps([2,3,4,5]),import.meta.url).then(n=>n.sql({dialect:n[e]}))}var z_=[ce.of({name:"C",extensions:["c","h","ino"],load(){return ue(()=>import("./dist-CX9H6beB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,4]),import.meta.url).then(e=>e.cpp())}}),ce.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return ue(()=>import("./dist-CX9H6beB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([6,7,4]),import.meta.url).then(e=>e.cpp())}}),ce.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Mi("Cassandra")}}),ce.of({name:"CSS",extensions:["css"],load(){return ue(()=>import("./dist-DRRy7eBA.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([8,9,4]),import.meta.url).then(e=>e.css())}}),ce.of({name:"Go",extensions:["go"],load(){return ue(()=>import("./dist-Dgtvd9Kj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([10,3,4,11]),import.meta.url).then(e=>e.go())}}),ce.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return ue(()=>import("./dist-ZWk4ZnCp.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([12,3,4,9,13,14]),import.meta.url).then(e=>e.html())}}),ce.of({name:"Java",extensions:["java"],load(){return ue(()=>import("./dist-BXRlb45H.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([15,16,4]),import.meta.url).then(e=>e.java())}}),ce.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return ue(()=>import("./dist-yqUyuquW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,3,4,14]),import.meta.url).then(e=>e.javascript())}}),ce.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return ue(()=>import("./dist-CovgAoiO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([18,19,4]),import.meta.url).then(e=>e.json())}}),ce.of({name:"JSX",extensions:["jsx"],load(){return ue(()=>import("./dist-yqUyuquW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,3,4,14]),import.meta.url).then(e=>e.javascript({jsx:!0}))}}),ce.of({name:"LESS",extensions:["less"],load(){return ue(()=>import("./dist-BwNTJR-i.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([20,9,4,21]),import.meta.url).then(e=>e.less())}}),ce.of({name:"Liquid",extensions:["liquid"],load(){return ue(()=>import("./dist-Bkj6k_mR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([22,3,4,9,13,14,23]),import.meta.url).then(e=>e.liquid())}}),ce.of({name:"MariaDB SQL",load(){return Mi("MariaSQL")}}),ce.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return ue(()=>import("./dist-Dwaup14P.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([24,3,4,9,13,14,25]),import.meta.url).then(e=>e.markdown())}}),ce.of({name:"MS SQL",load(){return Mi("MSSQL")}}),ce.of({name:"MySQL",load(){return Mi("MySQL")}}),ce.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return ue(()=>import("./dist-Bk5eZGhd.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([26,3,4,9,13,14,27]),import.meta.url).then(e=>e.php())}}),ce.of({name:"PLSQL",extensions:["pls"],load(){return Mi("PLSQL")}}),ce.of({name:"PostgreSQL",load(){return Mi("PostgreSQL")}}),ce.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return ue(()=>import("./dist-ueNDs5ZQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([28,3,4,29]),import.meta.url).then(e=>e.python())}}),ce.of({name:"Rust",extensions:["rs"],load(){return ue(()=>import("./dist-InfVPyNM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([30,31,4]),import.meta.url).then(e=>e.rust())}}),ce.of({name:"Sass",extensions:["sass"],load(){return ue(()=>import("./dist-C0iIc35G.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([32,9,4,33]),import.meta.url).then(e=>e.sass({indented:!0}))}}),ce.of({name:"SCSS",extensions:["scss"],load(){return ue(()=>import("./dist-C0iIc35G.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([32,9,4,33]),import.meta.url).then(e=>e.sass())}}),ce.of({name:"SQL",extensions:["sql"],load(){return Mi("StandardSQL")}}),ce.of({name:"SQLite",load(){return Mi("SQLite")}}),ce.of({name:"TSX",extensions:["tsx"],load(){return ue(()=>import("./dist-yqUyuquW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,3,4,14]),import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),ce.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return ue(()=>import("./dist-yqUyuquW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([17,3,4,14]),import.meta.url).then(e=>e.javascript({typescript:!0}))}}),ce.of({name:"WebAssembly",extensions:["wat","wast"],load(){return ue(()=>import("./dist-D4zTBP8M.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([34,35,4]),import.meta.url).then(e=>e.wast())}}),ce.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return ue(()=>import("./dist-BQrFKgQW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([36,37,4]),import.meta.url).then(e=>e.xml())}}),ce.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return ue(()=>import("./dist-B6J6eS8w.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([38,39,4]),import.meta.url).then(e=>e.yaml())}}),ce.of({name:"APL",extensions:["dyalog","apl"],load(){return ue(()=>import("./apl-Ctz9K_CH.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([40,41]),import.meta.url).then(e=>ge(e.apl))}}),ce.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return ue(()=>import("./asciiarmor-B77uBk9M.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([42,43]),import.meta.url).then(e=>ge(e.asciiArmor))}}),ce.of({name:"ASN.1",extensions:["asn","asn1"],load(){return ue(()=>import("./asn1-C-iZGcpJ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([44,45]),import.meta.url).then(e=>ge(e.asn1({})))}}),ce.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return ue(()=>import("./asterisk-Dxvm10BM.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ge(e.asterisk))}}),ce.of({name:"Brainfuck",extensions:["b","bf"],load(){return ue(()=>import("./brainfuck-rSNzkqqO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([46,47]),import.meta.url).then(e=>ge(e.brainfuck))}}),ce.of({name:"Cobol",extensions:["cob","cpy"],load(){return ue(()=>import("./cobol-APDh3yqj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([48,49]),import.meta.url).then(e=>ge(e.cobol))}}),ce.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return ue(()=>import("./clike-og00ojjO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>ge(e.csharp))}}),ce.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return ue(()=>import("./clojure-CHy9PEib.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ge(e.clojure))}}),ce.of({name:"ClojureScript",extensions:["cljs"],load(){return ue(()=>import("./clojure-CHy9PEib.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ge(e.clojure))}}),ce.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return ue(()=>import("./css-CUUUuuWv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([54,55]),import.meta.url).then(e=>ge(e.gss))}}),ce.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return ue(()=>import("./cmake-k8VrEC8g.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([56,57]),import.meta.url).then(e=>ge(e.cmake))}}),ce.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return ue(()=>import("./coffeescript-B8KyBzJB.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([58,59]),import.meta.url).then(e=>ge(e.coffeeScript))}}),ce.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return ue(()=>import("./commonlisp-08FCq9wE.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([60,61]),import.meta.url).then(e=>ge(e.commonLisp))}}),ce.of({name:"Cypher",extensions:["cyp","cypher"],load(){return ue(()=>import("./cypher-BTsj2L-h.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([62,63]),import.meta.url).then(e=>ge(e.cypher))}}),ce.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return ue(()=>import("./python-boYXLLLW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([64,65]),import.meta.url).then(e=>ge(e.cython))}}),ce.of({name:"Crystal",extensions:["cr"],load(){return ue(()=>import("./crystal-BgcbUMfj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([66,67]),import.meta.url).then(e=>ge(e.crystal))}}),ce.of({name:"D",extensions:["d"],load(){return ue(()=>import("./d-C25lQrYu.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([68,69]),import.meta.url).then(e=>ge(e.d))}}),ce.of({name:"Dart",extensions:["dart"],load(){return ue(()=>import("./clike-og00ojjO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>ge(e.dart))}}),ce.of({name:"diff",extensions:["diff","patch"],load(){return ue(()=>import("./diff-DNrpXl2n.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([70,71]),import.meta.url).then(e=>ge(e.diff))}}),ce.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return ue(()=>import("./dockerfile-BUeS7lwD.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([72,73]),import.meta.url).then(e=>ge(e.dockerFile))}}),ce.of({name:"DTD",extensions:["dtd"],load(){return ue(()=>import("./dtd-Bf8uxNQM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([74,75]),import.meta.url).then(e=>ge(e.dtd))}}),ce.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return ue(()=>import("./dylan-CLekIZ5m.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([76,77]),import.meta.url).then(e=>ge(e.dylan))}}),ce.of({name:"EBNF",load(){return ue(()=>import("./ebnf-WyEkC5mI.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ge(e.ebnf))}}),ce.of({name:"ECL",extensions:["ecl"],load(){return ue(()=>import("./ecl-Cuq-zYMt.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([78,79]),import.meta.url).then(e=>ge(e.ecl))}}),ce.of({name:"edn",extensions:["edn"],load(){return ue(()=>import("./clojure-CHy9PEib.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([52,53]),import.meta.url).then(e=>ge(e.clojure))}}),ce.of({name:"Eiffel",extensions:["e"],load(){return ue(()=>import("./eiffel-Cherdoll.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([80,81]),import.meta.url).then(e=>ge(e.eiffel))}}),ce.of({name:"Elm",extensions:["elm"],load(){return ue(()=>import("./elm-Bgc2VrN3.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([82,83]),import.meta.url).then(e=>ge(e.elm))}}),ce.of({name:"Erlang",extensions:["erl"],load(){return ue(()=>import("./erlang-DV-yOPHh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([84,85]),import.meta.url).then(e=>ge(e.erlang))}}),ce.of({name:"Esper",load(){return ue(()=>import("./sql-BEwc5KHU.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ge(e.esper))}}),ce.of({name:"Factor",extensions:["factor"],load(){return ue(()=>import("./factor-_pwpFL9V.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([86,87,73]),import.meta.url).then(e=>ge(e.factor))}}),ce.of({name:"FCL",load(){return ue(()=>import("./fcl-DiNuwQPq.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ge(e.fcl))}}),ce.of({name:"Forth",extensions:["forth","fth","4th"],load(){return ue(()=>import("./forth-DPYzVsxk.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([88,89]),import.meta.url).then(e=>ge(e.forth))}}),ce.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return ue(()=>import("./fortran-CHscrmjC.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([90,91]),import.meta.url).then(e=>ge(e.fortran))}}),ce.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return ue(()=>import("./mllike-CQVXuuVe.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([92,93]),import.meta.url).then(e=>ge(e.fSharp))}}),ce.of({name:"Gas",extensions:["s"],load(){return ue(()=>import("./gas-DmfcW0jn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([94,95]),import.meta.url).then(e=>ge(e.gas))}}),ce.of({name:"Gherkin",extensions:["feature"],load(){return ue(()=>import("./gherkin-nO90d6_0.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([96,97]),import.meta.url).then(e=>ge(e.gherkin))}}),ce.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return ue(()=>import("./groovy-BaG_xigU.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([98,99]),import.meta.url).then(e=>ge(e.groovy))}}),ce.of({name:"Haskell",extensions:["hs"],load(){return ue(()=>import("./haskell-zquS0pmy.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([100,101]),import.meta.url).then(e=>ge(e.haskell))}}),ce.of({name:"Haxe",extensions:["hx"],load(){return ue(()=>import("./haxe-jVHltQz8.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([102,103]),import.meta.url).then(e=>ge(e.haxe))}}),ce.of({name:"HXML",extensions:["hxml"],load(){return ue(()=>import("./haxe-jVHltQz8.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([102,103]),import.meta.url).then(e=>ge(e.hxml))}}),ce.of({name:"HTTP",load(){return ue(()=>import("./http-DN8Ba668.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ge(e.http))}}),ce.of({name:"IDL",extensions:["pro"],load(){return ue(()=>import("./idl-Faqcof-8.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([104,105]),import.meta.url).then(e=>ge(e.idl))}}),ce.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return ue(()=>import("./javascript-DaU2Qx8h.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([106,107]),import.meta.url).then(e=>ge(e.jsonld))}}),ce.of({name:"Jinja2",extensions:["j2","jinja","jinja2"],load(){return ue(()=>import("./jinja2-vOOqe5qU.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([108,109]),import.meta.url).then(e=>ge(e.jinja2))}}),ce.of({name:"Julia",extensions:["jl"],load(){return ue(()=>import("./julia-D_XPf6PQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([110,111]),import.meta.url).then(e=>ge(e.julia))}}),ce.of({name:"Kotlin",extensions:["kt","kts"],load(){return ue(()=>import("./clike-og00ojjO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>ge(e.kotlin))}}),ce.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return ue(()=>import("./livescript-BcySDqVp.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([112,113]),import.meta.url).then(e=>ge(e.liveScript))}}),ce.of({name:"Lua",extensions:["lua"],load(){return ue(()=>import("./lua-C2g4vKPW.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([114,115]),import.meta.url).then(e=>ge(e.lua))}}),ce.of({name:"mIRC",extensions:["mrc"],load(){return ue(()=>import("./mirc-m5tZSAj-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([116,117]),import.meta.url).then(e=>ge(e.mirc))}}),ce.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return ue(()=>import("./mathematica-CGC4E4mf.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([118,119]),import.meta.url).then(e=>ge(e.mathematica))}}),ce.of({name:"Modelica",extensions:["mo"],load(){return ue(()=>import("./modelica-Df0Pzd3q.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([120,121]),import.meta.url).then(e=>ge(e.modelica))}}),ce.of({name:"MUMPS",extensions:["mps"],load(){return ue(()=>import("./mumps-DIzXo46K.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([122,123]),import.meta.url).then(e=>ge(e.mumps))}}),ce.of({name:"Mbox",extensions:["mbox"],load(){return ue(()=>import("./mbox-COMy3rAR.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([124,125]),import.meta.url).then(e=>ge(e.mbox))}}),ce.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return ue(()=>import("./nginx-AsLDmrKT.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ge(e.nginx))}}),ce.of({name:"NSIS",extensions:["nsh","nsi"],load(){return ue(()=>import("./nsis-BwaU6U7W.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([126,127,73]),import.meta.url).then(e=>ge(e.nsis))}}),ce.of({name:"NTriples",extensions:["nt","nq"],load(){return ue(()=>import("./ntriples-Di_qQuNU.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([128,129]),import.meta.url).then(e=>ge(e.ntriples))}}),ce.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return ue(()=>import("./clike-og00ojjO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>ge(e.objectiveC))}}),ce.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return ue(()=>import("./clike-og00ojjO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>ge(e.objectiveCpp))}}),ce.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return ue(()=>import("./mllike-CQVXuuVe.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([92,93]),import.meta.url).then(e=>ge(e.oCaml))}}),ce.of({name:"Octave",extensions:["m"],load(){return ue(()=>import("./octave-d2UG6bxb.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([130,131]),import.meta.url).then(e=>ge(e.octave))}}),ce.of({name:"Oz",extensions:["oz"],load(){return ue(()=>import("./oz-XuOfGqvG.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([132,133]),import.meta.url).then(e=>ge(e.oz))}}),ce.of({name:"Pascal",extensions:["p","pas"],load(){return ue(()=>import("./pascal-C_8pV97M.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([134,135]),import.meta.url).then(e=>ge(e.pascal))}}),ce.of({name:"Perl",extensions:["pl","pm"],load(){return ue(()=>import("./perl-D0yyvTB8.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([136,137]),import.meta.url).then(e=>ge(e.perl))}}),ce.of({name:"Pig",extensions:["pig"],load(){return ue(()=>import("./pig-DdChm7J-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([138,139]),import.meta.url).then(e=>ge(e.pig))}}),ce.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return ue(()=>import("./powershell-BahaFAkM.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([140,141]),import.meta.url).then(e=>ge(e.powerShell))}}),ce.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return ue(()=>import("./properties-B0UjS1mb.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([142,143]),import.meta.url).then(e=>ge(e.properties))}}),ce.of({name:"ProtoBuf",extensions:["proto"],load(){return ue(()=>import("./protobuf-CIEUsgCC.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([144,145]),import.meta.url).then(e=>ge(e.protobuf))}}),ce.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return ue(()=>import("./pug-Y1U6OG_G.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([146,107,147]),import.meta.url).then(e=>ge(e.pug))}}),ce.of({name:"Puppet",extensions:["pp"],load(){return ue(()=>import("./puppet-CfWRrQAj.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([148,149]),import.meta.url).then(e=>ge(e.puppet))}}),ce.of({name:"Q",extensions:["q"],load(){return ue(()=>import("./q-BTop3Sb0.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([150,151]),import.meta.url).then(e=>ge(e.q))}}),ce.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return ue(()=>import("./r-Du4KfitP.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([152,153]),import.meta.url).then(e=>ge(e.r))}}),ce.of({name:"RPM Changes",load(){return ue(()=>import("./rpm-DVraFRLa.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>ge(e.rpmChanges))}}),ce.of({name:"RPM Spec",extensions:["spec"],load(){return ue(()=>import("./rpm-DVraFRLa.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([154,155]),import.meta.url).then(e=>ge(e.rpmSpec))}}),ce.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return ue(()=>import("./ruby-CQkBK2a9.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([156,157]),import.meta.url).then(e=>ge(e.ruby))}}),ce.of({name:"SAS",extensions:["sas"],load(){return ue(()=>import("./sas-DIYn6ybi.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([158,159]),import.meta.url).then(e=>ge(e.sas))}}),ce.of({name:"Scala",extensions:["scala"],load(){return ue(()=>import("./clike-og00ojjO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>ge(e.scala))}}),ce.of({name:"Scheme",extensions:["scm","ss"],load(){return ue(()=>import("./scheme-DQaXtNs_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([160,161]),import.meta.url).then(e=>ge(e.scheme))}}),ce.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return ue(()=>import("./shell-BKwxMNJ_.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([162,163]),import.meta.url).then(e=>ge(e.shell))}}),ce.of({name:"Sieve",extensions:["siv","sieve"],load(){return ue(()=>import("./sieve-BuFsd2gQ.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([164,165]),import.meta.url).then(e=>ge(e.sieve))}}),ce.of({name:"Smalltalk",extensions:["st"],load(){return ue(()=>import("./smalltalk-BRk1-XQy.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([166,167]),import.meta.url).then(e=>ge(e.smalltalk))}}),ce.of({name:"Solr",load(){return ue(()=>import("./solr-1u-M6W__.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ge(e.solr))}}),ce.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return ue(()=>import("./mllike-CQVXuuVe.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([92,93]),import.meta.url).then(e=>ge(e.sml))}}),ce.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return ue(()=>import("./sparql-DbKuGH6l.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([168,169]),import.meta.url).then(e=>ge(e.sparql))}}),ce.of({name:"Spreadsheet",alias:["excel","formula"],load(){return ue(()=>import("./spreadsheet-DWdiCsPI.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ge(e.spreadsheet))}}),ce.of({name:"Squirrel",extensions:["nut"],load(){return ue(()=>import("./clike-og00ojjO.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([50,51]),import.meta.url).then(e=>ge(e.squirrel))}}),ce.of({name:"Stylus",extensions:["styl"],load(){return ue(()=>import("./stylus-CFOJzR7o.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([170,171]),import.meta.url).then(e=>ge(e.stylus))}}),ce.of({name:"Swift",extensions:["swift"],load(){return ue(()=>import("./swift-BUhTx6hv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([172,173]),import.meta.url).then(e=>ge(e.swift))}}),ce.of({name:"sTeX",load(){return ue(()=>import("./stex-wt8gHRbn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>ge(e.stex))}}),ce.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return ue(()=>import("./stex-wt8gHRbn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([174,175]),import.meta.url).then(e=>ge(e.stex))}}),ce.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return ue(()=>import("./verilog-BO-pDm62.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>ge(e.verilog))}}),ce.of({name:"Tcl",extensions:["tcl"],load(){return ue(()=>import("./tcl-MP-B_vsS.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([178,179]),import.meta.url).then(e=>ge(e.tcl))}}),ce.of({name:"Textile",extensions:["textile"],load(){return ue(()=>import("./textile-MTIaEDRe.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([180,181]),import.meta.url).then(e=>ge(e.textile))}}),ce.of({name:"TiddlyWiki",load(){return ue(()=>import("./tiddlywiki-CNC91VG3.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ge(e.tiddlyWiki))}}),ce.of({name:"Tiki wiki",load(){return ue(()=>import("./tiki-vkGwv1_K.js").then(async e=>(await e.__tla,e)),[],import.meta.url).then(e=>ge(e.tiki))}}),ce.of({name:"TOML",extensions:["toml"],load(){return ue(()=>import("./toml-DY0cxrsl.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([182,183]),import.meta.url).then(e=>ge(e.toml))}}),ce.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return ue(()=>import("./troff-BIxIeW8s.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([184,185]),import.meta.url).then(e=>ge(e.troff))}}),ce.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return ue(()=>import("./ttcn-BE49dEYh.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([186,187]),import.meta.url).then(e=>ge(e.ttcn))}}),ce.of({name:"TTCN_CFG",extensions:["cfg"],load(){return ue(()=>import("./ttcn-cfg-BD8YYA5a.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([188,189]),import.meta.url).then(e=>ge(e.ttcnCfg))}}),ce.of({name:"Turtle",extensions:["ttl"],load(){return ue(()=>import("./turtle-BclFB0tn.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([190,191]),import.meta.url).then(e=>ge(e.turtle))}}),ce.of({name:"Web IDL",extensions:["webidl"],load(){return ue(()=>import("./webidl-DHMC9GWF.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([192,193]),import.meta.url).then(e=>ge(e.webIDL))}}),ce.of({name:"VB.NET",extensions:["vb"],load(){return ue(()=>import("./vb-DsN-p1cU.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([194,195]),import.meta.url).then(e=>ge(e.vb))}}),ce.of({name:"VBScript",extensions:["vbs"],load(){return ue(()=>import("./vbscript-DCmHq9j7.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([196,197]),import.meta.url).then(e=>ge(e.vbScript))}}),ce.of({name:"Velocity",extensions:["vtl"],load(){return ue(()=>import("./velocity-DOhnCHS-.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([198,199]),import.meta.url).then(e=>ge(e.velocity))}}),ce.of({name:"Verilog",extensions:["v"],load(){return ue(()=>import("./verilog-BO-pDm62.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([176,177]),import.meta.url).then(e=>ge(e.verilog))}}),ce.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return ue(()=>import("./vhdl-BN6ynKWP.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([200,201]),import.meta.url).then(e=>ge(e.vhdl))}}),ce.of({name:"XQuery",extensions:["xy","xquery"],load(){return ue(()=>import("./xquery-P4k--790.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([202,203]),import.meta.url).then(e=>ge(e.xQuery))}}),ce.of({name:"Yacas",extensions:["ys"],load(){return ue(()=>import("./yacas-2Y6ARAKT.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([204,205]),import.meta.url).then(e=>ge(e.yacas))}}),ce.of({name:"Z80",extensions:["z80"],load(){return ue(()=>import("./z80-CoWNhP-u.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([206,207]),import.meta.url).then(e=>ge(e.z80))}}),ce.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return ue(()=>import("./mscgen-ChgEFq6F.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>ge(e.mscgen))}}),ce.of({name:"X\xF9",extensions:["xu"],load(){return ue(()=>import("./mscgen-ChgEFq6F.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>ge(e.xu))}}),ce.of({name:"MsGenny",extensions:["msgenny"],load(){return ue(()=>import("./mscgen-ChgEFq6F.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([208,209]),import.meta.url).then(e=>ge(e.msgenny))}}),ce.of({name:"Vue",extensions:["vue"],load(){return ue(()=>import("./dist-DItrHsm3.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([210,3,4,9,13,14,211]),import.meta.url).then(e=>e.vue())}}),ce.of({name:"Angular Template",load(){return ue(()=>import("./dist-BsZCBdqv.js").then(async e=>(await e.__tla,e)),__vite__mapDeps([212,3,4,9,13,14]),import.meta.url).then(e=>e.angular())}})],Ah=new WeakMap,F_=/(\n|\r\n?|\u2028|\u2029)/g,B_=/^\s*/,H_=/\S/,V_=Array.prototype.slice,hd=48,Ih=57,jh=97,$_=102,qh=65,W_=70;jl=function(e){if(typeof e=="string")return Bh([e])[0];if(typeof e=="function")return function(){let a=V_.call(arguments);return a[0]=Fh(a[0]),e.apply(this,a)};let n=Fh(e),i=zh(n,0);for(let a=1;a<n.length;a++)i+=arguments[a]+zh(n,a);return i};function zh(e,n){let i=e[n];if(i===void 0)throw TypeError(`invalid cooked string at index ${n}`);return i}function Fh(e){let n=Ah.get(e);if(n)return n;let i=Bh(e.raw),a=i.map(K_);return Object.defineProperty(a,"raw",{value:Object.freeze(i)}),Object.freeze(a),Ah.set(e,a),a}function Bh(e){let n=e.map(s=>s.split(F_)),i;for(let s=0;s<n.length;s++){let c=n[s],d=s===0,p=s+1===n.length;if(d){if(c.length===1||c[0].length>0)throw Error("invalid content on opening line");c[1]=""}if(p){if(c.length===1||H_.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 v=c[h],w=h+1===c.length&&!p,_=B_.exec(v)[0];if(!w&&_.length===v.length){c[h]="";continue}i=U_(_,i)}}let a=i?i.length:0;return n.map(s=>{let c=s[0];for(let d=1;d<s.length;d+=2){let p=s[d],h=s[d+1];c+=p+h.slice(a)}return c})}function U_(e,n){if(n===void 0||e===n)return e;let i=0;for(let a=Math.min(e.length,n.length);i<a&&e[i]===n[i];i++);return e.slice(0,i)}function K_(e){let n="",i=0,a=0;for(;(a=e.indexOf("\\",a))>-1;){if(n+=e.slice(i,a),++a===e.length)return;let s=e[a++];switch(s){case"b":n+="\b";break;case"t":n+=" ";break;case"n":n+=`
15
+ `;break;case"v":n+="\v";break;case"f":n+="\f";break;case"r":n+="\r";break;case"\r":a<e.length&&e[a]===`
16
+ `&&++a;case`
17
+ `:case"\u2028":case"\u2029":break;case"0":if(Hh(e,a))return;n+="\0";break;case"x":{let c=gd(e,a,a+2);if(c===-1)return;a+=2,n+=String.fromCharCode(c);break}case"u":{let c;if(a<e.length&&e[a]==="{"){let d=e.indexOf("}",++a);if(d===-1)return;c=gd(e,a,d),a=d+1}else c=gd(e,a,a+4),a+=4;if(c===-1||c>1114111)return;n+=String.fromCodePoint(c);break}default:if(Hh(s,0))return;n+=s}i=a}return n+e.slice(i)}function Hh(e,n){let i=e.charCodeAt(n);return i>=hd&&i<=Ih}function gd(e,n,i){if(i>=e.length)return-1;let a=0;for(;n<i;n++){let s=Q_(e.charCodeAt(n));if(s===-1)return-1;a=a*16+s}return a}function Q_(e){return e>=hd&&e<=Ih?e-hd:e>=jh&&e<=$_?e-jh+10:e>=qh&&e<=W_?e-qh+10:-1}const Vh=["","f","r","fr","rf"];function G_(e){try{return jl(`
18
+ ${e}
19
+ `).trim()}catch{return e}}function J_(e){return nR.parse(e)}var X_=new Set(["(","[","{",",",")","]","}"]);function Y_(e,n){return e.name==="ArgList"?{args:Z_(e),kwargs:ex(e,n)}:(console.warn(`Not an ArgList, name: ${e.name}`),{args:[],kwargs:[]})}function Z_(e){var a;e.firstChild();let n=[],i=e.name;do if(i=e.name,!X_.has(i)){if(i==="VariableName"&&((a=e.node.nextSibling)==null?void 0:a.name)==="AssignOp"){e.prev();break}n.push(e.node)}while(e.nextSibling());return n}function ex(e,n){let i=[],a=e.name;do if(a=e.name,a==="VariableName"){let s=n.slice(e.from,e.to),c=e.node.nextSibling;if(!c||c.name!=="AssignOp")continue;let d=c.nextSibling;if(!d)continue;let p=n.slice(d.from,d.to).trim();i.push({key:s,value:p})}while(e.nextSibling());return i}function tx(e,n){if(e.name==="String"){let i=n.slice(e.from,e.to);return i.startsWith('r"""')||i.startsWith("r'''")?i.slice(4,-3):i.startsWith('"""')||i.startsWith("'''")?i.slice(3,-3):i.startsWith('r"')||i.startsWith("r'")?i.slice(2,-1):i.slice(1,-1)}if(e.name==="FormatString"){let i=n.slice(e.from,e.to);return i.startsWith('f"""')||i.startsWith("f'''")?i.slice(4,-3):i.startsWith('rf"""')||i.startsWith("rf'''")||i.startsWith('fr"""')||i.startsWith("fr'''")?i.slice(5,-3):i.startsWith('r"""')||i.startsWith("r'''")?i.slice(4,-3):i.startsWith('f"')||i.startsWith("f'")?i.slice(2,-1):i.startsWith('rf"')||i.startsWith("rf'")||i.startsWith('fr"')||i.startsWith("fr'")?i.slice(3,-1):(i.startsWith('r"')||i.startsWith("r'"),i.slice(2,-1))}return null}function nx(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 rx(e){let n=[...Vh].sort((i,a)=>a.length-i.length);for(let i of n)if(e.startsWith(i))return[i,e.slice(i.length)];return["",e]}function ix(e,n){return e.replaceAll(`\\${n}`,n)}var ox=[['"""','"""'],["'''","'''"],['"','"'],["'","'"]],ax=Vh.flatMap(e=>ox.map(([n,i])=>[e+n,i])).map(([e,n])=>[e,RegExp(`^mo\\.md\\(\\s*${$h(e)}(.*)${$h(n)}\\s*\\)$`,"s")]);function $h(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Wh=class{constructor(){De(this,"type","markdown");De(this,"defaultCode",`mo.md(r"""
20
+ """)`);De(this,"defaultMetadata",{quotePrefix:"r"})}static fromMarkdown(e){return`mo.md(r"""
21
+ ${e}
22
+ """)`}transformIn(e){e=e.trim();let n={...this.defaultMetadata};if(e==="")return{code:"",offset:0,metadata:n};for(let[i,a]of ax){let s=e.match(a);if(s){let c=s[1],[d,p]=rx(i);n.quotePrefix=d;let h=ix(c,p),v=e.indexOf(c);return{code:jl(`
23
+ ${h}
24
+ `).trim(),offset:v,metadata:n}}}return{code:e,offset:0,metadata:n}}transformOut(e,n){e===""&&(e=" ");let{quotePrefix:i}=n,a=e.replaceAll('""',String.raw`"\"`),s=`mo.md(${i}"""
25
+ `;return{code:s+a+`
26
+ """)`,offset:s.length+1}}isSupported(e){if(e=e.trim(),e==="")return!0;if(!e.startsWith("mo.md("))return!1;if(e==="mo.md()")return!0;let n=Yp.parser.parse(e),i=[{match:"Script"},{match:"ExpressionStatement"},{match:"CallExpression"},{match:"MemberExpression"},{match:"VariableName"},{match:"."},{match:"PropertyName"},{match:"ArgList"},{match:"("},{match:/String|FormatString/,stop:!0},{match:")"}],a=!0;return n.iterate({enter:s=>{let c=i.shift();if(c===void 0)return a=!1,!1;let d=c.match;return typeof d=="string"?(a&&(a=d===s.name),a&&!c.stop):(d.test(s.name)||(a=!1),a&&!c.stop)}}),a}},sx=class{constructor(){De(this,"type","python");De(this,"defaultCode","");De(this,"defaultMetadata",{})}transformIn(e){return{code:e,offset:0,metadata:{}}}transformOut(e,n){return{code:e,offset:0}}isSupported(e){return!0}},yd="__marimo_duckdb",Uh=class{constructor(){De(this,"type","sql");De(this,"defaultMetadata",{dataframeName:"_df",quotePrefix:"f",commentLines:[],showOutput:!0,engine:yd})}get defaultCode(){return'_df = mo.sql(f"""SELECT * FROM """)'}static fromQuery(e){return`_df = mo.sql(f"""${e.trim()}""")`}transformIn(e){e=e.trim();let n={...this.defaultMetadata,commentLines:this.extractCommentLines(e)};if(!this.isSupported(e))return{code:e,offset:0,metadata:n};if(e==="")return{code:"",offset:0,metadata:n};let i=Kh(e);return i?(n.dataframeName=i.dfName,n.showOutput=i.output??!0,n.engine=i.engine??yd,{code:jl(`
27
+ ${i.sqlString}
28
+ `).trim(),offset:i.startPosition,metadata:n}):{code:e,offset:0,metadata:n}}transformOut(e,n){let{quotePrefix:i,commentLines:a,showOutput:s,engine:c,dataframeName:d}=n,p=`${d} = mo.sql(
29
+ ${i}"""
30
+ `,h=e.replaceAll('"""',String.raw`\"""`),v=`
31
+ """${s?"":`,
32
+ output=False`}${c===yd?"":`,
33
+ engine=${c}`}
34
+ )`;return{code:[...a,p].join(`
35
+ `)+cx(h)+v,offset:p.length+1}}isSupported(e){return e.trim()===""?!0:!e.includes("mo.sql")||e.split("mo.sql").length>2?!1:Kh(e)!==null}extractCommentLines(e){let n=e.split(`
36
+ `),i=[];for(let a of n)if(a!=null&&a.startsWith("#"))i.push(a);else break;return i}};function lx(e){do{if(e.name==="AssignStatement")return e.node;if(e.name!=="Comment")return null}while(e.next());return null}function Kh(e){try{let n=J_(e).cursor();n.name==="Script"&&n.next();let i=lx(n);if(!i||e.slice(i.to).trim().length>0)return null;let a=null,s=null,c,d,p=0,h=i.cursor();if(h.firstChild(),h.name==="VariableName"&&(a=e.slice(h.from,h.to)),!a)return null;for(;h.next();)if(h.name==="CallExpression"){let v=h.node.cursor(),w=!1;if(v.firstChild(),v.name==="MemberExpression"&&(w=e.slice(v.from,v.to)==="mo.sql"),!w)continue;for(;v.next();)if(v.name==="ArgList"){let{args:_,kwargs:C}=Y_(v.node.cursor(),e);_.length===1&&(s=tx(_[0],e),p=_[0].from+nx(e.slice(_[0].from,_[0].to)));for(let{key:E,value:R}of C)switch(E){case"engine":c=R;break;case"output":d=R==="True";break}if(s==="")return{dfName:a,sqlString:"",engine:c,output:d,startPosition:p};break}break}return!a||!s?null:{dfName:a,sqlString:G_(s),engine:c,output:d,startPosition:p}}catch(n){return console.warn("Failed to parse SQL statement",n),null}}function cx(e){return e.split(`
37
+ `).map(n=>n!=null&&n.trim()?` ${n}`:n).join(`
38
+ `)}function ux(e,n){return{get:()=>n.get(e),sub:i=>n.sub(e,()=>i(n.get(e)))}}function dx(e,{offset:n,body:i=window}){let a=(n==null?void 0:n.top)??0,s=(n==null?void 0:n.bottom)??0,c=e.getBoundingClientRect();if(c.top<a){i.scrollBy({top:c.top-a,behavior:"smooth"});return}if(c.bottom>window.innerHeight-s){i.scrollBy({top:c.bottom-window.innerHeight+s,behavior:"smooth"});return}}bu=function(e){return e?e.state.field(Er).type:"python"};function fx(e,n){return!e||bu(e)===n?!1:e.state.doc.toString().trim()===""?!0:ur[n].isSupported(ii(e))}Am=function(e,n,i={}){return!i.force&&!fx(e,n)?!1:(Fm(e,{language:n}),n)};function px(e){return na.of([{key:e.getHotkey("cell.format").key,preventDefault:!0,run:n=>(Wu({[n.state.facet(sa)]:n}),!0)},{key:e.getHotkey("cell.viewAsMarkdown").key,preventDefault:!0,run:n=>{let i=bu(n);if(i!=="markdown"&&i!=="python")return!1;let a=Am(n,i==="python"?"markdown":"python",{force:!0});return a==="markdown"&&n.state.facet(Dt).afterToggleMarkdown(),a!==!1}}])}Q2=function(){return Tn.updateListener.of(e=>{if(e.view.hasFocus&&e.heightChanged&&e.docChanged){if(e.transactions.some(i=>i.effects.some(a=>a.is(pa))))return;let n=e.view.dom.getElementsByClassName("cm-activeLine cm-line");if(n.length===1){let i=n[0],a=document.getElementById("App");dn(a,"App not found"),dx(i,{offset:{top:30,bottom:150},body:a})}}})};function mx(){return{}}let hx,gx,Qh;({reducer:hx,createActions:gx,valueAtom:mo,useActions:Qh}=Sl(mx,{setVariables:(e,n)=>{let i={...e},a={};for(let s of n)a[s.name]={...i[s.name],...s};return a},addVariables:(e,n)=>{let i={...e};for(let a of n)i[a.name]={...i[a.name],...a};return i},setMetadata:(e,n)=>{let i={...e};for(let{name:a,value:s,dataType:c}of n)i[a]&&(i[a]={...i[a],value:s,dataType:c});return i}})),cw=()=>Un(mo),aw=function(){return Qh()};var yx=Kt(zr(),1),Gh="marimo:sidebar",Jh=new xu(Wb({selectedPanel:p3().optional().transform(e=>e),isSidebarOpen:$b(),isTerminalOpen:$b()}),vx);function vx(){return{selectedPanel:"variables",isSidebarOpen:!1,isTerminalOpen:!1}}let bx,wx,Xh;({reducer:bx,createActions:wx,valueAtom:Cu,useActions:Xh}=Sl(()=>Jh.get(Gh),{openApplication:(e,n)=>({...e,selectedPanel:n,isSidebarOpen:!0}),toggleApplication:(e,n)=>({...e,selectedPanel:n,isSidebarOpen:e.isSidebarOpen?e.selectedPanel!==n:!0}),toggleSidebarPanel:e=>({...e,isSidebarOpen:!e.isSidebarOpen}),setIsSidebarOpen:(e,n)=>({...e,isSidebarOpen:n}),toggleTerminal:e=>({...e,isTerminalOpen:!e.isTerminalOpen}),setIsTerminalOpen:(e,n)=>({...e,isTerminalOpen:n})},[(e,n)=>Jh.set(Gh,n)])),q2=()=>{let e=(0,yx.c)(2),n=Un(Cu);if(n.isSidebarOpen)return n;let i;return e[0]===n?i=e[1]:(i={...n,selectedPanel:void 0},e[0]=n,e[1]=i),i},zw=function(){return Xh()},fm=Fe({terminal:!1,pylsp:!1,basedpyright:!1,ty:!1});function zl(e){return ct.get(fm)[e]??!1}Nu=Fe({documentation:null});var Yh=new Set(["FunctionDefinition","LambdaExpression","ArrayComprehensionExpression","SetComprehension","DictionaryComprehensionExpression","ComprehensionExpression","ClassDefinition"]);function _x(e){let n=e2(e.state);if(!n||Cx(n))return[];let i=new Set(Object.keys(e.variables).filter(E=>{let R=e.variables[E];return R.dataType!=="module"&&!R.declaredBy.includes("setup")&&!R.declaredBy.includes(e.cellId)}));if(i.size===0)return[];let a=[],s=new Map,c=new Map,d=new Map;function p(E,R){var G,he,N,I,$,de,fe,xe,te,be,Se;let A=E.cursor(),H=A.name,V=A.from,U=Yh.has(H),L=R;switch(U&&(L=[...R,V],s.set(V,new Set),c.set(V,H)),H){case"FunctionDefinition":{let ie=E.cursor();ie.firstChild();do if(ie.name==="VariableName"){let Q=e.state.doc.sliceString(ie.from,ie.to),K=R[R.length-1]??-1;s.has(K)||s.set(K,new Set),(G=s.get(K))==null||G.add(Q);break}while(ie.nextSibling());let X=E.cursor();X.firstChild();do if(X.name==="ParamList"){let Q=X.node.cursor();Q.firstChild();do if(Q.name==="VariableName"){let K=e.state.doc.sliceString(Q.from,Q.to);(he=s.get(V))==null||he.add(K)}while(Q.nextSibling())}while(X.nextSibling());break}case"LambdaExpression":{let ie=E.cursor();ie.firstChild();do if(ie.name==="ParamList"){let X=ie.node.cursor();X.firstChild();do if(X.name==="VariableName"){let Q=e.state.doc.sliceString(X.from,X.to);(N=s.get(V))==null||N.add(Q)}while(X.nextSibling())}while(ie.nextSibling());break}case"ArrayComprehensionExpression":case"DictionaryComprehensionExpression":case"SetComprehension":case"ComprehensionExpression":{let ie=E.cursor();ie.firstChild();let X=!1;do if(ie.name==="for")X=!0;else if(X&&ie.name==="VariableName"){let Q=e.state.doc.sliceString(ie.from,ie.to);(I=s.get(V))==null||I.add(Q)}else if(X&&ie.name==="TupleExpression"){let Q=ie.node.cursor();Q.firstChild();do if(Q.name==="VariableName"){let K=e.state.doc.sliceString(Q.from,Q.to);($=s.get(V))==null||$.add(K)}while(Q.nextSibling())}else X&&ie.name==="in"&&(X=!1);while(ie.nextSibling());break}case"ClassDefinition":{let ie=E.cursor();ie.firstChild();do if(ie.name==="VariableName"){let X=e.state.doc.sliceString(ie.from,ie.to),Q=R[R.length-1]??-1;s.has(Q)||s.set(Q,new Set),(de=s.get(Q))==null||de.add(X);break}while(ie.nextSibling());d.set(V,[]);break}case"AssignStatement":{let ie=E.cursor(),X=[];ie.firstChild();do ie.name==="AssignOp"&&X.push(ie.from);while(ie.nextSibling());let Q=X[X.length-1],K=E.cursor();K.firstChild();let Ne=L[L.length-1]??-1;do K.from<Q&&vd(K,{currentScope:Ne,state:e.state,allDeclarations:s,scopeTypes:c,classLevelDeclarations:d,assignmentPosition:A.to});while(K.nextSibling());break}case"ForStatement":{let ie=E.cursor();ie.firstChild();let X=!1;do if(ie.name==="for")X=!0;else if(X&&ie.name==="VariableName"){let Q=e.state.doc.sliceString(ie.from,ie.to),K=L[L.length-1]??-1;s.has(K)||s.set(K,new Set),(fe=s.get(K))==null||fe.add(Q)}else X&&ie.name==="in"&&(X=!1);while(ie.nextSibling());break}case"ImportStatement":{let ie=E.cursor();ie.firstChild();do if(ie.name==="VariableName"){let X=e.state.doc.sliceString(ie.from,ie.to),Q=L[L.length-1]??-1;s.has(Q)||s.set(Q,new Set),(xe=s.get(Q))==null||xe.add(X)}while(ie.nextSibling());break}case"ImportFromStatement":{let ie=E.cursor();ie.firstChild();let X=!1;do if(ie.name==="import")X=!0;else if(X&&ie.name==="VariableName"){let Q=e.state.doc.sliceString(ie.from,ie.to),K=L[L.length-1]??-1;s.has(K)||s.set(K,new Set),(te=s.get(K))==null||te.add(Q)}while(ie.nextSibling());break}case"TryStatement":{let ie=E.cursor();ie.firstChild();let X=!1;do if(ie.name==="as")X=!0;else if(X&&ie.name==="VariableName"){let Q=e.state.doc.sliceString(ie.from,ie.to),K=L[L.length-1]??-1;s.has(K)||s.set(K,new Set),(be=s.get(K))==null||be.add(Q),X=!1}while(ie.nextSibling());break}case"WithStatement":{let ie=E.cursor();ie.firstChild();let X=!1;do if(ie.name==="as")X=!0;else if(X&&ie.name==="VariableName"){let Q=e.state.doc.sliceString(ie.from,ie.to),K=L[L.length-1]??-1;s.has(K)||s.set(K,new Set),(Se=s.get(K))==null||Se.add(Q),X=!1}while(ie.nextSibling());break}}C(A,ie=>{p(ie,L)})}function h(E,R,A){let H=d.get(R);return H?H.some(([V,U])=>V===E&&U<A):!1}function v(E,R,A){var H,V;for(let U of R)if(c.get(U)==="ClassDefinition"){if(h(E,U,A))return!0}else if((H=s.get(U))!=null&&H.has(E))return!0;return((V=s.get(-1))==null?void 0:V.has(E))??!1}function w(E,R){let A=E.cursor(),H=A.name,V=A.from,U=Yh.has(H),L=R;if(U&&(L=[...R,V]),H==="VariableName"){let G=e.state.doc.sliceString(A.from,A.to);_(G,A)&&(v(G,L,A.from)||a.push({from:A.from,to:A.to,variableName:G}))}C(A,G=>{w(G,L)})}function _(E,R){return i.has(E)&&!xx(R)&&!kx(R)}function C(E,R){if(E.firstChild())do R(E.node);while(E.nextSibling())}return p(n,[]),w(n,[]),a}function xx(e){let n=e.node.cursor();if(n.moveTo(e.from),n.parent()&&n.name==="CallExpression"&&n.firstChild())do if(n.name==="ArgList"&&n.firstChild()){do if(n.from===e.from&&n.to===e.to)return n.nextSibling()&&n.name==="AssignOp";while(n.nextSibling());break}while(n.nextSibling());return!1}function kx(e){let n=e.node.cursor();if(n.parent()&&n.name==="AssignStatement"){let i=n.node.cursor();i.firstChild();let a=-1;do if(i.name==="AssignOp"){a=i.from;break}while(i.nextSibling());return a!==-1&&e.from<a}return!1}function Cx(e){let n=e.cursor();do if(n.name==="\u26A0"||n.type.isError)return!0;while(n.next());return!1}function vd(e,n){var i;switch(e.name){case"VariableName":{let a=n.state.doc.sliceString(e.from,e.to);if(n.currentScope!==-1&&n.scopeTypes.get(n.currentScope)==="ClassDefinition"){let s=n.classLevelDeclarations.get(n.currentScope);s&&s.push([a,n.assignmentPosition])}else n.allDeclarations.has(n.currentScope)||n.allDeclarations.set(n.currentScope,new Set),(i=n.allDeclarations.get(n.currentScope))==null||i.add(a);break}case"TupleExpression":{let a=e.node.cursor();a.firstChild();do vd(a,n);while(a.nextSibling());break}case"ArrayExpression":{let a=e.node.cursor();a.firstChild();do vd(a,n);while(a.nextSibling());break}}}var Sx=Ti.mark({class:"mo-cm-reactive-reference"});rw=Ti.mark({class:"mo-cm-reactive-reference-hover"});var Zh=ta.define(),Ex=class{constructor(e,n){De(this,"highlightDebounceMs",300);this.view=e,this.cellId=n,this.scheduleHighlighting=Ub(()=>{this.runHighlighting()},this.highlightDebounceMs),this.variablesUnsubscribe=ct.sub(mo,()=>{this.scheduleHighlighting()}),this.scheduleHighlighting()}update(e){(e.docChanged||e.focusChanged)&&this.scheduleHighlighting()}destroy(){this.scheduleHighlighting.cancel(),this.variablesUnsubscribe()}runHighlighting(){let e=_x({state:this.view.state,cellId:this.cellId,variables:ct.get(mo)});e.length>0&&Pe.debug(`Found ${e.length} reactive variables in cell ${this.cellId}`),queueMicrotask(()=>{this.view.dispatch({effects:Zh.of(e)})})}};Du=pu.define({create(){return{decorations:Ti.none,ranges:[]}},update(e,n){let i={decorations:e.decorations.map(n.changes),ranges:e.ranges};for(let a of n.effects)a.is(Zh)&&(i={decorations:Ti.set(a.value.map(s=>Sx.range(s.from,s.to))),ranges:a.value});return i},provide:e=>Tn.decorations.from(e,n=>n.decorations)});function Tx(e){return[Du,ra.define(n=>new Ex(n,e))]}M2=function(e,n){return n?Tx(e):[]};function e0(e,n=!1){if(!e)return null;let i=document.createElement("span");if(i.classList.add("mo-cm-tooltip"),i.classList.add("docs-documentation"),n&&i.classList.add("cm-tooltip-section"),i.style.display="flex",i.style.flexDirection="column",i.style.gap=".8rem",i.innerHTML=e,n){let a=document.createElement("div");a.classList.add("text-xs","text-muted-foreground","font-medium","pt-1","-mt-2","border-t","border-border");let s=document.createElement("kbd");s.className="ml-1 rounded-md bg-muted/40 px-2 text-[0.75rem] font-prose center border border-foreground/20 text-muted-foreground inline whitespace-nowrap",s.textContent=_3()?"\u2318":"Ctrl",a.append(document.createTextNode("Jump to defining cell ")),a.append(s),a.append(document.createTextNode(" + Click")),i.append(a)}return i}_u=new yu("autocomplete-result",async(e,n)=>{let{sendCodeCompletionRequest:i}=Ri();await i({id:e,...n})});var Rx={param:3,property:2};const bd={asCompletionResult(e,n){return{from:e-n.prefix_length,options:n.options.map(i=>({label:i.name,type:i.type,boost:Rx[i.type]??1,info:()=>e0(i.completion_info)})),validFor:/^\w*$/}},asHoverTooltip({position:e,message:n,limitToType:i,excludeTypes:a,exactName:s,showGoToDefinitionHint:c=!1}){let d=Dx(n.options,s);if(!d)return;let p=e-n.prefix_length,h=e0(d.completion_info,c);if(h&&!(i&&d.type!==i)&&!(a!=null&&a.includes(d.type)))return{pos:p,html:d.completion_info,end:p+d.name.length,above:!0,create:()=>({dom:h,resize:!1})}}};function Dx(e,n){if(e.length!==0){if(e.length===1)return e[0];if(n)return e.find(i=>i.name===n)}}Zw=function(e){var n;return[(n=e==null?void 0:e.pylsp)!=null&&n.enabled&&zl("pylsp")?[]:a2(async(i,a)=>{let s=await t0({view:i,pos:a,excludeTypes:["tooltip"]});return s===null||s==="cancelled"?null:s},{hideOnChange:!0}),Nx]};async function t0({view:e,pos:n,excludeTypes:i}){var w;let a=cr.findElement(e.dom);if(!a)return Pe.error("Failed to find active cell."),null;let s=cr.parse(a.id),{startToken:c,endToken:d}=n0(e.state.doc,n),p=((w=e.state.field(Du,!1))==null?void 0:w.ranges.some(_=>n>=_.from&&n<=_.to))??!1,h=await _u.request({document:e.state.doc.slice(0,d).toString(),cellId:s});if(!h)return"cancelled";let v=e.state.doc.slice(c,d).toString();return bd.asHoverTooltip({position:d,message:h,exactName:v,excludeTypes:i,showGoToDefinitionHint:p})??null}function n0(e,n){let i=n,a=n;for(;i>0;){let s=e.sliceString(i-1,i);if(!/\w/.test(s))break;i--}for(;a<e.length;){let s=e.sliceString(a,a+1);if(!/\w/.test(s))break;a++}return{startToken:i,endToken:a}}function Ox(e){let{head:n}=e.selection.main,i=e.doc.sliceString(n-1,n);return/\w/.test(i)}var Px=Ub(async(e,n)=>{if(ct.get(Cu).selectedPanel!=="documentation")return;let i=await t0({view:e,pos:n});i!=="cancelled"&&ct.set(Nu,{documentation:(i==null?void 0:i.html)??null})},300),Nx=Tn.updateListener.of(e=>{if(e.selectionSet&&Ox(e.state)){let n=e.state.selection.main.head;Px(e.view,n)}});function r0(e,n){e.focus(),requestAnimationFrame(()=>{e.dispatch({selection:{anchor:n,head:n},effects:Tn.scrollIntoView(n,{y:"center"})})})}Ru=function(e,n){let{state:i}=e,a=e2(i),s=!1,c=0;return a.iterate({enter:d=>{if(s)return!1;if(d.name==="VariableName"&&i.doc.sliceString(d.from,d.to)===n)return c=d.from,s=!0,!1;if(d.name==="Comment"||d.name==="String")return!1}}),s?(r0(e,c),!0):!1};function Mx(e,n){return r0(e,e.state.doc.line(n).from),!0}function Lx(e){let{from:n,to:i}=e.selection.main;if(n===i){let{startToken:a,endToken:s}=n0(e.doc,n);return e.doc.sliceString(a,s)}return e.doc.sliceString(n,i)}function Ax(e,n){if(!n)return null;let i=e[n];return!i||i.declaredBy.length===0?null:i.declaredBy[0]}function Ix(e){return e.startsWith("_")}vm=function(e){let{state:n}=e,i=Lx(n);return i?(f2(e),e.dispatch({effects:O3}),mm(e,i)):!1},mm=function(e,n){let i=jx(e,n);return i?Ru(i,n):!1},D2=function(e,n){let i=i0(e);return i?Mx(i,n):!1};function jx(e,n){if(Ix(n))return e;let i=Ax(ct.get(mo),n);return i?i0(i):null}function i0(e){var n;return((n=ct.get(ft).cellHandles[e].current)==null?void 0:n.editorView)??null}function qx(e){var n=e.Pos;function i(u,m,y){if(m.line===y.line&&m.ch>=y.ch-1){var b=u.getLine(m.line).charCodeAt(m.ch);55296<=b&&b<=55551&&(y.ch+=1)}return{start:m,end:y}}var a=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"g<Up>",type:"keyToKey",toKeys:"gk"},{keys:"g<Down>",type:"keyToKey",toKeys:"gj"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h"},{keys:"<Del>",type:"keyToKey",toKeys:"x"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"keyToKey",toKeys:"i",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"g$",type:"motion",motion:"moveToEndOfDisplayLine"},{keys:"g^",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"g0",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{keys:"gq",type:"operator",operator:"hardWrap"},{keys:"gw",type:"operator",operator:"hardWrap",operatorArgs:{keepCursor:!0}},{keys:"g?",type:"operator",operator:"rot13"},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-u>",type:"operatorMotion",operator:"delete",motion:"moveToStartOfLine",context:"insert"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<register>",type:"action",action:"replayMacro"},{keys:"q<register>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<register>",type:"action",action:"setMark"},{keys:'"<register>',type:"action",action:"setRegister"},{keys:"<C-r><register>",type:"action",action:"insertRegister",context:"insert",isEdit:!0},{keys:"<C-o>",type:"action",action:"oneNormalCommand",context:"insert"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<register>",type:"motion",motion:"textObjectManipulation"},{keys:"i<register>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],s=Object.create(null),c=a.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"}],p=gn("");function h(u){u.setOption("disableInput",!0),u.setOption("showCursorWhenSelecting",!1),e.signal(u,"vim-mode-change",{mode:"normal"}),u.on("cursorActivity",Ms),Q(u),e.on(u.getInputField(),"paste",w(u))}function v(u){u.setOption("disableInput",!1),u.off("cursorActivity",Ms),e.off(u.getInputField(),"paste",w(u)),u.state.vim=null,Hi&&clearTimeout(Hi)}function w(u){var m=u.state.vim;return m.onPasteFn||(m.onPasteFn=function(){m.insertMode||(u.setCursor(Ct(u.getCursor(),0,1)),Ht.enterInsertMode(u,{},m))}),m.onPasteFn}var _=/[\d]/,C=[e.isWordChar,function(u){return u&&!e.isWordChar(u)&&!/\s/.test(u)}],E=[function(u){return/\S/.test(u)}],R=["<",">"],A=["-",'"',".",":","_","/","+"],H=/^\w$/,V=/^[A-Z]$/;try{V=RegExp("^[\\p{Lu}]$","u")}catch{}function U(u,m){return m>=u.firstLine()&&m<=u.lastLine()}function L(u){return/^[a-z]$/.test(u)}function G(u){return"()[]{}".indexOf(u)!=-1}function he(u){return _.test(u)}function N(u){return V.test(u)}function I(u){return/^\s*$/.test(u)}function $(u){return".?!".indexOf(u)!=-1}function de(u,m){for(var y=0;y<m.length;y++)if(m[y]==u)return!0;return!1}var fe={};function xe(u,m,y,b,x){if(m===void 0&&!x)throw Error("defaultValue is required unless callback is provided");if(y||(y="string"),fe[u]={type:y,defaultValue:m,callback:x},b)for(var k=0;k<b.length;k++)fe[b[k]]=fe[u];m&&te(u,m)}function te(u,m,y,b){var x=fe[u];b||(b={});var k=b.scope;if(!x)return Error("Unknown option: "+u);if(x.type=="boolean"){if(m&&m!==!0)return Error("Invalid argument: "+u+"="+m);m!==!1&&(m=!0)}x.callback?(k!=="local"&&x.callback(m,void 0),k!=="global"&&y&&x.callback(m,y)):(k!=="local"&&(x.value=x.type=="boolean"?!!m:m),k!=="global"&&y&&(y.state.vim.options[u]={value:m}))}function be(u,m,y){var b=fe[u];y||(y={});var x=y.scope;if(!b)return Error("Unknown option: "+u);if(b.callback){let k=m&&b.callback(void 0,m);return x!=="global"&&k!==void 0?k:x==="local"?void 0:b.callback()}else return(x!=="global"&&m&&m.state.vim.options[u]||x!=="local"&&b||{}).value}xe("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)}}),xe("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 Se=function(){var u=100,m=-1,y=0,b=0,x=Array(u);function k(M,z,j){var se=x[m%u];function oe(Z){var we=++m%u,_e=x[we];_e&&_e.clear(),x[we]=M.setBookmark(Z)}if(se){var Y=se.find();Y&&!Vt(Y,z)&&oe(z)}else oe(z);oe(j),y=m,b=m-u+1,b<0&&(b=0)}function T(M,z){m+=z,m>y?m=y:m<b&&(m=b);var j=x[(u+m)%u];if(j&&!j.find()){var se=z>0?1:-1,oe,Y=M.getCursor();do if(m+=se,j=x[(u+m)%u],j&&(oe=j.find())&&!Vt(Y,oe))break;while(m<y&&m>b)}return j}function O(M,z){var j=m,se=T(M,z);return m=j,se&&se.find()}return{cachedCursor:void 0,add:k,find:O,move:T}},ie=function(u){return u?{changes:u.changes,expectCursorActivityForChange:u.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class X{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=ie()}exitMacroRecordMode(){var m=K.macroModeState;m.onRecordingDone&&m.onRecordingDone(),m.onRecordingDone=void 0,m.isRecording=!1}enterMacroRecordMode(m,y){var b=K.registerController.getRegister(y);if(b){if(b.clear(),this.latestRegister=y,m.openDialog){var x=tr("span",{class:"cm-vim-message"},"recording @"+y);this.onRecordingDone=m.openDialog(x,function(){},{bottom:!0})}this.isRecording=!0}}}function Q(u){return u.state.vim||(u.state.vim={inputState:new Xn,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeReturn:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:void 0,sel:{anchor:new n(0,0),head:new n(0,0)},options:{},expectLiteralNext:!1,status:""}),u.state.vim}var K;function Ne(){for(var u in K={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:Se(),macroModeState:new X,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new Ln({}),searchHistoryController:new Pr,exCommandHistoryController:new Pr},fe){var m=fe[u];m.value=m.defaultValue}}class Qe{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 ut,Be={enterVimMode:h,leaveVimMode:v,buildKeyMap:function(){},getRegisterController:function(){return K.registerController},resetVimGlobalState_:Ne,getVimGlobalState_:function(){return K},maybeInitVimState_:Q,suppressErrorLogging:!1,InsertModeKey:Qe,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=a.length,y=c,b=a.slice(0,m-y);if(a=a.slice(m-y),u)for(var x=b.length-1;x>=0;x--){var k=b[x];if(u!==k.context)if(k.context)this._mapCommand(k);else{var T=["normal","insert","visual"];for(var O in T)if(T[O]!==u){var M=Object.assign({},k);M.context=T[O],this._mapCommand(M)}}}},langmap:gt,vimKeyFromEvent:tn,setOption:te,getOption:be,defineOption:xe,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');Ra[u]=y,Gt.commandMap_[m]={name:u,shortName:m,type:"api"}},handleKey:function(u,m,y){var b=this.findKey(u,m,y);if(typeof b=="function")return b()},multiSelectHandleKey:Io,findKey:function(u,m,y){var b=Q(u),x=u;function k(){var j=K.macroModeState;if(j.isRecording){if(m=="q")return j.exitMacroRecordMode(),kt(x),!0;y!="mapping"&&No(j,m)}}function T(){if(m=="<Esc>"){if(b.visualMode)Je(x);else if(b.insertMode)Lr(x);else return;return kt(x),!0}}function O(){if(T())return!0;b.inputState.keyBuffer.push(m);var j=b.inputState.keyBuffer.join(""),se=m.length==1,oe=An.matchCommand(j,a,b.inputState,"insert"),Y=b.inputState.changeQueue;if(oe.type=="none")return kt(x),!1;if(oe.type=="partial"){if(oe.expectLiteralNext&&(b.expectLiteralNext=!0),ut&&window.clearTimeout(ut),ut=se&&window.setTimeout(function(){b.insertMode&&b.inputState.keyBuffer.length&&kt(x)},be("insertModeEscKeysTimeout")),se){var Z=x.listSelections();(!Y||Y.removed.length!=Z.length)&&(Y=b.inputState.changeQueue=new ai),Y.inserted+=m;for(var we=0;we<Z.length;we++){var _e=vt(Z[we].anchor,Z[we].head),je=On(Z[we].anchor,Z[we].head),Ee=x.getRange(_e,x.state.overwrite?Ct(je,0,1):je);Y.removed[we]=(Y.removed[we]||"")+Ee}}return!se}else oe.type=="full"&&(b.inputState.keyBuffer.length=0);if(b.expectLiteralNext=!1,ut&&window.clearTimeout(ut),oe.command&&Y){for(var Z=x.listSelections(),we=0;we<Z.length;we++){var Ie=Z[we].head;x.replaceRange(Y.removed[we]||"",Ct(Ie,0,-Y.inserted.length),Ie,"+input")}K.macroModeState.lastInsertModeChanges.changes.pop()}return oe.command||kt(x),oe.command}function M(){if(k()||T())return!0;b.inputState.keyBuffer.push(m);var j=b.inputState.keyBuffer.join("");if(/^[1-9]\d*$/.test(j))return!0;var se=/^(\d*)(.*)$/.exec(j);if(!se)return kt(x),!1;var oe=b.visualMode?"visual":"normal",Y=se[2]||se[1];b.inputState.operatorShortcut&&b.inputState.operatorShortcut.slice(-1)==Y&&(Y=b.inputState.operatorShortcut);var Z=An.matchCommand(Y,a,b.inputState,oe);return Z.type=="none"?(kt(x),!1):Z.type=="partial"?(Z.expectLiteralNext&&(b.expectLiteralNext=!0),!0):Z.type=="clear"?(kt(x),!0):(b.expectLiteralNext=!1,b.inputState.keyBuffer.length=0,se=/^(\d*)(.*)$/.exec(j),se&&se[1]&&se[1]!="0"&&b.inputState.pushRepeatDigit(se[1]),Z.command)}var z=b.insertMode?O():M();if(z===!1)return!b.insertMode&&(m.length===1||e.isMac&&/<A-.>/.test(m))?function(){return!0}:void 0;if(z===!0)return function(){return!0};if(z)return function(){return x.operation(function(){x.curOp.isVimOp=!0;try{if(typeof z!="object")return;z.type=="keyToKey"?It(x,z.toKeys,z):An.processCommand(x,b,z)}catch(j){throw x.state.vim=void 0,Q(x),Be.suppressErrorLogging||console.log(j),j}return!0})}},handleEx:function(u,m){Gt.processCommand(u,m)},defineMotion:Fi,defineAction:Qt,defineOperator:si,mapCommand:Ar,_mapCommand:Oo,defineRegister:vn,exitVisualMode:Je,exitInsertMode:Lr},We=[],Re=!1,Me;function hn(u){if(!Me)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=`
39
+ `;else if(Ue[m]){var y=Me.value||"",b={key:Ue[m],target:{value:y,selectionEnd:y.length,selectionStart:y.length}};Me.onKeyDown&&Me.onKeyDown(b,Me.value,k),Me&&Me.onKeyUp&&Me.onKeyUp(b,Me.value,k);return}}if(u==`
40
+ `){var x=Me;Me=null,x.onClose&&x.onClose(x.value)}else Me.value=(Me.value||"")+u;function k(T){Me&&(typeof T=="string"?Me.value=T:Me=null)}}function It(u,m,y){var b=Re;if(y){if(We.indexOf(y)!=-1)return;We.push(y),Re=y.noremap!=0}try{for(var x=Q(u),k=/<(?:[CSMA]-)*\w+>|./gi,T;T=k.exec(m);){var O=T[0],M=x.insertMode;if(Me){hn(O);continue}if(!Be.handleKey(u,O,"mapping")&&M&&x.insertMode){if(O[0]=="<"){var z=O.toLowerCase().slice(1,-1);if(z=z.split("-").pop()||"",z=="lt")O="<";else if(z=="space")O=" ";else if(z=="cr")O=`
41
+ `;else if(Ue.hasOwnProperty(z)){O=Ue[z],kn(u,O);continue}else O=O[0],k.lastIndex=T.index+1}u.replaceSelection(O)}}}finally{if(We.pop(),Re=We.length?b:!1,!We.length&&Me){var j=Me;Me=null,Ro(u,j)}}}var Dn={Return:"CR",Backspace:"BS",Delete:"Del",Escape:"Esc",Insert:"Ins",ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"CR"," ":"Space"},sn={Shift:1,Alt:1,Command:1,Control:1,CapsLock:1,AltGraph:1,Dead:1,Unidentified:1},Ue={};"Left|Right|Up|Down|End|Home".split("|").concat(Object.keys(Dn)).forEach(function(u){Ue[(Dn[u]||"").toLowerCase()]=Ue[u.toLowerCase()]=u});function tn(u,m){var k;var y=u.key;if(!sn[y]){y.length>1&&y[0]=="n"&&(y=y.replace("Numpad","")),y=Dn[y]||y;var b="";if(u.ctrlKey&&(b+="C-"),u.altKey&&(b+="A-"),u.metaKey&&(b+="M-"),e.isMac&&b=="A-"&&y.length==1&&(b=b.slice(2)),(b||y.length>1)&&u.shiftKey&&(b+="S-"),m&&!m.expectLiteralNext&&y.length==1){if(p.keymap&&y in p.keymap)(p.remapCtrl!=0||!b)&&(y=p.keymap[y]);else if(y.charCodeAt(0)>128&&!s[y]){var x=((k=u.code)==null?void 0:k.slice(-1))||"";u.shiftKey||(x=x.toLowerCase()),x&&(y=x,!b&&u.altKey&&(b="A-"))}}return b+=y,b.length>1&&(b="<"+b+">"),b}}function gt(u,m){p.string!==u&&(p=gn(u)),p.remapCtrl=m}function gn(u){let m={};if(!u)return{keymap:m,string:""};function y(b){return b.split(/\\?(.)/).filter(Boolean)}return u.split(/((?:[^\\,]|\\.)+),/).map(b=>{if(!b)return;let x=b.split(/((?:[^\\;]|\\.)+);/);if(x.length==3){let k=y(x[1]),T=y(x[2]);if(k.length!==T.length)return;for(let O=0;O<k.length;++O)m[k[O]]=T[O]}else if(x.length==1){let k=y(b);if(k.length%2!=0)return;for(let T=0;T<k.length;T+=2)m[k[T]]=k[T+1]}}),{keymap:m,string:u}}xe("langmap",void 0,"string",["lmap"],function(u,m){if(u===void 0)return p.string;gt(u)});class Xn{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 kt(u,m){u.state.vim.inputState=new Xn,u.state.vim.expectLiteralNext=!1,e.signal(u,"vim-command-done",m)}function ai(){this.removed=[],this.inserted=""}class yn{constructor(m,y,b){this.clear(),this.keyBuffer=[m||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!y,this.blockwise=!!b}setText(m,y,b){this.keyBuffer=[m||""],this.linewise=!!y,this.blockwise=!!b}pushText(m,y){y&&(this.linewise||this.keyBuffer.push(`
42
+ `),this.linewise=!0),this.keyBuffer.push(m)}pushInsertModeChanges(m){this.insertModeChanges.push(ie(m))}pushSearchQuery(m){this.searchQueries.push(m)}clear(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1}toString(){return this.keyBuffer.join("")}}function vn(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,A.push(u)}class Ln{constructor(m){this.registers=m,this.unnamedRegister=m['"']=new yn,m["."]=new yn,m[":"]=new yn,m["/"]=new yn,m["+"]=new yn}pushText(m,y,b,x,k){if(m!=="_"){x&&b.charAt(b.length-1)!==`
43
+ `&&(b+=`
44
+ `);var T=this.isValidRegister(m)?this.getRegister(m):null;if(!T||!m){switch(y){case"yank":this.registers[0]=new yn(b,x,k);break;case"delete":case"change":b.indexOf(`
45
+ `)==-1?this.registers["-"]=new yn(b,x):(this.shiftNumericRegisters_(),this.registers[1]=new yn(b,x));break}this.unnamedRegister.setText(b,x,k);return}N(m)?T.pushText(b,x):T.setText(b,x,k),m==="+"&&navigator.clipboard.writeText(b),this.unnamedRegister.setText(T.toString(),x)}}getRegister(m){return this.isValidRegister(m)?(m=m.toLowerCase(),this.registers[m]||(this.registers[m]=new yn),this.registers[m]):this.unnamedRegister}isValidRegister(m){return m&&(de(m,A)||H.test(m))}shiftNumericRegisters_(){for(var m=9;m>=2;m--)this.registers[m]=this.getRegister(""+(m-1))}}class Pr{constructor(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}nextMatch(m,y){var b=this.historyBuffer,x=y?-1:1;this.initialPrefix===null&&(this.initialPrefix=m);for(var k=this.iterator+x;y?k>=0:k<b.length;k+=x)for(var T=b[k],O=0;O<=T.length;O++)if(this.initialPrefix==T.substring(0,O))return this.iterator=k,T;if(k>=b.length)return this.iterator=b.length,this.initialPrefix;if(k<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 An={matchCommand:function(u,m,y,b){var x=li(u,m,b,y),k=x.full[0];if(!k)return x.partial.length?{type:"partial",expectLiteralNext:x.partial.length==1&&x.partial[0].keys.slice(-11)=="<character>"}:{type:"none"};if(k.keys.slice(-11)=="<character>"||k.keys.slice(-10)=="<register>"){var T=Mr(u);if(!T||T.length>1)return{type:"clear"};y.selectedCharacter=T}return{type:"full",command:k}},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=Ft(y.motionArgs),this.evalInput(u,m)},processOperator:function(u,m,y){var b=m.inputState;if(b.operator)if(b.operator==y.operator){b.motion="expandToLine",b.motionArgs={linewise:!0,repeat:1},this.evalInput(u,m);return}else kt(u);b.operator=y.operator,b.operatorArgs=Ft(y.operatorArgs),y.keys.length>1&&(b.operatorShortcut=y.keys),y.exitVisualBlock&&(m.visualBlock=!1,bt(u)),m.visualMode&&this.evalInput(u,m)},processOperatorMotion:function(u,m,y){var b=m.visualMode,x=Ft(y.operatorMotionArgs);x&&b&&x.visualLine&&(m.visualLine=!0),this.processOperator(u,m,y),b||this.processMotion(u,m,y)},processAction:function(u,m,y){var b=m.inputState,x=b.getRepeat(),k=!!x,T=Ft(y.actionArgs)||{repeat:1};b.selectedCharacter&&(T.selectedCharacter=b.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=x||1,T.repeatIsExplicit=k,T.registerName=b.registerName,kt(u),m.lastMotion=null,y.isEdit&&this.recordLastEdit(m,b,y),Ht[y.action](u,T,m)},processSearch:function(u,m,y){if(!u.getSearchCursor)return;var b=y.searchArgs.forward,x=y.searchArgs.wholeWordOnly;bn(u).setReversed(!b);var k=b?"/":"?",T=bn(u).getQuery(),O=u.getScrollInfo(),M="";function z(Ee,Ie,lt){K.searchHistoryController.pushInput(Ee),K.searchHistoryController.reset();try{mr(u,Ee,Ie,lt)}catch{Ve(u,"Invalid regex: "+Ee),kt(u);return}An.processMotion(u,m,{keys:"",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:y.searchArgs.toJumplist}})}function j(Ee){u.scrollTo(O.left,O.top),z(Ee,!0,!0);var Ie=K.macroModeState;Ie.isRecording&&Ns(Ie,Ee)}function se(){return be("pcre")?"(JavaScript regexp: set pcre)":"(Vim regexp: set nopcre)"}function oe(Ee,Ie,lt){var Xe=tn(Ee),Ot,Pt;Xe=="<Up>"||Xe=="<Down>"?(Ot=Xe=="<Up>",Pt=Ee.target?Ee.target.selectionEnd:0,Ie=K.searchHistoryController.nextMatch(Ie,Ot)||"",lt(Ie),Pt&&Ee.target&&(Ee.target.selectionEnd=Ee.target.selectionStart=Math.min(Pt,Ee.target.value.length))):Xe&&Xe!="<Left>"&&Xe!="<Right>"&&K.searchHistoryController.reset(),M=Ie,Y()}function Y(){var Ee;try{Ee=mr(u,M,!0,!0)}catch{}Ee?u.scrollIntoView(oc(u,!b,Ee),30):(di(u),u.scrollTo(O.left,O.top))}function Z(Ee,Ie,lt){var Xe=tn(Ee);Xe=="<Esc>"||Xe=="<C-c>"||Xe=="<C-[>"||Xe=="<BS>"&&Ie==""?(K.searchHistoryController.pushInput(Ie),K.searchHistoryController.reset(),mr(u,(T==null?void 0:T.source)||""),di(u),u.scrollTo(O.left,O.top),e.e_stop(Ee),kt(u),lt(),u.focus()):Xe=="<Up>"||Xe=="<Down>"?e.e_stop(Ee):Xe=="<C-u>"&&(e.e_stop(Ee),lt(""))}switch(y.searchArgs.querySrc){case"prompt":var we=K.macroModeState;we.isPlaying?z(we.replaySearchQueries.shift()||"",!0,!1):Ro(u,{onClose:j,prefix:k,desc:tr("span",{$cursor:"pointer",onmousedown:function(Ie){Ie.preventDefault(),te("pcre",!be("pcre")),this.textContent=se(),Y()}},se()),onKeyUp:oe,onKeyDown:Z});break;case"wordUnderCursor":var _e=Ce(u,{noSymbol:!0}),je=!0;if(_e||(_e=Ce(u,{noSymbol:!1}),je=!1),!_e){Ve(u,"No word under cursor"),kt(u);return}let Ee=u.getLine(_e.start.line).substring(_e.start.ch,_e.end.ch);Ee=je&&x?"\\b"+Ee+"\\b":Ur(Ee),K.jumpList.cachedCursor=u.getCursor(),u.setCursor(_e.start),z(Ee,!0,!1);break}},processEx:function(u,m,y){function b(O){K.exCommandHistoryController.pushInput(O),K.exCommandHistoryController.reset(),Gt.processCommand(u,O),u.state.vim&&kt(u),di(u)}function x(O,M,z){var j=tn(O),se,oe;(j=="<Esc>"||j=="<C-c>"||j=="<C-[>"||j=="<BS>"&&M=="")&&(K.exCommandHistoryController.pushInput(M),K.exCommandHistoryController.reset(),e.e_stop(O),kt(u),di(u),z(),u.focus()),j=="<Up>"||j=="<Down>"?(e.e_stop(O),se=j=="<Up>",oe=O.target?O.target.selectionEnd:0,M=K.exCommandHistoryController.nextMatch(M,se)||"",z(M),oe&&O.target&&(O.target.selectionEnd=O.target.selectionStart=Math.min(oe,O.target.value.length))):j=="<C-u>"?(e.e_stop(O),z("")):j&&j!="<Left>"&&j!="<Right>"&&K.exCommandHistoryController.reset()}function k(O,M){var z=new e.StringStream(M),j={};try{if(Gt.parseInput_(u,z,j),j.commandName!="s"){di(u);return}var se=Gt.matchCommand_(j.commandName);if(!se||(Gt.parseCommandArgs_(z,j,se),!j.argString))return;var oe=To(j.argString.slice(1),!0,!0);oe&&Qr(u,oe)}catch{}}if(y.type=="keyToEx")Gt.processCommand(u,y.exArgs.input);else{var T={onClose:b,onKeyDown:x,onKeyUp:k,prefix:":"};m.visualMode&&(T.value="'<,'>",T.selectValueOnOpen=!1),Ro(u,T)}},evalInput:function(u,m){var y=m.inputState,b=y.motion,x=y.motionArgs||{repeat:1},k=y.operator,T=y.operatorArgs||{},O=y.registerName,M=m.sel,z=Ge(m.visualMode?yt(u,M.head):u.getCursor("head")),j=Ge(m.visualMode?yt(u,M.anchor):u.getCursor("anchor")),se=Ge(z),oe=Ge(j),Y,Z,we;if(k&&this.recordLastEdit(m,y),we=y.repeatOverride===void 0?y.getRepeat():y.repeatOverride,we>0&&x.explicitRepeat?x.repeatIsExplicit=!0:(x.noRepeat||!x.explicitRepeat&&we===0)&&(we=1,x.repeatIsExplicit=!1),y.selectedCharacter&&(x.selectedCharacter=T.selectedCharacter=y.selectedCharacter),x.repeat=we,kt(u),b){var _e=nn[b](u,z,x,m,y);if(m.lastMotion=nn[b],!_e)return;if(x.toJumplist){var je=K.jumpList,Ee=je.cachedCursor;Ee?(tt(u,Ee,_e),delete je.cachedCursor):tt(u,z,_e)}_e instanceof Array?(Z=_e[0],Y=_e[1]):Y=_e,Y||(Y=Ge(z)),m.visualMode?(m.visualBlock&&Y.ch===1/0||(Y=yt(u,Y,se)),Z&&(Z=yt(u,Z)),Z||(Z=oe),M.anchor=Z,M.head=Y,bt(u),fr(u,m,"<",st(Z,Y)?Z:Y),fr(u,m,">",st(Z,Y)?Y:Z)):k||(Y=yt(u,Y,se),u.setCursor(Y.line,Y.ch))}if(k){if(T.lastSel){Z=oe;var Ie=T.lastSel,lt=Math.abs(Ie.head.line-Ie.anchor.line),Xe=Math.abs(Ie.head.ch-Ie.anchor.ch);Y=Ie.visualLine?new n(oe.line+lt,oe.ch):Ie.visualBlock?new n(oe.line+lt,oe.ch+Xe):Ie.head.line==Ie.anchor.line?new n(oe.line,oe.ch+Xe):new n(oe.line+lt,oe.ch),m.visualMode=!0,m.visualLine=Ie.visualLine,m.visualBlock=Ie.visualBlock,M=m.sel={anchor:Z,head:Y},bt(u)}else m.visualMode&&(T.lastSel={anchor:Ge(M.anchor),head:Ge(M.head),visualBlock:m.visualBlock,visualLine:m.visualLine});var Ot,Pt,ze,Ke,Jt;if(m.visualMode){Ot=vt(M.head,M.anchor),Pt=On(M.head,M.anchor),ze=m.visualLine||T.linewise,Ke=m.visualBlock?"block":ze?"line":"char";var Xt=i(u,Ot,Pt);if(Jt=jt(u,{anchor:Xt.start,head:Xt.end},Ke),ze){var ln=Jt.ranges;if(Ke=="block")for(var jo=0;jo<ln.length;jo++)ln[jo].head.ch=St(u,ln[jo].head.line);else Ke=="line"&&(ln[0].head=new n(ln[0].head.line+1,0))}}else{if(Ot=Ge(Z||oe),Pt=Ge(Y||se),st(Pt,Ot)){var lc=Ot;Ot=Pt,Pt=lc}ze=x.linewise||T.linewise,ze?ne(u,Ot,Pt):x.forward&&q(u,Ot,Pt),Ke="char";var Wi=!x.inclusive||ze,Xt=i(u,Ot,Pt);Jt=jt(u,{anchor:Xt.start,head:Xt.end},Ke,Wi)}u.setSelections(Jt.ranges,Jt.primary),m.lastMotion=null,T.repeat=we,T.registerName=O,T.linewise=ze;var As=Nr[k](u,T,Jt.ranges,oe,Y);m.visualMode&&Je(u,As!=null),As&&u.setCursor(As)}},recordLastEdit:function(u,m,y){var b=K.macroModeState;b.isPlaying||(u.lastEditInputState=m,u.lastEditActionCommand=y,b.lastInsertModeChanges.changes=[],b.lastInsertModeChanges.expectCursorActivityForChange=!1,b.lastInsertModeChanges.visualBlock=u.visualBlock?u.sel.head.line-u.sel.anchor.line:0)}},nn={moveToTopLine:function(u,m,y){var b=Ds(u).top+y.repeat-1;return new n(b,ye(u.getLine(b)))},moveToMiddleLine:function(u){var m=Ds(u),y=Math.floor((m.top+m.bottom)*.5);return new n(y,ye(u.getLine(y)))},moveToBottomLine:function(u,m,y){var b=Ds(u).bottom-y.repeat+1;return new n(b,ye(u.getLine(b)))},expandToLine:function(u,m,y){return new n(m.line+y.repeat-1,1/0)},findNext:function(u,m,y){var b=bn(u),x=b.getQuery();if(x){var k=!y.forward;k=b.isReversed()?!k:k,Qr(u,x);var T=oc(u,k,x,y.repeat);return T||Ve(u,"No match found "+x+(be("pcre")?" (set nopcre to use Vim regexps)":"")),T}},findAndSelectNextInclusive:function(u,m,y,b,x){var k=bn(u),T=k.getQuery();if(T){var O=!y.forward;O=k.isReversed()?!O:O;var M=ac(u,O,T,y.repeat,b);if(M){if(x.operator)return M;var z=M[0],j=new n(M[1].line,M[1].ch-1);if(b.visualMode){(b.visualLine||b.visualBlock)&&(b.visualLine=!1,b.visualBlock=!1,e.signal(u,"vim-mode-change",{mode:"visual",subMode:""}));var se=b.sel.anchor;if(se)return k.isReversed()?y.forward?[se,z]:[se,j]:y.forward?[se,j]:[se,z]}else b.visualMode=!0,b.visualLine=!1,b.visualBlock=!1,e.signal(u,"vim-mode-change",{mode:"visual",subMode:""});return O?[j,z]:[z,j]}}},goToMark:function(u,m,y,b){var x=Ta(u,b,y.selectedCharacter||"");return x?y.linewise?{line:x.line,ch:ye(u.getLine(x.line))}:x:null},moveToOtherHighlightedEnd:function(u,m,y,b){var x=b.sel;return b.visualBlock&&y.sameLine?[yt(u,new n(x.anchor.line,x.head.ch)),yt(u,new n(x.head.line,x.anchor.ch))]:[x.head,x.anchor]},jumpToMark:function(u,m,y,b){for(var x=m,k=0;k<y.repeat;k++){var T=x;for(var O in b.marks)if(L(O)){var M=b.marks[O].find();if(!(y.forward?st(M,T):st(T,M))&&!(y.linewise&&M.line==T.line)){var z=Vt(T,x),j=y.forward?Wr(T,M,x):Wr(x,M,T);(z||j)&&(x=M)}}}return y.linewise&&(x=new n(x.line,ye(u.getLine(x.line)))),x},moveByCharacters:function(u,m,y){var b=m,x=y.repeat,k=y.forward?b.ch+x:b.ch-x;return new n(b.line,k)},moveByLines:function(u,m,y,b){var x=m,k=x.ch;switch(b.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:k=b.lastHPos;break;default:b.lastHPos=k}var T=y.repeat+(y.repeatOffset||0),O=y.forward?x.line+T:x.line-T,M=u.firstLine(),z=u.lastLine(),j=u.findPosV(x,y.forward?T:-T,"line",b.lastHSPos);return(y.forward?j.line>O:j.line<O)&&(O=j.line,k=j.ch),O<M&&x.line==M?this.moveToStartOfLine(u,m,y,b):O>z&&x.line==z?$t(u,m,y,b,!0):(y.toFirstChar&&(k=ye(u.getLine(O)),b.lastHPos=k),b.lastHSPos=u.charCoords(new n(O,k),"div").left,new n(O,k))},moveByDisplayLines:function(u,m,y,b){var x=m;switch(b.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:b.lastHSPos=u.charCoords(x,"div").left}var k=y.repeat,T=u.findPosV(x,y.forward?k:-k,"line",b.lastHSPos);if(T.hitSide)if(y.forward){var O={top:u.charCoords(T,"div").top+8,left:b.lastHSPos};T=u.coordsChar(O,"div")}else{var M=u.charCoords(new n(u.firstLine(),0),"div");M.left=b.lastHSPos,T=u.coordsChar(M,"div")}return b.lastHPos=T.ch,T},moveByPage:function(u,m,y){var b=m,x=y.repeat;return u.findPosV(b,y.forward?x:-x,"page")},moveByParagraph:function(u,m,y){var b=y.forward?1:-1;return ec(u,m,y.repeat,b).start},moveBySentence:function(u,m,y){var b=y.forward?1:-1;return Ea(u,m,y.repeat,b)},moveByScroll:function(u,m,y,b){var x=u.getScrollInfo(),k=null,T=y.repeat;T||(T=x.clientHeight/(2*u.defaultTextHeight()));var O=u.charCoords(m,"local");if(y.repeat=T,k=nn.moveByDisplayLines(u,m,y,b),!k)return null;var M=u.charCoords(k,"local");return u.scrollTo(null,x.top+M.top-O.top),k},moveByWords:function(u,m,y){return ht(u,m,y.repeat,!!y.forward,!!y.wordEnd,!!y.bigWord)},moveTillCharacter:function(u,m,y){var b=y.repeat,x=er(u,b,y.forward,y.selectedCharacter,m),k=y.forward?-1:1;return it(k,y),x?(x.ch+=k,x):null},moveToCharacter:function(u,m,y){var b=y.repeat;return it(0,y),er(u,b,y.forward,y.selectedCharacter,m)||m},moveToSymbol:function(u,m,y){var b=y.repeat;return y.selectedCharacter&&He(u,b,y.forward,y.selectedCharacter)||m},moveToColumn:function(u,m,y,b){var x=y.repeat;return b.lastHPos=x-1,b.lastHSPos=u.charCoords(m,"div").left,ws(u,x)},moveToEol:function(u,m,y,b){return $t(u,m,y,b,!1)},moveToFirstNonWhiteSpaceCharacter:function(u,m){var y=m;return new n(y.line,ye(u.getLine(y.line)))},moveToMatchedSymbol:function(u,m){for(var y=m,b=y.line,x=y.ch,k=u.getLine(b),T;x<k.length;x++)if(T=k.charAt(x),T&&G(T)){var O=u.getTokenTypeAt(new n(b,x+1));if(O!=="string"&&O!=="comment")break}if(x<k.length){var M=T==="<"||T===">"?/[(){}[\]<>]/:/[(){}[\]]/;return u.findMatchingBracket(new n(b,x),{bracketRegex:M}).to}else return y},moveToStartOfLine:function(u,m){return new n(m.line,0)},moveToLineOrEdgeOfDocument:function(u,m,y){var b=y.forward?u.lastLine():u.firstLine();return y.repeatIsExplicit&&(b=y.repeat-u.getOption("firstLineNumber")),new n(b,ye(u.getLine(b)))},moveToStartOfDisplayLine:function(u){return u.execCommand("goLineLeft"),u.getCursor()},moveToEndOfDisplayLine:function(u){u.execCommand("goLineRight");var m=u.getCursor();return m.sticky=="before"&&m.ch--,m},textObjectManipulation:function(u,m,y,b){var x={"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"},k={"'":!0,'"':!0,"`":!0},T=y.selectedCharacter||"";T=="b"?T="(":T=="B"&&(T="{");var O=!y.textObjectInner,M,z;if(x[T]){if(z=!0,M=pr(u,m,T,O),!M){var j=u.getSearchCursor(RegExp("\\"+T,"g"),m);j.find()&&(M=pr(u,j.from(),T,O))}}else if(k[T])z=!0,M=_s(u,m,T,O);else if(T==="W"||T==="w")for(var se=y.repeat||1;se-- >0;){var oe=Ce(u,{inclusive:O,innerWord:!O,bigWord:T==="W",noSymbol:T==="W",multiline:!0},M&&M.end);oe&&(M||(M=oe),M.end=oe.end)}else if(T==="p")if(M=ec(u,m,y.repeat,0,O),y.linewise=!0,b.visualMode)b.visualLine||(b.visualLine=!0);else{var Y=b.inputState.operatorArgs;Y&&(Y.linewise=!0),M.end.line--}else if(T==="t")M=pt(u,m,O);else if(T==="s"){var Z=u.getLine(m.line);m.ch>0&&$(Z[m.ch])&&--m.ch;var we=So(u,m,y.repeat,1,O),_e=So(u,m,y.repeat,-1,O);I(u.getLine(_e.line)[_e.ch])&&I(u.getLine(we.line)[we.ch-1])&&(_e={line:_e.line,ch:_e.ch+1}),M={start:_e,end:we}}return M?u.state.vim.visualMode?Pn(u,M.start,M.end,z):[M.start,M.end]:null},repeatLastCharacterSearch:function(u,m,y){var b=K.lastCharacterSearch,x=y.repeat,k=y.forward===b.forward,T=(b.increment?1:0)*(k?-1:1);u.moveH(-T,"char"),y.inclusive=!!k;var O=er(u,x,k,b.selectedCharacter);return O?(O.ch+=T,O):(u.moveH(T,"char"),m)}};function Fi(u,m){nn[u]=m}function $r(u,m){for(var y=[],b=0;b<m;b++)y.push(u);return y}var Nr={change:function(u,m,y){var b,x,k=u.state.vim,T=y[0].anchor,O=y[0].head;if(k.visualMode)if(m.fullLine)O.ch=Number.MAX_VALUE,O.line--,u.setSelection(T,O),x=u.getSelection(),u.replaceSelection(""),b=T;else{x=u.getSelection();var M=$r("",y.length);u.replaceSelections(M),b=vt(y[0].head,y[0].anchor)}else{x=u.getRange(T,O);var z=k.lastEditInputState;if((z==null?void 0:z.motion)=="moveByWords"&&!I(x)){var j=/\s+$/.exec(x);j&&z.motionArgs&&z.motionArgs.forward&&(O=Ct(O,0,-j[0].length),x=x.slice(0,-j[0].length))}m.linewise&&(T=new n(T.line,ye(u.getLine(T.line))),O.line>T.line&&(O=new n(O.line-1,Number.MAX_VALUE))),u.replaceRange("",T,O),b=T}K.registerController.pushText(m.registerName,"change",x,m.linewise,y.length>1),Ht.enterInsertMode(u,{head:b},u.state.vim)},delete:function(u,m,y){var b,x,k=u.state.vim;if(k.visualBlock){x=u.getSelection();var T=$r("",y.length);u.replaceSelections(T),b=vt(y[0].head,y[0].anchor)}else{var O=y[0].anchor,M=y[0].head;m.linewise&&M.line!=u.firstLine()&&O.line==u.lastLine()&&O.line==M.line-1&&(O.line==u.firstLine()?O.ch=0:O=new n(O.line-1,St(u,O.line-1))),x=u.getRange(O,M),u.replaceRange("",O,M),b=O,m.linewise&&(b=nn.moveToFirstNonWhiteSpaceCharacter(u,O))}return K.registerController.pushText(m.registerName,"delete",x,m.linewise,k.visualBlock),yt(u,b)},indent:function(u,m,y){var b=u.state.vim,x=b.visualMode&&m.repeat||1;if(b.visualBlock){for(var k=u.getOption("tabSize"),T=u.getOption("indentWithTabs")?" ":" ".repeat(k),O,M=y.length-1;M>=0;M--)if(O=vt(y[M].anchor,y[M].head),m.indentRight)u.replaceRange(T.repeat(x),O,O);else{for(var z=u.getLine(O.line),j=0,se=0;se<x;se++){var oe=z[O.ch+j];if(oe==" ")j++;else if(oe==" "){j++;for(var Y=1;Y<T.length&&(oe=z[O.ch+j],oe===" ");Y++)j++}else break}u.replaceRange("",O,Ct(O,0,j))}return O}else if(u.indentMore)for(var se=0;se<x;se++)m.indentRight?u.indentMore():u.indentLess();else{var Z=y[0].anchor.line,we=b.visualBlock?y[y.length-1].anchor.line:y[0].head.line;m.linewise&&we--;for(var M=Z;M<=we;M++)for(var se=0;se<x;se++)u.indentLine(M,m.indentRight)}return nn.moveToFirstNonWhiteSpaceCharacter(u,y[0].anchor)},indentAuto:function(u,m,y){return u.execCommand("indentAuto"),nn.moveToFirstNonWhiteSpaceCharacter(u,y[0].anchor)},hardWrap:function(u,m,y,b){if(u.hardWrap){var x=y[0].anchor.line,k=y[0].head.line;m.linewise&&k--;var T=u.hardWrap({from:x,to:k});return T>x&&m.linewise&&T--,m.keepCursor?b:new n(T,0)}},changeCase:function(u,m,y,b,x){for(var k=u.getSelections(),T=[],O=m.toLower,M=0;M<k.length;M++){var z=k[M],j="";if(O===!0)j=z.toLowerCase();else if(O===!1)j=z.toUpperCase();else for(var se=0;se<z.length;se++){var oe=z.charAt(se);j+=N(oe)?oe.toLowerCase():oe.toUpperCase()}T.push(j)}return u.replaceSelections(T),m.shouldMoveCursor?x:!u.state.vim.visualMode&&m.linewise&&y[0].anchor.line+1==y[0].head.line?nn.moveToFirstNonWhiteSpaceCharacter(u,b):m.linewise?b:vt(y[0].anchor,y[0].head)},yank:function(u,m,y,b){var x=u.state.vim,k=u.getSelection(),T=x.visualMode?vt(x.sel.anchor,x.sel.head,y[0].head,y[0].anchor):b;return K.registerController.pushText(m.registerName,"yank",k,m.linewise,x.visualBlock),T},rot13:function(u,m,y,b,x){for(var k=u.getSelections(),T=[],O=0;O<k.length;O++){let M=k[O].split("").map(z=>{let j=z.charCodeAt(0);return j>=65&&j<=90?String.fromCharCode(65+(j-65+13)%26):j>=97&&j<=122?String.fromCharCode(97+(j-97+13)%26):z}).join("");T.push(M)}return u.replaceSelections(T),m.shouldMoveCursor?x:!u.state.vim.visualMode&&m.linewise&&y[0].anchor.line+1==y[0].head.line?nn.moveToFirstNonWhiteSpaceCharacter(u,b):m.linewise?b:vt(y[0].anchor,y[0].head)}};function si(u,m){Nr[u]=m}var Ht={jumpListWalk:function(u,m,y){if(!y.visualMode){var b=m.repeat||1,x=m.forward,k=K.jumpList.move(u,x?b:-b),T=k?k.find():void 0;T||(T=u.getCursor()),u.setCursor(T)}},scroll:function(u,m,y){if(!y.visualMode){var b=m.repeat||1,x=u.defaultTextHeight(),k=u.getScrollInfo().top,T=x*b,O=m.forward?k+T:k-T,M=Ge(u.getCursor()),z=u.charCoords(M,"local");if(m.forward)O>z.top?(M.line+=(O-z.top)/x,M.line=Math.ceil(M.line),u.setCursor(M),z=u.charCoords(M,"local"),u.scrollTo(null,z.top)):u.scrollTo(null,O);else{var j=O+u.getScrollInfo().clientHeight;j<z.bottom?(M.line-=(z.bottom-j)/x,M.line=Math.floor(M.line),u.setCursor(M),z=u.charCoords(M,"local"),u.scrollTo(null,z.bottom-u.getScrollInfo().clientHeight)):u.scrollTo(null,O)}}},scrollToCursor:function(u,m){var y=u.getCursor().line,b=u.charCoords(new n(y,0),"local"),x=u.getScrollInfo().clientHeight,k=b.top;switch(m.position){case"center":k=b.bottom-x/2;break;case"bottom":var T=new n(y,u.getLine(y).length-1),O=u.charCoords(T,"local").bottom-k;k=k-x+O;break}u.scrollTo(null,k)},replayMacro:function(u,m,y){var b=m.selectedCharacter||"",x=m.repeat||1,k=K.macroModeState;for(b=="@"?b=k.latestRegister||"":k.latestRegister=b;x--;)Ps(u,y,k,b)},enterMacroRecordMode:function(u,m){var y=K.macroModeState,b=m.selectedCharacter;K.registerController.isValidRegister(b)&&y.enterMacroRecordMode(u,b)},toggleOverwrite:function(u){u.state.overwrite?(u.toggleOverwrite(!1),u.setOption("keyMap","vim-insert"),e.signal(u,"vim-mode-change",{mode:"insert"})):(u.toggleOverwrite(!0),u.setOption("keyMap","vim-replace"),e.signal(u,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(u,m,y){if(!u.getOption("readOnly")){y.insertMode=!0,y.insertModeRepeat=m&&m.repeat||1;var b=m?m.insertAt:null,x=y.sel,k=m.head||u.getCursor("head"),T=u.listSelections().length;if(b=="eol")k=new n(k.line,St(u,k.line));else if(b=="bol")k=new n(k.line,0);else if(b=="charAfter"){var O=i(u,k,Ct(k,0,1));k=O.end}else if(b=="firstNonBlank"){var O=i(u,k,nn.moveToFirstNonWhiteSpaceCharacter(u,k));k=O.end}else if(b=="startOfSelectedArea"){if(!y.visualMode)return;y.visualBlock?(k=new n(Math.min(x.head.line,x.anchor.line),Math.min(x.head.ch,x.anchor.ch)),T=Math.abs(x.head.line-x.anchor.line)+1):k=x.head.line<x.anchor.line?x.head:new n(x.anchor.line,0)}else if(b=="endOfSelectedArea"){if(!y.visualMode)return;y.visualBlock?(k=new n(Math.min(x.head.line,x.anchor.line),Math.max(x.head.ch,x.anchor.ch)+1),T=Math.abs(x.head.line-x.anchor.line)+1):k=x.head.line>=x.anchor.line?Ct(x.head,0,1):new n(x.anchor.line,0)}else if(b=="inplace"){if(y.visualMode)return}else b=="lastEdit"&&(k=Do(u)||k);u.setOption("disableInput",!1),m&&m.replace?(u.toggleOverwrite(!0),u.setOption("keyMap","vim-replace"),e.signal(u,"vim-mode-change",{mode:"replace"})):(u.toggleOverwrite(!1),u.setOption("keyMap","vim-insert"),e.signal(u,"vim-mode-change",{mode:"insert"})),K.macroModeState.isPlaying||(u.on("change",Mo),y.insertEnd&&y.insertEnd.clear(),y.insertEnd=u.setBookmark(k,{insertLeft:!0}),e.on(u.getInputField(),"keydown",Ao)),y.visualMode&&Je(u),Bn(u,k,T)}},toggleVisualMode:function(u,m,y){var b=m.repeat,x=u.getCursor(),k;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":""}),bt(u)):Je(u);else{y.visualMode=!0,y.visualLine=!!m.linewise,y.visualBlock=!!m.blockwise,k=yt(u,new n(x.line,x.ch+b-1));var T=i(u,x,k);y.sel={anchor:T.start,head:T.end},e.signal(u,"vim-mode-change",{mode:"visual",subMode:y.visualLine?"linewise":y.visualBlock?"blockwise":""}),bt(u),fr(u,y,"<",vt(x,k)),fr(u,y,">",On(x,k))}},reselectLastSelection:function(u,m,y){var b=y.lastSelection;if(y.visualMode&&Zn(u,y),b){var x=b.anchorMark.find(),k=b.headMark.find();if(!x||!k)return;y.sel={anchor:x,head:k},y.visualMode=!0,y.visualLine=b.visualLine,y.visualBlock=b.visualBlock,bt(u),fr(u,y,"<",vt(x,k)),fr(u,y,">",On(x,k)),e.signal(u,"vim-mode-change",{mode:"visual",subMode:y.visualLine?"linewise":y.visualBlock?"blockwise":""})}},joinLines:function(u,m,y){var b,x;if(y.visualMode){if(b=u.getCursor("anchor"),x=u.getCursor("head"),st(x,b)){var k=x;x=b,b=k}x.ch=St(u,x.line)-1}else{var T=Math.max(m.repeat,2);b=u.getCursor(),x=yt(u,new n(b.line+T-1,1/0))}for(var O=0,M=b.line;M<x.line;M++){O=St(u,b.line);var z="",j=0;if(!m.keepSpaces){var se=u.getLine(b.line+1);j=se.search(/\S/),j==-1?j=se.length:z=" "}u.replaceRange(z,new n(b.line,O),new n(b.line+1,j))}var oe=yt(u,new n(b.line,O));y.visualMode&&Je(u,!1),u.setCursor(oe)},newLineAndEnterInsertMode:function(u,m,y){y.insertMode=!0;var b=Ge(u.getCursor());b.line===u.firstLine()&&!m.after?(u.replaceRange(`
46
+ `,new n(u.firstLine(),0)),u.setCursor(u.firstLine(),0)):(b.line=m.after?b.line:b.line-1,b.ch=St(u,b.line),u.setCursor(b),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(u)),this.enterInsertMode(u,{repeat:m.repeat},y)},paste:function(u,m,y){var b=K.registerController.getRegister(m.registerName);if(m.registerName==="+")navigator.clipboard.readText().then(k=>{this.continuePaste(u,m,y,k,b)});else{var x=b.toString();this.continuePaste(u,m,y,x,b)}},continuePaste:function(u,m,y,b,x){var k=Ge(u.getCursor());if(b){if(m.matchIndent){var T=u.getOption("tabSize"),O=function(Jt){var Xt=Jt.split(" ").length-1,ln=Jt.split(" ").length-1;return Xt*T+ln*1},M=O(u.getLine(u.getCursor().line).match(/^\s*/)[0]),z=b.replace(/\n$/,""),j=b!==z,se=O(b.match(/^\s*/)[0]),b=z.replace(/^\s*/gm,function(Jt){var Xt=M+(O(Jt)-se);if(Xt<0)return"";if(u.getOption("indentWithTabs")){var ln=Math.floor(Xt/T);return Array(ln+1).join(" ")}else return Array(Xt+1).join(" ")});b+=j?`
47
+ `:""}m.repeat>1&&(b=Array(m.repeat+1).join(b));var oe=x.linewise,Y=x.blockwise,Z=Y?b.split(`
48
+ `):void 0;if(Z){oe&&Z.pop();for(var we=0;we<Z.length;we++)Z[we]=Z[we]==""?" ":Z[we];k.ch+=m.after?1:0,k.ch=Math.min(St(u,k.line),k.ch)}else oe?y.visualMode?b=y.visualLine?b.slice(0,-1):`
49
+ `+b.slice(0,b.length-1)+`
50
+ `:m.after?(b=`
51
+ `+b.slice(0,b.length-1),k.ch=St(u,k.line)):k.ch=0:k.ch+=m.after?1:0;var _e;if(y.visualMode){y.lastPastedText=b;var je,Ee=ui(u),Ie=Ee[0],lt=Ee[1],Xe=u.getSelection(),Ot=u.listSelections(),Pt=Array(Ot.length).join("1").split("1");y.lastSelection&&(je=y.lastSelection.headMark.find()),K.registerController.unnamedRegister.setText(Xe),Y?(u.replaceSelections(Pt),lt=new n(Ie.line+b.length-1,Ie.ch),u.setCursor(Ie),In(u,lt),u.replaceSelections(b),_e=Ie):y.visualBlock?(u.replaceSelections(Pt),u.setCursor(Ie),u.replaceRange(b,Ie,Ie),_e=Ie):(u.replaceRange(b,Ie,lt),_e=u.posFromIndex(u.indexFromPos(Ie)+b.length-1)),je&&(y.lastSelection.headMark=u.setBookmark(je)),oe&&(_e.ch=0)}else if(Y&&Z){u.setCursor(k);for(var we=0;we<Z.length;we++){var ze=k.line+we;ze>u.lastLine()&&u.replaceRange(`
52
+ `,new n(ze,0)),St(u,ze)<k.ch&&ci(u,ze,k.ch)}u.setCursor(k),In(u,new n(k.line+Z.length-1,k.ch)),u.replaceSelections(Z),_e=k}else if(u.replaceRange(b,k),oe){var ze=m.after?k.line+1:k.line;_e=new n(ze,ye(u.getLine(ze)))}else _e=Ge(k),/\n/.test(b)||(_e.ch+=b.length-(m.after?1:0));y.visualMode&&Je(u,!1),u.setCursor(_e)}},undo:function(u,m){u.operation(function(){dr(u,e.commands.undo,m.repeat)(),u.setCursor(yt(u,u.getCursor("start")))})},redo:function(u,m){dr(u,e.commands.redo,m.repeat)()},setRegister:function(u,m,y){y.inputState.registerName=m.selectedCharacter},insertRegister:function(u,m,y){var b=m.selectedCharacter,x=K.registerController.getRegister(b),k=x&&x.toString();k&&u.replaceSelection(k)},oneNormalCommand:function(u,m,y){Lr(u,!0),y.insertModeReturn=!0,e.on(u,"vim-command-done",function b(){y.visualMode||(y.insertModeReturn&&(y.insertModeReturn=!1,y.insertMode||Ht.enterInsertMode(u,{},y)),e.off(u,"vim-command-done",b))})},setMark:function(u,m,y){var b=m.selectedCharacter;b&&fr(u,y,b,u.getCursor())},replace:function(u,m,y){var b=m.selectedCharacter||"",x=u.getCursor(),k,T,O=u.listSelections();if(y.visualMode)x=u.getCursor("start"),T=u.getCursor("end");else{var M=u.getLine(x.line);k=x.ch+m.repeat,k>M.length&&(k=M.length),T=new n(x.line,k)}var z=i(u,x,T);if(x=z.start,T=z.end,b==`
53
+ `)y.visualMode||u.replaceRange("",x,T),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(u);else{var j=u.getRange(x,T);if(j=j.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b),j=j.replace(/[^\n]/g,b),y.visualBlock){var se=Array(u.getOption("tabSize")+1).join(" ");j=u.getSelection(),j=j.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b);var oe=j.replace(/\t/g,se).replace(/[^\n]/g,b).split(`
54
+ `);u.replaceSelections(oe)}else u.replaceRange(j,x,T);y.visualMode?(x=st(O[0].anchor,O[0].head)?O[0].anchor:O[0].head,u.setCursor(x),Je(u,!1)):u.setCursor(Ct(T,0,-1))}},incrementNumberToken:function(u,m){for(var y=u.getCursor(),b=u.getLine(y.line),x=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,k,T,O,M;(k=x.exec(b))!==null&&(T=k.index,O=T+k[0].length,!(y.ch<O)););if(!(!m.backtrack&&O<=y.ch)){if(k){var z=k[2]||k[4],j=k[3]||k[5],se=m.increase?1:-1,oe={"0b":2,0:8,"":10,"0x":16}[z.toLowerCase()];M=(parseInt(k[1]+j,oe)+se*m.repeat).toString(oe);var Y=z?Array(j.length-M.length+1+k[1].length).join("0"):"";M=M.charAt(0)==="-"?"-"+z+Y+M.substr(1):z+Y+M;var Z=new n(y.line,T),we=new n(y.line,O);u.replaceRange(M,Z,we)}else return;u.setCursor(new n(y.line,T+M.length-1))}},repeatLastEdit:function(u,m,y){var b=y.lastEditInputState;if(b){var x=m.repeat;x&&m.repeatIsExplicit?b.repeatOverride=x:x=b.repeatOverride||x,Ls(u,y,x,!1)}},indent:function(u,m){u.indentLine(u.getCursor().line,m.indentRight)},exitInsertMode:function(u,m){Lr(u)}};function Qt(u,m){Ht[u]=m}function yt(u,m,y){var b=u.state.vim,x=b.insertMode||b.visualMode,k=Math.min(Math.max(u.firstLine(),m.line),u.lastLine()),T=u.getLine(k),O=T.length-1+ +!!x,M=Math.min(Math.max(0,m.ch),O),z=T.charCodeAt(M);if(56320<=z&&z<=57343){var j=1;y&&y.line==k&&y.ch>M&&(j=-1),M+=j,M>O&&(M-=2)}return new n(k,M)}function Ft(u){var m={};for(var y in u)Object.prototype.hasOwnProperty.call(u,y)&&(m[y]=u[y]);return m}function Ct(u,m,y){return typeof m=="object"&&(y=m.ch,m=m.line),new n(u.line+m,u.ch+y)}function li(u,m,y,b){b.operator&&(y="operatorPending");for(var x,k=[],T=[],O=Re?m.length-c:0;O<m.length;O++){var M=m[O];y=="insert"&&M.context!="insert"||M.context&&M.context!=y||b.operator&&M.type=="action"||!(x=Bi(u,M.keys))||(x=="partial"&&k.push(M),x=="full"&&T.push(M))}return{partial:k,full:T}}function Bi(u,m){let y=m.slice(-11)=="<character>",b=m.slice(-10)=="<register>";if(y||b){var x=m.length-(y?11:10),k=u.slice(0,x),T=m.slice(0,x);return k==T&&u.length>x?"full":T.indexOf(k)==0?"partial":!1}else return u==m?"full":m.indexOf(u)==0?"partial":!1}function Mr(u){var m=/^.*(<[^>]+>)$/.exec(u),y=m?m[1]:u.slice(-1);if(y.length>1)switch(y){case"<CR>":case"<S-CR>":y=`
55
+ `;break;case"<Space>":case"<S-Space>":y=" ";break;default:y="";break}return y}function dr(u,m,y){return function(){for(var b=0;b<y;b++)m(u)}}function Ge(u){return new n(u.line,u.ch)}function Vt(u,m){return u.ch==m.ch&&u.line==m.line}function st(u,m){return u.line<m.line||u.line==m.line&&u.ch<m.ch}function vt(u,m){return arguments.length>2&&(m=vt.apply(void 0,Array.prototype.slice.call(arguments,1))),st(u,m)?u:m}function On(u,m){return arguments.length>2&&(m=On.apply(void 0,Array.prototype.slice.call(arguments,1))),st(u,m)?m:u}function Wr(u,m,y){var b=st(u,m),x=st(m,y);return b&&x}function St(u,m){return u.getLine(m).length}function Yn(u){return u.trim?u.trim():u.replace(/^\s+|\s+$/g,"")}function Ur(u){return u.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function ci(u,m,y){var b=St(u,m),x=Array(y-b+1).join(" ");u.setCursor(new n(m,b)),u.replaceRange(x,u.getCursor())}function In(u,m){var y=[],b=u.listSelections(),x=Ge(u.clipPos(m)),k=!Vt(m,x),T=Kr(b,u.getCursor("head")),O=Vt(b[T].head,b[T].anchor),M=b.length-1,z=M-T>T?M:0,j=b[z].anchor,se=Math.min(j.line,x.line),oe=Math.max(j.line,x.line),Y=j.ch,Z=x.ch,we=b[z].head.ch-Y,_e=Z-Y;we>0&&_e<=0?(Y++,k||Z--):we<0&&_e>=0?(Y--,O||Z++):we<0&&_e==-1&&(Y--,Z++);for(var je=se;je<=oe;je++){var Ee={anchor:new n(je,Y),head:new n(je,Z)};y.push(Ee)}return u.setSelections(y),m.ch=Z,j.ch=Y,j}function Bn(u,m,y){for(var b=[],x=0;x<y;x++){var k=Ct(m,x,0);b.push({anchor:k,head:k})}u.setSelections(b,0)}function Kr(u,m,y){for(var b=0;b<u.length;b++){var x=Vt(u[b].anchor,m),k=Vt(u[b].head,m);if(x||k)return b}return-1}function ui(u,m){var y=u.listSelections(),b=y[0],x=y[y.length-1];return[st(b.anchor,b.head)?b.anchor:b.head,st(x.anchor,x.head)?x.head:x.anchor]}function Zn(u,m){var y=m.sel.anchor,b=m.sel.head;m.lastPastedText&&(m.lastPastedText=(b=u.posFromIndex(u.indexFromPos(y)+m.lastPastedText.length),void 0)),m.lastSelection={anchorMark:u.setBookmark(y),headMark:u.setBookmark(b),anchor:Ge(y),head:Ge(b),visualMode:m.visualMode,visualLine:m.visualLine,visualBlock:m.visualBlock}}function Pn(u,m,y,b){var x=u.state.vim.sel,k=b?m:x.head,T=b?m:x.anchor,O;return st(y,m)&&(O=y,y=m,m=O),st(k,T)?(k=vt(m,k),T=On(T,y)):(T=vt(m,T),k=On(k,y),k=Ct(k,0,-1),k.ch==-1&&k.line!=u.firstLine()&&(k=new n(k.line-1,St(u,k.line-1)))),[T,k]}function bt(u,m,y){var b=u.state.vim;m||(m=b.sel),y||(y=b.visualLine?"line":b.visualBlock?"block":"char");var x=jt(u,m,y);u.setSelections(x.ranges,x.primary)}function jt(u,m,y,b){var x=Ge(m.head),k=Ge(m.anchor);if(y=="char"){var T=!b&&!st(m.head,m.anchor)?1:0,O=st(m.head,m.anchor)?1:0;return x=Ct(m.head,0,T),k=Ct(m.anchor,0,O),{ranges:[{anchor:k,head:x}],primary:0}}else if(y=="line"){if(st(m.head,m.anchor))x.ch=0,k.ch=St(u,k.line);else{k.ch=0;var M=u.lastLine();x.line>M&&(x.line=M),x.ch=St(u,x.line)}return{ranges:[{anchor:k,head:x}],primary:0}}else if(y=="block"){var z=Math.min(k.line,x.line),j=k.ch,se=Math.max(k.line,x.line),oe=x.ch;j<oe?oe+=1:j+=1;for(var Y=se-z+1,Z=x.line==z?0:Y-1,we=[],_e=0;_e<Y;_e++)we.push({anchor:new n(z+_e,j),head:new n(z+_e,oe)});return{ranges:we,primary:Z}}throw"never happens"}function P(u){var m=u.getCursor("head");return u.getSelection().length==1&&(m=vt(m,u.getCursor("anchor"))),m}function Je(u,m){var y=u.state.vim;m!==!1&&u.setCursor(yt(u,y.sel.head)),Zn(u,y),y.visualMode=!1,y.visualLine=!1,y.visualBlock=!1,y.insertMode||e.signal(u,"vim-mode-change",{mode:"normal"})}function q(u,m,y){var b=u.getRange(m,y);if(/\n\s*$/.test(b)){var x=b.split(`
56
+ `);x.pop();for(var k=x.pop();x.length>0&&k&&I(k);k=x.pop())y.line--,y.ch=0;k?(y.line--,y.ch=St(u,y.line)):y.ch=0}}function ne(u,m,y){m.ch=0,y.ch=0,y.line++}function ye(u){if(!u)return 0;var m=u.search(/\S/);return m==-1?u.length:m}function Ce(u,{inclusive:m,innerWord:y,bigWord:b,noSymbol:x,multiline:k},T){var O=T||P(u),M=u.getLine(O.line),z=M,j=O.line,se=j,oe=O.ch,Y,Z=x?C[0]:E[0];if(y&&/\s/.test(M.charAt(oe)))Z=function(lt){return/\s/.test(lt)};else{for(;!Z(M.charAt(oe));)if(oe++,oe>=M.length){if(!k)return null;oe--,Y=ot(u,O,!0,b,!0);break}b?Z=E[0]:(Z=C[0],Z(M.charAt(oe))||(Z=C[1]))}for(var we=oe,_e=oe;Z(M.charAt(_e))&&_e>=0;)_e--;if(_e++,Y)we=Y.to,se=Y.line,z=u.getLine(se),!z&&we==0&&we++;else for(;Z(M.charAt(we))&&we<M.length;)we++;if(m){var je=we,Ee=O.ch<=_e&&/\s/.test(M.charAt(O.ch));if(!Ee)for(;/\s/.test(z.charAt(we))&&we<z.length;)we++;if(je==we||Ee){for(var Ie=_e;/\s/.test(M.charAt(_e-1))&&_e>0;)_e--;!_e&&!Ee&&(_e=Ie)}}return{start:new n(j,_e),end:new n(se,we)}}function pt(u,m,y){var b=m;if(!e.findMatchingTag||!e.findEnclosingTag)return{start:b,end:b};var x=e.findMatchingTag(u,m)||e.findEnclosingTag(u,m);return!x||!x.open||!x.close?{start:b,end:b}:y?{start:x.open.from,end:x.close.to}:{start:x.open.to,end:x.close.from}}function tt(u,m,y){Vt(m,y)||K.jumpList.add(u,m,y)}function it(u,m){K.lastCharacterSearch.increment=u,K.lastCharacterSearch.forward=m.forward,K.lastCharacterSearch.selectedCharacter=m.selectedCharacter}var wt={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},$e={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 He(u,m,y,b){var x=Ge(u.getCursor()),k=y?1:-1,T=y?u.lineCount():-1,O=x.ch,M=x.line,z=u.getLine(M),j={lineText:z,nextCh:z.charAt(O),lastCh:null,index:O,symb:b,reverseSymb:(y?{")":"(","}":"{"}:{"(":")","{":"}"})[b],forward:y,depth:0,curMoveThrough:!1},se=wt[b];if(!se)return x;var oe=$e[se].init,Y=$e[se].isComplete;for(oe&&oe(j);M!==T&&m;){if(j.index+=k,j.nextCh=j.lineText.charAt(j.index),!j.nextCh){if(M+=k,j.lineText=u.getLine(M)||"",k>0)j.index=0;else{var Z=j.lineText.length;j.index=Z>0?Z-1:0}j.nextCh=j.lineText.charAt(j.index)}Y(j)&&(x.line=M,x.ch=j.index,m--)}return j.nextCh||j.curMoveThrough?new n(M,j.index):x}function ot(u,m,y,b,x){var k=m.line,T=m.ch,O=u.getLine(k),M=y?1:-1,z=b?E:C;if(x&&O==""){if(k+=M,O=u.getLine(k),!U(u,k))return null;T=y?0:O.length}for(;;){if(x&&O=="")return{from:0,to:0,line:k};for(var j=M>0?O.length:-1,se=j,oe=j;T!=j;){for(var Y=!1,Z=0;Z<z.length&&!Y;++Z)if(z[Z](O.charAt(T))){for(se=T;T!=j&&z[Z](O.charAt(T));)T+=M;if(oe=T,Y=se!=oe,se==m.ch&&k==m.line&&oe==se+M)continue;return{from:Math.min(se,oe+1),to:Math.max(se,oe),line:k}}Y||(T+=M)}if(k+=M,!U(u,k))return null;O=u.getLine(k),T=M>0?0:O.length}}function ht(u,m,y,b,x,k){var T=Ge(m),O=[];(b&&!x||!b&&x)&&y++;for(var M=!(b&&x),z=0;z<y;z++){var j=ot(u,m,b,k,M);if(!j){var se=St(u,u.lastLine());O.push(b?{line:u.lastLine(),from:se,to:se}:{line:0,from:0,to:0});break}O.push(j),m=new n(j.line,b?j.to-1:j.from)}var oe=O.length!=y,Y=O[0],Z=O.pop();return b&&!x?(!oe&&(Y.from!=T.ch||Y.line!=T.line)&&(Z=O.pop()),Z&&new n(Z.line,Z.from)):b&&x?Z&&new n(Z.line,Z.to-1):!b&&x?(!oe&&(Y.to!=T.ch||Y.line!=T.line)&&(Z=O.pop()),Z&&new n(Z.line,Z.to)):Z&&new n(Z.line,Z.from)}function $t(u,m,y,b,x){var k=new n(m.line+y.repeat-1,1/0),T=u.clipPos(k);return T.ch--,x||(b.lastHPos=1/0,b.lastHSPos=u.charCoords(T,"div").left),k}function er(u,m,y,b,x){if(b){for(var k=x||u.getCursor(),T=k.ch,O,M=0;M<m;M++){var z=u.getLine(k.line);if(O=Zl(T,z,b,y),O==-1)return;T=O}if(O!=null)return new n(u.getCursor().line,O)}}function ws(u,m){var y=u.getCursor().line;return yt(u,new n(y,m-1))}function fr(u,m,y,b){!de(y,R)&&!H.test(y)||(m.marks[y]&&m.marks[y].clear(),m.marks[y]=u.setBookmark(b))}function Zl(u,m,y,b,x){return b?m.indexOf(y,u+1):m.lastIndexOf(y,u-1)}function ec(u,m,y,b,x){var k=m.line,T=u.firstLine(),O=u.lastLine(),M,z,j=k;function se(_e){return!u.getLine(_e)}function oe(_e,je,Ee){return Ee?se(_e)!=se(_e+je):!se(_e)&&se(_e+je)}if(b){for(;T<=j&&j<=O&&y>0;)oe(j,b)&&y--,j+=b;return{start:new n(j,0),end:m}}var Y=u.state.vim;if(Y.visualLine&&oe(k,1,!0)){var Z=Y.sel.anchor;oe(Z.line,-1,!0)&&(!x||Z.line!=k)&&(k+=1)}var we=se(k);for(j=k;j<=O&&y;j++)oe(j,1,!0)&&(!x||se(j)!=we)&&y--;for(z=new n(j,0),j>O&&!we?we=!0:x=!1,j=k;j>T&&!((!x||se(j)==we||j==k)&&oe(j,-1,!0));j--);return M=new n(j,0),{start:M,end:z}}function So(u,m,y,b,x){function k(z){z.line!==null&&(z.pos+z.dir<0||z.pos+z.dir>=z.line.length?z.line=null:z.pos+=z.dir)}function T(z,j,se,oe){var Y={line:z.getLine(j),ln:j,pos:se,dir:oe};if(Y.line==="")return{ln:Y.ln,pos:Y.pos};var Z=Y.pos;for(k(Y);Y.line!==null;){if(Z=Y.pos,$(Y.line[Y.pos]))if(x){for(k(Y);Y.line!==null&&I(Y.line[Y.pos]);)Z=Y.pos,k(Y);return{ln:Y.ln,pos:Z+1}}else return{ln:Y.ln,pos:Y.pos+1};k(Y)}return{ln:Y.ln,pos:Z+1}}function O(z,j,se,oe){var Y=z.getLine(j),Z={line:Y,ln:j,pos:se,dir:oe};if(Z.line==="")return{ln:Z.ln,pos:Z.pos};var we=Z.pos;for(k(Z);Z.line!==null;){if(!I(Z.line[Z.pos])&&!$(Z.line[Z.pos]))we=Z.pos;else if($(Z.line[Z.pos]))return x&&I(Z.line[Z.pos+1])?{ln:Z.ln,pos:Z.pos+1}:{ln:Z.ln,pos:we};k(Z)}return Z.line=Y,x&&I(Z.line[Z.pos])?{ln:Z.ln,pos:Z.pos}:{ln:Z.ln,pos:we}}for(var M={ln:m.line,pos:m.ch};y>0;)M=b<0?O(u,M.ln,M.pos,b):T(u,M.ln,M.pos,b),y--;return new n(M.ln,M.pos)}function Ea(u,m,y,b){function x(M,z){if(z.line!==null)if(z.pos+z.dir<0||z.pos+z.dir>=z.line.length){if(z.ln+=z.dir,!U(M,z.ln)){z.line=null;return}z.line=M.getLine(z.ln),z.pos=z.dir>0?0:z.line.length-1}else z.pos+=z.dir}function k(M,z,j,se){var _e=M.getLine(z),oe=_e==="",Y={line:_e,ln:z,pos:j,dir:se},Z={ln:Y.ln,pos:Y.pos},we=Y.line==="";for(x(M,Y);Y.line!==null;){if(Z.ln=Y.ln,Z.pos=Y.pos,Y.line===""&&!we||oe&&Y.line!==""&&!I(Y.line[Y.pos]))return{ln:Y.ln,pos:Y.pos};$(Y.line[Y.pos])&&!oe&&(Y.pos===Y.line.length-1||I(Y.line[Y.pos+1]))&&(oe=!0),x(M,Y)}var _e=M.getLine(Z.ln);Z.pos=0;for(var je=_e.length-1;je>=0;--je)if(!I(_e[je])){Z.pos=je;break}return Z}function T(M,z,j,se){var _e=M.getLine(z),oe={line:_e,ln:z,pos:j,dir:se},Y=oe.ln,Z=null,we=oe.line==="";for(x(M,oe);oe.line!==null;){if(oe.line===""&&!we)return Z===null?{ln:oe.ln,pos:oe.pos}:{ln:Y,pos:Z};if($(oe.line[oe.pos])&&Z!==null&&!(oe.ln===Y&&oe.pos+1===Z))return{ln:Y,pos:Z};oe.line!==""&&!I(oe.line[oe.pos])&&(we=!1,Y=oe.ln,Z=oe.pos),x(M,oe)}var _e=M.getLine(Y);Z=0;for(var je=0;je<_e.length;++je)if(!I(_e[je])){Z=je;break}return{ln:Y,pos:Z}}for(var O={ln:m.line,pos:m.ch};y>0;)O=b<0?T(u,O.ln,O.pos,b):k(u,O.ln,O.pos,b),y--;return new n(O.ln,O.pos)}function pr(u,m,y,b){var x=m,k={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[y],T={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[y],O=u.getLine(x.line).charAt(x.ch)===T?1:0,M=u.scanForBracket(new n(x.line,x.ch+O),-1,void 0,{bracketRegex:k}),z=u.scanForBracket(new n(x.line,x.ch+O),1,void 0,{bracketRegex:k});if(!M||!z)return null;var j=M.pos,se=z.pos;if(j.line==se.line&&j.ch>se.ch||j.line>se.line){var oe=j;j=se,se=oe}return b?se.ch+=1:j.ch+=1,{start:j,end:se}}function _s(u,m,y,b){var x=Ge(m),k=u.getLine(x.line).split(""),T,O,M,z,j=k.indexOf(y);if(x.ch<j)x.ch=j;else if(j<x.ch&&k[x.ch]==y){var se=/string/.test(u.getTokenTypeAt(Ct(m,0,1))),oe=/string/.test(u.getTokenTypeAt(m));se&&!oe||(O=x.ch,--x.ch)}if(k[x.ch]==y&&!O)T=x.ch+1;else for(M=x.ch;M>-1&&!T;M--)k[M]==y&&(T=M+1);if(T&&!O)for(M=T,z=k.length;M<z&&!O;M++)k[M]==y&&(O=M);return!T||!O?{start:x,end:x}:(b&&(--T,++O),{start:new n(x.line,T),end:new n(x.line,O)})}xe("pcre",!0,"boolean");class tc{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 bn(u){var m=u.state.vim;return m.searchState_||(m.searchState_=new tc)}function xs(u){return nc(u,"/")}function ks(u){return Cs(u,"/")}function nc(u,m){var y=Cs(u,m)||[];if(!y.length)return[];var b=[];if(y[0]===0){for(var x=0;x<y.length;x++)typeof y[x]=="number"&&b.push(u.substring(y[x]+1,y[x+1]));return b}}function Cs(u,m){m||(m="/");for(var y=!1,b=[],x=0;x<u.length;x++){var k=u.charAt(x);!y&&k==m&&b.push(x),y=!y&&k=="\\"}return b}function Hn(u){var m={V:"|(){+?*.[$^",M:"|(){+?*.[",m:"|(){+?",v:"<>"},y={">":"(?<=[\\w])(?=[^\\w]|$)","<":"(?<=[^\\w]|^)(?=[\\w])"},b=m.m,x=u.replace(/\\.|[\[|(){+*?.$^<>]/g,function(T){if(T[0]==="\\"){var O=T[1];return O==="}"||b.indexOf(O)!=-1?O:O in m?(b=m[O],""):O in y?y[O]:T}else return b.indexOf(T)==-1?T:y[T]||"\\"+T}),k=x.indexOf("\\zs");return k!=-1&&(x="(?<="+x.slice(0,k)+")"+x.slice(k+3)),k=x.indexOf("\\ze"),k!=-1&&(x=x.slice(0,k)+"(?="+x.slice(k+3)+")"),x}var Ss={"\\n":`
57
+ `,"\\r":"\r","\\t":" "};function nf(u){for(var m=!1,y=[],b=-1;b<u.length;b++){var x=u.charAt(b)||"",k=u.charAt(b+1)||"";Ss[x+k]?(y.push(Ss[x+k]),b++):m?(y.push(x),m=!1):x==="\\"?(m=!0,he(k)||k==="$"?y.push("$"):k!=="/"&&k!=="\\"&&y.push("\\")):(x==="$"&&y.push("$"),y.push(x),k==="/"&&y.push("\\"))}return y.join("")}var Eo={"\\/":"/","\\\\":"\\","\\n":`
58
+ `,"\\r":"\r","\\t":" ","\\&":"&"};function rc(u){for(var m=new e.StringStream(u),y=[];!m.eol();){for(;m.peek()&&m.peek()!="\\";)y.push(m.next());var b=!1;for(var x in Eo)if(m.match(x,!0)){b=!0,y.push(Eo[x]);break}b||y.push(m.next())}return y.join("")}function To(u,m,y){K.registerController.getRegister("/").setText(u);var b=ks(u),x,k;return b.length?(x=u.substring(0,b[0]),k=u.substring(b[0]).indexOf("i")!=-1):x=u,x?(be("pcre")||(x=Hn(x)),y&&(m=/^[^A-Z]*$/.test(x)),new RegExp(x,m||k?"im":"m")):null}function tr(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 b in y)Object.prototype.hasOwnProperty.call(y,b)&&(b[0]==="$"?u.style[b.slice(1)]=y[b]:typeof y[b]=="function"?u[b]=y[b]:u.setAttribute(b,y[b]))}return u}function Ve(u,m,y){var b=tr("div",{$color:"red",$whiteSpace:"pre",class:"cm-vim-message"},m);u.openNotification?y?(b=tr("div",{},b,tr("div",{},"Press ENTER or type command to continue")),u.state.closeVimNotification&&u.state.closeVimNotification(),u.state.closeVimNotification=u.openNotification(b,{bottom:!0,duration:0})):u.openNotification(b,{bottom:!0,duration:15e3}):alert(b.innerText)}function Es(u,m){return tr("div",{$display:"flex",$flex:1},tr("span",{$fontFamily:"monospace",$whiteSpace:"pre",$flex:1,$display:"flex"},u,tr("input",{type:"text",autocorrect:"off",autocapitalize:"off",spellcheck:"false",$flex:1})),m&&tr("span",{$color:"#888"},m))}function Ro(u,m){var x;if(We.length){m.value||(m.value=""),Me=m;return}var y=Es(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 b="";typeof m.prefix!="string"&&m.prefix&&(b+=m.prefix.textContent),m.desc&&(b+=" "+m.desc),(x=m.onClose)==null||x.call(m,prompt(b,""))}}function Ts(u,m){return u instanceof RegExp&&m instanceof RegExp?u.flags==m.flags&&u.source==m.source:!1}function mr(u,m,y,b){if(m){var x=bn(u),k=To(m,!!y,!!b);if(k)return Qr(u,k),Ts(k,x.getQuery())||x.setQuery(k),k}}function ic(u){if(u.source.charAt(0)=="^")var m=!0;return{token:function(y){if(m&&!y.sol()){y.skipToEnd();return}var b=y.match(u,!1);if(b)return b[0].length==0?(y.next(),"searching"):!y.sol()&&(y.backUp(1),!u.exec(y.next()+b[0]))?(y.next(),null):(y.match(u),"searching");for(;!y.eol()&&(y.next(),!y.match(u,!1)););},query:u}}var Hi=0;function Qr(u,m){clearTimeout(Hi);var y=bn(u);y.highlightTimeout=Hi,Hi=setTimeout(function(){if(u.state.vim){var b=bn(u);b.highlightTimeout=void 0;var x=b.getOverlay();(!x||m!=x.query)&&(x&&u.removeOverlay(x),x=ic(m),u.addOverlay(x),u.showMatchesOnScrollbar&&(b.getScrollbarAnnotate()&&b.getScrollbarAnnotate().clear(),b.setScrollbarAnnotate(u.showMatchesOnScrollbar(m))),b.setOverlay(x))}},50)}function oc(u,m,y,b){return u.operation(function(){b===void 0&&(b=1);for(var x=u.getCursor(),k=u.getSearchCursor(y,x),T=0;T<b;T++){var O=k.find(m);if(T==0&&O&&Vt(k.from(),x)){var M=m?k.from():k.to();O=k.find(m),O&&!O[0]&&Vt(k.from(),M)&&u.getLine(M.line).length==M.ch&&(O=k.find(m))}if(!O&&(k=u.getSearchCursor(y,m?new n(u.lastLine()):new n(u.firstLine(),0)),!k.find(m)))return}return k.from()})}function ac(u,m,y,b,x){return u.operation(function(){b===void 0&&(b=1);var k=u.getCursor(),T=u.getSearchCursor(y,k),O=T.find(!m);!x.visualMode&&O&&Vt(T.from(),k)&&T.find(!m);for(var M=0;M<b;M++)if(O=T.find(m),!O&&(T=u.getSearchCursor(y,m?new n(u.lastLine()):new n(u.firstLine(),0)),!T.find(m)))return;var z=T.from(),j=T.to();return z&&j&&[z,j]})}function di(u){var m=bn(u);m.highlightTimeout&&(m.highlightTimeout=(clearTimeout(m.highlightTimeout),void 0)),u.removeOverlay(bn(u).getOverlay()),m.setOverlay(null),m.getScrollbarAnnotate()&&(m.getScrollbarAnnotate().clear(),m.setScrollbarAnnotate(null))}function Rs(u,m,y){return typeof u!="number"&&(u=u.line),m instanceof Array?de(u,m):typeof y=="number"?u>=m&&u<=y:u==m}function Ds(u){var m=u.getScrollInfo(),y=6,b=10,x=u.coordsChar({left:0,top:y+m.top},"local"),k=m.clientHeight-b+m.top,T=u.coordsChar({left:0,top:k},"local");return{top:x.line,bottom:T.line}}function Ta(u,m,y){if(y=="'"||y=="`")return K.jumpList.find(u,-1)||new n(0,0);if(y==".")return Do(u);var b=m.marks[y];return b&&b.find()}function Do(u){if(u.getLastEditEnd)return u.getLastEditEnd();for(var m=u.doc.history.done,y=m.length;y--;)if(m[y].changes)return Ge(m[y].changes[0].to)}class Os{constructor(){this.commandMap_,this.buildCommandMap_()}processCommand(m,y,b){var x=this;m.operation(function(){m.curOp&&(m.curOp.isVimOp=!0),x._processCommand(m,y,b)})}_processCommand(m,y,b){var x=m.state.vim,k=K.registerController.getRegister(":"),T=k.toString(),O=new e.StringStream(y);k.setText(y);var M=b||{};M.input=y;try{this.parseInput_(m,O,M)}catch(se){throw Ve(m,se+""),se}x.visualMode&&Je(m);var z,j;if(!M.commandName)M.line!==void 0&&(j="move");else if(z=this.matchCommand_(M.commandName),z){if(j=z.name,z.excludeFromCommandHistory&&k.setText(T),this.parseCommandArgs_(O,M,z),z.type=="exToKey"){It(m,z.toKeys||"",z);return}else if(z.type=="exToEx"){this.processCommand(m,z.toInput||"");return}}if(!j){Ve(m,'Not an editor command ":'+y+'"');return}try{Ra[j](m,M),(!z||!z.possiblyAsync)&&M.callback&&M.callback()}catch(se){throw Ve(m,se+""),se}}parseInput_(m,y,b){var k,T;y.eatWhile(":"),y.eat("%")?(b.line=m.firstLine(),b.lineEnd=m.lastLine()):(b.line=this.parseLineSpec_(m,y),b.line!==void 0&&y.eat(",")&&(b.lineEnd=this.parseLineSpec_(m,y))),b.line==null?m.state.vim.visualMode?(b.selectionLine=(k=Ta(m,m.state.vim,"<"))==null?void 0:k.line,b.selectionLineEnd=(T=Ta(m,m.state.vim,">"))==null?void 0:T.line):b.selectionLine=m.getCursor().line:(b.selectionLine=b.line,b.selectionLineEnd=b.lineEnd);var x=y.match(/^(\w+|!!|@@|[!#&*<=>@~])/);return x?b.commandName=x[1]:b.commandName=(y.match(/.*/)||[""])[0],b}parseLineSpec_(m,y){var b=y.match(/^(\d+)/);if(b)return parseInt(b[1],10)-1;switch(y.next()){case".":return this.parseLineSpecOffset_(y,m.getCursor().line);case"$":return this.parseLineSpecOffset_(y,m.lastLine());case"'":var x=y.next()||"",k=Ta(m,m.state.vim,x);if(!k)throw Error("Mark not set");return this.parseLineSpecOffset_(y,k.line);case"-":case"+":return y.backUp(1),this.parseLineSpecOffset_(y,m.getCursor().line);default:y.backUp(1);return}}parseLineSpecOffset_(m,y){var b=m.match(/^([+-])?(\d+)/);if(b){var x=parseInt(b[2],10);b[1]=="-"?y-=x:y+=x}return y}parseCommandArgs_(m,y,b){var T;if(!m.eol()){y.argString=(T=m.match(/.*/))==null?void 0:T[0];var x=b.argDelimiter||/\s+/,k=Yn(y.argString||"").split(x);k.length&&k[0]&&(y.args=k)}}matchCommand_(m){for(var y=m.length;y>0;y--){var b=m.substring(0,y);if(this.commandMap_[b]){var x=this.commandMap_[b];if(x.name.indexOf(m)===0)return x}}}buildCommandMap_(){this.commandMap_={};for(var m=0;m<d.length;m++){var y=d[m],b=y.shortName||y.name;this.commandMap_[b]=y}}map(m,y,b,x){if(m!=":"&&m.charAt(0)==":"){if(b)throw Error("Mode not supported for ex mappings");var k=m.substring(1);y!=":"&&y.charAt(0)==":"?this.commandMap_[k]={name:k,type:"exToEx",toInput:y.substring(1),user:!0}:this.commandMap_[k]={name:k,type:"exToKey",toKeys:y,user:!0}}else{var T={keys:m,type:"keyToKey",toKeys:y,noremap:!!x};b&&(T.context=b),Oo(T)}}unmap(m,y){if(m!=":"&&m.charAt(0)==":"){if(y)throw Error("Mode not supported for ex mappings");var b=m.substring(1);if(this.commandMap_[b]&&this.commandMap_[b].user)return delete this.commandMap_[b],!0}else for(var x=m,k=0;k<a.length;k++)if(x==a[k].keys&&a[k].context===y)return a.splice(k,1),Po(x),!0}}var Ra={colorscheme:function(u,m){if(!m.args||m.args.length<1){Ve(u,u.getOption("theme"));return}u.setOption("theme",m.args[0])},map:function(u,m,y,b){var x=m.args;if(!x||x.length<2){u&&Ve(u,"Invalid mapping: "+m.input);return}Gt.map(x[0],x[1],y,b)},imap:function(u,m){this.map(u,m,"insert")},nmap:function(u,m){this.map(u,m,"normal")},vmap:function(u,m){this.map(u,m,"visual")},omap:function(u,m){this.map(u,m,"operatorPending")},noremap:function(u,m){this.map(u,m,void 0,!0)},inoremap:function(u,m){this.map(u,m,"insert",!0)},nnoremap:function(u,m){this.map(u,m,"normal",!0)},vnoremap:function(u,m){this.map(u,m,"visual",!0)},onoremap:function(u,m){this.map(u,m,"operatorPending",!0)},unmap:function(u,m,y){var b=m.args;(!b||b.length<1||!Gt.unmap(b[0],y))&&u&&Ve(u,"No such mapping: "+m.input)},mapclear:function(u,m){Be.mapclear()},imapclear:function(u,m){Be.mapclear("insert")},nmapclear:function(u,m){Be.mapclear("normal")},vmapclear:function(u,m){Be.mapclear("visual")},omapclear:function(u,m){Be.mapclear("operatorPending")},move:function(u,m){An.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,b=m.setCfg||{};if(!y||y.length<1){u&&Ve(u,"Invalid mapping: "+m.input);return}var x=y[0].split("="),k=x.shift()||"",T=x.length>0?x.join("="):void 0,O=!1,M=!1;if(k.charAt(k.length-1)=="?"){if(T)throw Error("Trailing characters: "+m.argString);k=k.substring(0,k.length-1),O=!0}else k.charAt(k.length-1)=="!"&&(k=k.substring(0,k.length-1),M=!0);T===void 0&&k.substring(0,2)=="no"&&(k=k.substring(2),T=!1);var z=fe[k]&&fe[k].type=="boolean";if(z&&(M?T=!be(k,u,b):T??(T=!0)),!z&&T===void 0||O){var j=be(k,u,b);j instanceof Error?Ve(u,j.message):j===!0||j===!1?Ve(u," "+(j?"":"no")+k):Ve(u," "+k+"="+j)}else{var se=te(k,T,u,b);se instanceof Error&&Ve(u,se.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,b=K.registerController.registers,x=`----------Registers----------
59
+
60
+ `;if(y)for(var k=y.join(""),T=0;T<k.length;T++){var O=k.charAt(T);if(K.registerController.isValidRegister(O)){var M=b[O]||new yn;x+='"'+O+" "+M.toString()+`
61
+ `}}else for(var O in b){var z=b[O].toString();z.length&&(x+='"'+O+" "+z+`
62
+ `)}Ve(u,x,!0)},marks:function(u,m){var y=m.args,b=u.state.vim.marks,x=`-----------Marks-----------
63
+ mark line col
64
+
65
+ `;if(y)for(var k=y.join(""),T=0;T<k.length;T++){var O=k.charAt(T),M=b[O]&&b[O].find();M&&(x+=O+" "+M.line+" "+M.ch+`
66
+ `)}else for(var O in b){var M=b[O]&&b[O].find();M&&(x+=O+" "+M.line+" "+M.ch+`
67
+ `)}Ve(u,x,!0)},sort:function(u,m){var y,b,x,k,T;function O(){if(m.argString){var ze=new e.StringStream(m.argString);if(ze.eat("!")&&(y=!0),ze.eol())return;if(!ze.eatSpace())return"Invalid arguments";var Ke=ze.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!Ke||!ze.eol())return"Invalid arguments";if(Ke[1]){b=Ke[1].indexOf("i")!=-1,x=Ke[1].indexOf("u")!=-1;var Jt=Ke[1].indexOf("d")!=-1||Ke[1].indexOf("n")!=-1,Xt=Ke[1].indexOf("x")!=-1,ln=Ke[1].indexOf("o")!=-1;if(Number(Jt)+Number(Xt)+Number(ln)>1)return"Invalid arguments";k=Jt&&"decimal"||Xt&&"hex"||ln&&"octal"}Ke[2]&&(T=new RegExp(Ke[2].substr(1,Ke[2].length-2),b?"i":""))}}var M=O();if(M){Ve(u,M+": "+m.argString);return}var z=m.line||u.firstLine(),j=m.lineEnd||m.line||u.lastLine();if(z==j)return;var se=new n(z,0),oe=new n(j,St(u,j)),Y=u.getRange(se,oe).split(`
68
+ `),Z=k=="decimal"?/(-?)([\d]+)/:k=="hex"?/(-?)(?:0x)?([0-9a-f]+)/i:k=="octal"?/([0-7]+)/:null,we=k=="decimal"?10:k=="hex"?16:k=="octal"?8:void 0,_e=[],je=[];if(k||T)for(var Ee=0;Ee<Y.length;Ee++){var Ie=T?Y[Ee].match(T):null;Ie&&Ie[0]!=""?_e.push(Ie):Z&&Z.exec(Y[Ee])?_e.push(Y[Ee]):je.push(Y[Ee])}else je=Y;function lt(ze,Ke){if(y){var Jt=ze;ze=Ke,Ke=Jt}b&&(ze=ze.toLowerCase(),Ke=Ke.toLowerCase());var Xt=Z&&Z.exec(ze),ln=Z&&Z.exec(Ke);return!Xt||!ln?ze<Ke?-1:1:parseInt((Xt[1]+Xt[2]).toLowerCase(),we)-parseInt((ln[1]+ln[2]).toLowerCase(),we)}function Xe(ze,Ke){if(y){var Jt=ze;ze=Ke,Ke=Jt}return b&&(ze[0]=ze[0].toLowerCase(),Ke[0]=Ke[0].toLowerCase()),ze[0]<Ke[0]?-1:1}if(_e.sort(T?Xe:lt),T)for(var Ee=0;Ee<_e.length;Ee++)_e[Ee]=_e[Ee].input;else k||je.sort(lt);if(Y=y?_e.concat(je):je.concat(_e),x){var Ot=Y,Pt;Y=[];for(var Ee=0;Ee<Ot.length;Ee++)Ot[Ee]!=Pt&&Y.push(Ot[Ee]),Pt=Ot[Ee]}u.replaceRange(Y.join(`
69
+ `),se,oe)},vglobal:function(u,m){this.global(u,m)},normal:function(u,m){var y=!1,b=m.argString;if(b&&b[0]=="!"&&(b=b.slice(1),y=!0),b=b.trimStart(),!b){Ve(u,"Argument is required.");return}var x=m.line;if(typeof x=="number")for(var k=isNaN(m.lineEnd)?x:m.lineEnd,T=x;T<=k;T++)u.setCursor(T,0),It(u,m.argString.trimStart(),{noremap:y}),u.state.vim.insertMode&&Lr(u,!0);else It(u,m.argString.trimStart(),{noremap:y}),u.state.vim.insertMode&&Lr(u,!0)},global:function(u,m){var y=m.argString;if(!y){Ve(u,"Regular Expression missing from global");return}var b=m.commandName[0]==="v";y[0]==="!"&&m.commandName[0]==="g"&&(b=!0,y=y.slice(1));var x=m.line===void 0?u.firstLine():m.line,k=m.lineEnd||m.line||u.lastLine(),T=xs(y),O=y,M="";if(T&&T.length&&(O=T[0],M=T.slice(1,T.length).join("/")),O)try{mr(u,O,!0,!0)}catch{Ve(u,"Invalid regex: "+O);return}for(var z=bn(u).getQuery(),j=[],se=x;se<=k;se++){var oe=u.getLine(se);z.test(oe)!==b&&j.push(M?u.getLineHandle(se):oe)}if(!M){Ve(u,j.join(`
70
+ `));return}var Y=0,Z=function(){if(Y<j.length){var we=j[Y++],_e=u.getLineNumber(we);if(_e==null){Z();return}var je=_e+1+M;Gt.processCommand(u,je,{callback:Z})}else u.releaseLineHandles&&u.releaseLineHandles()};Z()},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,b=y?nc(y,y[0]):[],x="",k="",T,O,M,z=!1,j=!1;if(b&&b.length)x=b[0],be("pcre")&&x!==""&&(x=new RegExp(x).source),k=b[1],k!==void 0&&(k=be("pcre")?rc(k.replace(/([^\\])&/g,"$1$$&")):nf(k),K.lastSubstituteReplacePart=k),T=b[2]?b[2].split(" "):[];else if(y&&y.length){Ve(u,"Substitutions should be of the form :s/pattern/replace/");return}if(T&&(O=T[0],M=parseInt(T[1]),O&&(O.indexOf("c")!=-1&&(z=!0),O.indexOf("g")!=-1&&(j=!0),x=be("pcre")?x+"/"+O:x.replace(/\//g,"\\/")+"/"+O)),x)try{mr(u,x,!0,!0)}catch{Ve(u,"Invalid regex: "+x);return}if(k||(k=K.lastSubstituteReplacePart),k===void 0){Ve(u,"No previous substitute regular expression");return}var se=bn(u).getQuery(),oe=m.line===void 0?u.getCursor().line:m.line,Y=m.lineEnd||oe;oe==u.firstLine()&&Y==u.lastLine()&&(Y=1/0),M&&(oe=Y,Y=oe+M-1);var Z=yt(u,new n(oe,0)),we=u.getSearchCursor(se,Z);Vi(u,z,j,oe,Y,we,se,k,m.callback)},startinsert:function(u,m){It(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){di(u)},yank:function(u){var m=Ge(u.getCursor()).line,y=u.getLine(m);K.registerController.pushText("0","yank",y,!0,!0)},delete:function(u,m){var y=m.selectionLine,b=isNaN(m.selectionLineEnd)?y:m.selectionLineEnd;Nr.delete(u,{linewise:!0},[{anchor:new n(y,0),head:new n(b+1,0)}])},join:function(u,m){var y=m.selectionLine,b=isNaN(m.selectionLineEnd)?y:m.selectionLineEnd;u.setCursor(new n(y,0)),Ht.joinLines(u,{repeat:b-y},u.state.vim)},delmarks:function(u,m){if(!m.argString||!Yn(m.argString)){Ve(u,"Argument required");return}for(var y=u.state.vim,b=new e.StringStream(Yn(m.argString));!b.eol();){b.eatSpace();var x=b.pos;if(!b.match(/[a-zA-Z]/,!1)){Ve(u,"Invalid argument: "+m.argString.substring(x));return}var k=b.next();if(b.match("-",!0)){if(!b.match(/[a-zA-Z]/,!1)){Ve(u,"Invalid argument: "+m.argString.substring(x));return}var T=k,O=b.next();if(T&&O&&L(T)==L(O)){var M=T.charCodeAt(0),z=O.charCodeAt(0);if(M>=z){Ve(u,"Invalid argument: "+m.argString.substring(x));return}for(var j=0;j<=z-M;j++){var se=String.fromCharCode(M+j);delete y.marks[se]}}else{Ve(u,"Invalid argument: "+T+"-");return}}else k&&delete y.marks[k]}}},Gt=new Os;Be.defineEx("version","ve",u=>{Ve(u,"Codemirror-vim version: 6.3.0")});function Vi(u,m,y,b,x,k,T,O,M){u.state.vim.exMode=!0;var z=!1,j=0,se,oe,Y;function Z(){u.operation(function(){for(;!z;)we(),je();Ee()})}function we(){var lt="",Xe=k.match||k.pos&&k.pos.match;lt=Xe?O.replace(/\$(\d{1,3}|[$&])/g,function(Pt,ze){if(ze=="$")return"$";if(ze=="&")return Xe[0];for(var Ke=ze;parseInt(Ke)>=Xe.length&&Ke.length>0;)Ke=Ke.slice(0,Ke.length-1);return Ke?Xe[Ke]+ze.slice(Ke.length,ze.length):Pt}):u.getRange(k.from(),k.to()).replace(T,O);var Ot=k.to().line;k.replace(lt),oe=k.to().line,x+=oe-Ot,Y=oe<Ot}function _e(){var lt=se&&Ge(k.to()),Xe=k.findNext();return Xe&&!Xe[0]&&lt&&Vt(k.from(),lt)&&(Xe=k.findNext()),Xe&&j++,Xe}function je(){for(;_e()&&Rs(k.from(),b,x);)if(!(!y&&k.from().line==oe&&!Y)){u.scrollIntoView(k.from(),30),u.setSelection(k.from(),k.to()),se=k.from(),z=!1;return}z=!0}function Ee(lt){if(lt&&lt(),u.focus(),se){u.setCursor(se);var Xe=u.state.vim;Xe.exMode=!1,Xe.lastHPos=Xe.lastHSPos=se.ch}M?M():z&&Ve(u,(j?"Found "+j+" matches":"No matches found")+" for pattern: "+T+(be("pcre")?" (set nopcre to use Vim regexps)":""))}function Ie(lt,Xe,Ot){switch(e.e_stop(lt),tn(lt)){case"y":we(),je();break;case"n":je();break;case"a":var Pt=M;M=void 0,u.operation(Z),M=Pt;break;case"l":we();case"q":case"<Esc>":case"<C-c>":case"<C-[>":Ee(Ot);break}return z&&Ee(Ot),!0}if(je(),z){Ve(u,"No matches for "+T+(be("pcre")?" (set nopcre to use vim regexps)":""));return}if(!m){Z(),M&&M();return}Ro(u,{prefix:tr("span","replace with ",tr("strong",O)," (y/n/a/q/l)"),onKeyDown:Ie})}function Lr(u,m){var y=u.state.vim,b=K.macroModeState,x=K.registerController.getRegister("."),k=b.isPlaying,T=b.lastInsertModeChanges;k||(u.off("change",Mo),y.insertEnd&&y.insertEnd.clear(),y.insertEnd=void 0,e.off(u.getInputField(),"keydown",Ao)),!k&&y.insertModeRepeat&&y.insertModeRepeat>1&&(Ls(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),x.setText(T.changes.join("")),e.signal(u,"vim-mode-change",{mode:"normal"}),b.isRecording&&Gr(b)}function Oo(u){a.unshift(u),u.keys&&sc(u.keys)}function sc(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(m){m&&(s[m]||(s[m]=0),s[m]++)})}function Po(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(m){s[m]&&s[m]--})}function Ar(u,m,y,b,x){var k={keys:u,type:m};for(var T in k[m]=y,k[m+"Args"]=b,x)k[T]=x[T];Oo(k)}xe("insertModeEscKeysTimeout",200,"number");function Ps(u,m,y,b){var x=K.registerController.getRegister(b);if(b==":"){x.keyBuffer[0]&&Gt.processCommand(u,x.keyBuffer[0]),y.isPlaying=!1;return}var k=x.keyBuffer,T=0;y.isPlaying=!0,y.replaySearchQueries=x.searchQueries.slice(0);for(var O=0;O<k.length;O++)for(var M=k[O],z,j,se=/<(?:[CSMA]-)*\w+>|./gi;z=se.exec(M);)if(j=z[0],Be.handleKey(u,j,"macro"),m.insertMode){var oe=x.insertModeChanges[T++].changes;K.macroModeState.lastInsertModeChanges.changes=oe,Jr(u,oe,1),Lr(u)}y.isPlaying=!1}function No(u,m){if(!u.isPlaying){var y=u.latestRegister,b=K.registerController.getRegister(y);b&&b.pushText(m)}}function Gr(u){if(!u.isPlaying){var m=u.latestRegister,y=K.registerController.getRegister(m);y&&y.pushInsertModeChanges&&y.pushInsertModeChanges(u.lastInsertModeChanges)}}function Ns(u,m){if(!u.isPlaying){var y=u.latestRegister,b=K.registerController.getRegister(y);b&&b.pushSearchQuery&&b.pushSearchQuery(m)}}function Mo(u,m){var y=K.macroModeState,b=y.lastInsertModeChanges;if(!y.isPlaying)for(var x=u.state.vim;m;){if(b.expectCursorActivityForChange=!0,b.ignoreCount>1)b.ignoreCount--;else if(m.origin=="+input"||m.origin=="paste"||m.origin===void 0){var k=u.listSelections().length;k>1&&(b.ignoreCount=k);var T=m.text.join(`
71
+ `);if(b.maybeReset&&(b.maybeReset=(b.changes=[],!1)),T)if(u.state.overwrite&&!/\n/.test(T))b.changes.push([T]);else{if(T.length>1){var O=x&&x.insertEnd&&x.insertEnd.find(),M=u.getCursor();if(O&&O.line==M.line){var z=O.ch-M.ch;z>0&&z<T.length&&(b.changes.push([T,z]),T="")}}T&&b.changes.push(T)}}m=m.next}}function Ms(u){var x;var m=u.state.vim;if(m.insertMode){var y=K.macroModeState;if(y.isPlaying)return;var b=y.lastInsertModeChanges;b.expectCursorActivityForChange?b.expectCursorActivityForChange=!1:(b.maybeReset=!0,m.insertEnd&&m.insertEnd.clear(),m.insertEnd=u.setBookmark(u.getCursor(),{insertLeft:!0}))}else(x=u.curOp)!=null&&x.isVimOp||Lo(u,m)}function Lo(u,m){var y=u.getCursor("anchor"),b=u.getCursor("head");if(m.visualMode&&!u.somethingSelected()?Je(u,!1):!m.visualMode&&!m.insertMode&&u.somethingSelected()&&(m.visualMode=!0,m.visualLine=!1,e.signal(u,"vim-mode-change",{mode:"visual"})),m.visualMode){var x=st(b,y)?0:-1,k=st(b,y)?-1:0;b=Ct(b,0,x),y=Ct(y,0,k),m.sel={anchor:y,head:b},fr(u,m,"<",vt(b,y)),fr(u,m,">",On(b,y))}else m.insertMode||(m.lastHPos=u.getCursor().ch)}function Ao(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 Qe(y,u)))}function Ls(u,m,y,b){var x=K.macroModeState;x.isPlaying=!0;var k=m.lastEditActionCommand,T=m.inputState;function O(){k?An.processAction(u,m,k):An.evalInput(u,m)}function M(j){if(x.lastInsertModeChanges.changes.length>0){j=m.lastEditActionCommand?j:1;var se=x.lastInsertModeChanges;Jr(u,se.changes,j)}}if(m.inputState=m.lastEditInputState,k&&k.interlaceInsertRepeat)for(var z=0;z<y;z++)O(),M(1);else b||O(),M(y);m.inputState=T,m.insertMode&&!b&&Lr(u),x.isPlaying=!1}function kn(u,m){e.lookupKey(m,"vim-insert",function(y){return typeof y=="string"?e.commands[y](u):y(u),!0})}function Jr(u,m,y){var b=u.getCursor("head"),x=K.macroModeState.lastInsertModeChanges.visualBlock;x&&(Bn(u,b,x+1),y=u.listSelections().length,u.setCursor(b));for(var k=0;k<y;k++){x&&u.setCursor(Ct(b,k,0));for(var T=0;T<m.length;T++){var O=m[T];if(O instanceof Qe)kn(u,O.keyName);else if(typeof O=="string")u.replaceSelection(O);else{var M=u.getCursor(),z=Ct(M,0,O[0].length-(O[1]||0));u.replaceRange(O[0],M,O[1]?M:z),u.setCursor(z)}}}x&&u.setCursor(Ct(b,0,1))}function $i(u){var m=new u.constructor;return Object.keys(u).forEach(function(y){if(y!="insertEnd"){var b=u[y];Array.isArray(b)?b=b.slice():b&&typeof b=="object"&&b.constructor!=Object&&(b=$i(b)),m[y]=b}}),u.sel&&(m.sel={head:u.sel.head&&Ge(u.sel.head),anchor:u.sel.anchor&&Ge(u.sel.anchor)}),m}function Io(u,m,y){var k=Q(u),b=u,x=!1,k=Be.maybeInitVimState_(b),T=k.visualBlock||k.wasInVisualBlock;if(b.state.closeVimNotification){var O=b.state.closeVimNotification;if(b.state.closeVimNotification=null,O(),m=="<CR>")return kt(b),!0}var M=b.isInMultiSelectMode();if(k.wasInVisualBlock&&!M?k.wasInVisualBlock=!1:M&&k.visualBlock&&(k.wasInVisualBlock=!0),m=="<Esc>"&&!k.insertMode&&!k.visualMode&&M&&k.status=="<Esc>")kt(b);else if(T||!M||b.inVirtualSelectionMode)x=Be.handleKey(b,m,y);else{var z=$i(k),j=k.inputState.changeQueueList||[];b.operation(function(){var oe;b.curOp&&(b.curOp.isVimOp=!0);var se=0;b.forEachSelection(function(){b.state.vim.inputState.changeQueue=j[se];var Y=b.getCursor("head"),Z=b.getCursor("anchor"),we=st(Y,Z)?0:-1,_e=st(Y,Z)?-1:0;Y=Ct(Y,0,we),Z=Ct(Z,0,_e),b.state.vim.sel.head=Y,b.state.vim.sel.anchor=Z,x=Be.handleKey(b,m,y),b.virtualSelection&&(j[se]=b.state.vim.inputState.changeQueue,b.state.vim=$i(z)),se++}),(oe=b.curOp)!=null&&oe.cursorActivity&&!x&&(b.curOp.cursorActivity=!1),b.state.vim=k,k.inputState.changeQueueList=j,k.inputState.changeQueue=null},!0)}return x&&!k.visualMode&&!k.insertMode&&k.visualMode!=b.somethingSelected()&&Lo(b,k),x}return Ne(),Be}function Qn(e,n){var i=n.ch,a=n.line+1;a<1&&(a=1,i=0),a>e.lines&&(a=e.lines,i=Number.MAX_VALUE);var s=e.line(a);return Math.min(s.from+Math.max(0,i),s.to)}function Rr(e,n){let i=e.lineAt(n);return{line:i.number-1,ch:n-i.from}}var Br=class{constructor(e,n){this.line=e,this.ch=n}};function o0(e,n,i){if(e.addEventListener)e.addEventListener(n,i,!1);else{var a=e._handlers||(e._handlers={});a[n]=(a[n]||[]).concat(i)}}function a0(e,n,i){if(e.removeEventListener)e.removeEventListener(n,i,!1);else{var a=e._handlers,s=a&&a[n];if(s){var c=s.indexOf(i);c>-1&&(a[n]=s.slice(0,c).concat(s.slice(c+1)))}}}function s0(e,n,...i){var c;var a=(c=e._handlers)==null?void 0:c[n];if(a)for(var s=0;s<a.length;++s)a[s](...i)}function l0(e,...n){if(e)for(var i=0;i<e.length;++i)e[i](...n)}var wd;try{wd=RegExp("[\\w\\p{Alphabetic}\\p{Number}_]","u")}catch{wd=/[\w]/}function ds(e,n){var i=e.cm6;if(!i.state.readOnly){var a="input.type.compose";if(e.curOp&&(e.curOp.lastChange||(a="input.type.compose.start")),n.annotations)try{n.annotations.some(function(s){s.value=="input"&&(s.value=a)})}catch(s){console.error(s)}else n.userEvent=a;return i.dispatch(n)}}function c0(e,n){var a;e.curOp&&(e.curOp.$changeStart=void 0),(n?I3:j3)(e.cm6);let i=(a=e.curOp)==null?void 0:a.$changeStart;i!=null&&e.cm6.dispatch({selection:{anchor:i}})}var zx={Left:e=>rs(e.cm6,{key:"Left"},"editor"),Right:e=>rs(e.cm6,{key:"Right"},"editor"),Up:e=>rs(e.cm6,{key:"Up"},"editor"),Down:e=>rs(e.cm6,{key:"Down"},"editor"),Backspace:e=>rs(e.cm6,{key:"Backspace"},"editor"),Delete:e=>rs(e.cm6,{key:"Delete"},"editor")},Ze=class n_{openDialog(n,i,a){return Bx(this,n,i,a)}openNotification(n,i){return Fx(this,n,i)}constructor(n){this.state={},this.marks=Object.create(null),this.$mid=0,this.options={},this._handlers={},this.$lastChangeEndOffset=0,this.virtualSelection=null,this.cm6=n,this.onChange=this.onChange.bind(this),this.onSelectionChange=this.onSelectionChange.bind(this)}on(n,i){o0(this,n,i)}off(n,i){a0(this,n,i)}signal(n,i,a){s0(this,n,i,a)}indexFromPos(n){return Qn(this.cm6.state.doc,n)}posFromIndex(n){return Rr(this.cm6.state.doc,n)}foldCode(n){let i=this.cm6,a=i.state.selection.ranges,s=this.cm6.state.doc,c=Qn(s,n),d=fn.create([fn.range(c,c)],0).ranges;i.state.selection.ranges=d,E3(i),i.state.selection.ranges=a}firstLine(){return 0}lastLine(){return this.cm6.state.doc.lines-1}lineCount(){return this.cm6.state.doc.lines}setCursor(n,i){typeof n=="object"&&(i=n.ch,n=n.line);var a=Qn(this.cm6.state.doc,{line:n,ch:i||0});this.cm6.dispatch({selection:{anchor:a}},{scrollIntoView:!this.curOp}),this.curOp&&!this.curOp.isVimOp&&this.onBeforeEndOperation()}getCursor(n){var i=this.cm6.state.selection.main,a=n=="head"||!n?i.head:n=="anchor"?i.anchor:n=="start"?i.from:n=="end"?i.to:null;if(a==null)throw Error("Invalid cursor type");return this.posFromIndex(a)}listSelections(){var n=this.cm6.state.doc;return this.cm6.state.selection.ranges.map(i=>({anchor:Rr(n,i.anchor),head:Rr(n,i.head)}))}setSelections(n,i){var a=this.cm6.state.doc,s=n.map(c=>{var d=Qn(a,c.head),p=Qn(a,c.anchor);return d==p?fn.cursor(d,1):fn.range(p,d)});this.cm6.dispatch({selection:fn.create(s,i)})}setSelection(n,i,a){this.setSelections([{anchor:n,head:i}],0),a&&a.origin=="*mouse"&&this.onBeforeEndOperation()}getLine(n){var i=this.cm6.state.doc;return n<0||n>=i.lines?"":this.cm6.state.doc.line(n+1).text}getLineHandle(n){return this.$lineHandleChanges||(this.$lineHandleChanges=[]),{row:n,index:this.indexFromPos(new Br(n,0))}}getLineNumber(n){var i=this.$lineHandleChanges;if(!i)return null;for(var a=n.index,s=0;s<i.length;s++)if(a=i[s].changes.mapPos(a,1,Gb.TrackAfter),a==null)return null;var c=this.posFromIndex(a);return c.ch==0?c.line:null}releaseLineHandles(){this.$lineHandleChanges=void 0}getRange(n,i){var a=this.cm6.state.doc;return this.cm6.state.sliceDoc(Qn(a,n),Qn(a,i))}replaceRange(n,i,a,s){a||(a=i);var c=this.cm6.state.doc,d=Qn(c,i),p=Qn(c,a);ds(this,{changes:{from:d,to:p,insert:n}})}replaceSelection(n){ds(this,this.cm6.state.replaceSelection(n))}replaceSelections(n){var i=this.cm6.state.selection.ranges.map((a,s)=>({from:a.from,to:a.to,insert:n[s]||""}));ds(this,{changes:i})}getSelection(){return this.getSelections().join(`
72
+ `)}getSelections(){var n=this.cm6;return n.state.selection.ranges.map(i=>n.state.sliceDoc(i.from,i.to))}somethingSelected(){return this.cm6.state.selection.ranges.some(n=>!n.empty)}getInputField(){return this.cm6.contentDOM}clipPos(n){var i=this.cm6.state.doc,a=n.ch,s=n.line+1;s<1&&(s=1,a=0),s>i.lines&&(s=i.lines,a=Number.MAX_VALUE);var c=i.line(s);return a=Math.min(Math.max(0,a),c.to-c.from),new Br(s-1,a)}getValue(){return this.cm6.state.doc.toString()}setValue(n){var i=this.cm6;return i.dispatch({changes:{from:0,to:i.state.doc.length,insert:n},selection:fn.range(0,0)})}focus(){return this.cm6.focus()}blur(){return this.cm6.contentDOM.blur()}defaultTextHeight(){return this.cm6.defaultLineHeight}findMatchingBracket(n,i){var a=this.cm6.state,s=Qn(a.doc,n),c=Xb(a,s+1,-1);return c&&c.end||(c=Xb(a,s,1),c&&c.end)?{to:Rr(a.doc,c.end.from)}:{to:void 0}}scanForBracket(n,i,a,s){return $x(this,n,i,a,s)}indentLine(n,i){i?this.indentMore():this.indentLess()}indentMore(){F3(this.cm6)}indentLess(){J3(this.cm6)}execCommand(n){if(n=="indentAuto")n_.commands.indentAuto(this);else if(n=="goLineLeft")U3(this.cm6);else if(n=="goLineRight"){$3(this.cm6);let i=this.cm6.state,a=i.selection.main.head;a<i.doc.length&&i.sliceDoc(a,a+1)!==`
73
+ `&&B3(this.cm6)}else console.log(n+" is not implemented")}setBookmark(n,i){var a=i!=null&&i.insertLeft?1:-1,s=this.indexFromPos(n);return new Kx(this,s,a)}addOverlay({query:n}){let i=new W3({regexp:!0,search:n.source,caseSensitive:!/i/.test(n.flags)});if(i.valid){i.forVim=!0,this.cm6Query=i;let a=Jp.of(i);return this.cm6.dispatch({effects:a}),i}}removeOverlay(n){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let i=Jp.of(this.cm6Query);this.cm6.dispatch({effects:i})}getSearchCursor(n,i){var a=this,s=null,c=null,d=!1;i.ch??(i.ch=Number.MAX_VALUE);var p=Qn(a.cm6.state.doc,i),h=n.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(E,R){return R||"\\"+E});function v(E,R=0,A=E.length){return new z3(E,h,{ignoreCase:n.ignoreCase},R,A)}function w(E){var R=a.cm6.state.doc;if(E>R.length)return null;let A=v(R,E).next();return A.done?null:A.value}var _=1e4;function C(E,R){var A=a.cm6.state.doc;for(let H=1;;H++){let V=Math.max(E,R-H*_),U=v(A,V,R),L=null;for(;!U.next().done;)L=U.value;if(L&&(V==E||L.from>V+10))return L;if(V==E)return null}}return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(E){var R=a.cm6.state.doc;return s=E?C(0,s?d?s.to-1:s.from:p):w(s?d?s.to+1:s.to:p),c=s&&{from:Rr(R,s.from),to:Rr(R,s.to),match:s.match},d=s?s.from==s.to:!1,s&&s.match},from:function(){return c==null?void 0:c.from},to:function(){return c==null?void 0:c.to},replace:function(E){s&&(ds(a,{changes:{from:s.from,to:s.to,insert:E}}),s.to=s.from+E.length,c&&(c.to=Rr(a.cm6.state.doc,s.to)))},get match(){return c&&c.match}}}findPosV(n,i,a,s){let{cm6:c}=this,d=c.state.doc,p=a=="page"?c.dom.clientHeight:0,h=Qn(d,n),v=fn.cursor(h,1,void 0,s),w=Math.round(Math.abs(i));for(let C=0;C<w;C++)a=="page"?v=c.moveVertically(v,i>0,p):a=="line"&&(v=c.moveVertically(v,i>0));let _=Rr(d,v.head);return(i<0&&v.head==0&&s!=0&&n.line==0&&n.ch!=0||i>0&&v.head==d.length&&_.ch!=s&&n.line==_.line)&&(_.hitSide=!0),_}charCoords(n,i){var a=this.cm6.contentDOM.getBoundingClientRect(),s=Qn(this.cm6.state.doc,n),c=this.cm6.coordsAtPos(s),d=-a.top;return{left:((c==null?void 0:c.left)||0)-a.left,top:((c==null?void 0:c.top)||0)+d,bottom:((c==null?void 0:c.bottom)||0)+d}}coordsChar(n,i){var a=this.cm6.contentDOM.getBoundingClientRect(),s=this.cm6.posAtCoords({x:n.left+a.left,y:n.top+a.top})||0;return Rr(this.cm6.state.doc,s)}getScrollInfo(){var n=this.cm6.scrollDOM;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight,width:n.scrollWidth,clientHeight:n.clientHeight,clientWidth:n.clientWidth}}scrollTo(n,i){n!=null&&(this.cm6.scrollDOM.scrollLeft=n),i!=null&&(this.cm6.scrollDOM.scrollTop=i)}scrollIntoView(n,i){if(n){var a=this.indexFromPos(n);this.cm6.dispatch({effects:Tn.scrollIntoView(a)})}else this.cm6.dispatch({scrollIntoView:!0,userEvent:"scroll"})}getWrapperElement(){return this.cm6.dom}getMode(){return{name:this.getOption("mode")}}setSize(n,i){this.cm6.dom.style.width=n+4+"px",this.cm6.dom.style.height=i+"px",this.refresh()}refresh(){this.cm6.measure()}destroy(){this.removeOverlay()}getLastEditEnd(){return this.posFromIndex(this.$lastChangeEndOffset)}onChange(n){for(let a in this.$lineHandleChanges&&this.$lineHandleChanges.push(n),this.marks)this.marks[a].update(n.changes);this.virtualSelection&&(this.virtualSelection.ranges=this.virtualSelection.ranges.map(a=>a.map(n.changes)));var i=this.curOp=this.curOp||{};n.changes.iterChanges((a,s,c,d,p)=>{(i.$changeStart==null||i.$changeStart>c)&&(i.$changeStart=c),this.$lastChangeEndOffset=d;var h={text:p.toJSON()};i.lastChange?i.lastChange.next=i.lastChange=h:i.lastChange=i.change=h},!0),i.changeHandlers||(i.changeHandlers=this._handlers.change&&this._handlers.change.slice())}onSelectionChange(){var n=this.curOp=this.curOp||{};n.cursorActivityHandlers||(n.cursorActivityHandlers=this._handlers.cursorActivity&&this._handlers.cursorActivity.slice()),this.curOp.cursorActivity=!0}operation(n,i){this.curOp||(this.curOp={$d:0}),this.curOp.$d++;try{var a=n()}finally{this.curOp&&(this.curOp.$d--,this.curOp.$d||this.onBeforeEndOperation())}return a}onBeforeEndOperation(){var n=this.curOp,i=!1;n&&(n.change&&l0(n.changeHandlers,this,n.change),n&&n.cursorActivity&&(l0(n.cursorActivityHandlers,this,null),n.isVimOp&&(i=!0)),this.curOp=null),i&&this.scrollIntoView()}moveH(n,i){if(i=="char"){var a=this.getCursor();this.setCursor(a.line,a.ch+n)}}setOption(n,i){switch(n){case"keyMap":this.state.keyMap=i;break;case"textwidth":this.state.textwidth=i;break}}getOption(n){switch(n){case"firstLineNumber":return 1;case"tabSize":return this.cm6.state.tabSize||4;case"readOnly":return this.cm6.state.readOnly;case"indentWithTabs":return this.cm6.state.facet(Jb)==" ";case"indentUnit":return this.cm6.state.facet(Jb).length||2;case"textwidth":return this.state.textwidth;case"keyMap":return this.state.keyMap||"vim"}}toggleOverwrite(n){this.state.overwrite=n}getTokenTypeAt(n){var s,c,d;var i=this.indexFromPos(n),a=((d=(c=(s=t2(this.cm6.state,i))==null?void 0:s.resolve(i))==null?void 0:c.type)==null?void 0:d.name)||"";return/comment/i.test(a)?"comment":/string/i.test(a)?"string":""}overWriteSelection(n){var i=this.cm6.state.doc,a=this.cm6.state.selection,s=a.ranges.map(c=>{if(c.empty){var d=c.to<i.length?i.sliceString(c.from,c.to+1):"";if(d&&!/\n/.test(d))return fn.range(c.from,c.to+1)}return c});this.cm6.dispatch({selection:fn.create(s,a.mainIndex)}),this.replaceSelection(n)}isInMultiSelectMode(){return this.cm6.state.selection.ranges.length>1}virtualSelectionMode(){return!!this.virtualSelection}forEachSelection(n){var i=this.cm6.state.selection;this.virtualSelection=fn.create(i.ranges,i.mainIndex);for(var a=0;a<this.virtualSelection.ranges.length;a++){var s=this.virtualSelection.ranges[a];s&&(this.cm6.dispatch({selection:fn.create([s])}),n(),this.virtualSelection.ranges[a]=this.cm6.state.selection.ranges[0])}this.cm6.dispatch({selection:this.virtualSelection}),this.virtualSelection=null}hardWrap(n){return Qx(this,n)}};Ze.isMac=typeof navigator<"u"&&/Mac/.test(navigator.platform),Ze.Pos=Br,Ze.StringStream=L3,Ze.commands={cursorCharLeft:function(e){H3(e.cm6)},redo:function(e){c0(e,!1)},undo:function(e){c0(e,!0)},newlineAndIndent:function(e){A3({state:e.cm6.state,dispatch:n=>ds(e,n)})},indentAuto:function(e){G3(e.cm6)},newlineAndIndentContinueComment:void 0,save:void 0},Ze.isWordChar=function(e){return wd.test(e)},Ze.keys=zx,Ze.addClass=function(e,n){},Ze.rmClass=function(e,n){},Ze.e_preventDefault=function(e){e.preventDefault()},Ze.e_stop=function(e){var n,i;(n=e==null?void 0:e.stopPropagation)==null||n.call(e),(i=e==null?void 0:e.preventDefault)==null||i.call(e)},Ze.lookupKey=function(e,n,i){var a=Ze.keys[e];!a&&/^Arrow/.test(e)&&(a=Ze.keys[e.slice(5)]),a&&i(a)},Ze.on=o0,Ze.off=a0,Ze.signal=s0,Ze.findMatchingTag=Wx,Ze.findEnclosingTag=Ux,Ze.keyName=void 0;function u0(e,n,i){var a=document.createElement("div");return a.appendChild(n),a}function d0(e,n){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=n}function Fx(e,n,i){d0(e,p);var a=u0(e,n,i&&i.bottom),s=!1,c,d=i&&i.duration!==void 0?i.duration:5e3;function p(){s||(s=!0,clearTimeout(c),a.remove(),p0(e,a))}return a.onclick=function(h){h.preventDefault(),p()},f0(e,a),d&&(c=setTimeout(p,d)),p}function f0(e,n){var i=e.state.dialog;e.state.dialog=n,n.style.flex="1",n&&i!==n&&(i&&i.contains(document.activeElement)&&e.focus(),i&&i.parentElement?i.parentElement.replaceChild(n,i):i&&i.remove(),Ze.signal(e,"dialog"))}function p0(e,n){e.state.dialog==n&&(e.state.dialog=null,Ze.signal(e,"dialog"))}function Bx(e,n,i,a){a||(a={}),d0(e,void 0);var s=u0(e,n,a.bottom),c=!1;f0(e,s);function d(h){if(typeof h=="string")p.value=h;else{if(c)return;c=!0,p0(e,s),e.state.dialog||e.focus(),a.onClose&&a.onClose(s)}}var p=s.getElementsByTagName("input")[0];return p&&(a.value&&(p.value=a.value,a.selectValueOnOpen!==!1&&p.select()),a.onInput&&Ze.on(p,"input",function(h){a.onInput(h,p.value,d)}),a.onKeyUp&&Ze.on(p,"keyup",function(h){a.onKeyUp(h,p.value,d)}),Ze.on(p,"keydown",function(h){a&&a.onKeyDown&&a.onKeyDown(h,p.value,d)||(h.keyCode==13&&i&&i(p.value),(h.keyCode==27||a.closeOnEnter!==!1&&h.keyCode==13)&&(p.blur(),Ze.e_stop(h),d()))}),a.closeOnBlur!==!1&&Ze.on(p,"blur",function(){setTimeout(function(){document.activeElement!==p&&d()})}),p.focus()),d}var Hx={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function Vx(e){return e&&e.bracketRegex||/[(){}[\]]/}function $x(e,n,i,a,s){for(var c=s&&s.maxScanLineLength||1e4,d=s&&s.maxScanLines||1e3,p=[],h=Vx(s),v=i>0?Math.min(n.line+d,e.lastLine()+1):Math.max(e.firstLine()-1,n.line-d),w=n.line;w!=v;w+=i){var _=e.getLine(w);if(_){var C=i>0?0:_.length-1,E=i>0?_.length:-1;if(!(_.length>c))for(w==n.line&&(C=n.ch-(i<0?1:0));C!=E;C+=i){var R=_.charAt(C);if(h.test(R)){var A=Hx[R];if(A&&A.charAt(1)==">"==i>0)p.push(R);else if(p.length)p.pop();else return{pos:new Br(w,C),ch:R}}}}}return w-i==(i>0?e.lastLine():e.firstLine())?!1:null}function Wx(e,n){return null}function Ux(e,n){var c,d,p;var i=e.cm6.state,a=e.indexFromPos(n);a<i.doc.length&&i.sliceDoc(a,a+1)=="<"&&a++;for(var s=((c=t2(i,a))==null?void 0:c.resolve(a))||null;s;){if(((d=s.firstChild)==null?void 0:d.type.name)=="OpenTag"&&((p=s.lastChild)==null?void 0:p.type.name)=="CloseTag")return{open:m0(i.doc,s.firstChild),close:m0(i.doc,s.lastChild)};s=s.parent}}function m0(e,n){return{from:Rr(e,n.from),to:Rr(e,n.to)}}var Kx=class{constructor(e,n,i){this.cm=e,this.id=e.$mid++,this.offset=n,this.assoc=i,e.marks[this.id]=this}clear(){delete this.cm.marks[this.id]}find(){return this.offset==null?null:this.cm.posFromIndex(this.offset)}update(e){this.offset!=null&&(this.offset=e.mapPos(this.offset,this.assoc,Gb.TrackDel))}};function Qx(e,n){var R;for(var i=n.column||e.getOption("textwidth")||80,a=n.allowMerge!=0,s=Math.min(n.from,n.to),c=Math.max(n.from,n.to);s<=c;){var d=e.getLine(s);if(d.length>i){var p=E(d,i,5);if(p){var h=(R=/^\s*/.exec(d))==null?void 0:R[0];e.replaceRange(`
74
+ `+h,new Br(s,p.start),new Br(s,p.end))}c++}else if(a&&/\S/.test(d)&&s!=c){var v=e.getLine(s+1);if(v&&/\S/.test(v)){var w=d.replace(/\s+$/,""),_=v.replace(/^\s+/,""),C=w+" "+_,p=E(C,i,5);p&&p.start>w.length||C.length<i?(e.replaceRange(" ",new Br(s,w.length),new Br(s+1,v.length-_.length)),s--,c--):w.length<d.length&&e.replaceRange("",new Br(s,w.length),new Br(s,d.length))}}s++}return s;function E(A,H,V){if(!(A.length<H)){var U=A.slice(0,H),L=A.slice(H),G=/^(?:(\s+)|(\S+)(\s+))/.exec(L),he=/(?:(\s+)|(\s+)(\S+))$/.exec(U),N=0,I=0;if(he&&!he[2]&&(N=H-he[1].length,I=H),G&&!G[2]&&(N||(N=H),I=H+G[1].length),N)return{start:N,end:I};if(he&&he[2]&&he.index>V)return{start:he.index,end:he.index+he[2].length};if(G&&G[2])return N=H+G[2].length,{start:N,end:N+G[3].length}}}}var _d=P3||(function(){let e={cursorBlinkRate:1200};return function(){return e}})(),Gx=class{constructor(e,n,i,a,s,c,d,p,h,v){this.left=e,this.top=n,this.height=i,this.fontFamily=a,this.fontSize=s,this.fontWeight=c,this.color=d,this.className=p,this.letter=h,this.partial=v}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}},Jx=class{constructor(e,n){this.view=e,this.rangePieces=[],this.cursors=[],this.cm=n,this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.cursorLayer=e.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer cm-vimCursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),e.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){let e=_d(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"),Xx(e)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:e}=this.view,n=[];for(let i of e.selection.ranges){let a=i==e.selection.main,s=ek(this.cm,this.view,i,a);s&&n.push(s)}return{cursors:n}}drawSel({cursors:e}){if(e.length!=this.cursors.length||e.some((n,i)=>!n.eq(this.cursors[i]))){let n=this.cursorLayer.children;if(n.length!==e.length){this.cursorLayer.textContent="";for(let i of e)this.cursorLayer.appendChild(i.draw())}else e.forEach((i,a)=>i.adjust(n[a]));this.cursors=e}}destroy(){this.cursorLayer.remove()}};function Xx(e){return _d(e.startState)!=_d(e.state)}var Yx=hu.highest(Tn.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 Zx(e){let n=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==M3.LTR?n.left:n.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft*e.scaleX,top:n.top-e.scrollDOM.scrollTop*e.scaleY}}function ek(e,n,i,a){var w,_,C;var s;let c=i.head,d=!1,p=1,h=e.state.vim;if(h&&(!h.insertMode||e.state.overwrite)){if(d=!0,h.visualBlock&&!a)return null;i.anchor<i.head&&(c<n.state.doc.length&&n.state.sliceDoc(c,c+1))!=`
75
+ `&&c--,e.state.overwrite?p=.2:h.status&&(p=.5)}if(d){let E=c<n.state.doc.length&&n.state.sliceDoc(c,c+1);E&&/[\uDC00-\uDFFF]/.test(E)&&c>1&&(c--,E=n.state.sliceDoc(c,c+1));let R=n.coordsAtPos(c,1);if(!R)return null;let A=Zx(n),H=n.domAtPos(c),V=H?H.node:n.contentDOM;for(V instanceof Text&&H.offset>=V.data.length&&((w=V.parentElement)==null?void 0:w.nextSibling)&&(V=(_=V.parentElement)==null?void 0:_.nextSibling,H={node:V,offset:0});H&&H.node instanceof HTMLElement;)V=H.node,H={node:H.node.childNodes[H.offset],offset:0};if(!(V instanceof HTMLElement)){if(!V.parentNode)return null;V=V.parentNode}let U=getComputedStyle(V),L=R.left,G=(C=(s=n).coordsForChar)==null?void 0:C.call(s,c);if(G&&(L=G.left),!E||E==`
76
+ `||E=="\r")E="\xA0";else if(E==" "){E="\xA0";var v=n.coordsAtPos(c+1,-1);v&&(L=v.left-(v.left-R.left)/parseInt(U.tabSize))}else/[\uD800-\uDBFF]/.test(E)&&c<n.state.doc.length-1&&(E+=n.state.sliceDoc(c+1,c+2));let he=R.bottom-R.top;return new Gx((L-A.left)/n.scaleX,(R.top-A.top+he*(1-p))/n.scaleY,he*p/n.scaleY,U.fontFamily,U.fontSize,U.fontWeight,U.color,a?"cm-fat-cursor cm-cursor-primary":"cm-fat-cursor cm-cursor-secondary",E,p!=1)}else return null}let h0,g0,y0,v0;h0=typeof navigator<"u"&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent),Di=qx(Ze),g0=250,y0=Tn.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"}}),v0=ra.fromClass(class{constructor(e){this.status="",this.query=null,this.decorations=Ti.none,this.waitForCopy=!1,this.lastKeydown="",this.useNextTextInput=!1,this.compositionText="",this.view=e;let n=this.cm=new Ze(e);Di.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new Jx(e,n),this.updateClass(),this.cm.on("vim-command-done",()=>{n.state.vim&&(n.state.vim.status=""),this.blockCursor.scheduleRedraw(),this.updateStatus()}),this.cm.on("vim-mode-change",i=>{n.state.vim&&(n.state.vim.mode=i.mode,i.subMode&&(n.state.vim.mode+=" block"),n.state.vim.status="",this.blockCursor.scheduleRedraw(),this.updateClass(),this.updateStatus())}),this.cm.on("dialog",()=>{this.cm.state.statusbar?this.updateStatus():e.dispatch({effects:b0.of(!!this.cm.state.dialog)})}),this.dom=document.createElement("span"),this.spacer=document.createElement("span"),this.spacer.style.flex="1",this.statusButton=document.createElement("span"),this.statusButton.onclick=i=>{Di.handleKey(this.cm,"<Esc>","user"),this.cm.focus()},this.statusButton.style.cssText="cursor: pointer"}update(e){var n;if((e.viewportChanged||e.docChanged)&&this.query&&this.highlight(this.query),e.docChanged&&this.cm.onChange(e),e.selectionSet&&this.cm.onSelectionChange(),e.viewportChanged,this.cm.curOp&&!this.cm.curOp.isVimOp&&this.cm.onBeforeEndOperation(),e.transactions){for(let i of e.transactions)for(let a of i.effects)if(a.is(Jp))if(!((n=a.value)!=null&&n.forVim))this.highlight(null);else{let s=a.value.create();this.highlight(s)}}this.blockCursor.update(e)}updateClass(){let e=this.cm.state;!e.vim||e.vim.insertMode&&!e.overwrite?this.view.scrollDOM.classList.remove("cm-vimMode"):this.view.scrollDOM.classList.add("cm-vimMode")}updateStatus(){let e=this.cm.state.statusbar,n=this.cm.state.vim;if(!e||!n)return;let i=this.cm.state.dialog;if(i)i.parentElement!=e&&(e.textContent="",e.appendChild(i));else{e.textContent="";var a=(n.mode||"normal").toUpperCase();n.insertModeReturn&&(a+="(C-O)"),this.statusButton.textContent=`--${a}--`,e.appendChild(this.statusButton),e.appendChild(this.spacer)}this.dom.textContent=n.status,e.appendChild(this.dom)}destroy(){Di.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=Ti.none;let{view:n}=this,i=new Zb;for(let a=0,s=n.visibleRanges,c=s.length;a<c;a++){let{from:d,to:p}=s[a];for(;a<c-1&&p>s[a+1].from-2*g0;)p=s[++a].to;e.highlight(n.state,d,p,(h,v)=>{i.add(h,v,nk)})}return this.decorations=i.finish()}handleKey(e,n){let i=this.cm,a=i.state.vim;if(!a)return;let s=Di.vimKeyFromEvent(e,a);if(Ze.signal(this.cm,"inputEvent",{type:"handleKey",key:s}),!s)return;if(s=="<Esc>"&&!a.insertMode&&!a.visualMode&&this.query){let d=a.searchState_;d&&(i.removeOverlay(d.getOverlay()),d.setOverlay(null))}if(s==="<C-c>"&&!Ze.isMac&&i.somethingSelected())return this.waitForCopy=!0,!0;a.status=(a.status||"")+s;let c=Di.multiSelectHandleKey(i,s,"user");return a=Di.maybeInitVimState_(i),!c&&a.insertMode&&i.state.overwrite&&(e.key&&e.key.length==1&&!/\n/.test(e.key)?(c=!0,i.overWriteSelection(e.key)):e.key=="Backspace"&&(c=!0,Ze.commands.cursorCharLeft(i))),c&&(Ze.signal(this.cm,"vim-keypress",s),e.preventDefault(),e.stopPropagation(),this.blockCursor.scheduleRedraw()),this.updateStatus(),!!c}},{eventHandlers:{copy:function(e,n){this.waitForCopy&&(this.waitForCopy=!1,Promise.resolve().then(()=>{var i=this.cm,a=i.state.vim;a&&(a.insertMode?i.setSelection(i.getCursor(),i.getCursor()):i.operation(()=>{i.curOp&&(i.curOp.isVimOp=!0),Di.handleKey(i,"<Esc>","user")}))}))},compositionstart:function(e,n){this.useNextTextInput=!0,Ze.signal(this.cm,"inputEvent",e)},compositionupdate:function(e,n){Ze.signal(this.cm,"inputEvent",e)},compositionend:function(e,n){Ze.signal(this.cm,"inputEvent",e)},keypress:function(e,n){Ze.signal(this.cm,"inputEvent",e),this.lastKeydown=="Dead"&&this.handleKey(e,n)},keydown:function(e,n){Ze.signal(this.cm,"inputEvent",e),this.lastKeydown=e.key,this.lastKeydown=="Unidentified"||this.lastKeydown=="Process"||this.lastKeydown=="Dead"?this.useNextTextInput=!0:(this.useNextTextInput=!1,this.handleKey(e,n))}},provide:()=>[Tn.inputHandler.of((e,n,i,a)=>{var w,_;var s=Pl(e);if(!s)return!1;var c=(w=s.state)==null?void 0:w.vim,d=s.state.vimPlugin;if(c&&!c.insertMode&&!((_=s.curOp)!=null&&_.isVimOp)){if(a==="\0\0")return!0;if(Ze.signal(s,"inputEvent",{type:"text",text:a,from:n,to:i}),a.length==1&&d.useNextTextInput){if(c.expectLiteralNext&&e.composing)return d.compositionText=a,!1;if(d.compositionText){var p=d.compositionText;d.compositionText="";var h=e.state.selection.main.head;if(p===e.state.sliceDoc(h-p.length,h)){var v=s.getCursor();s.replaceRange("",s.posFromIndex(h-p.length),v)}}return d.handleKey({key:a,preventDefault:()=>{},stopPropagation:()=>{}}),tk(e),!0}}return!1})],decorations:e=>e.decorations});function tk(e){var n=e.scrollDOM.parentElement;if(n){if(h0){e.contentDOM.textContent="\0\0",e.contentDOM.dispatchEvent(new CustomEvent("compositionend"));return}var i=e.scrollDOM.nextSibling,a=window.getSelection(),s=a&&{anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset};e.scrollDOM.remove(),n.insertBefore(e.scrollDOM,i);try{s&&a&&(a.setPosition(s.anchorNode,s.anchorOffset),s.focusNode&&a.extend(s.focusNode,s.focusOffset))}catch(c){console.error(c)}e.focus(),e.contentDOM.dispatchEvent(new CustomEvent("compositionend"))}}var nk=Ti.mark({class:"cm-searchMatch"}),b0=ta.define(),rk=pu.define({create:()=>!1,update(e,n){for(let i of n.effects)i.is(b0)&&(e=i.value);return e},provide:e=>Gp.from(e,n=>n?ik:null)});function ik(e){let n=document.createElement("div");n.className="cm-vim-panel";let i=e.cm;return i.state.dialog&&n.appendChild(i.state.dialog),{top:!1,dom:n}}function ok(e){let n=document.createElement("div");n.className="cm-vim-panel";let i=e.cm;return i.state.statusbar=n,i.state.vimPlugin.updateStatus(),{dom:n}}K2=function(e={}){return[y0,v0,Yx,e.status?Gp.of(ok):rk]},Pl=function(e){return e.cm||null},lm=function(e){let n=e.state.selection.main;return n.from===0&&n.to===0},cm=function(e,n=!1){let i=e.state.selection.main,a=e.state.doc.length;return n&&i.from===a-1&&i.to===a-1?!0:i.from===a&&i.to===a},_2=function(e){e&&e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length}})},$2=function(e){var n;return((n=Pl(e))==null?void 0:n.state.vim)!=null},Ow=function(e){var i;let n=(i=Pl(e))==null?void 0:i.state.vim;return n?!n.mode&&!n.insertMode&&!n.visualMode?!0:n.mode==="normal":!1},Tw=function(e){e&&e.dispatch({selection:{anchor:0,head:e.state.doc.length}})};function w0(e,n){if(!(n!=null&&n.length))return Ti.none;let i=new Zb,a=e.facet(sa),s=n.filter(c=>c.kind==="cell"&&c.cellId===a).sort((c,d)=>c.lineNumber-d.lineNumber);for(let c of s){let d=e.doc.line(c.lineNumber),p=Ti.line({class:"cm-error-line"});i.add(d.from,d.from,p)}return i.finish()}var ak=class{constructor(e,n){this.decorations=w0(e.state,n.get()),this.unsubscribe=n.sub(i=>{let a=this.decorations.size;this.decorations=w0(e.state,i),a!==this.decorations.size&&e.dispatch({userEvent:"marimo.error-decoration-update"})})}update(e){this.decorations=this.decorations.map(e.changes)}destroy(){this.unsubscribe()}};function sk(e){return ra.define(n=>new ak(n,e),{decorations:n=>n.decorations})}function lk(e){return[sk(e),Tn.theme({".cm-error-line":{backgroundColor:"color-mix(in srgb, var(--red-4) 40%, transparent)"},"&.cm-focused .cm-error-line.cm-activeLine":{backgroundColor:"color-mix(in srgb, var(--red-6) 40%, transparent)"}})]}function ck({cellId:e,hotkeys:n}){let i=[];return i.push({key:n.getHotkey("cell.run").key,preventDefault:!0,stopPropagation:!0,run:a=>(a.state.facet(Dt).onRun(),!0)},{key:n.getHotkey("cell.runAndNewBelow").key,preventDefault:!0,stopPropagation:!0,run:a=>{let s=a.state.facet(Dt);return s.onRun(),e==="__scratch__"||(a.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})),!0}},{key:n.getHotkey("cell.runAndNewAbove").key,preventDefault:!0,stopPropagation:!0,run:a=>{let s=a.state.facet(Dt);return s.onRun(),e==="__scratch__"||(a.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!0})),!0}},{key:n.getHotkey("cell.aiCompletion").key,preventDefault:!0,stopPropagation:!0,run:a=>(a.state.facet(Dt).aiCellCompletion()&&a.contentDOM.focus(),!0)}),e!=="__scratch__"&&i.push({key:n.getHotkey("cell.goToDefinition").key,preventDefault:!0,stopPropagation:!0,run:a=>(vm(a),!0)},{key:n.getHotkey("cell.delete").key,preventDefault:!0,stopPropagation:!0,run:a=>(a.state.doc.length===0&&a.state.facet(Dt).deleteCell(),!0)},{key:n.getHotkey("cell.moveUp").key,preventDefault:!0,stopPropagation:!0,run:a=>(a.state.facet(Dt).moveCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.moveDown").key,preventDefault:!0,stopPropagation:!0,run:a=>(a.state.facet(Dt).moveCell({cellId:e,before:!1}),!0)},{key:n.getHotkey("cell.moveLeft").key,preventDefault:!0,stopPropagation:!0,run:a=>(a.state.facet(Dt).moveCell({cellId:e,before:!0,direction:"left"}),!0)},{key:n.getHotkey("cell.moveRight").key,preventDefault:!0,stopPropagation:!0,run:a=>(a.state.facet(Dt).moveCell({cellId:e,before:!1,direction:"right"}),!0)},{key:"ArrowUp",preventDefault:!0,stopPropagation:!0,run:a=>d2(a.state)?!1:lm(a)?(a.state.facet(Dt).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0):!1},{key:"ArrowDown",preventDefault:!0,stopPropagation:!0,run:a=>d2(a.state)?!1:cm(a)?(a.state.facet(Dt).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0):!1},{key:n.getHotkey("cell.focusDown").key,preventDefault:!0,stopPropagation:!0,run:a=>(a.state.facet(Dt).moveToNextCell({cellId:e,before:!1,noCreate:!0}),!0)},{key:n.getHotkey("cell.focusUp").key,preventDefault:!0,stopPropagation:!0,run:a=>(a.state.facet(Dt).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0)},{key:n.getHotkey("cell.sendToBottom").key,preventDefault:!0,stopPropagation:!0,run:a=>(a.state.facet(Dt).sendToBottom({cellId:e}),!0)},{key:n.getHotkey("cell.sendToTop").key,preventDefault:!0,stopPropagation:!0,run:a=>(a.state.facet(Dt).sendToTop({cellId:e}),!0)},{key:n.getHotkey("cell.createAbove").key,preventDefault:!0,stopPropagation:!0,run:a=>(a.contentDOM.blur(),a.state.facet(Dt).createNewCell({cellId:e,before:!0}),!0)},{key:n.getHotkey("cell.createBelow").key,preventDefault:!0,stopPropagation:!0,run:a=>(a.contentDOM.blur(),a.state.facet(Dt).createNewCell({cellId:e,before:!1}),!0)},{key:n.getHotkey("cell.hideCode").key,preventDefault:!0,stopPropagation:!0,run:a=>{var c;let s=a.state.facet(Dt).toggleHideCode();return f2(a),s?(a.contentDOM.blur(),(c=document.getElementById(cr.create(e)))==null||c.focus()):a.contentDOM.focus(),!0}},{key:n.getHotkey("cell.splitCell").key,preventDefault:!0,stopPropagation:!0,run:a=>{let s=a.state.facet(Dt);return s.splitCell({cellId:e}),s.moveToNextCell&&requestAnimationFrame(()=>{a.contentDOM.blur(),s.moveToNextCell({cellId:e,before:!1})}),!0}}),[hu.high(na.of(i))]}function uk(e){return[Tn.updateListener.of(n=>{if(n.docChanged){let i=n.transactions.some(d=>d.effects.some(p=>p.is(pa))),a=ii(n.view),s=n.view.state.facet(Dt),c=n.view.state.facet(sa);s.updateCellCode({cellId:c,code:a,formattingChange:i})}}),px(e)]}function dk({predicate:e}){return Tn.updateListener.of(n=>{n.docChanged&&n.view.hasFocus&&e()&&(n.transactions.some(i=>i.effects.some(a=>a.is(pa)))||n.view.state.facet(Dt).onRun())})}Z2=function({cellId:e,hotkeys:n,cellActions:i}){return[Dt.of(i),sa.of(e),ck({cellId:e,hotkeys:n}),uk(n),lk(ux(EE(e),ct))]};const _0=async e=>{let n=e.state.doc.sliceString(0,e.pos),i=document.activeElement,a=null;if(i!==null){let d=cr.findElement(i);d!==null&&(a=cr.parse(d.id))}if(a===null)return Pe.error("Failed to find active cell."),null;let s=await _u.request({document:n,cellId:a});if(!s)return null;let c=bd.asHoverTooltip({position:e.pos,message:s,limitToType:"tooltip"});return c&&ct.set(Nu,{documentation:c.html??null}),c?null:bd.asCompletionResult(e.pos,s)};function fk(e){return n=>e.predicate(n.state)?e.completion(n):null}var pk=async e=>{let n=e.matchBefore(/:\w*$/);if(!e.explicit&&!n)return null;let i=await mk();return{from:(n==null?void 0:n.from)??e.pos,options:i,validFor:/^[\w:]*$/}},mk=ti(async()=>{let e=await fetch("https://unpkg.com/emojilib@3.0.11/dist/emoji-en-US.json").then(n=>{if(!n.ok)throw Error("Failed to fetch emoji list");return n.json()}).catch(()=>({}));return Object.entries(e).map(([n,i])=>({shortcode:i[0],label:i.map(a=>`:${a}`).join(" "),emoji:n,displayLabel:`${n} ${i[0].replaceAll("_"," ")}`,apply:n,type:"emoji"}))}),hk=async e=>{let n=e.matchBefore(/::[\w-:]*$/);if(!e.explicit&&!n)return null;let i=await gk();return{from:(n==null?void 0:n.from)??e.pos,options:i,validFor:/^[\w-:]*$/}},gk=ti(async()=>{let e=await fetch("https://unpkg.com/lucide-static@0.452.0/tags.json").then(i=>{if(!i.ok)throw Error("Failed to fetch Lucide icon list");return i.json()}).catch(()=>({})),n=i=>`https://cdn.jsdelivr.net/npm/lucide-static@0.452.0/icons/${i}.svg`;return Object.entries(e).map(([i,a])=>({label:`::${i}`,displayLabel:i,type:"lucide-icon",boost:10,apply:`::lucide:${i}::`,detail:a.join(", "),info:()=>{let s=document.createElement("img");return s.src=n(i),s.style.width="24px",s.style.height="24px",s}}))}),yk=e=>{let n=e.matchBefore(/\\\w*$/);return!e.explicit&&!n?null:{from:(n==null?void 0:n.from)??e.pos,options:vk(),validFor:/^[\w\\]*$/}},vk=ti(()=>[["alpha","\u03B1","Greek small letter alpha"],["beta","\u03B2","Greek small letter beta"],["gamma","\u03B3","Greek small letter gamma"],["delta","\u03B4","Greek small letter delta"],["epsilon","\u03B5","Greek small letter epsilon"],["zeta","\u03B6","Greek small letter zeta"],["eta","\u03B7","Greek small letter eta"],["theta","\u03B8","Greek small letter theta"],["iota","\u03B9","Greek small letter iota"],["kappa","\u03BA","Greek small letter kappa"],["lambda","\u03BB","Greek small letter lambda"],["mu","\u03BC","Greek small letter mu"],["nu","\u03BD","Greek small letter nu"],["xi","\u03BE","Greek small letter xi"],["omicron","\u03BF","Greek small letter omicron"],["pi","\u03C0","Greek small letter pi"],["rho","\u03C1","Greek small letter rho"],["sigma","\u03C3","Greek small letter sigma"],["tau","\u03C4","Greek small letter tau"],["upsilon","\u03C5","Greek small letter upsilon"],["phi","\u03C6","Greek small letter phi"],["chi","\u03C7","Greek small letter chi"],["psi","\u03C8","Greek small letter psi"],["omega","\u03C9","Greek small letter omega"],["Gamma","\u0393","Greek capital letter gamma"],["Delta","\u0394","Greek capital letter delta"],["Theta","\u0398","Greek capital letter theta"],["Lambda","\u039B","Greek capital letter lambda"],["Xi","\u039E","Greek capital letter xi"],["Pi","\u03A0","Greek capital letter pi"],["Sigma","\u03A3","Greek capital letter sigma"],["Phi","\u03A6","Greek capital letter phi"],["Psi","\u03A8","Greek capital letter psi"],["Omega","\u03A9","Greek capital letter omega"],["pm","\xB1","Plus-minus sign"],["mp","\u2213","Minus-plus sign"],["times","\xD7","Multiplication sign"],["div","\xF7","Division sign"],["cdot","\u22C5","Dot operator"],["ast","\u2217","Asterisk operator"],["star","\u22C6","Star operator"],["circ","\u2218","Ring operator"],["bullet","\u2022","Bullet"],["cap","\u2229","Intersection"],["cup","\u222A","Union"],["uplus","\u228E","Multiset union"],["sqcap","\u2293","Square cap"],["sqcup","\u2294","Square cup"],["vee","\u2228","Logical or"],["wedge","\u2227","Logical and"],["setminus","\u2216","Set minus"],["oplus","\u2295","Circled plus"],["ominus","\u2296","Circled minus"],["otimes","\u2297","Circled times"],["oslash","\u2298","Circled division slash"],["odot","\u2299","Circled dot operator"],["leq","\u2264","Less than or equal to"],["geq","\u2265","Greater than or equal to"],["equiv","\u2261","Identical to"],["prec","\u227A","Precedes"],["succ","\u227B","Succeeds"],["sim","\u223C","Tilde operator"],["perp","\u22A5","Up tack"],["mid","\u2223","Divides"],["parallel","\u2225","Parallel to"],["subset","\u2282","Subset of"],["supset","\u2283","Superset of"],["subseteq","\u2286","Subset of or equal to"],["supseteq","\u2287","Superset of or equal to"],["cong","\u2245","Approximately equal to"],["approx","\u2248","Almost equal to"],["neq","\u2260","Not equal to"],["ne","\u2260","Not equal to"],["propto","\u221D","Proportional to"],["leftarrow","\u2190","Leftward arrow"],["rightarrow","\u2192","Rightward arrow"],["Leftarrow","\u21D0","Leftward double arrow"],["Rightarrow","\u21D2","Rightward double arrow"],["leftrightarrow","\u2194","Left right arrow"],["Leftrightarrow","\u21D4","Left right double arrow"],["uparrow","\u2191","Upward arrow"],["downarrow","\u2193","Downward arrow"],["Uparrow","\u21D1","Upward double arrow"],["Downarrow","\u21D3","Downward double arrow"],["infty","\u221E","Infinity"],["nabla","\u2207","Nabla"],["partial","\u2202","Partial differential"],["forall","\u2200","For all"],["exists","\u2203","There exists"],["nexists","\u2204","There does not exist"],["emptyset","\u2205","Empty set"],["in","\u2208","Element of"],["notin","\u2209","Not an element of"],["sum","\u2211","N-ary summation"],["prod","\u220F","N-ary product"],["int","\u222B","Integral"],["oint","\u222E","Contour integral"],["sqrt","\u221A","Square root"],["hbar","\u210F","Planck constant over 2pi"],["ldots","\u2026","Horizontal ellipsis"],["cdots","\u22EF","Midline horizontal ellipsis"],["vdots","\u22EE","Vertical ellipsis"],["ddots","\u22F1","Down right diagonal ellipsis"]].map(([e,n,i])=>({label:`\\${e} ${i}`,displayLabel:e,type:"latex-symbol",boost:10,apply:`\\${e}`,info:()=>{let a=document.createElement("div");return a.textContent=`${n} ${i}`,a},detail:n})));let x0;x0=[pk,hk,yk],Ju={isAbsolute:e=>e.startsWith("/")||e.startsWith("\\")||e.startsWith("C:\\"),dirname:e=>Dl.guessDeliminator(e).dirname(e),basename:e=>Dl.guessDeliminator(e).basename(e),rest:(e,n)=>Dl.guessDeliminator(e).rest(e,n),extension:e=>{let n=e.split(".");return n.length===1?"":n.at(-1)??""}},Dl=class Ym{constructor(n){this.deliminator=n}static guessDeliminator(n){return n.includes("/")?new Ym("/"):new Ym("\\")}join(...n){return n.filter(Boolean).join(this.deliminator)}basename(n){return n.split(this.deliminator).pop()??""}rest(n,i){let a=n.split(this.deliminator),s=i.split(this.deliminator),c=0;for(;c<a.length&&c<s.length&&a[c]===s[c];++c);return a.slice(c).join(this.deliminator)}dirname(n){let i=n.split(this.deliminator);return i.pop(),i.join(this.deliminator)}};function ma(e){return!e.state.selection.main.empty}function xd({view:e,selection:n,markup:i}){let a=[],s=!0;for(let c=n.from;c<=n.to;c++)if(!e.state.doc.lineAt(c).text.startsWith(i)){s=!1;break}for(let c=n.from;c<=n.to;){let d=e.state.doc.lineAt(c),p=d.text.startsWith(i);s?a.push({from:d.from,to:d.from+i.length,insert:ia.of([""])}):(p&&a.push({from:d.from,to:d.from+i.length,insert:ia.of([""])}),a.push({from:d.from,insert:ia.of([i])})),c=d.to+1}return a}function kd({view:e,range:n,markupAfter:i,markupBefore:a}){if(n.empty){let v=e.state.wordAt(n.head);v&&(n=v)}let s=e.state.sliceDoc(n.from-a.length,n.from)===a,c=e.state.sliceDoc(n.to,n.to+i.length)===i,d=[];d.push(s?{from:n.from-a.length,to:n.from,insert:ia.of([""])}:{from:n.from,insert:ia.of(a.split(`
77
+ `))},c?{from:n.to,to:n.to+i.length,insert:ia.of([""])}:{from:n.to,insert:ia.of(i.split(`
78
+ `))});let p=s?-a.length:a.length,h=c?-i.length:i.length;return{changes:d,range:fn.range(n.from+p,n.to+h)}}function bk(e){if(!ma(e))return!1;let n=xd({view:e,selection:e.state.selection.main,markup:"> "});return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function wk(e){if(!ma(e))return!1;let n=e.state.changeByRange(i=>{if(i.empty){let a=e.state.wordAt(i.head);a&&(i=a)}return kd({view:e,range:i,markupBefore:"**",markupAfter:"**"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:is.userEvent.of("input")})),e.focus(),!0}function k0(e){if(!ma(e))return!1;let n=e.state.changeByRange(i=>{if(i.empty){let s=e.state.wordAt(i.head);s&&(i=s)}let a=e.state.doc.lineAt(i.from).number!==e.state.doc.lineAt(i.to).number;return kd({view:e,range:i,markupBefore:a?"```\n":"`",markupAfter:a?"\n```":"`"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:is.userEvent.of("input")})),e.focus(),!0}function _k(e){let n=e.state.changeByRange(i=>{if(i.empty){let a=e.state.wordAt(i.head);a&&(i=a)}return kd({view:e,range:i,markupBefore:"_",markupAfter:"_"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:is.userEvent.of("input")})),e.focus(),!0}function C0(e,n="http://"){if(!ma(e))return!1;let i=e.state.changeByRange(s=>{let c=e.state.sliceDoc(s.from,s.to);return{changes:[{from:s.from,to:s.to,insert:`[${c}](${n})`}],range:s}});e.dispatch(e.state.update(i,{scrollIntoView:!0,annotations:is.userEvent.of("input")}));let{to:a}=i.selection.main;try{e.dispatch({selection:fn.create([fn.range(a+3,a+3+n.length),fn.cursor(a+3+n.length)])})}catch{}return e.focus(),!0}Gm=async function(e,n){var p;let i=new FileReader,a=await new Promise(h=>{i.onload=()=>h(i.result),i.readAsDataURL(n)}),s;try{if(a.startsWith("data:")){let h=a.split(",")[1],v=prompt("We can save your image as a file. Enter a filename.",n.name),w=n.type.split("/")[1];if(v!==null){v.trim()===""?v=n.name:v.endsWith(`.${w}`)||(v=`${v}.${w}`);let _=ct.get(ss),C=_?Ju.dirname(_):null,E=C?`${C}/public`:"public",R=await Ri().sendCreateFileOrFolder({path:E,type:"file",name:v,contents:h});R.success?(s=(p=R.info)==null?void 0:p.path,vu({title:"Image uploaded successfully",description:`We've uploaded your image at ${s}`})):vu({title:"Failed to upload image. Using raw base64 string."})}}}catch{vu({title:"Failed to upload image. Using raw base64 string."})}let c=e.state.changeByRange(h=>{let v=e.state.sliceDoc(h.from,h.to);return{changes:[{from:h.from,to:h.to,insert:`![${v}](${s??a})`}],range:h}});e.dispatch(e.state.update(c,{scrollIntoView:!0,annotations:is.userEvent.of("input")}));let{to:d}=c.selection.main;try{e.dispatch({selection:fn.create([fn.range(d+4,d+4+a.length),fn.cursor(d+4+a.length)])})}catch{}return e.focus(),!0},Cm=async function(e,n){let i=await n.text(),a=e.state.changeByRange(s=>({changes:[{from:s.from,to:s.from,insert:i}],range:s}));return e.dispatch(e.state.update(a,{scrollIntoView:!0,annotations:is.userEvent.of("input")})),e.focus(),!0};function xk(e){if(!ma(e))return!1;let{changes:n}=e.state.changeByRange(i=>({range:i,changes:xd({view:e,selection:i,markup:e.state.sliceDoc(i.from,i.to+2).startsWith("* ")?"* ":"- "})}));return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function kk(e){if(!ma(e))return!1;let{changes:n}=e.state.changeByRange(i=>({range:i,changes:xd({view:e,selection:i,markup:"1. "})}));return n.length>0&&e.dispatch(e.state.update({changes:n,scrollIntoView:!0,userEvent:"input"})),e.focus(),!0}function Ck(e){return[hu.highest(na.of([{key:e.getHotkey("markdown.bold").key,stopPropagation:!0,run:wk},{key:e.getHotkey("markdown.italic").key,stopPropagation:!0,run:_k},{key:e.getHotkey("markdown.link").key,stopPropagation:!0,run:n=>C0(n)},{key:e.getHotkey("markdown.orderedList").key,run:kk},{key:e.getHotkey("markdown.unorderedList").key,run:xk},{key:e.getHotkey("markdown.blockquote").key,run:bk},{key:e.getHotkey("markdown.code").key,run:k0},{key:"`",run:k0}])),Tn.domEventHandlers({paste:(n,i)=>{var s;if(i.state.selection.main.empty)return!1;let a=(s=n.clipboardData)==null?void 0:s.getData("text/plain");a!=null&&a.startsWith("http")&&(n.preventDefault(),C0(i,a))}}),Tn.domEventHandlers({paste:(n,i)=>{var s;let a=(s=n.clipboardData)==null?void 0:s.files[0];if(!a)return!1;if(a.type.startsWith("image/"))return n.preventDefault(),Gm(i,a),!0;if(a.type.startsWith("text/"))return n.preventDefault(),Cm(i,a),!0}})]}function Sk(e,n,i=3,a=""){return Object.values(e).flatMap(s=>n.has(s.name)?[]:{label:`${a}${s.name}`,displayLabel:s.name,detail:s.dataType??"",boost:i,type:"variable",apply:`${a}${s.name}`,section:"Variable",info:()=>Om(s)})}Om=function(e){let n=document.createElement("div");n.classList.add("mo-cm-tooltip","docs-documentation","min-w-[200px]","flex","flex-col","gap-1","p-2");let i=document.createElement("div");i.classList.add("flex","items-center","gap-2");let a=document.createElement("span");if(a.classList.add("font-bold","text-base"),a.textContent=e.name,i.append(a),e.dataType){let s=document.createElement("span");s.classList.add("text-xs","px-1.5","py-0.5","rounded-full","bg-purple-100","text-purple-800","dark:bg-purple-900","dark:text-purple-200"),s.textContent=e.dataType,i.append(s)}if(n.append(i),e.value){let s=document.createElement("div");s.classList.add("flex","flex-col","gap-1");let c=document.createElement("div");c.classList.add("text-xs","text-muted-foreground"),c.textContent="Value:",s.append(c);let d=document.createElement("div");d.classList.add("text-xs","font-mono","bg-muted","p-2","rounded","overflow-auto","max-h-40"),d.textContent=e.value,s.append(d),n.append(s)}return n};var ha="Python",Cd=123,S0=125,Sd=1,Ek={mark:`${ha}Mark`,resolve:ha};function Tk(e,n){return{defineNodes:[{name:ha,style:fu.emphasis},{name:`${ha}Mark`,style:fu.processingInstruction}],parseInline:[{name:ha,parse(i,a,s){return!n()||a!==Cd&&a!==S0||a===Cd&&i.slice(s-1,s)==="{"?-1:i.addDelimiter(Ek,s,s+Sd,a===Cd,a===S0)}}],wrap:n2(i=>{if(!n()||i.type.name!==ha)return null;let a=i.from+Sd,s=i.to-Sd;return a>=s||a<0||s<0?null:{parser:e,overlay:[{from:a,to:s}],extensions:[m2().support]}})}}const Rk=e=>{let n=e.state.doc.sliceString(0,e.pos),i=n.lastIndexOf("{");if(n.at(i-1)==="{"||i===-1||n.indexOf("}",i)>i)return null;let a=e.matchBefore(/\w*$/);if(!a)return null;let s=Sk(ct.get(mo),new Set,99);return{from:a.from,options:s,validFor:/^\w*$/}};var Fl="InlineMathDollar",ga="InlineMathBracket",Bl="BlockMathDollar",ya="BlockMathBracket",bo={[Fl]:1,[ga]:3,[Bl]:2,[ya]:3},Mt={DOLLAR:36,BACKSLASH:92,OPEN_PAREN:40,CLOSE_PAREN:41,OPEN_BRACKET:91,CLOSE_BRACKET:93},va=Object.keys(bo).reduce((e,n)=>(e[n]={mark:`${n}Mark`,resolve:n},e),{});function Dk(e){let n=[];return Object.keys(bo).forEach(i=>{n.push({name:i,style:fu.emphasis},{name:`${i}Mark`,style:fu.processingInstruction})}),{defineNodes:n,parseInline:[{name:Bl,parse(i,a,s){return a!==Mt.DOLLAR||i.char(s+1)!==Mt.DOLLAR?-1:i.addDelimiter(va[Bl],s,s+bo[Bl],!0,!0)}},{name:Fl,parse(i,a,s){return a!==Mt.DOLLAR||i.char(s+1)===Mt.DOLLAR?-1:i.addDelimiter(va[Fl],s,s+bo[Fl],!0,!0)}},{name:ga,before:"Escape",parse(i,a,s){return a!==Mt.BACKSLASH||i.char(s+1)!==Mt.BACKSLASH||![Mt.OPEN_PAREN,Mt.CLOSE_PAREN].includes(i.char(s+2))?-1:i.addDelimiter(va[ga],s,s+bo[ga],i.char(s+2)===Mt.OPEN_PAREN,i.char(s+2)===Mt.CLOSE_PAREN)}},{name:ya,before:"Escape",parse(i,a,s){return a!==Mt.BACKSLASH||i.char(s+1)!==Mt.BACKSLASH||![Mt.OPEN_BRACKET,Mt.CLOSE_BRACKET].includes(i.char(s+2))?-1:i.addDelimiter(va[ya],s,s+bo[ya],i.char(s+2)===Mt.OPEN_BRACKET,i.char(s+2)===Mt.CLOSE_BRACKET)}},{name:ga,before:"Escape",parse(i,a,s){return a!==Mt.BACKSLASH||![Mt.OPEN_PAREN,Mt.CLOSE_PAREN].includes(i.char(s+1))?-1:i.addDelimiter(va[ga],s,s+2,i.char(s+1)===Mt.OPEN_PAREN,i.char(s+1)===Mt.CLOSE_PAREN)}},{name:ya,before:"Escape",parse(i,a,s){return a!==Mt.BACKSLASH||![Mt.OPEN_BRACKET,Mt.CLOSE_BRACKET].includes(i.char(s+1))?-1:i.addDelimiter(va[ya],s,s+2,i.char(s+1)===Mt.OPEN_BRACKET,i.char(s+1)===Mt.CLOSE_BRACKET)}}],wrap:n2(i=>{let a=bo[i.type.name];if(a){let s=i.from+a,c=i.to-a;return s>=c||s<0||c<0?null:{parser:e,overlay:[{from:s,to:c}]}}return null})}}Qu=ta.define(),Yu=ta.define(),ri=pu.define({create:()=>({}),update:(e,n)=>{for(let i of n.effects){if(i.is(Qu))return i.value;if(i.is(Yu))return{...e,...i.value}}return e}});let Ed,E0,ba,T0,wa,R0;ju=class{constructor(){De(this,"parser",new Wh);De(this,"type","markdown");De(this,"defaultCode",this.parser.defaultCode);De(this,"defaultMetadata",this.parser.defaultMetadata)}static fromMarkdown(e){return Wh.fromMarkdown(e)}transformIn(e){let n=this.parser.transformIn(e);return[n.code,n.offset,n.metadata]}transformOut(e,n){let i=this.parser.transformOut(e,n);return[i.code,i.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,i,a){let s=p2().language.data,c,d=()=>{var h;if(!c)return!0;let p=c==null?void 0:c.state.field(ri);return p===void 0?!1:((h=p.quotePrefix)==null?void 0:h.includes("f"))??!1};return[ra.define(p=>(c=p,{})),p2({base:tR,codeLanguages:z_,extensions:[Dk(r2.define(oR).parser),Tk(Yp.parser,d)]}),Ck(i),x0.map(p=>s.of({autocomplete:p})),m2().language.data.of({autocomplete:fk({completion:_0,predicate:d})}),gu({defaultKeymap:!1,activateOnTyping:!0}),dk({predicate:()=>!d()})]}},Ed=ke(((e,n)=>{var i=typeof Reflect=="object"?Reflect:null,a=i&&typeof i.apply=="function"?i.apply:function(N,I,$){return Function.prototype.apply.call(N,I,$)},s=i&&typeof i.ownKeys=="function"?i.ownKeys:Object.getOwnPropertySymbols?function(N){return Object.getOwnPropertyNames(N).concat(Object.getOwnPropertySymbols(N))}:function(N){return Object.getOwnPropertyNames(N)};function c(N){console&&console.warn&&console.warn(N)}var d=Number.isNaN||function(N){return N!==N};function p(){p.init.call(this)}n.exports=p,n.exports.once=L,p.EventEmitter=p,p.prototype._events=void 0,p.prototype._eventsCount=0,p.prototype._maxListeners=void 0;var h=10;function v(N){if(typeof N!="function")throw TypeError('The "listener" argument must be of type Function. Received type '+typeof N)}Object.defineProperty(p,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(N){if(typeof N!="number"||N<0||d(N))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+N+".");h=N}}),p.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},p.prototype.setMaxListeners=function(N){if(typeof N!="number"||N<0||d(N))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+N+".");return this._maxListeners=N,this};function w(N){return N._maxListeners===void 0?p.defaultMaxListeners:N._maxListeners}p.prototype.getMaxListeners=function(){return w(this)},p.prototype.emit=function(N){for(var I=[],$=1;$<arguments.length;$++)I.push(arguments[$]);var de=N==="error",fe=this._events;if(fe!==void 0)de&&(de=fe.error===void 0);else if(!de)return!1;if(de){var xe;if(I.length>0&&(xe=I[0]),xe instanceof Error)throw xe;var te=Error("Unhandled error."+(xe?" ("+xe.message+")":""));throw te.context=xe,te}var be=fe[N];if(be===void 0)return!1;if(typeof be=="function")a(be,this,I);else for(var Se=be.length,ie=H(be,Se),$=0;$<Se;++$)a(ie[$],this,I);return!0};function _(N,I,$,de){var fe,xe,te;if(v($),xe=N._events,xe===void 0?(xe=N._events=Object.create(null),N._eventsCount=0):(xe.newListener!==void 0&&(N.emit("newListener",I,$.listener?$.listener:$),xe=N._events),te=xe[I]),te===void 0)te=xe[I]=$,++N._eventsCount;else if(typeof te=="function"?te=xe[I]=de?[$,te]:[te,$]:de?te.unshift($):te.push($),fe=w(N),fe>0&&te.length>fe&&!te.warned){te.warned=!0;var be=Error("Possible EventEmitter memory leak detected. "+te.length+" "+String(I)+" listeners added. Use emitter.setMaxListeners() to increase limit");be.name="MaxListenersExceededWarning",be.emitter=N,be.type=I,be.count=te.length,c(be)}return N}p.prototype.addListener=function(N,I){return _(this,N,I,!1)},p.prototype.on=p.prototype.addListener,p.prototype.prependListener=function(N,I){return _(this,N,I,!0)};function C(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function E(N,I,$){var de={fired:!1,wrapFn:void 0,target:N,type:I,listener:$},fe=C.bind(de);return fe.listener=$,de.wrapFn=fe,fe}p.prototype.once=function(N,I){return v(I),this.on(N,E(this,N,I)),this},p.prototype.prependOnceListener=function(N,I){return v(I),this.prependListener(N,E(this,N,I)),this},p.prototype.removeListener=function(N,I){var $,de,fe,xe,te;if(v(I),de=this._events,de===void 0||($=de[N],$===void 0))return this;if($===I||$.listener===I)--this._eventsCount===0?this._events=Object.create(null):(delete de[N],de.removeListener&&this.emit("removeListener",N,$.listener||I));else if(typeof $!="function"){for(fe=-1,xe=$.length-1;xe>=0;xe--)if($[xe]===I||$[xe].listener===I){te=$[xe].listener,fe=xe;break}if(fe<0)return this;fe===0?$.shift():V($,fe),$.length===1&&(de[N]=$[0]),de.removeListener!==void 0&&this.emit("removeListener",N,te||I)}return this},p.prototype.off=p.prototype.removeListener,p.prototype.removeAllListeners=function(N){var I,$=this._events,de;if($===void 0)return this;if($.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):$[N]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete $[N]),this;if(arguments.length===0){var fe=Object.keys($),xe;for(de=0;de<fe.length;++de)xe=fe[de],xe!=="removeListener"&&this.removeAllListeners(xe);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(I=$[N],typeof I=="function")this.removeListener(N,I);else if(I!==void 0)for(de=I.length-1;de>=0;de--)this.removeListener(N,I[de]);return this};function R(N,I,$){var de=N._events;if(de===void 0)return[];var fe=de[I];return fe===void 0?[]:typeof fe=="function"?$?[fe.listener||fe]:[fe]:$?U(fe):H(fe,fe.length)}p.prototype.listeners=function(N){return R(this,N,!0)},p.prototype.rawListeners=function(N){return R(this,N,!1)},p.listenerCount=function(N,I){return typeof N.listenerCount=="function"?N.listenerCount(I):A.call(N,I)},p.prototype.listenerCount=A;function A(N){var I=this._events;if(I!==void 0){var $=I[N];if(typeof $=="function")return 1;if($!==void 0)return $.length}return 0}p.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]};function H(N,I){for(var $=Array(I),de=0;de<I;++de)$[de]=N[de];return $}function V(N,I){for(;I+1<N.length;I++)N[I]=N[I+1];N.pop()}function U(N){for(var I=Array(N.length),$=0;$<I.length;++$)I[$]=N[$].listener||N[$];return I}function L(N,I){return new Promise(function($,de){function fe(te){N.removeListener(I,xe),de(te)}function xe(){typeof N.removeListener=="function"&&N.removeListener("error",fe),$([].slice.call(arguments))}he(N,I,xe,{once:!0}),I!=="error"&&G(N,fe,{once:!0})})}function G(N,I,$){typeof N.on=="function"&&he(N,"error",I,$)}function he(N,I,$,de){if(typeof N.on=="function")de.once?N.once(I,$):N.on(I,$);else if(typeof N.addEventListener=="function")N.addEventListener(I,function fe(xe){de.once&&N.removeEventListener(I,fe),$(xe)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof N)}})),E0=ke((e=>{var n=e&&e.__awaiter||function(s,c,d,p){function h(v){return v instanceof d?v:new d(function(w){w(v)})}return new(d||(d=Promise))(function(v,w){function _(R){try{E(p.next(R))}catch(A){w(A)}}function C(R){try{E(p.throw(R))}catch(A){w(A)}}function E(R){R.done?v(R.value):h(R.value).then(_,C)}E((p=p.apply(s,c||[])).next())})},i=e&&e.__generator||function(s,c){var d={label:0,sent:function(){if(v[0]&1)throw v[1];return v[1]},trys:[],ops:[]},p,h,v,w;return w={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(w[Symbol.iterator]=function(){return this}),w;function _(E){return function(R){return C([E,R])}}function C(E){if(p)throw TypeError("Generator is already executing.");for(;d;)try{if(p=1,h&&(v=E[0]&2?h.return:E[0]?h.throw||((v=h.return)&&v.call(h),0):h.next)&&!(v=v.call(h,E[1])).done)return v;switch(h=0,v&&(E=[E[0]&2,v.value]),E[0]){case 0:case 1:v=E;break;case 4:return d.label++,{value:E[1],done:!1};case 5:d.label++,h=E[1],E=[0];continue;case 7:E=d.ops.pop(),d.trys.pop();continue;default:if(v=d.trys,!(v=v.length>0&&v[v.length-1])&&(E[0]===6||E[0]===2)){d=0;continue}if(E[0]===3&&(!v||E[1]>v[0]&&E[1]<v[3])){d.label=E[1];break}if(E[0]===6&&d.label<v[1]){d.label=v[1],v=E;break}if(v&&d.label<v[2]){d.label=v[2],d.ops.push(E);break}v[2]&&d.ops.pop(),d.trys.pop();continue}E=c.call(s,d)}catch(R){E=[6,R],h=0}finally{p=v=0}if(E[0]&5)throw E[1];return{value:E[0]?E[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.defaultNextRequest=void 0;var a=Ed();e.defaultNextRequest=function(){var s=-1;return function(){return++s}},e.default=(function(){function s(c,d){d===void 0&&(d=e.defaultNextRequest()),this.batch=[],this.batchStarted=!1,this.lastId=-1,this.transports=c,this.requests={},this.connectPromise=this.connect(),this.requestChannel=new a.EventEmitter,this.nextID=d}return s.prototype.connect=function(){var c=this;return Promise.all(this.transports.map(function(d){return n(c,void 0,void 0,function(){return i(this,function(p){switch(p.label){case 0:return d.subscribe("error",this.handleError.bind(this)),d.subscribe("notification",this.handleNotification.bind(this)),[4,d.connect()];case 1:return p.sent(),[2]}})})}))},s.prototype.getPrimaryTransport=function(){return this.transports[0]},s.prototype.request=function(c,d,p){return d===void 0&&(d=!1),n(this,void 0,void 0,function(){var h,v,w,_,C=this;return i(this,function(E){return h=this.nextID().toString(),v=d?null:h,w={request:this.makeRequest(c.method,c.params||[],v),internalID:h},this.batchStarted?(_=new Promise(function(R,A){C.batch.push({resolve:R,reject:A,request:w})}),[2,_]):[2,this.getPrimaryTransport().sendData(w,p)]})})},s.prototype.close=function(){this.requestChannel.removeAllListeners(),this.transports.forEach(function(c){c.unsubscribe(),c.close()})},s.prototype.startBatch=function(){this.batchStarted=!0},s.prototype.stopBatch=function(){if(this.batchStarted===!1)throw Error("cannot end that which has never started");if(this.batch.length===0){this.batchStarted=!1;return}this.getPrimaryTransport().sendData(this.batch),this.batch=[],this.batchStarted=!1},s.prototype.makeRequest=function(c,d,p){return p?{jsonrpc:"2.0",id:p,method:c,params:d}:{jsonrpc:"2.0",method:c,params:d}},s.prototype.handleError=function(c){this.requestChannel.emit("error",c)},s.prototype.handleNotification=function(c){this.requestChannel.emit("notification",c)},s})()})),ba=ke((e=>{var n=e&&e.__extends||(function(){var a=function(s,c){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var h in p)p.hasOwnProperty(h)&&(d[h]=p[h])},a(s,c)};return function(s,c){a(s,c);function d(){this.constructor=s}s.prototype=c===null?Object.create(c):(d.prototype=c.prototype,new d)}})();Object.defineProperty(e,"__esModule",{value:!0}),e.convertJSONToRPCError=e.JSONRPCError=e.ERR_UNKNOWN=e.ERR_MISSIING_ID=e.ERR_TIMEOUT=void 0,e.ERR_TIMEOUT=7777,e.ERR_MISSIING_ID=7878,e.ERR_UNKNOWN=7979;var i=(function(a){n(s,a);function s(c,d,p){var h=this.constructor,v=a.call(this,c)||this;return v.message=c,v.code=d,v.data=p,Object.setPrototypeOf(v,h.prototype),v}return s})(Error);e.JSONRPCError=i,e.convertJSONToRPCError=function(a){if(a.error){var s=a.error,c=s.message,d=s.code,p=s.data;return new i(c,d,p)}return new i("Unknown error",e.ERR_UNKNOWN,a)}})),T0=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TransportRequestManager=void 0;var n=Ed(),i=ba();e.TransportRequestManager=(function(){function a(){this.pendingRequest={},this.pendingBatchRequest={},this.transportEventChannel=new n.EventEmitter}return a.prototype.addRequest=function(s,c){return this.transportEventChannel.emit("pending",s),s instanceof Array?(this.addBatchReq(s,c),Promise.resolve()):this.addReq(s.internalID,c)},a.prototype.settlePendingRequest=function(s,c){var d=this;s.forEach(function(p){var h=d.pendingRequest[p.internalID];if(delete d.pendingBatchRequest[p.internalID],h!==void 0){if(c){h.reject(c);return}h.resolve(),(p.request.id===null||p.request.id===void 0)&&delete d.pendingRequest[p.internalID]}})},a.prototype.isPendingRequest=function(s){return this.pendingRequest.hasOwnProperty(s)},a.prototype.resolveResponse=function(s,c){c===void 0&&(c=!0);var d=s;try{return d=JSON.parse(s),this.checkJSONRPC(d)===!1?void 0:d instanceof Array?this.resolveBatch(d,c):this.resolveRes(d,c)}catch{var p=new i.JSONRPCError("Bad response format",i.ERR_UNKNOWN,s);return c&&this.transportEventChannel.emit("error",p),p}},a.prototype.addBatchReq=function(s,c){var d=this;return s.forEach(function(p){var h=p.resolve,v=p.reject,w=p.request.internalID;d.pendingBatchRequest[w]=!0,d.pendingRequest[w]={resolve:h,reject:v}}),Promise.resolve()},a.prototype.addReq=function(s,c){var d=this;return new Promise(function(p,h){c!==null&&c&&d.setRequestTimeout(s,c,h),d.pendingRequest[s]={resolve:p,reject:h}})},a.prototype.checkJSONRPC=function(s){var c=[s];return s instanceof Array&&(c=s),c.every(function(d){return d.result!==void 0||d.error!==void 0||d.method!==void 0})},a.prototype.processResult=function(s,c){if(s.error){var d=i.convertJSONToRPCError(s);c.reject(d);return}c.resolve(s.result)},a.prototype.resolveBatch=function(s,c){var d=this,p=s.map(function(h){return d.resolveRes(h,c)}).filter(function(h){return h});if(p.length>0)return p[0]},a.prototype.resolveRes=function(s,c){var d=s.id,p=s.error,h=this.pendingRequest[d];if(h){delete this.pendingRequest[d],this.processResult(s,h),this.transportEventChannel.emit("response",s);return}if(d===void 0&&p===void 0){this.transportEventChannel.emit("notification",s);return}var v;return p&&(v=i.convertJSONToRPCError(s)),c&&p&&v&&this.transportEventChannel.emit("error",v),v},a.prototype.setRequestTimeout=function(s,c,d){var p=this;setTimeout(function(){delete p.pendingRequest[s],d(new i.JSONRPCError("Request timeout request took longer than "+c+" ms to resolve",i.ERR_TIMEOUT))},c)},a})()})),go=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Transport=void 0;var n=T0();e.Transport=(function(){function i(){this.transportRequestManager=new n.TransportRequestManager,this.transportRequestManager.transportEventChannel.on("error",function(){})}return i.prototype.subscribe=function(a,s){this.transportRequestManager.transportEventChannel.addListener(a,s)},i.prototype.unsubscribe=function(a,s){if(!a)return this.transportRequestManager.transportEventChannel.removeAllListeners();a&&s&&this.transportRequestManager.transportEventChannel.removeListener(a,s)},i.prototype.parseData=function(a){return a instanceof Array?a.map(function(s){return s.request.request}):a.request},i})()})),wa=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getNotifications=e.getBatchRequests=e.isNotification=void 0,e.isNotification=function(n){return n.request.id===void 0||n.request.id===null},e.getBatchRequests=function(n){return n instanceof Array?n.filter(function(i){return i.request.request.id!=null}).map(function(i){return i.request}):[]},e.getNotifications=function(n){return n instanceof Array?n.filter(function(i){return e.isNotification(i.request)}).map(function(i){return i.request}):e.isNotification(n)?[n]:[]}})),R0=ke((e=>{var n=e&&e.__extends||(function(){var c=function(d,p){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var w in v)v.hasOwnProperty(w)&&(h[w]=v[w])},c(d,p)};return function(d,p){c(d,p);function h(){this.constructor=d}d.prototype=p===null?Object.create(p):(h.prototype=p.prototype,new h)}})();Object.defineProperty(e,"__esModule",{value:!0});var i=go(),a=wa(),s=ba();e.default=(function(c){n(d,c);function d(p,h,v){var w=c.call(this)||this;return w.connection=p,w.reqUri=h,w.resUri=v,w}return d.prototype.connect=function(){var p=this;return this.connection.on(this.resUri,function(h){p.transportRequestManager.resolveResponse(h)}),Promise.resolve()},d.prototype.sendData=function(p,h){h===void 0&&(h=null);var v=this.transportRequestManager.addRequest(p,h),w=a.getNotifications(p),_=this.parseData(p);try{return this.connection.emit(this.reqUri,_),this.transportRequestManager.settlePendingRequest(w),v}catch(E){var C=new s.JSONRPCError(E.message,s.ERR_UNKNOWN,E);return this.transportRequestManager.settlePendingRequest(w,C),Promise.reject(C)}},d.prototype.close=function(){this.connection.removeAllListeners()},d})(i.Transport)}));function Ok(e){return e&&DataView.prototype.isPrototypeOf(e)}function _a(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Td(e){return typeof e!="string"&&(e=String(e)),e}function Rd(e){var n={next:function(){var i=e.shift();return{done:i===void 0,value:i}}};return Rn.iterable&&(n[Symbol.iterator]=function(){return n}),n}function an(e){this.map={},e instanceof an?e.forEach(function(n,i){this.append(i,n)},this):Array.isArray(e)?e.forEach(function(n){if(n.length!=2)throw TypeError("Headers constructor: expected name/value pair to be length 2, found"+n.length);this.append(n[0],n[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(n){this.append(n,e[n])},this)}function Dd(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}}function D0(e){return new Promise(function(n,i){e.onload=function(){n(e.result)},e.onerror=function(){i(e.error)}})}function Pk(e){var n=new FileReader,i=D0(n);return n.readAsArrayBuffer(e),i}function Nk(e){var n=new FileReader,i=D0(n),a=/charset=([A-Za-z0-9_-]+)/.exec(e.type),s=a?a[1]:"utf-8";return n.readAsText(e,s),i}function Mk(e){for(var n=new Uint8Array(e),i=Array(n.length),a=0;a<n.length;a++)i[a]=String.fromCharCode(n[a]);return i.join("")}function O0(e){if(e.slice)return e.slice(0);var n=new Uint8Array(e.byteLength);return n.set(new Uint8Array(e)),n.buffer}function P0(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:Rn.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Rn.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Rn.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Rn.arrayBuffer&&Rn.blob&&Ok(e)?(this._bodyArrayBuffer=O0(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Rn.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||L0(e))?this._bodyArrayBuffer=O0(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Rn.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Rn.blob&&(this.blob=function(){var e=Dd(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return Dd(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(Rn.blob)return this.blob().then(Pk);throw Error("could not read as ArrayBuffer")},this.text=function(){var e=Dd(this);if(e)return e;if(this._bodyBlob)return Nk(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Mk(this._bodyArrayBuffer));if(this._bodyFormData)throw Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Rn.formData&&(this.formData=function(){return this.text().then(Ak)}),this.json=function(){return this.text().then(JSON.parse)},this}function Lk(e){var n=e.toUpperCase();return A0.indexOf(n)>-1?n:e}function wo(e,n){if(!(this instanceof wo))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');n||(n={});var i=n.body;if(e instanceof wo){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,n.headers||(this.headers=new an(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!i&&e._bodyInit!=null&&(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=n.credentials||this.credentials||"same-origin",(n.headers||!this.headers)&&(this.headers=new an(n.headers)),this.method=Lk(n.method||this.method||"GET"),this.mode=n.mode||this.mode||null,this.signal=n.signal||this.signal||(function(){if("AbortController"in pn)return new AbortController().signal})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&i)throw TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),(this.method==="GET"||this.method==="HEAD")&&(n.cache==="no-store"||n.cache==="no-cache")){var a=/([?&])_=[^&]*/;a.test(this.url)?this.url=this.url.replace(a,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function Ak(e){var n=new FormData;return e.trim().split("&").forEach(function(i){if(i){var a=i.split("="),s=a.shift().replace(/\+/g," "),c=a.join("=").replace(/\+/g," ");n.append(decodeURIComponent(s),decodeURIComponent(c))}}),n}function Ik(e){var n=new an;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(i){return i.indexOf(`
79
+ `)===0?i.substr(1,i.length):i}).forEach(function(i){var a=i.split(":"),s=a.shift().trim();if(s){var c=a.join(":").trim();try{n.append(s,c)}catch(d){console.warn("Response "+d.message)}}}),n}function Hr(e,n){if(!(this instanceof Hr))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(n||(n={}),this.type="default",this.status=n.status===void 0?200:n.status,this.status<200||this.status>599)throw RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=n.statusText===void 0?"":""+n.statusText,this.headers=new an(n.headers),this.url=n.url||"",this._initBody(e)}function N0(e,n){return new Promise(function(i,a){var s=new wo(e,n);if(s.signal&&s.signal.aborted)return a(new Li("Aborted","AbortError"));var c=new XMLHttpRequest;function d(){c.abort()}c.onload=function(){var v={statusText:c.statusText,headers:Ik(c.getAllResponseHeaders()||"")};s.url.indexOf("file://")===0&&(c.status<200||c.status>599)?v.status=200:v.status=c.status,v.url="responseURL"in c?c.responseURL:v.headers.get("X-Request-URL");var w="response"in c?c.response:c.responseText;setTimeout(function(){i(new Hr(w,v))},0)},c.onerror=function(){setTimeout(function(){a(TypeError("Network request failed"))},0)},c.ontimeout=function(){setTimeout(function(){a(TypeError("Network request timed out"))},0)},c.onabort=function(){setTimeout(function(){a(new Li("Aborted","AbortError"))},0)};function p(v){try{return v===""&&pn.location.href?pn.location.href:v}catch{return v}}if(c.open(s.method,p(s.url),!0),s.credentials==="include"?c.withCredentials=!0:s.credentials==="omit"&&(c.withCredentials=!1),"responseType"in c&&(Rn.blob?c.responseType="blob":Rn.arrayBuffer&&(c.responseType="arraybuffer")),n&&typeof n.headers=="object"&&!(n.headers instanceof an||pn.Headers&&n.headers instanceof pn.Headers)){var h=[];Object.getOwnPropertyNames(n.headers).forEach(function(v){h.push(_a(v)),c.setRequestHeader(v,Td(n.headers[v]))}),s.headers.forEach(function(v,w){h.indexOf(w)===-1&&c.setRequestHeader(w,v)})}else s.headers.forEach(function(v,w){c.setRequestHeader(w,v)});s.signal&&(s.signal.addEventListener("abort",d),c.onreadystatechange=function(){c.readyState===4&&s.signal.removeEventListener("abort",d)}),c.send(s._bodyInit===void 0?null:s._bodyInit)})}let pn,Rn,M0,L0,A0,I0,Li,j0,q0,z0,F0,_o,B0,H0,V0,$0,W0,U0,xa,Od,Pd,K0,Ai,ka,Hl,Q0,Nd,G0,J0,X0,Y0,Vl,Z0,xo,Md,qt,$l,eg,tg,ng,rg,ig,og,ag,sg,lg,cg,ug,dg,fg,pg,mg,hg,gg,yg,vg,bg,wg,_g,xg,kg;j0=Bb((()=>{pn=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},Rn={searchParams:"URLSearchParams"in pn,iterable:"Symbol"in pn&&"iterator"in Symbol,blob:"FileReader"in pn&&"Blob"in pn&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in pn,arrayBuffer:"ArrayBuffer"in pn},Rn.arrayBuffer&&(M0=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],L0=ArrayBuffer.isView||function(e){return e&&M0.indexOf(Object.prototype.toString.call(e))>-1}),an.prototype.append=function(e,n){e=_a(e),n=Td(n);var i=this.map[e];this.map[e]=i?i+", "+n:n},an.prototype.delete=function(e){delete this.map[_a(e)]},an.prototype.get=function(e){return e=_a(e),this.has(e)?this.map[e]:null},an.prototype.has=function(e){return this.map.hasOwnProperty(_a(e))},an.prototype.set=function(e,n){this.map[_a(e)]=Td(n)},an.prototype.forEach=function(e,n){for(var i in this.map)this.map.hasOwnProperty(i)&&e.call(n,this.map[i],i,this)},an.prototype.keys=function(){var e=[];return this.forEach(function(n,i){e.push(i)}),Rd(e)},an.prototype.values=function(){var e=[];return this.forEach(function(n){e.push(n)}),Rd(e)},an.prototype.entries=function(){var e=[];return this.forEach(function(n,i){e.push([i,n])}),Rd(e)},Rn.iterable&&(an.prototype[Symbol.iterator]=an.prototype.entries),A0=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"],wo.prototype.clone=function(){return new wo(this,{body:this._bodyInit})},P0.call(wo.prototype),P0.call(Hr.prototype),Hr.prototype.clone=function(){return new Hr(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new an(this.headers),url:this.url})},Hr.error=function(){var e=new Hr(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e},I0=[301,302,303,307,308],Hr.redirect=function(e,n){if(I0.indexOf(n)===-1)throw RangeError("Invalid status code");return new Hr(null,{status:n,headers:{location:e}})},Li=pn.DOMException;try{new Li}catch{Li=function(e,n){this.message=e,this.name=n,this.stack=Error(e).stack},Li.prototype=Object.create(Error.prototype),Li.prototype.constructor=Li}N0.polyfill=!0,pn.fetch||(pn.fetch=N0,pn.Headers=an,pn.Request=wo,pn.Response=Hr)})),q0=ke(((e,n)=>{j0(),n.exports=self.fetch.bind(self)})),z0=ke((e=>{var n=e&&e.__extends||(function(){var w=function(_,C){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,R){E.__proto__=R}||function(E,R){for(var A in R)R.hasOwnProperty(A)&&(E[A]=R[A])},w(_,C)};return function(_,C){w(_,C);function E(){this.constructor=_}_.prototype=C===null?Object.create(C):(E.prototype=C.prototype,new E)}})(),i=e&&e.__awaiter||function(w,_,C,E){function R(A){return A instanceof C?A:new C(function(H){H(A)})}return new(C||(C=Promise))(function(A,H){function V(G){try{L(E.next(G))}catch(he){H(he)}}function U(G){try{L(E.throw(G))}catch(he){H(he)}}function L(G){G.done?A(G.value):R(G.value).then(V,U)}L((E=E.apply(w,_||[])).next())})},a=e&&e.__generator||function(w,_){var C={label:0,sent:function(){if(A[0]&1)throw A[1];return A[1]},trys:[],ops:[]},E,R,A,H;return H={next:V(0),throw:V(1),return:V(2)},typeof Symbol=="function"&&(H[Symbol.iterator]=function(){return this}),H;function V(L){return function(G){return U([L,G])}}function U(L){if(E)throw TypeError("Generator is already executing.");for(;C;)try{if(E=1,R&&(A=L[0]&2?R.return:L[0]?R.throw||((A=R.return)&&A.call(R),0):R.next)&&!(A=A.call(R,L[1])).done)return A;switch(R=0,A&&(L=[L[0]&2,A.value]),L[0]){case 0:case 1:A=L;break;case 4:return C.label++,{value:L[1],done:!1};case 5:C.label++,R=L[1],L=[0];continue;case 7:L=C.ops.pop(),C.trys.pop();continue;default:if(A=C.trys,!(A=A.length>0&&A[A.length-1])&&(L[0]===6||L[0]===2)){C=0;continue}if(L[0]===3&&(!A||L[1]>A[0]&&L[1]<A[3])){C.label=L[1];break}if(L[0]===6&&C.label<A[1]){C.label=A[1],A=L;break}if(A&&C.label<A[2]){C.label=A[2],C.ops.push(L);break}A[2]&&C.ops.pop(),C.trys.pop();continue}L=_.call(w,C)}catch(G){L=[6,G],R=0}finally{E=A=0}if(L[0]&5)throw L[1];return{value:L[0]?L[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(e,"__esModule",{value:!0}),e.HTTPTransport=void 0;var c=s(q0()),d=go(),p=wa(),h=ba(),v=(function(w){n(_,w);function _(C,E){var R=w.call(this)||this;return R.onlyNotifications=function(A){return A instanceof Array?A.every(function(H){return H.request.request.id===null||H.request.request.id===void 0}):A.request.id===null||A.request.id===void 0},R.uri=C,R.credentials=E&&E.credentials,R.headers=_.setupHeaders(E&&E.headers),R.injectedFetcher=E==null?void 0:E.fetcher,R}return _.prototype.connect=function(){return Promise.resolve()},_.prototype.sendData=function(C,E){return E===void 0&&(E=null),i(this,void 0,void 0,function(){var R,A,H,V,U,L,he,G,he;return a(this,function(N){switch(N.label){case 0:R=this.transportRequestManager.addRequest(C,E),A=p.getNotifications(C),H=p.getBatchRequests(C),V=this.injectedFetcher||c.default,N.label=1;case 1:return N.trys.push([1,4,,5]),[4,V(this.uri,{method:"POST",headers:this.headers,body:JSON.stringify(this.parseData(C)),credentials:this.credentials})];case 2:return U=N.sent(),this.transportRequestManager.settlePendingRequest(A),this.onlyNotifications(C)?[2,Promise.resolve()]:[4,U.text()];case 3:return L=N.sent(),he=this.transportRequestManager.resolveResponse(L),he?(this.transportRequestManager.settlePendingRequest(H,he),[2,Promise.reject(he)]):[3,5];case 4:return G=N.sent(),he=new h.JSONRPCError(G.message,h.ERR_UNKNOWN,G),this.transportRequestManager.settlePendingRequest(A,he),this.transportRequestManager.settlePendingRequest(p.getBatchRequests(C),he),[2,Promise.reject(he)];case 5:return[2,R]}})})},_.prototype.close=function(){},_.setupHeaders=function(C){var E=new Headers(C);return E.set("Content-Type","application/json"),E},_})(d.Transport);e.HTTPTransport=v,e.default=v})),F0=o3({default:()=>B0}),H0=Bb((()=>{_o=null,typeof WebSocket<"u"?_o=WebSocket:typeof MozWebSocket<"u"?_o=MozWebSocket:typeof global<"u"?_o=global.WebSocket||global.MozWebSocket:typeof window<"u"?_o=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(_o=self.WebSocket||self.MozWebSocket),B0=_o})),V0=ke((e=>{var n=e&&e.__extends||(function(){var v=function(w,_){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,E){C.__proto__=E}||function(C,E){for(var R in E)E.hasOwnProperty(R)&&(C[R]=E[R])},v(w,_)};return function(w,_){v(w,_);function C(){this.constructor=w}w.prototype=_===null?Object.create(_):(C.prototype=_.prototype,new C)}})(),i=e&&e.__awaiter||function(v,w,_,C){function E(R){return R instanceof _?R:new _(function(A){A(R)})}return new(_||(_=Promise))(function(R,A){function H(L){try{U(C.next(L))}catch(G){A(G)}}function V(L){try{U(C.throw(L))}catch(G){A(G)}}function U(L){L.done?R(L.value):E(L.value).then(H,V)}U((C=C.apply(v,w||[])).next())})},a=e&&e.__generator||function(v,w){var _={label:0,sent:function(){if(R[0]&1)throw R[1];return R[1]},trys:[],ops:[]},C,E,R,A;return A={next:H(0),throw:H(1),return:H(2)},typeof Symbol=="function"&&(A[Symbol.iterator]=function(){return this}),A;function H(U){return function(L){return V([U,L])}}function V(U){if(C)throw TypeError("Generator is already executing.");for(;_;)try{if(C=1,E&&(R=U[0]&2?E.return:U[0]?E.throw||((R=E.return)&&R.call(E),0):E.next)&&!(R=R.call(E,U[1])).done)return R;switch(E=0,R&&(U=[U[0]&2,R.value]),U[0]){case 0:case 1:R=U;break;case 4:return _.label++,{value:U[1],done:!1};case 5:_.label++,E=U[1],U=[0];continue;case 7:U=_.ops.pop(),_.trys.pop();continue;default:if(R=_.trys,!(R=R.length>0&&R[R.length-1])&&(U[0]===6||U[0]===2)){_=0;continue}if(U[0]===3&&(!R||U[1]>R[0]&&U[1]<R[3])){_.label=U[1];break}if(U[0]===6&&_.label<R[1]){_.label=R[1],R=U;break}if(R&&_.label<R[2]){_.label=R[2],_.ops.push(U);break}R[2]&&_.ops.pop(),_.trys.pop();continue}U=w.call(v,_)}catch(L){U=[6,L],E=0}finally{C=R=0}if(U[0]&5)throw U[1];return{value:U[0]?U[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0});var c=s((H0(),lu(F0))),d=go(),p=wa(),h=ba();e.default=(function(v){n(w,v);function w(_){var C=v.call(this)||this;return C.uri=_,C.connection=new c.default(_),C}return w.prototype.connect=function(){var _=this;return new Promise(function(C,E){var R=function(){_.connection.removeEventListener("open",R),C()};_.connection.addEventListener("open",R),_.connection.addEventListener("message",function(A){var H=A.data;_.transportRequestManager.resolveResponse(H)})})},w.prototype.sendData=function(_,C){return C===void 0&&(C=5e3),i(this,void 0,void 0,function(){var E,R,A;return a(this,function(H){E=this.transportRequestManager.addRequest(_,C),R=p.getNotifications(_);try{this.connection.send(JSON.stringify(this.parseData(_))),this.transportRequestManager.settlePendingRequest(R)}catch(V){A=new h.JSONRPCError(V.message,h.ERR_UNKNOWN,V),this.transportRequestManager.settlePendingRequest(R,A),this.transportRequestManager.settlePendingRequest(p.getBatchRequests(_),A),E=Promise.reject(A)}return[2,E]})})},w.prototype.close=function(){this.connection.close()},w})(d.Transport)})),$0=ke((e=>{var n=e&&e.__extends||(function(){var p=function(h,v){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,_){w.__proto__=_}||function(w,_){for(var C in _)_.hasOwnProperty(C)&&(w[C]=_[C])},p(h,v)};return function(h,v){p(h,v);function w(){this.constructor=h}h.prototype=v===null?Object.create(v):(w.prototype=v.prototype,new w)}})(),i=e&&e.__awaiter||function(p,h,v,w){function _(C){return C instanceof v?C:new v(function(E){E(C)})}return new(v||(v=Promise))(function(C,E){function R(V){try{H(w.next(V))}catch(U){E(U)}}function A(V){try{H(w.throw(V))}catch(U){E(U)}}function H(V){V.done?C(V.value):_(V.value).then(R,A)}H((w=w.apply(p,h||[])).next())})},a=e&&e.__generator||function(p,h){var v={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},w,_,C,E;return E={next:R(0),throw:R(1),return:R(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function R(H){return function(V){return A([H,V])}}function A(H){if(w)throw TypeError("Generator is already executing.");for(;v;)try{if(w=1,_&&(C=H[0]&2?_.return:H[0]?_.throw||((C=_.return)&&C.call(_),0):_.next)&&!(C=C.call(_,H[1])).done)return C;switch(_=0,C&&(H=[H[0]&2,C.value]),H[0]){case 0:case 1:C=H;break;case 4:return v.label++,{value:H[1],done:!1};case 5:v.label++,_=H[1],H=[0];continue;case 7:H=v.ops.pop(),v.trys.pop();continue;default:if(C=v.trys,!(C=C.length>0&&C[C.length-1])&&(H[0]===6||H[0]===2)){v=0;continue}if(H[0]===3&&(!C||H[1]>C[0]&&H[1]<C[3])){v.label=H[1];break}if(H[0]===6&&v.label<C[1]){v.label=C[1],C=H;break}if(C&&v.label<C[2]){v.label=C[2],v.ops.push(H);break}C[2]&&v.ops.pop(),v.trys.pop();continue}H=h.call(p,v)}catch(V){H=[6,V],_=0}finally{w=C=0}if(H[0]&5)throw H[1];return{value:H[0]?H[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=go(),c=wa(),d=function(p){var h=400,v=window.screen.height;return window.open(p,"inspector:popup","left=0,top=0,width="+h+",height="+v+",resizable,scrollbars=yes,status=1")};e.default=(function(p){n(h,p);function h(v){var w=p.call(this)||this;return w.messageHandler=function(_){w.transportRequestManager.resolveResponse(JSON.stringify(_.data))},w.uri=v,w.postMessageID="post-message-transport-"+Math.random(),w}return h.prototype.createWindow=function(v){return new Promise(function(w,_){var C=d(v);setTimeout(function(){w(C)},3e3)})},h.prototype.connect=function(){var v=this,w=/^(http|https):\/\/.*$/;return new Promise(function(_,C){return i(v,void 0,void 0,function(){var E;return a(this,function(R){switch(R.label){case 0:return w.test(this.uri)||C(Error("Bad URI")),E=this,[4,this.createWindow(this.uri)];case 1:return E.frame=R.sent(),window.addEventListener("message",this.messageHandler),_(),[2]}})})})},h.prototype.sendData=function(v,w){return w===void 0&&(w=5e3),i(this,void 0,void 0,function(){var _,C;return a(this,function(E){return _=this.transportRequestManager.addRequest(v,null),C=c.getNotifications(v),this.frame&&(this.frame.postMessage(v.request,this.uri),this.transportRequestManager.settlePendingRequest(C)),[2,_]})})},h.prototype.close=function(){this.frame&&(window.removeEventListener("message",this.messageHandler),this.frame.close())},h})(s.Transport)})),W0=ke((e=>{var n=e&&e.__extends||(function(){var d=function(p,h){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,w){v.__proto__=w}||function(v,w){for(var _ in w)w.hasOwnProperty(_)&&(v[_]=w[_])},d(p,h)};return function(p,h){d(p,h);function v(){this.constructor=p}p.prototype=h===null?Object.create(h):(v.prototype=h.prototype,new v)}})(),i=e&&e.__awaiter||function(d,p,h,v){function w(_){return _ instanceof h?_:new h(function(C){C(_)})}return new(h||(h=Promise))(function(_,C){function E(H){try{A(v.next(H))}catch(V){C(V)}}function R(H){try{A(v.throw(H))}catch(V){C(V)}}function A(H){H.done?_(H.value):w(H.value).then(E,R)}A((v=v.apply(d,p||[])).next())})},a=e&&e.__generator||function(d,p){var h={label:0,sent:function(){if(_[0]&1)throw _[1];return _[1]},trys:[],ops:[]},v,w,_,C;return C={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function E(A){return function(H){return R([A,H])}}function R(A){if(v)throw TypeError("Generator is already executing.");for(;h;)try{if(v=1,w&&(_=A[0]&2?w.return:A[0]?w.throw||((_=w.return)&&_.call(w),0):w.next)&&!(_=_.call(w,A[1])).done)return _;switch(w=0,_&&(A=[A[0]&2,_.value]),A[0]){case 0:case 1:_=A;break;case 4:return h.label++,{value:A[1],done:!1};case 5:h.label++,w=A[1],A=[0];continue;case 7:A=h.ops.pop(),h.trys.pop();continue;default:if(_=h.trys,!(_=_.length>0&&_[_.length-1])&&(A[0]===6||A[0]===2)){h=0;continue}if(A[0]===3&&(!_||A[1]>_[0]&&A[1]<_[3])){h.label=A[1];break}if(A[0]===6&&h.label<_[1]){h.label=_[1],_=A;break}if(_&&h.label<_[2]){h.label=_[2],h.ops.push(A);break}_[2]&&h.ops.pop(),h.trys.pop();continue}A=p.call(d,h)}catch(H){A=[6,H],w=0}finally{v=_=0}if(A[0]&5)throw A[1];return{value:A[0]?A[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0});var s=go(),c=wa();e.default=(function(d){n(p,d);function p(h){var v=d.call(this)||this;return v.messageHandler=function(w){v.transportRequestManager.resolveResponse(JSON.stringify(w.data))},v.uri=h,v.postMessageID="post-message-transport-"+Math.random(),v}return p.prototype.createWindow=function(h){var v=this;return new Promise(function(w,_){var C,E=document.createElement("iframe");E.setAttribute("id",v.postMessageID),E.setAttribute("width","0px"),E.setAttribute("height","0px"),E.setAttribute("style","visiblity:hidden;border:none;outline:none;"),E.addEventListener("load",function(){w(C)}),E.setAttribute("src",h),window.document.body.appendChild(E),C=E.contentWindow})},p.prototype.connect=function(){var h=this,v=/^(http|https):\/\/.*$/;return new Promise(function(w,_){return i(h,void 0,void 0,function(){var C;return a(this,function(E){switch(E.label){case 0:return v.test(this.uri)||_(Error("Bad URI")),C=this,[4,this.createWindow(this.uri)];case 1:return C.frame=E.sent(),window.addEventListener("message",this.messageHandler),w(),[2]}})})})},p.prototype.sendData=function(h,v){return v===void 0&&(v=5e3),i(this,void 0,void 0,function(){var w,_;return a(this,function(C){return w=this.transportRequestManager.addRequest(h,null),_=c.getNotifications(h),this.frame&&(this.frame.postMessage(h.request,"*"),this.transportRequestManager.settlePendingRequest(_)),[2,w]})})},p.prototype.close=function(){var h;(h=document.getElementById(this.postMessageID))==null||h.remove(),window.removeEventListener("message",this.messageHandler)},p})(s.Transport)})),U0=ke((e=>{var n=e&&e.__awaiter||function(a,s,c,d){function p(h){return h instanceof c?h:new c(function(v){v(h)})}return new(c||(c=Promise))(function(h,v){function w(E){try{C(d.next(E))}catch(R){v(R)}}function _(E){try{C(d.throw(E))}catch(R){v(R)}}function C(E){E.done?h(E.value):p(E.value).then(w,_)}C((d=d.apply(a,s||[])).next())})},i=e&&e.__generator||function(a,s){var c={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},d,p,h,v;return v={next:w(0),throw:w(1),return:w(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function w(C){return function(E){return _([C,E])}}function _(C){if(d)throw TypeError("Generator is already executing.");for(;c;)try{if(d=1,p&&(h=C[0]&2?p.return:C[0]?p.throw||((h=p.return)&&h.call(p),0):p.next)&&!(h=h.call(p,C[1])).done)return h;switch(p=0,h&&(C=[C[0]&2,h.value]),C[0]){case 0:case 1:h=C;break;case 4:return c.label++,{value:C[1],done:!1};case 5:c.label++,p=C[1],C=[0];continue;case 7:C=c.ops.pop(),c.trys.pop();continue;default:if(h=c.trys,!(h=h.length>0&&h[h.length-1])&&(C[0]===6||C[0]===2)){c=0;continue}if(C[0]===3&&(!h||C[1]>h[0]&&C[1]<h[3])){c.label=C[1];break}if(C[0]===6&&c.label<h[1]){c.label=h[1],h=C;break}if(h&&c.label<h[2]){c.label=h[2],c.ops.push(C);break}h[2]&&c.ops.pop(),c.trys.pop();continue}C=s.call(a,c)}catch(E){C=[6,E],p=0}finally{d=h=0}if(C[0]&5)throw C[1];return{value:C[0]?C[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=(function(){function a(s){this.requestManager=s}return a.prototype.startBatch=function(){return this.requestManager.startBatch()},a.prototype.stopBatch=function(){return this.requestManager.stopBatch()},a.prototype.request=function(s,c){return n(this,void 0,void 0,function(){return i(this,function(d){switch(d.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:d.sent(),d.label=2;case 2:return[2,this.requestManager.request(s,!1,c)]}})})},a.prototype.notify=function(s){return n(this,void 0,void 0,function(){return i(this,function(c){switch(c.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:c.sent(),c.label=2;case 2:return[2,this.requestManager.request(s,!0,null)]}})})},a.prototype.onNotification=function(s){this.requestManager.requestChannel.addListener("notification",s)},a.prototype.onError=function(s){this.requestManager.requestChannel.addListener("error",s)},a.prototype.close=function(){this.requestManager.close()},a})()})),Il=ke((e=>{var n=e&&e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.PostMessageIframeTransport=e.PostMessageWindowTransport=e.JSONRPCError=e.WebSocketTransport=e.EventEmitterTransport=e.HTTPTransport=e.RequestManager=e.Client=void 0,e.RequestManager=n(E0()).default,e.EventEmitterTransport=n(R0()).default,e.HTTPTransport=n(z0()).default,e.WebSocketTransport=n(V0()).default,e.PostMessageWindowTransport=n($0()).default,e.PostMessageIframeTransport=n(W0()).default;var i=ba();Object.defineProperty(e,"JSONRPCError",{enumerable:!0,get:function(){return i.JSONRPCError}});var a=n(U0());e.Client=a.default,e.default=a.default})),xa=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function n(h){return h===!0||h===!1}e.boolean=n;function i(h){return typeof h=="string"||h instanceof String}e.string=i;function a(h){return typeof h=="number"||h instanceof Number}e.number=a;function s(h){return h instanceof Error}e.error=s;function c(h){return typeof h=="function"}e.func=c;function d(h){return Array.isArray(h)}e.array=d;function p(h){return d(h)&&h.every(v=>i(v))}e.stringArray=p})),Od=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;var n=xa(),i;(function(d){d.ParseError=-32700,d.InvalidRequest=-32600,d.MethodNotFound=-32601,d.InvalidParams=-32602,d.InternalError=-32603,d.jsonrpcReservedErrorRangeStart=-32099,d.serverErrorStart=-32099,d.MessageWriteError=-32099,d.MessageReadError=-32098,d.PendingResponseRejected=-32097,d.ConnectionInactive=-32096,d.ServerNotInitialized=-32002,d.UnknownErrorCode=-32001,d.jsonrpcReservedErrorRangeEnd=-32e3,d.serverErrorEnd=-32e3})(i||(e.ErrorCodes=i={})),e.ResponseError=class r_ extends Error{constructor(p,h,v){super(h),this.code=n.number(p)?p:i.UnknownErrorCode,this.data=v,Object.setPrototypeOf(this,r_.prototype)}toJson(){let p={code:this.code,message:this.message};return this.data!==void 0&&(p.data=this.data),p}};var a=class Zu{constructor(p){this.kind=p}static is(p){return p===Zu.auto||p===Zu.byName||p===Zu.byPosition}toString(){return this.kind}};e.ParameterStructures=a,a.auto=new a("auto"),a.byPosition=new a("byPosition"),a.byName=new a("byName");var s=class{constructor(d,p){this.method=d,this.numberOfParams=p}get parameterStructures(){return a.auto}};e.AbstractMessageSignature=s,e.RequestType0=class extends s{constructor(d){super(d,0)}},e.RequestType=class extends s{constructor(d,p=a.auto){super(d,1),this._parameterStructures=p}get parameterStructures(){return this._parameterStructures}},e.RequestType1=class extends s{constructor(d,p=a.auto){super(d,1),this._parameterStructures=p}get parameterStructures(){return this._parameterStructures}},e.RequestType2=class extends s{constructor(d){super(d,2)}},e.RequestType3=class extends s{constructor(d){super(d,3)}},e.RequestType4=class extends s{constructor(d){super(d,4)}},e.RequestType5=class extends s{constructor(d){super(d,5)}},e.RequestType6=class extends s{constructor(d){super(d,6)}},e.RequestType7=class extends s{constructor(d){super(d,7)}},e.RequestType8=class extends s{constructor(d){super(d,8)}},e.RequestType9=class extends s{constructor(d){super(d,9)}},e.NotificationType=class extends s{constructor(d,p=a.auto){super(d,1),this._parameterStructures=p}get parameterStructures(){return this._parameterStructures}},e.NotificationType0=class extends s{constructor(d){super(d,0)}},e.NotificationType1=class extends s{constructor(d,p=a.auto){super(d,1),this._parameterStructures=p}get parameterStructures(){return this._parameterStructures}},e.NotificationType2=class extends s{constructor(d){super(d,2)}},e.NotificationType3=class extends s{constructor(d){super(d,3)}},e.NotificationType4=class extends s{constructor(d){super(d,4)}},e.NotificationType5=class extends s{constructor(d){super(d,5)}},e.NotificationType6=class extends s{constructor(d){super(d,6)}},e.NotificationType7=class extends s{constructor(d){super(d,7)}},e.NotificationType8=class extends s{constructor(d){super(d,8)}},e.NotificationType9=class extends s{constructor(d){super(d,9)}};var c;(function(d){function p(w){let _=w;return _&&n.string(_.method)&&(n.string(_.id)||n.number(_.id))}d.isRequest=p;function h(w){let _=w;return _&&n.string(_.method)&&w.id===void 0}d.isNotification=h;function v(w){let _=w;return _&&(_.result!==void 0||!!_.error)&&(n.string(_.id)||n.number(_.id)||_.id===null)}d.isResponse=v})(c||(e.Message=c={}))})),Pd=ke((e=>{var n;Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var i;(function(s){s.None=0,s.First=1,s.AsOld=s.First,s.Last=2,s.AsNew=s.Last})(i||(e.Touch=i={}));var a=class{constructor(){this[n]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var s;return(s=this._head)==null?void 0:s.value}get last(){var s;return(s=this._tail)==null?void 0:s.value}has(s){return this._map.has(s)}get(s,c=i.None){let d=this._map.get(s);if(d)return c!==i.None&&this.touch(d,c),d.value}set(s,c,d=i.None){let p=this._map.get(s);if(p)p.value=c,d!==i.None&&this.touch(p,d);else{switch(p={key:s,value:c,next:void 0,previous:void 0},d){case i.None:this.addItemLast(p);break;case i.First:this.addItemFirst(p);break;case i.Last:this.addItemLast(p);break;default:this.addItemLast(p);break}this._map.set(s,p),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){let c=this._map.get(s);if(c)return this._map.delete(s),this.removeItem(c),this._size--,c.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error("Invalid list");let s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,c){let d=this._state,p=this._head;for(;p;){if(c?s.bind(c)(p.value,p.key,this):s(p.value,p.key,this),this._state!==d)throw Error("LinkedMap got modified during iteration.");p=p.next}}keys(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let p={value:c.key,done:!1};return c=c.next,p}else return{value:void 0,done:!0}}};return d}values(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let p={value:c.value,done:!1};return c=c.next,p}else return{value:void 0,done:!0}}};return d}entries(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let p={value:[c.key,c.value],done:!1};return c=c.next,p}else return{value:void 0,done:!0}}};return d}[(n=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let c=this._head,d=this.size;for(;c&&d>s;)this._map.delete(c.key),c=c.next,d--;this._head=c,this._size=d,c&&(c.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{let c=s.next,d=s.previous;if(!c||!d)throw Error("Invalid list");c.previous=d,d.next=c}s.next=void 0,s.previous=void 0,this._state++}touch(s,c){if(!this._head||!this._tail)throw Error("Invalid list");if(!(c!==i.First&&c!==i.Last)){if(c===i.First){if(s===this._head)return;let d=s.next,p=s.previous;s===this._tail?(p.next=void 0,this._tail=p):(d.previous=p,p.next=d),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(c===i.Last){if(s===this._tail)return;let d=s.next,p=s.previous;s===this._head?(d.previous=void 0,this._head=d):(d.previous=p,p.next=d),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){let s=[];return this.forEach((c,d)=>{s.push([d,c])}),s}fromJSON(s){this.clear();for(let[c,d]of s)this.set(c,d)}};e.LinkedMap=a,e.LRUCache=class extends a{constructor(s,c=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,c),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,c=i.AsNew){return super.get(s,c)}peek(s){return super.get(s,i.None)}set(s,c){return super.set(s,c,i.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}})),K0=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Disposable=void 0;var n;(function(i){function a(s){return{dispose:s}}i.create=a})(n||(e.Disposable=n={}))})),Ai=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n;function i(){if(n===void 0)throw Error("No runtime abstraction layer installed");return n}(function(a){function s(c){if(c===void 0)throw Error("No runtime abstraction layer provided");n=c}a.install=s})(i||(i={})),e.default=i})),ka=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;var n=Ai(),i;(function(c){let d={dispose(){}};c.None=function(){return d}})(i||(e.Event=i={}));var a=class{add(c,d=null,p){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(c),this._contexts.push(d),Array.isArray(p)&&p.push({dispose:()=>this.remove(c,d)})}remove(c,d=null){if(!this._callbacks)return;let p=!1;for(let h=0,v=this._callbacks.length;h<v;h++)if(this._callbacks[h]===c)if(this._contexts[h]===d){this._callbacks.splice(h,1),this._contexts.splice(h,1);return}else p=!0;if(p)throw Error("When adding a listener with a context, you should remove it with the same context")}invoke(...c){if(!this._callbacks)return[];let d=[],p=this._callbacks.slice(0),h=this._contexts.slice(0);for(let v=0,w=p.length;v<w;v++)try{d.push(p[v].apply(h[v],c))}catch(_){(0,n.default)().console.error(_)}return d}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},s=class i_{constructor(d){this._options=d}get event(){return this._event||(this._event=(d,p,h)=>{this._callbacks||(this._callbacks=new a),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(d,p);let v={dispose:()=>{this._callbacks&&(this._callbacks.remove(d,p),v.dispose=i_._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(h)&&h.push(v),v}),this._event}fire(d){this._callbacks&&this._callbacks.invoke.call(this._callbacks,d)}dispose(){this._callbacks&&(this._callbacks=(this._callbacks.dispose(),void 0))}};e.Emitter=s,s._noop=function(){}})),Hl=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;var n=Ai(),i=xa(),a=ka(),s;(function(p){p.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:a.Event.None}),p.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:a.Event.None});function h(v){let w=v;return w&&(w===p.None||w===p.Cancelled||i.boolean(w.isCancellationRequested)&&!!w.onCancellationRequested)}p.is=h})(s||(e.CancellationToken=s={}));var c=Object.freeze(function(p,h){let v=(0,n.default)().timer.setTimeout(p.bind(h),0);return{dispose(){v.dispose()}}}),d=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?c:(this._emitter||(this._emitter=new a.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter=(this._emitter.dispose(),void 0))}};e.CancellationTokenSource=class{get token(){return this._token||(this._token=new d),this._token}cancel(){this._token?this._token.cancel():this._token=s.Cancelled}dispose(){this._token?this._token instanceof d&&this._token.dispose():this._token=s.None}}})),Q0=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;var n=Hl(),i;(function(c){c.Continue=0,c.Cancelled=1})(i||(i={})),e.SharedArraySenderStrategy=class{constructor(){this.buffers=new Map}enableCancellation(c){if(c.id===null)return;let d=new SharedArrayBuffer(4),p=new Int32Array(d,0,1);p[0]=i.Continue,this.buffers.set(c.id,d),c.$cancellationData=d}async sendCancellation(c,d){let p=this.buffers.get(d);if(p===void 0)return;let h=new Int32Array(p,0,1);Atomics.store(h,0,i.Cancelled)}cleanup(c){this.buffers.delete(c)}dispose(){this.buffers.clear()}};var a=class{constructor(c){this.data=new Int32Array(c,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===i.Cancelled}get onCancellationRequested(){throw Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},s=class{constructor(c){this.token=new a(c)}cancel(){}dispose(){}};e.SharedArrayReceiverStrategy=class{constructor(){this.kind="request"}createCancellationTokenSource(c){let d=c.$cancellationData;return d===void 0?new n.CancellationTokenSource:new s(d)}}})),Nd=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;var n=Ai();e.Semaphore=class{constructor(i=1){if(i<=0)throw Error("Capacity must be greater than 0");this._capacity=i,this._active=0,this._waiting=[]}lock(i){return new Promise((a,s)=>{this._waiting.push({thunk:i,resolve:a,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,n.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let i=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error("To many thunks active");try{let a=i.thunk();a instanceof Promise?a.then(s=>{this._active--,i.resolve(s),this.runNext()},s=>{this._active--,i.reject(s),this.runNext()}):(this._active--,i.resolve(a),this.runNext())}catch(a){this._active--,i.reject(a),this.runNext()}}}})),G0=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;var n=Ai(),i=xa(),a=ka(),s=Nd(),c;(function(h){function v(w){let _=w;return _&&i.func(_.listen)&&i.func(_.dispose)&&i.func(_.onError)&&i.func(_.onClose)&&i.func(_.onPartialMessage)}h.is=v})(c||(e.MessageReader=c={}));var d=class{constructor(){this.errorEmitter=new a.Emitter,this.closeEmitter=new a.Emitter,this.partialMessageEmitter=new a.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(h){this.errorEmitter.fire(this.asError(h))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(h){this.partialMessageEmitter.fire(h)}asError(h){return h instanceof Error?h:Error(`Reader received error. Reason: ${i.string(h.message)?h.message:"unknown"}`)}};e.AbstractMessageReader=d;var p;(function(h){function v(w){let _,C,E=new Map,R,A=new Map;if(w===void 0||typeof w=="string")_=w??"utf-8";else{if(_=w.charset??"utf-8",w.contentDecoder!==void 0&&(C=w.contentDecoder,E.set(C.name,C)),w.contentDecoders!==void 0)for(let H of w.contentDecoders)E.set(H.name,H);if(w.contentTypeDecoder!==void 0&&(R=w.contentTypeDecoder,A.set(R.name,R)),w.contentTypeDecoders!==void 0)for(let H of w.contentTypeDecoders)A.set(H.name,H)}return R===void 0&&(R=(0,n.default)().applicationJson.decoder,A.set(R.name,R)),{charset:_,contentDecoder:C,contentDecoders:E,contentTypeDecoder:R,contentTypeDecoders:A}}h.fromOptions=v})(p||(p={})),e.ReadableStreamMessageReader=class extends d{constructor(h,v){super(),this.readable=h,this.options=p.fromOptions(v),this.buffer=(0,n.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new s.Semaphore(1)}set partialMessageTimeout(h){this._partialMessageTimeout=h}get partialMessageTimeout(){return this._partialMessageTimeout}listen(h){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=h;let v=this.readable.onData(w=>{this.onData(w)});return this.readable.onError(w=>this.fireError(w)),this.readable.onClose(()=>this.fireClose()),v}onData(h){try{for(this.buffer.append(h);;){if(this.nextMessageLength===-1){let w=this.buffer.tryReadHeaders(!0);if(!w)return;let _=w.get("content-length");if(!_){this.fireError(Error(`Header must provide a Content-Length property.
80
+ ${JSON.stringify(Object.fromEntries(w))}`));return}let C=parseInt(_);if(isNaN(C)){this.fireError(Error(`Content-Length value must be a number. Got ${_}`));return}this.nextMessageLength=C}let v=this.buffer.tryReadBody(this.nextMessageLength);if(v===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let w=this.options.contentDecoder===void 0?v:await this.options.contentDecoder.decode(v),_=await this.options.contentTypeDecoder.decode(w,this.options);this.callback(_)}).catch(w=>{this.fireError(w)})}}catch(v){this.fireError(v)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer=(this.partialMessageTimer.dispose(),void 0))}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,n.default)().timer.setTimeout((h,v)=>{this.partialMessageTimer=void 0,h===this.messageToken&&(this.firePartialMessage({messageToken:h,waitingTime:v}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}})),J0=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;var n=Ai(),i=xa(),a=Nd(),s=ka(),c="Content-Length: ",d=`\r
81
+ `,p;(function(w){function _(C){let E=C;return E&&i.func(E.dispose)&&i.func(E.onClose)&&i.func(E.onError)&&i.func(E.write)}w.is=_})(p||(e.MessageWriter=p={}));var h=class{constructor(){this.errorEmitter=new s.Emitter,this.closeEmitter=new s.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(w,_,C){this.errorEmitter.fire([this.asError(w),_,C])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(w){return w instanceof Error?w:Error(`Writer received error. Reason: ${i.string(w.message)?w.message:"unknown"}`)}};e.AbstractMessageWriter=h;var v;(function(w){function _(C){return C===void 0||typeof C=="string"?{charset:C??"utf-8",contentTypeEncoder:(0,n.default)().applicationJson.encoder}:{charset:C.charset??"utf-8",contentEncoder:C.contentEncoder,contentTypeEncoder:C.contentTypeEncoder??(0,n.default)().applicationJson.encoder}}w.fromOptions=_})(v||(v={})),e.WriteableStreamMessageWriter=class extends h{constructor(w,_){super(),this.writable=w,this.options=v.fromOptions(_),this.errorCount=0,this.writeSemaphore=new a.Semaphore(1),this.writable.onError(C=>this.fireError(C)),this.writable.onClose(()=>this.fireClose())}async write(w){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(w,this.options).then(_=>this.options.contentEncoder===void 0?_:this.options.contentEncoder.encode(_)).then(_=>{let C=[];return C.push(c,_.byteLength.toString(),d),C.push(d),this.doWrite(w,C,_)},_=>{throw this.fireError(_),_}))}async doWrite(w,_,C){try{return await this.writable.write(_.join(""),"ascii"),this.writable.write(C)}catch(E){return this.handleError(E,w),Promise.reject(E)}}handleError(w,_){this.errorCount++,this.fireError(w,_,this.errorCount)}end(){this.writable.end()}}})),X0=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractMessageBuffer=void 0;var n=13,i=10,a=`\r
82
+ `;e.AbstractMessageBuffer=class{constructor(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){let c=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(c),this._totalLength+=c.byteLength}tryReadHeaders(s=!1){if(this._chunks.length===0)return;let c=0,d=0,p=0,h=0;e:for(;d<this._chunks.length;){let C=this._chunks[d];for(p=0;p<C.length;){switch(C[p]){case n:switch(c){case 0:c=1;break;case 2:c=3;break;default:c=0}break;case i:switch(c){case 1:c=2;break;case 3:c=4,p++;break e;default:c=0}break;default:c=0}p++}h+=C.byteLength,d++}if(c!==4)return;let v=this._read(h+p),w=new Map,_=this.toString(v,"ascii").split(a);if(_.length<2)return w;for(let C=0;C<_.length-2;C++){let E=_[C],R=E.indexOf(":");if(R===-1)throw Error(`Message header must separate key and value using ':'
83
+ ${E}`);let A=E.substr(0,R),H=E.substr(R+1).trim();w.set(s?A.toLowerCase():A,H)}return w}tryReadBody(s){if(!(this._totalLength<s))return this._read(s)}get numberOfBytes(){return this._totalLength}_read(s){if(s===0)return this.emptyBuffer();if(s>this._totalLength)throw Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){let p=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(p)}if(this._chunks[0].byteLength>s){let p=this._chunks[0],h=this.asNative(p,s);return this._chunks[0]=p.slice(s),this._totalLength-=s,h}let c=this.allocNative(s),d=0;for(;s>0;){let p=this._chunks[0];if(p.byteLength>s){let h=p.slice(0,s);c.set(h,d),d+=s,this._chunks[0]=p.slice(s),this._totalLength-=s,s-=s}else c.set(p,d),d+=p.byteLength,this._chunks.shift(),this._totalLength-=p.byteLength,s-=p.byteLength}return c}}})),Y0=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;var n=Ai(),i=xa(),a=Od(),s=Pd(),c=ka(),d=Hl(),p;(function(te){te.type=new a.NotificationType("$/cancelRequest")})(p||(p={}));var h;(function(te){function be(Se){return typeof Se=="string"||typeof Se=="number"}te.is=be})(h||(e.ProgressToken=h={}));var v;(function(te){te.type=new a.NotificationType("$/progress")})(v||(v={})),e.ProgressType=class{constructor(){}};var w;(function(te){function be(Se){return i.func(Se)}te.is=be})(w||(w={})),e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var _;(function(te){te[te.Off=0]="Off",te[te.Messages=1]="Messages",te[te.Compact=2]="Compact",te[te.Verbose=3]="Verbose"})(_||(e.Trace=_={}));var C;(function(te){te.Off="off",te.Messages="messages",te.Compact="compact",te.Verbose="verbose"})(C||(e.TraceValues=C={})),(function(te){function be(ie){if(!i.string(ie))return te.Off;switch(ie=ie.toLowerCase(),ie){case"off":return te.Off;case"messages":return te.Messages;case"compact":return te.Compact;case"verbose":return te.Verbose;default:return te.Off}}te.fromString=be;function Se(ie){switch(ie){case te.Off:return"off";case te.Messages:return"messages";case te.Compact:return"compact";case te.Verbose:return"verbose";default:return"off"}}te.toString=Se})(_||(e.Trace=_={}));var E;(function(te){te.Text="text",te.JSON="json"})(E||(e.TraceFormat=E={})),(function(te){function be(Se){return i.string(Se)?(Se=Se.toLowerCase(),Se==="json"?te.JSON:te.Text):te.Text}te.fromString=be})(E||(e.TraceFormat=E={}));var R;(function(te){te.type=new a.NotificationType("$/setTrace")})(R||(e.SetTraceNotification=R={}));var A;(function(te){te.type=new a.NotificationType("$/logTrace")})(A||(e.LogTraceNotification=A={}));var H;(function(te){te[te.Closed=1]="Closed",te[te.Disposed=2]="Disposed",te[te.AlreadyListening=3]="AlreadyListening"})(H||(e.ConnectionErrors=H={}));var V=class o_ extends Error{constructor(be,Se){super(Se),this.code=be,Object.setPrototypeOf(this,o_.prototype)}};e.ConnectionError=V;var U;(function(te){function be(Se){let ie=Se;return ie&&i.func(ie.cancelUndispatched)}te.is=be})(U||(e.ConnectionStrategy=U={}));var L;(function(te){function be(Se){let ie=Se;return ie&&(ie.kind===void 0||ie.kind==="id")&&i.func(ie.createCancellationTokenSource)&&(ie.dispose===void 0||i.func(ie.dispose))}te.is=be})(L||(e.IdCancellationReceiverStrategy=L={}));var G;(function(te){function be(Se){let ie=Se;return ie&&ie.kind==="request"&&i.func(ie.createCancellationTokenSource)&&(ie.dispose===void 0||i.func(ie.dispose))}te.is=be})(G||(e.RequestCancellationReceiverStrategy=G={}));var he;(function(te){te.Message=Object.freeze({createCancellationTokenSource(Se){return new d.CancellationTokenSource}});function be(Se){return L.is(Se)||G.is(Se)}te.is=be})(he||(e.CancellationReceiverStrategy=he={}));var N;(function(te){te.Message=Object.freeze({sendCancellation(Se,ie){return Se.sendNotification(p.type,{id:ie})},cleanup(Se){}});function be(Se){let ie=Se;return ie&&i.func(ie.sendCancellation)&&i.func(ie.cleanup)}te.is=be})(N||(e.CancellationSenderStrategy=N={}));var I;(function(te){te.Message=Object.freeze({receiver:he.Message,sender:N.Message});function be(Se){let ie=Se;return ie&&he.is(ie.receiver)&&N.is(ie.sender)}te.is=be})(I||(e.CancellationStrategy=I={}));var $;(function(te){function be(Se){let ie=Se;return ie&&i.func(ie.handleMessage)}te.is=be})($||(e.MessageStrategy=$={}));var de;(function(te){function be(Se){let ie=Se;return ie&&(I.is(ie.cancellationStrategy)||U.is(ie.connectionStrategy)||$.is(ie.messageStrategy))}te.is=be})(de||(e.ConnectionOptions=de={}));var fe;(function(te){te[te.New=1]="New",te[te.Listening=2]="Listening",te[te.Closed=3]="Closed",te[te.Disposed=4]="Disposed"})(fe||(fe={}));function xe(te,be,Se,ie){let X=Se===void 0?e.NullLogger:Se,Q=0,K=0,Ne=0,Qe,ut=new Map,Be,We=new Map,Re=new Map,Me,hn=new s.LinkedMap,It=new Map,Dn=new Set,sn=new Map,Ue=_.Off,tn=E.Text,gt,gn=fe.New,Xn=new c.Emitter,kt=new c.Emitter,ai=new c.Emitter,yn=new c.Emitter,vn=new c.Emitter,Ln=ie&&ie.cancellationStrategy?ie.cancellationStrategy:I.Message;function Pr(q){if(q===null)throw Error("Can't send requests with id null since the response can't be correlated.");return"req-"+q.toString()}function An(q){return q===null?"res-unknown-"+(++Ne).toString():"res-"+q.toString()}function nn(){return"not-"+(++K).toString()}function Fi(q,ne){a.Message.isRequest(ne)?q.set(Pr(ne.id),ne):a.Message.isResponse(ne)?q.set(An(ne.id),ne):q.set(nn(),ne)}function $r(q){}function Nr(){return gn===fe.Listening}function si(){return gn===fe.Closed}function Ht(){return gn===fe.Disposed}function Qt(){(gn===fe.New||gn===fe.Listening)&&(gn=fe.Closed,kt.fire(void 0))}function yt(q){Xn.fire([q,void 0,void 0])}function Ft(q){Xn.fire(q)}te.onClose(Qt),te.onError(yt),be.onClose(Qt),be.onError(Ft);function Ct(){Me||hn.size===0||(Me=(0,n.default)().timer.setImmediate(()=>{Me=void 0,Bi()}))}function li(q){a.Message.isRequest(q)?dr(q):a.Message.isNotification(q)?Vt(q):a.Message.isResponse(q)?Ge(q):st(q)}function Bi(){if(hn.size===0)return;let q=hn.shift();try{let ne=ie==null?void 0:ie.messageStrategy;$.is(ne)?ne.handleMessage(q,li):li(q)}finally{Ct()}}let Mr=q=>{try{if(a.Message.isNotification(q)&&q.method===p.type.method){let ne=q.params.id,ye=Pr(ne),Ce=hn.get(ye);if(a.Message.isRequest(Ce)){let tt=ie==null?void 0:ie.connectionStrategy,it=tt&&tt.cancelUndispatched?tt.cancelUndispatched(Ce,$r):void 0;if(it&&(it.error!==void 0||it.result!==void 0)){hn.delete(ye),sn.delete(ne),it.id=Ce.id,St(it,q.method,Date.now()),be.write(it).catch(()=>X.error("Sending response for canceled message failed."));return}}let pt=sn.get(ne);if(pt!==void 0){pt.cancel(),Ur(q);return}else Dn.add(ne)}Fi(hn,q)}finally{Ct()}};function dr(q){if(Ht())return;function ne($e,He,ot){let ht={jsonrpc:"2.0",id:q.id};$e instanceof a.ResponseError?ht.error=$e.toJson():ht.result=$e===void 0?null:$e,St(ht,He,ot),be.write(ht).catch(()=>X.error("Sending response failed."))}function ye($e,He,ot){let ht={jsonrpc:"2.0",id:q.id,error:$e.toJson()};St(ht,He,ot),be.write(ht).catch(()=>X.error("Sending response failed."))}function Ce($e,He,ot){$e===void 0&&($e=null);let ht={jsonrpc:"2.0",id:q.id,result:$e};St(ht,He,ot),be.write(ht).catch(()=>X.error("Sending response failed."))}Yn(q);let pt=ut.get(q.method),tt,it;pt&&(tt=pt.type,it=pt.handler);let wt=Date.now();if(it||Qe){let $e=q.id??String(Date.now()),He=L.is(Ln.receiver)?Ln.receiver.createCancellationTokenSource($e):Ln.receiver.createCancellationTokenSource(q);q.id!==null&&Dn.has(q.id)&&He.cancel(),q.id!==null&&sn.set($e,He);try{let ot;if(it)if(q.params===void 0){if(tt!==void 0&&tt.numberOfParams!==0){ye(new a.ResponseError(a.ErrorCodes.InvalidParams,`Request ${q.method} defines ${tt.numberOfParams} params but received none.`),q.method,wt);return}ot=it(He.token)}else if(Array.isArray(q.params)){if(tt!==void 0&&tt.parameterStructures===a.ParameterStructures.byName){ye(new a.ResponseError(a.ErrorCodes.InvalidParams,`Request ${q.method} defines parameters by name but received parameters by position`),q.method,wt);return}ot=it(...q.params,He.token)}else{if(tt!==void 0&&tt.parameterStructures===a.ParameterStructures.byPosition){ye(new a.ResponseError(a.ErrorCodes.InvalidParams,`Request ${q.method} defines parameters by position but received parameters by name`),q.method,wt);return}ot=it(q.params,He.token)}else Qe&&(ot=Qe(q.method,q.params,He.token));let ht=ot;ot?ht.then?ht.then($t=>{sn.delete($e),ne($t,q.method,wt)},$t=>{sn.delete($e),$t instanceof a.ResponseError?ye($t,q.method,wt):$t&&i.string($t.message)?ye(new a.ResponseError(a.ErrorCodes.InternalError,`Request ${q.method} failed with message: ${$t.message}`),q.method,wt):ye(new a.ResponseError(a.ErrorCodes.InternalError,`Request ${q.method} failed unexpectedly without providing any details.`),q.method,wt)}):(sn.delete($e),ne(ot,q.method,wt)):(sn.delete($e),Ce(ot,q.method,wt))}catch(ot){sn.delete($e),ot instanceof a.ResponseError?ne(ot,q.method,wt):ot&&i.string(ot.message)?ye(new a.ResponseError(a.ErrorCodes.InternalError,`Request ${q.method} failed with message: ${ot.message}`),q.method,wt):ye(new a.ResponseError(a.ErrorCodes.InternalError,`Request ${q.method} failed unexpectedly without providing any details.`),q.method,wt)}}else ye(new a.ResponseError(a.ErrorCodes.MethodNotFound,`Unhandled method ${q.method}`),q.method,wt)}function Ge(q){if(!Ht())if(q.id===null)q.error?X.error(`Received response message without id: Error is:
84
+ ${JSON.stringify(q.error,void 0,4)}`):X.error("Received response message without id. No further error information provided.");else{let ne=q.id,ye=It.get(ne);if(ci(q,ye),ye!==void 0){It.delete(ne);try{if(q.error){let Ce=q.error;ye.reject(new a.ResponseError(Ce.code,Ce.message,Ce.data))}else if(q.result!==void 0)ye.resolve(q.result);else throw Error("Should never happen.")}catch(Ce){Ce.message?X.error(`Response handler '${ye.method}' failed with message: ${Ce.message}`):X.error(`Response handler '${ye.method}' failed unexpectedly.`)}}}}function Vt(q){if(Ht())return;let ne,ye;if(q.method===p.type.method){let Ce=q.params.id;Dn.delete(Ce),Ur(q);return}else{let Ce=We.get(q.method);Ce&&(ye=Ce.handler,ne=Ce.type)}if(ye||Be)try{if(Ur(q),ye)if(q.params===void 0)ne!==void 0&&ne.numberOfParams!==0&&ne.parameterStructures!==a.ParameterStructures.byName&&X.error(`Notification ${q.method} defines ${ne.numberOfParams} params but received none.`),ye();else if(Array.isArray(q.params)){let Ce=q.params;q.method===v.type.method&&Ce.length===2&&h.is(Ce[0])?ye({token:Ce[0],value:Ce[1]}):(ne!==void 0&&(ne.parameterStructures===a.ParameterStructures.byName&&X.error(`Notification ${q.method} defines parameters by name but received parameters by position`),ne.numberOfParams!==q.params.length&&X.error(`Notification ${q.method} defines ${ne.numberOfParams} params but received ${Ce.length} arguments`)),ye(...Ce))}else ne!==void 0&&ne.parameterStructures===a.ParameterStructures.byPosition&&X.error(`Notification ${q.method} defines parameters by position but received parameters by name`),ye(q.params);else Be&&Be(q.method,q.params)}catch(Ce){Ce.message?X.error(`Notification handler '${q.method}' failed with message: ${Ce.message}`):X.error(`Notification handler '${q.method}' failed unexpectedly.`)}else ai.fire(q)}function st(q){if(!q){X.error("Received empty message.");return}X.error(`Received message which is neither a response nor a notification message:
85
+ ${JSON.stringify(q,null,4)}`);let ne=q;if(i.string(ne.id)||i.number(ne.id)){let ye=ne.id,Ce=It.get(ye);Ce&&Ce.reject(Error("The received response has neither a result nor an error property."))}}function vt(q){if(q!=null)switch(Ue){case _.Verbose:return JSON.stringify(q,null,4);case _.Compact:return JSON.stringify(q);default:return}}function On(q){if(!(Ue===_.Off||!gt))if(tn===E.Text){let ne;(Ue===_.Verbose||Ue===_.Compact)&&q.params&&(ne=`Params: ${vt(q.params)}
86
+
87
+ `),gt.log(`Sending request '${q.method} - (${q.id})'.`,ne)}else In("send-request",q)}function Wr(q){if(!(Ue===_.Off||!gt))if(tn===E.Text){let ne;(Ue===_.Verbose||Ue===_.Compact)&&(ne=q.params?`Params: ${vt(q.params)}
88
+
89
+ `:`No parameters provided.
90
+
91
+ `),gt.log(`Sending notification '${q.method}'.`,ne)}else In("send-notification",q)}function St(q,ne,ye){if(!(Ue===_.Off||!gt))if(tn===E.Text){let Ce;(Ue===_.Verbose||Ue===_.Compact)&&(q.error&&q.error.data?Ce=`Error data: ${vt(q.error.data)}
92
+
93
+ `:q.result?Ce=`Result: ${vt(q.result)}
94
+
95
+ `:q.error===void 0&&(Ce=`No result returned.
96
+
97
+ `)),gt.log(`Sending response '${ne} - (${q.id})'. Processing request took ${Date.now()-ye}ms`,Ce)}else In("send-response",q)}function Yn(q){if(!(Ue===_.Off||!gt))if(tn===E.Text){let ne;(Ue===_.Verbose||Ue===_.Compact)&&q.params&&(ne=`Params: ${vt(q.params)}
98
+
99
+ `),gt.log(`Received request '${q.method} - (${q.id})'.`,ne)}else In("receive-request",q)}function Ur(q){if(!(Ue===_.Off||!gt||q.method===A.type.method))if(tn===E.Text){let ne;(Ue===_.Verbose||Ue===_.Compact)&&(ne=q.params?`Params: ${vt(q.params)}
100
+
101
+ `:`No parameters provided.
102
+
103
+ `),gt.log(`Received notification '${q.method}'.`,ne)}else In("receive-notification",q)}function ci(q,ne){if(!(Ue===_.Off||!gt))if(tn===E.Text){let ye;if((Ue===_.Verbose||Ue===_.Compact)&&(q.error&&q.error.data?ye=`Error data: ${vt(q.error.data)}
104
+
105
+ `:q.result?ye=`Result: ${vt(q.result)}
106
+
107
+ `:q.error===void 0&&(ye=`No result returned.
108
+
109
+ `)),ne){let Ce=q.error?` Request failed: ${q.error.message} (${q.error.code}).`:"";gt.log(`Received response '${ne.method} - (${q.id})' in ${Date.now()-ne.timerStart}ms.${Ce}`,ye)}else gt.log(`Received response ${q.id} without active response promise.`,ye)}else In("receive-response",q)}function In(q,ne){if(!gt||Ue===_.Off)return;let ye={isLSPMessage:!0,type:q,message:ne,timestamp:Date.now()};gt.log(ye)}function Bn(){if(si())throw new V(H.Closed,"Connection is closed.");if(Ht())throw new V(H.Disposed,"Connection is disposed.")}function Kr(){if(Nr())throw new V(H.AlreadyListening,"Connection is already listening")}function ui(){if(!Nr())throw Error("Call listen() first.")}function Zn(q){return q===void 0?null:q}function Pn(q){if(q!==null)return q}function bt(q){return q!=null&&!Array.isArray(q)&&typeof q=="object"}function jt(q,ne){switch(q){case a.ParameterStructures.auto:return bt(ne)?Pn(ne):[Zn(ne)];case a.ParameterStructures.byName:if(!bt(ne))throw Error("Received parameters by name but param is not an object literal.");return Pn(ne);case a.ParameterStructures.byPosition:return[Zn(ne)];default:throw Error(`Unknown parameter structure ${q.toString()}`)}}function P(q,ne){let ye,Ce=q.numberOfParams;switch(Ce){case 0:ye=void 0;break;case 1:ye=jt(q.parameterStructures,ne[0]);break;default:ye=[];for(let pt=0;pt<ne.length&&pt<Ce;pt++)ye.push(Zn(ne[pt]));if(ne.length<Ce)for(let pt=ne.length;pt<Ce;pt++)ye.push(null);break}return ye}let Je={sendNotification:(q,...ne)=>{Bn();let ye,Ce;if(i.string(q)){ye=q;let tt=ne[0],it=0,wt=a.ParameterStructures.auto;a.ParameterStructures.is(tt)&&(it=1,wt=tt);let $e=ne.length,He=$e-it;switch(He){case 0:Ce=void 0;break;case 1:Ce=jt(wt,ne[it]);break;default:if(wt===a.ParameterStructures.byName)throw Error(`Received ${He} parameters for 'by Name' notification parameter structure.`);Ce=ne.slice(it,$e).map(ot=>Zn(ot));break}}else{let tt=ne;ye=q.method,Ce=P(q,tt)}let pt={jsonrpc:"2.0",method:ye,params:Ce};return Wr(pt),be.write(pt).catch(tt=>{throw X.error("Sending notification failed."),tt})},onNotification:(q,ne)=>{Bn();let ye;return i.func(q)?Be=q:ne&&(i.string(q)?(ye=q,We.set(q,{type:void 0,handler:ne})):(ye=q.method,We.set(q.method,{type:q,handler:ne}))),{dispose:()=>{ye===void 0?Be=void 0:We.delete(ye)}}},onProgress:(q,ne,ye)=>{if(Re.has(ne))throw Error(`Progress handler for token ${ne} already registered`);return Re.set(ne,ye),{dispose:()=>{Re.delete(ne)}}},sendProgress:(q,ne,ye)=>Je.sendNotification(v.type,{token:ne,value:ye}),onUnhandledProgress:yn.event,sendRequest:(q,...ne)=>{Bn(),ui();let ye,Ce,pt;if(i.string(q)){ye=q;let $e=ne[0],He=ne[ne.length-1],ot=0,ht=a.ParameterStructures.auto;a.ParameterStructures.is($e)&&(ot=1,ht=$e);let $t=ne.length;d.CancellationToken.is(He)&&(--$t,pt=He);let er=$t-ot;switch(er){case 0:Ce=void 0;break;case 1:Ce=jt(ht,ne[ot]);break;default:if(ht===a.ParameterStructures.byName)throw Error(`Received ${er} parameters for 'by Name' request parameter structure.`);Ce=ne.slice(ot,$t).map(ws=>Zn(ws));break}}else{let $e=ne;ye=q.method,Ce=P(q,$e);let He=q.numberOfParams;pt=d.CancellationToken.is($e[He])?$e[He]:void 0}let tt=Q++,it;pt&&(it=pt.onCancellationRequested(()=>{let $e=Ln.sender.sendCancellation(Je,tt);return $e===void 0?(X.log(`Received no promise from cancellation strategy when cancelling id ${tt}`),Promise.resolve()):$e.catch(()=>{X.log(`Sending cancellation messages for id ${tt} failed`)})}));let wt={jsonrpc:"2.0",id:tt,method:ye,params:Ce};return On(wt),typeof Ln.sender.enableCancellation=="function"&&Ln.sender.enableCancellation(wt),new Promise(async($e,He)=>{let ot={method:ye,timerStart:Date.now(),resolve:ht=>{$e(ht),Ln.sender.cleanup(tt),it==null||it.dispose()},reject:ht=>{He(ht),Ln.sender.cleanup(tt),it==null||it.dispose()}};try{await be.write(wt),It.set(tt,ot)}catch(ht){throw X.error("Sending request failed."),ot.reject(new a.ResponseError(a.ErrorCodes.MessageWriteError,ht.message?ht.message:"Unknown reason")),ht}})},onRequest:(q,ne)=>{Bn();let ye=null;return w.is(q)?(ye=void 0,Qe=q):i.string(q)?(ye=null,ne!==void 0&&(ye=q,ut.set(q,{handler:ne,type:void 0}))):ne!==void 0&&(ye=q.method,ut.set(q.method,{type:q,handler:ne})),{dispose:()=>{ye!==null&&(ye===void 0?Qe=void 0:ut.delete(ye))}}},hasPendingResponse:()=>It.size>0,trace:async(q,ne,ye)=>{let Ce=!1,pt=E.Text;ye!==void 0&&(i.boolean(ye)?Ce=ye:(Ce=ye.sendNotification||!1,pt=ye.traceFormat||E.Text)),Ue=q,tn=pt,gt=Ue===_.Off?void 0:ne,Ce&&!si()&&!Ht()&&await Je.sendNotification(R.type,{value:_.toString(q)})},onError:Xn.event,onClose:kt.event,onUnhandledNotification:ai.event,onDispose:vn.event,end:()=>{be.end()},dispose:()=>{if(Ht())return;gn=fe.Disposed,vn.fire(void 0);let q=new a.ResponseError(a.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let ne of It.values())ne.reject(q);It=new Map,sn=new Map,Dn=new Set,hn=new s.LinkedMap,i.func(be.dispose)&&be.dispose(),i.func(te.dispose)&&te.dispose()},listen:()=>{Bn(),Kr(),gn=fe.Listening,te.listen(Mr)},inspect:()=>{(0,n.default)().console.log("inspect")}};return Je.onNotification(A.type,q=>{if(Ue===_.Off||!gt)return;let ne=Ue===_.Verbose||Ue===_.Compact;gt.log(q.message,ne?q.verbose:void 0)}),Je.onNotification(v.type,q=>{let ne=Re.get(q.token);ne?ne(q.value):yn.fire(q)}),Je}e.createMessageConnection=xe})),Vl=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;var n=Od();Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return n.Message}}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:function(){return n.RequestType}}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:function(){return n.RequestType0}}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:function(){return n.RequestType1}}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:function(){return n.RequestType2}}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:function(){return n.RequestType3}}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:function(){return n.RequestType4}}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:function(){return n.RequestType5}}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:function(){return n.RequestType6}}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:function(){return n.RequestType7}}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:function(){return n.RequestType8}}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:function(){return n.RequestType9}}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:function(){return n.ResponseError}}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:function(){return n.ErrorCodes}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return n.NotificationType}}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:function(){return n.NotificationType0}}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:function(){return n.NotificationType1}}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:function(){return n.NotificationType2}}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:function(){return n.NotificationType3}}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:function(){return n.NotificationType4}}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:function(){return n.NotificationType5}}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:function(){return n.NotificationType6}}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:function(){return n.NotificationType7}}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:function(){return n.NotificationType8}}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:function(){return n.NotificationType9}}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:function(){return n.ParameterStructures}});var i=Pd();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:function(){return i.LinkedMap}}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:function(){return i.LRUCache}}),Object.defineProperty(e,"Touch",{enumerable:!0,get:function(){return i.Touch}});var a=K0();Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return a.Disposable}});var s=ka();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return s.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return s.Emitter}});var c=Hl();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return c.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return c.CancellationToken}});var d=Q0();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return d.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return d.SharedArrayReceiverStrategy}});var p=G0();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return p.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return p.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return p.ReadableStreamMessageReader}});var h=J0();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return h.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return h.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return h.WriteableStreamMessageWriter}});var v=X0();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return v.AbstractMessageBuffer}});var w=Y0();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:function(){return w.ConnectionStrategy}}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:function(){return w.ConnectionOptions}}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:function(){return w.NullLogger}}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:function(){return w.createMessageConnection}}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:function(){return w.ProgressToken}}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:function(){return w.ProgressType}}),Object.defineProperty(e,"Trace",{enumerable:!0,get:function(){return w.Trace}}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:function(){return w.TraceValues}}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:function(){return w.TraceFormat}}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:function(){return w.SetTraceNotification}}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:function(){return w.LogTraceNotification}}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:function(){return w.ConnectionErrors}}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:function(){return w.ConnectionError}}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return w.CancellationReceiverStrategy}}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:function(){return w.CancellationSenderStrategy}}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:function(){return w.CancellationStrategy}}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:function(){return w.MessageStrategy}}),e.RAL=Ai().default})),Z0=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=Vl(),i=class a_ extends n.AbstractMessageBuffer{constructor(v="utf-8"){super(v),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return a_.emptyBuffer}fromString(v,w){return new TextEncoder().encode(v)}toString(v,w){return w==="ascii"?this.asciiDecoder.decode(v):new TextDecoder(w).decode(v)}asNative(v,w){return w===void 0?v:v.slice(0,w)}allocNative(v){return new Uint8Array(v)}};i.emptyBuffer=new Uint8Array;var a=class{constructor(h){this.socket=h,this._onData=new n.Emitter,this._messageListener=v=>{v.data.arrayBuffer().then(w=>{this._onData.fire(new Uint8Array(w))},()=>{(0,n.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(h){return this.socket.addEventListener("close",h),n.Disposable.create(()=>this.socket.removeEventListener("close",h))}onError(h){return this.socket.addEventListener("error",h),n.Disposable.create(()=>this.socket.removeEventListener("error",h))}onEnd(h){return this.socket.addEventListener("end",h),n.Disposable.create(()=>this.socket.removeEventListener("end",h))}onData(h){return this._onData.event(h)}},s=class{constructor(h){this.socket=h}onClose(h){return this.socket.addEventListener("close",h),n.Disposable.create(()=>this.socket.removeEventListener("close",h))}onError(h){return this.socket.addEventListener("error",h),n.Disposable.create(()=>this.socket.removeEventListener("error",h))}onEnd(h){return this.socket.addEventListener("end",h),n.Disposable.create(()=>this.socket.removeEventListener("end",h))}write(h,v){if(typeof h=="string"){if(v!==void 0&&v!=="utf-8")throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${v}`);this.socket.send(h)}else this.socket.send(h);return Promise.resolve()}end(){this.socket.close()}},c=new TextEncoder,d=Object.freeze({messageBuffer:Object.freeze({create:h=>new i(h)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(h,v)=>{if(v.charset!=="utf-8")throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${v.charset}`);return Promise.resolve(c.encode(JSON.stringify(h,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(h,v)=>{if(!(h instanceof Uint8Array))throw Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(v.charset).decode(h)))}})}),stream:Object.freeze({asReadableStream:h=>new a(h),asWritableStream:h=>new s(h)}),console,timer:Object.freeze({setTimeout(h,v,...w){let _=setTimeout(h,v,...w);return{dispose:()=>clearTimeout(_)}},setImmediate(h,...v){let w=setTimeout(h,0,...v);return{dispose:()=>clearTimeout(w)}},setInterval(h,v,...w){let _=setInterval(h,v,...w);return{dispose:()=>clearInterval(_)}}})});function p(){return d}(function(h){function v(){n.RAL.install(d)}h.install=v})(p||(p={})),e.default=p})),xo=ke((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,p,h){h===void 0&&(h=p);var v=Object.getOwnPropertyDescriptor(d,p);(!v||("get"in v?!d.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return d[p]}}),Object.defineProperty(c,h,v)}):(function(c,d,p,h){h===void 0&&(h=p),c[h]=d[p]})),i=e&&e.__exportStar||function(c,d){for(var p in c)p!=="default"&&!Object.prototype.hasOwnProperty.call(d,p)&&n(d,c,p)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0,Z0().default.install();var a=Vl();i(Vl(),e),e.BrowserMessageReader=class extends a.AbstractMessageReader{constructor(c){super(),this._onData=new a.Emitter,this._messageListener=d=>{this._onData.fire(d.data)},c.addEventListener("error",d=>this.fireError(d)),c.onmessage=this._messageListener}listen(c){return this._onData.event(c)}},e.BrowserMessageWriter=class extends a.AbstractMessageWriter{constructor(c){super(),this.port=c,this.errorCount=0,c.addEventListener("error",d=>this.fireError(d))}write(c){try{return this.port.postMessage(c),Promise.resolve()}catch(d){return this.handleError(d,c),Promise.reject(d)}}handleError(c,d){this.errorCount++,this.fireError(c,d,this.errorCount)}end(){}};function s(c,d,p,h){return p===void 0&&(p=a.NullLogger),a.ConnectionStrategy.is(h)&&(h={connectionStrategy:h}),(0,a.createMessageConnection)(c,d,p,h)}e.createMessageConnection=s})),Md=ke(((e,n)=>{n.exports=xo()})),qt=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;var n=xo(),i;(function(a){a.clientToServer="clientToServer",a.serverToClient="serverToClient",a.both="both"})(i||(e.MessageDirection=i={})),e.RegistrationType=class{constructor(a){this.method=a}},e.ProtocolRequestType0=class extends n.RequestType0{constructor(a){super(a)}},e.ProtocolRequestType=class extends n.RequestType{constructor(a){super(a,n.ParameterStructures.byName)}},e.ProtocolNotificationType0=class extends n.NotificationType0{constructor(a){super(a)}},e.ProtocolNotificationType=class extends n.NotificationType{constructor(a){super(a,n.ParameterStructures.byName)}}})),$l=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.objectLiteral=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function n(w){return w===!0||w===!1}e.boolean=n;function i(w){return typeof w=="string"||w instanceof String}e.string=i;function a(w){return typeof w=="number"||w instanceof Number}e.number=a;function s(w){return w instanceof Error}e.error=s;function c(w){return typeof w=="function"}e.func=c;function d(w){return Array.isArray(w)}e.array=d;function p(w){return d(w)&&w.every(_=>i(_))}e.stringArray=p;function h(w,_){return Array.isArray(w)&&w.every(_)}e.typedArray=h;function v(w){return typeof w=="object"&&!!w}e.objectLiteral=v})),eg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;var n=qt(),i;(function(a){a.method="textDocument/implementation",a.messageDirection=n.MessageDirection.clientToServer,a.type=new n.ProtocolRequestType(a.method)})(i||(e.ImplementationRequest=i={}))})),tg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;var n=qt(),i;(function(a){a.method="textDocument/typeDefinition",a.messageDirection=n.MessageDirection.clientToServer,a.type=new n.ProtocolRequestType(a.method)})(i||(e.TypeDefinitionRequest=i={}))})),ng=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;var n=qt(),i;(function(s){s.method="workspace/workspaceFolders",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(i||(e.WorkspaceFoldersRequest=i={}));var a;(function(s){s.method="workspace/didChangeWorkspaceFolders",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolNotificationType(s.method)})(a||(e.DidChangeWorkspaceFoldersNotification=a={}))})),rg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;var n=qt(),i;(function(a){a.method="workspace/configuration",a.messageDirection=n.MessageDirection.serverToClient,a.type=new n.ProtocolRequestType(a.method)})(i||(e.ConfigurationRequest=i={}))})),ig=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;var n=qt(),i;(function(s){s.method="textDocument/documentColor",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.DocumentColorRequest=i={}));var a;(function(s){s.method="textDocument/colorPresentation",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(a||(e.ColorPresentationRequest=a={}))})),og=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;var n=qt(),i;(function(s){s.method="textDocument/foldingRange",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.FoldingRangeRequest=i={}));var a;(function(s){s.method="workspace/foldingRange/refresh",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(a||(e.FoldingRangeRefreshRequest=a={}))})),ag=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;var n=qt(),i;(function(a){a.method="textDocument/declaration",a.messageDirection=n.MessageDirection.clientToServer,a.type=new n.ProtocolRequestType(a.method)})(i||(e.DeclarationRequest=i={}))})),sg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;var n=qt(),i;(function(a){a.method="textDocument/selectionRange",a.messageDirection=n.MessageDirection.clientToServer,a.type=new n.ProtocolRequestType(a.method)})(i||(e.SelectionRangeRequest=i={}))})),lg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;var n=xo(),i=qt(),a;(function(d){d.type=new n.ProgressType;function p(h){return h===d.type}d.is=p})(a||(e.WorkDoneProgress=a={}));var s;(function(d){d.method="window/workDoneProgress/create",d.messageDirection=i.MessageDirection.serverToClient,d.type=new i.ProtocolRequestType(d.method)})(s||(e.WorkDoneProgressCreateRequest=s={}));var c;(function(d){d.method="window/workDoneProgress/cancel",d.messageDirection=i.MessageDirection.clientToServer,d.type=new i.ProtocolNotificationType(d.method)})(c||(e.WorkDoneProgressCancelNotification=c={}))})),cg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;var n=qt(),i;(function(c){c.method="textDocument/prepareCallHierarchy",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.CallHierarchyPrepareRequest=i={}));var a;(function(c){c.method="callHierarchy/incomingCalls",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(a||(e.CallHierarchyIncomingCallsRequest=a={}));var s;(function(c){c.method="callHierarchy/outgoingCalls",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.CallHierarchyOutgoingCallsRequest=s={}))})),ug=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;var n=qt(),i;(function(h){h.Relative="relative"})(i||(e.TokenFormat=i={}));var a;(function(h){h.method="textDocument/semanticTokens",h.type=new n.RegistrationType(h.method)})(a||(e.SemanticTokensRegistrationType=a={}));var s;(function(h){h.method="textDocument/semanticTokens/full",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolRequestType(h.method),h.registrationMethod=a.method})(s||(e.SemanticTokensRequest=s={}));var c;(function(h){h.method="textDocument/semanticTokens/full/delta",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolRequestType(h.method),h.registrationMethod=a.method})(c||(e.SemanticTokensDeltaRequest=c={}));var d;(function(h){h.method="textDocument/semanticTokens/range",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolRequestType(h.method),h.registrationMethod=a.method})(d||(e.SemanticTokensRangeRequest=d={}));var p;(function(h){h.method="workspace/semanticTokens/refresh",h.messageDirection=n.MessageDirection.serverToClient,h.type=new n.ProtocolRequestType0(h.method)})(p||(e.SemanticTokensRefreshRequest=p={}))})),dg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;var n=qt(),i;(function(a){a.method="window/showDocument",a.messageDirection=n.MessageDirection.serverToClient,a.type=new n.ProtocolRequestType(a.method)})(i||(e.ShowDocumentRequest=i={}))})),fg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;var n=qt(),i;(function(a){a.method="textDocument/linkedEditingRange",a.messageDirection=n.MessageDirection.clientToServer,a.type=new n.ProtocolRequestType(a.method)})(i||(e.LinkedEditingRangeRequest=i={}))})),pg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;var n=qt(),i;(function(v){v.file="file",v.folder="folder"})(i||(e.FileOperationPatternKind=i={}));var a;(function(v){v.method="workspace/willCreateFiles",v.messageDirection=n.MessageDirection.clientToServer,v.type=new n.ProtocolRequestType(v.method)})(a||(e.WillCreateFilesRequest=a={}));var s;(function(v){v.method="workspace/didCreateFiles",v.messageDirection=n.MessageDirection.clientToServer,v.type=new n.ProtocolNotificationType(v.method)})(s||(e.DidCreateFilesNotification=s={}));var c;(function(v){v.method="workspace/willRenameFiles",v.messageDirection=n.MessageDirection.clientToServer,v.type=new n.ProtocolRequestType(v.method)})(c||(e.WillRenameFilesRequest=c={}));var d;(function(v){v.method="workspace/didRenameFiles",v.messageDirection=n.MessageDirection.clientToServer,v.type=new n.ProtocolNotificationType(v.method)})(d||(e.DidRenameFilesNotification=d={}));var p;(function(v){v.method="workspace/didDeleteFiles",v.messageDirection=n.MessageDirection.clientToServer,v.type=new n.ProtocolNotificationType(v.method)})(p||(e.DidDeleteFilesNotification=p={}));var h;(function(v){v.method="workspace/willDeleteFiles",v.messageDirection=n.MessageDirection.clientToServer,v.type=new n.ProtocolRequestType(v.method)})(h||(e.WillDeleteFilesRequest=h={}))})),mg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;var n=qt(),i;(function(c){c.document="document",c.project="project",c.group="group",c.scheme="scheme",c.global="global"})(i||(e.UniquenessLevel=i={}));var a;(function(c){c.$import="import",c.$export="export",c.local="local"})(a||(e.MonikerKind=a={}));var s;(function(c){c.method="textDocument/moniker",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.MonikerRequest=s={}))})),hg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;var n=qt(),i;(function(c){c.method="textDocument/prepareTypeHierarchy",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.TypeHierarchyPrepareRequest=i={}));var a;(function(c){c.method="typeHierarchy/supertypes",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(a||(e.TypeHierarchySupertypesRequest=a={}));var s;(function(c){c.method="typeHierarchy/subtypes",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(s||(e.TypeHierarchySubtypesRequest=s={}))})),gg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;var n=qt(),i;(function(s){s.method="textDocument/inlineValue",s.messageDirection=n.MessageDirection.clientToServer,s.type=new n.ProtocolRequestType(s.method)})(i||(e.InlineValueRequest=i={}));var a;(function(s){s.method="workspace/inlineValue/refresh",s.messageDirection=n.MessageDirection.serverToClient,s.type=new n.ProtocolRequestType0(s.method)})(a||(e.InlineValueRefreshRequest=a={}))})),yg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;var n=qt(),i;(function(c){c.method="textDocument/inlayHint",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(i||(e.InlayHintRequest=i={}));var a;(function(c){c.method="inlayHint/resolve",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method)})(a||(e.InlayHintResolveRequest=a={}));var s;(function(c){c.method="workspace/inlayHint/refresh",c.messageDirection=n.MessageDirection.serverToClient,c.type=new n.ProtocolRequestType0(c.method)})(s||(e.InlayHintRefreshRequest=s={}))})),vg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;var n=xo(),i=$l(),a=qt(),s;(function(v){function w(_){let C=_;return C&&i.boolean(C.retriggerRequest)}v.is=w})(s||(e.DiagnosticServerCancellationData=s={}));var c;(function(v){v.Full="full",v.Unchanged="unchanged"})(c||(e.DocumentDiagnosticReportKind=c={}));var d;(function(v){v.method="textDocument/diagnostic",v.messageDirection=a.MessageDirection.clientToServer,v.type=new a.ProtocolRequestType(v.method),v.partialResult=new n.ProgressType})(d||(e.DocumentDiagnosticRequest=d={}));var p;(function(v){v.method="workspace/diagnostic",v.messageDirection=a.MessageDirection.clientToServer,v.type=new a.ProtocolRequestType(v.method),v.partialResult=new n.ProgressType})(p||(e.WorkspaceDiagnosticRequest=p={}));var h;(function(v){v.method="workspace/diagnostic/refresh",v.messageDirection=a.MessageDirection.serverToClient,v.type=new a.ProtocolRequestType0(v.method)})(h||(e.DiagnosticRefreshRequest=h={}))})),bg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;var n=(em(),lu(Zp)),i=$l(),a=qt(),s;(function(R){R.Markup=1,R.Code=2;function A(H){return H===1||H===2}R.is=A})(s||(e.NotebookCellKind=s={}));var c;(function(R){function A(U,L){let G={executionOrder:U};return(L===!0||L===!1)&&(G.success=L),G}R.create=A;function H(U){let L=U;return i.objectLiteral(L)&&n.uinteger.is(L.executionOrder)&&(L.success===void 0||i.boolean(L.success))}R.is=H;function V(U,L){return U===L?!0:U==null||L==null?!1:U.executionOrder===L.executionOrder&&U.success===L.success}R.equals=V})(c||(e.ExecutionSummary=c={}));var d;(function(R){function A(L,G){return{kind:L,document:G}}R.create=A;function H(L){let G=L;return i.objectLiteral(G)&&s.is(G.kind)&&n.DocumentUri.is(G.document)&&(G.metadata===void 0||i.objectLiteral(G.metadata))}R.is=H;function V(L,G){let he=new Set;return L.document!==G.document&&he.add("document"),L.kind!==G.kind&&he.add("kind"),L.executionSummary!==G.executionSummary&&he.add("executionSummary"),(L.metadata!==void 0||G.metadata!==void 0)&&!U(L.metadata,G.metadata)&&he.add("metadata"),(L.executionSummary!==void 0||G.executionSummary!==void 0)&&!c.equals(L.executionSummary,G.executionSummary)&&he.add("executionSummary"),he}R.diff=V;function U(L,G){if(L===G)return!0;if(L==null||G==null||typeof L!=typeof G||typeof L!="object")return!1;let he=Array.isArray(L),N=Array.isArray(G);if(he!==N)return!1;if(he&&N){if(L.length!==G.length)return!1;for(let I=0;I<L.length;I++)if(!U(L[I],G[I]))return!1}if(i.objectLiteral(L)&&i.objectLiteral(G)){let I=Object.keys(L),$=Object.keys(G);if(I.length!==$.length||(I.sort(),$.sort(),!U(I,$)))return!1;for(let de=0;de<I.length;de++){let fe=I[de];if(!U(L[fe],G[fe]))return!1}}return!0}})(d||(e.NotebookCell=d={}));var p;(function(R){function A(V,U,L,G){return{uri:V,notebookType:U,version:L,cells:G}}R.create=A;function H(V){let U=V;return i.objectLiteral(U)&&i.string(U.uri)&&n.integer.is(U.version)&&i.typedArray(U.cells,d.is)}R.is=H})(p||(e.NotebookDocument=p={}));var h;(function(R){R.method="notebookDocument/sync",R.messageDirection=a.MessageDirection.clientToServer,R.type=new a.RegistrationType(R.method)})(h||(e.NotebookDocumentSyncRegistrationType=h={}));var v;(function(R){R.method="notebookDocument/didOpen",R.messageDirection=a.MessageDirection.clientToServer,R.type=new a.ProtocolNotificationType(R.method),R.registrationMethod=h.method})(v||(e.DidOpenNotebookDocumentNotification=v={}));var w;(function(R){function A(V){let U=V;return i.objectLiteral(U)&&n.uinteger.is(U.start)&&n.uinteger.is(U.deleteCount)&&(U.cells===void 0||i.typedArray(U.cells,d.is))}R.is=A;function H(V,U,L){let G={start:V,deleteCount:U};return L!==void 0&&(G.cells=L),G}R.create=H})(w||(e.NotebookCellArrayChange=w={}));var _;(function(R){R.method="notebookDocument/didChange",R.messageDirection=a.MessageDirection.clientToServer,R.type=new a.ProtocolNotificationType(R.method),R.registrationMethod=h.method})(_||(e.DidChangeNotebookDocumentNotification=_={}));var C;(function(R){R.method="notebookDocument/didSave",R.messageDirection=a.MessageDirection.clientToServer,R.type=new a.ProtocolNotificationType(R.method),R.registrationMethod=h.method})(C||(e.DidSaveNotebookDocumentNotification=C={}));var E;(function(R){R.method="notebookDocument/didClose",R.messageDirection=a.MessageDirection.clientToServer,R.type=new a.ProtocolNotificationType(R.method),R.registrationMethod=h.method})(E||(e.DidCloseNotebookDocumentNotification=E={}))})),wg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineCompletionRequest=void 0;var n=qt(),i;(function(a){a.method="textDocument/inlineCompletion",a.messageDirection=n.MessageDirection.clientToServer,a.type=new n.ProtocolRequestType(a.method)})(i||(e.InlineCompletionRequest=i={}))})),_g=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceSymbolRequest=e.CodeActionResolveRequest=e.CodeActionRequest=e.DocumentSymbolRequest=e.DocumentHighlightRequest=e.ReferencesRequest=e.DefinitionRequest=e.SignatureHelpRequest=e.SignatureHelpTriggerKind=e.HoverRequest=e.CompletionResolveRequest=e.CompletionRequest=e.CompletionTriggerKind=e.PublishDiagnosticsNotification=e.WatchKind=e.RelativePattern=e.FileChangeType=e.DidChangeWatchedFilesNotification=e.WillSaveTextDocumentWaitUntilRequest=e.WillSaveTextDocumentNotification=e.TextDocumentSaveReason=e.DidSaveTextDocumentNotification=e.DidCloseTextDocumentNotification=e.DidChangeTextDocumentNotification=e.TextDocumentContentChangeEvent=e.DidOpenTextDocumentNotification=e.TextDocumentSyncKind=e.TelemetryEventNotification=e.LogMessageNotification=e.ShowMessageRequest=e.ShowMessageNotification=e.MessageType=e.DidChangeConfigurationNotification=e.ExitNotification=e.ShutdownRequest=e.InitializedNotification=e.InitializeErrorCodes=e.InitializeRequest=e.WorkDoneProgressOptions=e.TextDocumentRegistrationOptions=e.StaticRegistrationOptions=e.PositionEncodingKind=e.FailureHandlingKind=e.ResourceOperationKind=e.UnregistrationRequest=e.RegistrationRequest=e.DocumentSelector=e.NotebookCellTextDocumentFilter=e.NotebookDocumentFilter=e.TextDocumentFilter=void 0,e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.WillRenameFilesRequest=e.DidRenameFilesNotification=e.WillCreateFilesRequest=e.DidCreateFilesNotification=e.FileOperationPatternKind=e.LinkedEditingRangeRequest=e.ShowDocumentRequest=e.SemanticTokensRegistrationType=e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.TokenFormat=e.CallHierarchyPrepareRequest=e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=e.SelectionRangeRequest=e.DeclarationRequest=e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=e.ColorPresentationRequest=e.DocumentColorRequest=e.ConfigurationRequest=e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=e.TypeDefinitionRequest=e.ImplementationRequest=e.ApplyWorkspaceEditRequest=e.ExecuteCommandRequest=e.PrepareRenameRequest=e.RenameRequest=e.PrepareSupportDefaultBehavior=e.DocumentOnTypeFormattingRequest=e.DocumentRangesFormattingRequest=e.DocumentRangeFormattingRequest=e.DocumentFormattingRequest=e.DocumentLinkResolveRequest=e.DocumentLinkRequest=e.CodeLensRefreshRequest=e.CodeLensResolveRequest=e.CodeLensRequest=e.WorkspaceSymbolResolveRequest=void 0,e.InlineCompletionRequest=e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=e.InlineValueRefreshRequest=e.InlineValueRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchySubtypesRequest=e.TypeHierarchyPrepareRequest=void 0;var n=qt(),i=(em(),lu(Zp)),a=$l(),s=eg();Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return s.ImplementationRequest}});var c=tg();Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return c.TypeDefinitionRequest}});var d=ng();Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return d.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return d.DidChangeWorkspaceFoldersNotification}});var p=rg();Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return p.ConfigurationRequest}});var h=ig();Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return h.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return h.ColorPresentationRequest}});var v=og();Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return v.FoldingRangeRequest}}),Object.defineProperty(e,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return v.FoldingRangeRefreshRequest}});var w=ag();Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return w.DeclarationRequest}});var _=sg();Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return _.SelectionRangeRequest}});var C=lg();Object.defineProperty(e,"WorkDoneProgress",{enumerable:!0,get:function(){return C.WorkDoneProgress}}),Object.defineProperty(e,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return C.WorkDoneProgressCreateRequest}}),Object.defineProperty(e,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return C.WorkDoneProgressCancelNotification}});var E=cg();Object.defineProperty(e,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return E.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(e,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return E.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(e,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return E.CallHierarchyPrepareRequest}});var R=ug();Object.defineProperty(e,"TokenFormat",{enumerable:!0,get:function(){return R.TokenFormat}}),Object.defineProperty(e,"SemanticTokensRequest",{enumerable:!0,get:function(){return R.SemanticTokensRequest}}),Object.defineProperty(e,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return R.SemanticTokensDeltaRequest}}),Object.defineProperty(e,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return R.SemanticTokensRangeRequest}}),Object.defineProperty(e,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return R.SemanticTokensRefreshRequest}}),Object.defineProperty(e,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return R.SemanticTokensRegistrationType}});var A=dg();Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return A.ShowDocumentRequest}});var H=fg();Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return H.LinkedEditingRangeRequest}});var V=pg();Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:function(){return V.FileOperationPatternKind}}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:function(){return V.DidCreateFilesNotification}}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:function(){return V.WillCreateFilesRequest}}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:function(){return V.DidRenameFilesNotification}}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:function(){return V.WillRenameFilesRequest}}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return V.DidDeleteFilesNotification}}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return V.WillDeleteFilesRequest}});var U=mg();Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return U.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return U.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return U.MonikerRequest}});var L=hg();Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return L.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return L.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return L.TypeHierarchySupertypesRequest}});var G=gg();Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return G.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return G.InlineValueRefreshRequest}});var he=yg();Object.defineProperty(e,"InlayHintRequest",{enumerable:!0,get:function(){return he.InlayHintRequest}}),Object.defineProperty(e,"InlayHintResolveRequest",{enumerable:!0,get:function(){return he.InlayHintResolveRequest}}),Object.defineProperty(e,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return he.InlayHintRefreshRequest}});var N=vg();Object.defineProperty(e,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return N.DiagnosticServerCancellationData}}),Object.defineProperty(e,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return N.DocumentDiagnosticReportKind}}),Object.defineProperty(e,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return N.DocumentDiagnosticRequest}}),Object.defineProperty(e,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return N.WorkspaceDiagnosticRequest}}),Object.defineProperty(e,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return N.DiagnosticRefreshRequest}});var I=bg();Object.defineProperty(e,"NotebookCellKind",{enumerable:!0,get:function(){return I.NotebookCellKind}}),Object.defineProperty(e,"ExecutionSummary",{enumerable:!0,get:function(){return I.ExecutionSummary}}),Object.defineProperty(e,"NotebookCell",{enumerable:!0,get:function(){return I.NotebookCell}}),Object.defineProperty(e,"NotebookDocument",{enumerable:!0,get:function(){return I.NotebookDocument}}),Object.defineProperty(e,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return I.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(e,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return I.DidOpenNotebookDocumentNotification}}),Object.defineProperty(e,"NotebookCellArrayChange",{enumerable:!0,get:function(){return I.NotebookCellArrayChange}}),Object.defineProperty(e,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return I.DidChangeNotebookDocumentNotification}}),Object.defineProperty(e,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return I.DidSaveNotebookDocumentNotification}}),Object.defineProperty(e,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return I.DidCloseNotebookDocumentNotification}});var $=wg();Object.defineProperty(e,"InlineCompletionRequest",{enumerable:!0,get:function(){return $.InlineCompletionRequest}});var de;(function(P){function Je(q){let ne=q;return a.string(ne)||a.string(ne.language)||a.string(ne.scheme)||a.string(ne.pattern)}P.is=Je})(de||(e.TextDocumentFilter=de={}));var fe;(function(P){function Je(q){let ne=q;return a.objectLiteral(ne)&&(a.string(ne.notebookType)||a.string(ne.scheme)||a.string(ne.pattern))}P.is=Je})(fe||(e.NotebookDocumentFilter=fe={}));var xe;(function(P){function Je(q){let ne=q;return a.objectLiteral(ne)&&(a.string(ne.notebook)||fe.is(ne.notebook))&&(ne.language===void 0||a.string(ne.language))}P.is=Je})(xe||(e.NotebookCellTextDocumentFilter=xe={}));var te;(function(P){function Je(q){if(!Array.isArray(q))return!1;for(let ne of q)if(!a.string(ne)&&!de.is(ne)&&!xe.is(ne))return!1;return!0}P.is=Je})(te||(e.DocumentSelector=te={}));var be;(function(P){P.method="client/registerCapability",P.messageDirection=n.MessageDirection.serverToClient,P.type=new n.ProtocolRequestType(P.method)})(be||(e.RegistrationRequest=be={}));var Se;(function(P){P.method="client/unregisterCapability",P.messageDirection=n.MessageDirection.serverToClient,P.type=new n.ProtocolRequestType(P.method)})(Se||(e.UnregistrationRequest=Se={}));var ie;(function(P){P.Create="create",P.Rename="rename",P.Delete="delete"})(ie||(e.ResourceOperationKind=ie={}));var X;(function(P){P.Abort="abort",P.Transactional="transactional",P.TextOnlyTransactional="textOnlyTransactional",P.Undo="undo"})(X||(e.FailureHandlingKind=X={}));var Q;(function(P){P.UTF8="utf-8",P.UTF16="utf-16",P.UTF32="utf-32"})(Q||(e.PositionEncodingKind=Q={}));var K;(function(P){function Je(q){let ne=q;return ne&&a.string(ne.id)&&ne.id.length>0}P.hasId=Je})(K||(e.StaticRegistrationOptions=K={}));var Ne;(function(P){function Je(q){let ne=q;return ne&&(ne.documentSelector===null||te.is(ne.documentSelector))}P.is=Je})(Ne||(e.TextDocumentRegistrationOptions=Ne={}));var Qe;(function(P){function Je(ne){let ye=ne;return a.objectLiteral(ye)&&(ye.workDoneProgress===void 0||a.boolean(ye.workDoneProgress))}P.is=Je;function q(ne){let ye=ne;return ye&&a.boolean(ye.workDoneProgress)}P.hasWorkDoneProgress=q})(Qe||(e.WorkDoneProgressOptions=Qe={}));var ut;(function(P){P.method="initialize",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(ut||(e.InitializeRequest=ut={}));var Be;(function(P){P.unknownProtocolVersion=1})(Be||(e.InitializeErrorCodes=Be={}));var We;(function(P){P.method="initialized",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolNotificationType(P.method)})(We||(e.InitializedNotification=We={}));var Re;(function(P){P.method="shutdown",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType0(P.method)})(Re||(e.ShutdownRequest=Re={}));var Me;(function(P){P.method="exit",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolNotificationType0(P.method)})(Me||(e.ExitNotification=Me={}));var hn;(function(P){P.method="workspace/didChangeConfiguration",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolNotificationType(P.method)})(hn||(e.DidChangeConfigurationNotification=hn={}));var It;(function(P){P.Error=1,P.Warning=2,P.Info=3,P.Log=4,P.Debug=5})(It||(e.MessageType=It={}));var Dn;(function(P){P.method="window/showMessage",P.messageDirection=n.MessageDirection.serverToClient,P.type=new n.ProtocolNotificationType(P.method)})(Dn||(e.ShowMessageNotification=Dn={}));var sn;(function(P){P.method="window/showMessageRequest",P.messageDirection=n.MessageDirection.serverToClient,P.type=new n.ProtocolRequestType(P.method)})(sn||(e.ShowMessageRequest=sn={}));var Ue;(function(P){P.method="window/logMessage",P.messageDirection=n.MessageDirection.serverToClient,P.type=new n.ProtocolNotificationType(P.method)})(Ue||(e.LogMessageNotification=Ue={}));var tn;(function(P){P.method="telemetry/event",P.messageDirection=n.MessageDirection.serverToClient,P.type=new n.ProtocolNotificationType(P.method)})(tn||(e.TelemetryEventNotification=tn={}));var gt;(function(P){P.None=0,P.Full=1,P.Incremental=2})(gt||(e.TextDocumentSyncKind=gt={}));var gn;(function(P){P.method="textDocument/didOpen",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolNotificationType(P.method)})(gn||(e.DidOpenTextDocumentNotification=gn={}));var Xn;(function(P){function Je(ne){let ye=ne;return ye!=null&&typeof ye.text=="string"&&ye.range!==void 0&&(ye.rangeLength===void 0||typeof ye.rangeLength=="number")}P.isIncremental=Je;function q(ne){let ye=ne;return ye!=null&&typeof ye.text=="string"&&ye.range===void 0&&ye.rangeLength===void 0}P.isFull=q})(Xn||(e.TextDocumentContentChangeEvent=Xn={}));var kt;(function(P){P.method="textDocument/didChange",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolNotificationType(P.method)})(kt||(e.DidChangeTextDocumentNotification=kt={}));var ai;(function(P){P.method="textDocument/didClose",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolNotificationType(P.method)})(ai||(e.DidCloseTextDocumentNotification=ai={}));var yn;(function(P){P.method="textDocument/didSave",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolNotificationType(P.method)})(yn||(e.DidSaveTextDocumentNotification=yn={}));var vn;(function(P){P.Manual=1,P.AfterDelay=2,P.FocusOut=3})(vn||(e.TextDocumentSaveReason=vn={}));var Ln;(function(P){P.method="textDocument/willSave",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolNotificationType(P.method)})(Ln||(e.WillSaveTextDocumentNotification=Ln={}));var Pr;(function(P){P.method="textDocument/willSaveWaitUntil",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(Pr||(e.WillSaveTextDocumentWaitUntilRequest=Pr={}));var An;(function(P){P.method="workspace/didChangeWatchedFiles",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolNotificationType(P.method)})(An||(e.DidChangeWatchedFilesNotification=An={}));var nn;(function(P){P.Created=1,P.Changed=2,P.Deleted=3})(nn||(e.FileChangeType=nn={}));var Fi;(function(P){function Je(q){let ne=q;return a.objectLiteral(ne)&&(i.URI.is(ne.baseUri)||i.WorkspaceFolder.is(ne.baseUri))&&a.string(ne.pattern)}P.is=Je})(Fi||(e.RelativePattern=Fi={}));var $r;(function(P){P.Create=1,P.Change=2,P.Delete=4})($r||(e.WatchKind=$r={}));var Nr;(function(P){P.method="textDocument/publishDiagnostics",P.messageDirection=n.MessageDirection.serverToClient,P.type=new n.ProtocolNotificationType(P.method)})(Nr||(e.PublishDiagnosticsNotification=Nr={}));var si;(function(P){P.Invoked=1,P.TriggerCharacter=2,P.TriggerForIncompleteCompletions=3})(si||(e.CompletionTriggerKind=si={}));var Ht;(function(P){P.method="textDocument/completion",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(Ht||(e.CompletionRequest=Ht={}));var Qt;(function(P){P.method="completionItem/resolve",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(Qt||(e.CompletionResolveRequest=Qt={}));var yt;(function(P){P.method="textDocument/hover",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(yt||(e.HoverRequest=yt={}));var Ft;(function(P){P.Invoked=1,P.TriggerCharacter=2,P.ContentChange=3})(Ft||(e.SignatureHelpTriggerKind=Ft={}));var Ct;(function(P){P.method="textDocument/signatureHelp",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(Ct||(e.SignatureHelpRequest=Ct={}));var li;(function(P){P.method="textDocument/definition",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(li||(e.DefinitionRequest=li={}));var Bi;(function(P){P.method="textDocument/references",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(Bi||(e.ReferencesRequest=Bi={}));var Mr;(function(P){P.method="textDocument/documentHighlight",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(Mr||(e.DocumentHighlightRequest=Mr={}));var dr;(function(P){P.method="textDocument/documentSymbol",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(dr||(e.DocumentSymbolRequest=dr={}));var Ge;(function(P){P.method="textDocument/codeAction",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(Ge||(e.CodeActionRequest=Ge={}));var Vt;(function(P){P.method="codeAction/resolve",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(Vt||(e.CodeActionResolveRequest=Vt={}));var st;(function(P){P.method="workspace/symbol",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(st||(e.WorkspaceSymbolRequest=st={}));var vt;(function(P){P.method="workspaceSymbol/resolve",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(vt||(e.WorkspaceSymbolResolveRequest=vt={}));var On;(function(P){P.method="textDocument/codeLens",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(On||(e.CodeLensRequest=On={}));var Wr;(function(P){P.method="codeLens/resolve",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(Wr||(e.CodeLensResolveRequest=Wr={}));var St;(function(P){P.method="workspace/codeLens/refresh",P.messageDirection=n.MessageDirection.serverToClient,P.type=new n.ProtocolRequestType0(P.method)})(St||(e.CodeLensRefreshRequest=St={}));var Yn;(function(P){P.method="textDocument/documentLink",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(Yn||(e.DocumentLinkRequest=Yn={}));var Ur;(function(P){P.method="documentLink/resolve",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(Ur||(e.DocumentLinkResolveRequest=Ur={}));var ci;(function(P){P.method="textDocument/formatting",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(ci||(e.DocumentFormattingRequest=ci={}));var In;(function(P){P.method="textDocument/rangeFormatting",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(In||(e.DocumentRangeFormattingRequest=In={}));var Bn;(function(P){P.method="textDocument/rangesFormatting",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(Bn||(e.DocumentRangesFormattingRequest=Bn={}));var Kr;(function(P){P.method="textDocument/onTypeFormatting",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(Kr||(e.DocumentOnTypeFormattingRequest=Kr={}));var ui;(function(P){P.Identifier=1})(ui||(e.PrepareSupportDefaultBehavior=ui={}));var Zn;(function(P){P.method="textDocument/rename",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(Zn||(e.RenameRequest=Zn={}));var Pn;(function(P){P.method="textDocument/prepareRename",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(Pn||(e.PrepareRenameRequest=Pn={}));var bt;(function(P){P.method="workspace/executeCommand",P.messageDirection=n.MessageDirection.clientToServer,P.type=new n.ProtocolRequestType(P.method)})(bt||(e.ExecuteCommandRequest=bt={}));var jt;(function(P){P.method="workspace/applyEdit",P.messageDirection=n.MessageDirection.serverToClient,P.type=new n.ProtocolRequestType("workspace/applyEdit")})(jt||(e.ApplyWorkspaceEditRequest=jt={}))})),xg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var n=xo();function i(a,s,c,d){return n.ConnectionStrategy.is(d)&&(d={connectionStrategy:d}),(0,n.createMessageConnection)(a,s,c,d)}e.createProtocolConnection=i})),kg=ke((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,p,h){h===void 0&&(h=p);var v=Object.getOwnPropertyDescriptor(d,p);(!v||("get"in v?!d.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return d[p]}}),Object.defineProperty(c,h,v)}):(function(c,d,p,h){h===void 0&&(h=p),c[h]=d[p]})),i=e&&e.__exportStar||function(c,d){for(var p in c)p!=="default"&&!Object.prototype.hasOwnProperty.call(d,p)&&n(d,c,p)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,i(xo(),e),i((em(),lu(Zp)),e),i(qt(),e),i(_g(),e);var a=xg();Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:function(){return a.createProtocolConnection}});var s;(function(c){c.lspReservedErrorRangeStart=-32899,c.RequestFailed=-32803,c.ServerCancelled=-32802,c.ContentModified=-32801,c.RequestCancelled=-32800,c.lspReservedErrorRangeEnd=-32800})(s||(e.LSPErrorCodes=s={}))})),Vu=ke((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,p,h){h===void 0&&(h=p);var v=Object.getOwnPropertyDescriptor(d,p);(!v||("get"in v?!d.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return d[p]}}),Object.defineProperty(c,h,v)}):(function(c,d,p,h){h===void 0&&(h=p),c[h]=d[p]})),i=e&&e.__exportStar||function(c,d){for(var p in c)p!=="default"&&!Object.prototype.hasOwnProperty.call(d,p)&&n(d,c,p)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var a=Md();i(Md(),e),i(kg(),e);function s(c,d,p,h){return(0,a.createMessageConnection)(c,d,p,h)}e.createProtocolConnection=s}));function mn(e,n){if(n.line>=e.lines)return n.character===0?e.length:void 0;let i=e.line(n.line+1).from+n.character;if(!(i>e.length))return i}function Dr(e,n){return mn(e,n)||0}function Ii(e,n){let i=e.lineAt(n);return{character:n-i.from,line:i.number-1}}var Wl=new h2.Renderer,jk=Wl.code;Wl.code=e=>e.text.trim()?jk.call(Wl,e):"";function Cg(e){return h2(e,{async:!1,gfm:!0,breaks:!0,renderer:Wl})}function Or(e,n=Cg){if(!e)return"";if(Bk(e)){let i=e.value;return e.kind==="markdown"&&(i=n(i.trim())),i}return Array.isArray(e)?e.map(i=>Or(i,n)).filter(Boolean).join(`
110
+
111
+ `):typeof e=="string"?e:""}function qk(e){if(e.length===0)return"";if(e.length===1)return e[0]||"";e.sort();let n=e[0]||"",i=e[e.length-1]||"",a=0;for(;a<n.length&&n[a]===i[a];)a++;return n.substring(0,a)}function zk(e){if(e.length===0)return;let n=qk(e.map(s=>{var c;return((c=s.textEdit)==null?void 0:c.newText)||s.label}));if(n==="")return;let i=[];for(let s=0;s<n.length;s++){let c=n.slice(0,s+1);if(c.length>0){let d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");i.push(d)}}let a=i.join("|");return RegExp(`(${a})$`)}function Fk(e){return(e==null?void 0:e.range)!==void 0}function Bk(e){return e.kind!==void 0}function Gn(e,n){let i=document.createElement("div");i.className="cm-error-message",i.style.cssText=`
112
+ position: absolute;
113
+ padding: 8px;
114
+ background: #fee;
115
+ border: 1px solid #fcc;
116
+ border-radius: 4px;
117
+ color: #c00;
118
+ font-size: 14px;
119
+ z-index: 100;
120
+ max-width: 300px;
121
+ box-shadow: 0 2px 8px rgba(0,0,0,.15);
122
+ `,i.textContent=n;let a=e.coordsAtPos(e.state.selection.main.head);a&&(i.style.left=`${a.left}px`,i.style.top=`${a.bottom+5}px`),document.body.appendChild(i),setTimeout(()=>{i.style.opacity="0",i.style.transition="opacity 0.2s",setTimeout(()=>i.remove(),200)},3e3)}function Ul(e){if(e==null)return!0;if(Array.isArray(e))return e.length===0||e.every(Ul);if(typeof e=="string")return Sg(e);let n=e.value;return typeof n=="string"?Sg(n):!1}function Sg(e){return e==null?!0:typeof e=="string"?e.trim()===""||/^[\s\n`]*$/.test(e):!1}function Hk(e,n){let i=[];return n.iterChanges((a,s,c,d,p)=>{let h=p.toString();if(a===0&&s===e.length){i.push({text:h});return}let v=Ii(e,a),w=Ii(e,s);i.push({range:{start:v,end:w},text:h})}),i.sort((a,s)=>{if(!a.range)return 1;if(!s.range)return-1;let c=a.range.start.line??-1,d=s.range.start.line??-1;if(c!==d)return d-c;let p=a.range.start.character??-1;return(s.range.start.character??-1)-p}),i}var Vk=Kt(Vu(),1),$k=Object.fromEntries(Object.entries(Vk.CompletionItemKind).map(([e,n])=>[n,e])),Eg;(function(e){e.PlainText=1,e.Snippet=2})(Eg||(Eg={}));function Wk(e){return e.replaceAll(/\\\\/g,"").replaceAll(/(\$(\d+))/g,(n,i,a)=>"${"+a+"}")}function Uk(e,n){let{detail:i,labelDetails:a,label:s,kind:c,textEdit:d,insertText:p,documentation:h,additionalTextEdits:v,insertTextFormat:w}=e,_={label:s,detail:(a==null?void 0:a.detail)||i,apply(C,E,R,A){if(d&&Fk(d)?C.dispatch(u2(C.state,d.newText,Dr(C.state.doc,d.range.start),Dr(C.state.doc,d.range.end))):p&&w===Eg.Snippet&&n.useSnippetOnCompletion?eR(Wk(p))(C,null,R,A):C.dispatch(u2(C.state,s,R,A)),!v)return;let H=v.sort(({range:{end:V}},{range:{end:U}})=>Dr(C.state.doc,V)<Dr(C.state.doc,U)?1:Dr(C.state.doc,V)>Dr(C.state.doc,U)?-1:0);for(let V of H)C.dispatch(C.state.update({changes:{from:Dr(C.state.doc,V.range.start),to:mn(C.state.doc,V.range.end),insert:V.newText}}))},type:c&&$k[c].toLowerCase()};return n.hasResolveProvider&&n.resolveItem?_.info=async()=>{var C;try{let E=await((C=n.resolveItem)==null?void 0:C.call(n,e)),R=document.createElement("div");R.classList.add("documentation");let A=(E==null?void 0:E.documentation)||h;return!A||Ul(A)?null:(n.allowHTMLContent?R.innerHTML=Or(A,n.markdownRenderer):R.textContent=Or(A,n.markdownRenderer),R)}catch(E){if(console.error("Failed to resolve completion item:",E),Ul(h))return null;if(h){let R=document.createElement("div");return R.classList.add("documentation"),n.allowHTMLContent?R.innerHTML=Or(h,n.markdownRenderer):R.textContent=Or(h,n.markdownRenderer),R}return null}}:h&&(_.info=()=>{let C=document.createElement("div");return C.classList.add("documentation"),n.allowHTMLContent?C.innerHTML=Or(h,n.markdownRenderer):C.textContent=Or(h,n.markdownRenderer),C}),_}function Kk(e,n,i){let a=[n?Qk(n):Gk,i==="python"?Jk:void 0].filter(Boolean),s=e;if(n){let c=n.toLowerCase();/^\w+$/.test(c)&&(s=s.filter(({label:d,filterText:p})=>(p??d).toLowerCase().startsWith(c)))}for(let c of a)s.sort(c);return s}function Qk(e){return(n,i)=>{let a=n.sortText??n.label,s=i.sortText??i.label;switch(!0){case(a.startsWith(e)&&!s.startsWith(e)):return-1;case(!a.startsWith(e)&&s.startsWith(e)):return 1}return a.localeCompare(s)}}function Gk(e,n){let i=e.sortText??e.label,a=n.sortText??n.label;return i.localeCompare(a)}function Jk(e,n){let i=e.label.endsWith("="),a=n.label.endsWith("=");return i&&!a?-1:!i&&a?1:0}function Tg(e){let n=new Proxy({},{get(){throw Error(e)}});return function(i){return i.at(-1)??n}}const Rg=kl.define({combine:Tg("No document URI provided. Either pass a one into the extension or use documentUri.of().")}),Xk=kl.define({combine:Tg("No language ID provided. Either pass a one into the extension or use languageId.of().")});let Ld,Dg;Ld=Kt(Il(),1),Dg=1e4,Ll=class{constructor({rootUri:e,workspaceFolders:n,transport:i,initializationOptions:a,capabilities:s,timeout:c=Dg,getWorkspaceConfiguration:d}){De(this,"ready");De(this,"capabilities");De(this,"initializePromise");De(this,"rootUri");De(this,"workspaceFolders");De(this,"timeout");De(this,"transport");De(this,"requestManager");De(this,"client");De(this,"initializationOptions");De(this,"clientCapabilities");De(this,"notificationListeners",new Set);this.rootUri=e,this.workspaceFolders=n,this.transport=i,this.initializationOptions=a,this.clientCapabilities=s,this.timeout=c,this.ready=!1,this.capabilities=null,this.requestManager=new Ld.RequestManager([this.transport]),this.client=new Ld.Client(this.requestManager),this.client.onNotification(h=>{this.processNotification(h)});let p=this.transport;p!=null&&p.connection&&p.connection.addEventListener("message",h=>{let v=JSON.parse(h.data);v.method==="workspace/configuration"&&d?p.connection.send(JSON.stringify({jsonrpc:"2.0",id:v.id,result:d(v.params)})):v.method&&v.id&&p.connection.send(JSON.stringify({jsonrpc:"2.0",id:v.id,result:null}))}),this.initializePromise=this.initialize()}getInitializationOptions(){let e={textDocument:{hover:{dynamicRegistration:!0,contentFormat:["markdown","plaintext"]},moniker:{},synchronization:{dynamicRegistration:!0,willSave:!1,didSave:!1,willSaveWaitUntil:!1},codeAction:{dynamicRegistration:!0,codeActionLiteralSupport:{codeActionKind:{valueSet:["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},resolveSupport:{properties:["edit"]}},completion:{dynamicRegistration:!0,completionItem:{snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:["markdown","plaintext"],deprecatedSupport:!1,preselectSupport:!1},contextSupport:!1},signatureHelp:{dynamicRegistration:!0,signatureInformation:{documentationFormat:["markdown","plaintext"]}},declaration:{dynamicRegistration:!0,linkSupport:!0},definition:{dynamicRegistration:!0,linkSupport:!0},typeDefinition:{dynamicRegistration:!0,linkSupport:!0},implementation:{dynamicRegistration:!0,linkSupport:!0},rename:{dynamicRegistration:!0,prepareSupport:!0}},workspace:{didChangeConfiguration:{dynamicRegistration:!0}}};return{capabilities:this.clientCapabilities?typeof this.clientCapabilities=="function"?this.clientCapabilities(e):this.clientCapabilities:e,initializationOptions:this.initializationOptions,processId:null,rootUri:this.rootUri,workspaceFolders:this.workspaceFolders}}async initialize(){let{capabilities:e}=await this.request("initialize",this.getInitializationOptions(),this.timeout*3);this.capabilities=e,this.notify("initialized",{}),this.ready=!0}close(){this.client.close()}textDocumentDidOpen(e){return this.notify("textDocument/didOpen",e)}textDocumentDidChange(e){return this.notify("textDocument/didChange",e)}async textDocumentHover(e){return await this.request("textDocument/hover",e,this.timeout)}async textDocumentCompletion(e){return await this.request("textDocument/completion",e,this.timeout)}async completionItemResolve(e){return await this.request("completionItem/resolve",e,this.timeout)}async textDocumentDefinition(e){return await this.request("textDocument/definition",e,this.timeout)}async textDocumentCodeAction(e){return await this.request("textDocument/codeAction",e,this.timeout)}async textDocumentRename(e){return await this.request("textDocument/rename",e,this.timeout)}async textDocumentPrepareRename(e){return await this.request("textDocument/prepareRename",e,this.timeout)}async textDocumentSignatureHelp(e){return await this.request("textDocument/signatureHelp",e,this.timeout)}onNotification(e){return this.notificationListeners.add(e),()=>this.notificationListeners.delete(e)}request(e,n,i){return this.client.request({method:e,params:n},i)}notify(e,n){return this.client.notify({method:e,params:n})}processNotification(e){this.notificationListeners.forEach(n=>n(e))}},Il();var ji=Kt(Vu(),1),Og=console.log;function Yk(){return String(Date.now()+Math.random())}var Zk=class{constructor(e){De(this,"documentVersion");De(this,"pluginId");De(this,"client");De(this,"documentUri");De(this,"languageId");De(this,"view");De(this,"allowHTMLContent");De(this,"useSnippetOnCompletion");De(this,"sendIncrementalChanges");De(this,"featureOptions");De(this,"onGoToDefinition");De(this,"markdownRenderer");De(this,"disposeListener");De(this,"lastSeenDiagnosticsVersion",0);let{client:n,documentUri:i,languageId:a,view:s,featureOptions:c,sendIncrementalChanges:d=!0,allowHTMLContent:p=!1,useSnippetOnCompletion:h=!1,onGoToDefinition:v,markdownRenderer:w=Cg}=e;this.documentVersion=0,this.pluginId=Yk(),this.client=n,this.documentUri=i,this.languageId=a,this.view=s,this.allowHTMLContent=p,this.useSnippetOnCompletion=h,this.sendIncrementalChanges=d,this.featureOptions=c,this.onGoToDefinition=v,this.markdownRenderer=w,this.disposeListener=n.onNotification(this.processNotification.bind(this)),this.initialize({documentText:this.view.state.doc.toString()})}update({state:e,docChanged:n,startState:{doc:i},changes:a}){n&&(this.sendIncrementalChanges?this.sendChanges(Hk(i,a)):this.sendChanges([{text:e.doc.toString()}]))}destroy(){var e;(e=this.disposeListener)==null||e.call(this)}async initialize({documentText:e}){this.client.initializePromise&&await this.client.initializePromise,await this.client.textDocumentDidOpen({textDocument:{uri:this.documentUri,languageId:this.languageId,text:e,version:this.documentVersion}})}async sendChanges(e){if(this.client.ready)try{await this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:++this.documentVersion},contentChanges:e})}catch(n){console.error(n)}}requestDiagnostics(e){this.sendChanges([{text:e.state.doc.toString()}])}async requestHoverTooltip(e,{line:n,character:i}){var v;if(!this.featureOptions.hoverEnabled||!(this.client.ready&&((v=this.client.capabilities)!=null&&v.hoverProvider)))return null;let a=await this.client.textDocumentHover({textDocument:{uri:this.documentUri},position:{line:n,character:i}});if(!a)return null;let{contents:s,range:c}=a,d=mn(e.state.doc,{line:n,character:i}),p;if(c&&(d=mn(e.state.doc,c.start),p=mn(e.state.doc,c.end)),d==null||Ul(s))return null;let h=document.createElement("div");return h.classList.add("documentation","cm-lsp-hover-tooltip"),this.allowHTMLContent?h.innerHTML=Or(s,this.markdownRenderer):h.textContent=Or(s,this.markdownRenderer),{pos:d,end:p,create:w=>({dom:h}),above:!0}}async requestCompletion(e,{line:n,character:i},{triggerKind:a,triggerCharacter:s}){var C;if(!this.featureOptions.completionEnabled||!(this.client.ready&&((C=this.client.capabilities)!=null&&C.completionProvider)))return null;let c=await this.client.textDocumentCompletion({textDocument:{uri:this.documentUri},position:{line:n,character:i},context:{triggerKind:a,triggerCharacter:s}});if(!c)return null;let d="items"in c?c.items:c,p=zk(d),h=p?e.matchBefore(p):e.matchBefore(/[a-zA-Z0-9]+/),{pos:v}=e,w=Kk(d,h==null?void 0:h.text,this.languageId);h&&(v=h.from);let _=w.map(E=>{var R,A;return Uk(E,{allowHTMLContent:this.allowHTMLContent,useSnippetOnCompletion:this.useSnippetOnCompletion,hasResolveProvider:((A=(R=this.client.capabilities)==null?void 0:R.completionProvider)==null?void 0:A.resolveProvider)??!1,resolveItem:this.client.completionItemResolve.bind(this.client)})});return{from:v,options:_,filter:!1}}async requestDefinition(e,{line:n,character:i}){var w;if(!this.featureOptions.definitionEnabled||!(this.client.ready&&((w=this.client.capabilities)!=null&&w.definitionProvider)))return;let a=await this.client.textDocumentDefinition({textDocument:{uri:this.documentUri},position:{line:n,character:i}});if(!a)return;let s=Array.isArray(a)?a:[a];if(s.length===0)return;let c=s[0];if(!c)return;let d="uri"in c?c.uri:c.targetUri,p="range"in c?c.range:c.targetRange,h=d!==this.documentUri,v={uri:d,range:p,isExternalDocument:h};return h||e.dispatch(e.state.update({selection:{anchor:Dr(e.state.doc,p.start),head:mn(e.state.doc,p.end)}})),this.onGoToDefinition&&this.onGoToDefinition(v),v}processNotification(e){try{switch(e.method){case"textDocument/publishDiagnostics":this.processDiagnostics(e.params)}}catch(n){Og(n)}}async processDiagnostics(e){if(e.uri!==this.documentUri)return;if(e.version!=null&&e.version>this.lastSeenDiagnosticsVersion&&(this.lastSeenDiagnosticsVersion=e.version,this.clearDiagnostics()),!this.featureOptions.diagnosticsEnabled){this.clearDiagnostics();return}let n={[ji.DiagnosticSeverity.Error]:"error",[ji.DiagnosticSeverity.Warning]:"warning",[ji.DiagnosticSeverity.Information]:"info",[ji.DiagnosticSeverity.Hint]:"info"},i=e.diagnostics.map(async({range:s,message:c,severity:d,code:p,source:h})=>{var w;let v=(w=await this.requestCodeActions(s,[p]))==null?void 0:w.map(_=>{var C;return{name:"command"in _&&typeof _.command=="object"&&((C=_.command)==null?void 0:C.title)||_.title,apply:async()=>{var E;if("edit"in _&&((E=_.edit)!=null&&E.changes)){let R=_.edit.changes[this.documentUri];if(!R)return;for(let A of R)this.view.dispatch(this.view.state.update({changes:{from:Dr(this.view.state.doc,A.range.start),to:mn(this.view.state.doc,A.range.end),insert:A.newText}}))}"command"in _&&_.command&&Og("Executing command:",_.command)}}});return{from:Dr(this.view.state.doc,s.start),to:Dr(this.view.state.doc,s.end),severity:n[d??ji.DiagnosticSeverity.Error],message:c,renderMessage:()=>{let _=document.createElement("div");return _.innerHTML=this.markdownRenderer(c),_},source:h||this.languageId,markClass:this.pluginId,actions:v}}),a=await Promise.all(i);this.addDiagnostics(a)}addDiagnostics(e){if(e.length===0)return;let n=this.view.state,i=[];K3(n,c=>(i.push(c),!0));let a=new Set(e.map(c=>c.source).filter(Boolean)),s=e.filter(c=>!a.has(c.source));this.view.dispatch(s2(n,[...s,...e]))}clearDiagnostics(){this.view.dispatch(s2(this.view.state,[]))}async requestCodeActions(e,n){var i;return!this.featureOptions.codeActionsEnabled||!(this.client.ready&&((i=this.client.capabilities)!=null&&i.codeActionProvider))?null:await this.client.textDocumentCodeAction({textDocument:{uri:this.documentUri},range:e,context:{diagnostics:[{range:e,code:n[0],source:this.languageId,message:""}]}})}async requestRename(e,{line:n,character:i}){var a;if(this.featureOptions.renameEnabled){if(!this.client.ready){Gn(e,"Language server not ready");return}if(!((a=this.client.capabilities)!=null&&a.renameProvider)){Gn(e,"Rename not supported by language server");return}try{let s=await this.client.textDocumentPrepareRename({textDocument:{uri:this.documentUri},position:{line:n,character:i}}).catch(()=>this.prepareRenameFallback(e,{line:n,character:i}));if(!s||"defaultBehavior"in s){Gn(e,"Cannot rename this symbol");return}let c=document.createElement("div");c.className="cm-rename-popup",c.style.cssText="position: absolute; padding: 4px; background: white; border: 1px solid #ddd; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 99;";let d=document.createElement("input");d.type="text",d.style.cssText="width: 200px; padding: 4px; border: 1px solid #ddd;";let p="range"in s?s.range:s,h=mn(e.state.doc,p.start);if(h==null)return;let v=mn(e.state.doc,p.end);d.value=e.state.doc.sliceString(h,v),c.appendChild(d);let w=e.coordsAtPos(h);if(!w)return;c.style.left=`${w.left}px`,c.style.top=`${w.bottom+5}px`;let _=async()=>{let E=d.value.trim();if(!E){Gn(e,"New name cannot be empty"),c.remove();return}if(E===d.defaultValue){c.remove();return}try{let R=await this.client.textDocumentRename({textDocument:{uri:this.documentUri},position:{line:n,character:i},newName:E});await this.applyRenameEdit(e,R)}catch(R){Gn(e,`Rename failed: ${R instanceof Error?R.message:"Unknown error"}`)}finally{c.remove()}};d.addEventListener("keydown",E=>{E.key==="Enter"?_():E.key==="Escape"&&c.remove(),E.stopPropagation()});let C=E=>{c.contains(E.target)||(c.remove(),document.removeEventListener("mousedown",C))};document.addEventListener("mousedown",C),document.body.appendChild(c),d.focus(),d.select()}catch(s){Gn(e,`Rename failed: ${s instanceof Error?s.message:"Unknown error"}`)}}}async requestSignatureHelp(e,{line:n,character:i},a=void 0){var s,c;if(!(this.featureOptions.signatureHelpEnabled&&this.client.ready&&((s=this.client.capabilities)!=null&&s.signatureHelpProvider)))return null;try{let d=await this.client.textDocumentSignatureHelp({textDocument:{uri:this.documentUri},position:{line:n,character:i},context:{isRetrigger:!1,triggerKind:1,triggerCharacter:a}});if(!(d!=null&&d.signatures)||d.signatures.length===0)return null;let p=this.createTooltipContainer(),h=d.activeSignature??0,v=d.signatures[h]||d.signatures[0];if(!v)return null;let w=d.activeParameter??v.activeParameter??0,_=this.createSignatureElement(v,w);p.appendChild(_),v.documentation&&p.appendChild(this.createDocumentationElement(v.documentation));let C=(c=v.parameters)==null?void 0:c[w];C!=null&&C.documentation&&p.appendChild(this.createParameterDocElement(C.documentation));let E=mn(e.state.doc,{line:n,character:i});return E==null?null:{pos:E,end:E,create:R=>({dom:p}),above:!1}}catch(d){return console.error("Signature help error:",d),null}}async showSignatureHelpTooltip(e,n,i){let a=await this.requestSignatureHelp(e,Ii(e.state.doc,n),i);if(a){let{pos:s,create:c}=a,d=c(e),p=document.createElement("div");p.className="cm-tooltip cm-signature-tooltip",p.style.position="absolute",p.appendChild(d.dom);let h=e.coordsAtPos(s);if(h){p.style.left=`${h.left}px`,p.style.top=`${h.bottom+5}px`,document.body.appendChild(p),setTimeout(()=>{p.remove()},1e4);let v=()=>{p.remove(),e.dom.removeEventListener("keydown",v),e.dom.removeEventListener("mousedown",v)};e.dom.addEventListener("keydown",v),e.dom.addEventListener("mousedown",v)}}}createTooltipContainer(){let e=document.createElement("div");return e.classList.add("cm-signature-help"),e.style.cssText="padding: 6px; max-width: 400px;",e}createSignatureElement(e,n){let i=document.createElement("div");if(i.classList.add("cm-signature"),i.style.cssText="font-family: monospace; margin-bottom: 4px;",!e.label||typeof e.label!="string")return i.textContent="Signature information unavailable",i;let a=e.label,s=e.parameters||[];if(s.length===0||!s[n])return i.textContent=a,i;let c=s[n].label;return typeof c=="string"?this.allowHTMLContent?i.innerHTML=a.replace(c,`<strong class="cm-signature-active-param">${c}</strong>`):i.textContent=a.replace(c,`\xAB${c}\xBB`):Array.isArray(c)&&c.length===2?this.applyRangeHighlighting(i,a,c[0],c[1]):i.textContent=a,i}applyRangeHighlighting(e,n,i,a){e.textContent="";let s=n.substring(0,i),c=n.substring(i,a),d=n.substring(a);e.appendChild(document.createTextNode(s));let p=document.createElement("span");p.classList.add("cm-signature-active-param"),p.style.cssText="font-weight: bold; text-decoration: underline;",p.textContent=c,e.appendChild(p),e.appendChild(document.createTextNode(d))}createDocumentationElement(e){let n=document.createElement("div");n.classList.add("cm-signature-docs"),n.style.cssText="margin-top: 4px; color: #666;";let i=Or(e,this.markdownRenderer);return this.allowHTMLContent?n.innerHTML=i:n.textContent=i,n}createParameterDocElement(e){let n=document.createElement("div");n.classList.add("cm-parameter-docs"),n.style.cssText="margin-top: 4px; font-style: italic; border-top: 1px solid #eee; padding-top: 4px;";let i=Or(e,this.markdownRenderer);return this.allowHTMLContent?n.innerHTML=i:n.textContent=i,n}prepareRenameFallback(e,{line:n,character:i}){let a=e.state.doc.line(n+1).text,s=/\w+/g,c,d=i,p=i;for(;(c=s.exec(a))!==null;){let h=c.index,v=c.index+c[0].length;if(i>=h&&i<=v){d=h,p=v;break}}return d===i&&p===i?null:{range:{start:{line:n,character:d},end:{line:n,character:p}},placeholder:a.slice(d,p)}}async applyRenameEdit(e,n){if(!n)return Gn(e,"No edit returned from language server"),!1;let i=n.changes??{},a=n.documentChanges??[];if(Object.keys(i).length===0&&a.length===0)return Gn(e,"No changes to apply"),!1;if(a.length>0)for(let s of a){if("textDocument"in s){if(s.textDocument.uri!==this.documentUri){Gn(e,"Multi-file rename not supported yet");continue}let c=s.edits.sort((d,p)=>{let h=mn(e.state.doc,d.range.start);return(mn(e.state.doc,p.range.start)??0)-(h??0)}).map(d=>({from:mn(e.state.doc,d.range.start)??0,to:mn(e.state.doc,d.range.end)??0,insert:d.newText}));return e.dispatch(e.state.update({changes:c})),!0}return Gn(e,"File creation, deletion, or renaming operations not supported yet"),!1}else if(Object.keys(i).length>0)for(let[s,c]of Object.entries(i)){if(s!==this.documentUri){Gn(e,"Multi-file rename not supported yet");continue}let d=c.sort((p,h)=>{let v=mn(e.state.doc,p.range.start);return(mn(e.state.doc,h.range.start)??0)-(v??0)}).map(p=>({from:mn(e.state.doc,p.range.start)??0,to:mn(e.state.doc,p.range.end)??0,insert:p.newText}));e.dispatch(e.state.update({changes:d}))}return!1}};Mm=function(e){var d;let n=null,i={rename:"F2",goToDefinition:"F12",signatureHelp:"Mod-Shift-Space",...e.keyboardShortcuts},a=e.client,s={diagnosticsEnabled:!0,hoverEnabled:!0,completionEnabled:!0,definitionEnabled:!0,renameEnabled:!0,codeActionsEnabled:!0,signatureHelpEnabled:!0,signatureActivateOnTyping:!1,...e},c=[ra.define(p=>(n=new Zk({client:a,documentUri:e.documentUri??p.state.facet(Rg),languageId:e.languageId??p.state.facet(Xk),view:p,featureOptions:s,sendIncrementalChanges:e.sendIncrementalChanges,allowHTMLContent:e.allowHTMLContent,useSnippetOnCompletion:e.useSnippetOnCompletion,onGoToDefinition:e.onGoToDefinition,markdownRenderer:e.markdownRenderer}),n))];return c.push(na.of([{key:i.signatureHelp,run:p=>{if(!(n&&s.signatureHelpEnabled))return!1;let h=p.state.selection.main.head;return n.showSignatureHelpTooltip(p,h),!0}},{key:i.rename,run:p=>{if(!(n&&s.renameEnabled))return!1;let h=p.state.selection.main.head;return n.requestRename(p,Ii(p.state.doc,h)),!0}},{key:i.goToDefinition,run:p=>{if(!(n&&s.definitionEnabled))return!1;let h=p.state.selection.main.head;return n.requestDefinition(p,Ii(p.state.doc,h)).catch(v=>Gn(p,`Go to definition failed: ${v instanceof Error?v.message:"Unknown error"}`)),!0}}])),s.hoverEnabled&&c.push(a2((p,h)=>n==null?null:n.requestHoverTooltip(p,Ii(p.state.doc,h)),e.hoverConfig)),s.signatureHelpEnabled&&c.push(Tn.updateListener.of(async p=>{var E;if(!(n&&p.docChanged)||!((E=n.client.capabilities)!=null&&E.signatureHelpProvider)||!s.signatureActivateOnTyping)return;let h=n.client.capabilities.signatureHelpProvider.triggerCharacters||["(",","],v,w=p.changes,_=!1,C=-1;w.iterChanges((R,A,H,V,U)=>{if(_)return;let L=U.toString();if(L){for(let G of h)if(L.includes(G)){_=!0,C=V,v=G;break}}}),_&&C>=0&&n.showSignatureHelpTooltip(p.view,C,v)})),s.completionEnabled&&c.push(gu({...e.completionConfig,override:[async p=>{var _,C;if(n==null)return null;let{state:h,pos:v}=p,w=eC(p,((C=(_=n.client.capabilities)==null?void 0:_.completionProvider)==null?void 0:C.triggerCharacters)??[],e.completionMatchBefore);return w==null?null:await n.requestCompletion(p,Ii(h.doc,v),w)},...((d=e.completionConfig)==null?void 0:d.override)||[]]})),c.push(Tn.domEventHandlers({click:(p,h)=>{if(s.definitionEnabled&&i.goToDefinition==="ctrlcmd"&&(p.ctrlKey||p.metaKey)){let v=h.posAtCoords({x:p.clientX,y:p.clientY});v&&n&&(n.requestDefinition(h,Ii(h.state.doc,v)).catch(w=>Gn(h,`Go to definition failed: ${w instanceof Error?w.message:"Unknown error"}`)),p.preventDefault())}}})),c};function eC(e,n,i){let{state:a,pos:s,explicit:c}=e,d=a.doc.lineAt(s),p=ji.CompletionTriggerKind.Invoked,h,v=d.text[s-d.from-1]||"",w=n==null?void 0:n.includes(v);return!c&&w&&(p=ji.CompletionTriggerKind.TriggerCharacter,h=v),p===ji.CompletionTriggerKind.Invoked&&!e.matchBefore(i||/(\w+|\w+\.|\/|,)$/)?null:{triggerKind:p,triggerCharacter:h}}function Pg(){return`file://${Nl()??"/__marimo_notebook__.py"}`}function Ad(){return`file://${Ju.dirname(Nl()??"/")}`}function tC(e){return ei.filter(e,n=>n!==!1&&n!==null)}function Ng(e){let n=e.map(tC);return Object.assign({},...n)}var nC=class{constructor(e){De(this,"clients",[]);this.clients=e,this.documentUri=Pg()}onNotification(e){let n=[];for(let i of this.clients)n.push(i.onNotification(e));return()=>{for(let i of n)i();return!0}}get clientCapabilities(){return Ng(this.clients.map(e=>{if(e.clientCapabilities)return typeof e.clientCapabilities=="function"?e.clientCapabilities({}):e.clientCapabilities}).filter(e=>e!=null))}get ready(){return this.clients.some(e=>e.ready)}set ready(e){this.clients.forEach(n=>{n.ready=e})}get capabilities(){return Ng(this.clients.map(e=>e.capabilities).filter(e=>e!==null))}set capabilities(e){this.clients.forEach(n=>{n.capabilities=e})}get initializePromise(){return this.clients[0].initializePromise}set initializePromise(e){this.clients.forEach(n=>{n.initializePromise=e})}firstWithCapability(e){return this.clients.find(n=>{var i;return(i=n.capabilities)==null?void 0:i[e]})}clientsWithCapability(e){return this.clients.filter(n=>{var i;return(i=n.capabilities)==null?void 0:i[e]})}async initialize(){await Promise.all(this.clients.map(e=>e.initialize()))}async close(){await Promise.all(this.clients.map(e=>e.close()))}async textDocumentDidChange(e){return await Promise.all(this.clients.map(n=>n.textDocumentDidChange(e))),e}async completionItemResolve(e){let n=this.firstWithCapability("completionProvider");return n?n.completionItemResolve(e):e}async textDocumentCodeAction(e){let n=this.firstWithCapability("codeActionProvider");return n?n.textDocumentCodeAction(e):null}async textDocumentRename(e){let n=this.firstWithCapability("renameProvider");return n?n.textDocumentRename(e):null}async textDocumentPrepareRename(e){let n=this.firstWithCapability("renameProvider");return n?n.textDocumentPrepareRename(e):null}async textDocumentSignatureHelp(e){let n=this.firstWithCapability("signatureHelpProvider");return n?n.textDocumentSignatureHelp(e):null}async textDocumentCompletion(e){let n=this.clientsWithCapability("completionProvider");return rC(await Promise.allSettled(n.map(i=>i.textDocumentCompletion(e))))}async textDocumentDefinition(e){let n=this.firstWithCapability("definitionProvider");return n?n.textDocumentDefinition(e):null}async textDocumentDidOpen(e){return await Promise.all(this.clients.map(n=>n.textDocumentDidOpen(e))),e}async textDocumentHover(e){var n;for(let i of this.clients){if(!((n=i.capabilities)!=null&&n.hoverProvider))continue;let a=await i.textDocumentHover(e);if(a)return a}return{contents:[]}}};function rC(e){let n=[],i=!1;for(let a of e)if(a.status==="fulfilled"){let s=a.value;if(s==null)continue;Array.isArray(s)&&n.push(...s),"items"in s&&(n.push(...s.items),i||(i=s.isIncomplete))}return{items:n,isIncomplete:i}}var Kl=class{constructor(e,n={}){De(this,"cache",new Map);this.maxSize=e,this.options=n}getOrCreate(e){dn(this.options.create,"create function is required");let n=this.cache.get(e);if(n!==void 0)return n;let i=this.options.create(e);return this.cache.set(e,i),i}get(e){let n=this.cache.get(e);return n!==void 0&&(this.cache.delete(e),this.cache.set(e,n)),n}set(e,n){if(this.cache.has(e)&&this.cache.delete(e),this.cache.set(e,n),this.cache.size>this.maxSize){let i=this.cache.keys().next().value;i!==void 0&&this.cache.delete(i)}}keys(){return this.cache.keys()}values(){return this.cache.values()}entries(){return this.cache.entries()}delete(e){this.cache.delete(e)}};Ww=function(e){return[...iC(e),e].join(`
123
+ `)};function iC(e){return Nm().map(n=>{let i=ii(n);return i===e?null:i}).filter(Boolean).sort((n,i)=>n.startsWith("import")&&!i.startsWith("import")?-1:!n.startsWith("import")&&i.startsWith("import")?1:0)}var oC=Fe(e=>{let n=e(ft);return ei.fromEntries(n.cellIds.inOrderIds.map(i=>{let a=n.cellHandles[i];return[i,a!=null&&a.current?ii(a.current.editorView):""]}))}),aC=Fe(e=>e(ft).cellIds.inOrderIds),sC=Fe(e=>cC(e(aC),e(mo)));const lC=Fe(e=>({cellIds:e(sC),codes:e(oC)}));function cC(e,n){var h,v;let i=new Map;e.forEach(w=>i.set(w,[]));let a=new Set(e),s=new Set(e);for(let{declaredBy:w,usedBy:_}of Object.values(n))for(let C of w){a.delete(C);for(let E of _)s.delete(E),E!==C&&((h=i.get(C))==null||h.push(E))}let c=new Map;e.forEach(w=>c.set(w,0)),i.forEach(w=>{w.forEach(_=>{c.set(_,(c.get(_)||0)+1)})});let d=[];c.forEach((w,_)=>{w===0&&d.push(_)});let p=[];for(;d.length>0;){let w=d.shift();if(!w)break;p.push(w),(v=i.get(w))==null||v.forEach(_=>{c.set(_,(c.get(_)||0)-1),c.get(_)===0&&d.push(_)})}return[...p.filter(w=>!a.has(w)),...a]}function uC(e,n){let i=new Map,a=0;e.forEach(d=>{i.set(d,a),a+=n[d].split(`
124
+ `).length});function s(d){return i.has(d)||Pe.warn("[lsp] no cell line offsets for",d),i.get(d)??0}let c=e.map(d=>n[d]).join(`
125
+ `);return{cellIds:e,mergedText:c,transformRange:(d,p)=>Mg(d,s(p)),reverseRange:(d,p)=>Mg(d,-s(p)),isInRange:(d,p)=>{let h=n[p].split(`
126
+ `).length,v=i.get(p)||0,w=d.start.line-v,_=d.end.line-v;return w>=0&&_<h},getEditsForNewText:d=>{let p=d.split(`
127
+ `),h=c.split(`
128
+ `);if(p.length!==h.length)throw Error("Cannot apply rename when there are new lines");let v=[];for(let[w,_]of ei.entries(n)){if(!i.has(w))continue;let C=i.get(w)??0,E=_.split(`
129
+ `).length,R=p.slice(C,C+E);v.push({cellId:w,text:R.join(`
130
+ `)})}return v},transformPosition:(d,p)=>Ql(d,s(p)),reversePosition:(d,p)=>Ql(d,-s(p))}}function Mg(e,n){return{start:Ql(e.start,n),end:Ql(e.end,n)}}function Ql(e,n){return{line:e.line+n,character:e.character}}const Jn={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 Lg(e){return"notify"in e}var dC=class{constructor(e){De(this,"documentVersion",0);De(this,"versionToCellNumberAndVersion",new Kl(20));De(this,"lastSnapshot",null);this.getNotebookCode=e}snapshot(){var i;let e=this.getLens(),n=((i=this.lastSnapshot)==null?void 0:i.mergedText)!==e.mergedText;return n?(this.documentVersion++,this.lastSnapshot=e,{lens:e,didChange:n,version:this.documentVersion}):{lens:e,didChange:n,version:this.documentVersion}}getSnapshot(e){let n=this.versionToCellNumberAndVersion.get(e);if(!n)throw Error(`No snapshot for version ${e}`);return n}getLatestSnapshot(){if(!this.lastSnapshot)throw Error("No snapshots");return{lens:this.lastSnapshot,version:this.documentVersion}}getLens(){let{cellIds:e,codes:n}=this.getNotebookCode();return uC(e,n)}},fC=()=>{let e=qu().cellHandles;return ei.mapValues(e,n=>{var i;return(i=n.current)==null?void 0:i.editorViewOrNull})},Id=(zi=class{constructor(n,i,a=fC){De(this,"completionItemCache",new Kl(10));this.documentUri=Pg(),this.getNotebookEditors=a,this.initialSettings=i,this.client=n,this.patchProcessNotification(),this.initializePromise.then(()=>{dn(Lg(this.client),"notify is not a method on the client"),this.client.notify("workspace/didChangeConfiguration",{settings:i})}),this.snapshotter=new dC(this.getNotebookCode.bind(this))}onNotification(n){return this.client.onNotification(n)}get ready(){return this.client.ready}set ready(n){this.client.ready=n}get capabilities(){return this.client.capabilities}set capabilities(n){this.client.capabilities=n}get initializePromise(){return this.client.initializePromise}set initializePromise(n){this.client.initializePromise=n}get clientCapabilities(){return this.client.clientCapabilities}async initialize(){await this.client.initialize()}close(){this.client.close()}async resyncAllDocuments(){dn(Lg(this.client),"notify is not a method on the client"),await this.client.initialize(),this.client.notify("workspace/didChangeConfiguration",{settings:this.initialSettings});let{lens:n,version:i}=this.snapshotter.snapshot();await this.client.textDocumentDidOpen({textDocument:{languageId:"python",text:n.mergedText,uri:this.documentUri,version:i}}),Pe.log("[lsp] Document re-synchronization complete")}getNotebookCode(){return ct.get(lC)}assertCellDocumentUri(n){dn(Jn.is(n),"Execpted URI to be CellDocumentUri")}async textDocumentDidOpen(n){Pe.debug("[lsp] textDocumentDidOpen",n);let i=n.textDocument.uri;this.assertCellDocumentUri(i);let{lens:a,version:s}=this.snapshotter.snapshot();zi.SEEN_CELL_DOCUMENT_URIS.add(i);let c=await this.client.textDocumentDidOpen({textDocument:{languageId:n.textDocument.languageId,text:a.mergedText,uri:this.documentUri,version:s}});return c?{...c,textDocument:{...c.textDocument,text:a.mergedText}}:n}async sync(){let{lens:n,version:i,didChange:a}=this.snapshotter.snapshot();return a?this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:i},contentChanges:[{text:n.mergedText}]}):{textDocument:{uri:this.documentUri,version:i},contentChanges:[{text:n.mergedText}]}}async textDocumentDidChange(n){return Pe.debug("[lsp] textDocumentDidChange",n),n.contentChanges.length===1?this.sync():(Pe.warn("[lsp] Unhandled textDocumentDidChange",n),this.client.textDocumentDidChange(n))}async textDocumentDefinition(n){let i=n.textDocument.uri;if(!Jn.is(i))return Pe.warn("Invalid cell document URI",i),null;await this.sync();let{lens:a}=this.snapshotter.getLatestSnapshot(),s=Jn.parse(i);return this.client.textDocumentDefinition({...n,textDocument:{uri:this.documentUri},position:a.transformPosition(n.position,s)})}async textDocumentSignatureHelp(n){let i=n.textDocument.uri;if(!Jn.is(i))return Pe.warn("Invalid cell document URI",i),null;await this.sync();let{lens:a}=this.snapshotter.getLatestSnapshot(),s=Jn.parse(i);return await this.client.textDocumentSignatureHelp({...n,textDocument:{uri:this.documentUri},position:a.transformPosition(n.position,s)})||null}textDocumentCodeAction(n){return Promise.resolve(null)}async textDocumentRename(n){var C;let i=n.textDocument.uri;if(!Jn.is(i))return Pe.warn("Invalid cell document URI",i),null;let a=Jn.parse(i);await this.sync();let{lens:s}=this.snapshotter.getLatestSnapshot(),c=s.transformPosition(n.position,a),d=await this.client.textDocumentRename({...n,textDocument:{uri:this.documentUri},position:c});if(!d)return null;let p=(C=d.documentChanges)==null?void 0:C.flatMap(E=>"edits"in E?E.edits:[]);if(!p||p.length!==1)return Pe.warn("Expected exactly one edit",p),d;let h=p[0];if(!("newText"in h))return Pe.warn("Expected newText in edit",h),d;let v=s.getEditsForNewText(h.newText),w=new Map(v.map(E=>[E.cellId,E.text])),_=this.getNotebookEditors();for(let[E,R]of ei.entries(_)){let A=w.get(E);if(A==null){Pe.warn("No new code for cell",E);continue}if(!R){Pe.warn("No view for plugin",E);continue}R.state.doc.toString()!==A&&R.dispatch({changes:{from:0,to:R.state.doc.length,insert:A}})}return{...d,documentChanges:[{edits:[],textDocument:{uri:i,version:0}}]}}async completionItemResolve(n){let i=JSON.stringify(n),a=this.completionItemCache.get(i);if(a)return a;let s=this.client.completionItemResolve(n);return this.completionItemCache.set(i,s),s}async textDocumentPrepareRename(n){let i=n.textDocument.uri;if(!Jn.is(i))return Pe.warn("Invalid cell document URI",i),null;await this.sync();let{lens:a}=this.snapshotter.getLatestSnapshot(),s=Jn.parse(i);return this.client.textDocumentPrepareRename({...n,textDocument:{uri:this.documentUri},position:a.transformPosition(n.position,s)})}async textDocumentHover(n){Pe.debug("[lsp] textDocumentHover",n),await this.sync();let{lens:i}=this.snapshotter.getLatestSnapshot(),a=Jn.parse(n.textDocument.uri),s=await this.client.textDocumentHover({...n,textDocument:{uri:this.documentUri},position:i.transformPosition(n.position,a)});return s?(typeof s.contents=="object"&&"kind"in s.contents&&(s.contents={kind:"markdown",value:s.contents.value}),s.contents===""?null:(s.range&&(s.range=i.reverseRange(s.range,a)),s)):(Pe.debug("[lsp] no hover result"),s)}async textDocumentCompletion(n){let{lens:i}=this.snapshotter.getLatestSnapshot(),a=Jn.parse(n.textDocument.uri);return this.client.textDocumentCompletion({...n,textDocument:{uri:this.documentUri},position:i.transformPosition(n.position,a)})}patchProcessNotification(){dn("processNotification"in this.client,"processNotification is not a method on the client");let n=this.client.processNotification.bind(this.client),i=a=>{if(a.method==="textDocument/publishDiagnostics"){Pe.debug("[lsp] handling diagnostics",a);let s=this.snapshotter.getLatestSnapshot(),c=a.params.diagnostics,{lens:d,version:p}=s,h=new Map;for(let w of c)for(let _ of d.cellIds)if(d.isInRange(w.range,_)){h.has(_)||h.set(_,[]);let C={...w,range:d.reverseRange(w.range,_)};h.get(_).push(C);break}let v=new Set(zi.SEEN_CELL_DOCUMENT_URIS);for(let[w,_]of h.entries()){Pe.debug("[lsp] diagnostics for cell",w,_);let C=Jn.of(w);v.delete(C),n({...a,params:{...a.params,uri:C,version:p,diagnostics:_}})}if(v.size>0){Pe.debug("[lsp] clearing diagnostics",v);for(let w of v)n({method:"textDocument/publishDiagnostics",params:{uri:w,diagnostics:[]}})}return}return n(a)};this.client.processNotification=i}},De(zi,"SEEN_CELL_DOCUMENT_URIS",new Set),zi),pC=Kt(Il(),1),mC=Kt(go(),1),hC=class extends mC.Transport{constructor(n){super();De(this,"isClosed",!1);De(this,"hasConnectedBefore",!1);this.options=n,this.delegate=void 0}createDelegate(){if(this.delegate)try{this.delegate.close()}catch(n){Pe.warn("Error closing old WebSocket delegate",n)}return this.delegate=new pC.WebSocketTransport(this.options.getWsUrl()),this.delegate}isDelegateClosedOrClosing(){if(!this.delegate)return!0;let n=this.delegate.connection;return n?n.readyState===WebSocket.CLOSING||n.readyState===WebSocket.CLOSED:!0}async connect(){if(this.isClosed)throw Error("Transport is closed");return this.connectionPromise||(this.connectionPromise=(async()=>{try{this.options.waitForConnection&&await this.options.waitForConnection();let n=this.delegate;(!n||this.isDelegateClosedOrClosing())&&(n=this.createDelegate()),await n.connect(),Pe.log("WebSocket transport connected successfully");let i=this.hasConnectedBefore;this.hasConnectedBefore=!0,i&&this.options.onReconnect&&(Pe.log("Calling onReconnect callback to re-synchronize state"),await this.options.onReconnect())}catch(n){throw Pe.error("WebSocket transport connection failed",n),this.delegate=void 0,n}finally{this.connectionPromise=void 0}})()),this.connectionPromise}close(){var n;this.isClosed=!0,(n=this.delegate)==null||n.close(),this.delegate=void 0,this.connectionPromise=void 0}async sendData(n,i){var a;if(this.isDelegateClosedOrClosing()){Pe.warn("WebSocket is closed or closing, attempting to reconnect");try{await this.connect()}catch(s){throw Pe.error("Failed to reconnect WebSocket",s),s}}return(a=this.delegate)==null?void 0:a.sendData(n,i)}};function jd(e,n){let i=C3();return new hC({getWsUrl:()=>i.getLSPURL(e).toString(),waitForConnection:async()=>{await sR()},onReconnect:n})}Pm=function(e){return e===ni.CONNECTING},Ku=function(e){return e===ni.OPEN},Nw=function(e){return e===ni.CLOSED||e===ni.CLOSING||e===ni.CONNECTING},Aw=function(e){switch(e){case ni.CLOSED:return"App disconnected";case ni.CONNECTING:return"Connecting to a runtime ...";case ni.CLOSING:return"App disconnecting...";case ni.OPEN:return"";default:return""}};var Ag=ta.define(),Ig=new du,qd="marimo-connecting-indicator";function gC(){let e=document.getElementById(qd);return e||(e=document.createElement("div"),e.id=qd,e.textContent="Connecting\u2026",e.style.position="fixed",e.style.zIndex="9999",e.style.background="#222",e.style.color="#fff",e.style.padding="2px 8px",e.style.borderRadius="6px",e.style.fontSize="0.9em",e.style.boxShadow="0 2px 8px rgba(0,0,0,0.15)",e.style.pointerEvents="none",e.style.display="none",document.body.append(e)),e}function jg(e,n){let i=gC();i.style.left=`${e}px`,i.style.top=`${n}px`,i.style.display="block",i.textContent="Connecting\u2026"}function zd(){let e=document.getElementById(qd);e&&(e.style.display="none")}var Fd=null;mw=function(e){let n=()=>e.get(El).state,i=!Ku(n()),a=ra.define(s=>{let c=!1,d=s.dom;function p(){let C=s.state.selection.main,E=s.coordsAtPos(C.head);E?jg(E.left+2,E.bottom+2):jg(window.innerWidth/2,window.innerHeight*.1),Fd&&window.clearTimeout(Fd),Fd=window.setTimeout(zd,1500)}function h(){p()}function v(){c||(c=(d.addEventListener("keydown",h,{capture:!0}),d.addEventListener("paste",h,{capture:!0}),!0))}function w(){c&&(c=(d.removeEventListener("keydown",h,{capture:!0}),d.removeEventListener("paste",h,{capture:!0}),!1))}let _=e.sub(El,()=>{e.get(El).state===ni.CONNECTING?v():(w(),zd())});return Pm(n())&&v(),{destroy(){w(),_(),zd()}}});return[Ig.of(mu.readOnly.of(i)),mu.transactionExtender.of(s=>{for(let c of s.effects)if(c.is(Ag)){let d=c.value;if(d!==i)return i=d,{effects:Ig.reconfigure(mu.readOnly.of(d))}}return null}),ra.define(s=>{let c=e.sub(El,()=>{let d=!Ku(e.get(El).state);s.dispatch({effects:Ag.of(d)})});return{destroy(){c()}}}),a]};function yC(e){return e.facet(mu.readOnly)}function vC(e){return[o2(e),na.of([{key:"ArrowRight",preventDefault:!0,run:n=>qg(n,e)},{key:"Tab",preventDefault:!0,run:n=>qg(n,e)}])]}function qg(e,n){if(yC(e.state))return!1;let i=e.state.doc.length;return i===0?(e.dispatch({changes:{from:0,to:i,insert:n},selection:{head:n.length,anchor:n.length}}),!0):!1}function bC(e){let{beforeText:n,linkText:i,afterText:a,onClick:s}=e;return[o2(c=>{let d=document.createElement("span");d.append(document.createTextNode(n));let p=document.createElement("span");return p.textContent=i,p.classList.add("cm-clickable-placeholder"),p.onclick=h=>{h.stopPropagation(),s(c)},d.append(p),d.append(document.createTextNode(a)),d}),Tn.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 wC=ti(e=>{let n,i={transport:jd("pylsp",async()=>{await(n==null?void 0:n())}),rootUri:Ad(),workspaceFolders:[]},a=e==null?void 0:e.pylsp,s=["D100","D103"],c=["W292","E402"],d=["B018","I001"],p={pylsp:{plugins:{marimo_plugin:{enabled:!0},jedi:{auto_import_modules:["numpy"]},jedi_completion:{include_params:!0,resolve_at_most:50},flake8:{enabled:a==null?void 0:a.enable_flake8,extendIgnore:c},pydocstyle:{enabled:a==null?void 0:a.enable_pydocstyle,ignore:s},pylint:{enabled:a==null?void 0:a.enable_pylint},pyflakes:{enabled:a==null?void 0:a.enable_pyflakes},pylsp_mypy:{enabled:a==null?void 0:a.enable_mypy,live_mode:!0},ruff:{enabled:a==null?void 0:a.enable_ruff,extendIgnore:[...c,...s,...d]},signature:{formatter:a!=null&&a.enable_ruff?"ruff":"black",line_length:88}}}},h=new Id(new Ll({...i}),p);return n=()=>h.resyncAllDocuments(),h}),_C=ti(e=>{let n,i=new Id(new Ll({transport:jd("ty",async()=>{await(n==null?void 0:n())}),rootUri:Ad(),workspaceFolders:[],getWorkspaceConfiguration:a=>[{disableLanguageServices:!0}]}),{});return n=()=>i.resyncAllDocuments(),i}),xC=ti(e=>{let n,i=new Id(new Ll({transport:jd("basedpyright",async()=>{await(n==null?void 0:n())}),rootUri:Ad(),workspaceFolders:[]}),{});return n=()=>i.resyncAllDocuments(),i}),kC=class{constructor(){De(this,"parser",new sx);De(this,"type","python");De(this,"defaultCode",this.parser.defaultCode);De(this,"defaultMetadata",this.parser.defaultMetadata)}transformIn(e){let n=this.parser.transformIn(e);return[n.code,n.offset,n.metadata]}transformOut(e,n){let i=this.parser.transformOut(e,n);return[i.code,i.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,i,a,s){return[(()=>{var h,v,w,_;let c={defaultKeymap:!1,activateOnTyping:n.activate_on_typing,closeOnBlur:!1},d={hideOnChange:!0},p=[];if((h=s==null?void 0:s.pylsp)!=null&&h.enabled&&zl("pylsp")&&p.push(wC(s)),(v=s==null?void 0:s.ty)!=null&&v.enabled&&zl("ty")&&p.push(_C(s)),(w=s==null?void 0:s.basedpyright)!=null&&w.enabled&&zl("basedpyright")&&p.push(xC(s)),p.length>0){let C=p.length===1?p[0]:new nC(p);return[Mm({client:C,languageId:"python",allowHTMLContent:!0,useSnippetOnCompletion:!1,hoverConfig:d,completionConfig:c,diagnosticsEnabled:((_=s.diagnostics)==null?void 0:_.enabled)??!1,sendIncrementalChanges:!1,signatureHelpEnabled:!0,signatureActivateOnTyping:!1,keyboardShortcuts:{signatureHelp:i.getHotkey("cell.signatureHelp").key,goToDefinition:i.getHotkey("cell.goToDefinition").key,rename:i.getHotkey("cell.renameSymbol").key},completionMatchBefore:/(\w+|\w+\.|\(|\/|,)$/,onGoToDefinition:E=>{Pe.debug("onGoToDefinition",E),C.documentUri!==E.uri&&Ri().openFile({path:E.uri.replace("file://","")})}}),Rg.of(Jn.of(e))]}return gu({...c,override:[_0]})})(),qm(),CC(a)]}};function CC(e){return e==="marimo-import"?hu.highest(vC("import marimo as mo")):e==="ai"?bC({beforeText:"Start coding or ",linkText:"generate",afterText:" with AI.",onClick:n=>{n.state.facet(Dt).aiCellCompletion()}}):[]}var Bd=Yp.configure({props:[T3.add({ParenthesizedExpression:Yb,ArgList:Yb})]});qm=function(){return new i2(Bd,[Bd.data.of({autocomplete:rR}),Bd.data.of({autocomplete:iR})])};function SC(e){return Array.isArray(e)}function EC(e){var s,c,d,p,h,v,w;let n=e.path.join("."),i=((s=e.completion)==null?void 0:s.label)||e.value||e.path[e.path.length-1]||"unknown",a=`<div class="sql-hover-${e.semanticType}">`;switch(a+=`<div class="sql-hover-header"><strong>${i}</strong> <span class="sql-hover-type">${e.semanticType}</span></div>`,e.semanticType){case"database":if(a+=`<div class="sql-hover-description">Database${(c=e.completion)!=null&&c.detail?`: ${e.completion.detail}`:""}</div>`,e.namespace){let _=Gl(e.namespace);_>0&&(a+=`<div class="sql-hover-children">Contains ${_} schema${_===1?"":"s"}</div>`)}break;case"schema":if(a+=`<div class="sql-hover-description">Schema${(d=e.completion)!=null&&d.detail?`: ${e.completion.detail}`:""}</div>`,n&&(a+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${n}</code></div>`),e.namespace){let _=Gl(e.namespace);_>0&&(a+=`<div class="sql-hover-children">Contains ${_} table${_===1?"":"s"}</div>`)}break;case"table":if(a+=`<div class="sql-hover-description">Table${(p=e.completion)!=null&&p.detail?`: ${e.completion.detail}`:""}</div>`,n){let _=e.path;_.length>1&&(a+=`<div class="sql-hover-path"><strong>Schema:</strong> <code>${_.slice(0,-1).join(".")}</code></div>`)}if(e.namespace&&SC(e.namespace)){let _=e.namespace;if(_.length>0){a+=`<div class="sql-hover-columns"><strong>Columns (${_.length}):</strong><br>`;let C=_.slice(0,8).map(E=>typeof E=="string"?E:E.label);a+=C.map(E=>`<code>${E}</code>`).join(", "),_.length>8&&(a+=`, <em>and ${_.length-8} more...</em>`),a+="</div>"}}break;case"column":if(a+=`<div class="sql-hover-description">Column${(h=e.completion)!=null&&h.detail?`: ${e.completion.detail}`:""}</div>`,n){let _=e.path;_.length>1&&(a+=`<div class="sql-hover-path"><strong>Table:</strong> <code>${_.slice(0,-1).join(".")}</code></div>`)}break;default:if(a+=`<div class="sql-hover-description">Namespace${(v=e.completion)!=null&&v.detail?`: ${e.completion.detail}`:""}</div>`,n&&(a+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${n}</code></div>`),e.namespace){let _=Gl(e.namespace);_>0&&(a+=`<div class="sql-hover-children">Contains ${_} item${_===1?"":"s"}</div>`)}break}return(w=e.completion)!=null&&w.info&&typeof e.completion.info=="string"&&(a+=`<div class="sql-hover-info">${e.completion.info}</div>`),a+="</div>",a}function Gl(e){return Array.isArray(e)?e.length:typeof e=="object"&&e?"self"in e&&"children"in e?1+Gl(e.children):Object.keys(e).length:0}function TC(e){let{keyword:n,info:i}=e,a='<div class="sql-hover-keyword">';if(a+=`<div class="sql-hover-header"><strong>${n.toUpperCase()}</strong> <span class="sql-hover-type">keyword</span></div>`,a+=`<div class="sql-hover-description">${i.description}</div>`,i.syntax&&(a+=`<div class="sql-hover-syntax"><strong>Syntax:</strong> <code>${i.syntax}</code></div>`),i.example&&(a+=`<div class="sql-hover-example"><strong>Example:</strong><br><code>${i.example}</code></div>`),i.metadata&&typeof i.metadata=="object"&&Object.keys(i.metadata).length>0){a+='<div class="sql-hover-metadata">';for(let[s,c]of Object.entries(i.metadata))a+=`<span class="sql-hover-tag" title="${s}">${c}</span> `;a+="</div>"}return a+="</div>",a}function RC(e){let{tableName:n,columns:i,metadata:a}=e,s='<div class="sql-hover-table">';if(s+=`<div class="sql-hover-header"><strong>${n}</strong> <span class="sql-hover-type">table</span></div>`,s+=`<div class="sql-hover-description">Table with ${i.length} column${i.length===1?"":"s"}</div>`,i.length>0){s+='<div class="sql-hover-columns"><strong>Columns:</strong><br>';let c=i.slice(0,10);s+=c.map(d=>`<code>${d}</code>`).join(", "),i.length>10&&(s+=`, <em>and ${i.length-10} more...</em>`),s+="</div>"}if(a&&typeof a=="object"&&Object.keys(a).length>0){s+='<div class="sql-hover-metadata">';for(let[c,d]of Object.entries(a))s+=`<span class="sql-hover-tag" title="${c}">${d}</span> `;s+="</div>"}return s+="</div>",s}function DC(e){let{tableName:n,columnName:i,schema:a,metadata:s}=e,c='<div class="sql-hover-column">';c+=`<div class="sql-hover-header"><strong>${i}</strong> <span class="sql-hover-type">column</span></div>`,c+=`<div class="sql-hover-description">Column in table <code>${n}</code></div>`;let d=a[n];if(d&&d.length>1){let p=d.filter(h=>h!==i);if(p.length>0){c+=`<div class="sql-hover-related"><strong>Other columns in ${n}:</strong><br>`;let h=p.slice(0,8);c+=h.map(v=>`<code>${v}</code>`).join(", "),p.length>8&&(c+=`, <em>and ${p.length-8} more...</em>`),c+="</div>"}}if(s&&typeof s=="object"&&Object.keys(s).length>0){c+='<div class="sql-hover-metadata">';for(let[p,h]of Object.entries(s))c+=`<span class="sql-hover-tag" title="${p}">${h}</span> `;c+="</div>"}return c+="</div>",c}const OC={keyword:TC,table:RC,column:DC,namespace:EC};var PC={...tm,caseInsensitiveIdentifiers:!0,identifierQuotes:"`"};const zg=nm.define(PC),Fg=nm.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 NC=new Set(["postgresql","postgres","db2","mysql","sqlite","mssql","sqlserver","duckdb","mariadb","cassandra","noql","athena","bigquery","hive","redshift","snowflake","flink","mongodb","oracle","oracledb","timescaledb"]);function Hd(e){return NC.has(e)}function Bg(e){let n=e.dialect;if(!Hd(n))return fs;switch(n){case"postgresql":case"postgres":return tm;case"mysql":return dR;case"sqlite":return cR;case"mssql":case"sqlserver":return pR;case"duckdb":return Fg;case"mariadb":return mR;case"cassandra":return hR;case"oracledb":case"oracle":return lR;case"bigquery":return zg;case"timescaledb":return tm;case"athena":case"db2":case"hive":case"redshift":case"snowflake":case"flink":case"mongodb":case"noql":return Pe.debug("Unsupported dialect",{dialect:n}),fs;default:return Tl(n),fs}}var MC={...fR,caseInsensitiveIdentifiers:!0,identifierQuotes:"'"};let fs;fs=nm.define(MC),Oi="__marimo_duckdb",ls=new Set([Oi]),Vw="memory",Rl=function(e){return e===""};var ps={formatTableName:e=>e,formatSelectClause:(e,n)=>`SELECT ${e} FROM ${n} LIMIT 100`};function LC(e){if(e=e.toLowerCase(),!Hd(e))return ps;switch(e){case"bigquery":{let n=zg.spec.identifierQuotes;return{formatTableName:i=>`${n}${i}${n}`,formatSelectClause:ps.formatSelectClause}}case"mssql":case"sqlserver":return{formatTableName:ps.formatTableName,formatSelectClause:(n,i)=>`SELECT TOP 100 ${n} FROM ${i}`};case"timescaledb":case"postgres":case"postgresql":case"duckdb":return{formatTableName:n=>n.split(".").map(i=>`"${i}"`).join("."),formatSelectClause:(n,i)=>`SELECT ${n==="*"?"*":`"${n}"`} FROM ${i} LIMIT 100`};case"db2":case"mysql":case"sqlite":case"mariadb":case"cassandra":case"noql":case"athena":case"hive":case"redshift":case"snowflake":case"flink":case"mongodb":case"oracle":case"oracledb":return ps;default:return Tl(e),ps}}ww=function({table:e,columnName:n,sqlTableContext:i}){if(i){let{engine:a,schema:s,defaultSchema:c,defaultDatabase:d,database:p,dialect:h}=i,v=e.name;Rl(s)?v=p===d?v:`${p}.${v}`:(s!==c&&(v=`${s}.${v}`),p!==d&&(v=`${p}.${v}`));let w=LC(h),_=w.formatTableName(v),C=w.formatSelectClause(n,_);return a==="__marimo_duckdb"?`_df = mo.sql(f"""
131
+ ${C}
132
+ """)`:`_df = mo.sql(f"""
133
+ ${C}
134
+ """, engine=${a})`}return`_df = mo.sql(f'SELECT "${n}" FROM ${e.name} LIMIT 100')`},G2=function(e,n){if(n==="date"||n==="datetime"||n==="time"){if(e==="min")return"Earliest";if(e==="max")return"Latest"}return e};function AC(){return{tables:[],expandedTables:new Set,expandedColumns:new Set,columnsPreviews:new Map}}var{reducer:qR,createActions:zR,valueAtom:Hg,useActions:IC}=Sl(AC,{addDatasets:(e,n)=>{let{previewDatasetColumn:i}=Ri();for(let p of n.tables)for(let h of p.columns){let v=`${p.name}:${h.name}`;e.expandedColumns.has(v)&&i({tableName:p.name,columnName:h.name,source:p.source,sourceType:p.source_type})}let a=e.tables;n.clear_channel&&(a=a.filter(p=>p.source!==n.clear_channel));let s=[...n.tables,...a],c=new Set,d=s.filter(p=>{let h=`${p.name}:${p.source}`;return c.has(h)?!1:(c.add(h),!0)}).sort((p,h)=>p.name.localeCompare(h.name));return{...e,tables:d}},filterDatasetsFromVariables:(e,n)=>{let i=new Set(n),a=e.tables.filter(s=>s.variable_name?i.has(s.variable_name):!0);return{...e,tables:a}},toggleTable:(e,n)=>{let i=new Set(e.expandedTables);return i.has(n)?i.delete(n):i.add(n),{...e,expandedTables:i}},toggleColumn:(e,n)=>{let i=`${n.table}:${n.column}`,a=new Set(e.expandedColumns);return a.has(i)?a.delete(i):a.add(i),{...e,expandedColumns:a}},closeAllColumns:e=>({...e,expandedColumns:new Set}),addColumnPreview:(e,n)=>{let i=`${n.table_name}:${n.column_name}`,a=new Map(e.columnsPreviews);return a.set(i,n),{...e,columnsPreviews:a}}});sw=()=>Un(Hg),ku=Fe(e=>e(Hg).tables),uw=Fe(new Set),Fw=Fe(!1),dw=function(){return IC()};var jC=new Map([[Oi,{name:Oi,dialect:"duckdb",source:"duckdb",display_name:"DuckDB (In-Memory)",databases:[]}]]);function qC(){return{latestEngineSelected:Oi,connectionsMap:jC}}let zC,FC;({reducer:zC,createActions:FC,valueAtom:aa,useActions:F2}=Sl(qC,{addDataSourceConnection:(e,n)=>{if(n.connections.length===0)return e;let{latestEngineSelected:i,connectionsMap:a}=e,s=new Map(a);for(let c of n.connections)s.set(c.name,c);return{latestEngineSelected:i,connectionsMap:s}},filterDataSourcesFromVariables:(e,n)=>{let{latestEngineSelected:i,connectionsMap:a}=e,s=new Set(n),c=new Map([...a].filter(([d])=>ls.has(d)?!0:s.has(d)));return{latestEngineSelected:c.has(i)?i:Oi,connectionsMap:c}},clearDataSourceConnections:()=>({latestEngineSelected:Oi,connectionsMap:new Map}),removeDataSourceConnection:(e,n)=>{let{latestEngineSelected:i,connectionsMap:a}=e,s=new Map(a);return s.delete(n),{latestEngineSelected:s.has(i)?i:Oi,connectionsMap:s}},addTableList:(e,n)=>{let{tables:i,sqlTableContext:a}=n,{connectionsMap:s,latestEngineSelected:c}=e,d=a.engine,p=s.get(d);if(!p)return e;let h=new Map(s),v={...p,databases:p.databases.map(w=>w.name===a.database?{...w,schemas:w.schemas.map(_=>_.name===a.schema?{..._,tables:i}:_)}:w)};return h.set(d,v),{latestEngineSelected:c,connectionsMap:h}},addTable:(e,n)=>{let{table:i,sqlTableContext:a}=n,{connectionsMap:s,latestEngineSelected:c}=e,d=a.engine,p=i.name,h=s.get(d);if(!h)return e;let v=new Map(s),w={...h,databases:h.databases.map(_=>_.name===a.database?{..._,schemas:_.schemas.map(C=>{if(C.name!==a.schema)return C;let E=C.tables.length===0?[i]:C.tables.map(R=>R.name===p?i:R);return{...C,tables:E}})}:_)};return v.set(d,w),{latestEngineSelected:c,connectionsMap:v}}})),Ou=Fe(e=>e(aa).connectionsMap);function Vg(e){let n=ct.get(aa);n.connectionsMap.has(e)&&ct.set(aa,{...n,latestEngineSelected:e})}A2=Fe(e=>{let n=ct.get(ku),i=e(aa).connectionsMap,a=new Map;for(let s of n)a.set(s.name,s);for(let s of i.values())for(let c of s.databases){let d=c.name===s.default_database||s.databases.length===1;for(let p of c.schemas){let h=p.name===s.default_schema,v=Rl(p.name);for(let w of p.tables){let _;if(_=w.name,v){_=d?w.name:`${c.name}.${w.name}`,a.has(_)?Pe.warn(`Table name collision for ${_}. Skipping.`):a.set(_,w);continue}if(d&&h&&!a.has(_)){a.set(_,w);continue}if(_=`${p.name}.${w.name}`,d&&!a.has(_)){a.set(_,w);continue}_=`${c.name}.${p.name}.${w.name}`,a.has(_)?Pe.warn(`Table name collision for ${_}. Skipping.`):a.set(_,w)}}}return a}),P2=function(e){return e.variable_name?"dataframe":"table"};var BC=class s_{static jsonStringifySortKeys(){return n=>typeof n!="object"||!n?String(n):JSON.stringify(n,Object.keys(n).sort(),2)}constructor(n,i={}){this.delegate=n,this.toKey=i.toKey??s_.jsonStringifySortKeys(),this.cache=new Kl(i.maxSize??128)}request(n){let i=this.toKey(n),a=this.cache.get(i);if(a!==void 0)return a;let s=this.delegate.request(n);return this.cache.set(i,s),s.catch(c=>{throw this.cache.delete(i),c})}resolve(n,i){this.delegate.resolve(n,i)}reject(n,i){this.delegate.reject(n,i)}};t_=new yu("sql-table-preview",async(e,n)=>{await Ri().previewSQLTable({requestId:e,...n})}),x2=new yu("sql-table-list-preview",async(e,n)=>{await Ri().previewSQLTableList({requestId:e,...n})}),Tm=new BC(new yu("validate-sql",async(e,n)=>{await Ri().validateSQL({requestId:e,...n})}),{maxSize:3});var HC=Kt(zr(),1);let ko;ko=Fe(new Map),J2=e=>{let n=(0,HC.c)(3),i=Un(ko),a;return n[0]!==e||n[1]!==i?(a=i.get(e),n[0]=e,n[1]=i,n[2]=a):a=n[2],a};function $g(e){let n=ct.get(ko),i=new Map(n);i.delete(e),ct.set(ko,i)}function VC(){ct.set(ko,new Map)}function $C({cellId:e,errorMessage:n,dialect:i}){let a=ct.get(ko),s=new Map(a),c=i==="DuckDB"?WC(n):Wg(n);s.set(e,c),ct.set(ko,s)}function WC(e){let{errorType:n,errorMessage:i}=Wg(e),a=i,s,c=i.indexOf("LINE ");return c!==-1&&(s=i.slice(Math.max(0,c)).trim(),a=i.slice(0,Math.max(0,c)).trim()),{errorType:n,errorMessage:a,codeblock:s}}function Wg(e){return{errorType:e.split(":")[0].trim(),errorMessage:e.split(":").slice(1).join(":").trim()}}let Vd,Ug,$d,Wd;wm=qn("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"}]]),hm=qn("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"}]]),Vd=qn("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"}]]),um=qn("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"}]]),km=qn("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Ug=qn("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"}]]),_m=qn("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]),$d=qn("database-backup",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 12a9 3 0 0 0 5 2.69",key:"1ui2ym"}],["path",{d:"M21 9.3V5",key:"6k6cib"}],["path",{d:"M3 5v14a9 3 0 0 0 6.47 2.88",key:"i62tjy"}],["path",{d:"M12 12v4h4",key:"1bxaet"}],["path",{d:"M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16",key:"1f4ei9"}]]),as=qn("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"}]]),Bu=qn("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"}]]),wu=qn("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),la=qn("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"}]]),xm=qn("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"}]]),Wd=qn("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"}]]),oa=qn("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"}]]),Ol=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":return"Microsoft SQL Server";case"oracle":return"Oracle";case"redshift":return"Amazon Redshift";case"snowflake":return"Snowflake";case"bigquery":return"Google BigQuery";case"clickhouse":return"ClickHouse";case"timeplus":return"Timeplus";case"databricks":return"Databricks";case"db2":return"IBM Db2";case"hive":return"Apache Hive";case"impala":return"Apache Impala";case"presto":return"Presto";case"trino":return"Trino";case"cockroachdb":return"CockroachDB";case"timescaledb":return"TimescaleDB";case"singlestore":return"SingleStore";case"cassandra":return"Apache Cassandra";case"mongodb":return"MongoDB";case"iceberg":return"Apache Iceberg";default:return e}};function Kg(e){let[n,i]=e.split(" ");return i?`${Ol(n)} ${i}`:Ol(e)}Xu={boolean:bR,date:vR,time:km,datetime:Vd,temporal:Vd,number:rm,string:wR,integer:rm,unknown:hm},tw=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 Tl(e),"bg-(--slate-4) dark:bg-(--slate-6)"}};let ms,Qg,Ud,Gg,Ca,Jg,Xg,Yg,Zg,ey,Sa,Vr,Co,oi,Kd;po=class{constructor(e,n){this.singular=e,this._plural=n}pluralize(e){return e===1?this.singular:this.plural}get plural(){return this._plural??`${this.singular}s`}},S2=class l_{constructor(n){this.words=n}static of(...n){return new l_(n.map(i=>typeof i=="string"?new po(i):i))}join(n,i){return this.words.map(a=>a.pluralize(i)).join(n)}},ms=Kt(zr(),1),Qg=5,Ud={boolean:"bg-[var(--orange-4)] text-[var(--orange-11)]",date:"bg-[var(--grass-4)] text-[var(--grass-11)]",time:"bg-[var(--grass-4)] text-[var(--grass-11)]",datetime:"bg-[var(--grass-4)] text-[var(--grass-11)]",number:"bg-[var(--purple-4)] text-[var(--purple-11)]",integer:"bg-[var(--purple-4)] text-[var(--purple-11)]",string:"bg-[var(--blue-4)] text-[var(--blue-11)]",unknown:"bg-[var(--slate-4)] text-[var(--slate-11)]"},Gg={local:"bg-[var(--blue-4)] text-[var(--blue-11)]",duckdb:"bg-[var(--amber-4)] text-[var(--amber-11)]",connection:"bg-[var(--green-4)] text-[var(--green-11)]",catalog:"bg-[var(--purple-4)] text-[var(--purple-11)]"},Ca="p-3 min-w-[250px] flex flex-col divide-y",Jg=new po("column","columns"),Xg=new po("row","rows"),Yg=new po("schema","schemas"),Zg=new po("table","tables"),ey=new po("database","databases"),Sa=e=>{let n=(0,ms.c)(6),{icon:i,title:a,badge:s}=e,c;n[0]===a?c=n[1]:(c=(0,B.jsx)("h3",{className:"font-semibold text-sm",children:a}),n[0]=a,n[1]=c);let d;return n[2]!==s||n[3]!==i||n[4]!==c?(d=(0,B.jsxs)("div",{className:"flex items-center gap-2 pb-2",children:[i,c,s]}),n[2]=s,n[3]=i,n[4]=c,n[5]=d):d=n[5],d},Vr=e=>{let n=(0,ms.c)(5),{label:i,value:a}=e,s;n[0]===i?s=n[1]:(s=(0,B.jsxs)("span",{className:"text-[var(--slate-11)]",children:[i,":"]}),n[0]=i,n[1]=s);let c;return n[2]!==s||n[3]!==a?(c=(0,B.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[s,a]}),n[2]=s,n[3]=a,n[4]=c):c=n[4],c},Co=e=>{let n=(0,ms.c)(5),{icon:i,text:a}=e,s;n[0]===a?s=n[1]:(s=(0,B.jsx)("span",{className:"text-xs text-[var(--slate-11)]",children:a}),n[0]=a,n[1]=s);let c;return n[2]!==i||n[3]!==s?(c=(0,B.jsxs)("div",{className:"flex items-center gap-1",children:[i,s]}),n[2]=i,n[3]=s,n[4]=c):c=n[4],c},oi=e=>{let n=(0,ms.c)(15),{title:i,items:a,totalCount:s,limit:c}=e,d=i===void 0?"":i,p=c===void 0?Qg:c;if(a.length===0)return null;let h;n[0]!==a||n[1]!==p?(h=a.slice(0,p),n[0]=a,n[1]=p,n[2]=h):h=n[2];let v=h,w=s>p,_;n[3]===d?_=n[4]:(_=d&&(0,B.jsxs)("h4",{className:"text-xs font-medium text-[var(--slate-11)] mb-2",children:[d,":"]}),n[3]=d,n[4]=_);let C;n[5]!==w||n[6]!==p||n[7]!==s?(C=w&&(0,B.jsxs)("div",{className:"text-xs text-[var(--slate-10)] text-center py-1",children:["... and ",s-p," more"]}),n[5]=w,n[6]=p,n[7]=s,n[8]=C):C=n[8];let E;n[9]!==C||n[10]!==v?(E=(0,B.jsxs)("div",{className:"flex flex-col gap-1 overflow-y-auto",children:[v,C]}),n[9]=C,n[10]=v,n[11]=E):E=n[11];let R;return n[12]!==_||n[13]!==E?(R=(0,B.jsxs)("div",{className:"py-2",children:[_,E]}),n[12]=_,n[13]=E,n[14]=R):R=n[14],R},Kd=e=>Ud[e]||Ud.unknown;const UC=e=>{var d,p;let n=e.type==="view"?(0,B.jsx)(Bu,{className:"w-4 h-4 text-[var(--blue-9)]"}):(0,B.jsx)(oa,{className:"w-4 h-4 text-[var(--green-9)]"}),i=(0,B.jsx)(lr,{variant:"secondary",className:`text-xs ${e.type==="view"?"bg-[var(--blue-4)] text-[var(--blue-11)]":"bg-[var(--green-4)] text-[var(--green-11)]"}`,children:e.type}),a=e.columns.map(h=>{let v=Xu[h.type];return(0,B.jsxs)("div",{className:"flex items-center justify-between text-xs rounded",children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(v,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,B.jsx)("span",{className:"font-mono",children:h.name})]}),(0,B.jsx)(lr,{variant:"outline",className:`text-xs ${Kd(h.type)}`,children:h.type})]},h.name)}),s=e.primary_keys&&e.primary_keys.length>0,c=e.indexes&&e.indexes.length>0;return(0,B.jsxs)("div",{className:`${Ca} min-w-[300px]`,children:[(0,B.jsx)(Sa,{icon:n,title:e.name,badge:i}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,B.jsx)(Vr,{label:"Source",value:(0,B.jsx)(lr,{variant:"outline",className:`text-xs ${Gg[e.source_type]}`,children:e.source})}),e.variable_name&&(0,B.jsx)(Vr,{label:"Variable",value:(0,B.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.variable_name})}),e.engine&&(0,B.jsx)(Vr,{label:"Engine",value:(0,B.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.engine})})]}),(e.num_columns!=null||e.num_rows!=null)&&(0,B.jsxs)("div",{className:"grid grid-cols-2 gap-2 py-2",children:[e.num_columns!=null&&(0,B.jsx)(Co,{icon:(0,B.jsx)(_m,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_columns} ${Jg.pluralize(e.num_columns)}`}),e.num_rows!=null&&(0,B.jsx)(Co,{icon:(0,B.jsx)(rm,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_rows} ${Xg.pluralize(e.num_rows)}`})]}),e.columns.length===0&&Jl("column"),(s||c)&&(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[s&&(0,B.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,B.jsxs)("div",{className:"flex items-center gap-1",children:[(0,B.jsx)(aR,{className:"w-3 h-3 text-[var(--amber-9)]"}),(0,B.jsx)("span",{className:"text-xs font-medium text-[var(--slate-11)]",children:"Primary Keys:"})]}),(d=e.primary_keys)==null?void 0:d.map(h=>(0,B.jsx)(lr,{variant:"outline",className:"text-xs text-[var(--slate-11)]",children:h},h))]}),c&&(0,B.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,B.jsxs)("div",{className:"flex items-center gap-1 mb-1",children:[(0,B.jsx)(wm,{className:"w-3 h-3 text-[var(--purple-9)]"}),(0,B.jsx)("span",{className:"text-xs font-medium text-[var(--slate-11)]",children:"Indexes:"})]}),(p=e.indexes)==null?void 0:p.map(h=>(0,B.jsx)(lr,{variant:"outline",className:"text-xs text-[var(--slate-11)]",children:h},h))]})]}),e.columns.length>0&&(0,B.jsx)(oi,{items:a,totalCount:e.columns.length})]})},KC=e=>{var s;let n=Xu[e.type],i=(0,B.jsx)(lr,{variant:"outline",className:`text-xs ${Kd(e.type)}`,children:e.type}),a=((s=e.sample_values)==null?void 0:s.map((c,d)=>(0,B.jsx)("div",{className:"text-xs bg-[var(--slate-3)] rounded font-mono",children:c==null?"null":String(c)},d)))||[];return(0,B.jsxs)("div",{className:Ca,children:[(0,B.jsx)(Sa,{icon:(0,B.jsx)(n,{className:"w-4 h-4 text-[var(--slate-9)]"}),title:e.name,badge:i}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 mt-2",children:[(0,B.jsx)(Vr,{label:"Type",value:(0,B.jsx)("span",{className:"font-medium",children:e.type})}),(0,B.jsx)(Vr,{label:"External Type",value:(0,B.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.external_type})})]}),e.sample_values&&e.sample_values.length>0&&(0,B.jsx)(oi,{title:"Sample Values",items:a,totalCount:e.sample_values.length})]})},QC=e=>{let n=(0,B.jsx)(lr,{variant:"outline",className:"text-xs bg-[var(--blue-4)] text-[var(--blue-11)]",children:e.dialect}),i=e.schemas.map(a=>(0,B.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-[var(--slate-3)]",children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(la,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,B.jsx)("span",{children:a.name})]}),(0,B.jsxs)(lr,{variant:"outline",className:"text-xs",children:[a.tables.length," ",Zg.pluralize(a.tables.length)]})]},a.name));return(0,B.jsxs)("div",{className:Ca,children:[(0,B.jsx)(Sa,{icon:(0,B.jsx)(as,{className:"w-4 h-4 text-[var(--blue-9)]"}),title:e.name,badge:n}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,B.jsx)(Vr,{label:"Dialect",value:(0,B.jsx)("span",{className:"font-medium",children:e.dialect})}),e.engine&&(0,B.jsx)(Vr,{label:"Engine",value:(0,B.jsx)("code",{className:"text-xs bg-[var(--slate-4)] px-1 rounded",children:e.engine})})]}),(0,B.jsx)("div",{className:"py-2",children:(0,B.jsx)(Co,{icon:(0,B.jsx)(la,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.schemas.length} schema${e.schemas.length===1?"":"s"}`})}),e.schemas.length===0&&Jl("schema"),e.schemas.length>0&&(0,B.jsx)(oi,{title:"Schemas",items:i,totalCount:e.schemas.length})]})},GC=e=>{let n=(0,B.jsx)(lr,{variant:"outline",className:"text-xs bg-[var(--green-4)] text-[var(--green-11)]",children:"Schema"}),i=e.tables.map(a=>(0,B.jsxs)("div",{className:"flex items-center justify-between text-xs rounded hover:bg-[var(--slate-3)]",children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[a.type==="view"?(0,B.jsx)(Bu,{className:"w-3 h-3 text-[var(--blue-9)]"}):(0,B.jsx)(oa,{className:"w-3 h-3 text-[var(--green-9)]"}),(0,B.jsx)("span",{children:a.name})]}),(0,B.jsx)(lr,{variant:"outline",className:`text-xs ${a.type==="view"?"bg-[var(--blue-4)] text-[var(--blue-11)]":"bg-[var(--green-4)] text-[var(--green-11)]"}`,children:a.type})]},a.name));return(0,B.jsxs)("div",{className:Ca,children:[(0,B.jsx)(Sa,{icon:(0,B.jsx)(la,{className:"w-4 h-4 text-[var(--green-9)]"}),title:e.name,badge:n}),(0,B.jsx)("div",{className:"py-2",children:(0,B.jsx)(Co,{icon:(0,B.jsx)(oa,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.tables.length} table${e.tables.length===1?"":"s"}`})}),e.tables.length===0&&Jl("table"),e.tables.length>0&&(0,B.jsx)(oi,{title:"Tables",items:i,totalCount:e.tables.length})]})};var ty=(0,B.jsx)(lr,{variant:"outline",children:"default"}),JC=8,ny=3;let Jl;Gw=(e,n)=>{let i=e.databases.length,a=e.databases.reduce((h,v)=>h+v.schemas.length,0),s=(h,v)=>{if(h.tables.length===0)return null;let w=h.name===e.default_schema&&v,_=[];return a<JC&&(_=h.tables.slice(0,ny+1).map(C=>(0,B.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,B.jsx)(oa,{className:"w-3 h-3 text-[var(--green-9)]"}),(0,B.jsx)("span",{className:"text-xs",children:C.name})]},C.name))),(0,B.jsxs)("div",{children:[(0,B.jsxs)("div",{className:"flex items-center gap-2 text-xs rounded hover:bg-[var(--slate-3)] ml-2",children:[(0,B.jsx)(la,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,B.jsx)("span",{children:h.name}),w&&ty,(0,B.jsxs)(lr,{variant:"outline",className:"text-xs ml-auto",children:[h.tables.length," tables"]})]}),(0,B.jsx)(oi,{items:_,totalCount:h.tables.length,limit:ny})]},h.name)},c=e.databases.map(h=>{let v=h.name===e.default_database||e.databases.length===1,w=h.schemas.map(_=>s(_,v));return(0,B.jsxs)("div",{children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(as,{className:"w-3 h-3 text-[var(--blue-9)]"}),(0,B.jsx)("span",{className:"text-xs",children:h.name}),v&&ty]}),w&&(0,B.jsx)(oi,{items:w,totalCount:h.schemas.length})]},h.name)}),d=e.name;ls.has(e.name)&&(d="In-Memory");let p=n==null?void 0:n.map(h=>(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(oa,{className:"w-3 h-3 text-[var(--blue-9)]"}),(0,B.jsx)("span",{className:"text-xs",children:h.name})]},h.name));return(0,B.jsxs)("div",{className:`${Ca} px-1`,children:[(0,B.jsx)(Sa,{icon:(0,B.jsx)(Ug,{className:"w-4 h-4 text-[var(--purple-9)]"}),title:d}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,B.jsx)(Vr,{label:"Dialect",value:(0,B.jsx)("span",{className:"font-medium",children:Ol(e.dialect)})}),(0,B.jsx)(Vr,{label:"Source",value:(0,B.jsx)(lr,{variant:"outline",className:"text-xs bg-[var(--green-4)] text-[var(--green-11)]",children:e.source})})]}),(0,B.jsxs)("div",{className:"flex flex-row justify-between py-2",children:[(0,B.jsx)(Co,{icon:(0,B.jsx)(as,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${i} ${ey.pluralize(i)}`}),(0,B.jsx)(Co,{icon:(0,B.jsx)(la,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${a} ${Yg.pluralize(a)}`})]}),i>0&&(0,B.jsx)(oi,{items:c,totalCount:i}),p&&p.length>0&&(0,B.jsx)(oi,{title:"Dataframes",items:p,totalCount:p.length})]})},Jl=e=>(0,B.jsxs)("div",{className:"flex items-start gap-2 mt-3",children:[(0,B.jsx)(wu,{size:10,className:"mt-1 text-[var(--slate-10)] shrink-0"}),(0,B.jsxs)("span",{className:"text-xs text-[var(--slate-11)]",children:["No ",e," information available.",`
135
+ `,(0,B.jsx)("span",{className:"text-[var(--blue-10)]",children:"Introspect to see more details."})]})]});var Xl=Kt($u(),1),ry=class{constructor(){De(this,"schema",{})}addTable(e,n){let i={self:YC({table:n}),children:n.columns.map(a=>XC({column:a}))};return this.setAt([...e,n.name],i),this}addSchema(e,n){let i={self:ZC({namespace:n,path:e}),children:{}};return this.setAt(e,i),this}addDatabase(e,n){let i={self:eS({namespace:n,path:e}),children:{}};return this.setAt(e,i),this}setAt(e,n){let i=this.schema;for(let a of e.slice(0,-1))i[a]||(i[a]={children:{}}),i=i[a].children;i[e[e.length-1]]=n}build(){return this.schema}reset(){return this.schema={},this}};function XC(e){return{label:e.column.name,type:"column",info:()=>{let n=document.createElement("div");return(0,Xl.createRoot)(n).render(KC(e.column)),{dom:n}}}}function YC(e){return{label:e.table.name,type:"table",info:()=>{let n=document.createElement("div");return(0,Xl.createRoot)(n).render(UC(e.table)),{dom:n}}}}function ZC(e){return{label:e.namespace.name,detail:e.path.join("."),type:"schema",info:()=>{let n=document.createElement("div");return(0,Xl.createRoot)(n).render(GC(e.namespace)),{dom:n}}}}function eS(e){return{label:e.namespace.name,detail:e.path.join("."),type:"database",info:()=>{let n=document.createElement("div");return(0,Xl.createRoot)(n).render(QC(e.namespace)),{dom:n}}}}var tS=Fe(e=>{let n=e(ku),i=new ry;for(let a of n)i.addTable([],a);return i.build()}),nS=class{constructor(){this.cache=new Kl(10,{create:e=>this.getConnectionSchema(e)})}getConnection(e){return ct.get(Ou).get(e)}getConnectionSchema(e){var d;let{default_database:n,databases:i,default_schema:a}=e,s=new ry,c=i.find(p=>p.name===n||i.length===1);if(((d=c??i[0])==null?void 0:d.schemas.some(p=>Rl(p.name)))??!1){for(let p of i){let h=p.name===(c==null?void 0:c.name),v=p.schemas.flatMap(w=>w.tables);s.addDatabase([p.name],p);for(let w of v)h?s.addTable([],w):s.addTable([p.name],w)}return{shouldAddLocalTables:!1,schema:s.build(),defaultSchema:c==null?void 0:c.name}}if(c)for(let p of c.schemas){s.addSchema([p.name],p);for(let h of p.tables)s.addTable([p.name],h)}for(let p of i){s.addDatabase([p.name],p);for(let h of p.schemas){s.addSchema([p.name,h.name],h);for(let v of h.tables)s.addTable([p.name,h.name],v)}}return{shouldAddLocalTables:!0,schema:s.build(),defaultSchema:a??void 0}}getInternalDialect(e){let n=this.getConnection(e);return n?n.dialect:null}getDialect(e){let n=this.getConnection(e);return n?Bg(n):fs}getCompletionSource(e){let n=this.getConnection(e);if(!n)return null;let i=()=>ct.get(tS),a=this.cache.getOrCreate(n);return{dialect:Bg(n),schema:a.shouldAddLocalTables?{...a.schema,...i()}:a.schema,defaultSchema:a.defaultSchema,defaultTable:rS(n)}}};function rS(e){if(e.databases.length!==1)return;let n=e.databases[0];if(n.schemas.length!==1)return;let i=n.schemas[0];if(i.tables.length===1)return i.tables[0].name}const hs=new nS;function iy(e){return e.field(ri)}function iS(){return e=>{let n=iy(e.state).engine,i=hs.getCompletionSource(n);return i&&uR(i)(e)||null}}function oS(){return e=>{let n=iy(e.state).engine,i=hs.getDialect(n);return e.matchBefore(/\.\w*/)?null:gR(i,!0,(a,s)=>({label:a,type:s,info:async()=>{let c=(await aS())[a.toLocaleLowerCase()];if(!c)return null;let d=document.createElement("div");return d.innerHTML=OC.keyword({keyword:a,info:c}),d}}))(e)}}var aS=ti(async()=>{let e=await ue(()=>import("./common-keywords-Ccc2yBwn.js").then(async i=>(await i.__tla,i)),[],import.meta.url),n=await ue(()=>import("./duckdb-keywords-4oBeZ5E7.js").then(async i=>(await i.__tla,i)),[],import.meta.url);return{...e.default.keywords,...n.default.keywords}});Xw=function(e){let n=e.storage||os;return{getItem(i,a){try{let s=n.getItem(i);if(!s)return a;let c=JSON.parse(s);return e.fromSerializable(c)}catch(s){return Pe.warn(`Error getting ${i} from storage`,s),a}},setItem:(i,a)=>{n.setItem(i,JSON.stringify(e.toSerializable(a)))},removeItem:i=>{n.removeItem(i)}}},Lu=sh(()=>os);var sS=Kt(zr(),1),oy=Su("marimo:notebook-sql-mode","default",Lu);function lS(){let e=(0,sS.c)(3),[n,i]=Vb(oy),a;return e[0]!==i||e[1]!==n?(a={sqlMode:n,setSQLMode:i},e[0]=i,e[1]=n,e[2]=a):a=e[2],a}function cS(){return ct.get(oy)}var uS=Fg,ay=new du;function Qd(){return ct.get(aa).latestEngineSelected}Gu=(tf=class{constructor(){De(this,"parser",new Uh);De(this,"type","sql");this.sqlModeEnabled=!0}get defaultMetadata(){return{...this.parser.defaultMetadata,engine:Qd()||"__marimo_duckdb"}}get defaultCode(){let e=Qd();return e&&e!=="__marimo_duckdb"?`_df = mo.sql(f"""SELECT * FROM """, engine=${e})`:this.parser.defaultCode}transformIn(e){this.parser.defaultMetadata.engine=Qd()||"__marimo_duckdb";let n=this.parser.transformIn(e),i=n.metadata;return i.engine&&i.engine!=="__marimo_duckdb"&&Vg(i.engine),[n.code,n.offset,i]}transformOut(e,n){let i=this.parser.transformOut(e,n);return[i.code,i.offset]}isSupported(e){return this.parser.isSupported(e)}getExtension(e,n,i,a,s){let c=[ay.of(g2({dialect:uS})),na.of([{key:"Tab",run:d=>Z3(d)||Q3(d),preventDefault:!0}]),gu({defaultKeymap:!1,activateOnTyping:!0,override:[iS(),Rk,oS()]})];return this.sqlModeEnabled&&c.push(hS()),c}},De(tf,"fromQuery",e=>Uh.fromQuery(e)),tf);function sy(e,n){e.dispatch({effects:ay.reconfigure(g2({dialect:n}))})}function dS(e,n){sy(e,hs.getDialect(n))}function fS(e){let n=ly(e.state).engine;sy(e,hs.getDialect(n))}function ly(e){return e.field(ri)}function pS(e){var i;let n=(i=hs.getInternalDialect(e))==null?void 0:i.toLowerCase();if(!n||!Hd(n))return null;switch(n){case"postgresql":case"postgres":return"PostgreSQL";case"db2":return"DB2";case"mysql":return"MySQL";case"sqlite":return"Sqlite";case"mssql":case"sqlserver":return"TransactSQL";case"duckdb":return"DuckDB";case"mariadb":return"MariaDB";case"cassandra":return"Noql";case"athena":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":return Pe.debug("Unsupported dialect",{dialect:n}),null;default:return Tl(n),null}}var mS=300;function hS(){let e,n=null;return Tn.updateListener.of(i=>{if(!i.docChanged)return;let a=cS();if(a==="default")return;let s=ly(i.state).engine;if(!ls.has(s))return;let c=i.state.doc.toString();e&&window.clearTimeout(e),e=window.setTimeout(async()=>{if(n===c)return;n=c;let d=i.view.state.facet(sa);if(c===""){$g(d);return}try{let p=pS(s),h=(await gS(c,s,p,a)).validate_result;h!=null&&h.error_message?$C({cellId:d,errorMessage:h.error_message,dialect:p}):$g(d)}catch(p){Pe.error("Failed to validate SQL",{error:p})}},mS)})}async function gS(e,n,i,a){let s=await Tm.request({onlyParse:a==="default",engine:n,dialect:i,query:e});if(s.error)throw Error(s.error);return s}var yS=ti(()=>new kC),vS=ti(()=>new ju),bS=ti(()=>new Gu);ur={get python(){return yS()},get markdown(){return vS()},get sql(){return bS()}};function wS(){return Object.values(ur)}var At=Kt(cu(),1),Yl="Checkbox",[_S,FR]=PR(Yl),[xS,Gd]=_S(Yl);function kS(e){let{__scopeCheckbox:n,checked:i,children:a,defaultChecked:s,disabled:c,form:d,name:p,onCheckedChange:h,required:v,value:w="on",internal_do_not_use_render:_}=e,[C,E]=MR({prop:i,defaultProp:s??!1,onChange:h,caller:Yl}),[R,A]=At.useState(null),[H,V]=At.useState(null),U=At.useRef(!1),L=R?!!d||!!R.closest("form"):!0,G={checked:C,disabled:c,setChecked:E,control:R,setControl:A,name:p,form:d,value:w,hasConsumerStoppedPropagationRef:U,required:v,defaultChecked:qi(s)?!1:s,isFormControl:L,bubbleInput:H,setBubbleInput:V};return(0,B.jsx)(xS,{scope:n,...G,children:CS(_)?_(G):a})}var cy="CheckboxTrigger",uy=At.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:i,...a},s)=>{let{control:c,value:d,disabled:p,checked:h,required:v,setControl:w,setChecked:_,hasConsumerStoppedPropagationRef:C,isFormControl:E,bubbleInput:R}=Gd(cy,e),A=Kb(s,w),H=At.useRef(h);return At.useEffect(()=>{let V=c==null?void 0:c.form;if(V){let U=()=>_(H.current);return V.addEventListener("reset",U),()=>V.removeEventListener("reset",U)}},[c,_]),(0,B.jsx)(om.button,{type:"button",role:"checkbox","aria-checked":qi(h)?"mixed":h,"aria-required":v,"data-state":hy(h),"data-disabled":p?"":void 0,disabled:p,value:d,...a,ref:A,onKeyDown:v2(n,V=>{V.key==="Enter"&&V.preventDefault()}),onClick:v2(i,V=>{_(U=>qi(U)?!0:!U),R&&E&&(C.current=V.isPropagationStopped(),C.current||V.stopPropagation())})})});uy.displayName=cy;var Jd=At.forwardRef((e,n)=>{let{__scopeCheckbox:i,name:a,checked:s,defaultChecked:c,required:d,disabled:p,value:h,onCheckedChange:v,form:w,..._}=e;return(0,B.jsx)(kS,{__scopeCheckbox:i,checked:s,defaultChecked:c,disabled:p,required:d,onCheckedChange:v,name:a,form:w,value:h,internal_do_not_use_render:({isFormControl:C})=>(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(uy,{..._,ref:n,__scopeCheckbox:i}),C&&(0,B.jsx)(my,{__scopeCheckbox:i})]})})});Jd.displayName=Yl;var dy="CheckboxIndicator",fy=At.forwardRef((e,n)=>{let{__scopeCheckbox:i,forceMount:a,...s}=e,c=Gd(dy,i);return(0,B.jsx)(NR,{present:a||qi(c.checked)||c.checked===!0,children:(0,B.jsx)(om.span,{"data-state":hy(c.checked),"data-disabled":c.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...e.style}})})});fy.displayName=dy;var py="CheckboxBubbleInput",my=At.forwardRef(({__scopeCheckbox:e,...n},i)=>{let{control:a,hasConsumerStoppedPropagationRef:s,checked:c,defaultChecked:d,required:p,disabled:h,name:v,value:w,form:_,bubbleInput:C,setBubbleInput:E}=Gd(py,e),R=Kb(i,E),A=CR(c),H=LR(a);At.useEffect(()=>{let U=C;if(!U)return;let L=window.HTMLInputElement.prototype,G=Object.getOwnPropertyDescriptor(L,"checked").set,he=!s.current;if(A!==c&&G){let N=new Event("click",{bubbles:he});U.indeterminate=qi(c),G.call(U,qi(c)?!1:c),U.dispatchEvent(N)}},[C,A,c,s]);let V=At.useRef(qi(c)?!1:c);return(0,B.jsx)(om.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??V.current,required:p,disabled:h,name:v,value:w,form:_,...n,tabIndex:-1,ref:R,style:{...n.style,...H,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});my.displayName=py;function CS(e){return typeof e=="function"}function qi(e){return e==="indeterminate"}function hy(e){return qi(e)?"indeterminate":e?"checked":"unchecked"}let gy;gy=Kt(zr(),1),Al=At.forwardRef((e,n)=>{let i=(0,gy.c)(10),a,s;i[0]===e?(a=i[1],s=i[2]):({className:a,...s}=e,i[0]=e,i[1]=a,i[2]=s);let c;i[3]===a?c=i[4]:(c=uu("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",a),i[3]=a,i[4]=c);let d;i[5]===Symbol.for("react.memo_cache_sentinel")?(d=(0,B.jsx)(fy,{className:uu("flex items-center justify-center text-current max-h-[14px] overflow-hidden"),children:(0,B.jsx)(_R,{className:"h-4 w-4"})}),i[5]=d):d=i[5];let p;return i[6]!==s||i[7]!==n||i[8]!==c?(p=(0,B.jsx)(Jd,{ref:n,className:c,...s,children:d}),i[6]=s,i[7]=n,i[8]=c,i[9]=p):p=i[9],p}),Al.displayName=Jd.displayName,bw="_";var SS=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("."));jm=function(e,n=!0){return e=e.trim(),e?(/^\d/.test(e)&&(e=`_${e}`),e=e.replaceAll(/\W/g,"_"),n?e.toLowerCase():e):"_"},qw=function(e,n){let i=new Set(n),a=e,s=d=>!i.has(d)&&!SS.has(d);if(s(e))return e;let c=1;for(;!s(a);)a=`${e}_${c}`,c++;return a},xw=function(e,n){return Bm(e)?`cell-${n}`:e},Bm=function(e){return e?e==="_"||e==="__":!0};var ES=Kt(zr(),1);function TS(e){let n=(0,ES.c)(15),{minWidth:i,padding:a}=e,s=i===void 0?70:i,c=a===void 0?15:a,[d,p]=(0,At.useState)(50),h=(0,At.useRef)(null),v=(0,At.useRef)(null),w;n[0]===c?w=n[1]:(w=N=>{if(v.current&&h.current){let I=v.current;I.style.fontSize=window.getComputedStyle(h.current).fontSize,I.style.fontFamily=window.getComputedStyle(h.current).fontFamily,I.textContent=N;let $=I.offsetWidth;p($+c)}},n[0]=c,n[1]=w);let _=w,C;n[2]===_?C=n[3]:(C=()=>{var N;_(((N=h.current)==null?void 0:N.value)??"")},n[2]=_,n[3]=C),yR(C);let E;n[4]===_?E=n[5]:(E=N=>{_(N.target.value)},n[4]=_,n[5]=E);let R=`${d}px`,A=`${s}px`,H;n[6]!==R||n[7]!==A?(H={width:R,minWidth:A},n[6]=R,n[7]=A,n[8]=H):H=n[8];let V;n[9]!==E||n[10]!==H?(V={ref:h,type:"text",onChange:E,style:H},n[9]=E,n[10]=H,n[11]=V):V=n[11];let U=V,L;n[12]===Symbol.for("react.memo_cache_sentinel")?(L={ref:v,style:{visibility:"hidden",position:"absolute",whiteSpace:"pre"}},n[12]=L):L=n[12];let G=L,he;return n[13]===U?he=n[14]:(he={inputProps:U,spanProps:G},n[13]=U,n[14]=he),he}var RS=Kt(zr(),1);function DS({currentQuotePrefix:e,checked:n,prefix:i}){let a=e;return n?e===""?a=i:e!=="rf"&&i!==e&&(a="rf"):e===i?a="":e==="rf"&&(a=i==="r"?"f":"r"),a}const OS=()=>{let e=(0,RS.c)(2),n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,B.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,B.jsxs)("header",{className:"flex items-center gap-1",children:[(0,B.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"r"}),(0,B.jsx)("span",{className:"font-semibold",children:"Raw String"})]}),(0,B.jsx)("p",{className:"text-sm text-muted-foreground",children:"Write LaTeX without escaping special characters"}),(0,B.jsx)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:"\\alpha \\beta"})]}),e[0]=n):n=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=(0,B.jsxs)("div",{className:"flex flex-col gap-3.5",children:[n,(0,B.jsxs)("section",{className:"flex flex-col gap-0.5",children:[(0,B.jsxs)("header",{className:"flex items-center gap-1",children:[(0,B.jsx)("code",{className:"text-xs px-1 py-0.5 bg-(--slate-2) rounded",children:"f"}),(0,B.jsx)("span",{className:"font-semibold",children:"Format String"})]}),(0,B.jsx)("p",{className:"text-sm text-muted-foreground",children:"Interpolate Python values"}),(0,B.jsxs)("pre",{className:"text-xs bg-(--slate-2) p-2 rounded",children:["Hello ","{name}","! \u{1F601}"]})]})]}),e[1]=i):i=e[1],i};var PS="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",NS="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",MS="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==",LS="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",AS="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",IS=""+new URL("iceberg-COKYXo-A.png",import.meta.url).href,jS="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",qS="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",yy=""+new URL("postgresql-q8VEBKGg.svg",import.meta.url).href,zS="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",FS="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",BS="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",HS="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",VS="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",$S=""+new URL("trino-DFsJbQoT.svg",import.meta.url).href,WS=Kt(zr(),1),US={sqlite:HS,duckdb:LS,motherduck:jS,postgres:yy,postgresql:yy,mysql:qS,snowflake:FS,databricks:NS,clickhouse:PS,timeplus:VS,bigquery:AS,trino:$S,iceberg:IS,datafusion:MS,pyspark:BS,redshift:zS};Um=e=>{let n=(0,WS.c)(11),{name:i,className:a}=e,s=US[i.toLowerCase()];if(!s){let p;n[0]===a?p=n[1]:(p=uu("mt-0.5",a),n[0]=a,n[1]=p);let h;return n[2]===p?h=n[3]:(h=(0,B.jsx)(as,{className:p}),n[2]=p,n[3]=h),h}let c;n[4]!==a||n[5]!==s?(c=uu("invert-[.5] dark:invert-[.7]",a,s.endsWith(".png")&&"brightness-100 dark:brightness-100 invert-0 dark:invert-0"),n[4]=a,n[5]=s,n[6]=c):c=n[6];let d;return n[7]!==i||n[8]!==c||n[9]!==s?(d=(0,B.jsx)("img",{src:s,alt:i,className:c}),n[7]=i,n[8]=c,n[9]=s,n[10]=d):d=n[10],d};var Xd=Kt(zr(),1);const KS=e=>{let n=(0,Xd.c)(27),{selectedEngine:i,onChange:a}=e,s=Un(Ou),c=[],d=[];for(let[fe,xe]of s.entries())ls.has(fe)?c.push(xe):d.push(xe);let p=IR(),h=i&&!s.has(i),v;n[0]!==s||n[1]!==a||n[2]!==p?(v=fe=>{if(fe===vy){window.open(by,"_blank");return}let xe=s.get(fe);xe&&(p(),a(xe.name),Vg(xe.name))},n[0]=s,n[1]=a,n[2]=p,n[3]=v):v=n[3];let w=v,_=YS,C=RR,E;n[4]===Symbol.for("react.memo_cache_sentinel")?(E=(0,B.jsx)(GS,{children:(0,B.jsx)(kR,{placeholder:"Select an engine"})}),n[4]=E):E=n[4];let R=SR,A=ER,H;n[5]===Symbol.for("react.memo_cache_sentinel")?(H=(0,B.jsx)(xR,{children:"Database connections"}),n[5]=H):H=n[5];let V;n[6]!==h||n[7]!==i?(V=h&&(0,B.jsx)(im,{value:i,children:(0,B.jsxs)("div",{className:"flex items-center gap-1 opacity-50",children:[(0,B.jsx)(um,{className:"h-3 w-3"}),(0,B.jsx)("span",{className:"truncate",children:Kg(i)})]})},i),n[6]=h,n[7]=i,n[8]=V):V=n[8];let U=_(d),L=d.length>0&&(0,B.jsx)(y2,{}),G=_(c),he;n[9]===Symbol.for("react.memo_cache_sentinel")?(he=(0,B.jsx)(y2,{}),n[9]=he):he=n[9];let N;n[10]===Symbol.for("react.memo_cache_sentinel")?(N=(0,B.jsx)(im,{className:"text-muted-foreground",value:vy,children:(0,B.jsxs)("a",{className:"flex items-center gap-1",href:by,target:"_blank",rel:"noreferrer",children:[(0,B.jsx)(OR,{className:"h-3 w-3"}),(0,B.jsx)("span",{children:"How to add a database connection"})]})}),n[10]=N):N=n[10];let I;n[11]!==A||n[12]!==H||n[13]!==V||n[14]!==U||n[15]!==L||n[16]!==G?(I=(0,B.jsxs)(A,{children:[H,V,U,L,G,he,N]}),n[11]=A,n[12]=H,n[13]=V,n[14]=U,n[15]=L,n[16]=G,n[17]=I):I=n[17];let $;n[18]!==R||n[19]!==I?($=(0,B.jsx)(R,{children:I}),n[18]=R,n[19]=I,n[20]=$):$=n[20];let de;return n[21]!==C||n[22]!==w||n[23]!==i||n[24]!==$||n[25]!==E?(de=(0,B.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,B.jsxs)(C,{value:i,onValueChange:w,children:[E,$]})}),n[21]=C,n[22]=w,n[23]=i,n[24]=$,n[25]=E,n[26]=de):de=n[26],de};var vy="__help__",by="http://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database";const QS=()=>{let e=(0,Xd.c)(16),{sqlMode:n,setSQLMode:i}=lS(),a;e[0]!==i||e[1]!==n?(a=()=>{let E=n==="validate"?"default":"validate";E==="default"&&VC(),i(E)},e[0]=i,e[1]=n,e[2]=a):a=e[2];let s=a,c=ZS,d=eE,p;e[3]===n?p=e[4]:(p=d(n),e[3]=n,e[4]=p);let h;e[5]===n?h=e[6]:(h=c(n),e[5]=n,e[6]=h);let v=n==="validate"?"Validate":"Default",w;e[7]===v?w=e[8]:(w=(0,B.jsx)("span",{className:"ml-1",children:v}),e[7]=v,e[8]=w);let _;e[9]!==s||e[10]!==h||e[11]!==w?(_=(0,B.jsxs)(Qb,{variant:"ghost",size:"sm",onClick:s,className:"h-5 px-1.5 text-xs border-border shadow-none hover:bg-accent",children:[h,w]}),e[9]=s,e[10]=h,e[11]=w,e[12]=_):_=e[12];let C;return e[13]!==p||e[14]!==_?(C=(0,B.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,B.jsx)(am,{delayDuration:300,content:p,children:_})}),e[13]=p,e[14]=_,e[15]=C):C=e[15],C};var GS=e=>{let n=(0,Xd.c)(6),i,a;n[0]===e?(i=n[1],a=n[2]):({children:i,...a}=e,n[0]=e,n[1]=i,n[2]=a);let s;return n[3]!==i||n[4]!==a?(s=(0,B.jsx)(TR,{className:"text-xs border-border shadow-none! ring-0! h-5 px-1.5 hover:bg-accent transition-colors",...a,children:i}),n[3]=i,n[4]=a,n[5]=s):s=n[5],s};function JS(e){return e.source!=="iceberg"}function XS(e){return(0,B.jsx)(im,{value:e.name,children:(0,B.jsxs)("div",{className:"flex items-center gap-1",children:[(0,B.jsx)(Um,{className:"h-3 w-3",name:e.dialect}),(0,B.jsx)("span",{className:"truncate ml-0.5",children:Kg(e.display_name)})]})},e.name)}function YS(e){return e=e.filter(JS),e.map(XS)}function ZS(e){return e==="validate"?(0,B.jsx)(Wd,{className:"h-3 w-3"}):(0,B.jsx)($d,{className:"h-3 w-3"})}function eE(e){return e==="validate"?(0,B.jsxs)("div",{className:"text-xs",children:[(0,B.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,B.jsx)(Wd,{className:"h-3 w-3"}),"Validate Mode"]}),(0,B.jsx)("p",{children:"Queries are validated as you write them"})]}):(0,B.jsxs)("div",{className:"text-xs",children:[(0,B.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,B.jsx)($d,{className:"h-3 w-3"}),"Default Mode"]}),(0,B.jsx)("p",{children:"Standard editing"})]})}var wy=Kt(zr(),1),_y=()=>{let e=(0,wy.c)(1),n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,B.jsx)("div",{className:"h-4 border-r border-border"}),e[0]=n):n=e[0],n};const tE=e=>{let n=(0,wy.c)(98),{view:i}=e,a;n[0]===Symbol.for("react.memo_cache_sentinel")?(a={minWidth:50},n[0]=a):a=n[0];let{spanProps:s,inputProps:c}=TS(a),d;n[1]===i.state?d=n[2]:(d=i.state.field(Er),n[1]=i.state,n[2]=d);let p=d,h;n[3]===Symbol.for("react.memo_cache_sentinel")?(h=(0,B.jsx)("div",{}),n[3]=h):h=n[3];let v=h,w=!1,_;n[4]===i?_=n[5]:(_=A=>{i.dispatch({effects:Yu.of(A),changes:{from:0,to:i.state.doc.length,insert:i.state.doc.toString()}})},n[4]=i,n[5]=_);let C=_;if(p instanceof Gu){let A;n[6]===i.state?A=n[7]:(A=i.state.field(ri),n[6]=i.state,n[7]=A);let H=A;w=!0;let V;n[8]===C?V=n[9]:(V=Re=>{let Me=jm(Re.currentTarget.value,!1);Re.currentTarget.value=Me,C({dataframeName:Me})},n[8]=C,n[9]=V);let U=V,L;n[10]!==C||n[11]!==i?(L=Re=>{C({engine:Re}),dS(i,Re)},n[10]=C,n[11]=i,n[12]=L):L=n[12];let G=L,he;n[13]===Symbol.for("react.memo_cache_sentinel")?(he=(0,B.jsx)("span",{className:"select-none",children:"Output variable: "}),n[13]=he):he=n[13];let N;n[14]===c?N=n[15]:(N=Re=>{var Me;(Me=c.onChange)==null||Me.call(c,Re)},n[14]=c,n[15]=N);let I;n[16]===U?I=n[17]:(I=Re=>{Re.key==="Enter"&&Re.shiftKey&&U(Re)},n[16]=U,n[17]=I);let $;n[18]!==c||n[19]!==H.dataframeName||n[20]!==U||n[21]!==I||n[22]!==N?($=(0,B.jsx)("input",{...c,defaultValue:H.dataframeName,onChange:N,onBlur:U,onKeyDown:I,className:"min-w-14 w-auto border border-border rounded px-1 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring"}),n[18]=c,n[19]=H.dataframeName,n[20]=U,n[21]=I,n[22]=N,n[23]=$):$=n[23];let de;n[24]===s?de=n[25]:(de=(0,B.jsx)("span",{...s}),n[24]=s,n[25]=de);let fe;n[26]!==$||n[27]!==de?(fe=(0,B.jsxs)("label",{className:"flex gap-2 items-center",children:[he,$,de]}),n[26]=$,n[27]=de,n[28]=fe):fe=n[28];let xe;n[29]!==H.engine||n[30]!==G?(xe=(0,B.jsx)(KS,{selectedEngine:H.engine,onChange:G}),n[29]=H.engine,n[30]=G,n[31]=xe):xe=n[31];let te;n[32]===H.engine?te=n[33]:(te=H.engine==="__marimo_duckdb"&&(0,B.jsx)(QS,{}),n[32]=H.engine,n[33]=te);let be;n[34]===i?be=n[35]:(be=async()=>{await I_(i)},n[34]=i,n[35]=be);let Se;n[36]===Symbol.for("react.memo_cache_sentinel")?(Se=(0,B.jsx)(xm,{className:"h-3 w-3"}),n[36]=Se):Se=n[36];let ie;n[37]===be?ie=n[38]:(ie=(0,B.jsx)(am,{content:"Format SQL",children:(0,B.jsx)(Qb,{variant:"text",size:"icon",onClick:be,children:Se})}),n[37]=be,n[38]=ie);let X;n[39]===Symbol.for("react.memo_cache_sentinel")?(X=(0,B.jsx)(_y,{}),n[39]=X):X=n[39];let Q;n[40]===C?Q=n[41]:(Q=Re=>{C({showOutput:!Re.target.checked})},n[40]=C,n[41]=Q);let K=!H.showOutput,Ne;n[42]!==Q||n[43]!==K?(Ne=(0,B.jsx)("input",{type:"checkbox",onChange:Q,checked:K}),n[42]=Q,n[43]=K,n[44]=Ne):Ne=n[44];let Qe;n[45]===Symbol.for("react.memo_cache_sentinel")?(Qe=(0,B.jsx)("span",{className:"select-none",children:"Hide output"}),n[45]=Qe):Qe=n[45];let ut;n[46]===Ne?ut=n[47]:(ut=(0,B.jsxs)("label",{className:"flex items-center gap-2",children:[Ne,Qe]}),n[46]=Ne,n[47]=ut);let Be;n[48]!==te||n[49]!==ie||n[50]!==ut?(Be=(0,B.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[te,ie,X,ut]}),n[48]=te,n[49]=ie,n[50]=ut,n[51]=Be):Be=n[51];let We;n[52]!==fe||n[53]!==xe||n[54]!==Be?(We=(0,B.jsxs)("div",{className:"flex flex-1 gap-2 items-center",children:[fe,xe,Be]}),n[52]=fe,n[53]=xe,n[54]=Be,n[55]=We):We=n[55],v=We}if(p instanceof ju){w=!0;let A,H,V,U,L,G,he,N,I,$;if(n[56]!==C||n[57]!==i.state){let{quotePrefix:Q}=i.state.field(ri);H=Q,H===void 0&&(H="r",C({quotePrefix:H})),$=(K,Ne)=>{typeof Ne=="boolean"&&C({quotePrefix:DS({currentQuotePrefix:H,checked:Ne,prefix:K})})},V="flex flex-row w-full justify-end gap-1.5 items-center",N="flex items-center gap-1.5",n[68]===Symbol.for("react.memo_cache_sentinel")?(I=(0,B.jsx)("span",{children:"r"}),n[68]=I):I=n[68],A=Al,L="Toggle raw string",G="w-3 h-3",he=H.includes("r"),U=K=>{$("r",K)},n[56]=C,n[57]=i.state,n[58]=A,n[59]=H,n[60]=V,n[61]=U,n[62]=L,n[63]=G,n[64]=he,n[65]=N,n[66]=I,n[67]=$}else A=n[58],H=n[59],V=n[60],U=n[61],L=n[62],G=n[63],he=n[64],N=n[65],I=n[66],$=n[67];let de;n[69]!==A||n[70]!==U||n[71]!==L||n[72]!==G||n[73]!==he?(de=(0,B.jsx)(A,{"aria-label":L,className:G,checked:he,onCheckedChange:U}),n[69]=A,n[70]=U,n[71]=L,n[72]=G,n[73]=he,n[74]=de):de=n[74];let fe;n[75]!==de||n[76]!==N||n[77]!==I?(fe=(0,B.jsxs)("div",{className:N,children:[I,de]}),n[75]=de,n[76]=N,n[77]=I,n[78]=fe):fe=n[78];let xe;n[79]===Symbol.for("react.memo_cache_sentinel")?(xe=(0,B.jsx)("span",{children:"f"}),n[79]=xe):xe=n[79];let te;n[80]===H?te=n[81]:(te=H.includes("f"),n[80]=H,n[81]=te);let be;n[82]===$?be=n[83]:(be=Q=>{$("f",Q)},n[82]=$,n[83]=be);let Se;n[84]!==te||n[85]!==be?(Se=(0,B.jsxs)("div",{className:"flex items-center gap-1.5",children:[xe,(0,B.jsx)(Al,{"aria-label":"Toggle f-string",className:"w-3 h-3",checked:te,onCheckedChange:be})]}),n[84]=te,n[85]=be,n[86]=Se):Se=n[86];let ie;n[87]===Symbol.for("react.memo_cache_sentinel")?(ie=(0,B.jsx)(am,{content:(0,B.jsx)(OS,{}),children:(0,B.jsx)(wu,{className:"w-3 h-3"})}),n[87]=ie):ie=n[87];let X;n[88]!==V||n[89]!==fe||n[90]!==Se?(X=(0,B.jsxs)("div",{className:V,children:[fe,Se,ie]}),n[88]=V,n[89]=fe,n[90]=Se,n[91]=X):X=n[91],v=X}let E;n[92]===w?E=n[93]:(E=w&&(0,B.jsx)(_y,{}),n[92]=w,n[93]=E);let R;return n[94]!==v||n[95]!==p.type||n[96]!==E?(R=(0,B.jsx)(AR,{children:(0,B.jsxs)("div",{className:"flex justify-between items-center gap-4 pl-2 pt-2",children:[v,E,p.type]})}),n[94]=v,n[95]=p.type,n[96]=E,n[97]=R):R=n[97],R};var Yd=new du;Au=ta.define(),Er=pu.define({create(){return ur.python},update(e,n){for(let i of n.effects)if(i.is(Au))return i.value;return e},provide:e=>Gp.from(e,n=>n.type==="python"?null:i=>q_(i,tE))});function nE(){let e=wS(),n=(i,a)=>{let s=e[a%e.length];return s.isSupported(i)?s:n(i,a+1)};return[na.of([{key:"F4",preventDefault:!0,run:i=>{let a=i.state.field(Er),s=e.findIndex(d=>d.type===a.type),c=n(i.state.doc.toString(),s+1);return a===c?!1:(xy({view:i,nextLanguage:c,opts:{keepCodeAsIs:!1}}),!0)}}])]}function xy({view:e,nextLanguage:n,opts:i}){let a=e.state.field(Er),s=e.state.doc.toString(),c=e.state.facet(Nh),d=e.state.facet(Mh),p=e.state.facet(pd),h=e.state.facet(md),v=e.state.facet(Lh),w=e.state.field(ri),_=e.state.selection.main.head,C;if(i.keepCodeAsIs)C=s,a.type!==n.type&&(w={...n.defaultMetadata});else{let[E,R]=a.transformOut(s,w),[A,H,V]=n.transformIn(E);_+=R,_-=H,_=Xp(_,0,A.length),C=A,w=V}e.dispatch({effects:[Au.of(n),Qu.of(w),Yd.reconfigure(n.getExtension(h,c,d,p,v)),Iu.reconfigure([]),pa.of(!0)],changes:i.keepCodeAsIs?void 0:{from:0,to:e.state.doc.length,insert:C},selection:i.keepCodeAsIs?void 0:fn.cursor(_)}),e.dispatch({effects:[Iu.reconfigure([V3()])]}),n.type==="sql"&&fS(e)}Sw=function(e){let{placeholderType:n,completionConfig:i,hotkeys:a,cellId:s,lspConfig:c}=e;return[nE(),Yd.of(ur.python.getExtension(s,i,a,n,c)),Er,ri]},hw=function(e){return rE(ii({state:e}).trim())};function rE(e){return e?ur.markdown.isSupported(e)?ur.markdown:ur.sql.isSupported(e)?ur.sql:ur.python:ur.python}Fm=function(e,n){e.state.field(Er).type!==n.language&&xy({view:e,nextLanguage:ur[n.language],opts:{keepCodeAsIs:n.keepCodeAsIs??!1}})},Hw=function(e,{completionConfig:n,hotkeysProvider:i,lspConfig:a}){let s=e.state.field(Er),c=e.state.facet(pd),d=e.state.facet(md);return Yd.reconfigure(s.getExtension(d,n,i,c,a))},ii=function(e,n,i){let a=e.state.field(Er),s=e.state.field(ri),c=e.state.doc.toString();return n===void 0?a.transformOut(c,s)[0]:a.transformOut(c.slice(n,i),s)[0]},cs=function(e,n){let[i]=e.state.field(Er).transformIn(n);return zu(e,i),i};function iE(e){let n=e.state.selection.main.head,i=e.state.doc.toString(),a=i.length>0&&i[n-1]===`
136
+ `,s=i.length>0&&i[n]===`
137
+ `,c=a?n-1:n,d=s?n+1:n;return{beforeCursorCode:ii(e,0,c),afterCursorCode:ii(e,d)}}var oE=["marimo-carousel","marimo-tabs","marimo-accordion"];function aE(e){if(typeof DOMParser>"u")return null;let n=[],i=new DOMParser().parseFromString(e,"text/html").querySelectorAll("h1, h2, h3");for(let a of Array.from(i)){let s=a.textContent;if(oE.some(d=>a.closest(d))||!s)continue;let c=Number.parseInt(a.tagName[1],10);n.push({name:s,level:c,by:Im(a)})}return{items:n}}Im=function(e){let n=e.id;if(n)return{id:n};let i=e.textContent;return{path:`//${e.tagName}[contains(., "${i}")]`}};function sE(e){return{items:e.filter(Boolean).flatMap(n=>n.items)}}Wm=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"),aE(e.data)}catch{return Pe.error("Failed to parse outline"),null}},b2=function(e){return e==null?!1:e.items.some(n=>n.level<=3)};function ky(e,n){let i=d=>d.items.length===0?7:Math.min(...d.items.map(p=>p.level)),a=n[e];if(a==null||a.items.length===0)return Pe.warn("Failed to find a starting outline"),null;let s=i(a),c=e+1;for(;c<n.length;){let d=n[c];if(d&&i(d)<=s)return[e,c-1];c++}return[e,n.length-1]}Tu=function(e){return e==="application/vnd.marimo+error"||e==="application/vnd.marimo+traceback"};function lE(e,n){if(typeof window>"u")return;let i=`__marimo__${n}`;window[i]&&Pe.warn(`Overwriting existing debug object ${i}`),window[i]=e}var cE={markdown:!0,wasm_layouts:!1,rtc_v2:!1,performant_table_charts:!1,chat_modes:!1,cache_panel:!1,external_agents:!1};Mu=function(e){var n,i;return((i=(n=Qp())==null?void 0:n.experimental)==null?void 0:i[e])??cE[e]};function uE(e,n){let i=Qp();i.experimental=i.experimental??{},i.experimental[e]=n,Ri().saveUserConfig({config:i})}ow=({feature:e,children:n})=>Mu(e)?n:null,lE(uE,"setFeatureFlag"),lw=Su("marimo:rtc:username","",Lu),gm=ym(()=>Mu("rtc_v2")),Vm=class ed{static fromMilliseconds(n){return n==null?null:new ed(n)}static fromSeconds(n){return n==null?null:new ed(n*1e3)}static now(){return new ed(Date.now())}constructor(n){this.ms=n}toMilliseconds(){return this.ms}toSeconds(){return this.ms/1e3}};function dE(e,n=5e3){let i=[...e];if(i.length<2)return Sy(Cy(i),n);let a=i[i.length-1],s=i[i.length-2];return fE(a,s)&&(dn(typeof a.data=="string","expected string"),dn(typeof s.data=="string","expected string"),s.data+=a.data,i.pop()),Sy(Cy(i),n)}function fE(e,n){let i=e.mimetype==="text/plain"&&n.mimetype==="text/plain";if(!i)return!1;let a=e.channel===n.channel,s=e.channel!=="stdin";return i&&a&&s}function Cy(e){let n=[...e];if(n.length===0)return n;let i=n[n.length-1];if(i.mimetype!=="text/plain")return n;let a=/\r[^\n]/g,s=i.data;dn(typeof s=="string","expected string");let c=s.search(a);for(;c>-1;){let d=-1;for(let w=c-1;w>=0;w--)if(s.at(w)===`
138
+ `){d=w;break}let p=s.slice(c+1),h=s.slice(0,d+1),v=s.slice(d+1,c);s=v.length<=p.length?h+p:h+p+v.slice(p.length),c=s.search(a)}return n[n.length-1]={...i,data:s},n}function Sy(e,n){let i=0,a;for(a=e.length-1;a>=0&&i<n;a--){let p=e[a];p.mimetype==="text/plain"?(dn(typeof p.data=="string","expected string"),i+=p.data.split(`
139
+ `).length):i++}if(i<n)return e;let s=a+1,c={channel:"stderr",mimetype:"text/html",data:`<pre>Streaming output truncated to last ${n} lines.
140
+ </pre>`,timestamp:-1},d=e[s];if(d.mimetype==="text/plain"){dn(typeof d.data=="string","expected string");let p=d.data.split(`
141
+ `),h=n-(i-p.length);return[c,{...d,data:p.slice(-h).join(`
142
+ `)},...e.slice(s+1)]}return[c,...e.slice(s+1)]}function pE(e,n){let i={...e};switch(n.status){case"queued":i.interrupted=!1,i.errored=!1,i.runElapsedTimeMs=null,i.debuggerActive=!1;break;case"running":i.interrupted=!1,e.stopped&&(i.output=null),i.status==="queued"&&(i.consoleOutputs=[]),i.stopped=!1,i.runStartTimestamp=n.timestamp,i.lastRunStartTimestamp=n.timestamp;break;case"idle":e.runStartTimestamp&&(i.runElapsedTimeMs=Vm.fromSeconds((n.timestamp??0)-e.runStartTimestamp).toMilliseconds(),i.runStartTimestamp=null,i.staleInputs=!1),!e.lastRunStartTimestamp&&n.timestamp&&(i.lastRunStartTimestamp=n.timestamp),i.debuggerActive=!1;break;case null:break;case"disabled-transitively":break;case void 0:break;default:Tl(n.status)}i.output=n.output??i.output,i.staleInputs=n.stale_inputs??i.staleInputs,i.status=n.status??i.status,i.serialization=n.serialization;let a=!1;n.output!=null&&n.output.mimetype==="application/vnd.marimo+error"&&((i.status==="queued"||i.status==="running")&&(i.status="idle"),dn(Array.isArray(n.output.data),"Expected error output data to be an array"),n.output.data.some(d=>d.type==="interruption")?(i.interrupted=!0,a=!0):n.output.data.some(d=>d.type.includes("ancestor"))?i.stopped=!0:i.errored=!0);let s=e.consoleOutputs;a&&(i.debuggerActive=!1,s=s.map(d=>d.channel==="stdin"?{...d,response:d.response??""}:d)),n.console!==null&&(s=Array.isArray(n.console)?n.console:dE([...s,n.console].filter(Boolean))),i.consoleOutputs=s,i.outline=Wm(i.output);let c=[n.console].flat().filter(Boolean).filter(d=>d.channel==="pdb");return c.length>0&&c.some(d=>d.data==="start")&&(i.debuggerActive=!0),i}function mE(e){let n={...e};return e.status!=="disabled-transitively"&&(n.status="queued"),n.interrupted=!1,n.errored=!1,n.runElapsedTimeMs=null,n.debuggerActive=!1,n}dm=function(e){return e==="running"||e==="queued"},z2=function(e,n){let{status:i,output:a,runStartTimestamp:s,interrupted:c,staleInputs:d}=e;if(c)return!1;if(n)return!0;let p=dm(i),h=i==="running"&&a!==null&&s!==null&&(a.timestamp??0)>s;return p&&!h?!0:d};function hE(e,n){return DR(e*1e3,n==null?void 0:n.in)}var Ey=!1;function gE(e){var a;let n=[],i=[e.console].filter(Boolean).flat();for(let s of i)if(s.mimetype==="text/plain"){dn(typeof s.data=="string","expected string");let c=s.channel==="stderr"||s.channel==="marimo-error";switch(s.channel){case"stdout":case"stderr":case"marimo-error":n.push({timestamp:s.timestamp||Date.now(),level:c?"stderr":"stdout",message:s.data,cellId:e.cell_id});break;default:break}}if(n.forEach(Ty.log),i.length===0&&Tu((a=e.output)==null?void 0:a.mimetype)&&Array.isArray(e.output.data)){e.output.data.forEach(c=>{Ty.log({level:"stderr",cellId:e.cell_id,timestamp:e.timestamp??0,message:JSON.stringify(c)})});let s=e.output.data.some(c=>c.type==="internal");!Ey&&s&&(Ey=!0,vu({title:"An internal error occurred",description:"See console for details.",className:"text-xs text-background bg-(--red-10) py-2 pl-3 *:flex *:gap-3"}))}return n}var Ty={log:e=>{let n=e.level==="stdout"?"gray":e.level==="stderr"?"red":"orange",i=e.level.toUpperCase();console.log(`%c[${i}]`,`color:${n}; padding:2px 0; border-radius:2px; font-weight:bold`,`[${Rm(e.timestamp)}]`,`(${e.cellId}) ${e.message}`)}};Rm=function(e){try{return hE(e).toLocaleTimeString(void 0,{hour12:!0,hour:"numeric",minute:"numeric",second:"numeric"})}catch{return""}},N2=function(e,n){var a,s;let i=(s=(a=e.get(ft).cellHandles[n])==null?void 0:a.current)==null?void 0:s.editorView;i?i.focus():Pe.warn(`[CellFocusManager] focusCellEditor: element not found: ${n}`)},nw=function(e){let n=document.getElementById(cr.create(e));n?Zd(n):Pe.warn(`[CellFocusManager] focusCell: element not found: ${e}`)},Sm=function(){return document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains("marimo-cell")};function Zd(e){try{e.focus()}catch{Pe.warn("[CellFocusManager] element may not be focusable",e)}}sm=function(e,n){let{retries:i,delay:a,initialDelay:s=0}=n,c=0,d=()=>{if(c<i){try{if(e())return}catch(p){Pe.error(`Error executing function on attempt ${c+1}, retrying`,{error:p})}c++,setTimeout(d,a)}};s>0?setTimeout(d,s):d()};function gs({cellId:e,cell:n,isCodeHidden:i,codeFocus:a,variableName:s}){var d;if(!n)return;let c=document.getElementById(cr.create(e));if(!c){Pe.warn("scrollCellIntoView: element not found");return}if(Sm()){Zd(c);return}if(i)Zd(c);else{let p=(d=n.current)==null?void 0:d.editorView;if(!p){Pe.warn("scrollCellIntoView: editor not found",e);return}if(p.hasFocus)return;if(sm(()=>(p.focus(),p.hasFocus),{retries:5,delay:20}),a==="top")p.dispatch({selection:{anchor:0,head:0}});else if(a==="bottom"){let h=p.state.doc.line(p.state.doc.lines);p.dispatch({selection:{anchor:h.from,head:h.from}})}else s&&Ru(p,s)}c.scrollIntoView({behavior:"smooth",block:"nearest"})}Yw=function(e){let n=document.getElementById(cr.create(e));if(!n){Pe.warn("scrollCellIntoView: element not found");return}n.classList.add("focus-outline"),setTimeout(()=>{n.classList.remove("focus-outline")},2e3),n.scrollIntoView({behavior:"smooth",block:"center"})};function yE(){let e=document.getElementById("App");e==null||e.scrollTo({top:e.scrollHeight,behavior:"smooth"})}function vE(){var e;(e=document.getElementById("App"))==null||e.scrollTo({top:0,behavior:"smooth"})}kr=function({id:e,name:n="_",code:i="",lastCodeRun:a=null,lastExecutionTime:s=null,edited:c=!1,config:d,serializedEditorState:p=null}){return{id:e,config:d||{hide_code:!1,disabled:!1,column:null},name:n,code:i,edited:c,lastCodeRun:a,lastExecutionTime:s,serializedEditorState:p}};function bE(e){return{hide_code:!1,disabled:!1,column:null,...e}}Cr=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 ef=Kt(zr(),1);us="__scratch__",Sr="setup";function Ry(e){let n={column:0,hide_code:!1,disabled:!1};return{...e,cellData:{[us]:kr({id:us,config:n}),...e.cellData},cellRuntime:{[us]:Cr(),...e.cellRuntime},cellHandles:{[us]:(0,At.createRef)(),...e.cellHandles}}}function wE(){return Ry({cellIds:Ml.from([]),cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set})}let _E,xE,Dy;({reducer:_E,createActions:xE,useActions:Dy,valueAtom:ft}=Sl(wE,{createNewCell:(e,n)=>{var R;let{cellId:i,before:a,code:s,lastCodeRun:c=null,lastExecutionTime:d=null,autoFocus:p=!0,skipIfCodeExists:h=!1,hideCode:v=!1}=n,w,_;if(h){for(let A of e.cellIds.inOrderIds)if(((R=e.cellData[A])==null?void 0:R.code)===s)return e}if(i==="__end__"){let A=e.cellIds.atOrThrow(0);w=A.id,_=A.length}else if(typeof i=="string"){let A=e.cellIds.findWithId(i);w=A.id,_=A.topLevelIds.indexOf(i)}else if(i.type==="__end__"){let A=e.cellIds.get(i.columnId)||e.cellIds.atOrThrow(0);w=A.id,_=A.length}else throw Error("Invalid cellId");let C=n.newCellId||fo.create(),E=a?_:_+1;return{...e,cellIds:e.cellIds.insertId(C,w,E),cellData:{...e.cellData,[C]:kr({id:C,code:s,lastCodeRun:c,config:bE({hide_code:v}),lastExecutionTime:d,edited:!!s&&s!==c})},cellRuntime:{...e.cellRuntime,[C]:Cr()},cellHandles:{...e.cellHandles,[C]:(0,At.createRef)()},scrollKey:p?C:null,untouchedNewCells:v?new Set([...e.untouchedNewCells,C]):e.untouchedNewCells}},moveCell:(e,n)=>{let{cellId:i,before:a,direction:s}=n;if(a!==void 0&&s!==void 0&&Pe.warn("Both before and direction specified for moveCell. Ignoring one."),s){let p=e.cellIds.findWithId(i),h=e.cellIds.indexOf(p),v=s==="left"?h-1:h+1,w=e.cellIds.at(v);return w?{...e,cellIds:e.cellIds.moveAcrossColumns(p.id,i,w.id,void 0),scrollKey:i}:e}let c=e.cellIds.findWithId(i),d=c.indexOfOrThrow(i);return a&&d===0?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,0),scrollKey:i}:!a&&d===c.length-1?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,c.length-1),scrollKey:i}:a?{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,d-1),scrollKey:i}:{...e,cellIds:e.cellIds.moveWithinColumn(c.id,d,d+1),scrollKey:i}},dropCellOverCell:(e,n)=>{let{cellId:i,overCellId:a}=n,s=e.cellIds.findWithId(i),c=e.cellIds.findWithId(a),d=s.indexOfOrThrow(i),p=c.indexOfOrThrow(a);return s.id===c.id?d===p?e:{...e,cellIds:e.cellIds.moveWithinColumn(s.id,d,p),scrollKey:null}:{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,i,c.id,a),scrollKey:null}},dropCellOverColumn:(e,n)=>{let{cellId:i,columnId:a}=n,s=e.cellIds.findWithId(i);return{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,i,a,void 0)}},dropOverNewColumn:(e,n)=>{let{cellId:i}=n;return{...e,cellIds:e.cellIds.moveToNewColumn(i)}},moveColumn:(e,n)=>n.column===n.overColumn?e:{...e,cellIds:e.cellIds.moveColumn(n.column,n.overColumn)},focusCell:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:a,where:s}=n,c=i.indexOfOrThrow(a),d;d=s==="before"?Xp(c-1,0,i.length-1):s==="after"?Xp(c+1,0,i.length-1):c;let p=i.atOrThrow(d);return gs({cellId:p,cell:e.cellHandles[p],isCodeHidden:ys(e,p),codeFocus:s==="after"?"top":"bottom",variableName:void 0}),e},focusTopCell:e=>{let n=e.cellIds.getColumns().at(0);if(n===void 0||n.length===0)return e;let i=n.first();return gs({cellId:i,cell:e.cellHandles[i],isCodeHidden:ys(e,i),codeFocus:void 0,variableName:void 0}),vE(),e},focusBottomCell:e=>{let n=e.cellIds.getColumns().at(-1);if(n===void 0||n.length===0)return e;let i=n.last();return gs({cellId:i,cell:e.cellHandles[i],isCodeHidden:ys(e,i),codeFocus:void 0,variableName:void 0}),yE(),e},sendToTop:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:a,scroll:s=!0}=n,c=i.indexOfOrThrow(a);return c===0?e:{...e,cellIds:e.cellIds.moveWithinColumn(i.id,c,0),scrollKey:s?a:null}},sendToBottom:(e,n)=>{let i=e.cellIds.findWithId(n.cellId);if(i.length===0)return e;let{cellId:a,scroll:s=!0}=n,c=i.indexOfOrThrow(a),d=i.length-1;return c===d?e:{...e,cellIds:e.cellIds.moveWithinColumn(i.id,c,d),scrollKey:s?a:null}},addColumn:(e,n)=>{let i=fo.create();return{...e,cellIds:e.cellIds.addColumn(n.columnId,[i]),cellData:{...e.cellData,[i]:kr({id:i})},cellRuntime:{...e.cellRuntime,[i]:Cr()},cellHandles:{...e.cellHandles,[i]:(0,At.createRef)()},scrollKey:i}},addColumnBreakpoint:(e,n)=>{let{cellId:i}=n;return e.cellIds.getColumns()[0].inOrderIds[0]===i?e:{...e,cellIds:e.cellIds.insertBreakpoint(i)}},deleteColumn:(e,n)=>{let{columnId:i}=n;return{...e,cellIds:e.cellIds.delete(i)}},mergeAllColumns:e=>({...e,cellIds:e.cellIds.mergeAllColumns()}),compactColumns:e=>({...e,cellIds:e.cellIds.compact()}),deleteCell:(e,n)=>{var h,v;let i=n.cellId;if(e.cellIds.hasOnlyOneId())return e;let a=e.cellIds.findWithId(i),s=a.indexOfOrThrow(i),c=s===0?1:s-1,d=null;a.length>1&&(d=a.atOrThrow(c));let p=(v=(h=e.cellHandles[i].current)==null?void 0:h.editorView)==null?void 0:v.state.toJSON({history:q3});return p.doc=e.cellData[i].code,SE(i),{...e,cellIds:e.cellIds.deleteById(i),history:[...e.history,{name:e.cellData[i].name,serializedEditorState:p,column:a.id,index:s,isSetupCell:i===Sr}],scrollKey:d}},undoDeleteCell:e=>{if(e.history.length===0)return e;let{name:n,serializedEditorState:i={doc:""},column:a,index:s,isSetupCell:c}=e.history[e.history.length-1],d=c?Sr:fo.create(),p=kr({id:d,name:n,code:i.doc,edited:i.doc.trim().length>0,serializedEditorState:i});return{...e,cellIds:e.cellIds.insertId(d,a,s),cellData:{...e.cellData,[d]:p},cellRuntime:{...e.cellRuntime,[d]:Cr()},cellHandles:{...e.cellHandles,[d]:(0,At.createRef)()},history:e.history.slice(0,-1)}},clearSerializedEditorState:(e,n)=>{let{cellId:i}=n;return bs({state:e,cellId:i,cellReducer:a=>({...a,serializedEditorState:null})})},updateCellCode:(e,n)=>{let{cellId:i,code:a,formattingChange:s}=n;return e.cellData[i]?bs({state:e,cellId:i,cellReducer:c=>s?{...c,code:a,lastCodeRun:c.edited?c.lastCodeRun:a}:{...c,code:a,edited:a.trim()!==c.lastCodeRun}}):e},updateCellName:(e,n)=>{let{cellId:i,name:a}=n;return bs({state:e,cellId:i,cellReducer:s=>({...s,name:a})})},updateCellConfig:(e,n)=>{let{cellId:i,config:a}=n;return bs({state:e,cellId:i,cellReducer:s=>({...s,config:{...s.config,...a}})})},prepareForRun:(e,n)=>bs({state:vs({state:e,cellId:n.cellId,cellReducer:i=>mE(i)}),cellId:n.cellId,cellReducer:i=>({...i,edited:!1,lastCodeRun:i.code.trim()})}),handleCellMessage:(e,n)=>{let i=n.cell_id,a=vs({state:e,cellId:i,cellReducer:s=>pE(s,n)});return{...a,cellLogs:[...a.cellLogs,...gE(n)]}},setCellIds:(e,n)=>{if(a3(e.cellIds.inOrderIds,n.cellIds))return e;let i={...e.cellData},a={...e.cellRuntime},s={...e.cellHandles};for(let c of n.cellIds)c in e.cellData||(i[c]=kr({id:c})),c in e.cellRuntime||(a[c]=Cr()),c in e.cellHandles||(s[c]=(0,At.createRef)());return{...e,cellIds:Ml.fromWithPreviousShape(n.cellIds,e.cellIds),cellData:i,cellRuntime:a,cellHandles:s}},setCellCodes:(e,n)=>{dn(n.codes.length===n.ids.length,"Expected codes and ids to have the same length");let i={...e},a=({cell:s,code:c,cellId:d})=>{if(!s)return kr({id:d,code:c,lastCodeRun:n.codeIsStale?null:c,edited:n.codeIsStale&&c.trim().length>0});let p=n.codeIsStale?s.lastCodeRun:c,h=p?p.trim()!==c.trim():!!c;if(s.code.trim()===c.trim())return{...s,code:c,edited:h,lastCodeRun:p};if(!gm()){let v=i.cellHandles[d].current;v!=null&&v.editorViewOrNull&&cs(v.editorViewOrNull,c)}return{...s,code:c,edited:h,lastCodeRun:p}};for(let[s,c]of p_(n.ids,n.codes))s===void 0||c===void 0||(i={...i,cellData:{...i.cellData,[s]:a({cell:i.cellData[s],code:c,cellId:s})}});return i},setStdinResponse:(e,n)=>{let{cellId:i,response:a,outputIndex:s}=n;return vs({state:e,cellId:i,cellReducer:c=>{let d=[...c.consoleOutputs],p=d[s];return p.channel==="stdin"?(d[s]={channel:"stdin",mimetype:p.mimetype,data:p.data,timestamp:p.timestamp,response:a},{...c,interrupted:!1,consoleOutputs:d}):(Pe.warn("Expected stdin output"),c)}})},setCells:(e,n)=>{let i=Object.fromEntries(n.map(s=>[s.id,s])),a=Object.fromEntries(n.map(s=>[s.id,Cr()]));return Ry({...e,cellIds:Ml.fromIdsAndColumns(n.map(s=>[s.id,s.config.column])),cellData:i,cellRuntime:a,cellHandles:Object.fromEntries(n.map(s=>[s.id,(0,At.createRef)()]))})},moveToNextCell:(e,n)=>{let{cellId:i,before:a,noCreate:s=!1}=n;if(i==="__scratch__")return e;let c=e.cellIds.findWithId(i),d=c.indexOfOrThrow(i),p=a?d-1:d+1,h=p===c.length,v=p===-1;if(h&&!s){let w=fo.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,p),cellData:{...e.cellData,[w]:kr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Cr()},cellHandles:{...e.cellHandles,[w]:(0,At.createRef)()},scrollKey:w}}if(v&&!s){let w=fo.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,0),cellData:{...e.cellData,[w]:kr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Cr()},cellHandles:{...e.cellHandles,[w]:(0,At.createRef)()},scrollKey:w}}if((h||v)&&s)return e;if(p>=0&&p<c.length){let w=c.atOrThrow(p);gs({cellId:w,cell:e.cellHandles[w],isCodeHidden:ys(e,w),codeFocus:a?"bottom":"top",variableName:void 0})}return e},markTouched:(e,n)=>{let{cellId:i}=n;if(e.untouchedNewCells.has(i)){let a=new Set(e.untouchedNewCells);return a.delete(i),{...e,untouchedNewCells:a}}return e},scrollToTarget:e=>{let n=e.scrollKey;if(n===null)return e;let i=e.cellIds.findWithId(n),a=i.indexOfOrThrow(n),s=a===i.length-1?i.last():i.atOrThrow(a);return gs({cellId:s,cell:e.cellHandles[s],isCodeHidden:ys(e,s),codeFocus:void 0,variableName:void 0}),{...e,scrollKey:null}},foldAll:e=>(D_(Object.values(e.cellHandles).map(n=>{var i;return(i=n.current)==null?void 0:i.editorView})),e),unfoldAll:e=>(O_(Object.values(e.cellHandles).map(n=>{var i;return(i=n.current)==null?void 0:i.editorView})),e),clearLogs:e=>({...e,cellLogs:[]}),collapseCell:(e,n)=>{let{cellId:i}=n,a=e.cellIds.findWithId(i),s=a.topLevelIds.map(p=>e.cellRuntime[p].outline),c=ky(a.indexOfOrThrow(i),s);if(!c)return e;let d=a.atOrThrow(c[1]);return{...e,cellIds:e.cellIds.transformWithCellId(i,p=>p.collapse(i,d)),scrollKey:i}},expandCell:(e,n)=>{let{cellId:i}=n;return{...e,cellIds:e.cellIds.transformWithCellId(i,a=>a.expand(i)),scrollKey:i}},collapseAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>{let i=n.topLevelIds.map(h=>e.cellRuntime[h].outline),a=[...n.nodes],s=[],c=[],d=a.length-1;for(;d>=0;){let h=ky(d,i);if(h){let v=d,w=h[1],_=s.find(R=>R.start<=w&&R.end===w);_&&(w=_.start),s.push({start:v,end:w});let C=n.atOrThrow(v),E=n.atOrThrow(w);c.push({id:C,until:E})}else c.push(null);d--}let p=c.reverse();return n.collapseAll(p)})}),expandAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>n.expandAll())}),showCellIfHidden:(e,n)=>{let{cellId:i}=n,a=e.cellIds.findWithId(i),s=a,c=a.findAndExpandDeep(i);return c.equals(s)?e:{...e,cellIds:e.cellIds.transformWithCellId(i,()=>c)}},splitCell:(e,n)=>{var w;let{cellId:i}=n,a=e.cellIds.findWithId(i),s=a.indexOfOrThrow(i),c=e.cellData[i],d=e.cellHandles[i].current;if((d==null?void 0:d.editorView)==null)return e;let{beforeCursorCode:p,afterCursorCode:h}=iE(d.editorView);cs(d.editorView,p);let v=fo.create();return{...e,cellIds:e.cellIds.insertId(v,a.id,s+1),cellData:{...e.cellData,[i]:{...c,code:p,edited:!!p&&p.trim()!==((w=c.lastCodeRun)==null?void 0:w.trim())},[v]:kr({id:v,code:h,edited:!!h})},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]},[v]:Cr()},cellHandles:{...e.cellHandles,[v]:(0,At.createRef)()},scrollKey:v}},undoSplitCell:(e,n)=>{var d;let{cellId:i,snapshot:a}=n,s=e.cellData[i],c=e.cellHandles[i].current;return(c==null?void 0:c.editorView)==null?e:(cs(c.editorView,a),{...e,cellIds:e.cellIds.transformWithCellId(i,p=>{let h=p.indexOfOrThrow(i)+1;return p.deleteAtIndex(h)}),cellData:{...e.cellData,[i]:{...s,code:a,edited:!!a&&(a==null?void 0:a.trim())!==((d=s.lastCodeRun)==null?void 0:d.trim())}},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]}},cellHandles:{...e.cellHandles}})},clearCellOutput:(e,n)=>{let{cellId:i}=n;return vs({state:e,cellId:i,cellReducer:a=>({...a,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(e,n)=>{let{cellId:i}=n;return vs({state:e,cellId:i,cellReducer:a=>({...a,consoleOutputs:a.consoleOutputs.filter(s=>s.channel==="stdin"&&s.response==null)})})},clearAllCellOutputs:e=>{let n={...e.cellRuntime};for(let i of e.cellIds.inOrderIds)n[i]={...n[i],output:null,consoleOutputs:[]};return{...e,cellRuntime:n}},addSetupCellIfDoesntExist:(e,n)=>{let{code:i}=n;return i??(i="# Initialization code that runs before all other cells"),"setup"in e.cellIds?{...e,scrollKey:Sr}:{...e,cellIds:e.cellIds.insertId(Sr,e.cellIds.atOrThrow(0).id,0),cellData:{...e.cellData,[Sr]:kr({id:Sr,name:Sr,code:i,edited:!!i})},cellRuntime:{...e.cellRuntime,[Sr]:Cr()},cellHandles:{...e.cellHandles,[Sr]:(0,At.createRef)()},scrollKey:Sr}}}));function ys(e,n){return!!e.cellData[n].config.hide_code&&!e.untouchedNewCells.has(n)}function vs({state:e,cellId:n,cellReducer:i}){return n in e.cellRuntime?{...e,cellRuntime:{...e.cellRuntime,[n]:i(e.cellRuntime[n])}}:(Pe.warn(`Cell ${n} not found in state`),e)}function bs({state:e,cellId:n,cellReducer:i}){return n in e.cellData?{...e,cellData:{...e.cellData,[n]:i(e.cellData[n])}}:(Pe.warn(`Cell ${n} not found in state`),e)}_w=function(e){let n=e.cellData,i={column:null};return e.cellIds.getColumns().length>1?e.cellIds.getColumns().flatMap((a,s)=>a.inOrderIds.map((c,d)=>{let p={...i};return d===0&&(p.column=s),{...n[c].config,...p}})):e.cellIds.getColumns().flatMap(a=>a.inOrderIds.map(s=>({...n[s].config,...i})))};let Oy;Uu=Fe(e=>e(ft).cellIds),Jw=Fe(e=>e(Uu).hasOnlyOneId()),fw=Fe(e=>Hm(e(ft)).length>0),Kw=Fe(e=>$m(e(ft)).length>0),Bw=Fe(e=>A_(e(ft))),gw=Fe(e=>M_(e(ft))),Hu=Fe(e=>{let{cellIds:n,cellRuntime:i,cellData:a}=e(ft);return n.inOrderIds.map(s=>{var p;let c=i[s],{name:d}=a[s];if(Tu((p=c.output)==null?void 0:p.mimetype)){dn(Array.isArray(c.output.data),"Expected array data");let h=c.output.data.filter(v=>!v.type.includes("ancestor"));if(h.length>0)return{output:{...c.output,data:h},cellId:s,cellName:d}}return null}).filter(Boolean)}),k2=Fe(e=>{let{cellIds:n,cellRuntime:i}=e(ft);return sE(n.inOrderIds.map(a=>i[a].outline))}),pw=Fe(e=>e(Hu).length),Oy=s3(Fe(e=>{let{cellIds:n,cellData:i}=e(ft);return ei.fromEntries(n.inOrderIds.map(a=>{var s;return[a,(s=i[a])==null?void 0:s.name]}))}));var kE=Fe(e=>e(ft).scrollKey);R2=()=>Un(ft),Ew=()=>Un(Uu),H2=()=>Un(Oy),Dw=()=>Un(Hu),B2=()=>Un(ft).cellLogs,I2=()=>Un(kE),qu=()=>ct.get(ft),Mw=()=>{let{cellIds:e,cellData:n}=ct.get(ft);return e.inOrderIds.map(i=>{var a;return(a=n[i])==null?void 0:a.name}).filter(Boolean)};var CE=x_(y_(ft,e=>e.cellIds.inOrderIds.map(n=>e.cellData[n])));V2=()=>Vb(CE),X2=Fe(e=>P_(e(ft))),Qw=Fe(e=>N_(e(ft))),Y2=Fe(e=>e(ft).cellIds.colLength),kw=Fe(e=>e(ft).cellIds.idLength>0),yw=Fe(e=>e(ft).cellIds.getColumnIds()),Fu=nd(e=>Fe(n=>n(ft).cellData[e]));var Py=nd(e=>Fe(n=>n(ft).cellRuntime[e]));const Ny=nd(e=>Fe(n=>n(ft).cellHandles[e]));function SE(e){Fu.remove(e),Py.remove(e),Ny.remove(e)}E2=e=>{let n=(0,ef.c)(2),i;return n[0]===e?i=n[1]:(i=Fu(e),n[0]=e,n[1]=i),Un(i)},U2=e=>{let n=(0,ef.c)(2),i;return n[0]===e?i=n[1]:(i=Py(e),n[0]=e,n[1]=i),Un(i)},w2=e=>{let n=(0,ef.c)(2),i;return n[0]===e?i=n[1]:(i=Ny(e),n[0]=e,n[1]=i),Un(i)},Nm=()=>{let{cellIds:e,cellHandles:n}=ct.get(ft);return e.inOrderIds.map(i=>{var a,s;return(s=(a=n[i])==null?void 0:a.current)==null?void 0:s.editorViewOrNull}).filter(Boolean)},Iw=e=>{var i;let{cellHandles:n}=ct.get(ft);return(i=n[e].current)==null?void 0:i.editorView},$w=function(e){let{cellIds:n,cellData:i,cellRuntime:a}=e;return n.getColumns().flatMap(s=>s.topLevelIds.map(c=>({...i[c],...a[c]})))},Pw=function(e){return Fe(n=>n(ft).untouchedNewCells.has(e))};function EE(e){let n=Fe(i=>{let a=i(ft).cellRuntime[e];if(!a||a.status!=="idle")return;let s=a.consoleOutputs;if(!s||s.length===0)return;let c=s.find(d=>d.mimetype==="application/vnd.marimo+traceback");if(c)return c.data});return Fe(i=>{let a=i(n);if(a)return Dm(a)})}T2=function(){return Dy()}})();export{b2 as $,bu as $n,Rl as $t,w2 as A,_2 as An,zn as Ar,wu as At,sm as B,_u as Bn,cr as Br,x2 as Bt,k2 as C,Dl as Cn,C2 as Cr,S2 as Ct,E2 as D,lm as Dn,os as Dr,oa as Dt,T2 as E,cm as En,xu as Er,Ol as Et,R2 as F,D2 as Fn,O2 as Fr,um as Ft,dm as G,fm as Gn,pm as Gr,P2 as Gt,N2 as H,M2 as Hn,L2 as Hr,A2 as Ht,I2 as I,mm as In,j2 as Ir,hm as It,gm as J,q2 as Jn,ku as Jt,z2 as K,Cu as Kn,ym as Kr,F2 as Kt,kr as L,vm as Ln,bm as Lr,wm as Lt,B2 as M,Di as Mn,Su as Mr,as as Mt,H2 as N,Pl as Nn,Nl as Nr,_m as Nt,V2 as O,$2 as On,W2 as Or,xm as Ot,U2 as P,K2 as Pn,Eu as Pr,km as Pt,Tu as Q,Q2 as Qn,G2 as Qt,Cr as R,Ru as Rn,fo as Rr,J2 as Rt,X2 as S,Cm as Sn,Ml as Sr,po as St,Y2 as T,Z2 as Tn,ew as Tr,tw as Tt,Sm as U,Du as Un,Em as Ur,Ou as Ut,nw as V,rw as Vn,Pu as Vr,Tm as Vt,Rm as W,Nu as Wn,iw as Wr,aa as Wt,ow as X,aw as Xn,sw as Xt,lw as Y,cw as Yn,uw as Yt,Mu as Z,mo as Zn,dw as Zt,fw as _,jR as __tla,ri as _n,Dm as _r,ur as _t,pw as a,mw as an,sa as ar,hw as at,gw as b,Om as bn,ho as br,Lu as bt,yw as c,Pm as cn,vw as cr,Au as ct,Nm as d,Mm as dn,Lm as dr,bw as dt,ww as en,Am as er,Im as et,_w as f,Ll as fn,Iu as fr,xw as ft,kw as g,ju as gn,Cw as gr,Al as gt,qu as h,go as hn,zu as hr,jm as ht,Fu as i,qm as in,Dt as ir,Sw as it,Ew as j,Tw as jn,Rw as jr,Bu as jt,Dw as k,Ow as kn,ss as kr,la as kt,Pw as l,Nw as ln,zm as lr,Fm as lt,Mw as m,Il as mn,ca as mr,Bm as mt,Sr as n,Oi as nn,Lw as nr,ii as nt,Hu as o,Aw as on,Hm as or,Er as ot,Iw as p,Vu as pn,jw as pr,qw as pt,Vm as q,zw as qn,$u as qr,Fw as qt,Bw as r,ls as rn,Wu as rr,cs as rt,Uu as s,Ku as sn,$m as sr,Hw as st,us as t,Vw as tn,jl as tr,Wm as tt,$w as u,Ww as un,Uw as ur,Um as ut,Kw as v,Qu as vn,Km as vr,Gu as vt,Qw as w,Ju as wn,Qm as wr,Xu as wt,ft as x,Gm as xn,Jm as xr,Gw as xt,Jw as y,Yu as yn,Xm as yr,Xw as yt,Yw as z,Zw as zn,e_ as zr,t_ as zt};