@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.
- package/dist/assets/{CellStatus-DjUtGUqj.js → CellStatus-CHA41gSk.js} +1 -1
- package/dist/assets/{ConnectedDataExplorerComponent-Bjfp6wiJ.js → ConnectedDataExplorerComponent-cTGPcGbT.js} +1 -1
- package/dist/assets/{ConsoleOutput-C4nRvbNL.js → ConsoleOutput-CcWTsPJI.js} +1 -1
- package/dist/assets/{LazyAnyLanguageCodeMirror-BzY5E2SR.js → LazyAnyLanguageCodeMirror-De4wCXx1.js} +2 -2
- package/dist/assets/{MarimoErrorOutput-DKtP9DfP.js → MarimoErrorOutput-ZIgqDBQe.js} +1 -1
- package/dist/assets/{Output-x6LACtkd.js → Output-BNpy6qAs.js} +1 -1
- package/dist/assets/{RenderHTML-B4Xlxz9Q.js → RenderHTML-BBVeCFEd.js} +1 -1
- package/dist/assets/{TinyCode-CgC7YtPL.js → TinyCode-CSwZ6pBr.js} +1 -1
- package/dist/assets/{add-cell-with-ai-D94Om7DS.js → add-cell-with-ai-DF_F9Sqz.js} +1 -1
- package/dist/assets/{add-database-form-BDX2uZCC.js → add-database-form-C6bWFcDu.js} +1 -1
- package/dist/assets/{add-missing-import-Cy6g_y6i.js → add-missing-import-pmcK06GU.js} +1 -1
- package/dist/assets/{agent-panel-DPCsTGPU.js → agent-panel-Cy7eGnp2.js} +1 -1
- package/dist/assets/{any-language-editor-CgFodhrt.js → any-language-editor-CtKaNSoA.js} +1 -1
- package/dist/assets/{app-config-button-C02qSaV5.js → app-config-button-DkPbZ9Gv.js} +1 -1
- package/dist/assets/{cell-actions-CNcpitg7.js → cell-actions-BwzVQ6Dx.js} +1 -1
- package/dist/assets/{cell-editor-oXchtd-2.js → cell-editor-HcAVCF81.js} +4 -4
- package/dist/assets/{cell-link-d9BMXpwm.js → cell-link-Bp_0p3CR.js} +1 -1
- package/dist/assets/cells-DV6dfoCq.js +142 -0
- package/dist/assets/{chat-components-u_00E1Iv.js → chat-components-laNRM4nR.js} +2 -2
- package/dist/assets/{chat-panel-BBQVqm6k.js → chat-panel-D0ofjONu.js} +1 -1
- package/dist/assets/{client-Co0Fvwib.js → client-CHkG9bdV.js} +2 -2
- package/dist/assets/{column-preview-BsCKvnq_.js → column-preview-BavQbx6K.js} +1 -1
- package/dist/assets/{command-palette-C9_cNlJc.js → command-palette-BeIRV-WM.js} +1 -1
- package/dist/assets/{common-BWlM0NQw.js → common-C3tRfmeF.js} +1 -1
- package/dist/assets/{datasources-panel-CRS3I41j.js → datasources-panel-MHkoQPff.js} +1 -1
- package/dist/assets/{dependency-graph-panel-PEDmfewV.js → dependency-graph-panel-qI_Vzr7L.js} +1 -1
- package/dist/assets/dist-Dv7WCK3M.js +2 -0
- package/dist/assets/{documentation-panel-Caz5K_OT.js → documentation-panel-BSLe420O.js} +1 -1
- package/dist/assets/{edit-page-DuRQ1eIB.js → edit-page-BWiHWYlZ.js} +3 -3
- package/dist/assets/{error-panel-D0ZJmprT.js → error-panel-BXZjD7vi.js} +1 -1
- package/dist/assets/{esm-D8ZMWeYP.js → esm-C1NahKuy.js} +1 -1
- package/dist/assets/{file-explorer-panel-Jnmw434H.js → file-explorer-panel-Dfhel-3W.js} +1 -1
- package/dist/assets/{floating-outline-BXSB3SQ6.js → floating-outline-CgxonLQ-.js} +1 -1
- package/dist/assets/{focus-CUS3ckCE.js → focus--Piy3rX5.js} +1 -1
- package/dist/assets/{form-nAUuUhu3.js → form-Cdn744fY.js} +1 -1
- package/dist/assets/{form-BlnK1x-p.js → form-q5HZfP0M.js} +1 -1
- package/dist/assets/{glide-data-editor-BFKn2tIP.js → glide-data-editor-DyfmOgFY.js} +1 -1
- package/dist/assets/{home-page-DIYkvTFf.js → home-page-CQvcO2-r.js} +1 -1
- package/dist/assets/{index-DsdBxblV.js → index-vG-gdKWq.js} +7 -7
- package/dist/assets/{kiosk-mode-CHVximkk.js → kiosk-mode-OsMWvXhW.js} +1 -1
- package/dist/assets/{layout-CRXL9551.js → layout-BaosNuEp.js} +1 -1
- package/dist/assets/{logs-panel-9HAqKVuS.js → logs-panel-DzPVobVI.js} +1 -1
- package/dist/assets/{mermaid-D4G-AG2G.js → mermaid-DEUZM6JF.js} +1 -1
- package/dist/assets/{mode-CtH3Xe58.js → mode-BK9SOQXS.js} +1 -1
- package/dist/assets/{name-cell-input-DZWpmHYT.js → name-cell-input-VEOAxqMs.js} +1 -1
- package/dist/assets/{outline-panel-D0DvfWbQ.js → outline-panel-h_xN2aCi.js} +1 -1
- package/dist/assets/{packages-panel-DmqfeORQ.js → packages-panel-MgK5SK20.js} +1 -1
- package/dist/assets/{readonly-python-code-Ba_IF_mK.js → readonly-python-code-ChK3PfU6.js} +1 -1
- package/dist/assets/{run-page-Dtlg4eqe.js → run-page-BGTVY0j4.js} +1 -1
- package/dist/assets/{scratchpad-panel-5EljtEkX.js → scratchpad-panel-DZbJOjct.js} +1 -1
- package/dist/assets/{snippets-panel-Cg9ksbKX.js → snippets-panel-BkDWOzb7.js} +1 -1
- package/dist/assets/{state-7Nd5UYc6.js → state-BHcVA2dC.js} +1 -1
- package/dist/assets/{state-BDyZ5-wH.js → state-CjZ41ddG.js} +1 -1
- package/dist/assets/{storage-DczTxxXy.js → storage-Q85CaPfH.js} +1 -1
- package/dist/assets/{tracing-CbAnhOdo.js → tracing-DZ3Q4ew0.js} +1 -1
- package/dist/assets/{tracing-panel-B3iny2EN.js → tracing-panel-cWcQ0_7O.js} +2 -2
- package/dist/assets/{types-h5wz3HYN.js → types--mPsPGF4.js} +1 -1
- package/dist/assets/{useAddCell-CWXmrhes.js → useAddCell-Ig4Te4YX.js} +1 -1
- package/dist/assets/{useCellActionButton-fVEGFa_R.js → useCellActionButton-Dxhr7c1D.js} +1 -1
- package/dist/assets/{useDeleteCell-Bg8Hgk6e.js → useDeleteCell-Ba4wqcnv.js} +1 -1
- package/dist/assets/{useNotebookActions-BurReKKo.js → useNotebookActions-ClgDTwuq.js} +1 -1
- package/dist/assets/{useRunCells-BiWuvMY1.js → useRunCells-WnlQjiPG.js} +1 -1
- package/dist/assets/{useSplitCell-DhhZ7xVP.js → useSplitCell-BDVxP5U-.js} +1 -1
- package/dist/assets/useTheme-CJkb1R7C.js +1 -0
- package/dist/assets/{utilities.esm-CCw2KKJk.js → utilities.esm-SfrtJjbv.js} +1 -1
- package/dist/assets/{variable-panel-Dkhq2h3W.js → variable-panel-1cBDHa5H.js} +1 -1
- package/dist/assets/{vega-component-CrZQsWq8.js → vega-component-DBpZ-MEj.js} +1 -1
- package/dist/index.html +27 -27
- package/package.json +1 -1
- package/src/components/app-config/data-form.tsx +3 -3
- package/src/core/codemirror/language/languages/sql/sql.ts +2 -1
- package/dist/assets/cells-CZmitpcp.js +0 -151
- package/dist/assets/dist-CzgFQFBf.js +0 -2
- package/dist/assets/node-sql-parser-B60nzzE3.js +0 -68
- package/dist/assets/useTheme-DcMAIbRt.js +0 -1
- /package/dist/assets/{esm-DuHka6En.js → esm-D3_a5hg-.js} +0 -0
- /package/dist/assets/{react-plotly-B5BZoChE.js → react-plotly-BedjJ4JE.js} +0 -0
- /package/dist/assets/{wasm-BU5edgJp.js → wasm-86TLpKv7.js} +0 -0
- /package/dist/assets/{web-vitals-DxEe-Gv6.js → web-vitals-DCCm3RCd.js} +0 -0
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./esm-DuHka6En.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","./node-sql-parser-B60nzzE3.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var q3=Object.defineProperty;var z3=(Mi,Hr,_o)=>Hr in Mi?q3(Mi,Hr,{enumerable:!0,configurable:!0,writable:!0,value:_o}):Mi[Hr]=_o;var Ce=(Mi,Hr,_o)=>z3(Mi,typeof Hr!="symbol"?Hr+"":Hr,_o);import{a as gu,n as c2,o as F3,r as B3,s as Kt,t as ke}from"./chunk-DZLz74EQ.js";import{a as H3,c as Kn,d as Fe,n as st,o as u2,s as d2,t as V3}from"./jotai-BTnrNcC1.js";import{t as yu}from"./react-BcIddLXZ.js";import{t as $3}from"./react-dom-D6bRRS5R.js";import{A as W3,E as f2,F as p2,P as U3,V as K3,w as Q3,z as G3}from"./zod-U2NFpcFA.js";import{t as Br}from"./compiler-runtime-Cr9loedd.js";import{f as J3}from"./_Uint8Array-D5Z9rM2X.js";import{t as X3}from"./_arrayMap-DQI2GUNb.js";import{t as Y3}from"./toInteger-Bor4StOs.js";import{d as Z3,t as eR}from"./isArrayLikeObject-DKyJYtr8.js";import{u as tR}from"./_baseIsEqual-CVFfFJm2.js";import{t as nR}from"./_baseProperty-c4IQJQis.js";import{t as m2}from"./debounce-BUM2losY.js";import{a as ni,o as rR,u as Pe}from"./hotkeys-ClCtr3_I.js";import{t as fn}from"./invariant-D5a0EE05.js";import{d as rm,t as iR}from"./utils-BpjB6B-Y.js";import{g as oR,r as aR}from"./config-e9OVB2bJ.js";import{o as h2}from"./useEventListener-D1FLsfmf.js";import{t as sR}from"./jsx-runtime-mwDPpfh_.js";import{t as vu}from"./cn-DEUt_IsG.js";import{t as g2}from"./button-Zjtz1syG.js";import{Bt as y2,C as lR,D as cR,Dt as im,Et as us,F as v2,Gt as ho,H as uR,Ht as dR,It as bu,Jt as ds,K as wu,Kt as Rl,Lt as pn,R as b2,Rt as _u,S as fR,T as w2,Ut as _2,V as x2,Vt as xu,b as k2,bt as aa,ct as pR,et as C2,f as S2,ft as mR,ht as hR,it as gR,k as yR,l as ce,nt as vR,ot as sa,p as bR,qt as la,rt as en,tt as Oi,u as E2,wt as T2,yt as om,zt as Dl}from"./dist-o3-gJN-A.js";import{E as wR,S as _R,T as xR,_ as kR,a as R2,b as CR,d as am,f as SR,h as ER,i as TR,k as RR,m as DR,o as OR,p as PR,s as LR,t as NR,v as MR,w as AR,x as IR}from"./dist-CzgFQFBf.js";import{a as D2,i as jR,n as ri,o as O2,p as sm,s as Ol}from"./once-3GsqimLM.js";import{t as qR}from"./capabilities-CEL4hxAo.js";import{t as Pl}from"./createReducer-C6dJ71nW.js";import{t as Pi}from"./requests-DD3OWR81.js";import{t as ue}from"./preload-helper-DImqtvgl.js";import{d as P2,l as L2,n as zR,o as N2,p as FR,r as ku}from"./dist-DdXBxU_X.js";import{i as M2,o as BR}from"./dist-ws1ADWL0.js";import{a as HR,i as lm,n as VR,r as A2,t as $R}from"./dist-BGbJQ9FV.js";import{n as WR}from"./stex-w1KpyykF.js";import{n as Cu,t as UR}from"./key-BOd4SjWu.js";import{t as Su}from"./use-toast-BPMVOfO3.js";import{i as cm,r as um}from"./main-CCaZmKLi.js";import{t as I2}from"./marked.esm-BB_RKOA5.js";import{a as KR,s as ii,t as Ll}from"./connection-CsVOmbVi.js";import{a as QR,c as GR,d as JR,f as j2,i as XR,l as YR,n as ZR,o as dm,r as e4,s as fm,t as t4,u as n4}from"./dist-dCpey1ug.js";import{i as Nl,t as r4}from"./useLifecycle-CxNbfWnk.js";import{n as i4}from"./useTheme-DcMAIbRt.js";import{t as zn}from"./createLucideIcon-CaU6_Jtx.js";import{i as o4,n as a4,r as pm,t as s4}from"./type-DVCC-93H.js";import{t as l4}from"./check-Dc7YCRim.js";import{a as c4,c as u4,i as mm,m as d4,n as f4,o as q2,r as p4,s as m4,t as h4}from"./select-Di-JjADd.js";import{t as g4,u as y4}from"./toDate-CnvLb18a.js";import{t as cr}from"./badge-CxcKOiwY.js";import{C as v4,g as hm,v as b4,x as z2,y as w4}from"./Combination-DWHMUa0d.js";import{l as _4}from"./dist-1ZdxNBaX.js";import{i as x4,t as gm}from"./tooltip-CerBk_un.js";import{t as k4}from"./useNonce-CL3DrH5R.js";let F2,Eu,Ml,B2,H2,Fn,Tu,ym,Ru,ur,V2,$2,Al,W2,U2,K2,vm,fs,ca,Q2,bm,Du,Il,G2,J2,X2,wm,_m,xm,km,Y2,Z2,ew,tw,nw,rw,Cm,iw,Sm,Em,ow,Ou,aw,Pu,Tm,sw,Cr,Rm,Dm,Om,lw,Li,Lu,ps,cw,jl,ql,Pm,uw,dw,fw,Lm,pw,mw,Nu,Nm,Mu,hw,gw,Sr,Au,go,yw,vw,Mm,zl,yo,bw,ww,_w,xw,Am,Iu,Im,ju,kw,Cw,qu,jm,qm,zu,Sw,ua,Ew,Tw,Rw,Dw,Ow,Pw,Fu,vo,Lw,Nw,oi,zm,dr,Mw,Aw,da,Iw,jw,Fm,bo,Bu,qw,Bm,zw,Hu,Hm,Vm,$m,Fw,Bw,Wm,Um,Hw,Fl,Vu,Vw,$w,$u,Ww,Bl,Wu,wo,Uu,Km,Ku,Qm,Dt,Uw,Kw,Qw,Gw,Qu,Jw,Xw,ms,fa,Yw,Zw,Gm,Jm,e_,Hl,pa,Xm,Er,Ni,t_,ai,Gu,n_,Ym,Tr,r_,Ju,i_,o_,Zm,a_,Xu,s_,l_,ma,Yu,hs,Zu,ed,eh,c_,gs,u_,Vl,th,d_,f_,p_,nh,m_,td,rh,nd,h_,rd,ih,id,ft,oh,ah,g_,y_,od,sh,v_,b_,w_,__,x_,C4=(async()=>{var Hi,df;let Mi,Hr,_o,ch;Mi=ke((e=>{function n(X,G){var K=X.length;X.push(G);e:for(;0<K;){var Le=K-1>>>1,Qe=X[Le];if(0<s(Qe,G))X[Le]=G,X[K]=Qe,K=Le;else break e}}function i(X){return X.length===0?null:X[0]}function a(X){if(X.length===0)return null;var G=X[0],K=X.pop();if(K!==G){X[0]=K;e:for(var Le=0,Qe=X.length,ut=Qe>>>1;Le<ut;){var Be=2*(Le+1)-1,We=X[Be],De=Be+1,Ne=X[De];if(0>s(We,K))De<Qe&&0>s(Ne,We)?(X[Le]=Ne,X[De]=K,Le=De):(X[Le]=We,X[Be]=K,Le=Be);else if(De<Qe&&0>s(Ne,K))X[Le]=Ne,X[De]=K,Le=De;else break e}}return G}function s(X,G){var K=X.sortIndex-G.sortIndex;return K===0?X.id-G.id:K}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var m=[],g=[],w=1,_=null,C=3,E=!1,T=!1,A=!1,H=!1,V=typeof setTimeout=="function"?setTimeout:null,W=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function Q(X){for(var G=i(g);G!==null;){if(G.callback===null)a(g);else if(G.startTime<=X)a(g),G.sortIndex=G.expirationTime,n(m,G);else break;G=i(g)}}function pe(X){if(A=!1,Q(X),!T)if(i(m)!==null)T=!0,P||(P=!0,Y());else{var G=i(g);G!==null&&ie(pe,G.startTime-X)}}var P=!1,I=-1,$=5,de=-1;function fe(){return H?!0:!(e.unstable_now()-de<$)}function be(){if(H=!1,P){var X=e.unstable_now();de=X;var G=!0;try{e:{T=!1,A&&(A=!1,W(I),I=-1),E=!0;var K=C;try{t:{for(Q(X),_=i(m);_!==null&&!(_.expirationTime>X&&fe());){var Le=_.callback;if(typeof Le=="function"){_.callback=null,C=_.priorityLevel;var Qe=Le(_.expirationTime<=X);if(X=e.unstable_now(),typeof Qe=="function"){_.callback=Qe,Q(X),G=!0;break t}_===i(m)&&a(m),Q(X)}else a(m);_=i(m)}if(_!==null)G=!0;else{var ut=i(g);ut!==null&&ie(pe,ut.startTime-X),G=!1}}break e}finally{_=null,C=K,E=!1}G=void 0}}finally{G?Y():P=!1}}}var Y;if(typeof M=="function")Y=function(){M(be)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,Ee=we.port2;we.port1.onmessage=be,Y=function(){Ee.postMessage(null)}}else Y=function(){V(be,0)};function ie(X,G){I=V(function(){X(e.unstable_now())},G)}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 G=3;break;default:G=C}var K=C;C=G;try{return X()}finally{C=K}},e.unstable_requestPaint=function(){H=!0},e.unstable_runWithPriority=function(X,G){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var K=C;C=X;try{return G()}finally{C=K}},e.unstable_scheduleCallback=function(X,G,K){var Le=e.unstable_now();switch(typeof K=="object"&&K?(K=K.delay,K=typeof K=="number"&&0<K?Le+K:Le):K=Le,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:G,priorityLevel:X,startTime:K,expirationTime:Qe,sortIndex:-1},K>Le?(X.sortIndex=K,n(g,X),i(m)===null&&X===i(g)&&(A?(W(I),I=-1):A=!0,ie(pe,K-Le))):(X.sortIndex=Qe,n(m,X),T||E||(T=!0,P||(P=!0,Y()))),X},e.unstable_shouldYield=fe,e.unstable_wrapCallback=function(X){var G=C;return function(){var K=C;C=G;try{return X.apply(this,arguments)}finally{C=K}}}})),Hr=ke(((e,n)=>{n.exports=Mi()})),_o=ke((e=>{var n=Hr(),i=yu(),a=$3();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 f(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function m(t){if(d(t)!==t)throw Error(s(188))}function g(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 p=o.return;if(p===null)break;var y=p.alternate;if(y===null){if(l=p.return,l!==null){o=l;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===o)return m(p),t;if(y===l)return m(p),r;y=y.sibling}throw Error(s(188))}if(o.return!==l.return)o=p,l=y;else{for(var S=!1,D=p.child;D;){if(D===o){S=!0,o=p,l=y;break}if(D===l){S=!0,l=p,o=y;break}D=D.sibling}if(!S){for(D=y.child;D;){if(D===o){S=!0,o=y,l=p;break}if(D===l){S=!0,l=y,o=p;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"),T=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),W=Symbol.for("react.provider"),M=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),pe=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),de=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),be=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function we(t){return typeof t!="object"||!t?null:(t=Y&&t[Y]||t["@@iterator"],typeof t=="function"?t:null)}var Ee=Symbol.for("react.client.reference");function ie(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Ee?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 P:return"Suspense";case I:return"SuspenseList";case fe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case T:return"Portal";case Q:return(t.displayName||"Context")+".Provider";case M:return(t._context.displayName||"Context")+".Consumer";case pe:var r=t.render;return t=t.displayName,t||(t=(t=r.displayName||r.name||"",t===""?"ForwardRef":"ForwardRef("+t+")")),t;case $: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,G=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,Le={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 De(t,r){ut++,Qe[ut]=t.current,t.current=r}var Ne=Be(null),gn=Be(null),It=Be(null),Dn=Be(null);function ln(t,r){switch(De(It,r),De(gn,t),De(Ne,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?zb(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=zb(r),t=Fb(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}We(Ne),De(Ne,t)}function Ue(){We(Ne),We(gn),We(It)}function nn(t){t.memoizedState!==null&&De(Dn,t);var r=Ne.current,o=Fb(r,t.type);r!==o&&(De(gn,t),De(Ne,o))}function gt(t){gn.current===t&&(We(Ne),We(gn)),Dn.current===t&&(We(Dn),kl._currentValue=Le)}var yn=Object.prototype.hasOwnProperty,Yn=n.unstable_scheduleCallback,kt=n.unstable_cancelCallback,ci=n.unstable_shouldYield,vn=n.unstable_requestPaint,bn=n.unstable_now,An=n.unstable_getCurrentPriorityLevel,Nr=n.unstable_ImmediatePriority,In=n.unstable_UserBlockingPriority,rn=n.unstable_NormalPriority,Vi=n.unstable_LowPriority,Ur=n.unstable_IdlePriority,Mr=n.log,ui=n.unstable_setDisableYieldValue,Ht=null,Qt=null;function yt(t){if(typeof Mr=="function"&&ui(t),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(Ht,t)}catch{}}var Ft=Math.clz32?Math.clz32:$i,Ct=Math.log,di=Math.LN2;function $i(t){return t>>>=0,t===0?32:31-(Ct(t)/di|0)|0}var Ar=256,fr=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 p=0,y=t.suspendedLanes,S=t.pingedLanes;t=t.warmLanes;var D=l&134217727;return D===0?(D=l&~y,D===0?S===0?o||(o=l&~t,o!==0&&(p=Ge(o))):p=Ge(S):p=Ge(D)):(l=D&~y,l===0?(S&=D,S===0?o||(o=D&~t,o!==0&&(p=Ge(o))):p=Ge(S)):p=Ge(l)),p===0?0:r!==0&&r!==p&&(r&y)===0&&(y=p&-p,o=r&-r,y>=o||y===32&&o&4194048)?r:p}function lt(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=Ar;return Ar<<=1,!(Ar&4194048)&&(Ar=256),t}function Kr(){var t=fr;return fr<<=1,!(fr&62914560)&&(fr=4194304),t}function St(t){for(var r=[],o=0;31>o;o++)r.push(t);return r}function Zn(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Qr(t,r,o,l,p,y){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 me=31-Ft(o),ve=1<<me;D[me]=0,F[me]=-1;var ae=re[me];if(ae!==null)for(re[me]=null,me=0;me<ae.length;me++){var le=ae[me];le!==null&&(le.lane&=-536870913)}o&=~ve}l!==0&&fi(t,l,0),y!==0&&p===0&&t.tag!==0&&(t.suspendedLanes|=y&~(S&~r))}function fi(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 jn(t,r){var o=t.entangledLanes|=r;for(t=t.entanglements;o;){var l=31-Ft(o),p=1<<l;p&r|t[l]&r&&(t[l]|=r),o&=~p}}function Hn(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 Gr(t){return t&=-t,2<t?8<t?t&134217727?32:268435456:8:2}function pi(){var t=K.p;return t===0?(t=window.event,t===void 0?32:r2(t.type)):t}function er(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,L="__reactContainer$"+Pn,Je="__reactEvents$"+Pn,q="__reactListeners$"+Pn,ne="__reactHandles$"+Pn,ye="__reactResources$"+Pn,Se="__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[L]||o[bt]){if(o=r.alternate,r.child!==null||o!==null&&o.child!==null)for(t=$b(t);t!==null;){if(o=t[bt])return o;t=$b(t)}return r}t=o,o=t.parentNode}return null}function it(t){if(t=t[bt]||t[L]){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[Se]=!0}var ot=new Set,ht={};function $t(t,r){tr(t,r),tr(t+"Capture",r)}function tr(t,r){for(ht[t]=r,t=0;t<r.length;t++)ot.add(r[t])}var Ss=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]*$"),pr={},sc={};function lc(t){return yn.call(sc,t)?!0:yn.call(pr,t)?!1:Ss.test(t)?sc[t]=!0:(pr[t]=!0,!1)}function Oo(t,r,o){if(lc(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 Na(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 mr(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 Es,cc;function wn(t){if(Es===void 0)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);Es=r&&r[1]||"",cc=-1<o.stack.indexOf(`
|
|
3
|
-
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
-
`+Es+t+cc}var Ts=!1;function Rs(t,r){if(!t||Ts)return"";Ts=!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 p=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=l.DetermineComponentFrameRoot(),S=y[0],D=y[1];if(S&&D){var F=S.split(`
|
|
5
|
-
`),re=D.split(`
|
|
6
|
-
`);for(p=l=0;l<F.length&&!F[l].includes("DetermineComponentFrameRoot");)l++;for(;p<re.length&&!re[p].includes("DetermineComponentFrameRoot");)p++;if(l===F.length||p===re.length)for(l=F.length-1,p=re.length-1;1<=l&&0<=p&&F[l]!==re[p];)p--;for(;1<=l&&0<=p;l--,p--)if(F[l]!==re[p]){if(l!==1||p!==1)do if(l--,p--,0>p||F[l]!==re[p]){var me=`
|
|
7
|
-
`+F[l].replace(" at new "," at ");return t.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",t.displayName)),me}while(1<=l&&0<=p);break}}}finally{Ts=!1,Error.prepareStackTrace=o}return(o=t?t.displayName||t.name:"")?wn(o):""}function uc(t){switch(t.tag){case 26:case 27:case 5:return wn(t.type);case 16:return wn("Lazy");case 13:return wn("Suspense");case 19:return wn("SuspenseList");case 0:case 15:return Rs(t.type,!1);case 11:return Rs(t.type.render,!1);case 1:return Rs(t.type,!0);case 31:return wn("Activity");default:return""}}function Ds(t){try{var r="";do r+=uc(t),t=t.return;while(t);return r}catch(o){return`
|
|
8
|
-
Error generating stack: `+o.message+`
|
|
9
|
-
`+o.stack}}function Vn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Os(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function ff(t){var r=Os(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 p=o.get,y=o.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return p.call(this)},set:function(S){l=""+S,y.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 Po(t){t._valueTracker||(t._valueTracker=ff(t))}function dc(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var o=r.getValue(),l="";return t&&(l=Os(t)?t.checked?"true":"false":t.value),t=l,t===o?!1:(r.setValue(t),!0)}function Lo(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 nr=/[\n"\\]/g;function Ve(t){return t.replace(nr,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Ps(t,r,o,l,p,y,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=""+Vn(r)):t.value!==""+Vn(r)&&(t.value=""+Vn(r)),r==null?o==null?l!=null&&t.removeAttribute("value"):Ls(t,S,Vn(o)):Ls(t,S,Vn(r)),p==null&&y!=null&&(t.defaultChecked=!!y),p!=null&&(t.checked=p&&typeof p!="function"&&typeof p!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?t.name=""+Vn(D):t.removeAttribute("name")}function No(t,r,o,l,p,y,S,D){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.type=y),r!=null||o!=null){if(!(y!=="submit"&&y!=="reset"||r!=null))return;o=o==null?"":""+Vn(o),r=r==null?o:""+Vn(r),D||r===t.value||(t.value=r),t.defaultValue=r}l??(l=p),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 Ls(t,r,o){r==="number"&&Lo(t.ownerDocument)===t||t.defaultValue===""+o||(t.defaultValue=""+o)}function hr(t,r,o,l){if(t=t.options,r){r={};for(var p=0;p<o.length;p++)r["$"+o[p]]=!0;for(o=0;o<t.length;o++)p=r.hasOwnProperty("$"+t[o].value),t[o].selected!==p&&(t[o].selected=p),p&&l&&(t[o].defaultSelected=!0)}else{for(o=""+Vn(o),r=null,p=0;p<t.length;p++){if(t[p].value===o){t[p].selected=!0,l&&(t[p].defaultSelected=!0);return}r!==null||t[p].disabled||(r=t[p])}r!==null&&(r.selected=!0)}}function fc(t,r,o){if(r!=null&&(r=""+Vn(r),r!==t.value&&(t.value=r),o==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=o==null?"":""+Vn(o)}function Wi(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=Vn(r),t.defaultValue=o,l=t.textContent,l===o&&l!==""&&l!==null&&(t.value=l)}function Jr(t,r){if(r){var o=t.firstChild;if(o&&o===t.lastChild&&o.nodeType===3){o.nodeValue=r;return}}t.textContent=r}var pc=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 mc(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||pc.has(r)?r==="float"?t.cssFloat=o:t[r]=(""+o).trim():t[r]=o+"px"}function mi(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 p in r)l=r[p],r.hasOwnProperty(p)&&o[p]!==l&&mc(t,p,l)}else for(var y in r)r.hasOwnProperty(y)&&mc(t,y,r[y])}function Ns(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 Ms=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"]]),Ma=/^[\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 Mo(t){return Ma.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var As=null;function Aa(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Gt=null,Ui=null;function Ir(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(Ps(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 p=l[jt]||null;if(!p)throw Error(s(90));Ps(l,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<o.length;r++)l=o[r],l.form===t.form&&dc(l)}break e;case"textarea":fc(t,o.value,o.defaultValue);break e;case"select":r=o.value,r!=null&&hr(t,!!o.multiple,r,!1)}}}var Ao=!1;function hc(t,r,o){if(Ao)return t(r,o);Ao=!0;try{return t(r)}finally{if(Ao=!1,(Gt!==null||Ui!==null)&&(Jc(),Gt&&(r=Gt,t=Ui,Ui=Gt=null,Ir(r),t)))for(r=0;r<t.length;r++)Ir(t[r])}}function Io(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 jr=!(typeof window>"u"||window.document===void 0||window.document.createElement===void 0),Is=!1;if(jr)try{var jo={};Object.defineProperty(jo,"passive",{get:function(){Is=!0}}),window.addEventListener("test",jo,jo),window.removeEventListener("test",jo,jo)}catch{Is=!1}var Xr=null,js=null,qo=null;function qs(){if(qo)return qo;var t,r=js,o=r.length,l,p="value"in Xr?Xr.value:Xr.textContent,y=p.length;for(t=0;t<o&&r[t]===p[t];t++);var S=o-t;for(l=1;l<=S&&r[o-l]===p[y-l];l++);return qo=p.slice(t,1<l?1-l:void 0)}function zo(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 Fo(){return!0}function zs(){return!1}function Cn(t){function r(o,l,p,y,S){for(var D in this._reactName=o,this._targetInst=p,this.type=l,this.nativeEvent=y,this.target=S,this.currentTarget=null,t)t.hasOwnProperty(D)&&(o=t[D],this[D]=o?o(y):y[D]);return this.isDefaultPrevented=(y.defaultPrevented==null?y.returnValue===!1:y.defaultPrevented)?Fo:zs,this.isPropagationStopped=zs,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=Fo)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Fo)},persist:function(){},isPersistent:Fo}),r}var Yr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ki=Cn(Yr),Bo=_({},Yr,{view:0,detail:0}),u=Cn(Bo),h,v,b,x=_({},Bo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_e,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"?(h=t.screenX-b.screenX,v=t.screenY-b.screenY):v=h=0,b=t),h)},movementY:function(t){return"movementY"in t?t.movementY:v}}),k=Cn(x),R=Cn(_({},x,{dataTransfer:0})),O=Cn(_({},Bo,{relatedTarget:0})),N=Cn(_({},Yr,{animationName:0,elapsedTime:0,pseudoElement:0})),z=Cn(_({},Yr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}})),j=Cn(_({},Yr,{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"},Z={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ee(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=Z[t])?!!r[t]:!1}function _e(){return ee}var xe=Cn(_({},Bo,{key:function(t){if(t.key){var r=se[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=zo(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:_e,charCode:function(t){return t.type==="keypress"?zo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?zo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}})),je=Cn(_({},x,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Te=Cn(_({},Bo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_e})),Ie=Cn(_({},Yr,{propertyName:0,elapsedTime:0,pseudoElement:0})),ct=Cn(_({},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=Cn(_({},Yr,{newState:0,oldState:0})),Ot=[9,13,27,32],Pt=jr&&"CompositionEvent"in window,ze=null;jr&&"documentMode"in document&&(ze=document.documentMode);var Ke=jr&&"TextEvent"in window&&!ze,Jt=jr&&(!Pt||ze&&8<ze&&11>=ze),Xt=" ",cn=!1;function Ho(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 gc(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Qi=!1;function Fs(t,r){switch(t){case"compositionend":return gc(r);case"keypress":return r.which===32?(cn=!0,Xt):null;case"textInput":return t=r.data,t===Xt&&cn?null:t;default:return null}}function lT(t,r){if(Qi)return t==="compositionend"||!Pt&&Ho(t,r)?(t=qs(),qo=js=Xr=null,Qi=!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 cT={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 tv(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!cT[t.type]:r==="textarea"}function nv(t,r,o,l){Gt?Ui?Ui.push(l):Ui=[l]:Gt=l,r=nu(r,"onChange"),0<r.length&&(o=new Ki("onChange","change",null,o,l),t.push({event:o,listeners:r}))}var Bs=null,Hs=null;function uT(t){Nb(t,0)}function yc(t){if(dc(wt(t)))return t}function rv(t,r){if(t==="change")return r}var iv=!1;if(jr){var pf;if(jr){var mf="oninput"in document;if(!mf){var ov=document.createElement("div");ov.setAttribute("oninput","return;"),mf=typeof ov.oninput=="function"}pf=mf}else pf=!1;iv=pf&&(!document.documentMode||9<document.documentMode)}function av(){Bs&&(Bs.detachEvent("onpropertychange",sv),Hs=Bs=null)}function sv(t){if(t.propertyName==="value"&&yc(Hs)){var r=[];nv(r,Hs,t,Aa(t)),hc(uT,r)}}function dT(t,r,o){t==="focusin"?(av(),Bs=r,Hs=o,Bs.attachEvent("onpropertychange",sv)):t==="focusout"&&av()}function fT(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return yc(Hs)}function pT(t,r){if(t==="click")return yc(r)}function mT(t,r){if(t==="input"||t==="change")return yc(r)}function hT(t,r){return t===r&&(t!==0||1/t==1/r)||t!==t&&r!==r}var rr=typeof Object.is=="function"?Object.is:hT;function Vs(t,r){if(rr(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 p=o[l];if(!yn.call(r,p)||!rr(t[p],r[p]))return!1}return!0}function lv(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function cv(t,r){var o=lv(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=lv(o)}}function uv(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?uv(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function dv(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=Lo(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=Lo(t.document)}return r}function hf(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 gT=jr&&"documentMode"in document&&11>=document.documentMode,Ia=null,gf=null,$s=null,yf=!1;function fv(t,r,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;yf||Ia==null||Ia!==Lo(l)||(l=Ia,"selectionStart"in l&&hf(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}),$s&&Vs($s,l)||($s=l,l=nu(gf,"onSelect"),0<l.length&&(r=new Ki("onSelect","select",null,r,o),t.push({event:r,listeners:l}),r.target=Ia)))}function Vo(t,r){var o={};return o[t.toLowerCase()]=r.toLowerCase(),o["Webkit"+t]="webkit"+r,o["Moz"+t]="moz"+r,o}var ja={animationend:Vo("Animation","AnimationEnd"),animationiteration:Vo("Animation","AnimationIteration"),animationstart:Vo("Animation","AnimationStart"),transitionrun:Vo("Transition","TransitionRun"),transitionstart:Vo("Transition","TransitionStart"),transitioncancel:Vo("Transition","TransitionCancel"),transitionend:Vo("Transition","TransitionEnd")},vf={},pv={};jr&&(pv=document.createElement("div").style,"AnimationEvent"in window||(delete ja.animationend.animation,delete ja.animationiteration.animation,delete ja.animationstart.animation),"TransitionEvent"in window||delete ja.transitionend.transition);function $o(t){if(vf[t])return vf[t];if(!ja[t])return t;var r=ja[t],o;for(o in r)if(r.hasOwnProperty(o)&&o in pv)return vf[t]=r[o];return t}var mv=$o("animationend"),hv=$o("animationiteration"),gv=$o("animationstart"),yT=$o("transitionrun"),vT=$o("transitionstart"),bT=$o("transitioncancel"),yv=$o("transitionend"),vv=new Map,bf="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(" ");bf.push("scrollEnd");function qr(t,r){vv.set(t,r),$t(r,[t])}var bv=new WeakMap;function gr(t,r){if(typeof t=="object"&&t){var o=bv.get(t);return o===void 0?(r={value:t,source:r,stack:Ds(r)},bv.set(t,r),r):o}return{value:t,source:r,stack:Ds(r)}}var yr=[],qa=0,wf=0;function vc(){for(var t=qa,r=wf=qa=0;r<t;){var o=yr[r];yr[r++]=null;var l=yr[r];yr[r++]=null;var p=yr[r];yr[r++]=null;var y=yr[r];if(yr[r++]=null,l!==null&&p!==null){var S=l.pending;S===null?p.next=p:(p.next=S.next,S.next=p),l.pending=p}y!==0&&wv(o,p,y)}}function bc(t,r,o,l){yr[qa++]=t,yr[qa++]=r,yr[qa++]=o,yr[qa++]=l,wf|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function _f(t,r,o,l){return bc(t,r,o,l),wc(t)}function za(t,r){return bc(t,null,null,r),wc(t)}function wv(t,r,o){t.lanes|=o;var l=t.alternate;l!==null&&(l.lanes|=o);for(var p=!1,y=t.return;y!==null;)y.childLanes|=o,l=y.alternate,l!==null&&(l.childLanes|=o),y.tag===22&&(t=y.stateNode,t===null||t._visibility&1||(p=!0)),t=y,y=y.return;return t.tag===3?(y=t.stateNode,p&&r!==null&&(p=31-Ft(o),t=y.hiddenUpdates,l=t[p],l===null?t[p]=[r]:l.push(r),r.lane=o|536870912),y):null}function wc(t){if(50<hl)throw hl=0,Tp=null,Error(s(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var Fa={};function wT(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 ir(t,r,o,l){return new wT(t,r,o,l)}function xf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function hi(t,r){var o=t.alternate;return o===null?(o=ir(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 _v(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 _c(t,r,o,l,p,y){var S=0;if(l=t,typeof t=="function")xf(t)&&(S=1);else if(typeof t=="string")S=k3(t,o,Ne.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case fe:return t=ir(31,o,r,p),t.elementType=fe,t.lanes=y,t;case A:return Wo(o.children,p,y,r);case H:S=8,p|=24;break;case V:return t=ir(12,o,r,p|2),t.elementType=V,t.lanes=y,t;case P:return t=ir(13,o,r,p),t.elementType=P,t.lanes=y,t;case I:return t=ir(19,o,r,p),t.elementType=I,t.lanes=y,t;default:if(typeof t=="object"&&t)switch(t.$$typeof){case W:case Q:S=10;break e;case M:S=9;break e;case pe: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=ir(S,o,r,p),r.elementType=t,r.type=l,r.lanes=y,r}function Wo(t,r,o,l){return t=ir(7,t,l,r),t.lanes=o,t}function kf(t,r,o){return t=ir(6,t,null,r),t.lanes=o,t}function Cf(t,r,o){return r=ir(4,t.children===null?[]:t.children,t.key,r),r.lanes=o,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var Ba=[],Ha=0,xc=null,kc=0,vr=[],br=0,Uo=null,gi=1,yi="";function Ko(t,r){Ba[Ha++]=kc,Ba[Ha++]=xc,xc=t,kc=r}function xv(t,r,o){vr[br++]=gi,vr[br++]=yi,vr[br++]=Uo,Uo=t;var l=gi;t=yi;var p=32-Ft(l)-1;l&=~(1<<p),o+=1;var y=32-Ft(r)+p;if(30<y){var S=p-p%5;y=(l&(1<<S)-1).toString(32),l>>=S,p-=S,gi=1<<32-Ft(r)+p|o<<p|l,yi=y+t}else gi=1<<y|o<<p|l,yi=t}function Sf(t){t.return!==null&&(Ko(t,1),xv(t,1,0))}function Ef(t){for(;t===xc;)xc=Ba[--Ha],Ba[Ha]=null,kc=Ba[--Ha],Ba[Ha]=null;for(;t===Uo;)Uo=vr[--br],vr[br]=null,yi=vr[--br],vr[br]=null,gi=vr[--br],vr[br]=null}var qn=null,Wt=null,mt=!1,Qo=null,Zr=!1,Tf=Error(s(519));function Go(t){throw Ks(gr(Error(s(418,"")),t)),Tf}function kv(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<yl.length;o++)rt(yl[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),No(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0),Po(r);break;case"select":rt("invalid",r);break;case"textarea":rt("invalid",r),Wi(r,l.value,l.defaultValue,l.children),Po(r)}o=l.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||r.textContent===""+o||l.suppressHydrationWarning===!0||qb(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=ru),r=!0):r=!1,r||Go(t)}function Cv(t){for(qn=t.return;qn;)switch(qn.tag){case 5:case 13:Zr=!1;return;case 27:case 3:Zr=!0;return;default:qn=qn.return}}function Ws(t){if(t!==qn)return!1;if(!mt)return Cv(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")||Hp(t.type,t.memoizedProps)),o=!o),o&&Wt&&Go(t),Cv(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=Fr(t.nextSibling);break e}r--}else o!=="$"&&o!=="$!"&&o!=="$?"||r++;t=t.nextSibling}Wt=null}}else r===27?(r=Wt,lo(t.type)?(t=Up,Up=null,Wt=t):Wt=r):Wt=qn?Fr(t.stateNode.nextSibling):null;return!0}function Us(){Wt=qn=null,mt=!1}function Sv(){var t=Qo;return t!==null&&(Un===null?Un=t:Un.push.apply(Un,t),Qo=null),t}function Ks(t){Qo===null?Qo=[t]:Qo.push(t)}var Rf=Be(null),Jo=null,vi=null;function Gi(t,r,o){De(Rf,r._currentValue),r._currentValue=o}function bi(t){t._currentValue=Rf.current,We(Rf)}function Df(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 Of(t,r,o,l){var p=t.child;for(p!==null&&(p.return=t);p!==null;){var y=p.dependencies;if(y!==null){var S=p.child;y=y.firstContext;e:for(;y!==null;){var D=y;y=p;for(var F=0;F<r.length;F++)if(D.context===r[F]){y.lanes|=o,D=y.alternate,D!==null&&(D.lanes|=o),Df(y.return,o,t),l||(S=null);break e}y=D.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(s(341));S.lanes|=o,y=S.alternate,y!==null&&(y.lanes|=o),Df(S,o,t),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===t){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function Qs(t,r,o,l){t=null;for(var p=r,y=!1;p!==null;){if(!y){if(p.flags&524288)y=!0;else if(p.flags&262144)break}if(p.tag===10){var S=p.alternate;if(S===null)throw Error(s(387));if(S=S.memoizedProps,S!==null){var D=p.type;rr(p.pendingProps.value,S.value)||(t===null?t=[D]:t.push(D))}}else if(p===Dn.current){if(S=p.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(t===null?t=[kl]:t.push(kl))}p=p.return}t!==null&&Of(r,t,o,l),r.flags|=262144}function Cc(t){for(t=t.firstContext;t!==null;){if(!rr(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Xo(t){Jo=t,vi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Ln(t){return Ev(Jo,t)}function Sc(t,r){return Jo===null&&Xo(t),Ev(t,r)}function Ev(t,r){var o=r._currentValue;if(r={context:r,memoizedValue:o,next:null},vi===null){if(t===null)throw Error(s(308));vi=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else vi=vi.next=r;return o}var _T=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()})}},xT=n.unstable_scheduleCallback,kT=n.unstable_NormalPriority,un={$$typeof:Q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pf(){return{controller:new _T,data:new Map,refCount:0}}function Gs(t){t.refCount--,t.refCount===0&&xT(kT,function(){t.controller.abort()})}var Js=null,Lf=0,Va=0,$a=null;function CT(t,r){if(Js===null){var o=Js=[];Lf=0,Va=Mp(),$a={status:"pending",value:void 0,then:function(l){o.push(l)}}}return Lf++,r.then(Tv,Tv),r}function Tv(){if(--Lf===0&&Js!==null){$a!==null&&($a.status="fulfilled");var t=Js;Js=null,Va=0,$a=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function ST(t,r){var o=[],l={status:"pending",value:null,reason:null,then:function(p){o.push(p)}};return t.then(function(){l.status="fulfilled",l.value=r;for(var p=0;p<o.length;p++)(0,o[p])(r)},function(p){for(l.status="rejected",l.reason=p,p=0;p<o.length;p++)(0,o[p])(void 0)}),l}var Rv=G.S;G.S=function(t,r){typeof r=="object"&&r&&typeof r.then=="function"&&CT(t,r),Rv!==null&&Rv(t,r)};var Yo=Be(null);function Nf(){var t=Yo.current;return t===null?Mt.pooledCache:t}function Ec(t,r){r===null?De(Yo,Yo.current):De(Yo,r.pool)}function Dv(){var t=Nf();return t===null?null:{parent:un._currentValue,pool:t}}var Xs=Error(s(460)),Ov=Error(s(474)),Tc=Error(s(542)),Mf={then:function(){}};function Pv(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Rc(){}function Lv(t,r,o){switch(o=t[o],o===void 0?t.push(r):o!==r&&(r.then(Rc,Rc),r=o),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Mv(t),t;default:if(typeof r.status=="string")r.then(Rc,Rc);else{if(t=Mt,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=r,t.status="pending",t.then(function(l){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=l}},function(l){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Mv(t),t}throw Ys=r,Xs}}var Ys=null;function Nv(){if(Ys===null)throw Error(s(459));var t=Ys;return Ys=null,t}function Mv(t){if(t===Xs||t===Tc)throw Error(s(483))}var Ji=!1;function Af(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function If(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 Zo(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ea(t,r,o){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,_t&2){var p=l.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),l.pending=r,r=wc(t),wv(t,null,o),r}return bc(t,l,r,o),wc(t)}function Zs(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,jn(t,o)}}function jf(t,r){var o=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var p=null,y=null;if(o=o.firstBaseUpdate,o!==null){do{var S={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};y===null?p=y=S:y=y.next=S,o=o.next}while(o!==null);y===null?p=y=r:y=y.next=r}else p=y=r;o={baseState:l.baseState,firstBaseUpdate:p,lastBaseUpdate:y,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 qf=!1;function el(){if(qf){var t=$a;if(t!==null)throw t}}function tl(t,r,o,l){qf=!1;var p=t.updateQueue;Ji=!1;var y=p.firstBaseUpdate,S=p.lastBaseUpdate,D=p.shared.pending;if(D!==null){p.shared.pending=null;var F=D,re=F.next;F.next=null,S===null?y=re:S.next=re,S=F;var me=t.alternate;me!==null&&(me=me.updateQueue,D=me.lastBaseUpdate,D!==S&&(D===null?me.firstBaseUpdate=re:D.next=re,me.lastBaseUpdate=F))}if(y!==null){var ve=p.baseState;S=0,me=re=F=null,D=y;do{var ae=D.lane&-536870913,le=ae!==D.lane;if(le?(at&ae)===ae:(l&ae)===ae){ae!==0&&ae===Va&&(qf=!0),me!==null&&(me=me.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var qe=t,Me=D;ae=r;var Rt=o;switch(Me.tag){case 1:if(qe=Me.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=Me.payload,ae=typeof qe=="function"?qe.call(Rt,ve,ae):qe,ae==null)break e;ve=_({},ve,ae);break e;case 2:Ji=!0}}ae=D.callback,ae!==null&&(t.flags|=64,le&&(t.flags|=8192),le=p.callbacks,le===null?p.callbacks=[ae]:le.push(ae))}else le={lane:ae,tag:D.tag,payload:D.payload,callback:D.callback,next:null},me===null?(re=me=le,F=ve):me=me.next=le,S|=ae;if(D=D.next,D===null){if(D=p.shared.pending,D===null)break;le=D,D=le.next,le.next=null,p.lastBaseUpdate=le,p.shared.pending=null}}while(!0);me===null&&(F=ve),p.baseState=F,p.firstBaseUpdate=re,p.lastBaseUpdate=me,y===null&&(p.shared.lanes=0),io|=S,t.lanes=S,t.memoizedState=ve}}function Av(t,r){if(typeof t!="function")throw Error(s(191,t));t.call(r)}function Iv(t,r){var o=t.callbacks;if(o!==null)for(t.callbacks=null,t=0;t<o.length;t++)Av(o[t],r)}var Wa=Be(null),Dc=Be(0);function jv(t,r){t=Ti,De(Dc,t),De(Wa,r),Ti=t|r.baseLanes}function zf(){De(Dc,Ti),De(Wa,Wa.current)}function Ff(){Ti=Dc.current,We(Wa),We(Dc)}var Xi=0,Ye=null,Et=null,on=null,Oc=!1,Ua=!1,ta=!1,Pc=0,nl=0,Ka=null,ET=0;function Yt(){throw Error(s(321))}function Bf(t,r){if(r===null)return!1;for(var o=0;o<r.length&&o<t.length;o++)if(!rr(t[o],r[o]))return!1;return!0}function Hf(t,r,o,l,p,y){return Xi=y,Ye=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,G.H=t===null||t.memoizedState===null?w1:_1,ta=!1,y=o(l,p),ta=!1,Ua&&(y=zv(r,o,l,p)),qv(t),y}function qv(t){G.H=jc;var r=Et!==null&&Et.next!==null;if(Xi=0,on=Et=Ye=null,Oc=!1,nl=0,Ka=null,r)throw Error(s(300));t===null||_n||(t=t.dependencies,t!==null&&Cc(t)&&(_n=!0))}function zv(t,r,o,l){Ye=t;var p=0;do{if(Ua&&(Ka=null),nl=0,Ua=!1,25<=p)throw Error(s(301));if(p+=1,on=Et=null,t.updateQueue!=null){var y=t.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}G.H=NT,y=r(o,l)}while(Ua);return y}function TT(){var t=G.H,r=t.useState()[0];return r=typeof r.then=="function"?rl(r):r,t=t.useState()[0],(Et===null?null:Et.memoizedState)!==t&&(Ye.flags|=1024),r}function Vf(){var t=Pc!==0;return Pc=0,t}function $f(t,r,o){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~o}function Wf(t){if(Oc){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}Oc=!1}Xi=0,on=Et=Ye=null,Ua=!1,nl=Pc=0,Ka=null}function $n(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?Ye.memoizedState=on=t:on=on.next=t,on}function an(){if(Et===null){var t=Ye.alternate;t=t===null?null:t.memoizedState}else t=Et.next;var r=on===null?Ye.memoizedState:on.next;if(r!==null)on=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},on===null?Ye.memoizedState=on=t:on=on.next=t}return on}function Uf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function rl(t){var r=nl;return nl+=1,Ka===null&&(Ka=[]),t=Lv(Ka,t,r),r=Ye,(on===null?r.memoizedState:on.next)===null&&(r=r.alternate,G.H=r===null||r.memoizedState===null?w1:_1),t}function Lc(t){if(typeof t=="object"&&t){if(typeof t.then=="function")return rl(t);if(t.$$typeof===Q)return Ln(t)}throw Error(s(438,String(t)))}function Kf(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(p){return p.slice()}),index:0})))}if(r??(r={data:[],index:0}),o===null&&(o=Uf(),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]=be;return r.index++,o}function wi(t,r){return typeof r=="function"?r(t):r}function Nc(t){return Qf(an(),Et,t)}function Qf(t,r,o){var l=t.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=o;var p=t.baseQueue,y=l.pending;if(y!==null){if(p!==null){var S=p.next;p.next=y.next,y.next=S}r.baseQueue=p=y,l.pending=null}if(y=t.baseState,p===null)t.memoizedState=y;else{r=p.next;var D=S=null,F=null,re=r,me=!1;do{var ve=re.lane&-536870913;if(ve===re.lane?(Xi&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===Va&&(me=!0);else if((Xi&ae)===ae){re=re.next,ae===Va&&(me=!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=y):F=F.next=ve,Ye.lanes|=ae,io|=ae;ve=re.action,ta&&o(y,ve),y=re.hasEagerState?re.eagerState:o(y,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=y):F=F.next=ae,Ye.lanes|=ve,io|=ve;re=re.next}while(re!==null&&re!==r);if(F===null?S=y:F.next=D,!rr(y,t.memoizedState)&&(_n=!0,me&&(o=$a,o!==null)))throw o;t.memoizedState=y,t.baseState=S,t.baseQueue=F,l.lastRenderedState=y}return p===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function Gf(t){var r=an(),o=r.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=t;var l=o.dispatch,p=o.pending,y=r.memoizedState;if(p!==null){o.pending=null;var S=p=p.next;do y=t(y,S.action),S=S.next;while(S!==p);rr(y,r.memoizedState)||(_n=!0),r.memoizedState=y,r.baseQueue===null&&(r.baseState=y),o.lastRenderedState=y}return[y,l]}function Fv(t,r,o){var l=Ye,p=an(),y=mt;if(y){if(o===void 0)throw Error(s(407));o=o()}else o=r();var S=!rr((Et||p).memoizedState,o);if(S&&(p.memoizedState=o,_n=!0),p=p.queue,il(2048,8,Vv.bind(null,l,p,t),[t]),p.getSnapshot!==r||S||on!==null&&on.memoizedState.tag&1){if(l.flags|=2048,Qa(9,Mc(),Hv.bind(null,l,p,o,r),null),Mt===null)throw Error(s(349));y||Xi&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=Uf(),Ye.updateQueue=r,r.stores=[t]):(o=r.stores,o===null?r.stores=[t]:o.push(t))}function Hv(t,r,o,l){r.value=o,r.getSnapshot=l,$v(r)&&Wv(t)}function Vv(t,r,o){return o(function(){$v(r)&&Wv(t)})}function $v(t){var r=t.getSnapshot;t=t.value;try{var o=r();return!rr(t,o)}catch{return!0}}function Wv(t){var r=za(t,2);r!==null&&lr(r,t,2)}function Jf(t){var r=$n();if(typeof t=="function"){var o=t;if(t=o(),ta){yt(!0);try{o()}finally{yt(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wi,lastRenderedState:t},r}function Uv(t,r,o,l){return t.baseState=o,Qf(t,Et,typeof l=="function"?l:wi)}function RT(t,r,o,l,p){if(Ic(t))throw Error(s(485));if(t=r.action,t!==null){var y={payload:p,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){y.listeners.push(S)}};G.T===null?y.isTransition=!1:o(!0),l(y),o=r.pending,o===null?(y.next=r.pending=y,Kv(r,y)):(y.next=o.next,r.pending=o.next=y)}}function Kv(t,r){var o=r.action,l=r.payload,p=t.state;if(r.isTransition){var y=G.T,S={};G.T=S;try{var D=o(p,l),F=G.S;F!==null&&F(S,D),Qv(t,r,D)}catch(re){Xf(t,r,re)}finally{G.T=y}}else try{y=o(p,l),Qv(t,r,y)}catch(re){Xf(t,r,re)}}function Qv(t,r,o){typeof o=="object"&&o&&typeof o.then=="function"?o.then(function(l){Gv(t,r,l)},function(l){return Xf(t,r,l)}):Gv(t,r,o)}function Gv(t,r,o){r.status="fulfilled",r.value=o,Jv(r),t.state=o,r=t.pending,r!==null&&(o=r.next,o===r?t.pending=null:(o=o.next,r.next=o,Kv(t,o)))}function Xf(t,r,o){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=o,Jv(r),r=r.next;while(r!==l)}t.action=null}function Jv(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function Xv(t,r){return r}function Yv(t,r){if(mt){var o=Mt.formState;if(o!==null){e:{var l=Ye;if(mt){if(Wt){t:{for(var p=Wt,y=Zr;p.nodeType!==8;){if(!y){p=null;break t}if(p=Fr(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){Wt=Fr(p.nextSibling),l=p.data==="F!";break e}}Go(l)}l=!1}l&&(r=o[0])}}return o=$n(),o.memoizedState=o.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xv,lastRenderedState:r},o.queue=l,o=y1.bind(null,Ye,l),l.dispatch=o,l=Jf(!1),y=np.bind(null,Ye,!1,l.queue),l=$n(),p={state:r,dispatch:null,action:t,pending:null},l.queue=p,o=RT.bind(null,Ye,p,y,o),p.dispatch=o,l.memoizedState=t,[r,o,!1]}function Zv(t){return e1(an(),Et,t)}function e1(t,r,o){if(r=Qf(t,r,Xv)[0],t=Nc(wi)[0],typeof r=="object"&&r&&typeof r.then=="function")try{var l=rl(r)}catch(S){throw S===Xs?Tc:S}else l=r;r=an();var p=r.queue,y=p.dispatch;return o!==r.memoizedState&&(Ye.flags|=2048,Qa(9,Mc(),DT.bind(null,p,o),null)),[l,y,t]}function DT(t,r){t.action=r}function t1(t){var r=an(),o=Et;if(o!==null)return e1(r,o,t);an(),r=r.memoizedState,o=an();var l=o.queue.dispatch;return o.memoizedState=t,[r,l,!1]}function Qa(t,r,o,l){return t={tag:t,create:o,deps:l,inst:r,next:null},r=Ye.updateQueue,r===null&&(r=Uf(),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 Mc(){return{destroy:void 0,resource:void 0}}function n1(){return an().memoizedState}function Ac(t,r,o,l){var p=$n();l=l===void 0?null:l,Ye.flags|=t,p.memoizedState=Qa(1|r,Mc(),o,l)}function il(t,r,o,l){var p=an();l=l===void 0?null:l;var y=p.memoizedState.inst;Et!==null&&l!==null&&Bf(l,Et.memoizedState.deps)?p.memoizedState=Qa(r,y,o,l):(Ye.flags|=t,p.memoizedState=Qa(1|r,y,o,l))}function r1(t,r){Ac(8390656,8,t,r)}function i1(t,r){il(2048,8,t,r)}function o1(t,r){return il(4,2,t,r)}function a1(t,r){return il(4,4,t,r)}function s1(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 l1(t,r,o){o=o==null?null:o.concat([t]),il(4,4,s1.bind(null,r,t),o)}function Yf(){}function c1(t,r){var o=an();r=r===void 0?null:r;var l=o.memoizedState;return r!==null&&Bf(r,l[1])?l[0]:(o.memoizedState=[t,r],t)}function u1(t,r){var o=an();r=r===void 0?null:r;var l=o.memoizedState;if(r!==null&&Bf(r,l[1]))return l[0];if(l=t(),ta){yt(!0);try{t()}finally{yt(!1)}}return o.memoizedState=[l,r],l}function Zf(t,r,o){return o===void 0||Xi&1073741824?t.memoizedState=r:(t.memoizedState=o,t=ub(),Ye.lanes|=t,io|=t,o)}function d1(t,r,o,l){return rr(o,r)?o:Wa.current===null?Xi&42?(t=ub(),Ye.lanes|=t,io|=t,r):(_n=!0,t.memoizedState=o):(t=Zf(t,o,l),rr(t,r)||(_n=!0),t)}function f1(t,r,o,l,p){var y=K.p;K.p=y!==0&&8>y?y:8;var S=G.T,D={};G.T=D,np(t,!1,r,o);try{var F=p(),re=G.S;re!==null&&re(D,F),typeof F=="object"&&F&&typeof F.then=="function"?ol(t,r,ST(F,l),xr(t)):ol(t,r,l,xr(t))}catch(me){ol(t,r,{then:function(){},status:"rejected",reason:me},xr())}finally{K.p=y,G.T=S}}function OT(){}function ep(t,r,o,l){if(t.tag!==5)throw Error(s(476));var p=p1(t).queue;f1(t,p,r,Le,o===null?OT:function(){return m1(t),o(l)})}function p1(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Le,baseState:Le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wi,lastRenderedState:Le},next:null};var o={};return r.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wi,lastRenderedState:o},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function m1(t){var r=p1(t).next.queue;ol(t,r,{},xr())}function tp(){return Ln(kl)}function h1(){return an().memoizedState}function g1(){return an().memoizedState}function PT(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var o=xr();t=Zo(o);var l=ea(r,t,o);l!==null&&(lr(l,r,o),Zs(l,r,o)),r={cache:Pf()},t.payload=r;return}r=r.return}}function LT(t,r,o){var l=xr();o={lane:l,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},Ic(t)?v1(r,o):(o=_f(t,r,o,l),o!==null&&(lr(o,t,l),b1(o,r,l)))}function y1(t,r,o){ol(t,r,o,xr())}function ol(t,r,o,l){var p={lane:l,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(Ic(t))v1(r,p);else{var y=t.alternate;if(t.lanes===0&&(y===null||y.lanes===0)&&(y=r.lastRenderedReducer,y!==null))try{var S=r.lastRenderedState,D=y(S,o);if(p.hasEagerState=!0,p.eagerState=D,rr(D,S))return bc(t,r,p,0),Mt===null&&vc(),!1}catch{}if(o=_f(t,r,p,l),o!==null)return lr(o,t,l),b1(o,r,l),!0}return!1}function np(t,r,o,l){if(l={lane:2,revertLane:Mp(),action:l,hasEagerState:!1,eagerState:null,next:null},Ic(t)){if(r)throw Error(s(479))}else r=_f(t,o,l,2),r!==null&&lr(r,t,2)}function Ic(t){var r=t.alternate;return t===Ye||r!==null&&r===Ye}function v1(t,r){Ua=Oc=!0;var o=t.pending;o===null?r.next=r:(r.next=o.next,o.next=r),t.pending=r}function b1(t,r,o){if(o&4194048){var l=r.lanes;l&=t.pendingLanes,o|=l,r.lanes=o,jn(t,o)}}var jc={readContext:Ln,use:Lc,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},w1={readContext:Ln,use:Lc,useCallback:function(t,r){return $n().memoizedState=[t,r===void 0?null:r],t},useContext:Ln,useEffect:r1,useImperativeHandle:function(t,r,o){o=o==null?null:o.concat([t]),Ac(4194308,4,s1.bind(null,r,t),o)},useLayoutEffect:function(t,r){return Ac(4194308,4,t,r)},useInsertionEffect:function(t,r){Ac(4,2,t,r)},useMemo:function(t,r){var o=$n();r=r===void 0?null:r;var l=t();if(ta){yt(!0);try{t()}finally{yt(!1)}}return o.memoizedState=[l,r],l},useReducer:function(t,r,o){var l=$n();if(o!==void 0){var p=o(r);if(ta){yt(!0);try{o(r)}finally{yt(!1)}}}else p=r;return l.memoizedState=l.baseState=p,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:p},l.queue=t,t=t.dispatch=LT.bind(null,Ye,t),[l.memoizedState,t]},useRef:function(t){var r=$n();return t={current:t},r.memoizedState=t},useState:function(t){t=Jf(t);var r=t.queue,o=y1.bind(null,Ye,r);return r.dispatch=o,[t.memoizedState,o]},useDebugValue:Yf,useDeferredValue:function(t,r){return Zf($n(),t,r)},useTransition:function(){var t=Jf(!1);return t=f1.bind(null,Ye,t.queue,!0,!1),$n().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,o){var l=Ye,p=$n();if(mt){if(o===void 0)throw Error(s(407));o=o()}else{if(o=r(),Mt===null)throw Error(s(349));at&124||Bv(l,r,o)}p.memoizedState=o;var y={value:o,getSnapshot:r};return p.queue=y,r1(Vv.bind(null,l,y,t),[t]),l.flags|=2048,Qa(9,Mc(),Hv.bind(null,l,y,o,r),null),o},useId:function(){var t=$n(),r=Mt.identifierPrefix;if(mt){var o=yi,l=gi;o=(l&~(1<<32-Ft(l)-1)).toString(32)+o,r="\xAB"+r+"R"+o,o=Pc++,0<o&&(r+="H"+o.toString(32)),r+="\xBB"}else o=ET++,r="\xAB"+r+"r"+o.toString(32)+"\xBB";return t.memoizedState=r},useHostTransitionStatus:tp,useFormState:Yv,useActionState:Yv,useOptimistic:function(t){var r=$n();r.memoizedState=r.baseState=t;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=o,r=np.bind(null,Ye,!0,o),o.dispatch=r,[t,r]},useMemoCache:Kf,useCacheRefresh:function(){return $n().memoizedState=PT.bind(null,Ye)}},_1={readContext:Ln,use:Lc,useCallback:c1,useContext:Ln,useEffect:i1,useImperativeHandle:l1,useInsertionEffect:o1,useLayoutEffect:a1,useMemo:u1,useReducer:Nc,useRef:n1,useState:function(){return Nc(wi)},useDebugValue:Yf,useDeferredValue:function(t,r){return d1(an(),Et.memoizedState,t,r)},useTransition:function(){var t=Nc(wi)[0],r=an().memoizedState;return[typeof t=="boolean"?t:rl(t),r]},useSyncExternalStore:Fv,useId:h1,useHostTransitionStatus:tp,useFormState:Zv,useActionState:Zv,useOptimistic:function(t,r){return Uv(an(),Et,t,r)},useMemoCache:Kf,useCacheRefresh:g1},NT={readContext:Ln,use:Lc,useCallback:c1,useContext:Ln,useEffect:i1,useImperativeHandle:l1,useInsertionEffect:o1,useLayoutEffect:a1,useMemo:u1,useReducer:Gf,useRef:n1,useState:function(){return Gf(wi)},useDebugValue:Yf,useDeferredValue:function(t,r){var o=an();return Et===null?Zf(o,t,r):d1(o,Et.memoizedState,t,r)},useTransition:function(){var t=Gf(wi)[0],r=an().memoizedState;return[typeof t=="boolean"?t:rl(t),r]},useSyncExternalStore:Fv,useId:h1,useHostTransitionStatus:tp,useFormState:t1,useActionState:t1,useOptimistic:function(t,r){var o=an();return Et===null?(o.baseState=t,[t,o.queue.dispatch]):Uv(o,Et,t,r)},useMemoCache:Kf,useCacheRefresh:g1},Ga=null,al=0;function qc(t){var r=al;return al+=1,Ga===null&&(Ga=[]),Lv(Ga,t,r)}function sl(t,r){r=r.props.ref,t.ref=r===void 0?null:r}function zc(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 x1(t){var r=t._init;return r(t._payload)}function k1(t){function r(J,U){if(t){var te=J.deletions;te===null?(J.deletions=[U],J.flags|=16):te.push(U)}}function o(J,U){if(!t)return null;for(;U!==null;)r(J,U),U=U.sibling;return null}function l(J){for(var U=new Map;J!==null;)J.key===null?U.set(J.index,J):U.set(J.key,J),J=J.sibling;return U}function p(J,U){return J=hi(J,U),J.index=0,J.sibling=null,J}function y(J,U,te){return J.index=te,t?(te=J.alternate,te===null?(J.flags|=67108866,U):(te=te.index,te<U?(J.flags|=67108866,U):te)):(J.flags|=1048576,U)}function S(J){return t&&J.alternate===null&&(J.flags|=67108866),J}function D(J,U,te,he){return U===null||U.tag!==6?(U=kf(te,J.mode,he),U.return=J,U):(U=p(U,te),U.return=J,U)}function F(J,U,te,he){var Re=te.type;return Re===A?me(J,U,te.props.children,he,te.key):U!==null&&(U.elementType===Re||typeof Re=="object"&&Re&&Re.$$typeof===de&&x1(Re)===U.type)?(U=p(U,te.props),sl(U,te),U.return=J,U):(U=_c(te.type,te.key,te.props,null,J.mode,he),sl(U,te),U.return=J,U)}function re(J,U,te,he){return U===null||U.tag!==4||U.stateNode.containerInfo!==te.containerInfo||U.stateNode.implementation!==te.implementation?(U=Cf(te,J.mode,he),U.return=J,U):(U=p(U,te.children||[]),U.return=J,U)}function me(J,U,te,he,Re){return U===null||U.tag!==7?(U=Wo(te,J.mode,he,Re),U.return=J,U):(U=p(U,te),U.return=J,U)}function ve(J,U,te){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=kf(""+U,J.mode,te),U.return=J,U;if(typeof U=="object"&&U){switch(U.$$typeof){case E:return te=_c(U.type,U.key,U.props,null,J.mode,te),sl(te,U),te.return=J,te;case T:return U=Cf(U,J.mode,te),U.return=J,U;case de:var he=U._init;return U=he(U._payload),ve(J,U,te)}if(X(U)||we(U))return U=Wo(U,J.mode,te,null),U.return=J,U;if(typeof U.then=="function")return ve(J,qc(U),te);if(U.$$typeof===Q)return ve(J,Sc(J,U),te);zc(J,U)}return null}function ae(J,U,te,he){var Re=U===null?null:U.key;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Re===null?D(J,U,""+te,he):null;if(typeof te=="object"&&te){switch(te.$$typeof){case E:return te.key===Re?F(J,U,te,he):null;case T:return te.key===Re?re(J,U,te,he):null;case de:return Re=te._init,te=Re(te._payload),ae(J,U,te,he)}if(X(te)||we(te))return Re===null?me(J,U,te,he,null):null;if(typeof te.then=="function")return ae(J,U,qc(te),he);if(te.$$typeof===Q)return ae(J,U,Sc(J,te),he);zc(J,te)}return null}function le(J,U,te,he,Re){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return J=J.get(te)||null,D(U,J,""+he,Re);if(typeof he=="object"&&he){switch(he.$$typeof){case E:return J=J.get(he.key===null?te:he.key)||null,F(U,J,he,Re);case T:return J=J.get(he.key===null?te:he.key)||null,re(U,J,he,Re);case de:var et=he._init;return he=et(he._payload),le(J,U,te,he,Re)}if(X(he)||we(he))return J=J.get(te)||null,me(U,J,he,Re,null);if(typeof he.then=="function")return le(J,U,te,qc(he),Re);if(he.$$typeof===Q)return le(J,U,te,Sc(U,he),Re);zc(U,he)}return null}function qe(J,U,te,he){for(var Re=null,et=null,Oe=U,Ae=U=0,kn=null;Oe!==null&&Ae<te.length;Ae++){Oe.index>Ae?(kn=Oe,Oe=null):kn=Oe.sibling;var dt=ae(J,Oe,te[Ae],he);if(dt===null){Oe===null&&(Oe=kn);break}t&&Oe&&dt.alternate===null&&r(J,Oe),U=y(dt,U,Ae),et===null?Re=dt:et.sibling=dt,et=dt,Oe=kn}if(Ae===te.length)return o(J,Oe),mt&&Ko(J,Ae),Re;if(Oe===null){for(;Ae<te.length;Ae++)Oe=ve(J,te[Ae],he),Oe!==null&&(U=y(Oe,U,Ae),et===null?Re=Oe:et.sibling=Oe,et=Oe);return mt&&Ko(J,Ae),Re}for(Oe=l(Oe);Ae<te.length;Ae++)kn=le(Oe,J,Ae,te[Ae],he),kn!==null&&(t&&kn.alternate!==null&&Oe.delete(kn.key===null?Ae:kn.key),U=y(kn,U,Ae),et===null?Re=kn:et.sibling=kn,et=kn);return t&&Oe.forEach(function(mo){return r(J,mo)}),mt&&Ko(J,Ae),Re}function Me(J,U,te,he){if(te==null)throw Error(s(151));for(var Re=null,et=null,Oe=U,Ae=U=0,kn=null,dt=te.next();Oe!==null&&!dt.done;Ae++,dt=te.next()){Oe.index>Ae?(kn=Oe,Oe=null):kn=Oe.sibling;var mo=ae(J,Oe,dt.value,he);if(mo===null){Oe===null&&(Oe=kn);break}t&&Oe&&mo.alternate===null&&r(J,Oe),U=y(mo,U,Ae),et===null?Re=mo:et.sibling=mo,et=mo,Oe=kn}if(dt.done)return o(J,Oe),mt&&Ko(J,Ae),Re;if(Oe===null){for(;!dt.done;Ae++,dt=te.next())dt=ve(J,dt.value,he),dt!==null&&(U=y(dt,U,Ae),et===null?Re=dt:et.sibling=dt,et=dt);return mt&&Ko(J,Ae),Re}for(Oe=l(Oe);!dt.done;Ae++,dt=te.next())dt=le(Oe,J,Ae,dt.value,he),dt!==null&&(t&&dt.alternate!==null&&Oe.delete(dt.key===null?Ae:dt.key),U=y(dt,U,Ae),et===null?Re=dt:et.sibling=dt,et=dt);return t&&Oe.forEach(function(j3){return r(J,j3)}),mt&&Ko(J,Ae),Re}function Rt(J,U,te,he){if(typeof te=="object"&&te&&te.type===A&&te.key===null&&(te=te.props.children),typeof te=="object"&&te){switch(te.$$typeof){case E:e:{for(var Re=te.key;U!==null;){if(U.key===Re){if(Re=te.type,Re===A){if(U.tag===7){o(J,U.sibling),he=p(U,te.props.children),he.return=J,J=he;break e}}else if(U.elementType===Re||typeof Re=="object"&&Re&&Re.$$typeof===de&&x1(Re)===U.type){o(J,U.sibling),he=p(U,te.props),sl(he,te),he.return=J,J=he;break e}o(J,U);break}else r(J,U);U=U.sibling}te.type===A?(he=Wo(te.props.children,J.mode,he,te.key),he.return=J,J=he):(he=_c(te.type,te.key,te.props,null,J.mode,he),sl(he,te),he.return=J,J=he)}return S(J);case T:e:{for(Re=te.key;U!==null;){if(U.key===Re)if(U.tag===4&&U.stateNode.containerInfo===te.containerInfo&&U.stateNode.implementation===te.implementation){o(J,U.sibling),he=p(U,te.children||[]),he.return=J,J=he;break e}else{o(J,U);break}else r(J,U);U=U.sibling}he=Cf(te,J.mode,he),he.return=J,J=he}return S(J);case de:return Re=te._init,te=Re(te._payload),Rt(J,U,te,he)}if(X(te))return qe(J,U,te,he);if(we(te)){if(Re=we(te),typeof Re!="function")throw Error(s(150));return te=Re.call(te),Me(J,U,te,he)}if(typeof te.then=="function")return Rt(J,U,qc(te),he);if(te.$$typeof===Q)return Rt(J,U,Sc(J,te),he);zc(J,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,U!==null&&U.tag===6?(o(J,U.sibling),he=p(U,te),he.return=J,J=he):(o(J,U),he=kf(te,J.mode,he),he.return=J,J=he),S(J)):o(J,U)}return function(J,U,te,he){try{al=0;var Re=Rt(J,U,te,he);return Ga=null,Re}catch(Oe){if(Oe===Xs||Oe===Tc)throw Oe;var et=ir(29,Oe,null,J.mode);return et.lanes=he,et.return=J,et}}}var Ja=k1(!0),C1=k1(!1),wr=Be(null),_i=null;function Yi(t){var r=t.alternate;De(dn,dn.current&1),De(wr,t),_i===null&&(r===null||Wa.current!==null||r.memoizedState!==null)&&(_i=t)}function S1(t){if(t.tag===22){if(De(dn,dn.current),De(wr,t),_i===null){var r=t.alternate;r!==null&&r.memoizedState!==null&&(_i=t)}}else Zi(t)}function Zi(){De(dn,dn.current),De(wr,wr.current)}function xi(t){We(wr),_i===t&&(_i=null),We(dn)}var dn=Be(0);function Fc(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==="$?"||Wp(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 rp(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 ip={enqueueSetState:function(t,r,o){t=t._reactInternals;var l=xr(),p=Zo(l);p.payload=r,o!=null&&(p.callback=o),r=ea(t,p,l),r!==null&&(lr(r,t,l),Zs(r,t,l))},enqueueReplaceState:function(t,r,o){t=t._reactInternals;var l=xr(),p=Zo(l);p.tag=1,p.payload=r,o!=null&&(p.callback=o),r=ea(t,p,l),r!==null&&(lr(r,t,l),Zs(r,t,l))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var o=xr(),l=Zo(o);l.tag=2,r!=null&&(l.callback=r),r=ea(t,l,o),r!==null&&(lr(r,t,o),Zs(r,t,o))}};function E1(t,r,o,l,p,y,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,y,S):r.prototype&&r.prototype.isPureReactComponent?!Vs(o,l)||!Vs(p,y):!0}function T1(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&&ip.enqueueReplaceState(r,r.state,null)}function na(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 p in o===r&&(o=_({},o)),t)o[p]===void 0&&(o[p]=t[p]);return o}var Bc=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 MT(t){Bc(t)}function AT(t){console.error(t)}function IT(t){Bc(t)}function Hc(t,r){try{var o=t.onUncaughtError;o(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function R1(t,r,o){try{var l=t.onCaughtError;l(o.value,{componentStack:o.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function op(t,r,o){return o=Zo(o),o.tag=3,o.payload={element:null},o.callback=function(){Hc(t,r)},o}function D1(t){return t=Zo(t),t.tag=3,t}function O1(t,r,o,l){var p=o.type.getDerivedStateFromError;if(typeof p=="function"){var y=l.value;t.payload=function(){return p(y)},t.callback=function(){R1(r,o,l)}}var S=o.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){R1(r,o,l),typeof p!="function"&&(oo===null?oo=new Set([this]):oo.add(this));var D=l.stack;this.componentDidCatch(l.value,{componentStack:D===null?"":D})})}function jT(t,r,o,l,p){if(o.flags|=32768,typeof l=="object"&&l&&typeof l.then=="function"){if(r=o.alternate,r!==null&&Qs(r,o,p,!0),o=wr.current,o!==null){switch(o.tag){case 13:return _i===null?Dp():o.alternate===null&&Ut===0&&(Ut=3),o.flags&=-257,o.flags|=65536,o.lanes=p,l===Mf?o.flags|=16384:(r=o.updateQueue,r===null?o.updateQueue=new Set([l]):r.add(l),Pp(t,l,p)),!1;case 22:return o.flags|=65536,l===Mf?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)),Pp(t,l,p)),!1}throw Error(s(435,o.tag))}return Pp(t,l,p),Dp(),!1}if(mt)return r=wr.current,r===null?(l!==Tf&&(r=Error(s(423),{cause:l}),Ks(gr(r,o))),t=t.current.alternate,t.flags|=65536,p&=-p,t.lanes|=p,l=gr(l,o),p=op(t.stateNode,l,p),jf(t,p),Ut!==4&&(Ut=2)):(!(r.flags&65536)&&(r.flags|=256),r.flags|=65536,r.lanes=p,l!==Tf&&(t=Error(s(422),{cause:l}),Ks(gr(t,o)))),!1;var y=Error(s(520),{cause:l});if(y=gr(y,o),ml===null?ml=[y]:ml.push(y),Ut!==4&&(Ut=2),r===null)return!0;l=gr(l,o),o=r;do{switch(o.tag){case 3:return o.flags|=65536,t=p&-p,o.lanes|=t,t=op(o.stateNode,l,t),jf(o,t),!1;case 1:if(r=o.type,y=o.stateNode,!(o.flags&128)&&(typeof r.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(oo===null||!oo.has(y))))return o.flags|=65536,p&=-p,o.lanes|=p,p=D1(p),O1(p,t,o,l),jf(o,p),!1}o=o.return}while(o!==null);return!1}var P1=Error(s(461)),_n=!1;function Sn(t,r,o,l){r.child=t===null?C1(r,null,o,l):Ja(r,t.child,o,l)}function L1(t,r,o,l,p){o=o.render;var y=r.ref;if("ref"in l){var S={};for(var D in l)D!=="ref"&&(S[D]=l[D])}else S=l;return Xo(r),l=Hf(t,r,o,S,y,p),D=Vf(),t!==null&&!_n?($f(t,r,p),ki(t,r,p)):(mt&&D&&Sf(r),r.flags|=1,Sn(t,r,l,p),r.child)}function N1(t,r,o,l,p){if(t===null){var y=o.type;return typeof y=="function"&&!xf(y)&&y.defaultProps===void 0&&o.compare===null?(r.tag=15,r.type=y,M1(t,r,y,l,p)):(t=_c(o.type,null,l,r,r.mode,p),t.ref=r.ref,t.return=r,r.child=t)}if(y=t.child,!pp(t,p)){var S=y.memoizedProps;if(o=o.compare,o=o===null?Vs:o,o(S,l)&&t.ref===r.ref)return ki(t,r,p)}return r.flags|=1,t=hi(y,l),t.ref=r.ref,t.return=r,r.child=t}function M1(t,r,o,l,p){if(t!==null){var y=t.memoizedProps;if(Vs(y,l)&&t.ref===r.ref)if(_n=!1,r.pendingProps=l=y,pp(t,p))t.flags&131072&&(_n=!0);else return r.lanes=t.lanes,ki(t,r,p)}return ap(t,r,o,l,p)}function A1(t,r,o){var l=r.pendingProps,p=l.children,y=t===null?null:t.memoizedState;if(l.mode==="hidden"){if(r.flags&128){if(l=y===null?o:y.baseLanes|o,t!==null){for(p=r.child=t.child,y=0;p!==null;)y=y|p.lanes|p.childLanes,p=p.sibling;r.childLanes=y&~l}else r.childLanes=0,r.child=null;return I1(t,r,l,o)}if(o&536870912)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Ec(r,y===null?null:y.cachePool),y===null?zf():jv(r,y),S1(r);else return r.lanes=r.childLanes=536870912,I1(t,r,y===null?o:y.baseLanes|o,o)}else y===null?(t!==null&&Ec(r,null),zf(),Zi(r)):(Ec(r,y.cachePool),jv(r,y),Zi(r),r.memoizedState=null);return Sn(t,r,p,o),r.child}function I1(t,r,o,l){var p=Nf();return p=p===null?null:{parent:un._currentValue,pool:p},r.memoizedState={baseLanes:o,cachePool:p},t!==null&&Ec(r,null),zf(),S1(r),t!==null&&Qs(t,r,l,!0),null}function Vc(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 ap(t,r,o,l,p){return Xo(r),o=Hf(t,r,o,l,void 0,p),l=Vf(),t!==null&&!_n?($f(t,r,p),ki(t,r,p)):(mt&&l&&Sf(r),r.flags|=1,Sn(t,r,o,p),r.child)}function j1(t,r,o,l,p,y){return Xo(r),r.updateQueue=null,o=zv(r,l,o,p),qv(t),l=Vf(),t!==null&&!_n?($f(t,r,y),ki(t,r,y)):(mt&&l&&Sf(r),r.flags|=1,Sn(t,r,o,y),r.child)}function q1(t,r,o,l,p){if(Xo(r),r.stateNode===null){var y=Fa,S=o.contextType;typeof S=="object"&&S&&(y=Ln(S)),y=new o(l,y),r.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=ip,r.stateNode=y,y._reactInternals=r,y=r.stateNode,y.props=l,y.state=r.memoizedState,y.refs={},Af(r),S=o.contextType,y.context=typeof S=="object"&&S?Ln(S):Fa,y.state=r.memoizedState,S=o.getDerivedStateFromProps,typeof S=="function"&&(rp(r,o,S,l),y.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(S=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),S!==y.state&&ip.enqueueReplaceState(y,y.state,null),tl(r,l,y,p),el(),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(t===null){y=r.stateNode;var D=r.memoizedProps,F=na(o,D);y.props=F;var re=y.context,me=o.contextType;S=Fa,typeof me=="object"&&me&&(S=Ln(me));var ve=o.getDerivedStateFromProps;me=typeof ve=="function"||typeof y.getSnapshotBeforeUpdate=="function",D=r.pendingProps!==D,me||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(D||re!==S)&&T1(r,y,l,S),Ji=!1;var ae=r.memoizedState;y.state=ae,tl(r,l,y,p),el(),re=r.memoizedState,D||ae!==re||Ji?(typeof ve=="function"&&(rp(r,o,ve,l),re=r.memoizedState),(F=Ji||E1(r,o,F,l,ae,re,S))?(me||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(r.flags|=4194308)):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=re),y.props=l,y.state=re,y.context=S,l=F):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{y=r.stateNode,If(t,r),S=r.memoizedProps,me=na(o,S),y.props=me,ve=r.pendingProps,ae=y.context,re=o.contextType,F=Fa,typeof re=="object"&&re&&(F=Ln(re)),D=o.getDerivedStateFromProps,(re=typeof D=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(S!==ve||ae!==F)&&T1(r,y,l,F),Ji=!1,ae=r.memoizedState,y.state=ae,tl(r,l,y,p),el();var le=r.memoizedState;S!==ve||ae!==le||Ji||t!==null&&t.dependencies!==null&&Cc(t.dependencies)?(typeof D=="function"&&(rp(r,o,D,l),le=r.memoizedState),(me=Ji||E1(r,o,me,l,ae,le,F)||t!==null&&t.dependencies!==null&&Cc(t.dependencies))?(re||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(l,le,F),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(l,le,F)),typeof y.componentDidUpdate=="function"&&(r.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof y.componentDidUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=le),y.props=l,y.state=le,y.context=F,l=me):(typeof y.componentDidUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ae===t.memoizedState||(r.flags|=1024),l=!1)}return y=l,Vc(t,r),l=(r.flags&128)!=0,y||l?(y=r.stateNode,o=l&&typeof o.getDerivedStateFromError!="function"?null:y.render(),r.flags|=1,t!==null&&l?(r.child=Ja(r,t.child,null,p),r.child=Ja(r,null,o,p)):Sn(t,r,o,p),r.memoizedState=y.state,t=r.child):t=ki(t,r,p),t}function z1(t,r,o,l){return Us(),r.flags|=256,Sn(t,r,o,l),r.child}var sp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lp(t){return{baseLanes:t,cachePool:Dv()}}function cp(t,r,o){return t=t===null?0:t.childLanes&~o,r&&(t|=_r),t}function F1(t,r,o){var l=r.pendingProps,p=!1,y=(r.flags&128)!=0,S;if((S=y)||(S=t!==null&&t.memoizedState===null?!1:(dn.current&2)!=0),S&&(p=!0,r.flags&=-129),S=(r.flags&32)!=0,r.flags&=-33,t===null){if(mt){if(p?Yi(r):Zi(r),mt){var D=Wt,F;if(F=D){e:{for(F=D,D=Zr;F.nodeType!==8;){if(!D){D=null;break e}if(F=Fr(F.nextSibling),F===null){D=null;break e}}D=F}D===null?F=!1:(r.memoizedState={dehydrated:D,treeContext:Uo===null?null:{id:gi,overflow:yi},retryLane:536870912,hydrationErrors:null},F=ir(18,null,null,0),F.stateNode=D,F.return=r,r.child=F,qn=r,Wt=null,F=!0)}F||Go(r)}if(D=r.memoizedState,D!==null&&(D=D.dehydrated,D!==null))return Wp(D)?r.lanes=32:r.lanes=536870912,null;xi(r)}return D=l.children,l=l.fallback,p?(Zi(r),p=r.mode,D=$c({mode:"hidden",children:D},p),l=Wo(l,p,o,null),D.return=r,l.return=r,D.sibling=l,r.child=D,p=r.child,p.memoizedState=lp(o),p.childLanes=cp(t,S,o),r.memoizedState=sp,l):(Yi(r),up(r,D))}if(F=t.memoizedState,F!==null&&(D=F.dehydrated,D!==null)){if(y)r.flags&256?(Yi(r),r.flags&=-257,r=dp(t,r,o)):r.memoizedState===null?(Zi(r),p=l.fallback,D=r.mode,l=$c({mode:"visible",children:l.children},D),p=Wo(p,D,o,null),p.flags|=2,l.return=r,p.return=r,l.sibling=p,r.child=l,Ja(r,t.child,null,o),l=r.child,l.memoizedState=lp(o),l.childLanes=cp(t,S,o),r.memoizedState=sp,r=p):(Zi(r),r.child=t.child,r.flags|=128,r=null);else if(Yi(r),Wp(D)){if(S=D.nextSibling&&D.nextSibling.dataset,S)var re=S.dgst;S=re,l=Error(s(419)),l.stack="",l.digest=S,Ks({value:l,source:null,stack:null}),r=dp(t,r,o)}else if(_n||Qs(t,r,o,!1),S=(o&t.childLanes)!==0,_n||S){if(S=Mt,S!==null&&(l=o&-o,l=l&42?1:Hn(l),l=(l&(S.suspendedLanes|o))===0?l:0,l!==0&&l!==F.retryLane))throw F.retryLane=l,za(t,l),lr(S,t,l),P1;D.data==="$?"||Dp(),r=dp(t,r,o)}else D.data==="$?"?(r.flags|=192,r.child=t.child,r=null):(t=F.treeContext,Wt=Fr(D.nextSibling),qn=r,mt=!0,Qo=null,Zr=!1,t!==null&&(vr[br++]=gi,vr[br++]=yi,vr[br++]=Uo,gi=t.id,yi=t.overflow,Uo=r),r=up(r,l.children),r.flags|=4096);return r}return p?(Zi(r),p=l.fallback,D=r.mode,F=t.child,re=F.sibling,l=hi(F,{mode:"hidden",children:l.children}),l.subtreeFlags=F.subtreeFlags&65011712,re===null?(p=Wo(p,D,o,null),p.flags|=2):p=hi(re,p),p.return=r,l.return=r,l.sibling=p,r.child=l,l=p,p=r.child,D=t.child.memoizedState,D===null?D=lp(o):(F=D.cachePool,F===null?F=Dv():(re=un._currentValue,F=F.parent===re?F:{parent:re,pool:re}),D={baseLanes:D.baseLanes|o,cachePool:F}),p.memoizedState=D,p.childLanes=cp(t,S,o),r.memoizedState=sp,l):(Yi(r),o=t.child,t=o.sibling,o=hi(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 up(t,r){return r=$c({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function $c(t,r){return t=ir(22,t,null,r),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function dp(t,r,o){return Ja(r,t.child,null,o),t=up(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),Df(t.return,r,o)}function fp(t,r,o,l,p){var y=t.memoizedState;y===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:p}:(y.isBackwards=r,y.rendering=null,y.renderingStartTime=0,y.last=l,y.tail=o,y.tailMode=p)}function H1(t,r,o){var l=r.pendingProps,p=l.revealOrder,y=l.tail;if(Sn(t,r,l.children,o),l=dn.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(De(dn,l),p){case"forwards":for(o=r.child,p=null;o!==null;)t=o.alternate,t!==null&&Fc(t)===null&&(p=o),o=o.sibling;o=p,o===null?(p=r.child,r.child=null):(p=o.sibling,o.sibling=null),fp(r,!1,p,o,y);break;case"backwards":for(o=null,p=r.child,r.child=null;p!==null;){if(t=p.alternate,t!==null&&Fc(t)===null){r.child=p;break}t=p.sibling,p.sibling=o,o=p,p=t}fp(r,!0,o,null,y);break;case"together":fp(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function ki(t,r,o){if(t!==null&&(r.dependencies=t.dependencies),io|=r.lanes,(o&r.childLanes)===0)if(t!==null){if(Qs(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=hi(t,t.pendingProps),r.child=o,o.return=r;t.sibling!==null;)t=t.sibling,o=o.sibling=hi(t,t.pendingProps),o.return=r;o.sibling=null}return r.child}function pp(t,r){return(t.lanes&r)===0?(t=t.dependencies,!!(t!==null&&Cc(t))):!0}function qT(t,r,o){switch(r.tag){case 3:ln(r,r.stateNode.containerInfo),Gi(r,un,t.memoizedState.cache),Us();break;case 27:case 5:nn(r);break;case 4:ln(r,r.stateNode.containerInfo);break;case 10:Gi(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?(Yi(r),t=ki(t,r,o),t===null?null:t.sibling):F1(t,r,o):(Yi(r),r.flags|=128,null);Yi(r);break;case 19:var p=(t.flags&128)!=0;if(l=(o&r.childLanes)!==0,l||(l=(Qs(t,r,o,!1),(o&r.childLanes)!==0)),p){if(l)return H1(t,r,o);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),De(dn,dn.current),l)break;return null;case 22:case 23:return r.lanes=0,A1(t,r,o);case 24:Gi(r,un,t.memoizedState.cache)}return ki(t,r,o)}function V1(t,r,o){if(t!==null)if(t.memoizedProps!==r.pendingProps)_n=!0;else{if(!pp(t,o)&&!(r.flags&128))return _n=!1,qT(t,r,o);_n=!!(t.flags&131072)}else _n=!1,mt&&r.flags&1048576&&xv(r,kc,r.index);switch(r.lanes=0,r.tag){case 16:e:{t=r.pendingProps;var l=r.elementType,p=l._init;if(l=p(l._payload),r.type=l,typeof l=="function")xf(l)?(t=na(l,t),r.tag=1,r=q1(null,r,l,t,o)):(r.tag=0,r=ap(null,r,l,t,o));else{if(l!=null){if(p=l.$$typeof,p===pe){r.tag=11,r=L1(null,r,l,t,o);break e}else if(p===$){r.tag=14,r=N1(null,r,l,t,o);break e}}throw r=ie(l)||l,Error(s(306,r,""))}}return r;case 0:return ap(t,r,r.type,r.pendingProps,o);case 1:return l=r.type,p=na(l,r.pendingProps),q1(t,r,l,p,o);case 3:e:{if(ln(r,r.stateNode.containerInfo),t===null)throw Error(s(387));l=r.pendingProps;var y=r.memoizedState;p=y.element,If(t,r),tl(r,l,null,o);var S=r.memoizedState;if(l=S.cache,Gi(r,un,l),l!==y.cache&&Of(r,[un],o,!0),el(),l=S.element,y.isDehydrated)if(y={element:l,isDehydrated:!1,cache:S.cache},r.updateQueue.baseState=y,r.memoizedState=y,r.flags&256){r=z1(t,r,l,o);break e}else if(l!==p){p=gr(Error(s(424)),r),Ks(p),r=z1(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=Fr(t.firstChild),qn=r,mt=!0,Qo=null,Zr=!0,o=C1(r,null,l,o),r.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(Us(),l===p){r=ki(t,r,o);break e}Sn(t,r,l,o)}r=r.child}return r;case 26:return Vc(t,r),t===null?(o=Qb(r.type,null,r.pendingProps,null))?r.memoizedState=o:mt||(o=r.type,t=r.pendingProps,l=iu(It.current).createElement(o),l[bt]=r,l[jt]=t,Tn(l,o,t),He(l),r.stateNode=l):r.memoizedState=Qb(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return nn(r),t===null&&mt&&(l=r.stateNode=Wb(r.type,r.pendingProps,It.current),qn=r,Zr=!0,p=Wt,lo(r.type)?(Up=p,Wt=Fr(l.firstChild)):Wt=p),Sn(t,r,r.pendingProps.children,o),Vc(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&mt&&((p=l=Wt)&&(l=u3(l,r.type,r.pendingProps,Zr),l===null?p=!1:(r.stateNode=l,qn=r,Wt=Fr(l.firstChild),Zr=!1,p=!0)),p||Go(r)),nn(r),p=r.type,y=r.pendingProps,S=t===null?null:t.memoizedProps,l=y.children,Hp(p,y)?l=null:S!==null&&Hp(p,S)&&(r.flags|=32),r.memoizedState!==null&&(p=Hf(t,r,TT,null,null,o),kl._currentValue=p),Vc(t,r),Sn(t,r,l,o),r.child;case 6:return t===null&&mt&&((t=o=Wt)&&(o=d3(o,r.pendingProps,Zr),o===null?t=!1:(r.stateNode=o,qn=r,Wt=null,t=!0)),t||Go(r)),null;case 13:return F1(t,r,o);case 4:return ln(r,r.stateNode.containerInfo),l=r.pendingProps,t===null?r.child=Ja(r,null,l,o):Sn(t,r,l,o),r.child;case 11:return L1(t,r,r.type,r.pendingProps,o);case 7:return Sn(t,r,r.pendingProps,o),r.child;case 8:return Sn(t,r,r.pendingProps.children,o),r.child;case 12:return Sn(t,r,r.pendingProps.children,o),r.child;case 10:return l=r.pendingProps,Gi(r,r.type,l.value),Sn(t,r,l.children,o),r.child;case 9:return p=r.type._context,l=r.pendingProps.children,Xo(r),p=Ln(p),l=l(p),r.flags|=1,Sn(t,r,l,o),r.child;case 14:return N1(t,r,r.type,r.pendingProps,o);case 15:return M1(t,r,r.type,r.pendingProps,o);case 19:return H1(t,r,o);case 31:return l=r.pendingProps,o=r.mode,l={mode:l.mode,children:l.children},t===null?(o=$c(l,o),o.ref=r.ref,r.child=o,o.return=r,r=o):(o=hi(t.child,l),o.ref=r.ref,r.child=o,o.return=r,r=o),r;case 22:return A1(t,r,o);case 24:return Xo(r),l=Ln(un),t===null?(p=Nf(),p===null&&(p=Mt,y=Pf(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=o),p=y),r.memoizedState={parent:l,cache:p},Af(r),Gi(r,un,p)):((t.lanes&o)!==0&&(If(t,r),tl(r,null,null,o),el()),p=t.memoizedState,y=r.memoizedState,p.parent===l?(l=y.cache,Gi(r,un,l),l!==p.cache&&Of(r,[un],o,!0)):(p={parent:l,cache:l},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),Gi(r,un,l))),Sn(t,r,r.pendingProps.children,o),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Ci(t){t.flags|=4}function $1(t,r){if(r.type!=="stylesheet"||r.state.loading&4)t.flags&=-16777217;else if(t.flags|=16777216,!Zb(r)){if(r=wr.current,r!==null&&((at&4194048)===at?_i!==null:(at&62914560)!==at&&!(at&536870912)||r!==_i))throw Ys=Mf,Ov;t.flags|=8192}}function Wc(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag===22?536870912:Kr(),t.lanes|=r,es|=r)}function ll(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 p=t.child;p!==null;)o|=p.lanes|p.childLanes,l|=p.subtreeFlags&65011712,l|=p.flags&65011712,p.return=t,p=p.sibling;else for(p=t.child;p!==null;)o|=p.lanes|p.childLanes,l|=p.subtreeFlags,l|=p.flags,p.return=t,p=p.sibling;return t.subtreeFlags|=l,t.childLanes=o,r}function zT(t,r,o){var l=r.pendingProps;switch(Ef(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),bi(un),Ue(),o.pendingContext&&(o.pendingContext=(o.context=o.pendingContext,null)),(t===null||t.child===null)&&(Ws(r)?Ci(r):t===null||t.memoizedState.isDehydrated&&!(r.flags&256)||(r.flags|=1024,Sv())),Bt(r),null;case 26:return o=r.memoizedState,t===null?(Ci(r),o===null?(Bt(r),r.flags&=-16777217):(Bt(r),$1(r,o))):o?o===t.memoizedState?(Bt(r),r.flags&=-16777217):(Ci(r),Bt(r),$1(r,o)):(t.memoizedProps!==l&&Ci(r),Bt(r),r.flags&=-16777217),null;case 27:gt(r),o=It.current;var p=r.type;if(t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Ci(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Bt(r),null}t=Ne.current,Ws(r)?kv(r,t):(t=Wb(p,l,o),r.stateNode=t,Ci(r))}return Bt(r),null;case 5:if(gt(r),o=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Ci(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Bt(r),null}if(t=Ne.current,Ws(r))kv(r,t);else{switch(p=iu(It.current),t){case 1:t=p.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:t=p.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":t=p.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":t=p.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":t=p.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof l.is=="string"?p.createElement("select",{is:l.is}):p.createElement("select"),l.multiple?t.multiple=!0:l.size&&(t.size=l.size);break;default:t=typeof l.is=="string"?p.createElement(o,{is:l.is}):p.createElement(o)}}t[bt]=r,t[jt]=l;e:for(p=r.child;p!==null;){if(p.tag===5||p.tag===6)t.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===r)break e;for(;p.sibling===null;){if(p.return===null||p.return===r)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}r.stateNode=t;e:switch(Tn(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&&Ci(r)}}return Bt(r),r.flags&=-16777217,null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==l&&Ci(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(t=It.current,Ws(r)){if(t=r.stateNode,o=r.memoizedProps,l=null,p=qn,p!==null)switch(p.tag){case 27:case 5:l=p.memoizedProps}t[bt]=r,t=!!(t.nodeValue===o||l!==null&&l.suppressHydrationWarning===!0||qb(t.nodeValue,o)),t||Go(r)}else t=iu(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(p=Ws(r),l!==null&&l.dehydrated!==null){if(t===null){if(!p)throw Error(s(318));if(p=r.memoizedState,p=p===null?null:p.dehydrated,!p)throw Error(s(317));p[bt]=r}else Us(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;Bt(r),p=!1}else p=Sv(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(xi(r),r):(xi(r),null)}if(xi(r),r.flags&128)return r.lanes=o,r;if(o=l!==null,t=t!==null&&t.memoizedState!==null,o){l=r.child,p=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(p=l.alternate.memoizedState.cachePool.pool);var y=null;l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(y=l.memoizedState.cachePool.pool),y!==p&&(l.flags|=2048)}return o!==t&&o&&(r.child.flags|=8192),Wc(r,r.updateQueue),Bt(r),null;case 4:return Ue(),t===null&&Mb(r.stateNode.containerInfo),Bt(r),null;case 10:return bi(r.type),Bt(r),null;case 19:if(We(dn),p=r.memoizedState,p===null)return Bt(r),null;if(l=(r.flags&128)!=0,y=p.rendering,y===null)if(l)ll(p,!1);else{if(Ut!==0||t!==null&&t.flags&128)for(t=r.child;t!==null;){if(y=Fc(t),y!==null){for(r.flags|=128,ll(p,!1),t=y.updateQueue,r.updateQueue=t,Wc(r,t),r.subtreeFlags=0,t=o,o=r.child;o!==null;)_v(o,t),o=o.sibling;return De(dn,dn.current&1|2),r.child}t=t.sibling}p.tail!==null&&bn()>Qc&&(r.flags|=128,l=!0,ll(p,!1),r.lanes=4194304)}else{if(!l)if(t=Fc(y),t!==null){if(r.flags|=128,l=!0,t=t.updateQueue,r.updateQueue=t,Wc(r,t),ll(p,!0),p.tail===null&&p.tailMode==="hidden"&&!y.alternate&&!mt)return Bt(r),null}else 2*bn()-p.renderingStartTime>Qc&&o!==536870912&&(r.flags|=128,l=!0,ll(p,!1),r.lanes=4194304);p.isBackwards?(y.sibling=r.child,r.child=y):(t=p.last,t===null?r.child=y:t.sibling=y,p.last=y)}return p.tail===null?(Bt(r),null):(r=p.tail,p.rendering=r,p.tail=r.sibling,p.renderingStartTime=bn(),r.sibling=null,t=dn.current,De(dn,l?t&1|2:t&1),r);case 22:case 23:return xi(r),Ff(),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&&Wc(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(Yo),null;case 24:return o=null,t!==null&&(o=t.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),bi(un),Bt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function FT(t,r){switch(Ef(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return bi(un),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(xi(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Us()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return We(dn),null;case 4:return Ue(),null;case 10:return bi(r.type),null;case 22:case 23:return xi(r),Ff(),t!==null&&We(Yo),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return bi(un),null;case 25:return null;default:return null}}function W1(t,r){switch(Ef(r),r.tag){case 3:bi(un),Ue();break;case 26:case 27:case 5:gt(r);break;case 4:Ue();break;case 13:xi(r);break;case 19:We(dn);break;case 10:bi(r.type);break;case 22:case 23:xi(r),Ff(),t!==null&&We(Yo);break;case 24:bi(un)}}function cl(t,r){try{var o=r.updateQueue,l=o===null?null:o.lastEffect;if(l!==null){var p=l.next;o=p;do{if((o.tag&t)===t){l=void 0;var y=o.create,S=o.inst;l=y(),S.destroy=l}o=o.next}while(o!==p)}}catch(D){Lt(r,r.return,D)}}function eo(t,r,o){try{var l=r.updateQueue,p=l===null?null:l.lastEffect;if(p!==null){var y=p.next;l=y;do{if((l.tag&t)===t){var S=l.inst,D=S.destroy;if(D!==void 0){S.destroy=void 0,p=r;var F=o,re=D;try{re()}catch(me){Lt(p,F,me)}}}l=l.next}while(l!==y)}}catch(me){Lt(r,r.return,me)}}function U1(t){var r=t.updateQueue;if(r!==null){var o=t.stateNode;try{Iv(r,o)}catch(l){Lt(t,t.return,l)}}}function K1(t,r,o){o.props=na(t.type,t.memoizedProps),o.state=t.memoizedState;try{o.componentWillUnmount()}catch(l){Lt(t,r,l)}}function ul(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(p){Lt(t,r,p)}}function ei(t,r){var o=t.ref,l=t.refCleanup;if(o!==null)if(typeof l=="function")try{l()}catch(p){Lt(t,r,p)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(p){Lt(t,r,p)}else o.current=null}function Q1(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(p){Lt(t,t.return,p)}}function mp(t,r,o){try{var l=t.stateNode;o3(l,t.type,o,r),l[jt]=r}catch(p){Lt(t,t.return,p)}}function G1(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&lo(t.type)||t.tag===4}function hp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||G1(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&&lo(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 gp(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=ru));else if(l!==4&&(l===27&&lo(t.type)&&(o=t.stateNode,r=null),t=t.child,t!==null))for(gp(t,r,o),t=t.sibling;t!==null;)gp(t,r,o),t=t.sibling}function Uc(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&&lo(t.type)&&(o=t.stateNode),t=t.child,t!==null))for(Uc(t,r,o),t=t.sibling;t!==null;)Uc(t,r,o),t=t.sibling}function J1(t){var r=t.stateNode,o=t.memoizedProps;try{for(var l=t.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);Tn(r,l,o),r[bt]=t,r[jt]=o}catch(y){Lt(t,t.return,y)}}var Si=!1,Zt=!1,yp=!1,X1=typeof WeakSet=="function"?WeakSet:Set,xn=null;function BT(t,r){if(t=t.containerInfo,Fp=uu,t=dv(t),hf(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 p=l.anchorOffset,y=l.focusNode;l=l.focusOffset;try{o.nodeType,y.nodeType}catch{o=null;break e}var S=0,D=-1,F=-1,re=0,me=0,ve=t,ae=null;t:for(;;){for(var le;ve!==o||p!==0&&ve.nodeType!==3||(D=S+p),ve!==y||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===p&&(D=S),ae===y&&++me===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(Bp={focusedElem:t,selectionRange:o},uu=!1,xn=r;xn!==null;)if(r=xn,t=r.child,r.subtreeFlags&1024&&t!==null)t.return=r,xn=t;else for(;xn!==null;){switch(r=xn,y=r.alternate,t=r.flags,r.tag){case 0:break;case 11:case 15:break;case 1:if(t&1024&&y!==null){t=void 0,o=r,p=y.memoizedProps,y=y.memoizedState,l=o.stateNode;try{var qe=na(o.type,p,o.elementType===o.type);t=l.getSnapshotBeforeUpdate(qe,y),l.__reactInternalSnapshotBeforeUpdate=t}catch(Me){Lt(o,o.return,Me)}}break;case 3:if(t&1024){if(t=r.stateNode.containerInfo,o=t.nodeType,o===9)$p(t);else if(o===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":$p(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,xn=t;break}xn=r.return}}function Y1(t,r,o){var l=o.flags;switch(o.tag){case 0:case 11:case 15:to(t,o),l&4&&cl(5,o);break;case 1:if(to(t,o),l&4)if(t=o.stateNode,r===null)try{t.componentDidMount()}catch(S){Lt(o,o.return,S)}else{var p=na(o.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(p,r,t.__reactInternalSnapshotBeforeUpdate)}catch(S){Lt(o,o.return,S)}}l&64&&U1(o),l&512&&ul(o,o.return);break;case 3:if(to(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{Iv(t,r)}catch(S){Lt(o,o.return,S)}}break;case 27:r===null&&l&4&&J1(o);case 26:case 5:to(t,o),r===null&&l&4&&Q1(o),l&512&&ul(o,o.return);break;case 12:to(t,o);break;case 13:to(t,o),l&4&&tb(t,o),l&64&&(t=o.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(o=JT.bind(null,o),f3(t,o))));break;case 22:if(l=o.memoizedState!==null||Si,!l){r=r!==null&&r.memoizedState!==null||Zt,p=Si;var y=Zt;Si=l,(Zt=r)&&!y?no(t,o,(o.subtreeFlags&8772)!=0):to(t,o),Si=p,Zt=y}break;case 30:break;default:to(t,o)}}function Z1(t){var r=t.alternate;r!==null&&(t.alternate=null,Z1(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,Wn=!1;function Ei(t,r,o){for(o=o.child;o!==null;)eb(t,r,o),o=o.sibling}function eb(t,r,o){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(Ht,o)}catch{}switch(o.tag){case 26:Zt||ei(o,r),Ei(t,r,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Zt||ei(o,r);var l=zt,p=Wn;lo(o.type)&&(zt=o.stateNode,Wn=!1),Ei(t,r,o),bl(o.stateNode),zt=l,Wn=p;break;case 5:Zt||ei(o,r);case 6:if(l=zt,p=Wn,zt=null,Ei(t,r,o),zt=l,Wn=p,zt!==null)if(Wn)try{(zt.nodeType===9?zt.body:zt.nodeName==="HTML"?zt.ownerDocument.body:zt).removeChild(o.stateNode)}catch(y){Lt(o,r,y)}else try{zt.removeChild(o.stateNode)}catch(y){Lt(o,r,y)}break;case 18:zt!==null&&(Wn?(t=zt,Vb(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,o.stateNode),Tl(t)):Vb(zt,o.stateNode));break;case 4:l=zt,p=Wn,zt=o.stateNode.containerInfo,Wn=!0,Ei(t,r,o),zt=l,Wn=p;break;case 0:case 11:case 14:case 15:Zt||eo(2,o,r),Zt||eo(4,o,r),Ei(t,r,o);break;case 1:Zt||(ei(o,r),l=o.stateNode,typeof l.componentWillUnmount=="function"&&K1(o,r,l)),Ei(t,r,o);break;case 21:Ei(t,r,o);break;case 22:Zt=(l=Zt)||o.memoizedState!==null,Ei(t,r,o),Zt=l;break;default:Ei(t,r,o)}}function tb(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Tl(t)}catch(o){Lt(r,r.return,o)}}function HT(t){switch(t.tag){case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new X1),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new X1),r;default:throw Error(s(435,t.tag))}}function vp(t,r){var o=HT(t);r.forEach(function(l){var p=XT.bind(null,t,l);o.has(l)||(o.add(l),l.then(p,p))})}function or(t,r){var o=r.deletions;if(o!==null)for(var l=0;l<o.length;l++){var p=o[l],y=t,S=r,D=S;e:for(;D!==null;){switch(D.tag){case 27:if(lo(D.type)){zt=D.stateNode,Wn=!1;break e}break;case 5:zt=D.stateNode,Wn=!1;break e;case 3:case 4:zt=D.stateNode.containerInfo,Wn=!0;break e}D=D.return}if(zt===null)throw Error(s(160));eb(y,S,p),zt=null,Wn=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(r.subtreeFlags&13878)for(r=r.child;r!==null;)nb(r,t),r=r.sibling}var zr=null;function nb(t,r){var o=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:or(r,t),ar(t),l&4&&(eo(3,t,t.return),cl(3,t),eo(5,t,t.return));break;case 1:or(r,t),ar(t),l&512&&(Zt||o===null||ei(o,o.return)),l&64&&Si&&(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 p=zr;if(or(r,t),ar(t),l&512&&(Zt||o===null||ei(o,o.return)),l&4){var y=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,p=p.ownerDocument||p;t:switch(l){case"title":y=p.getElementsByTagName("title")[0],(!y||y[Se]||y[bt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(l),p.head.insertBefore(y,p.querySelector("head > title"))),Tn(y,l,o),y[bt]=t,He(y),l=y;break e;case"link":var S=Xb("link","href",p).get(l+(o.href||""));if(S){for(var D=0;D<S.length;D++)if(y=S[D],y.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&y.getAttribute("rel")===(o.rel==null?null:o.rel)&&y.getAttribute("title")===(o.title==null?null:o.title)&&y.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){S.splice(D,1);break t}}y=p.createElement(l),Tn(y,l,o),p.head.appendChild(y);break;case"meta":if(S=Xb("meta","content",p).get(l+(o.content||""))){for(D=0;D<S.length;D++)if(y=S[D],y.getAttribute("content")===(o.content==null?null:""+o.content)&&y.getAttribute("name")===(o.name==null?null:o.name)&&y.getAttribute("property")===(o.property==null?null:o.property)&&y.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&y.getAttribute("charset")===(o.charSet==null?null:o.charSet)){S.splice(D,1);break t}}y=p.createElement(l),Tn(y,l,o),p.head.appendChild(y);break;default:throw Error(s(468,l))}y[bt]=t,He(y),l=y}t.stateNode=l}else Yb(p,t.type,t.stateNode);else t.stateNode=Jb(p,l,t.memoizedProps);else y===l?l===null&&t.stateNode!==null&&mp(t,t.memoizedProps,o.memoizedProps):(y===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):y.count--,l===null?Yb(p,t.type,t.stateNode):Jb(p,l,t.memoizedProps))}break;case 27:or(r,t),ar(t),l&512&&(Zt||o===null||ei(o,o.return)),o!==null&&l&4&&mp(t,t.memoizedProps,o.memoizedProps);break;case 5:if(or(r,t),ar(t),l&512&&(Zt||o===null||ei(o,o.return)),t.flags&32){p=t.stateNode;try{Jr(p,"")}catch(le){Lt(t,t.return,le)}}l&4&&t.stateNode!=null&&(p=t.memoizedProps,mp(t,p,o===null?p:o.memoizedProps)),l&1024&&(yp=!0);break;case 6:if(or(r,t),ar(t),l&4){if(t.stateNode===null)throw Error(s(162));l=t.memoizedProps,o=t.stateNode;try{o.nodeValue=l}catch(le){Lt(t,t.return,le)}}break;case 3:if(su=null,p=zr,zr=ou(r.containerInfo),or(r,t),zr=p,ar(t),l&4&&o!==null&&o.memoizedState.isDehydrated)try{Tl(r.containerInfo)}catch(le){Lt(t,t.return,le)}yp&&(yp=!1,rb(t));break;case 4:l=zr,zr=ou(t.stateNode.containerInfo),or(r,t),ar(t),zr=l;break;case 12:or(r,t),ar(t);break;case 13:or(r,t),ar(t),t.child.flags&8192&&t.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Cp=bn()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,vp(t,l)));break;case 22:p=t.memoizedState!==null;var F=o!==null&&o.memoizedState!==null,re=Si,me=Zt;if(Si=re||p,Zt=me||F,or(r,t),Zt=me,Si=re,ar(t),l&8192)e:for(r=t.stateNode,r._visibility=p?r._visibility&-2:r._visibility|1,p&&(o===null||F||Si||Zt||ra(t)),o=null,r=t;;){if(r.tag===5||r.tag===26){if(o===null){F=o=r;try{if(y=F.stateNode,p)S=y.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){Lt(F,F.return,le)}}}else if(r.tag===6){if(o===null){F=r;try{F.stateNode.nodeValue=p?"":F.memoizedProps}catch(le){Lt(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,vp(t,o))));break;case 19:or(r,t),ar(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,vp(t,l)));break;case 30:break;case 21:break;default:or(r,t),ar(t)}}function ar(t){var r=t.flags;if(r&2){try{for(var o,l=t.return;l!==null;){if(G1(l)){o=l;break}l=l.return}if(o==null)throw Error(s(160));switch(o.tag){case 27:var p=o.stateNode;Uc(t,hp(t),p);break;case 5:var y=o.stateNode;o.flags&32&&(Jr(y,""),o.flags&=-33),Uc(t,hp(t),y);break;case 3:case 4:var S=o.stateNode.containerInfo;gp(t,hp(t),S);break;default:throw Error(s(161))}}catch(D){Lt(t,t.return,D)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function rb(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;rb(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function to(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Y1(t,r.alternate,r),r=r.sibling}function ra(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:eo(4,r,r.return),ra(r);break;case 1:ei(r,r.return);var o=r.stateNode;typeof o.componentWillUnmount=="function"&&K1(r,r.return,o),ra(r);break;case 27:bl(r.stateNode);case 26:case 5:ei(r,r.return),ra(r);break;case 22:r.memoizedState===null&&ra(r);break;case 30:ra(r);break;default:ra(r)}t=t.sibling}}function no(t,r,o){for(o&&(o=(r.subtreeFlags&8772)!=0),r=r.child;r!==null;){var l=r.alternate,p=t,y=r,S=y.flags;switch(y.tag){case 0:case 11:case 15:no(p,y,o),cl(4,y);break;case 1:if(no(p,y,o),l=y,p=l.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(re){Lt(l,l.return,re)}if(l=y,p=l.updateQueue,p!==null){var D=l.stateNode;try{var F=p.shared.hiddenCallbacks;if(F!==null)for(p.shared.hiddenCallbacks=null,p=0;p<F.length;p++)Av(F[p],D)}catch(re){Lt(l,l.return,re)}}o&&S&64&&U1(y),ul(y,y.return);break;case 27:J1(y);case 26:case 5:no(p,y,o),o&&l===null&&S&4&&Q1(y),ul(y,y.return);break;case 12:no(p,y,o);break;case 13:no(p,y,o),o&&S&4&&tb(p,y);break;case 22:y.memoizedState===null&&no(p,y,o),ul(y,y.return);break;case 30:break;default:no(p,y,o)}r=r.sibling}}function bp(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&&Gs(o))}function wp(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Gs(t))}function ti(t,r,o,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)ib(t,r,o,l),r=r.sibling}function ib(t,r,o,l){var p=r.flags;switch(r.tag){case 0:case 11:case 15:ti(t,r,o,l),p&2048&&cl(9,r);break;case 1:ti(t,r,o,l);break;case 3:ti(t,r,o,l),p&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Gs(t)));break;case 12:if(p&2048){ti(t,r,o,l),t=r.stateNode;try{var y=r.memoizedProps,S=y.id,D=y.onPostCommit;typeof D=="function"&&D(S,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(F){Lt(r,r.return,F)}}else ti(t,r,o,l);break;case 13:ti(t,r,o,l);break;case 23:break;case 22:y=r.stateNode,S=r.alternate,r.memoizedState===null?y._visibility&2?ti(t,r,o,l):(y._visibility|=2,Xa(t,r,o,l,(r.subtreeFlags&10256)!=0)):y._visibility&2?ti(t,r,o,l):dl(t,r),p&2048&&bp(S,r);break;case 24:ti(t,r,o,l),p&2048&&wp(r.alternate,r);break;default:ti(t,r,o,l)}}function Xa(t,r,o,l,p){for(p&&(p=(r.subtreeFlags&10256)!=0),r=r.child;r!==null;){var y=t,S=r,D=o,F=l,re=S.flags;switch(S.tag){case 0:case 11:case 15:Xa(y,S,D,F,p),cl(8,S);break;case 23:break;case 22:var me=S.stateNode;S.memoizedState===null?(me._visibility|=2,Xa(y,S,D,F,p)):me._visibility&2?Xa(y,S,D,F,p):dl(y,S),p&&re&2048&&bp(S.alternate,S);break;case 24:Xa(y,S,D,F,p),p&&re&2048&&wp(S.alternate,S);break;default:Xa(y,S,D,F,p)}r=r.sibling}}function dl(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var o=t,l=r,p=l.flags;switch(l.tag){case 22:dl(o,l),p&2048&&bp(l.alternate,l);break;case 24:dl(o,l),p&2048&&wp(l.alternate,l);break;default:dl(o,l)}r=r.sibling}}var fl=8192;function Ya(t){if(t.subtreeFlags&fl)for(t=t.child;t!==null;)ob(t),t=t.sibling}function ob(t){switch(t.tag){case 26:Ya(t),t.flags&fl&&t.memoizedState!==null&&S3(zr,t.memoizedState,t.memoizedProps);break;case 5:Ya(t);break;case 3:case 4:var r=zr;zr=ou(t.stateNode.containerInfo),Ya(t),zr=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=fl,fl=16777216,Ya(t),fl=r):Ya(t));break;default:Ya(t)}}function ab(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function pl(t){var r=t.deletions;if(t.flags&16){if(r!==null)for(var o=0;o<r.length;o++){var l=r[o];xn=l,lb(l,t)}ab(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)sb(t),t=t.sibling}function sb(t){switch(t.tag){case 0:case 11:case 15:pl(t),t.flags&2048&&eo(9,t,t.return);break;case 3:pl(t);break;case 12:pl(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,Kc(t)):pl(t);break;default:pl(t)}}function Kc(t){var r=t.deletions;if(t.flags&16){if(r!==null)for(var o=0;o<r.length;o++){var l=r[o];xn=l,lb(l,t)}ab(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:eo(8,r,r.return),Kc(r);break;case 22:o=r.stateNode,o._visibility&2&&(o._visibility&=-3,Kc(r));break;default:Kc(r)}t=t.sibling}}function lb(t,r){for(;xn!==null;){var o=xn;switch(o.tag){case 0:case 11:case 15:eo(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:Gs(o.memoizedState.cache)}if(l=o.child,l!==null)l.return=o,xn=l;else e:for(o=t;xn!==null;){l=xn;var p=l.sibling,y=l.return;if(Z1(l),l===o){xn=null;break e}if(p!==null){p.return=y,xn=p;break e}xn=y}}}var VT={getCacheForType:function(t){var r=Ln(un),o=r.data.get(t);return o===void 0&&(o=t(),r.data.set(t,o)),o}},$T=typeof WeakMap=="function"?WeakMap:Map,_t=0,Mt=null,nt=null,at=0,xt=0,sr=null,ro=!1,Za=!1,_p=!1,Ti=0,Ut=0,io=0,ia=0,xp=0,_r=0,es=0,ml=null,Un=null,kp=!1,Cp=0,Qc=1/0,Gc=null,oo=null,En=0,ao=null,ts=null,ns=0,Sp=0,Ep=null,cb=null,hl=0,Tp=null;function xr(){if(_t&2&&at!==0)return at&-at;if(G.T!==null){var t=Va;return t===0?Mp():t}return pi()}function ub(){_r===0&&(_r=!(at&536870912)||mt?On():536870912);var t=wr.current;return t!==null&&(t.flags|=32),_r}function lr(t,r,o){(t===Mt&&(xt===2||xt===9)||t.cancelPendingCommit!==null)&&(rs(t,0),so(t,at,_r,!1)),Zn(t,o),(!(_t&2)||t!==Mt)&&(t===Mt&&(!(_t&2)&&(ia|=o),Ut===4&&so(t,at,_r,!1)),Ri(t))}function db(t,r,o){if(_t&6)throw Error(s(327));var l=!o&&(r&124)==0&&(r&t.expiredLanes)===0||lt(t,r),p=l?KT(t,r):Op(t,r,!0),y=l;do{if(p===0){Za&&!l&&so(t,r,0,!1);break}else{if(o=t.current.alternate,y&&!WT(o)){p=Op(t,r,!1),y=!1;continue}if(p===2){if(y=r,t.errorRecoveryDisabledLanes&y)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;p=ml;var F=D.current.memoizedState.isDehydrated;if(F&&(rs(D,S).flags|=256),S=Op(D,S,!1),S!==2){if(_p&&!F){D.errorRecoveryDisabledLanes|=y,ia|=y,p=4;break e}y=Un,Un=p,y!==null&&(Un===null?Un=y:Un.push.apply(Un,y))}p=S}if(y=!1,p!==2)continue}}if(p===1){rs(t,0),so(t,r,0,!0);break}e:{switch(l=t,y=p,y){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:so(l,r,_r,!ro);break e;case 2:Un=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(p=Cp+300-bn(),10<p)){if(so(l,r,_r,!ro),Vt(l,0,!0)!==0)break e;l.timeoutHandle=Bb(fb.bind(null,l,o,Un,Gc,kp,r,_r,ia,es,ro,y,2,-0,0),p);break e}fb(l,o,Un,Gc,kp,r,_r,ia,es,ro,y,0,-0,0)}}break}while(!0);Ri(t)}function fb(t,r,o,l,p,y,S,D,F,re,me,ve,ae,le){if(t.timeoutHandle=-1,ve=r.subtreeFlags,(ve&8192||(ve&16785408)==16785408)&&(xl={stylesheets:null,count:0,unsuspend:C3},ob(r),ve=E3(),ve!==null)){t.cancelPendingCommit=ve(bb.bind(null,t,r,y,o,l,p,S,D,F,me,1,ae,le)),so(t,y,S,!re);return}bb(t,r,y,o,l,p,S,D,F)}function WT(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 p=o[l],y=p.getSnapshot;p=p.value;try{if(!rr(y(),p))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 so(t,r,o,l){r&=~xp,r&=~ia,t.suspendedLanes|=r,t.pingedLanes&=~r,l&&(t.warmLanes|=r),l=t.expirationTimes;for(var p=r;0<p;){var y=31-Ft(p),S=1<<y;l[y]=-1,p&=~S}o!==0&&fi(t,o,r)}function Jc(){return _t&6?!0:(gl(0,!1),!1)}function Rp(){if(nt!==null){if(xt===0)var t=nt.return;else t=nt,vi=Jo=null,Wf(t),Ga=null,al=0,t=nt;for(;t!==null;)W1(t.alternate,t),t=t.return;nt=null}}function rs(t,r){var o=t.timeoutHandle;o!==-1&&(t.timeoutHandle=-1,s3(o)),o=t.cancelPendingCommit,o!==null&&(t.cancelPendingCommit=null,o()),Rp(),Mt=t,nt=o=hi(t.current,null),at=r,xt=0,sr=null,ro=!1,Za=lt(t,r),_p=!1,es=_r=xp=ia=io=Ut=0,Un=ml=null,kp=!1,r&8&&(r|=r&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=r;0<l;){var p=31-Ft(l),y=1<<p;r|=t[p],l&=~y}return Ti=r,vc(),o}function pb(t,r){Ye=null,G.H=jc,r===Xs||r===Tc?(r=Nv(),xt=3):r===Ov?(r=Nv(),xt=4):xt=r===P1?8:typeof r=="object"&&r&&typeof r.then=="function"?6:1,sr=r,nt===null&&(Ut=1,Hc(t,gr(r,t.current)))}function mb(){var t=G.H;return G.H=jc,t===null?jc:t}function hb(){var t=G.A;return G.A=VT,t}function Dp(){Ut=4,ro||(at&4194048)!==at&&wr.current!==null||(Za=!0),!(io&134217727)&&!(ia&134217727)||Mt===null||so(Mt,at,_r,!1)}function Op(t,r,o){var l=_t;_t|=2;var p=mb(),y=hb();(Mt!==t||at!==r)&&(Gc=null,rs(t,r)),r=!1;var S=Ut;e:do try{if(xt!==0&&nt!==null){var D=nt,F=sr;switch(xt){case 8:Rp(),S=6;break e;case 3:case 2:case 9:case 6:wr.current===null&&(r=!0);var re=xt;if(xt=0,sr=null,is(t,D,F,re),o&&Za){S=0;break e}break;default:re=xt,xt=0,sr=null,is(t,D,F,re)}}UT(),S=Ut;break}catch(me){pb(t,me)}while(!0);return r&&t.shellSuspendCounter++,vi=Jo=null,_t=l,G.H=p,G.A=y,nt===null&&(Mt=null,at=0,vc()),S}function UT(){for(;nt!==null;)gb(nt)}function KT(t,r){var o=_t;_t|=2;var l=mb(),p=hb();Mt!==t||at!==r?(Gc=null,Qc=bn()+500,rs(t,r)):Za=lt(t,r);e:do try{if(xt!==0&&nt!==null){r=nt;var y=sr;t:switch(xt){case 1:xt=0,sr=null,is(t,r,y,1);break;case 2:case 9:if(Pv(y)){xt=0,sr=null,yb(r);break}r=function(){xt!==2&&xt!==9||Mt!==t||(xt=7),Ri(t)},y.then(r,r);break e;case 3:xt=7;break e;case 4:xt=5;break e;case 7:Pv(y)?(xt=0,sr=null,yb(r)):(xt=0,sr=null,is(t,r,y,7));break;case 5:var S=null;switch(nt.tag){case 26:S=nt.memoizedState;case 5:case 27:var D=nt;if(!S||Zb(S)){xt=0,sr=null;var F=D.sibling;if(F!==null)nt=F;else{var re=D.return;re===null?nt=null:(nt=re,Xc(re))}break t}}xt=0,sr=null,is(t,r,y,5);break;case 6:xt=0,sr=null,is(t,r,y,6);break;case 8:Rp(),Ut=6;break e;default:throw Error(s(462))}}QT();break}catch(me){pb(t,me)}while(!0);return vi=Jo=null,G.H=l,G.A=p,_t=o,nt===null?(Mt=null,at=0,vc(),Ut):0}function QT(){for(;nt!==null&&!ci();)gb(nt)}function gb(t){var r=V1(t.alternate,t,Ti);t.memoizedProps=t.pendingProps,r===null?Xc(t):nt=r}function yb(t){var r=t,o=r.alternate;switch(r.tag){case 15:case 0:r=j1(o,r,r.pendingProps,r.type,void 0,at);break;case 11:r=j1(o,r,r.pendingProps,r.type.render,r.ref,at);break;case 5:Wf(r);default:W1(o,r),r=nt=_v(r,Ti),r=V1(o,r,Ti)}t.memoizedProps=t.pendingProps,r===null?Xc(t):nt=r}function is(t,r,o,l){vi=Jo=null,Wf(r),Ga=null,al=0;var p=r.return;try{if(jT(t,p,r,o,at)){Ut=1,Hc(t,gr(o,t.current)),nt=null;return}}catch(y){if(p!==null)throw nt=p,y;Ut=1,Hc(t,gr(o,t.current)),nt=null;return}r.flags&32768?(mt||l===1?t=!0:Za||at&536870912?t=!1:(ro=t=!0,(l===2||l===9||l===3||l===6)&&(l=wr.current,l!==null&&l.tag===13&&(l.flags|=16384))),vb(r,t)):Xc(r)}function Xc(t){var r=t;do{if(r.flags&32768){vb(r,ro);return}t=r.return;var o=zT(r.alternate,r,Ti);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 vb(t,r){do{var o=FT(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 bb(t,r,o,l,p,y,S,D,F){t.cancelPendingCommit=null;do Yc();while(En!==0);if(_t&6)throw Error(s(327));if(r!==null){if(r===t.current)throw Error(s(177));if(y=r.lanes|r.childLanes,y|=wf,Qr(t,o,y,S,D,F),t===Mt&&(nt=Mt=null,at=0),ts=r,ao=t,ns=o,Sp=y,Ep=p,cb=l,r.subtreeFlags&10256||r.flags&10256?(t.callbackNode=null,t.callbackPriority=0,YT(rn,function(){return Cb(!0),null})):(t.callbackNode=null,t.callbackPriority=0),l=(r.flags&13878)!=0,r.subtreeFlags&13878||l){l=G.T,G.T=null,p=K.p,K.p=2,S=_t,_t|=4;try{BT(t,r,o)}finally{_t=S,K.p=p,G.T=l}}En=1,wb(),_b(),xb()}}function wb(){if(En===1){En=0;var t=ao,r=ts,o=(r.flags&13878)!=0;if(r.subtreeFlags&13878||o){o=G.T,G.T=null;var l=K.p;K.p=2;var p=_t;_t|=4;try{nb(r,t);var y=Bp,S=dv(t.containerInfo),D=y.focusedElem,F=y.selectionRange;if(S!==D&&D&&D.ownerDocument&&uv(D.ownerDocument.documentElement,D)){if(F!==null&&hf(D)){var re=F.start,me=F.end;if(me===void 0&&(me=re),"selectionStart"in D)D.selectionStart=re,D.selectionEnd=Math.min(me,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,Me=Math.min(F.start,qe),Rt=F.end===void 0?Me:Math.min(F.end,qe);!le.extend&&Me>Rt&&(S=Rt,Rt=Me,Me=S);var J=cv(D,Me),U=cv(D,Rt);if(J&&U&&(le.rangeCount!==1||le.anchorNode!==J.node||le.anchorOffset!==J.offset||le.focusNode!==U.node||le.focusOffset!==U.offset)){var te=ve.createRange();te.setStart(J.node,J.offset),le.removeAllRanges(),Me>Rt?(le.addRange(te),le.extend(U.node,U.offset)):(te.setEnd(U.node,U.offset),le.addRange(te))}}}}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 he=ve[D];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}uu=!!Fp,Bp=Fp=null}finally{_t=p,K.p=l,G.T=o}}t.current=r,En=2}}function _b(){if(En===2){En=0;var t=ao,r=ts,o=(r.flags&8772)!=0;if(r.subtreeFlags&8772||o){o=G.T,G.T=null;var l=K.p;K.p=2;var p=_t;_t|=4;try{Y1(t,r.alternate,r)}finally{_t=p,K.p=l,G.T=o}}En=3}}function xb(){if(En===4||En===3){En=0,vn();var t=ao,r=ts,o=ns,l=cb;r.subtreeFlags&10256||r.flags&10256?En=5:(En=0,ts=ao=null,kb(t,t.pendingLanes));var p=t.pendingLanes;if(p===0&&(oo=null),Gr(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=G.T,p=K.p,K.p=2,G.T=null;try{for(var y=t.onRecoverableError,S=0;S<l.length;S++){var D=l[S];y(D.value,{componentStack:D.stack})}}finally{G.T=r,K.p=p}}ns&3&&Yc(),Ri(t),p=t.pendingLanes,o&4194090&&p&42?t===Tp?hl++:(hl=0,Tp=t):hl=0,gl(0,!1)}}function kb(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Gs(r)))}function Yc(t){return wb(),_b(),xb(),Cb(t)}function Cb(){if(En!==5)return!1;var t=ao,r=Sp;Sp=0;var o=Gr(ns),l=G.T,p=K.p;try{K.p=32>o?32:o,G.T=null,o=Ep,Ep=null;var y=ao,S=ns;if(En=0,ts=ao=null,ns=0,_t&6)throw Error(s(331));var D=_t;if(_t|=4,sb(y.current),ib(y,y.current,S,o),_t=D,gl(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(Ht,y)}catch{}return!0}finally{K.p=p,G.T=l,kb(t,r)}}function Sb(t,r,o){r=gr(o,r),r=op(t.stateNode,r,2),t=ea(t,r,2),t!==null&&(Zn(t,2),Ri(t))}function Lt(t,r,o){if(t.tag===3)Sb(t,t,o);else for(;r!==null;){if(r.tag===3){Sb(r,t,o);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(oo===null||!oo.has(l))){t=gr(o,t),o=D1(2),l=ea(r,o,2),l!==null&&(O1(o,l,r,t),Zn(l,2),Ri(l));break}}r=r.return}}function Pp(t,r,o){var l=t.pingCache;if(l===null){l=t.pingCache=new $T;var p=new Set;l.set(r,p)}else p=l.get(r),p===void 0&&(p=new Set,l.set(r,p));p.has(o)||(_p=!0,p.add(o),t=GT.bind(null,t,r,o),r.then(t,t))}function GT(t,r,o){var l=t.pingCache;l!==null&&l.delete(r),t.pingedLanes|=t.suspendedLanes&o,t.warmLanes&=~o,Mt===t&&(at&o)===o&&(Ut===4||Ut===3&&(at&62914560)===at&&300>bn()-Cp?!(_t&2)&&rs(t,0):xp|=o,es===at&&(es=0)),Ri(t)}function Eb(t,r){r===0&&(r=Kr()),t=za(t,r),t!==null&&(Zn(t,r),Ri(t))}function JT(t){var r=t.memoizedState,o=0;r!==null&&(o=r.retryLane),Eb(t,o)}function XT(t,r){var o=0;switch(t.tag){case 13:var l=t.stateNode,p=t.memoizedState;p!==null&&(o=p.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),Eb(t,o)}function YT(t,r){return Yn(t,r)}var Zc=null,os=null,Lp=!1,eu=!1,Np=!1,oa=0;function Ri(t){t!==os&&t.next===null&&(os===null?Zc=os=t:os=os.next=t),eu=!0,Lp||(Lp=!0,e3())}function gl(t,r){if(!Np&&eu){Np=!0;do for(var o=!1,l=Zc;l!==null;){if(!r)if(t!==0){var p=l.pendingLanes;if(p===0)var y=0;else{var S=l.suspendedLanes,D=l.pingedLanes;y=(1<<31-Ft(42|t)+1)-1,y&=p&~(S&~D),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(o=!0,Ob(l,y))}else y=at,y=Vt(l,l===Mt?y:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),!(y&3)||lt(l,y)||(o=!0,Ob(l,y));l=l.next}while(o);Np=!1}}function ZT(){Tb()}function Tb(){eu=Lp=!1;var t=0;oa!==0&&(a3()&&(t=oa),oa=0);for(var r=bn(),o=null,l=Zc;l!==null;){var p=l.next,y=Rb(l,r);y===0?(l.next=null,o===null?Zc=p:o.next=p,p===null&&(os=o)):(o=l,(t!==0||y&3)&&(eu=!0)),l=p}gl(t,!1)}function Rb(t,r){for(var o=t.suspendedLanes,l=t.pingedLanes,p=t.expirationTimes,y=t.pendingLanes&-62914561;0<y;){var S=31-Ft(y),D=1<<S,F=p[S];F===-1?((D&o)===0||(D&l)!==0)&&(p[S]=vt(D,r)):F<=r&&(t.expiredLanes|=D),y&=~D}if(r=Mt,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)||lt(t,o)){if(r=o&-o,r===t.callbackPriority)return r;switch(l!==null&&kt(l),Gr(o)){case 2:case 8:o=In;break;case 32:o=rn;break;case 268435456:o=Ur;break;default:o=rn}return l=Db.bind(null,t),o=Yn(o,l),t.callbackPriority=r,t.callbackNode=o,r}return l!==null&&l!==null&&kt(l),t.callbackPriority=2,t.callbackNode=null,2}function Db(t,r){if(En!==0&&En!==5)return t.callbackNode=null,t.callbackPriority=0,null;var o=t.callbackNode;if(Yc(!0)&&t.callbackNode!==o)return null;var l=at;return l=Vt(t,t===Mt?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(db(t,l,r),Rb(t,bn()),t.callbackNode!=null&&t.callbackNode===o?Db.bind(null,t):null)}function Ob(t,r){if(Yc())return null;db(t,r,!0)}function e3(){l3(function(){_t&6?Yn(Nr,ZT):Tb()})}function Mp(){return oa===0&&(oa=On()),oa}function Pb(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Mo(""+t)}function Lb(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 t3(t,r,o,l,p){if(r==="submit"&&o&&o.stateNode===p){var y=Pb((p[jt]||null).action),S=l.submitter;S&&(r=(r=S[jt]||null)?Pb(r.formAction):S.getAttribute("formAction"),r!==null&&(y=r,S=null));var D=new Ki("action","action",null,l,p);t.push({event:D,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(oa!==0){var F=S?Lb(p,S):new FormData(p);ep(o,{pending:!0,data:F,method:p.method,action:y},null,F)}}else typeof y=="function"&&(D.preventDefault(),F=S?Lb(p,S):new FormData(p),ep(o,{pending:!0,data:F,method:p.method,action:y},y,F))},currentTarget:p}]})}}for(var Ap=0;Ap<bf.length;Ap++){var Ip=bf[Ap];qr(Ip.toLowerCase(),"on"+(Ip[0].toUpperCase()+Ip.slice(1)))}qr(mv,"onAnimationEnd"),qr(hv,"onAnimationIteration"),qr(gv,"onAnimationStart"),qr("dblclick","onDoubleClick"),qr("focusin","onFocus"),qr("focusout","onBlur"),qr(yT,"onTransitionRun"),qr(vT,"onTransitionStart"),qr(bT,"onTransitionCancel"),qr(yv,"onTransitionEnd"),tr("onMouseEnter",["mouseout","mouseover"]),tr("onMouseLeave",["mouseout","mouseover"]),tr("onPointerEnter",["pointerout","pointerover"]),tr("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 yl="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(" "),n3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(yl));function Nb(t,r){r=(r&4)!=0;for(var o=0;o<t.length;o++){var l=t[o],p=l.event;l=l.listeners;e:{var y=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!==y&&p.isPropagationStopped())break e;y=D,p.currentTarget=re;try{y(p)}catch(me){Bc(me)}p.currentTarget=null,y=F}else for(S=0;S<l.length;S++){if(D=l[S],F=D.instance,re=D.currentTarget,D=D.listener,F!==y&&p.isPropagationStopped())break e;y=D,p.currentTarget=re;try{y(p)}catch(me){Bc(me)}p.currentTarget=null,y=F}}}}function rt(t,r){var o=r[Je];o===void 0&&(o=r[Je]=new Set);var l=t+"__bubble";o.has(l)||(Ab(r,t,2,!1),o.add(l))}function jp(t,r,o){var l=0;r&&(l|=4),Ab(o,t,l,r)}var tu="_reactListening"+Math.random().toString(36).slice(2);function Mb(t){if(!t[tu]){t[tu]=!0,ot.forEach(function(o){o!=="selectionchange"&&(n3.has(o)||jp(o,!1,t),jp(o,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[tu]||(r[tu]=!0,jp("selectionchange",!1,r))}}function Ab(t,r,o,l){switch(r2(r)){case 2:var p=P3;break;case 8:p=L3;break;default:p=Xp}o=p.bind(null,r,o,t),p=void 0,!Is||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),l?p===void 0?t.addEventListener(r,o,!0):t.addEventListener(r,o,{capture:!0,passive:p}):p===void 0?t.addEventListener(r,o,!1):t.addEventListener(r,o,{passive:p})}function qp(t,r,o,l,p){var y=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===p)break;if(S===4)for(S=l.return;S!==null;){var F=S.tag;if((F===3||F===4)&&S.stateNode.containerInfo===p)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=y=S;continue e}D=D.parentNode}}l=l.return}hc(function(){var re=y,me=Aa(o),ve=[];e:{var ae=vv.get(t);if(ae!==void 0){var le=Ki,qe=t;switch(t){case"keypress":if(zo(o)===0)break e;case"keydown":case"keyup":le=xe;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=R;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=Te;break;case mv:case hv:case gv:le=N;break;case yv:le=Ie;break;case"scroll":case"scrollend":le=u;break;case"wheel":le=ct;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 Me=(r&4)!=0,Rt=!Me&&(t==="scroll"||t==="scrollend"),J=Me?ae===null?null:ae+"Capture":ae;Me=[];for(var U=re,te;U!==null;){var he=U;if(te=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||te===null||J===null||(he=Io(U,J),he!=null&&Me.push(vl(U,he,te))),Rt)break;U=U.return}0<Me.length&&(ae=new le(ae,qe,null,o,me),ve.push({event:ae,listeners:Me}))}}if(!(r&7)){e:{if(ae=t==="mouseover"||t==="pointerover",le=t==="mouseout"||t==="pointerout",ae&&o!==As&&(qe=o.relatedTarget||o.fromElement)&&(tt(qe)||qe[L]))break e;if((le||ae)&&(ae=me.window===me?me:(ae=me.ownerDocument)?ae.defaultView||ae.parentWindow:window,le?(qe=o.relatedTarget||o.toElement,le=re,qe=qe?tt(qe):null,qe!==null&&(Rt=d(qe),Me=qe.tag,qe!==Rt||Me!==5&&Me!==27&&Me!==6)&&(qe=null)):(le=null,qe=re),le!==qe)){if(Me=k,he="onMouseLeave",J="onMouseEnter",U="mouse",(t==="pointerout"||t==="pointerover")&&(Me=je,he="onPointerLeave",J="onPointerEnter",U="pointer"),Rt=le==null?ae:wt(le),te=qe==null?ae:wt(qe),ae=new Me(he,U+"leave",le,o,me),ae.target=Rt,ae.relatedTarget=te,he=null,tt(me)===re&&(Me=new Me(J,U+"enter",qe,o,me),Me.target=te,Me.relatedTarget=Rt,he=Me),Rt=he,le&&qe)t:{for(Me=le,J=qe,U=0,te=Me;te;te=as(te))U++;for(te=0,he=J;he;he=as(he))te++;for(;0<U-te;)Me=as(Me),U--;for(;0<te-U;)J=as(J),te--;for(;U--;){if(Me===J||J!==null&&Me===J.alternate)break t;Me=as(Me),J=as(J)}Me=null}else Me=null;le!==null&&Ib(ve,ae,le,Me,!1),qe!==null&&Rt!==null&&Ib(ve,Rt,qe,Me,!0)}}e:{if(ae=re?wt(re):window,le=ae.nodeName&&ae.nodeName.toLowerCase(),le==="select"||le==="input"&&ae.type==="file")var Re=rv;else if(tv(ae))if(iv)Re=mT;else{Re=fT;var et=dT}else le=ae.nodeName,!le||le.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?re&&Ns(re.elementType)&&(Re=rv):Re=pT;if(Re&&(Re=Re(t,re))){nv(ve,Re,o,me);break e}et&&et(t,ae,re),t==="focusout"&&re&&ae.type==="number"&&re.memoizedProps.value!=null&&Ls(ae,"number",ae.value)}switch(et=re?wt(re):window,t){case"focusin":(tv(et)||et.contentEditable==="true")&&(Ia=et,gf=re,$s=null);break;case"focusout":$s=gf=Ia=null;break;case"mousedown":yf=!0;break;case"contextmenu":case"mouseup":case"dragend":yf=!1,fv(ve,o,me);break;case"selectionchange":if(gT)break;case"keydown":case"keyup":fv(ve,o,me)}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 Qi?Ho(t,o)&&(Ae="onCompositionEnd"):t==="keydown"&&o.keyCode===229&&(Ae="onCompositionStart");Ae&&(Jt&&o.locale!=="ko"&&(Qi||Ae!=="onCompositionStart"?Ae==="onCompositionEnd"&&Qi&&(Oe=qs()):(Xr=me,js="value"in Xr?Xr.value:Xr.textContent,Qi=!0)),et=nu(re,Ae),0<et.length&&(Ae=new j(Ae,t,null,o,me),ve.push({event:Ae,listeners:et}),Oe?Ae.data=Oe:(Oe=gc(o),Oe!==null&&(Ae.data=Oe)))),(Oe=Ke?Fs(t,o):lT(t,o))&&(Ae=nu(re,"onBeforeInput"),0<Ae.length&&(et=new j("onBeforeInput","beforeinput",null,o,me),ve.push({event:et,listeners:Ae}),et.data=Oe)),t3(ve,t,re,o,me)}Nb(ve,r)})}function vl(t,r,o){return{instance:t,listener:r,currentTarget:o}}function nu(t,r){for(var o=r+"Capture",l=[];t!==null;){var p=t,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=Io(t,o),p!=null&&l.unshift(vl(t,p,y)),p=Io(t,r),p!=null&&l.push(vl(t,p,y))),t.tag===3)return l;t=t.return}return[]}function as(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Ib(t,r,o,l,p){for(var y=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,p?(re=Io(o,y),re!=null&&S.unshift(vl(o,re,F))):p||(re=Io(o,y),re!=null&&S.push(vl(o,re,F)))),o=o.return}S.length!==0&&t.push({event:r,listeners:S})}var r3=/\r\n?/g,i3=/\u0000|\uFFFD/g;function jb(t){return(typeof t=="string"?t:""+t).replace(r3,`
|
|
10
|
-
`).replace(i3,"")}function qb(t,r){return r=jb(r),jb(t)===r}function ru(){}function Tt(t,r,o,l,p,y){switch(o){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||Jr(t,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&Jr(t,""+l);break;case"className":Na(t,"class",l);break;case"tabIndex":Na(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Na(t,o,l);break;case"style":mi(t,l,y);break;case"data":if(r!=="object"){Na(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=Mo(""+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 y=="function"&&(o==="formAction"?(r!=="input"&&Tt(t,r,"name",p.name,p,null),Tt(t,r,"formEncType",p.formEncType,p,null),Tt(t,r,"formMethod",p.formMethod,p,null),Tt(t,r,"formTarget",p.formTarget,p,null)):(Tt(t,r,"encType",p.encType,p,null),Tt(t,r,"method",p.method,p,null),Tt(t,r,"target",p.target,p,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(o);break}l=Mo(""+l),t.setAttribute(o,l);break;case"onClick":l!=null&&(t.onclick=ru);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(p.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=Mo(""+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),Oo(t,"popover",l);break;case"xlinkActuate":mr(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":mr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":mr(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":mr(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":mr(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":mr(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":mr(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":mr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":mr(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Oo(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=Ms.get(o)||o,Oo(t,o,l))}}function zp(t,r,o,l,p,y){switch(o){case"style":mi(t,l,y);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(o=l.__html,o!=null){if(p.children!=null)throw Error(s(60));t.innerHTML=o}}break;case"children":typeof l=="string"?Jr(t,l):(typeof l=="number"||typeof l=="bigint")&&Jr(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=ru);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"&&(p=o.endsWith("Capture"),r=o.slice(2,p?o.length-7:void 0),y=t[jt]||null,y=y==null?null:y[o],typeof y=="function"&&t.removeEventListener(r,y,p),typeof l=="function")){typeof y!="function"&&y!==null&&(o in t?t[o]=null:t.hasAttribute(o)&&t.removeAttribute(o)),t.addEventListener(r,l,p);break e}o in t?t[o]=l:l===!0?t.setAttribute(o,""):Oo(t,o,l)}}}function Tn(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,p=!1,y;for(y in o)if(o.hasOwnProperty(y)){var S=o[y];if(S!=null)switch(y){case"src":l=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Tt(t,r,y,S,o,null)}}p&&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=y=S=p=null,F=null,re=null;for(l in o)if(o.hasOwnProperty(l)){var me=o[l];if(me!=null)switch(l){case"name":p=me;break;case"type":S=me;break;case"checked":F=me;break;case"defaultChecked":re=me;break;case"value":y=me;break;case"defaultValue":D=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(s(137,r));break;default:Tt(t,r,l,me,o,null)}}No(t,y,D,F,re,S,p,!1),Po(t);return;case"select":for(p in rt("invalid",t),l=S=y=null,o)if(o.hasOwnProperty(p)&&(D=o[p],D!=null))switch(p){case"value":y=D;break;case"defaultValue":S=D;break;case"multiple":l=D;default:Tt(t,r,p,D,o,null)}r=y,o=S,t.multiple=!!l,r==null?o!=null&&hr(t,!!l,o,!0):hr(t,!!l,r,!1);return;case"textarea":for(S in rt("invalid",t),y=p=l=null,o)if(o.hasOwnProperty(S)&&(D=o[S],D!=null))switch(S){case"value":l=D;break;case"defaultValue":p=D;break;case"children":y=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(s(91));break;default:Tt(t,r,S,D,o,null)}Wi(t,l,p,y),Po(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<yl.length;l++)rt(yl[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(Ns(r)){for(me in o)o.hasOwnProperty(me)&&(l=o[me],l!==void 0&&zp(t,r,me,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 o3(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 p=null,y=null,S=null,D=null,F=null,re=null,me=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":y=le;break;case"name":p=le;break;case"checked":re=le;break;case"defaultChecked":me=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)}}Ps(t,S,D,F,re,me,y,p);return;case"select":for(y in le=S=D=ae=null,o)if(F=o[y],o.hasOwnProperty(y)&&F!=null)switch(y){case"value":break;case"multiple":le=F;default:l.hasOwnProperty(y)||Tt(t,r,y,null,l,F)}for(p in l)if(y=l[p],F=o[p],l.hasOwnProperty(p)&&(y!=null||F!=null))switch(p){case"value":ae=y;break;case"defaultValue":D=y;break;case"multiple":S=y;default:y!==F&&Tt(t,r,p,y,l,F)}r=D,o=S,l=le,ae==null?!!l!=!!o&&(r==null?hr(t,!!o,o?[]:"",!1):hr(t,!!o,r,!0)):hr(t,!!o,ae,!1);return;case"textarea":for(D in le=ae=null,o)if(p=o[D],o.hasOwnProperty(D)&&p!=null&&!l.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:Tt(t,r,D,null,l,p)}for(S in l)if(p=l[S],y=o[S],l.hasOwnProperty(S)&&(p!=null||y!=null))switch(S){case"value":ae=p;break;case"defaultValue":le=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(s(91));break;default:p!==y&&Tt(t,r,S,p,l,y)}fc(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 Me in o)ae=o[Me],o.hasOwnProperty(Me)&&ae!=null&&!l.hasOwnProperty(Me)&&Tt(t,r,Me,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(Ns(r)){for(var Rt in o)ae=o[Rt],o.hasOwnProperty(Rt)&&ae!==void 0&&!l.hasOwnProperty(Rt)&&zp(t,r,Rt,void 0,l,ae);for(me in l)ae=l[me],le=o[me],!l.hasOwnProperty(me)||ae===le||ae===void 0&&le===void 0||zp(t,r,me,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 Fp=null,Bp=null;function iu(t){return t.nodeType===9?t:t.ownerDocument}function zb(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 Fb(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 Hp(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 Vp=null;function a3(){var t=window.event;return t&&t.type==="popstate"?t===Vp?!1:(Vp=t,!0):(Vp=null,!1)}var Bb=typeof setTimeout=="function"?setTimeout:void 0,s3=typeof clearTimeout=="function"?clearTimeout:void 0,Hb=typeof Promise=="function"?Promise:void 0,l3=typeof queueMicrotask=="function"?queueMicrotask:Hb===void 0?Bb:function(t){return Hb.resolve(null).then(t).catch(c3)};function c3(t){setTimeout(function(){throw t})}function lo(t){return t==="head"}function Vb(t,r){var o=r,l=0,p=0;do{var y=o.nextSibling;if(t.removeChild(o),y&&y.nodeType===8)if(o=y.data,o==="/$"){if(0<l&&8>l){o=l;var S=t.ownerDocument;if(o&1&&bl(S.documentElement),o&2&&bl(S.body),o&4)for(o=S.head,bl(o),S=o.firstChild;S;){var D=S.nextSibling,F=S.nodeName;S[Se]||F==="SCRIPT"||F==="STYLE"||F==="LINK"&&S.rel.toLowerCase()==="stylesheet"||o.removeChild(S),S=D}}if(p===0){t.removeChild(y),Tl(r);return}p--}else o==="$"||o==="$?"||o==="$!"?p++:l=o.charCodeAt(0)-48;else l=0;o=y}while(o);Tl(r)}function $p(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":$p(o),pt(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}t.removeChild(o)}}function u3(t,r,o,l){for(;t.nodeType===1;){var p=o;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[Se])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(y=t.getAttribute("rel"),y==="stylesheet"&&t.hasAttribute("data-precedence")||y!==p.rel||t.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||t.getAttribute("title")!==(p.title==null?null:p.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(y=t.getAttribute("src"),(y!==(p.src==null?null:p.src)||t.getAttribute("type")!==(p.type==null?null:p.type)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&t.getAttribute("name")===y)return t}else return t;if(t=Fr(t.nextSibling),t===null)break}return null}function d3(t,r,o){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!o||(t=Fr(t.nextSibling),t===null))return null;return t}function Wp(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function f3(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 Fr(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 Up=null;function $b(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 Wb(t,r,o){switch(r=iu(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 bl(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);pt(t)}var kr=new Map,Ub=new Set;function ou(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Di=K.d;K.d={f:p3,r:m3,D:h3,C:g3,L:y3,m:v3,X:w3,S:b3,M:_3};function p3(){var t=Di.f(),r=Jc();return t||r}function m3(t){var r=it(t);r!==null&&r.tag===5&&r.type==="form"?m1(r):Di.r(t)}var ss=typeof document>"u"?null:document;function Kb(t,r,o){var l=ss;if(l&&typeof r=="string"&&r){var p=Ve(r);p='link[rel="'+t+'"][href="'+p+'"]',typeof o=="string"&&(p+='[crossorigin="'+o+'"]'),Ub.has(p)||(Ub.add(p),t={rel:t,crossOrigin:o,href:r},l.querySelector(p)===null&&(r=l.createElement("link"),Tn(r,"link",t),He(r),l.head.appendChild(r)))}}function h3(t){Di.D(t),Kb("dns-prefetch",t,null)}function g3(t,r){Di.C(t,r),Kb("preconnect",t,r)}function y3(t,r,o){Di.L(t,r,o);var l=ss;if(l&&t&&r){var p='link[rel="preload"][as="'+Ve(r)+'"]';r==="image"&&o&&o.imageSrcSet?(p+='[imagesrcset="'+Ve(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(p+='[imagesizes="'+Ve(o.imageSizes)+'"]')):p+='[href="'+Ve(t)+'"]';var y=p;switch(r){case"style":y=ls(t);break;case"script":y=cs(t)}kr.has(y)||(t=_({rel:"preload",href:r==="image"&&o&&o.imageSrcSet?void 0:t,as:r},o),kr.set(y,t),l.querySelector(p)!==null||r==="style"&&l.querySelector(wl(y))||r==="script"&&l.querySelector(_l(y))||(r=l.createElement("link"),Tn(r,"link",t),He(r),l.head.appendChild(r)))}}function v3(t,r){Di.m(t,r);var o=ss;if(o&&t){var l=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+Ve(l)+'"][href="'+Ve(t)+'"]',y=p;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=cs(t)}if(!kr.has(y)&&(t=_({rel:"modulepreload",href:t},r),kr.set(y,t),o.querySelector(p)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(_l(y)))return}l=o.createElement("link"),Tn(l,"link",t),He(l),o.head.appendChild(l)}}}function b3(t,r,o){Di.S(t,r,o);var l=ss;if(l&&t){var p=$e(l).hoistableStyles,y=ls(t);r||(r="default");var S=p.get(y);if(!S){var D={loading:0,preload:null};if(S=l.querySelector(wl(y)))D.loading=5;else{t=_({rel:"stylesheet",href:t,"data-precedence":r},o),(o=kr.get(y))&&Kp(t,o);var F=S=l.createElement("link");He(F),Tn(F,"link",t),F._p=new Promise(function(re,me){F.onload=re,F.onerror=me}),F.addEventListener("load",function(){D.loading|=1}),F.addEventListener("error",function(){D.loading|=2}),D.loading|=4,au(S,r,l)}S={type:"stylesheet",instance:S,count:1,state:D},p.set(y,S)}}}function w3(t,r){Di.X(t,r);var o=ss;if(o&&t){var l=$e(o).hoistableScripts,p=cs(t),y=l.get(p);y||(y=o.querySelector(_l(p)),y||(t=_({src:t,async:!0},r),(r=kr.get(p))&&Qp(t,r),y=o.createElement("script"),He(y),Tn(y,"link",t),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},l.set(p,y))}}function _3(t,r){Di.M(t,r);var o=ss;if(o&&t){var l=$e(o).hoistableScripts,p=cs(t),y=l.get(p);y||(y=o.querySelector(_l(p)),y||(t=_({src:t,async:!0,type:"module"},r),(r=kr.get(p))&&Qp(t,r),y=o.createElement("script"),He(y),Tn(y,"link",t),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},l.set(p,y))}}function Qb(t,r,o,l){var p=(p=It.current)?ou(p):null;if(!p)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(r=ls(o.href),o=$e(p).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=ls(o.href);var y=$e(p).hoistableStyles,S=y.get(t);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(t,S),(y=p.querySelector(wl(t)))&&!y._p&&(S.instance=y,S.state.loading=5),kr.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},kr.set(t,o),y||x3(p,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=cs(o),o=$e(p).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 ls(t){return'href="'+Ve(t)+'"'}function wl(t){return'link[rel="stylesheet"]['+t+"]"}function Gb(t){return _({},t,{"data-precedence":t.precedence,precedence:null})}function x3(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}),Tn(r,"link",o),He(r),t.head.appendChild(r))}function cs(t){return'[src="'+Ve(t)+'"]'}function _l(t){return"script[async]"+t}function Jb(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 p=_({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),He(l),Tn(l,"style",p),au(l,o.precedence,t),r.instance=l;case"stylesheet":p=ls(o.href);var y=t.querySelector(wl(p));if(y)return r.state.loading|=4,r.instance=y,He(y),y;l=Gb(o),(p=kr.get(p))&&Kp(l,p),y=(t.ownerDocument||t).createElement("link"),He(y);var S=y;return S._p=new Promise(function(D,F){S.onload=D,S.onerror=F}),Tn(y,"link",l),r.state.loading|=4,au(y,o.precedence,t),r.instance=y;case"script":return y=cs(o.src),(p=t.querySelector(_l(y)))?(r.instance=p,He(p),p):(l=o,(p=kr.get(y))&&(l=_({},o),Qp(l,p)),t=t.ownerDocument||t,p=t.createElement("script"),He(p),Tn(p,"link",l),t.head.appendChild(p),r.instance=p);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,au(l,o.precedence,t));return r.instance}function au(t,r,o){for(var l=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=l.length?l[l.length-1]:null,y=p,S=0;S<l.length;S++){var D=l[S];if(D.dataset.precedence===r)y=D;else if(y!==p)break}y?y.parentNode.insertBefore(t,y.nextSibling):(r=o.nodeType===9?o.head:o,r.insertBefore(t,r.firstChild))}function Kp(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.title??(t.title=r.title)}function Qp(t,r){t.crossOrigin??(t.crossOrigin=r.crossOrigin),t.referrerPolicy??(t.referrerPolicy=r.referrerPolicy),t.integrity??(t.integrity=r.integrity)}var su=null;function Xb(t,r,o){if(su===null){var l=new Map,p=su=new Map;p.set(o,l)}else p=su,l=p.get(o),l||(l=new Map,p.set(o,l));if(l.has(t))return l;for(l.set(t,null),o=o.getElementsByTagName(t),p=0;p<o.length;p++){var y=o[p];if(!(y[Se]||y[bt]||t==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var S=y.getAttribute(r)||"";S=t+S;var D=l.get(S);D?D.push(y):l.set(S,[y])}}return l}function Yb(t,r,o){t=t.ownerDocument||t,t.head.insertBefore(o,r==="title"?t.querySelector("head > title"):null)}function k3(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 Zb(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}var xl=null;function C3(){}function S3(t,r,o){if(xl===null)throw Error(s(475));var l=xl;if(r.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&!(r.state.loading&4)){if(r.instance===null){var p=ls(o.href),y=t.querySelector(wl(p));if(y){t=y._p,typeof t=="object"&&t&&typeof t.then=="function"&&(l.count++,l=lu.bind(l),t.then(l,l)),r.state.loading|=4,r.instance=y,He(y);return}y=t.ownerDocument||t,o=Gb(o),(p=kr.get(p))&&Kp(o,p),y=y.createElement("link"),He(y);var S=y;S._p=new Promise(function(D,F){S.onload=D,S.onerror=F}),Tn(y,"link",o),r.instance=y}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(r,t),(t=r.state.preload)&&!(r.state.loading&3)&&(l.count++,r=lu.bind(l),t.addEventListener("load",r),t.addEventListener("error",r))}}function E3(){if(xl===null)throw Error(s(475));var t=xl;return t.stylesheets&&t.count===0&&Gp(t,t.stylesheets),0<t.count?function(r){var o=setTimeout(function(){if(t.stylesheets&&Gp(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 lu(){if(this.count--,this.count===0){if(this.stylesheets)Gp(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var cu=null;function Gp(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,cu=new Map,r.forEach(T3,t),cu=null,lu.call(t))}function T3(t,r){if(!(r.state.loading&4)){var o=cu.get(t);if(o)var l=o.get(null);else{o=new Map,cu.set(t,o);for(var p=t.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var S=p[y];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(o.set(S.dataset.precedence,S),l=S)}l&&o.set(null,l)}p=r.instance,S=p.getAttribute("data-precedence"),y=o.get(S)||l,y===l&&o.set(null,p),o.set(S,p),this.count++,l=lu.bind(this),p.addEventListener("load",l),p.addEventListener("error",l),y?y.parentNode.insertBefore(p,y.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(p,t.firstChild)),r.state.loading|=4}}var kl={$$typeof:Q,Provider:null,Consumer:null,_currentValue:Le,_currentValue2:Le,_threadCount:0};function R3(t,r,o,l,p,y,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=p,this.onCaughtError=y,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function D3(t,r,o,l,p,y,S,D,F,re,me,ve){return t=new R3(t,r,o,S,D,F,re,ve),r=1,y===!0&&(r|=24),y=ir(3,null,null,r),t.current=y,y.stateNode=t,r=Pf(),r.refCount++,t.pooledCache=r,r.refCount++,y.memoizedState={element:l,isDehydrated:o,cache:r},Af(y),t}function O3(t){return t?(t=Fa,t):Fa}function e2(t,r,o,l,p,y){p=O3(p),l.context===null?l.context=p:l.pendingContext=p,l=Zo(r),l.payload={element:o},y=y===void 0?null:y,y!==null&&(l.callback=y),o=ea(t,l,r),o!==null&&(lr(o,t,r),Zs(o,t,r))}function t2(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var o=t.retryLane;t.retryLane=o!==0&&o<r?o:r}}function Jp(t,r){t2(t,r),(t=t.alternate)&&t2(t,r)}function n2(t){if(t.tag===13){var r=za(t,67108864);r!==null&&lr(r,t,67108864),Jp(t,67108864)}}var uu=!0;function P3(t,r,o,l){var p=G.T;G.T=null;var y=K.p;try{K.p=2,Xp(t,r,o,l)}finally{K.p=y,G.T=p}}function L3(t,r,o,l){var p=G.T;G.T=null;var y=K.p;try{K.p=8,Xp(t,r,o,l)}finally{K.p=y,G.T=p}}function Xp(t,r,o,l){if(uu){var p=Yp(l);if(p===null)qp(t,r,l,du,o),i2(t,l);else if(M3(p,t,r,o,l))l.stopPropagation();else if(i2(t,l),r&4&&-1<N3.indexOf(t)){for(;p!==null;){var y=it(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var S=Ge(y.pendingLanes);if(S!==0){var D=y;for(D.pendingLanes|=2,D.entangledLanes|=2;S;){var F=1<<31-Ft(S);D.entanglements[1]|=F,S&=~F}Ri(y),!(_t&6)&&(Qc=bn()+500,gl(0,!1))}}break;case 13:D=za(y,2),D!==null&&lr(D,y,2),Jc(),Jp(y,2)}if(y=Yp(l),y===null&&qp(t,r,l,du,o),y===p)break;p=y}p!==null&&l.stopPropagation()}else qp(t,r,l,null,o)}}function Yp(t){return t=Aa(t),Zp(t)}var du=null;function Zp(t){if(du=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=f(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 du=t,null}function r2(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(An()){case Nr:return 2;case In:return 8;case rn:case Vi:return 32;case Ur:return 268435456;default:return 32}default:return 32}}var em=!1,co=null,uo=null,fo=null,Cl=new Map,Sl=new Map,po=[],N3="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 i2(t,r){switch(t){case"focusin":case"focusout":co=null;break;case"dragenter":case"dragleave":uo=null;break;case"mouseover":case"mouseout":fo=null;break;case"pointerover":case"pointerout":Cl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sl.delete(r.pointerId)}}function El(t,r,o,l,p,y){return t===null||t.nativeEvent!==y?(t={blockedOn:r,domEventName:o,eventSystemFlags:l,nativeEvent:y,targetContainers:[p]},r!==null&&(r=it(r),r!==null&&n2(r)),t):(t.eventSystemFlags|=l,r=t.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),t)}function M3(t,r,o,l,p){switch(r){case"focusin":return co=El(co,t,r,o,l,p),!0;case"dragenter":return uo=El(uo,t,r,o,l,p),!0;case"mouseover":return fo=El(fo,t,r,o,l,p),!0;case"pointerover":var y=p.pointerId;return Cl.set(y,El(Cl.get(y)||null,t,r,o,l,p)),!0;case"gotpointercapture":return y=p.pointerId,Sl.set(y,El(Sl.get(y)||null,t,r,o,l,p)),!0}return!1}function o2(t){var r=tt(t.target);if(r!==null){var o=d(r);if(o!==null){if(r=o.tag,r===13){if(r=f(o),r!==null){t.blockedOn=r,er(t.priority,function(){if(o.tag===13){var l=xr();l=Hn(l);var p=za(o,l);p!==null&&lr(p,o,l),Jp(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 fu(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var o=Yp(t.nativeEvent);if(o===null){o=t.nativeEvent;var l=new o.constructor(o.type,o);As=l,o.target.dispatchEvent(l),As=null}else return r=it(o),r!==null&&n2(r),t.blockedOn=o,!1;r.shift()}return!0}function a2(t,r,o){fu(t)&&o.delete(r)}function A3(){em=!1,co!==null&&fu(co)&&(co=null),uo!==null&&fu(uo)&&(uo=null),fo!==null&&fu(fo)&&(fo=null),Cl.forEach(a2),Sl.forEach(a2)}function pu(t,r){t.blockedOn===r&&(t.blockedOn=null,em||(em=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,A3)))}var mu=null;function s2(t){mu!==t&&(mu=t,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){mu===t&&(mu=null);for(var r=0;r<t.length;r+=3){var o=t[r],l=t[r+1],p=t[r+2];if(typeof l!="function"){if(Zp(l||o)===null)continue;break}var y=it(o);y!==null&&(t.splice(r,3),r-=3,ep(y,{pending:!0,data:p,method:o.method,action:l},l,p))}}))}function Tl(t){function r(F){return pu(F,t)}co!==null&&pu(co,t),uo!==null&&pu(uo,t),fo!==null&&pu(fo,t),Cl.forEach(r),Sl.forEach(r);for(var o=0;o<po.length;o++){var l=po[o];l.blockedOn===t&&(l.blockedOn=null)}for(;0<po.length&&(o=po[0],o.blockedOn===null);)o2(o),o.blockedOn===null&&po.shift();if(o=(t.ownerDocument||t).$$reactFormReplay,o!=null)for(l=0;l<o.length;l+=3){var p=o[l],y=o[l+1],S=p[jt]||null;if(typeof y=="function")S||s2(o);else if(S){var D=null;if(y&&y.hasAttribute("formAction")){if(p=y,S=y[jt]||null)D=S.formAction;else if(Zp(p)!==null)continue}else D=S.action;typeof D=="function"?o[l+1]=D:(o.splice(l,3),l-=3),s2(o)}}}function tm(t){this._internalRoot=t}nm.prototype.render=tm.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(s(409));var o=r.current;e2(o,xr(),t,r,null,null)},nm.prototype.unmount=tm.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;e2(t.current,2,null,t,null,null),Jc(),r[L]=null}};function nm(t){this._internalRoot=t}nm.prototype.unstable_scheduleHydration=function(t){if(t){var r=pi();t={blockedOn:null,target:t,priority:r};for(var o=0;o<po.length&&r!==0&&r<po[o].priority;o++);po.splice(o,0,t),o===0&&o2(t)}};var l2=i.version;if(l2!=="19.1.1")throw Error(s(527,l2,"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=g(r),t=t===null?null:w(t),t=t===null?null:t.stateNode,t};var I3={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hu.isDisabled&&hu.supportsFiber)try{Ht=hu.inject(I3),Qt=hu}catch{}}e.createRoot=function(t,r){if(!c(t))throw Error(s(299));var o=!1,l="",p=MT,y=AT,S=IT,D=null;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(y=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError),r.unstable_transitionCallbacks!==void 0&&(D=r.unstable_transitionCallbacks)),r=D3(t,1,!1,null,null,o,l,p,y,S,D,null),t[L]=r.current,Mb(t),new tm(r)}})),Xu=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=_o()})),ch="Expected a function";function O_(e,n){var i;if(typeof n!="function")throw TypeError(ch);return e=Y3(e),function(){return--e>0&&(i=n.apply(this,arguments)),e<=1&&(n=void 0),i}}var P_=O_;function L_(e){return P_(2,e)}let uh;Tm=L_,uh=Math.max;function N_(e){if(!(e&&e.length))return[];var n=0;return e=tR(e,function(i){if(eR(i))return n=uh(i.length,n),!0}),J3(n,function(i){return X3(e,nR(i))})}var M_=Z3(N_);km=function(e,n){if(e==null)throw Error(n||`Expected value but got ${e}`)},BigInt.prototype.toJSON=function(){return JSON.rawJSON(this.toString())},Im=function(e){try{return JSON.parse(e,(n,i)=>ld(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:ld(i):ld(i))}catch{return{}}},Sw=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 ld(e){return typeof e=="object"&&e&&"$bigint"in e&&typeof e.$bigint=="string"?BigInt(e.$bigint):e}var dh="abcdefghijklmnopqrstuvwxyz",fh=dh+dh.toUpperCase(),ph=new Set;go={create(){let e=0,n;do{let i="";for(let a=0;a<4;a++)i+=fh[Math.floor(Math.random()*fh.length)];n=i,e++}while(ph.has(n)&&e<100);if(e>=100)throw Error("Failed to generate unique CellId after 100 attempts");return ph.add(n),n}},ur={create(e){return fn(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=ur.findElement(n);if(i)return i;let a=n.getRootNode();if(n=a instanceof ShadowRoot?a.host:n.parentElement,n===a)break}return null}},tw=function(e){let n=null,i=ur.findElementThroughShadowDOMs(e);return i&&(n=ur.parse(i.id)),n},qu={parse(e){return e.getAttribute("object-id")},parseOrThrow(e){let n=qu.parse(e);return fn(n,"<marimo-ui-element/> missing object-id attribute"),n}},__={create(e){return`output-${e}`}},Dm=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)}},Nu=function(e){return Im(e??"")},X2=function(e){return ni.mapValues(e.dataset,n=>typeof n=="string"?Nu(n):n)},iw=function(e,n){let i=e.parentElement?qu.parse(e.parentElement):void 0;return i&&n.has(i)?n.lookupValue(i):Nu(e.dataset.initialValue)},ql=function(){if(iR())return document.title||null;if(oR()){let i=Dm.getFilename();if(i)return i}let e=document.querySelector("marimo-filename");km(e,"marimo-filename tag not found");let n=e.innerHTML;return n.length===0?null:n};var A_=Symbol("");Gw=function(e,n){return Fe(e,function(i,a,s){a(this,n(i(this),s))})};function cd(e,n){let i=null,a=new Map,s=new Set,c=f=>{let m;if(n===void 0)m=a.get(f);else for(let[w,_]of a)if(n(w,f)){m=_;break}if(m!==void 0)if(i!=null&&i(m[1],f))c.remove(f);else return m[0];let g=e(f);return a.set(f,[g,Date.now()]),d("CREATE",f,g),g},d=(f,m,g)=>{for(let w of s)w({type:f,param:m,atom:g})};return c.unstable_listen=f=>(s.add(f),()=>{s.delete(f)}),c.getParams=()=>a.keys(),c.remove=f=>{if(n===void 0){if(!a.has(f))return;let[m]=a.get(f);a.delete(f),d("REMOVE",f,m)}else for(let[m,[g]]of a)if(n(m,f)){a.delete(m),d("REMOVE",m,g);break}},c.setShouldRemove=f=>{if(i=f,i)for(let[m,[g,w]]of a)i(w,m)&&(a.delete(m),d("REMOVE",m,g))},c}var ud=(e,n,i)=>(n.has(i)?n:n.set(i,e())).get(i),I_=new WeakMap,j_=(e,n,i,a)=>ud(e,ud(()=>new WeakMap,ud(()=>new WeakMap,I_,n),i),a);function q_(e,n,i=Object.is){return j_(()=>{let a=Symbol(),s=([d,f])=>{if(f===a)return n(d);let m=n(d,f);return i(f,m)?f:m},c=Fe(d=>{let f=d(c);return s([d(e),f])});return c.init=a,c},e,n,i)}var mh=(e,n,i)=>(n.has(i)?n:n.set(i,e())).get(i),z_=new WeakMap,F_=(e,n,i)=>mh(e,mh(()=>new WeakMap,z_,n),i),B_={},hh=e=>!!e.write,H_=e=>typeof e=="function";function V_(e,n){return F_(()=>{let i=new WeakMap,a=(d,f)=>{let m=i.get(d);if(m)return m;let g=f&&i.get(f),w=[],_=[];return d.forEach((C,E)=>{let T=n?n(C):E;_[E]=T;let A=g&&g.atomList[g.keyList.indexOf(T)];if(A){w[E]=A;return}let H=V=>{let W=V(s),M=V(e),Q=a(M,W==null?void 0:W.arr).keyList.indexOf(T);if(Q<0||Q>=M.length){let pe=d[a(d).keyList.indexOf(T)];if(pe)return pe;throw Error("splitAtom: index out of bounds for read")}return M[Q]};w[E]=hh(e)?Fe(H,(V,W,M)=>{let Q=V(s),pe=V(e),P=a(pe,Q==null?void 0:Q.arr).keyList.indexOf(T);if(P<0||P>=pe.length)throw Error("splitAtom: index out of bounds for write");let I=H_(M)?M(pe[P]):M;Object.is(pe[P],I)||W(e,[...pe.slice(0,P),I,...pe.slice(P+1)])}):Fe(H)}),m=g&&g.keyList.length===_.length&&g.keyList.every((C,E)=>C===_[E])?g:{arr:d,atomList:w,keyList:_},i.set(d,m),m},s=Fe(d=>{let f=d(s);return a(d(e),f==null?void 0:f.arr)});s.init=void 0;let c=hh(e)?Fe(d=>d(s).atomList,(d,f,m)=>{switch(m.type){case"remove":{let g=d(c).indexOf(m.atom);if(g>=0){let w=d(e);f(e,[...w.slice(0,g),...w.slice(g+1)])}break}case"insert":{let g=m.before?d(c).indexOf(m.before):d(c).length;if(g>=0){let w=d(e);f(e,[...w.slice(0,g),m.value,...w.slice(g)])}break}case"move":{let g=d(c).indexOf(m.atom),w=m.before?d(c).indexOf(m.before):d(c).length;if(g>=0&&w>=0){let _=d(e);g<w?f(e,[..._.slice(0,g),..._.slice(g+1,w),_[g],..._.slice(w)]):f(e,[..._.slice(0,w),_[g],..._.slice(w,g),..._.slice(g+1)])}break}}}):Fe(d=>d(s).atomList);return c},e,n||B_)}var gh=e=>typeof(e==null?void 0:e.then)=="function";function yh(e=()=>{try{return window.localStorage}catch{return}},n){var f;let i,a,s={getItem:(m,g)=>{var C;let w=E=>{if(E||(E=""),i!==E){try{a=JSON.parse(E,n==null?void 0:n.reviver)}catch{return g}i=E}return a},_=((C=e())==null?void 0:C.getItem(m))??null;return gh(_)?_.then(w):w(_)},setItem:(m,g)=>{var w;return(w=e())==null?void 0:w.setItem(m,JSON.stringify(g,n==null?void 0:n.replacer))},removeItem:m=>{var g;return(g=e())==null?void 0:g.removeItem(m)}},c=m=>(g,w,_)=>m(g,C=>{let E;try{E=JSON.parse(C||"")}catch{E=_}w(E)}),d;try{d=(f=e())==null?void 0:f.subscribe}catch{}return!d&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(d=(m,g)=>{if(!(e()instanceof window.Storage))return()=>{};let w=_=>{_.storageArea===e()&&_.key===m&&g(_.newValue)};return window.addEventListener("storage",w),()=>{window.removeEventListener("storage",w)}}),d&&(s.subscribe=c(d)),s}var $_=yh();Lu=function(e,n,i=$_,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,f)=>{let m=typeof f=="function"?f(c(s)):f;return m===A_?(d(s,n),i.removeItem(e)):gh(m)?m.then(g=>(d(s,g),i.setItem(e,g))):(d(s,m),i.setItem(e,m))})},Fn=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=vh(d.value,n,i,a);else if(d.get!=null)d.get=vh(d.get,n,i,a);else throw"Only put a Memoize() decorator on a method or get accessor."}};var dd=new Map;function vh(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 f=this[s];if(Array.isArray(a))for(let m of a)dd.has(m)?dd.get(m).push(f):dd.set(m,[f]);if(n||c.length>0||i>0){let m;m=n===!0?c.map(_=>_.toString()).join("!"):n?n.apply(this,c):c[0];let g=`${m}__timestamp`,w=!1;if(i>0)if(!f.has(g))w=!0;else{let _=f.get(g);w=Date.now()-_>i}f.has(m)&&!w?d=f.get(m):(d=e.apply(this,c),f.set(m,d),i>0&&f.set(g,Date.now()))}else{let m=this;f.has(m)?d=f.get(m):(d=e.apply(this,c),f.set(m,d))}return d}}ms=Fe(ql()),fw=Fe(void 0);var W_=class{constructor(){Ce(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 U_(){let{hasLocalStorage:e,hasSessionStorage:n}=qR();return e?window.localStorage:n?window.sessionStorage:new W_}fs=U_();let Ai;_w=class{constructor(e,n=fs){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)}},Du=class{constructor(e,n,i=fs){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)}},ih=class extends Du{constructor(e,n,i){let a=st.get(ms);super(n,i),this.filename=a;try{this.unsubscribeFromFilename=st.sub(ms,()=>{let s=st.get(ms);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))}},Ai="marimo:notebook-col-sizes";function K_(){return{widths:[]}}var ga=new ih(Ai,p2({widths:Q3(K3([U3(),W3("contentWidth")]).default("contentWidth"))}),K_);W2={getColumnWidth:e=>ga.get(Ai).widths[e]??"contentWidth",saveColumnWidth:(e,n)=>{let i=ga.get(Ai).widths;if(i[e])i[e]=n;else{for(;i.length<=e;)i.push("contentWidth");i[e]=n}ga.set(Ai,{widths:i})},clearStorage:()=>{ga.remove(Ai)}};function Q_(e,n){let i=ga.get(Ai).widths,a=Ol(i,e,n);ga.set(Ai,{widths:a})}var bh,wh,_h,Rr,xh,kh,Ch,Sh,Bn,Eh,Th,Rh,Dh,Oh,Ph,tn;function Qn(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,f){return f(e,n,d)||d},c),s&&c.initializer!==void 0&&(c.value=c.initializer?c.initializer.call(s):void 0,c.initializer=void 0),c.initializer===void 0?(Object.defineProperty(e,n,c),null):c}let xo=(bh=Fn(),wh=Fn(),_h=Fn(),Rr=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}},Qn(Rr.prototype,"geDescendantCount",[bh],Object.getOwnPropertyDescriptor(Rr.prototype,"geDescendantCount"),Rr.prototype),Qn(Rr.prototype,"getDescendants",[wh],Object.getOwnPropertyDescriptor(Rr.prototype,"getDescendants"),Rr.prototype),Qn(Rr.prototype,"inOrderIds",[_h],Object.getOwnPropertyDescriptor(Rr.prototype,"inOrderIds"),Rr.prototype),Rr);var G_=0;let ya;ya=(xh=Fn(),kh=Fn(),Ch=Fn(),Sh=Fn(),Bn=class ha{constructor(n,i){this.nodes=n,this.id=i}static from(n){let i=`tree_${G_++}`;return new ha(n.map(a=>new xo(a,!1,[])),i)}static fromWithPreviousShape(n,i){var c;if(!i)return ha.from(n);let a=i.id,s=new ha(n.map(d=>new xo(d,!1,[])),a);for(let d of n)if(i.isCollapsed(d)){let f=((c=i._nodeMap.get(d))==null?void 0:c.children)??[];for(let m=f.length-1;m>=0;m--){let g=f[m];if(s._nodeMap.has(g.value)){s=s.collapse(d,g.value);break}}}return s}withNodes(n){return new ha(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(Ol(this.nodes,i,0))}moveToBack(n){let i=this.indexOfOrThrow(n);return this.withNodes(Ol(this.nodes,i,this.nodes.length-1))}collapse(n,i){let a=this.nodes.findIndex(m=>m.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(m=>m.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 f=c.splice(a+1,s-a);return c[a]=new xo(d.value,!0,f),this.withNodes(c)}collapseAll(n){let i=[...this.nodes];if(n.length===0)throw Error("No collapse ranges provided");if(n.length!==i.length)throw Error(`Collapse ranges length ${n.length} does not match tree length ${i.length}`);let a=i.length-1;for(;a>=0;){let s=i[a],c=n[a];if(!s.isCollapsed&&c){let{id:d,until:f}=c;if(d!==s.value)throw Error(`Node ${s.value} does not match collapse range id ${d}`);let m=f===void 0?i.length:i.findIndex(w=>w.value===f);if(m===-1)throw Error(`Node ${f} not found in tree`);if(m<a)throw Error(`Node ${f} is before node ${d}`);let g=i.splice(a+1,m-a);i[a]=new xo(s.value,!0,g),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 xo(s.value,!1,[]),a=O2(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 xo(a.value,!1,[]),n=O2(n,i+1,a.children)),i++}return this.withNodes(n)}move(n,i){return this.withNodes(Ol(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(D2(this.nodes,i,new xo(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(jR(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?[ha.from([]),this.withNodes(s)]:[this.withNodes(a),ha.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}},Qn(Bn.prototype,"topLevelIds",[xh],Object.getOwnPropertyDescriptor(Bn.prototype,"topLevelIds"),Bn.prototype),Qn(Bn.prototype,"inOrderIds",[kh],Object.getOwnPropertyDescriptor(Bn.prototype,"inOrderIds"),Bn.prototype),Qn(Bn.prototype,"idSet",[Ch],Object.getOwnPropertyDescriptor(Bn.prototype,"idSet"),Bn.prototype),Qn(Bn.prototype,"_nodeMap",[Sh],Object.getOwnPropertyDescriptor(Bn.prototype,"_nodeMap"),Bn.prototype),Bn),zl=(Eh=Fn(),Th=Fn(),Rh=Fn(),Dh=Fn(),Oh=Fn(),Ph=Fn(),tn=class Nn{constructor(n){this.columns=n,n.length===0&&(this.columns=[ya.from([])])}static from(n){return new Nn(n.map(i=>ya.from(i)))}static fromWithPreviousShape(n,i){if(!i)return Nn.from([n]);let a=i.getColumns(),s=Array.from({length:a.length},()=>[]),c=0;for(let d of n){let f=a.findIndex(m=>m.idSet.has(d));f===-1?s[c].push(d):(c=f,s[f].push(d))}return new Nn(s.map((d,f)=>ya.fromWithPreviousShape(d,a[f])))}isEmpty(){return this.columns.length===0?!0:this.columns.every(n=>n.nodes.length===0)}static fromIdsAndColumns(n){let i=Math.max(1,...n.map(([,c])=>(c??0)+1)),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 Nn.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 Nn(this.columns.flatMap(a=>a.id===n?[a,ya.from(i)]:[a]))}insertBreakpoint(n){let i=this.findWithId(n),[a,s]=i.split(n);return new Nn(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 Nn(s)}mergeAllColumns(){if(this.columns.length<=1)return this;let n=this.columns.flatMap(a=>a.nodes),i=this.columns[0];return new Nn([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),f=[...this.columns],m=f[c],g=m.nodes.findIndex(C=>C.value===i);if(g===-1)throw Error(`Node ${i} not found in column ${n}`);let w=m.nodes[g];f[c]=m.withNodes(m.nodes.filter((C,E)=>E!==g));let _=f[d];if(s){let C=_.indexOfOrThrow(s);f[d]=_.withNodes(D2(_.nodes,C,w))}else f[d]=_.withNodes([w,..._.nodes]);return new Nn(f)}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 Q_(a,s),new Nn(Ol([...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=ya.from([n]);return new Nn([...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 Nn(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 Nn(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 Nn(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 Nn(a):this}},Qn(tn.prototype,"isEmpty",[Eh],Object.getOwnPropertyDescriptor(tn.prototype,"isEmpty"),tn.prototype),Qn(tn.prototype,"topLevelIds",[Th],Object.getOwnPropertyDescriptor(tn.prototype,"topLevelIds"),tn.prototype),Qn(tn.prototype,"inOrderIds",[Rh],Object.getOwnPropertyDescriptor(tn.prototype,"inOrderIds"),tn.prototype),Qn(tn.prototype,"idLength",[Dh],Object.getOwnPropertyDescriptor(tn.prototype,"idLength"),tn.prototype),Qn(tn.prototype,"_columnMap",[Oh],Object.getOwnPropertyDescriptor(tn.prototype,"_columnMap"),tn.prototype),Qn(tn.prototype,"getColumnIds",[Ph],Object.getOwnPropertyDescriptor(tn.prototype,"getColumnIds"),tn.prototype),tn);let fd,pd,md,Lh,hd,Nh,Mh,Ah,Ih,jh,qh,zh,gd,yd,Fh,vd,bd;fd=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})),pd=ke((e=>{var n=e&&e.__extends||(function(){var P=function(I,$){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(de,fe){de.__proto__=fe}||function(de,fe){for(var be in fe)Object.prototype.hasOwnProperty.call(fe,be)&&(de[be]=fe[be])},P(I,$)};return function(I,$){if(typeof $!="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");P(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(P){for(var I,$=1,de=arguments.length;$<de;$++)for(var fe in I=arguments[$],I)Object.prototype.hasOwnProperty.call(I,fe)&&(P[fe]=I[fe]);return P},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.cloneNode=e.hasChildren=e.isDocument=e.isDirective=e.isComment=e.isText=e.isCDATA=e.isTag=e.Element=e.Document=e.CDATA=e.NodeWithChildren=e.ProcessingInstruction=e.Comment=e.Text=e.DataNode=e.Node=void 0;var a=fd(),s=(function(){function P(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(P.prototype,"parentNode",{get:function(){return this.parent},set:function(I){this.parent=I},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"previousSibling",{get:function(){return this.prev},set:function(I){this.prev=I},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"nextSibling",{get:function(){return this.next},set:function(I){this.next=I},enumerable:!1,configurable:!0}),P.prototype.cloneNode=function(I){return I===void 0&&(I=!1),Q(this,I)},P})();e.Node=s;var c=(function(P){n(I,P);function I($){var de=P.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(P){n(I,P);function I(){var $=P!==null&&P.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 f=(function(P){n(I,P);function I(){var $=P!==null&&P.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=f;var m=(function(P){n(I,P);function I($,de){var fe=P.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=m;var g=(function(P){n(I,P);function I($){var de=P.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=g;var w=(function(P){n(I,P);function I(){var $=P!==null&&P.apply(this,arguments)||this;return $.type=a.ElementType.CDATA,$}return Object.defineProperty(I.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),I})(g);e.CDATA=w;var _=(function(P){n(I,P);function I(){var $=P!==null&&P.apply(this,arguments)||this;return $.type=a.ElementType.Root,$}return Object.defineProperty(I.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),I})(g);e.Document=_;var C=(function(P){n(I,P);function I($,de,fe,be){fe===void 0&&(fe=[]),be===void 0&&(be=$==="script"?a.ElementType.Script:$==="style"?a.ElementType.Style:a.ElementType.Tag);var Y=P.call(this,fe)||this;return Y.name=$,Y.attribs=de,Y.type=be,Y}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,be;return{name:de,value:$.attribs[de],namespace:(fe=$["x-attribsNamespace"])==null?void 0:fe[de],prefix:(be=$["x-attribsPrefix"])==null?void 0:be[de]}})},enumerable:!1,configurable:!0}),I})(g);e.Element=C;function E(P){return(0,a.isTag)(P)}e.isTag=E;function T(P){return P.type===a.ElementType.CDATA}e.isCDATA=T;function A(P){return P.type===a.ElementType.Text}e.isText=A;function H(P){return P.type===a.ElementType.Comment}e.isComment=H;function V(P){return P.type===a.ElementType.Directive}e.isDirective=V;function W(P){return P.type===a.ElementType.Root}e.isDocument=W;function M(P){return Object.prototype.hasOwnProperty.call(P,"children")}e.hasChildren=M;function Q(P,I){I===void 0&&(I=!1);var $;if(A(P))$=new d(P.data);else if(H(P))$=new f(P.data);else if(E(P)){var de=I?pe(P.children):[],fe=new C(P.name,i({},P.attribs),de);de.forEach(function(Ee){return Ee.parent=fe}),P.namespace!=null&&(fe.namespace=P.namespace),P["x-attribsNamespace"]&&(fe["x-attribsNamespace"]=i({},P["x-attribsNamespace"])),P["x-attribsPrefix"]&&(fe["x-attribsPrefix"]=i({},P["x-attribsPrefix"])),$=fe}else if(T(P)){var de=I?pe(P.children):[],be=new w(de);de.forEach(function(ie){return ie.parent=be}),$=be}else if(W(P)){var de=I?pe(P.children):[],Y=new _(de);de.forEach(function(ie){return ie.parent=Y}),P["x-mode"]&&(Y["x-mode"]=P["x-mode"]),$=Y}else if(V(P)){var we=new m(P.name,P.data);P["x-name"]!=null&&(we["x-name"]=P["x-name"],we["x-publicId"]=P["x-publicId"],we["x-systemId"]=P["x-systemId"]),$=we}else throw Error(`Not implemented yet: ${P.type}`);return $.startIndex=P.startIndex,$.endIndex=P.endIndex,P.sourceCodeLocation!=null&&($.sourceCodeLocation=P.sourceCodeLocation),$}e.cloneNode=Q;function pe(P){for(var I=P.map(function(de){return Q(de,!0)}),$=1;$<I.length;$++)I[$].prev=I[$-1],I[$-1].next=I[$];return I}})),md=ke((e=>{var n=e&&e.__createBinding||(Object.create?(function(f,m,g,w){w===void 0&&(w=g);var _=Object.getOwnPropertyDescriptor(m,g);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[g]}}),Object.defineProperty(f,w,_)}):(function(f,m,g,w){w===void 0&&(w=g),f[w]=m[g]})),i=e&&e.__exportStar||function(f,m){for(var g in f)g!=="default"&&!Object.prototype.hasOwnProperty.call(m,g)&&n(m,f,g)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var a=fd(),s=pd();i(pd(),e);var c={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},d=(function(){function f(m,g,w){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof g=="function"&&(w=g,g=c),typeof m=="object"&&(g=m,m=void 0),this.callback=m??null,this.options=g??c,this.elementCB=w??null}return f.prototype.onparserinit=function(m){this.parser=m},f.prototype.onreset=function(){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},f.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},f.prototype.onerror=function(m){this.handleCallback(m)},f.prototype.onclosetag=function(){this.lastNode=null;var m=this.tagStack.pop();this.options.withEndIndices&&(m.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(m)},f.prototype.onopentag=function(m,g){var w=this.options.xmlMode?a.ElementType.Tag:void 0,_=new s.Element(m,g,void 0,w);this.addNode(_),this.tagStack.push(_)},f.prototype.ontext=function(m){var g=this.lastNode;if(g&&g.type===a.ElementType.Text)g.data+=m,this.options.withEndIndices&&(g.endIndex=this.parser.endIndex);else{var w=new s.Text(m);this.addNode(w),this.lastNode=w}},f.prototype.oncomment=function(m){if(this.lastNode&&this.lastNode.type===a.ElementType.Comment){this.lastNode.data+=m;return}var g=new s.Comment(m);this.addNode(g),this.lastNode=g},f.prototype.oncommentend=function(){this.lastNode=null},f.prototype.oncdatastart=function(){var m=new s.Text(""),g=new s.CDATA([m]);this.addNode(g),m.parent=g,this.lastNode=m},f.prototype.oncdataend=function(){this.lastNode=null},f.prototype.onprocessinginstruction=function(m,g){var w=new s.ProcessingInstruction(m,g);this.addNode(w)},f.prototype.handleCallback=function(m){if(typeof this.callback=="function")this.callback(m,this.dom);else if(m)throw m},f.prototype.addNode=function(m){var g=this.tagStack[this.tagStack.length-1],w=g.children[g.children.length-1];this.options.withStartIndices&&(m.startIndex=this.parser.startIndex),this.options.withEndIndices&&(m.endIndex=this.parser.endIndex),g.children.push(m),w&&(m.prev=w,w.next=m),m.parent=g,this.lastNode=null},f})();e.DomHandler=d,e.default=d})),Lh=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")})),hd=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatAttributes=s,e.escapeSpecialCharacters=d,e.revertEscapedCharacters=f,e.formatDOM=m;var n=md(),i=Lh();function a(g){return i.CASE_SENSITIVE_TAG_NAMES_MAP[g]}function s(g){for(var w={},_=0,C=g.length;_<C;_++){var E=g[_];w[E.name]=E.value}return w}function c(g){return g=g.toLowerCase(),a(g)||g}function d(g){return g.replace(i.CARRIAGE_RETURN_REGEX,i.CARRIAGE_RETURN_PLACEHOLDER)}function f(g){return g.replace(i.CARRIAGE_RETURN_PLACEHOLDER_REGEX,i.CARRIAGE_RETURN)}function m(g,w,_){w===void 0&&(w=null);for(var C=[],E,T=0,A=g.length;T<A;T++){var H=g[T];switch(H.nodeType){case 1:var V=c(H.nodeName);E=new n.Element(V,s(H.attributes)),E.children=m(V==="template"?H.content.childNodes:H.childNodes,E);break;case 3:E=new n.Text(f(H.nodeValue));break;case 8:E=new n.Comment(H.nodeValue);break;default:continue}var W=C[T-1]||null;W&&(W.next=E),E.parent=w,E.prev=W,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}})),Nh=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=H;var n=hd(),i="html",a="head",s="body",c=/<([a-zA-Z]+[0-9]?)/,d=/<head[^]*>/i,f=/<body[^]*>/i,m=function(V,W){throw Error("This browser does not support `document.implementation.createHTMLDocument`")},g=function(V,W){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";g=function(V,W){return W&&(V=`<${W}>${V}</${W}>`),_.parseFromString(V,C)},m=g}if(typeof document=="object"&&document.implementation){var E=document.implementation.createHTMLDocument();m=function(V,W){if(W){var M=E.documentElement.querySelector(W);return M&&(M.innerHTML=V),E}return E.documentElement.innerHTML=V,E}}var T=typeof document=="object"&&document.createElement("template"),A;T&&T.content&&(A=function(V){return T.innerHTML=V,T.content.childNodes});function H(V){var W,M;V=(0,n.escapeSpecialCharacters)(V);var Q=V.match(c),pe=Q&&Q[1]?Q[1].toLowerCase():"";switch(pe){case i:var P=g(V);if(!d.test(V)){var $=P.querySelector(a);(W=$==null?void 0:$.parentNode)==null||W.removeChild($)}if(!f.test(V)){var $=P.querySelector(s);(M=$==null?void 0:$.parentNode)==null||M.removeChild($)}return P.querySelectorAll(i);case a:case s:var I=m(V).querySelectorAll(pe);return f.test(V)&&d.test(V)?I[0].parentNode.childNodes:I;default:if(A)return A(V);var $=m(V,s).querySelector(s);return $.childNodes}}})),Mh=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(Nh()),a=hd(),s=/<(![a-zA-Z\s]+)>/;function c(d){if(typeof d!="string")throw TypeError("First argument must be a string");if(!d)return[];var f=d.match(s),m=f?f[1]:void 0;return(0,a.formatDOM)((0,i.default)(d),null,m)}})),Ah=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}})),Ih=ke((e=>{var n=0,i=1,a=2,s=3,c=4,d=5,f=6;function m(M){return w.hasOwnProperty(M)?w[M]:null}function g(M,Q,pe,P,I,$,de){this.acceptsBooleans=Q===a||Q===s||Q===c,this.attributeName=P,this.attributeNamespace=I,this.mustUseProperty=pe,this.propertyName=M,this.type=Q,this.sanitizeURL=$,this.removeEmptyString=de}var w={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(M=>{w[M]=new g(M,n,!1,M,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([M,Q])=>{w[M]=new g(M,i,!1,Q,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(M=>{w[M]=new g(M,a,!1,M.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(M=>{w[M]=new g(M,a,!1,M,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(M=>{w[M]=new g(M,s,!1,M.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(M=>{w[M]=new g(M,s,!0,M,null,!1,!1)}),["capture","download"].forEach(M=>{w[M]=new g(M,c,!1,M,null,!1,!1)}),["cols","rows","size","span"].forEach(M=>{w[M]=new g(M,f,!1,M,null,!1,!1)}),["rowSpan","start"].forEach(M=>{w[M]=new g(M,d,!1,M.toLowerCase(),null,!1,!1)});var _=/[\-\:]([a-z])/g,C=M=>M[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(M=>{let Q=M.replace(_,C);w[Q]=new g(Q,i,!1,M,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(M=>{let Q=M.replace(_,C);w[Q]=new g(Q,i,!1,M,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(M=>{let Q=M.replace(_,C);w[Q]=new g(Q,i,!1,M,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(M=>{w[M]=new g(M,i,!1,M.toLowerCase(),null,!1,!1)});var E="xlinkHref";w[E]=new g("xlinkHref",i,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(M=>{w[M]=new g(M,i,!1,M.toLowerCase(),null,!0,!0)});var{CAMELCASE:T,SAME:A,possibleStandardNames:H}=Ah(),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]*$")),W=Object.keys(H).reduce((M,Q)=>{let pe=H[Q];return pe===A?M[Q]=Q:pe===T?M[Q.toLowerCase()]=Q:M[Q]=pe,M},{});e.BOOLEAN=s,e.BOOLEANISH_STRING=a,e.NUMERIC=d,e.OVERLOADED_BOOLEAN=c,e.POSITIVE_NUMERIC=f,e.RESERVED=n,e.STRING=i,e.getPropertyInfo=m,e.isCustomAttribute=V,e.possibleStandardNames=W})),jh=ke(((e,n)=>{var i=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,a=/\n/g,s=/^\s*/,c=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d=/^:\s*/,f=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,m=/^[;\s]*/,g=/^\s+|\s+$/g,w=`
|
|
14
|
-
`,_="/",C="*",E="",T="comment",A="declaration";n.exports=function(V,W){if(typeof V!="string")throw TypeError("First argument must be a string");if(!V)return[];W||(W={});var M=1,Q=1;function pe(X){var G=X.match(a);G&&(M+=G.length);var K=X.lastIndexOf(w);Q=~K?X.length-K:Q+X.length}function P(){var X={line:M,column:Q};return function(G){return G.position=new I(X),be(),G}}function I(X){this.start=X,this.end={line:M,column:Q},this.source=W.source}I.prototype.content=V;var $=[];function de(X){var G=Error(W.source+":"+M+":"+Q+": "+X);if(G.reason=X,G.filename=W.source,G.line=M,G.column=Q,G.source=V,W.silent)$.push(G);else throw G}function fe(X){var G=X.exec(V);if(G){var K=G[0];return pe(K),V=V.slice(K.length),G}}function be(){fe(s)}function Y(X){var G;for(X||(X=[]);G=we();)G!==!1&&X.push(G);return X}function we(){var X=P();if(!(_!=V.charAt(0)||C!=V.charAt(1))){for(var G=2;E!=V.charAt(G)&&(C!=V.charAt(G)||_!=V.charAt(G+1));)++G;if(G+=2,E===V.charAt(G-1))return de("End of comment missing");var K=V.slice(2,G-2);return Q+=2,pe(K),V=V.slice(G),Q+=2,X({type:T,comment:K})}}function Ee(){var X=P(),G=fe(c);if(G){if(we(),!fe(d))return de("property missing ':'");var K=fe(f),Le=X({type:A,property:H(G[0].replace(i,E)),value:K?H(K[0].replace(i,E)):E});return fe(m),Le}}function ie(){var X=[];Y(X);for(var G;G=Ee();)G!==!1&&(X.push(G),Y(X));return X}return be(),ie()};function H(V){return V?V.replace(g,E):E}})),qh=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(jh());function a(s,c){var d=null;if(!s||typeof s!="string")return d;var f=(0,i.default)(s),m=typeof c=="function";return f.forEach(function(g){if(g.type==="declaration"){var w=g.property,_=g.value;m?c(w,_,g):_&&(d||(d={}),d[w]=_)}}),d}})),zh=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(g){return!g||a.test(g)||n.test(g)},f=function(g,w){return w.toUpperCase()},m=function(g,w){return`${w}-`};e.camelCase=function(g,w){return w===void 0&&(w={}),d(g)?g:(g=g.toLowerCase(),g=w.reactCompat?g.replace(c,m):g.replace(s,m),g.replace(i,f))}})),ah=ke(((e,n)=>{var i=(e&&e.__importDefault||function(c){return c&&c.__esModule?c:{default:c}})(qh()),a=zh();function s(c,d){var f={};return!c||typeof c!="string"||(0,i.default)(c,function(m,g){m&&g&&(f[(0,a.camelCase)(m,d)]=g)}),f}s.default=s,n.exports=s})),gd=ke((e=>{var n=e&&e.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(e,"__esModule",{value:!0}),e.returnFirstArg=e.canTextBeChildOfNode=e.ELEMENTS_WITH_NO_TEXT_CHILDREN=e.PRESERVE_CUSTOM_ATTRIBUTES=void 0,e.isCustomComponent=c,e.setStyleProp=f;var i=yu(),a=n(ah()),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(m,g){return m.includes("-")?!s.has(m):!!(g&&typeof g.is=="string")}var d={reactCompat:!0};function f(m,g){if(typeof m=="string"){if(!m.trim()){g.style={};return}try{g.style=(0,a.default)(m,d)}catch{g.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(m){return!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(m.name)},e.returnFirstArg=function(m){return m}})),yd=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var n=Ih(),i=gd(),a=["checked","value"],s=["input","select","textarea"],c={reset:!0,submit:!0};function d(m,g){m===void 0&&(m={});var w={},_=!!(m.type&&c[m.type]);for(var C in m){var E=m[C];if((0,n.isCustomAttribute)(C)){w[C]=E;continue}var T=C.toLowerCase(),A=f(T);if(A){var H=(0,n.getPropertyInfo)(A);switch(a.includes(A)&&s.includes(g)&&!_&&(A=f("default"+T)),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)(m.style,w),w}function f(m){return n.possibleStandardNames[m]}})),Fh=ke((e=>{var n=e&&e.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=d;var i=yu(),a=n(yd()),s=gd(),c={cloneElement:i.cloneElement,createElement:i.createElement,isValidElement:i.isValidElement};function d(m,g){g===void 0&&(g={});for(var w=[],_=typeof g.replace=="function",C=g.transform||s.returnFirstArg,E=g.library||c,T=E.cloneElement,A=E.createElement,H=E.isValidElement,V=m.length,W=0;W<V;W++){var M=m[W];if(_){var Q=g.replace(M,W);if(H(Q)){V>1&&(Q=T(Q,{key:Q.key||W})),w.push(C(Q,M,W));continue}}if(M.type==="text"){var pe=!M.data.trim().length;if(pe&&M.parent&&!(0,s.canTextBeChildOfNode)(M.parent)||g.trim&&pe)continue;w.push(C(M.data,M,W));continue}var P=M,I={};f(P)?((0,s.setStyleProp)(P.attribs.style,P.attribs),I=P.attribs):P.attribs&&(I=(0,a.default)(P.attribs,P.name));var $=void 0;switch(M.type){case"script":case"style":M.children[0]&&(I.dangerouslySetInnerHTML={__html:M.children[0].data});break;case"tag":M.name==="textarea"&&M.children[0]?I.defaultValue=M.children[0].data:M.children&&M.children.length&&($=d(M.children,g));break;default:continue}V>1&&(I.key=W),w.push(C(A(M.name,I,$),M,W))}return w.length===1?w[0]:w}function f(m){return s.PRESERVE_CUSTOM_ATTRIBUTES&&m.type==="tag"&&(0,s.isCustomComponent)(m.name,m.attribs)}})),vd=ke((e=>{var n=e&&e.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToDOM=e.domToReact=e.attributesToProps=e.Text=e.ProcessingInstruction=e.Element=e.Comment=void 0,e.default=d;var i=n(Mh());e.htmlToDOM=i.default,e.attributesToProps=n(yd()).default;var a=n(Fh());e.domToReact=a.default;var s=md();Object.defineProperty(e,"Comment",{enumerable:!0,get:function(){return s.Comment}}),Object.defineProperty(e,"Element",{enumerable:!0,get:function(){return s.Element}}),Object.defineProperty(e,"ProcessingInstruction",{enumerable:!0,get:function(){return s.ProcessingInstruction}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return s.Text}});var c={lowerCaseAttributeNames:!1};function d(f,m){if(typeof f!="string")throw TypeError("First argument must be a string");return f?(0,a.default)((0,i.default)(f,(m==null?void 0:m.htmlparser2)||c),m):[]}})),bd=Kt(vd(),1),bo=Kt(vd(),1),sh=bd.default.default||bd.default;let $l;$l=(e,n)=>{let[i,...a]=n.split("."),s=(e.attribs.class||"").split(" ");return e.tagName===i&&a.every(c=>s.includes(c))},Ww=e=>{var n;return e&&$l(e,"span.nb")&&e.firstChild instanceof bo.Text&&((n=e.firstChild.nodeValue)==null?void 0:n.includes("__marimo__"))},rh=function(e){var n,i,a;if(e instanceof bo.Element&&e.firstChild instanceof bo.Text&&$l(e,"span.nb")){let s=e.next;if(s&&s instanceof bo.Text){let c=s.next;if(c&&c instanceof bo.Element&&c.firstChild instanceof bo.Text&&$l(c,"span.m")){let d=Number.parseInt(c.firstChild.nodeValue||"0",10);if((n=e.firstChild.nodeValue)!=null&&n.includes("__marimo__")){let f=(i=/__marimo__cell_(\w+)_/.exec(e.firstChild.nodeValue))==null?void 0:i[1];if(f&&d)return{kind:"cell",cellId:f,lineNumber:d}}else{let f=(a=/"(.+?)"/.exec(e.firstChild.nodeValue))==null?void 0:a[1];if(f&&d)return{kind:"file",filePath:f,lineNumber:d}}}}}return null},zm=function(e){let n=[];return sh(e,{replace:i=>{let a=rh(i);if(a)return n.push(a),"dummy"}}),n};function Bh(e){return n=>{let i=!1;for(let a of n)a&&(i=e(a)||i);return i}}const J_=Bh(fR),X_=Bh(uR);Uu=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 f=e.state.selection.main.head,m=d.lineAt(f),g=m.number,w=f-m.from,_=e.state.update({changes:{from:0,to:d.length,insert:n}}).state.doc,C;if(g<=_.lines){let E=_.line(g),T=E.length;C=E.from+Math.min(w,T)}else C=_.line(_.lines).to;e.dispatch({changes:{from:0,to:d.length,insert:n},selection:{anchor:C},effects:s,userEvent:c})}else e.dispatch({changes:{from:0,to:d.length,insert:n},effects:s,userEvent:c})},pa=function(){return Dl.define({combine:e=>e[0]})};const Hh=pa(),Vh=pa(),wd=pa(),_d=pa(),$h=pa();i_=function({completionConfig:e,hotkeys:n,placeholderType:i,lspConfig:a,diagnosticsConfig:s}){return[Hh.of(e),Vh.of(n),wd.of(i),$h.of({...a,diagnostics:s})]},Vu=new bu;function Y_(e){return Object.values(e.cellRuntime).some(n=>n.status==="running")}function Z_(e){return Object.values(e.cellRuntime).filter(n=>n.status==="running"||n.status==="queued").length}function ex(e){return $m(e).length>0}p_=function(e){return e.cellIds.inOrderIds.map(n=>e.cellData[n])};function tx({cellHandles:e}){let n={};for(let[i,a]of ni.entries(e))a.current&&(n[i]=a.current.editorView);return n}Ym=function(e){let{cellIds:n,cellData:i}=e,a=[];for(let s of n.inOrderIds)i[s].config.disabled&&a.push(s);return a},eh=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 nx(e){return e.history.length>0}zw=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"})}},$m=function(e){let{cellIds:n,cellData:i,cellRuntime:a}=e;return n.inOrderIds.filter(s=>Gm({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))},Gm=function({executionTime:e,status:n,errored:i,interrupted:a,stopped:s}){return e===null&&n!=="queued"&&n!=="running"&&!(i||a||s)};let va;Dt=Dl.define({combine:e=>e[0]}),da=Dl.define({combine:e=>e[0]}),va=ho.define(),Yu=async function(e){let{sendFormat:n}=Pi(),i=ni.mapValues(e,s=>ai(s)),a=await n({codes:i,lineLength:rm().formatting.line_length});for(let[s,c]of ni.entries(a.codes)){let d=s,f=i[d],m=e[d];m&&c!==f&&(m.state.facet(Dt).updateCellCode({cellId:d,code:c,formattingChange:!0}),hs(m,c))}},t_=function(){return Yu(tx(Wu()))};async function rx(e){let{formatDialect:n,duckdb:i}=await ue(async()=>{let{formatDialect:g,duckdb:w}=await import("./esm-DuHka6En.js").then(async _=>(await _.__tla,_));return{formatDialect:g,duckdb:w}},__vite__mapDeps([0,1]),import.meta.url),a=e.state.field(Tr),s=yR(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],f=e.state.facet(Dt),m=e.state.facet(_d);f.updateCellCode({cellId:m,code:d,formattingChange:!0}),Uu(e,c,{effects:[va.of(!0)]})}var ix=Kt(Xu(),1),B=Kt(sR(),1);function ox(e,n){let i=document.createElement("div"),a;return{dom:i,mount(){a=(0,ix.createRoot)(i),a.render((0,B.jsx)(u2,{store:st,children:(0,B.jsx)(n,{view:e})}))},update(){a==null||a.render((0,B.jsx)(u2,{store:st,children:(0,B.jsx)(n,{view:e})}))},destroy(){a==null||a.unmount()}}}function ge(e){return new E2(S2.define(e))}function Ii(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 ax=[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 Ii("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 Ii("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 Ii("MSSQL")}}),ce.of({name:"MySQL",load(){return Ii("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 Ii("PLSQL")}}),ce.of({name:"PostgreSQL",load(){return Ii("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 Ii("StandardSQL")}}),ce.of({name:"SQLite",load(){return Ii("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())}})],Wh=new WeakMap,sx=/(\n|\r\n?|\u2028|\u2029)/g,lx=/^\s*/,cx=/\S/,ux=Array.prototype.slice,xd=48,Uh=57,Kh=97,dx=102,Qh=65,fx=70;Vl=function(e){if(typeof e=="string")return Xh([e])[0];if(typeof e=="function")return function(){let a=ux.call(arguments);return a[0]=Jh(a[0]),e.apply(this,a)};let n=Jh(e),i=Gh(n,0);for(let a=1;a<n.length;a++)i+=arguments[a]+Gh(n,a);return i};function Gh(e,n){let i=e[n];if(i===void 0)throw TypeError(`invalid cooked string at index ${n}`);return i}function Jh(e){let n=Wh.get(e);if(n)return n;let i=Xh(e.raw),a=i.map(mx);return Object.defineProperty(a,"raw",{value:Object.freeze(i)}),Object.freeze(a),Wh.set(e,a),a}function Xh(e){let n=e.map(s=>s.split(sx)),i;for(let s=0;s<n.length;s++){let c=n[s],d=s===0,f=s+1===n.length;if(d){if(c.length===1||c[0].length>0)throw Error("invalid content on opening line");c[1]=""}if(f){if(c.length===1||cx.test(c[c.length-1]))throw Error("invalid content on closing line");c[c.length-2]="",c[c.length-1]=""}for(let m=2;m<c.length;m+=2){let g=c[m],w=m+1===c.length&&!f,_=lx.exec(g)[0];if(!w&&_.length===g.length){c[m]="";continue}i=px(_,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 f=s[d],m=s[d+1];c+=f+m.slice(a)}return c})}function px(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 mx(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(Yh(e,a))return;n+="\0";break;case"x":{let c=kd(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=kd(e,a,d),a=d+1}else c=kd(e,a,a+4),a+=4;if(c===-1||c>1114111)return;n+=String.fromCodePoint(c);break}default:if(Yh(s,0))return;n+=s}i=a}return n+e.slice(i)}function Yh(e,n){let i=e.charCodeAt(n);return i>=xd&&i<=Uh}function kd(e,n,i){if(i>=e.length)return-1;let a=0;for(;n<i;n++){let s=hx(e.charCodeAt(n));if(s===-1)return-1;a=a*16+s}return a}function hx(e){return e>=xd&&e<=Uh?e-xd:e>=Kh&&e<=dx?e-Kh+10:e>=Qh&&e<=fx?e-Qh+10:-1}const Zh=["","f","r","fr","rf"];function gx(e){try{return Vl(`
|
|
18
|
-
${e}
|
|
19
|
-
`).trim()}catch{return e}}function yx(e){return HR.parse(e)}var vx=new Set(["(","[","{",",",")","]","}"]);function bx(e,n){return e.name==="ArgList"?{args:wx(e),kwargs:_x(e,n)}:(console.warn(`Not an ArgList, name: ${e.name}`),{args:[],kwargs:[]})}function wx(e){var a;e.firstChild();let n=[],i=e.name;do if(i=e.name,!vx.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 _x(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 f=n.slice(d.from,d.to).trim();i.push({key:s,value:f})}while(e.nextSibling());return i}function xx(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 kx(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 Cx(e){let n=[...Zh].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 Sx(e,n){return e.replaceAll(`\\${n}`,n)}var Ex=[['"""','"""'],["'''","'''"],['"','"'],["'","'"]],Tx=Zh.flatMap(e=>Ex.map(([n,i])=>[e+n,i])).map(([e,n])=>[e,RegExp(`^mo\\.md\\(\\s*${e0(e)}(.*)${e0(n)}\\s*\\)$`,"s")]);function e0(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var t0=class{constructor(){Ce(this,"type","markdown");Ce(this,"defaultCode",`mo.md(r"""
|
|
20
|
-
""")`);Ce(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 Tx){let s=e.match(a);if(s){let c=s[1],[d,f]=Cx(i);n.quotePrefix=d;let m=Sx(c,f),g=e.indexOf(c);return{code:Vl(`
|
|
23
|
-
${m}
|
|
24
|
-
`).trim(),offset:g,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=lm.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}},Rx=class{constructor(){Ce(this,"type","python");Ce(this,"defaultCode","");Ce(this,"defaultMetadata",{})}transformIn(e){return{code:e,offset:0,metadata:{}}}transformOut(e,n){return{code:e,offset:0}}isSupported(e){return!0}},Cd="__marimo_duckdb",n0=class{constructor(){Ce(this,"type","sql");Ce(this,"defaultMetadata",{dataframeName:"_df",quotePrefix:"f",commentLines:[],showOutput:!0,engine:Cd})}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=r0(e);return i?(n.dataframeName=i.dfName,n.showOutput=i.output??!0,n.engine=i.engine??Cd,{code:Vl(`
|
|
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,f=`${d} = mo.sql(
|
|
29
|
-
${i}"""
|
|
30
|
-
`,m=e.replaceAll('"""',String.raw`\"""`),g=`
|
|
31
|
-
"""${s?"":`,
|
|
32
|
-
output=False`}${c===Cd?"":`,
|
|
33
|
-
engine=${c}`}
|
|
34
|
-
)`;return{code:[...a,f].join(`
|
|
35
|
-
`)+Ox(m)+g,offset:f.length+1}}isSupported(e){return e.trim()===""?!0:!e.includes("mo.sql")||e.split("mo.sql").length>2?!1:r0(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 Dx(e){do{if(e.name==="AssignStatement")return e.node;if(e.name!=="Comment")return null}while(e.next());return null}function r0(e){try{let n=yx(e).cursor();n.name==="Script"&&n.next();let i=Dx(n);if(!i||e.slice(i.to).trim().length>0)return null;let a=null,s=null,c,d,f=0,m=i.cursor();if(m.firstChild(),m.name==="VariableName"&&(a=e.slice(m.from,m.to)),!a)return null;for(;m.next();)if(m.name==="CallExpression"){let g=m.node.cursor(),w=!1;if(g.firstChild(),g.name==="MemberExpression"&&(w=e.slice(g.from,g.to)==="mo.sql"),!w)continue;for(;g.next();)if(g.name==="ArgList"){let{args:_,kwargs:C}=bx(g.node.cursor(),e);_.length===1&&(s=xx(_[0],e),f=_[0].from+kx(e.slice(_[0].from,_[0].to)));for(let{key:E,value:T}of C)switch(E){case"engine":c=T;break;case"output":d=T==="True";break}if(s==="")return{dfName:a,sqlString:"",engine:c,output:d,startPosition:f};break}break}return!a||!s?null:{dfName:a,sqlString:gx(s),engine:c,output:d,startPosition:f}}catch(n){return console.warn("Failed to parse SQL statement",n),null}}function Ox(e){return e.split(`
|
|
37
|
-
`).map(n=>n!=null&&n.trim()?` ${n}`:n).join(`
|
|
38
|
-
`)}function Px(e,n){return{get:()=>n.get(e),sub:i=>n.sub(e,()=>i(n.get(e)))}}function Lx(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}}Eu=function(e){return e?e.state.field(Tr).type:"python"};function Nx(e,n){return!e||Eu(e)===n?!1:e.state.doc.toString().trim()===""?!0:dr[n].isSupported(ai(e))}Wm=function(e,n,i={}){return!i.force&&!Nx(e,n)?!1:(Jm(e,{language:n}),n)};function Mx(e){return aa.of([{key:e.getHotkey("cell.format").key,preventDefault:!0,run:n=>(Yu({[n.state.facet(da)]:n}),!0)},{key:e.getHotkey("cell.viewAsMarkdown").key,preventDefault:!0,run:n=>{let i=Eu(n);if(i!=="markdown"&&i!=="python")return!1;let a=Wm(n,i==="python"?"markdown":"python",{force:!0});return a==="markdown"&&n.state.facet(Dt).afterToggleMarkdown(),a!==!1}}])}hw=function(){return en.updateListener.of(e=>{if(e.view.hasFocus&&e.heightChanged&&e.docChanged){if(e.transactions.some(i=>i.effects.some(a=>a.is(va))))return;let n=e.view.dom.getElementsByClassName("cm-activeLine cm-line");if(n.length===1){let i=n[0],a=document.getElementById("App");fn(a,"App not found"),Lx(i,{offset:{top:30,bottom:150},body:a})}}})};function Ax(){return{}}let Ix,jx,i0;({reducer:Ix,createActions:jx,valueAtom:vo,useActions:i0}=Pl(Ax,{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}})),Ow=()=>Kn(vo),Tw=function(){return i0()};var qx=Kt(Br(),1),o0="marimo:sidebar",a0=new Du(p2({selectedPanel:G3().optional().transform(e=>e),isSidebarOpen:f2(),isTerminalOpen:f2()}),zx);function zx(){return{selectedPanel:"variables",isSidebarOpen:!1,isTerminalOpen:!1}}let Fx,Bx,s0;({reducer:Fx,createActions:Bx,valueAtom:Pu,useActions:s0}=Pl(()=>a0.get(o0),{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)=>a0.set(o0,n)])),ow=()=>{let e=(0,qx.c)(2),n=Kn(Pu);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},a_=function(){return s0()},xm=Fe({terminal:!1,pylsp:!1,basedpyright:!1,ty:!1});function Wl(e){return st.get(xm)[e]??!1}zu=Fe({documentation:null});var l0=new Set(["FunctionDefinition","LambdaExpression","ArrayComprehensionExpression","SetComprehension","DictionaryComprehensionExpression","ComprehensionExpression","ClassDefinition"]);function Hx(e){let n=x2(e.state);if(!n||Wx(n))return[];let i=new Set(Object.keys(e.variables).filter(E=>{let T=e.variables[E];return T.dataType!=="module"&&!T.declaredBy.includes("setup")&&!T.declaredBy.includes(e.cellId)}));if(i.size===0)return[];let a=[],s=new Map,c=new Map,d=new Map;function f(E,T){var Q,pe,P,I,$,de,fe,be,Y,we,Ee;let A=E.cursor(),H=A.name,V=A.from,W=l0.has(H),M=T;switch(W&&(M=[...T,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 G=e.state.doc.sliceString(ie.from,ie.to),K=T[T.length-1]??-1;s.has(K)||s.set(K,new Set),(Q=s.get(K))==null||Q.add(G);break}while(ie.nextSibling());let X=E.cursor();X.firstChild();do if(X.name==="ParamList"){let G=X.node.cursor();G.firstChild();do if(G.name==="VariableName"){let K=e.state.doc.sliceString(G.from,G.to);(pe=s.get(V))==null||pe.add(K)}while(G.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 G=e.state.doc.sliceString(X.from,X.to);(P=s.get(V))==null||P.add(G)}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 G=e.state.doc.sliceString(ie.from,ie.to);(I=s.get(V))==null||I.add(G)}else if(X&&ie.name==="TupleExpression"){let G=ie.node.cursor();G.firstChild();do if(G.name==="VariableName"){let K=e.state.doc.sliceString(G.from,G.to);($=s.get(V))==null||$.add(K)}while(G.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),G=T[T.length-1]??-1;s.has(G)||s.set(G,new Set),(de=s.get(G))==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 G=X[X.length-1],K=E.cursor();K.firstChild();let Le=M[M.length-1]??-1;do K.from<G&&Sd(K,{currentScope:Le,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 G=e.state.doc.sliceString(ie.from,ie.to),K=M[M.length-1]??-1;s.has(K)||s.set(K,new Set),(fe=s.get(K))==null||fe.add(G)}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),G=M[M.length-1]??-1;s.has(G)||s.set(G,new Set),(be=s.get(G))==null||be.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 G=e.state.doc.sliceString(ie.from,ie.to),K=M[M.length-1]??-1;s.has(K)||s.set(K,new Set),(Y=s.get(K))==null||Y.add(G)}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 G=e.state.doc.sliceString(ie.from,ie.to),K=M[M.length-1]??-1;s.has(K)||s.set(K,new Set),(we=s.get(K))==null||we.add(G),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 G=e.state.doc.sliceString(ie.from,ie.to),K=M[M.length-1]??-1;s.has(K)||s.set(K,new Set),(Ee=s.get(K))==null||Ee.add(G),X=!1}while(ie.nextSibling());break}}C(A,ie=>{f(ie,M)})}function m(E,T,A){let H=d.get(T);return H?H.some(([V,W])=>V===E&&W<A):!1}function g(E,T,A){var H,V;for(let W of T)if(c.get(W)==="ClassDefinition"){if(m(E,W,A))return!0}else if((H=s.get(W))!=null&&H.has(E))return!0;return((V=s.get(-1))==null?void 0:V.has(E))??!1}function w(E,T){let A=E.cursor(),H=A.name,V=A.from,W=l0.has(H),M=T;if(W&&(M=[...T,V]),H==="VariableName"){let Q=e.state.doc.sliceString(A.from,A.to);_(Q,A)&&(g(Q,M,A.from)||a.push({from:A.from,to:A.to,variableName:Q}))}C(A,Q=>{w(Q,M)})}function _(E,T){return i.has(E)&&!Vx(T)&&!$x(T)}function C(E,T){if(E.firstChild())do T(E.node);while(E.nextSibling())}return f(n,[]),w(n,[]),a}function Vx(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 $x(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 Wx(e){let n=e.cursor();do if(n.name==="\u26A0"||n.type.isError)return!0;while(n.next());return!1}function Sd(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 Sd(a,n);while(a.nextSibling());break}case"ArrayExpression":{let a=e.node.cursor();a.firstChild();do Sd(a,n);while(a.nextSibling());break}}}var Ux=Oi.mark({class:"mo-cm-reactive-reference"});Cw=Oi.mark({class:"mo-cm-reactive-reference-hover"});var c0=ho.define(),Kx=class{constructor(e,n){Ce(this,"highlightDebounceMs",300);this.view=e,this.cellId=n,this.scheduleHighlighting=m2(()=>{this.runHighlighting()},this.highlightDebounceMs),this.variablesUnsubscribe=st.sub(vo,()=>{this.scheduleHighlighting()}),this.scheduleHighlighting()}update(e){(e.docChanged||e.focusChanged)&&this.scheduleHighlighting()}destroy(){this.scheduleHighlighting.cancel(),this.variablesUnsubscribe()}runHighlighting(){let e=Hx({state:this.view.state,cellId:this.cellId,variables:st.get(vo)});e.length>0&&Pe.debug(`Found ${e.length} reactive variables in cell ${this.cellId}`),queueMicrotask(()=>{this.view.dispatch({effects:c0.of(e)})})}};Iu=Rl.define({create(){return{decorations:Oi.none,ranges:[]}},update(e,n){let i={decorations:e.decorations.map(n.changes),ranges:e.ranges};for(let a of n.effects)a.is(c0)&&(i={decorations:Oi.set(a.value.map(s=>Ux.range(s.from,s.to))),ranges:a.value});return i},provide:e=>en.decorations.from(e,n=>n.decorations)});function Qx(e){return[Iu,sa.define(n=>new Kx(n,e))]}ew=function(e,n){return n?Qx(e):[]};function u0(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=rR()?"\u2318":"Ctrl",a.append(document.createTextNode("Jump to defining cell ")),a.append(s),a.append(document.createTextNode(" + Click")),i.append(a)}return i}Ru=new Cu("autocomplete-result",async(e,n)=>{let{sendCodeCompletionRequest:i}=Pi();await i({id:e,...n})});var Gx={param:3,property:2};const Ed={asCompletionResult(e,n){return{from:e-n.prefix_length,options:n.options.map(i=>({label:i.name,type:i.type,boost:Gx[i.type]??1,info:()=>u0(i.completion_info)})),validFor:/^\w*$/}},asHoverTooltip({position:e,message:n,limitToType:i,excludeTypes:a,exactName:s,showGoToDefinitionHint:c=!1}){let d=Jx(n.options,s);if(!d)return;let f=e-n.prefix_length,m=u0(d.completion_info,c);if(m&&!(i&&d.type!==i)&&!(a!=null&&a.includes(d.type)))return{pos:f,html:d.completion_info,end:f+d.name.length,above:!0,create:()=>({dom:m,resize:!1})}}};function Jx(e,n){if(e.length!==0){if(e.length===1)return e[0];if(n)return e.find(i=>i.name===n)}}w_=function(e){var n;return[(n=e==null?void 0:e.pylsp)!=null&&n.enabled&&Wl("pylsp")?[]:om(async(i,a)=>{let s=await d0({view:i,pos:a,excludeTypes:["tooltip"]});return s===null||s==="cancelled"?null:s},{hideOnChange:!0}),Zx]};async function d0({view:e,pos:n,excludeTypes:i}){var w;let a=ur.findElement(e.dom);if(!a)return Pe.error("Failed to find active cell."),null;let s=ur.parse(a.id),{startToken:c,endToken:d}=f0(e.state.doc,n),f=((w=e.state.field(Iu,!1))==null?void 0:w.ranges.some(_=>n>=_.from&&n<=_.to))??!1,m=await Ru.request({document:e.state.doc.slice(0,d).toString(),cellId:s});if(!m)return"cancelled";let g=e.state.doc.slice(c,d).toString();return Ed.asHoverTooltip({position:d,message:m,exactName:g,excludeTypes:i,showGoToDefinitionHint:f})??null}function f0(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 Xx(e){let{head:n}=e.selection.main,i=e.doc.sliceString(n-1,n);return/\w/.test(i)}var Yx=m2(async(e,n)=>{if(st.get(Pu).selectedPanel!=="documentation")return;let i=await d0({view:e,pos:n});i!=="cancelled"&&st.set(zu,{documentation:(i==null?void 0:i.html)??null})},300),Zx=en.updateListener.of(e=>{if(e.selectionSet&&Xx(e.state)){let n=e.state.selection.main.head;Yx(e.view,n)}});function p0(e,n){e.focus(),requestAnimationFrame(()=>{e.dispatch({selection:{anchor:n,head:n},effects:en.scrollIntoView(n,{y:"center"})})})}Au=function(e,n){let{state:i}=e,a=x2(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?(p0(e,c),!0):!1};function ek(e,n){return p0(e,e.state.doc.line(n).from),!0}function tk(e){let{from:n,to:i}=e.selection.main;if(n===i){let{startToken:a,endToken:s}=f0(e.doc,n);return e.doc.sliceString(a,s)}return e.doc.sliceString(n,i)}function nk(e,n){if(!n)return null;let i=e[n];return!i||i.declaredBy.length===0?null:i.declaredBy[0]}function rk(e){return e.startsWith("_")}Rm=function(e){let{state:n}=e,i=tk(n);return i?(N2(e),e.dispatch({effects:pR}),Cm(e,i)):!1},Cm=function(e,n){let i=ik(e,n);return i?Au(i,n):!1},J2=function(e,n){let i=m0(e);return i?ek(i,n):!1};function ik(e,n){if(rk(n))return e;let i=nk(st.get(vo),n);return i?m0(i):null}function m0(e){var n;return((n=st.get(ft).cellHandles[e].current)==null?void 0:n.editorView)??null}function ok(e){var n=e.Pos;function i(u,h,v){if(h.line===v.line&&h.ch>=v.ch-1){var b=u.getLine(h.line).charCodeAt(h.ch);55296<=b&&b<=55551&&(v.ch+=1)}return{start:h,end:v}}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"}],f=yn("");function m(u){u.setOption("disableInput",!0),u.setOption("showCursorWhenSelecting",!1),e.signal(u,"vim-mode-change",{mode:"normal"}),u.on("cursorActivity",qs),G(u),e.on(u.getInputField(),"paste",w(u))}function g(u){u.setOption("disableInput",!1),u.off("cursorActivity",qs),e.off(u.getInputField(),"paste",w(u)),u.state.vim=null,Wi&&clearTimeout(Wi)}function w(u){var h=u.state.vim;return h.onPasteFn||(h.onPasteFn=function(){h.insertMode||(u.setCursor(Ct(u.getCursor(),0,1)),Ht.enterInsertMode(u,{},h))}),h.onPasteFn}var _=/[\d]/,C=[e.isWordChar,function(u){return u&&!e.isWordChar(u)&&!/\s/.test(u)}],E=[function(u){return/\S/.test(u)}],T=["<",">"],A=["-",'"',".",":","_","/","+"],H=/^\w$/,V=/^[A-Z]$/;try{V=RegExp("^[\\p{Lu}]$","u")}catch{}function W(u,h){return h>=u.firstLine()&&h<=u.lastLine()}function M(u){return/^[a-z]$/.test(u)}function Q(u){return"()[]{}".indexOf(u)!=-1}function pe(u){return _.test(u)}function P(u){return V.test(u)}function I(u){return/^\s*$/.test(u)}function $(u){return".?!".indexOf(u)!=-1}function de(u,h){for(var v=0;v<h.length;v++)if(h[v]==u)return!0;return!1}var fe={};function be(u,h,v,b,x){if(h===void 0&&!x)throw Error("defaultValue is required unless callback is provided");if(v||(v="string"),fe[u]={type:v,defaultValue:h,callback:x},b)for(var k=0;k<b.length;k++)fe[b[k]]=fe[u];h&&Y(u,h)}function Y(u,h,v,b){var x=fe[u];b||(b={});var k=b.scope;if(!x)return Error("Unknown option: "+u);if(x.type=="boolean"){if(h&&h!==!0)return Error("Invalid argument: "+u+"="+h);h!==!1&&(h=!0)}x.callback?(k!=="local"&&x.callback(h,void 0),k!=="global"&&v&&x.callback(h,v)):(k!=="local"&&(x.value=x.type=="boolean"?!!h:h),k!=="global"&&v&&(v.state.vim.options[u]={value:h}))}function we(u,h,v){var b=fe[u];v||(v={});var x=v.scope;if(!b)return Error("Unknown option: "+u);if(b.callback){let k=h&&b.callback(void 0,h);return x!=="global"&&k!==void 0?k:x==="local"?void 0:b.callback()}else return(x!=="global"&&h&&h.state.vim.options[u]||x!=="local"&&b||{}).value}be("filetype",void 0,"string",["ft"],function(u,h){if(h!==void 0)if(u===void 0){let v=h.getOption("mode");return v=="null"?"":v}else{let v=u==""?"null":u;h.setOption("mode",v)}}),be("textwidth",80,"number",["tw"],function(u,h){if(h!==void 0){if(u===void 0)return h.getOption("textwidth");var v=Math.round(u);v>1&&h.setOption("textwidth",v)}});var Ee=function(){var u=100,h=-1,v=0,b=0,x=Array(u);function k(N,z,j){var se=x[h%u];function oe(ee){var _e=++h%u,xe=x[_e];xe&&xe.clear(),x[_e]=N.setBookmark(ee)}if(se){var Z=se.find();Z&&!Vt(Z,z)&&oe(z)}else oe(z);oe(j),v=h,b=h-u+1,b<0&&(b=0)}function R(N,z){h+=z,h>v?h=v:h<b&&(h=b);var j=x[(u+h)%u];if(j&&!j.find()){var se=z>0?1:-1,oe,Z=N.getCursor();do if(h+=se,j=x[(u+h)%u],j&&(oe=j.find())&&!Vt(Z,oe))break;while(h<v&&h>b)}return j}function O(N,z){var j=h,se=R(N,z);return h=j,se&&se.find()}return{cachedCursor:void 0,add:k,find:O,move:R}},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 h=K.macroModeState;h.onRecordingDone&&h.onRecordingDone(),h.onRecordingDone=void 0,h.isRecording=!1}enterMacroRecordMode(h,v){var b=K.registerController.getRegister(v);if(b){if(b.clear(),this.latestRegister=v,h.openDialog){var x=nr("span",{class:"cm-vim-message"},"recording @"+v);this.onRecordingDone=h.openDialog(x,function(){},{bottom:!0})}this.isRecording=!0}}}function G(u){return u.state.vim||(u.state.vim={inputState:new Yn,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 Le(){for(var u in K={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:Ee(),macroModeState:new X,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new An({}),searchHistoryController:new Nr,exCommandHistoryController:new Nr},fe){var h=fe[u];h.value=h.defaultValue}}class Qe{constructor(h,v){this.keyName=h,this.key=v.key,this.ctrlKey=v.ctrlKey,this.altKey=v.altKey,this.metaKey=v.metaKey,this.shiftKey=v.shiftKey}}var ut,Be={enterVimMode:m,leaveVimMode:g,buildKeyMap:function(){},getRegisterController:function(){return K.registerController},resetVimGlobalState_:Le,getVimGlobalState_:function(){return K},maybeInitVimState_:G,suppressErrorLogging:!1,InsertModeKey:Qe,map:function(u,h,v){Gt.map(u,h,v)},unmap:function(u,h){return Gt.unmap(u,h)},noremap:function(u,h,v){Gt.map(u,h,v,!0)},mapclear:function(u){var h=a.length,v=c,b=a.slice(0,h-v);if(a=a.slice(h-v),u)for(var x=b.length-1;x>=0;x--){var k=b[x];if(u!==k.context)if(k.context)this._mapCommand(k);else{var R=["normal","insert","visual"];for(var O in R)if(R[O]!==u){var N=Object.assign({},k);N.context=R[O],this._mapCommand(N)}}}},langmap:gt,vimKeyFromEvent:nn,setOption:Y,getOption:we,defineOption:be,defineEx:function(u,h,v){if(!h)h=u;else if(u.indexOf(h)!==0)throw Error('(Vim.defineEx) "'+h+'" is not a prefix of "'+u+'", command not registered');Aa[u]=v,Gt.commandMap_[h]={name:u,shortName:h,type:"api"}},handleKey:function(u,h,v){var b=this.findKey(u,h,v);if(typeof b=="function")return b()},multiSelectHandleKey:Bo,findKey:function(u,h,v){var b=G(u),x=u;function k(){var j=K.macroModeState;if(j.isRecording){if(h=="q")return j.exitMacroRecordMode(),kt(x),!0;v!="mapping"&&jo(j,h)}}function R(){if(h=="<Esc>"){if(b.visualMode)Je(x);else if(b.insertMode)Ir(x);else return;return kt(x),!0}}function O(){if(R())return!0;b.inputState.keyBuffer.push(h);var j=b.inputState.keyBuffer.join(""),se=h.length==1,oe=In.matchCommand(j,a,b.inputState,"insert"),Z=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)},we("insertModeEscKeysTimeout")),se){var ee=x.listSelections();(!Z||Z.removed.length!=ee.length)&&(Z=b.inputState.changeQueue=new ci),Z.inserted+=h;for(var _e=0;_e<ee.length;_e++){var xe=vt(ee[_e].anchor,ee[_e].head),je=On(ee[_e].anchor,ee[_e].head),Te=x.getRange(xe,x.state.overwrite?Ct(je,0,1):je);Z.removed[_e]=(Z.removed[_e]||"")+Te}}return!se}else oe.type=="full"&&(b.inputState.keyBuffer.length=0);if(b.expectLiteralNext=!1,ut&&window.clearTimeout(ut),oe.command&&Z){for(var ee=x.listSelections(),_e=0;_e<ee.length;_e++){var Ie=ee[_e].head;x.replaceRange(Z.removed[_e]||"",Ct(Ie,0,-Z.inserted.length),Ie,"+input")}K.macroModeState.lastInsertModeChanges.changes.pop()}return oe.command||kt(x),oe.command}function N(){if(k()||R())return!0;b.inputState.keyBuffer.push(h);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",Z=se[2]||se[1];b.inputState.operatorShortcut&&b.inputState.operatorShortcut.slice(-1)==Z&&(Z=b.inputState.operatorShortcut);var ee=In.matchCommand(Z,a,b.inputState,oe);return ee.type=="none"?(kt(x),!1):ee.type=="partial"?(ee.expectLiteralNext&&(b.expectLiteralNext=!0),!0):ee.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]),ee.command)}var z=b.insertMode?O():N();if(z===!1)return!b.insertMode&&(h.length===1||e.isMac&&/<A-.>/.test(h))?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):In.processCommand(x,b,z)}catch(j){throw x.state.vim=void 0,G(x),Be.suppressErrorLogging||console.log(j),j}return!0})}},handleEx:function(u,h){Gt.processCommand(u,h)},defineMotion:Vi,defineAction:Qt,defineOperator:ui,mapCommand:jr,_mapCommand:Ao,defineRegister:bn,exitVisualMode:Je,exitInsertMode:Ir},We=[],De=!1,Ne;function gn(u){if(!Ne)throw Error("No prompt to send key to");if(u[0]=="<"){var h=u.toLowerCase().slice(1,-1);if(h=h.split("-").pop()||"",h=="lt")u="<";else if(h=="space")u=" ";else if(h=="cr")u=`
|
|
39
|
-
`;else if(Ue[h]){var v=Ne.value||"",b={key:Ue[h],target:{value:v,selectionEnd:v.length,selectionStart:v.length}};Ne.onKeyDown&&Ne.onKeyDown(b,Ne.value,k),Ne&&Ne.onKeyUp&&Ne.onKeyUp(b,Ne.value,k);return}}if(u==`
|
|
40
|
-
`){var x=Ne;Ne=null,x.onClose&&x.onClose(x.value)}else Ne.value=(Ne.value||"")+u;function k(R){Ne&&(typeof R=="string"?Ne.value=R:Ne=null)}}function It(u,h,v){var b=De;if(v){if(We.indexOf(v)!=-1)return;We.push(v),De=v.noremap!=0}try{for(var x=G(u),k=/<(?:[CSMA]-)*\w+>|./gi,R;R=k.exec(h);){var O=R[0],N=x.insertMode;if(Ne){gn(O);continue}if(!Be.handleKey(u,O,"mapping")&&N&&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],Cn(u,O);continue}else O=O[0],k.lastIndex=R.index+1}u.replaceSelection(O)}}}finally{if(We.pop(),De=We.length?b:!1,!We.length&&Ne){var j=Ne;Ne=null,No(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"},ln={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 nn(u,h){var k;var v=u.key;if(!ln[v]){v.length>1&&v[0]=="n"&&(v=v.replace("Numpad","")),v=Dn[v]||v;var b="";if(u.ctrlKey&&(b+="C-"),u.altKey&&(b+="A-"),u.metaKey&&(b+="M-"),e.isMac&&b=="A-"&&v.length==1&&(b=b.slice(2)),(b||v.length>1)&&u.shiftKey&&(b+="S-"),h&&!h.expectLiteralNext&&v.length==1){if(f.keymap&&v in f.keymap)(f.remapCtrl!=0||!b)&&(v=f.keymap[v]);else if(v.charCodeAt(0)>128&&!s[v]){var x=((k=u.code)==null?void 0:k.slice(-1))||"";u.shiftKey||(x=x.toLowerCase()),x&&(v=x,!b&&u.altKey&&(b="A-"))}}return b+=v,b.length>1&&(b="<"+b+">"),b}}function gt(u,h){f.string!==u&&(f=yn(u)),f.remapCtrl=h}function yn(u){let h={};if(!u)return{keymap:h,string:""};function v(b){return b.split(/\\?(.)/).filter(Boolean)}return u.split(/((?:[^\\,]|\\.)+),/).map(b=>{if(!b)return;let x=b.split(/((?:[^\\;]|\\.)+);/);if(x.length==3){let k=v(x[1]),R=v(x[2]);if(k.length!==R.length)return;for(let O=0;O<k.length;++O)h[k[O]]=R[O]}else if(x.length==1){let k=v(b);if(k.length%2!=0)return;for(let R=0;R<k.length;R+=2)h[k[R]]=k[R+1]}}),{keymap:h,string:u}}be("langmap",void 0,"string",["lmap"],function(u,h){if(u===void 0)return f.string;gt(u)});class Yn{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(h){this.operator?this.motionRepeat=this.motionRepeat.concat(h):this.prefixRepeat=this.prefixRepeat.concat(h)}getRepeat(){var h=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(h=1,this.prefixRepeat.length>0&&(h*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(h*=parseInt(this.motionRepeat.join(""),10))),h}}function kt(u,h){u.state.vim.inputState=new Yn,u.state.vim.expectLiteralNext=!1,e.signal(u,"vim-command-done",h)}function ci(){this.removed=[],this.inserted=""}class vn{constructor(h,v,b){this.clear(),this.keyBuffer=[h||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!v,this.blockwise=!!b}setText(h,v,b){this.keyBuffer=[h||""],this.linewise=!!v,this.blockwise=!!b}pushText(h,v){v&&(this.linewise||this.keyBuffer.push(`
|
|
42
|
-
`),this.linewise=!0),this.keyBuffer.push(h)}pushInsertModeChanges(h){this.insertModeChanges.push(ie(h))}pushSearchQuery(h){this.searchQueries.push(h)}clear(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1}toString(){return this.keyBuffer.join("")}}function bn(u,h){var v=K.registerController.registers;if(!u||u.length!=1)throw Error("Register name must be 1 character");if(v[u])throw Error("Register already defined "+u);v[u]=h,A.push(u)}class An{constructor(h){this.registers=h,this.unnamedRegister=h['"']=new vn,h["."]=new vn,h[":"]=new vn,h["/"]=new vn,h["+"]=new vn}pushText(h,v,b,x,k){if(h!=="_"){x&&b.charAt(b.length-1)!==`
|
|
43
|
-
`&&(b+=`
|
|
44
|
-
`);var R=this.isValidRegister(h)?this.getRegister(h):null;if(!R||!h){switch(v){case"yank":this.registers[0]=new vn(b,x,k);break;case"delete":case"change":b.indexOf(`
|
|
45
|
-
`)==-1?this.registers["-"]=new vn(b,x):(this.shiftNumericRegisters_(),this.registers[1]=new vn(b,x));break}this.unnamedRegister.setText(b,x,k);return}P(h)?R.pushText(b,x):R.setText(b,x,k),h==="+"&&navigator.clipboard.writeText(b),this.unnamedRegister.setText(R.toString(),x)}}getRegister(h){return this.isValidRegister(h)?(h=h.toLowerCase(),this.registers[h]||(this.registers[h]=new vn),this.registers[h]):this.unnamedRegister}isValidRegister(h){return h&&(de(h,A)||H.test(h))}shiftNumericRegisters_(){for(var h=9;h>=2;h--)this.registers[h]=this.getRegister(""+(h-1))}}class Nr{constructor(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}nextMatch(h,v){var b=this.historyBuffer,x=v?-1:1;this.initialPrefix===null&&(this.initialPrefix=h);for(var k=this.iterator+x;v?k>=0:k<b.length;k+=x)for(var R=b[k],O=0;O<=R.length;O++)if(this.initialPrefix==R.substring(0,O))return this.iterator=k,R;if(k>=b.length)return this.iterator=b.length,this.initialPrefix;if(k<0)return h}pushInput(h){var v=this.historyBuffer.indexOf(h);v>-1&&this.historyBuffer.splice(v,1),h.length&&this.historyBuffer.push(h)}reset(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}}var In={matchCommand:function(u,h,v,b){var x=di(u,h,b,v),k=x.full[0];if(!k)return x.partial.length?{type:"partial",expectLiteralNext:x.partial.length==1&&x.partial[0].keys.slice(-11)=="<character>"}:{type:"none"};if(k.keys.slice(-11)=="<character>"||k.keys.slice(-10)=="<register>"){var R=Ar(u);if(!R||R.length>1)return{type:"clear"};v.selectedCharacter=R}return{type:"full",command:k}},processCommand:function(u,h,v){switch(h.inputState.repeatOverride=v.repeatOverride,v.type){case"motion":this.processMotion(u,h,v);break;case"operator":this.processOperator(u,h,v);break;case"operatorMotion":this.processOperatorMotion(u,h,v);break;case"action":this.processAction(u,h,v);break;case"search":this.processSearch(u,h,v);break;case"ex":case"keyToEx":this.processEx(u,h,v);break}},processMotion:function(u,h,v){h.inputState.motion=v.motion,h.inputState.motionArgs=Ft(v.motionArgs),this.evalInput(u,h)},processOperator:function(u,h,v){var b=h.inputState;if(b.operator)if(b.operator==v.operator){b.motion="expandToLine",b.motionArgs={linewise:!0,repeat:1},this.evalInput(u,h);return}else kt(u);b.operator=v.operator,b.operatorArgs=Ft(v.operatorArgs),v.keys.length>1&&(b.operatorShortcut=v.keys),v.exitVisualBlock&&(h.visualBlock=!1,bt(u)),h.visualMode&&this.evalInput(u,h)},processOperatorMotion:function(u,h,v){var b=h.visualMode,x=Ft(v.operatorMotionArgs);x&&b&&x.visualLine&&(h.visualLine=!0),this.processOperator(u,h,v),b||this.processMotion(u,h,v)},processAction:function(u,h,v){var b=h.inputState,x=b.getRepeat(),k=!!x,R=Ft(v.actionArgs)||{repeat:1};b.selectedCharacter&&(R.selectedCharacter=b.selectedCharacter),v.operator&&this.processOperator(u,h,v),v.motion&&this.processMotion(u,h,v),(v.motion||v.operator)&&this.evalInput(u,h),R.repeat=x||1,R.repeatIsExplicit=k,R.registerName=b.registerName,kt(u),h.lastMotion=null,v.isEdit&&this.recordLastEdit(h,b,v),Ht[v.action](u,R,h)},processSearch:function(u,h,v){if(!u.getSearchCursor)return;var b=v.searchArgs.forward,x=v.searchArgs.wholeWordOnly;wn(u).setReversed(!b);var k=b?"/":"?",R=wn(u).getQuery(),O=u.getScrollInfo(),N="";function z(Te,Ie,ct){K.searchHistoryController.pushInput(Te),K.searchHistoryController.reset();try{hr(u,Te,Ie,ct)}catch{Ve(u,"Invalid regex: "+Te),kt(u);return}In.processMotion(u,h,{keys:"",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:v.searchArgs.toJumplist}})}function j(Te){u.scrollTo(O.left,O.top),z(Te,!0,!0);var Ie=K.macroModeState;Ie.isRecording&&js(Ie,Te)}function se(){return we("pcre")?"(JavaScript regexp: set pcre)":"(Vim regexp: set nopcre)"}function oe(Te,Ie,ct){var Xe=nn(Te),Ot,Pt;Xe=="<Up>"||Xe=="<Down>"?(Ot=Xe=="<Up>",Pt=Te.target?Te.target.selectionEnd:0,Ie=K.searchHistoryController.nextMatch(Ie,Ot)||"",ct(Ie),Pt&&Te.target&&(Te.target.selectionEnd=Te.target.selectionStart=Math.min(Pt,Te.target.value.length))):Xe&&Xe!="<Left>"&&Xe!="<Right>"&&K.searchHistoryController.reset(),N=Ie,Z()}function Z(){var Te;try{Te=hr(u,N,!0,!0)}catch{}Te?u.scrollIntoView(pc(u,!b,Te),30):(mi(u),u.scrollTo(O.left,O.top))}function ee(Te,Ie,ct){var Xe=nn(Te);Xe=="<Esc>"||Xe=="<C-c>"||Xe=="<C-[>"||Xe=="<BS>"&&Ie==""?(K.searchHistoryController.pushInput(Ie),K.searchHistoryController.reset(),hr(u,(R==null?void 0:R.source)||""),mi(u),u.scrollTo(O.left,O.top),e.e_stop(Te),kt(u),ct(),u.focus()):Xe=="<Up>"||Xe=="<Down>"?e.e_stop(Te):Xe=="<C-u>"&&(e.e_stop(Te),ct(""))}switch(v.searchArgs.querySrc){case"prompt":var _e=K.macroModeState;_e.isPlaying?z(_e.replaySearchQueries.shift()||"",!0,!1):No(u,{onClose:j,prefix:k,desc:nr("span",{$cursor:"pointer",onmousedown:function(Ie){Ie.preventDefault(),Y("pcre",!we("pcre")),this.textContent=se(),Z()}},se()),onKeyUp:oe,onKeyDown:ee});break;case"wordUnderCursor":var xe=Se(u,{noSymbol:!0}),je=!0;if(xe||(xe=Se(u,{noSymbol:!1}),je=!1),!xe){Ve(u,"No word under cursor"),kt(u);return}let Te=u.getLine(xe.start.line).substring(xe.start.ch,xe.end.ch);Te=je&&x?"\\b"+Te+"\\b":Qr(Te),K.jumpList.cachedCursor=u.getCursor(),u.setCursor(xe.start),z(Te,!0,!1);break}},processEx:function(u,h,v){function b(O){K.exCommandHistoryController.pushInput(O),K.exCommandHistoryController.reset(),Gt.processCommand(u,O),u.state.vim&&kt(u),mi(u)}function x(O,N,z){var j=nn(O),se,oe;(j=="<Esc>"||j=="<C-c>"||j=="<C-[>"||j=="<BS>"&&N=="")&&(K.exCommandHistoryController.pushInput(N),K.exCommandHistoryController.reset(),e.e_stop(O),kt(u),mi(u),z(),u.focus()),j=="<Up>"||j=="<Down>"?(e.e_stop(O),se=j=="<Up>",oe=O.target?O.target.selectionEnd:0,N=K.exCommandHistoryController.nextMatch(N,se)||"",z(N),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,N){var z=new e.StringStream(N),j={};try{if(Gt.parseInput_(u,z,j),j.commandName!="s"){mi(u);return}var se=Gt.matchCommand_(j.commandName);if(!se||(Gt.parseCommandArgs_(z,j,se),!j.argString))return;var oe=Lo(j.argString.slice(1),!0,!0);oe&&Jr(u,oe)}catch{}}if(v.type=="keyToEx")Gt.processCommand(u,v.exArgs.input);else{var R={onClose:b,onKeyDown:x,onKeyUp:k,prefix:":"};h.visualMode&&(R.value="'<,'>",R.selectValueOnOpen=!1),No(u,R)}},evalInput:function(u,h){var v=h.inputState,b=v.motion,x=v.motionArgs||{repeat:1},k=v.operator,R=v.operatorArgs||{},O=v.registerName,N=h.sel,z=Ge(h.visualMode?yt(u,N.head):u.getCursor("head")),j=Ge(h.visualMode?yt(u,N.anchor):u.getCursor("anchor")),se=Ge(z),oe=Ge(j),Z,ee,_e;if(k&&this.recordLastEdit(h,v),_e=v.repeatOverride===void 0?v.getRepeat():v.repeatOverride,_e>0&&x.explicitRepeat?x.repeatIsExplicit=!0:(x.noRepeat||!x.explicitRepeat&&_e===0)&&(_e=1,x.repeatIsExplicit=!1),v.selectedCharacter&&(x.selectedCharacter=R.selectedCharacter=v.selectedCharacter),x.repeat=_e,kt(u),b){var xe=rn[b](u,z,x,h,v);if(h.lastMotion=rn[b],!xe)return;if(x.toJumplist){var je=K.jumpList,Te=je.cachedCursor;Te?(tt(u,Te,xe),delete je.cachedCursor):tt(u,z,xe)}xe instanceof Array?(ee=xe[0],Z=xe[1]):Z=xe,Z||(Z=Ge(z)),h.visualMode?(h.visualBlock&&Z.ch===1/0||(Z=yt(u,Z,se)),ee&&(ee=yt(u,ee)),ee||(ee=oe),N.anchor=ee,N.head=Z,bt(u),pr(u,h,"<",lt(ee,Z)?ee:Z),pr(u,h,">",lt(ee,Z)?Z:ee)):k||(Z=yt(u,Z,se),u.setCursor(Z.line,Z.ch))}if(k){if(R.lastSel){ee=oe;var Ie=R.lastSel,ct=Math.abs(Ie.head.line-Ie.anchor.line),Xe=Math.abs(Ie.head.ch-Ie.anchor.ch);Z=Ie.visualLine?new n(oe.line+ct,oe.ch):Ie.visualBlock?new n(oe.line+ct,oe.ch+Xe):Ie.head.line==Ie.anchor.line?new n(oe.line,oe.ch+Xe):new n(oe.line+ct,oe.ch),h.visualMode=!0,h.visualLine=Ie.visualLine,h.visualBlock=Ie.visualBlock,N=h.sel={anchor:ee,head:Z},bt(u)}else h.visualMode&&(R.lastSel={anchor:Ge(N.anchor),head:Ge(N.head),visualBlock:h.visualBlock,visualLine:h.visualLine});var Ot,Pt,ze,Ke,Jt;if(h.visualMode){Ot=vt(N.head,N.anchor),Pt=On(N.head,N.anchor),ze=h.visualLine||R.linewise,Ke=h.visualBlock?"block":ze?"line":"char";var Xt=i(u,Ot,Pt);if(Jt=jt(u,{anchor:Xt.start,head:Xt.end},Ke),ze){var cn=Jt.ranges;if(Ke=="block")for(var Ho=0;Ho<cn.length;Ho++)cn[Ho].head.ch=St(u,cn[Ho].head.line);else Ke=="line"&&(cn[0].head=new n(cn[0].head.line+1,0))}}else{if(Ot=Ge(ee||oe),Pt=Ge(Z||se),lt(Pt,Ot)){var gc=Ot;Ot=Pt,Pt=gc}ze=x.linewise||R.linewise,ze?ne(u,Ot,Pt):x.forward&&q(u,Ot,Pt),Ke="char";var Qi=!x.inclusive||ze,Xt=i(u,Ot,Pt);Jt=jt(u,{anchor:Xt.start,head:Xt.end},Ke,Qi)}u.setSelections(Jt.ranges,Jt.primary),h.lastMotion=null,R.repeat=_e,R.registerName=O,R.linewise=ze;var Fs=Mr[k](u,R,Jt.ranges,oe,Z);h.visualMode&&Je(u,Fs!=null),Fs&&u.setCursor(Fs)}},recordLastEdit:function(u,h,v){var b=K.macroModeState;b.isPlaying||(u.lastEditInputState=h,u.lastEditActionCommand=v,b.lastInsertModeChanges.changes=[],b.lastInsertModeChanges.expectCursorActivityForChange=!1,b.lastInsertModeChanges.visualBlock=u.visualBlock?u.sel.head.line-u.sel.anchor.line:0)}},rn={moveToTopLine:function(u,h,v){var b=Ms(u).top+v.repeat-1;return new n(b,ye(u.getLine(b)))},moveToMiddleLine:function(u){var h=Ms(u),v=Math.floor((h.top+h.bottom)*.5);return new n(v,ye(u.getLine(v)))},moveToBottomLine:function(u,h,v){var b=Ms(u).bottom-v.repeat+1;return new n(b,ye(u.getLine(b)))},expandToLine:function(u,h,v){return new n(h.line+v.repeat-1,1/0)},findNext:function(u,h,v){var b=wn(u),x=b.getQuery();if(x){var k=!v.forward;k=b.isReversed()?!k:k,Jr(u,x);var R=pc(u,k,x,v.repeat);return R||Ve(u,"No match found "+x+(we("pcre")?" (set nopcre to use Vim regexps)":"")),R}},findAndSelectNextInclusive:function(u,h,v,b,x){var k=wn(u),R=k.getQuery();if(R){var O=!v.forward;O=k.isReversed()?!O:O;var N=mc(u,O,R,v.repeat,b);if(N){if(x.operator)return N;var z=N[0],j=new n(N[1].line,N[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()?v.forward?[se,z]:[se,j]:v.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,h,v,b){var x=Ma(u,b,v.selectedCharacter||"");return x?v.linewise?{line:x.line,ch:ye(u.getLine(x.line))}:x:null},moveToOtherHighlightedEnd:function(u,h,v,b){var x=b.sel;return b.visualBlock&&v.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,h,v,b){for(var x=h,k=0;k<v.repeat;k++){var R=x;for(var O in b.marks)if(M(O)){var N=b.marks[O].find();if(!(v.forward?lt(N,R):lt(R,N))&&!(v.linewise&&N.line==R.line)){var z=Vt(R,x),j=v.forward?Kr(R,N,x):Kr(x,N,R);(z||j)&&(x=N)}}}return v.linewise&&(x=new n(x.line,ye(u.getLine(x.line)))),x},moveByCharacters:function(u,h,v){var b=h,x=v.repeat,k=v.forward?b.ch+x:b.ch-x;return new n(b.line,k)},moveByLines:function(u,h,v,b){var x=h,k=x.ch;switch(b.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:k=b.lastHPos;break;default:b.lastHPos=k}var R=v.repeat+(v.repeatOffset||0),O=v.forward?x.line+R:x.line-R,N=u.firstLine(),z=u.lastLine(),j=u.findPosV(x,v.forward?R:-R,"line",b.lastHSPos);return(v.forward?j.line>O:j.line<O)&&(O=j.line,k=j.ch),O<N&&x.line==N?this.moveToStartOfLine(u,h,v,b):O>z&&x.line==z?$t(u,h,v,b,!0):(v.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,h,v,b){var x=h;switch(b.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:b.lastHSPos=u.charCoords(x,"div").left}var k=v.repeat,R=u.findPosV(x,v.forward?k:-k,"line",b.lastHSPos);if(R.hitSide)if(v.forward){var O={top:u.charCoords(R,"div").top+8,left:b.lastHSPos};R=u.coordsChar(O,"div")}else{var N=u.charCoords(new n(u.firstLine(),0),"div");N.left=b.lastHSPos,R=u.coordsChar(N,"div")}return b.lastHPos=R.ch,R},moveByPage:function(u,h,v){var b=h,x=v.repeat;return u.findPosV(b,v.forward?x:-x,"page")},moveByParagraph:function(u,h,v){var b=v.forward?1:-1;return lc(u,h,v.repeat,b).start},moveBySentence:function(u,h,v){var b=v.forward?1:-1;return Na(u,h,v.repeat,b)},moveByScroll:function(u,h,v,b){var x=u.getScrollInfo(),k=null,R=v.repeat;R||(R=x.clientHeight/(2*u.defaultTextHeight()));var O=u.charCoords(h,"local");if(v.repeat=R,k=rn.moveByDisplayLines(u,h,v,b),!k)return null;var N=u.charCoords(k,"local");return u.scrollTo(null,x.top+N.top-O.top),k},moveByWords:function(u,h,v){return ht(u,h,v.repeat,!!v.forward,!!v.wordEnd,!!v.bigWord)},moveTillCharacter:function(u,h,v){var b=v.repeat,x=tr(u,b,v.forward,v.selectedCharacter,h),k=v.forward?-1:1;return it(k,v),x?(x.ch+=k,x):null},moveToCharacter:function(u,h,v){var b=v.repeat;return it(0,v),tr(u,b,v.forward,v.selectedCharacter,h)||h},moveToSymbol:function(u,h,v){var b=v.repeat;return v.selectedCharacter&&He(u,b,v.forward,v.selectedCharacter)||h},moveToColumn:function(u,h,v,b){var x=v.repeat;return b.lastHPos=x-1,b.lastHSPos=u.charCoords(h,"div").left,Ss(u,x)},moveToEol:function(u,h,v,b){return $t(u,h,v,b,!1)},moveToFirstNonWhiteSpaceCharacter:function(u,h){var v=h;return new n(v.line,ye(u.getLine(v.line)))},moveToMatchedSymbol:function(u,h){for(var v=h,b=v.line,x=v.ch,k=u.getLine(b),R;x<k.length;x++)if(R=k.charAt(x),R&&Q(R)){var O=u.getTokenTypeAt(new n(b,x+1));if(O!=="string"&&O!=="comment")break}if(x<k.length){var N=R==="<"||R===">"?/[(){}[\]<>]/:/[(){}[\]]/;return u.findMatchingBracket(new n(b,x),{bracketRegex:N}).to}else return v},moveToStartOfLine:function(u,h){return new n(h.line,0)},moveToLineOrEdgeOfDocument:function(u,h,v){var b=v.forward?u.lastLine():u.firstLine();return v.repeatIsExplicit&&(b=v.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 h=u.getCursor();return h.sticky=="before"&&h.ch--,h},textObjectManipulation:function(u,h,v,b){var x={"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"},k={"'":!0,'"':!0,"`":!0},R=v.selectedCharacter||"";R=="b"?R="(":R=="B"&&(R="{");var O=!v.textObjectInner,N,z;if(x[R]){if(z=!0,N=mr(u,h,R,O),!N){var j=u.getSearchCursor(RegExp("\\"+R,"g"),h);j.find()&&(N=mr(u,j.from(),R,O))}}else if(k[R])z=!0,N=Es(u,h,R,O);else if(R==="W"||R==="w")for(var se=v.repeat||1;se-- >0;){var oe=Se(u,{inclusive:O,innerWord:!O,bigWord:R==="W",noSymbol:R==="W",multiline:!0},N&&N.end);oe&&(N||(N=oe),N.end=oe.end)}else if(R==="p")if(N=lc(u,h,v.repeat,0,O),v.linewise=!0,b.visualMode)b.visualLine||(b.visualLine=!0);else{var Z=b.inputState.operatorArgs;Z&&(Z.linewise=!0),N.end.line--}else if(R==="t")N=pt(u,h,O);else if(R==="s"){var ee=u.getLine(h.line);h.ch>0&&$(ee[h.ch])&&--h.ch;var _e=Oo(u,h,v.repeat,1,O),xe=Oo(u,h,v.repeat,-1,O);I(u.getLine(xe.line)[xe.ch])&&I(u.getLine(_e.line)[_e.ch-1])&&(xe={line:xe.line,ch:xe.ch+1}),N={start:xe,end:_e}}return N?u.state.vim.visualMode?Pn(u,N.start,N.end,z):[N.start,N.end]:null},repeatLastCharacterSearch:function(u,h,v){var b=K.lastCharacterSearch,x=v.repeat,k=v.forward===b.forward,R=(b.increment?1:0)*(k?-1:1);u.moveH(-R,"char"),v.inclusive=!!k;var O=tr(u,x,k,b.selectedCharacter);return O?(O.ch+=R,O):(u.moveH(R,"char"),h)}};function Vi(u,h){rn[u]=h}function Ur(u,h){for(var v=[],b=0;b<h;b++)v.push(u);return v}var Mr={change:function(u,h,v){var b,x,k=u.state.vim,R=v[0].anchor,O=v[0].head;if(k.visualMode)if(h.fullLine)O.ch=Number.MAX_VALUE,O.line--,u.setSelection(R,O),x=u.getSelection(),u.replaceSelection(""),b=R;else{x=u.getSelection();var N=Ur("",v.length);u.replaceSelections(N),b=vt(v[0].head,v[0].anchor)}else{x=u.getRange(R,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))}h.linewise&&(R=new n(R.line,ye(u.getLine(R.line))),O.line>R.line&&(O=new n(O.line-1,Number.MAX_VALUE))),u.replaceRange("",R,O),b=R}K.registerController.pushText(h.registerName,"change",x,h.linewise,v.length>1),Ht.enterInsertMode(u,{head:b},u.state.vim)},delete:function(u,h,v){var b,x,k=u.state.vim;if(k.visualBlock){x=u.getSelection();var R=Ur("",v.length);u.replaceSelections(R),b=vt(v[0].head,v[0].anchor)}else{var O=v[0].anchor,N=v[0].head;h.linewise&&N.line!=u.firstLine()&&O.line==u.lastLine()&&O.line==N.line-1&&(O.line==u.firstLine()?O.ch=0:O=new n(O.line-1,St(u,O.line-1))),x=u.getRange(O,N),u.replaceRange("",O,N),b=O,h.linewise&&(b=rn.moveToFirstNonWhiteSpaceCharacter(u,O))}return K.registerController.pushText(h.registerName,"delete",x,h.linewise,k.visualBlock),yt(u,b)},indent:function(u,h,v){var b=u.state.vim,x=b.visualMode&&h.repeat||1;if(b.visualBlock){for(var k=u.getOption("tabSize"),R=u.getOption("indentWithTabs")?" ":" ".repeat(k),O,N=v.length-1;N>=0;N--)if(O=vt(v[N].anchor,v[N].head),h.indentRight)u.replaceRange(R.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 Z=1;Z<R.length&&(oe=z[O.ch+j],oe===" ");Z++)j++}else break}u.replaceRange("",O,Ct(O,0,j))}return O}else if(u.indentMore)for(var se=0;se<x;se++)h.indentRight?u.indentMore():u.indentLess();else{var ee=v[0].anchor.line,_e=b.visualBlock?v[v.length-1].anchor.line:v[0].head.line;h.linewise&&_e--;for(var N=ee;N<=_e;N++)for(var se=0;se<x;se++)u.indentLine(N,h.indentRight)}return rn.moveToFirstNonWhiteSpaceCharacter(u,v[0].anchor)},indentAuto:function(u,h,v){return u.execCommand("indentAuto"),rn.moveToFirstNonWhiteSpaceCharacter(u,v[0].anchor)},hardWrap:function(u,h,v,b){if(u.hardWrap){var x=v[0].anchor.line,k=v[0].head.line;h.linewise&&k--;var R=u.hardWrap({from:x,to:k});return R>x&&h.linewise&&R--,h.keepCursor?b:new n(R,0)}},changeCase:function(u,h,v,b,x){for(var k=u.getSelections(),R=[],O=h.toLower,N=0;N<k.length;N++){var z=k[N],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+=P(oe)?oe.toLowerCase():oe.toUpperCase()}R.push(j)}return u.replaceSelections(R),h.shouldMoveCursor?x:!u.state.vim.visualMode&&h.linewise&&v[0].anchor.line+1==v[0].head.line?rn.moveToFirstNonWhiteSpaceCharacter(u,b):h.linewise?b:vt(v[0].anchor,v[0].head)},yank:function(u,h,v,b){var x=u.state.vim,k=u.getSelection(),R=x.visualMode?vt(x.sel.anchor,x.sel.head,v[0].head,v[0].anchor):b;return K.registerController.pushText(h.registerName,"yank",k,h.linewise,x.visualBlock),R},rot13:function(u,h,v,b,x){for(var k=u.getSelections(),R=[],O=0;O<k.length;O++){let N=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("");R.push(N)}return u.replaceSelections(R),h.shouldMoveCursor?x:!u.state.vim.visualMode&&h.linewise&&v[0].anchor.line+1==v[0].head.line?rn.moveToFirstNonWhiteSpaceCharacter(u,b):h.linewise?b:vt(v[0].anchor,v[0].head)}};function ui(u,h){Mr[u]=h}var Ht={jumpListWalk:function(u,h,v){if(!v.visualMode){var b=h.repeat||1,x=h.forward,k=K.jumpList.move(u,x?b:-b),R=k?k.find():void 0;R||(R=u.getCursor()),u.setCursor(R)}},scroll:function(u,h,v){if(!v.visualMode){var b=h.repeat||1,x=u.defaultTextHeight(),k=u.getScrollInfo().top,R=x*b,O=h.forward?k+R:k-R,N=Ge(u.getCursor()),z=u.charCoords(N,"local");if(h.forward)O>z.top?(N.line+=(O-z.top)/x,N.line=Math.ceil(N.line),u.setCursor(N),z=u.charCoords(N,"local"),u.scrollTo(null,z.top)):u.scrollTo(null,O);else{var j=O+u.getScrollInfo().clientHeight;j<z.bottom?(N.line-=(z.bottom-j)/x,N.line=Math.floor(N.line),u.setCursor(N),z=u.charCoords(N,"local"),u.scrollTo(null,z.bottom-u.getScrollInfo().clientHeight)):u.scrollTo(null,O)}}},scrollToCursor:function(u,h){var v=u.getCursor().line,b=u.charCoords(new n(v,0),"local"),x=u.getScrollInfo().clientHeight,k=b.top;switch(h.position){case"center":k=b.bottom-x/2;break;case"bottom":var R=new n(v,u.getLine(v).length-1),O=u.charCoords(R,"local").bottom-k;k=k-x+O;break}u.scrollTo(null,k)},replayMacro:function(u,h,v){var b=h.selectedCharacter||"",x=h.repeat||1,k=K.macroModeState;for(b=="@"?b=k.latestRegister||"":k.latestRegister=b;x--;)Is(u,v,k,b)},enterMacroRecordMode:function(u,h){var v=K.macroModeState,b=h.selectedCharacter;K.registerController.isValidRegister(b)&&v.enterMacroRecordMode(u,b)},toggleOverwrite:function(u){u.state.overwrite?(u.toggleOverwrite(!1),u.setOption("keyMap","vim-insert"),e.signal(u,"vim-mode-change",{mode:"insert"})):(u.toggleOverwrite(!0),u.setOption("keyMap","vim-replace"),e.signal(u,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(u,h,v){if(!u.getOption("readOnly")){v.insertMode=!0,v.insertModeRepeat=h&&h.repeat||1;var b=h?h.insertAt:null,x=v.sel,k=h.head||u.getCursor("head"),R=u.listSelections().length;if(b=="eol")k=new n(k.line,St(u,k.line));else if(b=="bol")k=new n(k.line,0);else if(b=="charAfter"){var O=i(u,k,Ct(k,0,1));k=O.end}else if(b=="firstNonBlank"){var O=i(u,k,rn.moveToFirstNonWhiteSpaceCharacter(u,k));k=O.end}else if(b=="startOfSelectedArea"){if(!v.visualMode)return;v.visualBlock?(k=new n(Math.min(x.head.line,x.anchor.line),Math.min(x.head.ch,x.anchor.ch)),R=Math.abs(x.head.line-x.anchor.line)+1):k=x.head.line<x.anchor.line?x.head:new n(x.anchor.line,0)}else if(b=="endOfSelectedArea"){if(!v.visualMode)return;v.visualBlock?(k=new n(Math.min(x.head.line,x.anchor.line),Math.max(x.head.ch,x.anchor.ch)+1),R=Math.abs(x.head.line-x.anchor.line)+1):k=x.head.line>=x.anchor.line?Ct(x.head,0,1):new n(x.anchor.line,0)}else if(b=="inplace"){if(v.visualMode)return}else b=="lastEdit"&&(k=Mo(u)||k);u.setOption("disableInput",!1),h&&h.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",qo),v.insertEnd&&v.insertEnd.clear(),v.insertEnd=u.setBookmark(k,{insertLeft:!0}),e.on(u.getInputField(),"keydown",Fo)),v.visualMode&&Je(u),Hn(u,k,R)}},toggleVisualMode:function(u,h,v){var b=h.repeat,x=u.getCursor(),k;if(v.visualMode)v.visualLine!=!!h.linewise||v.visualBlock!=!!h.blockwise?(v.visualLine=!!h.linewise,v.visualBlock=!!h.blockwise,e.signal(u,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""}),bt(u)):Je(u);else{v.visualMode=!0,v.visualLine=!!h.linewise,v.visualBlock=!!h.blockwise,k=yt(u,new n(x.line,x.ch+b-1));var R=i(u,x,k);v.sel={anchor:R.start,head:R.end},e.signal(u,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""}),bt(u),pr(u,v,"<",vt(x,k)),pr(u,v,">",On(x,k))}},reselectLastSelection:function(u,h,v){var b=v.lastSelection;if(v.visualMode&&er(u,v),b){var x=b.anchorMark.find(),k=b.headMark.find();if(!x||!k)return;v.sel={anchor:x,head:k},v.visualMode=!0,v.visualLine=b.visualLine,v.visualBlock=b.visualBlock,bt(u),pr(u,v,"<",vt(x,k)),pr(u,v,">",On(x,k)),e.signal(u,"vim-mode-change",{mode:"visual",subMode:v.visualLine?"linewise":v.visualBlock?"blockwise":""})}},joinLines:function(u,h,v){var b,x;if(v.visualMode){if(b=u.getCursor("anchor"),x=u.getCursor("head"),lt(x,b)){var k=x;x=b,b=k}x.ch=St(u,x.line)-1}else{var R=Math.max(h.repeat,2);b=u.getCursor(),x=yt(u,new n(b.line+R-1,1/0))}for(var O=0,N=b.line;N<x.line;N++){O=St(u,b.line);var z="",j=0;if(!h.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));v.visualMode&&Je(u,!1),u.setCursor(oe)},newLineAndEnterInsertMode:function(u,h,v){v.insertMode=!0;var b=Ge(u.getCursor());b.line===u.firstLine()&&!h.after?(u.replaceRange(`
|
|
46
|
-
`,new n(u.firstLine(),0)),u.setCursor(u.firstLine(),0)):(b.line=h.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:h.repeat},v)},paste:function(u,h,v){var b=K.registerController.getRegister(h.registerName);if(h.registerName==="+")navigator.clipboard.readText().then(k=>{this.continuePaste(u,h,v,k,b)});else{var x=b.toString();this.continuePaste(u,h,v,x,b)}},continuePaste:function(u,h,v,b,x){var k=Ge(u.getCursor());if(b){if(h.matchIndent){var R=u.getOption("tabSize"),O=function(Jt){var Xt=Jt.split(" ").length-1,cn=Jt.split(" ").length-1;return Xt*R+cn*1},N=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=N+(O(Jt)-se);if(Xt<0)return"";if(u.getOption("indentWithTabs")){var cn=Math.floor(Xt/R);return Array(cn+1).join(" ")}else return Array(Xt+1).join(" ")});b+=j?`
|
|
47
|
-
`:""}h.repeat>1&&(b=Array(h.repeat+1).join(b));var oe=x.linewise,Z=x.blockwise,ee=Z?b.split(`
|
|
48
|
-
`):void 0;if(ee){oe&&ee.pop();for(var _e=0;_e<ee.length;_e++)ee[_e]=ee[_e]==""?" ":ee[_e];k.ch+=h.after?1:0,k.ch=Math.min(St(u,k.line),k.ch)}else oe?v.visualMode?b=v.visualLine?b.slice(0,-1):`
|
|
49
|
-
`+b.slice(0,b.length-1)+`
|
|
50
|
-
`:h.after?(b=`
|
|
51
|
-
`+b.slice(0,b.length-1),k.ch=St(u,k.line)):k.ch=0:k.ch+=h.after?1:0;var xe;if(v.visualMode){v.lastPastedText=b;var je,Te=pi(u),Ie=Te[0],ct=Te[1],Xe=u.getSelection(),Ot=u.listSelections(),Pt=Array(Ot.length).join("1").split("1");v.lastSelection&&(je=v.lastSelection.headMark.find()),K.registerController.unnamedRegister.setText(Xe),Z?(u.replaceSelections(Pt),ct=new n(Ie.line+b.length-1,Ie.ch),u.setCursor(Ie),jn(u,ct),u.replaceSelections(b),xe=Ie):v.visualBlock?(u.replaceSelections(Pt),u.setCursor(Ie),u.replaceRange(b,Ie,Ie),xe=Ie):(u.replaceRange(b,Ie,ct),xe=u.posFromIndex(u.indexFromPos(Ie)+b.length-1)),je&&(v.lastSelection.headMark=u.setBookmark(je)),oe&&(xe.ch=0)}else if(Z&&ee){u.setCursor(k);for(var _e=0;_e<ee.length;_e++){var ze=k.line+_e;ze>u.lastLine()&&u.replaceRange(`
|
|
52
|
-
`,new n(ze,0)),St(u,ze)<k.ch&&fi(u,ze,k.ch)}u.setCursor(k),jn(u,new n(k.line+ee.length-1,k.ch)),u.replaceSelections(ee),xe=k}else if(u.replaceRange(b,k),oe){var ze=h.after?k.line+1:k.line;xe=new n(ze,ye(u.getLine(ze)))}else xe=Ge(k),/\n/.test(b)||(xe.ch+=b.length-(h.after?1:0));v.visualMode&&Je(u,!1),u.setCursor(xe)}},undo:function(u,h){u.operation(function(){fr(u,e.commands.undo,h.repeat)(),u.setCursor(yt(u,u.getCursor("start")))})},redo:function(u,h){fr(u,e.commands.redo,h.repeat)()},setRegister:function(u,h,v){v.inputState.registerName=h.selectedCharacter},insertRegister:function(u,h,v){var b=h.selectedCharacter,x=K.registerController.getRegister(b),k=x&&x.toString();k&&u.replaceSelection(k)},oneNormalCommand:function(u,h,v){Ir(u,!0),v.insertModeReturn=!0,e.on(u,"vim-command-done",function b(){v.visualMode||(v.insertModeReturn&&(v.insertModeReturn=!1,v.insertMode||Ht.enterInsertMode(u,{},v)),e.off(u,"vim-command-done",b))})},setMark:function(u,h,v){var b=h.selectedCharacter;b&&pr(u,v,b,u.getCursor())},replace:function(u,h,v){var b=h.selectedCharacter||"",x=u.getCursor(),k,R,O=u.listSelections();if(v.visualMode)x=u.getCursor("start"),R=u.getCursor("end");else{var N=u.getLine(x.line);k=x.ch+h.repeat,k>N.length&&(k=N.length),R=new n(x.line,k)}var z=i(u,x,R);if(x=z.start,R=z.end,b==`
|
|
53
|
-
`)v.visualMode||u.replaceRange("",x,R),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(u);else{var j=u.getRange(x,R);if(j=j.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b),j=j.replace(/[^\n]/g,b),v.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,R);v.visualMode?(x=lt(O[0].anchor,O[0].head)?O[0].anchor:O[0].head,u.setCursor(x),Je(u,!1)):u.setCursor(Ct(R,0,-1))}},incrementNumberToken:function(u,h){for(var v=u.getCursor(),b=u.getLine(v.line),x=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,k,R,O,N;(k=x.exec(b))!==null&&(R=k.index,O=R+k[0].length,!(v.ch<O)););if(!(!h.backtrack&&O<=v.ch)){if(k){var z=k[2]||k[4],j=k[3]||k[5],se=h.increase?1:-1,oe={"0b":2,0:8,"":10,"0x":16}[z.toLowerCase()];N=(parseInt(k[1]+j,oe)+se*h.repeat).toString(oe);var Z=z?Array(j.length-N.length+1+k[1].length).join("0"):"";N=N.charAt(0)==="-"?"-"+z+Z+N.substr(1):z+Z+N;var ee=new n(v.line,R),_e=new n(v.line,O);u.replaceRange(N,ee,_e)}else return;u.setCursor(new n(v.line,R+N.length-1))}},repeatLastEdit:function(u,h,v){var b=v.lastEditInputState;if(b){var x=h.repeat;x&&h.repeatIsExplicit?b.repeatOverride=x:x=b.repeatOverride||x,zs(u,v,x,!1)}},indent:function(u,h){u.indentLine(u.getCursor().line,h.indentRight)},exitInsertMode:function(u,h){Ir(u)}};function Qt(u,h){Ht[u]=h}function yt(u,h,v){var b=u.state.vim,x=b.insertMode||b.visualMode,k=Math.min(Math.max(u.firstLine(),h.line),u.lastLine()),R=u.getLine(k),O=R.length-1+ +!!x,N=Math.min(Math.max(0,h.ch),O),z=R.charCodeAt(N);if(56320<=z&&z<=57343){var j=1;v&&v.line==k&&v.ch>N&&(j=-1),N+=j,N>O&&(N-=2)}return new n(k,N)}function Ft(u){var h={};for(var v in u)Object.prototype.hasOwnProperty.call(u,v)&&(h[v]=u[v]);return h}function Ct(u,h,v){return typeof h=="object"&&(v=h.ch,h=h.line),new n(u.line+h,u.ch+v)}function di(u,h,v,b){b.operator&&(v="operatorPending");for(var x,k=[],R=[],O=De?h.length-c:0;O<h.length;O++){var N=h[O];v=="insert"&&N.context!="insert"||N.context&&N.context!=v||b.operator&&N.type=="action"||!(x=$i(u,N.keys))||(x=="partial"&&k.push(N),x=="full"&&R.push(N))}return{partial:k,full:R}}function $i(u,h){let v=h.slice(-11)=="<character>",b=h.slice(-10)=="<register>";if(v||b){var x=h.length-(v?11:10),k=u.slice(0,x),R=h.slice(0,x);return k==R&&u.length>x?"full":R.indexOf(k)==0?"partial":!1}else return u==h?"full":h.indexOf(u)==0?"partial":!1}function Ar(u){var h=/^.*(<[^>]+>)$/.exec(u),v=h?h[1]:u.slice(-1);if(v.length>1)switch(v){case"<CR>":case"<S-CR>":v=`
|
|
55
|
-
`;break;case"<Space>":case"<S-Space>":v=" ";break;default:v="";break}return v}function fr(u,h,v){return function(){for(var b=0;b<v;b++)h(u)}}function Ge(u){return new n(u.line,u.ch)}function Vt(u,h){return u.ch==h.ch&&u.line==h.line}function lt(u,h){return u.line<h.line||u.line==h.line&&u.ch<h.ch}function vt(u,h){return arguments.length>2&&(h=vt.apply(void 0,Array.prototype.slice.call(arguments,1))),lt(u,h)?u:h}function On(u,h){return arguments.length>2&&(h=On.apply(void 0,Array.prototype.slice.call(arguments,1))),lt(u,h)?h:u}function Kr(u,h,v){var b=lt(u,h),x=lt(h,v);return b&&x}function St(u,h){return u.getLine(h).length}function Zn(u){return u.trim?u.trim():u.replace(/^\s+|\s+$/g,"")}function Qr(u){return u.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function fi(u,h,v){var b=St(u,h),x=Array(v-b+1).join(" ");u.setCursor(new n(h,b)),u.replaceRange(x,u.getCursor())}function jn(u,h){var v=[],b=u.listSelections(),x=Ge(u.clipPos(h)),k=!Vt(h,x),R=Gr(b,u.getCursor("head")),O=Vt(b[R].head,b[R].anchor),N=b.length-1,z=N-R>R?N:0,j=b[z].anchor,se=Math.min(j.line,x.line),oe=Math.max(j.line,x.line),Z=j.ch,ee=x.ch,_e=b[z].head.ch-Z,xe=ee-Z;_e>0&&xe<=0?(Z++,k||ee--):_e<0&&xe>=0?(Z--,O||ee++):_e<0&&xe==-1&&(Z--,ee++);for(var je=se;je<=oe;je++){var Te={anchor:new n(je,Z),head:new n(je,ee)};v.push(Te)}return u.setSelections(v),h.ch=ee,j.ch=Z,j}function Hn(u,h,v){for(var b=[],x=0;x<v;x++){var k=Ct(h,x,0);b.push({anchor:k,head:k})}u.setSelections(b,0)}function Gr(u,h,v){for(var b=0;b<u.length;b++){var x=Vt(u[b].anchor,h),k=Vt(u[b].head,h);if(x||k)return b}return-1}function pi(u,h){var v=u.listSelections(),b=v[0],x=v[v.length-1];return[lt(b.anchor,b.head)?b.anchor:b.head,lt(x.anchor,x.head)?x.head:x.anchor]}function er(u,h){var v=h.sel.anchor,b=h.sel.head;h.lastPastedText&&(h.lastPastedText=(b=u.posFromIndex(u.indexFromPos(v)+h.lastPastedText.length),void 0)),h.lastSelection={anchorMark:u.setBookmark(v),headMark:u.setBookmark(b),anchor:Ge(v),head:Ge(b),visualMode:h.visualMode,visualLine:h.visualLine,visualBlock:h.visualBlock}}function Pn(u,h,v,b){var x=u.state.vim.sel,k=b?h:x.head,R=b?h:x.anchor,O;return lt(v,h)&&(O=v,v=h,h=O),lt(k,R)?(k=vt(h,k),R=On(R,v)):(R=vt(h,R),k=On(k,v),k=Ct(k,0,-1),k.ch==-1&&k.line!=u.firstLine()&&(k=new n(k.line-1,St(u,k.line-1)))),[R,k]}function bt(u,h,v){var b=u.state.vim;h||(h=b.sel),v||(v=b.visualLine?"line":b.visualBlock?"block":"char");var x=jt(u,h,v);u.setSelections(x.ranges,x.primary)}function jt(u,h,v,b){var x=Ge(h.head),k=Ge(h.anchor);if(v=="char"){var R=!b&&!lt(h.head,h.anchor)?1:0,O=lt(h.head,h.anchor)?1:0;return x=Ct(h.head,0,R),k=Ct(h.anchor,0,O),{ranges:[{anchor:k,head:x}],primary:0}}else if(v=="line"){if(lt(h.head,h.anchor))x.ch=0,k.ch=St(u,k.line);else{k.ch=0;var N=u.lastLine();x.line>N&&(x.line=N),x.ch=St(u,x.line)}return{ranges:[{anchor:k,head:x}],primary:0}}else if(v=="block"){var z=Math.min(k.line,x.line),j=k.ch,se=Math.max(k.line,x.line),oe=x.ch;j<oe?oe+=1:j+=1;for(var Z=se-z+1,ee=x.line==z?0:Z-1,_e=[],xe=0;xe<Z;xe++)_e.push({anchor:new n(z+xe,j),head:new n(z+xe,oe)});return{ranges:_e,primary:ee}}throw"never happens"}function L(u){var h=u.getCursor("head");return u.getSelection().length==1&&(h=vt(h,u.getCursor("anchor"))),h}function Je(u,h){var v=u.state.vim;h!==!1&&u.setCursor(yt(u,v.sel.head)),er(u,v),v.visualMode=!1,v.visualLine=!1,v.visualBlock=!1,v.insertMode||e.signal(u,"vim-mode-change",{mode:"normal"})}function q(u,h,v){var b=u.getRange(h,v);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())v.line--,v.ch=0;k?(v.line--,v.ch=St(u,v.line)):v.ch=0}}function ne(u,h,v){h.ch=0,v.ch=0,v.line++}function ye(u){if(!u)return 0;var h=u.search(/\S/);return h==-1?u.length:h}function Se(u,{inclusive:h,innerWord:v,bigWord:b,noSymbol:x,multiline:k},R){var O=R||L(u),N=u.getLine(O.line),z=N,j=O.line,se=j,oe=O.ch,Z,ee=x?C[0]:E[0];if(v&&/\s/.test(N.charAt(oe)))ee=function(ct){return/\s/.test(ct)};else{for(;!ee(N.charAt(oe));)if(oe++,oe>=N.length){if(!k)return null;oe--,Z=ot(u,O,!0,b,!0);break}b?ee=E[0]:(ee=C[0],ee(N.charAt(oe))||(ee=C[1]))}for(var _e=oe,xe=oe;ee(N.charAt(xe))&&xe>=0;)xe--;if(xe++,Z)_e=Z.to,se=Z.line,z=u.getLine(se),!z&&_e==0&&_e++;else for(;ee(N.charAt(_e))&&_e<N.length;)_e++;if(h){var je=_e,Te=O.ch<=xe&&/\s/.test(N.charAt(O.ch));if(!Te)for(;/\s/.test(z.charAt(_e))&&_e<z.length;)_e++;if(je==_e||Te){for(var Ie=xe;/\s/.test(N.charAt(xe-1))&&xe>0;)xe--;!xe&&!Te&&(xe=Ie)}}return{start:new n(j,xe),end:new n(se,_e)}}function pt(u,h,v){var b=h;if(!e.findMatchingTag||!e.findEnclosingTag)return{start:b,end:b};var x=e.findMatchingTag(u,h)||e.findEnclosingTag(u,h);return!x||!x.open||!x.close?{start:b,end:b}:v?{start:x.open.from,end:x.close.to}:{start:x.open.to,end:x.close.from}}function tt(u,h,v){Vt(h,v)||K.jumpList.add(u,h,v)}function it(u,h){K.lastCharacterSearch.increment=u,K.lastCharacterSearch.forward=h.forward,K.lastCharacterSearch.selectedCharacter=h.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 h=u.lastCh==="*"&&u.nextCh==="/";return u.lastCh=u.nextCh,h}},method:{init:function(u){u.symb=u.symb==="m"?"{":"}",u.reverseSymb=u.symb==="{"?"}":"{"},isComplete:function(u){return u.nextCh===u.symb}},preprocess:{init:function(u){u.index=0},isComplete:function(u){var v;if(u.nextCh==="#"){var h=(v=u.lineText.match(/^#(\w+)/))==null?void 0:v[1];if(h==="endif"){if(u.forward&&u.depth===0)return!0;u.depth++}else if(h==="if"){if(!u.forward&&u.depth===0)return!0;u.depth--}if(h==="else"&&u.depth===0)return!0}return!1}}};function He(u,h,v,b){var x=Ge(u.getCursor()),k=v?1:-1,R=v?u.lineCount():-1,O=x.ch,N=x.line,z=u.getLine(N),j={lineText:z,nextCh:z.charAt(O),lastCh:null,index:O,symb:b,reverseSymb:(v?{")":"(","}":"{"}:{"(":")","{":"}"})[b],forward:v,depth:0,curMoveThrough:!1},se=wt[b];if(!se)return x;var oe=$e[se].init,Z=$e[se].isComplete;for(oe&&oe(j);N!==R&&h;){if(j.index+=k,j.nextCh=j.lineText.charAt(j.index),!j.nextCh){if(N+=k,j.lineText=u.getLine(N)||"",k>0)j.index=0;else{var ee=j.lineText.length;j.index=ee>0?ee-1:0}j.nextCh=j.lineText.charAt(j.index)}Z(j)&&(x.line=N,x.ch=j.index,h--)}return j.nextCh||j.curMoveThrough?new n(N,j.index):x}function ot(u,h,v,b,x){var k=h.line,R=h.ch,O=u.getLine(k),N=v?1:-1,z=b?E:C;if(x&&O==""){if(k+=N,O=u.getLine(k),!W(u,k))return null;R=v?0:O.length}for(;;){if(x&&O=="")return{from:0,to:0,line:k};for(var j=N>0?O.length:-1,se=j,oe=j;R!=j;){for(var Z=!1,ee=0;ee<z.length&&!Z;++ee)if(z[ee](O.charAt(R))){for(se=R;R!=j&&z[ee](O.charAt(R));)R+=N;if(oe=R,Z=se!=oe,se==h.ch&&k==h.line&&oe==se+N)continue;return{from:Math.min(se,oe+1),to:Math.max(se,oe),line:k}}Z||(R+=N)}if(k+=N,!W(u,k))return null;O=u.getLine(k),R=N>0?0:O.length}}function ht(u,h,v,b,x,k){var R=Ge(h),O=[];(b&&!x||!b&&x)&&v++;for(var N=!(b&&x),z=0;z<v;z++){var j=ot(u,h,b,k,N);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),h=new n(j.line,b?j.to-1:j.from)}var oe=O.length!=v,Z=O[0],ee=O.pop();return b&&!x?(!oe&&(Z.from!=R.ch||Z.line!=R.line)&&(ee=O.pop()),ee&&new n(ee.line,ee.from)):b&&x?ee&&new n(ee.line,ee.to-1):!b&&x?(!oe&&(Z.to!=R.ch||Z.line!=R.line)&&(ee=O.pop()),ee&&new n(ee.line,ee.to)):ee&&new n(ee.line,ee.from)}function $t(u,h,v,b,x){var k=new n(h.line+v.repeat-1,1/0),R=u.clipPos(k);return R.ch--,x||(b.lastHPos=1/0,b.lastHSPos=u.charCoords(R,"div").left),k}function tr(u,h,v,b,x){if(b){for(var k=x||u.getCursor(),R=k.ch,O,N=0;N<h;N++){var z=u.getLine(k.line);if(O=sc(R,z,b,v),O==-1)return;R=O}if(O!=null)return new n(u.getCursor().line,O)}}function Ss(u,h){var v=u.getCursor().line;return yt(u,new n(v,h-1))}function pr(u,h,v,b){!de(v,T)&&!H.test(v)||(h.marks[v]&&h.marks[v].clear(),h.marks[v]=u.setBookmark(b))}function sc(u,h,v,b,x){return b?h.indexOf(v,u+1):h.lastIndexOf(v,u-1)}function lc(u,h,v,b,x){var k=h.line,R=u.firstLine(),O=u.lastLine(),N,z,j=k;function se(xe){return!u.getLine(xe)}function oe(xe,je,Te){return Te?se(xe)!=se(xe+je):!se(xe)&&se(xe+je)}if(b){for(;R<=j&&j<=O&&v>0;)oe(j,b)&&v--,j+=b;return{start:new n(j,0),end:h}}var Z=u.state.vim;if(Z.visualLine&&oe(k,1,!0)){var ee=Z.sel.anchor;oe(ee.line,-1,!0)&&(!x||ee.line!=k)&&(k+=1)}var _e=se(k);for(j=k;j<=O&&v;j++)oe(j,1,!0)&&(!x||se(j)!=_e)&&v--;for(z=new n(j,0),j>O&&!_e?_e=!0:x=!1,j=k;j>R&&!((!x||se(j)==_e||j==k)&&oe(j,-1,!0));j--);return N=new n(j,0),{start:N,end:z}}function Oo(u,h,v,b,x){function k(z){z.line!==null&&(z.pos+z.dir<0||z.pos+z.dir>=z.line.length?z.line=null:z.pos+=z.dir)}function R(z,j,se,oe){var Z={line:z.getLine(j),ln:j,pos:se,dir:oe};if(Z.line==="")return{ln:Z.ln,pos:Z.pos};var ee=Z.pos;for(k(Z);Z.line!==null;){if(ee=Z.pos,$(Z.line[Z.pos]))if(x){for(k(Z);Z.line!==null&&I(Z.line[Z.pos]);)ee=Z.pos,k(Z);return{ln:Z.ln,pos:ee+1}}else return{ln:Z.ln,pos:Z.pos+1};k(Z)}return{ln:Z.ln,pos:ee+1}}function O(z,j,se,oe){var Z=z.getLine(j),ee={line:Z,ln:j,pos:se,dir:oe};if(ee.line==="")return{ln:ee.ln,pos:ee.pos};var _e=ee.pos;for(k(ee);ee.line!==null;){if(!I(ee.line[ee.pos])&&!$(ee.line[ee.pos]))_e=ee.pos;else if($(ee.line[ee.pos]))return x&&I(ee.line[ee.pos+1])?{ln:ee.ln,pos:ee.pos+1}:{ln:ee.ln,pos:_e};k(ee)}return ee.line=Z,x&&I(ee.line[ee.pos])?{ln:ee.ln,pos:ee.pos}:{ln:ee.ln,pos:_e}}for(var N={ln:h.line,pos:h.ch};v>0;)N=b<0?O(u,N.ln,N.pos,b):R(u,N.ln,N.pos,b),v--;return new n(N.ln,N.pos)}function Na(u,h,v,b){function x(N,z){if(z.line!==null)if(z.pos+z.dir<0||z.pos+z.dir>=z.line.length){if(z.ln+=z.dir,!W(N,z.ln)){z.line=null;return}z.line=N.getLine(z.ln),z.pos=z.dir>0?0:z.line.length-1}else z.pos+=z.dir}function k(N,z,j,se){var xe=N.getLine(z),oe=xe==="",Z={line:xe,ln:z,pos:j,dir:se},ee={ln:Z.ln,pos:Z.pos},_e=Z.line==="";for(x(N,Z);Z.line!==null;){if(ee.ln=Z.ln,ee.pos=Z.pos,Z.line===""&&!_e||oe&&Z.line!==""&&!I(Z.line[Z.pos]))return{ln:Z.ln,pos:Z.pos};$(Z.line[Z.pos])&&!oe&&(Z.pos===Z.line.length-1||I(Z.line[Z.pos+1]))&&(oe=!0),x(N,Z)}var xe=N.getLine(ee.ln);ee.pos=0;for(var je=xe.length-1;je>=0;--je)if(!I(xe[je])){ee.pos=je;break}return ee}function R(N,z,j,se){var xe=N.getLine(z),oe={line:xe,ln:z,pos:j,dir:se},Z=oe.ln,ee=null,_e=oe.line==="";for(x(N,oe);oe.line!==null;){if(oe.line===""&&!_e)return ee===null?{ln:oe.ln,pos:oe.pos}:{ln:Z,pos:ee};if($(oe.line[oe.pos])&&ee!==null&&!(oe.ln===Z&&oe.pos+1===ee))return{ln:Z,pos:ee};oe.line!==""&&!I(oe.line[oe.pos])&&(_e=!1,Z=oe.ln,ee=oe.pos),x(N,oe)}var xe=N.getLine(Z);ee=0;for(var je=0;je<xe.length;++je)if(!I(xe[je])){ee=je;break}return{ln:Z,pos:ee}}for(var O={ln:h.line,pos:h.ch};v>0;)O=b<0?R(u,O.ln,O.pos,b):k(u,O.ln,O.pos,b),v--;return new n(O.ln,O.pos)}function mr(u,h,v,b){var x=h,k={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[v],R={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[v],O=u.getLine(x.line).charAt(x.ch)===R?1:0,N=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(!N||!z)return null;var j=N.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 Es(u,h,v,b){var x=Ge(h),k=u.getLine(x.line).split(""),R,O,N,z,j=k.indexOf(v);if(x.ch<j)x.ch=j;else if(j<x.ch&&k[x.ch]==v){var se=/string/.test(u.getTokenTypeAt(Ct(h,0,1))),oe=/string/.test(u.getTokenTypeAt(h));se&&!oe||(O=x.ch,--x.ch)}if(k[x.ch]==v&&!O)R=x.ch+1;else for(N=x.ch;N>-1&&!R;N--)k[N]==v&&(R=N+1);if(R&&!O)for(N=R,z=k.length;N<z&&!O;N++)k[N]==v&&(O=N);return!R||!O?{start:x,end:x}:(b&&(--R,++O),{start:new n(x.line,R),end:new n(x.line,O)})}be("pcre",!0,"boolean");class cc{constructor(){this.highlightTimeout}getQuery(){return K.query}setQuery(h){K.query=h}getOverlay(){return this.searchOverlay}setOverlay(h){this.searchOverlay=h}isReversed(){return K.isReversed}setReversed(h){K.isReversed=h}getScrollbarAnnotate(){return this.annotate}setScrollbarAnnotate(h){this.annotate=h}}function wn(u){var h=u.state.vim;return h.searchState_||(h.searchState_=new cc)}function Ts(u){return uc(u,"/")}function Rs(u){return Ds(u,"/")}function uc(u,h){var v=Ds(u,h)||[];if(!v.length)return[];var b=[];if(v[0]===0){for(var x=0;x<v.length;x++)typeof v[x]=="number"&&b.push(u.substring(v[x]+1,v[x+1]));return b}}function Ds(u,h){h||(h="/");for(var v=!1,b=[],x=0;x<u.length;x++){var k=u.charAt(x);!v&&k==h&&b.push(x),v=!v&&k=="\\"}return b}function Vn(u){var h={V:"|(){+?*.[$^",M:"|(){+?*.[",m:"|(){+?",v:"<>"},v={">":"(?<=[\\w])(?=[^\\w]|$)","<":"(?<=[^\\w]|^)(?=[\\w])"},b=h.m,x=u.replace(/\\.|[\[|(){+*?.$^<>]/g,function(R){if(R[0]==="\\"){var O=R[1];return O==="}"||b.indexOf(O)!=-1?O:O in h?(b=h[O],""):O in v?v[O]:R}else return b.indexOf(R)==-1?R:v[R]||"\\"+R}),k=x.indexOf("\\zs");return k!=-1&&(x="(?<="+x.slice(0,k)+")"+x.slice(k+3)),k=x.indexOf("\\ze"),k!=-1&&(x=x.slice(0,k)+"(?="+x.slice(k+3)+")"),x}var Os={"\\n":`
|
|
57
|
-
`,"\\r":"\r","\\t":" "};function ff(u){for(var h=!1,v=[],b=-1;b<u.length;b++){var x=u.charAt(b)||"",k=u.charAt(b+1)||"";Os[x+k]?(v.push(Os[x+k]),b++):h?(v.push(x),h=!1):x==="\\"?(h=!0,pe(k)||k==="$"?v.push("$"):k!=="/"&&k!=="\\"&&v.push("\\")):(x==="$"&&v.push("$"),v.push(x),k==="/"&&v.push("\\"))}return v.join("")}var Po={"\\/":"/","\\\\":"\\","\\n":`
|
|
58
|
-
`,"\\r":"\r","\\t":" ","\\&":"&"};function dc(u){for(var h=new e.StringStream(u),v=[];!h.eol();){for(;h.peek()&&h.peek()!="\\";)v.push(h.next());var b=!1;for(var x in Po)if(h.match(x,!0)){b=!0,v.push(Po[x]);break}b||v.push(h.next())}return v.join("")}function Lo(u,h,v){K.registerController.getRegister("/").setText(u);var b=Rs(u),x,k;return b.length?(x=u.substring(0,b[0]),k=u.substring(b[0]).indexOf("i")!=-1):x=u,x?(we("pcre")||(x=Vn(x)),v&&(h=/^[^A-Z]*$/.test(x)),new RegExp(x,h||k?"im":"m")):null}function nr(u){typeof u=="string"&&(u=document.createElement(u));for(var h=1;h<arguments.length;h++){var v=arguments[h];if(v)if(typeof v!="object"&&(v=document.createTextNode(v)),v.nodeType)u.appendChild(v);else for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(b[0]==="$"?u.style[b.slice(1)]=v[b]:typeof v[b]=="function"?u[b]=v[b]:u.setAttribute(b,v[b]))}return u}function Ve(u,h,v){var b=nr("div",{$color:"red",$whiteSpace:"pre",class:"cm-vim-message"},h);u.openNotification?v?(b=nr("div",{},b,nr("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 Ps(u,h){return nr("div",{$display:"flex",$flex:1},nr("span",{$fontFamily:"monospace",$whiteSpace:"pre",$flex:1,$display:"flex"},u,nr("input",{type:"text",autocorrect:"off",autocapitalize:"off",spellcheck:"false",$flex:1})),h&&nr("span",{$color:"#888"},h))}function No(u,h){var x;if(We.length){h.value||(h.value=""),Ne=h;return}var v=Ps(h.prefix,h.desc);if(u.openDialog)u.openDialog(v,h.onClose,{onKeyDown:h.onKeyDown,onKeyUp:h.onKeyUp,bottom:!0,selectValueOnOpen:!1,value:h.value});else{var b="";typeof h.prefix!="string"&&h.prefix&&(b+=h.prefix.textContent),h.desc&&(b+=" "+h.desc),(x=h.onClose)==null||x.call(h,prompt(b,""))}}function Ls(u,h){return u instanceof RegExp&&h instanceof RegExp?u.flags==h.flags&&u.source==h.source:!1}function hr(u,h,v,b){if(h){var x=wn(u),k=Lo(h,!!v,!!b);if(k)return Jr(u,k),Ls(k,x.getQuery())||x.setQuery(k),k}}function fc(u){if(u.source.charAt(0)=="^")var h=!0;return{token:function(v){if(h&&!v.sol()){v.skipToEnd();return}var b=v.match(u,!1);if(b)return b[0].length==0?(v.next(),"searching"):!v.sol()&&(v.backUp(1),!u.exec(v.next()+b[0]))?(v.next(),null):(v.match(u),"searching");for(;!v.eol()&&(v.next(),!v.match(u,!1)););},query:u}}var Wi=0;function Jr(u,h){clearTimeout(Wi);var v=wn(u);v.highlightTimeout=Wi,Wi=setTimeout(function(){if(u.state.vim){var b=wn(u);b.highlightTimeout=void 0;var x=b.getOverlay();(!x||h!=x.query)&&(x&&u.removeOverlay(x),x=fc(h),u.addOverlay(x),u.showMatchesOnScrollbar&&(b.getScrollbarAnnotate()&&b.getScrollbarAnnotate().clear(),b.setScrollbarAnnotate(u.showMatchesOnScrollbar(h))),b.setOverlay(x))}},50)}function pc(u,h,v,b){return u.operation(function(){b===void 0&&(b=1);for(var x=u.getCursor(),k=u.getSearchCursor(v,x),R=0;R<b;R++){var O=k.find(h);if(R==0&&O&&Vt(k.from(),x)){var N=h?k.from():k.to();O=k.find(h),O&&!O[0]&&Vt(k.from(),N)&&u.getLine(N.line).length==N.ch&&(O=k.find(h))}if(!O&&(k=u.getSearchCursor(v,h?new n(u.lastLine()):new n(u.firstLine(),0)),!k.find(h)))return}return k.from()})}function mc(u,h,v,b,x){return u.operation(function(){b===void 0&&(b=1);var k=u.getCursor(),R=u.getSearchCursor(v,k),O=R.find(!h);!x.visualMode&&O&&Vt(R.from(),k)&&R.find(!h);for(var N=0;N<b;N++)if(O=R.find(h),!O&&(R=u.getSearchCursor(v,h?new n(u.lastLine()):new n(u.firstLine(),0)),!R.find(h)))return;var z=R.from(),j=R.to();return z&&j&&[z,j]})}function mi(u){var h=wn(u);h.highlightTimeout&&(h.highlightTimeout=(clearTimeout(h.highlightTimeout),void 0)),u.removeOverlay(wn(u).getOverlay()),h.setOverlay(null),h.getScrollbarAnnotate()&&(h.getScrollbarAnnotate().clear(),h.setScrollbarAnnotate(null))}function Ns(u,h,v){return typeof u!="number"&&(u=u.line),h instanceof Array?de(u,h):typeof v=="number"?u>=h&&u<=v:u==h}function Ms(u){var h=u.getScrollInfo(),v=6,b=10,x=u.coordsChar({left:0,top:v+h.top},"local"),k=h.clientHeight-b+h.top,R=u.coordsChar({left:0,top:k},"local");return{top:x.line,bottom:R.line}}function Ma(u,h,v){if(v=="'"||v=="`")return K.jumpList.find(u,-1)||new n(0,0);if(v==".")return Mo(u);var b=h.marks[v];return b&&b.find()}function Mo(u){if(u.getLastEditEnd)return u.getLastEditEnd();for(var h=u.doc.history.done,v=h.length;v--;)if(h[v].changes)return Ge(h[v].changes[0].to)}class As{constructor(){this.commandMap_,this.buildCommandMap_()}processCommand(h,v,b){var x=this;h.operation(function(){h.curOp&&(h.curOp.isVimOp=!0),x._processCommand(h,v,b)})}_processCommand(h,v,b){var x=h.state.vim,k=K.registerController.getRegister(":"),R=k.toString(),O=new e.StringStream(v);k.setText(v);var N=b||{};N.input=v;try{this.parseInput_(h,O,N)}catch(se){throw Ve(h,se+""),se}x.visualMode&&Je(h);var z,j;if(!N.commandName)N.line!==void 0&&(j="move");else if(z=this.matchCommand_(N.commandName),z){if(j=z.name,z.excludeFromCommandHistory&&k.setText(R),this.parseCommandArgs_(O,N,z),z.type=="exToKey"){It(h,z.toKeys||"",z);return}else if(z.type=="exToEx"){this.processCommand(h,z.toInput||"");return}}if(!j){Ve(h,'Not an editor command ":'+v+'"');return}try{Aa[j](h,N),(!z||!z.possiblyAsync)&&N.callback&&N.callback()}catch(se){throw Ve(h,se+""),se}}parseInput_(h,v,b){var k,R;v.eatWhile(":"),v.eat("%")?(b.line=h.firstLine(),b.lineEnd=h.lastLine()):(b.line=this.parseLineSpec_(h,v),b.line!==void 0&&v.eat(",")&&(b.lineEnd=this.parseLineSpec_(h,v))),b.line==null?h.state.vim.visualMode?(b.selectionLine=(k=Ma(h,h.state.vim,"<"))==null?void 0:k.line,b.selectionLineEnd=(R=Ma(h,h.state.vim,">"))==null?void 0:R.line):b.selectionLine=h.getCursor().line:(b.selectionLine=b.line,b.selectionLineEnd=b.lineEnd);var x=v.match(/^(\w+|!!|@@|[!#&*<=>@~])/);return x?b.commandName=x[1]:b.commandName=(v.match(/.*/)||[""])[0],b}parseLineSpec_(h,v){var b=v.match(/^(\d+)/);if(b)return parseInt(b[1],10)-1;switch(v.next()){case".":return this.parseLineSpecOffset_(v,h.getCursor().line);case"$":return this.parseLineSpecOffset_(v,h.lastLine());case"'":var x=v.next()||"",k=Ma(h,h.state.vim,x);if(!k)throw Error("Mark not set");return this.parseLineSpecOffset_(v,k.line);case"-":case"+":return v.backUp(1),this.parseLineSpecOffset_(v,h.getCursor().line);default:v.backUp(1);return}}parseLineSpecOffset_(h,v){var b=h.match(/^([+-])?(\d+)/);if(b){var x=parseInt(b[2],10);b[1]=="-"?v-=x:v+=x}return v}parseCommandArgs_(h,v,b){var R;if(!h.eol()){v.argString=(R=h.match(/.*/))==null?void 0:R[0];var x=b.argDelimiter||/\s+/,k=Zn(v.argString||"").split(x);k.length&&k[0]&&(v.args=k)}}matchCommand_(h){for(var v=h.length;v>0;v--){var b=h.substring(0,v);if(this.commandMap_[b]){var x=this.commandMap_[b];if(x.name.indexOf(h)===0)return x}}}buildCommandMap_(){this.commandMap_={};for(var h=0;h<d.length;h++){var v=d[h],b=v.shortName||v.name;this.commandMap_[b]=v}}map(h,v,b,x){if(h!=":"&&h.charAt(0)==":"){if(b)throw Error("Mode not supported for ex mappings");var k=h.substring(1);v!=":"&&v.charAt(0)==":"?this.commandMap_[k]={name:k,type:"exToEx",toInput:v.substring(1),user:!0}:this.commandMap_[k]={name:k,type:"exToKey",toKeys:v,user:!0}}else{var R={keys:h,type:"keyToKey",toKeys:v,noremap:!!x};b&&(R.context=b),Ao(R)}}unmap(h,v){if(h!=":"&&h.charAt(0)==":"){if(v)throw Error("Mode not supported for ex mappings");var b=h.substring(1);if(this.commandMap_[b]&&this.commandMap_[b].user)return delete this.commandMap_[b],!0}else for(var x=h,k=0;k<a.length;k++)if(x==a[k].keys&&a[k].context===v)return a.splice(k,1),Io(x),!0}}var Aa={colorscheme:function(u,h){if(!h.args||h.args.length<1){Ve(u,u.getOption("theme"));return}u.setOption("theme",h.args[0])},map:function(u,h,v,b){var x=h.args;if(!x||x.length<2){u&&Ve(u,"Invalid mapping: "+h.input);return}Gt.map(x[0],x[1],v,b)},imap:function(u,h){this.map(u,h,"insert")},nmap:function(u,h){this.map(u,h,"normal")},vmap:function(u,h){this.map(u,h,"visual")},omap:function(u,h){this.map(u,h,"operatorPending")},noremap:function(u,h){this.map(u,h,void 0,!0)},inoremap:function(u,h){this.map(u,h,"insert",!0)},nnoremap:function(u,h){this.map(u,h,"normal",!0)},vnoremap:function(u,h){this.map(u,h,"visual",!0)},onoremap:function(u,h){this.map(u,h,"operatorPending",!0)},unmap:function(u,h,v){var b=h.args;(!b||b.length<1||!Gt.unmap(b[0],v))&&u&&Ve(u,"No such mapping: "+h.input)},mapclear:function(u,h){Be.mapclear()},imapclear:function(u,h){Be.mapclear("insert")},nmapclear:function(u,h){Be.mapclear("normal")},vmapclear:function(u,h){Be.mapclear("visual")},omapclear:function(u,h){Be.mapclear("operatorPending")},move:function(u,h){In.processCommand(u,u.state.vim,{keys:"",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:h.line+1})},set:function(u,h){var v=h.args,b=h.setCfg||{};if(!v||v.length<1){u&&Ve(u,"Invalid mapping: "+h.input);return}var x=v[0].split("="),k=x.shift()||"",R=x.length>0?x.join("="):void 0,O=!1,N=!1;if(k.charAt(k.length-1)=="?"){if(R)throw Error("Trailing characters: "+h.argString);k=k.substring(0,k.length-1),O=!0}else k.charAt(k.length-1)=="!"&&(k=k.substring(0,k.length-1),N=!0);R===void 0&&k.substring(0,2)=="no"&&(k=k.substring(2),R=!1);var z=fe[k]&&fe[k].type=="boolean";if(z&&(N?R=!we(k,u,b):R??(R=!0)),!z&&R===void 0||O){var j=we(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=Y(k,R,u,b);se instanceof Error&&Ve(u,se.message)}},setlocal:function(u,h){h.setCfg={scope:"local"},this.set(u,h)},setglobal:function(u,h){h.setCfg={scope:"global"},this.set(u,h)},registers:function(u,h){var v=h.args,b=K.registerController.registers,x=`----------Registers----------
|
|
59
|
-
|
|
60
|
-
`;if(v)for(var k=v.join(""),R=0;R<k.length;R++){var O=k.charAt(R);if(K.registerController.isValidRegister(O)){var N=b[O]||new vn;x+='"'+O+" "+N.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,h){var v=h.args,b=u.state.vim.marks,x=`-----------Marks-----------
|
|
63
|
-
mark line col
|
|
64
|
-
|
|
65
|
-
`;if(v)for(var k=v.join(""),R=0;R<k.length;R++){var O=k.charAt(R),N=b[O]&&b[O].find();N&&(x+=O+" "+N.line+" "+N.ch+`
|
|
66
|
-
`)}else for(var O in b){var N=b[O]&&b[O].find();N&&(x+=O+" "+N.line+" "+N.ch+`
|
|
67
|
-
`)}Ve(u,x,!0)},sort:function(u,h){var v,b,x,k,R;function O(){if(h.argString){var ze=new e.StringStream(h.argString);if(ze.eat("!")&&(v=!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,cn=Ke[1].indexOf("o")!=-1;if(Number(Jt)+Number(Xt)+Number(cn)>1)return"Invalid arguments";k=Jt&&"decimal"||Xt&&"hex"||cn&&"octal"}Ke[2]&&(R=new RegExp(Ke[2].substr(1,Ke[2].length-2),b?"i":""))}}var N=O();if(N){Ve(u,N+": "+h.argString);return}var z=h.line||u.firstLine(),j=h.lineEnd||h.line||u.lastLine();if(z==j)return;var se=new n(z,0),oe=new n(j,St(u,j)),Z=u.getRange(se,oe).split(`
|
|
68
|
-
`),ee=k=="decimal"?/(-?)([\d]+)/:k=="hex"?/(-?)(?:0x)?([0-9a-f]+)/i:k=="octal"?/([0-7]+)/:null,_e=k=="decimal"?10:k=="hex"?16:k=="octal"?8:void 0,xe=[],je=[];if(k||R)for(var Te=0;Te<Z.length;Te++){var Ie=R?Z[Te].match(R):null;Ie&&Ie[0]!=""?xe.push(Ie):ee&&ee.exec(Z[Te])?xe.push(Z[Te]):je.push(Z[Te])}else je=Z;function ct(ze,Ke){if(v){var Jt=ze;ze=Ke,Ke=Jt}b&&(ze=ze.toLowerCase(),Ke=Ke.toLowerCase());var Xt=ee&&ee.exec(ze),cn=ee&&ee.exec(Ke);return!Xt||!cn?ze<Ke?-1:1:parseInt((Xt[1]+Xt[2]).toLowerCase(),_e)-parseInt((cn[1]+cn[2]).toLowerCase(),_e)}function Xe(ze,Ke){if(v){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(xe.sort(R?Xe:ct),R)for(var Te=0;Te<xe.length;Te++)xe[Te]=xe[Te].input;else k||je.sort(ct);if(Z=v?xe.concat(je):je.concat(xe),x){var Ot=Z,Pt;Z=[];for(var Te=0;Te<Ot.length;Te++)Ot[Te]!=Pt&&Z.push(Ot[Te]),Pt=Ot[Te]}u.replaceRange(Z.join(`
|
|
69
|
-
`),se,oe)},vglobal:function(u,h){this.global(u,h)},normal:function(u,h){var v=!1,b=h.argString;if(b&&b[0]=="!"&&(b=b.slice(1),v=!0),b=b.trimStart(),!b){Ve(u,"Argument is required.");return}var x=h.line;if(typeof x=="number")for(var k=isNaN(h.lineEnd)?x:h.lineEnd,R=x;R<=k;R++)u.setCursor(R,0),It(u,h.argString.trimStart(),{noremap:v}),u.state.vim.insertMode&&Ir(u,!0);else It(u,h.argString.trimStart(),{noremap:v}),u.state.vim.insertMode&&Ir(u,!0)},global:function(u,h){var v=h.argString;if(!v){Ve(u,"Regular Expression missing from global");return}var b=h.commandName[0]==="v";v[0]==="!"&&h.commandName[0]==="g"&&(b=!0,v=v.slice(1));var x=h.line===void 0?u.firstLine():h.line,k=h.lineEnd||h.line||u.lastLine(),R=Ts(v),O=v,N="";if(R&&R.length&&(O=R[0],N=R.slice(1,R.length).join("/")),O)try{hr(u,O,!0,!0)}catch{Ve(u,"Invalid regex: "+O);return}for(var z=wn(u).getQuery(),j=[],se=x;se<=k;se++){var oe=u.getLine(se);z.test(oe)!==b&&j.push(N?u.getLineHandle(se):oe)}if(!N){Ve(u,j.join(`
|
|
70
|
-
`));return}var Z=0,ee=function(){if(Z<j.length){var _e=j[Z++],xe=u.getLineNumber(_e);if(xe==null){ee();return}var je=xe+1+N;Gt.processCommand(u,je,{callback:ee})}else u.releaseLineHandles&&u.releaseLineHandles()};ee()},substitute:function(u,h){if(!u.getSearchCursor)throw Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var v=h.argString,b=v?uc(v,v[0]):[],x="",k="",R,O,N,z=!1,j=!1;if(b&&b.length)x=b[0],we("pcre")&&x!==""&&(x=new RegExp(x).source),k=b[1],k!==void 0&&(k=we("pcre")?dc(k.replace(/([^\\])&/g,"$1$$&")):ff(k),K.lastSubstituteReplacePart=k),R=b[2]?b[2].split(" "):[];else if(v&&v.length){Ve(u,"Substitutions should be of the form :s/pattern/replace/");return}if(R&&(O=R[0],N=parseInt(R[1]),O&&(O.indexOf("c")!=-1&&(z=!0),O.indexOf("g")!=-1&&(j=!0),x=we("pcre")?x+"/"+O:x.replace(/\//g,"\\/")+"/"+O)),x)try{hr(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=wn(u).getQuery(),oe=h.line===void 0?u.getCursor().line:h.line,Z=h.lineEnd||oe;oe==u.firstLine()&&Z==u.lastLine()&&(Z=1/0),N&&(oe=Z,Z=oe+N-1);var ee=yt(u,new n(oe,0)),_e=u.getSearchCursor(se,ee);Ui(u,z,j,oe,Z,_e,se,k,h.callback)},startinsert:function(u,h){It(u,h.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){mi(u)},yank:function(u){var h=Ge(u.getCursor()).line,v=u.getLine(h);K.registerController.pushText("0","yank",v,!0,!0)},delete:function(u,h){var v=h.selectionLine,b=isNaN(h.selectionLineEnd)?v:h.selectionLineEnd;Mr.delete(u,{linewise:!0},[{anchor:new n(v,0),head:new n(b+1,0)}])},join:function(u,h){var v=h.selectionLine,b=isNaN(h.selectionLineEnd)?v:h.selectionLineEnd;u.setCursor(new n(v,0)),Ht.joinLines(u,{repeat:b-v},u.state.vim)},delmarks:function(u,h){if(!h.argString||!Zn(h.argString)){Ve(u,"Argument required");return}for(var v=u.state.vim,b=new e.StringStream(Zn(h.argString));!b.eol();){b.eatSpace();var x=b.pos;if(!b.match(/[a-zA-Z]/,!1)){Ve(u,"Invalid argument: "+h.argString.substring(x));return}var k=b.next();if(b.match("-",!0)){if(!b.match(/[a-zA-Z]/,!1)){Ve(u,"Invalid argument: "+h.argString.substring(x));return}var R=k,O=b.next();if(R&&O&&M(R)==M(O)){var N=R.charCodeAt(0),z=O.charCodeAt(0);if(N>=z){Ve(u,"Invalid argument: "+h.argString.substring(x));return}for(var j=0;j<=z-N;j++){var se=String.fromCharCode(N+j);delete v.marks[se]}}else{Ve(u,"Invalid argument: "+R+"-");return}}else k&&delete v.marks[k]}}},Gt=new As;Be.defineEx("version","ve",u=>{Ve(u,"Codemirror-vim version: 6.3.0")});function Ui(u,h,v,b,x,k,R,O,N){u.state.vim.exMode=!0;var z=!1,j=0,se,oe,Z;function ee(){u.operation(function(){for(;!z;)_e(),je();Te()})}function _e(){var ct="",Xe=k.match||k.pos&&k.pos.match;ct=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(R,O);var Ot=k.to().line;k.replace(ct),oe=k.to().line,x+=oe-Ot,Z=oe<Ot}function xe(){var ct=se&&Ge(k.to()),Xe=k.findNext();return Xe&&!Xe[0]&&ct&&Vt(k.from(),ct)&&(Xe=k.findNext()),Xe&&j++,Xe}function je(){for(;xe()&&Ns(k.from(),b,x);)if(!(!v&&k.from().line==oe&&!Z)){u.scrollIntoView(k.from(),30),u.setSelection(k.from(),k.to()),se=k.from(),z=!1;return}z=!0}function Te(ct){if(ct&&ct(),u.focus(),se){u.setCursor(se);var Xe=u.state.vim;Xe.exMode=!1,Xe.lastHPos=Xe.lastHSPos=se.ch}N?N():z&&Ve(u,(j?"Found "+j+" matches":"No matches found")+" for pattern: "+R+(we("pcre")?" (set nopcre to use Vim regexps)":""))}function Ie(ct,Xe,Ot){switch(e.e_stop(ct),nn(ct)){case"y":_e(),je();break;case"n":je();break;case"a":var Pt=N;N=void 0,u.operation(ee),N=Pt;break;case"l":_e();case"q":case"<Esc>":case"<C-c>":case"<C-[>":Te(Ot);break}return z&&Te(Ot),!0}if(je(),z){Ve(u,"No matches for "+R+(we("pcre")?" (set nopcre to use vim regexps)":""));return}if(!h){ee(),N&&N();return}No(u,{prefix:nr("span","replace with ",nr("strong",O)," (y/n/a/q/l)"),onKeyDown:Ie})}function Ir(u,h){var v=u.state.vim,b=K.macroModeState,x=K.registerController.getRegister("."),k=b.isPlaying,R=b.lastInsertModeChanges;k||(u.off("change",qo),v.insertEnd&&v.insertEnd.clear(),v.insertEnd=void 0,e.off(u.getInputField(),"keydown",Fo)),!k&&v.insertModeRepeat&&v.insertModeRepeat>1&&(zs(u,v,v.insertModeRepeat-1,!0),v.lastEditInputState.repeatOverride=v.insertModeRepeat),delete v.insertModeRepeat,v.insertMode=!1,h||u.setCursor(u.getCursor().line,u.getCursor().ch-1),u.setOption("keyMap","vim"),u.setOption("disableInput",!0),u.toggleOverwrite(!1),x.setText(R.changes.join("")),e.signal(u,"vim-mode-change",{mode:"normal"}),b.isRecording&&Xr(b)}function Ao(u){a.unshift(u),u.keys&&hc(u.keys)}function hc(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(h){h&&(s[h]||(s[h]=0),s[h]++)})}function Io(u){u.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(h){s[h]&&s[h]--})}function jr(u,h,v,b,x){var k={keys:u,type:h};for(var R in k[h]=v,k[h+"Args"]=b,x)k[R]=x[R];Ao(k)}be("insertModeEscKeysTimeout",200,"number");function Is(u,h,v,b){var x=K.registerController.getRegister(b);if(b==":"){x.keyBuffer[0]&&Gt.processCommand(u,x.keyBuffer[0]),v.isPlaying=!1;return}var k=x.keyBuffer,R=0;v.isPlaying=!0,v.replaySearchQueries=x.searchQueries.slice(0);for(var O=0;O<k.length;O++)for(var N=k[O],z,j,se=/<(?:[CSMA]-)*\w+>|./gi;z=se.exec(N);)if(j=z[0],Be.handleKey(u,j,"macro"),h.insertMode){var oe=x.insertModeChanges[R++].changes;K.macroModeState.lastInsertModeChanges.changes=oe,Yr(u,oe,1),Ir(u)}v.isPlaying=!1}function jo(u,h){if(!u.isPlaying){var v=u.latestRegister,b=K.registerController.getRegister(v);b&&b.pushText(h)}}function Xr(u){if(!u.isPlaying){var h=u.latestRegister,v=K.registerController.getRegister(h);v&&v.pushInsertModeChanges&&v.pushInsertModeChanges(u.lastInsertModeChanges)}}function js(u,h){if(!u.isPlaying){var v=u.latestRegister,b=K.registerController.getRegister(v);b&&b.pushSearchQuery&&b.pushSearchQuery(h)}}function qo(u,h){var v=K.macroModeState,b=v.lastInsertModeChanges;if(!v.isPlaying)for(var x=u.state.vim;h;){if(b.expectCursorActivityForChange=!0,b.ignoreCount>1)b.ignoreCount--;else if(h.origin=="+input"||h.origin=="paste"||h.origin===void 0){var k=u.listSelections().length;k>1&&(b.ignoreCount=k);var R=h.text.join(`
|
|
71
|
-
`);if(b.maybeReset&&(b.maybeReset=(b.changes=[],!1)),R)if(u.state.overwrite&&!/\n/.test(R))b.changes.push([R]);else{if(R.length>1){var O=x&&x.insertEnd&&x.insertEnd.find(),N=u.getCursor();if(O&&O.line==N.line){var z=O.ch-N.ch;z>0&&z<R.length&&(b.changes.push([R,z]),R="")}}R&&b.changes.push(R)}}h=h.next}}function qs(u){var x;var h=u.state.vim;if(h.insertMode){var v=K.macroModeState;if(v.isPlaying)return;var b=v.lastInsertModeChanges;b.expectCursorActivityForChange?b.expectCursorActivityForChange=!1:(b.maybeReset=!0,h.insertEnd&&h.insertEnd.clear(),h.insertEnd=u.setBookmark(u.getCursor(),{insertLeft:!0}))}else(x=u.curOp)!=null&&x.isVimOp||zo(u,h)}function zo(u,h){var v=u.getCursor("anchor"),b=u.getCursor("head");if(h.visualMode&&!u.somethingSelected()?Je(u,!1):!h.visualMode&&!h.insertMode&&u.somethingSelected()&&(h.visualMode=!0,h.visualLine=!1,e.signal(u,"vim-mode-change",{mode:"visual"})),h.visualMode){var x=lt(b,v)?0:-1,k=lt(b,v)?-1:0;b=Ct(b,0,x),v=Ct(v,0,k),h.sel={anchor:v,head:b},pr(u,h,"<",vt(b,v)),pr(u,h,">",On(b,v))}else h.insertMode||(h.lastHPos=u.getCursor().ch)}function Fo(u){var h=K.macroModeState.lastInsertModeChanges,v=e.keyName?e.keyName(u):u.key;v&&(v.indexOf("Delete")!=-1||v.indexOf("Backspace")!=-1)&&(h.maybeReset&&(h.maybeReset=(h.changes=[],!1)),h.changes.push(new Qe(v,u)))}function zs(u,h,v,b){var x=K.macroModeState;x.isPlaying=!0;var k=h.lastEditActionCommand,R=h.inputState;function O(){k?In.processAction(u,h,k):In.evalInput(u,h)}function N(j){if(x.lastInsertModeChanges.changes.length>0){j=h.lastEditActionCommand?j:1;var se=x.lastInsertModeChanges;Yr(u,se.changes,j)}}if(h.inputState=h.lastEditInputState,k&&k.interlaceInsertRepeat)for(var z=0;z<v;z++)O(),N(1);else b||O(),N(v);h.inputState=R,h.insertMode&&!b&&Ir(u),x.isPlaying=!1}function Cn(u,h){e.lookupKey(h,"vim-insert",function(v){return typeof v=="string"?e.commands[v](u):v(u),!0})}function Yr(u,h,v){var b=u.getCursor("head"),x=K.macroModeState.lastInsertModeChanges.visualBlock;x&&(Hn(u,b,x+1),v=u.listSelections().length,u.setCursor(b));for(var k=0;k<v;k++){x&&u.setCursor(Ct(b,k,0));for(var R=0;R<h.length;R++){var O=h[R];if(O instanceof Qe)Cn(u,O.keyName);else if(typeof O=="string")u.replaceSelection(O);else{var N=u.getCursor(),z=Ct(N,0,O[0].length-(O[1]||0));u.replaceRange(O[0],N,O[1]?N:z),u.setCursor(z)}}}x&&u.setCursor(Ct(b,0,1))}function Ki(u){var h=new u.constructor;return Object.keys(u).forEach(function(v){if(v!="insertEnd"){var b=u[v];Array.isArray(b)?b=b.slice():b&&typeof b=="object"&&b.constructor!=Object&&(b=Ki(b)),h[v]=b}}),u.sel&&(h.sel={head:u.sel.head&&Ge(u.sel.head),anchor:u.sel.anchor&&Ge(u.sel.anchor)}),h}function Bo(u,h,v){var k=G(u),b=u,x=!1,k=Be.maybeInitVimState_(b),R=k.visualBlock||k.wasInVisualBlock;if(b.state.closeVimNotification){var O=b.state.closeVimNotification;if(b.state.closeVimNotification=null,O(),h=="<CR>")return kt(b),!0}var N=b.isInMultiSelectMode();if(k.wasInVisualBlock&&!N?k.wasInVisualBlock=!1:N&&k.visualBlock&&(k.wasInVisualBlock=!0),h=="<Esc>"&&!k.insertMode&&!k.visualMode&&N&&k.status=="<Esc>")kt(b);else if(R||!N||b.inVirtualSelectionMode)x=Be.handleKey(b,h,v);else{var z=Ki(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 Z=b.getCursor("head"),ee=b.getCursor("anchor"),_e=lt(Z,ee)?0:-1,xe=lt(Z,ee)?-1:0;Z=Ct(Z,0,_e),ee=Ct(ee,0,xe),b.state.vim.sel.head=Z,b.state.vim.sel.anchor=ee,x=Be.handleKey(b,h,v),b.virtualSelection&&(j[se]=b.state.vim.inputState.changeQueue,b.state.vim=Ki(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()&&zo(b,k),x}return Le(),Be}function Gn(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 Dr(e,n){let i=e.lineAt(n);return{line:i.number-1,ch:n-i.from}}var Vr=class{constructor(e,n){this.line=e,this.ch=n}};function h0(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 g0(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 y0(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 v0(e,...n){if(e)for(var i=0;i<e.length;++i)e[i](...n)}var Td;try{Td=RegExp("[\\w\\p{Alphabetic}\\p{Number}_]","u")}catch{Td=/[\w]/}function ys(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 b0(e,n){var a;e.curOp&&(e.curOp.$changeStart=void 0),(n?RR:wR)(e.cm6);let i=(a=e.curOp)==null?void 0:a.$changeStart;i!=null&&e.cm6.dispatch({selection:{anchor:i}})}var ak={Left:e=>us(e.cm6,{key:"Left"},"editor"),Right:e=>us(e.cm6,{key:"Right"},"editor"),Up:e=>us(e.cm6,{key:"Up"},"editor"),Down:e=>us(e.cm6,{key:"Down"},"editor"),Backspace:e=>us(e.cm6,{key:"Backspace"},"editor"),Delete:e=>us(e.cm6,{key:"Delete"},"editor")},Ze=class k_{openDialog(n,i,a){return lk(this,n,i,a)}openNotification(n,i){return sk(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){h0(this,n,i)}off(n,i){g0(this,n,i)}signal(n,i,a){y0(this,n,i,a)}indexFromPos(n){return Gn(this.cm6.state.doc,n)}posFromIndex(n){return Dr(this.cm6.state.doc,n)}foldCode(n){let i=this.cm6,a=i.state.selection.ranges,s=this.cm6.state.doc,c=Gn(s,n),d=pn.create([pn.range(c,c)],0).ranges;i.state.selection.ranges=d,lR(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=Gn(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:Dr(n,i.anchor),head:Dr(n,i.head)}))}setSelections(n,i){var a=this.cm6.state.doc,s=n.map(c=>{var d=Gn(a,c.head),f=Gn(a,c.anchor);return d==f?pn.cursor(d,1):pn.range(f,d)});this.cm6.dispatch({selection:pn.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 Vr(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,y2.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(Gn(a,n),Gn(a,i))}replaceRange(n,i,a,s){a||(a=i);var c=this.cm6.state.doc,d=Gn(c,i),f=Gn(c,a);ys(this,{changes:{from:d,to:f,insert:n}})}replaceSelection(n){ys(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]||""}));ys(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 Vr(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:pn.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=Gn(a.doc,n),c=b2(a,s+1,-1);return c&&c.end||(c=b2(a,s,1),c&&c.end)?{to:Dr(a.doc,c.end.from)}:{to:void 0}}scanForBracket(n,i,a,s){return dk(this,n,i,a,s)}indentLine(n,i){i?this.indentMore():this.indentLess()}indentMore(){IR(this.cm6)}indentLess(){CR(this.cm6)}execCommand(n){if(n=="indentAuto")k_.commands.indentAuto(this);else if(n=="goLineLeft")DR(this.cm6);else if(n=="goLineRight"){ER(this.cm6);let i=this.cm6.state,a=i.selection.main.head;a<i.doc.length&&i.sliceDoc(a,a+1)!==`
|
|
73
|
-
`&&SR(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 mk(this,s,a)}addOverlay({query:n}){let i=new LR({regexp:!0,search:n.source,caseSensitive:!/i/.test(n.flags)});if(i.valid){i.forVim=!0,this.cm6Query=i;let a=am.of(i);return this.cm6.dispatch({effects:a}),i}}removeOverlay(n){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let i=am.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 f=Gn(a.cm6.state.doc,i),m=n.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(E,T){return T||"\\"+E});function g(E,T=0,A=E.length){return new OR(E,m,{ignoreCase:n.ignoreCase},T,A)}function w(E){var T=a.cm6.state.doc;if(E>T.length)return null;let A=g(T,E).next();return A.done?null:A.value}var _=1e4;function C(E,T){var A=a.cm6.state.doc;for(let H=1;;H++){let V=Math.max(E,T-H*_),W=g(A,V,T),M=null;for(;!W.next().done;)M=W.value;if(M&&(V==E||M.from>V+10))return M;if(V==E)return null}}return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(E){var T=a.cm6.state.doc;return s=E?C(0,s?d?s.to-1:s.from:f):w(s?d?s.to+1:s.to:f),c=s&&{from:Dr(T,s.from),to:Dr(T,s.to),match:s.match},d=s?s.from==s.to:!1,s&&s.match},from:function(){return c==null?void 0:c.from},to:function(){return c==null?void 0:c.to},replace:function(E){s&&(ys(a,{changes:{from:s.from,to:s.to,insert:E}}),s.to=s.from+E.length,c&&(c.to=Dr(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,f=a=="page"?c.dom.clientHeight:0,m=Gn(d,n),g=pn.cursor(m,1,void 0,s),w=Math.round(Math.abs(i));for(let C=0;C<w;C++)a=="page"?g=c.moveVertically(g,i>0,f):a=="line"&&(g=c.moveVertically(g,i>0));let _=Dr(d,g.head);return(i<0&&g.head==0&&s!=0&&n.line==0&&n.ch!=0||i>0&&g.head==d.length&&_.ch!=s&&n.line==_.line)&&(_.hitSide=!0),_}charCoords(n,i){var a=this.cm6.contentDOM.getBoundingClientRect(),s=Gn(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 Dr(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:en.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,f)=>{(i.$changeStart==null||i.$changeStart>c)&&(i.$changeStart=c),this.$lastChangeEndOffset=d;var m={text:f.toJSON()};i.lastChange?i.lastChange.next=i.lastChange=m:i.lastChange=i.change=m},!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&&v0(n.changeHandlers,this,n.change),n&&n.cursorActivity&&(v0(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(v2)==" ";case"indentUnit":return this.cm6.state.facet(v2).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=k2(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 pn.range(c.from,c.to+1)}return c});this.cm6.dispatch({selection:pn.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=pn.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:pn.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 hk(this,n)}};Ze.isMac=typeof navigator<"u"&&/Mac/.test(navigator.platform),Ze.Pos=Vr,Ze.StringStream=bR,Ze.commands={cursorCharLeft:function(e){PR(e.cm6)},redo:function(e){b0(e,!1)},undo:function(e){b0(e,!0)},newlineAndIndent:function(e){AR({state:e.cm6.state,dispatch:n=>ys(e,n)})},indentAuto:function(e){_R(e.cm6)},newlineAndIndentContinueComment:void 0,save:void 0},Ze.isWordChar=function(e){return Td.test(e)},Ze.keys=ak,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=h0,Ze.off=g0,Ze.signal=y0,Ze.findMatchingTag=fk,Ze.findEnclosingTag=pk,Ze.keyName=void 0;function w0(e,n,i){var a=document.createElement("div");return a.appendChild(n),a}function _0(e,n){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=n}function sk(e,n,i){_0(e,f);var a=w0(e,n,i&&i.bottom),s=!1,c,d=i&&i.duration!==void 0?i.duration:5e3;function f(){s||(s=!0,clearTimeout(c),a.remove(),k0(e,a))}return a.onclick=function(m){m.preventDefault(),f()},x0(e,a),d&&(c=setTimeout(f,d)),f}function x0(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 k0(e,n){e.state.dialog==n&&(e.state.dialog=null,Ze.signal(e,"dialog"))}function lk(e,n,i,a){a||(a={}),_0(e,void 0);var s=w0(e,n,a.bottom),c=!1;x0(e,s);function d(m){if(typeof m=="string")f.value=m;else{if(c)return;c=!0,k0(e,s),e.state.dialog||e.focus(),a.onClose&&a.onClose(s)}}var f=s.getElementsByTagName("input")[0];return f&&(a.value&&(f.value=a.value,a.selectValueOnOpen!==!1&&f.select()),a.onInput&&Ze.on(f,"input",function(m){a.onInput(m,f.value,d)}),a.onKeyUp&&Ze.on(f,"keyup",function(m){a.onKeyUp(m,f.value,d)}),Ze.on(f,"keydown",function(m){a&&a.onKeyDown&&a.onKeyDown(m,f.value,d)||(m.keyCode==13&&i&&i(f.value),(m.keyCode==27||a.closeOnEnter!==!1&&m.keyCode==13)&&(f.blur(),Ze.e_stop(m),d()))}),a.closeOnBlur!==!1&&Ze.on(f,"blur",function(){setTimeout(function(){document.activeElement!==f&&d()})}),f.focus()),d}var ck={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function uk(e){return e&&e.bracketRegex||/[(){}[\]]/}function dk(e,n,i,a,s){for(var c=s&&s.maxScanLineLength||1e4,d=s&&s.maxScanLines||1e3,f=[],m=uk(s),g=i>0?Math.min(n.line+d,e.lastLine()+1):Math.max(e.firstLine()-1,n.line-d),w=n.line;w!=g;w+=i){var _=e.getLine(w);if(_){var C=i>0?0:_.length-1,E=i>0?_.length:-1;if(!(_.length>c))for(w==n.line&&(C=n.ch-(i<0?1:0));C!=E;C+=i){var T=_.charAt(C);if(m.test(T)){var A=ck[T];if(A&&A.charAt(1)==">"==i>0)f.push(T);else if(f.length)f.pop();else return{pos:new Vr(w,C),ch:T}}}}}return w-i==(i>0?e.lastLine():e.firstLine())?!1:null}function fk(e,n){return null}function pk(e,n){var c,d,f;var i=e.cm6.state,a=e.indexFromPos(n);a<i.doc.length&&i.sliceDoc(a,a+1)=="<"&&a++;for(var s=((c=k2(i,a))==null?void 0:c.resolve(a))||null;s;){if(((d=s.firstChild)==null?void 0:d.type.name)=="OpenTag"&&((f=s.lastChild)==null?void 0:f.type.name)=="CloseTag")return{open:C0(i.doc,s.firstChild),close:C0(i.doc,s.lastChild)};s=s.parent}}function C0(e,n){return{from:Dr(e,n.from),to:Dr(e,n.to)}}var mk=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,y2.TrackDel))}};function hk(e,n){var T;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 f=E(d,i,5);if(f){var m=(T=/^\s*/.exec(d))==null?void 0:T[0];e.replaceRange(`
|
|
74
|
-
`+m,new Vr(s,f.start),new Vr(s,f.end))}c++}else if(a&&/\S/.test(d)&&s!=c){var g=e.getLine(s+1);if(g&&/\S/.test(g)){var w=d.replace(/\s+$/,""),_=g.replace(/^\s+/,""),C=w+" "+_,f=E(C,i,5);f&&f.start>w.length||C.length<i?(e.replaceRange(" ",new Vr(s,w.length),new Vr(s+1,g.length-_.length)),s--,c--):w.length<d.length&&e.replaceRange("",new Vr(s,w.length),new Vr(s,d.length))}}s++}return s;function E(A,H,V){if(!(A.length<H)){var W=A.slice(0,H),M=A.slice(H),Q=/^(?:(\s+)|(\S+)(\s+))/.exec(M),pe=/(?:(\s+)|(\s+)(\S+))$/.exec(W),P=0,I=0;if(pe&&!pe[2]&&(P=H-pe[1].length,I=H),Q&&!Q[2]&&(P||(P=H),I=H+Q[1].length),P)return{start:P,end:I};if(pe&&pe[2]&&pe.index>V)return{start:pe.index,end:pe.index+pe[2].length};if(Q&&Q[2])return P=H+Q[2].length,{start:P,end:P+Q[3].length}}}}var Rd=mR||(function(){let e={cursorBlinkRate:1200};return function(){return e}})(),gk=class{constructor(e,n,i,a,s,c,d,f,m,g){this.left=e,this.top=n,this.height=i,this.fontFamily=a,this.fontSize=s,this.fontWeight=c,this.color=d,this.className=f,this.letter=m,this.partial=g}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}},yk=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=Rd(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"),vk(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=_k(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 vk(e){return Rd(e.startState)!=Rd(e.state)}var bk=xu.highest(en.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 wk(e){let n=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==vR.LTR?n.left:n.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft*e.scaleX,top:n.top-e.scrollDOM.scrollTop*e.scaleY}}function _k(e,n,i,a){var w,_,C;var s;let c=i.head,d=!1,f=1,m=e.state.vim;if(m&&(!m.insertMode||e.state.overwrite)){if(d=!0,m.visualBlock&&!a)return null;i.anchor<i.head&&(c<n.state.doc.length&&n.state.sliceDoc(c,c+1))!=`
|
|
75
|
-
`&&c--,e.state.overwrite?f=.2:m.status&&(f=.5)}if(d){let E=c<n.state.doc.length&&n.state.sliceDoc(c,c+1);E&&/[\uDC00-\uDFFF]/.test(E)&&c>1&&(c--,E=n.state.sliceDoc(c,c+1));let T=n.coordsAtPos(c,1);if(!T)return null;let A=wk(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 W=getComputedStyle(V),M=T.left,Q=(C=(s=n).coordsForChar)==null?void 0:C.call(s,c);if(Q&&(M=Q.left),!E||E==`
|
|
76
|
-
`||E=="\r")E="\xA0";else if(E==" "){E="\xA0";var g=n.coordsAtPos(c+1,-1);g&&(M=g.left-(g.left-T.left)/parseInt(W.tabSize))}else/[\uD800-\uDBFF]/.test(E)&&c<n.state.doc.length-1&&(E+=n.state.sliceDoc(c+1,c+2));let pe=T.bottom-T.top;return new gk((M-A.left)/n.scaleX,(T.top-A.top+pe*(1-f))/n.scaleY,pe*f/n.scaleY,W.fontFamily,W.fontSize,W.fontWeight,W.color,a?"cm-fat-cursor cm-cursor-primary":"cm-fat-cursor cm-cursor-secondary",E,f!=1)}else return null}let S0,E0,T0,R0;S0=typeof navigator<"u"&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent),Li=ok(Ze),E0=250,T0=en.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"}}),R0=sa.fromClass(class{constructor(e){this.status="",this.query=null,this.decorations=Oi.none,this.waitForCopy=!1,this.lastKeydown="",this.useNextTextInput=!1,this.compositionText="",this.view=e;let n=this.cm=new Ze(e);Li.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new yk(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:D0.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=>{Li.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(am))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(){Li.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=Oi.none;let{view:n}=this,i=new _2;for(let a=0,s=n.visibleRanges,c=s.length;a<c;a++){let{from:d,to:f}=s[a];for(;a<c-1&&f>s[a+1].from-2*E0;)f=s[++a].to;e.highlight(n.state,d,f,(m,g)=>{i.add(m,g,kk)})}return this.decorations=i.finish()}handleKey(e,n){let i=this.cm,a=i.state.vim;if(!a)return;let s=Li.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=Li.multiSelectHandleKey(i,s,"user");return a=Li.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),Li.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:()=>[en.inputHandler.of((e,n,i,a)=>{var w,_;var s=jl(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 f=d.compositionText;d.compositionText="";var m=e.state.selection.main.head;if(f===e.state.sliceDoc(m-f.length,m)){var g=s.getCursor();s.replaceRange("",s.posFromIndex(m-f.length),g)}}return d.handleKey({key:a,preventDefault:()=>{},stopPropagation:()=>{}}),xk(e),!0}}return!1})],decorations:e=>e.decorations});function xk(e){var n=e.scrollDOM.parentElement;if(n){if(S0){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 kk=Oi.mark({class:"cm-searchMatch"}),D0=ho.define(),Ck=Rl.define({create:()=>!1,update(e,n){for(let i of n.effects)i.is(D0)&&(e=i.value);return e},provide:e=>im.from(e,n=>n?Sk:null)});function Sk(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 Ek(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}}mw=function(e={}){return[T0,R0,bk,e.status?im.of(Ek):Ck]},jl=function(e){return e.cm||null},vm=function(e){let n=e.state.selection.main;return n.from===0&&n.to===0},bm=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},H2=function(e){e&&e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length}})},dw=function(e){var n;return((n=jl(e))==null?void 0:n.state.vim)!=null},Xw=function(e){var i;let n=(i=jl(e))==null?void 0:i.state.vim;return n?!n.mode&&!n.insertMode&&!n.visualMode?!0:n.mode==="normal":!1},Qw=function(e){e&&e.dispatch({selection:{anchor:0,head:e.state.doc.length}})};function O0(e,n){if(!(n!=null&&n.length))return Oi.none;let i=new _2,a=e.facet(da),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),f=Oi.line({class:"cm-error-line"});i.add(d.from,d.from,f)}return i.finish()}var Tk=class{constructor(e,n){this.decorations=O0(e.state,n.get()),this.unsubscribe=n.sub(i=>{let a=this.decorations.size;this.decorations=O0(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 Rk(e){return sa.define(n=>new Tk(n,e),{decorations:n=>n.decorations})}function Dk(e){return[Rk(e),en.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 Ok({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=>(Rm(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=>L2(a.state)?!1:vm(a)?(a.state.facet(Dt).moveToNextCell({cellId:e,before:!0,noCreate:!0}),!0):!1},{key:"ArrowDown",preventDefault:!0,stopPropagation:!0,run:a=>L2(a.state)?!1:bm(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 N2(a),s?(a.contentDOM.blur(),(c=document.getElementById(ur.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}}),[xu.high(aa.of(i))]}function Pk(e){return[en.updateListener.of(n=>{if(n.docChanged){let i=n.transactions.some(d=>d.effects.some(f=>f.is(va))),a=ai(n.view),s=n.view.state.facet(Dt),c=n.view.state.facet(da);s.updateCellCode({cellId:c,code:a,formattingChange:i})}}),Mx(e)]}function Lk({predicate:e}){return en.updateListener.of(n=>{n.docChanged&&n.view.hasFocus&&e()&&(n.transactions.some(i=>i.effects.some(a=>a.is(va)))||n.view.state.facet(Dt).onRun())})}ww=function({cellId:e,hotkeys:n,cellActions:i}){return[Dt.of(i),da.of(e),Ok({cellId:e,hotkeys:n}),Pk(n),Dk(Px(sT(e),st))]};const P0=async e=>{let n=e.state.doc.sliceString(0,e.pos),i=document.activeElement,a=null;if(i!==null){let d=ur.findElement(i);d!==null&&(a=ur.parse(d.id))}if(a===null)return Pe.error("Failed to find active cell."),null;let s=await Ru.request({document:n,cellId:a});if(!s)return null;let c=Ed.asHoverTooltip({position:e.pos,message:s,limitToType:"tooltip"});return c&&st.set(zu,{documentation:c.html??null}),c?null:Ed.asCompletionResult(e.pos,s)};function Nk(e){return n=>e.predicate(n.state)?e.completion(n):null}var Mk=async e=>{let n=e.matchBefore(/:\w*$/);if(!e.explicit&&!n)return null;let i=await Ak();return{from:(n==null?void 0:n.from)??e.pos,options:i,validFor:/^[\w:]*$/}},Ak=ri(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"}))}),Ik=async e=>{let n=e.matchBefore(/::[\w-:]*$/);if(!e.explicit&&!n)return null;let i=await jk();return{from:(n==null?void 0:n.from)??e.pos,options:i,validFor:/^[\w-:]*$/}},jk=ri(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}}))}),qk=e=>{let n=e.matchBefore(/\\\w*$/);return!e.explicit&&!n?null:{from:(n==null?void 0:n.from)??e.pos,options:zk(),validFor:/^[\w\\]*$/}},zk=ri(()=>[["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 L0;L0=[Mk,Ik,qk],rd={isAbsolute:e=>e.startsWith("/")||e.startsWith("\\")||e.startsWith("C:\\"),dirname:e=>Al.guessDeliminator(e).dirname(e),basename:e=>Al.guessDeliminator(e).basename(e),rest:(e,n)=>Al.guessDeliminator(e).rest(e,n),extension:e=>{let n=e.split(".");return n.length===1?"":n.at(-1)??""}},Al=class lh{constructor(n){this.deliminator=n}static guessDeliminator(n){return n.includes("/")?new lh("/"):new lh("\\")}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 ba(e){return!e.state.selection.main.empty}function Dd({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),f=d.text.startsWith(i);s?a.push({from:d.from,to:d.from+i.length,insert:la.of([""])}):(f&&a.push({from:d.from,to:d.from+i.length,insert:la.of([""])}),a.push({from:d.from,insert:la.of([i])})),c=d.to+1}return a}function Od({view:e,range:n,markupAfter:i,markupBefore:a}){if(n.empty){let g=e.state.wordAt(n.head);g&&(n=g)}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:la.of([""])}:{from:n.from,insert:la.of(a.split(`
|
|
77
|
-
`))},c?{from:n.to,to:n.to+i.length,insert:la.of([""])}:{from:n.to,insert:la.of(i.split(`
|
|
78
|
-
`))});let f=s?-a.length:a.length,m=c?-i.length:i.length;return{changes:d,range:pn.range(n.from+f,n.to+m)}}function Fk(e){if(!ba(e))return!1;let n=Dd({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 Bk(e){if(!ba(e))return!1;let n=e.state.changeByRange(i=>{if(i.empty){let a=e.state.wordAt(i.head);a&&(i=a)}return Od({view:e,range:i,markupBefore:"**",markupAfter:"**"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:ds.userEvent.of("input")})),e.focus(),!0}function N0(e){if(!ba(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 Od({view:e,range:i,markupBefore:a?"```\n":"`",markupAfter:a?"\n```":"`"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:ds.userEvent.of("input")})),e.focus(),!0}function Hk(e){let n=e.state.changeByRange(i=>{if(i.empty){let a=e.state.wordAt(i.head);a&&(i=a)}return Od({view:e,range:i,markupBefore:"_",markupAfter:"_"})});return e.dispatch(e.state.update(n,{scrollIntoView:!0,annotations:ds.userEvent.of("input")})),e.focus(),!0}function M0(e,n="http://"){if(!ba(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:ds.userEvent.of("input")}));let{to:a}=i.selection.main;try{e.dispatch({selection:pn.create([pn.range(a+3,a+3+n.length),pn.cursor(a+3+n.length)])})}catch{}return e.focus(),!0}oh=async function(e,n){var f;let i=new FileReader,a=await new Promise(m=>{i.onload=()=>m(i.result),i.readAsDataURL(n)}),s;try{if(a.startsWith("data:")){let m=a.split(",")[1],g=prompt("We can save your image as a file. Enter a filename.",n.name),w=n.type.split("/")[1];if(g!==null){g.trim()===""?g=n.name:g.endsWith(`.${w}`)||(g=`${g}.${w}`);let _=st.get(ms),C=_?rd.dirname(_):null,E=C?`${C}/public`:"public",T=await Pi().sendCreateFileOrFolder({path:E,type:"file",name:g,contents:m});T.success?(s=(f=T.info)==null?void 0:f.path,Su({title:"Image uploaded successfully",description:`We've uploaded your image at ${s}`})):Su({title:"Failed to upload image. Using raw base64 string."})}}}catch{Su({title:"Failed to upload image. Using raw base64 string."})}let c=e.state.changeByRange(m=>{let g=e.state.sliceDoc(m.from,m.to);return{changes:[{from:m.from,to:m.to,insert:``}],range:m}});e.dispatch(e.state.update(c,{scrollIntoView:!0,annotations:ds.userEvent.of("input")}));let{to:d}=c.selection.main;try{e.dispatch({selection:pn.create([pn.range(d+4,d+4+a.length),pn.cursor(d+4+a.length)])})}catch{}return e.focus(),!0},Mm=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:ds.userEvent.of("input")})),e.focus(),!0};function Vk(e){if(!ba(e))return!1;let{changes:n}=e.state.changeByRange(i=>({range:i,changes:Dd({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 $k(e){if(!ba(e))return!1;let{changes:n}=e.state.changeByRange(i=>({range:i,changes:Dd({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 Wk(e){return[xu.highest(aa.of([{key:e.getHotkey("markdown.bold").key,stopPropagation:!0,run:Bk},{key:e.getHotkey("markdown.italic").key,stopPropagation:!0,run:Hk},{key:e.getHotkey("markdown.link").key,stopPropagation:!0,run:n=>M0(n)},{key:e.getHotkey("markdown.orderedList").key,run:$k},{key:e.getHotkey("markdown.unorderedList").key,run:Vk},{key:e.getHotkey("markdown.blockquote").key,run:Fk},{key:e.getHotkey("markdown.code").key,run:N0},{key:"`",run:N0}])),en.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(),M0(i,a))}}),en.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(),oh(i,a),!0;if(a.type.startsWith("text/"))return n.preventDefault(),Mm(i,a),!0}})]}function Uk(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:()=>Fm(s)})}Fm=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 wa="Python",Pd=123,A0=125,Ld=1,Kk={mark:`${wa}Mark`,resolve:wa};function Qk(e,n){return{defineNodes:[{name:wa,style:wu.emphasis},{name:`${wa}Mark`,style:wu.processingInstruction}],parseInline:[{name:wa,parse(i,a,s){return!n()||a!==Pd&&a!==A0||a===Pd&&i.slice(s-1,s)==="{"?-1:i.addDelimiter(Kk,s,s+Ld,a===Pd,a===A0)}}],wrap:C2(i=>{if(!n()||i.type.name!==wa)return null;let a=i.from+Ld,s=i.to-Ld;return a>=s||a<0||s<0?null:{parser:e,overlay:[{from:a,to:s}],extensions:[A2().support]}})}}const Gk=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=Uk(st.get(vo),new Set,99);return{from:a.from,options:s,validFor:/^\w*$/}};var Ul="InlineMathDollar",_a="InlineMathBracket",Kl="BlockMathDollar",xa="BlockMathBracket",ko={[Ul]:1,[_a]:3,[Kl]:2,[xa]:3},Nt={DOLLAR:36,BACKSLASH:92,OPEN_PAREN:40,CLOSE_PAREN:41,OPEN_BRACKET:91,CLOSE_BRACKET:93},ka=Object.keys(ko).reduce((e,n)=>(e[n]={mark:`${n}Mark`,resolve:n},e),{});function Jk(e){let n=[];return Object.keys(ko).forEach(i=>{n.push({name:i,style:wu.emphasis},{name:`${i}Mark`,style:wu.processingInstruction})}),{defineNodes:n,parseInline:[{name:Kl,parse(i,a,s){return a!==Nt.DOLLAR||i.char(s+1)!==Nt.DOLLAR?-1:i.addDelimiter(ka[Kl],s,s+ko[Kl],!0,!0)}},{name:Ul,parse(i,a,s){return a!==Nt.DOLLAR||i.char(s+1)===Nt.DOLLAR?-1:i.addDelimiter(ka[Ul],s,s+ko[Ul],!0,!0)}},{name:_a,before:"Escape",parse(i,a,s){return a!==Nt.BACKSLASH||i.char(s+1)!==Nt.BACKSLASH||![Nt.OPEN_PAREN,Nt.CLOSE_PAREN].includes(i.char(s+2))?-1:i.addDelimiter(ka[_a],s,s+ko[_a],i.char(s+2)===Nt.OPEN_PAREN,i.char(s+2)===Nt.CLOSE_PAREN)}},{name:xa,before:"Escape",parse(i,a,s){return a!==Nt.BACKSLASH||i.char(s+1)!==Nt.BACKSLASH||![Nt.OPEN_BRACKET,Nt.CLOSE_BRACKET].includes(i.char(s+2))?-1:i.addDelimiter(ka[xa],s,s+ko[xa],i.char(s+2)===Nt.OPEN_BRACKET,i.char(s+2)===Nt.CLOSE_BRACKET)}},{name:_a,before:"Escape",parse(i,a,s){return a!==Nt.BACKSLASH||![Nt.OPEN_PAREN,Nt.CLOSE_PAREN].includes(i.char(s+1))?-1:i.addDelimiter(ka[_a],s,s+2,i.char(s+1)===Nt.OPEN_PAREN,i.char(s+1)===Nt.CLOSE_PAREN)}},{name:xa,before:"Escape",parse(i,a,s){return a!==Nt.BACKSLASH||![Nt.OPEN_BRACKET,Nt.CLOSE_BRACKET].includes(i.char(s+1))?-1:i.addDelimiter(ka[xa],s,s+2,i.char(s+1)===Nt.OPEN_BRACKET,i.char(s+1)===Nt.CLOSE_BRACKET)}}],wrap:C2(i=>{let a=ko[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})}}td=ho.define(),od=ho.define(),oi=Rl.define({create:()=>({}),update:(e,n)=>{for(let i of n.effects){if(i.is(td))return i.value;if(i.is(od))return{...e,...i.value}}return e}});let Nd,I0,Ca,j0,Sa,q0;$u=class{constructor(){Ce(this,"parser",new t0);Ce(this,"type","markdown");Ce(this,"defaultCode",this.parser.defaultCode);Ce(this,"defaultMetadata",this.parser.defaultMetadata)}static fromMarkdown(e){return t0.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=M2().language.data,c,d=()=>{var m;if(!c)return!0;let f=c==null?void 0:c.state.field(oi);return f===void 0?!1:((m=f.quotePrefix)==null?void 0:m.includes("f"))??!1};return[sa.define(f=>(c=f,{})),M2({base:BR,codeLanguages:ax,extensions:[Jk(S2.define(WR).parser),Qk(lm.parser,d)]}),Wk(i),L0.map(f=>s.of({autocomplete:f})),A2().language.data.of({autocomplete:Nk({completion:P0,predicate:d})}),ku({defaultKeymap:!1,activateOnTyping:!0}),Lk({predicate:()=>!d()})]}},Nd=ke(((e,n)=>{var i=typeof Reflect=="object"?Reflect:null,a=i&&typeof i.apply=="function"?i.apply:function(P,I,$){return Function.prototype.apply.call(P,I,$)},s=i&&typeof i.ownKeys=="function"?i.ownKeys:Object.getOwnPropertySymbols?function(P){return Object.getOwnPropertyNames(P).concat(Object.getOwnPropertySymbols(P))}:function(P){return Object.getOwnPropertyNames(P)};function c(P){console&&console.warn&&console.warn(P)}var d=Number.isNaN||function(P){return P!==P};function f(){f.init.call(this)}n.exports=f,n.exports.once=M,f.EventEmitter=f,f.prototype._events=void 0,f.prototype._eventsCount=0,f.prototype._maxListeners=void 0;var m=10;function g(P){if(typeof P!="function")throw TypeError('The "listener" argument must be of type Function. Received type '+typeof P)}Object.defineProperty(f,"defaultMaxListeners",{enumerable:!0,get:function(){return m},set:function(P){if(typeof P!="number"||P<0||d(P))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+P+".");m=P}}),f.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},f.prototype.setMaxListeners=function(P){if(typeof P!="number"||P<0||d(P))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+P+".");return this._maxListeners=P,this};function w(P){return P._maxListeners===void 0?f.defaultMaxListeners:P._maxListeners}f.prototype.getMaxListeners=function(){return w(this)},f.prototype.emit=function(P){for(var I=[],$=1;$<arguments.length;$++)I.push(arguments[$]);var de=P==="error",fe=this._events;if(fe!==void 0)de&&(de=fe.error===void 0);else if(!de)return!1;if(de){var be;if(I.length>0&&(be=I[0]),be instanceof Error)throw be;var Y=Error("Unhandled error."+(be?" ("+be.message+")":""));throw Y.context=be,Y}var we=fe[P];if(we===void 0)return!1;if(typeof we=="function")a(we,this,I);else for(var Ee=we.length,ie=H(we,Ee),$=0;$<Ee;++$)a(ie[$],this,I);return!0};function _(P,I,$,de){var fe,be,Y;if(g($),be=P._events,be===void 0?(be=P._events=Object.create(null),P._eventsCount=0):(be.newListener!==void 0&&(P.emit("newListener",I,$.listener?$.listener:$),be=P._events),Y=be[I]),Y===void 0)Y=be[I]=$,++P._eventsCount;else if(typeof Y=="function"?Y=be[I]=de?[$,Y]:[Y,$]:de?Y.unshift($):Y.push($),fe=w(P),fe>0&&Y.length>fe&&!Y.warned){Y.warned=!0;var we=Error("Possible EventEmitter memory leak detected. "+Y.length+" "+String(I)+" listeners added. Use emitter.setMaxListeners() to increase limit");we.name="MaxListenersExceededWarning",we.emitter=P,we.type=I,we.count=Y.length,c(we)}return P}f.prototype.addListener=function(P,I){return _(this,P,I,!1)},f.prototype.on=f.prototype.addListener,f.prototype.prependListener=function(P,I){return _(this,P,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(P,I,$){var de={fired:!1,wrapFn:void 0,target:P,type:I,listener:$},fe=C.bind(de);return fe.listener=$,de.wrapFn=fe,fe}f.prototype.once=function(P,I){return g(I),this.on(P,E(this,P,I)),this},f.prototype.prependOnceListener=function(P,I){return g(I),this.prependListener(P,E(this,P,I)),this},f.prototype.removeListener=function(P,I){var $,de,fe,be,Y;if(g(I),de=this._events,de===void 0||($=de[P],$===void 0))return this;if($===I||$.listener===I)--this._eventsCount===0?this._events=Object.create(null):(delete de[P],de.removeListener&&this.emit("removeListener",P,$.listener||I));else if(typeof $!="function"){for(fe=-1,be=$.length-1;be>=0;be--)if($[be]===I||$[be].listener===I){Y=$[be].listener,fe=be;break}if(fe<0)return this;fe===0?$.shift():V($,fe),$.length===1&&(de[P]=$[0]),de.removeListener!==void 0&&this.emit("removeListener",P,Y||I)}return this},f.prototype.off=f.prototype.removeListener,f.prototype.removeAllListeners=function(P){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):$[P]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete $[P]),this;if(arguments.length===0){var fe=Object.keys($),be;for(de=0;de<fe.length;++de)be=fe[de],be!=="removeListener"&&this.removeAllListeners(be);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(I=$[P],typeof I=="function")this.removeListener(P,I);else if(I!==void 0)for(de=I.length-1;de>=0;de--)this.removeListener(P,I[de]);return this};function T(P,I,$){var de=P._events;if(de===void 0)return[];var fe=de[I];return fe===void 0?[]:typeof fe=="function"?$?[fe.listener||fe]:[fe]:$?W(fe):H(fe,fe.length)}f.prototype.listeners=function(P){return T(this,P,!0)},f.prototype.rawListeners=function(P){return T(this,P,!1)},f.listenerCount=function(P,I){return typeof P.listenerCount=="function"?P.listenerCount(I):A.call(P,I)},f.prototype.listenerCount=A;function A(P){var I=this._events;if(I!==void 0){var $=I[P];if(typeof $=="function")return 1;if($!==void 0)return $.length}return 0}f.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]};function H(P,I){for(var $=Array(I),de=0;de<I;++de)$[de]=P[de];return $}function V(P,I){for(;I+1<P.length;I++)P[I]=P[I+1];P.pop()}function W(P){for(var I=Array(P.length),$=0;$<I.length;++$)I[$]=P[$].listener||P[$];return I}function M(P,I){return new Promise(function($,de){function fe(Y){P.removeListener(I,be),de(Y)}function be(){typeof P.removeListener=="function"&&P.removeListener("error",fe),$([].slice.call(arguments))}pe(P,I,be,{once:!0}),I!=="error"&&Q(P,fe,{once:!0})})}function Q(P,I,$){typeof P.on=="function"&&pe(P,"error",I,$)}function pe(P,I,$,de){if(typeof P.on=="function")de.once?P.once(I,$):P.on(I,$);else if(typeof P.addEventListener=="function")P.addEventListener(I,function fe(be){de.once&&P.removeEventListener(I,fe),$(be)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof P)}})),I0=ke((e=>{var n=e&&e.__awaiter||function(s,c,d,f){function m(g){return g instanceof d?g:new d(function(w){w(g)})}return new(d||(d=Promise))(function(g,w){function _(T){try{E(f.next(T))}catch(A){w(A)}}function C(T){try{E(f.throw(T))}catch(A){w(A)}}function E(T){T.done?g(T.value):m(T.value).then(_,C)}E((f=f.apply(s,c||[])).next())})},i=e&&e.__generator||function(s,c){var d={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},f,m,g,w;return w={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(w[Symbol.iterator]=function(){return this}),w;function _(E){return function(T){return C([E,T])}}function C(E){if(f)throw TypeError("Generator is already executing.");for(;d;)try{if(f=1,m&&(g=E[0]&2?m.return:E[0]?m.throw||((g=m.return)&&g.call(m),0):m.next)&&!(g=g.call(m,E[1])).done)return g;switch(m=0,g&&(E=[E[0]&2,g.value]),E[0]){case 0:case 1:g=E;break;case 4:return d.label++,{value:E[1],done:!1};case 5:d.label++,m=E[1],E=[0];continue;case 7:E=d.ops.pop(),d.trys.pop();continue;default:if(g=d.trys,!(g=g.length>0&&g[g.length-1])&&(E[0]===6||E[0]===2)){d=0;continue}if(E[0]===3&&(!g||E[1]>g[0]&&E[1]<g[3])){d.label=E[1];break}if(E[0]===6&&d.label<g[1]){d.label=g[1],g=E;break}if(g&&d.label<g[2]){d.label=g[2],d.ops.push(E);break}g[2]&&d.ops.pop(),d.trys.pop();continue}E=c.call(s,d)}catch(T){E=[6,T],m=0}finally{f=g=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=Nd();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(f){switch(f.label){case 0:return d.subscribe("error",this.handleError.bind(this)),d.subscribe("notification",this.handleNotification.bind(this)),[4,d.connect()];case 1:return f.sent(),[2]}})})}))},s.prototype.getPrimaryTransport=function(){return this.transports[0]},s.prototype.request=function(c,d,f){return d===void 0&&(d=!1),n(this,void 0,void 0,function(){var m,g,w,_,C=this;return i(this,function(E){return m=this.nextID().toString(),g=d?null:m,w={request:this.makeRequest(c.method,c.params||[],g),internalID:m},this.batchStarted?(_=new Promise(function(T,A){C.batch.push({resolve:T,reject:A,request:w})}),[2,_]):[2,this.getPrimaryTransport().sendData(w,f)]})})},s.prototype.close=function(){this.requestChannel.removeAllListeners(),this.transports.forEach(function(c){c.unsubscribe(),c.close()})},s.prototype.startBatch=function(){this.batchStarted=!0},s.prototype.stopBatch=function(){if(this.batchStarted===!1)throw Error("cannot end that which has never started");if(this.batch.length===0){this.batchStarted=!1;return}this.getPrimaryTransport().sendData(this.batch),this.batch=[],this.batchStarted=!1},s.prototype.makeRequest=function(c,d,f){return f?{jsonrpc:"2.0",id:f,method:c,params:d}:{jsonrpc:"2.0",method:c,params:d}},s.prototype.handleError=function(c){this.requestChannel.emit("error",c)},s.prototype.handleNotification=function(c){this.requestChannel.emit("notification",c)},s})()})),Ca=ke((e=>{var n=e&&e.__extends||(function(){var a=function(s,c){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var m in f)f.hasOwnProperty(m)&&(d[m]=f[m])},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,f){var m=this.constructor,g=a.call(this,c)||this;return g.message=c,g.code=d,g.data=f,Object.setPrototypeOf(g,m.prototype),g}return s})(Error);e.JSONRPCError=i,e.convertJSONToRPCError=function(a){if(a.error){var s=a.error,c=s.message,d=s.code,f=s.data;return new i(c,d,f)}return new i("Unknown error",e.ERR_UNKNOWN,a)}})),j0=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TransportRequestManager=void 0;var n=Nd(),i=Ca();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(f){var m=d.pendingRequest[f.internalID];if(delete d.pendingBatchRequest[f.internalID],m!==void 0){if(c){m.reject(c);return}m.resolve(),(f.request.id===null||f.request.id===void 0)&&delete d.pendingRequest[f.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 f=new i.JSONRPCError("Bad response format",i.ERR_UNKNOWN,s);return c&&this.transportEventChannel.emit("error",f),f}},a.prototype.addBatchReq=function(s,c){var d=this;return s.forEach(function(f){var m=f.resolve,g=f.reject,w=f.request.internalID;d.pendingBatchRequest[w]=!0,d.pendingRequest[w]={resolve:m,reject:g}}),Promise.resolve()},a.prototype.addReq=function(s,c){var d=this;return new Promise(function(f,m){c!==null&&c&&d.setRequestTimeout(s,c,m),d.pendingRequest[s]={resolve:f,reject:m}})},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,f=s.map(function(m){return d.resolveRes(m,c)}).filter(function(m){return m});if(f.length>0)return f[0]},a.prototype.resolveRes=function(s,c){var d=s.id,f=s.error,m=this.pendingRequest[d];if(m){delete this.pendingRequest[d],this.processResult(s,m),this.transportEventChannel.emit("response",s);return}if(d===void 0&&f===void 0){this.transportEventChannel.emit("notification",s);return}var g;return f&&(g=i.convertJSONToRPCError(s)),c&&f&&g&&this.transportEventChannel.emit("error",g),g},a.prototype.setRequestTimeout=function(s,c,d){var f=this;setTimeout(function(){delete f.pendingRequest[s],d(new i.JSONRPCError("Request timeout request took longer than "+c+" ms to resolve",i.ERR_TIMEOUT))},c)},a})()})),wo=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Transport=void 0;var n=j0();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})()})),Sa=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]:[]}})),q0=ke((e=>{var n=e&&e.__extends||(function(){var c=function(d,f){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,g){m.__proto__=g}||function(m,g){for(var w in g)g.hasOwnProperty(w)&&(m[w]=g[w])},c(d,f)};return function(d,f){c(d,f);function m(){this.constructor=d}d.prototype=f===null?Object.create(f):(m.prototype=f.prototype,new m)}})();Object.defineProperty(e,"__esModule",{value:!0});var i=wo(),a=Sa(),s=Ca();e.default=(function(c){n(d,c);function d(f,m,g){var w=c.call(this)||this;return w.connection=f,w.reqUri=m,w.resUri=g,w}return d.prototype.connect=function(){var f=this;return this.connection.on(this.resUri,function(m){f.transportRequestManager.resolveResponse(m)}),Promise.resolve()},d.prototype.sendData=function(f,m){m===void 0&&(m=null);var g=this.transportRequestManager.addRequest(f,m),w=a.getNotifications(f),_=this.parseData(f);try{return this.connection.emit(this.reqUri,_),this.transportRequestManager.settlePendingRequest(w),g}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 Xk(e){return e&&DataView.prototype.isPrototypeOf(e)}function Ea(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 Md(e){return typeof e!="string"&&(e=String(e)),e}function Ad(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 sn(e){this.map={},e instanceof sn?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 Id(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}}function z0(e){return new Promise(function(n,i){e.onload=function(){n(e.result)},e.onerror=function(){i(e.error)}})}function Yk(e){var n=new FileReader,i=z0(n);return n.readAsArrayBuffer(e),i}function Zk(e){var n=new FileReader,i=z0(n),a=/charset=([A-Za-z0-9_-]+)/.exec(e.type),s=a?a[1]:"utf-8";return n.readAsText(e,s),i}function eC(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 F0(e){if(e.slice)return e.slice(0);var n=new Uint8Array(e.byteLength);return n.set(new Uint8Array(e)),n.buffer}function B0(){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&&Xk(e)?(this._bodyArrayBuffer=F0(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Rn.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||$0(e))?this._bodyArrayBuffer=F0(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=Id(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 Id(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(Yk);throw Error("could not read as ArrayBuffer")},this.text=function(){var e=Id(this);if(e)return e;if(this._bodyBlob)return Zk(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(eC(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(nC)}),this.json=function(){return this.text().then(JSON.parse)},this}function tC(e){var n=e.toUpperCase();return W0.indexOf(n)>-1?n:e}function Co(e,n){if(!(this instanceof Co))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 Co){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,n.headers||(this.headers=new sn(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 sn(n.headers)),this.method=tC(n.method||this.method||"GET"),this.mode=n.mode||this.mode||null,this.signal=n.signal||this.signal||(function(){if("AbortController"in mn)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 nC(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 rC(e){var n=new sn;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 $r(e,n){if(!(this instanceof $r))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 sn(n.headers),this.url=n.url||"",this._initBody(e)}function H0(e,n){return new Promise(function(i,a){var s=new Co(e,n);if(s.signal&&s.signal.aborted)return a(new ji("Aborted","AbortError"));var c=new XMLHttpRequest;function d(){c.abort()}c.onload=function(){var g={statusText:c.statusText,headers:rC(c.getAllResponseHeaders()||"")};s.url.indexOf("file://")===0&&(c.status<200||c.status>599)?g.status=200:g.status=c.status,g.url="responseURL"in c?c.responseURL:g.headers.get("X-Request-URL");var w="response"in c?c.response:c.responseText;setTimeout(function(){i(new $r(w,g))},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 ji("Aborted","AbortError"))},0)};function f(g){try{return g===""&&mn.location.href?mn.location.href:g}catch{return g}}if(c.open(s.method,f(s.url),!0),s.credentials==="include"?c.withCredentials=!0:s.credentials==="omit"&&(c.withCredentials=!1),"responseType"in c&&(Rn.blob?c.responseType="blob":Rn.arrayBuffer&&(c.responseType="arraybuffer")),n&&typeof n.headers=="object"&&!(n.headers instanceof sn||mn.Headers&&n.headers instanceof mn.Headers)){var m=[];Object.getOwnPropertyNames(n.headers).forEach(function(g){m.push(Ea(g)),c.setRequestHeader(g,Md(n.headers[g]))}),s.headers.forEach(function(g,w){m.indexOf(w)===-1&&c.setRequestHeader(w,g)})}else s.headers.forEach(function(g,w){c.setRequestHeader(w,g)});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 mn,Rn,V0,$0,W0,U0,ji,K0,Q0,G0,J0,So,X0,Y0,Z0,eg,tg,ng,Ta,jd,qd,rg,qi,Ra,Ql,ig,zd,og,ag,sg,lg,Gl,cg,Eo,Fd,qt,Jl,ug,dg,fg,pg,mg,hg,gg,yg,vg,bg,wg,_g,xg,kg,Cg,Sg,Eg,Tg,Rg,Dg,Og,Pg,Lg,Ng;K0=c2((()=>{mn=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},Rn={searchParams:"URLSearchParams"in mn,iterable:"Symbol"in mn&&"iterator"in Symbol,blob:"FileReader"in mn&&"Blob"in mn&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in mn,arrayBuffer:"ArrayBuffer"in mn},Rn.arrayBuffer&&(V0=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],$0=ArrayBuffer.isView||function(e){return e&&V0.indexOf(Object.prototype.toString.call(e))>-1}),sn.prototype.append=function(e,n){e=Ea(e),n=Md(n);var i=this.map[e];this.map[e]=i?i+", "+n:n},sn.prototype.delete=function(e){delete this.map[Ea(e)]},sn.prototype.get=function(e){return e=Ea(e),this.has(e)?this.map[e]:null},sn.prototype.has=function(e){return this.map.hasOwnProperty(Ea(e))},sn.prototype.set=function(e,n){this.map[Ea(e)]=Md(n)},sn.prototype.forEach=function(e,n){for(var i in this.map)this.map.hasOwnProperty(i)&&e.call(n,this.map[i],i,this)},sn.prototype.keys=function(){var e=[];return this.forEach(function(n,i){e.push(i)}),Ad(e)},sn.prototype.values=function(){var e=[];return this.forEach(function(n){e.push(n)}),Ad(e)},sn.prototype.entries=function(){var e=[];return this.forEach(function(n,i){e.push([i,n])}),Ad(e)},Rn.iterable&&(sn.prototype[Symbol.iterator]=sn.prototype.entries),W0=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"],Co.prototype.clone=function(){return new Co(this,{body:this._bodyInit})},B0.call(Co.prototype),B0.call($r.prototype),$r.prototype.clone=function(){return new $r(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new sn(this.headers),url:this.url})},$r.error=function(){var e=new $r(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e},U0=[301,302,303,307,308],$r.redirect=function(e,n){if(U0.indexOf(n)===-1)throw RangeError("Invalid status code");return new $r(null,{status:n,headers:{location:e}})},ji=mn.DOMException;try{new ji}catch{ji=function(e,n){this.message=e,this.name=n,this.stack=Error(e).stack},ji.prototype=Object.create(Error.prototype),ji.prototype.constructor=ji}H0.polyfill=!0,mn.fetch||(mn.fetch=H0,mn.Headers=sn,mn.Request=Co,mn.Response=$r)})),Q0=ke(((e,n)=>{K0(),n.exports=self.fetch.bind(self)})),G0=ke((e=>{var n=e&&e.__extends||(function(){var w=function(_,C){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,T){E.__proto__=T}||function(E,T){for(var A in T)T.hasOwnProperty(A)&&(E[A]=T[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 T(A){return A instanceof C?A:new C(function(H){H(A)})}return new(C||(C=Promise))(function(A,H){function V(Q){try{M(E.next(Q))}catch(pe){H(pe)}}function W(Q){try{M(E.throw(Q))}catch(pe){H(pe)}}function M(Q){Q.done?A(Q.value):T(Q.value).then(V,W)}M((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,T,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(M){return function(Q){return W([M,Q])}}function W(M){if(E)throw TypeError("Generator is already executing.");for(;C;)try{if(E=1,T&&(A=M[0]&2?T.return:M[0]?T.throw||((A=T.return)&&A.call(T),0):T.next)&&!(A=A.call(T,M[1])).done)return A;switch(T=0,A&&(M=[M[0]&2,A.value]),M[0]){case 0:case 1:A=M;break;case 4:return C.label++,{value:M[1],done:!1};case 5:C.label++,T=M[1],M=[0];continue;case 7:M=C.ops.pop(),C.trys.pop();continue;default:if(A=C.trys,!(A=A.length>0&&A[A.length-1])&&(M[0]===6||M[0]===2)){C=0;continue}if(M[0]===3&&(!A||M[1]>A[0]&&M[1]<A[3])){C.label=M[1];break}if(M[0]===6&&C.label<A[1]){C.label=A[1],A=M;break}if(A&&C.label<A[2]){C.label=A[2],C.ops.push(M);break}A[2]&&C.ops.pop(),C.trys.pop();continue}M=_.call(w,C)}catch(Q){M=[6,Q],T=0}finally{E=A=0}if(M[0]&5)throw M[1];return{value:M[0]?M[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=wo(),f=Sa(),m=Ca(),g=(function(w){n(_,w);function _(C,E){var T=w.call(this)||this;return T.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},T.uri=C,T.credentials=E&&E.credentials,T.headers=_.setupHeaders(E&&E.headers),T.injectedFetcher=E==null?void 0:E.fetcher,T}return _.prototype.connect=function(){return Promise.resolve()},_.prototype.sendData=function(C,E){return E===void 0&&(E=null),i(this,void 0,void 0,function(){var T,A,H,V,W,M,pe,Q,pe;return a(this,function(P){switch(P.label){case 0:T=this.transportRequestManager.addRequest(C,E),A=f.getNotifications(C),H=f.getBatchRequests(C),V=this.injectedFetcher||c.default,P.label=1;case 1:return P.trys.push([1,4,,5]),[4,V(this.uri,{method:"POST",headers:this.headers,body:JSON.stringify(this.parseData(C)),credentials:this.credentials})];case 2:return W=P.sent(),this.transportRequestManager.settlePendingRequest(A),this.onlyNotifications(C)?[2,Promise.resolve()]:[4,W.text()];case 3:return M=P.sent(),pe=this.transportRequestManager.resolveResponse(M),pe?(this.transportRequestManager.settlePendingRequest(H,pe),[2,Promise.reject(pe)]):[3,5];case 4:return Q=P.sent(),pe=new m.JSONRPCError(Q.message,m.ERR_UNKNOWN,Q),this.transportRequestManager.settlePendingRequest(A,pe),this.transportRequestManager.settlePendingRequest(f.getBatchRequests(C),pe),[2,Promise.reject(pe)];case 5:return[2,T]}})})},_.prototype.close=function(){},_.setupHeaders=function(C){var E=new Headers(C);return E.set("Content-Type","application/json"),E},_})(d.Transport);e.HTTPTransport=g,e.default=g})),J0=B3({default:()=>X0}),Y0=c2((()=>{So=null,typeof WebSocket<"u"?So=WebSocket:typeof MozWebSocket<"u"?So=MozWebSocket:typeof global<"u"?So=global.WebSocket||global.MozWebSocket:typeof window<"u"?So=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(So=self.WebSocket||self.MozWebSocket),X0=So})),Z0=ke((e=>{var n=e&&e.__extends||(function(){var g=function(w,_){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,E){C.__proto__=E}||function(C,E){for(var T in E)E.hasOwnProperty(T)&&(C[T]=E[T])},g(w,_)};return function(w,_){g(w,_);function C(){this.constructor=w}w.prototype=_===null?Object.create(_):(C.prototype=_.prototype,new C)}})(),i=e&&e.__awaiter||function(g,w,_,C){function E(T){return T instanceof _?T:new _(function(A){A(T)})}return new(_||(_=Promise))(function(T,A){function H(M){try{W(C.next(M))}catch(Q){A(Q)}}function V(M){try{W(C.throw(M))}catch(Q){A(Q)}}function W(M){M.done?T(M.value):E(M.value).then(H,V)}W((C=C.apply(g,w||[])).next())})},a=e&&e.__generator||function(g,w){var _={label:0,sent:function(){if(T[0]&1)throw T[1];return T[1]},trys:[],ops:[]},C,E,T,A;return A={next:H(0),throw:H(1),return:H(2)},typeof Symbol=="function"&&(A[Symbol.iterator]=function(){return this}),A;function H(W){return function(M){return V([W,M])}}function V(W){if(C)throw TypeError("Generator is already executing.");for(;_;)try{if(C=1,E&&(T=W[0]&2?E.return:W[0]?E.throw||((T=E.return)&&T.call(E),0):E.next)&&!(T=T.call(E,W[1])).done)return T;switch(E=0,T&&(W=[W[0]&2,T.value]),W[0]){case 0:case 1:T=W;break;case 4:return _.label++,{value:W[1],done:!1};case 5:_.label++,E=W[1],W=[0];continue;case 7:W=_.ops.pop(),_.trys.pop();continue;default:if(T=_.trys,!(T=T.length>0&&T[T.length-1])&&(W[0]===6||W[0]===2)){_=0;continue}if(W[0]===3&&(!T||W[1]>T[0]&&W[1]<T[3])){_.label=W[1];break}if(W[0]===6&&_.label<T[1]){_.label=T[1],T=W;break}if(T&&_.label<T[2]){_.label=T[2],_.ops.push(W);break}T[2]&&_.ops.pop(),_.trys.pop();continue}W=w.call(g,_)}catch(M){W=[6,M],E=0}finally{C=T=0}if(W[0]&5)throw W[1];return{value:W[0]?W[1]:void 0,done:!0}}},s=e&&e.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0});var c=s((Y0(),gu(J0))),d=wo(),f=Sa(),m=Ca();e.default=(function(g){n(w,g);function w(_){var C=g.call(this)||this;return C.uri=_,C.connection=new c.default(_),C}return w.prototype.connect=function(){var _=this;return new Promise(function(C,E){var T=function(){_.connection.removeEventListener("open",T),C()};_.connection.addEventListener("open",T),_.connection.addEventListener("message",function(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,T,A;return a(this,function(H){E=this.transportRequestManager.addRequest(_,C),T=f.getNotifications(_);try{this.connection.send(JSON.stringify(this.parseData(_))),this.transportRequestManager.settlePendingRequest(T)}catch(V){A=new m.JSONRPCError(V.message,m.ERR_UNKNOWN,V),this.transportRequestManager.settlePendingRequest(T,A),this.transportRequestManager.settlePendingRequest(f.getBatchRequests(_),A),E=Promise.reject(A)}return[2,E]})})},w.prototype.close=function(){this.connection.close()},w})(d.Transport)})),eg=ke((e=>{var n=e&&e.__extends||(function(){var f=function(m,g){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,_){w.__proto__=_}||function(w,_){for(var C in _)_.hasOwnProperty(C)&&(w[C]=_[C])},f(m,g)};return function(m,g){f(m,g);function w(){this.constructor=m}m.prototype=g===null?Object.create(g):(w.prototype=g.prototype,new w)}})(),i=e&&e.__awaiter||function(f,m,g,w){function _(C){return C instanceof g?C:new g(function(E){E(C)})}return new(g||(g=Promise))(function(C,E){function T(V){try{H(w.next(V))}catch(W){E(W)}}function A(V){try{H(w.throw(V))}catch(W){E(W)}}function H(V){V.done?C(V.value):_(V.value).then(T,A)}H((w=w.apply(f,m||[])).next())})},a=e&&e.__generator||function(f,m){var g={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},w,_,C,E;return E={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function T(H){return function(V){return A([H,V])}}function A(H){if(w)throw TypeError("Generator is already executing.");for(;g;)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 g.label++,{value:H[1],done:!1};case 5:g.label++,_=H[1],H=[0];continue;case 7:H=g.ops.pop(),g.trys.pop();continue;default:if(C=g.trys,!(C=C.length>0&&C[C.length-1])&&(H[0]===6||H[0]===2)){g=0;continue}if(H[0]===3&&(!C||H[1]>C[0]&&H[1]<C[3])){g.label=H[1];break}if(H[0]===6&&g.label<C[1]){g.label=C[1],C=H;break}if(C&&g.label<C[2]){g.label=C[2],g.ops.push(H);break}C[2]&&g.ops.pop(),g.trys.pop();continue}H=m.call(f,g)}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=wo(),c=Sa(),d=function(f){var m=400,g=window.screen.height;return window.open(f,"inspector:popup","left=0,top=0,width="+m+",height="+g+",resizable,scrollbars=yes,status=1")};e.default=(function(f){n(m,f);function m(g){var w=f.call(this)||this;return w.messageHandler=function(_){w.transportRequestManager.resolveResponse(JSON.stringify(_.data))},w.uri=g,w.postMessageID="post-message-transport-"+Math.random(),w}return m.prototype.createWindow=function(g){return new Promise(function(w,_){var C=d(g);setTimeout(function(){w(C)},3e3)})},m.prototype.connect=function(){var g=this,w=/^(http|https):\/\/.*$/;return new Promise(function(_,C){return i(g,void 0,void 0,function(){var E;return a(this,function(T){switch(T.label){case 0:return w.test(this.uri)||C(Error("Bad URI")),E=this,[4,this.createWindow(this.uri)];case 1:return E.frame=T.sent(),window.addEventListener("message",this.messageHandler),_(),[2]}})})})},m.prototype.sendData=function(g,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(g,null),C=c.getNotifications(g),this.frame&&(this.frame.postMessage(g.request,this.uri),this.transportRequestManager.settlePendingRequest(C)),[2,_]})})},m.prototype.close=function(){this.frame&&(window.removeEventListener("message",this.messageHandler),this.frame.close())},m})(s.Transport)})),tg=ke((e=>{var n=e&&e.__extends||(function(){var d=function(f,m){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,w){g.__proto__=w}||function(g,w){for(var _ in w)w.hasOwnProperty(_)&&(g[_]=w[_])},d(f,m)};return function(f,m){d(f,m);function g(){this.constructor=f}f.prototype=m===null?Object.create(m):(g.prototype=m.prototype,new g)}})(),i=e&&e.__awaiter||function(d,f,m,g){function w(_){return _ instanceof m?_:new m(function(C){C(_)})}return new(m||(m=Promise))(function(_,C){function E(H){try{A(g.next(H))}catch(V){C(V)}}function T(H){try{A(g.throw(H))}catch(V){C(V)}}function A(H){H.done?_(H.value):w(H.value).then(E,T)}A((g=g.apply(d,f||[])).next())})},a=e&&e.__generator||function(d,f){var m={label:0,sent:function(){if(_[0]&1)throw _[1];return _[1]},trys:[],ops:[]},g,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 T([A,H])}}function T(A){if(g)throw TypeError("Generator is already executing.");for(;m;)try{if(g=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 m.label++,{value:A[1],done:!1};case 5:m.label++,w=A[1],A=[0];continue;case 7:A=m.ops.pop(),m.trys.pop();continue;default:if(_=m.trys,!(_=_.length>0&&_[_.length-1])&&(A[0]===6||A[0]===2)){m=0;continue}if(A[0]===3&&(!_||A[1]>_[0]&&A[1]<_[3])){m.label=A[1];break}if(A[0]===6&&m.label<_[1]){m.label=_[1],_=A;break}if(_&&m.label<_[2]){m.label=_[2],m.ops.push(A);break}_[2]&&m.ops.pop(),m.trys.pop();continue}A=f.call(d,m)}catch(H){A=[6,H],w=0}finally{g=_=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=wo(),c=Sa();e.default=(function(d){n(f,d);function f(m){var g=d.call(this)||this;return g.messageHandler=function(w){g.transportRequestManager.resolveResponse(JSON.stringify(w.data))},g.uri=m,g.postMessageID="post-message-transport-"+Math.random(),g}return f.prototype.createWindow=function(m){var g=this;return new Promise(function(w,_){var C,E=document.createElement("iframe");E.setAttribute("id",g.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",m),window.document.body.appendChild(E),C=E.contentWindow})},f.prototype.connect=function(){var m=this,g=/^(http|https):\/\/.*$/;return new Promise(function(w,_){return i(m,void 0,void 0,function(){var C;return a(this,function(E){switch(E.label){case 0:return g.test(this.uri)||_(Error("Bad URI")),C=this,[4,this.createWindow(this.uri)];case 1:return C.frame=E.sent(),window.addEventListener("message",this.messageHandler),w(),[2]}})})})},f.prototype.sendData=function(m,g){return g===void 0&&(g=5e3),i(this,void 0,void 0,function(){var w,_;return a(this,function(C){return w=this.transportRequestManager.addRequest(m,null),_=c.getNotifications(m),this.frame&&(this.frame.postMessage(m.request,"*"),this.transportRequestManager.settlePendingRequest(_)),[2,w]})})},f.prototype.close=function(){var m;(m=document.getElementById(this.postMessageID))==null||m.remove(),window.removeEventListener("message",this.messageHandler)},f})(s.Transport)})),ng=ke((e=>{var n=e&&e.__awaiter||function(a,s,c,d){function f(m){return m instanceof c?m:new c(function(g){g(m)})}return new(c||(c=Promise))(function(m,g){function w(E){try{C(d.next(E))}catch(T){g(T)}}function _(E){try{C(d.throw(E))}catch(T){g(T)}}function C(E){E.done?m(E.value):f(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(m[0]&1)throw m[1];return m[1]},trys:[],ops:[]},d,f,m,g;return g={next:w(0),throw:w(1),return:w(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function w(C){return function(E){return _([C,E])}}function _(C){if(d)throw TypeError("Generator is already executing.");for(;c;)try{if(d=1,f&&(m=C[0]&2?f.return:C[0]?f.throw||((m=f.return)&&m.call(f),0):f.next)&&!(m=m.call(f,C[1])).done)return m;switch(f=0,m&&(C=[C[0]&2,m.value]),C[0]){case 0:case 1:m=C;break;case 4:return c.label++,{value:C[1],done:!1};case 5:c.label++,f=C[1],C=[0];continue;case 7:C=c.ops.pop(),c.trys.pop();continue;default:if(m=c.trys,!(m=m.length>0&&m[m.length-1])&&(C[0]===6||C[0]===2)){c=0;continue}if(C[0]===3&&(!m||C[1]>m[0]&&C[1]<m[3])){c.label=C[1];break}if(C[0]===6&&c.label<m[1]){c.label=m[1],m=C;break}if(m&&c.label<m[2]){c.label=m[2],c.ops.push(C);break}m[2]&&c.ops.pop(),c.trys.pop();continue}C=s.call(a,c)}catch(E){C=[6,E],f=0}finally{d=m=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})()})),Hl=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(I0()).default,e.EventEmitterTransport=n(q0()).default,e.HTTPTransport=n(G0()).default,e.WebSocketTransport=n(Z0()).default,e.PostMessageWindowTransport=n(eg()).default,e.PostMessageIframeTransport=n(tg()).default;var i=Ca();Object.defineProperty(e,"JSONRPCError",{enumerable:!0,get:function(){return i.JSONRPCError}});var a=n(ng());e.Client=a.default,e.default=a.default})),Ta=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(m){return m===!0||m===!1}e.boolean=n;function i(m){return typeof m=="string"||m instanceof String}e.string=i;function a(m){return typeof m=="number"||m instanceof Number}e.number=a;function s(m){return m instanceof Error}e.error=s;function c(m){return typeof m=="function"}e.func=c;function d(m){return Array.isArray(m)}e.array=d;function f(m){return d(m)&&m.every(g=>i(g))}e.stringArray=f})),jd=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=Ta(),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 C_ extends Error{constructor(f,m,g){super(m),this.code=n.number(f)?f:i.UnknownErrorCode,this.data=g,Object.setPrototypeOf(this,C_.prototype)}toJson(){let f={code:this.code,message:this.message};return this.data!==void 0&&(f.data=this.data),f}};var a=class ad{constructor(f){this.kind=f}static is(f){return f===ad.auto||f===ad.byName||f===ad.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,f){this.method=d,this.numberOfParams=f}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,f=a.auto){super(d,1),this._parameterStructures=f}get parameterStructures(){return this._parameterStructures}},e.RequestType1=class extends s{constructor(d,f=a.auto){super(d,1),this._parameterStructures=f}get parameterStructures(){return this._parameterStructures}},e.RequestType2=class extends s{constructor(d){super(d,2)}},e.RequestType3=class extends s{constructor(d){super(d,3)}},e.RequestType4=class extends s{constructor(d){super(d,4)}},e.RequestType5=class extends s{constructor(d){super(d,5)}},e.RequestType6=class extends s{constructor(d){super(d,6)}},e.RequestType7=class extends s{constructor(d){super(d,7)}},e.RequestType8=class extends s{constructor(d){super(d,8)}},e.RequestType9=class extends s{constructor(d){super(d,9)}},e.NotificationType=class extends s{constructor(d,f=a.auto){super(d,1),this._parameterStructures=f}get parameterStructures(){return this._parameterStructures}},e.NotificationType0=class extends s{constructor(d){super(d,0)}},e.NotificationType1=class extends s{constructor(d,f=a.auto){super(d,1),this._parameterStructures=f}get parameterStructures(){return this._parameterStructures}},e.NotificationType2=class extends s{constructor(d){super(d,2)}},e.NotificationType3=class extends s{constructor(d){super(d,3)}},e.NotificationType4=class extends s{constructor(d){super(d,4)}},e.NotificationType5=class extends s{constructor(d){super(d,5)}},e.NotificationType6=class extends s{constructor(d){super(d,6)}},e.NotificationType7=class extends s{constructor(d){super(d,7)}},e.NotificationType8=class extends s{constructor(d){super(d,8)}},e.NotificationType9=class extends s{constructor(d){super(d,9)}};var c;(function(d){function f(w){let _=w;return _&&n.string(_.method)&&(n.string(_.id)||n.number(_.id))}d.isRequest=f;function m(w){let _=w;return _&&n.string(_.method)&&w.id===void 0}d.isNotification=m;function g(w){let _=w;return _&&(_.result!==void 0||!!_.error)&&(n.string(_.id)||n.number(_.id)||_.id===null)}d.isResponse=g})(c||(e.Message=c={}))})),qd=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 f=this._map.get(s);if(f)f.value=c,d!==i.None&&this.touch(f,d);else{switch(f={key:s,value:c,next:void 0,previous:void 0},d){case i.None:this.addItemLast(f);break;case i.First:this.addItemFirst(f);break;case i.Last:this.addItemLast(f);break;default:this.addItemLast(f);break}this._map.set(s,f),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){let c=this._map.get(s);if(c)return this._map.delete(s),this.removeItem(c),this._size--,c.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error("Invalid list");let s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,c){let d=this._state,f=this._head;for(;f;){if(c?s.bind(c)(f.value,f.key,this):s(f.value,f.key,this),this._state!==d)throw Error("LinkedMap got modified during iteration.");f=f.next}}keys(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let f={value:c.key,done:!1};return c=c.next,f}else return{value:void 0,done:!0}}};return d}values(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let f={value:c.value,done:!1};return c=c.next,f}else return{value:void 0,done:!0}}};return d}entries(){let s=this._state,c=this._head,d={[Symbol.iterator]:()=>d,next:()=>{if(this._state!==s)throw Error("LinkedMap got modified during iteration.");if(c){let f={value:[c.key,c.value],done:!1};return c=c.next,f}else return{value:void 0,done:!0}}};return d}[(n=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let c=this._head,d=this.size;for(;c&&d>s;)this._map.delete(c.key),c=c.next,d--;this._head=c,this._size=d,c&&(c.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{let c=s.next,d=s.previous;if(!c||!d)throw Error("Invalid list");c.previous=d,d.next=c}s.next=void 0,s.previous=void 0,this._state++}touch(s,c){if(!this._head||!this._tail)throw Error("Invalid list");if(!(c!==i.First&&c!==i.Last)){if(c===i.First){if(s===this._head)return;let d=s.next,f=s.previous;s===this._tail?(f.next=void 0,this._tail=f):(d.previous=f,f.next=d),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(c===i.Last){if(s===this._tail)return;let d=s.next,f=s.previous;s===this._head?(d.previous=void 0,this._head=d):(d.previous=f,f.next=d),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){let s=[];return this.forEach((c,d)=>{s.push([d,c])}),s}fromJSON(s){this.clear();for(let[c,d]of s)this.set(c,d)}};e.LinkedMap=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))}}})),rg=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={}))})),qi=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})),Ra=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;var n=qi(),i;(function(c){let d={dispose(){}};c.None=function(){return d}})(i||(e.Event=i={}));var a=class{add(c,d=null,f){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(c),this._contexts.push(d),Array.isArray(f)&&f.push({dispose:()=>this.remove(c,d)})}remove(c,d=null){if(!this._callbacks)return;let f=!1;for(let m=0,g=this._callbacks.length;m<g;m++)if(this._callbacks[m]===c)if(this._contexts[m]===d){this._callbacks.splice(m,1),this._contexts.splice(m,1);return}else f=!0;if(f)throw Error("When adding a listener with a context, you should remove it with the same context")}invoke(...c){if(!this._callbacks)return[];let d=[],f=this._callbacks.slice(0),m=this._contexts.slice(0);for(let g=0,w=f.length;g<w;g++)try{d.push(f[g].apply(m[g],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 S_{constructor(d){this._options=d}get event(){return this._event||(this._event=(d,f,m)=>{this._callbacks||(this._callbacks=new a),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(d,f);let g={dispose:()=>{this._callbacks&&(this._callbacks.remove(d,f),g.dispose=S_._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(m)&&m.push(g),g}),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(){}})),Ql=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;var n=qi(),i=Ta(),a=Ra(),s;(function(f){f.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:a.Event.None}),f.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:a.Event.None});function m(g){let w=g;return w&&(w===f.None||w===f.Cancelled||i.boolean(w.isCancellationRequested)&&!!w.onCancellationRequested)}f.is=m})(s||(e.CancellationToken=s={}));var c=Object.freeze(function(f,m){let g=(0,n.default)().timer.setTimeout(f.bind(m),0);return{dispose(){g.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}}})),ig=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;var n=Ql(),i;(function(c){c.Continue=0,c.Cancelled=1})(i||(i={})),e.SharedArraySenderStrategy=class{constructor(){this.buffers=new Map}enableCancellation(c){if(c.id===null)return;let d=new SharedArrayBuffer(4),f=new Int32Array(d,0,1);f[0]=i.Continue,this.buffers.set(c.id,d),c.$cancellationData=d}async sendCancellation(c,d){let f=this.buffers.get(d);if(f===void 0)return;let m=new Int32Array(f,0,1);Atomics.store(m,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)}}})),zd=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;var n=qi();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()}}}})),og=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;var n=qi(),i=Ta(),a=Ra(),s=zd(),c;(function(m){function g(w){let _=w;return _&&i.func(_.listen)&&i.func(_.dispose)&&i.func(_.onError)&&i.func(_.onClose)&&i.func(_.onPartialMessage)}m.is=g})(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(m){this.errorEmitter.fire(this.asError(m))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(m){this.partialMessageEmitter.fire(m)}asError(m){return m instanceof Error?m:Error(`Reader received error. Reason: ${i.string(m.message)?m.message:"unknown"}`)}};e.AbstractMessageReader=d;var f;(function(m){function g(w){let _,C,E=new Map,T,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&&(T=w.contentTypeDecoder,A.set(T.name,T)),w.contentTypeDecoders!==void 0)for(let H of w.contentTypeDecoders)A.set(H.name,H)}return T===void 0&&(T=(0,n.default)().applicationJson.decoder,A.set(T.name,T)),{charset:_,contentDecoder:C,contentDecoders:E,contentTypeDecoder:T,contentTypeDecoders:A}}m.fromOptions=g})(f||(f={})),e.ReadableStreamMessageReader=class extends d{constructor(m,g){super(),this.readable=m,this.options=f.fromOptions(g),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(m){this._partialMessageTimeout=m}get partialMessageTimeout(){return this._partialMessageTimeout}listen(m){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=m;let g=this.readable.onData(w=>{this.onData(w)});return this.readable.onError(w=>this.fireError(w)),this.readable.onClose(()=>this.fireClose()),g}onData(m){try{for(this.buffer.append(m);;){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 g=this.buffer.tryReadBody(this.nextMessageLength);if(g===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let w=this.options.contentDecoder===void 0?g:await this.options.contentDecoder.decode(g),_=await this.options.contentTypeDecoder.decode(w,this.options);this.callback(_)}).catch(w=>{this.fireError(w)})}}catch(g){this.fireError(g)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer=(this.partialMessageTimer.dispose(),void 0))}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,n.default)().timer.setTimeout((m,g)=>{this.partialMessageTimer=void 0,m===this.messageToken&&(this.firePartialMessage({messageToken:m,waitingTime:g}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}})),ag=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;var n=qi(),i=Ta(),a=zd(),s=Ra(),c="Content-Length: ",d=`\r
|
|
81
|
-
`,f;(function(w){function _(C){let E=C;return E&&i.func(E.dispose)&&i.func(E.onClose)&&i.func(E.onError)&&i.func(E.write)}w.is=_})(f||(e.MessageWriter=f={}));var m=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=m;var g;(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=_})(g||(g={})),e.WriteableStreamMessageWriter=class extends m{constructor(w,_){super(),this.writable=w,this.options=g.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()}}})),sg=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,f=0,m=0;e:for(;d<this._chunks.length;){let C=this._chunks[d];for(f=0;f<C.length;){switch(C[f]){case n:switch(c){case 0:c=1;break;case 2:c=3;break;default:c=0}break;case i:switch(c){case 1:c=2;break;case 3:c=4,f++;break e;default:c=0}break;default:c=0}f++}m+=C.byteLength,d++}if(c!==4)return;let g=this._read(m+f),w=new Map,_=this.toString(g,"ascii").split(a);if(_.length<2)return w;for(let C=0;C<_.length-2;C++){let E=_[C],T=E.indexOf(":");if(T===-1)throw Error(`Message header must separate key and value using ':'
|
|
83
|
-
${E}`);let A=E.substr(0,T),H=E.substr(T+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 f=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(f)}if(this._chunks[0].byteLength>s){let f=this._chunks[0],m=this.asNative(f,s);return this._chunks[0]=f.slice(s),this._totalLength-=s,m}let c=this.allocNative(s),d=0;for(;s>0;){let f=this._chunks[0];if(f.byteLength>s){let m=f.slice(0,s);c.set(m,d),d+=s,this._chunks[0]=f.slice(s),this._totalLength-=s,s-=s}else c.set(f,d),d+=f.byteLength,this._chunks.shift(),this._totalLength-=f.byteLength,s-=f.byteLength}return c}}})),lg=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=qi(),i=Ta(),a=jd(),s=qd(),c=Ra(),d=Ql(),f;(function(Y){Y.type=new a.NotificationType("$/cancelRequest")})(f||(f={}));var m;(function(Y){function we(Ee){return typeof Ee=="string"||typeof Ee=="number"}Y.is=we})(m||(e.ProgressToken=m={}));var g;(function(Y){Y.type=new a.NotificationType("$/progress")})(g||(g={})),e.ProgressType=class{constructor(){}};var w;(function(Y){function we(Ee){return i.func(Ee)}Y.is=we})(w||(w={})),e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var _;(function(Y){Y[Y.Off=0]="Off",Y[Y.Messages=1]="Messages",Y[Y.Compact=2]="Compact",Y[Y.Verbose=3]="Verbose"})(_||(e.Trace=_={}));var C;(function(Y){Y.Off="off",Y.Messages="messages",Y.Compact="compact",Y.Verbose="verbose"})(C||(e.TraceValues=C={})),(function(Y){function we(ie){if(!i.string(ie))return Y.Off;switch(ie=ie.toLowerCase(),ie){case"off":return Y.Off;case"messages":return Y.Messages;case"compact":return Y.Compact;case"verbose":return Y.Verbose;default:return Y.Off}}Y.fromString=we;function Ee(ie){switch(ie){case Y.Off:return"off";case Y.Messages:return"messages";case Y.Compact:return"compact";case Y.Verbose:return"verbose";default:return"off"}}Y.toString=Ee})(_||(e.Trace=_={}));var E;(function(Y){Y.Text="text",Y.JSON="json"})(E||(e.TraceFormat=E={})),(function(Y){function we(Ee){return i.string(Ee)?(Ee=Ee.toLowerCase(),Ee==="json"?Y.JSON:Y.Text):Y.Text}Y.fromString=we})(E||(e.TraceFormat=E={}));var T;(function(Y){Y.type=new a.NotificationType("$/setTrace")})(T||(e.SetTraceNotification=T={}));var A;(function(Y){Y.type=new a.NotificationType("$/logTrace")})(A||(e.LogTraceNotification=A={}));var H;(function(Y){Y[Y.Closed=1]="Closed",Y[Y.Disposed=2]="Disposed",Y[Y.AlreadyListening=3]="AlreadyListening"})(H||(e.ConnectionErrors=H={}));var V=class E_ extends Error{constructor(we,Ee){super(Ee),this.code=we,Object.setPrototypeOf(this,E_.prototype)}};e.ConnectionError=V;var W;(function(Y){function we(Ee){let ie=Ee;return ie&&i.func(ie.cancelUndispatched)}Y.is=we})(W||(e.ConnectionStrategy=W={}));var M;(function(Y){function we(Ee){let ie=Ee;return ie&&(ie.kind===void 0||ie.kind==="id")&&i.func(ie.createCancellationTokenSource)&&(ie.dispose===void 0||i.func(ie.dispose))}Y.is=we})(M||(e.IdCancellationReceiverStrategy=M={}));var Q;(function(Y){function we(Ee){let ie=Ee;return ie&&ie.kind==="request"&&i.func(ie.createCancellationTokenSource)&&(ie.dispose===void 0||i.func(ie.dispose))}Y.is=we})(Q||(e.RequestCancellationReceiverStrategy=Q={}));var pe;(function(Y){Y.Message=Object.freeze({createCancellationTokenSource(Ee){return new d.CancellationTokenSource}});function we(Ee){return M.is(Ee)||Q.is(Ee)}Y.is=we})(pe||(e.CancellationReceiverStrategy=pe={}));var P;(function(Y){Y.Message=Object.freeze({sendCancellation(Ee,ie){return Ee.sendNotification(f.type,{id:ie})},cleanup(Ee){}});function we(Ee){let ie=Ee;return ie&&i.func(ie.sendCancellation)&&i.func(ie.cleanup)}Y.is=we})(P||(e.CancellationSenderStrategy=P={}));var I;(function(Y){Y.Message=Object.freeze({receiver:pe.Message,sender:P.Message});function we(Ee){let ie=Ee;return ie&&pe.is(ie.receiver)&&P.is(ie.sender)}Y.is=we})(I||(e.CancellationStrategy=I={}));var $;(function(Y){function we(Ee){let ie=Ee;return ie&&i.func(ie.handleMessage)}Y.is=we})($||(e.MessageStrategy=$={}));var de;(function(Y){function we(Ee){let ie=Ee;return ie&&(I.is(ie.cancellationStrategy)||W.is(ie.connectionStrategy)||$.is(ie.messageStrategy))}Y.is=we})(de||(e.ConnectionOptions=de={}));var fe;(function(Y){Y[Y.New=1]="New",Y[Y.Listening=2]="Listening",Y[Y.Closed=3]="Closed",Y[Y.Disposed=4]="Disposed"})(fe||(fe={}));function be(Y,we,Ee,ie){let X=Ee===void 0?e.NullLogger:Ee,G=0,K=0,Le=0,Qe,ut=new Map,Be,We=new Map,De=new Map,Ne,gn=new s.LinkedMap,It=new Map,Dn=new Set,ln=new Map,Ue=_.Off,nn=E.Text,gt,yn=fe.New,Yn=new c.Emitter,kt=new c.Emitter,ci=new c.Emitter,vn=new c.Emitter,bn=new c.Emitter,An=ie&&ie.cancellationStrategy?ie.cancellationStrategy:I.Message;function Nr(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 In(q){return q===null?"res-unknown-"+(++Le).toString():"res-"+q.toString()}function rn(){return"not-"+(++K).toString()}function Vi(q,ne){a.Message.isRequest(ne)?q.set(Nr(ne.id),ne):a.Message.isResponse(ne)?q.set(In(ne.id),ne):q.set(rn(),ne)}function Ur(q){}function Mr(){return yn===fe.Listening}function ui(){return yn===fe.Closed}function Ht(){return yn===fe.Disposed}function Qt(){(yn===fe.New||yn===fe.Listening)&&(yn=fe.Closed,kt.fire(void 0))}function yt(q){Yn.fire([q,void 0,void 0])}function Ft(q){Yn.fire(q)}Y.onClose(Qt),Y.onError(yt),we.onClose(Qt),we.onError(Ft);function Ct(){Ne||gn.size===0||(Ne=(0,n.default)().timer.setImmediate(()=>{Ne=void 0,$i()}))}function di(q){a.Message.isRequest(q)?fr(q):a.Message.isNotification(q)?Vt(q):a.Message.isResponse(q)?Ge(q):lt(q)}function $i(){if(gn.size===0)return;let q=gn.shift();try{let ne=ie==null?void 0:ie.messageStrategy;$.is(ne)?ne.handleMessage(q,di):di(q)}finally{Ct()}}let Ar=q=>{try{if(a.Message.isNotification(q)&&q.method===f.type.method){let ne=q.params.id,ye=Nr(ne),Se=gn.get(ye);if(a.Message.isRequest(Se)){let tt=ie==null?void 0:ie.connectionStrategy,it=tt&&tt.cancelUndispatched?tt.cancelUndispatched(Se,Ur):void 0;if(it&&(it.error!==void 0||it.result!==void 0)){gn.delete(ye),ln.delete(ne),it.id=Se.id,St(it,q.method,Date.now()),we.write(it).catch(()=>X.error("Sending response for canceled message failed."));return}}let pt=ln.get(ne);if(pt!==void 0){pt.cancel(),Qr(q);return}else Dn.add(ne)}Vi(gn,q)}finally{Ct()}};function fr(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),we.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),we.write(ht).catch(()=>X.error("Sending response failed."))}function Se($e,He,ot){$e===void 0&&($e=null);let ht={jsonrpc:"2.0",id:q.id,result:$e};St(ht,He,ot),we.write(ht).catch(()=>X.error("Sending response failed."))}Zn(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=M.is(An.receiver)?An.receiver.createCancellationTokenSource($e):An.receiver.createCancellationTokenSource(q);q.id!==null&&Dn.has(q.id)&&He.cancel(),q.id!==null&&ln.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=>{ln.delete($e),ne($t,q.method,wt)},$t=>{ln.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)}):(ln.delete($e),ne(ot,q.method,wt)):(ln.delete($e),Se(ot,q.method,wt))}catch(ot){ln.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(fi(q,ye),ye!==void 0){It.delete(ne);try{if(q.error){let Se=q.error;ye.reject(new a.ResponseError(Se.code,Se.message,Se.data))}else if(q.result!==void 0)ye.resolve(q.result);else throw Error("Should never happen.")}catch(Se){Se.message?X.error(`Response handler '${ye.method}' failed with message: ${Se.message}`):X.error(`Response handler '${ye.method}' failed unexpectedly.`)}}}}function Vt(q){if(Ht())return;let ne,ye;if(q.method===f.type.method){let Se=q.params.id;Dn.delete(Se),Qr(q);return}else{let Se=We.get(q.method);Se&&(ye=Se.handler,ne=Se.type)}if(ye||Be)try{if(Qr(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 Se=q.params;q.method===g.type.method&&Se.length===2&&m.is(Se[0])?ye({token:Se[0],value:Se[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 ${Se.length} arguments`)),ye(...Se))}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(Se){Se.message?X.error(`Notification handler '${q.method}' failed with message: ${Se.message}`):X.error(`Notification handler '${q.method}' failed unexpectedly.`)}else ci.fire(q)}function lt(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,Se=It.get(ye);Se&&Se.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(nn===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 jn("send-request",q)}function Kr(q){if(!(Ue===_.Off||!gt))if(nn===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 jn("send-notification",q)}function St(q,ne,ye){if(!(Ue===_.Off||!gt))if(nn===E.Text){let Se;(Ue===_.Verbose||Ue===_.Compact)&&(q.error&&q.error.data?Se=`Error data: ${vt(q.error.data)}
|
|
92
|
-
|
|
93
|
-
`:q.result?Se=`Result: ${vt(q.result)}
|
|
94
|
-
|
|
95
|
-
`:q.error===void 0&&(Se=`No result returned.
|
|
96
|
-
|
|
97
|
-
`)),gt.log(`Sending response '${ne} - (${q.id})'. Processing request took ${Date.now()-ye}ms`,Se)}else jn("send-response",q)}function Zn(q){if(!(Ue===_.Off||!gt))if(nn===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 jn("receive-request",q)}function Qr(q){if(!(Ue===_.Off||!gt||q.method===A.type.method))if(nn===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 jn("receive-notification",q)}function fi(q,ne){if(!(Ue===_.Off||!gt))if(nn===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 Se=q.error?` Request failed: ${q.error.message} (${q.error.code}).`:"";gt.log(`Received response '${ne.method} - (${q.id})' in ${Date.now()-ne.timerStart}ms.${Se}`,ye)}else gt.log(`Received response ${q.id} without active response promise.`,ye)}else jn("receive-response",q)}function jn(q,ne){if(!gt||Ue===_.Off)return;let ye={isLSPMessage:!0,type:q,message:ne,timestamp:Date.now()};gt.log(ye)}function Hn(){if(ui())throw new V(H.Closed,"Connection is closed.");if(Ht())throw new V(H.Disposed,"Connection is disposed.")}function Gr(){if(Mr())throw new V(H.AlreadyListening,"Connection is already listening")}function pi(){if(!Mr())throw Error("Call listen() first.")}function er(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):[er(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[er(ne)];default:throw Error(`Unknown parameter structure ${q.toString()}`)}}function L(q,ne){let ye,Se=q.numberOfParams;switch(Se){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<Se;pt++)ye.push(er(ne[pt]));if(ne.length<Se)for(let pt=ne.length;pt<Se;pt++)ye.push(null);break}return ye}let Je={sendNotification:(q,...ne)=>{Hn();let ye,Se;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:Se=void 0;break;case 1:Se=jt(wt,ne[it]);break;default:if(wt===a.ParameterStructures.byName)throw Error(`Received ${He} parameters for 'by Name' notification parameter structure.`);Se=ne.slice(it,$e).map(ot=>er(ot));break}}else{let tt=ne;ye=q.method,Se=L(q,tt)}let pt={jsonrpc:"2.0",method:ye,params:Se};return Kr(pt),we.write(pt).catch(tt=>{throw X.error("Sending notification failed."),tt})},onNotification:(q,ne)=>{Hn();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(De.has(ne))throw Error(`Progress handler for token ${ne} already registered`);return De.set(ne,ye),{dispose:()=>{De.delete(ne)}}},sendProgress:(q,ne,ye)=>Je.sendNotification(g.type,{token:ne,value:ye}),onUnhandledProgress:vn.event,sendRequest:(q,...ne)=>{Hn(),pi();let ye,Se,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 tr=$t-ot;switch(tr){case 0:Se=void 0;break;case 1:Se=jt(ht,ne[ot]);break;default:if(ht===a.ParameterStructures.byName)throw Error(`Received ${tr} parameters for 'by Name' request parameter structure.`);Se=ne.slice(ot,$t).map(Ss=>er(Ss));break}}else{let $e=ne;ye=q.method,Se=L(q,$e);let He=q.numberOfParams;pt=d.CancellationToken.is($e[He])?$e[He]:void 0}let tt=G++,it;pt&&(it=pt.onCancellationRequested(()=>{let $e=An.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:Se};return On(wt),typeof An.sender.enableCancellation=="function"&&An.sender.enableCancellation(wt),new Promise(async($e,He)=>{let ot={method:ye,timerStart:Date.now(),resolve:ht=>{$e(ht),An.sender.cleanup(tt),it==null||it.dispose()},reject:ht=>{He(ht),An.sender.cleanup(tt),it==null||it.dispose()}};try{await we.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)=>{Hn();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 Se=!1,pt=E.Text;ye!==void 0&&(i.boolean(ye)?Se=ye:(Se=ye.sendNotification||!1,pt=ye.traceFormat||E.Text)),Ue=q,nn=pt,gt=Ue===_.Off?void 0:ne,Se&&!ui()&&!Ht()&&await Je.sendNotification(T.type,{value:_.toString(q)})},onError:Yn.event,onClose:kt.event,onUnhandledNotification:ci.event,onDispose:bn.event,end:()=>{we.end()},dispose:()=>{if(Ht())return;yn=fe.Disposed,bn.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,ln=new Map,Dn=new Set,gn=new s.LinkedMap,i.func(we.dispose)&&we.dispose(),i.func(Y.dispose)&&Y.dispose()},listen:()=>{Hn(),Gr(),yn=fe.Listening,Y.listen(Ar)},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(g.type,q=>{let ne=De.get(q.token);ne?ne(q.value):vn.fire(q)}),Je}e.createMessageConnection=be})),Gl=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=jd();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=qd();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=rg();Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return a.Disposable}});var s=Ra();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return s.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return s.Emitter}});var c=Ql();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return c.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return c.CancellationToken}});var d=ig();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return d.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return d.SharedArrayReceiverStrategy}});var f=og();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return f.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return f.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return f.ReadableStreamMessageReader}});var m=ag();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return m.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return m.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return m.WriteableStreamMessageWriter}});var g=sg();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return g.AbstractMessageBuffer}});var w=lg();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=qi().default})),cg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0});var n=Gl(),i=class T_ extends n.AbstractMessageBuffer{constructor(g="utf-8"){super(g),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return T_.emptyBuffer}fromString(g,w){return new TextEncoder().encode(g)}toString(g,w){return w==="ascii"?this.asciiDecoder.decode(g):new TextDecoder(w).decode(g)}asNative(g,w){return w===void 0?g:g.slice(0,w)}allocNative(g){return new Uint8Array(g)}};i.emptyBuffer=new Uint8Array;var a=class{constructor(m){this.socket=m,this._onData=new n.Emitter,this._messageListener=g=>{g.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(m){return this.socket.addEventListener("close",m),n.Disposable.create(()=>this.socket.removeEventListener("close",m))}onError(m){return this.socket.addEventListener("error",m),n.Disposable.create(()=>this.socket.removeEventListener("error",m))}onEnd(m){return this.socket.addEventListener("end",m),n.Disposable.create(()=>this.socket.removeEventListener("end",m))}onData(m){return this._onData.event(m)}},s=class{constructor(m){this.socket=m}onClose(m){return this.socket.addEventListener("close",m),n.Disposable.create(()=>this.socket.removeEventListener("close",m))}onError(m){return this.socket.addEventListener("error",m),n.Disposable.create(()=>this.socket.removeEventListener("error",m))}onEnd(m){return this.socket.addEventListener("end",m),n.Disposable.create(()=>this.socket.removeEventListener("end",m))}write(m,g){if(typeof m=="string"){if(g!==void 0&&g!=="utf-8")throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${g}`);this.socket.send(m)}else this.socket.send(m);return Promise.resolve()}end(){this.socket.close()}},c=new TextEncoder,d=Object.freeze({messageBuffer:Object.freeze({create:m=>new i(m)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(m,g)=>{if(g.charset!=="utf-8")throw Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${g.charset}`);return Promise.resolve(c.encode(JSON.stringify(m,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(m,g)=>{if(!(m instanceof Uint8Array))throw Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(g.charset).decode(m)))}})}),stream:Object.freeze({asReadableStream:m=>new a(m),asWritableStream:m=>new s(m)}),console,timer:Object.freeze({setTimeout(m,g,...w){let _=setTimeout(m,g,...w);return{dispose:()=>clearTimeout(_)}},setImmediate(m,...g){let w=setTimeout(m,0,...g);return{dispose:()=>clearTimeout(w)}},setInterval(m,g,...w){let _=setInterval(m,g,...w);return{dispose:()=>clearInterval(_)}}})});function f(){return d}(function(m){function g(){n.RAL.install(d)}m.install=g})(f||(f={})),e.default=f})),Eo=ke((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,f,m){m===void 0&&(m=f);var g=Object.getOwnPropertyDescriptor(d,f);(!g||("get"in g?!d.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(c,m,g)}):(function(c,d,f,m){m===void 0&&(m=f),c[m]=d[f]})),i=e&&e.__exportStar||function(c,d){for(var f in c)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&n(d,c,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0,cg().default.install();var a=Gl();i(Gl(),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,f,m){return f===void 0&&(f=a.NullLogger),a.ConnectionStrategy.is(m)&&(m={connectionStrategy:m}),(0,a.createMessageConnection)(c,d,f,m)}e.createMessageConnection=s})),Fd=ke(((e,n)=>{n.exports=Eo()})),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=Eo(),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)}}})),Jl=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 f(w){return d(w)&&w.every(_=>i(_))}e.stringArray=f;function m(w,_){return Array.isArray(w)&&w.every(_)}e.typedArray=m;function g(w){return typeof w=="object"&&!!w}e.objectLiteral=g})),ug=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={}))})),dg=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={}))})),fg=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={}))})),pg=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={}))})),mg=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={}))})),hg=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={}))})),gg=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={}))})),yg=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={}))})),vg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;var n=Eo(),i=qt(),a;(function(d){d.type=new n.ProgressType;function f(m){return m===d.type}d.is=f})(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={}))})),bg=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={}))})),wg=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(m){m.Relative="relative"})(i||(e.TokenFormat=i={}));var a;(function(m){m.method="textDocument/semanticTokens",m.type=new n.RegistrationType(m.method)})(a||(e.SemanticTokensRegistrationType=a={}));var s;(function(m){m.method="textDocument/semanticTokens/full",m.messageDirection=n.MessageDirection.clientToServer,m.type=new n.ProtocolRequestType(m.method),m.registrationMethod=a.method})(s||(e.SemanticTokensRequest=s={}));var c;(function(m){m.method="textDocument/semanticTokens/full/delta",m.messageDirection=n.MessageDirection.clientToServer,m.type=new n.ProtocolRequestType(m.method),m.registrationMethod=a.method})(c||(e.SemanticTokensDeltaRequest=c={}));var d;(function(m){m.method="textDocument/semanticTokens/range",m.messageDirection=n.MessageDirection.clientToServer,m.type=new n.ProtocolRequestType(m.method),m.registrationMethod=a.method})(d||(e.SemanticTokensRangeRequest=d={}));var f;(function(m){m.method="workspace/semanticTokens/refresh",m.messageDirection=n.MessageDirection.serverToClient,m.type=new n.ProtocolRequestType0(m.method)})(f||(e.SemanticTokensRefreshRequest=f={}))})),_g=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={}))})),xg=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={}))})),kg=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(g){g.file="file",g.folder="folder"})(i||(e.FileOperationPatternKind=i={}));var a;(function(g){g.method="workspace/willCreateFiles",g.messageDirection=n.MessageDirection.clientToServer,g.type=new n.ProtocolRequestType(g.method)})(a||(e.WillCreateFilesRequest=a={}));var s;(function(g){g.method="workspace/didCreateFiles",g.messageDirection=n.MessageDirection.clientToServer,g.type=new n.ProtocolNotificationType(g.method)})(s||(e.DidCreateFilesNotification=s={}));var c;(function(g){g.method="workspace/willRenameFiles",g.messageDirection=n.MessageDirection.clientToServer,g.type=new n.ProtocolRequestType(g.method)})(c||(e.WillRenameFilesRequest=c={}));var d;(function(g){g.method="workspace/didRenameFiles",g.messageDirection=n.MessageDirection.clientToServer,g.type=new n.ProtocolNotificationType(g.method)})(d||(e.DidRenameFilesNotification=d={}));var f;(function(g){g.method="workspace/didDeleteFiles",g.messageDirection=n.MessageDirection.clientToServer,g.type=new n.ProtocolNotificationType(g.method)})(f||(e.DidDeleteFilesNotification=f={}));var m;(function(g){g.method="workspace/willDeleteFiles",g.messageDirection=n.MessageDirection.clientToServer,g.type=new n.ProtocolRequestType(g.method)})(m||(e.WillDeleteFilesRequest=m={}))})),Cg=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={}))})),Sg=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={}))})),Eg=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={}))})),Tg=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={}))})),Rg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;var n=Eo(),i=Jl(),a=qt(),s;(function(g){function w(_){let C=_;return C&&i.boolean(C.retriggerRequest)}g.is=w})(s||(e.DiagnosticServerCancellationData=s={}));var c;(function(g){g.Full="full",g.Unchanged="unchanged"})(c||(e.DocumentDiagnosticReportKind=c={}));var d;(function(g){g.method="textDocument/diagnostic",g.messageDirection=a.MessageDirection.clientToServer,g.type=new a.ProtocolRequestType(g.method),g.partialResult=new n.ProgressType})(d||(e.DocumentDiagnosticRequest=d={}));var f;(function(g){g.method="workspace/diagnostic",g.messageDirection=a.MessageDirection.clientToServer,g.type=new a.ProtocolRequestType(g.method),g.partialResult=new n.ProgressType})(f||(e.WorkspaceDiagnosticRequest=f={}));var m;(function(g){g.method="workspace/diagnostic/refresh",g.messageDirection=a.MessageDirection.serverToClient,g.type=new a.ProtocolRequestType0(g.method)})(m||(e.DiagnosticRefreshRequest=m={}))})),Dg=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=(um(),gu(cm)),i=Jl(),a=qt(),s;(function(T){T.Markup=1,T.Code=2;function A(H){return H===1||H===2}T.is=A})(s||(e.NotebookCellKind=s={}));var c;(function(T){function A(W,M){let Q={executionOrder:W};return(M===!0||M===!1)&&(Q.success=M),Q}T.create=A;function H(W){let M=W;return i.objectLiteral(M)&&n.uinteger.is(M.executionOrder)&&(M.success===void 0||i.boolean(M.success))}T.is=H;function V(W,M){return W===M?!0:W==null||M==null?!1:W.executionOrder===M.executionOrder&&W.success===M.success}T.equals=V})(c||(e.ExecutionSummary=c={}));var d;(function(T){function A(M,Q){return{kind:M,document:Q}}T.create=A;function H(M){let Q=M;return i.objectLiteral(Q)&&s.is(Q.kind)&&n.DocumentUri.is(Q.document)&&(Q.metadata===void 0||i.objectLiteral(Q.metadata))}T.is=H;function V(M,Q){let pe=new Set;return M.document!==Q.document&&pe.add("document"),M.kind!==Q.kind&&pe.add("kind"),M.executionSummary!==Q.executionSummary&&pe.add("executionSummary"),(M.metadata!==void 0||Q.metadata!==void 0)&&!W(M.metadata,Q.metadata)&&pe.add("metadata"),(M.executionSummary!==void 0||Q.executionSummary!==void 0)&&!c.equals(M.executionSummary,Q.executionSummary)&&pe.add("executionSummary"),pe}T.diff=V;function W(M,Q){if(M===Q)return!0;if(M==null||Q==null||typeof M!=typeof Q||typeof M!="object")return!1;let pe=Array.isArray(M),P=Array.isArray(Q);if(pe!==P)return!1;if(pe&&P){if(M.length!==Q.length)return!1;for(let I=0;I<M.length;I++)if(!W(M[I],Q[I]))return!1}if(i.objectLiteral(M)&&i.objectLiteral(Q)){let I=Object.keys(M),$=Object.keys(Q);if(I.length!==$.length||(I.sort(),$.sort(),!W(I,$)))return!1;for(let de=0;de<I.length;de++){let fe=I[de];if(!W(M[fe],Q[fe]))return!1}}return!0}})(d||(e.NotebookCell=d={}));var f;(function(T){function A(V,W,M,Q){return{uri:V,notebookType:W,version:M,cells:Q}}T.create=A;function H(V){let W=V;return i.objectLiteral(W)&&i.string(W.uri)&&n.integer.is(W.version)&&i.typedArray(W.cells,d.is)}T.is=H})(f||(e.NotebookDocument=f={}));var m;(function(T){T.method="notebookDocument/sync",T.messageDirection=a.MessageDirection.clientToServer,T.type=new a.RegistrationType(T.method)})(m||(e.NotebookDocumentSyncRegistrationType=m={}));var g;(function(T){T.method="notebookDocument/didOpen",T.messageDirection=a.MessageDirection.clientToServer,T.type=new a.ProtocolNotificationType(T.method),T.registrationMethod=m.method})(g||(e.DidOpenNotebookDocumentNotification=g={}));var w;(function(T){function A(V){let W=V;return i.objectLiteral(W)&&n.uinteger.is(W.start)&&n.uinteger.is(W.deleteCount)&&(W.cells===void 0||i.typedArray(W.cells,d.is))}T.is=A;function H(V,W,M){let Q={start:V,deleteCount:W};return M!==void 0&&(Q.cells=M),Q}T.create=H})(w||(e.NotebookCellArrayChange=w={}));var _;(function(T){T.method="notebookDocument/didChange",T.messageDirection=a.MessageDirection.clientToServer,T.type=new a.ProtocolNotificationType(T.method),T.registrationMethod=m.method})(_||(e.DidChangeNotebookDocumentNotification=_={}));var C;(function(T){T.method="notebookDocument/didSave",T.messageDirection=a.MessageDirection.clientToServer,T.type=new a.ProtocolNotificationType(T.method),T.registrationMethod=m.method})(C||(e.DidSaveNotebookDocumentNotification=C={}));var E;(function(T){T.method="notebookDocument/didClose",T.messageDirection=a.MessageDirection.clientToServer,T.type=new a.ProtocolNotificationType(T.method),T.registrationMethod=m.method})(E||(e.DidCloseNotebookDocumentNotification=E={}))})),Og=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={}))})),Pg=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=(um(),gu(cm)),a=Jl(),s=ug();Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return s.ImplementationRequest}});var c=dg();Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return c.TypeDefinitionRequest}});var d=fg();Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return d.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return d.DidChangeWorkspaceFoldersNotification}});var f=pg();Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return f.ConfigurationRequest}});var m=mg();Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return m.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return m.ColorPresentationRequest}});var g=hg();Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return g.FoldingRangeRequest}}),Object.defineProperty(e,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return g.FoldingRangeRefreshRequest}});var w=gg();Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return w.DeclarationRequest}});var _=yg();Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return _.SelectionRangeRequest}});var C=vg();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=bg();Object.defineProperty(e,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return E.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(e,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return E.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(e,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return E.CallHierarchyPrepareRequest}});var T=wg();Object.defineProperty(e,"TokenFormat",{enumerable:!0,get:function(){return T.TokenFormat}}),Object.defineProperty(e,"SemanticTokensRequest",{enumerable:!0,get:function(){return T.SemanticTokensRequest}}),Object.defineProperty(e,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return T.SemanticTokensDeltaRequest}}),Object.defineProperty(e,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return T.SemanticTokensRangeRequest}}),Object.defineProperty(e,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return T.SemanticTokensRefreshRequest}}),Object.defineProperty(e,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return T.SemanticTokensRegistrationType}});var A=_g();Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return A.ShowDocumentRequest}});var H=xg();Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return H.LinkedEditingRangeRequest}});var V=kg();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 W=Cg();Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return W.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return W.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return W.MonikerRequest}});var M=Sg();Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return M.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return M.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return M.TypeHierarchySupertypesRequest}});var Q=Eg();Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return Q.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return Q.InlineValueRefreshRequest}});var pe=Tg();Object.defineProperty(e,"InlayHintRequest",{enumerable:!0,get:function(){return pe.InlayHintRequest}}),Object.defineProperty(e,"InlayHintResolveRequest",{enumerable:!0,get:function(){return pe.InlayHintResolveRequest}}),Object.defineProperty(e,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return pe.InlayHintRefreshRequest}});var P=Rg();Object.defineProperty(e,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return P.DiagnosticServerCancellationData}}),Object.defineProperty(e,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return P.DocumentDiagnosticReportKind}}),Object.defineProperty(e,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return P.DocumentDiagnosticRequest}}),Object.defineProperty(e,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return P.WorkspaceDiagnosticRequest}}),Object.defineProperty(e,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return P.DiagnosticRefreshRequest}});var I=Dg();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 $=Og();Object.defineProperty(e,"InlineCompletionRequest",{enumerable:!0,get:function(){return $.InlineCompletionRequest}});var de;(function(L){function Je(q){let ne=q;return a.string(ne)||a.string(ne.language)||a.string(ne.scheme)||a.string(ne.pattern)}L.is=Je})(de||(e.TextDocumentFilter=de={}));var fe;(function(L){function Je(q){let ne=q;return a.objectLiteral(ne)&&(a.string(ne.notebookType)||a.string(ne.scheme)||a.string(ne.pattern))}L.is=Je})(fe||(e.NotebookDocumentFilter=fe={}));var be;(function(L){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))}L.is=Je})(be||(e.NotebookCellTextDocumentFilter=be={}));var Y;(function(L){function Je(q){if(!Array.isArray(q))return!1;for(let ne of q)if(!a.string(ne)&&!de.is(ne)&&!be.is(ne))return!1;return!0}L.is=Je})(Y||(e.DocumentSelector=Y={}));var we;(function(L){L.method="client/registerCapability",L.messageDirection=n.MessageDirection.serverToClient,L.type=new n.ProtocolRequestType(L.method)})(we||(e.RegistrationRequest=we={}));var Ee;(function(L){L.method="client/unregisterCapability",L.messageDirection=n.MessageDirection.serverToClient,L.type=new n.ProtocolRequestType(L.method)})(Ee||(e.UnregistrationRequest=Ee={}));var ie;(function(L){L.Create="create",L.Rename="rename",L.Delete="delete"})(ie||(e.ResourceOperationKind=ie={}));var X;(function(L){L.Abort="abort",L.Transactional="transactional",L.TextOnlyTransactional="textOnlyTransactional",L.Undo="undo"})(X||(e.FailureHandlingKind=X={}));var G;(function(L){L.UTF8="utf-8",L.UTF16="utf-16",L.UTF32="utf-32"})(G||(e.PositionEncodingKind=G={}));var K;(function(L){function Je(q){let ne=q;return ne&&a.string(ne.id)&&ne.id.length>0}L.hasId=Je})(K||(e.StaticRegistrationOptions=K={}));var Le;(function(L){function Je(q){let ne=q;return ne&&(ne.documentSelector===null||Y.is(ne.documentSelector))}L.is=Je})(Le||(e.TextDocumentRegistrationOptions=Le={}));var Qe;(function(L){function Je(ne){let ye=ne;return a.objectLiteral(ye)&&(ye.workDoneProgress===void 0||a.boolean(ye.workDoneProgress))}L.is=Je;function q(ne){let ye=ne;return ye&&a.boolean(ye.workDoneProgress)}L.hasWorkDoneProgress=q})(Qe||(e.WorkDoneProgressOptions=Qe={}));var ut;(function(L){L.method="initialize",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(ut||(e.InitializeRequest=ut={}));var Be;(function(L){L.unknownProtocolVersion=1})(Be||(e.InitializeErrorCodes=Be={}));var We;(function(L){L.method="initialized",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolNotificationType(L.method)})(We||(e.InitializedNotification=We={}));var De;(function(L){L.method="shutdown",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType0(L.method)})(De||(e.ShutdownRequest=De={}));var Ne;(function(L){L.method="exit",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolNotificationType0(L.method)})(Ne||(e.ExitNotification=Ne={}));var gn;(function(L){L.method="workspace/didChangeConfiguration",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolNotificationType(L.method)})(gn||(e.DidChangeConfigurationNotification=gn={}));var It;(function(L){L.Error=1,L.Warning=2,L.Info=3,L.Log=4,L.Debug=5})(It||(e.MessageType=It={}));var Dn;(function(L){L.method="window/showMessage",L.messageDirection=n.MessageDirection.serverToClient,L.type=new n.ProtocolNotificationType(L.method)})(Dn||(e.ShowMessageNotification=Dn={}));var ln;(function(L){L.method="window/showMessageRequest",L.messageDirection=n.MessageDirection.serverToClient,L.type=new n.ProtocolRequestType(L.method)})(ln||(e.ShowMessageRequest=ln={}));var Ue;(function(L){L.method="window/logMessage",L.messageDirection=n.MessageDirection.serverToClient,L.type=new n.ProtocolNotificationType(L.method)})(Ue||(e.LogMessageNotification=Ue={}));var nn;(function(L){L.method="telemetry/event",L.messageDirection=n.MessageDirection.serverToClient,L.type=new n.ProtocolNotificationType(L.method)})(nn||(e.TelemetryEventNotification=nn={}));var gt;(function(L){L.None=0,L.Full=1,L.Incremental=2})(gt||(e.TextDocumentSyncKind=gt={}));var yn;(function(L){L.method="textDocument/didOpen",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolNotificationType(L.method)})(yn||(e.DidOpenTextDocumentNotification=yn={}));var Yn;(function(L){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")}L.isIncremental=Je;function q(ne){let ye=ne;return ye!=null&&typeof ye.text=="string"&&ye.range===void 0&&ye.rangeLength===void 0}L.isFull=q})(Yn||(e.TextDocumentContentChangeEvent=Yn={}));var kt;(function(L){L.method="textDocument/didChange",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolNotificationType(L.method)})(kt||(e.DidChangeTextDocumentNotification=kt={}));var ci;(function(L){L.method="textDocument/didClose",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolNotificationType(L.method)})(ci||(e.DidCloseTextDocumentNotification=ci={}));var vn;(function(L){L.method="textDocument/didSave",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolNotificationType(L.method)})(vn||(e.DidSaveTextDocumentNotification=vn={}));var bn;(function(L){L.Manual=1,L.AfterDelay=2,L.FocusOut=3})(bn||(e.TextDocumentSaveReason=bn={}));var An;(function(L){L.method="textDocument/willSave",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolNotificationType(L.method)})(An||(e.WillSaveTextDocumentNotification=An={}));var Nr;(function(L){L.method="textDocument/willSaveWaitUntil",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(Nr||(e.WillSaveTextDocumentWaitUntilRequest=Nr={}));var In;(function(L){L.method="workspace/didChangeWatchedFiles",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolNotificationType(L.method)})(In||(e.DidChangeWatchedFilesNotification=In={}));var rn;(function(L){L.Created=1,L.Changed=2,L.Deleted=3})(rn||(e.FileChangeType=rn={}));var Vi;(function(L){function Je(q){let ne=q;return a.objectLiteral(ne)&&(i.URI.is(ne.baseUri)||i.WorkspaceFolder.is(ne.baseUri))&&a.string(ne.pattern)}L.is=Je})(Vi||(e.RelativePattern=Vi={}));var Ur;(function(L){L.Create=1,L.Change=2,L.Delete=4})(Ur||(e.WatchKind=Ur={}));var Mr;(function(L){L.method="textDocument/publishDiagnostics",L.messageDirection=n.MessageDirection.serverToClient,L.type=new n.ProtocolNotificationType(L.method)})(Mr||(e.PublishDiagnosticsNotification=Mr={}));var ui;(function(L){L.Invoked=1,L.TriggerCharacter=2,L.TriggerForIncompleteCompletions=3})(ui||(e.CompletionTriggerKind=ui={}));var Ht;(function(L){L.method="textDocument/completion",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(Ht||(e.CompletionRequest=Ht={}));var Qt;(function(L){L.method="completionItem/resolve",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(Qt||(e.CompletionResolveRequest=Qt={}));var yt;(function(L){L.method="textDocument/hover",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(yt||(e.HoverRequest=yt={}));var Ft;(function(L){L.Invoked=1,L.TriggerCharacter=2,L.ContentChange=3})(Ft||(e.SignatureHelpTriggerKind=Ft={}));var Ct;(function(L){L.method="textDocument/signatureHelp",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(Ct||(e.SignatureHelpRequest=Ct={}));var di;(function(L){L.method="textDocument/definition",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(di||(e.DefinitionRequest=di={}));var $i;(function(L){L.method="textDocument/references",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})($i||(e.ReferencesRequest=$i={}));var Ar;(function(L){L.method="textDocument/documentHighlight",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(Ar||(e.DocumentHighlightRequest=Ar={}));var fr;(function(L){L.method="textDocument/documentSymbol",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(fr||(e.DocumentSymbolRequest=fr={}));var Ge;(function(L){L.method="textDocument/codeAction",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(Ge||(e.CodeActionRequest=Ge={}));var Vt;(function(L){L.method="codeAction/resolve",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(Vt||(e.CodeActionResolveRequest=Vt={}));var lt;(function(L){L.method="workspace/symbol",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(lt||(e.WorkspaceSymbolRequest=lt={}));var vt;(function(L){L.method="workspaceSymbol/resolve",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(vt||(e.WorkspaceSymbolResolveRequest=vt={}));var On;(function(L){L.method="textDocument/codeLens",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(On||(e.CodeLensRequest=On={}));var Kr;(function(L){L.method="codeLens/resolve",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(Kr||(e.CodeLensResolveRequest=Kr={}));var St;(function(L){L.method="workspace/codeLens/refresh",L.messageDirection=n.MessageDirection.serverToClient,L.type=new n.ProtocolRequestType0(L.method)})(St||(e.CodeLensRefreshRequest=St={}));var Zn;(function(L){L.method="textDocument/documentLink",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(Zn||(e.DocumentLinkRequest=Zn={}));var Qr;(function(L){L.method="documentLink/resolve",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(Qr||(e.DocumentLinkResolveRequest=Qr={}));var fi;(function(L){L.method="textDocument/formatting",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(fi||(e.DocumentFormattingRequest=fi={}));var jn;(function(L){L.method="textDocument/rangeFormatting",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(jn||(e.DocumentRangeFormattingRequest=jn={}));var Hn;(function(L){L.method="textDocument/rangesFormatting",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(Hn||(e.DocumentRangesFormattingRequest=Hn={}));var Gr;(function(L){L.method="textDocument/onTypeFormatting",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(Gr||(e.DocumentOnTypeFormattingRequest=Gr={}));var pi;(function(L){L.Identifier=1})(pi||(e.PrepareSupportDefaultBehavior=pi={}));var er;(function(L){L.method="textDocument/rename",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(er||(e.RenameRequest=er={}));var Pn;(function(L){L.method="textDocument/prepareRename",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(Pn||(e.PrepareRenameRequest=Pn={}));var bt;(function(L){L.method="workspace/executeCommand",L.messageDirection=n.MessageDirection.clientToServer,L.type=new n.ProtocolRequestType(L.method)})(bt||(e.ExecuteCommandRequest=bt={}));var jt;(function(L){L.method="workspace/applyEdit",L.messageDirection=n.MessageDirection.serverToClient,L.type=new n.ProtocolRequestType("workspace/applyEdit")})(jt||(e.ApplyWorkspaceEditRequest=jt={}))})),Lg=ke((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var n=Eo();function i(a,s,c,d){return n.ConnectionStrategy.is(d)&&(d={connectionStrategy:d}),(0,n.createMessageConnection)(a,s,c,d)}e.createProtocolConnection=i})),Ng=ke((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,f,m){m===void 0&&(m=f);var g=Object.getOwnPropertyDescriptor(d,f);(!g||("get"in g?!d.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(c,m,g)}):(function(c,d,f,m){m===void 0&&(m=f),c[m]=d[f]})),i=e&&e.__exportStar||function(c,d){for(var f in c)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&n(d,c,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,i(Eo(),e),i((um(),gu(cm)),e),i(qt(),e),i(Pg(),e);var a=Lg();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={}))})),Ju=ke((e=>{var n=e&&e.__createBinding||(Object.create?(function(c,d,f,m){m===void 0&&(m=f);var g=Object.getOwnPropertyDescriptor(d,f);(!g||("get"in g?!d.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return d[f]}}),Object.defineProperty(c,m,g)}):(function(c,d,f,m){m===void 0&&(m=f),c[m]=d[f]})),i=e&&e.__exportStar||function(c,d){for(var f in c)f!=="default"&&!Object.prototype.hasOwnProperty.call(d,f)&&n(d,c,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;var a=Fd();i(Fd(),e),i(Ng(),e);function s(c,d,f,m){return(0,a.createMessageConnection)(c,d,f,m)}e.createProtocolConnection=s}));function hn(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 Or(e,n){return hn(e,n)||0}function zi(e,n){let i=e.lineAt(n);return{character:n-i.from,line:i.number-1}}var Xl=new I2.Renderer,iC=Xl.code;Xl.code=e=>e.text.trim()?iC.call(Xl,e):"";function Mg(e){return I2(e,{async:!1,gfm:!0,breaks:!0,renderer:Xl})}function Pr(e,n=Mg){if(!e)return"";if(lC(e)){let i=e.value;return e.kind==="markdown"&&(i=n(i.trim())),i}return Array.isArray(e)?e.map(i=>Pr(i,n)).filter(Boolean).join(`
|
|
110
|
-
|
|
111
|
-
`):typeof e=="string"?e:""}function oC(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 aC(e){if(e.length===0)return;let n=oC(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 sC(e){return(e==null?void 0:e.range)!==void 0}function lC(e){return e.kind!==void 0}function Jn(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 Yl(e){if(e==null)return!0;if(Array.isArray(e))return e.length===0||e.every(Yl);if(typeof e=="string")return Ag(e);let n=e.value;return typeof n=="string"?Ag(n):!1}function Ag(e){return e==null?!0:typeof e=="string"?e.trim()===""||/^[\s\n`]*$/.test(e):!1}function cC(e,n){let i=[];return n.iterChanges((a,s,c,d,f)=>{let m=f.toString();if(a===0&&s===e.length){i.push({text:m});return}let g=zi(e,a),w=zi(e,s);i.push({range:{start:g,end:w},text:m})}),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 f=a.range.start.character??-1;return(s.range.start.character??-1)-f}),i}var uC=Kt(Ju(),1),dC=Object.fromEntries(Object.entries(uC.CompletionItemKind).map(([e,n])=>[n,e])),Ig;(function(e){e.PlainText=1,e.Snippet=2})(Ig||(Ig={}));function fC(e){return e.replaceAll(/\\\\/g,"").replaceAll(/(\$(\d+))/g,(n,i,a)=>"${"+a+"}")}function pC(e,n){let{detail:i,labelDetails:a,label:s,kind:c,textEdit:d,insertText:f,documentation:m,additionalTextEdits:g,insertTextFormat:w}=e,_={label:s,detail:(a==null?void 0:a.detail)||i,apply(C,E,T,A){if(d&&sC(d)?C.dispatch(P2(C.state,d.newText,Or(C.state.doc,d.range.start),Or(C.state.doc,d.range.end))):f&&w===Ig.Snippet&&n.useSnippetOnCompletion?FR(fC(f))(C,null,T,A):C.dispatch(P2(C.state,s,T,A)),!g)return;let H=g.sort(({range:{end:V}},{range:{end:W}})=>Or(C.state.doc,V)<Or(C.state.doc,W)?1:Or(C.state.doc,V)>Or(C.state.doc,W)?-1:0);for(let V of H)C.dispatch(C.state.update({changes:{from:Or(C.state.doc,V.range.start),to:hn(C.state.doc,V.range.end),insert:V.newText}}))},type:c&&dC[c].toLowerCase()};return n.hasResolveProvider&&n.resolveItem?_.info=async()=>{var C;try{let E=await((C=n.resolveItem)==null?void 0:C.call(n,e)),T=document.createElement("div");T.classList.add("documentation");let A=(E==null?void 0:E.documentation)||m;return!A||Yl(A)?null:(n.allowHTMLContent?T.innerHTML=Pr(A,n.markdownRenderer):T.textContent=Pr(A,n.markdownRenderer),T)}catch(E){if(console.error("Failed to resolve completion item:",E),Yl(m))return null;if(m){let T=document.createElement("div");return T.classList.add("documentation"),n.allowHTMLContent?T.innerHTML=Pr(m,n.markdownRenderer):T.textContent=Pr(m,n.markdownRenderer),T}return null}}:m&&(_.info=()=>{let C=document.createElement("div");return C.classList.add("documentation"),n.allowHTMLContent?C.innerHTML=Pr(m,n.markdownRenderer):C.textContent=Pr(m,n.markdownRenderer),C}),_}function mC(e,n,i){let a=[n?hC(n):gC,i==="python"?yC:void 0].filter(Boolean),s=e;if(n){let c=n.toLowerCase();/^\w+$/.test(c)&&(s=s.filter(({label:d,filterText:f})=>(f??d).toLowerCase().startsWith(c)))}for(let c of a)s.sort(c);return s}function hC(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 gC(e,n){let i=e.sortText??e.label,a=n.sortText??n.label;return i.localeCompare(a)}function yC(e,n){let i=e.label.endsWith("="),a=n.label.endsWith("=");return i&&!a?-1:!i&&a?1:0}function jg(e){let n=new Proxy({},{get(){throw Error(e)}});return function(i){return i.at(-1)??n}}const qg=Dl.define({combine:jg("No document URI provided. Either pass a one into the extension or use documentUri.of().")}),vC=Dl.define({combine:jg("No language ID provided. Either pass a one into the extension or use languageId.of().")});let Bd,zg;Bd=Kt(Hl(),1),zg=1e4,Fl=class{constructor({rootUri:e,workspaceFolders:n,transport:i,initializationOptions:a,capabilities:s,timeout:c=zg,getWorkspaceConfiguration:d}){Ce(this,"ready");Ce(this,"capabilities");Ce(this,"initializePromise");Ce(this,"rootUri");Ce(this,"workspaceFolders");Ce(this,"timeout");Ce(this,"transport");Ce(this,"requestManager");Ce(this,"client");Ce(this,"initializationOptions");Ce(this,"clientCapabilities");Ce(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 Bd.RequestManager([this.transport]),this.client=new Bd.Client(this.requestManager),this.client.onNotification(m=>{this.processNotification(m)});let f=this.transport;f!=null&&f.connection&&f.connection.addEventListener("message",m=>{let g=JSON.parse(m.data);g.method==="workspace/configuration"&&d?f.connection.send(JSON.stringify({jsonrpc:"2.0",id:g.id,result:d(g.params)})):g.method&&g.id&&f.connection.send(JSON.stringify({jsonrpc:"2.0",id:g.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))}},Hl();var Fi=Kt(Ju(),1),Fg=console.log;function bC(){return String(Date.now()+Math.random())}var wC=class{constructor(e){Ce(this,"documentVersion");Ce(this,"pluginId");Ce(this,"client");Ce(this,"documentUri");Ce(this,"languageId");Ce(this,"view");Ce(this,"allowHTMLContent");Ce(this,"useSnippetOnCompletion");Ce(this,"sendIncrementalChanges");Ce(this,"featureOptions");Ce(this,"onGoToDefinition");Ce(this,"markdownRenderer");Ce(this,"disposeListener");Ce(this,"lastSeenDiagnosticsVersion",0);let{client:n,documentUri:i,languageId:a,view:s,featureOptions:c,sendIncrementalChanges:d=!0,allowHTMLContent:f=!1,useSnippetOnCompletion:m=!1,onGoToDefinition:g,markdownRenderer:w=Mg}=e;this.documentVersion=0,this.pluginId=bC(),this.client=n,this.documentUri=i,this.languageId=a,this.view=s,this.allowHTMLContent=f,this.useSnippetOnCompletion=m,this.sendIncrementalChanges=d,this.featureOptions=c,this.onGoToDefinition=g,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(cC(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 g;if(!this.featureOptions.hoverEnabled||!(this.client.ready&&((g=this.client.capabilities)!=null&&g.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=hn(e.state.doc,{line:n,character:i}),f;if(c&&(d=hn(e.state.doc,c.start),f=hn(e.state.doc,c.end)),d==null||Yl(s))return null;let m=document.createElement("div");return m.classList.add("documentation","cm-lsp-hover-tooltip"),this.allowHTMLContent?m.innerHTML=Pr(s,this.markdownRenderer):m.textContent=Pr(s,this.markdownRenderer),{pos:d,end:f,create:w=>({dom:m}),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,f=aC(d),m=f?e.matchBefore(f):e.matchBefore(/[a-zA-Z0-9]+/),{pos:g}=e,w=mC(d,m==null?void 0:m.text,this.languageId);m&&(g=m.from);let _=w.map(E=>{var T,A;return pC(E,{allowHTMLContent:this.allowHTMLContent,useSnippetOnCompletion:this.useSnippetOnCompletion,hasResolveProvider:((A=(T=this.client.capabilities)==null?void 0:T.completionProvider)==null?void 0:A.resolveProvider)??!1,resolveItem:this.client.completionItemResolve.bind(this.client)})});return{from:g,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,f="range"in c?c.range:c.targetRange,m=d!==this.documentUri,g={uri:d,range:f,isExternalDocument:m};return m||e.dispatch(e.state.update({selection:{anchor:Or(e.state.doc,f.start),head:hn(e.state.doc,f.end)}})),this.onGoToDefinition&&this.onGoToDefinition(g),g}processNotification(e){try{switch(e.method){case"textDocument/publishDiagnostics":this.processDiagnostics(e.params)}}catch(n){Fg(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={[Fi.DiagnosticSeverity.Error]:"error",[Fi.DiagnosticSeverity.Warning]:"warning",[Fi.DiagnosticSeverity.Information]:"info",[Fi.DiagnosticSeverity.Hint]:"info"},i=e.diagnostics.map(async({range:s,message:c,severity:d,code:f,source:m})=>{var w;let g=(w=await this.requestCodeActions(s,[f]))==null?void 0:w.map(_=>{var C;return{name:"command"in _&&typeof _.command=="object"&&((C=_.command)==null?void 0:C.title)||_.title,apply:async()=>{var E;if("edit"in _&&((E=_.edit)!=null&&E.changes)){let T=_.edit.changes[this.documentUri];if(!T)return;for(let A of T)this.view.dispatch(this.view.state.update({changes:{from:Or(this.view.state.doc,A.range.start),to:hn(this.view.state.doc,A.range.end),insert:A.newText}}))}"command"in _&&_.command&&Fg("Executing command:",_.command)}}});return{from:Or(this.view.state.doc,s.start),to:Or(this.view.state.doc,s.end),severity:n[d??Fi.DiagnosticSeverity.Error],message:c,renderMessage:()=>{let _=document.createElement("div");return _.innerHTML=this.markdownRenderer(c),_},source:m||this.languageId,markClass:this.pluginId,actions:g}}),a=await Promise.all(i);this.addDiagnostics(a)}addDiagnostics(e){if(e.length===0)return;let n=this.view.state,i=[];NR(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(R2(n,[...s,...e]))}clearDiagnostics(){this.view.dispatch(R2(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){Jn(e,"Language server not ready");return}if(!((a=this.client.capabilities)!=null&&a.renameProvider)){Jn(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){Jn(e,"Cannot rename this symbol");return}let c=document.createElement("div");c.className="cm-rename-popup",c.style.cssText="position: absolute; padding: 4px; background: white; border: 1px solid #ddd; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 99;";let d=document.createElement("input");d.type="text",d.style.cssText="width: 200px; padding: 4px; border: 1px solid #ddd;";let f="range"in s?s.range:s,m=hn(e.state.doc,f.start);if(m==null)return;let g=hn(e.state.doc,f.end);d.value=e.state.doc.sliceString(m,g),c.appendChild(d);let w=e.coordsAtPos(m);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){Jn(e,"New name cannot be empty"),c.remove();return}if(E===d.defaultValue){c.remove();return}try{let T=await this.client.textDocumentRename({textDocument:{uri:this.documentUri},position:{line:n,character:i},newName:E});await this.applyRenameEdit(e,T)}catch(T){Jn(e,`Rename failed: ${T instanceof Error?T.message:"Unknown error"}`)}finally{c.remove()}};d.addEventListener("keydown",E=>{E.key==="Enter"?_():E.key==="Escape"&&c.remove(),E.stopPropagation()});let C=E=>{c.contains(E.target)||(c.remove(),document.removeEventListener("mousedown",C))};document.addEventListener("mousedown",C),document.body.appendChild(c),d.focus(),d.select()}catch(s){Jn(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 f=this.createTooltipContainer(),m=d.activeSignature??0,g=d.signatures[m]||d.signatures[0];if(!g)return null;let w=d.activeParameter??g.activeParameter??0,_=this.createSignatureElement(g,w);f.appendChild(_),g.documentation&&f.appendChild(this.createDocumentationElement(g.documentation));let C=(c=g.parameters)==null?void 0:c[w];C!=null&&C.documentation&&f.appendChild(this.createParameterDocElement(C.documentation));let E=hn(e.state.doc,{line:n,character:i});return E==null?null:{pos:E,end:E,create:T=>({dom:f}),above:!1}}catch(d){return console.error("Signature help error:",d),null}}async showSignatureHelpTooltip(e,n,i){let a=await this.requestSignatureHelp(e,zi(e.state.doc,n),i);if(a){let{pos:s,create:c}=a,d=c(e),f=document.createElement("div");f.className="cm-tooltip cm-signature-tooltip",f.style.position="absolute",f.appendChild(d.dom);let m=e.coordsAtPos(s);if(m){f.style.left=`${m.left}px`,f.style.top=`${m.bottom+5}px`,document.body.appendChild(f),setTimeout(()=>{f.remove()},1e4);let g=()=>{f.remove(),e.dom.removeEventListener("keydown",g),e.dom.removeEventListener("mousedown",g)};e.dom.addEventListener("keydown",g),e.dom.addEventListener("mousedown",g)}}}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 f=document.createElement("span");f.classList.add("cm-signature-active-param"),f.style.cssText="font-weight: bold; text-decoration: underline;",f.textContent=c,e.appendChild(f),e.appendChild(document.createTextNode(d))}createDocumentationElement(e){let n=document.createElement("div");n.classList.add("cm-signature-docs"),n.style.cssText="margin-top: 4px; color: #666;";let i=Pr(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=Pr(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,f=i;for(;(c=s.exec(a))!==null;){let m=c.index,g=c.index+c[0].length;if(i>=m&&i<=g){d=m,f=g;break}}return d===i&&f===i?null:{range:{start:{line:n,character:d},end:{line:n,character:f}},placeholder:a.slice(d,f)}}async applyRenameEdit(e,n){if(!n)return Jn(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 Jn(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){Jn(e,"Multi-file rename not supported yet");continue}let c=s.edits.sort((d,f)=>{let m=hn(e.state.doc,d.range.start);return(hn(e.state.doc,f.range.start)??0)-(m??0)}).map(d=>({from:hn(e.state.doc,d.range.start)??0,to:hn(e.state.doc,d.range.end)??0,insert:d.newText}));return e.dispatch(e.state.update({changes:c})),!0}return Jn(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){Jn(e,"Multi-file rename not supported yet");continue}let d=c.sort((f,m)=>{let g=hn(e.state.doc,f.range.start);return(hn(e.state.doc,m.range.start)??0)-(g??0)}).map(f=>({from:hn(e.state.doc,f.range.start)??0,to:hn(e.state.doc,f.range.end)??0,insert:f.newText}));e.dispatch(e.state.update({changes:d}))}return!1}};Vm=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=[sa.define(f=>(n=new wC({client:a,documentUri:e.documentUri??f.state.facet(qg),languageId:e.languageId??f.state.facet(vC),view:f,featureOptions:s,sendIncrementalChanges:e.sendIncrementalChanges,allowHTMLContent:e.allowHTMLContent,useSnippetOnCompletion:e.useSnippetOnCompletion,onGoToDefinition:e.onGoToDefinition,markdownRenderer:e.markdownRenderer}),n))];return c.push(aa.of([{key:i.signatureHelp,run:f=>{if(!(n&&s.signatureHelpEnabled))return!1;let m=f.state.selection.main.head;return n.showSignatureHelpTooltip(f,m),!0}},{key:i.rename,run:f=>{if(!(n&&s.renameEnabled))return!1;let m=f.state.selection.main.head;return n.requestRename(f,zi(f.state.doc,m)),!0}},{key:i.goToDefinition,run:f=>{if(!(n&&s.definitionEnabled))return!1;let m=f.state.selection.main.head;return n.requestDefinition(f,zi(f.state.doc,m)).catch(g=>Jn(f,`Go to definition failed: ${g instanceof Error?g.message:"Unknown error"}`)),!0}}])),s.hoverEnabled&&c.push(om((f,m)=>n==null?null:n.requestHoverTooltip(f,zi(f.state.doc,m)),e.hoverConfig)),s.signatureHelpEnabled&&c.push(en.updateListener.of(async f=>{var E;if(!(n&&f.docChanged)||!((E=n.client.capabilities)!=null&&E.signatureHelpProvider)||!s.signatureActivateOnTyping)return;let m=n.client.capabilities.signatureHelpProvider.triggerCharacters||["(",","],g,w=f.changes,_=!1,C=-1;w.iterChanges((T,A,H,V,W)=>{if(_)return;let M=W.toString();if(M){for(let Q of m)if(M.includes(Q)){_=!0,C=V,g=Q;break}}}),_&&C>=0&&n.showSignatureHelpTooltip(f.view,C,g)})),s.completionEnabled&&c.push(ku({...e.completionConfig,override:[async f=>{var _,C;if(n==null)return null;let{state:m,pos:g}=f,w=_C(f,((C=(_=n.client.capabilities)==null?void 0:_.completionProvider)==null?void 0:C.triggerCharacters)??[],e.completionMatchBefore);return w==null?null:await n.requestCompletion(f,zi(m.doc,g),w)},...((d=e.completionConfig)==null?void 0:d.override)||[]]})),c.push(en.domEventHandlers({click:(f,m)=>{if(s.definitionEnabled&&i.goToDefinition==="ctrlcmd"&&(f.ctrlKey||f.metaKey)){let g=m.posAtCoords({x:f.clientX,y:f.clientY});g&&n&&(n.requestDefinition(m,zi(m.state.doc,g)).catch(w=>Jn(m,`Go to definition failed: ${w instanceof Error?w.message:"Unknown error"}`)),f.preventDefault())}}})),c};function _C(e,n,i){let{state:a,pos:s,explicit:c}=e,d=a.doc.lineAt(s),f=Fi.CompletionTriggerKind.Invoked,m,g=d.text[s-d.from-1]||"",w=n==null?void 0:n.includes(g);return!c&&w&&(f=Fi.CompletionTriggerKind.TriggerCharacter,m=g),f===Fi.CompletionTriggerKind.Invoked&&!e.matchBefore(i||/(\w+|\w+\.|\/|,)$/)?null:{triggerKind:f,triggerCharacter:m}}function Bg(){return`file://${ql()??"/__marimo_notebook__.py"}`}function Hd(){return`file://${rd.dirname(ql()??"/")}`}function xC(e){return ni.filter(e,n=>n!==!1&&n!==null)}function Hg(e){let n=e.map(xC);return Object.assign({},...n)}var kC=class{constructor(e){Ce(this,"clients",[]);this.clients=e,this.documentUri=Bg()}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 Hg(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 Hg(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 CC(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 CC(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 Zl=class{constructor(e,n={}){Ce(this,"cache",new Map);this.maxSize=e,this.options=n}getOrCreate(e){fn(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)}};f_=function(e){return[...SC(e),e].join(`
|
|
123
|
-
`)};function SC(e){return Hm().map(n=>{let i=ai(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 EC=Fe(e=>{let n=e(ft);return ni.fromEntries(n.cellIds.inOrderIds.map(i=>{let a=n.cellHandles[i];return[i,a!=null&&a.current?ai(a.current.editorView):""]}))}),TC=Fe(e=>e(ft).cellIds.inOrderIds),RC=Fe(e=>OC(e(TC),e(vo)));const DC=Fe(e=>({cellIds:e(RC),codes:e(EC)}));function OC(e,n){var m,g;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&&((m=i.get(C))==null||m.push(E))}let c=new Map;e.forEach(w=>c.set(w,0)),i.forEach(w=>{w.forEach(_=>{c.set(_,(c.get(_)||0)+1)})});let d=[];c.forEach((w,_)=>{w===0&&d.push(_)});let f=[];for(;d.length>0;){let w=d.shift();if(!w)break;f.push(w),(g=i.get(w))==null||g.forEach(_=>{c.set(_,(c.get(_)||0)-1),c.get(_)===0&&d.push(_)})}return[...f.filter(w=>!a.has(w)),...a]}function PC(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,f)=>Vg(d,s(f)),reverseRange:(d,f)=>Vg(d,-s(f)),isInRange:(d,f)=>{let m=n[f].split(`
|
|
126
|
-
`).length,g=i.get(f)||0,w=d.start.line-g,_=d.end.line-g;return w>=0&&_<m},getEditsForNewText:d=>{let f=d.split(`
|
|
127
|
-
`),m=c.split(`
|
|
128
|
-
`);if(f.length!==m.length)throw Error("Cannot apply rename when there are new lines");let g=[];for(let[w,_]of ni.entries(n)){if(!i.has(w))continue;let C=i.get(w)??0,E=_.split(`
|
|
129
|
-
`).length,T=f.slice(C,C+E);g.push({cellId:w,text:T.join(`
|
|
130
|
-
`)})}return g},transformPosition:(d,f)=>ec(d,s(f)),reversePosition:(d,f)=>ec(d,-s(f))}}function Vg(e,n){return{start:ec(e.start,n),end:ec(e.end,n)}}function ec(e,n){return{line:e.line+n,character:e.character}}const Xn={PREFIX:"file:///",of(e){return`${this.PREFIX}${e}`},is(e){return e.startsWith(this.PREFIX)},parse(e){return fn(this.is(e),`Invalid cell document URI: ${e}`),e.slice(this.PREFIX.length)}};function $g(e){return"notify"in e}var LC=class{constructor(e){Ce(this,"documentVersion",0);Ce(this,"versionToCellNumberAndVersion",new Zl(20));Ce(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 PC(e,n)}},NC=()=>{let e=Wu().cellHandles;return ni.mapValues(e,n=>{var i;return(i=n.current)==null?void 0:i.editorViewOrNull})},Vd=(Hi=class{constructor(n,i,a=NC){Ce(this,"completionItemCache",new Zl(10));this.documentUri=Bg(),this.getNotebookEditors=a,this.initialSettings=i,this.client=n,this.patchProcessNotification(),this.initializePromise.then(()=>{fn($g(this.client),"notify is not a method on the client"),this.client.notify("workspace/didChangeConfiguration",{settings:i})}),this.snapshotter=new LC(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(){fn($g(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 st.get(DC)}assertCellDocumentUri(n){fn(Xn.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();Hi.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(!Xn.is(i))return Pe.warn("Invalid cell document URI",i),null;await this.sync();let{lens:a}=this.snapshotter.getLatestSnapshot(),s=Xn.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(!Xn.is(i))return Pe.warn("Invalid cell document URI",i),null;await this.sync();let{lens:a}=this.snapshotter.getLatestSnapshot(),s=Xn.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(!Xn.is(i))return Pe.warn("Invalid cell document URI",i),null;let a=Xn.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 f=(C=d.documentChanges)==null?void 0:C.flatMap(E=>"edits"in E?E.edits:[]);if(!f||f.length!==1)return Pe.warn("Expected exactly one edit",f),d;let m=f[0];if(!("newText"in m))return Pe.warn("Expected newText in edit",m),d;let g=s.getEditsForNewText(m.newText),w=new Map(g.map(E=>[E.cellId,E.text])),_=this.getNotebookEditors();for(let[E,T]of ni.entries(_)){let A=w.get(E);if(A==null){Pe.warn("No new code for cell",E);continue}if(!T){Pe.warn("No view for plugin",E);continue}T.state.doc.toString()!==A&&T.dispatch({changes:{from:0,to:T.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(!Xn.is(i))return Pe.warn("Invalid cell document URI",i),null;await this.sync();let{lens:a}=this.snapshotter.getLatestSnapshot(),s=Xn.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=Xn.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=Xn.parse(n.textDocument.uri);return this.client.textDocumentCompletion({...n,textDocument:{uri:this.documentUri},position:i.transformPosition(n.position,a)})}patchProcessNotification(){fn("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:f}=s,m=new Map;for(let w of c)for(let _ of d.cellIds)if(d.isInRange(w.range,_)){m.has(_)||m.set(_,[]);let C={...w,range:d.reverseRange(w.range,_)};m.get(_).push(C);break}let g=new Set(Hi.SEEN_CELL_DOCUMENT_URIS);for(let[w,_]of m.entries()){Pe.debug("[lsp] diagnostics for cell",w,_);let C=Xn.of(w);g.delete(C),n({...a,params:{...a.params,uri:C,version:f,diagnostics:_}})}if(g.size>0){Pe.debug("[lsp] clearing diagnostics",g);for(let w of g)n({method:"textDocument/publishDiagnostics",params:{uri:w,diagnostics:[]}})}return}return n(a)};this.client.processNotification=i}},Ce(Hi,"SEEN_CELL_DOCUMENT_URIS",new Set),Hi),MC=Kt(Hl(),1),AC=Kt(wo(),1),IC=class extends AC.Transport{constructor(n){super();Ce(this,"isClosed",!1);Ce(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 MC.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 $d(e,n){let i=aR();return new IC({getWsUrl:()=>i.getLSPURL(e).toString(),waitForConnection:async()=>{await KR()},onReconnect:n})}Bm=function(e){return e===ii.CONNECTING},ed=function(e){return e===ii.OPEN},Zw=function(e){return e===ii.CLOSED||e===ii.CLOSING||e===ii.CONNECTING},n_=function(e){switch(e){case ii.CLOSED:return"App disconnected";case ii.CONNECTING:return"Connecting to a runtime ...";case ii.CLOSING:return"App disconnecting...";case ii.OPEN:return"";default:return""}};var Wg=ho.define(),Ug=new bu,Wd="marimo-connecting-indicator";function jC(){let e=document.getElementById(Wd);return e||(e=document.createElement("div"),e.id=Wd,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 Kg(e,n){let i=jC();i.style.left=`${e}px`,i.style.top=`${n}px`,i.style.display="block",i.textContent="Connecting\u2026"}function Ud(){let e=document.getElementById(Wd);e&&(e.style.display="none")}var Kd=null;Aw=function(e){let n=()=>e.get(Ll).state,i=!ed(n()),a=sa.define(s=>{let c=!1,d=s.dom;function f(){let C=s.state.selection.main,E=s.coordsAtPos(C.head);E?Kg(E.left+2,E.bottom+2):Kg(window.innerWidth/2,window.innerHeight*.1),Kd&&window.clearTimeout(Kd),Kd=window.setTimeout(Ud,1500)}function m(){f()}function g(){c||(c=(d.addEventListener("keydown",m,{capture:!0}),d.addEventListener("paste",m,{capture:!0}),!0))}function w(){c&&(c=(d.removeEventListener("keydown",m,{capture:!0}),d.removeEventListener("paste",m,{capture:!0}),!1))}let _=e.sub(Ll,()=>{e.get(Ll).state===ii.CONNECTING?g():(w(),Ud())});return Bm(n())&&g(),{destroy(){w(),_(),Ud()}}});return[Ug.of(_u.readOnly.of(i)),_u.transactionExtender.of(s=>{for(let c of s.effects)if(c.is(Wg)){let d=c.value;if(d!==i)return i=d,{effects:Ug.reconfigure(_u.readOnly.of(d))}}return null}),sa.define(s=>{let c=e.sub(Ll,()=>{let d=!ed(e.get(Ll).state);s.dispatch({effects:Wg.of(d)})});return{destroy(){c()}}}),a]};function qC(e){return e.facet(_u.readOnly)}function zC(e){return[T2(e),aa.of([{key:"ArrowRight",preventDefault:!0,run:n=>Qg(n,e)},{key:"Tab",preventDefault:!0,run:n=>Qg(n,e)}])]}function Qg(e,n){if(qC(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 FC(e){let{beforeText:n,linkText:i,afterText:a,onClick:s}=e;return[T2(c=>{let d=document.createElement("span");d.append(document.createTextNode(n));let f=document.createElement("span");return f.textContent=i,f.classList.add("cm-clickable-placeholder"),f.onclick=m=>{m.stopPropagation(),s(c)},d.append(f),d.append(document.createTextNode(a)),d}),en.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 BC=ri(e=>{let n,i={transport:$d("pylsp",async()=>{await(n==null?void 0:n())}),rootUri:Hd(),workspaceFolders:[]},a=e==null?void 0:e.pylsp,s=["D100","D103"],c=["W292","E402"],d=["B018","I001"],f={pylsp:{plugins:{marimo_plugin:{enabled:!0},jedi:{auto_import_modules:["numpy"]},jedi_completion:{include_params:!0,resolve_at_most:50},flake8:{enabled: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}}}},m=new Vd(new Fl({...i}),f);return n=()=>m.resyncAllDocuments(),m}),HC=ri(e=>{let n,i=new Vd(new Fl({transport:$d("ty",async()=>{await(n==null?void 0:n())}),rootUri:Hd(),workspaceFolders:[],getWorkspaceConfiguration:a=>[{disableLanguageServices:!0}]}),{});return n=()=>i.resyncAllDocuments(),i}),VC=ri(e=>{let n,i=new Vd(new Fl({transport:$d("basedpyright",async()=>{await(n==null?void 0:n())}),rootUri:Hd(),workspaceFolders:[]}),{});return n=()=>i.resyncAllDocuments(),i}),$C=class{constructor(){Ce(this,"parser",new Rx);Ce(this,"type","python");Ce(this,"defaultCode",this.parser.defaultCode);Ce(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 m,g,w,_;let c={defaultKeymap:!1,activateOnTyping:n.activate_on_typing,closeOnBlur:!1},d={hideOnChange:!0},f=[];if((m=s==null?void 0:s.pylsp)!=null&&m.enabled&&Wl("pylsp")&&f.push(BC(s)),(g=s==null?void 0:s.ty)!=null&&g.enabled&&Wl("ty")&&f.push(HC(s)),(w=s==null?void 0:s.basedpyright)!=null&&w.enabled&&Wl("basedpyright")&&f.push(VC(s)),f.length>0){let C=f.length===1?f[0]:new kC(f);return[Vm({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&&Pi().openFile({path:E.uri.replace("file://","")})}}),qg.of(Xn.of(e))]}return ku({...c,override:[P0]})})(),Qm(),WC(a)]}};function WC(e){return e==="marimo-import"?xu.highest(zC("import marimo as mo")):e==="ai"?FC({beforeText:"Start coding or ",linkText:"generate",afterText:" with AI.",onClick:n=>{n.state.facet(Dt).aiCellCompletion()}}):[]}var Qd=lm.configure({props:[cR.add({ParenthesizedExpression:w2,ArgList:w2})]});Qm=function(){return new E2(Qd,[Qd.data.of({autocomplete:VR}),Qd.data.of({autocomplete:$R})])};const UC=e=>{let n;return async()=>(n||(n=e()),await n)};var tc=class{constructor(e={}){Ce(this,"opts");Ce(this,"parser",null);Ce(this,"offsetRecord",{});Ce(this,"getParser",UC(async()=>{if(this.parser)return this.parser;let e=await ue(()=>import("./node-sql-parser-B60nzzE3.js").then(async i=>(await i.__tla,i)).then(F3(1)),__vite__mapDeps([213,1]),import.meta.url),{Parser:n}=e.default||e;return this.parser=new n,this.parser}));this.opts=e}async parse(e,n){var s,c;this.offsetRecord={};let i=(c=(s=this.opts).getParserOptions)==null?void 0:c.call(s,n.state),a=await this.sanitizeSql(e,i);try{let d=await this.getParser();return(i==null?void 0:i.database)==="DuckDB"?this.parseWithDuckDBSupport(a,i):{success:!0,errors:[],ast:d.astify(a,i)}}catch(d){return{success:!1,errors:[this.extractErrorInfo(d,a)]}}}async sanitizeSql(e,n){if(n!=null&&n.ignoreBrackets){let{sql:i,offsetRecord:a}=GC(e);return this.offsetRecord=a,i}return e}async parseWithDuckDBSupport(e,n){let i=await this.getParser(),a=KC(e).trimStart().toLowerCase();if(a.startsWith("from")||a.includes("macro"))return{success:!0,errors:[]};let s=e;a.includes("create or replace table")&&(this.offsetRecord[e.indexOf("create or replace table")]=-11,s=e.replace(/create or replace table/i,"create table"));try{let c={...n,database:"PostgreSQL"};return{success:!0,errors:[],ast:i.astify(s,c)}}catch(c){return{success:!1,errors:[this.extractErrorInfo(c,e)]}}}extractErrorInfo(e,n){var d,f,m;let i=1,a=1,s=(e==null?void 0:e.message)||"SQL parsing error",c=e;if(c!=null&&c.location)i=((d=c.location.start)==null?void 0:d.line)||1,a=((f=c.location.start)==null?void 0:f.column)||1;else if(c!=null&&c.hash)i=c.hash.line||1,a=((m=c.hash.loc)==null?void 0:m.first_column)||1;else{let g=s.match(/line (\d+)/i),w=s.match(/column (\d+)/i);g!=null&&g[1]&&(i=parseInt(g[1],10)),w!=null&&w[1]&&(a=parseInt(w[1],10))}for(let[g,w]of Object.entries(this.offsetRecord))a>parseInt(g,10)&&(a-=w);return a>n.length&&(a=n.length),{message:this.cleanErrorMessage(s),line:Math.max(1,i),column:a,severity:"error"}}cleanErrorMessage(e){return e.replace(/^Error: /,"").replace(/Expected .* but .* found\./i,n=>n.replace(/but .* found/,"found unexpected token")).trim()}async validateSql(e,n){return(await this.parse(e,n)).errors}async extractTableReferences(e){try{return(await this.getParser()).tableList(e).map(n=>{let i=n.split("::");return i[i.length-1]||n})}catch{return[]}}async extractColumnReferences(e){try{return(await this.getParser()).columnList(e).map(n=>{let i=n.split("::");return i[i.length-1]||n})}catch{return[]}}};function KC(e,n=["/*","--"]){let i=[];if(n.includes("/*")&&i.push("/\\*[\\s\\S]*?\\*/"),n.includes("--")&&i.push("--[^\\n]*"),i.length===0)return e;let a=RegExp(`^\\s*(${i.join("|")})\\s*`,""),s=e,c="";for(;s!==c;)c=s,s=s.replace(a,"");return s}var QC=2;function GC(e){let n={};return{sql:e.replace(/("(?:[^"\\]|\\.)*")|('(?:[^'\\]|\\.)*')|(\{[^}]*\})/g,(i,a,s,c,d)=>a||s?i:c?(n[d]=QC,`'${c}'`):i),offsetRecord:n}}var JC=750;function XC(e,n){let i=n.line(e.line).from+Math.max(0,e.column-1);return{from:i,to:i+1,severity:e.severity,message:e.message,source:"sql-parser"}}function YC(e={}){let n=e.parser||new tc;return TR(async i=>{let a=i.state.doc,s=a.toString();return s.trim()?(await n.validateSql(s,{state:i.state})).map(c=>XC(c,a)):[]},{delay:e.delay||JC})}function To(e){return typeof e=="object"&&!Array.isArray(e)&&!("self"in e)}function si(e){return typeof e=="object"&&!Array.isArray(e)&&"self"in e&&"children"in e}function Lr(e){return Array.isArray(e)}function Mn(e,n,i,a){let s=e.length;if(n==="string"||n==="completion"&&a&&Lr(a))return"column";if(n==="namespace"&&i){if(Lr(i))return"table";if(To(i))return Object.values(i).some(c=>Lr(c)||si(c)&&Lr(c.children))?s<=1?"database":"schema":s===0?"database":"namespace"}if(n==="completion"&&i)return Lr(i)?"table":(To(i)&&Object.values(i).some(c=>Lr(c)||si(c)&&Lr(c.children)),s<=1?"database":"schema");switch(s){case 0:return"database";case 1:return"schema";default:return"namespace"}}function Gg(e,n,i={}){let{maxDepth:a=10}=i;if(n===""&&si(e)){let c=Mn([],"completion",e.children);return{completion:e.self,path:[],type:"completion",semanticType:c,namespace:e.children}}let s=n.split(".").filter(c=>c.length>0);return s.length===0||s.length>a?null:Gd(e,s,[],i)}function Gd(e,n,i,a,s){if(n.length===0){if(si(e)){let m=Mn(i,"completion",e.children,s);return{completion:e.self,path:i,type:"completion",semanticType:m,namespace:e.children}}return{path:i,type:"namespace",semanticType:Mn(i,"namespace",e,s),namespace:e}}let[c,...d]=n,{caseSensitive:f=!1}=a;if(!c)return null;if(To(e)){let m=f?Object.keys(e).find(g=>g===c):Object.keys(e).find(g=>g.toLowerCase()===c.toLowerCase());if(m){let g=e[m];if(g)return Gd(g,d,[...i,m],a,e)}}else{if(si(e))return Gd(e.children,n,i,a,e);if(Lr(e)){for(let m of e)if(typeof m=="string"){if((f?m===c:m.toLowerCase()===c.toLowerCase())&&d.length===0){let g=Mn([...i,m],"string",void 0,e);return{value:m,path:[...i,m],type:"string",semanticType:g}}}else if((f?m.label===c:m.label.toLowerCase()===c.toLowerCase())&&d.length===0){let g=Mn([...i,m.label],"completion",void 0,e);return{completion:m,path:[...i,m.label],type:"completion",semanticType:g}}}}return null}function ZC(e,n,i={}){let a=[];if(n.includes(".")){let s=n.lastIndexOf("."),c=n.substring(0,s),d=n.substring(s+1),f=Gg(e,c,i);if(f!=null&&f.namespace)return Jd(f.namespace,d,f.path,i)}else return Jd(e,n,[],i);return a}function Jd(e,n,i,a){let s=[],{caseSensitive:c=!1,allowPartialMatch:d=!0}=a;if(To(e)){for(let[f,m]of Object.entries(e))if(d?c?f.startsWith(n):f.toLowerCase().startsWith(n.toLowerCase()):c?f===n:f.toLowerCase()===n.toLowerCase())if(si(m)){let g=Mn([...i,f],"completion",m.children,e);s.push({completion:m.self,path:[...i,f],type:"completion",semanticType:g,namespace:m.children})}else{let g=Mn([...i,f],"namespace",m,e);s.push({path:[...i,f],type:"namespace",semanticType:g,namespace:m})}}else if(si(e)){if(d?c?e.self.label.startsWith(n):e.self.label.toLowerCase().startsWith(n.toLowerCase()):c?e.self.label===n:e.self.label.toLowerCase()===n.toLowerCase()){let f=Mn([...i,e.self.label],"completion",e.children);s.push({completion:e.self,path:[...i,e.self.label],type:"completion",semanticType:f,namespace:e.children})}s.push(...Jd(e.children,n,i,a))}else if(Lr(e)){for(let f of e)if(typeof f=="string"){if(d?c?f.startsWith(n):f.toLowerCase().startsWith(n.toLowerCase()):c?f===n:f.toLowerCase()===n.toLowerCase()){let m=Mn([...i,f],"string",void 0,e);s.push({value:f,path:[...i,f],type:"string",semanticType:m})}}else if(d?c?f.label.startsWith(n):f.label.toLowerCase().startsWith(n.toLowerCase()):c?f.label===n:f.label.toLowerCase()===n.toLowerCase()){let m=Mn([...i,f.label],"completion",void 0,e);s.push({completion:f,path:[...i,f.label],type:"completion",semanticType:m})}}return s}function eS(e,n,i={}){let a=[],{maxDepth:s=10}=i;nc(e,[],a,s);let{caseSensitive:c=!1}=i;return a.filter(d=>d.path.some(f=>c?f===n:f.toLowerCase()===n.toLowerCase())).sort((d,f)=>{var w,_;let m=c?d.path[d.path.length-1]===n:((w=d.path[d.path.length-1])==null?void 0:w.toLowerCase())===n.toLowerCase(),g=c?f.path[f.path.length-1]===n:((_=f.path[f.path.length-1])==null?void 0:_.toLowerCase())===n.toLowerCase();return m&&!g?-1:!m&&g?1:d.path.length-f.path.length})}function nc(e,n,i,a){if(!(n.length>=a)){if(To(e))for(let[s,c]of Object.entries(e)){let d=[...n,s];if(si(c)){let f=Mn(d,"completion",c.children,e);i.push({completion:c.self,path:d,type:"completion",semanticType:f,namespace:c.children}),nc(c.children,d,i,a)}else{let f=Mn(d,"namespace",c,e);i.push({path:d,type:"namespace",semanticType:f,namespace:c}),nc(c,d,i,a)}}else if(si(e)){let s=Mn(n,"completion",e.children);i.push({completion:e.self,path:n,type:"completion",semanticType:s,namespace:e.children}),nc(e.children,n,i,a)}else if(Lr(e))for(let s of e)if(typeof s=="string"){let c=Mn([...n,s],"string",void 0,e);i.push({value:s,path:[...n,s],type:"string",semanticType:c})}else{let c=Mn([...n,s.label],"completion",void 0,e);i.push({completion:s,path:[...n,s.label],type:"completion",semanticType:c})}}}function Jg(e,n,i={}){let{enableFuzzySearch:a=!1}=i,s=Gg(e,n,i);if(s)return s;let c=ZC(e,n,i);if(c.length>0)return c[0]||null;if(a){let d=eS(e,n,i);if(d.length>0)return d[0]||null}return null}function Xg(e,n){if(n.size===0)return{};if(To(e)){let i={};for(let[a,s]of Object.entries(e))if(Array.from(n).some(c=>c.toLowerCase()===a.toLowerCase()))i[a]=s;else if(To(s)){let c=Xg(s,n);Object.keys(c).length>0&&(i[a]=c)}return i}return e}function tS(e={}){let{schema:n={},keywords:i={},hoverTime:a=300,enableKeywords:s=!0,enableTables:c=!0,enableColumns:d=!0,enableFuzzySearch:f=!0,parser:m=new tc,tooltipRender:g,tooltipRenderers:w={}}=e,_=null;return om(async(C,E,T)=>{let{from:A,to:H,text:V}=C.state.doc.lineAt(E),W=E,M=E;_===null&&(_=typeof i=="function"?i(C):Promise.resolve(i));let Q=await _;for(;W>A&&/[\w.]/.test(V[W-A-1]??"");)W--;for(;M<H&&/[\w.]/.test(V[M-A]??"");)M++;if(W===E&&T<0||M===E&&T>0)return null;let pe=V.slice(W-A,M-A).toLowerCase();if(!pe||pe.length===0)return null;let P=typeof n=="function"?n(C):n,I=null;if(`${pe}`,!I&&s&&Q[pe]&&(Q[pe],I={word:pe,view:C,pos:E,tooltipType:"keyword",keywordData:{keyword:pe,info:Q[pe]}}),!I&&(c||d)&&P){let $=C.state.doc.toString(),de=await m.extractTableReferences($),fe=new Set(de.map(we=>we.toLowerCase())),be=Xg(P,fe),Y=Jg(be,pe,{enableFuzzySearch:f});!Y&&fe.size===0&&(Y=Jg(P,pe,{enableFuzzySearch:f})),Y&&(Array.from(fe),I={word:pe,view:C,pos:E,tooltipType:"namespace",namespaceData:{item:Y,word:pe,resolvedSchema:fe.size>0?be:P}})}return I?{pos:W,end:M,above:!0,create($){if(g){let be=g(pe,$,E);if(be)return{dom:be}}let de=null;if(I.tooltipType==="keyword"&&I.keywordData)de=w.keyword?w.keyword(I.keywordData):Zg(I.keywordData);else if(I.tooltipType==="namespace"&&I.namespaceData){let be=I.namespaceData,{semanticType:Y}=be.item;de=Y==="table"&&w.table?w.table(be):Y==="column"&&w.column?w.column(be):(Y==="database"||Y==="schema"||Y==="namespace")&&w.namespace?w.namespace(be):Yg(be.item)}if(!de)return{dom:document.createElement("div")};let fe=document.createElement("div");return fe.className="cm-sql-hover-tooltip",fe.innerHTML=de,{dom:fe}}}:null},{hoverTime:a})}function Yg(e){var s,c,d,f,m,g,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 _=rc(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 _=rc(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${(f=e.completion)!=null&&f.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&&Lr(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${(m=e.completion)!=null&&m.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${(g=e.completion)!=null&&g.detail?`: ${e.completion.detail}`:""}</div>`,n&&(a+=`<div class="sql-hover-path"><strong>Path:</strong> <code>${n}</code></div>`),e.namespace){let _=rc(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 rc(e){return Array.isArray(e)?e.length:typeof e=="object"&&e?"self"in e&&"children"in e?1+rc(e.children):Object.keys(e).length:0}function Zg(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 nS(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 rS(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 f=d.filter(m=>m!==i);if(f.length>0){c+=`<div class="sql-hover-related"><strong>Other columns in ${n}:</strong><br>`;let m=f.slice(0,8);c+=m.map(g=>`<code>${g}</code>`).join(", "),f.length>8&&(c+=`, <em>and ${f.length-8} more...</em>`),c+="</div>"}}if(s&&typeof s=="object"&&Object.keys(s).length>0){c+='<div class="sql-hover-metadata">';for(let[f,m]of Object.entries(s))c+=`<span class="sql-hover-tag" title="${f}">${m}</span> `;c+="</div>"}return c+="</div>",c}const iS={keyword:Zg,table:nS,column:rS,namespace:Yg},ey=(e="light")=>{let n=e==="dark"?{tooltipBg:"#1f2937",tooltipBorder:"#374151",tooltipText:"#f9fafb",tooltipTypeBg:"#374151",tooltipTypeText:"#9ca3af",tooltipChildren:"#9ca3af",codeBg:"#374151",codeText:"#f3f4f6",strong:"#ffffff",em:"#9ca3af",header:"#ffffff",info:"#d1d5db",related:"#d1d5db",path:"#d1d5db",example:"#d1d5db",columns:"#d1d5db",syntax:"#d1d5db"}:{tooltipBg:"#ffffff",tooltipBorder:"#e5e7eb",tooltipText:"#374151",tooltipTypeBg:"#f3f4f6",tooltipTypeText:"#6b7280",tooltipChildren:"#6b7280",codeBg:"#f9fafb",codeText:"#1f2937",strong:"#111827",em:"#6b7280",header:"#111827",info:"#374151",related:"#374151",path:"#374151",example:"#374151",columns:"#374151",syntax:"#374151"};return en.theme({".cm-sql-hover-tooltip":{padding:"8px 12px",backgroundColor:n.tooltipBg,border:`1px solid ${n.tooltipBorder}`,borderRadius:"6px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",fontSize:"13px",lineHeight:"1.4",maxWidth:"320px",fontFamily:"system-ui, -apple-system, sans-serif",color:n.tooltipText},".cm-sql-hover-tooltip .sql-hover-header":{marginBottom:"6px",display:"flex",alignItems:"center",gap:"6px",color:n.header},".cm-sql-hover-tooltip .sql-hover-type":{fontSize:"11px",padding:"2px 6px",backgroundColor:n.tooltipTypeBg,color:n.tooltipTypeText,borderRadius:"4px",fontWeight:"500"},".cm-sql-hover-tooltip .sql-hover-description":{color:n.info,marginBottom:"8px"},".cm-sql-hover-tooltip .sql-hover-syntax":{marginBottom:"8px",color:n.syntax},".cm-sql-hover-tooltip .sql-hover-example":{marginBottom:"4px",color:n.example},".cm-sql-hover-tooltip .sql-hover-columns":{marginBottom:"4px",color:n.columns},".cm-sql-hover-tooltip .sql-hover-related":{marginBottom:"4px",color:n.related},".cm-sql-hover-tooltip .sql-hover-path":{marginBottom:"4px",color:n.path},".cm-sql-hover-tooltip .sql-hover-info":{marginBottom:"4px",color:n.info},".cm-sql-hover-tooltip .sql-hover-children":{marginBottom:"4px",color:n.tooltipChildren,fontSize:"12px"},".cm-sql-hover-tooltip code":{backgroundColor:n.codeBg,padding:"1px 4px",borderRadius:"3px",fontSize:"12px",fontFamily:"ui-monospace, 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace",color:n.codeText},".cm-sql-hover-tooltip strong":{fontWeight:"600",color:n.strong},".cm-sql-hover-tooltip em":{fontStyle:"italic",color:n.em}})};var oS=class{constructor(e){Ce(this,"parser");Ce(this,"cache",new Map);Ce(this,"MAX_CACHE_SIZE",10);this.parser=e}async analyzeDocument(e){let n=e.doc.toString(),i=this.generateCacheKey(n),a=this.cache.get(i);if(a)return a;let s=await this.extractStatements(n,e);if(this.cache.set(i,s),this.cache.size>this.MAX_CACHE_SIZE){let c=this.cache.keys().next().value;c!==void 0&&this.cache.delete(c)}return s}async getStatementAtPosition(e,n){return(await this.analyzeDocument(e)).find(i=>n>=i.from&&n<=i.to)||null}async getStatementsInRange(e,n,i){return(await this.analyzeDocument(e)).filter(a=>a.from<=i&&a.to>=n)}async extractStatements(e,n){let i=[],a=this.splitByStatementSeparators(e),s=0;for(let c of a){let d=c.trim();if(d.length===0){s+=c.length;continue}let f=s+c.indexOf(d),m=f+d.length,g=n.doc.lineAt(f),w=n.doc.lineAt(m),_=this.stripComments(d);if(_.trim().length===0||_.trim()===";"){s+=c.length;continue}let C=await this.parser.parse(_,{state:n}),E=this.determineStatementType(_),T=_.endsWith(";")?_.slice(0,-1).trim():_.trim();i.push({from:f,to:m,lineFrom:g.number,lineTo:w.number,content:T,type:E,isValid:C.success}),s+=c.length}return i}splitByStatementSeparators(e){let n=[],i="",a=!1,s="",c=!1,d=!1,f=0;for(;f<e.length;){let m=e[f],g=e[f+1];if(!a&&!d&&m==="-"&&g==="-"){c=!0,i+=m+g,f+=2;continue}if(!a&&!c&&m==="/"&&g==="*"){d=!0,i+=m+g,f+=2;continue}if(d&&m==="*"&&g==="/"){d=!1,i+=m+g,f+=2;continue}if(c&&(m===`
|
|
131
|
-
`||m==="\r")){c=!1,i+=m,f++;continue}if(c||d){i+=m,f++;continue}if(!a&&(m==="'"||m==='"'||m==="`"))a=!0,s=m,i+=m;else if(a&&m===s){if(g===s){i+=m+g,f+=2;continue}a=!1,s="",i+=m}else!a&&m===";"?(i+=m,n.push(i),i=""):i+=m;f++}return i.trim()&&n.push(i),n}determineStatementType(e){let n=e.trim().toLowerCase();return n.startsWith("select")?"select":n.startsWith("insert")?"insert":n.startsWith("update")?"update":n.startsWith("delete")?"delete":n.startsWith("create")?"create":n.startsWith("drop")?"drop":n.startsWith("alter")?"alter":n.startsWith("use")?"use":"other"}stripComments(e){let n="",i=!1,a="",s=!1,c=!1,d=0;for(;d<e.length;){let f=e[d],m=e[d+1];if(!i&&!c&&f==="-"&&m==="-"){s=!0,d+=2;continue}if(!i&&!s&&f==="/"&&m==="*"){c=!0,d+=2;continue}if(c&&f==="*"&&m==="/"){c=!1,d+=2;continue}if(s&&(f===`
|
|
132
|
-
`||f==="\r")){s=!1,n+=f,d++;continue}if(s||c){d++;continue}if(!i&&(f==="'"||f==='"'||f==="`"))i=!0,a=f,n+=f;else if(i&&f===a){if(m===a){n+=f+m,d+=2;continue}i=!1,a="",n+=f}else n+=f;d++}return n}generateCacheKey(e){let n=0;for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);n=(n<<5)-n+a,n&=n}return n.toString()}clearCache(){this.cache.clear()}},ty=ho.define(),ny=Rl.define({create(){return{currentStatement:null,allStatements:[],cursorPosition:0,isFocused:!0}},update(e,n){for(let i of n.effects)if(i.is(ty))return i.value;return e}}),aS=class extends gR{constructor(n,i,a=!0,s=!0){super();Ce(this,"config");Ce(this,"isCurrent");Ce(this,"isValid");Ce(this,"isFocused");this.config=n,this.isCurrent=i,this.isValid=a,this.isFocused=s}toDOM(){let n=document.createElement("div");n.className="cm-sql-gutter-marker";let i=this.config.backgroundColor||"#3b82f6";!this.isValid&&this.config.showInvalid!==!1&&(i=this.config.errorBackgroundColor||"#ef4444");let a;return a=this.isFocused?this.isCurrent?"1":(this.config.inactiveOpacity||"0.3").toString():this.config.unfocusedOpacity===void 0?this.config.hideWhenNotFocused?"0":this.isCurrent?"1":(this.config.inactiveOpacity||"0.3").toString():this.config.unfocusedOpacity.toString(),n.style.cssText=`
|
|
133
|
-
background: ${i};
|
|
134
|
-
height: 100%;
|
|
135
|
-
width: 100%;
|
|
136
|
-
opacity: ${a};
|
|
137
|
-
transition: opacity 150ms ease-in-out;
|
|
138
|
-
border-radius: 1px;
|
|
139
|
-
`,n}eq(n){return this.isCurrent===n.isCurrent&&this.isValid===n.isValid&&this.isFocused===n.isFocused&&this.config===n.config}};function sS(e,n){var f;let i=dR.empty;if((f=n.whenHide)!=null&&f.call(n,e))return i;let a=e.state.field(ny,!1);if(!a)return i;let{currentStatement:s,allStatements:c,isFocused:d}=a;try{for(let m of c){let g=(s==null?void 0:s.from)===m.from&&(s==null?void 0:s.to)===m.to;if(!m.isValid&&n.showInvalid===!1)continue;let w=new aS(n,g,m.isValid,d);for(let _=m.lineFrom;_<=m.lineTo;_++)try{if(_<1||_>e.state.doc.lines)continue;let C=e.state.doc.line(_);i=i.update({add:[w.range(C.from)]})}catch(C){console.warn("SqlGutter: Invalid line number",_,C)}}}catch(m){console.warn("SqlGutter: Error creating markers",m)}return i}function lS(e){return en.updateListener.of(async n=>{if(!n.docChanged&&!n.selectionSet&&!n.focusChanged)return;let{state:i}=n.view,{main:a}=i.selection,s=a.head,c=await e.analyzeDocument(i),d={currentStatement:await e.getStatementAtPosition(i,s),allStatements:c,cursorPosition:s,isFocused:n.view.hasFocus};n.view.dispatch({effects:ty.of(d)})})}function cS(e){let n=e.width||3;return en.baseTheme({".cm-sql-gutter":{width:`${n}px`,minWidth:`${n}px`},".cm-sql-gutter .cm-gutterElement":{width:`${n}px`,padding:"0",margin:"0"},".cm-sql-gutter-marker":{width:"100%",height:"100%",display:"block"},".cm-lineNumbers .cm-gutterElement":{paddingLeft:"8px",paddingRight:"8px"}})}function uS(e){return hR({class:`cm-sql-gutter ${e.className||""}`,markers:n=>sS(n,e)})}function dS(e={}){return[ny,lS(new oS(e.parser||new tc)),cS(e),uS(e)]}function fS(e={}){let n=[],{enableLinting:i=!0,enableGutterMarkers:a=!0,enableHover:s=!0,linterConfig:c,gutterConfig:d,hoverConfig:f}=e;return i&&n.push(YC(c)),a&&n.push(dS(d)),s&&(n.push(tS(f)),f!=null&&f.theme?n.push(f.theme):n.push(ey())),n}var pS={...dm,caseInsensitiveIdentifiers:!0,identifierQuotes:"`"};const ry=fm.define(pS),iy=fm.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 mS=new Set(["postgresql","postgres","db2","mysql","sqlite","mssql","sqlserver","duckdb","mariadb","cassandra","noql","athena","bigquery","hive","redshift","snowflake","flink","mongodb","oracle","oracledb","timescaledb"]);function Xd(e){return mS.has(e)}function oy(e){let n=e.dialect;if(!Xd(n))return vs;switch(n){case"postgresql":case"postgres":return dm;case"mysql":return XR;case"sqlite":return GR;case"mssql":case"sqlserver":return ZR;case"duckdb":return iy;case"mariadb":return e4;case"cassandra":return t4;case"oracledb":case"oracle":return QR;case"bigquery":return ry;case"timescaledb":return dm;case"athena":case"db2":case"hive":case"redshift":case"snowflake":case"flink":case"mongodb":case"noql":return Pe.debug("Unsupported dialect",{dialect:n}),vs;default:return Nl(n),vs}}var hS={...YR,caseInsensitiveIdentifiers:!0,identifierQuotes:"'"};let vs;vs=fm.define(hS),Ni="__marimo_duckdb",ma=new Set([Ni]),u_="memory",Ml=function(e){return e===""};var bs={formatTableName:e=>e,formatSelectClause:(e,n)=>`SELECT ${e} FROM ${n} LIMIT 100`};function gS(e){if(e=e.toLowerCase(),!Xd(e))return bs;switch(e){case"bigquery":{let n=ry.spec.identifierQuotes;return{formatTableName:i=>`${n}${i}${n}`,formatSelectClause:bs.formatSelectClause}}case"mssql":case"sqlserver":return{formatTableName:bs.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 bs;default:return Nl(e),bs}}Bw=function({table:e,columnName:n,sqlTableContext:i}){if(i){let{engine:a,schema:s,defaultSchema:c,defaultDatabase:d,database:f,dialect:m}=i,g=e.name;Ml(s)?g=f===d?g:`${f}.${g}`:(s!==c&&(g=`${s}.${g}`),f!==d&&(g=`${f}.${g}`));let w=gS(m),_=w.formatTableName(g),C=w.formatSelectClause(n,_);return a==="__marimo_duckdb"?`_df = mo.sql(f"""
|
|
140
|
-
${C}
|
|
141
|
-
""")`:`_df = mo.sql(f"""
|
|
142
|
-
${C}
|
|
143
|
-
""", engine=${a})`}return`_df = mo.sql(f'SELECT "${n}" FROM ${e.name} LIMIT 100')`},gw=function(e,n){if(n==="date"||n==="datetime"||n==="time"){if(e==="min")return"Earliest";if(e==="max")return"Latest"}return e};function yS(){return{tables:[],expandedTables:new Set,expandedColumns:new Set,columnsPreviews:new Map}}var{reducer:S4,createActions:E4,valueAtom:ay,useActions:vS}=Pl(yS,{addDatasets:(e,n)=>{let{previewDatasetColumn:i}=Pi();for(let f of n.tables)for(let m of f.columns){let g=`${f.name}:${m.name}`;e.expandedColumns.has(g)&&i({tableName:f.name,columnName:m.name,source:f.source,sourceType:f.source_type})}let a=e.tables;n.clear_channel&&(a=a.filter(f=>f.source!==n.clear_channel));let s=[...n.tables,...a],c=new Set,d=s.filter(f=>{let m=`${f.name}:${f.source}`;return c.has(m)?!1:(c.add(m),!0)}).sort((f,m)=>f.name.localeCompare(m.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}}});Rw=()=>Kn(ay),Ou=Fe(e=>e(ay).tables),Pw=Fe(new Set),s_=Fe(!1),Lw=function(){return vS()};var bS=new Map([[Ni,{name:Ni,dialect:"duckdb",source:"duckdb",display_name:"DuckDB (In-Memory)",databases:[]}]]);function wS(){return{latestEngineSelected:Ni,connectionsMap:bS}}let _S,xS;({reducer:_S,createActions:xS,valueAtom:ua,useActions:sw}=Pl(wS,{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])=>ma.has(d)?!0:s.has(d)));return{latestEngineSelected:c.has(i)?i:Ni,connectionsMap:c}},clearDataSourceConnections:()=>({latestEngineSelected:Ni,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:Ni,connectionsMap:s}},addTableList:(e,n)=>{let{tables:i,sqlTableContext:a}=n,{connectionsMap:s,latestEngineSelected:c}=e,d=a.engine,f=s.get(d);if(!f)return e;let m=new Map(s),g={...f,databases:f.databases.map(w=>w.name===a.database?{...w,schemas:w.schemas.map(_=>_.name===a.schema?{..._,tables:i}:_)}:w)};return m.set(d,g),{latestEngineSelected:c,connectionsMap:m}},addTable:(e,n)=>{let{table:i,sqlTableContext:a}=n,{connectionsMap:s,latestEngineSelected:c}=e,d=a.engine,f=i.name,m=s.get(d);if(!m)return e;let g=new Map(s),w={...m,databases:m.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(T=>T.name===f?i:T);return{...C,tables:E}})}:_)};return g.set(d,w),{latestEngineSelected:c,connectionsMap:g}}})),ju=Fe(e=>e(ua).connectionsMap);function sy(e){let n=st.get(ua);n.connectionsMap.has(e)&&st.set(ua,{...n,latestEngineSelected:e})}nw=Fe(e=>{let n=st.get(Ou),i=e(ua).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 f of c.schemas){let m=f.name===s.default_schema,g=Ml(f.name);for(let w of f.tables){let _;if(_=w.name,g){_=d?w.name:`${c.name}.${w.name}`,a.has(_)?Pe.warn(`Table name collision for ${_}. Skipping.`):a.set(_,w);continue}if(d&&m&&!a.has(_)){a.set(_,w);continue}if(_=`${f.name}.${w.name}`,d&&!a.has(_)){a.set(_,w);continue}_=`${c.name}.${f.name}.${w.name}`,a.has(_)?Pe.warn(`Table name collision for ${_}. Skipping.`):a.set(_,w)}}}return a}),Y2=function(e){return e.variable_name?"dataframe":"table"};var kS=class R_{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??R_.jsonStringifySortKeys(),this.cache=new Zl(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)}};x_=new Cu("sql-table-preview",async(e,n)=>{await Pi().previewSQLTable({requestId:e,...n})}),V2=new Cu("sql-table-list-preview",async(e,n)=>{await Pi().previewSQLTableList({requestId:e,...n})}),jm=new kS(new Cu("validate-sql",async(e,n)=>{await Pi().validateSQL({requestId:e,...n})}),{maxSize:3});var CS=Kt(Br(),1);let Ro;Ro=Fe(new Map),yw=e=>{let n=(0,CS.c)(3),i=Kn(Ro),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 ly(e){let n=st.get(Ro),i=new Map(n);i.delete(e),st.set(Ro,i)}function SS(){st.set(Ro,new Map)}function ES({cellId:e,errorMessage:n,dialect:i}){let a=st.get(Ro),s=new Map(a),c=i==="DuckDB"?TS(n):cy(n);s.set(e,c),st.set(Ro,s)}function TS(e){let{errorType:n,errorMessage:i}=cy(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 cy(e){return{errorType:e.split(":")[0].trim(),errorMessage:e.split(":").slice(1).join(":").trim()}}let Yd,uy,Zd,ef;Om=zn("book-marked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]),Sm=zn("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"}]]),Yd=zn("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"}]]),wm=zn("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"}]]),Nm=zn("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),uy=zn("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"}]]),Pm=zn("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]),Zd=zn("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"}]]),ps=zn("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"}]]),Qu=zn("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"}]]),Tu=zn("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),fa=zn("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"}]]),Lm=zn("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"}]]),ef=zn("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"}]]),ca=zn("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"}]]),Il=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 dy(e){let[n,i]=e.split(" ");return i?`${Il(n)} ${i}`:Il(e)}id={boolean:a4,date:o4,time:Nm,datetime:Yd,temporal:Yd,number:pm,string:s4,integer:pm,unknown:Sm},xw=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 Nl(e),"bg-(--slate-4) dark:bg-(--slate-6)"}};let ws,fy,tf,py,Da,my,hy,gy,yy,vy,Oa,Wr,Do,li,nf;yo=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`}},U2=class D_{constructor(n){this.words=n}static of(...n){return new D_(n.map(i=>typeof i=="string"?new yo(i):i))}join(n,i){return this.words.map(a=>a.pluralize(i)).join(n)}},ws=Kt(Br(),1),fy=5,tf={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)]"},py={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)]"},Da="p-3 min-w-[250px] flex flex-col divide-y",my=new yo("column","columns"),hy=new yo("row","rows"),gy=new yo("schema","schemas"),yy=new yo("table","tables"),vy=new yo("database","databases"),Oa=e=>{let n=(0,ws.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},Wr=e=>{let n=(0,ws.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},Do=e=>{let n=(0,ws.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},li=e=>{let n=(0,ws.c)(15),{title:i,items:a,totalCount:s,limit:c}=e,d=i===void 0?"":i,f=c===void 0?fy:c;if(a.length===0)return null;let m;n[0]!==a||n[1]!==f?(m=a.slice(0,f),n[0]=a,n[1]=f,n[2]=m):m=n[2];let g=m,w=s>f,_;n[3]===d?_=n[4]:(_=d&&(0,B.jsxs)("h4",{className:"text-xs font-medium text-[var(--slate-11)] mb-2",children:[d,":"]}),n[3]=d,n[4]=_);let C;n[5]!==w||n[6]!==f||n[7]!==s?(C=w&&(0,B.jsxs)("div",{className:"text-xs text-[var(--slate-10)] text-center py-1",children:["... and ",s-f," more"]}),n[5]=w,n[6]=f,n[7]=s,n[8]=C):C=n[8];let E;n[9]!==C||n[10]!==g?(E=(0,B.jsxs)("div",{className:"flex flex-col gap-1 overflow-y-auto",children:[g,C]}),n[9]=C,n[10]=g,n[11]=E):E=n[11];let T;return n[12]!==_||n[13]!==E?(T=(0,B.jsxs)("div",{className:"py-2",children:[_,E]}),n[12]=_,n[13]=E,n[14]=T):T=n[14],T},nf=e=>tf[e]||tf.unknown;const RS=e=>{var d,f;let n=e.type==="view"?(0,B.jsx)(Qu,{className:"w-4 h-4 text-[var(--blue-9)]"}):(0,B.jsx)(ca,{className:"w-4 h-4 text-[var(--green-9)]"}),i=(0,B.jsx)(cr,{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(m=>{let g=id[m.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)(g,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,B.jsx)("span",{className:"font-mono",children:m.name})]}),(0,B.jsx)(cr,{variant:"outline",className:`text-xs ${nf(m.type)}`,children:m.type})]},m.name)}),s=e.primary_keys&&e.primary_keys.length>0,c=e.indexes&&e.indexes.length>0;return(0,B.jsxs)("div",{className:`${Da} min-w-[300px]`,children:[(0,B.jsx)(Oa,{icon:n,title:e.name,badge:i}),(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,B.jsx)(Wr,{label:"Source",value:(0,B.jsx)(cr,{variant:"outline",className:`text-xs ${py[e.source_type]}`,children:e.source})}),e.variable_name&&(0,B.jsx)(Wr,{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)(Wr,{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)(Do,{icon:(0,B.jsx)(Pm,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_columns} ${my.pluralize(e.num_columns)}`}),e.num_rows!=null&&(0,B.jsx)(Do,{icon:(0,B.jsx)(pm,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.num_rows} ${hy.pluralize(e.num_rows)}`})]}),e.columns.length===0&&ic("column"),(s||c)&&(0,B.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[s&&(0,B.jsxs)("div",{className:"flex flex-row gap-1",children:[(0,B.jsxs)("div",{className:"flex items-center gap-1",children:[(0,B.jsx)(UR,{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(m=>(0,B.jsx)(cr,{variant:"outline",className:"text-xs text-[var(--slate-11)]",children:m},m))]}),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)(Om,{className:"w-3 h-3 text-[var(--purple-9)]"}),(0,B.jsx)("span",{className:"text-xs font-medium text-[var(--slate-11)]",children:"Indexes:"})]}),(f=e.indexes)==null?void 0:f.map(m=>(0,B.jsx)(cr,{variant:"outline",className:"text-xs text-[var(--slate-11)]",children:m},m))]})]}),e.columns.length>0&&(0,B.jsx)(li,{items:a,totalCount:e.columns.length})]})},DS=e=>{var s;let n=id[e.type],i=(0,B.jsx)(cr,{variant:"outline",className:`text-xs ${nf(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:Da,children:[(0,B.jsx)(Oa,{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)(Wr,{label:"Type",value:(0,B.jsx)("span",{className:"font-medium",children:e.type})}),(0,B.jsx)(Wr,{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)(li,{title:"Sample Values",items:a,totalCount:e.sample_values.length})]})},OS=e=>{let n=(0,B.jsx)(cr,{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)(fa,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,B.jsx)("span",{children:a.name})]}),(0,B.jsxs)(cr,{variant:"outline",className:"text-xs",children:[a.tables.length," ",yy.pluralize(a.tables.length)]})]},a.name));return(0,B.jsxs)("div",{className:Da,children:[(0,B.jsx)(Oa,{icon:(0,B.jsx)(ps,{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)(Wr,{label:"Dialect",value:(0,B.jsx)("span",{className:"font-medium",children:e.dialect})}),e.engine&&(0,B.jsx)(Wr,{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)(Do,{icon:(0,B.jsx)(fa,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.schemas.length} schema${e.schemas.length===1?"":"s"}`})}),e.schemas.length===0&&ic("schema"),e.schemas.length>0&&(0,B.jsx)(li,{title:"Schemas",items:i,totalCount:e.schemas.length})]})},PS=e=>{let n=(0,B.jsx)(cr,{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)(Qu,{className:"w-3 h-3 text-[var(--blue-9)]"}):(0,B.jsx)(ca,{className:"w-3 h-3 text-[var(--green-9)]"}),(0,B.jsx)("span",{children:a.name})]}),(0,B.jsx)(cr,{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:Da,children:[(0,B.jsx)(Oa,{icon:(0,B.jsx)(fa,{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)(Do,{icon:(0,B.jsx)(ca,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${e.tables.length} table${e.tables.length===1?"":"s"}`})}),e.tables.length===0&&ic("table"),e.tables.length>0&&(0,B.jsx)(li,{title:"Tables",items:i,totalCount:e.tables.length})]})};var by=(0,B.jsx)(cr,{variant:"outline",children:"default"}),LS=8,wy=3;let ic;g_=(e,n)=>{let i=e.databases.length,a=e.databases.reduce((m,g)=>m+g.schemas.length,0),s=(m,g)=>{if(m.tables.length===0)return null;let w=m.name===e.default_schema&&g,_=[];return a<LS&&(_=m.tables.slice(0,wy+1).map(C=>(0,B.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[(0,B.jsx)(ca,{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)(fa,{className:"w-3 h-3 text-[var(--slate-9)]"}),(0,B.jsx)("span",{children:m.name}),w&&by,(0,B.jsxs)(cr,{variant:"outline",className:"text-xs ml-auto",children:[m.tables.length," tables"]})]}),(0,B.jsx)(li,{items:_,totalCount:m.tables.length,limit:wy})]},m.name)},c=e.databases.map(m=>{let g=m.name===e.default_database||e.databases.length===1,w=m.schemas.map(_=>s(_,g));return(0,B.jsxs)("div",{children:[(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(ps,{className:"w-3 h-3 text-[var(--blue-9)]"}),(0,B.jsx)("span",{className:"text-xs",children:m.name}),g&&by]}),w&&(0,B.jsx)(li,{items:w,totalCount:m.schemas.length})]},m.name)}),d=e.name;ma.has(e.name)&&(d="In-Memory");let f=n==null?void 0:n.map(m=>(0,B.jsxs)("div",{className:"flex items-center gap-2",children:[(0,B.jsx)(ca,{className:"w-3 h-3 text-[var(--blue-9)]"}),(0,B.jsx)("span",{className:"text-xs",children:m.name})]},m.name));return(0,B.jsxs)("div",{className:`${Da} px-1`,children:[(0,B.jsx)(Oa,{icon:(0,B.jsx)(uy,{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)(Wr,{label:"Dialect",value:(0,B.jsx)("span",{className:"font-medium",children:Il(e.dialect)})}),(0,B.jsx)(Wr,{label:"Source",value:(0,B.jsx)(cr,{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)(Do,{icon:(0,B.jsx)(ps,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${i} ${vy.pluralize(i)}`}),(0,B.jsx)(Do,{icon:(0,B.jsx)(fa,{className:"w-3 h-3 text-[var(--slate-9)]"}),text:`${a} ${gy.pluralize(a)}`})]}),i>0&&(0,B.jsx)(li,{items:c,totalCount:i}),f&&f.length>0&&(0,B.jsx)(li,{title:"Dataframes",items:f,totalCount:f.length})]})},ic=e=>(0,B.jsxs)("div",{className:"flex items-start gap-2 mt-3",children:[(0,B.jsx)(Tu,{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.",`
|
|
144
|
-
`,(0,B.jsx)("span",{className:"text-[var(--blue-10)]",children:"Introspect to see more details."})]})]});var oc=Kt(Xu(),1),_y=class{constructor(){Ce(this,"schema",{})}addTable(e,n){let i={self:MS({table:n}),children:n.columns.map(a=>NS({column:a}))};return this.setAt([...e,n.name],i),this}addSchema(e,n){let i={self:AS({namespace:n,path:e}),children:{}};return this.setAt(e,i),this}addDatabase(e,n){let i={self:IS({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 NS(e){return{label:e.column.name,type:"column",info:()=>{let n=document.createElement("div");return(0,oc.createRoot)(n).render(DS(e.column)),{dom:n}}}}function MS(e){return{label:e.table.name,type:"table",info:()=>{let n=document.createElement("div");return(0,oc.createRoot)(n).render(RS(e.table)),{dom:n}}}}function AS(e){return{label:e.namespace.name,detail:e.path.join("."),type:"schema",info:()=>{let n=document.createElement("div");return(0,oc.createRoot)(n).render(PS(e.namespace)),{dom:n}}}}function IS(e){return{label:e.namespace.name,detail:e.path.join("."),type:"database",info:()=>{let n=document.createElement("div");return(0,oc.createRoot)(n).render(OS(e.namespace)),{dom:n}}}}var jS=Fe(e=>{let n=e(Ou),i=new _y;for(let a of n)i.addTable([],a);return i.build()}),qS=class{constructor(){this.cache=new Zl(10,{create:e=>this.getConnectionSchema(e)})}getConnection(e){return st.get(ju).get(e)}getConnectionSchema(e){var d;let{default_database:n,databases:i,default_schema:a}=e,s=new _y,c=i.find(f=>f.name===n||i.length===1);if(((d=c??i[0])==null?void 0:d.schemas.some(f=>Ml(f.name)))??!1){for(let f of i){let m=f.name===(c==null?void 0:c.name),g=f.schemas.flatMap(w=>w.tables);s.addDatabase([f.name],f);for(let w of g)m?s.addTable([],w):s.addTable([f.name],w)}return{shouldAddLocalTables:!1,schema:s.build(),defaultSchema:c==null?void 0:c.name}}if(c)for(let f of c.schemas){s.addSchema([f.name],f);for(let m of f.tables)s.addTable([f.name],m)}for(let f of i){s.addDatabase([f.name],f);for(let m of f.schemas){s.addSchema([f.name,m.name],m);for(let g of m.tables)s.addTable([f.name,m.name],g)}}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?oy(n):vs}getCompletionSource(e){let n=this.getConnection(e);if(!n)return null;let i=()=>st.get(jS),a=this.cache.getOrCreate(n);return{dialect:oy(n),schema:a.shouldAddLocalTables?{...a.schema,...i()}:a.schema,defaultSchema:a.defaultSchema,defaultTable:zS(n)}}};function zS(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 Pa=new qS;function xy(e){return e.field(oi)}function FS(){return e=>{let n=xy(e.state).engine,i=Pa.getCompletionSource(n);return i&&JR(i)(e)||null}}function BS(){return e=>{let n=xy(e.state).engine,i=Pa.getDialect(n);return e.matchBefore(/\.\w*/)?null:n4(i,!0,(a,s)=>({label:a,type:s,info:async()=>{let c=(await HS())[a.toLocaleLowerCase()];if(!c)return null;let d=document.createElement("div");return d.innerHTML=iS.keyword({keyword:a,info:c}),d}}))(e)}}var HS=ri(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}});v_=function(e){let n=e.storage||fs;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)}}},Bu=yh(()=>fs);var VS=Kt(Br(),1),ky=Lu("marimo:notebook-sql-mode","default",Bu);function $S(){let e=(0,VS.c)(3),[n,i]=d2(ky),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 Cy(){return st.get(ky)}var WS=iy,US="DuckDB",Sy=new bu;function rf(){return st.get(ua).latestEngineSelected}let Ey;nd=(df=class{constructor(){Ce(this,"parser",new n0);Ce(this,"type","sql");this.sqlModeEnabled=!0}get defaultMetadata(){return{...this.parser.defaultMetadata,engine:rf()||"__marimo_duckdb"}}get defaultCode(){let e=rf();return e&&e!=="__marimo_duckdb"?`_df = mo.sql(f"""SELECT * FROM """, engine=${e})`:this.parser.defaultCode}transformIn(e){this.parser.defaultMetadata.engine=rf()||"__marimo_duckdb";let n=this.parser.transformIn(e),i=n.metadata;return i.engine&&i.engine!=="__marimo_duckdb"&&sy(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){var d;let c=[Sy.of(j2({dialect:WS})),aa.of([{key:"Tab",run:f=>zR(f)||xR(f),preventDefault:!0}]),ku({defaultKeymap:!1,activateOnTyping:!0,override:[FS(),Gk,BS()]})];if(((d=s==null?void 0:s.diagnostics)==null?void 0:d.sql_linter)??!1){let f=st.get(i4),m=new Ey({getParserOptions:g=>({database:Ry(g)??US})});c.push(fS({enableLinting:!0,linterConfig:{delay:250,parser:m},enableGutterMarkers:!0,gutterConfig:{backgroundColor:"#3b82f6",errorBackgroundColor:"#ef4444",hideWhenNotFocused:!0,parser:m},hoverConfig:{schema:GS,hoverTime:300,enableKeywords:!0,enableTables:!0,enableColumns:!0,parser:m,theme:ey(f)}}),en.updateListener.of(g=>{g.focusChanged&&m.setFocusState(g.view.hasFocus)}))}return this.sqlModeEnabled&&c.push(XS()),c}},Ce(df,"fromQuery",e=>n0.fromQuery(e)),df),Ey=class extends tc{constructor(){super(...arguments);Ce(this,"validationTimeout",null);Ce(this,"VALIDATION_DELAY_MS",300);Ce(this,"isFocused",!1)}setFocusState(n){this.isFocused=n}async validateWithDelay(n,i,a){return this.validationTimeout&&window.clearTimeout(this.validationTimeout),new Promise(s=>{this.validationTimeout=window.setTimeout(async()=>{var c;if(!this.isFocused){s([]);return}try{let d=await Oy(n,i,a,Cy());if(d.error){Pe.error("Failed to validate SQL",{error:d.error}),s([]);return}s(((c=d.parse_result)==null?void 0:c.errors)??[])}catch(d){Pe.error("Failed to validate SQL",{error:d}),s([])}},this.VALIDATION_DELAY_MS)})}async validateSql(n,i){let a=La(i.state);if(!this.isFocused)return[];if(!ma.has(a.engine))return super.validateSql(n,i);let s=Ry(i.state);return this.validateWithDelay(n,a.engine,s)}async parse(n,i){return La(i.state).engine==="__marimo_duckdb"?{success:!0,errors:[]}:super.parse(n,i)}};function Ty(e,n){e.dispatch({effects:Sy.reconfigure(j2({dialect:n}))})}function KS(e,n){Ty(e,Pa.getDialect(n))}function QS(e){let n=La(e.state).engine;Ty(e,Pa.getDialect(n))}function La(e){return e.field(oi)}function GS(e){let n=La(e.state).engine,i=Pa.getCompletionSource(n);return i!=null&&i.schema?i.schema:{}}function Ry(e){let n=La(e).engine;return Dy(n)}function Dy(e){var i;let n=(i=Pa.getInternalDialect(e))==null?void 0:i.toLowerCase();if(!n||!Xd(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 Nl(n),null}}var JS=300;function XS(){let e,n=null;return en.updateListener.of(i=>{if(!i.docChanged)return;let a=Cy();if(a==="default")return;let s=La(i.state).engine;if(!ma.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(da);if(c===""){ly(d);return}try{let f=Dy(s),m=(await Oy(c,s,f,a)).validate_result;m!=null&&m.error_message?ES({cellId:d,errorMessage:m.error_message,dialect:f}):ly(d)}catch(f){Pe.error("Failed to validate SQL",{error:f})}},JS)})}async function Oy(e,n,i,a){let s=await jm.request({onlyParse:a==="default",engine:n,dialect:i,query:e});if(s.error)throw Error(s.error);return s}var YS=ri(()=>new $C),ZS=ri(()=>new $u),eE=ri(()=>new nd);dr={get python(){return YS()},get markdown(){return ZS()},get sql(){return eE()}};function tE(){return Object.values(dr)}var At=Kt(yu(),1),ac="Checkbox",[nE,T4]=v4(ac),[rE,of]=nE(ac);function iE(e){let{__scopeCheckbox:n,checked:i,children:a,defaultChecked:s,disabled:c,form:d,name:f,onCheckedChange:m,required:g,value:w="on",internal_do_not_use_render:_}=e,[C,E]=w4({prop:i,defaultProp:s??!1,onChange:m,caller:ac}),[T,A]=At.useState(null),[H,V]=At.useState(null),W=At.useRef(!1),M=T?!!d||!!T.closest("form"):!0,Q={checked:C,disabled:c,setChecked:E,control:T,setControl:A,name:f,form:d,value:w,hasConsumerStoppedPropagationRef:W,required:g,defaultChecked:Bi(s)?!1:s,isFormControl:M,bubbleInput:H,setBubbleInput:V};return(0,B.jsx)(rE,{scope:n,...Q,children:oE(_)?_(Q):a})}var Py="CheckboxTrigger",Ly=At.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:i,...a},s)=>{let{control:c,value:d,disabled:f,checked:m,required:g,setControl:w,setChecked:_,hasConsumerStoppedPropagationRef:C,isFormControl:E,bubbleInput:T}=of(Py,e),A=h2(s,w),H=At.useRef(m);return At.useEffect(()=>{let V=c==null?void 0:c.form;if(V){let W=()=>_(H.current);return V.addEventListener("reset",W),()=>V.removeEventListener("reset",W)}},[c,_]),(0,B.jsx)(hm.button,{type:"button",role:"checkbox","aria-checked":Bi(m)?"mixed":m,"aria-required":g,"data-state":jy(m),"data-disabled":f?"":void 0,disabled:f,value:d,...a,ref:A,onKeyDown:z2(n,V=>{V.key==="Enter"&&V.preventDefault()}),onClick:z2(i,V=>{_(W=>Bi(W)?!0:!W),T&&E&&(C.current=V.isPropagationStopped(),C.current||V.stopPropagation())})})});Ly.displayName=Py;var af=At.forwardRef((e,n)=>{let{__scopeCheckbox:i,name:a,checked:s,defaultChecked:c,required:d,disabled:f,value:m,onCheckedChange:g,form:w,..._}=e;return(0,B.jsx)(iE,{__scopeCheckbox:i,checked:s,defaultChecked:c,disabled:f,required:d,onCheckedChange:g,name:a,form:w,value:m,internal_do_not_use_render:({isFormControl:C})=>(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Ly,{..._,ref:n,__scopeCheckbox:i}),C&&(0,B.jsx)(Iy,{__scopeCheckbox:i})]})})});af.displayName=ac;var Ny="CheckboxIndicator",My=At.forwardRef((e,n)=>{let{__scopeCheckbox:i,forceMount:a,...s}=e,c=of(Ny,i);return(0,B.jsx)(b4,{present:a||Bi(c.checked)||c.checked===!0,children:(0,B.jsx)(hm.span,{"data-state":jy(c.checked),"data-disabled":c.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...e.style}})})});My.displayName=Ny;var Ay="CheckboxBubbleInput",Iy=At.forwardRef(({__scopeCheckbox:e,...n},i)=>{let{control:a,hasConsumerStoppedPropagationRef:s,checked:c,defaultChecked:d,required:f,disabled:m,name:g,value:w,form:_,bubbleInput:C,setBubbleInput:E}=of(Ay,e),T=h2(i,E),A=d4(c),H=_4(a);At.useEffect(()=>{let W=C;if(!W)return;let M=window.HTMLInputElement.prototype,Q=Object.getOwnPropertyDescriptor(M,"checked").set,pe=!s.current;if(A!==c&&Q){let P=new Event("click",{bubbles:pe});W.indeterminate=Bi(c),Q.call(W,Bi(c)?!1:c),W.dispatchEvent(P)}},[C,A,c,s]);let V=At.useRef(Bi(c)?!1:c);return(0,B.jsx)(hm.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??V.current,required:f,disabled:m,name:g,value:w,form:_,...n,tabIndex:-1,ref:T,style:{...n.style,...H,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Iy.displayName=Ay;function oE(e){return typeof e=="function"}function Bi(e){return e==="indeterminate"}function jy(e){return Bi(e)?"indeterminate":e?"checked":"unchecked"}let qy;qy=Kt(Br(),1),Bl=At.forwardRef((e,n)=>{let i=(0,qy.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=vu("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)(My,{className:vu("flex items-center justify-center text-current max-h-[14px] overflow-hidden"),children:(0,B.jsx)(l4,{className:"h-4 w-4"})}),i[5]=d):d=i[5];let f;return i[6]!==s||i[7]!==n||i[8]!==c?(f=(0,B.jsx)(af,{ref:n,className:c,...s,children:d}),i[6]=s,i[7]=n,i[8]=c,i[9]=f):f=i[9],f}),Bl.displayName=af.displayName,Fw="_";var aE=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("."));Km=function(e,n=!0){return e=e.trim(),e?(/^\d/.test(e)&&(e=`_${e}`),e=e.replaceAll(/\W/g,"_"),n?e.toLowerCase():e):"_"},o_=function(e,n){let i=new Set(n),a=e,s=d=>!i.has(d)&&!aE.has(d);if(s(e))return e;let c=1;for(;!s(a);)a=`${e}_${c}`,c++;return a},Vw=function(e,n){return Xm(e)?`cell-${n}`:e},Xm=function(e){return e?e==="_"||e==="__":!0};var sE=Kt(Br(),1);function lE(e){let n=(0,sE.c)(15),{minWidth:i,padding:a}=e,s=i===void 0?70:i,c=a===void 0?15:a,[d,f]=(0,At.useState)(50),m=(0,At.useRef)(null),g=(0,At.useRef)(null),w;n[0]===c?w=n[1]:(w=P=>{if(g.current&&m.current){let I=g.current;I.style.fontSize=window.getComputedStyle(m.current).fontSize,I.style.fontFamily=window.getComputedStyle(m.current).fontFamily,I.textContent=P;let $=I.offsetWidth;f($+c)}},n[0]=c,n[1]=w);let _=w,C;n[2]===_?C=n[3]:(C=()=>{var P;_(((P=m.current)==null?void 0:P.value)??"")},n[2]=_,n[3]=C),r4(C);let E;n[4]===_?E=n[5]:(E=P=>{_(P.target.value)},n[4]=_,n[5]=E);let T=`${d}px`,A=`${s}px`,H;n[6]!==T||n[7]!==A?(H={width:T,minWidth:A},n[6]=T,n[7]=A,n[8]=H):H=n[8];let V;n[9]!==E||n[10]!==H?(V={ref:m,type:"text",onChange:E,style:H},n[9]=E,n[10]=H,n[11]=V):V=n[11];let W=V,M;n[12]===Symbol.for("react.memo_cache_sentinel")?(M={ref:g,style:{visibility:"hidden",position:"absolute",whiteSpace:"pre"}},n[12]=M):M=n[12];let Q=M,pe;return n[13]===W?pe=n[14]:(pe={inputProps:W,spanProps:Q},n[13]=W,n[14]=pe),pe}var cE=Kt(Br(),1);function uE({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 dE=()=>{let e=(0,cE.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 fE="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",pE="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",mE="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==",hE="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",gE="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",yE=""+new URL("iceberg-COKYXo-A.png",import.meta.url).href,vE="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",bE="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",zy=""+new URL("postgresql-q8VEBKGg.svg",import.meta.url).href,wE="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",_E="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",xE="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",kE="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",CE="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",SE=""+new URL("trino-DFsJbQoT.svg",import.meta.url).href,EE=Kt(Br(),1),TE={sqlite:kE,duckdb:hE,motherduck:vE,postgres:zy,postgresql:zy,mysql:bE,snowflake:_E,databricks:pE,clickhouse:fE,timeplus:CE,bigquery:gE,trino:SE,iceberg:yE,datafusion:mE,pyspark:xE,redshift:wE};nh=e=>{let n=(0,EE.c)(11),{name:i,className:a}=e,s=TE[i.toLowerCase()];if(!s){let f;n[0]===a?f=n[1]:(f=vu("mt-0.5",a),n[0]=a,n[1]=f);let m;return n[2]===f?m=n[3]:(m=(0,B.jsx)(ps,{className:f}),n[2]=f,n[3]=m),m}let c;n[4]!==a||n[5]!==s?(c=vu("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 sf=Kt(Br(),1);const RE=e=>{let n=(0,sf.c)(27),{selectedEngine:i,onChange:a}=e,s=Kn(ju),c=[],d=[];for(let[fe,be]of s.entries())ma.has(fe)?c.push(be):d.push(be);let f=k4(),m=i&&!s.has(i),g;n[0]!==s||n[1]!==a||n[2]!==f?(g=fe=>{if(fe===Fy){window.open(By,"_blank");return}let be=s.get(fe);be&&(f(),a(be.name),sy(be.name))},n[0]=s,n[1]=a,n[2]=f,n[3]=g):g=n[3];let w=g,_=NE,C=h4,E;n[4]===Symbol.for("react.memo_cache_sentinel")?(E=(0,B.jsx)(OE,{children:(0,B.jsx)(u4,{placeholder:"Select an engine"})}),n[4]=E):E=n[4];let T=f4,A=p4,H;n[5]===Symbol.for("react.memo_cache_sentinel")?(H=(0,B.jsx)(c4,{children:"Database connections"}),n[5]=H):H=n[5];let V;n[6]!==m||n[7]!==i?(V=m&&(0,B.jsx)(mm,{value:i,children:(0,B.jsxs)("div",{className:"flex items-center gap-1 opacity-50",children:[(0,B.jsx)(wm,{className:"h-3 w-3"}),(0,B.jsx)("span",{className:"truncate",children:dy(i)})]})},i),n[6]=m,n[7]=i,n[8]=V):V=n[8];let W=_(d),M=d.length>0&&(0,B.jsx)(q2,{}),Q=_(c),pe;n[9]===Symbol.for("react.memo_cache_sentinel")?(pe=(0,B.jsx)(q2,{}),n[9]=pe):pe=n[9];let P;n[10]===Symbol.for("react.memo_cache_sentinel")?(P=(0,B.jsx)(mm,{className:"text-muted-foreground",value:Fy,children:(0,B.jsxs)("a",{className:"flex items-center gap-1",href:By,target:"_blank",rel:"noreferrer",children:[(0,B.jsx)(y4,{className:"h-3 w-3"}),(0,B.jsx)("span",{children:"How to add a database connection"})]})}),n[10]=P):P=n[10];let I;n[11]!==A||n[12]!==H||n[13]!==V||n[14]!==W||n[15]!==M||n[16]!==Q?(I=(0,B.jsxs)(A,{children:[H,V,W,M,Q,pe,P]}),n[11]=A,n[12]=H,n[13]=V,n[14]=W,n[15]=M,n[16]=Q,n[17]=I):I=n[17];let $;n[18]!==T||n[19]!==I?($=(0,B.jsx)(T,{children:I}),n[18]=T,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 Fy="__help__",By="http://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database";const DE=()=>{let e=(0,sf.c)(16),{sqlMode:n,setSQLMode:i}=$S(),a;e[0]!==i||e[1]!==n?(a=()=>{let E=n==="validate"?"default":"validate";E==="default"&&SS(),i(E)},e[0]=i,e[1]=n,e[2]=a):a=e[2];let s=a,c=ME,d=AE,f;e[3]===n?f=e[4]:(f=d(n),e[3]=n,e[4]=f);let m;e[5]===n?m=e[6]:(m=c(n),e[5]=n,e[6]=m);let g=n==="validate"?"Validate":"Default",w;e[7]===g?w=e[8]:(w=(0,B.jsx)("span",{className:"ml-1",children:g}),e[7]=g,e[8]=w);let _;e[9]!==s||e[10]!==m||e[11]!==w?(_=(0,B.jsxs)(g2,{variant:"ghost",size:"sm",onClick:s,className:"h-5 px-1.5 text-xs border-border shadow-none hover:bg-accent",children:[m,w]}),e[9]=s,e[10]=m,e[11]=w,e[12]=_):_=e[12];let C;return e[13]!==f||e[14]!==_?(C=(0,B.jsx)("div",{className:"flex flex-row gap-1 items-center",children:(0,B.jsx)(gm,{delayDuration:300,content:f,children:_})}),e[13]=f,e[14]=_,e[15]=C):C=e[15],C};var OE=e=>{let n=(0,sf.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)(m4,{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 PE(e){return e.source!=="iceberg"}function LE(e){return(0,B.jsx)(mm,{value:e.name,children:(0,B.jsxs)("div",{className:"flex items-center gap-1",children:[(0,B.jsx)(nh,{className:"h-3 w-3",name:e.dialect}),(0,B.jsx)("span",{className:"truncate ml-0.5",children:dy(e.display_name)})]})},e.name)}function NE(e){return e=e.filter(PE),e.map(LE)}function ME(e){return e==="validate"?(0,B.jsx)(ef,{className:"h-3 w-3"}):(0,B.jsx)(Zd,{className:"h-3 w-3"})}function AE(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)(ef,{className:"h-3 w-3"}),"Validate Mode"]}),(0,B.jsx)("p",{children:"Queries are validated as you write them"})]}):(0,B.jsxs)("div",{className:"text-xs",children:[(0,B.jsxs)("div",{className:"font-semibold mb-1 flex flex-row items-center gap-1",children:[(0,B.jsx)(Zd,{className:"h-3 w-3"}),"Default Mode"]}),(0,B.jsx)("p",{children:"Standard editing"})]})}var Hy=Kt(Br(),1),Vy=()=>{let e=(0,Hy.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 IE=e=>{let n=(0,Hy.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}=lE(a),d;n[1]===i.state?d=n[2]:(d=i.state.field(Tr),n[1]=i.state,n[2]=d);let f=d,m;n[3]===Symbol.for("react.memo_cache_sentinel")?(m=(0,B.jsx)("div",{}),n[3]=m):m=n[3];let g=m,w=!1,_;n[4]===i?_=n[5]:(_=A=>{i.dispatch({effects:od.of(A),changes:{from:0,to:i.state.doc.length,insert:i.state.doc.toString()}})},n[4]=i,n[5]=_);let C=_;if(f instanceof nd){let A;n[6]===i.state?A=n[7]:(A=i.state.field(oi),n[6]=i.state,n[7]=A);let H=A;w=!0;let V;n[8]===C?V=n[9]:(V=De=>{let Ne=Km(De.currentTarget.value,!1);De.currentTarget.value=Ne,C({dataframeName:Ne})},n[8]=C,n[9]=V);let W=V,M;n[10]!==C||n[11]!==i?(M=De=>{C({engine:De}),KS(i,De)},n[10]=C,n[11]=i,n[12]=M):M=n[12];let Q=M,pe;n[13]===Symbol.for("react.memo_cache_sentinel")?(pe=(0,B.jsx)("span",{className:"select-none",children:"Output variable: "}),n[13]=pe):pe=n[13];let P;n[14]===c?P=n[15]:(P=De=>{var Ne;(Ne=c.onChange)==null||Ne.call(c,De)},n[14]=c,n[15]=P);let I;n[16]===W?I=n[17]:(I=De=>{De.key==="Enter"&&De.shiftKey&&W(De)},n[16]=W,n[17]=I);let $;n[18]!==c||n[19]!==H.dataframeName||n[20]!==W||n[21]!==I||n[22]!==P?($=(0,B.jsx)("input",{...c,defaultValue:H.dataframeName,onChange:P,onBlur:W,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]=W,n[21]=I,n[22]=P,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:[pe,$,de]}),n[26]=$,n[27]=de,n[28]=fe):fe=n[28];let be;n[29]!==H.engine||n[30]!==Q?(be=(0,B.jsx)(RE,{selectedEngine:H.engine,onChange:Q}),n[29]=H.engine,n[30]=Q,n[31]=be):be=n[31];let Y;n[32]===H.engine?Y=n[33]:(Y=H.engine==="__marimo_duckdb"&&(0,B.jsx)(DE,{}),n[32]=H.engine,n[33]=Y);let we;n[34]===i?we=n[35]:(we=async()=>{await rx(i)},n[34]=i,n[35]=we);let Ee;n[36]===Symbol.for("react.memo_cache_sentinel")?(Ee=(0,B.jsx)(Lm,{className:"h-3 w-3"}),n[36]=Ee):Ee=n[36];let ie;n[37]===we?ie=n[38]:(ie=(0,B.jsx)(gm,{content:"Format SQL",children:(0,B.jsx)(g2,{variant:"text",size:"icon",onClick:we,children:Ee})}),n[37]=we,n[38]=ie);let X;n[39]===Symbol.for("react.memo_cache_sentinel")?(X=(0,B.jsx)(Vy,{}),n[39]=X):X=n[39];let G;n[40]===C?G=n[41]:(G=De=>{C({showOutput:!De.target.checked})},n[40]=C,n[41]=G);let K=!H.showOutput,Le;n[42]!==G||n[43]!==K?(Le=(0,B.jsx)("input",{type:"checkbox",onChange:G,checked:K}),n[42]=G,n[43]=K,n[44]=Le):Le=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]===Le?ut=n[47]:(ut=(0,B.jsxs)("label",{className:"flex items-center gap-2",children:[Le,Qe]}),n[46]=Le,n[47]=ut);let Be;n[48]!==Y||n[49]!==ie||n[50]!==ut?(Be=(0,B.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[Y,ie,X,ut]}),n[48]=Y,n[49]=ie,n[50]=ut,n[51]=Be):Be=n[51];let We;n[52]!==fe||n[53]!==be||n[54]!==Be?(We=(0,B.jsxs)("div",{className:"flex flex-1 gap-2 items-center",children:[fe,be,Be]}),n[52]=fe,n[53]=be,n[54]=Be,n[55]=We):We=n[55],g=We}if(f instanceof $u){w=!0;let A,H,V,W,M,Q,pe,P,I,$;if(n[56]!==C||n[57]!==i.state){let{quotePrefix:G}=i.state.field(oi);H=G,H===void 0&&(H="r",C({quotePrefix:H})),$=(K,Le)=>{typeof Le=="boolean"&&C({quotePrefix:uE({currentQuotePrefix:H,checked:Le,prefix:K})})},V="flex flex-row w-full justify-end gap-1.5 items-center",P="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=Bl,M="Toggle raw string",Q="w-3 h-3",pe=H.includes("r"),W=K=>{$("r",K)},n[56]=C,n[57]=i.state,n[58]=A,n[59]=H,n[60]=V,n[61]=W,n[62]=M,n[63]=Q,n[64]=pe,n[65]=P,n[66]=I,n[67]=$}else A=n[58],H=n[59],V=n[60],W=n[61],M=n[62],Q=n[63],pe=n[64],P=n[65],I=n[66],$=n[67];let de;n[69]!==A||n[70]!==W||n[71]!==M||n[72]!==Q||n[73]!==pe?(de=(0,B.jsx)(A,{"aria-label":M,className:Q,checked:pe,onCheckedChange:W}),n[69]=A,n[70]=W,n[71]=M,n[72]=Q,n[73]=pe,n[74]=de):de=n[74];let fe;n[75]!==de||n[76]!==P||n[77]!==I?(fe=(0,B.jsxs)("div",{className:P,children:[I,de]}),n[75]=de,n[76]=P,n[77]=I,n[78]=fe):fe=n[78];let be;n[79]===Symbol.for("react.memo_cache_sentinel")?(be=(0,B.jsx)("span",{children:"f"}),n[79]=be):be=n[79];let Y;n[80]===H?Y=n[81]:(Y=H.includes("f"),n[80]=H,n[81]=Y);let we;n[82]===$?we=n[83]:(we=G=>{$("f",G)},n[82]=$,n[83]=we);let Ee;n[84]!==Y||n[85]!==we?(Ee=(0,B.jsxs)("div",{className:"flex items-center gap-1.5",children:[be,(0,B.jsx)(Bl,{"aria-label":"Toggle f-string",className:"w-3 h-3",checked:Y,onCheckedChange:we})]}),n[84]=Y,n[85]=we,n[86]=Ee):Ee=n[86];let ie;n[87]===Symbol.for("react.memo_cache_sentinel")?(ie=(0,B.jsx)(gm,{content:(0,B.jsx)(dE,{}),children:(0,B.jsx)(Tu,{className:"w-3 h-3"})}),n[87]=ie):ie=n[87];let X;n[88]!==V||n[89]!==fe||n[90]!==Ee?(X=(0,B.jsxs)("div",{className:V,children:[fe,Ee,ie]}),n[88]=V,n[89]=fe,n[90]=Ee,n[91]=X):X=n[91],g=X}let E;n[92]===w?E=n[93]:(E=w&&(0,B.jsx)(Vy,{}),n[92]=w,n[93]=E);let T;return n[94]!==g||n[95]!==f.type||n[96]!==E?(T=(0,B.jsx)(x4,{children:(0,B.jsxs)("div",{className:"flex justify-between items-center gap-4 pl-2 pt-2",children:[g,E,f.type]})}),n[94]=g,n[95]=f.type,n[96]=E,n[97]=T):T=n[97],T};var lf=new bu;Hu=ho.define(),Tr=Rl.define({create(){return dr.python},update(e,n){for(let i of n.effects)if(i.is(Hu))return i.value;return e},provide:e=>im.from(e,n=>n.type==="python"?null:i=>ox(i,IE))});function jE(){let e=tE(),n=(i,a)=>{let s=e[a%e.length];return s.isSupported(i)?s:n(i,a+1)};return[aa.of([{key:"F4",preventDefault:!0,run:i=>{let a=i.state.field(Tr),s=e.findIndex(d=>d.type===a.type),c=n(i.state.doc.toString(),s+1);return a===c?!1:($y({view:i,nextLanguage:c,opts:{keepCodeAsIs:!1}}),!0)}}])]}function $y({view:e,nextLanguage:n,opts:i}){let a=e.state.field(Tr),s=e.state.doc.toString(),c=e.state.facet(Hh),d=e.state.facet(Vh),f=e.state.facet(wd),m=e.state.facet(_d),g=e.state.facet($h),w=e.state.field(oi),_=e.state.selection.main.head,C;if(i.keepCodeAsIs)C=s,a.type!==n.type&&(w={...n.defaultMetadata});else{let[E,T]=a.transformOut(s,w),[A,H,V]=n.transformIn(E);_+=T,_-=H,_=sm(_,0,A.length),C=A,w=V}e.dispatch({effects:[Hu.of(n),td.of(w),lf.reconfigure(n.getExtension(m,c,d,f,g)),Vu.reconfigure([]),va.of(!0)],changes:i.keepCodeAsIs?void 0:{from:0,to:e.state.doc.length,insert:C},selection:i.keepCodeAsIs?void 0:pn.cursor(_)}),e.dispatch({effects:[Vu.reconfigure([kR()])]}),n.type==="sql"&&QS(e)}Uw=function(e){let{placeholderType:n,completionConfig:i,hotkeys:a,cellId:s,lspConfig:c}=e;return[jE(),lf.of(dr.python.getExtension(s,i,a,n,c)),Tr,oi]},Iw=function(e){return qE(ai({state:e}).trim())};function qE(e){return e?dr.markdown.isSupported(e)?dr.markdown:dr.sql.isSupported(e)?dr.sql:dr.python:dr.python}Jm=function(e,n){e.state.field(Tr).type!==n.language&&$y({view:e,nextLanguage:dr[n.language],opts:{keepCodeAsIs:n.keepCodeAsIs??!1}})},c_=function(e,{completionConfig:n,hotkeysProvider:i,lspConfig:a}){let s=e.state.field(Tr),c=e.state.facet(wd),d=e.state.facet(_d);return lf.reconfigure(s.getExtension(d,n,i,c,a))},ai=function(e,n,i){let a=e.state.field(Tr),s=e.state.field(oi),c=e.state.doc.toString();return n===void 0?a.transformOut(c,s)[0]:a.transformOut(c.slice(n,i),s)[0]},hs=function(e,n){let[i]=e.state.field(Tr).transformIn(n);return Uu(e,i),i};function zE(e){let n=e.state.selection.main.head,i=e.state.doc.toString(),a=i.length>0&&i[n-1]===`
|
|
145
|
-
`,s=i.length>0&&i[n]===`
|
|
146
|
-
`,c=a?n-1:n,d=s?n+1:n;return{beforeCursorCode:ai(e,0,c),afterCursorCode:ai(e,d)}}var FE=["marimo-carousel","marimo-tabs","marimo-accordion"];function BE(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(FE.some(d=>a.closest(d))||!s)continue;let c=Number.parseInt(a.tagName[1],10);n.push({name:s,level:c,by:Um(a)})}return{items:n}}Um=function(e){let n=e.id;if(n)return{id:n};let i=e.textContent;return{path:`//${e.tagName}[contains(., "${i}")]`}};function HE(e){return{items:e.filter(Boolean).flatMap(n=>n.items)}}th=function(e){if(e==null||e.mimetype!=="text/html"&&e.mimetype!=="text/markdown"||e.data==null)return null;try{return fn(typeof e.data=="string","expected string"),BE(e.data)}catch{return Pe.error("Failed to parse outline"),null}},F2=function(e){return e==null?!1:e.items.some(n=>n.level<=3)};function Wy(e,n){let i=d=>d.items.length===0?7:Math.min(...d.items.map(f=>f.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]}Mu=function(e){return e==="application/vnd.marimo+error"||e==="application/vnd.marimo+traceback"};function VE(e,n){if(typeof window>"u")return;let i=`__marimo__${n}`;window[i]&&Pe.warn(`Overwriting existing debug object ${i}`),window[i]=e}var $E={markdown:!0,wasm_layouts:!1,rtc_v2:!1,performant_table_charts:!1,chat_modes:!1,cache_panel:!1,external_agents:!1};Fu=function(e){var n,i;return((i=(n=rm())==null?void 0:n.experimental)==null?void 0:i[e])??$E[e]};function WE(e,n){let i=rm();i.experimental=i.experimental??{},i.experimental[e]=n,Pi().saveUserConfig({config:i})}Ew=({feature:e,children:n})=>Fu(e)?n:null,VE(WE,"setFeatureFlag"),Dw=Lu("marimo:rtc:username","",Bu),Em=Tm(()=>Fu("rtc_v2")),Zm=class sd{static fromMilliseconds(n){return n==null?null:new sd(n)}static fromSeconds(n){return n==null?null:new sd(n*1e3)}static now(){return new sd(Date.now())}constructor(n){this.ms=n}toMilliseconds(){return this.ms}toSeconds(){return this.ms/1e3}};function UE(e,n=5e3){let i=[...e];if(i.length<2)return Ky(Uy(i),n);let a=i[i.length-1],s=i[i.length-2];return KE(a,s)&&(fn(typeof a.data=="string","expected string"),fn(typeof s.data=="string","expected string"),s.data+=a.data,i.pop()),Ky(Uy(i),n)}function KE(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 Uy(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;fn(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)===`
|
|
147
|
-
`){d=w;break}let f=s.slice(c+1),m=s.slice(0,d+1),g=s.slice(d+1,c);s=g.length<=f.length?m+f:m+f+g.slice(f.length),c=s.search(a)}return n[n.length-1]={...i,data:s},n}function Ky(e,n){let i=0,a;for(a=e.length-1;a>=0&&i<n;a--){let f=e[a];f.mimetype==="text/plain"?(fn(typeof f.data=="string","expected string"),i+=f.data.split(`
|
|
148
|
-
`).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.
|
|
149
|
-
</pre>`,timestamp:-1},d=e[s];if(d.mimetype==="text/plain"){fn(typeof d.data=="string","expected string");let f=d.data.split(`
|
|
150
|
-
`),m=n-(i-f.length);return[c,{...d,data:f.slice(-m).join(`
|
|
151
|
-
`)},...e.slice(s+1)]}return[c,...e.slice(s+1)]}function QE(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=Zm.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:Nl(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"),fn(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:UE([...s,n.console].filter(Boolean))),i.consoleOutputs=s,i.outline=th(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 GE(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}_m=function(e){return e==="running"||e==="queued"},aw=function(e,n){let{status:i,output:a,runStartTimestamp:s,interrupted:c,staleInputs:d}=e;if(c)return!1;if(n)return!0;let f=_m(i),m=i==="running"&&a!==null&&s!==null&&(a.timestamp??0)>s;return f&&!m?!0:d};function JE(e,n){return g4(e*1e3,n==null?void 0:n.in)}var Qy=!1;function XE(e){var a;let n=[],i=[e.console].filter(Boolean).flat();for(let s of i)if(s.mimetype==="text/plain"){fn(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(Gy.log),i.length===0&&Mu((a=e.output)==null?void 0:a.mimetype)&&Array.isArray(e.output.data)){e.output.data.forEach(c=>{Gy.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");!Qy&&s&&(Qy=!0,Su({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 Gy={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`,`[${qm(e.timestamp)}]`,`(${e.cellId}) ${e.message}`)}};qm=function(e){try{return JE(e).toLocaleTimeString(void 0,{hour12:!0,hour:"numeric",minute:"numeric",second:"numeric"})}catch{return""}},Z2=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}`)},kw=function(e){let n=document.getElementById(ur.create(e));n?cf(n):Pe.warn(`[CellFocusManager] focusCell: element not found: ${e}`)},Am=function(){return document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains("marimo-cell")};function cf(e){try{e.focus()}catch{Pe.warn("[CellFocusManager] element may not be focusable",e)}}ym=function(e,n){let{retries:i,delay:a,initialDelay:s=0}=n,c=0,d=()=>{if(c<i){try{if(e())return}catch(f){Pe.error(`Error executing function on attempt ${c+1}, retrying`,{error:f})}c++,setTimeout(d,a)}};s>0?setTimeout(d,s):d()};function _s({cellId:e,cell:n,isCodeHidden:i,codeFocus:a,variableName:s}){var d;if(!n)return;let c=document.getElementById(ur.create(e));if(!c){Pe.warn("scrollCellIntoView: element not found");return}if(Am()){cf(c);return}if(i)cf(c);else{let f=(d=n.current)==null?void 0:d.editorView;if(!f){Pe.warn("scrollCellIntoView: editor not found",e);return}if(f.hasFocus)return;if(ym(()=>(f.focus(),f.hasFocus),{retries:5,delay:20}),a==="top")f.dispatch({selection:{anchor:0,head:0}});else if(a==="bottom"){let m=f.state.doc.line(f.state.doc.lines);f.dispatch({selection:{anchor:m.from,head:m.from}})}else s&&Au(f,s)}c.scrollIntoView({behavior:"smooth",block:"nearest"})}b_=function(e){let n=document.getElementById(ur.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 ZE(){var e;(e=document.getElementById("App"))==null||e.scrollTo({top:0,behavior:"smooth"})}Cr=function({id:e,name:n="_",code:i="",lastCodeRun:a=null,lastExecutionTime:s=null,edited:c=!1,config:d,serializedEditorState:f=null}){return{id:e,config:d||{hide_code:!1,disabled:!1,column:null},name:n,code:i,edited:c,lastCodeRun:a,lastExecutionTime:s,serializedEditorState:f}};function eT(e){return{hide_code:!1,disabled:!1,column:null,...e}}Sr=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 uf=Kt(Br(),1);gs="__scratch__",Er="setup";function Jy(e){let n={column:0,hide_code:!1,disabled:!1};return{...e,cellData:{[gs]:Cr({id:gs,config:n}),...e.cellData},cellRuntime:{[gs]:Sr(),...e.cellRuntime},cellHandles:{[gs]:(0,At.createRef)(),...e.cellHandles}}}function tT(){return Jy({cellIds:zl.from([]),cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[],untouchedNewCells:new Set})}let nT,rT,Xy;({reducer:nT,createActions:rT,useActions:Xy,valueAtom:ft}=Pl(tT,{createNewCell:(e,n)=>{var T;let{cellId:i,before:a,code:s,lastCodeRun:c=null,lastExecutionTime:d=null,autoFocus:f=!0,skipIfCodeExists:m=!1,hideCode:g=!1}=n,w,_;if(m){for(let A of e.cellIds.inOrderIds)if(((T=e.cellData[A])==null?void 0:T.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||go.create(),E=a?_:_+1;return{...e,cellIds:e.cellIds.insertId(C,w,E),cellData:{...e.cellData,[C]:Cr({id:C,code:s,lastCodeRun:c,config:eT({hide_code:g}),lastExecutionTime:d,edited:!!s&&s!==c})},cellRuntime:{...e.cellRuntime,[C]:Sr()},cellHandles:{...e.cellHandles,[C]:(0,At.createRef)()},scrollKey:f?C:null,untouchedNewCells:g?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 f=e.cellIds.findWithId(i),m=e.cellIds.indexOf(f),g=s==="left"?m-1:m+1,w=e.cellIds.at(g);return w?{...e,cellIds:e.cellIds.moveAcrossColumns(f.id,i,w.id,void 0),scrollKey:i}:e}let c=e.cellIds.findWithId(i),d=c.indexOfOrThrow(i);return 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),f=c.indexOfOrThrow(a);return s.id===c.id?d===f?e:{...e,cellIds:e.cellIds.moveWithinColumn(s.id,d,f),scrollKey:null}:{...e,cellIds:e.cellIds.moveAcrossColumns(s.id,i,c.id,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"?sm(c-1,0,i.length-1):s==="after"?sm(c+1,0,i.length-1):c;let f=i.atOrThrow(d);return _s({cellId:f,cell:e.cellHandles[f],isCodeHidden:xs(e,f),codeFocus:s==="after"?"top":"bottom",variableName:void 0}),e},focusTopCell:e=>{let n=e.cellIds.getColumns().at(0);if(n===void 0||n.length===0)return e;let i=n.first();return _s({cellId:i,cell:e.cellHandles[i],isCodeHidden:xs(e,i),codeFocus:void 0,variableName:void 0}),ZE(),e},focusBottomCell:e=>{let n=e.cellIds.getColumns().at(-1);if(n===void 0||n.length===0)return e;let i=n.last();return _s({cellId:i,cell:e.cellHandles[i],isCodeHidden:xs(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=go.create();return{...e,cellIds:e.cellIds.addColumn(n.columnId,[i]),cellData:{...e.cellData,[i]:Cr({id:i})},cellRuntime:{...e.cellRuntime,[i]:Sr()},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 m,g;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 f=(g=(m=e.cellHandles[i].current)==null?void 0:m.editorView)==null?void 0:g.state.toJSON({history:MR});return f.doc=e.cellData[i].code,aT(i),{...e,cellIds:e.cellIds.deleteById(i),history:[...e.history,{name:e.cellData[i].name,serializedEditorState:f,column:a.id,index:s,isSetupCell:i===Er}],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?Er:go.create(),f=Cr({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]:f},cellRuntime:{...e.cellRuntime,[d]:Sr()},cellHandles:{...e.cellHandles,[d]:(0,At.createRef)()},history:e.history.slice(0,-1)}},clearSerializedEditorState:(e,n)=>{let{cellId:i}=n;return Cs({state:e,cellId:i,cellReducer:a=>({...a,serializedEditorState:null})})},updateCellCode:(e,n)=>{let{cellId:i,code:a,formattingChange:s}=n;return e.cellData[i]?Cs({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 Cs({state:e,cellId:i,cellReducer:s=>({...s,name:a})})},updateCellConfig:(e,n)=>{let{cellId:i,config:a}=n;return Cs({state:e,cellId:i,cellReducer:s=>({...s,config:{...s.config,...a}})})},prepareForRun:(e,n)=>Cs({state:ks({state:e,cellId:n.cellId,cellReducer:i=>GE(i)}),cellId:n.cellId,cellReducer:i=>({...i,edited:!1,lastCodeRun:i.code.trim()})}),handleCellMessage:(e,n)=>{let i=n.cell_id,a=ks({state:e,cellId:i,cellReducer:s=>QE(s,n)});return{...a,cellLogs:[...a.cellLogs,...XE(n)]}},setCellIds:(e,n)=>{if(H3(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]=Cr({id:c})),c in e.cellRuntime||(a[c]=Sr()),c in e.cellHandles||(s[c]=(0,At.createRef)());return{...e,cellIds:zl.fromWithPreviousShape(n.cellIds,e.cellIds),cellData:i,cellRuntime:a,cellHandles:s}},setCellCodes:(e,n)=>{fn(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 Cr({id:d,code:c,lastCodeRun:n.codeIsStale?null:c,edited:n.codeIsStale&&c.trim().length>0});let f=n.codeIsStale?s.lastCodeRun:c,m=f?f.trim()!==c.trim():!!c;if(s.code.trim()===c.trim())return{...s,code:c,edited:m,lastCodeRun:f};if(!Em()){let g=i.cellHandles[d].current;g!=null&&g.editorViewOrNull&&hs(g.editorViewOrNull,c)}return{...s,code:c,edited:m,lastCodeRun:f}};for(let[s,c]of M_(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 ks({state:e,cellId:i,cellReducer:c=>{let d=[...c.consoleOutputs],f=d[s];return f.channel==="stdin"?(d[s]={channel:"stdin",mimetype:f.mimetype,data:f.data,timestamp:f.timestamp,response: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,Sr()]));return Jy({...e,cellIds:zl.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),f=a?d-1:d+1,m=f===c.length,g=f===-1;if(m&&!s){let w=go.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,f),cellData:{...e.cellData,[w]:Cr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Sr()},cellHandles:{...e.cellHandles,[w]:(0,At.createRef)()},scrollKey:w}}if(g&&!s){let w=go.create();return{...e,cellIds:e.cellIds.insertId(w,c.id,0),cellData:{...e.cellData,[w]:Cr({id:w})},cellRuntime:{...e.cellRuntime,[w]:Sr()},cellHandles:{...e.cellHandles,[w]:(0,At.createRef)()},scrollKey:w}}if((m||g)&&s)return e;if(f>=0&&f<c.length){let w=c.atOrThrow(f);_s({cellId:w,cell:e.cellHandles[w],isCodeHidden:xs(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 _s({cellId:s,cell:e.cellHandles[s],isCodeHidden:xs(e,s),codeFocus:void 0,variableName:void 0}),{...e,scrollKey:null}},foldAll:e=>(J_(Object.values(e.cellHandles).map(n=>{var i;return(i=n.current)==null?void 0:i.editorView})),e),unfoldAll:e=>(X_(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(f=>e.cellRuntime[f].outline),c=Wy(a.indexOfOrThrow(i),s);if(!c)return e;let d=a.atOrThrow(c[1]);return{...e,cellIds:e.cellIds.transformWithCellId(i,f=>f.collapse(i,d)),scrollKey:i}},expandCell:(e,n)=>{let{cellId:i}=n;return{...e,cellIds:e.cellIds.transformWithCellId(i,a=>a.expand(i)),scrollKey:i}},collapseAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>{let i=n.topLevelIds.map(m=>e.cellRuntime[m].outline),a=[...n.nodes],s=[],c=[],d=a.length-1;for(;d>=0;){let m=Wy(d,i);if(m){let g=d,w=m[1],_=s.find(T=>T.start<=w&&T.end===w);_&&(w=_.start),s.push({start:g,end:w});let C=n.atOrThrow(g),E=n.atOrThrow(w);c.push({id:C,until:E})}else c.push(null);d--}let f=c.reverse();return n.collapseAll(f)})}),expandAllCells:e=>({...e,cellIds:e.cellIds.transformAll(n=>n.expandAll())}),showCellIfHidden:(e,n)=>{let{cellId:i}=n,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:f,afterCursorCode:m}=zE(d.editorView);hs(d.editorView,f);let g=go.create();return{...e,cellIds:e.cellIds.insertId(g,a.id,s+1),cellData:{...e.cellData,[i]:{...c,code:f,edited:!!f&&f.trim()!==((w=c.lastCodeRun)==null?void 0:w.trim())},[g]:Cr({id:g,code:m,edited:!!m})},cellRuntime:{...e.cellRuntime,[i]:{...e.cellRuntime[i],output:null,consoleOutputs:[]},[g]:Sr()},cellHandles:{...e.cellHandles,[g]:(0,At.createRef)()},scrollKey:g}},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:(hs(c.editorView,a),{...e,cellIds:e.cellIds.transformWithCellId(i,f=>{let m=f.indexOfOrThrow(i)+1;return f.deleteAtIndex(m)}),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 ks({state:e,cellId:i,cellReducer:a=>({...a,output:null,consoleOutputs:[]})})},clearCellConsoleOutput:(e,n)=>{let{cellId:i}=n;return ks({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:Er}:{...e,cellIds:e.cellIds.insertId(Er,e.cellIds.atOrThrow(0).id,0),cellData:{...e.cellData,[Er]:Cr({id:Er,name:Er,code:i,edited:!!i})},cellRuntime:{...e.cellRuntime,[Er]:Sr()},cellHandles:{...e.cellHandles,[Er]:(0,At.createRef)()},scrollKey:Er}}}));function xs(e,n){return!!e.cellData[n].config.hide_code&&!e.untouchedNewCells.has(n)}function ks({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 Cs({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)}Hw=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 f={...i};return d===0&&(f.column=s),{...n[c].config,...f}})):e.cellIds.getColumns().flatMap(a=>a.inOrderIds.map(s=>({...n[s].config,...i})))};let Yy;Zu=Fe(e=>e(ft).cellIds),y_=Fe(e=>e(Zu).hasOnlyOneId()),Nw=Fe(e=>Ym(e(ft)).length>0),m_=Fe(e=>eh(e(ft)).length>0),l_=Fe(e=>nx(e(ft))),jw=Fe(e=>ex(e(ft))),Gu=Fe(e=>{let{cellIds:n,cellRuntime:i,cellData:a}=e(ft);return n.inOrderIds.map(s=>{var f;let c=i[s],{name:d}=a[s];if(Mu((f=c.output)==null?void 0:f.mimetype)){fn(Array.isArray(c.output.data),"Expected array data");let m=c.output.data.filter(g=>!g.type.includes("ancestor"));if(m.length>0)return{output:{...c.output,data:m},cellId:s,cellName:d}}return null}).filter(Boolean)}),$2=Fe(e=>{let{cellIds:n,cellRuntime:i}=e(ft);return HE(n.inOrderIds.map(a=>i[a].outline))}),Mw=Fe(e=>e(Gu).length),Yy=V3(Fe(e=>{let{cellIds:n,cellData:i}=e(ft);return ni.fromEntries(n.inOrderIds.map(a=>{var s;return[a,(s=i[a])==null?void 0:s.name]}))}));var iT=Fe(e=>e(ft).scrollKey);G2=()=>Kn(ft),Kw=()=>Kn(Zu),cw=()=>Kn(Yy),Jw=()=>Kn(Gu),lw=()=>Kn(ft).cellLogs,rw=()=>Kn(iT),Wu=()=>st.get(ft),e_=()=>{let{cellIds:e,cellData:n}=st.get(ft);return e.inOrderIds.map(i=>{var a;return(a=n[i])==null?void 0:a.name}).filter(Boolean)};var oT=V_(q_(ft,e=>e.cellIds.inOrderIds.map(n=>e.cellData[n])));uw=()=>d2(oT),vw=Fe(e=>Y_(e(ft))),h_=Fe(e=>Z_(e(ft))),bw=Fe(e=>e(ft).cellIds.colLength),$w=Fe(e=>e(ft).cellIds.idLength>0),qw=Fe(e=>e(ft).cellIds.getColumnIds()),Ku=cd(e=>Fe(n=>n(ft).cellData[e]));var Zy=cd(e=>Fe(n=>n(ft).cellRuntime[e]));const ev=cd(e=>Fe(n=>n(ft).cellHandles[e]));function aT(e){Ku.remove(e),Zy.remove(e),ev.remove(e)}K2=e=>{let n=(0,uf.c)(2),i;return n[0]===e?i=n[1]:(i=Ku(e),n[0]=e,n[1]=i),Kn(i)},pw=e=>{let n=(0,uf.c)(2),i;return n[0]===e?i=n[1]:(i=Zy(e),n[0]=e,n[1]=i),Kn(i)},B2=e=>{let n=(0,uf.c)(2),i;return n[0]===e?i=n[1]:(i=ev(e),n[0]=e,n[1]=i),Kn(i)},Hm=()=>{let{cellIds:e,cellHandles:n}=st.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)},r_=e=>{var i;let{cellHandles:n}=st.get(ft);return(i=n[e].current)==null?void 0:i.editorView},d_=function(e){let{cellIds:n,cellData:i,cellRuntime:a}=e;return n.getColumns().flatMap(s=>s.topLevelIds.map(c=>({...i[c],...a[c]})))},Yw=function(e){return Fe(n=>n(ft).untouchedNewCells.has(e))};function sT(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 zm(a)})}Q2=function(){return Xy()}})();export{F2 as $,Eu as $n,Ml as $t,B2 as A,H2 as An,Fn as Ar,Tu as At,ym as B,Ru as Bn,ur as Br,V2 as Bt,$2 as C,Al as Cn,W2 as Cr,U2 as Ct,K2 as D,vm as Dn,fs as Dr,ca as Dt,Q2 as E,bm as En,Du as Er,Il as Et,G2 as F,J2 as Fn,X2 as Fr,wm as Ft,_m as G,xm as Gn,km as Gr,Y2 as Gt,Z2 as H,ew as Hn,tw as Hr,nw as Ht,rw as I,Cm as In,iw as Ir,Sm as It,Em as J,ow as Jn,Ou as Jt,aw as K,Pu as Kn,Tm as Kr,sw as Kt,Cr as L,Rm as Ln,Dm as Lr,Om as Lt,lw as M,Li as Mn,Lu as Mr,ps as Mt,cw as N,jl as Nn,ql as Nr,Pm as Nt,uw as O,dw as On,fw as Or,Lm as Ot,pw as P,mw as Pn,Nu as Pr,Nm as Pt,Mu as Q,hw as Qn,gw as Qt,Sr as R,Au as Rn,go as Rr,yw as Rt,vw as S,Mm as Sn,zl as Sr,yo as St,bw as T,ww as Tn,_w as Tr,xw as Tt,Am as U,Iu as Un,Im as Ur,ju as Ut,kw as V,Cw as Vn,qu as Vr,jm as Vt,qm as W,zu as Wn,Sw as Wr,ua as Wt,Ew as X,Tw as Xn,Rw as Xt,Dw as Y,Ow as Yn,Pw as Yt,Fu as Z,vo as Zn,Lw as Zt,Nw as _,C4 as __tla,oi as _n,zm as _r,dr as _t,Mw as a,Aw as an,da as ar,Iw as at,jw as b,Fm as bn,bo as br,Bu as bt,qw as c,Bm as cn,zw as cr,Hu as ct,Hm as d,Vm as dn,$m as dr,Fw as dt,Bw as en,Wm as er,Um as et,Hw as f,Fl as fn,Vu as fr,Vw as ft,$w as g,$u as gn,Ww as gr,Bl as gt,Wu as h,wo as hn,Uu as hr,Km as ht,Ku as i,Qm as in,Dt as ir,Uw as it,Kw as j,Qw as jn,Gw as jr,Qu as jt,Jw as k,Xw as kn,ms as kr,fa as kt,Yw as l,Zw as ln,Gm as lr,Jm as lt,e_ as m,Hl as mn,pa as mr,Xm as mt,Er as n,Ni as nn,t_ as nr,ai as nt,Gu as o,n_ as on,Ym as or,Tr as ot,r_ as p,Ju as pn,i_ as pr,o_ as pt,Zm as q,a_ as qn,Xu as qr,s_ as qt,l_ as r,ma as rn,Yu as rr,hs as rt,Zu as s,ed as sn,eh as sr,c_ as st,gs as t,u_ as tn,Vl as tr,th as tt,d_ as u,f_ as un,p_ as ur,nh as ut,m_ as v,td as vn,rh as vr,nd as vt,h_ as w,rd as wn,ih as wr,id as wt,ft as x,oh as xn,ah as xr,g_ as xt,y_ as y,od as yn,sh as yr,v_ as yt,b_ as z,w_ as zn,__ as zr,x_ as zt};
|