@chorus-aidlc/chorus 0.16.3 → 0.17.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 (355) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-build-manifest.json +445 -445
  3. package/.next/standalone/.next/app-path-routes-manifest.json +54 -54
  4. package/.next/standalone/.next/build-manifest.json +5 -5
  5. package/.next/standalone/.next/prerender-manifest.json +42 -42
  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 +1 -1
  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 +1 -1
  45. package/.next/standalone/.next/server/app/admin/companies/[uuid]/page_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/admin/companies/new/page_client-reference-manifest.js +1 -1
  47. package/.next/standalone/.next/server/app/admin/companies/new.html +2 -2
  48. package/.next/standalone/.next/server/app/admin/companies/new.rsc +1 -1
  49. package/.next/standalone/.next/server/app/admin/companies/page_client-reference-manifest.js +1 -1
  50. package/.next/standalone/.next/server/app/admin/companies.html +2 -2
  51. package/.next/standalone/.next/server/app/admin/companies.rsc +1 -1
  52. package/.next/standalone/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  53. package/.next/standalone/.next/server/app/admin.html +2 -2
  54. package/.next/standalone/.next/server/app/admin.rsc +1 -1
  55. package/.next/standalone/.next/server/app/api/admin/companies/[uuid]/route_client-reference-manifest.js +1 -1
  56. package/.next/standalone/.next/server/app/api/admin/companies/route_client-reference-manifest.js +1 -1
  57. package/.next/standalone/.next/server/app/api/admin/login/route_client-reference-manifest.js +1 -1
  58. package/.next/standalone/.next/server/app/api/admin/session/route_client-reference-manifest.js +1 -1
  59. package/.next/standalone/.next/server/app/api/agent-connections/route_client-reference-manifest.js +1 -1
  60. package/.next/standalone/.next/server/app/api/agents/[uuid]/route_client-reference-manifest.js +1 -1
  61. package/.next/standalone/.next/server/app/api/agents/[uuid]/sessions/route_client-reference-manifest.js +1 -1
  62. package/.next/standalone/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
  63. package/.next/standalone/.next/server/app/api/api-keys/[uuid]/route_client-reference-manifest.js +1 -1
  64. package/.next/standalone/.next/server/app/api/api-keys/route_client-reference-manifest.js +1 -1
  65. package/.next/standalone/.next/server/app/api/auth/callback/route_client-reference-manifest.js +1 -1
  66. package/.next/standalone/.next/server/app/api/auth/check-default/route_client-reference-manifest.js +1 -1
  67. package/.next/standalone/.next/server/app/api/auth/company-oidc/route_client-reference-manifest.js +1 -1
  68. package/.next/standalone/.next/server/app/api/auth/default-login/route_client-reference-manifest.js +1 -1
  69. package/.next/standalone/.next/server/app/api/auth/identify/route_client-reference-manifest.js +1 -1
  70. package/.next/standalone/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  71. package/.next/standalone/.next/server/app/api/auth/me/route_client-reference-manifest.js +1 -1
  72. package/.next/standalone/.next/server/app/api/auth/sync-token/route_client-reference-manifest.js +1 -1
  73. package/.next/standalone/.next/server/app/api/comments/route_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app/api/daemon/connection-heartbeat/route_client-reference-manifest.js +1 -1
  75. package/.next/standalone/.next/server/app/api/daemon/control/route_client-reference-manifest.js +1 -1
  76. package/.next/standalone/.next/server/app/api/daemon/directory-request/report/route_client-reference-manifest.js +1 -1
  77. package/.next/standalone/.next/server/app/api/daemon/execution-state/route_client-reference-manifest.js +1 -1
  78. package/.next/standalone/.next/server/app/api/daemon/executions/route_client-reference-manifest.js +1 -1
  79. package/.next/standalone/.next/server/app/api/daemon/pending-turns/route_client-reference-manifest.js +1 -1
  80. package/.next/standalone/.next/server/app/api/daemon/report-interrupt/route_client-reference-manifest.js +1 -1
  81. package/.next/standalone/.next/server/app/api/daemon/resume/route_client-reference-manifest.js +1 -1
  82. package/.next/standalone/.next/server/app/api/daemon/transcript/route_client-reference-manifest.js +1 -1
  83. package/.next/standalone/.next/server/app/api/daemon/turn-advance/route.js +1 -1
  84. package/.next/standalone/.next/server/app/api/daemon/turn-advance/route_client-reference-manifest.js +1 -1
  85. package/.next/standalone/.next/server/app/api/daemon-directory-requests/[uuid]/route_client-reference-manifest.js +1 -1
  86. package/.next/standalone/.next/server/app/api/daemon-directory-requests/route_client-reference-manifest.js +1 -1
  87. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/instruction/route_client-reference-manifest.js +1 -1
  88. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/repoint/route_client-reference-manifest.js +1 -1
  89. package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/route_client-reference-manifest.js +1 -1
  90. package/.next/standalone/.next/server/app/api/daemon-sessions/ad-hoc/route_client-reference-manifest.js +1 -1
  91. package/.next/standalone/.next/server/app/api/daemon-sessions/route_client-reference-manifest.js +1 -1
  92. package/.next/standalone/.next/server/app/api/documents/[uuid]/route_client-reference-manifest.js +1 -1
  93. package/.next/standalone/.next/server/app/api/entities/[type]/[uuid]/root-idea/route_client-reference-manifest.js +1 -1
  94. package/.next/standalone/.next/server/app/api/events/notifications/route_client-reference-manifest.js +1 -1
  95. package/.next/standalone/.next/server/app/api/events/route_client-reference-manifest.js +1 -1
  96. package/.next/standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  97. package/.next/standalone/.next/server/app/api/ideas/[uuid]/claim/route_client-reference-manifest.js +1 -1
  98. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/preview/route_client-reference-manifest.js +1 -1
  99. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/route_client-reference-manifest.js +1 -1
  100. package/.next/standalone/.next/server/app/api/ideas/[uuid]/parent/route_client-reference-manifest.js +1 -1
  101. package/.next/standalone/.next/server/app/api/ideas/[uuid]/release/route_client-reference-manifest.js +1 -1
  102. package/.next/standalone/.next/server/app/api/ideas/[uuid]/route_client-reference-manifest.js +1 -1
  103. package/.next/standalone/.next/server/app/api/ideas/[uuid]/wake-preview/route_client-reference-manifest.js +1 -1
  104. package/.next/standalone/.next/server/app/api/ideas/conversational/route_client-reference-manifest.js +1 -1
  105. package/.next/standalone/.next/server/app/api/mcp/route.js +3 -3
  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.js +1 -1
  108. package/.next/standalone/.next/server/app/api/me/assignments/route_client-reference-manifest.js +1 -1
  109. package/.next/standalone/.next/server/app/api/mentionables/route_client-reference-manifest.js +1 -1
  110. package/.next/standalone/.next/server/app/api/notifications/[uuid]/archive/route_client-reference-manifest.js +1 -1
  111. package/.next/standalone/.next/server/app/api/notifications/[uuid]/read/route_client-reference-manifest.js +1 -1
  112. package/.next/standalone/.next/server/app/api/notifications/preferences/route_client-reference-manifest.js +1 -1
  113. package/.next/standalone/.next/server/app/api/notifications/read-all/route_client-reference-manifest.js +1 -1
  114. package/.next/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  115. package/.next/standalone/.next/server/app/api/notifications/unread-count/route_client-reference-manifest.js +1 -1
  116. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/dashboard/route_client-reference-manifest.js +1 -1
  117. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/route_client-reference-manifest.js +1 -1
  118. package/.next/standalone/.next/server/app/api/project-groups/route_client-reference-manifest.js +1 -1
  119. package/.next/standalone/.next/server/app/api/project-visits/pin/route_client-reference-manifest.js +1 -1
  120. package/.next/standalone/.next/server/app/api/project-visits/route_client-reference-manifest.js +1 -1
  121. package/.next/standalone/.next/server/app/api/project-visits/visit/route_client-reference-manifest.js +1 -1
  122. package/.next/standalone/.next/server/app/api/projects/[uuid]/activity/route_client-reference-manifest.js +1 -1
  123. package/.next/standalone/.next/server/app/api/projects/[uuid]/agent-cwds/route_client-reference-manifest.js +1 -1
  124. package/.next/standalone/.next/server/app/api/projects/[uuid]/available/route.js +1 -1
  125. package/.next/standalone/.next/server/app/api/projects/[uuid]/available/route_client-reference-manifest.js +1 -1
  126. package/.next/standalone/.next/server/app/api/projects/[uuid]/documents/route_client-reference-manifest.js +1 -1
  127. package/.next/standalone/.next/server/app/api/projects/[uuid]/group/route_client-reference-manifest.js +1 -1
  128. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/route_client-reference-manifest.js +1 -1
  129. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/tracker/route_client-reference-manifest.js +1 -1
  130. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/[proposalUuid]/validate/route_client-reference-manifest.js +1 -1
  131. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/route_client-reference-manifest.js +1 -1
  132. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/summary/route_client-reference-manifest.js +1 -1
  133. package/.next/standalone/.next/server/app/api/projects/[uuid]/resource-graph/route_client-reference-manifest.js +1 -1
  134. package/.next/standalone/.next/server/app/api/projects/[uuid]/route_client-reference-manifest.js +1 -1
  135. package/.next/standalone/.next/server/app/api/projects/[uuid]/stats/route_client-reference-manifest.js +1 -1
  136. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/dependencies/route_client-reference-manifest.js +1 -1
  137. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/route_client-reference-manifest.js +1 -1
  138. package/.next/standalone/.next/server/app/api/projects/agent-cwd-options/route_client-reference-manifest.js +1 -1
  139. package/.next/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  140. package/.next/standalone/.next/server/app/api/proposals/[uuid]/approve/route_client-reference-manifest.js +1 -1
  141. package/.next/standalone/.next/server/app/api/proposals/[uuid]/close/route_client-reference-manifest.js +1 -1
  142. package/.next/standalone/.next/server/app/api/proposals/[uuid]/reject/route_client-reference-manifest.js +1 -1
  143. package/.next/standalone/.next/server/app/api/proposals/[uuid]/revoke/route_client-reference-manifest.js +1 -1
  144. package/.next/standalone/.next/server/app/api/proposals/[uuid]/route_client-reference-manifest.js +1 -1
  145. package/.next/standalone/.next/server/app/api/references/[uuid]/route_client-reference-manifest.js +1 -1
  146. package/.next/standalone/.next/server/app/api/references/route_client-reference-manifest.js +1 -1
  147. package/.next/standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  148. package/.next/standalone/.next/server/app/api/session/route_client-reference-manifest.js +1 -1
  149. package/.next/standalone/.next/server/app/api/sessions/[uuid]/route_client-reference-manifest.js +1 -1
  150. package/.next/standalone/.next/server/app/api/tasks/[uuid]/claim/route_client-reference-manifest.js +1 -1
  151. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/[dependsOnUuid]/route_client-reference-manifest.js +1 -1
  152. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/route_client-reference-manifest.js +1 -1
  153. package/.next/standalone/.next/server/app/api/tasks/[uuid]/release/route_client-reference-manifest.js +1 -1
  154. package/.next/standalone/.next/server/app/api/tasks/[uuid]/route_client-reference-manifest.js +1 -1
  155. package/.next/standalone/.next/server/app/api/tasks/[uuid]/sessions/route_client-reference-manifest.js +1 -1
  156. package/.next/standalone/.next/server/app/index.html +2 -2
  157. package/.next/standalone/.next/server/app/index.rsc +1 -1
  158. package/.next/standalone/.next/server/app/login/admin/page_client-reference-manifest.js +1 -1
  159. package/.next/standalone/.next/server/app/login/admin.html +2 -2
  160. package/.next/standalone/.next/server/app/login/admin.rsc +1 -1
  161. package/.next/standalone/.next/server/app/login/callback/page_client-reference-manifest.js +1 -1
  162. package/.next/standalone/.next/server/app/login/callback.html +2 -2
  163. package/.next/standalone/.next/server/app/login/callback.rsc +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 +1 -1
  168. package/.next/standalone/.next/server/app/login.html +2 -2
  169. package/.next/standalone/.next/server/app/login.rsc +1 -1
  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 +2 -2
  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 +2 -2
  178. package/.next/standalone/.next/server/app/settings.html +2 -2
  179. package/.next/standalone/.next/server/app/settings.rsc +3 -3
  180. package/.next/standalone/.next/server/app-paths-manifest.json +54 -54
  181. package/.next/standalone/.next/server/chunks/1114.js +1 -1
  182. package/.next/standalone/.next/server/chunks/1318.js +1 -1
  183. package/.next/standalone/.next/server/chunks/1437.js +1 -0
  184. package/.next/standalone/.next/server/chunks/1559.js +2 -2
  185. package/.next/standalone/.next/server/chunks/2572.js +1 -1
  186. package/.next/standalone/.next/server/chunks/2618.js +1 -1
  187. package/.next/standalone/.next/server/chunks/2961.js +1 -1
  188. package/.next/standalone/.next/server/chunks/{9793.js → 3045.js} +1 -1
  189. package/.next/standalone/.next/server/chunks/3831.js +37 -0
  190. package/.next/standalone/.next/server/chunks/4827.js +1 -1
  191. package/.next/standalone/.next/server/chunks/5245.js +1 -1
  192. package/.next/standalone/.next/server/chunks/{4394.js → 5706.js} +1 -1
  193. package/.next/standalone/.next/server/chunks/6113.js +1 -1
  194. package/.next/standalone/.next/server/chunks/6207.js +1 -1
  195. package/.next/standalone/.next/server/chunks/6506.js +2 -2
  196. package/.next/standalone/.next/server/chunks/6515.js +2 -2
  197. package/.next/standalone/.next/server/chunks/679.js +1 -1
  198. package/.next/standalone/.next/server/chunks/7368.js +1 -1
  199. package/.next/standalone/.next/server/chunks/7530.js +1 -1
  200. package/.next/standalone/.next/server/chunks/8454.js +1 -1
  201. package/.next/standalone/.next/server/chunks/920.js +1 -1
  202. package/.next/standalone/.next/server/chunks/9213.js +1 -1
  203. package/.next/standalone/.next/server/chunks/9378.js +1 -1
  204. package/.next/standalone/.next/server/chunks/9449.js +1 -0
  205. package/.next/standalone/.next/server/chunks/9458.js +1 -0
  206. package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
  207. package/.next/standalone/.next/server/middleware-manifest.json +5 -5
  208. package/.next/standalone/.next/server/pages/404.html +2 -2
  209. package/.next/standalone/.next/server/pages/500.html +1 -1
  210. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  211. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  212. package/.next/standalone/.next/static/chunks/{11595.97e534422c57aee1.js → 11595.bbe40924d18958bf.js} +1 -1
  213. package/.next/standalone/.next/static/chunks/18139-e6ef4b5869593f8e.js +1 -0
  214. package/.next/standalone/.next/static/chunks/28856-ef2cb58fbd404ef9.js +1 -0
  215. package/.next/standalone/.next/static/chunks/{31308-fda6febfb2882a28.js → 31308-bb4a97b3f39c22dd.js} +1 -1
  216. package/.next/standalone/.next/static/chunks/{33456.6dc44a6aca1a01fd.js → 33456.5499eb8e892b110a.js} +1 -1
  217. package/.next/standalone/.next/static/chunks/{4860.7873ebc9ba435c8c.js → 4860.be77046fb2b3a2bd.js} +1 -1
  218. package/.next/standalone/.next/static/chunks/66873-e3be53f41b3f2255.js +1 -0
  219. package/.next/standalone/.next/static/chunks/70303-aec3d52ad87602a3.js +1 -0
  220. package/.next/standalone/.next/static/chunks/76201-83b26515f85ce37c.js +1 -0
  221. package/.next/standalone/.next/static/chunks/78917-a8a8dff98857c045.js +1 -0
  222. package/.next/standalone/.next/static/chunks/{94643-01be319472d751b3.js → 94643-ffa140f765c73daf.js} +1 -1
  223. package/.next/standalone/.next/static/chunks/97663-9c3ae4fd60b353db.js +1 -0
  224. package/.next/standalone/.next/static/chunks/{99373.d0e808c18408b8da.js → 99373.111493dc260a2a04.js} +1 -1
  225. package/.next/standalone/.next/static/chunks/app/(dashboard)/{layout-b742c51c0a764daf.js → layout-40fe7d026c5a7c6d.js} +1 -1
  226. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/dashboard/page-87d4d0fe90fca28c.js +1 -0
  227. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page-1206abaee85dc915.js +1 -0
  228. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/{page-425acbe9ade5fa83.js → page-474e494097c8945f.js} +1 -1
  229. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/graph/page-e902b19328092ccf.js +1 -0
  230. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page-f273288c3530aa0f.js +1 -0
  231. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/new/page-6568a7b08bf9a54b.js +1 -0
  232. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/page-fbd3c27b68666234.js +1 -0
  233. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/{page-58b48aa0a11603c3.js → page-15bb6e1696668512.js} +1 -1
  234. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/{page-286faced32c6133f.js → page-2bea97214b1595cc.js} +1 -1
  235. package/.next/standalone/.next/static/chunks/app/(dashboard)/settings/page-2bf7ceee62b574c7.js +1 -0
  236. package/.next/standalone/.next/static/chunks/app/onboarding/{page-5c82cf3abd856301.js → page-540da64d7ba16dc7.js} +1 -1
  237. package/.next/standalone/.next/static/chunks/{webpack-fa066d7ff9ab2b29.js → webpack-7cbb3ba6792f1fb3.js} +1 -1
  238. package/.next/standalone/package.json +1 -1
  239. package/.next/standalone/public/chorus-plugin/.claude-plugin/plugin.json +1 -1
  240. package/.next/standalone/public/chorus-plugin/bin/chorus-api.sh +44 -1
  241. package/.next/standalone/public/chorus-plugin/bin/on-session-start.sh +4 -3
  242. package/.next/standalone/public/chorus-plugin/bin/tests/test-mcp-cli-delegation.sh +244 -0
  243. package/.next/standalone/public/chorus-plugin/skills/brainstorm/SKILL.md +1 -1
  244. package/.next/standalone/public/chorus-plugin/skills/chorus/SKILL.md +19 -1
  245. package/.next/standalone/public/chorus-plugin/skills/chorus-cli/SKILL.md +57 -0
  246. package/.next/standalone/public/chorus-plugin/skills/develop/SKILL.md +2 -2
  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 +85 -42
  250. package/.next/standalone/public/chorus-plugin/skills/orchestrate/SKILL.md +1 -1
  251. package/.next/standalone/public/chorus-plugin/skills/proposal/SKILL.md +2 -2
  252. package/.next/standalone/public/chorus-plugin/skills/quick-dev/SKILL.md +1 -1
  253. package/.next/standalone/public/chorus-plugin/skills/review/SKILL.md +1 -1
  254. package/.next/standalone/public/chorus-plugin/skills/yolo/SKILL.md +3 -3
  255. package/.next/standalone/public/dsh-credentials.sh +30 -0
  256. package/.next/standalone/public/install-codex.sh +21 -406
  257. package/.next/standalone/public/install-kiro.sh +20 -344
  258. package/.next/standalone/public/install-opencode.sh +20 -275
  259. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-brainstorm/SKILL.md +1 -1
  260. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-cli/SKILL.md +57 -0
  261. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-develop/SKILL.md +2 -2
  262. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-docs/SKILL.md +1 -1
  263. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-idea/SKILL.md +1 -1
  264. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-openspec-aware/SKILL.md +85 -42
  265. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-orchestrate/SKILL.md +1 -1
  266. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-proposal/SKILL.md +2 -2
  267. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-quick-dev/SKILL.md +1 -1
  268. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-review/SKILL.md +1 -1
  269. package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-yolo/SKILL.md +3 -3
  270. package/.next/standalone/public/kiro-plugin/bin/chorus-api.sh +44 -1
  271. package/.next/standalone/public/kiro-plugin/bin/on-agent-spawn.sh +6 -4
  272. package/.next/standalone/public/kiro-plugin/manifest.txt +41 -0
  273. package/.next/standalone/public/skill/brainstorm-chorus/SKILL.md +1 -1
  274. package/.next/standalone/public/skill/chorus/SKILL.md +19 -1
  275. package/.next/standalone/public/skill/code-reviewer-chorus/SKILL.md +1 -1
  276. package/.next/standalone/public/skill/develop-chorus/SKILL.md +1 -1
  277. package/.next/standalone/public/skill/docs-chorus/SKILL.md +1 -1
  278. package/.next/standalone/public/skill/idea-chorus/SKILL.md +1 -1
  279. package/.next/standalone/public/skill/orchestrate-chorus/SKILL.md +1 -1
  280. package/.next/standalone/public/skill/proposal-chorus/SKILL.md +1 -1
  281. package/.next/standalone/public/skill/proposal-reviewer-chorus/SKILL.md +1 -1
  282. package/.next/standalone/public/skill/quick-dev-chorus/SKILL.md +1 -1
  283. package/.next/standalone/public/skill/review-chorus/SKILL.md +1 -1
  284. package/.next/standalone/public/skill/task-reviewer-chorus/SKILL.md +1 -1
  285. package/.next/standalone/public/skill/yolo-chorus/SKILL.md +1 -1
  286. package/.next/standalone/public/test-dsh-credentials.sh +39 -0
  287. package/.next/standalone/public/test-install-codex.sh +31 -79
  288. package/README.ja.md +5 -3
  289. package/README.ko.md +5 -3
  290. package/README.md +5 -3
  291. package/README.zh.md +5 -3
  292. package/chorus.mjs +35 -1
  293. package/cli/agent-backend-prompt.mjs +94 -0
  294. package/cli/agents.mjs +329 -0
  295. package/cli/chorus-client.mjs +69 -0
  296. package/cli/claude-spawner.mjs +4 -0
  297. package/cli/client-args.mjs +11 -5
  298. package/cli/codex-spawner.mjs +11 -6
  299. package/cli/credentials.mjs +185 -3
  300. package/cli/daemon-agent.mjs +30 -5
  301. package/cli/daemon-banner.mjs +3 -3
  302. package/cli/daemon-config.mjs +27 -2
  303. package/cli/daemon-install-config.mjs +21 -14
  304. package/cli/daemon-rest-client.mjs +31 -8
  305. package/cli/daemon-service.mjs +120 -33
  306. package/cli/daemon.mjs +175 -28
  307. package/cli/dsh-managed-config.mjs +407 -0
  308. package/cli/dsh-spawner.mjs +445 -0
  309. package/cli/init/adapters.mjs +137 -0
  310. package/cli/init/agent-type-map.mjs +60 -0
  311. package/cli/init/chorus-plugin-consts.mjs +16 -0
  312. package/cli/init/codex-mcp-config.mjs +183 -0
  313. package/cli/init/contracts.mjs +120 -0
  314. package/cli/init/detect.mjs +97 -0
  315. package/cli/init/file-template.mjs +248 -0
  316. package/cli/init/install-methods.mjs +508 -0
  317. package/cli/init/registry.mjs +74 -0
  318. package/cli/init/run-command.mjs +30 -0
  319. package/cli/init/select.mjs +111 -0
  320. package/cli/init/steps/credential-seed.mjs +751 -0
  321. package/cli/init/steps/daemon-setup.mjs +246 -0
  322. package/cli/init/steps/plugin-install.mjs +37 -0
  323. package/cli/init-args.mjs +137 -0
  324. package/cli/init.mjs +198 -0
  325. package/cli/kiro-spawner.mjs +4 -0
  326. package/cli/login.mjs +26 -4
  327. package/cli/mcp-args.mjs +280 -0
  328. package/cli/mcp.mjs +164 -0
  329. package/cli/spawner-select.mjs +54 -2
  330. package/cli/turn-reporter.mjs +5 -2
  331. package/cli/upload-hooks.mjs +31 -1
  332. package/cli/waker.mjs +49 -6
  333. package/package.json +1 -1
  334. package/prisma/migrations/20260818024700_add_turn_backend_session_id/migration.sql +1 -0
  335. package/prisma/schema.prisma +3 -0
  336. package/.next/standalone/.next/server/chunks/3594.js +0 -1
  337. package/.next/standalone/.next/server/chunks/5351.js +0 -32
  338. package/.next/standalone/.next/server/chunks/6667.js +0 -1
  339. package/.next/standalone/.next/server/chunks/6995.js +0 -1
  340. package/.next/standalone/.next/static/chunks/19887-c0bb297a78a1c7cd.js +0 -1
  341. package/.next/standalone/.next/static/chunks/29108-5a11eea003f4cc11.js +0 -1
  342. package/.next/standalone/.next/static/chunks/53073-a7ed20af6538a178.js +0 -1
  343. package/.next/standalone/.next/static/chunks/6603-e70ddeab6ad09c50.js +0 -1
  344. package/.next/standalone/.next/static/chunks/78917-1b59cbb806b3ecfc.js +0 -1
  345. package/.next/standalone/.next/static/chunks/82751-3e161e1d8dbda3ac.js +0 -1
  346. package/.next/standalone/.next/static/chunks/99366-425e9ef22e60e3e2.js +0 -1
  347. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/dashboard/page-f636e00c28f425ea.js +0 -1
  348. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page-c004f1a194af7fa5.js +0 -1
  349. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/graph/page-fdd617457730a116.js +0 -1
  350. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page-6b3fb08d53826d02.js +0 -1
  351. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/new/page-d5b222f379b2e8ca.js +0 -1
  352. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/page-0a6c2d0e1b68e0e4.js +0 -1
  353. package/.next/standalone/.next/static/chunks/app/(dashboard)/settings/page-1507a761e67c2aa9.js +0 -1
  354. /package/.next/standalone/.next/static/{K8qIdwvKoIWbwQ_f01mnM → 0spgxl3lP26Fl1otd1D7R}/_buildManifest.js +0 -0
  355. /package/.next/standalone/.next/static/{K8qIdwvKoIWbwQ_f01mnM → 0spgxl3lP26Fl1otd1D7R}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";exports.id=1318,exports.ids=[1318],exports.modules={8495:(a,b,c)=>{c.d(b,{S:()=>h});var d=c(10837);c(21968);var e=c(9810),f=c(25711),g=c(96307);function h({className:a,...b}){return(0,d.jsx)(f.Root,{"data-slot":"checkbox",className:(0,g.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",a),...b,children:(0,d.jsx)(f.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:(0,d.jsx)(e.A,{className:"size-3.5"})})})}},9190:(a,b,c)=>{c.d(b,{n:()=>v});var d=c(10837),e=c(21968),f=c(9222),g=c(51592),h=c(49102),i=c(21790),j=c(20447),k=c(9810),l=c(97443),m=c(81512),n=c.n(m),o=c(76172),p=c(97252),q=c(22727),r=c(6871),s=c(7086),t=c(77521);let u=["in_progress","to_verify","open","assigned","done","closed"];function v({tasks:a,projectUuid:b,proposalUuids:c,onSelectTask:m}){let v=(0,f.c)("ideaTracker"),[w,x]=(0,e.useState)({}),y=(0,e.useMemo)(()=>a.map(a=>a.uuid),[a]),z=(0,e.useCallback)(async()=>{if(0===y.length)return;let a=await (0,p.h)(y);a.success&&a.data&&x(a.data)},[y]);(0,o.eV)("task",z);let A=(0,e.useMemo)(()=>{let b=[];for(let c of u){let d=a.filter(a=>a.status===c);d.length>0&&b.push({status:c,tasks:d})}let c=new Set(u),d=a.filter(a=>!c.has(a.status));return d.length>0&&b.push({status:"other",tasks:d}),b},[a]),[B,C]=(0,e.useState)(new Set),D=(0,e.useMemo)(()=>{let b=a.length,c=a.filter(a=>"done"===a.status||"closed"===a.status).length,d=0,e=0,f=0,g=0;for(let b of a)b.acceptanceSummary&&(d+=b.acceptanceSummary.total,e+=b.acceptanceSummary.passed,f+=b.acceptanceSummary.required,g+=b.acceptanceSummary.requiredPassed);return{total:b,done:c,acTotal:d,acPassed:e,acRequired:f,acRequiredPassed:g}},[a]);return 0===a.length?(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[(0,d.jsx)(g.A,{className:"h-8 w-8 text-muted-foreground"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:v("panel.taskList.noTasks")})]}):(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 rounded-lg bg-[#FAFAF7] dark:bg-[#1e1e1c] px-3 py-2",children:[(0,d.jsx)("span",{className:"text-[12px] text-muted-foreground",children:v("panel.taskList.summary",{done:D.done,total:D.total})}),D.acTotal>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"text-[12px] text-muted-foreground",children:"\xb7"}),(0,d.jsx)("span",{className:"text-[12px] text-muted-foreground",children:v("panel.taskList.acSummary",{passed:D.acRequiredPassed,total:D.acRequired})})]}),c.length>0&&(0,d.jsxs)(n(),{href:`/projects/${b}/tasks?proposalUuids=${c.join(",")}`,className:"ml-auto flex items-center gap-1 text-[13px] font-medium text-primary shrink-0",children:[v("panel.taskList.viewKanban"),(0,d.jsx)(h.A,{className:"h-3.5 w-3.5"})]})]}),A.map(a=>{let b=B.has(a.status);return(0,d.jsxs)("div",{children:[(0,d.jsxs)("button",{onClick:()=>{var b;return b=a.status,void C(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"flex items-center gap-2 w-full text-left py-1.5 group cursor-pointer",children:[b?(0,d.jsx)(h.A,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,d.jsx)(i.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,d.jsx)("span",{className:`h-2 w-2 rounded-full shrink-0 ${(0,t.eT)(a.status)}`}),(0,d.jsx)("span",{className:"text-[13px] font-medium text-foreground",children:function(a,b){switch(a){case"in_progress":return b("panel.taskList.inProgress");case"to_verify":return b("panel.taskList.toVerify");case"open":return b("panel.taskList.open");case"assigned":return b("panel.taskList.assigned");case"done":return b("panel.taskList.done");case"closed":return b("panel.taskList.closed");default:return a}}(a.status,v)}),(0,d.jsx)("span",{className:"text-[11px] text-muted-foreground ml-auto",children:a.tasks.length})]}),!b&&(0,d.jsx)("div",{className:"ml-3 space-y-0.5",children:a.tasks.map(a=>{let b=w[a.uuid]||0,c=a.acceptanceSummary;return(0,d.jsx)(q.D,{entityType:"task",entityUuid:a.uuid,badgeInside:!0,children:(0,d.jsxs)("button",{onClick:()=>m(a.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,d.jsx)(j.A,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0 group-hover:text-primary"}),(0,d.jsx)("span",{className:`h-1.5 w-1.5 rounded-full shrink-0 ${(0,t.eT)(a.status)}`}),(0,d.jsx)("span",{className:"flex-1 text-[13px] text-foreground truncate group-hover:text-primary",children:a.title}),c&&c.total>0&&(0,d.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,d.jsx)(k.A,{className:"h-2.5 w-2.5"}),c.requiredPassed,"/",c.required]}),a.assignee&&(0,d.jsxs)("span",{className:"shrink-0 inline-flex items-center gap-1 text-[10px] text-muted-foreground max-w-[72px] truncate",title:a.assignee.name,children:[(0,s.bB)(a.assignee)?(0,d.jsx)(r.AgentAvatar,{name:a.assignee.name,size:14,className:"shrink-0 rounded-full"}):(0,d.jsx)(l.A,{className:"h-2.5 w-2.5 shrink-0"}),a.assignee.name.split(/[@\s]/)[0]]}),b>0&&(0,d.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:v("panel.taskList.workersActive",{count:b}),children:b})]})},a.uuid)})})]},a.status)})]})}},9864:(a,b,c)=>{c.d(b,{d:()=>t});var d=c(10837),e=c(21968),f=c(9222),g=c(68884),h=c(76549),i=c(86460);let j=(0,c(56556).A)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var k=c(21692),l=c(42424),m=c(11568),n=c(10297),o=c(96307),p=c(42377);let q=(0,p.createServerReference)("40961fd2c514e009922e207a11cabfc30983a4ba2e",p.callServer,void 0,p.findSourceMapURL,"getProjectIdeasForPickerAction"),r=(0,p.createServerReference)("60c60e6d3d8ab3e1c7a1feeb6a5f95223a80a10bf9",p.callServer,void 0,p.findSourceMapURL,"setIdeaParentAction");var s=c(54722);function t({open:a,onOpenChange:b,ideaUuid:c,ideaTitle:p,projectUuid:t,currentParentUuid:u,descendantUuids:v,onChanged:w}){let x=(0,f.c)("ideaTracker.lineage"),y=(0,f.c)("common"),z=(0,g.r)(),[A,B]=(0,e.useState)([]),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(null),K=new Set([c,...v]);(0,e.useCallback)(async()=>{F(!0),J(null);try{let a=await q(t);a.success?(B(a.data),D(a.hasMore)):J(a.error)}catch(a){s.q.error("Failed to load parent candidates:",a),J(x("saveFailed"))}F(!1)},[t,x]);let L=async a=>{if(!G){H(!0),J(null);try{let d=await r(c,a);d.success?(h.oR.success(a?x("save"):x("detach")),b(!1),z.refresh(),w()):J(d.error||x("saveFailed"))}catch(a){J(a instanceof Error?a.message:x("saveFailed"))}H(!1)}};return(0,d.jsx)(m.lG,{open:a,onOpenChange:b,children:(0,d.jsxs)(m.Cf,{children:[(0,d.jsxs)(m.c7,{children:[(0,d.jsx)(m.L3,{children:x("setParentTitle")}),(0,d.jsx)(m.rr,{children:x("setParentDescription",{title:p})})]}),(0,d.jsxs)("div",{className:"min-w-0 space-y-3 pt-1",children:[E?(0,d.jsx)("div",{className:"flex h-40 items-center justify-center",children:(0,d.jsx)(i.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):(0,d.jsx)("div",{className:"rounded-md border border-border",children:(0,d.jsxs)(n.uB,{children:[(0,d.jsx)(n.G7,{placeholder:x("searchPlaceholder")}),(0,d.jsxs)(n.oI,{children:[(0,d.jsx)(n.xL,{children:x("noCandidates")}),(0,d.jsx)(n.L$,{children:A.map(a=>{let b=K.has(a.uuid),c=a.uuid===u;return(0,d.jsxs)(n.h_,{value:a.title,disabled:b,onSelect:()=>{b||L(a.uuid)},className:(0,o.cn)("flex min-w-0 items-center justify-between gap-2",b&&"opacity-55",c&&"bg-primary/10"),children:[(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px] text-foreground",children:a.title}),b&&(0,d.jsxs)("span",{className:"flex shrink-0 items-center gap-1 text-[11px] font-medium text-[#B0654A] dark:text-[#EBA890]",children:[(0,d.jsx)(j,{className:"h-3 w-3"}),x("cycleBlocked")]})]},a.uuid)})})]})]})}),(0,d.jsxs)("div",{className:"flex items-start gap-2 rounded-md bg-[#FBF0EB] dark:bg-[#221e1b] px-3 py-2.5",children:[(0,d.jsx)(k.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[#B0654A] dark:text-[#EBA890]"}),(0,d.jsx)("p",{className:"text-[12px] leading-relaxed text-[#9A5238] dark:text-[#E9A088]",children:x("cycleWarning")})]}),C&&(0,d.jsx)("p",{className:"px-1 text-[12px] text-muted-foreground",role:"status",children:x("pickerTruncated")}),I&&(0,d.jsx)("p",{className:"text-xs text-destructive",role:"alert",children:I})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3 pt-2",children:[u?(0,d.jsx)(l.$,{variant:"outline",className:"border-border",onClick:()=>L(null),disabled:G,children:x("detach")}):(0,d.jsx)("span",{}),(0,d.jsx)(l.$,{variant:"outline",className:"border-border",onClick:()=>b(!1),disabled:G,children:y("cancel")})]})]})})}},17068:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{x:()=>k});var e=c(10837),f=c(21968),g=c(9222),h=c(40467),i=c(56828),j=a([i]);function k({ideaUuid:a,currentUserUuid:b,commentCount:c,onCommentCountChange:d}){let j=(0,g.c)("ideaTracker"),[k,l]=(0,f.useState)("comments");return(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"flex gap-1 rounded-lg bg-secondary p-0.5",children:[(0,e.jsxs)("button",{onClick:()=>l("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 ${"comments"===k?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-muted-foreground"}`,children:[j("panel.activityTab.comments"),c>0&&(0,e.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:c})]}),(0,e.jsx)("button",{onClick:()=>l("activity"),className:`flex-1 rounded-md px-3 py-1.5 text-[13px] font-medium transition-colors cursor-pointer ${"activity"===k?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-muted-foreground"}`,children:j("panel.activityTab.activity")})]}),(0,e.jsx)("div",{children:"activity"===k?(0,e.jsx)(h.v,{ideaUuid:a}):(0,e.jsx)(i.$m,{targetType:"idea",targetUuid:a,currentUserUuid:b,onCountChange:d,compact:!0})})]})}i=(j.then?(await j)():j)[0],d()}catch(a){d(a)}})},21289:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(56556).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"}]])},25711:(a,b,c)=>{c.r(b),c.d(b,{Checkbox:()=>v,CheckboxIndicator:()=>x,Indicator:()=>x,Root:()=>v,createCheckboxScope:()=>p,unstable_BubbleInput:()=>z,unstable_CheckboxBubbleInput:()=>z,unstable_CheckboxProvider:()=>s,unstable_CheckboxTrigger:()=>u,unstable_Provider:()=>s,unstable_Trigger:()=>u});var d=c(21968),e=c(96090),f=c(42990),g=c(22546),h=c(15035),i=c(29851),j=c(7579),k=c(5030),l=c(16551),m=c(10837),n="Checkbox",[o,p]=(0,f.A)(n),[q,r]=o(n);function s(a){let{__scopeCheckbox:b,checked:c,children:e,defaultChecked:f,disabled:g,form:i,name:j,onCheckedChange:k,required:l,value:o="on",internal_do_not_use_render:p}=a,[r,s]=(0,h.i)({prop:c,defaultProp:f??!1,onChange:k,caller:n}),[t,u]=d.useState(null),[v,w]=d.useState(null),x=d.useRef(!1),y=!t||!!i||!!t.closest("form"),z={checked:r,disabled:g,setChecked:s,control:t,setControl:u,name:j,form:i,value:o,hasConsumerStoppedPropagationRef:x,required:l,defaultChecked:!A(f)&&f,isFormControl:y,bubbleInput:v,setBubbleInput:w};return(0,m.jsx)(q,{scope:b,...z,children:"function"==typeof p?p(z):e})}var t="CheckboxTrigger",u=d.forwardRef(({__scopeCheckbox:a,onKeyDown:b,onClick:c,...f},h)=>{let{control:i,value:j,disabled:k,checked:n,required:o,setControl:p,setChecked:q,hasConsumerStoppedPropagationRef:s,isFormControl:u,bubbleInput:v}=r(t,a),w=(0,e.s)(h,p),x=d.useRef(n);return d.useEffect(()=>{let a=i?.form;if(a){let b=()=>q(x.current);return a.addEventListener("reset",b),()=>a.removeEventListener("reset",b)}},[i,q]),(0,m.jsx)(l.sG.button,{type:"button",role:"checkbox","aria-checked":A(n)?"mixed":n,"aria-required":o,"data-state":B(n),"data-disabled":k?"":void 0,disabled:k,value:j,...f,ref:w,onKeyDown:(0,g.mK)(b,a=>{"Enter"===a.key&&a.preventDefault()}),onClick:(0,g.mK)(c,a=>{q(a=>!!A(a)||!a),v&&u&&(s.current=a.isPropagationStopped(),s.current||a.stopPropagation())})})});u.displayName=t;var v=d.forwardRef((a,b)=>{let{__scopeCheckbox:c,name:d,checked:e,defaultChecked:f,required:g,disabled:h,value:i,onCheckedChange:j,form:k,...l}=a;return(0,m.jsx)(s,{__scopeCheckbox:c,checked:e,defaultChecked:f,disabled:h,required:g,onCheckedChange:j,name:d,form:k,value:i,internal_do_not_use_render:({isFormControl:a})=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(u,{...l,ref:b,__scopeCheckbox:c}),a&&(0,m.jsx)(z,{__scopeCheckbox:c})]})})});v.displayName=n;var w="CheckboxIndicator",x=d.forwardRef((a,b)=>{let{__scopeCheckbox:c,forceMount:d,...e}=a,f=r(w,c);return(0,m.jsx)(k.C,{present:d||A(f.checked)||!0===f.checked,children:(0,m.jsx)(l.sG.span,{"data-state":B(f.checked),"data-disabled":f.disabled?"":void 0,...e,ref:b,style:{pointerEvents:"none",...a.style}})})});x.displayName=w;var y="CheckboxBubbleInput",z=d.forwardRef(({__scopeCheckbox:a,...b},c)=>{let{control:f,hasConsumerStoppedPropagationRef:g,checked:h,defaultChecked:k,required:n,disabled:o,name:p,value:q,form:s,bubbleInput:t,setBubbleInput:u}=r(y,a),v=(0,e.s)(c,u),w=(0,i.Z)(h),x=(0,j.X)(f);d.useEffect(()=>{if(!t)return;let a=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,b=!g.current;if(w!==h&&a){let c=new Event("click",{bubbles:b});t.indeterminate=A(h),a.call(t,!A(h)&&h),t.dispatchEvent(c)}},[t,w,h,g]);let z=d.useRef(!A(h)&&h);return(0,m.jsx)(l.sG.input,{type:"checkbox","aria-hidden":!0,defaultChecked:k??z.current,required:n,disabled:o,name:p,value:q,form:s,...b,tabIndex:-1,ref:v,style:{...b.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function A(a){return"indeterminate"===a}function B(a){return A(a)?"indeterminate":a?"checked":"unchecked"}z.displayName=y},32382:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{D:()=>ag});var e=c(10837),f=c(21968),g=c(9222),h=c(68884),i=c(76549),j=c(33291),k=c(24364),l=c(87461),m=c(10694),n=c(86460),o=c(53109),p=c(74733),q=c(59876),r=c(98893),s=c(79543),t=c(42424),u=c(74645),v=c(49599),w=c(9994),x=c(20170),y=c(2852),z=c(88536),A=c(6019),B=c(76172),C=c(84722),D=c(64370),E=c(97984),F=c(79901),G=c(9190),H=c(17068),I=c(86104),J=c(98310),K=c(60881),L=c(9864),M=c(44963),N=c(98028),O=c(53581),P=c(44686),Q=c(54758),R=c(47424),S=c(58562),T=c(62460),U=c(42494),V=c(77439),W=c(26402),X=c(73577),Y=c(43227),Z=c(90939),$=c(76799),_=c(77078),aa=c(87902),ab=c(54722),ac=c(76664),ad=c(77521),ae=c(79030),af=a([C,D,H,I,J,M]);function ag({ideaUuid:a,projectUuid:b,currentUserUuid:c,onClose:d,onNavigate:af}){let ag=(0,g.c)(),ah=(0,g.c)("ideaTracker"),ai=(0,g.c)("status"),aj=(0,g.c)("ideaTracker.lineage"),ak=(0,h.r)(),[al,am]=(0,f.useState)(null),[an,ao]=(0,f.useState)(!0),[ap,aq]=(0,f.useState)(null),[ar,as]=(0,f.useState)([]),[at,au]=(0,f.useState)([]),[av,aw]=(0,f.useState)("overview"),[ax,ay]=(0,f.useState)(new Set(["overview"])),[az,aA]=(0,f.useState)(!1),[aB,aC]=(0,f.useState)(0),[aD,aE]=(0,f.useState)(!1),[aF,aG]=(0,f.useState)(!1),[aH,aI]=(0,f.useState)(null),[aJ,aK]=(0,f.useState)(!0),[aL,aM]=(0,f.useState)(!1),[aN,aO]=(0,f.useState)(null),[aP,aQ]=(0,f.useState)(!1),{start:aR,pickerState:aS,confirmPick:aT,cancelPick:aU,isResolving:aV}=(0,$.E)({reassignNoWake:aa.U,previewIdeaUuid:al?.uuid}),[aW,aX]=(0,f.useState)(!1),[aY,aZ]=(0,f.useState)(""),[a$,a_]=(0,f.useState)(""),[a0,a1]=(0,f.useState)(!1),[a2,a3]=(0,f.useState)(null),[a4,a5]=(0,f.useState)(!1),[a6,a7]=(0,f.useState)(!1),[a8,a9]=(0,f.useState)(!1),[ba,bb]=(0,f.useState)(!1),[bc,bd]=(0,f.useState)(null),[be,bf]=(0,f.useState)(null),[bg,bh]=(0,f.useState)(null),bi=(0,f.useCallback)(a=>{bh(null),bd(a)},[]),bj=(0,f.useCallback)(a=>{bd(null),bf(null),bh(a)},[]),[bk,bl]=(0,f.useState)(!1),[bm,bn]=(0,f.useState)(!1),bo=(0,f.useCallback)(a=>{let b=new URLSearchParams(window.location.search);b.set("tab",a),window.history.replaceState(null,"",`${window.location.pathname}?${b.toString()}`)},[]),bp=(0,f.useCallback)(async()=>{try{let b=await (0,P.c)(a);b.success?(am(b.data),aq(null)):aq(ah("Not found"===b.error?"panel.notFound":"panel.loadFailed"))}catch{aq(ah("panel.loadFailed"))}finally{ao(!1)}},[a,ah]);(0,B.eV)("idea",bp),(0,B.eV)("proposal",bp),(0,B.eV)("task",bp);let bq=al?.uuid,br=al?.status,bs=(0,f.useCallback)(async()=>{if(!bq||"open"===br)return void as([]);try{let a=await (0,Q.U)(b,bq);a.success&&as(a.data)}catch(a){ab.q.error("Failed to fetch proposals:",a)}},[b,bq,br]);(0,B.eV)("proposal",bs);let bt=(0,f.useCallback)(async()=>{let a=ar.filter(a=>"approved"===a.status);if(0===a.length)return void au([]);try{let c=(await Promise.all(a.map(a=>(0,R.c)(b,a.uuid)))).flatMap(a=>a.success&&a.data?a.data.map(a=>({uuid:a.uuid,title:a.title,status:a.status,commentCount:a.commentCount??0,assignee:a.assignee??null,acceptanceSummary:a.acceptanceSummary??null})):[]);au(c)}catch(a){ab.q.error("Failed to fetch tasks:",a)}},[b,ar]);(0,B.eV)("task",bt);let bu=(0,f.useCallback)(async()=>{if(!bq)return;let a=await (0,T.z)(bq);a.success&&a.data&&aI(a.data),aK(!1)},[bq]);(0,B.eV)("idea",bu);let bv=(0,f.useMemo)(()=>al?function(a,b,c){let d=["overview"];return d.push("elaboration"),b.length>0&&d.push("proposal"),c.length>0&&d.push("tasks"),d.push("activity"),d}(0,ar,at):["overview","activity"],[al,ar,at]);(0,f.useRef)(null),al&&al.badgeHint;let bw=(0,f.useMemo)(()=>at.filter(a=>"in_progress"===a.status||"assigned"===a.status||"to_verify"===a.status).length,[at]),bx=(0,f.useCallback)(()=>{if(!bc)return void bf(null);(0,S.Q)(bc).then(a=>{a.success&&bf(a.data)}).catch(a=>ab.q.error("Failed to load task details:",a))},[bc]);(0,B.eV)("task",bx);let by=()=>{aX(!1),aZ(al?.title||""),a_(al?.content||""),a3(null)},bz=async()=>{if(!al||!aY.trim())return void a3(ag("ideas.titleRequired"));a1(!0),a3(null);let a=await (0,N.J)({ideaUuid:al.uuid,projectUuid:b,title:aY.trim(),content:a$.trim()||null});a1(!1),a.success?(aX(!1),await bp(),ak.refresh()):a3(a.error||ag("ideas.updateFailed"))},bA=async()=>{if(!al)return;aG(!0);let a=await (0,O.Z)(al.uuid,b);aG(!1),a.success&&(d(),ak.refresh())},bB=async()=>{if(!al)return;aM(!0),aO(null);let a=await (0,U.e)(al.uuid);aM(!1),a.success?(aQ(!0),await bp(),ak.refresh()):aO(a.error||ag("elaboration.verifyFailed"))},bC=async a=>{if(!al)return;a5(!0),am({...al,isContainer:a});let c=await (0,N.J)({ideaUuid:al.uuid,projectUuid:b,title:al.title,content:al.content??null,isContainer:a});a5(!1),c.success?(await bp(),ak.refresh()):(am({...al,isContainer:!a}),i.oR.error(c.error||ag("ideas.updateFailed")))},bD=al?.derivedStatus||"todo",bE=al?.isContainer===!0,bF=null!==al,bG=(0,W.o)({ideaStatus:al?.status,elaborationStatus:al?.elaborationStatus,elaboration:aH});return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:d}),(0,e.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 ${bm?"":"animate-in slide-in-from-right duration-300"}`,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between border-b border-secondary px-6 py-5",children:[(0,e.jsx)("div",{className:"flex-1 min-w-0",children:an?(0,e.jsx)("div",{className:"h-5 w-40 animate-pulse rounded bg-secondary"}):al?aW?(0,e.jsx)("h2",{className:"text-base font-semibold text-foreground",children:ag("ideas.editIdea")}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:`text-[11px] font-semibold uppercase tracking-wider ${bE?"text-primary":"text-muted-foreground"}`,children:bE?aj("typeTheme"):aj("typeIdea")}),(0,e.jsx)("h2",{className:"text-base font-semibold text-foreground truncate",children:al.title}),(0,e.jsxs)("div",{className:"mt-1.5 flex items-center gap-2",children:[(0,e.jsx)(v.E,{className:ad._5[bD]||ad._5.todo,children:al.badgeHint?ah(`badge.${ad.Wl[al.badgeHint]||"open"}`):ai(ad.Bj[bD]||"todo")}),bE&&al.childProgress&&al.childProgress.total>0&&(0,e.jsxs)("span",{className:"flex items-center gap-1 text-xs font-medium text-primary",title:aj("childrenDone",{done:al.childProgress.done,total:al.childProgress.total}),children:[(0,e.jsx)(ae.C,{done:al.childProgress.done,total:al.childProgress.total,size:13,stroke:2}),al.childProgress.done,"/",al.childProgress.total]}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,ac.r)(al.createdAt)})]})]}):(0,e.jsx)("h2",{className:"text-base font-semibold text-foreground",children:ah("panel.notFound")})}),(0,e.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[al&&!aW&&(0,e.jsxs)(t.$,{variant:"outline",size:"sm",className:"h-8 gap-1.5 border-border px-2.5",onClick:()=>bb(!0),title:aj("deriveIdea"),"aria-label":aj("deriveIdea"),children:[(0,e.jsx)(j.A,{className:"h-3.5 w-3.5 text-primary"}),(0,e.jsx)("span",{className:"text-[12px] font-medium text-primary",children:aj("derive")})]}),al&&!aW&&(0,e.jsx)(t.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-border",onClick:()=>a7(!0),title:ag("ideas.actions.move"),"aria-label":ag("ideas.actions.move"),children:(0,e.jsx)(k.A,{className:"h-4 w-4 text-muted-foreground"})}),al&&"elaborated"!==al.status&&!aW&&(0,e.jsx)(t.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-border",onClick:()=>{al&&(aZ(al.title),a_(al.content||""),a3(null),aX(!0))},title:ag("ideas.editIdea"),children:(0,e.jsx)(l.A,{className:"h-4 w-4 text-muted-foreground"})}),(0,e.jsx)(t.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-border",onClick:aW?by:d,children:(0,e.jsx)(m.A,{className:"h-4 w-4 text-muted-foreground"})})]})]}),al&&!an&&!aW&&(0,e.jsx)("div",{className:"border-b border-secondary px-6",children:(0,e.jsx)("div",{className:"flex gap-0 -mb-px",children:bv.map(a=>(0,e.jsxs)("button",{onClick:()=>{aw(a),aA(!0),ay(b=>new Set([...b,a])),bo(a)},className:`relative flex items-center gap-1.5 px-3 py-2.5 text-[13px] font-medium transition-colors cursor-pointer ${av===a?"text-primary border-b-2 border-primary":"text-muted-foreground hover:text-muted-foreground"}`,children:[ah(`panel.tabs.${a}`),"tasks"===a&&bw>0&&(0,e.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:bw}),"activity"===a&&aB>0&&(0,e.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:aB})]},a))})}),(0,e.jsx)(u.F,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:(0,e.jsx)("div",{className:"flex min-h-full flex-col px-6 py-5",children:an?(0,e.jsxs)("div",{className:"flex flex-1 items-center justify-center py-12",children:[(0,e.jsx)(n.A,{className:"h-6 w-6 animate-spin text-primary"}),(0,e.jsx)("span",{className:"ml-2 text-sm text-muted-foreground",children:ah("loading")})]}):ap?(0,e.jsx)("div",{className:"flex flex-1 items-center justify-center py-12",children:(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:ap})}):al?aW?(0,e.jsxs)("div",{className:"space-y-5",children:[a2&&(0,e.jsx)("div",{className:"rounded-lg bg-destructive/10 p-3 text-sm text-destructive",children:a2}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(y.J,{htmlFor:"edit-title",className:"text-[13px] font-medium text-foreground",children:ag("ideas.titleLabel")}),(0,e.jsx)(w.p,{id:"edit-title",value:aY,onChange:a=>aZ(a.target.value),className:"border-border text-sm focus-visible:ring-primary",autoFocus:!0})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(y.J,{htmlFor:"edit-content",className:"text-[13px] font-medium text-foreground",children:ag("common.content")}),(0,e.jsx)(x.T,{id:"edit-content",value:a$,onChange:a=>a_(a.target.value),rows:8,className:"border-border text-sm resize-none focus-visible:ring-primary"})]})]}):(0,e.jsxs)(e.Fragment,{children:[ax.has("overview")&&(0,e.jsxs)("div",{style:{display:"overview"===av?"block":"none"},children:[(0,e.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,e.jsxs)("div",{className:"min-w-0 space-y-0.5",children:[(0,e.jsxs)(y.J,{htmlFor:"container-toggle",className:"flex items-center gap-1.5 text-[13px] font-medium text-foreground",children:[(0,e.jsx)(j.A,{className:"h-3.5 w-3.5 text-primary","aria-hidden":!0}),aj("container")]}),(0,e.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:aj("containerDescription")})]}),(0,e.jsx)(z.d,{id:"container-toggle",checked:bE,disabled:a4,onCheckedChange:bC,"aria-label":aj("makeContainer")})]}),(0,e.jsx)(E.p,{idea:al,proposals:ar,tasks:at,onSelectTask:bi}),(0,e.jsxs)("div",{className:"mt-5 space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(j.A,{className:"h-3.5 w-3.5 text-primary"}),(0,e.jsx)("span",{className:"text-[12px] font-semibold text-foreground/80",children:aj("title")})]}),(0,e.jsxs)(t.$,{variant:"outline",size:"sm",className:"h-7 gap-1 border-border px-2 text-[11px] text-muted-foreground",onClick:()=>a9(!0),children:[(0,e.jsx)(l.A,{className:"h-3 w-3"}),al.parentUuid?aj("changeParent"):aj("setParent")]})]}),al.parent?(0,e.jsxs)("button",{type:"button",onClick:()=>af?.(al.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,e.jsx)(o.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,e.jsx)("span",{className:"shrink-0 text-[12px] text-muted-foreground",children:aj("derivedFrom")}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate text-[12px] font-medium text-foreground/80",children:al.parent.title})]}):(0,e.jsx)("p",{className:"px-1 text-[12px] text-muted-foreground",children:aj("noParent")}),al.children&&al.children.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-1 pt-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("span",{className:"text-[12px] font-medium text-foreground/80",children:aj("derivedIdeas")}),(0,e.jsx)("span",{className:"text-[11px] text-muted-foreground",children:al.children.length})]}),(()=>{let a=al.children.filter(a=>"done"===a.derivedStatus).length,b=al.children.length;return(0,e.jsxs)("span",{className:"flex items-center gap-1.5 text-[12px] text-muted-foreground",title:aj("childrenDone",{done:a,total:b}),children:[(0,e.jsx)(ae.C,{done:a,total:b,size:14,stroke:2}),a,"/",b]})})()]}),(0,e.jsx)("div",{className:"overflow-hidden rounded-lg border border-[#EFEBE3] dark:border-[#2a2a2e]",children:al.children.map((a,b)=>(0,e.jsxs)("div",{children:[b>0&&(0,e.jsx)("div",{className:"h-px bg-[#F0EEEA] dark:bg-[#1f1e1c]"}),(0,e.jsxs)("button",{type:"button",onClick:()=>af?.(a.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,e.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,e.jsx)(p.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,e.jsx)("span",{className:"truncate text-[12px] text-foreground",children:a.title})]}),(0,e.jsx)(v.E,{className:`shrink-0 border-0 text-[10px] ${ad._5[a.derivedStatus]||ad._5.todo}`,children:ai(ad.Bj[a.derivedStatus]||"todo")})]})]},a.uuid))})]})]}),(0,e.jsx)(F.U,{projectUuid:b,ideaUuid:al.uuid,proposals:ar,onDocClick:bj}),(0,e.jsxs)("div",{className:"mt-5 space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(q.A,{className:"h-3.5 w-3.5 text-primary"}),(0,e.jsx)("span",{className:"text-[12px] font-semibold text-foreground/80",children:ag("references.title")})]}),(0,e.jsx)(Z.ReferencesSection,{targetType:"idea",targetUuid:al.uuid,canWrite:!0,compact:!0})]})]}),bv.includes("elaboration")&&ax.has("elaboration")&&(0,e.jsx)("div",{style:{display:"elaboration"===av?"block":"none"},children:(0,e.jsx)(C.G,{idea:al,elaboration:aH,isLoading:aJ,onRefresh:async()=>{await bu(),await bp()},onReassign:()=>aE(!0),canReassign:bF})}),bv.includes("proposal")&&ax.has("proposal")&&(0,e.jsx)("div",{style:{display:"proposal"===av?"block":"none"},children:(0,e.jsx)(D.k,{idea:al,projectUuid:b,onTaskClick:bi,onDocClick:bj,initialProposals:ar})}),bv.includes("tasks")&&ax.has("tasks")&&(0,e.jsx)("div",{style:{display:"tasks"===av?"block":"none"},children:(0,e.jsx)(G.n,{tasks:at,projectUuid:b,proposalUuids:ar.filter(a=>"approved"===a.status).map(a=>a.uuid),onSelectTask:bi})}),ax.has("activity")&&(0,e.jsx)("div",{style:{display:"activity"===av?"block":"none"},children:(0,e.jsx)(H.x,{ideaUuid:al.uuid,currentUserUuid:c,commentCount:aB,onCommentCountChange:aC})})]}):null})}),al&&!an&&(0,e.jsx)("div",{className:"border-t border-secondary px-6 py-4",children:aW?(0,e.jsxs)("div",{className:"flex items-center justify-end gap-3",children:[(0,e.jsx)(t.$,{variant:"outline",className:"border-border",onClick:by,disabled:a0,children:ag("common.cancel")}),(0,e.jsx)(t.$,{className:"bg-primary hover:bg-[#B56A42] text-white",onClick:bz,disabled:a0||!aY.trim(),children:a0?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(n.A,{className:"mr-2 h-4 w-4 animate-spin"}),ag("common.save")]}):ag("common.save")})]}):(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,e.jsxs)("div",{className:"flex-1 min-w-0 flex flex-wrap items-center gap-2",children:[!bE&&(0,e.jsxs)(e.Fragment,{children:[bG&&!aP&&(0,e.jsx)(t.$,{className:"bg-primary hover:bg-[#B56A42] text-white",onClick:()=>{al&&aR({ideaUuid:al.uuid,wake:bB})},disabled:aL||aV,children:aL?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(n.A,{className:"mr-2 h-4 w-4 animate-spin"}),ag("elaboration.verifying")]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(r.A,{className:"mr-2 h-4 w-4"}),ag("elaboration.verifyButton")]})}),aP&&(0,e.jsx)("span",{className:"text-[11px] text-[#00796B] dark:text-[#4FD1C0]",children:ag("elaboration.verifiedQueuedHint")}),aN&&(0,e.jsx)("span",{className:"text-[11px] text-destructive",children:aN}),(0,e.jsx)(X.w,{ideaUuid:al.uuid,assignee:al.assignee,assigneeName:al.assignee?.name,proposals:ar,tasks:at,onStarted:()=>{bp()}}),(0,e.jsx)(Y.s,{ideaUuid:al.uuid,assignee:al.assignee,assigneeName:al.assignee?.name,proposals:ar,tasks:at,onStarted:()=>{bp()}})]}),bE&&(0,e.jsx)("span",{className:"text-[11px] text-muted-foreground",children:aj("containerHint")})]}),(0,e.jsxs)(A.Lt,{children:[(0,e.jsx)(A.tv,{asChild:!0,children:(0,e.jsx)(t.$,{variant:"outline",size:"icon",className:"shrink-0 h-8 w-8 border-border text-[#EF4444] dark:text-[#F0897E] hover:bg-[#FFEBEE] dark:hover:bg-[#331619] hover:text-[#EF4444] hover:border-[#EF4444]",children:(0,e.jsx)(s.A,{className:"h-4 w-4"})})}),(0,e.jsxs)(A.EO,{children:[(0,e.jsxs)(A.wd,{children:[(0,e.jsx)(A.r7,{children:ag("ideas.deleteIdea")}),(0,e.jsx)(A.$v,{children:ag("ideas.deleteIdeaConfirm",{title:al.title})})]}),(0,e.jsxs)(A.ck,{children:[(0,e.jsx)(A.Zr,{children:ag("common.cancel")}),(0,e.jsx)(A.Rx,{variant:"destructive",onClick:bA,disabled:aF,children:aF?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(n.A,{className:"mr-2 h-4 w-4 animate-spin"}),ag("common.delete")]}):ag("common.delete")})]})]})]})]})})]}),(0,e.jsx)(K.h,{open:a6,onOpenChange:a7,ideaUuid:a,projectUuid:b,onMoved:()=>d()}),al&&(0,e.jsx)(L.d,{open:a8,onOpenChange:a9,ideaUuid:al.uuid,ideaTitle:al.title,projectUuid:b,currentParentUuid:al.parentUuid??null,descendantUuids:al.descendantUuids??[],onChanged:bp}),al&&(0,e.jsx)(M.i,{open:ba,onOpenChange:bb,projectUuid:b,parentUuid:al.uuid,parentTitle:al.title,onCreated:a=>{i.oR.success(aj("deriveIdea")),ak.refresh(),af?.(a)}}),aD&&al&&(0,e.jsx)(V.i,{idea:{uuid:al.uuid,title:al.title,content:al.content,status:al.status,assignee:al.assignee?{type:al.assignee.type,uuid:al.assignee.uuid,name:al.assignee.name}:null},projectUuid:b,currentUserUuid:c,onClose:()=>{aE(!1),bp()}}),(0,e.jsx)(_.V,{open:null!==aS,agentName:al?.assignee?.name??"",instances:aS?.instances??[],onConfirm:aT,onCancel:aU}),bc&&be&&(0,e.jsx)(I.v,{task:be,projectUuid:b,currentUserUuid:c,mode:bk?"sidebyside":"overlay",onClose:()=>{bd(null),bf(null)},onBack:()=>{bd(null),bf(null)}}),bg&&(0,e.jsx)(J.K,{title:bg.title,type:bg.type,content:bg.content,mode:bk?"sidebyside":"overlay",onClose:()=>bh(null),onBack:()=>bh(null)})]})}[C,D,H,I,J,M]=af.then?(await af)():af,d()}catch(a){d(a)}})},33291:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(56556).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"}]])},40467:(a,b,c)=>{c.d(b,{v:()=>k});var d=c(10837),e=c(21968),f=c(9222),g=c(86460),h=c(2852),i=c(68141),j=c(77521);function k({ideaUuid:a}){let b=(0,f.c)(),[c,k]=(0,e.useState)([]),[l,m]=(0,e.useState)(!0);return(0,e.useCallback)(async()=>{m(!0),k((await (0,i.x)(a)).activities),m(!1)},[a]),(0,d.jsxs)("div",{className:"mt-5",children:[(0,d.jsx)(h.J,{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:b("common.activity")}),(0,d.jsx)("div",{className:"mt-2",children:l?(0,d.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,d.jsx)(g.A,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):0===c.length?(0,d.jsx)("p",{className:"text-sm text-muted-foreground italic",children:b("common.noActivity")}):c.map((a,e)=>(0,d.jsxs)("div",{className:"flex items-stretch gap-2.5",children:[(0,d.jsxs)("div",{className:"flex flex-col items-center w-2 shrink-0",children:[(0,d.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full border-[1.5px] border-[#D9D9D9] dark:border-[#3a3a40] bg-card"}),e<c.length-1&&(0,d.jsx)("div",{className:"flex-1 w-px bg-border mt-1"})]}),(0,d.jsxs)("div",{className:"flex-1 pb-3",children:[(0,d.jsx)("p",{className:"text-[13px] text-foreground",children:function(a,b){let{action:c,actorName:d}=a;switch(c){case"created":case"idea_created":return b("activity.ideaCreated",{actor:d});case"assigned":case"idea_assigned":return b("activity.ideaAssigned",{actor:d});case"claimed":case"idea_claimed":return b("activity.ideaClaimed",{actor:d});case"released":case"idea_released":return b("activity.ideaReleased",{actor:d});case"status_changed":case"idea_status_changed":return b("activity.ideaStatusChanged",{actor:d});case"edited":case"idea_edited":return b("activity.ideaEdited",{actor:d});case"reparented":case"idea_reparented":return b("activity.ideaReparented",{actor:d});case"elaboration_started":return b("activity.elaborationStarted",{actor:d});case"elaboration_answered":return b("activity.elaborationAnswered",{actor:d});case"elaboration_skipped":return b("activity.elaborationSkipped",{actor:d});case"elaboration_resolved":return b("activity.elaborationResolved",{actor:d});case"elaboration_followup":return b("activity.elaborationFollowup",{actor:d});default:return b("activity.genericAction",{actor:d,action:c})}}(a,b)}),(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground",children:(0,j.fw)(a.createdAt,b)})]})]},a.uuid))})]})}},44686:(a,b,c)=>{c.d(b,{c:()=>e});var d=c(42377);let e=(0,d.createServerReference)("40105aaae35dd17e0115cd8b12393c5a55a0c22ec3",d.callServer,void 0,d.findSourceMapURL,"getIdeaAction")},44963:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{i:()=>u});var e=c(10837),f=c(21968),g=c(9222),h=c(86460),i=c(42424),j=c(11568),k=c(9994),l=c(20170),m=c(2852),n=c(8495),o=c(94372),p=c(42087),q=c(93524),r=c(70028),s=c(68797),t=a([s]);function u({open:a,onOpenChange:b,projectUuid:c,onCreated:d,parentUuid:t,parentTitle:u}){let v=(0,g.c)("ideaTracker"),w=(0,g.c)("ideaTracker.lineage"),x=!!t,y=(0,g.c)("common"),[z,A]=(0,f.useState)(""),[B,C]=(0,f.useState)(""),[D,E]=(0,f.useState)(!1),[F,G]=(0,f.useState)(!1),[H,I]=(0,f.useState)(null),[J,K]=(0,f.useState)(!1),[L,M]=(0,f.useState)(!1),N=(0,r.kz)(),O=(N?.connections??[]).some(a=>"online"===a.effectiveStatus),[P,Q]=(0,f.useState)("form"),R=x?"form":P,S=async()=>{let a=z.trim();if(a){G(!0),I(null);try{let e=await fetch(`/api/projects/${c}/ideas`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:a,content:B.trim()||void 0,...t?{parentUuid:t}:{},...D?{isContainer:!0}:{}})}),f=await e.json();f.success&&f.data?.uuid?(A(""),C(""),E(!1),b(!1),d?.(f.data.uuid)):I(f.error||v("error.createFailed"))}catch{I(v("error.createFailed"))}finally{G(!1)}}},T=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"space-y-4 py-2",children:[(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(m.J,{htmlFor:"idea-title",children:v("newIdea.ideaTitle")}),(0,e.jsx)(k.p,{id:"idea-title",value:z,onChange:a=>A(a.target.value),placeholder:v("newIdea.titlePlaceholder"),autoFocus:!0,onKeyDown:a=>{!(0,p.P)(a)&&"Enter"===a.key&&!a.shiftKey&&z.trim()&&(a.preventDefault(),S())}})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsxs)(m.J,{htmlFor:"idea-content",children:[v("newIdea.description"),(0,e.jsxs)("span",{className:"ml-1 text-xs font-normal text-muted-foreground",children:["(",y("optional"),")"]})]}),(0,e.jsx)(l.T,{id:"idea-content",value:B,onChange:a=>C(a.target.value),placeholder:v("newIdea.descriptionPlaceholder"),rows:4,className:"resize-none"})]}),(0,e.jsxs)("div",{className:"flex items-start gap-2",children:[(0,e.jsx)(n.S,{id:"idea-is-container",checked:D,onCheckedChange:a=>E(!0===a),className:"mt-0.5"}),(0,e.jsxs)("div",{className:"grid gap-1 leading-none",children:[(0,e.jsx)(m.J,{htmlFor:"idea-is-container",className:"cursor-pointer",children:w("makeContainer")}),(0,e.jsx)("p",{className:"text-xs font-normal text-muted-foreground",children:w("containerHint")})]})]}),H&&(0,e.jsx)("div",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-[12px] text-destructive",children:H})]}),(0,e.jsxs)(j.Es,{children:[(0,e.jsx)(i.$,{variant:"outline",onClick:()=>b(!1),disabled:F,children:y("cancel")}),(0,e.jsxs)(i.$,{onClick:S,disabled:F||!z.trim(),className:"bg-primary hover:bg-[#B56A42] text-white",children:[F?(0,e.jsx)(h.A,{className:"mr-2 h-4 w-4 animate-spin"}):null,y("create")]})]})]}),U=async a=>{let b=await (0,q.tm)("/api/ideas/conversational",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectUuid:c,agentUuid:a.agentUuid,connectionUuid:a.connectionUuid,descriptionText:a.userText,...J?{decompose:!0}:{}})});if(!b.ok){let a=null;try{let c=await b.json();"string"==typeof c?.error&&c.error&&(a=c.error)}catch{}throw new s.fF(b.status,a)}let d=null;try{let a=await b.json();a?.success&&a.data?.session&&(d=a.data.session)}catch{}if(!d)throw new s.fF(b.status,null);return d},V=(0,e.jsxs)("div",{className:"space-y-3 py-2",children:[(0,e.jsxs)("div",{className:"flex items-start gap-2",children:[(0,e.jsx)(n.S,{id:"idea-decompose",checked:J,onCheckedChange:a=>K(!0===a),className:"mt-0.5"}),(0,e.jsxs)("div",{className:"grid gap-1 leading-none",children:[(0,e.jsx)(m.J,{htmlFor:"idea-decompose",className:"cursor-pointer",children:v("newIdea.decompose")}),(0,e.jsx)("p",{className:"text-xs font-normal text-muted-foreground",children:v("newIdea.decomposeHint")})]})]}),(0,e.jsx)(s.jH,{projectUuid:c,dispatch:U,onStarted:a=>{b(!1),N?.openChatForSession(a)}})]});return(0,e.jsx)(j.lG,{open:a,onOpenChange:b,children:(0,e.jsxs)(j.Cf,{className:"sm:max-w-[480px]",children:[(0,e.jsxs)(j.c7,{children:[(0,e.jsx)(j.L3,{children:x?w("deriveIdea"):v("newIdea.title")}),x&&u&&(0,e.jsxs)("p",{className:"text-[13px] text-muted-foreground",children:[w("derivedFrom")," \xb7 ",u]})]}),!x&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(o.tU,{value:R,onValueChange:a=>Q(a),children:(0,e.jsxs)(o.j7,{className:"grid w-full grid-cols-2",children:[(0,e.jsx)(o.Xi,{value:"form",children:v("newIdea.modeForm")}),(0,e.jsx)(o.Xi,{value:"conversation",disabled:!O&&!L,children:v("newIdea.modeConversation")})]})}),!O&&(0,e.jsxs)("div",{className:"rounded-xl border border-[#EFEBE4] dark:border-[#2a2a2e] bg-[#FCFBF8] dark:bg-[#1e1d1b] px-3 py-2",children:[(0,e.jsx)("p",{className:"px-1 pt-1 text-[12px] font-medium text-muted-foreground",children:v("newIdea.modeConversationOfflineHint")}),(0,e.jsx)(s.Bs,{variant:"compact"})]})]}),"form"===R?T:V]})})}s=(t.then?(await t)():t)[0],d()}catch(a){d(a)}})},53109:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(56556).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"}]])},55183:(a,b,c)=>{function d(a){return a.replace(/\\n/g,"\n")}c.d(b,{j:()=>d,y:()=>e});let e={prd:"typePrd",tech_design:"typeTechDesign",adr:"typeAdr",spec:"typeSpec",guide:"typeGuide",design:"typeDesign",note:"typeNote",report:"typeReport",other:"typeOther"}},58562:(a,b,c)=>{c.d(b,{Q:()=>e});var d=c(42377);let e=(0,d.createServerReference)("40bbd1b0376808960fb33e7569ba6eb1f6588104ae",d.callServer,void 0,d.findSourceMapURL,"getTaskAction")},64370:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{k:()=>A});var e=c(10837),f=c(21968),g=c(9222),h=c(81512),i=c.n(h),j=c(86460),k=c(21289),l=c(49102),m=c(20447),n=c(21790),o=c(51592),p=c(49599),q=c(42424),r=c(22727),s=c(90061),t=c(76172),u=c(97450),v=c(60265),w=c(55183),x=c(54758);c(47424);var y=c(54722),z=a([u]);function A({idea:a,projectUuid:b,onTaskClick:c,onDocClick:d,initialProposals:h}){let i=(0,g.c)("ideaTracker"),[l,m]=(0,f.useState)(h??[]),[n,o]=(0,f.useState)(!h),p=(0,f.useCallback)(async()=>{try{let c=await (0,x.U)(b,a.uuid);if(c.success)return m(c.data),c.data}catch(a){y.q.error("Failed to fetch proposals:",a)}finally{o(!1)}return[]},[b,a.uuid]),q=(0,f.useRef)(l);q.current=l;let{getPresence:r}=(0,s.xQ)();return((0,t.eV)("proposal",async()=>{let a=q.current;for(let b of(await p())){let c=a.find(a=>a.uuid===b.uuid);if(!c)continue;let d=new Set((c.documentDrafts??[]).map(a=>a.uuid)),e=new Set((c.taskDrafts??[]).map(a=>a.uuid)),f=(b.documentDrafts??[]).filter(a=>a.uuid&&!d.has(a.uuid)),g=(b.taskDrafts??[]).filter(a=>a.uuid&&!e.has(a.uuid)),h=[...f.map(a=>a.uuid),...g.map(a=>a.uuid)];if(h.length>0){let a=r("proposal",b.uuid)[0];if(a)for(let c of h)(0,s.fv)({entityType:"proposal",entityUuid:b.uuid,subEntityType:"draft",subEntityUuid:c,agentUuid:a.agentUuid,agentName:a.agentName,action:"mutate"})}}}),n)?(0,e.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,e.jsx)(j.A,{className:"h-5 w-5 animate-spin text-primary"})}):0===l.length?(0,e.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[(0,e.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#F3E5F5] dark:bg-[#281630]",children:(0,e.jsx)(k.A,{className:"h-5 w-5 text-[#7B1FA2] dark:text-[#C98FE0]"})}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:i("panel.noProposals")})]}):(0,e.jsx)("div",{className:"space-y-5",children:l.map(a=>(0,e.jsx)(B,{proposal:a,projectUuid:b,onTaskClick:c,onDocClick:d},a.uuid))})}u=(z.then?(await z)():z)[0];let D={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 B({proposal:a,projectUuid:b,onTaskClick:c,onDocClick:d}){let h=(0,g.c)("ideaTracker"),j=(0,g.c)(),k=(0,g.c)("proposals"),n=(0,g.c)("tasks"),o=(0,g.c)("documents"),s=a.documentDrafts||[],t=a.taskDrafts||[],[x,y]=(0,f.useState)(new Set),[z,A]=(0,f.useState)("cards"),[B,E]=(0,f.useState)([]),F="approved"===a.status,G=(0,f.useMemo)(()=>{let a=new Map;for(let b of B)a.set(b.title,b);return a},[B]),{dagTasks:H,dagEdges:I,dagHeight:J}=(0,f.useMemo)(()=>{let a=t.map(a=>{let b=G.get(a.title);return{uuid:b?.uuid||a.uuid,title:a.title,status:b?.status||"open",priority:a.priority||"medium"}}),b=[],c=new Map(t.map(a=>[a.uuid,a]));for(let a of t)if(a.dependsOnDraftUuids)for(let d of a.dependsOnDraftUuids){let e=G.get(a.title),f=c.get(d),g=f?G.get(f.title):void 0;b.push({from:e?.uuid||a.uuid,to:g?.uuid||d})}return{dagTasks:a,dagEdges:b,dagHeight:Math.max(350,90*a.length)}},[t,G]),K=F?B.filter(a=>"done"===a.status||"closed"===a.status).length:0;return(0,e.jsxs)("div",{className:"space-y-5",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("h3",{className:"text-[14px] font-semibold text-foreground truncate flex-1",children:a.title}),(0,e.jsx)(p.E,{className:`text-[11px] font-semibold border-0 shrink-0 ${D[a.status]||""}`,children:j(`status.${a.status}`)})]}),a.description&&(0,e.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,e.jsx)(u.MarkdownContent,{children:(0,w.j)(a.description)})}),(0,e.jsxs)(i(),{href:`/projects/${b}/proposals/${a.uuid}`,className:"flex items-center gap-1 text-[13px] font-medium text-primary hover:underline",children:[h("panel.viewProposal"),(0,e.jsx)(l.A,{className:"h-3.5 w-3.5"})]}),s.length>0&&(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-muted-foreground",children:k(F?"documents":"documentDrafts")}),(0,e.jsx)("span",{className:"text-[11px] text-muted-foreground",children:s.length})]}),(0,e.jsx)("div",{className:"space-y-0",children:s.map((b,c)=>(0,e.jsx)(r.D,{entityType:"proposal",entityUuid:a.uuid,subEntityType:"draft",subEntityUuid:b.uuid||`draft-${c}`,badgeInside:!0,children:(0,e.jsxs)(q.$,{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:()=>b.content&&d?.({title:b.title,type:b.type,content:b.content}),children:[(0,e.jsx)(m.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,e.jsx)(p.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:o(w.y[b.type]||"typeOther")}),(0,e.jsx)("span",{className:"flex-1 min-w-0 text-left text-[13px] text-foreground truncate",children:b.title})]})},b.uuid||c))})]}),(t.length>0||B.length>0)&&(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center justify-between pb-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-muted-foreground",children:k(F?"tasks":"taskDrafts")}),(0,e.jsx)("span",{className:"text-[11px] text-muted-foreground",children:F&&B.length>0?B.length:t.length})]}),(0,e.jsxs)("span",{className:"text-[12px] text-muted-foreground",children:[K,"/",F&&B.length>0?B.length:t.length]})]}),(0,e.jsx)("div",{className:"-mx-6 border-t border-border"}),I.length>0&&(0,e.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,e.jsx)(q.$,{variant:"ghost",size:"sm",onClick:()=>A("cards"),className:`rounded-md px-2.5 py-1 h-auto text-[11px] font-medium transition-colors ${"cards"===z?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-muted-foreground"}`,children:k("cardsView")}),(0,e.jsx)(q.$,{variant:"ghost",size:"sm",onClick:()=>A("dag"),className:`rounded-md px-2.5 py-1 h-auto text-[11px] font-medium transition-colors ${"dag"===z?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-muted-foreground"}`,children:n("dagView")})]}),"cards"===z&&(0,e.jsx)("div",{className:"space-y-0",children:F&&B.length>0?B.map(a=>(0,e.jsx)(r.D,{entityType:"task",entityUuid:a.uuid,badgeInside:!0,children:(0,e.jsx)(C,{task:{uuid:a.uuid,title:a.title},expanded:!1,onToggle:()=>{},onNavigate:c?()=>c(a.uuid):void 0,taskStatus:a.status})},a.uuid)):t.map((b,c)=>(0,e.jsx)(r.D,{entityType:"proposal",entityUuid:a.uuid,subEntityType:"draft",subEntityUuid:b.uuid,badgeInside:!0,children:(0,e.jsx)(C,{task:b,expanded:x.has(c),onToggle:()=>{y(a=>{let b=new Set(a);return b.has(c)?b.delete(c):b.add(c),b})}})},b.uuid))}),"dag"===z&&(0,e.jsx)("div",{className:"mt-3",children:(0,e.jsx)(v._u,{tasks:H,edges:I,readonly:!0,height:J,onNodeClick:c})})]}),0===s.length&&0===t.length&&0===B.length&&(0,e.jsx)("p",{className:"text-xs text-muted-foreground italic",children:k("emptyContainer")})]})}let E={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]"},F={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 C({task:a,expanded:b,onToggle:c,onNavigate:d,taskStatus:f}){let h=(0,g.c)("proposals"),i=(0,g.c)("acceptanceCriteria"),j=(0,g.c)("status"),k=a.acceptanceCriteriaItems||[],p=!!(a.description||k.length>0),r=f?E[f]||E.open:"border-[#D9D9D9] dark:border-[#3a3a40] bg-card",s=f?F[f]:null,t=(0,e.jsx)("span",{className:`shrink-0 h-2 w-2 rounded-full border-[1.5px] ${r} transition-colors`}),u=(0,e.jsx)("span",{className:"flex-1 min-w-0 text-[13px] leading-snug truncate text-muted-foreground",children:a.title}),v=s?(0,e.jsx)("span",{className:`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium ${s.className}`,children:j(s.key)}):null;return d?(0,e.jsxs)(q.$,{variant:"ghost",onClick:d,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,e.jsx)(m.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),t,u,v]}):(0,e.jsxs)("div",{children:[(0,e.jsxs)(q.$,{variant:"ghost",onClick:p?c:void 0,className:`w-full justify-start h-auto text-left flex items-center gap-2.5 py-4 ${p?"cursor-pointer hover:bg-background -mx-1 px-1 rounded-lg":""} transition-colors`,children:[b?(0,e.jsx)(n.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):(0,e.jsx)(l.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),t,u,v]}),b&&p&&(0,e.jsxs)("div",{className:"pb-3 pl-5 space-y-3",children:[a.description&&(0,e.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:a.description}),k.length>0&&(0,e.jsxs)("div",{className:"rounded-lg bg-background p-3 space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(o.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,e.jsx)("span",{className:"text-[11px] font-semibold text-foreground",children:h("taskAcceptanceCriteria")})]}),(0,e.jsx)("div",{className:"space-y-1.5",children:k.map((a,b)=>(0,e.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,e.jsx)("p",{className:"text-[11px] leading-snug text-foreground/80 flex-1",children:a.description}),!1!==a.required&&(0,e.jsx)("span",{className:"shrink-0 text-[10px] font-medium text-[#E65100] dark:text-[#F0A050]",children:i("required")})]},b))})]})]})]})}d()}catch(a){d(a)}})},69815:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{p:()=>n});var e=c(10837),f=c(9222),g=c(80251),h=c(6871),i=c(2852),j=c(99127),k=c(68797),l=c(7086),m=a([k]);function n({assignee:a,onReassign:b,editable:c}){let d=(0,f.c)("common"),m=!0===c&&"function"==typeof b,n=d(a?"reassign":"assign"),o=a?(0,e.jsxs)(e.Fragment,{children:[(0,l.bB)(a)?(0,e.jsx)(h.AgentAvatar,{name:a.name,size:28,className:"rounded-full"}):(0,e.jsx)(g.eu,{className:"h-7 w-7",children:(0,e.jsx)(g.q5,{className:"bg-border text-muted-foreground",children:a.name.charAt(0).toUpperCase()})}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"text-sm font-medium text-foreground",children:a.name}),(0,e.jsx)("div",{className:"text-xs text-muted-foreground",children:d((0,l.bB)(a)?"agent":"user")}),"agent_instance"===a.type&&a.instance&&(0,e.jsx)("div",{className:"mt-1",children:(0,e.jsx)(k.jQ,{cwd:a.instance.cwd,host:a.instance.host})})]})]}):(0,e.jsx)("span",{className:"text-sm text-muted-foreground",children:d("unassigned")}),p="mt-2 flex items-center gap-2.5 rounded-lg bg-background p-3";return(0,e.jsxs)("div",{children:[(0,e.jsx)(i.J,{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:d("assignee")}),m?(0,e.jsx)(j.Bc,{delayDuration:300,children:(0,e.jsxs)(j.m_,{children:[(0,e.jsx)(j.k$,{asChild:!0,children:(0,e.jsx)("button",{type:"button",onClick:b,"aria-label":n,className:`${p} w-full cursor-pointer text-left`,children:o})}),(0,e.jsx)(j.ZI,{children:n})]})}):(0,e.jsx)("div",{className:p,children:o})]})}k=(m.then?(await m)():m)[0],d()}catch(a){d(a)}})},72229:(a,b,c)=>{c.d(b,{b:()=>j});var d=c(21968),e=c(16551),f=c(10837),g="horizontal",h=["horizontal","vertical"],i=d.forwardRef((a,b)=>{var c;let{decorative:d,orientation:i=g,...j}=a,k=(c=i,h.includes(c))?i:g;return(0,f.jsx)(e.sG.div,{"data-orientation":k,...d?{role:"none"}:{"aria-orientation":"vertical"===k?k:void 0,role:"separator"},...j,ref:b})});i.displayName="Separator";var j=i},74733:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(56556).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"}]])},79030:(a,b,c)=>{c.d(b,{C:()=>f});var d=c(10837),e=c(96307);function f({done:a,total:b,size:c=14,stroke:f=2,className:g,color:h="#B26B3D",trackColor:i="#EAD9C8"}){let j=(c-f)/2,k=2*Math.PI*j,l=b>0?Math.min(1,Math.max(0,a/b)):0;return(0,d.jsxs)("svg",{width:c,height:c,viewBox:`0 0 ${c} ${c}`,className:(0,e.cn)("shrink-0",g),role:"img","aria-label":`${a}/${b}`,children:[(0,d.jsx)("circle",{cx:c/2,cy:c/2,r:j,fill:"none",stroke:i,strokeWidth:f}),l>0&&(0,d.jsx)("circle",{cx:c/2,cy:c/2,r:j,fill:"none",stroke:b>0&&a>=b?"#1D9E75":h,strokeWidth:f,strokeDasharray:k,strokeDashoffset:k*(1-l),strokeLinecap:"round",transform:`rotate(-90 ${c/2} ${c/2})`})]})}},79901:(a,b,c)=>{c.d(b,{U:()=>p});var d=c(10837),e=c(21968),f=c(9222),g=c(86460),h=c(20447),i=c(49599),j=c(42424),k=c(76172),l=c(54722),m=c(55183),n=c(42377);let o=(0,n.createServerReference)("603964df7ea6e899b7f77fb2fb1c2814093c4be728",n.callServer,void 0,n.findSourceMapURL,"getReportsForIdeaAction");function p({projectUuid:a,ideaUuid:b,proposals:c,onDocClick:n}){let p=(0,f.c)("idea"),q=(0,f.c)("documents"),[r,s]=(0,e.useState)([]),[t,u]=(0,e.useState)(!0),v=c.some(a=>"approved"===a.status),w=(0,e.useCallback)(async()=>{if(!v){s([]),u(!1);return}try{let c=await o(a,b);if(c.success){let a=[...c.data].sort((a,b)=>new Date(b.createdAt).getTime()-new Date(a.createdAt).getTime());s(a.map(a=>({uuid:a.uuid,title:a.title,type:a.type,content:a.content??null,createdAt:a.createdAt})))}}catch(a){l.q.error("Failed to fetch reports for idea:",a)}finally{u(!1)}},[a,b,v]);return((0,k.eV)("document",w),t)?v?(0,d.jsx)("div",{className:"flex items-center justify-center py-3",children:(0,d.jsx)(g.A,{className:"h-4 w-4 animate-spin text-primary"})}):null:0===r.length?null:(0,d.jsxs)("div",{className:"mt-6 space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,d.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-muted-foreground",children:p("reportsList")}),(0,d.jsx)("span",{className:"text-[11px] text-muted-foreground",children:r.length}),(0,d.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:["\xb7 ",p("reportsAcrossProposals")]})]}),(0,d.jsx)("div",{className:"space-y-0",children:r.map(a=>(0,d.jsxs)(j.$,{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:()=>n({title:a.title,type:"report",content:a.content??""}),children:[(0,d.jsx)(h.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,d.jsx)(i.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:q(m.y[a.type]||"typeOther")}),(0,d.jsx)("span",{className:"flex-1 min-w-0 text-left text-[13px] text-foreground truncate",children:a.title})]},a.uuid))})]})}},84722:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{G:()=>q});var e=c(10837),f=c(9222),g=c(86460),h=c(16235),i=c(2852),j=c(84819),k=c(25580),l=c(97450),m=c(31009),n=c(45148),o=c(69815),p=a([l,o]);function q({idea:a,elaboration:b,isLoading:c,onRefresh:d,onReassign:p,canReassign:q}){let r=(0,f.c)("ideaTracker"),s=(0,f.c)("common");return c?(0,e.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,e.jsx)(g.A,{className:"h-5 w-5 animate-spin text-primary"})}):(0,e.jsxs)(m.P.div,{variants:n.qG,initial:"initial",animate:"animate",children:[(0,e.jsx)(o.p,{assignee:a.assignee,onReassign:p,editable:q}),(0,e.jsx)(j.Separator,{className:"my-5 bg-secondary"}),b&&b.rounds.length>0?(0,e.jsx)("div",{children:(0,e.jsx)(k.R,{ideaUuid:a.uuid,elaboration:b,onRefresh:d})}):"open"===a.status?(0,e.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-8 text-center",children:[(0,e.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#FFF3E0] dark:bg-[#3a2a12]",children:(0,e.jsx)(h.A,{className:"h-5 w-5 text-[#E65100] dark:text-[#F0A050]"})}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium text-foreground",children:r("panel.elaborationNotStarted")}),(0,e.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:r("panel.elaborationNotStartedDesc")})]})]}):(0,e.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-8 text-center",children:[(0,e.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#E3F2FD] dark:bg-[#13253a]",children:(0,e.jsx)(h.A,{className:"h-5 w-5 text-[#1976D2] dark:text-[#5AA9F0]"})}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium text-foreground",children:r("panel.elaborationWaiting")}),(0,e.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:r("panel.elaborationWaitingDesc")})]})]}),a.content&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(j.Separator,{className:"my-5 bg-secondary"}),(0,e.jsxs)("div",{children:[(0,e.jsx)(i.J,{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:s("content")}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)("div",{className:"prose prose-sm max-w-none text-[13px] leading-relaxed text-foreground",children:(0,e.jsx)(l.MarkdownContent,{children:a.content})})})]})]})]})}[l,o]=p.then?(await p)():p,d()}catch(a){d(a)}})},97984:(a,b,c)=>{c.d(b,{p:()=>s});var d=c(10837),e=c(21968),f=c(9222),g=c(5797);let h=(0,c(56556).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 i=c(21289),j=c(51592),k=c(65956),l=c(20447),m=c(9810),n=c(90856),o=c(21790),p=c(49102),q=c(42377);q.callServer,q.findSourceMapURL;var r=c(77521);function s({idea:a,proposals:b,tasks:c,onSelectTask:q}){let s=(0,f.c)("ideaTracker"),t=(0,f.c)(),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(new Set),y=(0,e.useMemo)(()=>"open"===a.status?"idea_created":"elaborating"===a.status||0===b.length?"elaboration":b.some(a=>"approved"===a.status)&&c.length>0?"tasks":"proposal",[a.status,b,c]),z=(0,e.useMemo)(()=>{let a=["idea_created","elaboration","proposal","tasks"],b=a.indexOf(y);return a.map((a,c)=>({id:a,labelKey:({idea_created:"panel.timeline.ideaCreated",elaboration:"panel.timeline.elaboration",proposal:"panel.timeline.proposal",tasks:"panel.timeline.tasksProgress"})[a],status:c<b?"completed":c===b?"active":"upcoming",icon:({idea_created:(0,d.jsx)(g.A,{className:"h-3.5 w-3.5"}),elaboration:(0,d.jsx)(h,{className:"h-3.5 w-3.5"}),proposal:(0,d.jsx)(i.A,{className:"h-3.5 w-3.5"}),tasks:(0,d.jsx)(j.A,{className:"h-3.5 w-3.5"})})[a]}))},[y]),A=(0,e.useCallback)(a=>{x(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),B=(0,e.useMemo)(()=>"open"===a.status?s("panel.timeline.noElaboration"):"skipped"===a.elaborationStatus?s("panel.timeline.elaborationSkipped"):"resolved"===a.elaborationStatus&&u?s("panel.timeline.elaborationComplete",{count:u.summary.totalQuestions}):"elaborating"===a.status?s("panel.timeline.elaborationInProgress"):u&&u.summary.totalQuestions>0?s("panel.timeline.elaborationComplete",{count:u.summary.totalQuestions}):s("panel.timeline.noElaboration"),[a.status,a.elaborationStatus,u,s]),C=(0,e.useMemo)(()=>{if(0===b.length)return s("panel.timeline.noProposal");let a=b.filter(a=>"approved"===a.status).length,c=b.filter(a=>"pending"===a.status).length;if(a>0&&1===b.length)return s("panel.timeline.proposalApproved");if(a>0)return s("panel.timeline.proposalsApproved",{count:a,total:b.length});if(c>0)return s("panel.timeline.proposalPending");switch(b[0].status){case"draft":default:return s("panel.timeline.proposalDraft");case"rejected":return s("panel.timeline.proposalRejected")}},[b,s]),D=(0,e.useMemo)(()=>{let a=0,c=0;for(let d of b)a+=d.documentDrafts?.length??0,c+=d.taskDrafts?.length??0;return{docCount:a,taskDraftCount:c}},[b]),E=(0,e.useMemo)(()=>{let a=c.filter(a=>"done"===a.status||"closed"===a.status).length,b=c.filter(a=>"in_progress"===a.status).length;return{done:a,inProgress:b,toVerify:c.filter(a=>"to_verify"===a.status).length,open:c.filter(a=>"open"===a.status||"assigned"===a.status).length,total:c.length}},[c]);return(0,d.jsx)("div",{className:"space-y-0",children:z.map((e,f)=>{let g=w.has(e.id),h=f===z.length-1;return(0,d.jsxs)("div",{className:"flex gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col items-center w-5 shrink-0",children:[(0,d.jsx)("div",{className:"mt-1",children:"completed"===e.status?(0,d.jsx)("div",{className:"h-5 w-5 rounded-full bg-[#E0F2F1] dark:bg-[#12292a] flex items-center justify-center",children:(0,d.jsx)(m.A,{className:"h-3 w-3 text-[#00796B] dark:text-[#4FD1C0]"})}):"active"===e.status?(0,d.jsx)("div",{className:"h-5 w-5 rounded-full bg-primary flex items-center justify-center",children:(0,d.jsx)(n.A,{className:"h-2 w-2 fill-white text-white"})}):(0,d.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,d.jsx)(n.A,{className:"h-2 w-2 text-muted-foreground"})})}),!h&&(0,d.jsx)("div",{className:"flex-1 w-px bg-border mt-1 min-h-[8px]"})]}),(0,d.jsxs)("div",{className:`flex-1 min-w-0 ${h?"pb-0":"pb-4"}`,children:[(0,d.jsxs)("button",{onClick:()=>A(e.id),className:"flex items-center gap-1.5 w-full text-left group cursor-pointer",children:[g?(0,d.jsx)(o.A,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}):(0,d.jsx)(p.A,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,d.jsx)("span",{className:`text-[13px] font-medium ${"active"===e.status?"text-primary":"completed"===e.status?"text-foreground":"text-muted-foreground"}`,children:s(e.labelKey)}),!g&&(0,d.jsx)("span",{className:"text-[11px] text-muted-foreground truncate ml-1",children:(b=>{switch(b.id){case"idea_created":return a.createdBy?a.createdBy.name:"";case"elaboration":return B;case"proposal":return C;case"tasks":return c.length>0?s("panel.timeline.tasksComplete",{done:E.done,total:E.total}):s("panel.timeline.noTasks");default:return""}})(e)})]}),(e=>{let f=w.has(e.id);switch(e.id){case"idea_created":return f?(0,d.jsxs)("div",{className:"mt-2 space-y-1.5",children:[a.createdBy&&(0,d.jsx)("p",{className:"text-[12px] text-muted-foreground",children:s("panel.timeline.createdBy",{name:a.createdBy.name})}),(0,d.jsx)("p",{className:"text-[12px] text-muted-foreground",children:(0,r.fw)(a.createdAt,t)}),a.content&&(0,d.jsxs)("p",{className:"text-[12px] text-muted-foreground line-clamp-2",children:[a.content.slice(0,120),a.content.length>120?"...":""]})]}):null;case"elaboration":return f?(0,d.jsxs)("div",{className:"mt-2 space-y-1.5",children:[(0,d.jsx)("p",{className:"text-[12px] text-muted-foreground",children:B}),u&&u.rounds.length>0&&(0,d.jsx)("p",{className:"text-[12px] text-muted-foreground",children:s("panel.timeline.rounds",{count:u.rounds.length})})]}):null;case"proposal":return f?(0,d.jsxs)("div",{className:"mt-2 space-y-1.5",children:[(0,d.jsx)("p",{className:"text-[12px] text-muted-foreground",children:C}),b.length>0&&(0,d.jsxs)("div",{className:"space-y-1",children:[D.docCount>0&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-[12px] text-muted-foreground",children:[(0,d.jsx)(k.A,{className:"h-3 w-3"}),(0,d.jsx)("span",{children:s("panel.timeline.documents",{count:D.docCount})})]}),D.taskDraftCount>0&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-[12px] text-muted-foreground",children:[(0,d.jsx)(j.A,{className:"h-3 w-3"}),(0,d.jsx)("span",{children:s("panel.timeline.tasks",{count:D.taskDraftCount})})]})]})]}):null;case"tasks":return f?(0,d.jsx)("div",{className:"mt-2 space-y-2",children:0===c.length?(0,d.jsx)("p",{className:"text-[12px] text-muted-foreground",children:s("panel.timeline.noTasks")}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("div",{className:"flex-1 h-1.5 rounded-full bg-[#F0EDE8] dark:bg-[#1f1e1c] overflow-hidden flex",children:[E.done>0&&(0,d.jsx)("div",{className:"h-full bg-[#00796B]",style:{width:`${E.done/E.total*100}%`}}),E.inProgress>0&&(0,d.jsx)("div",{className:"h-full bg-[#1976D2]",style:{width:`${E.inProgress/E.total*100}%`}}),E.toVerify>0&&(0,d.jsx)("div",{className:"h-full bg-[#7B1FA2]",style:{width:`${E.toVerify/E.total*100}%`}})]}),(0,d.jsx)("span",{className:"text-[11px] text-muted-foreground shrink-0",children:s("panel.timeline.tasksComplete",{done:E.done,total:E.total})})]}),(0,d.jsxs)("div",{className:"space-y-1",children:[c.slice(0,5).map(a=>(0,d.jsxs)("button",{onClick:()=>q(a.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,d.jsx)(l.A,{className:"h-3 w-3 text-muted-foreground shrink-0 group-hover:text-primary"}),(0,d.jsx)("span",{className:`h-2 w-2 rounded-full shrink-0 ${(0,r.eT)(a.status)}`}),(0,d.jsx)("span",{className:"flex-1 text-[12px] text-foreground truncate group-hover:text-primary",children:a.title})]},a.uuid)),c.length>5&&(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground px-2",children:s("panel.timeline.moreItems",{count:c.length-5})})]})]})}):null;default:return null}})(e)]})]},e.id)})})}},98310:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{K:()=>q});var e=c(10837),f=c(21968),g=c(9222),h=c(35209),i=c(10694),j=c(42424),k=c(49599),l=c(74645),m=c(97450),n=c(55183),o=c(77521),p=a([m]);function q({title:a,type:b,content:c,mode:d="overlay",onClose:p,onBack:q}){let r=(0,g.c)("documents"),[s,t]=(0,f.useState)(!1),u="sidebyside"===d;return(0,e.jsxs)(e.Fragment,{children:[!u&&(0,e.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:p}),(0,e.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 ${u?`z-40 ${s?"":"animate-in slide-in-from-right duration-300"}`:`z-50 right-0 ${s?"":"animate-in slide-in-from-right duration-300"}`}`,style:u?{right:`${o.L8}px`}:void 0,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between border-b border-secondary px-6 py-5",children:[q&&(0,e.jsx)(j.$,{variant:"ghost",size:"icon",className:"mr-2 h-8 w-8 shrink-0",onClick:q,children:(0,e.jsx)(h.A,{className:"h-4 w-4 text-muted-foreground"})}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("h2",{className:"text-base font-semibold text-foreground truncate",children:a}),(0,e.jsx)("div",{className:"mt-1.5",children:(0,e.jsx)(k.E,{variant:"outline",className:"text-[10px] font-medium border-border text-muted-foreground bg-secondary px-2 py-0.5 font-mono",children:r(n.y[b]||"typeOther")})})]}),(0,e.jsx)(j.$,{variant:"outline",size:"icon",className:"ml-4 h-8 w-8 shrink-0 border-border",onClick:p,children:(0,e.jsx)(i.A,{className:"h-4 w-4 text-muted-foreground"})})]}),(0,e.jsx)(l.F,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:(0,e.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,e.jsx)(m.MarkdownContent,{children:(0,n.j)(c)})})})]})]})}m=(p.then?(await p)():p)[0],d()}catch(a){d(a)}})}};
1
+ "use strict";exports.id=1318,exports.ids=[1318],exports.modules={8495:(a,b,c)=>{c.d(b,{S:()=>h});var d=c(10837);c(21968);var e=c(9810),f=c(25711),g=c(96307);function h({className:a,...b}){return(0,d.jsx)(f.Root,{"data-slot":"checkbox",className:(0,g.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",a),...b,children:(0,d.jsx)(f.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:(0,d.jsx)(e.A,{className:"size-3.5"})})})}},9190:(a,b,c)=>{c.d(b,{n:()=>v});var d=c(10837),e=c(21968),f=c(9222),g=c(51592),h=c(49102),i=c(21790),j=c(20447),k=c(9810),l=c(97443),m=c(81512),n=c.n(m),o=c(76172),p=c(85282),q=c(22727),r=c(6871),s=c(7086),t=c(77521);let u=["in_progress","to_verify","open","assigned","done","closed"];function v({tasks:a,projectUuid:b,proposalUuids:c,onSelectTask:m}){let v=(0,f.c)("ideaTracker"),[w,x]=(0,e.useState)({}),y=(0,e.useMemo)(()=>a.map(a=>a.uuid),[a]),z=(0,e.useCallback)(async()=>{if(0===y.length)return;let a=await (0,p.h)(y);a.success&&a.data&&x(a.data)},[y]);(0,o.eV)("task",z);let A=(0,e.useMemo)(()=>{let b=[];for(let c of u){let d=a.filter(a=>a.status===c);d.length>0&&b.push({status:c,tasks:d})}let c=new Set(u),d=a.filter(a=>!c.has(a.status));return d.length>0&&b.push({status:"other",tasks:d}),b},[a]),[B,C]=(0,e.useState)(new Set),D=(0,e.useMemo)(()=>{let b=a.length,c=a.filter(a=>"done"===a.status||"closed"===a.status).length,d=0,e=0,f=0,g=0;for(let b of a)b.acceptanceSummary&&(d+=b.acceptanceSummary.total,e+=b.acceptanceSummary.passed,f+=b.acceptanceSummary.required,g+=b.acceptanceSummary.requiredPassed);return{total:b,done:c,acTotal:d,acPassed:e,acRequired:f,acRequiredPassed:g}},[a]);return 0===a.length?(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[(0,d.jsx)(g.A,{className:"h-8 w-8 text-muted-foreground"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:v("panel.taskList.noTasks")})]}):(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 rounded-lg bg-[#FAFAF7] dark:bg-[#1e1e1c] px-3 py-2",children:[(0,d.jsx)("span",{className:"text-[12px] text-muted-foreground",children:v("panel.taskList.summary",{done:D.done,total:D.total})}),D.acTotal>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"text-[12px] text-muted-foreground",children:"\xb7"}),(0,d.jsx)("span",{className:"text-[12px] text-muted-foreground",children:v("panel.taskList.acSummary",{passed:D.acRequiredPassed,total:D.acRequired})})]}),c.length>0&&(0,d.jsxs)(n(),{href:`/projects/${b}/tasks?proposalUuids=${c.join(",")}`,className:"ml-auto flex items-center gap-1 text-[13px] font-medium text-primary shrink-0",children:[v("panel.taskList.viewKanban"),(0,d.jsx)(h.A,{className:"h-3.5 w-3.5"})]})]}),A.map(a=>{let b=B.has(a.status);return(0,d.jsxs)("div",{children:[(0,d.jsxs)("button",{onClick:()=>{var b;return b=a.status,void C(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"flex items-center gap-2 w-full text-left py-1.5 group cursor-pointer",children:[b?(0,d.jsx)(h.A,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,d.jsx)(i.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,d.jsx)("span",{className:`h-2 w-2 rounded-full shrink-0 ${(0,t.eT)(a.status)}`}),(0,d.jsx)("span",{className:"text-[13px] font-medium text-foreground",children:function(a,b){switch(a){case"in_progress":return b("panel.taskList.inProgress");case"to_verify":return b("panel.taskList.toVerify");case"open":return b("panel.taskList.open");case"assigned":return b("panel.taskList.assigned");case"done":return b("panel.taskList.done");case"closed":return b("panel.taskList.closed");default:return a}}(a.status,v)}),(0,d.jsx)("span",{className:"text-[11px] text-muted-foreground ml-auto",children:a.tasks.length})]}),!b&&(0,d.jsx)("div",{className:"ml-3 space-y-0.5",children:a.tasks.map(a=>{let b=w[a.uuid]||0,c=a.acceptanceSummary;return(0,d.jsx)(q.D,{entityType:"task",entityUuid:a.uuid,badgeInside:!0,children:(0,d.jsxs)("button",{onClick:()=>m(a.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,d.jsx)(j.A,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0 group-hover:text-primary"}),(0,d.jsx)("span",{className:`h-1.5 w-1.5 rounded-full shrink-0 ${(0,t.eT)(a.status)}`}),(0,d.jsx)("span",{className:"flex-1 text-[13px] text-foreground truncate group-hover:text-primary",children:a.title}),c&&c.total>0&&(0,d.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,d.jsx)(k.A,{className:"h-2.5 w-2.5"}),c.requiredPassed,"/",c.required]}),a.assignee&&(0,d.jsxs)("span",{className:"shrink-0 inline-flex items-center gap-1 text-[10px] text-muted-foreground max-w-[72px] truncate",title:a.assignee.name,children:[(0,s.bB)(a.assignee)?(0,d.jsx)(r.AgentAvatar,{name:a.assignee.name,size:14,className:"shrink-0 rounded-full"}):(0,d.jsx)(l.A,{className:"h-2.5 w-2.5 shrink-0"}),a.assignee.name.split(/[@\s]/)[0]]}),b>0&&(0,d.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:v("panel.taskList.workersActive",{count:b}),children:b})]})},a.uuid)})})]},a.status)})]})}},17068:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{x:()=>k});var e=c(10837),f=c(21968),g=c(9222),h=c(40467),i=c(56828),j=a([i]);function k({ideaUuid:a,currentUserUuid:b,commentCount:c,onCommentCountChange:d}){let j=(0,g.c)("ideaTracker"),[k,l]=(0,f.useState)("comments");return(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"flex gap-1 rounded-lg bg-secondary p-0.5",children:[(0,e.jsxs)("button",{onClick:()=>l("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 ${"comments"===k?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-muted-foreground"}`,children:[j("panel.activityTab.comments"),c>0&&(0,e.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:c})]}),(0,e.jsx)("button",{onClick:()=>l("activity"),className:`flex-1 rounded-md px-3 py-1.5 text-[13px] font-medium transition-colors cursor-pointer ${"activity"===k?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-muted-foreground"}`,children:j("panel.activityTab.activity")})]}),(0,e.jsx)("div",{children:"activity"===k?(0,e.jsx)(h.v,{ideaUuid:a}):(0,e.jsx)(i.$m,{targetType:"idea",targetUuid:a,currentUserUuid:b,onCountChange:d,compact:!0})})]})}i=(j.then?(await j)():j)[0],d()}catch(a){d(a)}})},21289:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(56556).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"}]])},25711:(a,b,c)=>{c.r(b),c.d(b,{Checkbox:()=>v,CheckboxIndicator:()=>x,Indicator:()=>x,Root:()=>v,createCheckboxScope:()=>p,unstable_BubbleInput:()=>z,unstable_CheckboxBubbleInput:()=>z,unstable_CheckboxProvider:()=>s,unstable_CheckboxTrigger:()=>u,unstable_Provider:()=>s,unstable_Trigger:()=>u});var d=c(21968),e=c(96090),f=c(42990),g=c(22546),h=c(15035),i=c(29851),j=c(7579),k=c(5030),l=c(16551),m=c(10837),n="Checkbox",[o,p]=(0,f.A)(n),[q,r]=o(n);function s(a){let{__scopeCheckbox:b,checked:c,children:e,defaultChecked:f,disabled:g,form:i,name:j,onCheckedChange:k,required:l,value:o="on",internal_do_not_use_render:p}=a,[r,s]=(0,h.i)({prop:c,defaultProp:f??!1,onChange:k,caller:n}),[t,u]=d.useState(null),[v,w]=d.useState(null),x=d.useRef(!1),y=!t||!!i||!!t.closest("form"),z={checked:r,disabled:g,setChecked:s,control:t,setControl:u,name:j,form:i,value:o,hasConsumerStoppedPropagationRef:x,required:l,defaultChecked:!A(f)&&f,isFormControl:y,bubbleInput:v,setBubbleInput:w};return(0,m.jsx)(q,{scope:b,...z,children:"function"==typeof p?p(z):e})}var t="CheckboxTrigger",u=d.forwardRef(({__scopeCheckbox:a,onKeyDown:b,onClick:c,...f},h)=>{let{control:i,value:j,disabled:k,checked:n,required:o,setControl:p,setChecked:q,hasConsumerStoppedPropagationRef:s,isFormControl:u,bubbleInput:v}=r(t,a),w=(0,e.s)(h,p),x=d.useRef(n);return d.useEffect(()=>{let a=i?.form;if(a){let b=()=>q(x.current);return a.addEventListener("reset",b),()=>a.removeEventListener("reset",b)}},[i,q]),(0,m.jsx)(l.sG.button,{type:"button",role:"checkbox","aria-checked":A(n)?"mixed":n,"aria-required":o,"data-state":B(n),"data-disabled":k?"":void 0,disabled:k,value:j,...f,ref:w,onKeyDown:(0,g.mK)(b,a=>{"Enter"===a.key&&a.preventDefault()}),onClick:(0,g.mK)(c,a=>{q(a=>!!A(a)||!a),v&&u&&(s.current=a.isPropagationStopped(),s.current||a.stopPropagation())})})});u.displayName=t;var v=d.forwardRef((a,b)=>{let{__scopeCheckbox:c,name:d,checked:e,defaultChecked:f,required:g,disabled:h,value:i,onCheckedChange:j,form:k,...l}=a;return(0,m.jsx)(s,{__scopeCheckbox:c,checked:e,defaultChecked:f,disabled:h,required:g,onCheckedChange:j,name:d,form:k,value:i,internal_do_not_use_render:({isFormControl:a})=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(u,{...l,ref:b,__scopeCheckbox:c}),a&&(0,m.jsx)(z,{__scopeCheckbox:c})]})})});v.displayName=n;var w="CheckboxIndicator",x=d.forwardRef((a,b)=>{let{__scopeCheckbox:c,forceMount:d,...e}=a,f=r(w,c);return(0,m.jsx)(k.C,{present:d||A(f.checked)||!0===f.checked,children:(0,m.jsx)(l.sG.span,{"data-state":B(f.checked),"data-disabled":f.disabled?"":void 0,...e,ref:b,style:{pointerEvents:"none",...a.style}})})});x.displayName=w;var y="CheckboxBubbleInput",z=d.forwardRef(({__scopeCheckbox:a,...b},c)=>{let{control:f,hasConsumerStoppedPropagationRef:g,checked:h,defaultChecked:k,required:n,disabled:o,name:p,value:q,form:s,bubbleInput:t,setBubbleInput:u}=r(y,a),v=(0,e.s)(c,u),w=(0,i.Z)(h),x=(0,j.X)(f);d.useEffect(()=>{if(!t)return;let a=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,b=!g.current;if(w!==h&&a){let c=new Event("click",{bubbles:b});t.indeterminate=A(h),a.call(t,!A(h)&&h),t.dispatchEvent(c)}},[t,w,h,g]);let z=d.useRef(!A(h)&&h);return(0,m.jsx)(l.sG.input,{type:"checkbox","aria-hidden":!0,defaultChecked:k??z.current,required:n,disabled:o,name:p,value:q,form:s,...b,tabIndex:-1,ref:v,style:{...b.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function A(a){return"indeterminate"===a}function B(a){return A(a)?"indeterminate":a?"checked":"unchecked"}z.displayName=y},32382:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{D:()=>ag});var e=c(10837),f=c(21968),g=c(9222),h=c(68884),i=c(76549),j=c(33291),k=c(24364),l=c(87461),m=c(10694),n=c(86460),o=c(53109),p=c(74733),q=c(59876),r=c(98893),s=c(79543),t=c(42424),u=c(74645),v=c(49599),w=c(9994),x=c(20170),y=c(2852),z=c(88536),A=c(6019),B=c(76172),C=c(84722),D=c(64370),E=c(40417),F=c(49945),G=c(9190),H=c(17068),I=c(86104),J=c(98310),K=c(21502),L=c(76381),M=c(44963),N=c(78886),O=c(47888),P=c(94189),Q=c(14938),R=c(78853),S=c(78128),T=c(9369),U=c(79149),V=c(57270),W=c(26402),X=c(4069),Y=c(82367),Z=c(95627),$=c(76799),_=c(77078),aa=c(77697),ab=c(54722),ac=c(76664),ad=c(77521),ae=c(79030),af=a([C,D,H,I,J,M]);function ag({ideaUuid:a,projectUuid:b,currentUserUuid:c,onClose:d,onNavigate:af}){let ag=(0,g.c)(),ah=(0,g.c)("ideaTracker"),ai=(0,g.c)("status"),aj=(0,g.c)("ideaTracker.lineage"),ak=(0,h.r)(),[al,am]=(0,f.useState)(null),[an,ao]=(0,f.useState)(!0),[ap,aq]=(0,f.useState)(null),[ar,as]=(0,f.useState)([]),[at,au]=(0,f.useState)([]),[av,aw]=(0,f.useState)("overview"),[ax,ay]=(0,f.useState)(new Set(["overview"])),[az,aA]=(0,f.useState)(!1),[aB,aC]=(0,f.useState)(0),[aD,aE]=(0,f.useState)(!1),[aF,aG]=(0,f.useState)(!1),[aH,aI]=(0,f.useState)(null),[aJ,aK]=(0,f.useState)(!0),[aL,aM]=(0,f.useState)(!1),[aN,aO]=(0,f.useState)(null),[aP,aQ]=(0,f.useState)(!1),{start:aR,pickerState:aS,confirmPick:aT,cancelPick:aU,isResolving:aV}=(0,$.E)({reassignNoWake:aa.U,previewIdeaUuid:al?.uuid}),[aW,aX]=(0,f.useState)(!1),[aY,aZ]=(0,f.useState)(""),[a$,a_]=(0,f.useState)(""),[a0,a1]=(0,f.useState)(!1),[a2,a3]=(0,f.useState)(null),[a4,a5]=(0,f.useState)(!1),[a6,a7]=(0,f.useState)(!1),[a8,a9]=(0,f.useState)(!1),[ba,bb]=(0,f.useState)(!1),[bc,bd]=(0,f.useState)(null),[be,bf]=(0,f.useState)(null),[bg,bh]=(0,f.useState)(null),bi=(0,f.useCallback)(a=>{bh(null),bd(a)},[]),bj=(0,f.useCallback)(a=>{bd(null),bf(null),bh(a)},[]),[bk,bl]=(0,f.useState)(!1),[bm,bn]=(0,f.useState)(!1),bo=(0,f.useCallback)(a=>{let b=new URLSearchParams(window.location.search);b.set("tab",a),window.history.replaceState(null,"",`${window.location.pathname}?${b.toString()}`)},[]),bp=(0,f.useCallback)(async()=>{try{let b=await (0,P.c)(a);b.success?(am(b.data),aq(null)):aq(ah("Not found"===b.error?"panel.notFound":"panel.loadFailed"))}catch{aq(ah("panel.loadFailed"))}finally{ao(!1)}},[a,ah]);(0,B.eV)("idea",bp),(0,B.eV)("proposal",bp),(0,B.eV)("task",bp);let bq=al?.uuid,br=al?.status,bs=(0,f.useCallback)(async()=>{if(!bq||"open"===br)return void as([]);try{let a=await (0,Q.U)(b,bq);a.success&&as(a.data)}catch(a){ab.q.error("Failed to fetch proposals:",a)}},[b,bq,br]);(0,B.eV)("proposal",bs);let bt=(0,f.useCallback)(async()=>{let a=ar.filter(a=>"approved"===a.status);if(0===a.length)return void au([]);try{let c=(await Promise.all(a.map(a=>(0,R.c)(b,a.uuid)))).flatMap(a=>a.success&&a.data?a.data.map(a=>({uuid:a.uuid,title:a.title,status:a.status,commentCount:a.commentCount??0,assignee:a.assignee??null,acceptanceSummary:a.acceptanceSummary??null})):[]);au(c)}catch(a){ab.q.error("Failed to fetch tasks:",a)}},[b,ar]);(0,B.eV)("task",bt);let bu=(0,f.useCallback)(async()=>{if(!bq)return;let a=await (0,T.z)(bq);a.success&&a.data&&aI(a.data),aK(!1)},[bq]);(0,B.eV)("idea",bu);let bv=(0,f.useMemo)(()=>al?function(a,b,c){let d=["overview"];return d.push("elaboration"),b.length>0&&d.push("proposal"),c.length>0&&d.push("tasks"),d.push("activity"),d}(0,ar,at):["overview","activity"],[al,ar,at]);(0,f.useRef)(null),al&&al.badgeHint;let bw=(0,f.useMemo)(()=>at.filter(a=>"in_progress"===a.status||"assigned"===a.status||"to_verify"===a.status).length,[at]),bx=(0,f.useCallback)(()=>{if(!bc)return void bf(null);(0,S.Q)(bc).then(a=>{a.success&&bf(a.data)}).catch(a=>ab.q.error("Failed to load task details:",a))},[bc]);(0,B.eV)("task",bx);let by=()=>{aX(!1),aZ(al?.title||""),a_(al?.content||""),a3(null)},bz=async()=>{if(!al||!aY.trim())return void a3(ag("ideas.titleRequired"));a1(!0),a3(null);let a=await (0,N.J)({ideaUuid:al.uuid,projectUuid:b,title:aY.trim(),content:a$.trim()||null});a1(!1),a.success?(aX(!1),await bp(),ak.refresh()):a3(a.error||ag("ideas.updateFailed"))},bA=async()=>{if(!al)return;aG(!0);let a=await (0,O.Z)(al.uuid,b);aG(!1),a.success&&(d(),ak.refresh())},bB=async()=>{if(!al)return;aM(!0),aO(null);let a=await (0,U.e)(al.uuid);aM(!1),a.success?(aQ(!0),await bp(),ak.refresh()):aO(a.error||ag("elaboration.verifyFailed"))},bC=async a=>{if(!al)return;a5(!0),am({...al,isContainer:a});let c=await (0,N.J)({ideaUuid:al.uuid,projectUuid:b,title:al.title,content:al.content??null,isContainer:a});a5(!1),c.success?(await bp(),ak.refresh()):(am({...al,isContainer:!a}),i.oR.error(c.error||ag("ideas.updateFailed")))},bD=al?.derivedStatus||"todo",bE=al?.isContainer===!0,bF=null!==al,bG=(0,W.o)({ideaStatus:al?.status,elaborationStatus:al?.elaborationStatus,elaboration:aH});return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:d}),(0,e.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 ${bm?"":"animate-in slide-in-from-right duration-300"}`,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between border-b border-secondary px-6 py-5",children:[(0,e.jsx)("div",{className:"flex-1 min-w-0",children:an?(0,e.jsx)("div",{className:"h-5 w-40 animate-pulse rounded bg-secondary"}):al?aW?(0,e.jsx)("h2",{className:"text-base font-semibold text-foreground",children:ag("ideas.editIdea")}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:`text-[11px] font-semibold uppercase tracking-wider ${bE?"text-primary":"text-muted-foreground"}`,children:bE?aj("typeTheme"):aj("typeIdea")}),(0,e.jsx)("h2",{className:"text-base font-semibold text-foreground truncate",children:al.title}),(0,e.jsxs)("div",{className:"mt-1.5 flex items-center gap-2",children:[(0,e.jsx)(v.E,{className:ad._5[bD]||ad._5.todo,children:al.badgeHint?ah(`badge.${ad.Wl[al.badgeHint]||"open"}`):ai(ad.Bj[bD]||"todo")}),bE&&al.childProgress&&al.childProgress.total>0&&(0,e.jsxs)("span",{className:"flex items-center gap-1 text-xs font-medium text-primary",title:aj("childrenDone",{done:al.childProgress.done,total:al.childProgress.total}),children:[(0,e.jsx)(ae.C,{done:al.childProgress.done,total:al.childProgress.total,size:13,stroke:2}),al.childProgress.done,"/",al.childProgress.total]}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,ac.r)(al.createdAt)})]})]}):(0,e.jsx)("h2",{className:"text-base font-semibold text-foreground",children:ah("panel.notFound")})}),(0,e.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[al&&!aW&&(0,e.jsxs)(t.$,{variant:"outline",size:"sm",className:"h-8 gap-1.5 border-border px-2.5",onClick:()=>bb(!0),title:aj("deriveIdea"),"aria-label":aj("deriveIdea"),children:[(0,e.jsx)(j.A,{className:"h-3.5 w-3.5 text-primary"}),(0,e.jsx)("span",{className:"text-[12px] font-medium text-primary",children:aj("derive")})]}),al&&!aW&&(0,e.jsx)(t.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-border",onClick:()=>a7(!0),title:ag("ideas.actions.move"),"aria-label":ag("ideas.actions.move"),children:(0,e.jsx)(k.A,{className:"h-4 w-4 text-muted-foreground"})}),al&&"elaborated"!==al.status&&!aW&&(0,e.jsx)(t.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-border",onClick:()=>{al&&(aZ(al.title),a_(al.content||""),a3(null),aX(!0))},title:ag("ideas.editIdea"),children:(0,e.jsx)(l.A,{className:"h-4 w-4 text-muted-foreground"})}),(0,e.jsx)(t.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-border",onClick:aW?by:d,children:(0,e.jsx)(m.A,{className:"h-4 w-4 text-muted-foreground"})})]})]}),al&&!an&&!aW&&(0,e.jsx)("div",{className:"border-b border-secondary px-6",children:(0,e.jsx)("div",{className:"flex gap-0 -mb-px",children:bv.map(a=>(0,e.jsxs)("button",{onClick:()=>{aw(a),aA(!0),ay(b=>new Set([...b,a])),bo(a)},className:`relative flex items-center gap-1.5 px-3 py-2.5 text-[13px] font-medium transition-colors cursor-pointer ${av===a?"text-primary border-b-2 border-primary":"text-muted-foreground hover:text-muted-foreground"}`,children:[ah(`panel.tabs.${a}`),"tasks"===a&&bw>0&&(0,e.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:bw}),"activity"===a&&aB>0&&(0,e.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:aB})]},a))})}),(0,e.jsx)(u.F,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:(0,e.jsx)("div",{className:"flex min-h-full flex-col px-6 py-5",children:an?(0,e.jsxs)("div",{className:"flex flex-1 items-center justify-center py-12",children:[(0,e.jsx)(n.A,{className:"h-6 w-6 animate-spin text-primary"}),(0,e.jsx)("span",{className:"ml-2 text-sm text-muted-foreground",children:ah("loading")})]}):ap?(0,e.jsx)("div",{className:"flex flex-1 items-center justify-center py-12",children:(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:ap})}):al?aW?(0,e.jsxs)("div",{className:"space-y-5",children:[a2&&(0,e.jsx)("div",{className:"rounded-lg bg-destructive/10 p-3 text-sm text-destructive",children:a2}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(y.J,{htmlFor:"edit-title",className:"text-[13px] font-medium text-foreground",children:ag("ideas.titleLabel")}),(0,e.jsx)(w.p,{id:"edit-title",value:aY,onChange:a=>aZ(a.target.value),className:"border-border text-sm focus-visible:ring-primary",autoFocus:!0})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(y.J,{htmlFor:"edit-content",className:"text-[13px] font-medium text-foreground",children:ag("common.content")}),(0,e.jsx)(x.T,{id:"edit-content",value:a$,onChange:a=>a_(a.target.value),rows:8,className:"border-border text-sm resize-none focus-visible:ring-primary"})]})]}):(0,e.jsxs)(e.Fragment,{children:[ax.has("overview")&&(0,e.jsxs)("div",{style:{display:"overview"===av?"block":"none"},children:[(0,e.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,e.jsxs)("div",{className:"min-w-0 space-y-0.5",children:[(0,e.jsxs)(y.J,{htmlFor:"container-toggle",className:"flex items-center gap-1.5 text-[13px] font-medium text-foreground",children:[(0,e.jsx)(j.A,{className:"h-3.5 w-3.5 text-primary","aria-hidden":!0}),aj("container")]}),(0,e.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:aj("containerDescription")})]}),(0,e.jsx)(z.d,{id:"container-toggle",checked:bE,disabled:a4,onCheckedChange:bC,"aria-label":aj("makeContainer")})]}),(0,e.jsx)(E.p,{idea:al,proposals:ar,tasks:at,onSelectTask:bi}),(0,e.jsxs)("div",{className:"mt-5 space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(j.A,{className:"h-3.5 w-3.5 text-primary"}),(0,e.jsx)("span",{className:"text-[12px] font-semibold text-foreground/80",children:aj("title")})]}),(0,e.jsxs)(t.$,{variant:"outline",size:"sm",className:"h-7 gap-1 border-border px-2 text-[11px] text-muted-foreground",onClick:()=>a9(!0),children:[(0,e.jsx)(l.A,{className:"h-3 w-3"}),al.parentUuid?aj("changeParent"):aj("setParent")]})]}),al.parent?(0,e.jsxs)("button",{type:"button",onClick:()=>af?.(al.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,e.jsx)(o.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,e.jsx)("span",{className:"shrink-0 text-[12px] text-muted-foreground",children:aj("derivedFrom")}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate text-[12px] font-medium text-foreground/80",children:al.parent.title})]}):(0,e.jsx)("p",{className:"px-1 text-[12px] text-muted-foreground",children:aj("noParent")}),al.children&&al.children.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-1 pt-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("span",{className:"text-[12px] font-medium text-foreground/80",children:aj("derivedIdeas")}),(0,e.jsx)("span",{className:"text-[11px] text-muted-foreground",children:al.children.length})]}),(()=>{let a=al.children.filter(a=>"done"===a.derivedStatus).length,b=al.children.length;return(0,e.jsxs)("span",{className:"flex items-center gap-1.5 text-[12px] text-muted-foreground",title:aj("childrenDone",{done:a,total:b}),children:[(0,e.jsx)(ae.C,{done:a,total:b,size:14,stroke:2}),a,"/",b]})})()]}),(0,e.jsx)("div",{className:"overflow-hidden rounded-lg border border-[#EFEBE3] dark:border-[#2a2a2e]",children:al.children.map((a,b)=>(0,e.jsxs)("div",{children:[b>0&&(0,e.jsx)("div",{className:"h-px bg-[#F0EEEA] dark:bg-[#1f1e1c]"}),(0,e.jsxs)("button",{type:"button",onClick:()=>af?.(a.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,e.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,e.jsx)(p.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,e.jsx)("span",{className:"truncate text-[12px] text-foreground",children:a.title})]}),(0,e.jsx)(v.E,{className:`shrink-0 border-0 text-[10px] ${ad._5[a.derivedStatus]||ad._5.todo}`,children:ai(ad.Bj[a.derivedStatus]||"todo")})]})]},a.uuid))})]})]}),(0,e.jsx)(F.U,{projectUuid:b,ideaUuid:al.uuid,proposals:ar,onDocClick:bj}),(0,e.jsxs)("div",{className:"mt-5 space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(q.A,{className:"h-3.5 w-3.5 text-primary"}),(0,e.jsx)("span",{className:"text-[12px] font-semibold text-foreground/80",children:ag("references.title")})]}),(0,e.jsx)(Z.ReferencesSection,{targetType:"idea",targetUuid:al.uuid,canWrite:!0,compact:!0})]})]}),bv.includes("elaboration")&&ax.has("elaboration")&&(0,e.jsx)("div",{style:{display:"elaboration"===av?"block":"none"},children:(0,e.jsx)(C.G,{idea:al,elaboration:aH,isLoading:aJ,onRefresh:async()=>{await bu(),await bp()},onReassign:()=>aE(!0),canReassign:bF})}),bv.includes("proposal")&&ax.has("proposal")&&(0,e.jsx)("div",{style:{display:"proposal"===av?"block":"none"},children:(0,e.jsx)(D.k,{idea:al,projectUuid:b,onTaskClick:bi,onDocClick:bj,initialProposals:ar})}),bv.includes("tasks")&&ax.has("tasks")&&(0,e.jsx)("div",{style:{display:"tasks"===av?"block":"none"},children:(0,e.jsx)(G.n,{tasks:at,projectUuid:b,proposalUuids:ar.filter(a=>"approved"===a.status).map(a=>a.uuid),onSelectTask:bi})}),ax.has("activity")&&(0,e.jsx)("div",{style:{display:"activity"===av?"block":"none"},children:(0,e.jsx)(H.x,{ideaUuid:al.uuid,currentUserUuid:c,commentCount:aB,onCommentCountChange:aC})})]}):null})}),al&&!an&&(0,e.jsx)("div",{className:"border-t border-secondary px-6 py-4",children:aW?(0,e.jsxs)("div",{className:"flex items-center justify-end gap-3",children:[(0,e.jsx)(t.$,{variant:"outline",className:"border-border",onClick:by,disabled:a0,children:ag("common.cancel")}),(0,e.jsx)(t.$,{className:"bg-primary hover:bg-[#B56A42] text-white",onClick:bz,disabled:a0||!aY.trim(),children:a0?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(n.A,{className:"mr-2 h-4 w-4 animate-spin"}),ag("common.save")]}):ag("common.save")})]}):(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,e.jsxs)("div",{className:"flex-1 min-w-0 flex flex-wrap items-center gap-2",children:[!bE&&(0,e.jsxs)(e.Fragment,{children:[bG&&!aP&&(0,e.jsx)(t.$,{className:"bg-primary hover:bg-[#B56A42] text-white",onClick:()=>{al&&aR({ideaUuid:al.uuid,wake:bB})},disabled:aL||aV,children:aL?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(n.A,{className:"mr-2 h-4 w-4 animate-spin"}),ag("elaboration.verifying")]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(r.A,{className:"mr-2 h-4 w-4"}),ag("elaboration.verifyButton")]})}),aP&&(0,e.jsx)("span",{className:"text-[11px] text-[#00796B] dark:text-[#4FD1C0]",children:ag("elaboration.verifiedQueuedHint")}),aN&&(0,e.jsx)("span",{className:"text-[11px] text-destructive",children:aN}),(0,e.jsx)(X.w,{ideaUuid:al.uuid,assignee:al.assignee,assigneeName:al.assignee?.name,proposals:ar,tasks:at,onStarted:()=>{bp()}}),(0,e.jsx)(Y.s,{ideaUuid:al.uuid,assignee:al.assignee,assigneeName:al.assignee?.name,proposals:ar,tasks:at,onStarted:()=>{bp()}})]}),bE&&(0,e.jsx)("span",{className:"text-[11px] text-muted-foreground",children:aj("containerHint")})]}),(0,e.jsxs)(A.Lt,{children:[(0,e.jsx)(A.tv,{asChild:!0,children:(0,e.jsx)(t.$,{variant:"outline",size:"icon",className:"shrink-0 h-8 w-8 border-border text-[#EF4444] dark:text-[#F0897E] hover:bg-[#FFEBEE] dark:hover:bg-[#331619] hover:text-[#EF4444] hover:border-[#EF4444]",children:(0,e.jsx)(s.A,{className:"h-4 w-4"})})}),(0,e.jsxs)(A.EO,{children:[(0,e.jsxs)(A.wd,{children:[(0,e.jsx)(A.r7,{children:ag("ideas.deleteIdea")}),(0,e.jsx)(A.$v,{children:ag("ideas.deleteIdeaConfirm",{title:al.title})})]}),(0,e.jsxs)(A.ck,{children:[(0,e.jsx)(A.Zr,{children:ag("common.cancel")}),(0,e.jsx)(A.Rx,{variant:"destructive",onClick:bA,disabled:aF,children:aF?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(n.A,{className:"mr-2 h-4 w-4 animate-spin"}),ag("common.delete")]}):ag("common.delete")})]})]})]})]})})]}),(0,e.jsx)(K.h,{open:a6,onOpenChange:a7,ideaUuid:a,projectUuid:b,onMoved:()=>d()}),al&&(0,e.jsx)(L.d,{open:a8,onOpenChange:a9,ideaUuid:al.uuid,ideaTitle:al.title,projectUuid:b,currentParentUuid:al.parentUuid??null,descendantUuids:al.descendantUuids??[],onChanged:bp}),al&&(0,e.jsx)(M.i,{open:ba,onOpenChange:bb,projectUuid:b,parentUuid:al.uuid,parentTitle:al.title,onCreated:a=>{i.oR.success(aj("deriveIdea")),ak.refresh(),af?.(a)}}),aD&&al&&(0,e.jsx)(V.i,{idea:{uuid:al.uuid,title:al.title,content:al.content,status:al.status,assignee:al.assignee?{type:al.assignee.type,uuid:al.assignee.uuid,name:al.assignee.name}:null},projectUuid:b,currentUserUuid:c,onClose:()=>{aE(!1),bp()}}),(0,e.jsx)(_.V,{open:null!==aS,agentName:al?.assignee?.name??"",instances:aS?.instances??[],onConfirm:aT,onCancel:aU}),bc&&be&&(0,e.jsx)(I.v,{task:be,projectUuid:b,currentUserUuid:c,mode:bk?"sidebyside":"overlay",onClose:()=>{bd(null),bf(null)},onBack:()=>{bd(null),bf(null)}}),bg&&(0,e.jsx)(J.K,{title:bg.title,type:bg.type,content:bg.content,mode:bk?"sidebyside":"overlay",onClose:()=>bh(null),onBack:()=>bh(null)})]})}[C,D,H,I,J,M]=af.then?(await af)():af,d()}catch(a){d(a)}})},33291:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(56556).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"}]])},40417:(a,b,c)=>{c.d(b,{p:()=>s});var d=c(10837),e=c(21968),f=c(9222),g=c(5797);let h=(0,c(56556).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 i=c(21289),j=c(51592),k=c(65956),l=c(20447),m=c(9810),n=c(90856),o=c(21790),p=c(49102),q=c(42377);q.callServer,q.findSourceMapURL;var r=c(77521);function s({idea:a,proposals:b,tasks:c,onSelectTask:q}){let s=(0,f.c)("ideaTracker"),t=(0,f.c)(),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(new Set),y=(0,e.useMemo)(()=>"open"===a.status?"idea_created":"elaborating"===a.status||0===b.length?"elaboration":b.some(a=>"approved"===a.status)&&c.length>0?"tasks":"proposal",[a.status,b,c]),z=(0,e.useMemo)(()=>{let a=["idea_created","elaboration","proposal","tasks"],b=a.indexOf(y);return a.map((a,c)=>({id:a,labelKey:({idea_created:"panel.timeline.ideaCreated",elaboration:"panel.timeline.elaboration",proposal:"panel.timeline.proposal",tasks:"panel.timeline.tasksProgress"})[a],status:c<b?"completed":c===b?"active":"upcoming",icon:({idea_created:(0,d.jsx)(g.A,{className:"h-3.5 w-3.5"}),elaboration:(0,d.jsx)(h,{className:"h-3.5 w-3.5"}),proposal:(0,d.jsx)(i.A,{className:"h-3.5 w-3.5"}),tasks:(0,d.jsx)(j.A,{className:"h-3.5 w-3.5"})})[a]}))},[y]),A=(0,e.useCallback)(a=>{x(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),B=(0,e.useMemo)(()=>"open"===a.status?s("panel.timeline.noElaboration"):"skipped"===a.elaborationStatus?s("panel.timeline.elaborationSkipped"):"resolved"===a.elaborationStatus&&u?s("panel.timeline.elaborationComplete",{count:u.summary.totalQuestions}):"elaborating"===a.status?s("panel.timeline.elaborationInProgress"):u&&u.summary.totalQuestions>0?s("panel.timeline.elaborationComplete",{count:u.summary.totalQuestions}):s("panel.timeline.noElaboration"),[a.status,a.elaborationStatus,u,s]),C=(0,e.useMemo)(()=>{if(0===b.length)return s("panel.timeline.noProposal");let a=b.filter(a=>"approved"===a.status).length,c=b.filter(a=>"pending"===a.status).length;if(a>0&&1===b.length)return s("panel.timeline.proposalApproved");if(a>0)return s("panel.timeline.proposalsApproved",{count:a,total:b.length});if(c>0)return s("panel.timeline.proposalPending");switch(b[0].status){case"draft":default:return s("panel.timeline.proposalDraft");case"rejected":return s("panel.timeline.proposalRejected")}},[b,s]),D=(0,e.useMemo)(()=>{let a=0,c=0;for(let d of b)a+=d.documentDrafts?.length??0,c+=d.taskDrafts?.length??0;return{docCount:a,taskDraftCount:c}},[b]),E=(0,e.useMemo)(()=>{let a=c.filter(a=>"done"===a.status||"closed"===a.status).length,b=c.filter(a=>"in_progress"===a.status).length;return{done:a,inProgress:b,toVerify:c.filter(a=>"to_verify"===a.status).length,open:c.filter(a=>"open"===a.status||"assigned"===a.status).length,total:c.length}},[c]);return(0,d.jsx)("div",{className:"space-y-0",children:z.map((e,f)=>{let g=w.has(e.id),h=f===z.length-1;return(0,d.jsxs)("div",{className:"flex gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col items-center w-5 shrink-0",children:[(0,d.jsx)("div",{className:"mt-1",children:"completed"===e.status?(0,d.jsx)("div",{className:"h-5 w-5 rounded-full bg-[#E0F2F1] dark:bg-[#12292a] flex items-center justify-center",children:(0,d.jsx)(m.A,{className:"h-3 w-3 text-[#00796B] dark:text-[#4FD1C0]"})}):"active"===e.status?(0,d.jsx)("div",{className:"h-5 w-5 rounded-full bg-primary flex items-center justify-center",children:(0,d.jsx)(n.A,{className:"h-2 w-2 fill-white text-white"})}):(0,d.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,d.jsx)(n.A,{className:"h-2 w-2 text-muted-foreground"})})}),!h&&(0,d.jsx)("div",{className:"flex-1 w-px bg-border mt-1 min-h-[8px]"})]}),(0,d.jsxs)("div",{className:`flex-1 min-w-0 ${h?"pb-0":"pb-4"}`,children:[(0,d.jsxs)("button",{onClick:()=>A(e.id),className:"flex items-center gap-1.5 w-full text-left group cursor-pointer",children:[g?(0,d.jsx)(o.A,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}):(0,d.jsx)(p.A,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,d.jsx)("span",{className:`text-[13px] font-medium ${"active"===e.status?"text-primary":"completed"===e.status?"text-foreground":"text-muted-foreground"}`,children:s(e.labelKey)}),!g&&(0,d.jsx)("span",{className:"text-[11px] text-muted-foreground truncate ml-1",children:(b=>{switch(b.id){case"idea_created":return a.createdBy?a.createdBy.name:"";case"elaboration":return B;case"proposal":return C;case"tasks":return c.length>0?s("panel.timeline.tasksComplete",{done:E.done,total:E.total}):s("panel.timeline.noTasks");default:return""}})(e)})]}),(e=>{let f=w.has(e.id);switch(e.id){case"idea_created":return f?(0,d.jsxs)("div",{className:"mt-2 space-y-1.5",children:[a.createdBy&&(0,d.jsx)("p",{className:"text-[12px] text-muted-foreground",children:s("panel.timeline.createdBy",{name:a.createdBy.name})}),(0,d.jsx)("p",{className:"text-[12px] text-muted-foreground",children:(0,r.fw)(a.createdAt,t)}),a.content&&(0,d.jsxs)("p",{className:"text-[12px] text-muted-foreground line-clamp-2",children:[a.content.slice(0,120),a.content.length>120?"...":""]})]}):null;case"elaboration":return f?(0,d.jsxs)("div",{className:"mt-2 space-y-1.5",children:[(0,d.jsx)("p",{className:"text-[12px] text-muted-foreground",children:B}),u&&u.rounds.length>0&&(0,d.jsx)("p",{className:"text-[12px] text-muted-foreground",children:s("panel.timeline.rounds",{count:u.rounds.length})})]}):null;case"proposal":return f?(0,d.jsxs)("div",{className:"mt-2 space-y-1.5",children:[(0,d.jsx)("p",{className:"text-[12px] text-muted-foreground",children:C}),b.length>0&&(0,d.jsxs)("div",{className:"space-y-1",children:[D.docCount>0&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-[12px] text-muted-foreground",children:[(0,d.jsx)(k.A,{className:"h-3 w-3"}),(0,d.jsx)("span",{children:s("panel.timeline.documents",{count:D.docCount})})]}),D.taskDraftCount>0&&(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-[12px] text-muted-foreground",children:[(0,d.jsx)(j.A,{className:"h-3 w-3"}),(0,d.jsx)("span",{children:s("panel.timeline.tasks",{count:D.taskDraftCount})})]})]})]}):null;case"tasks":return f?(0,d.jsx)("div",{className:"mt-2 space-y-2",children:0===c.length?(0,d.jsx)("p",{className:"text-[12px] text-muted-foreground",children:s("panel.timeline.noTasks")}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("div",{className:"flex-1 h-1.5 rounded-full bg-[#F0EDE8] dark:bg-[#1f1e1c] overflow-hidden flex",children:[E.done>0&&(0,d.jsx)("div",{className:"h-full bg-[#00796B]",style:{width:`${E.done/E.total*100}%`}}),E.inProgress>0&&(0,d.jsx)("div",{className:"h-full bg-[#1976D2]",style:{width:`${E.inProgress/E.total*100}%`}}),E.toVerify>0&&(0,d.jsx)("div",{className:"h-full bg-[#7B1FA2]",style:{width:`${E.toVerify/E.total*100}%`}})]}),(0,d.jsx)("span",{className:"text-[11px] text-muted-foreground shrink-0",children:s("panel.timeline.tasksComplete",{done:E.done,total:E.total})})]}),(0,d.jsxs)("div",{className:"space-y-1",children:[c.slice(0,5).map(a=>(0,d.jsxs)("button",{onClick:()=>q(a.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,d.jsx)(l.A,{className:"h-3 w-3 text-muted-foreground shrink-0 group-hover:text-primary"}),(0,d.jsx)("span",{className:`h-2 w-2 rounded-full shrink-0 ${(0,r.eT)(a.status)}`}),(0,d.jsx)("span",{className:"flex-1 text-[12px] text-foreground truncate group-hover:text-primary",children:a.title})]},a.uuid)),c.length>5&&(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground px-2",children:s("panel.timeline.moreItems",{count:c.length-5})})]})]})}):null;default:return null}})(e)]})]},e.id)})})}},40467:(a,b,c)=>{c.d(b,{v:()=>k});var d=c(10837),e=c(21968),f=c(9222),g=c(86460),h=c(2852),i=c(87720),j=c(77521);function k({ideaUuid:a}){let b=(0,f.c)(),[c,k]=(0,e.useState)([]),[l,m]=(0,e.useState)(!0);return(0,e.useCallback)(async()=>{m(!0),k((await (0,i.x)(a)).activities),m(!1)},[a]),(0,d.jsxs)("div",{className:"mt-5",children:[(0,d.jsx)(h.J,{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:b("common.activity")}),(0,d.jsx)("div",{className:"mt-2",children:l?(0,d.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,d.jsx)(g.A,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):0===c.length?(0,d.jsx)("p",{className:"text-sm text-muted-foreground italic",children:b("common.noActivity")}):c.map((a,e)=>(0,d.jsxs)("div",{className:"flex items-stretch gap-2.5",children:[(0,d.jsxs)("div",{className:"flex flex-col items-center w-2 shrink-0",children:[(0,d.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full border-[1.5px] border-[#D9D9D9] dark:border-[#3a3a40] bg-card"}),e<c.length-1&&(0,d.jsx)("div",{className:"flex-1 w-px bg-border mt-1"})]}),(0,d.jsxs)("div",{className:"flex-1 pb-3",children:[(0,d.jsx)("p",{className:"text-[13px] text-foreground",children:function(a,b){let{action:c,actorName:d}=a;switch(c){case"created":case"idea_created":return b("activity.ideaCreated",{actor:d});case"assigned":case"idea_assigned":return b("activity.ideaAssigned",{actor:d});case"claimed":case"idea_claimed":return b("activity.ideaClaimed",{actor:d});case"released":case"idea_released":return b("activity.ideaReleased",{actor:d});case"status_changed":case"idea_status_changed":return b("activity.ideaStatusChanged",{actor:d});case"edited":case"idea_edited":return b("activity.ideaEdited",{actor:d});case"reparented":case"idea_reparented":return b("activity.ideaReparented",{actor:d});case"elaboration_started":return b("activity.elaborationStarted",{actor:d});case"elaboration_answered":return b("activity.elaborationAnswered",{actor:d});case"elaboration_skipped":return b("activity.elaborationSkipped",{actor:d});case"elaboration_resolved":return b("activity.elaborationResolved",{actor:d});case"elaboration_followup":return b("activity.elaborationFollowup",{actor:d});default:return b("activity.genericAction",{actor:d,action:c})}}(a,b)}),(0,d.jsx)("p",{className:"text-[11px] text-muted-foreground",children:(0,j.fw)(a.createdAt,b)})]})]},a.uuid))})]})}},44963:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{i:()=>u});var e=c(10837),f=c(21968),g=c(9222),h=c(86460),i=c(42424),j=c(11568),k=c(9994),l=c(20170),m=c(2852),n=c(8495),o=c(94372),p=c(42087),q=c(93524),r=c(70028),s=c(68797),t=a([s]);function u({open:a,onOpenChange:b,projectUuid:c,onCreated:d,parentUuid:t,parentTitle:u}){let v=(0,g.c)("ideaTracker"),w=(0,g.c)("ideaTracker.lineage"),x=!!t,y=(0,g.c)("common"),[z,A]=(0,f.useState)(""),[B,C]=(0,f.useState)(""),[D,E]=(0,f.useState)(!1),[F,G]=(0,f.useState)(!1),[H,I]=(0,f.useState)(null),[J,K]=(0,f.useState)(!1),[L,M]=(0,f.useState)(!1),N=(0,r.kz)(),O=(N?.connections??[]).some(a=>"online"===a.effectiveStatus),[P,Q]=(0,f.useState)("form"),R=x?"form":P,S=async()=>{let a=z.trim();if(a){G(!0),I(null);try{let e=await fetch(`/api/projects/${c}/ideas`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:a,content:B.trim()||void 0,...t?{parentUuid:t}:{},...D?{isContainer:!0}:{}})}),f=await e.json();f.success&&f.data?.uuid?(A(""),C(""),E(!1),b(!1),d?.(f.data.uuid)):I(f.error||v("error.createFailed"))}catch{I(v("error.createFailed"))}finally{G(!1)}}},T=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"space-y-4 py-2",children:[(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(m.J,{htmlFor:"idea-title",children:v("newIdea.ideaTitle")}),(0,e.jsx)(k.p,{id:"idea-title",value:z,onChange:a=>A(a.target.value),placeholder:v("newIdea.titlePlaceholder"),autoFocus:!0,onKeyDown:a=>{!(0,p.P)(a)&&"Enter"===a.key&&!a.shiftKey&&z.trim()&&(a.preventDefault(),S())}})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsxs)(m.J,{htmlFor:"idea-content",children:[v("newIdea.description"),(0,e.jsxs)("span",{className:"ml-1 text-xs font-normal text-muted-foreground",children:["(",y("optional"),")"]})]}),(0,e.jsx)(l.T,{id:"idea-content",value:B,onChange:a=>C(a.target.value),placeholder:v("newIdea.descriptionPlaceholder"),rows:4,className:"resize-none"})]}),(0,e.jsxs)("div",{className:"flex items-start gap-2",children:[(0,e.jsx)(n.S,{id:"idea-is-container",checked:D,onCheckedChange:a=>E(!0===a),className:"mt-0.5"}),(0,e.jsxs)("div",{className:"grid gap-1 leading-none",children:[(0,e.jsx)(m.J,{htmlFor:"idea-is-container",className:"cursor-pointer",children:w("makeContainer")}),(0,e.jsx)("p",{className:"text-xs font-normal text-muted-foreground",children:w("containerHint")})]})]}),H&&(0,e.jsx)("div",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-[12px] text-destructive",children:H})]}),(0,e.jsxs)(j.Es,{children:[(0,e.jsx)(i.$,{variant:"outline",onClick:()=>b(!1),disabled:F,children:y("cancel")}),(0,e.jsxs)(i.$,{onClick:S,disabled:F||!z.trim(),className:"bg-primary hover:bg-[#B56A42] text-white",children:[F?(0,e.jsx)(h.A,{className:"mr-2 h-4 w-4 animate-spin"}):null,y("create")]})]})]}),U=async a=>{let b=await (0,q.tm)("/api/ideas/conversational",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectUuid:c,agentUuid:a.agentUuid,connectionUuid:a.connectionUuid,descriptionText:a.userText,...J?{decompose:!0}:{}})});if(!b.ok){let a=null;try{let c=await b.json();"string"==typeof c?.error&&c.error&&(a=c.error)}catch{}throw new s.fF(b.status,a)}let d=null;try{let a=await b.json();a?.success&&a.data?.session&&(d=a.data.session)}catch{}if(!d)throw new s.fF(b.status,null);return d},V=(0,e.jsxs)("div",{className:"space-y-3 py-2",children:[(0,e.jsxs)("div",{className:"flex items-start gap-2",children:[(0,e.jsx)(n.S,{id:"idea-decompose",checked:J,onCheckedChange:a=>K(!0===a),className:"mt-0.5"}),(0,e.jsxs)("div",{className:"grid gap-1 leading-none",children:[(0,e.jsx)(m.J,{htmlFor:"idea-decompose",className:"cursor-pointer",children:v("newIdea.decompose")}),(0,e.jsx)("p",{className:"text-xs font-normal text-muted-foreground",children:v("newIdea.decomposeHint")})]})]}),(0,e.jsx)(s.jH,{projectUuid:c,dispatch:U,onStarted:a=>{b(!1),N?.openChatForSession(a)}})]});return(0,e.jsx)(j.lG,{open:a,onOpenChange:b,children:(0,e.jsxs)(j.Cf,{className:"sm:max-w-[480px]",children:[(0,e.jsxs)(j.c7,{children:[(0,e.jsx)(j.L3,{children:x?w("deriveIdea"):v("newIdea.title")}),x&&u&&(0,e.jsxs)("p",{className:"text-[13px] text-muted-foreground",children:[w("derivedFrom")," \xb7 ",u]})]}),!x&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(o.tU,{value:R,onValueChange:a=>Q(a),children:(0,e.jsxs)(o.j7,{className:"grid w-full grid-cols-2",children:[(0,e.jsx)(o.Xi,{value:"form",children:v("newIdea.modeForm")}),(0,e.jsx)(o.Xi,{value:"conversation",disabled:!O&&!L,children:v("newIdea.modeConversation")})]})}),!O&&(0,e.jsxs)("div",{className:"rounded-xl border border-[#EFEBE4] dark:border-[#2a2a2e] bg-[#FCFBF8] dark:bg-[#1e1d1b] px-3 py-2",children:[(0,e.jsx)("p",{className:"px-1 pt-1 text-[12px] font-medium text-muted-foreground",children:v("newIdea.modeConversationOfflineHint")}),(0,e.jsx)(s.Bs,{variant:"compact"})]})]}),"form"===R?T:V]})})}s=(t.then?(await t)():t)[0],d()}catch(a){d(a)}})},49945:(a,b,c)=>{c.d(b,{U:()=>p});var d=c(10837),e=c(21968),f=c(9222),g=c(86460),h=c(20447),i=c(49599),j=c(42424),k=c(76172),l=c(54722),m=c(55183),n=c(42377);let o=(0,n.createServerReference)("60310efd4f08ad907760bfb209049b8251f7210668",n.callServer,void 0,n.findSourceMapURL,"getReportsForIdeaAction");function p({projectUuid:a,ideaUuid:b,proposals:c,onDocClick:n}){let p=(0,f.c)("idea"),q=(0,f.c)("documents"),[r,s]=(0,e.useState)([]),[t,u]=(0,e.useState)(!0),v=c.some(a=>"approved"===a.status),w=(0,e.useCallback)(async()=>{if(!v){s([]),u(!1);return}try{let c=await o(a,b);if(c.success){let a=[...c.data].sort((a,b)=>new Date(b.createdAt).getTime()-new Date(a.createdAt).getTime());s(a.map(a=>({uuid:a.uuid,title:a.title,type:a.type,content:a.content??null,createdAt:a.createdAt})))}}catch(a){l.q.error("Failed to fetch reports for idea:",a)}finally{u(!1)}},[a,b,v]);return((0,k.eV)("document",w),t)?v?(0,d.jsx)("div",{className:"flex items-center justify-center py-3",children:(0,d.jsx)(g.A,{className:"h-4 w-4 animate-spin text-primary"})}):null:0===r.length?null:(0,d.jsxs)("div",{className:"mt-6 space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,d.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-muted-foreground",children:p("reportsList")}),(0,d.jsx)("span",{className:"text-[11px] text-muted-foreground",children:r.length}),(0,d.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:["\xb7 ",p("reportsAcrossProposals")]})]}),(0,d.jsx)("div",{className:"space-y-0",children:r.map(a=>(0,d.jsxs)(j.$,{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:()=>n({title:a.title,type:"report",content:a.content??""}),children:[(0,d.jsx)(h.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,d.jsx)(i.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:q(m.y[a.type]||"typeOther")}),(0,d.jsx)("span",{className:"flex-1 min-w-0 text-left text-[13px] text-foreground truncate",children:a.title})]},a.uuid))})]})}},53109:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(56556).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"}]])},55183:(a,b,c)=>{function d(a){return a.replace(/\\n/g,"\n")}c.d(b,{j:()=>d,y:()=>e});let e={prd:"typePrd",tech_design:"typeTechDesign",adr:"typeAdr",spec:"typeSpec",guide:"typeGuide",design:"typeDesign",note:"typeNote",report:"typeReport",other:"typeOther"}},64370:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{k:()=>A});var e=c(10837),f=c(21968),g=c(9222),h=c(81512),i=c.n(h),j=c(86460),k=c(21289),l=c(49102),m=c(20447),n=c(21790),o=c(51592),p=c(49599),q=c(42424),r=c(22727),s=c(90061),t=c(76172),u=c(97450),v=c(60265),w=c(55183),x=c(14938);c(78853);var y=c(54722),z=a([u]);function A({idea:a,projectUuid:b,onTaskClick:c,onDocClick:d,initialProposals:h}){let i=(0,g.c)("ideaTracker"),[l,m]=(0,f.useState)(h??[]),[n,o]=(0,f.useState)(!h),p=(0,f.useCallback)(async()=>{try{let c=await (0,x.U)(b,a.uuid);if(c.success)return m(c.data),c.data}catch(a){y.q.error("Failed to fetch proposals:",a)}finally{o(!1)}return[]},[b,a.uuid]),q=(0,f.useRef)(l);q.current=l;let{getPresence:r}=(0,s.xQ)();return((0,t.eV)("proposal",async()=>{let a=q.current;for(let b of(await p())){let c=a.find(a=>a.uuid===b.uuid);if(!c)continue;let d=new Set((c.documentDrafts??[]).map(a=>a.uuid)),e=new Set((c.taskDrafts??[]).map(a=>a.uuid)),f=(b.documentDrafts??[]).filter(a=>a.uuid&&!d.has(a.uuid)),g=(b.taskDrafts??[]).filter(a=>a.uuid&&!e.has(a.uuid)),h=[...f.map(a=>a.uuid),...g.map(a=>a.uuid)];if(h.length>0){let a=r("proposal",b.uuid)[0];if(a)for(let c of h)(0,s.fv)({entityType:"proposal",entityUuid:b.uuid,subEntityType:"draft",subEntityUuid:c,agentUuid:a.agentUuid,agentName:a.agentName,action:"mutate"})}}}),n)?(0,e.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,e.jsx)(j.A,{className:"h-5 w-5 animate-spin text-primary"})}):0===l.length?(0,e.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[(0,e.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#F3E5F5] dark:bg-[#281630]",children:(0,e.jsx)(k.A,{className:"h-5 w-5 text-[#7B1FA2] dark:text-[#C98FE0]"})}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:i("panel.noProposals")})]}):(0,e.jsx)("div",{className:"space-y-5",children:l.map(a=>(0,e.jsx)(B,{proposal:a,projectUuid:b,onTaskClick:c,onDocClick:d},a.uuid))})}u=(z.then?(await z)():z)[0];let D={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 B({proposal:a,projectUuid:b,onTaskClick:c,onDocClick:d}){let h=(0,g.c)("ideaTracker"),j=(0,g.c)(),k=(0,g.c)("proposals"),n=(0,g.c)("tasks"),o=(0,g.c)("documents"),s=a.documentDrafts||[],t=a.taskDrafts||[],[x,y]=(0,f.useState)(new Set),[z,A]=(0,f.useState)("cards"),[B,E]=(0,f.useState)([]),F="approved"===a.status,G=(0,f.useMemo)(()=>{let a=new Map;for(let b of B)a.set(b.title,b);return a},[B]),{dagTasks:H,dagEdges:I,dagHeight:J}=(0,f.useMemo)(()=>{let a=t.map(a=>{let b=G.get(a.title);return{uuid:b?.uuid||a.uuid,title:a.title,status:b?.status||"open",priority:a.priority||"medium"}}),b=[],c=new Map(t.map(a=>[a.uuid,a]));for(let a of t)if(a.dependsOnDraftUuids)for(let d of a.dependsOnDraftUuids){let e=G.get(a.title),f=c.get(d),g=f?G.get(f.title):void 0;b.push({from:e?.uuid||a.uuid,to:g?.uuid||d})}return{dagTasks:a,dagEdges:b,dagHeight:Math.max(350,90*a.length)}},[t,G]),K=F?B.filter(a=>"done"===a.status||"closed"===a.status).length:0;return(0,e.jsxs)("div",{className:"space-y-5",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("h3",{className:"text-[14px] font-semibold text-foreground truncate flex-1",children:a.title}),(0,e.jsx)(p.E,{className:`text-[11px] font-semibold border-0 shrink-0 ${D[a.status]||""}`,children:j(`status.${a.status}`)})]}),a.description&&(0,e.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,e.jsx)(u.MarkdownContent,{children:(0,w.j)(a.description)})}),(0,e.jsxs)(i(),{href:`/projects/${b}/proposals/${a.uuid}`,className:"flex items-center gap-1 text-[13px] font-medium text-primary hover:underline",children:[h("panel.viewProposal"),(0,e.jsx)(l.A,{className:"h-3.5 w-3.5"})]}),s.length>0&&(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-muted-foreground",children:k(F?"documents":"documentDrafts")}),(0,e.jsx)("span",{className:"text-[11px] text-muted-foreground",children:s.length})]}),(0,e.jsx)("div",{className:"space-y-0",children:s.map((b,c)=>(0,e.jsx)(r.D,{entityType:"proposal",entityUuid:a.uuid,subEntityType:"draft",subEntityUuid:b.uuid||`draft-${c}`,badgeInside:!0,children:(0,e.jsxs)(q.$,{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:()=>b.content&&d?.({title:b.title,type:b.type,content:b.content}),children:[(0,e.jsx)(m.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,e.jsx)(p.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:o(w.y[b.type]||"typeOther")}),(0,e.jsx)("span",{className:"flex-1 min-w-0 text-left text-[13px] text-foreground truncate",children:b.title})]})},b.uuid||c))})]}),(t.length>0||B.length>0)&&(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center justify-between pb-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-muted-foreground",children:k(F?"tasks":"taskDrafts")}),(0,e.jsx)("span",{className:"text-[11px] text-muted-foreground",children:F&&B.length>0?B.length:t.length})]}),(0,e.jsxs)("span",{className:"text-[12px] text-muted-foreground",children:[K,"/",F&&B.length>0?B.length:t.length]})]}),(0,e.jsx)("div",{className:"-mx-6 border-t border-border"}),I.length>0&&(0,e.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,e.jsx)(q.$,{variant:"ghost",size:"sm",onClick:()=>A("cards"),className:`rounded-md px-2.5 py-1 h-auto text-[11px] font-medium transition-colors ${"cards"===z?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-muted-foreground"}`,children:k("cardsView")}),(0,e.jsx)(q.$,{variant:"ghost",size:"sm",onClick:()=>A("dag"),className:`rounded-md px-2.5 py-1 h-auto text-[11px] font-medium transition-colors ${"dag"===z?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-muted-foreground"}`,children:n("dagView")})]}),"cards"===z&&(0,e.jsx)("div",{className:"space-y-0",children:F&&B.length>0?B.map(a=>(0,e.jsx)(r.D,{entityType:"task",entityUuid:a.uuid,badgeInside:!0,children:(0,e.jsx)(C,{task:{uuid:a.uuid,title:a.title},expanded:!1,onToggle:()=>{},onNavigate:c?()=>c(a.uuid):void 0,taskStatus:a.status})},a.uuid)):t.map((b,c)=>(0,e.jsx)(r.D,{entityType:"proposal",entityUuid:a.uuid,subEntityType:"draft",subEntityUuid:b.uuid,badgeInside:!0,children:(0,e.jsx)(C,{task:b,expanded:x.has(c),onToggle:()=>{y(a=>{let b=new Set(a);return b.has(c)?b.delete(c):b.add(c),b})}})},b.uuid))}),"dag"===z&&(0,e.jsx)("div",{className:"mt-3",children:(0,e.jsx)(v._u,{tasks:H,edges:I,readonly:!0,height:J,onNodeClick:c})})]}),0===s.length&&0===t.length&&0===B.length&&(0,e.jsx)("p",{className:"text-xs text-muted-foreground italic",children:k("emptyContainer")})]})}let E={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]"},F={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 C({task:a,expanded:b,onToggle:c,onNavigate:d,taskStatus:f}){let h=(0,g.c)("proposals"),i=(0,g.c)("acceptanceCriteria"),j=(0,g.c)("status"),k=a.acceptanceCriteriaItems||[],p=!!(a.description||k.length>0),r=f?E[f]||E.open:"border-[#D9D9D9] dark:border-[#3a3a40] bg-card",s=f?F[f]:null,t=(0,e.jsx)("span",{className:`shrink-0 h-2 w-2 rounded-full border-[1.5px] ${r} transition-colors`}),u=(0,e.jsx)("span",{className:"flex-1 min-w-0 text-[13px] leading-snug truncate text-muted-foreground",children:a.title}),v=s?(0,e.jsx)("span",{className:`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium ${s.className}`,children:j(s.key)}):null;return d?(0,e.jsxs)(q.$,{variant:"ghost",onClick:d,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,e.jsx)(m.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),t,u,v]}):(0,e.jsxs)("div",{children:[(0,e.jsxs)(q.$,{variant:"ghost",onClick:p?c:void 0,className:`w-full justify-start h-auto text-left flex items-center gap-2.5 py-4 ${p?"cursor-pointer hover:bg-background -mx-1 px-1 rounded-lg":""} transition-colors`,children:[b?(0,e.jsx)(n.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):(0,e.jsx)(l.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),t,u,v]}),b&&p&&(0,e.jsxs)("div",{className:"pb-3 pl-5 space-y-3",children:[a.description&&(0,e.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:a.description}),k.length>0&&(0,e.jsxs)("div",{className:"rounded-lg bg-background p-3 space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(o.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,e.jsx)("span",{className:"text-[11px] font-semibold text-foreground",children:h("taskAcceptanceCriteria")})]}),(0,e.jsx)("div",{className:"space-y-1.5",children:k.map((a,b)=>(0,e.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,e.jsx)("p",{className:"text-[11px] leading-snug text-foreground/80 flex-1",children:a.description}),!1!==a.required&&(0,e.jsx)("span",{className:"shrink-0 text-[10px] font-medium text-[#E65100] dark:text-[#F0A050]",children:i("required")})]},b))})]})]})]})}d()}catch(a){d(a)}})},69815:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{p:()=>n});var e=c(10837),f=c(9222),g=c(80251),h=c(6871),i=c(2852),j=c(99127),k=c(68797),l=c(7086),m=a([k]);function n({assignee:a,onReassign:b,editable:c}){let d=(0,f.c)("common"),m=!0===c&&"function"==typeof b,n=d(a?"reassign":"assign"),o=a?(0,e.jsxs)(e.Fragment,{children:[(0,l.bB)(a)?(0,e.jsx)(h.AgentAvatar,{name:a.name,size:28,className:"rounded-full"}):(0,e.jsx)(g.eu,{className:"h-7 w-7",children:(0,e.jsx)(g.q5,{className:"bg-border text-muted-foreground",children:a.name.charAt(0).toUpperCase()})}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"text-sm font-medium text-foreground",children:a.name}),(0,e.jsx)("div",{className:"text-xs text-muted-foreground",children:d((0,l.bB)(a)?"agent":"user")}),"agent_instance"===a.type&&a.instance&&(0,e.jsx)("div",{className:"mt-1",children:(0,e.jsx)(k.jQ,{cwd:a.instance.cwd,host:a.instance.host})})]})]}):(0,e.jsx)("span",{className:"text-sm text-muted-foreground",children:d("unassigned")}),p="mt-2 flex items-center gap-2.5 rounded-lg bg-background p-3";return(0,e.jsxs)("div",{children:[(0,e.jsx)(i.J,{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:d("assignee")}),m?(0,e.jsx)(j.Bc,{delayDuration:300,children:(0,e.jsxs)(j.m_,{children:[(0,e.jsx)(j.k$,{asChild:!0,children:(0,e.jsx)("button",{type:"button",onClick:b,"aria-label":n,className:`${p} w-full cursor-pointer text-left`,children:o})}),(0,e.jsx)(j.ZI,{children:n})]})}):(0,e.jsx)("div",{className:p,children:o})]})}k=(m.then?(await m)():m)[0],d()}catch(a){d(a)}})},72229:(a,b,c)=>{c.d(b,{b:()=>j});var d=c(21968),e=c(16551),f=c(10837),g="horizontal",h=["horizontal","vertical"],i=d.forwardRef((a,b)=>{var c;let{decorative:d,orientation:i=g,...j}=a,k=(c=i,h.includes(c))?i:g;return(0,f.jsx)(e.sG.div,{"data-orientation":k,...d?{role:"none"}:{"aria-orientation":"vertical"===k?k:void 0,role:"separator"},...j,ref:b})});i.displayName="Separator";var j=i},74733:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(56556).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"}]])},76381:(a,b,c)=>{c.d(b,{d:()=>t});var d=c(10837),e=c(21968),f=c(9222),g=c(68884),h=c(76549),i=c(86460);let j=(0,c(56556).A)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var k=c(21692),l=c(42424),m=c(11568),n=c(10297),o=c(96307),p=c(42377);let q=(0,p.createServerReference)("40cb3a823face3c0e28c55d0fe75c9134c119ae138",p.callServer,void 0,p.findSourceMapURL,"getProjectIdeasForPickerAction"),r=(0,p.createServerReference)("60d1f06394c12320d17a4174f6f14df58b2300333c",p.callServer,void 0,p.findSourceMapURL,"setIdeaParentAction");var s=c(54722);function t({open:a,onOpenChange:b,ideaUuid:c,ideaTitle:p,projectUuid:t,currentParentUuid:u,descendantUuids:v,onChanged:w}){let x=(0,f.c)("ideaTracker.lineage"),y=(0,f.c)("common"),z=(0,g.r)(),[A,B]=(0,e.useState)([]),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(null),K=new Set([c,...v]);(0,e.useCallback)(async()=>{F(!0),J(null);try{let a=await q(t);a.success?(B(a.data),D(a.hasMore)):J(a.error)}catch(a){s.q.error("Failed to load parent candidates:",a),J(x("saveFailed"))}F(!1)},[t,x]);let L=async a=>{if(!G){H(!0),J(null);try{let d=await r(c,a);d.success?(h.oR.success(a?x("save"):x("detach")),b(!1),z.refresh(),w()):J(d.error||x("saveFailed"))}catch(a){J(a instanceof Error?a.message:x("saveFailed"))}H(!1)}};return(0,d.jsx)(m.lG,{open:a,onOpenChange:b,children:(0,d.jsxs)(m.Cf,{children:[(0,d.jsxs)(m.c7,{children:[(0,d.jsx)(m.L3,{children:x("setParentTitle")}),(0,d.jsx)(m.rr,{children:x("setParentDescription",{title:p})})]}),(0,d.jsxs)("div",{className:"min-w-0 space-y-3 pt-1",children:[E?(0,d.jsx)("div",{className:"flex h-40 items-center justify-center",children:(0,d.jsx)(i.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):(0,d.jsx)("div",{className:"rounded-md border border-border",children:(0,d.jsxs)(n.uB,{children:[(0,d.jsx)(n.G7,{placeholder:x("searchPlaceholder")}),(0,d.jsxs)(n.oI,{children:[(0,d.jsx)(n.xL,{children:x("noCandidates")}),(0,d.jsx)(n.L$,{children:A.map(a=>{let b=K.has(a.uuid),c=a.uuid===u;return(0,d.jsxs)(n.h_,{value:a.title,disabled:b,onSelect:()=>{b||L(a.uuid)},className:(0,o.cn)("flex min-w-0 items-center justify-between gap-2",b&&"opacity-55",c&&"bg-primary/10"),children:[(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px] text-foreground",children:a.title}),b&&(0,d.jsxs)("span",{className:"flex shrink-0 items-center gap-1 text-[11px] font-medium text-[#B0654A] dark:text-[#EBA890]",children:[(0,d.jsx)(j,{className:"h-3 w-3"}),x("cycleBlocked")]})]},a.uuid)})})]})]})}),(0,d.jsxs)("div",{className:"flex items-start gap-2 rounded-md bg-[#FBF0EB] dark:bg-[#221e1b] px-3 py-2.5",children:[(0,d.jsx)(k.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[#B0654A] dark:text-[#EBA890]"}),(0,d.jsx)("p",{className:"text-[12px] leading-relaxed text-[#9A5238] dark:text-[#E9A088]",children:x("cycleWarning")})]}),C&&(0,d.jsx)("p",{className:"px-1 text-[12px] text-muted-foreground",role:"status",children:x("pickerTruncated")}),I&&(0,d.jsx)("p",{className:"text-xs text-destructive",role:"alert",children:I})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3 pt-2",children:[u?(0,d.jsx)(l.$,{variant:"outline",className:"border-border",onClick:()=>L(null),disabled:G,children:x("detach")}):(0,d.jsx)("span",{}),(0,d.jsx)(l.$,{variant:"outline",className:"border-border",onClick:()=>b(!1),disabled:G,children:y("cancel")})]})]})})}},78128:(a,b,c)=>{c.d(b,{Q:()=>e});var d=c(42377);let e=(0,d.createServerReference)("40837a5291d48e065a017c8f87b319479b12c399dd",d.callServer,void 0,d.findSourceMapURL,"getTaskAction")},79030:(a,b,c)=>{c.d(b,{C:()=>f});var d=c(10837),e=c(96307);function f({done:a,total:b,size:c=14,stroke:f=2,className:g,color:h="#B26B3D",trackColor:i="#EAD9C8"}){let j=(c-f)/2,k=2*Math.PI*j,l=b>0?Math.min(1,Math.max(0,a/b)):0;return(0,d.jsxs)("svg",{width:c,height:c,viewBox:`0 0 ${c} ${c}`,className:(0,e.cn)("shrink-0",g),role:"img","aria-label":`${a}/${b}`,children:[(0,d.jsx)("circle",{cx:c/2,cy:c/2,r:j,fill:"none",stroke:i,strokeWidth:f}),l>0&&(0,d.jsx)("circle",{cx:c/2,cy:c/2,r:j,fill:"none",stroke:b>0&&a>=b?"#1D9E75":h,strokeWidth:f,strokeDasharray:k,strokeDashoffset:k*(1-l),strokeLinecap:"round",transform:`rotate(-90 ${c/2} ${c/2})`})]})}},84722:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{G:()=>q});var e=c(10837),f=c(9222),g=c(86460),h=c(16235),i=c(2852),j=c(84819),k=c(1972),l=c(97450),m=c(31009),n=c(45148),o=c(69815),p=a([l,o]);function q({idea:a,elaboration:b,isLoading:c,onRefresh:d,onReassign:p,canReassign:q}){let r=(0,f.c)("ideaTracker"),s=(0,f.c)("common");return c?(0,e.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,e.jsx)(g.A,{className:"h-5 w-5 animate-spin text-primary"})}):(0,e.jsxs)(m.P.div,{variants:n.qG,initial:"initial",animate:"animate",children:[(0,e.jsx)(o.p,{assignee:a.assignee,onReassign:p,editable:q}),(0,e.jsx)(j.Separator,{className:"my-5 bg-secondary"}),b&&b.rounds.length>0?(0,e.jsx)("div",{children:(0,e.jsx)(k.R,{ideaUuid:a.uuid,elaboration:b,onRefresh:d})}):"open"===a.status?(0,e.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-8 text-center",children:[(0,e.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#FFF3E0] dark:bg-[#3a2a12]",children:(0,e.jsx)(h.A,{className:"h-5 w-5 text-[#E65100] dark:text-[#F0A050]"})}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium text-foreground",children:r("panel.elaborationNotStarted")}),(0,e.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:r("panel.elaborationNotStartedDesc")})]})]}):(0,e.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-8 text-center",children:[(0,e.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#E3F2FD] dark:bg-[#13253a]",children:(0,e.jsx)(h.A,{className:"h-5 w-5 text-[#1976D2] dark:text-[#5AA9F0]"})}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium text-foreground",children:r("panel.elaborationWaiting")}),(0,e.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:r("panel.elaborationWaitingDesc")})]})]}),a.content&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(j.Separator,{className:"my-5 bg-secondary"}),(0,e.jsxs)("div",{children:[(0,e.jsx)(i.J,{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:s("content")}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)("div",{className:"prose prose-sm max-w-none text-[13px] leading-relaxed text-foreground",children:(0,e.jsx)(l.MarkdownContent,{children:a.content})})})]})]})]})}[l,o]=p.then?(await p)():p,d()}catch(a){d(a)}})},94189:(a,b,c)=>{c.d(b,{c:()=>e});var d=c(42377);let e=(0,d.createServerReference)("40f7686cd5d2c0e98dc6558f1af819cc2fcd08faa0",d.callServer,void 0,d.findSourceMapURL,"getIdeaAction")},98310:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{K:()=>q});var e=c(10837),f=c(21968),g=c(9222),h=c(35209),i=c(10694),j=c(42424),k=c(49599),l=c(74645),m=c(97450),n=c(55183),o=c(77521),p=a([m]);function q({title:a,type:b,content:c,mode:d="overlay",onClose:p,onBack:q}){let r=(0,g.c)("documents"),[s,t]=(0,f.useState)(!1),u="sidebyside"===d;return(0,e.jsxs)(e.Fragment,{children:[!u&&(0,e.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:p}),(0,e.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 ${u?`z-40 ${s?"":"animate-in slide-in-from-right duration-300"}`:`z-50 right-0 ${s?"":"animate-in slide-in-from-right duration-300"}`}`,style:u?{right:`${o.L8}px`}:void 0,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between border-b border-secondary px-6 py-5",children:[q&&(0,e.jsx)(j.$,{variant:"ghost",size:"icon",className:"mr-2 h-8 w-8 shrink-0",onClick:q,children:(0,e.jsx)(h.A,{className:"h-4 w-4 text-muted-foreground"})}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("h2",{className:"text-base font-semibold text-foreground truncate",children:a}),(0,e.jsx)("div",{className:"mt-1.5",children:(0,e.jsx)(k.E,{variant:"outline",className:"text-[10px] font-medium border-border text-muted-foreground bg-secondary px-2 py-0.5 font-mono",children:r(n.y[b]||"typeOther")})})]}),(0,e.jsx)(j.$,{variant:"outline",size:"icon",className:"ml-4 h-8 w-8 shrink-0 border-border",onClick:p,children:(0,e.jsx)(i.A,{className:"h-4 w-4 text-muted-foreground"})})]}),(0,e.jsx)(l.F,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:(0,e.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,e.jsx)(m.MarkdownContent,{children:(0,n.j)(c)})})})]})]})}m=(p.then?(await p)():p)[0],d()}catch(a){d(a)}})}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=1437,exports.ids=[1437],exports.modules={644:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(56556).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"}]])},5918:(a,b,c)=>{c.d(b,{f:()=>e});var d=c(42377);let e=(0,d.createServerReference)("40df0e37bb7fd45eb2156127819f061544ddd8d6a9",d.callServer,void 0,d.findSourceMapURL,"getTaskActivitiesAction")},7500:(a,b,c)=>{c.d(b,{k:()=>e});var d=c(42377);let e=(0,d.createServerReference)("40ad697a1d14baa1161964adf881e5e7d690d9abf6",d.callServer,void 0,d.findSourceMapURL,"getProjectTasksForDependencyAction")},18786:(a,b,c)=>{c.d(b,{h:()=>e});var d=c(42377);let e=(0,d.createServerReference)("602f7574dd5442ac3794acee13648d1644a27e918c",d.callServer,void 0,d.findSourceMapURL,"markCriteriaAction")},21326:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(56556).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"}]])},22293:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{TK:()=>l,kq:()=>m,wG:()=>k,xo:()=>j});var e=c(2613);c(50785);var f=c(9259),g=c(50530),h=c(12217),i=a([f,g]);async function j(a){let b=await (0,f.d)();if(!b)return{dependsOn:[],dependedBy:[]};try{return await g.vQ(b.companyUuid,a)}catch{return{dependsOn:[],dependedBy:[]}}}async function k(a,b){let c=await (0,f.d)();if(!c)return{success:!1,error:"Unauthorized"};try{return await g.QL(c.companyUuid,a,b),{success:!0}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Unknown error"}}}async function l(a,b){let c=await (0,f.d)();if(!c)return{success:!1,error:"Unauthorized"};try{return await g.j9(c.companyUuid,a,b),{success:!0}}catch(a){return{success:!1,error:a instanceof Error?a.message:"Unknown error"}}}async function m(a){let b=await (0,f.d)();if(!b)return{tasks:[]};try{return{tasks:(await g.Vk({companyUuid:b.companyUuid,projectUuid:a,skip:0,take:1e3})).tasks.map(a=>({uuid:a.uuid,title:a.title,status:a.status}))}}catch{return{tasks:[]}}}[f,g]=i.then?(await i)():i,(0,h.D)([j,k,l,m]),(0,e.A)(j,"40d05690894458aaf82b0c2c4be8ee949fcaca80e7",null),(0,e.A)(k,"60a261760cd422a0ac8a315798976aa6fcaa045c06",null),(0,e.A)(l,"60d060df79ef2d59464d72cf12df59c5a5bd429d11",null),(0,e.A)(m,"40ad697a1d14baa1161964adf881e5e7d690d9abf6",null),d()}catch(a){d(a)}})},22374:(a,b,c)=>{c.d(b,{Y:()=>e});var d=c(42377);let e=(0,d.createServerReference)("40c633a7d138bc6dbd6fdd66fe5cb7198e52f7112d",d.callServer,void 0,d.findSourceMapURL,"updateTaskFieldsAction")},25848:(a,b,c)=>{c.d(b,{J:()=>e});var d=c(42377);let e=(0,d.createServerReference)("404c9a2469eaa7fc0ba47937f4bc5509315d0ee72f",d.callServer,void 0,d.findSourceMapURL,"getTaskSessionsAction")},29061:(a,b,c)=>{c.d(b,{N:()=>e});var d=c(42377);let e=(0,d.createServerReference)("6025177641cdabba8bf9655dbd3cd3761c125951a6",d.callServer,void 0,d.findSourceMapURL,"resetCriterionAction")},39347:(a,b,c)=>{c.d(b,{T:()=>e});var d=c(42377);let e=(0,d.createServerReference)("60cc8da4aa4989ffa3a5bad0a8f9cd7b59e7cd7173",d.callServer,void 0,d.findSourceMapURL,"deleteTaskAction")},52177:(a,b,c)=>{c.d(b,{T:()=>e});var d=c(42377);let e=(0,d.createServerReference)("60d060df79ef2d59464d72cf12df59c5a5bd429d11",d.callServer,void 0,d.findSourceMapURL,"removeTaskDependencyAction")},59179:(a,b,c)=>{c.d(b,{A:()=>d});let d=(0,c(56556).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"}]])},59871:(a,b,c)=>{c.d(b,{w:()=>e});var d=c(42377);let e=(0,d.createServerReference)("60a261760cd422a0ac8a315798976aa6fcaa045c06",d.callServer,void 0,d.findSourceMapURL,"addTaskDependencyAction")},60265:(a,b,c)=>{c.d(b,{_u:()=>x,c_:()=>r,nF:()=>w,qK:()=>u});var d=c(10837),e=c(21968),f=c(47797),g=c(92460);c(63410);var h=c(24346),i=c.n(h),j=c(9222),k=c(49599),l=c(74798);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"},n={open:"#E65100",assigned:"#1976D2",in_progress:"#5A9E6F",to_verify:"#7B1FA2",done:"#00796B",closed:"#9A9A9A"},o={low:"priority.low",medium:"priority.medium",high:"priority.high",critical:"priority.critical"},p={open:"status.open",assigned:"status.assigned",in_progress:"status.inProgress",to_verify:"status.toVerify",done:"status.done",closed:"status.closed"},q={low:"bg-[#9A9A9A]",medium:"bg-[#E65100]",high:"bg-[#D32F2F]",critical:"bg-[#B71C1C]"},r={taskNode:function({data:a}){let b=(0,j.c)();return(0,d.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,d.jsx)(f.h7,{type:"target",position:g.yX.Top,className:"!bg-primary !w-2 !h-2"}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,d.jsx)(k.E,{className:`text-[10px] ${m[a.status]||""}`,children:b(p[a.status]||a.status)}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("div",{className:`h-1.5 w-1.5 rounded-full ${q[a.priority]||""}`}),(0,d.jsx)("span",{className:"text-[10px] text-muted-foreground",children:b(o[a.priority]||a.priority)})]})]}),(0,d.jsx)("p",{className:"text-xs font-medium text-foreground leading-snug line-clamp-2",children:a.title}),(0,d.jsx)(f.h7,{type:"source",position:g.yX.Bottom,className:"!bg-primary !w-2 !h-2"})]})}},s={taskNode:function({data:a}){let b=n[a.status]||"#E5E0D8";return(0,d.jsxs)("div",{className:"rounded-md border-[1.5px] bg-card px-2.5 py-1.5 shadow-sm",style:{borderColor:b,width:t},children:[(0,d.jsx)(f.h7,{type:"target",position:g.yX.Top,className:"!bg-primary !w-1.5 !h-1.5"}),(0,d.jsx)("p",{className:"text-[10px] font-medium text-foreground leading-tight line-clamp-2",children:a.title}),(0,d.jsx)(f.h7,{type:"source",position:g.yX.Bottom,className:"!bg-primary !w-1.5 !h-1.5"})]})}},t=150,u={animated:!0,style:{stroke:"#C67A52",strokeWidth:2},markerEnd:{type:"arrowclosed",color:"#C67A52"}},v={animated:!0,style:{stroke:"#C67A52",strokeWidth:1.5},markerEnd:{type:"arrowclosed",color:"#C67A52"}};function w(a,b,c){let d=c?.nodeWidth??240,e=c?.nodeHeight??80,f=new(i()).graphlib.Graph;return f.setDefaultEdgeLabel(()=>({})),f.setGraph({rankdir:"TB",nodesep:c?.nodesep??50,ranksep:c?.ranksep??80}),a.forEach(a=>{f.setNode(a.id,{width:d,height:e})}),b.forEach(a=>{f.setEdge(a.source,a.target)}),i().layout(f),{nodes:a.map(a=>{let b=f.node(a.id);return{...a,position:{x:b.x-d/2,y:b.y-e/2}}}),edges:b}}function x({tasks:a,edges:b,readonly:c=!1,compact:g=!1,height:h,onNodeClick:i,className:k}){let m=(0,j.c)(),n=(0,l.W)(),{layoutedNodes:o,layoutedEdges:p}=(0,e.useMemo)(()=>{let c=a.map(a=>({id:a.uuid,type:"taskNode",position:{x:0,y:0},data:{title:a.title,status:a.status,priority:a.priority,proposalUuid:a.proposalUuid??null}})),d=w(c,b.map((a,b)=>({id:`e-${b}`,source:a.to,target:a.from,...g?v:u})),g?{nodeWidth:t,nodeHeight:50,nodesep:20,ranksep:40}:void 0);return{layoutedNodes:d.nodes,layoutedEdges:d.edges}},[a,b,g]);return 0===a.length?(0,d.jsx)("div",{className:`flex items-center justify-center text-sm text-muted-foreground ${k||""}`,style:h?{height:h}:void 0,children:m("tasks.noTasksToDisplay")}):(0,d.jsx)("div",{className:`rounded-[10px] border border-border bg-[#F7F6F3] dark:bg-[#1e1d1b] ${k||""}`,style:h?{height:h}:void 0,children:(0,d.jsxs)(f.Gc,{colorMode:n?"dark":"light",nodes:o,edges:p,nodeTypes:g?s:r,onNodeClick:i?(a,b)=>i(b.id):void 0,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:1.5,proOptions:{hideAttribution:!0},nodesDraggable:!c,nodesConnectable:!c,elementsSelectable:!c,panOnDrag:!0,zoomOnScroll:!0,children:[(0,d.jsx)(f.VS,{color:n?"#40392f":"#E5E0D8",gap:20}),!c&&(0,d.jsx)(f.H2,{className:"[&>button]:border-border [&>button]:bg-card [&>button]:text-foreground [&>button:hover]:bg-background"})]})})}},64029:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{f:()=>l});var e=c(2613);c(50785);var f=c(9259),g=c(67738),h=c(50530),i=c(97307),j=c(12217),k=a([f,g,h]);async function l(a){let b=await (0,f.d)();if(!b)return{activities:[],total:0};try{let c=await (0,h.K4)(b.companyUuid,a);if(!c)return{activities:[],total:0};return await (0,g.listActivitiesWithActorNames)({companyUuid:b.companyUuid,projectUuid:c.projectUuid,targetType:"task",targetUuid:a,skip:0,take:50})}catch(a){return i.default.error({err:a},"Failed to get task activities"),{activities:[],total:0}}}[f,g,h]=k.then?(await k)():k,(0,j.D)([l]),(0,e.A)(l,"40df0e37bb7fd45eb2156127819f061544ddd8d6a9",null),d()}catch(a){d(a)}})},71353:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{IY:()=>n,Nq:()=>m,hD:()=>l});var e=c(2613);c(50785);var f=c(5562),g=c(9259),h=c(50530),i=c(97307),j=c(12217),k=a([g,h]);async function l(a,b){let c=await (0,g.d)();if(!c)return{success:!1,error:"Unauthorized"};if("user"!==c.type&&"super_admin"!==c.type)return{success:!1,error:"Only users can verify acceptance criteria"};try{let d=await (0,h.K4)(c.companyUuid,a);if(!d)return{success:!1,error:"Task not found"};let e=await (0,h._T)(c.companyUuid,a,b,{type:c.type,actorUuid:c.actorUuid});return(0,f.revalidatePath)(`/projects/${d.projectUuid}/tasks/${a}`),(0,f.revalidatePath)(`/projects/${d.projectUuid}/tasks`),{success:!0,data:e}}catch(a){return i.default.error({err:a},"Failed to mark acceptance criteria"),{success:!1,error:"Failed to mark acceptance criteria"}}}async function m(a,b){let c=await (0,g.d)();if(!c)return{success:!1,error:"Unauthorized"};if("user"!==c.type&&"super_admin"!==c.type)return{success:!1,error:"Only users can reset acceptance criteria"};try{let d=await (0,h.K4)(c.companyUuid,a);if(!d)return{success:!1,error:"Task not found"};return await (0,h.Qi)(c.companyUuid,a,b),(0,f.revalidatePath)(`/projects/${d.projectUuid}/tasks/${a}`),(0,f.revalidatePath)(`/projects/${d.projectUuid}/tasks`),{success:!0}}catch(a){return i.default.error({err:a},"Failed to reset acceptance criterion"),{success:!1,error:"Failed to reset acceptance criterion"}}}async function n(a,b){let c=await (0,g.d)();if(!c)return{success:!1,error:"Unauthorized"};try{let d=await (0,h.K4)(c.companyUuid,a);if(!d)return{success:!1,error:"Task not found"};let e=await (0,h.cn)(c.companyUuid,a,b,{type:c.type,actorUuid:c.actorUuid});return(0,f.revalidatePath)(`/projects/${d.projectUuid}/tasks/${a}`),(0,f.revalidatePath)(`/projects/${d.projectUuid}/tasks`),{success:!0,data:e}}catch(a){return i.default.error({err:a},"Failed to self-check acceptance criteria"),{success:!1,error:"Failed to self-check acceptance criteria"}}}[g,h]=k.then?(await k)():k,(0,j.D)([l,m,n]),(0,e.A)(l,"602f7574dd5442ac3794acee13648d1644a27e918c",null),(0,e.A)(m,"6025177641cdabba8bf9655dbd3cd3761c125951a6",null),(0,e.A)(n,"608c7511238bfe910679caf57864069da597e91356",null),d()}catch(a){d(a)}})},72189:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{F:()=>k});var e=c(2613);c(50785);var f=c(9259),g=c(97879),h=c(97307),i=c(12217),j=a([f,g]);async function k(a){let b=await (0,f.d)();if(!b)return null;try{let c=await (0,g.PK)(b.companyUuid,a);if(!c)return null;return{uuid:c.uuid,title:c.title}}catch(a){return h.default.error({err:a},"Failed to get task source"),null}}[f,g]=j.then?(await j)():j,(0,i.D)([k]),(0,e.A)(k,"40b8a3a23f0e4f33c48e57d7a07ec490e065b10540",null),d()}catch(a){d(a)}})},73393:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{A0:()=>w,G3:()=>A,M0:()=>r,TV:()=>y,Yw:()=>x,bd:()=>t,hR:()=>u,iY:()=>p,p2:()=>s,qb:()=>q,vq:()=>z,y9:()=>v});var e=c(2613);c(50785);var f=c(5562),g=c(9259),h=c(50530),i=c(28774),j=c(61076),k=c(25383),l=c(67738),m=c(97307),n=c(12217),o=a([g,h,i,j,k,l]);async function p(a){let b=await (0,g.d)();if(!b)return{success:!1,error:"Unauthorized"};try{let c=await (0,h.K4)(b.companyUuid,a);if(!c)return{success:!1,error:"Task not found"};if("open"!==c.status&&"assigned"!==c.status)return{success:!1,error:"Task is not available for claiming"};return await (0,h.QK)({taskUuid:a,companyUuid:b.companyUuid,assigneeType:b.type,assigneeUuid:b.actorUuid,assignedByType:"user",assignedByUuid:b.actorUuid}),await (0,l.createActivity)({companyUuid:b.companyUuid,projectUuid:c.projectUuid,targetType:"task",targetUuid:a,actorType:b.type,actorUuid:b.actorUuid,action:"assigned",value:{assigneeType:b.type,assigneeUuid:b.actorUuid}}),(0,f.revalidatePath)(`/projects/${c.projectUuid}/tasks/${a}`),(0,f.revalidatePath)(`/projects/${c.projectUuid}/tasks`),{success:!0}}catch(a){return m.default.error({err:a},"Failed to claim task"),{success:!1,error:"Failed to claim task"}}}async function q(a,b,c){let d=await (0,g.d)();if(!d||"user"!==d.type)return{success:!1,error:"Unauthorized"};try{let e=await (0,h.K4)(d.companyUuid,a);if(!e)return{success:!1,error:"Task not found"};if("open"!==e.status&&"assigned"!==e.status)return{success:!1,error:"Task is not available for claiming"};let g=await (0,k.gt)({companyUuid:d.companyUuid,actorUserUuid:d.actorUuid,projectUuid:e.projectUuid,agentUuid:b}),i="project_fixed"===g.source?g.agentInstanceUuid:c;return await (0,h.QK)({taskUuid:a,companyUuid:d.companyUuid,assigneeType:"agent",assigneeUuid:b,assignedByType:"user",assignedByUuid:d.actorUuid,instanceUuid:i??void 0,cwdSource:"project_fixed"===g.source?g.source:null,cwdHost:"project_fixed"===g.source?g.host:null,runtimeCwd:"project_fixed"===g.source?g.cwd:null}),await (0,l.createActivity)({companyUuid:d.companyUuid,projectUuid:e.projectUuid,targetType:"task",targetUuid:a,actorType:d.type,actorUuid:d.actorUuid,action:"assigned",value:{assigneeType:"agent",assigneeUuid:b,...i?{instanceUuid:i}:{},..."project_fixed"===g.source?{resolvedCwdSource:g.source,resolvedCwdHost:g.host,resolvedRuntimeCwd:g.cwd}:{}}}),(0,f.revalidatePath)(`/projects/${e.projectUuid}/tasks/${a}`),(0,f.revalidatePath)(`/projects/${e.projectUuid}/tasks`),{success:!0}}catch(a){return m.default.error({err:a},"Failed to claim task to agent"),{success:!1,error:"Failed to claim task"}}}async function r(a,b,c){let d=await (0,g.d)();if(!d||"user"!==d.type)return{success:!1,error:"Unauthorized"};try{let e=await (0,h.K4)(d.companyUuid,a);if(!e)return{success:!1,error:"Task not found"};if("open"!==e.status&&"assigned"!==e.status)return{success:!1,error:"Task is not available for claiming"};return await (0,h.QK)({taskUuid:a,companyUuid:d.companyUuid,assigneeType:"agent",assigneeUuid:b,assignedByType:"user",assignedByUuid:d.actorUuid,instanceUuid:c}),(0,f.revalidatePath)(`/projects/${e.projectUuid}/tasks/${a}`),(0,f.revalidatePath)(`/projects/${e.projectUuid}/tasks`),{success:!0}}catch(a){return m.default.error({err:a},"Failed to reassign task instance (no wake)"),{success:!1,error:"Failed to reassign task"}}}async function s(a){let b=await (0,g.d)();if(!b)return{success:!1,error:"Unauthorized"};try{let c=await (0,h.K4)(b.companyUuid,a);if(!c)return{success:!1,error:"Task not found"};if("assigned"!==c.status&&"in_progress"!==c.status)return{success:!1,error:"Task is not in assigned status"};return await (0,h.Fp)(a),await (0,l.createActivity)({companyUuid:b.companyUuid,projectUuid:c.projectUuid,targetType:"task",targetUuid:a,actorType:b.type,actorUuid:b.actorUuid,action:"released"}),(0,f.revalidatePath)(`/projects/${c.projectUuid}/tasks/${a}`),(0,f.revalidatePath)(`/projects/${c.projectUuid}/tasks`),{success:!0}}catch(a){return m.default.error({err:a},"Failed to release task"),{success:!1,error:"Failed to release task"}}}async function t(a,b){let c=await (0,g.d)();if(!c)return{success:!1,error:"Unauthorized"};try{let d=await (0,h.K4)(c.companyUuid,a);if(!d)return{success:!1,error:"Task not found"};return await (0,h.lC)(a,{status:b}),await (0,l.createActivity)({companyUuid:c.companyUuid,projectUuid:d.projectUuid,targetType:"task",targetUuid:a,actorType:c.type,actorUuid:c.actorUuid,action:"status_changed",value:{status:b}}),(0,f.revalidatePath)(`/projects/${d.projectUuid}/tasks/${a}`),(0,f.revalidatePath)(`/projects/${d.projectUuid}/tasks`),{success:!0}}catch(a){return m.default.error({err:a},"Failed to update task status"),{success:!1,error:"Failed to update task status"}}}async function u(a){let b=await (0,g.d)();if(!b||"user"!==b.type)return{success:!1,error:"Only humans can verify tasks"};try{let c=await (0,h.K4)(b.companyUuid,a);if(!c)return{success:!1,error:"Task not found"};if("to_verify"!==c.status)return{success:!1,error:"Task is not in to_verify status"};let d=await (0,h.Ew)(a);if(!d.allowed)return{success:!1,error:d.reason||"Not all required acceptance criteria are passed"};return await (0,h.lC)(a,{status:"done"}),(0,f.revalidatePath)(`/projects/${c.projectUuid}/tasks/${a}`),(0,f.revalidatePath)(`/projects/${c.projectUuid}/tasks`),{success:!0}}catch(a){return m.default.error({err:a},"Failed to verify task"),{success:!1,error:"Failed to verify task"}}}async function v(a,b){let c=await (0,g.d)();if(!c||"user"!==c.type)return{success:!1,error:"Unauthorized"};try{let d=await (0,h.K4)(c.companyUuid,a);if(!d)return{success:!1,error:"Task not found"};if("open"!==d.status&&"assigned"!==d.status)return{success:!1,error:"Task is not available for assigning"};return await (0,h.QK)({taskUuid:a,companyUuid:c.companyUuid,assigneeType:"user",assigneeUuid:b,assignedByType:"user",assignedByUuid:c.actorUuid}),await (0,l.createActivity)({companyUuid:c.companyUuid,projectUuid:d.projectUuid,targetType:"task",targetUuid:a,actorType:c.type,actorUuid:c.actorUuid,action:"assigned",value:{assigneeType:"user",assigneeUuid:b}}),(0,f.revalidatePath)(`/projects/${d.projectUuid}/tasks/${a}`),(0,f.revalidatePath)(`/projects/${d.projectUuid}/tasks`),{success:!0}}catch(a){return m.default.error({err:a},"Failed to assign task to user"),{success:!1,error:"Failed to assign task"}}}async function w(a){let b=await (0,g.d)();if(!b)return{success:!1,error:"Unauthorized"};try{let c=await (0,h.UT)({companyUuid:b.companyUuid,projectUuid:a.projectUuid,title:a.title,description:a.description||null,priority:a.priority||"medium",storyPoints:a.storyPoints,acceptanceCriteria:a.acceptanceCriteria,createdByUuid:b.actorUuid});return await (0,l.createActivity)({companyUuid:b.companyUuid,projectUuid:a.projectUuid,targetType:"task",targetUuid:c.uuid,actorType:b.type,actorUuid:b.actorUuid,action:"task_created"}),(0,f.revalidatePath)(`/projects/${a.projectUuid}/tasks`),{success:!0,taskUuid:c.uuid}}catch(a){return m.default.error({err:a},"Failed to create task"),{success:!1,error:"Failed to create task"}}}async function x(a){let b=await (0,g.d)();if(!b)return{success:!1,error:"Unauthorized"};try{if(!await (0,h.K4)(b.companyUuid,a.taskUuid))return{success:!1,error:"Task not found"};return await (0,h.lC)(a.taskUuid,{title:a.title,description:a.description,priority:a.priority,storyPoints:a.storyPoints,acceptanceCriteria:a.acceptanceCriteria}),void 0!==a.acceptanceCriteriaItems&&await (0,h.Pf)(b.companyUuid,a.taskUuid,a.acceptanceCriteriaItems),(0,f.revalidatePath)(`/projects/${a.projectUuid}/tasks`),{success:!0}}catch(a){return m.default.error({err:a},"Failed to update task"),{success:!1,error:a instanceof Error?a.message:"Failed to update task"}}}async function y(a,b){let c=await (0,g.d)();if(!c)return{success:!1,error:"Unauthorized"};try{if(!await (0,h.K4)(c.companyUuid,a))return{success:!1,error:"Task not found"};return await (0,h.vq)(a),(0,f.revalidatePath)(`/projects/${b}/tasks`),{success:!0}}catch(a){return m.default.error({err:a},"Failed to delete task"),{success:!1,error:"Failed to delete task"}}}async function z(){let a=await (0,g.d)();if(!a||"user"!==a.type)return{agents:[],users:[]};try{let[b,c]=await Promise.all([(0,i.ic)(a.companyUuid,"task:write",a.actorUuid),(0,i.A8)(a.companyUuid)]);return{agents:b,users:c,currentUserUuid:a.actorUuid}}catch(a){return m.default.error({err:a},"Failed to get assignable agents"),{agents:[],users:[]}}}async function A(a,b){let c=await (0,g.d)();if(!c||"user"!==c.type)return{instances:[],resolvedTarget:null};try{let[d,e]=await Promise.all([(0,j._R)(c.companyUuid,a),b?(0,k.gt)({companyUuid:c.companyUuid,actorUserUuid:c.actorUuid,projectUuid:b,agentUuid:a}):null]);return{instances:d.map(a=>({connectionUuid:a.uuid,agentInstanceUuid:a.agentInstanceUuid,host:a.host,cwd:a.cwd,effectiveStatus:a.effectiveStatus})),resolvedTarget:e}}catch(a){return m.default.error({err:a},"Failed to get agent instances"),{instances:[],resolvedTarget:null}}}[g,h,i,j,k,l]=o.then?(await o)():o,(0,n.D)([p,q,r,s,t,u,v,w,x,y,z,A]),(0,e.A)(p,"402c386373a4fabf2ad2d5dfaa365acb288aac83a0",null),(0,e.A)(q,"70282f0868538e338c4b3140249ed90c558fa6ab54",null),(0,e.A)(r,"70888b128e2a5365195c2ae5d34b864ab7dc9bbcdb",null),(0,e.A)(s,"40f2bf09e6782d17c46f275c86a593725b6ca03e60",null),(0,e.A)(t,"601072d7fca898d2c59da1c68fed0b2cfe8a4de4b1",null),(0,e.A)(u,"40c6582cbaa1a6200494b24766d26822c6e7793709",null),(0,e.A)(v,"60c2047b27bf7270af9d1a080b9e280000f8a9a205",null),(0,e.A)(w,"40aa8a7ab6b0810f2a49113c9c28a4716de01592a7",null),(0,e.A)(x,"40c633a7d138bc6dbd6fdd66fe5cb7198e52f7112d",null),(0,e.A)(y,"60cc8da4aa4989ffa3a5bad0a8f9cd7b59e7cd7173",null),(0,e.A)(z,"00d273393a8e550e51cf5e0502a312e65b6c9b100c",null),(0,e.A)(A,"605280db671df3a878e2b64c216bc17303e832abfe",null),d()}catch(a){d(a)}})},77521:(a,b,c)=>{c.d(b,{Bj:()=>i,L8:()=>e,Wl:()=>j,_5:()=>h,eT:()=>f,fw:()=>g});var d=c(76664);let e=480;function f(a){switch(a){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 g(a,b){let c=new Date(a),e=new Date().getTime()-c.getTime(),f=Math.floor(e/6e4),g=Math.floor(e/36e5),h=Math.floor(e/864e5);return f<1?b("time.justNow"):f<60?b("time.minutesAgo",{minutes:f}):g<24?b("time.hoursAgo",{hours:g}):h<7?b("time.daysAgo",{days:h}):(0,d.r)(c)}let h={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]"},i={todo:"todo",in_progress:"inProgress",human_conduct_required:"humanConductRequired",done:"done"},j={open:"open",researching:"researching",answer_questions:"answerQuestions",planning:"planning",review_proposal:"reviewProposal",building:"building",verify_work:"verifyWork",done:"done"}},80112:(a,b,c)=>{c.d(b,{A:()=>e});var d=c(42377);let e=(0,d.createServerReference)("40aa8a7ab6b0810f2a49113c9c28a4716de01592a7",d.callServer,void 0,d.findSourceMapURL,"createTaskAction")},80267:(a,b,c)=>{c.d(b,{F:()=>e});var d=c(42377);let e=(0,d.createServerReference)("40b8a3a23f0e4f33c48e57d7a07ec490e065b10540",d.callServer,void 0,d.findSourceMapURL,"getTaskSourceAction")},81751:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{J:()=>l,h:()=>m});var e=c(2613);c(50785);var f=c(4687),g=c(9259),h=c(30457),i=c(97307),j=c(12217),k=a([g,h]);async function l(a){let b=await (0,g.d)();b||(0,f.redirect)("/login");try{let c=await (0,h.OU)(b.companyUuid,a);return{success:!0,data:c}}catch(a){return i.default.error({err:a},"Failed to fetch task sessions"),{success:!1,error:"Failed to fetch task sessions"}}}async function m(a){let b=await (0,g.d)();b||(0,f.redirect)("/login");try{let c=await (0,h.y_)(b.companyUuid,a);return{success:!0,data:c}}catch(a){return i.default.error({err:a},"Failed to fetch batch worker counts"),{success:!1,error:"Failed to fetch batch worker counts"}}}[g,h]=k.then?(await k)():k,(0,j.D)([l,m]),(0,e.A)(l,"404c9a2469eaa7fc0ba47937f4bc5509315d0ee72f",null),(0,e.A)(m,"40056a37711ca0f533e576b2db80ffba9280cd0da5",null),d()}catch(a){d(a)}})},82354:(a,b,c)=>{c.d(b,{b:()=>e});var d=c(42377);let e=(0,d.createServerReference)("601072d7fca898d2c59da1c68fed0b2cfe8a4de4b1",d.callServer,void 0,d.findSourceMapURL,"updateTaskStatusAction")},85282:(a,b,c)=>{c.d(b,{h:()=>e});var d=c(42377);let e=(0,d.createServerReference)("40056a37711ca0f533e576b2db80ffba9280cd0da5",d.callServer,void 0,d.findSourceMapURL,"getBatchWorkerCountsAction")},86104:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{v:()=>ae});var e=c(10837),f=c(21968),g=c(68884),h=c(9222),i=c(33407),j=c(10694),k=c(92900),l=c(35209),m=c(87461),n=c(65956),o=c(86460),p=c(67832),q=c(98893),r=c(97825),s=c(59179),t=c(55775),u=c(9810),v=c(97443),w=c(58270),x=c(644),y=c(21326),z=c(79543),A=c(49599),B=c(35198),C=c(42424),D=c(9994),E=c(20170),F=c(2852),G=c(74645),H=c(55732),I=c(6019),J=c(80251),K=c(6871),L=c(68797),M=c(7086),N=c(82354),O=c(80112),P=c(22374),Q=c(39347),R=c(18786),S=c(29061),T=c(56828),U=c(95627);c(5918),c(80267);var V=c(97450),W=c(73908),X=c(87707);c(94037),c(7500);var Y=c(59871),Z=c(52177);c(25848);var $=c(76664),_=c(31009),aa=c(45148),ab=c(77521),ac=a([L,T,V]);[L,T,V]=ac.then?(await ac)():ac;let af={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]"},ag={open:"open",assigned:"assigned",in_progress:"inProgress",to_verify:"toVerify",done:"done",closed:"closed"},ah={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]"},ai={low:"lowPriority",medium:"mediumPriority",high:"highPriority",critical:"criticalPriority"};function ad(a,b){let c=new Date(a),d=new Date().getTime()-c.getTime(),e=Math.floor(d/6e4),f=Math.floor(d/36e5),g=Math.floor(d/864e5);return e<1?b("time.justNow"):e<60?b("time.minutesAgo",{minutes:e}):f<24?b("time.hoursAgo",{hours:f}):g<7?b("time.daysAgo",{days:g}):(0,$.r)(c)}function ae({task:a,projectUuid:b,currentUserUuid:c,mode:d="overlay",onClose:ac,onCreated:ae,onDependencyChange:aj,onBack:ak}){let al=(0,h.c)(),am=(0,g.r)(),[an,ao]=(0,f.useState)(!1),[ap,aq]=(0,f.useState)(!1),[ar,as]=(0,f.useState)([]),[at,au]=(0,f.useState)(!0),[av,aw]=(0,f.useState)(null),[ax,ay]=(0,f.useState)(!1),[az,aA]=(0,f.useState)([]),[aB,aC]=(0,f.useState)([]),[aD,aE]=(0,f.useState)(!1),[aF,aG]=(0,f.useState)([]),[aH,aI]=(0,f.useState)(null),[aJ,aK]=(0,f.useState)([]),[aL,aM]=(0,f.useState)([]),aN=null===a,[aO,aP]=(0,f.useState)(aN),[aQ,aR]=(0,f.useState)(a?.title||""),[aS,aT]=(0,f.useState)(a?.description||""),[aU,aV]=(0,f.useState)(a?.priority||"medium"),[aW,aX]=(0,f.useState)(a?.storyPoints!=null?String(a.storyPoints):""),[aY,aZ]=(0,f.useState)((a?.acceptanceCriteriaItems??[]).map(a=>({description:a.description,required:a.required??!0}))),[a$,a_]=(0,f.useState)(!1),[a0,a1]=(0,f.useState)(null),[a2,a3]=(0,f.useState)(!1),a4=(0,M.RU)(a?.assignee??null,{type:"user",uuid:c}),a5=a4&&a?.status==="assigned",a6=a4&&a?.status==="in_progress",a7=a?.status==="to_verify",a8=async b=>{if(!a)return;aq(!0);let c=await (0,N.b)(a.uuid,b);aq(!1),c.success&&(ac(),am.refresh())},a9=()=>{if(aN)return void ac();aP(!1),a&&(aR(a.title),aT(a.description||""),aV(a.priority),aX(null!=a.storyPoints?String(a.storyPoints):""),aZ((a.acceptanceCriteriaItems??[]).map(a=>({description:a.description,required:a.required??!0})))),a1(null)},ba=async()=>{if(!aQ.trim())return void a1(al("tasks.titleRequired"));a_(!0),a1(null);let c=aW.trim()?parseFloat(aW):null;if(aN){let a=await (0,O.A)({projectUuid:b,title:aQ.trim(),description:aS.trim()||void 0,priority:aU,storyPoints:c,acceptanceCriteria:null});a_(!1),a.success?(aL.length>0&&a.taskUuid&&(await Promise.all(aL.map(b=>(0,Y.w)(a.taskUuid,b.uuid))),aj?.()),ae?.(),ac(),am.refresh()):a1(a.error||al("tasks.createFailed"))}else{let d=(a.acceptanceCriteriaItems??[]).map(a=>({description:a.description,required:a.required??!0})),e=aY.filter(a=>a.description.trim().length>0),f=(0,W.K)(d,e);if(f&&0===e.length){a_(!1),a1(al("acceptanceCriteria.atLeastOneRequired"));return}let g=await (0,P.Y)({taskUuid:a.uuid,projectUuid:b,title:aQ.trim(),description:aS.trim()||null,priority:aU,storyPoints:c,...f?{acceptanceCriteriaItems:e.map(a=>({description:a.description.trim(),required:a.required}))}:{}});a_(!1),g.success?(aP(!1),am.refresh()):a1(g.error||al("tasks.updateFailed"))}},bb=async()=>{if(!a)return;a3(!0);let c=await (0,Q.T)(a.uuid,b);a3(!1),c.success&&(ac(),am.refresh())},bc=async b=>{if(!a)return;aI(null);let c=await (0,Y.w)(a.uuid,b);if(c.success){let a=aF.find(a=>a.uuid===b);a&&aA(b=>[...b,a]),aj?.()}else aI(c.error||al("tasks.failedToAddDep"))},bd=async b=>{if(!a)return;aI(null);let c=await (0,Z.T)(a.uuid,b);c.success?(aA(a=>a.filter(a=>a.uuid!==b)),aj?.()):aI(c.error||al("tasks.failedToRemoveDep"))},be=async b=>{if(!a)return;aI(null);let c=await (0,Z.T)(b,a.uuid);c.success?(aC(a=>a.filter(a=>a.uuid!==b)),aj?.()):aI(c.error||al("tasks.failedToRemoveDep"))},bf=aF.filter(b=>b.uuid!==a?.uuid&&!az.some(a=>a.uuid===b.uuid)),bg=aF.filter(a=>!aL.some(b=>b.uuid===a.uuid)),bh="sidebyside"===d;return(0,e.jsxs)(e.Fragment,{children:[!bh&&(0,e.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:ac}),(0,e.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 ${bh?`z-40 ${an?"":"animate-in slide-in-from-right duration-300"}`:`z-50 right-0 ${an?"":"animate-in slide-in-from-right duration-300"}`}`,style:bh?{right:`${ab.L8}px`}:void 0,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between border-b border-secondary px-6 py-5",children:[ak&&(0,e.jsx)(C.$,{variant:"ghost",size:"icon",className:"mr-2 h-8 w-8 shrink-0",onClick:ak,children:(0,e.jsx)(l.A,{className:"h-4 w-4 text-muted-foreground"})}),(0,e.jsx)("div",{className:"flex-1 min-w-0",children:aO?(0,e.jsx)("h2",{className:"text-base font-semibold text-foreground",children:aN?al("tasks.createTaskTitle"):al("tasks.editTask")}):a?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("h2",{className:"text-base font-semibold text-foreground truncate",children:a.title}),(0,e.jsxs)("div",{className:"mt-1.5 flex items-center gap-2",children:[(0,e.jsx)(A.E,{className:af[a.status]||"",children:al(`status.${ag[a.status]||a.status}`)}),(0,e.jsx)(A.E,{className:ah[a.priority]||"",children:al(`priority.${ai[a.priority]||a.priority}`)}),a.storyPoints&&(0,e.jsxs)("span",{className:"rounded bg-secondary px-2 py-0.5 text-xs font-medium text-muted-foreground",children:[a.storyPoints,"h"]})]})]}):null}),(0,e.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[a&&!aO&&(0,e.jsxs)(C.$,{variant:"outline",size:"sm",className:"h-8 gap-1.5 border-border text-foreground",onClick:()=>{a&&(aR(a.title),aT(a.description||""),aV(a.priority),aX(null!=a.storyPoints?String(a.storyPoints):""),aZ((a.acceptanceCriteriaItems??[]).map(a=>({description:a.description,required:a.required??!0}))),a1(null),aP(!0))},children:[(0,e.jsx)(m.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,e.jsx)("span",{className:"text-xs",children:al("common.edit")})]}),(0,e.jsx)(C.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-border",onClick:aO&&!aN?a9:ac,children:(0,e.jsx)(j.A,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,e.jsx)(G.F,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:(0,e.jsx)("div",{className:"flex min-h-full flex-col px-6 py-5",children:aO?(0,e.jsxs)("div",{className:"space-y-5",children:[a0&&(0,e.jsx)("div",{className:"rounded-lg bg-destructive/10 p-3 text-sm text-destructive",children:a0}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(F.J,{htmlFor:"edit-title",className:"text-[13px] font-medium text-foreground",children:al("tasks.titleLabel")}),(0,e.jsx)(D.p,{id:"edit-title",value:aQ,onChange:a=>aR(a.target.value),className:"border-border text-sm focus-visible:ring-primary",autoFocus:!0})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(F.J,{htmlFor:"edit-description",className:"text-[13px] font-medium text-foreground",children:al("tasks.descriptionLabel")}),(0,e.jsx)(E.T,{id:"edit-description",value:aS,onChange:a=>aT(a.target.value),rows:4,className:"border-border text-sm resize-none focus-visible:ring-primary"})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(F.J,{htmlFor:"edit-priority",className:"text-[13px] font-medium text-foreground",children:al("tasks.priorityLabel")}),(0,e.jsxs)(H.l6,{value:aU,onValueChange:aV,children:[(0,e.jsx)(H.bq,{className:"border-border text-sm focus:ring-primary",children:(0,e.jsx)(H.yv,{})}),(0,e.jsxs)(H.gC,{children:[(0,e.jsx)(H.eb,{value:"low",children:al("priority.low")}),(0,e.jsx)(H.eb,{value:"medium",children:al("priority.medium")}),(0,e.jsx)(H.eb,{value:"high",children:al("priority.high")})]})]})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(F.J,{htmlFor:"edit-story-points",className:"text-[13px] font-medium text-foreground",children:al("tasks.storyPointsLabel")}),(0,e.jsx)(D.p,{id:"edit-story-points",type:"number",min:"0",step:"0.5",value:aW,onChange:a=>aX(a.target.value),className:"border-border text-sm focus-visible:ring-primary"})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(F.J,{className:"text-[13px] font-medium text-foreground",children:al("acceptanceCriteria.title")}),(0,e.jsx)(W.C,{items:aY,onChange:aZ})]}),aN&&(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(F.J,{className:"text-[13px] font-medium text-foreground",children:al("tasks.dependencies")}),aL.length>0&&(0,e.jsx)("div",{className:"space-y-1.5",children:aL.map(a=>(0,e.jsxs)("div",{className:"group flex items-center justify-between rounded-lg bg-background p-2.5",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,e.jsx)(i.A,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),(0,e.jsx)("span",{className:"text-xs text-foreground truncate",children:a.title}),(0,e.jsx)(A.E,{className:`shrink-0 text-[10px] ${af[a.status]||""}`,children:al(`status.${ag[a.status]||a.status}`)})]}),(0,e.jsx)(C.$,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",onClick:()=>aM(b=>b.filter(b=>b.uuid!==a.uuid)),children:(0,e.jsx)(j.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] hover:text-[#D32F2F]"})})]},a.uuid))}),bg.length>0&&(0,e.jsxs)(H.l6,{onValueChange:a=>{let b=aF.find(b=>b.uuid===a);b&&aM(a=>[...a,b])},children:[(0,e.jsx)(H.bq,{className:"h-8 border-border text-xs text-muted-foreground focus:ring-primary",children:(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(k.A,{className:"h-3 w-3"}),(0,e.jsx)(H.yv,{placeholder:al("tasks.addDependency")})]})}),(0,e.jsx)(H.gC,{children:bg.map(a=>(0,e.jsx)(H.eb,{value:a.uuid,children:(0,e.jsx)("span",{className:"truncate",children:a.title})},a.uuid))})]},aL.length)]})]}):a?(0,e.jsxs)(_.P.div,{variants:aa.qG,initial:"initial",animate:"animate",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("common.assignee")}),(0,e.jsx)("div",{className:"mt-2 flex items-center gap-2.5 rounded-lg bg-background p-3",children:a.assignee?(0,e.jsxs)(e.Fragment,{children:[(0,M.bB)(a.assignee)?(0,e.jsx)(K.AgentAvatar,{name:a.assignee.name,size:28,className:"rounded-full"}):(0,e.jsx)(J.eu,{className:"h-7 w-7",children:(0,e.jsx)(J.q5,{className:"bg-border text-muted-foreground",children:a.assignee.name.charAt(0).toUpperCase()})}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"text-sm font-medium text-foreground",children:a.assignee.name}),(0,e.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,M.bB)(a.assignee)?`${al("common.agent")} • ${a.assignee.assignedAt?(0,$.r)(a.assignee.assignedAt):""}`:al("common.user")}),"agent_instance"===a.assignee.type&&a.assignee.instance&&(0,e.jsx)("div",{className:"mt-1",children:(0,e.jsx)(L.jQ,{cwd:a.assignee.instance.cwd,host:a.assignee.instance.host})})]})]}):(0,e.jsx)("span",{className:"text-sm text-[#9A9A9A]",children:al("common.unassigned")})})]}),aJ.length>0&&(0,e.jsxs)("div",{className:"mt-5",children:[(0,e.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("sessions.activeWorkers")}),(0,e.jsx)("div",{className:"mt-2 space-y-1.5",children:aJ.map(a=>(0,e.jsxs)("div",{className:"flex items-center gap-2.5 rounded-lg bg-background p-2.5",children:[(0,e.jsxs)("div",{className:"relative flex-shrink-0",children:[(0,e.jsx)(K.AgentAvatar,{name:a.agentName,size:28,className:"rounded-full"}),(0,e.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 h-2 w-2 rounded-full bg-green-500 ring-2 ring-background"})]}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"text-xs font-medium text-foreground truncate",children:a.sessionName}),(0,e.jsxs)("div",{className:"text-[10px] text-[#9A9A9A]",children:[a.agentName," \xb7 ",ad(a.checkinAt,al)]})]})]},a.sessionUuid))})]}),(0,e.jsxs)("div",{className:"mt-5",children:[(0,e.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("common.description")}),(0,e.jsx)("div",{className:"mt-2",children:a.description?(0,e.jsx)("div",{className:"prose prose-sm max-w-none text-[13px] leading-relaxed text-foreground",children:(0,e.jsx)(V.MarkdownContent,{children:a.description})}):(0,e.jsx)("p",{className:"text-sm italic text-[#9A9A9A]",children:al("common.noDescription")})})]}),a.acceptanceCriteria&&!(a.acceptanceCriteriaItems&&a.acceptanceCriteriaItems.length>0)&&(0,e.jsxs)("div",{className:"mt-5",children:[(0,e.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("tasks.acceptanceCriteria")}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)("div",{className:"prose prose-sm max-w-none text-[13px] leading-relaxed text-foreground",children:(0,e.jsx)(V.MarkdownContent,{children:a.acceptanceCriteria})})})]}),av&&(0,e.jsxs)("div",{className:"mt-5",children:[(0,e.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("common.source")}),(0,e.jsx)("a",{href:`/projects/${b}/proposals/${av.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,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(n.A,{className:"h-3.5 w-3.5 text-primary"}),(0,e.jsx)("span",{className:"text-xs text-foreground",children:av.title})]})})]}),(0,e.jsxs)("div",{className:"mt-5",children:[(0,e.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("tasks.dependencies")}),aH&&(0,e.jsx)("div",{className:"mt-2 rounded-lg bg-destructive/10 p-2.5 text-xs text-destructive",children:aH}),aD?(0,e.jsx)("div",{className:"mt-2 flex items-center justify-center py-4",children:(0,e.jsx)(o.A,{className:"h-4 w-4 animate-spin text-[#9A9A9A]"})}):(0,e.jsxs)(e.Fragment,{children:[az.length>0&&(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,e.jsx)(p.A,{className:"h-3 w-3 text-[#9A9A9A]"}),(0,e.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("tasks.dependsOn")})]}),(0,e.jsx)("div",{className:"space-y-1.5",children:az.map(a=>(0,e.jsxs)("div",{className:"group flex items-center justify-between rounded-lg bg-background p-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,e.jsx)(i.A,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),(0,e.jsx)("span",{className:"text-xs text-foreground truncate",children:a.title}),(0,e.jsx)(A.E,{className:`shrink-0 text-[10px] ${af[a.status]||""}`,children:al(`status.${ag[a.status]||a.status}`)})]}),(0,e.jsx)(C.$,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",onClick:()=>bd(a.uuid),children:(0,e.jsx)(j.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] hover:text-[#D32F2F]"})})]},a.uuid))})]}),aB.length>0&&(0,e.jsxs)("div",{className:"mt-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,e.jsx)(p.A,{className:"h-3 w-3 rotate-180 text-[#9A9A9A]"}),(0,e.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("tasks.blockedByThis")})]}),(0,e.jsx)("div",{className:"space-y-1.5",children:aB.map(a=>(0,e.jsxs)("div",{className:"group flex items-center justify-between rounded-lg bg-background p-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,e.jsx)(i.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,e.jsx)("span",{className:"text-xs text-foreground truncate",children:a.title}),(0,e.jsx)(A.E,{className:`shrink-0 text-[10px] ${af[a.status]||""}`,children:al(`status.${ag[a.status]||a.status}`)})]}),(0,e.jsx)(C.$,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",onClick:()=>be(a.uuid),children:(0,e.jsx)(j.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] hover:text-[#D32F2F]"})})]},a.uuid))})]}),0===az.length&&0===aB.length&&(0,e.jsx)("p",{className:"mt-2 text-sm italic text-[#9A9A9A]",children:al("tasks.noDependencies")}),bf.length>0&&(0,e.jsx)("div",{className:"mt-3",children:(0,e.jsxs)(H.l6,{onValueChange:a=>bc(a),children:[(0,e.jsx)(H.bq,{className:"h-8 border-border text-xs text-muted-foreground focus:ring-primary",children:(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(k.A,{className:"h-3 w-3"}),(0,e.jsx)(H.yv,{placeholder:al("tasks.addDependency")})]})}),(0,e.jsx)(H.gC,{children:bf.map(a=>(0,e.jsx)(H.eb,{value:a.uuid,children:(0,e.jsx)("span",{className:"truncate",children:a.title})},a.uuid))})]},az.length)})]})]}),a&&a.acceptanceCriteriaItems&&a.acceptanceCriteriaItems.length>0&&(()=>{let b=a.acceptanceCriteriaItems,c=a.acceptanceSummary,d=a=>"passed"===a?(0,e.jsx)(q.A,{className:"h-4 w-4 text-green-600 dark:text-[#6FD19A]"}):"failed"===a?(0,e.jsx)(r.A,{className:"h-4 w-4 text-red-600 dark:text-[#F08078]"}):(0,e.jsx)(s.A,{className:"h-4 w-4 text-yellow-600 dark:text-[#E0B44E]"}),f=a=>"passed"===a?"bg-green-50 text-green-700 dark:bg-[#14281a] dark:text-[#6FD19A]":"failed"===a?"bg-red-50 text-red-700 dark:bg-[#331619] dark:text-[#F08078]":"bg-yellow-50 text-yellow-700 dark:bg-[#332a12] dark:text-[#E0B44E]",g=async(b,c)=>{(await (0,R.h)(a.uuid,[{uuid:b,status:c}])).success&&am.refresh()};return(0,e.jsxs)("div",{className:"mt-5",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("acceptanceCriteria.title")}),c&&(0,e.jsx)(A.E,{className:f(a.acceptanceStatus||"pending"),variant:"secondary",children:al("acceptanceCriteria.progress",{passed:c.passed,total:c.total})})]}),(0,e.jsxs)("div",{className:"mt-2 space-y-2",children:[b.map(b=>(0,e.jsx)(B.Zp,{className:"p-3",children:(0,e.jsxs)("div",{className:"flex items-start gap-2",children:[(0,e.jsx)("div",{className:"mt-0.5 shrink-0",children:d(b.status)}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,e.jsx)("span",{className:"text-xs text-foreground",children:b.description}),(0,e.jsx)(A.E,{variant:"outline",className:"text-[10px] shrink-0",children:b.required?al("acceptanceCriteria.required"):al("acceptanceCriteria.optional")})]}),(0,e.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-[10px]",children:[(0,e.jsx)("span",{className:"text-[#9A9A9A] w-20 shrink-0",children:al("acceptanceCriteria.devSelfCheck")}),(0,e.jsxs)(A.E,{className:`text-[10px] ${f(b.devStatus)}`,variant:"secondary",children:[d(b.devStatus),(0,e.jsx)("span",{className:"ml-1",children:al(`acceptanceCriteria.status.${b.devStatus}`)})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2 text-[10px]",children:[(0,e.jsx)("span",{className:"text-[#9A9A9A] w-20 shrink-0",children:al("acceptanceCriteria.verification")}),(0,e.jsxs)(A.E,{className:`text-[10px] ${f(b.status)}`,variant:"secondary",children:[d(b.status),(0,e.jsx)("span",{className:"ml-1",children:al(`acceptanceCriteria.status.${b.status}`)})]})]})]}),b.devEvidence&&(0,e.jsxs)("div",{className:"mt-2 rounded bg-background p-2",children:[(0,e.jsx)("span",{className:"text-[10px] font-medium text-[#9A9A9A]",children:al("acceptanceCriteria.devEvidence")}),(0,e.jsx)("p",{className:"text-[11px] text-foreground mt-0.5",children:b.devEvidence})]}),b.evidence&&(0,e.jsxs)("div",{className:"mt-2 rounded bg-background p-2",children:[(0,e.jsx)("span",{className:"text-[10px] font-medium text-[#9A9A9A]",children:al("acceptanceCriteria.verifyEvidence")}),(0,e.jsx)("p",{className:"text-[11px] text-foreground mt-0.5",children:b.evidence})]}),"pending"===b.status?(0,e.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,e.jsxs)(C.$,{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:()=>g(b.uuid,"passed"),children:[(0,e.jsx)(q.A,{className:"h-3.5 w-3.5 mr-1"}),al("acceptanceCriteria.pass")]}),(0,e.jsxs)(C.$,{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:()=>g(b.uuid,"failed"),children:[(0,e.jsx)(r.A,{className:"h-3.5 w-3.5 mr-1"}),al("acceptanceCriteria.fail")]})]}):(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(C.$,{size:"sm",variant:"ghost",className:"h-7 min-h-[44px] sm:min-h-0 text-xs text-[#9A9A9A] hover:text-foreground",onClick:async()=>{(await (0,S.N)(a.uuid,b.uuid)).success&&am.refresh()},children:al("acceptanceCriteria.undoVerification")})})]})]})},b.uuid)),c&&(c.requiredPending>0||c.requiredFailed>0)&&(0,e.jsxs)("div",{className:"flex items-center gap-2 rounded-lg bg-yellow-50 dark:bg-[#332a12] p-3 mt-2",children:[(0,e.jsx)(t.A,{className:"h-4 w-4 text-yellow-600 dark:text-[#E0B44E] shrink-0"}),(0,e.jsx)("span",{className:"text-xs text-yellow-700 dark:text-[#E0B44E]",children:al("acceptanceCriteria.gateBlocked",{count:c.requiredPending+c.requiredFailed})})]}),c&&0===c.requiredPending&&0===c.requiredFailed&&c.required>0&&(0,e.jsxs)("div",{className:"flex items-center gap-2 rounded-lg bg-green-50 dark:bg-[#14281a] p-3 mt-2",children:[(0,e.jsx)(q.A,{className:"h-4 w-4 text-green-600 dark:text-[#6FD19A] shrink-0"}),(0,e.jsx)("span",{className:"text-xs text-green-700 dark:text-[#6FD19A]",children:al("acceptanceCriteria.gateReady")})]})]})]})})(),(0,e.jsxs)("div",{className:"mt-5 flex-1",children:[(0,e.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("common.activity")}),(0,e.jsx)("div",{className:"mt-2 space-y-3",children:at?(0,e.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,e.jsx)(o.A,{className:"h-4 w-4 animate-spin text-[#9A9A9A]"})}):0===ar.length?(0,e.jsx)("p",{className:"text-sm text-[#9A9A9A] italic",children:al("common.noActivity")}):ar.map(a=>(0,e.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,e.jsx)("div",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-secondary",children:(0,e.jsx)("div",{className:`h-2 w-2 rounded-full ${function(a){switch(a){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"}}(a.action)}`})}),(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)("p",{className:"text-xs text-foreground",children:function(a,b){let c=a.sessionName?`${a.actorName} / ${a.sessionName}`:a.actorName,{action:d}=a;switch(d){case"task_created":return b("activity.taskCreated",{actor:c});case"task_assigned":return b("activity.taskAssigned",{actor:c});case"task_claimed":return b("activity.taskClaimed",{actor:c});case"task_started":return b("activity.taskStarted",{actor:c});case"task_submitted":return b("activity.taskSubmitted",{actor:c});case"task_completed":case"task_verified":return b("activity.taskCompleted",{actor:c});case"task_released":return b("activity.taskReleased",{actor:c});case"task_status_changed":return b("activity.taskStatusChanged",{actor:c});default:return`${c}: ${d}`}}(a,al)}),(0,e.jsx)("p",{className:"text-[10px] text-[#9A9A9A]",children:ad(a.createdAt,al)})]})]},a.uuid))})]}),(0,e.jsxs)("div",{className:"mt-5",children:[(0,e.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("references.title")}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(U.ReferencesSection,{targetType:"task",targetUuid:a.uuid,canWrite:!0,compact:!0})})]}),(0,e.jsxs)("div",{className:"mt-5",children:[(0,e.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:al("comments.title")}),(0,e.jsx)("div",{className:"mt-3",children:(0,e.jsx)(T.$m,{targetType:"task",targetUuid:a.uuid,currentUserUuid:c,compact:!0})})]})]}):null})}),(0,e.jsx)("div",{className:"border-t border-secondary px-6 py-4",children:(0,e.jsx)("div",{className:"flex items-center gap-3",children:aO?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(C.$,{variant:"outline",className:"border-border",onClick:a9,disabled:a$,children:al("common.cancel")}),(0,e.jsx)(C.$,{className:"bg-primary hover:bg-[#B56A42] text-white",onClick:ba,disabled:a$||!aQ.trim(),children:a$?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(o.A,{className:"mr-2 h-4 w-4 animate-spin"}),al("common.saving")]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(u.A,{className:"mr-2 h-4 w-4"}),aN?al("common.create"):al("tasks.saveChanges")]})})]}):a?(0,e.jsxs)(e.Fragment,{children:["done"!==a.status&&"closed"!==a.status&&(0,e.jsxs)(C.$,{variant:"outline",className:"border-border",onClick:()=>ay(!0),disabled:ap,children:[(0,e.jsx)(v.A,{className:"mr-2 h-4 w-4"}),al("common.assign")]}),a5&&(0,e.jsxs)(C.$,{className:"flex-1 bg-[#1976D2] hover:bg-[#1565C0] text-white",onClick:()=>a8("in_progress"),disabled:ap,children:[(0,e.jsx)(w.A,{className:"mr-2 h-4 w-4"}),al("tasks.startWork")]}),a6&&(0,e.jsxs)(C.$,{className:"flex-1 bg-[#7B1FA2] hover:bg-[#6A1B9A] text-white",onClick:()=>a8("to_verify"),disabled:ap,children:[(0,e.jsx)(x.A,{className:"mr-2 h-4 w-4"}),al("tasks.submitForReview")]}),a7&&(0,e.jsxs)(C.$,{className:"flex-1 bg-[#22C55E] hover:bg-[#16A34A] text-white",onClick:()=>a8("done"),disabled:ap,children:[(0,e.jsx)(y.A,{className:"mr-2 h-4 w-4"}),al("tasks.markAsVerified")]}),("done"===a.status||"closed"===a.status)&&(0,e.jsx)("div",{className:"text-sm text-[#9A9A9A] text-center w-full",children:al("tasks.taskCompleted")}),(0,e.jsx)("div",{className:"ml-auto",children:(0,e.jsxs)(I.Lt,{children:[(0,e.jsx)(I.tv,{asChild:!0,children:(0,e.jsx)(C.$,{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,e.jsx)(z.A,{className:"h-4 w-4"})})}),(0,e.jsxs)(I.EO,{children:[(0,e.jsxs)(I.wd,{children:[(0,e.jsx)(I.r7,{children:al("tasks.deleteTask")}),(0,e.jsx)(I.$v,{children:al("tasks.deleteTaskConfirm",{title:a.title})})]}),(0,e.jsxs)(I.ck,{children:[(0,e.jsx)(I.Zr,{children:al("common.cancel")}),(0,e.jsx)(I.Rx,{variant:"destructive",onClick:bb,disabled:a2,children:a2?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(o.A,{className:"mr-2 h-4 w-4 animate-spin"}),al("common.delete")]}):al("common.delete")})]})]})]})})]}):null})})]}),a&&ax&&(0,e.jsx)(X.Q,{task:a,projectUuid:b,currentUserUuid:c,onClose:()=>ay(!1)})]})}d()}catch(a){d(a)}})},87707:(a,b,c)=>{c.d(b,{Q:()=>y});var d=c(10837),e=c(21968),f=c(68884),g=c(9222),h=c(86460),i=c(21692),j=c(97443),k=c(42424),l=c(6871),m=c(94214),n=c(2852),o=c(11225),p=c(55732),q=c(23871),r=c(27696),s=c(27876),t=c(42377);t.callServer,t.findSourceMapURL,t.callServer,t.findSourceMapURL;let u=(0,t.createServerReference)("402c386373a4fabf2ad2d5dfaa365acb288aac83a0",t.callServer,void 0,t.findSourceMapURL,"claimTaskAction"),v=(0,t.createServerReference)("70282f0868538e338c4b3140249ed90c558fa6ab54",t.callServer,void 0,t.findSourceMapURL,"claimTaskToAgentAction"),w=(0,t.createServerReference)("60c2047b27bf7270af9d1a080b9e280000f8a9a205",t.callServer,void 0,t.findSourceMapURL,"claimTaskToUserAction"),x=(0,t.createServerReference)("40f2bf09e6782d17c46f275c86a593725b6ca03e60",t.callServer,void 0,t.findSourceMapURL,"releaseTaskAction");function y({task:a,projectUuid:b,currentUserUuid:c,onClose:t}){let y=(0,g.c)(),z=(0,f.r)(),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)("self"),[E,F]=(0,e.useState)(""),[G,H]=(0,e.useState)(""),[I,J]=(0,e.useState)([]),[K,L]=(0,e.useState)([]),[M,N]=(0,e.useState)(!0),[O,P]=(0,e.useState)(null),[Q,R]=(0,e.useState)([]),[S,T]=(0,e.useState)(!1),[U,V]=(0,e.useState)(null),[W,X]=(0,e.useState)(null),Y=!!a.assignee,Z=Q.find(a=>a.connectionUuid===W)??null,$=new Set(Q.map(a=>a.host)).size>1,_=async()=>{let b;if(B(!0),P(null),"self"===C)b=await u(a.uuid);else if("agent"===C&&E)b=await v(a.uuid,E,Z?.agentInstanceUuid??void 0);else if("user"===C&&G)b=await w(a.uuid,G);else{if("release"!==C)return void B(!1);b=await x(a.uuid)}B(!1),b?.success?(t(),z.refresh()):b?.error&&P(b.error)},aa="self"===C||"agent"===C&&E||"user"===C&&G||"release"===C&&Y;return(0,d.jsxs)(m._8,{open:!0,onOpenChange:a=>{a||t()},className:"bg-card sm:max-w-[400px]",header:(0,d.jsx)(m.AI,{className:"text-base font-semibold text-foreground",children:y("tasks.assignTask")}),footer:(0,d.jsxs)("div",{className:"flex w-full items-center justify-end gap-4",children:[(0,d.jsx)(k.$,{variant:"outline",onClick:t,disabled:A,className:"border-border",children:y("common.cancel")}),(0,d.jsx)(k.$,{onClick:_,disabled:A||!aa,className:"bg-primary hover:bg-[#B56A42] text-white",children:A?(0,d.jsx)(h.A,{className:"h-4 w-4 animate-spin"}):"release"===C?y("common.release"):function(){if("agent"!==C||!Z)return y("common.assign");let a=(0,r.kn)(Z.cwd),b=a.isUnknown?y(a.label):a.label,c=(0,r.g9)(Z.host),d=c.isUnknown?y(c.label):c.label;return $?y("assignInstance.assignToWithHost",{path:b,host:d}):y("assignInstance.assignTo",{path:b})}()})]}),bodyClassName:"space-y-4",children:[(0,d.jsxs)("div",{className:"rounded-lg bg-background p-3",children:[(0,d.jsx)("p",{className:"text-[13px] font-medium text-foreground",children:a.title}),a.description&&(0,d.jsx)("p",{className:"mt-1 text-[11px] text-muted-foreground line-clamp-2",children:a.description})]}),Y&&(0,d.jsx)("div",{className:"rounded-lg bg-[#E3F2FD] dark:bg-[#13253a] p-3",children:(0,d.jsxs)("p",{className:"text-xs text-[#1976D2] dark:text-[#5AA9F0]",children:[y("common.currentAssignee"),": ",(0,d.jsx)("span",{className:"font-medium",children:a.assignee?.name})]})}),O&&(0,d.jsx)("div",{className:"rounded-lg bg-[#FEE2E2] dark:bg-[#331619] p-3",children:(0,d.jsx)("p",{className:"text-xs text-[#D32F2F] dark:text-[#F08078]",children:O})}),(0,d.jsx)("p",{className:"text-[13px] text-muted-foreground",children:y("assign.selectAssignee")}),M?(0,d.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,d.jsx)(h.A,{className:"h-6 w-6 animate-spin text-[#9A9A9A]"})}):(0,d.jsxs)(o.z,{value:C,onValueChange:a=>D(a),className:"space-y-3",children:[(0,d.jsxs)("div",{className:`rounded-[10px] p-4 transition-colors cursor-pointer ${"self"===C?"bg-[#FDF8F6] dark:bg-[#201d1b] border-2 border-primary":"bg-card border border-border hover:border-primary/50"}`,onClick:()=>D("self"),children:[(0,d.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,d.jsx)(o.C,{value:"self",id:"self",className:"border-primary text-primary"}),(0,d.jsx)(n.J,{htmlFor:"self",className:"text-sm font-medium text-foreground cursor-pointer",children:y("assign.assignToMyself")})]}),(0,d.jsx)("p",{className:"mt-2 ml-6 text-xs text-muted-foreground leading-relaxed",children:y("assign.assignToMyselfDesc")})]}),(0,d.jsxs)("div",{className:`rounded-[10px] p-4 transition-colors ${"agent"===C?"bg-[#FDF8F6] dark:bg-[#201d1b] border-2 border-primary":"bg-card border border-border"}`,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2.5 cursor-pointer",onClick:()=>D("agent"),children:[(0,d.jsx)(o.C,{value:"agent",id:"agent",className:"border-primary text-primary"}),(0,d.jsx)(n.J,{htmlFor:"agent",className:"text-sm font-medium text-foreground cursor-pointer",children:y("assign.orAssignToAgent")})]}),(0,d.jsx)("p",{className:"mt-2 ml-6 text-xs text-muted-foreground leading-relaxed",children:y("tasks.onlySelectedAgentCanWork")}),"agent"===C&&(0,d.jsxs)("div",{className:"mt-3 ml-6 space-y-3",children:[(0,d.jsxs)(p.l6,{value:E,onValueChange:F,children:[(0,d.jsx)(p.bq,{className:"w-full border-border",children:(0,d.jsx)(p.yv,{placeholder:y("tasks.selectAgent")})}),(0,d.jsx)(p.gC,{className:"z-[120]",children:I.length>0?I.map(a=>(0,d.jsx)(p.eb,{value:a.uuid,children:(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(l.AgentAvatar,{name:a.name,size:16,className:"rounded-full"}),(0,d.jsx)("span",{children:a.name})]})},a.uuid)):(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-[#9A9A9A]",children:y("tasks.noAgentsAvailable")})})]}),E&&(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:y("assignInstance.workingDirectory")}),S?(0,d.jsxs)("div",{className:"flex items-center gap-2 py-2 text-xs text-[#9A9A9A]",children:[(0,d.jsx)(h.A,{className:"h-3.5 w-3.5 animate-spin"}),y("assignInstance.loadingInstances")]}):U?.source==="project_fixed"?(0,d.jsx)(s.Y,{target:U}):0===Q.length?(0,d.jsx)("p",{className:"rounded-lg bg-background p-2.5 text-[11px] leading-relaxed text-muted-foreground",children:y("assignInstance.noInstances")}):(0,d.jsx)(q.O,{instances:Q,selectedConnectionUuid:W,onSelect:a=>X(a.connectionUuid),ariaLabel:y("assignInstance.workingDirectory")}),U?.source!=="project_fixed"&&(0,d.jsxs)("div",{className:"flex items-start gap-1.5 text-[11px] leading-relaxed text-[#9A8C7E]",children:[(0,d.jsx)(i.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0","aria-hidden":!0}),(0,d.jsx)("span",{children:y("assignInstance.pinNote")})]})]})]})]}),(0,d.jsxs)("div",{className:`rounded-[10px] p-4 transition-colors ${"user"===C?"bg-[#FDF8F6] dark:bg-[#201d1b] border-2 border-primary":"bg-card border border-border"}`,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2.5 cursor-pointer",onClick:()=>D("user"),children:[(0,d.jsx)(o.C,{value:"user",id:"user",className:"border-primary text-primary"}),(0,d.jsx)(n.J,{htmlFor:"user",className:"text-sm font-medium text-foreground cursor-pointer",children:y("assign.orAssignToUser")})]}),"user"===C&&(0,d.jsx)("div",{className:"mt-3 ml-6",children:(0,d.jsxs)(p.l6,{value:G,onValueChange:H,children:[(0,d.jsx)(p.bq,{className:"w-full border-border",children:(0,d.jsx)(p.yv,{placeholder:y("tasks.selectUser")})}),(0,d.jsx)(p.gC,{className:"z-[120]",children:K.length>0?K.map(a=>(0,d.jsx)(p.eb,{value:a.uuid,children:(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(j.A,{className:"h-4 w-4 text-muted-foreground"}),(0,d.jsx)("span",{children:a.name||a.email})]})},a.uuid)):(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-[#9A9A9A]",children:y("tasks.noUsersAvailable")})})]})})]}),Y&&(0,d.jsxs)("div",{className:`rounded-[10px] p-4 transition-colors cursor-pointer ${"release"===C?"bg-[#FDF8F6] dark:bg-[#201d1b] border-2 border-primary":"bg-card border border-border hover:border-primary/50"}`,onClick:()=>D("release"),children:[(0,d.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,d.jsx)(o.C,{value:"release",id:"release",className:"border-primary text-primary"}),(0,d.jsx)(n.J,{htmlFor:"release",className:"text-sm font-medium text-foreground cursor-pointer",children:y("assign.releaseAssignee")})]}),(0,d.jsx)("p",{className:"mt-2 ml-6 text-xs text-muted-foreground leading-relaxed",children:y("assign.releaseAssigneeDesc")})]})]})]})}},94037:(a,b,c)=>{c.d(b,{x:()=>e});var d=c(42377);let e=(0,d.createServerReference)("40d05690894458aaf82b0c2c4be8ee949fcaca80e7",d.callServer,void 0,d.findSourceMapURL,"getTaskDependenciesAction")},98625:(a,b,c)=>{c.d(b,{T:()=>f});var d=c(21968),e=c(1007);function f(a,b){let c=(0,e.useSearchParams)(),f=(0,d.useRef)(!1),g=!f.current;f.current=!0;let h=c.get("panel")??(g?b??null:null),i=c.get("tab"),j=(0,d.useCallback)((b,c)=>{let d=new URLSearchParams(window.location.search);b?d.set("panel",b):d.delete("panel"),c?d.set("tab",c):d.delete("tab");let e=d.toString();return e?`${a}?${e}`:a},[a]),k=(0,d.useCallback)((a,b)=>{window.history.replaceState(null,"",j(a,b))},[j]),l=(0,d.useCallback)(()=>{window.history.replaceState(null,"",j(null))},[j]),m=(0,d.useCallback)(a=>{h&&window.history.replaceState(null,"",j(h,a))},[j,h]);return{selectedId:h,selectedTab:i,openPanel:k,closePanel:l,switchTab:m}}}};