tower-studio 0.2.24 → 0.2.26

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 (242) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  5. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -1
  12. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +29 -29
  13. package/.next/standalone/.next/server/app/_not-found/page.js +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  15. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/.next/server/app/api/adapters/test/route.js +1 -1
  17. package/.next/standalone/.next/server/app/api/adapters/test/route.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/api/files/assets/[projectId]/[filename]/route.js +1 -1
  20. package/.next/standalone/.next/server/app/api/files/assets/[projectId]/[filename]/route.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js +1 -1
  23. package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/internal/assets/reveal/route.js +1 -1
  25. package/.next/standalone/.next/server/app/api/internal/assets/reveal/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js +1 -1
  27. package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js +1 -1
  29. package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/internal/assistant/route.js +1 -1
  31. package/.next/standalone/.next/server/app/api/internal/assistant/route.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/api/internal/backup/import/route.js +1 -1
  33. package/.next/standalone/.next/server/app/api/internal/backup/import/route.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/api/internal/cache/[...segments]/route.js +1 -1
  35. package/.next/standalone/.next/server/app/api/internal/cache/[...segments]/route.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/api/internal/hooks/session/route.js +1 -1
  37. package/.next/standalone/.next/server/app/api/internal/hooks/session/route.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/api/internal/hooks/stop/route.js +1 -1
  39. package/.next/standalone/.next/server/app/api/internal/hooks/stop/route.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js +1 -1
  41. package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js +1 -1
  43. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js +1 -1
  45. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js.nft.json +1 -1
  46. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff-patch/route.js +1 -1
  47. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff-patch/route.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js +1 -1
  49. package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js.nft.json +1 -1
  50. package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
  51. package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +65 -65
  52. package/.next/standalone/.next/server/app/missions/page.js +1 -1
  53. package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
  54. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  55. package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
  56. package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +29 -29
  57. package/.next/standalone/.next/server/app/onboarding/page.js +1 -1
  58. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  59. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  60. package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +1 -1
  61. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +29 -29
  62. package/.next/standalone/.next/server/app/page.js +1 -1
  63. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  64. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  65. package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
  66. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +47 -47
  67. package/.next/standalone/.next/server/app/settings/page.js +1 -1
  68. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  69. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  70. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
  71. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +88 -88
  72. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js +1 -1
  73. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  74. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  75. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
  76. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +82 -82
  77. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js +1 -1
  78. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  79. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  80. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
  81. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +65 -65
  82. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js +1 -1
  83. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  84. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  85. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
  86. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +63 -63
  87. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +1 -1
  88. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  89. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  90. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
  91. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +29 -29
  92. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js +1 -1
  93. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  94. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  95. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +1 -1
  96. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +70 -70
  97. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js +1 -1
  98. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
  99. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
  100. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +2 -2
  101. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +80 -80
  102. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +1 -1
  103. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  104. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  105. package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
  106. package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +47 -47
  107. package/.next/standalone/.next/server/app/workspaces/page.js +1 -1
  108. package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
  109. package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  110. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js +1 -1
  111. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0hrprmi.js +2 -2
  112. package/.next/standalone/.next/server/chunks/[root-of-the-server]__08xus7y._.js +3 -0
  113. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0j-4yc7._.js → [root-of-the-server]__09sw_a5._.js} +2 -2
  114. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_3ce_3._.js +3 -0
  115. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0dy~osn._.js +3 -0
  116. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0l1-djp._.js +3 -0
  117. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0nggjno._.js +4 -0
  118. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0oe.86i._.js +4 -0
  119. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q8.khe._.js +3 -0
  120. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qif839._.js +4 -0
  121. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qn.178._.js +4 -0
  122. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0o3iihg._.js → [root-of-the-server]__0r17py1._.js} +2 -2
  123. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__024m_g.._.js → [root-of-the-server]__0rpck4h._.js} +2 -2
  124. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0hc9vir._.js → [root-of-the-server]__0ul.hbv._.js} +2 -2
  125. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0j8xb6s._.js → [root-of-the-server]__0~au8v.._.js} +2 -2
  126. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0r9mscb._.js → [root-of-the-server]__11c_is3._.js} +2 -2
  127. package/.next/standalone/.next/server/chunks/[root-of-the-server]__11j15wy._.js +4 -0
  128. package/.next/standalone/.next/server/chunks/[root-of-the-server]__12brxjg._.js +3 -0
  129. package/.next/standalone/.next/server/chunks/src_0bkvm8c._.js +1 -1
  130. package/.next/standalone/.next/server/chunks/src_lib_ai_0xx6y51._.js +1 -1
  131. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  132. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02-6df-._.js +3 -3
  133. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0nkk5tw._.js → [root-of-the-server]__03_nkjv._.js} +1 -1
  134. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__03e009u._.js +3 -3
  135. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__069pl~f._.js +3 -0
  136. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e_-mj-._.js +3 -3
  137. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0fzkdjl._.js +3 -3
  138. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0f~m-8x._.js → [root-of-the-server]__0ihwpkg._.js} +2 -2
  139. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jymb~t._.js +1 -1
  140. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pu-v0l._.js +3 -3
  141. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0um1ugs._.js +3 -3
  142. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0s5c_.m._.js → [root-of-the-server]__0z2guda._.js} +2 -2
  143. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z7je5_._.js +1 -1
  144. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__134_xv.._.js +1 -1
  145. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0.m3hdp._.js → [root-of-the-server]__1359.ry._.js} +2 -2
  146. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13vgkq5._.js +3 -3
  147. package/.next/standalone/.next/server/chunks/ssr/{_0fptgd5._.js → _0-~u69o._.js} +2 -2
  148. package/.next/standalone/.next/server/chunks/ssr/_0.-seei._.js +3 -0
  149. package/.next/standalone/.next/server/chunks/ssr/{_0bpuw.g._.js → _01~be~r._.js} +2 -2
  150. package/.next/standalone/.next/server/chunks/ssr/{_0~eek5n._.js → _04~5wua._.js} +2 -2
  151. package/.next/standalone/.next/server/chunks/ssr/{_10h3uho._.js → _059b1iq._.js} +2 -2
  152. package/.next/standalone/.next/server/chunks/ssr/_070t_mh._.js +2 -2
  153. package/.next/standalone/.next/server/chunks/ssr/{_02yw.tu._.js → _07zn10z._.js} +3 -3
  154. package/.next/standalone/.next/server/chunks/ssr/_08z-g~5._.js +3 -3
  155. package/.next/standalone/.next/server/chunks/ssr/_09i46mk._.js +3 -0
  156. package/.next/standalone/.next/server/chunks/ssr/_0_vjay8._.js +3 -3
  157. package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
  158. package/.next/standalone/.next/server/chunks/ssr/{_10xi4vt._.js → _0d.xo.l._.js} +2 -2
  159. package/.next/standalone/.next/server/chunks/ssr/_0jg.s-g._.js +1 -1
  160. package/.next/standalone/.next/server/chunks/ssr/{_0wism~u._.js → _0lfhglc._.js} +2 -2
  161. package/.next/standalone/.next/server/chunks/ssr/{_0913rlo._.js → _0os2jhl._.js} +2 -2
  162. package/.next/standalone/.next/server/chunks/ssr/{_0v7fx~g._.js → _0qmgbyt._.js} +2 -2
  163. package/.next/standalone/.next/server/chunks/ssr/_0r6gweb._.js +3 -3
  164. package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
  165. package/.next/standalone/.next/server/chunks/ssr/_0rt8jf_._.js +3 -3
  166. package/.next/standalone/.next/server/chunks/ssr/{_08gfd3m._.js → _0t3ckzo._.js} +3 -3
  167. package/.next/standalone/.next/server/chunks/ssr/_0ueyys5._.js +1 -1
  168. package/.next/standalone/.next/server/chunks/ssr/_0uuzh5m._.js +3 -3
  169. package/.next/standalone/.next/server/chunks/ssr/{_12w8uug._.js → _0zlbg~.._.js} +3 -3
  170. package/.next/standalone/.next/server/chunks/ssr/_0~aon4t._.js +3 -3
  171. package/.next/standalone/.next/server/chunks/ssr/src_075s.rk._.js +1 -1
  172. package/.next/standalone/.next/server/chunks/ssr/src_0djxlqx._.js +1 -1
  173. package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +1 -1
  174. package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
  175. package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
  176. package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
  177. package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
  178. package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
  179. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
  180. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
  181. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
  182. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  183. package/.next/standalone/.next/server/pages/500.html +1 -1
  184. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  185. package/.next/standalone/.next/server/server-reference-manifest.json +269 -269
  186. package/.next/standalone/.next/static/chunks/0-~1tfpfi66tt.js +2 -0
  187. package/.next/standalone/.next/static/chunks/0.f~eyd3jo5q9.js +1 -0
  188. package/.next/standalone/.next/static/chunks/{0.-zxtsxco8bd.js → 0.gbujgnms18e.js} +1 -1
  189. package/.next/standalone/.next/static/chunks/00mhzi2ol~xk-.js +1 -0
  190. package/.next/standalone/.next/static/chunks/{0~ld2l-heikt8.js → 010vqaoulg3ga.js} +1 -1
  191. package/.next/standalone/.next/static/chunks/018ze~5gezc3x.js +1 -0
  192. package/.next/standalone/.next/static/chunks/{0cek-x7mfk~on.js → 05wa29x.o3lj~.js} +1 -1
  193. package/.next/standalone/.next/static/chunks/06ei~c0zyf703.js +1 -0
  194. package/.next/standalone/.next/static/chunks/{0fbzsla5wwy9i.js → 0_jfml.3h1pg0.js} +1 -1
  195. package/.next/standalone/.next/static/chunks/0a9gl29cb30mk.js +1 -0
  196. package/.next/standalone/.next/static/chunks/{0m8.bvy~pci0u.js → 0acpmdkledyrn.js} +2 -2
  197. package/.next/standalone/.next/static/chunks/0ar5okzickbt2.js +1 -0
  198. package/.next/standalone/.next/static/chunks/{0utxs7_p1_s1k.js → 0d.a7uremospf.js} +1 -1
  199. package/.next/standalone/.next/static/chunks/{0_8kuv8c83uzb.js → 0er4f-pem1v4b.js} +1 -1
  200. package/.next/standalone/.next/static/chunks/{0q.oq9hy_v7uw.js → 0f.bggise4mxx.js} +1 -1
  201. package/.next/standalone/.next/static/chunks/0fjb3q23ay68k.js +5 -0
  202. package/.next/standalone/.next/static/chunks/{0dahitam46wjs.js → 0fx7van_kt_59.js} +1 -1
  203. package/.next/standalone/.next/static/chunks/0gr0-sewikazc.js +1 -0
  204. package/.next/standalone/.next/static/chunks/{00si9pyuu.huw.js → 0jdyczcgqgj0b.js} +1 -1
  205. package/.next/standalone/.next/static/chunks/{0zg1u7zkfyika.js → 0pc6e~rekt1qc.js} +1 -1
  206. package/.next/standalone/.next/static/chunks/{13aiv_bq~wolv.js → 0slsrmal~578k.js} +2 -2
  207. package/.next/standalone/.next/static/chunks/0vhyuvkq8.ebz.js +1 -0
  208. package/.next/standalone/.next/static/chunks/0w9_.z5nzj0lm.js +1 -0
  209. package/.next/standalone/.next/static/chunks/0wlv48-ug75b6.js +1 -0
  210. package/.next/standalone/.next/static/chunks/{0ynv~nu57u5.n.js → 13pdj4ms~jds_.js} +2 -2
  211. package/.next/standalone/.next/static/chunks/15_.l.-~mxr1v.js +1 -0
  212. package/.next/standalone/package.json +1 -1
  213. package/package.json +1 -1
  214. package/.next/standalone/.next/server/chunks/[root-of-the-server]__03j20vp._.js +0 -4
  215. package/.next/standalone/.next/server/chunks/[root-of-the-server]__05se6yk._.js +0 -4
  216. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06m1r8x._.js +0 -4
  217. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g788b3._.js +0 -4
  218. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qdvear._.js +0 -3
  219. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0umocfj._.js +0 -3
  220. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wuzc5o._.js +0 -4
  221. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0z-k6vg._.js +0 -3
  222. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~rm9q.._.js +0 -3
  223. package/.next/standalone/.next/server/chunks/[root-of-the-server]__12c9noi._.js +0 -3
  224. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09zg1z2._.js +0 -3
  225. package/.next/standalone/.next/server/chunks/ssr/_0_87rda._.js +0 -3
  226. package/.next/standalone/.next/server/chunks/ssr/_0bxl8ws._.js +0 -3
  227. package/.next/standalone/.next/static/chunks/04pw2khof~cip.js +0 -1
  228. package/.next/standalone/.next/static/chunks/05p8qmf14~0_n.js +0 -1
  229. package/.next/standalone/.next/static/chunks/07qaxp_r1s5c6.js +0 -1
  230. package/.next/standalone/.next/static/chunks/0cw.x2y2d~tq9.js +0 -1
  231. package/.next/standalone/.next/static/chunks/0d0m_9h0x6v-d.js +0 -1
  232. package/.next/standalone/.next/static/chunks/0dn2uby3.r~i8.js +0 -2
  233. package/.next/standalone/.next/static/chunks/0hfbmmcd4fqty.js +0 -1
  234. package/.next/standalone/.next/static/chunks/0j5-kx25u4y7o.js +0 -1
  235. package/.next/standalone/.next/static/chunks/0t0dn.254zxs-.js +0 -1
  236. package/.next/standalone/.next/static/chunks/0t9~b7j139x~h.js +0 -1
  237. package/.next/standalone/.next/static/chunks/0vj_1kxy3oc3z.js +0 -5
  238. package/.next/standalone/.next/static/chunks/0~r18o267lsua.js +0 -1
  239. package/.next/standalone/.next/static/chunks/14hyegs.jm13b.js +0 -1
  240. /package/.next/standalone/.next/static/{NM0zzDCa9moGRI5bLTuel → Wz6kaZQH2Kg2pF2j2ZFbe}/_buildManifest.js +0 -0
  241. /package/.next/standalone/.next/static/{NM0zzDCa9moGRI5bLTuel → Wz6kaZQH2Kg2pF2j2ZFbe}/_clientMiddlewareManifest.js +0 -0
  242. /package/.next/standalone/.next/static/{NM0zzDCa9moGRI5bLTuel → Wz6kaZQH2Kg2pF2j2ZFbe}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[473935,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(553798),e=a.i(711796);let f=(0,e.default)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]),g=(0,e.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);var h=a.i(283857),i=a.i(951192);function j({totalTasks:a,runningTasks:c}){let{t:d}=(0,i.useI18n)();return(0,b.jsxs)("div",{className:"grid grid-cols-3 gap-3 px-6 py-4",children:[(0,b.jsx)("div",{className:"rounded-xl border border-border bg-card p-4",children:(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:"rounded-lg bg-sky-500/10 p-2 ring-1 ring-sky-500/20",children:(0,b.jsx)(f,{className:"h-4 w-4 text-sky-400"})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:d("board.overview")}),(0,b.jsx)("p",{className:"text-2xl font-bold font-mono tracking-tight text-foreground",children:a})]})]})}),(0,b.jsx)("div",{className:"rounded-xl border border-border bg-card p-4",children:(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:"rounded-lg bg-primary/10 p-2 ring-1 ring-primary/20",children:(0,b.jsx)(g,{className:"h-4 w-4 text-primary"})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:d("board.running")}),(0,b.jsx)("p",{className:"text-2xl font-bold font-mono tracking-tight text-foreground",children:c})]})]})}),(0,b.jsx)("div",{className:"rounded-xl border border-border bg-card p-4",children:(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:"rounded-lg bg-emerald-500/10 p-2 ring-1 ring-emerald-500/20",children:(0,b.jsx)(h.Lightbulb,{className:"h-4 w-4 text-emerald-400"})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:d("board.tip")}),(0,b.jsx)("p",{className:"text-xs font-medium text-foreground/80",children:d("board.tipText")})]})]})})]})}var k=a.i(634910),l=a.i(774881),m=a.i(573242),n=a.i(577565),o=a.i(699570),p=a.i(866718),q=a.i(580701);function r({searchQuery:a,onSearchChange:c,versions:d=[],versionFilter:e="all",onVersionFilterChange:f,versionsHref:g,onCreateTask:h}){let j,{t:s}=(0,i.useI18n)(),t="all"===e?s("board.allVersions"):"backlog"===e?s("board.backlogFilter"):(j=d.find(a=>a.id===e))?`${j.number} ${j.name}`:s("board.allVersions");return(0,b.jsxs)("div",{className:"flex items-center gap-2 px-6 py-2",children:[f&&(0,b.jsxs)(q.Select,{value:e,onValueChange:a=>f(a||"all"),children:[(0,b.jsxs)(q.SelectTrigger,{className:"h-8 w-44 shrink-0 gap-1.5 text-xs text-muted-foreground",children:[(0,b.jsx)(n.GitBranch,{className:"h-3.5 w-3.5 shrink-0"}),(0,b.jsx)("span",{className:"truncate",children:t})]}),(0,b.jsxs)(q.SelectContent,{children:[(0,b.jsx)(q.SelectItem,{value:"all",children:s("board.allVersions")}),(0,b.jsx)(q.SelectItem,{value:"backlog",children:s("board.backlogFilter")}),d.map(a=>(0,b.jsxs)(q.SelectItem,{value:a.id,children:[(0,b.jsx)("span",{className:"font-mono",children:a.number})," ",a.name]},a.id))]})]}),(0,b.jsxs)("div",{className:"relative flex-1 max-w-xs",children:[(0,b.jsx)(m.Search,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,b.jsx)(p.Input,{type:"text",value:a,onChange:a=>c(a.target.value),placeholder:s("board.searchPlaceholder"),className:"pl-8 pr-3 text-xs"})]}),(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[g&&(0,b.jsx)(k.default,{href:g,children:(0,b.jsxs)(o.Button,{variant:"outline",className:"h-8 gap-1.5 text-xs text-muted-foreground",children:[(0,b.jsx)(n.GitBranch,{className:"h-3.5 w-3.5"}),s("version.timeline")]})}),(0,b.jsxs)(o.Button,{"data-tour":"create-task",variant:"outline",className:"gap-1.5 border-border text-xs text-muted-foreground hover:border-primary/30 hover:text-primary",onClick:h,children:[(0,b.jsx)(l.Plus,{className:"h-3.5 w-3.5"}),s("board.newTask")]})]})]})}var s=a.i(986099),t=a.i(668116),u=a.i(521007);function v({x:a,y:e,taskId:f,currentStatus:g,hasExecutions:h,workspaceId:j,onClose:k,onStatusChange:l,onLaunch:m}){let{t:n}=(0,i.useI18n)(),o=(0,d.useRouter)(),p=(0,c.useRef)(null);(0,c.useEffect)(()=>{let a=a=>{p.current&&!p.current.contains(a.target)&&k()},b=a=>{"Escape"===a.key&&k()};return document.addEventListener("mousedown",a),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",b)}},[k]);let q="flex items-center px-3 py-1.5 text-xs cursor-pointer hover:bg-accent rounded-sm w-full text-left",r=(0,b.jsxs)("div",{ref:p,style:{position:"fixed",top:e,left:a,zIndex:9999},className:"bg-popover border border-border rounded-md shadow-md py-1 min-w-[180px]",children:[(0,b.jsx)("div",{className:"px-3 py-1 text-[10px] text-muted-foreground uppercase tracking-wider",children:n("board.contextMenu.changeStatus")}),u.BOARD_COLUMNS.map(a=>(0,b.jsxs)("button",{type:"button",className:q,onClick:()=>{l(f,a.id),k()},children:[g===a.id?(0,b.jsx)(t.Check,{className:"h-3 w-3 mr-2 flex-shrink-0"}):(0,b.jsx)("span",{className:"w-5 flex-shrink-0"}),a.label]},a.id)),(0,b.jsx)("hr",{className:"my-1 border-border"}),(0,b.jsx)("button",{type:"button",className:`${q} ${h?"opacity-50 cursor-not-allowed":""}`,disabled:h,onClick:()=>{h||(m(f),k())},children:n("board.contextMenu.launch")}),"DONE"!==g&&"CANCELLED"!==g&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("hr",{className:"my-1 border-border"}),(0,b.jsx)("button",{type:"button",className:q,onClick:()=>{o.push(`/workspaces/${j}/tasks/${f}`),k()},children:n("board.contextMenu.goToDetail")})]})]});return"u"<typeof document?null:(0,s.createPortal)(r,document.body)}var w=a.i(643228),x=a.i(859103);let y=(0,e.default)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);var z=a.i(514126),A=a.i(336771),B=a.i(690251),C=a.i(975231);let D=(0,e.default)("pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);var E=a.i(786304),F=a.i(785259),G=a.i(335732),H=a.i(551578);function I({task:a,onClick:c,onEdit:d,onDelete:e,onTogglePin:f,onContextMenu:g}){let{t:h}=(0,i.useI18n)(),{attributes:j,listeners:k,setNodeRef:l,transform:m,transition:p,isDragging:q}=(0,x.useSortable)({id:a.id,data:{type:"task",task:a}}),r={transform:z.CSS.Transform.toString(m),transition:p,opacity:q?.4:1},s=u.PRIORITY_CONFIG[a.priority],t=!!a.baseBranch;return(0,b.jsxs)("div",{ref:l,style:r,...j,...k,className:"group cursor-grab rounded-lg border border-border bg-card p-3 transition-all hover:border-primary/20 hover:bg-accent/50 active:cursor-grabbing",onClick:c,onContextMenu:b=>{b.preventDefault(),b.stopPropagation(),g?.(a,b.clientX,b.clientY)},"data-testid":"task-card",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between",children:[(0,b.jsx)("h4",{className:"text-sm font-medium text-foreground",children:a.title}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0",children:[(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-xs",className:`transition-all ${a.pinned?"text-primary opacity-100":"text-muted-foreground opacity-0 group-hover:opacity-100"}`,onClick:b=>{b.stopPropagation(),f?.(a.id)},"aria-label":h(a.pinned?"board.unpin":"board.pin"),children:(0,b.jsx)(D,{className:`h-3.5 w-3.5 ${a.pinned?"-rotate-45":""}`})}),(0,b.jsxs)(G.DropdownMenu,{children:[(0,b.jsx)(G.DropdownMenuTrigger,{render:(0,b.jsx)("button",{className:"rounded-md p-0.5 text-muted-foreground opacity-0 transition-all hover:bg-background hover:text-foreground group-hover:opacity-100",onClick:a=>a.stopPropagation()}),children:(0,b.jsx)(A.MoreHorizontal,{className:"h-4 w-4"})}),(0,b.jsxs)(G.DropdownMenuContent,{align:"end",children:[(0,b.jsxs)(G.DropdownMenuItem,{onClick:b=>{b.stopPropagation(),d?.(a)},children:[(0,b.jsx)(B.Pencil,{className:"mr-2 h-3.5 w-3.5"}),h("common.edit")]}),(0,b.jsxs)(G.DropdownMenuItem,{className:"text-rose-400",onClick:b=>{b.stopPropagation(),e?.(a.id)},children:[(0,b.jsx)(C.Trash2,{className:"mr-2 h-3.5 w-3.5"}),h("common.delete")]})]})]})]})]}),a.description&&(0,b.jsx)("p",{className:"mt-1.5 line-clamp-3 text-xs leading-relaxed text-muted-foreground",children:a.description}),(0,b.jsxs)("div",{className:"mt-2.5 flex flex-wrap items-center gap-1.5",children:[(0,b.jsx)(E.Badge,{variant:"secondary",className:`text-[10px] font-semibold ${s.color}`,children:s.label}),a.labels?.map(a=>(0,b.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:a.label.color+"20",color:a.label.color},children:a.label.name},a.label.id)),(t||a.version)&&(0,b.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[t&&(0,b.jsxs)(F.Tooltip,{disableHoverablePopup:!0,children:[(0,b.jsx)(F.TooltipTrigger,{render:(0,b.jsx)("span",{className:"inline-flex cursor-default items-center rounded-md border border-border bg-muted px-1 py-0.5 text-muted-foreground",onPointerDown:a=>a.stopPropagation(),children:(0,b.jsx)(n.GitBranch,{className:"h-2.5 w-2.5 shrink-0"})})}),(0,b.jsx)(F.TooltipContent,{side:"top",children:h("board.card.worktree",{branch:a.baseBranch??""})})]}),a.version&&(0,b.jsxs)(F.Tooltip,{disableHoverablePopup:!0,children:[(0,b.jsx)(F.TooltipTrigger,{render:(0,b.jsx)("span",{className:"cursor-default",onPointerDown:a=>a.stopPropagation(),children:(0,b.jsx)(H.TaskVersionTag,{number:a.version.number,title:""})})}),(0,b.jsx)(F.TooltipContent,{side:"top",children:h("board.card.version",{number:a.version.number,name:a.version.name})})]})]})]})]})}var J=a.i(814574),K=a.i(269876);function L({open:a,onOpenChange:c,columnLabel:d,columnColor:e,tasks:f,onTaskClick:g}){let{t:h}=(0,i.useI18n)();return(0,b.jsx)(J.Dialog,{open:a,onOpenChange:c,children:(0,b.jsxs)(J.DialogContent,{className:"sm:max-w-6xl max-h-[80vh]",children:[(0,b.jsx)(J.DialogHeader,{children:(0,b.jsxs)(J.DialogTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:`h-2.5 w-2.5 rounded-full ${e}`}),(0,b.jsx)("span",{children:d}),(0,b.jsx)("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-xs font-mono font-medium text-muted-foreground",children:f.length})]})}),(0,b.jsx)(K.ScrollArea,{className:"max-h-[680px]",children:(0,b.jsxs)("div",{className:"grid grid-cols-4 gap-3 pr-3",children:[f.map(a=>{let d=u.PRIORITY_CONFIG[a.priority];return(0,b.jsxs)("div",{className:"cursor-pointer rounded-lg border border-border bg-card p-3 transition-all hover:border-primary/20 hover:bg-accent/50",onClick:()=>{g?.(a),c(!1)},children:[(0,b.jsx)("h4",{className:"text-sm font-medium text-foreground line-clamp-2",children:a.title}),a.description&&(0,b.jsx)("p",{className:"mt-1.5 line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:a.description}),(0,b.jsxs)("div",{className:"mt-2 flex items-center gap-1.5 flex-wrap",children:[(0,b.jsx)(E.Badge,{variant:"secondary",className:`text-[10px] font-semibold ${d.color}`,children:d.label}),a.labels?.map(a=>(0,b.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:a.label.color+"20",color:a.label.color},children:a.label.name},a.label.id))]})]},a.id)}),0===f.length&&(0,b.jsx)("div",{className:"col-span-4 py-8 text-center text-sm text-muted-foreground",children:h("board.noTasks")})]})})]})})}function M({id:a,label:d,color:e,tasks:f,onTaskClick:g,onEditTask:h,onAddTask:j,onDeleteTask:k,onTogglePin:m,onContextMenu:n}){let{setNodeRef:p,isOver:q}=(0,w.useDroppable)({id:a}),[r,s]=(0,c.useState)(!1),{t}=(0,i.useI18n)();return(0,b.jsxs)("div",{className:`flex w-0 min-w-[220px] flex-1 flex-col min-h-0 border-r border-border/50 last:border-r-0 transition-colors ${q?"bg-primary/[0.06]":""}`,children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 border-b border-border/30",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:`h-2 w-2 rounded-full ${e}`}),(0,b.jsx)("span",{className:"text-xs font-semibold tracking-wide text-secondary-foreground",children:d}),(0,b.jsx)("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] font-mono font-medium text-muted-foreground",children:f.length})]}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-xs",onClick:()=>s(!0),className:"text-muted-foreground","aria-label":t("board.viewAll"),children:(0,b.jsx)(y,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-xs",onClick:j,className:"text-muted-foreground","aria-label":"add",children:(0,b.jsx)(l.Plus,{className:"h-3.5 w-3.5"})})]})]}),(0,b.jsx)(L,{open:r,onOpenChange:s,columnLabel:d,columnColor:e,tasks:f,onTaskClick:g}),(0,b.jsx)(K.ScrollArea,{className:"flex-1 min-h-0",children:(0,b.jsx)("div",{ref:p,className:"flex flex-col gap-2 p-2",children:(0,b.jsx)(x.SortableContext,{items:f.map(a=>a.id),strategy:x.verticalListSortingStrategy,children:f.map(a=>(0,b.jsx)(I,{task:a,onClick:()=>g?.(a),onEdit:h,onDelete:k,onTogglePin:m,onContextMenu:n},a.id))})})})]})}function N({initialTasks:a,onTaskMove:d,onTaskClick:e,onEditTask:f,onAddTask:g,onDeleteTask:h,onTogglePin:i,onContextMenuStatusChange:j,onContextMenuLaunch:k,workspaceId:l}){let[m,n]=(0,c.useState)(a),[o,p]=(0,c.useState)(null),[q,r]=(0,c.useState)(null);(0,c.useEffect)(()=>{n(a)},[a]);let s=(0,w.useSensors)((0,w.useSensor)(w.PointerSensor,{activationConstraint:{distance:8}})),t=(0,c.useCallback)((a,b,c)=>{r({task:a,x:b,y:c})},[]),x=(0,c.useCallback)(a=>{let b=m.find(b=>b.id===a.active.id);b&&p(b)},[m]),y=(0,c.useCallback)(a=>{let b,{active:c,over:e}=a;if(p(null),!e)return;let f=c.id,g=e.id;if(u.BOARD_COLUMNS.some(a=>a.id===g))b=g;else{let a=m.find(a=>a.id===g);b=a?.status}b&&(n(a=>a.map(a=>a.id===f?{...a,status:b}:a)),d?.(f,b))},[m,d]);return(0,b.jsxs)(w.DndContext,{id:"kanban-board",sensors:s,collisionDetection:w.closestCorners,onDragStart:x,onDragEnd:y,children:[(0,b.jsx)("div",{className:"mx-2 flex h-full overflow-x-auto rounded-xl border border-border bg-card/50",children:u.BOARD_COLUMNS.map(a=>(0,b.jsx)(M,{id:a.id,label:a.label,color:a.color,tasks:m.filter(b=>b.status===a.id),onTaskClick:e,onEditTask:f,onAddTask:()=>g?.(a.id),onDeleteTask:h,onTogglePin:i,onContextMenu:t},a.id))}),(0,b.jsx)(w.DragOverlay,{children:o?(0,b.jsx)("div",{className:"rotate-3 scale-105",children:(0,b.jsx)(I,{task:o})}):null}),q&&(0,b.jsx)(v,{x:q.x,y:q.y,taskId:q.task.id,currentStatus:q.task.status,hasExecutions:(q.task._count?.executions??0)>0,workspaceId:l??"",onClose:()=>r(null),onStatusChange:(a,b)=>{j?.(a,b),r(null)},onLaunch:a=>{k?.(a),r(null)}})]})}var O=a.i(445798),P=a.i(442620),Q=a.i(10390),R=a.i(350739),S=a.i(347165);let T=(0,e.default)("git-commit-vertical",[["path",{d:"M12 3v6",key:"1holv5"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M12 15v6",key:"a9ows0"}]]);var U=a.i(616335),V=a.i(704494),W=a.i(394259),X=a.i(625892),Y=a.i(939859),Z=a.i(648512),$=a.i(22761),_=a.i(429246),aa=a.i(780410);let ab=(0,aa.createServerReference)("60109c81608371f4128d52892c70461efd1edf675f",aa.callServer,void 0,aa.findSourceMapURL,"updateProject");var ac=a.i(967433);let ad=(0,aa.createServerReference)("40b7092569c3783a0f354210188d656647e3f23966",aa.callServer,void 0,aa.findSourceMapURL,"deleteProject"),ae=(0,aa.createServerReference)("407d413dd4eb90b79b5a5de7b404a6ac8d7304515e",aa.callServer,void 0,aa.findSourceMapURL,"getRecentLocalProjects"),af=(0,aa.createServerReference)("407fb617cf3558aaef98fa415db2ac3c296712f4d2",aa.callServer,void 0,aa.findSourceMapURL,"getOrCreateTowerTaskId");var ag=a.i(137175),ah=a.i(260811),ai=a.i(804596),aj=a.i(976282),ak=a.i(952313),al=a.i(43775),am=a.i(487410);function an({commits:a}){let{t:d}=(0,i.useI18n)(),[e,f]=(0,c.useState)(!1);return 0===a.length?null:(0,b.jsxs)("div",{children:[(0,b.jsxs)("button",{onClick:()=>f(!e),className:"flex w-full items-center justify-between py-1",children:[(0,b.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:d("git.commitLog")}),e?(0,b.jsx)(P.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,b.jsx)(Q.ChevronRight,{className:"h-3 w-3 text-muted-foreground"})]}),e&&(0,b.jsx)("div",{className:"mt-1.5 space-y-0.5 max-h-64 overflow-y-auto",children:a.map(a=>(0,b.jsxs)("div",{className:"group flex items-start gap-2 rounded-md px-2 py-1.5 hover:bg-accent transition-colors",children:[(0,b.jsx)(T,{className:"h-3 w-3 shrink-0 text-muted-foreground mt-0.5"}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("p",{className:"text-xs text-foreground line-clamp-1",children:a.message}),(0,b.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,b.jsxs)("button",{onClick:()=>{navigator.clipboard.writeText(a.shortHash),ak.toast.success(`Copied ${a.shortHash}`)},className:"flex items-center gap-0.5 font-mono text-[10px] text-primary/70 hover:text-primary transition-colors",children:[a.shortHash,(0,b.jsx)($.Copy,{className:"h-2.5 w-2.5 opacity-0 group-hover:opacity-100 transition-opacity"})]}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:a.author}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(a){let b=Math.floor((Date.now()-new Date(a).getTime())/6e4);if(b<1)return"just now";if(b<60)return`${b}m`;let c=Math.floor(b/60);if(c<24)return`${c}h`;let d=Math.floor(c/24);return d<30?`${d}d`:`${Math.floor(d/30)}mo`}(a.date)})]})]})]},a.hash))})]})}var ao=a.i(607219),ap=a.i(324263),aq=a.i(7285);function ar({localPath:a,stashes:d,hasChanges:e,onRefresh:f}){let{t:g}=(0,i.useI18n)(),[h,j]=(0,c.useState)(!1),[k,l]=(0,c.useState)(!1),[m,n]=(0,c.useState)(""),[q,r]=(0,c.useState)(null),s=async()=>{l(!0);try{await (0,aq.gitAction)(a,"stash-save",{message:m}),n(""),ak.toast.success(g("git.stashSaved")),await f()}catch(a){ak.toast.error(a instanceof Error?a.message:String(a))}finally{l(!1)}},t=async b=>{r(b);try{await (0,aq.gitAction)(a,"stash-pop",{index:b}),ak.toast.success(g("git.stashApplied")),await f()}catch(a){ak.toast.error(a instanceof Error?a.message:String(a))}finally{r(null)}},u=async b=>{r(b);try{await (0,aq.gitAction)(a,"stash-drop",{index:b}),ak.toast.success(g("git.stashDropped")),await f()}catch(a){ak.toast.error(a instanceof Error?a.message:String(a))}finally{r(null)}};return e||0!==d.length?(0,b.jsxs)("div",{children:[(0,b.jsxs)("button",{onClick:()=>j(!h),className:"flex w-full items-center justify-between py-1",children:[(0,b.jsxs)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[g("git.stash")," ",d.length>0&&`(${d.length})`]}),h?(0,b.jsx)(P.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,b.jsx)(Q.ChevronRight,{className:"h-3 w-3 text-muted-foreground"})]}),h&&(0,b.jsxs)("div",{className:"mt-1.5 space-y-2",children:[e&&(0,b.jsxs)("div",{className:"flex gap-1.5",children:[(0,b.jsx)(p.Input,{value:m,onChange:a=>n(a.target.value),placeholder:g("git.stashMsgPlaceholder"),className:"h-7 text-xs flex-1",onKeyDown:a=>"Enter"===a.key&&s()}),(0,b.jsx)(o.Button,{variant:"outline",size:"icon-sm",onClick:s,disabled:k,className:"shrink-0",children:k?(0,b.jsx)(V.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(ao.Archive,{className:"h-3 w-3"})})]}),d.length>0&&(0,b.jsx)("div",{className:"space-y-0.5",children:d.map(a=>(0,b.jsxs)("div",{className:"group flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-accent transition-colors",children:[(0,b.jsx)(ao.Archive,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,b.jsx)("span",{className:"flex-1 min-w-0 truncate text-xs text-foreground",children:a.message||`stash@{${a.index}}`}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-xs",onClick:()=>t(a.index),disabled:q===a.index,className:"text-muted-foreground","aria-label":g("git.stashApply"),children:q===a.index?(0,b.jsx)(V.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(ap.ArrowUpFromLine,{className:"h-3 w-3"})}),(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-xs",onClick:()=>u(a.index),disabled:q===a.index,className:"text-rose-400","aria-label":g("git.stashDrop"),children:(0,b.jsx)(C.Trash2,{className:"h-3 w-3"})})]})]},a.index))})]})]}):null}var as=a.i(985716);function at({value:a,ariaLabel:d}){let{t:e}=(0,i.useI18n)(),[f,g]=(0,c.useState)(!1),h=async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(a);else{let b=document.createElement("textarea");b.value=a,document.body.appendChild(b),b.select(),document.execCommand("copy"),document.body.removeChild(b)}g(!0),ak.toast.success(e("common.copied")),setTimeout(()=>g(!1),1500)}catch{ak.toast.error(e("common.copyFailed"))}};return(0,b.jsxs)("div",{className:"flex items-center gap-1 rounded-md border border-border bg-muted/50 pl-3 pr-1 py-1.5",children:[(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",title:a,children:a}),(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{render:(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-xs",className:"shrink-0 text-muted-foreground","aria-label":d,onClick:h,children:f?(0,b.jsx)(t.Check,{className:"h-3 w-3 text-emerald-400"}):(0,b.jsx)($.Copy,{className:"h-3 w-3"})})}),(0,b.jsx)(F.TooltipContent,{children:f?e("common.copied"):e("common.copy")})]})]})}function au({project:a,workspaceId:e}){let{t:f,locale:g}=(0,i.useI18n)(),h=(0,d.useRouter)(),[j,k]=(0,c.useState)(!0),[l,m]=(0,c.useState)(!0),[q,r]=(0,c.useState)(!1),[s,t]=(0,c.useState)(!1),[u,v]=(0,c.useState)(""),[w,x]=(0,c.useState)(!1),[y,z]=(0,c.useState)(!1),[A,D]=(0,c.useState)(!1),[E,G]=(0,c.useState)(a.name),[H,I]=(0,c.useState)(a.alias??""),[K,L]=(0,c.useState)(a.description??""),[M,N]=(0,c.useState)(a.localPath??""),[O,$]=(0,c.useState)(a.projectType??"FRONTEND"),[aa,ao]=(0,c.useState)([]);(0,c.useEffect)(()=>{ae(100).then(ao)},[]);let[ap,aq]=(0,c.useState)(!1),[av,aw]=(0,c.useState)(""),[ax,ay]=(0,c.useState)(""),[az,aA]=(0,c.useState)(""),[aB,aC]=(0,c.useState)(""),[aD,aE]=(0,c.useState)("FRONTEND"),[aF,aG]=(0,c.useState)(!1),[aH,aI]=(0,c.useState)(!1),[aJ,aK]=(0,c.useState)(null),[aL,aM]=(0,c.useState)(!1),[aN,aO]=(0,c.useState)(!1),aP=a=>{ak.toast.info(a)},aQ=(0,c.useCallback)(async()=>{if(a.localPath){aM(!0);try{let b=await fetch(`/api/git?path=${encodeURIComponent(a.localPath)}`);b.ok&&aK(await b.json())}catch{}finally{aM(!1)}}},[a.localPath]);(0,c.useEffect)(()=>{aQ()},[aQ]);let aR=async()=>{if(a.localPath){aO(!0);try{(await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"init",path:a.localPath})})).ok?(aP(f("git.initSuccess")),await aQ()):aP(f("git.initFailed"))}catch{aP(f("git.initFailed"))}finally{aO(!1)}}},aS=(a,b)=>{h.push(`/workspaces/${a}?projectId=${b}`,{scroll:!1}),h.refresh()},aT=async()=>{if(ax.trim()){aG(!0);try{let a=await (0,ac.createProject)({name:ax.trim(),alias:az.trim()||void 0,description:aB.trim()||void 0,localPath:av,projectType:aD,workspaceId:e});aq(!1),aS(e,a.id)}catch(a){ak.toast.error(a instanceof Error?a.message:String(a))}finally{aG(!1)}}},aU=async()=>{if(M&&!aH){aI(!0);try{let a=await (0,aj.analyzeProjectDirectory)(M.trim(),g);L(a)}catch{ak.toast.error(f("project.analyzeError"))}finally{aI(!1)}}},aV=async()=>{try{await ab(a.id,{name:E.trim(),alias:H.trim()||void 0,description:K.trim()||void 0,localPath:M.trim()||void 0,projectType:O}),h.refresh(),r(!1)}catch(a){ak.toast.error(a instanceof Error?a.message:String(a))}};return(0,b.jsxs)("aside",{className:"relative w-72 flex-shrink-0 overflow-y-auto border-l border-border bg-sidebar",children:[(0,b.jsxs)("div",{className:"border-b border-border p-4",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("h2",{className:"text-base font-semibold text-foreground",children:a.name}),a.alias&&(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:a.alias})]}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{G(a.name),I(a.alias??""),L(a.description??""),N(a.localPath??""),r(!0)},className:"text-muted-foreground",children:(0,b.jsx)(B.Pencil,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{v(""),t(!0)},className:"text-muted-foreground hover:text-rose-400",children:(0,b.jsx)(C.Trash2,{className:"h-3.5 w-3.5"})})]})]}),a.description&&(0,b.jsx)("p",{className:"mt-2 text-sm text-secondary-foreground leading-relaxed line-clamp-4",children:a.description}),(0,b.jsx)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:(0,b.jsx)("span",{className:`inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-[11px] font-medium ${"GIT"===a.type?"bg-sky-500/15 text-sky-300 ring-1 ring-sky-500/20":"bg-muted text-muted-foreground ring-1 ring-border"}`,children:"GIT"===a.type?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(n.GitBranch,{className:"h-3 w-3"}),f("sidebar.right.gitType")]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(R.FileText,{className:"h-3 w-3"}),f("sidebar.right.normalType")]})})}),(a.localPath||a.gitUrl)&&(0,b.jsxs)("div",{className:"mt-3 space-y-1.5",children:[a.localPath&&(0,b.jsx)(at,{value:a.localPath,ariaLabel:f("project.localPath")}),a.gitUrl&&(0,b.jsx)(at,{value:a.gitUrl,ariaLabel:f("project.gitUrl")})]}),a.localPath&&(0,b.jsxs)("div",{className:"mt-3 space-y-1.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{render:(0,b.jsx)(o.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,ag.openInFileManager)(a.localPath)}catch(a){console.error("openInFileManager failed:",a),ak.toast.error(f("git.openInFileManagerFailed"))}},children:(0,b.jsx)(X.FolderSearch,{className:"h-4 w-4"})})}),(0,b.jsx)(F.TooltipContent,{children:f("git.openInFileManager")})]}),(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{render:(0,b.jsx)(o.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,ah.openInEditor)(a.localPath)}catch(a){console.error("openInEditor failed:",a),ak.toast.error(f("git.openInEditorFailed"))}},children:(0,b.jsx)(Y.Code,{className:"h-4 w-4"})})}),(0,b.jsx)(F.TooltipContent,{children:f("git.openInEditor")})]}),(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{render:(0,b.jsx)(o.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,ai.openInTerminal)(a.localPath)}catch(a){console.error("openInTerminal failed:",a),ak.toast.error(f("git.openInTerminalFailed"))}},children:(0,b.jsx)(Z.Terminal,{className:"h-4 w-4"})})}),(0,b.jsx)(F.TooltipContent,{children:f("git.openInTerminal")})]})]}),(0,b.jsxs)(o.Button,{variant:"outline",className:"w-full h-9 gap-1.5 text-xs",disabled:y,onClick:async()=>{z(!0);try{let b=await af(a.id);h.push(`/workspaces/${e}/tasks/${b}`)}catch{ak.toast.error(f("git.openStudioFailed"))}finally{z(!1)}},children:[y?(0,b.jsx)(V.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(S.FolderOpen,{className:"h-3.5 w-3.5"}),f("git.openStudio")]})]})]}),(0,b.jsxs)("div",{className:"border-b border-border p-4",children:[(0,b.jsxs)(o.Button,{variant:"ghost",onClick:()=>k(!j),className:"flex w-full cursor-pointer justify-between px-2 py-2",children:[(0,b.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:f("git.section")}),j?(0,b.jsx)(P.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,b.jsx)(Q.ChevronRight,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),j&&(0,b.jsx)("div",{className:"mt-3",children:a.localPath?aL?(0,b.jsxs)("div",{className:"flex items-center justify-center py-4 text-muted-foreground",children:[(0,b.jsx)(V.Loader2,{className:"h-4 w-4 animate-spin"}),(0,b.jsx)("span",{className:"ml-2 text-xs",children:f("git.loading")})]}):aJ&&!aJ.isGit?(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-muted/50 p-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,b.jsx)(U.AlertCircle,{className:"h-3.5 w-3.5"}),(0,b.jsx)("p",{className:"text-xs",children:f("git.notInitialized")})]}),(0,b.jsxs)(o.Button,{className:"mt-3 h-7 w-full gap-1.5 bg-primary/10 text-xs text-primary ring-1 ring-primary/20 hover:bg-primary/15",onClick:aR,disabled:aN,children:[aN?(0,b.jsx)(V.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(T,{className:"h-3 w-3"}),f("git.initRepo")]})]}):aJ?.isGit?(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("div",{className:"flex flex-col",children:(0,b.jsx)(as.EditorGitPanel,{localPath:a.localPath,mode:"project"})}),(0,b.jsx)(an,{commits:aJ.commits??[]}),(0,b.jsx)(ar,{localPath:a.localPath,stashes:aJ.stashes??[],hasChanges:(aJ.changedFiles??[]).length>0,onRefresh:aQ})]}):null:(0,b.jsx)("div",{className:"rounded-lg border border-border bg-muted/50 p-3",children:(0,b.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,b.jsx)(U.AlertCircle,{className:"h-3.5 w-3.5"}),(0,b.jsx)("p",{className:"text-xs",children:f("git.noLocalPath")})]})})})]}),(0,b.jsxs)("div",{className:"p-4",children:[(0,b.jsxs)(o.Button,{variant:"ghost",onClick:()=>m(!l),className:"flex w-full cursor-pointer justify-between px-2 py-2",children:[(0,b.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:f("sidebar.right.browseRepo")}),l?(0,b.jsx)(P.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,b.jsx)(Q.ChevronRight,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),l&&(0,b.jsxs)("div",{className:"mt-3 space-y-3",children:[(0,b.jsxs)(o.Button,{variant:"outline",className:"w-full h-8 gap-1.5 text-xs",onClick:()=>D(!0),children:[(0,b.jsx)(S.FolderOpen,{className:"h-3.5 w-3.5"}),f("sidebar.right.browseRepo")]}),aa.length>0&&(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5 px-1",children:f("sidebar.right.recent")}),(0,b.jsx)("div",{className:"space-y-0.5",children:aa.map(c=>(0,b.jsxs)("button",{onClick:()=>{c.id!==a.id&&aS(c.workspaceId,c.id)},className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors ${c.id===a.id?"bg-primary/10 text-primary cursor-default":"hover:bg-accent cursor-pointer"}`,children:["GIT"===c.type?(0,b.jsx)(n.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}):(0,b.jsx)(S.FolderOpen,{className:"h-3 w-3 shrink-0 text-primary/70"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("p",{className:"truncate text-xs font-medium text-foreground",children:c.name}),c.localPath&&(0,b.jsx)("p",{className:"truncate text-[10px] font-mono text-muted-foreground",children:c.localPath})]})]},c.id))})]})]})]}),(0,b.jsx)(J.Dialog,{open:q,onOpenChange:r,children:(0,b.jsxs)(J.DialogContent,{style:{maxWidth:"32rem"},children:[(0,b.jsx)(J.DialogHeader,{children:(0,b.jsx)(J.DialogTitle,{children:f("project.edit")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.name")}),(0,b.jsx)(p.Input,{value:E,onChange:a=>G(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.type.label")}),(0,b.jsx)("div",{className:"mt-1.5",children:(0,b.jsx)(am.SegmentedControl,{options:[{value:"FRONTEND",label:f("project.type.frontend")},{value:"BACKEND",label:f("project.type.backend")}],value:O,onChange:$})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.alias")}),(0,b.jsx)(p.Input,{value:H,onChange:a=>I(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.description")}),(0,b.jsxs)(o.Button,{type:"button",variant:"ghost",onClick:aU,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!M||aH?"opacity-50":""}`,children:[aH?(0,b.jsx)(V.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(W.Sparkles,{className:"h-3 w-3"}),aH?f("project.analyzing"):f("project.genDesc")]})]}),(0,b.jsx)(_.Textarea,{value:K,onChange:a=>L(a.target.value),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.localPath")}),(0,b.jsx)("div",{className:"mt-1.5 break-all rounded-md border border-border bg-muted/50 px-3 py-2 font-mono text-xs text-muted-foreground",children:M||"—"})]})]}),(0,b.jsxs)(J.DialogFooter,{children:[(0,b.jsx)(o.Button,{variant:"outline",onClick:()=>r(!1),children:f("common.cancel")}),(0,b.jsx)(o.Button,{onClick:aV,disabled:!E.trim()||aH,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:f("common.save")})]})]})}),(0,b.jsx)(al.FolderBrowserDialog,{open:A,onOpenChange:D,onSelect:a=>{q?N(a):(a=>{let b=aa.find(b=>b.localPath===a);if(b)return aS(b.workspaceId,b.id);let c=a.split("/").filter(Boolean).pop()??"";aw(a),ay(c),aA(""),aC(""),aq(!0)})(a)}}),(0,b.jsx)(J.Dialog,{open:ap,onOpenChange:aq,children:(0,b.jsxs)(J.DialogContent,{className:"sm:max-w-md",children:[(0,b.jsx)(J.DialogHeader,{children:(0,b.jsx)(J.DialogTitle,{children:f("topbar.newProject")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.localPath")}),(0,b.jsx)("div",{className:"mt-1.5 rounded-md border border-border bg-muted/50 px-3 py-2 font-mono text-xs text-muted-foreground",children:av})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.name")}),(0,b.jsx)(p.Input,{value:ax,onChange:a=>ay(a.target.value),placeholder:f("project.namePlaceholder"),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.type.label")}),(0,b.jsx)("div",{className:"mt-1.5",children:(0,b.jsx)(am.SegmentedControl,{options:[{value:"FRONTEND",label:f("project.type.frontend")},{value:"BACKEND",label:f("project.type.backend")}],value:aD,onChange:aE})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.alias")}),(0,b.jsx)(p.Input,{value:az,onChange:a=>aA(a.target.value),placeholder:f("project.aliasPlaceholder"),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.description")}),(0,b.jsx)(_.Textarea,{value:aB,onChange:a=>aC(a.target.value),placeholder:f("project.descPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,b.jsxs)(J.DialogFooter,{children:[(0,b.jsx)(o.Button,{variant:"outline",onClick:()=>aq(!1),children:f("common.cancel")}),(0,b.jsxs)(o.Button,{onClick:aT,disabled:!ax.trim()||aF,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[aF?(0,b.jsx)(V.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,f("common.create")]})]})]})}),(0,b.jsx)(J.Dialog,{open:s,onOpenChange:a=>{t(a),a||v("")},children:(0,b.jsxs)(J.DialogContent,{className:"sm:max-w-md",children:[(0,b.jsx)(J.DialogHeader,{children:(0,b.jsx)(J.DialogTitle,{className:"text-rose-400",children:f("project.deleteTitle")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:f("project.deleteWarning",{name:a.name})}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:f("project.deleteIrreversible")}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.deleteConfirmLabel")}),(0,b.jsx)(p.Input,{value:u,onChange:a=>v(a.target.value),placeholder:f("project.deleteConfirmPlaceholder"),className:"mt-1.5",autoFocus:!0})]})]}),(0,b.jsxs)(J.DialogFooter,{children:[(0,b.jsx)(o.Button,{variant:"outline",onClick:()=>t(!1),children:f("common.cancel")}),(0,b.jsxs)(o.Button,{variant:"destructive",disabled:u!==f("project.deleteConfirmText")||w,onClick:async()=>{x(!0);try{await ad(a.id),ak.toast.success(f("project.deleteSuccess")),h.push(`/workspaces/${e}`)}catch{ak.toast.error(f("project.deleteFailed"))}finally{x(!1),t(!1)}},children:[w&&(0,b.jsx)(V.Loader2,{className:"h-3 w-3 animate-spin mr-1"}),f("project.deleteButton")]})]})]})})]})}var av=a.i(963326),aw=a.i(300141),ax=a.i(913284),ay=a.i(269280),az=a.i(368114);function aA({title:a,description:c,branch:d,baseBranch:e,version:f,hasConversation:g,updatedAt:h,openDir:j,onBack:k}){let{t:l}=(0,i.useI18n)();return(0,b.jsxs)("div",{className:"border-b border-border px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(W.Sparkles,{className:"h-3.5 w-3.5 text-primary"}),(0,b.jsx)("span",{className:"text-xs font-semibold text-primary",children:l("taskDetail.title")})]}),(0,b.jsxs)(o.Button,{variant:"ghost",onClick:k,className:"flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground h-auto px-2 py-1",children:[(0,b.jsx)(ay.ArrowLeft,{className:"h-3.5 w-3.5"}),l("taskDetail.back")]})]}),(0,b.jsx)("h2",{className:"mt-2.5 text-lg font-bold tracking-tight text-foreground",children:a}),c&&(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:c}),(0,b.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[e?(0,b.jsxs)(E.Badge,{variant:"secondary",className:"bg-muted text-muted-foreground text-[10px] font-mono border border-border",children:[(0,b.jsx)(n.GitBranch,{className:"mr-1 h-3 w-3"}),e," · worktree"]}):d?(0,b.jsx)(E.Badge,{variant:"secondary",className:"bg-muted text-muted-foreground text-[10px] font-mono border border-border",children:l("taskDetail.directMode")}):null,f&&(0,b.jsx)(H.TaskVersionTag,{number:f.number,name:f.name,showName:!0}),g&&(0,b.jsx)(E.Badge,{variant:"secondary",className:"bg-emerald-500/10 text-emerald-400 text-[10px] border border-emerald-500/20",children:l("taskDetail.hasConversation")}),(0,b.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[l("taskDetail.updatedAt")," ",(0,az.formatRelativeTime)(h)]}),j&&(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-0.5",children:[(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{render:(0,b.jsx)(o.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,ag.openInFileManager)(j)}catch(a){console.error("openInFileManager failed:",a),ak.toast.error(l("git.openInFileManagerFailed"))}},children:(0,b.jsx)(X.FolderSearch,{className:"h-3.5 w-3.5"})})}),(0,b.jsx)(F.TooltipContent,{side:"bottom",children:l("git.openInFileManager")})]}),(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{render:(0,b.jsx)(o.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,ah.openInEditor)(j)}catch(a){console.error("openInEditor failed:",a),ak.toast.error(l("git.openInEditorFailed"))}},children:(0,b.jsx)(Y.Code,{className:"h-3.5 w-3.5"})})}),(0,b.jsx)(F.TooltipContent,{side:"bottom",children:l("git.openInEditor")})]}),(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{render:(0,b.jsx)(o.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,ai.openInTerminal)(j)}catch(a){console.error("openInTerminal failed:",a),ak.toast.error(l("git.openInTerminalFailed"))}},children:(0,b.jsx)(Z.Terminal,{className:"h-3.5 w-3.5"})})}),(0,b.jsx)(F.TooltipContent,{side:"bottom",children:l("git.openInTerminal")})]})]})]})]})}var aB=a.i(639138),aC=a.i(88757),aD=a.i(347872),aE=a.i(914218),aF=a.i(835515),aG=a.i(699438),aH=a.i(284886),aI=a.i(545510),aJ=a.i(109925),aK=a.i(773069),aL=a.i(772172),aM=a.i(209664),aN=a.i(715525),aO=a.i(324954);let aP=(0,e.default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);var aQ=a.i(54384),aR=a.i(509405),aS=a.i(262736);let aT=(0,aa.createServerReference)("409b338ecdbb1e5ac9b9d563a138a2a59d283d2035",aa.callServer,void 0,aa.findSourceMapURL,"getTaskNotes");var aU=a.i(915495);let aV=(0,aa.createServerReference)("40a92c87c17798d90a92fee15165981e7019049ef1",aa.callServer,void 0,aa.findSourceMapURL,"getTaskAssets");var aW=a.i(704315),aX=a.i(916731),aY=a.i(532615),aZ=a.i(894148),a$=a.i(161181);let a_=/\.(txt|md|json)$/i;function a0({taskId:a,projectId:d}){let{t:e}=(0,i.useI18n)(),f=(0,c.useRef)(null),[g,h]=(0,c.useState)([]),[j,k]=(0,c.useState)([]),[m,n]=(0,c.useState)(!1),[p,q]=(0,c.useState)(""),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(!1),[v,w]=(0,c.useState)(null);async function x(){p.trim()&&(await (0,aS.createNote)({title:p.trim(),content:r.trim(),projectId:d,taskId:a,category:"task"}),q(""),s(""),n(!1),aT(a).then(h))}async function y(a){await (0,aU.deleteNote)(a),h(b=>b.filter(b=>b.id!==a))}async function z(b){let c=b.target.files?.[0];if(c){u(!0);try{let b=new FormData;b.set("file",c),b.set("projectId",d),b.set("taskId",a),await (0,aW.uploadAsset)(b),aV(a).then(k)}finally{u(!1),f.current&&(f.current.value="")}}}async function A(a){await (0,aX.deleteAsset)(a),k(b=>b.filter(b=>b.id!==a))}function B(a){return(0,a$.isImageAsset)(a.filename,a.mimeType)||a_.test(a.filename)}function D(a){B(a)?w(a):ak.toast.info(e("assets.previewNotSupported"))}async function E(a){try{let b=await fetch("/api/internal/assets/reveal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:a.path})});if(!b.ok){let a=await b.json().catch(()=>({}));ak.toast.error(a.error||"Failed to reveal file")}}catch{ak.toast.error("Failed to reveal file")}}(0,c.useEffect)(()=>{aT(a).then(h),aV(a).then(k)},[a]);let F=v?(0,a$.isImageAsset)(v.filename,v.mimeType)?"image":a_.test(v.filename)?"text":null:null,G=j.filter(a=>(0,a$.isImageAsset)(a.filename,a.mimeType)).map(a=>({id:a.id,url:(0,a$.localPathToApiUrl)(a.path),filename:a.filename})),H=v?G.findIndex(a=>a.id===v.id):-1;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(K.ScrollArea,{className:"h-full",children:(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsxs)("div",{className:"border-b border-border px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("h3",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[(0,b.jsx)(R.FileText,{className:"h-3.5 w-3.5"}),e("taskPage.notes")]}),(0,b.jsxs)(o.Button,{variant:"ghost",className:"h-6 gap-1 px-2 text-xs",onClick:()=>n(!m),children:[m?(0,b.jsx)(aQ.X,{className:"h-3 w-3"}):(0,b.jsx)(l.Plus,{className:"h-3 w-3"}),m?"":e("taskPage.addNote")]})]}),m&&(0,b.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,b.jsx)("input",{type:"text",value:p,onChange:a=>q(a.target.value),placeholder:e("taskPage.noteTitle"),className:"h-8 w-full rounded-md border border-border bg-background px-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary",autoFocus:!0}),(0,b.jsx)("textarea",{value:r,onChange:a=>s(a.target.value),placeholder:e("taskPage.noteContent"),rows:3,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary resize-none"}),(0,b.jsx)(o.Button,{className:"text-xs",onClick:x,disabled:!p.trim(),children:e("taskPage.addNote")})]}),(0,b.jsxs)("div",{className:"mt-2 space-y-2",children:[0===g.length&&!m&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:e("taskPage.noNotes")}),g.map(a=>(0,b.jsx)("div",{className:"group rounded-md border border-border bg-card p-3",children:(0,b.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("h4",{className:"text-sm font-medium truncate",children:a.title}),a.content&&(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-3 whitespace-pre-wrap",children:a.content}),(0,b.jsx)("p",{className:"mt-1 text-[10px] text-muted-foreground",children:new Date(a.createdAt).toLocaleString()})]}),(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-xs",onClick:()=>y(a.id),className:"shrink-0 text-muted-foreground opacity-0 hover:bg-destructive/10 hover:text-destructive group-hover:opacity-100",title:e("taskPage.deleteNote"),children:(0,b.jsx)(C.Trash2,{className:"h-3.5 w-3.5"})})]})},a.id))]})]}),(0,b.jsxs)("div",{className:"px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("h3",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[(0,b.jsx)(aP,{className:"h-3.5 w-3.5"}),e("taskPage.attachments")]}),(0,b.jsxs)(o.Button,{variant:"ghost",className:"h-6 gap-1 px-2 text-xs",onClick:()=>f.current?.click(),disabled:t,children:[(0,b.jsx)(aO.Upload,{className:"h-3 w-3"}),e("taskPage.uploadFile")]}),(0,b.jsx)("input",{ref:f,type:"file",className:"hidden",onChange:z})]}),(0,b.jsxs)("div",{className:"mt-2 space-y-1.5",children:[0===j.length&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:e("taskPage.noAttachments")}),j.map(a=>{var c;let d=B(a);return(0,b.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border bg-card px-3 py-2",children:[(0,b.jsx)(aP,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,b.jsx)("button",{type:"button",onClick:()=>D(a),disabled:!d,className:`min-w-0 flex-1 truncate text-left text-sm ${d?"cursor-pointer hover:underline":"cursor-default"}`,title:d?e("assets.preview"):a.filename,children:a.filename}),(0,b.jsx)("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:(c=a.size)?c<1024?`${c} B`:c<1048576?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`:""}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5",children:[d&&(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-xs",onClick:()=>D(a),className:"shrink-0 text-muted-foreground hover:bg-accent",title:e("assets.preview"),children:(0,b.jsx)(aR.Eye,{className:"h-3 w-3"})}),(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-xs",onClick:()=>E(a),className:"shrink-0 text-muted-foreground hover:bg-accent",title:e("assets.revealInFinder"),children:(0,b.jsx)(S.FolderOpen,{className:"h-3 w-3"})}),(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-xs",onClick:()=>A(a.id),className:"shrink-0 text-muted-foreground hover:bg-destructive/10 hover:text-destructive",title:e("taskPage.deleteAttachment"),children:(0,b.jsx)(C.Trash2,{className:"h-3 w-3"})})]})]},a.id)})]})]})]})}),(0,b.jsx)(aY.ImageLightbox,{imageUrl:"image"===F&&H>=0?G[H].url:null,filename:"image"===F&&H>=0?G[H].filename:"",open:"image"===F,onOpenChange:a=>{a||w(null)},assets:G.map(({url:a,filename:b})=>({url:a,filename:b})),currentIndex:H>=0?H:void 0,onIndexChange:a=>{let b=G[a];if(!b)return;let c=j.find(a=>a.id===b.id);c&&w(c)}}),(0,b.jsx)(aZ.TextPreviewDialog,{url:"text"===F&&v?(0,a$.localPathToApiUrl)(v.path):null,filename:v?.filename??"",open:"text"===F,onOpenChange:a=>{a||w(null)}})]})}function a1({task:a,workspaceId:e,projectLocalPath:f,onClose:g}){let{t:h}=(0,i.useI18n)(),j=(0,d.useRouter)(),{removePortal:k}=(0,aD.useTerminalPortal)(),[l,m]=(0,c.useState)("terminal"),[n,p]=(0,c.useState)(null),[r,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(a.status);(0,c.useEffect)(()=>{u(a.status)},[a.status]);let[v,w]=(0,c.useState)(null),[x,y]=(0,c.useState)(!1),[z,A]=(0,c.useState)(!1),[B,C]=(0,c.useState)([]);(0,c.useEffect)(()=>{w(null),y(!1),A(!1),C([]),p(null),m("terminal")},[a.id]);let[D,E]=(0,c.useState)([]),[G,H]=(0,c.useState)(null);(0,c.useEffect)(()=>{let a=!1;return(0,aM.getPrompts)().then(b=>{if(a)return;E(b.map(a=>({id:a.id,name:a.name,isDefault:a.isDefault})));let c=b.find(a=>a.isDefault);c&&H(c.id)}),()=>{a=!0}},[]),(0,c.useEffect)(()=>{w(null),A(!1);let b=!1;return(0,aE.getTaskExecutions)(a.id).then(a=>{if(b)return;let c=a[0];if(c?.status==="RUNNING"){let a=c.worktreePath||f||null;a&&w(a)}C(a.filter(a=>"RUNNING"!==a.status)),A(!0)}),()=>{b=!0}},[a.id]),(0,c.useEffect)(()=>{if("changes"!==l||"TODO"===t||"CANCELLED"===t)return;let b=!1;return s(!0),fetch(`/api/tasks/${a.id}/diff`).then(a=>{if(!a.ok)throw Error(`HTTP ${a.status}`);return a.json()}).then(a=>{b||p(a?.files||a?.branchDeleted?a:null)}).catch(()=>{b||p(null)}).finally(()=>{b||s(!1)}),()=>{b=!0}},[l,t,a.id]);let I=(0,c.useCallback)(async()=>{if(!x){y(!0),k(a.id);try{let b=await (0,aF.startPtyExecutionSafe)(a.id,"",G);if(!b.ok){y(!1),ak.toast.error(b.error||h("terminal.startFailed"));return}w(b.worktreePath??null),u("IN_PROGRESS")}catch(a){y(!1),ak.toast.error(a instanceof Error&&a.message?a.message:h("terminal.startFailed"))}}},[a.id,x,G,h]),J=(0,c.useCallback)(b=>{y(!1),w(null),k(a.id),0===b&&u("IN_REVIEW"),(0,aE.getTaskExecutions)(a.id).then(a=>{C(a.filter(a=>"RUNNING"!==a.status))}),j.refresh()},[j,a.id]),L=(0,c.useCallback)(async()=>{await (0,aG.stopPtyExecution)(a.id),y(!1),k(a.id),w(null),u("IN_REVIEW"),(0,aE.getTaskExecutions)(a.id).then(a=>{C(a.filter(a=>"RUNNING"!==a.status))}),j.refresh()},[a.id,j]),M=(0,c.useCallback)(async b=>{y(!0),k(a.id),w(null);try{let{worktreePath:c}=await (0,aH.resumePtyExecution)(a.id,b);w(c),u("IN_PROGRESS")}catch{y(!1)}},[a.id,k]),N=(0,c.useCallback)(async()=>{y(!0),k(a.id),w(null);try{let{worktreePath:b}=await (0,aI.continueLatestPtyExecution)(a.id);w(b),u("IN_PROGRESS")}catch(a){y(!1),ak.toast.error(a instanceof Error?a.message:String(a))}},[a.id,k]),[O,P]=(0,c.useState)(!1),[Q,S]=(0,c.useState)([]),T=(0,c.useCallback)(async()=>{try{let b=await (0,aK.checkWorktreeClean)(a.id);if(b.hasWorktree&&!b.clean)return void ak.toast.error(h("taskPage.uncommittedChanges",{count:String(b.files.length)}));if(b.hasWorktree&&b.clean&&!b.hasCommits)return void ak.toast.error(h("taskPage.noChangesToComplete"),{action:{label:h("taskPage.markAsCancelled"),onClick:()=>{(0,aJ.updateTaskStatus)(a.id,"CANCELLED").then(()=>{u("CANCELLED"),ak.toast.success(h("taskPage.taskCancelled")),j.refresh()}).catch(()=>ak.toast.error("Failed to cancel task"))}}});if(b.hasWorktree&&b.hasCommits){S(b.commitLog),P(!0);return}await (0,aJ.updateTaskStatus)(a.id,"DONE"),u("DONE"),ak.toast.success(h("taskPage.taskCompleted")),j.refresh()}catch{ak.toast.error("Failed to complete task")}},[a.id,j,h]),U=(0,c.useCallback)(()=>{u("DONE"),P(!1),ak.toast.success(h("taskPage.taskCompleted")),j.refresh()},[j,h]),W=(0,c.useCallback)(async b=>{try{let{hash:c}=await (0,aL.commitWorktreeChanges)(a.id,b);ak.toast.success(h("diff.commitSuccess",{hash:c})),j.refresh();let d=await fetch(`/api/tasks/${a.id}/diff`);if(d.ok){let a=await d.json();p(a?.files?a:null)}}catch(a){ak.toast.error(a instanceof Error?a.message:"Commit failed")}},[a.id,j,h]);return(0,b.jsxs)("div",{className:"flex h-full w-[600px] flex-shrink-0 flex-col border-l border-border bg-sidebar","data-testid":"task-detail-panel",children:[(0,b.jsx)(aA,{title:a.title,description:h("taskDetail.panelDescription"),branch:`task/${a.id}`,baseBranch:a.baseBranch,version:a.version??null,hasConversation:!1,updatedAt:a.updatedAt,openDir:v??(f?a.subPath?`${f}/${a.subPath}`:f:null),onBack:g}),(0,b.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-2",children:[(0,b.jsxs)("div",{className:"flex gap-1",children:[(0,b.jsxs)("button",{onClick:()=>m("terminal"),className:`flex items-center gap-1.5 px-3 py-1 text-xs font-medium rounded-md ${"terminal"===l?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,b.jsx)(Z.Terminal,{className:"h-3 w-3"}),h("terminal.execute")]}),(0,b.jsx)("button",{onClick:()=>m("changes"),className:`px-3 py-1 text-xs font-medium rounded-md ${"changes"===l?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:h("taskPage.changes")}),(0,b.jsxs)("button",{onClick:()=>m("notes"),className:`flex items-center gap-1.5 px-3 py-1 text-xs font-medium rounded-md ${"notes"===l?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,b.jsx)(R.FileText,{className:"h-3 w-3"}),h("taskPage.notes")]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:["IN_REVIEW"===t&&(0,b.jsxs)(o.Button,{size:"sm",onClick:T,className:"bg-emerald-500/15 text-emerald-400 ring-1 ring-emerald-500/20 hover:bg-emerald-500/25",children:[(0,b.jsx)(ax.CheckCircle2,{className:"h-3 w-3"}),h("taskPage.completeTask")]}),"DONE"!==t&&"CANCELLED"!==t&&(0,b.jsxs)(o.Button,{variant:"ghost",size:"sm",onClick:()=>j.push(`/workspaces/${e}/tasks/${a.id}`),className:"text-muted-foreground",children:[(0,b.jsx)(av.ExternalLink,{className:"h-3 w-3"}),h("taskPage.viewDetails")]})]})]}),"terminal"===l?(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:z?v?(0,b.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,b.jsxs)("div",{className:"shrink-0 flex items-center justify-between border-b border-neutral-800 px-3 py-2 bg-[#0f1419]",children:[(0,b.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-emerald-400",children:[(0,b.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"}),h("execution.running")]}),(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsxs)(F.TooltipTrigger,{onClick:L,className:"flex items-center gap-1.5 rounded-md bg-red-500/15 px-3 py-1 text-xs font-medium text-red-400 hover:bg-red-500/25 transition-colors",children:[(0,b.jsx)(aw.Square,{className:"h-3 w-3"}),h("terminal.stopExecution")]}),(0,b.jsx)(F.TooltipContent,{side:"bottom",children:h("terminal.stopHint")})]})]}),(0,b.jsx)("div",{className:"flex-1 min-h-0",children:(0,b.jsx)(aD.TerminalOutlet,{taskId:a.id,worktreePath:v,onSessionEnd:J})})]}):"DONE"===t||"CANCELLED"===t?(0,b.jsx)("div",{className:"flex h-full flex-col overflow-hidden",children:(0,b.jsx)(K.ScrollArea,{className:"flex-1 min-h-0",children:(0,b.jsx)(aN.ExecutionTimeline,{executions:B})})}):(0,b.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,b.jsxs)("div",{className:"shrink-0 flex items-center gap-2 border-b border-border px-4 py-3",children:[D.length>0&&(0,b.jsxs)(q.Select,{defaultValue:G??"none",onValueChange:a=>H("none"===a?null:a),children:[(0,b.jsx)(q.SelectTrigger,{size:"sm",className:"min-w-[120px]",children:(0,b.jsx)("span",{className:"text-left truncate",children:G?D.find(a=>a.id===G)?.name??h("terminal.noPrompt"):h("terminal.noPrompt")})}),(0,b.jsxs)(q.SelectContent,{className:"min-w-[200px]",children:[(0,b.jsx)(q.SelectItem,{value:"none",children:h("terminal.noPrompt")}),D.map(a=>(0,b.jsxs)(q.SelectItem,{value:a.id,children:[a.name,a.isDefault?" ★":""]},a.id))]})]},`prompt-${D.length}`),(0,b.jsxs)(o.Button,{onClick:I,disabled:x,size:"sm",className:"gap-2 px-4",children:[x?(0,b.jsx)(V.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(Z.Terminal,{className:"h-3.5 w-3.5"}),x?h("terminal.executing"):h("terminal.launch")]})]}),(0,b.jsx)(K.ScrollArea,{className:"flex-1 min-h-0",children:(0,b.jsx)(aN.ExecutionTimeline,{executions:B,onResume:M,onContinueLatest:N})})]}):(0,b.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 bg-[#0f1419]",children:[(0,b.jsx)(V.Loader2,{className:"size-5 animate-spin text-neutral-500"}),(0,b.jsx)("span",{className:"text-xs text-neutral-500",children:h("execution.loading")})]})}):"changes"===l?(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:r?(0,b.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:h("taskPage.loadingDiff")})}):n?.branchDeleted?(0,b.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:h("taskPage.branchDeleted")})}):n?(0,b.jsx)(aB.TaskDiffView,{taskId:a.id,files:n.files,totalAdded:n.totalAdded,totalRemoved:n.totalRemoved,hasConflicts:n.hasConflicts,conflictFiles:n.conflictFiles,onCommit:W,hasUncommitted:n.hasUncommitted}):(0,b.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:h("taskPage.noChanges")})})}):"notes"===l?(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,b.jsx)(a0,{taskId:a.id,projectId:a.projectId})}):null,(0,b.jsx)(aC.TaskMergeConfirmDialog,{open:O,onOpenChange:P,taskId:a.id,taskTitle:a.title,baseBranch:a.baseBranch??"main",fileCount:n?.files?.length??0,commitCount:n?.commitCount??0,commitLog:Q,onMergeComplete:U})]})}var a2=a.i(758542),a3=a.i(444407);let a4=(0,aa.createServerReference)("407bd323d06ab78356857d76941714251499f42d2b",aa.callServer,void 0,aa.findSourceMapURL,"deleteTask"),a5=(0,aa.createServerReference)("40f9b090e922030f31a41927d44bac3fbb5536198a",aa.callServer,void 0,aa.findSourceMapURL,"toggleTaskPinned");var a6=a.i(157886);let a7=(0,aa.createServerReference)("4091ef67156805c12ffd885ab3e59437f9b4b3a8ca",aa.callServer,void 0,aa.findSourceMapURL,"getVersionsForPicker");var a8=a.i(912868);function a9({projects:a,activeProjectId:d,onSelect:e}){let f=(0,c.useRef)(null),[g,h]=(0,c.useState)(!1),[i,j]=(0,c.useState)(!1),k=()=>{let a=f.current;a&&(h(a.scrollLeft>0),j(a.scrollLeft<a.scrollWidth-a.clientWidth-1))};(0,c.useEffect)(()=>{k();let a=f.current;if(a){a.addEventListener("scroll",k);let b=new ResizeObserver(k);return b.observe(a),()=>{a.removeEventListener("scroll",k),b.disconnect()}}},[a]);let l=a=>{let b=f.current;b&&b.scrollBy({left:"left"===a?-150:150,behavior:"smooth"})};return(0,b.jsxs)("div",{className:"relative flex items-center",children:[g&&(0,b.jsx)("button",{onClick:()=>l("left"),className:"absolute left-0 z-10 flex h-8 w-8 items-center justify-center rounded-md bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border backdrop-blur-sm transition-colors hover:text-foreground",children:(0,b.jsx)(a8.ChevronLeft,{className:"h-4 w-4"})}),(0,b.jsx)("div",{ref:f,className:"flex items-center gap-1.5 overflow-x-auto scrollbar-none px-1 py-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:a.map(a=>{let c=d===a.id;return(0,b.jsxs)("button",{onClick:()=>{c||e(a.id)},className:`shrink-0 rounded-lg border-b-2 px-4 py-2 text-sm font-medium transition-colors ${c?"border-primary bg-primary/10 text-primary ring-1 ring-primary/20 cursor-default":"border-transparent text-muted-foreground hover:bg-accent hover:text-foreground cursor-pointer"}`,children:[(0,b.jsx)("span",{children:a.name}),a.alias&&(0,b.jsx)("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:a.alias})]},a.id)})}),i&&(0,b.jsx)("button",{onClick:()=>l("right"),className:"absolute right-0 z-10 flex h-8 w-8 items-center justify-center rounded-md bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border backdrop-blur-sm transition-colors hover:text-foreground",children:(0,b.jsx)(Q.ChevronRight,{className:"h-4 w-4"})})]})}var ba=a.i(811344);function bb({open:a,onOpenChange:c,taskTitle:d,uncommittedFiles:e,commitLog:f,onConfirm:g}){let{t:h}=(0,i.useI18n)(),j=e.length,k=f.length,l=0===j&&0===k;return(0,b.jsx)(J.Dialog,{open:a,onOpenChange:c,children:(0,b.jsxs)(J.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,b.jsx)(J.DialogHeader,{children:(0,b.jsxs)(J.DialogTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)(ba.AlertTriangle,{className:"h-4 w-4 text-amber-400"}),h("taskCancel.title")]})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{className:"rounded-lg border border-amber-500/20 bg-amber-500/10 p-3 space-y-1.5",children:[(0,b.jsx)("p",{className:"text-xs text-foreground",children:h("taskCancel.intro",{title:d})}),(0,b.jsx)("p",{className:"text-xs text-amber-300",children:h("taskCancel.irreversible")})]}),l?(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:h("taskCancel.cleanNotice")}):(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:h("taskCancel.uncommittedFiles")}),(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:j})]}),(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:h("taskCancel.unmergedCommits")}),(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:k})]})]}),j>0&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:h("taskCancel.filesList")}),(0,b.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:e.map((a,c)=>(0,b.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:a},c))})]}),k>0&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:h("taskCancel.commitsList")}),(0,b.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:f.map((a,c)=>(0,b.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:a},c))}),(0,b.jsx)("p",{className:"text-[10px] text-muted-foreground mt-1.5",children:h("taskCancel.reflogHint")})]})]}),(0,b.jsxs)(J.DialogFooter,{children:[(0,b.jsx)(o.Button,{variant:"outline",onClick:()=>c(!1),children:h("taskCancel.keep")}),(0,b.jsxs)(o.Button,{variant:"destructive",onClick:g,className:"gap-2",children:[(0,b.jsx)(ba.AlertTriangle,{className:"h-4 w-4"}),h("taskCancel.confirm")]})]})]})})}a.s(["BoardPageClient",0,function({workspaceId:a,projectId:e,project:f,projects:g,initialTasks:h,labels:k,openTaskId:l}){let m=(0,d.useRouter)(),{t:n}=(0,i.useI18n)(),[,o]=(0,c.useTransition)(),[p,q]=(0,c.useState)(""),[s,t]=(0,c.useState)("all"),[v,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)("TODO"),[z,A]=(0,c.useState)(l??null),[B,C]=(0,c.useState)([]),D=z?h.find(a=>a.id===z)??null:null,[E,F]=(0,c.useState)(null),[G,H]=(0,c.useState)(null),[I,J]=(0,c.useState)(null);(0,c.useEffect)(()=>{a7(e).then(C).catch(()=>C([]))},[e]);let K=B.find(a=>a.isCurrent)?.id??null,L=(0,c.useCallback)(()=>{o(()=>{m.refresh()})},[m]);(0,c.useEffect)(()=>{if(v)return;let a=setInterval(()=>{o(()=>{m.refresh()})},5e3);return()=>clearInterval(a)},[m,v]);let M=(0,c.useCallback)(a=>{q(a)},[]),P=(0,c.useCallback)(async a=>{let b=h.find(b=>b.id===a);if(b)try{let c=await (0,aK.checkWorktreeClean)(a);if(c.hasWorktree&&!c.clean){ak.toast.error(n("taskPage.uncommittedChanges",{count:String(c.files.length)})),L();return}if(c.hasWorktree&&c.clean&&!c.hasCommits){ak.toast.error(n("taskPage.noChangesToComplete"),{action:{label:n("taskPage.markAsCancelled"),onClick:()=>{(0,aJ.updateTaskStatus)(a,"CANCELLED").then(()=>{ak.toast.success(n("taskPage.taskCancelled")),L()}).catch(()=>ak.toast.error("Failed to cancel task"))}}}),L();return}if(c.hasWorktree&&c.hasCommits){H({task:b,commitLog:c.commitLog,commitCount:c.commitLog.length}),L();return}await (0,aJ.updateTaskStatus)(a,"DONE"),ak.toast.success(n("taskPage.taskCompleted")),L()}catch{ak.toast.error("Failed to complete task"),L()}},[h,L,n]),Q=(0,c.useCallback)(async a=>{let b=h.find(b=>b.id===a);if(b)try{let c=await (0,aK.checkWorktreeClean)(a);if(!c.hasWorktree){await (0,aJ.updateTaskStatus)(a,"CANCELLED"),ak.toast.success(n("taskPage.taskCancelled")),L();return}J({task:b,files:c.files,commitLog:c.commitLog}),L()}catch{ak.toast.error("Failed to cancel task"),L()}},[h,L,n]),R=(0,c.useCallback)(async(a,b)=>{"DONE"===b?await P(a):"CANCELLED"===b?await Q(a):(await (0,aJ.updateTaskStatus)(a,b),L())},[L,P,Q]),S=(0,c.useCallback)(async a=>{let b=await (0,a2.createTask)({title:a.title,description:a.description,projectId:e,priority:a.priority,status:a.status,labelIds:a.labelIds,baseBranch:a.baseBranch,subPath:a.subPath,versionId:a.versionId??void 0});if(a.autoStart&&b?.id)try{await (0,a6.startPtyExecution)(b.id,""),A(b.id)}catch(a){ak.toast.error(a instanceof Error?a.message:String(a))}L()},[e,L]),T=(0,c.useCallback)(async(a,b)=>{await (0,a3.updateTask)(a,{...b,labelIds:b.labelIds}),F(null),L()},[L]),U=(0,c.useCallback)(async a=>{await a4(a),z===a&&A(null),L()},[L,z]),V=(0,c.useCallback)(async a=>{await a5(a),L()},[L]),W=(0,c.useCallback)(async b=>{try{await (0,a6.startPtyExecution)(b,"")}catch(a){ak.toast.error(a instanceof Error?a.message:String(a))}m.push(`/workspaces/${a}/tasks/${b}`)},[m,a]),X=(0,c.useCallback)(async(a,b)=>{"DONE"===b?await P(a):"CANCELLED"===b?await Q(a):(await (0,aJ.updateTaskStatus)(a,b),L())},[L,P,Q]),Y=(0,c.useCallback)(a=>{y(a),F(null),w(!0)},[]),Z=(0,c.useCallback)(a=>{F(a),w(!0)},[]),$=h.filter(a=>!a.labels?.some(a=>a.label.name===u.TOWER_LABEL_NAME&&a.label.isBuiltin)),_=$.filter(a=>{if("backlog"===s){if(a.versionId)return!1}else if("all"!==s&&a.versionId!==s)return!1;if(p.trim()){let b=p.toLowerCase();if(!a.title.toLowerCase().includes(b)&&!a.description?.toLowerCase().includes(b))return!1}return!0});return(0,b.jsxs)("div",{className:"flex h-full",children:[(0,b.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,b.jsx)("div",{className:"px-6 pt-3 pb-1",children:(0,b.jsx)(a9,{projects:g,activeProjectId:e,onSelect:b=>m.push(`/workspaces/${a}?projectId=${b}`,{scroll:!1})})}),(0,b.jsx)(j,{totalTasks:$.length,runningTasks:$.filter(a=>"IN_PROGRESS"===a.status).length}),(0,b.jsx)(r,{searchQuery:p,onSearchChange:M,versions:B,versionFilter:s,onVersionFilterChange:t,versionsHref:`/workspaces/${a}/projects/${e}/versions`,onCreateTask:()=>{F(null),w(!0)}}),(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden p-4",children:(0,b.jsx)(N,{initialTasks:_,onTaskMove:R,onTaskClick:a=>{A(a.id)},onEditTask:Z,onAddTask:Y,onDeleteTask:U,onTogglePin:V,workspaceId:a,onContextMenuStatusChange:X,onContextMenuLaunch:W})}),(0,b.jsx)(O.CreateTaskDialog,{open:v,onOpenChange:a=>{w(a),a||F(null)},onSubmit:S,onUpdate:T,defaultStatus:x,editTask:E,editTaskLabelIds:E?.labels?E.labels.map(a=>a.labelId):[],labels:k.filter(a=>!(a.name===u.TOWER_LABEL_NAME&&a.isBuiltin)),projectType:f.type,projectLocalPath:f.localPath,versions:B,defaultVersionId:K})]}),D?(0,b.jsx)(a1,{task:D,workspaceId:a,projectLocalPath:f.localPath,onClose:()=>A(null)}):(0,b.jsx)(au,{project:f,workspaceId:a}),G&&(0,b.jsx)(aC.TaskMergeConfirmDialog,{open:!0,onOpenChange:a=>{a||H(null)},taskId:G.task.id,taskTitle:G.task.title,baseBranch:G.task.baseBranch??"main",fileCount:0,commitCount:G.commitCount,commitLog:G.commitLog,onMergeComplete:()=>{H(null),ak.toast.success(n("taskPage.taskCompleted")),L()}}),I&&(0,b.jsx)(bb,{open:!0,onOpenChange:a=>{a||J(null)},taskTitle:I.task.title,uncommittedFiles:I.files,commitLog:I.commitLog,onConfirm:()=>{let a=I.task.id;J(null),(0,aJ.updateTaskStatus)(a,"CANCELLED").then(()=>{ak.toast.success(n("taskPage.taskCancelled")),L()}).catch(()=>ak.toast.error("Failed to cancel task"))}})]})}],473935)}];
1
+ module.exports=[473935,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(553798),e=a.i(711796);let f=(0,e.default)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]),g=(0,e.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);var h=a.i(283857),i=a.i(951192);function j({totalTasks:a,runningTasks:c}){let{t:d}=(0,i.useI18n)();return(0,b.jsxs)("div",{className:"grid grid-cols-3 gap-3 px-6 py-4",children:[(0,b.jsx)("div",{className:"rounded-xl border border-border bg-card p-4",children:(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:"rounded-lg bg-sky-500/10 p-2 ring-1 ring-sky-500/20",children:(0,b.jsx)(f,{className:"h-4 w-4 text-sky-400"})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:d("board.overview")}),(0,b.jsx)("p",{className:"text-2xl font-bold font-mono tracking-tight text-foreground",children:a})]})]})}),(0,b.jsx)("div",{className:"rounded-xl border border-border bg-card p-4",children:(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:"rounded-lg bg-primary/10 p-2 ring-1 ring-primary/20",children:(0,b.jsx)(g,{className:"h-4 w-4 text-primary"})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:d("board.running")}),(0,b.jsx)("p",{className:"text-2xl font-bold font-mono tracking-tight text-foreground",children:c})]})]})}),(0,b.jsx)("div",{className:"rounded-xl border border-border bg-card p-4",children:(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:"rounded-lg bg-emerald-500/10 p-2 ring-1 ring-emerald-500/20",children:(0,b.jsx)(h.Lightbulb,{className:"h-4 w-4 text-emerald-400"})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:d("board.tip")}),(0,b.jsx)("p",{className:"text-xs font-medium text-foreground/80",children:d("board.tipText")})]})]})})]})}var k=a.i(634910),l=a.i(774881),m=a.i(573242),n=a.i(577565),o=a.i(699570),p=a.i(866718),q=a.i(580701);function r({searchQuery:a,onSearchChange:c,versions:d=[],versionFilter:e="all",onVersionFilterChange:f,versionsHref:g,onCreateTask:h}){let j,{t:s}=(0,i.useI18n)(),t="all"===e?s("board.allVersions"):"backlog"===e?s("board.backlogFilter"):(j=d.find(a=>a.id===e))?`${j.number} ${j.name}`:s("board.allVersions");return(0,b.jsxs)("div",{className:"flex items-center gap-2 px-6 py-2",children:[f&&(0,b.jsxs)(q.Select,{value:e,onValueChange:a=>f(a||"all"),children:[(0,b.jsxs)(q.SelectTrigger,{className:"h-8 w-44 shrink-0 gap-1.5 text-xs text-muted-foreground",children:[(0,b.jsx)(n.GitBranch,{className:"h-3.5 w-3.5 shrink-0"}),(0,b.jsx)("span",{className:"truncate",children:t})]}),(0,b.jsxs)(q.SelectContent,{children:[(0,b.jsx)(q.SelectItem,{value:"all",children:s("board.allVersions")}),(0,b.jsx)(q.SelectItem,{value:"backlog",children:s("board.backlogFilter")}),d.map(a=>(0,b.jsxs)(q.SelectItem,{value:a.id,children:[(0,b.jsx)("span",{className:"font-mono",children:a.number})," ",a.name]},a.id))]})]}),(0,b.jsxs)("div",{className:"relative flex-1 max-w-xs",children:[(0,b.jsx)(m.Search,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,b.jsx)(p.Input,{type:"text",value:a,onChange:a=>c(a.target.value),placeholder:s("board.searchPlaceholder"),className:"pl-8 pr-3 text-xs"})]}),(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[g&&(0,b.jsx)(k.default,{href:g,children:(0,b.jsxs)(o.Button,{variant:"outline",className:"h-8 gap-1.5 text-xs text-muted-foreground",children:[(0,b.jsx)(n.GitBranch,{className:"h-3.5 w-3.5"}),s("version.timeline")]})}),(0,b.jsxs)(o.Button,{"data-tour":"create-task",variant:"outline",className:"gap-1.5 border-border text-xs text-muted-foreground hover:border-primary/30 hover:text-primary",onClick:h,children:[(0,b.jsx)(l.Plus,{className:"h-3.5 w-3.5"}),s("board.newTask")]})]})]})}var s=a.i(986099),t=a.i(668116),u=a.i(521007);function v({x:a,y:e,taskId:f,currentStatus:g,hasExecutions:h,workspaceId:j,onClose:k,onStatusChange:l,onLaunch:m}){let{t:n}=(0,i.useI18n)(),o=(0,d.useRouter)(),p=(0,c.useRef)(null);(0,c.useEffect)(()=>{let a=a=>{p.current&&!p.current.contains(a.target)&&k()},b=a=>{"Escape"===a.key&&k()};return document.addEventListener("mousedown",a),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",b)}},[k]);let q="flex items-center px-3 py-1.5 text-xs cursor-pointer hover:bg-accent rounded-sm w-full text-left",r=(0,b.jsxs)("div",{ref:p,style:{position:"fixed",top:e,left:a,zIndex:9999},className:"bg-popover border border-border rounded-md shadow-md py-1 min-w-[180px]",children:[(0,b.jsx)("div",{className:"px-3 py-1 text-[10px] text-muted-foreground uppercase tracking-wider",children:n("board.contextMenu.changeStatus")}),u.BOARD_COLUMNS.map(a=>(0,b.jsxs)("button",{type:"button",className:q,onClick:()=>{l(f,a.id),k()},children:[g===a.id?(0,b.jsx)(t.Check,{className:"h-3 w-3 mr-2 flex-shrink-0"}):(0,b.jsx)("span",{className:"w-5 flex-shrink-0"}),a.label]},a.id)),(0,b.jsx)("hr",{className:"my-1 border-border"}),(0,b.jsx)("button",{type:"button",className:`${q} ${h?"opacity-50 cursor-not-allowed":""}`,disabled:h,onClick:()=>{h||(m(f),k())},children:n("board.contextMenu.launch")}),"DONE"!==g&&"CANCELLED"!==g&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("hr",{className:"my-1 border-border"}),(0,b.jsx)("button",{type:"button",className:q,onClick:()=>{o.push(`/workspaces/${j}/tasks/${f}`),k()},children:n("board.contextMenu.goToDetail")})]})]});return"u"<typeof document?null:(0,s.createPortal)(r,document.body)}var w=a.i(643228),x=a.i(859103);let y=(0,e.default)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);var z=a.i(514126),A=a.i(336771),B=a.i(690251),C=a.i(975231);let D=(0,e.default)("pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);var E=a.i(786304),F=a.i(785259),G=a.i(335732),H=a.i(551578);function I({task:a,onClick:c,onEdit:d,onDelete:e,onTogglePin:f,onContextMenu:g}){let{t:h}=(0,i.useI18n)(),{attributes:j,listeners:k,setNodeRef:l,transform:m,transition:p,isDragging:q}=(0,x.useSortable)({id:a.id,data:{type:"task",task:a}}),r={transform:z.CSS.Transform.toString(m),transition:p,opacity:q?.4:1},s=u.PRIORITY_CONFIG[a.priority],t=!!a.baseBranch;return(0,b.jsxs)("div",{ref:l,style:r,...j,...k,className:"group cursor-grab rounded-lg border border-border bg-card p-3 transition-all hover:border-primary/20 hover:bg-accent/50 active:cursor-grabbing",onClick:c,onContextMenu:b=>{b.preventDefault(),b.stopPropagation(),g?.(a,b.clientX,b.clientY)},"data-testid":"task-card",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between",children:[(0,b.jsx)("h4",{className:"text-sm font-medium text-foreground",children:a.title}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0",children:[(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-xs",className:`transition-all ${a.pinned?"text-primary opacity-100":"text-muted-foreground opacity-0 group-hover:opacity-100"}`,onClick:b=>{b.stopPropagation(),f?.(a.id)},"aria-label":h(a.pinned?"board.unpin":"board.pin"),children:(0,b.jsx)(D,{className:`h-3.5 w-3.5 ${a.pinned?"-rotate-45":""}`})}),(0,b.jsxs)(G.DropdownMenu,{children:[(0,b.jsx)(G.DropdownMenuTrigger,{render:(0,b.jsx)("button",{className:"rounded-md p-0.5 text-muted-foreground opacity-0 transition-all hover:bg-background hover:text-foreground group-hover:opacity-100",onClick:a=>a.stopPropagation()}),children:(0,b.jsx)(A.MoreHorizontal,{className:"h-4 w-4"})}),(0,b.jsxs)(G.DropdownMenuContent,{align:"end",children:[(0,b.jsxs)(G.DropdownMenuItem,{onClick:b=>{b.stopPropagation(),d?.(a)},children:[(0,b.jsx)(B.Pencil,{className:"mr-2 h-3.5 w-3.5"}),h("common.edit")]}),(0,b.jsxs)(G.DropdownMenuItem,{className:"text-rose-400",onClick:b=>{b.stopPropagation(),e?.(a.id)},children:[(0,b.jsx)(C.Trash2,{className:"mr-2 h-3.5 w-3.5"}),h("common.delete")]})]})]})]})]}),a.description&&(0,b.jsx)("p",{className:"mt-1.5 line-clamp-3 text-xs leading-relaxed text-muted-foreground",children:a.description}),(0,b.jsxs)("div",{className:"mt-2.5 flex flex-wrap items-center gap-1.5",children:[(0,b.jsx)(E.Badge,{variant:"secondary",className:`text-[10px] font-semibold ${s.color}`,children:s.label}),a.labels?.map(a=>(0,b.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:a.label.color+"20",color:a.label.color},children:a.label.name},a.label.id)),(t||a.version)&&(0,b.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[t&&(0,b.jsxs)(F.Tooltip,{disableHoverablePopup:!0,children:[(0,b.jsx)(F.TooltipTrigger,{render:(0,b.jsx)("span",{className:"inline-flex cursor-default items-center rounded-md border border-border bg-muted px-1 py-0.5 text-muted-foreground",onPointerDown:a=>a.stopPropagation(),children:(0,b.jsx)(n.GitBranch,{className:"h-2.5 w-2.5 shrink-0"})})}),(0,b.jsx)(F.TooltipContent,{side:"top",children:h("board.card.worktree",{branch:a.baseBranch??""})})]}),a.version&&(0,b.jsxs)(F.Tooltip,{disableHoverablePopup:!0,children:[(0,b.jsx)(F.TooltipTrigger,{render:(0,b.jsx)("span",{className:"cursor-default",onPointerDown:a=>a.stopPropagation(),children:(0,b.jsx)(H.TaskVersionTag,{number:a.version.number,title:""})})}),(0,b.jsx)(F.TooltipContent,{side:"top",children:h("board.card.version",{number:a.version.number,name:a.version.name})})]})]})]})]})}var J=a.i(814574),K=a.i(269876);function L({open:a,onOpenChange:c,columnLabel:d,columnColor:e,tasks:f,onTaskClick:g}){let{t:h}=(0,i.useI18n)();return(0,b.jsx)(J.Dialog,{open:a,onOpenChange:c,children:(0,b.jsxs)(J.DialogContent,{className:"sm:max-w-6xl max-h-[80vh]",children:[(0,b.jsx)(J.DialogHeader,{children:(0,b.jsxs)(J.DialogTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:`h-2.5 w-2.5 rounded-full ${e}`}),(0,b.jsx)("span",{children:d}),(0,b.jsx)("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-xs font-mono font-medium text-muted-foreground",children:f.length})]})}),(0,b.jsx)(K.ScrollArea,{className:"max-h-[680px]",children:(0,b.jsxs)("div",{className:"grid grid-cols-4 gap-3 pr-3",children:[f.map(a=>{let d=u.PRIORITY_CONFIG[a.priority];return(0,b.jsxs)("div",{className:"cursor-pointer rounded-lg border border-border bg-card p-3 transition-all hover:border-primary/20 hover:bg-accent/50",onClick:()=>{g?.(a),c(!1)},children:[(0,b.jsx)("h4",{className:"text-sm font-medium text-foreground line-clamp-2",children:a.title}),a.description&&(0,b.jsx)("p",{className:"mt-1.5 line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:a.description}),(0,b.jsxs)("div",{className:"mt-2 flex items-center gap-1.5 flex-wrap",children:[(0,b.jsx)(E.Badge,{variant:"secondary",className:`text-[10px] font-semibold ${d.color}`,children:d.label}),a.labels?.map(a=>(0,b.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:a.label.color+"20",color:a.label.color},children:a.label.name},a.label.id))]})]},a.id)}),0===f.length&&(0,b.jsx)("div",{className:"col-span-4 py-8 text-center text-sm text-muted-foreground",children:h("board.noTasks")})]})})]})})}function M({id:a,label:d,color:e,tasks:f,onTaskClick:g,onEditTask:h,onAddTask:j,onDeleteTask:k,onTogglePin:m,onContextMenu:n}){let{setNodeRef:p,isOver:q}=(0,w.useDroppable)({id:a}),[r,s]=(0,c.useState)(!1),{t}=(0,i.useI18n)();return(0,b.jsxs)("div",{className:`flex w-0 min-w-[220px] flex-1 flex-col min-h-0 border-r border-border/50 last:border-r-0 transition-colors ${q?"bg-primary/[0.06]":""}`,children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 border-b border-border/30",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:`h-2 w-2 rounded-full ${e}`}),(0,b.jsx)("span",{className:"text-xs font-semibold tracking-wide text-secondary-foreground",children:d}),(0,b.jsx)("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] font-mono font-medium text-muted-foreground",children:f.length})]}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-xs",onClick:()=>s(!0),className:"text-muted-foreground","aria-label":t("board.viewAll"),children:(0,b.jsx)(y,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-xs",onClick:j,className:"text-muted-foreground","aria-label":"add",children:(0,b.jsx)(l.Plus,{className:"h-3.5 w-3.5"})})]})]}),(0,b.jsx)(L,{open:r,onOpenChange:s,columnLabel:d,columnColor:e,tasks:f,onTaskClick:g}),(0,b.jsx)(K.ScrollArea,{className:"flex-1 min-h-0",children:(0,b.jsx)("div",{ref:p,className:"flex flex-col gap-2 p-2",children:(0,b.jsx)(x.SortableContext,{items:f.map(a=>a.id),strategy:x.verticalListSortingStrategy,children:f.map(a=>(0,b.jsx)(I,{task:a,onClick:()=>g?.(a),onEdit:h,onDelete:k,onTogglePin:m,onContextMenu:n},a.id))})})})]})}function N({initialTasks:a,onTaskMove:d,onTaskClick:e,onEditTask:f,onAddTask:g,onDeleteTask:h,onTogglePin:i,onContextMenuStatusChange:j,onContextMenuLaunch:k,workspaceId:l}){let[m,n]=(0,c.useState)(a),[o,p]=(0,c.useState)(null),[q,r]=(0,c.useState)(null);(0,c.useEffect)(()=>{n(a)},[a]);let s=(0,w.useSensors)((0,w.useSensor)(w.PointerSensor,{activationConstraint:{distance:8}})),t=(0,c.useCallback)((a,b,c)=>{r({task:a,x:b,y:c})},[]),x=(0,c.useCallback)(a=>{let b=m.find(b=>b.id===a.active.id);b&&p(b)},[m]),y=(0,c.useCallback)(a=>{let b,{active:c,over:e}=a;if(p(null),!e)return;let f=c.id,g=e.id;if(u.BOARD_COLUMNS.some(a=>a.id===g))b=g;else{let a=m.find(a=>a.id===g);b=a?.status}b&&(n(a=>a.map(a=>a.id===f?{...a,status:b}:a)),d?.(f,b))},[m,d]);return(0,b.jsxs)(w.DndContext,{id:"kanban-board",sensors:s,collisionDetection:w.closestCorners,onDragStart:x,onDragEnd:y,children:[(0,b.jsx)("div",{className:"mx-2 flex h-full overflow-x-auto rounded-xl border border-border bg-card/50",children:u.BOARD_COLUMNS.map(a=>(0,b.jsx)(M,{id:a.id,label:a.label,color:a.color,tasks:m.filter(b=>b.status===a.id),onTaskClick:e,onEditTask:f,onAddTask:()=>g?.(a.id),onDeleteTask:h,onTogglePin:i,onContextMenu:t},a.id))}),(0,b.jsx)(w.DragOverlay,{children:o?(0,b.jsx)("div",{className:"rotate-3 scale-105",children:(0,b.jsx)(I,{task:o})}):null}),q&&(0,b.jsx)(v,{x:q.x,y:q.y,taskId:q.task.id,currentStatus:q.task.status,hasExecutions:(q.task._count?.executions??0)>0,workspaceId:l??"",onClose:()=>r(null),onStatusChange:(a,b)=>{j?.(a,b),r(null)},onLaunch:a=>{k?.(a),r(null)}})]})}var O=a.i(445798),P=a.i(442620),Q=a.i(10390),R=a.i(350739),S=a.i(347165);let T=(0,e.default)("git-commit-vertical",[["path",{d:"M12 3v6",key:"1holv5"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M12 15v6",key:"a9ows0"}]]);var U=a.i(616335),V=a.i(704494),W=a.i(394259),X=a.i(625892),Y=a.i(939859),Z=a.i(648512),$=a.i(22761),_=a.i(429246),aa=a.i(780410);let ab=(0,aa.createServerReference)("60e5bd011dc6a4e5a4e590212faf0b52070559e282",aa.callServer,void 0,aa.findSourceMapURL,"updateProject");var ac=a.i(151758);let ad=(0,aa.createServerReference)("40ad6d9d9fc9f4271dc88f0a6f0ce0b998e9c1942a",aa.callServer,void 0,aa.findSourceMapURL,"deleteProject"),ae=(0,aa.createServerReference)("40263d9083d759e6c0f7b43b32a9046b7104f50c87",aa.callServer,void 0,aa.findSourceMapURL,"getRecentLocalProjects"),af=(0,aa.createServerReference)("407dd144dadc927c501a20a311504bf49531c43078",aa.callServer,void 0,aa.findSourceMapURL,"getOrCreateTowerTaskId");var ag=a.i(658765),ah=a.i(489123),ai=a.i(930824),aj=a.i(120755),ak=a.i(952313),al=a.i(43775),am=a.i(487410);function an({commits:a}){let{t:d}=(0,i.useI18n)(),[e,f]=(0,c.useState)(!1);return 0===a.length?null:(0,b.jsxs)("div",{children:[(0,b.jsxs)("button",{onClick:()=>f(!e),className:"flex w-full items-center justify-between py-1",children:[(0,b.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:d("git.commitLog")}),e?(0,b.jsx)(P.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,b.jsx)(Q.ChevronRight,{className:"h-3 w-3 text-muted-foreground"})]}),e&&(0,b.jsx)("div",{className:"mt-1.5 space-y-0.5 max-h-64 overflow-y-auto",children:a.map(a=>(0,b.jsxs)("div",{className:"group flex items-start gap-2 rounded-md px-2 py-1.5 hover:bg-accent transition-colors",children:[(0,b.jsx)(T,{className:"h-3 w-3 shrink-0 text-muted-foreground mt-0.5"}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("p",{className:"text-xs text-foreground line-clamp-1",children:a.message}),(0,b.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,b.jsxs)("button",{onClick:()=>{navigator.clipboard.writeText(a.shortHash),ak.toast.success(`Copied ${a.shortHash}`)},className:"flex items-center gap-0.5 font-mono text-[10px] text-primary/70 hover:text-primary transition-colors",children:[a.shortHash,(0,b.jsx)($.Copy,{className:"h-2.5 w-2.5 opacity-0 group-hover:opacity-100 transition-opacity"})]}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:a.author}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(a){let b=Math.floor((Date.now()-new Date(a).getTime())/6e4);if(b<1)return"just now";if(b<60)return`${b}m`;let c=Math.floor(b/60);if(c<24)return`${c}h`;let d=Math.floor(c/24);return d<30?`${d}d`:`${Math.floor(d/30)}mo`}(a.date)})]})]})]},a.hash))})]})}var ao=a.i(607219),ap=a.i(324263),aq=a.i(7285);function ar({localPath:a,stashes:d,hasChanges:e,onRefresh:f}){let{t:g}=(0,i.useI18n)(),[h,j]=(0,c.useState)(!1),[k,l]=(0,c.useState)(!1),[m,n]=(0,c.useState)(""),[q,r]=(0,c.useState)(null),s=async()=>{l(!0);try{await (0,aq.gitAction)(a,"stash-save",{message:m}),n(""),ak.toast.success(g("git.stashSaved")),await f()}catch(a){ak.toast.error(a instanceof Error?a.message:String(a))}finally{l(!1)}},t=async b=>{r(b);try{await (0,aq.gitAction)(a,"stash-pop",{index:b}),ak.toast.success(g("git.stashApplied")),await f()}catch(a){ak.toast.error(a instanceof Error?a.message:String(a))}finally{r(null)}},u=async b=>{r(b);try{await (0,aq.gitAction)(a,"stash-drop",{index:b}),ak.toast.success(g("git.stashDropped")),await f()}catch(a){ak.toast.error(a instanceof Error?a.message:String(a))}finally{r(null)}};return e||0!==d.length?(0,b.jsxs)("div",{children:[(0,b.jsxs)("button",{onClick:()=>j(!h),className:"flex w-full items-center justify-between py-1",children:[(0,b.jsxs)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[g("git.stash")," ",d.length>0&&`(${d.length})`]}),h?(0,b.jsx)(P.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,b.jsx)(Q.ChevronRight,{className:"h-3 w-3 text-muted-foreground"})]}),h&&(0,b.jsxs)("div",{className:"mt-1.5 space-y-2",children:[e&&(0,b.jsxs)("div",{className:"flex gap-1.5",children:[(0,b.jsx)(p.Input,{value:m,onChange:a=>n(a.target.value),placeholder:g("git.stashMsgPlaceholder"),className:"h-7 text-xs flex-1",onKeyDown:a=>"Enter"===a.key&&s()}),(0,b.jsx)(o.Button,{variant:"outline",size:"icon-sm",onClick:s,disabled:k,className:"shrink-0",children:k?(0,b.jsx)(V.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(ao.Archive,{className:"h-3 w-3"})})]}),d.length>0&&(0,b.jsx)("div",{className:"space-y-0.5",children:d.map(a=>(0,b.jsxs)("div",{className:"group flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-accent transition-colors",children:[(0,b.jsx)(ao.Archive,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,b.jsx)("span",{className:"flex-1 min-w-0 truncate text-xs text-foreground",children:a.message||`stash@{${a.index}}`}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-xs",onClick:()=>t(a.index),disabled:q===a.index,className:"text-muted-foreground","aria-label":g("git.stashApply"),children:q===a.index?(0,b.jsx)(V.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(ap.ArrowUpFromLine,{className:"h-3 w-3"})}),(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-xs",onClick:()=>u(a.index),disabled:q===a.index,className:"text-rose-400","aria-label":g("git.stashDrop"),children:(0,b.jsx)(C.Trash2,{className:"h-3 w-3"})})]})]},a.index))})]})]}):null}var as=a.i(985716);function at({value:a,ariaLabel:d}){let{t:e}=(0,i.useI18n)(),[f,g]=(0,c.useState)(!1),h=async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(a);else{let b=document.createElement("textarea");b.value=a,document.body.appendChild(b),b.select(),document.execCommand("copy"),document.body.removeChild(b)}g(!0),ak.toast.success(e("common.copied")),setTimeout(()=>g(!1),1500)}catch{ak.toast.error(e("common.copyFailed"))}};return(0,b.jsxs)("div",{className:"flex items-center gap-1 rounded-md border border-border bg-muted/50 pl-3 pr-1 py-1.5",children:[(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",title:a,children:a}),(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{render:(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-xs",className:"shrink-0 text-muted-foreground","aria-label":d,onClick:h,children:f?(0,b.jsx)(t.Check,{className:"h-3 w-3 text-emerald-400"}):(0,b.jsx)($.Copy,{className:"h-3 w-3"})})}),(0,b.jsx)(F.TooltipContent,{children:f?e("common.copied"):e("common.copy")})]})]})}function au({project:a,workspaceId:e}){let{t:f,locale:g}=(0,i.useI18n)(),h=(0,d.useRouter)(),[j,k]=(0,c.useState)(!0),[l,m]=(0,c.useState)(!0),[q,r]=(0,c.useState)(!1),[s,t]=(0,c.useState)(!1),[u,v]=(0,c.useState)(""),[w,x]=(0,c.useState)(!1),[y,z]=(0,c.useState)(!1),[A,D]=(0,c.useState)(!1),[E,G]=(0,c.useState)(a.name),[H,I]=(0,c.useState)(a.alias??""),[K,L]=(0,c.useState)(a.description??""),[M,N]=(0,c.useState)(a.localPath??""),[O,$]=(0,c.useState)(a.projectType??"FRONTEND"),[aa,ao]=(0,c.useState)([]);(0,c.useEffect)(()=>{ae(100).then(ao)},[]);let[ap,aq]=(0,c.useState)(!1),[av,aw]=(0,c.useState)(""),[ax,ay]=(0,c.useState)(""),[az,aA]=(0,c.useState)(""),[aB,aC]=(0,c.useState)(""),[aD,aE]=(0,c.useState)("FRONTEND"),[aF,aG]=(0,c.useState)(!1),[aH,aI]=(0,c.useState)(!1),[aJ,aK]=(0,c.useState)(null),[aL,aM]=(0,c.useState)(!1),[aN,aO]=(0,c.useState)(!1),aP=a=>{ak.toast.info(a)},aQ=(0,c.useCallback)(async()=>{if(a.localPath){aM(!0);try{let b=await fetch(`/api/git?path=${encodeURIComponent(a.localPath)}`);b.ok&&aK(await b.json())}catch{}finally{aM(!1)}}},[a.localPath]);(0,c.useEffect)(()=>{aQ()},[aQ]);let aR=async()=>{if(a.localPath){aO(!0);try{(await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"init",path:a.localPath})})).ok?(aP(f("git.initSuccess")),await aQ()):aP(f("git.initFailed"))}catch{aP(f("git.initFailed"))}finally{aO(!1)}}},aS=(a,b)=>{h.push(`/workspaces/${a}?projectId=${b}`,{scroll:!1}),h.refresh()},aT=async()=>{if(ax.trim()){aG(!0);try{let a=await (0,ac.createProject)({name:ax.trim(),alias:az.trim()||void 0,description:aB.trim()||void 0,localPath:av,projectType:aD,workspaceId:e});aq(!1),aS(e,a.id)}catch(a){ak.toast.error(a instanceof Error?a.message:String(a))}finally{aG(!1)}}},aU=async()=>{if(M&&!aH){aI(!0);try{let a=await (0,aj.analyzeProjectDirectory)(M.trim(),g);L(a)}catch{ak.toast.error(f("project.analyzeError"))}finally{aI(!1)}}},aV=async()=>{try{await ab(a.id,{name:E.trim(),alias:H.trim()||void 0,description:K.trim()||void 0,localPath:M.trim()||void 0,projectType:O}),h.refresh(),r(!1)}catch(a){ak.toast.error(a instanceof Error?a.message:String(a))}};return(0,b.jsxs)("aside",{className:"relative w-72 flex-shrink-0 overflow-y-auto border-l border-border bg-sidebar",children:[(0,b.jsxs)("div",{className:"border-b border-border p-4",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("h2",{className:"text-base font-semibold text-foreground",children:a.name}),a.alias&&(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:a.alias})]}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{G(a.name),I(a.alias??""),L(a.description??""),N(a.localPath??""),r(!0)},className:"text-muted-foreground",children:(0,b.jsx)(B.Pencil,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{v(""),t(!0)},className:"text-muted-foreground hover:text-rose-400",children:(0,b.jsx)(C.Trash2,{className:"h-3.5 w-3.5"})})]})]}),a.description&&(0,b.jsx)("p",{className:"mt-2 text-sm text-secondary-foreground leading-relaxed line-clamp-4",children:a.description}),(0,b.jsx)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:(0,b.jsx)("span",{className:`inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-[11px] font-medium ${"GIT"===a.type?"bg-sky-500/15 text-sky-300 ring-1 ring-sky-500/20":"bg-muted text-muted-foreground ring-1 ring-border"}`,children:"GIT"===a.type?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(n.GitBranch,{className:"h-3 w-3"}),f("sidebar.right.gitType")]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(R.FileText,{className:"h-3 w-3"}),f("sidebar.right.normalType")]})})}),(a.localPath||a.gitUrl)&&(0,b.jsxs)("div",{className:"mt-3 space-y-1.5",children:[a.localPath&&(0,b.jsx)(at,{value:a.localPath,ariaLabel:f("project.localPath")}),a.gitUrl&&(0,b.jsx)(at,{value:a.gitUrl,ariaLabel:f("project.gitUrl")})]}),a.localPath&&(0,b.jsxs)("div",{className:"mt-3 space-y-1.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{render:(0,b.jsx)(o.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,ag.openInFileManager)(a.localPath)}catch(a){console.error("openInFileManager failed:",a),ak.toast.error(f("git.openInFileManagerFailed"))}},children:(0,b.jsx)(X.FolderSearch,{className:"h-4 w-4"})})}),(0,b.jsx)(F.TooltipContent,{children:f("git.openInFileManager")})]}),(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{render:(0,b.jsx)(o.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,ah.openInEditor)(a.localPath)}catch(a){console.error("openInEditor failed:",a),ak.toast.error(f("git.openInEditorFailed"))}},children:(0,b.jsx)(Y.Code,{className:"h-4 w-4"})})}),(0,b.jsx)(F.TooltipContent,{children:f("git.openInEditor")})]}),(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{render:(0,b.jsx)(o.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,ai.openInTerminal)(a.localPath)}catch(a){console.error("openInTerminal failed:",a),ak.toast.error(f("git.openInTerminalFailed"))}},children:(0,b.jsx)(Z.Terminal,{className:"h-4 w-4"})})}),(0,b.jsx)(F.TooltipContent,{children:f("git.openInTerminal")})]})]}),(0,b.jsxs)(o.Button,{variant:"outline",className:"w-full h-9 gap-1.5 text-xs",disabled:y,onClick:async()=>{z(!0);try{let b=await af(a.id);h.push(`/workspaces/${e}/tasks/${b}`)}catch{ak.toast.error(f("git.openStudioFailed"))}finally{z(!1)}},children:[y?(0,b.jsx)(V.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(S.FolderOpen,{className:"h-3.5 w-3.5"}),f("git.openStudio")]})]})]}),(0,b.jsxs)("div",{className:"border-b border-border p-4",children:[(0,b.jsxs)(o.Button,{variant:"ghost",onClick:()=>k(!j),className:"flex w-full cursor-pointer justify-between px-2 py-2",children:[(0,b.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:f("git.section")}),j?(0,b.jsx)(P.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,b.jsx)(Q.ChevronRight,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),j&&(0,b.jsx)("div",{className:"mt-3",children:a.localPath?aL?(0,b.jsxs)("div",{className:"flex items-center justify-center py-4 text-muted-foreground",children:[(0,b.jsx)(V.Loader2,{className:"h-4 w-4 animate-spin"}),(0,b.jsx)("span",{className:"ml-2 text-xs",children:f("git.loading")})]}):aJ&&!aJ.isGit?(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-muted/50 p-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,b.jsx)(U.AlertCircle,{className:"h-3.5 w-3.5"}),(0,b.jsx)("p",{className:"text-xs",children:f("git.notInitialized")})]}),(0,b.jsxs)(o.Button,{className:"mt-3 h-7 w-full gap-1.5 bg-primary/10 text-xs text-primary ring-1 ring-primary/20 hover:bg-primary/15",onClick:aR,disabled:aN,children:[aN?(0,b.jsx)(V.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(T,{className:"h-3 w-3"}),f("git.initRepo")]})]}):aJ?.isGit?(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)("div",{className:"flex flex-col",children:(0,b.jsx)(as.EditorGitPanel,{localPath:a.localPath,mode:"project"})}),(0,b.jsx)(an,{commits:aJ.commits??[]}),(0,b.jsx)(ar,{localPath:a.localPath,stashes:aJ.stashes??[],hasChanges:(aJ.changedFiles??[]).length>0,onRefresh:aQ})]}):null:(0,b.jsx)("div",{className:"rounded-lg border border-border bg-muted/50 p-3",children:(0,b.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,b.jsx)(U.AlertCircle,{className:"h-3.5 w-3.5"}),(0,b.jsx)("p",{className:"text-xs",children:f("git.noLocalPath")})]})})})]}),(0,b.jsxs)("div",{className:"p-4",children:[(0,b.jsxs)(o.Button,{variant:"ghost",onClick:()=>m(!l),className:"flex w-full cursor-pointer justify-between px-2 py-2",children:[(0,b.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:f("sidebar.right.browseRepo")}),l?(0,b.jsx)(P.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,b.jsx)(Q.ChevronRight,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),l&&(0,b.jsxs)("div",{className:"mt-3 space-y-3",children:[(0,b.jsxs)(o.Button,{variant:"outline",className:"w-full h-8 gap-1.5 text-xs",onClick:()=>D(!0),children:[(0,b.jsx)(S.FolderOpen,{className:"h-3.5 w-3.5"}),f("sidebar.right.browseRepo")]}),aa.length>0&&(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5 px-1",children:f("sidebar.right.recent")}),(0,b.jsx)("div",{className:"space-y-0.5",children:aa.map(c=>(0,b.jsxs)("button",{onClick:()=>{c.id!==a.id&&aS(c.workspaceId,c.id)},className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors ${c.id===a.id?"bg-primary/10 text-primary cursor-default":"hover:bg-accent cursor-pointer"}`,children:["GIT"===c.type?(0,b.jsx)(n.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}):(0,b.jsx)(S.FolderOpen,{className:"h-3 w-3 shrink-0 text-primary/70"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("p",{className:"truncate text-xs font-medium text-foreground",children:c.name}),c.localPath&&(0,b.jsx)("p",{className:"truncate text-[10px] font-mono text-muted-foreground",children:c.localPath})]})]},c.id))})]})]})]}),(0,b.jsx)(J.Dialog,{open:q,onOpenChange:r,children:(0,b.jsxs)(J.DialogContent,{style:{maxWidth:"32rem"},children:[(0,b.jsx)(J.DialogHeader,{children:(0,b.jsx)(J.DialogTitle,{children:f("project.edit")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.name")}),(0,b.jsx)(p.Input,{value:E,onChange:a=>G(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.type.label")}),(0,b.jsx)("div",{className:"mt-1.5",children:(0,b.jsx)(am.SegmentedControl,{options:[{value:"FRONTEND",label:f("project.type.frontend")},{value:"BACKEND",label:f("project.type.backend")}],value:O,onChange:$})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.alias")}),(0,b.jsx)(p.Input,{value:H,onChange:a=>I(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.description")}),(0,b.jsxs)(o.Button,{type:"button",variant:"ghost",onClick:aU,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!M||aH?"opacity-50":""}`,children:[aH?(0,b.jsx)(V.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(W.Sparkles,{className:"h-3 w-3"}),aH?f("project.analyzing"):f("project.genDesc")]})]}),(0,b.jsx)(_.Textarea,{value:K,onChange:a=>L(a.target.value),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.localPath")}),(0,b.jsx)("div",{className:"mt-1.5 break-all rounded-md border border-border bg-muted/50 px-3 py-2 font-mono text-xs text-muted-foreground",children:M||"—"})]})]}),(0,b.jsxs)(J.DialogFooter,{children:[(0,b.jsx)(o.Button,{variant:"outline",onClick:()=>r(!1),children:f("common.cancel")}),(0,b.jsx)(o.Button,{onClick:aV,disabled:!E.trim()||aH,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:f("common.save")})]})]})}),(0,b.jsx)(al.FolderBrowserDialog,{open:A,onOpenChange:D,onSelect:a=>{q?N(a):(a=>{let b=aa.find(b=>b.localPath===a);if(b)return aS(b.workspaceId,b.id);let c=a.split("/").filter(Boolean).pop()??"";aw(a),ay(c),aA(""),aC(""),aq(!0)})(a)}}),(0,b.jsx)(J.Dialog,{open:ap,onOpenChange:aq,children:(0,b.jsxs)(J.DialogContent,{className:"sm:max-w-md",children:[(0,b.jsx)(J.DialogHeader,{children:(0,b.jsx)(J.DialogTitle,{children:f("topbar.newProject")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.localPath")}),(0,b.jsx)("div",{className:"mt-1.5 rounded-md border border-border bg-muted/50 px-3 py-2 font-mono text-xs text-muted-foreground",children:av})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.name")}),(0,b.jsx)(p.Input,{value:ax,onChange:a=>ay(a.target.value),placeholder:f("project.namePlaceholder"),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.type.label")}),(0,b.jsx)("div",{className:"mt-1.5",children:(0,b.jsx)(am.SegmentedControl,{options:[{value:"FRONTEND",label:f("project.type.frontend")},{value:"BACKEND",label:f("project.type.backend")}],value:aD,onChange:aE})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.alias")}),(0,b.jsx)(p.Input,{value:az,onChange:a=>aA(a.target.value),placeholder:f("project.aliasPlaceholder"),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.description")}),(0,b.jsx)(_.Textarea,{value:aB,onChange:a=>aC(a.target.value),placeholder:f("project.descPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,b.jsxs)(J.DialogFooter,{children:[(0,b.jsx)(o.Button,{variant:"outline",onClick:()=>aq(!1),children:f("common.cancel")}),(0,b.jsxs)(o.Button,{onClick:aT,disabled:!ax.trim()||aF,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[aF?(0,b.jsx)(V.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,f("common.create")]})]})]})}),(0,b.jsx)(J.Dialog,{open:s,onOpenChange:a=>{t(a),a||v("")},children:(0,b.jsxs)(J.DialogContent,{className:"sm:max-w-md",children:[(0,b.jsx)(J.DialogHeader,{children:(0,b.jsx)(J.DialogTitle,{className:"text-rose-400",children:f("project.deleteTitle")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:f("project.deleteWarning",{name:a.name})}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:f("project.deleteIrreversible")}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.deleteConfirmLabel")}),(0,b.jsx)(p.Input,{value:u,onChange:a=>v(a.target.value),placeholder:f("project.deleteConfirmPlaceholder"),className:"mt-1.5",autoFocus:!0})]})]}),(0,b.jsxs)(J.DialogFooter,{children:[(0,b.jsx)(o.Button,{variant:"outline",onClick:()=>t(!1),children:f("common.cancel")}),(0,b.jsxs)(o.Button,{variant:"destructive",disabled:u!==f("project.deleteConfirmText")||w,onClick:async()=>{x(!0);try{await ad(a.id),ak.toast.success(f("project.deleteSuccess")),h.push(`/workspaces/${e}`)}catch{ak.toast.error(f("project.deleteFailed"))}finally{x(!1),t(!1)}},children:[w&&(0,b.jsx)(V.Loader2,{className:"h-3 w-3 animate-spin mr-1"}),f("project.deleteButton")]})]})]})})]})}var av=a.i(963326),aw=a.i(300141),ax=a.i(913284),ay=a.i(269280),az=a.i(368114);function aA({title:a,description:c,branch:d,baseBranch:e,version:f,hasConversation:g,updatedAt:h,openDir:j,onBack:k}){let{t:l}=(0,i.useI18n)();return(0,b.jsxs)("div",{className:"border-b border-border px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(W.Sparkles,{className:"h-3.5 w-3.5 text-primary"}),(0,b.jsx)("span",{className:"text-xs font-semibold text-primary",children:l("taskDetail.title")})]}),(0,b.jsxs)(o.Button,{variant:"ghost",onClick:k,className:"flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground h-auto px-2 py-1",children:[(0,b.jsx)(ay.ArrowLeft,{className:"h-3.5 w-3.5"}),l("taskDetail.back")]})]}),(0,b.jsx)("h2",{className:"mt-2.5 text-lg font-bold tracking-tight text-foreground",children:a}),c&&(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:c}),(0,b.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[e?(0,b.jsxs)(E.Badge,{variant:"secondary",className:"bg-muted text-muted-foreground text-[10px] font-mono border border-border",children:[(0,b.jsx)(n.GitBranch,{className:"mr-1 h-3 w-3"}),e," · worktree"]}):d?(0,b.jsx)(E.Badge,{variant:"secondary",className:"bg-muted text-muted-foreground text-[10px] font-mono border border-border",children:l("taskDetail.directMode")}):null,f&&(0,b.jsx)(H.TaskVersionTag,{number:f.number,name:f.name,showName:!0}),g&&(0,b.jsx)(E.Badge,{variant:"secondary",className:"bg-emerald-500/10 text-emerald-400 text-[10px] border border-emerald-500/20",children:l("taskDetail.hasConversation")}),(0,b.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[l("taskDetail.updatedAt")," ",(0,az.formatRelativeTime)(h)]}),j&&(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-0.5",children:[(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{render:(0,b.jsx)(o.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,ag.openInFileManager)(j)}catch(a){console.error("openInFileManager failed:",a),ak.toast.error(l("git.openInFileManagerFailed"))}},children:(0,b.jsx)(X.FolderSearch,{className:"h-3.5 w-3.5"})})}),(0,b.jsx)(F.TooltipContent,{side:"bottom",children:l("git.openInFileManager")})]}),(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{render:(0,b.jsx)(o.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,ah.openInEditor)(j)}catch(a){console.error("openInEditor failed:",a),ak.toast.error(l("git.openInEditorFailed"))}},children:(0,b.jsx)(Y.Code,{className:"h-3.5 w-3.5"})})}),(0,b.jsx)(F.TooltipContent,{side:"bottom",children:l("git.openInEditor")})]}),(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{render:(0,b.jsx)(o.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,ai.openInTerminal)(j)}catch(a){console.error("openInTerminal failed:",a),ak.toast.error(l("git.openInTerminalFailed"))}},children:(0,b.jsx)(Z.Terminal,{className:"h-3.5 w-3.5"})})}),(0,b.jsx)(F.TooltipContent,{side:"bottom",children:l("git.openInTerminal")})]})]})]})]})}var aB=a.i(639138),aC=a.i(88757),aD=a.i(347872),aE=a.i(766663),aF=a.i(83801),aG=a.i(569992),aH=a.i(968254),aI=a.i(226315),aJ=a.i(427535),aK=a.i(162205),aL=a.i(958071),aM=a.i(103949),aN=a.i(715525),aO=a.i(324954);let aP=(0,e.default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);var aQ=a.i(54384),aR=a.i(509405),aS=a.i(77549);let aT=(0,aa.createServerReference)("4003a6d574d9f373c55d94ccf731f0012b5d2a4583",aa.callServer,void 0,aa.findSourceMapURL,"getTaskNotes");var aU=a.i(33205);let aV=(0,aa.createServerReference)("40b6a2f1f07f2adcf3dbe3460b438699bf2223929e",aa.callServer,void 0,aa.findSourceMapURL,"getTaskAssets");var aW=a.i(803618),aX=a.i(779623),aY=a.i(532615),aZ=a.i(894148),a$=a.i(161181);let a_=/\.(txt|md|json)$/i;function a0({taskId:a,projectId:d}){let{t:e}=(0,i.useI18n)(),f=(0,c.useRef)(null),[g,h]=(0,c.useState)([]),[j,k]=(0,c.useState)([]),[m,n]=(0,c.useState)(!1),[p,q]=(0,c.useState)(""),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(!1),[v,w]=(0,c.useState)(null);async function x(){p.trim()&&(await (0,aS.createNote)({title:p.trim(),content:r.trim(),projectId:d,taskId:a,category:"task"}),q(""),s(""),n(!1),aT(a).then(h))}async function y(a){await (0,aU.deleteNote)(a),h(b=>b.filter(b=>b.id!==a))}async function z(b){let c=b.target.files?.[0];if(c){u(!0);try{let b=new FormData;b.set("file",c),b.set("projectId",d),b.set("taskId",a),await (0,aW.uploadAsset)(b),aV(a).then(k)}finally{u(!1),f.current&&(f.current.value="")}}}async function A(a){await (0,aX.deleteAsset)(a),k(b=>b.filter(b=>b.id!==a))}function B(a){return(0,a$.isImageAsset)(a.filename,a.mimeType)||a_.test(a.filename)}function D(a){B(a)?w(a):ak.toast.info(e("assets.previewNotSupported"))}async function E(a){try{let b=await fetch("/api/internal/assets/reveal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:a.path})});if(!b.ok){let a=await b.json().catch(()=>({}));ak.toast.error(a.error||"Failed to reveal file")}}catch{ak.toast.error("Failed to reveal file")}}(0,c.useEffect)(()=>{aT(a).then(h),aV(a).then(k)},[a]);let F=v?(0,a$.isImageAsset)(v.filename,v.mimeType)?"image":a_.test(v.filename)?"text":null:null,G=j.filter(a=>(0,a$.isImageAsset)(a.filename,a.mimeType)).map(a=>({id:a.id,url:(0,a$.localPathToApiUrl)(a.path),filename:a.filename})),H=v?G.findIndex(a=>a.id===v.id):-1;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(K.ScrollArea,{className:"h-full",children:(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsxs)("div",{className:"border-b border-border px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("h3",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[(0,b.jsx)(R.FileText,{className:"h-3.5 w-3.5"}),e("taskPage.notes")]}),(0,b.jsxs)(o.Button,{variant:"ghost",className:"h-6 gap-1 px-2 text-xs",onClick:()=>n(!m),children:[m?(0,b.jsx)(aQ.X,{className:"h-3 w-3"}):(0,b.jsx)(l.Plus,{className:"h-3 w-3"}),m?"":e("taskPage.addNote")]})]}),m&&(0,b.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,b.jsx)("input",{type:"text",value:p,onChange:a=>q(a.target.value),placeholder:e("taskPage.noteTitle"),className:"h-8 w-full rounded-md border border-border bg-background px-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary",autoFocus:!0}),(0,b.jsx)("textarea",{value:r,onChange:a=>s(a.target.value),placeholder:e("taskPage.noteContent"),rows:3,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary resize-none"}),(0,b.jsx)(o.Button,{className:"text-xs",onClick:x,disabled:!p.trim(),children:e("taskPage.addNote")})]}),(0,b.jsxs)("div",{className:"mt-2 space-y-2",children:[0===g.length&&!m&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:e("taskPage.noNotes")}),g.map(a=>(0,b.jsx)("div",{className:"group rounded-md border border-border bg-card p-3",children:(0,b.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("h4",{className:"text-sm font-medium truncate",children:a.title}),a.content&&(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-3 whitespace-pre-wrap",children:a.content}),(0,b.jsx)("p",{className:"mt-1 text-[10px] text-muted-foreground",children:new Date(a.createdAt).toLocaleString()})]}),(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-xs",onClick:()=>y(a.id),className:"shrink-0 text-muted-foreground opacity-0 hover:bg-destructive/10 hover:text-destructive group-hover:opacity-100",title:e("taskPage.deleteNote"),children:(0,b.jsx)(C.Trash2,{className:"h-3.5 w-3.5"})})]})},a.id))]})]}),(0,b.jsxs)("div",{className:"px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("h3",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[(0,b.jsx)(aP,{className:"h-3.5 w-3.5"}),e("taskPage.attachments")]}),(0,b.jsxs)(o.Button,{variant:"ghost",className:"h-6 gap-1 px-2 text-xs",onClick:()=>f.current?.click(),disabled:t,children:[(0,b.jsx)(aO.Upload,{className:"h-3 w-3"}),e("taskPage.uploadFile")]}),(0,b.jsx)("input",{ref:f,type:"file",className:"hidden",onChange:z})]}),(0,b.jsxs)("div",{className:"mt-2 space-y-1.5",children:[0===j.length&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:e("taskPage.noAttachments")}),j.map(a=>{var c;let d=B(a);return(0,b.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border bg-card px-3 py-2",children:[(0,b.jsx)(aP,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,b.jsx)("button",{type:"button",onClick:()=>D(a),disabled:!d,className:`min-w-0 flex-1 truncate text-left text-sm ${d?"cursor-pointer hover:underline":"cursor-default"}`,title:d?e("assets.preview"):a.filename,children:a.filename}),(0,b.jsx)("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:(c=a.size)?c<1024?`${c} B`:c<1048576?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`:""}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5",children:[d&&(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-xs",onClick:()=>D(a),className:"shrink-0 text-muted-foreground hover:bg-accent",title:e("assets.preview"),children:(0,b.jsx)(aR.Eye,{className:"h-3 w-3"})}),(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-xs",onClick:()=>E(a),className:"shrink-0 text-muted-foreground hover:bg-accent",title:e("assets.revealInFinder"),children:(0,b.jsx)(S.FolderOpen,{className:"h-3 w-3"})}),(0,b.jsx)(o.Button,{variant:"ghost",size:"icon-xs",onClick:()=>A(a.id),className:"shrink-0 text-muted-foreground hover:bg-destructive/10 hover:text-destructive",title:e("taskPage.deleteAttachment"),children:(0,b.jsx)(C.Trash2,{className:"h-3 w-3"})})]})]},a.id)})]})]})]})}),(0,b.jsx)(aY.ImageLightbox,{imageUrl:"image"===F&&H>=0?G[H].url:null,filename:"image"===F&&H>=0?G[H].filename:"",open:"image"===F,onOpenChange:a=>{a||w(null)},assets:G.map(({url:a,filename:b})=>({url:a,filename:b})),currentIndex:H>=0?H:void 0,onIndexChange:a=>{let b=G[a];if(!b)return;let c=j.find(a=>a.id===b.id);c&&w(c)}}),(0,b.jsx)(aZ.TextPreviewDialog,{url:"text"===F&&v?(0,a$.localPathToApiUrl)(v.path):null,filename:v?.filename??"",open:"text"===F,onOpenChange:a=>{a||w(null)}})]})}function a1({task:a,workspaceId:e,projectLocalPath:f,onClose:g}){let{t:h}=(0,i.useI18n)(),j=(0,d.useRouter)(),{removePortal:k}=(0,aD.useTerminalPortal)(),[l,m]=(0,c.useState)("terminal"),[n,p]=(0,c.useState)(null),[r,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(a.status);(0,c.useEffect)(()=>{u(a.status)},[a.status]);let[v,w]=(0,c.useState)(null),[x,y]=(0,c.useState)(!1),[z,A]=(0,c.useState)(!1),[B,C]=(0,c.useState)([]);(0,c.useEffect)(()=>{w(null),y(!1),A(!1),C([]),p(null),m("terminal")},[a.id]);let[D,E]=(0,c.useState)([]),[G,H]=(0,c.useState)(null);(0,c.useEffect)(()=>{let a=!1;return(0,aM.getPrompts)().then(b=>{if(a)return;E(b.map(a=>({id:a.id,name:a.name,isDefault:a.isDefault})));let c=b.find(a=>a.isDefault);c&&H(c.id)}),()=>{a=!0}},[]),(0,c.useEffect)(()=>{w(null),A(!1);let b=!1;return(0,aE.getTaskExecutions)(a.id).then(a=>{if(b)return;let c=a[0];if(c?.status==="RUNNING"){let a=c.worktreePath||f||null;a&&w(a)}C(a.filter(a=>"RUNNING"!==a.status)),A(!0)}),()=>{b=!0}},[a.id]),(0,c.useEffect)(()=>{if("changes"!==l||"TODO"===t||"CANCELLED"===t)return;let b=!1;return s(!0),fetch(`/api/tasks/${a.id}/diff`).then(a=>{if(!a.ok)throw Error(`HTTP ${a.status}`);return a.json()}).then(a=>{b||p(a?.files||a?.branchDeleted?a:null)}).catch(()=>{b||p(null)}).finally(()=>{b||s(!1)}),()=>{b=!0}},[l,t,a.id]);let I=(0,c.useCallback)(async()=>{if(!x){y(!0),k(a.id);try{let b=await (0,aF.startPtyExecutionSafe)(a.id,"",G);if(!b.ok){y(!1),ak.toast.error(b.error||h("terminal.startFailed"));return}w(b.worktreePath??null),u("IN_PROGRESS")}catch(a){y(!1),ak.toast.error(a instanceof Error&&a.message?a.message:h("terminal.startFailed"))}}},[a.id,x,G,h]),J=(0,c.useCallback)(b=>{y(!1),w(null),k(a.id),0===b&&u("IN_REVIEW"),(0,aE.getTaskExecutions)(a.id).then(a=>{C(a.filter(a=>"RUNNING"!==a.status))}),j.refresh()},[j,a.id]),L=(0,c.useCallback)(async()=>{await (0,aG.stopPtyExecution)(a.id),y(!1),k(a.id),w(null),u("IN_REVIEW"),(0,aE.getTaskExecutions)(a.id).then(a=>{C(a.filter(a=>"RUNNING"!==a.status))}),j.refresh()},[a.id,j]),M=(0,c.useCallback)(async b=>{y(!0),k(a.id),w(null);try{let{worktreePath:c}=await (0,aH.resumePtyExecution)(a.id,b);w(c),u("IN_PROGRESS")}catch{y(!1)}},[a.id,k]),N=(0,c.useCallback)(async()=>{y(!0),k(a.id),w(null);try{let{worktreePath:b}=await (0,aI.continueLatestPtyExecution)(a.id);w(b),u("IN_PROGRESS")}catch(a){y(!1),ak.toast.error(a instanceof Error?a.message:String(a))}},[a.id,k]),[O,P]=(0,c.useState)(!1),[Q,S]=(0,c.useState)([]),T=(0,c.useCallback)(async()=>{try{let b=await (0,aK.checkWorktreeClean)(a.id);if(b.hasWorktree&&!b.clean)return void ak.toast.error(h("taskPage.uncommittedChanges",{count:String(b.files.length)}));if(b.hasWorktree&&b.clean&&!b.hasCommits)return void ak.toast.error(h("taskPage.noChangesToComplete"),{action:{label:h("taskPage.markAsCancelled"),onClick:()=>{(0,aJ.updateTaskStatus)(a.id,"CANCELLED").then(()=>{u("CANCELLED"),ak.toast.success(h("taskPage.taskCancelled")),j.refresh()}).catch(()=>ak.toast.error("Failed to cancel task"))}}});if(b.hasWorktree&&b.hasCommits){S(b.commitLog),P(!0);return}await (0,aJ.updateTaskStatus)(a.id,"DONE"),u("DONE"),ak.toast.success(h("taskPage.taskCompleted")),j.refresh()}catch{ak.toast.error("Failed to complete task")}},[a.id,j,h]),U=(0,c.useCallback)(()=>{u("DONE"),P(!1),ak.toast.success(h("taskPage.taskCompleted")),j.refresh()},[j,h]),W=(0,c.useCallback)(async b=>{try{let{hash:c}=await (0,aL.commitWorktreeChanges)(a.id,b);ak.toast.success(h("diff.commitSuccess",{hash:c})),j.refresh();let d=await fetch(`/api/tasks/${a.id}/diff`);if(d.ok){let a=await d.json();p(a?.files?a:null)}}catch(a){ak.toast.error(a instanceof Error?a.message:"Commit failed")}},[a.id,j,h]);return(0,b.jsxs)("div",{className:"flex h-full w-[600px] flex-shrink-0 flex-col border-l border-border bg-sidebar","data-testid":"task-detail-panel",children:[(0,b.jsx)(aA,{title:a.title,description:h("taskDetail.panelDescription"),branch:`task/${a.id}`,baseBranch:a.baseBranch,version:a.version??null,hasConversation:!1,updatedAt:a.updatedAt,openDir:v??(f?a.subPath?`${f}/${a.subPath}`:f:null),onBack:g}),(0,b.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-2",children:[(0,b.jsxs)("div",{className:"flex gap-1",children:[(0,b.jsxs)("button",{onClick:()=>m("terminal"),className:`flex items-center gap-1.5 px-3 py-1 text-xs font-medium rounded-md ${"terminal"===l?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,b.jsx)(Z.Terminal,{className:"h-3 w-3"}),h("terminal.execute")]}),(0,b.jsx)("button",{onClick:()=>m("changes"),className:`px-3 py-1 text-xs font-medium rounded-md ${"changes"===l?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:h("taskPage.changes")}),(0,b.jsxs)("button",{onClick:()=>m("notes"),className:`flex items-center gap-1.5 px-3 py-1 text-xs font-medium rounded-md ${"notes"===l?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,b.jsx)(R.FileText,{className:"h-3 w-3"}),h("taskPage.notes")]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:["IN_REVIEW"===t&&(0,b.jsxs)(o.Button,{size:"sm",onClick:T,className:"bg-emerald-500/15 text-emerald-400 ring-1 ring-emerald-500/20 hover:bg-emerald-500/25",children:[(0,b.jsx)(ax.CheckCircle2,{className:"h-3 w-3"}),h("taskPage.completeTask")]}),"DONE"!==t&&"CANCELLED"!==t&&(0,b.jsxs)(o.Button,{variant:"ghost",size:"sm",onClick:()=>j.push(`/workspaces/${e}/tasks/${a.id}`),className:"text-muted-foreground",children:[(0,b.jsx)(av.ExternalLink,{className:"h-3 w-3"}),h("taskPage.viewDetails")]})]})]}),"terminal"===l?(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:z?v?(0,b.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,b.jsxs)("div",{className:"shrink-0 flex items-center justify-between border-b border-neutral-800 px-3 py-2 bg-[#0f1419]",children:[(0,b.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-emerald-400",children:[(0,b.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"}),h("execution.running")]}),(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsxs)(F.TooltipTrigger,{onClick:L,className:"flex items-center gap-1.5 rounded-md bg-red-500/15 px-3 py-1 text-xs font-medium text-red-400 hover:bg-red-500/25 transition-colors",children:[(0,b.jsx)(aw.Square,{className:"h-3 w-3"}),h("terminal.stopExecution")]}),(0,b.jsx)(F.TooltipContent,{side:"bottom",children:h("terminal.stopHint")})]})]}),(0,b.jsx)("div",{className:"flex-1 min-h-0",children:(0,b.jsx)(aD.TerminalOutlet,{taskId:a.id,worktreePath:v,onSessionEnd:J})})]}):"DONE"===t||"CANCELLED"===t?(0,b.jsx)("div",{className:"flex h-full flex-col overflow-hidden",children:(0,b.jsx)(K.ScrollArea,{className:"flex-1 min-h-0",children:(0,b.jsx)(aN.ExecutionTimeline,{executions:B})})}):(0,b.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,b.jsxs)("div",{className:"shrink-0 flex items-center gap-2 border-b border-border px-4 py-3",children:[D.length>0&&(0,b.jsxs)(q.Select,{defaultValue:G??"none",onValueChange:a=>H("none"===a?null:a),children:[(0,b.jsx)(q.SelectTrigger,{size:"sm",className:"min-w-[120px]",children:(0,b.jsx)("span",{className:"text-left truncate",children:G?D.find(a=>a.id===G)?.name??h("terminal.noPrompt"):h("terminal.noPrompt")})}),(0,b.jsxs)(q.SelectContent,{className:"min-w-[200px]",children:[(0,b.jsx)(q.SelectItem,{value:"none",children:h("terminal.noPrompt")}),D.map(a=>(0,b.jsxs)(q.SelectItem,{value:a.id,children:[a.name,a.isDefault?" ★":""]},a.id))]})]},`prompt-${D.length}`),(0,b.jsxs)(o.Button,{onClick:I,disabled:x,size:"sm",className:"gap-2 px-4",children:[x?(0,b.jsx)(V.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(Z.Terminal,{className:"h-3.5 w-3.5"}),x?h("terminal.executing"):h("terminal.launch")]})]}),(0,b.jsx)(K.ScrollArea,{className:"flex-1 min-h-0",children:(0,b.jsx)(aN.ExecutionTimeline,{executions:B,onResume:M,onContinueLatest:N})})]}):(0,b.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 bg-[#0f1419]",children:[(0,b.jsx)(V.Loader2,{className:"size-5 animate-spin text-neutral-500"}),(0,b.jsx)("span",{className:"text-xs text-neutral-500",children:h("execution.loading")})]})}):"changes"===l?(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:r?(0,b.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:h("taskPage.loadingDiff")})}):n?.branchDeleted?(0,b.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:h("taskPage.branchDeleted")})}):n?(0,b.jsx)(aB.TaskDiffView,{taskId:a.id,files:n.files,totalAdded:n.totalAdded,totalRemoved:n.totalRemoved,hasConflicts:n.hasConflicts,conflictFiles:n.conflictFiles,onCommit:W,hasUncommitted:n.hasUncommitted}):(0,b.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:h("taskPage.noChanges")})})}):"notes"===l?(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,b.jsx)(a0,{taskId:a.id,projectId:a.projectId})}):null,(0,b.jsx)(aC.TaskMergeConfirmDialog,{open:O,onOpenChange:P,taskId:a.id,taskTitle:a.title,baseBranch:a.baseBranch??"main",fileCount:n?.files?.length??0,commitCount:n?.commitCount??0,commitLog:Q,onMergeComplete:U})]})}var a2=a.i(178174),a3=a.i(959677);let a4=(0,aa.createServerReference)("40040f4fb9834d8b51a904ea8a6dc164a28474719d",aa.callServer,void 0,aa.findSourceMapURL,"deleteTask"),a5=(0,aa.createServerReference)("40eb42cee81987cdd889d4207810747489aa4ba222",aa.callServer,void 0,aa.findSourceMapURL,"toggleTaskPinned");var a6=a.i(565620);let a7=(0,aa.createServerReference)("408fa13a43876365dca2d1770e4b1adbfe5eeaac74",aa.callServer,void 0,aa.findSourceMapURL,"getVersionsForPicker");var a8=a.i(912868);function a9({projects:a,activeProjectId:d,onSelect:e}){let f=(0,c.useRef)(null),[g,h]=(0,c.useState)(!1),[i,j]=(0,c.useState)(!1),k=()=>{let a=f.current;a&&(h(a.scrollLeft>0),j(a.scrollLeft<a.scrollWidth-a.clientWidth-1))};(0,c.useEffect)(()=>{k();let a=f.current;if(a){a.addEventListener("scroll",k);let b=new ResizeObserver(k);return b.observe(a),()=>{a.removeEventListener("scroll",k),b.disconnect()}}},[a]);let l=a=>{let b=f.current;b&&b.scrollBy({left:"left"===a?-150:150,behavior:"smooth"})};return(0,b.jsxs)("div",{className:"relative flex items-center",children:[g&&(0,b.jsx)("button",{onClick:()=>l("left"),className:"absolute left-0 z-10 flex h-8 w-8 items-center justify-center rounded-md bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border backdrop-blur-sm transition-colors hover:text-foreground",children:(0,b.jsx)(a8.ChevronLeft,{className:"h-4 w-4"})}),(0,b.jsx)("div",{ref:f,className:"flex items-center gap-1.5 overflow-x-auto scrollbar-none px-1 py-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:a.map(a=>{let c=d===a.id;return(0,b.jsxs)("button",{onClick:()=>{c||e(a.id)},className:`shrink-0 rounded-lg border-b-2 px-4 py-2 text-sm font-medium transition-colors ${c?"border-primary bg-primary/10 text-primary ring-1 ring-primary/20 cursor-default":"border-transparent text-muted-foreground hover:bg-accent hover:text-foreground cursor-pointer"}`,children:[(0,b.jsx)("span",{children:a.name}),a.alias&&(0,b.jsx)("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:a.alias})]},a.id)})}),i&&(0,b.jsx)("button",{onClick:()=>l("right"),className:"absolute right-0 z-10 flex h-8 w-8 items-center justify-center rounded-md bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border backdrop-blur-sm transition-colors hover:text-foreground",children:(0,b.jsx)(Q.ChevronRight,{className:"h-4 w-4"})})]})}var ba=a.i(811344);function bb({open:a,onOpenChange:c,taskTitle:d,uncommittedFiles:e,commitLog:f,onConfirm:g}){let{t:h}=(0,i.useI18n)(),j=e.length,k=f.length,l=0===j&&0===k;return(0,b.jsx)(J.Dialog,{open:a,onOpenChange:c,children:(0,b.jsxs)(J.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,b.jsx)(J.DialogHeader,{children:(0,b.jsxs)(J.DialogTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)(ba.AlertTriangle,{className:"h-4 w-4 text-amber-400"}),h("taskCancel.title")]})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{className:"rounded-lg border border-amber-500/20 bg-amber-500/10 p-3 space-y-1.5",children:[(0,b.jsx)("p",{className:"text-xs text-foreground",children:h("taskCancel.intro",{title:d})}),(0,b.jsx)("p",{className:"text-xs text-amber-300",children:h("taskCancel.irreversible")})]}),l?(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:h("taskCancel.cleanNotice")}):(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:h("taskCancel.uncommittedFiles")}),(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:j})]}),(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:h("taskCancel.unmergedCommits")}),(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:k})]})]}),j>0&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:h("taskCancel.filesList")}),(0,b.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:e.map((a,c)=>(0,b.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:a},c))})]}),k>0&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:h("taskCancel.commitsList")}),(0,b.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:f.map((a,c)=>(0,b.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:a},c))}),(0,b.jsx)("p",{className:"text-[10px] text-muted-foreground mt-1.5",children:h("taskCancel.reflogHint")})]})]}),(0,b.jsxs)(J.DialogFooter,{children:[(0,b.jsx)(o.Button,{variant:"outline",onClick:()=>c(!1),children:h("taskCancel.keep")}),(0,b.jsxs)(o.Button,{variant:"destructive",onClick:g,className:"gap-2",children:[(0,b.jsx)(ba.AlertTriangle,{className:"h-4 w-4"}),h("taskCancel.confirm")]})]})]})})}a.s(["BoardPageClient",0,function({workspaceId:a,projectId:e,project:f,projects:g,initialTasks:h,labels:k,openTaskId:l}){let m=(0,d.useRouter)(),{t:n}=(0,i.useI18n)(),[,o]=(0,c.useTransition)(),[p,q]=(0,c.useState)(""),[s,t]=(0,c.useState)("all"),[v,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)("TODO"),[z,A]=(0,c.useState)(l??null),[B,C]=(0,c.useState)([]),D=z?h.find(a=>a.id===z)??null:null,[E,F]=(0,c.useState)(null),[G,H]=(0,c.useState)(null),[I,J]=(0,c.useState)(null);(0,c.useEffect)(()=>{a7(e).then(C).catch(()=>C([]))},[e]);let K=B.find(a=>a.isCurrent)?.id??null,L=(0,c.useCallback)(()=>{o(()=>{m.refresh()})},[m]);(0,c.useEffect)(()=>{if(v)return;let a=setInterval(()=>{o(()=>{m.refresh()})},5e3);return()=>clearInterval(a)},[m,v]);let M=(0,c.useCallback)(a=>{q(a)},[]),P=(0,c.useCallback)(async a=>{let b=h.find(b=>b.id===a);if(b)try{let c=await (0,aK.checkWorktreeClean)(a);if(c.hasWorktree&&!c.clean){ak.toast.error(n("taskPage.uncommittedChanges",{count:String(c.files.length)})),L();return}if(c.hasWorktree&&c.clean&&!c.hasCommits){ak.toast.error(n("taskPage.noChangesToComplete"),{action:{label:n("taskPage.markAsCancelled"),onClick:()=>{(0,aJ.updateTaskStatus)(a,"CANCELLED").then(()=>{ak.toast.success(n("taskPage.taskCancelled")),L()}).catch(()=>ak.toast.error("Failed to cancel task"))}}}),L();return}if(c.hasWorktree&&c.hasCommits){H({task:b,commitLog:c.commitLog,commitCount:c.commitLog.length}),L();return}await (0,aJ.updateTaskStatus)(a,"DONE"),ak.toast.success(n("taskPage.taskCompleted")),L()}catch{ak.toast.error("Failed to complete task"),L()}},[h,L,n]),Q=(0,c.useCallback)(async a=>{let b=h.find(b=>b.id===a);if(b)try{let c=await (0,aK.checkWorktreeClean)(a);if(!c.hasWorktree){await (0,aJ.updateTaskStatus)(a,"CANCELLED"),ak.toast.success(n("taskPage.taskCancelled")),L();return}J({task:b,files:c.files,commitLog:c.commitLog}),L()}catch{ak.toast.error("Failed to cancel task"),L()}},[h,L,n]),R=(0,c.useCallback)(async(a,b)=>{"DONE"===b?await P(a):"CANCELLED"===b?await Q(a):(await (0,aJ.updateTaskStatus)(a,b),L())},[L,P,Q]),S=(0,c.useCallback)(async a=>{let b=await (0,a2.createTask)({title:a.title,description:a.description,projectId:e,priority:a.priority,status:a.status,labelIds:a.labelIds,baseBranch:a.baseBranch,subPath:a.subPath,versionId:a.versionId??void 0});if(a.autoStart&&b?.id)try{await (0,a6.startPtyExecution)(b.id,""),A(b.id)}catch(a){ak.toast.error(a instanceof Error?a.message:String(a))}L()},[e,L]),T=(0,c.useCallback)(async(a,b)=>{await (0,a3.updateTask)(a,{...b,labelIds:b.labelIds}),F(null),L()},[L]),U=(0,c.useCallback)(async a=>{await a4(a),z===a&&A(null),L()},[L,z]),V=(0,c.useCallback)(async a=>{await a5(a),L()},[L]),W=(0,c.useCallback)(async b=>{try{await (0,a6.startPtyExecution)(b,"")}catch(a){ak.toast.error(a instanceof Error?a.message:String(a))}m.push(`/workspaces/${a}/tasks/${b}`)},[m,a]),X=(0,c.useCallback)(async(a,b)=>{"DONE"===b?await P(a):"CANCELLED"===b?await Q(a):(await (0,aJ.updateTaskStatus)(a,b),L())},[L,P,Q]),Y=(0,c.useCallback)(a=>{y(a),F(null),w(!0)},[]),Z=(0,c.useCallback)(a=>{F(a),w(!0)},[]),$=h.filter(a=>!a.labels?.some(a=>a.label.name===u.TOWER_LABEL_NAME&&a.label.isBuiltin)),_=$.filter(a=>{if("backlog"===s){if(a.versionId)return!1}else if("all"!==s&&a.versionId!==s)return!1;if(p.trim()){let b=p.toLowerCase();if(!a.title.toLowerCase().includes(b)&&!a.description?.toLowerCase().includes(b))return!1}return!0});return(0,b.jsxs)("div",{className:"flex h-full",children:[(0,b.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,b.jsx)("div",{className:"px-6 pt-3 pb-1",children:(0,b.jsx)(a9,{projects:g,activeProjectId:e,onSelect:b=>m.push(`/workspaces/${a}?projectId=${b}`,{scroll:!1})})}),(0,b.jsx)(j,{totalTasks:$.length,runningTasks:$.filter(a=>"IN_PROGRESS"===a.status).length}),(0,b.jsx)(r,{searchQuery:p,onSearchChange:M,versions:B,versionFilter:s,onVersionFilterChange:t,versionsHref:`/workspaces/${a}/projects/${e}/versions`,onCreateTask:()=>{F(null),w(!0)}}),(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden p-4",children:(0,b.jsx)(N,{initialTasks:_,onTaskMove:R,onTaskClick:a=>{A(a.id)},onEditTask:Z,onAddTask:Y,onDeleteTask:U,onTogglePin:V,workspaceId:a,onContextMenuStatusChange:X,onContextMenuLaunch:W})}),(0,b.jsx)(O.CreateTaskDialog,{open:v,onOpenChange:a=>{w(a),a||F(null)},onSubmit:S,onUpdate:T,defaultStatus:x,editTask:E,editTaskLabelIds:E?.labels?E.labels.map(a=>a.labelId):[],labels:k.filter(a=>!(a.name===u.TOWER_LABEL_NAME&&a.isBuiltin)),projectType:f.type,projectLocalPath:f.localPath,versions:B,defaultVersionId:K})]}),D?(0,b.jsx)(a1,{task:D,workspaceId:a,projectLocalPath:f.localPath,onClose:()=>A(null)}):(0,b.jsx)(au,{project:f,workspaceId:a}),G&&(0,b.jsx)(aC.TaskMergeConfirmDialog,{open:!0,onOpenChange:a=>{a||H(null)},taskId:G.task.id,taskTitle:G.task.title,baseBranch:G.task.baseBranch??"main",fileCount:0,commitCount:G.commitCount,commitLog:G.commitLog,onMergeComplete:()=>{H(null),ak.toast.success(n("taskPage.taskCompleted")),L()}}),I&&(0,b.jsx)(bb,{open:!0,onOpenChange:a=>{a||J(null)},taskTitle:I.task.title,uncommittedFiles:I.files,commitLog:I.commitLog,onConfirm:()=>{let a=I.task.id;J(null),(0,aJ.updateTaskStatus)(a,"CANCELLED").then(()=>{ak.toast.success(n("taskPage.taskCancelled")),L()}).catch(()=>ak.toast.error("Failed to cancel task"))}})]})}],473935)}];
2
2
 
3
3
  //# sourceMappingURL=src_app_workspaces_%5BworkspaceId%5D_board-page-client_tsx_0gips66._.js.map