@chorus-aidlc/chorus 0.19.1 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (322) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-build-manifest.json +349 -349
  3. package/.next/standalone/.next/app-path-routes-manifest.json +38 -38
  4. package/.next/standalone/.next/build-manifest.json +5 -5
  5. package/.next/standalone/.next/prerender-manifest.json +18 -18
  6. package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page.js +1 -1
  7. package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page.js.nft.json +1 -1
  8. package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page_client-reference-manifest.js +1 -1
  9. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/activity/page.js +1 -1
  10. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/activity/page_client-reference-manifest.js +1 -1
  11. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/[ideaUuid]/page.js +1 -1
  12. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/[ideaUuid]/page_client-reference-manifest.js +1 -1
  13. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page.js +2 -2
  14. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page.js.nft.json +1 -1
  15. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page.js +2 -2
  17. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page_client-reference-manifest.js +1 -1
  18. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page.js +2 -2
  19. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/graph/page.js +2 -2
  21. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/graph/page.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/graph/page_client-reference-manifest.js +1 -1
  23. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page.js +2 -2
  24. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page_client-reference-manifest.js +1 -1
  26. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page.js +2 -2
  27. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page_client-reference-manifest.js +1 -1
  28. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page.js +2 -2
  29. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page_client-reference-manifest.js +1 -1
  30. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page.js +1 -1
  31. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page_client-reference-manifest.js +1 -1
  33. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page.js +1 -1
  34. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page_client-reference-manifest.js +1 -1
  36. package/.next/standalone/.next/server/app/(dashboard)/projects/page.js +1 -1
  37. package/.next/standalone/.next/server/app/(dashboard)/projects/page.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/(dashboard)/projects/page_client-reference-manifest.js +1 -1
  39. package/.next/standalone/.next/server/app/(dashboard)/settings/page.js +2 -2
  40. package/.next/standalone/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
  41. package/.next/standalone/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  42. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/_not-found.html +2 -2
  44. package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
  45. package/.next/standalone/.next/server/app/admin/companies/[uuid]/page.js +1 -1
  46. package/.next/standalone/.next/server/app/admin/companies/[uuid]/page_client-reference-manifest.js +1 -1
  47. package/.next/standalone/.next/server/app/admin/companies/new/page.js +1 -1
  48. package/.next/standalone/.next/server/app/admin/companies/new/page_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/admin/companies/new.html +2 -2
  50. package/.next/standalone/.next/server/app/admin/companies/new.rsc +3 -3
  51. package/.next/standalone/.next/server/app/admin/companies/page_client-reference-manifest.js +1 -1
  52. package/.next/standalone/.next/server/app/admin/companies.html +2 -2
  53. package/.next/standalone/.next/server/app/admin/companies.rsc +2 -2
  54. package/.next/standalone/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  55. package/.next/standalone/.next/server/app/admin.html +2 -2
  56. package/.next/standalone/.next/server/app/admin.rsc +2 -2
  57. package/.next/standalone/.next/server/app/api/admin/companies/[uuid]/route_client-reference-manifest.js +1 -1
  58. package/.next/standalone/.next/server/app/api/admin/companies/route_client-reference-manifest.js +1 -1
  59. package/.next/standalone/.next/server/app/api/admin/login/route_client-reference-manifest.js +1 -1
  60. package/.next/standalone/.next/server/app/api/admin/session/route_client-reference-manifest.js +1 -1
  61. package/.next/standalone/.next/server/app/api/agent-connections/route_client-reference-manifest.js +1 -1
  62. package/.next/standalone/.next/server/app/api/agents/[uuid]/route_client-reference-manifest.js +1 -1
  63. package/.next/standalone/.next/server/app/api/agents/[uuid]/sessions/route_client-reference-manifest.js +1 -1
  64. package/.next/standalone/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
  65. package/.next/standalone/.next/server/app/api/api-keys/[uuid]/route_client-reference-manifest.js +1 -1
  66. package/.next/standalone/.next/server/app/api/api-keys/route_client-reference-manifest.js +1 -1
  67. package/.next/standalone/.next/server/app/api/auth/callback/route_client-reference-manifest.js +1 -1
  68. package/.next/standalone/.next/server/app/api/auth/check-default/route_client-reference-manifest.js +1 -1
  69. package/.next/standalone/.next/server/app/api/auth/company-oidc/route_client-reference-manifest.js +1 -1
  70. package/.next/standalone/.next/server/app/api/auth/default-login/route_client-reference-manifest.js +1 -1
  71. package/.next/standalone/.next/server/app/api/auth/identify/route_client-reference-manifest.js +1 -1
  72. package/.next/standalone/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  73. package/.next/standalone/.next/server/app/api/auth/me/route_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app/api/auth/sync-token/route_client-reference-manifest.js +1 -1
  75. package/.next/standalone/.next/server/app/api/comments/route_client-reference-manifest.js +1 -1
  76. package/.next/standalone/.next/server/app/api/daemon/connection-heartbeat/route_client-reference-manifest.js +1 -1
  77. package/.next/standalone/.next/server/app/api/daemon/control/route_client-reference-manifest.js +1 -1
  78. package/.next/standalone/.next/server/app/api/daemon/directory-request/report/route_client-reference-manifest.js +1 -1
  79. package/.next/standalone/.next/server/app/api/daemon/execution-state/route_client-reference-manifest.js +1 -1
  80. package/.next/standalone/.next/server/app/api/daemon/executions/route_client-reference-manifest.js +1 -1
  81. package/.next/standalone/.next/server/app/api/daemon/pending-turns/route_client-reference-manifest.js +1 -1
  82. package/.next/standalone/.next/server/app/api/daemon/report-interrupt/route_client-reference-manifest.js +1 -1
  83. package/.next/standalone/.next/server/app/api/daemon/resume/route_client-reference-manifest.js +1 -1
  84. package/.next/standalone/.next/server/app/api/daemon/transcript/route_client-reference-manifest.js +1 -1
  85. package/.next/standalone/.next/server/app/api/daemon/turn-advance/route_client-reference-manifest.js +1 -1
  86. package/.next/standalone/.next/server/app/api/daemon-directory-requests/[uuid]/route_client-reference-manifest.js +1 -1
  87. package/.next/standalone/.next/server/app/api/daemon-directory-requests/route_client-reference-manifest.js +1 -1
  88. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/instruction/route_client-reference-manifest.js +1 -1
  89. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/repoint/route_client-reference-manifest.js +1 -1
  90. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/route_client-reference-manifest.js +1 -1
  91. package/.next/standalone/.next/server/app/api/daemon-sessions/ad-hoc/route_client-reference-manifest.js +1 -1
  92. package/.next/standalone/.next/server/app/api/daemon-sessions/route_client-reference-manifest.js +1 -1
  93. package/.next/standalone/.next/server/app/api/documents/[uuid]/route_client-reference-manifest.js +1 -1
  94. package/.next/standalone/.next/server/app/api/entities/[type]/[uuid]/root-idea/route_client-reference-manifest.js +1 -1
  95. package/.next/standalone/.next/server/app/api/events/notifications/route_client-reference-manifest.js +1 -1
  96. package/.next/standalone/.next/server/app/api/events/route_client-reference-manifest.js +1 -1
  97. package/.next/standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  98. package/.next/standalone/.next/server/app/api/ideas/[uuid]/claim/route_client-reference-manifest.js +1 -1
  99. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/preview/route_client-reference-manifest.js +1 -1
  100. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/route_client-reference-manifest.js +1 -1
  101. package/.next/standalone/.next/server/app/api/ideas/[uuid]/parent/route_client-reference-manifest.js +1 -1
  102. package/.next/standalone/.next/server/app/api/ideas/[uuid]/release/route_client-reference-manifest.js +1 -1
  103. package/.next/standalone/.next/server/app/api/ideas/[uuid]/route_client-reference-manifest.js +1 -1
  104. package/.next/standalone/.next/server/app/api/ideas/[uuid]/wake-preview/route_client-reference-manifest.js +1 -1
  105. package/.next/standalone/.next/server/app/api/ideas/conversational/route_client-reference-manifest.js +1 -1
  106. package/.next/standalone/.next/server/app/api/mcp/route_client-reference-manifest.js +1 -1
  107. package/.next/standalone/.next/server/app/api/me/assignments/route_client-reference-manifest.js +1 -1
  108. package/.next/standalone/.next/server/app/api/mentionables/route_client-reference-manifest.js +1 -1
  109. package/.next/standalone/.next/server/app/api/notifications/[uuid]/archive/route_client-reference-manifest.js +1 -1
  110. package/.next/standalone/.next/server/app/api/notifications/[uuid]/read/route_client-reference-manifest.js +1 -1
  111. package/.next/standalone/.next/server/app/api/notifications/preferences/route_client-reference-manifest.js +1 -1
  112. package/.next/standalone/.next/server/app/api/notifications/read-all/route_client-reference-manifest.js +1 -1
  113. package/.next/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  114. package/.next/standalone/.next/server/app/api/notifications/unread-count/route_client-reference-manifest.js +1 -1
  115. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/dashboard/route_client-reference-manifest.js +1 -1
  116. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/route_client-reference-manifest.js +1 -1
  117. package/.next/standalone/.next/server/app/api/project-groups/route_client-reference-manifest.js +1 -1
  118. package/.next/standalone/.next/server/app/api/project-visits/pin/route_client-reference-manifest.js +1 -1
  119. package/.next/standalone/.next/server/app/api/project-visits/route_client-reference-manifest.js +1 -1
  120. package/.next/standalone/.next/server/app/api/project-visits/visit/route_client-reference-manifest.js +1 -1
  121. package/.next/standalone/.next/server/app/api/projects/[uuid]/activity/route_client-reference-manifest.js +1 -1
  122. package/.next/standalone/.next/server/app/api/projects/[uuid]/agent-cwds/route_client-reference-manifest.js +1 -1
  123. package/.next/standalone/.next/server/app/api/projects/[uuid]/available/route_client-reference-manifest.js +1 -1
  124. package/.next/standalone/.next/server/app/api/projects/[uuid]/documents/route_client-reference-manifest.js +1 -1
  125. package/.next/standalone/.next/server/app/api/projects/[uuid]/group/route_client-reference-manifest.js +1 -1
  126. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/route_client-reference-manifest.js +1 -1
  127. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/tracker/route_client-reference-manifest.js +1 -1
  128. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/[proposalUuid]/validate/route_client-reference-manifest.js +1 -1
  129. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/route_client-reference-manifest.js +1 -1
  130. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/summary/route_client-reference-manifest.js +1 -1
  131. package/.next/standalone/.next/server/app/api/projects/[uuid]/resource-graph/route_client-reference-manifest.js +1 -1
  132. package/.next/standalone/.next/server/app/api/projects/[uuid]/route_client-reference-manifest.js +1 -1
  133. package/.next/standalone/.next/server/app/api/projects/[uuid]/stats/route_client-reference-manifest.js +1 -1
  134. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/dependencies/route_client-reference-manifest.js +1 -1
  135. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/route_client-reference-manifest.js +1 -1
  136. package/.next/standalone/.next/server/app/api/projects/agent-cwd-options/route_client-reference-manifest.js +1 -1
  137. package/.next/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  138. package/.next/standalone/.next/server/app/api/proposals/[uuid]/approve/route_client-reference-manifest.js +1 -1
  139. package/.next/standalone/.next/server/app/api/proposals/[uuid]/close/route_client-reference-manifest.js +1 -1
  140. package/.next/standalone/.next/server/app/api/proposals/[uuid]/reject/route_client-reference-manifest.js +1 -1
  141. package/.next/standalone/.next/server/app/api/proposals/[uuid]/revoke/route_client-reference-manifest.js +1 -1
  142. package/.next/standalone/.next/server/app/api/proposals/[uuid]/route_client-reference-manifest.js +1 -1
  143. package/.next/standalone/.next/server/app/api/references/[uuid]/route_client-reference-manifest.js +1 -1
  144. package/.next/standalone/.next/server/app/api/references/route_client-reference-manifest.js +1 -1
  145. package/.next/standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  146. package/.next/standalone/.next/server/app/api/session/route_client-reference-manifest.js +1 -1
  147. package/.next/standalone/.next/server/app/api/sessions/[uuid]/route_client-reference-manifest.js +1 -1
  148. package/.next/standalone/.next/server/app/api/tasks/[uuid]/claim/route_client-reference-manifest.js +1 -1
  149. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/[dependsOnUuid]/route_client-reference-manifest.js +1 -1
  150. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/route_client-reference-manifest.js +1 -1
  151. package/.next/standalone/.next/server/app/api/tasks/[uuid]/release/route_client-reference-manifest.js +1 -1
  152. package/.next/standalone/.next/server/app/api/tasks/[uuid]/route_client-reference-manifest.js +1 -1
  153. package/.next/standalone/.next/server/app/api/tasks/[uuid]/sessions/route_client-reference-manifest.js +1 -1
  154. package/.next/standalone/.next/server/app/index.html +2 -2
  155. package/.next/standalone/.next/server/app/index.rsc +2 -2
  156. package/.next/standalone/.next/server/app/login/admin/page.js +1 -1
  157. package/.next/standalone/.next/server/app/login/admin/page_client-reference-manifest.js +1 -1
  158. package/.next/standalone/.next/server/app/login/admin.html +2 -2
  159. package/.next/standalone/.next/server/app/login/admin.rsc +3 -3
  160. package/.next/standalone/.next/server/app/login/callback/page_client-reference-manifest.js +1 -1
  161. package/.next/standalone/.next/server/app/login/callback.html +2 -2
  162. package/.next/standalone/.next/server/app/login/callback.rsc +2 -2
  163. package/.next/standalone/.next/server/app/login/page.js +1 -1
  164. package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  165. package/.next/standalone/.next/server/app/login/pick-workspace/page_client-reference-manifest.js +1 -1
  166. package/.next/standalone/.next/server/app/login/pick-workspace.html +2 -2
  167. package/.next/standalone/.next/server/app/login/pick-workspace.rsc +2 -2
  168. package/.next/standalone/.next/server/app/login.html +2 -2
  169. package/.next/standalone/.next/server/app/login.rsc +3 -3
  170. package/.next/standalone/.next/server/app/onboarding/page.js +2 -2
  171. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  172. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  173. package/.next/standalone/.next/server/app/onboarding.html +2 -2
  174. package/.next/standalone/.next/server/app/onboarding.rsc +3 -3
  175. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  176. package/.next/standalone/.next/server/app/projects.html +2 -2
  177. package/.next/standalone/.next/server/app/projects.rsc +4 -4
  178. package/.next/standalone/.next/server/app/settings.html +2 -2
  179. package/.next/standalone/.next/server/app/settings.rsc +4 -4
  180. package/.next/standalone/.next/server/app-paths-manifest.json +38 -38
  181. package/.next/standalone/.next/server/chunks/1559.js +2 -2
  182. package/.next/standalone/.next/server/chunks/{657.js → 186.js} +1 -1
  183. package/.next/standalone/.next/server/chunks/2572.js +1 -1
  184. package/.next/standalone/.next/server/chunks/2961.js +1 -1
  185. package/.next/standalone/.next/server/chunks/3371.js +1 -0
  186. package/.next/standalone/.next/server/chunks/4131.js +39 -0
  187. package/.next/standalone/.next/server/chunks/4672.js +2 -2
  188. package/.next/standalone/.next/server/chunks/5245.js +1 -1
  189. package/.next/standalone/.next/server/chunks/5577.js +1 -0
  190. package/.next/standalone/.next/server/chunks/5728.js +1 -0
  191. package/.next/standalone/.next/server/chunks/6113.js +1 -1
  192. package/.next/standalone/.next/server/chunks/6515.js +2 -2
  193. package/.next/standalone/.next/server/chunks/6753.js +4 -4
  194. package/.next/standalone/.next/server/chunks/679.js +1 -1
  195. package/.next/standalone/.next/server/chunks/7368.js +1 -1
  196. package/.next/standalone/.next/server/chunks/7530.js +1 -1
  197. package/.next/standalone/.next/server/chunks/8017.js +1 -1
  198. package/.next/standalone/.next/server/chunks/8177.js +1 -0
  199. package/.next/standalone/.next/server/chunks/920.js +1 -1
  200. package/.next/standalone/.next/server/chunks/9213.js +1 -1
  201. package/.next/standalone/.next/server/chunks/9378.js +1 -1
  202. package/.next/standalone/.next/server/chunks/9931.js +1 -1
  203. package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
  204. package/.next/standalone/.next/server/middleware-manifest.json +5 -5
  205. package/.next/standalone/.next/server/pages/404.html +2 -2
  206. package/.next/standalone/.next/server/pages/500.html +1 -1
  207. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  208. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  209. package/.next/standalone/.next/static/chunks/{11595.b2b74d1d1d0ae9d9.js → 11595.4cebcf7499ef6a78.js} +1 -1
  210. package/.next/standalone/.next/static/chunks/27370-0d04028ec8a339f0.js +1 -0
  211. package/.next/standalone/.next/static/chunks/27787-3566e3dd0506e241.js +1 -0
  212. package/.next/standalone/.next/static/chunks/{33456.978e5f47d1c8eb93.js → 33456.a5a9acba61ca3665.js} +1 -1
  213. package/.next/standalone/.next/static/chunks/{4860.79d6eefc2861716f.js → 4860.61dfcdf8c4c5c703.js} +1 -1
  214. package/.next/standalone/.next/static/chunks/53504-3a0f6dee12a39d5d.js +1 -0
  215. package/.next/standalone/.next/static/chunks/63819-c52b5bc9ee32ca9b.js +1 -0
  216. package/.next/standalone/.next/static/chunks/76103-5d656aebd9cd5e7f.js +1 -0
  217. package/.next/standalone/.next/static/chunks/78847-9f65efbac984cf70.js +1 -0
  218. package/.next/standalone/.next/static/chunks/79919-32af2c1abfc92a30.js +1 -0
  219. package/.next/standalone/.next/static/chunks/91997-3592827b5a069beb.js +1 -0
  220. package/.next/standalone/.next/static/chunks/{99373.e659954ff5148796.js → 99373.747e181e4c952509.js} +1 -1
  221. package/.next/standalone/.next/static/chunks/app/(dashboard)/layout-6135300353d6c6ad.js +1 -0
  222. package/.next/standalone/.next/static/chunks/app/(dashboard)/project-groups/[uuid]/page-bb9f26c107a6b113.js +1 -0
  223. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/dashboard/page-31dd9042ee36b8e5.js +1 -0
  224. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page-a6bfa3b6b6893bc4.js +1 -0
  225. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/page-01e81333c9beee2d.js +1 -0
  226. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/graph/{page-487d071317ae5e6d.js → page-795b161eb0694092.js} +1 -1
  227. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page-e20e65b5df817433.js +1 -0
  228. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/new/page-fc2d02d552bbdbf0.js +1 -0
  229. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/page-0cfa38d2de9fa9d9.js +1 -0
  230. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/{page-7cb8a91f6ca34ba8.js → page-529dec4c3bcd5ba9.js} +1 -1
  231. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/{page-6466141ca355d9a4.js → page-b211c29669eaa3e4.js} +1 -1
  232. package/.next/standalone/.next/static/chunks/app/(dashboard)/settings/page-0606d1497512e155.js +1 -0
  233. package/.next/standalone/.next/static/chunks/app/admin/companies/[uuid]/page-47e49c331996193b.js +1 -0
  234. package/.next/standalone/.next/static/chunks/app/admin/companies/new/page-c1e28205503002de.js +1 -0
  235. package/.next/standalone/.next/static/chunks/app/login/admin/page-b0d0ea2fa4102ff7.js +1 -0
  236. package/.next/standalone/.next/static/chunks/app/login/page-ee63e900cb54148c.js +1 -0
  237. package/.next/standalone/.next/static/chunks/app/onboarding/{page-323e1d93218758c5.js → page-1f3ab167cab58610.js} +1 -1
  238. package/.next/standalone/.next/static/chunks/{webpack-ec441a05567c82b0.js → webpack-6151d196b2fab7e8.js} +1 -1
  239. package/.next/standalone/.next/static/css/09ac5931fe977492.css +1 -0
  240. package/.next/standalone/package.json +1 -1
  241. package/.next/standalone/public/chorus-plugin/.claude-plugin/plugin.json +1 -1
  242. package/.next/standalone/public/chorus-plugin/bin/chorus-api.sh +1 -1
  243. package/.next/standalone/public/chorus-plugin/skills/brainstorm/SKILL.md +1 -1
  244. package/.next/standalone/public/chorus-plugin/skills/chorus/SKILL.md +1 -1
  245. package/.next/standalone/public/chorus-plugin/skills/chorus-cli/SKILL.md +1 -1
  246. package/.next/standalone/public/chorus-plugin/skills/develop/SKILL.md +1 -1
  247. package/.next/standalone/public/chorus-plugin/skills/docs/SKILL.md +1 -1
  248. package/.next/standalone/public/chorus-plugin/skills/idea/SKILL.md +1 -1
  249. package/.next/standalone/public/chorus-plugin/skills/openspec-aware/SKILL.md +1 -1
  250. package/.next/standalone/public/chorus-plugin/skills/orchestrate/SKILL.md +1 -1
  251. package/.next/standalone/public/chorus-plugin/skills/proposal/SKILL.md +1 -1
  252. package/.next/standalone/public/chorus-plugin/skills/quick-dev/SKILL.md +1 -1
  253. package/.next/standalone/public/chorus-plugin/skills/research/SKILL.md +1 -1
  254. package/.next/standalone/public/chorus-plugin/skills/review/SKILL.md +1 -1
  255. package/.next/standalone/public/chorus-plugin/skills/spec-lite/SKILL.md +1 -1
  256. package/.next/standalone/public/chorus-plugin/skills/yolo/SKILL.md +1 -1
  257. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-brainstorm/SKILL.md +1 -1
  258. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-cli/SKILL.md +1 -1
  259. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-develop/SKILL.md +1 -1
  260. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-docs/SKILL.md +1 -1
  261. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-idea/SKILL.md +1 -1
  262. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-openspec-aware/SKILL.md +1 -1
  263. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-orchestrate/SKILL.md +1 -1
  264. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-proposal/SKILL.md +1 -1
  265. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-quick-dev/SKILL.md +1 -1
  266. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-research/SKILL.md +1 -1
  267. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-review/SKILL.md +1 -1
  268. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-spec-lite/SKILL.md +1 -1
  269. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-yolo/SKILL.md +1 -1
  270. package/.next/standalone/public/kiro-plugin/bin/chorus-api.sh +1 -1
  271. package/README.ja.md +3 -1
  272. package/README.ko.md +3 -1
  273. package/README.md +18 -1
  274. package/README.zh.md +18 -1
  275. package/chorus.mjs +7 -1
  276. package/cli/agent-cli-config.mjs +28 -2
  277. package/cli/claude-spawner.mjs +330 -18
  278. package/cli/codex-app-server-client.mjs +402 -0
  279. package/cli/codex-app-server-events.mjs +176 -0
  280. package/cli/codex-session-map.mjs +1 -1
  281. package/cli/codex-spawner.mjs +247 -241
  282. package/cli/init/adapters.mjs +2 -2
  283. package/cli/init/file-template.mjs +11 -4
  284. package/cli/init/install-methods.mjs +3 -1
  285. package/cli/pi-spawner.mjs +472 -78
  286. package/cli/process-killer.mjs +138 -13
  287. package/cli/process-stop-hooks.mjs +13 -0
  288. package/cli/upgrade-plugins.mjs +202 -0
  289. package/cli/upgrade-process.mjs +159 -0
  290. package/cli/upgrade.mjs +125 -0
  291. package/cli/upload-hooks.mjs +2 -2
  292. package/cli/windows-process-tree.mjs +154 -0
  293. package/package.json +1 -1
  294. package/.next/standalone/.next/server/chunks/3420.js +0 -1
  295. package/.next/standalone/.next/server/chunks/38.js +0 -39
  296. package/.next/standalone/.next/server/chunks/5576.js +0 -1
  297. package/.next/standalone/.next/server/chunks/6125.js +0 -1
  298. package/.next/standalone/.next/server/chunks/6509.js +0 -1
  299. package/.next/standalone/.next/static/chunks/17081-63e2cad8c15da2fb.js +0 -1
  300. package/.next/standalone/.next/static/chunks/27370-f998ed24dd4fa975.js +0 -1
  301. package/.next/standalone/.next/static/chunks/46437-88abf056c31c7e4e.js +0 -1
  302. package/.next/standalone/.next/static/chunks/48365-13b8e43016ba16a4.js +0 -1
  303. package/.next/standalone/.next/static/chunks/71522-de2b2a9d8e5059e1.js +0 -1
  304. package/.next/standalone/.next/static/chunks/79919-d423af700ae83862.js +0 -1
  305. package/.next/standalone/.next/static/chunks/91796-d235607f577fbaeb.js +0 -1
  306. package/.next/standalone/.next/static/chunks/99540-99af558190f96511.js +0 -1
  307. package/.next/standalone/.next/static/chunks/app/(dashboard)/layout-adf9dbdf339e9038.js +0 -1
  308. package/.next/standalone/.next/static/chunks/app/(dashboard)/project-groups/[uuid]/page-cf8ff072a8bc7409.js +0 -1
  309. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/dashboard/page-00d18e26961cee2f.js +0 -1
  310. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page-9ed4d7d4f5897de0.js +0 -1
  311. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/page-9d6d86299f2fadd9.js +0 -1
  312. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page-b18a2aba2c4f4f1c.js +0 -1
  313. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/new/page-32149a823e7abf42.js +0 -1
  314. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/page-0ac33f9146fc53c5.js +0 -1
  315. package/.next/standalone/.next/static/chunks/app/(dashboard)/settings/page-ba19aec7fde5086c.js +0 -1
  316. package/.next/standalone/.next/static/chunks/app/admin/companies/[uuid]/page-56118c51122ad639.js +0 -1
  317. package/.next/standalone/.next/static/chunks/app/admin/companies/new/page-4e20deb41357171c.js +0 -1
  318. package/.next/standalone/.next/static/chunks/app/login/admin/page-c8e40259e5d3d9e0.js +0 -1
  319. package/.next/standalone/.next/static/chunks/app/login/page-0a16a64855b771ef.js +0 -1
  320. package/.next/standalone/.next/static/css/652fcc1f1ab231c8.css +0 -1
  321. /package/.next/standalone/.next/static/{AWk31w7ryFKaxOnUlIeo2 → kDppeym4sfPwXjGFspZG8}/_buildManifest.js +0 -0
  322. /package/.next/standalone/.next/static/{AWk31w7ryFKaxOnUlIeo2 → kDppeym4sfPwXjGFspZG8}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[27370],{14554:(e,t,n)=>{n.d(t,{p:()=>o});var r=n(90508);n(1856);var a=n(24377);function o(e){let{className:t,type:n,...o}=e;return(0,r.jsx)("input",{type:n,"data-slot":"input",className:(0,a.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...o})}},15972:(e,t,n)=>{n.d(t,{T:()=>o});var r=n(90508);n(1856);var a=n(24377);function o(e){let{className:t,...n}=e;return(0,r.jsx)("textarea",{"data-slot":"textarea",className:(0,a.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...n})}},22922:(e,t,n)=>{n.d(t,{$:()=>l});var r=n(90508);n(1856);var a=n(49499),o=n(54154),s=n(24377);let i=(0,a.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium cursor-pointer transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function l(e){let{className:t,variant:n="default",size:a="default",asChild:l=!1,...c}=e,d=l?o.bL:"button";return(0,r.jsx)(d,{"data-slot":"button","data-variant":n,"data-size":a,className:(0,s.cn)(i({variant:n,size:a,className:t})),...c})}},24377:(e,t,n)=>{n.d(t,{cn:()=>o});var r=n(49251),a=n(58849);function o(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,a.QP)((0,r.$)(t))}},30509:(e,t,n)=>{n.d(t,{HB:()=>a,JK:()=>i,XQ:()=>s,bN:()=>l,vh:()=>o});var r=n(14655);function a(e){let t=function(e){let t=window.location.origin,n=new r.O({store:window.localStorage});return{authority:e.issuer,client_id:e.clientId,redirect_uri:"".concat(t,"/login/callback"),post_logout_redirect_uri:"".concat(t,"/login"),response_type:"code",scope:"openid profile email",automaticSilentRenew:!1,userStore:n,extraQueryParams:{company:e.companyUuid}}}(e);return new r.$5(t)}function o(e){localStorage.setItem("oidc_config",JSON.stringify(e))}function s(){let e=localStorage.getItem("oidc_config");if(!e)return null;try{return JSON.parse(e)}catch(e){return null}}function i(){localStorage.removeItem("oidc_config")}function l(e){return{sub:e.profile.sub,email:e.profile.email,name:e.profile.name,picture:e.profile.picture,accessToken:e.access_token,refreshToken:e.refresh_token,expiresAt:e.expires_at,idToken:e.id_token}}},41837:(e,t,n)=>{n.d(t,{e:()=>y,q:()=>w});var r=n(90508),a=n(1856),o=n(39268),s=n(48016),i=n(74957),l=n(85226),c=n(89967),d=n(71388),u=n(22922),f=n(14554),m=n(42305);let g=new Set(["HOST_OFFLINE","TIMEOUT","INVALID_PATH","OUTSIDE_ROOT","NOT_DIRECTORY","ACCESS_DENIED","STALE_TARGET","LIMIT_EXCEEDED","INTERNAL_ERROR"]);function h(e){if(e instanceof DOMException&&"AbortError"===e.name)return"ABORTED";let t=e instanceof Error?e.message:"INTERNAL_ERROR";return g.has(t)?t:"INTERNAL_ERROR"}function x(e){return e.includes("\\")&&!e.includes("/")?"\\":"/"}function p(e){let t=x(e);return e.endsWith(t)?e:"".concat(e).concat(t)}function v(e){if(e.aborted)throw new DOMException("Aborted","AbortError")}async function b(e,t){v(t);try{var n,r,a,o,s;let i=await fetch("/api/daemon-directory-requests",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:t});v(t);let l=await i.json();if(v(t),!i.ok||!l.success)throw Error(null!=(r=null==(n=l.error)?void 0:n.code)?r:"INTERNAL_ERROR");let c=l.data.request;for(;"pending"===c.status;){await function(e,t){return new Promise((t,n)=>{if(e.aborted)return void n(new DOMException("Aborted","AbortError"));let r=()=>{clearTimeout(a),e.removeEventListener("abort",r),n(new DOMException("Aborted","AbortError"))},a=setTimeout(()=>{e.removeEventListener("abort",r),t()},300);e.addEventListener("abort",r,{once:!0})})}(t,0),v(t);let e=await fetch("/api/daemon-directory-requests/".concat(encodeURIComponent(c.uuid)),{signal:t});v(t);let n=await e.json();if(v(t),!e.ok||!n.success)throw Error(null!=(o=null==(a=n.error)?void 0:a.code)?o:"INTERNAL_ERROR");c=n.data.request}if("success"!==c.status)throw Error(null!=(s=c.errorCode)?s:"INTERNAL_ERROR");return c}catch(e){throw v(t),e}}async function w(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new AbortController().signal,r=await b({operation:"validate",agentUuid:e.agentUuid,targetConnectionUuid:e.connectionUuid,cwd:e.cwd},n);return v(n),{...e,cwd:"string"==typeof(null==(t=r.result)?void 0:t.normalizedPath)?r.result.normalizedPath:e.cwd,validationRequestUuid:r.uuid}}function y(e){let{agentUuid:t,instances:n,onValidated:g,confirmLabel:v,showConfirm:w=!0,onSelectionChange:y}=e,N=(0,o.c)("directoryBrowser"),j=(0,a.useMemo)(()=>Array.from(new Map(n.map(e=>[e.host,e])).values()),[n]),[k,E]=(0,a.useState)(1===j.length?j[0]:null),[R,A]=(0,a.useState)([]),[z,_]=(0,a.useState)(""),[T,C]=(0,a.useState)("custom"),[S,O]=(0,a.useState)(null),[U,D]=(0,a.useState)(!1),[I,L]=(0,a.useState)(!1),[P,M]=(0,a.useState)(""),[B,q]=(0,a.useState)(""),[$,H]=(0,a.useState)([]),[J,W]=(0,a.useState)(-1),[K,F]=(0,a.useState)(!1),[Q,V]=(0,a.useState)(""),[X,G]=(0,a.useState)(null),[Z,Y]=(0,a.useState)(null),ee=(0,a.useRef)(0),et=(0,a.useRef)(0),en=(0,a.useRef)(0),er=(0,a.useRef)(null),ea=(0,a.useRef)(null),eo=(0,a.useRef)(null),es=(0,a.useRef)(y);es.current=y,(0,a.useEffect)(()=>{var e,t;K&&!(J<0)&&(null==(t=document.getElementById("directory-candidate-".concat(J)))||null==(e=t.scrollIntoView)||e.call(t,{block:"nearest"}))},[J,K]);let ei=()=>{var e;et.current+=1,null==(e=ea.current)||e.abort(),H([]),W(-1),F(!1),V("")},el=()=>{var e;en.current+=1,null==(e=eo.current)||e.abort(),G(e=>"validate"===e?null:e)};(0,a.useEffect)(()=>{var e;if(ee.current+=1,null==(e=er.current)||e.abort(),el(),ei(),A([]),_(""),C("custom"),O(null),D(!1),L(!1),M(""),q(""),Y(null),!k)return void G(null);let n=ee.current,r=k.connectionUuid,a=new AbortController;return er.current=a,G("roots"),b({operation:"roots",agentUuid:t,targetConnectionUuid:r},a.signal).then(e=>{var t;if(n!==ee.current||r!==k.connectionUuid)return;let a=null==(t=e.result)?void 0:t.roots;if(!Array.isArray(a)||0===a.length)throw Error("INTERNAL_ERROR");A(a),_(a[0]),D(!1),M(p(a[0]))}).catch(e=>{"ABORTED"!==h(e)&&n===ee.current&&(D(!0),Y(null))}).finally(()=>{n===ee.current&&G(null)}),()=>a.abort()},[t,k]);let ec=z?function(e,t){var n;let r=x(t),a=p(t);if(e===t||e===a)return"";if(!e.startsWith(a))return null;let o=e.slice(a.length);return o.endsWith(r)?"":null!=(n=o.split(r).at(-1))?n:""}(P,z):null;(0,a.useEffect)(()=>{var e;et.current+=1,null==(e=ea.current)||e.abort();let n=et.current;if(H([]),W(-1),F(!1),V(""),!k||!z||null===ec||0===ec.length)return void G(e=>"browse"===e?null:e);let r=k.connectionUuid,a=new AbortController;ea.current=a;let o=setTimeout(()=>{G("browse"),Y(null),b({operation:"list",agentUuid:t,targetConnectionUuid:r,prefix:P},a.signal).then(e=>{var t;if(n!==et.current||r!==k.connectionUuid||z!=z||P!=P)return;let a=Array.isArray(null==(t=e.result)?void 0:t.items)?e.result.items:[];H(a),W(a.length>0?0:-1),F(a.length>0),V(P)}).catch(e=>{let t=h(e);"ABORTED"!==t&&n===et.current&&(Y(t),V(P))}).finally(()=>{n===et.current&&G(null)})},250);return()=>{clearTimeout(o),a.abort()}},[t,k,ec,P,z]),(0,a.useEffect)(()=>()=>{var e,t,n;null==(e=er.current)||e.abort(),null==(t=ea.current)||t.abort(),null==(n=eo.current)||n.abort()},[]),(0,a.useEffect)(()=>{var e;let n=null!=S?S:k,r=B||(!w&&"custom"===T&&I?P.trim():"");null==(e=es.current)||e.call(es,n&&r?{agentUuid:t,connectionUuid:n.connectionUuid,host:n.host,cwd:r}:null)},[t,k,S,I,T,P,B,w]);let ed=e=>{el(),ei(),q(e.path),L(!0),M(p(e.path)),Y(null)},eu=async()=>{var e,n;let r=null!=S?S:k;if(!r||!B)return;en.current+=1,null==(e=eo.current)||e.abort();let a=en.current,o=new AbortController;eo.current=o,G("validate"),Y(null);try{let e=await b({operation:"validate",agentUuid:t,targetConnectionUuid:r.connectionUuid,cwd:B},o.signal),s="string"==typeof(null==(n=e.result)?void 0:n.normalizedPath)?e.result.normalizedPath:B;if(a!==en.current)return;await g({agentUuid:t,connectionUuid:r.connectionUuid,host:r.host,cwd:s,validationRequestUuid:e.uuid})}catch(t){let e=h(t);"ABORTED"!==e&&a===en.current&&Y(e)}finally{a===en.current&&G(null)}};return 0===j.length?(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:N("noHosts")}):(0,r.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[(0,r.jsx)("div",{className:"flex flex-wrap gap-2","aria-label":N("chooseHost"),children:j.map(e=>(0,r.jsx)(u.$,{type:"button",size:"sm",variant:(null==k?void 0:k.connectionUuid)===e.connectionUuid?"default":"outline",className:"h-11 max-w-full sm:h-8",onClick:()=>{el(),C("custom"),O(null),E(e)},children:(0,r.jsx)("span",{className:"truncate",children:e.host||N("unknownHost")})},e.connectionUuid))}),k&&(0,r.jsxs)(r.Fragment,{children:[(()=>{let e=n.filter(e=>e.host===k.host&&e.cwd);return(0,r.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-2",role:"group","aria-label":N("chooseDirectorySource"),children:[e.map(e=>(0,r.jsxs)(u.$,{type:"button",variant:"configured"===T&&(null==S?void 0:S.connectionUuid)===e.connectionUuid?"default":"outline",className:"h-auto min-w-0 justify-start px-3 py-2 text-left",onClick:()=>{var t;el(),ei(),C("configured"),O(e),L(!1),q(null!=(t=e.cwd)?t:""),Y(null)},children:[(0,r.jsx)(s.A,{className:"mr-2 size-4 shrink-0"}),(0,r.jsxs)("span",{className:"min-w-0",children:[(0,r.jsx)("span",{className:"block text-xs font-medium",children:N("configuredCwd")}),(0,r.jsx)("span",{className:"block truncate font-mono text-[10px] opacity-75",children:e.cwd})]})]},e.connectionUuid)),(0,r.jsxs)(u.$,{type:"button",variant:"custom"===T?"default":"outline",className:"h-auto min-w-0 justify-start px-3 py-2 text-left",onClick:()=>{el(),C("custom"),O(null),L(!1),q(""),M(z?p(z):""),Y(null)},children:[(0,r.jsx)(i.A,{className:"mr-2 size-4 shrink-0"}),(0,r.jsx)("span",{className:"text-xs font-medium",children:N("customCwd")})]})]})})(),"roots"===X&&(0,r.jsxs)("p",{role:"status",className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,r.jsx)(l.A,{className:"size-3.5 animate-spin"}),N("loadingRoots")]}),"custom"===T&&R.length>1&&(0,r.jsxs)("label",{className:"flex min-w-0 flex-col gap-1 text-xs font-medium",children:[N("browseRoot"),(0,r.jsx)("select",{"aria-label":N("browseRoot"),value:z,className:"h-11 min-w-0 rounded-md border border-input bg-background px-3 font-mono text-xs sm:h-9",onChange:e=>{el(),ei(),_(e.target.value),L(!1),M(p(e.target.value)),q(""),Y(null)},children:R.map(e=>(0,r.jsx)("option",{value:e,children:e},e))})]}),"custom"===T&&(z||U)&&(0,r.jsxs)("div",{className:"flex min-w-0 gap-2",children:[(0,r.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,r.jsx)(f.p,{role:"combobox","aria-label":N("pathPrefix"),"aria-autocomplete":U?"none":"list","aria-expanded":K,"aria-controls":U?void 0:"directory-candidates","aria-activedescendant":K&&J>=0?"directory-candidate-".concat(J):void 0,value:P,onChange:e=>{el(),M(e.target.value),L(!0),q(U?e.target.value.trim():""),Y(null)},onKeyDown:e=>{if(!(0,m.P)(e)){if("Escape"===e.key&&K){e.preventDefault(),F(!1);return}if(0!==$.length&&K){if("ArrowDown"===e.key||"ArrowUp"===e.key){e.preventDefault();let t="ArrowDown"===e.key?1:-1;W(e=>(e+t+$.length)%$.length);return}("Tab"===e.key||"Enter"===e.key)&&J>=0&&(e.preventDefault(),ed($[J]))}}},placeholder:N("pathPlaceholder"),className:"h-11 min-w-0 pr-9 font-mono text-xs sm:h-9"}),"browse"===X&&(0,r.jsx)(l.A,{"aria-label":N("loadingCandidates"),className:"absolute right-3 top-2.5 size-4 animate-spin text-muted-foreground"})]}),!U&&(0,r.jsx)(u.$,{type:"button",size:"icon",variant:"outline",className:"size-11 sm:size-9",disabled:P===z,onClick:()=>{el();let e=function(e,t){let n=x(t),r=t.endsWith(n)&&t.length>1?t.slice(0,-1):t,a=e.endsWith(n)&&e.length>r.length?e.slice(0,-1):e,o=a.slice(0,a.lastIndexOf(n));return!o||o.length<r.length?r:o.startsWith(p(r))?o:r}(P,z);ei(),L(!0),M(p(e)),q(e),Y(null)},"aria-label":N("parent"),title:N("parent"),children:(0,r.jsx)(c.A,{className:"size-4"})})]}),"custom"===T&&K&&$.length>0&&(0,r.jsx)("div",{id:"directory-candidates",role:"listbox",className:"max-h-40 overflow-y-auto rounded-md border border-border p-1",children:$.map((e,t)=>(0,r.jsxs)("button",{id:"directory-candidate-".concat(t),type:"button",role:"option","aria-selected":t===J,className:"flex min-h-11 w-full min-w-0 items-center gap-2 rounded px-2 py-2 text-left text-xs hover:bg-muted aria-selected:bg-muted",onMouseDown:e=>e.preventDefault(),onClick:()=>ed(e),children:[(0,r.jsx)(d.A,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,r.jsx)("span",{className:"min-w-0 break-all font-mono",children:e.path})]},e.path))}),"custom"===T&&Q===P&&0===$.length&&null===X&&!Z&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:N("empty")}),B&&(0,r.jsxs)("div",{className:"min-w-0 rounded-md border border-border bg-muted/30 p-3",children:[(0,r.jsx)("p",{className:"text-[11px] font-medium text-muted-foreground",children:N("selection")}),(0,r.jsx)("p",{className:"mt-1 break-all font-mono text-xs",children:B}),(0,r.jsx)("p",{className:"mt-1 truncate text-[11px] text-muted-foreground",children:(null!=S?S:k).host})]}),Z&&(0,r.jsx)("p",{role:"alert",className:"text-xs text-destructive",children:N("errors.".concat(Z))}),w&&(0,r.jsxs)(u.$,{type:"button",size:"sm",className:"h-11 w-fit sm:h-8",disabled:!B||null!==X,onClick:()=>void eu(),children:["validate"===X&&(0,r.jsx)(l.A,{className:"mr-2 size-4 animate-spin"}),v]})]})]})}},42305:(e,t,n)=>{n.d(t,{P:()=>r});function r(e){return("nativeEvent"in e?e.nativeEvent:e).isComposing||229===e.keyCode}},48416:(e,t,n)=>{n.d(t,{BT:()=>l,Wu:()=>c,ZB:()=>i,Zp:()=>o,aR:()=>s});var r=n(90508);n(1856);var a=n(24377);function o(e){let{className:t,...n}=e;return(0,r.jsx)("div",{"data-slot":"card",className:(0,a.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...n})}function s(e){let{className:t,...n}=e;return(0,r.jsx)("div",{"data-slot":"card-header",className:(0,a.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...n})}function i(e){let{className:t,...n}=e;return(0,r.jsx)("div",{"data-slot":"card-title",className:(0,a.cn)("leading-none font-semibold",t),...n})}function l(e){let{className:t,...n}=e;return(0,r.jsx)("div",{"data-slot":"card-description",className:(0,a.cn)("text-muted-foreground text-sm",t),...n})}function c(e){let{className:t,...n}=e;return(0,r.jsx)("div",{"data-slot":"card-content",className:(0,a.cn)("px-6",t),...n})}},62990:(e,t,n)=>{n.d(t,{IT:()=>c,cC:()=>u,hj:()=>s,ri:()=>f,tm:()=>d,w9:()=>i});var r=n(30509);let a=null;function o(){if(!a){let e=(0,r.XQ)();e&&(a=(0,r.HB)(e))}return a}function s(e){return(0,r.vh)(e),a=(0,r.HB)(e)}function i(){a=null}async function l(){let e=o();if(!e)return null;try{return await e.getUser()}catch(e){return null}}async function c(){let e=await l();if(!(null==e?void 0:e.refresh_token)||!e.access_token)return!1;try{return(await fetch("/api/auth/sync-token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:e.access_token,refreshToken:e.refresh_token})})).ok}catch(e){return!1}}async function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return fetch(e,{...t,credentials:"same-origin"})}async function u(){let e=o();if(e)try{await e.removeUser()}catch(e){}i(),(0,r.JK)()}async function f(){try{await fetch("/api/auth/logout",{method:"POST"})}catch(e){}let e=o();if(e)try{await e.removeUser()}catch(e){}i(),(0,r.JK)()}},73693:(e,t,n)=>{n.d(t,{BK:()=>i,eu:()=>s,q5:()=>l});var r=n(90508);n(1856);var a=n(65514),o=n(24377);function s(e){let{className:t,size:n="default",...s}=e;return(0,r.jsx)(a.Root,{"data-slot":"avatar","data-size":n,className:(0,o.cn)("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",t),...s})}function i(e){let{className:t,...n}=e;return(0,r.jsx)(a.Image,{"data-slot":"avatar-image",className:(0,o.cn)("aspect-square size-full",t),...n})}function l(e){let{className:t,...n}=e;return(0,r.jsx)(a.Fallback,{"data-slot":"avatar-fallback",className:(0,o.cn)("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",t),...n})}},91385:(e,t,n)=>{n.d(t,{AgentAvatar:()=>h,Pf:()=>m});var r=n(90508),a=n(1856),o=n(5425),s=n(93832),i=n(5985),l=n(14518),c=n(73693),d=n(24377);let u=new s.O(l),f=new Map;function m(e,t){let n,r="".concat(t,"\0").concat(e),a=f.get(r);if(void 0!==a)return a;try{let r="animated"===t?{seed:e,tags:["animation"]}:{seed:e,tags:["!animation"]};n=new i.e(u,r).toDataUri()}catch(e){n=null}return f.set(r,n),n}let g={xs:20,sm:24,md:32,lg:40};function h(e){let{name:t,size:n="md",animate:s=!0,className:i}=e,[l,u]=a.useState(!1);a.useEffect(()=>{var e;if("function"!=typeof window.matchMedia)return;let t=window.matchMedia("(prefers-reduced-motion: reduce)");u(t.matches);let n=e=>u(e.matches);return null==(e=t.addEventListener)||e.call(t,"change",n),()=>{var e;return null==(e=t.removeEventListener)?void 0:e.call(t,"change",n)}},[]);let f=s&&!l?"animated":"static",h=a.useMemo(()=>m(t,f),[t,f]),x="number"==typeof n?n:g[n],p=t.trim().charAt(0).toUpperCase();return(0,r.jsxs)(c.eu,{"data-slot":"agent-avatar","data-motion":f,className:(0,d.cn)("shrink-0 rounded-md bg-muted",i),style:{width:x,height:x},children:[h?(0,r.jsx)(c.BK,{src:h,alt:t,className:(0,d.cn)("rounded-md","origin-top scale-[1.5] -translate-y-[10%]"),draggable:!1}):null,(0,r.jsx)(c.q5,{className:"rounded-md","aria-label":t,children:p?(0,r.jsx)("span",{className:"text-[0.7em] font-medium",children:p}):(0,r.jsx)(o.A,{className:"size-1/2","aria-hidden":!0})})]})}},91814:(e,t,n)=>{n.d(t,{r:()=>o});var r=n(27290),a=n(1856);function o(){let e=(0,r.r)({delay:120});return(0,a.useMemo)(()=>({...e,refresh:()=>e.refresh({showProgress:!1})}),[e])}},97438:(e,t,n)=>{n.d(t,{Cf:()=>f,Es:()=>g,L3:()=>h,c7:()=>m,lG:()=>l,rr:()=>x,zM:()=>c});var r=n(90508);n(1856);var a=n(9160),o=n(71350),s=n(24377),i=n(22922);function l(e){let{...t}=e;return(0,r.jsx)(o.Root,{"data-slot":"dialog",...t})}function c(e){let{...t}=e;return(0,r.jsx)(o.Trigger,{"data-slot":"dialog-trigger",...t})}function d(e){let{...t}=e;return(0,r.jsx)(o.Portal,{"data-slot":"dialog-portal",...t})}function u(e){let{className:t,...n}=e;return(0,r.jsx)(o.Overlay,{"data-slot":"dialog-overlay",className:(0,s.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...n})}function f(e){let{className:t,overlayClassName:n,children:i,showCloseButton:l=!0,...c}=e;return(0,r.jsxs)(d,{"data-slot":"dialog-portal",children:[(0,r.jsx)(u,{className:n}),(0,r.jsxs)(o.Content,{"data-slot":"dialog-content",className:(0,s.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",t),...c,children:[i,l&&(0,r.jsxs)(o.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,r.jsx)(a.A,{}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function m(e){let{className:t,...n}=e;return(0,r.jsx)("div",{"data-slot":"dialog-header",className:(0,s.cn)("flex flex-col gap-2 text-center sm:text-left",t),...n})}function g(e){let{className:t,showCloseButton:n=!1,children:a,...l}=e;return(0,r.jsxs)("div",{"data-slot":"dialog-footer",className:(0,s.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...l,children:[a,n&&(0,r.jsx)(o.Close,{asChild:!0,children:(0,r.jsx)(i.$,{variant:"outline",children:"Close"})})]})}function h(e){let{className:t,...n}=e;return(0,r.jsx)(o.Title,{"data-slot":"dialog-title",className:(0,s.cn)("text-lg leading-none font-semibold",t),...n})}function x(e){let{className:t,...n}=e;return(0,r.jsx)(o.Description,{"data-slot":"dialog-description",className:(0,s.cn)("text-muted-foreground text-sm",t),...n})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[46437],{875:(e,t,a)=>{a.d(t,{i:()=>b});var s=a(90508),n=a(1856),r=a(39268),i=a(85226),l=a(67587),o=a(22922),d=a(97438),c=a(14554),u=a(15972),x=a(88064),m=a(39077),p=a(39674),h=a(42305),f=a(62990),g=a(59208),v=a(71921);function b(e){var t;let{open:a,onOpenChange:b,onCloseAutoFocus:j,projectUuid:y,onCreated:k,parentUuid:N,parentTitle:w}=e,C=(0,r.c)("ideaTracker"),S=(0,r.c)("ideaTracker.lineage"),A=!!N,F=(0,r.c)("common"),[E,_]=(0,n.useState)(""),[D,U]=(0,n.useState)(""),[R,T]=(0,n.useState)(!1),[I,P]=(0,n.useState)(!1),[M,L]=(0,n.useState)(null),[B,z]=(0,n.useState)(!1),[O,q]=(0,n.useState)(!1),[V,$]=(0,n.useState)(!1);(0,n.useEffect)(()=>{q(!1)},[a,y]);let[K,H]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(!a||A)return;let e=!1;return(0,f.tm)("/api/projects/".concat(encodeURIComponent(y),"/agent-cwds")).then(async t=>{if(!t.ok)return;let a=await t.json();if(!e){var s,n;H((null!=(n=null==a||null==(s=a.data)?void 0:s.agents)?n:[]).some(e=>e.preference))}}).catch(()=>{e||H(!1)}),()=>{e=!0}},[A,a,y]);let G=(0,g.kz)(),J=(null!=(t=null==G?void 0:G.connections)?t:[]).some(e=>"online"===e.effectiveStatus),[Q,W]=(0,n.useState)("form"),X=!A,Z=A?"form":Q,Y=async()=>{let e=E.trim();if(e){P(!0),L(null);try{var t;let a=await fetch("/api/projects/".concat(y,"/ideas"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,content:D.trim()||void 0,...N?{parentUuid:N}:{},...R?{isContainer:!0}:{}})}),s=await a.json();s.success&&(null==(t=s.data)?void 0:t.uuid)?(_(""),U(""),T(!1),b(!1),null==k||k(s.data.uuid)):L(s.error||C("error.createFailed"))}catch(e){L(C("error.createFailed"))}finally{P(!1)}}},ee=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"space-y-4 py-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(x.J,{htmlFor:"idea-title",children:C("newIdea.ideaTitle")}),(0,s.jsx)(c.p,{id:"idea-title",value:E,onChange:e=>_(e.target.value),placeholder:C("newIdea.titlePlaceholder"),autoFocus:!0,onKeyDown:e=>{!(0,h.P)(e)&&"Enter"===e.key&&!e.shiftKey&&E.trim()&&(e.preventDefault(),Y())}})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)(x.J,{htmlFor:"idea-content",children:[C("newIdea.description"),(0,s.jsxs)("span",{className:"ml-1 text-xs font-normal text-muted-foreground",children:["(",F("optional"),")"]})]}),(0,s.jsx)(u.T,{id:"idea-content",value:D,onChange:e=>U(e.target.value),placeholder:C("newIdea.descriptionPlaceholder"),rows:4,className:"resize-none"})]}),(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(m.S,{id:"idea-is-container",checked:R,onCheckedChange:e=>T(!0===e),className:"mt-0.5"}),(0,s.jsxs)("div",{className:"grid gap-1 leading-none",children:[(0,s.jsx)(x.J,{htmlFor:"idea-is-container",className:"cursor-pointer",children:S("makeContainer")}),(0,s.jsx)("p",{className:"text-xs font-normal text-muted-foreground",children:S("containerHint")})]})]}),M&&(0,s.jsx)("div",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-[12px] text-destructive",children:M})]}),(0,s.jsxs)(d.Es,{children:[(0,s.jsx)(o.$,{variant:"outline",onClick:()=>b(!1),disabled:I,children:F("cancel")}),(0,s.jsxs)(o.$,{onClick:Y,disabled:I||!E.trim(),className:"bg-primary hover:bg-[#B56A42] text-white",children:[I?(0,s.jsx)(i.A,{className:"mr-2 h-4 w-4 animate-spin"}):null,F("create")]})]})]}),et=async e=>{$(!0);try{let a=await (0,f.tm)("/api/ideas/conversational",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectUuid:y,agentUuid:e.agentUuid,connectionUuid:e.connectionUuid,descriptionText:e.userText,researchFirst:O,...B?{decompose:!0}:{}})});if(!a.ok){let e=null;try{let t=await a.json();"string"==typeof(null==t?void 0:t.error)&&t.error&&(e=t.error)}catch(e){}throw new v.fF(a.status,e)}let s=null;try{var t;let e=await a.json();(null==e?void 0:e.success)&&(null==(t=e.data)?void 0:t.session)&&(s=e.data.session)}catch(e){}if(!s)throw new v.fF(a.status,null);return s}finally{$(!1)}},ea=(0,s.jsxs)("div",{className:"space-y-3 py-2",children:[(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(m.S,{id:"idea-research-first",checked:O,onCheckedChange:e=>q(!0===e),disabled:V,"aria-describedby":"idea-research-first-hint",className:"mt-0.5"}),(0,s.jsxs)("div",{className:"grid gap-1",children:[(0,s.jsx)(x.J,{htmlFor:"idea-research-first",className:"cursor-pointer",children:C("newIdea.researchFirst")}),(0,s.jsx)("p",{id:"idea-research-first-hint",className:"text-xs leading-4 text-muted-foreground",children:C("newIdea.researchFirstHint")})]})]}),(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(m.S,{id:"idea-decompose",checked:B,disabled:V,onCheckedChange:e=>z(!0===e),className:"mt-0.5"}),(0,s.jsxs)("div",{className:"grid gap-1 leading-none",children:[(0,s.jsx)(x.J,{htmlFor:"idea-decompose",className:"cursor-pointer",children:C("newIdea.decompose")}),(0,s.jsx)("p",{className:"text-xs font-normal text-muted-foreground",children:C("newIdea.decomposeHint")})]})]}),(0,s.jsx)(v.jH,{projectUuid:y,dispatch:et,onStarted:()=>{b(!1),l.oR.success(C("newIdea.submitted"))}})]});return(0,s.jsx)(d.lG,{open:a,onOpenChange:b,children:(0,s.jsxs)(d.Cf,{className:"sm:max-w-[480px]",onCloseAutoFocus:j,children:[(0,s.jsxs)(d.c7,{children:[(0,s.jsx)(d.L3,{children:A?S("deriveIdea"):C("newIdea.title")}),A&&w&&(0,s.jsxs)("p",{className:"text-[13px] text-muted-foreground",children:[S("derivedFrom")," \xb7 ",w]})]}),X&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p.tU,{value:Z,onValueChange:e=>W(e),children:(0,s.jsxs)(p.j7,{className:"grid w-full grid-cols-2",children:[(0,s.jsx)(p.Xi,{value:"form",children:C("newIdea.modeForm")}),(0,s.jsx)(p.Xi,{value:"conversation",disabled:!J&&!K,children:C("newIdea.modeConversation")})]})}),!J&&(0,s.jsxs)("div",{className:"rounded-xl border border-[#EFEBE4] dark:border-[#2a2a2e] bg-[#FCFBF8] dark:bg-[#1e1d1b] px-3 py-2",children:[(0,s.jsx)("p",{className:"px-1 pt-1 text-[12px] font-medium text-muted-foreground",children:C("newIdea.modeConversationOfflineHint")}),(0,s.jsx)(v.Bs,{variant:"compact"})]})]}),"form"===Z?ee:ea]})})}},5725:(e,t,a)=>{a.d(t,{b:()=>d});var s=a(1856),n=a(93367),r=a(90508),i="horizontal",l=["horizontal","vertical"],o=s.forwardRef((e,t)=>{var a;let{decorative:s,orientation:o=i,...d}=e,c=(a=o,l.includes(a))?o:i;return(0,r.jsx)(n.sG.div,{"data-orientation":c,...s?{role:"none"}:{"aria-orientation":"vertical"===c?c:void 0,role:"separator"},...d,ref:t})});o.displayName="Separator";var d=o},24522:(e,t,a)=>{a.d(t,{K:()=>p});var s=a(90508),n=a(1856),r=a(39268),i=a(70633),l=a(9160),o=a(22922),d=a(57731),c=a(64993),u=a(82813),x=a(82523),m=a(90795);function p(e){let{title:t,type:a,content:p,mode:h="overlay",onClose:f,onBack:g}=e,v=(0,r.c)("documents"),[b,j]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=setTimeout(()=>j(!0),300);return()=>clearTimeout(e)},[]),(0,n.useEffect)(()=>{let e=e=>{"Escape"!==e.key||e.defaultPrevented||(e.preventDefault(),f())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[f]);let y="sidebyside"===h;return(0,s.jsxs)(s.Fragment,{children:[!y&&(0,s.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:f}),(0,s.jsxs)("div",{className:"fixed top-14 md:top-0 flex h-[calc(100%-3.5rem)] md:h-full w-full md:w-[480px] flex-col bg-card shadow-xl border-l border-border ".concat(y?"z-40 ".concat(b?"":"animate-in slide-in-from-right duration-300"):"z-50 right-0 ".concat(b?"":"animate-in slide-in-from-right duration-300")),style:y?{right:"".concat(m.L8,"px")}:void 0,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-secondary px-6 py-5",children:[g&&(0,s.jsx)(o.$,{variant:"ghost",size:"icon",className:"mr-2 h-8 w-8 shrink-0",onClick:g,children:(0,s.jsx)(i.A,{className:"h-4 w-4 text-muted-foreground"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("h2",{className:"text-base font-semibold text-foreground truncate",children:t}),(0,s.jsx)("div",{className:"mt-1.5",children:(0,s.jsx)(d.E,{variant:"outline",className:"text-[10px] font-medium border-border text-muted-foreground bg-secondary px-2 py-0.5 font-mono",children:v(x.y[a]||"typeOther")})})]}),(0,s.jsx)(o.$,{variant:"outline",size:"icon",className:"ml-4 h-8 w-8 shrink-0 border-border",onClick:f,children:(0,s.jsx)(l.A,{className:"h-4 w-4 text-muted-foreground"})})]}),(0,s.jsx)(c.F,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:(0,s.jsx)("div",{className:"px-6 py-5 text-[13px] leading-relaxed text-foreground prose prose-sm max-w-none [&_h1]:text-lg [&_h1]:font-semibold [&_h1]:mt-4 [&_h1]:mb-2 [&_h2]:text-base [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mb-1.5 [&_h3]:text-sm [&_h3]:font-medium [&_h3]:mt-2 [&_h3]:mb-1 [&_p]:text-[13px] [&_p]:text-foreground/80 [&_p]:my-1.5 [&_li]:text-[13px] [&_li]:text-foreground/80 [&_ul]:my-1 [&_ol]:my-1 [&_strong]:text-foreground [&_code]:text-[12px] [&_code]:bg-secondary [&_code]:text-foreground [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_pre]:bg-secondary [&_pre]:text-foreground [&_pre]:p-3 [&_pre]:rounded-lg [&_pre]:my-2 [&_a]:text-primary",children:(0,s.jsx)(u.MarkdownContent,{children:(0,x.j)(p)})})})]})]})}},27337:(e,t,a)=>{a.d(t,{D:()=>tf});var s=a(90508),n=a(1856),r=a(39268),i=a(91814),l=a(67587),o=a(9160),d=a(85226),c=a(64131),u=a(66206);let x=(0,u.A)("corner-left-up",[["path",{d:"M14 9 9 4 4 9",key:"1af5af"}],["path",{d:"M20 20h-7a4 4 0 0 1-4-4V4",key:"1blwi3"}]]);var m=a(48127),p=a(34956),h=a(22922),f=a(64993),g=a(57731),v=a(14554),b=a(15972),j=a(88064),y=a(12210),k=a(51817),N=a(63964),w=a(5425),C=a(84247),S=a(94305),A=a(82813),F=a(16544),E=a(65626),_=a(73693),D=a(91385),U=a(92691),R=a(71921),T=a(29532);function I(e){let{assignee:t,onReassign:a,editable:n}=e,i=(0,r.c)("common"),l=!0===n&&"function"==typeof a,o=i(t?"reassign":"assign"),d=t?(0,s.jsxs)(s.Fragment,{children:[(0,T.bB)(t)?(0,s.jsx)(D.AgentAvatar,{name:t.name,size:28,className:"rounded-full"}):(0,s.jsx)(_.eu,{className:"h-7 w-7",children:(0,s.jsx)(_.q5,{className:"bg-border text-muted-foreground",children:t.name.charAt(0).toUpperCase()})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("div",{className:"text-sm font-medium text-foreground",children:t.name}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:i((0,T.bB)(t)?"agent":"user")}),"agent_instance"===t.type&&t.instance&&(0,s.jsx)("div",{className:"mt-1",children:(0,s.jsx)(R.jQ,{cwd:t.instance.cwd,host:t.instance.host})})]})]}):(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:i("unassigned")}),c="mt-2 flex items-center gap-2.5 rounded-lg bg-background p-3";return(0,s.jsxs)("div",{children:[(0,s.jsx)(j.J,{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:i("assignee")}),l?(0,s.jsx)(U.Bc,{delayDuration:300,children:(0,s.jsxs)(U.m_,{children:[(0,s.jsx)(U.k$,{asChild:!0,children:(0,s.jsx)("button",{type:"button",onClick:a,"aria-label":o,className:"".concat(c," w-full cursor-pointer text-left"),children:d})}),(0,s.jsx)(U.ZI,{children:o})]})}):(0,s.jsx)("div",{className:c,children:d})]})}function P(e){let{idea:t,elaboration:a,isLoading:n,onRefresh:i,onReassign:l,canReassign:o}=e,c=(0,r.c)("ideaTracker"),u=(0,r.c)("common");return n?(0,s.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,s.jsx)(d.A,{className:"h-5 w-5 animate-spin text-primary"})}):(0,s.jsxs)(F.P.div,{variants:E.qG,initial:"initial",animate:"animate",children:[(0,s.jsx)(I,{assignee:t.assignee,onReassign:l,editable:o}),(0,s.jsx)(C.Separator,{className:"my-5 bg-secondary"}),a&&a.rounds.length>0?(0,s.jsx)("div",{children:(0,s.jsx)(S.R,{ideaUuid:t.uuid,elaboration:a,onRefresh:i})}):"open"===t.status?(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-8 text-center",children:[(0,s.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#FFF3E0] dark:bg-[#3a2a12]",children:(0,s.jsx)(w.A,{className:"h-5 w-5 text-[#E65100] dark:text-[#F0A050]"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground",children:c("panel.elaborationNotStarted")}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:c("panel.elaborationNotStartedDesc")})]})]}):(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-8 text-center",children:[(0,s.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#E3F2FD] dark:bg-[#13253a]",children:(0,s.jsx)(w.A,{className:"h-5 w-5 text-[#1976D2] dark:text-[#5AA9F0]"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground",children:c("panel.elaborationWaiting")}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:c("panel.elaborationWaitingDesc")})]})]}),t.content&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(C.Separator,{className:"my-5 bg-secondary"}),(0,s.jsxs)("div",{children:[(0,s.jsx)(j.J,{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:u("content")}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)("div",{className:"prose prose-sm max-w-none text-[13px] leading-relaxed text-foreground",children:(0,s.jsx)(A.MarkdownContent,{children:t.content})})})]})]})]})}var M=a(12790),L=a.n(M),B=a(94302),z=a(78948),O=a(37915),q=a(17730),V=a(32470),$=a(96213),K=a(47754),H=a(92745),G=a(82523),J=a(76167),Q=a(83987),W=a(67712);function X(e){let{idea:t,projectUuid:a,onTaskClick:i,onDocClick:l,initialProposals:o}=e,c=(0,r.c)("ideaTracker"),[u,x]=(0,n.useState)(null!=o?o:[]),[m,p]=(0,n.useState)(!o),h=(0,n.useCallback)(async()=>{try{let e=await (0,J.U)(a,t.uuid);if(e.success)return x(e.data),e.data}catch(e){W.q.error("Failed to fetch proposals:",e)}finally{p(!1)}return[]},[a,t.uuid]);(0,n.useEffect)(()=>{o||h()},[h,o]);let f=(0,n.useRef)(u);f.current=u;let{getPresence:g}=(0,K.xQ)();return((0,N.eV)("proposal",async()=>{let e=f.current;for(let r of(await h())){var t,a,s,n;let i=e.find(e=>e.uuid===r.uuid);if(!i)continue;let l=new Set((null!=(t=i.documentDrafts)?t:[]).map(e=>e.uuid)),o=new Set((null!=(a=i.taskDrafts)?a:[]).map(e=>e.uuid)),d=(null!=(s=r.documentDrafts)?s:[]).filter(e=>e.uuid&&!l.has(e.uuid)),c=(null!=(n=r.taskDrafts)?n:[]).filter(e=>e.uuid&&!o.has(e.uuid)),u=[...d.map(e=>e.uuid),...c.map(e=>e.uuid)];if(u.length>0){let e=g("proposal",r.uuid)[0];if(e)for(let t of u)(0,K.fv)({entityType:"proposal",entityUuid:r.uuid,subEntityType:"draft",subEntityUuid:t,agentUuid:e.agentUuid,agentName:e.agentName,action:"mutate"})}}}),m)?(0,s.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,s.jsx)(d.A,{className:"h-5 w-5 animate-spin text-primary"})}):0===u.length?(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[(0,s.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#F3E5F5] dark:bg-[#281630]",children:(0,s.jsx)(B.A,{className:"h-5 w-5 text-[#7B1FA2] dark:text-[#C98FE0]"})}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:c("panel.noProposals")})]}):(0,s.jsx)("div",{className:"space-y-5",children:u.map(e=>(0,s.jsx)(Y,{proposal:e,projectUuid:a,onTaskClick:i,onDocClick:l},e.uuid))})}let Z={draft:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-muted-foreground",pending:"bg-[#FFF3E0] dark:bg-[#3a2a12] text-[#E65100] dark:text-[#F0A050]",approved:"bg-[#E8F5E9] dark:bg-[#14281a] text-[#5A9E6F] dark:text-[#6FD19A]",rejected:"bg-[#FFEBEE] dark:bg-[#331619] text-[#C4574C] dark:text-[#F0897E]",revised:"bg-[#E3F2FD] dark:bg-[#13253a] text-[#1976D2] dark:text-[#5AA9F0]",closed:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-muted-foreground"};function Y(e){let{proposal:t,projectUuid:a,onTaskClick:i,onDocClick:l}=e,o=(0,r.c)("ideaTracker"),d=(0,r.c)(),c=(0,r.c)("proposals"),u=(0,r.c)("tasks"),x=(0,r.c)("documents"),m=t.documentDrafts||[],p=t.taskDrafts||[],[f,v]=(0,n.useState)(new Set),[b,j]=(0,n.useState)("cards"),[y,k]=(0,n.useState)([]),N="approved"===t.status;(0,n.useEffect)(()=>{N&&(0,Q.c)(a,t.uuid).then(e=>{e.success&&k(e.data||[])}).catch(e=>W.q.error("Failed to fetch materialized tasks:",e))},[N,a,t.uuid]);let w=(0,n.useMemo)(()=>{let e=new Map;for(let t of y)e.set(t.title,t);return e},[y]),{dagTasks:C,dagEdges:S,dagHeight:F}=(0,n.useMemo)(()=>{let e=p.map(e=>{let t=w.get(e.title);return{uuid:(null==t?void 0:t.uuid)||e.uuid,title:e.title,status:(null==t?void 0:t.status)||"open",priority:e.priority||"medium"}}),t=[],a=new Map(p.map(e=>[e.uuid,e]));for(let e of p)if(e.dependsOnDraftUuids)for(let s of e.dependsOnDraftUuids){let n=w.get(e.title),r=a.get(s),i=r?w.get(r.title):void 0;t.push({from:(null==n?void 0:n.uuid)||e.uuid,to:(null==i?void 0:i.uuid)||s})}return{dagTasks:e,dagEdges:t,dagHeight:Math.max(350,90*e.length)}},[p,w]),E=N?y.filter(e=>"done"===e.status||"closed"===e.status).length:0;return(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("h3",{className:"text-[14px] font-semibold text-foreground truncate flex-1",children:t.title}),(0,s.jsx)(g.E,{className:"text-[11px] font-semibold border-0 shrink-0 ".concat(Z[t.status]||""),children:d("status.".concat(t.status))})]}),t.description&&(0,s.jsx)("div",{className:"max-h-[120px] overflow-y-auto text-[13px] leading-relaxed text-foreground/80 prose prose-sm max-w-none [&_h1]:text-sm [&_h2]:text-[13px] [&_h3]:text-xs [&_p]:text-[13px] [&_p]:text-foreground/80 [&_p]:my-1.5 [&_li]:text-[13px] [&_li]:text-foreground/80 [&_ul]:my-1 [&_ol]:my-1 [&_strong]:text-foreground [&_code]:bg-secondary [&_code]:text-foreground [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_a]:text-primary",children:(0,s.jsx)(A.MarkdownContent,{children:(0,G.j)(t.description)})}),(0,s.jsxs)(L(),{href:"/projects/".concat(a,"/proposals/").concat(t.uuid),className:"flex items-center gap-1 text-[13px] font-medium text-primary hover:underline",children:[o("panel.viewProposal"),(0,s.jsx)(z.A,{className:"h-3.5 w-3.5"})]}),m.length>0&&(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-muted-foreground",children:c(N?"documents":"documentDrafts")}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground",children:m.length})]}),(0,s.jsx)("div",{className:"space-y-0",children:m.map((e,a)=>(0,s.jsx)($.D,{entityType:"proposal",entityUuid:t.uuid,subEntityType:"draft",subEntityUuid:e.uuid||"draft-".concat(a),badgeInside:!0,children:(0,s.jsxs)(h.$,{variant:"ghost",className:"w-full justify-start h-auto text-left flex items-center gap-2.5 py-3.5 hover:bg-background transition-colors cursor-pointer -mx-1 px-1 rounded-lg",onClick:()=>e.content&&(null==l?void 0:l({title:e.title,type:e.type,content:e.content})),children:[(0,s.jsx)(O.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,s.jsx)(g.E,{variant:"outline",className:"shrink-0 text-[10px] font-medium border-border text-muted-foreground bg-secondary px-2 py-0.5 font-mono",children:x(G.y[e.type]||"typeOther")}),(0,s.jsx)("span",{className:"flex-1 min-w-0 text-left text-[13px] text-foreground truncate",children:e.title})]})},e.uuid||a))})]}),(p.length>0||y.length>0)&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between pb-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-muted-foreground",children:c(N?"tasks":"taskDrafts")}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground",children:N&&y.length>0?y.length:p.length})]}),(0,s.jsxs)("span",{className:"text-[12px] text-muted-foreground",children:[E,"/",N&&y.length>0?y.length:p.length]})]}),(0,s.jsx)("div",{className:"-mx-6 border-t border-border"}),S.length>0&&(0,s.jsxs)("div",{className:"flex gap-0.5 rounded-lg border border-border bg-[#F7F6F3] dark:bg-[#1e1d1b] p-0.5 mt-3 w-fit",children:[(0,s.jsx)(h.$,{variant:"ghost",size:"sm",onClick:()=>j("cards"),className:"rounded-md px-2.5 py-1 h-auto text-[11px] font-medium transition-colors ".concat("cards"===b?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-muted-foreground"),children:c("cardsView")}),(0,s.jsx)(h.$,{variant:"ghost",size:"sm",onClick:()=>j("dag"),className:"rounded-md px-2.5 py-1 h-auto text-[11px] font-medium transition-colors ".concat("dag"===b?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-muted-foreground"),children:u("dagView")})]}),"cards"===b&&(0,s.jsx)("div",{className:"space-y-0",children:N&&y.length>0?y.map(e=>(0,s.jsx)($.D,{entityType:"task",entityUuid:e.uuid,badgeInside:!0,children:(0,s.jsx)(ea,{task:{uuid:e.uuid,title:e.title},expanded:!1,onToggle:()=>{},onNavigate:i?()=>i(e.uuid):void 0,taskStatus:e.status})},e.uuid)):p.map((e,a)=>(0,s.jsx)($.D,{entityType:"proposal",entityUuid:t.uuid,subEntityType:"draft",subEntityUuid:e.uuid,badgeInside:!0,children:(0,s.jsx)(ea,{task:e,expanded:f.has(a),onToggle:()=>{v(e=>{let t=new Set(e);return t.has(a)?t.delete(a):t.add(a),t})}})},e.uuid))}),"dag"===b&&(0,s.jsx)("div",{className:"mt-3",children:(0,s.jsx)(H._u,{tasks:C,edges:S,readonly:!0,height:F,onNodeClick:i})})]}),0===m.length&&0===p.length&&0===y.length&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground italic",children:c("emptyContainer")})]})}let ee={open:"border-[#D9D9D9] dark:border-[#3a3a40] bg-card",assigned:"border-[#1976D2] bg-[#1976D2]",in_progress:"border-[#5A9E6F] bg-[#5A9E6F]",to_verify:"border-[#7B1FA2] bg-[#7B1FA2]",done:"border-[#00796B] bg-[#00796B]",closed:"border-[#9A9A9A] bg-[#9A9A9A] dark:border-[#6b6862] dark:bg-[#6b6862]"},et={open:null,assigned:null,in_progress:{className:"bg-[#E8F5E9] dark:bg-[#14281a] text-[#5A9E6F] dark:text-[#6FD19A]",key:"inProgress"},to_verify:{className:"bg-[#F3E5F5] dark:bg-[#281630] text-[#7B1FA2] dark:text-[#C98FE0]",key:"toVerify"},done:{className:"bg-[#E0F2F1] dark:bg-[#12292a] text-[#00796B] dark:text-[#4FD1C0]",key:"done"},closed:{className:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-muted-foreground",key:"done"}};function ea(e){let{task:t,expanded:a,onToggle:n,onNavigate:i,taskStatus:l}=e,o=(0,r.c)("proposals"),d=(0,r.c)("acceptanceCriteria"),c=(0,r.c)("status"),u=t.acceptanceCriteriaItems||[],x=!!(t.description||u.length>0),m=l?ee[l]||ee.open:"border-[#D9D9D9] dark:border-[#3a3a40] bg-card",p=l?et[l]:null,f=(0,s.jsx)("span",{className:"shrink-0 h-2 w-2 rounded-full border-[1.5px] ".concat(m," transition-colors")}),g=(0,s.jsx)("span",{className:"flex-1 min-w-0 text-[13px] leading-snug truncate text-muted-foreground",children:t.title}),v=p?(0,s.jsx)("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium ".concat(p.className),children:c(p.key)}):null;return i?(0,s.jsxs)(h.$,{variant:"ghost",onClick:i,className:"w-full justify-start h-auto text-left flex items-center gap-2.5 py-4 cursor-pointer hover:bg-background -mx-1 px-1 rounded-lg transition-colors",children:[(0,s.jsx)(O.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),f,g,v]}):(0,s.jsxs)("div",{children:[(0,s.jsxs)(h.$,{variant:"ghost",onClick:x?n:void 0,className:"w-full justify-start h-auto text-left flex items-center gap-2.5 py-4 ".concat(x?"cursor-pointer hover:bg-background -mx-1 px-1 rounded-lg":""," transition-colors"),children:[a?(0,s.jsx)(q.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):(0,s.jsx)(z.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),f,g,v]}),a&&x&&(0,s.jsxs)("div",{className:"pb-3 pl-5 space-y-3",children:[t.description&&(0,s.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:t.description}),u.length>0&&(0,s.jsxs)("div",{className:"rounded-lg bg-background p-3 space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(V.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,s.jsx)("span",{className:"text-[11px] font-semibold text-foreground",children:o("taskAcceptanceCriteria")})]}),(0,s.jsx)("div",{className:"space-y-1.5",children:u.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,s.jsx)("p",{className:"text-[11px] leading-snug text-foreground/80 flex-1",children:e.description}),!1!==e.required&&(0,s.jsx)("span",{className:"shrink-0 text-[10px] font-medium text-[#E65100] dark:text-[#F0A050]",children:d("required")})]},t))})]})]})]})}var es=a(29767);let en=(0,u.A)("message-square-text",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]);var er=a(56770),ei=a(60532),el=a(97964),eo=a(52217);let ed=(0,eo.createServerReference)("40c1372c32cd7a8fa9855f98634464aee687a58348",eo.callServer,void 0,eo.findSourceMapURL,"getElaborationAction");var ec=a(90795);function eu(e){let{idea:t,proposals:a,tasks:i,onSelectTask:l}=e,o=(0,r.c)("ideaTracker"),d=(0,r.c)(),[c,u]=(0,n.useState)(null),[x,m]=(0,n.useState)(new Set);(0,n.useEffect)(()=>{"open"!==t.status&&ed(t.uuid).then(e=>{e.success&&e.data&&u(e.data)})},[t.uuid,t.status]);let p=(0,n.useMemo)(()=>"open"===t.status?"idea_created":"elaborating"===t.status||0===a.length?"elaboration":a.some(e=>"approved"===e.status)&&i.length>0?"tasks":"proposal",[t.status,a,i]),h=(0,n.useMemo)(()=>{let e=["idea_created","elaboration","proposal","tasks"],t=e.indexOf(p);return e.map((e,a)=>({id:e,labelKey:({idea_created:"panel.timeline.ideaCreated",elaboration:"panel.timeline.elaboration",proposal:"panel.timeline.proposal",tasks:"panel.timeline.tasksProgress"})[e],status:a<t?"completed":a===t?"active":"upcoming",icon:({idea_created:(0,s.jsx)(es.A,{className:"h-3.5 w-3.5"}),elaboration:(0,s.jsx)(en,{className:"h-3.5 w-3.5"}),proposal:(0,s.jsx)(B.A,{className:"h-3.5 w-3.5"}),tasks:(0,s.jsx)(V.A,{className:"h-3.5 w-3.5"})})[e]}))},[p]);(0,n.useEffect)(()=>{let e=h.find(e=>"active"===e.status);e&&m(new Set([e.id]))},[p]);let f=(0,n.useCallback)(e=>{m(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})},[]),g=(0,n.useMemo)(()=>"open"===t.status?o("panel.timeline.noElaboration"):"skipped"===t.elaborationStatus?o("panel.timeline.elaborationSkipped"):"resolved"===t.elaborationStatus&&c?o("panel.timeline.elaborationComplete",{count:c.summary.totalQuestions}):"elaborating"===t.status?o("panel.timeline.elaborationInProgress"):c&&c.summary.totalQuestions>0?o("panel.timeline.elaborationComplete",{count:c.summary.totalQuestions}):o("panel.timeline.noElaboration"),[t.status,t.elaborationStatus,c,o]),v=(0,n.useMemo)(()=>{if(0===a.length)return o("panel.timeline.noProposal");let e=a.filter(e=>"approved"===e.status).length,t=a.filter(e=>"pending"===e.status).length;if(e>0&&1===a.length)return o("panel.timeline.proposalApproved");if(e>0)return o("panel.timeline.proposalsApproved",{count:e,total:a.length});if(t>0)return o("panel.timeline.proposalPending");switch(a[0].status){case"draft":default:return o("panel.timeline.proposalDraft");case"rejected":return o("panel.timeline.proposalRejected")}},[a,o]),b=(0,n.useMemo)(()=>{let e=0,t=0;for(let l of a){var s,n,r,i;e+=null!=(r=null==(s=l.documentDrafts)?void 0:s.length)?r:0,t+=null!=(i=null==(n=l.taskDrafts)?void 0:n.length)?i:0}return{docCount:e,taskDraftCount:t}},[a]),j=(0,n.useMemo)(()=>{let e=i.filter(e=>"done"===e.status||"closed"===e.status).length,t=i.filter(e=>"in_progress"===e.status).length;return{done:e,inProgress:t,toVerify:i.filter(e=>"to_verify"===e.status).length,open:i.filter(e=>"open"===e.status||"assigned"===e.status).length,total:i.length}},[i]);return(0,s.jsx)("div",{className:"space-y-0",children:h.map((e,n)=>{let r=x.has(e.id),u=n===h.length-1;return(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center w-5 shrink-0",children:[(0,s.jsx)("div",{className:"mt-1",children:"completed"===e.status?(0,s.jsx)("div",{className:"h-5 w-5 rounded-full bg-[#E0F2F1] dark:bg-[#12292a] flex items-center justify-center",children:(0,s.jsx)(ei.A,{className:"h-3 w-3 text-[#00796B] dark:text-[#4FD1C0]"})}):"active"===e.status?(0,s.jsx)("div",{className:"h-5 w-5 rounded-full bg-primary flex items-center justify-center",children:(0,s.jsx)(el.A,{className:"h-2 w-2 fill-white text-white"})}):(0,s.jsx)("div",{className:"h-5 w-5 rounded-full border-2 border-dashed border-[#D9D9D9] dark:border-[#3a3a40] flex items-center justify-center",children:(0,s.jsx)(el.A,{className:"h-2 w-2 text-muted-foreground"})})}),!u&&(0,s.jsx)("div",{className:"flex-1 w-px bg-border mt-1 min-h-[8px]"})]}),(0,s.jsxs)("div",{className:"flex-1 min-w-0 ".concat(u?"pb-0":"pb-4"),children:[(0,s.jsxs)("button",{onClick:()=>f(e.id),className:"flex items-center gap-1.5 w-full text-left group cursor-pointer",children:[r?(0,s.jsx)(q.A,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}):(0,s.jsx)(z.A,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,s.jsx)("span",{className:"text-[13px] font-medium ".concat("active"===e.status?"text-primary":"completed"===e.status?"text-foreground":"text-muted-foreground"),children:o(e.labelKey)}),!r&&(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground truncate ml-1",children:(e=>{switch(e.id){case"idea_created":return t.createdBy?t.createdBy.name:"";case"elaboration":return g;case"proposal":return v;case"tasks":return i.length>0?o("panel.timeline.tasksComplete",{done:j.done,total:j.total}):o("panel.timeline.noTasks");default:return""}})(e)})]}),(e=>{let n=x.has(e.id);switch(e.id){case"idea_created":return n?(0,s.jsxs)("div",{className:"mt-2 space-y-1.5",children:[t.createdBy&&(0,s.jsx)("p",{className:"text-[12px] text-muted-foreground",children:o("panel.timeline.createdBy",{name:t.createdBy.name})}),(0,s.jsx)("p",{className:"text-[12px] text-muted-foreground",children:(0,ec.fw)(t.createdAt,d)}),t.content&&(0,s.jsxs)("p",{className:"text-[12px] text-muted-foreground line-clamp-2",children:[t.content.slice(0,120),t.content.length>120?"...":""]})]}):null;case"elaboration":return n?(0,s.jsxs)("div",{className:"mt-2 space-y-1.5",children:[(0,s.jsx)("p",{className:"text-[12px] text-muted-foreground",children:g}),c&&c.rounds.length>0&&(0,s.jsx)("p",{className:"text-[12px] text-muted-foreground",children:o("panel.timeline.rounds",{count:c.rounds.length})})]}):null;case"proposal":return n?(0,s.jsxs)("div",{className:"mt-2 space-y-1.5",children:[(0,s.jsx)("p",{className:"text-[12px] text-muted-foreground",children:v}),a.length>0&&(0,s.jsxs)("div",{className:"space-y-1",children:[b.docCount>0&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-[12px] text-muted-foreground",children:[(0,s.jsx)(er.A,{className:"h-3 w-3"}),(0,s.jsx)("span",{children:o("panel.timeline.documents",{count:b.docCount})})]}),b.taskDraftCount>0&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-[12px] text-muted-foreground",children:[(0,s.jsx)(V.A,{className:"h-3 w-3"}),(0,s.jsx)("span",{children:o("panel.timeline.tasks",{count:b.taskDraftCount})})]})]})]}):null;case"tasks":return n?(0,s.jsx)("div",{className:"mt-2 space-y-2",children:0===i.length?(0,s.jsx)("p",{className:"text-[12px] text-muted-foreground",children:o("panel.timeline.noTasks")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("div",{className:"flex-1 h-1.5 rounded-full bg-[#F0EDE8] dark:bg-[#1f1e1c] overflow-hidden flex",children:[j.done>0&&(0,s.jsx)("div",{className:"h-full bg-[#00796B]",style:{width:"".concat(j.done/j.total*100,"%")}}),j.inProgress>0&&(0,s.jsx)("div",{className:"h-full bg-[#1976D2]",style:{width:"".concat(j.inProgress/j.total*100,"%")}}),j.toVerify>0&&(0,s.jsx)("div",{className:"h-full bg-[#7B1FA2]",style:{width:"".concat(j.toVerify/j.total*100,"%")}})]}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground shrink-0",children:o("panel.timeline.tasksComplete",{done:j.done,total:j.total})})]}),(0,s.jsxs)("div",{className:"space-y-1",children:[i.slice(0,5).map(e=>(0,s.jsxs)("button",{onClick:()=>l(e.uuid),className:"flex items-center gap-2 w-full text-left rounded-md px-2 py-1.5 hover:bg-secondary transition-colors group cursor-pointer",children:[(0,s.jsx)(O.A,{className:"h-3 w-3 text-muted-foreground shrink-0 group-hover:text-primary"}),(0,s.jsx)("span",{className:"h-2 w-2 rounded-full shrink-0 ".concat((0,ec.eT)(e.status))}),(0,s.jsx)("span",{className:"flex-1 text-[12px] text-foreground truncate group-hover:text-primary",children:e.title})]},e.uuid)),i.length>5&&(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground px-2",children:o("panel.timeline.moreItems",{count:i.length-5})})]})]})}):null;default:return null}})(e)]})]},e.id)})})}let ex=(0,eo.createServerReference)("60ea8831a008ac0590ed35ea1f176ffee299002ef1",eo.callServer,void 0,eo.findSourceMapURL,"getReportsForIdeaAction");function em(e){let{projectUuid:t,ideaUuid:a,proposals:i,onDocClick:l}=e,o=(0,r.c)("idea"),c=(0,r.c)("documents"),[u,x]=(0,n.useState)([]),[m,p]=(0,n.useState)(!0),f=i.some(e=>"approved"===e.status),v=(0,n.useCallback)(async()=>{if(!f){x([]),p(!1);return}try{let e=await ex(t,a);if(e.success){let t=[...e.data].sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime());x(t.map(e=>{var t;return{uuid:e.uuid,title:e.title,type:e.type,content:null!=(t=e.content)?t:null,createdAt:e.createdAt}}))}}catch(e){W.q.error("Failed to fetch reports for idea:",e)}finally{p(!1)}},[t,a,f]);return((0,n.useEffect)(()=>{p(!0),v()},[v]),(0,N.eV)("document",v),m)?f?(0,s.jsx)("div",{className:"flex items-center justify-center py-3",children:(0,s.jsx)(d.A,{className:"h-4 w-4 animate-spin text-primary"})}):null:0===u.length?null:(0,s.jsxs)("div",{className:"mt-6 space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-muted-foreground",children:o("reportsList")}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground",children:u.length}),(0,s.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:["\xb7 ",o("reportsAcrossProposals")]})]}),(0,s.jsx)("div",{className:"space-y-0",children:u.map(e=>(0,s.jsxs)(h.$,{variant:"ghost",className:"w-full justify-start h-auto text-left flex items-center gap-2.5 py-3.5 hover:bg-background transition-colors cursor-pointer -mx-1 px-1 rounded-lg",onClick:()=>{var t;return l({title:e.title,type:"report",content:null!=(t=e.content)?t:""})},children:[(0,s.jsx)(O.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,s.jsx)(g.E,{variant:"outline",className:"shrink-0 text-[10px] font-medium border-border text-muted-foreground bg-secondary px-2 py-0.5 font-mono",children:c(G.y[e.type]||"typeOther")}),(0,s.jsx)("span",{className:"flex-1 min-w-0 text-left text-[13px] text-foreground truncate",children:e.title})]},e.uuid))})]})}var ep=a(94903),eh=a(12959);let ef=["in_progress","to_verify","open","assigned","done","closed"];function eg(e){let{tasks:t,projectUuid:a,proposalUuids:i,onSelectTask:l}=e,o=(0,r.c)("ideaTracker"),[d,c]=(0,n.useState)({}),u=(0,n.useMemo)(()=>t.map(e=>e.uuid),[t]),x=(0,n.useCallback)(async()=>{if(0===u.length)return;let e=await (0,eh.h)(u);e.success&&e.data&&c(e.data)},[u]);(0,n.useEffect)(()=>{x()},[x]),(0,N.eV)("task",x);let m=(0,n.useMemo)(()=>{let e=[];for(let a of ef){let s=t.filter(e=>e.status===a);s.length>0&&e.push({status:a,tasks:s})}let a=new Set(ef),s=t.filter(e=>!a.has(e.status));return s.length>0&&e.push({status:"other",tasks:s}),e},[t]),[p,h]=(0,n.useState)(new Set),f=(0,n.useMemo)(()=>{let e=t.length,a=t.filter(e=>"done"===e.status||"closed"===e.status).length,s=0,n=0,r=0,i=0;for(let e of t)e.acceptanceSummary&&(s+=e.acceptanceSummary.total,n+=e.acceptanceSummary.passed,r+=e.acceptanceSummary.required,i+=e.acceptanceSummary.requiredPassed);return{total:e,done:a,acTotal:s,acPassed:n,acRequired:r,acRequiredPassed:i}},[t]);return 0===t.length?(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[(0,s.jsx)(V.A,{className:"h-8 w-8 text-muted-foreground"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:o("panel.taskList.noTasks")})]}):(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 rounded-lg bg-[#FAFAF7] dark:bg-[#1e1e1c] px-3 py-2",children:[(0,s.jsx)("span",{className:"text-[12px] text-muted-foreground",children:o("panel.taskList.summary",{done:f.done,total:f.total})}),f.acTotal>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-[12px] text-muted-foreground",children:"\xb7"}),(0,s.jsx)("span",{className:"text-[12px] text-muted-foreground",children:o("panel.taskList.acSummary",{passed:f.acRequiredPassed,total:f.acRequired})})]}),i.length>0&&(0,s.jsxs)(L(),{href:"/projects/".concat(a,"/tasks?proposalUuids=").concat(i.join(",")),className:"ml-auto flex items-center gap-1 text-[13px] font-medium text-primary shrink-0",children:[o("panel.taskList.viewKanban"),(0,s.jsx)(z.A,{className:"h-3.5 w-3.5"})]})]}),m.map(e=>{let t=p.has(e.status);return(0,s.jsxs)("div",{children:[(0,s.jsxs)("button",{onClick:()=>{var t;return t=e.status,void h(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a})},className:"flex items-center gap-2 w-full text-left py-1.5 group cursor-pointer",children:[t?(0,s.jsx)(z.A,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,s.jsx)(q.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,s.jsx)("span",{className:"h-2 w-2 rounded-full shrink-0 ".concat((0,ec.eT)(e.status))}),(0,s.jsx)("span",{className:"text-[13px] font-medium text-foreground",children:function(e,t){switch(e){case"in_progress":return t("panel.taskList.inProgress");case"to_verify":return t("panel.taskList.toVerify");case"open":return t("panel.taskList.open");case"assigned":return t("panel.taskList.assigned");case"done":return t("panel.taskList.done");case"closed":return t("panel.taskList.closed");default:return e}}(e.status,o)}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground ml-auto",children:e.tasks.length})]}),!t&&(0,s.jsx)("div",{className:"ml-3 space-y-0.5",children:e.tasks.map(e=>{let t=d[e.uuid]||0,a=e.acceptanceSummary;return(0,s.jsx)($.D,{entityType:"task",entityUuid:e.uuid,badgeInside:!0,children:(0,s.jsxs)("button",{onClick:()=>l(e.uuid),className:"flex items-center gap-2 w-full text-left rounded-md px-2.5 py-2 hover:bg-secondary transition-colors group cursor-pointer",children:[(0,s.jsx)(O.A,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0 group-hover:text-primary"}),(0,s.jsx)("span",{className:"h-1.5 w-1.5 rounded-full shrink-0 ".concat((0,ec.eT)(e.status))}),(0,s.jsx)("span",{className:"flex-1 text-[13px] text-foreground truncate group-hover:text-primary",children:e.title}),a&&a.total>0&&(0,s.jsxs)("span",{className:"inline-flex items-center gap-0.5 shrink-0 rounded-full bg-[#F0EDE8] dark:bg-[#1f1e1c] px-1.5 py-0.5 text-[10px] text-muted-foreground",children:[(0,s.jsx)(ei.A,{className:"h-2.5 w-2.5"}),a.requiredPassed,"/",a.required]}),e.assignee&&(0,s.jsxs)("span",{className:"shrink-0 inline-flex items-center gap-1 text-[10px] text-muted-foreground max-w-[72px] truncate",title:e.assignee.name,children:[(0,T.bB)(e.assignee)?(0,s.jsx)(D.AgentAvatar,{name:e.assignee.name,size:14,className:"shrink-0 rounded-full"}):(0,s.jsx)(ep.A,{className:"h-2.5 w-2.5 shrink-0"}),e.assignee.name.split(/[@\s]/)[0]]}),t>0&&(0,s.jsx)("span",{className:"inline-flex items-center justify-center h-4 min-w-[16px] rounded-full bg-[#E8F5E9] dark:bg-[#14281a] text-[#2E7D32] dark:text-[#5FD07E] text-[9px] font-semibold shrink-0",title:o("panel.taskList.workersActive",{count:t}),children:t})]})},e.uuid)})})]},e.status)})]})}var ev=a(68205);function eb(e){let{ideaUuid:t}=e,a=(0,r.c)(),[i,l]=(0,n.useState)([]),[o,c]=(0,n.useState)(!0),u=(0,n.useCallback)(async()=>{c(!0),l((await (0,ev.x)(t)).activities),c(!1)},[t]);return(0,n.useEffect)(()=>{u()},[u]),(0,s.jsxs)("div",{className:"mt-5",children:[(0,s.jsx)(j.J,{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:a("common.activity")}),(0,s.jsx)("div",{className:"mt-2",children:o?(0,s.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,s.jsx)(d.A,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):0===i.length?(0,s.jsx)("p",{className:"text-sm text-muted-foreground italic",children:a("common.noActivity")}):i.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-stretch gap-2.5",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center w-2 shrink-0",children:[(0,s.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full border-[1.5px] border-[#D9D9D9] dark:border-[#3a3a40] bg-card"}),t<i.length-1&&(0,s.jsx)("div",{className:"flex-1 w-px bg-border mt-1"})]}),(0,s.jsxs)("div",{className:"flex-1 pb-3",children:[(0,s.jsx)("p",{className:"text-[13px] text-foreground",children:function(e,t){let{action:a,actorName:s}=e;switch(a){case"created":case"idea_created":return t("activity.ideaCreated",{actor:s});case"assigned":case"idea_assigned":return t("activity.ideaAssigned",{actor:s});case"claimed":case"idea_claimed":return t("activity.ideaClaimed",{actor:s});case"released":case"idea_released":return t("activity.ideaReleased",{actor:s});case"status_changed":case"idea_status_changed":return t("activity.ideaStatusChanged",{actor:s});case"edited":case"idea_edited":return t("activity.ideaEdited",{actor:s});case"reparented":case"idea_reparented":return t("activity.ideaReparented",{actor:s});case"elaboration_started":return t("activity.elaborationStarted",{actor:s});case"elaboration_answered":return t("activity.elaborationAnswered",{actor:s});case"elaboration_skipped":return t("activity.elaborationSkipped",{actor:s});case"elaboration_resolved":return t("activity.elaborationResolved",{actor:s});case"elaboration_followup":return t("activity.elaborationFollowup",{actor:s});default:return t("activity.genericAction",{actor:s,action:a})}}(e,a)}),(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:(0,ec.fw)(e.createdAt,a)})]})]},e.uuid))})]})}var ej=a(91796);function ey(e){let{ideaUuid:t,currentUserUuid:a,commentCount:i,onCommentCountChange:l}=e,o=(0,r.c)("ideaTracker"),[d,c]=(0,n.useState)("comments");return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex gap-1 rounded-lg bg-secondary p-0.5",children:[(0,s.jsxs)("button",{onClick:()=>c("comments"),className:"flex-1 rounded-md px-3 py-1.5 text-[13px] font-medium transition-colors flex items-center justify-center gap-1.5 cursor-pointer ".concat("comments"===d?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-muted-foreground"),children:[o("panel.activityTab.comments"),i>0&&(0,s.jsx)("span",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full bg-secondary text-muted-foreground text-[10px] font-semibold leading-none",children:i})]}),(0,s.jsx)("button",{onClick:()=>c("activity"),className:"flex-1 rounded-md px-3 py-1.5 text-[13px] font-medium transition-colors cursor-pointer ".concat("activity"===d?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-muted-foreground"),children:o("panel.activityTab.activity")})]}),(0,s.jsx)("div",{children:"activity"===d?(0,s.jsx)(eb,{ideaUuid:t}):(0,s.jsx)(ej.$m,{targetType:"idea",targetUuid:t,currentUserUuid:a,onCountChange:l,compact:!0})})]})}var ek=a(4945),eN=a(24522),ew=a(91760);let eC=(0,u.A)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var eS=a(30028),eA=a(97438),eF=a(4365),eE=a(24377);let e_=(0,eo.createServerReference)("40006abc666729415df0257abe5ccc404eec04cf0e",eo.callServer,void 0,eo.findSourceMapURL,"getProjectIdeasForPickerAction"),eD=(0,eo.createServerReference)("60c53a9b61a15dbc8aad08aecf05338d08571240aa",eo.callServer,void 0,eo.findSourceMapURL,"setIdeaParentAction");function eU(e){let{open:t,onOpenChange:a,ideaUuid:o,ideaTitle:c,projectUuid:u,currentParentUuid:x,descendantUuids:m,onChanged:p,onCloseAutoFocus:f}=e,g=(0,r.c)("ideaTracker.lineage"),v=(0,r.c)("common"),b=(0,i.r)(),[j,y]=(0,n.useState)([]),[k,N]=(0,n.useState)(!1),[w,C]=(0,n.useState)(!1),[S,A]=(0,n.useState)(!1),[F,E]=(0,n.useState)(null),_=new Set([o,...m]),D=(0,n.useCallback)(async()=>{C(!0),E(null);try{let e=await e_(u);e.success?(y(e.data),N(e.hasMore)):E(e.error)}catch(e){W.q.error("Failed to load parent candidates:",e),E(g("saveFailed"))}C(!1)},[u,g]);(0,n.useEffect)(()=>{t&&D()},[t,D]);let U=async e=>{if(!S){A(!0),E(null);try{let t=await eD(o,e);t.success?(l.oR.success(e?g("save"):g("detach")),a(!1),b.refresh(),p()):E(t.error||g("saveFailed"))}catch(e){E(e instanceof Error?e.message:g("saveFailed"))}A(!1)}};return(0,s.jsx)(eA.lG,{open:t,onOpenChange:a,children:(0,s.jsxs)(eA.Cf,{onCloseAutoFocus:f,children:[(0,s.jsxs)(eA.c7,{children:[(0,s.jsx)(eA.L3,{children:g("setParentTitle")}),(0,s.jsx)(eA.rr,{children:g("setParentDescription",{title:c})})]}),(0,s.jsxs)("div",{className:"min-w-0 space-y-3 pt-1",children:[w?(0,s.jsx)("div",{className:"flex h-40 items-center justify-center",children:(0,s.jsx)(d.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):(0,s.jsx)("div",{className:"rounded-md border border-border",children:(0,s.jsxs)(eF.uB,{children:[(0,s.jsx)(eF.G7,{placeholder:g("searchPlaceholder")}),(0,s.jsxs)(eF.oI,{children:[(0,s.jsx)(eF.xL,{children:g("noCandidates")}),(0,s.jsx)(eF.L$,{children:j.map(e=>{let t=_.has(e.uuid),a=e.uuid===x;return(0,s.jsxs)(eF.h_,{value:e.title,disabled:t,onSelect:()=>{t||U(e.uuid)},className:(0,eE.cn)("flex min-w-0 items-center justify-between gap-2",t&&"opacity-55",a&&"bg-primary/10"),children:[(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px] text-foreground",children:e.title}),t&&(0,s.jsxs)("span",{className:"flex shrink-0 items-center gap-1 text-[11px] font-medium text-[#B0654A] dark:text-[#EBA890]",children:[(0,s.jsx)(eC,{className:"h-3 w-3"}),g("cycleBlocked")]})]},e.uuid)})})]})]})}),(0,s.jsxs)("div",{className:"flex items-start gap-2 rounded-md bg-[#FBF0EB] dark:bg-[#221e1b] px-3 py-2.5",children:[(0,s.jsx)(eS.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[#B0654A] dark:text-[#EBA890]"}),(0,s.jsx)("p",{className:"text-[12px] leading-relaxed text-[#9A5238] dark:text-[#E9A088]",children:g("cycleWarning")})]}),k&&(0,s.jsx)("p",{className:"px-1 text-[12px] text-muted-foreground",role:"status",children:g("pickerTruncated")}),F&&(0,s.jsx)("p",{className:"text-xs text-destructive",role:"alert",children:F})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3 pt-2",children:[x?(0,s.jsx)(h.$,{variant:"outline",className:"border-border",onClick:()=>U(null),disabled:S,children:g("detach")}):(0,s.jsx)("span",{}),(0,s.jsx)(h.$,{variant:"outline",className:"border-border",onClick:()=>a(!1),disabled:S,children:v("cancel")})]})]})})}var eR=a(875),eT=a(28527),eI=a(59995);let eP=(0,eo.createServerReference)("4074ae748fd50b92b411ca059967546a201f39b1b8",eo.callServer,void 0,eo.findSourceMapURL,"getIdeaAction");var eM=a(89473),eL=a(63616),eB=a(39303),ez=a(1145),eO=a(11166),eq=a(30044),eV=a(42533),e$=a(62482),eK=a(84052),eH=a(95900),eG=a(57893),eJ=a(25373),eQ=a(97413),eW=a(66343),eX=a(68923),eZ=a(61620),eY=a(30492);let e0=(0,eo.createServerReference)("403bb332296b383d02ad4a7d35b3dae24960a05176",eo.callServer,void 0,eo.findSourceMapURL,"researchEligibilityAction"),e1=(0,eo.createServerReference)("705b81805be42afce15daf8abbb8433279c955a395",eo.callServer,void 0,eo.findSourceMapURL,"researchIdeaAction");var e2=a(2201),e5=a(21180),e3=a(91846),e9=a(78307),e4=a(6930),e6=a(3233),e8=a(81589);function e7(e){var t;let{projectUuid:a,onConfirm:i,onCancel:l,onCloseAutoFocus:o}=e,d=(0,r.c)("research"),c=(0,r.c)("common"),u=(0,n.useId)(),[x,m]=(0,n.useState)([]),[p,f]=(0,n.useState)(""),[g,v]=(0,n.useState)([]),[b,y]=(0,n.useState)(null),[k,N]=(0,n.useState)(null),[w,C]=(0,n.useState)(!0),[S,A]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=!0;return(0,e6.U)().then(t=>{e&&m(t.agents)}).catch(()=>{e&&A("unknown")}).finally(()=>{e&&C(!1)}),()=>{e=!1}},[]),(0,n.useEffect)(()=>{if(!p)return;let e=!0;return C(!0),y(null),N(null),v([]),A(null),(0,e8.G)(p,a).then(t=>{e&&(v((0,e9.C)(t.instances).filter(e=>!!e.agentInstanceUuid)),N(t.resolvedTarget))}).catch(()=>{e&&A("unknown")}).finally(()=>{e&&C(!1)}),()=>{e=!1}},[p,a]);let F=(null==k?void 0:k.source)==="project_fixed",E=!!p&&!w&&(F?"ready"===k.availability:!!(null==b?void 0:b.agentInstanceUuid));return(0,s.jsx)(eA.lG,{open:!0,onOpenChange:e=>{e||l()},children:(0,s.jsxs)(eA.Cf,{overlayClassName:"z-[105]",className:"z-[110] max-h-[85svh] overflow-y-auto",onCloseAutoFocus:o,children:[(0,s.jsxs)(eA.c7,{children:[(0,s.jsx)(eA.L3,{children:d("selectAgent")}),(0,s.jsx)(eA.rr,{children:d("selectionHint")})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)(j.J,{htmlFor:u,children:d("agentLabel")}),(0,s.jsxs)(e3.l6,{value:p,onValueChange:f,children:[(0,s.jsx)(e3.bq,{id:u,className:"w-full",children:(0,s.jsx)(e3.yv,{placeholder:d("selectAgent")})}),(0,s.jsx)(e3.gC,{className:"z-[120]",children:x.map(e=>(0,s.jsx)(e3.eb,{value:e.uuid,children:e.name},e.uuid))})]}),w&&(0,s.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:d("loading")}),!w&&0===x.length&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:d("noAgents")}),F&&(0,s.jsx)(e4.Y,{target:k}),!F&&!w&&p&&(0,s.jsx)(e9.O,{instances:g,selectedConnectionUuid:null!=(t=null==b?void 0:b.connectionUuid)?t:"",onSelect:y}),!w&&p&&(F&&"ready"!==k.availability||!F&&0===g.length)&&(0,s.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:d("agent_offline")}),S&&(0,s.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:d(S)})]}),(0,s.jsxs)(eA.Es,{children:[(0,s.jsx)(h.$,{variant:"outline",onClick:l,children:c("cancel")}),(0,s.jsx)(h.$,{disabled:!E,onClick:()=>i({agentUuid:p,...!F&&(null==b?void 0:b.agentInstanceUuid)?{instanceUuid:b.agentInstanceUuid}:{}}),children:d("requestButton")})]})]})})}function te(e){var t;let{ideaUuid:a,projectUuid:i,assignee:o,disabledReason:d,refreshKey:c,onStarted:u,renderAction:x,onCloseAutoFocus:m}=e,p=(0,r.c)("research"),[h,f]=(0,n.useState)("loading"),[g,v]=(0,n.useState)(!1),b=(0,n.useRef)(!1),[j,y]=(0,n.useState)(0),[k,N]=(0,n.useState)(!1),w=(0,n.useRef)(void 0),C=(0,n.useCallback)(async(e,t,a)=>(w.current={agentUuid:t,instanceUuid:a},{success:!0}),[]),{start:S,pickerState:A,confirmPick:F,confirmTemporary:E,cancelPick:_,isResolving:D}=(0,e2.E)({reassignNoWake:C,previewIdeaUuid:a});(0,n.useEffect)(()=>{let e=!0;f("loading");let t=()=>{e0(a).then(t=>{e&&f(t.eligible?void 0:t.reason)}).catch(()=>{e&&f("unknown")})};t(),window.addEventListener("focus",t);let s=setInterval(t,15e3);return()=>{e=!1,clearInterval(s),window.removeEventListener("focus",t)}},[a,null==o?void 0:o.uuid,c,j]);let U=async function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(!b.current){b.current=!0,v(!0);try{let s=e||w.current?await e1(a,e,w.current):await e1(a);s.success?(f(void 0),l.oR.success(p("dispatched")),w.current=void 0,u()):(t&&"assignment_required"===s.errorCode&&(0,eY.Q9)(o)?(b.current=!1,S({ideaUuid:a,wake:e=>U(e,!1)})):(l.oR.error(p(s.errorCode)),"assignment_required"!==s.errorCode||(0,eY.Q9)(o)||N(!0)),y(e=>e+1))}catch(e){l.oR.error(p("unknown"))}finally{b.current=!1,v(!1)}}};return(0,s.jsxs)(s.Fragment,{children:[x({label:p("button"),busy:g||D||k,disabledReason:d||(g||D||k?p("dispatching"):h?p(h):void 0),onSelect:()=>{d||h||b.current||D||(w.current=void 0,(0,eY.Q9)(o)?U():N(!0))}}),(0,s.jsx)(e5.V,{open:null!==A,onCloseAutoFocus:m,agentName:"",instances:null!=(t=null==A?void 0:A.instances)?t:[],agentUuid:null==A?void 0:A.agentUuid,onConfirm:F,onTemporaryConfirm:E,onCancel:_}),k&&(0,s.jsx)(e7,{projectUuid:i,onCloseAutoFocus:m,onCancel:()=>N(!1),onConfirm:e=>{w.current=e,N(!1),U(void 0,!1)}})]})}var tt=a(23826),ta=a(42305);let ts={default:"",research:"text-[#9A6700] focus:text-[#7A5100] focus:bg-[#FFF4CE] dark:text-[#F2C45D] dark:focus:text-[#F7D990] dark:focus:bg-[#3B2D12]",verify:"text-[#1976D2] focus:text-[#155FA0] focus:bg-[#E3F2FD] dark:text-[#64B5F6] dark:focus:text-[#90CAF9] dark:focus:bg-[#102A43]",develop:"text-[#2E7D32] focus:text-[#256628] focus:bg-[#E8F5E9] dark:text-[#72D572] dark:focus:text-[#9AE69A] dark:focus:bg-[#17351D]",yolo:"text-[#6A4FB6] focus:text-[#584098] focus:bg-[#F1ECFA] dark:text-[#B39DDB] dark:focus:text-[#D1C4E9] dark:focus:bg-[#2A2040]",destructive:"text-destructive focus:text-destructive focus:bg-destructive/10"},tn="(max-width: 639px)";function tr(e){var t;if(!window.matchMedia)return()=>{};let a=window.matchMedia(tn);return null==(t=a.addEventListener)||t.call(a,"change",e),()=>{var t;return null==(t=a.removeEventListener)?void 0:t.call(a,"change",e)}}function ti(){var e,t;return!!(null==(e=(t=window).matchMedia)?void 0:e.call(t,tn).matches)}function tl(e){let{label:t,icon:a,reason:r,onSelect:i,onTooltipEscape:l,tone:o="default"}=e,d=(0,n.useId)(),c=(0,s.jsxs)(eW._2,{"aria-label":t,"aria-disabled":!!r,"aria-describedby":r?d:void 0,variant:"destructive"===o?"destructive":"default",className:(0,eE.cn)(ts[o],r&&"cursor-default text-muted-foreground focus:bg-accent focus:text-muted-foreground dark:focus:bg-accent dark:text-muted-foreground dark:focus:text-muted-foreground"),onKeyDown:e=>{"Enter"===e.key&&(0,ta.P)(e)&&e.preventDefault()},onSelect:e=>{r?e.preventDefault():i()},children:[a,(0,s.jsx)("span",{children:t}),r&&(0,s.jsx)("span",{id:d,className:"sr-only",children:r})]});return r?(0,s.jsxs)(U.m_,{children:[(0,s.jsx)(U.k$,{asChild:!0,children:c}),(0,s.jsx)(U.ZI,{side:"left",className:"z-[120] max-w-64",onEscapeKeyDown:l,children:r})]}):c}function to(e){let{label:t,icon:a,reason:r,onSelect:i,tone:l="default"}=e,o=(0,n.useId)();return(0,s.jsxs)(h.$,{type:"button",variant:"ghost","aria-label":t,"aria-disabled":!!r,"aria-describedby":r?o:void 0,className:(0,eE.cn)("focus-visible:ring-ring flex h-auto min-h-12 w-full items-center gap-3 whitespace-normal rounded-lg px-3 py-2 text-left text-sm outline-none transition-colors","hover:bg-accent focus-visible:ring-2 [&_svg]:size-5 [&_svg]:shrink-0",ts[l],r&&"cursor-default text-muted-foreground hover:bg-transparent focus:bg-accent focus:text-muted-foreground dark:focus:bg-accent dark:text-muted-foreground dark:focus:text-muted-foreground"),onKeyDown:e=>{"Enter"===e.key&&(0,ta.P)(e)&&e.preventDefault()},onClick:()=>{r||i()},children:[a,(0,s.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,s.jsx)("span",{className:"block font-medium",children:t}),r&&(0,s.jsx)("span",{id:o,className:"mt-0.5 block break-words whitespace-normal text-xs leading-4 text-muted-foreground",children:r})]})]})}function td(e){let t=(0,r.c)(),a=(0,r.c)("ideaTracker.panel.actions"),[i,o]=(0,n.useState)(!1),d=(0,n.useSyncExternalStore)(tr,ti,()=>!1),u=e.busy?a("busy"):void 0,m=u||e.stageReason||e.stageDataReason,f=async t=>{try{let s=t?new URL("/projects/".concat(e.projectUuid,"/dashboard?panel=").concat(e.ideaUuid),window.location.origin).href:e.ideaUuid;await navigator.clipboard.writeText(s),l.oR.success(a(t?"linkCopied":"uuidCopied"))}catch(e){l.oR.error(a("copyFailed"))}},g={ideaUuid:e.ideaUuid,assignee:e.assignee,assigneeName:e.assigneeName,proposals:e.proposals,tasks:e.tasks,onStarted:e.onStarted,disabledReason:m,onCloseAutoFocus:e.onCloseAutoFocus};return(0,s.jsx)(te,{ideaUuid:e.ideaUuid,projectUuid:e.projectUuid,assignee:e.assignee,disabledReason:u,onCloseAutoFocus:e.onCloseAutoFocus,refreshKey:JSON.stringify([e.proposals,e.tasks]),onStarted:e.onStarted,renderAction:r=>(0,s.jsx)(eZ.w,{...g,disabledReason:m||(r.busy?a("busy"):void 0),renderAction:l=>(0,s.jsx)(tt.s,{...g,disabledReason:m||(l.busy?a("busy"):void 0),renderAction:m=>{let g=u||(l.busy||m.busy||r.busy?a("busy"):void 0),v=[[{label:r.label,icon:(0,s.jsx)(eq.A,{}),reason:g||r.disabledReason,onSelect:r.onSelect,tone:"research"},{label:t("elaboration.verifyButton"),icon:(0,s.jsx)(eV.A,{}),reason:g||e.stageReason||e.verifyReason,onSelect:e.onVerify,tone:"verify"},{label:l.label,icon:(0,s.jsx)(e$.A,{}),reason:g||l.disabledReason,onSelect:l.onSelect,tone:"develop"},{label:m.label,icon:(0,s.jsx)(eK.A,{}),reason:g||m.disabledReason,onSelect:m.onSelect,tone:"yolo"}],[{label:t("ideaTracker.lineage.deriveIdea"),icon:(0,s.jsx)(c.A,{}),reason:g,onSelect:e.onDerive,tone:"default"},{label:t("ideaTracker.lineage.setParentTitle"),icon:(0,s.jsx)(x,{}),reason:g,onSelect:e.onSetParent,tone:"default"},{label:t("ideas.actions.move"),icon:(0,s.jsx)(eH.A,{}),reason:g,onSelect:e.onMove,tone:"default"},{label:t("ideas.editIdea"),icon:(0,s.jsx)(eG.A,{}),reason:g||e.editReason,onSelect:e.onEdit,tone:"default"}],[{label:a("copyLink"),icon:(0,s.jsx)(p.A,{}),onSelect:()=>{f(!0)},tone:"default"},{label:a("copyUuid"),icon:(0,s.jsx)(eJ.A,{}),onSelect:()=>{f(!1)},tone:"default"}],[{label:t("ideas.deleteIdea"),icon:(0,s.jsx)(eQ.A,{}),reason:g,onSelect:e.onDelete,tone:"destructive"}]];return d?(0,s.jsxs)(eX.cj,{open:i,onOpenChange:o,children:[(0,s.jsx)(eX.CG,{asChild:!0,children:(0,s.jsxs)(h.$,{ref:e.triggerRef,variant:"outline",size:"sm",className:"h-11 gap-1.5 border-border px-3",children:[t("common.actions"),(0,s.jsx)(q.A,{className:"size-4","aria-hidden":!0})]})}),(0,s.jsxs)(eX.h,{side:"bottom",className:"max-h-[min(82svh,44rem)] gap-0 overflow-hidden rounded-t-2xl pb-[max(1rem,env(safe-area-inset-bottom))]",onCloseAutoFocus:e.onCloseAutoFocus,children:[(0,s.jsx)("div",{className:"mx-auto mt-2 h-1 w-10 shrink-0 rounded-full bg-muted-foreground/25","aria-hidden":!0}),(0,s.jsxs)(eX.Fm,{className:"border-b px-4 pt-3 pb-3 text-left",children:[(0,s.jsx)(eX.qp,{children:t("common.actions")}),(0,s.jsx)(eX.Qs,{className:"sr-only",children:t("common.actions")})]}),(0,s.jsx)("div",{className:"overflow-y-auto overscroll-contain px-2 py-2",children:v.map((e,t)=>(0,s.jsx)("div",{className:(0,eE.cn)(t>0&&"mt-1 border-t pt-1"),children:e.map(e=>(0,s.jsx)(to,{...e,onSelect:()=>{o(!1),e.onSelect()}},e.label))},t))})]})]}):(0,s.jsx)(U.Bc,{delayDuration:300,children:(0,s.jsxs)(eW.rI,{open:i,onOpenChange:o,children:[(0,s.jsx)(eW.ty,{asChild:!0,children:(0,s.jsxs)(h.$,{ref:e.triggerRef,variant:"outline",size:"sm",className:"h-8 gap-1.5 border-border px-2.5",children:[t("common.actions"),(0,s.jsx)(q.A,{className:"h-3.5 w-3.5","aria-hidden":!0})]})}),(0,s.jsx)(eW.SQ,{align:"end",className:"z-[100] w-64 max-w-[calc(100vw-1rem)] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto",children:v.map((e,t)=>(0,s.jsxs)(n.Fragment,{children:[t>0&&(0,s.jsx)(eW.mB,{}),e.map(e=>(0,s.jsx)(tl,{...e,onTooltipEscape:()=>o(!1)},e.label))]},t))})]})})}})})})}var tc=a(79935),tu=a(90612),tx=a(59208),tm=a(4054),tp=a(38106),th=a(77390);function tf(e){return(0,s.jsx)(tg,{...e},e.ideaUuid)}function tg(e){var t,a,u,w,C,S,A;let{ideaUuid:F,projectUuid:E,currentUserUuid:_,onClose:D,onNavigate:U}=e,R=(0,r.c)(),T=(0,r.c)("ideaTracker"),I=(0,r.c)("status"),M=(0,r.c)("ideaTracker.lineage"),L=(0,i.r)(),B=(0,tx.kz)(),z=null!=(u=null==B?void 0:B.activeSessionsByIdea.get(F))?u:[],[O,q]=(0,n.useState)(null),[V,$]=(0,n.useState)(!0),[K,H]=(0,n.useState)(null),[G,Z]=(0,n.useState)([]),[Y,ee]=(0,n.useState)([]),[et,ea]=(0,n.useState)(null),[es,en]=(0,n.useState)(null),er=(0,n.useRef)(0),ei=(0,n.useRef)(0),[el,eo]=(0,n.useState)("overview"),[ed,ex]=(0,n.useState)(new Set(["overview"])),[ep,eh]=(0,n.useState)(!1),[ef,ev]=(0,n.useState)(0),[eb,ej]=(0,n.useState)(!1),[eC,eS]=(0,n.useState)(!1),[eA,eF]=(0,n.useState)(!1),eE=(0,n.useRef)(null),e_=(0,n.useCallback)(e=>{var t;e.preventDefault(),null==(t=eE.current)||t.focus()},[]),[eD,eq]=(0,n.useState)(null),[eV,e$]=(0,n.useState)(!0),[eK,eH]=(0,n.useState)(!1),[eG,eJ]=(0,n.useState)(null),[eQ,eW]=(0,n.useState)(!1),{start:eX,pickerState:eZ,confirmPick:eY,cancelPick:e0,isResolving:e1}=(0,e2.E)({reassignNoWake:tm.U,previewIdeaUuid:null==O?void 0:O.uuid}),[e3,e9]=(0,n.useState)(!1),[e4,e6]=(0,n.useState)(""),[e8,e7]=(0,n.useState)(""),[te,tt]=(0,n.useState)(!1),[ta,ts]=(0,n.useState)(null),[tn,tr]=(0,n.useState)(!1),[ti,tl]=(0,n.useState)(!1),[to,tf]=(0,n.useState)(!1),[tg,tv]=(0,n.useState)(!1),[tb,tj]=(0,n.useState)(null),[ty,tk]=(0,n.useState)(null),[tN,tw]=(0,n.useState)(null),tC=(0,n.useCallback)(e=>{tw(null),tj(e)},[]),tS=(0,n.useCallback)(e=>{tj(null),tk(null),tw(e)},[]),[tA,tF]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=window.matchMedia("(min-width: 960px)");tF(e.matches);let t=e=>tF(e.matches);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let[tE,t_]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=setTimeout(()=>t_(!0),300);return()=>clearTimeout(e)},[]);let tD=(0,n.useCallback)(e=>{let t=new URLSearchParams(window.location.search);t.set("tab",e),window.history.replaceState(null,"","".concat(window.location.pathname,"?").concat(t.toString()))},[]),tU=(0,n.useCallback)(async()=>{try{let e=await eP(F);e.success?(q(e.data),H(null)):H(T("Not found"===e.error?"panel.notFound":"panel.loadFailed"))}catch(e){H(T("panel.loadFailed"))}finally{$(!1)}},[F,T]);(0,n.useEffect)(()=>{$(!0),tU()},[tU]),(0,N.eV)("idea",tU),(0,N.eV)("proposal",tU),(0,N.eV)("task",tU);let tR=null==O?void 0:O.uuid,tT=null==O?void 0:O.status,tI="".concat(tR,":").concat(tT),tP=(0,n.useCallback)(async()=>{let e=++er.current;if(ea(null),tR){if("open"===tT){Z([]),ea(tI);return}try{let t=await (0,J.U)(E,tR);e===er.current&&t.success&&(Z(t.data),ea(tI))}catch(e){W.q.error("Failed to fetch proposals:",e)}}},[E,tR,tT,tI]);(0,n.useEffect)(()=>{tP()},[tP]),(0,N.eV)("proposal",tP);let tM=(0,n.useCallback)(async()=>{let e=++ei.current;en(null);let t=G.filter(e=>"approved"===e.status);if(0===t.length){ee([]),en(G);return}try{let a=await Promise.all(t.map(e=>(0,Q.c)(E,e.uuid)));if(e!==ei.current||a.some(e=>!e.success))return;let s=a.flatMap(e=>e.success&&e.data?e.data.map(e=>{var t,a,s;return{uuid:e.uuid,title:e.title,status:e.status,commentCount:null!=(t=e.commentCount)?t:0,assignee:null!=(a=e.assignee)?a:null,acceptanceSummary:null!=(s=e.acceptanceSummary)?s:null}}):[]);ee(s),en(G)}catch(e){W.q.error("Failed to fetch tasks:",e)}},[E,G]);(0,n.useEffect)(()=>{tM()},[tM]),(0,N.eV)("task",tM);let tL=(0,n.useCallback)(async()=>{if(!tR)return;let e=await (0,eL.z)(tR);e.success&&e.data&&eq(e.data),e$(!1)},[tR]);(0,n.useEffect)(()=>{tL()},[tL]),(0,N.eV)("idea",tL);let tB=(0,n.useMemo)(()=>O?function(e,t,a){let s=["overview"];return s.push("elaboration"),t.length>0&&s.push("proposal"),a.length>0&&s.push("tasks"),s.push("activity"),s}(0,G,Y):["overview","activity"],[O,G,Y]),tz=(0,n.useRef)(new URLSearchParams(window.location.search).get("tab")),tO=O?function(e){switch(e){case"open":case"researching":case"answer_questions":return"elaboration";case"planning":case"review_proposal":return"proposal";case"building":case"verify_work":return"tasks";default:return"overview"}}(O.badgeHint):"overview";(0,n.useEffect)(()=>{let e;if(!O||ep)return;let t=tz.current;if(t)if(!tB.includes(t))return;else e=t,tz.current=null,eh(!0);else if(tB.includes(tO))e=tO;else{if("overview"!==tO)return;e="overview"}eo(e),ex(t=>new Set([...t,e])),tD(e)},[null==O?void 0:O.uuid,tO,tB]),(0,n.useEffect)(()=>{eh(!1)},[F]),(0,n.useEffect)(()=>{tB.includes(el)||eo("overview")},[tB,el]);let tq=(0,n.useMemo)(()=>Y.filter(e=>"in_progress"===e.status||"assigned"===e.status||"to_verify"===e.status).length,[Y]),tV=(0,n.useCallback)(()=>{if(!tb)return void tk(null);(0,eM.Q)(tb).then(e=>{e.success&&tk(e.data)}).catch(e=>W.q.error("Failed to load task details:",e))},[tb]);(0,n.useEffect)(()=>{tV()},[tV]),(0,N.eV)("task",tV),(0,n.useEffect)(()=>{e9(!1),e6((null==O?void 0:O.title)||""),e7((null==O?void 0:O.content)||""),ts(null)},[null==O?void 0:O.uuid,null==O?void 0:O.title,null==O?void 0:O.content]);let t$=()=>{e9(!1),e6((null==O?void 0:O.title)||""),e7((null==O?void 0:O.content)||""),ts(null)},tK=async()=>{if(!O||!e4.trim())return void ts(R("ideas.titleRequired"));tt(!0),ts(null);let e=await (0,eT.J)({ideaUuid:O.uuid,projectUuid:E,title:e4.trim(),content:e8.trim()||null});tt(!1),e.success?(e9(!1),await tU(),L.refresh()):ts(e.error||R("ideas.updateFailed"))},tH=async()=>{if(!O||eC)return;eS(!0);let e=await (0,eI.Z)(O.uuid,E);eS(!1),e.success&&(D(),L.refresh())},tG=async()=>{if(!O)return;eH(!0),eJ(null);let e=await (0,eB.e)(O.uuid);eH(!1),e.success?(eW(!0),await tU(),L.refresh()):eJ(e.error||R("elaboration.verifyFailed"))},tJ=async e=>{var t;if(!O)return;tr(!0),q({...O,isContainer:e});let a=await (0,eT.J)({ideaUuid:O.uuid,projectUuid:E,title:O.title,content:null!=(t=O.content)?t:null,isContainer:e});tr(!1),a.success?(await tU(),L.refresh()):(q({...O,isContainer:!e}),l.oR.error(a.error||R("ideas.updateFailed")))},tQ=(null==O?void 0:O.derivedStatus)||"todo",tW=(null==O?void 0:O.isContainer)===!0,tX=null!==O,tZ=(0,eO.o)({ideaStatus:null==O?void 0:O.status,elaborationStatus:null==O?void 0:O.elaborationStatus,elaboration:eD});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:D}),(0,s.jsxs)("div",{className:"fixed right-0 top-14 md:top-0 z-50 flex h-[calc(100%-3.5rem)] md:h-full w-full md:w-[480px] flex-col border-l border-border bg-card shadow-xl ".concat(tE?"":"animate-in slide-in-from-right duration-300"),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-secondary px-6 py-5",children:[(0,s.jsx)("div",{className:"flex-1 min-w-0",children:V?(0,s.jsx)("div",{className:"h-5 w-40 animate-pulse rounded bg-secondary"}):O?e3?(0,s.jsx)("h2",{className:"text-base font-semibold text-foreground",children:R("ideas.editIdea")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider ".concat(tW?"text-primary":"text-muted-foreground"),children:tW?M("typeTheme"):M("typeIdea")}),(0,s.jsx)("h2",{className:"text-base font-semibold text-foreground truncate",children:O.title}),(0,s.jsxs)("div",{className:"mt-1.5 flex min-w-0 items-center gap-2",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:[(0,s.jsx)(g.E,{className:ec._5[tQ]||ec._5.todo,children:O.badgeHint?T("badge.".concat(ec.Wl[O.badgeHint]||"open")):I(ec.Bj[tQ]||"todo")}),tW&&O.childProgress&&O.childProgress.total>0&&(0,s.jsxs)("span",{className:"flex shrink-0 items-center gap-1 text-xs font-medium text-primary",title:M("childrenDone",{done:O.childProgress.done,total:O.childProgress.total}),children:[(0,s.jsx)(th.C,{done:O.childProgress.done,total:O.childProgress.total,size:13,stroke:2}),O.childProgress.done,"/",O.childProgress.total]}),(0,s.jsx)("span",{className:"min-w-0 truncate whitespace-nowrap text-xs text-muted-foreground",title:(0,tp.r)(O.createdAt),children:(0,tp.r)(O.createdAt)})]}),z.length>0&&B&&(0,s.jsx)(tu.U,{sessions:z,onSelect:B.openChatForActiveSession,surface:"sidebar",className:"shrink-0"})]})]}):(0,s.jsx)("h2",{className:"text-base font-semibold text-foreground",children:T("panel.notFound")})}),(0,s.jsxs)("div",{className:"flex shrink-0 items-center gap-2 ml-3",children:[O&&!V&&!e3&&(0,s.jsx)(td,{ideaUuid:O.uuid,projectUuid:E,assignee:O.assignee,assigneeName:null==(t=O.assignee)?void 0:t.name,proposals:G,tasks:Y,triggerRef:eE,busy:eC||eK||e1||te||tn||null!==eZ,stageReason:tW?M("containerHint"):void 0,stageDataReason:et!==tI||es!==G?T("panel.actions.loadingStage"):void 0,verifyReason:eV?T("loading"):eQ?R("elaboration.verifiedQueuedHint"):tZ?void 0:T("panel.actions.verifyUnavailable"),editReason:"elaborated"===O.status?T("panel.actions.editUnavailable"):void 0,onVerify:()=>{!O||O.isContainer||!tZ||eQ||eV||eK||e1||tn||eX({ideaUuid:O.uuid,wake:tG})},onDerive:()=>tv(!0),onSetParent:()=>tf(!0),onMove:()=>tl(!0),onEdit:()=>{O&&"elaborated"!==O.status&&(e6(O.title),e7(O.content||""),ts(null),e9(!0))},onDelete:()=>eF(!0),onStarted:tU,onCloseAutoFocus:e_},O.uuid),(0,s.jsx)(h.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-border",onClick:e3?t$:D,"aria-label":R("common.close"),children:(0,s.jsx)(o.A,{className:"h-4 w-4 text-muted-foreground"})})]})]}),O&&!V&&!e3&&(0,s.jsx)("div",{className:"border-b border-secondary px-6",children:(0,s.jsx)("div",{className:"flex gap-0 -mb-px",children:tB.map(e=>(0,s.jsxs)("button",{onClick:()=>{eo(e),eh(!0),ex(t=>new Set([...t,e])),tD(e)},className:"relative flex items-center gap-1.5 px-3 py-2.5 text-[13px] font-medium transition-colors cursor-pointer ".concat(el===e?"text-primary border-b-2 border-primary":"text-muted-foreground hover:text-muted-foreground"),children:[T("panel.tabs.".concat(e)),"tasks"===e&&tq>0&&(0,s.jsx)("span",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full bg-[#E3F2FD] dark:bg-[#13253a] text-[#1976D2] dark:text-[#5AA9F0] text-[10px] font-semibold leading-none",children:tq}),"activity"===e&&ef>0&&(0,s.jsx)("span",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full bg-secondary text-muted-foreground text-[10px] font-semibold leading-none",children:ef})]},e))})}),(0,s.jsx)(f.F,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:(0,s.jsx)("div",{className:"flex min-h-full flex-col px-6 py-5",children:V?(0,s.jsxs)("div",{className:"flex flex-1 items-center justify-center py-12",children:[(0,s.jsx)(d.A,{className:"h-6 w-6 animate-spin text-primary"}),(0,s.jsx)("span",{className:"ml-2 text-sm text-muted-foreground",children:T("loading")})]}):K?(0,s.jsx)("div",{className:"flex flex-1 items-center justify-center py-12",children:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:K})}):O?e3?(0,s.jsxs)("div",{className:"space-y-5",children:[ta&&(0,s.jsx)("div",{className:"rounded-lg bg-destructive/10 p-3 text-sm text-destructive",children:ta}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(j.J,{htmlFor:"edit-title",className:"text-[13px] font-medium text-foreground",children:R("ideas.titleLabel")}),(0,s.jsx)(v.p,{id:"edit-title",value:e4,onChange:e=>e6(e.target.value),className:"border-border text-sm focus-visible:ring-primary",autoFocus:!0})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(j.J,{htmlFor:"edit-content",className:"text-[13px] font-medium text-foreground",children:R("common.content")}),(0,s.jsx)(b.T,{id:"edit-content",value:e8,onChange:e=>e7(e.target.value),rows:8,className:"border-border text-sm resize-none focus-visible:ring-primary"})]}),(0,s.jsxs)("div",{className:"flex items-center justify-end gap-3",children:[(0,s.jsx)(h.$,{variant:"outline",onClick:t$,disabled:te,children:R("common.cancel")}),(0,s.jsxs)(h.$,{onClick:tK,disabled:te||!e4.trim(),children:[te&&(0,s.jsx)(d.A,{className:"mr-2 h-4 w-4 animate-spin"}),R("common.save")]})]})]}):(0,s.jsxs)(s.Fragment,{children:[eQ&&(0,s.jsx)("p",{role:"status",className:"mb-4 text-xs text-muted-foreground",children:R("elaboration.verifiedQueuedHint")}),eG&&(0,s.jsx)("p",{role:"alert",className:"mb-4 text-xs text-destructive",children:eG}),tW&&(0,s.jsx)("p",{className:"mb-4 text-xs text-muted-foreground",children:M("containerHint")}),ed.has("overview")&&(0,s.jsxs)("div",{style:{display:"overview"===el?"block":"none"},children:[(0,s.jsxs)("div",{className:"mb-5 flex items-start justify-between gap-3 rounded-lg border border-[#EFEBE3] dark:border-[#2a2a2e] bg-background px-3.5 py-3",children:[(0,s.jsxs)("div",{className:"min-w-0 space-y-0.5",children:[(0,s.jsxs)(j.J,{htmlFor:"container-toggle",className:"flex items-center gap-1.5 text-[13px] font-medium text-foreground",children:[(0,s.jsx)(c.A,{className:"h-3.5 w-3.5 text-primary","aria-hidden":!0}),M("container")]}),(0,s.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:M("containerDescription")})]}),(0,s.jsx)(y.d,{id:"container-toggle",checked:tW,disabled:tn,onCheckedChange:tJ,"aria-label":M("makeContainer")})]}),(0,s.jsx)(eu,{idea:O,proposals:G,tasks:Y,onSelectTask:tC}),(0,s.jsxs)("div",{className:"mt-5 space-y-2",children:[(0,s.jsx)("div",{className:"flex items-center",children:(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(c.A,{className:"h-3.5 w-3.5 text-primary"}),(0,s.jsx)("span",{className:"text-[12px] font-semibold text-foreground/80",children:M("title")})]})}),O.parent?(0,s.jsxs)("button",{type:"button",onClick:()=>null==U?void 0:U(O.parent.uuid),className:"flex w-full items-center gap-2 rounded-lg bg-background px-3 py-2.5 text-left transition-colors hover:bg-secondary",children:[(0,s.jsx)(x,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,s.jsx)("span",{className:"shrink-0 text-[12px] text-muted-foreground",children:M("derivedFrom")}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate text-[12px] font-medium text-foreground/80",children:O.parent.title})]}):(0,s.jsx)("p",{className:"px-1 text-[12px] text-muted-foreground",children:M("noParent")}),O.children&&O.children.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-1 pt-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-[12px] font-medium text-foreground/80",children:M("derivedIdeas")}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground",children:O.children.length})]}),(()=>{let e=O.children.filter(e=>"done"===e.derivedStatus).length,t=O.children.length;return(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-[12px] text-muted-foreground",title:M("childrenDone",{done:e,total:t}),children:[(0,s.jsx)(th.C,{done:e,total:t,size:14,stroke:2}),e,"/",t]})})()]}),(0,s.jsx)("div",{className:"overflow-hidden rounded-lg border border-[#EFEBE3] dark:border-[#2a2a2e]",children:O.children.map((e,t)=>(0,s.jsxs)("div",{children:[t>0&&(0,s.jsx)("div",{className:"h-px bg-[#F0EEEA] dark:bg-[#1f1e1c]"}),(0,s.jsxs)("button",{type:"button",onClick:()=>null==U?void 0:U(e.uuid),className:"flex w-full items-center justify-between gap-2 px-3 py-2.5 text-left transition-colors hover:bg-background",children:[(0,s.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,s.jsx)(m.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,s.jsx)("span",{className:"truncate text-[12px] text-foreground",children:e.title})]}),(0,s.jsx)(g.E,{className:"shrink-0 border-0 text-[10px] ".concat(ec._5[e.derivedStatus]||ec._5.todo),children:I(ec.Bj[e.derivedStatus]||"todo")})]})]},e.uuid))})]})]}),(0,s.jsx)(em,{projectUuid:E,ideaUuid:O.uuid,proposals:G,onDocClick:tS}),(0,s.jsxs)("div",{className:"mt-5 space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(p.A,{className:"h-3.5 w-3.5 text-primary"}),(0,s.jsx)("span",{className:"text-[12px] font-semibold text-foreground/80",children:R("references.title")})]}),(0,s.jsx)(tc.ReferencesSection,{targetType:"idea",targetUuid:O.uuid,canWrite:!0,compact:!0})]})]}),tB.includes("elaboration")&&ed.has("elaboration")&&(0,s.jsx)("div",{style:{display:"elaboration"===el?"block":"none"},children:(0,s.jsx)(P,{idea:O,elaboration:eD,isLoading:eV,onRefresh:async()=>{await tL(),await tU()},onReassign:()=>ej(!0),canReassign:tX})}),tB.includes("proposal")&&ed.has("proposal")&&(0,s.jsx)("div",{style:{display:"proposal"===el?"block":"none"},children:(0,s.jsx)(X,{idea:O,projectUuid:E,onTaskClick:tC,onDocClick:tS,initialProposals:G})}),tB.includes("tasks")&&ed.has("tasks")&&(0,s.jsx)("div",{style:{display:"tasks"===el?"block":"none"},children:(0,s.jsx)(eg,{tasks:Y,projectUuid:E,proposalUuids:G.filter(e=>"approved"===e.status).map(e=>e.uuid),onSelectTask:tC})}),ed.has("activity")&&(0,s.jsx)("div",{style:{display:"activity"===el?"block":"none"},children:(0,s.jsx)(ey,{ideaUuid:O.uuid,currentUserUuid:_,commentCount:ef,onCommentCountChange:ev})})]}):null})}),O&&(0,s.jsx)(k.Lt,{open:eA,onOpenChange:eF,children:(0,s.jsxs)(k.EO,{onCloseAutoFocus:e_,children:[(0,s.jsxs)(k.wd,{children:[(0,s.jsx)(k.r7,{children:R("ideas.deleteIdea")}),(0,s.jsx)(k.$v,{children:R("ideas.deleteIdeaConfirm",{title:O.title})})]}),(0,s.jsxs)(k.ck,{children:[(0,s.jsx)(k.Zr,{children:R("common.cancel")}),(0,s.jsx)(k.Rx,{variant:"destructive",onClick:tH,disabled:eC,children:R("common.delete")})]})]})})]}),(0,s.jsx)(ew.h,{open:ti,onOpenChange:tl,onCloseAutoFocus:e_,ideaUuid:F,projectUuid:E,onMoved:()=>D()}),O&&(0,s.jsx)(eU,{open:to,onOpenChange:tf,ideaUuid:O.uuid,ideaTitle:O.title,projectUuid:E,currentParentUuid:null!=(w=O.parentUuid)?w:null,descendantUuids:null!=(C=O.descendantUuids)?C:[],onChanged:tU,onCloseAutoFocus:e_}),O&&(0,s.jsx)(eR.i,{open:tg,onOpenChange:tv,onCloseAutoFocus:e_,projectUuid:E,parentUuid:O.uuid,parentTitle:O.title,onCreated:e=>{l.oR.success(M("deriveIdea")),L.refresh(),null==U||U(e)}}),eb&&O&&(0,s.jsx)(ez.i,{idea:{uuid:O.uuid,title:O.title,content:O.content,status:O.status,assignee:O.assignee?{type:O.assignee.type,uuid:O.assignee.uuid,name:O.assignee.name}:null},projectUuid:E,currentUserUuid:_,onClose:()=>{ej(!1),tU()}}),(0,s.jsx)(e5.V,{open:null!==eZ,onCloseAutoFocus:e_,agentName:null!=(S=null==O||null==(a=O.assignee)?void 0:a.name)?S:"",instances:null!=(A=null==eZ?void 0:eZ.instances)?A:[],onConfirm:eY,onCancel:e0}),tb&&ty&&(0,s.jsx)(ek.v,{task:ty,projectUuid:E,currentUserUuid:_,mode:tA?"sidebyside":"overlay",onClose:()=>{tj(null),tk(null)},onBack:()=>{tj(null),tk(null)}}),tN&&(0,s.jsx)(eN.K,{title:tN.title,type:tN.type,content:tN.content,mode:tA?"sidebyside":"overlay",onClose:()=>tw(null),onBack:()=>tw(null)})]})}},39077:(e,t,a)=>{a.d(t,{S:()=>l});var s=a(90508);a(1856);var n=a(60532),r=a(98861),i=a(24377);function l(e){let{className:t,...a}=e;return(0,s.jsx)(r.Root,{"data-slot":"checkbox",className:(0,i.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:(0,s.jsx)(r.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:(0,s.jsx)(n.A,{className:"size-3.5"})})})}},39674:(e,t,a)=>{a.d(t,{Xi:()=>o,av:()=>d,j7:()=>l,tU:()=>i});var s=a(90508);a(1856);var n=a(79834),r=a(24377);function i(e){let{className:t,...a}=e;return(0,s.jsx)(n.Root,{"data-slot":"tabs",className:(0,r.cn)("flex flex-col gap-2",t),...a})}function l(e){let{className:t,...a}=e;return(0,s.jsx)(n.List,{"data-slot":"tabs-list",className:(0,r.cn)("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",t),...a})}function o(e){let{className:t,...a}=e;return(0,s.jsx)(n.Trigger,{"data-slot":"tabs-trigger",className:(0,r.cn)("data-[state=active]:bg-background data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring inline-flex items-center justify-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...a})}function d(e){let{className:t,...a}=e;return(0,s.jsx)(n.Content,{"data-slot":"tabs-content",className:(0,r.cn)("flex-1 outline-none",t),...a})}},48127:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(66206).A)("corner-down-right",[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]])},64131:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(66206).A)("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]])},77390:(e,t,a)=>{a.d(t,{C:()=>r});var s=a(90508),n=a(24377);function r(e){let{done:t,total:a,size:r=14,stroke:i=2,className:l,color:o="#B26B3D",trackColor:d="#EAD9C8"}=e,c=(r-i)/2,u=2*Math.PI*c,x=a>0?Math.min(1,Math.max(0,t/a)):0,m=a>0&&t>=a;return(0,s.jsxs)("svg",{width:r,height:r,viewBox:"0 0 ".concat(r," ").concat(r),className:(0,n.cn)("shrink-0",l),role:"img","aria-label":"".concat(t,"/").concat(a),children:[(0,s.jsx)("circle",{cx:r/2,cy:r/2,r:c,fill:"none",stroke:d,strokeWidth:i}),x>0&&(0,s.jsx)("circle",{cx:r/2,cy:r/2,r:c,fill:"none",stroke:m?"#1D9E75":o,strokeWidth:i,strokeDasharray:u,strokeDashoffset:u*(1-x),strokeLinecap:"round",transform:"rotate(-90 ".concat(r/2," ").concat(r/2,")")})]})}},79834:(e,t,a)=>{a.r(t),a.d(t,{Content:()=>D,List:()=>E,Root:()=>F,Tabs:()=>b,TabsContent:()=>C,TabsList:()=>y,TabsTrigger:()=>N,Trigger:()=>_,createTabsScope:()=>h});var s=a(1856),n=a(33328),r=a(21032),i=a(94782),l=a(19900),o=a(93367),d=a(72599),c=a(66249),u=a(40577),x=a(90508),m="Tabs",[p,h]=(0,r.A)(m,[i.RG]),f=(0,i.RG)(),[g,v]=p(m),b=s.forwardRef((e,t)=>{let{__scopeTabs:a,value:s,onValueChange:n,defaultValue:r,orientation:i="horizontal",dir:l,activationMode:p="automatic",...h}=e,f=(0,d.jH)(l),[v,b]=(0,c.i)({prop:s,onChange:n,defaultProp:null!=r?r:"",caller:m});return(0,x.jsx)(g,{scope:a,baseId:(0,u.B)(),value:v,onValueChange:b,orientation:i,dir:f,activationMode:p,children:(0,x.jsx)(o.sG.div,{dir:f,"data-orientation":i,...h,ref:t})})});b.displayName=m;var j="TabsList",y=s.forwardRef((e,t)=>{let{__scopeTabs:a,loop:s=!0,...n}=e,r=v(j,a),l=f(a);return(0,x.jsx)(i.bL,{asChild:!0,...l,orientation:r.orientation,dir:r.dir,loop:s,children:(0,x.jsx)(o.sG.div,{role:"tablist","aria-orientation":r.orientation,...n,ref:t})})});y.displayName=j;var k="TabsTrigger",N=s.forwardRef((e,t)=>{let{__scopeTabs:a,value:s,disabled:r=!1,...l}=e,d=v(k,a),c=f(a),u=S(d.baseId,s),m=A(d.baseId,s),p=s===d.value;return(0,x.jsx)(i.q7,{asChild:!0,...c,focusable:!r,active:p,children:(0,x.jsx)(o.sG.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":m,"data-state":p?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:u,...l,ref:t,onMouseDown:(0,n.mK)(e.onMouseDown,e=>{r||0!==e.button||!1!==e.ctrlKey?e.preventDefault():d.onValueChange(s)}),onKeyDown:(0,n.mK)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&d.onValueChange(s)}),onFocus:(0,n.mK)(e.onFocus,()=>{let e="manual"!==d.activationMode;p||r||!e||d.onValueChange(s)})})})});N.displayName=k;var w="TabsContent",C=s.forwardRef((e,t)=>{let{__scopeTabs:a,value:n,forceMount:r,children:i,...d}=e,c=v(w,a),u=S(c.baseId,n),m=A(c.baseId,n),p=n===c.value,h=s.useRef(p);return s.useEffect(()=>{let e=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,x.jsx)(l.C,{present:r||p,children:a=>{let{present:s}=a;return(0,x.jsx)(o.sG.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!s,id:m,tabIndex:0,...d,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:s&&i})}})});function S(e,t){return"".concat(e,"-trigger-").concat(t)}function A(e,t){return"".concat(e,"-content-").concat(t)}C.displayName=w;var F=b,E=y,_=N,D=C},82523:(e,t,a)=>{function s(e){return e.replace(/\\n/g,"\n")}a.d(t,{j:()=>s,y:()=>n});let n={prd:"typePrd",tech_design:"typeTechDesign",adr:"typeAdr",spec:"typeSpec",guide:"typeGuide",design:"typeDesign",note:"typeNote",report:"typeReport",other:"typeOther"}},89473:(e,t,a)=>{a.d(t,{Q:()=>n});var s=a(52217);let n=(0,s.createServerReference)("4018c133cab464c751b091e477234f766d43acc054",s.callServer,void 0,s.findSourceMapURL,"getTaskAction")},90612:(e,t,a)=>{a.d(t,{U:()=>u});var s=a(90508),n=a(1856),r=a(39268),i=a(91385),l=a(22922),o=a(17001),d=a(24377);function c(e){var t;return null!=(t=e.agentName)?t:e.agentUuid}function u(e){let{sessions:t,onSelect:a,surface:u,className:x}=e,m=(0,r.c)("activeSessions"),[p,h]=(0,n.useState)(!1),f=(0,n.useRef)(null);if((0,n.useEffect)(()=>()=>{null!==f.current&&clearTimeout(f.current)},[]),0===t.length)return null;let g=t.some(e=>e.canOpen),v=1===t.length&&t[0].canOpen,b=t[0],j=()=>{null!==f.current&&(clearTimeout(f.current),f.current=null)},y=()=>{j(),f.current=setTimeout(()=>h(!1),120)},k=e=>{e.canOpen&&(h(!1),a(e))},N=(0,s.jsxs)(l.$,{type:"button",variant:"outline",size:"tracker"===u?"xs":"icon-sm","data-testid":"".concat(u,"-active-session-indicator"),"aria-label":m(g?"indicatorLabel":"statusOnlyIndicatorLabel",{count:t.length}),"aria-disabled":!g,"aria-haspopup":t.length>1?"dialog":void 0,onPointerDown:e=>e.stopPropagation(),onPointerEnter:v?void 0:e=>{"touch"!==e.pointerType&&(j(),h(!0))},onPointerLeave:v?void 0:e=>{"touch"!==e.pointerType&&y()},onFocus:v?void 0:()=>h(!0),onClick:e=>{if(e.stopPropagation(),j(),v)return void k(b);p&&e.preventDefault()},onKeyDown:e=>e.stopPropagation(),className:(0,d.cn)("group/active relative gap-1.5 overflow-visible border-emerald-500/35 bg-emerald-500/10 font-semibold text-emerald-700 shadow-none transition-[background-color,border-color,box-shadow] hover:border-emerald-500/60 hover:bg-emerald-500/15 hover:text-emerald-700 hover:shadow-[0_3px_10px_-5px_rgba(16,185,129,0.8)] focus-visible:border-emerald-500 focus-visible:ring-emerald-500/50 dark:border-emerald-500/35 dark:bg-emerald-500/10 dark:text-emerald-300 dark:hover:border-emerald-500/60 dark:hover:bg-emerald-500/15 dark:hover:text-emerald-300","tracker"===u?"h-7 min-w-7 px-1 text-[11px]":"sidebar"===u?"h-8 min-w-8 px-1 text-[11px]":"h-9 min-w-9 px-1 text-[11px] shadow-sm",x),children:[(0,s.jsxs)("span",{className:"relative shrink-0","aria-hidden":!0,children:[(0,s.jsx)(i.AgentAvatar,{name:c(b),size:"graph"===u?22:20,className:"rounded-full ring-1 ring-emerald-600/25"}),(0,s.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 size-2 rounded-full border-2 border-card bg-emerald-500"}),(0,s.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 size-2 rounded-full bg-emerald-400/75 motion-safe:animate-ping motion-reduce:animate-none"})]}),t.length>1&&(0,s.jsx)("span",{children:t.length})]});return v?N:(0,s.jsxs)(o.AM,{open:p,onOpenChange:h,children:[(0,s.jsx)(o.Wv,{asChild:!0,children:N}),(0,s.jsxs)(o.hl,{align:"start",sideOffset:6,onCloseAutoFocus:e=>e.preventDefault(),onPointerDown:e=>e.stopPropagation(),onPointerEnter:j,onPointerLeave:y,onClick:e=>e.stopPropagation(),className:"w-[min(22rem,calc(100vw-2rem))] p-1.5","aria-label":m("chooserLabel"),children:[(0,s.jsx)("p",{className:"px-2 pb-1.5 pt-1 text-xs font-medium text-muted-foreground",children:m("runningCount",{count:t.length})}),(0,s.jsx)("div",{className:"max-h-64 overflow-y-auto",children:t.map(e=>{var t,a;return(0,s.jsxs)(l.$,{type:"button",variant:"ghost",disabled:!e.canOpen,"aria-label":e.canOpen?c(e):m("statusOnlyEntry",{agent:c(e)}),onClick:()=>k(e),className:"group/session h-auto w-full min-w-0 items-start justify-start gap-2.5 whitespace-normal px-2 py-2 text-left disabled:cursor-not-allowed disabled:opacity-65",children:[(0,s.jsxs)("span",{className:"relative mt-0.5 shrink-0","aria-hidden":!0,children:[(0,s.jsx)(i.AgentAvatar,{name:c(e),size:30,className:"rounded-lg ring-1 ring-border transition-shadow group-hover/session:ring-emerald-500/45"}),(0,s.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 size-2.5 rounded-full border-2 border-card bg-emerald-500"})]}),(0,s.jsxs)("span",{className:"min-w-0",children:[(0,s.jsx)("span",{className:"block truncate text-xs font-medium text-foreground",children:c(e)}),(0,s.jsx)("span",{className:"block truncate text-[11px] text-muted-foreground",children:e.connectionAvailable?m("location",{host:null!=(t=e.host)?t:m("unknownHost"),cwd:null!=(a=e.cwd)?a:m("unknownCwd")}):m("agentFallback")}),!e.canOpen&&(0,s.jsx)("span",{className:"block text-[11px] font-medium text-muted-foreground",children:m("statusOnly")})]})]},e.sessionUuid)})})]})]})}},94302:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(66206).A)("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"}]])},98861:(e,t,a)=>{a.r(t),a.d(t,{Checkbox:()=>y,CheckboxIndicator:()=>N,Indicator:()=>N,Root:()=>y,createCheckboxScope:()=>h,unstable_BubbleInput:()=>C,unstable_CheckboxBubbleInput:()=>C,unstable_CheckboxProvider:()=>v,unstable_CheckboxTrigger:()=>j,unstable_Provider:()=>v,unstable_Trigger:()=>j});var s=a(1856),n=a(34124),r=a(21032),i=a(33328),l=a(66249),o=a(72009),d=a(3705),c=a(19900),u=a(93367),x=a(90508),m="Checkbox",[p,h]=(0,r.A)(m),[f,g]=p(m);function v(e){let{__scopeCheckbox:t,checked:a,children:n,defaultChecked:r,disabled:i,form:o,name:d,onCheckedChange:c,required:u,value:p="on",internal_do_not_use_render:h}=e,[g,v]=(0,l.i)({prop:a,defaultProp:null!=r&&r,onChange:c,caller:m}),[b,j]=s.useState(null),[y,k]=s.useState(null),N=s.useRef(!1),w=!b||!!o||!!b.closest("form"),C={checked:g,disabled:i,setChecked:v,control:b,setControl:j,name:d,form:o,value:p,hasConsumerStoppedPropagationRef:N,required:u,defaultChecked:!S(r)&&r,isFormControl:w,bubbleInput:y,setBubbleInput:k};return(0,x.jsx)(f,{scope:t,...C,children:"function"==typeof h?h(C):n})}var b="CheckboxTrigger",j=s.forwardRef((e,t)=>{let{__scopeCheckbox:a,onKeyDown:r,onClick:l,...o}=e,{control:d,value:c,disabled:m,checked:p,required:h,setControl:f,setChecked:v,hasConsumerStoppedPropagationRef:j,isFormControl:y,bubbleInput:k}=g(b,a),N=(0,n.s)(t,f),w=s.useRef(p);return s.useEffect(()=>{let e=null==d?void 0:d.form;if(e){let t=()=>v(w.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[d,v]),(0,x.jsx)(u.sG.button,{type:"button",role:"checkbox","aria-checked":S(p)?"mixed":p,"aria-required":h,"data-state":A(p),"data-disabled":m?"":void 0,disabled:m,value:c,...o,ref:N,onKeyDown:(0,i.mK)(r,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,i.mK)(l,e=>{v(e=>!!S(e)||!e),k&&y&&(j.current=e.isPropagationStopped(),j.current||e.stopPropagation())})})});j.displayName=b;var y=s.forwardRef((e,t)=>{let{__scopeCheckbox:a,name:s,checked:n,defaultChecked:r,required:i,disabled:l,value:o,onCheckedChange:d,form:c,...u}=e;return(0,x.jsx)(v,{__scopeCheckbox:a,checked:n,defaultChecked:r,disabled:l,required:i,onCheckedChange:d,name:s,form:c,value:o,internal_do_not_use_render:e=>{let{isFormControl:s}=e;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(j,{...u,ref:t,__scopeCheckbox:a}),s&&(0,x.jsx)(C,{__scopeCheckbox:a})]})}})});y.displayName=m;var k="CheckboxIndicator",N=s.forwardRef((e,t)=>{let{__scopeCheckbox:a,forceMount:s,...n}=e,r=g(k,a);return(0,x.jsx)(c.C,{present:s||S(r.checked)||!0===r.checked,children:(0,x.jsx)(u.sG.span,{"data-state":A(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:t,style:{pointerEvents:"none",...e.style}})})});N.displayName=k;var w="CheckboxBubbleInput",C=s.forwardRef((e,t)=>{let{__scopeCheckbox:a,...r}=e,{control:i,hasConsumerStoppedPropagationRef:l,checked:c,defaultChecked:m,required:p,disabled:h,name:f,value:v,form:b,bubbleInput:j,setBubbleInput:y}=g(w,a),k=(0,n.s)(t,y),N=(0,o.Z)(c),C=(0,d.X)(i);s.useEffect(()=>{if(!j)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=!l.current;if(N!==c&&e){let a=new Event("click",{bubbles:t});j.indeterminate=S(c),e.call(j,!S(c)&&c),j.dispatchEvent(a)}},[j,N,c,l]);let A=s.useRef(!S(c)&&c);return(0,x.jsx)(u.sG.input,{type:"checkbox","aria-hidden":!0,defaultChecked:null!=m?m:A.current,required:p,disabled:h,name:f,value:v,form:b,...r,tabIndex:-1,ref:k,style:{...r.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function S(e){return"indeterminate"===e}function A(e){return S(e)?"indeterminate":e?"checked":"unchecked"}C.displayName=w}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[48365],{4945:(e,s,t)=>{t.d(s,{v:()=>ew});var a=t(90508),r=t(1856),i=t(91814),n=t(39268),c=t(76111),l=t(9160),d=t(5616),o=t(70633),u=t(57893),m=t(56770),x=t(85226),p=t(62898),h=t(42533),g=t(1861),f=t(66206);let v=(0,f.A)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);var b=t(17475),j=t(60532),N=t(94903),k=t(62482),A=t(6985);let y=(0,f.A)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var w=t(97413),F=t(57731),C=t(48416),S=t(22922),E=t(14554),D=t(15972),_=t(88064),R=t(64993),T=t(91846),U=t(51817),q=t(73693),M=t(91385),B=t(71921),L=t(29532),P=t(52217);let z=(0,P.createServerReference)("600ef5f631a0afd841f0eb94618a94230c75f4633d",P.callServer,void 0,P.findSourceMapURL,"updateTaskStatusAction"),I=(0,P.createServerReference)("40b58bcc05999627d35ce9ee119c48fcf9274c3b64",P.callServer,void 0,P.findSourceMapURL,"createTaskAction"),$=(0,P.createServerReference)("401bb6dd6f54bf569861d7ab90fdb4fbc8f643b95b",P.callServer,void 0,P.findSourceMapURL,"updateTaskFieldsAction"),V=(0,P.createServerReference)("60c0bdd096af5430c2d84638e266ba8ec42ad3dfec",P.callServer,void 0,P.findSourceMapURL,"deleteTaskAction"),W=(0,P.createServerReference)("601f3ef56eba01951aece255c9423d4eac19e10b74",P.callServer,void 0,P.findSourceMapURL,"markCriteriaAction"),J=(0,P.createServerReference)("60a8b08a1cf4971834e4fbffa3a3f313b34f5e7a2e",P.callServer,void 0,P.findSourceMapURL,"resetCriterionAction");var O=t(91796),H=t(79935);let G=(0,P.createServerReference)("40ec818bbfedd992dec5c0389219ebbcfb5b540187",P.callServer,void 0,P.findSourceMapURL,"getTaskActivitiesAction"),X=(0,P.createServerReference)("4012e94f282a6340bf6f328be8af652ec0dc0fc75a",P.callServer,void 0,P.findSourceMapURL,"getTaskSourceAction");var Z=t(82813),K=t(13108),Q=t(30028),Y=t(17722),ee=t(41033),es=t(78307),et=t(24900),ea=t(6930);let er=(0,P.createServerReference)("006dac3d771f51e5a4809e606b0fada9f691716f17",P.callServer,void 0,P.findSourceMapURL,"getDeveloperAgentsAction"),ei=(0,P.createServerReference)("603a80688b344c4c3c823b5926cfc46856dedbc08f",P.callServer,void 0,P.findSourceMapURL,"getAgentInstancesAction"),en=(0,P.createServerReference)("401b67aeb7ef9c6cbebff0181794a5c008531beb23",P.callServer,void 0,P.findSourceMapURL,"claimTaskAction"),ec=(0,P.createServerReference)("70a05b1ea9fd2a45ea7f1ac5abf5213d5d0f870346",P.callServer,void 0,P.findSourceMapURL,"claimTaskToAgentAction"),el=(0,P.createServerReference)("6062f95a86f4e84864f0ff51c588158d441686b9a6",P.callServer,void 0,P.findSourceMapURL,"claimTaskToUserAction"),ed=(0,P.createServerReference)("405b25991166331c3108bfc8ab12e0a6963500d6e8",P.callServer,void 0,P.findSourceMapURL,"releaseTaskAction");function eo(e){var s,t;let{task:c,projectUuid:l,currentUserUuid:d,onClose:o}=e,u=(0,n.c)(),m=(0,i.r)(),[p,h]=(0,r.useState)(!1),[g,f]=(0,r.useState)("self"),[v,b]=(0,r.useState)(""),[j,k]=(0,r.useState)(""),[A,y]=(0,r.useState)([]),[w,F]=(0,r.useState)([]),[C,E]=(0,r.useState)(!0),[D,R]=(0,r.useState)(null),[U,q]=(0,r.useState)([]),[B,L]=(0,r.useState)(!1),[P,z]=(0,r.useState)(null),[I,$]=(0,r.useState)(null),V=!!c.assignee;(0,r.useEffect)(()=>{!async function(){E(!0);let e=await er();y(e.agents||[]),F((e.users||[]).filter(e=>e.uuid!==d)),E(!1)}()},[d]),(0,r.useEffect)(()=>{if("agent"!==g||!v){q([]),$(null),z(null);return}let e=!1;return L(!0),$(null),ei(v,l).then(s=>{e||(q((0,es.C)(s.instances)),z(s.resolvedTarget))}).finally(()=>{e||L(!1)}),()=>{e=!0}},[l,g,v]);let W=null!=(t=U.find(e=>e.connectionUuid===I))?t:null,J=new Set(U.map(e=>e.host)).size>1,O=async()=>{let e;if(h(!0),R(null),"self"===g)e=await en(c.uuid);else if("agent"===g&&v){var s;e=await ec(c.uuid,v,null!=(s=null==W?void 0:W.agentInstanceUuid)?s:void 0)}else if("user"===g&&j)e=await el(c.uuid,j);else{if("release"!==g)return void h(!1);e=await ed(c.uuid)}h(!1),(null==e?void 0:e.success)?(o(),m.refresh()):(null==e?void 0:e.error)&&R(e.error)},H="self"===g||"agent"===g&&v||"user"===g&&j||"release"===g&&V;return(0,a.jsxs)(Y._8,{open:!0,onOpenChange:e=>{e||o()},className:"bg-card sm:max-w-[400px]",header:(0,a.jsx)(Y.AI,{className:"text-base font-semibold text-foreground",children:u("tasks.assignTask")}),footer:(0,a.jsxs)("div",{className:"flex w-full items-center justify-end gap-4",children:[(0,a.jsx)(S.$,{variant:"outline",onClick:o,disabled:p,className:"border-border",children:u("common.cancel")}),(0,a.jsx)(S.$,{onClick:O,disabled:p||!H,className:"bg-primary hover:bg-[#B56A42] text-white",children:p?(0,a.jsx)(x.A,{className:"h-4 w-4 animate-spin"}):"release"===g?u("common.release"):function(){if("agent"!==g||!W)return u("common.assign");let e=(0,et.kn)(W.cwd),s=e.isUnknown?u(e.label):e.label,t=(0,et.g9)(W.host),a=t.isUnknown?u(t.label):t.label;return J?u("assignInstance.assignToWithHost",{path:s,host:a}):u("assignInstance.assignTo",{path:s})}()})]}),bodyClassName:"space-y-4",children:[(0,a.jsxs)("div",{className:"rounded-lg bg-background p-3",children:[(0,a.jsx)("p",{className:"text-[13px] font-medium text-foreground",children:c.title}),c.description&&(0,a.jsx)("p",{className:"mt-1 text-[11px] text-muted-foreground line-clamp-2",children:c.description})]}),V&&(0,a.jsx)("div",{className:"rounded-lg bg-[#E3F2FD] dark:bg-[#13253a] p-3",children:(0,a.jsxs)("p",{className:"text-xs text-[#1976D2] dark:text-[#5AA9F0]",children:[u("common.currentAssignee"),": ",(0,a.jsx)("span",{className:"font-medium",children:null==(s=c.assignee)?void 0:s.name})]})}),D&&(0,a.jsx)("div",{className:"rounded-lg bg-[#FEE2E2] dark:bg-[#331619] p-3",children:(0,a.jsx)("p",{className:"text-xs text-[#D32F2F] dark:text-[#F08078]",children:D})}),(0,a.jsx)("p",{className:"text-[13px] text-muted-foreground",children:u("assign.selectAssignee")}),C?(0,a.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,a.jsx)(x.A,{className:"h-6 w-6 animate-spin text-[#9A9A9A]"})}):(0,a.jsxs)(ee.z,{value:g,onValueChange:e=>f(e),className:"space-y-3",children:[(0,a.jsxs)("div",{className:"rounded-[10px] p-4 transition-colors cursor-pointer ".concat("self"===g?"bg-[#FDF8F6] dark:bg-[#201d1b] border-2 border-primary":"bg-card border border-border hover:border-primary/50"),onClick:()=>f("self"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)(ee.C,{value:"self",id:"self",className:"border-primary text-primary"}),(0,a.jsx)(_.J,{htmlFor:"self",className:"text-sm font-medium text-foreground cursor-pointer",children:u("assign.assignToMyself")})]}),(0,a.jsx)("p",{className:"mt-2 ml-6 text-xs text-muted-foreground leading-relaxed",children:u("assign.assignToMyselfDesc")})]}),(0,a.jsxs)("div",{className:"rounded-[10px] p-4 transition-colors ".concat("agent"===g?"bg-[#FDF8F6] dark:bg-[#201d1b] border-2 border-primary":"bg-card border border-border"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5 cursor-pointer",onClick:()=>f("agent"),children:[(0,a.jsx)(ee.C,{value:"agent",id:"agent",className:"border-primary text-primary"}),(0,a.jsx)(_.J,{htmlFor:"agent",className:"text-sm font-medium text-foreground cursor-pointer",children:u("assign.orAssignToAgent")})]}),(0,a.jsx)("p",{className:"mt-2 ml-6 text-xs text-muted-foreground leading-relaxed",children:u("tasks.onlySelectedAgentCanWork")}),"agent"===g&&(0,a.jsxs)("div",{className:"mt-3 ml-6 space-y-3",children:[(0,a.jsxs)(T.l6,{value:v,onValueChange:b,children:[(0,a.jsx)(T.bq,{className:"w-full border-border",children:(0,a.jsx)(T.yv,{placeholder:u("tasks.selectAgent")})}),(0,a.jsx)(T.gC,{className:"z-[120]",children:A.length>0?A.map(e=>(0,a.jsx)(T.eb,{value:e.uuid,children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(M.AgentAvatar,{name:e.name,size:16,className:"rounded-full"}),(0,a.jsx)("span",{children:e.name})]})},e.uuid)):(0,a.jsx)("div",{className:"px-3 py-2 text-xs text-[#9A9A9A]",children:u("tasks.noAgentsAvailable")})})]}),v&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:u("assignInstance.workingDirectory")}),B?(0,a.jsxs)("div",{className:"flex items-center gap-2 py-2 text-xs text-[#9A9A9A]",children:[(0,a.jsx)(x.A,{className:"h-3.5 w-3.5 animate-spin"}),u("assignInstance.loadingInstances")]}):(null==P?void 0:P.source)==="project_fixed"?(0,a.jsx)(ea.Y,{target:P}):0===U.length?(0,a.jsx)("p",{className:"rounded-lg bg-background p-2.5 text-[11px] leading-relaxed text-muted-foreground",children:u("assignInstance.noInstances")}):(0,a.jsx)(es.O,{instances:U,selectedConnectionUuid:I,onSelect:e=>$(e.connectionUuid),ariaLabel:u("assignInstance.workingDirectory")}),(null==P?void 0:P.source)!=="project_fixed"&&(0,a.jsxs)("div",{className:"flex items-start gap-1.5 text-[11px] leading-relaxed text-[#9A8C7E]",children:[(0,a.jsx)(Q.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0","aria-hidden":!0}),(0,a.jsx)("span",{children:u("assignInstance.pinNote")})]})]})]})]}),(0,a.jsxs)("div",{className:"rounded-[10px] p-4 transition-colors ".concat("user"===g?"bg-[#FDF8F6] dark:bg-[#201d1b] border-2 border-primary":"bg-card border border-border"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5 cursor-pointer",onClick:()=>f("user"),children:[(0,a.jsx)(ee.C,{value:"user",id:"user",className:"border-primary text-primary"}),(0,a.jsx)(_.J,{htmlFor:"user",className:"text-sm font-medium text-foreground cursor-pointer",children:u("assign.orAssignToUser")})]}),"user"===g&&(0,a.jsx)("div",{className:"mt-3 ml-6",children:(0,a.jsxs)(T.l6,{value:j,onValueChange:k,children:[(0,a.jsx)(T.bq,{className:"w-full border-border",children:(0,a.jsx)(T.yv,{placeholder:u("tasks.selectUser")})}),(0,a.jsx)(T.gC,{className:"z-[120]",children:w.length>0?w.map(e=>(0,a.jsx)(T.eb,{value:e.uuid,children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(N.A,{className:"h-4 w-4 text-muted-foreground"}),(0,a.jsx)("span",{children:e.name||e.email})]})},e.uuid)):(0,a.jsx)("div",{className:"px-3 py-2 text-xs text-[#9A9A9A]",children:u("tasks.noUsersAvailable")})})]})})]}),V&&(0,a.jsxs)("div",{className:"rounded-[10px] p-4 transition-colors cursor-pointer ".concat("release"===g?"bg-[#FDF8F6] dark:bg-[#201d1b] border-2 border-primary":"bg-card border border-border hover:border-primary/50"),onClick:()=>f("release"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)(ee.C,{value:"release",id:"release",className:"border-primary text-primary"}),(0,a.jsx)(_.J,{htmlFor:"release",className:"text-sm font-medium text-foreground cursor-pointer",children:u("assign.releaseAssignee")})]}),(0,a.jsx)("p",{className:"mt-2 ml-6 text-xs text-muted-foreground leading-relaxed",children:u("assign.releaseAssigneeDesc")})]})]})]})}let eu=(0,P.createServerReference)("4062f26dc192d1554a37a9bdf376604cbacbda2456",P.callServer,void 0,P.findSourceMapURL,"getTaskDependenciesAction"),em=(0,P.createServerReference)("40d36f77a8263ae2de046587261ec684a4a994882a",P.callServer,void 0,P.findSourceMapURL,"getProjectTasksForDependencyAction");var ex=t(8325);let ep=(0,P.createServerReference)("605b4c79f92f7a42cf24a000ca4725ac71c4869c40",P.callServer,void 0,P.findSourceMapURL,"removeTaskDependencyAction"),eh=(0,P.createServerReference)("40e101064195866ae5df25d77f0782de51fbf2b4eb",P.callServer,void 0,P.findSourceMapURL,"getTaskSessionsAction");var eg=t(38106),ef=t(16544),ev=t(65626),eb=t(90795);let ej={open:"bg-[#FFF3E0] dark:bg-[#3a2a12] text-[#E65100] dark:text-[#F0A050]",assigned:"bg-[#E3F2FD] dark:bg-[#13253a] text-[#1976D2] dark:text-[#5AA9F0]",in_progress:"bg-[#E8F5E9] dark:bg-[#14281a] text-[#5A9E6F] dark:text-[#6FD19A]",to_verify:"bg-[#F3E5F5] dark:bg-[#281630] text-[#7B1FA2] dark:text-[#C98FE0]",done:"bg-[#E0F2F1] dark:bg-[#12292a] text-[#00796B] dark:text-[#4FD1C0]",closed:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-[#9A9A9A]"},eN={open:"open",assigned:"assigned",in_progress:"inProgress",to_verify:"toVerify",done:"done",closed:"closed"},ek={low:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-[#9A9A9A]",medium:"bg-[#FFF3E0] dark:bg-[#3a2a12] text-[#E65100] dark:text-[#F0A050]",high:"bg-[#FEE2E2] dark:bg-[#331619] text-[#D32F2F] dark:text-[#F08078]",critical:"bg-[#FFCDD2] dark:bg-[#3a181c] text-[#B71C1C] dark:text-[#F08078]"},eA={low:"lowPriority",medium:"mediumPriority",high:"highPriority",critical:"criticalPriority"};function ey(e,s){let t=new Date(e),a=new Date().getTime()-t.getTime(),r=Math.floor(a/6e4),i=Math.floor(a/36e5),n=Math.floor(a/864e5);return r<1?s("time.justNow"):r<60?s("time.minutesAgo",{minutes:r}):i<24?s("time.hoursAgo",{hours:i}):n<7?s("time.daysAgo",{days:n}):(0,eg.r)(t)}function ew(e){var s,t;let{task:f,projectUuid:P,currentUserUuid:Q,mode:Y="overlay",onClose:ee,onCreated:es,onDependencyChange:et,onBack:ea}=e,er=(0,n.c)(),ei=(0,i.r)(),[en,ec]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=setTimeout(()=>ec(!0),300);return()=>clearTimeout(e)},[]);let[el,ed]=(0,r.useState)(!1),[ew,eF]=(0,r.useState)([]),[eC,eS]=(0,r.useState)(!0),[eE,eD]=(0,r.useState)(null),[e_,eR]=(0,r.useState)(!1),[eT,eU]=(0,r.useState)([]),[eq,eM]=(0,r.useState)([]),[eB,eL]=(0,r.useState)(!1),[eP,ez]=(0,r.useState)([]),[eI,e$]=(0,r.useState)(null),[eV,eW]=(0,r.useState)([]),[eJ,eO]=(0,r.useState)([]),eH=null===f,[eG,eX]=(0,r.useState)(eH),[eZ,eK]=(0,r.useState)((null==f?void 0:f.title)||""),[eQ,eY]=(0,r.useState)((null==f?void 0:f.description)||""),[e0,e1]=(0,r.useState)((null==f?void 0:f.priority)||"medium"),[e2,e9]=(0,r.useState)((null==f?void 0:f.storyPoints)!=null?String(f.storyPoints):""),[e5,e3]=(0,r.useState)((null!=(s=null==f?void 0:f.acceptanceCriteriaItems)?s:[]).map(e=>{var s;return{description:e.description,required:null==(s=e.required)||s}})),[e6,e4]=(0,r.useState)(!1),[e8,e7]=(0,r.useState)(null),[se,ss]=(0,r.useState)(!1),st=(0,L.RU)(null!=(t=null==f?void 0:f.assignee)?t:null,{type:"user",uuid:Q}),sa=st&&(null==f?void 0:f.status)==="assigned",sr=st&&(null==f?void 0:f.status)==="in_progress",si=(null==f?void 0:f.status)==="to_verify";(0,r.useEffect)(()=>{async function e(){eS(!0),eF((await G(f.uuid)).activities),eS(!1)}async function s(){f.proposalUuid&&eD(await X(f.proposalUuid))}async function t(){eL(!0);let[e,s]=await Promise.all([eu(f.uuid),em(P)]);eU(e.dependsOn),eM(e.dependedBy),ez(s.tasks),eL(!1)}async function a(){let e=await eh(f.uuid);e.success&&e.data&&eW(e.data)}f&&(e(),s(),t(),a())},[null==f?void 0:f.uuid,null==f?void 0:f.proposalUuid,P]),(0,r.useEffect)(()=>{eH&&e();async function e(){ez((await em(P)).tasks)}},[eH,P]),(0,r.useEffect)(()=>{if(f){var e;eX(!1),eK(f.title),eY(f.description||""),e1(f.priority),e9(null!=f.storyPoints?String(f.storyPoints):""),e3((null!=(e=f.acceptanceCriteriaItems)?e:[]).map(e=>{var s;return{description:e.description,required:null==(s=e.required)||s}})),e7(null)}},[null==f?void 0:f.uuid,null==f?void 0:f.title,null==f?void 0:f.description,null==f?void 0:f.priority,null==f?void 0:f.storyPoints,null==f?void 0:f.acceptanceCriteriaItems]);let sn=async e=>{if(!f)return;ed(!0);let s=await z(f.uuid,e);ed(!1),s.success&&(ee(),ei.refresh())},sc=()=>{if(eH)return void ee();if(eX(!1),f){var e;eK(f.title),eY(f.description||""),e1(f.priority),e9(null!=f.storyPoints?String(f.storyPoints):""),e3((null!=(e=f.acceptanceCriteriaItems)?e:[]).map(e=>{var s;return{description:e.description,required:null==(s=e.required)||s}}))}e7(null)},sl=async()=>{if(!eZ.trim())return void e7(er("tasks.titleRequired"));e4(!0),e7(null);let e=e2.trim()?parseFloat(e2):null;if(eH){let s=await I({projectUuid:P,title:eZ.trim(),description:eQ.trim()||void 0,priority:e0,storyPoints:e,acceptanceCriteria:null});e4(!1),s.success?(eJ.length>0&&s.taskUuid&&(await Promise.all(eJ.map(e=>(0,ex.w)(s.taskUuid,e.uuid))),null==et||et()),null==es||es(),ee(),ei.refresh()):e7(s.error||er("tasks.createFailed"))}else{var s;let t=(null!=(s=f.acceptanceCriteriaItems)?s:[]).map(e=>{var s;return{description:e.description,required:null==(s=e.required)||s}}),a=e5.filter(e=>e.description.trim().length>0),r=(0,K.K)(t,a);if(r&&0===a.length){e4(!1),e7(er("acceptanceCriteria.atLeastOneRequired"));return}let i=await $({taskUuid:f.uuid,projectUuid:P,title:eZ.trim(),description:eQ.trim()||null,priority:e0,storyPoints:e,...r?{acceptanceCriteriaItems:a.map(e=>({description:e.description.trim(),required:e.required}))}:{}});e4(!1),i.success?(eX(!1),ei.refresh()):e7(i.error||er("tasks.updateFailed"))}},sd=async()=>{if(!f)return;ss(!0);let e=await V(f.uuid,P);ss(!1),e.success&&(ee(),ei.refresh())},so=async e=>{if(!f)return;e$(null);let s=await (0,ex.w)(f.uuid,e);if(s.success){let s=eP.find(s=>s.uuid===e);s&&eU(e=>[...e,s]),null==et||et()}else e$(s.error||er("tasks.failedToAddDep"))},su=async e=>{if(!f)return;e$(null);let s=await ep(f.uuid,e);s.success?(eU(s=>s.filter(s=>s.uuid!==e)),null==et||et()):e$(s.error||er("tasks.failedToRemoveDep"))},sm=async e=>{if(!f)return;e$(null);let s=await ep(e,f.uuid);s.success?(eM(s=>s.filter(s=>s.uuid!==e)),null==et||et()):e$(s.error||er("tasks.failedToRemoveDep"))},sx=eP.filter(e=>e.uuid!==(null==f?void 0:f.uuid)&&!eT.some(s=>s.uuid===e.uuid)),sp=eP.filter(e=>!eJ.some(s=>s.uuid===e.uuid)),sh="sidebyside"===Y;return(0,a.jsxs)(a.Fragment,{children:[!sh&&(0,a.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:ee}),(0,a.jsxs)("div",{className:"fixed top-14 md:top-0 flex h-[calc(100%-3.5rem)] md:h-full w-full md:w-[480px] flex-col bg-card shadow-xl border-l border-border ".concat(sh?"z-40 ".concat(en?"":"animate-in slide-in-from-right duration-300"):"z-50 right-0 ".concat(en?"":"animate-in slide-in-from-right duration-300")),style:sh?{right:"".concat(eb.L8,"px")}:void 0,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-secondary px-6 py-5",children:[ea&&(0,a.jsx)(S.$,{variant:"ghost",size:"icon",className:"mr-2 h-8 w-8 shrink-0",onClick:ea,children:(0,a.jsx)(o.A,{className:"h-4 w-4 text-muted-foreground"})}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:eG?(0,a.jsx)("h2",{className:"text-base font-semibold text-foreground",children:eH?er("tasks.createTaskTitle"):er("tasks.editTask")}):f?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{className:"text-base font-semibold text-foreground truncate",children:f.title}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center gap-2",children:[(0,a.jsx)(F.E,{className:ej[f.status]||"",children:er("status.".concat(eN[f.status]||f.status))}),(0,a.jsx)(F.E,{className:ek[f.priority]||"",children:er("priority.".concat(eA[f.priority]||f.priority))}),f.storyPoints&&(0,a.jsxs)("span",{className:"rounded bg-secondary px-2 py-0.5 text-xs font-medium text-muted-foreground",children:[f.storyPoints,"h"]})]})]}):null}),(0,a.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[f&&!eG&&(0,a.jsxs)(S.$,{variant:"outline",size:"sm",className:"h-8 gap-1.5 border-border text-foreground",onClick:()=>{var e;f&&(eK(f.title),eY(f.description||""),e1(f.priority),e9(null!=f.storyPoints?String(f.storyPoints):""),e3((null!=(e=f.acceptanceCriteriaItems)?e:[]).map(e=>{var s;return{description:e.description,required:null==(s=e.required)||s}})),e7(null),eX(!0))},children:[(0,a.jsx)(u.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,a.jsx)("span",{className:"text-xs",children:er("common.edit")})]}),(0,a.jsx)(S.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-border",onClick:eG&&!eH?sc:ee,children:(0,a.jsx)(l.A,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,a.jsx)(R.F,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:(0,a.jsx)("div",{className:"flex min-h-full flex-col px-6 py-5",children:eG?(0,a.jsxs)("div",{className:"space-y-5",children:[e8&&(0,a.jsx)("div",{className:"rounded-lg bg-destructive/10 p-3 text-sm text-destructive",children:e8}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(_.J,{htmlFor:"edit-title",className:"text-[13px] font-medium text-foreground",children:er("tasks.titleLabel")}),(0,a.jsx)(E.p,{id:"edit-title",value:eZ,onChange:e=>eK(e.target.value),className:"border-border text-sm focus-visible:ring-primary",autoFocus:!0})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(_.J,{htmlFor:"edit-description",className:"text-[13px] font-medium text-foreground",children:er("tasks.descriptionLabel")}),(0,a.jsx)(D.T,{id:"edit-description",value:eQ,onChange:e=>eY(e.target.value),rows:4,className:"border-border text-sm resize-none focus-visible:ring-primary"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(_.J,{htmlFor:"edit-priority",className:"text-[13px] font-medium text-foreground",children:er("tasks.priorityLabel")}),(0,a.jsxs)(T.l6,{value:e0,onValueChange:e1,children:[(0,a.jsx)(T.bq,{className:"border-border text-sm focus:ring-primary",children:(0,a.jsx)(T.yv,{})}),(0,a.jsxs)(T.gC,{children:[(0,a.jsx)(T.eb,{value:"low",children:er("priority.low")}),(0,a.jsx)(T.eb,{value:"medium",children:er("priority.medium")}),(0,a.jsx)(T.eb,{value:"high",children:er("priority.high")})]})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(_.J,{htmlFor:"edit-story-points",className:"text-[13px] font-medium text-foreground",children:er("tasks.storyPointsLabel")}),(0,a.jsx)(E.p,{id:"edit-story-points",type:"number",min:"0",step:"0.5",value:e2,onChange:e=>e9(e.target.value),className:"border-border text-sm focus-visible:ring-primary"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(_.J,{className:"text-[13px] font-medium text-foreground",children:er("acceptanceCriteria.title")}),(0,a.jsx)(K.C,{items:e5,onChange:e3})]}),eH&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(_.J,{className:"text-[13px] font-medium text-foreground",children:er("tasks.dependencies")}),eJ.length>0&&(0,a.jsx)("div",{className:"space-y-1.5",children:eJ.map(e=>(0,a.jsxs)("div",{className:"group flex items-center justify-between rounded-lg bg-background p-2.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)(c.A,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),(0,a.jsx)("span",{className:"text-xs text-foreground truncate",children:e.title}),(0,a.jsx)(F.E,{className:"shrink-0 text-[10px] ".concat(ej[e.status]||""),children:er("status.".concat(eN[e.status]||e.status))})]}),(0,a.jsx)(S.$,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",onClick:()=>eO(s=>s.filter(s=>s.uuid!==e.uuid)),children:(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] hover:text-[#D32F2F]"})})]},e.uuid))}),sp.length>0&&(0,a.jsxs)(T.l6,{onValueChange:e=>{let s=eP.find(s=>s.uuid===e);s&&eO(e=>[...e,s])},children:[(0,a.jsx)(T.bq,{className:"h-8 border-border text-xs text-muted-foreground focus:ring-primary",children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(d.A,{className:"h-3 w-3"}),(0,a.jsx)(T.yv,{placeholder:er("tasks.addDependency")})]})}),(0,a.jsx)(T.gC,{children:sp.map(e=>(0,a.jsx)(T.eb,{value:e.uuid,children:(0,a.jsx)("span",{className:"truncate",children:e.title})},e.uuid))})]},eJ.length)]})]}):f?(0,a.jsxs)(ef.P.div,{variants:ev.qG,initial:"initial",animate:"animate",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("common.assignee")}),(0,a.jsx)("div",{className:"mt-2 flex items-center gap-2.5 rounded-lg bg-background p-3",children:f.assignee?(0,a.jsxs)(a.Fragment,{children:[(0,L.bB)(f.assignee)?(0,a.jsx)(M.AgentAvatar,{name:f.assignee.name,size:28,className:"rounded-full"}):(0,a.jsx)(q.eu,{className:"h-7 w-7",children:(0,a.jsx)(q.q5,{className:"bg-border text-muted-foreground",children:f.assignee.name.charAt(0).toUpperCase()})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-foreground",children:f.assignee.name}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,L.bB)(f.assignee)?"".concat(er("common.agent")," • ").concat(f.assignee.assignedAt?(0,eg.r)(f.assignee.assignedAt):""):er("common.user")}),"agent_instance"===f.assignee.type&&f.assignee.instance&&(0,a.jsx)("div",{className:"mt-1",children:(0,a.jsx)(B.jQ,{cwd:f.assignee.instance.cwd,host:f.assignee.instance.host})})]})]}):(0,a.jsx)("span",{className:"text-sm text-[#9A9A9A]",children:er("common.unassigned")})})]}),eV.length>0&&(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("sessions.activeWorkers")}),(0,a.jsx)("div",{className:"mt-2 space-y-1.5",children:eV.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2.5 rounded-lg bg-background p-2.5",children:[(0,a.jsxs)("div",{className:"relative flex-shrink-0",children:[(0,a.jsx)(M.AgentAvatar,{name:e.agentName,size:28,className:"rounded-full"}),(0,a.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 h-2 w-2 rounded-full bg-green-500 ring-2 ring-background"})]}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"text-xs font-medium text-foreground truncate",children:e.sessionName}),(0,a.jsxs)("div",{className:"text-[10px] text-[#9A9A9A]",children:[e.agentName," \xb7 ",ey(e.checkinAt,er)]})]})]},e.sessionUuid))})]}),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("common.description")}),(0,a.jsx)("div",{className:"mt-2",children:f.description?(0,a.jsx)("div",{className:"prose prose-sm max-w-none text-[13px] leading-relaxed text-foreground",children:(0,a.jsx)(Z.MarkdownContent,{children:f.description})}):(0,a.jsx)("p",{className:"text-sm italic text-[#9A9A9A]",children:er("common.noDescription")})})]}),f.acceptanceCriteria&&!(f.acceptanceCriteriaItems&&f.acceptanceCriteriaItems.length>0)&&(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("tasks.acceptanceCriteria")}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)("div",{className:"prose prose-sm max-w-none text-[13px] leading-relaxed text-foreground",children:(0,a.jsx)(Z.MarkdownContent,{children:f.acceptanceCriteria})})})]}),eE&&(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("common.source")}),(0,a.jsx)("a",{href:"/projects/".concat(P,"/proposals/").concat(eE.uuid),className:"mt-2 flex items-center justify-between rounded-lg bg-background p-3 hover:bg-[#F0EDE5] dark:hover:bg-[#26241f] transition-colors",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(m.A,{className:"h-3.5 w-3.5 text-primary"}),(0,a.jsx)("span",{className:"text-xs text-foreground",children:eE.title})]})})]}),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("tasks.dependencies")}),eI&&(0,a.jsx)("div",{className:"mt-2 rounded-lg bg-destructive/10 p-2.5 text-xs text-destructive",children:eI}),eB?(0,a.jsx)("div",{className:"mt-2 flex items-center justify-center py-4",children:(0,a.jsx)(x.A,{className:"h-4 w-4 animate-spin text-[#9A9A9A]"})}):(0,a.jsxs)(a.Fragment,{children:[eT.length>0&&(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,a.jsx)(p.A,{className:"h-3 w-3 text-[#9A9A9A]"}),(0,a.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("tasks.dependsOn")})]}),(0,a.jsx)("div",{className:"space-y-1.5",children:eT.map(e=>(0,a.jsxs)("div",{className:"group flex items-center justify-between rounded-lg bg-background p-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)(c.A,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),(0,a.jsx)("span",{className:"text-xs text-foreground truncate",children:e.title}),(0,a.jsx)(F.E,{className:"shrink-0 text-[10px] ".concat(ej[e.status]||""),children:er("status.".concat(eN[e.status]||e.status))})]}),(0,a.jsx)(S.$,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",onClick:()=>su(e.uuid),children:(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] hover:text-[#D32F2F]"})})]},e.uuid))})]}),eq.length>0&&(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,a.jsx)(p.A,{className:"h-3 w-3 rotate-180 text-[#9A9A9A]"}),(0,a.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("tasks.blockedByThis")})]}),(0,a.jsx)("div",{className:"space-y-1.5",children:eq.map(e=>(0,a.jsxs)("div",{className:"group flex items-center justify-between rounded-lg bg-background p-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)(c.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,a.jsx)("span",{className:"text-xs text-foreground truncate",children:e.title}),(0,a.jsx)(F.E,{className:"shrink-0 text-[10px] ".concat(ej[e.status]||""),children:er("status.".concat(eN[e.status]||e.status))})]}),(0,a.jsx)(S.$,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",onClick:()=>sm(e.uuid),children:(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] hover:text-[#D32F2F]"})})]},e.uuid))})]}),0===eT.length&&0===eq.length&&(0,a.jsx)("p",{className:"mt-2 text-sm italic text-[#9A9A9A]",children:er("tasks.noDependencies")}),sx.length>0&&(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsxs)(T.l6,{onValueChange:e=>so(e),children:[(0,a.jsx)(T.bq,{className:"h-8 border-border text-xs text-muted-foreground focus:ring-primary",children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(d.A,{className:"h-3 w-3"}),(0,a.jsx)(T.yv,{placeholder:er("tasks.addDependency")})]})}),(0,a.jsx)(T.gC,{children:sx.map(e=>(0,a.jsx)(T.eb,{value:e.uuid,children:(0,a.jsx)("span",{className:"truncate",children:e.title})},e.uuid))})]},eT.length)})]})]}),f&&f.acceptanceCriteriaItems&&f.acceptanceCriteriaItems.length>0&&(()=>{let e=f.acceptanceCriteriaItems,s=f.acceptanceSummary,t=e=>"passed"===e?(0,a.jsx)(h.A,{className:"h-4 w-4 text-green-600 dark:text-[#6FD19A]"}):"failed"===e?(0,a.jsx)(g.A,{className:"h-4 w-4 text-red-600 dark:text-[#F08078]"}):(0,a.jsx)(v,{className:"h-4 w-4 text-yellow-600 dark:text-[#E0B44E]"}),r=e=>"passed"===e?"bg-green-50 text-green-700 dark:bg-[#14281a] dark:text-[#6FD19A]":"failed"===e?"bg-red-50 text-red-700 dark:bg-[#331619] dark:text-[#F08078]":"bg-yellow-50 text-yellow-700 dark:bg-[#332a12] dark:text-[#E0B44E]",i=async(e,s)=>{(await W(f.uuid,[{uuid:e,status:s}])).success&&ei.refresh()};return(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("acceptanceCriteria.title")}),s&&(0,a.jsx)(F.E,{className:r(f.acceptanceStatus||"pending"),variant:"secondary",children:er("acceptanceCriteria.progress",{passed:s.passed,total:s.total})})]}),(0,a.jsxs)("div",{className:"mt-2 space-y-2",children:[e.map(e=>(0,a.jsx)(C.Zp,{className:"p-3",children:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)("div",{className:"mt-0.5 shrink-0",children:t(e.status)}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"text-xs text-foreground",children:e.description}),(0,a.jsx)(F.E,{variant:"outline",className:"text-[10px] shrink-0",children:e.required?er("acceptanceCriteria.required"):er("acceptanceCriteria.optional")})]}),(0,a.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-[10px]",children:[(0,a.jsx)("span",{className:"text-[#9A9A9A] w-20 shrink-0",children:er("acceptanceCriteria.devSelfCheck")}),(0,a.jsxs)(F.E,{className:"text-[10px] ".concat(r(e.devStatus)),variant:"secondary",children:[t(e.devStatus),(0,a.jsx)("span",{className:"ml-1",children:er("acceptanceCriteria.status.".concat(e.devStatus))})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-[10px]",children:[(0,a.jsx)("span",{className:"text-[#9A9A9A] w-20 shrink-0",children:er("acceptanceCriteria.verification")}),(0,a.jsxs)(F.E,{className:"text-[10px] ".concat(r(e.status)),variant:"secondary",children:[t(e.status),(0,a.jsx)("span",{className:"ml-1",children:er("acceptanceCriteria.status.".concat(e.status))})]})]})]}),e.devEvidence&&(0,a.jsxs)("div",{className:"mt-2 rounded bg-background p-2",children:[(0,a.jsx)("span",{className:"text-[10px] font-medium text-[#9A9A9A]",children:er("acceptanceCriteria.devEvidence")}),(0,a.jsx)("p",{className:"text-[11px] text-foreground mt-0.5",children:e.devEvidence})]}),e.evidence&&(0,a.jsxs)("div",{className:"mt-2 rounded bg-background p-2",children:[(0,a.jsx)("span",{className:"text-[10px] font-medium text-[#9A9A9A]",children:er("acceptanceCriteria.verifyEvidence")}),(0,a.jsx)("p",{className:"text-[11px] text-foreground mt-0.5",children:e.evidence})]}),"pending"===e.status?(0,a.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,a.jsxs)(S.$,{size:"sm",variant:"outline",className:"h-8 min-h-[44px] sm:min-h-0 flex-1 sm:flex-none text-xs text-green-700 dark:text-[#6FD19A] border-green-200 dark:border-[#2a4a34] hover:bg-green-50 dark:hover:bg-[#14281a]",onClick:()=>i(e.uuid,"passed"),children:[(0,a.jsx)(h.A,{className:"h-3.5 w-3.5 mr-1"}),er("acceptanceCriteria.pass")]}),(0,a.jsxs)(S.$,{size:"sm",variant:"outline",className:"h-8 min-h-[44px] sm:min-h-0 flex-1 sm:flex-none text-xs text-red-700 dark:text-[#F08078] border-red-200 dark:border-[#5a2a2e] hover:bg-red-50 dark:hover:bg-[#331619]",onClick:()=>i(e.uuid,"failed"),children:[(0,a.jsx)(g.A,{className:"h-3.5 w-3.5 mr-1"}),er("acceptanceCriteria.fail")]})]}):(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)(S.$,{size:"sm",variant:"ghost",className:"h-7 min-h-[44px] sm:min-h-0 text-xs text-[#9A9A9A] hover:text-foreground",onClick:async()=>{(await J(f.uuid,e.uuid)).success&&ei.refresh()},children:er("acceptanceCriteria.undoVerification")})})]})]})},e.uuid)),s&&(s.requiredPending>0||s.requiredFailed>0)&&(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg bg-yellow-50 dark:bg-[#332a12] p-3 mt-2",children:[(0,a.jsx)(b.A,{className:"h-4 w-4 text-yellow-600 dark:text-[#E0B44E] shrink-0"}),(0,a.jsx)("span",{className:"text-xs text-yellow-700 dark:text-[#E0B44E]",children:er("acceptanceCriteria.gateBlocked",{count:s.requiredPending+s.requiredFailed})})]}),s&&0===s.requiredPending&&0===s.requiredFailed&&s.required>0&&(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg bg-green-50 dark:bg-[#14281a] p-3 mt-2",children:[(0,a.jsx)(h.A,{className:"h-4 w-4 text-green-600 dark:text-[#6FD19A] shrink-0"}),(0,a.jsx)("span",{className:"text-xs text-green-700 dark:text-[#6FD19A]",children:er("acceptanceCriteria.gateReady")})]})]})]})})(),(0,a.jsxs)("div",{className:"mt-5 flex-1",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("common.activity")}),(0,a.jsx)("div",{className:"mt-2 space-y-3",children:eC?(0,a.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,a.jsx)(x.A,{className:"h-4 w-4 animate-spin text-[#9A9A9A]"})}):0===ew.length?(0,a.jsx)("p",{className:"text-sm text-[#9A9A9A] italic",children:er("common.noActivity")}):ew.map(e=>(0,a.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,a.jsx)("div",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-secondary",children:(0,a.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(function(e){switch(e){case"task_created":return"bg-primary";case"task_assigned":case"task_claimed":return"bg-[#1976D2]";case"task_started":return"bg-[#5A9E6F]";case"task_submitted":return"bg-[#7B1FA2]";case"task_completed":case"task_verified":return"bg-[#00796B]";case"task_released":return"bg-[#E65100]";default:return"bg-muted-foreground"}}(e.action))})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"text-xs text-foreground",children:function(e,s){let t=e.sessionName?"".concat(e.actorName," / ").concat(e.sessionName):e.actorName,{action:a}=e;switch(a){case"task_created":return s("activity.taskCreated",{actor:t});case"task_assigned":return s("activity.taskAssigned",{actor:t});case"task_claimed":return s("activity.taskClaimed",{actor:t});case"task_started":return s("activity.taskStarted",{actor:t});case"task_submitted":return s("activity.taskSubmitted",{actor:t});case"task_completed":case"task_verified":return s("activity.taskCompleted",{actor:t});case"task_released":return s("activity.taskReleased",{actor:t});case"task_status_changed":return s("activity.taskStatusChanged",{actor:t});default:return"".concat(t,": ").concat(a)}}(e,er)}),(0,a.jsx)("p",{className:"text-[10px] text-[#9A9A9A]",children:ey(e.createdAt,er)})]})]},e.uuid))})]}),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("references.title")}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)(H.ReferencesSection,{targetType:"task",targetUuid:f.uuid,canWrite:!0,compact:!0})})]}),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("comments.title")}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)(O.$m,{targetType:"task",targetUuid:f.uuid,currentUserUuid:Q,compact:!0})})]})]}):null})}),(0,a.jsx)("div",{className:"border-t border-secondary px-6 py-4",children:(0,a.jsx)("div",{className:"flex items-center gap-3",children:eG?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.$,{variant:"outline",className:"border-border",onClick:sc,disabled:e6,children:er("common.cancel")}),(0,a.jsx)(S.$,{className:"bg-primary hover:bg-[#B56A42] text-white",onClick:sl,disabled:e6||!eZ.trim(),children:e6?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.A,{className:"mr-2 h-4 w-4 animate-spin"}),er("common.saving")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(j.A,{className:"mr-2 h-4 w-4"}),eH?er("common.create"):er("tasks.saveChanges")]})})]}):f?(0,a.jsxs)(a.Fragment,{children:["done"!==f.status&&"closed"!==f.status&&(0,a.jsxs)(S.$,{variant:"outline",className:"border-border",onClick:()=>eR(!0),disabled:el,children:[(0,a.jsx)(N.A,{className:"mr-2 h-4 w-4"}),er("common.assign")]}),sa&&(0,a.jsxs)(S.$,{className:"flex-1 bg-[#1976D2] hover:bg-[#1565C0] text-white",onClick:()=>sn("in_progress"),disabled:el,children:[(0,a.jsx)(k.A,{className:"mr-2 h-4 w-4"}),er("tasks.startWork")]}),sr&&(0,a.jsxs)(S.$,{className:"flex-1 bg-[#7B1FA2] hover:bg-[#6A1B9A] text-white",onClick:()=>sn("to_verify"),disabled:el,children:[(0,a.jsx)(A.A,{className:"mr-2 h-4 w-4"}),er("tasks.submitForReview")]}),si&&(0,a.jsxs)(S.$,{className:"flex-1 bg-[#22C55E] hover:bg-[#16A34A] text-white",onClick:()=>sn("done"),disabled:el,children:[(0,a.jsx)(y,{className:"mr-2 h-4 w-4"}),er("tasks.markAsVerified")]}),("done"===f.status||"closed"===f.status)&&(0,a.jsx)("div",{className:"text-sm text-[#9A9A9A] text-center w-full",children:er("tasks.taskCompleted")}),(0,a.jsx)("div",{className:"ml-auto",children:(0,a.jsxs)(U.Lt,{children:[(0,a.jsx)(U.tv,{asChild:!0,children:(0,a.jsx)(S.$,{variant:"outline",size:"icon",className:"h-9 w-9 border-border text-[#D32F2F] dark:text-[#F08078] hover:bg-[#FFEBEE] dark:hover:bg-[#331619] hover:text-[#D32F2F] hover:border-[#D32F2F]",children:(0,a.jsx)(w.A,{className:"h-4 w-4"})})}),(0,a.jsxs)(U.EO,{children:[(0,a.jsxs)(U.wd,{children:[(0,a.jsx)(U.r7,{children:er("tasks.deleteTask")}),(0,a.jsx)(U.$v,{children:er("tasks.deleteTaskConfirm",{title:f.title})})]}),(0,a.jsxs)(U.ck,{children:[(0,a.jsx)(U.Zr,{children:er("common.cancel")}),(0,a.jsx)(U.Rx,{variant:"destructive",onClick:sd,disabled:se,children:se?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.A,{className:"mr-2 h-4 w-4 animate-spin"}),er("common.delete")]}):er("common.delete")})]})]})]})})]}):null})})]}),f&&e_&&(0,a.jsx)(eo,{task:f,projectUuid:P,currentUserUuid:Q,onClose:()=>eR(!1)})]})}},6985:(e,s,t)=>{t.d(s,{A:()=>a});let a=(0,t(66206).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},8325:(e,s,t)=>{t.d(s,{w:()=>r});var a=t(52217);let r=(0,a.createServerReference)("60e8e7caf1be8a342df588f5426f5840bcc8fa5b9b",a.callServer,void 0,a.findSourceMapURL,"addTaskDependencyAction")},12959:(e,s,t)=>{t.d(s,{h:()=>r});var a=t(52217);let r=(0,a.createServerReference)("402ea59bf9c31add2b45196593376f275e6e034d0f",a.callServer,void 0,a.findSourceMapURL,"getBatchWorkerCountsAction")},70633:(e,s,t)=>{t.d(s,{A:()=>a});let a=(0,t(66206).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},81531:(e,s,t)=>{t.d(s,{T:()=>i});var a=t(1856),r=t(23675);function i(e,s){var t;let i=(0,r.useSearchParams)(),n=(0,a.useRef)(!1),c=!n.current;n.current=!0;let l=null!=(t=i.get("panel"))?t:c&&null!=s?s:null,d=i.get("tab"),o=(0,a.useCallback)((s,t)=>{let a=new URLSearchParams(window.location.search);s?a.set("panel",s):a.delete("panel"),t?a.set("tab",t):a.delete("tab");let r=a.toString();return r?"".concat(e,"?").concat(r):e},[e]),u=(0,a.useCallback)((e,s)=>{window.history.replaceState(null,"",o(e,s))},[o]),m=(0,a.useCallback)(()=>{window.history.replaceState(null,"",o(null))},[o]),x=(0,a.useCallback)(e=>{l&&window.history.replaceState(null,"",o(l,e))},[o,l]);return{selectedId:l,selectedTab:d,openPanel:u,closePanel:m,switchTab:x}}},90795:(e,s,t)=>{t.d(s,{Bj:()=>l,L8:()=>r,Wl:()=>d,_5:()=>c,eT:()=>i,fw:()=>n});var a=t(38106);let r=480;function i(e){switch(e){case"done":return"bg-[#00796B]";case"in_progress":return"bg-[#1976D2]";case"to_verify":return"bg-[#7B1FA2]";case"open":case"assigned":return"bg-[#E65100]";case"closed":return"bg-[#9A9A9A]";default:return"bg-[#D9D9D9]"}}function n(e,s){let t=new Date(e),r=new Date().getTime()-t.getTime(),i=Math.floor(r/6e4),n=Math.floor(r/36e5),c=Math.floor(r/864e5);return i<1?s("time.justNow"):i<60?s("time.minutesAgo",{minutes:i}):n<24?s("time.hoursAgo",{hours:n}):c<7?s("time.daysAgo",{days:c}):(0,a.r)(t)}let c={todo:"bg-[#FFF3E0] text-[#E65100] dark:bg-[#3a2a12] dark:text-[#F0A050]",in_progress:"bg-[#E3F2FD] text-[#1976D2] dark:bg-[#13253a] dark:text-[#5AA9F0]",human_conduct_required:"bg-[#F3E5F5] text-[#7B1FA2] dark:bg-[#281630] dark:text-[#C98FE0]",done:"bg-[#E0F2F1] text-[#00796B] dark:bg-[#12292a] dark:text-[#4FD1C0]"},l={todo:"todo",in_progress:"inProgress",human_conduct_required:"humanConductRequired",done:"done"},d={open:"open",researching:"researching",answer_questions:"answerQuestions",planning:"planning",review_proposal:"reviewProposal",building:"building",verify_work:"verifyWork",done:"done"}},92745:(e,s,t)=>{t.d(s,{_u:()=>A,c_:()=>f,nF:()=>k,qK:()=>j});var a=t(90508),r=t(1856),i=t(26145),n=t(75380);t(33805);var c=t(10196),l=t.n(c),d=t(39268),o=t(57731),u=t(49914);let m={open:"bg-[#FFF3E0] dark:bg-[#3a2a12] text-[#E65100] dark:text-[#F0A050]",assigned:"bg-[#E3F2FD] dark:bg-[#13253a] text-[#1976D2] dark:text-[#5AA9F0]",in_progress:"bg-[#E8F5E9] dark:bg-[#14281a] text-[#5A9E6F] dark:text-[#6FD19A]",to_verify:"bg-[#F3E5F5] dark:bg-[#281630] text-[#7B1FA2] dark:text-[#C98FE0]",done:"bg-[#E0F2F1] dark:bg-[#12292a] text-[#00796B] dark:text-[#4FD1C0]",closed:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-muted-foreground"},x={open:"#E65100",assigned:"#1976D2",in_progress:"#5A9E6F",to_verify:"#7B1FA2",done:"#00796B",closed:"#9A9A9A"},p={low:"priority.low",medium:"priority.medium",high:"priority.high",critical:"priority.critical"},h={open:"status.open",assigned:"status.assigned",in_progress:"status.inProgress",to_verify:"status.toVerify",done:"status.done",closed:"status.closed"},g={low:"bg-[#9A9A9A]",medium:"bg-[#E65100]",high:"bg-[#D32F2F]",critical:"bg-[#B71C1C]"},f={taskNode:function(e){let{data:s}=e,t=(0,d.c)();return(0,a.jsxs)("div",{className:"rounded-lg border-2 border-[#E5E2DC] dark:border-[#2a2a2e] bg-card px-4 py-3 shadow-sm min-w-[200px] max-w-[260px] cursor-pointer hover:border-primary transition-colors",children:[(0,a.jsx)(i.h7,{type:"target",position:n.yX.Top,className:"!bg-primary !w-2 !h-2"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,a.jsx)(o.E,{className:"text-[10px] ".concat(m[s.status]||""),children:t(h[s.status]||s.status)}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("div",{className:"h-1.5 w-1.5 rounded-full ".concat(g[s.priority]||"")}),(0,a.jsx)("span",{className:"text-[10px] text-muted-foreground",children:t(p[s.priority]||s.priority)})]})]}),(0,a.jsx)("p",{className:"text-xs font-medium text-foreground leading-snug line-clamp-2",children:s.title}),(0,a.jsx)(i.h7,{type:"source",position:n.yX.Bottom,className:"!bg-primary !w-2 !h-2"})]})}},v={taskNode:function(e){let{data:s}=e,t=x[s.status]||"#E5E0D8";return(0,a.jsxs)("div",{className:"rounded-md border-[1.5px] bg-card px-2.5 py-1.5 shadow-sm",style:{borderColor:t,width:b},children:[(0,a.jsx)(i.h7,{type:"target",position:n.yX.Top,className:"!bg-primary !w-1.5 !h-1.5"}),(0,a.jsx)("p",{className:"text-[10px] font-medium text-foreground leading-tight line-clamp-2",children:s.title}),(0,a.jsx)(i.h7,{type:"source",position:n.yX.Bottom,className:"!bg-primary !w-1.5 !h-1.5"})]})}},b=150,j={animated:!0,style:{stroke:"#C67A52",strokeWidth:2},markerEnd:{type:"arrowclosed",color:"#C67A52"}},N={animated:!0,style:{stroke:"#C67A52",strokeWidth:1.5},markerEnd:{type:"arrowclosed",color:"#C67A52"}};function k(e,s,t){var a,r,i,n;let c=null!=(a=null==t?void 0:t.nodeWidth)?a:240,d=null!=(r=null==t?void 0:t.nodeHeight)?r:80,o=new(l()).graphlib.Graph;return o.setDefaultEdgeLabel(()=>({})),o.setGraph({rankdir:"TB",nodesep:null!=(i=null==t?void 0:t.nodesep)?i:50,ranksep:null!=(n=null==t?void 0:t.ranksep)?n:80}),e.forEach(e=>{o.setNode(e.id,{width:c,height:d})}),s.forEach(e=>{o.setEdge(e.source,e.target)}),l().layout(o),{nodes:e.map(e=>{let s=o.node(e.id);return{...e,position:{x:s.x-c/2,y:s.y-d/2}}}),edges:s}}function A(e){let{tasks:s,edges:t,readonly:n=!1,compact:c=!1,height:l,onNodeClick:o,className:m}=e,x=(0,d.c)(),p=(0,u.W)(),{layoutedNodes:h,layoutedEdges:g}=(0,r.useMemo)(()=>{let e=s.map(e=>{var s;return{id:e.uuid,type:"taskNode",position:{x:0,y:0},data:{title:e.title,status:e.status,priority:e.priority,proposalUuid:null!=(s=e.proposalUuid)?s:null}}}),a=k(e,t.map((e,s)=>({id:"e-".concat(s),source:e.to,target:e.from,...c?N:j})),c?{nodeWidth:b,nodeHeight:50,nodesep:20,ranksep:40}:void 0);return{layoutedNodes:a.nodes,layoutedEdges:a.edges}},[s,t,c]);return 0===s.length?(0,a.jsx)("div",{className:"flex items-center justify-center text-sm text-muted-foreground ".concat(m||""),style:l?{height:l}:void 0,children:x("tasks.noTasksToDisplay")}):(0,a.jsx)("div",{className:"rounded-[10px] border border-border bg-[#F7F6F3] dark:bg-[#1e1d1b] ".concat(m||""),style:l?{height:l}:void 0,children:(0,a.jsxs)(i.Gc,{colorMode:p?"dark":"light",nodes:h,edges:g,nodeTypes:c?v:f,onNodeClick:o?(e,s)=>o(s.id):void 0,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:1.5,proOptions:{hideAttribution:!0},nodesDraggable:!n,nodesConnectable:!n,elementsSelectable:!n,panOnDrag:!0,zoomOnScroll:!0,children:[(0,a.jsx)(i.VS,{color:p?"#40392f":"#E5E0D8",gap:20}),!n&&(0,a.jsx)(i.H2,{className:"[&>button]:border-border [&>button]:bg-card [&>button]:text-foreground [&>button:hover]:bg-background"})]})})}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[71522],{10465:(e,s,t)=>{"use strict";t.d(s,{m:()=>m});var a=t(90508),n=t(81235),r=t(75320),i=t(39268),l=t(22922),o=t(32277),c=t(24377);let d="https://doc.chorus-ai.dev";function m(e){let{variant:s="inline",className:t}=e,m=(0,i.c)("resourceLinks"),{locale:u}=(0,o.Y)(),x="en"===u?d:"".concat(d,"/").concat(u);return(0,a.jsxs)("div",{className:(0,c.cn)("flex flex-wrap items-center gap-2","footer"===s&&"justify-center gap-3",t),children:[(0,a.jsx)(l.$,{variant:"outline",size:"sm",asChild:!0,children:(0,a.jsxs)("a",{href:"https://github.com/Chorus-AIDLC/Chorus",target:"_blank",rel:"noopener noreferrer","aria-label":m("githubAria"),children:[(0,a.jsx)(n.A,{className:"h-4 w-4"}),m("github")]})}),(0,a.jsx)(l.$,{variant:"outline",size:"sm",asChild:!0,children:(0,a.jsxs)("a",{href:x,target:"_blank",rel:"noopener noreferrer","aria-label":m("docsAria"),children:[(0,a.jsx)(r.A,{className:"h-4 w-4"}),m("docs")]})})]})}},15272:(e,s,t)=>{var a={"./en.json":[99373,99373],"./ja.json":[11595,11595],"./ko.json":[33456,33456],"./zh.json":[4860,4860]};function n(e){if(!t.o(a,e))return Promise.resolve().then(()=>{var s=Error("Cannot find module '"+e+"'");throw s.code="MODULE_NOT_FOUND",s});var s=a[e],n=s[0];return t.e(s[1]).then(()=>t.t(n,19))}n.keys=()=>Object.keys(a),n.id=15272,e.exports=n},25359:(e,s,t)=>{"use strict";t.d(s,{AL:()=>i,IB:()=>a,L$:()=>r,q:()=>n});let a=["en","zh","ko","ja"],n="en",r={en:"English",zh:"中文",ko:"한국어",ja:"日本語"};function i(){if("undefined"==typeof navigator)return n;let e=navigator.language.split("-")[0];return a.includes(e)?e:n}},32277:(e,s,t)=>{"use strict";t.d(s,{LocaleProvider:()=>m,Y:()=>d});var a=t(90508),n=t(1856),r=t(57472),i=t(25359),l=t(67712);let o="chorus-locale",c=(0,n.createContext)(null);function d(){let e=(0,n.useContext)(c);if(!e)throw Error("useLocale must be used within LocaleProvider");return e}function m(e){let{children:s}=e,[d,m]=(0,n.useState)(i.q),[u,x]=(0,n.useState)(null),[p,h]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e,s=localStorage.getItem(o);s&&i.IB.includes(s)?e=s:(e=(0,i.AL)(),localStorage.setItem(o,e)),m(e),document.cookie="chorus-locale=".concat(e,";path=/;max-age=").concat(31536e3,";SameSite=Lax"),h(!0)},[]),(0,n.useEffect)(()=>{p&&t(15272)("./".concat(d,".json")).then(e=>{x(e.default)}).catch(e=>{l.q.error("Failed to load messages for locale ".concat(d,":"),e),t(15272)("./".concat(i.q,".json")).then(e=>{x(e.default)})})},[d,p]);let g=(0,n.useCallback)(e=>{m(e),localStorage.setItem(o,e),document.cookie="chorus-locale=".concat(e,";path=/;max-age=").concat(31536e3,";SameSite=Lax"),document.documentElement.lang=e},[]);return p&&u?(0,a.jsx)(c.Provider,{value:{locale:d,setLocale:g},children:(0,a.jsx)(r.A,{locale:d,messages:u,children:s})}):null}},37750:(e,s,t)=>{"use strict";t.d(s,{Y:()=>u});var a=t(90508),n=t(1856),r=t(39268),i=t(22922),l=t(60532),o=t(9160),c=t(67712),d=t(75427),m=t(83792);function u(e){let{onAgentCreated:s,createAgentAndKey:t,onClose:u,embedded:x=!1,submitLabel:p,submittingLabel:h}=e,g=(0,r.c)(),[j,f]=(0,n.useState)(""),[b,v]=(0,n.useState)("admin_agent"),[N,k]=(0,n.useState)(["admin_agent"]),[y,w]=(0,n.useState)([]),[C,_]=(0,n.useState)(""),[S,T]=(0,n.useState)(!1),[A,R]=(0,n.useState)(null),[L,U]=(0,n.useState)(!1),I=async e=>{if((e.preventDefault(),j)&&("custom"!==b||0!==y.length)){T(!0);try{let e=await t({name:j,roles:N,permissions:"custom"===b?y:[],persona:C||null});e.success&&e.key?(x||R(e.key),s({uuid:e.agentUuid||"",name:j,roles:N,permissions:"custom"===b?y:[]},e.key)):c.q.error("Failed to create API key:",e.error)}catch(e){c.q.error("Failed to create API key:",e)}finally{T(!1)}}},P=async e=>{try{await navigator.clipboard.writeText(e),U(!0),setTimeout(()=>U(!1),2e3)}catch(e){c.q.error("Failed to copy to clipboard:",e)}},E=()=>{f(""),v("admin_agent"),k(["admin_agent"]),w([]),_(""),R(null),null==u||u()};return A&&!x?(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center gap-2 text-green-600",children:[(0,a.jsx)(l.A,{className:"h-5 w-5"}),(0,a.jsx)("span",{className:"font-medium",children:g("settings.apiKeyCreated")})]}),(0,a.jsx)("p",{className:"mb-4 text-sm text-muted-foreground",children:g("settings.apiKeyCreatedDesc")}),(0,a.jsxs)("div",{className:"mb-4 flex items-center gap-2",children:[(0,a.jsx)("code",{className:"flex-1 rounded bg-foreground px-3 py-2 font-mono text-sm text-background",children:A}),(0,a.jsx)(i.$,{variant:"outline",size:"sm",onClick:()=>P(A),children:g(L?"common.copied":"common.copy")})]}),(0,a.jsx)("p",{className:"mb-3 text-sm text-muted-foreground",children:g("settings.installGuideIntro")}),(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(m.Z,{apiKey:A})}),(0,a.jsx)(i.$,{onClick:E,className:"w-full",children:g("common.done")})]}):(0,a.jsxs)("form",{onSubmit:I,children:[!x&&(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-6 py-5",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-foreground",children:g("settings.createApiKey")}),u&&(0,a.jsx)(i.$,{type:"button",variant:"ghost",size:"icon",onClick:E,className:"h-8 w-8",children:(0,a.jsx)(o.A,{className:"h-4 w-4"})})]}),(0,a.jsx)("div",{className:x?void 0:"p-6",children:(0,a.jsx)(d.L,{name:j,onNameChange:f,preset:b,permissions:y,onPermissionsChange:function(e){v(e.preset),k(e.roles),w(e.permissions)},persona:C,onPersonaChange:_,nameInputId:"keyName",personaInputId:"create-agent-persona"})}),(0,a.jsxs)("div",{className:x?"flex justify-end gap-3 pt-2":"flex justify-end gap-3 border-t border-border px-6 py-4",children:[!x&&u&&(0,a.jsx)(i.$,{type:"button",variant:"outline",onClick:E,children:g("common.cancel")}),(0,a.jsx)(i.$,{type:"submit",disabled:!j||"custom"===b&&0===y.length||S,className:x?"w-full":void 0,size:x?"lg":"default",children:S?null!=h?h:g("settings.creating"):null!=p?p:g("settings.createApiKey")})]})]})}},39077:(e,s,t)=>{"use strict";t.d(s,{S:()=>l});var a=t(90508);t(1856);var n=t(60532),r=t(98861),i=t(24377);function l(e){let{className:s,...t}=e;return(0,a.jsx)(r.Root,{"data-slot":"checkbox",className:(0,i.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),...t,children:(0,a.jsx)(r.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:(0,a.jsx)(n.A,{className:"size-3.5"})})})}},39674:(e,s,t)=>{"use strict";t.d(s,{Xi:()=>o,av:()=>c,j7:()=>l,tU:()=>i});var a=t(90508);t(1856);var n=t(79834),r=t(24377);function i(e){let{className:s,...t}=e;return(0,a.jsx)(n.Root,{"data-slot":"tabs",className:(0,r.cn)("flex flex-col gap-2",s),...t})}function l(e){let{className:s,...t}=e;return(0,a.jsx)(n.List,{"data-slot":"tabs-list",className:(0,r.cn)("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",s),...t})}function o(e){let{className:s,...t}=e;return(0,a.jsx)(n.Trigger,{"data-slot":"tabs-trigger",className:(0,r.cn)("data-[state=active]:bg-background data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring inline-flex items-center justify-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),...t})}function c(e){let{className:s,...t}=e;return(0,a.jsx)(n.Content,{"data-slot":"tabs-content",className:(0,r.cn)("flex-1 outline-none",s),...t})}},44775:(e,s,t)=>{"use strict";t.d(s,{o:()=>a});let a={developer_agent:["idea:read","proposal:read","document:read","project:read","task:read","task:write"],pm_agent:["idea:read","idea:write","proposal:read","proposal:write","document:read","document:write","task:read","task:write","project:read","project:write"],admin_agent:["idea:read","idea:write","idea:admin","proposal:read","proposal:write","proposal:admin","document:read","document:write","document:admin","task:read","task:write","task:admin","project:read","project:write","project:admin"]}},50006:(e,s,t)=>{"use strict";t.d(s,{N:()=>r});var a=t(90508),n=t(82813);function r(e){let{code:s,language:t}=e,r="```".concat(t||"","\n").concat(s,"\n```");return(0,a.jsx)(n.MarkdownContent,{children:r})}},75427:(e,s,t)=>{"use strict";t.d(s,{L:()=>b});var a=t(90508),n=t(1856),r=t(39268),i=t(5425),l=t(91385),o=t(14554),c=t(88064),d=t(15972),m=t(39077),u=t(91846),x=t(44775),p=t(93810);let h={admin_agent:"agent.permissions.presetAdmin",pm_agent:"agent.permissions.presetPm",developer_agent:"agent.permissions.presetDev",custom:"agent.permissions.presetCustom"},g={admin_agent:"agent.permissions.help.admin",pm_agent:"agent.permissions.help.pm",developer_agent:"agent.permissions.help.dev",custom:"agent.permissions.help.custom"},j=["admin_agent","pm_agent","developer_agent","custom"];function f(e){let{preset:s,permissions:t,onChange:n,readOnly:i=!1}=e,l=(0,r.c)(),o=null!=s?s:"custom",d=new Set("custom"===o?t:x.o[o]);return(0,a.jsxs)("div",{"data-testid":"agent-permission-picker",className:"space-y-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)(c.J,{className:"text-[13px] font-medium",children:l("agent.permissions.title")}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:l("agent.permissions.description")})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c.J,{htmlFor:"agent-permission-preset",children:l("agent.permissions.presetLabel")}),(0,a.jsxs)(u.l6,{value:o,onValueChange:function(e){if("custom"===e)return void n({preset:"custom",roles:[],permissions:Array.from(d)});e in x.o&&n({preset:e,roles:[e],permissions:[]})},disabled:i,children:[(0,a.jsx)(u.bq,{id:"agent-permission-preset",className:"w-full","aria-label":l("agent.permissions.presetLabel"),children:(0,a.jsx)(u.yv,{placeholder:l(h[o]),children:l(h[o])})}),(0,a.jsx)(u.gC,{children:j.map(e=>(0,a.jsx)(u.eb,{value:e,textValue:l(h[e]),children:(0,a.jsxs)("div",{className:"flex flex-col gap-0.5 py-0.5",children:[(0,a.jsx)("span",{className:"text-sm font-semibold",children:l(h[e])}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:l(g[e])})]})},e))})]})]}),(0,a.jsxs)("div",{role:"grid","aria-label":l("agent.permissions.title"),className:"overflow-hidden rounded-md border",children:[(0,a.jsxs)("div",{role:"row",className:"bg-muted/50 text-muted-foreground grid grid-cols-[1.5fr_repeat(3,1fr)] items-center gap-2 px-4 py-2 text-xs font-medium",children:[(0,a.jsx)("div",{role:"columnheader",children:l("agent.permissions.resourceHeader")}),p.kl.map(e=>(0,a.jsx)("div",{role:"columnheader",className:"text-center",children:l("agent.permissions.actions.".concat(e))},e))]}),p.eZ.map(e=>(0,a.jsxs)("div",{role:"row",className:"border-t grid grid-cols-[1.5fr_repeat(3,1fr)] items-center gap-2 px-4 py-2 text-sm",children:[(0,a.jsx)("div",{role:"rowheader",className:"font-medium",children:l("agent.permissions.resources.".concat(e))}),p.kl.map(s=>{let t="".concat(e,":").concat(s),r="perm-".concat(e,"-").concat(s);return(0,a.jsx)("div",{role:"gridcell",className:"flex items-center justify-center",children:(0,a.jsx)(m.S,{id:r,checked:d.has(t),disabled:i,"aria-label":"".concat(l("agent.permissions.resources.".concat(e))," ").concat(l("agent.permissions.actions.".concat(s))),onCheckedChange:e=>{if(!i){let s=new Set(d);!0===e?s.add(t):s.delete(t),n({preset:"custom",roles:[],permissions:Array.from(s)})}}})},s)})]},e))]})]})]})}function b(e){let{name:s,onNameChange:t,preset:m,permissions:u,onPermissionsChange:p,persona:h,onPersonaChange:g,nameInputId:j="agent-form-name",personaInputId:b="agent-form-persona",readOnly:v=!1}=e,N=(0,r.c)(),k=(0,n.useMemo)(()=>"custom"===m?u:[...x.o[m]],[m,u]);return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[s.trim()?(0,a.jsx)(l.AgentAvatar,{name:s,size:56,className:"rounded-2xl"}):(0,a.jsx)("div",{"aria-hidden":!0,className:"flex size-14 items-center justify-center rounded-2xl bg-muted text-muted-foreground",children:(0,a.jsx)(i.A,{className:"size-7"})}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:N("settings.agentAvatarPreview")})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c.J,{htmlFor:j,className:"text-[13px]",children:N("settings.name")}),(0,a.jsx)(o.p,{id:j,value:s,onChange:e=>t(e.target.value),placeholder:N("settings.namePlaceholder"),className:"border-border",required:!0,disabled:v})]}),(0,a.jsx)(f,{preset:m,permissions:k,onChange:p,readOnly:v}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c.J,{htmlFor:b,className:"text-[13px]",children:N("settings.agentPersona")}),(0,a.jsx)(d.T,{id:b,value:h,onChange:e=>g(e.target.value),placeholder:N("settings.personaPlaceholder"),rows:4,disabled:v}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:N("settings.personaHint")})]})]})}},77297:(e,s,t)=>{"use strict";t.d(s,{I:()=>n});var a=t(52217);let n=(0,a.createServerReference)("4070f7519b54546522dce8a90b61c9311b9cb4960f",a.callServer,void 0,a.findSourceMapURL,"createAgentAndKeyAction")},83792:(e,s,t)=>{"use strict";t.d(s,{Z:()=>d});var a=t(90508),n=t(39268),r=t(48416),i=t(39674),l=t(81750),o=t(17730),c=t(50006);function d(e){let{apiKey:s}=e,t=(0,n.c)("onboarding"),d=window.location.origin,m=s||"<YOUR_API_KEY>",u=(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.profileStep.title")}),(0,a.jsx)(c.N,{language:"bash",code:'export CHORUS_AGENT_PROFILE="<agent-uuid>"'}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.profileStep.desc")})]});return(0,a.jsx)(r.Zp,{className:"w-full",children:(0,a.jsx)(r.Wu,{className:"p-6",children:(0,a.jsxs)(i.tU,{defaultValue:"claude-code",className:"w-full",children:[(0,a.jsxs)(i.j7,{className:"w-full justify-start overflow-x-auto",children:[(0,a.jsx)(i.Xi,{value:"claude-code",className:"shrink-0",children:t("install.tabs.claudeCode")}),(0,a.jsx)(i.Xi,{value:"codex",className:"shrink-0",children:t("install.tabs.codex")}),(0,a.jsx)(i.Xi,{value:"kiro",className:"shrink-0",children:t("install.tabs.kiro")}),(0,a.jsx)(i.Xi,{value:"pi",className:"shrink-0",children:t("install.tabs.pi")}),(0,a.jsx)(i.Xi,{value:"dsh",className:"shrink-0",children:t("install.tabs.dsh")}),(0,a.jsx)(i.Xi,{value:"opencode",className:"shrink-0",children:t("install.tabs.opencode")}),(0,a.jsx)(i.Xi,{value:"openclaw",className:"shrink-0",children:t("install.tabs.openClaw")}),(0,a.jsx)(i.Xi,{value:"other",className:"shrink-0",children:t("install.tabs.other")})]}),(0,a.jsxs)(i.av,{value:"claude-code",className:"mt-4 space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.claudeCode.step1Title")}),(0,a.jsx)(c.N,{language:"bash",code:'export CHORUS_URL="'.concat(d,'"\nexport CHORUS_API_KEY="').concat(m,'"')}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.claudeCode.step1Tip")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.claudeCode.step2Title")}),(0,a.jsx)(c.N,{language:"bash",code:"npm install -g @chorus-aidlc/chorus@0.17.0\nchorus agents add --agents claude"}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.claudeCode.step2Tip")})]})]}),(0,a.jsxs)(i.av,{value:"codex",className:"mt-4 space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.codex.step1Title")}),(0,a.jsx)(c.N,{language:"bash",code:'export CHORUS_URL="'.concat(d,'"\nexport CHORUS_API_KEY="').concat(m,'"')}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.codex.step1Tip")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.codex.step2Title")}),(0,a.jsx)(c.N,{language:"bash",code:"npm install -g @chorus-aidlc/chorus@0.17.0\nchorus agents add --agents codex"}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.codex.step2Tip")})]})]}),(0,a.jsxs)(i.av,{value:"kiro",className:"mt-4 space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.kiro.step1Title")}),(0,a.jsx)(c.N,{language:"bash",code:'export CHORUS_URL="'.concat(d,'"\nexport CHORUS_API_KEY="').concat(m,'"')}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.kiro.step1Tip")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.kiro.step2Title")}),(0,a.jsx)(c.N,{language:"bash",code:"npm install -g @chorus-aidlc/chorus@0.17.0\nchorus agents add --agents kiro"}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.kiro.step2Tip")})]}),u]}),(0,a.jsxs)(i.av,{value:"pi",className:"mt-4 space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.pi.step1Title")}),(0,a.jsx)(c.N,{language:"bash",code:'export CHORUS_URL="'.concat(d,'"\nexport CHORUS_API_KEY="').concat(m,'"')}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.pi.step1Tip")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.pi.step2Title")}),(0,a.jsx)(c.N,{language:"bash",code:"npm install -g @chorus-aidlc/chorus\nchorus agents add --agents pi"}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.pi.step2Tip")})]}),u]}),(0,a.jsxs)(i.av,{value:"dsh",className:"mt-4 space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.dsh.step1Title")}),(0,a.jsx)(c.N,{language:"bash",code:'export CHORUS_URL="'.concat(d,'"\nexport CHORUS_API_KEY="').concat(m,'"')}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.dsh.step1Tip")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.dsh.step2Title")}),(0,a.jsx)(c.N,{language:"bash",code:"dsh plugin --profile <name> add @chorus-aidlc/chorus-dsh -w"}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.dsh.step2Tip",{name:"<name>"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.dsh.step3Title")}),(0,a.jsx)(c.N,{language:"bash",code:"npm install -g @chorus-aidlc/chorus@0.17.0\nchorus agents add --agents dsh --dsh-profile <name>"}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.dsh.step3Tip",{name:"<name>"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.dsh.step4Title")}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:t("install.dsh.step4Desc",{name:"<name>"})})]})]}),(0,a.jsxs)(i.av,{value:"opencode",className:"mt-4 space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.opencode.step1Title")}),(0,a.jsx)(c.N,{language:"bash",code:'export CHORUS_URL="'.concat(d,'"\nexport CHORUS_API_KEY="').concat(m,'"')}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.opencode.step1Tip")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.opencode.step2Title")}),(0,a.jsx)(c.N,{language:"bash",code:"npm install -g @chorus-aidlc/chorus@0.17.0\nchorus agents add --agents opencode"}),(0,a.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:t("install.opencode.step2Tip")})]}),u,(0,a.jsxs)(l.Nt,{children:[(0,a.jsxs)(l.R6,{className:"flex w-full items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",children:[(0,a.jsx)(o.A,{className:"size-4 transition-transform duration-200 [[data-state=open]>&]:rotate-180"}),t("install.opencode.troubleshootingTitle")]}),(0,a.jsx)(l.Ke,{children:(0,a.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,a.jsxs)("div",{className:"rounded-md border border-amber-500/20 bg-amber-500/5 p-3",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-amber-600 dark:text-amber-400",children:t("install.opencode.issueCache.title")}),(0,a.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:t("install.opencode.issueCache.fix")})]}),(0,a.jsxs)("div",{className:"rounded-md border border-amber-500/20 bg-amber-500/5 p-3",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-amber-600 dark:text-amber-400",children:t("install.opencode.issueEnv.title")}),(0,a.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:t("install.opencode.issueEnv.fix")})]}),(0,a.jsxs)("div",{className:"rounded-md border border-amber-500/20 bg-amber-500/5 p-3",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-amber-600 dark:text-amber-400",children:t("install.opencode.issueCheckin.title")}),(0,a.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:t("install.opencode.issueCheckin.fix")})]})]})})]})]}),(0,a.jsxs)(i.av,{value:"openclaw",className:"mt-4 space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.openClaw.step1Title")}),(0,a.jsx)(c.N,{language:"bash",code:"openclaw plugins install @chorus-aidlc/chorus-openclaw-plugin"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.openClaw.step2Title")}),(0,a.jsx)(c.N,{language:"json",code:'{\n "hooks": { "enabled": true, "token": "<your-token>" },\n "plugins": {\n "enabled": true,\n "entries": {\n "chorus-openclaw-plugin": {\n "enabled": true,\n "config": {\n "chorusUrl": "'.concat(d,'",\n "apiKey": "').concat(m,'",\n "autoStart": true\n }\n }\n }\n }\n}')})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-medium text-foreground",children:t("install.openClaw.step3Title")}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:t("install.openClaw.step3Desc")})]}),(0,a.jsxs)(l.Nt,{children:[(0,a.jsxs)(l.R6,{className:"flex w-full items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",children:[(0,a.jsx)(o.A,{className:"size-4 transition-transform duration-200 [[data-state=open]>&]:rotate-180"}),t("install.openClaw.troubleshootingTitle")]}),(0,a.jsx)(l.Ke,{children:(0,a.jsxs)("div",{className:"mt-2 rounded-md border border-amber-500/20 bg-amber-500/5 p-3",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-amber-600 dark:text-amber-400",children:t("install.openClaw.troubleshootingError")}),(0,a.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:t("install.openClaw.troubleshootingFix")})]})})]})]}),(0,a.jsxs)(i.av,{value:"other",className:"mt-4 space-y-4",children:[(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:t("install.other.description")}),(0,a.jsx)(c.N,{code:"Please install and configure the Chorus AI-DLC collaboration platform.\n\nChorus URL: ".concat(d,"\nAPI Key: ").concat(m,"\n\nRead the setup instructions from:\n").concat(d,'/skill/chorus/SKILL.md\n\nFollow the "Setup" section to configure the MCP server,\nthen call chorus_checkin() to verify the connection.')})]})]})})})}},88064:(e,s,t)=>{"use strict";t.d(s,{J:()=>i});var a=t(90508);t(1856);var n=t(58057),r=t(24377);function i(e){let{className:s,...t}=e;return(0,a.jsx)(n.Root,{"data-slot":"label",className:(0,r.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),...t})}},93810:(e,s,t)=>{"use strict";t.d(s,{eZ:()=>a,kl:()=>n,lp:()=>r});let a=["idea","proposal","document","task","project"],n=["read","write","admin"],r=a.flatMap(e=>n.map(s=>"".concat(e,":").concat(s)))}}]);