termdock 1.4.208 → 1.4.210
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/App-CsLpah-H.js +155 -0
- package/dist/client/assets/App-CsLpah-H.js.br +0 -0
- package/dist/client/assets/App-CsLpah-H.js.gz +0 -0
- package/dist/client/assets/{ChangeWalkthroughPanel-B_1XHfyH.js → ChangeWalkthroughPanel-9pjAhzmc.js} +1 -1
- package/dist/client/assets/ChangeWalkthroughPanel-9pjAhzmc.js.br +0 -0
- package/dist/client/assets/ChangeWalkthroughPanel-9pjAhzmc.js.gz +0 -0
- package/dist/client/assets/{DagPlayground-D-Qim3m-.js → DagPlayground-DrW4_0hZ.js} +1 -1
- package/dist/client/assets/DagPlayground-DrW4_0hZ.js.br +0 -0
- package/dist/client/assets/DagPlayground-DrW4_0hZ.js.gz +0 -0
- package/dist/client/assets/{DiffLab-CqWLAQxv.js → DiffLab-Dj9e4Fc7.js} +1 -1
- package/dist/client/assets/DiffLab-Dj9e4Fc7.js.br +0 -0
- package/dist/client/assets/DiffLab-Dj9e4Fc7.js.gz +0 -0
- package/dist/client/assets/{DiffReview-DAjakI2d.js → DiffReview-B96r7R72.js} +1 -1
- package/dist/client/assets/DiffReview-B96r7R72.js.br +0 -0
- package/dist/client/assets/DiffReview-B96r7R72.js.gz +0 -0
- package/dist/client/assets/{DiffReviewLab-Dgo2Syun.js → DiffReviewLab-D4w5pPtn.js} +1 -1
- package/dist/client/assets/DiffReviewLab-D4w5pPtn.js.br +0 -0
- package/dist/client/assets/DiffReviewLab-D4w5pPtn.js.gz +0 -0
- package/dist/client/assets/{DiffViewer-BVPRo5a-.js → DiffViewer-BnuC5XJ-.js} +1 -1
- package/dist/client/assets/DiffViewer-BnuC5XJ-.js.br +0 -0
- package/dist/client/assets/DiffViewer-BnuC5XJ-.js.gz +0 -0
- package/dist/client/assets/{ModelPreview-heBo6X9C.js → ModelPreview-DzF4OoFj.js} +1 -1
- package/dist/client/assets/ModelPreview-DzF4OoFj.js.br +0 -0
- package/dist/client/assets/ModelPreview-DzF4OoFj.js.gz +0 -0
- package/dist/client/assets/{RightSidebar-Bgmu9z6r.js → RightSidebar-BA-cc-Qe.js} +5 -5
- package/dist/client/assets/RightSidebar-BA-cc-Qe.js.br +0 -0
- package/dist/client/assets/RightSidebar-BA-cc-Qe.js.gz +0 -0
- package/dist/client/assets/{abnfDiagram-VCTEODGH-B0ybOUfH.js → abnfDiagram-VCTEODGH-BZLdU_yA.js} +1 -1
- package/dist/client/assets/abnfDiagram-VCTEODGH-BZLdU_yA.js.br +0 -0
- package/dist/client/assets/abnfDiagram-VCTEODGH-BZLdU_yA.js.gz +0 -0
- package/dist/client/assets/{app-w08cW1Pf.js → app-C3lkifM6.js} +13 -13
- package/dist/client/assets/app-C3lkifM6.js.br +0 -0
- package/dist/client/assets/app-C3lkifM6.js.gz +0 -0
- package/dist/client/assets/{arc-CIdjYTZB.js → arc-DDQgfuy6.js} +1 -1
- package/dist/client/assets/arc-DDQgfuy6.js.br +0 -0
- package/dist/client/assets/arc-DDQgfuy6.js.gz +0 -0
- package/dist/client/assets/{architectureDiagram-5GKGNRK7-CqeUve-3.js → architectureDiagram-5GKGNRK7-D3JZQS6A.js} +1 -1
- package/dist/client/assets/architectureDiagram-5GKGNRK7-D3JZQS6A.js.br +0 -0
- package/dist/client/assets/architectureDiagram-5GKGNRK7-D3JZQS6A.js.gz +0 -0
- package/dist/client/assets/{blockDiagram-I7D4REHJ-BbwUePLS.js → blockDiagram-I7D4REHJ-DHBgrQry.js} +1 -1
- package/dist/client/assets/blockDiagram-I7D4REHJ-DHBgrQry.js.br +0 -0
- package/dist/client/assets/blockDiagram-I7D4REHJ-DHBgrQry.js.gz +0 -0
- package/dist/client/assets/{c4Diagram-7LVT6UL2-3Lf-B2zf.js → c4Diagram-7LVT6UL2-DwrzYgDu.js} +1 -1
- package/dist/client/assets/c4Diagram-7LVT6UL2-DwrzYgDu.js.br +0 -0
- package/dist/client/assets/c4Diagram-7LVT6UL2-DwrzYgDu.js.gz +0 -0
- package/dist/client/assets/channel-CLgKEJq0.js +1 -0
- package/dist/client/assets/{chunk-2Q5K7J3B-Dl_3lTqC.js → chunk-2Q5K7J3B-C5S4S5e5.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-C6g5jGRF.js → chunk-5VM5RSS4-DKcwKBrq.js} +1 -1
- package/dist/client/assets/{chunk-F27PBJKO-BnYahl3X.js → chunk-F27PBJKO-CtWaFdw2.js} +1 -1
- package/dist/client/assets/chunk-F27PBJKO-CtWaFdw2.js.br +0 -0
- package/dist/client/assets/chunk-F27PBJKO-CtWaFdw2.js.gz +0 -0
- package/dist/client/assets/{chunk-IMKFNOWR-CZgqp3pY.js → chunk-IMKFNOWR-eWFqTGPw.js} +1 -1
- package/dist/client/assets/chunk-IMKFNOWR-eWFqTGPw.js.br +0 -0
- package/dist/client/assets/chunk-IMKFNOWR-eWFqTGPw.js.gz +0 -0
- package/dist/client/assets/{chunk-JWPE2WC7-hmEN7EJ7.js → chunk-JWPE2WC7-B1CYKvn5.js} +1 -1
- package/dist/client/assets/{chunk-POPQ4Y6H-D8dnOdIQ.js → chunk-POPQ4Y6H-RzVsVya9.js} +1 -1
- package/dist/client/assets/{chunk-SVP7TREG-luZjAkmy.js → chunk-SVP7TREG-Bw3h4rUk.js} +1 -1
- package/dist/client/assets/chunk-SVP7TREG-Bw3h4rUk.js.br +0 -0
- package/dist/client/assets/chunk-SVP7TREG-Bw3h4rUk.js.gz +0 -0
- package/dist/client/assets/{chunk-TICWLB2K-CqeGGvbc.js → chunk-TICWLB2K-C3Z8kS1S.js} +1 -1
- package/dist/client/assets/chunk-TICWLB2K-C3Z8kS1S.js.br +0 -0
- package/dist/client/assets/chunk-TICWLB2K-C3Z8kS1S.js.gz +0 -0
- package/dist/client/assets/{chunk-XXDRQBXY-DuYuHvU1.js → chunk-XXDRQBXY-C6X3ae-5.js} +1 -1
- package/dist/client/assets/classDiagram-ZZMXUADV-Iy1giMMH.js +1 -0
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-Iy1giMMH.js +1 -0
- package/dist/client/assets/{cose-bilkent-JH36ORCC-D8xEx8g1.js → cose-bilkent-JH36ORCC-Bj0dE671.js} +1 -1
- package/dist/client/assets/cose-bilkent-JH36ORCC-Bj0dE671.js.br +0 -0
- package/dist/client/assets/cose-bilkent-JH36ORCC-Bj0dE671.js.gz +0 -0
- package/dist/client/assets/{cynefin-OW5HDTMX-ckwh3WjG.js → cynefin-OW5HDTMX-BZqIm0V4.js} +1 -1
- package/dist/client/assets/cynefin-OW5HDTMX-BZqIm0V4.js.br +0 -0
- package/dist/client/assets/cynefin-OW5HDTMX-BZqIm0V4.js.gz +0 -0
- package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-9ao5pye-.js → cynefinDiagram-5FMLGOSQ-BtSDof2E.js} +1 -1
- package/dist/client/assets/cynefinDiagram-5FMLGOSQ-BtSDof2E.js.br +0 -0
- package/dist/client/assets/cynefinDiagram-5FMLGOSQ-BtSDof2E.js.gz +0 -0
- package/dist/client/assets/{dagre-GXQ25YYZ-C6CE1ykl.js → dagre-GXQ25YYZ-D_fwVisa.js} +1 -1
- package/dist/client/assets/dagre-GXQ25YYZ-D_fwVisa.js.br +0 -0
- package/dist/client/assets/dagre-GXQ25YYZ-D_fwVisa.js.gz +0 -0
- package/dist/client/assets/{diagram-S7CK7UJ4--qL1dYvJ.js → diagram-S7CK7UJ4-DruZ3tNp.js} +1 -1
- package/dist/client/assets/diagram-S7CK7UJ4-DruZ3tNp.js.br +0 -0
- package/dist/client/assets/diagram-S7CK7UJ4-DruZ3tNp.js.gz +0 -0
- package/dist/client/assets/{diagram-UQ7AKVKN-BuslhIvo.js → diagram-UQ7AKVKN-Bv87b5ES.js} +1 -1
- package/dist/client/assets/diagram-UQ7AKVKN-Bv87b5ES.js.br +0 -0
- package/dist/client/assets/diagram-UQ7AKVKN-Bv87b5ES.js.gz +0 -0
- package/dist/client/assets/{diagram-VSXAHHWV-DxTUUQqI.js → diagram-VSXAHHWV-By4eKfnp.js} +1 -1
- package/dist/client/assets/diagram-VSXAHHWV-By4eKfnp.js.br +0 -0
- package/dist/client/assets/diagram-VSXAHHWV-By4eKfnp.js.gz +0 -0
- package/dist/client/assets/{diagram-VX7I27RA-DEs1ATVe.js → diagram-VX7I27RA-C3sFs7EN.js} +1 -1
- package/dist/client/assets/diagram-VX7I27RA-C3sFs7EN.js.br +0 -0
- package/dist/client/assets/diagram-VX7I27RA-C3sFs7EN.js.gz +0 -0
- package/dist/client/assets/{diagram-Z3DM3KII-b70kacua.js → diagram-Z3DM3KII-BsWhXp08.js} +1 -1
- package/dist/client/assets/diagram-Z3DM3KII-BsWhXp08.js.br +0 -0
- package/dist/client/assets/diagram-Z3DM3KII-BsWhXp08.js.gz +0 -0
- package/dist/client/assets/{ebnfDiagram-PWID7BFC-DSbfkzkN.js → ebnfDiagram-PWID7BFC-DoQKVXP-.js} +1 -1
- package/dist/client/assets/ebnfDiagram-PWID7BFC-DoQKVXP-.js.br +0 -0
- package/dist/client/assets/ebnfDiagram-PWID7BFC-DoQKVXP-.js.gz +0 -0
- package/dist/client/assets/{erDiagram-RLTQ6QDP-CNoYDTIc.js → erDiagram-RLTQ6QDP-BFWWJ5Ou.js} +1 -1
- package/dist/client/assets/erDiagram-RLTQ6QDP-BFWWJ5Ou.js.br +0 -0
- package/dist/client/assets/erDiagram-RLTQ6QDP-BFWWJ5Ou.js.gz +0 -0
- package/dist/client/assets/{flowDiagram-HODETNUW-BDB_I-xB.js → flowDiagram-HODETNUW-DCjkLTmk.js} +1 -1
- package/dist/client/assets/flowDiagram-HODETNUW-DCjkLTmk.js.br +0 -0
- package/dist/client/assets/flowDiagram-HODETNUW-DCjkLTmk.js.gz +0 -0
- package/dist/client/assets/{ganttDiagram-EL5Y4UJY-CwMDECe_.js → ganttDiagram-EL5Y4UJY-Uc4efO5H.js} +1 -1
- package/dist/client/assets/ganttDiagram-EL5Y4UJY-Uc4efO5H.js.br +0 -0
- package/dist/client/assets/ganttDiagram-EL5Y4UJY-Uc4efO5H.js.gz +0 -0
- package/dist/client/assets/{gestureArbiter-CJA17rO2.js → gestureArbiter-CvlW1We6.js} +1 -1
- package/dist/client/assets/gestureArbiter-CvlW1We6.js.br +0 -0
- package/dist/client/assets/gestureArbiter-CvlW1We6.js.gz +0 -0
- package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-DDmCVv3v.js → gitGraphDiagram-WWUBYQGX-00YUDgON.js} +1 -1
- package/dist/client/assets/gitGraphDiagram-WWUBYQGX-00YUDgON.js.br +0 -0
- package/dist/client/assets/gitGraphDiagram-WWUBYQGX-00YUDgON.js.gz +0 -0
- package/dist/client/assets/{index-oKp6kSMR.css → index-ReIvPq_j.css} +1 -1
- package/dist/client/assets/{index-oKp6kSMR.css.br → index-ReIvPq_j.css.br} +0 -0
- package/dist/client/assets/{index-oKp6kSMR.css.gz → index-ReIvPq_j.css.gz} +0 -0
- package/dist/client/assets/{infoDiagram-27XIBGKW-BtsRyqbl.js → infoDiagram-27XIBGKW-DuQms3YY.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-5VMMS53U-DjkAGFq0.js → ishikawaDiagram-5VMMS53U-Cf0OgBhG.js} +1 -1
- package/dist/client/assets/ishikawaDiagram-5VMMS53U-Cf0OgBhG.js.br +0 -0
- package/dist/client/assets/ishikawaDiagram-5VMMS53U-Cf0OgBhG.js.gz +0 -0
- package/dist/client/assets/{journeyDiagram-3NMN7TZE-kavkLqOG.js → journeyDiagram-3NMN7TZE-Gp4r3rCF.js} +1 -1
- package/dist/client/assets/journeyDiagram-3NMN7TZE-Gp4r3rCF.js.br +0 -0
- package/dist/client/assets/journeyDiagram-3NMN7TZE-Gp4r3rCF.js.gz +0 -0
- package/dist/client/assets/{kanban-definition-UXKFOSKX-3dQ9YCbF.js → kanban-definition-UXKFOSKX-C-AKurN1.js} +1 -1
- package/dist/client/assets/kanban-definition-UXKFOSKX-C-AKurN1.js.br +0 -0
- package/dist/client/assets/kanban-definition-UXKFOSKX-C-AKurN1.js.gz +0 -0
- package/dist/client/assets/{layout-BzpJjrk5.js → layout-D-QOmsMi.js} +1 -1
- package/dist/client/assets/layout-D-QOmsMi.js.br +0 -0
- package/dist/client/assets/layout-D-QOmsMi.js.gz +0 -0
- package/dist/client/assets/{linear-CNRLEGU-.js → linear-BeqO_tof.js} +1 -1
- package/dist/client/assets/linear-BeqO_tof.js.br +0 -0
- package/dist/client/assets/linear-BeqO_tof.js.gz +0 -0
- package/dist/client/assets/{mermaid.core-BEQFh9Am.js → mermaid.core-BLtEkDK8.js} +5 -5
- package/dist/client/assets/mermaid.core-BLtEkDK8.js.br +0 -0
- package/dist/client/assets/mermaid.core-BLtEkDK8.js.gz +0 -0
- package/dist/client/assets/{mindmap-definition-YA3MSWOX-3CbAEAeb.js → mindmap-definition-YA3MSWOX-vk40s7Xp.js} +1 -1
- package/dist/client/assets/mindmap-definition-YA3MSWOX-vk40s7Xp.js.br +0 -0
- package/dist/client/assets/mindmap-definition-YA3MSWOX-vk40s7Xp.js.gz +0 -0
- package/dist/client/assets/{passwordBootstrap-DUUe_9vr.js → passwordBootstrap-Di4aP0lT.js} +1 -1
- package/dist/client/assets/passwordBootstrap-Di4aP0lT.js.br +0 -0
- package/dist/client/assets/passwordBootstrap-Di4aP0lT.js.gz +0 -0
- package/dist/client/assets/{pegDiagram-XKGWAZYB-D5TazKod.js → pegDiagram-XKGWAZYB-CkDTWBkF.js} +1 -1
- package/dist/client/assets/pegDiagram-XKGWAZYB-CkDTWBkF.js.br +0 -0
- package/dist/client/assets/pegDiagram-XKGWAZYB-CkDTWBkF.js.gz +0 -0
- package/dist/client/assets/{pieDiagram-E7YTZNPT-CkRXRgMh.js → pieDiagram-E7YTZNPT-QSUx2yJ-.js} +1 -1
- package/dist/client/assets/pieDiagram-E7YTZNPT-QSUx2yJ-.js.br +0 -0
- package/dist/client/assets/pieDiagram-E7YTZNPT-QSUx2yJ-.js.gz +0 -0
- package/dist/client/assets/{quadrantDiagram-AXDQQJYC-iohu0Irx.js → quadrantDiagram-AXDQQJYC-D8wrrCn2.js} +1 -1
- package/dist/client/assets/quadrantDiagram-AXDQQJYC-D8wrrCn2.js.br +0 -0
- package/dist/client/assets/quadrantDiagram-AXDQQJYC-D8wrrCn2.js.gz +0 -0
- package/dist/client/assets/{railroadDiagram-O6MQD6OU-6YtCrfXB.js → railroadDiagram-O6MQD6OU-COf3jWKM.js} +1 -1
- package/dist/client/assets/railroadDiagram-O6MQD6OU-COf3jWKM.js.br +0 -0
- package/dist/client/assets/railroadDiagram-O6MQD6OU-COf3jWKM.js.gz +0 -0
- package/dist/client/assets/{referenceLongPress-CLNL30GV.js → referenceLongPress-CL-_oV1W.js} +1 -1
- package/dist/client/assets/referenceLongPress-CL-_oV1W.js.br +0 -0
- package/dist/client/assets/referenceLongPress-CL-_oV1W.js.gz +0 -0
- package/dist/client/assets/{requirementDiagram-BXWQKSXE-CHkVAq6h.js → requirementDiagram-BXWQKSXE-BBLWeRi-.js} +1 -1
- package/dist/client/assets/requirementDiagram-BXWQKSXE-BBLWeRi-.js.br +0 -0
- package/dist/client/assets/requirementDiagram-BXWQKSXE-BBLWeRi-.js.gz +0 -0
- package/dist/client/assets/{sankeyDiagram-P5KCCOFB-C-BI0Ui3.js → sankeyDiagram-P5KCCOFB-DEmGIxkm.js} +1 -1
- package/dist/client/assets/sankeyDiagram-P5KCCOFB-DEmGIxkm.js.br +0 -0
- package/dist/client/assets/sankeyDiagram-P5KCCOFB-DEmGIxkm.js.gz +0 -0
- package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-BCQPeD3U.js → sequenceDiagram-WJ2MYXX4-B4SUb8S0.js} +1 -1
- package/dist/client/assets/sequenceDiagram-WJ2MYXX4-B4SUb8S0.js.br +0 -0
- package/dist/client/assets/sequenceDiagram-WJ2MYXX4-B4SUb8S0.js.gz +0 -0
- package/dist/client/assets/{sizeCapture-INFHLROL-hA3LN75M.js → sizeCapture-INFHLROL-2a4ZeWnN.js} +1 -1
- package/dist/client/assets/sizeCapture-INFHLROL-2a4ZeWnN.js.br +0 -0
- package/dist/client/assets/sizeCapture-INFHLROL-2a4ZeWnN.js.gz +0 -0
- package/dist/client/assets/{sparkles-D4whT7Uj.js → sparkles-DBi87wGw.js} +1 -1
- package/dist/client/assets/{stateDiagram-D77RDMKH-BKwi9kEJ.js → stateDiagram-D77RDMKH-DVqqTfxD.js} +1 -1
- package/dist/client/assets/stateDiagram-D77RDMKH-DVqqTfxD.js.br +0 -0
- package/dist/client/assets/stateDiagram-D77RDMKH-DVqqTfxD.js.gz +0 -0
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-nVIOT-VV.js +1 -0
- package/dist/client/assets/{swimlanes-42K2YHIH-xN-dGpG2.js → swimlanes-42K2YHIH-C9GqpQYJ.js} +1 -1
- package/dist/client/assets/swimlanes-42K2YHIH-C9GqpQYJ.js.br +0 -0
- package/dist/client/assets/swimlanes-42K2YHIH-C9GqpQYJ.js.gz +0 -0
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-36hPxjFY.js +8 -0
- package/dist/client/assets/{timeline-definition-24CTP7MA-BM-lkbi4.js → timeline-definition-24CTP7MA-CXGCbcAJ.js} +1 -1
- package/dist/client/assets/timeline-definition-24CTP7MA-CXGCbcAJ.js.br +0 -0
- package/dist/client/assets/timeline-definition-24CTP7MA-CXGCbcAJ.js.gz +0 -0
- package/dist/client/assets/{triangle-alert-CKycZLN0.js → triangle-alert-e2w8-tp7.js} +1 -1
- package/dist/client/assets/{vennDiagram-4TSXK5OY-rwFNzPg-.js → vennDiagram-4TSXK5OY-Bn8n3YMo.js} +1 -1
- package/dist/client/assets/vennDiagram-4TSXK5OY-Bn8n3YMo.js.br +0 -0
- package/dist/client/assets/vennDiagram-4TSXK5OY-Bn8n3YMo.js.gz +0 -0
- package/dist/client/assets/{wardleyDiagram-VM6X3IG4-ub5oNGoi.js → wardleyDiagram-VM6X3IG4-BDBTLgbT.js} +1 -1
- package/dist/client/assets/wardleyDiagram-VM6X3IG4-BDBTLgbT.js.br +0 -0
- package/dist/client/assets/wardleyDiagram-VM6X3IG4-BDBTLgbT.js.gz +0 -0
- package/dist/client/assets/{xychartDiagram-S5SC5T6Z-CW3NXIgW.js → xychartDiagram-S5SC5T6Z-B_h_NFjr.js} +1 -1
- package/dist/client/assets/xychartDiagram-S5SC5T6Z-B_h_NFjr.js.br +0 -0
- package/dist/client/assets/xychartDiagram-S5SC5T6Z-B_h_NFjr.js.gz +0 -0
- package/dist/client/index.html +2 -2
- package/dist/client/index.html.br +0 -0
- package/dist/client/index.html.gz +0 -0
- package/dist/client/sw.js +1 -1
- package/dist/client/sw.js.br +0 -0
- package/dist/client/sw.js.gz +0 -0
- package/package.json +1 -1
- package/runtime-manifest.json +2 -2
- package/dist/client/assets/App-BAjxJZ_N.js +0 -155
- package/dist/client/assets/App-BAjxJZ_N.js.br +0 -0
- package/dist/client/assets/App-BAjxJZ_N.js.gz +0 -0
- package/dist/client/assets/ChangeWalkthroughPanel-B_1XHfyH.js.br +0 -0
- package/dist/client/assets/ChangeWalkthroughPanel-B_1XHfyH.js.gz +0 -0
- package/dist/client/assets/DagPlayground-D-Qim3m-.js.br +0 -0
- package/dist/client/assets/DagPlayground-D-Qim3m-.js.gz +0 -0
- package/dist/client/assets/DiffLab-CqWLAQxv.js.br +0 -0
- package/dist/client/assets/DiffLab-CqWLAQxv.js.gz +0 -0
- package/dist/client/assets/DiffReview-DAjakI2d.js.br +0 -0
- package/dist/client/assets/DiffReview-DAjakI2d.js.gz +0 -0
- package/dist/client/assets/DiffReviewLab-Dgo2Syun.js.br +0 -0
- package/dist/client/assets/DiffReviewLab-Dgo2Syun.js.gz +0 -0
- package/dist/client/assets/DiffViewer-BVPRo5a-.js.br +0 -0
- package/dist/client/assets/DiffViewer-BVPRo5a-.js.gz +0 -0
- package/dist/client/assets/ModelPreview-heBo6X9C.js.br +0 -0
- package/dist/client/assets/ModelPreview-heBo6X9C.js.gz +0 -0
- package/dist/client/assets/RightSidebar-Bgmu9z6r.js.br +0 -0
- package/dist/client/assets/RightSidebar-Bgmu9z6r.js.gz +0 -0
- package/dist/client/assets/abnfDiagram-VCTEODGH-B0ybOUfH.js.br +0 -0
- package/dist/client/assets/abnfDiagram-VCTEODGH-B0ybOUfH.js.gz +0 -0
- package/dist/client/assets/app-w08cW1Pf.js.br +0 -0
- package/dist/client/assets/app-w08cW1Pf.js.gz +0 -0
- package/dist/client/assets/arc-CIdjYTZB.js.br +0 -0
- package/dist/client/assets/arc-CIdjYTZB.js.gz +0 -0
- package/dist/client/assets/architectureDiagram-5GKGNRK7-CqeUve-3.js.br +0 -0
- package/dist/client/assets/architectureDiagram-5GKGNRK7-CqeUve-3.js.gz +0 -0
- package/dist/client/assets/blockDiagram-I7D4REHJ-BbwUePLS.js.br +0 -0
- package/dist/client/assets/blockDiagram-I7D4REHJ-BbwUePLS.js.gz +0 -0
- package/dist/client/assets/c4Diagram-7LVT6UL2-3Lf-B2zf.js.br +0 -0
- package/dist/client/assets/c4Diagram-7LVT6UL2-3Lf-B2zf.js.gz +0 -0
- package/dist/client/assets/channel-BRHb1vxd.js +0 -1
- package/dist/client/assets/chunk-F27PBJKO-BnYahl3X.js.br +0 -0
- package/dist/client/assets/chunk-F27PBJKO-BnYahl3X.js.gz +0 -0
- package/dist/client/assets/chunk-IMKFNOWR-CZgqp3pY.js.br +0 -0
- package/dist/client/assets/chunk-IMKFNOWR-CZgqp3pY.js.gz +0 -0
- package/dist/client/assets/chunk-SVP7TREG-luZjAkmy.js.br +0 -0
- package/dist/client/assets/chunk-SVP7TREG-luZjAkmy.js.gz +0 -0
- package/dist/client/assets/chunk-TICWLB2K-CqeGGvbc.js.br +0 -0
- package/dist/client/assets/chunk-TICWLB2K-CqeGGvbc.js.gz +0 -0
- package/dist/client/assets/classDiagram-ZZMXUADV-BMnGIYy0.js +0 -1
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-BMnGIYy0.js +0 -1
- package/dist/client/assets/cose-bilkent-JH36ORCC-D8xEx8g1.js.br +0 -0
- package/dist/client/assets/cose-bilkent-JH36ORCC-D8xEx8g1.js.gz +0 -0
- package/dist/client/assets/cynefin-OW5HDTMX-ckwh3WjG.js.br +0 -0
- package/dist/client/assets/cynefin-OW5HDTMX-ckwh3WjG.js.gz +0 -0
- package/dist/client/assets/cynefinDiagram-5FMLGOSQ-9ao5pye-.js.br +0 -0
- package/dist/client/assets/cynefinDiagram-5FMLGOSQ-9ao5pye-.js.gz +0 -0
- package/dist/client/assets/dagre-GXQ25YYZ-C6CE1ykl.js.br +0 -0
- package/dist/client/assets/dagre-GXQ25YYZ-C6CE1ykl.js.gz +0 -0
- package/dist/client/assets/diagram-S7CK7UJ4--qL1dYvJ.js.br +0 -0
- package/dist/client/assets/diagram-S7CK7UJ4--qL1dYvJ.js.gz +0 -0
- package/dist/client/assets/diagram-UQ7AKVKN-BuslhIvo.js.br +0 -0
- package/dist/client/assets/diagram-UQ7AKVKN-BuslhIvo.js.gz +0 -0
- package/dist/client/assets/diagram-VSXAHHWV-DxTUUQqI.js.br +0 -0
- package/dist/client/assets/diagram-VSXAHHWV-DxTUUQqI.js.gz +0 -0
- package/dist/client/assets/diagram-VX7I27RA-DEs1ATVe.js.br +0 -0
- package/dist/client/assets/diagram-VX7I27RA-DEs1ATVe.js.gz +0 -0
- package/dist/client/assets/diagram-Z3DM3KII-b70kacua.js.br +0 -0
- package/dist/client/assets/diagram-Z3DM3KII-b70kacua.js.gz +0 -0
- package/dist/client/assets/ebnfDiagram-PWID7BFC-DSbfkzkN.js.br +0 -0
- package/dist/client/assets/ebnfDiagram-PWID7BFC-DSbfkzkN.js.gz +0 -0
- package/dist/client/assets/erDiagram-RLTQ6QDP-CNoYDTIc.js.br +0 -0
- package/dist/client/assets/erDiagram-RLTQ6QDP-CNoYDTIc.js.gz +0 -0
- package/dist/client/assets/flowDiagram-HODETNUW-BDB_I-xB.js.br +0 -0
- package/dist/client/assets/flowDiagram-HODETNUW-BDB_I-xB.js.gz +0 -0
- package/dist/client/assets/ganttDiagram-EL5Y4UJY-CwMDECe_.js.br +0 -0
- package/dist/client/assets/ganttDiagram-EL5Y4UJY-CwMDECe_.js.gz +0 -0
- package/dist/client/assets/gestureArbiter-CJA17rO2.js.br +0 -0
- package/dist/client/assets/gestureArbiter-CJA17rO2.js.gz +0 -0
- package/dist/client/assets/gitGraphDiagram-WWUBYQGX-DDmCVv3v.js.br +0 -0
- package/dist/client/assets/gitGraphDiagram-WWUBYQGX-DDmCVv3v.js.gz +0 -0
- package/dist/client/assets/ishikawaDiagram-5VMMS53U-DjkAGFq0.js.br +0 -0
- package/dist/client/assets/ishikawaDiagram-5VMMS53U-DjkAGFq0.js.gz +0 -0
- package/dist/client/assets/journeyDiagram-3NMN7TZE-kavkLqOG.js.br +0 -0
- package/dist/client/assets/journeyDiagram-3NMN7TZE-kavkLqOG.js.gz +0 -0
- package/dist/client/assets/kanban-definition-UXKFOSKX-3dQ9YCbF.js.br +0 -0
- package/dist/client/assets/kanban-definition-UXKFOSKX-3dQ9YCbF.js.gz +0 -0
- package/dist/client/assets/layout-BzpJjrk5.js.br +0 -0
- package/dist/client/assets/layout-BzpJjrk5.js.gz +0 -0
- package/dist/client/assets/linear-CNRLEGU-.js.br +0 -0
- package/dist/client/assets/linear-CNRLEGU-.js.gz +0 -0
- package/dist/client/assets/mermaid.core-BEQFh9Am.js.br +0 -0
- package/dist/client/assets/mermaid.core-BEQFh9Am.js.gz +0 -0
- package/dist/client/assets/mindmap-definition-YA3MSWOX-3CbAEAeb.js.br +0 -0
- package/dist/client/assets/mindmap-definition-YA3MSWOX-3CbAEAeb.js.gz +0 -0
- package/dist/client/assets/passwordBootstrap-DUUe_9vr.js.br +0 -0
- package/dist/client/assets/passwordBootstrap-DUUe_9vr.js.gz +0 -0
- package/dist/client/assets/pegDiagram-XKGWAZYB-D5TazKod.js.br +0 -0
- package/dist/client/assets/pegDiagram-XKGWAZYB-D5TazKod.js.gz +0 -0
- package/dist/client/assets/pieDiagram-E7YTZNPT-CkRXRgMh.js.br +0 -0
- package/dist/client/assets/pieDiagram-E7YTZNPT-CkRXRgMh.js.gz +0 -0
- package/dist/client/assets/quadrantDiagram-AXDQQJYC-iohu0Irx.js.br +0 -0
- package/dist/client/assets/quadrantDiagram-AXDQQJYC-iohu0Irx.js.gz +0 -0
- package/dist/client/assets/railroadDiagram-O6MQD6OU-6YtCrfXB.js.br +0 -0
- package/dist/client/assets/railroadDiagram-O6MQD6OU-6YtCrfXB.js.gz +0 -0
- package/dist/client/assets/referenceLongPress-CLNL30GV.js.br +0 -0
- package/dist/client/assets/referenceLongPress-CLNL30GV.js.gz +0 -0
- package/dist/client/assets/requirementDiagram-BXWQKSXE-CHkVAq6h.js.br +0 -0
- package/dist/client/assets/requirementDiagram-BXWQKSXE-CHkVAq6h.js.gz +0 -0
- package/dist/client/assets/sankeyDiagram-P5KCCOFB-C-BI0Ui3.js.br +0 -0
- package/dist/client/assets/sankeyDiagram-P5KCCOFB-C-BI0Ui3.js.gz +0 -0
- package/dist/client/assets/sequenceDiagram-WJ2MYXX4-BCQPeD3U.js.br +0 -0
- package/dist/client/assets/sequenceDiagram-WJ2MYXX4-BCQPeD3U.js.gz +0 -0
- package/dist/client/assets/sizeCapture-INFHLROL-hA3LN75M.js.br +0 -0
- package/dist/client/assets/sizeCapture-INFHLROL-hA3LN75M.js.gz +0 -0
- package/dist/client/assets/stateDiagram-D77RDMKH-BKwi9kEJ.js.br +0 -0
- package/dist/client/assets/stateDiagram-D77RDMKH-BKwi9kEJ.js.gz +0 -0
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-CSGxt0x1.js +0 -1
- package/dist/client/assets/swimlanes-42K2YHIH-xN-dGpG2.js.br +0 -0
- package/dist/client/assets/swimlanes-42K2YHIH-xN-dGpG2.js.gz +0 -0
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-BBkYptnY.js +0 -8
- package/dist/client/assets/timeline-definition-24CTP7MA-BM-lkbi4.js.br +0 -0
- package/dist/client/assets/timeline-definition-24CTP7MA-BM-lkbi4.js.gz +0 -0
- package/dist/client/assets/vennDiagram-4TSXK5OY-rwFNzPg-.js.br +0 -0
- package/dist/client/assets/vennDiagram-4TSXK5OY-rwFNzPg-.js.gz +0 -0
- package/dist/client/assets/wardleyDiagram-VM6X3IG4-ub5oNGoi.js.br +0 -0
- package/dist/client/assets/wardleyDiagram-VM6X3IG4-ub5oNGoi.js.gz +0 -0
- package/dist/client/assets/xychartDiagram-S5SC5T6Z-CW3NXIgW.js.br +0 -0
- package/dist/client/assets/xychartDiagram-S5SC5T6Z-CW3NXIgW.js.gz +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ModelPreview-
|
|
2
|
-
import{Z as yt,R as ih,aT as e,
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ModelPreview-DzF4OoFj.js","assets/app-C3lkifM6.js","assets/react-XDCjal2T.js","assets/dnd-BCFAPC0L.js","assets/terminal-C7X98Amf.js","assets/index-ReIvPq_j.css","assets/App-CsLpah-H.js","assets/gestureArbiter-CvlW1We6.js","assets/gestureArbiter-C2J0D0kV.css","assets/referenceLongPress-CL-_oV1W.js","assets/triangle-alert-e2w8-tp7.js","assets/DiffReview-B96r7R72.js","assets/sparkles-DBi87wGw.js","assets/DiffViewer-BnuC5XJ-.js","assets/DiffViewer-T3uj2-aP.css","assets/ChangeWalkthroughPanel-9pjAhzmc.js","assets/katex-55ZPZeOF.css","assets/mermaid.core-BLtEkDK8.js","assets/purify.es-4eNOHKSq.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{Z as yt,R as ih,aT as e,c7 as pt,cd as vt,b7 as tt,a as Ns,aw as lh,C as gi,c as Ms,X as Ut,c5 as ch,aJ as dh,u as ps,ab as uh,c9 as te,aN as fh,aP as Oi,aQ as hh,aR as Ed,aO as gs,al as mh,E as ph,M as gh,aM as bh,b8 as xh,ba as vh,bb as yh,aE as wh,b9 as _c,t as xt,e as kh,L as at,q as Sh,b as jh,aD as Dc,ai as Fc,ag as Rh,ap as Ca,aq as Bc,ce as Ss,a9 as bs,ar as Ch,c6 as Yo,b2 as Nh,ak as Mh,c3 as $h,bA as Eh,at as Lh,G as Oc,F as Ah,ah as Ph,aj as Th,an as Uc,bC as Ih,o as _h,d as Na,f as bi,r as Ld,a5 as Dh,_ as $s,bu as Fh,cc as Bh,a_ as Oh,a7 as Uh}from"./app-C3lkifM6.js";import{b as o,r as Gr}from"./dnd-BCFAPC0L.js";import{w as Hh,f as zh,n as Ba,d as Wh,P as Gh,i as qh,R as xi,o as Ad,p as Kh,S as qn,D as Vh,c as Pd,a as Yh,v as Td,t as Hc,s as Ma,q as Xh,r as Jh,u as Qh,T as zc,C as Wc,h as Xo,g as $a,b as Zh,k as em,e as tm,l as rm,F as Gc}from"./App-CsLpah-H.js";import{a as nm,S as sm,b as Id,c as vi,F as am}from"./gestureArbiter-CvlW1We6.js";import{D as yi,C as js,L as _d,f as om,n as im}from"./DiffReview-B96r7R72.js";import{T as lm,L as za}from"./triangle-alert-e2w8-tp7.js";import{S as Es}from"./sparkles-DBi87wGw.js";import{C as Dd,a as Fd,M as Bd,G as Mr}from"./ChangeWalkthroughPanel-9pjAhzmc.js";import{r as Od,s as Ud,l as Hd,u as cm,G as zd,h as Wd}from"./DiffViewer-BnuC5XJ-.js";import{u as Gd}from"./referenceLongPress-CL-_oV1W.js";const dm=[["path",{d:"m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16",key:"d5nyq2"}],["path",{d:"M22 9v7",key:"pvm9v3"}],["path",{d:"M3.304 13h6.392",key:"1q3zxz"}],["circle",{cx:"18.5",cy:"12.5",r:"3.5",key:"z97x68"}]],um=yt("case-sensitive",dm);const fm=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],hm=yt("eye-off",fm);const mm=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],wi=yt("eye",mm);const pm=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ki=yt("file-text",pm);const gm=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],qc=yt("house",gm);const bm=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],xm=yt("image-plus",bm);const vm=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],ym=yt("maximize",vm);const wm=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],km=yt("minimize",wm);const Sm=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],jm=yt("pencil-line",Sm);const Rm=[["path",{d:"M17 3v10",key:"15fgeh"}],["path",{d:"m12.67 5.5 8.66 5",key:"1gpheq"}],["path",{d:"m12.67 10.5 8.66-5",key:"1dkfa6"}],["path",{d:"M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z",key:"swwfx4"}]],Cm=yt("regex",Rm);const Nm=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Mm=yt("rotate-cw",Nm);const $m=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]],Em=yt("scan",$m);const Lm=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Kc=yt("send",Lm);const Am=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Pm=yt("upload",Am);const Tm=[["circle",{cx:"7",cy:"12",r:"3",key:"12clwm"}],["path",{d:"M10 9v6",key:"17i7lo"}],["circle",{cx:"17",cy:"12",r:"3",key:"gl7c2s"}],["path",{d:"M14 7v8",key:"dl84cr"}],["path",{d:"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1",key:"lt2kga"}]],Im=yt("whole-word",Tm);function _m(t,n,s){try{const l=t instanceof HTMLImageElement?t.naturalWidth:t.width,d=t instanceof HTMLImageElement?t.naturalHeight:t.height;if(!l||!d)return Promise.resolve(null);const c=t instanceof HTMLImageElement?1400/Math.max(l,d):Math.min(1,1400/Math.max(l,d)),h=document.createElement("canvas");h.width=Math.max(1,Math.round(l*c)),h.height=Math.max(1,Math.round(d*c));const m=h.getContext("2d");if(!m)return Promise.resolve(null);const g=getComputedStyle(document.documentElement);if(m.fillStyle=g.getPropertyValue("--surface").trim()||"white",m.fillRect(0,0,h.width,h.height),m.drawImage(t,0,0,h.width,h.height),s){const p=Math.max(10,Math.min(16,h.width/35));m.font=`${p}px sans-serif`;const f=[];let k="";for(const y of s.split(" "))k&&m.measureText(`${k} ${y}`).width>h.width-20?(f.push(k),k=y):k=k?`${k} ${y}`:y;k&&f.push(k),m.fillStyle=g.getPropertyValue("--surface").trim()||"white",m.fillRect(0,0,h.width,f.length*(p+4)+12),m.fillStyle=g.getPropertyValue("--foreground").trim()||"black",f.forEach((y,N)=>m.fillText(y,10,8+p+N*(p+4)))}if(n){const p=n.xPercent*h.width/100,f=n.yPercent*h.height/100,k=Math.max(4,Math.min(12,Math.min(h.width,h.height)*.015)),y=k*1.6;m.strokeStyle=g.getPropertyValue("--primary").trim()||"black",m.lineWidth=Math.max(1,k/3),m.beginPath(),m.arc(p,f,k,0,Math.PI*2),m.stroke(),m.beginPath(),m.moveTo(p-y,f),m.lineTo(p+y,f),m.moveTo(p,f-y),m.lineTo(p,f+y),m.stroke()}return new Promise(p=>h.toBlob(p,"image/png"))}catch{return Promise.resolve(null)}}function Dm(t,n,s,l){return[t.trim(),n.trim(),l?`截图:${l}`:""].filter(Boolean).join(`
|
|
3
3
|
`)}function $b(t,n,s){const l=n*Math.PI/360,d=Math.min(l,Math.atan(Math.tan(l)*Math.max(s,.05)));return Math.max(t,1e-6)/Math.sin(d)*1.15}async function Fm(t,n,s,l){if(!s?.snapshot){l.isCurrent()&&l.insert(t,n);return}const d=new Date().toISOString(),c=new AbortController;let h,m;try{m=await Promise.race([(async()=>{const g=await s.snapshot;if(!(!g||c.signal.aborted||!l.isCurrent()))return l.upload(new File([g],`termdock-review-${crypto.randomUUID()}.png`,{type:"image/png"}),c.signal)})(),new Promise(g=>{h=setTimeout(()=>{c.abort(),g(void 0)},3e3)})])}catch{}finally{clearTimeout(h),c.abort()}l.isCurrent()&&l.insert(m?Dm(t,"",d,m):t,n)}function Bm(t){let n=1,s="terminal";for(;;){let l=!1;for(const d of t.values())if(d.name===s){l=!0;break}if(!l)break;s=`terminal-${n}`,n++}return s}const Vc=ih((t,n)=>({sessions:new Map,activeSessionId:null,nextSessionNumber:1,createSession:s=>{const l=Hh(),d=Date.now(),c=n().sessions,h=Bm(c),m={id:l,cwd:s,sessionId:null,name:h,customName:!1,createdAt:d,lastActivity:d};return t(g=>{const p=new Map(g.sessions);return p.set(l,m),{sessions:p,activeSessionId:g.activeSessionId??l,nextSessionNumber:g.nextSessionNumber+1}}),l},closeSession:s=>{t(l=>{const d=new Map(l.sessions),c=l.activeSessionId===s;d.delete(s);let h=l.activeSessionId;if(c){const m=Array.from(d.keys());h=m.length>0?m[0]:null}return{sessions:d,activeSessionId:h}})},switchSession:s=>{t(l=>l.sessions.has(s)?{activeSessionId:s}:l)},updateSession:(s,l)=>{t(d=>{const c=d.sessions.get(s);if(!c)return d;const h=new Map(d.sessions);return h.set(s,{...c,...l,lastActivity:Date.now()}),{sessions:h}})},setTerminalSession:(s,l)=>{n().updateSession(s,{sessionId:l.sessionId})},getActiveSession:()=>{const s=n();if(s.activeSessionId)return s.sessions.get(s.activeSessionId)},getSessionCount:()=>n().sessions.size,clearAllSessions:()=>{t({sessions:new Map,activeSessionId:null,nextSessionNumber:1})}}));function Om(t,n){return t===n||n.endsWith(`/${t}`)||t.endsWith(`/${n}`)}function Yc(t,n){return`${t??""}\0${n}`}function Um(t,n,s){if(!t||t.length===0||!s)return{explained:0,stale:0};const l=Yc(n,s);let d=0,c=0;for(const h of t){const m=[h.filePath,h.newPath,h.oldPath].filter(p=>typeof p=="string"&&p.length>0);(m.some(p=>Yc(h.repoRoot,p)===l)||m.some(p=>Om(p,s)))&&(d+=1)}return{explained:d,stale:c}}function Hm({status:t}){if(!t)return null;const n=t.stale>0&&t.explained===0;if(!(t.explained>0||t.stale>0))return null;const l=n?"AI audit explanation is stale":"AI audit explanation available";return e.jsx("span",{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full ${n?"bg-[color:var(--warning)]/15 text-[color:var(--warning)]":"bg-accent/10 text-accent"}`,title:l,"aria-label":l,children:n?e.jsx(lm,{size:10}):e.jsx(Es,{size:10})})}function Si({changeStatus:t,auditStatus:n,renderChangeBadge:s}){return e.jsxs("span",{className:"inline-flex items-center gap-1",children:[s(t),e.jsx(Hm,{status:n})]})}const qd="termdock:right-sidebar:diff-change-list-mode:v1";function zm(t){return t==="list"||t==="tree"}function Wm(){return tt(qd,zm)??"tree"}function Gm(t){for(const l of t){const d=l.hunk;if(d.oldPath&&d.newPath&&d.oldPath!==d.newPath)return"renamed";if(!d.oldPath&&d.newPath)return"added";if(d.oldPath&&!d.newPath)return"deleted"}const n=t.some(l=>l.hunk.additions>0),s=t.some(l=>l.hunk.deletions>0);return n&&!s?"added":!n&&s?"deleted":"modified"}function qm(t){const n=new Map;for(const l of t){const d=n.get(l.hunk.filePath)??{key:l.hunk.filePath,filePath:l.hunk.filePath,items:[],additions:0,deletions:0,explained:0,stale:0,changeType:"modified"};d.items.push(l),d.additions+=l.hunk.additions,d.deletions+=l.hunk.deletions,l.current&&(d.explained+=1),l.stale&&(d.stale+=1),n.set(l.hunk.filePath,d)}const s=Array.from(n.values()).sort((l,d)=>l.filePath.localeCompare(d.filePath));for(const l of s)l.changeType=Gm(l.items);return s}function Km(t){const n=t.filePath.split("/").pop()??t.filePath;return{key:t.key,path:t.filePath,displayName:n,displayDir:t.filePath.includes("/")?t.filePath.slice(0,-n.length-1):"",status:t.changeType,title:t.filePath}}function Vm(t,n){const s=t.filter(c=>c.trim().length>0);if(s.length<=1)return s[0]??"";const l=[],d=new Set;for(const[c,h]of s.entries()){const m=h.split(`
|
|
4
4
|
`),g=m.findIndex(k=>k.startsWith("@@ "));if(g<0){l.push(...m);continue}c===0&&l.push(...m.slice(0,g));const p=n[c];let f=g;for(;f>=0&&f<m.length;){const k=m.findIndex((E,$)=>$>f&&E.startsWith("@@ ")),y=k>=0?k:m.length,N=m.slice(f,y),_=N[0]??"",D=p?_===p:!0,B=_||p||N.join(`
|
|
5
5
|
`);D&&!d.has(B)&&(l.push(...N),d.add(B)),f=k}}return l.join(`
|
|
@@ -1635,12 +1635,12 @@ function installPreviewRuntime(capability, base, externalOrigins, shimUrl) {
|
|
|
1635
1635
|
`,La="/api/terminal/fs/preview/",Ep=8*1024*1024,Lp=32*1024*1024,Ap=128,Pp="data:,";function Nt(t){throw new Error(t)}function Tp(t){return JSON.stringify(t).replace(/</g,"\\u003c")}async function ed(t,n,s){let l="",d=0;for(const c of t.matchAll(n))l+=t.slice(d,c.index)+await s(c),d=c.index+c[0].length;return l+t.slice(d)}async function Jd(t,n){const s=n.origin??location.origin,l=new URL(t,s);(l.origin!==s||!ps(l.pathname)?.startsWith(La))&&Nt("预览地址不是有效的本地文件入口");const d=crypto.randomUUID(),c=`https://termdock-preview.invalid/${d}/`,h=[],m=G=>{!h.includes(G)&&h.length<20&&h.push(G)},g=new Set,p=[],f=new Set,k=new Map,y=new Map;let N=0,_=!1;const D=new Set,B=()=>{_=!0;for(const G of[...D])G();g.clear(),p.length=0};async function E(G){G.ok||Nt(`预览资源读取失败(${G.status})`);const J=G.body?.getReader(),M=[];let F=0;try{if(J)for(;;){const oe=await J.read();if(oe.done)break;F+=oe.value.byteLength,N+=oe.value.byteLength,(F>Ep||N>Lp)&&Nt("预览资源超出大小限制"),M.push(oe.value)}}catch(oe){throw await J?.cancel().catch(()=>{}),oe}finally{J?.releaseLock()}const K=new Uint8Array(F);let re=0;for(const oe of M)K.set(oe,re),re+=oe.length;return{bytes:K,type:G.headers.get("content-type")??"application/octet-stream",status:G.status}}let $=l,L;for(let G=0;G<4;G++){const J=await n.fetch($.pathname+$.search,{signal:n.signal,redirect:"manual"});if(![301,302,303,307,308].includes(J.status)){L=J;break}const M=J.headers.get("location");await J.body?.cancel(),M||Nt("预览重定向缺少目标");const F=new URL(M,$);(F.origin!==s||!ps(F.pathname)?.startsWith(La))&&Nt("预览重定向越出文件范围"),$=F}L||Nt("预览重定向次数过多");const A=ps($.pathname),O=A.slice(La.length).split("/");/^[a-f0-9]{32}$/.test(O[0])||Nt("服务未提供有效的预览资源授权");const I=ps(l.pathname).slice(La.length).split("/");/^[a-f0-9]{32}$/.test(I[0])&&I.shift(),I.join("/").replace(/\/$/,"")!==O.slice(1).join("/").replace(/\/$/,"")&&Nt("预览重定向改变了文件范围");const a=A.endsWith("/")?A:A.slice(0,A.lastIndexOf("/")+1),w=new URL($.pathname.endsWith("/")?$.pathname:$.pathname.slice(0,$.pathname.lastIndexOf("/")+1),s);function U(G,J){const M=new URL(G,J);return M.origin!==s?null:(ps(M.pathname)?.startsWith(a)||Nt("已阻止预览访问目录之外的资源"),M)}function j(G){const J=new URL(G,c);(J.origin!==new URL(c).origin||!J.pathname.startsWith(new URL(c).pathname))&&Nt("已阻止预览访问服务接口或目录之外的资源");const M=J.pathname.slice(new URL(c).pathname.length)+J.search;return U(M,w)??Nt("预览资源无效")}function X(G){const J=G.pathname+G.search,M=k.get(J);if(M)return M;if(_||n.signal?.aborted)return Promise.reject(new Error("预览已关闭"));if(k.size>=Ap)return Promise.reject(new Error("预览资源数量超出限制"));const F=n.fetch(J,{signal:n.signal,redirect:"manual"}).then(E);return k.set(J,F),F}function ne(G,J){_&&Nt("预览已关闭");const M=`termdock-resource-${d}-${p.length}`;return p.push({token:M,data:G,type:J}),g.add(M),M}async function ae(G,J,M,F=new Set){if(!G||G.startsWith("#")||/^data:(?:image|font)\//i.test(G)&&M==="resource")return G;try{const K=U(G,J);if(!K){const Re=new URL(G,J);return(Re.protocol!=="https:"||Re.username||Re.password||Re.origin===new URL(c).origin)&&Nt("已阻止不安全的外部资源"),f.add(Re.origin),Re.href}const re=`${M}:${K.href}`;(F.has(re)||F.size>=8)&&Nt("预览资源存在循环或过深引用");const oe=y.get(re);if(oe)return oe;const he=new Set(F);he.add(re);const me=(async()=>{const Re=await X(K);return M==="css"?ne(await fe(new TextDecoder().decode(Re.bytes),K,he),"text/css"):M==="script"?ne(Re.bytes,"text/javascript"):ne(Re.bytes,Re.type)})();return y.set(re,me),await me}catch(K){return m(K instanceof Error?K.message:"部分预览资源未能加载"),Pp}}async function fe(G,J,M){return G=await ed(G,/@import\s+(?:url\(\s*)?["']([^"']+)["']\s*\)?([^;]*);/gi,async F=>`@import url("${await ae(F[1],J,"css",M)}")${F[2]};`),ed(G,/url\(\s*(?:"([^"]*)"|'([^']*)'|([^)]*))\s*\)/gi,async F=>{const K=(F[1]??F[2]??F[3]).trim();return g.has(K)?F[0]:`url("${await ae(K,J,"resource",M)}")`})}try{const G=await E(L),J=ne(Mp,"text/javascript"),M=new DOMParser().parseFromString(new TextDecoder().decode(G.bytes),"text/html");M.querySelectorAll("base,meta[http-equiv],iframe,frame,object,embed").forEach(C=>C.remove());for(const C of M.querySelectorAll("*")){if(C.removeAttribute("ping"),C.removeAttribute("srcdoc"),C.hasAttribute("style")&&C.setAttribute("style",await fe(C.getAttribute("style"),$,new Set)),C.tagName==="STYLE"&&(C.textContent=await fe(C.textContent??"",$,new Set)),C.tagName==="A"||C.tagName==="AREA"){const Z=C.getAttribute("href");try{if(Z&&!Z.startsWith("#")){const de=U(Z,$);if(de)C.setAttribute("href",new URL(de.pathname.slice(w.pathname.length)+de.search+de.hash,c).href);else{const Le=new URL(Z,$);if(Le.protocol!=="https:"){C.removeAttribute("href");continue}f.add(Le.origin),C.setAttribute("href",Le.href)}}}catch(de){C.removeAttribute("href"),m(de instanceof Error?de.message:"预览链接无法加载")}}for(const Z of["data","manifest"])C.removeAttribute(Z);if(C.tagName==="SCRIPT"&&C.getAttribute("type")==="module"){C.setAttribute("type","module-shim");const Z=C.getAttribute("src");if(Z){const de=U(Z,$);if(de)C.setAttribute("src",new URL(de.pathname.slice(w.pathname.length)+de.search,c).href);else{const Le=new URL(Z,$);if(Le.protocol!=="https:"){C.remove();continue}f.add(Le.origin),C.setAttribute("src",Le.href)}}continue}if(C.tagName==="SCRIPT"&&C.getAttribute("type")==="importmap"){C.setAttribute("type","importmap-shim");continue}if(C.tagName==="LINK"){const Z=(C.getAttribute("rel")??"").toLowerCase();if(!["stylesheet","icon"].includes(Z)){C.remove();continue}const de=C.getAttribute("href");de&&C.setAttribute("href",await ae(de,$,Z==="stylesheet"?"css":"resource"))}if(C.hasAttribute("src")&&C.setAttribute("src",await ae(C.getAttribute("src"),$,C.tagName==="SCRIPT"?"script":"resource")),C.hasAttribute("poster")&&C.setAttribute("poster",await ae(C.getAttribute("poster"),$,"resource")),C.hasAttribute("srcset")){const Z=C.getAttribute("srcset");/data:/i.test(Z)?(C.removeAttribute("srcset"),m("混合内嵌图片候选暂不支持安全预览")):C.setAttribute("srcset",(await Promise.all(Z.split(",").map(async de=>{const[Le,...We]=de.trim().split(/\s+/);return`${await ae(Le,$,"resource")} ${We.join(" ")}`}))).join(", "))}C.setAttribute("referrerpolicy","no-referrer"),C.removeAttribute("integrity"),C.removeAttribute("crossorigin")}const F=[...f].join(" "),K=M.createElement("meta");K.httpEquiv="Content-Security-Policy",K.content=`default-src 'none'; script-src 'unsafe-inline' 'wasm-unsafe-eval' blob: ${F}; style-src 'unsafe-inline' blob: ${F}; img-src blob: data: ${F}; font-src blob: data: ${F}; media-src blob: data: ${F}; connect-src blob: ${F} ${[...f].map(C=>C.replace(/^https:/,"wss:")).join(" ")}; worker-src blob:; frame-src 'none'; object-src 'none'; base-uri https://termdock-preview.invalid; form-action 'none'`;const re=M.createElement("base");re.href=c;const oe=M.createElement("meta");oe.name="referrer",oe.content="no-referrer";const he=M.createElement("script");he.textContent=$p+`
|
|
1636
1636
|
installPreviewRuntime(`+[d,c,[...f],J].map(Tp).join(",")+");";const me=M.createElement("script");me.src=J,M.head.prepend(K,oe,re,he,me);const Re=`<!doctype html>
|
|
1637
1637
|
`+M.documentElement.outerHTML;return{html:Re,shellUrl:`/preview-shell.html#${d}`,errors:h,attach(C,Z){const de=new Set,Le=De=>{if(De.source!==C.contentWindow||De.data?.capability!==d)return;if(De.data.type==="preview-ready"){C.contentWindow?.postMessage({type:"preview-init",capability:d,html:Re,resources:p},"*");return}if(De.data.type==="preview-error"){Z("部分动态内容被安全预览限制");return}if(De.data.type==="preview-navigate"){(async()=>{const se=j(String(De.data.url)),S=await Jd(se.pathname+se.search,n);if(_){S.dispose();return}const V=S.attach(C,Z);D.add(()=>{V(),S.dispose()}),C.src=S.shellUrl.replace("#","?navigation="+crypto.randomUUID()+"#")})().catch(se=>Z(se instanceof Error?se.message:"无法打开预览页面"));return}if(De.data.type==="preview-external"){try{const se=new URL(String(De.data.url));se.protocol==="https:"&&f.has(se.origin)&&window.open(se.href,"_blank","noopener,noreferrer")}catch{}return}if(De.data.type!=="preview-fetch"||De.ports.length!==1)return;const le=De.ports[0];if(de.size>=8||!["GET","HEAD"].includes(De.data.method)){le.postMessage({error:"预览仅允许读取已授权目录资源"}),le.close();return}de.add(le),(async()=>{const se=j(String(De.data.url)),S=await X(se);if(!de.has(le)||_)return;const V=De.data.method==="HEAD"?new Uint8Array:S.bytes.slice();le.postMessage({status:S.status,headers:{"content-type":S.type},data:V.buffer},[V.buffer])})().catch(()=>{le.postMessage({error:"预览资源不在授权范围或无法加载"}),Z("部分动态资源不可用或超出预览目录")}).finally(()=>{de.delete(le),le.close()})};window.addEventListener("message",Le);const We=()=>{window.removeEventListener("message",Le);for(const De of de)De.close();de.clear(),D.delete(We)};return D.add(We),We},dispose:B}}catch(G){throw B(),G}}const Ip=o.forwardRef(function({src:n,title:s,exitFullscreenLabel:l,onFullscreenChange:d},c){const h=o.useRef(null),[m,g]=o.useState(null),[p,f]=o.useState(),[k,y]=o.useState("");o.useEffect(()=>{const A=new AbortController;let O;return f(void 0),y(""),(async()=>{const I=await uh();if(O=await Jd(n,{fetch:(a,w)=>I.fetch(a,w),signal:A.signal}),A.signal.aborted){O.dispose();return}f(O),O.errors.length&&y(O.errors.join(";"))})().catch(I=>{A.signal.aborted||y(I instanceof Error?I.message:"安全预览加载失败")}),()=>{A.abort(),O?.dispose()}},[n]),o.useEffect(()=>{if(!(!p||!m))return p.attach(m,y)},[p,m]);const[N,_]=o.useState(!1),[D,B]=o.useState(!1),E=N||D;o.useEffect(()=>{d?.(E)},[E,d]),o.useEffect(()=>{const A=()=>{_(document.fullscreenElement===h.current)};return document.addEventListener("fullscreenchange",A),()=>document.removeEventListener("fullscreenchange",A)},[]),o.useEffect(()=>{if(!D)return;const A=O=>{O.key==="Escape"&&B(!1)};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[D]);const $=o.useCallback(async()=>{const A=h.current;if(A){if(D){B(!1);return}if(document.fullscreenElement===A){await document.exitFullscreen();return}if(A.requestFullscreen&&document.fullscreenEnabled!==!1)try{await A.requestFullscreen();return}catch{}B(!0)}},[D]);o.useImperativeHandle(c,()=>({toggleFullscreen:$}),[$]);const L=e.jsxs("div",{ref:h,"data-html-preview-frame":!0,className:E?"fixed inset-0 z-modal-panel flex min-h-0 flex-col overflow-hidden bg-surface pt-[env(safe-area-inset-top,0px)] text-foreground":"flex h-full min-h-0 flex-col overflow-hidden bg-surface",children:[E&&e.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between gap-3 border-b border-border/15 bg-[var(--chrome-bg)] px-3",children:[e.jsx("span",{className:"min-w-0 truncate text-[12px] font-semibold",children:s}),e.jsx("button",{type:"button",onClick:()=>{$()},"aria-label":l,title:`${l} (Esc)`,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-surface-2 text-muted-foreground transition hover:bg-surface-elevated hover:text-foreground active:scale-95",children:e.jsx(Fd,{size:15})})]}),k&&e.jsx("div",{role:"status",className:"shrink-0 border-b border-border px-3 py-2 text-xs text-muted-foreground",children:k}),!p&&!k&&e.jsx("div",{role:"status",className:"p-3 text-xs text-muted-foreground",children:"正在安全加载预览资源…"}),e.jsx("iframe",{ref:g,src:p?.shellUrl,referrerPolicy:"no-referrer",title:s,sandbox:"allow-scripts",className:"block min-h-0 w-full flex-1 border-0 bg-white"})]});return D?Gr.createPortal(L,document.body):L}),Qd="termdock-file-search-match",Ci="termdock-file-search-current";function _p(t){const n=t.metaKey||t.ctrlKey,s=t.key.toLocaleLowerCase();return n&&s==="f"?"open":n&&s==="g"||t.key==="F3"?t.shiftKey?"previous":"next":t.key==="Escape"?"close":null}function Dp(t){return t.parentElement?.closest("[data-markdown-preview-block-start], [data-file-preview-line]")??null}function Fp(t,n){const s=n.trim().toLocaleLowerCase();if(!s)return[];const l=[];let d="",c=null;const h=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(let f=h.nextNode();f;f=h.nextNode()){if(!(f instanceof Text)||!f.data)continue;const k=Dp(f);if(!k)continue;c&&c!==k&&(d+=`
|
|
1638
|
-
`);const y=d.length;d+=f.data,l.push({node:f,start:y,end:d.length,group:k}),c=k}const m=d.toLocaleLowerCase(),g=[];let p=0;for(;p<=m.length-s.length;){const f=m.indexOf(s,p);if(f<0)break;const k=f+s.length,y=l.find(_=>_.start<=f&&_.end>f),N=l.find(_=>_.start<k&&_.end>=k);if(y&&N&&y.group===N.group){const _=document.createRange();_.setStart(y.node,f-y.start),_.setEnd(N.node,k-N.start),g.push(_)}p=f+Math.max(s.length,1)}return g}function Zd(){return typeof CSS<"u"&&CSS.highlights?CSS.highlights:null}function Aa(){const t=Zd();t?.delete(Qd),t?.delete(Ci)}function td(t,n){const s=Zd();if(!s||typeof Highlight>"u")return;s.set(Qd,new Highlight(...t));const l=t[n];l?s.set(Ci,new Highlight(l)):s.delete(Ci)}function rd(t){t?.startContainer.parentElement?.scrollIntoView({block:"center",inline:"nearest",behavior:"smooth"})}function Bp(t){return Array.from(new Set(t.split(/[\n,]/).map(n=>n.trim().replace(/^!+/,"")).filter(Boolean))).slice(0,24)}function Op(t,n){const s=n.trim();return!s||s==="."?t:/^(?:[/\\]|[A-Za-z]:[/\\])/.test(s)?s.replace(/[\\/]+$/,""):`${t.replace(/[\\/]+$/,"")}/${s.replace(/^\.?[\\/]+/,"").replace(/[\\/]+$/,"")}`}function Up(t,n){if(n===t)return".";const s=`${t.replace(/[\\/]+$/,"")}/`;return n.startsWith(s)?n.slice(s.length):n}function eu(t,n,s){return n?t:Gr.createPortal(t,s)}const Ui="termdock:right-sidebar:file-tree-scroll:v1",Hi="termdock:right-sidebar:file-preview-reading-state:v1",ws="termdock:right-sidebar:file-tree-width:v1",tu="termdock:right-sidebar:markdown-view-mode:v1",ru="termdock:right-sidebar:diff-change-list-mode:v1",nu="termdock:right-sidebar:diff-wrap:v1",su="termdock:diff-viewer:view-type:v1",au="termdock:right-sidebar:file-search-mode:v1",Zo="termdock:right-sidebar:collapsed-git-repo-groups:v1",nd="termdock:right-sidebar:collapsed-diff-directories:v1",ei="termdock:right-sidebar:branch-audit-module-open:v1",ou="termdock:right-sidebar:branch-audit-module:v1",Hp=150,iu="termdock:right-sidebar:active-git-repo:v1",sd="termdock:right-sidebar:context-draft-enabled:v1",ad="termdock:right-sidebar:context-draft-collapsed:v1",od="termdock:right-sidebar:context-draft-auto-collapse:v1",ti="termdock:right-sidebar:context-draft-text:v1",zp=300,Wp=20,Gp=120,qp=250,Kp=250,Vp=120,Yp=700,ri=600;function zn(t){return!!(t&&te.getState().nestedGitScanRoots[t])}const id=[2e3,5e3,15e3,3e4],Xp=320,Jp=500,Qp=20,Zp=12e3,Ni=300,ld=240,eg=560,lu="border-r px-2 py-1.5 sm:px-3 sm:py-2",Wa="max-w-[18rem] whitespace-normal break-words sm:max-w-[27rem]",cu=`${lu} border-b border-border/15 font-semibold last:border-r-0`,du=`${lu} border-border/10 align-top text-muted-foreground last:border-r-0`,zi="termdock-file-preview-horizontal-scroll",cd=o.lazy(()=>$s(()=>import("./ModelPreview-heBo6X9C.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]))),uu=`${zi} termdock-md-table-scroll max-w-full overflow-x-auto overflow-y-hidden rounded-lg border border-border/20 bg-surface`;function fu(t,n,s){return t&&!n?"unified":s}const tg=new Set([".md",".markdown",".mdown",".mkdn",".mkd"]);function rg(t){return t==="preview"||t==="source"}function ng(t){return t==="list"||t==="tree"||t==="ai"}function dd(){return tt(tu,rg)??"preview"}function sg(){return tt(ru,ng)??"tree"}function ks(t){return typeof t=="boolean"}function ag(t){return typeof t=="string"}function og(){return tt(nu,ks)??!0}function ig(t){return t==="unified"||t==="split"}function lg(){return tt(su,ig)??"unified"}function cg(t){return t==="name"||t==="content"||t==="regex"}function dg(){return tt(au,cg)??"name"}function hu(t){return t.repositories??(t.context?.root?[{id:t.context.root,root:t.context.root,relativeRoot:".",name:mt(t.context.root)||t.context.root,depth:0,nested:!1,available:t.available,files:t.files,context:t.context,error:t.error}]:[])}function ug(t){return!!t&&typeof t=="object"&&!Array.isArray(t)&&Object.values(t).every(n=>n===null||typeof n=="string")}function mu(){return tt(iu,ug)??{}}function ud(t){if(!t)return;const n=mu();return Object.prototype.hasOwnProperty.call(n,t)?n[t]:void 0}function ni(t,n){t&&vt(iu,{...mu(),[t]:n})}function fg(t,n){if(!n)return null;const s=new Set((t.repoFilters??[]).map(l=>l.root));return s.has(n)?n:s.size>0?null:(t.repositories??[]).some(l=>l.root===n)?n:null}function Mi(t){return!t.activeGitRepoRoot&&(t.groupCount>1||t.label!==t.rootName)}function pu(...t){const n=new Set;for(const s of t)for(const l of s)n.add(l.root);return n}function $i(t){return Array.isArray(t)&&t.every(n=>typeof n=="string")}function fd(t){const n=tt(t,$i);return n?new Set(n):new Set}function si(t,n){vt(t,[...n])}function hg(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const n=t;return typeof n.filePath=="string"&&typeof n.hunkHeader=="string"&&typeof n.hunkIndex=="number"&&typeof n.fingerprint=="string"&&typeof n.additions=="number"&&typeof n.deletions=="number"&&typeof n.diff=="string"&&(n.oldPath===void 0||n.oldPath===null||typeof n.oldPath=="string")&&(n.newPath===void 0||n.newPath===null||typeof n.newPath=="string")&&(n.source===void 0||n.source==="committed"||n.source==="uncommitted"||n.source==="unknown")&&(n.commit===void 0||n.commit===null||typeof n.commit=="string")}function mg(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const n=t;return typeof n.available=="boolean"&&(n.repoRoot===void 0||typeof n.repoRoot=="string")&&(n.workspaceRoot===void 0||typeof n.workspaceRoot=="string")&&(n.baseRef===void 0||typeof n.baseRef=="string")&&(n.baseBranch===void 0||typeof n.baseBranch=="string")&&(n.currentBranch===void 0||n.currentBranch===null||typeof n.currentBranch=="string")&&(n.headRef===void 0||n.headRef===null||typeof n.headRef=="string")&&(n.diffFingerprint===void 0||typeof n.diffFingerprint=="string")&&(n.stat===void 0||typeof n.stat=="string")&&(n.files===void 0||$i(n.files))&&(n.hunks===void 0||Array.isArray(n.hunks)&&n.hunks.every(hg))&&(n.commits===void 0||$i(n.commits))&&(n.commitCount===void 0||typeof n.commitCount=="number")&&(n.diff===void 0||typeof n.diff=="string")&&(n.truncated===void 0||typeof n.truncated=="boolean")&&(n.error===void 0||typeof n.error=="string")}function pg(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const n=t;return typeof n.key=="string"&&mg(n.diff)&&typeof n.repoLabel=="string"&&typeof n.createdAt=="number"}function gg(t){return!t||typeof t!="object"||Array.isArray(t)?!1:Object.values(t).every(n=>{if(!n||typeof n!="object"||Array.isArray(n))return!1;const s=n;return Array.isArray(s.selectedRepoRoots)&&s.selectedRepoRoots.every(l=>typeof l=="string")&&!!s.repoTargetBranches&&typeof s.repoTargetBranches=="object"&&!Array.isArray(s.repoTargetBranches)&&Object.values(s.repoTargetBranches).every(l=>typeof l=="string")&&(s.repoBaseBranches===void 0||!!s.repoBaseBranches&&typeof s.repoBaseBranches=="object"&&!Array.isArray(s.repoBaseBranches)&&Object.values(s.repoBaseBranches).every(l=>typeof l=="string"))&&(s.previewEntries===void 0||Array.isArray(s.previewEntries)&&s.previewEntries.every(pg))&&(s.selectedPreviewKey===void 0||s.selectedPreviewKey===null||typeof s.selectedPreviewKey=="string")&&(s.selectedPreviewFileKey===void 0||s.selectedPreviewFileKey===null||typeof s.selectedPreviewFileKey=="string")&&(s.previewDetailOpen===void 0||typeof s.previewDetailOpen=="boolean")&&(s.previewScrollTops===void 0||!!s.previewScrollTops&&typeof s.previewScrollTops=="object"&&!Array.isArray(s.previewScrollTops)&&Object.values(s.previewScrollTops).every(l=>typeof l=="number"))&&(s.previewMobileSlideIndex===void 0||typeof s.previewMobileSlideIndex=="number")&&(s.includeUncommitted===void 0||typeof s.includeUncommitted=="boolean")&&typeof s.updatedAt=="number"})}function hd(){return tt(ou,gg)??{}}function md(t){return[t.repoRoot,t.baseRef,t.branchName??"",t.headRef??"",t.diffFingerprint??""].join("\0")}function pd(t){const n=t?.trim()??"",s=n.indexOf("/");return s>=0?n.slice(s+1):n}function gu(t,n){const s=t?.trim(),l=n?.trim();return!s||!l?!1:s===l||pd(s)===pd(l)}function gd(t){const n=t?.branch??null;return[t?.upstream,...t?.remoteBranches??[],...t?.branches??[]].find(l=>l&&!gu(l,n))??""}function Ei(t,n){const s=Math.max(ld,n-320),l=Math.min(eg,s);return Math.min(l,Math.max(ld,t))}function bg(t){return typeof t=="number"&&Number.isFinite(t)}function xg(t){return Ei(tt(ws,bg)??Ni,t)}function bu(t){const n=t.split(/[\\/]/).pop()??t,s=n.lastIndexOf(".");return s>=0?n.slice(s).toLowerCase():""}function xs(t){return tg.has(bu(t))}function xu(t){const n=t.trim().replace(/\s+/g,"");return/^-{3,}$/.test(n)||/^\*{3,}$/.test(n)||/^_{3,}$/.test(n)}function Li(t){const n=t.trim();return/^#{1,6}\s+/.test(n)||xu(t)||/^>\s?/.test(n)||/^(```|~~~)/.test(n)||/^(?:[-+*]|\d+[.)])\s+/.test(n)}function vu(t){const n=t.trim();return/^(https?:|mailto:|#|\/|\.\/|\.\.\/)/i.test(n)||!/^[a-z][a-z0-9+.-]*:/i.test(n)&&!/[<>]/.test(n)?n:null}const yu=o.createContext(null);function Ua(t){return t.trim().replace(/\s+/g," ").toLowerCase()}function wu(t){return t.replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\[[^\]]*\]/g,"$1").replace(/[`*_~]/g,"").replace(/<[^>]+>/g,"").trim()}function ku(t){return t.replace(/\s+#+\s*$/,"").trim()}function Ai(t,n){const l=wu(t).toLowerCase().replace(/[^\p{L}\p{N}\s-]/gu,"").trim().replace(/\s+/g,"-")||"section",d=n.headingSlugCounts.get(l)??0;return n.headingSlugCounts.set(l,d+1),d===0?l:`${l}-${d}`}function bd(t){return wu(t)||t.trim()}function Ga(t){const n=t.match(/^\s{0,3}\[([^\]]+)\]:\s+(.+?)\s*$/);if(!n)return null;const s=Ti(n[2]);return s?{id:Ua(n[1]),definition:{href:s.href,title:s.title}}:null}function vg(t){const n=new Map;for(const s of t){const l=Ga(s);l&&n.set(l.id,l.definition)}return n}function Su(t){return t.trim().toLowerCase()}function ju(t){const n=t.match(/^\s{0,3}\[\^([^\]]+)\]:\s+(.+)\s*$/);return n?{id:Su(n[1]),text:n[2]}:null}function yg(t){const n=new Map;let s=null;for(const l of t){const d=ju(l);if(d){s=d.id,n.set(d.id,{id:d.id,text:d.text,index:n.size+1});continue}if(s&&/^\s{4,}\S/.test(l)){const c=n.get(s);c&&(c.text=`${c.text} ${l.trim()}`);continue}l.trim()&&(s=null)}return n}function Ru(t){const n=new Set;let s=!1;return t.forEach((l,d)=>{if(ju(l)){n.add(d),s=!0;return}if(s&&/^\s{4,}\S/.test(l)){n.add(d);return}l.trim()&&(s=!1)}),n}function wg(t){const n=[...t];let s=0;const l=t[0]?.trim();if(l==="---"||l==="+++"){for(n[0]="",s=1;s<t.length&&t[s].trim()!==l;)n[s]="",s+=1;s<t.length&&(n[s]="",s+=1)}for(;s<t.length;){const d=t[s].trim();if(d.startsWith("<!--")){if(n[s]="",!d.includes("-->")){for(s+=1;s<t.length&&!t[s].includes("-->");)n[s]="",s+=1;s<t.length&&(n[s]="")}s+=1;continue}s+=1}return n}function Cu(t){const n=t.replace(/\/+$/,""),s=n.lastIndexOf("/");return s<=0?s===0?"/":"":n.slice(0,s)}function Rs(t){const n=t.split(/[?#]/,1)[0],s=n.startsWith("/"),l=[];for(const c of n.split("/"))if(!(!c||c===".")){if(c===".."){l.length>0&&l.pop();continue}l.push(c)}return`${s?"/":""}${l.join("/")}`||(s?"/":".")}function Wi(t,n,s){const l=t.trim();if(!l||/^(?:https?:|mailto:|javascript:|data:)/i.test(l)||/^[a-z][a-z0-9+.-]*:/i.test(l))return null;if(l.startsWith("#")){if(!n)return null;try{return{path:n,fragment:decodeURIComponent(l.slice(1))||null,directory:!1}}catch{return null}}const d=l.indexOf("#"),c=d>=0?l.slice(0,d):l,h=d>=0?l.slice(d+1):"",m=c.split("?",1)[0];if(!m)return null;let g,p=null;try{g=decodeURIComponent(m),p=h?decodeURIComponent(h):null}catch{return null}const f=s?Rs(s):null;let k;if(g.startsWith("/")){const y=f&&(g===f||g.startsWith(`${f}/`));k=Rs(f&&!y?`${f}/${g.slice(1)}`:g)}else{if(!n)return null;k=Rs(`${Cu(n)}/${g}`)}return f&&k!==f&&!k.startsWith(`${f}/`)?null:{path:k,fragment:p,directory:/\/$/.test(m)}}function Gi(t,n,s,l,d){const c=t.trim();if(!c||/^(?:javascript|data):/i.test(c))return null;if(/^https?:\/\//i.test(c))return c;if(!l(c.split(/[?#]/,1)[0]))return null;let h;if(c.startsWith("/")){const m=s&&(c===s||c.startsWith(`${s}/`));h=Rs(s&&!m?`${s}/${c.slice(1)}`:c)}else{if(!n)return null;h=Rs(`${Cu(n)}/${c}`)}return d(h)}function kg(t,n,s){return Gi(t,n,s,Oi,l=>`/api/terminal/fs/blob?path=${encodeURIComponent(l)}`)}function Sg(t,n,s){return Gi(t,n,s,Ed,Ld)}const Pi=128,jg=360,ai=480;function Za(t){try{return/\.svg(?=$|[?#&])/i.test(decodeURIComponent(t))}catch{return!1}}function Nu(t,n,s,l,d=0){if(!n||!s)return null;let c,h;return d>0?(c=l>0?Math.min(d,l):d,h=s*c/n):Za(t)?(h=Math.min(Math.max(s,Pi),jg),c=n*h/s):(c=n,h=s),l>0&&c>l&&(h=h*l/c,c=l),h>ai&&(c=c*ai/h,h=ai),{width:Math.max(1,Math.round(c)),height:Math.max(1,Math.round(h))}}function Rg(t){if(!t.startsWith("/api/terminal/fs/blob?"))return null;try{return new URLSearchParams(t.slice(t.indexOf("?"))).get("path")}catch{return null}}function Mu(t){const n=Rg(t),s=te(l=>n?(l.fileChangeVersions.get(n)??0)+l.fileWatchEpoch:0);return n&&s>0?`${t}&v=${s}`:t}function Cg({src:t,alt:n,title:s,requestedWidthPx:l}){const d=Za(t),c=Mu(t),h=Ja(c),m=o.useRef(null),[g,p]=o.useState(!1),[f,k]=o.useState(0),[y,N]=o.useState({status:"loading"}),[_,D]=o.useState(null);o.useLayoutEffect(()=>{const $=m.current,L=$?.parentElement?.parentElement??$?.parentElement;if(!L)return;const A=()=>k(L.clientWidth);if(A(),typeof ResizeObserver>"u")return;const O=new ResizeObserver(A);return O.observe(L),()=>O.disconnect()},[]),o.useEffect(()=>{if(g)return;const $=m.current;if(!$||typeof IntersectionObserver>"u"){p(!0);return}const L=new IntersectionObserver(A=>{A.some(O=>O.isIntersecting)&&(p(!0),L.disconnect())},{rootMargin:"400px"});return L.observe($),()=>L.disconnect()},[g]),o.useEffect(()=>{if(!g)return;const $=new AbortController;let L=null;N({status:"loading"});const A=window.setTimeout(()=>{$.abort(new DOMException("Image fetch timed out","TimeoutError"))},15e3);return Uh(c,{signal:$.signal}).then(async O=>{if(!O.ok)throw new Error(`HTTP ${O.status}`);const I=Number(O.headers.get("X-Image-Width"))||0,a=Number(O.headers.get("X-Image-Height"))||0;return{blob:await O.blob(),width:I,height:a}}).then(({blob:O,width:I,height:a})=>{$.signal.aborted||(L=URL.createObjectURL(O),I>0&&a>0&&D({width:I,height:a}),N({status:"ready",objectUrl:L}))}).catch(()=>{const O=$.signal.reason;$.signal.aborted&&!(O instanceof DOMException&&O.name==="TimeoutError")||N({status:"fallback"})}).finally(()=>{window.clearTimeout(A)}),()=>{window.clearTimeout(A),$.abort(),L&&URL.revokeObjectURL(L)}},[g,c]);const B=Nu(t,_?.width??0,_?.height??0,f,l??0),E=B??(l?{width:f>0?Math.min(l,f):l,height:Math.round(l*.75)}:{width:Pi*2,height:Pi});return e.jsx("div",{ref:m,className:"block max-w-full",style:B?{width:B.width,height:B.height}:void 0,children:y.status==="ready"?e.jsx("img",{src:y.objectUrl,alt:n,title:s,decoding:"async",className:`${d?"":"termdock-fade-in "}block max-h-[480px] max-w-full object-contain`,style:B?{width:B.width,height:B.height}:void 0,onLoad:$=>{if(_)return;const L=$.currentTarget;L.naturalWidth>0&&L.naturalHeight>0&&D({width:L.naturalWidth,height:L.naturalHeight})}}):y.status==="fallback"?e.jsx("img",{src:h,alt:n,title:s,loading:"lazy",decoding:"async",className:"block max-h-[480px] max-w-full object-contain",style:B?{width:B.width,height:B.height}:void 0,onLoad:$=>{if(_)return;const L=$.currentTarget;L.naturalWidth>0&&L.naturalHeight>0&&D({width:L.naturalWidth,height:L.naturalHeight})}}):e.jsx("div",{"aria-hidden":!0,className:"flex max-w-full animate-pulse items-center justify-center rounded bg-surface-elevated/60",style:{width:E.width,height:E.height},children:e.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:n||"…"})})})}function Cs(t,n,s,l,d,c){const h=kg(s,d.markdownFilePath,d.rootPath);if(!h)return c?.fallbackText??``;const m=d.images.length;d.images.push({kind:"image",src:h,alt:n,title:l});const g=e.jsx(Cg,{src:h,alt:n,title:l,requestedWidthPx:c?.requestedWidthPx});return d.onImageOpen&&c?.interactive!==!1?e.jsx("button",{type:"button",className:"my-2 block max-w-full overflow-hidden rounded-md border border-border/20 bg-surface-2 text-left transition hover:border-border-strong focus:outline-none focus:ring-2 focus:ring-ring/45",title:l||n||"Open image",onClick:p=>{p.stopPropagation(),d.onImageOpen?.(m)},children:g},t):e.jsx("span",{className:"my-2 block max-w-full overflow-hidden rounded-md border border-border/20 bg-surface-2",children:g},t)}function oi(t){let n=t,s="";for(;/[.,;:!?)]$/.test(n);)s=`${n.slice(-1)}${s}`,n=n.slice(0,-1);return{linkText:n,suffix:s}}function xd(t){return/^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/.test(t)}function Ti(t){const n=t.trim(),s=n.match(/^<([^>]+)>(?:\s+(?:"([^"]*)"|'([^']*)'|\(([^)]*)\)))?$/);if(s)return{href:s[1],title:s[2]??s[3]??s[4]};const l=n.match(/^(\S+)(?:\s+(?:"([^"]*)"|'([^']*)'|\(([^)]*)\)))?$/);return l?{href:l[1],title:l[2]??l[3]??l[4]}:null}const $u="",Ng=/\\([\\`*{}\[\]#+\-.!_|~>$])/g;function Mg(t){return t.replace(Ng,(n,s)=>`${$u}${s.charCodeAt(0).toString(16).padStart(4,"0")}`)}function vd(t){return t.replace(new RegExp(`${$u}([0-9a-f]{4})`,"g"),(n,s)=>String.fromCharCode(Number.parseInt(s,16))).replace(/\\([()])/g,"$1")}function $g(t){const n=t.replace(/[\r\n]+/g," ");return/^ .+ $/.test(n)&&/[^ ]/.test(n.slice(1,-1))?n.slice(1,-1):n}const Eu={ALLOWED_TAGS:["a","abbr","b","blockquote","br","code","del","details","div","em","i","kbd","li","mark","ol","p","pre","s","span","strong","sub","summary","sup","table","tbody","td","th","thead","tr","u","ul"],ALLOWED_ATTR:["href","title","class","id","colspan","rowspan"],ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!0};let Pa=null;function Lu(){return Pa||(Pa=$s(()=>import("./purify.es-4eNOHKSq.js"),[]).then(t=>t.default??t).catch(t=>{throw Pa=null,t})),Pa}function Au({html:t}){const{t:n}=pt(),[s,l]=o.useState(null);return o.useEffect(()=>{let d=!1;return l(null),Lu().then(c=>{d||l(c.sanitize(t,Eu))}).catch(()=>{d||l("")}),()=>{d=!0}},[t]),s===null?e.jsx("div",{className:"py-2 text-xs text-muted-foreground",children:n("rightSidebar.renderingHtml")}):s?e.jsx("div",{className:"text-muted-foreground",dangerouslySetInnerHTML:{__html:s}}):null}function Eg({html:t}){const[n,s]=o.useState(null);return o.useEffect(()=>{let l=!1;return s(null),Lu().then(d=>{l||s(d.sanitize(t,Eu))}).catch(()=>{l||s("")}),()=>{l=!0}},[t]),n===null?null:n?e.jsx("span",{dangerouslySetInnerHTML:{__html:n}}):t}function Pu(t){const n=t.trim().match(/^<(div|section|article|aside|table|p|ul|ol|li|blockquote|pre|figure|figcaption)\b[^>]*>/i);if(!n)return null;const s=n[1].toLowerCase();return{tag:s,selfContained:new RegExp(`</${s}>`,"i").test(t)}}let Ta=null;function Lg(){return Ta||(Ta=Promise.all([$s(()=>import("./katex-DnlPpQZa.js"),[]),$s(()=>Promise.resolve({}),__vite__mapDeps([16]))]).then(([t])=>t.default??t).catch(t=>{throw Ta=null,t})),Ta}function Ls({tex:t,display:n=!1}){const[s,l]=o.useState(null),[d,c]=o.useState(!1);if(o.useEffect(()=>{let m=!1;return l(null),c(!1),Lg().then(g=>{m||l(g.renderToString(t,{displayMode:n,throwOnError:!1,trust:!1,strict:"ignore"}))}).catch(()=>{m||c(!0)}),()=>{m=!0}},[n,t]),d)return e.jsx("code",{className:"rounded bg-surface-2 px-1 py-0.5 font-mono text-[0.92em] text-foreground",children:n?`$$${t}$$`:`$${t}$`});if(!s)return e.jsx("span",{className:"text-muted-foreground/70",children:n?"Rendering formula...":t});const h=n?"my-2 overflow-auto rounded-md bg-surface-2 px-3 py-2 text-center":"inline-block align-middle";return e.jsx("span",{className:h,dangerouslySetInnerHTML:{__html:s}})}function qi(t){const n=new Map;for(const s of t.matchAll(/([a-zA-Z_:][-a-zA-Z0-9_:.]*)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+))/gi))n.set(s[1].toLowerCase(),s[2]??s[3]??s[4]);return n}function yd(t){const n=qi(t),s=n.get("src")?.trim()??"",l=n.get("width")?.trim().match(/^(\d+(?:\.\d+)?)(?:px)?$/i);return{src:s,alt:n.get("alt"),title:n.get("title"),widthPx:l?Number(l[1]):void 0}}function Ag(t){const n=t.indexOf(">"),s=n<0?t:t.slice(0,n+1),l=qi(s),d=l.get("src")?.trim()??"",c=l.get("width")?.trim().match(/^(\d+(?:\.\d+)?)(?:px)?$/i),h=s.replace(/=\s*(?:"[^"]*"|'[^']*')/g," "),m=n<0?"":t.slice(n+1).replace(/<\/video\s*>$/i,"").replace(/<[^>]*>/g,"").trim();return{src:d,fallbackText:m,widthPx:c?Number(c[1]):void 0,controls:/\bcontrols\b/i.test(h)}}function Pg({url:t,fallbackText:n,widthPx:s,hasControls:l}){const{t:d}=pt(),[c,h]=o.useState(!1),m=Ja(t,()=>h(!0));return m?e.jsx("span",{className:"my-2 block max-w-full overflow-hidden rounded-md border border-border/20 bg-surface-2",children:c?e.jsx("span",{className:"block px-3 py-2 text-xs text-muted-foreground",children:n?.trim()||d("rightSidebar.videoUnsupported")}):e.jsx("video",{className:"block max-w-full",src:m,style:s?{width:`${s}px`}:void 0,controls:l,preload:"metadata",playsInline:!0,onError:()=>h(!0)})}):null}function Tg(t,n,s){if(/^<a\b[^>]*>\s*<\s*img\b[^>]*>\s*<\/a\s*>$/i.test(t)){const h=t.slice(0,t.indexOf(">")+1),m=qi(h).get("href")?.trim()??"",g=t.match(/<\s*img\b[^>]*>/i)?.[0]??"",{src:p,alt:f,title:k,widthPx:y}=yd(g);if(!p)return null;const N=Gi(p,s.markdownFilePath,s.rootPath,Oi,$=>$);if(!N)return null;const _=m?Wi(m,s.markdownFilePath,s.rootPath):null,B=!!!(_&&_.path===N)&&m?vu(m):null,E=Cs(n,f??"",p,k,s,{requestedWidthPx:y,interactive:B?!1:void 0});return B?e.jsx("a",{href:B,target:"_blank",rel:"noreferrer",children:E},n):E}if(/^<\s*img\b[^>]*>$/i.test(t)){const{src:h,alt:m,title:g,widthPx:p}=yd(t);return h?Cs(n,m??"",h,g,s,{fallbackText:t,requestedWidthPx:p}):null}if(/^<\s*video\b[^>]*>[\s\S]*?<\/video\s*>$/i.test(t)){const{src:h,fallbackText:m,widthPx:g,controls:p}=Ag(t);if(!h)return null;const f=Sg(h,s.markdownFilePath,s.rootPath);return f?e.jsx(Pg,{url:f,fallbackText:m,widthPx:g,hasControls:p},n):null}if(/^<br\s*\/?>$/i.test(t))return e.jsx("br",{},n);const l=t.match(/^<(kbd|mark|sub|sup)>(.*?)<\/\1>$/i);if(!l)return/^<(a|abbr|span|b|strong|em|i|u|s|del|code)\b[\s\S]*<\/\1>$/i.test(t)?e.jsx(Eg,{html:t},n):null;const d=l[1].toLowerCase(),c=rt(l[2],`${n}-${d}`,!0,s);return d==="kbd"?e.jsx("kbd",{className:"rounded border border-border/30 bg-surface-2 px-1.5 py-0.5 font-mono text-[0.85em] text-foreground shadow-sm",children:c},n):d==="mark"?e.jsx("mark",{className:"rounded bg-warning/25 px-0.5 text-foreground",children:c},n):d==="sub"?e.jsx("sub",{children:c},n):e.jsx("sup",{children:c},n)}function rt(t,n,s=!0,l){const d=Mg(t),c=/(\\\([^)]*\\\)|\$[^$\n]+\$|<br\s*\/?>|<\s*img\b[^>]*>|<\s*video\b[^>]*>[\s\S]*?<\/video\s*>|<(?:a|abbr|span|b|strong|em|i|u|s|del|code|kbd|mark|sub|sup)\b[\s\S]*?<\/(?:a|abbr|span|b|strong|em|i|u|s|del|code|kbd|mark|sub|sup)>|!?\[[^\]]*\]\((?:<[^>]+>|(?:[^\s()]+|\([^()\s]*\))+)(?:\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\)|!?\[[^\]]+\]\[[^\]]*\]|!?\[[^\]]+\]|\[\^[^\]]+\]|(`+)([\s\S]*?)\2|~~[^~]+~~|\*\*[^*]+\*\*|__[^_]+__|\*[^*\s][^*]*\*|_[^_\s][^_]*_|<https?:\/\/[^>\s]+>|<[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+>|https?:\/\/[^\s<]+|www\.[^\s<]+|[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+)/gi,h=[];let m=0,g;for(;(g=c.exec(d))!==null;){g.index>m&&h.push(vd(d.slice(m,g.index)));const p=g[0],f=`${n}-${g.index}`,k=p.startsWith("<")?Tg(p,f,l):null;if(k)h.push(k);else if(p.startsWith("\\(")&&p.endsWith("\\)"))h.push(e.jsx(Ls,{tex:p.slice(2,-2)},f));else if(p.startsWith("$")&&p.endsWith("$"))h.push(e.jsx(Ls,{tex:p.slice(1,-1)},f));else if(p.startsWith("`")){const y=p.match(/^`+/)?.[0].length??1;h.push(e.jsx("code",{className:`${s?"break-all":"whitespace-nowrap"} rounded bg-surface-2 px-1 py-0.5 font-mono text-[0.92em] text-foreground`,children:$g(p.slice(y,-y))},f))}else if(p.startsWith("~~"))h.push(e.jsx("del",{className:"text-muted-foreground decoration-border-strong",children:rt(p.slice(2,-2),`${f}-del`,s,l)},f));else if(p.startsWith("**")||p.startsWith("__"))h.push(e.jsx("strong",{className:"font-semibold text-foreground",children:rt(p.slice(2,-2),`${f}-strong`,s,l)},f));else if(p.startsWith("*")||p.startsWith("_"))h.push(e.jsx("em",{className:"italic",children:rt(p.slice(1,-1),`${f}-em`,s,l)},f));else if(p.startsWith("![")){const y=p.match(/^!\[([^\]]*)\]\((.*)\)$/),N=p.match(/^!\[([^\]]+)\]\[([^\]]*)\]$/),_=p.match(/^!\[([^\]]+)\]$/);if(y){const D=Ti(y[2]);h.push(D?Cs(f,y[1],D.href,D.title,l):p)}else if(N){const D=N[2]||N[1],B=l.referenceDefinitions.get(Ua(D));h.push(B?Cs(f,N[1],B.href,B.title,l):p)}else if(_){const D=l.referenceDefinitions.get(Ua(_[1]));h.push(D?Cs(f,_[1],D.href,D.title,l):p)}else h.push(p)}else if(p.startsWith("[^")){const y=Su(p.slice(2,-1)),N=l.footnoteDefinitions.get(y);h.push(N?e.jsx("sup",{id:`fnref-${N.id}`,title:N.text,className:"ml-0.5 rounded bg-surface-2 px-1 text-[0.72em] font-semibold text-primary",children:e.jsx("a",{href:`#fn-${N.id}`,className:"text-primary no-underline",children:N.index})},f):p)}else if(p.startsWith("<http")){const y=p.slice(1,-1);h.push(e.jsx("a",{href:y,target:"_blank",rel:"noreferrer",className:`${s?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},f))}else if(p.startsWith("<")&&p.endsWith(">")&&xd(p.slice(1,-1))){const y=p.slice(1,-1);h.push(e.jsx("a",{href:`mailto:${y}`,className:`${s?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},f))}else if(xd(oi(p).linkText)){const{linkText:y,suffix:N}=oi(p);h.push(e.jsx("a",{href:`mailto:${y}`,className:`${s?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},f)),N&&h.push(N)}else if(p.startsWith("http")||p.startsWith("www.")){const{linkText:y,suffix:N}=oi(p),_=y.startsWith("www.")?`https://${y}`:y;h.push(e.jsx("a",{href:_,target:"_blank",rel:"noreferrer",className:`${s?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},f)),N&&h.push(N)}else{const y=p.match(/^\[([^\]]+)\]\((.*)\)$/),N=p.match(/^\[([^\]]+)\]\[([^\]]*)\]$/),_=p.match(/^\[([^\]]+)\]$/),D=N?N[2]||N[1]:_?.[1]??null,B=D?l.referenceDefinitions.get(Ua(D)):null,E=y?Ti(y[2]):null,$=E?.href??B?.href??null,L=$?vu($):null,A=y?.[1]??N?.[1]??_?.[1]??"";h.push(L?e.jsx("a",{href:L,title:E?.title??B?.title,target:"_blank",rel:"noreferrer",className:`${s?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:rt(A,`${f}-link`,s,l)},f):p)}m=c.lastIndex}return m<d.length&&h.push(vd(d.slice(m))),h.length>0?h:[t]}function Tu(t){return/(?: {2,}|\\)$/.test(t)}function Iu(t){return t.replace(/(?: {2,}|\\)$/,"")}function qa(t){return/^(?: {4}|\t)/.test(t)}function _u(t){return t.startsWith(" ")?t.slice(1):t.replace(/^ {4}/,"")}function Du(t,n,s){const l=[];return t.forEach((d,c)=>{const h=Tu(d);l.push(...rt(Iu(d),`${n}-${c}`,!0,s)),c<t.length-1&&l.push(h?e.jsx("br",{},`${n}-${c}-br`):" ")}),l}function Ii(t,n,s){const l=[],d=[];return t.forEach((c,h)=>{d.push(Tu(c)),l.push(rt(Iu(c),`${n}-${h}`,!0,s))}),{perLine:l,hardBreaks:d}}function _i(t,n,s,l,d){const c=[];return t.forEach((h,m)=>{const g=s[m]??0,p=!!(d&&g>=d.start&&g<=d.end);c.push(e.jsx("span",{"data-md-ref-start":g,"data-md-ref-end":g,"data-selected":p?"true":void 0,children:h},`${l}-ref-${m}`)),m<t.length-1&&c.push(n[m]?e.jsx("br",{},`${l}-${m}-br`):" ")}),c}function As(t){const n=t.trim().replace(/^\|/,"").replace(/\|$/,""),s=[];let l="",d=!1,c=0,h=0;for(let m=0;m<n.length;m+=1){const g=n[m];if(d){l+=g,d=!1;continue}if(g==="\\"){d=!0;continue}if(g==="`"){const p=m;for(;m+1<n.length&&n[m+1]==="`";)m+=1;const f=m-p+1;l+="`".repeat(f),c===0?c=f:c===f&&(c=0);continue}if(c===0&&g==="["?h+=1:c===0&&g==="]"&&h>0&&(h-=1),g==="|"&&c===0&&h===0){s.push(l.trim()),l="";continue}l+=g}return d&&(l+="\\"),s.push(l.trim()),s}function Fu(t){return As(t).map(n=>/^:-+:$/.test(n)?"center":/^-+:$/.test(n)?"right":/^:-+$/.test(n)?"left":null)}function Ka(t){return t==="center"?"text-center":t==="right"?"text-right":"text-left"}function Va(t){return/^\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)*\|?$/.test(t.trim())}function Bu(t,n){return t>96||t>44&&n>.35}function eo(t){return(t.match(/^\s*/)?.[0]??"").replace(/\t/g," ").length}function Ps(t){const n=t.trim().match(/^([-+*]|\d+[.)])\s+(.+)$/);if(!n)return null;const s=/^\d+[.)]$/.test(n[1]);return{ordered:s,start:s?Number.parseInt(n[1],10):void 0,content:n[2]}}function Ki(t,n,s,l,d,c=new Set){const h=[],m=[];let g=n;for(;g<t.length;){const p=t[g];if(d&&(Ga(p)||c.has(g))){g+=1;continue}const f=Ps(p),k=eo(p);if(!f){if(k>s&&m.length>0){([...m].reverse().find(D=>D.indent<k)?.item??m[m.length-1].item).paragraphs.push(p.trim());for(const D of m)D.item.lineEnd=g+1;g+=1;continue}break}if(k<s||k===s&&f.ordered!==l)break;const y={content:f.content,ordered:f.ordered,start:f.start,children:[],paragraphs:[],lineStart:g+1,lineEnd:g+1};for(;m.length>0&&m[m.length-1].indent>=k;)m.pop();const N=m[m.length-1]?.item??null;N?N.children.push(y):h.push(y),m.push({indent:k,item:y});for(const _ of m)_.item.lineEnd=g+1;g+=1}return{items:h,nextIndex:g}}function Ig(t){const n=t.find(l=>Ps(l));if(!n)return[];const s=Ps(n);return s?Ki(t,0,eo(n),s.ordered,!0,Ru(t)).items:[]}function Vi(t,n,s,l=0){return t.map((d,c)=>{const h=d.content.match(/^\[([ xX])\]\s+(.+)$/);return{key:`item-${c}`,taskItem:!!h,refStart:d.lineStart+l,refEnd:d.lineEnd+l,content:e.jsxs(e.Fragment,{children:[h?e.jsx("input",{type:"checkbox",checked:h[1].toLowerCase()==="x",readOnly:!0,className:"mr-2 align-[-2px] accent-primary"}):null,rt(h?.[2]??d.content,`li-${n}-${c}`,!0,s),d.paragraphs.length>0&&e.jsx("div",{className:"mt-1 space-y-1 text-muted-foreground",children:d.paragraphs.map((m,g)=>e.jsx("p",{children:rt(m,`li-${n}-${c}-p-${g}`,!0,s)},`paragraph-${g}`))})]}),groups:_g(d.children,`${n}-${c}`,s,l)}})}function _g(t,n,s,l=0){const d=[];for(const c of t){const h=d[d.length-1];h&&h.ordered===c.ordered?h.items.push(c):d.push({ordered:c.ordered,items:[c]})}return d.map((c,h)=>({ordered:c.ordered,start:c.ordered?c.items[0]?.start:void 0,items:Vi(c.items,`${n}-g${h}`,s,l)}))}function Yi(t,n){return t.map(s=>{const l=!!(n&&s.refStart<=n.end&&s.refEnd>=n.start);return e.jsxs("li",{className:s.taskItem?"list-none":void 0,"data-md-ref-start":s.refStart,"data-md-ref-end":s.refEnd,"data-selected":l?"true":void 0,children:[s.content,s.groups.length>0&&Dg(s.groups,n)]},s.key)})}function Dg(t,n){return t.map((s,l)=>{const d=s.ordered?"ol":"ul";return e.jsx(d,{start:s.start,className:`${s.ordered?"list-decimal":"list-disc"} mt-1 space-y-0.5 pl-4 marker:text-muted-foreground/60`,children:Yi(s.items,n)},`nested-${l}`)})}function Fg(t){const n=Array.from(t.footnoteDefinitions.values()).sort((s,l)=>s.index-l.index);return n.length===0?null:e.jsxs("section",{className:"mt-3 border-t border-border/20 pt-2 text-[12px] leading-5 text-muted-foreground",children:[e.jsx("div",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/80",children:t.footnotesLabel}),e.jsx("ol",{className:"list-decimal space-y-1 pl-5",children:n.map(s=>e.jsxs("li",{id:`fn-${s.id}`,children:[rt(s.text,`footnote-${s.id}`,!0,t)," ",e.jsx("a",{href:`#fnref-${s.id}`,className:"text-primary no-underline","aria-label":t.backToFootnoteLabel(s.index),children:"↩"})]},s.id))})]})}function Bg(t,n,s,l){const d=[];let c=0;const h=m=>l?.[m]??m+1;for(;c<t.length;){const m=t[c],g=m.trim();if(!g){c+=1;continue}if(/^<details>\s*$/i.test(g)){const E=c;let $="Details";const L=[];for(c+=1;c<t.length&&!/^<\/details>\s*$/i.test(t[c].trim());){const A=t[c].trim().match(/^<summary>(.*?)<\/summary>\s*$/i);A?$=A[1].trim()||$:L.push(t[c].trimStart()),c+=1}c<t.length&&(c+=1),d.push({kind:"static",node:e.jsxs("details",{className:"overflow-hidden rounded-lg border border-border/20 bg-surface px-3 py-2 text-muted-foreground",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-foreground",children:rt($,`${n}-details-${E}-summary`,!0,s)}),L.length>0&&e.jsx("div",{className:"mt-2 text-sm leading-6",children:Du(L,`${n}-details-${E}`,s)})]},`${n}-details-${E}`)});continue}const p=Pu(m);if(p){const E=[m],$=c;for(c+=1;c<t.length&&!p.selfContained&&!new RegExp(`</${p.tag}>`,"i").test(t[c]);)E.push(t[c]),c+=1;c<t.length&&!p.selfContained&&(E.push(t[c]),c+=1),d.push({kind:"static",node:e.jsx(Au,{html:E.join(`
|
|
1638
|
+
`);const y=d.length;d+=f.data,l.push({node:f,start:y,end:d.length,group:k}),c=k}const m=d.toLocaleLowerCase(),g=[];let p=0;for(;p<=m.length-s.length;){const f=m.indexOf(s,p);if(f<0)break;const k=f+s.length,y=l.find(_=>_.start<=f&&_.end>f),N=l.find(_=>_.start<k&&_.end>=k);if(y&&N&&y.group===N.group){const _=document.createRange();_.setStart(y.node,f-y.start),_.setEnd(N.node,k-N.start),g.push(_)}p=f+Math.max(s.length,1)}return g}function Zd(){return typeof CSS<"u"&&CSS.highlights?CSS.highlights:null}function Aa(){const t=Zd();t?.delete(Qd),t?.delete(Ci)}function td(t,n){const s=Zd();if(!s||typeof Highlight>"u")return;s.set(Qd,new Highlight(...t));const l=t[n];l?s.set(Ci,new Highlight(l)):s.delete(Ci)}function rd(t){t?.startContainer.parentElement?.scrollIntoView({block:"center",inline:"nearest",behavior:"smooth"})}function Bp(t){return Array.from(new Set(t.split(/[\n,]/).map(n=>n.trim().replace(/^!+/,"")).filter(Boolean))).slice(0,24)}function Op(t,n){const s=n.trim();return!s||s==="."?t:/^(?:[/\\]|[A-Za-z]:[/\\])/.test(s)?s.replace(/[\\/]+$/,""):`${t.replace(/[\\/]+$/,"")}/${s.replace(/^\.?[\\/]+/,"").replace(/[\\/]+$/,"")}`}function Up(t,n){if(n===t)return".";const s=`${t.replace(/[\\/]+$/,"")}/`;return n.startsWith(s)?n.slice(s.length):n}function eu(t,n,s){return n?t:Gr.createPortal(t,s)}const Ui="termdock:right-sidebar:file-tree-scroll:v1",Hi="termdock:right-sidebar:file-preview-reading-state:v1",ws="termdock:right-sidebar:file-tree-width:v1",tu="termdock:right-sidebar:markdown-view-mode:v1",ru="termdock:right-sidebar:diff-change-list-mode:v1",nu="termdock:right-sidebar:diff-wrap:v1",su="termdock:diff-viewer:view-type:v1",au="termdock:right-sidebar:file-search-mode:v1",Zo="termdock:right-sidebar:collapsed-git-repo-groups:v1",nd="termdock:right-sidebar:collapsed-diff-directories:v1",ei="termdock:right-sidebar:branch-audit-module-open:v1",ou="termdock:right-sidebar:branch-audit-module:v1",Hp=150,iu="termdock:right-sidebar:active-git-repo:v1",sd="termdock:right-sidebar:context-draft-enabled:v1",ad="termdock:right-sidebar:context-draft-collapsed:v1",od="termdock:right-sidebar:context-draft-auto-collapse:v1",ti="termdock:right-sidebar:context-draft-text:v1",zp=300,Wp=20,Gp=120,qp=250,Kp=250,Vp=120,Yp=700,ri=600;function zn(t){return!!(t&&te.getState().nestedGitScanRoots[t])}const id=[2e3,5e3,15e3,3e4],Xp=320,Jp=500,Qp=20,Zp=12e3,Ni=300,ld=240,eg=560,lu="border-r px-2 py-1.5 sm:px-3 sm:py-2",Wa="max-w-[18rem] whitespace-normal break-words sm:max-w-[27rem]",cu=`${lu} border-b border-border/15 font-semibold last:border-r-0`,du=`${lu} border-border/10 align-top text-muted-foreground last:border-r-0`,zi="termdock-file-preview-horizontal-scroll",cd=o.lazy(()=>$s(()=>import("./ModelPreview-DzF4OoFj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]))),uu=`${zi} termdock-md-table-scroll max-w-full overflow-x-auto overflow-y-hidden rounded-lg border border-border/20 bg-surface`;function fu(t,n,s){return t&&!n?"unified":s}const tg=new Set([".md",".markdown",".mdown",".mkdn",".mkd"]);function rg(t){return t==="preview"||t==="source"}function ng(t){return t==="list"||t==="tree"||t==="ai"}function dd(){return tt(tu,rg)??"preview"}function sg(){return tt(ru,ng)??"tree"}function ks(t){return typeof t=="boolean"}function ag(t){return typeof t=="string"}function og(){return tt(nu,ks)??!0}function ig(t){return t==="unified"||t==="split"}function lg(){return tt(su,ig)??"unified"}function cg(t){return t==="name"||t==="content"||t==="regex"}function dg(){return tt(au,cg)??"name"}function hu(t){return t.repositories??(t.context?.root?[{id:t.context.root,root:t.context.root,relativeRoot:".",name:mt(t.context.root)||t.context.root,depth:0,nested:!1,available:t.available,files:t.files,context:t.context,error:t.error}]:[])}function ug(t){return!!t&&typeof t=="object"&&!Array.isArray(t)&&Object.values(t).every(n=>n===null||typeof n=="string")}function mu(){return tt(iu,ug)??{}}function ud(t){if(!t)return;const n=mu();return Object.prototype.hasOwnProperty.call(n,t)?n[t]:void 0}function ni(t,n){t&&vt(iu,{...mu(),[t]:n})}function fg(t,n){if(!n)return null;const s=new Set((t.repoFilters??[]).map(l=>l.root));return s.has(n)?n:s.size>0?null:(t.repositories??[]).some(l=>l.root===n)?n:null}function Mi(t){return!t.activeGitRepoRoot&&(t.groupCount>1||t.label!==t.rootName)}function pu(...t){const n=new Set;for(const s of t)for(const l of s)n.add(l.root);return n}function $i(t){return Array.isArray(t)&&t.every(n=>typeof n=="string")}function fd(t){const n=tt(t,$i);return n?new Set(n):new Set}function si(t,n){vt(t,[...n])}function hg(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const n=t;return typeof n.filePath=="string"&&typeof n.hunkHeader=="string"&&typeof n.hunkIndex=="number"&&typeof n.fingerprint=="string"&&typeof n.additions=="number"&&typeof n.deletions=="number"&&typeof n.diff=="string"&&(n.oldPath===void 0||n.oldPath===null||typeof n.oldPath=="string")&&(n.newPath===void 0||n.newPath===null||typeof n.newPath=="string")&&(n.source===void 0||n.source==="committed"||n.source==="uncommitted"||n.source==="unknown")&&(n.commit===void 0||n.commit===null||typeof n.commit=="string")}function mg(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const n=t;return typeof n.available=="boolean"&&(n.repoRoot===void 0||typeof n.repoRoot=="string")&&(n.workspaceRoot===void 0||typeof n.workspaceRoot=="string")&&(n.baseRef===void 0||typeof n.baseRef=="string")&&(n.baseBranch===void 0||typeof n.baseBranch=="string")&&(n.currentBranch===void 0||n.currentBranch===null||typeof n.currentBranch=="string")&&(n.headRef===void 0||n.headRef===null||typeof n.headRef=="string")&&(n.diffFingerprint===void 0||typeof n.diffFingerprint=="string")&&(n.stat===void 0||typeof n.stat=="string")&&(n.files===void 0||$i(n.files))&&(n.hunks===void 0||Array.isArray(n.hunks)&&n.hunks.every(hg))&&(n.commits===void 0||$i(n.commits))&&(n.commitCount===void 0||typeof n.commitCount=="number")&&(n.diff===void 0||typeof n.diff=="string")&&(n.truncated===void 0||typeof n.truncated=="boolean")&&(n.error===void 0||typeof n.error=="string")}function pg(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const n=t;return typeof n.key=="string"&&mg(n.diff)&&typeof n.repoLabel=="string"&&typeof n.createdAt=="number"}function gg(t){return!t||typeof t!="object"||Array.isArray(t)?!1:Object.values(t).every(n=>{if(!n||typeof n!="object"||Array.isArray(n))return!1;const s=n;return Array.isArray(s.selectedRepoRoots)&&s.selectedRepoRoots.every(l=>typeof l=="string")&&!!s.repoTargetBranches&&typeof s.repoTargetBranches=="object"&&!Array.isArray(s.repoTargetBranches)&&Object.values(s.repoTargetBranches).every(l=>typeof l=="string")&&(s.repoBaseBranches===void 0||!!s.repoBaseBranches&&typeof s.repoBaseBranches=="object"&&!Array.isArray(s.repoBaseBranches)&&Object.values(s.repoBaseBranches).every(l=>typeof l=="string"))&&(s.previewEntries===void 0||Array.isArray(s.previewEntries)&&s.previewEntries.every(pg))&&(s.selectedPreviewKey===void 0||s.selectedPreviewKey===null||typeof s.selectedPreviewKey=="string")&&(s.selectedPreviewFileKey===void 0||s.selectedPreviewFileKey===null||typeof s.selectedPreviewFileKey=="string")&&(s.previewDetailOpen===void 0||typeof s.previewDetailOpen=="boolean")&&(s.previewScrollTops===void 0||!!s.previewScrollTops&&typeof s.previewScrollTops=="object"&&!Array.isArray(s.previewScrollTops)&&Object.values(s.previewScrollTops).every(l=>typeof l=="number"))&&(s.previewMobileSlideIndex===void 0||typeof s.previewMobileSlideIndex=="number")&&(s.includeUncommitted===void 0||typeof s.includeUncommitted=="boolean")&&typeof s.updatedAt=="number"})}function hd(){return tt(ou,gg)??{}}function md(t){return[t.repoRoot,t.baseRef,t.branchName??"",t.headRef??"",t.diffFingerprint??""].join("\0")}function pd(t){const n=t?.trim()??"",s=n.indexOf("/");return s>=0?n.slice(s+1):n}function gu(t,n){const s=t?.trim(),l=n?.trim();return!s||!l?!1:s===l||pd(s)===pd(l)}function gd(t){const n=t?.branch??null;return[t?.upstream,...t?.remoteBranches??[],...t?.branches??[]].find(l=>l&&!gu(l,n))??""}function Ei(t,n){const s=Math.max(ld,n-320),l=Math.min(eg,s);return Math.min(l,Math.max(ld,t))}function bg(t){return typeof t=="number"&&Number.isFinite(t)}function xg(t){return Ei(tt(ws,bg)??Ni,t)}function bu(t){const n=t.split(/[\\/]/).pop()??t,s=n.lastIndexOf(".");return s>=0?n.slice(s).toLowerCase():""}function xs(t){return tg.has(bu(t))}function xu(t){const n=t.trim().replace(/\s+/g,"");return/^-{3,}$/.test(n)||/^\*{3,}$/.test(n)||/^_{3,}$/.test(n)}function Li(t){const n=t.trim();return/^#{1,6}\s+/.test(n)||xu(t)||/^>\s?/.test(n)||/^(```|~~~)/.test(n)||/^(?:[-+*]|\d+[.)])\s+/.test(n)}function vu(t){const n=t.trim();return/^(https?:|mailto:|#|\/|\.\/|\.\.\/)/i.test(n)||!/^[a-z][a-z0-9+.-]*:/i.test(n)&&!/[<>]/.test(n)?n:null}const yu=o.createContext(null);function Ua(t){return t.trim().replace(/\s+/g," ").toLowerCase()}function wu(t){return t.replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\[[^\]]*\]/g,"$1").replace(/[`*_~]/g,"").replace(/<[^>]+>/g,"").trim()}function ku(t){return t.replace(/\s+#+\s*$/,"").trim()}function Ai(t,n){const l=wu(t).toLowerCase().replace(/[^\p{L}\p{N}\s-]/gu,"").trim().replace(/\s+/g,"-")||"section",d=n.headingSlugCounts.get(l)??0;return n.headingSlugCounts.set(l,d+1),d===0?l:`${l}-${d}`}function bd(t){return wu(t)||t.trim()}function Ga(t){const n=t.match(/^\s{0,3}\[([^\]]+)\]:\s+(.+?)\s*$/);if(!n)return null;const s=Ti(n[2]);return s?{id:Ua(n[1]),definition:{href:s.href,title:s.title}}:null}function vg(t){const n=new Map;for(const s of t){const l=Ga(s);l&&n.set(l.id,l.definition)}return n}function Su(t){return t.trim().toLowerCase()}function ju(t){const n=t.match(/^\s{0,3}\[\^([^\]]+)\]:\s+(.+)\s*$/);return n?{id:Su(n[1]),text:n[2]}:null}function yg(t){const n=new Map;let s=null;for(const l of t){const d=ju(l);if(d){s=d.id,n.set(d.id,{id:d.id,text:d.text,index:n.size+1});continue}if(s&&/^\s{4,}\S/.test(l)){const c=n.get(s);c&&(c.text=`${c.text} ${l.trim()}`);continue}l.trim()&&(s=null)}return n}function Ru(t){const n=new Set;let s=!1;return t.forEach((l,d)=>{if(ju(l)){n.add(d),s=!0;return}if(s&&/^\s{4,}\S/.test(l)){n.add(d);return}l.trim()&&(s=!1)}),n}function wg(t){const n=[...t];let s=0;const l=t[0]?.trim();if(l==="---"||l==="+++"){for(n[0]="",s=1;s<t.length&&t[s].trim()!==l;)n[s]="",s+=1;s<t.length&&(n[s]="",s+=1)}for(;s<t.length;){const d=t[s].trim();if(d.startsWith("<!--")){if(n[s]="",!d.includes("-->")){for(s+=1;s<t.length&&!t[s].includes("-->");)n[s]="",s+=1;s<t.length&&(n[s]="")}s+=1;continue}s+=1}return n}function Cu(t){const n=t.replace(/\/+$/,""),s=n.lastIndexOf("/");return s<=0?s===0?"/":"":n.slice(0,s)}function Rs(t){const n=t.split(/[?#]/,1)[0],s=n.startsWith("/"),l=[];for(const c of n.split("/"))if(!(!c||c===".")){if(c===".."){l.length>0&&l.pop();continue}l.push(c)}return`${s?"/":""}${l.join("/")}`||(s?"/":".")}function Wi(t,n,s){const l=t.trim();if(!l||/^(?:https?:|mailto:|javascript:|data:)/i.test(l)||/^[a-z][a-z0-9+.-]*:/i.test(l))return null;if(l.startsWith("#")){if(!n)return null;try{return{path:n,fragment:decodeURIComponent(l.slice(1))||null,directory:!1}}catch{return null}}const d=l.indexOf("#"),c=d>=0?l.slice(0,d):l,h=d>=0?l.slice(d+1):"",m=c.split("?",1)[0];if(!m)return null;let g,p=null;try{g=decodeURIComponent(m),p=h?decodeURIComponent(h):null}catch{return null}const f=s?Rs(s):null;let k;if(g.startsWith("/")){const y=f&&(g===f||g.startsWith(`${f}/`));k=Rs(f&&!y?`${f}/${g.slice(1)}`:g)}else{if(!n)return null;k=Rs(`${Cu(n)}/${g}`)}return f&&k!==f&&!k.startsWith(`${f}/`)?null:{path:k,fragment:p,directory:/\/$/.test(m)}}function Gi(t,n,s,l,d){const c=t.trim();if(!c||/^(?:javascript|data):/i.test(c))return null;if(/^https?:\/\//i.test(c))return c;if(!l(c.split(/[?#]/,1)[0]))return null;let h;if(c.startsWith("/")){const m=s&&(c===s||c.startsWith(`${s}/`));h=Rs(s&&!m?`${s}/${c.slice(1)}`:c)}else{if(!n)return null;h=Rs(`${Cu(n)}/${c}`)}return d(h)}function kg(t,n,s){return Gi(t,n,s,Oi,l=>`/api/terminal/fs/blob?path=${encodeURIComponent(l)}`)}function Sg(t,n,s){return Gi(t,n,s,Ed,Ld)}const Pi=128,jg=360,ai=480;function Za(t){try{return/\.svg(?=$|[?#&])/i.test(decodeURIComponent(t))}catch{return!1}}function Nu(t,n,s,l,d=0){if(!n||!s)return null;let c,h;return d>0?(c=l>0?Math.min(d,l):d,h=s*c/n):Za(t)?(h=Math.min(Math.max(s,Pi),jg),c=n*h/s):(c=n,h=s),l>0&&c>l&&(h=h*l/c,c=l),h>ai&&(c=c*ai/h,h=ai),{width:Math.max(1,Math.round(c)),height:Math.max(1,Math.round(h))}}function Rg(t){if(!t.startsWith("/api/terminal/fs/blob?"))return null;try{return new URLSearchParams(t.slice(t.indexOf("?"))).get("path")}catch{return null}}function Mu(t){const n=Rg(t),s=te(l=>n?(l.fileChangeVersions.get(n)??0)+l.fileWatchEpoch:0);return n&&s>0?`${t}&v=${s}`:t}function Cg({src:t,alt:n,title:s,requestedWidthPx:l}){const d=Za(t),c=Mu(t),h=Ja(c),m=o.useRef(null),[g,p]=o.useState(!1),[f,k]=o.useState(0),[y,N]=o.useState({status:"loading"}),[_,D]=o.useState(null);o.useLayoutEffect(()=>{const $=m.current,L=$?.parentElement?.parentElement??$?.parentElement;if(!L)return;const A=()=>k(L.clientWidth);if(A(),typeof ResizeObserver>"u")return;const O=new ResizeObserver(A);return O.observe(L),()=>O.disconnect()},[]),o.useEffect(()=>{if(g)return;const $=m.current;if(!$||typeof IntersectionObserver>"u"){p(!0);return}const L=new IntersectionObserver(A=>{A.some(O=>O.isIntersecting)&&(p(!0),L.disconnect())},{rootMargin:"400px"});return L.observe($),()=>L.disconnect()},[g]),o.useEffect(()=>{if(!g)return;const $=new AbortController;let L=null;N({status:"loading"});const A=window.setTimeout(()=>{$.abort(new DOMException("Image fetch timed out","TimeoutError"))},15e3);return Uh(c,{signal:$.signal}).then(async O=>{if(!O.ok)throw new Error(`HTTP ${O.status}`);const I=Number(O.headers.get("X-Image-Width"))||0,a=Number(O.headers.get("X-Image-Height"))||0;return{blob:await O.blob(),width:I,height:a}}).then(({blob:O,width:I,height:a})=>{$.signal.aborted||(L=URL.createObjectURL(O),I>0&&a>0&&D({width:I,height:a}),N({status:"ready",objectUrl:L}))}).catch(()=>{const O=$.signal.reason;$.signal.aborted&&!(O instanceof DOMException&&O.name==="TimeoutError")||N({status:"fallback"})}).finally(()=>{window.clearTimeout(A)}),()=>{window.clearTimeout(A),$.abort(),L&&URL.revokeObjectURL(L)}},[g,c]);const B=Nu(t,_?.width??0,_?.height??0,f,l??0),E=B??(l?{width:f>0?Math.min(l,f):l,height:Math.round(l*.75)}:{width:Pi*2,height:Pi});return e.jsx("div",{ref:m,className:"block max-w-full",style:B?{width:B.width,height:B.height}:void 0,children:y.status==="ready"?e.jsx("img",{src:y.objectUrl,alt:n,title:s,decoding:"async",className:`${d?"":"termdock-fade-in "}block max-h-[480px] max-w-full object-contain`,style:B?{width:B.width,height:B.height}:void 0,onLoad:$=>{if(_)return;const L=$.currentTarget;L.naturalWidth>0&&L.naturalHeight>0&&D({width:L.naturalWidth,height:L.naturalHeight})}}):y.status==="fallback"?e.jsx("img",{src:h,alt:n,title:s,loading:"lazy",decoding:"async",className:"block max-h-[480px] max-w-full object-contain",style:B?{width:B.width,height:B.height}:void 0,onLoad:$=>{if(_)return;const L=$.currentTarget;L.naturalWidth>0&&L.naturalHeight>0&&D({width:L.naturalWidth,height:L.naturalHeight})}}):e.jsx("div",{"aria-hidden":!0,className:"flex max-w-full animate-pulse items-center justify-center rounded bg-surface-elevated/60",style:{width:E.width,height:E.height},children:e.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:n||"…"})})})}function Cs(t,n,s,l,d,c){const h=kg(s,d.markdownFilePath,d.rootPath);if(!h)return c?.fallbackText??``;const m=d.images.length;d.images.push({kind:"image",src:h,alt:n,title:l});const g=e.jsx(Cg,{src:h,alt:n,title:l,requestedWidthPx:c?.requestedWidthPx});return d.onImageOpen&&c?.interactive!==!1?e.jsx("button",{type:"button",className:"my-2 block max-w-full overflow-hidden rounded-md border border-border/20 bg-surface-2 text-left transition hover:border-border-strong focus:outline-none focus:ring-2 focus:ring-ring/45",title:l||n||"Open image",onClick:p=>{p.stopPropagation(),d.onImageOpen?.(m)},children:g},t):e.jsx("span",{className:"my-2 block max-w-full overflow-hidden rounded-md border border-border/20 bg-surface-2",children:g},t)}function oi(t){let n=t,s="";for(;/[.,;:!?)]$/.test(n);)s=`${n.slice(-1)}${s}`,n=n.slice(0,-1);return{linkText:n,suffix:s}}function xd(t){return/^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/.test(t)}function Ti(t){const n=t.trim(),s=n.match(/^<([^>]+)>(?:\s+(?:"([^"]*)"|'([^']*)'|\(([^)]*)\)))?$/);if(s)return{href:s[1],title:s[2]??s[3]??s[4]};const l=n.match(/^(\S+)(?:\s+(?:"([^"]*)"|'([^']*)'|\(([^)]*)\)))?$/);return l?{href:l[1],title:l[2]??l[3]??l[4]}:null}const $u="",Ng=/\\([\\`*{}\[\]#+\-.!_|~>$])/g;function Mg(t){return t.replace(Ng,(n,s)=>`${$u}${s.charCodeAt(0).toString(16).padStart(4,"0")}`)}function vd(t){return t.replace(new RegExp(`${$u}([0-9a-f]{4})`,"g"),(n,s)=>String.fromCharCode(Number.parseInt(s,16))).replace(/\\([()])/g,"$1")}function $g(t){const n=t.replace(/[\r\n]+/g," ");return/^ .+ $/.test(n)&&/[^ ]/.test(n.slice(1,-1))?n.slice(1,-1):n}const Eu={ALLOWED_TAGS:["a","abbr","b","blockquote","br","code","del","details","div","em","i","kbd","li","mark","ol","p","pre","s","span","strong","sub","summary","sup","table","tbody","td","th","thead","tr","u","ul"],ALLOWED_ATTR:["href","title","class","id","colspan","rowspan"],ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!0};let Pa=null;function Lu(){return Pa||(Pa=$s(()=>import("./purify.es-4eNOHKSq.js"),[]).then(t=>t.default??t).catch(t=>{throw Pa=null,t})),Pa}function Au({html:t}){const{t:n}=pt(),[s,l]=o.useState(null);return o.useEffect(()=>{let d=!1;return l(null),Lu().then(c=>{d||l(c.sanitize(t,Eu))}).catch(()=>{d||l("")}),()=>{d=!0}},[t]),s===null?e.jsx("div",{className:"py-2 text-xs text-muted-foreground",children:n("rightSidebar.renderingHtml")}):s?e.jsx("div",{className:"text-muted-foreground",dangerouslySetInnerHTML:{__html:s}}):null}function Eg({html:t}){const[n,s]=o.useState(null);return o.useEffect(()=>{let l=!1;return s(null),Lu().then(d=>{l||s(d.sanitize(t,Eu))}).catch(()=>{l||s("")}),()=>{l=!0}},[t]),n===null?null:n?e.jsx("span",{dangerouslySetInnerHTML:{__html:n}}):t}function Pu(t){const n=t.trim().match(/^<(div|section|article|aside|table|p|ul|ol|li|blockquote|pre|figure|figcaption)\b[^>]*>/i);if(!n)return null;const s=n[1].toLowerCase();return{tag:s,selfContained:new RegExp(`</${s}>`,"i").test(t)}}let Ta=null;function Lg(){return Ta||(Ta=Promise.all([$s(()=>import("./katex-DnlPpQZa.js"),[]),$s(()=>Promise.resolve({}),__vite__mapDeps([16]))]).then(([t])=>t.default??t).catch(t=>{throw Ta=null,t})),Ta}function Ls({tex:t,display:n=!1}){const[s,l]=o.useState(null),[d,c]=o.useState(!1);if(o.useEffect(()=>{let m=!1;return l(null),c(!1),Lg().then(g=>{m||l(g.renderToString(t,{displayMode:n,throwOnError:!1,trust:!1,strict:"ignore"}))}).catch(()=>{m||c(!0)}),()=>{m=!0}},[n,t]),d)return e.jsx("code",{className:"rounded bg-surface-2 px-1 py-0.5 font-mono text-[0.92em] text-foreground",children:n?`$$${t}$$`:`$${t}$`});if(!s)return e.jsx("span",{className:"text-muted-foreground/70",children:n?"Rendering formula...":t});const h=n?"my-2 overflow-auto rounded-md bg-surface-2 px-3 py-2 text-center":"inline-block align-middle";return e.jsx("span",{className:h,dangerouslySetInnerHTML:{__html:s}})}function qi(t){const n=new Map;for(const s of t.matchAll(/([a-zA-Z_:][-a-zA-Z0-9_:.]*)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+))/gi))n.set(s[1].toLowerCase(),s[2]??s[3]??s[4]);return n}function yd(t){const n=qi(t),s=n.get("src")?.trim()??"",l=n.get("width")?.trim().match(/^(\d+(?:\.\d+)?)(?:px)?$/i);return{src:s,alt:n.get("alt"),title:n.get("title"),widthPx:l?Number(l[1]):void 0}}function Ag(t){const n=t.indexOf(">"),s=n<0?t:t.slice(0,n+1),l=qi(s),d=l.get("src")?.trim()??"",c=l.get("width")?.trim().match(/^(\d+(?:\.\d+)?)(?:px)?$/i),h=s.replace(/=\s*(?:"[^"]*"|'[^']*')/g," "),m=n<0?"":t.slice(n+1).replace(/<\/video\s*>$/i,"").replace(/<[^>]*>/g,"").trim();return{src:d,fallbackText:m,widthPx:c?Number(c[1]):void 0,controls:/\bcontrols\b/i.test(h)}}function Pg({url:t,fallbackText:n,widthPx:s,hasControls:l}){const{t:d}=pt(),[c,h]=o.useState(!1),m=Ja(t,()=>h(!0));return m?e.jsx("span",{className:"my-2 block max-w-full overflow-hidden rounded-md border border-border/20 bg-surface-2",children:c?e.jsx("span",{className:"block px-3 py-2 text-xs text-muted-foreground",children:n?.trim()||d("rightSidebar.videoUnsupported")}):e.jsx("video",{className:"block max-w-full",src:m,style:s?{width:`${s}px`}:void 0,controls:l,preload:"metadata",playsInline:!0,onError:()=>h(!0)})}):null}function Tg(t,n,s){if(/^<a\b[^>]*>\s*<\s*img\b[^>]*>\s*<\/a\s*>$/i.test(t)){const h=t.slice(0,t.indexOf(">")+1),m=qi(h).get("href")?.trim()??"",g=t.match(/<\s*img\b[^>]*>/i)?.[0]??"",{src:p,alt:f,title:k,widthPx:y}=yd(g);if(!p)return null;const N=Gi(p,s.markdownFilePath,s.rootPath,Oi,$=>$);if(!N)return null;const _=m?Wi(m,s.markdownFilePath,s.rootPath):null,B=!!!(_&&_.path===N)&&m?vu(m):null,E=Cs(n,f??"",p,k,s,{requestedWidthPx:y,interactive:B?!1:void 0});return B?e.jsx("a",{href:B,target:"_blank",rel:"noreferrer",children:E},n):E}if(/^<\s*img\b[^>]*>$/i.test(t)){const{src:h,alt:m,title:g,widthPx:p}=yd(t);return h?Cs(n,m??"",h,g,s,{fallbackText:t,requestedWidthPx:p}):null}if(/^<\s*video\b[^>]*>[\s\S]*?<\/video\s*>$/i.test(t)){const{src:h,fallbackText:m,widthPx:g,controls:p}=Ag(t);if(!h)return null;const f=Sg(h,s.markdownFilePath,s.rootPath);return f?e.jsx(Pg,{url:f,fallbackText:m,widthPx:g,hasControls:p},n):null}if(/^<br\s*\/?>$/i.test(t))return e.jsx("br",{},n);const l=t.match(/^<(kbd|mark|sub|sup)>(.*?)<\/\1>$/i);if(!l)return/^<(a|abbr|span|b|strong|em|i|u|s|del|code)\b[\s\S]*<\/\1>$/i.test(t)?e.jsx(Eg,{html:t},n):null;const d=l[1].toLowerCase(),c=rt(l[2],`${n}-${d}`,!0,s);return d==="kbd"?e.jsx("kbd",{className:"rounded border border-border/30 bg-surface-2 px-1.5 py-0.5 font-mono text-[0.85em] text-foreground shadow-sm",children:c},n):d==="mark"?e.jsx("mark",{className:"rounded bg-warning/25 px-0.5 text-foreground",children:c},n):d==="sub"?e.jsx("sub",{children:c},n):e.jsx("sup",{children:c},n)}function rt(t,n,s=!0,l){const d=Mg(t),c=/(\\\([^)]*\\\)|\$[^$\n]+\$|<br\s*\/?>|<\s*img\b[^>]*>|<\s*video\b[^>]*>[\s\S]*?<\/video\s*>|<(?:a|abbr|span|b|strong|em|i|u|s|del|code|kbd|mark|sub|sup)\b[\s\S]*?<\/(?:a|abbr|span|b|strong|em|i|u|s|del|code|kbd|mark|sub|sup)>|!?\[[^\]]*\]\((?:<[^>]+>|(?:[^\s()]+|\([^()\s]*\))+)(?:\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\)|!?\[[^\]]+\]\[[^\]]*\]|!?\[[^\]]+\]|\[\^[^\]]+\]|(`+)([\s\S]*?)\2|~~[^~]+~~|\*\*[^*]+\*\*|__[^_]+__|\*[^*\s][^*]*\*|_[^_\s][^_]*_|<https?:\/\/[^>\s]+>|<[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+>|https?:\/\/[^\s<]+|www\.[^\s<]+|[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+)/gi,h=[];let m=0,g;for(;(g=c.exec(d))!==null;){g.index>m&&h.push(vd(d.slice(m,g.index)));const p=g[0],f=`${n}-${g.index}`,k=p.startsWith("<")?Tg(p,f,l):null;if(k)h.push(k);else if(p.startsWith("\\(")&&p.endsWith("\\)"))h.push(e.jsx(Ls,{tex:p.slice(2,-2)},f));else if(p.startsWith("$")&&p.endsWith("$"))h.push(e.jsx(Ls,{tex:p.slice(1,-1)},f));else if(p.startsWith("`")){const y=p.match(/^`+/)?.[0].length??1;h.push(e.jsx("code",{className:`${s?"break-all":"whitespace-nowrap"} rounded bg-surface-2 px-1 py-0.5 font-mono text-[0.92em] text-foreground`,children:$g(p.slice(y,-y))},f))}else if(p.startsWith("~~"))h.push(e.jsx("del",{className:"text-muted-foreground decoration-border-strong",children:rt(p.slice(2,-2),`${f}-del`,s,l)},f));else if(p.startsWith("**")||p.startsWith("__"))h.push(e.jsx("strong",{className:"font-semibold text-foreground",children:rt(p.slice(2,-2),`${f}-strong`,s,l)},f));else if(p.startsWith("*")||p.startsWith("_"))h.push(e.jsx("em",{className:"italic",children:rt(p.slice(1,-1),`${f}-em`,s,l)},f));else if(p.startsWith("![")){const y=p.match(/^!\[([^\]]*)\]\((.*)\)$/),N=p.match(/^!\[([^\]]+)\]\[([^\]]*)\]$/),_=p.match(/^!\[([^\]]+)\]$/);if(y){const D=Ti(y[2]);h.push(D?Cs(f,y[1],D.href,D.title,l):p)}else if(N){const D=N[2]||N[1],B=l.referenceDefinitions.get(Ua(D));h.push(B?Cs(f,N[1],B.href,B.title,l):p)}else if(_){const D=l.referenceDefinitions.get(Ua(_[1]));h.push(D?Cs(f,_[1],D.href,D.title,l):p)}else h.push(p)}else if(p.startsWith("[^")){const y=Su(p.slice(2,-1)),N=l.footnoteDefinitions.get(y);h.push(N?e.jsx("sup",{id:`fnref-${N.id}`,title:N.text,className:"ml-0.5 rounded bg-surface-2 px-1 text-[0.72em] font-semibold text-primary",children:e.jsx("a",{href:`#fn-${N.id}`,className:"text-primary no-underline",children:N.index})},f):p)}else if(p.startsWith("<http")){const y=p.slice(1,-1);h.push(e.jsx("a",{href:y,target:"_blank",rel:"noreferrer",className:`${s?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},f))}else if(p.startsWith("<")&&p.endsWith(">")&&xd(p.slice(1,-1))){const y=p.slice(1,-1);h.push(e.jsx("a",{href:`mailto:${y}`,className:`${s?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},f))}else if(xd(oi(p).linkText)){const{linkText:y,suffix:N}=oi(p);h.push(e.jsx("a",{href:`mailto:${y}`,className:`${s?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},f)),N&&h.push(N)}else if(p.startsWith("http")||p.startsWith("www.")){const{linkText:y,suffix:N}=oi(p),_=y.startsWith("www.")?`https://${y}`:y;h.push(e.jsx("a",{href:_,target:"_blank",rel:"noreferrer",className:`${s?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},f)),N&&h.push(N)}else{const y=p.match(/^\[([^\]]+)\]\((.*)\)$/),N=p.match(/^\[([^\]]+)\]\[([^\]]*)\]$/),_=p.match(/^\[([^\]]+)\]$/),D=N?N[2]||N[1]:_?.[1]??null,B=D?l.referenceDefinitions.get(Ua(D)):null,E=y?Ti(y[2]):null,$=E?.href??B?.href??null,L=$?vu($):null,A=y?.[1]??N?.[1]??_?.[1]??"";h.push(L?e.jsx("a",{href:L,title:E?.title??B?.title,target:"_blank",rel:"noreferrer",className:`${s?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:rt(A,`${f}-link`,s,l)},f):p)}m=c.lastIndex}return m<d.length&&h.push(vd(d.slice(m))),h.length>0?h:[t]}function Tu(t){return/(?: {2,}|\\)$/.test(t)}function Iu(t){return t.replace(/(?: {2,}|\\)$/,"")}function qa(t){return/^(?: {4}|\t)/.test(t)}function _u(t){return t.startsWith(" ")?t.slice(1):t.replace(/^ {4}/,"")}function Du(t,n,s){const l=[];return t.forEach((d,c)=>{const h=Tu(d);l.push(...rt(Iu(d),`${n}-${c}`,!0,s)),c<t.length-1&&l.push(h?e.jsx("br",{},`${n}-${c}-br`):" ")}),l}function Ii(t,n,s){const l=[],d=[];return t.forEach((c,h)=>{d.push(Tu(c)),l.push(rt(Iu(c),`${n}-${h}`,!0,s))}),{perLine:l,hardBreaks:d}}function _i(t,n,s,l,d){const c=[];return t.forEach((h,m)=>{const g=s[m]??0,p=!!(d&&g>=d.start&&g<=d.end);c.push(e.jsx("span",{"data-md-ref-start":g,"data-md-ref-end":g,"data-selected":p?"true":void 0,children:h},`${l}-ref-${m}`)),m<t.length-1&&c.push(n[m]?e.jsx("br",{},`${l}-${m}-br`):" ")}),c}function As(t){const n=t.trim().replace(/^\|/,"").replace(/\|$/,""),s=[];let l="",d=!1,c=0,h=0;for(let m=0;m<n.length;m+=1){const g=n[m];if(d){l+=g,d=!1;continue}if(g==="\\"){d=!0;continue}if(g==="`"){const p=m;for(;m+1<n.length&&n[m+1]==="`";)m+=1;const f=m-p+1;l+="`".repeat(f),c===0?c=f:c===f&&(c=0);continue}if(c===0&&g==="["?h+=1:c===0&&g==="]"&&h>0&&(h-=1),g==="|"&&c===0&&h===0){s.push(l.trim()),l="";continue}l+=g}return d&&(l+="\\"),s.push(l.trim()),s}function Fu(t){return As(t).map(n=>/^:-+:$/.test(n)?"center":/^-+:$/.test(n)?"right":/^:-+$/.test(n)?"left":null)}function Ka(t){return t==="center"?"text-center":t==="right"?"text-right":"text-left"}function Va(t){return/^\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)*\|?$/.test(t.trim())}function Bu(t,n){return t>96||t>44&&n>.35}function eo(t){return(t.match(/^\s*/)?.[0]??"").replace(/\t/g," ").length}function Ps(t){const n=t.trim().match(/^([-+*]|\d+[.)])\s+(.+)$/);if(!n)return null;const s=/^\d+[.)]$/.test(n[1]);return{ordered:s,start:s?Number.parseInt(n[1],10):void 0,content:n[2]}}function Ki(t,n,s,l,d,c=new Set){const h=[],m=[];let g=n;for(;g<t.length;){const p=t[g];if(d&&(Ga(p)||c.has(g))){g+=1;continue}const f=Ps(p),k=eo(p);if(!f){if(k>s&&m.length>0){([...m].reverse().find(D=>D.indent<k)?.item??m[m.length-1].item).paragraphs.push(p.trim());for(const D of m)D.item.lineEnd=g+1;g+=1;continue}break}if(k<s||k===s&&f.ordered!==l)break;const y={content:f.content,ordered:f.ordered,start:f.start,children:[],paragraphs:[],lineStart:g+1,lineEnd:g+1};for(;m.length>0&&m[m.length-1].indent>=k;)m.pop();const N=m[m.length-1]?.item??null;N?N.children.push(y):h.push(y),m.push({indent:k,item:y});for(const _ of m)_.item.lineEnd=g+1;g+=1}return{items:h,nextIndex:g}}function Ig(t){const n=t.find(l=>Ps(l));if(!n)return[];const s=Ps(n);return s?Ki(t,0,eo(n),s.ordered,!0,Ru(t)).items:[]}function Vi(t,n,s,l=0){return t.map((d,c)=>{const h=d.content.match(/^\[([ xX])\]\s+(.+)$/);return{key:`item-${c}`,taskItem:!!h,refStart:d.lineStart+l,refEnd:d.lineEnd+l,content:e.jsxs(e.Fragment,{children:[h?e.jsx("input",{type:"checkbox",checked:h[1].toLowerCase()==="x",readOnly:!0,className:"mr-2 align-[-2px] accent-primary"}):null,rt(h?.[2]??d.content,`li-${n}-${c}`,!0,s),d.paragraphs.length>0&&e.jsx("div",{className:"mt-1 space-y-1 text-muted-foreground",children:d.paragraphs.map((m,g)=>e.jsx("p",{children:rt(m,`li-${n}-${c}-p-${g}`,!0,s)},`paragraph-${g}`))})]}),groups:_g(d.children,`${n}-${c}`,s,l)}})}function _g(t,n,s,l=0){const d=[];for(const c of t){const h=d[d.length-1];h&&h.ordered===c.ordered?h.items.push(c):d.push({ordered:c.ordered,items:[c]})}return d.map((c,h)=>({ordered:c.ordered,start:c.ordered?c.items[0]?.start:void 0,items:Vi(c.items,`${n}-g${h}`,s,l)}))}function Yi(t,n){return t.map(s=>{const l=!!(n&&s.refStart<=n.end&&s.refEnd>=n.start);return e.jsxs("li",{className:s.taskItem?"list-none":void 0,"data-md-ref-start":s.refStart,"data-md-ref-end":s.refEnd,"data-selected":l?"true":void 0,children:[s.content,s.groups.length>0&&Dg(s.groups,n)]},s.key)})}function Dg(t,n){return t.map((s,l)=>{const d=s.ordered?"ol":"ul";return e.jsx(d,{start:s.start,className:`${s.ordered?"list-decimal":"list-disc"} mt-1 space-y-0.5 pl-4 marker:text-muted-foreground/60`,children:Yi(s.items,n)},`nested-${l}`)})}function Fg(t){const n=Array.from(t.footnoteDefinitions.values()).sort((s,l)=>s.index-l.index);return n.length===0?null:e.jsxs("section",{className:"mt-3 border-t border-border/20 pt-2 text-[12px] leading-5 text-muted-foreground",children:[e.jsx("div",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/80",children:t.footnotesLabel}),e.jsx("ol",{className:"list-decimal space-y-1 pl-5",children:n.map(s=>e.jsxs("li",{id:`fn-${s.id}`,children:[rt(s.text,`footnote-${s.id}`,!0,t)," ",e.jsx("a",{href:`#fnref-${s.id}`,className:"text-primary no-underline","aria-label":t.backToFootnoteLabel(s.index),children:"↩"})]},s.id))})]})}function Bg(t,n,s,l){const d=[];let c=0;const h=m=>l?.[m]??m+1;for(;c<t.length;){const m=t[c],g=m.trim();if(!g){c+=1;continue}if(/^<details>\s*$/i.test(g)){const E=c;let $="Details";const L=[];for(c+=1;c<t.length&&!/^<\/details>\s*$/i.test(t[c].trim());){const A=t[c].trim().match(/^<summary>(.*?)<\/summary>\s*$/i);A?$=A[1].trim()||$:L.push(t[c].trimStart()),c+=1}c<t.length&&(c+=1),d.push({kind:"static",node:e.jsxs("details",{className:"overflow-hidden rounded-lg border border-border/20 bg-surface px-3 py-2 text-muted-foreground",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-foreground",children:rt($,`${n}-details-${E}-summary`,!0,s)}),L.length>0&&e.jsx("div",{className:"mt-2 text-sm leading-6",children:Du(L,`${n}-details-${E}`,s)})]},`${n}-details-${E}`)});continue}const p=Pu(m);if(p){const E=[m],$=c;for(c+=1;c<t.length&&!p.selfContained&&!new RegExp(`</${p.tag}>`,"i").test(t[c]);)E.push(t[c]),c+=1;c<t.length&&!p.selfContained&&(E.push(t[c]),c+=1),d.push({kind:"static",node:e.jsx(Au,{html:E.join(`
|
|
1639
1639
|
`)},`${n}-html-${$}`)});continue}const f=g.match(/^(```|~~~)\s*(.*)$/);if(f){const E=[],$=f[1],L=f[2]?.trim(),A=c;for(c+=1;c<t.length&&!t[c].trim().startsWith($);)E.push(t[c]),c+=1;c<t.length&&(c+=1),L.toLowerCase()==="mermaid"?d.push({kind:"static",node:e.jsx(Uu,{code:E.join(`
|
|
1640
1640
|
`),blockKey:`${n}-code-${A}`},`${n}-code-${A}`)}):["math","latex","tex"].includes(L.toLowerCase())?d.push({kind:"static",node:e.jsx(Ls,{tex:E.join(`
|
|
1641
1641
|
`),display:!0},`${n}-code-${A}`)}):d.push({kind:"code",key:`${n}-code-${A}`,code:E.join(`
|
|
1642
1642
|
`),lang:L,blockKey:`${n}-code-${A}`,codeStartLine:h(A)+1});continue}if(qa(m)){const E=[],$=c;for(;c<t.length&&(qa(t[c])||!t[c].trim());)E.push(t[c].trim()?_u(t[c]):""),c+=1;d.push({kind:"code",key:`${n}-indented-code-${$}`,code:E.join(`
|
|
1643
|
-
`).replace(/\n+$/,""),lang:"",blockKey:`${n}-indented-code-${$}`,codeStartLine:h($)});continue}const k=g.match(/^(#{1,6})\s+(.+)$/);if(k){const $=`h${Math.min(6,k[1].length+1)}`,L=ku(k[2]),A=Ai(L,s);d.push({kind:"static",node:e.jsx($,{id:A,className:"scroll-mt-16 font-semibold text-foreground",children:rt(L,`${n}-heading-${c}`,!0,s)},`${n}-heading-${c}`)}),c+=1;continue}if(c+1<t.length&&m.includes("|")&&Va(t[c+1])){const E=As(m),$=Fu(t[c+1]),L=[],A=c;for(c+=2;c<t.length&&t[c].includes("|")&&t[c].trim();)L.push(As(t[c])),c+=1;d.push({kind:"static",node:e.jsx("div",{className:uu,"data-markdown-table-scroll":!0,children:e.jsxs("table",{className:"w-max min-w-full max-w-none table-auto border-collapse text-left text-[11px] sm:text-xs",children:[e.jsx("thead",{className:"bg-surface-2 text-foreground",children:e.jsx("tr",{children:E.map((O,I)=>e.jsx("th",{className:`${cu} ${Ka($[I]??null)}`,children:e.jsx("div",{className:Wa,children:rt(O,`${n}-th-${A}-${I}`,!0,s)})},`h-${I}`))})}),e.jsx("tbody",{children:L.map((O,I)=>e.jsx("tr",{className:"border-t border-border/10",children:E.map((a,w)=>e.jsx("td",{className:`${du} ${Ka($[w]??null)}`,children:e.jsx("div",{className:Wa,children:rt(O[w]??"",`${n}-td-${A}-${I}-${w}`,!0,s)})},`c-${w}`))},`r-${I}`))})]})},`${n}-table-${A}`)});continue}const y=Ps(m);if(y){const E=y.ordered,$=eo(m),L=y.start,A=c,O=Ki(t,c,$,E,!1);c=O.nextIndex,d.push({kind:"list",keyPrefix:`${n}-list-${A}`,ordered:E,start:E?L:void 0,renders:Vi(O.items,`${n}-list-${A}`,s,h(0)-1)});continue}const N=[m.trimStart()],_=[h(c)],D=c;for(c+=1;c<t.length&&t[c].trim()&&!Li(t[c])&&!(c+1<t.length&&t[c].includes("|")&&Va(t[c+1]));)N.push(t[c].trimStart()),_.push(h(c)),c+=1;const B=Ii(N,`${n}-p-${D}`,s);d.push({kind:"paragraph",keyPrefix:`${n}-p-${D}`,perLine:B.perLine,hardBreaks:B.hardBreaks,lineNums:_})}return d}function Og(t,n){return t.map(s=>{switch(s.kind){case"static":return s.node;case"paragraph":return e.jsx("p",{children:_i(s.perLine,s.hardBreaks,s.lineNums,s.keyPrefix,n)},s.keyPrefix);case"list":{const l=s.ordered?"ol":"ul";return e.jsx(l,{start:s.start,className:`${s.ordered?"list-decimal":"list-disc"} space-y-0.5 pl-4 marker:text-muted-foreground/70`,children:Yi(s.renders,n)},s.keyPrefix)}case"code":return e.jsx(Ya,{code:s.code,lang:s.lang,blockKey:s.blockKey,codeStartLine:s.codeStartLine,lineRange:n},s.key)}})}let Ia=null,wd=!1;const _a=16,Ou=192;function Ug(){return Ia||(Ia=$s(()=>import("./mermaid.core-
|
|
1643
|
+
`).replace(/\n+$/,""),lang:"",blockKey:`${n}-indented-code-${$}`,codeStartLine:h($)});continue}const k=g.match(/^(#{1,6})\s+(.+)$/);if(k){const $=`h${Math.min(6,k[1].length+1)}`,L=ku(k[2]),A=Ai(L,s);d.push({kind:"static",node:e.jsx($,{id:A,className:"scroll-mt-16 font-semibold text-foreground",children:rt(L,`${n}-heading-${c}`,!0,s)},`${n}-heading-${c}`)}),c+=1;continue}if(c+1<t.length&&m.includes("|")&&Va(t[c+1])){const E=As(m),$=Fu(t[c+1]),L=[],A=c;for(c+=2;c<t.length&&t[c].includes("|")&&t[c].trim();)L.push(As(t[c])),c+=1;d.push({kind:"static",node:e.jsx("div",{className:uu,"data-markdown-table-scroll":!0,children:e.jsxs("table",{className:"w-max min-w-full max-w-none table-auto border-collapse text-left text-[11px] sm:text-xs",children:[e.jsx("thead",{className:"bg-surface-2 text-foreground",children:e.jsx("tr",{children:E.map((O,I)=>e.jsx("th",{className:`${cu} ${Ka($[I]??null)}`,children:e.jsx("div",{className:Wa,children:rt(O,`${n}-th-${A}-${I}`,!0,s)})},`h-${I}`))})}),e.jsx("tbody",{children:L.map((O,I)=>e.jsx("tr",{className:"border-t border-border/10",children:E.map((a,w)=>e.jsx("td",{className:`${du} ${Ka($[w]??null)}`,children:e.jsx("div",{className:Wa,children:rt(O[w]??"",`${n}-td-${A}-${I}-${w}`,!0,s)})},`c-${w}`))},`r-${I}`))})]})},`${n}-table-${A}`)});continue}const y=Ps(m);if(y){const E=y.ordered,$=eo(m),L=y.start,A=c,O=Ki(t,c,$,E,!1);c=O.nextIndex,d.push({kind:"list",keyPrefix:`${n}-list-${A}`,ordered:E,start:E?L:void 0,renders:Vi(O.items,`${n}-list-${A}`,s,h(0)-1)});continue}const N=[m.trimStart()],_=[h(c)],D=c;for(c+=1;c<t.length&&t[c].trim()&&!Li(t[c])&&!(c+1<t.length&&t[c].includes("|")&&Va(t[c+1]));)N.push(t[c].trimStart()),_.push(h(c)),c+=1;const B=Ii(N,`${n}-p-${D}`,s);d.push({kind:"paragraph",keyPrefix:`${n}-p-${D}`,perLine:B.perLine,hardBreaks:B.hardBreaks,lineNums:_})}return d}function Og(t,n){return t.map(s=>{switch(s.kind){case"static":return s.node;case"paragraph":return e.jsx("p",{children:_i(s.perLine,s.hardBreaks,s.lineNums,s.keyPrefix,n)},s.keyPrefix);case"list":{const l=s.ordered?"ol":"ul";return e.jsx(l,{start:s.start,className:`${s.ordered?"list-decimal":"list-disc"} space-y-0.5 pl-4 marker:text-muted-foreground/70`,children:Yi(s.renders,n)},s.keyPrefix)}case"code":return e.jsx(Ya,{code:s.code,lang:s.lang,blockKey:s.blockKey,codeStartLine:s.codeStartLine,lineRange:n},s.key)}})}let Ia=null,wd=!1;const _a=16,Ou=192;function Ug(){return Ia||(Ia=$s(()=>import("./mermaid.core-BLtEkDK8.js").then(t=>t.bl),__vite__mapDeps([17,1,2,3,4,5,18])).then(t=>t.default??t).catch(t=>{throw Ia=null,t})),Ia}function Hg(t){wd||(t.initialize({startOnLoad:!1,securityLevel:"strict",theme:"neutral"}),wd=!0)}function zg(t){const n=t.match(/\sviewBox=(["'])([^"']+)\1/i);if(!n)return t;const[,,s]=n,l=s.trim().split(/[\s,]+/).map(Number),[,,d,c]=l;if(!Number.isFinite(d)||!Number.isFinite(c)||d<=0||c<=0)return t;const h=Math.max(Ou,Math.ceil(d)),m=Math.ceil(h/d*c);return t.replace(/<svg\b([^>]*)>/i,(g,p)=>`<svg${p.replace(/\s(?:width|height)=(["']).*?\1/gi,"").replace(/\sstyle=(["']).*?\1/gi,"")} width="${h}" height="${m}">`)}function Wg(t){const n=t?.querySelector("svg");if(!n)return;let s;try{s=n.getBBox()}catch{return}if(!Number.isFinite(s.width)||!Number.isFinite(s.height)||s.width<=0||s.height<=0)return;const l=s.x-_a,d=s.y-_a,c=s.width+_a*2,h=s.height+_a*2,m=Math.max(Ou,Math.ceil(c)),g=Math.ceil(m/c*h);n.setAttribute("viewBox",`${l} ${d} ${c} ${h}`),n.setAttribute("width",String(m)),n.setAttribute("height",String(g)),n.removeAttribute("style")}function Gg(t){const n=t.trim().split(/\s+/,1)[0]?.toLowerCase();if(!n)return null;const s=n.replace(/^language-/,"");return Od(`code.${s}`)??s}function Uu({code:t,blockKey:n}){const{t:s}=pt(),[l,d]=o.useState(null),[c,h]=o.useState(!1),m=o.useRef(null),g=o.useContext(yu);o.useEffect(()=>{let f=!1;return d(null),h(!1),Ug().then(async k=>{Hg(k);const y=`termdock-md-mermaid-${n.replace(/[^a-zA-Z0-9_-]/g,"-")}`,{svg:N}=await k.render(y,t);f||d(zg(N))}).catch(()=>{f||h(!0)}),()=>{f=!0}},[n,t]),o.useLayoutEffect(()=>{l&&Wg(m.current)},[l]);const p=o.useCallback(()=>{const f=m.current?.querySelector("svg")?.outerHTML??l;f&&g?.(f)},[g,l]);return c?e.jsx(Ya,{code:t,lang:"mermaid",blockKey:`${n}-fallback`}):e.jsxs("div",{className:"overflow-hidden rounded-lg border border-border/20 bg-surface shadow-sm",children:[e.jsx("div",{className:"border-b border-border/15 bg-surface-2 px-3 py-1.5 text-[10px] uppercase tracking-wide text-muted-foreground",children:"mermaid"}),e.jsx("div",{className:"bg-surface p-3",children:l?e.jsx("button",{type:"button",className:"block max-w-full rounded text-left focus:outline-none focus:ring-2 focus:ring-ring/45",title:s("rightSidebar.openMermaidDiagram"),onClick:f=>{f.stopPropagation(),p()},children:e.jsx("span",{ref:m,role:"img","aria-label":s("rightSidebar.mermaidDiagram"),className:"block max-h-[70vh] max-w-full overflow-auto rounded bg-white p-2 text-slate-900 [&_svg]:block [&_svg]:h-auto [&_svg]:max-w-full",dangerouslySetInnerHTML:{__html:l}})}):e.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:s("rightSidebar.renderingDiagram")})})]})}function Ya({code:t,lang:n,blockKey:s,codeStartLine:l,lineRange:d}){const c=Gg(n),[h,m]=o.useState(null);o.useEffect(()=>{if(!c||!Ud(t)){m(null);return}let p=!1;return Hd().then(f=>{if(p||!f.registered(c)){p||m(null);return}try{m(Wd(f,t,c))}catch{p||m(null)}}).catch(()=>{p||m(null)}),()=>{p=!0}},[s,t,c]);const g=h??(t||" ").split(`
|
|
1644
1644
|
`).map(p=>[p||" "]);return e.jsxs("div",{className:"overflow-hidden rounded-lg border border-border/20 bg-surface shadow-sm",children:[n&&e.jsx("div",{className:"border-b border-border/15 bg-surface-2 px-3 py-1.5 text-[10px] uppercase tracking-wide text-muted-foreground",children:n}),e.jsx("pre",{className:`${zi} termdock-code overflow-auto p-3 text-[11px] leading-relaxed text-foreground`,children:e.jsx("code",{children:g.map((p,f)=>{const k=l!=null?l+f:null,y=!!(d&&k!=null&&k>=d.start&&k<=d.end);return e.jsxs("span",{"data-md-ref-start":k??void 0,"data-md-ref-end":k??void 0,"data-selected":y?"true":void 0,children:[p,f<g.length-1?`
|
|
1645
1645
|
`:null]},`${s}-line-${f}`)})})})]})}function Xi(t,n,s,l,d){t=wg(t);const c=vg(t),h=Ru(t),m=[],g={markdownFilePath:n,rootPath:s,referenceDefinitions:c,footnoteDefinitions:yg(t),headingSlugCounts:new Map,images:m,onImageOpen:l,footnotesLabel:d?.footnotes??"Footnotes",backToFootnoteLabel:d?.backToFootnote??(y=>`Back to footnote ${y}`)},p=[];let f=0;for(;f<t.length;){const y=t[f],N=y.trim();if(Ga(y)||h.has(f)){f+=1;continue}if(!N){f+=1;continue}if(/^<details>\s*$/i.test(N)){const I=f;let a="Details";const w=[];for(f+=1;f<t.length&&!/^<\/details>\s*$/i.test(t[f].trim());){const U=t[f].trim().match(/^<summary>(.*?)<\/summary>\s*$/i);U?a=U[1].trim()||a:w.push(t[f].trimStart()),f+=1}f<t.length&&(f+=1),p.push({key:`details-${I}`,startLine:I+1,endLine:f,content:e.jsxs("details",{className:"overflow-hidden rounded-lg border border-border/20 bg-surface px-3 py-2 text-muted-foreground",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-foreground",children:rt(a,`details-${I}-summary`,!0,g)}),w.length>0&&e.jsx("div",{className:"mt-2 text-sm leading-6",children:Du(w,`details-${I}`,g)})]})});continue}const _=Pu(y);if(_){const I=[y],a=f;for(f+=1;f<t.length&&!_.selfContained&&!new RegExp(`</${_.tag}>`,"i").test(t[f]);)I.push(t[f]),f+=1;f<t.length&&!_.selfContained&&(I.push(t[f]),f+=1),p.push({key:`html-${a}`,startLine:a+1,endLine:f,content:e.jsx(Au,{html:I.join(`
|
|
1646
1646
|
`)})});continue}const D=N.match(/^(```|~~~)\s*(.*)$/);if(D){const I=[],a=D[1],w=D[2]?.trim(),U=f;for(f+=1;f<t.length&&!t[f].trim().startsWith(a);)I.push(t[f]),f+=1;f<t.length&&(f+=1),p.push({key:`code-${U}`,startLine:U+1,endLine:f,fineGrained:w.toLowerCase()!=="mermaid"&&!["math","latex","tex"].includes(w.toLowerCase()),content:w.toLowerCase()==="mermaid"?e.jsx(Uu,{code:I.join(`
|
|
@@ -1675,4 +1675,4 @@ ${ie}
|
|
|
1675
1675
|
`)},[_r,Vt,Rt,yr,b]),zf=o.useCallback((r="generate")=>{const i=r==="generate"?Uo:[r==="regenerate"?"模式:重新生成。请基于当前分支导出结果重新生成全部 hunk 解释并覆盖写回。":"模式:补充失效。请基于当前分支导出结果只补充新增、变更或已失效的 hunk 解释,仍有效的解释不要重复写回。","",Uo].join(`
|
|
1676
1676
|
`);Wr(a("rightSidebar.branchAuditShort"),i,`context:branch-audit-scope:${r}`),d||s()},[Uo,Wr,s,d,a]),Wf=o.useCallback(async()=>{if(!b||Vt.length===0)return;const r=b;z(!0),xe(null),Zt(null),$e(null);try{const i=await Promise.all(Vt.map(async H=>{const Y=Rt[H.root]?.trim();if(!Y)throw new Error(a("rightSidebar.branchAuditMissingBase",{repo:H.label}));const ke=(yr[H.root]||H.branch||"").trim();return Ph({cwd:b,repoRoot:H.root,base:Y,head:ke&&ke!==H.branch?ke:null,includeUncommitted:_r,requestSlotId:`right-sidebar-branch-preview:${H.root}`})}));if(!je(r))return;const u=i.find(H=>!H.available);if(u){xe(u.error??"Branch diff is unavailable");return}const x=i.length===1?i[0]:{available:!0,workspaceRoot:b,repoRoot:b,baseRef:i.map(H=>H.baseRef??H.baseBranch).filter(Boolean).join(", "),currentBranch:i.map(H=>H.currentBranch??"HEAD").filter(Boolean).join(", "),headRef:i.map(H=>H.headRef).filter(Boolean).join(", "),diffFingerprint:i.map(H=>H.diffFingerprint).filter(Boolean).join("+"),stat:i.map(H=>H.stat).filter(Boolean).join(`
|
|
1677
1677
|
`),files:i.flatMap((H,Y)=>{const ke=Vt[Y];return(H.files??[]).map(Ie=>`${ke?.label??H.repoRoot??"repo"}/${Ie}`)}),hunks:i.flatMap((H,Y)=>{const Ie=Vt[Y]?.label??H.repoRoot??"repo";return(H.hunks??[]).map(Ge=>({...Ge,filePath:`${Ie}/${Ge.filePath}`,oldPath:Ge.oldPath?`${Ie}/${Ge.oldPath}`:Ge.oldPath,newPath:Ge.newPath?`${Ie}/${Ge.newPath}`:Ge.newPath}))}),commits:i.flatMap(H=>H.commits??[]),commitCount:i.reduce((H,Y)=>H+(Y.commitCount??Y.commits?.length??0),0),diff:i.map(H=>H.diff).filter(Boolean).join(`
|
|
1678
|
-
`),truncated:i.some(H=>H.truncated)};if((x.hunks??[]).length===0){xe(a("rightSidebar.branchAuditDiffEmpty"));return}const v=Date.now(),R=["preview",x.repoRoot??b,x.baseRef??x.baseBranch??"",x.currentBranch??"",x.headRef??"",x.diffFingerprint??v].join("\0"),T=Vt.length===1?Vt[0].label:`${Vt.length} repos`;Zt(x),Qn(H=>[{key:R,diff:x,repoLabel:T,createdAt:v},...H.filter(Y=>Y.key!==R)].slice(0,8)),jn(H=>H[R]===void 0?H:{...H,[R]:0}),tn(R),rn(x.hunks?.[0]?`${x.hunks[0].filePath}\0${x.hunks[0].hunkHeader}\0${x.hunks[0].hunkIndex}`:null),Qt(!0)}catch(i){if(!je(r)||dr(i))return;xe(i instanceof Error?i.message:"Failed to load branch diff")}finally{je(r)&&z(!1)}},[_r,Vt,Rt,yr,je,b,a]),Gf=o.useCallback(r=>{Zt(r.diff),xe(null),tn(r.key),rn(r.diff.hunks?.[0]?`${r.diff.hunks[0].filePath}\0${r.diff.hunks[0].hunkHeader}\0${r.diff.hunks[0].hunkIndex}`:null),Qt(!0)},[]),qf=o.useCallback(r=>{Qn(i=>i.filter(u=>u.key!==r)),jn(i=>{if(!(r in i))return i;const u={...i};return delete u[r],u}),Ze===r&&(tn(null),Zt(null),Qt(!1))},[Ze]),Kf=o.useCallback(r=>{const i=Un.find(u=>u.key===r);i&&(Zt(null),xe(null),tn(r),rn(i.records[0]?.filePath??null),Qt(!0))},[Un]),Vf=o.useCallback(async r=>{if(!b||!ye)return;const[i]=r.split(/\s+/);if(i){Fe(i),ot(null),$e(null);try{const u=await Th({cwd:b,repoRoot:ye,commit:i,requestSlotId:"right-sidebar-commit-diff"});if(!u.available){ot(u.error??"Commit diff is unavailable");return}$e(u);const x=u.hunks?.[0];Fs(x?`${x.filePath}\0${x.hunkHeader}\0${x.hunkIndex}`:null)}catch(u){ot(u instanceof Error?u.message:"Failed to load commit diff")}finally{Fe(null)}}},[ye,b]),Yf=o.useCallback(r=>{if(!Me||!Ze)return;const i=Math.max(0,Math.round(r));jn(u=>Math.abs((u[Ze]??0)-i)<24?u:{...u,[Ze]:i})},[Me,Ze]);o.useEffect(()=>{!ee||!xr||!Me||is(1)},[xr,Me,ee,is]);const mc=o.useCallback(r=>{r&&df(i=>im(i,r))},[]),pc=Xs.key===Ye?Xs.key:null,ya=o.useCallback(r=>{const i=te.getState(),u=pb();Fa("select_diff_file",{interactionId:u,path:r,previousSelectedFilePath:i.selectedFilePath,rootPath:i.rootPath,activeGitRepoRoot:ce,changedFiles:i.changedFiles.size,gitBundleLoading:i.gitBundleLoading,gitBundleLastLoadedAt:i.gitBundleLastLoadedAt,rightTab:i.rightTab}),Xe(r),on("diff"),ee&&r&&is(1),mc(r),queueMicrotask(()=>{const x=te.getState();Fa("select_diff_file_after",{interactionId:u,requestedPath:r,selectedFilePath:x.selectedFilePath,rootPath:x.rootPath,rightTab:x.rightTab,changedFiles:x.changedFiles.size,activeGitRepoRoot:ce})})},[ce,ee,mc,Xe,on,is]),gc=o.useCallback(r=>{const i=Array.from(ve.values()).find(u=>{const x=lt(u,b),v=ht(u);return u.path===r.filePath||v===r.filePath||u.absolutePath===r.filePath||(x?`${x}/${u.path}`===r.filePath:!1)||r.repoRoot&&x===r.repoRoot&&u.path===r.filePath});if(i){ya(ht(i)),window.setTimeout(()=>bn(r),90),window.setTimeout(()=>bn(r),320),window.setTimeout(()=>bn(r),760);return}bn(r)},[ve,b,ya]),bc=o.useCallback(({slideToDetail:r,fullscreen:i,toggleFullscreen:u}={})=>Xn.length>0?e.jsx(Dd,{walkthroughs:Xn,repoRoot:ce,fullscreen:i,onToggleFullscreen:u,onNavigate:x=>{ee&&window.requestAnimationFrame(()=>r?.()),gc(x)}}):e.jsxs("div",{className:"rounded-lg border border-border/15 bg-surface px-3 py-6 text-center text-xs text-muted-foreground",children:[e.jsx(Es,{size:18,className:"mx-auto mb-2 text-muted-foreground/80"}),a("rightSidebar.changeWalkthroughEmpty")]}),[ce,Xn,gc,ee,a]),Xf=o.useCallback(r=>{r&&Er(i=>{const u=new Set(i);return u.has(r)?u.delete(r):u.add(r),si(Zo,u),u})},[]),xc=o.useCallback(r=>{to(i=>{const u=new Set(i);return u.has(r)?u.delete(r):u.add(r),si(nd,u),u})},[]),wa=o.useCallback(r=>{Is(r),vt(ru,r)},[]);o.useEffect(()=>{ha||St!=="ai"||wa("tree")},[St,wa,ha]);const Ho=o.useCallback(()=>{_s(r=>{const i=!r;return vt(nu,i),i})},[]),vc=o.useCallback(r=>{Vr(r),vt(su,r)},[]),{whitespace:yc,context:wc}=cm(),kc=o.useMemo(()=>({algorithm:"histogram",whitespace:yc,context:wc}),[yc,wc]),Sc=o.useCallback(r=>{F(r),vt(au,r)},[]),ka=o.useCallback(async(r,i,u,x)=>{let v=r;for(;v.ok&&v.status==="running";)await new Promise(T=>window.setTimeout(T,1500)),v=await Uc({jobId:v.jobId,cwd:i.cwd,action:i.action});if(!v.ok)throw new Error("Git action status is unavailable");if(v.status==="error")throw new Error(v.error||v.message||"Git action failed");const R={action:i.action,path:x,label:u};return rs(R),window.setTimeout(()=>rs(T=>T?.action===R.action&&T.path===R.path?null:T),1400),v},[]),it=o.useCallback(async(r,i,u)=>{const x=b;b&&ir.current.delete(b),ut(null),rs(null),ts({action:r.action,path:u});try{const v=await Ih({...r,includeNested:zn(b)}),R=await ka(v,r,i,u);if(!je(x))return!1;const T=b?await Ca(b,void 0,{includeNested:zn(b),cacheOnly:!0,action:"git_action_cache_sync",requestSlotId:Gn(b)}).catch(()=>R.bundle):R.bundle;return je(x)?(T&&Hr(T,{reloadDiff:!0,cacheOnly:!0}),Dr(null),!0):!1}catch(v){return rs(null),ut(a("rightSidebar.gitActionFailed",{message:v instanceof Error?v.message:"Unknown error"})),!1}finally{je(x)&&ts(null)}},[Hr,je,b,a,ka]),jc=o.useCallback(async r=>{const i=b,u=await _h({...r,includeNested:zn(b)});if(!je(i))return;const x=b?await Ca(b,void 0,{includeNested:zn(b),cacheOnly:!0,action:"git_action_cache_sync",requestSlotId:Gn(b)}).catch(()=>u.bundle):u.bundle;je(i)&&x&&Hr(x,{reloadDiff:!0,cacheOnly:!0})},[Hr,je,b]),Sa=o.useCallback((r,i,u)=>{if(i){if(r==="stage-all"){it({action:"stage-all",cwd:i},a("rightSidebar.stageAll"),`repo:${i}`);return}Dr({kind:"stash-all",repoRoot:i,repoLabel:u})}},[it,a]),Rc=o.useCallback(r=>{Je(r),ni(b,r),Gs(""),qs(""),Ks(""),Xe(Jl(r)),Ke||on("diff"),r&&r!==b&&V.find(u=>u.root===r)?.deferred&&Kt(r,{includeNested:!1,background:!0,replaceRepoRoot:r})},[Jl,Ke,V,Kt,b,Xe,on]),Cc=o.useCallback(r=>{const i=new Set([...Dt.current.keys(),...cn.current,...ir.current]);for(const u of i)u!==r&&(_t.current.delete(u),Dt.current.get(u)?.abort(),Dt.current.delete(u),xt(`right-sidebar-git-untracked:${u}`),cn.current.delete(u),ir.current.delete(u))},[]),Jf=o.useCallback(async r=>{const i=b;if(!i||(await te.getState().setNestedGitScanRoot(i,r),!je(i)))return;if(r){await Kt(i,{includeNested:!0,discoverOnly:!0,replaceWorkspace:!0,background:!0,reloadDiff:!0});return}Cc(i),Gs(""),qs(""),Ks(""),oo(x=>x.filter(v=>v===i));const u=Ft;u&<(u,i)!==i&&Xe(null),await Kt(i,{includeNested:!1,replaceWorkspace:!0,background:!0,reloadDiff:!0})},[Cc,je,Kt,b,Xe,Ft]),Qf=o.useCallback(async()=>{if(!ye||ze){ut(a("rightSidebar.selectRepositoryForGitActions"));return}const r=ns.trim();!r||r===ue?.branch||await it({action:"switch-branch",cwd:ye,branch:r},a("rightSidebar.switchBranch"))},[ue?.branch,ye,ze,it,ns,a]),Nc=o.useCallback(async()=>{if(!ye||ze){ut(a("rightSidebar.selectRepositoryForGitActions"));return}const r=Ws.trim();if(!r)return;await it({action:"commit",cwd:ye,message:r},a("rightSidebar.commitChanges"))&&ll("")},[ye,Ws,ze,it,a]),Zf=o.useCallback(async()=>{if(!ye||ze){ut(a("rightSidebar.selectRepositoryForGitActions"));return}const r=sn.trim(),i=an.trim();await it({action:"push",cwd:ye,...r?{remote:r}:{},...i?{branch:i}:{}},a("rightSidebar.pushChanges"))},[ye,an,sn,ze,it,a]),eh=o.useCallback(async()=>{if(!ye||ze){ut(a("rightSidebar.selectRepositoryForGitActions"));return}const r=sn.trim(),i=an.trim();await it({action:"pull",cwd:ye,...r?{remote:r}:{},...i?{branch:i}:{}},a("rightSidebar.pullChanges"))},[ye,an,sn,ze,it,a]);o.useEffect(()=>{if(!Ke||!ye||Pe)return;let r=!1;const i={push:a("rightSidebar.pushChanges"),pull:a("rightSidebar.pullChanges"),commit:a("rightSidebar.commitChanges"),"switch-branch":a("rightSidebar.switchBranch"),"stage-all":a("rightSidebar.stageAll"),"stash-all":a("rightSidebar.stashAll")};return(async()=>{for(const u of["push","pull","commit","switch-branch","stage-all","stash-all"]){if(r)return;const x=await Uc({cwd:ye,action:u}).catch(()=>null);if(!x?.ok||x.status!=="running")continue;const v={action:u,cwd:ye},R=i[u]??u;ts({action:u});try{const T=await ka(x,v,R);if(r||!je(b))return;const H=b?await Ca(b,void 0,{includeNested:zn(b),cacheOnly:!0,action:"git_action_cache_sync",requestSlotId:Gn(b)}).catch(()=>T.bundle):T.bundle;H&&Hr(H,{reloadDiff:!0,cacheOnly:!0})}catch(T){r||ut(a("rightSidebar.gitActionFailed",{message:T instanceof Error?T.message:"Unknown error"}))}finally{r||ts(null)}return}})(),()=>{r=!0}},[ye,Hr,Ke,je,b,Pe,a,ka]);const zo=Mn?.action==="commit",Wo=Mn?.action==="switch-branch",Go=Mn?.action==="pull",qo=Mn?.action==="push",ja=Ke||lf,Ko=pa?a("rightSidebar.changeAuditScopeAll"):cr.length===1?cr[0].label:`${cr.length} repos`,th=cr.length>0,Mc=Vt.length>0,rh=b?e.jsx(kd,{open:so,onOpenChange:ao,showScopePicker:!0,selectedAll:pa,repos:Bt,selectedRoots:ma,onToggleRepo:Bf,onGenerate:()=>zf(Bo?"regenerate":"generate"),disabled:!th,generateDisabled:!Mc,inserted:q?.startsWith("context:branch-audit-scope:")??!1,buttonLabel:a(Bo?"rightSidebar.branchAuditRegenerate":"rightSidebar.branchAuditGenerate"),insertedLabel:a("rightSidebar.inserted"),title:a("rightSidebar.branchAuditGenerateTitle"),ariaLabel:a("rightSidebar.branchAuditShort"),scopeTitle:a("rightSidebar.changeAuditScopeLabel"),scopeLabel:Ko,allLabel:a("rightSidebar.changeAuditScopeAll"),generateLabel:a(Bo?"rightSidebar.branchAuditRegenerate":"rightSidebar.branchAuditGenerate"),onSecondaryAction:()=>{Wf()},secondaryDisabled:!Mc||P,secondaryLabel:a("rightSidebar.branchAuditViewDiff"),secondaryTitle:a("rightSidebar.branchAuditViewDiffTitle"),secondaryLoading:P,loading:rl.size>0,statusTitle:rl.size>0?a("rightSidebar.branchCandidatesLoading"):void 0,extraContent:e.jsxs("div",{className:"mb-2 space-y-1.5",children:[e.jsxs("label",{className:"flex cursor-pointer items-center justify-between gap-3 rounded-md bg-surface-2 px-2 py-1.5 text-[11px] text-foreground",children:[e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block font-medium",children:a("rightSidebar.includeUncommitted")}),e.jsx("span",{className:"block truncate text-[10px] text-muted-foreground",children:a("rightSidebar.includeUncommittedHint")})]}),e.jsx("input",{type:"checkbox",checked:_r,onChange:r=>tl(r.target.checked),className:"h-4 w-4 shrink-0 accent-[rgb(var(--primary-rgb))]"})]}),rc.length>0&&e.jsx("div",{className:"rounded-md bg-[rgb(var(--warning-rgb)_/_0.12)] px-2 py-1.5 text-[10px] text-[color:var(--warning)]",children:a("rightSidebar.missingBaseReposSkipped",{repositories:rc.map(r=>r.label).join(w==="zh"?"、":", ")})})]}),renderRepoExtra:r=>{const i=bt.get(r.root),u=[],x=new Set,v=(Y,ke)=>{!Y||x.has(Y)||(x.add(Y),u.push({value:Y,label:Y,meta:ke}))};v(yr[r.root]||i?.context?.branch,a("rightSidebar.pushCurrentBranchBadge"));for(const Y of i?.context?.branches??[])v(Y,Y===i?.context?.branch?a("rightSidebar.pushCurrentBranchBadge"):a("rightSidebar.localBranch"));for(const Y of i?.context?.remoteBranches??[])v(Y,a("rightSidebar.remoteBranch"));const R=[],T=new Set,H=(Y,ke)=>{!Y||T.has(Y)||(T.add(Y),R.push({value:Y,label:Y,meta:ke}))};H(Rt[r.root],Rt[r.root]?a("rightSidebar.pushUpstreamBadge"):void 0),H(i?.context?.upstream,i?.context?.upstream?a("rightSidebar.pushUpstreamBadge"):void 0);for(const Y of i?.context?.remoteBranches??[])H(Y,"remote");for(const Y of i?.context?.branches??[])H(Y,Y===i?.context?.branch?a("rightSidebar.pushCurrentBranchBadge"):"local");return e.jsxs("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-2",children:[e.jsx(Wn,{label:a("rightSidebar.currentBranchLabel"),value:yr[r.root]||i?.context?.branch||"",options:u,placeholder:a("rightSidebar.switchBranchPlaceholder"),searchPlaceholder:a("rightSidebar.switchBranchSearchPlaceholder"),emptyText:a("rightSidebar.switchNoBranches"),onChange:Y=>{Os(ke=>({...ke,[r.root]:Y}))}}),e.jsx(Wn,{label:a("rightSidebar.branchAuditBaseLabel"),value:Rt[r.root]||"",options:R,placeholder:a("rightSidebar.branchAuditBasePlaceholder"),searchPlaceholder:a("rightSidebar.branchAuditBaseSearchPlaceholder"),emptyText:a("rightSidebar.branchAuditBaseEmpty"),onChange:Y=>{Us(ke=>({...ke,[r.root]:Y}))}})]})}}):null,$c=ys(jt.reduce((r,i)=>Math.max(r,i.injectedAt??0),0),w),nh=b?e.jsxs("div",{className:"border-b border-border/10 px-1 py-3",children:[e.jsxs("button",{type:"button",onClick:()=>el(r=>{const i=!r;return vt(ei,i),i}),className:"group flex w-full items-center gap-2 rounded-lg px-1 py-1.5 text-left transition hover:bg-surface-2 active:scale-[0.99]","aria-expanded":es,children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-surface-2 text-muted-foreground group-hover:text-foreground",children:e.jsx(Es,{size:14})}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-[12px] font-semibold text-foreground",children:a("rightSidebar.branchAuditTitle")}),e.jsx("span",{className:"block truncate text-[10px] text-muted-foreground",children:Ko})]}),e.jsx("span",{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition group-hover:bg-surface-elevated group-hover:text-foreground ${es?"rotate-90":""}`,children:e.jsx(Na,{size:13})})]}),es&&e.jsxs("div",{className:"mt-2 rounded-lg border border-border/10 bg-surface/60 p-2",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 text-[11px] text-muted-foreground",children:[a("rightSidebar.changeAuditScopeLabel"),": ",Ko]}),rh]}),ie&&e.jsx("div",{className:"mb-2 rounded-md bg-surface-2 px-2 py-1.5 text-[11px] text-destructive",children:ie}),e.jsxs("div",{className:"mt-2 space-y-1.5",children:[Qr.map(r=>e.jsxs("div",{className:`flex min-w-0 items-start gap-1 rounded-md transition ${Ze===r.key?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,children:[e.jsxs("button",{type:"button",onClick:()=>Gf(r),className:"min-w-0 flex-1 px-2 py-1.5 text-left active:scale-[0.99]",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] font-medium text-foreground",children:r.repoLabel}),e.jsxs("span",{className:"shrink-0 rounded bg-surface px-1.5 py-0.5 text-[10px] text-muted-foreground",children:[r.diff.hunks?.length??0," hunk"]})]}),e.jsxs("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1 text-[10px] text-muted-foreground",children:[e.jsx("span",{className:"rounded bg-surface px-1.5 py-0.5",children:r.diff.currentBranch??"HEAD"}),e.jsx("span",{className:"text-muted-foreground/60",children:"→"}),e.jsx("span",{className:"rounded bg-surface px-1.5 py-0.5",children:r.diff.baseRef??r.diff.baseBranch}),e.jsx("span",{className:"rounded bg-surface px-1.5 py-0.5",children:a("rightSidebar.branchAuditViewDiff")})]}),ys(r.createdAt,w)&&e.jsx("div",{className:"mt-1 truncate text-[10px] text-muted-foreground/70",children:ys(r.createdAt,w)})]}),e.jsx("button",{type:"button",onClick:()=>qf(r.key),className:"mr-1 mt-1 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition hover:bg-surface hover:text-foreground active:scale-95",title:a("common.delete"),"aria-label":a("common.delete"),children:e.jsx(Ba,{size:12})})]},r.key)),Un.length>0?Un.slice(0,Math.max(0,8-Qr.length)).map(r=>e.jsxs("div",{className:`flex min-w-0 items-start gap-1 rounded-md transition ${Ze===r.key?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,children:[e.jsxs("button",{type:"button",onClick:()=>Kf(r.key),className:"min-w-0 flex-1 px-2 py-1.5 text-left active:scale-[0.99]",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] font-medium text-foreground",children:r.repoLabel}),e.jsxs("span",{className:"shrink-0 rounded bg-surface px-1.5 py-0.5 text-[10px] text-muted-foreground",children:[r.records.length," hunk"]})]}),e.jsxs("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1 text-[10px] text-muted-foreground",children:[e.jsx("span",{className:"rounded bg-surface px-1.5 py-0.5",children:r.branchName??"HEAD"}),e.jsx("span",{className:"text-muted-foreground/60",children:"→"}),e.jsx("span",{className:"rounded bg-surface px-1.5 py-0.5",children:r.baseRef}),r.diffFingerprint&&e.jsx("span",{className:"rounded bg-surface px-1.5 py-0.5",children:r.diffFingerprint})]}),ys(r.latestInjectedAt,w)&&e.jsx("div",{className:"mt-1 truncate text-[10px] text-muted-foreground/70",children:a("rightSidebar.branchAuditGeneratedAt",{time:ys(r.latestInjectedAt,w)??""})})]}),e.jsx("button",{type:"button",onClick:()=>{Df(r)},className:"mr-1 mt-1 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition hover:bg-surface hover:text-foreground active:scale-95",title:a("rightSidebar.branchAuditClearTitle"),"aria-label":a("rightSidebar.branchAuditClearTitle"),children:e.jsx(Ba,{size:12})})]},r.key)):Qr.length===0?e.jsx("div",{className:"rounded-md bg-surface-2 px-2 py-1.5 text-[11px] text-muted-foreground",children:a("rightSidebar.branchAuditEmpty")}):null]})]})]}):null,Ec=or&&b&&On?e.jsxs("div",{className:ja?"overflow-visible":"overflow-hidden",children:[nh,e.jsxs("button",{type:"button",onClick:()=>{Ke||cf(r=>{const i=!r;return i&&ye&&!On&&!nn&&Ro(ye),i})},"aria-expanded":ja,className:`group flex w-full items-center gap-2 px-1 py-1.5 text-left transition ${Ke?"cursor-default":"rounded-lg hover:bg-surface-2 active:scale-[0.99]"}`,children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-surface-2 text-muted-foreground group-hover:text-foreground",children:e.jsx(Mr,{size:14})}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-[12px] font-semibold text-foreground",children:a("rightSidebar.gitQuickActions")}),e.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[e.jsxs("span",{className:`inline-flex min-w-[4.5rem] items-center justify-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium ${pn.staged>0?"bg-accent/10 text-accent":"bg-surface-2 text-muted-foreground"}`,children:[nn&&e.jsx(at,{size:10,className:"animate-spin"}),pn.staged>0?a("rightSidebar.stagedCount",{count:pn.staged}):a("rightSidebar.noStagedChangesShort")]}),!Ke&&e.jsx("span",{className:`flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground transition group-hover:bg-surface-elevated group-hover:text-foreground ${ja?"rotate-90":""}`,children:e.jsx(Na,{size:13})})]})]}),ja&&e.jsxs("div",{className:"space-y-0",children:[Lt.length>1&&e.jsxs("div",{className:"border-b border-border/10 px-1 py-3",children:[e.jsx("div",{className:"mb-2 flex items-center justify-between gap-2",children:e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] font-semibold text-foreground",children:a("rightSidebar.gitRepositorySectionTitle")}),e.jsx("div",{className:"mt-0.5 truncate text-[10px] text-muted-foreground",children:Sf})]})}),e.jsx(Wn,{label:a("rightSidebar.gitRepositoryLabel"),value:ye??"",options:Lt,placeholder:a("rightSidebar.gitRepositoryPlaceholder"),searchPlaceholder:a("rightSidebar.gitRepositorySearchPlaceholder"),emptyText:a("rightSidebar.gitRepositoryEmpty"),disabled:!!Pe,onChange:r=>{Rc(r||null)}}),ze&&e.jsx("div",{className:"mt-2 rounded-md bg-[rgb(var(--warning-rgb)_/_0.12)] px-2 py-1.5 text-[11px] text-[color:var(--warning)]",children:a("rightSidebar.selectRepositoryForGitActions")})]}),e.jsxs("div",{className:"border-b border-border/10 px-1 py-3",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] font-semibold text-foreground",children:a("rightSidebar.branchSectionTitle")}),e.jsx("div",{className:"mt-0.5 truncate text-[10px] text-muted-foreground",children:jf})]}),e.jsxs("button",{type:"button",onClick:()=>{Qf()},disabled:!Tf,className:`relative inline-flex h-7 shrink-0 items-center justify-center rounded-md px-2.5 text-[11px] font-semibold transition disabled:cursor-not-allowed disabled:opacity-50 active:scale-95 ${Wo?"bg-accent/10 text-accent hover:bg-accent/15":"bg-surface-2 text-foreground hover:bg-surface-elevated"}`,title:a("rightSidebar.switchBranch"),children:[e.jsx("span",{className:Pe?.action==="switch-branch"||Wo?"opacity-0":"",children:a("rightSidebar.switchBranch")}),Pe?.action==="switch-branch"&&e.jsx(at,{size:12,className:"absolute animate-spin"}),Wo&&Pe?.action!=="switch-branch"&&e.jsx("span",{className:"absolute",children:"✓"})]})]}),e.jsx(Wn,{label:a("rightSidebar.currentBranchLabel"),value:ns,options:Nf,placeholder:a("rightSidebar.switchBranchPlaceholder"),searchPlaceholder:a("rightSidebar.switchBranchSearchPlaceholder"),emptyText:a("rightSidebar.switchNoBranches"),disabled:!!Pe,onChange:Gs})]}),e.jsxs("div",{className:"border-b border-border/10 px-1 py-3",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] font-semibold text-foreground",children:a("rightSidebar.commitSectionTitle")}),e.jsx("div",{className:"mt-0.5 truncate text-[10px] text-muted-foreground",children:ze?a("rightSidebar.selectRepositoryForGitActions"):pn.staged>0?a("rightSidebar.commitReadyHint",{count:pn.staged}):a("rightSidebar.commitNeedsStaged")})]}),e.jsxs("button",{type:"button",onClick:()=>{Nc()},disabled:!!Pe||ze||pn.staged===0||!Ws.trim(),className:`relative inline-flex h-7 shrink-0 items-center justify-center rounded-md px-2.5 text-[11px] font-semibold transition active:scale-95 ${zo?"bg-accent/10 text-accent disabled:bg-accent/10 disabled:text-accent":"bg-primary text-primary-foreground hover:bg-primary/90 disabled:bg-surface-2 disabled:text-muted-foreground"} disabled:cursor-not-allowed`,title:ze?a("rightSidebar.selectRepositoryForGitActions"):pn.staged===0?a("rightSidebar.commitNeedsStaged"):a("rightSidebar.commitChanges"),children:[e.jsx("span",{className:Pe?.action==="commit"||zo?"opacity-0":"",children:a("rightSidebar.commitChanges")}),Pe?.action==="commit"&&e.jsx(at,{size:12,className:"absolute animate-spin"}),zo&&Pe?.action!=="commit"&&e.jsx("span",{className:"absolute",children:"✓"})]})]}),e.jsx("input",{value:Ws,onChange:r=>ll(r.target.value),onKeyDown:r=>{(r.metaKey||r.ctrlKey)&&r.key==="Enter"&&(r.preventDefault(),Nc())},placeholder:a("rightSidebar.commitMessagePlaceholder"),disabled:!!Pe,className:"w-full rounded-md border border-border/15 bg-surface-2 px-2.5 py-1.5 text-[12px] text-foreground outline-none transition placeholder:text-muted-foreground/70 focus:border-primary/35 focus:ring-1 focus:ring-primary/25 disabled:cursor-not-allowed disabled:opacity-60",maxLength:300})]}),e.jsxs("div",{className:"border-b border-border/10 px-1 py-3",children:[e.jsxs("button",{type:"button",onClick:()=>vr(r=>!r),className:"group flex w-full items-center justify-between gap-2 rounded-lg px-1 py-1.5 text-left transition hover:bg-surface-2 active:scale-[0.99]","aria-expanded":er,children:[e.jsx("span",{className:"min-w-0 text-[11px] font-semibold text-foreground",children:a("rightSidebar.recentCommitsTitle")}),e.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[Cn&&e.jsx(at,{size:12,className:"animate-spin text-muted-foreground"}),e.jsx("span",{className:`flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground transition group-hover:bg-surface-elevated group-hover:text-foreground ${er?"rotate-90":""}`,children:e.jsx(Na,{size:13})})]})]}),er&&e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-surface-2 px-2 py-1.5 text-muted-foreground focus-within:bg-surface-elevated",children:[e.jsx(qn,{size:12,className:"shrink-0"}),e.jsx("input",{value:Rn,onChange:r=>Zr(r.target.value),placeholder:a("rightSidebar.recentCommitsSearchPlaceholder"),className:"min-w-0 flex-1 bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground",autoCapitalize:"off",autoCorrect:"off",autoComplete:"off",spellCheck:!1}),Rn&&e.jsx("button",{type:"button",onClick:()=>Zr(""),className:"rounded-full p-0.5 text-muted-foreground hover:bg-surface hover:text-foreground","aria-label":a("rightSidebar.clearSearch"),children:e.jsx(Ut,{size:12})})]}),e.jsxs("div",{className:"max-h-56 space-y-1 overflow-y-auto overscroll-contain pr-1",onScroll:Rf,children:[tr.length>0?tr.map(r=>{const[i,...u]=r.split(/\s+/),x=u.join(" ")||r;return e.jsxs("button",{type:"button",onClick:()=>{Vf(r)},className:"flex w-full min-w-0 items-start gap-2 rounded-md bg-surface-2 px-2 py-1.5 text-left font-mono text-[10px] transition hover:bg-surface-elevated active:scale-[0.99]",title:x,children:[e.jsx("span",{className:"shrink-0 text-[color:var(--diff-hunk-accent)]",children:i}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-muted-foreground",title:x,children:x}),He===i&&e.jsx(at,{size:11,className:"shrink-0 animate-spin text-muted-foreground"})]},r)}):Cn?e.jsx("div",{className:"rounded-md bg-surface-2 px-2 py-2 text-center text-[11px] text-muted-foreground",children:a("common.loading")}):e.jsx("div",{className:"rounded-md bg-surface-2 px-2 py-1.5 text-[11px] text-muted-foreground",children:a("rightSidebar.recentCommitsEmpty")}),Q&&e.jsx("div",{className:"flex justify-center rounded-md bg-surface-2 px-2 py-2 text-muted-foreground",children:e.jsx(at,{size:12,className:"animate-spin"})}),no&&!Q&&tr.length>0&&e.jsx("button",{type:"button",onClick:()=>{fs({reset:!1})},className:"w-full rounded-md bg-surface-2 px-2 py-1.5 text-[11px] font-medium text-muted-foreground transition hover:bg-surface-elevated hover:text-foreground",children:a("rightSidebar.recentCommitsLoadMore")})]})]}),nt&&e.jsx("div",{className:"mt-2 rounded-md bg-destructive/10 px-2 py-1.5 text-[11px] text-destructive",children:nt}),nr&&e.jsx("div",{className:"mt-2 rounded-md bg-destructive/10 px-2 py-1.5 text-[11px] text-destructive",children:nr})]}),e.jsxs("div",{className:"px-1 py-3",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[e.jsx("div",{className:"text-[11px] font-semibold text-foreground",children:a("rightSidebar.pushSectionTitle")}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[e.jsxs("button",{type:"button",onClick:()=>{eh()},disabled:!Af,className:`relative inline-flex h-7 min-w-[3.25rem] items-center justify-center rounded-md px-2.5 text-[11px] font-semibold transition disabled:cursor-not-allowed disabled:opacity-50 active:scale-95 ${Go?"bg-accent/10 text-accent hover:bg-accent/15":"bg-surface-2 text-foreground hover:bg-surface-elevated"}`,title:a("rightSidebar.pullChanges"),children:[e.jsx("span",{className:Pe?.action==="pull"||Go?"opacity-0":"",children:a("rightSidebar.pullChanges")}),Pe?.action==="pull"&&e.jsx(at,{size:12,className:"absolute animate-spin"}),Go&&Pe?.action!=="pull"&&e.jsx("span",{className:"absolute",children:"✓"})]}),e.jsxs("button",{type:"button",onClick:()=>{Zf()},disabled:!Pf,className:`relative inline-flex h-7 min-w-[3.25rem] items-center justify-center rounded-md px-2.5 text-[11px] font-semibold transition disabled:cursor-not-allowed disabled:opacity-50 active:scale-95 ${qo?"bg-accent/10 text-accent hover:bg-accent/15":"bg-surface-2 text-foreground hover:bg-surface-elevated"}`,title:a("rightSidebar.pushChanges"),children:[e.jsx("span",{className:Pe?.action==="push"||qo?"opacity-0":"",children:a("rightSidebar.pushChanges")}),Pe?.action==="push"&&e.jsx(at,{size:12,className:"absolute animate-spin"}),qo&&Pe?.action!=="push"&&e.jsx("span",{className:"absolute",children:"✓"})]})]})]}),e.jsxs("div",{className:`mb-2 flex min-w-0 items-center justify-between gap-2 rounded-md px-2 py-1.5 text-[11px] ${sc.className}`,title:ue?.upstream??void 0,children:[e.jsx("span",{className:"truncate font-medium",children:sc.text}),e.jsx("span",{className:"w-[6.5rem] shrink-0 truncate text-right text-[10px] opacity-75",children:ue?.upstream??""})]}),e.jsxs("div",{className:`grid gap-1.5 ${tc?"grid-cols-2":"grid-cols-1"}`,children:[tc&&e.jsx(Wn,{label:a("rightSidebar.pushRemoteLabel"),value:sn,options:ec,placeholder:a("rightSidebar.pushRemotePlaceholder"),searchPlaceholder:a("rightSidebar.pushRemoteSearchPlaceholder"),emptyText:a("rightSidebar.pushNoRemotes"),disabled:!!Pe,onChange:qs}),e.jsx(Wn,{label:a("rightSidebar.pushBranchLabel"),value:an,options:Mf,placeholder:a("rightSidebar.pushBranchPlaceholder",{branch:ue?.branch??"HEAD"}),searchPlaceholder:a("rightSidebar.pushBranchSearchPlaceholder"),emptyText:a("rightSidebar.pushNoBranches"),disabled:!!Pe,onChange:Ks})]})]})]})]}):null,sh=o.useCallback(r=>{const i=lt(r,b);if(!i)return[];const u=fi(r),x=[];return r.canStage&&x.push({key:"stage-file",label:a("rightSidebar.stageFile"),onClick:()=>{it({action:"stage-file",cwd:i,paths:[r.path]},a("rightSidebar.stageFile"),u)}}),r.canUnstage&&x.push({key:"unstage-file",label:a("rightSidebar.unstageFile"),onClick:()=>{it({action:"unstage-file",cwd:i,paths:[r.path]},a("rightSidebar.unstageFile"),u)}}),r.canStash&&x.push({key:"stash-file",label:a("rightSidebar.stashFile"),onClick:()=>{it({action:"stash-file",cwd:i,paths:[r.path]},a("rightSidebar.stashFile"),u)}}),r.canRestoreWorktree&&x.push({key:"restore-worktree-file",label:a("rightSidebar.restoreFile"),destructive:!0,onClick:()=>Dr({kind:"restore",file:r,phrase:""})}),x},[b,it,a]),ah=o.useCallback(()=>{if(m){f?.();return}kr(0),jr.current?.slideTo(0),wr(!1),kt(null)},[f,m]),Lc=o.useCallback(r=>{if(j(""),It(r),Xe(null),kt(null),ne(null),ee){m&&f?.(),kr(0),jr.current?.slideTo(0),wr(!1);return}},[ee,f,m,Xe,It]);o.useEffect(()=>{const r=i=>{const u=i.detail,x=u?.path;if(typeof x!="string"||!x.startsWith("/"))return;j(""),kt(null),Te(null);const v=!!(b&&(x===b||x.startsWith(`${b}/`)));if(u.kind==="file"){const R=ci(x);cs(x),typeof u.line=="number"&&Number.isSafeInteger(u.line)&&u.line>0&&Te(u.line),It(v?null:R),ne(T=>({path:x,nonce:(T?.nonce??0)+1}));return}Xe(null),v?(It(null),ne(R=>({path:x,nonce:(R?.nonce??0)+1}))):(ne(null),It(x)),ee&&(m&&f?.(),kr(0),jr.current?.slideTo(0),wr(!1))};return window.addEventListener(zc,r),()=>window.removeEventListener(zc,r)},[cs,ee,f,m,b,Xe,It]),o.useEffect(()=>{t||(At(!1),zt(!1))},[t]),o.useEffect(()=>{if(!Xt&&!hr)return;const r=i=>{i instanceof globalThis.KeyboardEvent&&i.key!=="Escape"||i instanceof globalThis.MouseEvent&&i.target instanceof Node&&(Ts.current?.contains(i.target)||yn.current?.contains(i.target))||(At(!1),zt(!1))};return window.addEventListener("mousedown",r),window.addEventListener("keydown",r),()=>{window.removeEventListener("mousedown",r),window.removeEventListener("keydown",r)}},[hr,Xt]);const Ac=e.jsxs("div",{"data-local-layer":"file-explorer-menu-host",className:"sticky top-0 z-20 bg-surface/95 px-2.5 py-1.5 backdrop-blur",children:[e.jsxs("div",{className:"flex min-h-9 min-w-0 items-center gap-1.5",children:[e.jsx("button",{type:"button",onClick:yf,disabled:!da,className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition hover:bg-surface-2 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-35 active:scale-95","aria-label":a("rightSidebar.parentFolder"),title:a("rightSidebar.parentFolder"),children:e.jsx(Pd,{size:14})}),e.jsx("button",{type:"button",onClick:zl,disabled:!b||Ln===b,className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition hover:bg-surface-2 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-35 active:scale-95","aria-label":a("rightSidebar.backToProjectRoot"),title:a("rightSidebar.backToProjectRoot"),children:e.jsx(qc,{size:14})}),e.jsx("button",{type:"button",onClick:wf,disabled:!pe,className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition hover:bg-surface-2 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-35 active:scale-95","aria-label":a("rightSidebar.refreshFiles"),title:cl?a("rightSidebar.fileWatchUnavailable",{message:cl}):a("rightSidebar.refreshFiles"),children:e.jsx(xi,{size:13})}),e.jsx("div",{className:"min-w-0 flex-1 px-1",title:pe??void 0,children:e.jsxs("div",{className:"flex min-w-0 items-center gap-1 text-[12px] font-medium text-foreground",children:[e.jsx("span",{className:"truncate",children:xf}),ea==="modified"&&e.jsx("span",{className:"inline-flex shrink-0 text-primary",title:a("fileTree.sortedByModified"),"aria-label":a("fileTree.sortedByModified"),children:e.jsx(Wc,{size:11})})]})}),e.jsx("button",{type:"button",onClick:()=>pe&&zr(pe,Et??void 0),disabled:!pe,...pe&&Et?Mo(ca(pe),Et):{},className:`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md transition disabled:cursor-not-allowed disabled:opacity-35 active:scale-95 ${Et&&(q===Et||Ce===Et)?"bg-surface-elevated text-foreground":"bg-primary/10 text-primary hover:bg-primary/20"}`,"aria-label":a(Et&&Ce===Et?"rightSidebar.copied":Et&&q===Et?"rightSidebar.inserted":"rightSidebar.insertCurrentFolder"),title:a("rightSidebar.insertCurrentFolder"),children:Et&&(q===Et||Ce===Et)?e.jsx(gi,{size:13}):e.jsx(za,{size:13})}),e.jsxs("div",{ref:yn,className:"relative shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>{At(!1),zt(r=>!r)},className:`inline-flex h-7 w-7 items-center justify-center rounded-md transition active:scale-95 ${hr?"bg-surface-elevated text-foreground":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,"aria-expanded":hr,"aria-haspopup":"menu","aria-label":a("sidebar.moreActions"),title:a("sidebar.moreActions"),children:e.jsx(bi,{size:14})}),hr&&e.jsxs("div",{role:"menu","data-local-layer":"file-explorer-menu",className:"absolute right-0 top-[calc(100%+4px)] z-30 w-48 overflow-hidden rounded-xl border border-border/15 bg-surface p-1 text-[12px] shadow-xl shadow-[0_18px_48px_var(--app-shadow-soft)] animate-fade-in",children:[e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{zt(!1),kf()},disabled:!Lo,className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left transition disabled:opacity-40 ${us?"text-primary hover:bg-primary/10":"text-foreground hover:bg-surface-2"}`,children:[us?e.jsx(Xo,{size:14}):e.jsx($a,{size:14,className:"text-muted-foreground"}),e.jsx("span",{children:a(us?"rightSidebar.unpinCurrentFolder":"rightSidebar.pinCurrentFolder")})]}),e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{zt(!1),ff()},className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left transition ${bo?"text-primary hover:bg-primary/10":"text-foreground hover:bg-surface-2"}`,children:[bo?e.jsx(hm,{size:14}):e.jsx(wi,{size:14,className:"text-muted-foreground"}),e.jsx("span",{children:a(bo?"rightSidebar.hideHiddenFiles":"rightSidebar.showHiddenFiles")})]}),e.jsxs("button",{type:"button",role:"menuitem",disabled:!pe,onClick:()=>{pe&&(zt(!1),hf(pe,ea==="modified"?"name":"modified"))},className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-foreground transition hover:bg-surface-2 disabled:opacity-40",children:[ea==="modified"?e.jsx(Zh,{size:14}):e.jsx(Wc,{size:14,className:"text-muted-foreground"}),e.jsx("span",{children:a(ea==="modified"?"fileTree.sortByName":"fileTree.sortByModified")})]})]})]})]}),b&&(ua.length>0||vf)&&e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1 pb-0.5 text-[11px]",children:[e.jsx("span",{className:"shrink-0 px-1 text-[10px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:a("rightSidebar.pinnedFolders")}),e.jsxs("button",{type:"button",onClick:zl,className:`inline-flex max-w-[9rem] shrink-0 items-center gap-1 rounded-full px-2 py-0.5 font-medium transition active:scale-95 ${pe===b?"bg-surface-elevated text-foreground":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,title:b,children:[e.jsx(qc,{size:10,className:"shrink-0"}),e.jsx("span",{className:"truncate",children:Ve})]}),ua.map(r=>{const i=r.path,u=r.kind==="file",x=u?Ye===i:pe===i;return e.jsxs("span",{className:`group inline-flex max-w-[12rem] shrink-0 items-center rounded-full transition ${x?"bg-primary/15 text-primary":"bg-surface-2 text-foreground hover:bg-surface-elevated"}`,title:i,children:[e.jsxs("button",{type:"button",onClick:()=>u?cs(i):It(i),className:"inline-flex min-w-0 items-center gap-1 px-2 py-0.5 font-medium active:scale-95",children:[u?e.jsx(ki,{size:10,className:"shrink-0"}):e.jsx($a,{size:10,className:"shrink-0"}),e.jsx("span",{className:"truncate",children:mt(i)})]}),e.jsx("button",{type:"button",onClick:()=>ln(i),className:"mr-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-muted-foreground transition hover:bg-surface-elevated hover:text-foreground","aria-label":a("rightSidebar.unpinFolder",{name:mt(i)}),title:a("rightSidebar.unpinFolder",{name:mt(i)}),children:e.jsx(Ut,{size:9})})]},i)})]}),e.jsx("span",{"data-local-layer":"file-explorer-divider",className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 h-px bg-border/15","aria-hidden":"true"})]}),Vo=o.useMemo(()=>{if($n===null)return null;const r=typeof navigator>"u"?void 0:navigator.language,i=Math.max(0,Math.floor((fo-$n)/1e3)),u=new Intl.RelativeTimeFormat(r,{numeric:"auto"}),[x,v]=i<60?[-i,"second"]:i<3600?[-Math.floor(i/60),"minute"]:i<86400?[-Math.floor(i/3600),"hour"]:[-Math.floor(i/86400),"day"];return u.format(x,v)},[fo,$n]),Pc=b&&!ls?e.jsx("button",{type:"button",onClick:()=>{Jf(!xo)},"aria-pressed":xo,title:a("rightSidebar.multiRepoScanTitle"),className:`inline-flex h-7 shrink-0 items-center rounded-full px-2.5 text-[11px] font-medium transition active:scale-95 ${xo?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground hover:text-foreground"}`,children:a("rightSidebar.multiRepoScan")}):null,Tc=b?e.jsxs("div",{className:"inline-flex shrink-0 items-center gap-1.5",children:[Vo?e.jsx("span",{className:"whitespace-nowrap text-[10px] text-muted-foreground",title:a("rightSidebar.gitLastUpdated",{time:Vo}),children:Vo}):null,e.jsx("button",{type:"button",onClick:()=>{os()},disabled:Mt,className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition hover:bg-surface-2 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50 active:scale-95","aria-label":a("rightSidebar.refreshGit"),title:a("rightSidebar.refreshGit"),children:e.jsx(xi,{size:13,className:Mt?"animate-spin":""})})]}):null,oh=El?a("rightSidebar.changeAuditScopeAll"):un.length===1?un[0].relativeRoot==="."?Ve:un[0].relativeRoot||un[0].name:`${un.length} repos`,Ic=b?e.jsxs("div",{className:"inline-flex h-7 shrink-0 items-center",children:[e.jsx(kd,{open:Ds,onOpenChange:Tr,showScopePicker:gn,selectedAll:El,repos:mf,selectedRoots:qt,onToggleRepo:Ff,onGenerate:()=>If(),disabled:!b,inserted:q===Hl,buttonLabel:a("rightSidebar.changeAuditShort"),insertedLabel:a("rightSidebar.inserted"),title:a("rightSidebar.insertChangeAuditPromptTitle"),ariaLabel:a("rightSidebar.insertChangeAuditPrompt"),scopeTitle:a("rightSidebar.changeAuditScopeLabel"),scopeLabel:oh,allLabel:a("rightSidebar.changeAuditScopeAll"),generateLabel:a("rightSidebar.changeAuditShort"),loading:Lr,error:!!Pr,statusTitle:Pr??(Lr?a("rightSidebar.changeAuditLoading"):jt.length>0?`${a("rightSidebar.changeAuditLoaded",{count:jt.length})}${$c?` · ${a("rightSidebar.changeAuditLoadedAt",{time:$c})}`:""}`:void 0)}),e.jsx("button",{type:"button",onClick:()=>{_f()},disabled:Lr||jt.length===0,className:`inline-flex h-7 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition hover:bg-surface-2 hover:text-foreground disabled:pointer-events-none active:scale-95 ${jt.length>0?"":"invisible"}`,title:a("rightSidebar.clearChangeAuditTitle"),"aria-label":a("rightSidebar.clearChangeAudit"),children:e.jsx(Ba,{size:12})})]}):null,Ra=ve.size>0||se?.available||Fr?e.jsxs("div",{className:"flex flex-wrap items-center gap-1 text-[10px] font-medium",children:[se?.available&&se.branch&&e.jsxs("span",{className:"inline-flex min-w-0 max-w-[8rem] items-center gap-0.5 truncate rounded bg-surface-2 px-1.5 py-0.5 text-muted-foreground",title:se.branch,children:[e.jsx(Mr,{size:10,className:"shrink-0"}),e.jsx("span",{className:"truncate",children:se.branch})]}),st.modified>0&&e.jsxs("span",{className:"rounded bg-surface-2 px-1.5 py-0.5 text-[color:var(--diff-hunk-accent)]",children:[st.modified,"M"]}),st.added>0&&e.jsxs("span",{className:"rounded bg-surface-2 px-1.5 py-0.5 text-[color:var(--diff-insert-strong)]",children:["+",st.added]}),st.deleted>0&&e.jsxs("span",{className:"rounded bg-surface-2 px-1.5 py-0.5 text-[color:var(--diff-delete-strong)]",children:["-",st.deleted]}),st.renamed>0&&e.jsxs("span",{className:"rounded bg-surface-2 px-1.5 py-0.5 text-muted-foreground",children:[st.renamed,"R"]}),st.copied>0&&e.jsxs("span",{className:"rounded bg-surface-2 px-1.5 py-0.5 text-[color:var(--diff-insert-strong)]",children:[st.copied,"C"]}),st.untracked>0&&e.jsxs("span",{className:"rounded bg-surface-2 px-1.5 py-0.5 text-[color:var(--diff-insert-strong)]",children:[st.untracked,"U"]}),st.conflicted>0&&e.jsxs("span",{className:"rounded bg-destructive/10 px-1.5 py-0.5 text-destructive",children:[st.conflicted,"!"]}),st.other>0&&e.jsxs("span",{className:"rounded bg-surface-2 px-1.5 py-0.5 text-muted-foreground",children:[st.other,"?"]}),st.staged>0&&e.jsx("span",{className:"rounded bg-accent/10 px-1.5 py-0.5 text-accent",children:a("rightSidebar.stagedCountShort",{count:st.staged})}),se?.available&&b&&ve.size>0&&V.length<=1&&e.jsx("button",{type:"button",onClick:()=>{it({action:"stage-all",cwd:b},a("rightSidebar.stageAll"))},disabled:!!Pe,className:"rounded-full bg-accent/10 px-2 py-0.5 font-medium text-accent hover:bg-accent/20 disabled:opacity-50",title:a("rightSidebar.stageAll"),children:a("rightSidebar.stageAll")}),se?.available&&b&&ve.size>0&&V.length<=1&&e.jsx("button",{type:"button",onClick:()=>Dr({kind:"stash-all",repoRoot:b,repoLabel:Ve}),disabled:!!Pe,className:"rounded-full bg-surface-2 px-2 py-0.5 font-medium text-foreground hover:bg-surface-elevated disabled:opacity-50",title:a("rightSidebar.stashAll"),children:a("rightSidebar.stashAll")})]}):null;return e.jsxs(em,{side:"right",isOpen:t,drawerWidthPx:n,onClose:s,onOpen:l,push:d,pinned:c,children:[Mo.popoverNode,e.jsxs("div",{className:"relative shrink-0 border-b border-border/15 bg-surface px-2 pt-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"min-w-0 flex-1 px-1",children:e.jsxs("div",{className:"flex min-h-[1.25rem] items-baseline gap-1.5",children:[e.jsx("span",{className:"truncate text-[13px] font-semibold text-foreground",title:b??void 0,children:Ve}),(!ee||co)&&se?.available&&se.branch&&e.jsxs("span",{className:"inline-flex min-w-0 items-center gap-0.5 truncate text-[11px] text-muted-foreground",title:se.branch,children:[e.jsx(Mr,{size:10,className:"shrink-0"}),e.jsx("span",{className:"max-w-[7rem] truncate",children:se.branch})]})]})}),e.jsx("button",{type:"button",onClick:()=>{const r=!ae;fe(r),r?window.requestAnimationFrame(()=>document.querySelector("[data-right-search]")?.focus()):j("")},className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition active:scale-95 ${ae?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,"aria-label":a("rightSidebar.toggleSearch"),title:a("common.search"),children:e.jsx(qn,{size:14})}),e.jsxs("button",{type:"button",role:"switch","aria-checked":Qe,onClick:()=>{xn(r=>!r),ur(!1)},className:`relative inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition active:scale-95 ${Qe?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,"aria-label":a("rightSidebar.toggleContextDraft"),title:a("rightSidebar.contextDraftTitle"),children:[e.jsx(jm,{size:14}),!Qe&&wt.trim()&&e.jsx("span",{className:"absolute right-0.5 top-0.5 h-1.5 w-1.5 rounded-full bg-primary","aria-hidden":"true"})]}),e.jsx("input",{ref:hl,type:"file",multiple:!0,className:"hidden",onChange:r=>{const i=r.target.files;!i||i.length===0||(ds(Array.from(i)),r.target.value="")}}),e.jsx("input",{ref:ml,type:"file",accept:"image/*",className:"hidden",onChange:r=>{const i=r.target.files?.[0];r.target.value="",i&&bf(i)}}),h&&e.jsx("button",{type:"button",onClick:h,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition active:scale-95 ${c?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,"aria-label":a(c?"sidebar.unpinSidebar":"sidebar.pinSidebar"),title:a(c?"sidebar.unpinSidebar":"sidebar.pinSidebar"),children:c?e.jsx(Xo,{size:14}):e.jsx($a,{size:14})}),e.jsxs("div",{ref:Ts,className:"relative shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>{zt(!1),At(r=>!r)},className:`relative inline-flex h-8 w-8 items-center justify-center rounded-full transition active:scale-95 ${Xt?"bg-surface-elevated text-foreground":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,"aria-expanded":Xt,"aria-haspopup":"menu","aria-label":a("sidebar.moreActions"),title:a("sidebar.moreActions"),children:e.jsx(bi,{size:15})}),Xt&&e.jsxs("div",{role:"menu",className:"absolute right-0 top-[calc(100%+4px)] z-30 w-56 overflow-hidden rounded-xl border border-border/15 bg-surface/98 p-1 text-[12px] shadow-xl shadow-[0_18px_48px_var(--app-shadow-soft)] backdrop-blur animate-fade-in",children:[e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{At(!1),hl.current?.click()},disabled:Vs,className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-foreground transition hover:bg-surface-2 disabled:opacity-50",children:[Vs?e.jsx(at,{size:14,className:"animate-spin text-muted-foreground"}):e.jsx(Pm,{size:14,className:"text-muted-foreground"}),e.jsx("span",{children:a("rightSidebar.uploadFiles")})]}),e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{At(!1),ml.current?.click()},disabled:Vs,className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-foreground transition hover:bg-surface-2 disabled:opacity-50",children:[Vs?e.jsx(at,{size:14,className:"animate-spin text-muted-foreground"}):e.jsx(xm,{size:14,className:"text-muted-foreground"}),e.jsx("span",{children:a("rightSidebar.insertLocalImage")})]}),h&&e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{At(!1),h()},className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left transition ${c?"text-primary hover:bg-primary/10":"text-foreground hover:bg-surface-2"}`,children:[c?e.jsx(Xo,{size:14}):e.jsx($a,{size:14,className:"text-muted-foreground"}),e.jsx("span",{children:a(c?"sidebar.unpinSidebar":"sidebar.pinSidebar")})]}),c&&e.jsxs("div",{className:"mt-1 flex items-center gap-2 border-t border-border/15 px-1.5 pt-1.5",role:"group","aria-label":a("rightSidebar.layoutMode"),children:[e.jsx("div",{className:"shrink-0 pl-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:a("rightSidebar.layoutMode")}),e.jsx("div",{className:"grid min-w-0 flex-1 grid-cols-3 gap-0.5 rounded-lg bg-surface-2 p-0.5",children:[["auto",a("rightSidebar.layoutModeAuto")],["narrow",a("rightSidebar.layoutModeNarrow")],["wide",a("rightSidebar.layoutModeWide")]].map(([r,i])=>{const u=G===r;return e.jsx("button",{type:"button",role:"menuitemradio","aria-checked":u,onClick:()=>{J(r),At(!1)},className:`rounded-md px-1 py-1.5 text-center text-[11px] font-medium transition active:scale-95 ${u?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,children:i},r)})})]})]})]}),e.jsx("button",{type:"button",onClick:s,className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-surface-2 text-muted-foreground transition hover:bg-destructive/20 hover:text-destructive active:scale-95","aria-label":a("rightSidebar.close"),children:e.jsx(Ut,{size:14})})]}),ae&&e.jsxs("div",{className:"mt-2 space-y-1.5 pb-0.5",children:[e.jsxs("div",{className:"flex items-center gap-2 rounded-xl bg-surface-2 px-3 py-1.5 text-muted-foreground transition focus-within:bg-surface-elevated",children:[e.jsx(qn,{size:12,className:"shrink-0"}),e.jsx("input",{"data-right-search":!0,type:"search",value:U,onChange:r=>j(r.target.value),placeholder:a(M==="content"?"rightSidebar.searchPlaceholderContent":"rightSidebar.filterChanges"),className:"min-w-0 flex-1 bg-transparent text-[13px] text-foreground placeholder:text-muted-foreground",autoCapitalize:"off",autoCorrect:"off",autoComplete:"off",enterKeyHint:"search",spellCheck:!1}),e.jsxs("div",{className:`flex shrink-0 items-center gap-0.5 rounded-full bg-surface/70 p-0.5 font-medium ${ee?"text-[11px]":"text-[10px]"}`,children:[e.jsx("button",{type:"button",onClick:()=>Sc("name"),"aria-pressed":M==="name",className:`rounded-full px-2 transition active:scale-95 ${ee?"py-1":"py-0.5"} ${M==="name"?"bg-primary/15 text-primary":"text-muted-foreground/80 hover:text-foreground"}`,children:a("rightSidebar.searchModeName")}),e.jsx("button",{type:"button",onClick:()=>Sc("content"),"aria-pressed":M==="content",className:`rounded-full px-2 transition active:scale-95 ${ee?"py-1":"py-0.5"} ${M==="content"?"bg-primary/15 text-primary":"text-muted-foreground/80 hover:text-foreground"}`,children:a("rightSidebar.searchModeContent")})]}),U&&e.jsx("button",{type:"button",onClick:()=>j(""),className:"rounded-full p-0.5 text-muted-foreground hover:bg-surface hover:text-foreground","aria-label":a("rightSidebar.clearSearch"),children:e.jsx(Ut,{size:12})})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("label",{className:"flex min-w-0 flex-1 items-center gap-2 rounded-lg bg-surface-2 px-2.5 py-1.5 text-muted-foreground transition focus-within:bg-surface-elevated",children:[e.jsx(tm,{size:12,className:"shrink-0 text-primary"}),e.jsx("span",{className:"shrink-0 text-[10px] font-medium",children:a("rightSidebar.searchScope")}),e.jsx("input",{"data-search-scope":!0,value:K,onChange:r=>re(r.target.value),onKeyDown:r=>{r.key==="Enter"&&document.querySelector("[data-right-search]")?.focus()},className:"min-w-0 flex-1 bg-transparent font-mono text-[11px] text-foreground placeholder:text-muted-foreground",placeholder:a("rightSidebar.searchScopePlaceholder"),"aria-label":a("rightSidebar.searchScope"),autoCapitalize:"off",autoCorrect:"off",spellCheck:!1}),K!=="."&&e.jsx("button",{type:"button",onClick:()=>re("."),className:"shrink-0 rounded p-0.5 text-muted-foreground hover:bg-surface hover:text-foreground","aria-label":a("rightSidebar.resetSearchScope"),children:e.jsx(Ut,{size:11})})]}),e.jsxs("button",{type:"button",onClick:()=>Re(r=>!r),"aria-expanded":me,className:`relative inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg transition active:scale-95 ${me||ss.length>0||C||de||We?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,title:a("rightSidebar.searchOptions"),"aria-label":a("rightSidebar.searchOptions"),children:[e.jsx(rm,{size:13}),ss.length>0&&e.jsx("span",{className:"absolute -right-1 -top-1 min-w-4 rounded-full bg-primary px-1 text-[8px] font-bold leading-4 text-primary-foreground",children:ss.length})]})]}),me&&e.jsxs("div",{className:"animate-fade-in rounded-xl bg-surface-2 p-2",children:[e.jsxs("label",{className:"flex items-center gap-2 rounded-lg bg-surface px-2.5 py-1.5 text-muted-foreground focus-within:bg-surface-elevated",children:[e.jsx("span",{className:"shrink-0 text-[10px] font-medium",children:a("rightSidebar.searchExclude")}),e.jsx("input",{"data-search-exclude":!0,value:oe,onChange:r=>he(r.target.value),className:"min-w-0 flex-1 bg-transparent font-mono text-[11px] text-foreground placeholder:text-muted-foreground",placeholder:a("rightSidebar.searchExcludePlaceholder"),"aria-label":a("rightSidebar.searchExclude"),autoCapitalize:"off",autoCorrect:"off",spellCheck:!1}),oe&&e.jsx("button",{type:"button",onClick:()=>he(""),className:"rounded p-0.5 hover:bg-surface-2 hover:text-foreground","aria-label":a("rightSidebar.clearSearchExclude"),children:e.jsx(Ut,{size:11})})]}),M==="content"&&e.jsx("div",{className:"mt-1.5 flex flex-wrap items-center gap-1",role:"group","aria-label":a("rightSidebar.contentSearchOptions"),children:[[C,()=>Z(r=>!r),um,a("rightSidebar.matchCase")],[de,()=>Le(r=>!r),Im,a("rightSidebar.matchWholeWord")],[We,()=>De(r=>!r),Cm,a("rightSidebar.useRegex")]].map(([r,i,u,x])=>e.jsxs("button",{type:"button",onClick:i,"aria-pressed":r,className:`inline-flex items-center gap-1 rounded-lg px-2 py-1 text-[10px] transition ${r?"bg-primary/15 text-primary":"bg-surface text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,children:[e.jsx(u,{size:12}),x]},x))})]})]}),ls?null:e.jsxs("div",{className:"mt-2 grid grid-cols-3 gap-0.5 rounded-md bg-surface-2 p-0.5",children:[e.jsxs("button",{type:"button",onClick:()=>on("git"),className:`flex items-center justify-center gap-1 rounded px-2 py-1.5 text-[11px] font-medium transition active:scale-[0.98] ${Rr==="git"?"bg-surface-elevated text-foreground":"text-muted-foreground hover:bg-surface-2"}`,children:[e.jsx(Mr,{size:12}),a("rightSidebar.tabGit"),Mt&&Rr==="git"?e.jsx(at,{size:12,className:"animate-spin text-muted-foreground"}):null]}),e.jsxs("button",{type:"button",onClick:()=>on("diff"),className:`flex items-center justify-center gap-1 rounded px-2 py-1.5 text-[11px] font-medium transition active:scale-[0.98] ${Rr==="diff"?"bg-surface-elevated text-foreground":"text-muted-foreground hover:bg-surface-2"}`,children:[e.jsx(zd,{size:12}),a("rightSidebar.tabChanges"),Mt?e.jsx(at,{size:12,className:"animate-spin text-muted-foreground"}):ve.size>0?e.jsx("span",{className:"text-[10px] text-accent",children:ve.size}):null]}),e.jsxs("button",{type:"button",onClick:()=>on("files"),className:`flex items-center justify-center gap-1 rounded px-2 py-1.5 text-[11px] font-medium transition active:scale-[0.98] ${Rr==="files"?"bg-surface-elevated text-foreground":"text-muted-foreground hover:bg-surface-2"}`,children:[e.jsx(am,{size:12}),a("rightSidebar.tabFiles")]})]}),e.jsx("div",{className:"h-2"}),ol&&e.jsx("div",{className:"pointer-events-none absolute right-3 top-10 z-20 max-w-[72%] rounded-lg bg-destructive/95 px-3 py-2 text-[11px] font-medium text-destructive-foreground shadow-md animate-fade-in",children:ol})]}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-hidden bg-surface",children:[e.jsx(li,{active:Ke,mounted:or,fallback:e.jsx(vs,{slow:!1}),children:Ue?e.jsx("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:e.jsx(Xc,{items:Of,selectedKey:nf,onSelect:Fs,emptyText:a("rightSidebar.noChanges"),mobile:ee,backLabel:a("rightSidebar.backToChangeList"),headerTitle:a("rightSidebar.recentCommitsTitle"),headerMeta:`${Ue.headRef??""}${Ue.commits?.[0]?` · ${Ue.commits[0]}`:""}`,onClose:()=>{$e(null),Fs(null)},closeLabel:a("common.back"),wrap:Pt,onToggleWrap:ee?Ho:void 0,wrapTitle:a("rightSidebar.wrapLongLines"),wrapOnLabel:a("rightSidebar.wrapOn"),wrapOffLabel:a("rightSidebar.wrapOff"),desktopLayout:ee?"stacked":"split",onInsertDiffReference:Wr,onReferenceCopied:Cr,insertedReferenceKey:q,copiedReferenceKey:Ce,onClearAuditRecord:xa})}):xr?e.jsx("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:e.jsx(Xc,{items:Fo,selectedKey:io,onSelect:rn,emptyText:a(Me?"rightSidebar.branchAuditDiffEmpty":"rightSidebar.branchAuditEmpty"),mobile:ee,backLabel:a("rightSidebar.backToChangeList"),headerTitle:a(Me?"rightSidebar.branchAuditViewDiff":"rightSidebar.branchAuditTitle"),headerMeta:va?`${va.repoLabel} · ${va.branchName??"HEAD"} → ${va.baseRef}`:void 0,onClose:()=>{Qt(!1),Zt(null)},closeLabel:a("common.back"),wrap:Pt,onToggleWrap:ee?Ho:void 0,wrapTitle:a("rightSidebar.wrapLongLines"),wrapOnLabel:a("rightSidebar.wrapOn"),wrapOffLabel:a("rightSidebar.wrapOff"),desktopLayout:ee?"stacked":"split",onInsertDiffReference:Wr,onReferenceCopied:Cr,insertedReferenceKey:q,copiedReferenceKey:Ce,onClearAuditRecord:xa,walkthroughs:Uf,onWalkthroughNavigate:Hf,initialDetailScrollTop:Me&&Ze?Sn[Ze]:void 0,onDetailScrollPositionChange:Yf,externalSwiperRef:ee?aa:void 0,onMobileSlideChange:ee?lo:void 0})}):e.jsx("div",{className:"h-full overflow-y-auto overscroll-contain px-2 py-2",children:Ec||(Mt?e.jsx(vs,{slow:Zs}):Pn?e.jsx(Da,{message:Pn,onRetry:()=>{os()}}):Md(se)?e.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:a(b?"rightSidebar.gitUnavailable":"fileTree.noWorkingDir")}):se?.available===!1?e.jsx(Da,{message:se.error??a("rightSidebar.gitChangesLoadFailed"),onRetry:()=>{os()}}):b?e.jsx(vs,{slow:Zs}):e.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:a(b?"rightSidebar.gitUnavailable":"fileTree.noWorkingDir")}))})}),e.jsx(li,{active:Fn,children:ee?e.jsxs(Id,{className:"h-full min-h-0 w-full",slidesPerView:1,resistanceRatio:.45,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:".swiper-no-swiping",allowTouchMove:!1,touchAngle:75,touchStartPreventDefault:!1,onSwiper:r=>{jr.current=r,r.slideTo(sl,0)},onSlideChange:r=>{if(kr(r.activeIndex),as.current===r.activeIndex){as.current=null;return}r.activeIndex===0&&(wr(!1),kt(null),f?.())},children:[e.jsx(vi,{className:"h-full min-h-0",children:e.jsxs("div",{ref:Tn,onScroll:Al,onDragOver:ia,onDragEnter:ia,onDragLeave:Il,onDrop:_l,className:"h-full overflow-y-auto overscroll-contain bg-surface relative",children:[dl&&e.jsx("div",{className:"pointer-events-none absolute left-3 right-3 top-3 z-10 flex justify-center",children:e.jsx("div",{className:"rounded-xl bg-surface-elevated px-4 py-2 text-sm font-semibold text-foreground shadow-lg",children:a("rightSidebar.dropToUpload")})}),!U.trim()&&Ac,e.jsx(Gc,{rootPath:pe??"",onFileSelect:cs,onPathReference:zr,getReferenceText:ca,onReferenceCopied:Cr,insertedReferenceKey:q,copiedReferenceKey:Ce,onDirectoryRoot:Wl,onSearchFromDirectory:Gl,onDirectoryPinToggle:ql,onFilePinToggle:Kl,pinnedPaths:hn,selectedFilePath:Ye,query:le,searchRootPath:Cl,searchOptions:Nl,searchMode:M,onContentMatchSelect:Pl,onDirectoryDropFiles:(r,i)=>ds(i,r),revealDirectory:X,canOpenInFileBrowser:ul,onOpenInFileBrowser:Tl})]})}),e.jsx(vi,{className:"h-full min-h-0",children:e.jsx("div",{className:"h-full overflow-hidden bg-surface",children:e.jsx(Bi,{filePath:Fn&&(sf||sl===1)?Ye:null,onInsertReference:zr,onInsertText:Nr,onInsertFeature:Nr,onReviewReference:Ol,onReferenceCopied:Cr,onClose:ah,onDirectoryLinkOpen:Lc,isMobile:!0,lineRange:Kr,onLineRangeChange:kt,insertedReferenceKey:q,copiedReferenceKey:Ce,scrollToLine:$r,onScrollToLineHandled:()=>Te(null),markdownOutlineOpen:D,markdownOutlineCloseSignal:B,onOpenMarkdownOutline:E,onCloseMarkdownOutline:$,markdownImageLightboxOpen:L,markdownImageLightboxCloseSignal:A,onOpenMarkdownImageLightbox:O,onCloseMarkdownImageLightbox:I})})})]}):e.jsxs("div",{className:"flex h-full min-h-0",children:[e.jsxs("div",{ref:Tn,onScroll:Al,onDragOver:ia,onDragEnter:ia,onDragLeave:Il,onDrop:_l,className:"shrink-0 overflow-y-auto overscroll-contain bg-surface relative",style:{width:mo},children:[dl&&e.jsx("div",{className:"pointer-events-none absolute left-3 right-3 top-3 z-10 flex justify-center",children:e.jsx("div",{className:"rounded-xl bg-surface-elevated px-4 py-2 text-sm font-semibold text-foreground shadow-lg",children:a("rightSidebar.dropToUpload")})}),!U.trim()&&Ac,e.jsx(Gc,{rootPath:pe??"",onFileSelect:cs,onPathReference:zr,getReferenceText:ca,onReferenceCopied:Cr,insertedReferenceKey:q,copiedReferenceKey:Ce,onDirectoryRoot:Wl,onSearchFromDirectory:Gl,onDirectoryPinToggle:ql,onFilePinToggle:Kl,pinnedPaths:hn,selectedFilePath:Ye,query:le,searchRootPath:Cl,searchOptions:Nl,searchMode:M,onContentMatchSelect:Pl,onDirectoryDropFiles:(r,i)=>ds(i,r),revealDirectory:X,canOpenInFileBrowser:ul,onOpenInFileBrowser:Tl})]}),e.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":a("rightSidebar.resizeFileTree"),title:a("rightSidebar.resizeFileTree"),"data-local-layer":"file-preview-separator",className:"group relative z-10 w-2 shrink-0 cursor-col-resize touch-none border-l border-border/15 bg-surface",onPointerDown:pf,onPointerMove:gf,onPointerUp:Ll,onPointerCancel:Ll,onDoubleClick:()=>{po(Ni),vt(ws,Ni)},children:e.jsx("span",{className:"absolute left-1/2 top-0 h-full w-px -translate-x-1/2 bg-border/20 transition group-hover:bg-primary/45"})}),e.jsx("div",{className:"min-w-0 flex-1 overflow-hidden bg-surface",children:e.jsx(Bi,{filePath:Fn?Ye:null,onInsertReference:zr,onInsertText:Nr,onInsertFeature:Nr,onReviewReference:Ol,onReferenceCopied:Cr,onDirectoryLinkOpen:Lc,isMobile:!1,lineRange:Kr,onLineRangeChange:kt,insertedReferenceKey:q,copiedReferenceKey:Ce,scrollToLine:$r,onScrollToLineHandled:()=>Te(null),markdownOutlineOpen:D,markdownOutlineCloseSignal:B,onOpenMarkdownOutline:E,onCloseMarkdownOutline:$,markdownImageLightboxOpen:L,markdownImageLightboxCloseSignal:A,onOpenMarkdownImageLightbox:O,onCloseMarkdownImageLightbox:I})})]})}),e.jsx(li,{active:ft,mounted:af||ft,children:()=>ee?e.jsx(yi,{mobile:!0,backLabel:a("rightSidebar.backToChangeList"),externalSwiperRef:aa,onMobileSlideChange:lo,groups:Ot.length>0?uc():[],mode:St,onModeChange:wa,selectedKey:Ye,scrollToKey:pc,scrollToKeyNonce:Xs.nonce,compact:!1,collapsedDirectoryKeys:mr,onToggleDirectory:xc,onSelectFile:r=>{const i=Array.from(ve.values()).find(u=>ht(u)===r.key);i&&ya(ht(i))},renderLeading:hc,renderTrailing:r=>{const i=Array.from(ve.values()).find(u=>ht(u)===r.key);return i?cc(i):null},renderDirectoryTrailing:dc,renderSubtitle:r=>{const i=Array.from(ve.values()).find(u=>ht(u)===r.key);return i?ic(i):null},listContainerClassName:"termdock-native-select min-h-0 px-2 pb-[calc(env(safe-area-inset-bottom)+4.5rem)]",renderListHeader:r=>b&&e.jsxs("div",{className:"px-0 py-0",children:[Ra&&e.jsx("div",{className:"mb-2",children:Ra}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("div",{className:"min-w-0",children:e.jsx("div",{className:"text-[10px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:a("rightSidebar.allChanges")})}),e.jsxs("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:[Ot.length,"/",ve.size]})]}),e.jsxs("div",{className:"mt-2 flex min-w-0 flex-wrap items-center gap-1.5",children:[ac(),Pc,r,c&&_o(),Ic,Tc]}),Ct&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] font-medium text-foreground",children:Ct.label}),Ct.branch&&e.jsx("span",{className:"max-w-[7rem] truncate rounded bg-surface-2 px-1.5 py-0.5 text-[10px] text-muted-foreground",children:Ct.branch})]}),!Ct&&gn&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 rounded-md bg-surface-2 px-2 py-1.5 text-[11px] text-muted-foreground",children:[e.jsx(Mr,{size:12,className:"shrink-0"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:a("rightSidebar.selectRepositoryForDiff")})]})]}),aiContent:ha?(r=>bc(r)):void 0,emptyContent:Mt&&ve.size===0&&Fr===null?e.jsx(vs,{slow:Zs}):Pn&&ve.size===0?e.jsx(Da,{message:Pn,onRetry:()=>{os()}}):ve.size===0?e.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:a("rightSidebar.noChanges")}):Ot.length===0?e.jsx("div",{className:"bg-surface-2 px-3 py-4 text-center text-xs text-muted-foreground",children:a("rightSidebar.noMatchingChanges")}):null,renderMobileDetailHeader:e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>is(0),className:"inline-flex h-9 shrink-0 items-center gap-1.5 rounded-full bg-surface-2 px-3 text-xs font-semibold text-muted-foreground transition hover:bg-surface-elevated hover:text-foreground active:scale-95",title:a("rightSidebar.backToChangeList"),children:[e.jsx(Ns,{size:14}),a("rightSidebar.backToChangeList")]}),e.jsxs("div",{className:"flex min-w-0 items-center justify-end gap-1.5",children:[c&&_o(),e.jsxs("button",{type:"button",onClick:Ho,"aria-pressed":Pt,title:a("rightSidebar.wrapLongLines"),className:`inline-flex h-9 shrink-0 items-center gap-1 rounded-full px-3 text-[11px] font-medium transition active:scale-95 ${Pt?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground hover:text-foreground"}`,children:[e.jsx("span",{className:"font-mono text-[12px] leading-none",children:"Aa"}),e.jsx("span",{children:a(Pt?"rightSidebar.wrapOn":"rightSidebar.wrapOff")})]})]})]}),detailContainerClassName:"termdock-native-select termdock-diff-stream-scroller min-h-0",files:fc(),activePane:ft,wrap:Pt,showScrollHint:!Pt,diffViewType:uf,inlineMode:Yn,diffOptions:kc,reloadKey:pr,renderStreamBadge:r=>e.jsx(js,{status:r}),onHunkGitAction:jc,onInsertDiffReference:Wr,onReferenceCopied:Cr,insertedReferenceKey:q,copiedReferenceKey:Ce,onClearAuditRecord:xa,onDetailScroll:ga}):e.jsx(yi,{mobile:!1,desktopLayout:"split",desktopSidePanel:null,desktopListClassName:"w-[320px] min-w-[260px] shrink-0 overflow-y-auto overscroll-contain border-r border-border/15 bg-surface",backLabel:a("rightSidebar.backToChangeList"),groups:Ot.length>0?uc():[],mode:St,onModeChange:wa,selectedKey:Ye,scrollToKey:pc,scrollToKeyNonce:Xs.nonce,compact:!0,collapsedDirectoryKeys:mr,onToggleDirectory:xc,onSelectFile:r=>{const i=Array.from(ve.values()).find(u=>ht(u)===r.key);i&&ya(ht(i))},renderLeading:hc,renderTrailing:r=>{const i=Array.from(ve.values()).find(u=>ht(u)===r.key);return i?cc(i):null},renderDirectoryTrailing:dc,renderSubtitle:r=>{const i=Array.from(ve.values()).find(u=>ht(u)===r.key);return i?ic(i):null},aiContent:ha?(r=>bc(r)):void 0,emptyContent:Mt&&ve.size===0&&Fr===null?e.jsx(vs,{slow:Zs}):Pn&&ve.size===0?e.jsx(Da,{message:Pn,onRetry:()=>{os()}}):ve.size===0?e.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:a("rightSidebar.noChanges")}):Ot.length===0?e.jsx("div",{className:"bg-surface-2 px-3 py-4 text-center text-xs text-muted-foreground",children:a("rightSidebar.noMatchingChanges")}):null,renderListHeader:r=>b&&e.jsxs("div",{className:"px-0 py-0",children:[Ra&&e.jsx("div",{className:"mb-2",children:Ra}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"px-1 text-[10px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:a("rightSidebar.allChanges")}),e.jsx("div",{className:"flex items-center gap-1.5",children:e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[Ot.length,"/",ve.size]})})]}),e.jsxs("div",{className:"mt-2 flex min-w-0 flex-wrap items-center gap-1.5",children:[ac(),Pc,r,_o(),Ic,Tc]}),Ct&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] font-medium text-foreground",children:Ct.label}),Ct.branch&&e.jsx("span",{className:"max-w-[7rem] truncate rounded bg-surface-2 px-1.5 py-0.5 text-[10px] text-muted-foreground",children:Ct.branch}),e.jsx("button",{type:"button",onClick:()=>Sa("stage-all",Ct.root,Ct.label),disabled:!!Pe,className:"rounded-full bg-accent/10 px-2 py-0.5 text-[10px] font-medium text-accent hover:bg-accent/20 disabled:opacity-50",title:a("rightSidebar.stageAll"),children:a("rightSidebar.stageAll")}),e.jsx("button",{type:"button",onClick:()=>Sa("stash-all",Ct.root,Ct.label),disabled:!!Pe,className:"rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-medium text-foreground hover:bg-surface-elevated disabled:opacity-50",title:a("rightSidebar.stashAll"),children:a("rightSidebar.stashAll")})]}),!Ct&&gn&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 rounded-md bg-surface-2 px-2 py-1.5 text-[11px] text-muted-foreground",children:[e.jsx(Mr,{size:12,className:"shrink-0"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:a("rightSidebar.selectRepositoryForDiff")})]})]}),files:fc(),activePane:ft,wrap:Pt,showScrollHint:!Pt,diffViewType:Jt,inlineMode:Yn,diffOptions:kc,reloadKey:pr,renderStreamBadge:r=>e.jsx(js,{status:r}),onHunkGitAction:jc,onInsertDiffReference:Wr,onReferenceCopied:Cr,insertedReferenceKey:q,copiedReferenceKey:Ce,onClearAuditRecord:xa,onDetailScroll:ga})})]}),t&&Qe&&e.jsx(ap,{value:wt,collapsed:gt,autoCollapseAfterSend:Yt,focusRequest:qr,insertError:Vn?a("rightSidebar.contextDraftInsertFailed"):null,onChange:r=>{Wt(!1),Ht(r)},onCollapsedChange:ur,onAutoCollapseAfterSendChange:vn,onDisable:()=>xn(!1),onClear:()=>Ht(""),onInsert:()=>Ul(!1),onInsertAndSend:()=>Ul(!0),labels:{title:a("rightSidebar.contextDraftTitle"),hint:a("rightSidebar.contextDraftHint"),placeholder:a("rightSidebar.contextDraftPlaceholder"),collapse:a("rightSidebar.contextDraftCollapse"),expand:a("rightSidebar.contextDraftExpand"),disable:a("rightSidebar.contextDraftDisable"),clear:a("rightSidebar.contextDraftClear"),insert:a("rightSidebar.contextDraftInsert"),insertAndSend:a("rightSidebar.contextDraftInsertAndSend"),inserted:a("rightSidebar.contextDraftInserted"),sent:a("rightSidebar.contextDraftSent"),send:a("rightSidebar.contextDraftSend"),appended:a("rightSidebar.contextDraftAppended"),resize:a("rightSidebar.contextDraftResize"),autoCollapseAfterSend:a("rightSidebar.contextDraftAutoCollapseAfterSend"),characterCount:r=>a("rightSidebar.contextDraftCharacterCount",{count:r})}}),Lf(),dt&&typeof document<"u"&&Gr.createPortal(e.jsx("div",{className:"fixed inset-0 z-modal-backdrop bg-[var(--app-backdrop)] backdrop-blur-sm",onClick:()=>Dr(null),children:e.jsxs("div",{className:"fixed inset-x-3 bottom-[max(1.5rem,env(safe-area-inset-bottom,0px))] z-modal-panel mx-auto max-w-md rounded-2xl border border-border/20 bg-surface-elevated p-4 shadow-2xl",onClick:r=>r.stopPropagation(),children:[e.jsx("div",{className:"text-sm font-semibold text-foreground",children:dt.kind==="restore"?a("rightSidebar.confirmRestoreTitle"):a("rightSidebar.confirmStashAllTitle")}),e.jsx("div",{className:"mt-2 text-xs leading-relaxed text-muted-foreground",children:dt.kind==="restore"?a("rightSidebar.confirmRestoreDescription",{path:Ad(dt.file.absolutePath,b)}):a("rightSidebar.confirmStashAllDescription")}),dt.kind==="restore"&&e.jsx("input",{value:dt.phrase,onChange:r=>Dr({...dt,phrase:r.target.value}),placeholder:a("rightSidebar.confirmRestorePlaceholder"),className:"mt-3 w-full rounded-xl border border-border/20 bg-surface-2 px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground",autoFocus:!0}),e.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>Dr(null),className:"rounded-full bg-surface-2 px-3 py-1.5 text-xs font-medium text-muted-foreground hover:bg-surface-elevated hover:text-foreground",children:a("common.cancel")}),e.jsx("button",{type:"button",disabled:!!Pe||dt.kind==="restore"&&dt.phrase.trim()!==a("rightSidebar.confirmRestorePhrase"),onClick:()=>{if(dt.kind==="restore"){const r=lt(dt.file,b);if(!r)return;it({action:"restore-worktree-file",cwd:r,paths:[dt.file.path],confirm:{acknowledged:!0,phrase:dt.phrase}},a("rightSidebar.restoreFile"),fi(dt.file))}else{const r=dt.repoRoot??b;if(!r)return;it({action:"stash-all",cwd:r},a("rightSidebar.stashAll"),`repo:${r}`)}},className:`rounded-full px-3 py-1.5 text-xs font-semibold disabled:opacity-50 ${dt.kind==="restore"?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-primary text-primary-foreground hover:bg-primary/90"}`,children:a(Pe?"rightSidebar.gitActionRunning":"rightSidebar.confirmAction")})]})]})}),document.body)]})}const Eb=Object.freeze(Object.defineProperty({__proto__:null,FilePreview:Bi,MarkdownImageLightbox:Wu,MarkdownPreview:Gu,RightSidebar:xb,__testParseMarkdownListBlock:Ig,buildMarkdownPreviewBlocks:qg,buildMarkdownPreviewRenderResult:Xi,collectKnownGitRepoRoots:pu,computeMarkdownImageDisplayBox:Nu,getMarkdownHeadingOutline:zu,getMarkdownHeadingPathAtLine:Hu,getNextMarkdownPreviewLineRange:Qg,isSvgImageSrc:Za,mountRightSidebarRepoPickerOverlay:eu,replaceGitRepositorySnapshot:Ju,resolveMarkdownLocalLinkTarget:Wi,resolveRightSidebarDiffViewType:fu,shouldCloseMarkdownImageLightboxDrag:Bu,showsGitRepoGroupHeader:Mi},Symbol.toStringTag,{value:"Module"}));export{wi as E,qc as H,ym as M,Eb as R,hm as a,km as b,_m as c,$b as m};
|
|
1678
|
+
`),truncated:i.some(H=>H.truncated)};if((x.hunks??[]).length===0){xe(a("rightSidebar.branchAuditDiffEmpty"));return}const v=Date.now(),R=["preview",x.repoRoot??b,x.baseRef??x.baseBranch??"",x.currentBranch??"",x.headRef??"",x.diffFingerprint??v].join("\0"),T=Vt.length===1?Vt[0].label:`${Vt.length} repos`;Zt(x),Qn(H=>[{key:R,diff:x,repoLabel:T,createdAt:v},...H.filter(Y=>Y.key!==R)].slice(0,8)),jn(H=>H[R]===void 0?H:{...H,[R]:0}),tn(R),rn(x.hunks?.[0]?`${x.hunks[0].filePath}\0${x.hunks[0].hunkHeader}\0${x.hunks[0].hunkIndex}`:null),Qt(!0)}catch(i){if(!je(r)||dr(i))return;xe(i instanceof Error?i.message:"Failed to load branch diff")}finally{je(r)&&z(!1)}},[_r,Vt,Rt,yr,je,b,a]),Gf=o.useCallback(r=>{Zt(r.diff),xe(null),tn(r.key),rn(r.diff.hunks?.[0]?`${r.diff.hunks[0].filePath}\0${r.diff.hunks[0].hunkHeader}\0${r.diff.hunks[0].hunkIndex}`:null),Qt(!0)},[]),qf=o.useCallback(r=>{Qn(i=>i.filter(u=>u.key!==r)),jn(i=>{if(!(r in i))return i;const u={...i};return delete u[r],u}),Ze===r&&(tn(null),Zt(null),Qt(!1))},[Ze]),Kf=o.useCallback(r=>{const i=Un.find(u=>u.key===r);i&&(Zt(null),xe(null),tn(r),rn(i.records[0]?.filePath??null),Qt(!0))},[Un]),Vf=o.useCallback(async r=>{if(!b||!ye)return;const[i]=r.split(/\s+/);if(i){Fe(i),ot(null),$e(null);try{const u=await Th({cwd:b,repoRoot:ye,commit:i,requestSlotId:"right-sidebar-commit-diff"});if(!u.available){ot(u.error??"Commit diff is unavailable");return}$e(u);const x=u.hunks?.[0];Fs(x?`${x.filePath}\0${x.hunkHeader}\0${x.hunkIndex}`:null)}catch(u){ot(u instanceof Error?u.message:"Failed to load commit diff")}finally{Fe(null)}}},[ye,b]),Yf=o.useCallback(r=>{if(!Me||!Ze)return;const i=Math.max(0,Math.round(r));jn(u=>Math.abs((u[Ze]??0)-i)<24?u:{...u,[Ze]:i})},[Me,Ze]);o.useEffect(()=>{!ee||!xr||!Me||is(1)},[xr,Me,ee,is]);const mc=o.useCallback(r=>{r&&df(i=>im(i,r))},[]),pc=Xs.key===Ye?Xs.key:null,ya=o.useCallback(r=>{const i=te.getState(),u=pb();Fa("select_diff_file",{interactionId:u,path:r,previousSelectedFilePath:i.selectedFilePath,rootPath:i.rootPath,activeGitRepoRoot:ce,changedFiles:i.changedFiles.size,gitBundleLoading:i.gitBundleLoading,gitBundleLastLoadedAt:i.gitBundleLastLoadedAt,rightTab:i.rightTab}),Xe(r),on("diff"),ee&&r&&is(1),mc(r),queueMicrotask(()=>{const x=te.getState();Fa("select_diff_file_after",{interactionId:u,requestedPath:r,selectedFilePath:x.selectedFilePath,rootPath:x.rootPath,rightTab:x.rightTab,changedFiles:x.changedFiles.size,activeGitRepoRoot:ce})})},[ce,ee,mc,Xe,on,is]),gc=o.useCallback(r=>{const i=Array.from(ve.values()).find(u=>{const x=lt(u,b),v=ht(u);return u.path===r.filePath||v===r.filePath||u.absolutePath===r.filePath||(x?`${x}/${u.path}`===r.filePath:!1)||r.repoRoot&&x===r.repoRoot&&u.path===r.filePath});if(i){ya(ht(i)),window.setTimeout(()=>bn(r),90),window.setTimeout(()=>bn(r),320),window.setTimeout(()=>bn(r),760);return}bn(r)},[ve,b,ya]),bc=o.useCallback(({slideToDetail:r,fullscreen:i,toggleFullscreen:u}={})=>Xn.length>0?e.jsx(Dd,{walkthroughs:Xn,repoRoot:ce,fullscreen:i,onToggleFullscreen:u,onNavigate:x=>{ee&&window.requestAnimationFrame(()=>r?.()),gc(x)}}):e.jsxs("div",{className:"rounded-lg border border-border/15 bg-surface px-3 py-6 text-center text-xs text-muted-foreground",children:[e.jsx(Es,{size:18,className:"mx-auto mb-2 text-muted-foreground/80"}),a("rightSidebar.changeWalkthroughEmpty")]}),[ce,Xn,gc,ee,a]),Xf=o.useCallback(r=>{r&&Er(i=>{const u=new Set(i);return u.has(r)?u.delete(r):u.add(r),si(Zo,u),u})},[]),xc=o.useCallback(r=>{to(i=>{const u=new Set(i);return u.has(r)?u.delete(r):u.add(r),si(nd,u),u})},[]),wa=o.useCallback(r=>{Is(r),vt(ru,r)},[]);o.useEffect(()=>{ha||St!=="ai"||wa("tree")},[St,wa,ha]);const Ho=o.useCallback(()=>{_s(r=>{const i=!r;return vt(nu,i),i})},[]),vc=o.useCallback(r=>{Vr(r),vt(su,r)},[]),{whitespace:yc,context:wc}=cm(),kc=o.useMemo(()=>({algorithm:"histogram",whitespace:yc,context:wc}),[yc,wc]),Sc=o.useCallback(r=>{F(r),vt(au,r)},[]),ka=o.useCallback(async(r,i,u,x)=>{let v=r;for(;v.ok&&v.status==="running";)await new Promise(T=>window.setTimeout(T,1500)),v=await Uc({jobId:v.jobId,cwd:i.cwd,action:i.action});if(!v.ok)throw new Error("Git action status is unavailable");if(v.status==="error")throw new Error(v.error||v.message||"Git action failed");const R={action:i.action,path:x,label:u};return rs(R),window.setTimeout(()=>rs(T=>T?.action===R.action&&T.path===R.path?null:T),1400),v},[]),it=o.useCallback(async(r,i,u)=>{const x=b;b&&ir.current.delete(b),ut(null),rs(null),ts({action:r.action,path:u});try{const v=await Ih({...r,includeNested:zn(b)}),R=await ka(v,r,i,u);if(!je(x))return!1;const T=b?await Ca(b,void 0,{includeNested:zn(b),cacheOnly:!0,action:"git_action_cache_sync",requestSlotId:Gn(b)}).catch(()=>R.bundle):R.bundle;return je(x)?(T&&Hr(T,{reloadDiff:!0,cacheOnly:!0}),Dr(null),!0):!1}catch(v){return rs(null),ut(a("rightSidebar.gitActionFailed",{message:v instanceof Error?v.message:"Unknown error"})),!1}finally{je(x)&&ts(null)}},[Hr,je,b,a,ka]),jc=o.useCallback(async r=>{const i=b,u=await _h({...r,includeNested:zn(b)});if(!je(i))return;const x=b?await Ca(b,void 0,{includeNested:zn(b),cacheOnly:!0,action:"git_action_cache_sync",requestSlotId:Gn(b)}).catch(()=>u.bundle):u.bundle;je(i)&&x&&Hr(x,{reloadDiff:!0,cacheOnly:!0})},[Hr,je,b]),Sa=o.useCallback((r,i,u)=>{if(i){if(r==="stage-all"){it({action:"stage-all",cwd:i},a("rightSidebar.stageAll"),`repo:${i}`);return}Dr({kind:"stash-all",repoRoot:i,repoLabel:u})}},[it,a]),Rc=o.useCallback(r=>{Je(r),ni(b,r),Gs(""),qs(""),Ks(""),Xe(Jl(r)),Ke||on("diff"),r&&r!==b&&V.find(u=>u.root===r)?.deferred&&Kt(r,{includeNested:!1,background:!0,replaceRepoRoot:r})},[Jl,Ke,V,Kt,b,Xe,on]),Cc=o.useCallback(r=>{const i=new Set([...Dt.current.keys(),...cn.current,...ir.current]);for(const u of i)u!==r&&(_t.current.delete(u),Dt.current.get(u)?.abort(),Dt.current.delete(u),xt(`right-sidebar-git-untracked:${u}`),cn.current.delete(u),ir.current.delete(u))},[]),Jf=o.useCallback(async r=>{const i=b;if(!i||(await te.getState().setNestedGitScanRoot(i,r),!je(i)))return;if(r){await Kt(i,{includeNested:!0,discoverOnly:!0,replaceWorkspace:!0,background:!0,reloadDiff:!0});return}Cc(i),Gs(""),qs(""),Ks(""),oo(x=>x.filter(v=>v===i));const u=Ft;u&<(u,i)!==i&&Xe(null),await Kt(i,{includeNested:!1,replaceWorkspace:!0,background:!0,reloadDiff:!0})},[Cc,je,Kt,b,Xe,Ft]),Qf=o.useCallback(async()=>{if(!ye||ze){ut(a("rightSidebar.selectRepositoryForGitActions"));return}const r=ns.trim();!r||r===ue?.branch||await it({action:"switch-branch",cwd:ye,branch:r},a("rightSidebar.switchBranch"))},[ue?.branch,ye,ze,it,ns,a]),Nc=o.useCallback(async()=>{if(!ye||ze){ut(a("rightSidebar.selectRepositoryForGitActions"));return}const r=Ws.trim();if(!r)return;await it({action:"commit",cwd:ye,message:r},a("rightSidebar.commitChanges"))&&ll("")},[ye,Ws,ze,it,a]),Zf=o.useCallback(async()=>{if(!ye||ze){ut(a("rightSidebar.selectRepositoryForGitActions"));return}const r=sn.trim(),i=an.trim();await it({action:"push",cwd:ye,...r?{remote:r}:{},...i?{branch:i}:{}},a("rightSidebar.pushChanges"))},[ye,an,sn,ze,it,a]),eh=o.useCallback(async()=>{if(!ye||ze){ut(a("rightSidebar.selectRepositoryForGitActions"));return}const r=sn.trim(),i=an.trim();await it({action:"pull",cwd:ye,...r?{remote:r}:{},...i?{branch:i}:{}},a("rightSidebar.pullChanges"))},[ye,an,sn,ze,it,a]);o.useEffect(()=>{if(!Ke||!ye||Pe)return;let r=!1;const i={push:a("rightSidebar.pushChanges"),pull:a("rightSidebar.pullChanges"),commit:a("rightSidebar.commitChanges"),"switch-branch":a("rightSidebar.switchBranch"),"stage-all":a("rightSidebar.stageAll"),"stash-all":a("rightSidebar.stashAll")};return(async()=>{for(const u of["push","pull","commit","switch-branch","stage-all","stash-all"]){if(r)return;const x=await Uc({cwd:ye,action:u}).catch(()=>null);if(!x?.ok||x.status!=="running")continue;const v={action:u,cwd:ye},R=i[u]??u;ts({action:u});try{const T=await ka(x,v,R);if(r||!je(b))return;const H=b?await Ca(b,void 0,{includeNested:zn(b),cacheOnly:!0,action:"git_action_cache_sync",requestSlotId:Gn(b)}).catch(()=>T.bundle):T.bundle;H&&Hr(H,{reloadDiff:!0,cacheOnly:!0})}catch(T){r||ut(a("rightSidebar.gitActionFailed",{message:T instanceof Error?T.message:"Unknown error"}))}finally{r||ts(null)}return}})(),()=>{r=!0}},[ye,Hr,Ke,je,b,Pe,a,ka]);const zo=Mn?.action==="commit",Wo=Mn?.action==="switch-branch",Go=Mn?.action==="pull",qo=Mn?.action==="push",ja=Ke||lf,Ko=pa?a("rightSidebar.changeAuditScopeAll"):cr.length===1?cr[0].label:`${cr.length} repos`,th=cr.length>0,Mc=Vt.length>0,rh=b?e.jsx(kd,{open:so,onOpenChange:ao,showScopePicker:!0,selectedAll:pa,repos:Bt,selectedRoots:ma,onToggleRepo:Bf,onGenerate:()=>zf(Bo?"regenerate":"generate"),disabled:!th,generateDisabled:!Mc,inserted:q?.startsWith("context:branch-audit-scope:")??!1,buttonLabel:a(Bo?"rightSidebar.branchAuditRegenerate":"rightSidebar.branchAuditGenerate"),insertedLabel:a("rightSidebar.inserted"),title:a("rightSidebar.branchAuditGenerateTitle"),ariaLabel:a("rightSidebar.branchAuditShort"),scopeTitle:a("rightSidebar.changeAuditScopeLabel"),scopeLabel:Ko,allLabel:a("rightSidebar.changeAuditScopeAll"),generateLabel:a(Bo?"rightSidebar.branchAuditRegenerate":"rightSidebar.branchAuditGenerate"),onSecondaryAction:()=>{Wf()},secondaryDisabled:!Mc||P,secondaryLabel:a("rightSidebar.branchAuditViewDiff"),secondaryTitle:a("rightSidebar.branchAuditViewDiffTitle"),secondaryLoading:P,loading:rl.size>0,statusTitle:rl.size>0?a("rightSidebar.branchCandidatesLoading"):void 0,extraContent:e.jsxs("div",{className:"mb-2 space-y-1.5",children:[e.jsxs("label",{className:"flex cursor-pointer items-center justify-between gap-3 rounded-md bg-surface-2 px-2 py-1.5 text-[11px] text-foreground",children:[e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block font-medium",children:a("rightSidebar.includeUncommitted")}),e.jsx("span",{className:"block truncate text-[10px] text-muted-foreground",children:a("rightSidebar.includeUncommittedHint")})]}),e.jsx("input",{type:"checkbox",checked:_r,onChange:r=>tl(r.target.checked),className:"h-4 w-4 shrink-0 accent-[rgb(var(--primary-rgb))]"})]}),rc.length>0&&e.jsx("div",{className:"rounded-md bg-[rgb(var(--warning-rgb)_/_0.12)] px-2 py-1.5 text-[10px] text-[color:var(--warning)]",children:a("rightSidebar.missingBaseReposSkipped",{repositories:rc.map(r=>r.label).join(w==="zh"?"、":", ")})})]}),renderRepoExtra:r=>{const i=bt.get(r.root),u=[],x=new Set,v=(Y,ke)=>{!Y||x.has(Y)||(x.add(Y),u.push({value:Y,label:Y,meta:ke}))};v(yr[r.root]||i?.context?.branch,a("rightSidebar.pushCurrentBranchBadge"));for(const Y of i?.context?.branches??[])v(Y,Y===i?.context?.branch?a("rightSidebar.pushCurrentBranchBadge"):a("rightSidebar.localBranch"));for(const Y of i?.context?.remoteBranches??[])v(Y,a("rightSidebar.remoteBranch"));const R=[],T=new Set,H=(Y,ke)=>{!Y||T.has(Y)||(T.add(Y),R.push({value:Y,label:Y,meta:ke}))};H(Rt[r.root],Rt[r.root]?a("rightSidebar.pushUpstreamBadge"):void 0),H(i?.context?.upstream,i?.context?.upstream?a("rightSidebar.pushUpstreamBadge"):void 0);for(const Y of i?.context?.remoteBranches??[])H(Y,"remote");for(const Y of i?.context?.branches??[])H(Y,Y===i?.context?.branch?a("rightSidebar.pushCurrentBranchBadge"):"local");return e.jsxs("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-2",children:[e.jsx(Wn,{label:a("rightSidebar.currentBranchLabel"),value:yr[r.root]||i?.context?.branch||"",options:u,placeholder:a("rightSidebar.switchBranchPlaceholder"),searchPlaceholder:a("rightSidebar.switchBranchSearchPlaceholder"),emptyText:a("rightSidebar.switchNoBranches"),onChange:Y=>{Os(ke=>({...ke,[r.root]:Y}))}}),e.jsx(Wn,{label:a("rightSidebar.branchAuditBaseLabel"),value:Rt[r.root]||"",options:R,placeholder:a("rightSidebar.branchAuditBasePlaceholder"),searchPlaceholder:a("rightSidebar.branchAuditBaseSearchPlaceholder"),emptyText:a("rightSidebar.branchAuditBaseEmpty"),onChange:Y=>{Us(ke=>({...ke,[r.root]:Y}))}})]})}}):null,$c=ys(jt.reduce((r,i)=>Math.max(r,i.injectedAt??0),0),w),nh=b?e.jsxs("div",{className:"border-b border-border/10 px-1 py-3",children:[e.jsxs("button",{type:"button",onClick:()=>el(r=>{const i=!r;return vt(ei,i),i}),className:"group flex w-full items-center gap-2 rounded-lg px-1 py-1.5 text-left transition hover:bg-surface-2 active:scale-[0.99]","aria-expanded":es,children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-surface-2 text-muted-foreground group-hover:text-foreground",children:e.jsx(Es,{size:14})}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-[12px] font-semibold text-foreground",children:a("rightSidebar.branchAuditTitle")}),e.jsx("span",{className:"block truncate text-[10px] text-muted-foreground",children:Ko})]}),e.jsx("span",{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition group-hover:bg-surface-elevated group-hover:text-foreground ${es?"rotate-90":""}`,children:e.jsx(Na,{size:13})})]}),es&&e.jsxs("div",{className:"mt-2 rounded-lg border border-border/10 bg-surface/60 p-2",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 text-[11px] text-muted-foreground",children:[a("rightSidebar.changeAuditScopeLabel"),": ",Ko]}),rh]}),ie&&e.jsx("div",{className:"mb-2 rounded-md bg-surface-2 px-2 py-1.5 text-[11px] text-destructive",children:ie}),e.jsxs("div",{className:"mt-2 space-y-1.5",children:[Qr.map(r=>e.jsxs("div",{className:`flex min-w-0 items-start gap-1 rounded-md transition ${Ze===r.key?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,children:[e.jsxs("button",{type:"button",onClick:()=>Gf(r),className:"min-w-0 flex-1 px-2 py-1.5 text-left active:scale-[0.99]",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] font-medium text-foreground",children:r.repoLabel}),e.jsxs("span",{className:"shrink-0 rounded bg-surface px-1.5 py-0.5 text-[10px] text-muted-foreground",children:[r.diff.hunks?.length??0," hunk"]})]}),e.jsxs("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1 text-[10px] text-muted-foreground",children:[e.jsx("span",{className:"rounded bg-surface px-1.5 py-0.5",children:r.diff.currentBranch??"HEAD"}),e.jsx("span",{className:"text-muted-foreground/60",children:"→"}),e.jsx("span",{className:"rounded bg-surface px-1.5 py-0.5",children:r.diff.baseRef??r.diff.baseBranch}),e.jsx("span",{className:"rounded bg-surface px-1.5 py-0.5",children:a("rightSidebar.branchAuditViewDiff")})]}),ys(r.createdAt,w)&&e.jsx("div",{className:"mt-1 truncate text-[10px] text-muted-foreground/70",children:ys(r.createdAt,w)})]}),e.jsx("button",{type:"button",onClick:()=>qf(r.key),className:"mr-1 mt-1 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition hover:bg-surface hover:text-foreground active:scale-95",title:a("common.delete"),"aria-label":a("common.delete"),children:e.jsx(Ba,{size:12})})]},r.key)),Un.length>0?Un.slice(0,Math.max(0,8-Qr.length)).map(r=>e.jsxs("div",{className:`flex min-w-0 items-start gap-1 rounded-md transition ${Ze===r.key?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,children:[e.jsxs("button",{type:"button",onClick:()=>Kf(r.key),className:"min-w-0 flex-1 px-2 py-1.5 text-left active:scale-[0.99]",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] font-medium text-foreground",children:r.repoLabel}),e.jsxs("span",{className:"shrink-0 rounded bg-surface px-1.5 py-0.5 text-[10px] text-muted-foreground",children:[r.records.length," hunk"]})]}),e.jsxs("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1 text-[10px] text-muted-foreground",children:[e.jsx("span",{className:"rounded bg-surface px-1.5 py-0.5",children:r.branchName??"HEAD"}),e.jsx("span",{className:"text-muted-foreground/60",children:"→"}),e.jsx("span",{className:"rounded bg-surface px-1.5 py-0.5",children:r.baseRef}),r.diffFingerprint&&e.jsx("span",{className:"rounded bg-surface px-1.5 py-0.5",children:r.diffFingerprint})]}),ys(r.latestInjectedAt,w)&&e.jsx("div",{className:"mt-1 truncate text-[10px] text-muted-foreground/70",children:a("rightSidebar.branchAuditGeneratedAt",{time:ys(r.latestInjectedAt,w)??""})})]}),e.jsx("button",{type:"button",onClick:()=>{Df(r)},className:"mr-1 mt-1 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition hover:bg-surface hover:text-foreground active:scale-95",title:a("rightSidebar.branchAuditClearTitle"),"aria-label":a("rightSidebar.branchAuditClearTitle"),children:e.jsx(Ba,{size:12})})]},r.key)):Qr.length===0?e.jsx("div",{className:"rounded-md bg-surface-2 px-2 py-1.5 text-[11px] text-muted-foreground",children:a("rightSidebar.branchAuditEmpty")}):null]})]})]}):null,Ec=or&&b&&On?e.jsxs("div",{className:ja?"overflow-visible":"overflow-hidden",children:[nh,e.jsxs("button",{type:"button",onClick:()=>{Ke||cf(r=>{const i=!r;return i&&ye&&!On&&!nn&&Ro(ye),i})},"aria-expanded":ja,className:`group flex w-full items-center gap-2 px-1 py-1.5 text-left transition ${Ke?"cursor-default":"rounded-lg hover:bg-surface-2 active:scale-[0.99]"}`,children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-surface-2 text-muted-foreground group-hover:text-foreground",children:e.jsx(Mr,{size:14})}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-[12px] font-semibold text-foreground",children:a("rightSidebar.gitQuickActions")}),e.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[e.jsxs("span",{className:`inline-flex min-w-[4.5rem] items-center justify-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium ${pn.staged>0?"bg-accent/10 text-accent":"bg-surface-2 text-muted-foreground"}`,children:[nn&&e.jsx(at,{size:10,className:"animate-spin"}),pn.staged>0?a("rightSidebar.stagedCount",{count:pn.staged}):a("rightSidebar.noStagedChangesShort")]}),!Ke&&e.jsx("span",{className:`flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground transition group-hover:bg-surface-elevated group-hover:text-foreground ${ja?"rotate-90":""}`,children:e.jsx(Na,{size:13})})]})]}),ja&&e.jsxs("div",{className:"space-y-0",children:[Lt.length>1&&e.jsxs("div",{className:"border-b border-border/10 px-1 py-3",children:[e.jsx("div",{className:"mb-2 flex items-center justify-between gap-2",children:e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] font-semibold text-foreground",children:a("rightSidebar.gitRepositorySectionTitle")}),e.jsx("div",{className:"mt-0.5 truncate text-[10px] text-muted-foreground",children:Sf})]})}),e.jsx(Wn,{label:a("rightSidebar.gitRepositoryLabel"),value:ye??"",options:Lt,placeholder:a("rightSidebar.gitRepositoryPlaceholder"),searchPlaceholder:a("rightSidebar.gitRepositorySearchPlaceholder"),emptyText:a("rightSidebar.gitRepositoryEmpty"),disabled:!!Pe,onChange:r=>{Rc(r||null)}}),ze&&e.jsx("div",{className:"mt-2 rounded-md bg-[rgb(var(--warning-rgb)_/_0.12)] px-2 py-1.5 text-[11px] text-[color:var(--warning)]",children:a("rightSidebar.selectRepositoryForGitActions")})]}),e.jsxs("div",{className:"border-b border-border/10 px-1 py-3",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] font-semibold text-foreground",children:a("rightSidebar.branchSectionTitle")}),e.jsx("div",{className:"mt-0.5 truncate text-[10px] text-muted-foreground",children:jf})]}),e.jsxs("button",{type:"button",onClick:()=>{Qf()},disabled:!Tf,className:`relative inline-flex h-7 shrink-0 items-center justify-center rounded-md px-2.5 text-[11px] font-semibold transition disabled:cursor-not-allowed disabled:opacity-50 active:scale-95 ${Wo?"bg-accent/10 text-accent hover:bg-accent/15":"bg-surface-2 text-foreground hover:bg-surface-elevated"}`,title:a("rightSidebar.switchBranch"),children:[e.jsx("span",{className:Pe?.action==="switch-branch"||Wo?"opacity-0":"",children:a("rightSidebar.switchBranch")}),Pe?.action==="switch-branch"&&e.jsx(at,{size:12,className:"absolute animate-spin"}),Wo&&Pe?.action!=="switch-branch"&&e.jsx("span",{className:"absolute",children:"✓"})]})]}),e.jsx(Wn,{label:a("rightSidebar.currentBranchLabel"),value:ns,options:Nf,placeholder:a("rightSidebar.switchBranchPlaceholder"),searchPlaceholder:a("rightSidebar.switchBranchSearchPlaceholder"),emptyText:a("rightSidebar.switchNoBranches"),disabled:!!Pe,onChange:Gs})]}),e.jsxs("div",{className:"border-b border-border/10 px-1 py-3",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] font-semibold text-foreground",children:a("rightSidebar.commitSectionTitle")}),e.jsx("div",{className:"mt-0.5 truncate text-[10px] text-muted-foreground",children:ze?a("rightSidebar.selectRepositoryForGitActions"):pn.staged>0?a("rightSidebar.commitReadyHint",{count:pn.staged}):a("rightSidebar.commitNeedsStaged")})]}),e.jsxs("button",{type:"button",onClick:()=>{Nc()},disabled:!!Pe||ze||pn.staged===0||!Ws.trim(),className:`relative inline-flex h-7 shrink-0 items-center justify-center rounded-md px-2.5 text-[11px] font-semibold transition active:scale-95 ${zo?"bg-accent/10 text-accent disabled:bg-accent/10 disabled:text-accent":"bg-primary text-primary-foreground hover:bg-primary/90 disabled:bg-surface-2 disabled:text-muted-foreground"} disabled:cursor-not-allowed`,title:ze?a("rightSidebar.selectRepositoryForGitActions"):pn.staged===0?a("rightSidebar.commitNeedsStaged"):a("rightSidebar.commitChanges"),children:[e.jsx("span",{className:Pe?.action==="commit"||zo?"opacity-0":"",children:a("rightSidebar.commitChanges")}),Pe?.action==="commit"&&e.jsx(at,{size:12,className:"absolute animate-spin"}),zo&&Pe?.action!=="commit"&&e.jsx("span",{className:"absolute",children:"✓"})]})]}),e.jsx("input",{value:Ws,onChange:r=>ll(r.target.value),onKeyDown:r=>{(r.metaKey||r.ctrlKey)&&r.key==="Enter"&&(r.preventDefault(),Nc())},placeholder:a("rightSidebar.commitMessagePlaceholder"),disabled:!!Pe,className:"w-full rounded-md border border-border/15 bg-surface-2 px-2.5 py-1.5 text-[12px] text-foreground outline-none transition placeholder:text-muted-foreground/70 focus:border-primary/35 focus:ring-1 focus:ring-primary/25 disabled:cursor-not-allowed disabled:opacity-60",maxLength:300})]}),e.jsxs("div",{className:"border-b border-border/10 px-1 py-3",children:[e.jsxs("button",{type:"button",onClick:()=>vr(r=>!r),className:"group flex w-full items-center justify-between gap-2 rounded-lg px-1 py-1.5 text-left transition hover:bg-surface-2 active:scale-[0.99]","aria-expanded":er,children:[e.jsx("span",{className:"min-w-0 text-[11px] font-semibold text-foreground",children:a("rightSidebar.recentCommitsTitle")}),e.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[Cn&&e.jsx(at,{size:12,className:"animate-spin text-muted-foreground"}),e.jsx("span",{className:`flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground transition group-hover:bg-surface-elevated group-hover:text-foreground ${er?"rotate-90":""}`,children:e.jsx(Na,{size:13})})]})]}),er&&e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-surface-2 px-2 py-1.5 text-muted-foreground focus-within:bg-surface-elevated",children:[e.jsx(qn,{size:12,className:"shrink-0"}),e.jsx("input",{value:Rn,onChange:r=>Zr(r.target.value),placeholder:a("rightSidebar.recentCommitsSearchPlaceholder"),className:"min-w-0 flex-1 bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground",autoCapitalize:"off",autoCorrect:"off",autoComplete:"off",spellCheck:!1}),Rn&&e.jsx("button",{type:"button",onClick:()=>Zr(""),className:"rounded-full p-0.5 text-muted-foreground hover:bg-surface hover:text-foreground","aria-label":a("rightSidebar.clearSearch"),children:e.jsx(Ut,{size:12})})]}),e.jsxs("div",{className:"max-h-56 space-y-1 overflow-y-auto overscroll-contain pr-1",onScroll:Rf,children:[tr.length>0?tr.map(r=>{const[i,...u]=r.split(/\s+/),x=u.join(" ")||r;return e.jsxs("button",{type:"button",onClick:()=>{Vf(r)},className:"flex w-full min-w-0 items-start gap-2 rounded-md bg-surface-2 px-2 py-1.5 text-left font-mono text-[10px] transition hover:bg-surface-elevated active:scale-[0.99]",title:x,children:[e.jsx("span",{className:"shrink-0 text-[color:var(--diff-hunk-accent)]",children:i}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-muted-foreground",title:x,children:x}),He===i&&e.jsx(at,{size:11,className:"shrink-0 animate-spin text-muted-foreground"})]},r)}):Cn?e.jsx("div",{className:"rounded-md bg-surface-2 px-2 py-2 text-center text-[11px] text-muted-foreground",children:a("common.loading")}):e.jsx("div",{className:"rounded-md bg-surface-2 px-2 py-1.5 text-[11px] text-muted-foreground",children:a("rightSidebar.recentCommitsEmpty")}),Q&&e.jsx("div",{className:"flex justify-center rounded-md bg-surface-2 px-2 py-2 text-muted-foreground",children:e.jsx(at,{size:12,className:"animate-spin"})}),no&&!Q&&tr.length>0&&e.jsx("button",{type:"button",onClick:()=>{fs({reset:!1})},className:"w-full rounded-md bg-surface-2 px-2 py-1.5 text-[11px] font-medium text-muted-foreground transition hover:bg-surface-elevated hover:text-foreground",children:a("rightSidebar.recentCommitsLoadMore")})]})]}),nt&&e.jsx("div",{className:"mt-2 rounded-md bg-destructive/10 px-2 py-1.5 text-[11px] text-destructive",children:nt}),nr&&e.jsx("div",{className:"mt-2 rounded-md bg-destructive/10 px-2 py-1.5 text-[11px] text-destructive",children:nr})]}),e.jsxs("div",{className:"px-1 py-3",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[e.jsx("div",{className:"text-[11px] font-semibold text-foreground",children:a("rightSidebar.pushSectionTitle")}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[e.jsxs("button",{type:"button",onClick:()=>{eh()},disabled:!Af,className:`relative inline-flex h-7 min-w-[3.25rem] items-center justify-center rounded-md px-2.5 text-[11px] font-semibold transition disabled:cursor-not-allowed disabled:opacity-50 active:scale-95 ${Go?"bg-accent/10 text-accent hover:bg-accent/15":"bg-surface-2 text-foreground hover:bg-surface-elevated"}`,title:a("rightSidebar.pullChanges"),children:[e.jsx("span",{className:Pe?.action==="pull"||Go?"opacity-0":"",children:a("rightSidebar.pullChanges")}),Pe?.action==="pull"&&e.jsx(at,{size:12,className:"absolute animate-spin"}),Go&&Pe?.action!=="pull"&&e.jsx("span",{className:"absolute",children:"✓"})]}),e.jsxs("button",{type:"button",onClick:()=>{Zf()},disabled:!Pf,className:`relative inline-flex h-7 min-w-[3.25rem] items-center justify-center rounded-md px-2.5 text-[11px] font-semibold transition disabled:cursor-not-allowed disabled:opacity-50 active:scale-95 ${qo?"bg-accent/10 text-accent hover:bg-accent/15":"bg-surface-2 text-foreground hover:bg-surface-elevated"}`,title:a("rightSidebar.pushChanges"),children:[e.jsx("span",{className:Pe?.action==="push"||qo?"opacity-0":"",children:a("rightSidebar.pushChanges")}),Pe?.action==="push"&&e.jsx(at,{size:12,className:"absolute animate-spin"}),qo&&Pe?.action!=="push"&&e.jsx("span",{className:"absolute",children:"✓"})]})]})]}),e.jsxs("div",{className:`mb-2 flex min-w-0 items-center justify-between gap-2 rounded-md px-2 py-1.5 text-[11px] ${sc.className}`,title:ue?.upstream??void 0,children:[e.jsx("span",{className:"truncate font-medium",children:sc.text}),e.jsx("span",{className:"w-[6.5rem] shrink-0 truncate text-right text-[10px] opacity-75",children:ue?.upstream??""})]}),e.jsxs("div",{className:`grid gap-1.5 ${tc?"grid-cols-2":"grid-cols-1"}`,children:[tc&&e.jsx(Wn,{label:a("rightSidebar.pushRemoteLabel"),value:sn,options:ec,placeholder:a("rightSidebar.pushRemotePlaceholder"),searchPlaceholder:a("rightSidebar.pushRemoteSearchPlaceholder"),emptyText:a("rightSidebar.pushNoRemotes"),disabled:!!Pe,onChange:qs}),e.jsx(Wn,{label:a("rightSidebar.pushBranchLabel"),value:an,options:Mf,placeholder:a("rightSidebar.pushBranchPlaceholder",{branch:ue?.branch??"HEAD"}),searchPlaceholder:a("rightSidebar.pushBranchSearchPlaceholder"),emptyText:a("rightSidebar.pushNoBranches"),disabled:!!Pe,onChange:Ks})]})]})]})]}):null,sh=o.useCallback(r=>{const i=lt(r,b);if(!i)return[];const u=fi(r),x=[];return r.canStage&&x.push({key:"stage-file",label:a("rightSidebar.stageFile"),onClick:()=>{it({action:"stage-file",cwd:i,paths:[r.path]},a("rightSidebar.stageFile"),u)}}),r.canUnstage&&x.push({key:"unstage-file",label:a("rightSidebar.unstageFile"),onClick:()=>{it({action:"unstage-file",cwd:i,paths:[r.path]},a("rightSidebar.unstageFile"),u)}}),r.canStash&&x.push({key:"stash-file",label:a("rightSidebar.stashFile"),onClick:()=>{it({action:"stash-file",cwd:i,paths:[r.path]},a("rightSidebar.stashFile"),u)}}),r.canRestoreWorktree&&x.push({key:"restore-worktree-file",label:a("rightSidebar.restoreFile"),destructive:!0,onClick:()=>Dr({kind:"restore",file:r,phrase:""})}),x},[b,it,a]),ah=o.useCallback(()=>{if(m){f?.();return}kr(0),jr.current?.slideTo(0),wr(!1),kt(null)},[f,m]),Lc=o.useCallback(r=>{if(j(""),It(r),Xe(null),kt(null),ne(null),ee){m&&f?.(),kr(0),jr.current?.slideTo(0),wr(!1);return}},[ee,f,m,Xe,It]);o.useEffect(()=>{const r=i=>{const u=i.detail,x=u?.path;if(typeof x!="string"||!x.startsWith("/"))return;j(""),kt(null),Te(null);const v=!!(b&&(x===b||x.startsWith(`${b}/`)));if(u.kind==="file"){const R=ci(x);cs(x),typeof u.line=="number"&&Number.isSafeInteger(u.line)&&u.line>0&&Te(u.line),It(v?null:R),ne(T=>({path:x,nonce:(T?.nonce??0)+1}));return}Xe(null),v?(It(null),ne(R=>({path:x,nonce:(R?.nonce??0)+1}))):(ne(null),It(x)),ee&&(m&&f?.(),kr(0),jr.current?.slideTo(0),wr(!1))};return window.addEventListener(zc,r),()=>window.removeEventListener(zc,r)},[cs,ee,f,m,b,Xe,It]),o.useEffect(()=>{t||(At(!1),zt(!1))},[t]),o.useEffect(()=>{if(!Xt&&!hr)return;const r=i=>{i instanceof globalThis.KeyboardEvent&&i.key!=="Escape"||i instanceof globalThis.MouseEvent&&i.target instanceof Node&&(Ts.current?.contains(i.target)||yn.current?.contains(i.target))||(At(!1),zt(!1))};return window.addEventListener("mousedown",r),window.addEventListener("keydown",r),()=>{window.removeEventListener("mousedown",r),window.removeEventListener("keydown",r)}},[hr,Xt]);const Ac=e.jsxs("div",{"data-local-layer":"file-explorer-menu-host",className:"sticky top-0 z-20 bg-surface/95 px-2.5 py-1.5 backdrop-blur",children:[e.jsxs("div",{className:"flex min-h-9 min-w-0 items-center gap-1.5",children:[e.jsx("button",{type:"button",onClick:yf,disabled:!da,className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition hover:bg-surface-2 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-35 active:scale-95","aria-label":a("rightSidebar.parentFolder"),title:a("rightSidebar.parentFolder"),children:e.jsx(Pd,{size:14})}),e.jsx("button",{type:"button",onClick:zl,disabled:!b||Ln===b,className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition hover:bg-surface-2 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-35 active:scale-95","aria-label":a("rightSidebar.backToProjectRoot"),title:a("rightSidebar.backToProjectRoot"),children:e.jsx(qc,{size:14})}),e.jsx("button",{type:"button",onClick:wf,disabled:!pe,className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition hover:bg-surface-2 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-35 active:scale-95","aria-label":a("rightSidebar.refreshFiles"),title:cl?a("rightSidebar.fileWatchUnavailable",{message:cl}):a("rightSidebar.refreshFiles"),children:e.jsx(xi,{size:13})}),e.jsx("div",{className:"min-w-0 flex-1 px-1",title:pe??void 0,children:e.jsxs("div",{className:"flex min-w-0 items-center gap-1 text-[12px] font-medium text-foreground",children:[e.jsx("span",{className:"truncate",children:xf}),ea==="modified"&&e.jsx("span",{className:"inline-flex shrink-0 text-primary",title:a("fileTree.sortedByModified"),"aria-label":a("fileTree.sortedByModified"),children:e.jsx(Wc,{size:11})})]})}),e.jsx("button",{type:"button",onClick:()=>pe&&zr(pe,Et??void 0),disabled:!pe,...pe&&Et?Mo(ca(pe),Et):{},className:`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md transition disabled:cursor-not-allowed disabled:opacity-35 active:scale-95 ${Et&&(q===Et||Ce===Et)?"bg-surface-elevated text-foreground":"bg-primary/10 text-primary hover:bg-primary/20"}`,"aria-label":a(Et&&Ce===Et?"rightSidebar.copied":Et&&q===Et?"rightSidebar.inserted":"rightSidebar.insertCurrentFolder"),title:a("rightSidebar.insertCurrentFolder"),children:Et&&(q===Et||Ce===Et)?e.jsx(gi,{size:13}):e.jsx(za,{size:13})}),e.jsxs("div",{ref:yn,className:"relative shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>{At(!1),zt(r=>!r)},className:`inline-flex h-7 w-7 items-center justify-center rounded-md transition active:scale-95 ${hr?"bg-surface-elevated text-foreground":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,"aria-expanded":hr,"aria-haspopup":"menu","aria-label":a("sidebar.moreActions"),title:a("sidebar.moreActions"),children:e.jsx(bi,{size:14})}),hr&&e.jsxs("div",{role:"menu","data-local-layer":"file-explorer-menu",className:"absolute right-0 top-[calc(100%+4px)] z-30 w-48 overflow-hidden rounded-xl border border-border/15 bg-surface p-1 text-[12px] shadow-xl shadow-[0_18px_48px_var(--app-shadow-soft)] animate-fade-in",children:[e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{zt(!1),kf()},disabled:!Lo,className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left transition disabled:opacity-40 ${us?"text-primary hover:bg-primary/10":"text-foreground hover:bg-surface-2"}`,children:[us?e.jsx(Xo,{size:14}):e.jsx($a,{size:14,className:"text-muted-foreground"}),e.jsx("span",{children:a(us?"rightSidebar.unpinCurrentFolder":"rightSidebar.pinCurrentFolder")})]}),e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{zt(!1),ff()},className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left transition ${bo?"text-primary hover:bg-primary/10":"text-foreground hover:bg-surface-2"}`,children:[bo?e.jsx(hm,{size:14}):e.jsx(wi,{size:14,className:"text-muted-foreground"}),e.jsx("span",{children:a(bo?"rightSidebar.hideHiddenFiles":"rightSidebar.showHiddenFiles")})]}),e.jsxs("button",{type:"button",role:"menuitem",disabled:!pe,onClick:()=>{pe&&(zt(!1),hf(pe,ea==="modified"?"name":"modified"))},className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-foreground transition hover:bg-surface-2 disabled:opacity-40",children:[ea==="modified"?e.jsx(Zh,{size:14}):e.jsx(Wc,{size:14,className:"text-muted-foreground"}),e.jsx("span",{children:a(ea==="modified"?"fileTree.sortByName":"fileTree.sortByModified")})]})]})]})]}),b&&(ua.length>0||vf)&&e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1 pb-0.5 text-[11px]",children:[e.jsx("span",{className:"shrink-0 px-1 text-[10px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:a("rightSidebar.pinnedFolders")}),e.jsxs("button",{type:"button",onClick:zl,className:`inline-flex max-w-[9rem] shrink-0 items-center gap-1 rounded-full px-2 py-0.5 font-medium transition active:scale-95 ${pe===b?"bg-surface-elevated text-foreground":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,title:b,children:[e.jsx(qc,{size:10,className:"shrink-0"}),e.jsx("span",{className:"truncate",children:Ve})]}),ua.map(r=>{const i=r.path,u=r.kind==="file",x=u?Ye===i:pe===i;return e.jsxs("span",{className:`group inline-flex max-w-[12rem] shrink-0 items-center rounded-full transition ${x?"bg-primary/15 text-primary":"bg-surface-2 text-foreground hover:bg-surface-elevated"}`,title:i,children:[e.jsxs("button",{type:"button",onClick:()=>u?cs(i):It(i),className:"inline-flex min-w-0 items-center gap-1 px-2 py-0.5 font-medium active:scale-95",children:[u?e.jsx(ki,{size:10,className:"shrink-0"}):e.jsx($a,{size:10,className:"shrink-0"}),e.jsx("span",{className:"truncate",children:mt(i)})]}),e.jsx("button",{type:"button",onClick:()=>ln(i),className:"mr-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-muted-foreground transition hover:bg-surface-elevated hover:text-foreground","aria-label":a("rightSidebar.unpinFolder",{name:mt(i)}),title:a("rightSidebar.unpinFolder",{name:mt(i)}),children:e.jsx(Ut,{size:9})})]},i)})]}),e.jsx("span",{"data-local-layer":"file-explorer-divider",className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 h-px bg-border/15","aria-hidden":"true"})]}),Vo=o.useMemo(()=>{if($n===null)return null;const r=typeof navigator>"u"?void 0:navigator.language,i=Math.max(0,Math.floor((fo-$n)/1e3)),u=new Intl.RelativeTimeFormat(r,{numeric:"auto"}),[x,v]=i<60?[-i,"second"]:i<3600?[-Math.floor(i/60),"minute"]:i<86400?[-Math.floor(i/3600),"hour"]:[-Math.floor(i/86400),"day"];return u.format(x,v)},[fo,$n]),Pc=b&&!ls?e.jsx("button",{type:"button",onClick:()=>{Jf(!xo)},"aria-pressed":xo,title:a("rightSidebar.multiRepoScanTitle"),className:`inline-flex h-7 shrink-0 items-center rounded-full px-2.5 text-[11px] font-medium transition active:scale-95 ${xo?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground hover:text-foreground"}`,children:a("rightSidebar.multiRepoScan")}):null,Tc=b?e.jsxs("div",{className:"inline-flex shrink-0 items-center gap-1.5",children:[Vo?e.jsx("span",{className:"whitespace-nowrap text-[10px] text-muted-foreground",title:a("rightSidebar.gitLastUpdated",{time:Vo}),children:Vo}):null,e.jsx("button",{type:"button",onClick:()=>{os()},disabled:Mt,className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition hover:bg-surface-2 hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50 active:scale-95","aria-label":a("rightSidebar.refreshGit"),title:a("rightSidebar.refreshGit"),children:e.jsx(xi,{size:13,className:Mt?"animate-spin":""})})]}):null,oh=El?a("rightSidebar.changeAuditScopeAll"):un.length===1?un[0].relativeRoot==="."?Ve:un[0].relativeRoot||un[0].name:`${un.length} repos`,Ic=b?e.jsxs("div",{className:"inline-flex h-7 shrink-0 items-center",children:[e.jsx(kd,{open:Ds,onOpenChange:Tr,showScopePicker:gn,selectedAll:El,repos:mf,selectedRoots:qt,onToggleRepo:Ff,onGenerate:()=>If(),disabled:!b,inserted:q===Hl,buttonLabel:a("rightSidebar.changeAuditShort"),insertedLabel:a("rightSidebar.inserted"),title:a("rightSidebar.insertChangeAuditPromptTitle"),ariaLabel:a("rightSidebar.insertChangeAuditPrompt"),scopeTitle:a("rightSidebar.changeAuditScopeLabel"),scopeLabel:oh,allLabel:a("rightSidebar.changeAuditScopeAll"),generateLabel:a("rightSidebar.changeAuditShort"),loading:Lr,error:!!Pr,statusTitle:Pr??(Lr?a("rightSidebar.changeAuditLoading"):jt.length>0?`${a("rightSidebar.changeAuditLoaded",{count:jt.length})}${$c?` · ${a("rightSidebar.changeAuditLoadedAt",{time:$c})}`:""}`:void 0)}),e.jsx("button",{type:"button",onClick:()=>{_f()},disabled:Lr||jt.length===0,className:`inline-flex h-7 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition hover:bg-surface-2 hover:text-foreground disabled:pointer-events-none active:scale-95 ${jt.length>0?"":"invisible"}`,title:a("rightSidebar.clearChangeAuditTitle"),"aria-label":a("rightSidebar.clearChangeAudit"),children:e.jsx(Ba,{size:12})})]}):null,Ra=ve.size>0||se?.available||Fr?e.jsxs("div",{className:"flex flex-wrap items-center gap-1 text-[10px] font-medium",children:[se?.available&&se.branch&&e.jsxs("span",{className:"inline-flex min-w-0 max-w-[8rem] items-center gap-0.5 truncate rounded bg-surface-2 px-1.5 py-0.5 text-muted-foreground",title:se.branch,children:[e.jsx(Mr,{size:10,className:"shrink-0"}),e.jsx("span",{className:"truncate",children:se.branch})]}),st.modified>0&&e.jsxs("span",{className:"rounded bg-surface-2 px-1.5 py-0.5 text-[color:var(--diff-hunk-accent)]",children:[st.modified,"M"]}),st.added>0&&e.jsxs("span",{className:"rounded bg-surface-2 px-1.5 py-0.5 text-[color:var(--diff-insert-strong)]",children:["+",st.added]}),st.deleted>0&&e.jsxs("span",{className:"rounded bg-surface-2 px-1.5 py-0.5 text-[color:var(--diff-delete-strong)]",children:["-",st.deleted]}),st.renamed>0&&e.jsxs("span",{className:"rounded bg-surface-2 px-1.5 py-0.5 text-muted-foreground",children:[st.renamed,"R"]}),st.copied>0&&e.jsxs("span",{className:"rounded bg-surface-2 px-1.5 py-0.5 text-[color:var(--diff-insert-strong)]",children:[st.copied,"C"]}),st.untracked>0&&e.jsxs("span",{className:"rounded bg-surface-2 px-1.5 py-0.5 text-[color:var(--diff-insert-strong)]",children:[st.untracked,"U"]}),st.conflicted>0&&e.jsxs("span",{className:"rounded bg-destructive/10 px-1.5 py-0.5 text-destructive",children:[st.conflicted,"!"]}),st.other>0&&e.jsxs("span",{className:"rounded bg-surface-2 px-1.5 py-0.5 text-muted-foreground",children:[st.other,"?"]}),st.staged>0&&e.jsx("span",{className:"rounded bg-accent/10 px-1.5 py-0.5 text-accent",children:a("rightSidebar.stagedCountShort",{count:st.staged})}),se?.available&&b&&ve.size>0&&V.length<=1&&e.jsx("button",{type:"button",onClick:()=>{it({action:"stage-all",cwd:b},a("rightSidebar.stageAll"))},disabled:!!Pe,className:"rounded-full bg-accent/10 px-2 py-0.5 font-medium text-accent hover:bg-accent/20 disabled:opacity-50",title:a("rightSidebar.stageAll"),children:a("rightSidebar.stageAll")}),se?.available&&b&&ve.size>0&&V.length<=1&&e.jsx("button",{type:"button",onClick:()=>Dr({kind:"stash-all",repoRoot:b,repoLabel:Ve}),disabled:!!Pe,className:"rounded-full bg-surface-2 px-2 py-0.5 font-medium text-foreground hover:bg-surface-elevated disabled:opacity-50",title:a("rightSidebar.stashAll"),children:a("rightSidebar.stashAll")})]}):null;return e.jsxs(em,{side:"right",isOpen:t,drawerWidthPx:n,onClose:s,onOpen:l,push:d,pinned:c,children:[Mo.popoverNode,e.jsxs("div",{className:"relative shrink-0 border-b border-border/15 bg-surface px-2 pt-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"min-w-0 flex-1 px-1",children:e.jsxs("div",{className:"flex min-h-[1.25rem] items-baseline gap-1.5",children:[e.jsx("span",{className:"truncate text-[13px] font-semibold text-foreground",title:b??void 0,children:Ve}),(!ee||co)&&se?.available&&se.branch&&e.jsxs("span",{className:"inline-flex min-w-0 items-center gap-0.5 truncate text-[11px] text-muted-foreground",title:se.branch,children:[e.jsx(Mr,{size:10,className:"shrink-0"}),e.jsx("span",{className:"max-w-[7rem] truncate",children:se.branch})]})]})}),e.jsx("button",{type:"button",onClick:()=>{const r=!ae;fe(r),r?window.requestAnimationFrame(()=>document.querySelector("[data-right-search]")?.focus()):j("")},className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition active:scale-95 ${ae?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,"aria-label":a("rightSidebar.toggleSearch"),title:a("common.search"),children:e.jsx(qn,{size:14})}),e.jsxs("button",{type:"button",role:"switch","aria-checked":Qe,onClick:()=>{xn(r=>!r),ur(!1)},className:`relative inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition active:scale-95 ${Qe?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,"aria-label":a("rightSidebar.toggleContextDraft"),title:a("rightSidebar.contextDraftTitle"),children:[e.jsx(jm,{size:14}),!Qe&&wt.trim()&&e.jsx("span",{className:"absolute right-0.5 top-0.5 h-1.5 w-1.5 rounded-full bg-primary","aria-hidden":"true"})]}),e.jsx("input",{ref:hl,type:"file",multiple:!0,className:"hidden",onChange:r=>{const i=r.target.files;!i||i.length===0||(ds(Array.from(i)),r.target.value="")}}),e.jsx("input",{ref:ml,type:"file",accept:"image/*",className:"hidden",onChange:r=>{const i=r.target.files?.[0];r.target.value="",i&&bf(i)}}),h&&e.jsx("button",{type:"button",onClick:h,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition active:scale-95 ${c?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,"aria-label":a(c?"sidebar.unpinSidebar":"sidebar.pinSidebar"),title:a(c?"sidebar.unpinSidebar":"sidebar.pinSidebar"),children:c?e.jsx(Xo,{size:14}):e.jsx($a,{size:14})}),e.jsxs("div",{ref:Ts,className:"relative shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>{zt(!1),At(r=>!r)},className:`relative inline-flex h-8 w-8 items-center justify-center rounded-full transition active:scale-95 ${Xt?"bg-surface-elevated text-foreground":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,"aria-expanded":Xt,"aria-haspopup":"menu","aria-label":a("sidebar.moreActions"),title:a("sidebar.moreActions"),children:e.jsx(bi,{size:15})}),Xt&&e.jsxs("div",{role:"menu",className:"absolute right-0 top-[calc(100%+4px)] z-30 w-56 overflow-hidden rounded-xl border border-border/15 bg-surface/98 p-1 text-[12px] shadow-xl shadow-[0_18px_48px_var(--app-shadow-soft)] backdrop-blur animate-fade-in",children:[e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{At(!1),hl.current?.click()},disabled:Vs,className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-foreground transition hover:bg-surface-2 disabled:opacity-50",children:[Vs?e.jsx(at,{size:14,className:"animate-spin text-muted-foreground"}):e.jsx(Pm,{size:14,className:"text-muted-foreground"}),e.jsx("span",{children:a("rightSidebar.uploadFiles")})]}),e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{At(!1),ml.current?.click()},disabled:Vs,className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-foreground transition hover:bg-surface-2 disabled:opacity-50",children:[Vs?e.jsx(at,{size:14,className:"animate-spin text-muted-foreground"}):e.jsx(xm,{size:14,className:"text-muted-foreground"}),e.jsx("span",{children:a("rightSidebar.insertLocalImage")})]}),h&&e.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{At(!1),h()},className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left transition ${c?"text-primary hover:bg-primary/10":"text-foreground hover:bg-surface-2"}`,children:[c?e.jsx(Xo,{size:14}):e.jsx($a,{size:14,className:"text-muted-foreground"}),e.jsx("span",{children:a(c?"sidebar.unpinSidebar":"sidebar.pinSidebar")})]}),c&&e.jsxs("div",{className:"mt-1 flex items-center gap-2 border-t border-border/15 px-1.5 pt-1.5",role:"group","aria-label":a("rightSidebar.layoutMode"),children:[e.jsx("div",{className:"shrink-0 pl-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:a("rightSidebar.layoutMode")}),e.jsx("div",{className:"grid min-w-0 flex-1 grid-cols-3 gap-0.5 rounded-lg bg-surface-2 p-0.5",children:[["auto",a("rightSidebar.layoutModeAuto")],["narrow",a("rightSidebar.layoutModeNarrow")],["wide",a("rightSidebar.layoutModeWide")]].map(([r,i])=>{const u=G===r;return e.jsx("button",{type:"button",role:"menuitemradio","aria-checked":u,onClick:()=>{J(r),At(!1)},className:`rounded-md px-1 py-1.5 text-center text-[11px] font-medium transition active:scale-95 ${u?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,children:i},r)})})]})]})]}),e.jsx("button",{type:"button",onClick:s,className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-surface-2 text-muted-foreground transition hover:bg-destructive/20 hover:text-destructive active:scale-95","aria-label":a("rightSidebar.close"),children:e.jsx(Ut,{size:14})})]}),ae&&e.jsxs("div",{className:"mt-2 space-y-1.5 pb-0.5",children:[e.jsxs("div",{className:"flex items-center gap-2 rounded-xl bg-surface-2 px-3 py-1.5 text-muted-foreground transition focus-within:bg-surface-elevated",children:[e.jsx(qn,{size:12,className:"shrink-0"}),e.jsx("input",{"data-right-search":!0,type:"search",value:U,onChange:r=>j(r.target.value),placeholder:a(M==="content"?"rightSidebar.searchPlaceholderContent":"rightSidebar.filterChanges"),className:"min-w-0 flex-1 bg-transparent text-[13px] text-foreground placeholder:text-muted-foreground",autoCapitalize:"off",autoCorrect:"off",autoComplete:"off",enterKeyHint:"search",spellCheck:!1}),e.jsxs("div",{className:`flex shrink-0 items-center gap-0.5 rounded-full bg-surface/70 p-0.5 font-medium ${ee?"text-[11px]":"text-[10px]"}`,children:[e.jsx("button",{type:"button",onClick:()=>Sc("name"),"aria-pressed":M==="name",className:`rounded-full px-2 transition active:scale-95 ${ee?"py-1":"py-0.5"} ${M==="name"?"bg-primary/15 text-primary":"text-muted-foreground/80 hover:text-foreground"}`,children:a("rightSidebar.searchModeName")}),e.jsx("button",{type:"button",onClick:()=>Sc("content"),"aria-pressed":M==="content",className:`rounded-full px-2 transition active:scale-95 ${ee?"py-1":"py-0.5"} ${M==="content"?"bg-primary/15 text-primary":"text-muted-foreground/80 hover:text-foreground"}`,children:a("rightSidebar.searchModeContent")})]}),U&&e.jsx("button",{type:"button",onClick:()=>j(""),className:"rounded-full p-0.5 text-muted-foreground hover:bg-surface hover:text-foreground","aria-label":a("rightSidebar.clearSearch"),children:e.jsx(Ut,{size:12})})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("label",{className:"flex min-w-0 flex-1 items-center gap-2 rounded-lg bg-surface-2 px-2.5 py-1.5 text-muted-foreground transition focus-within:bg-surface-elevated",children:[e.jsx(tm,{size:12,className:"shrink-0 text-primary"}),e.jsx("span",{className:"shrink-0 text-[10px] font-medium",children:a("rightSidebar.searchScope")}),e.jsx("input",{"data-search-scope":!0,value:K,onChange:r=>re(r.target.value),onKeyDown:r=>{r.key==="Enter"&&document.querySelector("[data-right-search]")?.focus()},className:"min-w-0 flex-1 bg-transparent font-mono text-[11px] text-foreground placeholder:text-muted-foreground",placeholder:a("rightSidebar.searchScopePlaceholder"),"aria-label":a("rightSidebar.searchScope"),autoCapitalize:"off",autoCorrect:"off",spellCheck:!1}),K!=="."&&e.jsx("button",{type:"button",onClick:()=>re("."),className:"shrink-0 rounded p-0.5 text-muted-foreground hover:bg-surface hover:text-foreground","aria-label":a("rightSidebar.resetSearchScope"),children:e.jsx(Ut,{size:11})})]}),e.jsxs("button",{type:"button",onClick:()=>Re(r=>!r),"aria-expanded":me,className:`relative inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg transition active:scale-95 ${me||ss.length>0||C||de||We?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,title:a("rightSidebar.searchOptions"),"aria-label":a("rightSidebar.searchOptions"),children:[e.jsx(rm,{size:13}),ss.length>0&&e.jsx("span",{className:"absolute -right-1 -top-1 min-w-4 rounded-full bg-primary px-1 text-[8px] font-bold leading-4 text-primary-foreground",children:ss.length})]})]}),me&&e.jsxs("div",{className:"animate-fade-in rounded-xl bg-surface-2 p-2",children:[e.jsxs("label",{className:"flex items-center gap-2 rounded-lg bg-surface px-2.5 py-1.5 text-muted-foreground focus-within:bg-surface-elevated",children:[e.jsx("span",{className:"shrink-0 text-[10px] font-medium",children:a("rightSidebar.searchExclude")}),e.jsx("input",{"data-search-exclude":!0,value:oe,onChange:r=>he(r.target.value),className:"min-w-0 flex-1 bg-transparent font-mono text-[11px] text-foreground placeholder:text-muted-foreground",placeholder:a("rightSidebar.searchExcludePlaceholder"),"aria-label":a("rightSidebar.searchExclude"),autoCapitalize:"off",autoCorrect:"off",spellCheck:!1}),oe&&e.jsx("button",{type:"button",onClick:()=>he(""),className:"rounded p-0.5 hover:bg-surface-2 hover:text-foreground","aria-label":a("rightSidebar.clearSearchExclude"),children:e.jsx(Ut,{size:11})})]}),M==="content"&&e.jsx("div",{className:"mt-1.5 flex flex-wrap items-center gap-1",role:"group","aria-label":a("rightSidebar.contentSearchOptions"),children:[[C,()=>Z(r=>!r),um,a("rightSidebar.matchCase")],[de,()=>Le(r=>!r),Im,a("rightSidebar.matchWholeWord")],[We,()=>De(r=>!r),Cm,a("rightSidebar.useRegex")]].map(([r,i,u,x])=>e.jsxs("button",{type:"button",onClick:i,"aria-pressed":r,className:`inline-flex items-center gap-1 rounded-lg px-2 py-1 text-[10px] transition ${r?"bg-primary/15 text-primary":"bg-surface text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,children:[e.jsx(u,{size:12}),x]},x))})]})]}),ls?null:e.jsxs("div",{className:"mt-2 grid grid-cols-3 gap-0.5 rounded-md bg-surface-2 p-0.5",children:[e.jsxs("button",{type:"button",onClick:()=>on("git"),className:`flex items-center justify-center gap-1 rounded px-2 py-1.5 text-[11px] font-medium transition active:scale-[0.98] ${Rr==="git"?"bg-surface-elevated text-foreground":"text-muted-foreground hover:bg-surface-2"}`,children:[e.jsx(Mr,{size:12}),a("rightSidebar.tabGit"),Mt&&Rr==="git"?e.jsx(at,{size:12,className:"animate-spin text-muted-foreground"}):null]}),e.jsxs("button",{type:"button",onClick:()=>on("diff"),className:`flex items-center justify-center gap-1 rounded px-2 py-1.5 text-[11px] font-medium transition active:scale-[0.98] ${Rr==="diff"?"bg-surface-elevated text-foreground":"text-muted-foreground hover:bg-surface-2"}`,children:[e.jsx(zd,{size:12}),a("rightSidebar.tabChanges"),Mt?e.jsx(at,{size:12,className:"animate-spin text-muted-foreground"}):ve.size>0?e.jsx("span",{className:"text-[10px] text-accent",children:ve.size}):null]}),e.jsxs("button",{type:"button",onClick:()=>on("files"),className:`flex items-center justify-center gap-1 rounded px-2 py-1.5 text-[11px] font-medium transition active:scale-[0.98] ${Rr==="files"?"bg-surface-elevated text-foreground":"text-muted-foreground hover:bg-surface-2"}`,children:[e.jsx(am,{size:12}),a("rightSidebar.tabFiles")]})]}),e.jsx("div",{className:"h-2"}),ol&&e.jsx("div",{className:"pointer-events-none absolute right-3 top-10 z-20 max-w-[72%] rounded-lg bg-destructive/95 px-3 py-2 text-[11px] font-medium text-destructive-foreground shadow-md animate-fade-in",children:ol})]}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-hidden bg-surface",children:[e.jsx(li,{active:Ke,mounted:or,fallback:e.jsx(vs,{slow:!1}),children:Ue?e.jsx("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:e.jsx(Xc,{items:Of,selectedKey:nf,onSelect:Fs,emptyText:a("rightSidebar.noChanges"),mobile:ee,backLabel:a("rightSidebar.backToChangeList"),headerTitle:a("rightSidebar.recentCommitsTitle"),headerMeta:`${Ue.headRef??""}${Ue.commits?.[0]?` · ${Ue.commits[0]}`:""}`,onClose:()=>{$e(null),Fs(null)},closeLabel:a("common.back"),wrap:Pt,onToggleWrap:ee?Ho:void 0,wrapTitle:a("rightSidebar.wrapLongLines"),wrapOnLabel:a("rightSidebar.wrapOn"),wrapOffLabel:a("rightSidebar.wrapOff"),desktopLayout:ee?"stacked":"split",onInsertDiffReference:Wr,onReferenceCopied:Cr,insertedReferenceKey:q,copiedReferenceKey:Ce,onClearAuditRecord:xa})}):xr?e.jsx("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:e.jsx(Xc,{items:Fo,selectedKey:io,onSelect:rn,emptyText:a(Me?"rightSidebar.branchAuditDiffEmpty":"rightSidebar.branchAuditEmpty"),mobile:ee,backLabel:a("rightSidebar.backToChangeList"),headerTitle:a(Me?"rightSidebar.branchAuditViewDiff":"rightSidebar.branchAuditTitle"),headerMeta:va?`${va.repoLabel} · ${va.branchName??"HEAD"} → ${va.baseRef}`:void 0,onClose:()=>{Qt(!1),Zt(null)},closeLabel:a("common.back"),wrap:Pt,onToggleWrap:ee?Ho:void 0,wrapTitle:a("rightSidebar.wrapLongLines"),wrapOnLabel:a("rightSidebar.wrapOn"),wrapOffLabel:a("rightSidebar.wrapOff"),desktopLayout:ee?"stacked":"split",onInsertDiffReference:Wr,onReferenceCopied:Cr,insertedReferenceKey:q,copiedReferenceKey:Ce,onClearAuditRecord:xa,walkthroughs:Uf,onWalkthroughNavigate:Hf,initialDetailScrollTop:Me&&Ze?Sn[Ze]:void 0,onDetailScrollPositionChange:Yf,externalSwiperRef:ee?aa:void 0,onMobileSlideChange:ee?lo:void 0})}):e.jsx("div",{className:"h-full overflow-y-auto overscroll-contain px-2 py-2",children:Ec||(Mt?e.jsx(vs,{slow:Zs}):Pn?e.jsx(Da,{message:Pn,onRetry:()=>{os()}}):Md(se)?e.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:a(b?"rightSidebar.gitUnavailable":"fileTree.noWorkingDir")}):se?.available===!1?e.jsx(Da,{message:se.error??a("rightSidebar.gitChangesLoadFailed"),onRetry:()=>{os()}}):b?e.jsx(vs,{slow:Zs}):e.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:a(b?"rightSidebar.gitUnavailable":"fileTree.noWorkingDir")}))})}),e.jsx(li,{active:Fn,children:ee?e.jsxs(Id,{className:"h-full min-h-0 w-full",slidesPerView:1,resistanceRatio:.45,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:".swiper-no-swiping",allowTouchMove:!1,touchAngle:75,touchStartPreventDefault:!1,onSwiper:r=>{jr.current=r,r.slideTo(sl,0)},onSlideChange:r=>{if(kr(r.activeIndex),as.current===r.activeIndex){as.current=null;return}r.activeIndex===0&&(wr(!1),kt(null),f?.())},children:[e.jsx(vi,{className:"h-full min-h-0",children:e.jsxs("div",{ref:Tn,onScroll:Al,onDragOver:ia,onDragEnter:ia,onDragLeave:Il,onDrop:_l,className:"h-full overflow-auto overscroll-contain bg-surface relative",children:[dl&&e.jsx("div",{className:"pointer-events-none absolute left-3 right-3 top-3 z-10 flex justify-center",children:e.jsx("div",{className:"rounded-xl bg-surface-elevated px-4 py-2 text-sm font-semibold text-foreground shadow-lg",children:a("rightSidebar.dropToUpload")})}),!U.trim()&&Ac,e.jsx(Gc,{rootPath:pe??"",onFileSelect:cs,onPathReference:zr,getReferenceText:ca,onReferenceCopied:Cr,insertedReferenceKey:q,copiedReferenceKey:Ce,onDirectoryRoot:Wl,onSearchFromDirectory:Gl,onDirectoryPinToggle:ql,onFilePinToggle:Kl,pinnedPaths:hn,selectedFilePath:Ye,query:le,searchRootPath:Cl,searchOptions:Nl,searchMode:M,onContentMatchSelect:Pl,onDirectoryDropFiles:(r,i)=>ds(i,r),revealDirectory:X,canOpenInFileBrowser:ul,onOpenInFileBrowser:Tl})]})}),e.jsx(vi,{className:"h-full min-h-0",children:e.jsx("div",{className:"h-full overflow-hidden bg-surface",children:e.jsx(Bi,{filePath:Fn&&(sf||sl===1)?Ye:null,onInsertReference:zr,onInsertText:Nr,onInsertFeature:Nr,onReviewReference:Ol,onReferenceCopied:Cr,onClose:ah,onDirectoryLinkOpen:Lc,isMobile:!0,lineRange:Kr,onLineRangeChange:kt,insertedReferenceKey:q,copiedReferenceKey:Ce,scrollToLine:$r,onScrollToLineHandled:()=>Te(null),markdownOutlineOpen:D,markdownOutlineCloseSignal:B,onOpenMarkdownOutline:E,onCloseMarkdownOutline:$,markdownImageLightboxOpen:L,markdownImageLightboxCloseSignal:A,onOpenMarkdownImageLightbox:O,onCloseMarkdownImageLightbox:I})})})]}):e.jsxs("div",{className:"flex h-full min-h-0",children:[e.jsxs("div",{ref:Tn,onScroll:Al,onDragOver:ia,onDragEnter:ia,onDragLeave:Il,onDrop:_l,className:"shrink-0 overflow-auto overscroll-contain bg-surface relative",style:{width:mo},children:[dl&&e.jsx("div",{className:"pointer-events-none absolute left-3 right-3 top-3 z-10 flex justify-center",children:e.jsx("div",{className:"rounded-xl bg-surface-elevated px-4 py-2 text-sm font-semibold text-foreground shadow-lg",children:a("rightSidebar.dropToUpload")})}),!U.trim()&&Ac,e.jsx(Gc,{rootPath:pe??"",onFileSelect:cs,onPathReference:zr,getReferenceText:ca,onReferenceCopied:Cr,insertedReferenceKey:q,copiedReferenceKey:Ce,onDirectoryRoot:Wl,onSearchFromDirectory:Gl,onDirectoryPinToggle:ql,onFilePinToggle:Kl,pinnedPaths:hn,selectedFilePath:Ye,query:le,searchRootPath:Cl,searchOptions:Nl,searchMode:M,onContentMatchSelect:Pl,onDirectoryDropFiles:(r,i)=>ds(i,r),revealDirectory:X,canOpenInFileBrowser:ul,onOpenInFileBrowser:Tl})]}),e.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":a("rightSidebar.resizeFileTree"),title:a("rightSidebar.resizeFileTree"),"data-local-layer":"file-preview-separator",className:"group relative z-10 w-2 shrink-0 cursor-col-resize touch-none border-l border-border/15 bg-surface",onPointerDown:pf,onPointerMove:gf,onPointerUp:Ll,onPointerCancel:Ll,onDoubleClick:()=>{po(Ni),vt(ws,Ni)},children:e.jsx("span",{className:"absolute left-1/2 top-0 h-full w-px -translate-x-1/2 bg-border/20 transition group-hover:bg-primary/45"})}),e.jsx("div",{className:"min-w-0 flex-1 overflow-hidden bg-surface",children:e.jsx(Bi,{filePath:Fn?Ye:null,onInsertReference:zr,onInsertText:Nr,onInsertFeature:Nr,onReviewReference:Ol,onReferenceCopied:Cr,onDirectoryLinkOpen:Lc,isMobile:!1,lineRange:Kr,onLineRangeChange:kt,insertedReferenceKey:q,copiedReferenceKey:Ce,scrollToLine:$r,onScrollToLineHandled:()=>Te(null),markdownOutlineOpen:D,markdownOutlineCloseSignal:B,onOpenMarkdownOutline:E,onCloseMarkdownOutline:$,markdownImageLightboxOpen:L,markdownImageLightboxCloseSignal:A,onOpenMarkdownImageLightbox:O,onCloseMarkdownImageLightbox:I})})]})}),e.jsx(li,{active:ft,mounted:af||ft,children:()=>ee?e.jsx(yi,{mobile:!0,backLabel:a("rightSidebar.backToChangeList"),externalSwiperRef:aa,onMobileSlideChange:lo,groups:Ot.length>0?uc():[],mode:St,onModeChange:wa,selectedKey:Ye,scrollToKey:pc,scrollToKeyNonce:Xs.nonce,compact:!1,collapsedDirectoryKeys:mr,onToggleDirectory:xc,onSelectFile:r=>{const i=Array.from(ve.values()).find(u=>ht(u)===r.key);i&&ya(ht(i))},renderLeading:hc,renderTrailing:r=>{const i=Array.from(ve.values()).find(u=>ht(u)===r.key);return i?cc(i):null},renderDirectoryTrailing:dc,renderSubtitle:r=>{const i=Array.from(ve.values()).find(u=>ht(u)===r.key);return i?ic(i):null},listContainerClassName:"termdock-native-select min-h-0 px-2 pb-[calc(env(safe-area-inset-bottom)+4.5rem)]",renderListHeader:r=>b&&e.jsxs("div",{className:"px-0 py-0",children:[Ra&&e.jsx("div",{className:"mb-2",children:Ra}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("div",{className:"min-w-0",children:e.jsx("div",{className:"text-[10px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:a("rightSidebar.allChanges")})}),e.jsxs("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:[Ot.length,"/",ve.size]})]}),e.jsxs("div",{className:"mt-2 flex min-w-0 flex-wrap items-center gap-1.5",children:[ac(),Pc,r,c&&_o(),Ic,Tc]}),Ct&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] font-medium text-foreground",children:Ct.label}),Ct.branch&&e.jsx("span",{className:"max-w-[7rem] truncate rounded bg-surface-2 px-1.5 py-0.5 text-[10px] text-muted-foreground",children:Ct.branch})]}),!Ct&&gn&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 rounded-md bg-surface-2 px-2 py-1.5 text-[11px] text-muted-foreground",children:[e.jsx(Mr,{size:12,className:"shrink-0"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:a("rightSidebar.selectRepositoryForDiff")})]})]}),aiContent:ha?(r=>bc(r)):void 0,emptyContent:Mt&&ve.size===0&&Fr===null?e.jsx(vs,{slow:Zs}):Pn&&ve.size===0?e.jsx(Da,{message:Pn,onRetry:()=>{os()}}):ve.size===0?e.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:a("rightSidebar.noChanges")}):Ot.length===0?e.jsx("div",{className:"bg-surface-2 px-3 py-4 text-center text-xs text-muted-foreground",children:a("rightSidebar.noMatchingChanges")}):null,renderMobileDetailHeader:e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>is(0),className:"inline-flex h-9 shrink-0 items-center gap-1.5 rounded-full bg-surface-2 px-3 text-xs font-semibold text-muted-foreground transition hover:bg-surface-elevated hover:text-foreground active:scale-95",title:a("rightSidebar.backToChangeList"),children:[e.jsx(Ns,{size:14}),a("rightSidebar.backToChangeList")]}),e.jsxs("div",{className:"flex min-w-0 items-center justify-end gap-1.5",children:[c&&_o(),e.jsxs("button",{type:"button",onClick:Ho,"aria-pressed":Pt,title:a("rightSidebar.wrapLongLines"),className:`inline-flex h-9 shrink-0 items-center gap-1 rounded-full px-3 text-[11px] font-medium transition active:scale-95 ${Pt?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground hover:text-foreground"}`,children:[e.jsx("span",{className:"font-mono text-[12px] leading-none",children:"Aa"}),e.jsx("span",{children:a(Pt?"rightSidebar.wrapOn":"rightSidebar.wrapOff")})]})]})]}),detailContainerClassName:"termdock-native-select termdock-diff-stream-scroller min-h-0",files:fc(),activePane:ft,wrap:Pt,showScrollHint:!Pt,diffViewType:uf,inlineMode:Yn,diffOptions:kc,reloadKey:pr,renderStreamBadge:r=>e.jsx(js,{status:r}),onHunkGitAction:jc,onInsertDiffReference:Wr,onReferenceCopied:Cr,insertedReferenceKey:q,copiedReferenceKey:Ce,onClearAuditRecord:xa,onDetailScroll:ga}):e.jsx(yi,{mobile:!1,desktopLayout:"split",desktopSidePanel:null,desktopListClassName:"w-[320px] min-w-[260px] shrink-0 overflow-y-auto overscroll-contain border-r border-border/15 bg-surface",backLabel:a("rightSidebar.backToChangeList"),groups:Ot.length>0?uc():[],mode:St,onModeChange:wa,selectedKey:Ye,scrollToKey:pc,scrollToKeyNonce:Xs.nonce,compact:!0,collapsedDirectoryKeys:mr,onToggleDirectory:xc,onSelectFile:r=>{const i=Array.from(ve.values()).find(u=>ht(u)===r.key);i&&ya(ht(i))},renderLeading:hc,renderTrailing:r=>{const i=Array.from(ve.values()).find(u=>ht(u)===r.key);return i?cc(i):null},renderDirectoryTrailing:dc,renderSubtitle:r=>{const i=Array.from(ve.values()).find(u=>ht(u)===r.key);return i?ic(i):null},aiContent:ha?(r=>bc(r)):void 0,emptyContent:Mt&&ve.size===0&&Fr===null?e.jsx(vs,{slow:Zs}):Pn&&ve.size===0?e.jsx(Da,{message:Pn,onRetry:()=>{os()}}):ve.size===0?e.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:a("rightSidebar.noChanges")}):Ot.length===0?e.jsx("div",{className:"bg-surface-2 px-3 py-4 text-center text-xs text-muted-foreground",children:a("rightSidebar.noMatchingChanges")}):null,renderListHeader:r=>b&&e.jsxs("div",{className:"px-0 py-0",children:[Ra&&e.jsx("div",{className:"mb-2",children:Ra}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"px-1 text-[10px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:a("rightSidebar.allChanges")}),e.jsx("div",{className:"flex items-center gap-1.5",children:e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[Ot.length,"/",ve.size]})})]}),e.jsxs("div",{className:"mt-2 flex min-w-0 flex-wrap items-center gap-1.5",children:[ac(),Pc,r,_o(),Ic,Tc]}),Ct&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px] font-medium text-foreground",children:Ct.label}),Ct.branch&&e.jsx("span",{className:"max-w-[7rem] truncate rounded bg-surface-2 px-1.5 py-0.5 text-[10px] text-muted-foreground",children:Ct.branch}),e.jsx("button",{type:"button",onClick:()=>Sa("stage-all",Ct.root,Ct.label),disabled:!!Pe,className:"rounded-full bg-accent/10 px-2 py-0.5 text-[10px] font-medium text-accent hover:bg-accent/20 disabled:opacity-50",title:a("rightSidebar.stageAll"),children:a("rightSidebar.stageAll")}),e.jsx("button",{type:"button",onClick:()=>Sa("stash-all",Ct.root,Ct.label),disabled:!!Pe,className:"rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-medium text-foreground hover:bg-surface-elevated disabled:opacity-50",title:a("rightSidebar.stashAll"),children:a("rightSidebar.stashAll")})]}),!Ct&&gn&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 rounded-md bg-surface-2 px-2 py-1.5 text-[11px] text-muted-foreground",children:[e.jsx(Mr,{size:12,className:"shrink-0"}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:a("rightSidebar.selectRepositoryForDiff")})]})]}),files:fc(),activePane:ft,wrap:Pt,showScrollHint:!Pt,diffViewType:Jt,inlineMode:Yn,diffOptions:kc,reloadKey:pr,renderStreamBadge:r=>e.jsx(js,{status:r}),onHunkGitAction:jc,onInsertDiffReference:Wr,onReferenceCopied:Cr,insertedReferenceKey:q,copiedReferenceKey:Ce,onClearAuditRecord:xa,onDetailScroll:ga})})]}),t&&Qe&&e.jsx(ap,{value:wt,collapsed:gt,autoCollapseAfterSend:Yt,focusRequest:qr,insertError:Vn?a("rightSidebar.contextDraftInsertFailed"):null,onChange:r=>{Wt(!1),Ht(r)},onCollapsedChange:ur,onAutoCollapseAfterSendChange:vn,onDisable:()=>xn(!1),onClear:()=>Ht(""),onInsert:()=>Ul(!1),onInsertAndSend:()=>Ul(!0),labels:{title:a("rightSidebar.contextDraftTitle"),hint:a("rightSidebar.contextDraftHint"),placeholder:a("rightSidebar.contextDraftPlaceholder"),collapse:a("rightSidebar.contextDraftCollapse"),expand:a("rightSidebar.contextDraftExpand"),disable:a("rightSidebar.contextDraftDisable"),clear:a("rightSidebar.contextDraftClear"),insert:a("rightSidebar.contextDraftInsert"),insertAndSend:a("rightSidebar.contextDraftInsertAndSend"),inserted:a("rightSidebar.contextDraftInserted"),sent:a("rightSidebar.contextDraftSent"),send:a("rightSidebar.contextDraftSend"),appended:a("rightSidebar.contextDraftAppended"),resize:a("rightSidebar.contextDraftResize"),autoCollapseAfterSend:a("rightSidebar.contextDraftAutoCollapseAfterSend"),characterCount:r=>a("rightSidebar.contextDraftCharacterCount",{count:r})}}),Lf(),dt&&typeof document<"u"&&Gr.createPortal(e.jsx("div",{className:"fixed inset-0 z-modal-backdrop bg-[var(--app-backdrop)] backdrop-blur-sm",onClick:()=>Dr(null),children:e.jsxs("div",{className:"fixed inset-x-3 bottom-[max(1.5rem,env(safe-area-inset-bottom,0px))] z-modal-panel mx-auto max-w-md rounded-2xl border border-border/20 bg-surface-elevated p-4 shadow-2xl",onClick:r=>r.stopPropagation(),children:[e.jsx("div",{className:"text-sm font-semibold text-foreground",children:dt.kind==="restore"?a("rightSidebar.confirmRestoreTitle"):a("rightSidebar.confirmStashAllTitle")}),e.jsx("div",{className:"mt-2 text-xs leading-relaxed text-muted-foreground",children:dt.kind==="restore"?a("rightSidebar.confirmRestoreDescription",{path:Ad(dt.file.absolutePath,b)}):a("rightSidebar.confirmStashAllDescription")}),dt.kind==="restore"&&e.jsx("input",{value:dt.phrase,onChange:r=>Dr({...dt,phrase:r.target.value}),placeholder:a("rightSidebar.confirmRestorePlaceholder"),className:"mt-3 w-full rounded-xl border border-border/20 bg-surface-2 px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground",autoFocus:!0}),e.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>Dr(null),className:"rounded-full bg-surface-2 px-3 py-1.5 text-xs font-medium text-muted-foreground hover:bg-surface-elevated hover:text-foreground",children:a("common.cancel")}),e.jsx("button",{type:"button",disabled:!!Pe||dt.kind==="restore"&&dt.phrase.trim()!==a("rightSidebar.confirmRestorePhrase"),onClick:()=>{if(dt.kind==="restore"){const r=lt(dt.file,b);if(!r)return;it({action:"restore-worktree-file",cwd:r,paths:[dt.file.path],confirm:{acknowledged:!0,phrase:dt.phrase}},a("rightSidebar.restoreFile"),fi(dt.file))}else{const r=dt.repoRoot??b;if(!r)return;it({action:"stash-all",cwd:r},a("rightSidebar.stashAll"),`repo:${r}`)}},className:`rounded-full px-3 py-1.5 text-xs font-semibold disabled:opacity-50 ${dt.kind==="restore"?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-primary text-primary-foreground hover:bg-primary/90"}`,children:a(Pe?"rightSidebar.gitActionRunning":"rightSidebar.confirmAction")})]})]})}),document.body)]})}const Eb=Object.freeze(Object.defineProperty({__proto__:null,FilePreview:Bi,MarkdownImageLightbox:Wu,MarkdownPreview:Gu,RightSidebar:xb,__testParseMarkdownListBlock:Ig,buildMarkdownPreviewBlocks:qg,buildMarkdownPreviewRenderResult:Xi,collectKnownGitRepoRoots:pu,computeMarkdownImageDisplayBox:Nu,getMarkdownHeadingOutline:zu,getMarkdownHeadingPathAtLine:Hu,getNextMarkdownPreviewLineRange:Qg,isSvgImageSrc:Za,mountRightSidebarRepoPickerOverlay:eu,replaceGitRepositorySnapshot:Ju,resolveMarkdownLocalLinkTarget:Wi,resolveRightSidebarDiffViewType:fu,shouldCloseMarkdownImageLightboxDrag:Bu,showsGitRepoGroupHeader:Mi},Symbol.toStringTag,{value:"Module"}));export{wi as E,qc as H,ym as M,Eb as R,hm as a,km as b,_m as c,$b as m};
|