termdock 1.4.355 → 1.4.356

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (406) hide show
  1. package/dist/client/assets/{AndroidMirrorView-BC_6L3mG.js → AndroidMirrorView-DW9oRr0w.js} +1 -1
  2. package/dist/client/assets/AndroidMirrorView-DW9oRr0w.js.br +0 -0
  3. package/dist/client/assets/AndroidMirrorView-DW9oRr0w.js.gz +0 -0
  4. package/dist/client/assets/App-DEZ2i9ZZ.js +178 -0
  5. package/dist/client/assets/App-DEZ2i9ZZ.js.br +0 -0
  6. package/dist/client/assets/App-DEZ2i9ZZ.js.gz +0 -0
  7. package/dist/client/assets/{ArchitecturePanel-CYdolNzT.js → ArchitecturePanel-Bf4b-6An.js} +2 -2
  8. package/dist/client/assets/ArchitecturePanel-Bf4b-6An.js.br +0 -0
  9. package/dist/client/assets/ArchitecturePanel-Bf4b-6An.js.gz +0 -0
  10. package/dist/client/assets/{ChangeWalkthroughPanel-mAiaX5i8.js → ChangeWalkthroughPanel-DO_zJfZr.js} +1 -1
  11. package/dist/client/assets/ChangeWalkthroughPanel-DO_zJfZr.js.br +0 -0
  12. package/dist/client/assets/ChangeWalkthroughPanel-DO_zJfZr.js.gz +0 -0
  13. package/dist/client/assets/{ChatRichContent-D2NtgMuL.js → ChatRichContent-Cu1E1cJ8.js} +36 -36
  14. package/dist/client/assets/ChatRichContent-Cu1E1cJ8.js.br +0 -0
  15. package/dist/client/assets/ChatRichContent-Cu1E1cJ8.js.gz +0 -0
  16. package/dist/client/assets/{CollaborationMainWorkspace-CcHsVfXD.js → CollaborationMainWorkspace-BhmpSEbf.js} +1 -1
  17. package/dist/client/assets/CollaborationMainWorkspace-BhmpSEbf.js.br +0 -0
  18. package/dist/client/assets/CollaborationMainWorkspace-BhmpSEbf.js.gz +0 -0
  19. package/dist/client/assets/{CollaborationTaskContent-FcrGGSr_.js → CollaborationTaskContent-CX0Aqdi2.js} +1 -1
  20. package/dist/client/assets/{ComputerControlView-DU9krDsg.js → ComputerControlView-DjQLzn10.js} +3 -3
  21. package/dist/client/assets/ComputerControlView-DjQLzn10.js.br +0 -0
  22. package/dist/client/assets/ComputerControlView-DjQLzn10.js.gz +0 -0
  23. package/dist/client/assets/{DagPlayground-CbEuQA68.js → DagPlayground-CPYwfryM.js} +1 -1
  24. package/dist/client/assets/DagPlayground-CPYwfryM.js.br +0 -0
  25. package/dist/client/assets/DagPlayground-CPYwfryM.js.gz +0 -0
  26. package/dist/client/assets/{DiffLab-PysBkJrJ.js → DiffLab-ptw96Q_4.js} +1 -1
  27. package/dist/client/assets/DiffLab-ptw96Q_4.js.br +0 -0
  28. package/dist/client/assets/DiffLab-ptw96Q_4.js.gz +0 -0
  29. package/dist/client/assets/{DiffReview-Ce3wKMBk.js → DiffReview-12E2zWyL.js} +1 -1
  30. package/dist/client/assets/DiffReview-12E2zWyL.js.br +0 -0
  31. package/dist/client/assets/DiffReview-12E2zWyL.js.gz +0 -0
  32. package/dist/client/assets/{DiffReviewLab-D6PxvtBY.js → DiffReviewLab-eEi3y-0G.js} +1 -1
  33. package/dist/client/assets/DiffReviewLab-eEi3y-0G.js.br +0 -0
  34. package/dist/client/assets/DiffReviewLab-eEi3y-0G.js.gz +0 -0
  35. package/dist/client/assets/{DiffViewer-Bp-BLT2f.js → DiffViewer-DqcQxp4Q.js} +1 -1
  36. package/dist/client/assets/DiffViewer-DqcQxp4Q.js.br +0 -0
  37. package/dist/client/assets/DiffViewer-DqcQxp4Q.js.gz +0 -0
  38. package/dist/client/assets/{GitLoadingSkeleton-Fa4AXG-N.js → GitLoadingSkeleton-DYrDIDF1.js} +1 -1
  39. package/dist/client/assets/GitLoadingSkeleton-DYrDIDF1.js.br +0 -0
  40. package/dist/client/assets/GitLoadingSkeleton-DYrDIDF1.js.gz +0 -0
  41. package/dist/client/assets/{MarkdownPreview-_Z5UzhLt.js → MarkdownPreview-CsJGsDRL.js} +2 -2
  42. package/dist/client/assets/MarkdownPreview-CsJGsDRL.js.br +0 -0
  43. package/dist/client/assets/MarkdownPreview-CsJGsDRL.js.gz +0 -0
  44. package/dist/client/assets/{ModelPreview-Cl0X7I-U.js → ModelPreview-DjtHLlqP.js} +1 -1
  45. package/dist/client/assets/ModelPreview-DjtHLlqP.js.br +0 -0
  46. package/dist/client/assets/ModelPreview-DjtHLlqP.js.gz +0 -0
  47. package/dist/client/assets/{RecordingSaveDialog-Ca2iJsOW.js → RecordingSaveDialog-DUtwgIME.js} +1 -1
  48. package/dist/client/assets/RecordingSaveDialog-DUtwgIME.js.br +0 -0
  49. package/dist/client/assets/RecordingSaveDialog-DUtwgIME.js.gz +0 -0
  50. package/dist/client/assets/{RightSidebar-CwXIBpEw.js → RightSidebar-BltjUFwI.js} +3 -3
  51. package/dist/client/assets/RightSidebar-BltjUFwI.js.br +0 -0
  52. package/dist/client/assets/RightSidebar-BltjUFwI.js.gz +0 -0
  53. package/dist/client/assets/SessionChatView-CdKfHRp8.js +13 -0
  54. package/dist/client/assets/SessionChatView-CdKfHRp8.js.br +0 -0
  55. package/dist/client/assets/SessionChatView-CdKfHRp8.js.gz +0 -0
  56. package/dist/client/assets/{SessionResourceSidebar-BObKJeA9.js → SessionResourceSidebar-DmQOydhf.js} +2 -2
  57. package/dist/client/assets/SessionResourceSidebar-DmQOydhf.js.br +0 -0
  58. package/dist/client/assets/SessionResourceSidebar-DmQOydhf.js.gz +0 -0
  59. package/dist/client/assets/{TodoWorkspace-BdesAuz4.js → TodoWorkspace-Bh1C035B.js} +1 -1
  60. package/dist/client/assets/TodoWorkspace-Bh1C035B.js.br +0 -0
  61. package/dist/client/assets/TodoWorkspace-Bh1C035B.js.gz +0 -0
  62. package/dist/client/assets/{abnfDiagram-VCTEODGH-BajyXVpH.js → abnfDiagram-VCTEODGH-Cvf_KWZ0.js} +1 -1
  63. package/dist/client/assets/abnfDiagram-VCTEODGH-Cvf_KWZ0.js.br +0 -0
  64. package/dist/client/assets/abnfDiagram-VCTEODGH-Cvf_KWZ0.js.gz +0 -0
  65. package/dist/client/assets/app-DuUnqxq-.js +37 -0
  66. package/dist/client/assets/app-DuUnqxq-.js.br +0 -0
  67. package/dist/client/assets/app-DuUnqxq-.js.gz +0 -0
  68. package/dist/client/assets/{arc-CbhM5I2d.js → arc-UvdowQOf.js} +1 -1
  69. package/dist/client/assets/{arc-CbhM5I2d.js.br → arc-UvdowQOf.js.br} +0 -0
  70. package/dist/client/assets/arc-UvdowQOf.js.gz +0 -0
  71. package/dist/client/assets/{architectureDiagram-5GKGNRK7-CDKLcS6D.js → architectureDiagram-5GKGNRK7-DotsbCCA.js} +1 -1
  72. package/dist/client/assets/architectureDiagram-5GKGNRK7-DotsbCCA.js.br +0 -0
  73. package/dist/client/assets/architectureDiagram-5GKGNRK7-DotsbCCA.js.gz +0 -0
  74. package/dist/client/assets/{arrow-down-Dp27yS0N.js → arrow-down-FGzRy9D-.js} +1 -1
  75. package/dist/client/assets/{arrow-up-BEUQcf-s.js → arrow-up-DNkfesW0.js} +1 -1
  76. package/dist/client/assets/{blockDiagram-I7D4REHJ-CXiIO6_W.js → blockDiagram-I7D4REHJ-CoOfSG4k.js} +1 -1
  77. package/dist/client/assets/blockDiagram-I7D4REHJ-CoOfSG4k.js.br +0 -0
  78. package/dist/client/assets/blockDiagram-I7D4REHJ-CoOfSG4k.js.gz +0 -0
  79. package/dist/client/assets/{c4Diagram-7LVT6UL2-uZ-i2eKH.js → c4Diagram-7LVT6UL2-BAfjgs8B.js} +1 -1
  80. package/dist/client/assets/c4Diagram-7LVT6UL2-BAfjgs8B.js.br +0 -0
  81. package/dist/client/assets/c4Diagram-7LVT6UL2-BAfjgs8B.js.gz +0 -0
  82. package/dist/client/assets/channel-BzMU9Wks.js +1 -0
  83. package/dist/client/assets/{chevron-left-D8ntyw2S.js → chevron-left-xqARwD-7.js} +1 -1
  84. package/dist/client/assets/{chunk-2Q5K7J3B-DVe3dVJR.js → chunk-2Q5K7J3B-DiiQ7BvG.js} +1 -1
  85. package/dist/client/assets/{chunk-5VM5RSS4-BDBNKGuU.js → chunk-5VM5RSS4-CczSK8wW.js} +1 -1
  86. package/dist/client/assets/{chunk-F27PBJKO-BP7hTwtm.js → chunk-F27PBJKO-BI3Di4Ve.js} +1 -1
  87. package/dist/client/assets/chunk-F27PBJKO-BI3Di4Ve.js.br +0 -0
  88. package/dist/client/assets/chunk-F27PBJKO-BI3Di4Ve.js.gz +0 -0
  89. package/dist/client/assets/{chunk-IMKFNOWR-LIGuOtnb.js → chunk-IMKFNOWR-Cvvs1wmn.js} +1 -1
  90. package/dist/client/assets/chunk-IMKFNOWR-Cvvs1wmn.js.br +0 -0
  91. package/dist/client/assets/chunk-IMKFNOWR-Cvvs1wmn.js.gz +0 -0
  92. package/dist/client/assets/{chunk-JWPE2WC7-C1_iFEvk.js → chunk-JWPE2WC7-lrJRD9WA.js} +1 -1
  93. package/dist/client/assets/{chunk-POPQ4Y6H-CYZsO-QL.js → chunk-POPQ4Y6H-CnPC9D8B.js} +1 -1
  94. package/dist/client/assets/{chunk-SVP7TREG-FnWYLNCS.js → chunk-SVP7TREG-BZfMhm64.js} +1 -1
  95. package/dist/client/assets/chunk-SVP7TREG-BZfMhm64.js.br +0 -0
  96. package/dist/client/assets/chunk-SVP7TREG-BZfMhm64.js.gz +0 -0
  97. package/dist/client/assets/{chunk-TICWLB2K-dcOCcmQq.js → chunk-TICWLB2K-DmkEaRK3.js} +1 -1
  98. package/dist/client/assets/chunk-TICWLB2K-DmkEaRK3.js.br +0 -0
  99. package/dist/client/assets/chunk-TICWLB2K-DmkEaRK3.js.gz +0 -0
  100. package/dist/client/assets/{chunk-XXDRQBXY-B2H2Yt9G.js → chunk-XXDRQBXY-BP9Lccpe.js} +1 -1
  101. package/dist/client/assets/{circle-Pldg1yI9.js → circle-DGZOpG8V.js} +1 -1
  102. package/dist/client/assets/classDiagram-ZZMXUADV-DtAtEoWU.js +1 -0
  103. package/dist/client/assets/classDiagram-v2-VYDZK3BY-DtAtEoWU.js +1 -0
  104. package/dist/client/assets/{clipboard-tTkMEO1S.js → clipboard-rLx5CzbY.js} +1 -1
  105. package/dist/client/assets/{clipboardText-BapOM7QN.js → clipboardText-cZXParp1.js} +1 -1
  106. package/dist/client/assets/clipboardText-cZXParp1.js.br +0 -0
  107. package/dist/client/assets/clipboardText-cZXParp1.js.gz +0 -0
  108. package/dist/client/assets/{cose-bilkent-JH36ORCC-Bz38mqD8.js → cose-bilkent-JH36ORCC-0xPYMc2z.js} +1 -1
  109. package/dist/client/assets/cose-bilkent-JH36ORCC-0xPYMc2z.js.br +0 -0
  110. package/dist/client/assets/cose-bilkent-JH36ORCC-0xPYMc2z.js.gz +0 -0
  111. package/dist/client/assets/{cynefin-OW5HDTMX-CZAa1A6y.js → cynefin-OW5HDTMX-BQ7-lCHm.js} +1 -1
  112. package/dist/client/assets/cynefin-OW5HDTMX-BQ7-lCHm.js.br +0 -0
  113. package/dist/client/assets/cynefin-OW5HDTMX-BQ7-lCHm.js.gz +0 -0
  114. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-BaQnW4VG.js → cynefinDiagram-5FMLGOSQ-CazHuSj1.js} +1 -1
  115. package/dist/client/assets/cynefinDiagram-5FMLGOSQ-CazHuSj1.js.br +0 -0
  116. package/dist/client/assets/cynefinDiagram-5FMLGOSQ-CazHuSj1.js.gz +0 -0
  117. package/dist/client/assets/{dagre-GXQ25YYZ-BdnT61bc.js → dagre-GXQ25YYZ-CJNgsyHQ.js} +1 -1
  118. package/dist/client/assets/dagre-GXQ25YYZ-CJNgsyHQ.js.br +0 -0
  119. package/dist/client/assets/dagre-GXQ25YYZ-CJNgsyHQ.js.gz +0 -0
  120. package/dist/client/assets/{diagram-S7CK7UJ4-BWiF8QNc.js → diagram-S7CK7UJ4-D4xXIj1P.js} +1 -1
  121. package/dist/client/assets/diagram-S7CK7UJ4-D4xXIj1P.js.br +0 -0
  122. package/dist/client/assets/diagram-S7CK7UJ4-D4xXIj1P.js.gz +0 -0
  123. package/dist/client/assets/{diagram-UQ7AKVKN-DLURjCFp.js → diagram-UQ7AKVKN-BWhpL-35.js} +1 -1
  124. package/dist/client/assets/diagram-UQ7AKVKN-BWhpL-35.js.br +0 -0
  125. package/dist/client/assets/diagram-UQ7AKVKN-BWhpL-35.js.gz +0 -0
  126. package/dist/client/assets/{diagram-VSXAHHWV-DYIcLklz.js → diagram-VSXAHHWV-DG9A7EgJ.js} +1 -1
  127. package/dist/client/assets/diagram-VSXAHHWV-DG9A7EgJ.js.br +0 -0
  128. package/dist/client/assets/diagram-VSXAHHWV-DG9A7EgJ.js.gz +0 -0
  129. package/dist/client/assets/{diagram-VX7I27RA-C9vqviXX.js → diagram-VX7I27RA-L5PSvynM.js} +1 -1
  130. package/dist/client/assets/diagram-VX7I27RA-L5PSvynM.js.br +0 -0
  131. package/dist/client/assets/diagram-VX7I27RA-L5PSvynM.js.gz +0 -0
  132. package/dist/client/assets/{diagram-Z3DM3KII-BJuQxTkw.js → diagram-Z3DM3KII-moBH7ruR.js} +1 -1
  133. package/dist/client/assets/diagram-Z3DM3KII-moBH7ruR.js.br +0 -0
  134. package/dist/client/assets/diagram-Z3DM3KII-moBH7ruR.js.gz +0 -0
  135. package/dist/client/assets/{ebnfDiagram-PWID7BFC-BcbISm-z.js → ebnfDiagram-PWID7BFC-DEiGgcRP.js} +1 -1
  136. package/dist/client/assets/ebnfDiagram-PWID7BFC-DEiGgcRP.js.br +0 -0
  137. package/dist/client/assets/ebnfDiagram-PWID7BFC-DEiGgcRP.js.gz +0 -0
  138. package/dist/client/assets/{erDiagram-RLTQ6QDP-fhNpRzUG.js → erDiagram-RLTQ6QDP-BboIleYi.js} +1 -1
  139. package/dist/client/assets/erDiagram-RLTQ6QDP-BboIleYi.js.br +0 -0
  140. package/dist/client/assets/erDiagram-RLTQ6QDP-BboIleYi.js.gz +0 -0
  141. package/dist/client/assets/{external-link-DE8Gj-da.js → external-link-AZ3wjUg5.js} +1 -1
  142. package/dist/client/assets/{flowDiagram-HODETNUW-CVDJ_1Zu.js → flowDiagram-HODETNUW-COxz7Rda.js} +1 -1
  143. package/dist/client/assets/flowDiagram-HODETNUW-COxz7Rda.js.br +0 -0
  144. package/dist/client/assets/flowDiagram-HODETNUW-COxz7Rda.js.gz +0 -0
  145. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-Dzn-mrfe.js → ganttDiagram-EL5Y4UJY-_XdRvgyZ.js} +1 -1
  146. package/dist/client/assets/ganttDiagram-EL5Y4UJY-_XdRvgyZ.js.br +0 -0
  147. package/dist/client/assets/ganttDiagram-EL5Y4UJY-_XdRvgyZ.js.gz +0 -0
  148. package/dist/client/assets/{git-compare-Ct2eJNs4.js → git-compare-90v75Jal.js} +1 -1
  149. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-Ci-wfvCz.js → gitGraphDiagram-WWUBYQGX-CBb9xBNW.js} +1 -1
  150. package/dist/client/assets/gitGraphDiagram-WWUBYQGX-CBb9xBNW.js.br +0 -0
  151. package/dist/client/assets/gitGraphDiagram-WWUBYQGX-CBb9xBNW.js.gz +0 -0
  152. package/dist/client/assets/{index-DOq3vkFG.css → index-nIgxJ6I3.css} +1 -1
  153. package/dist/client/assets/index-nIgxJ6I3.css.br +0 -0
  154. package/dist/client/assets/{index-DOq3vkFG.css.gz → index-nIgxJ6I3.css.gz} +0 -0
  155. package/dist/client/assets/{infoDiagram-27XIBGKW-npBmeTt7.js → infoDiagram-27XIBGKW-DjLdeNZi.js} +1 -1
  156. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-CCn5Ha25.js → ishikawaDiagram-5VMMS53U-Bcr-lhIE.js} +1 -1
  157. package/dist/client/assets/ishikawaDiagram-5VMMS53U-Bcr-lhIE.js.br +0 -0
  158. package/dist/client/assets/ishikawaDiagram-5VMMS53U-Bcr-lhIE.js.gz +0 -0
  159. package/dist/client/assets/{journeyDiagram-3NMN7TZE-CPl5oPfe.js → journeyDiagram-3NMN7TZE-3vK6s9Pq.js} +1 -1
  160. package/dist/client/assets/journeyDiagram-3NMN7TZE-3vK6s9Pq.js.br +0 -0
  161. package/dist/client/assets/journeyDiagram-3NMN7TZE-3vK6s9Pq.js.gz +0 -0
  162. package/dist/client/assets/{kanban-definition-UXKFOSKX-Dmia2kLZ.js → kanban-definition-UXKFOSKX-DqDYDca0.js} +1 -1
  163. package/dist/client/assets/kanban-definition-UXKFOSKX-DqDYDca0.js.br +0 -0
  164. package/dist/client/assets/kanban-definition-UXKFOSKX-DqDYDca0.js.gz +0 -0
  165. package/dist/client/assets/{layout-B2Kz5M73.js → layout-C7_WwzCP.js} +1 -1
  166. package/dist/client/assets/layout-C7_WwzCP.js.br +0 -0
  167. package/dist/client/assets/layout-C7_WwzCP.js.gz +0 -0
  168. package/dist/client/assets/{linear-D2CT7wE3.js → linear-BQCRhl6P.js} +1 -1
  169. package/dist/client/assets/linear-BQCRhl6P.js.br +0 -0
  170. package/dist/client/assets/linear-BQCRhl6P.js.gz +0 -0
  171. package/dist/client/assets/{link-x33s12VI.js → link-Cq14tNBm.js} +1 -1
  172. package/dist/client/assets/link-Cq14tNBm.js.br +0 -0
  173. package/dist/client/assets/link-Cq14tNBm.js.gz +0 -0
  174. package/dist/client/assets/{list-tree-XBmm9il2.js → list-tree-C281zrdg.js} +1 -1
  175. package/dist/client/assets/{loader-circle-D_nJKmMD.js → loader-circle-Df0zpx5N.js} +1 -1
  176. package/dist/client/assets/{maximize-2-t-zzENew.js → maximize-2-CovPxWdw.js} +1 -1
  177. package/dist/client/assets/{mermaid.core-G9XIcppl.js → mermaid.core-DGsccxt-.js} +5 -5
  178. package/dist/client/assets/mermaid.core-DGsccxt-.js.br +0 -0
  179. package/dist/client/assets/mermaid.core-DGsccxt-.js.gz +0 -0
  180. package/dist/client/assets/{mindmap-definition-YA3MSWOX-D2OX9OkO.js → mindmap-definition-YA3MSWOX-l0eF1PQE.js} +1 -1
  181. package/dist/client/assets/mindmap-definition-YA3MSWOX-l0eF1PQE.js.br +0 -0
  182. package/dist/client/assets/mindmap-definition-YA3MSWOX-l0eF1PQE.js.gz +0 -0
  183. package/dist/client/assets/{passwordBootstrap-DkTynZfV.js → passwordBootstrap-B5VzheZz.js} +1 -1
  184. package/dist/client/assets/passwordBootstrap-B5VzheZz.js.br +0 -0
  185. package/dist/client/assets/passwordBootstrap-B5VzheZz.js.gz +0 -0
  186. package/dist/client/assets/{pegDiagram-XKGWAZYB-qNjd6dbd.js → pegDiagram-XKGWAZYB-fRrxGIDM.js} +1 -1
  187. package/dist/client/assets/pegDiagram-XKGWAZYB-fRrxGIDM.js.br +0 -0
  188. package/dist/client/assets/pegDiagram-XKGWAZYB-fRrxGIDM.js.gz +0 -0
  189. package/dist/client/assets/{pieDiagram-E7YTZNPT-DcCmKDFh.js → pieDiagram-E7YTZNPT-B-EBa3qN.js} +1 -1
  190. package/dist/client/assets/pieDiagram-E7YTZNPT-B-EBa3qN.js.br +0 -0
  191. package/dist/client/assets/pieDiagram-E7YTZNPT-B-EBa3qN.js.gz +0 -0
  192. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-BpDzkl9h.js → quadrantDiagram-AXDQQJYC-Dj4e6f4h.js} +1 -1
  193. package/dist/client/assets/quadrantDiagram-AXDQQJYC-Dj4e6f4h.js.br +0 -0
  194. package/dist/client/assets/quadrantDiagram-AXDQQJYC-Dj4e6f4h.js.gz +0 -0
  195. package/dist/client/assets/{quote-DeByS04O.js → quote-COQfrXhi.js} +1 -1
  196. package/dist/client/assets/{railroadDiagram-O6MQD6OU-DkwV8w7x.js → railroadDiagram-O6MQD6OU-CEMppxTC.js} +1 -1
  197. package/dist/client/assets/railroadDiagram-O6MQD6OU-CEMppxTC.js.br +0 -0
  198. package/dist/client/assets/railroadDiagram-O6MQD6OU-CEMppxTC.js.gz +0 -0
  199. package/dist/client/assets/{rdpSession-D5NrFTav.js → rdpSession-C5rS-ImV.js} +1 -1
  200. package/dist/client/assets/rdpSession-C5rS-ImV.js.br +0 -0
  201. package/dist/client/assets/rdpSession-C5rS-ImV.js.gz +0 -0
  202. package/dist/client/assets/{requirementDiagram-BXWQKSXE-BRwt5MXl.js → requirementDiagram-BXWQKSXE-Dri1k4_x.js} +1 -1
  203. package/dist/client/assets/requirementDiagram-BXWQKSXE-Dri1k4_x.js.br +0 -0
  204. package/dist/client/assets/requirementDiagram-BXWQKSXE-Dri1k4_x.js.gz +0 -0
  205. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-DZ8y_gv3.js → sankeyDiagram-P5KCCOFB-CMsL_tYL.js} +1 -1
  206. package/dist/client/assets/sankeyDiagram-P5KCCOFB-CMsL_tYL.js.br +0 -0
  207. package/dist/client/assets/sankeyDiagram-P5KCCOFB-CMsL_tYL.js.gz +0 -0
  208. package/dist/client/assets/{search-CDJ4fv-q.js → search-Dg6HWygj.js} +1 -1
  209. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-CJ9lZEsN.js → sequenceDiagram-WJ2MYXX4-4_4hZtOd.js} +1 -1
  210. package/dist/client/assets/sequenceDiagram-WJ2MYXX4-4_4hZtOd.js.br +0 -0
  211. package/dist/client/assets/sequenceDiagram-WJ2MYXX4-4_4hZtOd.js.gz +0 -0
  212. package/dist/client/assets/{settings-2-DtFz7lgk.js → settings-2-iGqzPez0.js} +1 -1
  213. package/dist/client/assets/{sizeCapture-INFHLROL-Dt9ZzegQ.js → sizeCapture-INFHLROL-3QA6qj2j.js} +1 -1
  214. package/dist/client/assets/sizeCapture-INFHLROL-3QA6qj2j.js.br +0 -0
  215. package/dist/client/assets/sizeCapture-INFHLROL-3QA6qj2j.js.gz +0 -0
  216. package/dist/client/assets/{stateDiagram-D77RDMKH-DgeQtV3s.js → stateDiagram-D77RDMKH-90IFPhD9.js} +1 -1
  217. package/dist/client/assets/stateDiagram-D77RDMKH-90IFPhD9.js.br +0 -0
  218. package/dist/client/assets/stateDiagram-D77RDMKH-90IFPhD9.js.gz +0 -0
  219. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-CH-yvmL4.js +1 -0
  220. package/dist/client/assets/{sun-CvzpsfHU.js → sun-BAMMjiA8.js} +1 -1
  221. package/dist/client/assets/{swimlanes-42K2YHIH-DHB6MQ8v.js → swimlanes-42K2YHIH-BuHieVWC.js} +1 -1
  222. package/dist/client/assets/swimlanes-42K2YHIH-BuHieVWC.js.br +0 -0
  223. package/dist/client/assets/swimlanes-42K2YHIH-BuHieVWC.js.gz +0 -0
  224. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-P_rDqbtg.js +8 -0
  225. package/dist/client/assets/{syntaxHighlight-DF6Q5phI.js → syntaxHighlight-Cz6TPDW9.js} +1 -1
  226. package/dist/client/assets/syntaxHighlight-Cz6TPDW9.js.br +0 -0
  227. package/dist/client/assets/syntaxHighlight-Cz6TPDW9.js.gz +0 -0
  228. package/dist/client/assets/{timeline-definition-24CTP7MA-EqVVyv-E.js → timeline-definition-24CTP7MA-C7FpaNwf.js} +1 -1
  229. package/dist/client/assets/timeline-definition-24CTP7MA-C7FpaNwf.js.br +0 -0
  230. package/dist/client/assets/timeline-definition-24CTP7MA-C7FpaNwf.js.gz +0 -0
  231. package/dist/client/assets/{triangle-alert--5QOrsVl.js → triangle-alert-Oj-OsZDw.js} +1 -1
  232. package/dist/client/assets/{unplug-BNUx6Lmk.js → unplug-DN2SNXUL.js} +1 -1
  233. package/dist/client/assets/{vennDiagram-4TSXK5OY-BBE17-sL.js → vennDiagram-4TSXK5OY-CxoHHVcs.js} +1 -1
  234. package/dist/client/assets/vennDiagram-4TSXK5OY-CxoHHVcs.js.br +0 -0
  235. package/dist/client/assets/vennDiagram-4TSXK5OY-CxoHHVcs.js.gz +0 -0
  236. package/dist/client/assets/{videoCompression-B09OiyP5.js → videoCompression-rr2lu3uy.js} +1 -1
  237. package/dist/client/assets/videoCompression-rr2lu3uy.js.br +0 -0
  238. package/dist/client/assets/videoCompression-rr2lu3uy.js.gz +0 -0
  239. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-B4gZGXiA.js → wardleyDiagram-VM6X3IG4-B4Hsh-Ad.js} +1 -1
  240. package/dist/client/assets/wardleyDiagram-VM6X3IG4-B4Hsh-Ad.js.br +0 -0
  241. package/dist/client/assets/wardleyDiagram-VM6X3IG4-B4Hsh-Ad.js.gz +0 -0
  242. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-BDO5xF5D.js → xychartDiagram-S5SC5T6Z-CghzsxQv.js} +1 -1
  243. package/dist/client/assets/xychartDiagram-S5SC5T6Z-CghzsxQv.js.br +0 -0
  244. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-BDO5xF5D.js.gz → xychartDiagram-S5SC5T6Z-CghzsxQv.js.gz} +0 -0
  245. package/dist/client/index.html +2 -2
  246. package/dist/client/index.html.br +0 -0
  247. package/dist/client/index.html.gz +0 -0
  248. package/dist/client/sw.js +1 -1
  249. package/dist/client/sw.js.br +0 -0
  250. package/dist/client/sw.js.gz +0 -0
  251. package/dist/server/agent/chatUIPrompt.js +1 -0
  252. package/dist/server/federation/invitations.js +5 -1
  253. package/dist/server/federation/routeInvitations.js +5 -1
  254. package/package.json +1 -1
  255. package/runtime-manifest.json +3 -3
  256. package/scripts/ensure-node-pty.cjs +22 -7
  257. package/scripts/postinstall.mjs +5 -4
  258. package/dist/client/assets/AndroidMirrorView-BC_6L3mG.js.br +0 -0
  259. package/dist/client/assets/AndroidMirrorView-BC_6L3mG.js.gz +0 -0
  260. package/dist/client/assets/App-BGECv_n_.js +0 -178
  261. package/dist/client/assets/App-BGECv_n_.js.br +0 -0
  262. package/dist/client/assets/App-BGECv_n_.js.gz +0 -0
  263. package/dist/client/assets/ArchitecturePanel-CYdolNzT.js.br +0 -0
  264. package/dist/client/assets/ArchitecturePanel-CYdolNzT.js.gz +0 -0
  265. package/dist/client/assets/ChangeWalkthroughPanel-mAiaX5i8.js.br +0 -0
  266. package/dist/client/assets/ChangeWalkthroughPanel-mAiaX5i8.js.gz +0 -0
  267. package/dist/client/assets/ChatRichContent-D2NtgMuL.js.br +0 -0
  268. package/dist/client/assets/ChatRichContent-D2NtgMuL.js.gz +0 -0
  269. package/dist/client/assets/CollaborationMainWorkspace-CcHsVfXD.js.br +0 -0
  270. package/dist/client/assets/CollaborationMainWorkspace-CcHsVfXD.js.gz +0 -0
  271. package/dist/client/assets/ComputerControlView-DU9krDsg.js.br +0 -0
  272. package/dist/client/assets/ComputerControlView-DU9krDsg.js.gz +0 -0
  273. package/dist/client/assets/DagPlayground-CbEuQA68.js.br +0 -0
  274. package/dist/client/assets/DagPlayground-CbEuQA68.js.gz +0 -0
  275. package/dist/client/assets/DiffLab-PysBkJrJ.js.br +0 -0
  276. package/dist/client/assets/DiffLab-PysBkJrJ.js.gz +0 -0
  277. package/dist/client/assets/DiffReview-Ce3wKMBk.js.br +0 -0
  278. package/dist/client/assets/DiffReview-Ce3wKMBk.js.gz +0 -0
  279. package/dist/client/assets/DiffReviewLab-D6PxvtBY.js.br +0 -0
  280. package/dist/client/assets/DiffReviewLab-D6PxvtBY.js.gz +0 -0
  281. package/dist/client/assets/DiffViewer-Bp-BLT2f.js.br +0 -0
  282. package/dist/client/assets/DiffViewer-Bp-BLT2f.js.gz +0 -0
  283. package/dist/client/assets/GitLoadingSkeleton-Fa4AXG-N.js.br +0 -0
  284. package/dist/client/assets/GitLoadingSkeleton-Fa4AXG-N.js.gz +0 -0
  285. package/dist/client/assets/MarkdownPreview-_Z5UzhLt.js.br +0 -0
  286. package/dist/client/assets/MarkdownPreview-_Z5UzhLt.js.gz +0 -0
  287. package/dist/client/assets/ModelPreview-Cl0X7I-U.js.br +0 -0
  288. package/dist/client/assets/ModelPreview-Cl0X7I-U.js.gz +0 -0
  289. package/dist/client/assets/RecordingSaveDialog-Ca2iJsOW.js.br +0 -0
  290. package/dist/client/assets/RecordingSaveDialog-Ca2iJsOW.js.gz +0 -0
  291. package/dist/client/assets/RightSidebar-CwXIBpEw.js.br +0 -0
  292. package/dist/client/assets/RightSidebar-CwXIBpEw.js.gz +0 -0
  293. package/dist/client/assets/SessionChatView-D3sLcYAc.js +0 -13
  294. package/dist/client/assets/SessionChatView-D3sLcYAc.js.br +0 -0
  295. package/dist/client/assets/SessionChatView-D3sLcYAc.js.gz +0 -0
  296. package/dist/client/assets/SessionResourceSidebar-BObKJeA9.js.br +0 -0
  297. package/dist/client/assets/SessionResourceSidebar-BObKJeA9.js.gz +0 -0
  298. package/dist/client/assets/TodoWorkspace-BdesAuz4.js.br +0 -0
  299. package/dist/client/assets/TodoWorkspace-BdesAuz4.js.gz +0 -0
  300. package/dist/client/assets/abnfDiagram-VCTEODGH-BajyXVpH.js.br +0 -0
  301. package/dist/client/assets/abnfDiagram-VCTEODGH-BajyXVpH.js.gz +0 -0
  302. package/dist/client/assets/app-C3WX_u_Z.js +0 -37
  303. package/dist/client/assets/app-C3WX_u_Z.js.br +0 -0
  304. package/dist/client/assets/app-C3WX_u_Z.js.gz +0 -0
  305. package/dist/client/assets/arc-CbhM5I2d.js.gz +0 -0
  306. package/dist/client/assets/architectureDiagram-5GKGNRK7-CDKLcS6D.js.br +0 -0
  307. package/dist/client/assets/architectureDiagram-5GKGNRK7-CDKLcS6D.js.gz +0 -0
  308. package/dist/client/assets/blockDiagram-I7D4REHJ-CXiIO6_W.js.br +0 -0
  309. package/dist/client/assets/blockDiagram-I7D4REHJ-CXiIO6_W.js.gz +0 -0
  310. package/dist/client/assets/c4Diagram-7LVT6UL2-uZ-i2eKH.js.br +0 -0
  311. package/dist/client/assets/c4Diagram-7LVT6UL2-uZ-i2eKH.js.gz +0 -0
  312. package/dist/client/assets/channel-Dg7JKsqi.js +0 -1
  313. package/dist/client/assets/chunk-F27PBJKO-BP7hTwtm.js.br +0 -0
  314. package/dist/client/assets/chunk-F27PBJKO-BP7hTwtm.js.gz +0 -0
  315. package/dist/client/assets/chunk-IMKFNOWR-LIGuOtnb.js.br +0 -0
  316. package/dist/client/assets/chunk-IMKFNOWR-LIGuOtnb.js.gz +0 -0
  317. package/dist/client/assets/chunk-SVP7TREG-FnWYLNCS.js.br +0 -0
  318. package/dist/client/assets/chunk-SVP7TREG-FnWYLNCS.js.gz +0 -0
  319. package/dist/client/assets/chunk-TICWLB2K-dcOCcmQq.js.br +0 -0
  320. package/dist/client/assets/chunk-TICWLB2K-dcOCcmQq.js.gz +0 -0
  321. package/dist/client/assets/classDiagram-ZZMXUADV-D6QBd_IP.js +0 -1
  322. package/dist/client/assets/classDiagram-v2-VYDZK3BY-D6QBd_IP.js +0 -1
  323. package/dist/client/assets/clipboardText-BapOM7QN.js.br +0 -0
  324. package/dist/client/assets/clipboardText-BapOM7QN.js.gz +0 -0
  325. package/dist/client/assets/cose-bilkent-JH36ORCC-Bz38mqD8.js.br +0 -0
  326. package/dist/client/assets/cose-bilkent-JH36ORCC-Bz38mqD8.js.gz +0 -0
  327. package/dist/client/assets/cynefin-OW5HDTMX-CZAa1A6y.js.br +0 -0
  328. package/dist/client/assets/cynefin-OW5HDTMX-CZAa1A6y.js.gz +0 -0
  329. package/dist/client/assets/cynefinDiagram-5FMLGOSQ-BaQnW4VG.js.br +0 -0
  330. package/dist/client/assets/cynefinDiagram-5FMLGOSQ-BaQnW4VG.js.gz +0 -0
  331. package/dist/client/assets/dagre-GXQ25YYZ-BdnT61bc.js.br +0 -0
  332. package/dist/client/assets/dagre-GXQ25YYZ-BdnT61bc.js.gz +0 -0
  333. package/dist/client/assets/diagram-S7CK7UJ4-BWiF8QNc.js.br +0 -0
  334. package/dist/client/assets/diagram-S7CK7UJ4-BWiF8QNc.js.gz +0 -0
  335. package/dist/client/assets/diagram-UQ7AKVKN-DLURjCFp.js.br +0 -0
  336. package/dist/client/assets/diagram-UQ7AKVKN-DLURjCFp.js.gz +0 -0
  337. package/dist/client/assets/diagram-VSXAHHWV-DYIcLklz.js.br +0 -0
  338. package/dist/client/assets/diagram-VSXAHHWV-DYIcLklz.js.gz +0 -0
  339. package/dist/client/assets/diagram-VX7I27RA-C9vqviXX.js.br +0 -0
  340. package/dist/client/assets/diagram-VX7I27RA-C9vqviXX.js.gz +0 -0
  341. package/dist/client/assets/diagram-Z3DM3KII-BJuQxTkw.js.br +0 -0
  342. package/dist/client/assets/diagram-Z3DM3KII-BJuQxTkw.js.gz +0 -0
  343. package/dist/client/assets/ebnfDiagram-PWID7BFC-BcbISm-z.js.br +0 -0
  344. package/dist/client/assets/ebnfDiagram-PWID7BFC-BcbISm-z.js.gz +0 -0
  345. package/dist/client/assets/erDiagram-RLTQ6QDP-fhNpRzUG.js.br +0 -0
  346. package/dist/client/assets/erDiagram-RLTQ6QDP-fhNpRzUG.js.gz +0 -0
  347. package/dist/client/assets/flowDiagram-HODETNUW-CVDJ_1Zu.js.br +0 -0
  348. package/dist/client/assets/flowDiagram-HODETNUW-CVDJ_1Zu.js.gz +0 -0
  349. package/dist/client/assets/ganttDiagram-EL5Y4UJY-Dzn-mrfe.js.br +0 -0
  350. package/dist/client/assets/ganttDiagram-EL5Y4UJY-Dzn-mrfe.js.gz +0 -0
  351. package/dist/client/assets/gitGraphDiagram-WWUBYQGX-Ci-wfvCz.js.br +0 -0
  352. package/dist/client/assets/gitGraphDiagram-WWUBYQGX-Ci-wfvCz.js.gz +0 -0
  353. package/dist/client/assets/index-DOq3vkFG.css.br +0 -0
  354. package/dist/client/assets/ishikawaDiagram-5VMMS53U-CCn5Ha25.js.br +0 -0
  355. package/dist/client/assets/ishikawaDiagram-5VMMS53U-CCn5Ha25.js.gz +0 -0
  356. package/dist/client/assets/journeyDiagram-3NMN7TZE-CPl5oPfe.js.br +0 -0
  357. package/dist/client/assets/journeyDiagram-3NMN7TZE-CPl5oPfe.js.gz +0 -0
  358. package/dist/client/assets/kanban-definition-UXKFOSKX-Dmia2kLZ.js.br +0 -0
  359. package/dist/client/assets/kanban-definition-UXKFOSKX-Dmia2kLZ.js.gz +0 -0
  360. package/dist/client/assets/layout-B2Kz5M73.js.br +0 -0
  361. package/dist/client/assets/layout-B2Kz5M73.js.gz +0 -0
  362. package/dist/client/assets/linear-D2CT7wE3.js.br +0 -0
  363. package/dist/client/assets/linear-D2CT7wE3.js.gz +0 -0
  364. package/dist/client/assets/link-x33s12VI.js.br +0 -0
  365. package/dist/client/assets/link-x33s12VI.js.gz +0 -0
  366. package/dist/client/assets/mermaid.core-G9XIcppl.js.br +0 -0
  367. package/dist/client/assets/mermaid.core-G9XIcppl.js.gz +0 -0
  368. package/dist/client/assets/mindmap-definition-YA3MSWOX-D2OX9OkO.js.br +0 -0
  369. package/dist/client/assets/mindmap-definition-YA3MSWOX-D2OX9OkO.js.gz +0 -0
  370. package/dist/client/assets/passwordBootstrap-DkTynZfV.js.br +0 -0
  371. package/dist/client/assets/passwordBootstrap-DkTynZfV.js.gz +0 -0
  372. package/dist/client/assets/pegDiagram-XKGWAZYB-qNjd6dbd.js.br +0 -0
  373. package/dist/client/assets/pegDiagram-XKGWAZYB-qNjd6dbd.js.gz +0 -0
  374. package/dist/client/assets/pieDiagram-E7YTZNPT-DcCmKDFh.js.br +0 -0
  375. package/dist/client/assets/pieDiagram-E7YTZNPT-DcCmKDFh.js.gz +0 -0
  376. package/dist/client/assets/quadrantDiagram-AXDQQJYC-BpDzkl9h.js.br +0 -0
  377. package/dist/client/assets/quadrantDiagram-AXDQQJYC-BpDzkl9h.js.gz +0 -0
  378. package/dist/client/assets/railroadDiagram-O6MQD6OU-DkwV8w7x.js.br +0 -0
  379. package/dist/client/assets/railroadDiagram-O6MQD6OU-DkwV8w7x.js.gz +0 -0
  380. package/dist/client/assets/rdpSession-D5NrFTav.js.br +0 -0
  381. package/dist/client/assets/rdpSession-D5NrFTav.js.gz +0 -0
  382. package/dist/client/assets/requirementDiagram-BXWQKSXE-BRwt5MXl.js.br +0 -0
  383. package/dist/client/assets/requirementDiagram-BXWQKSXE-BRwt5MXl.js.gz +0 -0
  384. package/dist/client/assets/sankeyDiagram-P5KCCOFB-DZ8y_gv3.js.br +0 -0
  385. package/dist/client/assets/sankeyDiagram-P5KCCOFB-DZ8y_gv3.js.gz +0 -0
  386. package/dist/client/assets/sequenceDiagram-WJ2MYXX4-CJ9lZEsN.js.br +0 -0
  387. package/dist/client/assets/sequenceDiagram-WJ2MYXX4-CJ9lZEsN.js.gz +0 -0
  388. package/dist/client/assets/sizeCapture-INFHLROL-Dt9ZzegQ.js.br +0 -0
  389. package/dist/client/assets/sizeCapture-INFHLROL-Dt9ZzegQ.js.gz +0 -0
  390. package/dist/client/assets/stateDiagram-D77RDMKH-DgeQtV3s.js.br +0 -0
  391. package/dist/client/assets/stateDiagram-D77RDMKH-DgeQtV3s.js.gz +0 -0
  392. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-CKS6y2rR.js +0 -1
  393. package/dist/client/assets/swimlanes-42K2YHIH-DHB6MQ8v.js.br +0 -0
  394. package/dist/client/assets/swimlanes-42K2YHIH-DHB6MQ8v.js.gz +0 -0
  395. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DvUzDKPI.js +0 -8
  396. package/dist/client/assets/syntaxHighlight-DF6Q5phI.js.br +0 -0
  397. package/dist/client/assets/syntaxHighlight-DF6Q5phI.js.gz +0 -0
  398. package/dist/client/assets/timeline-definition-24CTP7MA-EqVVyv-E.js.br +0 -0
  399. package/dist/client/assets/timeline-definition-24CTP7MA-EqVVyv-E.js.gz +0 -0
  400. package/dist/client/assets/vennDiagram-4TSXK5OY-BBE17-sL.js.br +0 -0
  401. package/dist/client/assets/vennDiagram-4TSXK5OY-BBE17-sL.js.gz +0 -0
  402. package/dist/client/assets/videoCompression-B09OiyP5.js.br +0 -0
  403. package/dist/client/assets/videoCompression-B09OiyP5.js.gz +0 -0
  404. package/dist/client/assets/wardleyDiagram-VM6X3IG4-B4gZGXiA.js.br +0 -0
  405. package/dist/client/assets/wardleyDiagram-VM6X3IG4-B4gZGXiA.js.gz +0 -0
  406. package/dist/client/assets/xychartDiagram-S5SC5T6Z-BDO5xF5D.js.br +0 -0
@@ -1 +1 @@
1
- import{aV as Se,ea as oe,cg as s,eb as we,a4 as Ie,q as Pe,C as Fe,ei as Oe,u as Xe,dj as ze,b0 as Be,at as He}from"./app-C3WX_u_Z.js";import{R as Ge,b as r,r as Me}from"./dnd-BCFAPC0L.js";import{u as be}from"./use-gesture-react.esm-DYpdiE_k.js";import{S as $e,c as Ke,h as Ue,r as qe,y as Ve,b as Ye,u as Ze}from"./gestureArbiter-DszagC-d.js";import{A as Je}from"./arrow-up-BEUQcf-s.js";const Qe=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],We=Se("folder-tree",Qe);const et=[["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"}]],yt=Se("upload",et),xe={dampingRatio:.8,response:.3},tt=.998;function rt(n,a,u,f){const o=2*Math.PI/Math.max(n.response,.001),E=a-f,g=u,l=n.dampingRatio;if(Math.abs(l-1)<1e-4){const m=E,k=g+o*E;return{value:y=>f+(m+k*y)*Math.exp(-o*y),velocity:y=>(k-o*(m+k*y))*Math.exp(-o*y)}}if(l<1){const m=o*Math.sqrt(1-l*l),k=E,y=(g+l*o*E)/m;return{value:h=>f+Math.exp(-l*o*h)*(k*Math.cos(m*h)+y*Math.sin(m*h)),velocity:h=>Math.exp(-l*o*h)*((y*m-l*o*k)*Math.cos(m*h)-(k*m+l*o*y)*Math.sin(m*h))}}const x=o*Math.sqrt(l*l-1),d=-l*o+x,p=-l*o-x,S=(g-p*E)/(d-p),j=E-S;return{value:m=>f+S*Math.exp(d*m)+j*Math.exp(p*m),velocity:m=>S*d*Math.exp(d*m)+j*p*Math.exp(p*m)}}function nt(n,a=tt){return n/1e3*(a/(1-a))}function ge(n,a,u=.55){return n*a*u/(a+u*Math.abs(n))}function st(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}const ot=.1,at=5;function ct(n,a,u,f,o){const E=rt(n,a,u,f),g=1e3/60,l=240,x=[];for(let d=0;d<l;d++){const p=d*g/1e3,S=E.value(p),j=E.velocity(p);if(x.push(o?o(S):S),d>0&&Math.abs(S-f)<ot&&Math.abs(j)<at)break}return x.push(o?o(f):f),{frames:x,durationMs:(x.length-1)*g,solver:E}}const it='input:not([type="hidden"]), textarea, select, [contenteditable]:not([contenteditable="false"])';function lt(){if(typeof document>"u")return;const n=document.activeElement;n instanceof HTMLElement&&n.matches(it)&&n.blur()}const ut=18,ye=8,ve={touch:ye,pen:ye},dt=500,re=200,ke=50,ft=`[${$e}]`;function ne(n,a,u){return Math.min(u,Math.max(a,n))}function Re(n){if(!n||typeof n!="object")return!1;const a=n;return typeof a.pointerType=="string"?a.pointerType==="touch"||a.pointerType==="pen":typeof a.type=="string"&&a.type.startsWith("touch")}function Ee(n){if(!n||typeof n!="object")return!1;const a=n.target;return a instanceof Element&&!!a.closest(ft)}function K(...n){typeof window<"u"&&window.__SIDEBAR_DEBUG__&&console.log("[Sidebar]",...n)}const vt=Ge.forwardRef(function({side:a,isOpen:u,drawerWidthPx:f,onClose:o,onOpen:E,children:g,pinned:l=!1},x){const{t:d}=oe(),p=a==="left",S=p?-f:f,j=r.useRef(null),m=r.useRef(null),k=r.useRef(u?0:S),y=r.useRef(null),h=r.useRef(null),T=r.useRef(0),D=r.useRef(null),_=r.useRef(null),v=r.useRef(!1),R=r.useRef(null),N=r.useRef(!1),M=r.useRef([]),F=r.useRef(null),Ce=r.useRef(k.current),Te=r.useRef(u?1:0),O=r.useRef(u);O.current=u;const X=r.useRef(S);X.current=S;const J=r.useRef(f);J.current=f;const Q=r.useRef(p);Q.current=p;const ae=r.useRef(o);ae.current=o;const W=r.useRef(E);W.current=E;const ce=r.useCallback(e=>{j.current=e,typeof x=="function"?x(e):x&&(x.current=e)},[x]),ie=r.useCallback(()=>{h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null),y.current=null},[]),U=r.useCallback(e=>{const t=J.current;return Q.current?(e+t)/t:(t-e)/t},[]),le=r.useCallback(e=>{const t=m.current;t&&(t.style.opacity=String(ne(U(e),0,1)))},[U]),A=r.useCallback(e=>{k.current=e;const t=j.current;t&&(t.style.transform=`translateX(${e}px)`,le(e))},[le]),q=r.useCallback(e=>{y.current=e,h.current===null&&(h.current=window.requestAnimationFrame(()=>{h.current=null;const t=y.current;y.current=null,t!==null&&A(t)}))},[A]),z=r.useCallback(()=>{h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null);const e=y.current;y.current=null,e!==null&&A(e)},[A]),$=r.useCallback(e=>{const t=X.current;return ne(e,Math.min(0,t),Math.max(0,t))},[]),B=r.useCallback(()=>{const e=D.current;if(!e)return null;D.current=null;const t=(performance.now()-e.startTime)/1e3,c={value:e.solver.value(t),velocity:e.solver.velocity(t)};return e.animations.forEach(i=>i.cancel()),c},[]),L=r.useCallback(()=>{_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),ee=r.useCallback(()=>{F.current?.(),F.current=null},[]),V=r.useCallback(()=>{z(),L();const e=B();e&&A($(e.value));const t=j.current,c=m.current;t?.getAnimations().forEach(i=>i.cancel()),t&&(t.style.transition="none",t.style.opacity="1"),c?.getAnimations().forEach(i=>i.cancel()),c&&(c.style.transition="none")},[A,L,$,z,B]),Y=r.useCallback((e,t)=>{z(),L();const c=j.current,i=m.current,b=e?0:X.current;i&&(i.style.pointerEvents=e?"auto":"none");const w=B(),C=w?$(w.value):k.current,H=t?.velocity??w?.velocity??0;if(st())return k.current=b,c&&(c.style.transition=`opacity ${re}ms ease`,c.style.opacity=e?"1":"0",c.style.transform=`translateX(${b}px)`),i&&(i.style.transition=`opacity ${re}ms ease`,i.style.opacity=e?"1":"0"),re;c&&(c.style.transition="none",c.style.opacity="1"),i&&(i.style.transition="none");const I=Math.abs(t?.velocity??0)>dt,{frames:G,durationMs:Z,solver:De}=ct({dampingRatio:I?xe.dampingRatio:1,response:xe.response},C,H,b,$);if(!c||Math.abs(C-b)<.5&&Math.abs(H)<5)return A(b),0;const te=c.animate(G.map(P=>({transform:`translateX(${P}px)`})),{duration:Z,easing:"linear",fill:"forwards"}),he=[te];return i&&he.push(i.animate(G.map(P=>({opacity:String(ne(U(P),0,1))})),{duration:Z,easing:"linear",fill:"forwards"})),D.current={solver:De,startTime:performance.now(),target:b,animations:he},K("spring start",{startX:C,startVelocity:H,targetX:b,frames:G.length,durationMs:Z}),te.onfinish=()=>{const P=D.current;!P||!P.animations.includes(te)||(D.current=null,A(b),P.animations.forEach(Le=>Le.cancel()),K("spring finish",{targetX:b}))},Z},[A,L,$,z,U,B]),ue=r.useCallback(e=>{z();const t=e,c=0,i=X.current,b=k.current+nt(t),w=Math.abs(b-c)<=Math.abs(b-i);K("decideSnap",{velocity:t,currentX:k.current,projected:b,shouldOpen:w});const C=Y(w,{velocity:t});return w&&!O.current?_.current=window.setTimeout(()=>{_.current=null,W.current?.()},C+ke):!w&&O.current&&(_.current=window.setTimeout(()=>{_.current=null,ae.current()},C+ke)),w},[Y,z]),de=r.useCallback(e=>{const t=X.current,c=Math.min(0,t),i=Math.max(0,t),b=J.current;return e<c?c-ge(c-e,b):e>i?i+ge(e-i,b):e},[]),fe=r.useCallback(e=>{const t=M.current,c=performance.now();t.push({t:c,x:e});const i=c-120;for(;t.length>0&&t[0].t<i;)t.shift()},[]),pe=r.useCallback(()=>{const e=M.current;if(e.length<2)return 0;const t=e[e.length-1];if(performance.now()-t.t>60)return 0;const c=e[0],i=(t.t-c.t)/1e3;return i<.016?0:(t.x-c.x)/i},[]);r.useEffect(()=>{L();const e=D.current,t=u?0:X.current;e&&e.target===t||Y(u)},[u,Y,L]),r.useEffect(()=>{V(),q(O.current?0:S)},[S,V,q]),r.useEffect(()=>()=>{ie(),L(),B(),ee()},[L,ie,ee,B]);const _e=be(({active:e,cancel:t,first:c,last:i,movement:[b],event:w})=>{if(K("bindPanel",{active:e,first:c,last:i,mx:b}),!Re(w)){t();return}if(c){if(ee(),v.current=!1,R.current=null,M.current=[],Ee(w)){t();return}const C=j.current,H=C?Ke(w.target,C):null;if(!H||Ue()){t();return}const I=qe(H,b,Q.current?-1:1);if(K("arbitrate",{owner:I.kind,mx:b}),I.kind==="swiper"){F.current=Ve(I.instance),t();return}if(I.kind==="scroller"){const G=Ye(I.element);if(G)R.current=G;else{t();return}}R.current||(v.current=!0,V(),T.current=k.current)}if(!e){R.current=null,v.current&&(v.current=!1,ue(pe()));return}if(R.current){Ze(R.current,b);return}if(v.current){const C=de(T.current+b);fe(C),q(C)}},{axis:"x",axisThreshold:ve,filterTaps:!0,pointer:{touch:!0}}),Ne=be(({active:e,cancel:t,first:c,movement:[i],event:b})=>{if(!Re(b)){t();return}if(O.current){t();return}if(c&&(N.current=!0,M.current=[],V(),T.current=k.current),!e){N.current&&(N.current=!1,ue(pe())&&lt());return}if(N.current){const w=de(T.current+i);fe(w),q(w)}},{axis:"x",axisThreshold:ve,filterTaps:!0,pointer:{touch:!0}}),Ae=r.useCallback(e=>{e.preventDefault(),e.stopPropagation(),O.current||W.current?.()},[]);if(l)return s.jsx("aside",{ref:ce,"data-sidebar":a,"data-sidebar-pinned":"true",className:"relative flex h-full min-h-0 w-full flex-col app-chrome-bg",children:g});const me=_e();return s.jsxs(s.Fragment,{children:[s.jsx("div",{...Ne(),style:{position:"fixed",top:"1.5rem",bottom:"10rem",...p?{left:0}:{right:0},width:ut,zIndex:"var(--z-chrome-hint)",touchAction:"none",pointerEvents:u?"none":"auto"},onClick:Ae,"aria-label":d(p?"sidebar.openLeftSidebar":"sidebar.openRightSidebar")}),s.jsx("div",{ref:m,"data-sidebar-backdrop":a,className:"fixed inset-0 z-sidebar-backdrop bg-[var(--app-backdrop)] cursor-default",style:{opacity:Te.current,pointerEvents:u?"auto":"none",transition:"none",willChange:"opacity"},onClick:o,"aria-label":d("sidebar.closeSidebar")}),s.jsx("aside",{...me,onClickCapture:e=>{Ee(e)||me.onClickCapture?.(e)},ref:ce,"data-sidebar":a,className:`fixed inset-y-0 z-sidebar-panel flex flex-col chrome-glow-panel will-change-transform ${p?"border-r border-border":"border-l border-border/15"}`,style:{...p?{left:0}:{right:0},width:f,maxWidth:p?"94vw":"95vw",transform:`translateX(${Ce.current}px)`,transition:"none",touchAction:"pan-y",pointerEvents:u?"auto":"none",paddingTop:"var(--safe-top-inset, env(safe-area-inset-top, 0px))",paddingBottom:"var(--safe-bottom-inset, env(safe-area-inset-bottom, 0px))",...p?{paddingLeft:"var(--safe-left-inset, env(safe-area-inset-left, 0px))"}:{paddingRight:"var(--safe-right-inset, env(safe-area-inset-right, 0px))"}},children:g})]})});function se(n){return n.trim().replace(/\/+$/,"")||"/"}function pt(n){const a=se(n);if(a==="/")return"/";const u=a.lastIndexOf("/");return u<=0?"/":a.slice(0,u)}function je({open:n,initialPath:a,title:u,labels:f,onCancel:o,onConfirm:E}){const{t:g}=oe(),l={hint:f?.hint??g("sidebar.directoryPickerHint"),cancel:f?.cancel??g("common.cancel"),confirm:f?.confirm??g("sidebar.useThisFolder"),close:f?.close??g("common.close"),parent:f?.parent??g("rightSidebar.parentFolder")},x=r.useRef(null);we(x,n,o);const[d,p]=r.useState(()=>se(a));return r.useEffect(()=>{n&&p(se(a))},[a,n]),r.useEffect(()=>{if(!n)return;const S=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=S}},[n]),n?Me.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:"fixed inset-0 z-modal-backdrop cursor-default bg-[var(--app-backdrop)] backdrop-blur-sm",onClick:o,"aria-label":l.cancel}),s.jsxs("section",{ref:x,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":"directory-picker-title",className:"fixed bottom-[max(0.75rem,env(safe-area-inset-bottom,0px))] left-[max(0.75rem,env(safe-area-inset-left,0px))] right-[max(0.75rem,env(safe-area-inset-right,0px))] top-[max(0.75rem,env(safe-area-inset-top,0px))] z-modal-panel flex flex-col overflow-hidden rounded-2xl border border-border/15 bg-surface shadow-[0_28px_70px_var(--app-shadow-strong),0_14px_32px_var(--app-shadow-soft)] sm:bottom-auto sm:left-1/2 sm:right-auto sm:top-1/2 sm:h-[min(72svh,36rem)] sm:w-[min(36rem,calc(100vw-2rem))] sm:-translate-x-1/2 sm:-translate-y-1/2",children:[s.jsxs("header",{className:"flex shrink-0 items-center gap-3 border-b border-border/15 px-4 py-3",children:[s.jsx("span",{className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/15 text-primary",children:s.jsx(We,{size:15})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h2",{id:"directory-picker-title",className:"text-[13px] font-semibold text-foreground",children:u}),s.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:l.hint})]}),s.jsx("button",{type:"button",onClick:o,className:"inline-flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition hover:bg-surface-2 hover:text-foreground","aria-label":l.close,children:s.jsx(Ie,{size:15})})]}),s.jsxs("div",{className:"flex min-h-11 shrink-0 items-center gap-2 border-b border-border/15 px-3 py-1.5",children:[s.jsx("button",{type:"button",disabled:d==="/",onClick:()=>p(pt(d)),className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition hover:bg-surface-2 hover:text-foreground disabled:opacity-30","aria-label":l.parent,children:s.jsx(Je,{size:14})}),s.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[10.5px] text-foreground",title:d,children:d})]}),s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain py-1",children:s.jsx(Pe,{rootPath:d,directoriesOnly:!0,onFileSelect:()=>{},onDirectoryRoot:p,selectedFilePath:a||null})}),s.jsxs("footer",{className:"flex shrink-0 items-center justify-end gap-2 border-t border-border/15 bg-surface-elevated px-3 py-3",children:[s.jsx("button",{type:"button",onClick:o,className:"min-h-10 rounded-lg bg-surface-2 px-4 text-[11px] font-medium text-foreground transition hover:bg-surface",children:l.cancel}),s.jsxs("button",{type:"button",onClick:()=>E(d),className:"inline-flex min-h-10 items-center gap-1.5 rounded-lg bg-primary px-4 text-[11px] font-semibold text-primary-foreground transition hover:bg-primary/90",children:[s.jsx(Fe,{size:13}),l.confirm]})]})]})]}),document.body):null}const kt=Object.freeze(Object.defineProperty({__proto__:null,DirectoryPickerDialog:je},Symbol.toStringTag,{value:"Module"}));function Rt({file:n,initialPath:a,onInsert:u,onDone:f}){const{t:o}=oe(),E=Oe(),[g,l]=r.useState(!1),[x,d]=r.useState(!1),[p,S]=r.useState(!1),[j,m]=r.useState(!1),[k,y]=r.useState(null),h=r.useRef(!1),T=r.useRef(null);we(T,!g,()=>{});const D=async()=>{if(!h.current){h.current=!0,d(!0),m(!0);try{await Be(n.id),f()}catch(v){y(v instanceof Error?v.message:String(v))}finally{h.current=!1,d(!1),m(!1)}}};r.useEffect(()=>{if(g)return;T.current?.focus();const v=R=>{if(R.stopPropagation(),R.key==="Escape"&&R.preventDefault(),R.key!=="Tab")return;const N=Array.from(T.current?.querySelectorAll("button:not(:disabled)")??[]),M=N[0],F=N.at(-1);R.shiftKey&&(document.activeElement===M||document.activeElement===T.current)?(R.preventDefault(),F?.focus()):!R.shiftKey&&document.activeElement===F&&(R.preventDefault(),M?.focus())};return document.addEventListener("keydown",v,!0),()=>document.removeEventListener("keydown",v,!0)},[g]);const _=async(v,R)=>{if(h.current)return;const N=He(R);h.current=!0,d(!0),S(v!==void 0),l(!1),y(null);try{const M=await ze(n.id,v);if(v===void 0&&(!N()||await u(M.path,R)===!1))throw new Error(o("android.captureUnavailable"));f()}catch(M){y(M instanceof Error?M.message:String(M))}finally{h.current=!1,d(!1)}};return g?s.jsx(je,{open:!0,initialPath:a||"/",title:o("android.recordingSave"),onCancel:()=>l(!1),onConfirm:v=>{_(v)}}):Me.createPortal(s.jsx("div",{className:"fixed inset-0 z-modal-panel flex items-center justify-center bg-[var(--app-backdrop)] p-4",children:s.jsxs("div",{ref:T,role:"dialog","aria-modal":"true","aria-labelledby":"recording-save-title",tabIndex:-1,"aria-busy":x,className:"w-full max-w-sm rounded-xl border border-border bg-surface p-4 text-foreground shadow-xl outline-none",children:[s.jsx("h2",{id:"recording-save-title",className:"text-sm font-semibold",children:o("android.recordingConfirm")}),s.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:o("android.recordingSaveHint")}),s.jsxs("p",{className:"mt-2 break-all text-xs text-muted-foreground",children:[n.name," · ",(n.size/1024/1024).toFixed(1)," MB"]}),(k||n.error)&&s.jsx("p",{role:"alert",className:"mt-3 break-words text-xs text-destructive",children:k||n.error}),x&&s.jsxs("p",{role:"status",className:"mt-3 flex items-center gap-2 text-sm text-primary",children:[s.jsx(Xe,{size:16,className:"animate-spin"}),j?`${o("android.recordingDiscard")}…`:o(p?"android.recordingSaving":"android.captureInserting")]}),s.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[s.jsx("button",{type:"button",disabled:x||n.status!=="ready",onClick:v=>{_(void 0,v.currentTarget)},className:"min-h-10 rounded-lg bg-primary px-3 text-sm text-primary-foreground disabled:opacity-40",children:o("android.recordingInsert")}),!E&&s.jsx("button",{type:"button",disabled:x||n.status!=="ready",onClick:()=>l(!0),className:"min-h-10 rounded-lg bg-surface-2 px-3 text-sm disabled:opacity-40",children:o("android.recordingSave")}),s.jsx("button",{type:"button",disabled:x,onClick:()=>{D()},className:"min-h-10 rounded-lg px-3 text-sm text-muted-foreground disabled:opacity-40",children:o("android.recordingDiscard")})]})]})}),document.body)}export{je as D,Rt as R,vt as S,yt as U,kt as a};
1
+ import{aV as Se,ea as oe,cg as s,eb as we,a4 as Ie,q as Pe,C as Fe,ei as Oe,u as Xe,dj as ze,b0 as Be,at as He}from"./app-DuUnqxq-.js";import{R as Ge,b as r,r as Me}from"./dnd-BCFAPC0L.js";import{u as be}from"./use-gesture-react.esm-DYpdiE_k.js";import{S as $e,c as Ke,h as Ue,r as qe,y as Ve,b as Ye,u as Ze}from"./gestureArbiter-DszagC-d.js";import{A as Je}from"./arrow-up-DNkfesW0.js";const Qe=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],We=Se("folder-tree",Qe);const et=[["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"}]],yt=Se("upload",et),xe={dampingRatio:.8,response:.3},tt=.998;function rt(n,a,u,f){const o=2*Math.PI/Math.max(n.response,.001),E=a-f,g=u,l=n.dampingRatio;if(Math.abs(l-1)<1e-4){const m=E,k=g+o*E;return{value:y=>f+(m+k*y)*Math.exp(-o*y),velocity:y=>(k-o*(m+k*y))*Math.exp(-o*y)}}if(l<1){const m=o*Math.sqrt(1-l*l),k=E,y=(g+l*o*E)/m;return{value:h=>f+Math.exp(-l*o*h)*(k*Math.cos(m*h)+y*Math.sin(m*h)),velocity:h=>Math.exp(-l*o*h)*((y*m-l*o*k)*Math.cos(m*h)-(k*m+l*o*y)*Math.sin(m*h))}}const x=o*Math.sqrt(l*l-1),d=-l*o+x,p=-l*o-x,S=(g-p*E)/(d-p),j=E-S;return{value:m=>f+S*Math.exp(d*m)+j*Math.exp(p*m),velocity:m=>S*d*Math.exp(d*m)+j*p*Math.exp(p*m)}}function nt(n,a=tt){return n/1e3*(a/(1-a))}function ge(n,a,u=.55){return n*a*u/(a+u*Math.abs(n))}function st(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}const ot=.1,at=5;function ct(n,a,u,f,o){const E=rt(n,a,u,f),g=1e3/60,l=240,x=[];for(let d=0;d<l;d++){const p=d*g/1e3,S=E.value(p),j=E.velocity(p);if(x.push(o?o(S):S),d>0&&Math.abs(S-f)<ot&&Math.abs(j)<at)break}return x.push(o?o(f):f),{frames:x,durationMs:(x.length-1)*g,solver:E}}const it='input:not([type="hidden"]), textarea, select, [contenteditable]:not([contenteditable="false"])';function lt(){if(typeof document>"u")return;const n=document.activeElement;n instanceof HTMLElement&&n.matches(it)&&n.blur()}const ut=18,ye=8,ve={touch:ye,pen:ye},dt=500,re=200,ke=50,ft=`[${$e}]`;function ne(n,a,u){return Math.min(u,Math.max(a,n))}function Re(n){if(!n||typeof n!="object")return!1;const a=n;return typeof a.pointerType=="string"?a.pointerType==="touch"||a.pointerType==="pen":typeof a.type=="string"&&a.type.startsWith("touch")}function Ee(n){if(!n||typeof n!="object")return!1;const a=n.target;return a instanceof Element&&!!a.closest(ft)}function K(...n){typeof window<"u"&&window.__SIDEBAR_DEBUG__&&console.log("[Sidebar]",...n)}const vt=Ge.forwardRef(function({side:a,isOpen:u,drawerWidthPx:f,onClose:o,onOpen:E,children:g,pinned:l=!1},x){const{t:d}=oe(),p=a==="left",S=p?-f:f,j=r.useRef(null),m=r.useRef(null),k=r.useRef(u?0:S),y=r.useRef(null),h=r.useRef(null),T=r.useRef(0),D=r.useRef(null),_=r.useRef(null),v=r.useRef(!1),R=r.useRef(null),N=r.useRef(!1),M=r.useRef([]),F=r.useRef(null),Ce=r.useRef(k.current),Te=r.useRef(u?1:0),O=r.useRef(u);O.current=u;const X=r.useRef(S);X.current=S;const J=r.useRef(f);J.current=f;const Q=r.useRef(p);Q.current=p;const ae=r.useRef(o);ae.current=o;const W=r.useRef(E);W.current=E;const ce=r.useCallback(e=>{j.current=e,typeof x=="function"?x(e):x&&(x.current=e)},[x]),ie=r.useCallback(()=>{h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null),y.current=null},[]),U=r.useCallback(e=>{const t=J.current;return Q.current?(e+t)/t:(t-e)/t},[]),le=r.useCallback(e=>{const t=m.current;t&&(t.style.opacity=String(ne(U(e),0,1)))},[U]),A=r.useCallback(e=>{k.current=e;const t=j.current;t&&(t.style.transform=`translateX(${e}px)`,le(e))},[le]),q=r.useCallback(e=>{y.current=e,h.current===null&&(h.current=window.requestAnimationFrame(()=>{h.current=null;const t=y.current;y.current=null,t!==null&&A(t)}))},[A]),z=r.useCallback(()=>{h.current!==null&&(window.cancelAnimationFrame(h.current),h.current=null);const e=y.current;y.current=null,e!==null&&A(e)},[A]),$=r.useCallback(e=>{const t=X.current;return ne(e,Math.min(0,t),Math.max(0,t))},[]),B=r.useCallback(()=>{const e=D.current;if(!e)return null;D.current=null;const t=(performance.now()-e.startTime)/1e3,c={value:e.solver.value(t),velocity:e.solver.velocity(t)};return e.animations.forEach(i=>i.cancel()),c},[]),L=r.useCallback(()=>{_.current!==null&&(window.clearTimeout(_.current),_.current=null)},[]),ee=r.useCallback(()=>{F.current?.(),F.current=null},[]),V=r.useCallback(()=>{z(),L();const e=B();e&&A($(e.value));const t=j.current,c=m.current;t?.getAnimations().forEach(i=>i.cancel()),t&&(t.style.transition="none",t.style.opacity="1"),c?.getAnimations().forEach(i=>i.cancel()),c&&(c.style.transition="none")},[A,L,$,z,B]),Y=r.useCallback((e,t)=>{z(),L();const c=j.current,i=m.current,b=e?0:X.current;i&&(i.style.pointerEvents=e?"auto":"none");const w=B(),C=w?$(w.value):k.current,H=t?.velocity??w?.velocity??0;if(st())return k.current=b,c&&(c.style.transition=`opacity ${re}ms ease`,c.style.opacity=e?"1":"0",c.style.transform=`translateX(${b}px)`),i&&(i.style.transition=`opacity ${re}ms ease`,i.style.opacity=e?"1":"0"),re;c&&(c.style.transition="none",c.style.opacity="1"),i&&(i.style.transition="none");const I=Math.abs(t?.velocity??0)>dt,{frames:G,durationMs:Z,solver:De}=ct({dampingRatio:I?xe.dampingRatio:1,response:xe.response},C,H,b,$);if(!c||Math.abs(C-b)<.5&&Math.abs(H)<5)return A(b),0;const te=c.animate(G.map(P=>({transform:`translateX(${P}px)`})),{duration:Z,easing:"linear",fill:"forwards"}),he=[te];return i&&he.push(i.animate(G.map(P=>({opacity:String(ne(U(P),0,1))})),{duration:Z,easing:"linear",fill:"forwards"})),D.current={solver:De,startTime:performance.now(),target:b,animations:he},K("spring start",{startX:C,startVelocity:H,targetX:b,frames:G.length,durationMs:Z}),te.onfinish=()=>{const P=D.current;!P||!P.animations.includes(te)||(D.current=null,A(b),P.animations.forEach(Le=>Le.cancel()),K("spring finish",{targetX:b}))},Z},[A,L,$,z,U,B]),ue=r.useCallback(e=>{z();const t=e,c=0,i=X.current,b=k.current+nt(t),w=Math.abs(b-c)<=Math.abs(b-i);K("decideSnap",{velocity:t,currentX:k.current,projected:b,shouldOpen:w});const C=Y(w,{velocity:t});return w&&!O.current?_.current=window.setTimeout(()=>{_.current=null,W.current?.()},C+ke):!w&&O.current&&(_.current=window.setTimeout(()=>{_.current=null,ae.current()},C+ke)),w},[Y,z]),de=r.useCallback(e=>{const t=X.current,c=Math.min(0,t),i=Math.max(0,t),b=J.current;return e<c?c-ge(c-e,b):e>i?i+ge(e-i,b):e},[]),fe=r.useCallback(e=>{const t=M.current,c=performance.now();t.push({t:c,x:e});const i=c-120;for(;t.length>0&&t[0].t<i;)t.shift()},[]),pe=r.useCallback(()=>{const e=M.current;if(e.length<2)return 0;const t=e[e.length-1];if(performance.now()-t.t>60)return 0;const c=e[0],i=(t.t-c.t)/1e3;return i<.016?0:(t.x-c.x)/i},[]);r.useEffect(()=>{L();const e=D.current,t=u?0:X.current;e&&e.target===t||Y(u)},[u,Y,L]),r.useEffect(()=>{V(),q(O.current?0:S)},[S,V,q]),r.useEffect(()=>()=>{ie(),L(),B(),ee()},[L,ie,ee,B]);const _e=be(({active:e,cancel:t,first:c,last:i,movement:[b],event:w})=>{if(K("bindPanel",{active:e,first:c,last:i,mx:b}),!Re(w)){t();return}if(c){if(ee(),v.current=!1,R.current=null,M.current=[],Ee(w)){t();return}const C=j.current,H=C?Ke(w.target,C):null;if(!H||Ue()){t();return}const I=qe(H,b,Q.current?-1:1);if(K("arbitrate",{owner:I.kind,mx:b}),I.kind==="swiper"){F.current=Ve(I.instance),t();return}if(I.kind==="scroller"){const G=Ye(I.element);if(G)R.current=G;else{t();return}}R.current||(v.current=!0,V(),T.current=k.current)}if(!e){R.current=null,v.current&&(v.current=!1,ue(pe()));return}if(R.current){Ze(R.current,b);return}if(v.current){const C=de(T.current+b);fe(C),q(C)}},{axis:"x",axisThreshold:ve,filterTaps:!0,pointer:{touch:!0}}),Ne=be(({active:e,cancel:t,first:c,movement:[i],event:b})=>{if(!Re(b)){t();return}if(O.current){t();return}if(c&&(N.current=!0,M.current=[],V(),T.current=k.current),!e){N.current&&(N.current=!1,ue(pe())&&lt());return}if(N.current){const w=de(T.current+i);fe(w),q(w)}},{axis:"x",axisThreshold:ve,filterTaps:!0,pointer:{touch:!0}}),Ae=r.useCallback(e=>{e.preventDefault(),e.stopPropagation(),O.current||W.current?.()},[]);if(l)return s.jsx("aside",{ref:ce,"data-sidebar":a,"data-sidebar-pinned":"true",className:"relative flex h-full min-h-0 w-full flex-col app-chrome-bg",children:g});const me=_e();return s.jsxs(s.Fragment,{children:[s.jsx("div",{...Ne(),style:{position:"fixed",top:"1.5rem",bottom:"10rem",...p?{left:0}:{right:0},width:ut,zIndex:"var(--z-chrome-hint)",touchAction:"none",pointerEvents:u?"none":"auto"},onClick:Ae,"aria-label":d(p?"sidebar.openLeftSidebar":"sidebar.openRightSidebar")}),s.jsx("div",{ref:m,"data-sidebar-backdrop":a,className:"fixed inset-0 z-sidebar-backdrop bg-[var(--app-backdrop)] cursor-default",style:{opacity:Te.current,pointerEvents:u?"auto":"none",transition:"none",willChange:"opacity"},onClick:o,"aria-label":d("sidebar.closeSidebar")}),s.jsx("aside",{...me,onClickCapture:e=>{Ee(e)||me.onClickCapture?.(e)},ref:ce,"data-sidebar":a,className:`fixed inset-y-0 z-sidebar-panel flex flex-col chrome-glow-panel will-change-transform ${p?"border-r border-border":"border-l border-border/15"}`,style:{...p?{left:0}:{right:0},width:f,maxWidth:p?"94vw":"95vw",transform:`translateX(${Ce.current}px)`,transition:"none",touchAction:"pan-y",pointerEvents:u?"auto":"none",paddingTop:"var(--safe-top-inset, env(safe-area-inset-top, 0px))",paddingBottom:"var(--safe-bottom-inset, env(safe-area-inset-bottom, 0px))",...p?{paddingLeft:"var(--safe-left-inset, env(safe-area-inset-left, 0px))"}:{paddingRight:"var(--safe-right-inset, env(safe-area-inset-right, 0px))"}},children:g})]})});function se(n){return n.trim().replace(/\/+$/,"")||"/"}function pt(n){const a=se(n);if(a==="/")return"/";const u=a.lastIndexOf("/");return u<=0?"/":a.slice(0,u)}function je({open:n,initialPath:a,title:u,labels:f,onCancel:o,onConfirm:E}){const{t:g}=oe(),l={hint:f?.hint??g("sidebar.directoryPickerHint"),cancel:f?.cancel??g("common.cancel"),confirm:f?.confirm??g("sidebar.useThisFolder"),close:f?.close??g("common.close"),parent:f?.parent??g("rightSidebar.parentFolder")},x=r.useRef(null);we(x,n,o);const[d,p]=r.useState(()=>se(a));return r.useEffect(()=>{n&&p(se(a))},[a,n]),r.useEffect(()=>{if(!n)return;const S=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=S}},[n]),n?Me.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:"fixed inset-0 z-modal-backdrop cursor-default bg-[var(--app-backdrop)] backdrop-blur-sm",onClick:o,"aria-label":l.cancel}),s.jsxs("section",{ref:x,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":"directory-picker-title",className:"fixed bottom-[max(0.75rem,env(safe-area-inset-bottom,0px))] left-[max(0.75rem,env(safe-area-inset-left,0px))] right-[max(0.75rem,env(safe-area-inset-right,0px))] top-[max(0.75rem,env(safe-area-inset-top,0px))] z-modal-panel flex flex-col overflow-hidden rounded-2xl border border-border/15 bg-surface shadow-[0_28px_70px_var(--app-shadow-strong),0_14px_32px_var(--app-shadow-soft)] sm:bottom-auto sm:left-1/2 sm:right-auto sm:top-1/2 sm:h-[min(72svh,36rem)] sm:w-[min(36rem,calc(100vw-2rem))] sm:-translate-x-1/2 sm:-translate-y-1/2",children:[s.jsxs("header",{className:"flex shrink-0 items-center gap-3 border-b border-border/15 px-4 py-3",children:[s.jsx("span",{className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/15 text-primary",children:s.jsx(We,{size:15})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h2",{id:"directory-picker-title",className:"text-[13px] font-semibold text-foreground",children:u}),s.jsx("p",{className:"mt-0.5 text-[10px] text-muted-foreground",children:l.hint})]}),s.jsx("button",{type:"button",onClick:o,className:"inline-flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition hover:bg-surface-2 hover:text-foreground","aria-label":l.close,children:s.jsx(Ie,{size:15})})]}),s.jsxs("div",{className:"flex min-h-11 shrink-0 items-center gap-2 border-b border-border/15 px-3 py-1.5",children:[s.jsx("button",{type:"button",disabled:d==="/",onClick:()=>p(pt(d)),className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition hover:bg-surface-2 hover:text-foreground disabled:opacity-30","aria-label":l.parent,children:s.jsx(Je,{size:14})}),s.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[10.5px] text-foreground",title:d,children:d})]}),s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain py-1",children:s.jsx(Pe,{rootPath:d,directoriesOnly:!0,onFileSelect:()=>{},onDirectoryRoot:p,selectedFilePath:a||null})}),s.jsxs("footer",{className:"flex shrink-0 items-center justify-end gap-2 border-t border-border/15 bg-surface-elevated px-3 py-3",children:[s.jsx("button",{type:"button",onClick:o,className:"min-h-10 rounded-lg bg-surface-2 px-4 text-[11px] font-medium text-foreground transition hover:bg-surface",children:l.cancel}),s.jsxs("button",{type:"button",onClick:()=>E(d),className:"inline-flex min-h-10 items-center gap-1.5 rounded-lg bg-primary px-4 text-[11px] font-semibold text-primary-foreground transition hover:bg-primary/90",children:[s.jsx(Fe,{size:13}),l.confirm]})]})]})]}),document.body):null}const kt=Object.freeze(Object.defineProperty({__proto__:null,DirectoryPickerDialog:je},Symbol.toStringTag,{value:"Module"}));function Rt({file:n,initialPath:a,onInsert:u,onDone:f}){const{t:o}=oe(),E=Oe(),[g,l]=r.useState(!1),[x,d]=r.useState(!1),[p,S]=r.useState(!1),[j,m]=r.useState(!1),[k,y]=r.useState(null),h=r.useRef(!1),T=r.useRef(null);we(T,!g,()=>{});const D=async()=>{if(!h.current){h.current=!0,d(!0),m(!0);try{await Be(n.id),f()}catch(v){y(v instanceof Error?v.message:String(v))}finally{h.current=!1,d(!1),m(!1)}}};r.useEffect(()=>{if(g)return;T.current?.focus();const v=R=>{if(R.stopPropagation(),R.key==="Escape"&&R.preventDefault(),R.key!=="Tab")return;const N=Array.from(T.current?.querySelectorAll("button:not(:disabled)")??[]),M=N[0],F=N.at(-1);R.shiftKey&&(document.activeElement===M||document.activeElement===T.current)?(R.preventDefault(),F?.focus()):!R.shiftKey&&document.activeElement===F&&(R.preventDefault(),M?.focus())};return document.addEventListener("keydown",v,!0),()=>document.removeEventListener("keydown",v,!0)},[g]);const _=async(v,R)=>{if(h.current)return;const N=He(R);h.current=!0,d(!0),S(v!==void 0),l(!1),y(null);try{const M=await ze(n.id,v);if(v===void 0&&(!N()||await u(M.path,R)===!1))throw new Error(o("android.captureUnavailable"));f()}catch(M){y(M instanceof Error?M.message:String(M))}finally{h.current=!1,d(!1)}};return g?s.jsx(je,{open:!0,initialPath:a||"/",title:o("android.recordingSave"),onCancel:()=>l(!1),onConfirm:v=>{_(v)}}):Me.createPortal(s.jsx("div",{className:"fixed inset-0 z-modal-panel flex items-center justify-center bg-[var(--app-backdrop)] p-4",children:s.jsxs("div",{ref:T,role:"dialog","aria-modal":"true","aria-labelledby":"recording-save-title",tabIndex:-1,"aria-busy":x,className:"w-full max-w-sm rounded-xl border border-border bg-surface p-4 text-foreground shadow-xl outline-none",children:[s.jsx("h2",{id:"recording-save-title",className:"text-sm font-semibold",children:o("android.recordingConfirm")}),s.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:o("android.recordingSaveHint")}),s.jsxs("p",{className:"mt-2 break-all text-xs text-muted-foreground",children:[n.name," · ",(n.size/1024/1024).toFixed(1)," MB"]}),(k||n.error)&&s.jsx("p",{role:"alert",className:"mt-3 break-words text-xs text-destructive",children:k||n.error}),x&&s.jsxs("p",{role:"status",className:"mt-3 flex items-center gap-2 text-sm text-primary",children:[s.jsx(Xe,{size:16,className:"animate-spin"}),j?`${o("android.recordingDiscard")}…`:o(p?"android.recordingSaving":"android.captureInserting")]}),s.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[s.jsx("button",{type:"button",disabled:x||n.status!=="ready",onClick:v=>{_(void 0,v.currentTarget)},className:"min-h-10 rounded-lg bg-primary px-3 text-sm text-primary-foreground disabled:opacity-40",children:o("android.recordingInsert")}),!E&&s.jsx("button",{type:"button",disabled:x||n.status!=="ready",onClick:()=>l(!0),className:"min-h-10 rounded-lg bg-surface-2 px-3 text-sm disabled:opacity-40",children:o("android.recordingSave")}),s.jsx("button",{type:"button",disabled:x,onClick:()=>{D()},className:"min-h-10 rounded-lg px-3 text-sm text-muted-foreground disabled:opacity-40",children:o("android.recordingDiscard")})]})]})}),document.body)}export{je as D,Rt as R,vt as S,yt as U,kt as a};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ModelPreview-Cl0X7I-U.js","assets/app-C3WX_u_Z.js","assets/react-XDCjal2T.js","assets/dnd-BCFAPC0L.js","assets/terminal-Dea8wJF3.js","assets/index-DOq3vkFG.css","assets/search-CDJ4fv-q.js","assets/sun-CvzpsfHU.js","assets/list-tree-XBmm9il2.js","assets/AndroidMirrorView-BC_6L3mG.js","assets/v4-EwEgHOG0.js","assets/RecordingSaveDialog-Ca2iJsOW.js","assets/use-gesture-react.esm-DYpdiE_k.js","assets/gestureArbiter-DszagC-d.js","assets/arrow-up-BEUQcf-s.js","assets/unplug-BNUx6Lmk.js","assets/circle-Pldg1yI9.js","assets/quote-DeByS04O.js","assets/MarkdownPreview-_Z5UzhLt.js","assets/swiper-DJjq1TYT.js","assets/swiper-C2J0D0kV.css","assets/syntaxHighlight-DF6Q5phI.js","assets/GitLoadingSkeleton-Fa4AXG-N.js","assets/DiffReview-Ce3wKMBk.js","assets/DiffViewer-Bp-BLT2f.js","assets/git-compare-Ct2eJNs4.js","assets/DiffViewer-T3uj2-aP.css","assets/triangle-alert--5QOrsVl.js","assets/ChangeWalkthroughPanel-mAiaX5i8.js","assets/chevron-left-D8ntyw2S.js","assets/maximize-2-t-zzENew.js","assets/loader-circle-D_nJKmMD.js","assets/arrow-down-Dp27yS0N.js","assets/ArchitecturePanel-CYdolNzT.js","assets/link-x33s12VI.js","assets/purify.es-4eNOHKSq.js","assets/ArchitecturePanel-B_BDrrfR.css","assets/ComputerControlView-DU9krDsg.js","assets/clipboard-tTkMEO1S.js","assets/settings-2-DtFz7lgk.js"])))=>i.map(i=>d[i]);
2
- import{aV as Jr,ea as _t,cg as t,n as po,cq as Qd,r as Gi,u as lt,F as eh,h as ds,a4 as Xt,ej as U,V as sa,eq as Pt,cG as ct,c as mo,bK as Zd,C as go,g as aa,_ as co,e5 as Zs,e6 as Wi,$ as Zc,d1 as eu,dT as th,dq as rh,b5 as nh,L as bo,R as uo,c0 as sh,as as Ws,be as ah,ed as tu,c8 as oh,ca as ih,cb as lh,cc as ch,c9 as qs,bu as dh,E as uh,w as fh,c4 as hh,cI as ph,cL as mh,cM as gh,bX as bh,cJ as ed,ar as yt,ak as ru,am as xh,p as qi,k as vh,m as yh,v as Ri,al as wh,e8 as ji,bW as td,bo as rd,bk as kh,by as Ci,bz as nd,er as ra,bb as Ks,bA as Sh,cw as Rh,dQ as sd,br as jh,e3 as Ch,at as Ni,de as Nh,ek as Yr,d5 as An,an as Ph,ao as ad,bD as Eh,aB as od,aA as Ah,bl as id,bq as Th,bw as ld,dh as Mh,ad as cd,j as dd,I as Pi,H as ro,b as Lh,y as ud,U as fd,t as Ih,q as hd,ap as $h,a5 as sl,d6 as Fh,eo as Dh,J as _h}from"./app-C3WX_u_Z.js";import{u as Bh,j as Ei,Z as Uh,a as nu,F as Oh,M as Hh,_ as zh,c as Gh,d as Wh,e as qh,g as Kh,f as Vh,h as Yh,r as Xh,s as Jh}from"./MarkdownPreview-_Z5UzhLt.js";import{b as n,r as Qr}from"./dnd-BCFAPC0L.js";import{b as Qh,a as Zh,P as ep,d as tp,c as rp,N as pd,S as np,C as sp,G as ap,A as op}from"./GitLoadingSkeleton-Fa4AXG-N.js";import{S as ip,a as md}from"./swiper-DJjq1TYT.js";import{S as lp,U as cp}from"./RecordingSaveDialog-Ca2iJsOW.js";import{A as al}from"./arrow-up-BEUQcf-s.js";import{D as Ki,C as na,f as dp,n as up}from"./DiffReview-Ce3wKMBk.js";import{T as fp,G as br}from"./triangle-alert--5QOrsVl.js";import{C as su,M as au}from"./ChangeWalkthroughPanel-mAiaX5i8.js";import{R as ou,S as gd,V as hp,d as pp,M as mp,A as Ai,u as gp,f as bp,i as bd,H as xd,b as xp}from"./AndroidMirrorView-BC_6L3mG.js";import{u as vp}from"./DiffViewer-Bp-BLT2f.js";import{r as yp,s as wp,l as kp,a as vd,g as Vi,b as Sp,h as Rp}from"./syntaxHighlight-DF6Q5phI.js";import{L as yd}from"./loader-circle-D_nJKmMD.js";import{a as wd,S as kd}from"./gestureArbiter-DszagC-d.js";import{M as iu}from"./maximize-2-t-zzENew.js";import{L as jp}from"./list-tree-XBmm9il2.js";import{S as us}from"./search-CDJ4fv-q.js";import{A as Cp}from"./arrow-down-Dp27yS0N.js";import{G as lu}from"./git-compare-Ct2eJNs4.js";const Np=[["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"}]],Pp=Jr("case-sensitive",Np);const Ep=[["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"}]],Ap=Jr("eye-off",Ep);const Tp=[["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"}]],Yi=Jr("eye",Tp);const Mp=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Lp=Jr("funnel",Mp);const Ip=[["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"}]],$p=Jr("image-plus",Ip);const Fp=[["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"}]],Dp=Jr("regex",Fp);const _p=[["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"}]],Bp=Jr("scan",_p);const Up=[["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"}]],Op=Jr("whole-word",Up);function Sd({children:r,actions:a}){const{t:i}=_t(),[c,f]=n.useState(!1),p=n.useId(),g=n.useRef(null),k=n.useRef(null),m=()=>{f(!1),g.current?.focus({preventScroll:!0})};return n.useLayoutEffect(()=>{if(!c)return;const x=g.current,w=k.current;if(!x||!w)return;const R=window.visualViewport,b=()=>{const P=x.getBoundingClientRect(),$=(R?.offsetLeft??0)+8,D=(R?.offsetTop??0)+8,te=Math.max(0,(R?.width??window.innerWidth)-16),M=D+(R?.height??window.innerHeight)-16,I=Math.min(240,te),H=Math.max(0,P.top-D-6),Y=Math.max(0,M-P.bottom-6),be=w.scrollHeight>Y&&H>Y;Object.assign(w.style,{width:`${I}px`,left:`${Math.max($,Math.min(P.right-I,$+te-I))}px`,top:`${be?P.top-6:P.bottom+6}px`,maxHeight:`${be?H:Y}px`,transform:be?"translateY(-100%)":"none"})};b();const A=typeof ResizeObserver>"u"?null:new ResizeObserver(b);return A?.observe(x),A?.observe(w),window.addEventListener("resize",b),window.addEventListener("scroll",b,!0),R?.addEventListener("resize",b),R?.addEventListener("scroll",b),()=>{A?.disconnect(),window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0),R?.removeEventListener("resize",b),R?.removeEventListener("scroll",b)}},[c]),n.useEffect(()=>{if(!c)return;k.current?.querySelector("button:not(:disabled)")?.focus({preventScroll:!0});const x=w=>{w.target instanceof Node&&!g.current?.contains(w.target)&&!k.current?.contains(w.target)&&f(!1)};return document.addEventListener("pointerdown",x),()=>document.removeEventListener("pointerdown",x)},[c]),t.jsxs("div",{className:"mt-2",children:[t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[r,t.jsxs("button",{ref:g,type:"button","aria-haspopup":"menu","aria-expanded":c,"aria-controls":c?p:void 0,onClick:()=>f(x=>!x),onKeyDown:x=>{(x.key==="ArrowDown"||x.key==="ArrowUp")&&(x.preventDefault(),f(!0))},className:`ml-auto inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md px-2 text-[11px] font-medium transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary ${c?"bg-surface-2 text-foreground":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,children:[t.jsx(po,{size:14}),i("sidebar.moreActions")]})]}),typeof document<"u"&&Qr.createPortal(t.jsx("div",{ref:k,id:p,hidden:!c,role:"menu","data-sidebar-gesture-ignore":!0,"aria-label":i("sidebar.moreActions"),className:"fixed z-menu-panel overflow-y-auto overscroll-contain rounded-lg border border-border/30 bg-surface p-1 shadow-[0_8px_24px_var(--app-shadow-soft)]",onKeyDown:x=>{if(!x.currentTarget.contains(x.target))return;const w=[...x.currentTarget.querySelectorAll("button:not(:disabled)")],R=w.indexOf(document.activeElement);let b;if(x.key==="Escape"){x.preventDefault(),x.stopPropagation(),m();return}if(x.key==="Tab"){m();return}if(x.key==="ArrowDown")b=(R+1)%w.length;else if(x.key==="ArrowUp")b=(R-1+w.length)%w.length;else if(x.key==="Home")b=0;else if(x.key==="End")b=w.length-1;else return;x.preventDefault(),w[b]?.focus({preventScroll:!0})},children:a(m)}),document.body)]})}const Ti="a[href],button,input,select,textarea,[tabindex],[contenteditable],iframe,summary,audio[controls],video[controls]",is=n.memo(function({active:a,mounted:i=!0,fallback:c=null,children:f}){const p=n.useRef(null);return n.useLayoutEffect(()=>{const g=p.current;if(!g||a)return;const k=new Map,m=R=>{k.has(R)||(k.set(R,R.inert),R.inert=!0)},x=R=>{R instanceof HTMLElement&&R.matches(Ti)&&m(R),R.querySelectorAll(Ti).forEach(m)};x(g);const w=new MutationObserver(R=>{for(const b of R)b.type==="attributes"?b.target instanceof HTMLElement&&b.target.matches(Ti)&&m(b.target):b.addedNodes.forEach(A=>{A instanceof Element&&x(A)})});return w.observe(g,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex","href","contenteditable","controls"]}),()=>{w.disconnect();for(const[R,b]of k)R.inert=b}},[a,i]),t.jsx("div",{ref:p,className:"absolute inset-0 min-h-0 overflow-hidden bg-surface text-foreground",style:a?void 0:{clipPath:"inset(100%)"},"aria-hidden":!a,children:i?typeof f=="function"?f():f:c})},(r,a)=>!r.active&&!a.active&&r.mounted===a.mounted);async function Hp(r){let a;try{await Promise.race([r(),new Promise(i=>{a=setTimeout(i,3e3)})])}catch{}finally{clearTimeout(a)}}function zp({active:r,rootPath:a,loading:i,delay:c,lastStartedRoot:f,load:p}){n.useEffect(()=>{if(!r||!a||i||f.current===a)return;const g=window.setTimeout(()=>{f.current=a,p(a)},c);return()=>window.clearTimeout(g)},[r,a,i,c,f,p])}function Gp({rootPath:r,paths:a,disabled:i,onChange:c}){const{t:f}=_t(),[p,g]=n.useState(""),[k,m]=n.useState(0),[x,w]=n.useState(null),[R,b]=n.useState(!1),[A,P]=n.useState(!1),$=`${r.replace(/[\\/]+$/,"")}/${p}`;n.useEffect(()=>{const I=new AbortController;return w(null),b(!1),Qd($,I.signal,!0,"pick_git_ignore_exception").then(H=>{I.signal.aborted||w({directory:p,entries:H.entries,truncated:!!H.truncated})}).catch(()=>{I.signal.aborted||b(!0)}),()=>I.abort()},[$,p,k]);const D=I=>{w(null),b(!1),g(I)},te=x?.directory===p,M=I=>{if(I.length>200){P(!0);return}P(!1),c(I)};return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"overflow-hidden rounded-lg border border-border/30 bg-surface-2",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 p-2",children:[t.jsx("button",{type:"button",disabled:i||!p,onClick:()=>D(p.slice(0,Math.max(0,p.lastIndexOf("/")))),"aria-label":f("rightSidebar.parentFolder"),className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface-elevated hover:text-foreground disabled:opacity-30",children:t.jsx(al,{size:14})}),t.jsx("button",{type:"button",disabled:i||!p,onClick:()=>D(""),"aria-label":f("rightSidebar.backToProjectRoot"),className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface-elevated hover:text-foreground disabled:opacity-30",children:t.jsx(Gi,{size:14})}),t.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",title:$,children:p||"./"})]}),t.jsxs("div",{className:"h-56 overflow-y-auto overscroll-contain p-1",role:"group","aria-label":f("rightSidebar.gitIgnoreExceptionsPaths"),"aria-busy":!te&&!R,children:[R?t.jsxs("div",{className:"flex flex-col items-center gap-2 p-4 text-center text-xs",children:[t.jsx("p",{role:"alert",className:"text-destructive",children:f("rightSidebar.gitIgnoreExceptionsLoadFailed")}),t.jsx("button",{type:"button",disabled:i,onClick:()=>{b(!1),m(I=>I+1)},className:"rounded-md px-3 py-2 text-primary hover:bg-surface-elevated disabled:opacity-40",children:f("common.retry")})]}):te?x.entries.length===0?t.jsx("p",{className:"p-4 text-center text-xs text-muted-foreground",children:f("rightSidebar.gitIgnoreExceptionsEmptyDirectory")}):x.entries.map(I=>{const H=p?`${p}/${I.name}`:I.name,Y=H+(I.type==="directory"?"/":""),be=a.includes(Y)||a.includes(H),_=a.some(ae=>ae.endsWith("/")&&H.startsWith(ae)),o=I.type==="directory"?Gi:eh;return t.jsxs("div",{className:"flex items-center gap-1 rounded-md hover:bg-surface-elevated",children:[t.jsxs("label",{className:"flex min-h-10 min-w-0 flex-1 cursor-pointer items-center gap-2 px-2 text-xs",children:[t.jsx("input",{type:"checkbox",checked:be||_,disabled:i||_,onChange:()=>M(be?a.filter(ae=>ae!==Y&&ae!==H):[...a,Y]),className:"h-4 w-4 shrink-0 accent-[var(--primary)] disabled:opacity-40"}),t.jsx(o,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"truncate",title:I.name,children:I.name})]}),I.type==="directory"&&t.jsx("button",{type:"button",disabled:i,onClick:()=>D(H),"aria-label":f("rightSidebar.gitIgnoreExceptionsOpenDirectory",{name:I.name}),className:"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface hover:text-foreground disabled:opacity-40",children:t.jsx(ds,{size:15})})]},I.name)}):t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(lt,{size:18})}),te&&x.truncated&&t.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:f("rightSidebar.gitIgnoreExceptionsTruncated")})]})]}),t.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[t.jsx("span",{className:"font-medium",children:f("rightSidebar.gitIgnoreExceptionsSelected",{count:a.length})}),t.jsx("button",{type:"button",disabled:i||a.length===0,onClick:()=>M([]),className:"rounded-md px-2 py-1 text-muted-foreground hover:bg-surface-2 hover:text-foreground disabled:opacity-40",children:f("rightSidebar.gitIgnoreExceptionsClear")})]}),a.length>0&&t.jsx("ul",{className:"max-h-24 overflow-y-auto overscroll-contain",children:a.map(I=>t.jsxs("li",{className:"flex items-center gap-2 rounded-md pl-2 text-xs hover:bg-surface-2",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate font-mono",title:I,children:I}),t.jsx("button",{type:"button",disabled:i,onClick:()=>M(a.filter(H=>H!==I)),"aria-label":f("rightSidebar.gitIgnoreExceptionsRemove",{path:I}),className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface-elevated hover:text-foreground disabled:opacity-40",children:t.jsx(Xt,{size:13})})]},I))}),A&&t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:f("rightSidebar.gitIgnoreExceptionsInvalid")})]})}function Wp({rootPath:r,disabled:a,pressed:i,saving:c,onToggle:f}){const{t:p}=_t(),g=n.useId(),k=n.useRef(null),m=n.useRef(null),x=n.useRef(null),w=n.useRef(null),R=n.useRef(!1),[b,A]=n.useState(!1),[P,$]=n.useState([]),[D,te]=n.useState(!1),[M,I]=n.useState(null),H=U(W=>W.setGitIgnoreExceptions),Y=()=>{x.current!==null&&clearTimeout(x.current),x.current=null,w.current=null},be=()=>{Y(),!(a||D||!r)&&($([...U.getState().gitIgnoreExceptions[r]??[]]),I(null),A(!0))},_=()=>{D||A(!1)},o=W=>{Y(),R.current=!1,!(W.button!==0||!W.isPrimary||a)&&(W.currentTarget.setPointerCapture(W.pointerId),w.current={x:W.clientX,y:W.clientY},x.current=setTimeout(()=>{R.current=!0,be()},450))};n.useEffect(()=>(A(!1),Y(),Y),[r]),n.useEffect(()=>{if(b)return m.current?.focus(),()=>k.current?.focus()},[b]);const ae=p(i?"rightSidebar.showGitIgnoredFiles":"rightSidebar.hideGitIgnoredFiles");return t.jsxs(t.Fragment,{children:[t.jsx("button",{ref:k,type:"button",disabled:a||D,"aria-pressed":i,"aria-label":ae,"aria-description":p("rightSidebar.gitIgnoreConfigureHint"),title:`${ae} · ${p("rightSidebar.gitIgnoreConfigureHint")}`,onClick:W=>{if(R.current&&W.detail!==0){R.current=!1,W.preventDefault();return}f()},onContextMenu:W=>{W.preventDefault(),R.current=!0,b||be()},onPointerDown:o,onPointerMove:W=>{const he=w.current;he&&Math.hypot(W.clientX-he.x,W.clientY-he.y)>10&&Y()},onPointerUp:Y,onPointerCancel:Y,onLostPointerCapture:Y,className:`inline-flex h-7 w-7 shrink-0 select-none items-center justify-center rounded-md transition active:scale-95 disabled:cursor-not-allowed disabled:opacity-35 [-webkit-touch-callout:none] ${i?"bg-surface-2 text-primary hover:bg-surface-elevated":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,children:c?t.jsx(lt,{size:14}):t.jsx(Lp,{size:14})}),b&&Qr.createPortal(t.jsx("div",{className:"fixed inset-0 z-modal-backdrop flex items-center justify-center bg-[var(--app-backdrop)] p-3 backdrop-blur-sm",onClick:_,children:t.jsxs("form",{ref:m,role:"dialog",tabIndex:-1,"aria-modal":"true","aria-labelledby":`${g}-title`,"aria-describedby":`${g}-hint`,className:"relative z-modal-panel flex max-h-[80dvh] w-full max-w-lg flex-col gap-3 overflow-y-auto rounded-xl border border-border/20 bg-surface p-4 text-foreground shadow-2xl",onClick:W=>W.stopPropagation(),onKeyDown:W=>{if(W.key==="Escape"&&(W.preventDefault(),W.stopPropagation(),_()),W.key==="Tab"){const he=Array.from(m.current?.querySelectorAll("button:not(:disabled), input:not(:disabled)")??[]);if(!he.length){W.preventDefault(),m.current?.focus();return}const G=he[0],le=he[he.length-1];W.shiftKey&&document.activeElement===G&&(W.preventDefault(),le?.focus()),document.activeElement===m.current?(W.preventDefault(),(W.shiftKey?le:G)?.focus()):!W.shiftKey&&document.activeElement===le&&(W.preventDefault(),G?.focus())}},onSubmit:W=>{if(W.preventDefault(),!(!r||D)){if(P.length>200){I(p("rightSidebar.gitIgnoreExceptionsInvalid"));return}te(!0),I(null),H(r,P).then(()=>A(!1)).catch(()=>I(p("rightSidebar.gitIgnoreExceptionsSaveFailed"))).finally(()=>te(!1))}},children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("h2",{id:`${g}-title`,className:"text-sm font-medium",children:p("rightSidebar.gitIgnoreExceptionsTitle")}),t.jsx("button",{type:"button",disabled:D,onClick:_,"aria-label":p("common.close"),className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface-2 hover:text-foreground disabled:opacity-40",children:t.jsx(Xt,{size:16})})]}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",title:r??void 0,children:r}),t.jsx("p",{id:`${g}-hint`,className:"text-xs leading-relaxed text-muted-foreground",children:p("rightSidebar.gitIgnoreExceptionsHint")}),t.jsx("p",{className:"text-xs font-medium",children:p("rightSidebar.gitIgnoreExceptionsPaths")}),r&&t.jsx(Gp,{rootPath:r,paths:P,onChange:$,disabled:D}),M&&t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:M}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx("button",{type:"button",disabled:D,onClick:_,className:"rounded-lg px-3 py-2 text-xs text-muted-foreground hover:bg-surface-2 disabled:opacity-40",children:p("common.cancel")}),t.jsxs("button",{type:"submit",disabled:D,className:"inline-flex items-center gap-2 rounded-lg bg-primary px-3 py-2 text-xs font-medium text-primary-foreground disabled:opacity-50",children:[D&&t.jsx(lt,{size:13}),p("common.save")]})]})]})}),document.body)]})}function qp(r,a,i){try{const c=r instanceof HTMLImageElement?r.naturalWidth:r.width,f=r instanceof HTMLImageElement?r.naturalHeight:r.height;if(!c||!f)return Promise.resolve(null);const p=r instanceof HTMLImageElement?1400/Math.max(c,f):Math.min(1,1400/Math.max(c,f)),g=document.createElement("canvas");g.width=Math.max(1,Math.round(c*p)),g.height=Math.max(1,Math.round(f*p));const k=g.getContext("2d");if(!k)return Promise.resolve(null);const m=getComputedStyle(document.documentElement);if(k.fillStyle=m.getPropertyValue("--surface").trim()||"white",k.fillRect(0,0,g.width,g.height),k.drawImage(r,0,0,g.width,g.height),i){const x=Math.max(10,Math.min(16,g.width/35));k.font=`${x}px sans-serif`;const w=[];let R="";for(const b of i.split(" "))R&&k.measureText(`${R} ${b}`).width>g.width-20?(w.push(R),R=b):R=R?`${R} ${b}`:b;R&&w.push(R),k.fillStyle=m.getPropertyValue("--surface").trim()||"white",k.fillRect(0,0,g.width,w.length*(x+4)+12),k.fillStyle=m.getPropertyValue("--foreground").trim()||"black",w.forEach((b,A)=>k.fillText(b,10,8+x+A*(x+4)))}if(a){const x=a.xPercent*g.width/100,w=a.yPercent*g.height/100,R=Math.max(4,Math.min(12,Math.min(g.width,g.height)*.015)),b=R*1.6;k.strokeStyle=m.getPropertyValue("--primary").trim()||"black",k.lineWidth=Math.max(1,R/3),k.beginPath(),k.arc(x,w,R,0,Math.PI*2),k.stroke(),k.beginPath(),k.moveTo(x-b,w),k.lineTo(x+b,w),k.moveTo(x,w-b),k.lineTo(x,w+b),k.stroke()}return new Promise(x=>g.toBlob(x,"image/png"))}catch{return Promise.resolve(null)}}function Kp(r,a,i,c){return[r.trim(),a.trim(),c?`截图:${c}`:""].filter(Boolean).join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ModelPreview-DjtHLlqP.js","assets/app-DuUnqxq-.js","assets/react-XDCjal2T.js","assets/dnd-BCFAPC0L.js","assets/terminal-Dea8wJF3.js","assets/index-nIgxJ6I3.css","assets/search-Dg6HWygj.js","assets/sun-BAMMjiA8.js","assets/list-tree-C281zrdg.js","assets/AndroidMirrorView-DW9oRr0w.js","assets/v4-EwEgHOG0.js","assets/RecordingSaveDialog-DUtwgIME.js","assets/use-gesture-react.esm-DYpdiE_k.js","assets/gestureArbiter-DszagC-d.js","assets/arrow-up-DNkfesW0.js","assets/unplug-DN2SNXUL.js","assets/circle-DGZOpG8V.js","assets/quote-COQfrXhi.js","assets/MarkdownPreview-CsJGsDRL.js","assets/swiper-DJjq1TYT.js","assets/swiper-C2J0D0kV.css","assets/syntaxHighlight-Cz6TPDW9.js","assets/GitLoadingSkeleton-DYrDIDF1.js","assets/DiffReview-12E2zWyL.js","assets/DiffViewer-DqcQxp4Q.js","assets/git-compare-90v75Jal.js","assets/DiffViewer-T3uj2-aP.css","assets/triangle-alert-Oj-OsZDw.js","assets/ChangeWalkthroughPanel-DO_zJfZr.js","assets/chevron-left-xqARwD-7.js","assets/maximize-2-CovPxWdw.js","assets/loader-circle-Df0zpx5N.js","assets/arrow-down-FGzRy9D-.js","assets/ArchitecturePanel-Bf4b-6An.js","assets/link-Cq14tNBm.js","assets/purify.es-4eNOHKSq.js","assets/ArchitecturePanel-B_BDrrfR.css","assets/ComputerControlView-DjQLzn10.js","assets/clipboard-rLx5CzbY.js","assets/settings-2-iGqzPez0.js"])))=>i.map(i=>d[i]);
2
+ import{aV as Jr,ea as _t,cg as t,n as po,cq as Qd,r as Gi,u as lt,F as eh,h as ds,a4 as Xt,ej as U,V as sa,eq as Pt,cG as ct,c as mo,bK as Zd,C as go,g as aa,_ as co,e5 as Zs,e6 as Wi,$ as Zc,d1 as eu,dT as th,dq as rh,b5 as nh,L as bo,R as uo,c0 as sh,as as Ws,be as ah,ed as tu,c8 as oh,ca as ih,cb as lh,cc as ch,c9 as qs,bu as dh,E as uh,w as fh,c4 as hh,cI as ph,cL as mh,cM as gh,bX as bh,cJ as ed,ar as yt,ak as ru,am as xh,p as qi,k as vh,m as yh,v as Ri,al as wh,e8 as ji,bW as td,bo as rd,bk as kh,by as Ci,bz as nd,er as ra,bb as Ks,bA as Sh,cw as Rh,dQ as sd,br as jh,e3 as Ch,at as Ni,de as Nh,ek as Yr,d5 as An,an as Ph,ao as ad,bD as Eh,aB as od,aA as Ah,bl as id,bq as Th,bw as ld,dh as Mh,ad as cd,j as dd,I as Pi,H as ro,b as Lh,y as ud,U as fd,t as Ih,q as hd,ap as $h,a5 as sl,d6 as Fh,eo as Dh,J as _h}from"./app-DuUnqxq-.js";import{u as Bh,j as Ei,Z as Uh,a as nu,F as Oh,M as Hh,_ as zh,c as Gh,d as Wh,e as qh,g as Kh,f as Vh,h as Yh,r as Xh,s as Jh}from"./MarkdownPreview-CsJGsDRL.js";import{b as n,r as Qr}from"./dnd-BCFAPC0L.js";import{b as Qh,a as Zh,P as ep,d as tp,c as rp,N as pd,S as np,C as sp,G as ap,A as op}from"./GitLoadingSkeleton-DYrDIDF1.js";import{S as ip,a as md}from"./swiper-DJjq1TYT.js";import{S as lp,U as cp}from"./RecordingSaveDialog-DUtwgIME.js";import{A as al}from"./arrow-up-DNkfesW0.js";import{D as Ki,C as na,f as dp,n as up}from"./DiffReview-12E2zWyL.js";import{T as fp,G as br}from"./triangle-alert-Oj-OsZDw.js";import{C as su,M as au}from"./ChangeWalkthroughPanel-DO_zJfZr.js";import{R as ou,S as gd,V as hp,d as pp,M as mp,A as Ai,u as gp,f as bp,i as bd,H as xd,b as xp}from"./AndroidMirrorView-DW9oRr0w.js";import{u as vp}from"./DiffViewer-DqcQxp4Q.js";import{r as yp,s as wp,l as kp,a as vd,g as Vi,b as Sp,h as Rp}from"./syntaxHighlight-Cz6TPDW9.js";import{L as yd}from"./loader-circle-Df0zpx5N.js";import{a as wd,S as kd}from"./gestureArbiter-DszagC-d.js";import{M as iu}from"./maximize-2-CovPxWdw.js";import{L as jp}from"./list-tree-C281zrdg.js";import{S as us}from"./search-Dg6HWygj.js";import{A as Cp}from"./arrow-down-FGzRy9D-.js";import{G as lu}from"./git-compare-90v75Jal.js";const Np=[["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"}]],Pp=Jr("case-sensitive",Np);const Ep=[["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"}]],Ap=Jr("eye-off",Ep);const Tp=[["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"}]],Yi=Jr("eye",Tp);const Mp=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Lp=Jr("funnel",Mp);const Ip=[["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"}]],$p=Jr("image-plus",Ip);const Fp=[["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"}]],Dp=Jr("regex",Fp);const _p=[["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"}]],Bp=Jr("scan",_p);const Up=[["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"}]],Op=Jr("whole-word",Up);function Sd({children:r,actions:a}){const{t:i}=_t(),[c,f]=n.useState(!1),p=n.useId(),g=n.useRef(null),k=n.useRef(null),m=()=>{f(!1),g.current?.focus({preventScroll:!0})};return n.useLayoutEffect(()=>{if(!c)return;const x=g.current,w=k.current;if(!x||!w)return;const R=window.visualViewport,b=()=>{const P=x.getBoundingClientRect(),$=(R?.offsetLeft??0)+8,D=(R?.offsetTop??0)+8,te=Math.max(0,(R?.width??window.innerWidth)-16),M=D+(R?.height??window.innerHeight)-16,I=Math.min(240,te),H=Math.max(0,P.top-D-6),Y=Math.max(0,M-P.bottom-6),be=w.scrollHeight>Y&&H>Y;Object.assign(w.style,{width:`${I}px`,left:`${Math.max($,Math.min(P.right-I,$+te-I))}px`,top:`${be?P.top-6:P.bottom+6}px`,maxHeight:`${be?H:Y}px`,transform:be?"translateY(-100%)":"none"})};b();const A=typeof ResizeObserver>"u"?null:new ResizeObserver(b);return A?.observe(x),A?.observe(w),window.addEventListener("resize",b),window.addEventListener("scroll",b,!0),R?.addEventListener("resize",b),R?.addEventListener("scroll",b),()=>{A?.disconnect(),window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0),R?.removeEventListener("resize",b),R?.removeEventListener("scroll",b)}},[c]),n.useEffect(()=>{if(!c)return;k.current?.querySelector("button:not(:disabled)")?.focus({preventScroll:!0});const x=w=>{w.target instanceof Node&&!g.current?.contains(w.target)&&!k.current?.contains(w.target)&&f(!1)};return document.addEventListener("pointerdown",x),()=>document.removeEventListener("pointerdown",x)},[c]),t.jsxs("div",{className:"mt-2",children:[t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[r,t.jsxs("button",{ref:g,type:"button","aria-haspopup":"menu","aria-expanded":c,"aria-controls":c?p:void 0,onClick:()=>f(x=>!x),onKeyDown:x=>{(x.key==="ArrowDown"||x.key==="ArrowUp")&&(x.preventDefault(),f(!0))},className:`ml-auto inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md px-2 text-[11px] font-medium transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary ${c?"bg-surface-2 text-foreground":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,children:[t.jsx(po,{size:14}),i("sidebar.moreActions")]})]}),typeof document<"u"&&Qr.createPortal(t.jsx("div",{ref:k,id:p,hidden:!c,role:"menu","data-sidebar-gesture-ignore":!0,"aria-label":i("sidebar.moreActions"),className:"fixed z-menu-panel overflow-y-auto overscroll-contain rounded-lg border border-border/30 bg-surface p-1 shadow-[0_8px_24px_var(--app-shadow-soft)]",onKeyDown:x=>{if(!x.currentTarget.contains(x.target))return;const w=[...x.currentTarget.querySelectorAll("button:not(:disabled)")],R=w.indexOf(document.activeElement);let b;if(x.key==="Escape"){x.preventDefault(),x.stopPropagation(),m();return}if(x.key==="Tab"){m();return}if(x.key==="ArrowDown")b=(R+1)%w.length;else if(x.key==="ArrowUp")b=(R-1+w.length)%w.length;else if(x.key==="Home")b=0;else if(x.key==="End")b=w.length-1;else return;x.preventDefault(),w[b]?.focus({preventScroll:!0})},children:a(m)}),document.body)]})}const Ti="a[href],button,input,select,textarea,[tabindex],[contenteditable],iframe,summary,audio[controls],video[controls]",is=n.memo(function({active:a,mounted:i=!0,fallback:c=null,children:f}){const p=n.useRef(null);return n.useLayoutEffect(()=>{const g=p.current;if(!g||a)return;const k=new Map,m=R=>{k.has(R)||(k.set(R,R.inert),R.inert=!0)},x=R=>{R instanceof HTMLElement&&R.matches(Ti)&&m(R),R.querySelectorAll(Ti).forEach(m)};x(g);const w=new MutationObserver(R=>{for(const b of R)b.type==="attributes"?b.target instanceof HTMLElement&&b.target.matches(Ti)&&m(b.target):b.addedNodes.forEach(A=>{A instanceof Element&&x(A)})});return w.observe(g,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabindex","href","contenteditable","controls"]}),()=>{w.disconnect();for(const[R,b]of k)R.inert=b}},[a,i]),t.jsx("div",{ref:p,className:"absolute inset-0 min-h-0 overflow-hidden bg-surface text-foreground",style:a?void 0:{clipPath:"inset(100%)"},"aria-hidden":!a,children:i?typeof f=="function"?f():f:c})},(r,a)=>!r.active&&!a.active&&r.mounted===a.mounted);async function Hp(r){let a;try{await Promise.race([r(),new Promise(i=>{a=setTimeout(i,3e3)})])}catch{}finally{clearTimeout(a)}}function zp({active:r,rootPath:a,loading:i,delay:c,lastStartedRoot:f,load:p}){n.useEffect(()=>{if(!r||!a||i||f.current===a)return;const g=window.setTimeout(()=>{f.current=a,p(a)},c);return()=>window.clearTimeout(g)},[r,a,i,c,f,p])}function Gp({rootPath:r,paths:a,disabled:i,onChange:c}){const{t:f}=_t(),[p,g]=n.useState(""),[k,m]=n.useState(0),[x,w]=n.useState(null),[R,b]=n.useState(!1),[A,P]=n.useState(!1),$=`${r.replace(/[\\/]+$/,"")}/${p}`;n.useEffect(()=>{const I=new AbortController;return w(null),b(!1),Qd($,I.signal,!0,"pick_git_ignore_exception").then(H=>{I.signal.aborted||w({directory:p,entries:H.entries,truncated:!!H.truncated})}).catch(()=>{I.signal.aborted||b(!0)}),()=>I.abort()},[$,p,k]);const D=I=>{w(null),b(!1),g(I)},te=x?.directory===p,M=I=>{if(I.length>200){P(!0);return}P(!1),c(I)};return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"overflow-hidden rounded-lg border border-border/30 bg-surface-2",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 p-2",children:[t.jsx("button",{type:"button",disabled:i||!p,onClick:()=>D(p.slice(0,Math.max(0,p.lastIndexOf("/")))),"aria-label":f("rightSidebar.parentFolder"),className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface-elevated hover:text-foreground disabled:opacity-30",children:t.jsx(al,{size:14})}),t.jsx("button",{type:"button",disabled:i||!p,onClick:()=>D(""),"aria-label":f("rightSidebar.backToProjectRoot"),className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface-elevated hover:text-foreground disabled:opacity-30",children:t.jsx(Gi,{size:14})}),t.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",title:$,children:p||"./"})]}),t.jsxs("div",{className:"h-56 overflow-y-auto overscroll-contain p-1",role:"group","aria-label":f("rightSidebar.gitIgnoreExceptionsPaths"),"aria-busy":!te&&!R,children:[R?t.jsxs("div",{className:"flex flex-col items-center gap-2 p-4 text-center text-xs",children:[t.jsx("p",{role:"alert",className:"text-destructive",children:f("rightSidebar.gitIgnoreExceptionsLoadFailed")}),t.jsx("button",{type:"button",disabled:i,onClick:()=>{b(!1),m(I=>I+1)},className:"rounded-md px-3 py-2 text-primary hover:bg-surface-elevated disabled:opacity-40",children:f("common.retry")})]}):te?x.entries.length===0?t.jsx("p",{className:"p-4 text-center text-xs text-muted-foreground",children:f("rightSidebar.gitIgnoreExceptionsEmptyDirectory")}):x.entries.map(I=>{const H=p?`${p}/${I.name}`:I.name,Y=H+(I.type==="directory"?"/":""),be=a.includes(Y)||a.includes(H),_=a.some(ae=>ae.endsWith("/")&&H.startsWith(ae)),o=I.type==="directory"?Gi:eh;return t.jsxs("div",{className:"flex items-center gap-1 rounded-md hover:bg-surface-elevated",children:[t.jsxs("label",{className:"flex min-h-10 min-w-0 flex-1 cursor-pointer items-center gap-2 px-2 text-xs",children:[t.jsx("input",{type:"checkbox",checked:be||_,disabled:i||_,onChange:()=>M(be?a.filter(ae=>ae!==Y&&ae!==H):[...a,Y]),className:"h-4 w-4 shrink-0 accent-[var(--primary)] disabled:opacity-40"}),t.jsx(o,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"truncate",title:I.name,children:I.name})]}),I.type==="directory"&&t.jsx("button",{type:"button",disabled:i,onClick:()=>D(H),"aria-label":f("rightSidebar.gitIgnoreExceptionsOpenDirectory",{name:I.name}),className:"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface hover:text-foreground disabled:opacity-40",children:t.jsx(ds,{size:15})})]},I.name)}):t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(lt,{size:18})}),te&&x.truncated&&t.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:f("rightSidebar.gitIgnoreExceptionsTruncated")})]})]}),t.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[t.jsx("span",{className:"font-medium",children:f("rightSidebar.gitIgnoreExceptionsSelected",{count:a.length})}),t.jsx("button",{type:"button",disabled:i||a.length===0,onClick:()=>M([]),className:"rounded-md px-2 py-1 text-muted-foreground hover:bg-surface-2 hover:text-foreground disabled:opacity-40",children:f("rightSidebar.gitIgnoreExceptionsClear")})]}),a.length>0&&t.jsx("ul",{className:"max-h-24 overflow-y-auto overscroll-contain",children:a.map(I=>t.jsxs("li",{className:"flex items-center gap-2 rounded-md pl-2 text-xs hover:bg-surface-2",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate font-mono",title:I,children:I}),t.jsx("button",{type:"button",disabled:i,onClick:()=>M(a.filter(H=>H!==I)),"aria-label":f("rightSidebar.gitIgnoreExceptionsRemove",{path:I}),className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface-elevated hover:text-foreground disabled:opacity-40",children:t.jsx(Xt,{size:13})})]},I))}),A&&t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:f("rightSidebar.gitIgnoreExceptionsInvalid")})]})}function Wp({rootPath:r,disabled:a,pressed:i,saving:c,onToggle:f}){const{t:p}=_t(),g=n.useId(),k=n.useRef(null),m=n.useRef(null),x=n.useRef(null),w=n.useRef(null),R=n.useRef(!1),[b,A]=n.useState(!1),[P,$]=n.useState([]),[D,te]=n.useState(!1),[M,I]=n.useState(null),H=U(W=>W.setGitIgnoreExceptions),Y=()=>{x.current!==null&&clearTimeout(x.current),x.current=null,w.current=null},be=()=>{Y(),!(a||D||!r)&&($([...U.getState().gitIgnoreExceptions[r]??[]]),I(null),A(!0))},_=()=>{D||A(!1)},o=W=>{Y(),R.current=!1,!(W.button!==0||!W.isPrimary||a)&&(W.currentTarget.setPointerCapture(W.pointerId),w.current={x:W.clientX,y:W.clientY},x.current=setTimeout(()=>{R.current=!0,be()},450))};n.useEffect(()=>(A(!1),Y(),Y),[r]),n.useEffect(()=>{if(b)return m.current?.focus(),()=>k.current?.focus()},[b]);const ae=p(i?"rightSidebar.showGitIgnoredFiles":"rightSidebar.hideGitIgnoredFiles");return t.jsxs(t.Fragment,{children:[t.jsx("button",{ref:k,type:"button",disabled:a||D,"aria-pressed":i,"aria-label":ae,"aria-description":p("rightSidebar.gitIgnoreConfigureHint"),title:`${ae} · ${p("rightSidebar.gitIgnoreConfigureHint")}`,onClick:W=>{if(R.current&&W.detail!==0){R.current=!1,W.preventDefault();return}f()},onContextMenu:W=>{W.preventDefault(),R.current=!0,b||be()},onPointerDown:o,onPointerMove:W=>{const he=w.current;he&&Math.hypot(W.clientX-he.x,W.clientY-he.y)>10&&Y()},onPointerUp:Y,onPointerCancel:Y,onLostPointerCapture:Y,className:`inline-flex h-7 w-7 shrink-0 select-none items-center justify-center rounded-md transition active:scale-95 disabled:cursor-not-allowed disabled:opacity-35 [-webkit-touch-callout:none] ${i?"bg-surface-2 text-primary hover:bg-surface-elevated":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,children:c?t.jsx(lt,{size:14}):t.jsx(Lp,{size:14})}),b&&Qr.createPortal(t.jsx("div",{className:"fixed inset-0 z-modal-backdrop flex items-center justify-center bg-[var(--app-backdrop)] p-3 backdrop-blur-sm",onClick:_,children:t.jsxs("form",{ref:m,role:"dialog",tabIndex:-1,"aria-modal":"true","aria-labelledby":`${g}-title`,"aria-describedby":`${g}-hint`,className:"relative z-modal-panel flex max-h-[80dvh] w-full max-w-lg flex-col gap-3 overflow-y-auto rounded-xl border border-border/20 bg-surface p-4 text-foreground shadow-2xl",onClick:W=>W.stopPropagation(),onKeyDown:W=>{if(W.key==="Escape"&&(W.preventDefault(),W.stopPropagation(),_()),W.key==="Tab"){const he=Array.from(m.current?.querySelectorAll("button:not(:disabled), input:not(:disabled)")??[]);if(!he.length){W.preventDefault(),m.current?.focus();return}const G=he[0],le=he[he.length-1];W.shiftKey&&document.activeElement===G&&(W.preventDefault(),le?.focus()),document.activeElement===m.current?(W.preventDefault(),(W.shiftKey?le:G)?.focus()):!W.shiftKey&&document.activeElement===le&&(W.preventDefault(),G?.focus())}},onSubmit:W=>{if(W.preventDefault(),!(!r||D)){if(P.length>200){I(p("rightSidebar.gitIgnoreExceptionsInvalid"));return}te(!0),I(null),H(r,P).then(()=>A(!1)).catch(()=>I(p("rightSidebar.gitIgnoreExceptionsSaveFailed"))).finally(()=>te(!1))}},children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("h2",{id:`${g}-title`,className:"text-sm font-medium",children:p("rightSidebar.gitIgnoreExceptionsTitle")}),t.jsx("button",{type:"button",disabled:D,onClick:_,"aria-label":p("common.close"),className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-surface-2 hover:text-foreground disabled:opacity-40",children:t.jsx(Xt,{size:16})})]}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",title:r??void 0,children:r}),t.jsx("p",{id:`${g}-hint`,className:"text-xs leading-relaxed text-muted-foreground",children:p("rightSidebar.gitIgnoreExceptionsHint")}),t.jsx("p",{className:"text-xs font-medium",children:p("rightSidebar.gitIgnoreExceptionsPaths")}),r&&t.jsx(Gp,{rootPath:r,paths:P,onChange:$,disabled:D}),M&&t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:M}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx("button",{type:"button",disabled:D,onClick:_,className:"rounded-lg px-3 py-2 text-xs text-muted-foreground hover:bg-surface-2 disabled:opacity-40",children:p("common.cancel")}),t.jsxs("button",{type:"submit",disabled:D,className:"inline-flex items-center gap-2 rounded-lg bg-primary px-3 py-2 text-xs font-medium text-primary-foreground disabled:opacity-50",children:[D&&t.jsx(lt,{size:13}),p("common.save")]})]})]})}),document.body)]})}function qp(r,a,i){try{const c=r instanceof HTMLImageElement?r.naturalWidth:r.width,f=r instanceof HTMLImageElement?r.naturalHeight:r.height;if(!c||!f)return Promise.resolve(null);const p=r instanceof HTMLImageElement?1400/Math.max(c,f):Math.min(1,1400/Math.max(c,f)),g=document.createElement("canvas");g.width=Math.max(1,Math.round(c*p)),g.height=Math.max(1,Math.round(f*p));const k=g.getContext("2d");if(!k)return Promise.resolve(null);const m=getComputedStyle(document.documentElement);if(k.fillStyle=m.getPropertyValue("--surface").trim()||"white",k.fillRect(0,0,g.width,g.height),k.drawImage(r,0,0,g.width,g.height),i){const x=Math.max(10,Math.min(16,g.width/35));k.font=`${x}px sans-serif`;const w=[];let R="";for(const b of i.split(" "))R&&k.measureText(`${R} ${b}`).width>g.width-20?(w.push(R),R=b):R=R?`${R} ${b}`:b;R&&w.push(R),k.fillStyle=m.getPropertyValue("--surface").trim()||"white",k.fillRect(0,0,g.width,w.length*(x+4)+12),k.fillStyle=m.getPropertyValue("--foreground").trim()||"black",w.forEach((b,A)=>k.fillText(b,10,8+x+A*(x+4)))}if(a){const x=a.xPercent*g.width/100,w=a.yPercent*g.height/100,R=Math.max(4,Math.min(12,Math.min(g.width,g.height)*.015)),b=R*1.6;k.strokeStyle=m.getPropertyValue("--primary").trim()||"black",k.lineWidth=Math.max(1,R/3),k.beginPath(),k.arc(x,w,R,0,Math.PI*2),k.stroke(),k.beginPath(),k.moveTo(x-b,w),k.lineTo(x+b,w),k.moveTo(x,w-b),k.lineTo(x,w+b),k.stroke()}return new Promise(x=>g.toBlob(x,"image/png"))}catch{return Promise.resolve(null)}}function Kp(r,a,i,c){return[r.trim(),a.trim(),c?`截图:${c}`:""].filter(Boolean).join(`
3
3
  `)}function Eb(r,a,i){const c=a*Math.PI/360,f=Math.min(c,Math.atan(Math.tan(c)*Math.max(i,.05)));return Math.max(r,1e-6)/Math.sin(f)*1.15}async function Vp(r,a,i,c){if(!i?.snapshot)return c.isCurrent()?await c.insert(r,a):!1;const f=new Date().toISOString(),p=new AbortController;let g,k;try{k=await Promise.race([(async()=>{const m=await i.snapshot;if(!(!m||p.signal.aborted||!c.isCurrent()))return c.upload(new File([m],`termdock-review-${crypto.randomUUID()}.png`,{type:"image/png"}),p.signal)})(),new Promise(m=>{g=setTimeout(()=>{p.abort(),m(void 0)},3e3)})])}catch{}finally{clearTimeout(g),p.abort()}return c.isCurrent()?await c.insert(k?Kp(r,"",f,k):r,a):!1}function Yp(r,a){return r===a||a.endsWith(`/${r}`)||r.endsWith(`/${a}`)}function Rd(r,a){return`${r??""}\0${a}`}function Xp(r,a,i){if(!r||r.length===0||!i)return{explained:0,stale:0};const c=Rd(a,i);let f=0,p=0;for(const g of r){const k=[g.filePath,g.newPath,g.oldPath].filter(x=>typeof x=="string"&&x.length>0);(k.some(x=>Rd(g.repoRoot,x)===c)||k.some(x=>Yp(x,i)))&&(f+=1)}return{explained:f,stale:p}}function Jp({status:r}){if(!r)return null;const a=r.stale>0&&r.explained===0;if(!(r.explained>0||r.stale>0))return null;const c=a?"AI audit explanation is stale":"AI audit explanation available";return t.jsx("span",{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full ${a?"bg-[color:var(--warning)]/15 text-[color:var(--warning)]":"bg-accent/10 text-accent"}`,title:c,"aria-label":c,children:a?t.jsx(fp,{size:10}):t.jsx(sa,{size:10})})}function Xi({changeStatus:r,auditStatus:a,renderChangeBadge:i}){return t.jsxs("span",{className:"inline-flex items-center gap-1",children:[i(r),t.jsx(Jp,{status:a})]})}const cu="termdock:right-sidebar:diff-change-list-mode:v1";function Qp(r){return r==="list"||r==="tree"}function Zp(){return ct(cu,Qp)??"tree"}function em(r){for(const a of r){const i=a.hunk;if(i.oldPath&&i.newPath&&i.oldPath!==i.newPath)return"renamed";if(i.oldPath===null&&i.newPath)return"added";if(i.oldPath&&i.newPath===null)return"deleted"}return"modified"}function tm(r){const a=new Map;for(const c of r){const f=a.get(c.hunk.filePath)??{key:c.hunk.filePath,filePath:c.hunk.filePath,items:[],additions:0,deletions:0,explained:0,stale:0,changeType:"modified"};f.items.push(c),f.additions+=c.hunk.additions,f.deletions+=c.hunk.deletions,c.current&&(f.explained+=1),c.stale&&(f.stale+=1),a.set(c.hunk.filePath,f)}const i=Array.from(a.values()).sort((c,f)=>c.filePath.localeCompare(f.filePath));for(const c of i)c.changeType=em(c.items);return i}function rm(r){const a=r.filePath.split("/").pop()??r.filePath;return{key:r.key,path:r.filePath,displayName:a,displayDir:r.filePath.includes("/")?r.filePath.slice(0,-a.length-1):"",status:r.changeType,title:r.filePath}}function nm(r,a){const i=r.filter(p=>p.trim().length>0);if(i.length<=1)return i[0]??"";const c=[],f=new Set;for(const[p,g]of i.entries()){const k=g.split(`
4
4
  `),m=k.findIndex(R=>R.startsWith("@@ "));if(m<0){c.push(...k);continue}p===0&&c.push(...k.slice(0,m));const x=a[p];let w=m;for(;w>=0&&w<k.length;){const R=k.findIndex((te,M)=>M>w&&te.startsWith("@@ ")),b=R>=0?R:k.length,A=k.slice(w,b),P=A[0]??"",$=x?P===x:!0,D=P||x||A.join(`
5
5
  `);$&&!f.has(D)&&(c.push(...A),f.add(D)),w=R}}return c.join(`
@@ -1635,7 +1635,7 @@ function installPreviewRuntime(capability, base, externalOrigins, shimUrl) {
1635
1635
  `,ao="/api/terminal/fs/preview/",Vm=8*1024*1024,Ym=32*1024*1024,Xm=128,Jm="data:,";function Nt(r){throw new Error(r)}function Qm(r){return JSON.stringify(r).replace(/</g,"\\u003c")}async function Ad(r,a,i){let c="",f=0;for(const p of r.matchAll(a))c+=r.slice(f,p.index)+await i(p),f=p.index+p[0].length;return c+r.slice(f)}async function pu(r,a){const i=a.origin??location.origin,c=new URL(r,i);(c.origin!==i||!Ws(c.pathname)?.startsWith(ao))&&Nt("预览地址不是有效的本地文件入口");const f=crypto.randomUUID(),p=`https://termdock-preview.invalid/${f}/`,g=[],k=F=>{!g.includes(F)&&g.length<20&&g.push(F)},m=new Set,x=[],w=new Set,R=new Map,b=new Map;let A=0,P=!1;const $=new Set,D=()=>{P=!0;for(const F of[...$])F();m.clear(),x.length=0};async function te(F){F.ok||Nt(`预览资源读取失败(${F.status})`);const ee=F.body?.getReader(),C=[];let L=0;try{if(ee)for(;;){const pe=await ee.read();if(pe.done)break;L+=pe.value.byteLength,A+=pe.value.byteLength,(L>Vm||A>Ym)&&Nt("预览资源超出大小限制"),C.push(pe.value)}}catch(pe){throw await ee?.cancel().catch(()=>{}),pe}finally{ee?.releaseLock()}const q=new Uint8Array(L);let ne=0;for(const pe of C)q.set(pe,ne),ne+=pe.length;return{bytes:q,type:F.headers.get("content-type")??"application/octet-stream",status:F.status}}let M=c,I;for(let F=0;F<4;F++){const ee=await a.fetch(M.pathname+M.search,{signal:a.signal,redirect:"manual"});if(![301,302,303,307,308].includes(ee.status)){I=ee;break}const C=ee.headers.get("location");await ee.body?.cancel(),C||Nt("预览重定向缺少目标");const L=new URL(C,M);(L.origin!==i||!Ws(L.pathname)?.startsWith(ao))&&Nt("预览重定向越出文件范围"),M=L}I||Nt("预览重定向次数过多");const H=Ws(M.pathname),Y=H.slice(ao.length).split("/");/^[a-f0-9]{32}$/.test(Y[0])||Nt("服务未提供有效的预览资源授权");const be=Ws(c.pathname).slice(ao.length).split("/");/^[a-f0-9]{32}$/.test(be[0])&&be.shift(),be.join("/").replace(/\/$/,"")!==Y.slice(1).join("/").replace(/\/$/,"")&&Nt("预览重定向改变了文件范围");const _=H.endsWith("/")?H:H.slice(0,H.lastIndexOf("/")+1),o=new URL(M.pathname.endsWith("/")?M.pathname:M.pathname.slice(0,M.pathname.lastIndexOf("/")+1),i);function ae(F,ee){const C=new URL(F,ee);return C.origin!==i?null:(Ws(C.pathname)?.startsWith(_)||Nt("已阻止预览访问目录之外的资源"),C)}function W(F){const ee=new URL(F,p);(ee.origin!==new URL(p).origin||!ee.pathname.startsWith(new URL(p).pathname))&&Nt("已阻止预览访问服务接口或目录之外的资源");const C=ee.pathname.slice(new URL(p).pathname.length)+ee.search;return ae(C,o)??Nt("预览资源无效")}function he(F){const ee=F.pathname+F.search,C=R.get(ee);if(C)return C;if(P||a.signal?.aborted)return Promise.reject(new Error("预览已关闭"));if(R.size>=Xm)return Promise.reject(new Error("预览资源数量超出限制"));const L=a.fetch(ee,{signal:a.signal,redirect:"manual"}).then(te);return R.set(ee,L),L}function G(F,ee){P&&Nt("预览已关闭");const C=`termdock-resource-${f}-${x.length}`;return x.push({token:C,data:F,type:ee}),m.add(C),C}async function le(F,ee,C,L=new Set){if(!F||F.startsWith("#")||/^data:(?:image|font)\//i.test(F)&&C==="resource")return F;try{const q=ae(F,ee);if(!q){const Pe=new URL(F,ee);return(Pe.protocol!=="https:"||Pe.username||Pe.password||Pe.origin===new URL(p).origin)&&Nt("已阻止不安全的外部资源"),w.add(Pe.origin),Pe.href}const ne=`${C}:${q.href}`;(L.has(ne)||L.size>=8)&&Nt("预览资源存在循环或过深引用");const pe=b.get(ne);if(pe)return pe;const Ne=new Set(L);Ne.add(ne);const we=(async()=>{const Pe=await he(q);return C==="css"?G(await j(new TextDecoder().decode(Pe.bytes),q,Ne),"text/css"):C==="script"?G(Pe.bytes,"text/javascript"):G(Pe.bytes,Pe.type)})();return b.set(ne,we),await we}catch(q){return k(q instanceof Error?q.message:"部分预览资源未能加载"),Jm}}async function j(F,ee,C){return F=await Ad(F,/@import\s+(?:url\(\s*)?["']([^"']+)["']\s*\)?([^;]*);/gi,async L=>`@import url("${await le(L[1],ee,"css",C)}")${L[2]};`),Ad(F,/url\(\s*(?:"([^"]*)"|'([^']*)'|([^)]*))\s*\)/gi,async L=>{const q=(L[1]??L[2]??L[3]).trim();return m.has(q)?L[0]:`url("${await le(q,ee,"resource",C)}")`})}try{const F=await te(I),ee=G(qm,"text/javascript"),C=new DOMParser().parseFromString(new TextDecoder().decode(F.bytes),"text/html");C.querySelectorAll("base,meta[http-equiv],iframe,frame,object,embed").forEach(O=>O.remove());for(const O of C.querySelectorAll("*")){if(O.removeAttribute("ping"),O.removeAttribute("srcdoc"),O.hasAttribute("style")&&O.setAttribute("style",await j(O.getAttribute("style"),M,new Set)),O.tagName==="STYLE"&&(O.textContent=await j(O.textContent??"",M,new Set)),O.tagName==="A"||O.tagName==="AREA"){const ue=O.getAttribute("href");try{if(ue&&!ue.startsWith("#")){const oe=ae(ue,M);if(oe)O.setAttribute("href",new URL(oe.pathname.slice(o.pathname.length)+oe.search+oe.hash,p).href);else{const Fe=new URL(ue,M);if(Fe.protocol!=="https:"){O.removeAttribute("href");continue}w.add(Fe.origin),O.setAttribute("href",Fe.href)}}}catch(oe){O.removeAttribute("href"),k(oe instanceof Error?oe.message:"预览链接无法加载")}}for(const ue of["data","manifest"])O.removeAttribute(ue);if(O.tagName==="SCRIPT"&&O.getAttribute("type")==="module"){O.setAttribute("type","module-shim");const ue=O.getAttribute("src");if(ue){const oe=ae(ue,M);if(oe)O.setAttribute("src",new URL(oe.pathname.slice(o.pathname.length)+oe.search,p).href);else{const Fe=new URL(ue,M);if(Fe.protocol!=="https:"){O.remove();continue}w.add(Fe.origin),O.setAttribute("src",Fe.href)}}continue}if(O.tagName==="SCRIPT"&&O.getAttribute("type")==="importmap"){O.setAttribute("type","importmap-shim");continue}if(O.tagName==="LINK"){const ue=(O.getAttribute("rel")??"").toLowerCase();if(!["stylesheet","icon"].includes(ue)){O.remove();continue}const oe=O.getAttribute("href");oe&&O.setAttribute("href",await le(oe,M,ue==="stylesheet"?"css":"resource"))}if(O.hasAttribute("src")&&O.setAttribute("src",await le(O.getAttribute("src"),M,O.tagName==="SCRIPT"?"script":"resource")),O.hasAttribute("poster")&&O.setAttribute("poster",await le(O.getAttribute("poster"),M,"resource")),O.hasAttribute("srcset")){const ue=O.getAttribute("srcset");/data:/i.test(ue)?(O.removeAttribute("srcset"),k("混合内嵌图片候选暂不支持安全预览")):O.setAttribute("srcset",(await Promise.all(ue.split(",").map(async oe=>{const[Fe,...Ie]=oe.trim().split(/\s+/);return`${await le(Fe,M,"resource")} ${Ie.join(" ")}`}))).join(", "))}O.setAttribute("referrerpolicy","no-referrer"),O.removeAttribute("integrity"),O.removeAttribute("crossorigin")}const L=[...w].join(" "),q=C.createElement("meta");q.httpEquiv="Content-Security-Policy",q.content=`default-src 'none'; script-src 'unsafe-inline' 'wasm-unsafe-eval' blob: ${L}; style-src 'unsafe-inline' blob: ${L}; img-src blob: data: ${L}; font-src blob: data: ${L}; media-src blob: data: ${L}; connect-src blob: ${L} ${[...w].map(O=>O.replace(/^https:/,"wss:")).join(" ")}; worker-src blob:; frame-src 'none'; object-src 'none'; base-uri https://termdock-preview.invalid; form-action 'none'`;const ne=C.createElement("base");ne.href=p;const pe=C.createElement("meta");pe.name="referrer",pe.content="no-referrer";const Ne=C.createElement("script");Ne.textContent=Km+`
1636
1636
  installPreviewRuntime(`+[f,p,[...w],ee].map(Qm).join(",")+");";const we=C.createElement("script");we.src=ee,C.head.prepend(q,pe,ne,Ne,we);const Pe=`<!doctype html>
1637
1637
  `+C.documentElement.outerHTML;return{html:Pe,shellUrl:`/preview-shell.html#${f}`,errors:g,attach(O,ue){const oe=new Set,Fe=E=>{if(E.source!==O.contentWindow||E.data?.capability!==f)return;if(E.data.type==="preview-ready"){O.contentWindow?.postMessage({type:"preview-init",capability:f,html:Pe,resources:x},"*");return}if(E.data.type==="preview-error"){ue("部分动态内容被安全预览限制");return}if(E.data.type==="preview-navigate"){(async()=>{const ge=W(String(E.data.url)),De=await pu(ge.pathname+ge.search,a);if(P){De.dispose();return}const Ve=De.attach(O,ue);$.add(()=>{Ve(),De.dispose()}),O.src=De.shellUrl.replace("#","?navigation="+crypto.randomUUID()+"#")})().catch(ge=>ue(ge instanceof Error?ge.message:"无法打开预览页面"));return}if(E.data.type==="preview-external"){try{const ge=new URL(String(E.data.url));ge.protocol==="https:"&&w.has(ge.origin)&&window.open(ge.href,"_blank","noopener,noreferrer")}catch{}return}if(E.data.type!=="preview-fetch"||E.ports.length!==1)return;const xe=E.ports[0];if(oe.size>=8||!["GET","HEAD"].includes(E.data.method)){xe.postMessage({error:"预览仅允许读取已授权目录资源"}),xe.close();return}oe.add(xe),(async()=>{const ge=W(String(E.data.url)),De=await he(ge);if(!oe.has(xe)||P)return;const Ve=E.data.method==="HEAD"?new Uint8Array:De.bytes.slice();xe.postMessage({status:De.status,headers:{"content-type":De.type},data:Ve.buffer},[Ve.buffer])})().catch(()=>{xe.postMessage({error:"预览资源不在授权范围或无法加载"}),ue("部分动态资源不可用或超出预览目录")}).finally(()=>{oe.delete(xe),xe.close()})};window.addEventListener("message",Fe);const Ie=()=>{window.removeEventListener("message",Fe);for(const E of oe)E.close();oe.clear(),$.delete(Ie)};return $.add(Ie),Ie},dispose:D}}catch(F){throw D(),F}}const Zm=n.forwardRef(function({src:a,title:i,exitFullscreenLabel:c,onFullscreenChange:f},p){const g=n.useRef(null),[k,m]=n.useState(null),[x,w]=n.useState(),[R,b]=n.useState("");n.useEffect(()=>{const H=new AbortController;let Y;return w(void 0),b(""),(async()=>{const be=await ah();if(Y=await pu(a,{fetch:(_,o)=>be.fetch(_,o),signal:H.signal}),H.signal.aborted){Y.dispose();return}w(Y),Y.errors.length&&b(Y.errors.join(";"))})().catch(be=>{H.signal.aborted||b(be instanceof Error?be.message:"安全预览加载失败")}),()=>{H.abort(),Y?.dispose()}},[a]),n.useEffect(()=>{if(!(!x||!k))return x.attach(k,b)},[x,k]);const[A,P]=n.useState(!1),[$,D]=n.useState(!1),te=A||$;n.useEffect(()=>{f?.(te)},[te,f]),n.useEffect(()=>{const H=()=>{P(document.fullscreenElement===g.current)};return document.addEventListener("fullscreenchange",H),()=>document.removeEventListener("fullscreenchange",H)},[]),n.useEffect(()=>{if(!$)return;const H=Y=>{Y.key==="Escape"&&D(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[$]);const M=n.useCallback(async()=>{const H=g.current;if(H){if($){D(!1);return}if(document.fullscreenElement===H){await document.exitFullscreen();return}if(H.requestFullscreen&&document.fullscreenEnabled!==!1)try{await H.requestFullscreen();return}catch{}D(!0)}},[$]);n.useImperativeHandle(p,()=>({toggleFullscreen:M}),[M]);const I=t.jsxs("div",{ref:g,"data-html-preview-frame":!0,className:te?"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:[te&&t.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:[t.jsx("span",{className:"min-w-0 truncate text-[12px] font-semibold",children:i}),t.jsx("button",{type:"button",onClick:()=>{M()},"aria-label":c,title:`${c} (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:t.jsx(au,{size:15})})]}),R&&t.jsx("div",{role:"status",className:"shrink-0 border-b border-border px-3 py-2 text-xs text-muted-foreground",children:R}),!x&&!R&&t.jsx("div",{role:"status",className:"p-3 text-xs text-muted-foreground",children:"正在安全加载预览资源…"}),t.jsx("iframe",{ref:m,src:x?.shellUrl,referrerPolicy:"no-referrer",title:i,sandbox:"allow-scripts",className:"block min-h-0 w-full flex-1 border-0 bg-white"})]});return $?Qr.createPortal(I,document.body):I}),mu="termdock-file-search-match",Zi="termdock-file-search-current";function eg(r,a,i){return!!(a&&r?.isConnected&&!i.defaultPrevented&&!r.closest('[inert], [aria-hidden="true"], [hidden]')&&i.target instanceof Node&&r.contains(i.target))}function tg(r){const a=r.metaKey||r.ctrlKey,i=r.key.toLocaleLowerCase();return a&&i==="f"?"open":a&&i==="g"||r.key==="F3"?r.shiftKey?"previous":"next":r.key==="Escape"?"close":null}function rg(r){return r.parentElement?.closest("[data-markdown-preview-block-start], [data-file-preview-line]")??null}function ng(r,a){const i=a.trim().toLocaleLowerCase();if(!i)return[];const c=[];let f="",p=null;const g=document.createTreeWalker(r,NodeFilter.SHOW_TEXT);for(let w=g.nextNode();w;w=g.nextNode()){if(!(w instanceof Text)||!w.data)continue;const R=rg(w);if(!R)continue;p&&p!==R&&(f+=`
1638
- `);const b=f.length;f+=w.data,c.push({node:w,start:b,end:f.length,group:R}),p=R}const k=f.toLocaleLowerCase(),m=[];let x=0;for(;x<=k.length-i.length;){const w=k.indexOf(i,x);if(w<0)break;const R=w+i.length,b=c.find(P=>P.start<=w&&P.end>w),A=c.find(P=>P.start<R&&P.end>=R);if(b&&A&&b.group===A.group){const P=document.createRange();P.setStart(b.node,w-b.start),P.setEnd(A.node,R-A.start),m.push(P)}x=w+Math.max(i.length,1)}return m}function gu(){return typeof CSS<"u"&&CSS.highlights?CSS.highlights:null}let xo;function Td(r){return xo===r}function oo(r){if(r&&xo!==r)return;const a=gu();a?.delete(mu),a?.delete(Zi),xo=void 0}function Ii(r,a,i){const c=gu();if(!c||typeof Highlight>"u")return;xo=i,c.set(mu,new Highlight(...r));const f=r[a];f?c.set(Zi,new Highlight(f)):c.delete(Zi)}function Md(r){r?.startContainer.parentElement?.scrollIntoView({block:"center",inline:"nearest",behavior:"smooth"})}function sg(r){return Array.from(new Set(r.split(/[\n,]/).map(a=>a.trim().replace(/^!+/,"")).filter(Boolean))).slice(0,24)}function ag(r,a){const i=a.trim();return!i||i==="."?r:/^(?:[/\\]|[A-Za-z]:[/\\])/.test(i)?i.replace(/[\\/]+$/,""):`${r.replace(/[\\/]+$/,"")}/${i.replace(/^\.?[\\/]+/,"").replace(/[\\/]+$/,"")}`}function og(r,a){if(a===r)return".";const i=`${r.replace(/[\\/]+$/,"")}/`;return a.startsWith(i)?a.slice(i.length):a}function bu(r,a,i){return a?r:Qr.createPortal(r,i)}const ol="termdock:right-sidebar:file-tree-scroll:v1",il="termdock:right-sidebar:file-preview-reading-state:v1",ea="termdock:right-sidebar:file-tree-width:v1",xu="termdock:right-sidebar:markdown-view-mode:v1",vu="termdock:right-sidebar:diff-change-list-mode:v1",yu="termdock:right-sidebar:diff-wrap:v1",wu="termdock:diff-viewer:view-type:v1",ku="termdock:right-sidebar:file-search-mode:v1",$i="termdock:right-sidebar:collapsed-git-repo-groups:v1",Ld="termdock:right-sidebar:collapsed-diff-directories:v1",Fi="termdock:right-sidebar:branch-audit-module-open:v1",Su="termdock:right-sidebar:branch-audit-module:v1",ig=150,Id="termdock:right-sidebar:context-draft-enabled:v1",$d="termdock:right-sidebar:context-draft-collapsed:v1",Fd="termdock:right-sidebar:context-draft-auto-collapse:v1",Di="termdock:right-sidebar:context-draft-text:v1",lg=300,cg=20,dg=120,ug=250,fg=250,hg=120,pg=700,_i=600,mg=6e4;function Vs(r){return!!(r&&U.getState().nestedGitScanRoots[r])}const Dd=[2e3,5e3,15e3,3e4],gg=320,bg=500,xg=20,vg=12e3,el=300,_d=240,yg=560,Bd=n.lazy(()=>sl(()=>import("./ModelPreview-Cl0X7I-U.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]))),wg=n.lazy(()=>sl(()=>import("./ArchitecturePanel-CYdolNzT.js"),__vite__mapDeps([33,1,2,3,4,5,34,11,12,13,14,24,21,25,26,35,18,19,20,8,9,10,15,16,22,23,27,28,29,30,31,6,32,36])).then(r=>({default:r.ArchitecturePanel}))),kg=n.lazy(()=>sl(()=>import("./ComputerControlView-DU9krDsg.js").then(r=>r.a),__vite__mapDeps([37,1,2,3,4,5,29,31,15,38,30,39])));function Ru(r,a,i){return r&&!a?"unified":i}const Sg=new Set([".md",".markdown",".mdown",".mkdn",".mkd"]);function Rg(r){return r==="preview"||r==="source"}function jg(r){return r==="list"||r==="tree"||r==="ai"}function Ud(){return ct(xu,Rg)??"preview"}function Cg(){return ct(vu,jg)??"tree"}function ta(r){return typeof r=="boolean"}function Ng(r){return typeof r=="string"}function Pg(){return ct(yu,ta)??!0}function Eg(r){return r==="unified"||r==="split"}function Ag(){return ct(wu,Eg)??"unified"}function Tg(r){return r==="name"||r==="content"||r==="regex"}function Mg(){return ct(ku,Tg)??"name"}function ju(r){return r.repositories??(r.context?.root?[{id:r.context.root,root:r.context.root,relativeRoot:".",name:gt(r.context.root)||r.context.root,depth:0,nested:!1,available:r.available,files:r.files,context:r.context,error:r.error}]:[])}function Lg(r,a){if(!a)return null;const i=new Set((r.repoFilters??[]).map(c=>c.root));return i.has(a)?a:i.size>0?null:(r.repositories??[]).some(c=>c.root===a)?a:null}function tl(r){return!r.activeGitRepoRoot&&(r.groupCount>1||r.label!==r.rootName)}function Cu(...r){const a=new Set;for(const i of r)for(const c of i)a.add(c.root);return a}function rl(r){return Array.isArray(r)&&r.every(a=>typeof a=="string")}function Od(r){const a=ct(r,rl);return a?new Set(a):new Set}function Bi(r,a){Pt(r,[...a])}function Ig(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;const a=r;return typeof a.filePath=="string"&&typeof a.hunkHeader=="string"&&typeof a.hunkIndex=="number"&&typeof a.fingerprint=="string"&&typeof a.additions=="number"&&typeof a.deletions=="number"&&typeof a.diff=="string"&&(a.oldPath===void 0||a.oldPath===null||typeof a.oldPath=="string")&&(a.newPath===void 0||a.newPath===null||typeof a.newPath=="string")&&(a.source===void 0||a.source==="committed"||a.source==="uncommitted"||a.source==="unknown")&&(a.commit===void 0||a.commit===null||typeof a.commit=="string")}function $g(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;const a=r;return typeof a.available=="boolean"&&(a.repoRoot===void 0||typeof a.repoRoot=="string")&&(a.workspaceRoot===void 0||typeof a.workspaceRoot=="string")&&(a.baseRef===void 0||typeof a.baseRef=="string")&&(a.baseBranch===void 0||typeof a.baseBranch=="string")&&(a.currentBranch===void 0||a.currentBranch===null||typeof a.currentBranch=="string")&&(a.headRef===void 0||a.headRef===null||typeof a.headRef=="string")&&(a.diffFingerprint===void 0||typeof a.diffFingerprint=="string")&&(a.stat===void 0||typeof a.stat=="string")&&(a.files===void 0||rl(a.files))&&(a.hunks===void 0||Array.isArray(a.hunks)&&a.hunks.every(Ig))&&(a.commits===void 0||rl(a.commits))&&(a.commitCount===void 0||typeof a.commitCount=="number")&&(a.diff===void 0||typeof a.diff=="string")&&(a.truncated===void 0||typeof a.truncated=="boolean")&&(a.error===void 0||typeof a.error=="string")}function Fg(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;const a=r;return typeof a.key=="string"&&$g(a.diff)&&typeof a.repoLabel=="string"&&typeof a.createdAt=="number"}function Dg(r){return!r||typeof r!="object"||Array.isArray(r)?!1:Object.values(r).every(a=>{if(!a||typeof a!="object"||Array.isArray(a))return!1;const i=a;return Array.isArray(i.selectedRepoRoots)&&i.selectedRepoRoots.every(c=>typeof c=="string")&&!!i.repoTargetBranches&&typeof i.repoTargetBranches=="object"&&!Array.isArray(i.repoTargetBranches)&&Object.values(i.repoTargetBranches).every(c=>typeof c=="string")&&(i.repoBaseBranches===void 0||!!i.repoBaseBranches&&typeof i.repoBaseBranches=="object"&&!Array.isArray(i.repoBaseBranches)&&Object.values(i.repoBaseBranches).every(c=>typeof c=="string"))&&(i.previewEntries===void 0||Array.isArray(i.previewEntries)&&i.previewEntries.every(Fg))&&(i.selectedPreviewKey===void 0||i.selectedPreviewKey===null||typeof i.selectedPreviewKey=="string")&&(i.selectedPreviewFileKey===void 0||i.selectedPreviewFileKey===null||typeof i.selectedPreviewFileKey=="string")&&(i.previewDetailOpen===void 0||typeof i.previewDetailOpen=="boolean")&&(i.previewScrollTops===void 0||!!i.previewScrollTops&&typeof i.previewScrollTops=="object"&&!Array.isArray(i.previewScrollTops)&&Object.values(i.previewScrollTops).every(c=>typeof c=="number"))&&(i.previewMobileSlideIndex===void 0||typeof i.previewMobileSlideIndex=="number")&&(i.repoIncludeUncommitted===void 0||!!i.repoIncludeUncommitted&&typeof i.repoIncludeUncommitted=="object"&&!Array.isArray(i.repoIncludeUncommitted)&&Object.values(i.repoIncludeUncommitted).every(c=>typeof c=="boolean"))&&(i.includeUncommitted===void 0||typeof i.includeUncommitted=="boolean")&&typeof i.updatedAt=="number"})}function Hd(){return ct(Su,Dg)??{}}function zd(r){return[r.repoRoot,r.baseRef,r.branchName??"",r.headRef??"",r.diffFingerprint??""].join("\0")}function Gd(r){const a=r?.trim()??"",i=a.indexOf("/");return i>=0?a.slice(i+1):a}function Nu(r,a){const i=r?.trim(),c=a?.trim();return!i||!c?!1:i===c||Gd(i)===Gd(c)}function Wd(r){const a=r?.branch??null;return[r?.upstream,...r?.remoteBranches??[],...r?.branches??[]].find(c=>c&&!Nu(c,a))??""}function nl(r,a){const i=Math.max(_d,a-320),c=Math.min(yg,i);return Math.min(c,Math.max(_d,r))}function _g(r){return typeof r=="number"&&Number.isFinite(r)}function Bg(r){return nl(ct(ea,_g)??el,r)}function Pu(r){const a=r.split(/[\\/]/).pop()??r,i=a.lastIndexOf(".");return i>=0?a.slice(i).toLowerCase():""}function Ys(r){return Sg.has(Pu(r))}function cs({label:r,value:a,options:i,placeholder:c,searchPlaceholder:f,emptyText:p,disabled:g,onChange:k}){const{t:m}=_t(),[x,w]=n.useState(!1),[R,b]=n.useState(""),[A,P]=n.useState(null),$=n.useRef(null),D=n.useRef(null),te=R.trim().toLowerCase(),M=n.useMemo(()=>te?i.filter(_=>`${_.label} ${_.meta??""}`.toLowerCase().includes(te)):i,[te,i]),I=i.find(_=>_.value===a),H=()=>{const _=R.trim();_&&(k(_),w(!1),b(""))},Y=n.useCallback(()=>{const _=$.current?.getBoundingClientRect();if(!_)return!1;const o=12,ae=Math.max(220,Math.min(_.width,window.innerWidth-o*2)),W=Math.min(Math.max(o,_.left),window.innerWidth-ae-o),he=window.innerHeight-_.bottom-o,G=_.top-o,le=he>=180||he>=G,j=Math.max(96,(le?he:G)-4),F=Math.min(320,j);return P({left:W,top:le?_.bottom+4:Math.max(o,_.top-F-4),width:ae,maxHeight:F}),!0},[]),be=()=>{Y(),w(!0)};return n.useEffect(()=>{if(!x)return;let _=0;const o=()=>{_||(_=window.requestAnimationFrame(()=>{_=0,Y()}))},ae=W=>{const he=W.target;he instanceof Node&&($.current?.contains(he)||D.current?.contains(he)||(w(!1),b("")))};return window.addEventListener("resize",o),window.addEventListener("scroll",o,!0),document.addEventListener("pointerdown",ae,!0),()=>{_&&window.cancelAnimationFrame(_),window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0),document.removeEventListener("pointerdown",ae,!0)}},[x,Y]),t.jsxs("div",{className:"relative min-w-0",children:[t.jsxs("button",{ref:$,type:"button",disabled:g,onClick:()=>{if(!g){if(b(""),x){w(!1);return}be()}},className:"group flex w-full items-center justify-between gap-2 min-h-10 rounded-md border border-transparent bg-surface-2 px-3 py-2 text-left transition hover:bg-surface-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:[t.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-3",children:[t.jsx("span",{className:"shrink-0 text-[11px] text-muted-foreground",children:r}),t.jsx("span",{className:`min-w-0 flex-1 truncate text-[13px] ${a?"text-foreground":"text-muted-foreground/70"}`,children:I?.label??(a||c)})]}),t.jsx(aa,{size:13,className:`shrink-0 text-muted-foreground transition group-hover:text-foreground ${x?"rotate-180":""}`})]}),x&&!g&&typeof document<"u"&&Qr.createPortal(t.jsxs("div",{ref:D,className:"fixed z-popover overflow-hidden rounded-lg border border-border/15 bg-surface shadow-lg",onClick:_=>_.stopPropagation(),style:{left:A?.left??12,top:A?.top??12,width:A?.width??260,maxHeight:A?.maxHeight??320},children:[t.jsx("div",{className:"border-b border-border/10 p-1.5",children:t.jsxs("div",{className:"flex items-center gap-1.5 rounded-md bg-surface-2 px-2 py-1.5",children:[t.jsx(us,{size:12,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{autoFocus:!0,value:R,onChange:_=>b(_.target.value),onKeyDown:_=>{if(_.key==="Escape"){_.preventDefault(),w(!1),b("");return}_.key==="Enter"&&(_.preventDefault(),H())},onBlur:()=>{R.trim()&&M.length===0&&H()},placeholder:f,className:"min-w-0 flex-1 bg-transparent text-[12px] text-foreground outline-none placeholder:text-muted-foreground/70"})]})}),t.jsxs("div",{className:"overflow-y-auto p-1",style:{maxHeight:Math.max(96,(A?.maxHeight??320)-46)},children:[R.trim()&&!i.some(_=>_.value===R.trim())&&t.jsxs("button",{type:"button",onMouseDown:_=>_.preventDefault(),onClick:H,className:"mb-1 flex w-full items-center justify-between gap-2 rounded-md bg-primary/10 px-2 py-1.5 text-left text-[12px] font-medium text-primary transition hover:bg-primary/15",children:[t.jsx("span",{className:"min-w-0 truncate",children:R.trim()}),t.jsx("span",{className:"shrink-0 text-[10px] text-primary/75",children:m("common.use")})]}),M.length>0?M.map(_=>t.jsxs("button",{type:"button",onClick:()=>{k(_.value),w(!1),b("")},className:`flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-left text-[12px] transition hover:bg-surface-2 ${_.value===a?"bg-accent/10 text-accent":"text-foreground"}`,children:[t.jsx("span",{className:"min-w-0 truncate font-medium",children:_.label}),_.meta&&t.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:_.meta})]},_.value)):t.jsx("div",{className:"px-2 py-2 text-[11px] text-muted-foreground",children:p})]})]}),document.body)]})}function qd({open:r,onOpenChange:a,showScopePicker:i,selectedAll:c,repos:f,selectedRoots:p,onToggleRepo:g,onGenerate:k,onSecondaryAction:m,disabled:x,generateDisabled:w,secondaryDisabled:R,inserted:b,buttonLabel:A,insertedLabel:P,title:$,ariaLabel:D,scopeTitle:te,scopeLabel:M,allLabel:I,generateLabel:H,secondaryLabel:Y,secondaryTitle:be,secondaryLoading:_,loading:o,error:ae,statusTitle:W,extraContent:he,renderRepoExtra:G,menuItem:le=!1}){return t.jsxs("div",{className:le?"relative w-full":"relative inline-flex shrink-0",children:[t.jsxs("button",{type:"button",role:le?"menuitem":void 0,tabIndex:le?-1:void 0,onClick:j=>{i?a(!r):w||k(j.currentTarget)},disabled:x,className:`relative flex items-center rounded-md transition disabled:cursor-not-allowed disabled:opacity-50 ${le?"min-h-10 w-full gap-2.5 px-2.5 text-left text-[12px] focus:bg-surface-2 focus:outline-none [@media(pointer:coarse)]:min-h-11":"h-7 shrink-0 justify-center gap-1 px-2 text-[11px] font-medium active:scale-95"} ${ae?"text-destructive hover:bg-destructive/5":b?"bg-surface-elevated text-foreground":le?"text-foreground hover:bg-surface-2":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,"aria-label":D,title:W??(i?`${te}: ${M}`:$),children:[o?t.jsx(lt,{size:le?15:13,className:"shrink-0 animate-spin"}):t.jsx(sa,{size:le?15:13,className:le?"shrink-0 text-muted-foreground":void 0}),t.jsx("span",{className:le?"min-w-0 flex-1":void 0,children:b?P:A}),i&&(le?t.jsx(ds,{size:13,className:"shrink-0 text-muted-foreground"}):t.jsx(aa,{size:11,className:`shrink-0 transition ${r?"rotate-180":""}`})),ae&&t.jsx("span",{className:"absolute right-0.5 top-0.5 size-1.5 rounded-full bg-destructive"})]}),i&&r&&typeof document<"u"&&Qr.createPortal(t.jsx("div",{className:"fixed inset-0 z-modal-backdrop bg-[var(--app-backdrop)] px-3 py-6 backdrop-blur-sm animate-fade-in",onClick:()=>a(!1),children:t.jsxs("div",{className:"fixed left-1/2 top-1/2 z-modal-panel flex max-h-[min(82vh,36rem)] w-[calc(100vw-1.5rem)] max-w-[42rem] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-border/20 bg-surface text-[11px] shadow-2xl",onClick:j=>j.stopPropagation(),children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border/15 px-3 py-2",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-[12px] font-semibold text-foreground",children:te}),t.jsx("div",{className:"mt-0.5 truncate text-[10px] text-muted-foreground",children:M})]}),t.jsx("button",{type:"button",onClick:()=>a(!1),className:"inline-flex h-7 w-7 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","aria-label":"Close",children:t.jsx(Xt,{size:14})})]}),t.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-2",children:[he,t.jsxs("button",{type:"button",onClick:()=>g(null),className:`flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-left font-medium transition ${c?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,children:[t.jsx("span",{className:"truncate",children:I}),c&&t.jsx("span",{className:"text-[10px]",children:"✓"})]}),f.map(j=>{const F=p.includes(j.root);return t.jsxs("div",{className:`mt-1 rounded-md transition ${F?"bg-primary/15 text-primary":""}`,children:[t.jsxs("button",{type:"button",onClick:()=>g(j.root),className:`flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-left font-medium transition ${F?"text-primary":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,title:j.root,children:[t.jsxs("span",{className:"min-w-0",children:[t.jsx("span",{className:"block truncate",children:j.label}),j.branch&&t.jsx("span",{className:"block truncate text-[9px] opacity-70",children:j.branch})]}),F&&t.jsx("span",{className:"text-[10px]",children:"✓"})]}),G&&(c||F)&&t.jsx("div",{className:"px-2 pb-2",children:G(j)})]},j.root)})]}),t.jsxs("div",{className:`grid grid-cols-1 gap-1.5 border-t border-border/15 p-2 ${m&&Y?"sm:grid-cols-2":""}`,children:[m&&Y&&t.jsxs("button",{type:"button",onClick:()=>{R||(a(!1),m())},disabled:R,className:"flex h-7 w-full items-center justify-center gap-1 rounded-md bg-surface-2 px-2 text-[11px] font-semibold text-muted-foreground transition hover:bg-surface-elevated hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50 active:scale-95",title:be,children:[_?t.jsx(lt,{size:12,className:"animate-spin"}):t.jsx(lu,{size:12}),Y]}),t.jsxs("button",{type:"button",onClick:async j=>{if(w)return;await k(j.currentTarget)!==!1&&a(!1)},disabled:w,className:"flex h-7 w-full items-center justify-center gap-1 rounded-md bg-primary/15 px-2 text-[11px] font-semibold text-primary transition hover:bg-primary/25 disabled:cursor-not-allowed disabled:opacity-50 active:scale-95",title:$,children:[t.jsx(sa,{size:12}),H]})]})]})}),document.body)]})}function Ug(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;for(const a of Object.values(r)){if(!a||typeof a!="object"||Array.isArray(a))return!1;const i=a;if(typeof i.top!="number"||!Number.isFinite(i.top)||typeof i.updatedAt!="number"||!Number.isFinite(i.updatedAt))return!1}return!0}function Eu(){return ct(ol,Ug)??{}}function Og(r,a){const i=Eu(),c=Object.entries({...i,[r]:{top:a,updatedAt:Date.now()}}).sort(([,f],[,p])=>p.updatedAt-f.updatedAt).slice(0,cg);ra(ol,Object.fromEntries(c),ug)}function Hg(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;const a=r;return typeof a.start=="number"&&Number.isFinite(a.start)&&typeof a.end=="number"&&Number.isFinite(a.end)&&a.start>=1&&a.end>=a.start}function zg(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;for(const a of Object.values(r)){if(!a||typeof a!="object"||Array.isArray(a))return!1;const i=a;if(typeof i.top!="number"||!Number.isFinite(i.top)||i.left!==void 0&&(typeof i.left!="number"||!Number.isFinite(i.left))||i.markdownTop!==void 0&&(typeof i.markdownTop!="number"||!Number.isFinite(i.markdownTop))||i.lineRange!==void 0&&i.lineRange!==null&&!Hg(i.lineRange)||typeof i.updatedAt!="number"||!Number.isFinite(i.updatedAt))return!1}return!0}function ll(r,a){if(!a)return null;const i=r&&!a.startsWith("/")?`${r}/${a}`:a;return r?`${r}::${i}`:i}function Au(){return ct(il,zg)??{}}function Kd(r,a){const i=ll(r,a);return i?Au()[i]??null:null}function Ui(r,a,i){const c=ll(r,a);if(!c)return;const f=Au(),p=f[c]??{top:0,left:0,markdownTop:0,lineRange:null,updatedAt:Date.now()},g=Object.entries({...f,[c]:{...p,...i,updatedAt:Date.now()}}).sort(([,k],[,m])=>m.updatedAt-k.updatedAt).slice(0,dg);ra(il,Object.fromEntries(g),fg)}function Oi({slow:r}){return t.jsx(ap,{slow:r})}function io({message:r,onRetry:a}){const{t:i}=_t();return t.jsxs("div",{className:"mx-3 mt-3 overflow-hidden rounded-xl border border-destructive/20 bg-destructive/5 px-4 py-5 text-center text-sm text-destructive",children:[t.jsx("div",{className:"font-medium",children:i("rightSidebar.gitChangesLoadFailed")}),t.jsx("div",{className:"mt-1 break-words text-xs opacity-85",children:r}),t.jsx("button",{type:"button",onClick:a,className:"mt-3 rounded-full bg-destructive/10 px-3 py-1.5 text-xs font-semibold text-destructive transition hover:bg-destructive/15 active:scale-95",children:i("rightSidebar.retryGitChanges")})]})}function ho(r,a){const i=a&&r.startsWith(`${a}/`)?r.slice(a.length+1):r,c=i.split("/").filter(Boolean);return{name:c.pop()||i,dir:c.join("/")}}function gt(r){if(!r)return"";const a=r.replace(/\/+$/,"");return a.split("/").pop()||a||"/"}function lo(r){if(!r)return null;const a=r.replace(/\/+$/,"")||"/";if(a==="/")return null;const i=a.slice(0,a.lastIndexOf("/"))||"/";return i===a?null:i}function Gg(r,a,i){return Vi(r,a,i)}function Tu(r){const a=new Map;for(const i of r)a.set(cl(i),i);return a}function Mu(r,a){const i=new Map(r);for(const c of a)i.set(cl(c),c);return i}function Vd(r,a){let i=0;for(const c of r){const f=ut(c,a);f&&a&&f!==a&&(i+=1)}return i}function Wg(r){return r.reduce((a,i)=>a+(i.staged?1:0),0)}function qg(r,a){return Array.from(Mu(Tu(r),a).values()).sort((i,c)=>i.path.localeCompare(c.path))}function Kg(r,a){const i=r.relativeRoot==="."?gt(a??r.root)||r.name||r.root:r.relativeRoot||r.name||gt(r.root)||r.root;return{root:r.root,label:i,branch:r.context?.branch??null,count:r.files.length,staged:Wg(r.files)}}function Lu(r,a){const i=gt(a??"")||a||"";return r.map(c=>Kg(c,a)).sort((c,f)=>i&&c.label===i?-1:i&&f.label===i?1:c.label.localeCompare(f.label))}function Iu(r,a,i,c,f){const p=ju(i),g=p.find($=>$.root===c)??p[0]??null,k=a.find($=>$.root===c)??null,m=k?.relativeRoot??g?.relativeRoot??".",x=k?.name??g?.name??(gt(c)||c),w=(g?.files??i.files).map($=>({...$,repoRoot:c,repoRelativeRoot:m,repoName:x})),R=g?.context??i.context,b={...k??g??{id:c,root:c,relativeRoot:m,name:x,depth:0,nested:!!(f&&c!==f),available:i.available,files:[],context:null},...g??{},id:k?.id??g?.id??c,root:c,displayRoot:k?.displayRoot??g?.displayRoot,relativeRoot:m,name:x,depth:k?.depth??g?.depth??0,nested:k?.nested??g?.nested??!!(f&&c!==f),available:g?.available??i.available,deferred:g?.deferred??!1,files:w,context:R?{...R,root:c,changedFiles:w.map($=>({path:$.path,absolutePath:$.absolutePath,status:$.status}))}:null,untrackedDeferred:g?.untrackedDeferred??i.untrackedDeferred,error:g?.error??i.error},A=k?a.map($=>$.root===c?b:$):[...a,b];return{files:Array.from(r).filter($=>ut($,f)!==c).concat(w),repositories:A,repoFilters:Lu(A,f)}}function ut(r,a){return r.repoRoot??a}function cl(r){return`${r.repoRoot??""}\0${r.path}`}function xr(r){return r.absolutePath||r.path}function Hi(r){return cl(r)}function Vg(r){return r.repoRelativeRoot&&r.repoRelativeRoot!=="."?r.repoRelativeRoot:r.repoName??""}function Yd(r){return r.reduce((a,i)=>a+(i.staged?1:0),0)}function Xd(r){const a={added:0,modified:0,deleted:0,renamed:0,copied:0,untracked:0,conflicted:0,staged:0,other:0};for(const i of r)i.status==="added"?a.added+=1:i.status==="modified"?a.modified+=1:i.status==="deleted"?a.deleted+=1:i.status==="renamed"?a.renamed+=1:i.status==="copied"?a.copied+=1:i.status==="untracked"?a.untracked+=1:i.status==="conflicted"?a.conflicted+=1:a.other+=1,i.staged&&(a.staged+=1);return a}function Xs(r){let a=0;const i=r??"root";for(let c=0;c<i.length;c+=1)a=Math.imul(a^i.charCodeAt(c),16777619);return`right-sidebar-git-bundle:${(a>>>0).toString(36)}`}function Js(r,a){return typeof r!="number"||!Number.isFinite(r)||r<=0?null:new Intl.DateTimeFormat(a==="zh"?"zh-CN":"en",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(r))}function vr(r){return r instanceof DOMException&&r.name==="AbortError"}function Yg(r){const a=r.error??r.context?.error??"";return a.includes("request was cancelled")||a.includes("IO_REQUEST_CANCELLED")}function Jd(r){return r?.available===!1&&r.code==="NOT_GIT_REPOSITORY"}function Xg({actions:r,running:a,completed:i}){const{t:c}=_t(),[f,p]=n.useState(!1),g=n.useRef(null),k=r.find(x=>a?.action===x.key),m=r.find(x=>i?.action===x.key);return r.length===0?null:(n.useEffect(()=>{if(!f)return;const x=R=>{const b=R.target;b instanceof Node&&g.current?.contains(b)||p(!1)},w=R=>{R.key==="Escape"&&p(!1)};return document.addEventListener("pointerdown",x),document.addEventListener("keydown",w),()=>{document.removeEventListener("pointerdown",x),document.removeEventListener("keydown",w)}},[f]),t.jsxs("div",{ref:g,className:"relative shrink-0",children:[t.jsx("button",{type:"button",onClick:x=>{x.stopPropagation(),p(w=>!w)},disabled:r.every(x=>x.disabled)&&!a&&!i,className:`inline-flex h-6 min-w-6 shrink-0 items-center justify-center rounded-md transition active:scale-95 disabled:opacity-50 ${f?"bg-surface-elevated text-foreground":m?"bg-accent/10 text-accent":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,title:k?.label??m?.label??c("rightSidebar.gitQuickActions"),children:k?t.jsx(lt,{size:13,className:"animate-spin"}):m?t.jsx("span",{className:"text-[12px] font-semibold",children:"✓"}):t.jsx(po,{size:14})}),f&&t.jsx("div",{className:"absolute right-0 top-[calc(100%+2px)] z-30 w-44 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:r.map(x=>{const w=a?.action===x.key,R=i?.action===x.key;return t.jsxs("button",{type:"button",onClick:b=>{b.stopPropagation(),x.onClick(),p(!1)},disabled:x.disabled||!!a,className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left font-medium transition active:scale-[0.99] disabled:opacity-50 ${R?"bg-accent/10 text-accent":x.destructive?"text-destructive hover:bg-destructive/10":"text-foreground hover:bg-surface-2"}`,children:[t.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:w?t.jsx(lt,{size:13,className:"animate-spin"}):R?"✓":null}),t.jsx("span",{className:"min-w-0 flex-1 truncate",children:x.label})]},x.key)})})]}))}function Jg(r){const a=window.getComputedStyle(r).overflowY;return(a==="auto"||a==="scroll")&&r.scrollHeight>r.clientHeight+1}function $u(r){let a=r;for(;a;){if(a.classList.contains("termdock-diff-stream-scroller")&&Jg(a))return a;a=a.parentElement}return r.closest(".termdock-diff-stream-scroller")}function fs(r){return r.getClientRects().length>0&&window.getComputedStyle(r).visibility!=="hidden"}const zi=new WeakMap;function vo(r){const a=zi.get(r);a!==void 0&&window.clearTimeout(a),r.classList.remove("diff-walkthrough-target"),r.offsetWidth,r.classList.add("diff-walkthrough-target");const i=window.setTimeout(()=>{r.classList.remove("diff-walkthrough-target"),zi.delete(r)},1700);zi.set(r,i)}function Qg(r){const a=CSS.escape(r),i=[`[data-diff-stream-item="${a}"]`,`[data-diff-selection-path="${a}"]`,`[data-diff-absolute-path="${a}"]`].join(","),c=Array.from(document.querySelectorAll(".termdock-diff-stream-scroller"));let f=null;for(const k of c){if(!fs(k))continue;const m=k.querySelector(i);if(m&&fs(m)){f=m;break}}if(f??=Array.from(document.querySelectorAll(i)).find(fs)??null,!f)return;const p=$u(f);if(!p){f.scrollIntoView({block:"start",behavior:"smooth"}),vo(f);return}const g=f.getBoundingClientRect().top-p.getBoundingClientRect().top+p.scrollTop;p.scrollTo({top:Math.max(0,g),behavior:"instant"}),vo(f)}function Tn(r){const a=CSS.escape(r.filePath),i=typeof r.sectionIndex=="number"?String(r.sectionIndex):null,c=typeof r.hunkIndex=="number"?String(r.hunkIndex):null,f=r.sectionFingerprint?CSS.escape(r.sectionFingerprint):null,p=r.hunkFingerprint?CSS.escape(r.hunkFingerprint):null,g=[i!==null&&f?`[data-diff-section-audit="${a}"][data-diff-section-index="${i}"][data-diff-section-fingerprint="${f}"]`:null,i!==null&&f?`[data-diff-section-anchor="${a}"][data-diff-section-index="${i}"][data-diff-section-fingerprint="${f}"]`:null,i!==null?`[data-diff-section-audit="${a}"][data-diff-section-index="${i}"]`:null,i!==null?`[data-diff-section-anchor="${a}"][data-diff-section-index="${i}"]`:null,c!==null&&p?`[data-diff-hunk-anchor="${a}"][data-diff-hunk-index="${c}"][data-diff-hunk-fingerprint="${p}"]`:null,c!==null?`[data-diff-hunk-anchor="${a}"][data-diff-hunk-index="${c}"]`:null,`[data-diff-file-path="${a}"]`].filter(P=>!!P),k=Array.from(document.querySelectorAll(".termdock-diff-stream-scroller"));let m=null;for(const P of k)if(fs(P)){for(const $ of g){const D=P.querySelector($);if(D&&fs(D)){m=D;break}}if(m)break}if(m??=g.flatMap(P=>Array.from(document.querySelectorAll(P))).find(fs)??null,!m){Qg(r.filePath);return}const x=$u(m);if(!x){m.scrollIntoView({block:"center",behavior:"smooth"}),vo(m);return}const w=m.getBoundingClientRect(),R=x.getBoundingClientRect(),A=w.top-R.top+x.scrollTop-Math.max(24,(x.clientHeight-w.height)/2);x.scrollTo({top:Math.max(0,A),behavior:"instant"}),vo(m)}let Zg=0,eb=0,tb=0,rb=0,nb=0;function st(r,a={}){if(typeof window>"u")return;const i=JSON.stringify({level:r==="error"||r==="empty_bundle"?"warn":"info",message:`GIT_BUNDLE ${r}`,data:{seq:++eb,ts:Date.now(),...a}});fetch("/api/client-log",{method:"POST",headers:{"Content-Type":"application/json"},body:i,keepalive:!0}).catch(()=>{})}function Qs(r,a={}){if(typeof window>"u")return;const i=JSON.stringify({level:"info",message:`DIFF_INTERACTION ${r}`,data:{seq:++rb,ts:Date.now(),...a}});fetch("/api/client-log",{method:"POST",headers:{"Content-Type":"application/json"},body:i,keepalive:!0}).catch(()=>{})}function sb(){return`diff-ui-${Date.now().toString(36)}-${(++nb).toString(36)}`}function ab(r){return r instanceof Element?r.closest("[data-diff-selection-path]"):null}function ob(r){const a=r.target instanceof HTMLElement?r.target:null;return{eventType:r.type,button:r.button,pointerType:r instanceof globalThis.PointerEvent?r.pointerType:void 0,targetTag:a?.tagName,targetClass:a?.className,targetText:a?.textContent?.slice(0,80)}}function yo({onReviewReference:r,filePath:a,active:i=!0,onInsertReference:c,onInsertText:f,onInsertFeature:p,onReferenceCopied:g,onClose:k,onDirectoryLinkOpen:m,isMobile:x,markdownOutlineOpen:w,markdownOutlineCloseSignal:R,onOpenMarkdownOutline:b,onCloseMarkdownOutline:A,markdownImageLightboxOpen:P,markdownImageLightboxCloseSignal:$,onOpenMarkdownImageLightbox:D,onCloseMarkdownImageLightbox:te,lineRange:M,onLineRangeChange:I,insertedReferenceKey:H,copiedReferenceKey:Y,scrollToLine:be,onScrollToLineHandled:_}){const{t:o}=_t(),ae=n.useRef(null),W=n.useRef({}),he=n.useRef(i);he.current=i,n.useEffect(()=>{i||ae.current?.querySelectorAll("video").forEach(S=>S.pause())},[i]);const G=U(S=>S.rootPath),le=U(S=>S.selectFile),[j,F]=n.useState({kind:"idle"}),[ee,C]=n.useState("schematic"),[L,q]=n.useState(null),ne=n.useRef(null),[pe,Ne]=n.useState(null),we=n.useRef(new Map),Pe=n.useRef(null),[O,ue]=n.useState(null),[oe,Fe]=n.useState(()=>Ud()),[Ie,E]=n.useState(()=>Pd(G,a)),xe=n.useRef(null),[ge,De]=n.useState(!1),[Ve,Ae]=n.useState(null),[Jt,Be]=n.useState(0),[ft,Ue]=n.useState([]),[Qt,me]=n.useState(null),dt=n.useRef(null),at=n.useRef(a),[bt,Oe]=n.useState(null),V=wm(G&&a&&!a.startsWith("/")?`${G}/${a}`:a,i),[ye,Ze]=n.useState(!1),[wt,ir]=n.useState(""),[N,Q]=n.useState([]),[ke,Ye]=n.useState(0),ht=n.useRef(null),yr=tu(g),kt=ll(G,a);n.useEffect(()=>{if(at.current===a)return;at.current=a;const S=a&&G&&!a.startsWith("/")?`${G}/${a}`:a;if(dt.current===S){dt.current=null;return}dt.current=null,Ue([]),me(null),Ze(!1),ir("")},[a,G]);const St=a?G&&!a.startsWith("/")?`${G}/${a}`:a:null,Mn=U(S=>St?(S.fileChangeVersions.get(St)??0)+S.fileWatchEpoch:S.fileWatchEpoch),hs=n.useRef(null),wr=n.useRef(null),[Bt,Zr]=n.useState(0),Zt=n.useCallback(()=>Zr(S=>S+1),[]);n.useEffect(()=>{const S=ne.current;return ne.current=null,q(null),S&&URL.revokeObjectURL(S.objectUrl),()=>{const T=ne.current;ne.current=null,T&&URL.revokeObjectURL(T.objectUrl)}},[St,Mn,Bt]),n.useEffect(()=>{if(!a){hs.current=null,F({kind:"idle"});return}const S=G&&!a.startsWith("/")?`${G}/${a}`:a,T=new AbortController,ce=++Zg,Se=`right-sidebar-file-preview:${ce}`,Je=performance.now();let Te=!1;const ze=(K,We={})=>{Te||(Te=!0,Ei("end",{loadingId:ce,reason:K,durationMs:Math.round(performance.now()-Je),filePath:a,fullPath:S,rootPath:G,...We}))};let Me=null;const Ge=oh(S),ot=Ge?S.toLowerCase().endsWith(".kicad_pcb")?ee==="schematic"?"pcb-front":ee:"schematic":ee,Fn=!Ge&&ih(S),cr=!Ge&&!Fn&&lh(S),ys=!Ge&&!Fn&&!cr&&ch(S),an=Ys(S),on=qs(S),zr=Ge?"eda":Fn?"image":cr?"model3d":ys?"video":"text",ln=hs.current!==S;if(hs.current=S,ln){Ei("start",{loadingId:ce,filePath:a,fullPath:S,rootPath:G,mode:zr,externalVersion:Mn}),F({kind:"loading",mode:zr}),wr.current=null;const K=Kd(G,a);I(K?.lineRange??null),Fe(an?Ud():"source"),E(on?Pd(G,a):"source"),Ge&&C(dh(S))}ln||F(K=>K.kind==="error"?{kind:"loading",mode:zr}:K);const cn=window.setTimeout(()=>{Te||T.signal.aborted||Ei("still_active",{loadingId:ce,filePath:a,fullPath:S,rootPath:G,mode:zr,durationMs:Math.round(performance.now()-Je),isPathChange:ln})},3e3),ws=window.setTimeout(()=>{if(Te||T.signal.aborted)return;const K=Ge?o("rightSidebar.edaTimeout"):cr?o("rightSidebar.model3dTimeout"):"File preview timed out. Try the file again or refresh the directory.";T.abort(new DOMException(K,"TimeoutError")),F({kind:"error",message:K}),ze("stuck_timeout",{error:K})},Ge?uh+5e3:cr?fh+5e3:hh(S)?35e3:vg);if(Ge){const K=ot==="pcb-3d"?ne.current:null;K?(F(K),ze("eda_3d_client_cache_hit",{bytes:K.meta.size,view:K.view,mimeType:K.meta.mimeType})):ph(S,ot,T.signal,"view_file",Se).then(We=>{if(T.signal.aborted)return;Me=URL.createObjectURL(We.blob);const Tt={kind:"eda",sourcePath:We.path||S,objectUrl:Me,view:We.view,meta:{size:We.size,mimeType:We.mimeType,modified:We.modified}};if(We.view==="pcb-3d"){const dr=ne.current;dr&&dr.objectUrl!==Me&&URL.revokeObjectURL(dr.objectUrl),ne.current=Tt,q(Tt),Me=null}F(Tt),ze("eda_loaded",{bytes:We.size,view:We.view,mimeType:We.mimeType})}).catch(We=>{T.signal.aborted||(F({kind:"error",message:We instanceof Error&&/timed out/i.test(We.message)?o("rightSidebar.edaTimeout"):We instanceof Error?We.message:o("rightSidebar.edaLoadFailed")}),ze("error",{error:We instanceof Error?We.message:String(We)}))})}else if(Fn)mh(S,T.signal,"view_file",Se).then(K=>{Me=URL.createObjectURL(K.blob),F({kind:"image",objectUrl:Me,meta:{size:K.size,mimeType:K.mimeType,modified:K.modified}}),ze("image_loaded",{bytes:K.size,mimeType:K.mimeType})}).catch(K=>{T.signal.aborted||(F({kind:"error",message:K instanceof Error?K.message:o("rightSidebar.imageLoadFailed")}),ze("error",{error:K instanceof Error?K.message:String(K)}))});else if(cr)gh(S,T.signal,"view_file",Se).then(K=>{T.signal.aborted||(Me=URL.createObjectURL(K.blob),F({kind:"model3d",sourcePath:K.path||S,objectUrl:Me,ext:K.ext,meta:{size:K.size,mimeType:K.mimeType,modified:K.modified}}),ze("model3d_loaded",{bytes:K.size,ext:K.ext}))}).catch(K=>{T.signal.aborted||(F({kind:"error",message:K instanceof Error&&(K.name==="TimeoutError"||/timed out/i.test(K.message))?o("rightSidebar.model3dTimeout"):K instanceof Error?K.message:o("rightSidebar.model3dLoadFailed")}),ze("error",{error:K instanceof Error?K.message:String(K)}))});else if(ys){const K=bh(S)??"",We=$h(S);F(Tt=>Tt.kind==="video"&&Tt.url===We?Tt:{kind:"video",url:We,meta:{size:null,mimeType:K,modified:null}}),ze("video_ready",{mimeType:K})}else ed(S,T.signal,"view_file",Se).then(K=>{if(!T.signal.aborted){if(K.binary){F({kind:"binary"});return}F({kind:"text",content:K.content,sourcePath:K.path||S,meta:{size:K.size,truncated:K.truncated}}),ze("text_loaded",{bytes:K.size,truncated:!!K.truncated})}}).catch(K=>{T.signal.aborted||(F({kind:"error",message:K instanceof Error?K.message:"Failed to read file"}),ze("error",{error:K instanceof Error?K.message:String(K)}))});return()=>{T.abort(),yt(Se),window.clearTimeout(cn),window.clearTimeout(ws),Me&&URL.revokeObjectURL(Me),ze("cleanup")}},[a,G,Mn,Bt,I,o,ee]),n.useEffect(()=>{if(j.kind!=="model3d"||!a){Ne(null);return}let S=!1;const T=a.lastIndexOf("/"),ce=T>=0?a.slice(T+1):a,Se=T>=0?a.slice(0,T):"",Je=Se.lastIndexOf("/"),Te=Je>=0?Se.slice(0,Je):"",ze=ce.replace(/\.(stl|glb|gltf)$/i,""),Me=`${Te?`${Te}/`:""}features/${ze}.json`;return ed(Me).then(Ge=>{if(!S)try{const ot=JSON.parse(Ge.content);Ne(ot.version===1&&Array.isArray(ot.features)&&ot.features.length>0?ot.features:null)}catch{Ne(null)}}).catch(()=>{S||Ne(null)}),()=>{S=!0}},[j,a]),n.useEffect(()=>{if(j.kind!=="text"){Oe(null);return}const S=G&&a&&!a.startsWith("/")?`${G}/${a}`:a,T=yp(S),ce=j.content,Se=Ys(S??"")&&oe==="preview",Je=qs(S??"")&&Ie==="preview";if(!T||Se||Je||!wp(ce)){Oe(null);return}let Te=!1;const ze=Me=>{if(Te||!Me.registered(T)){Te||Oe(null);return}try{Oe(Sp(Me,ce,T))}catch{Oe(null)}};return Ve?ze(Ve):(Oe(null),kp().then(Me=>{Te||(Ae(Me),ze(Me))}).catch(()=>{})),()=>{Te=!0}},[j,Ve,a,G,oe,Ie]),n.useLayoutEffect(()=>{if(!kt||j.kind!=="text")return;const S=`${kt}:${oe}:${Ie}`;if(wr.current===S)return;const T=Kd(G,a);if(wr.current=S,!T)return;const ce=requestAnimationFrame(()=>{const Se=Pe.current;if(!Se)return;const Je=oe==="preview"?T.markdownTop??T.top:T.top;Se.scrollTo({top:Math.max(0,Je??0),left:Math.max(0,T.left??0)}),Be(oe==="preview"?Math.max(0,Je??0):0)});return()=>cancelAnimationFrame(ce)},[a,oe,Ie,j.kind,kt,G]),n.useEffect(()=>{kt&&Ui(G,a,{lineRange:M})},[a,M,kt,G]),n.useEffect(()=>{if(be==null||j.kind!=="text")return;ue(null),I({start:be,end:be});const S=be,T=requestAnimationFrame(()=>{const ce=we.current.get(S);ce&&ce.scrollIntoView({block:"center"}),_?.()});return()=>cancelAnimationFrame(T)},[be,j,I,_]);const Ln=n.useCallback(S=>{const T=Pe.current;if(!T)return!1;const ce=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(S):S.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),Se=T.querySelector(`#${ce}`);return Se?(Se.scrollIntoView({block:"start"}),!0):!1},[]);n.useEffect(()=>{const S=G&&a&&!a.startsWith("/")?`${G}/${a}`:a,T=j.kind==="text"&&Ys(S??"")&&oe==="preview";if(!Qt||!T)return;const ce=requestAnimationFrame(()=>{Ln(Qt)&&me(null)});return()=>cancelAnimationFrame(ce)},[a,Ln,oe,Qt,j,G]),n.useLayoutEffect(()=>{const S=Pe.current;if(!S||!M){ue(null);return}if(O)return;const T=j.kind==="image"||j.kind==="loading"&&j.mode==="image",ce=G&&a&&!a.startsWith("/")?`${G}/${a}`:a,Se=j.kind==="text"&&Ys(ce??"")&&oe==="preview",Je=j.kind==="text"&&qs(ce??"")&&Ie==="preview";if(j.kind!=="text"||T||Se||Je){ue(null);return}const Te=()=>{const Me=we.current.get(M.end);if(!Me||!S){ue(null);return}const Ge=Me.offsetTop+Me.offsetHeight/2,ot=S.scrollLeft+Math.max(8,S.clientWidth-120);ue({top:Ge,left:ot})};Te();const ze=new ResizeObserver(()=>Te());return ze.observe(S),()=>ze.disconnect()},[M,O,j,oe,Ie,a,G,bt]);const kr=j.kind==="text"&&!(qs(St??"")&&Ie==="preview")&&!St?.toLowerCase().endsWith(".csv")&&!St?.toLowerCase().endsWith(".kicad_pro")&&!St?.toLowerCase().endsWith(".kicad_prl"),In=n.useCallback(()=>{Ze(!1),ir(""),Q([]),Ye(0),oo(W.current)},[]),en=n.useCallback(()=>{!i||!kr||(Ze(!0),requestAnimationFrame(()=>{const S=ae.current;!he.current||!S?.isConnected||S.closest('[inert], [aria-hidden="true"], [hidden]')||S.getClientRects().length===0||getComputedStyle(S).visibility==="hidden"||!S.contains(document.activeElement)||(ht.current?.focus(),ht.current?.select())}))},[i,kr]),Dr=n.useCallback(S=>{Ye(T=>N.length===0?0:(T+S+N.length)%N.length)},[N.length]),Ut=n.useCallback(S=>{if(S.nativeEvent.isComposing||!eg(ae.current,i,S))return;const T=tg(S);if(T==="open"&&kr){S.preventDefault(),en();return}ye&&(T==="close"?(S.preventDefault(),In()):(T==="next"||T==="previous")&&(S.preventDefault(),Dr(T==="previous"?-1:1)))},[i,In,ye,Dr,en,kr]);if(n.useLayoutEffect(()=>{if(oo(W.current),!i||!ye||!wt.trim()||!Pe.current){Q([]),Ye(0);return}const S=ng(Pe.current,wt);return Q(S),Ye(0),(ae.current?.contains(document.activeElement)||Td(W.current))&&(Ii(S,0,W.current),Md(S[0])),()=>oo(W.current)},[i,ye,wt,bt,oe,j]),n.useEffect(()=>{!i||!ye||!wt.trim()||!ae.current?.contains(document.activeElement)&&!Td(W.current)||(Ii(N,ke,W.current),Md(N[ke]))},[i,ke,N,ye,wt]),n.useEffect(()=>()=>oo(W.current),[]),!a)return t.jsx("div",{className:"mx-3 mt-3 overflow-hidden rounded-xl border border-border/15 bg-surface-2 px-4 py-8 text-center text-sm text-muted-foreground",children:o("rightSidebar.selectFilePrompt")});const He=G&&!a.startsWith("/")?`${G}/${a}`:a,Et=ho(He,G),Sr=ru(He,G),Rr=j.kind==="text"&&j.content?j.content.split(`
1638
+ `);const b=f.length;f+=w.data,c.push({node:w,start:b,end:f.length,group:R}),p=R}const k=f.toLocaleLowerCase(),m=[];let x=0;for(;x<=k.length-i.length;){const w=k.indexOf(i,x);if(w<0)break;const R=w+i.length,b=c.find(P=>P.start<=w&&P.end>w),A=c.find(P=>P.start<R&&P.end>=R);if(b&&A&&b.group===A.group){const P=document.createRange();P.setStart(b.node,w-b.start),P.setEnd(A.node,R-A.start),m.push(P)}x=w+Math.max(i.length,1)}return m}function gu(){return typeof CSS<"u"&&CSS.highlights?CSS.highlights:null}let xo;function Td(r){return xo===r}function oo(r){if(r&&xo!==r)return;const a=gu();a?.delete(mu),a?.delete(Zi),xo=void 0}function Ii(r,a,i){const c=gu();if(!c||typeof Highlight>"u")return;xo=i,c.set(mu,new Highlight(...r));const f=r[a];f?c.set(Zi,new Highlight(f)):c.delete(Zi)}function Md(r){r?.startContainer.parentElement?.scrollIntoView({block:"center",inline:"nearest",behavior:"smooth"})}function sg(r){return Array.from(new Set(r.split(/[\n,]/).map(a=>a.trim().replace(/^!+/,"")).filter(Boolean))).slice(0,24)}function ag(r,a){const i=a.trim();return!i||i==="."?r:/^(?:[/\\]|[A-Za-z]:[/\\])/.test(i)?i.replace(/[\\/]+$/,""):`${r.replace(/[\\/]+$/,"")}/${i.replace(/^\.?[\\/]+/,"").replace(/[\\/]+$/,"")}`}function og(r,a){if(a===r)return".";const i=`${r.replace(/[\\/]+$/,"")}/`;return a.startsWith(i)?a.slice(i.length):a}function bu(r,a,i){return a?r:Qr.createPortal(r,i)}const ol="termdock:right-sidebar:file-tree-scroll:v1",il="termdock:right-sidebar:file-preview-reading-state:v1",ea="termdock:right-sidebar:file-tree-width:v1",xu="termdock:right-sidebar:markdown-view-mode:v1",vu="termdock:right-sidebar:diff-change-list-mode:v1",yu="termdock:right-sidebar:diff-wrap:v1",wu="termdock:diff-viewer:view-type:v1",ku="termdock:right-sidebar:file-search-mode:v1",$i="termdock:right-sidebar:collapsed-git-repo-groups:v1",Ld="termdock:right-sidebar:collapsed-diff-directories:v1",Fi="termdock:right-sidebar:branch-audit-module-open:v1",Su="termdock:right-sidebar:branch-audit-module:v1",ig=150,Id="termdock:right-sidebar:context-draft-enabled:v1",$d="termdock:right-sidebar:context-draft-collapsed:v1",Fd="termdock:right-sidebar:context-draft-auto-collapse:v1",Di="termdock:right-sidebar:context-draft-text:v1",lg=300,cg=20,dg=120,ug=250,fg=250,hg=120,pg=700,_i=600,mg=6e4;function Vs(r){return!!(r&&U.getState().nestedGitScanRoots[r])}const Dd=[2e3,5e3,15e3,3e4],gg=320,bg=500,xg=20,vg=12e3,el=300,_d=240,yg=560,Bd=n.lazy(()=>sl(()=>import("./ModelPreview-DjtHLlqP.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]))),wg=n.lazy(()=>sl(()=>import("./ArchitecturePanel-Bf4b-6An.js"),__vite__mapDeps([33,1,2,3,4,5,34,11,12,13,14,24,21,25,26,35,18,19,20,8,9,10,15,16,22,23,27,28,29,30,31,6,32,36])).then(r=>({default:r.ArchitecturePanel}))),kg=n.lazy(()=>sl(()=>import("./ComputerControlView-DjQLzn10.js").then(r=>r.a),__vite__mapDeps([37,1,2,3,4,5,29,31,15,38,30,39])));function Ru(r,a,i){return r&&!a?"unified":i}const Sg=new Set([".md",".markdown",".mdown",".mkdn",".mkd"]);function Rg(r){return r==="preview"||r==="source"}function jg(r){return r==="list"||r==="tree"||r==="ai"}function Ud(){return ct(xu,Rg)??"preview"}function Cg(){return ct(vu,jg)??"tree"}function ta(r){return typeof r=="boolean"}function Ng(r){return typeof r=="string"}function Pg(){return ct(yu,ta)??!0}function Eg(r){return r==="unified"||r==="split"}function Ag(){return ct(wu,Eg)??"unified"}function Tg(r){return r==="name"||r==="content"||r==="regex"}function Mg(){return ct(ku,Tg)??"name"}function ju(r){return r.repositories??(r.context?.root?[{id:r.context.root,root:r.context.root,relativeRoot:".",name:gt(r.context.root)||r.context.root,depth:0,nested:!1,available:r.available,files:r.files,context:r.context,error:r.error}]:[])}function Lg(r,a){if(!a)return null;const i=new Set((r.repoFilters??[]).map(c=>c.root));return i.has(a)?a:i.size>0?null:(r.repositories??[]).some(c=>c.root===a)?a:null}function tl(r){return!r.activeGitRepoRoot&&(r.groupCount>1||r.label!==r.rootName)}function Cu(...r){const a=new Set;for(const i of r)for(const c of i)a.add(c.root);return a}function rl(r){return Array.isArray(r)&&r.every(a=>typeof a=="string")}function Od(r){const a=ct(r,rl);return a?new Set(a):new Set}function Bi(r,a){Pt(r,[...a])}function Ig(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;const a=r;return typeof a.filePath=="string"&&typeof a.hunkHeader=="string"&&typeof a.hunkIndex=="number"&&typeof a.fingerprint=="string"&&typeof a.additions=="number"&&typeof a.deletions=="number"&&typeof a.diff=="string"&&(a.oldPath===void 0||a.oldPath===null||typeof a.oldPath=="string")&&(a.newPath===void 0||a.newPath===null||typeof a.newPath=="string")&&(a.source===void 0||a.source==="committed"||a.source==="uncommitted"||a.source==="unknown")&&(a.commit===void 0||a.commit===null||typeof a.commit=="string")}function $g(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;const a=r;return typeof a.available=="boolean"&&(a.repoRoot===void 0||typeof a.repoRoot=="string")&&(a.workspaceRoot===void 0||typeof a.workspaceRoot=="string")&&(a.baseRef===void 0||typeof a.baseRef=="string")&&(a.baseBranch===void 0||typeof a.baseBranch=="string")&&(a.currentBranch===void 0||a.currentBranch===null||typeof a.currentBranch=="string")&&(a.headRef===void 0||a.headRef===null||typeof a.headRef=="string")&&(a.diffFingerprint===void 0||typeof a.diffFingerprint=="string")&&(a.stat===void 0||typeof a.stat=="string")&&(a.files===void 0||rl(a.files))&&(a.hunks===void 0||Array.isArray(a.hunks)&&a.hunks.every(Ig))&&(a.commits===void 0||rl(a.commits))&&(a.commitCount===void 0||typeof a.commitCount=="number")&&(a.diff===void 0||typeof a.diff=="string")&&(a.truncated===void 0||typeof a.truncated=="boolean")&&(a.error===void 0||typeof a.error=="string")}function Fg(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;const a=r;return typeof a.key=="string"&&$g(a.diff)&&typeof a.repoLabel=="string"&&typeof a.createdAt=="number"}function Dg(r){return!r||typeof r!="object"||Array.isArray(r)?!1:Object.values(r).every(a=>{if(!a||typeof a!="object"||Array.isArray(a))return!1;const i=a;return Array.isArray(i.selectedRepoRoots)&&i.selectedRepoRoots.every(c=>typeof c=="string")&&!!i.repoTargetBranches&&typeof i.repoTargetBranches=="object"&&!Array.isArray(i.repoTargetBranches)&&Object.values(i.repoTargetBranches).every(c=>typeof c=="string")&&(i.repoBaseBranches===void 0||!!i.repoBaseBranches&&typeof i.repoBaseBranches=="object"&&!Array.isArray(i.repoBaseBranches)&&Object.values(i.repoBaseBranches).every(c=>typeof c=="string"))&&(i.previewEntries===void 0||Array.isArray(i.previewEntries)&&i.previewEntries.every(Fg))&&(i.selectedPreviewKey===void 0||i.selectedPreviewKey===null||typeof i.selectedPreviewKey=="string")&&(i.selectedPreviewFileKey===void 0||i.selectedPreviewFileKey===null||typeof i.selectedPreviewFileKey=="string")&&(i.previewDetailOpen===void 0||typeof i.previewDetailOpen=="boolean")&&(i.previewScrollTops===void 0||!!i.previewScrollTops&&typeof i.previewScrollTops=="object"&&!Array.isArray(i.previewScrollTops)&&Object.values(i.previewScrollTops).every(c=>typeof c=="number"))&&(i.previewMobileSlideIndex===void 0||typeof i.previewMobileSlideIndex=="number")&&(i.repoIncludeUncommitted===void 0||!!i.repoIncludeUncommitted&&typeof i.repoIncludeUncommitted=="object"&&!Array.isArray(i.repoIncludeUncommitted)&&Object.values(i.repoIncludeUncommitted).every(c=>typeof c=="boolean"))&&(i.includeUncommitted===void 0||typeof i.includeUncommitted=="boolean")&&typeof i.updatedAt=="number"})}function Hd(){return ct(Su,Dg)??{}}function zd(r){return[r.repoRoot,r.baseRef,r.branchName??"",r.headRef??"",r.diffFingerprint??""].join("\0")}function Gd(r){const a=r?.trim()??"",i=a.indexOf("/");return i>=0?a.slice(i+1):a}function Nu(r,a){const i=r?.trim(),c=a?.trim();return!i||!c?!1:i===c||Gd(i)===Gd(c)}function Wd(r){const a=r?.branch??null;return[r?.upstream,...r?.remoteBranches??[],...r?.branches??[]].find(c=>c&&!Nu(c,a))??""}function nl(r,a){const i=Math.max(_d,a-320),c=Math.min(yg,i);return Math.min(c,Math.max(_d,r))}function _g(r){return typeof r=="number"&&Number.isFinite(r)}function Bg(r){return nl(ct(ea,_g)??el,r)}function Pu(r){const a=r.split(/[\\/]/).pop()??r,i=a.lastIndexOf(".");return i>=0?a.slice(i).toLowerCase():""}function Ys(r){return Sg.has(Pu(r))}function cs({label:r,value:a,options:i,placeholder:c,searchPlaceholder:f,emptyText:p,disabled:g,onChange:k}){const{t:m}=_t(),[x,w]=n.useState(!1),[R,b]=n.useState(""),[A,P]=n.useState(null),$=n.useRef(null),D=n.useRef(null),te=R.trim().toLowerCase(),M=n.useMemo(()=>te?i.filter(_=>`${_.label} ${_.meta??""}`.toLowerCase().includes(te)):i,[te,i]),I=i.find(_=>_.value===a),H=()=>{const _=R.trim();_&&(k(_),w(!1),b(""))},Y=n.useCallback(()=>{const _=$.current?.getBoundingClientRect();if(!_)return!1;const o=12,ae=Math.max(220,Math.min(_.width,window.innerWidth-o*2)),W=Math.min(Math.max(o,_.left),window.innerWidth-ae-o),he=window.innerHeight-_.bottom-o,G=_.top-o,le=he>=180||he>=G,j=Math.max(96,(le?he:G)-4),F=Math.min(320,j);return P({left:W,top:le?_.bottom+4:Math.max(o,_.top-F-4),width:ae,maxHeight:F}),!0},[]),be=()=>{Y(),w(!0)};return n.useEffect(()=>{if(!x)return;let _=0;const o=()=>{_||(_=window.requestAnimationFrame(()=>{_=0,Y()}))},ae=W=>{const he=W.target;he instanceof Node&&($.current?.contains(he)||D.current?.contains(he)||(w(!1),b("")))};return window.addEventListener("resize",o),window.addEventListener("scroll",o,!0),document.addEventListener("pointerdown",ae,!0),()=>{_&&window.cancelAnimationFrame(_),window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0),document.removeEventListener("pointerdown",ae,!0)}},[x,Y]),t.jsxs("div",{className:"relative min-w-0",children:[t.jsxs("button",{ref:$,type:"button",disabled:g,onClick:()=>{if(!g){if(b(""),x){w(!1);return}be()}},className:"group flex w-full items-center justify-between gap-2 min-h-10 rounded-md border border-transparent bg-surface-2 px-3 py-2 text-left transition hover:bg-surface-elevated focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:[t.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-3",children:[t.jsx("span",{className:"shrink-0 text-[11px] text-muted-foreground",children:r}),t.jsx("span",{className:`min-w-0 flex-1 truncate text-[13px] ${a?"text-foreground":"text-muted-foreground/70"}`,children:I?.label??(a||c)})]}),t.jsx(aa,{size:13,className:`shrink-0 text-muted-foreground transition group-hover:text-foreground ${x?"rotate-180":""}`})]}),x&&!g&&typeof document<"u"&&Qr.createPortal(t.jsxs("div",{ref:D,className:"fixed z-popover overflow-hidden rounded-lg border border-border/15 bg-surface shadow-lg",onClick:_=>_.stopPropagation(),style:{left:A?.left??12,top:A?.top??12,width:A?.width??260,maxHeight:A?.maxHeight??320},children:[t.jsx("div",{className:"border-b border-border/10 p-1.5",children:t.jsxs("div",{className:"flex items-center gap-1.5 rounded-md bg-surface-2 px-2 py-1.5",children:[t.jsx(us,{size:12,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{autoFocus:!0,value:R,onChange:_=>b(_.target.value),onKeyDown:_=>{if(_.key==="Escape"){_.preventDefault(),w(!1),b("");return}_.key==="Enter"&&(_.preventDefault(),H())},onBlur:()=>{R.trim()&&M.length===0&&H()},placeholder:f,className:"min-w-0 flex-1 bg-transparent text-[12px] text-foreground outline-none placeholder:text-muted-foreground/70"})]})}),t.jsxs("div",{className:"overflow-y-auto p-1",style:{maxHeight:Math.max(96,(A?.maxHeight??320)-46)},children:[R.trim()&&!i.some(_=>_.value===R.trim())&&t.jsxs("button",{type:"button",onMouseDown:_=>_.preventDefault(),onClick:H,className:"mb-1 flex w-full items-center justify-between gap-2 rounded-md bg-primary/10 px-2 py-1.5 text-left text-[12px] font-medium text-primary transition hover:bg-primary/15",children:[t.jsx("span",{className:"min-w-0 truncate",children:R.trim()}),t.jsx("span",{className:"shrink-0 text-[10px] text-primary/75",children:m("common.use")})]}),M.length>0?M.map(_=>t.jsxs("button",{type:"button",onClick:()=>{k(_.value),w(!1),b("")},className:`flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-left text-[12px] transition hover:bg-surface-2 ${_.value===a?"bg-accent/10 text-accent":"text-foreground"}`,children:[t.jsx("span",{className:"min-w-0 truncate font-medium",children:_.label}),_.meta&&t.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:_.meta})]},_.value)):t.jsx("div",{className:"px-2 py-2 text-[11px] text-muted-foreground",children:p})]})]}),document.body)]})}function qd({open:r,onOpenChange:a,showScopePicker:i,selectedAll:c,repos:f,selectedRoots:p,onToggleRepo:g,onGenerate:k,onSecondaryAction:m,disabled:x,generateDisabled:w,secondaryDisabled:R,inserted:b,buttonLabel:A,insertedLabel:P,title:$,ariaLabel:D,scopeTitle:te,scopeLabel:M,allLabel:I,generateLabel:H,secondaryLabel:Y,secondaryTitle:be,secondaryLoading:_,loading:o,error:ae,statusTitle:W,extraContent:he,renderRepoExtra:G,menuItem:le=!1}){return t.jsxs("div",{className:le?"relative w-full":"relative inline-flex shrink-0",children:[t.jsxs("button",{type:"button",role:le?"menuitem":void 0,tabIndex:le?-1:void 0,onClick:j=>{i?a(!r):w||k(j.currentTarget)},disabled:x,className:`relative flex items-center rounded-md transition disabled:cursor-not-allowed disabled:opacity-50 ${le?"min-h-10 w-full gap-2.5 px-2.5 text-left text-[12px] focus:bg-surface-2 focus:outline-none [@media(pointer:coarse)]:min-h-11":"h-7 shrink-0 justify-center gap-1 px-2 text-[11px] font-medium active:scale-95"} ${ae?"text-destructive hover:bg-destructive/5":b?"bg-surface-elevated text-foreground":le?"text-foreground hover:bg-surface-2":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,"aria-label":D,title:W??(i?`${te}: ${M}`:$),children:[o?t.jsx(lt,{size:le?15:13,className:"shrink-0 animate-spin"}):t.jsx(sa,{size:le?15:13,className:le?"shrink-0 text-muted-foreground":void 0}),t.jsx("span",{className:le?"min-w-0 flex-1":void 0,children:b?P:A}),i&&(le?t.jsx(ds,{size:13,className:"shrink-0 text-muted-foreground"}):t.jsx(aa,{size:11,className:`shrink-0 transition ${r?"rotate-180":""}`})),ae&&t.jsx("span",{className:"absolute right-0.5 top-0.5 size-1.5 rounded-full bg-destructive"})]}),i&&r&&typeof document<"u"&&Qr.createPortal(t.jsx("div",{className:"fixed inset-0 z-modal-backdrop bg-[var(--app-backdrop)] px-3 py-6 backdrop-blur-sm animate-fade-in",onClick:()=>a(!1),children:t.jsxs("div",{className:"fixed left-1/2 top-1/2 z-modal-panel flex max-h-[min(82vh,36rem)] w-[calc(100vw-1.5rem)] max-w-[42rem] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-border/20 bg-surface text-[11px] shadow-2xl",onClick:j=>j.stopPropagation(),children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border/15 px-3 py-2",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-[12px] font-semibold text-foreground",children:te}),t.jsx("div",{className:"mt-0.5 truncate text-[10px] text-muted-foreground",children:M})]}),t.jsx("button",{type:"button",onClick:()=>a(!1),className:"inline-flex h-7 w-7 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","aria-label":"Close",children:t.jsx(Xt,{size:14})})]}),t.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-2",children:[he,t.jsxs("button",{type:"button",onClick:()=>g(null),className:`flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-left font-medium transition ${c?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,children:[t.jsx("span",{className:"truncate",children:I}),c&&t.jsx("span",{className:"text-[10px]",children:"✓"})]}),f.map(j=>{const F=p.includes(j.root);return t.jsxs("div",{className:`mt-1 rounded-md transition ${F?"bg-primary/15 text-primary":""}`,children:[t.jsxs("button",{type:"button",onClick:()=>g(j.root),className:`flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-left font-medium transition ${F?"text-primary":"text-muted-foreground hover:bg-surface-2 hover:text-foreground"}`,title:j.root,children:[t.jsxs("span",{className:"min-w-0",children:[t.jsx("span",{className:"block truncate",children:j.label}),j.branch&&t.jsx("span",{className:"block truncate text-[9px] opacity-70",children:j.branch})]}),F&&t.jsx("span",{className:"text-[10px]",children:"✓"})]}),G&&(c||F)&&t.jsx("div",{className:"px-2 pb-2",children:G(j)})]},j.root)})]}),t.jsxs("div",{className:`grid grid-cols-1 gap-1.5 border-t border-border/15 p-2 ${m&&Y?"sm:grid-cols-2":""}`,children:[m&&Y&&t.jsxs("button",{type:"button",onClick:()=>{R||(a(!1),m())},disabled:R,className:"flex h-7 w-full items-center justify-center gap-1 rounded-md bg-surface-2 px-2 text-[11px] font-semibold text-muted-foreground transition hover:bg-surface-elevated hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50 active:scale-95",title:be,children:[_?t.jsx(lt,{size:12,className:"animate-spin"}):t.jsx(lu,{size:12}),Y]}),t.jsxs("button",{type:"button",onClick:async j=>{if(w)return;await k(j.currentTarget)!==!1&&a(!1)},disabled:w,className:"flex h-7 w-full items-center justify-center gap-1 rounded-md bg-primary/15 px-2 text-[11px] font-semibold text-primary transition hover:bg-primary/25 disabled:cursor-not-allowed disabled:opacity-50 active:scale-95",title:$,children:[t.jsx(sa,{size:12}),H]})]})]})}),document.body)]})}function Ug(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;for(const a of Object.values(r)){if(!a||typeof a!="object"||Array.isArray(a))return!1;const i=a;if(typeof i.top!="number"||!Number.isFinite(i.top)||typeof i.updatedAt!="number"||!Number.isFinite(i.updatedAt))return!1}return!0}function Eu(){return ct(ol,Ug)??{}}function Og(r,a){const i=Eu(),c=Object.entries({...i,[r]:{top:a,updatedAt:Date.now()}}).sort(([,f],[,p])=>p.updatedAt-f.updatedAt).slice(0,cg);ra(ol,Object.fromEntries(c),ug)}function Hg(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;const a=r;return typeof a.start=="number"&&Number.isFinite(a.start)&&typeof a.end=="number"&&Number.isFinite(a.end)&&a.start>=1&&a.end>=a.start}function zg(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;for(const a of Object.values(r)){if(!a||typeof a!="object"||Array.isArray(a))return!1;const i=a;if(typeof i.top!="number"||!Number.isFinite(i.top)||i.left!==void 0&&(typeof i.left!="number"||!Number.isFinite(i.left))||i.markdownTop!==void 0&&(typeof i.markdownTop!="number"||!Number.isFinite(i.markdownTop))||i.lineRange!==void 0&&i.lineRange!==null&&!Hg(i.lineRange)||typeof i.updatedAt!="number"||!Number.isFinite(i.updatedAt))return!1}return!0}function ll(r,a){if(!a)return null;const i=r&&!a.startsWith("/")?`${r}/${a}`:a;return r?`${r}::${i}`:i}function Au(){return ct(il,zg)??{}}function Kd(r,a){const i=ll(r,a);return i?Au()[i]??null:null}function Ui(r,a,i){const c=ll(r,a);if(!c)return;const f=Au(),p=f[c]??{top:0,left:0,markdownTop:0,lineRange:null,updatedAt:Date.now()},g=Object.entries({...f,[c]:{...p,...i,updatedAt:Date.now()}}).sort(([,k],[,m])=>m.updatedAt-k.updatedAt).slice(0,dg);ra(il,Object.fromEntries(g),fg)}function Oi({slow:r}){return t.jsx(ap,{slow:r})}function io({message:r,onRetry:a}){const{t:i}=_t();return t.jsxs("div",{className:"mx-3 mt-3 overflow-hidden rounded-xl border border-destructive/20 bg-destructive/5 px-4 py-5 text-center text-sm text-destructive",children:[t.jsx("div",{className:"font-medium",children:i("rightSidebar.gitChangesLoadFailed")}),t.jsx("div",{className:"mt-1 break-words text-xs opacity-85",children:r}),t.jsx("button",{type:"button",onClick:a,className:"mt-3 rounded-full bg-destructive/10 px-3 py-1.5 text-xs font-semibold text-destructive transition hover:bg-destructive/15 active:scale-95",children:i("rightSidebar.retryGitChanges")})]})}function ho(r,a){const i=a&&r.startsWith(`${a}/`)?r.slice(a.length+1):r,c=i.split("/").filter(Boolean);return{name:c.pop()||i,dir:c.join("/")}}function gt(r){if(!r)return"";const a=r.replace(/\/+$/,"");return a.split("/").pop()||a||"/"}function lo(r){if(!r)return null;const a=r.replace(/\/+$/,"")||"/";if(a==="/")return null;const i=a.slice(0,a.lastIndexOf("/"))||"/";return i===a?null:i}function Gg(r,a,i){return Vi(r,a,i)}function Tu(r){const a=new Map;for(const i of r)a.set(cl(i),i);return a}function Mu(r,a){const i=new Map(r);for(const c of a)i.set(cl(c),c);return i}function Vd(r,a){let i=0;for(const c of r){const f=ut(c,a);f&&a&&f!==a&&(i+=1)}return i}function Wg(r){return r.reduce((a,i)=>a+(i.staged?1:0),0)}function qg(r,a){return Array.from(Mu(Tu(r),a).values()).sort((i,c)=>i.path.localeCompare(c.path))}function Kg(r,a){const i=r.relativeRoot==="."?gt(a??r.root)||r.name||r.root:r.relativeRoot||r.name||gt(r.root)||r.root;return{root:r.root,label:i,branch:r.context?.branch??null,count:r.files.length,staged:Wg(r.files)}}function Lu(r,a){const i=gt(a??"")||a||"";return r.map(c=>Kg(c,a)).sort((c,f)=>i&&c.label===i?-1:i&&f.label===i?1:c.label.localeCompare(f.label))}function Iu(r,a,i,c,f){const p=ju(i),g=p.find($=>$.root===c)??p[0]??null,k=a.find($=>$.root===c)??null,m=k?.relativeRoot??g?.relativeRoot??".",x=k?.name??g?.name??(gt(c)||c),w=(g?.files??i.files).map($=>({...$,repoRoot:c,repoRelativeRoot:m,repoName:x})),R=g?.context??i.context,b={...k??g??{id:c,root:c,relativeRoot:m,name:x,depth:0,nested:!!(f&&c!==f),available:i.available,files:[],context:null},...g??{},id:k?.id??g?.id??c,root:c,displayRoot:k?.displayRoot??g?.displayRoot,relativeRoot:m,name:x,depth:k?.depth??g?.depth??0,nested:k?.nested??g?.nested??!!(f&&c!==f),available:g?.available??i.available,deferred:g?.deferred??!1,files:w,context:R?{...R,root:c,changedFiles:w.map($=>({path:$.path,absolutePath:$.absolutePath,status:$.status}))}:null,untrackedDeferred:g?.untrackedDeferred??i.untrackedDeferred,error:g?.error??i.error},A=k?a.map($=>$.root===c?b:$):[...a,b];return{files:Array.from(r).filter($=>ut($,f)!==c).concat(w),repositories:A,repoFilters:Lu(A,f)}}function ut(r,a){return r.repoRoot??a}function cl(r){return`${r.repoRoot??""}\0${r.path}`}function xr(r){return r.absolutePath||r.path}function Hi(r){return cl(r)}function Vg(r){return r.repoRelativeRoot&&r.repoRelativeRoot!=="."?r.repoRelativeRoot:r.repoName??""}function Yd(r){return r.reduce((a,i)=>a+(i.staged?1:0),0)}function Xd(r){const a={added:0,modified:0,deleted:0,renamed:0,copied:0,untracked:0,conflicted:0,staged:0,other:0};for(const i of r)i.status==="added"?a.added+=1:i.status==="modified"?a.modified+=1:i.status==="deleted"?a.deleted+=1:i.status==="renamed"?a.renamed+=1:i.status==="copied"?a.copied+=1:i.status==="untracked"?a.untracked+=1:i.status==="conflicted"?a.conflicted+=1:a.other+=1,i.staged&&(a.staged+=1);return a}function Xs(r){let a=0;const i=r??"root";for(let c=0;c<i.length;c+=1)a=Math.imul(a^i.charCodeAt(c),16777619);return`right-sidebar-git-bundle:${(a>>>0).toString(36)}`}function Js(r,a){return typeof r!="number"||!Number.isFinite(r)||r<=0?null:new Intl.DateTimeFormat(a==="zh"?"zh-CN":"en",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(r))}function vr(r){return r instanceof DOMException&&r.name==="AbortError"}function Yg(r){const a=r.error??r.context?.error??"";return a.includes("request was cancelled")||a.includes("IO_REQUEST_CANCELLED")}function Jd(r){return r?.available===!1&&r.code==="NOT_GIT_REPOSITORY"}function Xg({actions:r,running:a,completed:i}){const{t:c}=_t(),[f,p]=n.useState(!1),g=n.useRef(null),k=r.find(x=>a?.action===x.key),m=r.find(x=>i?.action===x.key);return r.length===0?null:(n.useEffect(()=>{if(!f)return;const x=R=>{const b=R.target;b instanceof Node&&g.current?.contains(b)||p(!1)},w=R=>{R.key==="Escape"&&p(!1)};return document.addEventListener("pointerdown",x),document.addEventListener("keydown",w),()=>{document.removeEventListener("pointerdown",x),document.removeEventListener("keydown",w)}},[f]),t.jsxs("div",{ref:g,className:"relative shrink-0",children:[t.jsx("button",{type:"button",onClick:x=>{x.stopPropagation(),p(w=>!w)},disabled:r.every(x=>x.disabled)&&!a&&!i,className:`inline-flex h-6 min-w-6 shrink-0 items-center justify-center rounded-md transition active:scale-95 disabled:opacity-50 ${f?"bg-surface-elevated text-foreground":m?"bg-accent/10 text-accent":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,title:k?.label??m?.label??c("rightSidebar.gitQuickActions"),children:k?t.jsx(lt,{size:13,className:"animate-spin"}):m?t.jsx("span",{className:"text-[12px] font-semibold",children:"✓"}):t.jsx(po,{size:14})}),f&&t.jsx("div",{className:"absolute right-0 top-[calc(100%+2px)] z-30 w-44 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:r.map(x=>{const w=a?.action===x.key,R=i?.action===x.key;return t.jsxs("button",{type:"button",onClick:b=>{b.stopPropagation(),x.onClick(),p(!1)},disabled:x.disabled||!!a,className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left font-medium transition active:scale-[0.99] disabled:opacity-50 ${R?"bg-accent/10 text-accent":x.destructive?"text-destructive hover:bg-destructive/10":"text-foreground hover:bg-surface-2"}`,children:[t.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:w?t.jsx(lt,{size:13,className:"animate-spin"}):R?"✓":null}),t.jsx("span",{className:"min-w-0 flex-1 truncate",children:x.label})]},x.key)})})]}))}function Jg(r){const a=window.getComputedStyle(r).overflowY;return(a==="auto"||a==="scroll")&&r.scrollHeight>r.clientHeight+1}function $u(r){let a=r;for(;a;){if(a.classList.contains("termdock-diff-stream-scroller")&&Jg(a))return a;a=a.parentElement}return r.closest(".termdock-diff-stream-scroller")}function fs(r){return r.getClientRects().length>0&&window.getComputedStyle(r).visibility!=="hidden"}const zi=new WeakMap;function vo(r){const a=zi.get(r);a!==void 0&&window.clearTimeout(a),r.classList.remove("diff-walkthrough-target"),r.offsetWidth,r.classList.add("diff-walkthrough-target");const i=window.setTimeout(()=>{r.classList.remove("diff-walkthrough-target"),zi.delete(r)},1700);zi.set(r,i)}function Qg(r){const a=CSS.escape(r),i=[`[data-diff-stream-item="${a}"]`,`[data-diff-selection-path="${a}"]`,`[data-diff-absolute-path="${a}"]`].join(","),c=Array.from(document.querySelectorAll(".termdock-diff-stream-scroller"));let f=null;for(const k of c){if(!fs(k))continue;const m=k.querySelector(i);if(m&&fs(m)){f=m;break}}if(f??=Array.from(document.querySelectorAll(i)).find(fs)??null,!f)return;const p=$u(f);if(!p){f.scrollIntoView({block:"start",behavior:"smooth"}),vo(f);return}const g=f.getBoundingClientRect().top-p.getBoundingClientRect().top+p.scrollTop;p.scrollTo({top:Math.max(0,g),behavior:"instant"}),vo(f)}function Tn(r){const a=CSS.escape(r.filePath),i=typeof r.sectionIndex=="number"?String(r.sectionIndex):null,c=typeof r.hunkIndex=="number"?String(r.hunkIndex):null,f=r.sectionFingerprint?CSS.escape(r.sectionFingerprint):null,p=r.hunkFingerprint?CSS.escape(r.hunkFingerprint):null,g=[i!==null&&f?`[data-diff-section-audit="${a}"][data-diff-section-index="${i}"][data-diff-section-fingerprint="${f}"]`:null,i!==null&&f?`[data-diff-section-anchor="${a}"][data-diff-section-index="${i}"][data-diff-section-fingerprint="${f}"]`:null,i!==null?`[data-diff-section-audit="${a}"][data-diff-section-index="${i}"]`:null,i!==null?`[data-diff-section-anchor="${a}"][data-diff-section-index="${i}"]`:null,c!==null&&p?`[data-diff-hunk-anchor="${a}"][data-diff-hunk-index="${c}"][data-diff-hunk-fingerprint="${p}"]`:null,c!==null?`[data-diff-hunk-anchor="${a}"][data-diff-hunk-index="${c}"]`:null,`[data-diff-file-path="${a}"]`].filter(P=>!!P),k=Array.from(document.querySelectorAll(".termdock-diff-stream-scroller"));let m=null;for(const P of k)if(fs(P)){for(const $ of g){const D=P.querySelector($);if(D&&fs(D)){m=D;break}}if(m)break}if(m??=g.flatMap(P=>Array.from(document.querySelectorAll(P))).find(fs)??null,!m){Qg(r.filePath);return}const x=$u(m);if(!x){m.scrollIntoView({block:"center",behavior:"smooth"}),vo(m);return}const w=m.getBoundingClientRect(),R=x.getBoundingClientRect(),A=w.top-R.top+x.scrollTop-Math.max(24,(x.clientHeight-w.height)/2);x.scrollTo({top:Math.max(0,A),behavior:"instant"}),vo(m)}let Zg=0,eb=0,tb=0,rb=0,nb=0;function st(r,a={}){if(typeof window>"u")return;const i=JSON.stringify({level:r==="error"||r==="empty_bundle"?"warn":"info",message:`GIT_BUNDLE ${r}`,data:{seq:++eb,ts:Date.now(),...a}});fetch("/api/client-log",{method:"POST",headers:{"Content-Type":"application/json"},body:i,keepalive:!0}).catch(()=>{})}function Qs(r,a={}){if(typeof window>"u")return;const i=JSON.stringify({level:"info",message:`DIFF_INTERACTION ${r}`,data:{seq:++rb,ts:Date.now(),...a}});fetch("/api/client-log",{method:"POST",headers:{"Content-Type":"application/json"},body:i,keepalive:!0}).catch(()=>{})}function sb(){return`diff-ui-${Date.now().toString(36)}-${(++nb).toString(36)}`}function ab(r){return r instanceof Element?r.closest("[data-diff-selection-path]"):null}function ob(r){const a=r.target instanceof HTMLElement?r.target:null;return{eventType:r.type,button:r.button,pointerType:r instanceof globalThis.PointerEvent?r.pointerType:void 0,targetTag:a?.tagName,targetClass:a?.className,targetText:a?.textContent?.slice(0,80)}}function yo({onReviewReference:r,filePath:a,active:i=!0,onInsertReference:c,onInsertText:f,onInsertFeature:p,onReferenceCopied:g,onClose:k,onDirectoryLinkOpen:m,isMobile:x,markdownOutlineOpen:w,markdownOutlineCloseSignal:R,onOpenMarkdownOutline:b,onCloseMarkdownOutline:A,markdownImageLightboxOpen:P,markdownImageLightboxCloseSignal:$,onOpenMarkdownImageLightbox:D,onCloseMarkdownImageLightbox:te,lineRange:M,onLineRangeChange:I,insertedReferenceKey:H,copiedReferenceKey:Y,scrollToLine:be,onScrollToLineHandled:_}){const{t:o}=_t(),ae=n.useRef(null),W=n.useRef({}),he=n.useRef(i);he.current=i,n.useEffect(()=>{i||ae.current?.querySelectorAll("video").forEach(S=>S.pause())},[i]);const G=U(S=>S.rootPath),le=U(S=>S.selectFile),[j,F]=n.useState({kind:"idle"}),[ee,C]=n.useState("schematic"),[L,q]=n.useState(null),ne=n.useRef(null),[pe,Ne]=n.useState(null),we=n.useRef(new Map),Pe=n.useRef(null),[O,ue]=n.useState(null),[oe,Fe]=n.useState(()=>Ud()),[Ie,E]=n.useState(()=>Pd(G,a)),xe=n.useRef(null),[ge,De]=n.useState(!1),[Ve,Ae]=n.useState(null),[Jt,Be]=n.useState(0),[ft,Ue]=n.useState([]),[Qt,me]=n.useState(null),dt=n.useRef(null),at=n.useRef(a),[bt,Oe]=n.useState(null),V=wm(G&&a&&!a.startsWith("/")?`${G}/${a}`:a,i),[ye,Ze]=n.useState(!1),[wt,ir]=n.useState(""),[N,Q]=n.useState([]),[ke,Ye]=n.useState(0),ht=n.useRef(null),yr=tu(g),kt=ll(G,a);n.useEffect(()=>{if(at.current===a)return;at.current=a;const S=a&&G&&!a.startsWith("/")?`${G}/${a}`:a;if(dt.current===S){dt.current=null;return}dt.current=null,Ue([]),me(null),Ze(!1),ir("")},[a,G]);const St=a?G&&!a.startsWith("/")?`${G}/${a}`:a:null,Mn=U(S=>St?(S.fileChangeVersions.get(St)??0)+S.fileWatchEpoch:S.fileWatchEpoch),hs=n.useRef(null),wr=n.useRef(null),[Bt,Zr]=n.useState(0),Zt=n.useCallback(()=>Zr(S=>S+1),[]);n.useEffect(()=>{const S=ne.current;return ne.current=null,q(null),S&&URL.revokeObjectURL(S.objectUrl),()=>{const T=ne.current;ne.current=null,T&&URL.revokeObjectURL(T.objectUrl)}},[St,Mn,Bt]),n.useEffect(()=>{if(!a){hs.current=null,F({kind:"idle"});return}const S=G&&!a.startsWith("/")?`${G}/${a}`:a,T=new AbortController,ce=++Zg,Se=`right-sidebar-file-preview:${ce}`,Je=performance.now();let Te=!1;const ze=(K,We={})=>{Te||(Te=!0,Ei("end",{loadingId:ce,reason:K,durationMs:Math.round(performance.now()-Je),filePath:a,fullPath:S,rootPath:G,...We}))};let Me=null;const Ge=oh(S),ot=Ge?S.toLowerCase().endsWith(".kicad_pcb")?ee==="schematic"?"pcb-front":ee:"schematic":ee,Fn=!Ge&&ih(S),cr=!Ge&&!Fn&&lh(S),ys=!Ge&&!Fn&&!cr&&ch(S),an=Ys(S),on=qs(S),zr=Ge?"eda":Fn?"image":cr?"model3d":ys?"video":"text",ln=hs.current!==S;if(hs.current=S,ln){Ei("start",{loadingId:ce,filePath:a,fullPath:S,rootPath:G,mode:zr,externalVersion:Mn}),F({kind:"loading",mode:zr}),wr.current=null;const K=Kd(G,a);I(K?.lineRange??null),Fe(an?Ud():"source"),E(on?Pd(G,a):"source"),Ge&&C(dh(S))}ln||F(K=>K.kind==="error"?{kind:"loading",mode:zr}:K);const cn=window.setTimeout(()=>{Te||T.signal.aborted||Ei("still_active",{loadingId:ce,filePath:a,fullPath:S,rootPath:G,mode:zr,durationMs:Math.round(performance.now()-Je),isPathChange:ln})},3e3),ws=window.setTimeout(()=>{if(Te||T.signal.aborted)return;const K=Ge?o("rightSidebar.edaTimeout"):cr?o("rightSidebar.model3dTimeout"):"File preview timed out. Try the file again or refresh the directory.";T.abort(new DOMException(K,"TimeoutError")),F({kind:"error",message:K}),ze("stuck_timeout",{error:K})},Ge?uh+5e3:cr?fh+5e3:hh(S)?35e3:vg);if(Ge){const K=ot==="pcb-3d"?ne.current:null;K?(F(K),ze("eda_3d_client_cache_hit",{bytes:K.meta.size,view:K.view,mimeType:K.meta.mimeType})):ph(S,ot,T.signal,"view_file",Se).then(We=>{if(T.signal.aborted)return;Me=URL.createObjectURL(We.blob);const Tt={kind:"eda",sourcePath:We.path||S,objectUrl:Me,view:We.view,meta:{size:We.size,mimeType:We.mimeType,modified:We.modified}};if(We.view==="pcb-3d"){const dr=ne.current;dr&&dr.objectUrl!==Me&&URL.revokeObjectURL(dr.objectUrl),ne.current=Tt,q(Tt),Me=null}F(Tt),ze("eda_loaded",{bytes:We.size,view:We.view,mimeType:We.mimeType})}).catch(We=>{T.signal.aborted||(F({kind:"error",message:We instanceof Error&&/timed out/i.test(We.message)?o("rightSidebar.edaTimeout"):We instanceof Error?We.message:o("rightSidebar.edaLoadFailed")}),ze("error",{error:We instanceof Error?We.message:String(We)}))})}else if(Fn)mh(S,T.signal,"view_file",Se).then(K=>{Me=URL.createObjectURL(K.blob),F({kind:"image",objectUrl:Me,meta:{size:K.size,mimeType:K.mimeType,modified:K.modified}}),ze("image_loaded",{bytes:K.size,mimeType:K.mimeType})}).catch(K=>{T.signal.aborted||(F({kind:"error",message:K instanceof Error?K.message:o("rightSidebar.imageLoadFailed")}),ze("error",{error:K instanceof Error?K.message:String(K)}))});else if(cr)gh(S,T.signal,"view_file",Se).then(K=>{T.signal.aborted||(Me=URL.createObjectURL(K.blob),F({kind:"model3d",sourcePath:K.path||S,objectUrl:Me,ext:K.ext,meta:{size:K.size,mimeType:K.mimeType,modified:K.modified}}),ze("model3d_loaded",{bytes:K.size,ext:K.ext}))}).catch(K=>{T.signal.aborted||(F({kind:"error",message:K instanceof Error&&(K.name==="TimeoutError"||/timed out/i.test(K.message))?o("rightSidebar.model3dTimeout"):K instanceof Error?K.message:o("rightSidebar.model3dLoadFailed")}),ze("error",{error:K instanceof Error?K.message:String(K)}))});else if(ys){const K=bh(S)??"",We=$h(S);F(Tt=>Tt.kind==="video"&&Tt.url===We?Tt:{kind:"video",url:We,meta:{size:null,mimeType:K,modified:null}}),ze("video_ready",{mimeType:K})}else ed(S,T.signal,"view_file",Se).then(K=>{if(!T.signal.aborted){if(K.binary){F({kind:"binary"});return}F({kind:"text",content:K.content,sourcePath:K.path||S,meta:{size:K.size,truncated:K.truncated}}),ze("text_loaded",{bytes:K.size,truncated:!!K.truncated})}}).catch(K=>{T.signal.aborted||(F({kind:"error",message:K instanceof Error?K.message:"Failed to read file"}),ze("error",{error:K instanceof Error?K.message:String(K)}))});return()=>{T.abort(),yt(Se),window.clearTimeout(cn),window.clearTimeout(ws),Me&&URL.revokeObjectURL(Me),ze("cleanup")}},[a,G,Mn,Bt,I,o,ee]),n.useEffect(()=>{if(j.kind!=="model3d"||!a){Ne(null);return}let S=!1;const T=a.lastIndexOf("/"),ce=T>=0?a.slice(T+1):a,Se=T>=0?a.slice(0,T):"",Je=Se.lastIndexOf("/"),Te=Je>=0?Se.slice(0,Je):"",ze=ce.replace(/\.(stl|glb|gltf)$/i,""),Me=`${Te?`${Te}/`:""}features/${ze}.json`;return ed(Me).then(Ge=>{if(!S)try{const ot=JSON.parse(Ge.content);Ne(ot.version===1&&Array.isArray(ot.features)&&ot.features.length>0?ot.features:null)}catch{Ne(null)}}).catch(()=>{S||Ne(null)}),()=>{S=!0}},[j,a]),n.useEffect(()=>{if(j.kind!=="text"){Oe(null);return}const S=G&&a&&!a.startsWith("/")?`${G}/${a}`:a,T=yp(S),ce=j.content,Se=Ys(S??"")&&oe==="preview",Je=qs(S??"")&&Ie==="preview";if(!T||Se||Je||!wp(ce)){Oe(null);return}let Te=!1;const ze=Me=>{if(Te||!Me.registered(T)){Te||Oe(null);return}try{Oe(Sp(Me,ce,T))}catch{Oe(null)}};return Ve?ze(Ve):(Oe(null),kp().then(Me=>{Te||(Ae(Me),ze(Me))}).catch(()=>{})),()=>{Te=!0}},[j,Ve,a,G,oe,Ie]),n.useLayoutEffect(()=>{if(!kt||j.kind!=="text")return;const S=`${kt}:${oe}:${Ie}`;if(wr.current===S)return;const T=Kd(G,a);if(wr.current=S,!T)return;const ce=requestAnimationFrame(()=>{const Se=Pe.current;if(!Se)return;const Je=oe==="preview"?T.markdownTop??T.top:T.top;Se.scrollTo({top:Math.max(0,Je??0),left:Math.max(0,T.left??0)}),Be(oe==="preview"?Math.max(0,Je??0):0)});return()=>cancelAnimationFrame(ce)},[a,oe,Ie,j.kind,kt,G]),n.useEffect(()=>{kt&&Ui(G,a,{lineRange:M})},[a,M,kt,G]),n.useEffect(()=>{if(be==null||j.kind!=="text")return;ue(null),I({start:be,end:be});const S=be,T=requestAnimationFrame(()=>{const ce=we.current.get(S);ce&&ce.scrollIntoView({block:"center"}),_?.()});return()=>cancelAnimationFrame(T)},[be,j,I,_]);const Ln=n.useCallback(S=>{const T=Pe.current;if(!T)return!1;const ce=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(S):S.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),Se=T.querySelector(`#${ce}`);return Se?(Se.scrollIntoView({block:"start"}),!0):!1},[]);n.useEffect(()=>{const S=G&&a&&!a.startsWith("/")?`${G}/${a}`:a,T=j.kind==="text"&&Ys(S??"")&&oe==="preview";if(!Qt||!T)return;const ce=requestAnimationFrame(()=>{Ln(Qt)&&me(null)});return()=>cancelAnimationFrame(ce)},[a,Ln,oe,Qt,j,G]),n.useLayoutEffect(()=>{const S=Pe.current;if(!S||!M){ue(null);return}if(O)return;const T=j.kind==="image"||j.kind==="loading"&&j.mode==="image",ce=G&&a&&!a.startsWith("/")?`${G}/${a}`:a,Se=j.kind==="text"&&Ys(ce??"")&&oe==="preview",Je=j.kind==="text"&&qs(ce??"")&&Ie==="preview";if(j.kind!=="text"||T||Se||Je){ue(null);return}const Te=()=>{const Me=we.current.get(M.end);if(!Me||!S){ue(null);return}const Ge=Me.offsetTop+Me.offsetHeight/2,ot=S.scrollLeft+Math.max(8,S.clientWidth-120);ue({top:Ge,left:ot})};Te();const ze=new ResizeObserver(()=>Te());return ze.observe(S),()=>ze.disconnect()},[M,O,j,oe,Ie,a,G,bt]);const kr=j.kind==="text"&&!(qs(St??"")&&Ie==="preview")&&!St?.toLowerCase().endsWith(".csv")&&!St?.toLowerCase().endsWith(".kicad_pro")&&!St?.toLowerCase().endsWith(".kicad_prl"),In=n.useCallback(()=>{Ze(!1),ir(""),Q([]),Ye(0),oo(W.current)},[]),en=n.useCallback(()=>{!i||!kr||(Ze(!0),requestAnimationFrame(()=>{const S=ae.current;!he.current||!S?.isConnected||S.closest('[inert], [aria-hidden="true"], [hidden]')||S.getClientRects().length===0||getComputedStyle(S).visibility==="hidden"||!S.contains(document.activeElement)||(ht.current?.focus(),ht.current?.select())}))},[i,kr]),Dr=n.useCallback(S=>{Ye(T=>N.length===0?0:(T+S+N.length)%N.length)},[N.length]),Ut=n.useCallback(S=>{if(S.nativeEvent.isComposing||!eg(ae.current,i,S))return;const T=tg(S);if(T==="open"&&kr){S.preventDefault(),en();return}ye&&(T==="close"?(S.preventDefault(),In()):(T==="next"||T==="previous")&&(S.preventDefault(),Dr(T==="previous"?-1:1)))},[i,In,ye,Dr,en,kr]);if(n.useLayoutEffect(()=>{if(oo(W.current),!i||!ye||!wt.trim()||!Pe.current){Q([]),Ye(0);return}const S=ng(Pe.current,wt);return Q(S),Ye(0),(ae.current?.contains(document.activeElement)||Td(W.current))&&(Ii(S,0,W.current),Md(S[0])),()=>oo(W.current)},[i,ye,wt,bt,oe,j]),n.useEffect(()=>{!i||!ye||!wt.trim()||!ae.current?.contains(document.activeElement)&&!Td(W.current)||(Ii(N,ke,W.current),Md(N[ke]))},[i,ke,N,ye,wt]),n.useEffect(()=>()=>oo(W.current),[]),!a)return t.jsx("div",{className:"mx-3 mt-3 overflow-hidden rounded-xl border border-border/15 bg-surface-2 px-4 py-8 text-center text-sm text-muted-foreground",children:o("rightSidebar.selectFilePrompt")});const He=G&&!a.startsWith("/")?`${G}/${a}`:a,Et=ho(He,G),Sr=ru(He,G),Rr=j.kind==="text"&&j.content?j.content.split(`
1639
1639
  `):[],oa=Math.max(2,String(Rr.length).length)+1,jr=j.kind==="text"||j.kind==="image"||j.kind==="model3d"||j.kind==="video"||j.kind==="eda"?j.meta:null,Cr=Ys(He),ia=He.toLowerCase().endsWith(".csv"),At=He.toLowerCase().endsWith(".kicad_pro"),ps=He.toLowerCase().endsWith(".kicad_prl"),Ot=j.kind==="text"&&Cr&&oe==="preview",la=qs(He),Ht=j.kind==="text"&&la&&Ie==="preview",ca=j.kind==="image"||j.kind==="loading"&&j.mode==="image",ko=j.kind==="model3d"||j.kind==="loading"&&j.mode==="model3d",xt=j.kind==="video"||j.kind==="loading"&&j.mode==="video",tn=j.kind==="eda"||j.kind==="loading"&&j.mode==="eda",ms=j.kind==="text"?j.sourcePath:He,_r=xh(ms,G,M),Br=(()=>{if(!M||j.kind!=="text"||Rr.length===0)return _r;const S=[];for(let Se=M.start;Se<=M.end;Se+=1)S.push(`${Se} ${Rr[Se-1]??""}`);const T=Pu(He).replace(/^\./,""),ce="```";return`${_r}
1640
1640
  ${ce}${T}
1641
1641
  ${S.join(`