diffing 0.4.1 → 0.5.0
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/README.md +41 -7
- package/dist/cli-agent-BatQgghr.mjs +499 -0
- package/dist/cli-agent-BwZE05CQ.mjs +499 -0
- package/dist/cli-agent-CLvCYpmH.mjs +499 -0
- package/dist/cli-agent-CX8Fa1Ph.mjs +499 -0
- package/dist/cli-agent-SILzesQP.mjs +513 -0
- package/dist/cli-agent-USzLoAit.mjs +499 -0
- package/dist/cli-gh-BV5az425.mjs +147 -0
- package/dist/cli-gh-Bo6fOHQR.mjs +147 -0
- package/dist/cli-gh-D1LoWJl-.mjs +147 -0
- package/dist/cli-gh-DROAJlHi.mjs +147 -0
- package/dist/cli-gh-DiT8BWwu.mjs +147 -0
- package/dist/cli.mjs +97 -3381
- package/dist/client/assets/{angular-html-DIKVmS-w.js → angular-html-BENRjrvE.js} +1 -1
- package/dist/client/assets/{angular-ts-DK13mfBQ.js → angular-ts-BkliueKG.js} +1 -1
- package/dist/client/assets/{apl-NVZUxqwo.js → apl-KTyp4w2D.js} +1 -1
- package/dist/client/assets/{arc-kijUuucY.js → arc-C_OSvkyP.js} +1 -1
- package/dist/client/assets/{architectureDiagram-3BPJPVTR-Dup-CzBS.js → architectureDiagram-3BPJPVTR-mnE1gNyZ.js} +1 -1
- package/dist/client/assets/{astro-RPdCumat.js → astro-yRj4to-g.js} +1 -1
- package/dist/client/assets/{blade-_ubz_KMD.js → blade-C9-yC6OZ.js} +1 -1
- package/dist/client/assets/{blockDiagram-GPEHLZMM-Cl0-G1MY.js → blockDiagram-GPEHLZMM-CRvSVyKN.js} +1 -1
- package/dist/client/assets/{c-IEKcSTtW.js → c-Ct9jvrYE.js} +1 -1
- package/dist/client/assets/{c4Diagram-AAUBKEIU-C3T6FV-K.js → c4Diagram-AAUBKEIU-DjKSb2e1.js} +1 -1
- package/dist/client/assets/channel-C-4se7DL.js +1 -0
- package/dist/client/assets/{chunk-2J33WTMH-B5MFxFjX.js → chunk-2J33WTMH-qCKs_d3h.js} +1 -1
- package/dist/client/assets/{chunk-3OPIFGDE-DWxCOZgI.js → chunk-3OPIFGDE-CKlSXswq.js} +1 -1
- package/dist/client/assets/{chunk-4BX2VUAB-DWdovlBC.js → chunk-4BX2VUAB-hTW5Y0Nd.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-CFSaZijP.js → chunk-55IACEB6-s0GqpI90.js} +1 -1
- package/dist/client/assets/{chunk-5ZQYHXKU-BH_cLkIj.js → chunk-5ZQYHXKU-udG-lpX4.js} +1 -1
- package/dist/client/assets/{chunk-727SXJPM-BbsJC2PT.js → chunk-727SXJPM-DVxTc02y.js} +1 -1
- package/dist/client/assets/{chunk-AQP2D5EJ-tFAP6fC1.js → chunk-AQP2D5EJ-B3tUnmo8.js} +1 -1
- package/dist/client/assets/{chunk-BSJP7CBP-BGuhsdwy.js → chunk-BSJP7CBP-kRRlTujo.js} +1 -1
- package/dist/client/assets/{chunk-CSCIHK7Q-DXSJWhsY.js → chunk-CSCIHK7Q-DCuKIUBq.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-6vBylg_I.js → chunk-FMBD7UC4-ubdx7k5v.js} +1 -1
- package/dist/client/assets/{chunk-KSCS5N6A-C7iBFsUg.js → chunk-KSCS5N6A-DQL7OmPt.js} +1 -1
- package/dist/client/assets/{chunk-L5ZTLDWV-CRU3nvaK.js → chunk-L5ZTLDWV-CiL1m8Rv.js} +1 -1
- package/dist/client/assets/{chunk-LZXEDZCA-6ppA-_4h.js → chunk-LZXEDZCA-CCM9Cjch.js} +2 -2
- package/dist/client/assets/{chunk-ND2GUHAM-D1cTmgHe.js → chunk-ND2GUHAM-CwaTnKF0.js} +1 -1
- package/dist/client/assets/{chunk-NZK2D7GU-CpUab6v7.js → chunk-NZK2D7GU-B7fSEZrX.js} +1 -1
- package/dist/client/assets/{chunk-O5CBEL6O-cDxBycWe.js → chunk-O5CBEL6O-B6YFcOS-.js} +1 -1
- package/dist/client/assets/chunk-QZHKN3VN-AyjK8EAt.js +1 -0
- package/dist/client/assets/chunk-WU5MYG2G-9-4Xqnl2.js +1 -0
- package/dist/client/assets/{chunk-XPW4576I-CI9GEEdy.js → chunk-XPW4576I-CXr3zzSB.js} +1 -1
- package/dist/client/assets/classDiagram-4FO5ZUOK-BTJ4Aj_7.js +1 -0
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-D0haGZVz.js +1 -0
- package/dist/client/assets/{cobol-BVhbHJgp.js → cobol-DsFmMC48.js} +1 -1
- package/dist/client/assets/{coffee-gY6asS_B.js → coffee-C2yB8Qe3.js} +1 -1
- package/dist/client/assets/{cose-bilkent-S5V4N54A-BOs7zxZa.js → cose-bilkent-S5V4N54A-GMtsBHu-.js} +1 -1
- package/dist/client/assets/{cpp-el3R6exS.js → cpp-BaQo5sKT.js} +1 -1
- package/dist/client/assets/{crystal-D2_0btIo.js → crystal-DqA_S2VB.js} +1 -1
- package/dist/client/assets/{css-DtPe7dg4.js → css-Dx2FXpZT.js} +1 -1
- package/dist/client/assets/{dagre-BM42HDAG-CR_0cBOz.js → dagre-BM42HDAG-BsXOZT1Y.js} +1 -1
- package/dist/client/assets/{diagram-2AECGRRQ-D9um0wp2.js → diagram-2AECGRRQ-CR6siaeN.js} +1 -1
- package/dist/client/assets/{diagram-5GNKFQAL-Dx0TEfBJ.js → diagram-5GNKFQAL-CDZR1QcC.js} +1 -1
- package/dist/client/assets/{diagram-KO2AKTUF-DjBHOuUD.js → diagram-KO2AKTUF-Di30mzpa.js} +1 -1
- package/dist/client/assets/{diagram-LMA3HP47-CK2MO5Gx.js → diagram-LMA3HP47-gAYk3RNx.js} +1 -1
- package/dist/client/assets/{diagram-OG6HWLK6-CANQancN.js → diagram-OG6HWLK6-CJquOKkB.js} +1 -1
- package/dist/client/assets/{dist-DGlwcsQQ.js → dist-Dt4KwfbE.js} +1 -1
- package/dist/client/assets/{edge-Ch_PYBsB.js → edge-CQpty0x5.js} +1 -1
- package/dist/client/assets/{elixir-DEJrJATq.js → elixir-BcaGdZXN.js} +1 -1
- package/dist/client/assets/{elm-Brlko4-d.js → elm-CP76VjNp.js} +1 -1
- package/dist/client/assets/{erDiagram-TEJ5UH35-Dnfrs6yk.js → erDiagram-TEJ5UH35-Bn7AKn4C.js} +1 -1
- package/dist/client/assets/{erb-DQPphNua.js → erb-5-RC0m2F.js} +1 -1
- package/dist/client/assets/{flowDiagram-I6XJVG4X-BNMdFtjG.js → flowDiagram-I6XJVG4X-0xHUbQwP.js} +1 -1
- package/dist/client/assets/{ganttDiagram-6RSMTGT7-X-fPXz_A.js → ganttDiagram-6RSMTGT7-DPMd_wXW.js} +1 -1
- package/dist/client/assets/{git-rebase-BpS915SI.js → git-rebase-Bqj-6hRc.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PVQCEYII-CRN_dRXM.js → gitGraphDiagram-PVQCEYII-B3-X4FvC.js} +1 -1
- package/dist/client/assets/{glimmer-js-DZDngVuD.js → glimmer-js-B9DDu9wr.js} +1 -1
- package/dist/client/assets/{glimmer-ts-DKNjJvyp.js → glimmer-ts-C67nh0lS.js} +1 -1
- package/dist/client/assets/{glsl-C-Y1tHoU.js → glsl-4_qCLsUA.js} +1 -1
- package/dist/client/assets/{graphql-DYVBNazO.js → graphql-BPnYvj3r.js} +1 -1
- package/dist/client/assets/{hack-DewKAtLe.js → hack-lddqozaa.js} +1 -1
- package/dist/client/assets/{haml-CIA_AeXu.js → haml-ap0ZMUQp.js} +1 -1
- package/dist/client/assets/{handlebars-Bade6JXX.js → handlebars-DzkaM9As.js} +1 -1
- package/dist/client/assets/{html-C4hhbuGp.js → html-CokHrq1C.js} +1 -1
- package/dist/client/assets/{html-derivative-BXfztBtv.js → html-derivative-C_RIVbdg.js} +1 -1
- package/dist/client/assets/{http-Cq90-CTl.js → http-Ch6kOrN2.js} +1 -1
- package/dist/client/assets/{hurl-DklQHYoa.js → hurl-C10trGis.js} +1 -1
- package/dist/client/assets/{index-j9gqGQit.js → index-HMLOzXE5.js} +72 -72
- package/dist/client/assets/{index-CMyunQt6.css → index-tBAqyUGu.css} +1 -1
- package/dist/client/assets/{infoDiagram-5YYISTIA-Ht-AcvP4.js → infoDiagram-5YYISTIA-CrNF878y.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-k_l70iFb.js → ishikawaDiagram-YF4QCWOH-KGxvlsNl.js} +1 -1
- package/dist/client/assets/{java-BMUwLm1h.js → java-CRDLxWFu.js} +1 -1
- package/dist/client/assets/{javascript-B8nPCUVp.js → javascript-BJrijFXZ.js} +1 -1
- package/dist/client/assets/{jinja-CkxiRcB3.js → jinja-Dq3vAj4T.js} +1 -1
- package/dist/client/assets/{jison-CFnN5uQs.js → jison-PSOWkXj1.js} +1 -1
- package/dist/client/assets/{journeyDiagram-JHISSGLW-C98PUC9Y.js → journeyDiagram-JHISSGLW-CtS0cOcB.js} +1 -1
- package/dist/client/assets/{json-B7HNnjIx.js → json-Ue4paT4d.js} +1 -1
- package/dist/client/assets/{jsx-BfVPuW3i.js → jsx-D60Fd_vz.js} +1 -1
- package/dist/client/assets/{julia-Bj0ETGjT.js → julia-7UqDDEkb.js} +1 -1
- package/dist/client/assets/{just-CqIe_c9k.js → just-2Nqw-G9g.js} +1 -1
- package/dist/client/assets/{kanban-definition-UN3LZRKU-BE-uvH7w.js → kanban-definition-UN3LZRKU-iXUnaPci.js} +1 -1
- package/dist/client/assets/{latex-Cvy8E64e.js → latex-CAORCICD.js} +1 -1
- package/dist/client/assets/{line-BpooNUgm.js → line-BvDfaxy7.js} +1 -1
- package/dist/client/assets/{linear-CM6ZoyCp.js → linear-BPNP_vs-.js} +1 -1
- package/dist/client/assets/{liquid-x09l8QqE.js → liquid-B1dMHpLg.js} +1 -1
- package/dist/client/assets/{lua-BSlDLjt5.js → lua-CVg9faio.js} +1 -1
- package/dist/client/assets/{marko-CoNMQlTn.js → marko-CIj0-gvZ.js} +1 -1
- package/dist/client/assets/{mdc-BSzVESPu.js → mdc-Dcm42qXg.js} +1 -1
- package/dist/client/assets/{mermaid-parser.core-BDXJMxHu.js → mermaid-parser.core-akPZ8Xt7.js} +1 -1
- package/dist/client/assets/{mermaid.core-Dw-_vXTc.js → mermaid.core-DTef5PVY.js} +3 -3
- package/dist/client/assets/{mindmap-definition-RKZ34NQL-BTxGT8rM.js → mindmap-definition-RKZ34NQL-jM52CcWE.js} +1 -1
- package/dist/client/assets/{nginx-CBhJTj0i.js → nginx-zzgwPZum.js} +1 -1
- package/dist/client/assets/{nim-CtHbOBlO.js → nim-Au_jXrfv.js} +1 -1
- package/dist/client/assets/{perl-DLMzG3tu.js → perl-CAllCqkR.js} +1 -1
- package/dist/client/assets/{php-KomVR3Hz.js → php-CgM1w-IE.js} +1 -1
- package/dist/client/assets/{pieDiagram-4H26LBE5-BBUObAJW.js → pieDiagram-4H26LBE5-BdI8P976.js} +1 -1
- package/dist/client/assets/{pug-T4SRLx8P.js → pug-uy7R6gmf.js} +1 -1
- package/dist/client/assets/{qml-DJdSRUmU.js → qml-XvGkfj7l.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-W4KKPZXB-B7vvauZv.js → quadrantDiagram-W4KKPZXB-CTUrE6VT.js} +1 -1
- package/dist/client/assets/{r-CwuTg9lK.js → r-DFRLw0D7.js} +1 -1
- package/dist/client/assets/{razor-Ch4dgsGY.js → razor-e63ackHA.js} +1 -1
- package/dist/client/assets/{regexp-D2GTwJE0.js → regexp-BmysD-wZ.js} +1 -1
- package/dist/client/assets/{requirementDiagram-4Y6WPE33-DpcNiR3Y.js → requirementDiagram-4Y6WPE33-oNojoZNX.js} +1 -1
- package/dist/client/assets/{rst-D78f0DyR.js → rst-BdbFuh_U.js} +1 -1
- package/dist/client/assets/{ruby-BUcw6ITs.js → ruby-CSdAL4us.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-5OEKKPKP-ChzSQD2O.js → sankeyDiagram-5OEKKPKP-Dj7lZz55.js} +1 -1
- package/dist/client/assets/{sas-DoT2JDsj.js → sas-JtqALwix.js} +1 -1
- package/dist/client/assets/{scss-B6G_d-6b.js → scss-BKQrDG10.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-3UESZ5HK-CzkdL8s7.js → sequenceDiagram-3UESZ5HK-BNpcmJ78.js} +1 -1
- package/dist/client/assets/{shellscript-DI252Bga.js → shellscript-jk-NKrK3.js} +1 -1
- package/dist/client/assets/{shellsession-BuO_s8FQ.js → shellsession-C_OxJCjJ.js} +1 -1
- package/dist/client/assets/{soy-DZTZJTEE.js → soy-6C-zhFL7.js} +1 -1
- package/dist/client/assets/{sql-C4isoJr_.js → sql-N-x_YojG.js} +1 -1
- package/dist/client/assets/{src-BMvz5HE8.js → src-i7-w__4l.js} +1 -1
- package/dist/client/assets/{stata-Dhu6qITh.js → stata-Dkub6QBh.js} +1 -1
- package/dist/client/assets/{stateDiagram-AJRCARHV-DvYcrdap.js → stateDiagram-AJRCARHV-D30q2ZVZ.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-BHNVJYJU-CyrdNaut.js +1 -0
- package/dist/client/assets/{surrealql-CSDpq5j3.js → surrealql-2pOLFG_P.js} +1 -1
- package/dist/client/assets/{svelte-C4ITAvxr.js → svelte-CuvADzyi.js} +1 -1
- package/dist/client/assets/{templ-BTgKA9-7.js → templ-DtOxTonk.js} +1 -1
- package/dist/client/assets/{tex-Dg4N9ndP.js → tex-BwPRGOZW.js} +1 -1
- package/dist/client/assets/{timeline-definition-PNZ67QCA-Djt5Lwk2.js → timeline-definition-PNZ67QCA-7FTcWUjq.js} +1 -1
- package/dist/client/assets/{ts-tags-BufYnYos.js → ts-tags-Cn_Y5EDf.js} +1 -1
- package/dist/client/assets/{tsx-DmkFP0sw.js → tsx-RC8FAazO.js} +1 -1
- package/dist/client/assets/{twig-BJv_IWYK.js → twig-DtQFIjP0.js} +1 -1
- package/dist/client/assets/{typescript-BKp05Qme.js → typescript-DX6qUod4.js} +1 -1
- package/dist/client/assets/{vennDiagram-CIIHVFJN-DDVADTIa.js → vennDiagram-CIIHVFJN-B4eT2YKy.js} +1 -1
- package/dist/client/assets/{vue-BsHXCXzh.js → vue-D8H1bCQ7.js} +1 -1
- package/dist/client/assets/{vue-html-CCsH-lmo.js → vue-html-B0YmCSWB.js} +1 -1
- package/dist/client/assets/{vue-vine-B5P1JXxo.js → vue-vine-Buj2gfKi.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-YWT4CUSO-yeVKWvtX.js → wardleyDiagram-YWT4CUSO-_PA_cSF5.js} +1 -1
- package/dist/client/assets/{xml-CFkhYff0.js → xml-KzFmzaXc.js} +1 -1
- package/dist/client/assets/{xsl-Dc5XRzm6.js → xsl-x0R4ZCXO.js} +1 -1
- package/dist/client/assets/{xychartDiagram-2RQKCTM6--8Ik-9v0.js → xychartDiagram-2RQKCTM6-g1emmBmb.js} +1 -1
- package/dist/client/assets/{yaml-BTCCxCxi.js → yaml-BCE-GuGS.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/mcp-BMTZLQuB.mjs +758 -0
- package/dist/mcp-BUF2nEL7.mjs +1036 -0
- package/dist/mcp-Bpx76OGU.mjs +945 -0
- package/dist/mcp-C1T7LI0H.mjs +1036 -0
- package/dist/mcp-C4Bjmf9m.mjs +1047 -0
- package/dist/mcp-CFxcdEcJ.mjs +733 -0
- package/dist/mcp-CwjThGi2.mjs +913 -0
- package/dist/mcp-D4OsB9lt.mjs +1047 -0
- package/dist/mcp-DJ2batvt.mjs +913 -0
- package/dist/mcp-Ds_lPX_o.mjs +913 -0
- package/dist/plan-format-B6nbAw_c.mjs +132 -0
- package/dist/server-95UE5bgh.mjs +3367 -0
- package/dist/server-B0cS95Lf.mjs +3488 -0
- package/dist/server-Bj-6KlK5.mjs +3367 -0
- package/dist/server-Bpf84Il0.mjs +3367 -0
- package/dist/server-CYSpLbdA.mjs +3360 -0
- package/dist/server-Dov7jbV3.mjs +3367 -0
- package/dist/server-eQ2E4Axo.mjs +3367 -0
- package/dist/server-lock-C_wPtEsH.mjs +909 -0
- package/dist/server-lock-Cbu3qHdu.mjs +924 -0
- package/dist/server-lock-D32inEn9.mjs +924 -0
- package/dist/server-lock-Ddcat0HF.mjs +851 -0
- package/dist/server-lock-Ujbcgq28.mjs +954 -0
- package/dist/update-check-CXeSZANo.mjs +129 -0
- package/package.json +3 -2
- package/dist/client/assets/channel-CpWSvbvQ.js +0 -1
- package/dist/client/assets/chunk-QZHKN3VN-HhMIifwl.js +0 -1
- package/dist/client/assets/chunk-WU5MYG2G-CvIzXEms.js +0 -1
- package/dist/client/assets/classDiagram-4FO5ZUOK-DFu-dNVy.js +0 -1
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-D7Xcgo6q.js +0 -1
- package/dist/client/assets/stateDiagram-v2-BHNVJYJU-D5igY81I.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-BENRjrvE.js","assets/html-CokHrq1C.js","assets/css-Dx2FXpZT.js","assets/javascript-BJrijFXZ.js","assets/angular-ts-BkliueKG.js","assets/scss-BKQrDG10.js","assets/apl-KTyp4w2D.js","assets/json-Ue4paT4d.js","assets/xml-KzFmzaXc.js","assets/java-CRDLxWFu.js","assets/astro-yRj4to-g.js","assets/postcss-BHCm7Qae.js","assets/tsx-RC8FAazO.js","assets/typescript-DX6qUod4.js","assets/blade-C9-yC6OZ.js","assets/html-derivative-C_RIVbdg.js","assets/sql-N-x_YojG.js","assets/bsl-BrHd4RA2.js","assets/sdbl-AL_m-RO_.js","assets/cairo-BDZ6TRZS.js","assets/python-D1NFioGW.js","assets/cobol-DsFmMC48.js","assets/coffee-C2yB8Qe3.js","assets/cpp-BaQo5sKT.js","assets/glsl-4_qCLsUA.js","assets/c-Ct9jvrYE.js","assets/regexp-BmysD-wZ.js","assets/crystal-DqA_S2VB.js","assets/shellscript-jk-NKrK3.js","assets/edge-CQpty0x5.js","assets/elixir-BcaGdZXN.js","assets/elm-CP76VjNp.js","assets/erb-5-RC0m2F.js","assets/ruby-CSdAL4us.js","assets/graphql-BPnYvj3r.js","assets/jsx-D60Fd_vz.js","assets/haml-ap0ZMUQp.js","assets/lua-CVg9faio.js","assets/yaml-BCE-GuGS.js","assets/erlang-cuhwpmsu.js","assets/markdown-DXxotAxn.js","assets/fortran-fixed-form-DWr0EnJn.js","assets/fortran-free-form-Br4jRtSc.js","assets/fsharp-CQ5iYSPA.js","assets/gdresource-CN-lsNu5.js","assets/gdscript-hSAZM1eh.js","assets/gdshader-D4XNAEs9.js","assets/git-commit-6e79eN7Q.js","assets/diff-CW0RWGd9.js","assets/git-rebase-Bqj-6hRc.js","assets/glimmer-js-B9DDu9wr.js","assets/glimmer-ts-C67nh0lS.js","assets/hack-lddqozaa.js","assets/handlebars-DzkaM9As.js","assets/http-Ch6kOrN2.js","assets/hurl-C10trGis.js","assets/csv-BBwiVr0X.js","assets/hxml-nwJci6H5.js","assets/haxe-DMg0jS3a.js","assets/jinja-Dq3vAj4T.js","assets/jison-PSOWkXj1.js","assets/julia-7UqDDEkb.js","assets/r-DFRLw0D7.js","assets/just-2Nqw-G9g.js","assets/perl-CAllCqkR.js","assets/latex-CAORCICD.js","assets/tex-BwPRGOZW.js","assets/liquid-B1dMHpLg.js","assets/marko-CIj0-gvZ.js","assets/less-DyHub3ow.js","assets/mdc-Dcm42qXg.js","assets/nextflow-DSfydIxt.js","assets/nextflow-groovy-DV4H3hok.js","assets/nginx-zzgwPZum.js","assets/nim-Au_jXrfv.js","assets/php-CgM1w-IE.js","assets/pug-uy7R6gmf.js","assets/qml-XvGkfj7l.js","assets/razor-e63ackHA.js","assets/csharp-C3YlYcLV.js","assets/rst-BdbFuh_U.js","assets/cmake-DaqQuj4A.js","assets/sas-JtqALwix.js","assets/shaderlab-CbbQwRPF.js","assets/hlsl-DPe9L0Dt.js","assets/shellsession-C_OxJCjJ.js","assets/soy-6C-zhFL7.js","assets/sparql-DEoxFJ5d.js","assets/turtle-BM-MG8WY.js","assets/stata-Dkub6QBh.js","assets/surrealql-2pOLFG_P.js","assets/svelte-CuvADzyi.js","assets/templ-DtOxTonk.js","assets/go-BJpWXZEs.js","assets/ts-tags-Cn_Y5EDf.js","assets/twig-DtQFIjP0.js","assets/vue-D8H1bCQ7.js","assets/vue-html-B0YmCSWB.js","assets/vue-vine-Buj2gfKi.js","assets/stylus-B_iq45Sj.js","assets/xsl-x0R4ZCXO.js","assets/mermaid.core-DTef5PVY.js","assets/chunk-O5CBEL6O-B6YFcOS-.js","assets/src-i7-w__4l.js","assets/chunk-5ZQYHXKU-udG-lpX4.js","assets/dist-Dt4KwfbE.js","assets/chunk-CSCIHK7Q-DCuKIUBq.js","assets/chunk-3OPIFGDE-CKlSXswq.js","assets/chunk-L5ZTLDWV-CiL1m8Rv.js","assets/chunk-NZK2D7GU-B7fSEZrX.js","assets/rough.esm-BBrzuQ0N.js","assets/chunk-BSJP7CBP-kRRlTujo.js","assets/chunk-KSCS5N6A-DQL7OmPt.js","assets/line-BvDfaxy7.js","assets/path-g3G46IZB.js","assets/array-CkF66D10.js","assets/chunk-LZXEDZCA-CCM9Cjch.js","assets/chunk-WU5MYG2G-9-4Xqnl2.js","assets/chunk-XPW4576I-CXr3zzSB.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.4`})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=p();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.4`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=d(),n=p(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function P(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var F=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R={pending:!1,data:null,method:null,action:null},z=[],ee=-1;function te(e){return{current:e}}function B(e){0>ee||(e.current=z[ee],z[ee]=null,ee--)}function V(e,t){ee++,z[ee]=e.current,e.current=t}var H=te(null),ne=te(null),re=te(null),ie=te(null);function ae(e,t){switch(V(re,t),V(ne,e),V(H,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Kd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Kd(t),e=qd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}B(H),V(H,e)}function oe(){B(H),B(ne),B(re)}function se(e){e.memoizedState!==null&&V(ie,e);var t=H.current,n=qd(t,e.type);t!==n&&(V(ne,e),V(H,n))}function ce(e){ne.current===e&&(B(H),B(ne)),ie.current===e&&(B(ie),rp._currentValue=R)}var le,ue;function U(e){if(le===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);le=t&&t[1]||``,ue=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+le+e+ue}var de=!1;function fe(e,t){if(!e||de)return``;de=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
@@ -18,7 +18,7 @@ Error generating stack: `+e.message+`
|
|
|
18
18
|
\f\r "&'<=>\``.split(``)],[`\0
|
|
19
19
|
\f\r "&'<=>\``.split(``),`\0
|
|
20
20
|
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Oo(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1:r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=ga);let l=ko(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!xo(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!io(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function ko(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Ao(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function Ao(e,t,n){let r=fa(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=e.settings.allowDangerousCharacters?0:1,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=Ba(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Do.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?qa:Ja)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=Ba(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Do.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&Ka(n,o)>Ka(n,e.alternative)&&(o=e.alternative),s=o+Ba(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Do.single:Do.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var jo=[`<`,`&`];function Mo(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:Ba(e.value,Object.assign({},r.settings.characterReferences,{subset:jo}))}function No(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Mo(e,t,n,r)}function Po(e,t,n,r){return r.all(e)}var Fo=va(`type`,{invalid:Io,unknown:Lo,handlers:{comment:Wa,doctype:Ga,element:Oo,raw:No,root:Po,text:Mo}});function Io(e){throw Error("Expected node, not `"+e+"`")}function Lo(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Ro={},zo={},Bo=[];function Vo(e,t){let n=t||Ro,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Ho,all:Uo,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Ii,characterReferences:n.characterReferences||zo,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?ga:ha,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Ho(e,t,n){return Fo(e,t,n,this)}function Uo(e){let t=[],n=e&&e.children||Bo,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}function Wo(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function Go(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Ko(e){return Array.isArray(e)?e:[e]}async function qo(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function Jo(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function Yo(e){return e===`ansi`||Jo(e)}function Xo(e){return e===`none`}function Zo(e){return Xo(e)}function Qo(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(/\s+/g);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function $o(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(/(\r?\n)/g),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}function es(e){let t=$o(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t[t.length-1].length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function ts(e,t,n){let r=new Set;for(let t of e.matchAll(/:?lang=["']([^"']+)["']/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/(?:```|~~~)([\w-]+)/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/\\begin\{([\w-]+)\}/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(!n)return Array.from(r);let i=n.getBundledLanguages();return Array.from(r).filter(e=>e&&i[e])}var ns=`light-dark()`,rs=[`color`,`background-color`];function is(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function as(e,t){let n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?is(e,t):e})):e}function os(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>ss(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&rs.includes(a))if(r===ns&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new Qn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');c[a]=`light-dark(${o[e][a]||`inherit`}, ${o[r][a]||`inherit`})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s;else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function ss(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&yr.Italic&&(t[`font-style`]=`italic`),e.fontStyle&yr.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&yr.Underline&&n.push(`underline`),e.fontStyle&yr.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function cs(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}var ls=new WeakMap;function us(e,t){ls.set(e,t)}function ds(e){return ls.get(e)}var fs=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(Ko(n).map(e=>[e,Fi])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return ps(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function ps(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function ms(e,t){if(!(e instanceof fs))throw new Qn(`Invalid grammar state`);return e.getInternalStack(t)}function hs(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=function(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new Qn(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...r.indexToPos(e),offset:e}}else{let t=r.lines[e.line];if(t===void 0)throw new Qn(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${r.lines.length}`);let n=e.character;if(n<0&&(n=t.length+n),n<0||n>t.length)throw new Qn(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:n,offset:r.posToIndex(e.line,n)}}},r=es(t.source),i=(t.options.decorations||[]).map(e=>({...e,start:n(e.start),end:n(e.end)}));gs(i),e.set(t.meta,{decorations:i,converter:r,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return as(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=Array.from(e.children).filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new Qn(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=_s(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new Qn(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new Qn(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&Qo(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function gs(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new Qn(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new Qn(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function _s(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(_s).join(``):``}var vs=[hs()];function ys(e){let t=bs(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...vs]}function bs(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var xs=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],Ss={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Cs(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function ws(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}else if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function Ts(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:`resetAll`});else if(r<=9)Ss[r]&&t.push({type:`setDecoration`,value:Ss[r]});else if(r<=29){let e=Ss[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:xs[r-30]}});else if(r===38){let n=ws(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:xs[r-40]}});else if(r===48){let n=ws(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:xs[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:xs[r-100+8]}})}return t}function Es(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Cs(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=Ts(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var Ds={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function Os(e=Ds){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<xs.length;e++)r.push(t(xs[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var ks={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function As(e,t,n){let r=Wo(e,n),i=$o(t),a=Os(Object.fromEntries(xs.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||ks[t]]}))),o=Es();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=Go(i,r),o=Go(o,r),n.decorations.has(`dim`)&&(i=js(i));let s=yr.None;return n.decorations.has(`bold`)&&(s|=yr.Bold),n.decorations.has(`italic`)&&(s|=yr.Italic),n.decorations.has(`underline`)&&(s|=yr.Underline),n.decorations.has(`strikethrough`)&&(s|=yr.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function js(e){let t=e.match(/#([0-9a-f]{3,8})/i);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}else if(e.length===6)return`#${e}80`;else if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}else if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function Ms(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n,i=e.resolveLangAlias(n.lang||`text`);if(Jo(i)||Xo(r))return $o(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:a,colorMap:o}=e.setTheme(r);if(i===`ansi`)return As(a,t,n);let s=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==s.name)throw new Qn(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(a.name))throw new Qn(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return Ps(t,s,a,o,n)}function Ns(...e){if(e.length===2)return ds(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(Jo(i)||Xo(a))throw new Qn(`Plain language does not have grammar state`);if(i===`ansi`)throw new Qn(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new fs(Fs(n,c,o,s,r).stateStack,c.name,o.name)}function Ps(e,t,n,r,i){let a=Fs(e,t,n,r,i),o=new fs(a.stateStack,t.name,n.name);return us(a.tokens,o),a.tokens}function Fs(e,t,n,r,i){let a=Wo(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=i,c=$o(e),l=i.grammarState?ms(i.grammarState,n.name)??Fi:i.grammarContextCode==null?Fi:Fs(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,u=[],d=[];for(let e=0,f=c.length;e<f;e++){let[f,p]=c[e];if(f===``){u=[],d.push([]);continue}if(o>0&&f.length>=o){u=[],d.push([{content:f,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;i.includeExplanation&&(m=t.tokenizeLine(f,l,s),h=m.tokens,g=0);let _=t.tokenizeLine2(f,l,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:f.length;if(t===o)continue;let s=_.tokens[2*e+1],c=Go(r[Tr.getForeground(s)],a),l=Tr.getFontStyle(s),d={content:f.substring(t,o),offset:p+t,color:c,fontStyle:l};if(i.includeExplanation){let e=[];if(i.includeExplanation!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(/,/).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}d.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=f.substring(t.startIndex,t.endIndex);r+=n.length,d.explanation.push({content:n,scopes:i.includeExplanation===`scopeName`?Is(t.scopes):Ls(e,t.scopes)}),g+=1}}u.push(d)}d.push(u),u=[],l=_.ruleStack}return{tokens:d,stateStack:l}}function Is(e){return e.map(e=>({scopeName:e}))}function Ls(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Bs(e,i,t.slice(0,r))}}return n}function Rs(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function zs(e,t,n){if(!Rs(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Rs(e[r],n[i])&&--r,--i;return r===-1}function Bs(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(zs(e,t,n)){r.push(a);break}return r}function Vs(e,t,n){let r=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),i=r.map(r=>{let i=Ms(e,t,{...n,theme:r.theme});return{tokens:i,state:ds(i),theme:typeof r.theme==`string`?r.theme:r.theme.name}}),a=Hs(...i.map(e=>e.tokens)),o=a[0].map((e,t)=>e.map((e,i)=>{let o={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(o.explanation=e.explanation),a.forEach((e,n)=>{let{content:a,explanation:s,offset:c,...l}=e[t][i];o.variants[r[n].color]=l}),o})),s=i[0].state?new fs(Object.fromEntries(i.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),i[0].state.lang):void 0;return s&&us(o,s),o}function Hs(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}function Us(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:t.color===l?1:0);if(f.length===0)throw new Qn("`themes` option must not be empty");let p=Vs(e,t,n);if(c=ds(p),l&&ns!==l&&!f.find(e=>e.color===l))throw new Qn(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>os(e,h,u,l,d))),c&&us(a,c);let g=f.map(e=>Wo(e.theme,n));i=Ws(f,m,g,u,l,`fg`,d),r=Ws(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=Wo(n.theme,n);a=Ms(e,t,n);let l=e.getTheme(n.theme);r=Go(l.bg,s),i=Go(l.fg,s),o=l.name,c=ds(a)}else throw new Qn("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function Ws(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=Go(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===ns&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new Qn('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Go(t[r][a],n[r])||`inherit`}, ${Go(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}function Gs(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>Gs(e,t,n),codeToTokens:(t,n)=>Us(e,t,n)}){let i=t;for(let e of ys(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Us(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=qs(a):d===`never`&&(a=Js(a)),f&&(a=Ys(a));let p={...r,get source(){return i}};for(let e of ys(n))a=e.tokens?.call(p,a)||a;return Ks(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Ks(e,t,n,r=ds(e)){let i=ys(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(t.rootStyle==null?l.style=`background-color:${t.bg};color:${t.fg}`:l.style=t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:Qo,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
|
|
21
|
-
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=cs(a.htmlStyle||ss(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&us(m,r),m}function qs(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&yr.Underline||i.fontStyle&yr.Strikethrough));o&&i.content.match(/^\s+$/)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function Js(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function Ys(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t[t.length-1],r=cs(e.htmlStyle||ss(e)),i=cs(n.htmlStyle||ss(n)),a=e.fontStyle&&(e.fontStyle&yr.Underline||e.fontStyle&yr.Strikethrough),o=n.fontStyle&&(n.fontStyle&yr.Underline||n.fontStyle&yr.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Xs=Vo;function Zs(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>Gs(e,t,n),codeToTokens:(t,n)=>Us(e,t,n)},i=Xs(Gs(e,t,n,r));for(let e of ys(n))i=e.postprocess?.call(r,i,n)||i;return i}var Qs={light:`#333333`,dark:`#bbbbbb`},$s={light:`#fffffe`,dark:`#1e1e1e`},ec=`__shiki_resolved`;function tc(e){if(e?.[ec])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?Qs.light:Qs.dark,n||=t.type===`light`?$s.light:$s.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,ec,{enumerable:!1,writable:!1,value:!0}),t}async function nc(e){return Array.from(new Set((await Promise.all(e.filter(e=>!Yo(e)).map(async e=>await qo(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function rc(e){return(await Promise.all(e.map(async e=>Zo(e)?null:tc(await qo(e))))).filter(e=>!!e)}var ic=3,ac=!1;function oc(e,t=3){if(ic&&!(typeof ic==`number`&&t>ic)){if(ac)throw Error(`[SHIKI DEPRECATE]: ${e}`);console.trace(`[SHIKI DEPRECATE]: ${e}`)}}var sc=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function cc(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new sc(`Circular alias \`${Array.from(n).join(` -> `)} -> ${e}\``);n.add(e)}}return e}var lc=class extends Pi{constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=tc(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=fr.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=cc(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=Array.from(this._langGraph.entries()),n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new sc(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},uc=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},dc=0;function fc(e){dc+=1,e.warnings!==!1&&dc>=10&&dc%10==0&&console.warn(`[Shiki] ${dc} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new sc("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(tc),i=new lc(new uc(e.engine,n),r,n,e.langAlias),a;function o(t){return cc(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new sc(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new sc(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await nc(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await rc(e))}function g(){if(t)throw new sc(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--dc)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function pc(e){e.engine||oc("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([rc(e.themes||[]),nc(e.langs||[]),e.engine]);return fc({...e,themes:t,langs:n,engine:r})}async function mc(e){let t=await pc(e);return{getLastGrammarState:(...e)=>Ns(t,...e),codeToTokensBase:(e,n)=>Ms(t,e,n),codeToTokensWithThemes:(e,n)=>Vs(t,e,n),codeToTokens:(e,n)=>Us(t,e,n),codeToHast:(e,n)=>Gs(t,e,n),codeToHtml:(e,n)=>Zs(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function hc(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,Yo(n))return[];let r=t[n];if(!r)throw new Qn(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(Zo(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new Qn(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await mc({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function gc(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}else{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function _c(e,t){let n=gc(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var vc=`modulepreload`,yc=function(e){return`/`+e},bc={},J=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=yc(t,n),t in bc)return;bc[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:vc,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},xc=[{id:`abap`,name:`ABAP`,import:(()=>J(()=>import(`./abap-cWYhO34H.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>J(()=>import(`./actionscript-3-B80ndJsD.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>J(()=>import(`./ada-C0C0SoYB.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>J(()=>import(`./angular-html-DIKVmS-w.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>J(()=>import(`./angular-ts-DK13mfBQ.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>J(()=>import(`./apache-DBwBm4bB.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>J(()=>import(`./apex-FcV7UxQi.js`),[]))},{id:`apl`,name:`APL`,import:(()=>J(()=>import(`./apl-NVZUxqwo.js`),__vite__mapDeps([6,2,1,3,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>J(()=>import(`./applescript-hQs8VNpS.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>J(()=>import(`./ara-BOadBOZg.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>J(()=>import(`./asciidoc-BsfqiBck.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>J(()=>import(`./asm-C2vUqzqz.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>J(()=>import(`./astro-RPdCumat.js`),__vite__mapDeps([10,2,3,7,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>J(()=>import(`./awk-D4e-eeZT.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>J(()=>import(`./ballerina-BzvFqbha.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>J(()=>import(`./bat-CFyw2ERn.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>J(()=>import(`./beancount-a6Gsu5WX.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>J(()=>import(`./berry-C2jyz4Ah.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>J(()=>import(`./bibtex-Dyet-B83.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>J(()=>import(`./bicep-CghvUIvy.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>J(()=>import(`./bird2-nHigvs-R.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>J(()=>import(`./blade-_ubz_KMD.js`),__vite__mapDeps([14,2,15,1,3,7,16,8,9])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>J(()=>import(`./bsl-BrHd4RA2.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>J(()=>import(`./c-IEKcSTtW.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>J(()=>import(`./c3-9ZrcmAmr.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>J(()=>import(`./cadence-BPDgYNWy.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>J(()=>import(`./cairo-BDZ6TRZS.js`),__vite__mapDeps([19,20])))},{id:`clarity`,name:`Clarity`,import:(()=>J(()=>import(`./clarity-Cmao5KSK.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>J(()=>import(`./clojure-D2dPuTkk.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>J(()=>import(`./cmake-DaqQuj4A.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>J(()=>import(`./cobol-BVhbHJgp.js`),__vite__mapDeps([21,1,2,3,9])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>J(()=>import(`./codeowners-B748jmvc.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>J(()=>import(`./codeql-CXb_8gHR.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>J(()=>import(`./coffee-gY6asS_B.js`),__vite__mapDeps([22,3])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>J(()=>import(`./common-lisp-UZn9nc_5.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>J(()=>import(`./coq-DtO6yBIf.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>J(()=>import(`./cpp-el3R6exS.js`).then(e=>e.n),__vite__mapDeps([23,24,25,26,16])))},{id:`crystal`,name:`Crystal`,import:(()=>J(()=>import(`./crystal-D2_0btIo.js`),__vite__mapDeps([27,25,2,1,3,28,16])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>J(()=>import(`./csharp-C3YlYcLV.js`),[]))},{id:`css`,name:`CSS`,import:(()=>J(()=>import(`./css-DtPe7dg4.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>J(()=>import(`./csv-BBwiVr0X.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>J(()=>import(`./cue-ScBFXY5f.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>J(()=>import(`./cypher-CGStaC1X.js`),[]))},{id:`d`,name:`D`,import:(()=>J(()=>import(`./d-CuTCIvnX.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>J(()=>import(`./dart-CqEodbm2.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>J(()=>import(`./dax-UdE5S0Dh.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>J(()=>import(`./desktop-DfmsfHJA.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>J(()=>import(`./diff-CW0RWGd9.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>J(()=>import(`./docker-B1qtW4ha.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>J(()=>import(`./dotenv-BUzOh1k8.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>J(()=>import(`./dream-maker-CBvk18nW.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>J(()=>import(`./edge-Ch_PYBsB.js`),__vite__mapDeps([29,15,1,2,3,13])))},{id:`elixir`,name:`Elixir`,import:(()=>J(()=>import(`./elixir-DEJrJATq.js`),__vite__mapDeps([30,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>J(()=>import(`./elm-Brlko4-d.js`),__vite__mapDeps([31,24,25])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>J(()=>import(`./emacs-lisp-DvSgLhDc.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>J(()=>import(`./erb-DQPphNua.js`),__vite__mapDeps([32,1,2,3,33,25,23,24,26,16,34,35,12,13,36,37,28,8,9,38])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>J(()=>import(`./erlang-cuhwpmsu.js`),__vite__mapDeps([39,40])))},{id:`fennel`,name:`Fennel`,import:(()=>J(()=>import(`./fennel-C-1kWlGf.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>J(()=>import(`./fish-CCpdtwqS.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>J(()=>import(`./fluent-BLg032oD.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>J(()=>import(`./fortran-fixed-form-DWr0EnJn.js`),__vite__mapDeps([41,42])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>J(()=>import(`./fortran-free-form-Br4jRtSc.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>J(()=>import(`./fsharp-CQ5iYSPA.js`),__vite__mapDeps([43,40])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>J(()=>import(`./gdresource-CN-lsNu5.js`),__vite__mapDeps([44,45,46])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>J(()=>import(`./gdscript-hSAZM1eh.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>J(()=>import(`./gdshader-D4XNAEs9.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>J(()=>import(`./genie-DmN-ICAN.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>J(()=>import(`./gherkin-cuHHmRcX.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>J(()=>import(`./git-commit-6e79eN7Q.js`),__vite__mapDeps([47,48])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>J(()=>import(`./git-rebase-BpS915SI.js`),__vite__mapDeps([49,28])))},{id:`gleam`,name:`Gleam`,import:(()=>J(()=>import(`./gleam-D8VhqPDN.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>J(()=>import(`./glimmer-js-DZDngVuD.js`),__vite__mapDeps([50,2,1,3,13])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>J(()=>import(`./glimmer-ts-DKNjJvyp.js`),__vite__mapDeps([51,2,1,3,13])))},{id:`glsl`,name:`GLSL`,import:(()=>J(()=>import(`./glsl-C-Y1tHoU.js`).then(e=>e.n),__vite__mapDeps([24,25])))},{id:`gn`,name:`GN`,import:(()=>J(()=>import(`./gn-BjGRlX27.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>J(()=>import(`./gnuplot-BZCXuE4q.js`),[]))},{id:`go`,name:`Go`,import:(()=>J(()=>import(`./go-BJpWXZEs.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>J(()=>import(`./graphql-DYVBNazO.js`).then(e=>e.n),__vite__mapDeps([34,3,35,12,13])))},{id:`groovy`,name:`Groovy`,import:(()=>J(()=>import(`./groovy-D9w3Dn-z.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>J(()=>import(`./hack-DewKAtLe.js`),__vite__mapDeps([52,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>J(()=>import(`./haml-CIA_AeXu.js`).then(e=>e.n),__vite__mapDeps([36,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>J(()=>import(`./handlebars-Bade6JXX.js`),__vite__mapDeps([53,2,1,3,38])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>J(()=>import(`./haskell-DqDdKEgk.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>J(()=>import(`./haxe-DMg0jS3a.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>J(()=>import(`./hcl-SZIZUK_X.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>J(()=>import(`./hjson-DF1VspiE.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>J(()=>import(`./hlsl-DPe9L0Dt.js`),[]))},{id:`html`,name:`HTML`,import:(()=>J(()=>import(`./html-C4hhbuGp.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>J(()=>import(`./html-derivative-BXfztBtv.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>J(()=>import(`./http-Cq90-CTl.js`),__vite__mapDeps([54,34,3,35,12,13,7,28,8,9])))},{id:`hurl`,name:`Hurl`,import:(()=>J(()=>import(`./hurl-DklQHYoa.js`),__vite__mapDeps([55,56,34,3,35,12,13,8,9])))},{id:`hxml`,name:`HXML`,import:(()=>J(()=>import(`./hxml-nwJci6H5.js`),__vite__mapDeps([57,58])))},{id:`hy`,name:`Hy`,import:(()=>J(()=>import(`./hy-B0f-B1mH.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>J(()=>import(`./imba-Bq3j1cW5.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>J(()=>import(`./ini-BayloP2U.js`),[]))},{id:`java`,name:`Java`,import:(()=>J(()=>import(`./java-BMUwLm1h.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>J(()=>import(`./javascript-B8nPCUVp.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>J(()=>import(`./jinja-CkxiRcB3.js`),__vite__mapDeps([59,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>J(()=>import(`./jison-CFnN5uQs.js`),__vite__mapDeps([60,3])))},{id:`json`,name:`JSON`,import:(()=>J(()=>import(`./json-B7HNnjIx.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>J(()=>import(`./json5-CRSfdIrY.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>J(()=>import(`./jsonc-y4g9DQPx.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>J(()=>import(`./jsonl-D2paVn9r.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>J(()=>import(`./jsonnet-CLH27mtz.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>J(()=>import(`./jssm-CPPYaqX-.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>J(()=>import(`./jsx-BfVPuW3i.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>J(()=>import(`./julia-Bj0ETGjT.js`),__vite__mapDeps([61,23,24,25,26,16,3,20,62])))},{id:`just`,name:`Just`,import:(()=>J(()=>import(`./just-CqIe_c9k.js`),__vite__mapDeps([63,3,64,2,1,16,8,9,20,33,25,23,24,26,34,35,12,13,36,37,28,38])))},{id:`kdl`,name:`KDL`,import:(()=>J(()=>import(`./kdl-D1BQjjnw.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>J(()=>import(`./kotlin-ndCaDnf0.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>J(()=>import(`./kusto-D-4nbkD3.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>J(()=>import(`./latex-Cvy8E64e.js`),__vite__mapDeps([65,66,62])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>J(()=>import(`./lean-YmtAsB0p.js`),[]))},{id:`less`,name:`Less`,import:(()=>J(()=>import(`./less-DyHub3ow.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>J(()=>import(`./liquid-x09l8QqE.js`),__vite__mapDeps([67,2,1,3,7])))},{id:`llvm`,name:`LLVM IR`,import:(()=>J(()=>import(`./llvm-DCcqrY0D.js`),[]))},{id:`log`,name:`Log file`,import:(()=>J(()=>import(`./log-DWAAMNbe.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>J(()=>import(`./logo-ClQMGkNL.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>J(()=>import(`./lua-BSlDLjt5.js`).then(e=>e.n),__vite__mapDeps([37,25])))},{id:`luau`,name:`Luau`,import:(()=>J(()=>import(`./luau-CmcXFvLt.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>J(()=>import(`./make-DcfJyUzm.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>J(()=>import(`./markdown-DXxotAxn.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>J(()=>import(`./marko-CoNMQlTn.js`),__vite__mapDeps([68,2,69,5,13])))},{id:`matlab`,name:`MATLAB`,import:(()=>J(()=>import(`./matlab-BlfbTznR.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>J(()=>import(`./mdc-BSzVESPu.js`),__vite__mapDeps([70,15,1,2,3,40,38])))},{id:`mdx`,name:`MDX`,import:(()=>J(()=>import(`./mdx-H8fyPQd8.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>J(()=>import(`./mermaid-CWAV2dmV.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>J(()=>import(`./mipsasm-BWYFAm2s.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>J(()=>import(`./mojo-DZcPJEIN.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>J(()=>import(`./moonbit-6eslNlJL.js`),[]))},{id:`move`,name:`Move`,import:(()=>J(()=>import(`./move-DxFc9-QU.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>J(()=>import(`./narrat-gv38dJOT.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>J(()=>import(`./nextflow-DSfydIxt.js`),__vite__mapDeps([71,72])))},{id:`nextflow-groovy`,name:`nextflow-groovy`,import:(()=>J(()=>import(`./nextflow-groovy-DV4H3hok.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>J(()=>import(`./nginx-CBhJTj0i.js`),__vite__mapDeps([73,37,25])))},{id:`nim`,name:`Nim`,import:(()=>J(()=>import(`./nim-CtHbOBlO.js`),__vite__mapDeps([74,25,2,24,1,3,40,8,9])))},{id:`nix`,name:`Nix`,import:(()=>J(()=>import(`./nix-NlOz3HGM.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>J(()=>import(`./nushell-D86Z8aFF.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>J(()=>import(`./objective-c-iuJvUjCv.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>J(()=>import(`./objective-cpp-C62JvfMT.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>J(()=>import(`./ocaml-Rbryo9lg.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>J(()=>import(`./odin-CfaOVNP_.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>J(()=>import(`./openscad-DCRhgheK.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>J(()=>import(`./pascal-CTesTHtV.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>J(()=>import(`./perl-DLMzG3tu.js`),__vite__mapDeps([64,2,1,3,16,8,9])))},{id:`php`,name:`PHP`,import:(()=>J(()=>import(`./php-KomVR3Hz.js`),__vite__mapDeps([75,2,1,3,7,16,8,9])))},{id:`pkl`,name:`Pkl`,import:(()=>J(()=>import(`./pkl-BjUMjQkt.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>J(()=>import(`./plsql-BgKEZSSo.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>J(()=>import(`./po-C5s_CVt8.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>J(()=>import(`./polar-y4hX8qM0.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>J(()=>import(`./postcss-BHCm7Qae.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>J(()=>import(`./powerquery-C2vMt8aZ.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>J(()=>import(`./powershell-DEcjmg1c.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>J(()=>import(`./prisma-Ba-Tcxy5.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>J(()=>import(`./prolog-B4o261Jv.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>J(()=>import(`./proto-o3IZKiMR.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>J(()=>import(`./pug-T4SRLx8P.js`),__vite__mapDeps([76,2,1,3])))},{id:`puppet`,name:`Puppet`,import:(()=>J(()=>import(`./puppet-BC0dqZ31.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>J(()=>import(`./purescript-CLDw1y5G.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>J(()=>import(`./python-D1NFioGW.js`),[]))},{id:`qml`,name:`QML`,import:(()=>J(()=>import(`./qml-DJdSRUmU.js`),__vite__mapDeps([77,3])))},{id:`qmldir`,name:`QML Directory`,import:(()=>J(()=>import(`./qmldir-B7i9e9Vn.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>J(()=>import(`./qss-DIe6oKX8.js`),[]))},{id:`r`,name:`R`,import:(()=>J(()=>import(`./r-CwuTg9lK.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>J(()=>import(`./racket-CAOC_yyk.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>J(()=>import(`./raku-Ccua3vW6.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>J(()=>import(`./razor-Ch4dgsGY.js`),__vite__mapDeps([78,79,1,2,3])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>J(()=>import(`./reg-CAYZT9kE.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>J(()=>import(`./regexp-D2GTwJE0.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>J(()=>import(`./rel-cvB6F5nO.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>J(()=>import(`./riscv-SYGtE4EN.js`),[]))},{id:`ron`,name:`RON`,import:(()=>J(()=>import(`./ron-CRt869SB.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>J(()=>import(`./rosmsg-BwrfJ66Z.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>J(()=>import(`./rst-D78f0DyR.js`),__vite__mapDeps([80,81,23,24,25,26,16,15,1,2,3,20,33,34,35,12,13,36,37,28,8,9,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>J(()=>import(`./ruby-BUcw6ITs.js`),__vite__mapDeps([33,25,23,24,26,16,2,34,3,35,12,13,36,1,37,28,8,9,38])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>J(()=>import(`./rust-DCKTTPxN.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>J(()=>import(`./sas-DoT2JDsj.js`),__vite__mapDeps([82,16])))},{id:`sass`,name:`Sass`,import:(()=>J(()=>import(`./sass-CorcwySt.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>J(()=>import(`./scala-DlI-OmYj.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>J(()=>import(`./scheme-CcNEGkZH.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>J(()=>import(`./scss-B6G_d-6b.js`).then(e=>e.n),__vite__mapDeps([5,2])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>J(()=>import(`./sdbl-AL_m-RO_.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>J(()=>import(`./shaderlab-CbbQwRPF.js`),__vite__mapDeps([83,84])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>J(()=>import(`./shellscript-DI252Bga.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>J(()=>import(`./shellsession-BuO_s8FQ.js`),__vite__mapDeps([85,28])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>J(()=>import(`./smalltalk-Y2ogrfbk.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>J(()=>import(`./solidity-Bfbm9QZQ.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>J(()=>import(`./soy-DZTZJTEE.js`),__vite__mapDeps([86,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>J(()=>import(`./sparql-DEoxFJ5d.js`),__vite__mapDeps([87,88])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>J(()=>import(`./splunk-6DJA2XFa.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>J(()=>import(`./sql-C4isoJr_.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>J(()=>import(`./ssh-config-CbQtdF-u.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>J(()=>import(`./stata-Dhu6qITh.js`),__vite__mapDeps([89,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>J(()=>import(`./stylus-B_iq45Sj.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>J(()=>import(`./surrealql-CSDpq5j3.js`),__vite__mapDeps([90,3])))},{id:`svelte`,name:`Svelte`,import:(()=>J(()=>import(`./svelte-C4ITAvxr.js`),__vite__mapDeps([91,2,3,11,13])))},{id:`swift`,name:`Swift`,import:(()=>J(()=>import(`./swift-C7KIgN-p.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>J(()=>import(`./system-verilog-C3G9wERd.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>J(()=>import(`./systemd-CwxGrojj.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>J(()=>import(`./talonscript-DqnSo1EO.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>J(()=>import(`./tasl-T8ethp86.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>J(()=>import(`./tcl-Ccl366o0.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>J(()=>import(`./templ-BTgKA9-7.js`),__vite__mapDeps([92,2,93,3])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>J(()=>import(`./terraform-BBf6ZI_0.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>J(()=>import(`./tex-Dg4N9ndP.js`),__vite__mapDeps([66,62])))},{id:`toml`,name:`TOML`,import:(()=>J(()=>import(`./toml-C5Z_BR4r.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>J(()=>import(`./ts-tags-BufYnYos.js`),__vite__mapDeps([94,2,24,25,1,3,16,13,8,9])))},{id:`tsv`,name:`TSV`,import:(()=>J(()=>import(`./tsv-rX8sUJs7.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>J(()=>import(`./tsx-DmkFP0sw.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>J(()=>import(`./turtle-BM-MG8WY.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>J(()=>import(`./twig-BJv_IWYK.js`),__vite__mapDeps([95,2,3,75,1,7,16,8,9,20,33,25,23,24,26,34,35,12,13,36,37,28,38,5])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>J(()=>import(`./typescript-BKp05Qme.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>J(()=>import(`./typespec-C5gKydvR.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>J(()=>import(`./typst--_5VchrY.js`),[]))},{id:`v`,name:`V`,import:(()=>J(()=>import(`./v-C6PwpmTC.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>J(()=>import(`./vala-4pTaceSj.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>J(()=>import(`./vb-DhoR5A6S.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>J(()=>import(`./verilog-B9f_1lPn.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>J(()=>import(`./vhdl-Cy4RAmOe.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>J(()=>import(`./viml-CFQW-CcD.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>J(()=>import(`./vue-BsHXCXzh.js`),__vite__mapDeps([96,2,15,1,3,7,13])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>J(()=>import(`./vue-html-CCsH-lmo.js`),__vite__mapDeps([97,3])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>J(()=>import(`./vue-vine-B5P1JXxo.js`),__vite__mapDeps([98,2,3,69,11,5,99])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>J(()=>import(`./vyper-BW5zj9bE.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>J(()=>import(`./wasm-BigxSLnm.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>J(()=>import(`./wenyan-BZzM1SQT.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>J(()=>import(`./wgsl-xBPHbLlq.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>J(()=>import(`./wikitext-BXJWUNJK.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>J(()=>import(`./wit-2GnUs67P.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>J(()=>import(`./wolfram-DIFDmw-g.js`),[]))},{id:`xml`,name:`XML`,import:(()=>J(()=>import(`./xml-CFkhYff0.js`).then(e=>e.n),__vite__mapDeps([8,9])))},{id:`xsl`,name:`XSL`,import:(()=>J(()=>import(`./xsl-Dc5XRzm6.js`),__vite__mapDeps([100,8,9])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>J(()=>import(`./yaml-BTCCxCxi.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>J(()=>import(`./zenscript-DQaUUjbx.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>J(()=>import(`./zig-BDepRvBi.js`),[]))}],Sc=Object.fromEntries(xc.map(e=>[e.id,e.import])),Cc=Object.fromEntries(xc.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),wc={...Sc,...Cc},Tc=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>J(()=>import(`./andromeeda-Ch2kWS7s.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>J(()=>import(`./aurora-x-BHLqzt7j.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>J(()=>import(`./ayu-dark-DCotN_ZT.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>J(()=>import(`./ayu-light-CKB6o_im.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>J(()=>import(`./ayu-mirage-B38lW-C5.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-frappe-BY_2ofjk.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>J(()=>import(`./catppuccin-latte-D6GXPBmA.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-macchiato-BuW8_cyo.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-mocha-znex9DPe.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>J(()=>import(`./dark-plus-BvePH-r3.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>J(()=>import(`./dracula-kJQjC_Gy.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>J(()=>import(`./dracula-soft-B3XhEjCl.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>J(()=>import(`./everforest-dark-u0zLn75q.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>J(()=>import(`./everforest-light-D3syIoAR.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>J(()=>import(`./github-dark-CEBLh0--.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>J(()=>import(`./github-dark-default-Dq0Z4Xai.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>J(()=>import(`./github-dark-dimmed-D90YmS4w.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>J(()=>import(`./github-dark-high-contrast-B6BWv1iC.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>J(()=>import(`./github-light-lXSVSq5T.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>J(()=>import(`./github-light-default-DsPWmj4v.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>J(()=>import(`./github-light-high-contrast-C7aLb3kp.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-hard-_deksD0U.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-medium-CT31284j.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-soft-BZuEUCbj.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-hard-dxv4n_ZS.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-medium-BsW_fVfR.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-soft-BiGy99gD.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>J(()=>import(`./horizon-Ngud75Kn.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`dark`,import:(()=>J(()=>import(`./horizon-bright-Cnljd0XD.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>J(()=>import(`./houston-BenZxlMr.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>J(()=>import(`./kanagawa-dragon-Bt5mhLu1.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>J(()=>import(`./kanagawa-lotus-FGA3pRJk.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>J(()=>import(`./kanagawa-wave-DnLVZPAD.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>J(()=>import(`./laserwave-D2qAZkaG.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>J(()=>import(`./light-plus-CP13QUvm.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>J(()=>import(`./material-theme-JFoPTBSr.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>J(()=>import(`./material-theme-darker-BHaqZ19v.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>J(()=>import(`./material-theme-lighter-CGnnS2bs.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>J(()=>import(`./material-theme-ocean-Drhewjqf.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>J(()=>import(`./material-theme-palenight-DbUypmpb.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>J(()=>import(`./min-dark-BEelvXUB.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>J(()=>import(`./min-light-CTPBOACR.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>J(()=>import(`./monokai-DQlZXbkg.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>J(()=>import(`./night-owl-BLcrYhaC.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>J(()=>import(`./night-owl-light-BG-tBJOz.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>J(()=>import(`./nord-Dm2F5_QB.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>J(()=>import(`./one-dark-pro-DC9SHdX0.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>J(()=>import(`./one-light-Doo39p0H.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>J(()=>import(`./plastic-B3CcSpon.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>J(()=>import(`./poimandres-BsK70ma5.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>J(()=>import(`./red-DtDH206x.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>J(()=>import(`./rose-pine-CjBfSJ5b.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>J(()=>import(`./rose-pine-dawn-C0xwy7iJ.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>J(()=>import(`./rose-pine-moon-BSNy9Ty0.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>J(()=>import(`./slack-dark-rMhrfPm6.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>J(()=>import(`./slack-ochin-9w8X74hU.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>J(()=>import(`./snazzy-light-DHr9ygpP.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>J(()=>import(`./solarized-dark-UPcKev9Q.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>J(()=>import(`./solarized-light-DUsjROvl.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>J(()=>import(`./synthwave-84-lf_Wt0K_.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>J(()=>import(`./tokyo-night-BF5ata25.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>J(()=>import(`./vesper-CmBi_iCT.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>J(()=>import(`./vitesse-black-CE8RoBJP.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>J(()=>import(`./vitesse-dark-BpF142p_.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>J(()=>import(`./vitesse-light-CMwxPBrg.js`),[]))}].map(e=>[e.id,e.import])),Ec=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Dc(){return 2147483648}function Oc(){return typeof performance<`u`?performance.now():Date.now()}var kc=(e,t)=>e+(t-e%t)%t;async function Ac(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=Dc();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,kc(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:Oc,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var jc=Object.defineProperty,Mc=(e,t,n)=>t in e?jc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nc=(e,t,n)=>Mc(e,typeof t==`symbol`?t:t+``,n),Pc=null;function Fc(e){throw new Ec(e.UTF8ToString(e.getLastOnigError()))}var Ic=class e{constructor(t){Nc(this,`utf16Length`),Nc(this,`utf8Length`),Nc(this,`utf16Value`),Nc(this,`utf8Value`),Nc(this,`utf16OffsetToUtf8`),Nc(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},Lc=class e{constructor(t){if(Nc(this,`id`,++e.LAST_ID),Nc(this,`_onigBinding`),Nc(this,`content`),Nc(this,`utf16Length`),Nc(this,`utf8Length`),Nc(this,`utf16OffsetToUtf8`),Nc(this,`utf8OffsetToUtf16`),Nc(this,`ptr`),!Pc)throw new Ec(`Must invoke loadWasm first.`);this._onigBinding=Pc,this.content=t;let n=new Ic(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=Pc.omalloc(1e4),e._sharedPtrInUse=!0,Pc.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(Pc)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Nc(Lc,`LAST_ID`,0),Nc(Lc,`_sharedPtr`,0),Nc(Lc,`_sharedPtrInUse`,!1);var Rc=Lc,zc=class{constructor(e){if(Nc(this,`_onigBinding`),Nc(this,`_ptr`),!Pc)throw new Ec(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new Ic(e[r]);t[r]=i.createString(Pc),n[r]=i.utf8Length}let r=Pc.omalloc(4*e.length);Pc.HEAPU32.set(t,r/4);let i=Pc.omalloc(4*e.length);Pc.HEAPU32.set(n,i/4);let a=Pc.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)Pc.ofree(t[n]);Pc.ofree(i),Pc.ofree(r),a===0&&Fc(Pc),this._onigBinding=Pc,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new Rc(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function Bc(e){return typeof e.instantiator==`function`}function Vc(e){return typeof e.default==`function`}function Hc(e){return e.data!==void 0}function Uc(e){return typeof Response<`u`&&e instanceof Response}function Wc(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var Gc;function Kc(e){if(Gc)return Gc;async function t(){Pc=await Ac(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),Bc(n)?n=await n.instantiator(t):Vc(n)?n=await n.default(t):(Hc(n)&&(n=n.data),Uc(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await Jc(n)(t):await Yc(n)(t):Wc(n)||n instanceof WebAssembly.Module?n=await qc(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await qc(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return Gc=t(),Gc}function qc(e){return t=>WebAssembly.instantiate(e,t)}function Jc(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Yc(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function Xc(e){return e&&await Kc(e),{createScanner(e){return new zc(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new Rc(e)}}}var Zc=hc({langs:wc,themes:Tc,engine:()=>Xc(J(()=>import(`./wasm-CSccDuAq.js`),[]))}),{codeToHtml:Qc,codeToHast:$c,codeToTokens:el,codeToTokensBase:tl,codeToTokensWithThemes:nl,getSingletonHighlighter:rl,getLastGrammarState:il}=_c(Zc,{guessEmbeddedLanguages:ts});function al(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function ol(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var sl=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),cl=String.raw;function ll(e,t){if(e==null)throw Error(t??`Value expected`);return e}var ul=cl`\[\^?`,dl=`c.? | C(?:-.?)?|${cl`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${cl`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${cl`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${cl`o\{[^\}]*\}?`}|${cl`\d{1,3}`}`,fl=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,pl=new RegExp(cl`
|
|
21
|
+
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=cs(a.htmlStyle||ss(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&us(m,r),m}function qs(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&yr.Underline||i.fontStyle&yr.Strikethrough));o&&i.content.match(/^\s+$/)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function Js(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function Ys(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t[t.length-1],r=cs(e.htmlStyle||ss(e)),i=cs(n.htmlStyle||ss(n)),a=e.fontStyle&&(e.fontStyle&yr.Underline||e.fontStyle&yr.Strikethrough),o=n.fontStyle&&(n.fontStyle&yr.Underline||n.fontStyle&yr.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Xs=Vo;function Zs(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>Gs(e,t,n),codeToTokens:(t,n)=>Us(e,t,n)},i=Xs(Gs(e,t,n,r));for(let e of ys(n))i=e.postprocess?.call(r,i,n)||i;return i}var Qs={light:`#333333`,dark:`#bbbbbb`},$s={light:`#fffffe`,dark:`#1e1e1e`},ec=`__shiki_resolved`;function tc(e){if(e?.[ec])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?Qs.light:Qs.dark,n||=t.type===`light`?$s.light:$s.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,ec,{enumerable:!1,writable:!1,value:!0}),t}async function nc(e){return Array.from(new Set((await Promise.all(e.filter(e=>!Yo(e)).map(async e=>await qo(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function rc(e){return(await Promise.all(e.map(async e=>Zo(e)?null:tc(await qo(e))))).filter(e=>!!e)}var ic=3,ac=!1;function oc(e,t=3){if(ic&&!(typeof ic==`number`&&t>ic)){if(ac)throw Error(`[SHIKI DEPRECATE]: ${e}`);console.trace(`[SHIKI DEPRECATE]: ${e}`)}}var sc=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function cc(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new sc(`Circular alias \`${Array.from(n).join(` -> `)} -> ${e}\``);n.add(e)}}return e}var lc=class extends Pi{constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=tc(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=fr.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=cc(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=Array.from(this._langGraph.entries()),n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new sc(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},uc=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},dc=0;function fc(e){dc+=1,e.warnings!==!1&&dc>=10&&dc%10==0&&console.warn(`[Shiki] ${dc} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new sc("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(tc),i=new lc(new uc(e.engine,n),r,n,e.langAlias),a;function o(t){return cc(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new sc(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new sc(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await nc(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await rc(e))}function g(){if(t)throw new sc(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--dc)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function pc(e){e.engine||oc("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([rc(e.themes||[]),nc(e.langs||[]),e.engine]);return fc({...e,themes:t,langs:n,engine:r})}async function mc(e){let t=await pc(e);return{getLastGrammarState:(...e)=>Ns(t,...e),codeToTokensBase:(e,n)=>Ms(t,e,n),codeToTokensWithThemes:(e,n)=>Vs(t,e,n),codeToTokens:(e,n)=>Us(t,e,n),codeToHast:(e,n)=>Gs(t,e,n),codeToHtml:(e,n)=>Zs(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function hc(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,Yo(n))return[];let r=t[n];if(!r)throw new Qn(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(Zo(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new Qn(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await mc({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function gc(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}else{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function _c(e,t){let n=gc(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var vc=`modulepreload`,yc=function(e){return`/`+e},bc={},J=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=yc(t,n),t in bc)return;bc[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:vc,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},xc=[{id:`abap`,name:`ABAP`,import:(()=>J(()=>import(`./abap-cWYhO34H.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>J(()=>import(`./actionscript-3-B80ndJsD.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>J(()=>import(`./ada-C0C0SoYB.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>J(()=>import(`./angular-html-BENRjrvE.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>J(()=>import(`./angular-ts-BkliueKG.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>J(()=>import(`./apache-DBwBm4bB.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>J(()=>import(`./apex-FcV7UxQi.js`),[]))},{id:`apl`,name:`APL`,import:(()=>J(()=>import(`./apl-KTyp4w2D.js`),__vite__mapDeps([6,2,1,3,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>J(()=>import(`./applescript-hQs8VNpS.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>J(()=>import(`./ara-BOadBOZg.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>J(()=>import(`./asciidoc-BsfqiBck.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>J(()=>import(`./asm-C2vUqzqz.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>J(()=>import(`./astro-yRj4to-g.js`),__vite__mapDeps([10,2,3,7,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>J(()=>import(`./awk-D4e-eeZT.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>J(()=>import(`./ballerina-BzvFqbha.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>J(()=>import(`./bat-CFyw2ERn.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>J(()=>import(`./beancount-a6Gsu5WX.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>J(()=>import(`./berry-C2jyz4Ah.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>J(()=>import(`./bibtex-Dyet-B83.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>J(()=>import(`./bicep-CghvUIvy.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>J(()=>import(`./bird2-nHigvs-R.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>J(()=>import(`./blade-C9-yC6OZ.js`),__vite__mapDeps([14,2,15,1,3,7,16,8,9])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>J(()=>import(`./bsl-BrHd4RA2.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>J(()=>import(`./c-Ct9jvrYE.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>J(()=>import(`./c3-9ZrcmAmr.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>J(()=>import(`./cadence-BPDgYNWy.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>J(()=>import(`./cairo-BDZ6TRZS.js`),__vite__mapDeps([19,20])))},{id:`clarity`,name:`Clarity`,import:(()=>J(()=>import(`./clarity-Cmao5KSK.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>J(()=>import(`./clojure-D2dPuTkk.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>J(()=>import(`./cmake-DaqQuj4A.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>J(()=>import(`./cobol-DsFmMC48.js`),__vite__mapDeps([21,1,2,3,9])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>J(()=>import(`./codeowners-B748jmvc.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>J(()=>import(`./codeql-CXb_8gHR.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>J(()=>import(`./coffee-C2yB8Qe3.js`),__vite__mapDeps([22,3])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>J(()=>import(`./common-lisp-UZn9nc_5.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>J(()=>import(`./coq-DtO6yBIf.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>J(()=>import(`./cpp-BaQo5sKT.js`).then(e=>e.n),__vite__mapDeps([23,24,25,26,16])))},{id:`crystal`,name:`Crystal`,import:(()=>J(()=>import(`./crystal-DqA_S2VB.js`),__vite__mapDeps([27,25,2,1,3,28,16])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>J(()=>import(`./csharp-C3YlYcLV.js`),[]))},{id:`css`,name:`CSS`,import:(()=>J(()=>import(`./css-Dx2FXpZT.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>J(()=>import(`./csv-BBwiVr0X.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>J(()=>import(`./cue-ScBFXY5f.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>J(()=>import(`./cypher-CGStaC1X.js`),[]))},{id:`d`,name:`D`,import:(()=>J(()=>import(`./d-CuTCIvnX.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>J(()=>import(`./dart-CqEodbm2.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>J(()=>import(`./dax-UdE5S0Dh.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>J(()=>import(`./desktop-DfmsfHJA.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>J(()=>import(`./diff-CW0RWGd9.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>J(()=>import(`./docker-B1qtW4ha.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>J(()=>import(`./dotenv-BUzOh1k8.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>J(()=>import(`./dream-maker-CBvk18nW.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>J(()=>import(`./edge-CQpty0x5.js`),__vite__mapDeps([29,15,1,2,3,13])))},{id:`elixir`,name:`Elixir`,import:(()=>J(()=>import(`./elixir-BcaGdZXN.js`),__vite__mapDeps([30,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>J(()=>import(`./elm-CP76VjNp.js`),__vite__mapDeps([31,24,25])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>J(()=>import(`./emacs-lisp-DvSgLhDc.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>J(()=>import(`./erb-5-RC0m2F.js`),__vite__mapDeps([32,1,2,3,33,25,23,24,26,16,34,35,12,13,36,37,28,8,9,38])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>J(()=>import(`./erlang-cuhwpmsu.js`),__vite__mapDeps([39,40])))},{id:`fennel`,name:`Fennel`,import:(()=>J(()=>import(`./fennel-C-1kWlGf.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>J(()=>import(`./fish-CCpdtwqS.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>J(()=>import(`./fluent-BLg032oD.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>J(()=>import(`./fortran-fixed-form-DWr0EnJn.js`),__vite__mapDeps([41,42])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>J(()=>import(`./fortran-free-form-Br4jRtSc.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>J(()=>import(`./fsharp-CQ5iYSPA.js`),__vite__mapDeps([43,40])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>J(()=>import(`./gdresource-CN-lsNu5.js`),__vite__mapDeps([44,45,46])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>J(()=>import(`./gdscript-hSAZM1eh.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>J(()=>import(`./gdshader-D4XNAEs9.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>J(()=>import(`./genie-DmN-ICAN.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>J(()=>import(`./gherkin-cuHHmRcX.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>J(()=>import(`./git-commit-6e79eN7Q.js`),__vite__mapDeps([47,48])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>J(()=>import(`./git-rebase-Bqj-6hRc.js`),__vite__mapDeps([49,28])))},{id:`gleam`,name:`Gleam`,import:(()=>J(()=>import(`./gleam-D8VhqPDN.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>J(()=>import(`./glimmer-js-B9DDu9wr.js`),__vite__mapDeps([50,2,1,3,13])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>J(()=>import(`./glimmer-ts-C67nh0lS.js`),__vite__mapDeps([51,2,1,3,13])))},{id:`glsl`,name:`GLSL`,import:(()=>J(()=>import(`./glsl-4_qCLsUA.js`).then(e=>e.n),__vite__mapDeps([24,25])))},{id:`gn`,name:`GN`,import:(()=>J(()=>import(`./gn-BjGRlX27.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>J(()=>import(`./gnuplot-BZCXuE4q.js`),[]))},{id:`go`,name:`Go`,import:(()=>J(()=>import(`./go-BJpWXZEs.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>J(()=>import(`./graphql-BPnYvj3r.js`).then(e=>e.n),__vite__mapDeps([34,3,35,12,13])))},{id:`groovy`,name:`Groovy`,import:(()=>J(()=>import(`./groovy-D9w3Dn-z.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>J(()=>import(`./hack-lddqozaa.js`),__vite__mapDeps([52,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>J(()=>import(`./haml-ap0ZMUQp.js`).then(e=>e.n),__vite__mapDeps([36,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>J(()=>import(`./handlebars-DzkaM9As.js`),__vite__mapDeps([53,2,1,3,38])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>J(()=>import(`./haskell-DqDdKEgk.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>J(()=>import(`./haxe-DMg0jS3a.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>J(()=>import(`./hcl-SZIZUK_X.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>J(()=>import(`./hjson-DF1VspiE.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>J(()=>import(`./hlsl-DPe9L0Dt.js`),[]))},{id:`html`,name:`HTML`,import:(()=>J(()=>import(`./html-CokHrq1C.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>J(()=>import(`./html-derivative-C_RIVbdg.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>J(()=>import(`./http-Ch6kOrN2.js`),__vite__mapDeps([54,34,3,35,12,13,7,28,8,9])))},{id:`hurl`,name:`Hurl`,import:(()=>J(()=>import(`./hurl-C10trGis.js`),__vite__mapDeps([55,56,34,3,35,12,13,8,9])))},{id:`hxml`,name:`HXML`,import:(()=>J(()=>import(`./hxml-nwJci6H5.js`),__vite__mapDeps([57,58])))},{id:`hy`,name:`Hy`,import:(()=>J(()=>import(`./hy-B0f-B1mH.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>J(()=>import(`./imba-Bq3j1cW5.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>J(()=>import(`./ini-BayloP2U.js`),[]))},{id:`java`,name:`Java`,import:(()=>J(()=>import(`./java-CRDLxWFu.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>J(()=>import(`./javascript-BJrijFXZ.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>J(()=>import(`./jinja-Dq3vAj4T.js`),__vite__mapDeps([59,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>J(()=>import(`./jison-PSOWkXj1.js`),__vite__mapDeps([60,3])))},{id:`json`,name:`JSON`,import:(()=>J(()=>import(`./json-Ue4paT4d.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>J(()=>import(`./json5-CRSfdIrY.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>J(()=>import(`./jsonc-y4g9DQPx.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>J(()=>import(`./jsonl-D2paVn9r.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>J(()=>import(`./jsonnet-CLH27mtz.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>J(()=>import(`./jssm-CPPYaqX-.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>J(()=>import(`./jsx-D60Fd_vz.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>J(()=>import(`./julia-7UqDDEkb.js`),__vite__mapDeps([61,23,24,25,26,16,3,20,62])))},{id:`just`,name:`Just`,import:(()=>J(()=>import(`./just-2Nqw-G9g.js`),__vite__mapDeps([63,3,64,2,1,16,8,9,20,33,25,23,24,26,34,35,12,13,36,37,28,38])))},{id:`kdl`,name:`KDL`,import:(()=>J(()=>import(`./kdl-D1BQjjnw.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>J(()=>import(`./kotlin-ndCaDnf0.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>J(()=>import(`./kusto-D-4nbkD3.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>J(()=>import(`./latex-CAORCICD.js`),__vite__mapDeps([65,66,62])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>J(()=>import(`./lean-YmtAsB0p.js`),[]))},{id:`less`,name:`Less`,import:(()=>J(()=>import(`./less-DyHub3ow.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>J(()=>import(`./liquid-B1dMHpLg.js`),__vite__mapDeps([67,2,1,3,7])))},{id:`llvm`,name:`LLVM IR`,import:(()=>J(()=>import(`./llvm-DCcqrY0D.js`),[]))},{id:`log`,name:`Log file`,import:(()=>J(()=>import(`./log-DWAAMNbe.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>J(()=>import(`./logo-ClQMGkNL.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>J(()=>import(`./lua-CVg9faio.js`).then(e=>e.n),__vite__mapDeps([37,25])))},{id:`luau`,name:`Luau`,import:(()=>J(()=>import(`./luau-CmcXFvLt.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>J(()=>import(`./make-DcfJyUzm.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>J(()=>import(`./markdown-DXxotAxn.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>J(()=>import(`./marko-CIj0-gvZ.js`),__vite__mapDeps([68,2,69,5,13])))},{id:`matlab`,name:`MATLAB`,import:(()=>J(()=>import(`./matlab-BlfbTznR.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>J(()=>import(`./mdc-Dcm42qXg.js`),__vite__mapDeps([70,15,1,2,3,40,38])))},{id:`mdx`,name:`MDX`,import:(()=>J(()=>import(`./mdx-H8fyPQd8.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>J(()=>import(`./mermaid-CWAV2dmV.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>J(()=>import(`./mipsasm-BWYFAm2s.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>J(()=>import(`./mojo-DZcPJEIN.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>J(()=>import(`./moonbit-6eslNlJL.js`),[]))},{id:`move`,name:`Move`,import:(()=>J(()=>import(`./move-DxFc9-QU.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>J(()=>import(`./narrat-gv38dJOT.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>J(()=>import(`./nextflow-DSfydIxt.js`),__vite__mapDeps([71,72])))},{id:`nextflow-groovy`,name:`nextflow-groovy`,import:(()=>J(()=>import(`./nextflow-groovy-DV4H3hok.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>J(()=>import(`./nginx-zzgwPZum.js`),__vite__mapDeps([73,37,25])))},{id:`nim`,name:`Nim`,import:(()=>J(()=>import(`./nim-Au_jXrfv.js`),__vite__mapDeps([74,25,2,24,1,3,40,8,9])))},{id:`nix`,name:`Nix`,import:(()=>J(()=>import(`./nix-NlOz3HGM.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>J(()=>import(`./nushell-D86Z8aFF.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>J(()=>import(`./objective-c-iuJvUjCv.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>J(()=>import(`./objective-cpp-C62JvfMT.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>J(()=>import(`./ocaml-Rbryo9lg.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>J(()=>import(`./odin-CfaOVNP_.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>J(()=>import(`./openscad-DCRhgheK.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>J(()=>import(`./pascal-CTesTHtV.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>J(()=>import(`./perl-CAllCqkR.js`),__vite__mapDeps([64,2,1,3,16,8,9])))},{id:`php`,name:`PHP`,import:(()=>J(()=>import(`./php-CgM1w-IE.js`),__vite__mapDeps([75,2,1,3,7,16,8,9])))},{id:`pkl`,name:`Pkl`,import:(()=>J(()=>import(`./pkl-BjUMjQkt.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>J(()=>import(`./plsql-BgKEZSSo.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>J(()=>import(`./po-C5s_CVt8.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>J(()=>import(`./polar-y4hX8qM0.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>J(()=>import(`./postcss-BHCm7Qae.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>J(()=>import(`./powerquery-C2vMt8aZ.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>J(()=>import(`./powershell-DEcjmg1c.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>J(()=>import(`./prisma-Ba-Tcxy5.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>J(()=>import(`./prolog-B4o261Jv.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>J(()=>import(`./proto-o3IZKiMR.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>J(()=>import(`./pug-uy7R6gmf.js`),__vite__mapDeps([76,2,1,3])))},{id:`puppet`,name:`Puppet`,import:(()=>J(()=>import(`./puppet-BC0dqZ31.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>J(()=>import(`./purescript-CLDw1y5G.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>J(()=>import(`./python-D1NFioGW.js`),[]))},{id:`qml`,name:`QML`,import:(()=>J(()=>import(`./qml-XvGkfj7l.js`),__vite__mapDeps([77,3])))},{id:`qmldir`,name:`QML Directory`,import:(()=>J(()=>import(`./qmldir-B7i9e9Vn.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>J(()=>import(`./qss-DIe6oKX8.js`),[]))},{id:`r`,name:`R`,import:(()=>J(()=>import(`./r-DFRLw0D7.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>J(()=>import(`./racket-CAOC_yyk.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>J(()=>import(`./raku-Ccua3vW6.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>J(()=>import(`./razor-e63ackHA.js`),__vite__mapDeps([78,79,1,2,3])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>J(()=>import(`./reg-CAYZT9kE.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>J(()=>import(`./regexp-BmysD-wZ.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>J(()=>import(`./rel-cvB6F5nO.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>J(()=>import(`./riscv-SYGtE4EN.js`),[]))},{id:`ron`,name:`RON`,import:(()=>J(()=>import(`./ron-CRt869SB.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>J(()=>import(`./rosmsg-BwrfJ66Z.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>J(()=>import(`./rst-BdbFuh_U.js`),__vite__mapDeps([80,81,23,24,25,26,16,15,1,2,3,20,33,34,35,12,13,36,37,28,8,9,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>J(()=>import(`./ruby-CSdAL4us.js`),__vite__mapDeps([33,25,23,24,26,16,2,34,3,35,12,13,36,1,37,28,8,9,38])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>J(()=>import(`./rust-DCKTTPxN.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>J(()=>import(`./sas-JtqALwix.js`),__vite__mapDeps([82,16])))},{id:`sass`,name:`Sass`,import:(()=>J(()=>import(`./sass-CorcwySt.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>J(()=>import(`./scala-DlI-OmYj.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>J(()=>import(`./scheme-CcNEGkZH.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>J(()=>import(`./scss-BKQrDG10.js`).then(e=>e.n),__vite__mapDeps([5,2])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>J(()=>import(`./sdbl-AL_m-RO_.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>J(()=>import(`./shaderlab-CbbQwRPF.js`),__vite__mapDeps([83,84])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>J(()=>import(`./shellscript-jk-NKrK3.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>J(()=>import(`./shellsession-C_OxJCjJ.js`),__vite__mapDeps([85,28])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>J(()=>import(`./smalltalk-Y2ogrfbk.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>J(()=>import(`./solidity-Bfbm9QZQ.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>J(()=>import(`./soy-6C-zhFL7.js`),__vite__mapDeps([86,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>J(()=>import(`./sparql-DEoxFJ5d.js`),__vite__mapDeps([87,88])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>J(()=>import(`./splunk-6DJA2XFa.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>J(()=>import(`./sql-N-x_YojG.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>J(()=>import(`./ssh-config-CbQtdF-u.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>J(()=>import(`./stata-Dkub6QBh.js`),__vite__mapDeps([89,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>J(()=>import(`./stylus-B_iq45Sj.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>J(()=>import(`./surrealql-2pOLFG_P.js`),__vite__mapDeps([90,3])))},{id:`svelte`,name:`Svelte`,import:(()=>J(()=>import(`./svelte-CuvADzyi.js`),__vite__mapDeps([91,2,3,11,13])))},{id:`swift`,name:`Swift`,import:(()=>J(()=>import(`./swift-C7KIgN-p.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>J(()=>import(`./system-verilog-C3G9wERd.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>J(()=>import(`./systemd-CwxGrojj.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>J(()=>import(`./talonscript-DqnSo1EO.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>J(()=>import(`./tasl-T8ethp86.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>J(()=>import(`./tcl-Ccl366o0.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>J(()=>import(`./templ-DtOxTonk.js`),__vite__mapDeps([92,2,93,3])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>J(()=>import(`./terraform-BBf6ZI_0.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>J(()=>import(`./tex-BwPRGOZW.js`),__vite__mapDeps([66,62])))},{id:`toml`,name:`TOML`,import:(()=>J(()=>import(`./toml-C5Z_BR4r.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>J(()=>import(`./ts-tags-Cn_Y5EDf.js`),__vite__mapDeps([94,2,24,25,1,3,16,13,8,9])))},{id:`tsv`,name:`TSV`,import:(()=>J(()=>import(`./tsv-rX8sUJs7.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>J(()=>import(`./tsx-RC8FAazO.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>J(()=>import(`./turtle-BM-MG8WY.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>J(()=>import(`./twig-DtQFIjP0.js`),__vite__mapDeps([95,2,3,75,1,7,16,8,9,20,33,25,23,24,26,34,35,12,13,36,37,28,38,5])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>J(()=>import(`./typescript-DX6qUod4.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>J(()=>import(`./typespec-C5gKydvR.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>J(()=>import(`./typst--_5VchrY.js`),[]))},{id:`v`,name:`V`,import:(()=>J(()=>import(`./v-C6PwpmTC.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>J(()=>import(`./vala-4pTaceSj.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>J(()=>import(`./vb-DhoR5A6S.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>J(()=>import(`./verilog-B9f_1lPn.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>J(()=>import(`./vhdl-Cy4RAmOe.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>J(()=>import(`./viml-CFQW-CcD.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>J(()=>import(`./vue-D8H1bCQ7.js`),__vite__mapDeps([96,2,15,1,3,7,13])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>J(()=>import(`./vue-html-B0YmCSWB.js`),__vite__mapDeps([97,3])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>J(()=>import(`./vue-vine-Buj2gfKi.js`),__vite__mapDeps([98,2,3,69,11,5,99])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>J(()=>import(`./vyper-BW5zj9bE.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>J(()=>import(`./wasm-BigxSLnm.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>J(()=>import(`./wenyan-BZzM1SQT.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>J(()=>import(`./wgsl-xBPHbLlq.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>J(()=>import(`./wikitext-BXJWUNJK.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>J(()=>import(`./wit-2GnUs67P.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>J(()=>import(`./wolfram-DIFDmw-g.js`),[]))},{id:`xml`,name:`XML`,import:(()=>J(()=>import(`./xml-KzFmzaXc.js`).then(e=>e.n),__vite__mapDeps([8,9])))},{id:`xsl`,name:`XSL`,import:(()=>J(()=>import(`./xsl-x0R4ZCXO.js`),__vite__mapDeps([100,8,9])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>J(()=>import(`./yaml-BCE-GuGS.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>J(()=>import(`./zenscript-DQaUUjbx.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>J(()=>import(`./zig-BDepRvBi.js`),[]))}],Sc=Object.fromEntries(xc.map(e=>[e.id,e.import])),Cc=Object.fromEntries(xc.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),wc={...Sc,...Cc},Tc=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>J(()=>import(`./andromeeda-Ch2kWS7s.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>J(()=>import(`./aurora-x-BHLqzt7j.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>J(()=>import(`./ayu-dark-DCotN_ZT.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>J(()=>import(`./ayu-light-CKB6o_im.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>J(()=>import(`./ayu-mirage-B38lW-C5.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-frappe-BY_2ofjk.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>J(()=>import(`./catppuccin-latte-D6GXPBmA.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-macchiato-BuW8_cyo.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-mocha-znex9DPe.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>J(()=>import(`./dark-plus-BvePH-r3.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>J(()=>import(`./dracula-kJQjC_Gy.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>J(()=>import(`./dracula-soft-B3XhEjCl.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>J(()=>import(`./everforest-dark-u0zLn75q.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>J(()=>import(`./everforest-light-D3syIoAR.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>J(()=>import(`./github-dark-CEBLh0--.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>J(()=>import(`./github-dark-default-Dq0Z4Xai.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>J(()=>import(`./github-dark-dimmed-D90YmS4w.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>J(()=>import(`./github-dark-high-contrast-B6BWv1iC.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>J(()=>import(`./github-light-lXSVSq5T.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>J(()=>import(`./github-light-default-DsPWmj4v.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>J(()=>import(`./github-light-high-contrast-C7aLb3kp.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-hard-_deksD0U.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-medium-CT31284j.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-soft-BZuEUCbj.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-hard-dxv4n_ZS.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-medium-BsW_fVfR.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-soft-BiGy99gD.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>J(()=>import(`./horizon-Ngud75Kn.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`dark`,import:(()=>J(()=>import(`./horizon-bright-Cnljd0XD.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>J(()=>import(`./houston-BenZxlMr.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>J(()=>import(`./kanagawa-dragon-Bt5mhLu1.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>J(()=>import(`./kanagawa-lotus-FGA3pRJk.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>J(()=>import(`./kanagawa-wave-DnLVZPAD.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>J(()=>import(`./laserwave-D2qAZkaG.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>J(()=>import(`./light-plus-CP13QUvm.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>J(()=>import(`./material-theme-JFoPTBSr.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>J(()=>import(`./material-theme-darker-BHaqZ19v.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>J(()=>import(`./material-theme-lighter-CGnnS2bs.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>J(()=>import(`./material-theme-ocean-Drhewjqf.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>J(()=>import(`./material-theme-palenight-DbUypmpb.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>J(()=>import(`./min-dark-BEelvXUB.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>J(()=>import(`./min-light-CTPBOACR.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>J(()=>import(`./monokai-DQlZXbkg.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>J(()=>import(`./night-owl-BLcrYhaC.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>J(()=>import(`./night-owl-light-BG-tBJOz.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>J(()=>import(`./nord-Dm2F5_QB.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>J(()=>import(`./one-dark-pro-DC9SHdX0.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>J(()=>import(`./one-light-Doo39p0H.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>J(()=>import(`./plastic-B3CcSpon.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>J(()=>import(`./poimandres-BsK70ma5.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>J(()=>import(`./red-DtDH206x.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>J(()=>import(`./rose-pine-CjBfSJ5b.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>J(()=>import(`./rose-pine-dawn-C0xwy7iJ.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>J(()=>import(`./rose-pine-moon-BSNy9Ty0.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>J(()=>import(`./slack-dark-rMhrfPm6.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>J(()=>import(`./slack-ochin-9w8X74hU.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>J(()=>import(`./snazzy-light-DHr9ygpP.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>J(()=>import(`./solarized-dark-UPcKev9Q.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>J(()=>import(`./solarized-light-DUsjROvl.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>J(()=>import(`./synthwave-84-lf_Wt0K_.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>J(()=>import(`./tokyo-night-BF5ata25.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>J(()=>import(`./vesper-CmBi_iCT.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>J(()=>import(`./vitesse-black-CE8RoBJP.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>J(()=>import(`./vitesse-dark-BpF142p_.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>J(()=>import(`./vitesse-light-CMwxPBrg.js`),[]))}].map(e=>[e.id,e.import])),Ec=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Dc(){return 2147483648}function Oc(){return typeof performance<`u`?performance.now():Date.now()}var kc=(e,t)=>e+(t-e%t)%t;async function Ac(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=Dc();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,kc(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:Oc,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var jc=Object.defineProperty,Mc=(e,t,n)=>t in e?jc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nc=(e,t,n)=>Mc(e,typeof t==`symbol`?t:t+``,n),Pc=null;function Fc(e){throw new Ec(e.UTF8ToString(e.getLastOnigError()))}var Ic=class e{constructor(t){Nc(this,`utf16Length`),Nc(this,`utf8Length`),Nc(this,`utf16Value`),Nc(this,`utf8Value`),Nc(this,`utf16OffsetToUtf8`),Nc(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},Lc=class e{constructor(t){if(Nc(this,`id`,++e.LAST_ID),Nc(this,`_onigBinding`),Nc(this,`content`),Nc(this,`utf16Length`),Nc(this,`utf8Length`),Nc(this,`utf16OffsetToUtf8`),Nc(this,`utf8OffsetToUtf16`),Nc(this,`ptr`),!Pc)throw new Ec(`Must invoke loadWasm first.`);this._onigBinding=Pc,this.content=t;let n=new Ic(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=Pc.omalloc(1e4),e._sharedPtrInUse=!0,Pc.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(Pc)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Nc(Lc,`LAST_ID`,0),Nc(Lc,`_sharedPtr`,0),Nc(Lc,`_sharedPtrInUse`,!1);var Rc=Lc,zc=class{constructor(e){if(Nc(this,`_onigBinding`),Nc(this,`_ptr`),!Pc)throw new Ec(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new Ic(e[r]);t[r]=i.createString(Pc),n[r]=i.utf8Length}let r=Pc.omalloc(4*e.length);Pc.HEAPU32.set(t,r/4);let i=Pc.omalloc(4*e.length);Pc.HEAPU32.set(n,i/4);let a=Pc.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)Pc.ofree(t[n]);Pc.ofree(i),Pc.ofree(r),a===0&&Fc(Pc),this._onigBinding=Pc,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new Rc(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function Bc(e){return typeof e.instantiator==`function`}function Vc(e){return typeof e.default==`function`}function Hc(e){return e.data!==void 0}function Uc(e){return typeof Response<`u`&&e instanceof Response}function Wc(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var Gc;function Kc(e){if(Gc)return Gc;async function t(){Pc=await Ac(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),Bc(n)?n=await n.instantiator(t):Vc(n)?n=await n.default(t):(Hc(n)&&(n=n.data),Uc(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await Jc(n)(t):await Yc(n)(t):Wc(n)||n instanceof WebAssembly.Module?n=await qc(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await qc(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return Gc=t(),Gc}function qc(e){return t=>WebAssembly.instantiate(e,t)}function Jc(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Yc(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function Xc(e){return e&&await Kc(e),{createScanner(e){return new zc(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new Rc(e)}}}var Zc=hc({langs:wc,themes:Tc,engine:()=>Xc(J(()=>import(`./wasm-CSccDuAq.js`),[]))}),{codeToHtml:Qc,codeToHast:$c,codeToTokens:el,codeToTokensBase:tl,codeToTokensWithThemes:nl,getSingletonHighlighter:rl,getLastGrammarState:il}=_c(Zc,{guessEmbeddedLanguages:ts});function al(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function ol(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var sl=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),cl=String.raw;function ll(e,t){if(e==null)throw Error(t??`Value expected`);return e}var ul=cl`\[\^?`,dl=`c.? | C(?:-.?)?|${cl`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${cl`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${cl`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${cl`o\{[^\}]*\}?`}|${cl`\d{1,3}`}`,fl=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,pl=new RegExp(cl`
|
|
22
22
|
\\ (?:
|
|
23
23
|
${dl}
|
|
24
24
|
| [gk]<[^>]*>?
|
|
@@ -1929,10 +1929,10 @@ XID_Start XIDS`.split(/\s/).map(e=>[Nu(e),e])),Dd=new Map([[`s`,dd(383)],[dd(383
|
|
|
1929
1929
|
`},l]}}var JB=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),YB=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),XB=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),ZB=[...YB,...XB],QB=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),$B=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),eV=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),tV=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse(),nV=$B.concat(eV).sort().reverse();function rV(e){let t=JB(e),n=nV,r=`[\\w-]+`,i=`(`+r+`|@\\{[\\w-]+\\})`,a=[],o=[],s=function(e){return{className:`string`,begin:`~?`+e+`.*?`+e}},c=function(e,t,n){return{className:e,begin:t,relevance:n}},l={$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:QB.join(` `)},u={begin:`\\(`,end:`\\)`,contains:o,keywords:l,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s(`'`),s(`"`),t.CSS_NUMBER_MODE,{begin:`(url|data-uri)\\(`,starts:{className:`string`,end:`[\\)\\n]`,excludeEnd:!0}},t.HEXCOLOR,u,c(`variable`,`@@?`+r,10),c(`variable`,`@\\{`+r+`\\}`),c(`built_in`,"~?`[^`]*?`"),{className:`attribute`,begin:r+`\\s*:`,end:`:`,returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:`and not`},t.FUNCTION_DISPATCH);let d=o.concat({begin:/\{/,end:/\}/,contains:a}),f={beginKeywords:`when`,endsWithParent:!0,contains:[{beginKeywords:`and not`}].concat(o)},p={begin:i+`\\s*:`,returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+tV.join(`|`)+`)\\b`,end:/(?=:)/,starts:{endsWithParent:!0,illegal:`[<=$]`,relevance:0,contains:o}}]},m={className:`keyword`,begin:`@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b`,starts:{end:`[;{}]`,keywords:l,returnEnd:!0,contains:o,relevance:0}},h={className:`variable`,variants:[{begin:`@`+r+`\\s*:`,relevance:15},{begin:`@`+r}],starts:{end:`[;}]`,returnEnd:!0,contains:d}},g={variants:[{begin:`[\\.#:&\\[>]`,end:`[;{}]`},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,c(`keyword`,`all\\b`),c(`variable`,`@\\{`+r+`\\}`),{begin:`\\b(`+ZB.join(`|`)+`)\\b`,className:`selector-tag`},t.CSS_NUMBER_MODE,c(`selector-tag`,i,0),c(`selector-id`,`#`+i),c(`selector-class`,`\\.`+i,0),c(`selector-tag`,`&`,0),t.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,begin:`:(`+$B.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+eV.join(`|`)+`)`},{begin:/\(/,end:/\)/,relevance:0,contains:d},{begin:`!important`},t.FUNCTION_DISPATCH]},_={begin:`[\\w-]+:(:)?(${n.join(`|`)})`,returnBegin:!0,contains:[g]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,h,_,p,g,f,t.FUNCTION_DISPATCH),{name:`Less`,case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function iV(e){let t=`\\[=*\\[`,n=`\\]=*\\]`,r={begin:t,end:n,contains:[`self`]},i=[e.COMMENT(`--(?!`+t+`)`,`$`),e.COMMENT(`--`+t,n,{contains:[r],relevance:10})];return{name:`Lua`,aliases:[`pluto`],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:`true false nil`,keyword:`and break do else elseif end for goto if in local not or repeat return then until while`,built_in:`_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove`},contains:i.concat([{className:`function`,beginKeywords:`function`,end:`\\)`,contains:[e.inherit(e.TITLE_MODE,{begin:`([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*`}),{className:`params`,begin:`\\(`,endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:`string`,begin:t,end:n,contains:[r],relevance:5}])}}function aV(e){let t={className:`variable`,variants:[{begin:`\\$\\(`+e.UNDERSCORE_IDENT_RE+`\\)`,contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:`variable`,begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:`subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value`},contains:[t,n]},i={begin:`^`+e.UNDERSCORE_IDENT_RE+`\\s*(?=[:+?]?=)`},a={className:`meta`,begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:`.PHONY`}},o={className:`section`,begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:`Makefile`,aliases:[`mk`,`mak`,`make`],keywords:{$pattern:/[\w-]+/,keyword:`define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath`},contains:[e.HASH_COMMENT_MODE,t,n,r,i,a,o]}}function oV(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function sV(e){let t={className:`built_in`,begin:`\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+`},n=/[a-zA-Z@][a-zA-Z0-9_]*/,r=[`int`,`float`,`char`,`unsigned`,`signed`,`short`,`long`,`double`,`wchar_t`,`unichar`,`void`,`bool`,`BOOL`,`id|0`,`_Bool`],i=`while.export.sizeof.typedef.const.struct.for.union.volatile.static.mutable.if.do.return.goto.enum.else.break.extern.asm.case.default.register.explicit.typename.switch.continue.inline.readonly.assign.readwrite.self.@synchronized.id.typeof.nonatomic.IBOutlet.IBAction.strong.weak.copy.in.out.inout.bycopy.byref.oneway.__strong.__weak.__block.__autoreleasing.@private.@protected.@public.@try.@property.@end.@throw.@catch.@finally.@autoreleasepool.@synthesize.@dynamic.@selector.@optional.@required.@encode.@package.@import.@defs.@compatibility_alias.__bridge.__bridge_transfer.__bridge_retained.__bridge_retain.__covariant.__contravariant.__kindof._Nonnull._Nullable._Null_unspecified.__FUNCTION__.__PRETTY_FUNCTION__.__attribute__.getter.setter.retain.unsafe_unretained.nonnull.nullable.null_unspecified.null_resettable.class.instancetype.NS_DESIGNATED_INITIALIZER.NS_UNAVAILABLE.NS_REQUIRES_SUPER.NS_RETURNS_INNER_POINTER.NS_INLINE.NS_AVAILABLE.NS_DEPRECATED.NS_ENUM.NS_OPTIONS.NS_SWIFT_UNAVAILABLE.NS_ASSUME_NONNULL_BEGIN.NS_ASSUME_NONNULL_END.NS_REFINED_FOR_SWIFT.NS_SWIFT_NAME.NS_SWIFT_NOTHROW.NS_DURING.NS_HANDLER.NS_ENDHANDLER.NS_VALUERETURN.NS_VOIDRETURN`.split(`.`),a=[`false`,`true`,`FALSE`,`TRUE`,`nil`,`YES`,`NO`,`NULL`],o=[`dispatch_once_t`,`dispatch_queue_t`,`dispatch_sync`,`dispatch_async`,`dispatch_once`],s={"variable.language":[`this`,`super`],$pattern:n,keyword:i,literal:a,built_in:o,type:r},c={$pattern:n,keyword:[`@interface`,`@class`,`@protocol`,`@implementation`]};return{name:`Objective-C`,aliases:[`mm`,`objc`,`obj-c`,`obj-c++`,`objective-c++`],keywords:s,illegal:`</`,contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:`string`,variants:[{begin:`@"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]}]},{className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),{className:`string`,begin:/<.*?>/,end:/$/,illegal:`\\n`},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:`class`,begin:`(`+c.keyword.join(`|`)+`)\\b`,end:/(\{|$)/,excludeEnd:!0,keywords:c,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:`\\.`+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function cV(e){let t=e.regex,n=`abs.accept.alarm.and.atan2.bind.binmode.bless.break.caller.chdir.chmod.chomp.chop.chown.chr.chroot.class.close.closedir.connect.continue.cos.crypt.dbmclose.dbmopen.defined.delete.die.do.dump.each.else.elsif.endgrent.endhostent.endnetent.endprotoent.endpwent.endservent.eof.eval.exec.exists.exit.exp.fcntl.field.fileno.flock.for.foreach.fork.format.formline.getc.getgrent.getgrgid.getgrnam.gethostbyaddr.gethostbyname.gethostent.getlogin.getnetbyaddr.getnetbyname.getnetent.getpeername.getpgrp.getpriority.getprotobyname.getprotobynumber.getprotoent.getpwent.getpwnam.getpwuid.getservbyname.getservbyport.getservent.getsockname.getsockopt.given.glob.gmtime.goto.grep.gt.hex.if.index.int.ioctl.join.keys.kill.last.lc.lcfirst.length.link.listen.local.localtime.log.lstat.lt.ma.map.method.mkdir.msgctl.msgget.msgrcv.msgsnd.my.ne.next.no.not.oct.open.opendir.or.ord.our.pack.package.pipe.pop.pos.print.printf.prototype.push.q|0.qq.quotemeta.qw.qx.rand.read.readdir.readline.readlink.readpipe.recv.redo.ref.rename.require.reset.return.reverse.rewinddir.rindex.rmdir.say.scalar.seek.seekdir.select.semctl.semget.semop.send.setgrent.sethostent.setnetent.setpgrp.setpriority.setprotoent.setpwent.setservent.setsockopt.shift.shmctl.shmget.shmread.shmwrite.shutdown.sin.sleep.socket.socketpair.sort.splice.split.sprintf.sqrt.srand.stat.state.study.sub.substr.symlink.syscall.sysopen.sysread.sysseek.system.syswrite.tell.telldir.tie.tied.time.times.tr.truncate.uc.ucfirst.umask.undef.unless.unlink.unpack.unshift.untie.until.use.utime.values.vec.wait.waitpid.wantarray.warn.when.while.write.x|0.xor.y|0`.split(`.`),r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(` `)},a={className:`subst`,begin:`[$@]\\{`,end:`\\}`,keywords:i},o={begin:/->\{/,end:/\}/},s={scope:`attr`,match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:`variable`,variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,`(?![A-Za-z])(?![@$%])`)},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[s]},l={className:`number`,variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[e.BACKSLASH_ESCAPE,a,c],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(e,n,i=`\\1`)=>{let a=i===`\\1`?i:t.concat(i,n);return t.concat(t.concat(`(?:`,e,`)`),n,/(?:\\.|[^\\\/])*?/,a,/(?:\\.|[^\\\/])*?/,i,r)},p=(e,n,i)=>t.concat(t.concat(`(?:`,e,`)`),n,/(?:\\.|[^\\\/])*?/,i,r),m=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:`string`,contains:u,variants:[{begin:`q[qwxr]?\\s*\\(`,end:`\\)`,relevance:5},{begin:`q[qwxr]?\\s*\\[`,end:`\\]`,relevance:5},{begin:`q[qwxr]?\\s*\\{`,end:`\\}`,relevance:5},{begin:`q[qwxr]?\\s*\\|`,end:`\\|`,relevance:5},{begin:`q[qwxr]?\\s*<`,end:`>`,relevance:5},{begin:`qw\\s+q`,end:`q`,relevance:5},{begin:`'`,end:`'`,contains:[e.BACKSLASH_ESCAPE]},{begin:`"`,end:`"`},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:`-?\\w+\\s*=>`,relevance:0}]},l,{begin:`(\\/\\/|`+e.RE_STARTERS_RE+`|\\b(split|return|print|reverse|grep)\\b)\\s*`,keywords:`split return print reverse grep`,relevance:0,contains:[e.HASH_COMMENT_MODE,{className:`regexp`,variants:[{begin:f(`s|tr|y`,t.either(...d,{capture:!0}))},{begin:f(`s|tr|y`,`\\(`,`\\)`)},{begin:f(`s|tr|y`,`\\[`,`\\]`)},{begin:f(`s|tr|y`,`\\{`,`\\}`)}],relevance:2},{className:`regexp`,variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p(`(?:m|qr)?`,/\//,/\//)},{begin:p(`m|qr`,t.either(...d,{capture:!0}),/\1/)},{begin:p(`m|qr`,/\(/,/\)/)},{begin:p(`m|qr`,/\[/,/\]/)},{begin:p(`m|qr`,/\{/,/\}/)}]}]},{className:`function`,beginKeywords:`sub method`,end:`(\\s*\\(.*?\\))?[;{]`,excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s]},{className:`class`,beginKeywords:`class`,end:`[;{]`,excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s,l]},{begin:`-\\w\\b`,relevance:0},{begin:`^__DATA__$`,end:`^__END__$`,subLanguage:`mojolicious`,contains:[{begin:`^@@.*`,end:`$`,className:`comment`}]}];return a.contains=m,o.contains=m,{name:`Perl`,aliases:[`pl`,`pm`],keywords:i,contains:m}}function lV(e){let t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=t.concat(/[A-Z]+/,n),o={scope:`variable`,match:`\\$+`+r},s={scope:`meta`,variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:`subst`,variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},f=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
|
|
1930
1930
|
]`,m={scope:`string`,variants:[u,l,d,f]},h={scope:`number`,variants:[{begin:`\\b0[bB][01]+(?:_[01]+)*\\b`},{begin:`\\b0[oO][0-7]+(?:_[0-7]+)*\\b`},{begin:`\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b`},{begin:`(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?`}],relevance:0},g=[`false`,`null`,`true`],_=`__CLASS__.__DIR__.__FILE__.__FUNCTION__.__COMPILER_HALT_OFFSET__.__LINE__.__METHOD__.__NAMESPACE__.__TRAIT__.die.echo.exit.include.include_once.print.require.require_once.array.abstract.and.as.binary.bool.boolean.break.callable.case.catch.class.clone.const.continue.declare.default.do.double.else.elseif.empty.enddeclare.endfor.endforeach.endif.endswitch.endwhile.enum.eval.extends.final.finally.float.for.foreach.from.global.goto.if.implements.instanceof.insteadof.int.integer.interface.isset.iterable.list.match|0.mixed.new.never.object.or.private.protected.public.readonly.real.return.string.switch.throw.trait.try.unset.use.var.void.while.xor.yield`.split(`.`),v=`Error|0.AppendIterator.ArgumentCountError.ArithmeticError.ArrayIterator.ArrayObject.AssertionError.BadFunctionCallException.BadMethodCallException.CachingIterator.CallbackFilterIterator.CompileError.Countable.DirectoryIterator.DivisionByZeroError.DomainException.EmptyIterator.ErrorException.Exception.FilesystemIterator.FilterIterator.GlobIterator.InfiniteIterator.InvalidArgumentException.IteratorIterator.LengthException.LimitIterator.LogicException.MultipleIterator.NoRewindIterator.OutOfBoundsException.OutOfRangeException.OuterIterator.OverflowException.ParentIterator.ParseError.RangeException.RecursiveArrayIterator.RecursiveCachingIterator.RecursiveCallbackFilterIterator.RecursiveDirectoryIterator.RecursiveFilterIterator.RecursiveIterator.RecursiveIteratorIterator.RecursiveRegexIterator.RecursiveTreeIterator.RegexIterator.RuntimeException.SeekableIterator.SplDoublyLinkedList.SplFileInfo.SplFileObject.SplFixedArray.SplHeap.SplMaxHeap.SplMinHeap.SplObjectStorage.SplObserver.SplPriorityQueue.SplQueue.SplStack.SplSubject.SplTempFileObject.TypeError.UnderflowException.UnexpectedValueException.UnhandledMatchError.ArrayAccess.BackedEnum.Closure.Fiber.Generator.Iterator.IteratorAggregate.Serializable.Stringable.Throwable.Traversable.UnitEnum.WeakReference.WeakMap.Directory.__PHP_Incomplete_Class.parent.php_user_filter.self.static.stdClass`.split(`.`),y={keyword:_,literal:(e=>{let t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(g),built_in:v},b=e=>e.map(e=>e.replace(/\|\d+$/,``)),x={variants:[{match:[/new/,t.concat(p,`+`),t.concat(`(?!`,b(v).join(`\\b|`),`\\b)`),i],scope:{1:`keyword`,4:`title.class`}}]},S=t.concat(r,`\\b(?!\\()`),C={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{2:`variable.constant`}},{match:[/::/,/class/],scope:{2:`variable.language`}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{1:`title.class`,3:`variable.constant`}},{match:[i,t.concat(`::`,t.lookahead(/(?!class\b)/))],scope:{1:`title.class`}},{match:[i,/::/,/class/],scope:{1:`title.class`,3:`variable.language`}}]},w={scope:`attr`,match:t.concat(r,t.lookahead(`:`),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[w,o,C,e.C_BLOCK_COMMENT_MODE,m,h,x]},E={relevance:0,match:[/\b/,t.concat(`(?!fn\\b|function\\b|`,b(_).join(`\\b|`),`|`,b(v).join(`\\b|`),`\\b)`),r,t.concat(p,`*`),t.lookahead(/(?=\()/)],scope:{3:`title.function.invoke`},contains:[T]};T.contains.push(E);let D=[w,C,e.C_BLOCK_COMMENT_MODE,m,h,x],O={begin:t.concat(/#\[\s*\\?/,t.either(i,a)),beginScope:`meta`,end:/]/,endScope:`meta`,keywords:{literal:g,keyword:[`new`,`array`]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:[`new`,`array`]},contains:[`self`,...D]},...D,{scope:`meta`,variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:y,contains:[O,e.HASH_COMMENT_MODE,e.COMMENT(`//`,`$`),e.COMMENT(`/\\*`,`\\*/`,{contains:[{scope:`doctag`,match:`@[A-Za-z]+`}]}),{match:/__halt_compiler\(\);/,keywords:`__halt_compiler`,starts:{scope:`comment`,end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:`meta`,endsParent:!0}]}},s,{scope:`variable.language`,match:/\$this\b/},o,E,C,{match:[/const/,/\s/,r],scope:{1:`keyword`,3:`variable.constant`}},x,{scope:`function`,relevance:0,beginKeywords:`fn function`,end:/[;{]/,excludeEnd:!0,illegal:`[$%\\[]`,contains:[{beginKeywords:`use`},e.UNDERSCORE_TITLE_MODE,{begin:`=>`,endsParent:!0},{scope:`params`,begin:`\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0,keywords:y,contains:[`self`,O,o,C,e.C_BLOCK_COMMENT_MODE,m,h]}]},{scope:`class`,variants:[{beginKeywords:`enum`,illegal:/[($"]/},{beginKeywords:`class interface trait`,illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:`extends implements`},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:`namespace`,relevance:0,end:`;`,illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:`title.class`})]},{beginKeywords:`use`,relevance:0,end:`;`,contains:[{match:/\b(as|const|function)\b/,scope:`keyword`},e.UNDERSCORE_TITLE_MODE]},m,h]}}function uV(e){return{name:`PHP template`,subLanguage:`xml`,contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:`php`,contains:[{begin:`/\\*`,end:`\\*/`,skip:!0},{begin:`b"`,end:`"`,skip:!0},{begin:`b'`,end:`'`,skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function dV(e){return{name:`Plain text`,aliases:[`text`,`txt`],disableAutodetect:!0}}function fV(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function pV(e){return{aliases:[`pycon`],contains:[{className:`meta.prompt`,starts:{end:/ |$/,starts:{end:`$`,subLanguage:`python`}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function mV(e){let t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:`R`,keywords:{$pattern:n,keyword:`function if in break next repeat else for while`,literal:`NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10`,built_in:`LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm`},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:`doctag`,match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:`doctag`,begin:`@param`,end:/$/,contains:[{scope:`variable`,variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:`doctag`,match:/@[a-zA-Z]+/},{scope:`keyword`,match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:`"`,end:`"`,relevance:0},{begin:`'`,end:`'`,relevance:0}]},{relevance:0,variants:[{scope:{1:`operator`,2:`number`},match:[i,r]},{scope:{1:`operator`,2:`number`},match:[/%[^%]*%/,r]},{scope:{1:`punctuation`,2:`number`},match:[a,r]},{scope:{2:`number`},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:`operator`},match:[n,/\s+/,/<-/,/\s+/]},{scope:`operator`,relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:`punctuation`,relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function hV(e){let t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),a=[`include`,`extend`,`prepend`,`public`,`private`,`protected`,`raise`,`throw`],o={"variable.constant":[`__FILE__`,`__LINE__`,`__ENCODING__`],"variable.language":[`self`,`super`],keyword:[`alias`,`and`,`begin`,`BEGIN`,`break`,`case`,`class`,`defined`,`do`,`else`,`elsif`,`end`,`END`,`ensure`,`for`,`if`,`in`,`module`,`next`,`not`,`or`,`redo`,`require`,`rescue`,`retry`,`return`,`then`,`undef`,`unless`,`until`,`when`,`while`,`yield`,...a],built_in:[`proc`,`lambda`,`attr_accessor`,`attr_reader`,`attr_writer`,`define_method`,`private_constant`,`module_function`],literal:[`true`,`false`,`nil`]},s={className:`doctag`,begin:`@[A-Za-z]+`},c={begin:`#<`,end:`>`},l=[e.COMMENT(`#`,`$`,{contains:[s]}),e.COMMENT(`^=begin`,`^=end`,{contains:[s],relevance:10}),e.COMMENT(`^__END__`,e.MATCH_NOTHING_RE)],u={className:`subst`,begin:/#\{/,end:/\}/,keywords:o},d={className:`string`,contains:[e.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,u]})]}]},f=`[0-9](_?[0-9])*`,p={className:`number`,relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${f}))?([eE][+-]?(${f})|r)?i?\\b`},{begin:`\\b0[dD][0-9](_?[0-9])*r?i?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*r?i?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*r?i?\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b`},{begin:`\\b0(_?[0-7])+r?i?\\b`}]},m={variants:[{match:/\(\)/},{className:`params`,begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},h={match:[/(include|extend)\s+/,i],scope:{2:`title.class`},keywords:o},g={variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:`title.class`,4:`title.class.inherited`},keywords:o},_={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`},v={match:[/def/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},y=[d,g,h,{relevance:0,match:[i,/\.new[. (]/],scope:{1:`title.class`}},_,{relevance:0,match:r,scope:`title.class`},v,{begin:e.IDENT_RE+`::`},{className:`symbol`,begin:e.UNDERSCORE_IDENT_RE+`(!|\\?)?:`,relevance:0},{className:`symbol`,begin:`:(?!\\s)`,contains:[d,{begin:n}],relevance:0},p,{className:`variable`,begin:`(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])`},{className:`params`,begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:`(`+e.RE_STARTERS_RE+`|unless)\\s*`,keywords:`unless`,contains:[{className:`regexp`,contains:[e.BACKSLASH_ESCAPE,u],illegal:/\n/,variants:[{begin:`/`,end:`/[a-z]*`},{begin:/%r\{/,end:/\}[a-z]*/},{begin:`%r\\(`,end:`\\)[a-z]*`},{begin:`%r!`,end:`![a-z]*`},{begin:`%r\\[`,end:`\\][a-z]*`}]}].concat(c,l),relevance:0}].concat(c,l);u.contains=y,m.contains=y;let b=[{begin:/^\s*=>/,starts:{end:`$`,contains:y}},{className:`meta.prompt`,begin:`^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])`,starts:{end:`$`,keywords:o,contains:y}}];return l.unshift(c),{name:`Ruby`,aliases:[`rb`,`gemspec`,`podspec`,`thor`,`irb`],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:`ruby`})].concat(b,l,y)}}function gV(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:`title.function.invoke`,relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o=`([ui](8|16|32|64|128|size)|f(32|64))?`,s=`abstract.as.async.await.become.box.break.const.continue.crate.do.dyn.else.enum.extern.false.final.fn.for.if.impl.in.let.loop.macro.match.mod.move.mut.override.priv.pub.ref.return.self.Self.static.struct.super.trait.true.try.type.typeof.union.unsafe.unsized.use.virtual.where.while.yield`.split(`.`),c=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],l=`drop .Copy.Send.Sized.Sync.Drop.Fn.FnMut.FnOnce.ToOwned.Clone.Debug.PartialEq.PartialOrd.Eq.Ord.AsRef.AsMut.Into.From.Default.Iterator.Extend.IntoIterator.DoubleEndedIterator.ExactSizeIterator.SliceConcatExt.ToString.assert!.assert_eq!.bitflags!.bytes!.cfg!.col!.concat!.concat_idents!.debug_assert!.debug_assert_eq!.env!.eprintln!.panic!.file!.format!.format_args!.include_bytes!.include_str!.line!.local_data_key!.module_path!.option_env!.print!.println!.select!.stringify!.try!.unimplemented!.unreachable!.vec!.write!.writeln!.macro_rules!.assert_ne!.debug_assert_ne!`.split(`.`),u=[`i8`,`i16`,`i32`,`i64`,`i128`,`isize`,`u8`,`u16`,`u32`,`u64`,`u128`,`usize`,`f32`,`f64`,`str`,`char`,`bool`,`Box`,`Option`,`Result`,`String`,`Vec`];return{name:`Rust`,aliases:[`rs`],keywords:{$pattern:e.IDENT_RE+`!?`,type:u,keyword:s,literal:c,built_in:l},illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:`symbol`,begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:`string`,variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:`char.escape`,match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:`number`,variants:[{begin:`\\b0b([01_]+)`+o},{begin:`\\b0o([0-7_]+)`+o},{begin:`\\b0x([A-Fa-f0-9_]+)`+o},{begin:`\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)`+o}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:`keyword`,3:`title.function`}},{className:`meta`,begin:`#!?\\[`,end:`\\]`,contains:[{className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:`keyword`,3:`keyword`,4:`variable`}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:`keyword`,3:`variable`,5:`keyword`}},{begin:[/type/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:e.IDENT_RE+`::`,keywords:{keyword:`Self`,built_in:l,type:u}},{className:`punctuation`,begin:`->`},a]}}var _V=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),vV=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),yV=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),bV=[...vV,...yV],xV=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),SV=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),CV=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),wV=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function TV(e){let t=_V(e),n=CV,r=SV,i=`@[a-z-]+`,a={className:`variable`,begin:`(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b`,relevance:0};return{name:`SCSS`,case_insensitive:!0,illegal:`[=/|']`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:`selector-id`,begin:`#[A-Za-z0-9_-]+`,relevance:0},{className:`selector-class`,begin:`\\.[A-Za-z0-9_-]+`,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:`selector-tag`,begin:`\\b(`+bV.join(`|`)+`)\\b`,relevance:0},{className:`selector-pseudo`,begin:`:(`+r.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+n.join(`|`)+`)`},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+wV.join(`|`)+`)\\b`},{begin:`\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b`},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:`@(page|font-face)`,keywords:{$pattern:i,keyword:`@page @font-face`}},{begin:`@`,end:`[{;]`,returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:xV.join(` `)},contains:[{begin:i,className:`keyword`},{begin:/[a-z-]+(?=:)/,className:`attribute`},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function EV(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function DV(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}function OV(e){return e?typeof e==`string`?e:e.source:null}function kV(e){return AV(`(?=`,e,`)`)}function AV(...e){return e.map(e=>OV(e)).join(``)}function jV(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function MV(...e){return`(`+(jV(e).capture?``:`?:`)+e.map(e=>OV(e)).join(`|`)+`)`}var NV=e=>AV(/\b/,e,/\w$/.test(e)?/\b/:/\B/),PV=[`Protocol`,`Type`].map(NV),FV=[`init`,`self`].map(NV),IV=[`Any`,`Self`],LV=[`actor`,`any`,`associatedtype`,`async`,`await`,/as\?/,/as!/,`as`,`borrowing`,`break`,`case`,`catch`,`class`,`consume`,`consuming`,`continue`,`convenience`,`copy`,`default`,`defer`,`deinit`,`didSet`,`distributed`,`do`,`dynamic`,`each`,`else`,`enum`,`extension`,`fallthrough`,/fileprivate\(set\)/,`fileprivate`,`final`,`for`,`func`,`get`,`guard`,`if`,`import`,`indirect`,`infix`,/init\?/,/init!/,`inout`,/internal\(set\)/,`internal`,`in`,`is`,`isolated`,`nonisolated`,`lazy`,`let`,`macro`,`mutating`,`nonmutating`,/open\(set\)/,`open`,`operator`,`optional`,`override`,`package`,`postfix`,`precedencegroup`,`prefix`,/private\(set\)/,`private`,`protocol`,/public\(set\)/,`public`,`repeat`,`required`,`rethrows`,`return`,`set`,`some`,`static`,`struct`,`subscript`,`super`,`switch`,`throws`,`throw`,/try\?/,/try!/,`try`,`typealias`,/unowned\(safe\)/,/unowned\(unsafe\)/,`unowned`,`var`,`weak`,`where`,`while`,`willSet`],RV=[`false`,`nil`,`true`],zV=[`assignment`,`associativity`,`higherThan`,`left`,`lowerThan`,`none`,`right`],BV=[`#colorLiteral`,`#column`,`#dsohandle`,`#else`,`#elseif`,`#endif`,`#error`,`#file`,`#fileID`,`#fileLiteral`,`#filePath`,`#function`,`#if`,`#imageLiteral`,`#keyPath`,`#line`,`#selector`,`#sourceLocation`,`#warning`],VV=`abs.all.any.assert.assertionFailure.debugPrint.dump.fatalError.getVaList.isKnownUniquelyReferenced.max.min.numericCast.pointwiseMax.pointwiseMin.precondition.preconditionFailure.print.readLine.repeatElement.sequence.stride.swap.swift_unboxFromSwiftValueWithType.transcode.type.unsafeBitCast.unsafeDowncast.withExtendedLifetime.withUnsafeMutablePointer.withUnsafePointer.withVaList.withoutActuallyEscaping.zip`.split(`.`),HV=MV(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),UV=MV(HV,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),WV=AV(HV,UV,`*`),GV=MV(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),KV=MV(GV,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),qV=AV(GV,KV,`*`),JV=AV(/[A-Z]/,KV,`*`),YV=[`attached`,`autoclosure`,AV(/convention\(/,MV(`swift`,`block`,`c`),/\)/),`discardableResult`,`dynamicCallable`,`dynamicMemberLookup`,`escaping`,`freestanding`,`frozen`,`GKInspectable`,`IBAction`,`IBDesignable`,`IBInspectable`,`IBOutlet`,`IBSegueAction`,`inlinable`,`main`,`nonobjc`,`NSApplicationMain`,`NSCopying`,`NSManaged`,AV(/objc\(/,qV,/\)/),`objc`,`objcMembers`,`propertyWrapper`,`requires_stored_property_inits`,`resultBuilder`,`Sendable`,`testable`,`UIApplicationMain`,`unchecked`,`unknown`,`usableFromInline`,`warn_unqualified_access`],XV=[`iOS`,`iOSApplicationExtension`,`macOS`,`macOSApplicationExtension`,`macCatalyst`,`macCatalystApplicationExtension`,`watchOS`,`watchOSApplicationExtension`,`tvOS`,`tvOSApplicationExtension`,`swift`];function ZV(e){let t={match:/\s+/,relevance:0},n=e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,MV(...PV,...FV)],className:{2:`keyword`}},a={match:AV(/\./,MV(...LV)),relevance:0},o=LV.filter(e=>typeof e==`string`).concat([`_|0`]),s={variants:[{className:`keyword`,match:MV(...LV.filter(e=>typeof e!=`string`).concat(IV).map(NV),...FV)}]},c={$pattern:MV(/\b\w+/,/#\w+/),keyword:o.concat(BV),literal:RV},l=[i,a,s],u=[{match:AV(/\./,MV(...VV)),relevance:0},{className:`built_in`,match:AV(/\b/,MV(...VV),/(?=\()/)}],d={match:/->/,relevance:0},f=[d,{className:`operator`,relevance:0,variants:[{match:WV},{match:`\\.(\\.|${UV})+`}]}],p=`([0-9]_*)+`,m=`([0-9a-fA-F]_*)+`,h={className:`number`,relevance:0,variants:[{match:`\\b(${p})(\\.(${p}))?([eE][+-]?(${p}))?\\b`},{match:`\\b0x(${m})(\\.(${m}))?([pP][+-]?(${p}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},g=(e=``)=>({className:`subst`,variants:[{match:AV(/\\/,e,/[0\\tnr"']/)},{match:AV(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(e=``)=>({className:`subst`,match:AV(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(e=``)=>({className:`subst`,label:`interpol`,begin:AV(/\\/,e,/\(/),end:/\)/}),y=(e=``)=>({begin:AV(e,/"""/),end:AV(/"""/,e),contains:[g(e),_(e),v(e)]}),b=(e=``)=>({begin:AV(e,/"/),end:AV(/"/,e),contains:[g(e),v(e)]}),x={className:`string`,variants:[y(),y(`#`),y(`##`),y(`###`),b(),b(`#`),b(`##`),b(`###`)]},S=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],C={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:S},w=e=>{let t=AV(e,/\//),n=AV(/\//,e);return{begin:t,end:n,contains:[...S,{scope:`comment`,begin:`#(?!.*${n})`,end:/$/}]}},T={scope:`regexp`,variants:[w(`###`),w(`##`),w(`#`),C]},E={match:AV(/`/,qV,/`/)},D=[E,{className:`variable`,match:/\$\d+/},{className:`variable`,match:`\\$${KV}+`}],O=[{match:/(@|#(un)?)available/,scope:`keyword`,starts:{contains:[{begin:/\(/,end:/\)/,keywords:XV,contains:[...f,h,x]}]}},{scope:`keyword`,match:AV(/@/,MV(...YV),kV(MV(/\(/,/\s+/)))},{scope:`meta`,match:AV(/@/,qV)}],k={match:kV(/\b[A-Z]/),relevance:0,contains:[{className:`type`,match:AV(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,KV,`+`)},{className:`type`,match:JV,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:AV(/\s+&\s+/,kV(JV)),relevance:0}]},A={begin:/</,end:/>/,keywords:c,contains:[...r,...l,...O,d,k]};k.contains.push(A);let j={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:[`self`,{match:AV(qV,/\s*:/),keywords:`_|0`,relevance:0},...r,T,...l,...u,...f,h,x,...D,...O,k]},M={begin:/</,end:/>/,keywords:`repeat each`,contains:[...r,k]},N={begin:/\(/,end:/\)/,keywords:c,contains:[{begin:MV(kV(AV(qV,/\s*:/)),kV(AV(qV,/\s+/,qV,/\s*:/))),end:/:/,relevance:0,contains:[{className:`keyword`,match:/\b_\b/},{className:`params`,match:qV}]},...r,...l,...f,h,x,...O,k,j],endsParent:!0,illegal:/["']/},P={match:[/(func|macro)/,/\s+/,MV(E.match,qV,WV)],className:{1:`keyword`,3:`title.function`},contains:[M,N,t],illegal:[/\[/,/%/]},F={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:`keyword`},contains:[M,N,t],illegal:/\[|%/},I={match:[/operator/,/\s+/,WV],className:{1:`keyword`,3:`title`}},L={begin:[/precedencegroup/,/\s+/,JV],className:{1:`keyword`,3:`title`},contains:[k],keywords:[...zV,...RV],end:/}/},R={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:`keyword`,3:`keyword`,5:`title.function`}},z={match:[/class\b/,/\s+/,/var\b/],scope:{1:`keyword`,3:`keyword`}},ee={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,qV,/\s*/],beginScope:{1:`keyword`,3:`title.class`},keywords:c,contains:[M,...l,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:`title.class.inherited`,match:JV},...l],relevance:0}]};for(let e of x.variants){let t=e.contains.find(e=>e.label===`interpol`);t.keywords=c;let n=[...l,...u,...f,h,x,...D];t.contains=[...n,{begin:/\(/,end:/\)/,contains:[`self`,...n]}]}return{name:`Swift`,keywords:c,contains:[...r,P,F,R,z,ee,I,L,{beginKeywords:`import`,end:/$/,contains:[...r],relevance:0},T,...l,...u,...f,h,x,...D,...O,k,j]}}var QV=`[A-Za-z$_][0-9A-Za-z$_]*`,$V=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),eH=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],tH=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),nH=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],rH=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],iH=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],aH=[].concat(rH,tH,nH);function oH(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=QV,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:QV,keyword:$V,literal:eH,built_in:aH,"variable.language":iH},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...tH,...nH]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...rH,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function sH(e){let t=e.regex,n=oH(e),r=QV,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:QV,keyword:$V.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:eH,built_in:aH.concat(i),"variable.language":iH},l={className:`meta`,begin:`@`+r},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function cH(e){let t=e.regex,n={className:`string`,begin:/"(""|[^/n])"C\b/},r={className:`string`,begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,c={className:`literal`,variants:[{begin:t.concat(/# */,t.either(a,i),/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(a,i),/ +/,t.either(o,s),/ *#/)}]},l={className:`number`,relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:`label`,begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:`doctag`,begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:`Visual Basic .NET`,aliases:[`vb`],case_insensitive:!0,classNameAliases:{label:`symbol`},keywords:{keyword:`addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield`,built_in:`addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort`,type:`boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort`,literal:`true false nothing`},illegal:`//|\\{|\\}|endif|gosub|variant|wend|^\\$ `,contains:[n,r,c,l,u,d,f,{className:`meta`,begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:`const disable else elseif enable end externalsource if region then`},contains:[f]}]}}function lH(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);t.contains.push(`self`);let n=e.COMMENT(/;;/,/$/),r=`anyfunc,block,br,br_if,br_table,call,call_indirect,data,drop,elem,else,end,export,func,global.get,global.set,local.get,local.set,local.tee,get_global,get_local,global,if,import,local,loop,memory,memory.grow,memory.size,module,mut,nop,offset,param,result,return,select,set_global,set_local,start,table,tee_local,then,type,unreachable`.split(`,`),i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:`keyword`,3:`title.function`}},a={className:`variable`,begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:`punctuation`,relevance:0},s={className:`number`,relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:`type`},l={className:`keyword`,match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:`WebAssembly`,keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:`keyword`,3:`operator`}},a,o,i,e.QUOTE_STRING_MODE,c,l,s]}}function uH(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function dH(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}var fH={arduino:lB,bash:uB,c:dB,cpp:fB,csharp:pB,css:SB,diff:CB,go:wB,graphql:TB,ini:EB,java:MB,javascript:VB,json:HB,kotlin:qB,less:rV,lua:iV,makefile:aV,markdown:oV,objectivec:sV,perl:cV,php:lV,"php-template":uV,plaintext:dV,python:fV,"python-repl":pV,r:mV,ruby:hV,rust:gV,scss:TV,shell:EV,sql:DV,swift:ZV,typescript:sH,vbnet:cH,wasm:lH,xml:uH,yaml:dH},pH=l(o(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,j=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},M={begin:`\\\\[\\s\\S]`,relevance:0},N={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[M]},P={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[M]},F={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},I=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},L=I(`//`,`$`),R=I(`/\\*`,`\\*/`),z=I(`#`,`$`),ee={scope:`number`,begin:D,relevance:0},te={scope:`number`,begin:O,relevance:0},B={scope:`number`,begin:k,relevance:0},V={scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[M,{begin:/\[/,end:/\]/,relevance:0,contains:[M]}]},H={scope:`title`,begin:T,relevance:0},ne={scope:`title`,begin:E,relevance:0},re={begin:`\\.\\s*`+E,relevance:0},ie=Object.freeze({__proto__:null,APOS_STRING_MODE:N,BACKSLASH_ESCAPE:M,BINARY_NUMBER_MODE:B,BINARY_NUMBER_RE:k,COMMENT:I,C_BLOCK_COMMENT_MODE:R,C_LINE_COMMENT_MODE:L,C_NUMBER_MODE:te,C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:z,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:re,NUMBER_MODE:ee,NUMBER_RE:D,PHRASAL_WORDS_MODE:F,QUOTE_STRING_MODE:P,REGEXP_MODE:V,RE_STARTERS_RE:A,SHEBANG:j,TITLE_MODE:H,UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:ne});function ae(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function oe(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function se(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=ae,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function ce(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function le(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function ue(e,t){e.relevance===void 0&&(e.relevance=1)}var U=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},de=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],fe=`keyword`;function pe(e,t,n=fe){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,pe(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,me(n[0],n[1])]})}}function me(e,t){return t?Number(t):he(e)?0:1}function he(e){return de.includes(e.toLowerCase())}var ge={},_e=e=>{console.error(e)},ve=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ye=(e,t)=>{ge[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),ge[`${e}/${t}`]=!0)},be=Error();function xe(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function Se(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw _e(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),be;if(typeof e.beginScope!=`object`||e.beginScope===null)throw _e(`beginScope must be object`),be;xe(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function Ce(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw _e(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),be;if(typeof e.endScope!=`object`||e.endScope===null)throw _e(`endScope must be object`),be;xe(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function we(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Te(e){we(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),Se(e),Ce(e)}function Ee(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null),this.matcherRe=t(C(this.regexes.map(e=>e[1]),{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[oe,le,Te,U].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[se,ce,ue].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=pe(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Oe(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function De(e){return e?e.endsWithParent||De(e.starts):!1}function Oe(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:De(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var ke=`11.11.1`,Ae=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},je=i,Me=a,Ne=Symbol(`nomatch`),Pe=7,Fe=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=N(n[1]);return t||(ve(s.replace(`{}`,n[1])),ve(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||N(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(ye(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),ye(`10.7.0`,`Please use highlight(code, options) instead.
|
|
1931
1931
|
https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};z(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,z(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){M.addText(P);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(P),n=``;for(;t;){n+=P.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(M.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=Pe&&(F+=a),e.startsWith(`_`))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(P)}n+=P.substring(e),M.addText(n)}function f(){if(P===``)return;let e=null;if(typeof A.subLanguage==`string`){if(!t[A.subLanguage]){M.addText(P);return}e=v(A.subLanguage,P,!0,j[A.subLanguage]),j[A.subLanguage]=e._top}else e=S(P,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(F+=e.relevance),M.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),P=``}function m(e,t){e!==``&&(M.startScope(t),M.addText(e),M.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(P=i,d(),P=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&M.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(P,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),P=``):e.beginScope._multi&&(h(e.beginScope,t),P=``)),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(P+=e[0],1):(R=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?P+=t:(n.excludeBegin&&(P+=t),p(),!n.returnBegin&&!n.excludeBegin&&(P=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return Ne;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?P+=t:(a.returnEnd||a.excludeEnd||(P+=t),p(),a.excludeEnd&&(P=t));do A.scope&&M.closeNode(),!A.skip&&!A.subLanguage&&(F+=A.relevance),A=A.parent;while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>M.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(P+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(P+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(A.scope||`<unnamed>`)+`"`);throw e.mode=A,e}else if(r.type===`end`){let e=C(r);if(e!==Ne)return e}if(r.type===`illegal`&&a===``)return P+=`
|
|
1932
|
-
`,1;if(L>1e5&&L>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return P+=a,a.length}let D=N(e);if(!D)throw _e(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=Ee(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let P=``,F=0,I=0,L=0,R=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){L++,R?R=!1:A.matcher.considerAll(),A.matcher.lastIndex=I;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(I,e.index),e);I=e.index+t}E(n.substring(I))}return M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:F,illegal:!1,_emitter:M,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:je(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:I,context:n.slice(I-100,I+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{language:e,value:je(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:je(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(N).filter(F).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1;if(N(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(z(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Ae(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),z(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Me(l,e)}let E=()=>{k(),ye(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),ye(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(_e(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)_e(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&P(i.aliases,{languageName:n})}function j(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function M(){return Object.keys(t)}function N(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function P(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function F(e){let t=N(e);return t&&!t.disableAutodetect}function I(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function L(e){I(e),a.push(e)}function R(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function z(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function ee(e){return ye(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),ye(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:ee,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:N,registerAliases:P,autoDetection:F,inherit:Me,addPlugin:L,removePlugin:R}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=ke,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in ie)typeof ie[e]==`object`&&n(ie[e]);return Object.assign(e,ie),e},Ie=Fe({});Ie.newInstance=()=>Fe({}),t.exports=Ie,Ie.HighlightJS=Ie,Ie.default=Ie}))()).default,mH={},hH=`hljs-`;function gH(e){let t=pH.newInstance();return e&&a(e),{highlight:n,highlightAuto:r,listLanguages:i,register:a,registerAlias:o,registered:s};function n(e,n,r){let i=r||mH,a=typeof i.prefix==`string`?i.prefix:hH;if(!t.getLanguage(e))throw Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:_H,classPrefix:a});let o=t.highlight(n,{ignoreIllegals:!0,language:e});if(o.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:o.errorRaised});let s=o._emitter.root,c=s.data;return c.language=o.language,c.relevance=o.relevance,s}function r(e,r){let a=(r||mH).subset||i(),o=-1,s=0,c;for(;++o<a.length;){let i=a[o];if(!t.getLanguage(i))continue;let l=n(i,e,r);l.data&&l.data.relevance!==void 0&&l.data.relevance>s&&(s=l.data.relevance,c=l)}return c||{type:`root`,children:[],data:{language:void 0,relevance:s}}}function i(){return t.listLanguages()}function a(e,n){if(typeof e==`string`)t.registerLanguage(e,n);else{let n;for(n in e)Object.hasOwn(e,n)&&t.registerLanguage(n,e[n])}}function o(e,n){if(typeof e==`string`)t.registerAliases(typeof n==`string`?n:[...n],{languageName:e});else{let n;for(n in e)if(Object.hasOwn(e,n)){let r=e[n];t.registerAliases(typeof r==`string`?r:[...r],{languageName:n})}}}function s(e){return!!t.getLanguage(e)}}var _H=class{constructor(e){this.options=e,this.root={type:`root`,children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e===``)return;let t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&n.type===`text`?n.value+=e:t.children.push({type:`text`,value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){let n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:`element`,tagName:`span`,properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){let t=this,n=e.split(`.`).map(function(e,n){return n?e+`_`.repeat(n):t.options.classPrefix+e}),r=this.stack[this.stack.length-1],i={type:`element`,tagName:`span`,properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return``}},vH={};function yH(e){let t=e||vH,n=t.aliases,r=t.detect||!1,i=t.languages||fH,a=t.plainText,o=t.prefix,s=t.subset,c=`hljs`,l=gH(i);if(n&&l.registerAlias(n),o){let e=o.indexOf(`-`);c=e===-1?o:o.slice(0,e)}return function(e,t){MF(e,`element`,function(e,n,i){if(e.tagName!==`code`||!i||i.type!==`element`||i.tagName!==`pre`)return;let u=bH(e);if(u===!1||!u&&!r||u&&a&&a.includes(u))return;Array.isArray(e.properties.className)||(e.properties.className=[]),e.properties.className.includes(c)||e.properties.className.unshift(c);let d=Qz(e,{whitespace:`pre`}),f;try{f=u?l.highlight(u,d,{prefix:o}):l.highlightAuto(d,{prefix:o,subset:s})}catch(n){let r=n;if(u&&/Unknown language/.test(r.message)){t.message("Cannot highlight as `"+u+"`, it’s not registered",{ancestors:[i,e],cause:r,place:e.position,ruleId:`missing-language`,source:`rehype-highlight`});return}throw r}!u&&f.data&&f.data.language&&e.properties.className.push(`language-`+f.data.language),f.children.length>0&&(e.children=f.children)})}}function bH(e){let t=e.properties.className,n=-1;if(!Array.isArray(t))return;let r;for(;++n<t.length;){let e=String(t[n]);if(e===`no-highlight`||e===`nohighlight`)return!1;!r&&e.slice(0,5)===`lang-`&&(r=e.slice(5)),!r&&e.slice(0,9)===`language-`&&(r=e.slice(9))}return r}var xH=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],SH={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...xH,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...xH],h2:[[`className`,`sr-only`]],img:[...xH,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...xH,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...xH],table:[...xH],ul:[...xH,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},CH={}.hasOwnProperty;function wH(e,t){let n={type:`root`,children:[]},r=TH({schema:t?{...SH,...t}:SH,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function TH(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return EH(e,n);case`doctype`:return DH(e,n);case`element`:return OH(e,n);case`root`:return kH(e,n);case`text`:return AH(e,n);default:}}}function EH(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return LH(r,t),r}}function DH(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return LH(e,t),e}}function OH(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=jH(e,t.children),i=MH(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&CH.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return LH(o,t),o}function kH(e,t){let n={type:`root`,children:jH(e,t.children)};return LH(n,t),n}function AH(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return LH(n,t),n}function jH(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=TH(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function MH(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&CH.call(r,n)?r[n]:void 0,o=r&&CH.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(CH.call(s,l)){let t=s[l],n=NH(e,RH(a,l),l,t);n??=NH(e,RH(o,l),l,t),n!=null&&(c[l]=n)}if(i&&CH.call(i,n)){let e=i[n];for(l in e)CH.call(e,l)&&!CH.call(c,l)&&(c[l]=e[l])}return c}function NH(e,t,n,r){return t?Array.isArray(r)?PH(e,t,n,r):FH(e,t,n,r):void 0}function PH(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=FH(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function FH(e,t,n,r){if(!(typeof r!=`boolean`&&typeof r!=`number`&&typeof r!=`string`)&&IH(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function IH(e,t,n){let r=e.schema.protocols&&CH.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function LH(e,t){let n=GA(t);t.data&&(e.data=_F(t.data)),n&&(e.position=n)}function RH(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function zH(e){return function(t){return wH(t,e)}}function BH(){return typeof document>`u`?`dark`:(nE[document.documentElement.getAttribute(`data-theme`)||`nord`]?.type??`dark`)===`light`?`default`:`dark`}function VH({chart:e}){let t=(0,W.useRef)(null),n=`mermaid-${(0,W.useId)().replace(/[^a-zA-Z0-9]/g,``)}`,[r,i]=(0,W.useState)(null);return(0,W.useEffect)(()=>{let r=!1;if(t.current)return(async()=>{try{let a=(await J(async()=>{let{default:e}=await import(`./mermaid.core-Dw-_vXTc.js`);return{default:e}},__vite__mapDeps([101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118]))).default;a.initialize({startOnLoad:!1,securityLevel:`strict`,theme:BH()});let{svg:o,bindFunctions:s}=await a.render(n,e);if(r||!t.current)return;t.current.innerHTML=o,s?.(t.current),i(null)}catch(e){r||i(e instanceof Error?e.message:String(e))}})(),()=>{r=!0}},[e,n]),r?(0,G.jsxs)(`div`,{className:`mermaid-error`,children:[(0,G.jsxs)(`div`,{className:`mermaid-error-note`,children:[`Failed to render diagram: `,r]}),(0,G.jsx)(`pre`,{children:(0,G.jsx)(`code`,{children:e})})]}):(0,G.jsx)(`div`,{className:`mermaid`,ref:t,role:`img`,"aria-label":`Mermaid diagram`})}var HH=[Nz,Iz],UH=[[zH,{...SH,protocols:{...SH.protocols,href:[...SH.protocols?.href??[],`file`,`file-mention`]}}],[yH,{ignoreMissing:!0,plainText:[`mermaid`,`suggestion`]}]];function WH(e){return e.startsWith(`file://`)||e.startsWith(`file-mention://`)?e:PI(e)}function GH(e){return e==null||e===!1||e===!0?``:typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(GH).join(``):(0,W.isValidElement)(e)?GH(e.props.children):``}function KH(e){return typeof e==`string`?/language-([\w-]+)/.exec(e)?.[1]??null:null}var qH={pre({children:e}){let t=KH((0,W.isValidElement)(e)?e.props.className:void 0);return t===`mermaid`?(0,G.jsx)(VH,{chart:GH(e).replace(/\n$/,``)}):t===`suggestion`?null:(0,G.jsx)(`pre`,{children:e})},a({href:e,children:t}){return typeof e==`string`&&e.startsWith(`file-mention://`)?(0,G.jsx)(`span`,{className:`mention-file`,title:e.slice(15),children:t}):(0,G.jsx)(`a`,{href:e,...typeof e==`string`&&/^https?:\/\//.test(e)?{target:`_blank`,rel:`noopener noreferrer`}:{},children:t})}};function JH({content:e,className:t}){return(0,G.jsx)(`div`,{className:t,children:(0,G.jsx)(AI,{remarkPlugins:HH,rehypePlugins:UH,urlTransform:WH,components:qH,children:e})})}function YH(e,t){let n=e.slice(0,t);for(let e=t-1;e>=0;e--){let t=n[e];if(t===`@`){if(e===0||/\s/.test(n[e-1])){let t=n.slice(e+1);if(!/\s/.test(t))return{atStart:e,query:t}}return null}if(t===`
|
|
1933
|
-
`)return null}return null}function XH(e,t){let n=(0,W.useRef)(null),[r,i]=(0,W.useState)(null),[a,o]=(0,W.useState)(0),[s,c]=(0,W.useState)(0),l=(0,W.useRef)(0),u=(0,W.useCallback)(e=>{n.current=e},[]);(0,W.useEffect)(()=>{let t=n.current;if(!t)return;let r=t.selectionStart;l.current=r;let a=YH(e,r);if(i(a),a){o(0);let n=parseFloat(getComputedStyle(t).lineHeight)||20,i=(e.slice(0,r).match(/\n/g)||[]).length;c((parseFloat(getComputedStyle(t).paddingTop)||0)+(i+1)*n+4)}},[e]);let d=r?.query??``,f=nt({queryKey:[`file-mention`,d],enabled:r!==null,placeholderData:V,staleTime:5e3,queryFn:async({signal:e})=>{let t=await fetch(`/api/search`,{method:`POST`,headers:{"content-type":`application/json`},signal:e,body:JSON.stringify({scope:`files`,query:d})});if(!t.ok)throw Error(`Search failed (${t.status})`);return await t.json()}}),p=f.data?.items??[],m=r!==null&&(p.length>0||f.isFetching),h=(0,W.useCallback)(a=>{if(!r)return;let o=n.current;if(!o)return;let s=e.slice(0,r.atStart),c=e.slice(l.current),u=`@${a} `;t(s+u+c),i(null),requestAnimationFrame(()=>{o.selectionStart=o.selectionEnd=(s+u).length,o.focus()})},[r,e,t]),g=(0,W.useCallback)(e=>{if(!m)return!1;if(e.key===`ArrowDown`){e.preventDefault();let t=p.length;return t>0&&o(e=>(e+1)%t),!0}if(e.key===`ArrowUp`){e.preventDefault();let t=p.length;return t>0&&o(e=>e===0?t-1:e-1),!0}return(e.key===`Enter`||e.key===`Tab`)&&p[a]?(e.preventDefault(),h(p[a].path),!0):e.key===`Escape`?(e.preventDefault(),i(null),!0):!1},[m,p,a,h]),_=(0,W.useCallback)(e=>h(e),[h]);return{isOpen:m,results:p,focusedIndex:a,query:d,isFetching:f.isFetching,cursorTop:s,handleKeyDown:g,onSelect:_,setFocusedIndex:o,setTextareaRef:u}}function ZH(e,t){let n=t.trim().toLowerCase();if(!n)return[];let r=e.toLowerCase(),i=[],a=0;for(let e=0;e<r.length&&a<n.length;e++)if(r[e]===n[a]){let t=i[i.length-1];t&&t[1]===e?t[1]=e+1:i.push([e,e+1]),a++}return a===n.length?i:[]}function QH({text:e,ranges:t}){if(!t.length)return(0,G.jsx)(G.Fragment,{children:e});let n=[],r=0;return t.forEach(([t,i],a)=>{t>r&&n.push(e.slice(r,t)),n.push((0,G.jsx)(`mark`,{className:`mention-highlight`,children:e.slice(t,i)},a)),r=i}),r<e.length&&n.push(e.slice(r)),(0,G.jsx)(G.Fragment,{children:n})}var $H=e=>{let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t+1)},eU=e=>{let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)};function tU({results:e,focusedIndex:t,query:n,cursorTop:r,onSelect:i,onHover:a}){let o=(0,W.useRef)(null);return(0,W.useEffect)(()=>{(o.current?.querySelector(`[data-focused="true"]`))?.scrollIntoView({block:`nearest`})},[t]),e.length===0?null:(0,G.jsx)(`div`,{className:`mention-dropdown`,ref:o,role:`listbox`,"aria-label":`File suggestions`,style:{top:r},children:e.map((e,r)=>{let o=eU(e.path),s=ZH(o,n),c=r===t;return(0,G.jsxs)(`div`,{role:`option`,"aria-selected":c,"data-focused":c,className:`mention-item ${c?`mention-item-focused`:``}`,onMouseDown:t=>{t.preventDefault(),i(e.path)},onMouseEnter:()=>a(r),children:[(0,G.jsx)(`span`,{className:`mention-icon`,children:(0,G.jsx)(qD,{size:13})}),(0,G.jsxs)(`div`,{className:`mention-info`,children:[(0,G.jsx)(`span`,{className:`mention-name`,children:(0,G.jsx)(QH,{text:o,ranges:s})}),(0,G.jsx)(`span`,{className:`mention-dir`,children:$H(e.path)||`./`})]})]},e.path)})})}function nU(e){return e.replace(/@([^\s@]+)/g,(e,t)=>`[${t.split(`/`).pop()||t}](file-mention://${t})`)}function rU({id:e,value:t,onChange:n,placeholder:r,rows:i=3,ariaLabel:a,textareaClassName:o,onSubmitShortcut:s}){let[c,l]=(0,W.useState)(`write`),u=(0,W.useRef)(null),d=(0,W.useRef)(null),f=XH(t,n),p=(0,W.useRef)(t);(0,W.useEffect)(()=>{p.current=t},[t]),(0,W.useEffect)(()=>{c===`preview`&&d.current?.focus()},[c]);let m=async e=>{let r=e.clipboardData.items,i=null;for(let e=0;e<r.length;e++){let t=r[e];if(t.kind===`file`&&t.type.startsWith(`image/`)){i=t.getAsFile();break}}if(!i)return;e.preventDefault();let a=u.current;if(!a)return;let o=a.selectionStart,s=a.selectionEnd,c=Math.random().toString(36).slice(2,8),l=`![Uploading image… ${c}]()`,d=t.slice(0,o)+l+t.slice(s);n(d),p.current=d;try{let e=new FormData;e.append(`file`,i,i.name||`pasted-${c}.png`);let t=await fetch(`/api/attachments`,{method:`POST`,body:e});if(!t.ok)throw Error(`HTTP ${t.status}`);let r=await t.json();if(!r.url)throw Error(r.error||`Upload failed`);n(p.current.replace(l,``))}catch(e){console.error(`Image upload failed:`,e),n(p.current.replace(l,`![upload failed]()`))}};return(0,G.jsxs)(`div`,{className:`md-field`,children:[(0,G.jsxs)(`div`,{className:`comment-form-tabs`,role:`tablist`,"aria-label":`Markdown editor mode`,children:[(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":c===`write`,onClick:()=>l(`write`),onKeyDown:e=>{e.key===`ArrowRight`&&(e.preventDefault(),l(`preview`))},className:`comment-form-tab-btn ${c===`write`?`comment-form-tab-btn-active`:`comment-form-tab-btn-inactive`}`,children:`Write`}),(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":c===`preview`,onClick:()=>l(`preview`),onKeyDown:e=>{e.key===`ArrowLeft`&&(e.preventDefault(),l(`write`))},className:`comment-form-tab-btn ${c===`preview`?`comment-form-tab-btn-active`:`comment-form-tab-btn-inactive`}`,children:`Preview`})]}),c===`write`?(0,G.jsxs)(`div`,{style:{position:`relative`},children:[(0,G.jsx)(`textarea`,{id:e,ref:e=>{u.current=e,f.setTextareaRef(e)},className:o,value:t,rows:i,placeholder:r,"aria-label":a,onChange:e=>n(e.target.value),onPaste:m,onKeyDown:e=>{f.handleKeyDown(e)||(e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),s?.()),e.key===`p`&&(e.metaKey||e.ctrlKey)&&e.shiftKey&&(e.preventDefault(),l(e=>e===`write`?`preview`:`write`)))}}),f.isOpen&&(0,G.jsx)(tU,{results:f.results,focusedIndex:f.focusedIndex,query:f.query,cursorTop:f.cursorTop,onSelect:f.onSelect,onHover:f.setFocusedIndex})]}):(0,G.jsx)(`div`,{ref:d,className:`md-field-preview markdown-body`,role:`tabpanel`,"aria-label":`Markdown preview`,tabIndex:0,onKeyDown:e=>{e.key===`p`&&(e.metaKey||e.ctrlKey)&&e.shiftKey&&(e.preventDefault(),l(`write`))},children:t.trim()?(0,G.jsx)(JH,{content:nU(t)}):(0,G.jsx)(`span`,{className:`md-field-empty`,children:`Nothing to preview`})})]})}var iU=[{value:`approved`,label:`Approve`,description:`The changes look good — the agent can proceed.`,icon:jD,className:`plan-verdict-approve`},{value:`changes-requested`,label:`Request edits`,description:`The agent should address the comments and apply edits.`,icon:sO,className:`plan-verdict-changes`},{value:`rejected`,label:`Reject`,description:`Don't keep building on this — the approach needs rethinking.`,icon:AO,className:`plan-verdict-reject`},{value:`comment-only`,label:`Comment only`,description:`Agent must NOT edit files — only reply to comments. General note goes to chat.`,icon:cO,className:`plan-verdict-comment-only`}];function aU({comments:e,onEditComment:t,onDeleteComment:n,onSend:r,sending:i,agentWaiting:a,onCopyComments:o}){let{haptic:s,sound:c}=lD(),[l,u]=(0,W.useState)(!1),[d,f]=(0,W.useState)(``),[p,m]=(0,W.useState)(null),[h,g]=(0,W.useState)(!1),_=async()=>{o&&(await o(),g(!0),setTimeout(()=>g(!1),2e3))},v=e.length,y=(0,W.useMemo)(()=>[...e].sort((e,t)=>e.createdAt-t.createdAt),[e]),b=async()=>{p&&(s(`heavy`),c(`send`),await r(p,d,p===`comment-only`?`comment-only`:`standard`),f(``),m(null),u(!1))};return(0,G.jsx)(bk,{open:l,onOpenChange:u,ariaLabel:`Submit your review to the agent`,className:`send-review-popover`,trigger:(0,G.jsxs)(`button`,{className:`btn btn-primary btn-sm send-review-btn`,disabled:i,title:a?`An agent is connected and waiting`:`Submit your review to a waiting agent`,style:{display:`inline-flex`,alignItems:`center`,gap:`6px`},children:[a&&(0,G.jsx)(`span`,{className:`agent-waiting-dot`,"aria-hidden":`true`}),(0,G.jsx)(AD,{size:14}),(0,G.jsx)(`span`,{className:`btn-label`,children:i?`Sending…`:v>0?`Send to agent (${v})`:`Send to agent`})]}),children:(0,G.jsxs)(`div`,{className:`srp`,children:[(0,G.jsxs)(`div`,{className:`srp-head`,children:[(0,G.jsx)(AD,{size:15,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`srp-title`,children:`Send review to agent`}),(0,G.jsxs)(`span`,{className:`srp-count`,children:[v,` comment`,v===1?``:`s`]})]}),(0,G.jsx)(`div`,{className:`plan-verdict-options`,role:`radiogroup`,"aria-label":`Verdict`,children:iU.map(e=>{let t=e.icon,n=p===e.value;return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":n,className:`plan-verdict-option ${e.className} ${n?`plan-verdict-option-selected`:``}`,onClick:()=>m(e.value),children:[(0,G.jsx)(`span`,{className:`plan-verdict-icon`,children:(0,G.jsx)(t,{size:15,"aria-hidden":`true`})}),(0,G.jsxs)(`span`,{className:`plan-verdict-text`,children:[(0,G.jsx)(`span`,{className:`plan-verdict-label`,children:e.label}),(0,G.jsx)(`span`,{className:`plan-verdict-desc`,children:e.description})]}),(0,G.jsx)(`span`,{className:`plan-verdict-radio`,"aria-hidden":`true`})]},e.value)})}),v>0?(0,G.jsx)(`ul`,{className:`srp-list`,"aria-label":`Comments to send`,children:y.map(e=>(0,G.jsx)(oU,{comment:e,onEdit:t,onDelete:n},e.id))}):(0,G.jsx)(`p`,{className:`srp-empty`,children:`No inline comments — your verdict and overall note will be sent on their own.`}),(0,G.jsxs)(`div`,{className:`srp-general`,children:[(0,G.jsxs)(`label`,{className:`srp-general-label`,htmlFor:`srp-general-input`,children:[`Overall comment `,(0,G.jsx)(`span`,{className:`srp-optional`,children:`(optional · Markdown)`})]}),(0,G.jsx)(rU,{id:`srp-general-input`,value:d,onChange:f,textareaClassName:`srp-general-input`,placeholder:`Add an overall note for the agent that applies to the whole review…`,rows:3,ariaLabel:`Overall review comment`,onSubmitShortcut:b})]}),(0,G.jsxs)(`div`,{className:`srp-footer`,children:[o&&(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:_,disabled:v===0,style:{marginRight:`auto`},children:h?`Copied!`:`Copy comments`}),(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>u(!1),disabled:i,children:`Cancel`}),(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:b,disabled:!p||i,children:i?`Sending…`:`Send review`})]})]})})}function oU({comment:e,onEdit:t,onDelete:n}){let[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(e.body),s=(0,W.useRef)(null);(0,W.useEffect)(()=>{r&&(s.current?.focus(),s.current?.select())},[r]);let c=e.lineNumber>0?e.startLineNumber&&e.startLineNumber!==e.lineNumber?`:${e.startLineNumber}-${e.lineNumber}`:`:${e.lineNumber}`:` · file`,l=()=>{let n=a.trim();n&&n!==e.body&&t(e.id,n),i(!1)};return(0,G.jsxs)(`li`,{className:`srp-item`,children:[(0,G.jsxs)(`div`,{className:`srp-item-top`,children:[(0,G.jsxs)(`span`,{className:`srp-item-loc`,children:[(0,G.jsx)(`span`,{className:`srp-item-file`,children:tE(e.filePath)}),(0,G.jsx)(`span`,{className:`srp-item-line`,children:c})]}),e.status===`resolved`&&(0,G.jsx)(`span`,{className:`srp-item-resolved`,children:`resolved`}),(0,G.jsxs)(`span`,{className:`srp-item-actions`,children:[r?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:l,title:`Save edit`,children:(0,G.jsx)(jD,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:()=>{o(e.body),i(!1)},title:`Cancel edit`,children:(0,G.jsx)(AO,{size:13,"aria-hidden":`true`})})]}):(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:()=>i(!0),title:`Edit comment`,children:(0,G.jsx)(hO,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`srp-icon-btn srp-icon-btn-danger`,onClick:()=>n(e.id),title:`Remove from review`,children:(0,G.jsx)(TO,{size:13,"aria-hidden":`true`})})]})]}),e.lineContent?.trim()&&(0,G.jsx)(`code`,{className:`srp-item-code`,children:e.lineContent.trim().slice(0,160)}),r?(0,G.jsx)(`textarea`,{ref:s,className:`srp-item-edit`,value:a,rows:2,onChange:e=>o(e.target.value),onKeyDown:t=>{t.key===`Enter`&&(t.metaKey||t.ctrlKey)?(t.preventDefault(),l()):t.key===`Escape`&&(t.preventDefault(),o(e.body),i(!1))}}):(0,G.jsx)(`p`,{className:`srp-item-body`,children:e.body})]})}var sU=[{value:`word`,label:`Word`},{value:`word-alt`,label:`Word (alt)`},{value:`char`,label:`Character`},{value:`none`,label:`None`}],cU=[{value:`classic`,label:`Classic (+/−)`},{value:`bars`,label:`Bars`},{value:`none`,label:`None`}],lU=[{value:`line-info`,label:`Line info + context`},{value:`line-info-basic`,label:`Line info`},{value:`metadata`,label:`Metadata only`},{value:`simple`,label:`Simple`}],uU=[{value:`both`,label:`Both`},{value:`line`,label:`Line only`},{value:`number`,label:`Number only`},{value:`disabled`,label:`Disabled`}],dU=[11,12,13,14,15,16].map(e=>({value:String(e),label:`${e}px`})),fU=[2,4,8].map(e=>({value:String(e),label:String(e)})),pU=[{value:``,label:`Default`},{value:`chrome`,label:`Chrome`},{value:`firefox`,label:`Firefox`},{value:`edge`,label:`Edge`},{value:`brave`,label:`Brave`}],mU=[{value:`default`,label:`Default / System`},{value:`vscode`,label:`VS Code`},{value:`zed`,label:`Zed`},{value:`vim`,label:`Vim`},{value:`neovim`,label:`Neovim`}],hU=(0,W.memo)(function({repoName:e,branch:t,fileCount:n,additions:r,deletions:i,commentCount:a,planCount:o,pendingPlanCount:s,onOpenPlans:c,diffStyle:l,diffOptions:u,defaultTabSize:d,browser:f,theme:p,editorIDE:m,customMode:h,showMode:g,showCommitCount:_,lineDiffType:v,lineWrap:y,diffIndicators:b,showLineNumbers:x,hunkSeparators:S,lineHoverHighlight:C,fontSize:w,haptics:T,sounds:E,uiFont:D,monoFont:O,onDiffStyleChange:k,onDiffOptionsChange:A,onDefaultTabSizeChange:j,onBrowserChange:M,onOpenThemeModal:N,onEditorIDEChange:P,onLineDiffTypeChange:F,onLineWrapChange:I,onDiffIndicatorsChange:L,onShowLineNumbersChange:R,onHunkSeparatorsChange:z,onLineHoverHighlightChange:ee,onFontSizeChange:te,onHapticsChange:B,onSoundsChange:V,onOpenUiFontModal:H,onOpenMonoFontModal:ne,onOpenSearch:re,onCopyComments:ie,onSendToAgent:ae,agentWaiting:oe,sending:se,comments:ce,onEditComment:le,onDeleteComment:ue,sidebarCollapsed:U,onToggleSidebar:de}){let[fe,pe]=(0,W.useState)(!1);return(0,W.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&(e.key===`,`||e.code===`Comma`)&&(e.preventDefault(),pe(e=>!e))};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[]),(0,G.jsxs)(`div`,{className:`toolbar`,children:[(0,G.jsxs)(`div`,{className:`toolbar-left`,children:[de&&(0,G.jsx)(`button`,{className:`toolbar-mobile-toggle`,onClick:de,"aria-label":`Toggle sidebar`,title:U?`Open sidebar`:`Close sidebar`,children:(0,G.jsx)(iO,{size:18})}),(0,G.jsx)(`h1`,{className:`toolbar-title`,children:e}),t&&(0,G.jsxs)(`span`,{className:`toolbar-branch`,children:[(0,G.jsx)(JD,{size:12}),t]}),(0,G.jsx)(`span`,{className:`toolbar-stat`,children:g?(0,G.jsxs)(G.Fragment,{children:[`showing`,` `,(0,G.jsx)(`strong`,{className:`toolbar-stat-count`,children:_}),` `,`commit`,_===1?``:`s`]}):(0,G.jsxs)(G.Fragment,{children:[n,` file`,n===1?``:`s`,` changed`,r>0&&(0,G.jsxs)(`span`,{className:`stat-additions`,children:[` +`,r]}),i>0&&(0,G.jsxs)(`span`,{className:`stat-deletions`,children:[` -`,i]})]})})]}),(0,G.jsxs)(`div`,{className:`toolbar-right`,children:[(0,G.jsxs)(`button`,{className:`btn btn-sm toolbar-search-btn`,onClick:re,title:`Search (⌘K)`,children:[(0,G.jsx)(xO,{size:14,style:{marginRight:`6px`}}),(0,G.jsx)(`span`,{children:`Search`}),(0,G.jsx)(`kbd`,{className:`toolbar-search-kbd`,children:`⌘K`})]}),o>0&&(0,G.jsxs)(`button`,{className:`btn btn-sm toolbar-plans-btn ${s>0?`toolbar-plans-btn-pending`:``}`,onClick:c,title:s>0?`${s} plan${s===1?``:`s`} awaiting your review`:`Review agent plans`,children:[s>0&&(0,G.jsx)(`span`,{className:`agent-waiting-dot`,"aria-hidden":`true`}),(0,G.jsx)(BD,{size:14,style:{marginRight:`6px`}}),(0,G.jsx)(`span`,{children:`Plans`}),s>0&&(0,G.jsx)(`span`,{className:`toolbar-plans-badge`,children:s})]}),(0,G.jsx)(bk,{open:fe,onOpenChange:pe,ariaLabel:`Settings`,className:`settings-popover`,trigger:(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn ${fe?`btn-active`:``}`,title:`Settings`,children:[(0,G.jsx)(SO,{size:14}),` `,(0,G.jsx)(`span`,{className:`btn-label`,children:`Settings`})]}),children:(0,G.jsxs)(`div`,{className:`popover-scroll settings-panel`,children:[!h&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Source`}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:u.staged,onChange:e=>A({...u,staged:e.target.checked})}),`Show staged`]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:u.untracked,onChange:e=>A({...u,untracked:e.target.checked})}),`Show untracked`]})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Display`}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Inline diff`}),(0,G.jsx)(NA,{value:v,onValueChange:e=>F(e),options:sU,ariaLabel:`Inline diff style`})]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:y,onChange:e=>I(e.target.checked)}),`Wrap long lines`]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Diff indicators`}),(0,G.jsx)(NA,{value:b,onValueChange:e=>L(e),options:cU,ariaLabel:`Diff indicators`})]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:x,onChange:e=>R(e.target.checked)}),`Show line numbers`]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Hunk separator`}),(0,G.jsx)(NA,{value:S,onValueChange:e=>z(e),options:lU,ariaLabel:`Hunk separator style`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Hover highlight`}),(0,G.jsx)(NA,{value:C,onValueChange:e=>ee(e),options:uU,ariaLabel:`Hover highlight`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Font size`}),(0,G.jsx)(NA,{value:String(w),onValueChange:e=>te(Number(e)),options:dU,ariaLabel:`Font size`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Default tab size`}),(0,G.jsx)(NA,{value:String(d),onValueChange:e=>j(Number(e)),options:fU,ariaLabel:`Default tab size`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`UI font`}),(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn`,onClick:()=>{pe(!1),H()},style:{display:`inline-flex`,alignItems:`center`},title:D??`Default (Geist Mono)`,children:[(0,G.jsx)(DO,{size:13,style:{marginRight:`4px`}}),(0,G.jsx)(`span`,{style:{maxWidth:`120px`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:D??`Default…`})]})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Code font`}),(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn`,onClick:()=>{pe(!1),ne()},style:{display:`inline-flex`,alignItems:`center`},title:O??`Default (JetBrains Mono)`,children:[(0,G.jsx)(DO,{size:13,style:{marginRight:`4px`}}),(0,G.jsx)(`span`,{style:{maxWidth:`120px`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:O??`Default…`})]})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`External tools`}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Browser`}),(0,G.jsx)(NA,{value:f||``,onValueChange:M,options:pU,ariaLabel:`Browser`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Preferred IDE`}),(0,G.jsx)(NA,{value:m||`default`,onValueChange:P,options:mU,ariaLabel:`Preferred IDE`})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Review Options`}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Diff style`}),(0,G.jsx)(NA,{value:l,onValueChange:e=>k(e),options:[{value:`split`,label:`Split`},{value:`unified`,label:`Unified`}],ariaLabel:`Diff style`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Theme`}),(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn`,onClick:()=>{pe(!1),N()},style:{display:`inline-flex`,alignItems:`center`},children:[(0,G.jsx)(dO,{size:14,style:{marginRight:`4px`}}),(0,G.jsx)(`span`,{children:`Switch Theme...`})]})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Feedback`}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:T,onChange:e=>B(e.target.checked)}),`Haptic feedback`]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:E,onChange:e=>V(e.target.checked)}),`Sound effects`]})]})}),(0,G.jsx)(aU,{comments:ce,onEditComment:le,onDeleteComment:ue,onSend:ae,sending:se,agentWaiting:oe,onCopyComments:ie})]})]})});function gU({commit:e,index:t,total:n}){let[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(!1),s=(0,W.useRef)(null);(0,W.useEffect)(()=>()=>{s.current&&clearTimeout(s.current)},[]);let c=async()=>{try{await navigator.clipboard.writeText(e.sha),i(!0),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>i(!1),1500)}catch{}},l=e.body.trim().length>0,u=e.parents.length>1,d=n>1?`Commit ${t+1} of ${n}: ${e.subject}`:`Commit: ${e.subject}`;return(0,G.jsxs)(`section`,{className:`commit-banner`,"aria-label":d,children:[(0,G.jsxs)(`header`,{className:`commit-banner-header`,children:[(0,G.jsxs)(`div`,{className:`commit-banner-line`,children:[(0,G.jsx)(YD,{size:14,className:`commit-banner-icon`,"aria-hidden":`true`}),(0,G.jsxs)(`button`,{type:`button`,className:`commit-banner-sha`,onClick:c,title:r?`Copied full SHA`:`Click to copy full SHA`,"aria-label":`Copy full SHA ${e.sha}`,children:[(0,G.jsx)(`span`,{className:`commit-banner-sha-text`,children:e.shortSha}),r?(0,G.jsx)(jD,{size:12,className:`commit-banner-sha-icon`,"aria-hidden":`true`}):(0,G.jsx)(UD,{size:12,className:`commit-banner-sha-icon`,"aria-hidden":`true`})]}),u&&(0,G.jsx)(`span`,{className:`commit-banner-merge-badge`,title:`Merge commit with ${e.parents.length} parents`,children:`merge`}),(0,G.jsx)(`h2`,{className:`commit-banner-subject`,children:e.subject})]}),(0,G.jsxs)(`div`,{className:`commit-banner-meta`,children:[(0,G.jsxs)(`span`,{className:`commit-banner-author`,children:[(0,G.jsx)(`span`,{className:`commit-banner-author-name`,children:e.authorName}),(0,G.jsxs)(`span`,{className:`commit-banner-author-email`,children:[`<`,e.authorEmail,`>`]})]}),(0,G.jsx)(`span`,{className:`commit-banner-date`,title:e.authorDate,children:_U(e.authorDate)}),e.committerName!==e.authorName||e.committerEmail!==e.authorEmail?(0,G.jsxs)(`span`,{className:`commit-banner-committer`,title:`Committed by ${e.committerName} <${e.committerEmail}> at ${e.committerDate}`,children:[(0,G.jsx)(`span`,{className:`commit-banner-committer-label`,children:`committed by`}),` `,(0,G.jsx)(`span`,{children:e.committerName})]}):null]})]}),l&&(0,G.jsxs)(`div`,{className:`commit-banner-body`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`commit-banner-body-toggle`,onClick:()=>o(e=>!e),"aria-expanded":a,"aria-controls":`commit-banner-body-${e.shortSha}`,children:[a?(0,G.jsx)(MD,{size:14}):(0,G.jsx)(PD,{size:14}),(0,G.jsx)(qD,{size:13,"aria-hidden":`true`}),(0,G.jsx)(`span`,{children:a?`Hide message`:`Show message`})]}),a&&(0,G.jsx)(`pre`,{id:`commit-banner-body-${e.shortSha}`,className:`commit-banner-body-pre`,children:e.body})]})]})}function _U(e){try{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}catch{return e}}var vU=W.createContext(void 0);function yU(e){let t=W.useContext(vU);if(e===!1&&t===void 0)throw Error(j_(27));return t}var bU={...yT,...lT},xU=W.forwardRef(function(e,t){let{render:n,className:r,forceRender:i=!1,...a}=e,{store:o}=yU(),s=o.useState(`open`),c=o.useState(`nested`),l=o.useState(`mounted`),u=o.useState(`transitionStatus`);return tS(`div`,e,{state:W.useMemo(()=>({open:s,transitionStatus:u}),[s,u]),ref:[o.context.backdropRef,t],stateAttributesMapping:bU,props:[{role:`presentation`,hidden:!l,style:{userSelect:`none`,WebkitUserSelect:`none`}},a],enabled:i||!c})}),SU=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),CU=function(e){return e[e.open=uT.open]=`open`,e[e.closed=uT.closed]=`closed`,e[e.startingStyle=uT.startingStyle]=`startingStyle`,e[e.endingStyle=uT.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),wU=W.createContext(void 0);function TU(){let e=W.useContext(wU);if(e===void 0)throw Error(j_(26));return e}var EU={...yT,...lT,nestedDialogOpen(e){return e?{[CU.nestedDialogOpen]:``}:null}},DU=W.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,...o}=e,{store:s}=yU(),c=s.useState(`descriptionElementId`),l=s.useState(`disablePointerDismissal`),u=s.useState(`floatingRootContext`),d=s.useState(`popupProps`),f=s.useState(`modal`),p=s.useState(`mounted`),m=s.useState(`nested`),h=s.useState(`nestedOpenDialogCount`),g=s.useState(`open`),_=s.useState(`openMethod`),v=s.useState(`titleElementId`),y=s.useState(`transitionStatus`),b=s.useState(`role`);TU(),hw({open:g,ref:s.context.popupRef,onComplete(){g&&s.context.onOpenChangeComplete?.(!0)}});function x(e){return e===`touch`?s.context.popupRef.current:!0}let S=i===void 0?x:i,C=h>0,w=tS(`div`,e,{state:W.useMemo(()=>({open:g,nested:m,transitionStatus:y,nestedDialogOpen:C}),[g,m,y,C]),props:[d,{"aria-labelledby":v??void 0,"aria-describedby":c??void 0,role:b,tabIndex:-1,hidden:!p,onKeyDown(e){hk.has(e.key)&&e.stopPropagation()},style:{[SU.nestedDialogs]:h}},o],ref:[t,s.context.popupRef,s.useStateSetter(`popupElement`)],stateAttributesMapping:EU});return(0,G.jsx)(xS,{context:u,openInteractionType:_,disabled:!p,closeOnFocusOut:!l,initialFocus:S,returnFocus:r,modal:f!==!1,restoreFocus:`popup`,children:w})}),OU=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=yU(),a=i.useState(`mounted`),o=i.useState(`modal`);return a||n?(0,G.jsx)(wU.Provider,{value:n,children:(0,G.jsxs)(uS,{ref:t,...r,children:[a&&o===!0&&(0,G.jsx)(ak,{ref:i.context.internalBackdropRef,inert:ZT(!open)}),e.children]})}):null});function kU(e){let{store:t,parentContext:n,actionsRef:r}=e,i=t.useState(`open`),a=t.useState(`disablePointerDismissal`),o=t.useState(`modal`),s=t.useState(`popupElement`),{openMethod:c,triggerProps:l,reset:u}=GO(i);vw(t);let{forceUnmount:d}=yw(i,t,()=>{u()}),f=X(e=>{let n=ox(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),p=W.useCallback(()=>{t.setOpen(!1,f(ix))},[t,f]);W.useImperativeHandle(r,()=>({unmount:d,close:p}),[d,p]);let m=Ew({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[h,g]=W.useState(0),_=h===0,v=Xw(m),y=LC(m,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=zv(e);if(_&&!a){let e=n;return o&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||Rv(e,s)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:_});RO(i&&o===!0,s);let{getReferenceProps:b,getFloatingProps:x,getTriggerProps:S}=zw([v,y]);t.useContextCallback(`onNestedDialogOpen`,e=>{g(e+1)}),t.useContextCallback(`onNestedDialogClose`,()=>{g(0)}),W.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(h),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,h]);let C=W.useMemo(()=>b(l),[b,l]),w=W.useMemo(()=>S(l),[S,l]),T=W.useMemo(()=>x(),[x]);t.useSyncedValues({openMethod:c,activeTriggerProps:C,inactiveTriggerProps:w,popupProps:T,floatingRootContext:m,nestedOpenDialogCount:h})}var AU={...Cw,modal:Z(e=>e.modal),nested:Z(e=>e.nested),nestedOpenDialogCount:Z(e=>e.nestedOpenDialogCount),disablePointerDismissal:Z(e=>e.disablePointerDismissal),openMethod:Z(e=>e.openMethod),descriptionElementId:Z(e=>e.descriptionElementId),titleElementId:Z(e=>e.titleElementId),viewportElement:Z(e=>e.viewportElement),role:Z(e=>e.role)},jU=class extends uw{constructor(e){super(MU(e),{popupRef:W.createRef(),backdropRef:W.createRef(),internalBackdropRef:W.createRef(),triggerElements:new bw,onOpenChange:void 0,onOpenChangeComplete:void 0},AU)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let n={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit(`openchange`,n);let r={open:e},i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),this.update(r)}};function MU(e={}){return{...Sw(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function NU(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=yU(!0),p=!!f,m=F_(()=>l?.store??new jU({open:n??r,activeTriggerId:u===void 0?d:u,modal:s,disablePointerDismissal:o,nested:p})).current;m.useControlledProp(`open`,n,r),m.useControlledProp(`activeTriggerId`,u,d),m.useSyncedValues({disablePointerDismissal:o,nested:p,modal:s}),m.useContextCallback(`onOpenChange`,i),m.useContextCallback(`onOpenChangeComplete`,a);let h=m.useState(`payload`);kU({store:m,actionsRef:c,parentContext:f?.store.context,onOpenChange:i,triggerIdProp:u});let g=W.useMemo(()=>({store:m}),[m]);return(0,G.jsx)(vU.Provider,{value:g,children:typeof t==`function`?t({payload:h}):t})}function PU({open:e,onClose:t,className:n,ariaLabel:r,initialFocus:i,onKeyDown:a,children:o}){return(0,G.jsx)(NU,{open:e,onOpenChange:e=>{e||t()},children:(0,G.jsxs)(OU,{children:[(0,G.jsx)(xU,{className:`ui-modal-backdrop`}),(0,G.jsx)(DU,{className:`ui-modal-popup ${n??``}`,"aria-label":r,initialFocus:i,onKeyDown:a,children:o})]})})}async function FU(e,t){let n=await fetch(`/api/file-text?path=${encodeURIComponent(e)}&version=${t}`);if(!n.ok){if(n.status===404)return null;throw Error(`HTTP ${n.status} fetching ${t} ${e}`)}let r=await n.json();if(r.missing)return null;if(r.error)throw Error(r.error);return r.content??``}function IU(e,t){let[n,r]=(0,W.useState)({loading:!1,error:null,oldContent:null,newContent:null});return(0,W.useEffect)(()=>{if(!t||!e)return;let n=!1;return r(e=>({...e,loading:!0,error:null})),Promise.all([FU(e,`old`),FU(e,`new`)]).then(([e,t])=>{n||r({loading:!1,error:null,oldContent:e,newContent:t})}).catch(e=>{n||r({loading:!1,error:e.message,oldContent:null,newContent:null})}),()=>{n=!0}},[e,t]),n}var LU=`diffing-draft-`,RU=10080*60*1e3;function zU(...e){return LU+e.join(`:`)}function BU(...e){try{let t=fD(zU(...e));if(!t)return null;let n=JSON.parse(t);return Date.now()-n.timestamp>RU?(_D(zU(...e)),null):n.body}catch{return null}}var VU={};function HU(e,...t){let n=zU(...t);VU[n]&&clearTimeout(VU[n]),VU[n]=setTimeout(()=>{UU(e,...t),delete VU[n]},500)}function UU(e,...t){let n=zU(...t);try{e.trim()?gD(n,JSON.stringify({body:e,timestamp:Date.now()})):_D(n)}catch{}}function WU(...e){try{_D(zU(...e))}catch{}}function GU(e){return e.replace(/@([^\s@]+)/g,(e,t)=>`[${t.split(`/`).pop()||t}](file-mention://${t})`)}function KU({initialBody:e,lineContent:t,draftKey:n,onSubmit:r,onCancel:i}){let{haptic:a,sound:o}=lD(),[s,c]=(0,W.useState)(()=>{if(n){let e=BU(n);if(e)return e}return e||``}),[l,u]=(0,W.useState)(`write`),d=(0,W.useRef)(null),f=(0,W.useRef)(null),p=XH(s,c);(0,W.useEffect)(()=>{l===`write`?d.current?.focus():f.current?.focus()},[l]),(0,W.useEffect)(()=>{n&&HU(s,n)},[s,n]);let m=()=>{let e=s.trim();e&&(n&&WU(n),a(`success`),o(`success`),r(e))},h=e=>{if(!p.handleKeyDown(e)&&(e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m()),e.key===`p`&&(e.metaKey||e.ctrlKey)&&e.shiftKey&&(e.preventDefault(),u(e=>e===`write`?`preview`:`write`)),e.key===`Escape`)){if(s.includes(`
|
|
1934
|
-
`))return;i()}},g=async e=>{let t=e.clipboardData.items,n=null;for(let e=0;e<t.length;e++){let r=t[e];if(r.kind===`file`&&r.type.startsWith(`image/`)){n=r.getAsFile();break}}if(!n)return;e.preventDefault();let r=d.current;if(!r)return;let i=r.selectionStart,a=r.selectionEnd,o=Math.random().toString(36).slice(2,8),s=`![Uploading image… ${o}]()`,l=r.value;c(l.slice(0,i)+s+l.slice(a));try{let e=new FormData;e.append(`file`,n,n.name||`pasted-${o}.png`);let t=await fetch(`/api/attachments`,{method:`POST`,body:e});if(!t.ok)throw Error(`HTTP ${t.status}`);let r=await t.json();if(!r.url)throw Error(r.error||`Upload failed`);let i=``;c(e=>e.replace(s,i))}catch(e){console.error(`Image upload failed:`,e),c(e=>e.replace(s,`![upload failed]()`))}};return(0,G.jsxs)(`div`,{className:`comment-form`,style:{padding:`16px`},role:`form`,"aria-label":`Comment form`,children:[(0,G.jsxs)(`div`,{className:`comment-form-tabs`,role:`tablist`,"aria-label":`Comment form mode`,children:[(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":l===`write`,"aria-controls":`comment-write-panel`,onClick:()=>u(`write`),onKeyDown:e=>{e.key===`ArrowRight`&&(e.preventDefault(),u(`preview`))},className:`comment-form-tab-btn ${l===`write`?`comment-form-tab-btn-active`:`comment-form-tab-btn-inactive`}`,children:`Write`}),(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":l===`preview`,"aria-controls":`comment-preview-panel`,onClick:()=>u(`preview`),onKeyDown:e=>{e.key===`ArrowLeft`&&(e.preventDefault(),u(`write`))},className:`comment-form-tab-btn ${l===`preview`?`comment-form-tab-btn-active`:`comment-form-tab-btn-inactive`}`,children:`Preview`})]}),l===`write`?(0,G.jsxs)(`div`,{style:{position:`relative`},children:[(0,G.jsx)(`textarea`,{id:`comment-write-panel`,ref:e=>{d.current=e,p.setTextareaRef(e)},value:s,onChange:e=>c(e.target.value),onKeyDown:h,onPaste:g,placeholder:`Leave a review comment (supports Markdown and Pasting Clipboard Images)...`,rows:4,"aria-label":`Comment body`,style:{minHeight:`100px`}}),p.isOpen&&(0,G.jsx)(tU,{results:p.results,focusedIndex:p.focusedIndex,query:p.query,cursorTop:p.cursorTop,onSelect:p.onSelect,onHover:p.setFocusedIndex})]}):(0,G.jsxs)(`div`,{id:`comment-preview-panel`,ref:f,role:`tabpanel`,"aria-label":`Preview`,tabIndex:0,onKeyDown:e=>{e.key===`p`&&(e.metaKey||e.ctrlKey)&&e.shiftKey&&(e.preventDefault(),u(`write`))},style:{display:`flex`,flexDirection:`column`,gap:`12px`},children:[(()=>{let e=!!s.match(/```suggestion\n([\s\S]*?)```/);return s.replace(/```suggestion\n([\s\S]*?)```/g,``).trim().length>0||!e?(0,G.jsx)(`div`,{className:`comment-preview markdown-body`,style:{minHeight:`100px`,padding:`12px 16px`,border:`1px solid var(--border-normal)`,borderRadius:`var(--radius-md)`,background:`var(--bg-primary)`,fontSize:`14px`,lineHeight:1.6,color:`var(--text-primary)`,overflowY:`auto`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,overflowWrap:`break-word`},children:s.trim()?(0,G.jsx)(JH,{content:GU(s)}):(0,G.jsx)(`span`,{style:{color:`var(--text-muted)`,fontStyle:`italic`},children:`Nothing to preview`})}):null})(),(()=>{let e=s.match(/```suggestion\n([\s\S]*?)```/),n=!!e,r=e?e[1].trimEnd():``;return n?(0,G.jsxs)(`div`,{className:`suggestion-card`,style:{border:`1px solid var(--border-normal)`,borderRadius:`var(--radius-md)`,overflow:`hidden`,background:`var(--bg-primary)`,boxShadow:`var(--shadow-sm)`},children:[(0,G.jsx)(`div`,{className:`suggestion-header`,style:{padding:`8px 12px`,background:`var(--bg-secondary)`,borderBottom:`1px solid var(--border-normal)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,fontSize:`12px`,fontWeight:600},children:(0,G.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Suggested Change Preview`})}),(0,G.jsxs)(`div`,{className:`suggestion-diff`,style:{display:`flex`,flexDirection:`column`,fontSize:`12px`,fontFamily:`var(--font-mono)`,overflowX:`auto`},children:[t&&(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-danger-bg)`,borderBottom:`1px dashed var(--border-color)`,color:`var(--feedback-danger-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`-`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:t})]}),(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-success-bg)`,color:`var(--feedback-success-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`+`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:r})]})]})]}):null})()]}),(0,G.jsxs)(`div`,{className:`comment-form-actions`,style:{display:`flex`,justifyContent:`flex-end`,gap:`8px`,marginTop:`12px`},children:[(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:i,children:`Cancel`}),(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:m,disabled:!s.trim(),children:e?`Save`:`Comment`})]})]})}function qU({role:e,size:t=16}){return e===`agent`?(0,G.jsx)(`div`,{className:`comment-avatar-circle comment-avatar-agent`,style:{width:`${t*2}px`,height:`${t*2}px`},children:(0,G.jsx)(AD,{size:t,"aria-hidden":`true`})}):(0,G.jsx)(`div`,{className:`comment-avatar-circle comment-avatar-user`,style:{width:`${t*2}px`,height:`${t*2}px`},children:(0,G.jsx)(kO,{size:t,"aria-hidden":`true`})})}function JU({comment:e,onDelete:t}){let[,n]=(0,W.useState)(0),{resolveComment:r,unresolveComment:i,addReply:a,removeReply:o,editReply:s,applySuggestion:c,editComment:l}=xE(),u=e.status===`resolved`,[d,f]=(0,W.useState)(u),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(!1),[_,v]=(0,W.useState)(!1),[y,b]=(0,W.useState)(null),x=(0,W.useRef)(null),S=e.body.replace(/```suggestion\n([\s\S]*?)```/g,``).trim().length>0;(0,W.useEffect)(()=>{f(e.status===`resolved`)},[e.status]),(0,W.useEffect)(()=>{let e=setInterval(()=>n(e=>e+1),3e4);return()=>clearInterval(e)},[]);let C=()=>r(e.id),w=()=>i(e.id),T=e=>{b(e)},E=t=>{o(e.id,t)};return u&&d?(0,G.jsxs)(`div`,{className:`comment-resolved-collapsed`,style:{padding:`12px 18px`,margin:`14px 20px`,background:`var(--bg-secondary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-md)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,opacity:.85,boxShadow:`var(--shadow-sm)`},children:[(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,fontSize:`13px`,color:`var(--text-muted)`},children:[(0,G.jsx)(LD,{size:16,style:{color:`var(--success)`}}),(0,G.jsx)(`span`,{style:{fontWeight:600},children:`Conversation resolved`}),e.lineNumber===0&&(0,G.jsx)(`span`,{style:{padding:`2px 6px`,background:`var(--accent-subtle)`,border:`1px solid var(--primary)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:700,color:`var(--primary)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`File Comment`}),e.startLineNumber&&e.startLineNumber!==e.lineNumber&&(0,G.jsxs)(`span`,{style:{padding:`2px 6px`,background:`var(--bg-primary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text-secondary)`},children:[`L`,e.startLineNumber,`-`,e.lineNumber]}),(0,G.jsx)(`span`,{children:`•`}),(0,G.jsx)(`span`,{children:e.replies?.length>0?`${e.replies.length+1} comments`:`1 comment`})]}),(0,G.jsx)(`button`,{style:{background:`none`,border:`none`,color:`var(--primary)`,fontSize:`12px`,fontWeight:600,cursor:`pointer`},onClick:()=>f(!1),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),f(!1))},"aria-label":`Show resolved conversation`,children:`Show resolved`})]}):h?(0,G.jsx)(`div`,{className:`comment-bubble-canvas`,id:`comment-${e.id}`,role:`article`,"aria-label":`Edit comment`,children:(0,G.jsxs)(`div`,{className:`comment-node`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(qU,{role:`user`,size:16})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge comment-node-badge-user`,children:`User`}),(0,G.jsxs)(`span`,{className:`comment-node-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`,flexWrap:`wrap`},children:[eE(e.createdAt),e.lineNumber===0&&(0,G.jsx)(`span`,{style:{padding:`1px 5px`,background:`var(--accent-subtle)`,border:`1px solid var(--primary)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:700,color:`var(--primary)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`File Comment`}),e.startLineNumber&&e.startLineNumber!==e.lineNumber&&(0,G.jsxs)(`span`,{style:{padding:`1px 5px`,background:`var(--bg-primary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text-secondary)`},children:[`L`,e.startLineNumber,`-`,e.lineNumber]})]})]}),(0,G.jsx)(`div`,{style:{marginTop:`8px`},children:(0,G.jsx)(KU,{draftKey:`edit:${e.id}`,initialBody:e.body,lineContent:e.lineContent,onSubmit:t=>{l(e.id,t),g(!1)},onCancel:()=>g(!1)})})]})]})}):(0,G.jsxs)(`div`,{className:`comment-bubble-canvas ${u?`comment-bubble-canvas-resolved`:``}`,id:`comment-${e.id}`,role:`article`,"aria-label":e.lineNumber===0?`File-level comment`:`Comment by user on line ${e.lineNumber}`,children:[(0,G.jsxs)(`div`,{className:`comment-node ${u?`comment-node-resolved`:``}`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(qU,{role:`user`,size:16})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge comment-node-badge-user`,children:`User`}),(0,G.jsxs)(`span`,{className:`comment-node-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`,flexWrap:`wrap`},children:[eE(e.createdAt),e.lineNumber===0&&(0,G.jsx)(`span`,{style:{padding:`1px 5px`,background:`var(--accent-subtle)`,border:`1px solid var(--primary)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:700,color:`var(--primary)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`File Comment`}),e.startLineNumber&&e.startLineNumber!==e.lineNumber&&(0,G.jsxs)(`span`,{style:{padding:`1px 5px`,background:`var(--bg-primary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text-secondary)`},children:[`L`,e.startLineNumber,`-`,e.lineNumber]})]}),u&&(0,G.jsxs)(`span`,{className:`comment-canvas-resolved-banner`,style:{marginLeft:`8px`},children:[(0,G.jsx)(LD,{size:13}),`Resolved`]}),!u&&(0,G.jsxs)(`div`,{className:`comment-node-actions`,children:[(0,G.jsx)(`button`,{ref:x,className:`comment-node-btn`,onClick:()=>g(!0),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),g(!0))},title:`Edit comment`,"aria-label":`Edit comment`,tabIndex:0,children:(0,G.jsx)(hO,{size:13,"aria-hidden":`true`})}),_?(0,G.jsxs)(`div`,{className:`comment-delete-confirm`,style:{display:`flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsxs)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>t(e.id),title:`Confirm delete`,"aria-label":`Confirm delete comment`,style:{color:`var(--danger)`,background:`var(--feedback-danger-bg)`,fontWeight:600,fontSize:`11px`,borderRadius:`var(--radius-sm)`,border:`1px solid var(--feedback-danger-border)`,padding:`2px 6px`,cursor:`pointer`,display:`flex`,alignItems:`center`,gap:`2px`,width:`auto`,height:`auto`},children:[(0,G.jsx)(EO,{size:11}),`Delete?`]}),(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>v(!1),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),v(!1))},title:`Cancel delete`,"aria-label":`Cancel delete`,style:{fontSize:`11px`,padding:`2px 6px`,width:`auto`,height:`auto`},children:`Cancel`})]}):(0,G.jsx)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>v(!0),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),v(!0))},title:`Delete comment`,"aria-label":`Delete comment`,tabIndex:0,children:(0,G.jsx)(TO,{size:13,"aria-hidden":`true`})})]})]}),S&&(0,G.jsx)(JH,{content:e.body,className:`comment-node-body markdown-body ${u?`comment-resolved-line`:``}`}),(()=>{let t=e.body.match(/```suggestion\n([\s\S]*?)```/),n=!!t&&e.side===`additions`,r=t?t[1].trimEnd():``;return n?(0,G.jsxs)(`div`,{className:`suggestion-card`,style:{marginTop:`12px`,marginBottom:`4px`,border:`1px solid var(--border-normal)`,borderRadius:`var(--radius-md)`,overflow:`hidden`,background:`var(--bg-primary)`,boxShadow:`var(--shadow-sm)`},children:[(0,G.jsxs)(`div`,{className:`suggestion-header`,style:{padding:`8px 12px`,background:`var(--bg-secondary)`,borderBottom:`1px solid var(--border-normal)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,fontSize:`12px`,fontWeight:600},children:[(0,G.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Suggested Change`}),u?(0,G.jsxs)(`span`,{style:{color:`var(--feedback-success-text)`,display:`inline-flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsx)(LD,{size:12}),` Applied`]}):(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:async()=>{try{await c(e.id)}catch(e){alert(e.message)}},style:{fontSize:`11px`,padding:`2px 8px`,borderRadius:`var(--radius-sm)`,height:`24px`},children:`Apply Suggestion`})]}),(0,G.jsxs)(`div`,{className:`suggestion-diff`,style:{display:`flex`,flexDirection:`column`,fontSize:`12px`,fontFamily:`var(--font-mono)`,overflowX:`auto`},children:[(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-danger-bg)`,borderBottom:`1px dashed var(--border-color)`,color:`var(--feedback-danger-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`-`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:e.lineContent})]}),(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-success-bg)`,color:`var(--feedback-success-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`+`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:r})]})]})]}):null})()]})]}),e.replies?.length>0&&(0,G.jsx)(`div`,{className:`comment-replies`,role:`list`,"aria-label":`Replies`,children:e.replies.map((t,n)=>{let r=t.role===`agent`,i=y===t.id;return(0,G.jsxs)(`div`,{className:`comment-node ${r?`comment-node-agent`:`comment-node-user`} ${u?`comment-node-resolved`:``}`,role:`listitem`,"aria-label":`${r?`Agent`:`User`} reply ${n+1}`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(qU,{role:r?`agent`:`user`,size:14})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:r?`Agent`:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge ${r?`comment-node-badge-agent`:`comment-node-badge-user`}`,children:r?`Agent`:`User`}),r&&t.model&&(0,G.jsx)(`span`,{style:{fontSize:`10px`,fontWeight:600,padding:`1px 5px`,borderRadius:`4px`,background:`var(--bg-tertiary)`,color:`var(--text-secondary)`,fontFamily:`var(--font-mono)`},children:t.model}),(0,G.jsx)(`span`,{className:`comment-node-time`,children:eE(t.createdAt)}),!u&&(0,G.jsxs)(`div`,{className:`comment-node-actions`,children:[(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>T(t.id),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),T(t.id))},title:`Edit reply`,"aria-label":`Edit reply`,tabIndex:0,children:(0,G.jsx)(hO,{size:12,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>E(t.id),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),E(t.id))},title:`Delete reply`,"aria-label":`Delete reply`,tabIndex:0,children:(0,G.jsx)(TO,{size:12,"aria-hidden":`true`})})]})]}),i?(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`var(--radius-md)`,border:`1px solid var(--border-color)`,marginTop:`6px`},children:(0,G.jsx)(KU,{draftKey:`reply-edit:${e.id}:${t.id}`,initialBody:t.body,onSubmit:n=>{s(e.id,t.id,n),b(null)},onCancel:()=>b(null)})}):(0,G.jsx)(JH,{content:t.body,className:`comment-node-body markdown-body`})]})]},t.id)})}),(0,G.jsxs)(`div`,{className:`comment-canvas-footer`,children:[!p&&(0,G.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,G.jsxs)(`button`,{onClick:()=>m(!0),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),m(!0))},className:`comment-reply-trigger`,"aria-label":`Write a reply`,tabIndex:0,style:{width:`100%`,maxWidth:`320px`},children:[(0,G.jsx)(vO,{size:14,"aria-hidden":`true`}),`Reply...`]}),u?(0,G.jsxs)(`div`,{style:{display:`flex`,gap:`6px`,marginLeft:`12px`},children:[(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:()=>f(!0),style:{fontSize:`12px`,padding:`4px 10px`},"aria-label":`Hide resolved conversation`,children:`Hide`}),(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:w,style:{fontSize:`12px`,padding:`4px 10px`},"aria-label":`Unresolve conversation`,children:`Unresolve`})]}):(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:C,style:{fontSize:`12px`,padding:`4px 10px`,marginLeft:`12px`},"aria-label":`Resolve conversation`,children:`Resolve conversation`})]}),p&&(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`var(--radius-md)`,border:`1px solid var(--border-color)`,marginTop:`4px`},children:(0,G.jsx)(KU,{draftKey:`reply:${e.id}`,onSubmit:t=>{a(e.id,t),m(!1)},onCancel:()=>{m(!1),x.current?.focus()}})})]})]})}var YU=(0,W.memo)(function({id:e,fileDiff:t,filePath:n,annotations:r,diffStyle:i,tabSize:a,viewed:o,theme:s,editorIDE:c,lineDiffType:l,lineWrap:u,diffIndicators:d,showLineNumbers:f,hunkSeparators:p,lineHoverHighlight:m,fontSize:h,monoFontFamily:g,expandContextByDefault:_,collapsedContextThreshold:v,expansionLineCount:y,onViewedChange:b,onAddComment:x,onDeleteComment:S}){let[C,w]=(0,W.useState)(null),[T,E]=(0,W.useState)(null),[D,O]=(0,W.useState)(0),[k,A]=(0,W.useState)(null),[j,M]=(0,W.useState)(!1),[N,P]=(0,W.useState)(o),[F,I]=(0,W.useState)(!1),[L,R]=(0,W.useState)(!1),[z,ee]=(0,W.useState)(_),[te,B]=(0,W.useState)(null),[V,H]=(0,W.useState)(null),[ne,re]=(0,W.useState)(null),ie=(0,W.useRef)(null),ae=e=>{e.stopPropagation(),!(typeof navigator>`u`||!navigator.clipboard)&&navigator.clipboard.writeText(n).then(()=>{M(!0),window.setTimeout(()=>M(!1),1500)},()=>{})},oe=async(e,t=!1)=>{if(te===null&&!(!t&&typeof window<`u`&&!window.confirm(`Revert hunk #${e+1} in ${n}? This rewrites the file via "git apply --reverse".`))){B(e),H(null);try{let t=await fetch(`/api/revert-hunk`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:n,hunkIndex:e})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`HTTP ${t.status}`)}}catch(e){H(e.message)}finally{B(null)}}},se=t.type===`change`||t.type===`rename-changed`,ce=!N&&se,{loading:le,oldContent:ue,newContent:U}=IU(n,z&&ce),de=z&&ue!==null&&U!==null,fe=t.prevName??n;(0,W.useEffect)(()=>{P(o)},[o]);let pe=nE[s]||nE.nord,me=(0,W.useMemo)(()=>ZU(a,h,g),[a,h,g]),he=(e,n,r)=>{let i=r&&r!==n?r:n,a=n,o=[];for(let n=i;n<=a;n++){let r=e===`additions`?t.additionLines:t.deletionLines,i=e===`additions`?`additionStart`:`deletionStart`,a=e===`additions`?`additionCount`:`deletionCount`,s=e===`additions`?`additionLineIndex`:`deletionLineIndex`,c=!1;for(let e of t.hunks){let t=e[i],l=e[a];if(n>=t&&n<t+l){let i=e[s]+(n-t);o.push(r[i]??``),c=!0;break}}c||o.push(``)}return o.join(`
|
|
1935
|
-
`)},ge=async e=>{if(e.stopPropagation(),t.type!==`deleted`){I(!0);try{await fetch(`/api/open-file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:n,editor:c})})}catch(e){console.error(`Failed to open file in IDE editor:`,e)}finally{I(!1)}}},_e=()=>{switch(t.type){case`new`:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-new`,children:`Added`});case`deleted`:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-deleted`,children:`Deleted`});case`rename-pure`:case`rename-changed`:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-renamed`,children:`Renamed`});default:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-modified`,children:`Modified`})}},ve=r.filter(e=>e.lineNumber===0),ye=r.filter(e=>e.lineNumber>0),be=e=>`_pending`in e.metadata?(0,G.jsx)(KU,{draftKey:`new:${n}:${C.side}:${C.startLineNumber||C.lineNumber}:${C.lineNumber}`,lineContent:he(C.side,C.lineNumber,C.startLineNumber),onSubmit:e=>{let t=he(C.side,C.lineNumber,C.startLineNumber);x(n,C.side,C.lineNumber,t,e,C.startLineNumber),w(null),E(null)},onCancel:()=>{w(null),E(null)}}):(0,G.jsx)(JU,{comment:e.metadata,onDelete:S}),xe=e=>(0,G.jsx)(`button`,{className:`gutter-add-btn`,onClick:()=>{let t=e();t&&w({side:t.side,lineNumber:t.lineNumber})},children:`+`}),Se=[...ye,...C?[{side:C.side,lineNumber:C.lineNumber,metadata:{_pending:!0}}]:[]];return(0,G.jsxs)(`div`,{ref:ie,className:`file-diff-card ${o?`file-diff-viewed`:``} ${N?`file-diff-collapsed`:``}`,id:e,children:[(0,G.jsxs)(`div`,{className:`file-diff-card-header`,onClick:()=>P(!N),children:[(0,G.jsxs)(`div`,{className:`file-diff-header-left`,children:[(0,G.jsx)(`span`,{className:`file-diff-collapse-indicator`,children:N?(0,G.jsx)(PD,{size:14}):(0,G.jsx)(MD,{size:14})}),(0,G.jsx)(`span`,{className:`file-diff-name`,title:n,children:n}),(0,G.jsx)(`button`,{className:`file-diff-copy-path-btn`,onClick:ae,title:`Copy file path to clipboard`,"aria-label":`Copy file path to clipboard`,children:j?(0,G.jsx)(jD,{size:12}):(0,G.jsx)(UD,{size:12})}),_e(),ye.length>0&&(0,G.jsxs)(`span`,{className:`file-diff-comment-badge`,title:`${ye.length} inline comment${ye.length===1?``:`s`}`,children:[(0,G.jsx)(cO,{size:10}),ye.length]}),D>0&&(0,G.jsxs)(`span`,{className:`file-diff-selection-badge`,"aria-live":`polite`,children:[D,` line`,D===1?``:`s`,` selected`]}),j&&(0,G.jsx)(`span`,{className:`file-diff-permalink-flash`,role:`status`,children:`Copied path`}),k&&(0,G.jsxs)(`span`,{className:`file-diff-permalink-flash`,role:`status`,children:[`Copied `,k]})]}),(0,G.jsxs)(`div`,{className:`file-diff-header-right`,onClick:e=>e.stopPropagation(),children:[ce&&(0,G.jsxs)(`button`,{className:`file-diff-edit-btn ${z?`btn-active`:``}`,onClick:()=>ee(e=>!e),disabled:le,title:z?`Hide unchanged context (use original patch render)`:`Load full file so unchanged context becomes expandable`,children:[le?(0,G.jsx)(nO,{size:11,className:`spin`}):(0,G.jsx)(rO,{size:11}),(0,G.jsx)(`span`,{children:le?`Loading…`:z?`Hide Context`:`Expand Context`})]}),t.type!==`deleted`&&(0,G.jsxs)(`button`,{className:`file-diff-edit-btn`,onClick:ge,disabled:F,title:`Open and edit full file locally`,children:[(0,G.jsx)(mO,{size:11}),(0,G.jsx)(`span`,{children:F?`Opening...`:`Edit File`})]}),(0,G.jsxs)(`button`,{className:`file-diff-edit-btn`,onClick:()=>{P(!1),R(!0)},title:`Comment on this entire file`,children:[(0,G.jsx)(cO,{size:11}),(0,G.jsx)(`span`,{children:`Add Comment`})]}),(0,G.jsxs)(`label`,{className:`viewed-label ${o?`viewed-checked`:``}`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>b(n,e.target.checked)}),`Viewed`]})]})]}),!N&&t.hunks.length>0&&(0,G.jsxs)(`div`,{className:`file-diff-hunk-actions`,onClick:e=>e.stopPropagation(),children:[(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`},children:[(0,G.jsx)(`span`,{className:`file-diff-hunk-actions-label`,style:{display:`inline-flex`,alignItems:`center`,gap:`4px`},children:`Selective Revert`}),(0,G.jsx)($T,{content:`Selective Revert lets you preview and undo specific blocks of changes (hunks) in this file using 'git apply --reverse'.`,side:`top`,children:(0,G.jsx)(RD,{size:12,style:{color:`var(--text-muted)`,cursor:`help`}})}),(0,G.jsx)(`span`,{style:{color:`var(--text-muted)`,fontSize:`11px`,margin:`0 4px`},children:`·`}),(0,G.jsxs)(`span`,{style:{color:`var(--text-secondary)`,fontSize:`11px`},children:[t.hunks.length,` block`,t.hunks.length===1?``:`s`,` available`]})]}),(0,G.jsx)(`div`,{className:`file-diff-hunk-actions-buttons`,children:t.hunks.map((e,t)=>(0,G.jsxs)(`button`,{type:`button`,className:`file-diff-hunk-revert-btn`,onClick:()=>re(t),disabled:te!==null,title:`Preview and revert hunk #${t+1} (lines @${e.additionStart}+${e.additionLines??e.additionCount})`,children:[te===t?(0,G.jsx)(nO,{size:10,className:`spin`}):(0,G.jsx)(OO,{size:10}),(0,G.jsxs)(`span`,{children:[`Hunk #`,t+1]})]},t))}),V&&(0,G.jsxs)(`span`,{className:`file-diff-hunk-error`,role:`alert`,children:[(0,G.jsx)(ID,{size:11}),V]})]}),ne!==null&&(()=>{let e=t.hunks[ne];if(!e)return null;let r=t.deletionLines.slice(e.deletionLineIndex,e.deletionLineIndex+(e.deletionCount??e.deletionLines??0)),i=t.additionLines.slice(e.additionLineIndex,e.additionLineIndex+(e.additionStart!==void 0&&e.additionLines!==void 0?e.additionLines:e.additionCount??0));return(0,G.jsxs)(PU,{open:ne!==null,onClose:()=>re(null),className:`hunk-revert-modal`,ariaLabel:`Selective Revert Preview Hunk #${ne+1}`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header-title`,children:[(0,G.jsx)(OO,{size:18,className:`shortcuts-icon`}),(0,G.jsxs)(`h2`,{children:[`Revert Hunk #`,ne+1]})]}),(0,G.jsx)(`button`,{className:`shortcuts-close-btn`,onClick:()=>re(null),"aria-label":`Close dialog`,children:(0,G.jsx)(AO,{size:16})})]}),(0,G.jsxs)(`div`,{className:`shortcuts-body`,children:[(0,G.jsxs)(`div`,{className:`hunk-preview-intro`,children:[`Reverting this hunk will restore the deleted (`,(0,G.jsx)(`span`,{style:{color:`var(--feedback-danger-text)`,fontWeight:600},children:`red`}),`) lines and remove the added (`,(0,G.jsx)(`span`,{style:{color:`var(--feedback-success-text)`,fontWeight:600},children:`green`}),`) lines from `,(0,G.jsx)(`strong`,{children:n.split(`/`).pop()}),`.`]}),(0,G.jsxs)(`div`,{className:`hunk-preview-container`,children:[(0,G.jsxs)(`div`,{className:`hunk-preview-header`,children:[(0,G.jsx)(`span`,{children:n}),(0,G.jsxs)(`span`,{children:[`Lines: @-`,e.deletionStart,`,`,e.deletionCount??e.deletionLines??0,` @+`,e.additionStart,`,`,e.additionLines??e.additionCount??0]})]}),(0,G.jsxs)(`div`,{className:`hunk-preview-code`,children:[r.map((e,t)=>(0,G.jsxs)(`div`,{className:`hunk-preview-line hunk-preview-line-deletion`,children:[(0,G.jsx)(`span`,{className:`hunk-preview-sign`,children:`-`}),(0,G.jsx)(`span`,{className:`hunk-preview-text`,children:e})]},`del-${t}`)),i.map((e,t)=>(0,G.jsxs)(`div`,{className:`hunk-preview-line hunk-preview-line-addition`,children:[(0,G.jsx)(`span`,{className:`hunk-preview-sign`,children:`+`}),(0,G.jsx)(`span`,{className:`hunk-preview-text`,children:e})]},`add-${t}`)),r.length===0&&i.length===0&&(0,G.jsx)(`div`,{className:`hunk-preview-line`,style:{fontStyle:`italic`,color:`var(--text-muted)`},children:`No changes in this hunk.`})]})]}),(0,G.jsx)(XU,{filePath:n,deletionStart:e.deletionStart,deletionCount:e.deletionCount??e.deletionLines??0})]}),(0,G.jsxs)(`div`,{className:`modal-footer`,children:[(0,G.jsx)(`button`,{className:`hunk-revert-btn-secondary`,onClick:()=>re(null),children:`Cancel`}),(0,G.jsx)(`button`,{className:`hunk-revert-btn-primary`,onClick:async()=>{let e=ne;re(null),await oe(e,!0)},children:`Revert Changes`})]})]})})(),!N&&(0,G.jsxs)(`div`,{className:`file-diff-card-body`,children:[(ve.length>0||L)&&(0,G.jsxs)(`div`,{className:`file-level-comments-section`,style:{margin:`16px 20px`,padding:`12px`,background:`rgba(255,255,255,0.02)`,border:`1px solid var(--border-color)`,borderRadius:`8px`,display:`flex`,flexDirection:`column`,gap:`12px`},children:[(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`,fontSize:`13px`,fontWeight:600,color:`var(--text-secondary)`},children:[(0,G.jsx)(cO,{size:14}),(0,G.jsxs)(`span`,{children:[`File-Level Comments (`,ve.length,`)`]})]}),ve.length>0&&(0,G.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`12px`},children:ve.map(e=>(0,G.jsx)(JU,{comment:e.metadata,onDelete:S},e.metadata.id))}),L&&(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`6px`,border:`1px solid var(--border-color)`},children:(0,G.jsx)(KU,{draftKey:`file-comment:${n}`,lineContent:``,onSubmit:e=>{x(n,`additions`,0,``,e),R(!1)},onCancel:()=>R(!1)})})]}),de?(0,G.jsx)(Xg,{oldFile:{name:fe,contents:ue??``},newFile:{name:n,contents:U??``},options:{diffStyle:i,enableGutterUtility:!0,enableLineSelection:!0,disableFileHeader:!0,lineDiffType:l,overflow:u?`wrap`:`scroll`,diffIndicators:d,disableLineNumbers:!f,hunkSeparators:p,lineHoverHighlight:m,expandUnchanged:!1,collapsedContextThreshold:v,expansionLineCount:y,onLineSelectionStart:()=>{E(null),O(0)},onLineSelectionChange:e=>{O(e?Math.abs(e.end-e.start)+1:0)},onLineSelectionEnd:e=>{O(0),e&&(E(e),w({side:e.endSide||`additions`,lineNumber:e.end,startLineNumber:e.start}))},onLineNumberClick:e=>{let t=`${n}:${e.annotationSide===`deletions`?`-`:`+`}${e.lineNumber}`;navigator.clipboard?.writeText(t).then(()=>{A(t),setTimeout(()=>A(null),1600)},()=>{})},theme:{dark:pe.type===`dark`?pe.themeName:`nord`,light:pe.type===`light`?pe.themeName:`github-light`},themeType:pe.type,unsafeCSS:me},selectedLines:T,lineAnnotations:Se,renderHeaderMetadata:()=>null,renderAnnotation:be,renderGutterUtility:xe}):(0,G.jsx)(Yg,{fileDiff:t,options:{diffStyle:i,enableGutterUtility:!0,enableLineSelection:!0,disableFileHeader:!0,lineDiffType:l,overflow:u?`wrap`:`scroll`,diffIndicators:d,disableLineNumbers:!f,hunkSeparators:p,lineHoverHighlight:m,onLineSelectionStart:()=>{E(null),O(0)},onLineSelectionChange:e=>{O(e?Math.abs(e.end-e.start)+1:0)},onLineSelectionEnd:e=>{O(0),e&&(E(e),w({side:e.endSide||`additions`,lineNumber:e.end,startLineNumber:e.start}))},onLineNumberClick:e=>{let t=`${n}:${e.annotationSide===`deletions`?`-`:`+`}${e.lineNumber}`;navigator.clipboard?.writeText(t).then(()=>{A(t),setTimeout(()=>A(null),1600)},()=>{})},theme:{dark:pe.type===`dark`?pe.themeName:`nord`,light:pe.type===`light`?pe.themeName:`github-light`},themeType:pe.type,unsafeCSS:me},selectedLines:T,lineAnnotations:Se,renderHeaderMetadata:()=>null,renderAnnotation:e=>`_pending`in e.metadata?(0,G.jsx)(KU,{draftKey:`new:${n}:${C.side}:${C.startLineNumber||C.lineNumber}:${C.lineNumber}`,lineContent:he(C.side,C.lineNumber,C.startLineNumber),onSubmit:e=>{let t=he(C.side,C.lineNumber,C.startLineNumber);x(n,C.side,C.lineNumber,t,e,C.startLineNumber),w(null),E(null)},onCancel:()=>{w(null),E(null)}}):(0,G.jsx)(JU,{comment:e.metadata,onDelete:S}),renderGutterUtility:e=>(0,G.jsx)(`button`,{className:`gutter-add-btn`,onClick:()=>{let t=e();t&&w({side:t.side,lineNumber:t.lineNumber})},children:`+`})})]})]})});function XU({filePath:e,deletionStart:t,deletionCount:n}){let[r,i]=(0,W.useState)(null),[a,o]=(0,W.useState)(!1),[s,c]=(0,W.useState)(null);if((0,W.useEffect)(()=>{let r=!0;return(async()=>{o(!0),c(null);try{let a=new URLSearchParams({filePath:e,deletionStart:String(t),deletionCount:String(n)}),o=await fetch(`/api/hunk-history?${a}`);if(!o.ok)throw Error(`HTTP ${o.status}`);let s=await o.json();r&&i(s)}catch(e){r&&c(e.message||`Failed to fetch hunk history`)}finally{r&&o(!1)}})(),()=>{r=!1}},[e,t,n]),a)return(0,G.jsxs)(`div`,{className:`hunk-history-loading`,children:[(0,G.jsx)(nO,{size:14,className:`spin`,style:{marginRight:`8px`}}),(0,G.jsx)(`span`,{children:`Loading git history & origin blame…`})]});if(s)return(0,G.jsxs)(`div`,{className:`hunk-history-error`,children:[(0,G.jsx)(ID,{size:14,style:{color:`var(--feedback-danger-text)`,marginRight:`8px`}}),(0,G.jsxs)(`span`,{children:[`Failed to load git history: `,s]})]});if(!r)return null;let l=Array.from(new Map(r.blame.map(e=>[e.commit,e])).values());return(0,G.jsxs)(`div`,{className:`hunk-history-section`,children:[l.length>0&&(0,G.jsxs)(`div`,{className:`hunk-history-block`,children:[(0,G.jsx)(`h3`,{className:`hunk-history-title`,children:`Commit(s) introducing deleted lines`}),(0,G.jsx)(`div`,{className:`hunk-history-commits`,children:l.map(e=>(0,G.jsxs)(`div`,{className:`hunk-history-commit-card`,children:[(0,G.jsxs)(`div`,{className:`hunk-history-commit-header`,children:[(0,G.jsx)(`span`,{className:`hunk-history-commit-hash`,children:e.commit}),(0,G.jsxs)(`span`,{className:`hunk-history-commit-author`,children:[(0,G.jsx)(kO,{size:11}),(0,G.jsx)(`span`,{children:e.author})]}),(0,G.jsxs)(`span`,{className:`hunk-history-commit-date`,children:[(0,G.jsx)(VD,{size:11}),(0,G.jsx)(`span`,{children:e.date})]})]}),(0,G.jsx)(`div`,{className:`hunk-history-commit-msg`,children:e.summary})]},e.commit))})]}),r.recentCommits.length>0&&(0,G.jsxs)(`div`,{className:`hunk-history-block`,children:[(0,G.jsx)(`h3`,{className:`hunk-history-title`,children:`Recent File Modification History`}),(0,G.jsx)(`div`,{className:`hunk-history-log`,children:r.recentCommits.map(e=>(0,G.jsxs)(`div`,{className:`hunk-history-log-row`,children:[(0,G.jsx)(`span`,{className:`hunk-history-log-hash`,children:e.hash}),(0,G.jsx)(`span`,{className:`hunk-history-log-msg`,title:e.summary,children:e.summary}),(0,G.jsx)(`span`,{className:`hunk-history-log-author`,children:e.author}),(0,G.jsx)(`span`,{className:`hunk-history-log-date`,children:e.date})]},e.hash))})]})]})}function ZU(e,t,n){return`
|
|
1932
|
+
`,1;if(L>1e5&&L>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return P+=a,a.length}let D=N(e);if(!D)throw _e(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=Ee(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let P=``,F=0,I=0,L=0,R=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){L++,R?R=!1:A.matcher.considerAll(),A.matcher.lastIndex=I;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(I,e.index),e);I=e.index+t}E(n.substring(I))}return M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:F,illegal:!1,_emitter:M,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:je(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:I,context:n.slice(I-100,I+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{language:e,value:je(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:je(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(N).filter(F).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1;if(N(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(z(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Ae(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),z(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Me(l,e)}let E=()=>{k(),ye(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),ye(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(_e(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)_e(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&P(i.aliases,{languageName:n})}function j(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function M(){return Object.keys(t)}function N(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function P(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function F(e){let t=N(e);return t&&!t.disableAutodetect}function I(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function L(e){I(e),a.push(e)}function R(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function z(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function ee(e){return ye(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),ye(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:ee,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:N,registerAliases:P,autoDetection:F,inherit:Me,addPlugin:L,removePlugin:R}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=ke,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in ie)typeof ie[e]==`object`&&n(ie[e]);return Object.assign(e,ie),e},Ie=Fe({});Ie.newInstance=()=>Fe({}),t.exports=Ie,Ie.HighlightJS=Ie,Ie.default=Ie}))()).default,mH={},hH=`hljs-`;function gH(e){let t=pH.newInstance();return e&&a(e),{highlight:n,highlightAuto:r,listLanguages:i,register:a,registerAlias:o,registered:s};function n(e,n,r){let i=r||mH,a=typeof i.prefix==`string`?i.prefix:hH;if(!t.getLanguage(e))throw Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:_H,classPrefix:a});let o=t.highlight(n,{ignoreIllegals:!0,language:e});if(o.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:o.errorRaised});let s=o._emitter.root,c=s.data;return c.language=o.language,c.relevance=o.relevance,s}function r(e,r){let a=(r||mH).subset||i(),o=-1,s=0,c;for(;++o<a.length;){let i=a[o];if(!t.getLanguage(i))continue;let l=n(i,e,r);l.data&&l.data.relevance!==void 0&&l.data.relevance>s&&(s=l.data.relevance,c=l)}return c||{type:`root`,children:[],data:{language:void 0,relevance:s}}}function i(){return t.listLanguages()}function a(e,n){if(typeof e==`string`)t.registerLanguage(e,n);else{let n;for(n in e)Object.hasOwn(e,n)&&t.registerLanguage(n,e[n])}}function o(e,n){if(typeof e==`string`)t.registerAliases(typeof n==`string`?n:[...n],{languageName:e});else{let n;for(n in e)if(Object.hasOwn(e,n)){let r=e[n];t.registerAliases(typeof r==`string`?r:[...r],{languageName:n})}}}function s(e){return!!t.getLanguage(e)}}var _H=class{constructor(e){this.options=e,this.root={type:`root`,children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e===``)return;let t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&n.type===`text`?n.value+=e:t.children.push({type:`text`,value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){let n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:`element`,tagName:`span`,properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){let t=this,n=e.split(`.`).map(function(e,n){return n?e+`_`.repeat(n):t.options.classPrefix+e}),r=this.stack[this.stack.length-1],i={type:`element`,tagName:`span`,properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return``}},vH={};function yH(e){let t=e||vH,n=t.aliases,r=t.detect||!1,i=t.languages||fH,a=t.plainText,o=t.prefix,s=t.subset,c=`hljs`,l=gH(i);if(n&&l.registerAlias(n),o){let e=o.indexOf(`-`);c=e===-1?o:o.slice(0,e)}return function(e,t){MF(e,`element`,function(e,n,i){if(e.tagName!==`code`||!i||i.type!==`element`||i.tagName!==`pre`)return;let u=bH(e);if(u===!1||!u&&!r||u&&a&&a.includes(u))return;Array.isArray(e.properties.className)||(e.properties.className=[]),e.properties.className.includes(c)||e.properties.className.unshift(c);let d=Qz(e,{whitespace:`pre`}),f;try{f=u?l.highlight(u,d,{prefix:o}):l.highlightAuto(d,{prefix:o,subset:s})}catch(n){let r=n;if(u&&/Unknown language/.test(r.message)){t.message("Cannot highlight as `"+u+"`, it’s not registered",{ancestors:[i,e],cause:r,place:e.position,ruleId:`missing-language`,source:`rehype-highlight`});return}throw r}!u&&f.data&&f.data.language&&e.properties.className.push(`language-`+f.data.language),f.children.length>0&&(e.children=f.children)})}}function bH(e){let t=e.properties.className,n=-1;if(!Array.isArray(t))return;let r;for(;++n<t.length;){let e=String(t[n]);if(e===`no-highlight`||e===`nohighlight`)return!1;!r&&e.slice(0,5)===`lang-`&&(r=e.slice(5)),!r&&e.slice(0,9)===`language-`&&(r=e.slice(9))}return r}var xH=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],SH={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...xH,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...xH],h2:[[`className`,`sr-only`]],img:[...xH,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...xH,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...xH],table:[...xH],ul:[...xH,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},CH={}.hasOwnProperty;function wH(e,t){let n={type:`root`,children:[]},r=TH({schema:t?{...SH,...t}:SH,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function TH(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return EH(e,n);case`doctype`:return DH(e,n);case`element`:return OH(e,n);case`root`:return kH(e,n);case`text`:return AH(e,n);default:}}}function EH(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return LH(r,t),r}}function DH(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return LH(e,t),e}}function OH(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=jH(e,t.children),i=MH(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&CH.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return LH(o,t),o}function kH(e,t){let n={type:`root`,children:jH(e,t.children)};return LH(n,t),n}function AH(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return LH(n,t),n}function jH(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=TH(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function MH(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&CH.call(r,n)?r[n]:void 0,o=r&&CH.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(CH.call(s,l)){let t=s[l],n=NH(e,RH(a,l),l,t);n??=NH(e,RH(o,l),l,t),n!=null&&(c[l]=n)}if(i&&CH.call(i,n)){let e=i[n];for(l in e)CH.call(e,l)&&!CH.call(c,l)&&(c[l]=e[l])}return c}function NH(e,t,n,r){return t?Array.isArray(r)?PH(e,t,n,r):FH(e,t,n,r):void 0}function PH(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=FH(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function FH(e,t,n,r){if(!(typeof r!=`boolean`&&typeof r!=`number`&&typeof r!=`string`)&&IH(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function IH(e,t,n){let r=e.schema.protocols&&CH.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function LH(e,t){let n=GA(t);t.data&&(e.data=_F(t.data)),n&&(e.position=n)}function RH(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function zH(e){return function(t){return wH(t,e)}}function BH(){return typeof document>`u`?`dark`:(nE[document.documentElement.getAttribute(`data-theme`)||`nord`]?.type??`dark`)===`light`?`default`:`dark`}function VH({chart:e}){let t=(0,W.useRef)(null),n=`mermaid-${(0,W.useId)().replace(/[^a-zA-Z0-9]/g,``)}`,[r,i]=(0,W.useState)(null);return(0,W.useEffect)(()=>{let r=!1;if(t.current)return(async()=>{try{let a=(await J(async()=>{let{default:e}=await import(`./mermaid.core-DTef5PVY.js`);return{default:e}},__vite__mapDeps([101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118]))).default;a.initialize({startOnLoad:!1,securityLevel:`strict`,theme:BH()});let{svg:o,bindFunctions:s}=await a.render(n,e);if(r||!t.current)return;t.current.innerHTML=o,s?.(t.current),i(null)}catch(e){r||i(e instanceof Error?e.message:String(e))}})(),()=>{r=!0}},[e,n]),r?(0,G.jsxs)(`div`,{className:`mermaid-error`,children:[(0,G.jsxs)(`div`,{className:`mermaid-error-note`,children:[`Failed to render diagram: `,r]}),(0,G.jsx)(`pre`,{children:(0,G.jsx)(`code`,{children:e})})]}):(0,G.jsx)(`div`,{className:`mermaid`,ref:t,role:`img`,"aria-label":`Mermaid diagram`})}var HH=[Nz,Iz],UH=[[zH,{...SH,protocols:{...SH.protocols,href:[...SH.protocols?.href??[],`file`,`file-mention`]}}],[yH,{ignoreMissing:!0,plainText:[`mermaid`,`suggestion`]}]];function WH(e){return e.startsWith(`file://`)||e.startsWith(`file-mention://`)?e:PI(e)}function GH(e){return e==null||e===!1||e===!0?``:typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(GH).join(``):(0,W.isValidElement)(e)?GH(e.props.children):``}function KH(e){return typeof e==`string`?/language-([\w-]+)/.exec(e)?.[1]??null:null}var qH={pre({children:e}){let t=KH((0,W.isValidElement)(e)?e.props.className:void 0);return t===`mermaid`?(0,G.jsx)(VH,{chart:GH(e).replace(/\n$/,``)}):t===`suggestion`?null:(0,G.jsx)(`pre`,{children:e})},a({href:e,children:t}){return typeof e==`string`&&e.startsWith(`file-mention://`)?(0,G.jsx)(`span`,{className:`mention-file`,title:e.slice(15),children:t}):(0,G.jsx)(`a`,{href:e,...typeof e==`string`&&/^https?:\/\//.test(e)?{target:`_blank`,rel:`noopener noreferrer`}:{},children:t})}};function JH({content:e,className:t}){return(0,G.jsx)(`div`,{className:t,children:(0,G.jsx)(AI,{remarkPlugins:HH,rehypePlugins:UH,urlTransform:WH,components:qH,children:e})})}function YH(e,t){let n=e.slice(0,t);for(let e=t-1;e>=0;e--){let t=n[e];if(t===`@`){if(e===0||/\s/.test(n[e-1])){let t=n.slice(e+1);if(!/\s/.test(t))return{atStart:e,query:t}}return null}if(t===`
|
|
1933
|
+
`)return null}return null}function XH(e,t){let n=(0,W.useRef)(null),[r,i]=(0,W.useState)(null),[a,o]=(0,W.useState)(0),[s,c]=(0,W.useState)(0),l=(0,W.useRef)(0),u=(0,W.useCallback)(e=>{n.current=e},[]);(0,W.useEffect)(()=>{let t=n.current;if(!t)return;let r=t.selectionStart;l.current=r;let a=YH(e,r);if(i(a),a){o(0);let n=parseFloat(getComputedStyle(t).lineHeight)||20,i=(e.slice(0,r).match(/\n/g)||[]).length;c((parseFloat(getComputedStyle(t).paddingTop)||0)+(i+1)*n+4)}},[e]);let d=r?.query??``,f=nt({queryKey:[`file-mention`,d],enabled:r!==null,placeholderData:V,staleTime:5e3,queryFn:async({signal:e})=>{let t=await fetch(`/api/search`,{method:`POST`,headers:{"content-type":`application/json`},signal:e,body:JSON.stringify({scope:`files`,query:d})});if(!t.ok)throw Error(`Search failed (${t.status})`);return await t.json()}}),p=f.data?.items??[],m=r!==null&&(p.length>0||f.isFetching),h=(0,W.useCallback)(a=>{if(!r)return;let o=n.current;if(!o)return;let s=e.slice(0,r.atStart),c=e.slice(l.current),u=`@${a} `;t(s+u+c),i(null),requestAnimationFrame(()=>{o.selectionStart=o.selectionEnd=(s+u).length,o.focus()})},[r,e,t]),g=(0,W.useCallback)(e=>{if(!m)return!1;if(e.key===`ArrowDown`){e.preventDefault();let t=p.length;return t>0&&o(e=>(e+1)%t),!0}if(e.key===`ArrowUp`){e.preventDefault();let t=p.length;return t>0&&o(e=>e===0?t-1:e-1),!0}return(e.key===`Enter`||e.key===`Tab`)&&p[a]?(e.preventDefault(),h(p[a].path),!0):e.key===`Escape`?(e.preventDefault(),i(null),!0):!1},[m,p,a,h]),_=(0,W.useCallback)(e=>h(e),[h]);return{isOpen:m,results:p,focusedIndex:a,query:d,isFetching:f.isFetching,cursorTop:s,handleKeyDown:g,onSelect:_,setFocusedIndex:o,setTextareaRef:u}}function ZH(e,t){let n=t.trim().toLowerCase();if(!n)return[];let r=e.toLowerCase(),i=[],a=0;for(let e=0;e<r.length&&a<n.length;e++)if(r[e]===n[a]){let t=i[i.length-1];t&&t[1]===e?t[1]=e+1:i.push([e,e+1]),a++}return a===n.length?i:[]}function QH({text:e,ranges:t}){if(!t.length)return(0,G.jsx)(G.Fragment,{children:e});let n=[],r=0;return t.forEach(([t,i],a)=>{t>r&&n.push(e.slice(r,t)),n.push((0,G.jsx)(`mark`,{className:`mention-highlight`,children:e.slice(t,i)},a)),r=i}),r<e.length&&n.push(e.slice(r)),(0,G.jsx)(G.Fragment,{children:n})}var $H=e=>{let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t+1)},eU=e=>{let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)};function tU({results:e,focusedIndex:t,query:n,cursorTop:r,onSelect:i,onHover:a}){let o=(0,W.useRef)(null);return(0,W.useEffect)(()=>{(o.current?.querySelector(`[data-focused="true"]`))?.scrollIntoView({block:`nearest`})},[t]),e.length===0?null:(0,G.jsx)(`div`,{className:`mention-dropdown`,ref:o,role:`listbox`,"aria-label":`File suggestions`,style:{top:r},children:e.map((e,r)=>{let o=eU(e.path),s=ZH(o,n),c=r===t;return(0,G.jsxs)(`div`,{role:`option`,"aria-selected":c,"data-focused":c,className:`mention-item ${c?`mention-item-focused`:``}`,onMouseDown:t=>{t.preventDefault(),i(e.path)},onMouseEnter:()=>a(r),children:[(0,G.jsx)(`span`,{className:`mention-icon`,children:(0,G.jsx)(qD,{size:13})}),(0,G.jsxs)(`div`,{className:`mention-info`,children:[(0,G.jsx)(`span`,{className:`mention-name`,children:(0,G.jsx)(QH,{text:o,ranges:s})}),(0,G.jsx)(`span`,{className:`mention-dir`,children:$H(e.path)||`./`})]})]},e.path)})})}function nU(e){return e.replace(/@([^\s@]+)/g,(e,t)=>`[${t.split(`/`).pop()||t}](file-mention://${t})`)}function rU({id:e,value:t,onChange:n,placeholder:r,rows:i=3,ariaLabel:a,textareaClassName:o,onSubmitShortcut:s}){let[c,l]=(0,W.useState)(`write`),u=(0,W.useRef)(null),d=(0,W.useRef)(null),f=XH(t,n),p=(0,W.useRef)(t);(0,W.useEffect)(()=>{p.current=t},[t]),(0,W.useEffect)(()=>{c===`preview`&&d.current?.focus()},[c]);let m=async e=>{let r=e.clipboardData.items,i=null;for(let e=0;e<r.length;e++){let t=r[e];if(t.kind===`file`&&t.type.startsWith(`image/`)){i=t.getAsFile();break}}if(!i)return;e.preventDefault();let a=u.current;if(!a)return;let o=a.selectionStart,s=a.selectionEnd,c=Math.random().toString(36).slice(2,8),l=`![Uploading image… ${c}]()`,d=t.slice(0,o)+l+t.slice(s);n(d),p.current=d;try{let e=new FormData;e.append(`file`,i,i.name||`pasted-${c}.png`);let t=await fetch(`/api/attachments`,{method:`POST`,body:e});if(!t.ok)throw Error(`HTTP ${t.status}`);let r=await t.json();if(!r.url)throw Error(r.error||`Upload failed`);n(p.current.replace(l,``))}catch(e){console.error(`Image upload failed:`,e),n(p.current.replace(l,`![upload failed]()`))}};return(0,G.jsxs)(`div`,{className:`md-field`,children:[(0,G.jsxs)(`div`,{className:`comment-form-tabs`,role:`tablist`,"aria-label":`Markdown editor mode`,children:[(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":c===`write`,onClick:()=>l(`write`),onKeyDown:e=>{e.key===`ArrowRight`&&(e.preventDefault(),l(`preview`))},className:`comment-form-tab-btn ${c===`write`?`comment-form-tab-btn-active`:`comment-form-tab-btn-inactive`}`,children:`Write`}),(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":c===`preview`,onClick:()=>l(`preview`),onKeyDown:e=>{e.key===`ArrowLeft`&&(e.preventDefault(),l(`write`))},className:`comment-form-tab-btn ${c===`preview`?`comment-form-tab-btn-active`:`comment-form-tab-btn-inactive`}`,children:`Preview`})]}),c===`write`?(0,G.jsxs)(`div`,{style:{position:`relative`},children:[(0,G.jsx)(`textarea`,{id:e,ref:e=>{u.current=e,f.setTextareaRef(e)},className:o,value:t,rows:i,placeholder:r,"aria-label":a,onChange:e=>n(e.target.value),onPaste:m,onKeyDown:e=>{f.handleKeyDown(e)||(e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),s?.()),e.key===`p`&&(e.metaKey||e.ctrlKey)&&e.shiftKey&&(e.preventDefault(),l(e=>e===`write`?`preview`:`write`)))}}),f.isOpen&&(0,G.jsx)(tU,{results:f.results,focusedIndex:f.focusedIndex,query:f.query,cursorTop:f.cursorTop,onSelect:f.onSelect,onHover:f.setFocusedIndex})]}):(0,G.jsx)(`div`,{ref:d,className:`md-field-preview markdown-body`,role:`tabpanel`,"aria-label":`Markdown preview`,tabIndex:0,onKeyDown:e=>{e.key===`p`&&(e.metaKey||e.ctrlKey)&&e.shiftKey&&(e.preventDefault(),l(`write`))},children:t.trim()?(0,G.jsx)(JH,{content:nU(t)}):(0,G.jsx)(`span`,{className:`md-field-empty`,children:`Nothing to preview`})})]})}var iU=`diffing-submit-panel-height`,aU=`diffing-submit-panel-width`,oU=[{label:`S`,width:420,height:340},{label:`M`,width:480,height:440},{label:`L`,width:560,height:560},{label:`XL`,width:640,height:760}],sU=480,cU=520;function lU(e){return Number.isFinite(e)?Math.max(280,Math.min(760,e)):sU}function uU(e){return Number.isFinite(e)?Math.max(360,Math.min(720,e)):cU}function dU(){let e=fD(iU);if(e==null)return sU;let t=Number(e);return Number.isFinite(t)?lU(t):sU}function fU(){let e=fD(aU);if(e==null)return cU;let t=Number(e);return Number.isFinite(t)?uU(t):cU}function pU(){let[e,t]=(0,W.useState)(()=>dU()),[n,r]=(0,W.useState)(()=>fU()),i=(0,W.useRef)(null),a=(0,W.useRef)(e);a.current=e;let o=(0,W.useRef)(n);o.current=n;let s=(0,W.useCallback)(e=>{let n=lU(e);t(n),gD(iU,String(n))},[]),c=(0,W.useCallback)(e=>{let t=uU(e);r(t),gD(aU,String(t))},[]),l=(0,W.useCallback)(e=>{c(e.width),s(e.height)},[c,s]),u=(()=>{for(let t=0;t<oU.length;t++){let r=oU[t];if(Math.abs(e-r.height)<1&&Math.abs(n-r.width)<1)return t}return-1})(),d=(0,W.useCallback)(e=>{e.preventDefault();let n=i.current;if(!n)return;let r=e.clientY,o=a.current,s=o,c=0,l=()=>{c=0,n.style.setProperty(`--submit-panel-height`,`${s}px`)},u=e=>{s=lU(o+(e.clientY-r)),c||=requestAnimationFrame(l)},d=()=>{c&&cancelAnimationFrame(c),t(s),gD(iU,String(s)),document.removeEventListener(`mousemove`,u),document.removeEventListener(`mouseup`,d),document.body.style.cursor=``,document.body.style.userSelect=``};document.addEventListener(`mousemove`,u),document.addEventListener(`mouseup`,d),document.body.style.cursor=`row-resize`,document.body.style.userSelect=`none`},[]),f=(0,W.useCallback)(e=>{e.preventDefault();let t=i.current;if(!t)return;let n=e.clientX,a=o.current,s=a,c=0,l=()=>{c=0,t.style.setProperty(`--submit-panel-width`,`${s}px`)},u=e=>{s=uU(a+(n-e.clientX)),c||=requestAnimationFrame(l)},d=()=>{c&&cancelAnimationFrame(c),r(s),gD(aU,String(s)),document.removeEventListener(`mousemove`,u),document.removeEventListener(`mouseup`,d),document.body.style.cursor=``,document.body.style.userSelect=``};document.addEventListener(`mousemove`,u),document.addEventListener(`mouseup`,d),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},[]);return(0,W.useEffect)(()=>()=>{document.body.style.cursor=``,document.body.style.userSelect=``},[]),{height:e,width:n,setHeight:s,setWidth:c,applyPreset:l,activePreset:u,startResize:d,startLeftResize:f,popoverStyle:{"--submit-panel-height":`${e}px`,"--submit-panel-width":`${n}px`},panelRef:i}}var mU=[{value:`approved`,label:`Approve`,description:`The changes look good — the agent can proceed.`,icon:jD,className:`plan-verdict-approve`},{value:`changes-requested`,label:`Request edits`,description:`The agent should address the comments and apply edits.`,icon:sO,className:`plan-verdict-changes`},{value:`rejected`,label:`Reject`,description:`Don't keep building on this — the approach needs rethinking.`,icon:AO,className:`plan-verdict-reject`},{value:`comment-only`,label:`Comment only`,description:`Agent must NOT edit files — only reply to comments. General note goes to chat.`,icon:cO,className:`plan-verdict-comment-only`}];function hU({comments:e,onEditComment:t,onDeleteComment:n,onSend:r,sending:i,agentWaiting:a,onCopyComments:o}){let{haptic:s,sound:c}=lD(),[l,u]=(0,W.useState)(!1),[d,f]=(0,W.useState)(``),[p,m]=(0,W.useState)(null),[h,g]=(0,W.useState)(!1),{popoverStyle:_,activePreset:v,applyPreset:y,startResize:b,startLeftResize:x,panelRef:S}=pU(),C=async()=>{o&&(await o(),g(!0),setTimeout(()=>g(!1),2e3))},w=e.length,T=(0,W.useMemo)(()=>[...e].sort((e,t)=>e.createdAt-t.createdAt),[e]),E=async()=>{p&&(s(`heavy`),c(`send`),await r(p,d,p===`comment-only`?`comment-only`:`standard`),f(``),m(null),u(!1))};return(0,G.jsx)(bk,{open:l,onOpenChange:u,ariaLabel:`Submit your review to the agent`,className:`send-review-popover`,trigger:(0,G.jsxs)(`button`,{className:`btn btn-primary btn-sm send-review-btn`,disabled:i,title:a?`An agent is connected and waiting`:`Submit your review to a waiting agent`,style:{display:`inline-flex`,alignItems:`center`,gap:`6px`},children:[a&&(0,G.jsx)(`span`,{className:`agent-waiting-dot`,"aria-hidden":`true`}),(0,G.jsx)(AD,{size:14}),(0,G.jsx)(`span`,{className:`btn-label`,children:i?`Sending…`:w>0?`Send to agent (${w})`:`Send to agent`})]}),children:(0,G.jsxs)(`div`,{className:`srp`,ref:S,style:_,children:[(0,G.jsx)(`div`,{className:`srp-resize-handle-left`,onMouseDown:x,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize submit panel width`,tabIndex:0}),(0,G.jsxs)(`div`,{className:`srp-head`,children:[(0,G.jsx)(AD,{size:15,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`srp-title`,children:`Send review to agent`}),(0,G.jsx)(`div`,{className:`srp-size-presets`,role:`group`,"aria-label":`Panel size`,children:oU.map((e,t)=>(0,G.jsx)(`button`,{className:`srp-preset-btn`,role:`radio`,"aria-checked":v===t,"aria-pressed":v===t,onClick:()=>y(e),title:`${e.width}×${e.height}px`,children:e.label},e.label))}),(0,G.jsxs)(`span`,{className:`srp-count`,children:[w,` comment`,w===1?``:`s`]})]}),(0,G.jsxs)(`div`,{className:`srp-scroll`,children:[(0,G.jsx)(`div`,{className:`plan-verdict-options`,role:`radiogroup`,"aria-label":`Verdict`,children:mU.map(e=>{let t=e.icon,n=p===e.value;return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":n,className:`plan-verdict-option ${e.className} ${n?`plan-verdict-option-selected`:``}`,onClick:()=>m(e.value),children:[(0,G.jsx)(`span`,{className:`plan-verdict-icon`,children:(0,G.jsx)(t,{size:15,"aria-hidden":`true`})}),(0,G.jsxs)(`span`,{className:`plan-verdict-text`,children:[(0,G.jsx)(`span`,{className:`plan-verdict-label`,children:e.label}),(0,G.jsx)(`span`,{className:`plan-verdict-desc`,children:e.description})]}),(0,G.jsx)(`span`,{className:`plan-verdict-radio`,"aria-hidden":`true`})]},e.value)})}),w>0?(0,G.jsx)(`ul`,{className:`srp-list`,"aria-label":`Comments to send`,children:T.map(e=>(0,G.jsx)(gU,{comment:e,onEdit:t,onDelete:n},e.id))}):(0,G.jsx)(`p`,{className:`srp-empty`,children:`No inline comments — your verdict and overall note will be sent on their own.`}),(0,G.jsxs)(`div`,{className:`srp-general`,children:[(0,G.jsxs)(`label`,{className:`srp-general-label`,htmlFor:`srp-general-input`,children:[`Overall comment `,(0,G.jsx)(`span`,{className:`srp-optional`,children:`(optional · Markdown)`})]}),(0,G.jsx)(rU,{id:`srp-general-input`,value:d,onChange:f,textareaClassName:`srp-general-input`,placeholder:`Add an overall note for the agent that applies to the whole review…`,rows:3,ariaLabel:`Overall review comment`,onSubmitShortcut:E})]})]}),(0,G.jsxs)(`div`,{className:`srp-footer`,children:[o&&(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:C,disabled:w===0,style:{marginRight:`auto`},children:h?`Copied!`:`Copy comments`}),(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>u(!1),disabled:i,children:`Cancel`}),(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:E,disabled:!p||i,children:i?`Sending…`:`Send review`})]}),(0,G.jsx)(`div`,{className:`srp-resize-handle`,onMouseDown:b,role:`separator`,"aria-orientation":`horizontal`,"aria-label":`Resize submit panel`,tabIndex:0})]})})}function gU({comment:e,onEdit:t,onDelete:n}){let[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(e.body),s=(0,W.useRef)(null);(0,W.useEffect)(()=>{r&&(s.current?.focus(),s.current?.select())},[r]);let c=e.lineNumber>0?e.startLineNumber&&e.startLineNumber!==e.lineNumber?`:${e.startLineNumber}-${e.lineNumber}`:`:${e.lineNumber}`:` · file`,l=()=>{let n=a.trim();n&&n!==e.body&&t(e.id,n),i(!1)};return(0,G.jsxs)(`li`,{className:`srp-item`,children:[(0,G.jsxs)(`div`,{className:`srp-item-top`,children:[(0,G.jsxs)(`span`,{className:`srp-item-loc`,children:[(0,G.jsx)(`span`,{className:`srp-item-file`,children:tE(e.filePath)}),(0,G.jsx)(`span`,{className:`srp-item-line`,children:c})]}),e.status===`resolved`&&(0,G.jsx)(`span`,{className:`srp-item-resolved`,children:`resolved`}),(0,G.jsxs)(`span`,{className:`srp-item-actions`,children:[r?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:l,title:`Save edit`,children:(0,G.jsx)(jD,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:()=>{o(e.body),i(!1)},title:`Cancel edit`,children:(0,G.jsx)(AO,{size:13,"aria-hidden":`true`})})]}):(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:()=>i(!0),title:`Edit comment`,children:(0,G.jsx)(hO,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`srp-icon-btn srp-icon-btn-danger`,onClick:()=>n(e.id),title:`Remove from review`,children:(0,G.jsx)(TO,{size:13,"aria-hidden":`true`})})]})]}),e.lineContent?.trim()&&(0,G.jsx)(`code`,{className:`srp-item-code`,children:e.lineContent.trim().slice(0,160)}),r?(0,G.jsx)(`textarea`,{ref:s,className:`srp-item-edit`,value:a,rows:2,onChange:e=>o(e.target.value),onKeyDown:t=>{t.key===`Enter`&&(t.metaKey||t.ctrlKey)?(t.preventDefault(),l()):t.key===`Escape`&&(t.preventDefault(),o(e.body),i(!1))}}):(0,G.jsx)(`p`,{className:`srp-item-body`,children:e.body})]})}var _U=[{value:`word`,label:`Word`},{value:`word-alt`,label:`Word (alt)`},{value:`char`,label:`Character`},{value:`none`,label:`None`}],vU=[{value:`classic`,label:`Classic (+/−)`},{value:`bars`,label:`Bars`},{value:`none`,label:`None`}],yU=[{value:`line-info`,label:`Line info + context`},{value:`line-info-basic`,label:`Line info`},{value:`metadata`,label:`Metadata only`},{value:`simple`,label:`Simple`}],bU=[{value:`both`,label:`Both`},{value:`line`,label:`Line only`},{value:`number`,label:`Number only`},{value:`disabled`,label:`Disabled`}],xU=[11,12,13,14,15,16].map(e=>({value:String(e),label:`${e}px`})),SU=[2,4,8].map(e=>({value:String(e),label:String(e)})),CU=[{value:``,label:`Default`},{value:`chrome`,label:`Chrome`},{value:`firefox`,label:`Firefox`},{value:`edge`,label:`Edge`},{value:`brave`,label:`Brave`}],wU=[{value:`default`,label:`Default / System`},{value:`vscode`,label:`VS Code`},{value:`zed`,label:`Zed`},{value:`vim`,label:`Vim`},{value:`neovim`,label:`Neovim`}],TU=(0,W.memo)(function({repoName:e,branch:t,fileCount:n,additions:r,deletions:i,commentCount:a,planCount:o,pendingPlanCount:s,onOpenPlans:c,diffStyle:l,diffOptions:u,defaultTabSize:d,browser:f,theme:p,editorIDE:m,customMode:h,showMode:g,showCommitCount:_,lineDiffType:v,lineWrap:y,diffIndicators:b,showLineNumbers:x,hunkSeparators:S,lineHoverHighlight:C,fontSize:w,haptics:T,sounds:E,uiFont:D,monoFont:O,onDiffStyleChange:k,onDiffOptionsChange:A,onDefaultTabSizeChange:j,onBrowserChange:M,onOpenThemeModal:N,onEditorIDEChange:P,onLineDiffTypeChange:F,onLineWrapChange:I,onDiffIndicatorsChange:L,onShowLineNumbersChange:R,onHunkSeparatorsChange:z,onLineHoverHighlightChange:ee,onFontSizeChange:te,onHapticsChange:B,onSoundsChange:V,onOpenUiFontModal:H,onOpenMonoFontModal:ne,onOpenSearch:re,onCopyComments:ie,onSendToAgent:ae,agentWaiting:oe,sending:se,comments:ce,onEditComment:le,onDeleteComment:ue,sidebarCollapsed:U,onToggleSidebar:de}){let[fe,pe]=(0,W.useState)(!1);return(0,W.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&(e.key===`,`||e.code===`Comma`)&&(e.preventDefault(),pe(e=>!e))};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[]),(0,G.jsxs)(`div`,{className:`toolbar`,children:[(0,G.jsxs)(`div`,{className:`toolbar-left`,children:[de&&(0,G.jsx)(`button`,{className:`toolbar-mobile-toggle`,onClick:de,"aria-label":`Toggle sidebar`,title:U?`Open sidebar`:`Close sidebar`,children:(0,G.jsx)(iO,{size:18})}),(0,G.jsx)(`h1`,{className:`toolbar-title`,children:e}),t&&(0,G.jsxs)(`span`,{className:`toolbar-branch`,children:[(0,G.jsx)(JD,{size:12}),t]}),(0,G.jsx)(`span`,{className:`toolbar-stat`,children:g?(0,G.jsxs)(G.Fragment,{children:[`showing`,` `,(0,G.jsx)(`strong`,{className:`toolbar-stat-count`,children:_}),` `,`commit`,_===1?``:`s`]}):(0,G.jsxs)(G.Fragment,{children:[n,` file`,n===1?``:`s`,` changed`,r>0&&(0,G.jsxs)(`span`,{className:`stat-additions`,children:[` +`,r]}),i>0&&(0,G.jsxs)(`span`,{className:`stat-deletions`,children:[` -`,i]})]})})]}),(0,G.jsxs)(`div`,{className:`toolbar-right`,children:[(0,G.jsxs)(`button`,{className:`btn btn-sm toolbar-search-btn`,onClick:re,title:`Search (⌘K)`,children:[(0,G.jsx)(xO,{size:14,style:{marginRight:`6px`}}),(0,G.jsx)(`span`,{children:`Search`}),(0,G.jsx)(`kbd`,{className:`toolbar-search-kbd`,children:`⌘K`})]}),o>0&&(0,G.jsxs)(`button`,{className:`btn btn-sm toolbar-plans-btn ${s>0?`toolbar-plans-btn-pending`:``}`,onClick:c,title:s>0?`${s} plan${s===1?``:`s`} awaiting your review`:`Review agent plans`,children:[s>0&&(0,G.jsx)(`span`,{className:`agent-waiting-dot`,"aria-hidden":`true`}),(0,G.jsx)(BD,{size:14,style:{marginRight:`6px`}}),(0,G.jsx)(`span`,{children:`Plans`}),s>0&&(0,G.jsx)(`span`,{className:`toolbar-plans-badge`,children:s})]}),(0,G.jsx)(bk,{open:fe,onOpenChange:pe,ariaLabel:`Settings`,className:`settings-popover`,trigger:(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn ${fe?`btn-active`:``}`,title:`Settings`,children:[(0,G.jsx)(SO,{size:14}),` `,(0,G.jsx)(`span`,{className:`btn-label`,children:`Settings`})]}),children:(0,G.jsxs)(`div`,{className:`popover-scroll settings-panel`,children:[!h&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Source`}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:u.staged,onChange:e=>A({...u,staged:e.target.checked})}),`Show staged`]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:u.untracked,onChange:e=>A({...u,untracked:e.target.checked})}),`Show untracked`]})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Display`}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Inline diff`}),(0,G.jsx)(NA,{value:v,onValueChange:e=>F(e),options:_U,ariaLabel:`Inline diff style`})]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:y,onChange:e=>I(e.target.checked)}),`Wrap long lines`]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Diff indicators`}),(0,G.jsx)(NA,{value:b,onValueChange:e=>L(e),options:vU,ariaLabel:`Diff indicators`})]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:x,onChange:e=>R(e.target.checked)}),`Show line numbers`]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Hunk separator`}),(0,G.jsx)(NA,{value:S,onValueChange:e=>z(e),options:yU,ariaLabel:`Hunk separator style`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Hover highlight`}),(0,G.jsx)(NA,{value:C,onValueChange:e=>ee(e),options:bU,ariaLabel:`Hover highlight`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Font size`}),(0,G.jsx)(NA,{value:String(w),onValueChange:e=>te(Number(e)),options:xU,ariaLabel:`Font size`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Default tab size`}),(0,G.jsx)(NA,{value:String(d),onValueChange:e=>j(Number(e)),options:SU,ariaLabel:`Default tab size`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`UI font`}),(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn`,onClick:()=>{pe(!1),H()},style:{display:`inline-flex`,alignItems:`center`},title:D??`Default (Geist Mono)`,children:[(0,G.jsx)(DO,{size:13,style:{marginRight:`4px`}}),(0,G.jsx)(`span`,{style:{maxWidth:`120px`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:D??`Default…`})]})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Code font`}),(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn`,onClick:()=>{pe(!1),ne()},style:{display:`inline-flex`,alignItems:`center`},title:O??`Default (JetBrains Mono)`,children:[(0,G.jsx)(DO,{size:13,style:{marginRight:`4px`}}),(0,G.jsx)(`span`,{style:{maxWidth:`120px`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:O??`Default…`})]})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`External tools`}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Browser`}),(0,G.jsx)(NA,{value:f||``,onValueChange:M,options:CU,ariaLabel:`Browser`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Preferred IDE`}),(0,G.jsx)(NA,{value:m||`default`,onValueChange:P,options:wU,ariaLabel:`Preferred IDE`})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Review Options`}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Diff style`}),(0,G.jsx)(NA,{value:l,onValueChange:e=>k(e),options:[{value:`split`,label:`Split`},{value:`unified`,label:`Unified`}],ariaLabel:`Diff style`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Theme`}),(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn`,onClick:()=>{pe(!1),N()},style:{display:`inline-flex`,alignItems:`center`},children:[(0,G.jsx)(dO,{size:14,style:{marginRight:`4px`}}),(0,G.jsx)(`span`,{children:`Switch Theme...`})]})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Feedback`}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:T,onChange:e=>B(e.target.checked)}),`Haptic feedback`]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:E,onChange:e=>V(e.target.checked)}),`Sound effects`]})]})}),(0,G.jsx)(hU,{comments:ce,onEditComment:le,onDeleteComment:ue,onSend:ae,sending:se,agentWaiting:oe,onCopyComments:ie})]})]})});function EU({commit:e,index:t,total:n}){let[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(!1),s=(0,W.useRef)(null);(0,W.useEffect)(()=>()=>{s.current&&clearTimeout(s.current)},[]);let c=async()=>{try{await navigator.clipboard.writeText(e.sha),i(!0),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>i(!1),1500)}catch{}},l=e.body.trim().length>0,u=e.parents.length>1,d=n>1?`Commit ${t+1} of ${n}: ${e.subject}`:`Commit: ${e.subject}`;return(0,G.jsxs)(`section`,{className:`commit-banner`,"aria-label":d,children:[(0,G.jsxs)(`header`,{className:`commit-banner-header`,children:[(0,G.jsxs)(`div`,{className:`commit-banner-line`,children:[(0,G.jsx)(YD,{size:14,className:`commit-banner-icon`,"aria-hidden":`true`}),(0,G.jsxs)(`button`,{type:`button`,className:`commit-banner-sha`,onClick:c,title:r?`Copied full SHA`:`Click to copy full SHA`,"aria-label":`Copy full SHA ${e.sha}`,children:[(0,G.jsx)(`span`,{className:`commit-banner-sha-text`,children:e.shortSha}),r?(0,G.jsx)(jD,{size:12,className:`commit-banner-sha-icon`,"aria-hidden":`true`}):(0,G.jsx)(UD,{size:12,className:`commit-banner-sha-icon`,"aria-hidden":`true`})]}),u&&(0,G.jsx)(`span`,{className:`commit-banner-merge-badge`,title:`Merge commit with ${e.parents.length} parents`,children:`merge`}),(0,G.jsx)(`h2`,{className:`commit-banner-subject`,children:e.subject})]}),(0,G.jsxs)(`div`,{className:`commit-banner-meta`,children:[(0,G.jsxs)(`span`,{className:`commit-banner-author`,children:[(0,G.jsx)(`span`,{className:`commit-banner-author-name`,children:e.authorName}),(0,G.jsxs)(`span`,{className:`commit-banner-author-email`,children:[`<`,e.authorEmail,`>`]})]}),(0,G.jsx)(`span`,{className:`commit-banner-date`,title:e.authorDate,children:DU(e.authorDate)}),e.committerName!==e.authorName||e.committerEmail!==e.authorEmail?(0,G.jsxs)(`span`,{className:`commit-banner-committer`,title:`Committed by ${e.committerName} <${e.committerEmail}> at ${e.committerDate}`,children:[(0,G.jsx)(`span`,{className:`commit-banner-committer-label`,children:`committed by`}),` `,(0,G.jsx)(`span`,{children:e.committerName})]}):null]})]}),l&&(0,G.jsxs)(`div`,{className:`commit-banner-body`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`commit-banner-body-toggle`,onClick:()=>o(e=>!e),"aria-expanded":a,"aria-controls":`commit-banner-body-${e.shortSha}`,children:[a?(0,G.jsx)(MD,{size:14}):(0,G.jsx)(PD,{size:14}),(0,G.jsx)(qD,{size:13,"aria-hidden":`true`}),(0,G.jsx)(`span`,{children:a?`Hide message`:`Show message`})]}),a&&(0,G.jsx)(`pre`,{id:`commit-banner-body-${e.shortSha}`,className:`commit-banner-body-pre`,children:e.body})]})]})}function DU(e){try{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}catch{return e}}var OU=W.createContext(void 0);function kU(e){let t=W.useContext(OU);if(e===!1&&t===void 0)throw Error(j_(27));return t}var AU={...yT,...lT},jU=W.forwardRef(function(e,t){let{render:n,className:r,forceRender:i=!1,...a}=e,{store:o}=kU(),s=o.useState(`open`),c=o.useState(`nested`),l=o.useState(`mounted`),u=o.useState(`transitionStatus`);return tS(`div`,e,{state:W.useMemo(()=>({open:s,transitionStatus:u}),[s,u]),ref:[o.context.backdropRef,t],stateAttributesMapping:AU,props:[{role:`presentation`,hidden:!l,style:{userSelect:`none`,WebkitUserSelect:`none`}},a],enabled:i||!c})}),MU=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),NU=function(e){return e[e.open=uT.open]=`open`,e[e.closed=uT.closed]=`closed`,e[e.startingStyle=uT.startingStyle]=`startingStyle`,e[e.endingStyle=uT.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),PU=W.createContext(void 0);function FU(){let e=W.useContext(PU);if(e===void 0)throw Error(j_(26));return e}var IU={...yT,...lT,nestedDialogOpen(e){return e?{[NU.nestedDialogOpen]:``}:null}},LU=W.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,...o}=e,{store:s}=kU(),c=s.useState(`descriptionElementId`),l=s.useState(`disablePointerDismissal`),u=s.useState(`floatingRootContext`),d=s.useState(`popupProps`),f=s.useState(`modal`),p=s.useState(`mounted`),m=s.useState(`nested`),h=s.useState(`nestedOpenDialogCount`),g=s.useState(`open`),_=s.useState(`openMethod`),v=s.useState(`titleElementId`),y=s.useState(`transitionStatus`),b=s.useState(`role`);FU(),hw({open:g,ref:s.context.popupRef,onComplete(){g&&s.context.onOpenChangeComplete?.(!0)}});function x(e){return e===`touch`?s.context.popupRef.current:!0}let S=i===void 0?x:i,C=h>0,w=tS(`div`,e,{state:W.useMemo(()=>({open:g,nested:m,transitionStatus:y,nestedDialogOpen:C}),[g,m,y,C]),props:[d,{"aria-labelledby":v??void 0,"aria-describedby":c??void 0,role:b,tabIndex:-1,hidden:!p,onKeyDown(e){hk.has(e.key)&&e.stopPropagation()},style:{[MU.nestedDialogs]:h}},o],ref:[t,s.context.popupRef,s.useStateSetter(`popupElement`)],stateAttributesMapping:IU});return(0,G.jsx)(xS,{context:u,openInteractionType:_,disabled:!p,closeOnFocusOut:!l,initialFocus:S,returnFocus:r,modal:f!==!1,restoreFocus:`popup`,children:w})}),RU=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=kU(),a=i.useState(`mounted`),o=i.useState(`modal`);return a||n?(0,G.jsx)(PU.Provider,{value:n,children:(0,G.jsxs)(uS,{ref:t,...r,children:[a&&o===!0&&(0,G.jsx)(ak,{ref:i.context.internalBackdropRef,inert:ZT(!open)}),e.children]})}):null});function zU(e){let{store:t,parentContext:n,actionsRef:r}=e,i=t.useState(`open`),a=t.useState(`disablePointerDismissal`),o=t.useState(`modal`),s=t.useState(`popupElement`),{openMethod:c,triggerProps:l,reset:u}=GO(i);vw(t);let{forceUnmount:d}=yw(i,t,()=>{u()}),f=X(e=>{let n=ox(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),p=W.useCallback(()=>{t.setOpen(!1,f(ix))},[t,f]);W.useImperativeHandle(r,()=>({unmount:d,close:p}),[d,p]);let m=Ew({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[h,g]=W.useState(0),_=h===0,v=Xw(m),y=LC(m,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=zv(e);if(_&&!a){let e=n;return o&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||Rv(e,s)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:_});RO(i&&o===!0,s);let{getReferenceProps:b,getFloatingProps:x,getTriggerProps:S}=zw([v,y]);t.useContextCallback(`onNestedDialogOpen`,e=>{g(e+1)}),t.useContextCallback(`onNestedDialogClose`,()=>{g(0)}),W.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(h),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,h]);let C=W.useMemo(()=>b(l),[b,l]),w=W.useMemo(()=>S(l),[S,l]),T=W.useMemo(()=>x(),[x]);t.useSyncedValues({openMethod:c,activeTriggerProps:C,inactiveTriggerProps:w,popupProps:T,floatingRootContext:m,nestedOpenDialogCount:h})}var BU={...Cw,modal:Z(e=>e.modal),nested:Z(e=>e.nested),nestedOpenDialogCount:Z(e=>e.nestedOpenDialogCount),disablePointerDismissal:Z(e=>e.disablePointerDismissal),openMethod:Z(e=>e.openMethod),descriptionElementId:Z(e=>e.descriptionElementId),titleElementId:Z(e=>e.titleElementId),viewportElement:Z(e=>e.viewportElement),role:Z(e=>e.role)},VU=class extends uw{constructor(e){super(HU(e),{popupRef:W.createRef(),backdropRef:W.createRef(),internalBackdropRef:W.createRef(),triggerElements:new bw,onOpenChange:void 0,onOpenChangeComplete:void 0},BU)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let n={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit(`openchange`,n);let r={open:e},i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),this.update(r)}};function HU(e={}){return{...Sw(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function UU(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=kU(!0),p=!!f,m=F_(()=>l?.store??new VU({open:n??r,activeTriggerId:u===void 0?d:u,modal:s,disablePointerDismissal:o,nested:p})).current;m.useControlledProp(`open`,n,r),m.useControlledProp(`activeTriggerId`,u,d),m.useSyncedValues({disablePointerDismissal:o,nested:p,modal:s}),m.useContextCallback(`onOpenChange`,i),m.useContextCallback(`onOpenChangeComplete`,a);let h=m.useState(`payload`);zU({store:m,actionsRef:c,parentContext:f?.store.context,onOpenChange:i,triggerIdProp:u});let g=W.useMemo(()=>({store:m}),[m]);return(0,G.jsx)(OU.Provider,{value:g,children:typeof t==`function`?t({payload:h}):t})}function WU({open:e,onClose:t,className:n,ariaLabel:r,initialFocus:i,onKeyDown:a,children:o}){return(0,G.jsx)(UU,{open:e,onOpenChange:e=>{e||t()},children:(0,G.jsxs)(RU,{children:[(0,G.jsx)(jU,{className:`ui-modal-backdrop`}),(0,G.jsx)(LU,{className:`ui-modal-popup ${n??``}`,"aria-label":r,initialFocus:i,onKeyDown:a,children:o})]})})}async function GU(e,t){let n=await fetch(`/api/file-text?path=${encodeURIComponent(e)}&version=${t}`);if(!n.ok){if(n.status===404)return null;throw Error(`HTTP ${n.status} fetching ${t} ${e}`)}let r=await n.json();if(r.missing)return null;if(r.error)throw Error(r.error);return r.content??``}function KU(e,t){let[n,r]=(0,W.useState)({loading:!1,error:null,oldContent:null,newContent:null});return(0,W.useEffect)(()=>{if(!t||!e)return;let n=!1;return r(e=>({...e,loading:!0,error:null})),Promise.all([GU(e,`old`),GU(e,`new`)]).then(([e,t])=>{n||r({loading:!1,error:null,oldContent:e,newContent:t})}).catch(e=>{n||r({loading:!1,error:e.message,oldContent:null,newContent:null})}),()=>{n=!0}},[e,t]),n}var qU=`diffing-draft-`,JU=10080*60*1e3;function YU(...e){return qU+e.join(`:`)}function XU(...e){try{let t=fD(YU(...e));if(!t)return null;let n=JSON.parse(t);return Date.now()-n.timestamp>JU?(_D(YU(...e)),null):n.body}catch{return null}}var ZU={};function QU(e,...t){let n=YU(...t);ZU[n]&&clearTimeout(ZU[n]),ZU[n]=setTimeout(()=>{$U(e,...t),delete ZU[n]},500)}function $U(e,...t){let n=YU(...t);try{e.trim()?gD(n,JSON.stringify({body:e,timestamp:Date.now()})):_D(n)}catch{}}function eW(...e){try{_D(YU(...e))}catch{}}function tW(e){return e.replace(/@([^\s@]+)/g,(e,t)=>`[${t.split(`/`).pop()||t}](file-mention://${t})`)}function nW({initialBody:e,lineContent:t,draftKey:n,onSubmit:r,onCancel:i}){let{haptic:a,sound:o}=lD(),[s,c]=(0,W.useState)(()=>{if(n){let e=XU(n);if(e)return e}return e||``}),[l,u]=(0,W.useState)(`write`),d=(0,W.useRef)(null),f=(0,W.useRef)(null),p=XH(s,c);(0,W.useEffect)(()=>{l===`write`?d.current?.focus():f.current?.focus()},[l]),(0,W.useEffect)(()=>{n&&QU(s,n)},[s,n]);let m=()=>{let e=s.trim();e&&(n&&eW(n),a(`success`),o(`success`),r(e))},h=e=>{if(!p.handleKeyDown(e)&&(e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m()),e.key===`p`&&(e.metaKey||e.ctrlKey)&&e.shiftKey&&(e.preventDefault(),u(e=>e===`write`?`preview`:`write`)),e.key===`Escape`)){if(s.includes(`
|
|
1934
|
+
`))return;i()}},g=async e=>{let t=e.clipboardData.items,n=null;for(let e=0;e<t.length;e++){let r=t[e];if(r.kind===`file`&&r.type.startsWith(`image/`)){n=r.getAsFile();break}}if(!n)return;e.preventDefault();let r=d.current;if(!r)return;let i=r.selectionStart,a=r.selectionEnd,o=Math.random().toString(36).slice(2,8),s=`![Uploading image… ${o}]()`,l=r.value;c(l.slice(0,i)+s+l.slice(a));try{let e=new FormData;e.append(`file`,n,n.name||`pasted-${o}.png`);let t=await fetch(`/api/attachments`,{method:`POST`,body:e});if(!t.ok)throw Error(`HTTP ${t.status}`);let r=await t.json();if(!r.url)throw Error(r.error||`Upload failed`);let i=``;c(e=>e.replace(s,i))}catch(e){console.error(`Image upload failed:`,e),c(e=>e.replace(s,`![upload failed]()`))}};return(0,G.jsxs)(`div`,{className:`comment-form`,style:{padding:`16px`},role:`form`,"aria-label":`Comment form`,children:[(0,G.jsxs)(`div`,{className:`comment-form-tabs`,role:`tablist`,"aria-label":`Comment form mode`,children:[(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":l===`write`,"aria-controls":`comment-write-panel`,onClick:()=>u(`write`),onKeyDown:e=>{e.key===`ArrowRight`&&(e.preventDefault(),u(`preview`))},className:`comment-form-tab-btn ${l===`write`?`comment-form-tab-btn-active`:`comment-form-tab-btn-inactive`}`,children:`Write`}),(0,G.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":l===`preview`,"aria-controls":`comment-preview-panel`,onClick:()=>u(`preview`),onKeyDown:e=>{e.key===`ArrowLeft`&&(e.preventDefault(),u(`write`))},className:`comment-form-tab-btn ${l===`preview`?`comment-form-tab-btn-active`:`comment-form-tab-btn-inactive`}`,children:`Preview`})]}),l===`write`?(0,G.jsxs)(`div`,{style:{position:`relative`},children:[(0,G.jsx)(`textarea`,{id:`comment-write-panel`,ref:e=>{d.current=e,p.setTextareaRef(e)},value:s,onChange:e=>c(e.target.value),onKeyDown:h,onPaste:g,placeholder:`Leave a review comment (supports Markdown and Pasting Clipboard Images)...`,rows:4,"aria-label":`Comment body`,style:{minHeight:`100px`}}),p.isOpen&&(0,G.jsx)(tU,{results:p.results,focusedIndex:p.focusedIndex,query:p.query,cursorTop:p.cursorTop,onSelect:p.onSelect,onHover:p.setFocusedIndex})]}):(0,G.jsxs)(`div`,{id:`comment-preview-panel`,ref:f,role:`tabpanel`,"aria-label":`Preview`,tabIndex:0,onKeyDown:e=>{e.key===`p`&&(e.metaKey||e.ctrlKey)&&e.shiftKey&&(e.preventDefault(),u(`write`))},style:{display:`flex`,flexDirection:`column`,gap:`12px`},children:[(()=>{let e=!!s.match(/```suggestion\n([\s\S]*?)```/);return s.replace(/```suggestion\n([\s\S]*?)```/g,``).trim().length>0||!e?(0,G.jsx)(`div`,{className:`comment-preview markdown-body`,style:{minHeight:`100px`,padding:`12px 16px`,border:`1px solid var(--border-normal)`,borderRadius:`var(--radius-md)`,background:`var(--bg-primary)`,fontSize:`14px`,lineHeight:1.6,color:`var(--text-primary)`,overflowY:`auto`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,overflowWrap:`break-word`},children:s.trim()?(0,G.jsx)(JH,{content:tW(s)}):(0,G.jsx)(`span`,{style:{color:`var(--text-muted)`,fontStyle:`italic`},children:`Nothing to preview`})}):null})(),(()=>{let e=s.match(/```suggestion\n([\s\S]*?)```/),n=!!e,r=e?e[1].trimEnd():``;return n?(0,G.jsxs)(`div`,{className:`suggestion-card`,style:{border:`1px solid var(--border-normal)`,borderRadius:`var(--radius-md)`,overflow:`hidden`,background:`var(--bg-primary)`,boxShadow:`var(--shadow-sm)`},children:[(0,G.jsx)(`div`,{className:`suggestion-header`,style:{padding:`8px 12px`,background:`var(--bg-secondary)`,borderBottom:`1px solid var(--border-normal)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,fontSize:`12px`,fontWeight:600},children:(0,G.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Suggested Change Preview`})}),(0,G.jsxs)(`div`,{className:`suggestion-diff`,style:{display:`flex`,flexDirection:`column`,fontSize:`12px`,fontFamily:`var(--font-mono)`,overflowX:`auto`},children:[t&&(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-danger-bg)`,borderBottom:`1px dashed var(--border-color)`,color:`var(--feedback-danger-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`-`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:t})]}),(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-success-bg)`,color:`var(--feedback-success-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`+`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:r})]})]})]}):null})()]}),(0,G.jsxs)(`div`,{className:`comment-form-actions`,style:{display:`flex`,justifyContent:`flex-end`,gap:`8px`,marginTop:`12px`},children:[(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:i,children:`Cancel`}),(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:m,disabled:!s.trim(),children:e?`Save`:`Comment`})]})]})}function rW({role:e,size:t=16}){return e===`agent`?(0,G.jsx)(`div`,{className:`comment-avatar-circle comment-avatar-agent`,style:{width:`${t*2}px`,height:`${t*2}px`},children:(0,G.jsx)(AD,{size:t,"aria-hidden":`true`})}):(0,G.jsx)(`div`,{className:`comment-avatar-circle comment-avatar-user`,style:{width:`${t*2}px`,height:`${t*2}px`},children:(0,G.jsx)(kO,{size:t,"aria-hidden":`true`})})}function iW({comment:e,onDelete:t}){let[,n]=(0,W.useState)(0),{resolveComment:r,unresolveComment:i,addReply:a,removeReply:o,editReply:s,applySuggestion:c,editComment:l}=xE(),u=e.status===`resolved`,[d,f]=(0,W.useState)(u),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(!1),[_,v]=(0,W.useState)(!1),[y,b]=(0,W.useState)(null),x=(0,W.useRef)(null),S=e.body.replace(/```suggestion\n([\s\S]*?)```/g,``).trim().length>0;(0,W.useEffect)(()=>{f(e.status===`resolved`)},[e.status]),(0,W.useEffect)(()=>{let e=setInterval(()=>n(e=>e+1),3e4);return()=>clearInterval(e)},[]);let C=()=>r(e.id),w=()=>i(e.id),T=e=>{b(e)},E=t=>{o(e.id,t)};return u&&d?(0,G.jsxs)(`div`,{className:`comment-resolved-collapsed`,style:{padding:`12px 18px`,margin:`14px 20px`,background:`var(--bg-secondary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-md)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,opacity:.85,boxShadow:`var(--shadow-sm)`},children:[(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`,fontSize:`13px`,color:`var(--text-muted)`},children:[(0,G.jsx)(LD,{size:16,style:{color:`var(--success)`}}),(0,G.jsx)(`span`,{style:{fontWeight:600},children:`Conversation resolved`}),e.lineNumber===0&&(0,G.jsx)(`span`,{style:{padding:`2px 6px`,background:`var(--accent-subtle)`,border:`1px solid var(--primary)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:700,color:`var(--primary)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`File Comment`}),e.startLineNumber&&e.startLineNumber!==e.lineNumber&&(0,G.jsxs)(`span`,{style:{padding:`2px 6px`,background:`var(--bg-primary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text-secondary)`},children:[`L`,e.startLineNumber,`-`,e.lineNumber]}),(0,G.jsx)(`span`,{children:`•`}),(0,G.jsx)(`span`,{children:e.replies?.length>0?`${e.replies.length+1} comments`:`1 comment`})]}),(0,G.jsx)(`button`,{style:{background:`none`,border:`none`,color:`var(--primary)`,fontSize:`12px`,fontWeight:600,cursor:`pointer`},onClick:()=>f(!1),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),f(!1))},"aria-label":`Show resolved conversation`,children:`Show resolved`})]}):h?(0,G.jsx)(`div`,{className:`comment-bubble-canvas`,id:`comment-${e.id}`,role:`article`,"aria-label":`Edit comment`,children:(0,G.jsxs)(`div`,{className:`comment-node`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(rW,{role:`user`,size:16})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge comment-node-badge-user`,children:`User`}),(0,G.jsxs)(`span`,{className:`comment-node-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`,flexWrap:`wrap`},children:[eE(e.createdAt),e.lineNumber===0&&(0,G.jsx)(`span`,{style:{padding:`1px 5px`,background:`var(--accent-subtle)`,border:`1px solid var(--primary)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:700,color:`var(--primary)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`File Comment`}),e.startLineNumber&&e.startLineNumber!==e.lineNumber&&(0,G.jsxs)(`span`,{style:{padding:`1px 5px`,background:`var(--bg-primary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text-secondary)`},children:[`L`,e.startLineNumber,`-`,e.lineNumber]})]})]}),(0,G.jsx)(`div`,{style:{marginTop:`8px`},children:(0,G.jsx)(nW,{draftKey:`edit:${e.id}`,initialBody:e.body,lineContent:e.lineContent,onSubmit:t=>{l(e.id,t),g(!1)},onCancel:()=>g(!1)})})]})]})}):(0,G.jsxs)(`div`,{className:`comment-bubble-canvas ${u?`comment-bubble-canvas-resolved`:``}`,id:`comment-${e.id}`,role:`article`,"aria-label":e.lineNumber===0?`File-level comment`:`Comment by user on line ${e.lineNumber}`,children:[(0,G.jsxs)(`div`,{className:`comment-node ${u?`comment-node-resolved`:``}`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(rW,{role:`user`,size:16})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge comment-node-badge-user`,children:`User`}),(0,G.jsxs)(`span`,{className:`comment-node-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`,flexWrap:`wrap`},children:[eE(e.createdAt),e.lineNumber===0&&(0,G.jsx)(`span`,{style:{padding:`1px 5px`,background:`var(--accent-subtle)`,border:`1px solid var(--primary)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:700,color:`var(--primary)`,textTransform:`uppercase`,letterSpacing:`0.5px`},children:`File Comment`}),e.startLineNumber&&e.startLineNumber!==e.lineNumber&&(0,G.jsxs)(`span`,{style:{padding:`1px 5px`,background:`var(--bg-primary)`,border:`1px solid var(--border-color)`,borderRadius:`var(--radius-sm)`,fontSize:`10px`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text-secondary)`},children:[`L`,e.startLineNumber,`-`,e.lineNumber]})]}),u&&(0,G.jsxs)(`span`,{className:`comment-canvas-resolved-banner`,style:{marginLeft:`8px`},children:[(0,G.jsx)(LD,{size:13}),`Resolved`]}),!u&&(0,G.jsxs)(`div`,{className:`comment-node-actions`,children:[(0,G.jsx)(`button`,{ref:x,className:`comment-node-btn`,onClick:()=>g(!0),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),g(!0))},title:`Edit comment`,"aria-label":`Edit comment`,tabIndex:0,children:(0,G.jsx)(hO,{size:13,"aria-hidden":`true`})}),_?(0,G.jsxs)(`div`,{className:`comment-delete-confirm`,style:{display:`flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsxs)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>t(e.id),title:`Confirm delete`,"aria-label":`Confirm delete comment`,style:{color:`var(--danger)`,background:`var(--feedback-danger-bg)`,fontWeight:600,fontSize:`11px`,borderRadius:`var(--radius-sm)`,border:`1px solid var(--feedback-danger-border)`,padding:`2px 6px`,cursor:`pointer`,display:`flex`,alignItems:`center`,gap:`2px`,width:`auto`,height:`auto`},children:[(0,G.jsx)(EO,{size:11}),`Delete?`]}),(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>v(!1),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),v(!1))},title:`Cancel delete`,"aria-label":`Cancel delete`,style:{fontSize:`11px`,padding:`2px 6px`,width:`auto`,height:`auto`},children:`Cancel`})]}):(0,G.jsx)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>v(!0),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),v(!0))},title:`Delete comment`,"aria-label":`Delete comment`,tabIndex:0,children:(0,G.jsx)(TO,{size:13,"aria-hidden":`true`})})]})]}),S&&(0,G.jsx)(JH,{content:e.body,className:`comment-node-body markdown-body ${u?`comment-resolved-line`:``}`}),(()=>{let t=e.body.match(/```suggestion\n([\s\S]*?)```/),n=!!t&&e.side===`additions`,r=t?t[1].trimEnd():``;return n?(0,G.jsxs)(`div`,{className:`suggestion-card`,style:{marginTop:`12px`,marginBottom:`4px`,border:`1px solid var(--border-normal)`,borderRadius:`var(--radius-md)`,overflow:`hidden`,background:`var(--bg-primary)`,boxShadow:`var(--shadow-sm)`},children:[(0,G.jsxs)(`div`,{className:`suggestion-header`,style:{padding:`8px 12px`,background:`var(--bg-secondary)`,borderBottom:`1px solid var(--border-normal)`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,fontSize:`12px`,fontWeight:600},children:[(0,G.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:`Suggested Change`}),u?(0,G.jsxs)(`span`,{style:{color:`var(--feedback-success-text)`,display:`inline-flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsx)(LD,{size:12}),` Applied`]}):(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:async()=>{try{await c(e.id)}catch(e){alert(e.message)}},style:{fontSize:`11px`,padding:`2px 8px`,borderRadius:`var(--radius-sm)`,height:`24px`},children:`Apply Suggestion`})]}),(0,G.jsxs)(`div`,{className:`suggestion-diff`,style:{display:`flex`,flexDirection:`column`,fontSize:`12px`,fontFamily:`var(--font-mono)`,overflowX:`auto`},children:[(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-danger-bg)`,borderBottom:`1px dashed var(--border-color)`,color:`var(--feedback-danger-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`-`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:e.lineContent})]}),(0,G.jsxs)(`div`,{style:{display:`flex`,padding:`8px 12px`,background:`var(--feedback-success-bg)`,color:`var(--feedback-success-text)`,minWidth:`max-content`},children:[(0,G.jsx)(`span`,{style:{width:`20px`,userSelect:`none`,opacity:.5},children:`+`}),(0,G.jsx)(`span`,{style:{whiteSpace:`pre`},children:r})]})]})]}):null})()]})]}),e.replies?.length>0&&(0,G.jsx)(`div`,{className:`comment-replies`,role:`list`,"aria-label":`Replies`,children:e.replies.map((t,n)=>{let r=t.role===`agent`,i=y===t.id;return(0,G.jsxs)(`div`,{className:`comment-node ${r?`comment-node-agent`:`comment-node-user`} ${u?`comment-node-resolved`:``}`,role:`listitem`,"aria-label":`${r?`Agent`:`User`} reply ${n+1}`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(rW,{role:r?`agent`:`user`,size:14})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:r?`Agent`:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge ${r?`comment-node-badge-agent`:`comment-node-badge-user`}`,children:r?`Agent`:`User`}),r&&t.model&&(0,G.jsx)(`span`,{style:{fontSize:`10px`,fontWeight:600,padding:`1px 5px`,borderRadius:`4px`,background:`var(--bg-tertiary)`,color:`var(--text-secondary)`,fontFamily:`var(--font-mono)`},children:t.model}),(0,G.jsx)(`span`,{className:`comment-node-time`,children:eE(t.createdAt)}),!u&&(0,G.jsxs)(`div`,{className:`comment-node-actions`,children:[(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>T(t.id),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),T(t.id))},title:`Edit reply`,"aria-label":`Edit reply`,tabIndex:0,children:(0,G.jsx)(hO,{size:12,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>E(t.id),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),E(t.id))},title:`Delete reply`,"aria-label":`Delete reply`,tabIndex:0,children:(0,G.jsx)(TO,{size:12,"aria-hidden":`true`})})]})]}),i?(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`var(--radius-md)`,border:`1px solid var(--border-color)`,marginTop:`6px`},children:(0,G.jsx)(nW,{draftKey:`reply-edit:${e.id}:${t.id}`,initialBody:t.body,onSubmit:n=>{s(e.id,t.id,n),b(null)},onCancel:()=>b(null)})}):(0,G.jsx)(JH,{content:t.body,className:`comment-node-body markdown-body`})]})]},t.id)})}),(0,G.jsxs)(`div`,{className:`comment-canvas-footer`,children:[!p&&(0,G.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,G.jsxs)(`button`,{onClick:()=>m(!0),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),m(!0))},className:`comment-reply-trigger`,"aria-label":`Write a reply`,tabIndex:0,style:{width:`100%`,maxWidth:`320px`},children:[(0,G.jsx)(vO,{size:14,"aria-hidden":`true`}),`Reply...`]}),u?(0,G.jsxs)(`div`,{style:{display:`flex`,gap:`6px`,marginLeft:`12px`},children:[(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:()=>f(!0),style:{fontSize:`12px`,padding:`4px 10px`},"aria-label":`Hide resolved conversation`,children:`Hide`}),(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:w,style:{fontSize:`12px`,padding:`4px 10px`},"aria-label":`Unresolve conversation`,children:`Unresolve`})]}):(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:C,style:{fontSize:`12px`,padding:`4px 10px`,marginLeft:`12px`},"aria-label":`Resolve conversation`,children:`Resolve conversation`})]}),p&&(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`var(--radius-md)`,border:`1px solid var(--border-color)`,marginTop:`4px`},children:(0,G.jsx)(nW,{draftKey:`reply:${e.id}`,onSubmit:t=>{a(e.id,t),m(!1)},onCancel:()=>{m(!1),x.current?.focus()}})})]})]})}var aW=(0,W.memo)(function({id:e,fileDiff:t,filePath:n,annotations:r,diffStyle:i,tabSize:a,viewed:o,theme:s,editorIDE:c,lineDiffType:l,lineWrap:u,diffIndicators:d,showLineNumbers:f,hunkSeparators:p,lineHoverHighlight:m,fontSize:h,monoFontFamily:g,expandContextByDefault:_,collapsedContextThreshold:v,expansionLineCount:y,onViewedChange:b,onAddComment:x,onDeleteComment:S}){let[C,w]=(0,W.useState)(null),[T,E]=(0,W.useState)(null),[D,O]=(0,W.useState)(0),[k,A]=(0,W.useState)(null),[j,M]=(0,W.useState)(!1),[N,P]=(0,W.useState)(o),[F,I]=(0,W.useState)(!1),[L,R]=(0,W.useState)(!1),[z,ee]=(0,W.useState)(_),[te,B]=(0,W.useState)(null),[V,H]=(0,W.useState)(null),[ne,re]=(0,W.useState)(null),ie=(0,W.useRef)(null),ae=e=>{e.stopPropagation(),!(typeof navigator>`u`||!navigator.clipboard)&&navigator.clipboard.writeText(n).then(()=>{M(!0),window.setTimeout(()=>M(!1),1500)},()=>{})},oe=async(e,t=!1)=>{if(te===null&&!(!t&&typeof window<`u`&&!window.confirm(`Revert hunk #${e+1} in ${n}? This rewrites the file via "git apply --reverse".`))){B(e),H(null);try{let t=await fetch(`/api/revert-hunk`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:n,hunkIndex:e})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`HTTP ${t.status}`)}}catch(e){H(e.message)}finally{B(null)}}},se=t.type===`change`||t.type===`rename-changed`,ce=!N&&se,{loading:le,oldContent:ue,newContent:U}=KU(n,z&&ce),de=z&&ue!==null&&U!==null,fe=t.prevName??n;(0,W.useEffect)(()=>{P(o)},[o]);let pe=nE[s]||nE.nord,me=(0,W.useMemo)(()=>sW(a,h,g),[a,h,g]),he=(e,n,r)=>{let i=r&&r!==n?r:n,a=n,o=[];for(let n=i;n<=a;n++){let r=e===`additions`?t.additionLines:t.deletionLines,i=e===`additions`?`additionStart`:`deletionStart`,a=e===`additions`?`additionCount`:`deletionCount`,s=e===`additions`?`additionLineIndex`:`deletionLineIndex`,c=!1;for(let e of t.hunks){let t=e[i],l=e[a];if(n>=t&&n<t+l){let i=e[s]+(n-t);o.push(r[i]??``),c=!0;break}}c||o.push(``)}return o.join(`
|
|
1935
|
+
`)},ge=async e=>{if(e.stopPropagation(),t.type!==`deleted`){I(!0);try{await fetch(`/api/open-file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:n,editor:c})})}catch(e){console.error(`Failed to open file in IDE editor:`,e)}finally{I(!1)}}},_e=()=>{switch(t.type){case`new`:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-new`,children:`Added`});case`deleted`:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-deleted`,children:`Deleted`});case`rename-pure`:case`rename-changed`:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-renamed`,children:`Renamed`});default:return(0,G.jsx)(`span`,{className:`diff-status-badge diff-status-modified`,children:`Modified`})}},ve=r.filter(e=>e.lineNumber===0),ye=r.filter(e=>e.lineNumber>0),be=e=>`_pending`in e.metadata?(0,G.jsx)(nW,{draftKey:`new:${n}:${C.side}:${C.startLineNumber||C.lineNumber}:${C.lineNumber}`,lineContent:he(C.side,C.lineNumber,C.startLineNumber),onSubmit:e=>{let t=he(C.side,C.lineNumber,C.startLineNumber);x(n,C.side,C.lineNumber,t,e,C.startLineNumber),w(null),E(null)},onCancel:()=>{w(null),E(null)}}):(0,G.jsx)(iW,{comment:e.metadata,onDelete:S}),xe=e=>(0,G.jsx)(`button`,{className:`gutter-add-btn`,onClick:()=>{let t=e();t&&w({side:t.side,lineNumber:t.lineNumber})},children:`+`}),Se=[...ye,...C?[{side:C.side,lineNumber:C.lineNumber,metadata:{_pending:!0}}]:[]];return(0,G.jsxs)(`div`,{ref:ie,className:`file-diff-card ${o?`file-diff-viewed`:``} ${N?`file-diff-collapsed`:``}`,id:e,children:[(0,G.jsxs)(`div`,{className:`file-diff-card-header`,onClick:()=>P(!N),children:[(0,G.jsxs)(`div`,{className:`file-diff-header-left`,children:[(0,G.jsx)(`span`,{className:`file-diff-collapse-indicator`,children:N?(0,G.jsx)(PD,{size:14}):(0,G.jsx)(MD,{size:14})}),(0,G.jsx)(`span`,{className:`file-diff-name`,title:n,children:n}),(0,G.jsx)(`button`,{className:`file-diff-copy-path-btn`,onClick:ae,title:`Copy file path to clipboard`,"aria-label":`Copy file path to clipboard`,children:j?(0,G.jsx)(jD,{size:12}):(0,G.jsx)(UD,{size:12})}),_e(),ye.length>0&&(0,G.jsxs)(`span`,{className:`file-diff-comment-badge`,title:`${ye.length} inline comment${ye.length===1?``:`s`}`,children:[(0,G.jsx)(cO,{size:10}),ye.length]}),D>0&&(0,G.jsxs)(`span`,{className:`file-diff-selection-badge`,"aria-live":`polite`,children:[D,` line`,D===1?``:`s`,` selected`]}),j&&(0,G.jsx)(`span`,{className:`file-diff-permalink-flash`,role:`status`,children:`Copied path`}),k&&(0,G.jsxs)(`span`,{className:`file-diff-permalink-flash`,role:`status`,children:[`Copied `,k]})]}),(0,G.jsxs)(`div`,{className:`file-diff-header-right`,onClick:e=>e.stopPropagation(),children:[ce&&(0,G.jsxs)(`button`,{className:`file-diff-edit-btn ${z?`btn-active`:``}`,onClick:()=>ee(e=>!e),disabled:le,title:z?`Hide unchanged context (use original patch render)`:`Load full file so unchanged context becomes expandable`,children:[le?(0,G.jsx)(nO,{size:11,className:`spin`}):(0,G.jsx)(rO,{size:11}),(0,G.jsx)(`span`,{children:le?`Loading…`:z?`Hide Context`:`Expand Context`})]}),t.type!==`deleted`&&(0,G.jsxs)(`button`,{className:`file-diff-edit-btn`,onClick:ge,disabled:F,title:`Open and edit full file locally`,children:[(0,G.jsx)(mO,{size:11}),(0,G.jsx)(`span`,{children:F?`Opening...`:`Edit File`})]}),(0,G.jsxs)(`button`,{className:`file-diff-edit-btn`,onClick:()=>{P(!1),R(!0)},title:`Comment on this entire file`,children:[(0,G.jsx)(cO,{size:11}),(0,G.jsx)(`span`,{children:`Add Comment`})]}),(0,G.jsxs)(`label`,{className:`viewed-label ${o?`viewed-checked`:``}`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>b(n,e.target.checked)}),`Viewed`]})]})]}),!N&&t.hunks.length>0&&(0,G.jsxs)(`div`,{className:`file-diff-hunk-actions`,onClick:e=>e.stopPropagation(),children:[(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`},children:[(0,G.jsx)(`span`,{className:`file-diff-hunk-actions-label`,style:{display:`inline-flex`,alignItems:`center`,gap:`4px`},children:`Selective Revert`}),(0,G.jsx)($T,{content:`Selective Revert lets you preview and undo specific blocks of changes (hunks) in this file using 'git apply --reverse'.`,side:`top`,children:(0,G.jsx)(RD,{size:12,style:{color:`var(--text-muted)`,cursor:`help`}})}),(0,G.jsx)(`span`,{style:{color:`var(--text-muted)`,fontSize:`11px`,margin:`0 4px`},children:`·`}),(0,G.jsxs)(`span`,{style:{color:`var(--text-secondary)`,fontSize:`11px`},children:[t.hunks.length,` block`,t.hunks.length===1?``:`s`,` available`]})]}),(0,G.jsx)(`div`,{className:`file-diff-hunk-actions-buttons`,children:t.hunks.map((e,t)=>(0,G.jsxs)(`button`,{type:`button`,className:`file-diff-hunk-revert-btn`,onClick:()=>re(t),disabled:te!==null,title:`Preview and revert hunk #${t+1} (lines @${e.additionStart}+${e.additionLines??e.additionCount})`,children:[te===t?(0,G.jsx)(nO,{size:10,className:`spin`}):(0,G.jsx)(OO,{size:10}),(0,G.jsxs)(`span`,{children:[`Hunk #`,t+1]})]},t))}),V&&(0,G.jsxs)(`span`,{className:`file-diff-hunk-error`,role:`alert`,children:[(0,G.jsx)(ID,{size:11}),V]})]}),ne!==null&&(()=>{let e=t.hunks[ne];if(!e)return null;let r=t.deletionLines.slice(e.deletionLineIndex,e.deletionLineIndex+(e.deletionCount??e.deletionLines??0)),i=t.additionLines.slice(e.additionLineIndex,e.additionLineIndex+(e.additionStart!==void 0&&e.additionLines!==void 0?e.additionLines:e.additionCount??0));return(0,G.jsxs)(WU,{open:ne!==null,onClose:()=>re(null),className:`hunk-revert-modal`,ariaLabel:`Selective Revert Preview Hunk #${ne+1}`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header-title`,children:[(0,G.jsx)(OO,{size:18,className:`shortcuts-icon`}),(0,G.jsxs)(`h2`,{children:[`Revert Hunk #`,ne+1]})]}),(0,G.jsx)(`button`,{className:`shortcuts-close-btn`,onClick:()=>re(null),"aria-label":`Close dialog`,children:(0,G.jsx)(AO,{size:16})})]}),(0,G.jsxs)(`div`,{className:`shortcuts-body`,children:[(0,G.jsxs)(`div`,{className:`hunk-preview-intro`,children:[`Reverting this hunk will restore the deleted (`,(0,G.jsx)(`span`,{style:{color:`var(--feedback-danger-text)`,fontWeight:600},children:`red`}),`) lines and remove the added (`,(0,G.jsx)(`span`,{style:{color:`var(--feedback-success-text)`,fontWeight:600},children:`green`}),`) lines from `,(0,G.jsx)(`strong`,{children:n.split(`/`).pop()}),`.`]}),(0,G.jsxs)(`div`,{className:`hunk-preview-container`,children:[(0,G.jsxs)(`div`,{className:`hunk-preview-header`,children:[(0,G.jsx)(`span`,{children:n}),(0,G.jsxs)(`span`,{children:[`Lines: @-`,e.deletionStart,`,`,e.deletionCount??e.deletionLines??0,` @+`,e.additionStart,`,`,e.additionLines??e.additionCount??0]})]}),(0,G.jsxs)(`div`,{className:`hunk-preview-code`,children:[r.map((e,t)=>(0,G.jsxs)(`div`,{className:`hunk-preview-line hunk-preview-line-deletion`,children:[(0,G.jsx)(`span`,{className:`hunk-preview-sign`,children:`-`}),(0,G.jsx)(`span`,{className:`hunk-preview-text`,children:e})]},`del-${t}`)),i.map((e,t)=>(0,G.jsxs)(`div`,{className:`hunk-preview-line hunk-preview-line-addition`,children:[(0,G.jsx)(`span`,{className:`hunk-preview-sign`,children:`+`}),(0,G.jsx)(`span`,{className:`hunk-preview-text`,children:e})]},`add-${t}`)),r.length===0&&i.length===0&&(0,G.jsx)(`div`,{className:`hunk-preview-line`,style:{fontStyle:`italic`,color:`var(--text-muted)`},children:`No changes in this hunk.`})]})]}),(0,G.jsx)(oW,{filePath:n,deletionStart:e.deletionStart,deletionCount:e.deletionCount??e.deletionLines??0})]}),(0,G.jsxs)(`div`,{className:`modal-footer`,children:[(0,G.jsx)(`button`,{className:`hunk-revert-btn-secondary`,onClick:()=>re(null),children:`Cancel`}),(0,G.jsx)(`button`,{className:`hunk-revert-btn-primary`,onClick:async()=>{let e=ne;re(null),await oe(e,!0)},children:`Revert Changes`})]})]})})(),!N&&(0,G.jsxs)(`div`,{className:`file-diff-card-body`,children:[(ve.length>0||L)&&(0,G.jsxs)(`div`,{className:`file-level-comments-section`,style:{margin:`16px 20px`,padding:`12px`,background:`rgba(255,255,255,0.02)`,border:`1px solid var(--border-color)`,borderRadius:`8px`,display:`flex`,flexDirection:`column`,gap:`12px`},children:[(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`,fontSize:`13px`,fontWeight:600,color:`var(--text-secondary)`},children:[(0,G.jsx)(cO,{size:14}),(0,G.jsxs)(`span`,{children:[`File-Level Comments (`,ve.length,`)`]})]}),ve.length>0&&(0,G.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`12px`},children:ve.map(e=>(0,G.jsx)(iW,{comment:e.metadata,onDelete:S},e.metadata.id))}),L&&(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`6px`,border:`1px solid var(--border-color)`},children:(0,G.jsx)(nW,{draftKey:`file-comment:${n}`,lineContent:``,onSubmit:e=>{x(n,`additions`,0,``,e),R(!1)},onCancel:()=>R(!1)})})]}),de?(0,G.jsx)(Xg,{oldFile:{name:fe,contents:ue??``},newFile:{name:n,contents:U??``},options:{diffStyle:i,enableGutterUtility:!0,enableLineSelection:!0,disableFileHeader:!0,lineDiffType:l,overflow:u?`wrap`:`scroll`,diffIndicators:d,disableLineNumbers:!f,hunkSeparators:p,lineHoverHighlight:m,expandUnchanged:!1,collapsedContextThreshold:v,expansionLineCount:y,onLineSelectionStart:()=>{E(null),O(0)},onLineSelectionChange:e=>{O(e?Math.abs(e.end-e.start)+1:0)},onLineSelectionEnd:e=>{O(0),e&&(E(e),w({side:e.endSide||`additions`,lineNumber:e.end,startLineNumber:e.start}))},onLineNumberClick:e=>{let t=`${n}:${e.annotationSide===`deletions`?`-`:`+`}${e.lineNumber}`;navigator.clipboard?.writeText(t).then(()=>{A(t),setTimeout(()=>A(null),1600)},()=>{})},theme:{dark:pe.type===`dark`?pe.themeName:`nord`,light:pe.type===`light`?pe.themeName:`github-light`},themeType:pe.type,unsafeCSS:me},selectedLines:T,lineAnnotations:Se,renderHeaderMetadata:()=>null,renderAnnotation:be,renderGutterUtility:xe}):(0,G.jsx)(Yg,{fileDiff:t,options:{diffStyle:i,enableGutterUtility:!0,enableLineSelection:!0,disableFileHeader:!0,lineDiffType:l,overflow:u?`wrap`:`scroll`,diffIndicators:d,disableLineNumbers:!f,hunkSeparators:p,lineHoverHighlight:m,onLineSelectionStart:()=>{E(null),O(0)},onLineSelectionChange:e=>{O(e?Math.abs(e.end-e.start)+1:0)},onLineSelectionEnd:e=>{O(0),e&&(E(e),w({side:e.endSide||`additions`,lineNumber:e.end,startLineNumber:e.start}))},onLineNumberClick:e=>{let t=`${n}:${e.annotationSide===`deletions`?`-`:`+`}${e.lineNumber}`;navigator.clipboard?.writeText(t).then(()=>{A(t),setTimeout(()=>A(null),1600)},()=>{})},theme:{dark:pe.type===`dark`?pe.themeName:`nord`,light:pe.type===`light`?pe.themeName:`github-light`},themeType:pe.type,unsafeCSS:me},selectedLines:T,lineAnnotations:Se,renderHeaderMetadata:()=>null,renderAnnotation:e=>`_pending`in e.metadata?(0,G.jsx)(nW,{draftKey:`new:${n}:${C.side}:${C.startLineNumber||C.lineNumber}:${C.lineNumber}`,lineContent:he(C.side,C.lineNumber,C.startLineNumber),onSubmit:e=>{let t=he(C.side,C.lineNumber,C.startLineNumber);x(n,C.side,C.lineNumber,t,e,C.startLineNumber),w(null),E(null)},onCancel:()=>{w(null),E(null)}}):(0,G.jsx)(iW,{comment:e.metadata,onDelete:S}),renderGutterUtility:e=>(0,G.jsx)(`button`,{className:`gutter-add-btn`,onClick:()=>{let t=e();t&&w({side:t.side,lineNumber:t.lineNumber})},children:`+`})})]})]})});function oW({filePath:e,deletionStart:t,deletionCount:n}){let[r,i]=(0,W.useState)(null),[a,o]=(0,W.useState)(!1),[s,c]=(0,W.useState)(null);if((0,W.useEffect)(()=>{let r=!0;return(async()=>{o(!0),c(null);try{let a=new URLSearchParams({filePath:e,deletionStart:String(t),deletionCount:String(n)}),o=await fetch(`/api/hunk-history?${a}`);if(!o.ok)throw Error(`HTTP ${o.status}`);let s=await o.json();r&&i(s)}catch(e){r&&c(e.message||`Failed to fetch hunk history`)}finally{r&&o(!1)}})(),()=>{r=!1}},[e,t,n]),a)return(0,G.jsxs)(`div`,{className:`hunk-history-loading`,children:[(0,G.jsx)(nO,{size:14,className:`spin`,style:{marginRight:`8px`}}),(0,G.jsx)(`span`,{children:`Loading git history & origin blame…`})]});if(s)return(0,G.jsxs)(`div`,{className:`hunk-history-error`,children:[(0,G.jsx)(ID,{size:14,style:{color:`var(--feedback-danger-text)`,marginRight:`8px`}}),(0,G.jsxs)(`span`,{children:[`Failed to load git history: `,s]})]});if(!r)return null;let l=Array.from(new Map(r.blame.map(e=>[e.commit,e])).values());return(0,G.jsxs)(`div`,{className:`hunk-history-section`,children:[l.length>0&&(0,G.jsxs)(`div`,{className:`hunk-history-block`,children:[(0,G.jsx)(`h3`,{className:`hunk-history-title`,children:`Commit(s) introducing deleted lines`}),(0,G.jsx)(`div`,{className:`hunk-history-commits`,children:l.map(e=>(0,G.jsxs)(`div`,{className:`hunk-history-commit-card`,children:[(0,G.jsxs)(`div`,{className:`hunk-history-commit-header`,children:[(0,G.jsx)(`span`,{className:`hunk-history-commit-hash`,children:e.commit}),(0,G.jsxs)(`span`,{className:`hunk-history-commit-author`,children:[(0,G.jsx)(kO,{size:11}),(0,G.jsx)(`span`,{children:e.author})]}),(0,G.jsxs)(`span`,{className:`hunk-history-commit-date`,children:[(0,G.jsx)(VD,{size:11}),(0,G.jsx)(`span`,{children:e.date})]})]}),(0,G.jsx)(`div`,{className:`hunk-history-commit-msg`,children:e.summary})]},e.commit))})]}),r.recentCommits.length>0&&(0,G.jsxs)(`div`,{className:`hunk-history-block`,children:[(0,G.jsx)(`h3`,{className:`hunk-history-title`,children:`Recent File Modification History`}),(0,G.jsx)(`div`,{className:`hunk-history-log`,children:r.recentCommits.map(e=>(0,G.jsxs)(`div`,{className:`hunk-history-log-row`,children:[(0,G.jsx)(`span`,{className:`hunk-history-log-hash`,children:e.hash}),(0,G.jsx)(`span`,{className:`hunk-history-log-msg`,title:e.summary,children:e.summary}),(0,G.jsx)(`span`,{className:`hunk-history-log-author`,children:e.author}),(0,G.jsx)(`span`,{className:`hunk-history-log-date`,children:e.date})]},e.hash))})]})]})}function sW(e,t,n){return`
|
|
1936
1936
|
:host {
|
|
1937
1937
|
--diffs-tab-size: ${e} !important;
|
|
1938
1938
|
--diffs-font-family: ${n} !important;
|
|
@@ -1994,7 +1994,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
|
|
|
1994
1994
|
overflow-wrap: break-word !important;
|
|
1995
1995
|
min-width: 0 !important;
|
|
1996
1996
|
}
|
|
1997
|
-
`}var
|
|
1997
|
+
`}var cW=new Set([`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.bmp`,`.svg`,`.ico`,`.avif`]);function lW(e){let t=e.slice(e.lastIndexOf(`.`)).toLowerCase();return cW.has(t)}function uW({filePath:e,info:t,viewed:n,onViewedChange:r}){let i=lW(e);return(0,G.jsxs)(`div`,{className:`file-diff-card ${n?`file-diff-viewed`:``}`,id:`file-${e}`,children:[(0,G.jsxs)(`div`,{className:`binary-diff-header`,children:[(0,G.jsx)(`span`,{className:`binary-diff-name`,children:e}),(0,G.jsxs)(`label`,{className:`viewed-label`,onClick:e=>e.stopPropagation(),children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:n,onChange:t=>r(e,t.target.checked)}),`Viewed`]})]}),!n&&(0,G.jsx)(`div`,{className:`binary-diff-body`,children:i?(0,G.jsx)(dW,{filePath:e,changeType:t.type}):(0,G.jsxs)(`div`,{className:`binary-diff-message`,children:[`Binary file `,t.type===`added`?`added`:t.type===`untracked`?`untracked`:t.type===`deleted`?`deleted`:`changed`]})})]})}function dW({filePath:e,changeType:t}){let n=`/api/file-content?path=${encodeURIComponent(e)}&version=old`,r=`/api/file-content?path=${encodeURIComponent(e)}&version=new`;return t===`added`||t===`untracked`?(0,G.jsx)(`div`,{className:`image-preview`,children:(0,G.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,G.jsx)(`div`,{className:`image-preview-label image-preview-label-added`,children:`Added`}),(0,G.jsx)(`img`,{src:r,alt:e,className:`image-preview-img`})]})}):t===`deleted`?(0,G.jsx)(`div`,{className:`image-preview`,children:(0,G.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,G.jsx)(`div`,{className:`image-preview-label image-preview-label-deleted`,children:`Deleted`}),(0,G.jsx)(`img`,{src:n,alt:e,className:`image-preview-img image-preview-deleted`})]})}):(0,G.jsxs)(`div`,{className:`image-preview image-preview-compare`,children:[(0,G.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,G.jsx)(`div`,{className:`image-preview-label`,children:`Before`}),(0,G.jsx)(`img`,{src:n,alt:`${e} (before)`,className:`image-preview-img`})]}),(0,G.jsxs)(`div`,{className:`image-preview-panel`,children:[(0,G.jsx)(`div`,{className:`image-preview-label`,children:`After`}),(0,G.jsx)(`img`,{src:r,alt:`${e} (after)`,className:`image-preview-img`})]})]})}var fW=[],pW=(0,W.memo)(function({files:e,diffStyle:t,tabSizeMap:n,defaultTabSize:r,viewedFiles:i,binaryFiles:a,theme:o,editorIDE:s,lineDiffType:c,lineWrap:l,diffIndicators:u,showLineNumbers:d,hunkSeparators:f,lineHoverHighlight:p,fontSize:m,monoFontFamily:h,expandContextByDefault:g,collapsedContextThreshold:_,expansionLineCount:v,onViewedChange:y,fileAnnotationsMap:b,onAddComment:x,onDeleteComment:S}){let C=(0,W.useMemo)(()=>[...e].sort((e,t)=>{let n=e.name.split(`/`),r=t.name.split(`/`),i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=e<n.length-1;if(t!==e<r.length-1)return t?-1:1;let i=n[e].localeCompare(r[e]);if(i!==0)return i}return n.length-r.length}),[e]);return C.length===0?(0,G.jsx)(`div`,{className:`empty-state`,children:(0,G.jsx)(`p`,{children:`No changes found.`})}):(0,G.jsx)(`div`,{className:`diff-viewer`,children:C.map((e,C)=>{let w=e.name,T=a.get(w);return T?(0,G.jsx)(uW,{filePath:w,info:T,viewed:i.has(w),onViewedChange:y},`${w}-${C}`):(0,G.jsx)(aW,{id:`file-${w}`,fileDiff:e,filePath:w,annotations:b.get(w)??fW,diffStyle:t,tabSize:n[w]??r,viewed:i.has(w),theme:o,editorIDE:s,lineDiffType:c,lineWrap:l,diffIndicators:u,showLineNumbers:d,hunkSeparators:f,lineHoverHighlight:p,fontSize:m,monoFontFamily:h,expandContextByDefault:g,collapsedContextThreshold:_,expansionLineCount:v,onViewedChange:y,onAddComment:x,onDeleteComment:S},`${w}-${C}`)})})}),mW={current:{label:`Current`,icon:jD,title:`Keep the current/HEAD side`},incoming:{label:`Incoming`,icon:AO,title:`Keep the incoming side`},both:{label:`Both`,icon:gO,title:`Keep both sides (current then incoming)`}},hW=(0,W.memo)(function({filePath:e,theme:t,fontSize:n,monoFontFamily:r,tabSize:i,onSaved:a}){let o=nE[t]||nE.nord,[s,c]=(0,W.useState)({loading:!0,error:null,file:null}),[l,u]=(0,W.useState)(null),[d,f]=(0,W.useState)(0),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(null),[_,v]=(0,W.useState)(!1),y=(0,W.useRef)(null);(0,W.useEffect)(()=>{let t=!1;return c({loading:!0,error:null,file:null}),u(null),f(0),v(!1),g(null),fetch(`/api/file-text?path=${encodeURIComponent(e)}&version=new`).then(e=>e.json()).then(n=>{if(!t){if(n.error){c({loading:!1,error:n.error,file:null});return}c({loading:!1,error:null,file:{name:e,contents:n.content??``}})}}).catch(e=>{t||c({loading:!1,error:e.message,file:null})}),()=>{t=!0}},[e]);let b=(e,t)=>{let n=y.current;if(!n)return;let r=n.resolveConflict(e,t);r&&r.file&&(u(r.file),f(e=>e+1))};return s.loading?(0,G.jsxs)(`div`,{className:`merge-conflict-card merge-conflict-card-loading`,children:[(0,G.jsx)(nO,{size:14,className:`spin`}),(0,G.jsxs)(`span`,{children:[`Loading `,e,`…`]})]}):s.error||!s.file?(0,G.jsxs)(`div`,{className:`merge-conflict-card merge-conflict-card-error`,children:[(0,G.jsx)(ID,{size:14}),(0,G.jsxs)(`span`,{children:[`Could not load `,e,`: `,s.error??`unknown error`]})]}):(0,G.jsxs)(`div`,{className:`merge-conflict-card`,children:[(0,G.jsxs)(`div`,{className:`merge-conflict-header`,children:[(0,G.jsxs)(`div`,{className:`merge-conflict-title`,children:[(0,G.jsx)(ZD,{size:14}),(0,G.jsx)(`span`,{className:`merge-conflict-name`,title:e,children:e})]}),(0,G.jsxs)(`div`,{className:`merge-conflict-actions`,children:[d>0&&(0,G.jsxs)(`span`,{className:`merge-conflict-status`,children:[d,` resolution`,d===1?``:`s`,` pending`]}),(0,G.jsxs)(`button`,{className:`file-diff-edit-btn`,onClick:async()=>{let t=l??s.file;if(t){m(!0),g(null);try{let n=await fetch(`/api/save-file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({filePath:e,content:t.contents,gitAdd:!0})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`HTTP ${n.status}`)}v(!0),a()}catch(e){g(e.message)}finally{m(!1)}}},disabled:p||_,title:"Write the resolved file to disk and `git add` it",children:[p?(0,G.jsx)(nO,{size:11,className:`spin`}):_?(0,G.jsx)(LD,{size:11}):(0,G.jsx)(bO,{size:11}),(0,G.jsx)(`span`,{children:p?`Saving…`:_?`Saved + staged`:`Save & stage`})]})]})]}),h&&(0,G.jsxs)(`div`,{className:`merge-conflict-card-error`,role:`alert`,children:[(0,G.jsx)(ID,{size:14}),(0,G.jsx)(`span`,{children:h})]}),(0,G.jsx)(k_,{file:l??s.file,options:{disableFileHeader:!0,enableGutterUtility:!1,mergeConflictActionsType:`custom`,theme:{dark:o.type===`dark`?o.themeName:`nord`,light:o.type===`light`?o.themeName:`github-light`},themeType:o.type,unsafeCSS:`
|
|
1998
1998
|
:host {
|
|
1999
1999
|
--diffs-tab-size: ${i} !important;
|
|
2000
2000
|
--diffs-font-family: ${r} !important;
|
|
@@ -2007,7 +2007,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
|
|
|
2007
2007
|
font-variant-ligatures: common-ligatures !important;
|
|
2008
2008
|
font-feature-settings: "liga" on, "calt" on !important;
|
|
2009
2009
|
}
|
|
2010
|
-
`},renderMergeConflictUtility:(e,t)=>{let n=t();return n&&(y.current=n),(0,G.jsx)(`div`,{className:`merge-conflict-buttons`,children:[`current`,`incoming`,`both`].map(t=>{let{label:n,icon:r,title:i}=
|
|
2010
|
+
`},renderMergeConflictUtility:(e,t)=>{let n=t();return n&&(y.current=n),(0,G.jsx)(`div`,{className:`merge-conflict-buttons`,children:[`current`,`incoming`,`both`].map(t=>{let{label:n,icon:r,title:i}=mW[t];return(0,G.jsxs)(`button`,{type:`button`,className:`merge-conflict-btn merge-conflict-btn-${t}`,title:i,onClick:()=>b(e.conflictIndex,t),children:[(0,G.jsx)(r,{size:11}),(0,G.jsx)(`span`,{children:n})]},t)})})}})]})}),gW=`file-tree-container`,_W=`data-file-tree-style`,vW=`data-file-tree-unsafe-css`,yW=`data-file-tree-scrollbar-measure`,bW=`data-file-tree-scrollbar-gutter-measured`,xW=`--trees-scrollbar-gutter-measured`,SW=`header`,CW=`context-menu`,wW=`context-menu-trigger`,TW=typeof window>`u`?W.useEffect:W.useLayoutEffect;function EW(e,t,n){let r=e==null?null:(0,G.jsx)(`div`,{slot:SW,children:e}),i=t!=null&&n!=null?(0,G.jsx)(`div`,{slot:CW,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,G.jsxs)(G.Fragment,{children:[r,i]})}function DW(e,t){return typeof window>`u`&&t!=null?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):(0,G.jsx)(G.Fragment,{children:e})}function OW(e){let t=e.shadowRoot;return t?.querySelector(`[data-file-tree-id]`)instanceof HTMLElement||t?.querySelector(`[data-file-tree-id]`)instanceof SVGElement?!0:e.querySelector(`template[shadowrootmode="open"]`)instanceof HTMLTemplateElement}function kW(e,t,n,r,i){let a={...e??{}};if(t!=null&&delete a.header,n){let t=e?.contextMenu,n=t?.onClose,o=t?.onOpen;a.contextMenu={...t??{},enabled:!0,onClose:()=>{n?.(),r()},onOpen:(e,t)=>{i(e,t),o?.(e,t)}},delete a.contextMenu.render}return a.header!=null||a.contextMenu!=null?a:void 0}function AW({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,W.useState)(null),[c,l]=(0,W.useState)(null),u=(0,W.useRef)(n.getComposition()),d=(0,W.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,p=(0,W.useCallback)(()=>{s(null)},[]),m=(0,W.useCallback)((e,t)=>{s({context:t,item:e})},[]),h=u.current,g=(0,W.useMemo)(()=>kW(h,e,f,p,m),[h,p,m,f,e]),_=(0,W.useCallback)(e=>{l(e)},[]);(0,W.useEffect)(()=>{f||s(null)},[f]),TW(()=>{n.setComposition(g)},[g,n]),TW(()=>{if(c!=null)return r!=null&&OW(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let v=DW(EW(e,i,o),r),y=t??r?.id,b={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...a.style};return(0,G.jsx)(gW,{...a,id:y,ref:_,style:b,suppressHydrationWarning:r!=null,children:v})}var jW=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
2011
2011
|
<symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
|
|
2012
2012
|
<path d="M12.4697 5.46973C12.7626 5.17684 13.2374 5.17684 13.5303 5.46973C13.8232 5.76262 13.8232 6.23738 13.5303 6.53028L8.53028 11.5303C8.23738 11.8232 7.76262 11.8232 7.46973 11.5303L2.46973 6.53028C2.17684 6.23738 2.17684 5.76262 2.46973 5.46973C2.76262 5.17684 3.23738 5.17684 3.53028 5.46973L8 9.93946L12.4697 5.46973Z" fill="currentcolor"/>
|
|
2013
2013
|
</symbol>
|
|
@@ -2024,72 +2024,72 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
|
|
|
2024
2024
|
<symbol id="file-tree-icon-ellipsis" viewBox="0 0 16 16">
|
|
2025
2025
|
<path d="M5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M9.5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M14 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" />
|
|
2026
2026
|
</symbol>
|
|
2027
|
-
</svg>`,
|
|
2027
|
+
</svg>`,MW=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
|
|
2028
2028
|
<path fill="currentColor" d="M6.08 13.92c-.63-.57-.81-1.79-.55-2.67.45.56 1.08.73 1.73.83 1 .15 1.99.1 2.92-.37l.32-.19q.13.38.08.78a2.1 2.1 0 0 1-.9 1.5q-.3.24-.61.43c-.64.44-.81.95-.57 1.69l.02.08a1.7 1.7 0 0 1-.74-.64 2 2 0 0 1-.3-.98q0-.27-.02-.52-.07-.61-.61-.62a.7.7 0 0 0-.75.6z" class="bg" opacity=".6"/>
|
|
2029
2029
|
<path fill="currentColor" d="M2.5 11.1s1.86-.9 3.72-.9l1.4-4.39c.05-.21.2-.36.38-.36s.33.15.38.36l1.4 4.38c2.2 0 3.72.92 3.72.92l-3.16-8.69q-.13-.4-.45-.42H6.11q-.3.02-.45.42z" class="fg"/>
|
|
2030
|
-
</symbol>`,
|
|
2030
|
+
</symbol>`,NW=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
|
|
2031
2031
|
<path fill="currentColor" fill-rule="evenodd" d="M9.49.5q1.92.05 2.66.54 1.27.6 1.35 1.52v.23a4 4 0 0 1-.53 1.9l-1.38 1.24q-.74.38-.72.63c.77.82 1.33 1.29.85 2.42q-.47 1.1-2.04 2.28c-.5.32-1.88 1.35-2.96 1.86-1.64.77-3.1 1.4-4.65 1.89-.51.16-1.5.16-1.5.16L.5 15A76 76 0 0 0 5.76 3.49q-.1-.08-.1-.2.1 0 .32-.35l-.03-.09q-1.17.39-2.38 1.3l-.13.03q0-.1-.21-.16-.46.31-.82.7l-.13-.19.16-.06-.03-.16-.34.29L2 4.5q.36-.48.72-.54l.04-.1V3.8q.16 0 .15-.06l.13-.06a6 6 0 0 0 1.13-.9v-.03H4.1l-.12.07q0-.1-.1-.1l-.15.07-.04-.1q.93-.52 1.63-1.05Q7.89.65 9.5.5M8.46 7.83l-.32.04c-1.31.54-2.31.82-2.91.88a71 71 0 0 0-2.2 4.54h.07q.58-.04 3.04-1.42.13 0 1.66-1.05L9.18 9.7v.03q.45-.2.81-1.3v-.2q-.5-.46-1.53-.4m.28-5.75c-.5.1-.75.19-.72.38l-1.16 2.6q-.17.1-.34.95-.3.48-.25.77v.1l.22.05A15 15 0 0 1 8.86 6c1.1-.71 2.12-1.38 2.8-2.54q.24-.33.21-.54-.02-.33-.4-.54c-.54 0-1.07-.34-1.63-.28l-.94-.03z" clip-rule="evenodd"/>
|
|
2032
|
-
</symbol>`,
|
|
2032
|
+
</symbol>`,PW=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
|
|
2033
2033
|
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
2034
2034
|
<path fill="currentColor" d="M11.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zM7 6.75C7 6.42 6.64 6 6 6s-1 .42-1 .75q-.01.25.22.41.26.21.89.35.74.14 1.28.53c.37.29.61.7.61 1.21 0 .87-.68 1.5-1.5 1.7v.55a.5.5 0 0 1-1 0v-.56c-.82-.18-1.5-.82-1.5-1.69a.5.5 0 0 1 1 0c0 .33.36.75 1 .75s1-.42 1-.75q.01-.25-.22-.41a2 2 0 0 0-.89-.35q-.74-.14-1.28-.53A1.5 1.5 0 0 1 4 6.75c0-.87.68-1.5 1.5-1.7V4.5a.5.5 0 0 1 1 0v.56c.82.18 1.5.82 1.5 1.69a.5.5 0 0 1-1 0" class="fg-stroke"/>
|
|
2035
|
-
</symbol>`,
|
|
2035
|
+
</symbol>`,FW=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
|
|
2036
2036
|
<path fill="currentColor" d="M8 2 4.88 7.35a7 7 0 0 1 3.7-.13l1.04.25-.99 4.16-1.05-.25a2.7 2.7 0 0 0-3.07 1.45l-.98-.47a4 4 0 0 1 1.07-1.31 3.8 3.8 0 0 1 3.23-.71l.5-2.08a6 6 0 0 0-5.07 1.12A5.9 5.9 0 0 0 1 14h14z"/>
|
|
2037
|
-
</symbol>`,
|
|
2037
|
+
</symbol>`,IW=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
|
|
2038
2038
|
<path fill="currentColor" fill-rule="evenodd" d="M11.72 1.5A2.5 2.5 0 0 1 14.2 4q.02 1.08.3 2.09c.22.73.56 1.24 1.08 1.45.22.08.4.27.4.5s-.18.43-.4.51q-.76.34-1.08 1.45c-.2.65-.27 1.32-.3 2a2.5 2.5 0 0 1-2.48 2.5H4.25A2.6 2.6 0 0 1 1.7 12c-.04-.85-.1-1.68-.22-2.04C1.26 9.23.92 8.7.4 8.5.18 8.42 0 8.23 0 8s.18-.42.4-.5q.77-.35 1.09-1.46c.1-.36.17-1.19.2-2.04a2.6 2.6 0 0 1 2.56-2.5z" class="bg" clip-rule="evenodd" opacity=".2"/>
|
|
2039
2039
|
<path fill="currentColor" fill-rule="evenodd" d="M8.47 4.54c1.23 0 2.04.68 2.04 1.73 0 .73-.55 1.39-1.24 1.5v.04c.94.1 1.58.77 1.58 1.7 0 1.2-.9 1.95-2.37 1.95H5.97a.3.3 0 0 1-.2-.08.3.3 0 0 1-.08-.2V4.82a.3.3 0 0 1 .08-.2.3.3 0 0 1 .2-.08zm-1.7 6.04h1.49q1.47-.01 1.49-1.15Q9.74 8.31 8.2 8.3H6.77zm0-5.16v2.06h1.21c.93 0 1.45-.38 1.45-1.06 0-.65-.44-1-1.22-1z" class="fg" clip-rule="evenodd"/>
|
|
2040
|
-
</symbol>`,
|
|
2040
|
+
</symbol>`,LW=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
|
|
2041
2041
|
<path fill="currentColor" d="M8.88 6.96c0 3.82 3.72 4.7 5.7 3.74-.23.9-1.04 1.67-2.35 1.93-.02.4.42 1.28.82 1.63-.9.35-1.94-.12-2.51-.48a5 5 0 0 0-.32 1.87c-.68 0-1.57-1-1.8-1.37-.3.18-.85 1.15-.96 1.72a2.4 2.4 0 0 1-.81-.86 2.4 2.4 0 0 1-.3-1.15c-.38.27-1.48.95-1.99 1.18-.25-.58-.15-1.3 0-2.06-.21.12-1.8.27-2.43.12.32-.36.75-1.19.94-1.57A4.5 4.5 0 0 1 .44 10.6c.48-.22.97-.53 1.49-1.06C1.26 9.17.24 8.64 0 7.7a6 6 0 0 0 1.79-.32C1.28 7.08.44 6.15.6 5.01c.42.21 1.3.37 1.73.3a3.4 3.4 0 0 1-.25-2.75 5 5 0 0 0 1.48 1c-.08-.8.3-2.31.8-2.71.2.46.73 1.21 1.08 1.4.09-.61.87-2.06 1.57-2.25 0 .5.27 1.4.5 1.67.51-.54 2.25-1.44 3.64-1.13-.43.45-.75.61-.86.98 1.05 0 2.78.34 4.27 1.93-2.34-.89-5.69.56-5.69 3.5" class="bg" opacity=".5"/>
|
|
2042
2042
|
<path fill="currentColor" d="M11.21 3.59a4.1 4.1 0 0 0 2.47 2.89c.24-.22.61-.38.95-.19.76.44.2 1.26-.34 1.66l-.07.06a13 13 0 0 1-4.49 1.61l-.3-.43a10.5 10.5 0 0 0 4.13-1.31 1 1 0 0 0 .23-.25.5.5 0 0 0-.21-.69l-.15-.06a4.5 4.5 0 0 1-1.77-1.31 4.5 4.5 0 0 1-.88-1.77q.2-.12.43-.21"/>
|
|
2043
2043
|
<path fill="currentColor" d="M10.36 5.18a.4.4 0 0 0-.03.38c.09.2.3.3.46.23s.24-.3.15-.5l-.01-.02q.23.13.34.39a.83.83 0 0 1-.43 1.08.8.8 0 0 1-1.08-.43.83.83 0 0 1 .6-1.13"/>
|
|
2044
|
-
</symbol>`,
|
|
2044
|
+
</symbol>`,RW=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
|
|
2045
2045
|
<path fill="currentColor" d="M8 14c3.87 0 7-2.46 7-5.49 0-1.88-1.2-3.53-3.04-4.52q-1.1-.61-1.84-1.07C9.2 2.35 8.64 2 8 2s-1.36.45-2.31 1.03A29 29 0 0 1 4.04 4C2.2 4.98 1 6.63 1 8.51 1 11.54 4.13 14 8 14M7.18 3.88q.3-.66.3-1.37c0-.08.11-.1.13-.01.38 1.57-.53 2.35-1.2 2.61-.08.03-.12-.07-.06-.12a3 3 0 0 0 .83-1.12m1.2-.05a3 3 0 0 0-.45-1.3V2.5c-.04-.07.05-.15.1-.1 1.15 1.2.77 2.3.33 2.87-.05.05-.13 0-.11-.08q.21-.67.13-1.37m1.04-.32a3 3 0 0 0-.94-1.02v-.01c-.06-.05-.01-.16.07-.12 1.51.61 1.61 1.8 1.43 2.5l-.03.03a.07.07 0 0 1-.1-.06 3 3 0 0 0-.43-1.32m-2.97.32c-.36.3-.74.43-1.2.56q-.11 0-.1-.1a3.5 3.5 0 0 0 1.76-1.57s.09-.07.1.04c0 .18-.2.76-.56 1.07m2.89 6.36q-.13.52-.55.88a1.3 1.3 0 0 1-.75.35 1.3 1.3 0 0 1-.77-.35 1.7 1.7 0 0 1-.54-.88.13.13 0 0 1 .15-.15h2.31a.14.14 0 0 1 .15.15M6.15 8.95a1.1 1.1 0 0 1-1.39-.14A1.1 1.1 0 0 1 5.12 7a1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1-.17 1.69m4.96 0a1.1 1.1 0 0 1-1.4-.14 1.1 1.1 0 0 1 .37-1.8 1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1 .24 1.2 1 1 0 0 1-.41.5"/>
|
|
2046
|
-
</symbol>`,
|
|
2046
|
+
</symbol>`,zW=`<symbol id="file-tree-builtin-c" viewBox="0 0 16 16">
|
|
2047
2047
|
<path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
|
|
2048
|
-
</symbol>`,
|
|
2048
|
+
</symbol>`,BW=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
|
|
2049
2049
|
<path fill="currentColor" d="M3.75 10.31 6.5 8.77l.04-.14-.04-.07h-.14l-.46-.03-1.57-.04-1.38-.07-1.33-.07-.34-.07L1 7.86l.03-.21.28-.18.4.03.89.07 1.33.08.97.06 1.43.16h.22l.03-.1-.07-.05-.06-.06-1.39-.92-1.48-.98-.79-.57-.42-.28-.2-.28-.1-.6.39-.41.52.04.12.03.52.4 1.12.86L6.2 6.04l.2.17.09-.06.01-.04-.1-.15-.76-1.46-.85-1.46-.37-.6-.1-.36a1 1 0 0 1-.06-.42l.42-.59.25-.07.6.08.22.2.36.84.58 1.3.9 1.77.29.53.14.47.04.14h.1v-.07l.07-1 .14-1.22.14-1.57.04-.45.23-.53.42-.28.36.15.28.41-.04.25-.16 1.08-.36 1.7-.21 1.14h.12l.14-.15.58-.76.97-1.2.42-.5.5-.51.32-.25h.6l.44.66-.2.68-.61.79-.52.65-.74 1-.45.8.04.05h.1l1.68-.36.9-.16 1.06-.18.5.23.05.22-.2.48-1.15.28-1.34.28-2 .46-.04.01.03.04.9.09.4.03h.94l1.77.14.46.28.27.37-.04.28-.72.37-.95-.23-2.24-.53-.76-.18h-.11v.06l.64.63L12 10.86l1.48 1.35.07.34-.18.28-.2-.03-1.29-.98-.5-.42-1.12-.95h-.07v.1l.25.38 1.37 2.05.07.63-.1.2-.36.14-.38-.08-.8-1.12-.85-1.26-.66-1.15-.07.05-.4 4.23-.19.21-.42.17-.35-.28-.2-.42.2-.87.23-1.12.18-.9.17-1.1.1-.36v-.03h-.1l-.84 1.16-1.27 1.72-1 1.07-.24.1-.42-.22.04-.39.22-.32 1.4-1.8.84-1.1.57-.64-.02-.07h-.04l-3.7 2.4-.66.09-.28-.28.03-.42.14-.14 1.12-.77z"/>
|
|
2050
|
-
</symbol>`,
|
|
2050
|
+
</symbol>`,VW=`<symbol id="file-tree-builtin-cpp" viewBox="0 0 16 16">
|
|
2051
2051
|
<path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
|
|
2052
|
-
</symbol>`,
|
|
2052
|
+
</symbol>`,HW=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
|
|
2053
2053
|
<path fill="currentColor" d="M8 15c-5.76 0-7-1.24-7-7V2a1 1 0 0 1 1-1h6c5.77 0 7 1.24 7 7s-1.24 7-7 7" class="vector" opacity=".2"/>
|
|
2054
2054
|
<path fill="currentColor" d="M10.1 9.19h.73c.03.49.22.6 1 .6.76 0 .93-.12.93-.68 0-.52-.17-.67-.94-.85-1.38-.3-1.68-.56-1.68-1.47 0-1.05.3-1.29 1.67-1.29 1.29 0 1.57.2 1.6 1.13h-.74c-.01-.34-.17-.42-.85-.42-.77 0-.94.1-.94.58 0 .42.17.55.96.73 1.36.3 1.66.58 1.66 1.59 0 1.14-.31 1.39-1.73 1.39-1.39 0-1.69-.24-1.67-1.31m-3.9 0h.74c.03.49.21.6.99.6.76 0 .93-.12.93-.68 0-.52-.17-.67-.93-.85-1.39-.3-1.69-.56-1.69-1.47 0-1.05.3-1.29 1.67-1.29 1.3 0 1.58.2 1.6 1.13h-.73c-.02-.34-.18-.42-.85-.42-.78 0-.95.1-.95.58 0 .42.17.55.96.73 1.37.3 1.67.58 1.67 1.59 0 1.14-.32 1.39-1.74 1.39-1.38 0-1.68-.24-1.66-1.31m-1.22 0h.75c-.09 1.07-.37 1.31-1.56 1.31-1.37 0-1.68-.45-1.68-2.5 0-1.96.36-2.5 1.68-2.5 1.16 0 1.44.25 1.52 1.35h-.76c-.08-.52-.22-.64-.76-.64-.74 0-.9.33-.9 1.78 0 1.47.16 1.8.9 1.8.58 0 .74-.11.8-.6"/>
|
|
2055
|
-
</symbol>`,
|
|
2055
|
+
</symbol>`,UW=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
|
|
2056
2056
|
<path fill="currentColor" d="M14.953 9.733a12.4 12.4 0 0 1-.244 1.936c-.207.933-.532 1.58-.996 2.044s-1.11.789-2.044.996C10.73 14.918 9.533 15 8 15s-2.73-.082-3.669-.291c-.933-.207-1.58-.532-2.044-.996s-.789-1.11-.996-2.044c-.122-.547-.2-1.182-.244-1.92q.23.364.532.667c.64.639 1.482 1.031 2.533 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265a4 4 0 0 0 .541-.683"/>
|
|
2057
2057
|
<path fill="currentColor" d="M14.93 5.924c-.046.663-.118 1.24-.23 1.743-.207.932-.532 1.579-.995 2.042s-1.11.789-2.042.996c-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997s-.789-1.11-.996-2.042a12 12 0 0 1-.227-1.683l.016-.188a4 4 0 0 0 .5.62c.638.639 1.48 1.031 2.532 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265.192-.192.357-.404.506-.633z"/>
|
|
2058
2058
|
<path fill="currentColor" d="M8 1c1.533 0 2.73.082 3.669.291.933.207 1.58.533 2.044.996.403.404.904.944.91 1.695.004.764-.509 1.318-.918 1.727-.463.463-1.11.789-2.042.996-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997-.406-.406-.915-.953-.915-1.71 0-.758.509-1.305.915-1.712.464-.463 1.11-.789 2.044-.996C5.27 1.082 6.467 1 8 1"/>
|
|
2059
|
-
</symbol>`,
|
|
2059
|
+
</symbol>`,WW=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
|
|
2060
2060
|
<path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".4"/>
|
|
2061
2061
|
<path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
|
|
2062
|
-
</symbol>`,
|
|
2062
|
+
</symbol>`,GW=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
|
|
2063
2063
|
<path fill="currentColor" d="M15.85 6.54c-.05-.04-.45-.36-1.31-.36q-.34 0-.68.06a2.7 2.7 0 0 0-1.14-1.79l-.23-.14-.15.23a3 3 0 0 0-.4 1q-.24 1.01.26 1.84c-.4.24-1.03.3-1.17.3H.5a.5.5 0 0 0-.5.52q-.01 1.46.46 2.83.55 1.5 1.6 2.18c.79.5 2.08.79 3.54.79q.96 0 1.94-.18a8 8 0 0 0 2.55-.97 7 7 0 0 0 1.73-1.5 10 10 0 0 0 1.7-3.06h.15a2.4 2.4 0 0 0 1.8-.7 2 2 0 0 0 .47-.74l.06-.2z"/>
|
|
2064
2064
|
<path fill="currentColor" d="M1.48 7.36h1.4a.14.14 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H1.48a.13.13 0 0 0-.13.14v1.32q.02.13.13.13m1.94 0h1.41a.14.14 0 0 0 .13-.13V5.91q-.01-.12-.13-.14h-1.4a.13.13 0 0 0-.13.14v1.32q0 .13.12.13m1.98 0h1.4q.13 0 .14-.13V5.91a.13.13 0 0 0-.14-.14H5.4q-.1.01-.12.14v1.32q0 .13.12.13m1.95 0h1.42q.1 0 .12-.13V5.91q0-.12-.12-.14H7.35q-.1.01-.12.14v1.32q.01.13.12.13M3.42 5.5h1.41c.07 0 .13-.08.13-.15V4.03a.13.13 0 0 0-.13-.14h-1.4q-.12 0-.13.14v1.31q0 .13.12.15m1.98 0h1.4c.08 0 .14-.08.14-.15V4.03q0-.13-.14-.14H5.4q-.1 0-.12.14v1.31q0 .13.12.15m1.95 0h1.42c.06 0 .12-.08.12-.15V4.03q-.01-.13-.12-.14H7.35q-.1 0-.12.14v1.31q.01.13.12.15m0-1.9h1.42q.1-.02.12-.14v-1.3Q8.88 2 8.77 2H7.35q-.1 0-.12.14v1.3q.01.13.12.14m1.97 3.78h1.4a.13.13 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H9.32q-.1.01-.12.14v1.32q.01.13.12.13" opacity=".5"/>
|
|
2065
|
-
</symbol>`,
|
|
2065
|
+
</symbol>`,KW=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
|
|
2066
2066
|
<path fill="currentColor" d="M11.16 6.1 8.12 4.35a.3.3 0 0 0-.24 0L4.84 6.1a.3.3 0 0 0-.12.2v3.5q0 .14.12.22l3.04 1.74q.12.08.24 0l3.04-1.74a.2.2 0 0 0 .13-.22V6.3a.3.3 0 0 0-.13-.2" opacity=".5"/>
|
|
2067
2067
|
<path fill="currentColor" d="m.1 7.69 3.63-6.3A.8.8 0 0 1 4.37 1h7.26c.26 0 .5.17.64.4l3.63 6.27a.8.8 0 0 1 0 .75l-3.63 6.24a.7.7 0 0 1-.64.34H4.37a.7.7 0 0 1-.64-.34L.1 8.41a.7.7 0 0 1 0-.72m3 3.02q.01.15.14.23l4.63 2.66q.13.06.26 0l4.63-2.66a.3.3 0 0 0 .14-.23V5.4a.3.3 0 0 0-.14-.23L8.13 2.52a.3.3 0 0 0-.26 0L3.24 5.17a.3.3 0 0 0-.14.23z"/>
|
|
2068
|
-
</symbol>`,
|
|
2068
|
+
</symbol>`,qW=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
|
|
2069
2069
|
<path fill="currentColor" d="M12.3 13c-1.59 0-2.68-.99-2.68-2.5 0-1.43 1-2.34 2.88-2.35h2.16v-.83c0-1.08-.62-1.68-1.73-1.68-1.05 0-1.66.54-1.73 1.36H9.93c.09-1.43 1.06-2.48 3.05-2.48 1.75 0 3.02.95 3.02 2.68v5.66h-1.29v-1.02h-.04c-.41.66-1.16 1.16-2.37 1.16m.36-1.12c1.14 0 2-.72 2-1.74v-.96H12.6c-1.12 0-1.6.54-1.6 1.28 0 .97.8 1.42 1.66 1.42m-11.24.98H0L3.8 2h1.39l3.8 10.86H7.54l-1.08-3.2H2.5zm3.09-9.25h-.04l-1.6 4.95H6.1z"/>
|
|
2070
|
-
</symbol>`,
|
|
2070
|
+
</symbol>`,JW=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
|
|
2071
2071
|
<path fill="currentColor" d="M14.74 7.38 8.62 1.26a.9.9 0 0 0-1.27 0L6.08 2.53l1.61 1.61a1.07 1.07 0 0 1 1.36 1.37l1.55 1.55a1.07 1.07 0 0 1 1.1 1.77 1.07 1.07 0 0 1-1.74-1.16L8.5 6.22v3.8a1.07 1.07 0 1 1-.89-.02V6.15a1.07 1.07 0 0 1-.58-1.4l-1.58-1.6-4.2 4.2a.9.9 0 0 0 0 1.27l6.12 6.12a.9.9 0 0 0 1.27 0l6.09-6.09a.9.9 0 0 0 0-1.27"/>
|
|
2072
|
-
</symbol>`,
|
|
2072
|
+
</symbol>`,YW=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
|
|
2073
2073
|
<path fill="currentColor" fill-rule="evenodd" d="M4.41 4.57A3.2 3.2 0 0 1 6.87 5q.74.49 1.08 1.29.08.12-.1.16l-1.55.4c-.14.03-.15.04-.27-.1a1 1 0 0 0-.44-.34 1.6 1.6 0 0 0-1.68.14q-.95.61-.94 1.73c0 .73.52 1.33 1.25 1.43q.95.1 1.58-.6l.25-.34h-1.8c-.19 0-.24-.12-.17-.27.12-.28.34-.76.47-1a.3.3 0 0 1 .24-.14h2.98a4 4 0 0 1 .64-1.19 4 4 0 0 1 2.6-1.52 3.5 3.5 0 0 1 2.64.46q1.13.73 1.31 2.04a3.5 3.5 0 0 1-1.06 3.09q-.93.92-2.23 1.17l-.74.08a3.5 3.5 0 0 1-2.27-.8 3 3 0 0 1-.93-1.42 4 4 0 0 1-.39.61 4 4 0 0 1-2.64 1.56 3.3 3.3 0 0 1-2.5-.6 3 3 0 0 1-1.18-2.03 3.5 3.5 0 0 1 .8-2.67 4 4 0 0 1 2.6-1.58M13.1 7.5a1.53 1.53 0 0 0-1.9-1.21q-1.3.3-1.62 1.59a1.5 1.5 0 0 0 .85 1.72q.77.33 1.52-.05a2 2 0 0 0 1.18-1.74q0-.17-.03-.3" clip-rule="evenodd"/>
|
|
2074
|
-
</symbol>`,
|
|
2074
|
+
</symbol>`,XW=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
|
|
2075
2075
|
<path fill="currentColor" fill-rule="evenodd" d="M8 1a1.25 1.25 0 0 1 1.18 1.65l2.8 1.61q.33-.25.77-.26a1.25 1.25 0 0 1 .48 2.4v3.2a1.25 1.25 0 1 1-1.25 2.13l-2.8 1.62A1.25 1.25 0 0 1 8 15a1.25 1.25 0 0 1-1.18-1.65l-2.8-1.62q-.33.26-.77.27a1.25 1.25 0 0 1-.48-2.4V6.4a1.25 1.25 0 1 1 1.25-2.14l2.8-1.61A1.25 1.25 0 0 1 8 1M4.44 11.14l-.06.13 2.75 1.58a1.25 1.25 0 0 1 1.74 0l2.74-1.58-.05-.13zm3.89-7.68a1.3 1.3 0 0 1-.66 0L4.03 9.77q.37.3.45.78h7.04q.08-.48.45-.78zM4.38 4.73a1.24 1.24 0 0 1-1.02 1.76v3.02l.13.01 3.67-6.35-.03-.02zm4.46-1.56 3.67 6.35.13-.01V6.49a1.25 1.25 0 0 1-1.03-1.76L8.87 3.15z" clip-rule="evenodd"/>
|
|
2076
|
-
</symbol>`,
|
|
2076
|
+
</symbol>`,ZW=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
|
|
2077
2077
|
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
2078
2078
|
<path fill="currentColor" d="M10.48 3.76a.5.5 0 0 1 .4.58L10.6 5.8h1.14a.5.5 0 0 1 0 1h-1.32L10 9.2h1.08a.5.5 0 0 1 0 1H9.8l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H6.4l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H4.25a.5.5 0 0 1 0-1h1.32L6 6.8H4.93a.5.5 0 0 1 0-1H6.2l.3-1.64a.5.5 0 1 1 .98.18L7.2 5.8h2.4l.3-1.64a.5.5 0 0 1 .58-.4M6.58 9.2h2.4l.44-2.4h-2.4z" class="fg"/>
|
|
2079
|
-
</symbol>`,
|
|
2079
|
+
</symbol>`,QW=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
|
|
2080
2080
|
<path fill="currentColor" d="M12.5 2A2.5 2.5 0 0 1 15 4.5v4.67l-4.05-3.54-4.08 4.08-3-2L1 10.6V4.5A2.5 2.5 0 0 1 3.5 2z" opacity=".3"/>
|
|
2081
2081
|
<path fill="currentColor" d="M15 10.5v1a2.5 2.5 0 0 1-2.5 2.5h-9a2.5 2.5 0 0 1-2.46-2.04L4 9l3 2 4-4zm-7-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"/>
|
|
2082
|
-
</symbol
|
|
2082
|
+
</symbol>`,$W=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
|
|
2083
2083
|
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
2084
2084
|
<path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66M3.5 9.5h.98c0 .76.15.92.85.92.77 0 .94-.18.94-1.02V5.1h1v4.34c0 1.54-.35 1.87-1.92 1.87-1.55 0-1.89-.32-1.86-1.8"/>
|
|
2085
|
-
</symbol>`,
|
|
2085
|
+
</symbol>`,eG=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
|
|
2086
2086
|
<path fill="currentColor" d="M13.25 11.5V9.75a.5.5 0 0 1 .36-.48l.55-.15a1.16 1.16 0 0 0 0-2.24l-.55-.15a.5.5 0 0 1-.36-.48V4.5a2.5 2.5 0 0 0-2.5-2.5h-.25a.5.5 0 0 0 0 1h.25a1.5 1.5 0 0 1 1.5 1.5v1.75a1.5 1.5 0 0 0 1.09 1.44l.54.15a.16.16 0 0 1 0 .32l-.54.15a1.5 1.5 0 0 0-1.09 1.44v1.75a1.5 1.5 0 0 1-1.5 1.5h-.25a.5.5 0 0 0 0 1h.25a2.5 2.5 0 0 0 2.5-2.5m-10.5 0V9.75a.5.5 0 0 0-.36-.48l-.55-.15a1.16 1.16 0 0 1 0-2.24l.55-.15a.5.5 0 0 0 .36-.48V4.5A2.5 2.5 0 0 1 5.25 2h.25a.5.5 0 0 1 0 1h-.25a1.5 1.5 0 0 0-1.5 1.5v1.75a1.5 1.5 0 0 1-1.09 1.44l-.54.15a.16.16 0 0 0 0 .32l.54.15a1.5 1.5 0 0 1 1.09 1.45v1.74a1.5 1.5 0 0 0 1.5 1.5h.25a.5.5 0 0 1 0 1h-.25a2.5 2.5 0 0 1-2.5-2.5"/>
|
|
2087
|
-
</symbol>`,
|
|
2087
|
+
</symbol>`,tG=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
|
|
2088
2088
|
<path fill="currentColor" d="M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z"/>
|
|
2089
|
-
</symbol>`,
|
|
2089
|
+
</symbol>`,nG=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
|
|
2090
2090
|
<path fill="currentColor" d="M9.26-.04a3 3 0 0 1 2 .82 2.8 2.8 0 0 1 .8 2.35 2.9 2.9 0 0 1 2.41.8l.03.02a2.74 2.74 0 0 1 0 3.94l-5.8 5.69-.04.06-.02.07q0 .04.02.07.01.04.04.06l1.2 1.17a.55.55 0 0 1 0 .79.6.6 0 0 1-.81 0l-1.2-1.17a1.3 1.3 0 0 1 0-1.84L13.7 7.1a1.65 1.65 0 0 0 .37-1.82 2 2 0 0 0-.37-.54l-.03-.03a1.73 1.73 0 0 0-2.4 0L6.47 9.4l-.07.06a.58.58 0 0 1-.92-.18.6.6 0 0 1 .12-.6l4.85-4.76a1.65 1.65 0 0 0 0-2.36 1.73 1.73 0 0 0-2.4 0l-6.43 6.3a.6.6 0 0 1-.8 0 .55.55 0 0 1 0-.8L7.25.79a3 3 0 0 1 2-.82"/>
|
|
2091
2091
|
<path fill="currentColor" d="M9.26 2.19a.6.6 0 0 1 .52.34.6.6 0 0 1 0 .43l-.12.18L4.9 7.79a1.65 1.65 0 0 0 0 2.36 1.73 1.73 0 0 0 2.4 0l4.75-4.66a.58.58 0 0 1 .93.18.6.6 0 0 1-.12.61l-4.75 4.66a2.9 2.9 0 0 1-4.01 0 2.75 2.75 0 0 1-.62-3.04A3 3 0 0 1 4.1 7l4.74-4.65a.6.6 0 0 1 .4-.16"/>
|
|
2092
|
-
</symbol>`,
|
|
2092
|
+
</symbol>`,rG=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
|
|
2093
2093
|
<defs>
|
|
2094
2094
|
<linearGradient id="a" x1="4.522" x2="14" y1="3.943" y2="16" gradientUnits="userSpaceOnUse">
|
|
2095
2095
|
<stop stop-color="currentColor"/>
|
|
@@ -2099,82 +2099,82 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
|
|
|
2099
2099
|
<path fill="currentColor" d="M3 2h1.522v9.09H3z"/>
|
|
2100
2100
|
<path fill="url(#a)" d="M4.903 2 15 15.075q-.565.5-1.195.925L4.522 3.943z"/>
|
|
2101
2101
|
<path fill="currentColor" d="M12.172 2h-1.508v9.094h1.508z"/>
|
|
2102
|
-
</symbol>`,
|
|
2102
|
+
</symbol>`,iG=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
|
|
2103
2103
|
<path fill="currentColor" d="M2 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z" class="vector" opacity=".2"/>
|
|
2104
2104
|
<path fill="currentColor" d="M10.5 13H13V3H3v10h5V5.5h2.5z"/>
|
|
2105
|
-
</symbol>`,
|
|
2105
|
+
</symbol>`,aG=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
|
|
2106
2106
|
<path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .5.5V3h3.5a.5.5 0 0 1 .38.83L10.5 7.69v1.44q.41.04.95-.16a4 4 0 0 0 .72-.35l.04-.03h.01a.5.5 0 0 1 .67.1l2 2.5a.5.5 0 0 1 0 .62c-.76.96-3.14 2.69-6.89 2.69s-6.13-1.73-6.89-2.69a.5.5 0 0 1 0-.62l2-2.5a.5.5 0 0 1 .67-.1l.05.03.16.09q.22.13.56.26.54.2.95.16V7.69L2.12 3.83A.5.5 0 0 1 2.5 3H6V1.5a.5.5 0 0 1 .5-.5zM7 3.5a.5.5 0 0 1-.5.5H3.6l2.78 3.17a.5.5 0 0 1 .12.33v2a.5.5 0 0 1-.28.45c-.7.35-1.5.15-2.02-.05a5 5 0 0 1-.58-.26l-1.46 1.84c.82.78 2.8 2.02 5.84 2.02s5.02-1.24 5.84-2.02l-1.46-1.83a5 5 0 0 1-.58.26c-.52.2-1.33.39-2.02.04a.5.5 0 0 1-.28-.45v-2a.5.5 0 0 1 .12-.33L12.4 4H9.5a.5.5 0 0 1-.5-.5V2H7z"/>
|
|
2107
|
-
</symbol>`,
|
|
2107
|
+
</symbol>`,oG=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
|
|
2108
2108
|
<path fill="currentColor" d="M14.5 8a6.5 6.5 0 0 0-5.9-6.47l5.42 8.93A7 7 0 0 0 14.5 8M2.88 12A6.5 6.5 0 0 0 8 14.5c2.08 0 3.93-.98 5.12-2.5zm8.62-1h1.68L11.5 8.24zm-1-.55a4 4 0 0 1-.7.55h.7zM8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M5.5 11h.7a4 4 0 0 1-.7-.55zm-2.68 0H4.5V8.24zm3.76-6.2A4 4 0 0 1 8 4.5q.76 0 1.42.3L8 2.46zM1.5 8q0 1.31.48 2.46L7.4 1.53A6.5 6.5 0 0 0 1.5 8m14 0a7.5 7.5 0 0 1-.99 3.72l-.01.03-.02.03A7.5 7.5 0 0 1 8 15.5a7.5 7.5 0 0 1-6.5-3.75l-.01-.03A7.5 7.5 0 1 1 15.5 8"/>
|
|
2109
|
-
</symbol>`,
|
|
2109
|
+
</symbol>`,sG=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
|
|
2110
2110
|
<path fill="currentColor" d="M6 12v1H4.93v-1zm1-2v1H2v-1zm6-4v1h-3V6zm-1-4v1H9V2z"/>
|
|
2111
2111
|
<path fill="currentColor" d="M11.5 10v1H8v-1zM5 6v1H2V6zm5-2v1H9V4z" opacity=".8"/>
|
|
2112
2112
|
<path fill="currentColor" d="M6 14v1H2v-1zm-.5-6v1H2V8zM13 4v1h-3V4zM4.93 2v1H2V2z" opacity=".6"/>
|
|
2113
2113
|
<path fill="currentColor" d="M4.93 12v1H2v-1zM13 8v1H9V8zM5.5 4v1H2V4zM9 2v1H4.93V2z" opacity=".4"/>
|
|
2114
|
-
</symbol>`,
|
|
2114
|
+
</symbol>`,cG=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
|
|
2115
2115
|
<path fill="currentColor" d="M8.33 8.4H10c1.16 0 1.9-.73 1.9-1.86V5.08q0-.24.25-.24h.74c.75 0 1.33.32 1.66.97q.4.73.41 1.46c.09.9.09 1.78-.24 2.67-.25.73-.75 1.3-1.58 1.46h-4.8c-.08 0-.25 0-.25.08v.4s.17.09.25.09h2.82q.34-.02.33.32v1.06c0 .56-.25.97-.75 1.13-.41.16-.83.33-1.24.4a7 7 0 0 1-2.98-.07 3 3 0 0 1-1.16-.49c-.33-.32-.58-.65-.5-1.14v-2.91c0-1.13.67-1.78 1.82-1.78q.89-.1 1.66-.08m2.32 4.86a.65.65 0 0 0-.66-.65c-.34 0-.67.33-.67.65s.33.57.67.65a.65.65 0 0 0 .66-.65" class="bg" opacity=".8"/>
|
|
2116
2116
|
<path fill="currentColor" d="M7.67 7.6H6c-1.16 0-1.9.73-1.9 1.86v1.46q0 .24-.25.24h-.74c-.75 0-1.33-.32-1.66-.97a3 3 0 0 1-.41-1.46 6 6 0 0 1 .24-2.67c.25-.73.75-1.3 1.58-1.46h4.8c.08 0 .25 0 .25-.08v-.4s-.17-.09-.25-.09H4.85c-.24 0-.33-.08-.33-.32V2.65c0-.56.25-.97.75-1.13.41-.16.83-.33 1.24-.4a7 7 0 0 1 2.98.07c.41.09.83.25 1.16.49.33.32.58.65.5 1.13v2.92c0 1.14-.67 1.78-1.82 1.78-.58.08-1.16.08-1.66.08M5.35 2.73c0 .33.25.65.66.65.33 0 .66-.32.66-.65 0-.32-.33-.56-.66-.64a.65.65 0 0 0-.66.64" class="fg"/>
|
|
2117
|
-
</symbol
|
|
2117
|
+
</symbol>`,lG=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
|
|
2118
2118
|
<path fill="currentColor" d="M8 6.65c.73 0 1.31.6 1.31 1.35S8.73 9.35 8 9.35 6.69 8.75 6.69 8 7.27 6.65 8 6.65"/>
|
|
2119
2119
|
<path fill="currentColor" fill-rule="evenodd" d="M8 2.55c1.3-.99 2.59-1.34 3.5-.8.92.55 1.27 1.87 1.08 3.53C14.06 5.94 15 6.9 15 8s-.94 2.06-2.42 2.72c.19 1.65-.16 2.98-1.08 3.52-.91.55-2.2.2-3.5-.8-1.3 1-2.58 1.35-3.5.8-.91-.54-1.27-1.87-1.08-3.52C1.94 10.06 1 9.1 1 8s.94-2.06 2.42-2.72c-.19-1.66.17-2.98 1.08-3.52s2.2-.2 3.5.8M4.26 11.2c-.08 1.34.28 2.03.68 2.26s1.15.22 2.25-.52l.11-.09a12 12 0 0 1-1.24-1.39 11 11 0 0 1-1.8-.41zm7.47-.15q-.83.27-1.79.41-.6.8-1.24 1.4l.11.08c1.1.74 1.86.76 2.25.52.4-.23.76-.92.68-2.26zm-3.04.54a14 14 0 0 1-1.38 0q.34.38.69.7.35-.32.7-.7M8 5.29q-.76 0-1.47.1A13 13 0 0 0 5.07 8a14 14 0 0 0 1.46 2.62 13 13 0 0 0 2.94 0A13 13 0 0 0 10.93 8a14 14 0 0 0-1.46-2.62A13 13 0 0 0 8 5.3M4.64 9.18q-.15.5-.25.96.44.16.94.27a15 15 0 0 1-.7-1.23m6.73 0a15 15 0 0 1-.7 1.23q.5-.11.95-.27a10 10 0 0 0-.25-.96M3.44 6.26C2.27 6.86 1.87 7.53 1.87 8s.4 1.14 1.57 1.74l.13.07q.18-.88.55-1.81a12 12 0 0 1-.55-1.8q-.07.02-.13.06m8.99-.07A12 12 0 0 1 11.88 8q.36.94.55 1.8l.13-.06c1.17-.6 1.56-1.27 1.56-1.74s-.39-1.14-1.56-1.74zm-7.1-.6q-.5.11-.94.27.1.46.25.96a15 15 0 0 1 .69-1.23m5.34 0a15 15 0 0 1 .7 1.23q.14-.5.24-.96-.44-.15-.94-.27M7.18 3.06c-1.09-.74-1.85-.76-2.24-.52s-.76.92-.69 2.26l.01.15a11 11 0 0 1 1.8-.41q.6-.8 1.24-1.4zm3.88-.52c-.4-.24-1.15-.22-2.25.52l-.12.08q.65.6 1.25 1.4.96.15 1.8.41v-.14c.08-1.35-.28-2.04-.68-2.27M8 3.7a10 10 0 0 0-.7.7 14 14 0 0 1 1.4 0 10 10 0 0 0-.7-.7" clip-rule="evenodd"/>
|
|
2120
|
-
</symbol>`,
|
|
2120
|
+
</symbol>`,uG=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
|
|
2121
2121
|
<path fill="currentColor" fill-rule="evenodd" d="M11.04 2c.48 0 .92.23 1.18.6l2.54 3.65c.37.52.3 1.23-.15 1.69l-5.58 5.64a1.47 1.47 0 0 1-2.06 0L1.39 7.94a1.3 1.3 0 0 1-.15-1.7l2.54-3.63q.2-.3.5-.45.33-.16.68-.16zm.84 2.17a.5.5 0 0 0-.7-.05L8 6.84 4.83 4.12a.5.5 0 0 0-.65.76L6.65 7H3.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1H9.35l2.48-2.12a.5.5 0 0 0 .05-.7" clip-rule="evenodd"/>
|
|
2122
|
-
</symbol>`,
|
|
2122
|
+
</symbol>`,dG=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
|
|
2123
2123
|
<path fill="currentColor" fill-rule="evenodd" d="M8 .8a.2.2 0 0 1 .18.1l.38.6.16.02.5-.53.01-.01a.2.2 0 0 1 .33.08l.25.68.16.05.59-.43h.02a.2.2 0 0 1 .3.14l.12.71.15.08.65-.3a.2.2 0 0 1 .2.02.2.2 0 0 1 .1.18l-.03.72.12.1.71-.16a.2.2 0 0 1 .25.25l-.17.7q.06.06.1.13l.73-.03A.2.2 0 0 1 14 4a.2.2 0 0 1 .02.2l-.3.66.08.14.71.12a.2.2 0 0 1 .14.32l-.43.59.05.16.68.25a.2.2 0 0 1 .07.35l-.53.49.01.16.62.38a.2.2 0 0 1 0 .36l-.62.38-.01.16.53.5a.2.2 0 0 1-.07.34l-.68.25-.05.16.43.59a.2.2 0 0 1-.14.32l-.72.12-.07.15.3.65a.2.2 0 0 1-.02.2.2.2 0 0 1-.18.1l-.72-.03-.1.13.16.7a.2.2 0 0 1-.25.25l-.7-.17-.13.1.03.73a.2.2 0 0 1-.1.18.2.2 0 0 1-.2.02l-.66-.3-.14.08-.12.71a.2.2 0 0 1-.32.14l-.59-.43-.16.05-.25.68a.2.2 0 0 1-.34.07l-.5-.53-.16.01-.38.62a.2.2 0 0 1-.36 0l-.38-.62-.16-.01-.5.53a.2.2 0 0 1-.34-.07l-.25-.68-.16-.05-.59.43a.2.2 0 0 1-.32-.14L5 13.78l-.15-.07-.65.3a.2.2 0 0 1-.2-.02.2.2 0 0 1-.1-.18l.03-.72-.13-.1-.7.16a.2.2 0 0 1-.25-.25l.17-.7-.1-.13-.73.03a.2.2 0 0 1-.2-.3l.3-.66-.08-.14-.71-.12a.2.2 0 0 1-.14-.32l.43-.59-.05-.16-.68-.25A.2.2 0 0 1 1 9.22l.53-.5-.02-.16-.6-.38A.2.2 0 0 1 .8 8a.2.2 0 0 1 .1-.18l.6-.38.02-.16-.53-.5a.2.2 0 0 1 .07-.34l.68-.25.05-.16-.43-.59a.2.2 0 0 1 .14-.32L2.2 5l.08-.15L2 4.2a.2.2 0 0 1 .2-.3l.72.03.1-.13-.16-.7a.2.2 0 0 1 .25-.25l.7.16.13-.1-.03-.72A.2.2 0 0 1 4 2a.2.2 0 0 1 .2-.02l.65.3L5 2.2l.12-.71v-.03a.2.2 0 0 1 .32-.1l.59.41.16-.04.25-.68.01-.02A.2.2 0 0 1 6.8.99l.49.53.16-.02.38-.61.02-.02A.2.2 0 0 1 8 .79M6.8 9.45h1.26l.06.01q.03.01.03.05v1.52q0 .07-.09.06h-4.5A5.4 5.4 0 0 0 8 13.42a5.4 5.4 0 0 0 4.45-2.33h-2.42c-.36 0-.68-.5-.77-.75-.08-.22-.2-.91-.25-1.12-.15-.61-.59-.71-.78-.73H6.8zM8 2.58a5.4 5.4 0 0 0-4.07 1.85h5.74l.17.02c.23.03.6.12.96.35.34.23.83.68.83 1.4 0 .66-.55 1.16-1.08 1.5.42.33.7.53.86 1.44.04.17.34.32.62.29.29-.03.62-.16.62-.75v-.24q0-.1.07-.1h.68A5.43 5.43 0 0 0 8 2.59M2.96 6.03a5.4 5.4 0 0 0-.19 3.37h1.66V6.03zM6.8 7.06h1.66c.35 0 .77-.12.77-.47 0-.42-.55-.53-.65-.53H6.8z" clip-rule="evenodd"/>
|
|
2124
|
-
</symbol>`,
|
|
2124
|
+
</symbol>`,fG=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
|
|
2125
2125
|
<path fill="currentColor" fill-rule="evenodd" d="M8.08 1.44c2.41-.91 4.96-.37 5.35 1.27.39 1.62-.92 3.56-2.6 4.25a5 5 0 0 1-3.26.35c-.58-.2-.92-.62-1-.85-.03-.09-.09-.24 0-.3.05-.03.08-.02.22.15s.7.6 1.75.48c2.78-.34 4.45-2.64 3.92-3.88-.37-.87-2.5-1.26-5.18.16C4.03 4.81 3.85 6.24 3.82 6.8c-.08 1.5 1.73 2.28 2.7 3.4q.04.03.07.08c.3-.12.7-.19 1.35-.2 1.58-.03 2.47 1.08 2.43 2.08-.03.78-.7 1.1-.82 1.13-.1.01-.14.02-.15-.06q-.03-.06.13-.15c.16-.09.42-.3.48-.72.05-.43-.24-1.44-1.76-1.63a3 3 0 0 0-1.33.08c.27.62.32 1.87-.29 2.83-.63 1-1.8 1.61-2.93 1.27-.37-.1-.93-.92-.45-2.05.46-1.07 2.4-2.12 2.66-2.26-.9-.83-3.08-1.95-3.4-3.65-.08-.49.13-1.65 1.46-2.98a12 12 0 0 1 4.11-2.52m-1.88 9.7c-.01.01-.9.47-1.52 1.17-.59.66-.75 1.48-.43 1.69.3.18 1-.04 1.51-.62a3 3 0 0 0 .5-.9q.2-.64.02-1.39z" clip-rule="evenodd"/>
|
|
2126
|
-
</symbol>`,
|
|
2126
|
+
</symbol>`,pG=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
|
|
2127
2127
|
<path fill="currentColor" d="M4 3v3.5l1.5-1L7 15 .5 6l1-1.5L0 3l2.5-2h1zm12 0-1.5 1.5 1 1.5L9 15l1.5-9.5 1.5 1V3l.5-2h1zm-8 8.5a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1"/>
|
|
2128
2128
|
<path fill="currentColor" d="M6.5 2.5V4l-2 1.5v-4zm5 3L9.5 4V2.5l2-1zM9 4H7V2.5h2z"/>
|
|
2129
|
-
</symbol>`,
|
|
2129
|
+
</symbol>`,mG=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
|
|
2130
2130
|
<path fill="currentColor" d="m3.98 3.7 3.36-2.08a4.5 4.5 0 0 1 5.9 1.23 4 4 0 0 1 .7 3.02q-.16.75-.58 1.4c.42.77.56 1.66.4 2.52a3.7 3.7 0 0 1-1.57 2.4l-.17.1-3.36 2.09a4.5 4.5 0 0 1-5.9-1.23 4 4 0 0 1-.66-1.44 4 4 0 0 1-.04-1.58 4 4 0 0 1 .58-1.4 4 4 0 0 1-.4-2.52 3.7 3.7 0 0 1 1.57-2.4zl3.36-2.08zm7.87 0a2.7 2.7 0 0 0-1.26-.95 2.7 2.7 0 0 0-1.6-.07 3 3 0 0 0-.52.2l-.16.09-3.36 2.08a2 2 0 0 0-.69.64 2 2 0 0 0-.36.86 2.3 2.3 0 0 0 .42 1.81A2.7 2.7 0 0 0 7.18 9.4q.28-.06.53-.2l.16-.09 1.28-.79.2-.09a.8.8 0 0 1 .87.31.7.7 0 0 1 .13.55.7.7 0 0 1-.24.4l-.08.05-3.36 2.08-.2.09a1 1 0 0 1-.49-.02 1 1 0 0 1-.38-.3 1 1 0 0 1-.13-.37v-.1l.01-.13-.13-.03a4 4 0 0 1-1.1-.5l-.2-.14-.18-.12-.07.18-.08.3a2.3 2.3 0 0 0 .43 1.82q.45.64 1.19.93.73.28 1.51.14l.16-.04q.27-.07.52-.2l.16-.09 3.36-2.08q.4-.25.69-.64.27-.4.36-.86a2.3 2.3 0 0 0-.42-1.82 2.7 2.7 0 0 0-1.27-.95 2.7 2.7 0 0 0-1.6-.08q-.27.07-.52.2l-.16.1-1.28.79-.2.09a1 1 0 0 1-.49-.03 1 1 0 0 1-.38-.29.7.7 0 0 1-.13-.54.7.7 0 0 1 .24-.4l.08-.06L9.33 4.4l.2-.1a.8.8 0 0 1 .87.32 1 1 0 0 1 .13.38v.22l.11.04q.6.18 1.12.5l.2.14.17.12.06-.19.08-.3a2.3 2.3 0 0 0-.42-1.81z"/>
|
|
2131
|
-
</symbol>`,
|
|
2131
|
+
</symbol>`,hG=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
|
|
2132
2132
|
<path fill="currentColor" d="M5 7a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2z"/>
|
|
2133
2133
|
<path fill="currentColor" d="M6 1a5 5 0 0 1 4.58 3H7a3 3 0 0 0-3 3v3.58A5 5 0 0 1 6 1" opacity=".5"/>
|
|
2134
|
-
</symbol>`,
|
|
2134
|
+
</symbol>`,gG=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
|
|
2135
2135
|
<path fill="currentColor" d="M9.43 4.8A.6.6 0 1 1 9.19 6l-.56.96a1.2 1.2 0 0 1 .32 1.58l.7.53a.89.89 0 1 1-.17.22l-.7-.52a1.2 1.2 0 0 1-1.4.25l-.56.87a.75.75 0 1 1-.57-.2 1 1 0 0 1 .32.05l.56-.87a1.2 1.2 0 0 1-.4-1.24l-1.2-.47a.56.56 0 1 1 .1-.28v.02l1.2.47a1.2 1.2 0 0 1 1.56-.55l.56-.97a.6.6 0 0 1-.15-.64.6.6 0 0 1 .63-.4"/>
|
|
2136
2136
|
<path fill="currentColor" fill-rule="evenodd" d="M9.17 1q.16.63.27 1.26a6 6 0 0 1 1.61.67q.52-.38 1.08-.71l1.65 1.64q-.32.56-.68 1.05.48.78.72 1.67.6.09 1.18.25v2.32q-.55.15-1.11.24a6 6 0 0 1-.7 1.82q.31.44.59.91l-1.65 1.65-.85-.55a6 6 0 0 1-1.9.83q-.08.47-.2.95H6.84q-.12-.46-.2-.93a6 6 0 0 1-1.96-.81q-.39.27-.8.51l-1.65-1.65q.25-.43.53-.84a6 6 0 0 1-.75-1.9L1 9.16V6.83q.54-.14 1.09-.24a6 6 0 0 1 .77-1.74q-.33-.47-.63-.98l1.65-1.65q.54.32 1.03.68a6 6 0 0 1 1.66-.66q.1-.61.26-1.24zM7.96 3.73a4 4 0 0 0-1.74.36 4.5 4.5 0 0 0-2.3 2.3 4.4 4.4 0 0 0-.1 3.29l.03.06a4.4 4.4 0 0 0 2.4 2.47 4.4 4.4 0 0 0 3.48-.02l.03-.02a4.4 4.4 0 0 0 2.3-2.42l.06-.14a4.4 4.4 0 0 0-.2-3.4 4.4 4.4 0 0 0-2.13-2.07L9.47 4a4 4 0 0 0-1.51-.27" clip-rule="evenodd"/>
|
|
2137
|
-
</symbol>`,
|
|
2137
|
+
</symbol>`,_G=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
|
|
2138
2138
|
<path fill="currentColor" d="M9.63 1c6.15 4.35 4.16 9.15 4.16 9.15s1.75 2.05 1.04 3.85c0 0-.72-1.26-1.93-1.26-1.17 0-1.85 1.26-4.2 1.26C3.47 14 1 9.46 1 9.46c4.71 3.22 7.93.94 7.93.94C6.8 9.12 2.29 3 2.29 3c3.93 3.47 5.63 4.39 5.63 4.39-1.01-.87-3.86-5.13-3.86-5.13C6.34 4.66 10.86 8 10.86 8c1.28-3.7-1.23-7-1.23-7"/>
|
|
2139
|
-
</symbol>`,
|
|
2139
|
+
</symbol>`,vG=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
|
|
2140
2140
|
<path fill="currentColor" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" opacity=".4"/>
|
|
2141
2141
|
<path fill="currentColor" d="M11.5 8a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5zM5 12h2.5v-1H5zm3.5 0H11v-1H8.5zM5 10h2.5V9H5zm3.5 0H11V9H8.5zm1-9a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
|
|
2142
|
-
</symbol>`,
|
|
2142
|
+
</symbol>`,yG=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
|
|
2143
2143
|
<path fill="currentColor" fill-rule="evenodd" d="M8 4Q5.2 4 4.5 6.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C8.98 7.23 9.77 8 11.5 8q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C10.52 4.77 9.73 4 8 4M4.5 8Q1.7 8 1 10.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C5.48 11.23 6.26 12 8 12q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C7.02 8.77 6.24 8 4.5 8" clip-rule="evenodd"/>
|
|
2144
|
-
</symbol>`,
|
|
2144
|
+
</symbol>`,bG=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
|
|
2145
2145
|
<path fill="currentColor" d="M1 0v5.05l4.35 2.53V2.53zm9.18 5.34L5.83 2.82v5.05l4.35 2.53zm.47 5.06V5.34L15 2.82v5.05zm-.48 5.6-4.35-2.53V8.42l4.35 2.53z"/>
|
|
2146
|
-
</symbol>`,
|
|
2146
|
+
</symbol>`,xG=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
|
|
2147
2147
|
<path fill="currentColor" fill-rule="evenodd" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" clip-rule="evenodd" opacity=".4"/>
|
|
2148
2148
|
<path fill="currentColor" d="M8.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zm2-2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1zm-1-8a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z"/>
|
|
2149
|
-
</symbol>`,
|
|
2149
|
+
</symbol>`,SG=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
|
|
2150
2150
|
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
2151
2151
|
<path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66m-3 1.57V5.99H3.5v-.9h4.21v.9H6.1v5.22z"/>
|
|
2152
|
-
</symbol>`,
|
|
2152
|
+
</symbol>`,CG=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
|
|
2153
2153
|
<path fill="currentColor" d="M8.57 14.87c-.18.26-.55.11-.55-.22v-3.18l-.05-.27-.13-.22-.2-.15-.24-.06H4.29c-.26 0-.4-.32-.26-.55L6.08 7c.3-.46 0-1.1-.5-1.1H1.8c-.25 0-.4-.32-.25-.56l2.65-4.2A.3.3 0 0 1 4.46 1h7.9c.26 0 .4.32.26.55l-2.05 3.23c-.29.46 0 1.1.5 1.1h3.12c.26 0 .4.34.24.57z"/>
|
|
2154
|
-
</symbol>`,
|
|
2154
|
+
</symbol>`,wG=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
|
|
2155
2155
|
<path fill="currentColor" d="m5.11 9.68-2.4 1.84a.6.6 0 0 1-.75-.04l-.77-.7a.6.6 0 0 1 0-.87L3.28 8zm5.52-8.42a.51.51 0 0 1 .87.36V4.8L7.32 8 5.1 6.32z" opacity=".75"/>
|
|
2156
2156
|
<path fill="currentColor" d="M11.1 14.99h.03zM1.96 4.52a.6.6 0 0 1 .75-.04l8.8 6.71v3.19a.51.51 0 0 1-.88.36L1.19 6.1a.6.6 0 0 1 0-.87z" opacity=".65"/>
|
|
2157
2157
|
<path fill="currentColor" d="M11.62 14.91a.9.9 0 0 1-1-.17.51.51 0 0 0 .88-.36V1.62a.51.51 0 0 0-.87-.36.9.9 0 0 1 1-.17l2.87 1.39a.9.9 0 0 1 .5.8v9.44a.9.9 0 0 1-.5.8z"/>
|
|
2158
|
-
</symbol>`,
|
|
2158
|
+
</symbol>`,TG=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
|
|
2159
2159
|
<path fill="currentColor" d="M9.62 2.25 8 5.02 6.38 2.25H1l7 12 7-12z" opacity=".5"/>
|
|
2160
2160
|
<path fill="currentColor" d="M9.54 2.25 8 4.95l-1.54-2.7H4l4 7 4-7z"/>
|
|
2161
|
-
</symbol>`,
|
|
2161
|
+
</symbol>`,EG=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
|
|
2162
2162
|
<path fill="currentColor" d="M13 1a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h3a2 2 0 1 0 4 0z" class="subtract" opacity=".2"/>
|
|
2163
2163
|
<path fill="currentColor" d="M4.64 11.4h.02l.8-3.4h.91l.73 3.45L7.88 8h.96l-1.25 5h-.97L5.9 9.6 5.1 13h-1L3 8h.98z"/>
|
|
2164
2164
|
<path fill="currentColor" fill-rule="evenodd" d="M13 13h-1.02l-.33-1.11H9.9L9.64 13h-.97l1.26-5h1.54zm-2.49-3.77-.42 1.84h1.32l-.49-1.84z" clip-rule="evenodd"/>
|
|
2165
|
-
</symbol>`,
|
|
2165
|
+
</symbol>`,DG=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
|
|
2166
2166
|
<path fill="currentColor" d="M14.1 11.79 8.26 15v-2.5l3.64-1.94zm.4-.35V4.73l-2.14 1.2v4.3zm-12.6.35L7.74 15v-2.5L4.1 10.56zm-.4-.35V4.73l2.14 1.2v4.3zm.25-7.15 6-3.29v2.42L3.9 5.47l-.03.01zm12.5 0L8.25 1v2.42l3.85 2.05.03.01z" class="bg" opacity=".4"/>
|
|
2167
2167
|
<path fill="currentColor" d="m7.74 11.93-3.59-1.92v-3.8l3.6 2.02zm.52 0 3.59-1.92v-3.8l-3.6 2.02zM4.4 5.77 8 3.85l3.6 1.93L8 7.8z" class="fg"/>
|
|
2168
|
-
</symbol>`,
|
|
2168
|
+
</symbol>`,OG=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
|
|
2169
2169
|
<path fill="currentColor" d="M7.5 2A1.5 1.5 0 0 1 9 3.5v3A1.5 1.5 0 0 1 7.5 8h-2v2A1.5 1.5 0 0 0 7 11.5v-1A1.5 1.5 0 0 1 8.5 9h5a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 7 13.5v-1A2.5 2.5 0 0 1 4.5 10V8h-2A1.5 1.5 0 0 1 1 6.5v-3A1.5 1.5 0 0 1 2.5 2zm1 8a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5zm-6-7a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5z"/>
|
|
2170
|
-
</symbol>`,
|
|
2170
|
+
</symbol>`,kG=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
|
|
2171
2171
|
<path fill="currentColor" d="m14.73 1.5-7.29 8.82h4.17l-1.73 2.04H5.76L1.27 14.5l7.3-8.91H4.39l1.73-2.05h4.12z"/>
|
|
2172
2172
|
<path fill="currentColor" d="M5.21 3.54 3.56 5.6h-.55v4.73h.83L2.1 12.36H1V3.54zm9.79 0v8.82h-4.3l1.74-2.04h.55V5.68h-.83l1.74-2.14z"/>
|
|
2173
|
-
</symbol>`,
|
|
2173
|
+
</symbol>`,AG=[PW,zW,VW,HW,UW,WW,qW,JW,YW,ZW,QW,$W,eG,tG,nG,cG,uG,dG,_G,vG,xG,SG,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
|
|
2174
2174
|
<path fill="currentColor" d="M4.585 2a2 2 0 0 1 1.028.285l1.788 1.072a1 1 0 0 0 .514.143H12A2 2 0 0 1 13.935 5H0V4a2 2 0 0 1 2-2z" class="bg" opacity=".5"/>
|
|
2175
2175
|
<path fill="currentColor" fill-rule="evenodd" d="M14 12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-1.25h1v-1H0V6h14zM9.9 8.25c-.883 0-1.9.5-1.9.5H7v1h1v1s1.017.5 1.9.5c.884 0 1.6-.672 1.6-1.5s-.716-1.5-1.6-1.5M2 9.75v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1zm-5-1v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1z" class="fg" clip-rule="evenodd"/>
|
|
2176
|
-
</symbol>`],
|
|
2177
|
-
`)}\n</svg>`)}var
|
|
2176
|
+
</symbol>`],jG=[MW,NW,FW,IW,LW,RW,BW,GW,KW,XW,rG,iG,aG,oG,sG,lG,fG,pG,mG,hG,gG,yG,bG,CG,wG,TG,EG,DG,OG,kG];function MG(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
|
|
2177
|
+
`)}\n</svg>`)}var NG=MG(jW,AG),PG={minimal:jW,standard:NG,complete:MG(NG,jG)},FG={".babelrc":`babel`,".babelrc.json":`babel`,".bash_profile":`bash`,".bashrc":`bash`,".browserslistrc":`browserslist`,".dockerignore":`docker`,".eslintignore":`eslint`,".eslintrc":`eslint`,".eslintrc.cjs":`eslint`,".eslintrc.js":`eslint`,".eslintrc.json":`eslint`,".eslintrc.yaml":`eslint`,".eslintrc.yml":`eslint`,".gitattributes":`git`,".gitignore":`git`,".gitkeep":`git`,".gitmodules":`git`,".oxlintrc.json":`oxc`,".postcssrc":`postcss`,".postcssrc.json":`postcss`,".postcssrc.yaml":`postcss`,".postcssrc.yml":`postcss`,".prettierignore":`prettier`,".prettierrc":`prettier`,".prettierrc.cjs":`prettier`,".prettierrc.js":`prettier`,".prettierrc.json":`prettier`,".prettierrc.mjs":`prettier`,".prettierrc.toml":`prettier`,".prettierrc.yaml":`prettier`,".prettierrc.yml":`prettier`,".stylelintignore":`stylelint`,".stylelintrc":`stylelint`,".stylelintrc.cjs":`stylelint`,".stylelintrc.js":`stylelint`,".stylelintrc.json":`stylelint`,".stylelintrc.mjs":`stylelint`,".stylelintrc.yaml":`stylelint`,".stylelintrc.yml":`stylelint`,".terraform.lock.hcl":`terraform`,".zprofile":`bash`,".zshenv":`bash`,".zshrc":`bash`,"babel.config.cjs":`babel`,"babel.config.js":`babel`,"babel.config.json":`babel`,"babel.config.mjs":`babel`,"biome.json":`biome`,"biome.jsonc":`biome`,"bootstrap.bundle.js":`bootstrap`,"bootstrap.bundle.min.js":`bootstrap`,"bootstrap.css":`bootstrap`,"bootstrap.js":`bootstrap`,"bootstrap.min.css":`bootstrap`,"bootstrap.min.js":`bootstrap`,"bun.lock":`bun`,"bun.lockb":`bun`,"bunfig.toml":`bun`,"claude.md":`claude`,"compose.yaml":`docker`,"compose.yml":`docker`,"docker-compose.override.yml":`docker`,"docker-compose.yaml":`docker`,"docker-compose.yml":`docker`,dockerfile:`docker`,"eslint.config.cjs":`eslint`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,"eslint.config.mts":`eslint`,"eslint.config.ts":`eslint`,gemfile:`ruby`,"next.config.js":`nextjs`,"next.config.mjs":`nextjs`,"next.config.mts":`nextjs`,"next.config.ts":`nextjs`,"postcss.config.cjs":`postcss`,"postcss.config.js":`postcss`,"postcss.config.mjs":`postcss`,"postcss.config.ts":`postcss`,"prettier.config.cjs":`prettier`,"prettier.config.js":`prettier`,"prettier.config.mjs":`prettier`,rakefile:`ruby`,"readme.md":`markdown`,"stylelint.config.cjs":`stylelint`,"stylelint.config.js":`stylelint`,"stylelint.config.mjs":`stylelint`,"svgo.config.cjs":`svgo`,"svgo.config.js":`svgo`,"svgo.config.mjs":`svgo`,"svgo.config.ts":`svgo`,"tailwind.config.cjs":`tailwind`,"tailwind.config.js":`tailwind`,"tailwind.config.mjs":`tailwind`,"tailwind.config.ts":`tailwind`,"vite.config.js":`vite`,"vite.config.mjs":`vite`,"vite.config.mts":`vite`,"vite.config.ts":`vite`,"webpack.config.babel.js":`webpack`,"webpack.config.cjs":`webpack`,"webpack.config.js":`webpack`,"webpack.config.mjs":`webpack`,"webpack.config.ts":`webpack`},IG={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,c:`c`,cc:`cpp`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,cpp:`cpp`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,cxx:`cpp`,db:`database`,editorconfig:`text`,env:`text`,"env.development":`text`,"env.local":`text`,"env.production":`text`,eot:`font`,erb:`ruby`,fish:`bash`,gemspec:`ruby`,gif:`image`,go:`go`,gql:`graphql`,graphql:`graphql`,gz:`zip`,h:`c`,hh:`cpp`,hpp:`cpp`,htm:`html`,html:`html`,hxx:`cpp`,icns:`image`,ico:`image`,ini:`text`,inl:`cpp`,jar:`zip`,jpeg:`image`,jpg:`image`,js:`javascript`,json:`json`,json5:`json`,jsonc:`json`,jsonl:`json`,jsx:`javascript`,ksh:`bash`,less:`css`,LICENSE:`text`,log:`text`,markdown:`markdown`,mcp:`mcp`,md:`markdown`,mdx:`markdown`,"mdx.tsx":`markdown`,mjs:`javascript`,mm:`cpp`,mts:`typescript`,ods:`table`,otf:`font`,png:`image`,postcss:`css`,py:`python`,pyi:`python`,pyw:`python`,pyx:`python`,rake:`ruby`,rar:`zip`,rb:`ruby`,rs:`rust`,rst:`text`,rtf:`text`,sass:`css`,scss:`css`,sh:`bash`,sql:`database`,sqlite:`database`,sqlite3:`database`,styl:`css`,svelte:`svelte`,svg:`svg`,swift:`swift`,tar:`zip`,tf:`terraform`,tfstate:`terraform`,tfvars:`terraform`,tgz:`zip`,tif:`image`,tiff:`image`,ts:`typescript`,tsv:`table`,tsx:`typescript`,ttf:`font`,txt:`text`,vue:`vue`,war:`zip`,wasm:`wasm`,wast:`wasm`,wat:`wasm`,webp:`image`,woff:`font`,woff2:`font`,xhtml:`html`,xls:`table`,xlsx:`table`,xz:`zip`,yaml:`yml`,yml:`yml`,zig:`zig`,zip:`zip`,zsh:`bash`},LG={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},RG=new Set([`bash`,`c`,`cpp`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),zG=new Set([`complete`]);function BG(e){return PG[e===`none`?`minimal`:e]}function VG(e){return`file-tree-builtin-${e}`}function HG(e){return e!==`none`&&zG.has(e)}function UG(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=FG[t.toLowerCase()];if(i!=null&&(r||RG.has(i)))return i;for(let e of n){if(r){let t=LG[e];if(t!=null)return t}let t=IG[e];if(t!=null&&(r||RG.has(t)))return t}return`default`}function WG(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function GG(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(WG(e)?`none`:`complete`),colored:e.colored??!0}}var KG={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function qG(e,t){if(typeof e==`number`)return{itemHeight:t??KG.default.itemHeight,factor:e};let n=KG[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var JG=KG.default.itemHeight,YG=`@layer base, theme, unsafe;
|
|
2178
2178
|
|
|
2179
2179
|
@layer base {
|
|
2180
2180
|
:host {
|
|
@@ -3838,13 +3838,13 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
|
|
|
3838
3838
|
}
|
|
3839
3839
|
}
|
|
3840
3840
|
}
|
|
3841
|
-
`,
|
|
3841
|
+
`,XG=`@layer base, unsafe;`;function ZG(e){return`${XG}
|
|
3842
3842
|
@layer base {
|
|
3843
3843
|
${e}
|
|
3844
|
-
}`}function
|
|
3844
|
+
}`}function QG(e){return`${XG}
|
|
3845
3845
|
@layer unsafe {
|
|
3846
3846
|
${e}
|
|
3847
|
-
}`}var UG=new WeakMap;function WG(e){let t=UG.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(lW,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),UG.set(e,i),i}function GG(e,t){if(!e.isConnected)return;let n=WG(t);if(n==null)return;let r=t.querySelector(`style[${uW}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(uW,``),t.appendChild(i)),i.textContent=`:host { ${dW}: ${n}px; }`}var KG;function qG(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){KG??(KG=new CSSStyleSheet,KG.replaceSync(VG(zG)));let t=!1;try{e.adoptedStyleSheets=[KG],t=!0}catch{}if(t){e.querySelector(`style[${sW}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(sW,``),t.textContent=VG(zG),e.prepend(t)}}function JG(e,t){YG(e,t),qG(t),GG(e,t)}function YG(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});JG(this,e)}}if(customElements.define(oW,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(oW)))e instanceof HTMLElement&&JG(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var XG=5,ZG=1<<XG,QG=ZG*4;function $G(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function eK(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function tK(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function nK(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function rK(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function iK(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function aK(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,lK(e,t)}function oK(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=nK(e).get(t);if(i===void 0)return;let a=i>>XG;e.childVisibleChunkSums[a]+=r}function sK(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=uK(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=ZG}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function cK(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>XG;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<XG}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function lK(e,t){if(t.childIds.length<QG){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/ZG),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>XG]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function uK(e,t,n,r){let i=Math.min(t.childIds.length,n+ZG),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var dK=7,fK=3,pK=1<<fK,mK=4;function hK(e,t,n=0){return e<<mK|n<<fK|t}function gK(e){return e.depthAndFlags>>>mK}function _K(e){return(e.depthAndFlags&pK)>>fK}function vK(e){return(e.depthAndFlags&pK)!==0}function yK(e){return e.depthAndFlags&dK}function bK(e,t){return(yK(e)&t)!==0}function xK(e,t){e.depthAndFlags|=t}function SK(e,t){e.depthAndFlags=hK(t,yK(e),_K(e))}var CK=Symbol(`benchmarkInstrumentation`);function wK(e,t){return t==null||Object.defineProperty(e,CK,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function TK(e){return e==null?null:e[CK]??null}function Q(e,t,n){return e==null?n():e.measurePhase(t,n)}function EK(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function DK(e){return e>=48&&e<=57}function OK(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!DK(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&DK(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function kK(e){let t=e.toLowerCase();return{lowerValue:t,tokens:OK(t)}}function AK(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function jK(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=AK(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function MK(e,t,n){let r=jK(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function NK(e,t){return MK(e,t,kK)}function PK(e,t){return t===e.segments.length-1?e.isDirectory?1:0:1}function FK(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=PK(e,r);return a===PK(t,r)?NK(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function IK(e,t){return FK(e,t)}function LK(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=kK(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=PK(e,n);return o===PK(t,n)?MK(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function RK(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=kK(r);return e.sortKeyById[t]=i,i}function zK(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function BK(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function VK(e){let{hasTrailingSlash:t,segments:n}=BK(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function HK(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=BK(e);return{requiresDirectory:t,segments:n}}var UK=``;function WK(){let e=new Map;return e.set(UK,0),{idByValue:e,valueById:[UK],sortKeyById:[kK(UK)]}}function GK(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function KK(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var qK=Symbol(`pathStorePreparedInputKind`);function JK(e,t){return e[qK]=t,e}function YK(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function XK(e,t,n){return n===`default`?IK(e,t):n(YK(e),YK(t))}function ZK(){return{depthAndFlags:hK(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function QK(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function $K(e){return e.isDirectory?e.segments.length:e.segments.length-1}function eq(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function tq(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function nq(e,t={}){return cq(e,t).map(e=>e.path)}function rq(e,t={}){let n=cq(e,t);return JK({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function iq(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return JK({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function aq(e){let t=e,n=t.preparedPaths;if(t[qK]===`prepared`&&n!=null)return n;if(!eq(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function oq(e){let t=e;return t[qK]===`presorted`&&t.presortedPaths!=null||tq(t.presortedPaths)?t.presortedPaths:null}function sq(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function cq(e,t={}){let n=zK(t),r=TK(t);EK(r,`workload.inputFiles`,e.length);let i=Q(r,`store.preparePathEntries.parse`,()=>e.map(e=>VK(e)));return Q(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>XK(e,t,n.sort))),i}var lq=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[ZK()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=WK();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=TK(e),this.options=zK(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,$G())}appendPaths(e){return Q(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>VK(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,Q(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return Q(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null)if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:hK(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:hK(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:hK(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=VK(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null)if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:hK(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:hK(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=VK(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(Q(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||Q(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort===`default`?LK(this.lastPreparedPath,e,this.segmentSortKeyCache):XK(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=$K(e),i=n==null?0:$K(n),a=n==null?0:QK(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=GK(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:hK(gK(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),rK(i,s),s}createFileChildUnchecked(e,t){let n=GK(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:hK(gK(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),rK(r,a),a}getOrCreateDirectoryChild(e,t){let n=GK(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!vK(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:hK(gK(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),rK(r,a),this.directories.set(a,$G()),a}createDirectoryChild(e,t){let n=GK(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:hK(gK(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),rK(r,a),this.directories.set(a,$G()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!vK(n))throw Error(`Path is not a directory: "${t}"`);if(bK(n,1))throw Error(`Duplicate path: "${t}"`);xK(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,eK());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(vK(a)){let t=eK();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;vK(n)&&this.directories.set(t,$G());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),rK(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!vK(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return aK(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function uq(e,t=`closed`,n=null){let r=fq(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function dq(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function fq(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function pq(e,t){return bK(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:gK(t)<=e.defaultExpansion}function mq(e,t,n=e.snapshot.nodes[t]){return n==null||!vK(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:pq(e,n)}function hq(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!vK(r))return;let i=pq(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function gq(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function _q(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function vq(e,t){let n=gq(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function yq(e,t){let n=gq(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function bq(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function xq(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function Sq(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function Cq(e,t){e.directoryLoadInfoById.delete(t)}function wq(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function Tq(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Eq(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function Dq(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function Oq(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function kq(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Aq(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function jq(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function Mq(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Nq(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Pq(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Fq(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function Iq(e,t,n){return{...n,visibleCountDelta:qq(e)-t}}function Lq(e,t){let n=qq(e),r=dq();e.transactionStack.push(r);try{t()}catch(t){throw Bq(e,r,!1),t}Bq(e,r,!0,qq(e)-n)}function Rq(e,t){let n=e.instrumentation;if(n==null){zq(e,t);return}Q(n,`store.events.record`,()=>zq(e,t))}function zq(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){Gq(e,t);return}n.events.push(t),Wq(n,t)}function Bq(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?Uq(i,t):Q(n,`store.events.batch.merge`,()=>Uq(i,t));return}let a=Vq(t,r),o=e.instrumentation;if(o==null){Gq(e,a);return}Q(o,`store.events.batch.commit`,()=>Gq(e,a))}function Vq(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function Hq(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function Uq(e,t){for(let n of t.events)e.events.push(n);Hq(e,t)}function Wq(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function Gq(e,t){let n=e.instrumentation;if(n==null){Kq(e,t);return}Q(n,`store.events.emit`,()=>Kq(e,t))}function Kq(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function qq(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function Jq(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!vK(n)||bK(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!vK(a)?null:i}function Yq(e,t){let n=t;for(;;){let t=Jq(e,n);if(t==null)return n;n=t}}function Xq(e,t){let n=[t],r=t;for(;;){let t=Jq(e,r);if(t==null)return n;n.push(t),r=t}}function Zq(e,t){let n=t==null?e.snapshot.rootId:sJ(e,t);return n==null?[]:dJ(e,n)}function Qq(e,t){let n=VK(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=EJ(e,TJ(e,r)),{createdNodeIds:a,directoryId:o}=fJ(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=uJ(e,o);if(bK(n,1))throw Error(`Path already exists: "${t}"`);xK(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=mJ(e,o,n.basename),s.add(c);iJ(e,o);let l=EJ(e,o);return Tq({affectedAncestorIds:oJ(e,c),affectedNodeIds:[...s],path:t,projectionChanged:DJ(i,l)})}function $q(e,t,n){let r=sJ(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=uJ(e,r);if(bK(i,2))throw Error(`The root node cannot be removed`);if(vK(i)&&lJ(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=EJ(e,a),s=CJ(e,r);_J(e,a,r,i.nameId),wJ(e,a),iJ(e,a);let c=EJ(e,a);return Eq({affectedAncestorIds:oJ(e,a),affectedNodeIds:s,path:t,projectionChanged:DJ(o,c),recursive:n.recursive===!0})}function eJ(e,t,n,r){let i=sJ(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=uJ(e,i);if(bK(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=xJ(e,i,n),c=EJ(e,a.parentId),l=EJ(e,s.parentId),u=KK(e.snapshot.segmentTable,a.nameId),d=GK(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(vK(a)&&jJ(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=tK(e.snapshot.nodes,lJ(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&SJ(e,p,o,_K(a))===`skip`)return null;let m=a.parentId;_J(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),AJ(e,i),gJ(e,s.parentId,i),wJ(e,m),e.pathCacheVersion++,iJ(e,m),s.parentId!==m&&iJ(e,s.parentId);let h=EJ(e,m),g=EJ(e,s.parentId);return Dq({affectedAncestorIds:[...new Set([...oJ(e,m),...oJ(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:OJ([c,l],[h,g]),to:rJ(e,i)})}function tJ(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function nJ(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function rJ(e,t){let n=uJ(e,t),r=tJ(e,t);if(r!=null)return r;if(bK(n,2))return nJ(e,t,``);let i=rJ(e,n.parentId),a=KK(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return nJ(e,t,vK(n)?`${o}/`:o)}function iJ(e,t){let n=e.instrumentation;if(n==null){NJ(e,t);return}Q(n,`store.recomputeCountsUpwardFrom`,()=>NJ(e,t))}function aJ(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!vK(o)){MJ(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){MJ(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function oJ(e,t){let n=[],r=t;for(;r!=null;){let t=uJ(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function sJ(e,t){if(t.length===0)return e.snapshot.rootId;let n=HK(t);return cJ(e,n.segments,n.requiresDirectory)}function cJ(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=lJ(e,r),a=tK(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=uJ(e,r);return n&&!vK(i)?null:r}function lJ(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function uJ(e,t){let n=e.snapshot.nodes[t];if(n===void 0||bK(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function dJ(e,t){let n=e.snapshot.nodes[t];if(n===void 0||bK(n,4))return[];if(!vK(n))return[rJ(e,t)];if(lJ(e,t).childIds.length===0)return bK(n,1)&&!bK(n,2)?[rJ(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||bK(n,4)){i.pop();continue}if(!vK(n)){r.push(rJ(e,t.nodeId)),i.pop();continue}let a=lJ(e,t.nodeId);if(a.childIds.length===0){bK(n,1)&&!bK(n,2)&&r.push(rJ(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function fJ(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=GK(e.snapshot.segmentTable,i),a=lJ(e,r),o=tK(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!vK(uJ(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=pJ(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function pJ(e,t,n){let r=uJ(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:hK(gK(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,$G()),gJ(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function mJ(e,t,n){let r=GK(e.snapshot.segmentTable,n),i=lJ(e,t);if(tK(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${FJ(e,t,n)}"`);let a=uJ(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:hK(gK(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),gJ(e,t,o),e.activeNodeCount++,o}function hJ(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}vJ(e,n,o)<0?i=a:r=a+1}return r}function gJ(e,t,n){let r=lJ(e,t),i=uJ(e,n);tK(e.snapshot.nodes,r).set(i.nameId,n),oK(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=hJ(e,r,n);r.childIds.splice(a,0,n),iK(r,a),lK(e.snapshot.nodes,r)}function _J(e,t,n,r){let i=lJ(e,t),a=nK(i),o=a.get(n)??-1;tK(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&oK(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),iK(i,o),lK(e.snapshot.nodes,i))}function vJ(e,t,n){let r=e.snapshot.options.sort;return r===`default`?yJ(e,t,n):r(bJ(e,t),bJ(e,n))}function yJ(e,t,n){let r=uJ(e,t),i=uJ(e,n),a=vK(r);if(a!==vK(i))return a?-1:1;let o=jK(RK(e.snapshot.segmentTable,r.nameId),RK(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=KK(e.snapshot.segmentTable,r.nameId),c=KK(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function bJ(e,t){let n=uJ(e,t),r=rJ(e,t),i=vK(n),a=i?r.slice(0,-1):r;return{basename:KK(e.snapshot.segmentTable,n.nameId),depth:gK(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function xJ(e,t,n){let r=uJ(e,t),i=sJ(e,n);if(i!=null){let t=uJ(e,i);if(vK(t))return{basename:KK(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=HK(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=HK(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:cJ(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function SJ(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${rJ(e,t)}"`);let i=uJ(e,t);if(_K(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(vK(i)&&lJ(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return CJ(e,t),_J(e,a,t,o),wJ(e,a),iJ(e,a),`handled`}function CJ(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=uJ(e,t.nodeId);if(t.visitedChildren||!vK(i)){vK(i)&&e.snapshot.directories.delete(t.nodeId),xK(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),Cq(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=lJ(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function wJ(e,t){let n=t;for(;n!=null;){let t=uJ(e,n);if(!vK(t)||bK(t,2)||lJ(e,n).childIds.length>0)return;xK(t,1),n=t.parentId===n?null:t.parentId}}function TJ(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=tK(e.snapshot.nodes,lJ(e,n)).get(t);if(i==null||!vK(uJ(e,i)))break;n=i}return n}function EJ(e,t){let n=kJ(e,t);if(n==null)return null;let r=Yq(e,n),i=uJ(e,r),a=n===r?null:Xq(e,n).map(t=>rJ(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:lJ(e,r).childIds.length>0,path:rJ(e,r),terminalKind:_K(i)})}function DJ(e,t){return OJ([e],[t])}function OJ(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function kJ(e,t){let n=t;for(;n!=null;){let t=uJ(e,n);if(!vK(t)||bK(t,2))return null;if(!mq(e,n,t))return n;n=t.parentId}return null}function AJ(e,t){let n=uJ(e,t);if(SK(n,(t===e.snapshot.rootId?-1:gK(uJ(e,n.parentId)))+1),!vK(n))return;let r=lJ(e,t);for(let t of r.childIds)AJ(e,t)}function jJ(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=uJ(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function MJ(e,t,n=uJ(e,t),r=!1){let i=e.instrumentation;if(i==null){PJ(e,t,n,r);return}Q(i,`store.recomputeNodeCounts`,()=>PJ(e,t,n,r))}function NJ(e,t){let n=t;for(;n!=null;){let t=uJ(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(MJ(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&oK(lJ(e,s),n,a,o),n=s}}function PJ(e,t,n,r){if(!vK(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=lJ(e,t);if(r){let t=e.instrumentation;t==null?aK(e.snapshot.nodes,i):Q(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>aK(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,bK(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=Jq(e,t)==null?mq(e,t,n)?1+o:1:o}function FJ(e,t,n){let r=rJ(e,t);return r.length===0?n:`${r}${n}`}function IJ(e){return e!=null&&!bK(e,4)}function LJ(e,t){let n=e.snapshot.nodes[t];return!IJ(n)||!vK(n)||bK(n,2)?null:n}function RJ(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&IJ(e.snapshot.nodes[n])&&(t+=1);return t}function zJ(e){return Math.max(0,e.valueById.length-1)}function BJ(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:RJ(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:zJ(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function VJ(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function HJ(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)LJ(e,n)!=null&&t.push(rJ(e,n));for(let t of e.expandedDirectoryIds)LJ(e,t)!=null&&n.push(rJ(e,t));return{collapsedPaths:t,expandedPaths:n}}function UJ(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)LJ(e,n)==null||_q(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:rJ(e,n)});return t}function WJ(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=sJ(e,n);t!=null&&hq(e,t,!0,uJ(e,t))}for(let n of t.collapsedPaths){let t=sJ(e,n);t!=null&&hq(e,t,!1,uJ(e,t))}}function GJ(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=sJ(e,n.path);t!=null&&LJ(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function KJ(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function qJ(e){let t=e.snapshot.segmentTable,n=WK();for(let r of e.snapshot.nodes)if(IJ(r)){if(bK(r,2)){r.nameId=0;continue}r.nameId=GK(n,KK(t,r.nameId))}e.snapshot.segmentTable=n}function JJ(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!IJ(r)||!vK(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return IJ(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[uJ(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),aK(e.snapshot.nodes,n)}}function YJ(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(IJ(n))break;--t}e.snapshot.nodes.length=t+1}function XJ(e){let t=HJ(e),n=UJ(e);Q(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>KJ(e)),Q(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>qJ(e)),Q(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>JJ(e)),Q(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>YJ(e)),Q(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>WJ(e,t)),Q(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>GJ(e,n)),Q(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>aJ(e,e.snapshot.rootId))}function ZJ(e){let t=HJ(e),n=UJ(e),r=Q(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>Zq(e)),i=wK({...e.snapshot.options},e.instrumentation),a=Q(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new lq(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,Q(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>WJ(e,t)),Q(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>GJ(e,n)),Q(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>aJ(e,e.snapshot.rootId))}function QJ(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function $J(e,t){let n=BJ(e);t===`stable`?Q(e.instrumentation,`store.cleanup.stable`,()=>XJ(e)):Q(e.instrumentation,`store.cleanup.aggressive`,()=>ZJ(e));let r=BJ(e);return VJ(t,t===`stable`,n,r)}var eY=64;function tY(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function nY(e){return uJ(e,e.snapshot.rootId).visibleSubtreeCount}function rY(e,t,n,r){let i=uJ(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function iY(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:CY(e,t.cursor),setSize:t.setSize,subtreeEndIndex:rY(e,t.cursor,t.index,n)}}function aY(e,t,n,r,i,a){let o=lJ(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=sK(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return oY(e,u,l,r+c,i+1,s,o.childIds.length,a)}function oY(e,t,n,r,i,a,o,s){if(!vK(uJ(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=_Y(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=uJ(e,c.terminalNodeId);if(!vK(l)||!mq(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return aY(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function sY(e,t){let n=nY(e);if(t<0||t>=n)return null;let r=aY(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>rJ(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=iY(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:CY(e,r.cursor),setSize:r.setSize,subtreeEndIndex:rY(e,r.cursor,r.index,n)}}function cY(e,t,n){let r=e.instrumentation,i=nY(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return SY(e,o+1);let t=[],n=mY(e,a);for(let r=a;r<=o&&n!=null;r++){let r=CY(e,n);t.push(r),n=yY(e,n)}return t}let s=[],c=0,l=0,u=Q(r,`store.getVisibleSlice.selectFirstRow`,()=>mY(e,a));for(let t=a;t<=o&&u!=null;t++){let t=Q(r,`store.getVisibleSlice.materializeRow`,()=>CY(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=Q(r,`store.getVisibleSlice.advanceCursor`,()=>yY(e,u))}return EK(r,`workload.visibleRowsRead`,s.length),EK(r,`workload.flattenedRowsRead`,c),EK(r,`workload.flattenedSegmentsRead`,l),s}function lY(e,t=nY(e)){let n=e.instrumentation;return n==null?xY(e,t):Q(n,`store.getVisibleTreeProjection`,()=>xY(e,t))}function uY(e){return bY(lY(e))}function dY(e,t){let n=sJ(e,t);if(n==null||n===e.snapshot.rootId||vK(uJ(e,n))&&Yq(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=uJ(e,i).parentId,n=lJ(e,t),s=nK(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=cK(a,n,s),t!==o){let n=uJ(e,t),a=Jq(e,t);if(!mq(e,t,n)&&a!==i)return null;Yq(e,t)===t&&(r+=1)}i=t}return r}function fY(e,t){let n=sJ(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=uJ(e,n);if(!vK(r))throw Error(`Path is not a directory: "${t}"`);return mq(e,n,r)?null:(hq(e,n,!0,r),iJ(e,n),Oq({affectedAncestorIds:oJ(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function pY(e,t){let n=sJ(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=uJ(e,n);if(!vK(r))throw Error(`Path is not a directory: "${t}"`);return mq(e,n,r)?(hq(e,n,!1,r),iJ(e,n),kq({affectedAncestorIds:oJ(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function mY(e,t){return t<0||t>=nY(e)?null:hY(e,e.snapshot.rootId,t,-1)}function hY(e,t,n,r){let i=lJ(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?sK(e.snapshot.nodes,i,n):Q(a,`store.getVisibleSlice.selectChildIndex`,()=>sK(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return gY(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function gY(e,t,n,r){if(!vK(uJ(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=_Y(e,t,r);if(n===0)return i;let a=uJ(e,i.terminalNodeId);if(!vK(a)||!mq(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return hY(e,i.terminalNodeId,n-1,i.visibleDepth)}function _Y(e,t,n){return vK(uJ(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:Yq(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:Q(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>Yq(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function vY(e,t){let n=uJ(e,t);if(!vK(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:Jq(e,r)!==t}function yY(e,t){let n=uJ(e,t.terminalNodeId);if(vK(n)){let r=lJ(e,t.terminalNodeId);if(mq(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:gY(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=uJ(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=lJ(e,n),o=nK(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return gY(e,s,0,i);vY(e,r)&&i--,r=n}}function bY(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function xY(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(eY);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=tY(o,y);let x,S=_;if(vK(v))S=f?Yq(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:rJ(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&vK(C)&&mq(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function SY(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!vK(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:rJ(e,f)};continue}let h=l?Yq(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=CY(e,g);let _=i[h];_!=null&&vK(_)&&mq(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function CY(e,t){let n=uJ(e,t.terminalNodeId),r=vK(n)?wY(e,t):null,i=rJ(e,t.terminalNodeId),a=KK(e.snapshot.segmentTable,n.nameId),o=vK(n)&&lJ(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?Xq(e,t.headNodeId).map(n=>{let r=uJ(e,n);return{isTerminal:n===t.terminalNodeId,name:KK(e.snapshot.segmentTable,r.nameId),nodeId:n,path:rJ(e,n)}}):Q(c,`store.getVisibleSlice.flatten.collectSegments`,()=>Xq(e,t.headNodeId).map(n=>{let r=uJ(e,n);return{isTerminal:n===t.terminalNodeId,name:KK(e.snapshot.segmentTable,r.nameId),nodeId:n,path:rJ(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:vK(n)&&mq(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:vK(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function wY(e,t){if(t.headNodeId===t.terminalNodeId)return _q(e,t.terminalNodeId);let n=Xq(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=_q(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function TY(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!vK(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&lK(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&vK(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,lK(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function EY(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var DY=class e{#e;constructor(e={}){let t=TK(e),n=Q(t,`store.builder.create`,()=>new lq(e));if(e.preparedInput!=null){let t=oq(e.preparedInput);t==null?n.appendPreparedPaths(aq(e.preparedInput),!1):n.appendPresortedPaths(t,sq(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(Q(t,`store.preparePathEntries`,()=>cq(r,e)))}let r=Q(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=Q(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=Q(t,`store.state.create`,()=>uq(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:Q(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||EY(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&Q(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?Q(t,`store.state.initializeOpenVisibleCounts`,()=>TY(this.#e)):Q(t,`store.state.recomputeCounts`,()=>aJ(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return nq(e,t)}static prepareInput(e,t={}){return rq(e,t)}static preparePresortedInput(e){return iq(e)}list(e){return Q(this.#e.instrumentation,`store.list`,()=>Zq(this.#e,e))}add(e){Q(this.#e.instrumentation,`store.add`,()=>{let t=nY(this.#e);Rq(this.#e,Iq(this.#e,t,Qq(this.#e,e)))})}remove(e,t={}){Q(this.#e.instrumentation,`store.remove`,()=>{let n=nY(this.#e);Rq(this.#e,Iq(this.#e,n,$q(this.#e,e,t)))})}move(e,t,n={}){Q(this.#e.instrumentation,`store.move`,()=>{let r=nY(this.#e),i=eJ(this.#e,e,t,n);i!=null&&Rq(this.#e,Iq(this.#e,r,i))})}batch(e){Lq(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return Q(this.#e.instrumentation,`store.getVisibleCount`,()=>nY(this.#e))}getVisibleSlice(e,t){return Q(this.#e.instrumentation,`store.getVisibleSlice`,()=>cY(this.#e,e,t))}getVisibleRowContext(e){return Q(this.#e.instrumentation,`store.getVisibleRowContext`,()=>sY(this.#e,e))}getVisibleTreeProjection(){return uY(this.#e)}getVisibleTreeProjectionData(e){return lY(this.#e,e)}getVisibleIndex(e){return Q(this.#e.instrumentation,`store.getVisibleIndex`,()=>dY(this.#e,e))}getPathInfo(e){return Q(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=sJ(this.#e,e);if(t==null)return null;let n=uJ(this.#e,t);return{depth:gK(n),kind:vK(n)?`directory`:`file`,path:rJ(this.#e,t)}})}isExpanded(e){return Q(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=uJ(this.#e,t);return mq(this.#e,t,n)})}expand(e){Q(this.#e.instrumentation,`store.expand`,()=>{let t=nY(this.#e),n=fY(this.#e,e);n!=null&&Rq(this.#e,Iq(this.#e,t,n))})}collapse(e){Q(this.#e.instrumentation,`store.collapse`,()=>{let t=nY(this.#e),n=pY(this.#e,e);n!=null&&Rq(this.#e,Iq(this.#e,t,n))})}on(e,t){return wq(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return _q(this.#e,t)}markDirectoryUnloaded(e){Q(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(lJ(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=nY(this.#e);yq(this.#e,t),Rq(this.#e,Iq(this.#e,n,Aq({affectedAncestorIds:oJ(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return Q(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=nY(this.#e),r=vq(this.#e,t);return Rq(this.#e,Iq(this.#e,n,jq({affectedAncestorIds:oJ(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return Q(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||_q(this.#e,n)!==`loading`||!xq(this.#e,n,e.attemptId))return!1;let r=rJ(this.#e,n);this.validateChildPatch(r,t);let i=nY(this.#e),a=[];for(let e of t.operations){OY(r,e);let t=nY(this.#e);switch(e.type){case`add`:a.push(Iq(this.#e,t,Qq(this.#e,e.path)));break;case`remove`:a.push(Iq(this.#e,t,$q(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=eJ(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(Iq(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return Rq(this.#e,Iq(this.#e,i,Mq({affectedAncestorIds:oJ(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:rJ(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return Q(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=nY(this.#e),r=bq(this.#e,t,e.attemptId);return Rq(this.#e,Iq(this.#e,n,Nq({affectedAncestorIds:oJ(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:rJ(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return Q(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=nY(this.#e),i=Sq(this.#e,n,e.attemptId,t);return Rq(this.#e,Iq(this.#e,r,Pq({affectedAncestorIds:oJ(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:rJ(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return Q(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(QJ(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=nY(this.#e),n=$J(this.#e,e.mode??`stable`);return Rq(this.#e,Iq(this.#e,t,Fq({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=lJ(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??kK(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=jK(RK(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!vK(uJ(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=uJ(this.#e,n);mq(this.#e,n,i)||(hq(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=uJ(this.#e,e);if(!mq(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=sJ(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!vK(uJ(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!vK(uJ(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=uJ(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=uJ(this.#e,e),r=Jq(this.#e,e);if(!mq(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function OY(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`);break}}var kY=e=>e.startsWith(`f::`)?e.slice(3):e;function AY(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function jY(e,t){return e===``?t:`${e}/${t}`}function MY({files:e,path:t,isFolder:n,nextBasename:r}){let i=kY(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=AY(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=jY(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function NY(e){return e.endsWith(`/`)}function PY(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function FY(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function IY(e,t){return t.includes(e)?FY(t):[e]}function LY(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function RY(e,t){return{draggedPaths:e,target:t}}function zY(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(NY(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function BY(e,t){return t.kind===`root`||t.directoryPath==null?PY(e):t.directoryPath}function VY(e,t){let n=e.map(e=>{let n=BY(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function HY(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function UY(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!HY(DY.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function WY(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function GY(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function KY(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function qY(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return KY(e,t.path)?n?e:null:e;case`move`:return GY(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=qY(r,e,n),r==null)return null;return r}}}function JY(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function YY(e){switch(e.operation){case`add`:return{...JY(e),operation:`add`,path:e.path};case`remove`:return{...JY(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...JY(e),from:e.from,operation:`move`,to:e.to}}}function XY(e){return{...JY(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>YY(e)),operation:`batch`}}function ZY(e){switch(e.operation){case`add`:case`remove`:case`move`:return YY(e);case`batch`:return XY(e);default:return null}}function QY(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function $Y(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function eX(e){return $Y(e).at(-1)??null}function tX(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function nX(e){return e.endsWith(`/`)}var rX=e=>e.toLowerCase();function iX(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function aX(e){return e.endsWith(`/`)?e.slice(0,-1):e}function oX(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var sX=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},cX=Symbol(`FILE_TREE_RENAME_VIEW`),lX=512,uX=512;function dX(e){return e===`top`||e===`center`?e:`nearest`}function fX(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=$Y(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function pX(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:fX(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var mX=class{#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=UY({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=eX(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:dX(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=uX){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t==null||!this.#B.has(t)||this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=IY(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=RY(t.draggedPaths,n);(zY(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}LY(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=RY(e.draggedPaths,t);if(zY(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=VY(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=nX(r),a=aX(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of $Y(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=iX(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}[cX](){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,nX(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,nX(e)?{recursive:!0}:void 0);return}let t=nX(e),n=MY({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:aX(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(oX(n.sourcePath,t),oX(n.destinationPath,t))}#Y(e){this.#T==null||this.#E===e||(this.#E=e,this.#De())}resetPaths(e,t={}){let n=this.#H.list().length,r=this.#G,i=UY({paths:e,preparedInput:t.preparedInput},`resetPaths`,this.#e.sort),a=this.#le(i.paths,i.preparedInput,t.initialExpandedPaths),o=this.#c,s=this.#T,c=this.getSelectedPaths(),l=this.#z;this.#K?.(),this.#H=a,this.#d.clear(),this.#he();let u=c.map(e=>a.getPathInfo(e)?.path??null).filter(e=>e!=null),d=!QY(this.#B,u);this.#B=new Set(u),d&&(this.#V+=1),this.#z=l==null?null:a.getPathInfo(l)?.path??null,this.#T=s==null?null:a.getPathInfo(s)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(o,o!=null||u.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:i.paths.length,pathCountBefore:n,projectionChanged:!0,usedPreparedInput:t.preparedInput!=null,visibleCountDelta:this.#G-r})}#X(e){this.#Ie();let t=eX(e),n=tX(e,t),r=null,i=null;for(let e of this.#be()){if(eX(e)!==t)continue;let a=tX(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=$Y(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!QY(this.#B,r),a=this.#z!==t;!i&&!a||(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new DY({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of $Y(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(rX),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(rX),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of $Y(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:sX(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of $Y(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of $Y(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=pX(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,lX)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s===e&&this.#c===n||(this.#s=e,this.#c=n,t&&this.#De()))}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=qY(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=qY(this.#c,e,!0),r=[...this.#B].map(t=>qY(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=qY(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return QY(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&WY(e)&&(this.#i=null);let t=WY(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=ZY(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},hX=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function gX(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(!(e[t]===`/`||t===e.length)){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function _X(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function vX(e,t){return t?`${e}/`:e}function yX(e,t=null){let n=hX(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set;for(let t of e??[]){let e=gX(t.path);if(e==null)continue;let n=vX(e.path,e.isDirectory);r.set(n,t.status),t.status===`ignored`&&e.isDirectory?a.add(n):e.isDirectory&&a.delete(n);for(let t of _X(e.path))i.add(t)}return{directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}var bX=e=>e.trim().toLowerCase(),xX=e=>e.split(`/`).at(-1)??e,SX=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function CX(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function wX(e){let t=FG(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(bX(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let n=xX(o),s=n.toLowerCase(),c=r.get(s);if(c!=null)return CX(c,e);for(let[t,n]of a)if(s.includes(t))return CX(n,e);let l=SX(n);for(let t of l){let n=i.get(t);if(n!=null)return CX(n,e)}let u=NG(t.set,n,l);if(u!=null&&t.set!==`none`)return{name:jG(u),remappedFrom:e,token:u}}let s=n?.[e];return s==null?{name:e}:CX(s,e)}}}var TX,EX,DX,OX,kX,AX,jX,MX,NX,PX,FX={},IX=[],LX=Array.isArray,RX=IX.slice,zX=Object.assign;function BX(e){e&&e.parentNode&&e.remove()}function VX(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?RX.call(arguments,2):n),HX(e,o,r,i,null)}function HX(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++EX,__i:-1,__u:0};return i==null&&TX.vnode!=null&&TX.vnode(a),a}function UX(e){return e.children}function WX(e,t){this.props=e,this.context=t,this.__g=0}function GX(e,t){if(t==null)return e.__?GX(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?GX(e):null}function KX(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return KX(e)}}function qX(e){(8&e.__g||!(e.__g|=8)||!DX.push(e)||kX++)&&OX==TX.debounceRendering||((OX=TX.debounceRendering)||queueMicrotask)(JX)}function JX(){for(var e,t,n,r,i,a,o,s,c=1;DX.length;)DX.length>c&&DX.sort(AX),e=DX.shift(),c=DX.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=zX({},r)).__v=r.__v+1,TX.vnode&&TX.vnode(n),nZ(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??GX(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,iZ(a,n,o),n.__e!=i&&KX(n)));kX=0}function YX(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||IX,b=t.length;for(c=XX(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?FX:y[m.__i]||FX,m.__i=f,_=nZ(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&sZ(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=ZX(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function XX(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?HX(null,o,null,null,null):LX(o)?HX(UX,{children:o},null,null,null):o.constructor==null&&o.__b>0?HX(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=QX(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=GX(s)),cZ(s,s));return r}function ZX(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=ZX(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=GX(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function QX(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>(u?1:0)){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function $X(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function eZ(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||$X(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||$X(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(jX,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=MX,e.addEventListener(t,a?PX:NX,a)):e.removeEventListener(t,a?PX:NX,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function tZ(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=MX++;else if(t.u<n.l)return;return n(TX.event?TX.event(t):t)}}}function nZ(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=TX.__b)&&d(t);n:if(typeof M==`function`)try{if(v=t.props,y=`prototype`in M&&M.prototype.render,b=(d=M.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new M(v,x):(t.__c=f=new WX(v,x),f.constructor=M,f.render=lZ),b&&b.sub(f),f.props=v,f.state||={},f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=zX({},f.__s)),zX(f.__s,M.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&M.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=TX.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=zX({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===UX&&d.key==null&&(E=aZ(d.props.children)),s=YX(e,LX(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(D=0,O=!1,t.__u|=c?160:128,t.__c.__z=[],k=0;k<a.length;k++)(A=a[k])==null||O||(A.nodeType==8&&A.data==`$s`?(D>0&&t.__c.__z.push(A),D++,a[k]=null):A.nodeType==8&&A.data==`/$s`?(--D>0&&t.__c.__z.push(A),O=D===0,s=a[k],a[k]=null):D>0&&(t.__c.__z.push(A),a[k]=null));if(!O){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(j=a.length;j--;)BX(a[j]);rZ(t)}else t.__e=n.__e,t.__k=n.__k,e.then||rZ(t);TX.__e(e,t,n)}else s=t.__e=oZ(n.__e,t,n,r,i,a,o,c,l,u);return(d=TX.diffed)&&d(t),128&t.__u?void 0:s}function rZ(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(rZ)}function iZ(e,t,n){for(var r=0;r<n.length;r++)sZ(n[r],n[++r],n[++r]);TX.__c&&TX.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){TX.__e(e,t.__v)}})}function aZ(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:LX(e)?e.map(aZ):zX({},e)}function oZ(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(TX.__m&&TX.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=RX.call(e.childNodes),v=n.props||FX,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;eZ(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||eZ(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),YX(b==`template`?e.content:e,LX(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&GX(n,0),s,c,l),a!=null)for(u=a.length;u--;)BX(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||eZ(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&eZ(e,u,g,v[u],i))}return e}function sZ(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){TX.__e(e,n)}}function cZ(e,t,n){var r,i;if(TX.unmount&&TX.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||sZ(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){TX.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&cZ(r[i],t,n||typeof e.type!=`function`);n||BX(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function lZ(e,t,n){return this.constructor(e,n)}function uZ(e,t){var n,r,i,a;t==document&&(t=document.documentElement),TX.__&&TX.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=VX(UX,null,[e]),i=[],a=[],nZ(t,e,r||FX,FX,t.namespaceURI,r?null:t.firstChild?RX.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),iZ(i,e,a)}function dZ(e,t){e.__u|=32,uZ(e,t)}TX={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw kX=0,e}},EX=0,WX.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=zX({},this.state);typeof e==`function`&&(e=e(zX({},n),this.props)),e&&zX(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),qX(this))},WX.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),qX(this))},WX.prototype.render=UX,DX=[],kX=0,AX=function(e,t){return e.__v.__b-t.__v.__b},jX=/(PointerCapture)$|Capture$/i,MX=0,NX=tZ(!1),PX=tZ(!0);var fZ=0;Array.isArray;function $(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--fZ,__i:-1,__u:0,__source:i,__self:a};return TX.vnode&&TX.vnode(l),l}var pZ=16,mZ=16,hZ={};function gZ({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=hZ[e]??{width:pZ,height:mZ},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`,h=o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`};return $(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...h,viewBox:m,width:f,height:p,children:$(`use`,{href:c})})}var _Z=e=>{if(e.length<2)return[e,``];let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]},vZ=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},yZ=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},bZ=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},xZ=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},SZ=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function CZ({children:e,marker:t,variant:n=`default`}){"use no memo";let r=n===`fade`;return $(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:$(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):r?$(`span`,{"data-truncate-fade":!0}):t})})}function wZ(e){"use no memo";let{mode:t,children:n}=e;return $(`div`,{children:[$(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?$(`span`,{children:n}):n}),$(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?$(`span`,{children:n}):n})]})}function TZ({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=$(wZ,{mode:t,children:e},`content`),o=$(CZ,{marker:n,mode:t,variant:r},`marker`),s=$(`div`,{"data-truncate-fill":!0},`fill`);return $(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:$(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function EZ({children:e,...t}){"use no memo";return $(TZ,{mode:`truncate`,...t,children:e})}function DZ({children:e,...t}){"use no memo";return $(TZ,{mode:`fruncate`,...t,children:e})}function OZ({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=$(EZ,{...s,children:t[0]}),l=$(DZ,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return $(`div`,{className:a,style:o});if(e.length<i)return $(n===`end`?DZ:EZ,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=_Z:r===`extension`?t=vZ:r===`leaf-path`&&(t=yZ);else if(typeof r==`number`)t=bZ,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=xZ:e===`first`&&(t=SZ)}else typeof r==`function`&&(t=r);t??=_Z;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=$(EZ,{...s,..._,children:f}),l=$(DZ,{...s,...v,children:p})}return $(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[$(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),$(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var kZ={endIndex:-1,startIndex:-1};function AZ(e,t,n){return Math.min(Math.max(e,t),n)}function jZ(e,t){return e<0||t<e?kZ:{endIndex:t,startIndex:e}}function MZ(e){return e.startIndex<0||e.endIndex<e.startIndex}function NZ(e,t){return MZ(e)?0:(e.endIndex-e.startIndex+1)*t}function PZ(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function FZ(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function IZ(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function LZ(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function RZ(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function zZ(e,t,n){if(e.length===0||t<=0)return[];let r=RZ(e),i=IZ(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=LZ(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function BZ(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=AZ(t.scrollTop,0,o),c=t.stickyRows??zZ(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=PZ(s,n,t.itemHeight),m=PZ(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?kZ:jZ(m,FZ(u+d,n,t.itemHeight)),y=g+1,b=MZ(v)?kZ:jZ(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=NZ(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:MZ(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var VZ={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},HZ={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},UZ=`Contains git status items`;function WZ(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function GZ(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return WZ({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function KZ(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function qZ(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function JZ(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function YZ(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function XZ(e,t){return e!=null&&e>0?e:t}function ZZ(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function QZ(e,t,n,r,i=0){let a=WZ({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function $Z(e,t,n,r,i,a,o=0){let s=GZ({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s==null?!1:(e.scrollTop=s,!0)}function eQ(e,t,n,r,i,a){let o=KZ({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function tQ(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function nQ(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function rQ({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return $(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function iQ(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function aQ(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var oQ,sQ,cQ,lQ,uQ=Object.is,dQ=0,fQ=[],pQ=TX,mQ=pQ.__b,hQ=pQ.__r,gQ=pQ.diffed,_Q=pQ.__c,vQ=pQ.unmount,yQ=pQ.__;function bQ(e,t){pQ.__h&&pQ.__h(sQ,e,dQ||t),dQ=0;var n=sQ.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function xQ(e){return dQ=1,SQ(PQ,e)}function SQ(e,t,n){var r=bQ(oQ++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):PQ(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);uQ(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=sQ,!sQ.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,uQ(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};sQ.__f=!0;var a=sQ.shouldComponentUpdate,o=sQ.componentWillUpdate;sQ.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},sQ.shouldComponentUpdate=i}return r.__N||r.__}function CQ(e,t){var n=bQ(oQ++,3);!pQ.__s&&NQ(n.__H,t)&&(n.__=e,n.u=t,sQ.__H.__h.push(n))}function wQ(e,t){var n=bQ(oQ++,4);!pQ.__s&&NQ(n.__H,t)&&(n.__=e,n.u=t,sQ.__h.push(n))}function TQ(e){return dQ=5,EQ(function(){return{current:e}},[])}function EQ(e,t){var n=bQ(oQ++,7);return NQ(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function DQ(e,t){return dQ=8,EQ(function(){return e},t)}function OQ(){for(var e;e=fQ.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(jQ),e.__H.__h.forEach(MQ),e.__H.__h=[]}catch(t){e.__H.__h=[],pQ.__e(t,e.__v)}}pQ.__b=function(e){sQ=null,mQ&&mQ(e)},pQ.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),yQ&&yQ(e,t)},pQ.__r=function(e){hQ&&hQ(e),oQ=0;var t=(sQ=e.__c).__H;t&&(cQ===sQ?(t.__h=[],sQ.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(jQ),t.__h.forEach(MQ),t.__h=[],oQ=0)),cQ=sQ},pQ.diffed=function(e){gQ&&gQ(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(fQ.push(t)!==1&&lQ===pQ.requestAnimationFrame||((lQ=pQ.requestAnimationFrame)||AQ)(OQ)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),cQ=sQ=null},pQ.__c=function(e,t){t.some(function(e){try{e.__h.forEach(jQ),e.__h=e.__h.filter(function(e){return!e.__||MQ(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],pQ.__e(n,e.__v)}}),_Q&&_Q(e,t)},pQ.unmount=function(e){vQ&&vQ(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{jQ(e)}catch(e){t=e}}),n.__H=void 0,t&&pQ.__e(t,n.__v))};var kQ=typeof requestAnimationFrame==`function`;function AQ(e){var t,n=function(){clearTimeout(r),kQ&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);kQ&&(t=requestAnimationFrame(n))}function jQ(e){var t=sQ,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),sQ=t}function MQ(e){var t=sQ;e.__c=e.__(),sQ=t}function NQ(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!uQ(t,e[n])})}function PQ(e,t){return typeof t==`function`?t(e):t}function FQ(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:$(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return $(UX,{children:[$(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:$(EZ,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function IQ(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function LQ(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function RQ(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function zQ({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=BZ(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:RQ(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?RQ(u,1,t,o):i&&r<=0&&c.length>0?zZ(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var BQ=400,VQ=10,HQ=40,UQ=18;function WQ(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?GQ(e,t,n):a instanceof HTMLElement?a:null}function GQ(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function KQ(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function qQ(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function JQ(){return navigator.vendor!==`Apple Computer, Inc.`}function YQ(e,t){let n=e-t.top;if(n<HQ)return-Math.ceil((HQ-Math.max(0,n))/HQ*UQ);let r=t.bottom-e;return r<HQ?Math.ceil((HQ-Math.max(0,r))/HQ*UQ):0}function XQ(e,t){if(e!=null){let t=VZ[e];return t==null?null:{text:t,title:HZ[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:UZ}:null}function ZQ(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function QQ(e){return e!=null&&`toggle`in e}function $Q(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function e$(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function t$(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function n$(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function r$(e,t){return t&&n$(e)||(e.ctrlKey||e.metaKey)&&$Q(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var i$=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function a$(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function o$(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function s$(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function c$(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function l$(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function u$(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function d$(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function f$(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function p$(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=f$(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function m$(e,t){return{kind:e.kind,name:LQ(e),path:t}}function h$(e){return e==null?void 0:`${e}__tree`}function g$(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function _$(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function v$(e,t){if(e==null)return null;if(`text`in e)return $(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?_$(e.icon)?t(e.icon):{name:e.icon}:_$(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return $(`span`,{title:e.title,children:$(gZ,{...n})})}function y$(e){e!=null&&qZ(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function b$(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=IQ(e);return $(UX,{children:[e.depth>0?$(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>$(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,$(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?$(gZ,{...t(`file-tree-icon-chevron`)}):$(gZ,{...t(`file-tree-icon-file`,u)})}),$(`div`,{"data-item-section":`content`,children:e.isFlattened?FQ(e,c,a):c??$(OZ,{minimumLength:5,split:`extension`,children:e.name})}),i?$(`div`,{"data-item-section":`decoration`,children:r==null?null:v$(r,t)}):null,s?$(`div`,{"data-item-section":`git`,children:v$(o,t)}):null,n?$(`div`,{"data-item-section":`action`,children:l?$(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:$(gZ,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function x$(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:w,contextMenuButtonVisibility:T,contextMenuRightClickEnabled:E,registerRenameInput:D,registerButton:O,resolveIcon:k,renderDecorationForRow:A,openContextMenuForRow:j,onRowClick:M,onKeyDown:N}=e,P=IQ(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,R=I===`sticky`,z=_?.get(P)??null??ZQ(t.ancestorPaths,v,y),ee=t.kind===`directory`&&(b?.has(P)??!1),te=A(t,P),B=XQ(z,ee),V=S&&w,H=te!=null||x||V,ne=V&&T===`always`,re=a.getPath()===P,ie=re?a.getValue():``,ae=R||!re?null:$(rQ,{ref:D,ariaLabel:`Rename ${LQ(t)}`,isFlattened:t.isFlattened,value:ie,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),oe=b$(t,k,{actionLaneEnabled:V,customDecoration:te,decorationLaneEnabled:H,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:B,gitLaneActive:x,renameInput:ae,showDecorativeActionAffordance:ne}),se={...iQ({ariaLabel:LQ(t),domId:t.isFocused?g$(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:V,contextMenuButtonVisibility:V?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:ee,effectiveGitStatus:z,isContextHovered:s===P,isDragTarget:l?.kind===`directory`&&l.directoryPath===P,isDragging:c?.has(P)===!0,isFocusRinged:t.isFocused&&o===P},targetPath:P}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(P),j(t,P,{anchorRect:s$(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:R?void 0:()=>{i.focusMountedPathFromInput(P)},onKeyDown:R?void 0:N,ref:e=>{O(P,e)}};return!R&&re?$(`div`,{...se,children:oe}):$(`button`,{...se,type:`button`,draggable:u&&!F,onDragEnd:u&&!F?p:void 0,onDragStart:u&&!F?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{if(R){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!F?e=>{m(e,t,P)}:void 0,onClick:e=>{M(e,t,P,I)},children:oe})}function S$(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(IQ(e))).map((n,r)=>x$(e,n,t.start+r))}function C$({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=RG,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=TQ(null),v=TQ(null),y=TQ(!1),b=TQ(null),x=TQ(null),S=TQ(null),C=TQ(null),w=TQ(null),T=TQ(new Map),E=TQ(new Map),D=TQ(()=>{}),O=TQ(null),k=TQ(0),A=TQ(!1),j=TQ(null);j.current!==t&&(A.current=!1,j.current=t);let M=TQ(!1),N=TQ(null),P=TQ(null),F=TQ(!1),I=TQ(null),L=TQ(null),R=TQ(null),z=TQ(null),ee=TQ(null),te=TQ(null),B=TQ(null),V=TQ(null),H=TQ(!1),ne=TQ(null),re=TQ(null),ie=TQ(null),ae=TQ(null),oe=EQ(()=>new Map,[]),[,se]=xQ(0),[ce,le]=xQ(null),[ue,U]=xQ(null),[de,fe]=xQ(null),[pe,me]=xQ(null),[he,ge]=xQ(0),[_e,ve]=xQ(null),ye=TQ(_e);ye.current=_e;let be=TQ(null),xe=TQ(null),Se=TQ(null),Ce=TQ(null),we=TQ(null),Te=TQ(!1),Ee=()=>{xe.current=null,Se.current=null,Ce.current=null},De=(e,t)=>{xe.current=e,Se.current=null,Ce.current=t==null?null:{path:e,scrollTop:t}},Oe=(e,t)=>{xe.current=null,Se.current={path:e,viewportOffset:t},Ce.current=null},ke=TQ(d===`retain`&&t.isSearchOpen()),[Ae,je]=xQ(p);CQ(()=>{p||je(!1)},[p]);let Me=TQ(!1),Ne=DQ(()=>{Me.current=!0,je(e=>e&&!1)},[]),[Pe,Fe]=xQ(()=>zQ({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Ie,Le]=xQ(!1);CQ(()=>{Le(!0)},[]);let Re=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,ze=e?.contextMenu?.triggerMode??(Re?`right-click`:`both`),W=ze===`both`||ze===`button`,G=e?.contextMenu?.buttonVisibility??`when-needed`,Be=ze===`both`||ze===`right-click`;wQ(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;we.current=t,U(t),me(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Te.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let Ve=DQ((e,t)=>{l$(T.current,e,t)},[]),He=DQ((e,t)=>{l$(E.current,e,t)},[]),Ue=DQ(e=>{x.current=e},[]),We=DQ(e=>u$(e,E.current,T.current),[]),Ge=n!=null||r!=null||i!=null,{resolveIcon:Ke}=EQ(()=>wX(a),[a]),qe=t[cX](),Je=qe.getPath(),Ye=Je!=null,Xe=t.isSearchOpen(),Ze=t.getSearchValue(),Qe=t.getFocusedPath(),$e=t.getFocusedIndex(),et=t.getScrollRequest(),tt=t.isDragAndDropEnabled(),nt=t.getDragSession(),rt=EQ(()=>nt==null?null:new Set(nt.draggedPaths),[nt]),it=nt?.target??null,at=nt?.primaryPath??null,ot=h$(o),{overlayHeight:st,overlayRows:ct,snapshot:lt,visibleRows:ut}=Pe,dt=lt.physical.viewportHeight,ft=EQ(()=>({end:lt.window.endIndex,start:lt.window.startIndex}),[lt.window.endIndex,lt.window.startIndex]),pt=ct,mt=lt.sticky.rows,ht=lt.physical.totalHeight,gt=lt.sticky.height,_t=EQ(()=>new Set(mt.map(e=>IQ(e.row))),[mt]),vt=$e>=0&&$e>=ft.start&&$e<=ft.end,yt=DQ((e,t)=>u?.({item:m$(e,t),row:e})??null,[u]),bt=DQ(e=>qZ(e==null?null:T.current.get(e)??null)?!0:qZ(S.current),[]),xt=DQ(e=>{bt(t.focusNearestPath(e))},[t,bt]),St=TQ(xt);St.current=xt;let Ct=TQ(!0),wt=TQ(()=>{}),Tt=DQ((t=!0)=>{let n=ye.current;n!=null&&(Ct.current=Ct.current&&t,ve(null),e?.contextMenu?.onClose?.(),Ct.current&&xt(n.path))},[e?.contextMenu,xt]);wt.current=Tt;let Et=DQ(e=>{let t=e==null?null:c$(S.current,e);fe(e=>e===t?e:t)},[]),Dt=DQ((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=We(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;De(n,e?.scrollTop??null),M.current=!0,le(e=>e===n?e:n)}i.focus(),Et(a),Ct.current=!0,ve({anchorRect:r?.anchorRect??null,item:m$(e,n),path:n,source:r?.source??`keyboard`})},[t,We,Et]),Ot=DQ(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=YZ(e,dt);I.current=$e<0||e==null?null:Math.max(0,Math.min($e*s-e.scrollTop,Math.max(0,t-s))),F.current=!0}t.startRenaming(e)!==!1&&(me(`focus`),se(e=>e+1))}},[t,$e,s,l,dt]),kt=DQ((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=YZ(i,dt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:zQ({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,eQ(i,a,s,l,u,d),D.current(),be.current=n?e:null,!0},[t,s,c,dt,h]),At=()=>y.current===!0||ae.current!=null||H.current===!0,jt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Mt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Nt=()=>{z.current!=null&&(clearTimeout(z.current),z.current=null),R.current=null},K=()=>{te.current?.remove(),te.current=null},Pt=()=>{Mt(L.current),L.current=null,ee.current=null},Ft=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},It=()=>{V.current?.(),V.current=null,ae.current!=null&&(clearTimeout(ae.current),ae.current=null),H.current=!1,ne.current=null,ie.current=null,re.current!=null&&(re.current.setAttribute(`draggable`,`true`),re.current.style.removeProperty(`touch-action`),re.current=null),K(),Nt(),Pt(),B.current=null},Lt=(e,n)=>{let r=S.current?.getRootNode(),i=KQ(WQ(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Rt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Nt();return}let r=t.getItem(e.directoryPath),i=QQ(r)?r:null;if(i==null||i.isExpanded()){Nt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;R.current!==a&&(Nt(),R.current=a,z.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind!==`directory`||n.directoryPath!==e.directoryPath||n.flattenedSegmentPath!==e.flattenedSegmentPath||i.expand()},n))},zt=()=>{L.current=null;let e=ee.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=YQ(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,D.current()),Rt(Lt(e.clientX,e.clientY)),L.current=jt(zt)},Bt=(e,t)=>{ee.current={clientX:e,clientY:t},L.current??=jt(zt)},Vt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(It(),K(),Nt(),Pt(),t.startDrag(r)===!1){e.preventDefault();return}if(B.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),JQ())){let t=qQ(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Ft(t),te.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Ht=()=>{K(),Nt(),Pt(),B.current=null,t.cancelDrag()},Ut=(e,n,r)=>{if(ae.current!=null||H.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;ie.current={clientX:i.clientX,clientY:i.clientY},re.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!H.current;ae.current!=null&&(clearTimeout(ae.current),ae.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),V.current===o&&(V.current=null),t&&(a.setAttribute(`draggable`,`true`),re.current===a&&(re.current=null),ie.current=null)},s=e=>{let t=e.touches[0],n=ie.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=VQ*VQ||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),V.current=o,ae.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),re.current===a&&(re.current=null),ie.current=null;return}H.current=!0,re.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),B.current=n;let e=a.getBoundingClientRect(),s=qQ(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Ft(s),te.current=s,ne.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=ne.current;n!=null&&te.current!=null&&(te.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Rt(Lt(t.clientX,t.clientY)),Bt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Lt(n.clientX,n.clientY),t.completeDrag(),It()},u=()=>{t.cancelDrag(),It()};V.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},BQ)},Wt=e=>{if(_e!=null){if(e.key===`Escape`){Tt(),e.preventDefault(),e.stopPropagation();return}i$.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(qe.isActive()){if(e.key===`Escape`)qe.cancel();else if(e.key===`Enter`)qe.commit();else return;me(`focus`),se(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Ot(Qe??void 0),e.preventDefault(),e.stopPropagation();return}if(Xe){if(e.key===`Escape`)F.current=!1,I.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=YZ(n,dt);I.current=$e<0||n==null?null:Math.max(0,Math.min($e*s-n.scrollTop,Math.max(0,r-s))),F.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;me(`focus`),se(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&e$(e)){t.openSearch(e.key),se(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Re&&n$(e),r=r$(e,Re),i=r&&S.current!=null?JZ(S.current):null,a=r?new Set(d$(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==Qe&&a.has(o)){let e=C.current;De(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=QQ(p)?p:null,h=u!=null&&(_t.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=u$(u,E.current,T.current);e==null||n==null?y=!1:Dt(e,u)}else if((e.ctrlKey||e.metaKey)&&$Q(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;me(`focus`);let b=t.getFocusedPath(),x=b!=null&&(_t.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))De(b,v?.scrollTop??null),M.current=!0,le(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(Oe(b,p$(S.current,v,i,u,s,gt,dt)),M.current=!0,le(e=>e===b?e:b)):Ee()}se(e=>e+1),e.preventDefault(),e.stopPropagation()};wQ(()=>{if(!(!f||!Xe)){if(ke.current){ke.current=!1;return}qZ(w.current)}},[Xe,f]),wQ(()=>{let e=x.current;switch(nQ({hasRenderedInput:e!=null,previousRenamingPath:P.current,renamingPath:Je})){case`reset`:P.current=null;return;case`reveal-canonical`:Je!=null&&kt(Je,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(be.current=null,P.current=Je,qZ(e),e.select());return}},[ft.end,ft.start,Je,kt,_t]),wQ(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=JZ(e)?.dataset.itemPath??null;le(e=>e===t?e:t)},i=()=>{n(),M.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,JZ(e)!=null){r();return}M.current=!1,le(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,le(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;le(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),wQ(()=>{let e=S.current;e!=null&&(lt.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[lt.physical.scrollTop]),wQ(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=YZ(n,g);let a=()=>{let e=t.getVisibleCount(),r=XZ(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Fe(zQ({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!A.current){A.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=XZ(O.current,g),i=t.getVisibleRows(e,e)[0]??null;QZ(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}D.current=a;let o=!1,l=t.subscribe(()=>{o?se(e=>e+1):o=!0,a()}),u=()=>{Te.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,ge(e=>e+1),e=null},50))},d=null,f=()=>{i!=null&&delete i.dataset.overlayReveal,d!=null&&(clearTimeout(d),d=null)},p=()=>{i==null||Te.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,d!=null&&clearTimeout(d),d=setTimeout(()=>{f()},200))},m=()=>{if(a(),n.scrollTop>0&&f(),ye.current!=null&&y.current&&wt.current(),Te.current===!0){y.current=!1;return}U(e=>e==null?e:null),u()},_=()=>{u(),p()},v=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),x=e=>{v.has(e.key)&&_()};n.addEventListener(`scroll`,m,{passive:!0}),n.addEventListener(`wheel`,_,{passive:!0}),n.addEventListener(`touchmove`,_,{passive:!0}),n.addEventListener(`keydown`,x);let w=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:ZZ(e[0]))??YZ(n,g),a()}):null;return w?.observe(n),()=>{D.current=()=>{},l(),n.removeEventListener(`scroll`,m),n.removeEventListener(`wheel`,_),n.removeEventListener(`touchmove`,_),n.removeEventListener(`keydown`,x),e!=null&&clearTimeout(e),d!=null&&clearTimeout(d),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,w?.disconnect()}},[t,g,s,c,h]),wQ(()=>{Re||_e==null||Tt(!1)},[Tt,Re,_e]);let Gt=EQ(()=>_e==null?null:`${_e.path}::${_e.source}`,[_e]);wQ(()=>{if(Gt==null){m?.clearSlotContent(pW);return}let t=ye.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??o$(n.getBoundingClientRect()),close:e=>{wt.current(e?.restoreFocus??!0)},restoreFocus:()=>{Ct.current&&St.current(ye.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(pW,i),e?.contextMenu?.onOpen?.(t.item,r),y$(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&y$(i)}),()=>{m?.clearSlotContent(pW)}},[Gt,e?.contextMenu,m]),wQ(()=>{_e!=null&&t.getItem(_e.path)==null&&Tt()},[Tt,_e,t]),wQ(()=>{if(_e==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(a$(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Tt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Tt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Tt,_e]),wQ(()=>{let e=C.current,n=S.current;if(e==null||n==null){N.current=Qe;return}let r=Qe==null?null:T.current.get(Qe)??null,i=JZ(n),a=i?.dataset.itemPath??null,o=Ye&&x.current===i,c=f&&w.current===i,l=F.current&&!Xe,u=I.current??0,d=be.current,p=xe.current,m=Se.current,g=Ce.current,_=i!=null,v=M.current||_,y=N.current!==Qe,b=p!=null&&p===Qe&&Qe!=null,E=!1,O=!1;if(et!=null&&et.id!==k.current){k.current=et.id;let n=et.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,dt-s))):gt;E=!0,O=$Z(e,n,s,dt,ht,et.offset,t)}t.clearScrollRequest(et.id)}let A=!E&&l&&eQ(e,$e,s,dt,ht,u),j=!E&&d!=null&&d===Qe&&eQ(e,$e,s,dt,ht,gt),P=!E&&m!=null&&m.path===Qe&&eQ(e,$e,s,dt,ht,m.viewportOffset),L=!E&&g!=null&&g.path===Qe&&e.scrollTop!==g.scrollTop;if(L&&(e.scrollTop=g.scrollTop),(L||O||j||P||A||v&&y&&d!==Qe&&!b&&QZ(e,$e,s,dt,gt))&&D.current(),E){N.current=Qe;return}if(!v){N.current=Qe;return}if(o){N.current=Qe;return}if(c&&!l){N.current=Qe;return}if(r==null){l&&$e>=0&&(eQ(e,$e,s,dt,ht,u),D.current()),N.current=Qe;return}(y||l||d===Qe||p===Qe||m?.path===Qe||g?.path===Qe||a==null||a!==Qe)&&(qZ(r),d===Qe&&(be.current=null),p===Qe&&(xe.current=null),m?.path===Qe&&(Se.current=null),g?.path===Qe&&(Ce.current=null),F.current=!1,I.current=null),N.current=Qe},[t,$e,Qe,vt,s,Ye,Xe,ft,dt,f,et,h,gt,ht,ut]);let Kt=$e>=0&&$e>=lt.visible.startIndex&&$e<=lt.visible.endIndex,qt=Qe!=null&&pt.some(e=>IQ(e.row)===Qe),Jt=Kt||qt,Yt=W&&M.current===!0&&Jt?Qe:null,Xt=pe===`pointer`?ue:null,Zt=_e?.path??we.current??Xt??Yt??ue,Qt=_e?.source===`right-click`;wQ(()=>{y.current&&_e==null||Et(We(Zt))},[_e,We,ft,dt,he,pt,Zt,Et,ut]);let $t=DQ(e=>{if(y.current||a$(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&me(e=>e===`pointer`?e:`pointer`),U(e=>e===i?e:i)},[]),en=DQ(()=>{U(null)},[]);wQ(()=>{if(!tt)return;let e=()=>{It(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),It(),t.cancelDrag()}},[t,tt]);let tn=e=>{if(!tt||t.getDragSession()==null||H.current)return;let n=KQ(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Rt(t.getDragSession()?.target??null),Bt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},nn=e=>{if(!tt||t.getDragSession()==null||H.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Nt(),Pt(),t.setDragTarget(null))},rn=e=>{!tt||t.getDragSession()==null||H.current||(e.preventDefault(),Lt(e.clientX,e.clientY),t.completeDrag(),K(),Nt(),Pt(),B.current=null)},an=lt.window.height,on=lt.window.offsetTop,sn=Math.min(0,dt-an),cn=Math.min(0,dt-an-gt),ln=ce===Qe||F.current,un=Qe!=null&&ln&&!vt&&$e>=0?ut[$e]??t.getVisibleRows($e,$e)[0]??null:null,dn=un==null?null:tQ($e,s,ft,an),fn=B.current,pn=at!=null&&fn!=null&&fn.path===at&&fn.index>=ft.start&&fn.index<=ft.end,mn=at!=null&&fn!=null&&fn.path===at&&!pn&&fn.path!==un?.path?fn:null,hn=mn==null?null:tQ(mn.index,s,ft,an),gn=t$(($e>=0?ut[$e]??t.getVisibleRows($e,$e)[0]??null:null)?.ancestorPaths.at(-1)??null),_n=Xe&&Qe!=null?g$(o,Qe,!vt):void 0,vn=_e?.path??(Xe?Qe:ce),yn=_e?.path??ue,bn=We(Zt),xn=Re&&W&&!Qt&&!Ye&&bn!=null&&de!=null&&Zt!=null,Sn=Re&&(xn||_e!=null),Cn=_e?.anchorRect,wn=Cn==null&&bn!=null&&de!=null&&(_e!=null||xn)?de:null,Tn=Cn==null?wn==null?void 0:{top:`${wn}px`}:{left:`${Cn.left}px`,position:`fixed`,right:`auto`,top:`${Cn.top}px`},En=Qt?{opacity:`0`}:void 0,Dn=DQ((e,n,r,i)=>{let a=aQ({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:Xe,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c);break}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=lt.visible.startIndex&&n.index<=lt.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,le(e=>e===c?e:c),me(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&kt(c,{targetOffset:`sticky-parents`})},[t,Xe,lt.visible.endIndex,lt.visible.startIndex,kt]),On=()=>{if(y.current||!W||Zt==null||bn==null)return;let e=t.getItem(Zt);e!=null&&(Et(bn),Ct.current=!0,ve({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:bn.getAttribute(`aria-label`)??Zt,path:e.getPath()},path:e.getPath(),source:`button`}))},kn={contextHoverPath:yn,contextMenuButtonTriggerEnabled:W,contextMenuButtonVisibility:G,contextMenuEnabled:Re,contextMenuRightClickEnabled:Be,contextMenuTriggerMode:ze,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:tt,draggedPathSet:rt,dragTarget:it,gitLaneActive:Ge,gitStatusByPath:n,handleRowDragEnd:Ht,handleRowDragStart:Vt,handleRowTouchStart:Ut,ignoredGitDirectories:r,ignoredInheritanceCache:oe,instanceId:o,itemHeight:s,onKeyDown:Wt,onRowClick:Dn,openContextMenuForRow:Dt,registerButton:Ve,registerRenameInput:Ue,renameView:qe,renderDecorationForRow:yt,resolveIcon:Ke,shouldSuppressContextMenu:At,visualFocusPath:vn},An={...kn,registerButton:He};return $(`div`,{ref:S,id:ot,"data-file-tree-context-menu-button-visibility":Re&&W?G:void 0,"data-file-tree-context-menu-trigger-mode":Re?ze:void 0,"data-file-tree-has-context-menu-action-lane":Re&&W?`true`:void 0,"data-file-tree-has-git-lane":Ge?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:tt?nn:void 0,onDragOver:tt?tn:void 0,onDrop:tt?rn:void 0,onKeyDown:Wt,onPointerLeave:Re?en:void 0,onPointerOver:Re?$t:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[$(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:gn}}),$(`slot`,{name:fW,"data-type":`header-slot`}),f?$(`div`,{"data-file-tree-search-container":!0,"data-open":Xe?`true`:`false`,children:$(`input`,{ref:w,"aria-activedescendant":_n,"aria-controls":ot,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ae?`true`:void 0,value:Ze,onBlur:()=>{d===`retain`&&!Me.current||t.closeSearch()},onFocus:Ne,onPointerDown:Ne,onInput:e=>{Ne();let n=e.currentTarget;t.setSearch(n.value)}})}):null,$(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Ie&&pt.length>0?$(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:$(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${st}px`},children:pt.map((e,t)=>x$(An,e.row,`sticky:${IQ(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${pt.length-t}`}}))})}):null,$(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${ht}px`},children:[$(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${on}px`}}),$(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${an}px`,top:`${sn}px`,bottom:`${cn}px`},children:[S$(kn,ft,_t),un!=null&&dn!=null?x$(kn,un,`parked:${un.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:at===un.path?`none`:void 0,position:`absolute`,right:`0`,top:`${dn}px`}}):null,mn!=null&&hn!=null?x$(kn,mn,`parked-drag:${mn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${hn}px`}}):null]})]})]}),Re?$(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":Sn?`true`:`false`,style:Tn,children:[$(`button`,{ref:v,type:`button`,"data-type":mW,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":_e==null?`false`:`true`,"data-visible":xn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),_e!=null){Tt();return}On()},tabIndex:-1,style:En,children:$(gZ,{...Ke(`file-tree-icon-ellipsis`)})}),_e==null?null:$(`slot`,{name:pW})]}):null,_e==null?null:$(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Tt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Tt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var w$={hydrateRoot:(e,t)=>{dZ(VX(C$,t),e)},renderRoot:(e,t)=>{uZ(VX(C$,t),e)},unmountRoot:e=>{uZ(null,e)}};function T$(e,t){w$.renderRoot(e,t)}function E$(e,t){w$.hydrateRoot(e,t)}function D$(e){w$.unmountRoot(e)}var O$=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}},k$=`__c`,A$=`__k`,j$=`__d`,M$=`__s`,N$=/[\s\n\\/='"\0<>]/,P$=/^(xlink|xmlns|xml)([A-Z])/,F$=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,I$=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,L$=new Set([`draggable`,`spellcheck`]);function R$(e){e.__g===void 0?e[j$]=!0:e.__g|=8}function z$(e){e.__g===void 0?e[j$]=!1:e.__g&=-9}function B$(e){return e.__g===void 0?!0===e[j$]:!!(8&e.__g)}var V$=/["&<]/;function H$(e){if(e.length===0||!1===V$.test(e))return e;for(var t=0,n=0,r=``,i=``;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i=`"`;break;case 38:i=`&`;break;case 60:i=`<`;break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=i,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var U$={},W$=new Set(`animation-iteration-count.border-image-outset.border-image-slice.border-image-width.box-flex.box-flex-group.box-ordinal-group.column-count.fill-opacity.flex.flex-grow.flex-negative.flex-order.flex-positive.flex-shrink.flood-opacity.font-weight.grid-column.grid-row.line-clamp.line-height.opacity.order.orphans.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.widows.z-index.zoom`.split(`.`)),G$=/[A-Z]/g;function K$(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:U$[n]||(U$[n]=n.replace(G$,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||W$.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function q$(){this.__d=!0}function J$(e,t){return{__v:e,context:t,props:e.props,setState:q$,forceUpdate:q$,__d:!0,__h:[]}}function Y$(e,t,n){if(!e.s){if(n instanceof X$){if(!n.s)return void(n.o=Y$.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(Y$.bind(null,e,t),Y$.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var X$=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{Y$(r,1,a(this.v))}catch(e){Y$(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?Y$(r,1,t?t(i):i):n?Y$(r,1,n(i)):Y$(r,2,i)}catch(e){Y$(r,2,e)}},r},e}(),Z$,Q$,$$,e1,t1={},n1=Array.isArray,r1=Object.assign,i1=``,a1=`<!--$s-->`,o1=`<!--/$s-->`;function s1(e,t){var n,r=e.type,i=!0;return e[k$]?(i=!1,(n=e[k$]).state=n[M$]):n=new r(e.props,t),e[k$]=n,n.__v=e,n.props=e.props,n.context=t,R$(n),n.state??=t1,n[M$]??(n[M$]=n.state),r.getDerivedStateFromProps?n.state=r1({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[M$]===n.state?n.state:n[M$]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),$$&&$$(e),n.render(n.props,n.state,t)}function c1(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===i1)return i1;var s=typeof e;if(s!=`object`)return s==`function`?i1:s==`string`?H$(e):e+i1;if(n1(e)){var c,l=i1;i[A$]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=c1(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=i1,n1(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return i1;e.__=i,Z$&&Z$(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===UX){if(`tpl`in g){for(var x=i1,S=0;S<g.tpl.length;S++)if(x+=g.tpl[S],g.exprs&&S<g.exprs.length){var C=g.exprs[S];if(C==null)continue;typeof C!=`object`||C.constructor!==void 0&&!n1(C)?x+=C:x+=c1(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+H$(g.UNSTABLE_comment)+`-->`;v=g.children}else{if((_=h.contextType)!=null){var w=t[_.__c];b=w?w.props.value:_.__}var T=h.prototype&&typeof h.prototype.render==`function`;if(T)v=s1(e,b),y=e[k$];else{e[k$]=y=J$(e,b);for(var E=0;B$(y)&&E++<25;){z$(y),$$&&$$(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}R$(y)}if(y.getChildContext!=null&&(t=r1({},t,y.getChildContext())),T&&TX.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===UX&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return c1(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[M$]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,t1),B$(y)?(v=s1(e,t),(y=e[k$]).getChildContext!=null&&(t=r1({},t,y.getChildContext())),c1(v=v!=null&&v.type===UX&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):i1}finally{Q$&&Q$(e),e1&&e1(e)}}}v=v!=null&&v.type===UX&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var D=c1(v,t,n,r,e,a,o);return Q$&&Q$(e),TX.unmount&&TX.unmount(e),e._suspended?typeof D==`string`?a1+D+o1:n1(D)?(D.unshift(a1),D.push(o1),D):D.then(function(e){return a1+e+o1}):D}catch(i){if(!a&&o&&o.onError){var O=function i(s){return o.onError(s,e,function(e,s){try{return c1(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(O!==void 0)return O;var k=TX.__e;return k&&k(i,e),i1}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=c1(v,t,n,r,e,a,o);return e._suspended?a1+s+o1:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var A,j=`<`+h,M=i1;for(var N in g){var P=g[N];if(typeof(P=u1(P)?P.value:P)!=`function`||N===`class`||N===`className`){switch(N){case`children`:A=P;continue;case`key`:case`ref`:case`__self`:case`__source`:continue;case`htmlFor`:if(`for`in g)continue;N=`for`;break;case`className`:if(`class`in g)continue;N=`class`;break;case`defaultChecked`:N=`checked`;break;case`defaultSelected`:N=`selected`;break;case`defaultValue`:case`value`:switch(N=`value`,h){case`textarea`:A=P;continue;case`select`:r=P;continue;case`option`:r!=P||`selected`in g||(j+=` selected`)}break;case`dangerouslySetInnerHTML`:M=P&&P.__html;continue;case`style`:typeof P==`object`&&(P=K$(P));break;case`acceptCharset`:N=`accept-charset`;break;case`httpEquiv`:N=`http-equiv`;break;default:if(P$.test(N))N=N.replace(P$,`$1:$2`).toLowerCase();else{if(N$.test(N))continue;N[4]!==`-`&&!L$.has(N)||P==null?n?I$.test(N)&&(N=N===`panose1`?`panose-1`:N.replace(/([A-Z])/g,`-$1`).toLowerCase()):F$.test(N)&&(N=N.toLowerCase()):P+=i1}}P!=null&&!1!==P&&(j=!0===P||P===i1?j+` `+N:j+` `+N+`="`+(typeof P==`string`?H$(P):P+i1)+`"`)}}if(N$.test(h))throw Error(h+` is not a valid HTML tag name in `+j+`>`);if(M||(typeof A==`string`?M=H$(A):A!=null&&!1!==A&&!0!==A&&(M=c1(A,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),Q$&&Q$(e),e1&&e1(e),!M&&l1.has(h))return j+`/>`;var F=`</`+h+`>`,I=j+`>`;return n1(M)?[I].concat(M,[F]):typeof M==`string`?I+M+F:[I,M,F]}var l1=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function u1(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var d1=0;function f1(e){return e!=null&&e.length>0?e:(d1+=1,`pst_ft_${d1}`)}function p1({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??RG)}function m1(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function h1(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function g1(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var _1=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new O$;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=f1(a),this.#p=yX(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=LG(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new mX({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(D$(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){this.#t.resetPaths(e,t)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),T$(t.wrapper,this.#w()))}setGitStatus(e){this.#p=yX(e,this.#p);let t=this.#T();t!=null&&T$(t.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),T$(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),E$(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),T$(r,this.#w())}#C(){return{initialViewportHeight:p1({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(fW,e());return}this.#l.setSlotHtml(fW,this.#e?.header?.html??null)}#k(e){let t=g1(e).find(e=>h1(e)),n=m1(AG(FG(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=g1(e),n=t.find(e=>h1(e)),r=t.filter(e=>e!==n),i=FG(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=m1(i);if(a==null){for(let e of r)e.remove();return}if(!(r.length===1&&r[0].outerHTML===a.outerHTML)){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=FG(this.#m);t.colored&&MG(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${cW}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}this.#g?.parentNode===e&&this.#_===this.#h||(this.#g??=document.createElement(`style`),this.#g.setAttribute(cW,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=HG(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return JG(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}};function v1(e){let[t]=(0,W.useState)(()=>new _1(e)),n=(0,W.useRef)({timeout:null,model:t});return(0,W.useEffect)(()=>{let{current:e}=n;return e.timeout!=null&&(clearTimeout(e.timeout),e.timeout=null),()=>{e.timeout=setTimeout(()=>e.model.cleanUp(),1)}},[]),{model:t}}var y1=(0,W.memo)(function({files:e,activeFile:t,commentCounts:n,viewedFiles:r,untrackedFiles:i,onFileClick:a,collapsed:o,onToggleCollapse:s}){let[c,l]=(0,W.useState)(``),u=(0,W.useMemo)(()=>e.map(e=>e.name),[e]),d=(0,W.useMemo)(()=>{let e=new Set;return u.forEach(t=>{let n=t.split(`/`);for(let t=1;t<n.length;t++)e.add(n.slice(0,t).join(`/`))}),Array.from(e)},[u]),f=(0,W.useMemo)(()=>e.map(e=>{let t=`modified`;if(i.has(e.name))t=`untracked`;else if(e.prevName)t=`renamed`;else{let n=e.prevObjectId,r=e.newObjectId;n===`0000000`||n===`0000000000000000000000000000000000000000`?t=`added`:(r===`0000000`||r===`0000000000000000000000000000000000000000`)&&(t=`deleted`)}return{path:e.name,status:t}}),[e,i]),p=(0,W.useRef)({commentCounts:n,viewedFiles:r});p.current={commentCounts:n,viewedFiles:r};let{model:m}=v1({paths:u,fileTreeSearchMode:`hide-non-matches`,gitStatus:f,renderRowDecoration:(0,W.useCallback)(e=>{let t=e.item.path,{commentCounts:n,viewedFiles:r}=p.current,i=r.has(t),a=n[t]??0;return i&&a>0?{text:`✓ 💬 ${a}`,title:`Viewed, ${a} comment${a>1?`s`:``}`}:i?{text:`✓`,title:`Viewed`}:a>0?{text:`💬 ${a}`,title:`${a} comment${a>1?`s`:``}`}:null},[]),initialSelectedPaths:t?[t]:[],initialExpandedPaths:d,onSelectionChange:e=>{e.length>0&&e[0]!==t&&a(e[0])}});return(0,W.useEffect)(()=>{m.resetPaths(u,{initialExpandedPaths:d})},[u,d,m]),(0,W.useEffect)(()=>{m.setGitStatus(f)},[f,n,r,m]),(0,W.useEffect)(()=>{if(t)try{m.focusPath(t),m.scrollToPath(t,{focus:!0,offset:`nearest`})}catch(e){console.error(`Failed to scroll to active file:`,e)}},[t,m]),(0,W.useEffect)(()=>{m.setSearch(c||null)},[c,m]),o?(0,G.jsx)(`div`,{className:`ft`,children:(0,G.jsx)(`div`,{className:`ft-search`,children:s&&(0,G.jsx)($T,{content:`Expand sidebar`,side:`right`,children:(0,G.jsx)(`button`,{className:`sidebar-toggle`,onClick:s,"aria-label":`Expand sidebar`,children:(0,G.jsx)(pO,{size:16})})})})}):(0,G.jsxs)(`div`,{className:`ft`,style:{display:`flex`,flexDirection:`column`,height:`100%`},children:[(0,G.jsxs)(`div`,{className:`ft-search`,children:[s&&(0,G.jsx)($T,{content:`Collapse sidebar`,side:`right`,children:(0,G.jsx)(`button`,{className:`sidebar-toggle`,onClick:s,"aria-label":`Collapse sidebar`,children:(0,G.jsx)(fO,{size:16})})}),(0,G.jsxs)(`div`,{className:`ft-search-wrapper`,children:[(0,G.jsx)(xO,{size:14,className:`ft-search-icon`}),(0,G.jsx)(`input`,{type:`text`,placeholder:`Filter files...`,value:c,onChange:e=>l(e.target.value),className:`ft-search-input`})]})]}),(0,G.jsx)(`div`,{style:{flex:1,minHeight:0,overflow:`auto`},children:(0,G.jsx)(bW,{model:m,className:`ft-pierre-tree`})})]})});function b1(e){return e.status===`resolved`?`resolved`:e.replies?.length?`replied`:`open`}var x1=[{key:`all`,label:`All`},{key:`open`,label:`Open`},{key:`replied`,label:`Replied`},{key:`resolved`,label:`Resolved`}];function S1({comments:e,resolveComment:t,unresolveComment:n,removeComment:r,addReply:i,editComment:a,editReply:o,removeReply:s}){let[c,l]=(0,W.useState)(`all`),u=(0,W.useMemo)(()=>{let t={all:e.length,open:0,replied:0,resolved:0};for(let n of e)t[b1(n)]++;return t},[e]),d=(0,W.useMemo)(()=>[...e].sort((e,t)=>t.createdAt-e.createdAt),[e]),f=(0,W.useMemo)(()=>c===`all`?d:d.filter(e=>b1(e)===c),[d,c]);return e.length===0?null:(0,G.jsxs)(`div`,{className:`cmt`,role:`complementary`,"aria-label":`Review comments`,children:[(0,G.jsxs)(`div`,{className:`cmt-head`,children:[(0,G.jsxs)(`div`,{className:`cmt-title`,children:[(0,G.jsx)(cO,{size:14,"aria-hidden":`true`}),(0,G.jsx)(`span`,{children:`Comments`}),(0,G.jsx)(`span`,{className:`cmt-total`,children:e.length})]}),(0,G.jsx)(`div`,{className:`cmt-filters`,role:`tablist`,"aria-label":`Filter comments`,children:x1.map(e=>(0,G.jsxs)(`button`,{role:`tab`,"aria-selected":c===e.key,className:`cmt-filter ${c===e.key?`cmt-filter-active`:``}`,onClick:()=>l(e.key),disabled:e.key!==`all`&&u[e.key]===0,children:[e.label,(0,G.jsx)(`span`,{className:`cmt-filter-count`,children:u[e.key]})]},e.key))})]}),(0,G.jsx)(`ul`,{className:`cmt-list`,"aria-label":`Comment threads`,children:f.length===0?(0,G.jsxs)(`li`,{className:`cmt-empty`,children:[`No `,c,` comments`]}):f.map(e=>(0,G.jsx)(C1,{comment:e,resolveComment:t,unresolveComment:n,removeComment:r,addReply:i,editComment:a,editReply:o,removeReply:s},e.id))})]})}function C1({comment:e,resolveComment:t,unresolveComment:n,removeComment:r,addReply:i,editComment:a,editReply:o,removeReply:s}){let c=b1(e),l=e.status===`resolved`,u=e.replies?.length??0,{haptic:d,sound:f}=lD(),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(!1),[_,v]=(0,W.useState)(!1),[y,b]=(0,W.useState)(!1),x=(0,W.useCallback)(()=>{e.lineNumber>0?oE(e.filePath,e.lineNumber,e.side):document.getElementById(`file-${e.filePath}`)?.scrollIntoView({block:`start`})},[e.filePath,e.lineNumber,e.side]),S=e.lineNumber>0?`:${e.lineNumber}`:` · file`;return(0,G.jsxs)(`li`,{className:`cmt-card cmt-card-${c} ${l?`cmt-card-resolved`:``}`,children:[(0,G.jsxs)(`div`,{className:`cmt-card-top`,children:[(0,G.jsx)(`span`,{className:`cmt-dot cmt-dot-${c}`,"aria-hidden":`true`}),(0,G.jsxs)(`button`,{className:`cmt-loc`,onClick:x,title:`Jump to ${e.filePath}${S}`,children:[(0,G.jsx)(`span`,{className:`cmt-loc-file`,children:tE(e.filePath)}),(0,G.jsx)(`span`,{className:`cmt-loc-line`,children:S})]}),(0,G.jsx)(`span`,{className:`cmt-time`,children:eE(e.createdAt)})]}),e.lineContent?.trim()&&(0,G.jsx)(`button`,{className:`cmt-codeline`,onClick:x,title:`Jump to line`,children:(0,G.jsx)(`code`,{children:e.lineContent.trim().slice(0,160)})}),_?(0,G.jsx)(KU,{draftKey:`tracker-edit:${e.id}`,initialBody:e.body,onCancel:()=>v(!1),onSubmit:t=>{a(e.id,t),v(!1)}}):(0,G.jsx)(JH,{content:e.body,className:`cmt-body markdown-body`}),(0,G.jsxs)(`div`,{className:`cmt-actions`,children:[(0,G.jsxs)(`button`,{className:`cmt-act`,onClick:()=>{g(e=>!e),m(!0)},title:`Reply`,children:[(0,G.jsx)(WD,{size:13,"aria-hidden":`true`}),(0,G.jsx)(`span`,{children:`Reply`})]}),(0,G.jsx)(`button`,{className:`cmt-act`,onClick:()=>v(e=>!e),title:`Edit comment`,children:(0,G.jsx)(hO,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`cmt-act ${l?`cmt-act-resolved`:``}`,onClick:()=>{l?(n(e.id),d(`light`),f(`toggle`)):(t(e.id),d(`success`),f(`resolve`))},title:l?`Reopen`:`Resolve`,children:l?(0,G.jsx)(yO,{size:13,"aria-hidden":`true`}):(0,G.jsx)(jD,{size:13,"aria-hidden":`true`})}),y?(0,G.jsxs)(`span`,{className:`cmt-confirm`,children:[(0,G.jsx)(`button`,{className:`cmt-act cmt-act-danger`,onClick:()=>{r(e.id),d(`medium`),f(`remove`)},title:`Confirm delete`,children:`Delete?`}),(0,G.jsx)(`button`,{className:`cmt-act`,onClick:()=>b(!1),title:`Cancel`,children:(0,G.jsx)(AO,{size:13,"aria-hidden":`true`})})]}):(0,G.jsx)(`button`,{className:`cmt-act cmt-act-del`,onClick:()=>b(!0),title:`Delete comment`,children:(0,G.jsx)(TO,{size:13,"aria-hidden":`true`})})]}),u>0&&(0,G.jsxs)(`button`,{className:`cmt-thread-toggle`,onClick:()=>m(e=>!e),"aria-expanded":p,children:[(0,G.jsx)(PD,{size:12,className:`cmt-chev ${p?`cmt-chev-open`:``}`,"aria-hidden":`true`}),u,` `,u===1?`reply`:`replies`]}),p&&u>0&&(0,G.jsx)(`ul`,{className:`cmt-replies`,children:e.replies.map(t=>(0,G.jsx)(w1,{reply:t,onEdit:n=>o(e.id,t.id,n),onRemove:()=>s(e.id,t.id)},t.id))}),h&&(0,G.jsx)(KU,{draftKey:`reply:${e.id}`,onCancel:()=>g(!1),onSubmit:t=>{i(e.id,t),d(`light`),f(`success`),g(!1),m(!0)}})]})}function w1({reply:e,onEdit:t,onRemove:n}){let r=e.role===`agent`||e.role==null&&!!e.model,[i,a]=(0,W.useState)(!1);return(0,G.jsxs)(`li`,{className:`cmt-reply ${r?`cmt-reply-agent`:``}`,children:[(0,G.jsxs)(`div`,{className:`cmt-reply-head`,children:[(0,G.jsxs)(`span`,{className:`cmt-reply-who ${r?`cmt-reply-who-agent`:``}`,children:[r?(0,G.jsx)(AD,{size:11,"aria-hidden":`true`}):null,r?e.model||`Agent`:`You`]}),(0,G.jsx)(`span`,{className:`cmt-time`,children:eE(e.createdAt)}),!r&&(0,G.jsx)(`button`,{className:`cmt-reply-act`,onClick:()=>a(e=>!e),title:`Edit reply`,children:(0,G.jsx)(hO,{size:11,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`cmt-reply-act cmt-act-del`,onClick:n,title:`Delete reply`,children:(0,G.jsx)(TO,{size:11,"aria-hidden":`true`})})]}),i?(0,G.jsx)(KU,{draftKey:`tracker-reply-edit:${e.id}`,initialBody:e.body,onCancel:()=>a(!1),onSubmit:e=>{t(e),a(!1)}}):(0,G.jsx)(JH,{content:e.body,className:`cmt-reply-body markdown-body`})]})}function T1(e,t){let[n,r]=(0,W.useState)(e);return(0,W.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function E1(e){return e===`symbols`?2:e===`text`?1:0}function D1({scope:e,query:t,regex:n,changedOnly:r,changedPaths:i,open:a}){let o=T1(t,130).trim(),s=a&&o.length>=E1(e);return{...nt({queryKey:[`search`,e,o,e===`text`?n:!1,r,r?i:null],enabled:s,placeholderData:V,staleTime:5e3,queryFn:async({signal:t})=>{let a=await fetch(`/api/search`,{method:`POST`,headers:{"content-type":`application/json`},signal:t,body:JSON.stringify({scope:e,query:o,regex:e===`text`?n:!1,changedPaths:r?i:void 0})});if(!a.ok)throw Error(`Search request failed (${a.status})`);return await a.json()}}),enabled:s,pending:t.trim()!==o,minLength:E1(e)}}function O1(e,t){fetch(`/api/search/track`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({query:e,path:t})}).catch(()=>{})}function k1(e){return nt({queryKey:[`file-text`,e],enabled:!!e,staleTime:300*1e3,queryFn:async({signal:t})=>{let n=await fetch(`/api/file-text?path=${encodeURIComponent(e)}&version=new`,{signal:t});if(n.status===415)return{content:null,missing:!1,binary:!0};if(!n.ok)throw Error(`Failed to load file (${n.status})`);let r=await n.json();if(r.error){if(/binary/i.test(r.error))return{content:null,missing:!1,binary:!0};throw Error(r.error)}return r.missing?{content:null,missing:!0,binary:!1}:{content:r.content??``,missing:!1,binary:!1}}})}var A1=[{pattern:/^\s*(?:export\s+)?(?:async\s+)?function\s+(\w[\w$]*)\s*[<(]/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=\s*(?:async\s*)?\(/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=\s*(?:async\s+)?function/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:export\s+)?class\s+(\w[\w$]*)/i,kind:`class`,nameGroup:1},{pattern:/^\s*(?:export\s+)?interface\s+(\w[\w$]*)/i,kind:`interface`,nameGroup:1},{pattern:/^\s*(?:export\s+)?type\s+(\w[\w$]*)\s*=/i,kind:`type`,nameGroup:1},{pattern:/^\s*(?:export\s+)?enum\s+(\w[\w$]*)/i,kind:`enum`,nameGroup:1},{pattern:/^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=/i,kind:`variable`,nameGroup:1},{pattern:/^\s*def\s+(\w[\w$]*)\s*\(/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?fn\s+(\w[\w$]*)\s*[<(]/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?struct\s+(\w[\w$]*)/i,kind:`struct`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?enum\s+(\w[\w$]*)/i,kind:`enum`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?impl\s+(\w[\w$]*)/i,kind:`impl`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?trait\s+(\w[\w$]*)/i,kind:`trait`,nameGroup:1},{pattern:/^\s*func\s+(\w[\w$]*)\s*\(/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:func\s+)?\((\w[\w$]*)\s+\*?\w+\)\s+(\w[\w$]*)\s*\(/i,kind:`method`,nameGroup:2}];function j1(e){for(let{pattern:t,kind:n,nameGroup:r}of A1){let i=t.exec(e);if(i){let e=i[r];if(e)return{name:e,kind:n}}}return null}function M1(e){return new Set(e.map(e=>e.name))}function N1(e){let t=new Set;for(let n of e)n.side===`additions`&&t.add(`${n.filePath}:${n.lineNumber}`);return t}function P1(e,t){return e.kind===`file`?t.diffFileSet.has(e.path)?{type:`scrollFile`,path:e.path}:{type:`preview`,path:e.path}:t.diffFileSet.has(e.path)?{type:`scrollLine`,path:e.path,line:e.line,side:`additions`,match:e.match}:{type:`preview`,path:e.path,line:e.line,match:e.match}}function F1(e,t){if(!t||t.length===0)return null;let n=!0;for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127){n=!1;break}let r=n?e.length:L1(e),i=null;if(!n){i=Array(r+1).fill(-1);let t=0;for(let n=0;n<e.length;){i[t]=n;let r=e.codePointAt(n);n+=r>65535?2:1,t+=I1(r)}i[r]=e.length}let a=[];for(let e of t){let[t,o]=e;if(!(t==null||o==null||o<=t||t<0||o>r))if(n)a.push([t,o]);else{let e=i[t],n=i[o];e>=0&&n>=0&&a.push([e,n])}}return a.length?a:null}function I1(e){return e<=127?1:e<=2047?2:e<=65535?3:4}function L1(e){let t=0;for(let n=0;n<e.length;){let r=e.codePointAt(n);t+=I1(r),n+=r>65535?2:1}return t}function R1(e,t,n){let r=((t?F1(e,t):null)??z1(e,n)).map(([t,n])=>[Math.max(0,t),Math.min(e.length,n)]).filter(([e,t])=>t>e).sort((e,t)=>e[0]-t[0]),i=[];for(let[e,t]of r){let n=i[i.length-1];n&&e<=n[1]?n[1]=Math.max(n[1],t):i.push([e,t])}return i}function z1(e,t){let n=t.trim();if(!n)return[];let r=[],i=e.toLowerCase(),a=n.toLowerCase(),o=0;for(;r.length<50;){let e=i.indexOf(a,o);if(e===-1)break;r.push([e,e+a.length]),o=e+a.length}return r}function B1(e,t){let n=e.toLowerCase(),r=t.toLowerCase();if(!r)return 0;let i=0,a=0,o=-1;for(let e=0;e<n.length&&i<r.length;e++)n[e]===r[i]&&(a+=o>=0&&e-o===1?5:1,o=e,i++);return i===r.length?a-e.length*.01:null}function V1(e){let t=[],n=new Set;for(let r of e){if(r.side!==`additions`)continue;let e=j1(r.content);if(e){let i=`${r.filePath}:${r.lineNumber}:${e.name}`;if(n.has(i))continue;n.add(i);let a=r.content.indexOf(e.name),o=a>=0?[[a,a+e.name.length]]:[];t.push({name:e.name,kind:e.kind,path:r.filePath,fileName:r.filePath.split(`/`).pop()||``,line:r.lineNumber,content:r.content,matchRanges:o,gitStatus:``})}}return t}var H1=[{key:`all`,label:`All`,Icon:tO},{key:`files`,label:`Files`,Icon:qD},{key:`text`,label:`Text`,Icon:DO},{key:`symbols`,label:`Symbols`,Icon:HD}],U1={function:`ƒ`,method:`m`,class:`C`,variable:`v`,interface:`I`,type:`T`,enum:`E`,struct:`S`,impl:`i`,trait:`t`};function W1(e){switch(e){case`modified`:return{label:`M`,title:`modified`};case`untracked`:return{label:`U`,title:`untracked`};case`staged_new`:case`added`:return{label:`A`,title:`added`};case`deleted`:return{label:`D`,title:`deleted`};case`renamed`:return{label:`R`,title:`renamed`};case``:case`clean`:return null;default:return{label:e.charAt(0).toUpperCase(),title:e}}}function G1({text:e,ranges:t}){if(!t.length)return(0,G.jsx)(G.Fragment,{children:e});let n=[],r=0;return t.forEach(([t,i],a)=>{t>r&&n.push(e.slice(r,t)),n.push((0,G.jsx)(`mark`,{className:`searchpalette-mark`,children:e.slice(t,i)},a)),r=i}),r<e.length&&n.push(e.slice(r)),(0,G.jsx)(G.Fragment,{children:n})}function K1(e,t){let n=t.trim().toLowerCase();if(!n)return[];let r=e.toLowerCase(),i=[],a=0;for(let e=0;e<r.length&&a<n.length;e++)if(r[e]===n[a]){let t=i[i.length-1];t&&t[1]===e?t[1]=e+1:i.push([e,e+1]),a++}return a===n.length?i:[]}var q1=e=>{let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t+1)};function J1(e,t){let n=e.length-e.trimStart().length,r=e.slice(n),i=n;if(r.length>400){let e=t.find(e=>e[0]>=n),a=e?Math.max(0,e[0]-n-24):0,o=a>0?`…`:``;r=o+r.slice(a,a+400),i=n+a-o.length}let a=t.map(([e,t])=>[e-i,t-i]).filter(([e,t])=>t>0&&e<r.length).map(([e,t])=>[Math.max(0,e),Math.min(r.length,t)]);return{text:r,ranges:a}}function Y1({isOpen:e,onClose:t,initialScope:n,files:r,changedEntries:i,customMode:a,staged:o,onNavigateFile:s,theme:c,fontSize:l,monoFontFamily:u,defaultTabSize:d,lineWrap:f,showLineNumbers:p,lineHoverHighlight:m}){let[h,g]=(0,W.useState)(``),[_,v]=(0,W.useState)(n),[y,b]=(0,W.useState)(!1),[x,S]=(0,W.useState)(!1),[C,w]=(0,W.useState)(0),[T,E]=(0,W.useState)(null),D=(0,W.useRef)(null),O=(0,W.useRef)(null),k=(0,W.useMemo)(()=>M1(r),[r]),A=(0,W.useMemo)(()=>N1(i),[i]),j=D1({scope:_,query:h,regex:y,changedOnly:x,changedPaths:(0,W.useMemo)(()=>[...k],[k]),open:e}),M=j.data&&j.data.scope===_?j.data:void 0,N=M?.error,P=nt({queryKey:[`repo-files-fallback`],enabled:e&&_===`files`&&!!N,staleTime:6e4,queryFn:async()=>(await(await fetch(`/api/repo-files`)).json()).files??[]});(0,W.useEffect)(()=>{e&&(g(``),v(n),b(!1),S(!1),w(0),E(null))},[e,n]),(0,W.useEffect)(()=>{e&&D.current?.focus()},[e]),(0,W.useEffect)(()=>{w(0),E(null)},[h,_]);let F=(0,W.useMemo)(()=>{let e=h.trim(),t=e.toLowerCase(),n=[];if(_===`files`&&N&&P.data)n=P.data.map(e=>({path:e,score:t?B1(e,t):0})).filter(e=>e.score!==null).sort((e,t)=>t.score-e.score).slice(0,60).map(({path:e})=>({kind:`file`,key:e,hit:{path:e,fileName:tE(e),gitStatus:``,matchType:``,exact:!1},inDiff:k.has(e)}));else if(M)M.scope===`files`?n=M.items.map(e=>({kind:`file`,key:e.path,hit:e,inDiff:k.has(e.path)})):M.scope===`text`?n=M.items.map(e=>({kind:`text`,key:`${e.path}:${e.line}:${e.col}`,hit:e,inDiff:k.has(e.path)})):M.scope===`symbols`?n=M.items.map(e=>({kind:`symbol`,key:`${e.path}:${e.line}:${e.name}`,hit:e,inDiff:k.has(e.path)})):M.scope===`all`&&(n=M.items.map(e=>e.kind===`file`?{kind:`file`,key:`all:${e.hit.path}`,hit:e.hit,inDiff:k.has(e.hit.path)}:e.kind===`text`?{kind:`text`,key:`all:${e.hit.path}:${e.hit.line}:${e.hit.col}`,hit:e.hit,inDiff:k.has(e.hit.path)}:{kind:`symbol`,key:`all:${e.hit.path}:${e.hit.line}:${e.hit.name}`,hit:e.hit,inDiff:k.has(e.hit.path)}));else if(_===`symbols`&&e.length<2){let e=V1(i);n=(t?e.filter(e=>e.name.toLowerCase().includes(t)):e).map(e=>({kind:`symbol`,key:`local:${e.path}:${e.line}:${e.name}`,hit:e,inDiff:!0}))}let r=n.filter(e=>e.inDiff),a=n.filter(e=>!e.inDiff);return[...r,...a]},[M,N,P.data,_,k,h,i]);(0,W.useEffect)(()=>{C>=F.length&&w(0)},[F.length,C]),(0,W.useEffect)(()=>{(O.current?.querySelector(`[data-focused="true"]`))?.scrollIntoView({block:`nearest`})},[C,F]);let I=(0,W.useMemo)(()=>({diffFileSet:k,changedKeys:A,customMode:a,staged:o}),[k,A,a,o]),L=(0,W.useCallback)((e,n)=>{let r=F[e];if(!r)return;let i=r.hit.path,a=h.trim();if(O1(a,i),r.kind===`file`){if(n){E({path:i});return}P1({kind:`file`,path:i},I).type===`scrollFile`?(t(),requestAnimationFrame(()=>s(i))):E({path:i});return}let o=r.hit.line,c=r.kind===`symbol`?r.hit.name:a;if(n){E({path:i,line:o,match:c});return}let l=P1({kind:`line`,path:i,line:o,match:c},I);l.type===`scrollLine`?(t(),requestAnimationFrame(()=>oE(i,l.line,l.side,l.match))):E({path:i,line:o,match:c})},[F,h,I,t,s]),R=(0,W.useCallback)(e=>{v(t=>H1[(H1.findIndex(e=>e.key===t)+e+H1.length)%H1.length].key)},[]),z=(0,W.useCallback)(e=>{if(e.key===`PageDown`){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:150,behavior:`auto`});return}if(e.key===`PageUp`){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:-150,behavior:`auto`});return}if(e.altKey&&(e.key===`ArrowDown`||e.key===`j`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:80,behavior:`auto`});return}if(e.altKey&&(e.key===`ArrowUp`||e.key===`k`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:-80,behavior:`auto`});return}if(e.shiftKey&&(e.key===`ArrowDown`||e.key===`j`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:80,behavior:`auto`});return}if(e.shiftKey&&(e.key===`ArrowUp`||e.key===`k`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:-80,behavior:`auto`});return}if(e.key===`Tab`){e.preventDefault(),R(e.shiftKey?-1:1);return}let t=e=>{F.length!==0&&w(t=>(t+e+F.length)%F.length)};e.key===`ArrowDown`||e.ctrlKey&&(e.key===`n`||e.key===`j`)?(e.preventDefault(),t(1)):e.key===`ArrowUp`||e.ctrlKey&&(e.key===`p`||e.key===`k`)?(e.preventDefault(),t(-1)):e.ctrlKey&&e.key===`d`?(e.preventDefault(),t(8)):e.ctrlKey&&e.key===`u`?(e.preventDefault(),t(-8)):e.key===`Enter`&&(e.preventDefault(),L(C,e.metaKey||e.ctrlKey))},[R,F.length,L,C]),ee=(0,W.useCallback)(()=>{T?E(null):t()},[T,t]),te=M?.total??F.length,B=(j.isFetching||j.pending)&&j.enabled,V=M?.indexing;return(0,G.jsxs)(PU,{open:e,onClose:ee,className:`searchpalette ui-modal--palette ${T?`searchpalette--split`:``}`,ariaLabel:`Search files, text and symbols`,initialFocus:D,onKeyDown:z,children:[(0,G.jsxs)(`div`,{className:`searchpalette-header`,children:[(0,G.jsxs)(`div`,{className:`searchpalette-input-row`,children:[(0,G.jsx)(xO,{size:15,className:`searchpalette-search-icon`}),(0,G.jsx)(`input`,{ref:D,type:`text`,className:`searchpalette-input`,placeholder:_===`all`?`Search files, text and symbols…`:_===`files`?`Search files in the repo…`:_===`text`?y?`Search by regular expression…`:`Search file contents…`:`Search symbol definitions…`,value:h,onChange:e=>g(e.target.value),role:`combobox`,"aria-expanded":F.length>0,"aria-controls":`searchpalette-list`,"aria-activedescendant":F[C]?`sp-row-${C}`:void 0,spellCheck:!1,autoComplete:`off`}),B&&(0,G.jsx)(nO,{size:14,className:`searchpalette-spinner spin`}),h&&(0,G.jsx)(`button`,{className:`searchpalette-clear`,onClick:()=>g(``),"aria-label":`Clear search`,children:(0,G.jsx)(AO,{size:14})}),(0,G.jsx)(`span`,{className:`searchpalette-count`,children:V?`indexing…`:M?`${F.length} of ${te}`:``})]}),(0,G.jsxs)(`div`,{className:`searchpalette-controls`,children:[(0,G.jsx)(`div`,{className:`searchpalette-scopes`,role:`tablist`,"aria-label":`Search scope`,children:H1.map(e=>(0,G.jsxs)(`button`,{role:`tab`,"aria-selected":_===e.key,className:`searchpalette-scope ${_===e.key?`is-active`:``}`,onClick:()=>v(e.key),children:[(0,G.jsx)(e.Icon,{size:12}),e.label]},e.key))}),(0,G.jsxs)(`div`,{className:`searchpalette-toggles`,children:[_===`text`&&(0,G.jsx)(`button`,{className:`searchpalette-toggle ${y?`is-active`:``}`,onClick:()=>b(e=>!e),title:`Regular expression`,"aria-pressed":y,children:`.*`}),(0,G.jsxs)(`button`,{className:`searchpalette-toggle ${x?`is-active`:``}`,onClick:()=>S(e=>!e),title:`Limit to files in the current diff`,"aria-pressed":x,children:[(0,G.jsx)(XD,{size:12}),`Changed`]})]})]}),M?.regexError&&(0,G.jsx)(`div`,{className:`searchpalette-note`,children:`Invalid regex — showing literal matches`})]}),(0,G.jsxs)(`div`,{className:`searchpalette-body`,children:[(0,G.jsx)(`div`,{className:`searchpalette-list`,id:`searchpalette-list`,role:`listbox`,ref:O,children:(0,G.jsx)(X1,{rows:F,scope:_,query:h,focusedIndex:C,engineError:N,isFetching:j.isFetching,enabled:j.enabled,minLength:j.minLength,regex:y,changedOnly:x,onHover:w,onActivate:(e,t)=>L(e,t?t.metaKey||t.ctrlKey:!1),onRetry:()=>j.refetch()})}),T&&(0,G.jsx)(n0,{preview:T,theme:c,fontSize:l,monoFontFamily:u,defaultTabSize:d,lineWrap:f,showLineNumbers:p,lineHoverHighlight:m,onClose:()=>E(null),inDiff:k.has(T.path),onGoToDiff:()=>{t(),T.line?requestAnimationFrame(()=>oE(T.path,T.line,`additions`,T.match)):requestAnimationFrame(()=>s(T.path))}},T.path)]}),(0,G.jsxs)(`div`,{className:`searchpalette-foot`,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`Tab`}),` scope`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`↑↓`}),` move`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`↵`}),` `,T&&k.has(T.path)?`view in diff`:`open`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`⌘↵`}),` peek`]}),T&&(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`⌥↑↓`}),` / `,(0,G.jsx)(`kbd`,{children:`⇧↑↓`}),` scroll preview`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`esc`}),` `,T?`back`:`close`]})]})]})}function X1({rows:e,scope:t,query:n,focusedIndex:r,engineError:i,isFetching:a,enabled:o,minLength:s,regex:c,changedOnly:l,onHover:u,onActivate:d,onRetry:f}){return i&&t!==`files`?(0,G.jsxs)(`div`,{className:`searchpalette-state searchpalette-state--error`,children:[(0,G.jsx)(`p`,{children:`Search engine unavailable`}),(0,G.jsx)(`span`,{className:`searchpalette-state-detail`,children:i}),(0,G.jsx)(`button`,{className:`searchpalette-retry`,onClick:f,children:`Retry`})]}):e.length>0?(0,G.jsx)(G.Fragment,{children:e.map((e,t)=>(0,G.jsx)(Z1,{row:e,index:t,query:n,focused:t===r,onHover:u,onActivate:d},e.key))}):o?a?(0,G.jsxs)(`div`,{className:`searchpalette-state`,children:[(0,G.jsx)(nO,{size:15,className:`spin`}),` Searching…`]}):(0,G.jsxs)(`div`,{className:`searchpalette-state`,children:[(0,G.jsxs)(`p`,{children:[`No matches`,n.trim()?` for “${n.trim()}”`:``]}),(0,G.jsx)(`span`,{className:`searchpalette-state-detail`,children:l?`Searching only changed files — turn off Changed to search the whole repo`:t===`text`&&!c?`Try Tab to switch scope, or enable .* for regex`:`Try Tab to switch scope`})]}):(0,G.jsx)(`div`,{className:`searchpalette-state`,children:t===`symbols`?n.trim()?`No matching symbols in the current diff. Type at least 2 characters to search the whole repository.`:`No symbols found in the current diff. Type at least 2 characters to search the whole repository.`:t===`text`?`Type to search file contents`:`Type to filter — or browse all files`})}function Z1({row:e,index:t,query:n,focused:r,onHover:i,onActivate:a}){let o=W1(e.hit.gitStatus);return(0,G.jsxs)(`div`,{id:`sp-row-${t}`,role:`option`,"aria-selected":r,"data-focused":r,className:`searchpalette-row ${r?`is-focused`:``} ${e.inDiff?`is-indiff`:``}`,onMouseEnter:()=>i(t),onClick:e=>a(t,e),children:[e.kind===`file`&&(0,G.jsx)(Q1,{hit:e.hit,query:n}),e.kind===`text`&&(0,G.jsx)($1,{hit:e.hit,query:n}),e.kind===`symbol`&&(0,G.jsx)(e0,{hit:e.hit}),(0,G.jsxs)(`div`,{className:`searchpalette-rail`,children:[e.inDiff&&(0,G.jsx)(`span`,{className:`searchpalette-pill searchpalette-pill--diff`,children:`diff`}),o&&(0,G.jsx)(`span`,{className:`searchpalette-git searchpalette-git--${o.title}`,title:o.title,children:o.label})]})]})}function Q1({hit:e,query:t}){let n=e.fileName,r=K1(n,t);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`searchpalette-tile searchpalette-tile--file`,children:(0,G.jsx)(qD,{size:13})}),(0,G.jsxs)(`div`,{className:`searchpalette-info`,children:[(0,G.jsx)(`span`,{className:`searchpalette-primary`,children:(0,G.jsx)(G1,{text:n,ranges:r})}),(0,G.jsx)(`span`,{className:`searchpalette-secondary`,children:q1(e.path)||`./`})]})]})}function $1({hit:e,query:t}){let n=R1(e.content,e.matchRanges,t),{text:r,ranges:i}=J1(e.content,n);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`searchpalette-tile searchpalette-tile--text`,children:(0,G.jsx)(DO,{size:13})}),(0,G.jsxs)(`div`,{className:`searchpalette-info`,children:[(0,G.jsx)(`span`,{className:`searchpalette-primary searchpalette-code`,children:(0,G.jsx)(G1,{text:r,ranges:i})}),(0,G.jsxs)(`span`,{className:`searchpalette-secondary`,children:[e.fileName,`:`,e.line,(0,G.jsx)(`span`,{className:`searchpalette-crumb`,children:q1(e.path)})]})]})]})}function e0({hit:e}){let t=e.content.indexOf(e.name),n=t>=0?e.content.slice(t+e.name.length).trimEnd():``,r=R1(e.name,e.matchRanges.length?t0(e):void 0,e.name);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`searchpalette-tile searchpalette-tile--symbol`,title:e.kind,children:U1[e.kind]??`?`}),(0,G.jsxs)(`div`,{className:`searchpalette-info`,children:[(0,G.jsxs)(`span`,{className:`searchpalette-primary`,children:[(0,G.jsx)(G1,{text:e.name,ranges:r}),n&&(0,G.jsx)(`span`,{className:`searchpalette-sigtail`,children:n.slice(0,60)})]}),(0,G.jsxs)(`span`,{className:`searchpalette-secondary`,children:[e.fileName,`:`,e.line,(0,G.jsx)(`span`,{className:`searchpalette-crumb`,children:q1(e.path)})]})]}),(0,G.jsx)(`span`,{className:`searchpalette-kind-badge`,children:e.kind})]})}function t0(e){let t=e.content.indexOf(e.name);if(t<0)return;let n=[];for(let[r,i]of e.matchRanges){let a=r-t,o=i-t;o>0&&a<e.name.length&&n.push([Math.max(0,a),Math.min(e.name.length,o)])}return n.length?n:void 0}function n0({preview:e,theme:t,fontSize:n,monoFontFamily:r,defaultTabSize:i,lineWrap:a,showLineNumbers:o,lineHoverHighlight:s,onClose:c,inDiff:l,onGoToDiff:u}){let d=nE[t]||nE.nord,{data:f,isLoading:p,error:m}=k1(e.path),h=(0,W.useRef)(null);return(0,W.useEffect)(()=>{!f?.content||!e.line||!h.current||aE(h.current,e.line,e.match)},[f?.content,e.line,e.match]),(0,G.jsxs)(`div`,{className:`searchpalette-preview`,children:[(0,G.jsxs)(`div`,{className:`searchpalette-preview-head`,children:[(0,G.jsx)(qD,{size:12}),(0,G.jsx)(`span`,{className:`searchpalette-preview-path`,children:e.path}),l&&(0,G.jsxs)(`button`,{className:`searchpalette-preview-diff-btn`,onClick:u,title:`Open this file and line in the main diff viewer (Enter)`,style:{padding:`2.5px 8px`,fontSize:`10.5px`,background:`var(--accent-subtle)`,border:`1px solid var(--accent)`,borderRadius:`4px`,color:`var(--text-primary)`,cursor:`pointer`,fontWeight:600,marginRight:`8px`,display:`inline-flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsx)(XD,{size:11}),`View in Diff`]}),(0,G.jsx)(`button`,{className:`searchpalette-clear`,onClick:c,"aria-label":`Close preview`,children:(0,G.jsx)(AO,{size:14})})]}),(0,G.jsx)(`div`,{className:`searchpalette-preview-body`,ref:h,children:p?(0,G.jsxs)(`div`,{className:`searchpalette-state`,children:[(0,G.jsx)(nO,{size:15,className:`spin`}),` Loading `,e.path,`…`]}):m?(0,G.jsx)(`div`,{className:`searchpalette-state searchpalette-state--error`,children:m.message}):f?.binary?(0,G.jsx)(`div`,{className:`searchpalette-state`,children:`Binary file — no preview`}):f?.missing?(0,G.jsx)(`div`,{className:`searchpalette-state`,children:`File not present in the working tree`}):f?(0,G.jsx)(Bh,{file:{name:e.path,contents:f.content??``},options:{disableFileHeader:!0,overflow:a?`wrap`:`scroll`,disableLineNumbers:!o,lineHoverHighlight:s,theme:{dark:d.type===`dark`?d.themeName:`nord`,light:d.type===`light`?d.themeName:`github-light`},themeType:d.type,unsafeCSS:`
|
|
3847
|
+
}`}var $G=new WeakMap;function eK(e){let t=$G.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(yW,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),$G.set(e,i),i}function tK(e,t){if(!e.isConnected)return;let n=eK(t);if(n==null)return;let r=t.querySelector(`style[${bW}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(bW,``),t.appendChild(i)),i.textContent=`:host { ${xW}: ${n}px; }`}var nK;function rK(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){nK??(nK=new CSSStyleSheet,nK.replaceSync(ZG(YG)));let t=!1;try{e.adoptedStyleSheets=[nK],t=!0}catch{}if(t){e.querySelector(`style[${_W}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(_W,``),t.textContent=ZG(YG),e.prepend(t)}}function iK(e,t){aK(e,t),rK(t),tK(e,t)}function aK(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});iK(this,e)}}if(customElements.define(gW,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(gW)))e instanceof HTMLElement&&iK(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var oK=5,sK=1<<oK,cK=sK*4;function lK(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function uK(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function dK(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function fK(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function pK(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function mK(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function hK(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,yK(e,t)}function gK(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=fK(e).get(t);if(i===void 0)return;let a=i>>oK;e.childVisibleChunkSums[a]+=r}function _K(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=bK(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=sK}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function vK(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>oK;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<oK}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function yK(e,t){if(t.childIds.length<cK){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/sK),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>oK]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function bK(e,t,n,r){let i=Math.min(t.childIds.length,n+sK),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var xK=7,SK=3,CK=1<<SK,wK=4;function TK(e,t,n=0){return e<<wK|n<<SK|t}function EK(e){return e.depthAndFlags>>>wK}function DK(e){return(e.depthAndFlags&CK)>>SK}function OK(e){return(e.depthAndFlags&CK)!==0}function kK(e){return e.depthAndFlags&xK}function AK(e,t){return(kK(e)&t)!==0}function jK(e,t){e.depthAndFlags|=t}function MK(e,t){e.depthAndFlags=TK(t,kK(e),DK(e))}var NK=Symbol(`benchmarkInstrumentation`);function PK(e,t){return t==null||Object.defineProperty(e,NK,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function FK(e){return e==null?null:e[NK]??null}function Q(e,t,n){return e==null?n():e.measurePhase(t,n)}function IK(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function LK(e){return e>=48&&e<=57}function RK(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!LK(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&LK(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function zK(e){let t=e.toLowerCase();return{lowerValue:t,tokens:RK(t)}}function BK(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function VK(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=BK(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function HK(e,t,n){let r=VK(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function UK(e,t){return HK(e,t,zK)}function WK(e,t){return t===e.segments.length-1?e.isDirectory?1:0:1}function GK(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=WK(e,r);return a===WK(t,r)?UK(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function KK(e,t){return GK(e,t)}function qK(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=zK(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=WK(e,n);return o===WK(t,n)?HK(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function JK(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=zK(r);return e.sortKeyById[t]=i,i}function YK(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function XK(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function ZK(e){let{hasTrailingSlash:t,segments:n}=XK(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function QK(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=XK(e);return{requiresDirectory:t,segments:n}}var $K=``;function eq(){let e=new Map;return e.set($K,0),{idByValue:e,valueById:[$K],sortKeyById:[zK($K)]}}function tq(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function nq(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var rq=Symbol(`pathStorePreparedInputKind`);function iq(e,t){return e[rq]=t,e}function aq(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function oq(e,t,n){return n===`default`?KK(e,t):n(aq(e),aq(t))}function sq(){return{depthAndFlags:TK(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function cq(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function lq(e){return e.isDirectory?e.segments.length:e.segments.length-1}function uq(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function dq(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function fq(e,t={}){return vq(e,t).map(e=>e.path)}function pq(e,t={}){let n=vq(e,t);return iq({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function mq(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return iq({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function hq(e){let t=e,n=t.preparedPaths;if(t[rq]===`prepared`&&n!=null)return n;if(!uq(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function gq(e){let t=e;return t[rq]===`presorted`&&t.presortedPaths!=null||dq(t.presortedPaths)?t.presortedPaths:null}function _q(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function vq(e,t={}){let n=YK(t),r=FK(t);IK(r,`workload.inputFiles`,e.length);let i=Q(r,`store.preparePathEntries.parse`,()=>e.map(e=>ZK(e)));return Q(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>oq(e,t,n.sort))),i}var yq=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[sq()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=eq();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=FK(e),this.options=YK(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,lK())}appendPaths(e){return Q(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>ZK(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,Q(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return Q(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null)if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:TK(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:TK(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:TK(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=ZK(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null)if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:TK(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:TK(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=ZK(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(Q(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||Q(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort===`default`?qK(this.lastPreparedPath,e,this.segmentSortKeyCache):oq(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=lq(e),i=n==null?0:lq(n),a=n==null?0:cq(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=tq(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:TK(EK(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),pK(i,s),s}createFileChildUnchecked(e,t){let n=tq(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:TK(EK(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),pK(r,a),a}getOrCreateDirectoryChild(e,t){let n=tq(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!OK(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:TK(EK(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),pK(r,a),this.directories.set(a,lK()),a}createDirectoryChild(e,t){let n=tq(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:TK(EK(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),pK(r,a),this.directories.set(a,lK()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!OK(n))throw Error(`Path is not a directory: "${t}"`);if(AK(n,1))throw Error(`Duplicate path: "${t}"`);jK(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,uK());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(OK(a)){let t=uK();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;OK(n)&&this.directories.set(t,lK());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),pK(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!OK(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return hK(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function bq(e,t=`closed`,n=null){let r=Sq(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function xq(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function Sq(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function Cq(e,t){return AK(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:EK(t)<=e.defaultExpansion}function wq(e,t,n=e.snapshot.nodes[t]){return n==null||!OK(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:Cq(e,n)}function Tq(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!OK(r))return;let i=Cq(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function Eq(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function Dq(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function Oq(e,t){let n=Eq(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function kq(e,t){let n=Eq(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function Aq(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function jq(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function Mq(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function Nq(e,t){e.directoryLoadInfoById.delete(t)}function Pq(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function Fq(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Iq(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function Lq(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function Rq(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function zq(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Bq(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Vq(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function Hq(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Uq(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Wq(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Gq(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function Kq(e,t,n){return{...n,visibleCountDelta:rJ(e)-t}}function qq(e,t){let n=rJ(e),r=xq();e.transactionStack.push(r);try{t()}catch(t){throw Xq(e,r,!1),t}Xq(e,r,!0,rJ(e)-n)}function Jq(e,t){let n=e.instrumentation;if(n==null){Yq(e,t);return}Q(n,`store.events.record`,()=>Yq(e,t))}function Yq(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){tJ(e,t);return}n.events.push(t),eJ(n,t)}function Xq(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?$q(i,t):Q(n,`store.events.batch.merge`,()=>$q(i,t));return}let a=Zq(t,r),o=e.instrumentation;if(o==null){tJ(e,a);return}Q(o,`store.events.batch.commit`,()=>tJ(e,a))}function Zq(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function Qq(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function $q(e,t){for(let n of t.events)e.events.push(n);Qq(e,t)}function eJ(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function tJ(e,t){let n=e.instrumentation;if(n==null){nJ(e,t);return}Q(n,`store.events.emit`,()=>nJ(e,t))}function nJ(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function rJ(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function iJ(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!OK(n)||AK(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!OK(a)?null:i}function aJ(e,t){let n=t;for(;;){let t=iJ(e,n);if(t==null)return n;n=t}}function oJ(e,t){let n=[t],r=t;for(;;){let t=iJ(e,r);if(t==null)return n;n.push(t),r=t}}function sJ(e,t){let n=t==null?e.snapshot.rootId:_J(e,t);return n==null?[]:xJ(e,n)}function cJ(e,t){let n=ZK(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=IJ(e,FJ(e,r)),{createdNodeIds:a,directoryId:o}=SJ(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=bJ(e,o);if(AK(n,1))throw Error(`Path already exists: "${t}"`);jK(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=wJ(e,o,n.basename),s.add(c);mJ(e,o);let l=IJ(e,o);return Fq({affectedAncestorIds:gJ(e,c),affectedNodeIds:[...s],path:t,projectionChanged:LJ(i,l)})}function lJ(e,t,n){let r=_J(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=bJ(e,r);if(AK(i,2))throw Error(`The root node cannot be removed`);if(OK(i)&&yJ(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=IJ(e,a),s=NJ(e,r);DJ(e,a,r,i.nameId),PJ(e,a),mJ(e,a);let c=IJ(e,a);return Iq({affectedAncestorIds:gJ(e,a),affectedNodeIds:s,path:t,projectionChanged:LJ(o,c),recursive:n.recursive===!0})}function uJ(e,t,n,r){let i=_J(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=bJ(e,i);if(AK(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=jJ(e,i,n),c=IJ(e,a.parentId),l=IJ(e,s.parentId),u=nq(e.snapshot.segmentTable,a.nameId),d=tq(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(OK(a)&&VJ(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=dK(e.snapshot.nodes,yJ(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&MJ(e,p,o,DK(a))===`skip`)return null;let m=a.parentId;DJ(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),BJ(e,i),EJ(e,s.parentId,i),PJ(e,m),e.pathCacheVersion++,mJ(e,m),s.parentId!==m&&mJ(e,s.parentId);let h=IJ(e,m),g=IJ(e,s.parentId);return Lq({affectedAncestorIds:[...new Set([...gJ(e,m),...gJ(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:RJ([c,l],[h,g]),to:pJ(e,i)})}function dJ(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function fJ(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function pJ(e,t){let n=bJ(e,t),r=dJ(e,t);if(r!=null)return r;if(AK(n,2))return fJ(e,t,``);let i=pJ(e,n.parentId),a=nq(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return fJ(e,t,OK(n)?`${o}/`:o)}function mJ(e,t){let n=e.instrumentation;if(n==null){UJ(e,t);return}Q(n,`store.recomputeCountsUpwardFrom`,()=>UJ(e,t))}function hJ(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!OK(o)){HJ(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){HJ(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function gJ(e,t){let n=[],r=t;for(;r!=null;){let t=bJ(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function _J(e,t){if(t.length===0)return e.snapshot.rootId;let n=QK(t);return vJ(e,n.segments,n.requiresDirectory)}function vJ(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=yJ(e,r),a=dK(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=bJ(e,r);return n&&!OK(i)?null:r}function yJ(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function bJ(e,t){let n=e.snapshot.nodes[t];if(n===void 0||AK(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function xJ(e,t){let n=e.snapshot.nodes[t];if(n===void 0||AK(n,4))return[];if(!OK(n))return[pJ(e,t)];if(yJ(e,t).childIds.length===0)return AK(n,1)&&!AK(n,2)?[pJ(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||AK(n,4)){i.pop();continue}if(!OK(n)){r.push(pJ(e,t.nodeId)),i.pop();continue}let a=yJ(e,t.nodeId);if(a.childIds.length===0){AK(n,1)&&!AK(n,2)&&r.push(pJ(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function SJ(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=tq(e.snapshot.segmentTable,i),a=yJ(e,r),o=dK(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!OK(bJ(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=CJ(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function CJ(e,t,n){let r=bJ(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:TK(EK(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,lK()),EJ(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function wJ(e,t,n){let r=tq(e.snapshot.segmentTable,n),i=yJ(e,t);if(dK(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${GJ(e,t,n)}"`);let a=bJ(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:TK(EK(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),EJ(e,t,o),e.activeNodeCount++,o}function TJ(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}OJ(e,n,o)<0?i=a:r=a+1}return r}function EJ(e,t,n){let r=yJ(e,t),i=bJ(e,n);dK(e.snapshot.nodes,r).set(i.nameId,n),gK(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=TJ(e,r,n);r.childIds.splice(a,0,n),mK(r,a),yK(e.snapshot.nodes,r)}function DJ(e,t,n,r){let i=yJ(e,t),a=fK(i),o=a.get(n)??-1;dK(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&gK(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),mK(i,o),yK(e.snapshot.nodes,i))}function OJ(e,t,n){let r=e.snapshot.options.sort;return r===`default`?kJ(e,t,n):r(AJ(e,t),AJ(e,n))}function kJ(e,t,n){let r=bJ(e,t),i=bJ(e,n),a=OK(r);if(a!==OK(i))return a?-1:1;let o=VK(JK(e.snapshot.segmentTable,r.nameId),JK(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=nq(e.snapshot.segmentTable,r.nameId),c=nq(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function AJ(e,t){let n=bJ(e,t),r=pJ(e,t),i=OK(n),a=i?r.slice(0,-1):r;return{basename:nq(e.snapshot.segmentTable,n.nameId),depth:EK(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function jJ(e,t,n){let r=bJ(e,t),i=_J(e,n);if(i!=null){let t=bJ(e,i);if(OK(t))return{basename:nq(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=QK(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=QK(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:vJ(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function MJ(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${pJ(e,t)}"`);let i=bJ(e,t);if(DK(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(OK(i)&&yJ(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return NJ(e,t),DJ(e,a,t,o),PJ(e,a),mJ(e,a),`handled`}function NJ(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=bJ(e,t.nodeId);if(t.visitedChildren||!OK(i)){OK(i)&&e.snapshot.directories.delete(t.nodeId),jK(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),Nq(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=yJ(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function PJ(e,t){let n=t;for(;n!=null;){let t=bJ(e,n);if(!OK(t)||AK(t,2)||yJ(e,n).childIds.length>0)return;jK(t,1),n=t.parentId===n?null:t.parentId}}function FJ(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=dK(e.snapshot.nodes,yJ(e,n)).get(t);if(i==null||!OK(bJ(e,i)))break;n=i}return n}function IJ(e,t){let n=zJ(e,t);if(n==null)return null;let r=aJ(e,n),i=bJ(e,r),a=n===r?null:oJ(e,n).map(t=>pJ(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:yJ(e,r).childIds.length>0,path:pJ(e,r),terminalKind:DK(i)})}function LJ(e,t){return RJ([e],[t])}function RJ(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function zJ(e,t){let n=t;for(;n!=null;){let t=bJ(e,n);if(!OK(t)||AK(t,2))return null;if(!wq(e,n,t))return n;n=t.parentId}return null}function BJ(e,t){let n=bJ(e,t);if(MK(n,(t===e.snapshot.rootId?-1:EK(bJ(e,n.parentId)))+1),!OK(n))return;let r=yJ(e,t);for(let t of r.childIds)BJ(e,t)}function VJ(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=bJ(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function HJ(e,t,n=bJ(e,t),r=!1){let i=e.instrumentation;if(i==null){WJ(e,t,n,r);return}Q(i,`store.recomputeNodeCounts`,()=>WJ(e,t,n,r))}function UJ(e,t){let n=t;for(;n!=null;){let t=bJ(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(HJ(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&gK(yJ(e,s),n,a,o),n=s}}function WJ(e,t,n,r){if(!OK(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=yJ(e,t);if(r){let t=e.instrumentation;t==null?hK(e.snapshot.nodes,i):Q(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>hK(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,AK(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=iJ(e,t)==null?wq(e,t,n)?1+o:1:o}function GJ(e,t,n){let r=pJ(e,t);return r.length===0?n:`${r}${n}`}function KJ(e){return e!=null&&!AK(e,4)}function qJ(e,t){let n=e.snapshot.nodes[t];return!KJ(n)||!OK(n)||AK(n,2)?null:n}function JJ(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&KJ(e.snapshot.nodes[n])&&(t+=1);return t}function YJ(e){return Math.max(0,e.valueById.length-1)}function XJ(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:JJ(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:YJ(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function ZJ(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function QJ(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)qJ(e,n)!=null&&t.push(pJ(e,n));for(let t of e.expandedDirectoryIds)qJ(e,t)!=null&&n.push(pJ(e,t));return{collapsedPaths:t,expandedPaths:n}}function $J(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)qJ(e,n)==null||Dq(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:pJ(e,n)});return t}function eY(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=_J(e,n);t!=null&&Tq(e,t,!0,bJ(e,t))}for(let n of t.collapsedPaths){let t=_J(e,n);t!=null&&Tq(e,t,!1,bJ(e,t))}}function tY(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=_J(e,n.path);t!=null&&qJ(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function nY(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function rY(e){let t=e.snapshot.segmentTable,n=eq();for(let r of e.snapshot.nodes)if(KJ(r)){if(AK(r,2)){r.nameId=0;continue}r.nameId=tq(n,nq(t,r.nameId))}e.snapshot.segmentTable=n}function iY(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!KJ(r)||!OK(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return KJ(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[bJ(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),hK(e.snapshot.nodes,n)}}function aY(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(KJ(n))break;--t}e.snapshot.nodes.length=t+1}function oY(e){let t=QJ(e),n=$J(e);Q(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>nY(e)),Q(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>rY(e)),Q(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>iY(e)),Q(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>aY(e)),Q(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>eY(e,t)),Q(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>tY(e,n)),Q(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>hJ(e,e.snapshot.rootId))}function sY(e){let t=QJ(e),n=$J(e),r=Q(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>sJ(e)),i=PK({...e.snapshot.options},e.instrumentation),a=Q(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new yq(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,Q(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>eY(e,t)),Q(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>tY(e,n)),Q(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>hJ(e,e.snapshot.rootId))}function cY(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function lY(e,t){let n=XJ(e);t===`stable`?Q(e.instrumentation,`store.cleanup.stable`,()=>oY(e)):Q(e.instrumentation,`store.cleanup.aggressive`,()=>sY(e));let r=XJ(e);return ZJ(t,t===`stable`,n,r)}var uY=64;function dY(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function fY(e){return bJ(e,e.snapshot.rootId).visibleSubtreeCount}function pY(e,t,n,r){let i=bJ(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function mY(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:NY(e,t.cursor),setSize:t.setSize,subtreeEndIndex:pY(e,t.cursor,t.index,n)}}function hY(e,t,n,r,i,a){let o=yJ(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=_K(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return gY(e,u,l,r+c,i+1,s,o.childIds.length,a)}function gY(e,t,n,r,i,a,o,s){if(!OK(bJ(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=DY(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=bJ(e,c.terminalNodeId);if(!OK(l)||!wq(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return hY(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function _Y(e,t){let n=fY(e);if(t<0||t>=n)return null;let r=hY(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>pJ(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=mY(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:NY(e,r.cursor),setSize:r.setSize,subtreeEndIndex:pY(e,r.cursor,r.index,n)}}function vY(e,t,n){let r=e.instrumentation,i=fY(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return MY(e,o+1);let t=[],n=wY(e,a);for(let r=a;r<=o&&n!=null;r++){let r=NY(e,n);t.push(r),n=kY(e,n)}return t}let s=[],c=0,l=0,u=Q(r,`store.getVisibleSlice.selectFirstRow`,()=>wY(e,a));for(let t=a;t<=o&&u!=null;t++){let t=Q(r,`store.getVisibleSlice.materializeRow`,()=>NY(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=Q(r,`store.getVisibleSlice.advanceCursor`,()=>kY(e,u))}return IK(r,`workload.visibleRowsRead`,s.length),IK(r,`workload.flattenedRowsRead`,c),IK(r,`workload.flattenedSegmentsRead`,l),s}function yY(e,t=fY(e)){let n=e.instrumentation;return n==null?jY(e,t):Q(n,`store.getVisibleTreeProjection`,()=>jY(e,t))}function bY(e){return AY(yY(e))}function xY(e,t){let n=_J(e,t);if(n==null||n===e.snapshot.rootId||OK(bJ(e,n))&&aJ(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=bJ(e,i).parentId,n=yJ(e,t),s=fK(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=vK(a,n,s),t!==o){let n=bJ(e,t),a=iJ(e,t);if(!wq(e,t,n)&&a!==i)return null;aJ(e,t)===t&&(r+=1)}i=t}return r}function SY(e,t){let n=_J(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=bJ(e,n);if(!OK(r))throw Error(`Path is not a directory: "${t}"`);return wq(e,n,r)?null:(Tq(e,n,!0,r),mJ(e,n),Rq({affectedAncestorIds:gJ(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function CY(e,t){let n=_J(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=bJ(e,n);if(!OK(r))throw Error(`Path is not a directory: "${t}"`);return wq(e,n,r)?(Tq(e,n,!1,r),mJ(e,n),zq({affectedAncestorIds:gJ(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function wY(e,t){return t<0||t>=fY(e)?null:TY(e,e.snapshot.rootId,t,-1)}function TY(e,t,n,r){let i=yJ(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?_K(e.snapshot.nodes,i,n):Q(a,`store.getVisibleSlice.selectChildIndex`,()=>_K(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return EY(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function EY(e,t,n,r){if(!OK(bJ(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=DY(e,t,r);if(n===0)return i;let a=bJ(e,i.terminalNodeId);if(!OK(a)||!wq(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return TY(e,i.terminalNodeId,n-1,i.visibleDepth)}function DY(e,t,n){return OK(bJ(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:aJ(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:Q(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>aJ(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function OY(e,t){let n=bJ(e,t);if(!OK(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:iJ(e,r)!==t}function kY(e,t){let n=bJ(e,t.terminalNodeId);if(OK(n)){let r=yJ(e,t.terminalNodeId);if(wq(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:EY(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=bJ(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=yJ(e,n),o=fK(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return EY(e,s,0,i);OY(e,r)&&i--,r=n}}function AY(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function jY(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(uY);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=dY(o,y);let x,S=_;if(OK(v))S=f?aJ(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:pJ(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&OK(C)&&wq(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function MY(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!OK(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:pJ(e,f)};continue}let h=l?aJ(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=NY(e,g);let _=i[h];_!=null&&OK(_)&&wq(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function NY(e,t){let n=bJ(e,t.terminalNodeId),r=OK(n)?PY(e,t):null,i=pJ(e,t.terminalNodeId),a=nq(e.snapshot.segmentTable,n.nameId),o=OK(n)&&yJ(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?oJ(e,t.headNodeId).map(n=>{let r=bJ(e,n);return{isTerminal:n===t.terminalNodeId,name:nq(e.snapshot.segmentTable,r.nameId),nodeId:n,path:pJ(e,n)}}):Q(c,`store.getVisibleSlice.flatten.collectSegments`,()=>oJ(e,t.headNodeId).map(n=>{let r=bJ(e,n);return{isTerminal:n===t.terminalNodeId,name:nq(e.snapshot.segmentTable,r.nameId),nodeId:n,path:pJ(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:OK(n)&&wq(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:OK(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function PY(e,t){if(t.headNodeId===t.terminalNodeId)return Dq(e,t.terminalNodeId);let n=oJ(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=Dq(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function FY(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!OK(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&yK(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&OK(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,yK(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function IY(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var LY=class e{#e;constructor(e={}){let t=FK(e),n=Q(t,`store.builder.create`,()=>new yq(e));if(e.preparedInput!=null){let t=gq(e.preparedInput);t==null?n.appendPreparedPaths(hq(e.preparedInput),!1):n.appendPresortedPaths(t,_q(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(Q(t,`store.preparePathEntries`,()=>vq(r,e)))}let r=Q(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=Q(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=Q(t,`store.state.create`,()=>bq(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:Q(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||IY(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&Q(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?Q(t,`store.state.initializeOpenVisibleCounts`,()=>FY(this.#e)):Q(t,`store.state.recomputeCounts`,()=>hJ(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return fq(e,t)}static prepareInput(e,t={}){return pq(e,t)}static preparePresortedInput(e){return mq(e)}list(e){return Q(this.#e.instrumentation,`store.list`,()=>sJ(this.#e,e))}add(e){Q(this.#e.instrumentation,`store.add`,()=>{let t=fY(this.#e);Jq(this.#e,Kq(this.#e,t,cJ(this.#e,e)))})}remove(e,t={}){Q(this.#e.instrumentation,`store.remove`,()=>{let n=fY(this.#e);Jq(this.#e,Kq(this.#e,n,lJ(this.#e,e,t)))})}move(e,t,n={}){Q(this.#e.instrumentation,`store.move`,()=>{let r=fY(this.#e),i=uJ(this.#e,e,t,n);i!=null&&Jq(this.#e,Kq(this.#e,r,i))})}batch(e){qq(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return Q(this.#e.instrumentation,`store.getVisibleCount`,()=>fY(this.#e))}getVisibleSlice(e,t){return Q(this.#e.instrumentation,`store.getVisibleSlice`,()=>vY(this.#e,e,t))}getVisibleRowContext(e){return Q(this.#e.instrumentation,`store.getVisibleRowContext`,()=>_Y(this.#e,e))}getVisibleTreeProjection(){return bY(this.#e)}getVisibleTreeProjectionData(e){return yY(this.#e,e)}getVisibleIndex(e){return Q(this.#e.instrumentation,`store.getVisibleIndex`,()=>xY(this.#e,e))}getPathInfo(e){return Q(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=_J(this.#e,e);if(t==null)return null;let n=bJ(this.#e,t);return{depth:EK(n),kind:OK(n)?`directory`:`file`,path:pJ(this.#e,t)}})}isExpanded(e){return Q(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=bJ(this.#e,t);return wq(this.#e,t,n)})}expand(e){Q(this.#e.instrumentation,`store.expand`,()=>{let t=fY(this.#e),n=SY(this.#e,e);n!=null&&Jq(this.#e,Kq(this.#e,t,n))})}collapse(e){Q(this.#e.instrumentation,`store.collapse`,()=>{let t=fY(this.#e),n=CY(this.#e,e);n!=null&&Jq(this.#e,Kq(this.#e,t,n))})}on(e,t){return Pq(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return Dq(this.#e,t)}markDirectoryUnloaded(e){Q(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(yJ(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=fY(this.#e);kq(this.#e,t),Jq(this.#e,Kq(this.#e,n,Bq({affectedAncestorIds:gJ(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return Q(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=fY(this.#e),r=Oq(this.#e,t);return Jq(this.#e,Kq(this.#e,n,Vq({affectedAncestorIds:gJ(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return Q(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||Dq(this.#e,n)!==`loading`||!jq(this.#e,n,e.attemptId))return!1;let r=pJ(this.#e,n);this.validateChildPatch(r,t);let i=fY(this.#e),a=[];for(let e of t.operations){RY(r,e);let t=fY(this.#e);switch(e.type){case`add`:a.push(Kq(this.#e,t,cJ(this.#e,e.path)));break;case`remove`:a.push(Kq(this.#e,t,lJ(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=uJ(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(Kq(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return Jq(this.#e,Kq(this.#e,i,Hq({affectedAncestorIds:gJ(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:pJ(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return Q(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=fY(this.#e),r=Aq(this.#e,t,e.attemptId);return Jq(this.#e,Kq(this.#e,n,Uq({affectedAncestorIds:gJ(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:pJ(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return Q(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=fY(this.#e),i=Mq(this.#e,n,e.attemptId,t);return Jq(this.#e,Kq(this.#e,r,Wq({affectedAncestorIds:gJ(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:pJ(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return Q(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(cY(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=fY(this.#e),n=lY(this.#e,e.mode??`stable`);return Jq(this.#e,Kq(this.#e,t,Gq({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=yJ(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??zK(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=VK(JK(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!OK(bJ(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=bJ(this.#e,n);wq(this.#e,n,i)||(Tq(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=bJ(this.#e,e);if(!wq(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=_J(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!OK(bJ(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!OK(bJ(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=bJ(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=bJ(this.#e,e),r=iJ(this.#e,e);if(!wq(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function RY(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`);break}}var zY=e=>e.startsWith(`f::`)?e.slice(3):e;function BY(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function VY(e,t){return e===``?t:`${e}/${t}`}function HY({files:e,path:t,isFolder:n,nextBasename:r}){let i=zY(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=BY(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=VY(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function UY(e){return e.endsWith(`/`)}function WY(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function GY(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function KY(e,t){return t.includes(e)?GY(t):[e]}function qY(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function JY(e,t){return{draggedPaths:e,target:t}}function YY(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(UY(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function XY(e,t){return t.kind===`root`||t.directoryPath==null?WY(e):t.directoryPath}function ZY(e,t){let n=e.map(e=>{let n=XY(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function QY(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function $Y(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!QY(LY.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function eX(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function tX(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function nX(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function rX(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return nX(e,t.path)?n?e:null:e;case`move`:return tX(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=rX(r,e,n),r==null)return null;return r}}}function iX(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function aX(e){switch(e.operation){case`add`:return{...iX(e),operation:`add`,path:e.path};case`remove`:return{...iX(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...iX(e),from:e.from,operation:`move`,to:e.to}}}function oX(e){return{...iX(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>aX(e)),operation:`batch`}}function sX(e){switch(e.operation){case`add`:case`remove`:case`move`:return aX(e);case`batch`:return oX(e);default:return null}}function cX(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function lX(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function uX(e){return lX(e).at(-1)??null}function dX(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function fX(e){return e.endsWith(`/`)}var pX=e=>e.toLowerCase();function mX(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function hX(e){return e.endsWith(`/`)?e.slice(0,-1):e}function gX(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var _X=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},vX=Symbol(`FILE_TREE_RENAME_VIEW`),yX=512,bX=512;function xX(e){return e===`top`||e===`center`?e:`nearest`}function SX(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=lX(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function CX(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:SX(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var wX=class{#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=$Y({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=uX(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:xX(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=bX){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t==null||!this.#B.has(t)||this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=KY(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=JY(t.draggedPaths,n);(YY(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}qY(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=JY(e.draggedPaths,t);if(YY(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=ZY(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=fX(r),a=hX(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of lX(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=mX(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}[vX](){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,fX(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,fX(e)?{recursive:!0}:void 0);return}let t=fX(e),n=HY({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:hX(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(gX(n.sourcePath,t),gX(n.destinationPath,t))}#Y(e){this.#T==null||this.#E===e||(this.#E=e,this.#De())}resetPaths(e,t={}){let n=this.#H.list().length,r=this.#G,i=$Y({paths:e,preparedInput:t.preparedInput},`resetPaths`,this.#e.sort),a=this.#le(i.paths,i.preparedInput,t.initialExpandedPaths),o=this.#c,s=this.#T,c=this.getSelectedPaths(),l=this.#z;this.#K?.(),this.#H=a,this.#d.clear(),this.#he();let u=c.map(e=>a.getPathInfo(e)?.path??null).filter(e=>e!=null),d=!cX(this.#B,u);this.#B=new Set(u),d&&(this.#V+=1),this.#z=l==null?null:a.getPathInfo(l)?.path??null,this.#T=s==null?null:a.getPathInfo(s)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(o,o!=null||u.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:i.paths.length,pathCountBefore:n,projectionChanged:!0,usedPreparedInput:t.preparedInput!=null,visibleCountDelta:this.#G-r})}#X(e){this.#Ie();let t=uX(e),n=dX(e,t),r=null,i=null;for(let e of this.#be()){if(uX(e)!==t)continue;let a=dX(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=lX(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!cX(this.#B,r),a=this.#z!==t;!i&&!a||(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new LY({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of lX(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(pX),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(pX),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of lX(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:_X(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of lX(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of lX(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=CX(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,yX)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s===e&&this.#c===n||(this.#s=e,this.#c=n,t&&this.#De()))}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=rX(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=rX(this.#c,e,!0),r=[...this.#B].map(t=>rX(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=rX(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return cX(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&eX(e)&&(this.#i=null);let t=eX(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=sX(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},TX=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function EX(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(!(e[t]===`/`||t===e.length)){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function DX(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function OX(e,t){return t?`${e}/`:e}function kX(e,t=null){let n=TX(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set;for(let t of e??[]){let e=EX(t.path);if(e==null)continue;let n=OX(e.path,e.isDirectory);r.set(n,t.status),t.status===`ignored`&&e.isDirectory?a.add(n):e.isDirectory&&a.delete(n);for(let t of DX(e.path))i.add(t)}return{directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}var AX=e=>e.trim().toLowerCase(),jX=e=>e.split(`/`).at(-1)??e,MX=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function NX(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function PX(e){let t=GG(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(AX(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let n=jX(o),s=n.toLowerCase(),c=r.get(s);if(c!=null)return NX(c,e);for(let[t,n]of a)if(s.includes(t))return NX(n,e);let l=MX(n);for(let t of l){let n=i.get(t);if(n!=null)return NX(n,e)}let u=UG(t.set,n,l);if(u!=null&&t.set!==`none`)return{name:VG(u),remappedFrom:e,token:u}}let s=n?.[e];return s==null?{name:e}:NX(s,e)}}}var FX,IX,LX,RX,zX,BX,VX,HX,UX,WX,GX={},KX=[],qX=Array.isArray,JX=KX.slice,YX=Object.assign;function XX(e){e&&e.parentNode&&e.remove()}function ZX(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?JX.call(arguments,2):n),QX(e,o,r,i,null)}function QX(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++IX,__i:-1,__u:0};return i==null&&FX.vnode!=null&&FX.vnode(a),a}function $X(e){return e.children}function eZ(e,t){this.props=e,this.context=t,this.__g=0}function tZ(e,t){if(t==null)return e.__?tZ(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?tZ(e):null}function nZ(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return nZ(e)}}function rZ(e){(8&e.__g||!(e.__g|=8)||!LX.push(e)||zX++)&&RX==FX.debounceRendering||((RX=FX.debounceRendering)||queueMicrotask)(iZ)}function iZ(){for(var e,t,n,r,i,a,o,s,c=1;LX.length;)LX.length>c&&LX.sort(BX),e=LX.shift(),c=LX.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=YX({},r)).__v=r.__v+1,FX.vnode&&FX.vnode(n),fZ(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??tZ(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,mZ(a,n,o),n.__e!=i&&nZ(n)));zX=0}function aZ(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||KX,b=t.length;for(c=oZ(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?GX:y[m.__i]||GX,m.__i=f,_=fZ(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&_Z(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=sZ(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function oZ(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?QX(null,o,null,null,null):qX(o)?QX($X,{children:o},null,null,null):o.constructor==null&&o.__b>0?QX(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=cZ(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=tZ(s)),vZ(s,s));return r}function sZ(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=sZ(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=tZ(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function cZ(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>(u?1:0)){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function lZ(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function uZ(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||lZ(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||lZ(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(VX,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=HX,e.addEventListener(t,a?WX:UX,a)):e.removeEventListener(t,a?WX:UX,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function dZ(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=HX++;else if(t.u<n.l)return;return n(FX.event?FX.event(t):t)}}}function fZ(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=FX.__b)&&d(t);n:if(typeof M==`function`)try{if(v=t.props,y=`prototype`in M&&M.prototype.render,b=(d=M.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new M(v,x):(t.__c=f=new eZ(v,x),f.constructor=M,f.render=yZ),b&&b.sub(f),f.props=v,f.state||={},f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=YX({},f.__s)),YX(f.__s,M.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&M.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=FX.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=YX({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===$X&&d.key==null&&(E=hZ(d.props.children)),s=aZ(e,qX(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(D=0,O=!1,t.__u|=c?160:128,t.__c.__z=[],k=0;k<a.length;k++)(A=a[k])==null||O||(A.nodeType==8&&A.data==`$s`?(D>0&&t.__c.__z.push(A),D++,a[k]=null):A.nodeType==8&&A.data==`/$s`?(--D>0&&t.__c.__z.push(A),O=D===0,s=a[k],a[k]=null):D>0&&(t.__c.__z.push(A),a[k]=null));if(!O){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(j=a.length;j--;)XX(a[j]);pZ(t)}else t.__e=n.__e,t.__k=n.__k,e.then||pZ(t);FX.__e(e,t,n)}else s=t.__e=gZ(n.__e,t,n,r,i,a,o,c,l,u);return(d=FX.diffed)&&d(t),128&t.__u?void 0:s}function pZ(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(pZ)}function mZ(e,t,n){for(var r=0;r<n.length;r++)_Z(n[r],n[++r],n[++r]);FX.__c&&FX.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){FX.__e(e,t.__v)}})}function hZ(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:qX(e)?e.map(hZ):YX({},e)}function gZ(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(FX.__m&&FX.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=JX.call(e.childNodes),v=n.props||GX,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;uZ(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||uZ(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),aZ(b==`template`?e.content:e,qX(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&tZ(n,0),s,c,l),a!=null)for(u=a.length;u--;)XX(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||uZ(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&uZ(e,u,g,v[u],i))}return e}function _Z(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){FX.__e(e,n)}}function vZ(e,t,n){var r,i;if(FX.unmount&&FX.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||_Z(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){FX.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&vZ(r[i],t,n||typeof e.type!=`function`);n||XX(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function yZ(e,t,n){return this.constructor(e,n)}function bZ(e,t){var n,r,i,a;t==document&&(t=document.documentElement),FX.__&&FX.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=ZX($X,null,[e]),i=[],a=[],fZ(t,e,r||GX,GX,t.namespaceURI,r?null:t.firstChild?JX.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),mZ(i,e,a)}function xZ(e,t){e.__u|=32,bZ(e,t)}FX={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw zX=0,e}},IX=0,eZ.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=YX({},this.state);typeof e==`function`&&(e=e(YX({},n),this.props)),e&&YX(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),rZ(this))},eZ.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),rZ(this))},eZ.prototype.render=$X,LX=[],zX=0,BX=function(e,t){return e.__v.__b-t.__v.__b},VX=/(PointerCapture)$|Capture$/i,HX=0,UX=dZ(!1),WX=dZ(!0);var SZ=0;Array.isArray;function $(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--SZ,__i:-1,__u:0,__source:i,__self:a};return FX.vnode&&FX.vnode(l),l}var CZ=16,wZ=16,TZ={};function EZ({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=TZ[e]??{width:CZ,height:wZ},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`,h=o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`};return $(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...h,viewBox:m,width:f,height:p,children:$(`use`,{href:c})})}var DZ=e=>{if(e.length<2)return[e,``];let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]},OZ=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},kZ=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},AZ=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},jZ=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},MZ=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function NZ({children:e,marker:t,variant:n=`default`}){"use no memo";let r=n===`fade`;return $(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:$(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):r?$(`span`,{"data-truncate-fade":!0}):t})})}function PZ(e){"use no memo";let{mode:t,children:n}=e;return $(`div`,{children:[$(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?$(`span`,{children:n}):n}),$(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?$(`span`,{children:n}):n})]})}function FZ({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=$(PZ,{mode:t,children:e},`content`),o=$(NZ,{marker:n,mode:t,variant:r},`marker`),s=$(`div`,{"data-truncate-fill":!0},`fill`);return $(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:$(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function IZ({children:e,...t}){"use no memo";return $(FZ,{mode:`truncate`,...t,children:e})}function LZ({children:e,...t}){"use no memo";return $(FZ,{mode:`fruncate`,...t,children:e})}function RZ({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=$(IZ,{...s,children:t[0]}),l=$(LZ,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return $(`div`,{className:a,style:o});if(e.length<i)return $(n===`end`?LZ:IZ,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=DZ:r===`extension`?t=OZ:r===`leaf-path`&&(t=kZ);else if(typeof r==`number`)t=AZ,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=jZ:e===`first`&&(t=MZ)}else typeof r==`function`&&(t=r);t??=DZ;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=$(IZ,{...s,..._,children:f}),l=$(LZ,{...s,...v,children:p})}return $(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[$(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),$(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var zZ={endIndex:-1,startIndex:-1};function BZ(e,t,n){return Math.min(Math.max(e,t),n)}function VZ(e,t){return e<0||t<e?zZ:{endIndex:t,startIndex:e}}function HZ(e){return e.startIndex<0||e.endIndex<e.startIndex}function UZ(e,t){return HZ(e)?0:(e.endIndex-e.startIndex+1)*t}function WZ(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function GZ(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function KZ(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function qZ(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function JZ(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function YZ(e,t,n){if(e.length===0||t<=0)return[];let r=JZ(e),i=KZ(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=qZ(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function XZ(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=BZ(t.scrollTop,0,o),c=t.stickyRows??YZ(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=WZ(s,n,t.itemHeight),m=WZ(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?zZ:VZ(m,GZ(u+d,n,t.itemHeight)),y=g+1,b=HZ(v)?zZ:VZ(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=UZ(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:HZ(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var ZZ={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},QZ={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},$Z=`Contains git status items`;function eQ(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function tQ(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return eQ({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function nQ(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function rQ(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function iQ(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function aQ(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function oQ(e,t){return e!=null&&e>0?e:t}function sQ(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function cQ(e,t,n,r,i=0){let a=eQ({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function lQ(e,t,n,r,i,a,o=0){let s=tQ({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s==null?!1:(e.scrollTop=s,!0)}function uQ(e,t,n,r,i,a){let o=nQ({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function dQ(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function fQ(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function pQ({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return $(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function mQ(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function hQ(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var gQ,_Q,vQ,yQ,bQ=Object.is,xQ=0,SQ=[],CQ=FX,wQ=CQ.__b,TQ=CQ.__r,EQ=CQ.diffed,DQ=CQ.__c,OQ=CQ.unmount,kQ=CQ.__;function AQ(e,t){CQ.__h&&CQ.__h(_Q,e,xQ||t),xQ=0;var n=_Q.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function jQ(e){return xQ=1,MQ(WQ,e)}function MQ(e,t,n){var r=AQ(gQ++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):WQ(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);bQ(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=_Q,!_Q.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,bQ(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};_Q.__f=!0;var a=_Q.shouldComponentUpdate,o=_Q.componentWillUpdate;_Q.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},_Q.shouldComponentUpdate=i}return r.__N||r.__}function NQ(e,t){var n=AQ(gQ++,3);!CQ.__s&&UQ(n.__H,t)&&(n.__=e,n.u=t,_Q.__H.__h.push(n))}function PQ(e,t){var n=AQ(gQ++,4);!CQ.__s&&UQ(n.__H,t)&&(n.__=e,n.u=t,_Q.__h.push(n))}function FQ(e){return xQ=5,IQ(function(){return{current:e}},[])}function IQ(e,t){var n=AQ(gQ++,7);return UQ(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function LQ(e,t){return xQ=8,IQ(function(){return e},t)}function RQ(){for(var e;e=SQ.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(VQ),e.__H.__h.forEach(HQ),e.__H.__h=[]}catch(t){e.__H.__h=[],CQ.__e(t,e.__v)}}CQ.__b=function(e){_Q=null,wQ&&wQ(e)},CQ.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),kQ&&kQ(e,t)},CQ.__r=function(e){TQ&&TQ(e),gQ=0;var t=(_Q=e.__c).__H;t&&(vQ===_Q?(t.__h=[],_Q.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(VQ),t.__h.forEach(HQ),t.__h=[],gQ=0)),vQ=_Q},CQ.diffed=function(e){EQ&&EQ(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(SQ.push(t)!==1&&yQ===CQ.requestAnimationFrame||((yQ=CQ.requestAnimationFrame)||BQ)(RQ)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),vQ=_Q=null},CQ.__c=function(e,t){t.some(function(e){try{e.__h.forEach(VQ),e.__h=e.__h.filter(function(e){return!e.__||HQ(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],CQ.__e(n,e.__v)}}),DQ&&DQ(e,t)},CQ.unmount=function(e){OQ&&OQ(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{VQ(e)}catch(e){t=e}}),n.__H=void 0,t&&CQ.__e(t,n.__v))};var zQ=typeof requestAnimationFrame==`function`;function BQ(e){var t,n=function(){clearTimeout(r),zQ&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);zQ&&(t=requestAnimationFrame(n))}function VQ(e){var t=_Q,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),_Q=t}function HQ(e){var t=_Q;e.__c=e.__(),_Q=t}function UQ(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!bQ(t,e[n])})}function WQ(e,t){return typeof t==`function`?t(e):t}function GQ(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:$(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return $($X,{children:[$(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:$(IZ,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function KQ(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function qQ(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function JQ(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function YQ({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=XZ(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:JQ(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?JQ(u,1,t,o):i&&r<=0&&c.length>0?YZ(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var XQ=400,ZQ=10,QQ=40,$Q=18;function e$(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?t$(e,t,n):a instanceof HTMLElement?a:null}function t$(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function n$(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function r$(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function i$(){return navigator.vendor!==`Apple Computer, Inc.`}function a$(e,t){let n=e-t.top;if(n<QQ)return-Math.ceil((QQ-Math.max(0,n))/QQ*$Q);let r=t.bottom-e;return r<QQ?Math.ceil((QQ-Math.max(0,r))/QQ*$Q):0}function o$(e,t){if(e!=null){let t=ZZ[e];return t==null?null:{text:t,title:QZ[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:$Z}:null}function s$(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function c$(e){return e!=null&&`toggle`in e}function l$(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function u$(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function d$(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function f$(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function p$(e,t){return t&&f$(e)||(e.ctrlKey||e.metaKey)&&l$(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var m$=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function h$(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function g$(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function _$(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function v$(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function y$(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function b$(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function x$(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function S$(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function C$(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=S$(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function w$(e,t){return{kind:e.kind,name:qQ(e),path:t}}function T$(e){return e==null?void 0:`${e}__tree`}function E$(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function D$(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function O$(e,t){if(e==null)return null;if(`text`in e)return $(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?D$(e.icon)?t(e.icon):{name:e.icon}:D$(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return $(`span`,{title:e.title,children:$(EZ,{...n})})}function k$(e){e!=null&&rQ(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function A$(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=KQ(e);return $($X,{children:[e.depth>0?$(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>$(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,$(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?$(EZ,{...t(`file-tree-icon-chevron`)}):$(EZ,{...t(`file-tree-icon-file`,u)})}),$(`div`,{"data-item-section":`content`,children:e.isFlattened?GQ(e,c,a):c??$(RZ,{minimumLength:5,split:`extension`,children:e.name})}),i?$(`div`,{"data-item-section":`decoration`,children:r==null?null:O$(r,t)}):null,s?$(`div`,{"data-item-section":`git`,children:O$(o,t)}):null,n?$(`div`,{"data-item-section":`action`,children:l?$(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:$(EZ,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function j$(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:w,contextMenuButtonVisibility:T,contextMenuRightClickEnabled:E,registerRenameInput:D,registerButton:O,resolveIcon:k,renderDecorationForRow:A,openContextMenuForRow:j,onRowClick:M,onKeyDown:N}=e,P=KQ(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,R=I===`sticky`,z=_?.get(P)??null??s$(t.ancestorPaths,v,y),ee=t.kind===`directory`&&(b?.has(P)??!1),te=A(t,P),B=o$(z,ee),V=S&&w,H=te!=null||x||V,ne=V&&T===`always`,re=a.getPath()===P,ie=re?a.getValue():``,ae=R||!re?null:$(pQ,{ref:D,ariaLabel:`Rename ${qQ(t)}`,isFlattened:t.isFlattened,value:ie,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),oe=A$(t,k,{actionLaneEnabled:V,customDecoration:te,decorationLaneEnabled:H,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:B,gitLaneActive:x,renameInput:ae,showDecorativeActionAffordance:ne}),se={...mQ({ariaLabel:qQ(t),domId:t.isFocused?E$(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:V,contextMenuButtonVisibility:V?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:ee,effectiveGitStatus:z,isContextHovered:s===P,isDragTarget:l?.kind===`directory`&&l.directoryPath===P,isDragging:c?.has(P)===!0,isFocusRinged:t.isFocused&&o===P},targetPath:P}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(P),j(t,P,{anchorRect:_$(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:R?void 0:()=>{i.focusMountedPathFromInput(P)},onKeyDown:R?void 0:N,ref:e=>{O(P,e)}};return!R&&re?$(`div`,{...se,children:oe}):$(`button`,{...se,type:`button`,draggable:u&&!F,onDragEnd:u&&!F?p:void 0,onDragStart:u&&!F?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{if(R){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!F?e=>{m(e,t,P)}:void 0,onClick:e=>{M(e,t,P,I)},children:oe})}function M$(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(KQ(e))).map((n,r)=>j$(e,n,t.start+r))}function N$({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=JG,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=FQ(null),v=FQ(null),y=FQ(!1),b=FQ(null),x=FQ(null),S=FQ(null),C=FQ(null),w=FQ(null),T=FQ(new Map),E=FQ(new Map),D=FQ(()=>{}),O=FQ(null),k=FQ(0),A=FQ(!1),j=FQ(null);j.current!==t&&(A.current=!1,j.current=t);let M=FQ(!1),N=FQ(null),P=FQ(null),F=FQ(!1),I=FQ(null),L=FQ(null),R=FQ(null),z=FQ(null),ee=FQ(null),te=FQ(null),B=FQ(null),V=FQ(null),H=FQ(!1),ne=FQ(null),re=FQ(null),ie=FQ(null),ae=FQ(null),oe=IQ(()=>new Map,[]),[,se]=jQ(0),[ce,le]=jQ(null),[ue,U]=jQ(null),[de,fe]=jQ(null),[pe,me]=jQ(null),[he,ge]=jQ(0),[_e,ve]=jQ(null),ye=FQ(_e);ye.current=_e;let be=FQ(null),xe=FQ(null),Se=FQ(null),Ce=FQ(null),we=FQ(null),Te=FQ(!1),Ee=()=>{xe.current=null,Se.current=null,Ce.current=null},De=(e,t)=>{xe.current=e,Se.current=null,Ce.current=t==null?null:{path:e,scrollTop:t}},Oe=(e,t)=>{xe.current=null,Se.current={path:e,viewportOffset:t},Ce.current=null},ke=FQ(d===`retain`&&t.isSearchOpen()),[Ae,je]=jQ(p);NQ(()=>{p||je(!1)},[p]);let Me=FQ(!1),Ne=LQ(()=>{Me.current=!0,je(e=>e&&!1)},[]),[Pe,Fe]=jQ(()=>YQ({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Ie,Le]=jQ(!1);NQ(()=>{Le(!0)},[]);let Re=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,ze=e?.contextMenu?.triggerMode??(Re?`right-click`:`both`),W=ze===`both`||ze===`button`,G=e?.contextMenu?.buttonVisibility??`when-needed`,Be=ze===`both`||ze===`right-click`;PQ(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;we.current=t,U(t),me(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Te.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let Ve=LQ((e,t)=>{y$(T.current,e,t)},[]),He=LQ((e,t)=>{y$(E.current,e,t)},[]),Ue=LQ(e=>{x.current=e},[]),We=LQ(e=>b$(e,E.current,T.current),[]),Ge=n!=null||r!=null||i!=null,{resolveIcon:Ke}=IQ(()=>PX(a),[a]),qe=t[vX](),Je=qe.getPath(),Ye=Je!=null,Xe=t.isSearchOpen(),Ze=t.getSearchValue(),Qe=t.getFocusedPath(),$e=t.getFocusedIndex(),et=t.getScrollRequest(),tt=t.isDragAndDropEnabled(),nt=t.getDragSession(),rt=IQ(()=>nt==null?null:new Set(nt.draggedPaths),[nt]),it=nt?.target??null,at=nt?.primaryPath??null,ot=T$(o),{overlayHeight:st,overlayRows:ct,snapshot:lt,visibleRows:ut}=Pe,dt=lt.physical.viewportHeight,ft=IQ(()=>({end:lt.window.endIndex,start:lt.window.startIndex}),[lt.window.endIndex,lt.window.startIndex]),pt=ct,mt=lt.sticky.rows,ht=lt.physical.totalHeight,gt=lt.sticky.height,_t=IQ(()=>new Set(mt.map(e=>KQ(e.row))),[mt]),vt=$e>=0&&$e>=ft.start&&$e<=ft.end,yt=LQ((e,t)=>u?.({item:w$(e,t),row:e})??null,[u]),bt=LQ(e=>rQ(e==null?null:T.current.get(e)??null)?!0:rQ(S.current),[]),xt=LQ(e=>{bt(t.focusNearestPath(e))},[t,bt]),St=FQ(xt);St.current=xt;let Ct=FQ(!0),wt=FQ(()=>{}),Tt=LQ((t=!0)=>{let n=ye.current;n!=null&&(Ct.current=Ct.current&&t,ve(null),e?.contextMenu?.onClose?.(),Ct.current&&xt(n.path))},[e?.contextMenu,xt]);wt.current=Tt;let Et=LQ(e=>{let t=e==null?null:v$(S.current,e);fe(e=>e===t?e:t)},[]),Dt=LQ((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=We(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;De(n,e?.scrollTop??null),M.current=!0,le(e=>e===n?e:n)}i.focus(),Et(a),Ct.current=!0,ve({anchorRect:r?.anchorRect??null,item:w$(e,n),path:n,source:r?.source??`keyboard`})},[t,We,Et]),Ot=LQ(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=aQ(e,dt);I.current=$e<0||e==null?null:Math.max(0,Math.min($e*s-e.scrollTop,Math.max(0,t-s))),F.current=!0}t.startRenaming(e)!==!1&&(me(`focus`),se(e=>e+1))}},[t,$e,s,l,dt]),kt=LQ((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=aQ(i,dt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:YQ({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,uQ(i,a,s,l,u,d),D.current(),be.current=n?e:null,!0},[t,s,c,dt,h]),At=()=>y.current===!0||ae.current!=null||H.current===!0,jt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Mt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Nt=()=>{z.current!=null&&(clearTimeout(z.current),z.current=null),R.current=null},K=()=>{te.current?.remove(),te.current=null},Pt=()=>{Mt(L.current),L.current=null,ee.current=null},Ft=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},It=()=>{V.current?.(),V.current=null,ae.current!=null&&(clearTimeout(ae.current),ae.current=null),H.current=!1,ne.current=null,ie.current=null,re.current!=null&&(re.current.setAttribute(`draggable`,`true`),re.current.style.removeProperty(`touch-action`),re.current=null),K(),Nt(),Pt(),B.current=null},Lt=(e,n)=>{let r=S.current?.getRootNode(),i=n$(e$(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Rt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Nt();return}let r=t.getItem(e.directoryPath),i=c$(r)?r:null;if(i==null||i.isExpanded()){Nt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;R.current!==a&&(Nt(),R.current=a,z.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind!==`directory`||n.directoryPath!==e.directoryPath||n.flattenedSegmentPath!==e.flattenedSegmentPath||i.expand()},n))},zt=()=>{L.current=null;let e=ee.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=a$(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,D.current()),Rt(Lt(e.clientX,e.clientY)),L.current=jt(zt)},Bt=(e,t)=>{ee.current={clientX:e,clientY:t},L.current??=jt(zt)},Vt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(It(),K(),Nt(),Pt(),t.startDrag(r)===!1){e.preventDefault();return}if(B.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),i$())){let t=r$(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Ft(t),te.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Ht=()=>{K(),Nt(),Pt(),B.current=null,t.cancelDrag()},Ut=(e,n,r)=>{if(ae.current!=null||H.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;ie.current={clientX:i.clientX,clientY:i.clientY},re.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!H.current;ae.current!=null&&(clearTimeout(ae.current),ae.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),V.current===o&&(V.current=null),t&&(a.setAttribute(`draggable`,`true`),re.current===a&&(re.current=null),ie.current=null)},s=e=>{let t=e.touches[0],n=ie.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=ZQ*ZQ||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),V.current=o,ae.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),re.current===a&&(re.current=null),ie.current=null;return}H.current=!0,re.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),B.current=n;let e=a.getBoundingClientRect(),s=r$(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Ft(s),te.current=s,ne.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=ne.current;n!=null&&te.current!=null&&(te.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Rt(Lt(t.clientX,t.clientY)),Bt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Lt(n.clientX,n.clientY),t.completeDrag(),It()},u=()=>{t.cancelDrag(),It()};V.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},XQ)},Wt=e=>{if(_e!=null){if(e.key===`Escape`){Tt(),e.preventDefault(),e.stopPropagation();return}m$.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(qe.isActive()){if(e.key===`Escape`)qe.cancel();else if(e.key===`Enter`)qe.commit();else return;me(`focus`),se(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Ot(Qe??void 0),e.preventDefault(),e.stopPropagation();return}if(Xe){if(e.key===`Escape`)F.current=!1,I.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=aQ(n,dt);I.current=$e<0||n==null?null:Math.max(0,Math.min($e*s-n.scrollTop,Math.max(0,r-s))),F.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;me(`focus`),se(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&u$(e)){t.openSearch(e.key),se(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Re&&f$(e),r=p$(e,Re),i=r&&S.current!=null?iQ(S.current):null,a=r?new Set(x$(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==Qe&&a.has(o)){let e=C.current;De(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=c$(p)?p:null,h=u!=null&&(_t.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=b$(u,E.current,T.current);e==null||n==null?y=!1:Dt(e,u)}else if((e.ctrlKey||e.metaKey)&&l$(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;me(`focus`);let b=t.getFocusedPath(),x=b!=null&&(_t.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))De(b,v?.scrollTop??null),M.current=!0,le(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(Oe(b,C$(S.current,v,i,u,s,gt,dt)),M.current=!0,le(e=>e===b?e:b)):Ee()}se(e=>e+1),e.preventDefault(),e.stopPropagation()};PQ(()=>{if(!(!f||!Xe)){if(ke.current){ke.current=!1;return}rQ(w.current)}},[Xe,f]),PQ(()=>{let e=x.current;switch(fQ({hasRenderedInput:e!=null,previousRenamingPath:P.current,renamingPath:Je})){case`reset`:P.current=null;return;case`reveal-canonical`:Je!=null&&kt(Je,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(be.current=null,P.current=Je,rQ(e),e.select());return}},[ft.end,ft.start,Je,kt,_t]),PQ(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=iQ(e)?.dataset.itemPath??null;le(e=>e===t?e:t)},i=()=>{n(),M.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,iQ(e)!=null){r();return}M.current=!1,le(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,le(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;le(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),PQ(()=>{let e=S.current;e!=null&&(lt.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[lt.physical.scrollTop]),PQ(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=aQ(n,g);let a=()=>{let e=t.getVisibleCount(),r=oQ(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Fe(YQ({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!A.current){A.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=oQ(O.current,g),i=t.getVisibleRows(e,e)[0]??null;cQ(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}D.current=a;let o=!1,l=t.subscribe(()=>{o?se(e=>e+1):o=!0,a()}),u=()=>{Te.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,ge(e=>e+1),e=null},50))},d=null,f=()=>{i!=null&&delete i.dataset.overlayReveal,d!=null&&(clearTimeout(d),d=null)},p=()=>{i==null||Te.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,d!=null&&clearTimeout(d),d=setTimeout(()=>{f()},200))},m=()=>{if(a(),n.scrollTop>0&&f(),ye.current!=null&&y.current&&wt.current(),Te.current===!0){y.current=!1;return}U(e=>e==null?e:null),u()},_=()=>{u(),p()},v=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),x=e=>{v.has(e.key)&&_()};n.addEventListener(`scroll`,m,{passive:!0}),n.addEventListener(`wheel`,_,{passive:!0}),n.addEventListener(`touchmove`,_,{passive:!0}),n.addEventListener(`keydown`,x);let w=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:sQ(e[0]))??aQ(n,g),a()}):null;return w?.observe(n),()=>{D.current=()=>{},l(),n.removeEventListener(`scroll`,m),n.removeEventListener(`wheel`,_),n.removeEventListener(`touchmove`,_),n.removeEventListener(`keydown`,x),e!=null&&clearTimeout(e),d!=null&&clearTimeout(d),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,w?.disconnect()}},[t,g,s,c,h]),PQ(()=>{Re||_e==null||Tt(!1)},[Tt,Re,_e]);let Gt=IQ(()=>_e==null?null:`${_e.path}::${_e.source}`,[_e]);PQ(()=>{if(Gt==null){m?.clearSlotContent(CW);return}let t=ye.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??g$(n.getBoundingClientRect()),close:e=>{wt.current(e?.restoreFocus??!0)},restoreFocus:()=>{Ct.current&&St.current(ye.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(CW,i),e?.contextMenu?.onOpen?.(t.item,r),k$(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&k$(i)}),()=>{m?.clearSlotContent(CW)}},[Gt,e?.contextMenu,m]),PQ(()=>{_e!=null&&t.getItem(_e.path)==null&&Tt()},[Tt,_e,t]),PQ(()=>{if(_e==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(h$(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Tt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Tt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Tt,_e]),PQ(()=>{let e=C.current,n=S.current;if(e==null||n==null){N.current=Qe;return}let r=Qe==null?null:T.current.get(Qe)??null,i=iQ(n),a=i?.dataset.itemPath??null,o=Ye&&x.current===i,c=f&&w.current===i,l=F.current&&!Xe,u=I.current??0,d=be.current,p=xe.current,m=Se.current,g=Ce.current,_=i!=null,v=M.current||_,y=N.current!==Qe,b=p!=null&&p===Qe&&Qe!=null,E=!1,O=!1;if(et!=null&&et.id!==k.current){k.current=et.id;let n=et.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,dt-s))):gt;E=!0,O=lQ(e,n,s,dt,ht,et.offset,t)}t.clearScrollRequest(et.id)}let A=!E&&l&&uQ(e,$e,s,dt,ht,u),j=!E&&d!=null&&d===Qe&&uQ(e,$e,s,dt,ht,gt),P=!E&&m!=null&&m.path===Qe&&uQ(e,$e,s,dt,ht,m.viewportOffset),L=!E&&g!=null&&g.path===Qe&&e.scrollTop!==g.scrollTop;if(L&&(e.scrollTop=g.scrollTop),(L||O||j||P||A||v&&y&&d!==Qe&&!b&&cQ(e,$e,s,dt,gt))&&D.current(),E){N.current=Qe;return}if(!v){N.current=Qe;return}if(o){N.current=Qe;return}if(c&&!l){N.current=Qe;return}if(r==null){l&&$e>=0&&(uQ(e,$e,s,dt,ht,u),D.current()),N.current=Qe;return}(y||l||d===Qe||p===Qe||m?.path===Qe||g?.path===Qe||a==null||a!==Qe)&&(rQ(r),d===Qe&&(be.current=null),p===Qe&&(xe.current=null),m?.path===Qe&&(Se.current=null),g?.path===Qe&&(Ce.current=null),F.current=!1,I.current=null),N.current=Qe},[t,$e,Qe,vt,s,Ye,Xe,ft,dt,f,et,h,gt,ht,ut]);let Kt=$e>=0&&$e>=lt.visible.startIndex&&$e<=lt.visible.endIndex,qt=Qe!=null&&pt.some(e=>KQ(e.row)===Qe),Jt=Kt||qt,Yt=W&&M.current===!0&&Jt?Qe:null,Xt=pe===`pointer`?ue:null,Zt=_e?.path??we.current??Xt??Yt??ue,Qt=_e?.source===`right-click`;PQ(()=>{y.current&&_e==null||Et(We(Zt))},[_e,We,ft,dt,he,pt,Zt,Et,ut]);let $t=LQ(e=>{if(y.current||h$(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&me(e=>e===`pointer`?e:`pointer`),U(e=>e===i?e:i)},[]),en=LQ(()=>{U(null)},[]);PQ(()=>{if(!tt)return;let e=()=>{It(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),It(),t.cancelDrag()}},[t,tt]);let tn=e=>{if(!tt||t.getDragSession()==null||H.current)return;let n=n$(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Rt(t.getDragSession()?.target??null),Bt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},nn=e=>{if(!tt||t.getDragSession()==null||H.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Nt(),Pt(),t.setDragTarget(null))},rn=e=>{!tt||t.getDragSession()==null||H.current||(e.preventDefault(),Lt(e.clientX,e.clientY),t.completeDrag(),K(),Nt(),Pt(),B.current=null)},an=lt.window.height,on=lt.window.offsetTop,sn=Math.min(0,dt-an),cn=Math.min(0,dt-an-gt),ln=ce===Qe||F.current,un=Qe!=null&&ln&&!vt&&$e>=0?ut[$e]??t.getVisibleRows($e,$e)[0]??null:null,dn=un==null?null:dQ($e,s,ft,an),fn=B.current,pn=at!=null&&fn!=null&&fn.path===at&&fn.index>=ft.start&&fn.index<=ft.end,mn=at!=null&&fn!=null&&fn.path===at&&!pn&&fn.path!==un?.path?fn:null,hn=mn==null?null:dQ(mn.index,s,ft,an),gn=d$(($e>=0?ut[$e]??t.getVisibleRows($e,$e)[0]??null:null)?.ancestorPaths.at(-1)??null),_n=Xe&&Qe!=null?E$(o,Qe,!vt):void 0,vn=_e?.path??(Xe?Qe:ce),yn=_e?.path??ue,bn=We(Zt),xn=Re&&W&&!Qt&&!Ye&&bn!=null&&de!=null&&Zt!=null,Sn=Re&&(xn||_e!=null),Cn=_e?.anchorRect,wn=Cn==null&&bn!=null&&de!=null&&(_e!=null||xn)?de:null,Tn=Cn==null?wn==null?void 0:{top:`${wn}px`}:{left:`${Cn.left}px`,position:`fixed`,right:`auto`,top:`${Cn.top}px`},En=Qt?{opacity:`0`}:void 0,Dn=LQ((e,n,r,i)=>{let a=hQ({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:Xe,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c);break}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=lt.visible.startIndex&&n.index<=lt.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,le(e=>e===c?e:c),me(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&kt(c,{targetOffset:`sticky-parents`})},[t,Xe,lt.visible.endIndex,lt.visible.startIndex,kt]),On=()=>{if(y.current||!W||Zt==null||bn==null)return;let e=t.getItem(Zt);e!=null&&(Et(bn),Ct.current=!0,ve({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:bn.getAttribute(`aria-label`)??Zt,path:e.getPath()},path:e.getPath(),source:`button`}))},kn={contextHoverPath:yn,contextMenuButtonTriggerEnabled:W,contextMenuButtonVisibility:G,contextMenuEnabled:Re,contextMenuRightClickEnabled:Be,contextMenuTriggerMode:ze,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:tt,draggedPathSet:rt,dragTarget:it,gitLaneActive:Ge,gitStatusByPath:n,handleRowDragEnd:Ht,handleRowDragStart:Vt,handleRowTouchStart:Ut,ignoredGitDirectories:r,ignoredInheritanceCache:oe,instanceId:o,itemHeight:s,onKeyDown:Wt,onRowClick:Dn,openContextMenuForRow:Dt,registerButton:Ve,registerRenameInput:Ue,renameView:qe,renderDecorationForRow:yt,resolveIcon:Ke,shouldSuppressContextMenu:At,visualFocusPath:vn},An={...kn,registerButton:He};return $(`div`,{ref:S,id:ot,"data-file-tree-context-menu-button-visibility":Re&&W?G:void 0,"data-file-tree-context-menu-trigger-mode":Re?ze:void 0,"data-file-tree-has-context-menu-action-lane":Re&&W?`true`:void 0,"data-file-tree-has-git-lane":Ge?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:tt?nn:void 0,onDragOver:tt?tn:void 0,onDrop:tt?rn:void 0,onKeyDown:Wt,onPointerLeave:Re?en:void 0,onPointerOver:Re?$t:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[$(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:gn}}),$(`slot`,{name:SW,"data-type":`header-slot`}),f?$(`div`,{"data-file-tree-search-container":!0,"data-open":Xe?`true`:`false`,children:$(`input`,{ref:w,"aria-activedescendant":_n,"aria-controls":ot,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ae?`true`:void 0,value:Ze,onBlur:()=>{d===`retain`&&!Me.current||t.closeSearch()},onFocus:Ne,onPointerDown:Ne,onInput:e=>{Ne();let n=e.currentTarget;t.setSearch(n.value)}})}):null,$(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Ie&&pt.length>0?$(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:$(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${st}px`},children:pt.map((e,t)=>j$(An,e.row,`sticky:${KQ(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${pt.length-t}`}}))})}):null,$(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${ht}px`},children:[$(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${on}px`}}),$(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${an}px`,top:`${sn}px`,bottom:`${cn}px`},children:[M$(kn,ft,_t),un!=null&&dn!=null?j$(kn,un,`parked:${un.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:at===un.path?`none`:void 0,position:`absolute`,right:`0`,top:`${dn}px`}}):null,mn!=null&&hn!=null?j$(kn,mn,`parked-drag:${mn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${hn}px`}}):null]})]})]}),Re?$(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":Sn?`true`:`false`,style:Tn,children:[$(`button`,{ref:v,type:`button`,"data-type":wW,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":_e==null?`false`:`true`,"data-visible":xn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),_e!=null){Tt();return}On()},tabIndex:-1,style:En,children:$(EZ,{...Ke(`file-tree-icon-ellipsis`)})}),_e==null?null:$(`slot`,{name:CW})]}):null,_e==null?null:$(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Tt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Tt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var P$={hydrateRoot:(e,t)=>{xZ(ZX(N$,t),e)},renderRoot:(e,t)=>{bZ(ZX(N$,t),e)},unmountRoot:e=>{bZ(null,e)}};function F$(e,t){P$.renderRoot(e,t)}function I$(e,t){P$.hydrateRoot(e,t)}function L$(e){P$.unmountRoot(e)}var R$=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}},z$=`__c`,B$=`__k`,V$=`__d`,H$=`__s`,U$=/[\s\n\\/='"\0<>]/,W$=/^(xlink|xmlns|xml)([A-Z])/,G$=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,K$=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,q$=new Set([`draggable`,`spellcheck`]);function J$(e){e.__g===void 0?e[V$]=!0:e.__g|=8}function Y$(e){e.__g===void 0?e[V$]=!1:e.__g&=-9}function X$(e){return e.__g===void 0?!0===e[V$]:!!(8&e.__g)}var Z$=/["&<]/;function Q$(e){if(e.length===0||!1===Z$.test(e))return e;for(var t=0,n=0,r=``,i=``;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i=`"`;break;case 38:i=`&`;break;case 60:i=`<`;break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=i,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var $$={},e1=new Set(`animation-iteration-count.border-image-outset.border-image-slice.border-image-width.box-flex.box-flex-group.box-ordinal-group.column-count.fill-opacity.flex.flex-grow.flex-negative.flex-order.flex-positive.flex-shrink.flood-opacity.font-weight.grid-column.grid-row.line-clamp.line-height.opacity.order.orphans.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.widows.z-index.zoom`.split(`.`)),t1=/[A-Z]/g;function n1(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:$$[n]||($$[n]=n.replace(t1,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||e1.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function r1(){this.__d=!0}function i1(e,t){return{__v:e,context:t,props:e.props,setState:r1,forceUpdate:r1,__d:!0,__h:[]}}function a1(e,t,n){if(!e.s){if(n instanceof o1){if(!n.s)return void(n.o=a1.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(a1.bind(null,e,t),a1.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var o1=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{a1(r,1,a(this.v))}catch(e){a1(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?a1(r,1,t?t(i):i):n?a1(r,1,n(i)):a1(r,2,i)}catch(e){a1(r,2,e)}},r},e}(),s1,c1,l1,u1,d1={},f1=Array.isArray,p1=Object.assign,m1=``,h1=`<!--$s-->`,g1=`<!--/$s-->`;function _1(e,t){var n,r=e.type,i=!0;return e[z$]?(i=!1,(n=e[z$]).state=n[H$]):n=new r(e.props,t),e[z$]=n,n.__v=e,n.props=e.props,n.context=t,J$(n),n.state??=d1,n[H$]??(n[H$]=n.state),r.getDerivedStateFromProps?n.state=p1({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[H$]===n.state?n.state:n[H$]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),l1&&l1(e),n.render(n.props,n.state,t)}function v1(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===m1)return m1;var s=typeof e;if(s!=`object`)return s==`function`?m1:s==`string`?Q$(e):e+m1;if(f1(e)){var c,l=m1;i[B$]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=v1(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=m1,f1(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return m1;e.__=i,s1&&s1(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===$X){if(`tpl`in g){for(var x=m1,S=0;S<g.tpl.length;S++)if(x+=g.tpl[S],g.exprs&&S<g.exprs.length){var C=g.exprs[S];if(C==null)continue;typeof C!=`object`||C.constructor!==void 0&&!f1(C)?x+=C:x+=v1(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+Q$(g.UNSTABLE_comment)+`-->`;v=g.children}else{if((_=h.contextType)!=null){var w=t[_.__c];b=w?w.props.value:_.__}var T=h.prototype&&typeof h.prototype.render==`function`;if(T)v=_1(e,b),y=e[z$];else{e[z$]=y=i1(e,b);for(var E=0;X$(y)&&E++<25;){Y$(y),l1&&l1(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}J$(y)}if(y.getChildContext!=null&&(t=p1({},t,y.getChildContext())),T&&FX.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===$X&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return v1(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[H$]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,d1),X$(y)?(v=_1(e,t),(y=e[z$]).getChildContext!=null&&(t=p1({},t,y.getChildContext())),v1(v=v!=null&&v.type===$X&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):m1}finally{c1&&c1(e),u1&&u1(e)}}}v=v!=null&&v.type===$X&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var D=v1(v,t,n,r,e,a,o);return c1&&c1(e),FX.unmount&&FX.unmount(e),e._suspended?typeof D==`string`?h1+D+g1:f1(D)?(D.unshift(h1),D.push(g1),D):D.then(function(e){return h1+e+g1}):D}catch(i){if(!a&&o&&o.onError){var O=function i(s){return o.onError(s,e,function(e,s){try{return v1(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(O!==void 0)return O;var k=FX.__e;return k&&k(i,e),m1}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=v1(v,t,n,r,e,a,o);return e._suspended?h1+s+g1:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var A,j=`<`+h,M=m1;for(var N in g){var P=g[N];if(typeof(P=b1(P)?P.value:P)!=`function`||N===`class`||N===`className`){switch(N){case`children`:A=P;continue;case`key`:case`ref`:case`__self`:case`__source`:continue;case`htmlFor`:if(`for`in g)continue;N=`for`;break;case`className`:if(`class`in g)continue;N=`class`;break;case`defaultChecked`:N=`checked`;break;case`defaultSelected`:N=`selected`;break;case`defaultValue`:case`value`:switch(N=`value`,h){case`textarea`:A=P;continue;case`select`:r=P;continue;case`option`:r!=P||`selected`in g||(j+=` selected`)}break;case`dangerouslySetInnerHTML`:M=P&&P.__html;continue;case`style`:typeof P==`object`&&(P=n1(P));break;case`acceptCharset`:N=`accept-charset`;break;case`httpEquiv`:N=`http-equiv`;break;default:if(W$.test(N))N=N.replace(W$,`$1:$2`).toLowerCase();else{if(U$.test(N))continue;N[4]!==`-`&&!q$.has(N)||P==null?n?K$.test(N)&&(N=N===`panose1`?`panose-1`:N.replace(/([A-Z])/g,`-$1`).toLowerCase()):G$.test(N)&&(N=N.toLowerCase()):P+=m1}}P!=null&&!1!==P&&(j=!0===P||P===m1?j+` `+N:j+` `+N+`="`+(typeof P==`string`?Q$(P):P+m1)+`"`)}}if(U$.test(h))throw Error(h+` is not a valid HTML tag name in `+j+`>`);if(M||(typeof A==`string`?M=Q$(A):A!=null&&!1!==A&&!0!==A&&(M=v1(A,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),c1&&c1(e),u1&&u1(e),!M&&y1.has(h))return j+`/>`;var F=`</`+h+`>`,I=j+`>`;return f1(M)?[I].concat(M,[F]):typeof M==`string`?I+M+F:[I,M,F]}var y1=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function b1(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var x1=0;function S1(e){return e!=null&&e.length>0?e:(x1+=1,`pst_ft_${x1}`)}function C1({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??JG)}function w1(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function T1(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function E1(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var D1=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new R$;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=S1(a),this.#p=kX(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=qG(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new wX({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(L$(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){this.#t.resetPaths(e,t)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),F$(t.wrapper,this.#w()))}setGitStatus(e){this.#p=kX(e,this.#p);let t=this.#T();t!=null&&F$(t.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),F$(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),I$(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),F$(r,this.#w())}#C(){return{initialViewportHeight:C1({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(SW,e());return}this.#l.setSlotHtml(SW,this.#e?.header?.html??null)}#k(e){let t=E1(e).find(e=>T1(e)),n=w1(BG(GG(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=E1(e),n=t.find(e=>T1(e)),r=t.filter(e=>e!==n),i=GG(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=w1(i);if(a==null){for(let e of r)e.remove();return}if(!(r.length===1&&r[0].outerHTML===a.outerHTML)){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=GG(this.#m);t.colored&&HG(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${vW}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}this.#g?.parentNode===e&&this.#_===this.#h||(this.#g??=document.createElement(`style`),this.#g.setAttribute(vW,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=QG(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return iK(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}};function O1(e){let[t]=(0,W.useState)(()=>new D1(e)),n=(0,W.useRef)({timeout:null,model:t});return(0,W.useEffect)(()=>{let{current:e}=n;return e.timeout!=null&&(clearTimeout(e.timeout),e.timeout=null),()=>{e.timeout=setTimeout(()=>e.model.cleanUp(),1)}},[]),{model:t}}var k1=(0,W.memo)(function({files:e,activeFile:t,commentCounts:n,viewedFiles:r,untrackedFiles:i,onFileClick:a,collapsed:o,onToggleCollapse:s}){let[c,l]=(0,W.useState)(``),u=(0,W.useMemo)(()=>e.map(e=>e.name),[e]),d=(0,W.useMemo)(()=>{let e=new Set;return u.forEach(t=>{let n=t.split(`/`);for(let t=1;t<n.length;t++)e.add(n.slice(0,t).join(`/`))}),Array.from(e)},[u]),f=(0,W.useMemo)(()=>e.map(e=>{let t=`modified`;if(i.has(e.name))t=`untracked`;else if(e.prevName)t=`renamed`;else{let n=e.prevObjectId,r=e.newObjectId;n===`0000000`||n===`0000000000000000000000000000000000000000`?t=`added`:(r===`0000000`||r===`0000000000000000000000000000000000000000`)&&(t=`deleted`)}return{path:e.name,status:t}}),[e,i]),p=(0,W.useRef)({commentCounts:n,viewedFiles:r});p.current={commentCounts:n,viewedFiles:r};let{model:m}=O1({paths:u,fileTreeSearchMode:`hide-non-matches`,gitStatus:f,renderRowDecoration:(0,W.useCallback)(e=>{let t=e.item.path,{commentCounts:n,viewedFiles:r}=p.current,i=r.has(t),a=n[t]??0;return i&&a>0?{text:`✓ 💬 ${a}`,title:`Viewed, ${a} comment${a>1?`s`:``}`}:i?{text:`✓`,title:`Viewed`}:a>0?{text:`💬 ${a}`,title:`${a} comment${a>1?`s`:``}`}:null},[]),initialSelectedPaths:t?[t]:[],initialExpandedPaths:d,onSelectionChange:e=>{e.length>0&&e[0]!==t&&a(e[0])}});return(0,W.useEffect)(()=>{m.resetPaths(u,{initialExpandedPaths:d})},[u,d,m]),(0,W.useEffect)(()=>{m.setGitStatus(f)},[f,n,r,m]),(0,W.useEffect)(()=>{if(t)try{m.focusPath(t),m.scrollToPath(t,{focus:!0,offset:`nearest`})}catch(e){console.error(`Failed to scroll to active file:`,e)}},[t,m]),(0,W.useEffect)(()=>{m.setSearch(c||null)},[c,m]),o?(0,G.jsx)(`div`,{className:`ft`,children:(0,G.jsx)(`div`,{className:`ft-search`,children:s&&(0,G.jsx)($T,{content:`Expand sidebar`,side:`right`,children:(0,G.jsx)(`button`,{className:`sidebar-toggle`,onClick:s,"aria-label":`Expand sidebar`,children:(0,G.jsx)(pO,{size:16})})})})}):(0,G.jsxs)(`div`,{className:`ft`,style:{display:`flex`,flexDirection:`column`,height:`100%`},children:[(0,G.jsxs)(`div`,{className:`ft-search`,children:[s&&(0,G.jsx)($T,{content:`Collapse sidebar`,side:`right`,children:(0,G.jsx)(`button`,{className:`sidebar-toggle`,onClick:s,"aria-label":`Collapse sidebar`,children:(0,G.jsx)(fO,{size:16})})}),(0,G.jsxs)(`div`,{className:`ft-search-wrapper`,children:[(0,G.jsx)(xO,{size:14,className:`ft-search-icon`}),(0,G.jsx)(`input`,{type:`text`,placeholder:`Filter files...`,value:c,onChange:e=>l(e.target.value),className:`ft-search-input`})]})]}),(0,G.jsx)(`div`,{style:{flex:1,minHeight:0,overflow:`auto`},children:(0,G.jsx)(AW,{model:m,className:`ft-pierre-tree`})})]})});function A1(e){return e.status===`resolved`?`resolved`:e.replies?.length?`replied`:`open`}var j1=[{key:`all`,label:`All`},{key:`open`,label:`Open`},{key:`replied`,label:`Replied`},{key:`resolved`,label:`Resolved`}];function M1({comments:e,resolveComment:t,unresolveComment:n,removeComment:r,addReply:i,editComment:a,editReply:o,removeReply:s}){let[c,l]=(0,W.useState)(`all`),u=(0,W.useMemo)(()=>{let t={all:e.length,open:0,replied:0,resolved:0};for(let n of e)t[A1(n)]++;return t},[e]),d=(0,W.useMemo)(()=>[...e].sort((e,t)=>t.createdAt-e.createdAt),[e]),f=(0,W.useMemo)(()=>c===`all`?d:d.filter(e=>A1(e)===c),[d,c]);return e.length===0?null:(0,G.jsxs)(`div`,{className:`cmt`,role:`complementary`,"aria-label":`Review comments`,children:[(0,G.jsxs)(`div`,{className:`cmt-head`,children:[(0,G.jsxs)(`div`,{className:`cmt-title`,children:[(0,G.jsx)(cO,{size:14,"aria-hidden":`true`}),(0,G.jsx)(`span`,{children:`Comments`}),(0,G.jsx)(`span`,{className:`cmt-total`,children:e.length})]}),(0,G.jsx)(`div`,{className:`cmt-filters`,role:`tablist`,"aria-label":`Filter comments`,children:j1.map(e=>(0,G.jsxs)(`button`,{role:`tab`,"aria-selected":c===e.key,className:`cmt-filter ${c===e.key?`cmt-filter-active`:``}`,onClick:()=>l(e.key),disabled:e.key!==`all`&&u[e.key]===0,children:[e.label,(0,G.jsx)(`span`,{className:`cmt-filter-count`,children:u[e.key]})]},e.key))})]}),(0,G.jsx)(`ul`,{className:`cmt-list`,"aria-label":`Comment threads`,children:f.length===0?(0,G.jsxs)(`li`,{className:`cmt-empty`,children:[`No `,c,` comments`]}):f.map(e=>(0,G.jsx)(N1,{comment:e,resolveComment:t,unresolveComment:n,removeComment:r,addReply:i,editComment:a,editReply:o,removeReply:s},e.id))})]})}function N1({comment:e,resolveComment:t,unresolveComment:n,removeComment:r,addReply:i,editComment:a,editReply:o,removeReply:s}){let c=A1(e),l=e.status===`resolved`,u=e.replies?.length??0,{haptic:d,sound:f}=lD(),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(!1),[_,v]=(0,W.useState)(!1),[y,b]=(0,W.useState)(!1),x=(0,W.useCallback)(()=>{e.lineNumber>0?oE(e.filePath,e.lineNumber,e.side):document.getElementById(`file-${e.filePath}`)?.scrollIntoView({block:`start`})},[e.filePath,e.lineNumber,e.side]),S=e.lineNumber>0?`:${e.lineNumber}`:` · file`;return(0,G.jsxs)(`li`,{className:`cmt-card cmt-card-${c} ${l?`cmt-card-resolved`:``}`,children:[(0,G.jsxs)(`div`,{className:`cmt-card-top`,children:[(0,G.jsx)(`span`,{className:`cmt-dot cmt-dot-${c}`,"aria-hidden":`true`}),(0,G.jsxs)(`button`,{className:`cmt-loc`,onClick:x,title:`Jump to ${e.filePath}${S}`,children:[(0,G.jsx)(`span`,{className:`cmt-loc-file`,children:tE(e.filePath)}),(0,G.jsx)(`span`,{className:`cmt-loc-line`,children:S})]}),(0,G.jsx)(`span`,{className:`cmt-time`,children:eE(e.createdAt)})]}),e.lineContent?.trim()&&(0,G.jsx)(`button`,{className:`cmt-codeline`,onClick:x,title:`Jump to line`,children:(0,G.jsx)(`code`,{children:e.lineContent.trim().slice(0,160)})}),_?(0,G.jsx)(nW,{draftKey:`tracker-edit:${e.id}`,initialBody:e.body,onCancel:()=>v(!1),onSubmit:t=>{a(e.id,t),v(!1)}}):(0,G.jsx)(JH,{content:e.body,className:`cmt-body markdown-body`}),(0,G.jsxs)(`div`,{className:`cmt-actions`,children:[(0,G.jsxs)(`button`,{className:`cmt-act`,onClick:()=>{g(e=>!e),m(!0)},title:`Reply`,children:[(0,G.jsx)(WD,{size:13,"aria-hidden":`true`}),(0,G.jsx)(`span`,{children:`Reply`})]}),(0,G.jsx)(`button`,{className:`cmt-act`,onClick:()=>v(e=>!e),title:`Edit comment`,children:(0,G.jsx)(hO,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`cmt-act ${l?`cmt-act-resolved`:``}`,onClick:()=>{l?(n(e.id),d(`light`),f(`toggle`)):(t(e.id),d(`success`),f(`resolve`))},title:l?`Reopen`:`Resolve`,children:l?(0,G.jsx)(yO,{size:13,"aria-hidden":`true`}):(0,G.jsx)(jD,{size:13,"aria-hidden":`true`})}),y?(0,G.jsxs)(`span`,{className:`cmt-confirm`,children:[(0,G.jsx)(`button`,{className:`cmt-act cmt-act-danger`,onClick:()=>{r(e.id),d(`medium`),f(`remove`)},title:`Confirm delete`,children:`Delete?`}),(0,G.jsx)(`button`,{className:`cmt-act`,onClick:()=>b(!1),title:`Cancel`,children:(0,G.jsx)(AO,{size:13,"aria-hidden":`true`})})]}):(0,G.jsx)(`button`,{className:`cmt-act cmt-act-del`,onClick:()=>b(!0),title:`Delete comment`,children:(0,G.jsx)(TO,{size:13,"aria-hidden":`true`})})]}),u>0&&(0,G.jsxs)(`button`,{className:`cmt-thread-toggle`,onClick:()=>m(e=>!e),"aria-expanded":p,children:[(0,G.jsx)(PD,{size:12,className:`cmt-chev ${p?`cmt-chev-open`:``}`,"aria-hidden":`true`}),u,` `,u===1?`reply`:`replies`]}),p&&u>0&&(0,G.jsx)(`ul`,{className:`cmt-replies`,children:e.replies.map(t=>(0,G.jsx)(P1,{reply:t,onEdit:n=>o(e.id,t.id,n),onRemove:()=>s(e.id,t.id)},t.id))}),h&&(0,G.jsx)(nW,{draftKey:`reply:${e.id}`,onCancel:()=>g(!1),onSubmit:t=>{i(e.id,t),d(`light`),f(`success`),g(!1),m(!0)}})]})}function P1({reply:e,onEdit:t,onRemove:n}){let r=e.role===`agent`||e.role==null&&!!e.model,[i,a]=(0,W.useState)(!1);return(0,G.jsxs)(`li`,{className:`cmt-reply ${r?`cmt-reply-agent`:``}`,children:[(0,G.jsxs)(`div`,{className:`cmt-reply-head`,children:[(0,G.jsxs)(`span`,{className:`cmt-reply-who ${r?`cmt-reply-who-agent`:``}`,children:[r?(0,G.jsx)(AD,{size:11,"aria-hidden":`true`}):null,r?e.model||`Agent`:`You`]}),(0,G.jsx)(`span`,{className:`cmt-time`,children:eE(e.createdAt)}),!r&&(0,G.jsx)(`button`,{className:`cmt-reply-act`,onClick:()=>a(e=>!e),title:`Edit reply`,children:(0,G.jsx)(hO,{size:11,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`cmt-reply-act cmt-act-del`,onClick:n,title:`Delete reply`,children:(0,G.jsx)(TO,{size:11,"aria-hidden":`true`})})]}),i?(0,G.jsx)(nW,{draftKey:`tracker-reply-edit:${e.id}`,initialBody:e.body,onCancel:()=>a(!1),onSubmit:e=>{t(e),a(!1)}}):(0,G.jsx)(JH,{content:e.body,className:`cmt-reply-body markdown-body`})]})}function F1(e,t){let[n,r]=(0,W.useState)(e);return(0,W.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function I1(e){return e===`symbols`?2:e===`text`?1:0}function L1({scope:e,query:t,regex:n,changedOnly:r,changedPaths:i,open:a}){let o=F1(t,130).trim(),s=a&&o.length>=I1(e);return{...nt({queryKey:[`search`,e,o,e===`text`?n:!1,r,r?i:null],enabled:s,placeholderData:V,staleTime:5e3,queryFn:async({signal:t})=>{let a=await fetch(`/api/search`,{method:`POST`,headers:{"content-type":`application/json`},signal:t,body:JSON.stringify({scope:e,query:o,regex:e===`text`?n:!1,changedPaths:r?i:void 0})});if(!a.ok)throw Error(`Search request failed (${a.status})`);return await a.json()}}),enabled:s,pending:t.trim()!==o,minLength:I1(e)}}function R1(e,t){fetch(`/api/search/track`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({query:e,path:t})}).catch(()=>{})}function z1(e){return nt({queryKey:[`file-text`,e],enabled:!!e,staleTime:300*1e3,queryFn:async({signal:t})=>{let n=await fetch(`/api/file-text?path=${encodeURIComponent(e)}&version=new`,{signal:t});if(n.status===415)return{content:null,missing:!1,binary:!0};if(!n.ok)throw Error(`Failed to load file (${n.status})`);let r=await n.json();if(r.error){if(/binary/i.test(r.error))return{content:null,missing:!1,binary:!0};throw Error(r.error)}return r.missing?{content:null,missing:!0,binary:!1}:{content:r.content??``,missing:!1,binary:!1}}})}var B1=[{pattern:/^\s*(?:export\s+)?(?:async\s+)?function\s+(\w[\w$]*)\s*[<(]/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=\s*(?:async\s*)?\(/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=\s*(?:async\s+)?function/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:export\s+)?class\s+(\w[\w$]*)/i,kind:`class`,nameGroup:1},{pattern:/^\s*(?:export\s+)?interface\s+(\w[\w$]*)/i,kind:`interface`,nameGroup:1},{pattern:/^\s*(?:export\s+)?type\s+(\w[\w$]*)\s*=/i,kind:`type`,nameGroup:1},{pattern:/^\s*(?:export\s+)?enum\s+(\w[\w$]*)/i,kind:`enum`,nameGroup:1},{pattern:/^\s*(?:export\s+)?(?:const|let|var)\s+(\w[\w$]*)\s*=/i,kind:`variable`,nameGroup:1},{pattern:/^\s*def\s+(\w[\w$]*)\s*\(/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?fn\s+(\w[\w$]*)\s*[<(]/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?struct\s+(\w[\w$]*)/i,kind:`struct`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?enum\s+(\w[\w$]*)/i,kind:`enum`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?impl\s+(\w[\w$]*)/i,kind:`impl`,nameGroup:1},{pattern:/^\s*(?:pub(?:\s*\(\w+\))?\s+)?trait\s+(\w[\w$]*)/i,kind:`trait`,nameGroup:1},{pattern:/^\s*func\s+(\w[\w$]*)\s*\(/i,kind:`function`,nameGroup:1},{pattern:/^\s*(?:func\s+)?\((\w[\w$]*)\s+\*?\w+\)\s+(\w[\w$]*)\s*\(/i,kind:`method`,nameGroup:2}];function V1(e){for(let{pattern:t,kind:n,nameGroup:r}of B1){let i=t.exec(e);if(i){let e=i[r];if(e)return{name:e,kind:n}}}return null}function H1(e){return new Set(e.map(e=>e.name))}function U1(e){let t=new Set;for(let n of e)n.side===`additions`&&t.add(`${n.filePath}:${n.lineNumber}`);return t}function W1(e,t){return e.kind===`file`?t.diffFileSet.has(e.path)?{type:`scrollFile`,path:e.path}:{type:`preview`,path:e.path}:t.diffFileSet.has(e.path)?{type:`scrollLine`,path:e.path,line:e.line,side:`additions`,match:e.match}:{type:`preview`,path:e.path,line:e.line,match:e.match}}function G1(e,t){if(!t||t.length===0)return null;let n=!0;for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127){n=!1;break}let r=n?e.length:q1(e),i=null;if(!n){i=Array(r+1).fill(-1);let t=0;for(let n=0;n<e.length;){i[t]=n;let r=e.codePointAt(n);n+=r>65535?2:1,t+=K1(r)}i[r]=e.length}let a=[];for(let e of t){let[t,o]=e;if(!(t==null||o==null||o<=t||t<0||o>r))if(n)a.push([t,o]);else{let e=i[t],n=i[o];e>=0&&n>=0&&a.push([e,n])}}return a.length?a:null}function K1(e){return e<=127?1:e<=2047?2:e<=65535?3:4}function q1(e){let t=0;for(let n=0;n<e.length;){let r=e.codePointAt(n);t+=K1(r),n+=r>65535?2:1}return t}function J1(e,t,n){let r=((t?G1(e,t):null)??Y1(e,n)).map(([t,n])=>[Math.max(0,t),Math.min(e.length,n)]).filter(([e,t])=>t>e).sort((e,t)=>e[0]-t[0]),i=[];for(let[e,t]of r){let n=i[i.length-1];n&&e<=n[1]?n[1]=Math.max(n[1],t):i.push([e,t])}return i}function Y1(e,t){let n=t.trim();if(!n)return[];let r=[],i=e.toLowerCase(),a=n.toLowerCase(),o=0;for(;r.length<50;){let e=i.indexOf(a,o);if(e===-1)break;r.push([e,e+a.length]),o=e+a.length}return r}function X1(e,t){let n=e.toLowerCase(),r=t.toLowerCase();if(!r)return 0;let i=0,a=0,o=-1;for(let e=0;e<n.length&&i<r.length;e++)n[e]===r[i]&&(a+=o>=0&&e-o===1?5:1,o=e,i++);return i===r.length?a-e.length*.01:null}function Z1(e){let t=[],n=new Set;for(let r of e){if(r.side!==`additions`)continue;let e=V1(r.content);if(e){let i=`${r.filePath}:${r.lineNumber}:${e.name}`;if(n.has(i))continue;n.add(i);let a=r.content.indexOf(e.name),o=a>=0?[[a,a+e.name.length]]:[];t.push({name:e.name,kind:e.kind,path:r.filePath,fileName:r.filePath.split(`/`).pop()||``,line:r.lineNumber,content:r.content,matchRanges:o,gitStatus:``})}}return t}var Q1=[{key:`all`,label:`All`,Icon:tO},{key:`files`,label:`Files`,Icon:qD},{key:`text`,label:`Text`,Icon:DO},{key:`symbols`,label:`Symbols`,Icon:HD}],$1={function:`ƒ`,method:`m`,class:`C`,variable:`v`,interface:`I`,type:`T`,enum:`E`,struct:`S`,impl:`i`,trait:`t`};function e0(e){switch(e){case`modified`:return{label:`M`,title:`modified`};case`untracked`:return{label:`U`,title:`untracked`};case`staged_new`:case`added`:return{label:`A`,title:`added`};case`deleted`:return{label:`D`,title:`deleted`};case`renamed`:return{label:`R`,title:`renamed`};case``:case`clean`:return null;default:return{label:e.charAt(0).toUpperCase(),title:e}}}function t0({text:e,ranges:t}){if(!t.length)return(0,G.jsx)(G.Fragment,{children:e});let n=[],r=0;return t.forEach(([t,i],a)=>{t>r&&n.push(e.slice(r,t)),n.push((0,G.jsx)(`mark`,{className:`searchpalette-mark`,children:e.slice(t,i)},a)),r=i}),r<e.length&&n.push(e.slice(r)),(0,G.jsx)(G.Fragment,{children:n})}function n0(e,t){let n=t.trim().toLowerCase();if(!n)return[];let r=e.toLowerCase(),i=[],a=0;for(let e=0;e<r.length&&a<n.length;e++)if(r[e]===n[a]){let t=i[i.length-1];t&&t[1]===e?t[1]=e+1:i.push([e,e+1]),a++}return a===n.length?i:[]}var r0=e=>{let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t+1)};function i0(e,t){let n=e.length-e.trimStart().length,r=e.slice(n),i=n;if(r.length>400){let e=t.find(e=>e[0]>=n),a=e?Math.max(0,e[0]-n-24):0,o=a>0?`…`:``;r=o+r.slice(a,a+400),i=n+a-o.length}let a=t.map(([e,t])=>[e-i,t-i]).filter(([e,t])=>t>0&&e<r.length).map(([e,t])=>[Math.max(0,e),Math.min(r.length,t)]);return{text:r,ranges:a}}function a0({isOpen:e,onClose:t,initialScope:n,files:r,changedEntries:i,customMode:a,staged:o,onNavigateFile:s,theme:c,fontSize:l,monoFontFamily:u,defaultTabSize:d,lineWrap:f,showLineNumbers:p,lineHoverHighlight:m}){let[h,g]=(0,W.useState)(``),[_,v]=(0,W.useState)(n),[y,b]=(0,W.useState)(!1),[x,S]=(0,W.useState)(!1),[C,w]=(0,W.useState)(0),[T,E]=(0,W.useState)(null),D=(0,W.useRef)(null),O=(0,W.useRef)(null),k=(0,W.useMemo)(()=>H1(r),[r]),A=(0,W.useMemo)(()=>U1(i),[i]),j=L1({scope:_,query:h,regex:y,changedOnly:x,changedPaths:(0,W.useMemo)(()=>[...k],[k]),open:e}),M=j.data&&j.data.scope===_?j.data:void 0,N=M?.error,P=nt({queryKey:[`repo-files-fallback`],enabled:e&&_===`files`&&!!N,staleTime:6e4,queryFn:async()=>(await(await fetch(`/api/repo-files`)).json()).files??[]});(0,W.useEffect)(()=>{e&&(g(``),v(n),b(!1),S(!1),w(0),E(null))},[e,n]),(0,W.useEffect)(()=>{e&&D.current?.focus()},[e]),(0,W.useEffect)(()=>{w(0),E(null)},[h,_]);let F=(0,W.useMemo)(()=>{let e=h.trim(),t=e.toLowerCase(),n=[];if(_===`files`&&N&&P.data)n=P.data.map(e=>({path:e,score:t?X1(e,t):0})).filter(e=>e.score!==null).sort((e,t)=>t.score-e.score).slice(0,60).map(({path:e})=>({kind:`file`,key:e,hit:{path:e,fileName:tE(e),gitStatus:``,matchType:``,exact:!1},inDiff:k.has(e)}));else if(M)M.scope===`files`?n=M.items.map(e=>({kind:`file`,key:e.path,hit:e,inDiff:k.has(e.path)})):M.scope===`text`?n=M.items.map(e=>({kind:`text`,key:`${e.path}:${e.line}:${e.col}`,hit:e,inDiff:k.has(e.path)})):M.scope===`symbols`?n=M.items.map(e=>({kind:`symbol`,key:`${e.path}:${e.line}:${e.name}`,hit:e,inDiff:k.has(e.path)})):M.scope===`all`&&(n=M.items.map(e=>e.kind===`file`?{kind:`file`,key:`all:${e.hit.path}`,hit:e.hit,inDiff:k.has(e.hit.path)}:e.kind===`text`?{kind:`text`,key:`all:${e.hit.path}:${e.hit.line}:${e.hit.col}`,hit:e.hit,inDiff:k.has(e.hit.path)}:{kind:`symbol`,key:`all:${e.hit.path}:${e.hit.line}:${e.hit.name}`,hit:e.hit,inDiff:k.has(e.hit.path)}));else if(_===`symbols`&&e.length<2){let e=Z1(i);n=(t?e.filter(e=>e.name.toLowerCase().includes(t)):e).map(e=>({kind:`symbol`,key:`local:${e.path}:${e.line}:${e.name}`,hit:e,inDiff:!0}))}let r=n.filter(e=>e.inDiff),a=n.filter(e=>!e.inDiff);return[...r,...a]},[M,N,P.data,_,k,h,i]);(0,W.useEffect)(()=>{C>=F.length&&w(0)},[F.length,C]),(0,W.useEffect)(()=>{(O.current?.querySelector(`[data-focused="true"]`))?.scrollIntoView({block:`nearest`})},[C,F]);let I=(0,W.useMemo)(()=>({diffFileSet:k,changedKeys:A,customMode:a,staged:o}),[k,A,a,o]),L=(0,W.useCallback)((e,n)=>{let r=F[e];if(!r)return;let i=r.hit.path,a=h.trim();if(R1(a,i),r.kind===`file`){if(n){E({path:i});return}W1({kind:`file`,path:i},I).type===`scrollFile`?(t(),requestAnimationFrame(()=>s(i))):E({path:i});return}let o=r.hit.line,c=r.kind===`symbol`?r.hit.name:a;if(n){E({path:i,line:o,match:c});return}let l=W1({kind:`line`,path:i,line:o,match:c},I);l.type===`scrollLine`?(t(),requestAnimationFrame(()=>oE(i,l.line,l.side,l.match))):E({path:i,line:o,match:c})},[F,h,I,t,s]),R=(0,W.useCallback)(e=>{v(t=>Q1[(Q1.findIndex(e=>e.key===t)+e+Q1.length)%Q1.length].key)},[]),z=(0,W.useCallback)(e=>{if(e.key===`PageDown`){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:150,behavior:`auto`});return}if(e.key===`PageUp`){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:-150,behavior:`auto`});return}if(e.altKey&&(e.key===`ArrowDown`||e.key===`j`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:80,behavior:`auto`});return}if(e.altKey&&(e.key===`ArrowUp`||e.key===`k`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:-80,behavior:`auto`});return}if(e.shiftKey&&(e.key===`ArrowDown`||e.key===`j`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:80,behavior:`auto`});return}if(e.shiftKey&&(e.key===`ArrowUp`||e.key===`k`)){e.preventDefault(),document.querySelector(`.searchpalette-preview-body`)?.scrollBy({top:-80,behavior:`auto`});return}if(e.key===`Tab`){e.preventDefault(),R(e.shiftKey?-1:1);return}let t=e=>{F.length!==0&&w(t=>(t+e+F.length)%F.length)};e.key===`ArrowDown`||e.ctrlKey&&(e.key===`n`||e.key===`j`)?(e.preventDefault(),t(1)):e.key===`ArrowUp`||e.ctrlKey&&(e.key===`p`||e.key===`k`)?(e.preventDefault(),t(-1)):e.ctrlKey&&e.key===`d`?(e.preventDefault(),t(8)):e.ctrlKey&&e.key===`u`?(e.preventDefault(),t(-8)):e.key===`Enter`&&(e.preventDefault(),L(C,e.metaKey||e.ctrlKey))},[R,F.length,L,C]),ee=(0,W.useCallback)(()=>{T?E(null):t()},[T,t]),te=M?.total??F.length,B=(j.isFetching||j.pending)&&j.enabled,V=M?.indexing;return(0,G.jsxs)(WU,{open:e,onClose:ee,className:`searchpalette ui-modal--palette ${T?`searchpalette--split`:``}`,ariaLabel:`Search files, text and symbols`,initialFocus:D,onKeyDown:z,children:[(0,G.jsxs)(`div`,{className:`searchpalette-header`,children:[(0,G.jsxs)(`div`,{className:`searchpalette-input-row`,children:[(0,G.jsx)(xO,{size:15,className:`searchpalette-search-icon`}),(0,G.jsx)(`input`,{ref:D,type:`text`,className:`searchpalette-input`,placeholder:_===`all`?`Search files, text and symbols…`:_===`files`?`Search files in the repo…`:_===`text`?y?`Search by regular expression…`:`Search file contents…`:`Search symbol definitions…`,value:h,onChange:e=>g(e.target.value),role:`combobox`,"aria-expanded":F.length>0,"aria-controls":`searchpalette-list`,"aria-activedescendant":F[C]?`sp-row-${C}`:void 0,spellCheck:!1,autoComplete:`off`}),B&&(0,G.jsx)(nO,{size:14,className:`searchpalette-spinner spin`}),h&&(0,G.jsx)(`button`,{className:`searchpalette-clear`,onClick:()=>g(``),"aria-label":`Clear search`,children:(0,G.jsx)(AO,{size:14})}),(0,G.jsx)(`span`,{className:`searchpalette-count`,children:V?`indexing…`:M?`${F.length} of ${te}`:``})]}),(0,G.jsxs)(`div`,{className:`searchpalette-controls`,children:[(0,G.jsx)(`div`,{className:`searchpalette-scopes`,role:`tablist`,"aria-label":`Search scope`,children:Q1.map(e=>(0,G.jsxs)(`button`,{role:`tab`,"aria-selected":_===e.key,className:`searchpalette-scope ${_===e.key?`is-active`:``}`,onClick:()=>v(e.key),children:[(0,G.jsx)(e.Icon,{size:12}),e.label]},e.key))}),(0,G.jsxs)(`div`,{className:`searchpalette-toggles`,children:[_===`text`&&(0,G.jsx)(`button`,{className:`searchpalette-toggle ${y?`is-active`:``}`,onClick:()=>b(e=>!e),title:`Regular expression`,"aria-pressed":y,children:`.*`}),(0,G.jsxs)(`button`,{className:`searchpalette-toggle ${x?`is-active`:``}`,onClick:()=>S(e=>!e),title:`Limit to files in the current diff`,"aria-pressed":x,children:[(0,G.jsx)(XD,{size:12}),`Changed`]})]})]}),M?.regexError&&(0,G.jsx)(`div`,{className:`searchpalette-note`,children:`Invalid regex — showing literal matches`})]}),(0,G.jsxs)(`div`,{className:`searchpalette-body`,children:[(0,G.jsx)(`div`,{className:`searchpalette-list`,id:`searchpalette-list`,role:`listbox`,ref:O,children:(0,G.jsx)(o0,{rows:F,scope:_,query:h,focusedIndex:C,engineError:N,isFetching:j.isFetching,enabled:j.enabled,minLength:j.minLength,regex:y,changedOnly:x,onHover:w,onActivate:(e,t)=>L(e,t?t.metaKey||t.ctrlKey:!1),onRetry:()=>j.refetch()})}),T&&(0,G.jsx)(f0,{preview:T,theme:c,fontSize:l,monoFontFamily:u,defaultTabSize:d,lineWrap:f,showLineNumbers:p,lineHoverHighlight:m,onClose:()=>E(null),inDiff:k.has(T.path),onGoToDiff:()=>{t(),T.line?requestAnimationFrame(()=>oE(T.path,T.line,`additions`,T.match)):requestAnimationFrame(()=>s(T.path))}},T.path)]}),(0,G.jsxs)(`div`,{className:`searchpalette-foot`,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`Tab`}),` scope`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`↑↓`}),` move`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`↵`}),` `,T&&k.has(T.path)?`view in diff`:`open`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`⌘↵`}),` peek`]}),T&&(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`⌥↑↓`}),` / `,(0,G.jsx)(`kbd`,{children:`⇧↑↓`}),` scroll preview`]}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{children:`esc`}),` `,T?`back`:`close`]})]})]})}function o0({rows:e,scope:t,query:n,focusedIndex:r,engineError:i,isFetching:a,enabled:o,minLength:s,regex:c,changedOnly:l,onHover:u,onActivate:d,onRetry:f}){return i&&t!==`files`?(0,G.jsxs)(`div`,{className:`searchpalette-state searchpalette-state--error`,children:[(0,G.jsx)(`p`,{children:`Search engine unavailable`}),(0,G.jsx)(`span`,{className:`searchpalette-state-detail`,children:i}),(0,G.jsx)(`button`,{className:`searchpalette-retry`,onClick:f,children:`Retry`})]}):e.length>0?(0,G.jsx)(G.Fragment,{children:e.map((e,t)=>(0,G.jsx)(s0,{row:e,index:t,query:n,focused:t===r,onHover:u,onActivate:d},e.key))}):o?a?(0,G.jsxs)(`div`,{className:`searchpalette-state`,children:[(0,G.jsx)(nO,{size:15,className:`spin`}),` Searching…`]}):(0,G.jsxs)(`div`,{className:`searchpalette-state`,children:[(0,G.jsxs)(`p`,{children:[`No matches`,n.trim()?` for “${n.trim()}”`:``]}),(0,G.jsx)(`span`,{className:`searchpalette-state-detail`,children:l?`Searching only changed files — turn off Changed to search the whole repo`:t===`text`&&!c?`Try Tab to switch scope, or enable .* for regex`:`Try Tab to switch scope`})]}):(0,G.jsx)(`div`,{className:`searchpalette-state`,children:t===`symbols`?n.trim()?`No matching symbols in the current diff. Type at least 2 characters to search the whole repository.`:`No symbols found in the current diff. Type at least 2 characters to search the whole repository.`:t===`text`?`Type to search file contents`:`Type to filter — or browse all files`})}function s0({row:e,index:t,query:n,focused:r,onHover:i,onActivate:a}){let o=e0(e.hit.gitStatus);return(0,G.jsxs)(`div`,{id:`sp-row-${t}`,role:`option`,"aria-selected":r,"data-focused":r,className:`searchpalette-row ${r?`is-focused`:``} ${e.inDiff?`is-indiff`:``}`,onMouseEnter:()=>i(t),onClick:e=>a(t,e),children:[e.kind===`file`&&(0,G.jsx)(c0,{hit:e.hit,query:n}),e.kind===`text`&&(0,G.jsx)(l0,{hit:e.hit,query:n}),e.kind===`symbol`&&(0,G.jsx)(u0,{hit:e.hit}),(0,G.jsxs)(`div`,{className:`searchpalette-rail`,children:[e.inDiff&&(0,G.jsx)(`span`,{className:`searchpalette-pill searchpalette-pill--diff`,children:`diff`}),o&&(0,G.jsx)(`span`,{className:`searchpalette-git searchpalette-git--${o.title}`,title:o.title,children:o.label})]})]})}function c0({hit:e,query:t}){let n=e.fileName,r=n0(n,t);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`searchpalette-tile searchpalette-tile--file`,children:(0,G.jsx)(qD,{size:13})}),(0,G.jsxs)(`div`,{className:`searchpalette-info`,children:[(0,G.jsx)(`span`,{className:`searchpalette-primary`,children:(0,G.jsx)(t0,{text:n,ranges:r})}),(0,G.jsx)(`span`,{className:`searchpalette-secondary`,children:r0(e.path)||`./`})]})]})}function l0({hit:e,query:t}){let n=J1(e.content,e.matchRanges,t),{text:r,ranges:i}=i0(e.content,n);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`searchpalette-tile searchpalette-tile--text`,children:(0,G.jsx)(DO,{size:13})}),(0,G.jsxs)(`div`,{className:`searchpalette-info`,children:[(0,G.jsx)(`span`,{className:`searchpalette-primary searchpalette-code`,children:(0,G.jsx)(t0,{text:r,ranges:i})}),(0,G.jsxs)(`span`,{className:`searchpalette-secondary`,children:[e.fileName,`:`,e.line,(0,G.jsx)(`span`,{className:`searchpalette-crumb`,children:r0(e.path)})]})]})]})}function u0({hit:e}){let t=e.content.indexOf(e.name),n=t>=0?e.content.slice(t+e.name.length).trimEnd():``,r=J1(e.name,e.matchRanges.length?d0(e):void 0,e.name);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`searchpalette-tile searchpalette-tile--symbol`,title:e.kind,children:$1[e.kind]??`?`}),(0,G.jsxs)(`div`,{className:`searchpalette-info`,children:[(0,G.jsxs)(`span`,{className:`searchpalette-primary`,children:[(0,G.jsx)(t0,{text:e.name,ranges:r}),n&&(0,G.jsx)(`span`,{className:`searchpalette-sigtail`,children:n.slice(0,60)})]}),(0,G.jsxs)(`span`,{className:`searchpalette-secondary`,children:[e.fileName,`:`,e.line,(0,G.jsx)(`span`,{className:`searchpalette-crumb`,children:r0(e.path)})]})]}),(0,G.jsx)(`span`,{className:`searchpalette-kind-badge`,children:e.kind})]})}function d0(e){let t=e.content.indexOf(e.name);if(t<0)return;let n=[];for(let[r,i]of e.matchRanges){let a=r-t,o=i-t;o>0&&a<e.name.length&&n.push([Math.max(0,a),Math.min(e.name.length,o)])}return n.length?n:void 0}function f0({preview:e,theme:t,fontSize:n,monoFontFamily:r,defaultTabSize:i,lineWrap:a,showLineNumbers:o,lineHoverHighlight:s,onClose:c,inDiff:l,onGoToDiff:u}){let d=nE[t]||nE.nord,{data:f,isLoading:p,error:m}=z1(e.path),h=(0,W.useRef)(null);return(0,W.useEffect)(()=>{!f?.content||!e.line||!h.current||aE(h.current,e.line,e.match)},[f?.content,e.line,e.match]),(0,G.jsxs)(`div`,{className:`searchpalette-preview`,children:[(0,G.jsxs)(`div`,{className:`searchpalette-preview-head`,children:[(0,G.jsx)(qD,{size:12}),(0,G.jsx)(`span`,{className:`searchpalette-preview-path`,children:e.path}),l&&(0,G.jsxs)(`button`,{className:`searchpalette-preview-diff-btn`,onClick:u,title:`Open this file and line in the main diff viewer (Enter)`,style:{padding:`2.5px 8px`,fontSize:`10.5px`,background:`var(--accent-subtle)`,border:`1px solid var(--accent)`,borderRadius:`4px`,color:`var(--text-primary)`,cursor:`pointer`,fontWeight:600,marginRight:`8px`,display:`inline-flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsx)(XD,{size:11}),`View in Diff`]}),(0,G.jsx)(`button`,{className:`searchpalette-clear`,onClick:c,"aria-label":`Close preview`,children:(0,G.jsx)(AO,{size:14})})]}),(0,G.jsx)(`div`,{className:`searchpalette-preview-body`,ref:h,children:p?(0,G.jsxs)(`div`,{className:`searchpalette-state`,children:[(0,G.jsx)(nO,{size:15,className:`spin`}),` Loading `,e.path,`…`]}):m?(0,G.jsx)(`div`,{className:`searchpalette-state searchpalette-state--error`,children:m.message}):f?.binary?(0,G.jsx)(`div`,{className:`searchpalette-state`,children:`Binary file — no preview`}):f?.missing?(0,G.jsx)(`div`,{className:`searchpalette-state`,children:`File not present in the working tree`}):f?(0,G.jsx)(Bh,{file:{name:e.path,contents:f.content??``},options:{disableFileHeader:!0,overflow:a?`wrap`:`scroll`,disableLineNumbers:!o,lineHoverHighlight:s,theme:{dark:d.type===`dark`?d.themeName:`nord`,light:d.type===`light`?d.themeName:`github-light`},themeType:d.type,unsafeCSS:`
|
|
3848
3848
|
:host {
|
|
3849
3849
|
--diffs-tab-size: ${i} !important;
|
|
3850
3850
|
--diffs-font-family: ${r} !important;
|
|
@@ -3857,11 +3857,11 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
|
|
|
3857
3857
|
font-variant-ligatures: common-ligatures !important;
|
|
3858
3858
|
font-feature-settings: "liga" on, "calt" on !important;
|
|
3859
3859
|
}
|
|
3860
|
-
`}}):null})]})}var r0=(0,W.memo)(function({activeFile:e,onShowHelp:t,placeholder:n=`No active file (J/K to jump)`}){let[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(!1),s=(0,W.useRef)(null);(0,W.useEffect)(()=>{let e=()=>{let e=document.activeElement;if(e){let t=e.tagName.toLowerCase();i(t===`input`||t===`textarea`||e.hasAttribute(`contenteditable`))}else i(!1)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,e);let t=setInterval(e,400);return()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,e),clearInterval(t)}},[]),(0,W.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`b`&&(e.preventDefault(),o(e=>!e))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[]);let c=e?e.split(`/`).pop():null,l=e&&e.includes(`/`)?e.split(`/`).slice(0,-1).join(`/`)+`/`:``,u=(0,W.useCallback)(e=>{e?.stopPropagation(),o(e=>!e)},[]);return(0,G.jsxs)(`div`,{className:`vim-status-bar ${a?`vim-status-collapsed`:``}`,children:[(0,G.jsx)(`div`,{className:`vim-mode-badge ${r?`vim-mode-insert`:`vim-mode-normal`}`,children:r?`INSERT`:`NORMAL`}),!a&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`vim-status-content`,children:[(0,G.jsx)(wO,{size:12,className:`vim-status-icon`}),e?(0,G.jsxs)(`span`,{className:`vim-status-file`,title:e,children:[(0,G.jsx)(`span`,{className:`vim-file-dir`,children:l}),(0,G.jsx)(`strong`,{className:`vim-file-name`,children:c})]}):(0,G.jsx)(`span`,{className:`vim-status-placeholder`,children:n})]}),(0,G.jsxs)(`button`,{className:`vim-status-help-btn`,onClick:t,title:`View Keyboard Shortcuts (?)`,children:[(0,G.jsx)(RD,{size:13}),(0,G.jsx)(`span`,{children:`Shortcuts`}),(0,G.jsx)(`kbd`,{className:`vim-kbd-small`,children:`?`})]})]}),(0,G.jsx)(`button`,{ref:s,className:`vim-status-toggle`,onClick:u,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),u(e))},title:a?`Expand status bar (⌘B)`:`Collapse status bar (⌘B)`,"aria-label":a?`Expand status bar`:`Collapse status bar`,tabIndex:0,children:a?(0,G.jsx)(PD,{size:12}):(0,G.jsx)(ND,{size:12})})]})}),i0=(0,W.memo)(function({isOpen:e,onClose:t,mode:n=`diff`}){let r=n===`plan`?[{title:`Scrolling & Content`,icon:(0,G.jsx)(uO,{size:15}),items:[{keys:[`j`],description:`Scroll Down slightly`},{keys:[`k`],description:`Scroll Up slightly`},{keys:[`Ctrl`,`d`],description:`Scroll Down half page`},{keys:[`Ctrl`,`u`],description:`Scroll Up half page`},{keys:[`g`,`g`],description:`Scroll to Top of plan`},{keys:[`G`],description:`Scroll to Bottom of plan`}]},{title:`Plan Navigation`,icon:(0,G.jsx)(eO,{size:15}),items:[{keys:[`J`],description:`Jump to Next Plan in list`},{keys:[`K`],description:`Jump to Previous Plan in list`},{keys:[`b`],description:`Toggle Plans Sidebar Panel collapse`}]},{title:`Search & Dialogs`,icon:(0,G.jsx)(KD,{size:15}),items:[{keys:[`g`,`t`],description:`Open Theme Selection Modal`},{keys:[`?`],description:`Toggle Keyboard Shortcuts Guide`},{keys:[`Esc`],description:`Close preview / dialog`}]},{title:`Views & Formatting`,icon:(0,G.jsx)(cO,{size:15}),items:[{keys:[`m`],description:`Toggle View Mode (Source / Rendered)`},{keys:[`t`],description:`Cycle Tab Indentation Size (2 → 4 → 8)`},{keys:[`w`],description:`Toggle Soft-Wrap Long Lines`},{keys:[`n`],description:`Toggle Line Numbers`},{keys:[`⌘`,`Shift`,`P`],description:`Toggle Preview Mode in Comments`}]}]:[{title:`Scrolling & Diffs`,icon:(0,G.jsx)(uO,{size:15}),items:[{keys:[`j`],description:`Scroll Down slightly`},{keys:[`k`],description:`Scroll Up slightly`},{keys:[`Ctrl`,`d`],description:`Scroll Down half page`},{keys:[`Ctrl`,`u`],description:`Scroll Up half page`},{keys:[`g`,`g`],description:`Scroll to Top of diffs`},{keys:[`G`],description:`Scroll to Bottom of diffs`}]},{title:`File Navigation`,icon:(0,G.jsx)(eO,{size:15}),items:[{keys:[`J`],description:`Jump to Next File Diff`},{keys:[`K`],description:`Jump to Previous File Diff`},{keys:[`v`],description:`Toggle Viewed state for Active File`},{keys:[`b`],description:`Toggle Sidebar Panel collapse`}]},{title:`Search & Dialogs`,icon:(0,G.jsx)(KD,{size:15}),items:[{keys:[`⌘`,`K`],description:`Open Search Palette (files · text · symbols)`},{keys:[`/`],description:`Search file contents (Text scope)`},{keys:[`g`,`f`],description:`Search files (Files scope)`},{keys:[`s`],description:`Search symbols (or "g s")`},{keys:[`g`,`v`],description:`Browse any file in the repo`},{keys:[`g`,`t`],description:`Open Theme Selection Modal`},{keys:[`Tab`],description:`Cycle search scope while open`},{keys:[`⌘`,`↵`],description:`Peek a result in the preview pane`},{keys:[`?`],description:`Toggle Keyboard Shortcuts Guide`},{keys:[`Esc`],description:`Close preview / dialog`}]},{title:`Views & Formatting`,icon:(0,G.jsx)(cO,{size:15}),items:[{keys:[`m`],description:`Toggle Diff Style (Split / Unified)`},{keys:[`t`],description:`Cycle Tab Indentation Size (2 → 4 → 8)`},{keys:[`w`],description:`Toggle Soft-Wrap Long Lines`},{keys:[`n`],description:`Toggle Line Numbers`},{keys:[`i`],description:`Cycle Diff Indicator Style (+/− → bars → none)`},{keys:[`Shift`,`I`],description:`Cycle Inline Diff Style (word → char → none)`},{keys:[`⌘`,`Shift`,`P`],description:`Toggle Preview Mode in Comments`}]}];return(0,G.jsxs)(PU,{open:e,onClose:t,className:`shortcuts-modal`,ariaLabel:`Keyboard shortcuts`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header-title`,children:[(0,G.jsx)(eO,{size:18,className:`shortcuts-icon`}),(0,G.jsx)(`h2`,{children:`Developer Keyboard Shortcuts`})]}),(0,G.jsx)(`button`,{className:`shortcuts-close-btn`,onClick:t,"aria-label":`Close dialog`,children:(0,G.jsx)(AO,{size:16})})]}),(0,G.jsxs)(`div`,{className:`shortcuts-body`,children:[(0,G.jsx)(`div`,{className:`shortcuts-intro`,children:`Vim-style keybindings are enabled! Navigate and review plans entirely from your home keys.`}),(0,G.jsx)(`div`,{className:`shortcuts-grid`,children:r.map((e,t)=>(0,G.jsxs)(`div`,{className:`shortcuts-section`,children:[(0,G.jsxs)(`h3`,{className:`shortcuts-section-title`,children:[e.icon,(0,G.jsx)(`span`,{children:e.title})]}),(0,G.jsx)(`div`,{className:`shortcuts-list`,children:e.items.map((e,t)=>(0,G.jsxs)(`div`,{className:`shortcuts-row`,children:[(0,G.jsx)(`span`,{className:`shortcuts-desc`,children:e.description}),(0,G.jsx)(`div`,{className:`shortcuts-keys`,children:e.keys.map((t,n)=>(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{className:`vim-kbd`,children:t}),n<e.keys.length-1&&(0,G.jsx)(`span`,{className:`kbd-plus`,children:`+`})]},n))})]},t))})]},t))})]}),(0,G.jsxs)(`div`,{className:`shortcuts-footer`,children:[`Press `,(0,G.jsx)(`kbd`,{className:`vim-kbd-small`,children:`?`}),` to dismiss this menu at any time.`]})]})});function a0({activity:e,onDismiss:t,onJump:n}){if((0,W.useEffect)(()=>{if(!e)return;let n=setTimeout(t,8e3);return()=>clearTimeout(n)},[e,t]),!e)return null;let r=e.body.length>120?`${e.body.slice(0,120)}…`:e.body;return(0,G.jsxs)(`div`,{className:`agent-toast`,role:`status`,"aria-live":`polite`,children:[(0,G.jsxs)(`button`,{className:`agent-toast-body`,onClick:()=>{n(e.filePath),t()},title:`Jump to the file`,children:[(0,G.jsx)(`span`,{className:`agent-toast-icon`,children:(0,G.jsx)(AD,{size:16})}),(0,G.jsxs)(`span`,{className:`agent-toast-text`,children:[(0,G.jsxs)(`span`,{className:`agent-toast-title`,children:[`Agent replied`,e.model?` · ${e.model}`:``]}),(0,G.jsx)(`span`,{className:`agent-toast-file`,children:e.filePath}),(0,G.jsx)(`span`,{className:`agent-toast-preview`,children:r})]})]}),(0,G.jsx)(`button`,{className:`agent-toast-close`,onClick:t,"aria-label":`Dismiss`,children:(0,G.jsx)(AO,{size:14})})]})}var o0=[{id:`nord`,name:`Nord (Main)`,type:`dark`,colors:{bg:`#2e3440`,secondary:`#242933`,accent:`#88c0d0`}},{id:`github-dark`,name:`GitHub Dark`,type:`dark`,colors:{bg:`#0d1117`,secondary:`#161b22`,accent:`#58a6ff`}},{id:`github-dark-dimmed`,name:`GitHub Dark Dimmed`,type:`dark`,colors:{bg:`#22272e`,secondary:`#1c2128`,accent:`#539bf5`}},{id:`github-dark-high-contrast`,name:`GitHub Dark HC`,type:`dark`,colors:{bg:`#0a0c10`,secondary:`#010409`,accent:`#409eff`}},{id:`github-light`,name:`GitHub Light`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f6f8fa`,accent:`#0969da`}},{id:`github-light-high-contrast`,name:`GitHub Light HC`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f6f8fa`,accent:`#0969da`}},{id:`dracula`,name:`Dracula`,type:`dark`,colors:{bg:`#282a36`,secondary:`#1e1f29`,accent:`#bd93f9`}},{id:`one-dark`,name:`One Dark`,type:`dark`,colors:{bg:`#282c34`,secondary:`#21252b`,accent:`#61afef`}},{id:`synthwave-84`,name:`Synthwave '84`,type:`dark`,colors:{bg:`#2b213a`,secondary:`#241b2f`,accent:`#f92aad`}},{id:`tokyo-night`,name:`Tokyo Night`,type:`dark`,colors:{bg:`#1a1b26`,secondary:`#16161e`,accent:`#7aa2f7`}},{id:`catppuccin-mocha`,name:`Catppuccin Mocha`,type:`dark`,colors:{bg:`#1e1e2e`,secondary:`#181825`,accent:`#cba6f7`}},{id:`catppuccin-frappe`,name:`Catppuccin Frappé`,type:`dark`,colors:{bg:`#303446`,secondary:`#292c3c`,accent:`#ca9ee6`}},{id:`catppuccin-macchiato`,name:`Catppuccin Macchiato`,type:`dark`,colors:{bg:`#24273a`,secondary:`#1e2030`,accent:`#c6a0f6`}},{id:`catppuccin-latte`,name:`Catppuccin Latte`,type:`light`,colors:{bg:`#eff1f5`,secondary:`#e6e9ef`,accent:`#8839ef`}},{id:`solarized-dark`,name:`Solarized Dark`,type:`dark`,colors:{bg:`#002b36`,secondary:`#073642`,accent:`#268bd2`}},{id:`solarized-light`,name:`Solarized Light`,type:`light`,colors:{bg:`#fdf6e3`,secondary:`#eee8d5`,accent:`#268bd2`}},{id:`monokai`,name:`Monokai`,type:`dark`,colors:{bg:`#272822`,secondary:`#1d1e19`,accent:`#f92672`}},{id:`ayu-dark`,name:`Ayu Dark`,type:`dark`,colors:{bg:`#0a0e14`,secondary:`#0d1117`,accent:`#e6b450`}},{id:`ayu-light`,name:`Ayu Light`,type:`light`,colors:{bg:`#fafafa`,secondary:`#f3f3f3`,accent:`#ff9900`}},{id:`nightfox`,name:`Nightfox`,type:`dark`,colors:{bg:`#192330`,secondary:`#131a24`,accent:`#719cd6`}},{id:`nordfox`,name:`Nordfox`,type:`dark`,colors:{bg:`#2e3440`,secondary:`#232831`,accent:`#81a1c1`}},{id:`duskfox`,name:`Duskfox`,type:`dark`,colors:{bg:`#232136`,secondary:`#1d1b2d`,accent:`#86b3b3`}},{id:`terafox`,name:`Terafox`,type:`dark`,colors:{bg:`#152528`,secondary:`#0f1c1e`,accent:`#5a93aa`}},{id:`carbonfox`,name:`Carbonfox`,type:`dark`,colors:{bg:`#161616`,secondary:`#111111`,accent:`#78a9ff`}},{id:`dayfox`,name:`Dayfox`,type:`light`,colors:{bg:`#f6f2ee`,secondary:`#ebe5df`,accent:`#2848a9`}},{id:`dawnfox`,name:`Dawnfox`,type:`light`,colors:{bg:`#eae5e5`,secondary:`#e0d8d8`,accent:`#614d85`}},{id:`andromeeda`,name:`Andromeeda`,type:`dark`,colors:{bg:`#090b10`,secondary:`#0e1117`,accent:`#00e8c6`}},{id:`aurora-x`,name:`Aurora X`,type:`dark`,colors:{bg:`#07090f`,secondary:`#0c0e15`,accent:`#2eb5e5`}},{id:`dark-plus`,name:`Dark+ (VS Code)`,type:`dark`,colors:{bg:`#1e1e1e`,secondary:`#252526`,accent:`#0e639c`}},{id:`light-plus`,name:`Light+ (VS Code)`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f3f3f3`,accent:`#007acc`}},{id:`houston`,name:`Houston (Astro)`,type:`dark`,colors:{bg:`#131415`,secondary:`#17191e`,accent:`#ff5d01`}},{id:`laserwave`,name:`Laserwave`,type:`dark`,colors:{bg:`#1b1d28`,secondary:`#181a23`,accent:`#ffe261`}},{id:`material-theme`,name:`Material Theme`,type:`dark`,colors:{bg:`#263238`,secondary:`#1e272c`,accent:`#80cbd8`}},{id:`material-theme-darker`,name:`Material Darker`,type:`dark`,colors:{bg:`#212121`,secondary:`#1a1a1a`,accent:`#80cbd8`}},{id:`material-theme-lighter`,name:`Material Lighter`,type:`light`,colors:{bg:`#fafafa`,secondary:`#eeeded`,accent:`#80cbd8`}},{id:`material-theme-ocean`,name:`Material Ocean`,type:`dark`,colors:{bg:`#0f111a`,secondary:`#090b10`,accent:`#80cbd8`}},{id:`material-theme-palenight`,name:`Material Palenight`,type:`dark`,colors:{bg:`#292d3e`,secondary:`#202331`,accent:`#80cbd8`}},{id:`min-dark`,name:`Min Dark`,type:`dark`,colors:{bg:`#1f1f1f`,secondary:`#181818`,accent:`#ffffff`}},{id:`min-light`,name:`Min Light`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f5f5f5`,accent:`#111111`}},{id:`night-owl`,name:`Night Owl`,type:`dark`,colors:{bg:`#011627`,secondary:`#0b2942`,accent:`#7fdbca`}},{id:`one-light`,name:`One Light`,type:`light`,colors:{bg:`#fafafa`,secondary:`#f0f0f0`,accent:`#40a9ff`}},{id:`plastic`,name:`Plastic`,type:`dark`,colors:{bg:`#21252b`,secondary:`#1b1d23`,accent:`#61afef`}},{id:`poimandres`,name:`Poimandres`,type:`dark`,colors:{bg:`#1b1e28`,secondary:`#171922`,accent:`#50cad2`}},{id:`rose-pine`,name:`Rosé Pine`,type:`dark`,colors:{bg:`#191724`,secondary:`#1f1d2e`,accent:`#c4a7e7`}},{id:`rose-pine-moon`,name:`Rosé Pine Moon`,type:`dark`,colors:{bg:`#232136`,secondary:`#2a283e`,accent:`#c4a7e7`}},{id:`rose-pine-dawn`,name:`Rosé Pine Dawn`,type:`light`,colors:{bg:`#faf4ed`,secondary:`#f2e9e1`,accent:`#907aa9`}},{id:`slack-dark`,name:`Slack Dark`,type:`dark`,colors:{bg:`#1a1d21`,secondary:`#222529`,accent:`#36c5f0`}},{id:`slack-ochre`,name:`Slack Ochre`,type:`dark`,colors:{bg:`#222222`,secondary:`#2b2b2b`,accent:`#e8912d`}},{id:`vesper`,name:`Vesper`,type:`dark`,colors:{bg:`#101010`,secondary:`#161616`,accent:`#ffc600`}},{id:`vitesse-black`,name:`Vitesse Black`,type:`dark`,colors:{bg:`#000000`,secondary:`#0b0b0b`,accent:`#4d9375`}},{id:`vitesse-dark`,name:`Vitesse Dark`,type:`dark`,colors:{bg:`#121212`,secondary:`#181818`,accent:`#4d9375`}},{id:`vitesse-light`,name:`Vitesse Light`,type:`light`,colors:{bg:`#ffffff`,secondary:`#fafafa`,accent:`#1b655f`}}];function s0({open:e,activeTheme:t,onThemeChange:n,onClose:r}){let[i,a]=(0,W.useState)(``),[o,s]=(0,W.useState)(`all`),[c,l]=(0,W.useState)(0),u=(0,W.useRef)(null),d=(0,W.useRef)(null),f=(0,W.useRef)([]);(0,W.useEffect)(()=>{e&&(a(``),s(`all`),l(0),setTimeout(()=>{u.current?.focus()},50))},[e]);let p=(0,W.useMemo)(()=>{let e=i.toLowerCase().trim();return o0.filter(t=>{let n=t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e),r=o===`all`||t.type===o;return n&&r})},[i,o]);return(0,W.useEffect)(()=>{c>=p.length&&l(Math.max(0,p.length-1))},[p,c]),(0,W.useEffect)(()=>{e&&f.current[c]&&f.current[c]?.scrollIntoView({block:`nearest`,behavior:`smooth`})},[c,e]),(0,G.jsx)(PU,{open:e,onClose:r,className:`theme-modal`,ariaLabel:`Theme Selector Modal`,children:(0,G.jsxs)(`div`,{className:`theme-modal-content`,onKeyDown:e=>{let t=p.length;if(e.key===`Escape`){e.preventDefault(),r();return}if(t!==0)switch(e.key){case`ArrowRight`:e.preventDefault(),l(e=>Math.min(e+1,t-1));break;case`ArrowLeft`:e.preventDefault(),l(e=>Math.max(e-1,0));break;case`ArrowDown`:e.preventDefault(),c+2<t?l(c+2):l(t-1);break;case`ArrowUp`:e.preventDefault(),c-2>=0&&l(c-2);break;case`Enter`:e.preventDefault(),p[c]&&(n(p[c].id),r());break;default:break}},children:[(0,G.jsxs)(`div`,{className:`theme-modal-header`,children:[(0,G.jsxs)(`div`,{className:`theme-modal-title-row`,children:[(0,G.jsx)(`h2`,{className:`theme-modal-title`,children:`Select Color Theme`}),(0,G.jsx)(`button`,{className:`theme-modal-close-btn`,onClick:r,"aria-label":`Close`,children:(0,G.jsx)(AO,{size:16})})]}),(0,G.jsxs)(`div`,{className:`theme-modal-search-wrapper`,children:[(0,G.jsx)(xO,{className:`theme-modal-search-icon`,size:16}),(0,G.jsx)(`input`,{ref:u,type:`text`,className:`theme-modal-search-input`,placeholder:`Search themes... (e.g. nordfox, github)`,value:i,onChange:e=>{a(e.target.value),l(0)}}),i&&(0,G.jsx)(`button`,{className:`theme-modal-clear-btn`,onClick:()=>{a(``),l(0),u.current?.focus()},children:(0,G.jsx)(AO,{size:14})})]}),(0,G.jsxs)(`div`,{className:`theme-modal-filters`,children:[(0,G.jsxs)(`button`,{className:`theme-filter-tab ${o===`all`?`active`:``}`,onClick:()=>{s(`all`),l(0),u.current?.focus()},children:[`All Themes (`,o0.length,`)`]}),(0,G.jsxs)(`button`,{className:`theme-filter-tab ${o===`dark`?`active`:``}`,onClick:()=>{s(`dark`),l(0),u.current?.focus()},children:[(0,G.jsx)(lO,{size:12,style:{marginRight:`6px`}}),`Dark (`,o0.filter(e=>e.type===`dark`).length,`)`]}),(0,G.jsxs)(`button`,{className:`theme-filter-tab ${o===`light`?`active`:``}`,onClick:()=>{s(`light`),l(0),u.current?.focus()},children:[(0,G.jsx)(CO,{size:12,style:{marginRight:`6px`}}),`Light (`,o0.filter(e=>e.type===`light`).length,`)`]})]})]}),(0,G.jsx)(`div`,{ref:d,className:`theme-modal-list`,children:p.length===0?(0,G.jsxs)(`div`,{className:`theme-modal-empty`,children:[(0,G.jsxs)(`p`,{className:`theme-modal-empty-text`,children:[`No themes matching "`,i,`"`]}),(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>{a(``),s(`all`),l(0),u.current?.focus()},children:`Reset Search`})]}):(0,G.jsx)(`div`,{className:`theme-modal-grid`,children:p.map((e,i)=>{let a=t===e.id;return(0,G.jsxs)(`button`,{ref:e=>{f.current[i]=e},type:`button`,className:`theme-modal-card ${a?`active`:``} ${c===i?`focused`:``}`,onClick:()=>{n(e.id),r()},onMouseEnter:()=>l(i),children:[(0,G.jsxs)(`div`,{className:`theme-card-info`,children:[(0,G.jsx)(`span`,{className:`theme-card-name`,children:e.name}),(0,G.jsx)(`span`,{className:`theme-card-meta`,children:e.type===`dark`?(0,G.jsx)(`span`,{className:`theme-meta-tag dark-tag`,children:`Dark`}):(0,G.jsx)(`span`,{className:`theme-meta-tag light-tag`,children:`Light`})})]}),(0,G.jsxs)(`div`,{className:`theme-card-right`,children:[(0,G.jsxs)(`span`,{className:`theme-swatches`,children:[(0,G.jsx)(`span`,{className:`theme-swatch`,style:{background:e.colors.bg},title:`Background`}),(0,G.jsx)(`span`,{className:`theme-swatch`,style:{background:e.colors.secondary},title:`Secondary`}),(0,G.jsx)(`span`,{className:`theme-swatch`,style:{background:e.colors.accent},title:`Accent`})]}),(0,G.jsx)(`span`,{className:`theme-card-status`,children:a&&(0,G.jsx)(jD,{size:14,className:`theme-check-icon`})})]})]},e.id)})})}),(0,G.jsxs)(`div`,{className:`theme-modal-footer`,children:[(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`↑`}),` `,(0,G.jsx)(`kbd`,{children:`↓`}),` `,(0,G.jsx)(`kbd`,{children:`←`}),` `,(0,G.jsx)(`kbd`,{children:`→`}),` Navigate`]}),(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`Enter`}),` Select`]}),(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`ESC`}),` Close`]})]})]})})}var c0=`Cascadia Code.Cascadia Mono.Consolas.Courier New.Dank Mono.Fantasque Sans Mono.Fira Code.Fira Mono.Geist Mono.Hack.IBM Plex Mono.Inconsolata.Input Mono.JetBrains Mono.Maple Mono.Menlo.Monaco.Monoid.Monaspace Argon.Monaspace Krypton.Monaspace Neon.Monaspace Radon.Monaspace Xenon.Noto Sans Mono.Operator Mono.Roboto Mono.SF Mono.Source Code Pro.Space Mono.Ubuntu Mono.Victor Mono`.split(`.`);async function l0(){if(`queryLocalFonts`in window)try{let e=await window.queryLocalFonts();return[...new Set(e.map(e=>e.family))].sort((e,t)=>e.localeCompare(t))}catch{}return c0}function u0({open:e,title:t,defaultLabel:n,activeFont:r,onFontChange:i,onClose:a}){let[o,s]=(0,W.useState)(``),[c,l]=(0,W.useState)([]),[u,d]=(0,W.useState)(!1),[f,p]=(0,W.useState)(0),m=(0,W.useRef)(null),h=(0,W.useRef)(null),g=(0,W.useRef)([]);(0,W.useEffect)(()=>{e&&(s(``),p(0),setTimeout(()=>m.current?.focus(),50),!(c.length>0)&&(d(!0),l0().then(e=>{l(e),d(!1)})))},[e]);let _=(0,W.useMemo)(()=>{let e=o.toLowerCase().trim();return e?c.filter(t=>t.toLowerCase().includes(e)):c},[c,o]),v=_.length+1;(0,W.useEffect)(()=>{f>=v&&p(Math.max(0,v-1))},[v,f]),(0,W.useEffect)(()=>{e&&(f===0?g.current[0]:g.current[f])?.scrollIntoView({block:`nearest`,behavior:`smooth`})},[f,e]);let y=e=>{i(e),a()},b=e=>{if(e.key===`Escape`){e.preventDefault(),a();return}if(v!==0)switch(e.key){case`ArrowDown`:e.preventDefault(),p(e=>Math.min(e+1,v-1));break;case`ArrowUp`:e.preventDefault(),p(e=>Math.max(e-1,0));break;case`Enter`:e.preventDefault(),f===0?y(null):_[f-1]&&y(_[f-1]);break}},x=!r;return(0,G.jsx)(PU,{open:e,onClose:a,className:`theme-modal`,ariaLabel:`${t} Modal`,children:(0,G.jsxs)(`div`,{className:`theme-modal-content`,onKeyDown:b,children:[(0,G.jsxs)(`div`,{className:`theme-modal-header`,children:[(0,G.jsxs)(`div`,{className:`theme-modal-title-row`,children:[(0,G.jsx)(`h2`,{className:`theme-modal-title`,children:t}),(0,G.jsx)(`button`,{className:`theme-modal-close-btn`,onClick:a,"aria-label":`Close`,children:(0,G.jsx)(AO,{size:16})})]}),(0,G.jsxs)(`div`,{className:`theme-modal-search-wrapper`,children:[(0,G.jsx)(xO,{className:`theme-modal-search-icon`,size:16}),(0,G.jsx)(`input`,{ref:m,type:`text`,className:`theme-modal-search-input`,placeholder:`Search fonts...`,value:o,onChange:e=>{s(e.target.value),p(0)}}),o&&(0,G.jsx)(`button`,{className:`theme-modal-clear-btn`,onClick:()=>{s(``),p(0),m.current?.focus()},children:(0,G.jsx)(AO,{size:14})})]})]}),(0,G.jsx)(`div`,{ref:h,className:`theme-modal-list`,children:u?(0,G.jsx)(`div`,{className:`theme-modal-empty`,children:(0,G.jsx)(`p`,{className:`theme-modal-empty-text`,children:`Loading fonts…`})}):(0,G.jsxs)(`div`,{className:`font-picker-list`,children:[(0,G.jsxs)(`button`,{ref:e=>{g.current[0]=e},type:`button`,className:`font-picker-item ${x?`active`:``} ${f===0?`focused`:``}`,onClick:()=>y(null),onMouseEnter:()=>p(0),children:[(0,G.jsxs)(`span`,{className:`font-picker-name font-picker-default-name`,children:[(0,G.jsx)(DO,{size:13,style:{marginRight:`6px`,opacity:.6}}),n]}),(0,G.jsx)(`span`,{className:`font-picker-status`,children:x&&(0,G.jsx)(jD,{size:14,className:`theme-check-icon`})})]},`__default__`),_.length===0&&o?(0,G.jsxs)(`div`,{className:`theme-modal-empty`,style:{paddingTop:`16px`},children:[(0,G.jsxs)(`p`,{className:`theme-modal-empty-text`,children:[`No fonts matching "`,o,`"`]}),(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>{s(``),p(0),m.current?.focus()},children:`Reset Search`})]}):_.map((e,t)=>{let n=r===e,i=f===t+1;return(0,G.jsxs)(`button`,{ref:e=>{g.current[t+1]=e},type:`button`,className:`font-picker-item ${n?`active`:``} ${i?`focused`:``}`,onClick:()=>y(e),onMouseEnter:()=>p(t+1),children:[(0,G.jsx)(`span`,{className:`font-picker-name`,style:{fontFamily:`"${e}", ui-monospace, monospace`},children:e}),(0,G.jsx)(`span`,{className:`font-picker-status`,children:n&&(0,G.jsx)(jD,{size:14,className:`theme-check-icon`})})]},e)})]})}),(0,G.jsxs)(`div`,{className:`theme-modal-footer`,children:[(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`↑`}),` `,(0,G.jsx)(`kbd`,{children:`↓`}),` Navigate`]}),(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`Enter`}),` Select`]}),(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`ESC`}),` Close`]})]})]})})}function d0(){let e=Am(),{settings:t,loaded:n,updateSettings:r}=IE(),[,i]=(0,W.useTransition)(),{patch:a,repoName:o,branch:s,customMode:c,showMode:l,commits:u,truncated:d,binaryFiles:f,tabSizeMap:p,untrackedFiles:m,loading:h,refreshing:g,error:_}=gE({staged:t.staged,untracked:t.untracked},!0),{comments:v,addComment:y,removeComment:b,resolveComment:x,unresolveComment:S,addReply:C,editComment:w,editReply:T,removeReply:E,copyAllComments:D,agentActivity:O,clearAgentActivity:k,sendToAgent:A,sending:j,agentWaiting:M}=xE(),{plans:N}=wE(),P=(0,W.useMemo)(()=>N.filter(e=>e.decision===`pending`).length,[N]),{status:F,refresh:I}=ME(a),[L,R]=(0,W.useState)(null),[z,ee]=(0,W.useState)(()=>{try{let e=fD(`diffing-sidebar-collapsed`);if(e!=null)return e===`true`}catch{}return typeof window<`u`&&window.innerWidth<=768}),[te,B]=(0,W.useState)(()=>{try{let e=fD(`diffing-sidebar-width`);return e?Number(e):320}catch{return 320}}),V=(0,W.useRef)(te);V.current=te;let H=(0,W.useRef)(null),ne=(0,W.useRef)(null),re=(0,W.useRef)(null),ie=(0,W.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=V.current,r=ne.current,i=re.current,a=r?r.getBoundingClientRect().left:0,o=n,s=0,c=()=>{s=0,i&&(i.style.transform=`translateX(${a+o}px)`)};i&&(i.style.transform=`translateX(${a+n}px)`,i.classList.add(`sidebar-resize-guide-active`));let l=e=>{let r=e.clientX-t;o=Math.max(240,Math.min(640,n+r)),s||=requestAnimationFrame(c)},u=()=>{s&&cancelAnimationFrame(s),i&&i.classList.remove(`sidebar-resize-guide-active`),B(o);try{gD(`diffing-sidebar-width`,String(o))}catch{}document.removeEventListener(`mousemove`,l),document.removeEventListener(`mouseup`,u),document.body.style.cursor=``,document.body.style.userSelect=``};document.addEventListener(`mousemove`,l),document.addEventListener(`mouseup`,u),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},[]),[ae,oe]=(0,W.useState)({open:!1,scope:`files`}),se=(0,W.useCallback)(e=>oe({open:!0,scope:e}),[]),ce=(0,W.useCallback)(()=>oe(e=>({...e,open:!1})),[]),[le,ue]=(0,W.useState)(!1),[U,de]=(0,W.useState)(!1),[fe,pe]=(0,W.useState)(!1),[me,he]=(0,W.useState)(!1),[ge,_e]=(0,W.useState)(()=>{try{let e=fD(`diffing-comment-panel-height`);return e?Number(e):220}catch{return 220}}),ve=(0,W.useRef)(ge);ve.current=ge;let ye=(0,W.useCallback)(e=>{e.preventDefault();let t=e.clientY,n=ve.current,r=H.current,i=n,a=0,o=()=>{a=0,r?.style.setProperty(`--comment-panel-height`,`${i}px`)},s=e=>{let r=t-e.clientY;i=Math.max(100,Math.min(600,n+r)),a||=requestAnimationFrame(o)},c=()=>{a&&cancelAnimationFrame(a),_e(i);try{gD(`diffing-comment-panel-height`,String(i))}catch{}document.removeEventListener(`mousemove`,s),document.removeEventListener(`mouseup`,c),document.body.style.cursor=``,document.body.style.userSelect=``};document.addEventListener(`mousemove`,s),document.addEventListener(`mouseup`,c),document.body.style.cursor=`row-resize`,document.body.style.userSelect=`none`},[]);(0,W.useEffect)(()=>{try{gD(`diffing-comment-panel-height`,String(ge))}catch{}},[ge]);let{viewedFiles:be,setViewed:xe}=BE(),Se=(0,W.useRef)(null);un([`G`,`S`],()=>se(`symbols`)),un([`G`,`F`],()=>se(`all`)),un([`G`,`V`],()=>se(`files`)),(0,W.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&(e.key===`k`||e.key===`K`)&&(e.preventDefault(),oe(e=>e.open?{...e,open:!1}:{open:!0,scope:`all`}))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,W.useEffect)(()=>{try{gD(`diffing-sidebar-collapsed`,String(z))}catch{}},[z]);let Ce=(0,W.useMemo)(()=>new Set(m),[m]),we=(0,W.useRef)([]),Te=(0,W.useMemo)(()=>{if(!a)return[];try{let e=Pg(a).flatMap(e=>e.files),t=new Set(e.map(e=>e.name));for(let n of f)if(!t.has(n.path)){let t={name:n.path,type:n.type===`added`||n.type===`untracked`?`new`:n.type===`deleted`?`deleted`:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:!0,deletionLines:[],additionLines:[]};e.push(t)}let n=e.map(e=>{let t=we.current.find(t=>t.name===e.name);return t&&t.type===e.type&&t.isPartial===e.isPartial&&t.deletionLines.length===e.deletionLines.length&&t.additionLines.length===e.additionLines.length&&JSON.stringify(t.hunks)===JSON.stringify(e.hunks)?t:e});return we.current=n,n}catch{return[]}},[a,f]),Ee=vD(Te),De=(0,W.useMemo)(()=>{if(!a)return{additions:0,deletions:0};let e=0,t=0,n=0,r=a.length;for(;n<r;){let i=a.indexOf(`
|
|
3861
|
-
`,n);i===-1&&(i=r);let o=a.charCodeAt(n);o===43?n+2<r&&a.charCodeAt(n+1)===43&&a.charCodeAt(n+2)===43||e++:o===45&&(n+2<r&&a.charCodeAt(n+1)===45&&a.charCodeAt(n+2)===45||t++),n=i+1}return{additions:e,deletions:t}},[a]),Oe=(0,W.useMemo)(()=>{let e=new Map;for(let t of f)e.set(t.path,t);return e},[f]),ke=(0,W.useMemo)(()=>{let e={};for(let t of v)e[t.filePath]=(e[t.filePath]??0)+1;return e},[v]),Ae=(0,W.useRef)(new Map),je=(0,W.useMemo)(()=>{let e=new Map,t=new Map;for(let e of v){let n=t.get(e.filePath);n||(n=[],t.set(e.filePath,n)),n.push(e)}for(let[n,r]of t){let t=r.map(e=>({side:e.side,lineNumber:e.lineNumber,metadata:e})),i=Ae.current.get(n);i&&JSON.stringify(i)===JSON.stringify(t)?e.set(n,i):e.set(n,t)}return Ae.current=e,e},[v]),Me=(0,W.useCallback)(e=>{R(e);let t=document.getElementById(`file-${e}`);t&&t.scrollIntoView({block:`start`})},[]),Ne=(0,W.useCallback)((e,t)=>{xe(e,t)},[xe]),Pe=(0,W.useCallback)(e=>{i(()=>{r({diffStyle:e})})},[r]),Fe=(0,W.useCallback)(e=>{i(()=>{r(e)})},[r]),Ie=(0,W.useCallback)(e=>{i(()=>{r({defaultTabSize:e})})},[r]),Le=(0,W.useCallback)(e=>{i(()=>{r({browser:e})})},[r]),Re=(0,W.useCallback)(e=>{i(()=>{r({theme:e})})},[r]),ze=(0,W.useCallback)(e=>{i(()=>{r({editorIDE:e})})},[r]),Be=(0,W.useCallback)(e=>{i(()=>{r({lineDiffType:e})})},[r]),Ve=(0,W.useCallback)(e=>{i(()=>{r({lineWrap:e})})},[r]),He=(0,W.useCallback)(e=>{i(()=>{r({diffIndicators:e})})},[r]),Ue=(0,W.useCallback)(e=>{i(()=>{r({showLineNumbers:e})})},[r]),We=(0,W.useCallback)(e=>{i(()=>{r({hunkSeparators:e})})},[r]),Ge=(0,W.useCallback)(e=>{i(()=>{r({lineHoverHighlight:e})})},[r]),Ke=(0,W.useCallback)(e=>{i(()=>{r({fontSize:e})})},[r]),qe=(0,W.useCallback)(e=>{r({haptics:e})},[r]),Je=(0,W.useCallback)(e=>{r({sounds:e})},[r]),Ye=(0,W.useCallback)(e=>{r({uiFont:e})},[r]),Xe=(0,W.useCallback)(e=>{r({monoFont:e})},[r]),Ze=(0,W.useCallback)(()=>{Ve(!t.lineWrap)},[t.lineWrap,Ve]),Qe=(0,W.useCallback)(()=>{Ue(!t.showLineNumbers)},[t.showLineNumbers,Ue]),$e=(0,W.useCallback)(()=>{let e=[`classic`,`bars`,`none`],n=t.diffIndicators||`classic`,r=e[(e.indexOf(n)+1)%e.length];He(r)},[t.diffIndicators,He]),et=(0,W.useCallback)(()=>{let e=[`word`,`word-alt`,`char`,`none`],n=t.lineDiffType||`word`,r=e[(e.indexOf(n)+1)%e.length];Be(r)},[t.lineDiffType,Be]),tt=(0,W.useCallback)(()=>{ee(e=>!e)},[]),nt=(0,W.useCallback)(e=>{if(Te.length===0)return;let t=0;if(L){let n=Te.findIndex(e=>e.name===L);n!==-1&&(t=e===`next`?Math.min(n+1,Te.length-1):Math.max(n-1,0))}let n=Te[t].name;R(n);let r=document.getElementById(`file-${n}`);r&&r.scrollIntoView({block:`start`})},[Te,L,R]),rt=(0,W.useCallback)(()=>{L&&xe(L,!be.has(L))},[L,be,xe]),it=(0,W.useCallback)(()=>{Pe(t.diffStyle===`split`?`unified`:`split`)},[t.diffStyle,Pe]),at=(0,W.useCallback)(()=>{let e=[2,4,8],n=t.defaultTabSize||4;Ie(e[(e.indexOf(n)+1)%e.length])},[t.defaultTabSize,Ie]),ot=(0,W.useCallback)(()=>{tt()},[tt]);(0,W.useEffect)(()=>{let e=``,t,n=0,r=r=>{let i=document.activeElement;if(i){let e=i.tagName.toLowerCase();if(e===`input`||e===`textarea`||i.hasAttribute(`contenteditable`))return}clearTimeout(t);let a=r.key;if(r.ctrlKey){a===`d`?(r.preventDefault(),window.scrollBy({top:window.innerHeight/2,behavior:`auto`}),sD(`selection`,`navigate`),e=``):a===`u`&&(r.preventDefault(),window.scrollBy({top:-window.innerHeight/2,behavior:`auto`}),sD(`selection`,`navigate`),e=``);return}if(!(a.length>1&&a!==`Escape`&&a!==`Enter`))if(e+=a,t=setTimeout(()=>{e=``},800),e===`j`){r.preventDefault(),window.scrollBy({top:100,behavior:`auto`});let t=Date.now();t-n>80&&(aD(`navigate`),n=t),e=``}else if(e===`k`){r.preventDefault(),window.scrollBy({top:-100,behavior:`auto`});let t=Date.now();t-n>80&&(aD(`navigate`),n=t),e=``}else e===`gg`?(r.preventDefault(),window.scrollTo({top:0,behavior:`auto`}),sD(`selection`,`navigate`),e=``):e===`G`?(r.preventDefault(),window.scrollTo({top:document.documentElement.scrollHeight,behavior:`auto`}),sD(`selection`,`navigate`),e=``):e===`J`?(r.preventDefault(),nt(`next`),sD(`selection`,`navigate`),e=``):e===`K`?(r.preventDefault(),nt(`prev`),sD(`selection`,`navigate`),e=``):e===`v`?(r.preventDefault(),rt(),sD(`selection`,`toggle`),e=``):e===`m`?(r.preventDefault(),it(),sD(`selection`,`toggle`),e=``):e===`t`?(r.preventDefault(),at(),sD(`selection`,`toggle`),e=``):e===`b`?(r.preventDefault(),ot(),sD(`selection`,`toggle`),e=``):e===`w`?(r.preventDefault(),Ze(),sD(`selection`,`toggle`),e=``):e===`n`?(r.preventDefault(),Qe(),sD(`selection`,`toggle`),e=``):e===`i`?(r.preventDefault(),$e(),sD(`selection`,`toggle`),e=``):e===`I`?(r.preventDefault(),et(),sD(`selection`,`toggle`),e=``):e===`/`?(r.preventDefault(),se(`text`),sD(`medium`,`open`),e=``):e===`s`?(r.preventDefault(),se(`symbols`),sD(`medium`,`open`),e=``):e===`gv`?(r.preventDefault(),se(`files`),sD(`medium`,`open`),e=``):e===`gt`?(r.preventDefault(),de(!0),sD(`medium`,`open`),e=``):e===`?`?(r.preventDefault(),ue(!0),sD(`medium`,`open`),e=``):e.length>=2&&(e=``)};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),clearTimeout(t)}},[Te,L,be,t.diffStyle,t.defaultTabSize,nt,rt,it,at,ot,Ze,Qe,$e,et,de]);let st=(0,W.useMemo)(()=>({staged:t.staged,untracked:t.untracked}),[t.staged,t.untracked]);(0,W.useEffect)(()=>{let e=t.theme||`nord`,n=document.documentElement;n.classList.add(`theme-switching`),n.setAttribute(`data-theme`,e);let r=requestAnimationFrame(()=>{requestAnimationFrame(()=>n.classList.remove(`theme-switching`))});return()=>cancelAnimationFrame(r)},[t.theme]),LE(n,t.uiFont,t.monoFont);let ct=(0,W.useMemo)(()=>FE(t.monoFont),[t.monoFont]),lt=(0,W.useMemo)(()=>nE[t.theme||`nord`]||nE.nord,[t.theme]);return(0,W.useEffect)(()=>{e&&e.setRenderOptions({theme:{dark:lt.type===`dark`?lt.themeName:`nord`,light:lt.type===`light`?lt.themeName:`github-light`}}).catch(e=>{console.error(`Failed to set worker pool render options:`,e)})},[e,lt]),(0,W.useEffect)(()=>{let e=lt.type===`dark`?lt.themeName:`nord`,t=lt.type===`light`?lt.themeName:`github-light`;Uf({themes:Array.from(new Set([e,t])),langs:[]}).catch(()=>{})},[lt]),h?(0,G.jsxs)(`div`,{className:`app skeleton-app`,style:{"--sidebar-width":`${te}px`,"--comment-panel-height":`${ge}px`},children:[(0,G.jsxs)(`header`,{className:`skeleton-toolbar`,children:[(0,G.jsx)(`div`,{className:`skeleton-item skeleton-logo`}),(0,G.jsx)(`div`,{className:`skeleton-item skeleton-stats`}),(0,G.jsx)(`div`,{className:`skeleton-item skeleton-actions`})]}),(0,G.jsxs)(`div`,{className:`app-body`,children:[(0,G.jsx)(`aside`,{className:`sidebar skeleton-sidebar ${z?`sidebar-collapsed`:``}`,children:!z&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`skeleton-search`}),(0,G.jsx)(`div`,{className:`skeleton-tree-nodes`,children:Array.from({length:8}).map((e,t)=>(0,G.jsxs)(`div`,{className:`skeleton-tree-node`,style:{paddingLeft:`${t%3*16+16}px`},children:[(0,G.jsx)(`div`,{className:`skeleton-node-icon`}),(0,G.jsx)(`div`,{className:`skeleton-node-text`,style:{width:`${60+t*12%60}px`}})]},t))})]})}),!z&&(0,G.jsx)(`div`,{className:`sidebar-resize-handle`,style:{cursor:`default`}}),(0,G.jsx)(`main`,{className:`main skeleton-main`,children:(0,G.jsx)(`div`,{className:`diff-viewer`,children:Array.from({length:3}).map((e,t)=>(0,G.jsxs)(`div`,{className:`file-diff-card skeleton-card`,children:[(0,G.jsxs)(`div`,{className:`skeleton-card-header`,children:[(0,G.jsx)(`div`,{className:`skeleton-card-title`,style:{width:`${120+t*45%150}px`}}),(0,G.jsx)(`div`,{className:`skeleton-card-badge`})]}),(0,G.jsx)(`div`,{className:`skeleton-card-body`,children:Array.from({length:5}).map((e,t)=>(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`${50+t*15%45}%`}},t))})]},t))})})]})]}):_?(0,G.jsx)(`div`,{className:`error`,children:(0,G.jsxs)(`p`,{children:[`Error: `,_]})}):(0,G.jsx)(cD,{enabled:t.haptics??!0,soundsEnabled:t.sounds??!0,children:(0,G.jsxs)(`div`,{className:`app`,ref:H,style:{"--sidebar-width":`${te}px`,"--comment-panel-height":`${ge}px`},children:[g&&(0,G.jsx)(`div`,{className:`refresh-bar`,role:`status`,"aria-label":`Refreshing diff`}),(0,G.jsx)(`div`,{className:`sidebar-resize-guide`,ref:re,"aria-hidden":`true`}),(0,G.jsx)(hU,{repoName:o,branch:s,fileCount:Te.length,additions:De.additions,deletions:De.deletions,commentCount:v.length,planCount:N.length,pendingPlanCount:P,onOpenPlans:()=>DE(`/plan`),diffStyle:t.diffStyle,diffOptions:st,defaultTabSize:t.defaultTabSize,browser:t.browser,theme:t.theme||`nord`,editorIDE:t.editorIDE,customMode:c,showMode:l,showCommitCount:u.length,lineDiffType:t.lineDiffType,lineWrap:t.lineWrap,diffIndicators:t.diffIndicators,showLineNumbers:t.showLineNumbers,hunkSeparators:t.hunkSeparators,lineHoverHighlight:t.lineHoverHighlight,fontSize:t.fontSize,haptics:t.haptics??!0,sounds:t.sounds??!0,uiFont:t.uiFont,monoFont:t.monoFont,sidebarCollapsed:z,onToggleSidebar:tt,onDiffStyleChange:Pe,onDiffOptionsChange:Fe,onDefaultTabSizeChange:Ie,onBrowserChange:Le,onOpenThemeModal:()=>de(!0),onEditorIDEChange:ze,onLineDiffTypeChange:Be,onLineWrapChange:Ve,onDiffIndicatorsChange:He,onShowLineNumbersChange:Ue,onHunkSeparatorsChange:We,onLineHoverHighlightChange:Ge,onFontSizeChange:Ke,onHapticsChange:qe,onSoundsChange:Je,onOpenUiFontModal:()=>pe(!0),onOpenMonoFontModal:()=>he(!0),onOpenSearch:()=>se(`all`),onCopyComments:D,onSendToAgent:A,agentWaiting:M,sending:j,comments:v,onEditComment:w,onDeleteComment:b}),!z&&(0,G.jsx)(`div`,{className:`sidebar-mobile-backdrop`,onClick:tt,"aria-hidden":`true`}),(0,G.jsxs)(`div`,{className:`app-body`,children:[(0,G.jsxs)(`aside`,{ref:ne,className:`sidebar ${z?`sidebar-collapsed`:``}`,children:[(0,G.jsx)(`div`,{style:{flex:1,minHeight:0,overflow:`hidden`},children:(0,G.jsx)(y1,{files:Te,activeFile:L,commentCounts:ke,viewedFiles:be,untrackedFiles:Ce,onFileClick:Me,collapsed:z,onToggleCollapse:tt})}),!z&&v.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`ct-resize-handle`,onMouseDown:ye,role:`separator`,"aria-label":`Resize comments panel`,"aria-orientation":`horizontal`,tabIndex:0}),(0,G.jsx)(`div`,{className:`ct-wrapper`,style:{flexShrink:0},children:(0,G.jsx)(S1,{comments:v,resolveComment:x,unresolveComment:S,removeComment:b,addReply:C,editComment:w,editReply:T,removeReply:E})})]})]}),!z&&(0,G.jsx)(`div`,{className:`sidebar-resize-handle`,onMouseDown:ie,role:`separator`,"aria-label":`Resize sidebar`,"aria-orientation":`vertical`,tabIndex:0}),(0,G.jsxs)(`main`,{className:`main`,ref:Se,children:[l&&u.length>0&&(0,G.jsxs)(`div`,{className:`commit-banner-stack`,role:`list`,children:[u.map((e,t)=>(0,G.jsx)(gU,{commit:e,index:t,total:u.length},e.sha)),d>0&&(0,G.jsxs)(`div`,{className:`commit-banner-truncated`,role:`status`,children:[`+ `,d,` more commit`,d===1?``:`s`,` not shown`]})]}),F.inMerge&&F.conflicts.length>0&&(0,G.jsxs)(`div`,{className:`merge-conflict-banner`,children:[(0,G.jsx)(`strong`,{children:`Merge in progress`}),(0,G.jsxs)(`span`,{children:[F.conflicts.length,` unresolved file`,F.conflicts.length===1?``:`s`,` below. Use the inline buttons to accept current/incoming/both, then "Save & stage".`]})]}),F.conflicts.map(e=>(0,G.jsx)(aW,{filePath:e,theme:t.theme||`nord`,fontSize:t.fontSize,monoFontFamily:ct,tabSize:p[e]??t.defaultTabSize,onSaved:()=>{I()}},e)),(0,G.jsx)(rW,{files:Te,diffStyle:t.diffStyle,tabSizeMap:p,defaultTabSize:t.defaultTabSize,viewedFiles:be,binaryFiles:Oe,theme:t.theme||`nord`,editorIDE:t.editorIDE,lineDiffType:t.lineDiffType,lineWrap:t.lineWrap,diffIndicators:t.diffIndicators,showLineNumbers:t.showLineNumbers,hunkSeparators:t.hunkSeparators,lineHoverHighlight:t.lineHoverHighlight,fontSize:t.fontSize,monoFontFamily:ct,expandContextByDefault:t.expandContextByDefault,collapsedContextThreshold:t.collapsedContextThreshold,expansionLineCount:t.expansionLineCount,onViewedChange:Ne,fileAnnotationsMap:je,onAddComment:y,onDeleteComment:b})]})]}),(0,G.jsx)(Y1,{isOpen:ae.open,onClose:ce,initialScope:ae.scope,files:Te,changedEntries:Ee,customMode:c,staged:t.staged,onNavigateFile:Me,theme:t.theme||`nord`,fontSize:t.fontSize,monoFontFamily:ct,defaultTabSize:t.defaultTabSize,lineWrap:t.lineWrap,showLineNumbers:t.showLineNumbers,lineHoverHighlight:t.lineHoverHighlight}),(0,G.jsx)(r0,{activeFile:L,onShowHelp:()=>ue(!0)}),(0,G.jsx)(i0,{isOpen:le,onClose:()=>ue(!1)}),(0,G.jsx)(s0,{open:U,activeTheme:t.theme||`nord`,onThemeChange:Re,onClose:()=>de(!1)}),(0,G.jsx)(u0,{open:fe,title:`Select UI Font`,defaultLabel:`Default (Geist Mono, from CDN)`,activeFont:t.uiFont,onFontChange:Ye,onClose:()=>pe(!1)}),(0,G.jsx)(u0,{open:me,title:`Select Code Font`,defaultLabel:`Default (JetBrains Mono, from CDN)`,activeFont:t.monoFont,onFontChange:Xe,onClose:()=>he(!1)}),(0,G.jsx)(a0,{activity:O,onDismiss:k,onJump:Me})]})})}function f0(e,t){if(t<1)return;let n=e.split(`
|
|
3862
|
-
`),r=Math.min(t,n.length);for(let e=r-1;e>=0;e--){let t=/^\s{0,3}(#{1,6})\s+(.*?)\s*#*\s*$/.exec(n[e]);if(t)return t[2].trim()}}function
|
|
3860
|
+
`}}):null})]})}var p0=(0,W.memo)(function({activeFile:e,onShowHelp:t,placeholder:n=`No active file (J/K to jump)`}){let[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(!0),s=(0,W.useRef)(null);(0,W.useEffect)(()=>{let e=()=>{let e=document.activeElement;if(e){let t=e.tagName.toLowerCase();i(t===`input`||t===`textarea`||e.hasAttribute(`contenteditable`))}else i(!1)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,e);let t=setInterval(e,400);return()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,e),clearInterval(t)}},[]),(0,W.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`b`&&(e.preventDefault(),o(e=>!e))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[]);let c=e?e.split(`/`).pop():null,l=e&&e.includes(`/`)?e.split(`/`).slice(0,-1).join(`/`)+`/`:``,u=(0,W.useCallback)(e=>{e?.stopPropagation(),o(e=>!e)},[]);return(0,G.jsxs)(`div`,{className:`vim-status-bar ${a?`vim-status-collapsed`:``}`,children:[(0,G.jsx)(`div`,{className:`vim-mode-badge ${r?`vim-mode-insert`:`vim-mode-normal`}`,children:r?`INSERT`:`NORMAL`}),!a&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`vim-status-content`,children:[(0,G.jsx)(wO,{size:12,className:`vim-status-icon`}),e?(0,G.jsxs)(`span`,{className:`vim-status-file`,title:e,children:[(0,G.jsx)(`span`,{className:`vim-file-dir`,children:l}),(0,G.jsx)(`strong`,{className:`vim-file-name`,children:c})]}):(0,G.jsx)(`span`,{className:`vim-status-placeholder`,children:n})]}),(0,G.jsxs)(`button`,{className:`vim-status-help-btn`,onClick:t,title:`View Keyboard Shortcuts (?)`,children:[(0,G.jsx)(RD,{size:13}),(0,G.jsx)(`span`,{children:`Shortcuts`}),(0,G.jsx)(`kbd`,{className:`vim-kbd-small`,children:`?`})]})]}),(0,G.jsx)(`button`,{ref:s,className:`vim-status-toggle`,onClick:u,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),u(e))},title:a?`Expand status bar (⌘B)`:`Collapse status bar (⌘B)`,"aria-label":a?`Expand status bar`:`Collapse status bar`,tabIndex:0,children:a?(0,G.jsx)(PD,{size:12}):(0,G.jsx)(ND,{size:12})})]})}),m0=(0,W.memo)(function({isOpen:e,onClose:t,mode:n=`diff`}){let r=n===`plan`?[{title:`Scrolling & Content`,icon:(0,G.jsx)(uO,{size:15}),items:[{keys:[`j`],description:`Scroll Down slightly`},{keys:[`k`],description:`Scroll Up slightly`},{keys:[`Ctrl`,`d`],description:`Scroll Down half page`},{keys:[`Ctrl`,`u`],description:`Scroll Up half page`},{keys:[`g`,`g`],description:`Scroll to Top of plan`},{keys:[`G`],description:`Scroll to Bottom of plan`}]},{title:`Plan Navigation`,icon:(0,G.jsx)(eO,{size:15}),items:[{keys:[`J`],description:`Jump to Next Plan in list`},{keys:[`K`],description:`Jump to Previous Plan in list`},{keys:[`b`],description:`Toggle Plans Sidebar Panel collapse`}]},{title:`Search & Dialogs`,icon:(0,G.jsx)(KD,{size:15}),items:[{keys:[`g`,`t`],description:`Open Theme Selection Modal`},{keys:[`?`],description:`Toggle Keyboard Shortcuts Guide`},{keys:[`Esc`],description:`Close preview / dialog`}]},{title:`Views & Formatting`,icon:(0,G.jsx)(cO,{size:15}),items:[{keys:[`m`],description:`Toggle View Mode (Source / Rendered)`},{keys:[`t`],description:`Cycle Tab Indentation Size (2 → 4 → 8)`},{keys:[`w`],description:`Toggle Soft-Wrap Long Lines`},{keys:[`n`],description:`Toggle Line Numbers`},{keys:[`⌘`,`Shift`,`P`],description:`Toggle Preview Mode in Comments`}]}]:[{title:`Scrolling & Diffs`,icon:(0,G.jsx)(uO,{size:15}),items:[{keys:[`j`],description:`Scroll Down slightly`},{keys:[`k`],description:`Scroll Up slightly`},{keys:[`Ctrl`,`d`],description:`Scroll Down half page`},{keys:[`Ctrl`,`u`],description:`Scroll Up half page`},{keys:[`g`,`g`],description:`Scroll to Top of diffs`},{keys:[`G`],description:`Scroll to Bottom of diffs`}]},{title:`File Navigation`,icon:(0,G.jsx)(eO,{size:15}),items:[{keys:[`J`],description:`Jump to Next File Diff`},{keys:[`K`],description:`Jump to Previous File Diff`},{keys:[`v`],description:`Toggle Viewed state for Active File`},{keys:[`b`],description:`Toggle Sidebar Panel collapse`}]},{title:`Search & Dialogs`,icon:(0,G.jsx)(KD,{size:15}),items:[{keys:[`⌘`,`K`],description:`Open Search Palette (files · text · symbols)`},{keys:[`/`],description:`Search file contents (Text scope)`},{keys:[`g`,`f`],description:`Search files (Files scope)`},{keys:[`s`],description:`Search symbols (or "g s")`},{keys:[`g`,`v`],description:`Browse any file in the repo`},{keys:[`g`,`t`],description:`Open Theme Selection Modal`},{keys:[`Tab`],description:`Cycle search scope while open`},{keys:[`⌘`,`↵`],description:`Peek a result in the preview pane`},{keys:[`?`],description:`Toggle Keyboard Shortcuts Guide`},{keys:[`Esc`],description:`Close preview / dialog`}]},{title:`Views & Formatting`,icon:(0,G.jsx)(cO,{size:15}),items:[{keys:[`m`],description:`Toggle Diff Style (Split / Unified)`},{keys:[`t`],description:`Cycle Tab Indentation Size (2 → 4 → 8)`},{keys:[`w`],description:`Toggle Soft-Wrap Long Lines`},{keys:[`n`],description:`Toggle Line Numbers`},{keys:[`i`],description:`Cycle Diff Indicator Style (+/− → bars → none)`},{keys:[`Shift`,`I`],description:`Cycle Inline Diff Style (word → char → none)`},{keys:[`⌘`,`Shift`,`P`],description:`Toggle Preview Mode in Comments`}]}];return(0,G.jsxs)(WU,{open:e,onClose:t,className:`shortcuts-modal`,ariaLabel:`Keyboard shortcuts`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header-title`,children:[(0,G.jsx)(eO,{size:18,className:`shortcuts-icon`}),(0,G.jsx)(`h2`,{children:`Developer Keyboard Shortcuts`})]}),(0,G.jsx)(`button`,{className:`shortcuts-close-btn`,onClick:t,"aria-label":`Close dialog`,children:(0,G.jsx)(AO,{size:16})})]}),(0,G.jsxs)(`div`,{className:`shortcuts-body`,children:[(0,G.jsx)(`div`,{className:`shortcuts-intro`,children:`Vim-style keybindings are enabled! Navigate and review plans entirely from your home keys.`}),(0,G.jsx)(`div`,{className:`shortcuts-grid`,children:r.map((e,t)=>(0,G.jsxs)(`div`,{className:`shortcuts-section`,children:[(0,G.jsxs)(`h3`,{className:`shortcuts-section-title`,children:[e.icon,(0,G.jsx)(`span`,{children:e.title})]}),(0,G.jsx)(`div`,{className:`shortcuts-list`,children:e.items.map((e,t)=>(0,G.jsxs)(`div`,{className:`shortcuts-row`,children:[(0,G.jsx)(`span`,{className:`shortcuts-desc`,children:e.description}),(0,G.jsx)(`div`,{className:`shortcuts-keys`,children:e.keys.map((t,n)=>(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`kbd`,{className:`vim-kbd`,children:t}),n<e.keys.length-1&&(0,G.jsx)(`span`,{className:`kbd-plus`,children:`+`})]},n))})]},t))})]},t))})]}),(0,G.jsxs)(`div`,{className:`shortcuts-footer`,children:[`Press `,(0,G.jsx)(`kbd`,{className:`vim-kbd-small`,children:`?`}),` to dismiss this menu at any time.`]})]})});function h0({activity:e,onDismiss:t,onJump:n}){if((0,W.useEffect)(()=>{if(!e)return;let n=setTimeout(t,8e3);return()=>clearTimeout(n)},[e,t]),!e)return null;let r=e.body.length>120?`${e.body.slice(0,120)}…`:e.body;return(0,G.jsxs)(`div`,{className:`agent-toast`,role:`status`,"aria-live":`polite`,children:[(0,G.jsxs)(`button`,{className:`agent-toast-body`,onClick:()=>{n(e.filePath),t()},title:`Jump to the file`,children:[(0,G.jsx)(`span`,{className:`agent-toast-icon`,children:(0,G.jsx)(AD,{size:16})}),(0,G.jsxs)(`span`,{className:`agent-toast-text`,children:[(0,G.jsxs)(`span`,{className:`agent-toast-title`,children:[`Agent replied`,e.model?` · ${e.model}`:``]}),(0,G.jsx)(`span`,{className:`agent-toast-file`,children:e.filePath}),(0,G.jsx)(`span`,{className:`agent-toast-preview`,children:r})]})]}),(0,G.jsx)(`button`,{className:`agent-toast-close`,onClick:t,"aria-label":`Dismiss`,children:(0,G.jsx)(AO,{size:14})})]})}var g0=[{id:`nord`,name:`Nord (Main)`,type:`dark`,colors:{bg:`#2e3440`,secondary:`#242933`,accent:`#88c0d0`}},{id:`github-dark`,name:`GitHub Dark`,type:`dark`,colors:{bg:`#0d1117`,secondary:`#161b22`,accent:`#58a6ff`}},{id:`github-dark-dimmed`,name:`GitHub Dark Dimmed`,type:`dark`,colors:{bg:`#22272e`,secondary:`#1c2128`,accent:`#539bf5`}},{id:`github-dark-high-contrast`,name:`GitHub Dark HC`,type:`dark`,colors:{bg:`#0a0c10`,secondary:`#010409`,accent:`#409eff`}},{id:`github-light`,name:`GitHub Light`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f6f8fa`,accent:`#0969da`}},{id:`github-light-high-contrast`,name:`GitHub Light HC`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f6f8fa`,accent:`#0969da`}},{id:`dracula`,name:`Dracula`,type:`dark`,colors:{bg:`#282a36`,secondary:`#1e1f29`,accent:`#bd93f9`}},{id:`one-dark`,name:`One Dark`,type:`dark`,colors:{bg:`#282c34`,secondary:`#21252b`,accent:`#61afef`}},{id:`synthwave-84`,name:`Synthwave '84`,type:`dark`,colors:{bg:`#2b213a`,secondary:`#241b2f`,accent:`#f92aad`}},{id:`tokyo-night`,name:`Tokyo Night`,type:`dark`,colors:{bg:`#1a1b26`,secondary:`#16161e`,accent:`#7aa2f7`}},{id:`catppuccin-mocha`,name:`Catppuccin Mocha`,type:`dark`,colors:{bg:`#1e1e2e`,secondary:`#181825`,accent:`#cba6f7`}},{id:`catppuccin-frappe`,name:`Catppuccin Frappé`,type:`dark`,colors:{bg:`#303446`,secondary:`#292c3c`,accent:`#ca9ee6`}},{id:`catppuccin-macchiato`,name:`Catppuccin Macchiato`,type:`dark`,colors:{bg:`#24273a`,secondary:`#1e2030`,accent:`#c6a0f6`}},{id:`catppuccin-latte`,name:`Catppuccin Latte`,type:`light`,colors:{bg:`#eff1f5`,secondary:`#e6e9ef`,accent:`#8839ef`}},{id:`solarized-dark`,name:`Solarized Dark`,type:`dark`,colors:{bg:`#002b36`,secondary:`#073642`,accent:`#268bd2`}},{id:`solarized-light`,name:`Solarized Light`,type:`light`,colors:{bg:`#fdf6e3`,secondary:`#eee8d5`,accent:`#268bd2`}},{id:`monokai`,name:`Monokai`,type:`dark`,colors:{bg:`#272822`,secondary:`#1d1e19`,accent:`#f92672`}},{id:`ayu-dark`,name:`Ayu Dark`,type:`dark`,colors:{bg:`#0a0e14`,secondary:`#0d1117`,accent:`#e6b450`}},{id:`ayu-light`,name:`Ayu Light`,type:`light`,colors:{bg:`#fafafa`,secondary:`#f3f3f3`,accent:`#ff9900`}},{id:`nightfox`,name:`Nightfox`,type:`dark`,colors:{bg:`#192330`,secondary:`#131a24`,accent:`#719cd6`}},{id:`nordfox`,name:`Nordfox`,type:`dark`,colors:{bg:`#2e3440`,secondary:`#232831`,accent:`#81a1c1`}},{id:`duskfox`,name:`Duskfox`,type:`dark`,colors:{bg:`#232136`,secondary:`#1d1b2d`,accent:`#86b3b3`}},{id:`terafox`,name:`Terafox`,type:`dark`,colors:{bg:`#152528`,secondary:`#0f1c1e`,accent:`#5a93aa`}},{id:`carbonfox`,name:`Carbonfox`,type:`dark`,colors:{bg:`#161616`,secondary:`#111111`,accent:`#78a9ff`}},{id:`dayfox`,name:`Dayfox`,type:`light`,colors:{bg:`#f6f2ee`,secondary:`#ebe5df`,accent:`#2848a9`}},{id:`dawnfox`,name:`Dawnfox`,type:`light`,colors:{bg:`#eae5e5`,secondary:`#e0d8d8`,accent:`#614d85`}},{id:`andromeeda`,name:`Andromeeda`,type:`dark`,colors:{bg:`#090b10`,secondary:`#0e1117`,accent:`#00e8c6`}},{id:`aurora-x`,name:`Aurora X`,type:`dark`,colors:{bg:`#07090f`,secondary:`#0c0e15`,accent:`#2eb5e5`}},{id:`dark-plus`,name:`Dark+ (VS Code)`,type:`dark`,colors:{bg:`#1e1e1e`,secondary:`#252526`,accent:`#0e639c`}},{id:`light-plus`,name:`Light+ (VS Code)`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f3f3f3`,accent:`#007acc`}},{id:`houston`,name:`Houston (Astro)`,type:`dark`,colors:{bg:`#131415`,secondary:`#17191e`,accent:`#ff5d01`}},{id:`laserwave`,name:`Laserwave`,type:`dark`,colors:{bg:`#1b1d28`,secondary:`#181a23`,accent:`#ffe261`}},{id:`material-theme`,name:`Material Theme`,type:`dark`,colors:{bg:`#263238`,secondary:`#1e272c`,accent:`#80cbd8`}},{id:`material-theme-darker`,name:`Material Darker`,type:`dark`,colors:{bg:`#212121`,secondary:`#1a1a1a`,accent:`#80cbd8`}},{id:`material-theme-lighter`,name:`Material Lighter`,type:`light`,colors:{bg:`#fafafa`,secondary:`#eeeded`,accent:`#80cbd8`}},{id:`material-theme-ocean`,name:`Material Ocean`,type:`dark`,colors:{bg:`#0f111a`,secondary:`#090b10`,accent:`#80cbd8`}},{id:`material-theme-palenight`,name:`Material Palenight`,type:`dark`,colors:{bg:`#292d3e`,secondary:`#202331`,accent:`#80cbd8`}},{id:`min-dark`,name:`Min Dark`,type:`dark`,colors:{bg:`#1f1f1f`,secondary:`#181818`,accent:`#ffffff`}},{id:`min-light`,name:`Min Light`,type:`light`,colors:{bg:`#ffffff`,secondary:`#f5f5f5`,accent:`#111111`}},{id:`night-owl`,name:`Night Owl`,type:`dark`,colors:{bg:`#011627`,secondary:`#0b2942`,accent:`#7fdbca`}},{id:`one-light`,name:`One Light`,type:`light`,colors:{bg:`#fafafa`,secondary:`#f0f0f0`,accent:`#40a9ff`}},{id:`plastic`,name:`Plastic`,type:`dark`,colors:{bg:`#21252b`,secondary:`#1b1d23`,accent:`#61afef`}},{id:`poimandres`,name:`Poimandres`,type:`dark`,colors:{bg:`#1b1e28`,secondary:`#171922`,accent:`#50cad2`}},{id:`rose-pine`,name:`Rosé Pine`,type:`dark`,colors:{bg:`#191724`,secondary:`#1f1d2e`,accent:`#c4a7e7`}},{id:`rose-pine-moon`,name:`Rosé Pine Moon`,type:`dark`,colors:{bg:`#232136`,secondary:`#2a283e`,accent:`#c4a7e7`}},{id:`rose-pine-dawn`,name:`Rosé Pine Dawn`,type:`light`,colors:{bg:`#faf4ed`,secondary:`#f2e9e1`,accent:`#907aa9`}},{id:`slack-dark`,name:`Slack Dark`,type:`dark`,colors:{bg:`#1a1d21`,secondary:`#222529`,accent:`#36c5f0`}},{id:`slack-ochre`,name:`Slack Ochre`,type:`dark`,colors:{bg:`#222222`,secondary:`#2b2b2b`,accent:`#e8912d`}},{id:`vesper`,name:`Vesper`,type:`dark`,colors:{bg:`#101010`,secondary:`#161616`,accent:`#ffc600`}},{id:`vitesse-black`,name:`Vitesse Black`,type:`dark`,colors:{bg:`#000000`,secondary:`#0b0b0b`,accent:`#4d9375`}},{id:`vitesse-dark`,name:`Vitesse Dark`,type:`dark`,colors:{bg:`#121212`,secondary:`#181818`,accent:`#4d9375`}},{id:`vitesse-light`,name:`Vitesse Light`,type:`light`,colors:{bg:`#ffffff`,secondary:`#fafafa`,accent:`#1b655f`}}];function _0({open:e,activeTheme:t,onThemeChange:n,onClose:r}){let[i,a]=(0,W.useState)(``),[o,s]=(0,W.useState)(`all`),[c,l]=(0,W.useState)(0),u=(0,W.useRef)(null),d=(0,W.useRef)(null),f=(0,W.useRef)([]);(0,W.useEffect)(()=>{e&&(a(``),s(`all`),l(0),setTimeout(()=>{u.current?.focus()},50))},[e]);let p=(0,W.useMemo)(()=>{let e=i.toLowerCase().trim();return g0.filter(t=>{let n=t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e),r=o===`all`||t.type===o;return n&&r})},[i,o]);return(0,W.useEffect)(()=>{c>=p.length&&l(Math.max(0,p.length-1))},[p,c]),(0,W.useEffect)(()=>{e&&f.current[c]&&f.current[c]?.scrollIntoView({block:`nearest`,behavior:`smooth`})},[c,e]),(0,G.jsx)(WU,{open:e,onClose:r,className:`theme-modal`,ariaLabel:`Theme Selector Modal`,children:(0,G.jsxs)(`div`,{className:`theme-modal-content`,onKeyDown:e=>{let t=p.length;if(e.key===`Escape`){e.preventDefault(),r();return}if(t!==0)switch(e.key){case`ArrowRight`:e.preventDefault(),l(e=>Math.min(e+1,t-1));break;case`ArrowLeft`:e.preventDefault(),l(e=>Math.max(e-1,0));break;case`ArrowDown`:e.preventDefault(),c+2<t?l(c+2):l(t-1);break;case`ArrowUp`:e.preventDefault(),c-2>=0&&l(c-2);break;case`Enter`:e.preventDefault(),p[c]&&(n(p[c].id),r());break;default:break}},children:[(0,G.jsxs)(`div`,{className:`theme-modal-header`,children:[(0,G.jsxs)(`div`,{className:`theme-modal-title-row`,children:[(0,G.jsx)(`h2`,{className:`theme-modal-title`,children:`Select Color Theme`}),(0,G.jsx)(`button`,{className:`theme-modal-close-btn`,onClick:r,"aria-label":`Close`,children:(0,G.jsx)(AO,{size:16})})]}),(0,G.jsxs)(`div`,{className:`theme-modal-search-wrapper`,children:[(0,G.jsx)(xO,{className:`theme-modal-search-icon`,size:16}),(0,G.jsx)(`input`,{ref:u,type:`text`,className:`theme-modal-search-input`,placeholder:`Search themes... (e.g. nordfox, github)`,value:i,onChange:e=>{a(e.target.value),l(0)}}),i&&(0,G.jsx)(`button`,{className:`theme-modal-clear-btn`,onClick:()=>{a(``),l(0),u.current?.focus()},children:(0,G.jsx)(AO,{size:14})})]}),(0,G.jsxs)(`div`,{className:`theme-modal-filters`,children:[(0,G.jsxs)(`button`,{className:`theme-filter-tab ${o===`all`?`active`:``}`,onClick:()=>{s(`all`),l(0),u.current?.focus()},children:[`All Themes (`,g0.length,`)`]}),(0,G.jsxs)(`button`,{className:`theme-filter-tab ${o===`dark`?`active`:``}`,onClick:()=>{s(`dark`),l(0),u.current?.focus()},children:[(0,G.jsx)(lO,{size:12,style:{marginRight:`6px`}}),`Dark (`,g0.filter(e=>e.type===`dark`).length,`)`]}),(0,G.jsxs)(`button`,{className:`theme-filter-tab ${o===`light`?`active`:``}`,onClick:()=>{s(`light`),l(0),u.current?.focus()},children:[(0,G.jsx)(CO,{size:12,style:{marginRight:`6px`}}),`Light (`,g0.filter(e=>e.type===`light`).length,`)`]})]})]}),(0,G.jsx)(`div`,{ref:d,className:`theme-modal-list`,children:p.length===0?(0,G.jsxs)(`div`,{className:`theme-modal-empty`,children:[(0,G.jsxs)(`p`,{className:`theme-modal-empty-text`,children:[`No themes matching "`,i,`"`]}),(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>{a(``),s(`all`),l(0),u.current?.focus()},children:`Reset Search`})]}):(0,G.jsx)(`div`,{className:`theme-modal-grid`,children:p.map((e,i)=>{let a=t===e.id;return(0,G.jsxs)(`button`,{ref:e=>{f.current[i]=e},type:`button`,className:`theme-modal-card ${a?`active`:``} ${c===i?`focused`:``}`,onClick:()=>{n(e.id),r()},onMouseEnter:()=>l(i),children:[(0,G.jsxs)(`div`,{className:`theme-card-info`,children:[(0,G.jsx)(`span`,{className:`theme-card-name`,children:e.name}),(0,G.jsx)(`span`,{className:`theme-card-meta`,children:e.type===`dark`?(0,G.jsx)(`span`,{className:`theme-meta-tag dark-tag`,children:`Dark`}):(0,G.jsx)(`span`,{className:`theme-meta-tag light-tag`,children:`Light`})})]}),(0,G.jsxs)(`div`,{className:`theme-card-right`,children:[(0,G.jsxs)(`span`,{className:`theme-swatches`,children:[(0,G.jsx)(`span`,{className:`theme-swatch`,style:{background:e.colors.bg},title:`Background`}),(0,G.jsx)(`span`,{className:`theme-swatch`,style:{background:e.colors.secondary},title:`Secondary`}),(0,G.jsx)(`span`,{className:`theme-swatch`,style:{background:e.colors.accent},title:`Accent`})]}),(0,G.jsx)(`span`,{className:`theme-card-status`,children:a&&(0,G.jsx)(jD,{size:14,className:`theme-check-icon`})})]})]},e.id)})})}),(0,G.jsxs)(`div`,{className:`theme-modal-footer`,children:[(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`↑`}),` `,(0,G.jsx)(`kbd`,{children:`↓`}),` `,(0,G.jsx)(`kbd`,{children:`←`}),` `,(0,G.jsx)(`kbd`,{children:`→`}),` Navigate`]}),(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`Enter`}),` Select`]}),(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`ESC`}),` Close`]})]})]})})}var v0=`Cascadia Code.Cascadia Mono.Consolas.Courier New.Dank Mono.Fantasque Sans Mono.Fira Code.Fira Mono.Geist Mono.Hack.IBM Plex Mono.Inconsolata.Input Mono.JetBrains Mono.Maple Mono.Menlo.Monaco.Monoid.Monaspace Argon.Monaspace Krypton.Monaspace Neon.Monaspace Radon.Monaspace Xenon.Noto Sans Mono.Operator Mono.Roboto Mono.SF Mono.Source Code Pro.Space Mono.Ubuntu Mono.Victor Mono`.split(`.`);async function y0(){if(`queryLocalFonts`in window)try{let e=await window.queryLocalFonts();return[...new Set(e.map(e=>e.family))].sort((e,t)=>e.localeCompare(t))}catch{}return v0}function b0({open:e,title:t,defaultLabel:n,activeFont:r,onFontChange:i,onClose:a}){let[o,s]=(0,W.useState)(``),[c,l]=(0,W.useState)([]),[u,d]=(0,W.useState)(!1),[f,p]=(0,W.useState)(0),m=(0,W.useRef)(null),h=(0,W.useRef)(null),g=(0,W.useRef)([]);(0,W.useEffect)(()=>{e&&(s(``),p(0),setTimeout(()=>m.current?.focus(),50),!(c.length>0)&&(d(!0),y0().then(e=>{l(e),d(!1)})))},[e]);let _=(0,W.useMemo)(()=>{let e=o.toLowerCase().trim();return e?c.filter(t=>t.toLowerCase().includes(e)):c},[c,o]),v=_.length+1;(0,W.useEffect)(()=>{f>=v&&p(Math.max(0,v-1))},[v,f]),(0,W.useEffect)(()=>{e&&(f===0?g.current[0]:g.current[f])?.scrollIntoView({block:`nearest`,behavior:`smooth`})},[f,e]);let y=e=>{i(e),a()},b=e=>{if(e.key===`Escape`){e.preventDefault(),a();return}if(v!==0)switch(e.key){case`ArrowDown`:e.preventDefault(),p(e=>Math.min(e+1,v-1));break;case`ArrowUp`:e.preventDefault(),p(e=>Math.max(e-1,0));break;case`Enter`:e.preventDefault(),f===0?y(null):_[f-1]&&y(_[f-1]);break}},x=!r;return(0,G.jsx)(WU,{open:e,onClose:a,className:`theme-modal`,ariaLabel:`${t} Modal`,children:(0,G.jsxs)(`div`,{className:`theme-modal-content`,onKeyDown:b,children:[(0,G.jsxs)(`div`,{className:`theme-modal-header`,children:[(0,G.jsxs)(`div`,{className:`theme-modal-title-row`,children:[(0,G.jsx)(`h2`,{className:`theme-modal-title`,children:t}),(0,G.jsx)(`button`,{className:`theme-modal-close-btn`,onClick:a,"aria-label":`Close`,children:(0,G.jsx)(AO,{size:16})})]}),(0,G.jsxs)(`div`,{className:`theme-modal-search-wrapper`,children:[(0,G.jsx)(xO,{className:`theme-modal-search-icon`,size:16}),(0,G.jsx)(`input`,{ref:m,type:`text`,className:`theme-modal-search-input`,placeholder:`Search fonts...`,value:o,onChange:e=>{s(e.target.value),p(0)}}),o&&(0,G.jsx)(`button`,{className:`theme-modal-clear-btn`,onClick:()=>{s(``),p(0),m.current?.focus()},children:(0,G.jsx)(AO,{size:14})})]})]}),(0,G.jsx)(`div`,{ref:h,className:`theme-modal-list`,children:u?(0,G.jsx)(`div`,{className:`theme-modal-empty`,children:(0,G.jsx)(`p`,{className:`theme-modal-empty-text`,children:`Loading fonts…`})}):(0,G.jsxs)(`div`,{className:`font-picker-list`,children:[(0,G.jsxs)(`button`,{ref:e=>{g.current[0]=e},type:`button`,className:`font-picker-item ${x?`active`:``} ${f===0?`focused`:``}`,onClick:()=>y(null),onMouseEnter:()=>p(0),children:[(0,G.jsxs)(`span`,{className:`font-picker-name font-picker-default-name`,children:[(0,G.jsx)(DO,{size:13,style:{marginRight:`6px`,opacity:.6}}),n]}),(0,G.jsx)(`span`,{className:`font-picker-status`,children:x&&(0,G.jsx)(jD,{size:14,className:`theme-check-icon`})})]},`__default__`),_.length===0&&o?(0,G.jsxs)(`div`,{className:`theme-modal-empty`,style:{paddingTop:`16px`},children:[(0,G.jsxs)(`p`,{className:`theme-modal-empty-text`,children:[`No fonts matching "`,o,`"`]}),(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>{s(``),p(0),m.current?.focus()},children:`Reset Search`})]}):_.map((e,t)=>{let n=r===e,i=f===t+1;return(0,G.jsxs)(`button`,{ref:e=>{g.current[t+1]=e},type:`button`,className:`font-picker-item ${n?`active`:``} ${i?`focused`:``}`,onClick:()=>y(e),onMouseEnter:()=>p(t+1),children:[(0,G.jsx)(`span`,{className:`font-picker-name`,style:{fontFamily:`"${e}", ui-monospace, monospace`},children:e}),(0,G.jsx)(`span`,{className:`font-picker-status`,children:n&&(0,G.jsx)(jD,{size:14,className:`theme-check-icon`})})]},e)})]})}),(0,G.jsxs)(`div`,{className:`theme-modal-footer`,children:[(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`↑`}),` `,(0,G.jsx)(`kbd`,{children:`↓`}),` Navigate`]}),(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`Enter`}),` Select`]}),(0,G.jsxs)(`span`,{className:`theme-footer-item`,children:[(0,G.jsx)(`kbd`,{children:`ESC`}),` Close`]})]})]})})}function x0(){let e=Am(),{settings:t,loaded:n,updateSettings:r}=IE(),[,i]=(0,W.useTransition)(),{patch:a,repoName:o,branch:s,customMode:c,showMode:l,commits:u,truncated:d,binaryFiles:f,tabSizeMap:p,untrackedFiles:m,loading:h,refreshing:g,error:_}=gE({staged:t.staged,untracked:t.untracked},!0),{comments:v,addComment:y,removeComment:b,resolveComment:x,unresolveComment:S,addReply:C,editComment:w,editReply:T,removeReply:E,copyAllComments:D,agentActivity:O,clearAgentActivity:k,sendToAgent:A,sending:j,agentWaiting:M}=xE(),{plans:N}=wE(),P=(0,W.useMemo)(()=>N.filter(e=>e.decision===`pending`).length,[N]),{status:F,refresh:I}=ME(a),[L,R]=(0,W.useState)(null),[z,ee]=(0,W.useState)(()=>{try{let e=fD(`diffing-sidebar-collapsed`);if(e!=null)return e===`true`}catch{}return typeof window<`u`&&window.innerWidth<=768}),[te,B]=(0,W.useState)(()=>{try{let e=fD(`diffing-sidebar-width`);return e?Number(e):320}catch{return 320}}),V=(0,W.useRef)(te);V.current=te;let H=(0,W.useRef)(null),ne=(0,W.useRef)(null),re=(0,W.useRef)(null),ie=(0,W.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=V.current,r=ne.current,i=re.current,a=r?r.getBoundingClientRect().left:0,o=n,s=0,c=()=>{s=0,i&&(i.style.transform=`translateX(${a+o}px)`)};i&&(i.style.transform=`translateX(${a+n}px)`,i.classList.add(`sidebar-resize-guide-active`));let l=e=>{let r=e.clientX-t;o=Math.max(240,Math.min(640,n+r)),s||=requestAnimationFrame(c)},u=()=>{s&&cancelAnimationFrame(s),i&&i.classList.remove(`sidebar-resize-guide-active`),B(o);try{gD(`diffing-sidebar-width`,String(o))}catch{}document.removeEventListener(`mousemove`,l),document.removeEventListener(`mouseup`,u),document.body.style.cursor=``,document.body.style.userSelect=``};document.addEventListener(`mousemove`,l),document.addEventListener(`mouseup`,u),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},[]),[ae,oe]=(0,W.useState)({open:!1,scope:`files`}),se=(0,W.useCallback)(e=>oe({open:!0,scope:e}),[]),ce=(0,W.useCallback)(()=>oe(e=>({...e,open:!1})),[]),[le,ue]=(0,W.useState)(!1),[U,de]=(0,W.useState)(!1),[fe,pe]=(0,W.useState)(!1),[me,he]=(0,W.useState)(!1),[ge,_e]=(0,W.useState)(()=>{try{let e=fD(`diffing-comment-panel-height`);return e?Number(e):220}catch{return 220}}),ve=(0,W.useRef)(ge);ve.current=ge;let ye=(0,W.useCallback)(e=>{e.preventDefault();let t=e.clientY,n=ve.current,r=H.current,i=n,a=0,o=()=>{a=0,r?.style.setProperty(`--comment-panel-height`,`${i}px`)},s=e=>{let r=t-e.clientY;i=Math.max(100,Math.min(600,n+r)),a||=requestAnimationFrame(o)},c=()=>{a&&cancelAnimationFrame(a),_e(i);try{gD(`diffing-comment-panel-height`,String(i))}catch{}document.removeEventListener(`mousemove`,s),document.removeEventListener(`mouseup`,c),document.body.style.cursor=``,document.body.style.userSelect=``};document.addEventListener(`mousemove`,s),document.addEventListener(`mouseup`,c),document.body.style.cursor=`row-resize`,document.body.style.userSelect=`none`},[]);(0,W.useEffect)(()=>{try{gD(`diffing-comment-panel-height`,String(ge))}catch{}},[ge]);let{viewedFiles:be,setViewed:xe}=BE(),Se=(0,W.useRef)(null);un([`G`,`S`],()=>se(`symbols`)),un([`G`,`F`],()=>se(`all`)),un([`G`,`V`],()=>se(`files`)),(0,W.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&(e.key===`k`||e.key===`K`)&&(e.preventDefault(),oe(e=>e.open?{...e,open:!1}:{open:!0,scope:`all`}))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,W.useEffect)(()=>{try{gD(`diffing-sidebar-collapsed`,String(z))}catch{}},[z]);let Ce=(0,W.useMemo)(()=>new Set(m),[m]),we=(0,W.useRef)([]),Te=(0,W.useMemo)(()=>{if(!a)return[];try{let e=Pg(a).flatMap(e=>e.files),t=new Set(e.map(e=>e.name));for(let n of f)if(!t.has(n.path)){let t={name:n.path,type:n.type===`added`||n.type===`untracked`?`new`:n.type===`deleted`?`deleted`:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:!0,deletionLines:[],additionLines:[]};e.push(t)}let n=e.map(e=>{let t=we.current.find(t=>t.name===e.name);return t&&t.type===e.type&&t.isPartial===e.isPartial&&t.deletionLines.length===e.deletionLines.length&&t.additionLines.length===e.additionLines.length&&JSON.stringify(t.hunks)===JSON.stringify(e.hunks)?t:e});return we.current=n,n}catch{return[]}},[a,f]),Ee=vD(Te),De=(0,W.useMemo)(()=>{if(!a)return{additions:0,deletions:0};let e=0,t=0,n=0,r=a.length;for(;n<r;){let i=a.indexOf(`
|
|
3861
|
+
`,n);i===-1&&(i=r);let o=a.charCodeAt(n);o===43?n+2<r&&a.charCodeAt(n+1)===43&&a.charCodeAt(n+2)===43||e++:o===45&&(n+2<r&&a.charCodeAt(n+1)===45&&a.charCodeAt(n+2)===45||t++),n=i+1}return{additions:e,deletions:t}},[a]),Oe=(0,W.useMemo)(()=>{let e=new Map;for(let t of f)e.set(t.path,t);return e},[f]),ke=(0,W.useMemo)(()=>{let e={};for(let t of v)e[t.filePath]=(e[t.filePath]??0)+1;return e},[v]),Ae=(0,W.useRef)(new Map),je=(0,W.useMemo)(()=>{let e=new Map,t=new Map;for(let e of v){let n=t.get(e.filePath);n||(n=[],t.set(e.filePath,n)),n.push(e)}for(let[n,r]of t){let t=r.map(e=>({side:e.side,lineNumber:e.lineNumber,metadata:e})),i=Ae.current.get(n);i&&JSON.stringify(i)===JSON.stringify(t)?e.set(n,i):e.set(n,t)}return Ae.current=e,e},[v]),Me=(0,W.useCallback)(e=>{R(e);let t=document.getElementById(`file-${e}`);t&&t.scrollIntoView({block:`start`})},[]),Ne=(0,W.useCallback)((e,t)=>{xe(e,t)},[xe]),Pe=(0,W.useCallback)(e=>{i(()=>{r({diffStyle:e})})},[r]),Fe=(0,W.useCallback)(e=>{i(()=>{r(e)})},[r]),Ie=(0,W.useCallback)(e=>{i(()=>{r({defaultTabSize:e})})},[r]),Le=(0,W.useCallback)(e=>{i(()=>{r({browser:e})})},[r]),Re=(0,W.useCallback)(e=>{i(()=>{r({theme:e})})},[r]),ze=(0,W.useCallback)(e=>{i(()=>{r({editorIDE:e})})},[r]),Be=(0,W.useCallback)(e=>{i(()=>{r({lineDiffType:e})})},[r]),Ve=(0,W.useCallback)(e=>{i(()=>{r({lineWrap:e})})},[r]),He=(0,W.useCallback)(e=>{i(()=>{r({diffIndicators:e})})},[r]),Ue=(0,W.useCallback)(e=>{i(()=>{r({showLineNumbers:e})})},[r]),We=(0,W.useCallback)(e=>{i(()=>{r({hunkSeparators:e})})},[r]),Ge=(0,W.useCallback)(e=>{i(()=>{r({lineHoverHighlight:e})})},[r]),Ke=(0,W.useCallback)(e=>{i(()=>{r({fontSize:e})})},[r]),qe=(0,W.useCallback)(e=>{r({haptics:e})},[r]),Je=(0,W.useCallback)(e=>{r({sounds:e})},[r]),Ye=(0,W.useCallback)(e=>{r({uiFont:e})},[r]),Xe=(0,W.useCallback)(e=>{r({monoFont:e})},[r]),Ze=(0,W.useCallback)(()=>{Ve(!t.lineWrap)},[t.lineWrap,Ve]),Qe=(0,W.useCallback)(()=>{Ue(!t.showLineNumbers)},[t.showLineNumbers,Ue]),$e=(0,W.useCallback)(()=>{let e=[`classic`,`bars`,`none`],n=t.diffIndicators||`classic`,r=e[(e.indexOf(n)+1)%e.length];He(r)},[t.diffIndicators,He]),et=(0,W.useCallback)(()=>{let e=[`word`,`word-alt`,`char`,`none`],n=t.lineDiffType||`word`,r=e[(e.indexOf(n)+1)%e.length];Be(r)},[t.lineDiffType,Be]),tt=(0,W.useCallback)(()=>{ee(e=>!e)},[]),nt=(0,W.useCallback)(e=>{if(Te.length===0)return;let t=0;if(L){let n=Te.findIndex(e=>e.name===L);n!==-1&&(t=e===`next`?Math.min(n+1,Te.length-1):Math.max(n-1,0))}let n=Te[t].name;R(n);let r=document.getElementById(`file-${n}`);r&&r.scrollIntoView({block:`start`})},[Te,L,R]),rt=(0,W.useCallback)(()=>{L&&xe(L,!be.has(L))},[L,be,xe]),it=(0,W.useCallback)(()=>{Pe(t.diffStyle===`split`?`unified`:`split`)},[t.diffStyle,Pe]),at=(0,W.useCallback)(()=>{let e=[2,4,8],n=t.defaultTabSize||4;Ie(e[(e.indexOf(n)+1)%e.length])},[t.defaultTabSize,Ie]),ot=(0,W.useCallback)(()=>{tt()},[tt]);(0,W.useEffect)(()=>{let e=``,t,n=0,r=r=>{let i=document.activeElement;if(i){let e=i.tagName.toLowerCase();if(e===`input`||e===`textarea`||i.hasAttribute(`contenteditable`))return}clearTimeout(t);let a=r.key;if(r.ctrlKey){a===`d`?(r.preventDefault(),window.scrollBy({top:window.innerHeight/2,behavior:`auto`}),sD(`selection`,`navigate`),e=``):a===`u`&&(r.preventDefault(),window.scrollBy({top:-window.innerHeight/2,behavior:`auto`}),sD(`selection`,`navigate`),e=``);return}if(!(a.length>1&&a!==`Escape`&&a!==`Enter`))if(e+=a,t=setTimeout(()=>{e=``},800),e===`j`){r.preventDefault(),window.scrollBy({top:100,behavior:`auto`});let t=Date.now();t-n>80&&(aD(`navigate`),n=t),e=``}else if(e===`k`){r.preventDefault(),window.scrollBy({top:-100,behavior:`auto`});let t=Date.now();t-n>80&&(aD(`navigate`),n=t),e=``}else e===`gg`?(r.preventDefault(),window.scrollTo({top:0,behavior:`auto`}),sD(`selection`,`navigate`),e=``):e===`G`?(r.preventDefault(),window.scrollTo({top:document.documentElement.scrollHeight,behavior:`auto`}),sD(`selection`,`navigate`),e=``):e===`J`?(r.preventDefault(),nt(`next`),sD(`selection`,`navigate`),e=``):e===`K`?(r.preventDefault(),nt(`prev`),sD(`selection`,`navigate`),e=``):e===`v`?(r.preventDefault(),rt(),sD(`selection`,`toggle`),e=``):e===`m`?(r.preventDefault(),it(),sD(`selection`,`toggle`),e=``):e===`t`?(r.preventDefault(),at(),sD(`selection`,`toggle`),e=``):e===`b`?(r.preventDefault(),ot(),sD(`selection`,`toggle`),e=``):e===`w`?(r.preventDefault(),Ze(),sD(`selection`,`toggle`),e=``):e===`n`?(r.preventDefault(),Qe(),sD(`selection`,`toggle`),e=``):e===`i`?(r.preventDefault(),$e(),sD(`selection`,`toggle`),e=``):e===`I`?(r.preventDefault(),et(),sD(`selection`,`toggle`),e=``):e===`/`?(r.preventDefault(),se(`text`),sD(`medium`,`open`),e=``):e===`s`?(r.preventDefault(),se(`symbols`),sD(`medium`,`open`),e=``):e===`gv`?(r.preventDefault(),se(`files`),sD(`medium`,`open`),e=``):e===`gt`?(r.preventDefault(),de(!0),sD(`medium`,`open`),e=``):e===`?`?(r.preventDefault(),ue(!0),sD(`medium`,`open`),e=``):e.length>=2&&(e=``)};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),clearTimeout(t)}},[Te,L,be,t.diffStyle,t.defaultTabSize,nt,rt,it,at,ot,Ze,Qe,$e,et,de]);let st=(0,W.useMemo)(()=>({staged:t.staged,untracked:t.untracked}),[t.staged,t.untracked]);(0,W.useEffect)(()=>{let e=t.theme||`nord`,n=document.documentElement;n.classList.add(`theme-switching`),n.setAttribute(`data-theme`,e);let r=requestAnimationFrame(()=>{requestAnimationFrame(()=>n.classList.remove(`theme-switching`))});return()=>cancelAnimationFrame(r)},[t.theme]),LE(n,t.uiFont,t.monoFont);let ct=(0,W.useMemo)(()=>FE(t.monoFont),[t.monoFont]),lt=(0,W.useMemo)(()=>nE[t.theme||`nord`]||nE.nord,[t.theme]);return(0,W.useEffect)(()=>{e&&e.setRenderOptions({theme:{dark:lt.type===`dark`?lt.themeName:`nord`,light:lt.type===`light`?lt.themeName:`github-light`}}).catch(e=>{console.error(`Failed to set worker pool render options:`,e)})},[e,lt]),(0,W.useEffect)(()=>{let e=lt.type===`dark`?lt.themeName:`nord`,t=lt.type===`light`?lt.themeName:`github-light`;Uf({themes:Array.from(new Set([e,t])),langs:[]}).catch(()=>{})},[lt]),h?(0,G.jsxs)(`div`,{className:`app skeleton-app`,style:{"--sidebar-width":`${te}px`,"--comment-panel-height":`${ge}px`},children:[(0,G.jsxs)(`header`,{className:`skeleton-toolbar`,children:[(0,G.jsx)(`div`,{className:`skeleton-item skeleton-logo`}),(0,G.jsx)(`div`,{className:`skeleton-item skeleton-stats`}),(0,G.jsx)(`div`,{className:`skeleton-item skeleton-actions`})]}),(0,G.jsxs)(`div`,{className:`app-body`,children:[(0,G.jsx)(`aside`,{className:`sidebar skeleton-sidebar ${z?`sidebar-collapsed`:``}`,children:!z&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`skeleton-search`}),(0,G.jsx)(`div`,{className:`skeleton-tree-nodes`,children:Array.from({length:8}).map((e,t)=>(0,G.jsxs)(`div`,{className:`skeleton-tree-node`,style:{paddingLeft:`${t%3*16+16}px`},children:[(0,G.jsx)(`div`,{className:`skeleton-node-icon`}),(0,G.jsx)(`div`,{className:`skeleton-node-text`,style:{width:`${60+t*12%60}px`}})]},t))})]})}),!z&&(0,G.jsx)(`div`,{className:`sidebar-resize-handle`,style:{cursor:`default`}}),(0,G.jsx)(`main`,{className:`main skeleton-main`,children:(0,G.jsx)(`div`,{className:`diff-viewer`,children:Array.from({length:3}).map((e,t)=>(0,G.jsxs)(`div`,{className:`file-diff-card skeleton-card`,children:[(0,G.jsxs)(`div`,{className:`skeleton-card-header`,children:[(0,G.jsx)(`div`,{className:`skeleton-card-title`,style:{width:`${120+t*45%150}px`}}),(0,G.jsx)(`div`,{className:`skeleton-card-badge`})]}),(0,G.jsx)(`div`,{className:`skeleton-card-body`,children:Array.from({length:5}).map((e,t)=>(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`${50+t*15%45}%`}},t))})]},t))})})]})]}):_?(0,G.jsx)(`div`,{className:`error`,children:(0,G.jsxs)(`p`,{children:[`Error: `,_]})}):(0,G.jsx)(cD,{enabled:t.haptics??!0,soundsEnabled:t.sounds??!0,children:(0,G.jsxs)(`div`,{className:`app`,ref:H,style:{"--sidebar-width":`${te}px`,"--comment-panel-height":`${ge}px`},children:[g&&(0,G.jsx)(`div`,{className:`refresh-bar`,role:`status`,"aria-label":`Refreshing diff`}),(0,G.jsx)(`div`,{className:`sidebar-resize-guide`,ref:re,"aria-hidden":`true`}),(0,G.jsx)(TU,{repoName:o,branch:s,fileCount:Te.length,additions:De.additions,deletions:De.deletions,commentCount:v.length,planCount:N.length,pendingPlanCount:P,onOpenPlans:()=>DE(`/plan`),diffStyle:t.diffStyle,diffOptions:st,defaultTabSize:t.defaultTabSize,browser:t.browser,theme:t.theme||`nord`,editorIDE:t.editorIDE,customMode:c,showMode:l,showCommitCount:u.length,lineDiffType:t.lineDiffType,lineWrap:t.lineWrap,diffIndicators:t.diffIndicators,showLineNumbers:t.showLineNumbers,hunkSeparators:t.hunkSeparators,lineHoverHighlight:t.lineHoverHighlight,fontSize:t.fontSize,haptics:t.haptics??!0,sounds:t.sounds??!0,uiFont:t.uiFont,monoFont:t.monoFont,sidebarCollapsed:z,onToggleSidebar:tt,onDiffStyleChange:Pe,onDiffOptionsChange:Fe,onDefaultTabSizeChange:Ie,onBrowserChange:Le,onOpenThemeModal:()=>de(!0),onEditorIDEChange:ze,onLineDiffTypeChange:Be,onLineWrapChange:Ve,onDiffIndicatorsChange:He,onShowLineNumbersChange:Ue,onHunkSeparatorsChange:We,onLineHoverHighlightChange:Ge,onFontSizeChange:Ke,onHapticsChange:qe,onSoundsChange:Je,onOpenUiFontModal:()=>pe(!0),onOpenMonoFontModal:()=>he(!0),onOpenSearch:()=>se(`all`),onCopyComments:D,onSendToAgent:A,agentWaiting:M,sending:j,comments:v,onEditComment:w,onDeleteComment:b}),!z&&(0,G.jsx)(`div`,{className:`sidebar-mobile-backdrop`,onClick:tt,"aria-hidden":`true`}),(0,G.jsxs)(`div`,{className:`app-body`,children:[(0,G.jsxs)(`aside`,{ref:ne,className:`sidebar ${z?`sidebar-collapsed`:``}`,children:[(0,G.jsx)(`div`,{style:{flex:1,minHeight:0,overflow:`hidden`},children:(0,G.jsx)(k1,{files:Te,activeFile:L,commentCounts:ke,viewedFiles:be,untrackedFiles:Ce,onFileClick:Me,collapsed:z,onToggleCollapse:tt})}),!z&&v.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`ct-resize-handle`,onMouseDown:ye,role:`separator`,"aria-label":`Resize comments panel`,"aria-orientation":`horizontal`,tabIndex:0}),(0,G.jsx)(`div`,{className:`ct-wrapper`,style:{flexShrink:0},children:(0,G.jsx)(M1,{comments:v,resolveComment:x,unresolveComment:S,removeComment:b,addReply:C,editComment:w,editReply:T,removeReply:E})})]})]}),!z&&(0,G.jsx)(`div`,{className:`sidebar-resize-handle`,onMouseDown:ie,role:`separator`,"aria-label":`Resize sidebar`,"aria-orientation":`vertical`,tabIndex:0}),(0,G.jsxs)(`main`,{className:`main`,ref:Se,children:[l&&u.length>0&&(0,G.jsxs)(`div`,{className:`commit-banner-stack`,role:`list`,children:[u.map((e,t)=>(0,G.jsx)(EU,{commit:e,index:t,total:u.length},e.sha)),d>0&&(0,G.jsxs)(`div`,{className:`commit-banner-truncated`,role:`status`,children:[`+ `,d,` more commit`,d===1?``:`s`,` not shown`]})]}),F.inMerge&&F.conflicts.length>0&&(0,G.jsxs)(`div`,{className:`merge-conflict-banner`,children:[(0,G.jsx)(`strong`,{children:`Merge in progress`}),(0,G.jsxs)(`span`,{children:[F.conflicts.length,` unresolved file`,F.conflicts.length===1?``:`s`,` below. Use the inline buttons to accept current/incoming/both, then "Save & stage".`]})]}),F.conflicts.map(e=>(0,G.jsx)(hW,{filePath:e,theme:t.theme||`nord`,fontSize:t.fontSize,monoFontFamily:ct,tabSize:p[e]??t.defaultTabSize,onSaved:()=>{I()}},e)),(0,G.jsx)(pW,{files:Te,diffStyle:t.diffStyle,tabSizeMap:p,defaultTabSize:t.defaultTabSize,viewedFiles:be,binaryFiles:Oe,theme:t.theme||`nord`,editorIDE:t.editorIDE,lineDiffType:t.lineDiffType,lineWrap:t.lineWrap,diffIndicators:t.diffIndicators,showLineNumbers:t.showLineNumbers,hunkSeparators:t.hunkSeparators,lineHoverHighlight:t.lineHoverHighlight,fontSize:t.fontSize,monoFontFamily:ct,expandContextByDefault:t.expandContextByDefault,collapsedContextThreshold:t.collapsedContextThreshold,expansionLineCount:t.expansionLineCount,onViewedChange:Ne,fileAnnotationsMap:je,onAddComment:y,onDeleteComment:b})]})]}),(0,G.jsx)(a0,{isOpen:ae.open,onClose:ce,initialScope:ae.scope,files:Te,changedEntries:Ee,customMode:c,staged:t.staged,onNavigateFile:Me,theme:t.theme||`nord`,fontSize:t.fontSize,monoFontFamily:ct,defaultTabSize:t.defaultTabSize,lineWrap:t.lineWrap,showLineNumbers:t.showLineNumbers,lineHoverHighlight:t.lineHoverHighlight}),(0,G.jsx)(p0,{activeFile:L,onShowHelp:()=>ue(!0)}),(0,G.jsx)(m0,{isOpen:le,onClose:()=>ue(!1)}),(0,G.jsx)(_0,{open:U,activeTheme:t.theme||`nord`,onThemeChange:Re,onClose:()=>de(!1)}),(0,G.jsx)(b0,{open:fe,title:`Select UI Font`,defaultLabel:`Default (Geist Mono, from CDN)`,activeFont:t.uiFont,onFontChange:Ye,onClose:()=>pe(!1)}),(0,G.jsx)(b0,{open:me,title:`Select Code Font`,defaultLabel:`Default (JetBrains Mono, from CDN)`,activeFont:t.monoFont,onFontChange:Xe,onClose:()=>he(!1)}),(0,G.jsx)(h0,{activity:O,onDismiss:k,onJump:Me})]})})}function S0(e,t){if(t<1)return;let n=e.split(`
|
|
3862
|
+
`),r=Math.min(t,n.length);for(let e=r-1;e>=0;e--){let t=/^\s{0,3}(#{1,6})\s+(.*?)\s*#*\s*$/.exec(n[e]);if(t)return t[2].trim()}}function C0(e,t,n){if(t<1)return``;let r=e.split(`
|
|
3863
3863
|
`),i=Math.max(1,t),a=Math.min(n,r.length);return a<i?``:r.slice(i-1,a).join(`
|
|
3864
|
-
`)}function m0({role:e,size:t=16}){return e===`agent`?(0,G.jsx)(`div`,{className:`comment-avatar-circle comment-avatar-agent`,style:{width:`${t*2}px`,height:`${t*2}px`},children:(0,G.jsx)(AD,{size:t,"aria-hidden":`true`})}):(0,G.jsx)(`div`,{className:`comment-avatar-circle comment-avatar-user`,style:{width:`${t*2}px`,height:`${t*2}px`},children:(0,G.jsx)(kO,{size:t,"aria-hidden":`true`})})}function h0({comment:e,onResolve:t,onUnresolve:n,onDelete:r,onEdit:i,onReply:a,onEditReply:o,onDeleteReply:s}){let[,c]=(0,W.useState)(0),l=e.status===`resolved`,[u,d]=(0,W.useState)(l),[f,p]=(0,W.useState)(!1),[m,h]=(0,W.useState)(!1),[g,_]=(0,W.useState)(!1),[v,y]=(0,W.useState)(null);(0,W.useEffect)(()=>d(e.status===`resolved`),[e.status]),(0,W.useEffect)(()=>{let e=setInterval(()=>c(e=>e+1),3e4);return()=>clearInterval(e)},[]);let b=e.lineNumber===0,x=e.startLineNumber&&e.startLineNumber!==e.lineNumber,S=(0,G.jsxs)(G.Fragment,{children:[e.sectionTitle&&(0,G.jsxs)(`span`,{className:`plan-comment-section-chip`,title:`Section: ${e.sectionTitle}`,children:[`§\xA0`,e.sectionTitle]}),b?(0,G.jsx)(`span`,{className:`plan-comment-line-chip plan-comment-line-chip-general`,children:`Whole plan`}):(0,G.jsx)(`span`,{className:`plan-comment-line-chip`,children:x?`L${e.startLineNumber}-${e.lineNumber}`:`L${e.lineNumber}`})]});return l&&u?(0,G.jsxs)(`div`,{className:`comment-resolved-collapsed plan-comment-resolved-collapsed`,children:[(0,G.jsxs)(`div`,{className:`plan-comment-resolved-left`,children:[(0,G.jsx)(LD,{size:15,style:{color:`var(--success)`}}),(0,G.jsx)(`span`,{style:{fontWeight:600},children:`Resolved`}),S,(0,G.jsx)(`span`,{children:`•`}),(0,G.jsx)(`span`,{children:e.replies?.length?`${e.replies.length+1} comments`:`1 comment`})]}),(0,G.jsx)(`button`,{className:`plan-comment-show-resolved`,onClick:()=>d(!1),children:`Show`})]}):(0,G.jsxs)(`div`,{className:`comment-bubble-canvas ${l?`comment-bubble-canvas-resolved`:``}`,id:`plan-comment-${e.id}`,role:`article`,children:[(0,G.jsxs)(`div`,{className:`comment-node ${l?`comment-node-resolved`:``}`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(m0,{role:`user`,size:16})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge comment-node-badge-user`,children:`User`}),(0,G.jsxs)(`span`,{className:`comment-node-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`,flexWrap:`wrap`},children:[eE(e.createdAt),S]}),l&&(0,G.jsxs)(`span`,{className:`comment-canvas-resolved-banner`,style:{marginLeft:`8px`},children:[(0,G.jsx)(LD,{size:13}),`Resolved`]}),!l&&!m&&(0,G.jsxs)(`div`,{className:`comment-node-actions`,children:[(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>h(!0),title:`Edit comment`,"aria-label":`Edit comment`,children:(0,G.jsx)(hO,{size:13,"aria-hidden":`true`})}),g?(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsxs)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:r,title:`Confirm delete`,style:{color:`var(--danger)`,background:`var(--feedback-danger-bg)`,fontWeight:600,fontSize:`11px`,border:`1px solid var(--feedback-danger-border)`,padding:`2px 6px`,width:`auto`,height:`auto`,display:`flex`,alignItems:`center`,gap:`2px`},children:[(0,G.jsx)(EO,{size:11}),`Delete?`]}),(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>_(!1),title:`Cancel delete`,style:{fontSize:`11px`,padding:`2px 6px`,width:`auto`,height:`auto`},children:`Cancel`})]}):(0,G.jsx)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>_(!0),title:`Delete comment`,"aria-label":`Delete comment`,children:(0,G.jsx)(TO,{size:13,"aria-hidden":`true`})})]})]}),m?(0,G.jsx)(`div`,{style:{marginTop:`8px`},children:(0,G.jsx)(KU,{draftKey:`plan-edit:${e.id}`,initialBody:e.body,lineContent:e.lineContent,onSubmit:e=>{i(e),h(!1)},onCancel:()=>h(!1)})}):(0,G.jsx)(JH,{content:e.body,className:`comment-node-body markdown-body ${l?`comment-resolved-line`:``}`})]})]}),e.replies?.length>0&&(0,G.jsx)(`div`,{className:`comment-replies`,role:`list`,"aria-label":`Replies`,children:e.replies.map((t,n)=>{let r=t.role===`agent`,i=v===t.id;return(0,G.jsxs)(`div`,{className:`comment-node ${r?`comment-node-agent`:`comment-node-user`} ${l?`comment-node-resolved`:``}`,role:`listitem`,"aria-label":`${r?`Agent`:`User`} reply ${n+1}`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(m0,{role:r?`agent`:`user`,size:14})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:r?`Agent`:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge ${r?`comment-node-badge-agent`:`comment-node-badge-user`}`,children:r?`Agent`:`User`}),r&&t.model&&(0,G.jsx)(`span`,{style:{fontSize:`10px`,fontWeight:600,padding:`1px 5px`,borderRadius:`4px`,background:`var(--bg-tertiary)`,color:`var(--text-secondary)`,fontFamily:`var(--font-mono)`},children:t.model}),(0,G.jsx)(`span`,{className:`comment-node-time`,children:eE(t.createdAt)}),!l&&(0,G.jsxs)(`div`,{className:`comment-node-actions`,children:[(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>y(t.id),title:`Edit reply`,"aria-label":`Edit reply`,children:(0,G.jsx)(hO,{size:12,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>s(t.id),title:`Delete reply`,"aria-label":`Delete reply`,children:(0,G.jsx)(TO,{size:12,"aria-hidden":`true`})})]})]}),i?(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`var(--radius-md)`,border:`1px solid var(--border-color)`,marginTop:`6px`},children:(0,G.jsx)(KU,{draftKey:`plan-reply-edit:${e.id}:${t.id}`,initialBody:t.body,onSubmit:e=>{o(t.id,e),y(null)},onCancel:()=>y(null)})}):(0,G.jsx)(JH,{content:t.body,className:`comment-node-body markdown-body`})]})]},t.id)})}),(0,G.jsxs)(`div`,{className:`comment-canvas-footer`,children:[!f&&(0,G.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,G.jsxs)(`button`,{onClick:()=>p(!0),className:`comment-reply-trigger`,style:{width:`100%`,maxWidth:`320px`},children:[(0,G.jsx)(vO,{size:14,"aria-hidden":`true`}),`Reply...`]}),l?(0,G.jsxs)(`div`,{style:{display:`flex`,gap:`6px`,marginLeft:`12px`},children:[(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:()=>d(!0),style:{fontSize:`12px`,padding:`4px 10px`},children:`Hide`}),(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:n,style:{fontSize:`12px`,padding:`4px 10px`},children:`Unresolve`})]}):(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:t,style:{fontSize:`12px`,padding:`4px 10px`,marginLeft:`12px`},children:`Resolve`})]}),f&&(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`var(--radius-md)`,border:`1px solid var(--border-color)`,marginTop:`4px`},children:(0,G.jsx)(KU,{draftKey:`plan-reply:${e.id}`,onSubmit:e=>{a(e),p(!1)},onCancel:()=>p(!1)})})]})]})}var g0=(0,W.memo)(function({isOpen:e,filePath:t,onClose:n}){let{data:r,isLoading:i,error:a}=k1(t),o=t?t.split(`/`).pop():``;return(0,G.jsxs)(PU,{open:e,onClose:n,className:`shortcuts-modal file-preview-modal`,ariaLabel:`File preview`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header-title`,children:[(0,G.jsx)(qD,{size:18,className:`shortcuts-icon`}),(0,G.jsxs)(`h2`,{children:[`Preview: `,o]}),(0,G.jsx)(`span`,{style:{fontSize:`11px`,color:`var(--text-muted)`,marginLeft:`8px`},children:t})]}),(0,G.jsx)(`button`,{className:`shortcuts-close-btn`,onClick:n,"aria-label":`Close dialog`,children:(0,G.jsx)(AO,{size:16})})]}),(0,G.jsxs)(`div`,{className:`shortcuts-body`,style:{maxHeight:`60vh`,display:`flex`,flexDirection:`column`},children:[i&&(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`40px`,gap:`8px`,color:`var(--text-muted)`},children:[(0,G.jsx)(nO,{size:16,className:`spin`}),(0,G.jsx)(`span`,{children:`Loading file content...`})]}),a&&(0,G.jsxs)(`div`,{style:{padding:`20px`,color:`var(--danger)`,background:`var(--feedback-danger-bg)`,borderRadius:`6px`},children:[`Failed to load file: `,a.message||String(a)]}),r&&(0,G.jsx)(`div`,{style:{flex:1,overflow:`auto`,background:`var(--bg-secondary)`,borderRadius:`6px`,border:`1px solid var(--border-normal)`},children:r.binary?(0,G.jsx)(`div`,{style:{padding:`40px`,textAlign:`center`,color:`var(--text-muted)`},children:`Binary file cannot be previewed.`}):r.missing?(0,G.jsx)(`div`,{style:{padding:`40px`,textAlign:`center`,color:`var(--text-muted)`},children:`File does not exist or has been deleted.`}):(0,G.jsx)(`pre`,{style:{margin:0,padding:`16px`,fontFamily:`var(--font-mono)`,fontSize:`13px`,lineHeight:`1.6`,overflowX:`auto`,whiteSpace:`pre-wrap`,wordBreak:`break-all`},children:(0,G.jsx)(`code`,{children:r.content})})})]}),(0,G.jsx)(`div`,{className:`shortcuts-footer`,style:{justifyContent:`flex-end`},children:(0,G.jsx)(`button`,{className:`btn btn-sm btn-primary`,onClick:n,children:`Close Preview`})})]})}),_0={pending:{label:`Pending review`,className:`plan-badge-pending`,icon:VD},approved:{label:`Approved`,className:`plan-badge-approved`,icon:jD},"changes-requested":{label:`Changes requested`,className:`plan-badge-changes`,icon:sO},rejected:{label:`Rejected`,className:`plan-badge-rejected`,icon:AO},"comment-only":{label:`Comment only`,className:`plan-badge-comment-only`,icon:cO}};function v0({plan:e,theme:t,fontSize:n,monoFontFamily:r,defaultTabSize:i,lineWrap:a,showLineNumbers:o,lineHoverHighlight:s,viewMode:c}){let{addPlanComment:l,editPlanComment:u,resolvePlanComment:d,unresolvePlanComment:f,removePlanComment:p,addPlanReply:m,editPlanReply:h,removePlanReply:g,submitDecision:_,submitting:v,agentWaiting:y}=wE(),[b,x]=(0,W.useState)(null),[S,C]=(0,W.useState)(null),[w,T]=(0,W.useState)(0),[E,D]=(0,W.useState)(null),O=e.versions??[],[k,A]=(0,W.useState)(e.version),[j,M]=(0,W.useState)(e.body),[N,P]=(0,W.useState)(e.title),F=(0,W.useRef)(e.version);(0,W.useEffect)(()=>{let t=k===F.current;e.version!==F.current&&t&&A(e.version),F.current=e.version},[e.version,k]),(0,W.useEffect)(()=>{let t=!1;if(k===e.version){M(e.body),P(e.title);return}let n=O.find(e=>e.version===k);if(n){M(n.body),P(n.title);return}return fetch(`/api/plans/${e.id}/versions/${k}`).then(e=>e.ok?e.json():null).then(e=>{t||!e?.version||(M(e.version.body),P(e.version.title))}).catch(()=>{}),()=>{t=!0}},[k,e.version,e.body,e.title,e.id,O]),(0,W.useEffect)(()=>{C(null),T(0),x(null)},[k]);let I=k!==e.version,L=(0,W.useMemo)(()=>O.map(t=>({value:String(t.version),label:t.version===e.version?`v${t.version} (current)`:`v${t.version}`})),[O,e.version]),R=e=>{let t=e.target.closest(`a`);if(t){let n=t.getAttribute(`href`);n&&n.startsWith(`file:///`)&&(e.preventDefault(),D(n.replace(`file://`,``)))}},z=nE[t]||nE.nord,ee=(0,W.useMemo)(()=>y0(i,n,r),[i,n,r]),te=e.comments??[],B=I?te.filter(e=>e.createdAtPlanVersion===k):te,V=B.filter(e=>e.lineNumber>0),H=B.filter(e=>e.lineNumber===0);B.filter(e=>e.status===`open`).length;let ne=te.length,re=(e,t)=>p0(j,e??t,t),ie=(t,n)=>{l({planId:e.id,lineNumber:t.lineNumber,startLineNumber:t.startLineNumber,lineContent:re(t.startLineNumber,t.lineNumber),sectionTitle:f0(j,t.startLineNumber??t.lineNumber),body:n,createdAtPlanVersion:k}),x(null),C(null)},ae=(0,W.useMemo)(()=>{let e=V.map(e=>({lineNumber:e.lineNumber,metadata:e}));return b&&e.push({lineNumber:b.lineNumber,metadata:{_pending:!0}}),e},[V,b]),oe=t=>{let n=t.metadata;if(!n)return null;if(`_pending`in n){let t=b;return(0,G.jsx)(KU,{draftKey:`plan-new:${e.id}:${t.startLineNumber??t.lineNumber}:${t.lineNumber}`,lineContent:re(t.startLineNumber,t.lineNumber),onSubmit:e=>ie(t,e),onCancel:()=>{x(null),C(null)}})}let r=n;return(0,G.jsx)(h0,{comment:r,onResolve:()=>d(e.id,r.id),onUnresolve:()=>f(e.id,r.id),onDelete:()=>p(e.id,r.id),onEdit:t=>u(e.id,r.id,t),onReply:t=>m(e.id,r.id,t),onEditReply:(t,n)=>h(e.id,r.id,t,n),onDeleteReply:t=>g(e.id,r.id,t)})},se=_0[e.decision],ce=se.icon;return(0,G.jsxs)(`div`,{className:`plan-review`,children:[(0,G.jsx)(`div`,{className:`plan-review-head`,children:(0,G.jsxs)(`div`,{className:`plan-review-head-main`,children:[(0,G.jsxs)(`h2`,{className:`plan-review-title`,title:N,children:[N,I&&N!==e.title&&(0,G.jsxs)(`span`,{className:`plan-review-title-historical`,title:`Currently submitted title: ${e.title}`,children:[` `,`(current: `,e.title,`)`]})]}),(0,G.jsxs)(`div`,{className:`plan-review-meta`,children:[(0,G.jsxs)(`span`,{className:`plan-badge ${se.className}`,children:[(0,G.jsx)(ce,{size:12,"aria-hidden":`true`}),se.label]}),(0,G.jsxs)(`span`,{className:`plan-review-chip`,children:[`v`,k,O.length>1?` / ${O.length}`:``]}),O.length>1&&(0,G.jsxs)(`div`,{className:`plan-review-version-switcher`,children:[(0,G.jsx)($D,{size:12,"aria-hidden":`true`,className:`plan-review-version-switcher-icon`}),(0,G.jsx)(NA,{value:String(k),onValueChange:e=>A(Number(e)),options:L,ariaLabel:`Plan version`}),I&&(0,G.jsxs)(`button`,{type:`button`,className:`plan-review-version-back`,onClick:()=>A(e.version),title:`Back to current v${e.version}`,children:[(0,G.jsx)(kD,{size:11,"aria-hidden":`true`}),`Back to v`,e.version]}),I&&(0,G.jsx)(`span`,{className:`plan-review-version-current-dot`,title:`This is v${k} of ${e.version}`,"aria-label":`Viewing historical version ${k}`})]}),e.source&&(0,G.jsx)(`span`,{className:`plan-review-chip`,children:e.source}),e.model&&(0,G.jsxs)(`span`,{className:`plan-review-chip plan-review-chip-model`,children:[(0,G.jsx)(AD,{size:11,"aria-hidden":`true`}),e.model]}),V.length+H.length>0&&(0,G.jsxs)(`span`,{className:`plan-review-chip`,children:[B.length,` comment`,B.length===1?``:`s`,I&&ne!==B.length&&(0,G.jsxs)(`span`,{className:`plan-review-chip-sub`,children:[` of `,ne]})]}),w>0&&(0,G.jsxs)(`span`,{className:`plan-review-chip plan-review-chip-selection`,"aria-live":`polite`,children:[w,` line`,w===1?``:`s`,` selected`]})]})]})}),I&&(0,G.jsxs)(`div`,{className:`plan-review-historical-banner`,role:`status`,children:[(0,G.jsx)($D,{size:14,"aria-hidden":`true`}),(0,G.jsxs)(`span`,{children:[`Viewing `,(0,G.jsxs)(`strong`,{children:[`v`,k]}),` of this plan (current is `,(0,G.jsxs)(`strong`,{children:[`v`,e.version]}),`).`,` `,`Comments and line anchors reflect v`,k,`.`]}),(0,G.jsxs)(`button`,{type:`button`,className:`plan-review-historical-banner-back`,onClick:()=>A(e.version),children:[(0,G.jsx)(kD,{size:11,"aria-hidden":`true`}),`Back to current`]})]}),e.decision!==`pending`&&(0,G.jsxs)(`div`,{className:`plan-decision-banner ${se.className}`,children:[(0,G.jsx)(ce,{size:15,"aria-hidden":`true`}),(0,G.jsxs)(`div`,{className:`plan-decision-banner-text`,children:[(0,G.jsx)(`strong`,{children:se.label}),e.decisionComment&&(0,G.jsx)(JH,{content:e.decisionComment,className:`plan-decision-banner-note markdown-body`})]})]}),H.length>0&&(0,G.jsxs)(`div`,{className:`plan-general-section`,children:[(0,G.jsxs)(`div`,{className:`plan-general-header`,children:[(0,G.jsx)(oO,{size:14}),(0,G.jsxs)(`span`,{children:[`General comments (`,H.length,`)`]})]}),H.map(t=>(0,G.jsx)(h0,{comment:t,onResolve:()=>d(e.id,t.id),onUnresolve:()=>f(e.id,t.id),onDelete:()=>p(e.id,t.id),onEdit:n=>u(e.id,t.id,n),onReply:n=>m(e.id,t.id,n),onEditReply:(n,r)=>h(e.id,t.id,n,r),onDeleteReply:n=>g(e.id,t.id,n)},t.id))]}),c===`rendered`?(0,G.jsx)(`div`,{className:`markdown-body plan-rendered`,onClick:R,children:(0,G.jsx)(JH,{content:j})}):(0,G.jsx)(`div`,{className:`plan-file`,children:(0,G.jsx)(Bh,{file:{name:`PLAN.md`,contents:j,lang:`markdown`},options:{disableFileHeader:!0,enableGutterUtility:!0,enableLineSelection:!0,overflow:a?`wrap`:`scroll`,disableLineNumbers:!o,lineHoverHighlight:s,onLineSelectionStart:()=>{C(null),T(0)},onLineSelectionChange:e=>{T(e?Math.abs(e.end-e.start)+1:0)},onLineSelectionEnd:e=>{T(0),e&&(C(e),x({lineNumber:e.end,startLineNumber:e.start}))},theme:{dark:z.type===`dark`?z.themeName:`nord`,light:z.type===`light`?z.themeName:`github-light`},themeType:z.type,unsafeCSS:ee},selectedLines:S,lineAnnotations:ae,renderAnnotation:oe,renderGutterUtility:e=>(0,G.jsx)(`button`,{className:`gutter-add-btn`,onClick:()=>{let t=e();t&&x({lineNumber:t.lineNumber})},children:`+`})})}),(0,G.jsx)(g0,{isOpen:!!E,filePath:E,onClose:()=>D(null)})]})}function y0(e,t,n){return`
|
|
3864
|
+
`)}function w0({role:e,size:t=16}){return e===`agent`?(0,G.jsx)(`div`,{className:`comment-avatar-circle comment-avatar-agent`,style:{width:`${t*2}px`,height:`${t*2}px`},children:(0,G.jsx)(AD,{size:t,"aria-hidden":`true`})}):(0,G.jsx)(`div`,{className:`comment-avatar-circle comment-avatar-user`,style:{width:`${t*2}px`,height:`${t*2}px`},children:(0,G.jsx)(kO,{size:t,"aria-hidden":`true`})})}function T0({comment:e,onResolve:t,onUnresolve:n,onDelete:r,onEdit:i,onReply:a,onEditReply:o,onDeleteReply:s}){let[,c]=(0,W.useState)(0),l=e.status===`resolved`,[u,d]=(0,W.useState)(l),[f,p]=(0,W.useState)(!1),[m,h]=(0,W.useState)(!1),[g,_]=(0,W.useState)(!1),[v,y]=(0,W.useState)(null);(0,W.useEffect)(()=>d(e.status===`resolved`),[e.status]),(0,W.useEffect)(()=>{let e=setInterval(()=>c(e=>e+1),3e4);return()=>clearInterval(e)},[]);let b=e.lineNumber===0,x=e.startLineNumber&&e.startLineNumber!==e.lineNumber,S=(0,G.jsxs)(G.Fragment,{children:[e.sectionTitle&&(0,G.jsxs)(`span`,{className:`plan-comment-section-chip`,title:`Section: ${e.sectionTitle}`,children:[`§\xA0`,e.sectionTitle]}),b?(0,G.jsx)(`span`,{className:`plan-comment-line-chip plan-comment-line-chip-general`,children:`Whole plan`}):(0,G.jsx)(`span`,{className:`plan-comment-line-chip`,children:x?`L${e.startLineNumber}-${e.lineNumber}`:`L${e.lineNumber}`})]});return l&&u?(0,G.jsxs)(`div`,{className:`comment-resolved-collapsed plan-comment-resolved-collapsed`,children:[(0,G.jsxs)(`div`,{className:`plan-comment-resolved-left`,children:[(0,G.jsx)(LD,{size:15,style:{color:`var(--success)`}}),(0,G.jsx)(`span`,{style:{fontWeight:600},children:`Resolved`}),S,(0,G.jsx)(`span`,{children:`•`}),(0,G.jsx)(`span`,{children:e.replies?.length?`${e.replies.length+1} comments`:`1 comment`})]}),(0,G.jsx)(`button`,{className:`plan-comment-show-resolved`,onClick:()=>d(!1),children:`Show`})]}):(0,G.jsxs)(`div`,{className:`comment-bubble-canvas ${l?`comment-bubble-canvas-resolved`:``}`,id:`plan-comment-${e.id}`,role:`article`,children:[(0,G.jsxs)(`div`,{className:`comment-node ${l?`comment-node-resolved`:``}`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(w0,{role:`user`,size:16})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge comment-node-badge-user`,children:`User`}),(0,G.jsxs)(`span`,{className:`comment-node-time`,style:{display:`flex`,alignItems:`center`,gap:`8px`,flexWrap:`wrap`},children:[eE(e.createdAt),S]}),l&&(0,G.jsxs)(`span`,{className:`comment-canvas-resolved-banner`,style:{marginLeft:`8px`},children:[(0,G.jsx)(LD,{size:13}),`Resolved`]}),!l&&!m&&(0,G.jsxs)(`div`,{className:`comment-node-actions`,children:[(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>h(!0),title:`Edit comment`,"aria-label":`Edit comment`,children:(0,G.jsx)(hO,{size:13,"aria-hidden":`true`})}),g?(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`4px`},children:[(0,G.jsxs)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:r,title:`Confirm delete`,style:{color:`var(--danger)`,background:`var(--feedback-danger-bg)`,fontWeight:600,fontSize:`11px`,border:`1px solid var(--feedback-danger-border)`,padding:`2px 6px`,width:`auto`,height:`auto`,display:`flex`,alignItems:`center`,gap:`2px`},children:[(0,G.jsx)(EO,{size:11}),`Delete?`]}),(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>_(!1),title:`Cancel delete`,style:{fontSize:`11px`,padding:`2px 6px`,width:`auto`,height:`auto`},children:`Cancel`})]}):(0,G.jsx)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>_(!0),title:`Delete comment`,"aria-label":`Delete comment`,children:(0,G.jsx)(TO,{size:13,"aria-hidden":`true`})})]})]}),m?(0,G.jsx)(`div`,{style:{marginTop:`8px`},children:(0,G.jsx)(nW,{draftKey:`plan-edit:${e.id}`,initialBody:e.body,lineContent:e.lineContent,onSubmit:e=>{i(e),h(!1)},onCancel:()=>h(!1)})}):(0,G.jsx)(JH,{content:e.body,className:`comment-node-body markdown-body ${l?`comment-resolved-line`:``}`})]})]}),e.replies?.length>0&&(0,G.jsx)(`div`,{className:`comment-replies`,role:`list`,"aria-label":`Replies`,children:e.replies.map((t,n)=>{let r=t.role===`agent`,i=v===t.id;return(0,G.jsxs)(`div`,{className:`comment-node ${r?`comment-node-agent`:`comment-node-user`} ${l?`comment-node-resolved`:``}`,role:`listitem`,"aria-label":`${r?`Agent`:`User`} reply ${n+1}`,children:[(0,G.jsx)(`div`,{className:`comment-avatar-col`,children:(0,G.jsx)(w0,{role:r?`agent`:`user`,size:14})}),(0,G.jsxs)(`div`,{className:`comment-content-col`,children:[(0,G.jsxs)(`div`,{className:`comment-node-header`,children:[(0,G.jsx)(`span`,{className:`comment-node-author`,children:r?`Agent`:`User`}),(0,G.jsx)(`span`,{className:`comment-node-badge ${r?`comment-node-badge-agent`:`comment-node-badge-user`}`,children:r?`Agent`:`User`}),r&&t.model&&(0,G.jsx)(`span`,{style:{fontSize:`10px`,fontWeight:600,padding:`1px 5px`,borderRadius:`4px`,background:`var(--bg-tertiary)`,color:`var(--text-secondary)`,fontFamily:`var(--font-mono)`},children:t.model}),(0,G.jsx)(`span`,{className:`comment-node-time`,children:eE(t.createdAt)}),!l&&(0,G.jsxs)(`div`,{className:`comment-node-actions`,children:[(0,G.jsx)(`button`,{className:`comment-node-btn`,onClick:()=>y(t.id),title:`Edit reply`,"aria-label":`Edit reply`,children:(0,G.jsx)(hO,{size:12,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`comment-node-btn comment-node-btn-delete`,onClick:()=>s(t.id),title:`Delete reply`,"aria-label":`Delete reply`,children:(0,G.jsx)(TO,{size:12,"aria-hidden":`true`})})]})]}),i?(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`var(--radius-md)`,border:`1px solid var(--border-color)`,marginTop:`6px`},children:(0,G.jsx)(nW,{draftKey:`plan-reply-edit:${e.id}:${t.id}`,initialBody:t.body,onSubmit:e=>{o(t.id,e),y(null)},onCancel:()=>y(null)})}):(0,G.jsx)(JH,{content:t.body,className:`comment-node-body markdown-body`})]})]},t.id)})}),(0,G.jsxs)(`div`,{className:`comment-canvas-footer`,children:[!f&&(0,G.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,G.jsxs)(`button`,{onClick:()=>p(!0),className:`comment-reply-trigger`,style:{width:`100%`,maxWidth:`320px`},children:[(0,G.jsx)(vO,{size:14,"aria-hidden":`true`}),`Reply...`]}),l?(0,G.jsxs)(`div`,{style:{display:`flex`,gap:`6px`,marginLeft:`12px`},children:[(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:()=>d(!0),style:{fontSize:`12px`,padding:`4px 10px`},children:`Hide`}),(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:n,style:{fontSize:`12px`,padding:`4px 10px`},children:`Unresolve`})]}):(0,G.jsx)(`button`,{className:`btn btn-secondary btn-sm`,onClick:t,style:{fontSize:`12px`,padding:`4px 10px`,marginLeft:`12px`},children:`Resolve`})]}),f&&(0,G.jsx)(`div`,{style:{background:`var(--bg-secondary)`,borderRadius:`var(--radius-md)`,border:`1px solid var(--border-color)`,marginTop:`4px`},children:(0,G.jsx)(nW,{draftKey:`plan-reply:${e.id}`,onSubmit:e=>{a(e),p(!1)},onCancel:()=>p(!1)})})]})]})}var E0=(0,W.memo)(function({isOpen:e,filePath:t,onClose:n}){let{data:r,isLoading:i,error:a}=z1(t),o=t?t.split(`/`).pop():``;return(0,G.jsxs)(WU,{open:e,onClose:n,className:`shortcuts-modal file-preview-modal`,ariaLabel:`File preview`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header`,children:[(0,G.jsxs)(`div`,{className:`shortcuts-header-title`,children:[(0,G.jsx)(qD,{size:18,className:`shortcuts-icon`}),(0,G.jsxs)(`h2`,{children:[`Preview: `,o]}),(0,G.jsx)(`span`,{style:{fontSize:`11px`,color:`var(--text-muted)`,marginLeft:`8px`},children:t})]}),(0,G.jsx)(`button`,{className:`shortcuts-close-btn`,onClick:n,"aria-label":`Close dialog`,children:(0,G.jsx)(AO,{size:16})})]}),(0,G.jsxs)(`div`,{className:`shortcuts-body`,style:{maxHeight:`60vh`,display:`flex`,flexDirection:`column`},children:[i&&(0,G.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`40px`,gap:`8px`,color:`var(--text-muted)`},children:[(0,G.jsx)(nO,{size:16,className:`spin`}),(0,G.jsx)(`span`,{children:`Loading file content...`})]}),a&&(0,G.jsxs)(`div`,{style:{padding:`20px`,color:`var(--danger)`,background:`var(--feedback-danger-bg)`,borderRadius:`6px`},children:[`Failed to load file: `,a.message||String(a)]}),r&&(0,G.jsx)(`div`,{style:{flex:1,overflow:`auto`,background:`var(--bg-secondary)`,borderRadius:`6px`,border:`1px solid var(--border-normal)`},children:r.binary?(0,G.jsx)(`div`,{style:{padding:`40px`,textAlign:`center`,color:`var(--text-muted)`},children:`Binary file cannot be previewed.`}):r.missing?(0,G.jsx)(`div`,{style:{padding:`40px`,textAlign:`center`,color:`var(--text-muted)`},children:`File does not exist or has been deleted.`}):(0,G.jsx)(`pre`,{style:{margin:0,padding:`16px`,fontFamily:`var(--font-mono)`,fontSize:`13px`,lineHeight:`1.6`,overflowX:`auto`,whiteSpace:`pre-wrap`,wordBreak:`break-all`},children:(0,G.jsx)(`code`,{children:r.content})})})]}),(0,G.jsx)(`div`,{className:`shortcuts-footer`,style:{justifyContent:`flex-end`},children:(0,G.jsx)(`button`,{className:`btn btn-sm btn-primary`,onClick:n,children:`Close Preview`})})]})}),D0={pending:{label:`Pending review`,className:`plan-badge-pending`,icon:VD},approved:{label:`Approved`,className:`plan-badge-approved`,icon:jD},"changes-requested":{label:`Changes requested`,className:`plan-badge-changes`,icon:sO},rejected:{label:`Rejected`,className:`plan-badge-rejected`,icon:AO},"comment-only":{label:`Comment only`,className:`plan-badge-comment-only`,icon:cO}};function O0({plan:e,theme:t,fontSize:n,monoFontFamily:r,defaultTabSize:i,lineWrap:a,showLineNumbers:o,lineHoverHighlight:s,viewMode:c}){let{addPlanComment:l,editPlanComment:u,resolvePlanComment:d,unresolvePlanComment:f,removePlanComment:p,addPlanReply:m,editPlanReply:h,removePlanReply:g,submitDecision:_,submitting:v,agentWaiting:y}=wE(),[b,x]=(0,W.useState)(null),[S,C]=(0,W.useState)(null),[w,T]=(0,W.useState)(0),[E,D]=(0,W.useState)(null),O=e.versions??[],[k,A]=(0,W.useState)(e.version),[j,M]=(0,W.useState)(e.body),[N,P]=(0,W.useState)(e.title),F=(0,W.useRef)(e.version);(0,W.useEffect)(()=>{let t=k===F.current;e.version!==F.current&&t&&A(e.version),F.current=e.version},[e.version,k]),(0,W.useEffect)(()=>{let t=!1;if(k===e.version){M(e.body),P(e.title);return}let n=O.find(e=>e.version===k);if(n){M(n.body),P(n.title);return}return fetch(`/api/plans/${e.id}/versions/${k}`).then(e=>e.ok?e.json():null).then(e=>{t||!e?.version||(M(e.version.body),P(e.version.title))}).catch(()=>{}),()=>{t=!0}},[k,e.version,e.body,e.title,e.id,O]),(0,W.useEffect)(()=>{C(null),T(0),x(null)},[k]);let I=k!==e.version,L=(0,W.useMemo)(()=>O.map(t=>({value:String(t.version),label:t.version===e.version?`v${t.version} (current)`:`v${t.version}`})),[O,e.version]),R=e=>{let t=e.target.closest(`a`);if(t){let n=t.getAttribute(`href`);n&&n.startsWith(`file:///`)&&(e.preventDefault(),D(n.replace(`file://`,``)))}},z=nE[t]||nE.nord,ee=(0,W.useMemo)(()=>k0(i,n,r),[i,n,r]),te=e.comments??[],B=I?te.filter(e=>e.createdAtPlanVersion===k):te,V=B.filter(e=>e.lineNumber>0),H=B.filter(e=>e.lineNumber===0);B.filter(e=>e.status===`open`).length;let ne=te.length,re=(e,t)=>C0(j,e??t,t),ie=(t,n)=>{l({planId:e.id,lineNumber:t.lineNumber,startLineNumber:t.startLineNumber,lineContent:re(t.startLineNumber,t.lineNumber),sectionTitle:S0(j,t.startLineNumber??t.lineNumber),body:n,createdAtPlanVersion:k}),x(null),C(null)},ae=(0,W.useMemo)(()=>{let e=V.map(e=>({lineNumber:e.lineNumber,metadata:e}));return b&&e.push({lineNumber:b.lineNumber,metadata:{_pending:!0}}),e},[V,b]),oe=t=>{let n=t.metadata;if(!n)return null;if(`_pending`in n){let t=b;return(0,G.jsx)(nW,{draftKey:`plan-new:${e.id}:${t.startLineNumber??t.lineNumber}:${t.lineNumber}`,lineContent:re(t.startLineNumber,t.lineNumber),onSubmit:e=>ie(t,e),onCancel:()=>{x(null),C(null)}})}let r=n;return(0,G.jsx)(T0,{comment:r,onResolve:()=>d(e.id,r.id),onUnresolve:()=>f(e.id,r.id),onDelete:()=>p(e.id,r.id),onEdit:t=>u(e.id,r.id,t),onReply:t=>m(e.id,r.id,t),onEditReply:(t,n)=>h(e.id,r.id,t,n),onDeleteReply:t=>g(e.id,r.id,t)})},se=D0[e.decision],ce=se.icon;return(0,G.jsxs)(`div`,{className:`plan-review`,children:[(0,G.jsx)(`div`,{className:`plan-review-head`,children:(0,G.jsxs)(`div`,{className:`plan-review-head-main`,children:[(0,G.jsxs)(`h2`,{className:`plan-review-title`,title:N,children:[N,I&&N!==e.title&&(0,G.jsxs)(`span`,{className:`plan-review-title-historical`,title:`Currently submitted title: ${e.title}`,children:[` `,`(current: `,e.title,`)`]})]}),(0,G.jsxs)(`div`,{className:`plan-review-meta`,children:[(0,G.jsxs)(`span`,{className:`plan-badge ${se.className}`,children:[(0,G.jsx)(ce,{size:12,"aria-hidden":`true`}),se.label]}),(0,G.jsxs)(`span`,{className:`plan-review-chip`,children:[`v`,k,O.length>1?` / ${O.length}`:``]}),O.length>1&&(0,G.jsxs)(`div`,{className:`plan-review-version-switcher`,children:[(0,G.jsx)($D,{size:12,"aria-hidden":`true`,className:`plan-review-version-switcher-icon`}),(0,G.jsx)(NA,{value:String(k),onValueChange:e=>A(Number(e)),options:L,ariaLabel:`Plan version`}),I&&(0,G.jsxs)(`button`,{type:`button`,className:`plan-review-version-back`,onClick:()=>A(e.version),title:`Back to current v${e.version}`,children:[(0,G.jsx)(kD,{size:11,"aria-hidden":`true`}),`Back to v`,e.version]}),I&&(0,G.jsx)(`span`,{className:`plan-review-version-current-dot`,title:`This is v${k} of ${e.version}`,"aria-label":`Viewing historical version ${k}`})]}),e.source&&(0,G.jsx)(`span`,{className:`plan-review-chip`,children:e.source}),e.model&&(0,G.jsxs)(`span`,{className:`plan-review-chip plan-review-chip-model`,children:[(0,G.jsx)(AD,{size:11,"aria-hidden":`true`}),e.model]}),V.length+H.length>0&&(0,G.jsxs)(`span`,{className:`plan-review-chip`,children:[B.length,` comment`,B.length===1?``:`s`,I&&ne!==B.length&&(0,G.jsxs)(`span`,{className:`plan-review-chip-sub`,children:[` of `,ne]})]}),w>0&&(0,G.jsxs)(`span`,{className:`plan-review-chip plan-review-chip-selection`,"aria-live":`polite`,children:[w,` line`,w===1?``:`s`,` selected`]})]})]})}),I&&(0,G.jsxs)(`div`,{className:`plan-review-historical-banner`,role:`status`,children:[(0,G.jsx)($D,{size:14,"aria-hidden":`true`}),(0,G.jsxs)(`span`,{children:[`Viewing `,(0,G.jsxs)(`strong`,{children:[`v`,k]}),` of this plan (current is `,(0,G.jsxs)(`strong`,{children:[`v`,e.version]}),`).`,` `,`Comments and line anchors reflect v`,k,`.`]}),(0,G.jsxs)(`button`,{type:`button`,className:`plan-review-historical-banner-back`,onClick:()=>A(e.version),children:[(0,G.jsx)(kD,{size:11,"aria-hidden":`true`}),`Back to current`]})]}),e.decision!==`pending`&&(0,G.jsxs)(`div`,{className:`plan-decision-banner ${se.className}`,children:[(0,G.jsx)(ce,{size:15,"aria-hidden":`true`}),(0,G.jsxs)(`div`,{className:`plan-decision-banner-text`,children:[(0,G.jsx)(`strong`,{children:se.label}),e.decisionComment&&(0,G.jsx)(JH,{content:e.decisionComment,className:`plan-decision-banner-note markdown-body`})]})]}),H.length>0&&(0,G.jsxs)(`div`,{className:`plan-general-section`,children:[(0,G.jsxs)(`div`,{className:`plan-general-header`,children:[(0,G.jsx)(oO,{size:14}),(0,G.jsxs)(`span`,{children:[`General comments (`,H.length,`)`]})]}),H.map(t=>(0,G.jsx)(T0,{comment:t,onResolve:()=>d(e.id,t.id),onUnresolve:()=>f(e.id,t.id),onDelete:()=>p(e.id,t.id),onEdit:n=>u(e.id,t.id,n),onReply:n=>m(e.id,t.id,n),onEditReply:(n,r)=>h(e.id,t.id,n,r),onDeleteReply:n=>g(e.id,t.id,n)},t.id))]}),c===`rendered`?(0,G.jsx)(`div`,{className:`markdown-body plan-rendered`,onClick:R,children:(0,G.jsx)(JH,{content:j})}):(0,G.jsx)(`div`,{className:`plan-file`,children:(0,G.jsx)(Bh,{file:{name:`PLAN.md`,contents:j,lang:`markdown`},options:{disableFileHeader:!0,enableGutterUtility:!0,enableLineSelection:!0,overflow:a?`wrap`:`scroll`,disableLineNumbers:!o,lineHoverHighlight:s,onLineSelectionStart:()=>{C(null),T(0)},onLineSelectionChange:e=>{T(e?Math.abs(e.end-e.start)+1:0)},onLineSelectionEnd:e=>{T(0),e&&(C(e),x({lineNumber:e.end,startLineNumber:e.start}))},theme:{dark:z.type===`dark`?z.themeName:`nord`,light:z.type===`light`?z.themeName:`github-light`},themeType:z.type,unsafeCSS:ee},selectedLines:S,lineAnnotations:ae,renderAnnotation:oe,renderGutterUtility:e=>(0,G.jsx)(`button`,{className:`gutter-add-btn`,onClick:()=>{let t=e();t&&x({lineNumber:t.lineNumber})},children:`+`})})}),(0,G.jsx)(E0,{isOpen:!!E,filePath:E,onClose:()=>D(null)})]})}function k0(e,t,n){return`
|
|
3865
3865
|
:host {
|
|
3866
3866
|
--diffs-tab-size: ${e} !important;
|
|
3867
3867
|
--diffs-font-family: ${n} !important;
|
|
@@ -3914,9 +3914,9 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
|
|
|
3914
3914
|
overflow-wrap: break-word !important;
|
|
3915
3915
|
min-width: 0 !important;
|
|
3916
3916
|
}
|
|
3917
|
-
`}var b0={pending:{icon:VD,className:`plan-badge-pending`,label:`Pending`},approved:{icon:jD,className:`plan-badge-approved`,label:`Approved`},"changes-requested":{icon:sO,className:`plan-badge-changes`,label:`Changes`},rejected:{icon:AO,className:`plan-badge-rejected`,label:`Rejected`},"comment-only":{icon:cO,className:`plan-badge-comment-only`,label:`Comment only`}};function x0({plans:e,activeId:t,onSelect:n,onDelete:r,collapsed:i,onToggleCollapse:a}){let[o,s]=(0,W.useState)(``),c=(0,W.useMemo)(()=>[...e].sort((e,t)=>t.createdAt-e.createdAt),[e]),l=(0,W.useMemo)(()=>c.filter(e=>e.title.toLowerCase().includes(o.toLowerCase())),[c,o]);return i?(0,G.jsx)(`div`,{className:`ft`,children:(0,G.jsx)(`div`,{className:`ft-search`,children:a&&(0,G.jsx)($T,{content:`Expand sidebar`,side:`right`,children:(0,G.jsx)(`button`,{className:`sidebar-toggle`,onClick:a,"aria-label":`Expand sidebar`,children:(0,G.jsx)(pO,{size:16})})})})}):(0,G.jsxs)(`div`,{className:`ft`,style:{display:`flex`,flexDirection:`column`,height:`100%`},children:[(0,G.jsxs)(`div`,{className:`ft-search`,children:[a&&(0,G.jsx)($T,{content:`Collapse sidebar`,side:`right`,children:(0,G.jsx)(`button`,{className:`sidebar-toggle`,onClick:a,"aria-label":`Collapse sidebar`,children:(0,G.jsx)(fO,{size:16})})}),(0,G.jsxs)(`div`,{className:`ft-search-wrapper`,children:[(0,G.jsx)(xO,{size:14,className:`ft-search-icon`}),(0,G.jsx)(`input`,{type:`text`,placeholder:`Filter plans...`,value:o,onChange:e=>s(e.target.value),className:`ft-search-input`})]})]}),(0,G.jsxs)(`div`,{className:`plan-list-scroll`,style:{flex:1,minHeight:0,overflow:`auto`},children:[(0,G.jsxs)(`div`,{className:`plan-list-header`,children:[`Plans (`,l.length,`)`]}),l.length===0&&(0,G.jsx)(`div`,{className:`plan-list-empty`,children:o?`No matching plans found.`:`No plans submitted yet.`}),l.map(e=>{let i=b0[e.decision],a=i.icon,o=(e.comments??[]).filter(e=>e.status===`open`).length;return(0,G.jsxs)(`div`,{className:`plan-list-item ${e.id===t?`plan-list-item-active`:``}`,onClick:()=>n(e.id),role:`button`,tabIndex:0,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n(e.id))},children:[(0,G.jsxs)(`div`,{className:`plan-list-item-top`,children:[(0,G.jsx)(`span`,{className:`plan-badge plan-badge-dot ${i.className}`,title:i.label,children:(0,G.jsx)(a,{size:11,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`plan-list-item-title`,title:e.title,children:e.title}),(0,G.jsx)(`button`,{className:`plan-list-delete`,title:`Delete plan`,onClick:t=>{t.stopPropagation(),r(e.id)},children:(0,G.jsx)(TO,{size:12,"aria-hidden":`true`})})]}),(0,G.jsxs)(`div`,{className:`plan-list-item-sub`,children:[(0,G.jsxs)(`span`,{children:[`v`,e.version]}),o>0&&(0,G.jsxs)(`span`,{children:[`· `,o,` open`]}),e.model&&(0,G.jsxs)(`span`,{className:`plan-list-item-model`,children:[`· `,(0,G.jsx)(AD,{size:10,"aria-hidden":`true`}),` `,e.model]}),(0,G.jsxs)(`span`,{className:`plan-list-item-time`,children:[`· `,eE(e.createdAt)]})]})]},e.id)})]})]})}var S0=[{value:`approved`,label:`Approve`,description:`The plan looks good — the agent should proceed.`,icon:jD,className:`plan-verdict-approve`},{value:`changes-requested`,label:`Request changes`,description:`The agent should revise the plan and resubmit it.`,icon:sO,className:`plan-verdict-changes`},{value:`rejected`,label:`Reject`,description:`Don't proceed — the approach needs rethinking.`,icon:AO,className:`plan-verdict-reject`},{value:`comment-only`,label:`Comment only`,description:`Agent must NOT edit files — only reply to comments. General note goes to chat.`,icon:cO,className:`plan-verdict-comment-only`}];function C0({openCommentCount:e,onSubmit:t,submitting:n,agentWaiting:r,currentDecision:i}){let{haptic:a,sound:o}=lD(),[s,c]=(0,W.useState)(!1),[l,u]=(0,W.useState)(null),[d,f]=(0,W.useState)(``),p=async()=>{l&&(a(`heavy`),o(`send`),await t(l,d,l===`comment-only`?`comment-only`:`standard`),f(``),u(null),c(!1))},m=i!==`pending`;return(0,G.jsx)(bk,{open:s,onOpenChange:c,ariaLabel:`Submit plan review`,className:`submit-plan-review-popover`,trigger:(0,G.jsxs)(`button`,{className:`btn btn-primary btn-sm send-review-btn`,disabled:n,title:r?`An agent is connected and waiting for your verdict`:`Submit your verdict on this plan`,style:{display:`inline-flex`,alignItems:`center`,gap:`6px`},children:[r&&(0,G.jsx)(`span`,{className:`agent-waiting-dot`,"aria-hidden":`true`}),m?(0,G.jsx)(_O,{size:14}):(0,G.jsx)(zD,{size:14}),(0,G.jsx)(`span`,{className:`btn-label`,children:n?`Submitting…`:m?`Update review`:`Submit review`})]}),children:(0,G.jsxs)(`div`,{className:`srp`,children:[(0,G.jsxs)(`div`,{className:`srp-head`,children:[m?(0,G.jsx)(_O,{size:15,"aria-hidden":`true`}):(0,G.jsx)(zD,{size:15,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`srp-title`,children:m?`Update plan review`:`Submit plan review`}),e>0&&(0,G.jsxs)(`span`,{className:`srp-count`,children:[e,` open comment`,e===1?``:`s`]})]}),(0,G.jsx)(`div`,{className:`plan-verdict-options`,role:`radiogroup`,"aria-label":`Verdict`,children:S0.map(e=>{let t=e.icon,n=l===e.value;return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":n,className:`plan-verdict-option ${e.className} ${n?`plan-verdict-option-selected`:``}`,onClick:()=>u(e.value),children:[(0,G.jsx)(`span`,{className:`plan-verdict-icon`,children:(0,G.jsx)(t,{size:15,"aria-hidden":`true`})}),(0,G.jsxs)(`span`,{className:`plan-verdict-text`,children:[(0,G.jsx)(`span`,{className:`plan-verdict-label`,children:e.label}),(0,G.jsx)(`span`,{className:`plan-verdict-desc`,children:e.description})]}),(0,G.jsx)(`span`,{className:`plan-verdict-radio`,"aria-hidden":`true`})]},e.value)})}),(0,G.jsxs)(`div`,{className:`srp-general`,children:[(0,G.jsxs)(`label`,{className:`srp-general-label`,htmlFor:`plan-decision-comment`,children:[`Overall comment `,(0,G.jsx)(`span`,{className:`srp-optional`,children:`(optional · Markdown)`})]}),(0,G.jsx)(rU,{id:`plan-decision-comment`,value:d,onChange:f,textareaClassName:`srp-general-input`,placeholder:`Add an overall note for the agent that applies to the whole plan…`,rows:3,ariaLabel:`Overall plan review comment`,onSubmitShortcut:p})]}),(0,G.jsxs)(`div`,{className:`srp-footer`,children:[(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>c(!1),disabled:n,children:`Cancel`}),(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:p,disabled:!l||n,children:n?`Submitting…`:`Submit review`})]})]})})}var w0=[11,12,13,14,15,16].map(e=>({value:String(e),label:`${e}px`})),T0=[2,4,8].map(e=>({value:String(e),label:String(e)})),E0=[{value:`both`,label:`Both`},{value:`line`,label:`Line only`},{value:`number`,label:`Number only`},{value:`disabled`,label:`Disabled`}];function D0(){let e=Am(),{settings:t,loaded:n,updateSettings:r}=IE();LE(n,t.uiFont,t.monoFont);let{plans:i,getPlan:a,removePlan:o,agentActivity:s,clearAgentActivity:c,submitDecision:l,submitting:u,agentWaiting:d,isLoading:f}=wE(),p=jE(),[m,h]=(0,W.useState)(!1),[g,_]=(0,W.useState)(!1),[v,y]=(0,W.useState)(!1);(0,W.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&(e.key===`,`||e.code===`Comma`)&&(e.preventDefault(),_(e=>!e))};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[]);let[b,x]=(0,W.useState)(()=>{try{return fD(`diffing-plan-view-mode`)===`rendered`?`rendered`:`source`}catch{return`source`}}),S=(0,W.useCallback)(e=>{x(e);try{gD(`diffing-plan-view-mode`,e)}catch{}},[]),C=(0,W.useMemo)(()=>{let e=/^\/plan\/([^/]+)/.exec(p);return e?decodeURIComponent(e[1]):null},[p]),w=(0,W.useMemo)(()=>C?a(C):i.length===0?null:[...i].reverse().find(e=>e.decision===`pending`)??i[i.length-1],[C,i,a]),T=(0,W.useMemo)(()=>nE[t.theme||`nord`]||nE.nord,[t.theme]);(0,W.useEffect)(()=>{let e=t.theme||`nord`,n=document.documentElement;n.classList.add(`theme-switching`),n.setAttribute(`data-theme`,e);let r=requestAnimationFrame(()=>{requestAnimationFrame(()=>n.classList.remove(`theme-switching`))});return()=>cancelAnimationFrame(r)},[t.theme]),(0,W.useEffect)(()=>{e&&e.setRenderOptions({theme:{dark:T.type===`dark`?T.themeName:`nord`,light:T.type===`light`?T.themeName:`github-light`}}).catch(e=>console.error(`Failed to set worker pool render options:`,e))},[e,T]),(0,W.useEffect)(()=>{let e=T.type===`dark`?T.themeName:`nord`,t=T.type===`light`?T.themeName:`github-light`;Uf({themes:Array.from(new Set([e,t])),langs:[]}).catch(()=>{})},[T]);let[E,D]=(0,W.useState)(()=>{try{let e=fD(`diffing-sidebar-collapsed`);if(e!=null)return e===`true`}catch{}return typeof window<`u`&&window.innerWidth<=768}),[O,k]=(0,W.useState)(()=>{try{let e=fD(`diffing-sidebar-width`);return e?Number(e):320}catch{return 320}});(0,W.useEffect)(()=>{try{gD(`diffing-sidebar-collapsed`,String(E))}catch{}},[E]);let A=(0,W.useRef)(O);A.current=O;let j=(0,W.useRef)(null),M=(0,W.useRef)(null),N=(0,W.useRef)(null),P=(0,W.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=A.current,r=M.current,i=N.current,a=r?r.getBoundingClientRect().left:0,o=n,s=0,c=()=>{s=0,i&&(i.style.transform=`translateX(${a+o}px)`)};i&&(i.style.transform=`translateX(${a+n}px)`,i.classList.add(`sidebar-resize-guide-active`));let l=e=>{let r=e.clientX-t;o=Math.max(240,Math.min(640,n+r)),s||=requestAnimationFrame(c)},u=()=>{s&&cancelAnimationFrame(s),i&&i.classList.remove(`sidebar-resize-guide-active`),k(o);try{gD(`diffing-sidebar-width`,String(o))}catch{}document.removeEventListener(`mousemove`,l),document.removeEventListener(`mouseup`,u),document.body.style.cursor=``,document.body.style.userSelect=``};document.addEventListener(`mousemove`,l),document.addEventListener(`mouseup`,u),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},[]),F=(0,W.useCallback)(()=>{D(e=>!e)},[]),I=(0,W.useCallback)(()=>{r({lineWrap:!t.lineWrap})},[t.lineWrap,r]),L=(0,W.useCallback)(()=>{r({showLineNumbers:!t.showLineNumbers})},[t.showLineNumbers,r]),R=(0,W.useCallback)(()=>{S(b===`source`?`rendered`:`source`)},[b,S]),z=(0,W.useCallback)(()=>{let e=[2,4,8],n=t.defaultTabSize||4;r({defaultTabSize:e[(e.indexOf(n)+1)%e.length]})},[t.defaultTabSize,r]),ee=(0,W.useCallback)(e=>{if(i.length===0)return;let t=[...i].sort((e,t)=>t.createdAt-e.createdAt),n=0;if(w){let r=t.findIndex(e=>e.id===w.id);r!==-1&&(n=e===`next`?Math.min(r+1,t.length-1):Math.max(r-1,0))}let r=t[n];DE(`/plan/${r.id}`)},[i,w]);(0,W.useEffect)(()=>{let e=``,t,n=0,r=r=>{let i=document.activeElement;if(i){let e=i.tagName.toLowerCase();if(e===`input`||e===`textarea`||i.hasAttribute(`contenteditable`))return}clearTimeout(t);let a=r.key;if(r.ctrlKey){a===`d`?(r.preventDefault(),window.scrollBy({top:window.innerHeight/2,behavior:`auto`}),sD(`selection`,`navigate`),e=``):a===`u`&&(r.preventDefault(),window.scrollBy({top:-window.innerHeight/2,behavior:`auto`}),sD(`selection`,`navigate`),e=``);return}if(!(a.length>1&&a!==`Escape`&&a!==`Enter`))if(e+=a,t=setTimeout(()=>{e=``},800),e===`j`){r.preventDefault(),window.scrollBy({top:100,behavior:`auto`});let t=Date.now();t-n>80&&(aD(`navigate`),n=t),e=``}else if(e===`k`){r.preventDefault(),window.scrollBy({top:-100,behavior:`auto`});let t=Date.now();t-n>80&&(aD(`navigate`),n=t),e=``}else e===`gg`?(r.preventDefault(),window.scrollTo({top:0,behavior:`auto`}),sD(`selection`,`navigate`),e=``):e===`G`?(r.preventDefault(),window.scrollTo({top:document.documentElement.scrollHeight,behavior:`auto`}),sD(`selection`,`navigate`),e=``):e===`J`?(r.preventDefault(),ee(`next`),sD(`selection`,`navigate`),e=``):e===`K`?(r.preventDefault(),ee(`prev`),sD(`selection`,`navigate`),e=``):e===`m`?(r.preventDefault(),R(),sD(`selection`,`toggle`),e=``):e===`t`?(r.preventDefault(),z(),sD(`selection`,`toggle`),e=``):e===`b`?(r.preventDefault(),F(),sD(`selection`,`toggle`),e=``):e===`w`?(r.preventDefault(),I(),sD(`selection`,`toggle`),e=``):e===`n`?(r.preventDefault(),L(),sD(`selection`,`toggle`),e=``):e===`gt`?(r.preventDefault(),h(!0),sD(`medium`,`open`),e=``):e===`?`?(r.preventDefault(),y(!0),sD(`medium`,`open`),e=``):e.length>=2&&(e=``)};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r)}},[F,I,L,R,z,ee]);let te=(0,W.useMemo)(()=>w?(w.comments??[]).filter(e=>e.status===`open`).length:0,[w]);return f||!n?(0,G.jsxs)(`div`,{className:`app plan-app skeleton-app`,style:{"--sidebar-width":`${O}px`},children:[(0,G.jsxs)(`header`,{className:`skeleton-toolbar`,children:[(0,G.jsx)(`div`,{className:`skeleton-item skeleton-logo`,style:{width:`140px`}}),(0,G.jsx)(`div`,{className:`skeleton-item skeleton-stats`,style:{width:`80px`,marginLeft:`20px`}}),(0,G.jsx)(`div`,{className:`skeleton-item skeleton-actions`,style:{width:`220px`}})]}),(0,G.jsxs)(`div`,{className:`app-body`,children:[(0,G.jsx)(`aside`,{className:`sidebar plan-sidebar skeleton-sidebar ${E?`sidebar-collapsed`:``}`,children:!E&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`skeleton-search`,style:{height:`32px`,margin:`0 16px 16px 16px`}}),(0,G.jsx)(`div`,{className:`skeleton-tree-nodes`,children:Array.from({length:4}).map((e,t)=>(0,G.jsxs)(`div`,{className:`skeleton-tree-node`,style:{paddingLeft:`16px`,height:`40px`,borderBottom:`1px solid var(--border-weak)`},children:[(0,G.jsx)(`div`,{className:`skeleton-node-icon`,style:{width:`20px`,height:`20px`,borderRadius:`50%`}}),(0,G.jsx)(`div`,{className:`skeleton-node-text`,style:{width:`${80+t*30%90}px`,height:`14px`}})]},t))})]})}),!E&&(0,G.jsx)(`div`,{className:`sidebar-resize-handle`,style:{cursor:`default`}}),(0,G.jsx)(`main`,{className:`main plan-main skeleton-main`,children:(0,G.jsxs)(`div`,{className:`file-diff-card skeleton-card`,style:{border:`1px solid var(--border-color)`,borderRadius:`8px`},children:[(0,G.jsxs)(`div`,{className:`skeleton-card-header`,style:{padding:`16px 20px`},children:[(0,G.jsx)(`div`,{className:`skeleton-card-title`,style:{width:`250px`,height:`20px`}}),(0,G.jsx)(`div`,{className:`skeleton-card-badge`,style:{width:`100px`,height:`24px`}})]}),(0,G.jsxs)(`div`,{className:`skeleton-card-body`,style:{padding:`24px`,background:`var(--bg-secondary)`,display:`flex`,flexDirection:`column`,gap:`16px`},children:[(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`90%`,height:`16px`}}),(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`75%`,height:`16px`}}),(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`85%`,height:`16px`}}),(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`40%`,height:`16px`}}),(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`60%`,height:`16px`}}),(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`80%`,height:`16px`}})]})]})})]})]}):(0,G.jsx)(cD,{enabled:t.haptics??!0,soundsEnabled:t.sounds??!0,children:(0,G.jsxs)(`div`,{className:`app plan-app`,ref:j,style:{"--sidebar-width":`${O}px`},children:[(0,G.jsx)(`div`,{className:`sidebar-resize-guide`,ref:N,"aria-hidden":`true`}),(0,G.jsxs)(`div`,{className:`toolbar plan-app-toolbar`,children:[(0,G.jsxs)(`div`,{className:`toolbar-left`,children:[(0,G.jsx)(`button`,{className:`toolbar-mobile-toggle`,onClick:()=>D(!E),"aria-label":`Toggle sidebar`,title:E?`Open sidebar`:`Close sidebar`,children:(0,G.jsx)(iO,{size:18})}),(0,G.jsxs)(`button`,{className:`btn btn-sm`,onClick:()=>DE(`/`),title:`Back to the diff review`,children:[(0,G.jsx)(kD,{size:14,style:{marginRight:`6px`}}),(0,G.jsx)(`span`,{className:`btn-label`,children:`Diff`})]}),(0,G.jsxs)(`h1`,{className:`toolbar-title plan-app-title`,children:[(0,G.jsx)(BD,{size:16,style:{marginRight:`6px`}}),`Plan review`]}),(0,G.jsxs)(`span`,{className:`toolbar-stat`,children:[i.length,` plan`,i.length===1?``:`s`]})]}),(0,G.jsxs)(`div`,{className:`toolbar-right`,children:[(0,G.jsx)(bk,{open:g,onOpenChange:_,ariaLabel:`Settings`,className:`settings-popover`,trigger:(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn ${g?`btn-active`:``}`,title:`Settings`,children:[(0,G.jsx)(SO,{size:14}),` `,(0,G.jsx)(`span`,{className:`btn-label`,children:`Settings`})]}),children:(0,G.jsxs)(`div`,{className:`popover-scroll settings-panel`,children:[(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Review Options`}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`View mode`}),(0,G.jsx)(NA,{value:b,onValueChange:e=>S(e),options:[{value:`source`,label:`Source (commentable)`},{value:`rendered`,label:`Rendered (markdown)`}],ariaLabel:`Plan view mode`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Theme`}),(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn`,onClick:()=>{_(!1),h(!0)},style:{display:`inline-flex`,alignItems:`center`},children:[(0,G.jsx)(dO,{size:14,style:{marginRight:`4px`}}),(0,G.jsx)(`span`,{children:`Switch Theme...`})]})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Display`}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:t.lineWrap,onChange:e=>r({lineWrap:e.target.checked})}),`Wrap long lines`]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:t.showLineNumbers,onChange:e=>r({showLineNumbers:e.target.checked})}),`Show line numbers`]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Hover highlight`}),(0,G.jsx)(NA,{value:t.lineHoverHighlight,onValueChange:e=>r({lineHoverHighlight:e}),options:E0,ariaLabel:`Hover highlight`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Font size`}),(0,G.jsx)(NA,{value:String(t.fontSize),onValueChange:e=>r({fontSize:Number(e)}),options:w0,ariaLabel:`Font size`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Default tab size`}),(0,G.jsx)(NA,{value:String(t.defaultTabSize),onValueChange:e=>r({defaultTabSize:Number(e)}),options:T0,ariaLabel:`Default tab size`})]})]})}),w&&(0,G.jsx)(C0,{openCommentCount:te,onSubmit:(e,t)=>l(w.id,e,t),submitting:u,agentWaiting:d,currentDecision:w.decision})]})]}),!E&&(0,G.jsx)(`div`,{className:`sidebar-mobile-backdrop`,onClick:()=>D(!0),"aria-hidden":`true`}),(0,G.jsxs)(`div`,{className:`app-body`,children:[(0,G.jsx)(`aside`,{ref:M,className:`sidebar plan-sidebar ${E?`sidebar-collapsed`:``}`,children:(0,G.jsx)(`div`,{style:{flex:1,minHeight:0,overflow:`hidden`},children:(0,G.jsx)(x0,{plans:i,activeId:w?.id??null,onSelect:e=>DE(`/plan/${e}`),onDelete:e=>{o(e),w?.id===e&&DE(`/plan`)},collapsed:E,onToggleCollapse:()=>D(!E)})})}),!E&&(0,G.jsx)(`div`,{className:`sidebar-resize-handle`,onMouseDown:P,role:`separator`,"aria-label":`Resize sidebar`,"aria-orientation":`vertical`,tabIndex:0}),(0,G.jsx)(`main`,{className:`main plan-main`,children:w?(0,G.jsx)(v0,{plan:w,theme:t.theme||`nord`,fontSize:t.fontSize,monoFontFamily:FE(t.monoFont),defaultTabSize:t.defaultTabSize,lineWrap:t.lineWrap,showLineNumbers:t.showLineNumbers,lineHoverHighlight:t.lineHoverHighlight,viewMode:b},w.id):(0,G.jsx)(O0,{hasPlans:i.length>0,notFound:!!C})})]}),(0,G.jsx)(s0,{open:m,activeTheme:t.theme||`nord`,onThemeChange:e=>r({theme:e}),onClose:()=>h(!1)}),(0,G.jsx)(a0,{activity:s?{at:s.at,commentId:s.commentId,filePath:`plan comment`,model:s.model,body:s.body}:null,onDismiss:c,onJump:()=>{s&&DE(`/plan/${s.planId}`)}}),(0,G.jsx)(r0,{activeFile:w?w.title:null,onShowHelp:()=>y(!0),placeholder:`No active plan (J/K to jump)`}),(0,G.jsx)(i0,{isOpen:v,onClose:()=>y(!1),mode:`plan`})]})})}function O0({hasPlans:e,notFound:t}){return(0,G.jsxs)(`div`,{className:`plan-empty-state`,children:[(0,G.jsx)(BD,{size:40,style:{opacity:.4}}),t?(0,G.jsx)(`p`,{children:`That plan no longer exists. Pick one from the list, or submit a new plan.`}):e?(0,G.jsx)(`p`,{children:`Select a plan from the list to review it.`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{children:`No plans have been submitted for review yet.`}),(0,G.jsxs)(`p`,{className:`plan-empty-hint`,children:[`An agent can submit one with`,` `,(0,G.jsx)(`code`,{children:`diffing plan submit PLAN.md`}),` (or the `,(0,G.jsx)(`code`,{children:`submit_plan`}),` MCP tool), then block on`,` `,(0,G.jsx)(`code`,{children:`diffing plan await`}),` until you approve, reject, or request changes here.`]})]})]})}var k0=[`pr-session`];function A0(){let e=Ve(),{data:t,isLoading:n,error:r}=nt({queryKey:k0,queryFn:async()=>{let e=await fetch(`/api/gh/session`);if(e.status===404)return null;if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()},retry:!1});return(0,W.useEffect)(()=>fE(`pr-session`,()=>{e.invalidateQueries({queryKey:k0})}),[e]),{session:t,loaded:!n,error:r}}var j0=[`pr-comments`];function M0(e){let t=Ve(),{data:n=[]}=nt({queryKey:j0,queryFn:async()=>{let e=await fetch(`/api/gh/pr-session/comments`);if(e.status===404)return[];if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()},enabled:e});(0,W.useEffect)(()=>fE(`pr-session`,()=>{t.invalidateQueries({queryKey:j0})}),[t]);let r=rt({mutationFn:async e=>(await fetch(`/api/gh/pr-session/comments`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})).json(),onSuccess:e=>{t.setQueryData(j0,(t=[])=>[...t,e])}}),i=rt({mutationFn:async e=>(await fetch(`/api/gh/pr-session/comments/${e}`,{method:`DELETE`}),e),onSuccess:e=>{t.setQueryData(j0,(t=[])=>t.filter(t=>t.id!==e))}}),a=rt({mutationFn:async({id:e,body:t,status:n})=>(await fetch(`/api/gh/pr-session/comments/${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:t,status:n})})).json(),onSuccess:e=>{t.setQueryData(j0,(t=[])=>t.map(t=>t.id===e.id?e:t))}}),o=rt({mutationFn:async({id:e,body:t})=>(await fetch(`/api/gh/pr-session/comments/${e}/replies`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:t,role:`user`})})).json(),onSuccess:e=>{t.setQueryData(j0,(t=[])=>t.map(t=>t.id===e.id?e:t))}});return{comments:n,addComment:r.mutate,removeComment:i.mutate,updateComment:a.mutate,addReply:o.mutate}}function N0(){return rt({mutationFn:async e=>{let t=await fetch(`/api/gh/submit`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({decision:e.decision,body:e.body,dryRun:e.dryRun})}),n=await t.json();if(!t.ok)throw Error(n.error||`HTTP ${t.status}`);return n}})}function P0(){let e=Ve();return rt({mutationFn:async()=>{let e=await fetch(`/api/gh/pr/refresh`,{method:`POST`}),t=await e.json();if(!e.ok)throw Error(t.error||`HTTP ${e.status}`);return t},onSuccess:()=>{e.invalidateQueries({queryKey:k0})}})}function F0({session:e,comments:t,onEditComment:n,onDeleteComment:r}){let{haptic:i,sound:a}=lD(),o=N0(),[s,c]=(0,W.useState)(!1),[l,u]=(0,W.useState)(null),[d,f]=(0,W.useState)(``),p=t.length,m=(0,W.useMemo)(()=>[...t].sort((e,t)=>e.createdAt-t.createdAt),[t]),h=!!e.submittedAt,g=async()=>{if(l){i(`heavy`),a(`send`);try{await o.mutateAsync({decision:l,body:d}),f(``),u(null),c(!1)}catch{}}};return(0,G.jsx)(bk,{open:s,onOpenChange:c,ariaLabel:`Submit your review to GitHub`,className:`srp`,trigger:(0,G.jsxs)(`button`,{className:`btn btn-primary btn-sm send-review-btn`,disabled:o.isPending,title:h?`Already submitted`:`Submit your review to the PR on GitHub`,style:{display:`inline-flex`,alignItems:`center`,gap:`6px`},children:[(0,G.jsx)(QD,{size:14}),(0,G.jsx)(`span`,{className:`btn-label`,children:o.isPending?`Submitting…`:h?`Submitted ✓`:p>0?`Submit to GitHub (${p})`:`Submit to GitHub`})]}),children:(0,G.jsxs)(`div`,{className:`srp-inner`,children:[(0,G.jsxs)(`div`,{className:`srp-head`,children:[(0,G.jsx)(QD,{size:15,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`srp-title`,children:`Submit review to GitHub`}),(0,G.jsxs)(`span`,{className:`srp-count`,children:[p,` comment`,p===1?``:`s`]})]}),h&&(0,G.jsxs)(`div`,{className:`srp-already-submitted`,children:[(0,G.jsx)(jD,{size:13}),(0,G.jsxs)(`span`,{children:[`Already submitted as`,` `,e.submittedReviewUrl?(0,G.jsxs)(`a`,{href:e.submittedReviewUrl,target:`_blank`,rel:`noreferrer`,children:[`review #`,e.submittedReviewId,` `,(0,G.jsx)(GD,{size:11})]}):`review #${e.submittedReviewId}`,`. Re-submitting will post a new review on the same PR.`]})]}),(0,G.jsx)(`div`,{className:`plan-verdict-options`,role:`radiogroup`,"aria-label":`Verdict`,children:I0.map(e=>{let t=e.icon,n=l===e.value;return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":n,className:`plan-verdict-option ${e.className} ${n?`plan-verdict-option-selected`:``}`,onClick:()=>u(e.value),children:[(0,G.jsx)(`span`,{className:`plan-verdict-icon`,children:(0,G.jsx)(t,{size:15,"aria-hidden":`true`})}),(0,G.jsxs)(`span`,{className:`plan-verdict-text`,children:[(0,G.jsx)(`span`,{className:`plan-verdict-label`,children:e.label}),(0,G.jsx)(`span`,{className:`plan-verdict-desc`,children:e.description})]}),(0,G.jsx)(`span`,{className:`plan-verdict-radio`,"aria-hidden":`true`})]},e.value)})}),p>0?(0,G.jsx)(`ul`,{className:`srp-list`,"aria-label":`Comments to send`,children:m.map(e=>(0,G.jsx)(L0,{comment:e,onEdit:n,onDelete:r},e.id))}):(0,G.jsx)(`p`,{className:`srp-empty`,children:`No inline comments — your verdict and overall note will be sent on their own.`}),(0,G.jsxs)(`div`,{className:`srp-general`,children:[(0,G.jsxs)(`label`,{className:`srp-general-label`,htmlFor:`srp-gh-general-input`,children:[`Overall comment `,(0,G.jsx)(`span`,{className:`srp-optional`,children:`(optional · Markdown)`})]}),(0,G.jsx)(rU,{id:`srp-gh-general-input`,value:d,onChange:f,textareaClassName:`srp-general-input`,placeholder:`Add an overall note for the PR that applies to the whole review…`,rows:3,ariaLabel:`Overall PR review comment`,onSubmitShortcut:g})]}),o.isError&&(0,G.jsxs)(`div`,{className:`srp-error`,role:`alert`,children:[(0,G.jsx)(ID,{size:13}),(0,G.jsx)(`span`,{children:o.error?.message??`Submit failed`})]}),(0,G.jsxs)(`div`,{className:`srp-footer`,children:[(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>c(!1),disabled:o.isPending,children:`Cancel`}),(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:g,disabled:!l||o.isPending,children:o.isPending?`Submitting…`:`Submit review`})]})]})})}var I0=[{value:`approve`,label:`Approve`,description:`The PR is good — submit an APPROVE review.`,icon:jD,className:`plan-verdict-approve`},{value:`comment`,label:`Comment`,description:`Leave neutral feedback (no approve / no request changes).`,icon:sO,className:`plan-verdict-changes`},{value:`request-changes`,label:`Request changes`,description:`The author must address the comments before merging.`,icon:AO,className:`plan-verdict-reject`}];function L0({comment:e,onEdit:t,onDelete:n}){let[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(e.body),s=(0,W.useRef)(null);(0,W.useEffect)(()=>{r&&(s.current?.focus(),s.current?.select())},[r]);let c=e.lineNumber>0?e.startLineNumber&&e.startLineNumber!==e.lineNumber?`:${e.startLineNumber}-${e.lineNumber}`:`:${e.lineNumber}`:` · file`,l=()=>{let n=a.trim();n&&n!==e.body&&t(e.id,n),i(!1)};return(0,G.jsxs)(`li`,{className:`srp-item`,children:[(0,G.jsxs)(`div`,{className:`srp-item-top`,children:[(0,G.jsxs)(`span`,{className:`srp-item-loc`,children:[(0,G.jsx)(`span`,{className:`srp-item-file`,children:tE(e.filePath)}),(0,G.jsx)(`span`,{className:`srp-item-line`,children:c})]}),e.status===`resolved`&&(0,G.jsx)(`span`,{className:`srp-item-resolved`,children:`resolved`}),(0,G.jsxs)(`span`,{className:`srp-item-actions`,children:[r?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:l,title:`Save edit`,children:(0,G.jsx)(jD,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:()=>{o(e.body),i(!1)},title:`Cancel edit`,children:(0,G.jsx)(AO,{size:13,"aria-hidden":`true`})})]}):(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:()=>i(!0),title:`Edit comment`,children:(0,G.jsx)(hO,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`srp-icon-btn srp-icon-btn-danger`,onClick:()=>n(e.id),title:`Remove from review`,children:(0,G.jsx)(TO,{size:13,"aria-hidden":`true`})})]})]}),e.lineContent?.trim()&&(0,G.jsx)(`code`,{className:`srp-item-code`,children:e.lineContent.trim().slice(0,160)}),r?(0,G.jsx)(`textarea`,{ref:s,className:`srp-item-edit`,value:a,rows:2,onChange:e=>o(e.target.value),onKeyDown:t=>{t.key===`Enter`&&(t.metaKey||t.ctrlKey)?(t.preventDefault(),l()):t.key===`Escape`&&(t.preventDefault(),o(e.body),i(!1))}}):(0,G.jsx)(`p`,{className:`srp-item-body`,children:e.body})]})}function R0({session:e}){let[t,n]=(0,W.useState)(!1);return(0,W.useEffect)(()=>{n(!1)},[e.submittedAt]),t?null:(0,G.jsxs)(`div`,{className:`pr-submitted-toast`,role:`status`,children:[(0,G.jsx)(LD,{size:16,className:`pr-submitted-icon`}),(0,G.jsxs)(`div`,{className:`pr-submitted-text`,children:[(0,G.jsx)(`strong`,{children:`Review submitted to GitHub.`}),e.submittedReviewUrl&&(0,G.jsxs)(G.Fragment,{children:[` `,(0,G.jsxs)(`a`,{href:e.submittedReviewUrl,target:`_blank`,rel:`noreferrer`,children:[`Open review on GitHub `,(0,G.jsx)(GD,{size:11})]})]}),e.authSource&&(0,G.jsxs)(`span`,{className:`pr-submitted-auth`,children:[`via `,e.authSource]})]}),(0,G.jsx)(`button`,{className:`pr-submitted-dismiss`,onClick:()=>n(!0),title:`Dismiss`,"aria-label":`Dismiss`,children:`×`})]})}function z0(){Am();let{settings:e,loaded:t}=IE();LE(t,e.uiFont,e.monoFont);let{session:n,loaded:r}=A0(),i=P0(),{comments:a,addComment:o,removeComment:s,updateComment:c,addReply:l}=M0(r&&!!n),{patch:u,loading:d,error:f}=gE({staged:!1,untracked:!1},r&&!!n),{viewedFiles:p,setViewed:m}=BE();(0,W.useEffect)(()=>{Uf().catch(()=>{})},[]);let[h,g]=(0,W.useState)(null),[_,v]=(0,W.useState)(()=>{try{let e=fD(`diffing-sidebar-collapsed`);if(e!=null)return e===`true`}catch{}return typeof window<`u`&&window.innerWidth<=768}),[y,b]=(0,W.useState)(()=>{try{let e=fD(`diffing-sidebar-width`);return e?Number(e):320}catch{return 320}}),x=(0,W.useRef)(y);x.current=y;let S=(0,W.useRef)(null),C=(0,W.useRef)(null),w=(0,W.useRef)(null);(0,W.useEffect)(()=>{try{gD(`diffing-sidebar-collapsed`,String(_))}catch{}},[_]);let T=(0,W.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=x.current,r=C.current,i=w.current,a=r?r.getBoundingClientRect().left:0,o=n,s=0,c=()=>{s=0,i&&(i.style.transform=`translateX(${a+o}px)`)};i&&(i.style.transform=`translateX(${a+n}px)`,i.classList.add(`sidebar-resize-guide-active`));let l=e=>{let r=e.clientX-t;o=Math.max(240,Math.min(640,n+r)),s||=requestAnimationFrame(c)},u=()=>{s&&cancelAnimationFrame(s),i&&i.classList.remove(`sidebar-resize-guide-active`),b(o);try{gD(`diffing-sidebar-width`,String(o))}catch{}document.removeEventListener(`mousemove`,l),document.removeEventListener(`mouseup`,u),document.body.style.cursor=``,document.body.style.userSelect=``};document.addEventListener(`mousemove`,l),document.addEventListener(`mouseup`,u),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},[]),E=(0,W.useMemo)(()=>{if(!u)return[];try{return Pg(u).flatMap(e=>e.files)}catch{return[]}},[u]),D=(0,W.useMemo)(()=>{let e=new Map;if(!n)return e;for(let t of n.existingComments??[]){let n=e.get(t.path)??[];n.push(t),e.set(t.path,n)}return e},[n]),O=(0,W.useMemo)(()=>{let e=new Map;for(let t of a){let n=e.get(t.filePath)??[];n.push({side:t.side,lineNumber:t.lineNumber,metadata:t}),e.set(t.filePath,n)}return e},[a]),k=n?.existingComments?.length??0;return r&&!n?(0,G.jsxs)(`div`,{className:`pr-app-empty`,children:[(0,G.jsx)(QD,{size:32}),(0,G.jsx)(`h2`,{children:`No active PR session`}),(0,G.jsxs)(`p`,{children:[`Start one with `,(0,G.jsx)(`code`,{children:`diffing "gh pr 1234"`}),` or`,` `,(0,G.jsx)(`code`,{children:`diffing --gh-pr 1234`}),` from inside the repo.`]}),(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>DE(`/`),children:`Back to local review`})]}):n?(0,G.jsxs)(`div`,{ref:S,className:`app pr-app`,"data-pr-mode":`true`,children:[(0,G.jsxs)(`header`,{className:`pr-header`,children:[(0,G.jsxs)(`div`,{className:`pr-header-left`,children:[(0,G.jsx)(QD,{size:16,"aria-hidden":`true`}),(0,G.jsxs)(`strong`,{className:`pr-header-ref`,children:[n.owner,`/`,n.repo,`#`,n.pullNumber]}),(0,G.jsx)(`span`,{className:`pr-header-title`,children:n.title})]}),(0,G.jsxs)(`div`,{className:`pr-header-right`,children:[(0,G.jsxs)(`span`,{className:`pr-header-stat`,title:`+${n.additions} -${n.deletions} across ${n.changedFiles} files`,children:[`+`,n.additions,` −`,n.deletions,` · `,n.changedFiles,` files`]}),(0,G.jsxs)(`button`,{className:`btn btn-sm pr-header-copy`,onClick:async()=>{await navigator.clipboard.writeText(vE(a))},disabled:a.length===0,title:`Copy new comments as Markdown`,children:[(0,G.jsx)(UD,{size:12}),(0,G.jsx)(`span`,{className:`btn-label`,children:`Copy`})]}),(0,G.jsxs)(`button`,{className:`btn btn-sm pr-header-refresh`,onClick:()=>i.mutate(),disabled:i.isPending,title:`Re-fetch PR metadata from GitHub`,children:[(0,G.jsx)(_O,{size:12,className:i.isPending?`spinning`:``}),(0,G.jsx)(`span`,{className:`btn-label`,children:i.isPending?`Refreshing…`:`Refresh`})]}),(0,G.jsxs)(`a`,{className:`btn btn-sm pr-header-link`,href:n.url,target:`_blank`,rel:`noreferrer`,title:`Open on GitHub`,children:[(0,G.jsx)(GD,{size:12}),(0,G.jsx)(`span`,{className:`btn-label`,children:`Open`})]}),(0,G.jsx)(F0,{session:n,comments:a,onEditComment:(e,t)=>c({id:e,body:t}),onDeleteComment:s})]})]}),k>0&&(0,G.jsxs)(`div`,{className:`pr-existing-summary`,children:[(0,G.jsx)(aO,{size:12}),(0,G.jsxs)(`span`,{children:[k,` existing review comment`,k===1?``:`s`,` on this PR (read-only context, only your new comments will be posted).`]})]}),f&&(0,G.jsxs)(`div`,{className:`pr-error`,children:[`Failed to load the PR diff: `,f]}),(0,G.jsxs)(`div`,{className:`app-body`,style:{gridTemplateColumns:_?`0 1fr`:`${y}px 1fr`},children:[(0,G.jsxs)(`aside`,{ref:C,className:`sidebar ${_?`sidebar-collapsed`:``}`,style:_?{width:0,display:`none`}:{width:y},children:[(0,G.jsx)(y1,{files:E,activeFile:h,setActiveFile:g,commentCounts:{},existingCommentCounts:Object.fromEntries([...D.entries()].map(([e,t])=>[e,t.length]))}),(0,G.jsx)(`div`,{className:`sidebar-resize-handle`,onMouseDown:T,title:`Drag to resize`})]}),(0,G.jsx)(`main`,{className:`main`,children:d&&!u?(0,G.jsx)(`div`,{className:`pr-app-loading`,children:`Loading PR diff…`}):E.length===0?(0,G.jsx)(`div`,{className:`empty-state`,children:(0,G.jsx)(`p`,{children:`No changes found in this PR.`})}):(0,G.jsx)(B0,{files:E,fileAnnotations:O,existingCommentsByFile:D,viewedFiles:p,settings:e,onAddComment:e=>o({filePath:e.filePath,side:e.side,lineNumber:e.lineNumber,startLineNumber:e.startLineNumber,lineContent:e.lineContent,body:e.body}),onReplyComment:(e,t)=>l({id:e,body:t}),onEditComment:(e,t)=>c({id:e,body:t}),onDeleteComment:s,onViewedChange:m})})]}),(0,G.jsx)(`div`,{className:`sidebar-resize-guide`,ref:w,"aria-hidden":`true`}),(0,G.jsx)(S1,{comments:a,files:E,activeFile:h,onSetActiveFile:g,onEditComment:(e,t)=>c({id:e,body:t}),onDeleteComment:s,onAddReply:(e,t)=>l({id:e,body:t}),collapsed:!1,onToggleCollapsed:()=>{}}),n.submittedAt&&(0,G.jsx)(R0,{session:n}),(0,G.jsxs)(`button`,{className:`pr-back-button`,onClick:()=>DE(`/`),title:`Back to local review`,children:[(0,G.jsx)(kD,{size:14}),(0,G.jsx)(`span`,{children:`Back to local`})]})]}):(0,G.jsx)(`div`,{className:`pr-app-empty`,children:(0,G.jsx)(`span`,{children:`Loading PR session…`})})}function B0({files:e,fileAnnotations:t,existingCommentsByFile:n,viewedFiles:r,settings:i,onAddComment:a,onReplyComment:o,onEditComment:s,onDeleteComment:c,onViewedChange:l}){return(0,G.jsx)(`div`,{className:`pr-diff-surface`,children:e.map((e,o)=>{let s=e.name,u=n.get(s)??[];return(0,G.jsxs)(`div`,{className:`pr-file-block`,children:[(0,G.jsx)(rW,{files:[e],diffStyle:`unified`,tabSizeMap:{},defaultTabSize:4,viewedFiles:r,binaryFiles:new Map,theme:i.theme??`github-dark`,lineDiffType:`none`,lineWrap:!1,diffIndicators:`none`,showLineNumbers:!0,hunkSeparators:`line-numbers`,lineHoverHighlight:`none`,fontSize:i.fontSize??13,monoFontFamily:i.monoFont??`ui-monospace, SFMono-Regular, Menlo, monospace`,expandContextByDefault:!1,collapsedContextThreshold:2**53-1,expansionLineCount:0,onViewedChange:l,fileAnnotationsMap:new Map([[s,t.get(s)??[]]]),onAddComment:(...e)=>{let[t,n,r,i,o,s]=e;a({filePath:t,side:n,lineNumber:r,lineContent:i,body:o,startLineNumber:s})},onDeleteComment:c}),u.length>0&&(0,G.jsxs)(`div`,{className:`pr-existing-strip`,children:[(0,G.jsxs)(`div`,{className:`pr-existing-strip-head`,children:[(0,G.jsx)(aO,{size:11}),(0,G.jsxs)(`span`,{children:[u.length,` existing comment`,u.length===1?``:`s`,` on this file`]})]}),(0,G.jsx)(`ul`,{className:`pr-existing-strip-list`,children:u.map(e=>(0,G.jsxs)(`li`,{className:`pr-existing-strip-item`,children:[(0,G.jsxs)(`div`,{className:`pr-existing-strip-meta`,children:[(0,G.jsxs)(`strong`,{children:[`@`,e.author?.login??`unknown`]}),(0,G.jsx)(`span`,{className:`pr-existing-strip-line`,children:e.line==null?`· file`:`:${e.line}`}),e.state&&(0,G.jsx)(`span`,{className:`pr-existing-strip-state pr-state-${e.state.toLowerCase()}`,children:e.state.toLowerCase().replace(`_`,` `)}),e.replies.length>0&&(0,G.jsxs)(`span`,{className:`pr-existing-strip-replies`,children:[`+`,e.replies.length,` repl`,e.replies.length===1?`y`:`ies`]})]}),(0,G.jsx)(`p`,{className:`pr-existing-strip-body`,children:e.body})]},e.id))})]})]},`${s}-${o}`)})})}function V0(){let e=jE(),[t,n]=(0,W.useState)(!1);return(0,W.useEffect)(()=>{dD().then(()=>{n(!0)})},[]),t?e===`/plan`||e.startsWith(`/plan/`)?(0,G.jsx)(D0,{}):e===`/gh/pr`||e.startsWith(`/gh/pr/`)?(0,G.jsx)(z0,{}):(0,G.jsx)(d0,{}):(0,G.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,height:`100vh`,width:`100vw`,background:`#0d1117`,color:`#c9d1d9`,fontFamily:`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`},children:[(0,G.jsx)(`div`,{style:{width:`32px`,height:`32px`,border:`3px solid rgba(139, 148, 158, 0.15)`,borderTop:`3px solid #58a6ff`,borderRadius:`50%`,animation:`spin 0.8s linear infinite`,marginBottom:`16px`}}),(0,G.jsx)(`span`,{style:{fontSize:`13px`,fontWeight:500,opacity:.75,letterSpacing:`0.3px`},children:`Loading review session...`}),(0,G.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`
|
|
3917
|
+
`}var A0={pending:{icon:VD,className:`plan-badge-pending`,label:`Pending`},approved:{icon:jD,className:`plan-badge-approved`,label:`Approved`},"changes-requested":{icon:sO,className:`plan-badge-changes`,label:`Changes`},rejected:{icon:AO,className:`plan-badge-rejected`,label:`Rejected`},"comment-only":{icon:cO,className:`plan-badge-comment-only`,label:`Comment only`}};function j0({plans:e,activeId:t,onSelect:n,onDelete:r,collapsed:i,onToggleCollapse:a}){let[o,s]=(0,W.useState)(``),c=(0,W.useMemo)(()=>[...e].sort((e,t)=>t.createdAt-e.createdAt),[e]),l=(0,W.useMemo)(()=>c.filter(e=>e.title.toLowerCase().includes(o.toLowerCase())),[c,o]);return i?(0,G.jsx)(`div`,{className:`ft`,children:(0,G.jsx)(`div`,{className:`ft-search`,children:a&&(0,G.jsx)($T,{content:`Expand sidebar`,side:`right`,children:(0,G.jsx)(`button`,{className:`sidebar-toggle`,onClick:a,"aria-label":`Expand sidebar`,children:(0,G.jsx)(pO,{size:16})})})})}):(0,G.jsxs)(`div`,{className:`ft`,style:{display:`flex`,flexDirection:`column`,height:`100%`},children:[(0,G.jsxs)(`div`,{className:`ft-search`,children:[a&&(0,G.jsx)($T,{content:`Collapse sidebar`,side:`right`,children:(0,G.jsx)(`button`,{className:`sidebar-toggle`,onClick:a,"aria-label":`Collapse sidebar`,children:(0,G.jsx)(fO,{size:16})})}),(0,G.jsxs)(`div`,{className:`ft-search-wrapper`,children:[(0,G.jsx)(xO,{size:14,className:`ft-search-icon`}),(0,G.jsx)(`input`,{type:`text`,placeholder:`Filter plans...`,value:o,onChange:e=>s(e.target.value),className:`ft-search-input`})]})]}),(0,G.jsxs)(`div`,{className:`plan-list-scroll`,style:{flex:1,minHeight:0,overflow:`auto`},children:[(0,G.jsxs)(`div`,{className:`plan-list-header`,children:[`Plans (`,l.length,`)`]}),l.length===0&&(0,G.jsx)(`div`,{className:`plan-list-empty`,children:o?`No matching plans found.`:`No plans submitted yet.`}),l.map(e=>{let i=A0[e.decision],a=i.icon,o=(e.comments??[]).filter(e=>e.status===`open`).length;return(0,G.jsxs)(`div`,{className:`plan-list-item ${e.id===t?`plan-list-item-active`:``}`,onClick:()=>n(e.id),role:`button`,tabIndex:0,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n(e.id))},children:[(0,G.jsxs)(`div`,{className:`plan-list-item-top`,children:[(0,G.jsx)(`span`,{className:`plan-badge plan-badge-dot ${i.className}`,title:i.label,children:(0,G.jsx)(a,{size:11,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`plan-list-item-title`,title:e.title,children:e.title}),(0,G.jsx)(`button`,{className:`plan-list-delete`,title:`Delete plan`,onClick:t=>{t.stopPropagation(),r(e.id)},children:(0,G.jsx)(TO,{size:12,"aria-hidden":`true`})})]}),(0,G.jsxs)(`div`,{className:`plan-list-item-sub`,children:[(0,G.jsxs)(`span`,{children:[`v`,e.version]}),o>0&&(0,G.jsxs)(`span`,{children:[`· `,o,` open`]}),e.model&&(0,G.jsxs)(`span`,{className:`plan-list-item-model`,children:[`· `,(0,G.jsx)(AD,{size:10,"aria-hidden":`true`}),` `,e.model]}),(0,G.jsxs)(`span`,{className:`plan-list-item-time`,children:[`· `,eE(e.createdAt)]})]})]},e.id)})]})]})}var M0=[{value:`approved`,label:`Approve`,description:`The plan looks good — the agent should proceed.`,icon:jD,className:`plan-verdict-approve`},{value:`changes-requested`,label:`Request changes`,description:`The agent should revise the plan and resubmit it.`,icon:sO,className:`plan-verdict-changes`},{value:`rejected`,label:`Reject`,description:`Don't proceed — the approach needs rethinking.`,icon:AO,className:`plan-verdict-reject`},{value:`comment-only`,label:`Comment only`,description:`Agent must NOT edit files — only reply to comments. General note goes to chat.`,icon:cO,className:`plan-verdict-comment-only`}];function N0({openCommentCount:e,onSubmit:t,submitting:n,agentWaiting:r,currentDecision:i}){let{haptic:a,sound:o}=lD(),[s,c]=(0,W.useState)(!1),[l,u]=(0,W.useState)(null),[d,f]=(0,W.useState)(``),{popoverStyle:p,activePreset:m,applyPreset:h,startResize:g,startLeftResize:_,panelRef:v}=pU(),y=async()=>{l&&(a(`heavy`),o(`send`),await t(l,d,l===`comment-only`?`comment-only`:`standard`),f(``),u(null),c(!1))},b=i!==`pending`;return(0,G.jsx)(bk,{open:s,onOpenChange:c,ariaLabel:`Submit plan review`,className:`submit-plan-review-popover`,trigger:(0,G.jsxs)(`button`,{className:`btn btn-primary btn-sm send-review-btn`,disabled:n,title:r?`An agent is connected and waiting for your verdict`:`Submit your verdict on this plan`,style:{display:`inline-flex`,alignItems:`center`,gap:`6px`},children:[r&&(0,G.jsx)(`span`,{className:`agent-waiting-dot`,"aria-hidden":`true`}),b?(0,G.jsx)(_O,{size:14}):(0,G.jsx)(zD,{size:14}),(0,G.jsx)(`span`,{className:`btn-label`,children:n?`Submitting…`:b?`Update review`:`Submit review`})]}),children:(0,G.jsxs)(`div`,{className:`srp`,ref:v,style:p,children:[(0,G.jsx)(`div`,{className:`srp-resize-handle-left`,onMouseDown:_,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize submit panel width`,tabIndex:0}),(0,G.jsxs)(`div`,{className:`srp-head`,children:[b?(0,G.jsx)(_O,{size:15,"aria-hidden":`true`}):(0,G.jsx)(zD,{size:15,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`srp-title`,children:b?`Update plan review`:`Submit plan review`}),(0,G.jsx)(`div`,{className:`srp-size-presets`,role:`group`,"aria-label":`Panel size`,children:oU.map((e,t)=>(0,G.jsx)(`button`,{className:`srp-preset-btn`,role:`radio`,"aria-checked":m===t,"aria-pressed":m===t,onClick:()=>h(e),title:`${e.width}×${e.height}px`,children:e.label},e.label))}),e>0&&(0,G.jsxs)(`span`,{className:`srp-count`,children:[e,` open comment`,e===1?``:`s`]})]}),(0,G.jsxs)(`div`,{className:`srp-scroll`,children:[(0,G.jsx)(`div`,{className:`plan-verdict-options`,role:`radiogroup`,"aria-label":`Verdict`,children:M0.map(e=>{let t=e.icon,n=l===e.value;return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":n,className:`plan-verdict-option ${e.className} ${n?`plan-verdict-option-selected`:``}`,onClick:()=>u(e.value),children:[(0,G.jsx)(`span`,{className:`plan-verdict-icon`,children:(0,G.jsx)(t,{size:15,"aria-hidden":`true`})}),(0,G.jsxs)(`span`,{className:`plan-verdict-text`,children:[(0,G.jsx)(`span`,{className:`plan-verdict-label`,children:e.label}),(0,G.jsx)(`span`,{className:`plan-verdict-desc`,children:e.description})]}),(0,G.jsx)(`span`,{className:`plan-verdict-radio`,"aria-hidden":`true`})]},e.value)})}),(0,G.jsxs)(`div`,{className:`srp-general`,children:[(0,G.jsxs)(`label`,{className:`srp-general-label`,htmlFor:`plan-decision-comment`,children:[`Overall comment `,(0,G.jsx)(`span`,{className:`srp-optional`,children:`(optional · Markdown)`})]}),(0,G.jsx)(rU,{id:`plan-decision-comment`,value:d,onChange:f,textareaClassName:`srp-general-input`,placeholder:`Add an overall note for the agent that applies to the whole plan…`,rows:3,ariaLabel:`Overall plan review comment`,onSubmitShortcut:y})]})]}),(0,G.jsxs)(`div`,{className:`srp-footer`,children:[(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>c(!1),disabled:n,children:`Cancel`}),(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:y,disabled:!l||n,children:n?`Submitting…`:`Submit review`})]}),(0,G.jsx)(`div`,{className:`srp-resize-handle`,onMouseDown:g,role:`separator`,"aria-orientation":`horizontal`,"aria-label":`Resize submit panel`,tabIndex:0})]})})}var P0=[11,12,13,14,15,16].map(e=>({value:String(e),label:`${e}px`})),F0=[2,4,8].map(e=>({value:String(e),label:String(e)})),I0=[{value:`both`,label:`Both`},{value:`line`,label:`Line only`},{value:`number`,label:`Number only`},{value:`disabled`,label:`Disabled`}];function L0(){let e=Am(),{settings:t,loaded:n,updateSettings:r}=IE();LE(n,t.uiFont,t.monoFont);let{plans:i,getPlan:a,removePlan:o,agentActivity:s,clearAgentActivity:c,submitDecision:l,submitting:u,agentWaiting:d,isLoading:f}=wE(),p=jE(),[m,h]=(0,W.useState)(!1),[g,_]=(0,W.useState)(!1),[v,y]=(0,W.useState)(!1);(0,W.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&(e.key===`,`||e.code===`Comma`)&&(e.preventDefault(),_(e=>!e))};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[]);let[b,x]=(0,W.useState)(()=>{try{return fD(`diffing-plan-view-mode`)===`rendered`?`rendered`:`source`}catch{return`source`}}),S=(0,W.useCallback)(e=>{x(e);try{gD(`diffing-plan-view-mode`,e)}catch{}},[]),C=(0,W.useMemo)(()=>{let e=/^\/plan\/([^/]+)/.exec(p);return e?decodeURIComponent(e[1]):null},[p]),w=(0,W.useMemo)(()=>C?a(C):i.length===0?null:[...i].reverse().find(e=>e.decision===`pending`)??i[i.length-1],[C,i,a]),T=(0,W.useMemo)(()=>nE[t.theme||`nord`]||nE.nord,[t.theme]);(0,W.useEffect)(()=>{let e=t.theme||`nord`,n=document.documentElement;n.classList.add(`theme-switching`),n.setAttribute(`data-theme`,e);let r=requestAnimationFrame(()=>{requestAnimationFrame(()=>n.classList.remove(`theme-switching`))});return()=>cancelAnimationFrame(r)},[t.theme]),(0,W.useEffect)(()=>{e&&e.setRenderOptions({theme:{dark:T.type===`dark`?T.themeName:`nord`,light:T.type===`light`?T.themeName:`github-light`}}).catch(e=>console.error(`Failed to set worker pool render options:`,e))},[e,T]),(0,W.useEffect)(()=>{let e=T.type===`dark`?T.themeName:`nord`,t=T.type===`light`?T.themeName:`github-light`;Uf({themes:Array.from(new Set([e,t])),langs:[]}).catch(()=>{})},[T]);let[E,D]=(0,W.useState)(()=>{try{let e=fD(`diffing-sidebar-collapsed`);if(e!=null)return e===`true`}catch{}return typeof window<`u`&&window.innerWidth<=768}),[O,k]=(0,W.useState)(()=>{try{let e=fD(`diffing-sidebar-width`);return e?Number(e):320}catch{return 320}});(0,W.useEffect)(()=>{try{gD(`diffing-sidebar-collapsed`,String(E))}catch{}},[E]);let A=(0,W.useRef)(O);A.current=O;let j=(0,W.useRef)(null),M=(0,W.useRef)(null),N=(0,W.useRef)(null),P=(0,W.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=A.current,r=M.current,i=N.current,a=r?r.getBoundingClientRect().left:0,o=n,s=0,c=()=>{s=0,i&&(i.style.transform=`translateX(${a+o}px)`)};i&&(i.style.transform=`translateX(${a+n}px)`,i.classList.add(`sidebar-resize-guide-active`));let l=e=>{let r=e.clientX-t;o=Math.max(240,Math.min(640,n+r)),s||=requestAnimationFrame(c)},u=()=>{s&&cancelAnimationFrame(s),i&&i.classList.remove(`sidebar-resize-guide-active`),k(o);try{gD(`diffing-sidebar-width`,String(o))}catch{}document.removeEventListener(`mousemove`,l),document.removeEventListener(`mouseup`,u),document.body.style.cursor=``,document.body.style.userSelect=``};document.addEventListener(`mousemove`,l),document.addEventListener(`mouseup`,u),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},[]),F=(0,W.useCallback)(()=>{D(e=>!e)},[]),I=(0,W.useCallback)(()=>{r({lineWrap:!t.lineWrap})},[t.lineWrap,r]),L=(0,W.useCallback)(()=>{r({showLineNumbers:!t.showLineNumbers})},[t.showLineNumbers,r]),R=(0,W.useCallback)(()=>{S(b===`source`?`rendered`:`source`)},[b,S]),z=(0,W.useCallback)(()=>{let e=[2,4,8],n=t.defaultTabSize||4;r({defaultTabSize:e[(e.indexOf(n)+1)%e.length]})},[t.defaultTabSize,r]),ee=(0,W.useCallback)(e=>{if(i.length===0)return;let t=[...i].sort((e,t)=>t.createdAt-e.createdAt),n=0;if(w){let r=t.findIndex(e=>e.id===w.id);r!==-1&&(n=e===`next`?Math.min(r+1,t.length-1):Math.max(r-1,0))}let r=t[n];DE(`/plan/${r.id}`)},[i,w]);(0,W.useEffect)(()=>{let e=``,t,n=0,r=r=>{let i=document.activeElement;if(i){let e=i.tagName.toLowerCase();if(e===`input`||e===`textarea`||i.hasAttribute(`contenteditable`))return}clearTimeout(t);let a=r.key;if(r.ctrlKey){a===`d`?(r.preventDefault(),window.scrollBy({top:window.innerHeight/2,behavior:`auto`}),sD(`selection`,`navigate`),e=``):a===`u`&&(r.preventDefault(),window.scrollBy({top:-window.innerHeight/2,behavior:`auto`}),sD(`selection`,`navigate`),e=``);return}if(!(a.length>1&&a!==`Escape`&&a!==`Enter`))if(e+=a,t=setTimeout(()=>{e=``},800),e===`j`){r.preventDefault(),window.scrollBy({top:100,behavior:`auto`});let t=Date.now();t-n>80&&(aD(`navigate`),n=t),e=``}else if(e===`k`){r.preventDefault(),window.scrollBy({top:-100,behavior:`auto`});let t=Date.now();t-n>80&&(aD(`navigate`),n=t),e=``}else e===`gg`?(r.preventDefault(),window.scrollTo({top:0,behavior:`auto`}),sD(`selection`,`navigate`),e=``):e===`G`?(r.preventDefault(),window.scrollTo({top:document.documentElement.scrollHeight,behavior:`auto`}),sD(`selection`,`navigate`),e=``):e===`J`?(r.preventDefault(),ee(`next`),sD(`selection`,`navigate`),e=``):e===`K`?(r.preventDefault(),ee(`prev`),sD(`selection`,`navigate`),e=``):e===`m`?(r.preventDefault(),R(),sD(`selection`,`toggle`),e=``):e===`t`?(r.preventDefault(),z(),sD(`selection`,`toggle`),e=``):e===`b`?(r.preventDefault(),F(),sD(`selection`,`toggle`),e=``):e===`w`?(r.preventDefault(),I(),sD(`selection`,`toggle`),e=``):e===`n`?(r.preventDefault(),L(),sD(`selection`,`toggle`),e=``):e===`gt`?(r.preventDefault(),h(!0),sD(`medium`,`open`),e=``):e===`?`?(r.preventDefault(),y(!0),sD(`medium`,`open`),e=``):e.length>=2&&(e=``)};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r)}},[F,I,L,R,z,ee]);let te=(0,W.useMemo)(()=>w?(w.comments??[]).filter(e=>e.status===`open`).length:0,[w]);return f||!n?(0,G.jsxs)(`div`,{className:`app plan-app skeleton-app`,style:{"--sidebar-width":`${O}px`},children:[(0,G.jsxs)(`header`,{className:`skeleton-toolbar`,children:[(0,G.jsx)(`div`,{className:`skeleton-item skeleton-logo`,style:{width:`140px`}}),(0,G.jsx)(`div`,{className:`skeleton-item skeleton-stats`,style:{width:`80px`,marginLeft:`20px`}}),(0,G.jsx)(`div`,{className:`skeleton-item skeleton-actions`,style:{width:`220px`}})]}),(0,G.jsxs)(`div`,{className:`app-body`,children:[(0,G.jsx)(`aside`,{className:`sidebar plan-sidebar skeleton-sidebar ${E?`sidebar-collapsed`:``}`,children:!E&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`skeleton-search`,style:{height:`32px`,margin:`0 16px 16px 16px`}}),(0,G.jsx)(`div`,{className:`skeleton-tree-nodes`,children:Array.from({length:4}).map((e,t)=>(0,G.jsxs)(`div`,{className:`skeleton-tree-node`,style:{paddingLeft:`16px`,height:`40px`,borderBottom:`1px solid var(--border-weak)`},children:[(0,G.jsx)(`div`,{className:`skeleton-node-icon`,style:{width:`20px`,height:`20px`,borderRadius:`50%`}}),(0,G.jsx)(`div`,{className:`skeleton-node-text`,style:{width:`${80+t*30%90}px`,height:`14px`}})]},t))})]})}),!E&&(0,G.jsx)(`div`,{className:`sidebar-resize-handle`,style:{cursor:`default`}}),(0,G.jsx)(`main`,{className:`main plan-main skeleton-main`,children:(0,G.jsxs)(`div`,{className:`file-diff-card skeleton-card`,style:{border:`1px solid var(--border-color)`,borderRadius:`8px`},children:[(0,G.jsxs)(`div`,{className:`skeleton-card-header`,style:{padding:`16px 20px`},children:[(0,G.jsx)(`div`,{className:`skeleton-card-title`,style:{width:`250px`,height:`20px`}}),(0,G.jsx)(`div`,{className:`skeleton-card-badge`,style:{width:`100px`,height:`24px`}})]}),(0,G.jsxs)(`div`,{className:`skeleton-card-body`,style:{padding:`24px`,background:`var(--bg-secondary)`,display:`flex`,flexDirection:`column`,gap:`16px`},children:[(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`90%`,height:`16px`}}),(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`75%`,height:`16px`}}),(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`85%`,height:`16px`}}),(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`40%`,height:`16px`}}),(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`60%`,height:`16px`}}),(0,G.jsx)(`div`,{className:`skeleton-code-line`,style:{width:`80%`,height:`16px`}})]})]})})]})]}):(0,G.jsx)(cD,{enabled:t.haptics??!0,soundsEnabled:t.sounds??!0,children:(0,G.jsxs)(`div`,{className:`app plan-app`,ref:j,style:{"--sidebar-width":`${O}px`},children:[(0,G.jsx)(`div`,{className:`sidebar-resize-guide`,ref:N,"aria-hidden":`true`}),(0,G.jsxs)(`div`,{className:`toolbar plan-app-toolbar`,children:[(0,G.jsxs)(`div`,{className:`toolbar-left`,children:[(0,G.jsx)(`button`,{className:`toolbar-mobile-toggle`,onClick:()=>D(!E),"aria-label":`Toggle sidebar`,title:E?`Open sidebar`:`Close sidebar`,children:(0,G.jsx)(iO,{size:18})}),(0,G.jsxs)(`button`,{className:`btn btn-sm`,onClick:()=>DE(`/`),title:`Back to the diff review`,children:[(0,G.jsx)(kD,{size:14,style:{marginRight:`6px`}}),(0,G.jsx)(`span`,{className:`btn-label`,children:`Diff`})]}),(0,G.jsxs)(`h1`,{className:`toolbar-title plan-app-title`,children:[(0,G.jsx)(BD,{size:16,style:{marginRight:`6px`}}),`Plan review`]}),(0,G.jsxs)(`span`,{className:`toolbar-stat`,children:[i.length,` plan`,i.length===1?``:`s`]})]}),(0,G.jsxs)(`div`,{className:`toolbar-right`,children:[(0,G.jsx)(bk,{open:g,onOpenChange:_,ariaLabel:`Settings`,className:`settings-popover`,trigger:(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn ${g?`btn-active`:``}`,title:`Settings`,children:[(0,G.jsx)(SO,{size:14}),` `,(0,G.jsx)(`span`,{className:`btn-label`,children:`Settings`})]}),children:(0,G.jsxs)(`div`,{className:`popover-scroll settings-panel`,children:[(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Review Options`}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`View mode`}),(0,G.jsx)(NA,{value:b,onValueChange:e=>S(e),options:[{value:`source`,label:`Source (commentable)`},{value:`rendered`,label:`Rendered (markdown)`}],ariaLabel:`Plan view mode`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Theme`}),(0,G.jsxs)(`button`,{className:`btn btn-sm settings-btn`,onClick:()=>{_(!1),h(!0)},style:{display:`inline-flex`,alignItems:`center`},children:[(0,G.jsx)(dO,{size:14,style:{marginRight:`4px`}}),(0,G.jsx)(`span`,{children:`Switch Theme...`})]})]}),(0,G.jsx)(`div`,{className:`settings-section-label`,children:`Display`}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:t.lineWrap,onChange:e=>r({lineWrap:e.target.checked})}),`Wrap long lines`]}),(0,G.jsxs)(`label`,{className:`settings-item`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:t.showLineNumbers,onChange:e=>r({showLineNumbers:e.target.checked})}),`Show line numbers`]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Hover highlight`}),(0,G.jsx)(NA,{value:t.lineHoverHighlight,onValueChange:e=>r({lineHoverHighlight:e}),options:I0,ariaLabel:`Hover highlight`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Font size`}),(0,G.jsx)(NA,{value:String(t.fontSize),onValueChange:e=>r({fontSize:Number(e)}),options:P0,ariaLabel:`Font size`})]}),(0,G.jsxs)(`div`,{className:`settings-item settings-item-spaced`,children:[(0,G.jsx)(`span`,{children:`Default tab size`}),(0,G.jsx)(NA,{value:String(t.defaultTabSize),onValueChange:e=>r({defaultTabSize:Number(e)}),options:F0,ariaLabel:`Default tab size`})]})]})}),w&&(0,G.jsx)(N0,{openCommentCount:te,onSubmit:(e,t)=>l(w.id,e,t),submitting:u,agentWaiting:d,currentDecision:w.decision})]})]}),!E&&(0,G.jsx)(`div`,{className:`sidebar-mobile-backdrop`,onClick:()=>D(!0),"aria-hidden":`true`}),(0,G.jsxs)(`div`,{className:`app-body`,children:[(0,G.jsx)(`aside`,{ref:M,className:`sidebar plan-sidebar ${E?`sidebar-collapsed`:``}`,children:(0,G.jsx)(`div`,{style:{flex:1,minHeight:0,overflow:`hidden`},children:(0,G.jsx)(j0,{plans:i,activeId:w?.id??null,onSelect:e=>DE(`/plan/${e}`),onDelete:e=>{o(e),w?.id===e&&DE(`/plan`)},collapsed:E,onToggleCollapse:()=>D(!E)})})}),!E&&(0,G.jsx)(`div`,{className:`sidebar-resize-handle`,onMouseDown:P,role:`separator`,"aria-label":`Resize sidebar`,"aria-orientation":`vertical`,tabIndex:0}),(0,G.jsx)(`main`,{className:`main plan-main`,children:w?(0,G.jsx)(O0,{plan:w,theme:t.theme||`nord`,fontSize:t.fontSize,monoFontFamily:FE(t.monoFont),defaultTabSize:t.defaultTabSize,lineWrap:t.lineWrap,showLineNumbers:t.showLineNumbers,lineHoverHighlight:t.lineHoverHighlight,viewMode:b},w.id):(0,G.jsx)(R0,{hasPlans:i.length>0,notFound:!!C})})]}),(0,G.jsx)(_0,{open:m,activeTheme:t.theme||`nord`,onThemeChange:e=>r({theme:e}),onClose:()=>h(!1)}),(0,G.jsx)(h0,{activity:s?{at:s.at,commentId:s.commentId,filePath:`plan comment`,model:s.model,body:s.body}:null,onDismiss:c,onJump:()=>{s&&DE(`/plan/${s.planId}`)}}),(0,G.jsx)(p0,{activeFile:w?w.title:null,onShowHelp:()=>y(!0),placeholder:`No active plan (J/K to jump)`}),(0,G.jsx)(m0,{isOpen:v,onClose:()=>y(!1),mode:`plan`})]})})}function R0({hasPlans:e,notFound:t}){return(0,G.jsxs)(`div`,{className:`plan-empty-state`,children:[(0,G.jsx)(BD,{size:40,style:{opacity:.4}}),t?(0,G.jsx)(`p`,{children:`That plan no longer exists. Pick one from the list, or submit a new plan.`}):e?(0,G.jsx)(`p`,{children:`Select a plan from the list to review it.`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{children:`No plans have been submitted for review yet.`}),(0,G.jsxs)(`p`,{className:`plan-empty-hint`,children:[`An agent can submit one with`,` `,(0,G.jsx)(`code`,{children:`diffing plan submit PLAN.md`}),` (or the `,(0,G.jsx)(`code`,{children:`submit_plan`}),` MCP tool), then block on`,` `,(0,G.jsx)(`code`,{children:`diffing plan await`}),` until you approve, reject, or request changes here.`]})]})]})}var z0=[`pr-session`];function B0(){let e=Ve(),{data:t,isLoading:n,error:r}=nt({queryKey:z0,queryFn:async()=>{let e=await fetch(`/api/gh/session`);if(e.status===404)return null;if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()},retry:!1});return(0,W.useEffect)(()=>fE(`pr-session`,()=>{e.invalidateQueries({queryKey:z0})}),[e]),{session:t,loaded:!n,error:r}}var V0=[`pr-comments`];function H0(e){let t=Ve(),{data:n=[]}=nt({queryKey:V0,queryFn:async()=>{let e=await fetch(`/api/gh/pr-session/comments`);if(e.status===404)return[];if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()},enabled:e});(0,W.useEffect)(()=>fE(`pr-session`,()=>{t.invalidateQueries({queryKey:V0})}),[t]);let r=rt({mutationFn:async e=>(await fetch(`/api/gh/pr-session/comments`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})).json(),onSuccess:e=>{t.setQueryData(V0,(t=[])=>[...t,e])}}),i=rt({mutationFn:async e=>(await fetch(`/api/gh/pr-session/comments/${e}`,{method:`DELETE`}),e),onSuccess:e=>{t.setQueryData(V0,(t=[])=>t.filter(t=>t.id!==e))}}),a=rt({mutationFn:async({id:e,body:t,status:n})=>(await fetch(`/api/gh/pr-session/comments/${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:t,status:n})})).json(),onSuccess:e=>{t.setQueryData(V0,(t=[])=>t.map(t=>t.id===e.id?e:t))}}),o=rt({mutationFn:async({id:e,body:t})=>(await fetch(`/api/gh/pr-session/comments/${e}/replies`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({body:t,role:`user`})})).json(),onSuccess:e=>{t.setQueryData(V0,(t=[])=>t.map(t=>t.id===e.id?e:t))}});return{comments:n,addComment:r.mutate,removeComment:i.mutate,updateComment:a.mutate,addReply:o.mutate}}function U0(){return rt({mutationFn:async e=>{let t=await fetch(`/api/gh/submit`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({decision:e.decision,body:e.body,dryRun:e.dryRun})}),n=await t.json();if(!t.ok)throw Error(n.error||`HTTP ${t.status}`);return n}})}function W0(){let e=Ve();return rt({mutationFn:async()=>{let e=await fetch(`/api/gh/pr/refresh`,{method:`POST`}),t=await e.json();if(!e.ok)throw Error(t.error||`HTTP ${e.status}`);return t},onSuccess:()=>{e.invalidateQueries({queryKey:z0})}})}function G0({session:e,comments:t,onEditComment:n,onDeleteComment:r}){let{haptic:i,sound:a}=lD(),o=U0(),[s,c]=(0,W.useState)(!1),[l,u]=(0,W.useState)(null),[d,f]=(0,W.useState)(``),{popoverStyle:p,activePreset:m,applyPreset:h,startResize:g,startLeftResize:_,panelRef:v}=pU(),y=t.length,b=(0,W.useMemo)(()=>[...t].sort((e,t)=>e.createdAt-t.createdAt),[t]),x=!!e.submittedAt,S=async()=>{if(l){i(`heavy`),a(`send`);try{await o.mutateAsync({decision:l,body:d}),f(``),u(null),c(!1)}catch{}}};return(0,G.jsx)(bk,{open:s,onOpenChange:c,ariaLabel:`Submit your review to GitHub`,className:`submit-to-github-popover`,trigger:(0,G.jsxs)(`button`,{className:`btn btn-primary btn-sm send-review-btn`,disabled:o.isPending,title:x?`Already submitted`:`Submit your review to the PR on GitHub`,style:{display:`inline-flex`,alignItems:`center`,gap:`6px`},children:[(0,G.jsx)(QD,{size:14}),(0,G.jsx)(`span`,{className:`btn-label`,children:o.isPending?`Submitting…`:x?`Submitted ✓`:y>0?`Submit to GitHub (${y})`:`Submit to GitHub`})]}),children:(0,G.jsxs)(`div`,{className:`srp`,ref:v,style:p,children:[(0,G.jsx)(`div`,{className:`srp-resize-handle-left`,onMouseDown:_,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize submit panel width`,tabIndex:0}),(0,G.jsxs)(`div`,{className:`srp-head`,children:[(0,G.jsx)(QD,{size:15,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`srp-title`,children:`Submit review to GitHub`}),(0,G.jsx)(`div`,{className:`srp-size-presets`,role:`group`,"aria-label":`Panel size`,children:oU.map((e,t)=>(0,G.jsx)(`button`,{className:`srp-preset-btn`,role:`radio`,"aria-checked":m===t,"aria-pressed":m===t,onClick:()=>h(e),title:`${e.width}×${e.height}px`,children:e.label},e.label))}),(0,G.jsxs)(`span`,{className:`srp-count`,children:[y,` comment`,y===1?``:`s`]})]}),(0,G.jsxs)(`div`,{className:`srp-scroll`,children:[x&&(0,G.jsxs)(`div`,{className:`srp-already-submitted`,children:[(0,G.jsx)(jD,{size:13}),(0,G.jsxs)(`span`,{children:[`Already submitted as`,` `,e.submittedReviewUrl?(0,G.jsxs)(`a`,{href:e.submittedReviewUrl,target:`_blank`,rel:`noreferrer`,children:[`review #`,e.submittedReviewId,` `,(0,G.jsx)(GD,{size:11})]}):`review #${e.submittedReviewId}`,`. Re-submitting will post a new review on the same PR.`]})]}),(0,G.jsx)(`div`,{className:`plan-verdict-options`,role:`radiogroup`,"aria-label":`Verdict`,children:K0.map(e=>{let t=e.icon,n=l===e.value;return(0,G.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":n,className:`plan-verdict-option ${e.className} ${n?`plan-verdict-option-selected`:``}`,onClick:()=>u(e.value),children:[(0,G.jsx)(`span`,{className:`plan-verdict-icon`,children:(0,G.jsx)(t,{size:15,"aria-hidden":`true`})}),(0,G.jsxs)(`span`,{className:`plan-verdict-text`,children:[(0,G.jsx)(`span`,{className:`plan-verdict-label`,children:e.label}),(0,G.jsx)(`span`,{className:`plan-verdict-desc`,children:e.description})]}),(0,G.jsx)(`span`,{className:`plan-verdict-radio`,"aria-hidden":`true`})]},e.value)})}),y>0?(0,G.jsx)(`ul`,{className:`srp-list`,"aria-label":`Comments to send`,children:b.map(e=>(0,G.jsx)(q0,{comment:e,onEdit:n,onDelete:r},e.id))}):(0,G.jsx)(`p`,{className:`srp-empty`,children:`No inline comments — your verdict and overall note will be sent on their own.`}),(0,G.jsxs)(`div`,{className:`srp-general`,children:[(0,G.jsxs)(`label`,{className:`srp-general-label`,htmlFor:`srp-gh-general-input`,children:[`Overall comment `,(0,G.jsx)(`span`,{className:`srp-optional`,children:`(optional · Markdown)`})]}),(0,G.jsx)(rU,{id:`srp-gh-general-input`,value:d,onChange:f,textareaClassName:`srp-general-input`,placeholder:`Add an overall note for the PR that applies to the whole review…`,rows:3,ariaLabel:`Overall PR review comment`,onSubmitShortcut:S})]}),o.isError&&(0,G.jsxs)(`div`,{className:`srp-error`,role:`alert`,children:[(0,G.jsx)(ID,{size:13}),(0,G.jsx)(`span`,{children:o.error?.message??`Submit failed`})]})]}),(0,G.jsxs)(`div`,{className:`srp-footer`,children:[(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>c(!1),disabled:o.isPending,children:`Cancel`}),(0,G.jsx)(`button`,{className:`btn btn-primary btn-sm`,onClick:S,disabled:!l||o.isPending,children:o.isPending?`Submitting…`:`Submit review`})]}),(0,G.jsx)(`div`,{className:`srp-resize-handle`,onMouseDown:g,role:`separator`,"aria-orientation":`horizontal`,"aria-label":`Resize submit panel`,tabIndex:0})]})})}var K0=[{value:`approve`,label:`Approve`,description:`The PR is good — submit an APPROVE review.`,icon:jD,className:`plan-verdict-approve`},{value:`comment`,label:`Comment`,description:`Leave neutral feedback (no approve / no request changes).`,icon:sO,className:`plan-verdict-changes`},{value:`request-changes`,label:`Request changes`,description:`The author must address the comments before merging.`,icon:AO,className:`plan-verdict-reject`}];function q0({comment:e,onEdit:t,onDelete:n}){let[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(e.body),s=(0,W.useRef)(null);(0,W.useEffect)(()=>{r&&(s.current?.focus(),s.current?.select())},[r]);let c=e.lineNumber>0?e.startLineNumber&&e.startLineNumber!==e.lineNumber?`:${e.startLineNumber}-${e.lineNumber}`:`:${e.lineNumber}`:` · file`,l=()=>{let n=a.trim();n&&n!==e.body&&t(e.id,n),i(!1)};return(0,G.jsxs)(`li`,{className:`srp-item`,children:[(0,G.jsxs)(`div`,{className:`srp-item-top`,children:[(0,G.jsxs)(`span`,{className:`srp-item-loc`,children:[(0,G.jsx)(`span`,{className:`srp-item-file`,children:tE(e.filePath)}),(0,G.jsx)(`span`,{className:`srp-item-line`,children:c})]}),e.status===`resolved`&&(0,G.jsx)(`span`,{className:`srp-item-resolved`,children:`resolved`}),(0,G.jsxs)(`span`,{className:`srp-item-actions`,children:[r?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:l,title:`Save edit`,children:(0,G.jsx)(jD,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:()=>{o(e.body),i(!1)},title:`Cancel edit`,children:(0,G.jsx)(AO,{size:13,"aria-hidden":`true`})})]}):(0,G.jsx)(`button`,{className:`srp-icon-btn`,onClick:()=>i(!0),title:`Edit comment`,children:(0,G.jsx)(hO,{size:13,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{className:`srp-icon-btn srp-icon-btn-danger`,onClick:()=>n(e.id),title:`Remove from review`,children:(0,G.jsx)(TO,{size:13,"aria-hidden":`true`})})]})]}),e.lineContent?.trim()&&(0,G.jsx)(`code`,{className:`srp-item-code`,children:e.lineContent.trim().slice(0,160)}),r?(0,G.jsx)(`textarea`,{ref:s,className:`srp-item-edit`,value:a,rows:2,onChange:e=>o(e.target.value),onKeyDown:t=>{t.key===`Enter`&&(t.metaKey||t.ctrlKey)?(t.preventDefault(),l()):t.key===`Escape`&&(t.preventDefault(),o(e.body),i(!1))}}):(0,G.jsx)(`p`,{className:`srp-item-body`,children:e.body})]})}function J0({session:e}){let[t,n]=(0,W.useState)(!1);return(0,W.useEffect)(()=>{n(!1)},[e.submittedAt]),t?null:(0,G.jsxs)(`div`,{className:`pr-submitted-toast`,role:`status`,children:[(0,G.jsx)(LD,{size:16,className:`pr-submitted-icon`}),(0,G.jsxs)(`div`,{className:`pr-submitted-text`,children:[(0,G.jsx)(`strong`,{children:`Review submitted to GitHub.`}),e.submittedReviewUrl&&(0,G.jsxs)(G.Fragment,{children:[` `,(0,G.jsxs)(`a`,{href:e.submittedReviewUrl,target:`_blank`,rel:`noreferrer`,children:[`Open review on GitHub `,(0,G.jsx)(GD,{size:11})]})]}),e.authSource&&(0,G.jsxs)(`span`,{className:`pr-submitted-auth`,children:[`via `,e.authSource]})]}),(0,G.jsx)(`button`,{className:`pr-submitted-dismiss`,onClick:()=>n(!0),title:`Dismiss`,"aria-label":`Dismiss`,children:`×`})]})}function Y0(){Am();let{settings:e,loaded:t}=IE();LE(t,e.uiFont,e.monoFont);let{session:n,loaded:r}=B0(),i=W0(),{comments:a,addComment:o,removeComment:s,updateComment:c,addReply:l}=H0(r&&!!n),{patch:u,loading:d,error:f}=gE({staged:!1,untracked:!1},r&&!!n),{viewedFiles:p,setViewed:m}=BE();(0,W.useEffect)(()=>{Uf().catch(()=>{})},[]);let[h,g]=(0,W.useState)(null),[_,v]=(0,W.useState)(()=>{try{let e=fD(`diffing-sidebar-collapsed`);if(e!=null)return e===`true`}catch{}return typeof window<`u`&&window.innerWidth<=768}),[y,b]=(0,W.useState)(()=>{try{let e=fD(`diffing-sidebar-width`);return e?Number(e):320}catch{return 320}}),x=(0,W.useRef)(y);x.current=y;let S=(0,W.useRef)(null),C=(0,W.useRef)(null),w=(0,W.useRef)(null);(0,W.useEffect)(()=>{try{gD(`diffing-sidebar-collapsed`,String(_))}catch{}},[_]);let T=(0,W.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=x.current,r=C.current,i=w.current,a=r?r.getBoundingClientRect().left:0,o=n,s=0,c=()=>{s=0,i&&(i.style.transform=`translateX(${a+o}px)`)};i&&(i.style.transform=`translateX(${a+n}px)`,i.classList.add(`sidebar-resize-guide-active`));let l=e=>{let r=e.clientX-t;o=Math.max(240,Math.min(640,n+r)),s||=requestAnimationFrame(c)},u=()=>{s&&cancelAnimationFrame(s),i&&i.classList.remove(`sidebar-resize-guide-active`),b(o);try{gD(`diffing-sidebar-width`,String(o))}catch{}document.removeEventListener(`mousemove`,l),document.removeEventListener(`mouseup`,u),document.body.style.cursor=``,document.body.style.userSelect=``};document.addEventListener(`mousemove`,l),document.addEventListener(`mouseup`,u),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},[]),E=(0,W.useMemo)(()=>{if(!u)return[];try{return Pg(u).flatMap(e=>e.files)}catch{return[]}},[u]),D=(0,W.useMemo)(()=>{let e=new Map;if(!n)return e;for(let t of n.existingComments??[]){let n=e.get(t.path)??[];n.push(t),e.set(t.path,n)}return e},[n]),O=(0,W.useMemo)(()=>{let e=new Map;for(let t of a){let n=e.get(t.filePath)??[];n.push({side:t.side,lineNumber:t.lineNumber,metadata:t}),e.set(t.filePath,n)}return e},[a]),k=n?.existingComments?.length??0;return r&&!n?(0,G.jsxs)(`div`,{className:`pr-app-empty`,children:[(0,G.jsx)(QD,{size:32}),(0,G.jsx)(`h2`,{children:`No active PR session`}),(0,G.jsxs)(`p`,{children:[`Start one with `,(0,G.jsx)(`code`,{children:`diffing "gh pr 1234"`}),` or`,` `,(0,G.jsx)(`code`,{children:`diffing --gh-pr 1234`}),` from inside the repo.`]}),(0,G.jsx)(`button`,{className:`btn btn-sm`,onClick:()=>DE(`/`),children:`Back to local review`})]}):n?(0,G.jsxs)(`div`,{ref:S,className:`app pr-app`,"data-pr-mode":`true`,children:[(0,G.jsxs)(`header`,{className:`pr-header`,children:[(0,G.jsxs)(`div`,{className:`pr-header-left`,children:[(0,G.jsx)(QD,{size:16,"aria-hidden":`true`}),(0,G.jsxs)(`strong`,{className:`pr-header-ref`,children:[n.owner,`/`,n.repo,`#`,n.pullNumber]}),(0,G.jsx)(`span`,{className:`pr-header-title`,children:n.title})]}),(0,G.jsxs)(`div`,{className:`pr-header-right`,children:[(0,G.jsxs)(`span`,{className:`pr-header-stat`,title:`+${n.additions} -${n.deletions} across ${n.changedFiles} files`,children:[`+`,n.additions,` −`,n.deletions,` · `,n.changedFiles,` files`]}),(0,G.jsxs)(`button`,{className:`btn btn-sm pr-header-copy`,onClick:async()=>{await navigator.clipboard.writeText(vE(a))},disabled:a.length===0,title:`Copy new comments as Markdown`,children:[(0,G.jsx)(UD,{size:12}),(0,G.jsx)(`span`,{className:`btn-label`,children:`Copy`})]}),(0,G.jsxs)(`button`,{className:`btn btn-sm pr-header-refresh`,onClick:()=>i.mutate(),disabled:i.isPending,title:`Re-fetch PR metadata from GitHub`,children:[(0,G.jsx)(_O,{size:12,className:i.isPending?`spinning`:``}),(0,G.jsx)(`span`,{className:`btn-label`,children:i.isPending?`Refreshing…`:`Refresh`})]}),(0,G.jsxs)(`a`,{className:`btn btn-sm pr-header-link`,href:n.url,target:`_blank`,rel:`noreferrer`,title:`Open on GitHub`,children:[(0,G.jsx)(GD,{size:12}),(0,G.jsx)(`span`,{className:`btn-label`,children:`Open`})]}),(0,G.jsx)(G0,{session:n,comments:a,onEditComment:(e,t)=>c({id:e,body:t}),onDeleteComment:s})]})]}),k>0&&(0,G.jsxs)(`div`,{className:`pr-existing-summary`,children:[(0,G.jsx)(aO,{size:12}),(0,G.jsxs)(`span`,{children:[k,` existing review comment`,k===1?``:`s`,` on this PR (read-only context, only your new comments will be posted).`]})]}),f&&(0,G.jsxs)(`div`,{className:`pr-error`,children:[`Failed to load the PR diff: `,f]}),(0,G.jsxs)(`div`,{className:`app-body`,style:{gridTemplateColumns:_?`0 1fr`:`${y}px 1fr`},children:[(0,G.jsxs)(`aside`,{ref:C,className:`sidebar ${_?`sidebar-collapsed`:``}`,style:_?{width:0,display:`none`}:{width:y},children:[(0,G.jsx)(k1,{files:E,activeFile:h,setActiveFile:g,commentCounts:{},existingCommentCounts:Object.fromEntries([...D.entries()].map(([e,t])=>[e,t.length]))}),(0,G.jsx)(`div`,{className:`sidebar-resize-handle`,onMouseDown:T,title:`Drag to resize`})]}),(0,G.jsx)(`main`,{className:`main`,children:d&&!u?(0,G.jsx)(`div`,{className:`pr-app-loading`,children:`Loading PR diff…`}):E.length===0?(0,G.jsx)(`div`,{className:`empty-state`,children:(0,G.jsx)(`p`,{children:`No changes found in this PR.`})}):(0,G.jsx)(X0,{files:E,fileAnnotations:O,existingCommentsByFile:D,viewedFiles:p,settings:e,onAddComment:e=>o({filePath:e.filePath,side:e.side,lineNumber:e.lineNumber,startLineNumber:e.startLineNumber,lineContent:e.lineContent,body:e.body}),onReplyComment:(e,t)=>l({id:e,body:t}),onEditComment:(e,t)=>c({id:e,body:t}),onDeleteComment:s,onViewedChange:m})})]}),(0,G.jsx)(`div`,{className:`sidebar-resize-guide`,ref:w,"aria-hidden":`true`}),(0,G.jsx)(M1,{comments:a,files:E,activeFile:h,onSetActiveFile:g,onEditComment:(e,t)=>c({id:e,body:t}),onDeleteComment:s,onAddReply:(e,t)=>l({id:e,body:t}),collapsed:!1,onToggleCollapsed:()=>{}}),n.submittedAt&&(0,G.jsx)(J0,{session:n}),(0,G.jsxs)(`button`,{className:`pr-back-button`,onClick:()=>DE(`/`),title:`Back to local review`,children:[(0,G.jsx)(kD,{size:14}),(0,G.jsx)(`span`,{children:`Back to local`})]})]}):(0,G.jsx)(`div`,{className:`pr-app-empty`,children:(0,G.jsx)(`span`,{children:`Loading PR session…`})})}function X0({files:e,fileAnnotations:t,existingCommentsByFile:n,viewedFiles:r,settings:i,onAddComment:a,onReplyComment:o,onEditComment:s,onDeleteComment:c,onViewedChange:l}){return(0,G.jsx)(`div`,{className:`pr-diff-surface`,children:e.map((e,o)=>{let s=e.name,u=n.get(s)??[];return(0,G.jsxs)(`div`,{className:`pr-file-block`,children:[(0,G.jsx)(pW,{files:[e],diffStyle:`unified`,tabSizeMap:{},defaultTabSize:4,viewedFiles:r,binaryFiles:new Map,theme:i.theme??`github-dark`,lineDiffType:`none`,lineWrap:!1,diffIndicators:`none`,showLineNumbers:!0,hunkSeparators:`line-numbers`,lineHoverHighlight:`none`,fontSize:i.fontSize??13,monoFontFamily:i.monoFont??`ui-monospace, SFMono-Regular, Menlo, monospace`,expandContextByDefault:!1,collapsedContextThreshold:2**53-1,expansionLineCount:0,onViewedChange:l,fileAnnotationsMap:new Map([[s,t.get(s)??[]]]),onAddComment:(...e)=>{let[t,n,r,i,o,s]=e;a({filePath:t,side:n,lineNumber:r,lineContent:i,body:o,startLineNumber:s})},onDeleteComment:c}),u.length>0&&(0,G.jsxs)(`div`,{className:`pr-existing-strip`,children:[(0,G.jsxs)(`div`,{className:`pr-existing-strip-head`,children:[(0,G.jsx)(aO,{size:11}),(0,G.jsxs)(`span`,{children:[u.length,` existing comment`,u.length===1?``:`s`,` on this file`]})]}),(0,G.jsx)(`ul`,{className:`pr-existing-strip-list`,children:u.map(e=>(0,G.jsxs)(`li`,{className:`pr-existing-strip-item`,children:[(0,G.jsxs)(`div`,{className:`pr-existing-strip-meta`,children:[(0,G.jsxs)(`strong`,{children:[`@`,e.author?.login??`unknown`]}),(0,G.jsx)(`span`,{className:`pr-existing-strip-line`,children:e.line==null?`· file`:`:${e.line}`}),e.state&&(0,G.jsx)(`span`,{className:`pr-existing-strip-state pr-state-${e.state.toLowerCase()}`,children:e.state.toLowerCase().replace(`_`,` `)}),e.replies.length>0&&(0,G.jsxs)(`span`,{className:`pr-existing-strip-replies`,children:[`+`,e.replies.length,` repl`,e.replies.length===1?`y`:`ies`]})]}),(0,G.jsx)(`p`,{className:`pr-existing-strip-body`,children:e.body})]},e.id))})]})]},`${s}-${o}`)})})}function Z0(){let e=jE(),[t,n]=(0,W.useState)(!1);return(0,W.useEffect)(()=>{dD().then(()=>{n(!0)})},[]),t?e===`/plan`||e.startsWith(`/plan/`)?(0,G.jsx)(L0,{}):e===`/gh/pr`||e.startsWith(`/gh/pr/`)?(0,G.jsx)(Y0,{}):(0,G.jsx)(x0,{}):(0,G.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,height:`100vh`,width:`100vw`,background:`#0d1117`,color:`#c9d1d9`,fontFamily:`-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`},children:[(0,G.jsx)(`div`,{style:{width:`32px`,height:`32px`,border:`3px solid rgba(139, 148, 158, 0.15)`,borderTop:`3px solid #58a6ff`,borderRadius:`50%`,animation:`spin 0.8s linear infinite`,marginBottom:`16px`}}),(0,G.jsx)(`span`,{style:{fontSize:`13px`,fontWeight:500,opacity:.75,letterSpacing:`0.3px`},children:`Loading review session...`}),(0,G.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`
|
|
3918
3918
|
@keyframes spin {
|
|
3919
3919
|
0% { transform: rotate(0deg); }
|
|
3920
3920
|
100% { transform: rotate(360deg); }
|
|
3921
3921
|
}
|
|
3922
|
-
`}})]})}var
|
|
3922
|
+
`}})]})}var Q0=new Le;(0,mn.createRoot)(document.getElementById(`root`)).render((0,G.jsx)(He,{client:Q0,children:(0,G.jsx)(ot,{children:(0,G.jsx)(km,{poolOptions:{workerFactory:()=>new A_,poolSize:Math.max(1,Math.min(4,navigator.hardwareConcurrency||2))},highlighterOptions:{theme:{dark:`nord`,light:`github-light`}},children:(0,G.jsx)(QT,{children:(0,G.jsx)(Z0,{})})})})}));export{l as i,o as n,s as r,J as t};
|