wind-agent-cli 1.37.3 → 1.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/README.md +16 -1
  2. package/dist/api-docs.html +2 -2
  3. package/dist/assets/{CodeEditor-BqmxpZ_D.js → CodeEditor-FvgsnJ7J.js} +6 -6
  4. package/dist/assets/FileTree-NLULrBDi.js +1 -0
  5. package/dist/assets/GitPanel-51KUBbEW.js +4 -0
  6. package/dist/assets/{MarkdownPreview-93h_1tJa.js → MarkdownPreview-PEEWVWeS.js} +17 -27
  7. package/dist/assets/Shell-BEx66cW_.js +76 -0
  8. package/dist/assets/Shell-DrlLKa8f.css +1 -0
  9. package/dist/assets/StandaloneShell-BkuUCPZP.js +1 -0
  10. package/dist/assets/TaskMasterPanel-DfQG80SF.js +2 -0
  11. package/dist/assets/abnfDiagram-N423BO3Z-Cc0ul87U.js +1 -0
  12. package/dist/assets/arc-BAuugHw_.js +1 -0
  13. package/dist/assets/architectureDiagram-T3A2C74G-DA3G7QZD.js +36 -0
  14. package/dist/assets/{blockDiagram-VBNYF7ZC-oSjQ1SgE.js → blockDiagram-VBNYF7ZC-tJ12IJs3.js} +4 -4
  15. package/dist/assets/c4Diagram-5PPSVZJV-5BTMCXL4.js +10 -0
  16. package/dist/assets/channel-BGDgNNQz.js +1 -0
  17. package/dist/assets/{chunk-2GRJ4B5K-B07uZ07O.js → chunk-2GRJ4B5K-BPaI06Ou.js} +1 -1
  18. package/dist/assets/{chunk-2Q5K7J3B-DNSfO7xS.js → chunk-2Q5K7J3B-HV4zmsEe.js} +1 -1
  19. package/dist/assets/chunk-5RXB4S5H-BAwutJoU.js +231 -0
  20. package/dist/assets/{chunk-5VM5RSS4-B7vZV0zC.js → chunk-5VM5RSS4-B9QAJPrv.js} +1 -1
  21. package/dist/assets/{chunk-6Q2QTUOP-DuS_xUGG.js → chunk-6Q2QTUOP-BOIW8bzI.js} +1 -1
  22. package/dist/assets/chunk-GF5L2VYU-DD13o00-.js +206 -0
  23. package/dist/assets/{chunk-JWPE2WC7-DD2hcXvs.js → chunk-JWPE2WC7-CFBm23VK.js} +1 -1
  24. package/dist/assets/{chunk-KBJHAD2P-Cz-l38qp.js → chunk-KBJHAD2P-C0i0v8Op.js} +1 -1
  25. package/dist/assets/{chunk-RYQCIY6F-DGFIU1YM.js → chunk-RYQCIY6F-DfeK0taV.js} +1 -1
  26. package/dist/assets/{chunk-XXDRQBXY-CmfzoYFl.js → chunk-XXDRQBXY-BKWvf-QE.js} +1 -1
  27. package/dist/assets/classDiagram-JCYQIIEL-C2SNM4oy.js +1 -0
  28. package/dist/assets/classDiagram-v2-OCEON4UE-C2SNM4oy.js +1 -0
  29. package/dist/assets/cose-bilkent-JH36ORCC-CBE8oM7L.js +1 -0
  30. package/dist/assets/{cynefin-VYW2F7L2-P1HecReO.js → cynefin-VYW2F7L2-DziGp35A.js} +11 -23
  31. package/dist/assets/cynefinDiagram-MW4NZA55-CNvtHl39.js +62 -0
  32. package/dist/assets/cytoscape.esm-yzknjiTM.js +321 -0
  33. package/dist/assets/dagre-VZM6K2ZE-Bz9lsU7m.js +4 -0
  34. package/dist/assets/{diagram-7IWD3JNH-9CWGFMYR.js → diagram-7IWD3JNH-CV7D3VSd.js} +5 -5
  35. package/dist/assets/{diagram-B4RE2ZJO-TWK59T6V.js → diagram-B4RE2ZJO-Dj4EjDNC.js} +2 -2
  36. package/dist/assets/diagram-LBJQPF4R-wJ6FHvf-.js +24 -0
  37. package/dist/assets/diagram-Q27KOJAE-DMFYMhOB.js +24 -0
  38. package/dist/assets/diagram-UB23O5K3-DeBSbWAI.js +41 -0
  39. package/dist/assets/ebnfDiagram-BXEA7PRR-2NnJSGhT.js +1 -0
  40. package/dist/assets/erDiagram-JOGREHBK-DrSlg8hr.js +85 -0
  41. package/dist/assets/feature-chat-CvOCyaLe.js +88 -0
  42. package/dist/assets/feature-workspace-CAB6bgPy.js +39 -0
  43. package/dist/assets/{flowDiagram-UKHOOZJN-DEr2II5V.js → flowDiagram-UKHOOZJN-C0pejU6W.js} +4 -4
  44. package/dist/assets/ganttDiagram-PKOTCBZU-BM0VCUUz.js +292 -0
  45. package/dist/assets/gitGraphDiagram-DS77QQ5N-SbLG0c5_.js +106 -0
  46. package/dist/assets/graph-DOmOIIwC.js +1 -0
  47. package/dist/assets/{index-BSe3UiFA.js → index-BflGfU1C.js} +3 -3
  48. package/dist/assets/index-Btkf0_rU.js +1 -0
  49. package/dist/assets/index-Cr5MbHuj.css +1 -0
  50. package/dist/assets/index-Gqazqfs3.js +1 -0
  51. package/dist/assets/index-nyrkoQK6.js +35 -0
  52. package/dist/assets/infoDiagram-6WML65LV-Cf5DSa66.js +2 -0
  53. package/dist/assets/ishikawaDiagram-WSZJBQD7-DwyFutKy.js +70 -0
  54. package/dist/assets/journeyDiagram-NVQOT4AX-Df0FRhLo.js +139 -0
  55. package/dist/assets/{kanban-definition-27J2QSJJ-DmlgiV7K.js → kanban-definition-27J2QSJJ-HmpbjrZz.js} +6 -6
  56. package/dist/assets/{layout-D6BstSzF.js → layout-D-LzfAck.js} +1 -1
  57. package/dist/assets/{linear-Ct_eoJQk.js → linear-DOM01LBe.js} +1 -1
  58. package/dist/assets/map-DxJ2ADlA.js +1 -0
  59. package/dist/assets/mermaid.core-C2Ma-_S6.js +306 -0
  60. package/dist/assets/{mindmap-definition-FAOFIHXS-DGtMgQhf.js → mindmap-definition-FAOFIHXS-B4GOIn76.js} +4 -4
  61. package/dist/assets/pegDiagram-VL7TDLO6-BHur7aH2.js +1 -0
  62. package/dist/assets/{pieDiagram-7S7Q4E2Y-DMkt_Zfr.js → pieDiagram-7S7Q4E2Y-Cw0UELLV.js} +2 -2
  63. package/dist/assets/quadrantDiagram-CIZ2JOQS-CB2BrX3g.js +7 -0
  64. package/dist/assets/railroadDiagram-AXF67PYL-DPYZYmLX.js +1 -0
  65. package/dist/assets/requirementDiagram-LRYGKXZP-DSX4IJ1n.js +84 -0
  66. package/dist/assets/sankeyDiagram-W5VNT64P-TenC3ZQo.js +40 -0
  67. package/dist/assets/sequenceDiagram-SI44F4Z6-DltGsf3F.js +162 -0
  68. package/dist/assets/sizeCapture-X5ZJPWSS-D7llwbJZ.js +1 -0
  69. package/dist/assets/stateDiagram-OKZ733FA-C-hAvbnY.js +1 -0
  70. package/dist/assets/stateDiagram-v2-UEYNNEHI-DaYSFcRQ.js +1 -0
  71. package/dist/assets/swimlanes-SLNWSIFB-DWD30fv6.js +2 -0
  72. package/dist/assets/swimlanesDiagram-ULZ7WXOC-LTkF2T6t.js +8 -0
  73. package/dist/assets/timeline-definition-Z64GVDOM-quWmimSE.js +120 -0
  74. package/dist/assets/vendor-data-DsEZeNPr.js +4 -0
  75. package/dist/assets/vendor-i18n-B6HjLCnN.js +1 -0
  76. package/dist/assets/vendor-markdown-DkITEES2.js +298 -0
  77. package/dist/assets/vendor-react-C2GTiUCy.js +10 -0
  78. package/dist/assets/vendor-ui-CAUHSABu.js +49 -0
  79. package/dist/assets/vennDiagram-T6HMQDX7-aUQcm8h5.js +34 -0
  80. package/dist/assets/{wardleyDiagram-T6FBY63Y-Db9dsaXv.js → wardleyDiagram-T6FBY63Y-BZ0bwsFQ.js} +2 -2
  81. package/dist/assets/workbox-window.prod.es5-BBnX5xw4.js +2 -0
  82. package/dist/assets/xychartDiagram-ELKLHX3M-DOVzAq63.js +7 -0
  83. package/dist/favicon.png +0 -0
  84. package/dist/icons/icon-128x128.png +0 -0
  85. package/dist/icons/icon-144x144.png +0 -0
  86. package/dist/icons/icon-152x152.png +0 -0
  87. package/dist/icons/icon-180x180.png +0 -0
  88. package/dist/icons/icon-192x192.png +0 -0
  89. package/dist/icons/icon-384x384.png +0 -0
  90. package/dist/icons/icon-512x512.png +0 -0
  91. package/dist/icons/icon-72x72.png +0 -0
  92. package/dist/icons/icon-96x96.png +0 -0
  93. package/dist/icons/icon-maskable-192x192.png +0 -0
  94. package/dist/icons/icon-maskable-512x512.png +0 -0
  95. package/dist/icons/new-icon.png +0 -0
  96. package/dist/index.html +17 -27
  97. package/dist/logo-128.png +0 -0
  98. package/dist/logo-256.png +0 -0
  99. package/dist/manifest.webmanifest +1 -0
  100. package/dist/push-sw.js +48 -0
  101. package/dist/screenshots/setup-screen-mobile.png +0 -0
  102. package/dist/screenshots/setup-screen.png +0 -0
  103. package/dist/sw.js +1 -124
  104. package/dist/workbox-ae5c0bb2.js +1 -0
  105. package/dist-server/server/index.js +1 -1
  106. package/dist-server/server/index.js.map +1 -1
  107. package/dist-server/server/load-env.js +4 -2
  108. package/dist-server/server/load-env.js.map +1 -1
  109. package/dist-server/server/modules/agent/agent.routes.js +1 -1
  110. package/dist-server/server/modules/agent/agent.routes.js.map +1 -1
  111. package/dist-server/server/modules/browser-use/browser-use.service.js +1 -1
  112. package/dist-server/server/modules/browser-use/browser-use.service.js.map +1 -1
  113. package/dist-server/server/modules/cli/cli.service.js +5 -5
  114. package/dist-server/server/modules/cli/cli.service.js.map +1 -1
  115. package/dist-server/server/modules/cli/sandbox.service.js +7 -7
  116. package/dist-server/server/modules/cli/sandbox.service.js.map +1 -1
  117. package/dist-server/server/modules/commands/commands.routes.js +1 -1
  118. package/dist-server/server/modules/commands/commands.routes.js.map +1 -1
  119. package/dist-server/server/modules/commands/tests/commands.test.js +1 -1
  120. package/dist-server/server/modules/commands/tests/commands.test.js.map +1 -1
  121. package/dist-server/server/modules/database/connection.js +1 -1
  122. package/dist-server/server/modules/database/connection.js.map +1 -1
  123. package/dist-server/server/modules/database/repositories/sessions.db.js +1 -1
  124. package/dist-server/server/modules/database/tests/projects.db.integration.test.js +3 -2
  125. package/dist-server/server/modules/database/tests/projects.db.integration.test.js.map +1 -1
  126. package/dist-server/server/modules/database/tests/sessions-provider-mapping.test.js +4 -3
  127. package/dist-server/server/modules/database/tests/sessions-provider-mapping.test.js.map +1 -1
  128. package/dist-server/server/modules/database/tests/sessions.db.integration.test.js +2 -1
  129. package/dist-server/server/modules/database/tests/sessions.db.integration.test.js.map +1 -1
  130. package/dist-server/server/modules/notifications/services/notification-orchestrator.service.js +1 -1
  131. package/dist-server/server/modules/notifications/services/notification-orchestrator.service.js.map +1 -1
  132. package/dist-server/server/modules/notifications/vapid-keys.service.js +1 -1
  133. package/dist-server/server/modules/notifications/vapid-keys.service.js.map +1 -1
  134. package/dist-server/server/modules/projects/tests/project-management.service.test.js +2 -1
  135. package/dist-server/server/modules/projects/tests/project-management.service.test.js.map +1 -1
  136. package/dist-server/server/modules/providers/list/codex/codex-app-server.client.js +2 -2
  137. package/dist-server/server/modules/providers/list/codex/codex-app-server.client.js.map +1 -1
  138. package/dist-server/server/modules/providers/list/codex/codex-models.provider.js +1 -1
  139. package/dist-server/server/modules/providers/list/codex/codex-models.provider.js.map +1 -1
  140. package/dist-server/server/modules/providers/list/cursor/cursor-models.provider.js +1 -1
  141. package/dist-server/server/modules/providers/list/cursor/cursor-models.provider.js.map +1 -1
  142. package/dist-server/server/modules/providers/list/cursor/cursor-session-synchronizer.provider.js.map +1 -1
  143. package/dist-server/server/modules/providers/list/opencode/opencode-models.provider.js +1 -1
  144. package/dist-server/server/modules/providers/services/sessions.service.js +1 -1
  145. package/dist-server/server/modules/providers/tests/claude-auth.test.js +8 -0
  146. package/dist-server/server/modules/providers/tests/claude-auth.test.js.map +1 -1
  147. package/dist-server/server/modules/providers/tests/codex-sessions.test.js +1 -1
  148. package/dist-server/server/modules/providers/tests/codex-sessions.test.js.map +1 -1
  149. package/dist-server/server/modules/providers/tests/opencode-sessions.test.js +2 -2
  150. package/dist-server/server/modules/providers/tests/opencode-sessions.test.js.map +1 -1
  151. package/dist-server/server/modules/providers/tests/provider.routes.test.js +1 -1
  152. package/dist-server/server/modules/providers/tests/provider.routes.test.js.map +1 -1
  153. package/dist-server/server/modules/system/system.service.js +1 -1
  154. package/dist-server/server/modules/system/system.service.js.map +1 -1
  155. package/dist-server/server/modules/system/tests/system.service.test.js +1 -1
  156. package/dist-server/server/modules/system/tests/system.service.test.js.map +1 -1
  157. package/dist-server/server/modules/taskmaster/taskmaster.routes.js +4 -3
  158. package/dist-server/server/modules/taskmaster/taskmaster.routes.js.map +1 -1
  159. package/dist-server/server/modules/websocket/services/shell-websocket.service.js +1 -1
  160. package/dist-server/server/modules/websocket/services/shell-websocket.service.js.map +1 -1
  161. package/dist-server/server/modules/worktrees/services/worktree-list.service.js +1 -1
  162. package/dist-server/server/modules/worktrees/services/worktree-open.service.js +1 -1
  163. package/dist-server/server/modules/worktrees/services/worktree-remove.service.js +1 -1
  164. package/electron/cloud.js +3 -3
  165. package/electron/desktopNotifications.js +1 -1
  166. package/electron/desktopWindow.js +12 -12
  167. package/electron/launcher/index.html +1 -1
  168. package/electron/launcher/launcher.js +14 -14
  169. package/electron/localServer.js +5 -5
  170. package/electron/main.js +19 -19
  171. package/electron/serverInstaller.js +2 -2
  172. package/electron/viewHost.js +1 -1
  173. package/package.json +49 -37
  174. package/public/api-docs.html +2 -2
  175. package/scripts/build-client.mjs +30 -0
  176. package/scripts/generate-pwa-icons.ps1 +33 -0
  177. package/scripts/verify-pwa-build.mjs +37 -0
  178. package/server/index.ts +1 -1
  179. package/server/load-env.ts +4 -2
  180. package/server/modules/agent/agent.routes.ts +1 -1
  181. package/server/modules/browser-use/browser-use.service.ts +1 -1
  182. package/server/modules/cli/cli.service.ts +5 -5
  183. package/server/modules/cli/sandbox.service.ts +7 -7
  184. package/server/modules/commands/commands.routes.ts +1 -1
  185. package/server/modules/commands/tests/commands.test.ts +1 -1
  186. package/server/modules/database/connection.ts +2 -1
  187. package/server/modules/database/repositories/sessions.db.ts +1 -1
  188. package/server/modules/database/tests/projects.db.integration.test.ts +3 -2
  189. package/server/modules/database/tests/sessions-provider-mapping.test.ts +4 -3
  190. package/server/modules/database/tests/sessions.db.integration.test.ts +2 -1
  191. package/server/modules/notifications/services/notification-orchestrator.service.js +1 -1
  192. package/server/modules/notifications/vapid-keys.service.ts +1 -1
  193. package/server/modules/projects/tests/project-management.service.test.ts +2 -1
  194. package/server/modules/providers/list/codex/codex-app-server.client.ts +2 -2
  195. package/server/modules/providers/list/codex/codex-models.provider.ts +1 -1
  196. package/server/modules/providers/list/cursor/cursor-models.provider.ts +1 -1
  197. package/server/modules/providers/list/cursor/cursor-session-synchronizer.provider.ts +0 -1
  198. package/server/modules/providers/list/opencode/opencode-models.provider.ts +1 -1
  199. package/server/modules/providers/services/sessions.service.ts +1 -1
  200. package/server/modules/providers/tests/claude-auth.test.ts +7 -0
  201. package/server/modules/providers/tests/codex-sessions.test.ts +1 -1
  202. package/server/modules/providers/tests/opencode-sessions.test.ts +2 -2
  203. package/server/modules/providers/tests/provider.routes.test.ts +1 -1
  204. package/server/modules/system/system.service.ts +1 -1
  205. package/server/modules/system/tests/system.service.test.ts +1 -1
  206. package/server/modules/taskmaster/taskmaster.routes.ts +4 -3
  207. package/server/modules/websocket/services/shell-websocket.service.ts +1 -1
  208. package/server/modules/worktrees/services/worktree-list.service.ts +1 -1
  209. package/server/modules/worktrees/services/worktree-open.service.ts +1 -1
  210. package/server/modules/worktrees/services/worktree-remove.service.ts +1 -1
  211. package/server/shared/interfaces.ts +1 -1
  212. package/server/shared/types.ts +6 -6
  213. package/dist/assets/FileTree-DLE7Ioai.js +0 -127
  214. package/dist/assets/GitPanel-f8RMRa8D.js +0 -29
  215. package/dist/assets/PluginTabContent-DU1jjkXP.js +0 -1
  216. package/dist/assets/Shell-CN_2MRIM.js +0 -81
  217. package/dist/assets/Shell-qxJ8_QYu.css +0 -32
  218. package/dist/assets/StandaloneShell-D0avS8UE.js +0 -1
  219. package/dist/assets/TaskMasterPanel-Cpf1Q5Ph.js +0 -32
  220. package/dist/assets/abnfDiagram-N423BO3Z-p3aJIm4T.js +0 -1
  221. package/dist/assets/arc-CTeud6Fl.js +0 -1
  222. package/dist/assets/architectureDiagram-T3A2C74G-CG7kRCJU.js +0 -36
  223. package/dist/assets/c4Diagram-5PPSVZJV-RkzF0DJV.js +0 -10
  224. package/dist/assets/channel-BfQbarn9.js +0 -1
  225. package/dist/assets/chunk-5RXB4S5H-BTeYcgyb.js +0 -231
  226. package/dist/assets/chunk-GF5L2VYU-CKLZ3iVD.js +0 -206
  227. package/dist/assets/classDiagram-JCYQIIEL-Bpfe3kq7.js +0 -1
  228. package/dist/assets/classDiagram-v2-OCEON4UE-Bpfe3kq7.js +0 -1
  229. package/dist/assets/code-xml-CLpHzEOP.js +0 -6
  230. package/dist/assets/cose-bilkent-JH36ORCC-DlFcLXCB.js +0 -1
  231. package/dist/assets/cynefinDiagram-MW4NZA55-COgduz5P.js +0 -62
  232. package/dist/assets/cytoscape.esm-C10L9Icf.js +0 -331
  233. package/dist/assets/dagre-VZM6K2ZE-Bbb-siGp.js +0 -4
  234. package/dist/assets/diagram-LBJQPF4R-ErMC9yaa.js +0 -24
  235. package/dist/assets/diagram-Q27KOJAE-Dt_-C7hV.js +0 -24
  236. package/dist/assets/diagram-UB23O5K3-BJ1DnRAF.js +0 -41
  237. package/dist/assets/ebnfDiagram-BXEA7PRR-CE1YaQ9s.js +0 -1
  238. package/dist/assets/erDiagram-JOGREHBK-Bqk7N9aY.js +0 -85
  239. package/dist/assets/ganttDiagram-PKOTCBZU-CWYAUeYN.js +0 -292
  240. package/dist/assets/gitGraphDiagram-DS77QQ5N-tdEcEIM6.js +0 -106
  241. package/dist/assets/graph-Cx-EqisW.js +0 -1
  242. package/dist/assets/index-B-sTfSZq.js +0 -1
  243. package/dist/assets/index-B_FDMWar.js +0 -1174
  244. package/dist/assets/index-CWJtg2pR.js +0 -11
  245. package/dist/assets/index-t1w8KNxn.css +0 -1
  246. package/dist/assets/infoDiagram-6WML65LV-A3IqRUnO.js +0 -2
  247. package/dist/assets/ishikawaDiagram-WSZJBQD7-B2uL6bkK.js +0 -70
  248. package/dist/assets/journeyDiagram-NVQOT4AX-D9JB-hRW.js +0 -139
  249. package/dist/assets/map-CV9uif0g.js +0 -1
  250. package/dist/assets/mermaid.core-CQ698HNn.js +0 -312
  251. package/dist/assets/pegDiagram-VL7TDLO6-CO6vP4n9.js +0 -1
  252. package/dist/assets/quadrantDiagram-CIZ2JOQS-DgNxRz6t.js +0 -7
  253. package/dist/assets/railroadDiagram-AXF67PYL-DKz9UqA9.js +0 -1
  254. package/dist/assets/requirementDiagram-LRYGKXZP-L84XyGgV.js +0 -84
  255. package/dist/assets/sankeyDiagram-W5VNT64P-CQqWbJ3j.js +0 -40
  256. package/dist/assets/sequenceDiagram-SI44F4Z6--tnzS2tb.js +0 -162
  257. package/dist/assets/sizeCapture-X5ZJPWSS-DujwEOtm.js +0 -1
  258. package/dist/assets/stateDiagram-OKZ733FA-BK3TcZY2.js +0 -1
  259. package/dist/assets/stateDiagram-v2-UEYNNEHI-_medyomK.js +0 -1
  260. package/dist/assets/swimlanes-SLNWSIFB-naX-Uv1B.js +0 -2
  261. package/dist/assets/swimlanesDiagram-ULZ7WXOC-DstIv3TC.js +0 -8
  262. package/dist/assets/timeline-definition-Z64GVDOM-C-vP_ddU.js +0 -120
  263. package/dist/assets/vendor-react-whEHfigN.js +0 -59
  264. package/dist/assets/vennDiagram-T6HMQDX7-DN-I7o-7.js +0 -34
  265. package/dist/assets/xychartDiagram-ELKLHX3M-DE6OxW_p.js +0 -7
  266. package/dist/manifest.json +0 -61
@@ -1,29 +0,0 @@
1
- import{c as fe,b as Z,j as e,Y as Fe,G as he,Q as pe,Z as Ae,T as oe,$ as ft,R as V,a0 as P,I as xe,w as Xe,X as we,a1 as pt,A as gt,a2 as Ye,a3 as Le,D as Ze,a4 as Pe,t as bt,L as yt,F as jt,i as Nt}from"./index-B_FDMWar.js";import{r as n}from"./vendor-react-whEHfigN.js";/**
2
- * @license lucide-react v0.515.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const wt=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],vt=fe("arrow-right-left",wt);/**
7
- * @license lucide-react v0.515.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const Ct=[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]],ve=fe("git-fork",Ct);/**
12
- * @license lucide-react v0.515.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const kt=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],et=fe("history",kt);/**
17
- * @license lucide-react v0.515.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const St=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],$t=fe("house",St);/**
22
- * @license lucide-react v0.515.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */const Et=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],It=fe("tag",Et),Tt="main",Ft=50,tt=[{key:"modified",status:"M"},{key:"added",status:"A"},{key:"deleted",status:"D"},{key:"untracked",status:"U"}],Lt={M:"Modified",A:"Added",D:"Deleted",U:"Untracked"},Me={M:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/40 dark:text-yellow-300 border-yellow-200 dark:border-yellow-800/50",A:"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300 border-green-200 dark:border-green-800/50",D:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300 border-red-200 dark:border-red-800/50",U:"bg-muted text-muted-foreground border-border"},Rt={discard:"Discard Changes",delete:"Delete File",commit:"Confirm Action",pull:"Confirm Pull",push:"Confirm Push",publish:"Publish Branch",revertLocalCommit:"Revert Local Commit",deleteBranch:"Delete Branch"},At={discard:"Discard",delete:"Delete",commit:"Confirm",pull:"Pull",push:"Push",publish:"Publish",revertLocalCommit:"Revert Commit",deleteBranch:"Delete"},Dt={discard:"bg-red-600 hover:bg-red-700",delete:"bg-red-600 hover:bg-red-700",commit:"bg-primary hover:bg-primary/90",pull:"bg-green-600 hover:bg-green-700",push:"bg-orange-600 hover:bg-orange-700",publish:"bg-purple-600 hover:bg-purple-700",revertLocalCommit:"bg-yellow-600 hover:bg-yellow-700",deleteBranch:"bg-red-600 hover:bg-red-700"},Ot={discard:"bg-red-100 dark:bg-red-900/30",delete:"bg-red-100 dark:bg-red-900/30",commit:"bg-yellow-100 dark:bg-yellow-900/30",pull:"bg-yellow-100 dark:bg-yellow-900/30",push:"bg-yellow-100 dark:bg-yellow-900/30",publish:"bg-yellow-100 dark:bg-yellow-900/30",revertLocalCommit:"bg-yellow-100 dark:bg-yellow-900/30",deleteBranch:"bg-red-100 dark:bg-red-900/30"};function De(t){return t?tt.flatMap(({key:r})=>t[r]||[]):[]}function rt(t){return De(t).length}function We(t){return rt(t)>0}function Bt(t){return Lt[t]||t}function Oe(t){return Me[t]||Me.U}function Mt(t){const r=[],s=t.split(/^diff --git /m).slice(1);for(const a of s){const o=a.split(`
27
- `),i=(o[0]??"").match(/^a\/(.+?) b\/(.+)/);if(!i)continue;const g=i[1],h=i[2];let m="M";const f=o.slice(0,6).join(`
28
- `);f.includes("new file mode")?m="A":f.includes("deleted file mode")&&(m="D");const v=m==="D"?g:h;let y=0,p=0;for(const x of o)x.startsWith("+++")||x.startsWith("---")||(x.startsWith("+")?y++:x.startsWith("-")&&p++);const j=v.lastIndexOf("/"),u=j>=0?v.substring(0,j+1):"",N=j>=0?v.substring(j+1):v;r.push({path:v,directory:u,filename:N,status:m,insertions:y,deletions:p})}return{files:r,totalFiles:r.length,totalInsertions:r.reduce((a,o)=>a+o.insertions,0),totalDeletions:r.reduce((a,o)=>a+o.deletions,0)}}function Wt(){const[t,r]=n.useState(()=>localStorage.getItem("selected-provider")||"claude");return n.useEffect(()=>{const s=()=>{const a=localStorage.getItem("selected-provider")||"claude";r(a)};return window.addEventListener("storage",s),()=>window.removeEventListener("storage",s)},[]),t}const M=Z;function _e(t){return t instanceof DOMException&&t.name==="AbortError"}async function O(t,r){if(r?.aborted)throw new DOMException("Request aborted","AbortError");const s=await t.json();if(r?.aborted)throw new DOMException("Request aborted","AbortError");return s}function _t({selectedProject:t,activeView:r,onFileOpen:s}){const[a,o]=n.useState(null),[d,i]=n.useState({}),[g,h]=n.useState(!1),[m,f]=n.useState(""),[v,y]=n.useState([]),[p,j]=n.useState([]),[u,N]=n.useState(!1),[x,T]=n.useState(!1),[I,B]=n.useState({}),[W,w]=n.useState(null),[$,k]=n.useState([]),[L,S]=n.useState([]),[R,G]=n.useState(!1),[J,Y]=n.useState(!1),[U,C]=n.useState(!1),[A,H]=n.useState(!1),[Q,se]=n.useState(!1),[ie,ne]=n.useState(!1),[le,D]=n.useState(!1),[K,z]=n.useState(null),Ce=n.useCallback(()=>z(null),[]),X=n.useRef(t?.projectId??null);n.useEffect(()=>{X.current=t?.projectId??null},[t]);const ge=Wt(),be=n.useCallback(async(c,l)=>{if(!t)return;const b=t.projectId;try{const F=await M(`/api/git/diff?project=${encodeURIComponent(b)}&file=${encodeURIComponent(c)}`,{signal:l}),je=await O(F,l);if(l?.aborted||X.current!==b)return;!je.error&&je.diff&&i(Ie=>({...Ie,[c]:je.diff}))}catch(F){if(l?.aborted||_e(F))return;console.error("Error fetching file diff:",F)}},[t]),E=n.useCallback(async c=>{if(!t)return;const l=t.projectId;h(!0);try{const b=await M(`/api/git/status?project=${encodeURIComponent(l)}`,{signal:c}),F=await O(b,c);if(c?.aborted||X.current!==l)return;if(F.error){F.notGitRepository||console.error("Git status error:",F.error),o({error:F.error,details:F.details,notGitRepository:F.notGitRepository}),f("");return}o(F),f(F.branch||Tt),De(F).forEach(Ie=>{be(Ie,c)})}catch(b){if(c?.aborted||_e(b)||X.current!==l)return;console.error("Error fetching git status:",b),o({error:"Git operation failed",details:String(b)}),f("")}finally{h(!1)}},[be,t]),q=n.useCallback(async()=>{if(t)try{const c=await M(`/api/git/branches?project=${encodeURIComponent(t.projectId)}`),l=await O(c);if(!l.error&&l.branches){y(l.branches),k(l.localBranches??l.branches),S(l.remoteBranches??[]);return}y([]),k([]),S([])}catch(c){console.error("Error fetching branches:",c),y([]),k([]),S([])}},[t]),_=n.useCallback(async()=>{if(t)try{const c=await M(`/api/git/remote-status?project=${encodeURIComponent(t.projectId)}`),l=await O(c);if(!l.error){w(l);return}w(null)}catch(c){console.error("Error fetching remote status:",c),w(null)}},[t]),ke=n.useCallback(async c=>{if(!t)return!1;try{const l=await M("/api/git/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:t.projectId,branch:c})}),b=await O(l);return b.success?(f(c),E(),!0):(console.error("Failed to switch branch:",b.error),!1)}catch(l){return console.error("Error switching branch:",l),!1}},[E,t]),Se=n.useCallback(async c=>{const l=c.trim();if(!t||!l)return!1;G(!0);try{const b=await M("/api/git/create-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:t.projectId,branch:l})}),F=await O(b);return F.success?(f(l),q(),E(),!0):(console.error("Failed to create branch:",F.error),!1)}catch(b){return console.error("Error creating branch:",b),!1}finally{G(!1)}},[q,E,t]),$e=n.useCallback(async(c,l=!1)=>{if(!t)return!1;try{const b=await M("/api/git/delete-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:t.projectId,branch:c,force:l})}),F=await O(b);return F.success?(q(),!0):(z(F.error??"Delete branch failed"),!1)}catch(b){return z(b instanceof Error?b.message:"Delete branch failed"),!1}},[q,t]),Ee=n.useCallback(async()=>{if(t){Y(!0);try{const c=await M("/api/git/fetch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:t.projectId})}),l=await O(c);if(l.success){E(),_(),q();return}z(l.error??"Fetch failed")}catch(c){z(c instanceof Error?c.message:"Fetch failed")}finally{Y(!1)}}},[q,E,_,t]),ce=n.useCallback(async()=>{if(t){C(!0);try{const c=await M("/api/git/pull",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:t.projectId})}),l=await O(c);if(l.success){E(),_();return}z(l.error??"Pull failed")}catch(c){z(c instanceof Error?c.message:"Pull failed")}finally{C(!1)}}},[E,_,t]),de=n.useCallback(async()=>{if(t){H(!0);try{const c=await M("/api/git/push",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:t.projectId})}),l=await O(c);if(l.success){E(),_();return}z(l.error??"Push failed")}catch(c){z(c instanceof Error?c.message:"Push failed")}finally{H(!1)}}},[E,_,t]),me=n.useCallback(async()=>{if(t){se(!0);try{const c=await M("/api/git/publish",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:t.projectId,branch:m})}),l=await O(c);if(l.success){E(),_();return}console.error("Publish failed:",l.error)}catch(c){console.error("Error publishing branch:",c)}finally{se(!1)}}},[m,E,_,t]),ye=n.useCallback(async c=>{if(t)try{const l=await M("/api/git/discard",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:t.projectId,file:c})}),b=await O(l);if(b.success){E();return}console.error("Discard failed:",b.error)}catch(l){console.error("Error discarding changes:",l)}},[E,t]),at=n.useCallback(async c=>{if(t)try{const l=await M("/api/git/delete-untracked",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:t.projectId,file:c})}),b=await O(l);if(b.success){E();return}console.error("Delete failed:",b.error)}catch(l){console.error("Error deleting untracked file:",l)}},[E,t]),ot=n.useCallback(async c=>{if(!t||c.length===0)return!1;try{const l=await M("/api/git/stage",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:t.projectId,files:c})}),b=await O(l);return b.success?(await E(),!0):(z(b.error??"Stage failed"),!1)}catch(l){return z(l instanceof Error?l.message:"Stage failed"),!1}},[E,t]),it=n.useCallback(async c=>{if(!t||c.length===0)return!1;try{const l=await M("/api/git/unstage",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:t.projectId,files:c})}),b=await O(l);return b.success?(await E(),!0):(z(b.error??"Unstage failed"),!1)}catch(l){return z(l instanceof Error?l.message:"Unstage failed"),!1}},[E,t]),Be=n.useCallback(async()=>{if(!t)return;const c=t.projectId;N(!0);try{const l=await M(`/api/git/commits?project=${encodeURIComponent(c)}&limit=${Ft}`),b=await O(l);if(X.current!==c)return;!b.error&&b.commits&&j(b.commits)}catch(l){console.error("Error fetching commits:",l)}finally{X.current===c&&(N(!1),T(!0))}},[t]),lt=n.useCallback(async c=>{if(t)try{const l=await M(`/api/git/commit-diff?project=${encodeURIComponent(t.projectId)}&commit=${c}`),b=await O(l);!b.error&&b.diff&&B(F=>({...F,[c]:b.diff}))}catch(l){console.error("Error fetching commit diff:",l)}},[t]),ct=n.useCallback(async c=>{if(!t||c.length===0)return null;try{const l=await Z("/api/git/generate-commit-message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:t.projectId,files:c,provider:ge})}),b=await O(l);return b.message?b.message:(console.error("Failed to generate commit message:",b.error),null)}catch(l){return console.error("Error generating commit message:",l),null}},[ge,t]),dt=n.useCallback(async(c,l)=>{if(!t||!c.trim()||l.length===0)return!1;try{const b=await M("/api/git/commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:t.projectId,message:c,files:l})}),F=await O(b);return F.success?(E(),_(),!0):(console.error("Commit failed:",F.error),!1)}catch(b){return console.error("Error committing changes:",b),!1}},[E,_,t]),mt=n.useCallback(async()=>{if(!t)throw new Error("No project selected");ne(!0);try{const c=await M("/api/git/initial-commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:t.projectId})}),l=await O(c);if(l.success)return E(),_(),!0;throw new Error(l.error||"Failed to create initial commit")}catch(c){throw console.error("Error creating initial commit:",c),c}finally{ne(!1)}},[E,_,t]),ut=n.useCallback(async()=>{if(!t)return!1;const c=t.projectId;D(!0);try{const l=await M("/api/git/init",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:c})}),b=await O(l);return X.current!==c?!1:b.success?(E(),q(),_(),!0):(z(b.error??"Failed to initialize repository"),!1)}catch(l){return X.current===c&&z(l instanceof Error?l.message:"Failed to initialize repository"),!1}finally{D(!1)}},[q,E,_,t]),ht=n.useCallback(async c=>{if(s){if(!t){s(c);return}try{const l=await M(`/api/git/file-with-diff?project=${encodeURIComponent(t.projectId)}&file=${encodeURIComponent(c)}`),b=await O(l);if(b.error){console.error("Error fetching file with diff:",b.error),s(c);return}s(c,{old_string:b.oldContent||"",new_string:b.currentContent||""})}catch(l){console.error("Error opening file:",l),s(c)}}},[s,t]),xt=n.useCallback(()=>{E(),q(),_()},[q,E,_]);return n.useEffect(()=>{const c=new AbortController;return f(""),y([]),k([]),S([]),o(null),w(null),i({}),j([]),B({}),h(!1),N(!1),T(!1),z(null),t?(E(c.signal),q(),_(),()=>{c.abort()}):()=>{c.abort()}},[q,E,_,t]),n.useEffect(()=>{!t||r!=="history"||Be()},[r,Be,t]),{gitStatus:a,gitDiff:d,isLoading:g,isLoadingCommits:u||!x,currentBranch:m,branches:v,localBranches:$,remoteBranches:L,recentCommits:p,commitDiffs:I,remoteStatus:W,isCreatingBranch:R,isFetching:J,isPulling:U,isPushing:A,isPublishing:Q,isCreatingInitialCommit:ie,isInitializingRepository:le,operationError:K,clearOperationError:Ce,refreshAll:xt,switchBranch:ke,createBranch:Se,deleteBranch:$e,handleFetch:Ee,handlePull:ce,handlePush:de,handlePublish:me,discardChanges:ye,deleteUntrackedFile:at,stageFiles:ot,unstageFiles:it,fetchCommitDiff:lt,generateCommitMessage:ct,commitChanges:dt,createInitialCommit:mt,initRepository:ut,openFile:ht}}async function Ut(t){return await t.json()}function zt({projectId:t,onSuccess:r}){const[s,a]=n.useState(!1),o=n.useCallback(async()=>{if(t){a(!0);try{const d=await Z("/api/git/revert-local-commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:t})}),i=await Ut(d);if(!i.success){console.error("Revert local commit failed:",i.error||i.details||"Unknown error");return}r?.()}catch(d){console.error("Error reverting local commit:",d)}finally{a(!1)}}},[r,t]);return{isRevertingLocalCommit:s,revertLatestLocalCommit:o}}const Te=new Map;function Gt({isMobile:t,projectPath:r,selectedFileCount:s,isHidden:a,onCommit:o,onRequestConfirmation:d}){const[i,g]=n.useState(()=>Te.get(r)??""),h=u=>{g(u),u?Te.set(r,u):Te.delete(r)},[m,f]=n.useState(!1),[v,y]=n.useState(t),p=async(u=i)=>{const N=u.trim();if(!N||s===0||m)return!1;f(!0);try{const x=await o(N);return x&&h(""),x}finally{f(!1)}},j=()=>{const u=i.trim();!u||s===0||m||d({type:"commit",message:`Commit ${s} file${s!==1?"s":""} with message: "${u}"?`,onConfirm:async()=>{await p(u)}})};return e.jsx("div",{className:`transition-all duration-300 ease-in-out ${a?"max-h-0 -translate-y-2 overflow-hidden opacity-0":"max-h-96 translate-y-0 opacity-100"}`,children:t&&v?e.jsx("div",{className:"border-b border-border/60 px-4 py-2",children:e.jsxs("button",{onClick:()=>y(!1),className:"flex w-full items-center justify-center gap-2 rounded-lg bg-primary px-3 py-2 text-sm text-primary-foreground transition-colors hover:bg-primary/90",children:[e.jsx(Fe,{className:"h-4 w-4"}),e.jsxs("span",{children:["Commit ",s," file",s!==1?"s":""]}),e.jsx(he,{className:"h-3 w-3"})]})}):e.jsxs("div",{className:"border-b border-border/60 px-4 py-3",children:[t&&e.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-medium text-foreground",children:"Commit Changes"}),e.jsx("button",{onClick:()=>y(!0),className:"rounded-lg p-1 transition-colors hover:bg-accent",children:e.jsx(he,{className:"h-4 w-4 rotate-180"})})]}),e.jsx("textarea",{value:i,onChange:u=>h(u.target.value),placeholder:"Message (Ctrl+Enter to commit)",className:"w-full resize-none rounded-xl border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:border-primary/30 focus:outline-none focus:ring-2 focus:ring-primary/20",rows:3,onKeyDown:u=>{u.key==="Enter"&&(u.ctrlKey||u.metaKey)&&(u.preventDefault(),p())}}),e.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:[s," file",s!==1?"s":""," selected"]}),e.jsxs("button",{onClick:j,disabled:!i.trim()||s===0||m,className:"flex items-center space-x-1 rounded-lg bg-primary px-3 py-1.5 text-sm text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50",children:[e.jsx(pe,{className:"h-3 w-3"}),e.jsx("span",{children:m?"Committing...":"Commit"})]})]})]})})}const Ue=2e5,ze=1500;function Ht(t){const r=t.length>Ue,a=(r?t.slice(0,Ue):t).split(`
29
- `),o=a.length>ze;return{lines:o?a.slice(0,ze):a,isCharacterTruncated:r,isLineTruncated:o}}function st({diff:t,isMobile:r,wrapText:s}){const a=n.useMemo(()=>Ht(t||""),[t]),o=a.isCharacterTruncated||a.isLineTruncated;if(!t)return e.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No diff available"});const d=(i,g)=>{const h=i.startsWith("+")&&!i.startsWith("+++"),m=i.startsWith("-")&&!i.startsWith("---"),f=i.startsWith("@@");return e.jsx("div",{className:`px-3 py-0.5 font-mono text-xs ${r&&s?"whitespace-pre-wrap break-all":"overflow-x-auto whitespace-pre"} ${h?"bg-green-50 text-green-700 dark:bg-green-950/50 dark:text-green-300":m?"bg-red-50 text-red-700 dark:bg-red-950/50 dark:text-red-300":f?"bg-primary/5 text-primary":"text-muted-foreground/70"}`,children:i},g)};return e.jsxs("div",{className:"diff-viewer",children:[o&&e.jsx("div",{className:"mb-2 rounded-md border border-border bg-card px-3 py-2 text-xs text-muted-foreground",children:"Large diff preview: rendering is limited to keep the tab responsive."}),a.lines.map((i,g)=>d(i,g))]})}function Jt({filePath:t,status:r,isMobile:s,isExpanded:a,isSelected:o,diff:d,wrapText:i,onToggleSelected:g,onToggleExpanded:h,onOpenFile:m,onToggleWrapText:f,onRequestFileAction:v}){const y=Bt(r),p=Oe(r);return e.jsxs("div",{className:"border-b border-border last:border-0",children:[e.jsxs("div",{className:`flex items-center transition-colors hover:bg-accent/50 ${s?"px-2 py-1.5":"px-3 py-2"}`,children:[e.jsx("input",{type:"checkbox",checked:o,onChange:()=>g(t),onClick:j=>j.stopPropagation(),className:`rounded border-border bg-background text-primary checked:bg-primary focus:ring-primary/40 ${s?"mr-1.5":"mr-2"}`}),e.jsxs("div",{className:"flex min-w-0 flex-1 items-center",children:[e.jsx("button",{onClick:j=>{j.stopPropagation(),h(t)},className:`cursor-pointer rounded p-0.5 hover:bg-accent ${s?"mr-1":"mr-2"}`,title:a?"Collapse diff":"Expand diff",children:e.jsx(Ae,{className:`h-3 w-3 transition-transform duration-200 ease-in-out ${a?"rotate-90":"rotate-0"}`})}),e.jsx("span",{className:`flex-1 truncate ${s?"text-xs":"text-sm"} cursor-pointer hover:text-primary hover:underline`,onClick:j=>{j.stopPropagation(),m(t)},title:"Click to open file",children:t}),e.jsxs("span",{className:"flex items-center gap-1",children:[(r==="M"||r==="D"||r==="U")&&e.jsxs("button",{onClick:j=>{j.stopPropagation(),v(t,r)},className:`${s?"px-2 py-1 text-xs":"p-1"} flex items-center gap-1 rounded font-medium text-destructive hover:bg-destructive/10`,title:r==="U"?"Delete untracked file":"Discard changes",children:[e.jsx(oe,{className:"h-3 w-3"}),s&&e.jsx("span",{children:r==="U"?"Delete":"Discard"})]}),e.jsx("span",{className:`inline-flex h-5 w-5 items-center justify-center rounded border text-[10px] font-bold ${p}`,title:y,children:r})]})]})]}),e.jsxs("div",{className:`duration-400 overflow-hidden bg-muted/50 transition-all ease-in-out ${a&&d?"max-h-[600px] translate-y-0 opacity-100":"max-h-0 -translate-y-1 opacity-0"}`,children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border p-2",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`inline-flex h-5 w-5 items-center justify-center rounded border text-[10px] font-bold ${p}`,children:r}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:y})]}),s&&e.jsx("button",{onClick:j=>{j.stopPropagation(),f()},className:"text-sm text-muted-foreground transition-colors hover:text-foreground",title:i?"Switch to horizontal scroll":"Switch to text wrap",children:i?"Scroll":"Wrap"})]}),e.jsx("div",{className:"max-h-96 overflow-y-auto",children:d&&e.jsx(st,{diff:d,isMobile:s,wrapText:i})})]})]})}function Ge({gitStatus:t,gitDiff:r,expandedFiles:s,selectedFiles:a,isMobile:o,wrapText:d,filePaths:i,onToggleSelected:g,onToggleExpanded:h,onOpenFile:m,onToggleWrapText:f,onRequestFileAction:v}){return e.jsx(e.Fragment,{children:tt.map(({key:y,status:p})=>(t[y]||[]).filter(j=>!i||i.has(j)).map(j=>e.jsx(Jt,{filePath:j,status:p,isMobile:o,isExpanded:s.has(j),isSelected:a.has(j),diff:r[j],wrapText:d,onToggleSelected:g,onToggleExpanded:h,onOpenFile:m,onToggleWrapText:f,onRequestFileAction:v},j)))})}const qt=[{status:"M",label:"Modified"},{status:"A",label:"Added"},{status:"D",label:"Deleted"},{status:"U",label:"Untracked"}];function Vt({isMobile:t}){const[r,s]=n.useState(!1);return t?null:e.jsxs("div",{className:"border-b border-border/60",children:[e.jsxs("button",{onClick:()=>s(a=>!a),className:"flex w-full items-center justify-center gap-1 bg-muted/30 px-4 py-2 text-sm text-muted-foreground transition-colors hover:bg-muted/50",children:[e.jsx(ft,{className:"h-3 w-3"}),e.jsx("span",{children:"File Status Guide"}),r?e.jsx(he,{className:"h-3 w-3"}):e.jsx(Ae,{className:"h-3 w-3"})]}),r&&e.jsx("div",{className:"bg-muted/30 px-4 py-3 text-sm",children:e.jsx("div",{className:"flex justify-center gap-6",children:qt.map(a=>e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`inline-flex h-5 w-5 items-center justify-center rounded border text-[10px] font-bold ${Oe(a.status)}`,children:a.status}),e.jsx("span",{className:"italic text-muted-foreground",children:a.label})]},a.status))})})]})}function Qt({isMobile:t,projectPath:r,gitStatus:s,gitDiff:a,isLoading:o,wrapText:d,isCreatingInitialCommit:i,onWrapTextChange:g,onCreateInitialCommit:h,onOpenFile:m,onDiscardFile:f,onDeleteFile:v,onStageFiles:y,onUnstageFiles:p,onCommitChanges:j,onRequestConfirmation:u,onExpandedFilesChange:N}){const[x,T]=n.useState(new Set),[I,B]=n.useState(new Set),[W,w]=n.useState(0),$=n.useRef(Promise.resolve()),k=n.useMemo(()=>De(s),[s]),L=x.size>0,S=n.useCallback(C=>{w(A=>A+1),$.current=$.current.catch(()=>{}).then(C).finally(()=>w(A=>A-1))},[]);n.useEffect(()=>{if(!s||s.error){B(new Set);return}W>0||B(new Set(s.staged??[]))},[s,W]),n.useEffect(()=>{N(L)},[L,N]),n.useEffect(()=>()=>{N(!1)},[N]);const R=n.useCallback(C=>{T(A=>{const H=new Set(A);return H.has(C)?H.delete(C):H.add(C),H})},[]),G=n.useCallback(C=>{const A=I.has(C);B(H=>{const Q=new Set(H);return A?Q.delete(C):Q.add(C),Q}),S(()=>A?p([C]):y([C]))},[S,y,p,I]),J=n.useCallback((C,A)=>{if(A==="U"){u({type:"delete",message:`Delete untracked file "${C}"? This action cannot be undone.`,onConfirm:async()=>{await v(C)}});return}u({type:"discard",message:`Discard all changes to "${C}"? This action cannot be undone.`,onConfirm:async()=>{await f(C)}})},[v,f,u]),Y=n.useCallback(C=>j(C,Array.from(I)),[j,I]),U=n.useMemo(()=>new Set(k.filter(C=>!I.has(C))),[k,I]);return e.jsxs(e.Fragment,{children:[e.jsx(Gt,{isMobile:t,projectPath:r,selectedFileCount:I.size,isHidden:L,onCommit:Y,onRequestConfirmation:u}),!s?.error&&e.jsx(Vt,{isMobile:t}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:o?e.jsx("div",{className:"flex h-32 items-center justify-center",children:e.jsx(V,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):s?.hasCommits===!1&&We(s)?e.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:[e.jsx("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-muted/50",children:e.jsx(P,{className:"h-7 w-7 text-muted-foreground/50"})}),e.jsx("h3",{className:"mb-2 text-lg font-medium text-foreground",children:"No commits yet"}),e.jsx("p",{className:"mb-6 max-w-md text-sm text-muted-foreground",children:"This repository doesn't have any commits yet. Create your first commit to start tracking changes."}),e.jsx("button",{onClick:()=>void h(),disabled:i,className:"flex items-center gap-2 rounded-lg bg-primary px-4 py-2 text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50",children:i?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"h-4 w-4 animate-spin"}),e.jsx("span",{children:"Creating Initial Commit..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(Fe,{className:"h-4 w-4"}),e.jsx("span",{children:"Create Initial Commit"})]})})]}):!s||!We(s)?e.jsxs("div",{className:"flex h-32 flex-col items-center justify-center text-muted-foreground",children:[e.jsx(Fe,{className:"mb-2 h-10 w-10 opacity-40"}),e.jsx("p",{className:"text-sm",children:"No changes detected"})]}):e.jsxs("div",{className:t?"pb-4":"",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border/60 bg-muted/30 px-3 py-1.5",children:[e.jsxs("span",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:["Staged (",I.size,")"]}),I.size>0&&e.jsx("button",{onClick:()=>{const C=Array.from(I);B(new Set),S(()=>p(C))},className:"text-xs text-primary transition-colors hover:text-primary/80",children:"Unstage All"})]}),I.size===0?e.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground italic",children:"No staged files"}):e.jsx(Ge,{gitStatus:s,gitDiff:a,expandedFiles:x,selectedFiles:I,isMobile:t,wrapText:d,filePaths:I,onToggleSelected:G,onToggleExpanded:R,onOpenFile:C=>{m(C)},onToggleWrapText:()=>g(!d),onRequestFileAction:J}),e.jsxs("div",{className:"flex items-center justify-between border-b border-border/60 bg-muted/30 px-3 py-1.5",children:[e.jsxs("span",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:["Changes (",U.size,")"]}),U.size>0&&e.jsx("button",{onClick:()=>{const C=Array.from(U);B(new Set(k)),S(()=>y(C))},className:"text-xs text-primary transition-colors hover:text-primary/80",children:"Stage All"})]}),U.size===0?e.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground italic",children:"All changes staged"}):e.jsx(Ge,{gitStatus:s,gitDiff:a,expandedFiles:x,selectedFiles:I,isMobile:t,wrapText:d,filePaths:U,onToggleSelected:G,onToggleExpanded:R,onOpenFile:C=>{m(C)},onToggleWrapText:()=>g(!d),onRequestFileAction:J})]})})]})}const He=["#0ea5e9","#f97316","#a855f7","#22c55e","#ef4444","#eab308","#14b8a6","#ec4899","#6366f1","#84cc16"],ae=t=>He[t%He.length];function Kt(t){const r=[],s=[],a=()=>{const o=r.indexOf(null);return o!==-1?o:(r.push(null),r.length-1)};for(const o of t){const d=new Set;r.forEach((u,N)=>{u!==null&&d.add(N)});const i=[];r.forEach((u,N)=>{u===o.hash&&i.push(N)});const g=i.length>0,h=g?i[0]:a(),m=i.slice(1);for(const u of m)r[u]=null;const f=o.parents??[];r[h]=f.length>0?f[0]:null;const v=[];for(const u of f.slice(1)){const N=r.findIndex(x=>x===u);if(N!==-1&&N!==h)v.push(N);else{const x=a();r[x]=u,v.push(x)}}const y=[...d].filter(u=>u!==h&&!i.includes(u)).sort((u,N)=>u-N),p=[];r.forEach((u,N)=>{u!==null&&p.push(N)});const j=Math.max(r.length,h+1);for(;r.length>0&&r[r.length-1]===null;)r.pop();s.push({nodeLane:h,laneCount:j,hasTopContinuation:g,hasParentContinuation:f.length>0,inbound:m,outbound:v,passThrough:y,bottomLanes:p})}return s}const Re=12,ue=56,ee=28,Je=3.5,te=2,re=t=>t*Re+Re/2;function Xt({row:t}){const r=t.laneCount*Re,s=re(t.nodeLane),a=ae(t.nodeLane);return e.jsxs("div",{"aria-hidden":!0,className:"relative shrink-0 self-stretch overflow-hidden",style:{width:r},children:[e.jsxs("svg",{className:"absolute left-0 top-0",width:r,height:ue,fill:"none",children:[t.passThrough.map(o=>e.jsx("path",{d:`M ${re(o)} 0 V ${ue}`,stroke:ae(o),strokeWidth:te},`pass-${o}`)),t.hasTopContinuation&&e.jsx("path",{d:`M ${s} 0 V ${ee}`,stroke:a,strokeWidth:te}),t.hasParentContinuation&&e.jsx("path",{d:`M ${s} ${ee} V ${ue}`,stroke:a,strokeWidth:te}),t.inbound.map(o=>e.jsx("path",{d:`M ${re(o)} 0 Q ${re(o)} ${ee} ${s} ${ee}`,stroke:ae(o),strokeWidth:te},`in-${o}`)),t.outbound.map(o=>e.jsx("path",{d:`M ${s} ${ee} Q ${re(o)} ${ee} ${re(o)} ${ue}`,stroke:ae(o),strokeWidth:te},`out-${o}`)),e.jsx("circle",{cx:s,cy:ee,r:t.inbound.length>0||t.outbound.length>0?Je+.5:Je,fill:a})]}),t.bottomLanes.map(o=>e.jsx("div",{className:"absolute",style:{left:re(o)-te/2,top:ue,bottom:0,width:te,backgroundColor:ae(o)}},`rail-${o}`))]})}function Yt(t){return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function Zt({refName:t,color:r}){const s=t.startsWith("tag: "),a=t.startsWith("HEAD -> "),o=s?t.slice(5):a?t.slice(8):t;return e.jsxs("span",{className:"inline-flex max-w-40 items-center gap-1 rounded-full border px-1.5 py-px text-[10px] font-medium leading-4",style:{borderColor:r,color:r,backgroundColor:a?`${r}22`:"transparent"},title:t,children:[s?e.jsx(It,{className:"h-2.5 w-2.5 shrink-0"}):e.jsx(P,{className:"h-2.5 w-2.5 shrink-0"}),e.jsx("span",{className:"truncate",children:o})]})}function Pt({commit:t,isExpanded:r,diff:s,isMobile:a,wrapText:o,graphRow:d,onToggle:i}){const g=n.useMemo(()=>s?Mt(s):null,[s]),h=d?ae(d.nodeLane):"#0ea5e9";return e.jsxs("div",{className:"flex border-b border-border last:border-0",children:[d&&e.jsx(Xt,{row:d}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("button",{type:"button","aria-expanded":r,className:"flex w-full cursor-pointer items-start border-0 bg-transparent p-3 text-left transition-colors hover:bg-accent/50",onClick:i,children:[e.jsx("span",{className:"mr-2 mt-1 rounded p-0.5 hover:bg-accent",children:r?e.jsx(he,{className:"h-3 w-3"}):e.jsx(Ae,{className:"h-3 w-3"})}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[t.refs&&t.refs.length>0&&e.jsx("span",{className:"mb-0.5 flex flex-wrap gap-1",children:t.refs.map(m=>e.jsx(Zt,{refName:m,color:h},m))}),e.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:t.message}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[t.author," • ",t.date]})]}),e.jsx("span",{className:"flex-shrink-0 font-mono text-sm text-muted-foreground/60",children:t.hash.substring(0,7)})]})})]}),r&&s&&e.jsx("div",{className:"bg-muted/50",children:e.jsxs("div",{className:"max-h-[32rem] overflow-y-auto p-3",children:[e.jsx("p",{className:"mb-2 select-all font-mono text-xs text-muted-foreground/70",children:t.hash}),e.jsxs("div",{className:"mb-3 flex gap-4 text-xs text-muted-foreground",children:[e.jsxs("span",{children:[e.jsx("span",{className:"text-muted-foreground/60",children:"Author "}),t.author]}),e.jsxs("span",{children:[e.jsx("span",{className:"text-muted-foreground/60",children:"Date "}),Yt(t.date)]})]}),g&&e.jsxs("div",{className:"mb-3 flex gap-4 rounded-md bg-muted/80 px-4 py-2 text-center text-xs",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-muted-foreground/60",children:"Files"}),e.jsx("div",{className:"font-semibold text-foreground",children:g.totalFiles})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-muted-foreground/60",children:"Added"}),e.jsxs("div",{className:"font-semibold text-green-600 dark:text-green-400",children:["+",g.totalInsertions]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-muted-foreground/60",children:"Removed"}),e.jsxs("div",{className:"font-semibold text-red-600 dark:text-red-400",children:["-",g.totalDeletions]})]})]}),g&&g.files.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("p",{className:"mb-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground/60",children:"Changed Files"}),e.jsx("div",{className:"rounded-md border border-border/60",children:g.files.map((m,f)=>e.jsxs("div",{className:`flex items-center gap-2 px-2.5 py-1.5 text-xs ${f<g.files.length-1?"border-b border-border/40":""}`,children:[e.jsx("span",{className:`inline-flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border text-[9px] font-bold ${Oe(m.status)}`,children:m.status}),e.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[m.directory&&e.jsx("span",{className:"text-muted-foreground/60",children:m.directory}),e.jsx("span",{className:"font-medium text-foreground",children:m.filename})]}),e.jsxs("span",{className:"flex-shrink-0 font-mono text-muted-foreground/60",children:[m.insertions>0&&e.jsxs("span",{className:"text-green-600 dark:text-green-400",children:["+",m.insertions]}),m.insertions>0&&m.deletions>0&&"/",m.deletions>0&&e.jsxs("span",{className:"text-red-600 dark:text-red-400",children:["-",m.deletions]})]})]},m.path))})]}),e.jsx(st,{diff:s,isMobile:a,wrapText:o})]})})]})]})}function er({isMobile:t,isLoading:r,recentCommits:s,commitDiffs:a,wrapText:o,onFetchCommitDiff:d}){const[i,g]=n.useState(new Set),h=n.useMemo(()=>s.some(f=>f.parents!==void 0)?Kt(s):null,[s]),m=n.useCallback(f=>{const v=!i.has(f);g(y=>{const p=new Set(y);return p.has(f)?p.delete(f):p.add(f),p}),v&&!a[f]&&d(f).catch(y=>{console.error("Failed to fetch commit diff:",y)})},[a,i,d,g]);return e.jsx("div",{className:"flex-1 overflow-y-auto",children:r?e.jsx("div",{className:"flex h-32 items-center justify-center",children:e.jsx(V,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):s.length===0?e.jsxs("div",{className:"flex h-32 flex-col items-center justify-center text-muted-foreground",children:[e.jsx(et,{className:"mb-2 h-10 w-10 opacity-40"}),e.jsx("p",{className:"text-sm",children:"No commits found"})]}):e.jsx("div",{className:t?"pb-4":"",children:s.map((f,v)=>e.jsx(Pt,{commit:f,isExpanded:i.has(f.hash),diff:a[f.hash],isMobile:t,wrapText:o,graphRow:h?.[v],onToggle:()=>m(f.hash)},f.hash))})})}function nt({isOpen:t,currentBranch:r,isCreatingBranch:s,onClose:a,onCreateBranch:o}){const[d,i]=n.useState("");n.useEffect(()=>{t||i("")},[t]);const g=async()=>{const h=d.trim();if(!h)return!1;try{const m=await o(h);return m&&(i(""),a()),m}catch(m){return console.error("Failed to create branch:",m),!1}};return t?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[e.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm",onClick:a}),e.jsx("div",{className:"relative w-full max-w-md overflow-hidden rounded-xl border border-border bg-card shadow-2xl",role:"dialog","aria-modal":"true","aria-labelledby":"new-branch-title",children:e.jsxs("div",{className:"p-6",children:[e.jsx("h3",{className:"mb-4 text-lg font-semibold text-foreground",children:"Create New Branch"}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"git-new-branch-name",className:"mb-2 block text-sm font-medium text-foreground/80",children:"Branch Name"}),e.jsx("input",{id:"git-new-branch-name",type:"text",value:d,onChange:h=>i(h.target.value),onKeyDown:h=>{if(h.key==="Enter"&&!s){h.preventDefault(),h.stopPropagation(),g();return}h.key==="Escape"&&!s&&(h.preventDefault(),h.stopPropagation(),a())},placeholder:"feature/new-feature",className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-primary/30 focus:outline-none focus:ring-2 focus:ring-primary/20",autoFocus:!0})]}),e.jsxs("p",{className:"mb-4 text-sm text-muted-foreground",children:["This will create a new branch from the current branch (",r,")"]}),e.jsxs("div",{className:"flex justify-end space-x-3",children:[e.jsx("button",{onClick:a,className:"rounded-lg px-4 py-2 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:"Cancel"}),e.jsx("button",{onClick:()=>void g(),disabled:!d.trim()||s,className:"flex items-center space-x-2 rounded-lg bg-primary px-4 py-2 text-sm text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50",children:s?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"h-3 w-3 animate-spin"}),e.jsx("span",{children:"Creating..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(xe,{className:"h-3 w-3"}),e.jsx("span",{children:"Create Branch"})]})})]})]})})]}):null}function qe({name:t,isCurrent:r,isRemote:s,aheadCount:a,behindCount:o,isMobile:d,onSwitch:i,onDelete:g}){return e.jsxs("div",{className:`group flex items-center gap-3 border-b border-border/40 px-4 transition-colors hover:bg-accent/40 ${d?"py-2.5":"py-3"} ${r?"bg-primary/5":""}`,children:[e.jsx("div",{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md border ${r?"border-primary/30 bg-primary/10 text-primary":s?"border-border bg-muted text-muted-foreground":"border-border bg-muted/50 text-muted-foreground"}`,children:s?e.jsx(pt,{className:"h-3.5 w-3.5"}):e.jsx(P,{className:"h-3.5 w-3.5"})}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`truncate text-sm font-medium ${r?"text-foreground":"text-foreground/80"}`,children:t}),r&&e.jsx("span",{className:"shrink-0 rounded-full bg-primary/15 px-1.5 py-0.5 text-xs font-semibold text-primary",children:"current"}),s&&!r&&e.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-xs text-muted-foreground",children:"remote"})]}),r&&(a>0||o>0)&&e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[a>0&&e.jsxs("span",{className:"text-green-600 dark:text-green-400",children:["↑",a," ahead"]}),o>0&&e.jsxs("span",{className:"text-primary",children:["↓",o," behind"]})]})]}),e.jsx("div",{className:`flex shrink-0 items-center gap-1 ${r?"opacity-100":"opacity-0 group-hover:opacity-100"} transition-opacity`,children:r?e.jsx(pe,{className:"h-4 w-4 text-primary"}):s?null:e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:i,className:"rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",title:`Switch to ${t}`,children:"Switch"}),e.jsx("button",{onClick:g,className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive",title:`Delete ${t}`,children:e.jsx(oe,{className:"h-3.5 w-3.5"})})]})})]})}function Ve({label:t,count:r}){return e.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between bg-background/95 px-4 py-2 backdrop-blur-sm",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:t}),e.jsx("span",{className:"rounded-full bg-muted px-1.5 py-0.5 text-xs text-muted-foreground",children:r})]})}function tr({isMobile:t,isLoading:r,currentBranch:s,localBranches:a,remoteBranches:o,remoteStatus:d,isCreatingBranch:i,onSwitchBranch:g,onCreateBranch:h,onDeleteBranch:m,onRequestConfirmation:f}){const[v,y]=n.useState(!1),[p,j]=n.useState(""),u=d?.ahead??0,N=d?.behind??0,x=p.trim().toLowerCase(),T=n.useMemo(()=>x?a.filter(w=>w.toLowerCase().includes(x)):a,[a,x]),I=n.useMemo(()=>x?o.filter(w=>w.toLowerCase().includes(x)):o,[x,o]),B=w=>{f({type:"commit",message:`Switch to branch "${w}"? Make sure you have no uncommitted changes.`,onConfirm:()=>void g(w)})},W=w=>{f({type:"deleteBranch",message:`Delete branch "${w}"? A normal delete only succeeds when the branch is fully merged. This cannot be undone.`,onConfirm:()=>void m(w),alternateConfirmation:{label:"Force delete this unmerged branch",description:"Permanently removes the branch even when it contains commits that have not been merged elsewhere.",actionLabel:"Force delete",onConfirm:()=>void m(w,!0)}})};return r&&a.length===0?e.jsx("div",{className:"flex h-32 items-center justify-center",children:e.jsx(V,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):e.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border/40 px-4 py-2.5",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:[a.length," local",o.length>0?`, ${o.length} remote`:""]}),e.jsxs("button",{onClick:()=>y(!0),className:"flex items-center gap-1.5 rounded-lg bg-primary/10 px-3 py-1.5 text-sm font-medium text-primary transition-colors hover:bg-primary/20",children:[e.jsx(xe,{className:"h-3.5 w-3.5"}),"New branch"]})]}),e.jsxs("div",{className:"flex items-center gap-2 border-b border-border/40 px-4 py-2",children:[e.jsx(Xe,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e.jsx("input",{type:"text",value:p,onChange:w=>j(w.target.value),placeholder:"Search branches...",className:"w-full bg-transparent text-sm text-foreground placeholder:text-muted-foreground focus:outline-none"}),p&&e.jsx("button",{onClick:()=>j(""),className:"shrink-0 text-muted-foreground transition-colors hover:text-foreground",title:"Clear search",children:e.jsx(we,{className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[T.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(Ve,{label:"Local",count:T.length}),T.map(w=>e.jsx(qe,{name:w,isCurrent:w===s,isRemote:!1,aheadCount:w===s?u:0,behindCount:w===s?N:0,isMobile:t,onSwitch:()=>B(w),onDelete:()=>W(w)},`local:${w}`))]}),I.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(Ve,{label:"Remote",count:I.length}),I.map(w=>e.jsx(qe,{name:w,isCurrent:!1,isRemote:!0,aheadCount:0,behindCount:0,isMobile:t,onSwitch:()=>B(w),onDelete:()=>W(w)},`remote:${w}`))]}),T.length===0&&I.length===0&&e.jsxs("div",{className:"flex h-32 flex-col items-center justify-center gap-2 text-muted-foreground",children:[e.jsx(P,{className:"h-10 w-10 opacity-30"}),e.jsx("p",{className:"text-sm",children:x?"No branches match your search":"No branches found"})]})]}),e.jsx(nt,{isOpen:v,currentBranch:s,isCreatingBranch:i,onClose:()=>y(!1),onCreateBranch:h})]})}function Ne(t,r){const s=t.error?.message||r,a=t.error?.details;return Array.isArray(a)&&a.length>0?`${s}: ${a.slice(0,5).join(", ")}${a.length>5?", …":""}`:typeof a=="string"&&a.trim()?`${s}: ${a.trim()}`:s}function rr({selectedProject:t,onProjectSelect:r,onProjectsRefresh:s}){const[a,o]=n.useState(null),[d,i]=n.useState(!1),[g,h]=n.useState(!1),[m,f]=n.useState(!1),[v,y]=n.useState(null),p=n.useRef(null),[j,u]=n.useState(null),N=n.useCallback(()=>u(null),[]),x=n.useRef(t?.projectId??null);n.useEffect(()=>{x.current=t?.projectId??null},[t]);const T=n.useCallback(async()=>{if(!t)return;const $=t.projectId;i(!0);try{const k=await Z(`/api/worktrees?project=${encodeURIComponent($)}`),L=await k.json();if(x.current!==$)return;if(!k.ok||!L.data){o(null);return}o(L.data)}catch(k){console.error("Error fetching worktrees:",k),x.current===$&&o(null)}finally{x.current===$&&(i(!1),h(!0))}},[t]);n.useEffect(()=>{o(null),h(!1),u(null),T()},[T]);const I=n.useCallback(async($,k,L)=>{const S=$.trim();if(!t||!S)return!1;const R=t.projectId;f(!0),u(null);try{const G=await Z("/api/worktrees/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:R,branch:S,baseBranch:k})}),J=await G.json();return x.current!==R?!1:!G.ok||!J.data?(u(Ne(J,"Failed to create worktree")),!1):(s?.(),L&&J.data.project&&r?r(J.data.project):T(),!0)}catch(G){return x.current===R&&u(G instanceof Error?G.message:"Failed to create worktree"),!1}finally{f(!1)}},[T,r,s,t]),B=n.useCallback(async $=>{if(!t||p.current!==null)return!1;const k=t.projectId,L=Symbol("open-worktree");p.current=L,y($),u(null);try{const S=await Z("/api/worktrees/open",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:k,worktreePath:$})}),R=await S.json();return x.current!==k?!1:!S.ok||!R.data?.project?(u(Ne(R,"Failed to open worktree")),!1):(s?.(),r?.(R.data.project),!0)}catch(S){return x.current===k&&u(S instanceof Error?S.message:"Failed to open worktree"),!1}finally{p.current===L&&(p.current=null,y(null))}},[r,s,t]),W=n.useCallback(async($,k)=>{if(!t||p.current!==null)return!1;const L=Symbol("merge-worktree");p.current=L,y($),u(null);try{const S=await Z("/api/worktrees/merge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:t.projectId,worktreePath:$,squash:k.squash,message:k.message,removeAfterMerge:k.removeAfterMerge})}),R=await S.json();return!S.ok||!R.success?(u(Ne(R,"Merge failed")),!1):(s?.(),T(),!0)}catch(S){return u(S instanceof Error?S.message:"Merge failed"),!1}finally{p.current===L&&(p.current=null,y(null))}},[T,s,t]),w=n.useCallback(async($,k)=>{if(!t||p.current!==null)return!1;const L=Symbol("remove-worktree");p.current=L,y($),u(null);try{const S=await Z("/api/worktrees/remove",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:t.projectId,worktreePath:$,force:k.force,deleteBranch:k.deleteBranch})}),R=await S.json();return!S.ok||!R.success?(u(Ne(R,"Failed to remove worktree")),!1):(s?.(),T(),!0)}catch(S){return u(S instanceof Error?S.message:"Failed to remove worktree"),!1}finally{p.current===L&&(p.current=null,y(null))}},[T,s,t]);return{worktreeData:a,isLoading:d||!g,isCreatingWorktree:m,busyWorktreePath:v,actionError:j,clearActionError:N,refreshWorktrees:T,createWorktree:I,openWorktree:B,mergeWorktree:W,removeWorktree:w}}function Qe(t,r){return t?r?`Squash merge branch '${t}'`:`Merge branch '${t}'`:""}function sr({worktree:t,baseBranch:r,isMerging:s,onClose:a,onMerge:o}){const[d,i]=n.useState(!0),[g,h]=n.useState(""),[m,f]=n.useState(!0),[v,y]=n.useState(!1);n.useEffect(()=>{t&&(i(!0),f(!0),h(Qe(t.branch,!0)),y(!1))},[t]);const p=N=>{i(N),v||h(Qe(t?.branch??null,N))},j=async()=>{if(!t)return;await o(t.path,{squash:d,message:g.trim(),removeAfterMerge:m})&&a()};if(!t)return null;const u=`${t.ahead} commit${t.ahead===1?"":"s"}`;return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[e.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm",onClick:a}),e.jsx("div",{className:"relative w-full max-w-md overflow-hidden rounded-xl border border-border bg-card shadow-2xl",role:"dialog","aria-modal":"true","aria-labelledby":"merge-worktree-title",children:e.jsxs("div",{className:"p-6",children:[e.jsx("h3",{id:"merge-worktree-title",className:"mb-1 text-lg font-semibold text-foreground",children:"Merge Worktree"}),e.jsxs("div",{className:"mb-4 flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"max-w-[45%] truncate rounded-md bg-primary/10 px-2 py-1 font-mono text-primary",children:t.branch}),e.jsx(gt,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e.jsx("span",{className:"max-w-[45%] truncate rounded-md bg-muted px-2 py-1 font-mono text-foreground/80",children:r}),e.jsx("span",{className:"ml-auto shrink-0 text-xs text-muted-foreground",children:u})]}),e.jsxs("label",{className:"mb-3 flex cursor-pointer items-start gap-2 text-sm text-foreground/80",children:[e.jsx("input",{type:"checkbox",checked:d,onChange:N=>p(N.target.checked),className:"mt-0.5 h-4 w-4 rounded border-border accent-primary"}),e.jsxs("span",{children:["Squash commits",e.jsxs("span",{className:"block text-xs text-muted-foreground",children:["Combine all ",u," into a single commit on ",r]})]})]}),e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{htmlFor:"merge-worktree-message",className:"mb-2 block text-sm font-medium text-foreground/80",children:"Commit message"}),e.jsx("textarea",{id:"merge-worktree-message",value:g,onChange:N=>{h(N.target.value),y(!0)},rows:2,className:"w-full resize-none rounded-xl border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:border-primary/30 focus:outline-none focus:ring-2 focus:ring-primary/20"})]}),e.jsxs("label",{className:"mb-4 flex cursor-pointer items-start gap-2 text-sm text-foreground/80",children:[e.jsx("input",{type:"checkbox",checked:m,onChange:N=>f(N.target.checked),className:"mt-0.5 h-4 w-4 rounded border-border accent-primary"}),e.jsxs("span",{children:["Clean up after merge",e.jsx("span",{className:"block text-xs text-muted-foreground",children:"Remove the worktree and delete its branch once merged"})]})]}),e.jsxs("div",{className:"flex justify-end space-x-3",children:[e.jsx("button",{onClick:a,className:"rounded-lg px-4 py-2 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:"Cancel"}),e.jsx("button",{onClick:()=>void j(),disabled:s||!g.trim(),className:"flex items-center space-x-2 rounded-lg bg-primary px-4 py-2 text-sm text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50",children:s?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"h-3 w-3 animate-spin"}),e.jsx("span",{children:"Merging..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ye,{className:"h-3 w-3"}),e.jsx("span",{children:d?"Squash & Merge":"Merge"})]})})]})]})})]})}function nr(t){return t.replace(/[/\\:*?"<>|\s]+/g,"-").replace(/\.+$/g,"").replace(/^-+|-+$/g,"")}function ar(t){const r=t.split(/[\\/]/).filter(Boolean);return r[r.length-1]??t}function or({isOpen:t,baseBranch:r,localBranches:s,repositoryRoot:a,isCreating:o,onClose:d,onCreate:i}){const[g,h]=n.useState(""),[m,f]=n.useState(""),[v,y]=n.useState(!0);n.useEffect(()=>{if(!t)h(""),y(!0);else{const x=r&&s.includes(r)?r:s[0]??"";f(x)}},[t,r,s]);const p=g.trim(),j=s.includes(p),u=n.useMemo(()=>{if(!p)return null;const x=nr(p);return x?`${ar(a)}-worktrees/${x}`:null},[a,p]),N=async()=>{if(!p)return!1;const x=await i(p,j?null:m||null,v);return x&&d(),x};return t?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[e.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm",onClick:d}),e.jsx("div",{className:"relative w-full max-w-md overflow-hidden rounded-xl border border-border bg-card shadow-2xl",role:"dialog","aria-modal":"true","aria-labelledby":"new-worktree-title",children:e.jsxs("div",{className:"p-6",children:[e.jsx("h3",{id:"new-worktree-title",className:"mb-1 text-lg font-semibold text-foreground",children:"New Worktree"}),e.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:"Check out a branch in its own folder and work on it in parallel."}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"worktree-branch-name",className:"mb-2 block text-sm font-medium text-foreground/80",children:"Branch"}),e.jsx("input",{id:"worktree-branch-name",type:"text",value:g,onChange:x=>h(x.target.value),onKeyDown:x=>{if(x.key==="Enter"&&!o){x.preventDefault(),x.stopPropagation(),N();return}x.key==="Escape"&&!o&&(x.preventDefault(),x.stopPropagation(),d())},placeholder:"feature/new-feature",className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-foreground placeholder:text-muted-foreground focus:border-primary/30 focus:outline-none focus:ring-2 focus:ring-primary/20",autoFocus:!0}),j&&e.jsx("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"Existing branch — it will be checked out as-is."})]}),!j&&e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"worktree-base-branch",className:"mb-2 block text-sm font-medium text-foreground/80",children:"Create from"}),e.jsx("select",{id:"worktree-base-branch",value:m,onChange:x=>f(x.target.value),className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-foreground focus:border-primary/30 focus:outline-none focus:ring-2 focus:ring-primary/20",children:s.map(x=>e.jsx("option",{value:x,children:x},x))})]}),u&&e.jsxs("p",{className:"mb-4 rounded-lg bg-muted/50 px-3 py-2 text-xs text-muted-foreground",children:["Will be created in ",e.jsx("span",{className:"font-mono text-foreground/80",children:u})]}),e.jsxs("label",{className:"mb-4 flex cursor-pointer items-center gap-2 text-sm text-foreground/80",children:[e.jsx("input",{type:"checkbox",checked:v,onChange:x=>y(x.target.checked),className:"h-4 w-4 rounded border-border accent-primary"}),"Switch to the worktree after creating it"]}),e.jsxs("div",{className:"flex justify-end space-x-3",children:[e.jsx("button",{onClick:d,className:"rounded-lg px-4 py-2 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:"Cancel"}),e.jsx("button",{onClick:()=>void N(),disabled:!p||o,className:"flex items-center space-x-2 rounded-lg bg-primary px-4 py-2 text-sm text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50",children:o?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"h-3 w-3 animate-spin"}),e.jsx("span",{children:"Creating..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(ve,{className:"h-3 w-3"}),e.jsx("span",{children:"Create Worktree"})]})})]})]})})]}):null}function ir({worktree:t,isRemoving:r,onClose:s,onRemove:a}){const[o,d]=n.useState(!0),[i,g]=n.useState(!1);n.useEffect(()=>{t&&(d(!0),g(!1))},[t]);const h=async()=>{if(!t)return;await a(t.path,{force:i,deleteBranch:o})&&s()};if(!t)return null;const m=t.changedFileCount>0;return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[e.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm",onClick:s}),e.jsx("div",{className:"relative w-full max-w-md overflow-hidden rounded-xl border border-border bg-card shadow-2xl",role:"dialog","aria-modal":"true","aria-labelledby":"remove-worktree-title",children:e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"mb-4 flex items-center",children:[e.jsx("div",{className:"mr-3 rounded-full bg-red-100 p-2 dark:bg-red-900/30",children:e.jsx(oe,{className:"h-4 w-4 text-red-600 dark:text-red-400"})}),e.jsx("h3",{id:"remove-worktree-title",className:"text-lg font-semibold text-foreground",children:"Remove Worktree"})]}),e.jsxs("p",{className:"mb-3 text-sm text-muted-foreground",children:["Remove the worktree for"," ",e.jsx("span",{className:"font-mono text-foreground/80",children:t.branch??"detached HEAD"}),"? Its folder is deleted and the linked project is archived — chat sessions stay recoverable."]}),m&&e.jsxs("p",{className:"mb-3 rounded-lg border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-600 dark:text-amber-400",children:["This worktree has ",t.changedFileCount," uncommitted change",t.changedFileCount===1?"":"s"," that will be lost."]}),t.branch&&e.jsxs("label",{className:"mb-2 flex cursor-pointer items-center gap-2 text-sm text-foreground/80",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:f=>d(f.target.checked),className:"h-4 w-4 rounded border-border accent-primary"}),"Also delete branch ",e.jsx("span",{className:"font-mono",children:t.branch})]}),m&&e.jsxs("label",{className:"mb-2 flex cursor-pointer items-center gap-2 text-sm text-foreground/80",children:[e.jsx("input",{type:"checkbox",checked:i,onChange:f=>g(f.target.checked),className:"h-4 w-4 rounded border-border accent-primary"}),"Discard uncommitted changes"]}),e.jsxs("div",{className:"mt-4 flex justify-end space-x-3",children:[e.jsx("button",{onClick:s,className:"rounded-lg px-4 py-2 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:"Cancel"}),e.jsx("button",{onClick:()=>void h(),disabled:r||m&&!i,className:"flex items-center space-x-2 rounded-lg bg-red-600 px-4 py-2 text-sm text-white transition-colors hover:bg-red-700 disabled:cursor-not-allowed disabled:opacity-50",children:r?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"h-3 w-3 animate-spin"}),e.jsx("span",{children:"Removing..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"h-3 w-3"}),e.jsx("span",{children:"Remove"})]})})]})]})})]})}function lr(t){return t.split(/[\\/]/).filter(Boolean).slice(-2).join("/")||t}function cr({worktree:t,isMobile:r,isBusy:s,onOpen:a,onMerge:o,onRemove:d}){const i=t.branch??(t.headSha?`detached @ ${t.headSha.slice(0,7)}`:"detached");return e.jsxs("div",{className:`group flex items-center gap-3 border-b border-border/40 px-4 transition-colors hover:bg-accent/40 ${r?"py-2.5":"py-3"} ${t.isCurrent?"bg-primary/5":""}`,children:[e.jsx("div",{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md border ${t.isCurrent?"border-primary/30 bg-primary/10 text-primary":"border-border bg-muted/50 text-muted-foreground"}`,children:t.isMain?e.jsx($t,{className:"h-3.5 w-3.5"}):e.jsx(ve,{className:"h-3.5 w-3.5"})}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`truncate text-sm font-medium ${t.isCurrent?"text-foreground":"text-foreground/80"}`,children:i}),t.isCurrent&&e.jsx("span",{className:"shrink-0 rounded-full bg-primary/15 px-1.5 py-0.5 text-xs font-semibold text-primary",children:"current"}),t.isMain&&e.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-xs text-muted-foreground",children:"main worktree"}),t.isLocked&&e.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-xs text-muted-foreground",children:"locked"})]}),e.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs text-muted-foreground",children:[e.jsx("span",{className:"shrink-0 font-mono",children:lr(t.path)}),t.ahead>0&&e.jsxs("span",{className:"shrink-0 text-green-600 dark:text-green-400",children:["↑",t.ahead]}),t.behind>0&&e.jsxs("span",{className:"shrink-0 text-primary",children:["↓",t.behind]}),t.changedFileCount>0&&e.jsxs("span",{className:"shrink-0 text-amber-600 dark:text-amber-400",children:["● ",t.changedFileCount," change",t.changedFileCount===1?"":"s"]}),t.lastCommitSubject&&e.jsx("span",{className:"truncate",children:t.lastCommitSubject})]})]}),e.jsx("div",{className:`flex shrink-0 items-center gap-1 ${t.isCurrent||s?"opacity-100":"opacity-100 sm:opacity-0 sm:focus-within:opacity-100 sm:group-hover:opacity-100"} transition-opacity`,children:s?e.jsx(V,{className:"h-4 w-4 animate-spin text-muted-foreground"}):t.isCurrent?e.jsx(pe,{className:"h-4 w-4 text-primary"}):e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:a,className:"flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",title:`Switch to ${i}`,children:[e.jsx(vt,{className:"h-3 w-3"}),"Open"]}),!t.isMain&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:o,disabled:!t.branch||t.ahead===0,className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-primary/10 hover:text-primary disabled:cursor-not-allowed disabled:opacity-40",title:t.ahead===0?"Nothing to merge — no commits ahead of the base branch":`Merge ${i} into the base branch`,children:e.jsx(Ye,{className:"h-3.5 w-3.5"})}),e.jsx("button",{onClick:d,className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive",title:`Remove worktree for ${i}`,children:e.jsx(oe,{className:"h-3.5 w-3.5"})})]})]})})]})}function dr({isMobile:t,selectedProject:r,localBranches:s,onProjectSelect:a,onProjectsRefresh:o}){const{worktreeData:d,isLoading:i,isCreatingWorktree:g,busyWorktreePath:h,actionError:m,clearActionError:f,refreshWorktrees:v,createWorktree:y,openWorktree:p,mergeWorktree:j,removeWorktree:u}=rr({selectedProject:r,onProjectSelect:a,onProjectsRefresh:o}),[N,x]=n.useState(!1),[T,I]=n.useState(null),[B,W]=n.useState(null),w=d?.worktrees??[],$=w.filter(k=>!k.isMain).length;return i&&w.length===0?e.jsx("div",{className:"flex h-32 items-center justify-center",children:e.jsx(V,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):e.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border/40 px-4 py-2.5",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:$===0?"No worktrees":`${$} worktree${$===1?"":"s"}`}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("button",{onClick:()=>void v(),className:"rounded-lg p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",title:"Refresh worktrees",children:e.jsx(V,{className:`h-3.5 w-3.5 ${i?"animate-spin":""}`})}),e.jsxs("button",{onClick:()=>x(!0),disabled:!d,className:"flex items-center gap-1.5 rounded-lg bg-primary/10 px-3 py-1.5 text-sm font-medium text-primary transition-colors hover:bg-primary/20 disabled:cursor-not-allowed disabled:opacity-50",children:[e.jsx(xe,{className:"h-3.5 w-3.5"}),"New worktree"]})]})]}),m&&e.jsxs("div",{className:"flex items-start gap-2 border-b border-destructive/30 bg-destructive/10 px-4 py-2.5",children:[e.jsx("p",{className:"min-w-0 flex-1 break-words text-xs text-destructive",children:m}),e.jsx("button",{onClick:f,className:"shrink-0 text-destructive/70 transition-colors hover:text-destructive",title:"Dismiss",children:e.jsx(we,{className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[w.map(k=>e.jsx(cr,{worktree:k,isMobile:t,isBusy:h===k.path,onOpen:()=>void p(k.path),onMerge:()=>I(k),onRemove:()=>W(k)},k.path)),$===0&&e.jsxs("div",{className:"flex flex-col items-center gap-3 px-6 py-10 text-center",children:[e.jsx(ve,{className:"h-10 w-10 text-muted-foreground opacity-30"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground/80",children:"Work on branches in parallel"}),e.jsx("p",{className:"mx-auto mt-1 max-w-xs text-xs text-muted-foreground",children:"A worktree checks out a branch in its own folder, so you can run separate chat sessions side by side and merge the results back when they're ready."})]}),e.jsxs("button",{onClick:()=>x(!0),disabled:!d,className:"flex items-center gap-1.5 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50",children:[e.jsx(xe,{className:"h-3.5 w-3.5"}),"Create your first worktree"]})]})]}),e.jsx(or,{isOpen:N,baseBranch:d?.baseBranch??null,localBranches:s,repositoryRoot:d?.repositoryRoot??"",isCreating:g,onClose:()=>x(!1),onCreate:y}),e.jsx(sr,{worktree:T,baseBranch:d?.baseBranch??null,isMerging:T!==null&&h===T.path,onClose:()=>I(null),onMerge:j}),e.jsx(ir,{worktree:B,isRemoving:B!==null&&h===B.path,onClose:()=>W(null),onRemove:u})]})}function mr({isMobile:t,currentBranch:r,branches:s,remoteStatus:a,isLoading:o,isCreatingBranch:d,isFetching:i,isPulling:g,isPushing:h,isPublishing:m,isRevertingLocalCommit:f,operationError:v,onRefresh:y,onRevertLocalCommit:p,onSwitchBranch:j,onCreateBranch:u,onFetch:N,onPull:x,onPush:T,onPublish:I,onClearError:B,onRequestConfirmation:W}){const[w,$]=n.useState(!1),[k,L]=n.useState(!1),[S,R]=n.useState(""),G=n.useRef(null),J=n.useRef(null);n.useEffect(()=>{w?J.current?.focus():R("")},[w]);const Y=n.useMemo(()=>{const D=S.trim().toLowerCase();return D?s.filter(K=>K.toLowerCase().includes(D)):s},[s,S]);n.useEffect(()=>{const D=K=>{G.current&&!G.current.contains(K.target)&&$(!1)};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[]);const U=a?.ahead??0,C=a?.behind??0,A=a?.remoteName??"remote",H=i||g||h||m,Q=()=>{W({type:"pull",message:`Pull ${C} commit${C!==1?"s":""} from ${A}?`,onConfirm:x})},se=()=>{W({type:"push",message:`Push ${U} commit${U!==1?"s":""} to ${A}?`,onConfirm:T})},ie=()=>{W({type:"publish",message:`Publish branch "${r}" to ${A}?`,onConfirm:I})},ne=()=>{W({type:"revertLocalCommit",message:"Revert the latest local commit? This removes the commit but keeps its changes staged.",onConfirm:p})},le=async D=>{try{await j(D)&&$(!1)}catch(K){console.error("[GitPanelHeader] Failed to switch branch:",K)}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`flex items-center justify-between border-b border-border/60 ${t?"px-3 py-2":"px-4 py-3"}`,children:[e.jsxs("div",{className:"relative",ref:G,children:[e.jsxs("button",{onClick:()=>$(D=>!D),className:`flex items-center rounded-lg transition-colors hover:bg-accent ${t?"space-x-1 px-2 py-1":"space-x-2 px-3 py-1.5"}`,children:[e.jsx(P,{className:`text-muted-foreground ${t?"h-3 w-3":"h-4 w-4"}`}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:`font-medium ${t?"text-xs":"text-sm"}`,children:r}),a?.hasRemote&&e.jsxs("span",{className:"flex items-center gap-0.5 text-xs",children:[U>0&&e.jsxs("span",{className:"text-green-600 dark:text-green-400",title:`${U} ahead`,children:["↑",U]}),C>0&&e.jsxs("span",{className:"text-primary",title:`${C} behind`,children:["↓",C]}),a.isUpToDate&&e.jsx("span",{className:"text-muted-foreground",title:"Up to date",children:"✓"})]})]}),e.jsx(he,{className:`h-3 w-3 text-muted-foreground transition-transform ${w?"rotate-180":""}`})]}),w&&e.jsxs("div",{className:"absolute left-0 top-full z-50 mt-1 w-64 overflow-hidden rounded-xl border border-border bg-card shadow-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[e.jsx(Xe,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e.jsx("input",{ref:J,type:"text",value:S,onChange:D=>R(D.target.value),placeholder:"Search branches...",className:"w-full bg-transparent text-sm text-foreground placeholder:text-muted-foreground focus:outline-none"}),S&&e.jsx("button",{onClick:()=>R(""),className:"shrink-0 text-muted-foreground transition-colors hover:text-foreground",title:"Clear search",children:e.jsx(we,{className:"h-3.5 w-3.5"})})]}),e.jsx("div",{className:"max-h-64 overflow-y-auto py-1",children:Y.length===0?e.jsx("div",{className:"px-4 py-3 text-center text-sm text-muted-foreground",children:"No matching branches"}):Y.map(D=>e.jsx("button",{onClick:()=>void le(D),className:`w-full px-4 py-2 text-left text-sm transition-colors hover:bg-accent ${D===r?"bg-accent/50 text-foreground":"text-muted-foreground"}`,children:e.jsxs("span",{className:"flex items-center space-x-2",children:[D===r&&e.jsx(pe,{className:"h-3 w-3 text-primary"}),e.jsx("span",{className:D===r?"font-medium":"",children:D})]})},D))}),e.jsx("div",{className:"border-t border-border py-1",children:e.jsxs("button",{onClick:()=>{L(!0),$(!1)},className:"flex w-full items-center space-x-2 px-4 py-2 text-left text-sm transition-colors hover:bg-accent",children:[e.jsx(xe,{className:"h-3 w-3"}),e.jsx("span",{children:"Create new branch"})]})})]})]}),e.jsxs("div",{className:`flex items-center ${t?"gap-1":"gap-2"}`,children:[a?.hasRemote&&e.jsx(e.Fragment,{children:a.hasUpstream?e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>void N(),disabled:H,className:"flex items-center gap-1 rounded-lg bg-primary px-2.5 py-1 text-sm text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",title:`Fetch from ${A}`,children:[e.jsx(V,{className:`h-3 w-3 ${i?"animate-spin":""}`}),!t&&e.jsx("span",{children:i?"Fetching…":"Fetch"})]}),C>0&&e.jsxs("button",{onClick:Q,disabled:H,className:"flex items-center gap-1 rounded-lg bg-green-600 px-2.5 py-1 text-sm text-white transition-colors hover:bg-green-700 disabled:opacity-50",title:`Pull ${C} from ${A}`,children:[e.jsx(Ze,{className:`h-3 w-3 ${g?"animate-pulse":""}`}),!t&&e.jsx("span",{children:g?"Pulling…":`Pull ${C}`})]}),U>0&&e.jsxs("button",{onClick:se,disabled:H,className:"flex items-center gap-1 rounded-lg bg-orange-600 px-2.5 py-1 text-sm text-white transition-colors hover:bg-orange-700 disabled:opacity-50",title:`Push ${U} to ${A}`,children:[e.jsx(Le,{className:`h-3 w-3 ${h?"animate-pulse":""}`}),!t&&e.jsx("span",{children:h?"Pushing…":`Push ${U}`})]})]}):e.jsxs("button",{onClick:ie,disabled:H,className:"flex items-center gap-1 rounded-lg bg-primary px-2.5 py-1 text-sm text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",title:`Publish "${r}" to ${A}`,children:[e.jsx(Le,{className:`h-3 w-3 ${m?"animate-pulse":""}`}),!t&&e.jsx("span",{children:m?"Publishing…":"Publish"})]})}),e.jsx("button",{onClick:ne,disabled:f,className:`rounded-lg transition-colors hover:bg-accent disabled:opacity-50 ${t?"p-1":"p-1.5"}`,title:"Revert latest local commit",children:e.jsx(Pe,{className:`text-muted-foreground ${f?"animate-pulse":""} ${t?"h-3 w-3":"h-4 w-4"}`})}),e.jsx("button",{onClick:y,disabled:o,className:`rounded-lg transition-colors hover:bg-accent ${t?"p-1":"p-1.5"}`,title:"Refresh git status",children:e.jsx(V,{className:`text-muted-foreground ${o?"animate-spin":""} ${t?"h-3 w-3":"h-4 w-4"}`})})]})]}),v&&e.jsxs("div",{className:"flex items-start gap-2 border-b border-destructive/20 bg-destructive/10 px-4 py-2.5 text-sm text-destructive",children:[e.jsx(bt,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("span",{className:"flex-1 leading-snug",children:v}),e.jsx("button",{onClick:B,className:"shrink-0 rounded p-0.5 hover:bg-destructive/20","aria-label":"Dismiss error",children:e.jsx(we,{className:"h-3.5 w-3.5"})})]}),e.jsx(nt,{isOpen:k,currentBranch:r,isCreatingBranch:d,onClose:()=>L(!1),onCreateBranch:u})]})}function ur({error:t,details:r,canInitRepository:s=!1,isInitializingRepository:a=!1,initError:o,onInitRepository:d}){const i=s&&!!d;return e.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center px-6 py-12 text-muted-foreground",children:[e.jsx("div",{className:"mb-6 flex h-16 w-16 items-center justify-center rounded-2xl bg-muted/50",children:e.jsx(P,{className:"h-8 w-8 opacity-40"})}),i?e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"mb-3 text-center text-lg font-medium text-foreground",children:"No git repository"}),e.jsx("p",{className:"mb-6 max-w-md text-center text-sm leading-relaxed",children:"This project is not a git repository yet. Initialize one to start tracking changes and use source control features."}),e.jsx("button",{onClick:d,disabled:a,className:"flex items-center gap-2 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-60",children:a?e.jsxs(e.Fragment,{children:[e.jsx(yt,{className:"h-4 w-4 animate-spin"}),"Initializing repository..."]}):e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"h-4 w-4"}),"Run git init"]})}),o&&e.jsx("p",{className:"mt-4 max-w-md text-center text-sm leading-relaxed text-destructive",children:o})]}):e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"mb-3 text-center text-lg font-medium text-foreground",children:t}),r&&e.jsx("p",{className:"max-w-md text-center text-sm leading-relaxed",children:r})]})]})}const hr=[{id:"changes",label:"Changes",Icon:jt},{id:"history",label:"Commits",Icon:et},{id:"branches",label:"Branches",Icon:P},{id:"worktrees",label:"Worktrees",Icon:ve}];function xr({activeView:t,isHidden:r,changeCount:s,onChange:a}){return e.jsx("div",{className:`border-b border-border/60 transition-all duration-300 ease-in-out ${r?"max-h-0 -translate-y-2 overflow-hidden opacity-0":"max-h-16 translate-y-0 opacity-100"}`,children:e.jsx("div",{className:"scrollbar-hide flex w-full snap-x overflow-x-auto overscroll-x-contain [-webkit-overflow-scrolling:touch]",role:"tablist","aria-label":"Source control views",children:hr.map(({id:o,label:d,Icon:i})=>e.jsx("button",{type:"button",role:"tab","aria-selected":t===o,onClick:()=>a(o),className:`min-w-max flex-none snap-start px-4 py-2 text-sm font-medium transition-colors sm:min-w-0 sm:flex-1 ${t===o?"border-b-2 border-primary text-primary":"text-muted-foreground hover:text-foreground"}`,children:e.jsxs("span",{className:"flex items-center justify-center gap-2",children:[e.jsx(i,{className:"h-4 w-4"}),e.jsx("span",{children:d}),o==="changes"&&s>0&&e.jsx("span",{className:"rounded-full bg-primary/15 px-1.5 py-0.5 text-xs font-semibold text-primary",children:s})]})},o))})})}function Ke(t){return t==="discard"||t==="delete"?e.jsx(oe,{className:"h-4 w-4"}):t==="commit"?e.jsx(pe,{className:"h-4 w-4"}):t==="pull"?e.jsx(Ze,{className:"h-4 w-4"}):t==="revertLocalCommit"?e.jsx(Pe,{className:"h-4 w-4"}):e.jsx(Le,{className:"h-4 w-4"})}function fr({action:t,onCancel:r,onConfirm:s}){const[a,o]=n.useState(!1),d=t?`confirmation-title-${t.type}`:void 0,i=()=>{o(!1),r()},g=()=>{const h=a&&!!t?.alternateConfirmation;o(!1),s(h)};return n.useEffect(()=>{if(!t)return;const h=m=>{m.key==="Escape"&&(o(!1),r())};return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[t,r]),t?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[e.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm",onClick:i}),e.jsxs("div",{className:"relative flex max-h-[calc(100dvh-2rem)] w-full max-w-md flex-col overflow-hidden rounded-xl border border-border bg-card shadow-2xl",role:"dialog","aria-modal":"true","aria-labelledby":d,children:[e.jsxs("div",{className:"flex shrink-0 items-center px-6 pt-6",children:[e.jsx("div",{className:`mr-3 rounded-full p-2 ${Ot[t.type]}`,children:Ke(t.type)}),e.jsx("h3",{id:d,className:"text-lg font-semibold text-foreground",children:Rt[t.type]})]}),e.jsx("p",{className:"scrollbar-thin my-4 min-h-0 flex-1 overflow-y-auto overscroll-contain whitespace-pre-wrap break-words px-6 text-sm text-muted-foreground",children:t.message}),t.alternateConfirmation&&e.jsxs("label",{className:"mx-6 mb-5 flex cursor-pointer items-start gap-3 rounded-lg border border-destructive/30 bg-destructive/5 p-3 transition-colors hover:bg-destructive/10",children:[e.jsx("input",{type:"checkbox",checked:a,onChange:h=>o(h.target.checked),className:"mt-0.5 h-4 w-4 shrink-0 accent-destructive"}),e.jsxs("span",{className:"min-w-0",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-sm font-medium text-foreground",children:[e.jsx(Nt,{className:"h-3.5 w-3.5 text-destructive"}),t.alternateConfirmation.label]}),e.jsx("span",{className:"mt-1 block text-xs leading-relaxed text-muted-foreground",children:t.alternateConfirmation.description})]})]}),e.jsxs("div",{className:"flex shrink-0 justify-end space-x-3 px-6 pb-6",children:[e.jsx("button",{onClick:i,className:"rounded-lg px-4 py-2 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:"Cancel"}),e.jsxs("button",{onClick:g,className:`flex items-center space-x-2 rounded-lg px-4 py-2 text-sm text-white transition-colors ${Dt[t.type]}`,children:[Ke(t.type),e.jsx("span",{children:a&&t.alternateConfirmation?t.alternateConfirmation.actionLabel:At[t.type]})]})]})]})]}):null}function br({selectedProject:t,isMobile:r=!1,onFileOpen:s,onProjectSelect:a,onProjectsRefresh:o}){const[d,i]=n.useState("changes"),[g,h]=n.useState(!0),[m,f]=n.useState(!1),[v,y]=n.useState(null),{gitStatus:p,gitDiff:j,isLoading:u,isLoadingCommits:N,currentBranch:x,branches:T,localBranches:I,remoteBranches:B,recentCommits:W,commitDiffs:w,remoteStatus:$,isCreatingBranch:k,isFetching:L,isPulling:S,isPushing:R,isPublishing:G,isCreatingInitialCommit:J,isInitializingRepository:Y,operationError:U,clearOperationError:C,refreshAll:A,switchBranch:H,createBranch:Q,deleteBranch:se,handleFetch:ie,handlePull:ne,handlePush:le,handlePublish:D,discardChanges:K,deleteUntrackedFile:z,stageFiles:Ce,unstageFiles:X,fetchCommitDiff:ge,commitChanges:be,createInitialCommit:E,initRepository:q,openFile:_}=_t({selectedProject:t,activeView:d,onFileOpen:s}),{isRevertingLocalCommit:ke,revertLatestLocalCommit:Se}=zt({projectId:t?.projectId??null,onSuccess:A}),$e=n.useCallback(async(de=!1)=>{if(!v)return;const me=v;y(null);try{await(de?me.alternateConfirmation?.onConfirm??me.onConfirm:me.onConfirm)()}catch(ye){console.error("Error executing confirmation action:",ye)}},[v]),Ee=rt(p),ce=!!p?.notGitRepository;return t?e.jsxs("div",{className:"flex h-full flex-col bg-background",children:[!ce&&e.jsx(mr,{isMobile:r,currentBranch:x,branches:T,remoteStatus:$,isLoading:u,isCreatingBranch:k,isFetching:L,isPulling:S,isPushing:R,isPublishing:G,isRevertingLocalCommit:ke,operationError:U,onRefresh:A,onRevertLocalCommit:Se,onSwitchBranch:H,onCreateBranch:Q,onFetch:ie,onPull:ne,onPush:le,onPublish:D,onClearError:C,onRequestConfirmation:y}),p?.error?e.jsx(ur,{error:p.error,details:p.details,canInitRepository:ce,isInitializingRepository:Y,initError:ce?U:null,onInitRepository:()=>{C(),q()}}):e.jsxs(e.Fragment,{children:[e.jsx(xr,{activeView:d,isHidden:m,changeCount:Ee,onChange:i}),d==="changes"&&e.jsx(Qt,{isMobile:r,projectPath:t.fullPath,gitStatus:p,gitDiff:j,isLoading:u,wrapText:g,isCreatingInitialCommit:J,onWrapTextChange:h,onCreateInitialCommit:E,onOpenFile:_,onDiscardFile:K,onDeleteFile:z,onStageFiles:Ce,onUnstageFiles:X,onCommitChanges:be,onRequestConfirmation:y,onExpandedFilesChange:f},t.fullPath),d==="history"&&e.jsx(er,{isMobile:r,isLoading:u||W.length===0&&N,recentCommits:W,commitDiffs:w,wrapText:g,onFetchCommitDiff:ge}),d==="worktrees"&&e.jsx(dr,{isMobile:r,selectedProject:t,localBranches:I,onProjectSelect:a,onProjectsRefresh:o},t.fullPath),d==="branches"&&e.jsx(tr,{isMobile:r,isLoading:u,currentBranch:x,localBranches:I,remoteBranches:B,remoteStatus:$,isCreatingBranch:k,onSwitchBranch:H,onCreateBranch:Q,onDeleteBranch:se,onRequestConfirmation:y})]}),e.jsx(fr,{action:v,onCancel:()=>y(null),onConfirm:de=>{$e(de)}})]}):e.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:e.jsx("p",{children:"Select a project to view source control"})})}export{br as default};
@@ -1 +0,0 @@
1
- import{u as j,a as F,b as y,j as I}from"./index-B_FDMWar.js";import{r as c}from"./vendor-react-whEHfigN.js";function g(e,r,t){return{theme:e?"dark":"light",project:r?{name:r.projectId,path:r.fullPath||r.path||""}:null,session:t?{id:t.id,title:t.title||t.name||t.id}:null}}function P({pluginName:e,selectedProject:r,selectedSession:t}){const a=c.useRef(null),{isDarkMode:p}=j(),{plugins:C}=F(),x=c.useRef(g(p,r,t)),R=c.useRef(new Set),i=c.useRef(null),s=C.find(n=>n.name===e);return c.useEffect(()=>{const n=g(p,r,t);x.current=n;for(const u of R.current)try{u(n)}catch{}},[p,r,t]),c.useEffect(()=>{if(!a.current||!s?.enabled)return;let n=!0;const u=a.current,U=s?.entry??"index.js",d=R.current;return(async()=>{try{const l=`/api/plugins/${encodeURIComponent(e)}/assets/${encodeURIComponent(U)}`,o=await y(l);if(!o.ok)throw new Error(`Failed to fetch plugin (HTTP ${o.status})`);const v=await o.text(),E=new Blob([v],{type:"application/javascript"}),b=URL.createObjectURL(E),h=await import(b).finally(()=>URL.revokeObjectURL(b));if(!n||!a.current)return;i.current=h;const $={get context(){return x.current},onContextChange(f){return d.add(f),()=>d.delete(f)},async rpc(f,k,w){const T=String(k).replace(/^\//,""),m=await y(`/api/plugins/${encodeURIComponent(e)}/rpc/${T}`,{method:f||"GET",...w!==void 0?{body:JSON.stringify(w)}:{}});if(!m.ok)throw new Error(`RPC error ${m.status}`);return m.json()}};if(await h.mount?.(u,$),!n){try{h.unmount?.(u)}catch{}i.current=null;return}}catch(l){if(!n)return;if(console.error(`[Plugin:${e}] Failed to load:`,l),a.current){const o=document.createElement("div");o.style.cssText="padding:16px;font-size:13px;color:#dc2626",o.textContent=`Plugin failed to load: ${String(l)}`,a.current.replaceChildren(o)}}})(),()=>{n=!1;try{i.current?.unmount?.(u)}catch{}d.clear(),i.current=null}},[e,s?.entry,s?.enabled]),I.jsx("div",{ref:a,className:"h-full w-full overflow-auto"})}export{P as default};