@chorus-aidlc/chorus 0.9.1 → 0.9.2

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 (223) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-build-manifest.json +179 -179
  3. package/.next/standalone/.next/app-path-routes-manifest.json +29 -29
  4. package/.next/standalone/.next/build-manifest.json +2 -2
  5. package/.next/standalone/.next/prerender-manifest.json +42 -42
  6. package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page.js +2 -2
  7. package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page_client-reference-manifest.js +1 -1
  8. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/activity/page.js +1 -1
  9. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/activity/page_client-reference-manifest.js +1 -1
  10. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/[ideaUuid]/page.js +1 -1
  11. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/[ideaUuid]/page_client-reference-manifest.js +1 -1
  12. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page.js +2 -2
  13. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page.js.nft.json +1 -1
  14. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page.js +1 -1
  16. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page_client-reference-manifest.js +1 -1
  17. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page.js +2 -2
  18. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page_client-reference-manifest.js +1 -1
  19. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/ideas/[ideaUuid]/page.js +1 -1
  20. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/ideas/[ideaUuid]/page.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/ideas/[ideaUuid]/page_client-reference-manifest.js +1 -1
  22. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/ideas/page.js +2 -2
  23. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/ideas/page.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/ideas/page_client-reference-manifest.js +1 -1
  25. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page.js +2 -2
  26. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page_client-reference-manifest.js +1 -1
  28. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page.js +1 -1
  29. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page_client-reference-manifest.js +1 -1
  30. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page.js +2 -2
  31. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page_client-reference-manifest.js +1 -1
  32. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page.js +1 -1
  33. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page_client-reference-manifest.js +1 -1
  35. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page.js +1 -1
  36. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page_client-reference-manifest.js +1 -1
  38. package/.next/standalone/.next/server/app/(dashboard)/projects/page.js +2 -2
  39. package/.next/standalone/.next/server/app/(dashboard)/projects/page_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/(dashboard)/settings/page.js +2 -2
  41. package/.next/standalone/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  44. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  45. package/.next/standalone/.next/server/app/_not-found.rsc +1 -1
  46. package/.next/standalone/.next/server/app/admin/companies/[uuid]/page_client-reference-manifest.js +1 -1
  47. package/.next/standalone/.next/server/app/admin/companies/new/page_client-reference-manifest.js +1 -1
  48. package/.next/standalone/.next/server/app/admin/companies/new.html +1 -1
  49. package/.next/standalone/.next/server/app/admin/companies/new.rsc +1 -1
  50. package/.next/standalone/.next/server/app/admin/companies/page_client-reference-manifest.js +1 -1
  51. package/.next/standalone/.next/server/app/admin/companies.html +1 -1
  52. package/.next/standalone/.next/server/app/admin/companies.rsc +1 -1
  53. package/.next/standalone/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  54. package/.next/standalone/.next/server/app/admin.html +1 -1
  55. package/.next/standalone/.next/server/app/admin.rsc +1 -1
  56. package/.next/standalone/.next/server/app/api/admin/companies/[uuid]/route_client-reference-manifest.js +1 -1
  57. package/.next/standalone/.next/server/app/api/admin/companies/route_client-reference-manifest.js +1 -1
  58. package/.next/standalone/.next/server/app/api/admin/login/route_client-reference-manifest.js +1 -1
  59. package/.next/standalone/.next/server/app/api/admin/session/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/refresh/route_client-reference-manifest.js +1 -1
  73. package/.next/standalone/.next/server/app/api/auth/session/route_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app/api/auth/sync-token/route_client-reference-manifest.js +1 -1
  75. package/.next/standalone/.next/server/app/api/comments/route_client-reference-manifest.js +1 -1
  76. package/.next/standalone/.next/server/app/api/documents/[uuid]/route_client-reference-manifest.js +1 -1
  77. package/.next/standalone/.next/server/app/api/events/notifications/route_client-reference-manifest.js +1 -1
  78. package/.next/standalone/.next/server/app/api/events/route_client-reference-manifest.js +1 -1
  79. package/.next/standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  80. package/.next/standalone/.next/server/app/api/ideas/[uuid]/claim/route_client-reference-manifest.js +1 -1
  81. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/preview/route_client-reference-manifest.js +1 -1
  82. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/route_client-reference-manifest.js +1 -1
  83. package/.next/standalone/.next/server/app/api/ideas/[uuid]/release/route_client-reference-manifest.js +1 -1
  84. package/.next/standalone/.next/server/app/api/ideas/[uuid]/route_client-reference-manifest.js +1 -1
  85. package/.next/standalone/.next/server/app/api/mcp/route.js +1 -1
  86. package/.next/standalone/.next/server/app/api/mcp/route_client-reference-manifest.js +1 -1
  87. package/.next/standalone/.next/server/app/api/me/assignments/route_client-reference-manifest.js +1 -1
  88. package/.next/standalone/.next/server/app/api/mentionables/route_client-reference-manifest.js +1 -1
  89. package/.next/standalone/.next/server/app/api/notifications/[uuid]/archive/route_client-reference-manifest.js +1 -1
  90. package/.next/standalone/.next/server/app/api/notifications/[uuid]/read/route_client-reference-manifest.js +1 -1
  91. package/.next/standalone/.next/server/app/api/notifications/preferences/route_client-reference-manifest.js +1 -1
  92. package/.next/standalone/.next/server/app/api/notifications/read-all/route_client-reference-manifest.js +1 -1
  93. package/.next/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  94. package/.next/standalone/.next/server/app/api/notifications/unread-count/route_client-reference-manifest.js +1 -1
  95. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/dashboard/route_client-reference-manifest.js +1 -1
  96. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/route_client-reference-manifest.js +1 -1
  97. package/.next/standalone/.next/server/app/api/project-groups/route_client-reference-manifest.js +1 -1
  98. package/.next/standalone/.next/server/app/api/projects/[uuid]/activity/route_client-reference-manifest.js +1 -1
  99. package/.next/standalone/.next/server/app/api/projects/[uuid]/available/route_client-reference-manifest.js +1 -1
  100. package/.next/standalone/.next/server/app/api/projects/[uuid]/documents/route_client-reference-manifest.js +1 -1
  101. package/.next/standalone/.next/server/app/api/projects/[uuid]/group/route_client-reference-manifest.js +1 -1
  102. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/route_client-reference-manifest.js +1 -1
  103. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/tracker/route_client-reference-manifest.js +1 -1
  104. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/[proposalUuid]/validate/route_client-reference-manifest.js +1 -1
  105. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/route_client-reference-manifest.js +1 -1
  106. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/summary/route_client-reference-manifest.js +1 -1
  107. package/.next/standalone/.next/server/app/api/projects/[uuid]/route_client-reference-manifest.js +1 -1
  108. package/.next/standalone/.next/server/app/api/projects/[uuid]/stats/route_client-reference-manifest.js +1 -1
  109. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/dependencies/route_client-reference-manifest.js +1 -1
  110. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/route_client-reference-manifest.js +1 -1
  111. package/.next/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  112. package/.next/standalone/.next/server/app/api/proposals/[uuid]/approve/route_client-reference-manifest.js +1 -1
  113. package/.next/standalone/.next/server/app/api/proposals/[uuid]/close/route_client-reference-manifest.js +1 -1
  114. package/.next/standalone/.next/server/app/api/proposals/[uuid]/reject/route_client-reference-manifest.js +1 -1
  115. package/.next/standalone/.next/server/app/api/proposals/[uuid]/revoke/route_client-reference-manifest.js +1 -1
  116. package/.next/standalone/.next/server/app/api/proposals/[uuid]/route_client-reference-manifest.js +1 -1
  117. package/.next/standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  118. package/.next/standalone/.next/server/app/api/sessions/[uuid]/route_client-reference-manifest.js +1 -1
  119. package/.next/standalone/.next/server/app/api/tasks/[uuid]/claim/route_client-reference-manifest.js +1 -1
  120. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/[dependsOnUuid]/route_client-reference-manifest.js +1 -1
  121. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/route_client-reference-manifest.js +1 -1
  122. package/.next/standalone/.next/server/app/api/tasks/[uuid]/release/route_client-reference-manifest.js +1 -1
  123. package/.next/standalone/.next/server/app/api/tasks/[uuid]/route_client-reference-manifest.js +1 -1
  124. package/.next/standalone/.next/server/app/api/tasks/[uuid]/sessions/route_client-reference-manifest.js +1 -1
  125. package/.next/standalone/.next/server/app/index.html +1 -1
  126. package/.next/standalone/.next/server/app/index.rsc +1 -1
  127. package/.next/standalone/.next/server/app/login/admin/page_client-reference-manifest.js +1 -1
  128. package/.next/standalone/.next/server/app/login/admin.html +1 -1
  129. package/.next/standalone/.next/server/app/login/admin.rsc +1 -1
  130. package/.next/standalone/.next/server/app/login/callback/page_client-reference-manifest.js +1 -1
  131. package/.next/standalone/.next/server/app/login/callback.html +1 -1
  132. package/.next/standalone/.next/server/app/login/callback.rsc +1 -1
  133. package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  134. package/.next/standalone/.next/server/app/login/pick-workspace/page_client-reference-manifest.js +1 -1
  135. package/.next/standalone/.next/server/app/login/pick-workspace.html +1 -1
  136. package/.next/standalone/.next/server/app/login/pick-workspace.rsc +1 -1
  137. package/.next/standalone/.next/server/app/login/silent-refresh/page_client-reference-manifest.js +1 -1
  138. package/.next/standalone/.next/server/app/login/silent-refresh.html +1 -1
  139. package/.next/standalone/.next/server/app/login/silent-refresh.rsc +1 -1
  140. package/.next/standalone/.next/server/app/login.html +1 -1
  141. package/.next/standalone/.next/server/app/login.rsc +1 -1
  142. package/.next/standalone/.next/server/app/onboarding/page.js +3 -3
  143. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  144. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  145. package/.next/standalone/.next/server/app/onboarding.html +1 -1
  146. package/.next/standalone/.next/server/app/onboarding.rsc +2 -2
  147. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  148. package/.next/standalone/.next/server/app/projects.html +1 -1
  149. package/.next/standalone/.next/server/app/projects.rsc +2 -2
  150. package/.next/standalone/.next/server/app/settings.html +1 -1
  151. package/.next/standalone/.next/server/app/settings.rsc +3 -3
  152. package/.next/standalone/.next/server/app-paths-manifest.json +29 -29
  153. package/.next/standalone/.next/server/chunks/2990.js +1 -0
  154. package/.next/standalone/.next/server/chunks/4090.js +2 -2
  155. package/.next/standalone/.next/server/chunks/5491.js +1 -0
  156. package/.next/standalone/.next/server/chunks/6207.js +1 -1
  157. package/.next/standalone/.next/server/chunks/{5044.js → 6878.js} +1 -1
  158. package/.next/standalone/.next/server/chunks/7578.js +2 -2
  159. package/.next/standalone/.next/server/chunks/7621.js +1 -0
  160. package/.next/standalone/.next/server/chunks/8144.js +1 -0
  161. package/.next/standalone/.next/server/chunks/8637.js +1 -1
  162. package/.next/standalone/.next/server/chunks/9508.js +2 -2
  163. package/.next/standalone/.next/server/middleware-manifest.json +5 -5
  164. package/.next/standalone/.next/server/pages/404.html +1 -1
  165. package/.next/standalone/.next/server/pages/500.html +1 -1
  166. package/.next/standalone/.next/server/pages-manifest.json +1 -1
  167. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  168. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  169. package/.next/standalone/.next/static/chunks/19126-12ce8ade288ce1dc.js +1 -0
  170. package/.next/standalone/.next/static/chunks/19898-7e07c69b635e3662.js +1 -0
  171. package/.next/standalone/.next/static/chunks/35486-1978488574385a45.js +1 -0
  172. package/.next/standalone/.next/static/chunks/52206-51a89715ca643e44.js +1 -0
  173. package/.next/standalone/.next/static/chunks/60011-b602fea2afba6992.js +1 -0
  174. package/.next/standalone/.next/static/chunks/{32190-a110356fb68a4333.js → 75444-976ac95fd66e7988.js} +1 -1
  175. package/.next/standalone/.next/static/chunks/app/(dashboard)/layout-dd7eb66bb4ffd252.js +1 -0
  176. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/dashboard/page-6d92b9867caf0fe1.js +1 -0
  177. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page-f8f17f58cf779d37.js +1 -0
  178. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/page-83e2e42b27132b41.js +1 -0
  179. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/ideas/[ideaUuid]/{page-405cc5757c9116ed.js → page-55148db4b28ee5f5.js} +1 -1
  180. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/ideas/{page-1591999fb2994672.js → page-556c181809c9e4f6.js} +1 -1
  181. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page-656797940b35b23c.js +1 -0
  182. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/new/{page-31f4ffd9778a39ed.js → page-414b398806324ad1.js} +1 -1
  183. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/page-af88aeaedc3f4ae5.js +1 -0
  184. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/{page-00ae31e877b4b261.js → page-6524ab00e6cdf59a.js} +1 -1
  185. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/{page-b148c338bed81dce.js → page-7b0bb5f037cd320b.js} +1 -1
  186. package/.next/standalone/.next/static/chunks/app/(dashboard)/settings/page-db79d84fa8ca8cbf.js +1 -0
  187. package/.next/standalone/.next/static/chunks/app/onboarding/{page-9768ac847f5b2b48.js → page-7a00689ba561c111.js} +1 -1
  188. package/.next/standalone/package.json +1 -1
  189. package/.next/standalone/public/chorus-plugin/.claude-plugin/plugin.json +1 -1
  190. package/.next/standalone/public/chorus-plugin/agents/proposal-reviewer.md +3 -2
  191. package/.next/standalone/public/chorus-plugin/agents/task-reviewer.md +1 -1
  192. package/.next/standalone/public/chorus-plugin/skills/brainstorm/SKILL.md +1 -1
  193. package/.next/standalone/public/chorus-plugin/skills/chorus/SKILL.md +2 -2
  194. package/.next/standalone/public/chorus-plugin/skills/develop/SKILL.md +3 -2
  195. package/.next/standalone/public/chorus-plugin/skills/idea/SKILL.md +1 -1
  196. package/.next/standalone/public/chorus-plugin/skills/openspec-aware/SKILL.md +1 -1
  197. package/.next/standalone/public/chorus-plugin/skills/proposal/SKILL.md +6 -4
  198. package/.next/standalone/public/chorus-plugin/skills/quick-dev/SKILL.md +1 -1
  199. package/.next/standalone/public/chorus-plugin/skills/review/SKILL.md +5 -3
  200. package/.next/standalone/public/chorus-plugin/skills/yolo/SKILL.md +1 -1
  201. package/.next/standalone/public/skill/chorus/SKILL.md +1 -1
  202. package/.next/standalone/public/skill/develop-chorus/SKILL.md +2 -1
  203. package/.next/standalone/public/skill/proposal-chorus/SKILL.md +5 -3
  204. package/.next/standalone/public/skill/review-chorus/SKILL.md +4 -2
  205. package/package.json +1 -1
  206. package/.next/standalone/.next/server/chunks/3405.js +0 -1
  207. package/.next/standalone/.next/server/chunks/4043.js +0 -1
  208. package/.next/standalone/.next/server/chunks/6592.js +0 -1
  209. package/.next/standalone/.next/server/chunks/6975.js +0 -1
  210. package/.next/standalone/.next/static/chunks/19126-7671ce1fd803fdd4.js +0 -1
  211. package/.next/standalone/.next/static/chunks/44046-5c0f7f8c0914988a.js +0 -1
  212. package/.next/standalone/.next/static/chunks/60011-0fbcb92028fe9655.js +0 -1
  213. package/.next/standalone/.next/static/chunks/6028-fe4175ea5e6241ed.js +0 -1
  214. package/.next/standalone/.next/static/chunks/9562-8433cd5c5abad077.js +0 -1
  215. package/.next/standalone/.next/static/chunks/app/(dashboard)/layout-8409ca03f132910b.js +0 -1
  216. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/dashboard/page-7f7a7f654cab4dc3.js +0 -1
  217. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page-a99a690b878a03be.js +0 -1
  218. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/page-95cdcec5e6db551f.js +0 -1
  219. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page-2d85f24a980966b7.js +0 -1
  220. package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/page-38579c303156008c.js +0 -1
  221. package/.next/standalone/.next/static/chunks/app/(dashboard)/settings/page-b153aa34b940a24c.js +0 -1
  222. /package/.next/standalone/.next/static/{yBxnuARbl0brBJS3_STaI → -kClYg0a7zvFcgkw_LnG7}/_buildManifest.js +0 -0
  223. /package/.next/standalone/.next/static/{yBxnuARbl0brBJS3_STaI → -kClYg0a7zvFcgkw_LnG7}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[19898],{6985:(e,s,t)=>{t.d(s,{A:()=>a});let a=(0,t(66206).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},17156:(e,s,t)=>{t.d(s,{v:()=>ep});var a=t(90508),i=t(1856),r=t(23675),c=t(39268),n=t(76111),l=t(9160),d=t(5616),o=t(70633),x=t(57893),m=t(5425),u=t(56770),h=t(85226),p=t(62898),g=t(42533),v=t(1861),f=t(66206);let j=(0,f.A)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);var b=t(17475),A=t(60532),N=t(94903),C=t(62482),y=t(6985);let w=(0,f.A)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var k=t(97413),F=t(57731),E=t(48416),S=t(22922),D=t(14554),B=t(15972),R=t(88064),_=t(64993),T=t(91846),U=t(51817),L=t(73693),M=t(52217);let P=(0,M.createServerReference)("60d385edc971b774b29db4a76b6288664e3ff6e3eb",M.callServer,void 0,M.findSourceMapURL,"updateTaskStatusAction"),q=(0,M.createServerReference)("4087985b5a435fc84336fa71bd622ee65068d1a70b",M.callServer,void 0,M.findSourceMapURL,"createTaskAction"),z=(0,M.createServerReference)("407cf64363bc094181b20e71be29f4eaf985ab9701",M.callServer,void 0,M.findSourceMapURL,"updateTaskFieldsAction"),$=(0,M.createServerReference)("60c69091d26aa5c80138990b48d8f4bbd263a11976",M.callServer,void 0,M.findSourceMapURL,"deleteTaskAction"),V=(0,M.createServerReference)("602e9726afe57f14e2e0c2e3d15a128969d3f8f9fb",M.callServer,void 0,M.findSourceMapURL,"markCriteriaAction"),W=(0,M.createServerReference)("60b53a2c77387cac4116e4d73ae3df5ae307ea6923",M.callServer,void 0,M.findSourceMapURL,"resetCriterionAction");var J=t(5810);let O=(0,M.createServerReference)("40ea4b2ab97cda9f0eb1e59de4b81b2d4a29df9557",M.callServer,void 0,M.findSourceMapURL,"getTaskActivitiesAction"),I=(0,M.createServerReference)("400067c3cf7ed30a442781337da48bbf9fb8a963a1",M.callServer,void 0,M.findSourceMapURL,"getTaskSourceAction");var G=t(97261),H=t(41033);let X=(0,M.createServerReference)("00cc674162965f046ec2005a0aa1d5339a8b86d16b",M.callServer,void 0,M.findSourceMapURL,"getDeveloperAgentsAction"),Z=(0,M.createServerReference)("402bfb6dbc2330339f67e613036af0ecfa02e7e8db",M.callServer,void 0,M.findSourceMapURL,"claimTaskAction"),K=(0,M.createServerReference)("60acc6478ae16ce4142685f481af02f600d91733e6",M.callServer,void 0,M.findSourceMapURL,"claimTaskToAgentAction"),Q=(0,M.createServerReference)("602ec983630518488edb633843f13f8936904eba82",M.callServer,void 0,M.findSourceMapURL,"claimTaskToUserAction"),Y=(0,M.createServerReference)("40791ba93d4adb772e44c848aff6980f7da5f5c833",M.callServer,void 0,M.findSourceMapURL,"releaseTaskAction");function ee(e){var s;let{task:t,projectUuid:n,currentUserUuid:d,onClose:o}=e,x=(0,c.c)(),u=(0,r.useRouter)(),[p,g]=(0,i.useState)(!1),[v,f]=(0,i.useState)("self"),[j,b]=(0,i.useState)(""),[A,C]=(0,i.useState)(""),[y,w]=(0,i.useState)([]),[k,F]=(0,i.useState)([]),[E,D]=(0,i.useState)(!0),[B,_]=(0,i.useState)(null),U=!!t.assignee;(0,i.useEffect)(()=>{!async function(){D(!0);let e=await X();w(e.agents||[]),F((e.users||[]).filter(e=>e.uuid!==d)),D(!1)}()},[d]);let L=async()=>{let e;if(g(!0),_(null),"self"===v)e=await Z(t.uuid);else if("agent"===v&&j)e=await K(t.uuid,j);else if("user"===v&&A)e=await Q(t.uuid,A);else{if("release"!==v)return void g(!1);e=await Y(t.uuid)}g(!1),(null==e?void 0:e.success)?(o(),u.refresh()):(null==e?void 0:e.error)&&_(e.error)},M="self"===v||"agent"===v&&j||"user"===v&&A||"release"===v&&U;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-0 z-50 bg-black/40",onClick:o}),(0,a.jsxs)("div",{className:"fixed left-1/2 top-1/2 z-50 w-[400px] -translate-x-1/2 -translate-y-1/2 rounded-2xl bg-white shadow-xl border border-[#E5E0D8]",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-[#E5E0D8] px-6 py-5",children:[(0,a.jsx)("h2",{className:"text-base font-semibold text-[#2C2C2C]",children:x("tasks.assignTask")}),(0,a.jsx)("button",{onClick:o,className:"text-[#9A9A9A] hover:text-[#6B6B6B] transition-colors",children:(0,a.jsx)(l.A,{className:"h-5 w-5"})})]}),(0,a.jsxs)("div",{className:"p-6 space-y-4",children:[(0,a.jsxs)("div",{className:"rounded-lg bg-[#FAF8F4] p-3",children:[(0,a.jsx)("p",{className:"text-[13px] font-medium text-[#2C2C2C]",children:t.title}),t.description&&(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[#6B6B6B] line-clamp-2",children:t.description})]}),U&&(0,a.jsx)("div",{className:"rounded-lg bg-[#E3F2FD] p-3",children:(0,a.jsxs)("p",{className:"text-xs text-[#1976D2]",children:[x("common.currentAssignee"),": ",(0,a.jsx)("span",{className:"font-medium",children:null==(s=t.assignee)?void 0:s.name})]})}),B&&(0,a.jsx)("div",{className:"rounded-lg bg-[#FEE2E2] p-3",children:(0,a.jsx)("p",{className:"text-xs text-[#D32F2F]",children:B})}),(0,a.jsx)("p",{className:"text-[13px] text-[#6B6B6B]",children:x("assign.selectAssignee")}),E?(0,a.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,a.jsx)(h.A,{className:"h-6 w-6 animate-spin text-[#9A9A9A]"})}):(0,a.jsxs)(H.z,{value:v,onValueChange:e=>f(e),className:"space-y-3",children:[(0,a.jsxs)("div",{className:"rounded-[10px] p-4 transition-colors cursor-pointer ".concat("self"===v?"bg-[#FDF8F6] border-2 border-[#C67A52]":"bg-white border border-[#E5E0D8] hover:border-[#C67A52]/50"),onClick:()=>f("self"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)(H.C,{value:"self",id:"self",className:"border-[#C67A52] text-[#C67A52]"}),(0,a.jsx)(R.J,{htmlFor:"self",className:"text-sm font-medium text-[#2C2C2C] cursor-pointer",children:x("assign.assignToMyself")})]}),(0,a.jsx)("p",{className:"mt-2 ml-6 text-xs text-[#6B6B6B] leading-relaxed",children:x("assign.assignToMyselfDesc")})]}),(0,a.jsxs)("div",{className:"rounded-[10px] p-4 transition-colors ".concat("agent"===v?"bg-[#FDF8F6] border-2 border-[#C67A52]":"bg-white border border-[#E5E0D8]"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5 cursor-pointer",onClick:()=>f("agent"),children:[(0,a.jsx)(H.C,{value:"agent",id:"agent",className:"border-[#C67A52] text-[#C67A52]"}),(0,a.jsx)(R.J,{htmlFor:"agent",className:"text-sm font-medium text-[#2C2C2C] cursor-pointer",children:x("assign.orAssignToAgent")})]}),(0,a.jsx)("p",{className:"mt-2 ml-6 text-xs text-[#6B6B6B] leading-relaxed",children:x("tasks.onlySelectedAgentCanWork")}),"agent"===v&&(0,a.jsx)("div",{className:"mt-3 ml-6",children:(0,a.jsxs)(T.l6,{value:j,onValueChange:b,children:[(0,a.jsx)(T.bq,{className:"w-full border-[#E5E0D8]",children:(0,a.jsx)(T.yv,{placeholder:x("tasks.selectAgent")})}),(0,a.jsx)(T.gC,{children:y.length>0?y.map(e=>(0,a.jsx)(T.eb,{value:e.uuid,children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(m.A,{className:"h-4 w-4 text-[#C67A52]"}),(0,a.jsx)("span",{children:e.name})]})},e.uuid)):(0,a.jsx)("div",{className:"px-3 py-2 text-xs text-[#9A9A9A]",children:x("tasks.noAgentsAvailable")})})]})})]}),(0,a.jsxs)("div",{className:"rounded-[10px] p-4 transition-colors ".concat("user"===v?"bg-[#FDF8F6] border-2 border-[#C67A52]":"bg-white border border-[#E5E0D8]"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5 cursor-pointer",onClick:()=>f("user"),children:[(0,a.jsx)(H.C,{value:"user",id:"user",className:"border-[#C67A52] text-[#C67A52]"}),(0,a.jsx)(R.J,{htmlFor:"user",className:"text-sm font-medium text-[#2C2C2C] cursor-pointer",children:x("assign.orAssignToUser")})]}),"user"===v&&(0,a.jsx)("div",{className:"mt-3 ml-6",children:(0,a.jsxs)(T.l6,{value:A,onValueChange:C,children:[(0,a.jsx)(T.bq,{className:"w-full border-[#E5E0D8]",children:(0,a.jsx)(T.yv,{placeholder:x("tasks.selectUser")})}),(0,a.jsx)(T.gC,{children:k.length>0?k.map(e=>(0,a.jsx)(T.eb,{value:e.uuid,children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(N.A,{className:"h-4 w-4 text-[#6B6B6B]"}),(0,a.jsx)("span",{children:e.name||e.email})]})},e.uuid)):(0,a.jsx)("div",{className:"px-3 py-2 text-xs text-[#9A9A9A]",children:x("tasks.noUsersAvailable")})})]})})]}),U&&(0,a.jsxs)("div",{className:"rounded-[10px] p-4 transition-colors cursor-pointer ".concat("release"===v?"bg-[#FDF8F6] border-2 border-[#C67A52]":"bg-white border border-[#E5E0D8] hover:border-[#C67A52]/50"),onClick:()=>f("release"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)(H.C,{value:"release",id:"release",className:"border-[#C67A52] text-[#C67A52]"}),(0,a.jsx)(R.J,{htmlFor:"release",className:"text-sm font-medium text-[#2C2C2C] cursor-pointer",children:x("assign.releaseAssignee")})]}),(0,a.jsx)("p",{className:"mt-2 ml-6 text-xs text-[#6B6B6B] leading-relaxed",children:x("assign.releaseAssigneeDesc")})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-4 rounded-b-2xl bg-white px-6 py-6 border-t border-[#E5E0D8]",children:[(0,a.jsx)(S.$,{variant:"outline",onClick:o,disabled:p,className:"border-[#E5E0D8]",children:x("common.cancel")}),(0,a.jsx)(S.$,{onClick:L,disabled:p||!M,className:"bg-[#C67A52] hover:bg-[#B56A42] text-white",children:p?(0,a.jsx)(h.A,{className:"h-4 w-4 animate-spin"}):x("release"===v?"common.release":"common.assign")})]})]})]})}let es=(0,M.createServerReference)("40c9676a9993d0f850c6955f9c0589450c7244d18b",M.callServer,void 0,M.findSourceMapURL,"getTaskDependenciesAction"),et=(0,M.createServerReference)("40abc84636d041cef8f935b0751c9281f791c9e012",M.callServer,void 0,M.findSourceMapURL,"getProjectTasksForDependencyAction");var ea=t(32700);let ei=(0,M.createServerReference)("600e5e8e6c349b6193e5e9996fb72d67b9a5c50e6d",M.callServer,void 0,M.findSourceMapURL,"removeTaskDependencyAction"),er=(0,M.createServerReference)("40e97ce0b950d948479e35998482b7f2991815cd36",M.callServer,void 0,M.findSourceMapURL,"getTaskSessionsAction");var ec=t(38106),en=t(16544),el=t(65626),ed=t(90795);let eo={open:"bg-[#FFF3E0] text-[#E65100]",assigned:"bg-[#E3F2FD] text-[#1976D2]",in_progress:"bg-[#E8F5E9] text-[#5A9E6F]",to_verify:"bg-[#F3E5F5] text-[#7B1FA2]",done:"bg-[#E0F2F1] text-[#00796B]",closed:"bg-[#F5F5F5] text-[#9A9A9A]"},ex={open:"open",assigned:"assigned",in_progress:"inProgress",to_verify:"toVerify",done:"done",closed:"closed"},em={low:"bg-[#F5F5F5] text-[#9A9A9A]",medium:"bg-[#FFF3E0] text-[#E65100]",high:"bg-[#FEE2E2] text-[#D32F2F]",critical:"bg-[#FFCDD2] text-[#B71C1C]"},eu={low:"lowPriority",medium:"mediumPriority",high:"highPriority",critical:"criticalPriority"};function eh(e,s){let t=new Date(e),a=new Date().getTime()-t.getTime(),i=Math.floor(a/6e4),r=Math.floor(a/36e5),c=Math.floor(a/864e5);return i<1?s("time.justNow"):i<60?s("time.minutesAgo",{minutes:i}):r<24?s("time.hoursAgo",{hours:r}):c<7?s("time.daysAgo",{days:c}):(0,ec.r)(t)}function ep(e){var s;let{task:t,projectUuid:f,currentUserUuid:M,mode:H="overlay",onClose:X,onCreated:Z,onDependencyChange:K,onBack:Q}=e,Y=(0,c.c)(),ep=(0,r.useRouter)(),[eg,ev]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let e=setTimeout(()=>ev(!0),300);return()=>clearTimeout(e)},[]);let[ef,ej]=(0,i.useState)(!1),[eb,eA]=(0,i.useState)([]),[eN,eC]=(0,i.useState)(!0),[ey,ew]=(0,i.useState)(null),[ek,eF]=(0,i.useState)(!1),[eE,eS]=(0,i.useState)([]),[eD,eB]=(0,i.useState)([]),[eR,e_]=(0,i.useState)(!1),[eT,eU]=(0,i.useState)([]),[eL,eM]=(0,i.useState)(null),[eP,eq]=(0,i.useState)([]),[ez,e$]=(0,i.useState)([]),eV=null===t,[eW,eJ]=(0,i.useState)(eV),[eO,eI]=(0,i.useState)((null==t?void 0:t.title)||""),[eG,eH]=(0,i.useState)((null==t?void 0:t.description)||""),[eX,eZ]=(0,i.useState)((null==t?void 0:t.priority)||"medium"),[eK,eQ]=(0,i.useState)((null==t?void 0:t.storyPoints)!=null?String(t.storyPoints):""),[eY,e0]=(0,i.useState)((null==t?void 0:t.acceptanceCriteria)||""),[e2,e1]=(0,i.useState)(!1),[e5,e6]=(0,i.useState)(null),[e9,e3]=(0,i.useState)(!1),e7=(null==t||null==(s=t.assignee)?void 0:s.uuid)===M,e4=e7&&(null==t?void 0:t.status)==="assigned",e8=e7&&(null==t?void 0:t.status)==="in_progress",se=(null==t?void 0:t.status)==="to_verify";(0,i.useEffect)(()=>{async function e(){eC(!0),eA((await O(t.uuid)).activities),eC(!1)}async function s(){t.proposalUuid&&ew(await I(t.proposalUuid))}async function a(){e_(!0);let[e,s]=await Promise.all([es(t.uuid),et(f)]);eS(e.dependsOn),eB(e.dependedBy),eU(s.tasks),e_(!1)}async function i(){let e=await er(t.uuid);e.success&&e.data&&eq(e.data)}t&&(e(),s(),a(),i())},[null==t?void 0:t.uuid,null==t?void 0:t.proposalUuid,f]),(0,i.useEffect)(()=>{eV&&e();async function e(){eU((await et(f)).tasks)}},[eV,f]),(0,i.useEffect)(()=>{t&&(eJ(!1),eI(t.title),eH(t.description||""),eZ(t.priority),eQ(null!=t.storyPoints?String(t.storyPoints):""),e0(t.acceptanceCriteria||""),e6(null))},[null==t?void 0:t.uuid,null==t?void 0:t.title,null==t?void 0:t.description,null==t?void 0:t.priority,null==t?void 0:t.storyPoints,null==t?void 0:t.acceptanceCriteria]);let ss=async e=>{if(!t)return;ej(!0);let s=await P(t.uuid,e);ej(!1),s.success&&(X(),ep.refresh())},st=()=>{if(eV)return void X();eJ(!1),t&&(eI(t.title),eH(t.description||""),eZ(t.priority),eQ(null!=t.storyPoints?String(t.storyPoints):""),e0(t.acceptanceCriteria||"")),e6(null)},sa=async()=>{if(!eO.trim())return void e6(Y("tasks.titleRequired"));e1(!0),e6(null);let e=eK.trim()?parseFloat(eK):null;if(eV){let s=await q({projectUuid:f,title:eO.trim(),description:eG.trim()||void 0,priority:eX,storyPoints:e,acceptanceCriteria:eY.trim()||null});e1(!1),s.success?(ez.length>0&&s.taskUuid&&(await Promise.all(ez.map(e=>(0,ea.w)(s.taskUuid,e.uuid))),null==K||K()),null==Z||Z(),X(),ep.refresh()):e6(s.error||Y("tasks.createFailed"))}else{let s=await z({taskUuid:t.uuid,projectUuid:f,title:eO.trim(),description:eG.trim()||null,priority:eX,storyPoints:e,acceptanceCriteria:eY.trim()||null});e1(!1),s.success?(eJ(!1),ep.refresh()):e6(s.error||Y("tasks.updateFailed"))}},si=async()=>{if(!t)return;e3(!0);let e=await $(t.uuid,f);e3(!1),e.success&&(X(),ep.refresh())},sr=async e=>{if(!t)return;eM(null);let s=await (0,ea.w)(t.uuid,e);if(s.success){let s=eT.find(s=>s.uuid===e);s&&eS(e=>[...e,s]),null==K||K()}else eM(s.error||Y("tasks.failedToAddDep"))},sc=async e=>{if(!t)return;eM(null);let s=await ei(t.uuid,e);s.success?(eS(s=>s.filter(s=>s.uuid!==e)),null==K||K()):eM(s.error||Y("tasks.failedToRemoveDep"))},sn=async e=>{if(!t)return;eM(null);let s=await ei(e,t.uuid);s.success?(eB(s=>s.filter(s=>s.uuid!==e)),null==K||K()):eM(s.error||Y("tasks.failedToRemoveDep"))},sl=eT.filter(e=>e.uuid!==(null==t?void 0:t.uuid)&&!eE.some(s=>s.uuid===e.uuid)),sd=eT.filter(e=>!ez.some(s=>s.uuid===e.uuid)),so="sidebyside"===H;return(0,a.jsxs)(a.Fragment,{children:[!so&&(0,a.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:X}),(0,a.jsxs)("div",{className:"fixed top-14 md:top-0 flex h-[calc(100%-3.5rem)] md:h-full w-full flex-col bg-white shadow-xl border-l border-[#E5E0D8] ".concat(so?"z-40 ".concat(eg?"":"animate-in slide-in-from-right duration-300"):"z-50 right-0 ".concat(eg?"":"animate-in slide-in-from-right duration-300")),style:{maxWidth:"".concat(ed.L8,"px"),...so?{right:"".concat(ed.L8,"px")}:{}},children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-[#F5F2EC] px-6 py-5",children:[Q&&(0,a.jsx)(S.$,{variant:"ghost",size:"icon",className:"mr-2 h-8 w-8 shrink-0",onClick:Q,children:(0,a.jsx)(o.A,{className:"h-4 w-4 text-[#6B6B6B]"})}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:eW?(0,a.jsx)("h2",{className:"text-base font-semibold text-[#2C2C2C]",children:eV?Y("tasks.createTaskTitle"):Y("tasks.editTask")}):t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{className:"text-base font-semibold text-[#2C2C2C] truncate",children:t.title}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center gap-2",children:[(0,a.jsx)(F.E,{className:eo[t.status]||"",children:Y("status.".concat(ex[t.status]||t.status))}),(0,a.jsx)(F.E,{className:em[t.priority]||"",children:Y("priority.".concat(eu[t.priority]||t.priority))}),t.storyPoints&&(0,a.jsxs)("span",{className:"rounded bg-[#F5F2EC] px-2 py-0.5 text-xs font-medium text-[#6B6B6B]",children:[t.storyPoints,"h"]})]})]}):null}),(0,a.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[t&&!eW&&(0,a.jsxs)(S.$,{variant:"outline",size:"sm",className:"h-8 gap-1.5 border-[#E5E0D8] text-[#2C2C2C]",onClick:()=>{t&&(eI(t.title),eH(t.description||""),eZ(t.priority),eQ(null!=t.storyPoints?String(t.storyPoints):""),e0(t.acceptanceCriteria||""),e6(null),eJ(!0))},children:[(0,a.jsx)(x.A,{className:"h-3.5 w-3.5 text-[#6B6B6B]"}),(0,a.jsx)("span",{className:"text-xs",children:Y("common.edit")})]}),(0,a.jsx)(S.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-[#E5E0D8]",onClick:eW&&!eV?st:X,children:(0,a.jsx)(l.A,{className:"h-4 w-4 text-[#6B6B6B]"})})]})]}),(0,a.jsx)(_.F,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:(0,a.jsx)("div",{className:"flex min-h-full flex-col px-6 py-5",children:eW?(0,a.jsxs)("div",{className:"space-y-5",children:[e5&&(0,a.jsx)("div",{className:"rounded-lg bg-destructive/10 p-3 text-sm text-destructive",children:e5}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(R.J,{htmlFor:"edit-title",className:"text-[13px] font-medium text-[#2C2C2C]",children:Y("tasks.titleLabel")}),(0,a.jsx)(D.p,{id:"edit-title",value:eO,onChange:e=>eI(e.target.value),className:"border-[#E5E0D8] text-sm focus-visible:ring-[#C67A52]",autoFocus:!0})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(R.J,{htmlFor:"edit-description",className:"text-[13px] font-medium text-[#2C2C2C]",children:Y("tasks.descriptionLabel")}),(0,a.jsx)(B.T,{id:"edit-description",value:eG,onChange:e=>eH(e.target.value),rows:4,className:"border-[#E5E0D8] text-sm resize-none focus-visible:ring-[#C67A52]"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(R.J,{htmlFor:"edit-priority",className:"text-[13px] font-medium text-[#2C2C2C]",children:Y("tasks.priorityLabel")}),(0,a.jsxs)(T.l6,{value:eX,onValueChange:eZ,children:[(0,a.jsx)(T.bq,{className:"border-[#E5E0D8] text-sm focus:ring-[#C67A52]",children:(0,a.jsx)(T.yv,{})}),(0,a.jsxs)(T.gC,{children:[(0,a.jsx)(T.eb,{value:"low",children:Y("priority.low")}),(0,a.jsx)(T.eb,{value:"medium",children:Y("priority.medium")}),(0,a.jsx)(T.eb,{value:"high",children:Y("priority.high")})]})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(R.J,{htmlFor:"edit-story-points",className:"text-[13px] font-medium text-[#2C2C2C]",children:Y("tasks.storyPointsLabel")}),(0,a.jsx)(D.p,{id:"edit-story-points",type:"number",min:"0",step:"0.5",value:eK,onChange:e=>eQ(e.target.value),className:"border-[#E5E0D8] text-sm focus-visible:ring-[#C67A52]"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(R.J,{htmlFor:"edit-acceptance-criteria",className:"text-[13px] font-medium text-[#2C2C2C]",children:Y("tasks.acceptanceCriteriaLabel")}),(0,a.jsx)(B.T,{id:"edit-acceptance-criteria",value:eY,onChange:e=>e0(e.target.value),rows:4,className:"border-[#E5E0D8] text-sm resize-none focus-visible:ring-[#C67A52]"})]}),eV&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(R.J,{className:"text-[13px] font-medium text-[#2C2C2C]",children:Y("tasks.dependencies")}),ez.length>0&&(0,a.jsx)("div",{className:"space-y-1.5",children:ez.map(e=>(0,a.jsxs)("div",{className:"group flex items-center justify-between rounded-lg bg-[#FAF8F4] p-2.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)(n.A,{className:"h-3.5 w-3.5 shrink-0 text-[#C67A52]"}),(0,a.jsx)("span",{className:"text-xs text-[#2C2C2C] truncate",children:e.title}),(0,a.jsx)(F.E,{className:"shrink-0 text-[10px] ".concat(eo[e.status]||""),children:Y("status.".concat(ex[e.status]||e.status))})]}),(0,a.jsx)(S.$,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",onClick:()=>e$(s=>s.filter(s=>s.uuid!==e.uuid)),children:(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] hover:text-[#D32F2F]"})})]},e.uuid))}),sd.length>0&&(0,a.jsxs)(T.l6,{onValueChange:e=>{let s=eT.find(s=>s.uuid===e);s&&e$(e=>[...e,s])},children:[(0,a.jsx)(T.bq,{className:"h-8 border-[#E5E0D8] text-xs text-[#6B6B6B] focus:ring-[#C67A52]",children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(d.A,{className:"h-3 w-3"}),(0,a.jsx)(T.yv,{placeholder:Y("tasks.addDependency")})]})}),(0,a.jsx)(T.gC,{children:sd.map(e=>(0,a.jsx)(T.eb,{value:e.uuid,children:(0,a.jsx)("span",{className:"truncate",children:e.title})},e.uuid))})]},ez.length)]})]}):t?(0,a.jsxs)(en.P.div,{variants:el.qG,initial:"initial",animate:"animate",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:Y("common.assignee")}),(0,a.jsx)("div",{className:"mt-2 flex items-center gap-2.5 rounded-lg bg-[#FAF8F4] p-3",children:t.assignee?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L.eu,{className:"h-7 w-7",children:(0,a.jsx)(L.q5,{className:"agent"===t.assignee.type?"bg-[#C67A52] text-white":"bg-[#E5E0D8] text-[#6B6B6B]",children:"agent"===t.assignee.type?(0,a.jsx)(m.A,{className:"h-3.5 w-3.5"}):t.assignee.name.charAt(0).toUpperCase()})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm font-medium text-[#2C2C2C]",children:t.assignee.name}),(0,a.jsx)("div",{className:"text-xs text-[#6B6B6B]",children:"agent"===t.assignee.type?"".concat(Y("common.agent")," • ").concat(t.assignee.assignedAt?(0,ec.r)(t.assignee.assignedAt):""):Y("common.user")})]})]}):(0,a.jsx)("span",{className:"text-sm text-[#9A9A9A]",children:Y("common.unassigned")})})]}),eP.length>0&&(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:Y("sessions.activeWorkers")}),(0,a.jsx)("div",{className:"mt-2 space-y-1.5",children:eP.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2.5 rounded-lg bg-[#FAF8F4] p-2.5",children:[(0,a.jsx)("div",{className:"h-2 w-2 rounded-full bg-green-500 flex-shrink-0"}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"text-xs font-medium text-[#2C2C2C] truncate",children:e.sessionName}),(0,a.jsxs)("div",{className:"text-[10px] text-[#9A9A9A]",children:[e.agentName," \xb7 ",eh(e.checkinAt,Y)]})]})]},e.sessionUuid))})]}),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:Y("common.description")}),(0,a.jsx)("div",{className:"mt-2",children:t.description?(0,a.jsx)("div",{className:"prose prose-sm max-w-none text-[13px] leading-relaxed text-[#2C2C2C]",children:(0,a.jsx)(G.MarkdownContent,{children:t.description})}):(0,a.jsx)("p",{className:"text-sm italic text-[#9A9A9A]",children:Y("common.noDescription")})})]}),t.acceptanceCriteria&&!(t.acceptanceCriteriaItems&&t.acceptanceCriteriaItems.length>0)&&(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:Y("tasks.acceptanceCriteria")}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)("div",{className:"prose prose-sm max-w-none text-[13px] leading-relaxed text-[#2C2C2C]",children:(0,a.jsx)(G.MarkdownContent,{children:t.acceptanceCriteria})})})]}),ey&&(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:Y("common.source")}),(0,a.jsx)("a",{href:"/projects/".concat(f,"/proposals/").concat(ey.uuid),className:"mt-2 flex items-center justify-between rounded-lg bg-[#FAF8F4] p-3 hover:bg-[#F0EDE5] transition-colors",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(u.A,{className:"h-3.5 w-3.5 text-[#C67A52]"}),(0,a.jsx)("span",{className:"text-xs text-[#2C2C2C]",children:ey.title})]})})]}),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:Y("tasks.dependencies")}),eL&&(0,a.jsx)("div",{className:"mt-2 rounded-lg bg-destructive/10 p-2.5 text-xs text-destructive",children:eL}),eR?(0,a.jsx)("div",{className:"mt-2 flex items-center justify-center py-4",children:(0,a.jsx)(h.A,{className:"h-4 w-4 animate-spin text-[#9A9A9A]"})}):(0,a.jsxs)(a.Fragment,{children:[eE.length>0&&(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,a.jsx)(p.A,{className:"h-3 w-3 text-[#9A9A9A]"}),(0,a.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:Y("tasks.dependsOn")})]}),(0,a.jsx)("div",{className:"space-y-1.5",children:eE.map(e=>(0,a.jsxs)("div",{className:"group flex items-center justify-between rounded-lg bg-[#FAF8F4] p-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)(n.A,{className:"h-3.5 w-3.5 shrink-0 text-[#C67A52]"}),(0,a.jsx)("span",{className:"text-xs text-[#2C2C2C] truncate",children:e.title}),(0,a.jsx)(F.E,{className:"shrink-0 text-[10px] ".concat(eo[e.status]||""),children:Y("status.".concat(ex[e.status]||e.status))})]}),(0,a.jsx)(S.$,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",onClick:()=>sc(e.uuid),children:(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] hover:text-[#D32F2F]"})})]},e.uuid))})]}),eD.length>0&&(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,a.jsx)(p.A,{className:"h-3 w-3 rotate-180 text-[#9A9A9A]"}),(0,a.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:Y("tasks.blockedByThis")})]}),(0,a.jsx)("div",{className:"space-y-1.5",children:eD.map(e=>(0,a.jsxs)("div",{className:"group flex items-center justify-between rounded-lg bg-[#FAF8F4] p-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)(n.A,{className:"h-3.5 w-3.5 shrink-0 text-[#6B6B6B]"}),(0,a.jsx)("span",{className:"text-xs text-[#2C2C2C] truncate",children:e.title}),(0,a.jsx)(F.E,{className:"shrink-0 text-[10px] ".concat(eo[e.status]||""),children:Y("status.".concat(ex[e.status]||e.status))})]}),(0,a.jsx)(S.$,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",onClick:()=>sn(e.uuid),children:(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] hover:text-[#D32F2F]"})})]},e.uuid))})]}),0===eE.length&&0===eD.length&&(0,a.jsx)("p",{className:"mt-2 text-sm italic text-[#9A9A9A]",children:Y("tasks.noDependencies")}),sl.length>0&&(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsxs)(T.l6,{onValueChange:e=>sr(e),children:[(0,a.jsx)(T.bq,{className:"h-8 border-[#E5E0D8] text-xs text-[#6B6B6B] focus:ring-[#C67A52]",children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(d.A,{className:"h-3 w-3"}),(0,a.jsx)(T.yv,{placeholder:Y("tasks.addDependency")})]})}),(0,a.jsx)(T.gC,{children:sl.map(e=>(0,a.jsx)(T.eb,{value:e.uuid,children:(0,a.jsx)("span",{className:"truncate",children:e.title})},e.uuid))})]},eE.length)})]})]}),t&&t.acceptanceCriteriaItems&&t.acceptanceCriteriaItems.length>0&&(()=>{let e=t.acceptanceCriteriaItems,s=t.acceptanceSummary,i=e=>"passed"===e?(0,a.jsx)(g.A,{className:"h-4 w-4 text-green-600"}):"failed"===e?(0,a.jsx)(v.A,{className:"h-4 w-4 text-red-600"}):(0,a.jsx)(j,{className:"h-4 w-4 text-yellow-600"}),r=e=>"passed"===e?"bg-green-50 text-green-700":"failed"===e?"bg-red-50 text-red-700":"bg-yellow-50 text-yellow-700",c=async(e,s)=>{(await V(t.uuid,[{uuid:e,status:s}])).success&&ep.refresh()};return(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:Y("acceptanceCriteria.title")}),s&&(0,a.jsx)(F.E,{className:r(t.acceptanceStatus||"pending"),variant:"secondary",children:Y("acceptanceCriteria.progress",{passed:s.passed,total:s.total})})]}),(0,a.jsxs)("div",{className:"mt-2 space-y-2",children:[e.map(e=>(0,a.jsx)(E.Zp,{className:"p-3",children:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)("div",{className:"mt-0.5 shrink-0",children:i(e.status)}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"text-xs text-[#2C2C2C]",children:e.description}),(0,a.jsx)(F.E,{variant:"outline",className:"text-[10px] shrink-0",children:e.required?Y("acceptanceCriteria.required"):Y("acceptanceCriteria.optional")})]}),(0,a.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-[10px]",children:[(0,a.jsx)("span",{className:"text-[#9A9A9A] w-20 shrink-0",children:Y("acceptanceCriteria.devSelfCheck")}),(0,a.jsxs)(F.E,{className:"text-[10px] ".concat(r(e.devStatus)),variant:"secondary",children:[i(e.devStatus),(0,a.jsx)("span",{className:"ml-1",children:Y("acceptanceCriteria.status.".concat(e.devStatus))})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-[10px]",children:[(0,a.jsx)("span",{className:"text-[#9A9A9A] w-20 shrink-0",children:Y("acceptanceCriteria.verification")}),(0,a.jsxs)(F.E,{className:"text-[10px] ".concat(r(e.status)),variant:"secondary",children:[i(e.status),(0,a.jsx)("span",{className:"ml-1",children:Y("acceptanceCriteria.status.".concat(e.status))})]})]})]}),e.devEvidence&&(0,a.jsxs)("div",{className:"mt-2 rounded bg-[#FAF8F4] p-2",children:[(0,a.jsx)("span",{className:"text-[10px] font-medium text-[#9A9A9A]",children:Y("acceptanceCriteria.devEvidence")}),(0,a.jsx)("p",{className:"text-[11px] text-[#2C2C2C] mt-0.5",children:e.devEvidence})]}),e.evidence&&(0,a.jsxs)("div",{className:"mt-2 rounded bg-[#FAF8F4] p-2",children:[(0,a.jsx)("span",{className:"text-[10px] font-medium text-[#9A9A9A]",children:Y("acceptanceCriteria.verifyEvidence")}),(0,a.jsx)("p",{className:"text-[11px] text-[#2C2C2C] mt-0.5",children:e.evidence})]}),"pending"===e.status?(0,a.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,a.jsxs)(S.$,{size:"sm",variant:"outline",className:"h-8 min-h-[44px] sm:min-h-0 flex-1 sm:flex-none text-xs text-green-700 border-green-200 hover:bg-green-50",onClick:()=>c(e.uuid,"passed"),children:[(0,a.jsx)(g.A,{className:"h-3.5 w-3.5 mr-1"}),Y("acceptanceCriteria.pass")]}),(0,a.jsxs)(S.$,{size:"sm",variant:"outline",className:"h-8 min-h-[44px] sm:min-h-0 flex-1 sm:flex-none text-xs text-red-700 border-red-200 hover:bg-red-50",onClick:()=>c(e.uuid,"failed"),children:[(0,a.jsx)(v.A,{className:"h-3.5 w-3.5 mr-1"}),Y("acceptanceCriteria.fail")]})]}):(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)(S.$,{size:"sm",variant:"ghost",className:"h-7 min-h-[44px] sm:min-h-0 text-xs text-[#9A9A9A] hover:text-[#2C2C2C]",onClick:async()=>{(await W(t.uuid,e.uuid)).success&&ep.refresh()},children:Y("acceptanceCriteria.undoVerification")})})]})]})},e.uuid)),s&&(s.requiredPending>0||s.requiredFailed>0)&&(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg bg-yellow-50 p-3 mt-2",children:[(0,a.jsx)(b.A,{className:"h-4 w-4 text-yellow-600 shrink-0"}),(0,a.jsx)("span",{className:"text-xs text-yellow-700",children:Y("acceptanceCriteria.gateBlocked",{count:s.requiredPending+s.requiredFailed})})]}),s&&0===s.requiredPending&&0===s.requiredFailed&&s.required>0&&(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg bg-green-50 p-3 mt-2",children:[(0,a.jsx)(g.A,{className:"h-4 w-4 text-green-600 shrink-0"}),(0,a.jsx)("span",{className:"text-xs text-green-700",children:Y("acceptanceCriteria.gateReady")})]})]})]})})(),(0,a.jsxs)("div",{className:"mt-5 flex-1",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:Y("common.activity")}),(0,a.jsx)("div",{className:"mt-2 space-y-3",children:eN?(0,a.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,a.jsx)(h.A,{className:"h-4 w-4 animate-spin text-[#9A9A9A]"})}):0===eb.length?(0,a.jsx)("p",{className:"text-sm text-[#9A9A9A] italic",children:Y("common.noActivity")}):eb.map(e=>(0,a.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,a.jsx)("div",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-[#F5F2EC]",children:(0,a.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(function(e){switch(e){case"task_created":return"bg-[#C67A52]";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-[#6B6B6B]"}}(e.action))})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"text-xs text-[#2C2C2C]",children:function(e,s){let t=e.sessionName?"".concat(e.actorName," / ").concat(e.sessionName):e.actorName,{action:a}=e;switch(a){case"task_created":return s("activity.taskCreated",{actor:t});case"task_assigned":return s("activity.taskAssigned",{actor:t});case"task_claimed":return s("activity.taskClaimed",{actor:t});case"task_started":return s("activity.taskStarted",{actor:t});case"task_submitted":return s("activity.taskSubmitted",{actor:t});case"task_completed":case"task_verified":return s("activity.taskCompleted",{actor:t});case"task_released":return s("activity.taskReleased",{actor:t});case"task_status_changed":return s("activity.taskStatusChanged",{actor:t});default:return"".concat(t,": ").concat(a)}}(e,Y)}),(0,a.jsx)("p",{className:"text-[10px] text-[#9A9A9A]",children:eh(e.createdAt,Y)})]})]},e.uuid))})]}),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:Y("comments.title")}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)(J.$,{targetType:"task",targetUuid:t.uuid,currentUserUuid:M,compact:!0})})]})]}):null})}),(0,a.jsx)("div",{className:"border-t border-[#F5F2EC] px-6 py-4",children:(0,a.jsx)("div",{className:"flex items-center gap-3",children:eW?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.$,{variant:"outline",className:"border-[#E5E0D8]",onClick:st,disabled:e2,children:Y("common.cancel")}),(0,a.jsx)(S.$,{className:"bg-[#C67A52] hover:bg-[#B56A42] text-white",onClick:sa,disabled:e2||!eO.trim(),children:e2?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.A,{className:"mr-2 h-4 w-4 animate-spin"}),Y("common.saving")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(A.A,{className:"mr-2 h-4 w-4"}),eV?Y("common.create"):Y("tasks.saveChanges")]})})]}):t?(0,a.jsxs)(a.Fragment,{children:["done"!==t.status&&"closed"!==t.status&&(0,a.jsxs)(S.$,{variant:"outline",className:"border-[#E5E0D8]",onClick:()=>eF(!0),disabled:ef,children:[(0,a.jsx)(N.A,{className:"mr-2 h-4 w-4"}),Y("common.assign")]}),e4&&(0,a.jsxs)(S.$,{className:"flex-1 bg-[#1976D2] hover:bg-[#1565C0] text-white",onClick:()=>ss("in_progress"),disabled:ef,children:[(0,a.jsx)(C.A,{className:"mr-2 h-4 w-4"}),Y("tasks.startWork")]}),e8&&(0,a.jsxs)(S.$,{className:"flex-1 bg-[#7B1FA2] hover:bg-[#6A1B9A] text-white",onClick:()=>ss("to_verify"),disabled:ef,children:[(0,a.jsx)(y.A,{className:"mr-2 h-4 w-4"}),Y("tasks.submitForReview")]}),se&&(0,a.jsxs)(S.$,{className:"flex-1 bg-[#22C55E] hover:bg-[#16A34A] text-white",onClick:()=>ss("done"),disabled:ef,children:[(0,a.jsx)(w,{className:"mr-2 h-4 w-4"}),Y("tasks.markAsVerified")]}),("done"===t.status||"closed"===t.status)&&(0,a.jsx)("div",{className:"text-sm text-[#9A9A9A] text-center w-full",children:Y("tasks.taskCompleted")}),(0,a.jsx)("div",{className:"ml-auto",children:(0,a.jsxs)(U.Lt,{children:[(0,a.jsx)(U.tv,{asChild:!0,children:(0,a.jsx)(S.$,{variant:"outline",size:"icon",className:"h-9 w-9 border-[#E5E0D8] text-[#D32F2F] hover:bg-[#FFEBEE] hover:text-[#D32F2F] hover:border-[#D32F2F]",children:(0,a.jsx)(k.A,{className:"h-4 w-4"})})}),(0,a.jsxs)(U.EO,{children:[(0,a.jsxs)(U.wd,{children:[(0,a.jsx)(U.r7,{children:Y("tasks.deleteTask")}),(0,a.jsx)(U.$v,{children:Y("tasks.deleteTaskConfirm",{title:t.title})})]}),(0,a.jsxs)(U.ck,{children:[(0,a.jsx)(U.Zr,{children:Y("common.cancel")}),(0,a.jsx)(U.Rx,{variant:"destructive",onClick:si,disabled:e9,children:e9?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.A,{className:"mr-2 h-4 w-4 animate-spin"}),Y("common.delete")]}):Y("common.delete")})]})]})]})})]}):null})})]}),t&&ek&&(0,a.jsx)(ee,{task:t,projectUuid:f,currentUserUuid:M,onClose:()=>eF(!1)})]})}},18789:(e,s,t)=>{t.d(s,{A:()=>a});let a=(0,t(66206).A)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]])},32700:(e,s,t)=>{t.d(s,{w:()=>i});var a=t(52217);let i=(0,a.createServerReference)("60e61948d08a5f90212a42d4cd0efd78a07aae46f2",a.callServer,void 0,a.findSourceMapURL,"addTaskDependencyAction")},41111:(e,s,t)=>{t.d(s,{h:()=>i});var a=t(52217);let i=(0,a.createServerReference)("400a9b126aa8432283d46f71e2fa1da35098566ce7",a.callServer,void 0,a.findSourceMapURL,"getBatchWorkerCountsAction")},62482:(e,s,t)=>{t.d(s,{A:()=>a});let a=(0,t(66206).A)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]])},70633:(e,s,t)=>{t.d(s,{A:()=>a});let a=(0,t(66206).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},81531:(e,s,t)=>{t.d(s,{T:()=>i});var a=t(1856);function i(e,s){let[t,i]=(0,a.useState)(null!=s?s:null),[r,c]=(0,a.useState)(()=>new URLSearchParams(window.location.search).get("tab")),n=(0,a.useCallback)((s,t)=>{let a=new URLSearchParams(window.location.search);s?a.set("panel",s):a.delete("panel"),t?a.set("tab",t):a.delete("tab");let i=a.toString();return i?"".concat(e,"?").concat(i):e},[e]),l=(0,a.useCallback)((e,s)=>{let t=n(e,s);window.history.replaceState(null,"",t),i(e),c(null!=s?s:null)},[n]),d=(0,a.useCallback)(()=>{let e=n(null);window.history.replaceState(null,"",e),i(null),c(null)},[n]),o=(0,a.useCallback)(e=>{if(!t)return;let s=n(t,e);window.history.replaceState(null,"",s),c(e)},[n,t]);return(0,a.useEffect)(()=>{function e(){let e=new URLSearchParams(window.location.search),s=e.get("panel");s?(i(s),c(e.get("tab"))):(i(null),c(null))}return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[]),{selectedId:t,selectedTab:r,openPanel:l,closePanel:d,switchTab:o}}},90795:(e,s,t)=>{t.d(s,{Bj:()=>l,L8:()=>i,Wl:()=>d,_5:()=>n,eT:()=>r,fw:()=>c});var a=t(38106);let i=480;function r(e){switch(e){case"done":return"bg-[#00796B]";case"in_progress":return"bg-[#1976D2]";case"to_verify":return"bg-[#7B1FA2]";case"open":case"assigned":return"bg-[#E65100]";case"closed":return"bg-[#9A9A9A]";default:return"bg-[#D9D9D9]"}}function c(e,s){let t=new Date(e),i=new Date().getTime()-t.getTime(),r=Math.floor(i/6e4),c=Math.floor(i/36e5),n=Math.floor(i/864e5);return r<1?s("time.justNow"):r<60?s("time.minutesAgo",{minutes:r}):c<24?s("time.hoursAgo",{hours:c}):n<7?s("time.daysAgo",{days:n}):(0,a.r)(t)}let n={todo:"bg-[#FFF3E0] text-[#E65100]",in_progress:"bg-[#E3F2FD] text-[#1976D2]",human_conduct_required:"bg-[#F3E5F5] text-[#7B1FA2]",done:"bg-[#E0F2F1] text-[#00796B]"},l={todo:"todo",in_progress:"inProgress",human_conduct_required:"humanConductRequired",done:"done"},d={open:"open",researching:"researching",answer_questions:"answerQuestions",planning:"planning",review_proposal:"reviewProposal",building:"building",verify_work:"verifyWork",done:"done"}},92745:(e,s,t)=>{t.d(s,{_u:()=>N,c_:()=>g,nF:()=>A,qK:()=>j});var a=t(90508),i=t(1856),r=t(26145),c=t(75380);t(33805);var n=t(10196),l=t.n(n),d=t(39268),o=t(57731);let x={open:"bg-[#FFF3E0] text-[#E65100]",assigned:"bg-[#E3F2FD] text-[#1976D2]",in_progress:"bg-[#E8F5E9] text-[#5A9E6F]",to_verify:"bg-[#F3E5F5] text-[#7B1FA2]",done:"bg-[#E0F2F1] text-[#00796B]",closed:"bg-[#F5F5F5] text-[#9A9A9A]"},m={open:"#E65100",assigned:"#1976D2",in_progress:"#5A9E6F",to_verify:"#7B1FA2",done:"#00796B",closed:"#9A9A9A"},u={low:"priority.low",medium:"priority.medium",high:"priority.high",critical:"priority.critical"},h={open:"status.open",assigned:"status.assigned",in_progress:"status.inProgress",to_verify:"status.toVerify",done:"status.done",closed:"status.closed"},p={low:"bg-[#9A9A9A]",medium:"bg-[#E65100]",high:"bg-[#D32F2F]",critical:"bg-[#B71C1C]"},g={taskNode:function(e){let{data:s}=e,t=(0,d.c)();return(0,a.jsxs)("div",{className:"rounded-lg border-2 border-[#E5E2DC] bg-white px-4 py-3 shadow-sm min-w-[200px] max-w-[260px] cursor-pointer hover:border-[#C67A52] transition-colors",children:[(0,a.jsx)(r.h7,{type:"target",position:c.yX.Top,className:"!bg-[#C67A52] !w-2 !h-2"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,a.jsx)(o.E,{className:"text-[10px] ".concat(x[s.status]||""),children:t(h[s.status]||s.status)}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("div",{className:"h-1.5 w-1.5 rounded-full ".concat(p[s.priority]||"")}),(0,a.jsx)("span",{className:"text-[10px] text-[#9A9A9A]",children:t(u[s.priority]||s.priority)})]})]}),(0,a.jsx)("p",{className:"text-xs font-medium text-[#2C2C2C] leading-snug line-clamp-2",children:s.title}),(0,a.jsx)(r.h7,{type:"source",position:c.yX.Bottom,className:"!bg-[#C67A52] !w-2 !h-2"})]})}},v={taskNode:function(e){let{data:s}=e,t=m[s.status]||"#E5E0D8";return(0,a.jsxs)("div",{className:"rounded-md border-[1.5px] bg-white px-2.5 py-1.5 shadow-sm",style:{borderColor:t,width:f},children:[(0,a.jsx)(r.h7,{type:"target",position:c.yX.Top,className:"!bg-[#C67A52] !w-1.5 !h-1.5"}),(0,a.jsx)("p",{className:"text-[10px] font-medium text-[#2C2C2C] leading-tight line-clamp-2",children:s.title}),(0,a.jsx)(r.h7,{type:"source",position:c.yX.Bottom,className:"!bg-[#C67A52] !w-1.5 !h-1.5"})]})}},f=150,j={animated:!0,style:{stroke:"#C67A52",strokeWidth:2},markerEnd:{type:"arrowclosed",color:"#C67A52"}},b={animated:!0,style:{stroke:"#C67A52",strokeWidth:1.5},markerEnd:{type:"arrowclosed",color:"#C67A52"}};function A(e,s,t){var a,i,r,c;let n=null!=(a=null==t?void 0:t.nodeWidth)?a:240,d=null!=(i=null==t?void 0:t.nodeHeight)?i:80,o=new(l()).graphlib.Graph;return o.setDefaultEdgeLabel(()=>({})),o.setGraph({rankdir:"TB",nodesep:null!=(r=null==t?void 0:t.nodesep)?r:50,ranksep:null!=(c=null==t?void 0:t.ranksep)?c:80}),e.forEach(e=>{o.setNode(e.id,{width:n,height:d})}),s.forEach(e=>{o.setEdge(e.source,e.target)}),l().layout(o),{nodes:e.map(e=>{let s=o.node(e.id);return{...e,position:{x:s.x-n/2,y:s.y-d/2}}}),edges:s}}function N(e){let{tasks:s,edges:t,readonly:c=!1,compact:n=!1,height:l,onNodeClick:o,className:x}=e,m=(0,d.c)(),{layoutedNodes:u,layoutedEdges:h}=(0,i.useMemo)(()=>{let e=s.map(e=>{var s;return{id:e.uuid,type:"taskNode",position:{x:0,y:0},data:{title:e.title,status:e.status,priority:e.priority,proposalUuid:null!=(s=e.proposalUuid)?s:null}}}),a=A(e,t.map((e,s)=>({id:"e-".concat(s),source:e.to,target:e.from,...n?b:j})),n?{nodeWidth:f,nodeHeight:50,nodesep:20,ranksep:40}:void 0);return{layoutedNodes:a.nodes,layoutedEdges:a.edges}},[s,t,n]);return 0===s.length?(0,a.jsx)("div",{className:"flex items-center justify-center text-sm text-[#9A9A9A] ".concat(x||""),style:l?{height:l}:void 0,children:m("tasks.noTasksToDisplay")}):(0,a.jsx)("div",{className:"rounded-[10px] border border-[#E5E0D8] bg-[#F7F6F3] ".concat(x||""),style:l?{height:l}:void 0,children:(0,a.jsxs)(r.Gc,{nodes:u,edges:h,nodeTypes:n?v:g,onNodeClick:o?(e,s)=>o(s.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,a.jsx)(r.VS,{color:"#E5E0D8",gap:20}),!c&&(0,a.jsx)(r.H2,{className:"[&>button]:border-[#E5E0D8] [&>button]:bg-white [&>button]:text-[#2C2C2C] [&>button:hover]:bg-[#FAF8F4]"})]})})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[35486],{4365:(e,t,a)=>{a.d(t,{G7:()=>o,L$:()=>u,h_:()=>x,oI:()=>d,uB:()=>l,xL:()=>c});var s=a(90508);a(1856);var r=a(64731),n=a(30044),i=a(24377);function l(e){let{className:t,...a}=e;return(0,s.jsx)(r.uB,{"data-slot":"command",className:(0,i.cn)("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...a})}function o(e){let{className:t,...a}=e;return(0,s.jsxs)("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[(0,s.jsx)(n.A,{className:"size-4 shrink-0 opacity-50"}),(0,s.jsx)(r.uB.Input,{"data-slot":"command-input",className:(0,i.cn)("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...a})]})}function d(e){let{className:t,...a}=e;return(0,s.jsx)(r.uB.List,{"data-slot":"command-list",className:(0,i.cn)("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),...a})}function c(e){let{...t}=e;return(0,s.jsx)(r.uB.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t})}function u(e){let{className:t,...a}=e;return(0,s.jsx)(r.uB.Group,{"data-slot":"command-group",className:(0,i.cn)("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...a})}function x(e){let{className:t,...a}=e;return(0,s.jsx)(r.uB.Item,{"data-slot":"command-item",className:(0,i.cn)("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t),...a})}},14554:(e,t,a)=>{a.d(t,{p:()=>n});var s=a(90508);a(1856);var r=a(24377);function n(e){let{className:t,type:a,...n}=e;return(0,s.jsx)("input",{type:a,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...n})}},15972:(e,t,a)=>{a.d(t,{T:()=>n});var s=a(90508);a(1856);var r=a(24377);function n(e){let{className:t,...a}=e;return(0,s.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...a})}},17001:(e,t,a)=>{a.d(t,{AM:()=>i,Wv:()=>l,hl:()=>o});var s=a(90508);a(1856);var r=a(79919),n=a(24377);function i(e){let{...t}=e;return(0,s.jsx)(r.Root,{"data-slot":"popover",...t})}function l(e){let{...t}=e;return(0,s.jsx)(r.Trigger,{"data-slot":"popover-trigger",...t})}function o(e){let{className:t,align:a="center",sideOffset:i=4,...l}=e;return(0,s.jsx)(r.Portal,{children:(0,s.jsx)(r.Content,{"data-slot":"popover-content",align:a,sideOffset:i,className:(0,n.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...l})})}},18347:(e,t,a)=>{a.d(t,{Z:()=>r});var s=a(52217);let r=(0,s.createServerReference)("60617c2383c242812e8771091926b3985cdc54198d",s.callServer,void 0,s.findSourceMapURL,"deleteIdeaAction")},27939:(e,t,a)=>{a.d(t,{z:()=>r});var s=a(52217);let r=(0,s.createServerReference)("40eba34de2272666c8403c4c673feb198e9f0be2e2",s.callServer,void 0,s.findSourceMapURL,"getElaborationAction")},32260:(e,t,a)=>{a.d(t,{J:()=>r});var s=a(52217);let r=(0,s.createServerReference)("40f255f3f891818c05b96831d0a86f6089de5d8a43",s.callServer,void 0,s.findSourceMapURL,"updateIdeaAction")},41033:(e,t,a)=>{a.d(t,{C:()=>o,z:()=>l});var s=a(90508);a(1856);var r=a(97964),n=a(63197),i=a(24377);function l(e){let{className:t,...a}=e;return(0,s.jsx)(n.Root,{"data-slot":"radio-group",className:(0,i.cn)("grid gap-3",t),...a})}function o(e){let{className:t,...a}=e;return(0,s.jsx)(n.Item,{"data-slot":"radio-group-item",className:(0,i.cn)("border-input text-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 dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:(0,s.jsx)(n.Indicator,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:(0,s.jsx)(r.A,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}},57731:(e,t,a)=>{a.d(t,{E:()=>o});var s=a(90508);a(1856);var r=a(49499),n=a(54154),i=a(24377);let l=(0,r.F)("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline",success:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100",warning:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100"}},defaultVariants:{variant:"default"}});function o(e){let{className:t,variant:a="default",asChild:r=!1,...o}=e,d=r?n.bL:"span";return(0,s.jsx)(d,{"data-slot":"badge","data-variant":a,className:(0,i.cn)(l({variant:a}),t),...o})}},62929:(e,t,a)=>{a.d(t,{R:()=>N});var s=a(90508),r=a(1856),n=a(23675),i=a(39268),l=a(17730),o=a(78948),d=a(37915),c=a(62898),u=a(57893),x=a(60532),m=a(85226),p=a(22922),f=a(14554),g=a(81750),h=a(52217);let v=(0,h.createServerReference)("7064838059846ed59cbec509f45f72c827ff4bde6d",h.callServer,void 0,h.findSourceMapURL,"submitElaborationAnswersAction");var b=a(42305);let j="__other__",w={functional:"functional",non_functional:"nonFunctional",business_context:"businessContext",technical_context:"technicalContext",user_scenario:"userScenario",scope:"scope"};function N(e){let{ideaUuid:t,elaboration:a,onRefresh:r}=e,l=(0,i.c)("elaboration"),o=(0,n.useRouter)();if(!a||0===a.rounds.length)return null;let{summary:d,rounds:c}=a;return(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:l("title")}),(0,s.jsx)("span",{className:"text-xs font-medium text-[#C67A52]",children:l("answeredCounter",{answered:d.answeredQuestions,total:d.totalQuestions})})]}),(0,s.jsx)("div",{className:"space-y-2.5",children:c.map(e=>(0,s.jsx)(y,{round:e,ideaUuid:t,onAnswered:async()=>{await (null==r?void 0:r()),o.refresh()}},e.uuid))})]})}function y(e){let{round:t,ideaUuid:a,onAnswered:n}=e,d=(0,i.c)("elaboration"),c="pending_answers"===t.status,u="answered"===t.status||"validated"===t.status||"needs_followup"===t.status,[x,m]=(0,r.useState)(c);return(0,s.jsx)(g.Nt,{open:x,onOpenChange:m,children:(0,s.jsxs)("div",{className:"overflow-hidden rounded-xl border border-[#E5E0D8] bg-white",children:[(0,s.jsx)(g.R6,{asChild:!0,children:(0,s.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between px-4 py-3 text-left transition-colors cursor-pointer hover:bg-[#FAF8F4] ".concat(x?"bg-[#F7F6F3] border-b border-[#E5E0D8]":""),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[x?(0,s.jsx)(l.A,{className:"h-4 w-4 text-[#6B6B6B]"}):(0,s.jsx)(o.A,{className:"h-4 w-4 text-[#6B6B6B]"}),(0,s.jsx)("span",{className:"flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-full text-[11px] font-semibold text-white ".concat(c?"bg-[#C67A52]":"bg-[#888780]"),children:t.roundNumber}),(0,s.jsx)("span",{className:"text-[13px] font-semibold text-[#2C2C2C]",children:d("roundLabel",{number:t.roundNumber})}),!x&&(0,s.jsxs)("span",{className:"text-xs text-[#9A9A9A]",children:["\xb7 ",d("questionCount",{count:t.questions.length})]})]}),u?(0,s.jsx)("span",{className:"rounded bg-[#E8F5E9] px-2 py-0.5 text-[10px] font-medium text-[#2E7D32]",children:d("statusAnswered")}):(0,s.jsx)("span",{className:"rounded bg-[#FFF3E0] px-2 py-0.5 text-[10px] font-medium text-[#E65100]",children:d("pendingAnswers")})]})}),(0,s.jsx)(g.Ke,{children:c?(0,s.jsx)(C,{round:t,ideaUuid:a,onAnswered:n}):(0,s.jsx)(A,{round:t})})]})})}function A(e){let{round:t}=e,a=(0,i.c)("elaboration");return(0,s.jsx)("div",{className:"space-y-4 px-4 py-4",children:t.questions.map((e,r)=>{var n,i;let l=(null==(n=e.answer)?void 0:n.selectedOptionId)?e.options.find(t=>{var a;return t.id===(null==(a=e.answer)?void 0:a.selectedOptionId)}):null,o=(null==(i=e.answer)?void 0:i.customText)||(null==l?void 0:l.label)||a("noAnswer"),d=w[e.category]||e.category;return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsxs)("span",{className:"text-xs leading-relaxed text-[#6B6B6B]",children:["Q: ",e.text]}),(0,s.jsx)("span",{className:"shrink-0 text-[11px] italic text-[#B0B0B0]",children:a("category.".concat(d))})]}),(0,s.jsxs)("p",{className:"mt-1 text-xs font-medium leading-relaxed text-[#2C2C2C]",children:["A: ",o]}),r<t.questions.length-1&&(0,s.jsx)("div",{className:"mt-4 h-px bg-[#F0EEEA]"})]},e.uuid)})})}function C(e){var t,a,n;let{round:l,ideaUuid:g,onAnswered:h}=e,N=(0,i.c)("elaboration"),[y,A]=(0,r.useState)(0),C=(0,r.useRef)(y),[k,S]=(0,r.useState)("right"),[B,E]=(0,r.useState)({}),[F,D]=(0,r.useState)(!1),[R,z]=(0,r.useState)(null);(0,r.useEffect)(()=>{C.current=y},[y]);let I=(0,r.useCallback)((e,t)=>{S("left"===t?"right":"left"),A(e)},[]),_=l.questions,U=_[y],T=w[U.category]||U.category,L=(0,r.useCallback)((e,t)=>{if(E(a=>{var s;return{...a,[e]:{questionId:e,selectedOptionId:t===j?null:t,customText:t===j?(null==(s=a[e])?void 0:s.customText)||"":null}}}),t!==j){let e=Math.min(_.length-1,C.current+1);e!==C.current&&setTimeout(()=>I(e,"left"),200)}},[_.length,I]),O=(0,r.useCallback)((e,t)=>{E(a=>({...a,[e]:{...a[e],questionId:e,selectedOptionId:null,customText:t}}))},[]),M=_.filter(e=>e.required).every(e=>{let t=B[e.questionId];return!!t&&!!(t.selectedOptionId||t.customText&&t.customText.trim())}),q=async()=>{D(!0),z(null);let e=Object.values(B),t=await v(g,l.uuid,e);t.success?(await h(),D(!1)):(D(!1),z(t.error||N("submitFailed")))},P=(e=>{let t=B[e];return t?null===t.selectedOptionId&&null!==t.customText&&void 0!==t.customText?j:t.selectedOptionId||null:null})(U.questionId),$=P===j,K=y===_.length-1,G=!!(null!=(n=null==(t=B[U.questionId])?void 0:t.customText)?n:"").trim();return(0,s.jsxs)("div",{className:"overflow-hidden p-3.5",children:[(0,s.jsxs)("div",{className:"right"===k?"animate-in slide-in-from-right-4 duration-200":"animate-in slide-in-from-left-4 duration-200",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsx)("div",{className:"flex-1 text-sm text-[#6B6B6B]",children:U.text}),(0,s.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[(0,s.jsx)(p.$,{variant:"ghost",size:"icon",onClick:()=>I(y-1,"right"),disabled:0===y,className:"h-7 w-7 text-[#6B6B6B] disabled:opacity-30",children:(0,s.jsx)(d.A,{className:"h-4 w-4"})}),(0,s.jsx)("span",{className:"text-xs text-[#9A9A9A]",children:N("navCounter",{current:y+1,total:_.length})}),(0,s.jsx)(p.$,{variant:"ghost",size:"icon",onClick:()=>I(y+1,"left"),disabled:y===_.length-1,className:"h-7 w-7 text-[#6B6B6B] disabled:opacity-30",children:(0,s.jsx)(o.A,{className:"h-4 w-4"})})]})]}),(0,s.jsxs)("div",{className:"mt-3",children:[U.options.map((e,t)=>{let a=P===e.id;return(0,s.jsxs)("div",{children:[(0,s.jsxs)(p.$,{variant:"ghost",onClick:()=>L(U.questionId,e.id),className:"flex w-full items-start justify-between gap-2.5 px-3.5 py-3 h-auto text-left transition-colors rounded-none ".concat(a?"bg-[#F7F6F3]":"hover:bg-[#FAF8F4]"),children:[(0,s.jsxs)("span",{className:"flex flex-1 min-w-0 items-start gap-2.5",children:[(0,s.jsx)("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-[#E5E0D8] text-xs font-medium text-[#5F5E5A]",children:t+1}),(0,s.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col items-start",children:[(0,s.jsx)("span",{className:"whitespace-normal [overflow-wrap:anywhere] text-[13px] text-[#2C2C2A]",children:e.label}),e.description&&(0,s.jsx)("span",{className:"whitespace-normal [overflow-wrap:anywhere] text-[11px] text-[#9A9A9A]",children:e.description})]})]}),a&&(0,s.jsx)(c.A,{className:"mt-1 h-4 w-4 shrink-0 text-[#888780]"})]}),t<U.options.length-1&&(0,s.jsx)("div",{className:"h-px bg-[#F0EEEA]"})]},e.id)}),(0,s.jsx)("div",{className:"h-px bg-[#F0EEEA]"}),(0,s.jsxs)("div",{className:"flex w-full items-center gap-2.5 px-3.5 py-3 transition-colors ".concat($?"bg-[#F7F6F3]":"hover:bg-[#FAF8F4]"),children:[(0,s.jsx)("span",{className:"flex h-7 w-7 shrink-0 cursor-pointer items-center justify-center rounded-md bg-[#E5E0D8]",onClick:()=>L(U.questionId,j),children:(0,s.jsx)(u.A,{className:"h-3.5 w-3.5 text-[#B4B2A9]"})}),$?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(f.p,{type:"text",value:(null==(a=B[U.questionId])?void 0:a.customText)||"",onChange:e=>O(U.questionId,e.target.value),onKeyDown:e=>{if((0,b.P)(e)||"Enter"!==e.key||e.shiftKey||e.ctrlKey||e.metaKey||(e.preventDefault(),K||!G))return;let t=C.current+1;setTimeout(()=>I(t,"left"),200)},placeholder:N("somethingElse"),className:"flex-1 border-none bg-transparent text-[13px] text-[#2C2C2A] placeholder:italic placeholder:text-[#B4B2A9] shadow-none focus-visible:ring-0",autoFocus:!0}),!K&&(0,s.jsx)(p.$,{type:"button",variant:"ghost",size:"icon",onClick:()=>{if(K||!G)return;let e=C.current+1;setTimeout(()=>I(e,"left"),200)},disabled:!G,"aria-label":N("confirmAnswerAria"),className:"h-7 w-7 text-[#6B6B6B] disabled:opacity-30",children:(0,s.jsx)(x.A,{className:"h-4 w-4"})})]}):(0,s.jsx)(p.$,{variant:"ghost",onClick:()=>L(U.questionId,j),className:"flex-1 justify-start text-left text-[13px] italic text-[#B4B2A9] h-auto p-0 hover:bg-transparent",children:N("somethingElse")})]})]})]},y),R&&(0,s.jsx)("div",{className:"mt-3 rounded-lg bg-destructive/10 p-2.5 text-[12px] text-destructive",children:R}),(0,s.jsxs)("div",{className:"mt-3 flex items-center justify-between",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-[11px] text-[#B0B0B0]",children:[(0,s.jsx)("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-[#C67A52]"}),N("category.".concat(T))]}),(0,s.jsx)(p.$,{onClick:q,disabled:!M||F,className:"bg-[#C67A52] hover:bg-[#B56A42] text-white text-[13px]",children:F?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.A,{className:"mr-2 h-3.5 w-3.5 animate-spin"}),N("submitting")]}):N("submitAnswers")})]})]})}},64993:(e,t,a)=>{a.d(t,{F:()=>i});var s=a(90508);a(1856);var r=a(65326),n=a(24377);function i(e){let{className:t,children:a,...i}=e;return(0,s.jsxs)(r.Root,{"data-slot":"scroll-area",className:(0,n.cn)("relative",t),...i,children:[(0,s.jsx)(r.Viewport,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:a}),(0,s.jsx)(l,{}),(0,s.jsx)(r.Corner,{})]})}function l(e){let{className:t,orientation:a="vertical",...i}=e;return(0,s.jsx)(r.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:a,className:(0,n.cn)("flex touch-none p-px transition-colors select-none","vertical"===a&&"h-full w-2.5 border-l border-l-transparent","horizontal"===a&&"h-2.5 flex-col border-t border-t-transparent",t),...i,children:(0,s.jsx)(r.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}},65626:(e,t,a)=>{a.d(t,{K5:()=>o,Rf:()=>l,Yv:()=>s,bK:()=>i,qG:()=>n,tE:()=>r});let s={fast:.15,normal:.2,slow:.3,easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1],stagger:.04,staggerFast:.03,spring:{type:"spring",stiffness:500,damping:30},tween:{type:"tween",duration:.2,ease:[0,0,.2,1]}},r={initial:{opacity:0,y:8},animate:{opacity:1,y:0,transition:{duration:s.normal,ease:s.easeOut}},exit:{opacity:0,y:-4,transition:{duration:s.fast,ease:s.easeOut}}},n={initial:{opacity:0},animate:{opacity:1,transition:{duration:s.normal,ease:s.easeOut}},exit:{opacity:0,transition:{duration:s.fast,ease:s.easeOut}}};s.normal,s.easeOut,s.fast,s.easeOut;let i={initial:{},animate:{transition:{staggerChildren:s.stagger}}},l={initial:{opacity:0,y:8},animate:{opacity:1,y:0,transition:{duration:s.normal,ease:s.easeOut}}},o={initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0,transition:{duration:s.fast,ease:s.easeOut}},exit:{opacity:0,scale:.95,y:-4,transition:{duration:s.fast,ease:s.easeOut}}}},81750:(e,t,a)=>{a.d(t,{Ke:()=>o,Nt:()=>i,R6:()=>l});var s=a(90508),r=a(38476),n=a(24377);function i(e){let{...t}=e;return(0,s.jsx)(r.Root,{"data-slot":"collapsible",...t})}function l(e){let{...t}=e;return(0,s.jsx)(r.Trigger,{"data-slot":"collapsible-trigger",...t})}function o(e){let{className:t,...a}=e;return(0,s.jsx)(r.Content,{"data-slot":"collapsible-content",className:(0,n.cn)("overflow-hidden data-[state=open]:animate-[collapsible-down_250ms_ease-in-out] data-[state=closed]:animate-[collapsible-up_200ms_ease-in-out]",t),...a})}},84103:(e,t,a)=>{a.d(t,{h:()=>y});var s=a(90508),r=a(1856),n=a(39268),i=a(23675),l=a(67587),o=a(85226),d=a(30825),c=a(60532),u=a(17475),x=a(22922),m=a(88064),p=a(97438),f=a(4365),g=a(17001),h=a(24377),v=a(52217);let b=(0,v.createServerReference)("00007d98eddea70ac03aa46cc211972042863bdbcf",v.callServer,void 0,v.findSourceMapURL,"getProjectsAndGroupsAction"),j=(0,v.createServerReference)("6031b83c7e48a3a21624e15c0e003377117809671a",v.callServer,void 0,v.findSourceMapURL,"moveIdeaPreviewAction"),w=(0,v.createServerReference)("60bfd14cca7aaa2de736b5b6da202109f13fe3c61a",v.callServer,void 0,v.findSourceMapURL,"moveIdeaAction");var N=a(67712);function y(e){let{open:t,onOpenChange:a,ideaUuid:v,projectUuid:y,onMoved:A}=e,C=(0,n.c)("ideas"),k=(0,n.c)("common"),S=(0,i.useRouter)(),[B,E]=(0,r.useState)([]),[F,D]=(0,r.useState)(!1),[R,z]=(0,r.useState)(null),[I,_]=(0,r.useState)(!1),U=(()=>{if(!R)return null;for(let e of B){let t=e.projects.find(e=>e.uuid===R);if(t)return t.name}return null})(),[T,L]=(0,r.useState)(null),[O,M]=(0,r.useState)(!1),[q,P]=(0,r.useState)(null),[$,K]=(0,r.useState)(!1),[G,J]=(0,r.useState)(null),V=(0,r.useRef)(0),W=(0,r.useCallback)(e=>{e&&e.addEventListener("wheel",e=>e.stopPropagation(),{passive:!0})},[]),Q=(0,r.useCallback)(async()=>{z(null),L(null),P(null),J(null),D(!0);try{let e=await b();if(e.success){let{projects:t,groups:a}=e.data,s=t.filter(e=>e.uuid!==y).map(e=>({uuid:e.uuid,name:e.name,groupUuid:e.groupUuid})),r=new Map;for(let e of a)r.set(e.uuid,e.name);let n=new Map,i=[];for(let e of s)e.groupUuid&&r.has(e.groupUuid)?(n.has(e.groupUuid)||n.set(e.groupUuid,{uuid:e.groupUuid,name:r.get(e.groupUuid),projects:[]}),n.get(e.groupUuid).projects.push({uuid:e.uuid,name:e.name})):i.push({uuid:e.uuid,name:e.name});let l=[...n.values()];i.length>0&&l.push({uuid:"ungrouped",name:C("ungrouped"),projects:i}),E(l)}}catch(e){N.q.error("Failed to load projects for move dialog:",e),E([])}D(!1)},[y,C]);(0,r.useEffect)(()=>{t&&Q()},[t,Q]),(0,r.useEffect)(()=>{if(!R){L(null),P(null);return}let e=++V.current;M(!0),P(null),L(null),j(v,R).then(t=>{e===V.current&&(t.success?L(t.moved):P(t.error||C("moveDialog.error",{message:""})))}).catch(t=>{e===V.current&&(N.q.error("Failed to fetch move preview:",t),P(C("moveDialog.error",{message:t instanceof Error?t.message:String(t)})))}).finally(()=>{e===V.current&&M(!1)})},[R,v,C]);let Y=async()=>{if(R&&T&&!$){K(!0),J(null);try{let e=await w(v,R);if(e.success){let t=e.moved;l.oR.success(C("moveDialog.successToast",{...t}),{action:{label:C("moveDialog.viewMovedIdea"),onClick:()=>{S.push("/projects/".concat(R,"/dashboard?panel=").concat(v,"&tab=overview"))}}}),a(!1),S.refresh(),A(t)}else J(C("moveDialog.error",{message:e.error||C("moveFailed")}))}catch(e){J(C("moveDialog.error",{message:e instanceof Error?e.message:C("moveFailed")}))}K(!1)}};return(0,s.jsx)(p.lG,{open:t,onOpenChange:a,children:(0,s.jsxs)(p.Cf,{children:[(0,s.jsxs)(p.c7,{children:[(0,s.jsx)(p.L3,{children:C("moveDialog.title")}),(0,s.jsx)(p.rr,{children:C("moveDialog.description")})]}),(0,s.jsxs)("div",{className:"space-y-3 pt-1",children:[(0,s.jsx)(m.J,{htmlFor:"move-target-project",className:"text-[13px] font-medium text-[#2C2C2C]",children:C("moveDialog.targetProjectLabel")}),F?(0,s.jsx)("div",{className:"flex items-center justify-center h-10 border border-[#E5E0D8] rounded-md",children:(0,s.jsx)(o.A,{className:"h-4 w-4 animate-spin text-[#9A9A9A]"})}):(0,s.jsxs)(g.AM,{open:I,onOpenChange:_,children:[(0,s.jsx)(g.Wv,{asChild:!0,children:(0,s.jsxs)(x.$,{id:"move-target-project",variant:"outline",role:"combobox","aria-expanded":I,className:(0,h.cn)("w-full justify-between border-[#E5E0D8] font-normal",!U&&"text-[#9A9A9A]"),children:[null!=U?U:C("moveDialog.targetProjectPlaceholder"),(0,s.jsx)(d.A,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,s.jsx)(g.hl,{ref:W,className:"w-[--radix-popover-trigger-width] p-0 pointer-events-auto",align:"start",children:(0,s.jsxs)(f.uB,{children:[(0,s.jsx)(f.G7,{placeholder:C("moveDialog.searchProjects")}),(0,s.jsxs)(f.oI,{children:[(0,s.jsx)(f.xL,{children:C("noProjectsFound")}),B.map(e=>(0,s.jsx)(f.L$,{heading:e.name,children:e.projects.map(t=>(0,s.jsxs)(f.h_,{value:"".concat(t.name," ").concat(e.name),onSelect:()=>{z(t.uuid),_(!1)},children:[(0,s.jsx)(c.A,{className:(0,h.cn)("mr-2 h-4 w-4",R===t.uuid?"opacity-100":"opacity-0")}),t.name]},t.uuid))},e.uuid))]})]})})]}),R&&(0,s.jsx)("div",{role:"status","aria-live":"polite",className:"rounded-lg border border-[#E5E0D8] bg-[#FAF8F4] p-3 text-[13px] text-[#2C2C2C]",children:O?(0,s.jsxs)("div",{className:"flex items-center gap-2 text-[#6B6B6B]",children:[(0,s.jsx)(o.A,{className:"h-3.5 w-3.5 animate-spin"}),(0,s.jsx)("span",{children:C("moveDialog.previewLoading")})]}):q?(0,s.jsxs)("div",{className:"flex items-start gap-2 text-destructive",children:[(0,s.jsx)(u.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,s.jsx)("span",{children:q})]}):T?(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{children:C("moveDialog.previewSummary",{...T})}),(0,s.jsx)("p",{className:"text-[12px] text-[#9A9A9A]",children:C("moveDialog.previewWarning")})]}):null}),G&&(0,s.jsx)("p",{className:"text-xs text-destructive",role:"alert",children:G})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-3 pt-2",children:[(0,s.jsx)(x.$,{variant:"outline",className:"border-[#E5E0D8]",onClick:()=>a(!1),disabled:$,children:k("cancel")}),(0,s.jsx)(x.$,{className:"bg-[#C67A52] hover:bg-[#B56A42] text-white",onClick:Y,disabled:!R||!T||$||O,children:$?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.A,{className:"mr-2 h-4 w-4 animate-spin"}),C("moving")]}):C("moveDialog.confirm")})]})]})})}},88064:(e,t,a)=>{a.d(t,{J:()=>i});var s=a(90508);a(1856);var r=a(58057),n=a(24377);function i(e){let{className:t,...a}=e;return(0,s.jsx)(r.Root,{"data-slot":"label",className:(0,n.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...a})}},88179:(e,t,a)=>{a.d(t,{x:()=>r});var s=a(52217);let r=(0,s.createServerReference)("40dd39ef3975ba7aaeedf05316839e53aa3ca3048c",s.callServer,void 0,s.findSourceMapURL,"getIdeaActivitiesAction")},91846:(e,t,a)=>{a.d(t,{bq:()=>u,eb:()=>m,gC:()=>x,l6:()=>d,yv:()=>c});var s=a(90508);a(1856);var r=a(17730),n=a(60532),i=a(89967),l=a(48218),o=a(24377);function d(e){let{...t}=e;return(0,s.jsx)(l.Root,{"data-slot":"select",...t})}function c(e){let{...t}=e;return(0,s.jsx)(l.Value,{"data-slot":"select-value",...t})}function u(e){let{className:t,size:a="default",children:n,...i}=e;return(0,s.jsxs)(l.Trigger,{"data-slot":"select-trigger","data-size":a,className:(0,o.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...i,children:[n,(0,s.jsx)(l.Icon,{asChild:!0,children:(0,s.jsx)(r.A,{className:"size-4 opacity-50"})})]})}function x(e){let{className:t,children:a,position:r="item-aligned",align:n="center",...i}=e;return(0,s.jsx)(l.Portal,{children:(0,s.jsxs)(l.Content,{"data-slot":"select-content",className:(0,o.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,align:n,...i,children:[(0,s.jsx)(p,{}),(0,s.jsx)(l.Viewport,{className:(0,o.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),(0,s.jsx)(f,{})]})})}function m(e){let{className:t,children:a,...r}=e;return(0,s.jsxs)(l.Item,{"data-slot":"select-item",className:(0,o.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...r,children:[(0,s.jsx)("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,s.jsx)(l.ItemIndicator,{children:(0,s.jsx)(n.A,{className:"size-4"})})}),(0,s.jsx)(l.ItemText,{children:a})]})}function p(e){let{className:t,...a}=e;return(0,s.jsx)(l.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,s.jsx)(i.A,{className:"size-4"})})}function f(e){let{className:t,...a}=e;return(0,s.jsx)(l.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,s.jsx)(r.A,{className:"size-4"})})}},92715:(e,t,a)=>{a.d(t,{i:()=>w});var s=a(90508),r=a(1856),n=a(23675),i=a(39268),l=a(9160),o=a(85226),d=a(5425),c=a(94903),u=a(22922),x=a(88064),m=a(41033),p=a(91846),f=a(52217);let g=(0,f.createServerReference)("008127e61d1a2b93414427d9254894b652bf634a1c",f.callServer,void 0,f.findSourceMapURL,"getPmAgentsAction"),h=(0,f.createServerReference)("40acf33fcac9689fd03b4b47f5b3613edd2d7c0eac",f.callServer,void 0,f.findSourceMapURL,"claimIdeaAction"),v=(0,f.createServerReference)("60cc0ca7e086e5de740232d9ba14b99f5f787e61ed",f.callServer,void 0,f.findSourceMapURL,"claimIdeaToAgentAction"),b=(0,f.createServerReference)("60fce9c195a035f568667c03dc3c3707f77f06673f",f.callServer,void 0,f.findSourceMapURL,"claimIdeaToUserAction"),j=(0,f.createServerReference)("40a7b8275d5a0c936ee891fcb08d82c1c035c4e85f",f.callServer,void 0,f.findSourceMapURL,"releaseIdeaAction");function w(e){var t;let{idea:a,projectUuid:f,currentUserUuid:w,onClose:N}=e,y=(0,i.c)(),A=(0,n.useRouter)(),[C,k]=(0,r.useState)(!1),[S,B]=(0,r.useState)("self"),[E,F]=(0,r.useState)(""),[D,R]=(0,r.useState)(""),[z,I]=(0,r.useState)([]),[_,U]=(0,r.useState)([]),[T,L]=(0,r.useState)(!0),O=!!a.assignee;(0,r.useEffect)(()=>{!async function(){L(!0);let e=await g();I(e.agents||[]),U((e.users||[]).filter(e=>e.uuid!==w)),L(!1)}()},[w]);let M=async()=>{let e;if(k(!0),"self"===S)e=await h(a.uuid);else if("agent"===S&&E)e=await v(a.uuid,E);else if("user"===S&&D)e=await b(a.uuid,D);else{if("release"!==S)return void k(!1);e=await j(a.uuid)}k(!1),(null==e?void 0:e.success)&&(A.refresh(),N())},q="self"===S||"agent"===S&&E||"user"===S&&D||"release"===S&&O;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed inset-0 z-50 bg-black/40",onClick:N}),(0,s.jsxs)("div",{className:"fixed left-1/2 top-1/2 z-50 w-[400px] -translate-x-1/2 -translate-y-1/2 rounded-2xl bg-white shadow-xl border border-[#E5E0D8]",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-[#E5E0D8] px-6 py-5",children:[(0,s.jsx)("h2",{className:"text-base font-semibold text-[#2C2C2C]",children:y("ideas.assignIdea")}),(0,s.jsx)("button",{onClick:N,className:"text-[#9A9A9A] hover:text-[#6B6B6B] transition-colors",children:(0,s.jsx)(l.A,{className:"h-5 w-5"})})]}),(0,s.jsxs)("div",{className:"p-6 space-y-4",children:[(0,s.jsxs)("div",{className:"rounded-lg bg-[#FAF8F4] p-3",children:[(0,s.jsx)("p",{className:"text-[13px] font-medium text-[#2C2C2C]",children:a.title}),a.content&&(0,s.jsx)("p",{className:"mt-1 text-[11px] text-[#6B6B6B] line-clamp-2",children:a.content})]}),O&&(0,s.jsx)("div",{className:"rounded-lg bg-[#E3F2FD] p-3",children:(0,s.jsxs)("p",{className:"text-xs text-[#1976D2]",children:[y("common.currentAssignee"),": ",(0,s.jsx)("span",{className:"font-medium",children:null==(t=a.assignee)?void 0:t.name})]})}),(0,s.jsx)("p",{className:"text-[13px] text-[#6B6B6B]",children:y("ideas.selectIdeaAssignee")}),T?(0,s.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,s.jsx)(o.A,{className:"h-6 w-6 animate-spin text-[#9A9A9A]"})}):(0,s.jsxs)(m.z,{value:S,onValueChange:e=>B(e),className:"space-y-3",children:[(0,s.jsxs)("div",{className:"rounded-[10px] p-4 transition-colors cursor-pointer ".concat("self"===S?"bg-[#FDF8F6] border-2 border-[#C67A52]":"bg-white border border-[#E5E0D8] hover:border-[#C67A52]/50"),onClick:()=>B("self"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,s.jsx)(m.C,{value:"self",id:"idea-self",className:"border-[#C67A52] text-[#C67A52]"}),(0,s.jsx)(x.J,{htmlFor:"idea-self",className:"text-sm font-medium text-[#2C2C2C] cursor-pointer",children:y("assign.assignToMyself")})]}),(0,s.jsx)("p",{className:"mt-2 ml-6 text-xs text-[#6B6B6B] leading-relaxed",children:y("ideas.assignToMyselfIdeaDesc")})]}),(0,s.jsxs)("div",{className:"rounded-[10px] p-4 transition-colors ".concat("agent"===S?"bg-[#FDF8F6] border-2 border-[#C67A52]":"bg-white border border-[#E5E0D8]"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2.5 cursor-pointer",onClick:()=>B("agent"),children:[(0,s.jsx)(m.C,{value:"agent",id:"idea-agent",className:"border-[#C67A52] text-[#C67A52]"}),(0,s.jsx)(x.J,{htmlFor:"idea-agent",className:"text-sm font-medium text-[#2C2C2C] cursor-pointer",children:y("ideas.orAssignToPmAgent")})]}),(0,s.jsx)("p",{className:"mt-2 ml-6 text-xs text-[#6B6B6B] leading-relaxed",children:y("ideas.onlySelectedPmAgentCanWork")}),"agent"===S&&(0,s.jsx)("div",{className:"mt-3 ml-6",children:(0,s.jsxs)(p.l6,{value:E,onValueChange:F,children:[(0,s.jsx)(p.bq,{className:"w-full border-[#E5E0D8]",children:(0,s.jsx)(p.yv,{placeholder:y("ideas.selectPmAgent")})}),(0,s.jsx)(p.gC,{children:z.length>0?z.map(e=>(0,s.jsx)(p.eb,{value:e.uuid,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(d.A,{className:"h-4 w-4 text-[#C67A52]"}),(0,s.jsx)("span",{children:e.name})]})},e.uuid)):(0,s.jsx)("div",{className:"px-3 py-2 text-xs text-[#9A9A9A]",children:y("ideas.noPmAgentsAvailable")})})]})})]}),(0,s.jsxs)("div",{className:"rounded-[10px] p-4 transition-colors ".concat("user"===S?"bg-[#FDF8F6] border-2 border-[#C67A52]":"bg-white border border-[#E5E0D8]"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2.5 cursor-pointer",onClick:()=>B("user"),children:[(0,s.jsx)(m.C,{value:"user",id:"idea-user",className:"border-[#C67A52] text-[#C67A52]"}),(0,s.jsx)(x.J,{htmlFor:"idea-user",className:"text-sm font-medium text-[#2C2C2C] cursor-pointer",children:y("assign.orAssignToUser")})]}),"user"===S&&(0,s.jsx)("div",{className:"mt-3 ml-6",children:(0,s.jsxs)(p.l6,{value:D,onValueChange:R,children:[(0,s.jsx)(p.bq,{className:"w-full border-[#E5E0D8]",children:(0,s.jsx)(p.yv,{placeholder:y("tasks.selectUser")})}),(0,s.jsx)(p.gC,{children:_.length>0?_.map(e=>(0,s.jsx)(p.eb,{value:e.uuid,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(c.A,{className:"h-4 w-4 text-[#6B6B6B]"}),(0,s.jsx)("span",{children:e.name||e.email})]})},e.uuid)):(0,s.jsx)("div",{className:"px-3 py-2 text-xs text-[#9A9A9A]",children:y("tasks.noUsersAvailable")})})]})})]}),O&&(0,s.jsxs)("div",{className:"rounded-[10px] p-4 transition-colors cursor-pointer ".concat("release"===S?"bg-[#FDF8F6] border-2 border-[#C67A52]":"bg-white border border-[#E5E0D8] hover:border-[#C67A52]/50"),onClick:()=>B("release"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,s.jsx)(m.C,{value:"release",id:"idea-release",className:"border-[#C67A52] text-[#C67A52]"}),(0,s.jsx)(x.J,{htmlFor:"idea-release",className:"text-sm font-medium text-[#2C2C2C] cursor-pointer",children:y("assign.releaseAssignee")})]}),(0,s.jsx)("p",{className:"mt-2 ml-6 text-xs text-[#6B6B6B] leading-relaxed",children:y("ideas.releaseIdeaAssigneeDesc")})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-end gap-4 rounded-b-2xl bg-white px-6 py-6 border-t border-[#E5E0D8]",children:[(0,s.jsx)(u.$,{variant:"outline",onClick:N,disabled:C,className:"border-[#E5E0D8]",children:y("common.cancel")}),(0,s.jsx)(u.$,{onClick:M,disabled:C||!q,className:"bg-[#C67A52] hover:bg-[#B56A42] text-white",children:C?(0,s.jsx)(o.A,{className:"h-4 w-4 animate-spin"}):y("release"===S?"common.release":"common.assign")})]})]})]})}},97438:(e,t,a)=>{a.d(t,{Cf:()=>x,Es:()=>p,L3:()=>f,c7:()=>m,lG:()=>o,rr:()=>g,zM:()=>d});var s=a(90508);a(1856);var r=a(9160),n=a(71350),i=a(24377),l=a(22922);function o(e){let{...t}=e;return(0,s.jsx)(n.Root,{"data-slot":"dialog",...t})}function d(e){let{...t}=e;return(0,s.jsx)(n.Trigger,{"data-slot":"dialog-trigger",...t})}function c(e){let{...t}=e;return(0,s.jsx)(n.Portal,{"data-slot":"dialog-portal",...t})}function u(e){let{className:t,...a}=e;return(0,s.jsx)(n.Overlay,{"data-slot":"dialog-overlay",className:(0,i.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function x(e){let{className:t,children:a,showCloseButton:l=!0,...o}=e;return(0,s.jsxs)(c,{"data-slot":"dialog-portal",children:[(0,s.jsx)(u,{}),(0,s.jsxs)(n.Content,{"data-slot":"dialog-content",className:(0,i.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",t),...o,children:[a,l&&(0,s.jsxs)(n.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,s.jsx)(r.A,{}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function m(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"dialog-header",className:(0,i.cn)("flex flex-col gap-2 text-center sm:text-left",t),...a})}function p(e){let{className:t,showCloseButton:a=!1,children:r,...o}=e;return(0,s.jsxs)("div",{"data-slot":"dialog-footer",className:(0,i.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...o,children:[r,a&&(0,s.jsx)(n.Close,{asChild:!0,children:(0,s.jsx)(l.$,{variant:"outline",children:"Close"})})]})}function f(e){let{className:t,...a}=e;return(0,s.jsx)(n.Title,{"data-slot":"dialog-title",className:(0,i.cn)("text-lg leading-none font-semibold",t),...a})}function g(e){let{className:t,...a}=e;return(0,s.jsx)(n.Description,{"data-slot":"dialog-description",className:(0,i.cn)("text-muted-foreground text-sm",t),...a})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[52206],{5810:(e,t,n)=>{n.d(t,{$:()=>U});var r=n(90508),a=n(1856),o=n(39268),s=n(94903),l=n(85226),i=n(95886),c=n(36755),d=n(5425),u=n(22922),m=n(73693),f=n(42242),p=n(85783),x=n(99783),h=n(24377),g=n(42305);let v=x.A.extend({addAttributes(){var e;return{...null==(e=this.parent)?void 0:e.call(this),mentionType:{default:"user",parseHTML:e=>e.getAttribute("data-mention-type")||"user",renderHTML:e=>({"data-mention-type":e.mentionType||"user"})}}}});function y(e){let t=e.getJSON();return t.content?t.content.map(e=>(function e(t){if("mention"===t.type){let e=t.attrs;return e?"@[".concat(e.label||e.id,"](").concat(e.mentionType||"user",":").concat(e.id,")"):""}if("text"===t.type)return t.text||"";if("hardBreak"===t.type)return"\n";let n=t.content;return n?n.map(e).join(""):""})(e)).join("\n"):""}function b(e){if(!e)return{type:"doc",content:[{type:"paragraph"}]};let t=/@\[([^\]]+)\]\((user|agent):([a-f0-9-]+)\)/g;return{type:"doc",content:e.split("\n").map(e=>{let n,r=[],a=0,o=RegExp(t.source,"g");for(;null!==(n=o.exec(e));)n.index>a&&r.push({type:"text",text:e.slice(a,n.index)}),r.push({type:"mention",attrs:{id:n[3],label:n[1],mentionType:n[2]}}),a=n.index+n[0].length;return a<e.length&&r.push({type:"text",text:e.slice(a)}),{type:"paragraph",content:r.length>0?r:void 0}})}}function w(e,t,n,r,a){if(a.innerHTML="",t){let e=document.createElement("div");e.className="flex items-center justify-center py-3 px-4",e.innerHTML='<div class="h-4 w-4 animate-spin rounded-full border-2 border-[#9A9A9A] border-t-transparent"></div>',a.appendChild(e);return}if(0===e.length){let e=document.createElement("div");e.className="py-2 px-3 text-xs text-[#9A9A9A]",e.textContent="No results",a.appendChild(e);return}let o=document.createElement("div");o.className="py-1";let s=0,l=e=>{n({id:e.uuid,label:e.name,mentionType:e.type})},i=()=>{o.innerHTML="",e.forEach((e,t)=>{let n=document.createElement("button");n.type="button",n.className="flex w-full items-center gap-2.5 px-3 py-1.5 text-left text-sm transition-colors ".concat(t===s?"bg-[#FAF8F4] text-[#2C2C2C]":"text-[#6B6B6B] hover:bg-[#FAF8F4]"),n.onclick=()=>l(e);let r=document.createElement("div");r.className="flex h-6 w-6 shrink-0 items-center justify-center rounded-full ".concat("agent"===e.type?"bg-[#C67A52] text-white":"bg-[#E5E0D8] text-[#6B6B6B]"),r.innerHTML="agent"===e.type?'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 8V4H8"/><rect width="16" height="12" x="4" y="8" rx="2"/><path d="M2 14h2"/><path d="M20 14h2"/><path d="M15 13v2"/><path d="M9 13v2"/></svg>':'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>';let a=document.createElement("div");a.className="min-w-0 flex-1";let i=document.createElement("div");if(i.className="truncate text-xs font-medium",i.textContent=e.name,a.appendChild(i),e.email){let t=document.createElement("div");t.className="truncate text-[10px] text-[#9A9A9A]",t.textContent=e.email,a.appendChild(t)}if("agent"===e.type&&e.roles&&e.roles.length>0){let t=document.createElement("div");t.className="truncate text-[10px] text-[#9A9A9A]",t.textContent=e.roles.join(", "),a.appendChild(t)}n.appendChild(r),n.appendChild(a),o.appendChild(n)})};i(),a.appendChild(o),r.current={onKeyDown:t=>{let{event:n}=t;return!(0,g.P)(n)&&("ArrowUp"===n.key?(s=s<=0?e.length-1:s-1,i(),!0):"ArrowDown"===n.key?(s=s>=e.length-1?0:s+1,i(),!0):"Enter"===n.key?(e[s]&&l(e[s]),!0):"Escape"===n.key)}}}let j=(0,a.forwardRef)((e,t)=>{let{value:n,onChange:o,placeholder:s,className:l,disabled:i,onSubmit:c}=e,d=(0,a.useRef)([]),u=(0,a.useRef)(!1),m=(0,a.useRef)(null),x=(0,a.useRef)(null),j=(0,a.useRef)(null),N=(0,a.useRef)(null),[,E]=(0,a.useState)(0),C=(0,a.useRef)(!1),A=function(e,t){let n=(0,a.useRef)(null),r=(0,a.useRef)(e);r.current=e;let o=(0,a.useCallback)(e=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>r.current(e),250)},[250]);return(0,a.useEffect)(()=>()=>{n.current&&clearTimeout(n.current)},[]),o}((0,a.useCallback)(async e=>{u.current=!0,E(e=>e+1);try{let t=await fetch("/api/mentionables?q=".concat(encodeURIComponent(e),"&limit=10"));if(t.ok){let e=await t.json();e.success&&(d.current=e.data)}}catch(e){d.current=[]}finally{u.current=!1,E(e=>e+1)}},[]),250);(0,a.useEffect)(()=>{j.current&&N.current&&w(d.current,u.current,N.current,m,j.current)});let k=(0,f.hG)({immediatelyRender:!1,extensions:[p.A.configure({heading:!1,blockquote:!1,codeBlock:!1,bulletList:!1,orderedList:!1,listItem:!1,horizontalRule:!1}),v.configure({HTMLAttributes:{class:"text-blue-600 font-medium"},renderText(e){var t;let{node:n}=e;return"@".concat(null!=(t=n.attrs.label)?t:n.attrs.id)},suggestion:{char:"@",allowSpaces:!0,items:e=>{let{query:t}=e;return A(t),d.current},render:()=>({onStart:e=>{var t;let n=document.createElement("div");if(n.className="z-[100] rounded-md border border-[#E5E0D8] bg-white shadow-md min-w-[200px] max-w-[300px] overflow-hidden",j.current=n,N.current=e.command,e.clientRect){let t="function"==typeof e.clientRect?e.clientRect():e.clientRect;t&&(n.style.position="fixed",n.style.left="".concat(t.left,"px"),window.innerHeight-t.bottom<220?n.style.bottom="".concat(window.innerHeight-t.top+4,"px"):n.style.top="".concat(t.bottom+4,"px"))}(null!=(t=x.current)?t:document.body).appendChild(n),w(d.current,u.current,e.command,m,n)},onUpdate:e=>{if(N.current=e.command,j.current&&e.clientRect){let t="function"==typeof e.clientRect?e.clientRect():e.clientRect;t&&(j.current.style.left="".concat(t.left,"px"),window.innerHeight-t.bottom<220?(j.current.style.top="",j.current.style.bottom="".concat(window.innerHeight-t.top+4,"px")):(j.current.style.bottom="",j.current.style.top="".concat(t.bottom+4,"px")))}j.current&&w(d.current,u.current,e.command,m,j.current)},onKeyDown:e=>!!m.current&&m.current.onKeyDown(e),onExit:()=>{var e;null==(e=j.current)||e.remove(),j.current=null,N.current=null,d.current=[],u.current=!1}})}})],content:b(n),editable:!i,editorProps:{attributes:{class:(0,h.cn)("min-h-[36px] max-h-[120px] overflow-y-auto px-3 py-2 text-sm outline-none","prose prose-sm max-w-none [&_p]:my-0"),"data-placeholder":s||""},handleKeyDown:(e,t)=>!(0,g.P)(t)&&"Enter"===t.key&&!t.shiftKey&&!j.current&&!!c&&(t.preventDefault(),c(),!0)},onUpdate:e=>{let{editor:t}=e;C.current=!0,o(y(t))}});return(0,a.useEffect)(()=>{if(!k||C.current){C.current=!1;return}y(k)!==n&&k.commands.setContent(b(n))},[n,k]),(0,a.useEffect)(()=>{k&&k.setEditable(!i)},[i,k]),(0,a.useImperativeHandle)(t,()=>({focus:()=>null==k?void 0:k.commands.focus(),clear:()=>{null==k||k.commands.clearContent(),o("")}})),(0,r.jsxs)("div",{ref:x,className:(0,h.cn)("relative rounded-md border border-input bg-transparent shadow-xs transition-[color,box-shadow]","focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]",i&&"cursor-not-allowed opacity-50",l),children:[(0,r.jsx)(f.$Z,{editor:k}),(0,r.jsx)("style",{children:"\n .tiptap p.is-editor-empty:first-child::before {\n content: attr(data-placeholder);\n color: #9A9A9A;\n float: left;\n height: 0;\n pointer-events: none;\n }\n .tiptap .mention {\n color: #2563eb;\n font-weight: 500;\n }\n "})]})});j.displayName="MentionEditor";var N=n(75024),E=n(52217);let C=(0,E.createServerReference)("7030e5bddb8203c1a4309d65deac0510675de0ade6",E.callServer,void 0,E.findSourceMapURL,"createCommentAction");var A=n(97261);let k=/@\[([^\]]+)\]\((user|agent):([a-f0-9-]+)\)/g,T=/\u200B\u200BMENTION_(\d+)\u200B\u200B/g;function z(e){let{children:t}=e;if(!t||"string"!=typeof t)return null;if(!new RegExp(k.source).test(t))return(0,r.jsx)("div",{className:"overflow-hidden [&_pre]:overflow-x-auto",children:(0,r.jsx)(A.MarkdownContent,{children:t})});let{processed:n,mentions:a}=function(e){let t=[],n=RegExp(k.source,"g");return{processed:e.replace(n,(e,n,r,a)=>{let o=t.length;return t.push({displayName:n,type:r,uuid:a}),"".concat("​​MENTION_").concat(o).concat("​​")}),mentions:t}}(t);return(0,r.jsx)(R,{mentions:a,children:(0,r.jsx)(A.MarkdownContent,{children:n})})}function R(e){let{children:t,mentions:n}=e,o=a.useRef(null);return a.useEffect(()=>{let e;if(!o.current||0===n.length)return;let t=document.createTreeWalker(o.current,NodeFilter.SHOW_TEXT,null),r=[];for(;e=t.nextNode();)T.test(e.textContent||"")&&r.push(e),T.lastIndex=0;for(let e of r){var a;let t,r=e.textContent||"",o=document.createDocumentFragment(),s=0,l=RegExp(T.source,"g");for(;null!==(t=l.exec(r));){t.index>s&&o.appendChild(document.createTextNode(r.slice(s,t.index)));let e=n[parseInt(t[1],10)];if(e){let t=document.createElement("span");t.className="text-blue-600 font-medium",t.title="".concat(e.type,": ").concat(e.uuid),t.textContent="@".concat(e.displayName),o.appendChild(t)}else o.appendChild(document.createTextNode(t[0]));s=t.index+t[0].length}s<r.length&&o.appendChild(document.createTextNode(r.slice(s))),null==(a=e.parentNode)||a.replaceChild(o,e)}},[n]),(0,r.jsx)("div",{ref:o,className:"overflow-hidden [&_pre]:overflow-x-auto",children:t})}var S=n(63964),_=n(96213),D=n(30423),M=n(38106),B=n(67587);function U(e){let{targetType:t,targetUuid:n,currentUserUuid:d,onCountChange:f,compact:p=!1}=e,x=(0,o.c)(),[h,g]=(0,a.useState)(""),[v,y]=(0,a.useState)([]),[b,w]=(0,a.useState)(!0),[E,A]=(0,a.useState)(null),[k,T]=(0,a.useState)(!1),z=(0,a.useRef)(null),R=p?"h-6 w-6":"h-[30px] w-[30px]",D=p?"gap-2":"gap-2.5",M=p?"h-3 w-3":"h-[15px] w-[15px]";(0,a.useEffect)(()=>{null==f||f(v.length)},[v.length,f]);let U=(0,a.useCallback)(async()=>{w(!0),A(null);let e=await (0,N.d)(t,n);e.success?y(e.comments):A(e.error),w(!1)},[t,n]);(0,a.useEffect)(()=>{U()},[U]),(0,S.w0)(t,n,e=>{d&&e.actorUuid===d||(0,N.d)(t,n).then(e=>{e.success&&y(e.comments)})});let L=async()=>{if(!h.trim()||k)return;T(!0);let e=await C(t,n,h);if(T(!1),e.success){var r;y(t=>[...t,e.comment]),g(""),null==(r=z.current)||r.clear()}else B.oR.error(e.error)},H=[...v].reverse();return(0,r.jsx)(_.D,{entityType:t,entityUuid:n,subEntityType:"comment",children:(0,r.jsxs)("div",{className:"flex flex-col gap-0",children:[(0,r.jsxs)("div",{className:"flex items-center ".concat(D," pb-3 border-b border-[#F0EDE8]"),children:[(0,r.jsx)(m.eu,{className:"".concat(p?"h-6 w-6":"h-7 w-7"," shrink-0"),children:(0,r.jsx)(m.q5,{className:"bg-[#E5E0D8] text-[#6B6B6B]",children:(0,r.jsx)(s.A,{className:"".concat(p?"h-3 w-3":"h-3.5 w-3.5")})})}),(0,r.jsx)("div",{className:"flex-1 min-w-0",children:(0,r.jsx)(j,{ref:z,value:h,onChange:g,onSubmit:L,placeholder:x("comments.addComment"),className:"border border-[#E5E0D8] bg-white text-sm rounded-lg",disabled:k})}),(0,r.jsx)(u.$,{size:"sm",className:"shrink-0 gap-1 bg-[#E07A5F] text-white hover:bg-[#D06A4F]",disabled:!h.trim()||k,onClick:L,children:k?(0,r.jsx)(l.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(i.A,{className:"h-3.5 w-3.5"})})]}),(0,r.jsx)("div",{children:b?(0,r.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,r.jsx)(l.A,{className:"h-4 w-4 animate-spin text-[#9A9A9A]"})}):E?(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 py-8 text-sm text-[#9A9A9A]",children:[(0,r.jsx)(c.A,{className:"h-4 w-4"}),(0,r.jsx)("p",{children:x("comments.loadError")}),(0,r.jsx)(u.$,{variant:"outline",size:"sm",onClick:U,children:x("comments.retry")})]}):0===H.length?(0,r.jsx)("p",{className:"py-8 text-center text-sm text-[#9A9A9A] italic",children:x("comments.noComments")}):H.map(e=>(0,r.jsx)(F,{comment:e,compact:p,avatarSize:R,gap:D,iconSize:M,t:x},e.uuid))})]})})}function F(e){let{comment:t,compact:n,avatarSize:o,gap:s,iconSize:l,t:i}=e,[c,f]=(0,a.useState)(!1),p="agent"===t.author.type,x=p?(0,D.j)(t.author.name):null,h=t.content.length>200,g=x?"".concat(x,"18"):void 0;return(0,r.jsxs)("div",{className:"flex ".concat(s," py-3 border-b border-[#F0EDE8] last:border-b-0"),children:[(0,r.jsx)(m.eu,{className:"".concat(o," shrink-0"),children:(0,r.jsx)(m.q5,{style:p?{backgroundColor:g,color:null!=x?x:void 0}:void 0,className:p?"":"bg-[#E5E0D8] text-[#6B6B6B] text-[11px] font-medium",children:p?(0,r.jsx)(d.A,{className:l}):t.author.name.charAt(0).toUpperCase()})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[(0,r.jsx)("span",{className:"".concat(n?"text-xs":"text-[13px]"," font-semibold text-[#1A1A1A]"),children:t.author.name}),(0,r.jsx)("span",{style:p?{backgroundColor:g,color:null!=x?x:void 0}:void 0,className:"inline-flex items-center rounded px-1.5 py-px text-[9px] font-medium ".concat(p?"":"bg-[#F0EDE8] text-[#6B6B6B]"),children:i(p?"comments.roleAgent":"comments.roleHuman")}),(0,r.jsx)("span",{className:"text-[11px] text-[#BFBFBF]",children:function(e,t){let n=new Date(e),r=new Date().getTime()-n.getTime(),a=Math.floor(r/6e4),o=Math.floor(r/36e5),s=Math.floor(r/864e5);return a<1?t("time.justNow"):a<60?t("time.minutesAgo",{minutes:a}):o<24?t("time.hoursAgo",{hours:o}):s<7?t("time.daysAgo",{days:s}):(0,M.r)(n)}(t.createdAt,i)})]}),p&&t.author.owner&&(0,r.jsx)("div",{className:"flex items-center gap-1 mt-0.5",children:(0,r.jsx)("span",{className:"text-[11px] text-[#A3A3A3] italic",children:i("comments.onBehalfOf",{name:t.author.owner.name})})}),(0,r.jsx)("div",{className:"mt-1 ".concat(n?"text-xs":"text-[13px]"," leading-relaxed text-[#3D3D3D] max-w-none [&_h1]:text-sm [&_h1]:font-semibold [&_h1]:mt-2 [&_h1]:mb-1 [&_h2]:text-[13px] [&_h2]:font-semibold [&_h2]:mt-2 [&_h2]:mb-1 [&_h3]:text-[13px] [&_h3]:font-semibold [&_h3]:mt-1.5 [&_h3]:mb-0.5 [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1 [&_li]:my-0.5"),children:h&&!c?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z,{children:t.content.slice(0,200)+"..."}),(0,r.jsx)(u.$,{variant:"link",size:"sm",onClick:()=>f(!0),className:"h-auto p-0 text-[#E07A5F] text-xs font-medium mt-1",children:i("comments.showMore")})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z,{children:t.content}),h&&(0,r.jsx)(u.$,{variant:"link",size:"sm",onClick:()=>f(!1),className:"h-auto p-0 text-[#E07A5F] text-xs font-medium mt-1",children:i("comments.showLess")})]})})]})]})}},22922:(e,t,n)=>{n.d(t,{$:()=>i});var r=n(90508);n(1856);var a=n(49499),o=n(54154),s=n(24377);let l=(0,a.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium cursor-pointer transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function i(e){let{className:t,variant:n="default",size:a="default",asChild:i=!1,...c}=e,d=i?o.bL:"button";return(0,r.jsx)(d,{"data-slot":"button","data-variant":n,"data-size":a,className:(0,s.cn)(l({variant:n,size:a,className:t})),...c})}},24377:(e,t,n)=>{n.d(t,{cn:()=>o});var r=n(49251),a=n(58849);function o(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,a.QP)((0,r.$)(t))}},30423:(e,t,n)=>{n.d(t,{j:()=>a});let r=["#E06C75","#E5C07B","#98C379","#56B6C2","#61AFEF","#C678DD","#D19A66","#BE5046","#7EC8E3","#C3E88D","#F78C6C","#A9DC76"];function a(e){let t=function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Math.abs(t)}(e)%r.length;return r[t]}},38106:(e,t,n)=>{function r(e){let t="string"==typeof e?new Date(e):e;if(isNaN(t.getTime()))return"";let n=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0"),o=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0");return"".concat(n,"-").concat(r,"-").concat(a," ").concat(o,":").concat(s)}function a(e,t){let n="string"==typeof e?new Date(e):e;return isNaN(n.getTime())?"":n.toLocaleDateString(t,{month:"short",day:"numeric"})}n.d(t,{r:()=>r,s:()=>a})},42305:(e,t,n)=>{n.d(t,{P:()=>r});function r(e){return("nativeEvent"in e?e.nativeEvent:e).isComposing||229===e.keyCode}},47754:(e,t,n)=>{n.d(t,{fv:()=>x,xQ:()=>h});var r=n(1856),a=n(63964);let o=new Map,s=new Map,l=new Map,i=new Set,c=0;function d(e,t,n,r){return n?r?"".concat(e,":").concat(t,":").concat(n,":").concat(r):"".concat(e,":").concat(t,":").concat(n):"".concat(e,":").concat(t)}function u(){c++,i.forEach(e=>e())}function m(e){var t;let n=e.subEntityType,r=e.subEntityUuid,a=d(e.entityType,e.entityUuid,n,r),i=function(e,t,n,r,a){let o=d(e,t,r,a);return"".concat(o,":").concat(n)}(e.entityType,e.entityUuid,e.agentUuid,n,r),c=s.get(i);if(c&&Date.now()-c<3e3)return;s.set(i,Date.now());let m={agentUuid:e.agentUuid,agentName:e.agentName,action:e.action,timestamp:Date.now()},f=(null!=(t=o.get(a))?t:[]).filter(t=>t.agentUuid!==e.agentUuid);f.push(m),o.set(a,f);let p=l.get(i);p&&clearTimeout(p);let x=setTimeout(()=>{let t=o.get(a);if(t){let n=t.filter(t=>t.agentUuid!==e.agentUuid);0===n.length?o.delete(a):o.set(a,n)}s.delete(i),l.delete(i),u()},3e3);l.set(i,x),u()}function f(){return c}function p(e){return i.add(e),()=>{i.delete(e)}}function x(e){m({type:"presence",companyUuid:"",projectUuid:"",...e,timestamp:Date.now()})}function h(){return(0,r.useSyncExternalStore)(p,f,f),(0,a.S2)(m),{getPresence:(e,t,n,r)=>{if(n){var a;return null!=(a=o.get(d(e,t,n,r)))?a:[]}let s="".concat(e,":").concat(t),l=new Map;for(let[e,t]of o)if(e===s||e.startsWith(s+":"))for(let e of t){let t=l.get(e.agentUuid);(!t||e.timestamp>t.timestamp)&&l.set(e.agentUuid,e)}return[...l.values()]}}}},48416:(e,t,n)=>{n.d(t,{BT:()=>i,Wu:()=>d,X9:()=>c,ZB:()=>l,Zp:()=>o,aR:()=>s,wL:()=>u});var r=n(90508);n(1856);var a=n(24377);function o(e){let{className:t,...n}=e;return(0,r.jsx)("div",{"data-slot":"card",className:(0,a.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...n})}function s(e){let{className:t,...n}=e;return(0,r.jsx)("div",{"data-slot":"card-header",className:(0,a.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...n})}function l(e){let{className:t,...n}=e;return(0,r.jsx)("div",{"data-slot":"card-title",className:(0,a.cn)("leading-none font-semibold",t),...n})}function i(e){let{className:t,...n}=e;return(0,r.jsx)("div",{"data-slot":"card-description",className:(0,a.cn)("text-muted-foreground text-sm",t),...n})}function c(e){let{className:t,...n}=e;return(0,r.jsx)("div",{"data-slot":"card-action",className:(0,a.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",t),...n})}function d(e){let{className:t,...n}=e;return(0,r.jsx)("div",{"data-slot":"card-content",className:(0,a.cn)("px-6",t),...n})}function u(e){let{className:t,...n}=e;return(0,r.jsx)("div",{"data-slot":"card-footer",className:(0,a.cn)("flex items-center px-6 [.border-t]:pt-6",t),...n})}},51817:(e,t,n)=>{n.d(t,{$v:()=>x,EO:()=>u,Lt:()=>l,Rx:()=>h,Zr:()=>g,ck:()=>f,r7:()=>p,tv:()=>i,wd:()=>m});var r=n(90508);n(1856);var a=n(90299),o=n(24377),s=n(22922);function l(e){let{...t}=e;return(0,r.jsx)(a.Root,{"data-slot":"alert-dialog",...t})}function i(e){let{...t}=e;return(0,r.jsx)(a.Trigger,{"data-slot":"alert-dialog-trigger",...t})}function c(e){let{...t}=e;return(0,r.jsx)(a.Portal,{"data-slot":"alert-dialog-portal",...t})}function d(e){let{className:t,...n}=e;return(0,r.jsx)(a.Overlay,{"data-slot":"alert-dialog-overlay",className:(0,o.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...n})}function u(e){let{className:t,size:n="default",...s}=e;return(0,r.jsxs)(c,{children:[(0,r.jsx)(d,{}),(0,r.jsx)(a.Content,{"data-slot":"alert-dialog-content","data-size":n,className:(0,o.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg",t),...s})]})}function m(e){let{className:t,...n}=e;return(0,r.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,o.cn)("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",t),...n})}function f(e){let{className:t,...n}=e;return(0,r.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,o.cn)("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",t),...n})}function p(e){let{className:t,...n}=e;return(0,r.jsx)(a.Title,{"data-slot":"alert-dialog-title",className:(0,o.cn)("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",t),...n})}function x(e){let{className:t,...n}=e;return(0,r.jsx)(a.Description,{"data-slot":"alert-dialog-description",className:(0,o.cn)("text-muted-foreground text-sm",t),...n})}function h(e){let{className:t,variant:n="default",size:l="default",...i}=e;return(0,r.jsx)(s.$,{variant:n,size:l,asChild:!0,children:(0,r.jsx)(a.Action,{"data-slot":"alert-dialog-action",className:(0,o.cn)(t),...i})})}function g(e){let{className:t,variant:n="outline",size:l="default",...i}=e;return(0,r.jsx)(s.$,{variant:n,size:l,asChild:!0,children:(0,r.jsx)(a.Cancel,{"data-slot":"alert-dialog-cancel",className:(0,o.cn)(t),...i})})}},63964:(e,t,n)=>{n.d(t,{S2:()=>c,eV:()=>i,l9:()=>l,tS:()=>s,w0:()=>d});var r=n(90508),a=n(1856);n(23675);let o=(0,a.createContext)(null);function s(e){let{projectUuid:t,children:n}=e,s=(0,a.useRef)(new Set),l=(0,a.useRef)(new Set),i=(0,a.useRef)(new Set),c=(0,a.useCallback)(()=>{s.current.forEach(e=>e())},[]),d=(0,a.useCallback)(e=>{l.current.forEach(t=>t(e))},[]);(0,a.useEffect)(()=>{let e,n=null,r=0,a={};function o(){s(),(n=new EventSource(t?"/api/events?projectUuid=".concat(t):"/api/events")).onmessage=t=>{let n=null;try{n=JSON.parse(t.data)}catch(e){return}if(!n)return;if("presence"===n.type)return void i.current.forEach(e=>e(n));let o=n;clearTimeout(e);let s=Date.now(),l=s-r;l>=3e3?(r=s,c()):e=setTimeout(()=>{r=Date.now(),c()},Math.max(1e3,3e3-l));let u=o.entityType;clearTimeout(a[u]),a[u]=setTimeout(()=>{d(o)},300)},n.onerror=()=>{}}function s(){n&&(n.close(),n=null)}function l(){if("visible"===document.visibilityState&&(!n||n.readyState===EventSource.CLOSED))for(let e of(o(),c(),["task","idea","proposal","document","project","project_group"]))d({companyUuid:"",projectUuid:"",entityType:e,entityUuid:"",action:"updated"})}return o(),document.addEventListener("visibilitychange",l),()=>{for(let t in s(),clearTimeout(e),a)clearTimeout(a[t]);document.removeEventListener("visibilitychange",l)}},[t,c,d]);let u=(0,a.useCallback)(e=>(s.current.add(e),()=>{s.current.delete(e)}),[]),m=(0,a.useCallback)(e=>(l.current.add(e),()=>{l.current.delete(e)}),[]),f=(0,a.useCallback)(e=>(i.current.add(e),()=>{i.current.delete(e)}),[]),p=(0,a.useMemo)(()=>({subscribe:u,subscribeEntity:m,subscribePresence:f}),[u,m,f]);return(0,r.jsx)(o.Provider,{value:p,children:n})}function l(e){let t=(0,a.useContext)(o),n=(0,a.useRef)(e);n.current=e,(0,a.useEffect)(()=>{if(!t)return;let e=()=>n.current();return e(),t.subscribe(e)},[t])}function i(e,t){let n=(0,a.useContext)(o),r=(0,a.useRef)(t);r.current=t;let s=(0,a.useRef)(e);s.current=e,(0,a.useEffect)(()=>{if(n)return n.subscribeEntity(e=>{let t=s.current;(Array.isArray(t)?t.includes(e.entityType):e.entityType===t)&&r.current(e)})},[n])}function c(e){let t=(0,a.useContext)(o),n=(0,a.useRef)(e);n.current=e,(0,a.useEffect)(()=>{if(t)return t.subscribePresence(e=>n.current(e))},[t])}function d(e,t,n){let r=(0,a.useContext)(o),s=(0,a.useRef)(n);s.current=n,(0,a.useEffect)(()=>{if(r)return r.subscribeEntity(n=>{n.entityType===e&&n.entityUuid===t&&s.current(n)})},[r,e,t])}},67712:(e,t,n)=>{n.d(t,{q:()=>l});var r=n(55036);let a={debug:0,info:1,warn:2,error:3},o=r.env.NEXT_PUBLIC_LOG_LEVEL||"warn";function s(e){return a[e]>=a[o]}let l={debug:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];s("debug")&&console.debug("[Chorus] ".concat(e),...n)},info:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];s("info")&&console.info("[Chorus] ".concat(e),...n)},warn:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];s("warn")&&console.warn("[Chorus] ".concat(e),...n)},error:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];s("error")&&console.error("[Chorus] ".concat(e),...n)}}},73693:(e,t,n)=>{n.d(t,{eu:()=>s,q5:()=>l});var r=n(90508);n(1856);var a=n(65514),o=n(24377);function s(e){let{className:t,size:n="default",...s}=e;return(0,r.jsx)(a.Root,{"data-slot":"avatar","data-size":n,className:(0,o.cn)("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",t),...s})}function l(e){let{className:t,...n}=e;return(0,r.jsx)(a.Fallback,{"data-slot":"avatar-fallback",className:(0,o.cn)("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",t),...n})}},75024:(e,t,n)=>{n.d(t,{d:()=>a});var r=n(52217);let a=(0,r.createServerReference)("60f6e47a0c3981cac67a3f6ce39eb2c02aa9566f71",r.callServer,void 0,r.findSourceMapURL,"getCommentsAction")},96213:(e,t,n)=>{n.d(t,{D:()=>l});var r=n(90508),a=n(47754),o=n(30423),s=n(5425);function l(e){let{entityType:t,entityUuid:n,subEntityType:s,subEntityUuid:l,children:c,badgeInside:d}=e,{getPresence:u}=(0,a.xQ)(),m=u(t,n,s,l),f=m.length>0,p=f&&m.some(e=>"mutate"===e.action),x=f?p?m.find(e=>"mutate"===e.action):m[m.length-1]:null,h=x?(0,o.j)(x.agentName):"transparent";return(0,r.jsxs)("div",{className:"relative",style:f?{outline:"2px ".concat(p?"solid":"dashed"," ").concat(h),outlineOffset:"-2px",borderRadius:"var(--radius)"}:void 0,children:[f&&(0,r.jsxs)("div",{className:"absolute flex gap-1 z-10 justify-end ".concat(d?"top-0.5 right-1.5 max-w-[70%]":"-top-2.5 right-2 max-w-[80%]"),children:[m.slice(0,3).map(e=>(0,r.jsx)(i,{entry:e},e.agentUuid)),m.length>3&&(0,r.jsxs)("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-medium text-white bg-gray-500 whitespace-nowrap",children:["+",m.length-3]})]}),c]})}function i(e){let{entry:t}=e,n=(0,o.j)(t.agentName);return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-[10px] font-medium text-white whitespace-nowrap animate-in fade-in duration-300 ease-out sm:text-[11px] sm:px-2",style:{backgroundColor:n},children:[(0,r.jsx)(s.A,{className:"h-2.5 w-2.5"}),t.agentName]})}},97261:(e,t,n)=>{n.d(t,{MarkdownContent:()=>d});var r=n(90508),a=n(1856),o=n(65700),s=n(19169),l=n(26190);let i={code:s.a,mermaid:l.a},c={mermaid:{fullscreen:!0,download:!0,copy:!0,panZoom:!0}};function d(e){let{children:t}=e,n=function(){let[e,t]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=document.documentElement,n=()=>t(e.classList.contains("dark"));n();let r=new MutationObserver(n);return r.observe(e,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},[]),e}(),s=(0,a.useMemo)(()=>({config:{theme:n?"dark":"default"}}),[n]);return(0,r.jsx)(o.jH,{plugins:i,controls:c,mermaid:s,children:t},n?"dark":"light")}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[60011],{4365:(e,t,s)=>{"use strict";s.d(t,{G7:()=>o,L$:()=>u,h_:()=>x,oI:()=>d,uB:()=>l,xL:()=>c});var a=s(90508);s(1856);var r=s(64731),n=s(30044),i=s(24377);function l(e){let{className:t,...s}=e;return(0,a.jsx)(r.uB,{"data-slot":"command",className:(0,i.cn)("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...s})}function o(e){let{className:t,...s}=e;return(0,a.jsxs)("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[(0,a.jsx)(n.A,{className:"size-4 shrink-0 opacity-50"}),(0,a.jsx)(r.uB.Input,{"data-slot":"command-input",className:(0,i.cn)("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...s})]})}function d(e){let{className:t,...s}=e;return(0,a.jsx)(r.uB.List,{"data-slot":"command-list",className:(0,i.cn)("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),...s})}function c(e){let{...t}=e;return(0,a.jsx)(r.uB.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t})}function u(e){let{className:t,...s}=e;return(0,a.jsx)(r.uB.Group,{"data-slot":"command-group",className:(0,i.cn)("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...s})}function x(e){let{className:t,...s}=e;return(0,a.jsx)(r.uB.Item,{"data-slot":"command-item",className:(0,i.cn)("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t),...s})}},14554:(e,t,s)=>{"use strict";s.d(t,{p:()=>n});var a=s(90508);s(1856);var r=s(24377);function n(e){let{className:t,type:s,...n}=e;return(0,a.jsx)("input",{type:s,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...n})}},15972:(e,t,s)=>{"use strict";s.d(t,{T:()=>n});var a=s(90508);s(1856);var r=s(24377);function n(e){let{className:t,...s}=e;return(0,a.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...s})}},17001:(e,t,s)=>{"use strict";s.d(t,{AM:()=>i,Wv:()=>l,hl:()=>o});var a=s(90508);s(1856);var r=s(79919),n=s(24377);function i(e){let{...t}=e;return(0,a.jsx)(r.Root,{"data-slot":"popover",...t})}function l(e){let{...t}=e;return(0,a.jsx)(r.Trigger,{"data-slot":"popover-trigger",...t})}function o(e){let{className:t,align:s="center",sideOffset:i=4,...l}=e;return(0,a.jsx)(r.Portal,{children:(0,a.jsx)(r.Content,{"data-slot":"popover-content",align:s,sideOffset:i,className:(0,n.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...l})})}},18670:(e,t,s)=>{"use strict";s.d(t,{TaskViewToggle:()=>eo});var a=s(90508),r=s(1856),n=s(23675),i=s(39268),l=s(83064),o=s(18789),d=s(76111),c=s(5616),u=s(22922),x=s(57731),p=s(48416),m=s(62205),g=s(81531),f=s(56770),h=s(30825),b=s(60532),v=s(9160),j=s(24377),y=s(17001),w=s(4365);function N(e){let{projectUuid:t}=e,s=(0,i.c)("tasks"),l=(0,n.useRouter)(),o=(0,n.usePathname)(),d=(0,n.useSearchParams)(),[c,p]=(0,r.useState)(!1),[m,g]=(0,r.useState)([]),[N,k]=(0,r.useState)(new Set);(0,r.useEffect)(()=>{let e=d.get("proposalUuids");e?k(new Set(e.split(",").filter(Boolean))):k(new Set)},[d]),(0,r.useEffect)(()=>{let e=!1;return async function(){try{let s=await fetch("/api/projects/".concat(t,"/proposals/summary"));if(!s.ok)return;let a=await s.json();!e&&a.success&&g(a.data)}catch(e){}}(),()=>{e=!0}},[t]);let C=(0,r.useCallback)(e=>{let t=new URLSearchParams(d.toString());e.size>0?t.set("proposalUuids",Array.from(e).join(",")):t.delete("proposalUuids");let s=t.toString();l.replace("".concat(o).concat(s?"?".concat(s):""),{scroll:!1})},[l,o,d]),F=(0,r.useCallback)(e=>{k(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),C(s),s})},[C]),A=(0,r.useCallback)(()=>{k(new Set),C(new Set)},[C]),E=N.size>0;return(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-sm text-muted-foreground shrink-0",children:[(0,a.jsx)(f.A,{className:"size-4"}),(0,a.jsxs)("span",{children:[s("proposalFilter.label"),":"]})]}),(0,a.jsxs)(y.AM,{open:c,onOpenChange:p,children:[(0,a.jsx)(y.Wv,{asChild:!0,children:(0,a.jsxs)(u.$,{variant:"outline",size:"sm",role:"combobox","aria-expanded":c,className:(0,j.cn)("justify-between gap-1 min-w-[120px] max-w-[200px] md:min-w-[160px] md:max-w-none",E&&"border-[#C67A52] bg-[#FFF8F4]"),children:[(0,a.jsx)("span",{className:"truncate",children:E?s("proposalFilter.filtered",{filtered:N.size,total:m.length}):s("proposalFilter.allProposals")}),(0,a.jsx)(h.A,{className:"size-4 shrink-0 opacity-50"})]})}),(0,a.jsx)(y.hl,{className:"w-[300px] p-0",align:"start",children:(0,a.jsxs)(w.uB,{children:[(0,a.jsx)(w.G7,{placeholder:s("proposalFilter.search")}),(0,a.jsxs)(w.oI,{children:[(0,a.jsx)(w.xL,{children:s("proposalFilter.noResults")}),(0,a.jsx)(w.L$,{children:m.map(e=>{let t=N.has(e.uuid);return(0,a.jsxs)(w.h_,{value:e.title,onSelect:()=>F(e.uuid),className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)("div",{className:(0,j.cn)("flex size-4 shrink-0 items-center justify-center rounded-sm border",t?"border-[#C67A52] bg-[#C67A52] text-white":"border-muted-foreground/30"),children:t&&(0,a.jsx)(b.A,{className:"size-3"})}),(0,a.jsx)("span",{className:"truncate",children:e.title})]}),(0,a.jsx)(x.E,{variant:"secondary",className:"ml-2 shrink-0",children:s("proposalFilter.taskCount",{count:e.taskCount})})]},e.uuid)})})]})]})})]}),E&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex flex-wrap gap-1 max-w-full",children:m.filter(e=>N.has(e.uuid)).map(e=>(0,a.jsxs)(x.E,{variant:"outline",className:"gap-1 border-[#C67A52] bg-[#FFF8F4] text-[#C67A52]",children:[e.title,(0,a.jsx)("button",{type:"button",className:"ml-0.5 rounded-full hover:bg-[#C67A52]/20",onClick:()=>F(e.uuid),children:(0,a.jsx)(v.A,{className:"size-3"})})]},e.uuid))}),(0,a.jsx)(u.$,{variant:"ghost",size:"xs",onClick:A,className:"text-muted-foreground",children:s("proposalFilter.clear")})]})]})}var k=s(1976),C=s(96213),F=s(66206);let A=(0,F.A)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);var E=s(17475);let B=(0,F.A)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);var S=s(43827);let z=(0,r.createContext)(null);var _=s(95725),U=s(66506);let D=e=>!e.isLayoutDirty&&e.willUpdate(!1),L=e=>{let{children:t,id:s,inherit:n=!0}=e,i=(0,r.useContext)(S.L),l=(0,r.useContext)(z),[o,d]=function(){let e=function(){let e=(0,r.useRef)(!1);return(0,U.E)(()=>(e.current=!0,()=>{e.current=!1}),[]),e}(),[t,s]=(0,r.useState)(0),a=(0,r.useCallback)(()=>{e.current&&s(t+1)},[t]);return[(0,r.useCallback)(()=>_.Gt.postRender(a),[a]),t]}(),c=(0,r.useRef)(null),u=i.id||l;null===c.current&&((e=>!0==(!0===e)||"id"===e)(n)&&u&&(s=s?u+"-"+s:u),c.current={id:s,group:!0===n&&i.group||function(){let e=new Set,t=new WeakMap,s=()=>e.forEach(D);return{add:a=>{e.add(a),t.set(a,a.addEventListener("willUpdate",s))},remove:a=>{e.delete(a);let r=t.get(a);r&&(r(),t.delete(a)),s()},dirty:s}}()});let x=(0,r.useMemo)(()=>({...c.current,forceRender:o}),[d]);return(0,a.jsx)(S.L.Provider,{value:x,children:t})};var P=s(16544),T=s(65626),O=s(97438),R=s(52217);let M=(0,R.createServerReference)("404c827587d084b705d5e681300d5efc7c4a15884c",R.callServer,void 0,R.findSourceMapURL,"fetchTasksAction"),I=(0,R.createServerReference)("70e6a324a0ad35e72e953ad68512d76a27ccf22d2d",R.callServer,void 0,R.findSourceMapURL,"moveTaskToColumnAction"),V=(0,R.createServerReference)("603b5cf9e54f8696551b0046467e7d00f4ed79dbe0",R.callServer,void 0,R.findSourceMapURL,"forceMoveTaskToColumnAction");var K=s(67712),$=s(17156),q=s(41111),G=s(63964);let W={open:"bg-[#FFF3E0] text-[#E65100]",assigned:"bg-[#E3F2FD] text-[#1976D2]",in_progress:"bg-[#E8F5E9] text-[#5A9E6F]",to_verify:"bg-[#F3E5F5] text-[#7B1FA2]",done:"bg-[#E0F2F1] text-[#00796B]",closed:"bg-[#F5F5F5] text-[#9A9A9A]"},H={open:"open",assigned:"assigned",in_progress:"inProgress",to_verify:"toVerify",done:"done",closed:"closed"},Z={in_progress:"bg-[#FFF3E0] text-[#E65100]",assigned:"bg-[#E8F5E9] text-[#2E7D32]",open:"bg-[#F5F5F5] text-[#6B6B6B]",to_verify:"bg-[#E3F2FD] text-[#1565C0]"},Y=[{id:"todo",labelKey:"todo",statuses:["open","assigned"]},{id:"in_progress",labelKey:"inProgress",statuses:["in_progress"]},{id:"to_verify",labelKey:"toVerify",statuses:["to_verify"]},{id:"done",labelKey:"done",statuses:["done","closed"]}];function J(e){let{projectUuid:t,initialTasks:s,currentUserUuid:n,selectedTaskUuid:l,onTaskSelect:o,onPanelClose:d,proposalUuidFilter:c}=e,m=(0,i.c)(),[g,f]=(0,r.useState)(s),[h,b]=(0,r.useState)({}),[v,j]=(0,r.useState)(!1),[y,w]=(0,r.useState)(null),[N,F]=(0,r.useState)([]),[S,z]=(0,r.useState)(!1),[_,U]=(0,r.useState)([]),[D,R]=(0,r.useState)(!1),[J,Q]=(0,r.useState)(!1),X=(0,r.useCallback)(async()=>{let e=await M(t);if(e.success){let t=c?e.data.filter(e=>e.proposalUuid&&c.has(e.proposalUuid)):e.data;f(t);let s=await (0,q.h)(t.map(e=>e.uuid));s.success&&s.data&&b(s.data)}},[t,c]);(0,G.eV)("task",X);let ee=(0,r.useRef)(c);(0,r.useEffect)(()=>{ee.current!==c&&(ee.current=c,X())},[c,X]),(0,r.useEffect)(()=>{0!==s.length&&(0,q.h)(s.map(e=>e.uuid)).then(e=>{e.success&&e.data&&b(e.data)})},[s]);let et=(0,r.useMemo)(()=>{var e;return l&&null!=(e=g.find(e=>e.uuid===l))?e:null},[l,g]),es=e=>g.filter(t=>e.includes(t.status)),ea=e=>es(e).reduce((e,t)=>e+(t.storyPoints||0),0),er=async e=>{let s;Q(!1);let{destination:a,source:r,draggableId:n}=e;if(!a||a.droppableId===r.droppableId&&a.index===r.index)return;let i=a.droppableId;r.droppableId;let l=g.find(e=>e.uuid===n);if(!l)return;if(Y.find(e=>e.id===i),"todo"===i)s="assigned"===l.status?"assigned":"open";else if("in_progress"===i)s="in_progress";else if("to_verify"===i)s="to_verify";else{if("done"!==i)return;s="to_verify"===l.status?"done":"to_verify"}f(e=>e.map(e=>e.uuid===n?{...e,status:s}:e));let o=await I(n,i,t);if(o.success)X();else{if("blocked"in o&&o.blocked&&"blockers"in o){f(e=>e.map(e=>e.uuid===n?{...e,status:l.status}:e)),w(l),F(o.blockers),j(!0);return}f(e=>e.map(e=>e.uuid===n?{...e,status:l.status}:e)),"gateBlocked"in o&&o.gateBlocked&&(U("unresolvedCriteria"in o&&Array.isArray(o.unresolvedCriteria)?o.unresolvedCriteria:[]),z(!0))}},en=async()=>{if(y){R(!0);try{let e=await V(y.uuid,"in_progress");e.success?(j(!1),w(null),F([]),X()):K.q.error("Failed to force move task:",e.error)}finally{R(!1)}}},ei=()=>{j(!1),w(null),F([])};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(k.JY,{onDragStart:()=>{Q(!0)},onDragEnd:er,children:(0,a.jsx)(L,{children:(0,a.jsx)("div",{className:"flex flex-1 gap-4 overflow-x-auto pb-4",children:Y.map(e=>{let t=es(e.statuses);return(0,a.jsxs)("div",{className:"flex w-[300px] flex-shrink-0 flex-col rounded-xl bg-[#F5F2EC] p-4",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-[#2C2C2C]",children:m("status.".concat(e.labelKey))}),(0,a.jsx)("span",{className:"rounded-full bg-white px-2 py-0.5 text-xs font-medium text-[#6B6B6B]",children:t.length})]}),ea(e.statuses)>0&&(0,a.jsxs)("span",{className:"flex items-center gap-1 text-xs text-[#9A9A9A]",children:[(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-3 w-3",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,a.jsx)("polyline",{points:"12 6 12 12 16 14"})]}),ea(e.statuses),"h"]})]}),(0,a.jsx)(k.gL,{droppableId:e.id,children:(e,s)=>(0,a.jsxs)("div",{ref:e.innerRef,...e.droppableProps,className:"flex-1 space-y-3 overflow-y-auto min-h-[100px] rounded-lg pt-3 pr-3 transition-colors ".concat(s.isDraggingOver?"bg-[#E5E0D8]":""),children:[0!==t.length||s.isDraggingOver?t.map((e,t)=>{let s=!!e.dependsOn&&0!==e.dependsOn.length&&e.dependsOn.some(e=>"done"!==e.status&&"closed"!==e.status),r=(s?!e.dependsOn?[]:e.dependsOn.filter(e=>"done"!==e.status&&"closed"!==e.status):[]).map(e=>e.title).join(", ");return(0,a.jsx)(k.sx,{draggableId:e.uuid,index:t,children:(t,n)=>(0,a.jsx)("div",{ref:t.innerRef,...t.draggableProps,...t.dragHandleProps,onClick:()=>{n.isDragging||o(e.uuid)},style:t.draggableProps.style,children:(0,a.jsxs)(P.P.div,{className:"relative",layoutId:J?void 0:"task-card-".concat(e.uuid),transition:T.Yv.spring,children:[h[e.uuid]>0&&(0,a.jsx)("div",{className:"absolute -top-3 -right-3 z-10 flex h-11 w-11 items-center justify-center rounded-full border-2 border-green-400 bg-white shadow-sm",children:(0,a.jsx)("img",{src:"/typing-animation.gif",alt:"",className:"h-8 w-8"})}),(0,a.jsx)(C.D,{entityType:"task",entityUuid:e.uuid,children:(0,a.jsxs)(p.Zp,{className:"cursor-pointer p-4 transition-all ".concat(s?"border-dashed border-[#D1D1D1] opacity-60":"border-[#E5E0D8] hover:border-[#C67A52]"," bg-white hover:shadow-sm ").concat(n.isDragging?"shadow-lg rotate-2":""),children:[(0,a.jsxs)("div",{className:"mb-2 flex items-start justify-between",children:[(0,a.jsx)(x.E,{className:W[e.status]||"",children:m("status.".concat(H[e.status]||e.status))}),(0,a.jsx)("div",{className:"flex items-center gap-1.5",children:e.storyPoints&&(0,a.jsxs)("span",{className:"flex items-center gap-1 rounded bg-[#FFF3E0] px-2 py-0.5 text-xs font-medium text-[#E65100]",children:[(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-3 w-3",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,a.jsx)("polyline",{points:"12 6 12 12 16 14"})]}),e.storyPoints,"h"]})})]}),(0,a.jsx)("h4",{className:"mb-1 font-medium text-[#2C2C2C]",children:e.title}),e.description&&(0,a.jsx)("p",{className:"mb-2 line-clamp-2 text-sm text-[#6B6B6B]",children:e.description}),s&&(0,a.jsxs)("div",{className:"mb-2 flex items-center gap-1.5 rounded-md bg-[#FFF3E0] px-2 py-1",children:[(0,a.jsx)(A,{className:"h-3 w-3 shrink-0 text-[#E65100]"}),(0,a.jsx)("span",{className:"text-[9px] font-medium leading-tight text-[#E65100] line-clamp-1",children:m("tasks.blockedBy",{tasks:r})})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between text-xs text-[#9A9A9A]",children:[e.assignee?(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-3 w-3",children:[(0,a.jsx)("path",{d:"M12 8V4H8"}),(0,a.jsx)("rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"})]}),e.assignee.name]}):"open"===e.status?(0,a.jsx)("span",{className:"text-[#C67A52]",children:m("common.assign")}):(0,a.jsx)("span",{children:m("common.unassigned")}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[h[e.uuid]>0&&(0,a.jsxs)(x.E,{variant:"outline",className:"h-4 gap-1 border-green-300 px-1.5 text-[10px] text-green-700",children:[(0,a.jsx)("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-green-500"}),m("sessions.workerCount",{count:h[e.uuid]})]}),e.acceptanceSummary&&e.acceptanceSummary.total>0&&(()=>{let t=e.acceptanceSummary,s="to_verify"===e.status,r=t.requiredPassed===t.required&&t.required>0,n=t.requiredFailed>0,i="bg-[#F5F2EC] text-[#9A9A9A]";return s&&(i=r?"bg-green-50 text-green-700":n?"bg-red-50 text-[#C4574C]":"bg-amber-50 text-[#D97706]"),(0,a.jsxs)(x.E,{className:"h-4 gap-1 border-0 px-1.5 text-[9px] ".concat(i),children:[(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-2.5 w-2.5",children:[(0,a.jsx)("path",{d:"M9 11l3 3L22 4"}),(0,a.jsx)("path",{d:"M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11"})]}),t.passed,"/",t.total]})})()]})]})]})})]})})},e.uuid)}):(0,a.jsx)("div",{className:"flex h-24 items-center justify-center rounded-lg border-2 border-dashed border-[#E5E0D8] text-sm text-[#9A9A9A]",children:m("tasks.noTasks")}),e.placeholder]})})]},e.id)})})})}),et&&(0,a.jsx)($.v,{task:et,projectUuid:t,currentUserUuid:n,onClose:d}),(0,a.jsx)(O.lG,{open:v,onOpenChange:e=>{e||ei()},children:(0,a.jsxs)(O.Cf,{className:"max-w-md rounded-2xl",children:[(0,a.jsxs)(O.c7,{children:[(0,a.jsxs)(O.L3,{className:"flex items-center gap-2",children:[(0,a.jsx)(E.A,{className:"h-5 w-5 text-[#E65100]"}),m("tasks.dependencyBlocked")]}),(0,a.jsx)(O.rr,{children:m("tasks.dependencyBlockedDescription")})]}),(0,a.jsxs)("div",{className:"rounded-lg bg-[#FAF8F4] p-3",children:[(0,a.jsx)("p",{className:"mb-2 text-xs font-medium text-[#6B6B6B]",children:m("tasks.blockerList")}),(0,a.jsx)("div",{className:"space-y-2",children:N.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-[#E5E0D8] bg-white p-3",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-[#2C2C2C]",children:e.title}),(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[e.assignee&&(0,a.jsx)("span",{className:"text-xs text-[#6B6B6B]",children:e.assignee.name}),e.sessionCheckin&&(0,a.jsxs)("span",{className:"flex items-center gap-1 text-xs text-[#6B6B6B]",children:[(0,a.jsx)(B,{className:"h-3 w-3"}),e.sessionCheckin.sessionName]})]})]}),(0,a.jsx)(x.E,{className:"shrink-0 ".concat(Z[e.status]||"bg-[#F5F5F5] text-[#6B6B6B]"),children:m("status.".concat(H[e.status]||e.status))})]},e.uuid))})]}),(0,a.jsxs)(O.Es,{className:"gap-2 sm:gap-0",children:[(0,a.jsx)(u.$,{variant:"outline",onClick:ei,children:m("common.cancel")}),(0,a.jsx)(u.$,{className:"bg-[#E65100] hover:bg-[#BF4400] text-white",onClick:en,disabled:D,children:D?m("common.processing"):m("tasks.forceMove")})]})]})}),(0,a.jsx)(O.lG,{open:S,onOpenChange:z,children:(0,a.jsxs)(O.Cf,{className:"max-w-[520px] rounded-2xl p-0 gap-0",children:[(0,a.jsxs)(O.c7,{className:"px-6 pt-6 pb-4",children:[(0,a.jsxs)(O.L3,{className:"flex items-center gap-2.5",children:[(0,a.jsx)(E.A,{className:"h-5 w-5 text-[#C4574C]"}),m("acceptanceCriteria.title")]}),(0,a.jsx)(O.rr,{className:"text-[13px] leading-relaxed text-[#6B6B6B]",children:m("acceptanceCriteria.gateBlocked",{count:_.filter(e=>e.required&&"passed"!==e.status).length})})]}),(0,a.jsxs)("div",{className:"px-6 pb-4 space-y-3",children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold text-[#9A9A9A] uppercase tracking-wide",children:m("acceptanceCriteria.title")}),_.map(e=>(0,a.jsxs)("div",{className:"rounded-lg border p-3 space-y-2 ".concat("failed"===e.status?"border-red-200 bg-white":"border-[#E5E0D8] bg-white"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"h-2 w-2 rounded-full shrink-0 ".concat("failed"===e.status?"bg-[#C4574C]":"bg-[#F59E0B]")}),(0,a.jsx)("span",{className:"text-xs font-semibold text-[#2C2C2C]",children:e.description})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pl-4",children:[(0,a.jsx)(x.E,{className:"text-[10px] border-0 ".concat("failed"===e.status?"bg-red-50 text-[#C4574C]":"bg-amber-50 text-[#D97706]"),children:m("acceptanceCriteria.status.".concat(e.status))}),(0,a.jsx)(x.E,{className:"text-[10px] border-0 bg-[#FAF8F4] text-[#9A9A9A]",children:e.required?m("acceptanceCriteria.required"):m("acceptanceCriteria.optional")}),!e.evidence&&(0,a.jsx)("span",{className:"text-[10px] italic text-[#9A9A9A]",children:m("acceptanceCriteria.noEvidence")})]}),e.evidence&&(0,a.jsxs)("div",{className:"rounded-md bg-red-50 p-2 ml-4",children:[(0,a.jsx)("span",{className:"text-[10px] font-medium text-[#9A9A9A]",children:m("acceptanceCriteria.verifyEvidence")}),(0,a.jsx)("p",{className:"text-[11px] text-[#2C2C2C] mt-0.5",children:e.evidence})]})]},e.uuid))]}),(0,a.jsx)(O.Es,{className:"border-t border-[#E5E2DC] px-6 py-4",children:(0,a.jsx)(u.$,{className:"rounded-lg bg-[#C4574C] hover:bg-[#A3433A] text-white",onClick:()=>z(!1),children:m("acceptanceCriteria.dismiss")})})]})})]})}var Q=s(26145);s(33805);var X=s(85226),ee=s(92745);let et=(0,R.createServerReference)("409104618de392f8717da94eecea67506658f87b2f",R.callServer,void 0,R.findSourceMapURL,"getProjectDependenciesAction");var es=s(32700);function ea(e){let{projectUuid:t,onTaskSelect:s,refreshKey:l}=e,o=(0,i.c)(),d=(0,n.useSearchParams)(),[c,x,p]=(0,Q.ck)([]),[m,g,f]=(0,Q.fM)([]),[h,b]=(0,r.useState)(!0),[j,y]=(0,r.useState)(null),w=(0,r.useMemo)(()=>{let e=d.get("proposalUuids");if(!e)return null;let t=e.split(",").filter(Boolean);return t.length>0?new Set(t):null},[d]),N=(0,r.useCallback)(async()=>{b(!0);let e=await et(t),s=e.nodes,a=e.edges;if(w){let t=new Set((s=e.nodes.filter(e=>null!==e.proposalUuid&&w.has(e.proposalUuid))).map(e=>e.uuid));a=e.edges.filter(e=>t.has(e.from)&&t.has(e.to))}let r=s.map(e=>({id:e.uuid,type:"taskNode",position:{x:0,y:0},data:{title:e.title,status:e.status,priority:e.priority,proposalUuid:e.proposalUuid}})),n=a.map((e,t)=>({id:"e-".concat(t),source:e.to,target:e.from,...ee.qK})),{nodes:i,edges:l}=(0,ee.nF)(r,n);x(i),g(l),b(!1)},[t,w,x,g]);(0,r.useEffect)(()=>{N()},[N,l]);let k=(0,r.useCallback)(async e=>{if(!e.source||!e.target)return;y(null);let t=e.target,s=e.source,a=await (0,es.w)(t,s);if(!a.success)return void y(a.error||o("tasks.failedToAddDep"));await N()},[N]),C=(0,r.useCallback)((e,t)=>{s(t.id)},[s]);return h?(0,a.jsx)("div",{className:"flex flex-1 items-center justify-center",children:(0,a.jsx)(X.A,{className:"h-6 w-6 animate-spin text-[#9A9A9A]"})}):0===c.length?(0,a.jsx)("div",{className:"flex flex-1 items-center justify-center text-sm text-[#9A9A9A]",children:o("tasks.noTasksToDisplay")}):(0,a.jsxs)("div",{className:"flex-1 rounded-xl border border-[#E5E0D8] bg-[#FAFAF8] relative",children:[j&&(0,a.jsxs)("div",{className:"absolute top-3 left-1/2 -translate-x-1/2 z-10 rounded-lg bg-red-50 border border-red-200 px-4 py-2 text-xs text-red-700 shadow-sm",children:[j,(0,a.jsx)(u.$,{variant:"ghost",size:"icon",className:"ml-2 h-5 w-5 font-medium hover:text-red-900",onClick:()=>y(null),children:(0,a.jsx)(v.A,{className:"h-3 w-3"})})]}),(0,a.jsxs)(Q.Gc,{nodes:c,edges:m,onNodesChange:p,onEdgesChange:f,onConnect:k,onNodeClick:C,nodeTypes:ee.c_,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:1.5,proOptions:{hideAttribution:!0},children:[(0,a.jsx)(Q.VS,{color:"#E5E0D8",gap:20}),(0,a.jsx)(Q.H2,{className:"[&>button]:border-[#E5E0D8] [&>button]:bg-white [&>button]:text-[#2C2C2C] [&>button:hover]:bg-[#FAF8F4]"})]})]})}let er={open:"bg-[#FFF3E0] text-[#E65100]",assigned:"bg-[#E3F2FD] text-[#1976D2]",in_progress:"bg-[#E8F5E9] text-[#5A9E6F]",to_verify:"bg-[#F3E5F5] text-[#7B1FA2]",done:"bg-[#E0F2F1] text-[#00796B]",closed:"bg-[#F5F5F5] text-[#9A9A9A]"},en={open:"open",assigned:"assigned",in_progress:"inProgress",to_verify:"toVerify",done:"done",closed:"closed"},ei=[{id:"all",labelKey:"allStatuses",statuses:[]},{id:"todo",labelKey:"todo",statuses:["open","assigned"]},{id:"in_progress",labelKey:"inProgress",statuses:["in_progress"]},{id:"to_verify",labelKey:"toVerify",statuses:["to_verify"]},{id:"done",labelKey:"done",statuses:["done","closed"]}],el={high:"bg-red-100 text-red-700",medium:"bg-yellow-100 text-yellow-700",low:"bg-blue-100 text-blue-700"};function eo(e){let{projectUuid:t,initialTasks:s,currentUserUuid:f,initialSelectedTaskUuid:h}=e,b=(0,i.c)(),v=(0,m.a)(),j=(0,n.useSearchParams)(),[y,w]=(0,r.useState)("kanban"),k="/projects/".concat(t,"/tasks"),{selectedId:C,openPanel:F,closePanel:A}=(0,g.T)(k,h),E=(0,r.useMemo)(()=>{let e=j.get("proposalUuids");if(!e)return null;let t=e.split(",").filter(Boolean);return t.length>0?new Set(t):null},[j]);(0,r.useEffect)(()=>{v&&"kanban"===y&&w("list")},[v]);let[B,S]=(0,r.useState)(!1),[z,_]=(0,r.useState)(0),[U,D]=(0,r.useState)("all"),L=(0,r.useMemo)(()=>{var e;return C&&null!=(e=s.find(e=>e.uuid===C))?e:null},[C,s]),T=(0,r.useCallback)(()=>{_(e=>e+1)},[]),O=(0,r.useMemo)(()=>E?s.filter(e=>e.proposalUuid&&E.has(e.proposalUuid)):s,[s,E]),R=(0,r.useMemo)(()=>{let e=ei.find(e=>e.id===U);return e&&0!==e.statuses.length?O.filter(t=>e.statuses.includes(t.status)):O},[O,U]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-4 overflow-x-auto",children:(0,a.jsx)(N,{projectUuid:t})}),(0,a.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1 rounded-lg bg-[#F5F2EC] p-1 w-fit",children:[v&&(0,a.jsxs)(u.$,{variant:"ghost",size:"sm",className:"h-8 gap-1.5 rounded-md px-3 text-xs ".concat("list"===y?"bg-white text-[#2C2C2C] shadow-sm":"text-[#6B6B6B] hover:text-[#2C2C2C]"),onClick:()=>w("list"),children:[(0,a.jsx)(l.A,{className:"h-3.5 w-3.5"}),b("tasks.listView")]}),!v&&(0,a.jsxs)(u.$,{variant:"ghost",size:"sm",className:"h-8 gap-1.5 rounded-md px-3 text-xs ".concat("kanban"===y?"bg-white text-[#2C2C2C] shadow-sm":"text-[#6B6B6B] hover:text-[#2C2C2C]"),onClick:()=>w("kanban"),children:[(0,a.jsx)(o.A,{className:"h-3.5 w-3.5"}),b("tasks.kanbanView")]}),(0,a.jsxs)(u.$,{variant:"ghost",size:"sm",className:"h-8 gap-1.5 rounded-md px-3 text-xs ".concat("dag"===y?"bg-white text-[#2C2C2C] shadow-sm":"text-[#6B6B6B] hover:text-[#2C2C2C]"),onClick:()=>w("dag"),children:[(0,a.jsx)(d.A,{className:"h-3.5 w-3.5"}),b("tasks.dagView")]})]}),(0,a.jsxs)(u.$,{className:"bg-[#C67A52] hover:bg-[#B56A42] text-white",onClick:()=>{A(),S(!0)},children:[(0,a.jsx)(c.A,{className:"mr-2 h-4 w-4"}),b("tasks.newTask")]})]}),"list"===y?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-4 flex gap-1 overflow-x-auto border-b border-[#E5E0D8] pb-2",children:ei.map(e=>{let t=0===e.statuses.length?O.length:O.filter(t=>e.statuses.includes(t.status)).length;return(0,a.jsxs)(u.$,{variant:"ghost",size:"sm",className:"h-8 shrink-0 rounded-md px-3 text-xs ".concat(U===e.id?"bg-[#F5F2EC] text-[#2C2C2C] font-medium":"text-[#6B6B6B] hover:text-[#2C2C2C]"),onClick:()=>D(e.id),children:["all"===e.id?b("tasks.".concat(e.labelKey)):b("status.".concat(e.labelKey)),(0,a.jsx)("span",{className:"ml-1.5 rounded-full bg-white px-1.5 py-0.5 text-[10px] font-medium text-[#6B6B6B]",children:t})]},e.id)})}),(0,a.jsx)("div",{className:"flex-1 space-y-2 overflow-y-auto",children:0===R.length?(0,a.jsx)(P.P.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},transition:{duration:.2,ease:[0,0,.2,1]},className:"flex h-24 items-center justify-center rounded-lg border-2 border-dashed border-[#E5E0D8] text-sm text-[#9A9A9A]",children:b("tasks.noTasks")}):R.map(e=>(0,a.jsxs)(p.Zp,{className:"cursor-pointer border-[#E5E0D8] bg-white p-4 transition-all hover:border-[#C67A52] hover:shadow-sm",onClick:()=>F(e.uuid),children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("h4",{className:"font-medium text-[#2C2C2C] truncate",children:e.title}),e.description&&(0,a.jsx)("p",{className:"mt-1 line-clamp-1 text-sm text-[#6B6B6B]",children:e.description})]}),(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[null!=e.storyPoints&&e.storyPoints>0&&(0,a.jsxs)("span",{className:"rounded bg-[#FFF3E0] px-2 py-0.5 text-xs font-medium text-[#E65100]",children:[e.storyPoints,"h"]}),(0,a.jsx)(x.E,{className:el[e.priority]||"",children:b("priority.".concat(e.priority))}),(0,a.jsx)(x.E,{className:er[e.status]||"",children:b("status.".concat(en[e.status]||e.status))})]})]}),e.assignee&&(0,a.jsx)("div",{className:"mt-2 flex items-center gap-1.5 text-xs text-[#9A9A9A]",children:(0,a.jsx)("span",{className:"truncate",children:e.assignee.name})})]},e.uuid))}),L&&(0,a.jsx)($.v,{task:L,projectUuid:t,currentUserUuid:f,onClose:A,onDependencyChange:T})]}):"kanban"===y?(0,a.jsx)(J,{projectUuid:t,initialTasks:O,currentUserUuid:f,selectedTaskUuid:C,onTaskSelect:F,onPanelClose:A,proposalUuidFilter:E}):(0,a.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,a.jsx)(ea,{projectUuid:t,onTaskSelect:e=>F(e),refreshKey:z}),L&&(0,a.jsx)($.v,{task:L,projectUuid:t,currentUserUuid:f,onClose:A,onDependencyChange:T})]}),B&&!L&&(0,a.jsx)($.v,{task:null,projectUuid:t,currentUserUuid:f,onClose:()=>S(!1),onCreated:()=>S(!1)})]})}},41033:(e,t,s)=>{"use strict";s.d(t,{C:()=>o,z:()=>l});var a=s(90508);s(1856);var r=s(97964),n=s(63197),i=s(24377);function l(e){let{className:t,...s}=e;return(0,a.jsx)(n.Root,{"data-slot":"radio-group",className:(0,i.cn)("grid gap-3",t),...s})}function o(e){let{className:t,...s}=e;return(0,a.jsx)(n.Item,{"data-slot":"radio-group-item",className:(0,i.cn)("border-input text-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 dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...s,children:(0,a.jsx)(n.Indicator,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:(0,a.jsx)(r.A,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}},57731:(e,t,s)=>{"use strict";s.d(t,{E:()=>o});var a=s(90508);s(1856);var r=s(49499),n=s(54154),i=s(24377);let l=(0,r.F)("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline",success:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100",warning:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100"}},defaultVariants:{variant:"default"}});function o(e){let{className:t,variant:s="default",asChild:r=!1,...o}=e,d=r?n.bL:"span";return(0,a.jsx)(d,{"data-slot":"badge","data-variant":s,className:(0,i.cn)(l({variant:s}),t),...o})}},62205:(e,t,s)=>{"use strict";s.d(t,{a:()=>r});var a=s(1856);function r(){let[e,t]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=window.matchMedia("(max-width: 767px)");t(e.matches);let s=e=>t(e.matches);return e.addEventListener("change",s),()=>e.removeEventListener("change",s)},[]),e}},64993:(e,t,s)=>{"use strict";s.d(t,{F:()=>i});var a=s(90508);s(1856);var r=s(65326),n=s(24377);function i(e){let{className:t,children:s,...i}=e;return(0,a.jsxs)(r.Root,{"data-slot":"scroll-area",className:(0,n.cn)("relative",t),...i,children:[(0,a.jsx)(r.Viewport,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:s}),(0,a.jsx)(l,{}),(0,a.jsx)(r.Corner,{})]})}function l(e){let{className:t,orientation:s="vertical",...i}=e;return(0,a.jsx)(r.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:s,className:(0,n.cn)("flex touch-none p-px transition-colors select-none","vertical"===s&&"h-full w-2.5 border-l border-l-transparent","horizontal"===s&&"h-2.5 flex-col border-t border-t-transparent",t),...i,children:(0,a.jsx)(r.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}},65626:(e,t,s)=>{"use strict";s.d(t,{K5:()=>o,Rf:()=>l,Yv:()=>a,bK:()=>i,qG:()=>n,tE:()=>r});let a={fast:.15,normal:.2,slow:.3,easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1],stagger:.04,staggerFast:.03,spring:{type:"spring",stiffness:500,damping:30},tween:{type:"tween",duration:.2,ease:[0,0,.2,1]}},r={initial:{opacity:0,y:8},animate:{opacity:1,y:0,transition:{duration:a.normal,ease:a.easeOut}},exit:{opacity:0,y:-4,transition:{duration:a.fast,ease:a.easeOut}}},n={initial:{opacity:0},animate:{opacity:1,transition:{duration:a.normal,ease:a.easeOut}},exit:{opacity:0,transition:{duration:a.fast,ease:a.easeOut}}};a.normal,a.easeOut,a.fast,a.easeOut;let i={initial:{},animate:{transition:{staggerChildren:a.stagger}}},l={initial:{opacity:0,y:8},animate:{opacity:1,y:0,transition:{duration:a.normal,ease:a.easeOut}}},o={initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0,transition:{duration:a.fast,ease:a.easeOut}},exit:{opacity:0,scale:.95,y:-4,transition:{duration:a.fast,ease:a.easeOut}}}},78917:(e,t,s)=>{Promise.resolve().then(s.bind(s,18670))},88064:(e,t,s)=>{"use strict";s.d(t,{J:()=>i});var a=s(90508);s(1856);var r=s(58057),n=s(24377);function i(e){let{className:t,...s}=e;return(0,a.jsx)(r.Root,{"data-slot":"label",className:(0,n.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...s})}},91846:(e,t,s)=>{"use strict";s.d(t,{bq:()=>u,eb:()=>p,gC:()=>x,l6:()=>d,yv:()=>c});var a=s(90508);s(1856);var r=s(17730),n=s(60532),i=s(89967),l=s(48218),o=s(24377);function d(e){let{...t}=e;return(0,a.jsx)(l.Root,{"data-slot":"select",...t})}function c(e){let{...t}=e;return(0,a.jsx)(l.Value,{"data-slot":"select-value",...t})}function u(e){let{className:t,size:s="default",children:n,...i}=e;return(0,a.jsxs)(l.Trigger,{"data-slot":"select-trigger","data-size":s,className:(0,o.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...i,children:[n,(0,a.jsx)(l.Icon,{asChild:!0,children:(0,a.jsx)(r.A,{className:"size-4 opacity-50"})})]})}function x(e){let{className:t,children:s,position:r="item-aligned",align:n="center",...i}=e;return(0,a.jsx)(l.Portal,{children:(0,a.jsxs)(l.Content,{"data-slot":"select-content",className:(0,o.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,align:n,...i,children:[(0,a.jsx)(m,{}),(0,a.jsx)(l.Viewport,{className:(0,o.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:s}),(0,a.jsx)(g,{})]})})}function p(e){let{className:t,children:s,...r}=e;return(0,a.jsxs)(l.Item,{"data-slot":"select-item",className:(0,o.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...r,children:[(0,a.jsx)("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,a.jsx)(l.ItemIndicator,{children:(0,a.jsx)(n.A,{className:"size-4"})})}),(0,a.jsx)(l.ItemText,{children:s})]})}function m(e){let{className:t,...s}=e;return(0,a.jsx)(l.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...s,children:(0,a.jsx)(i.A,{className:"size-4"})})}function g(e){let{className:t,...s}=e;return(0,a.jsx)(l.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:(0,o.cn)("flex cursor-default items-center justify-center py-1",t),...s,children:(0,a.jsx)(r.A,{className:"size-4"})})}},97438:(e,t,s)=>{"use strict";s.d(t,{Cf:()=>x,Es:()=>m,L3:()=>g,c7:()=>p,lG:()=>o,rr:()=>f,zM:()=>d});var a=s(90508);s(1856);var r=s(9160),n=s(71350),i=s(24377),l=s(22922);function o(e){let{...t}=e;return(0,a.jsx)(n.Root,{"data-slot":"dialog",...t})}function d(e){let{...t}=e;return(0,a.jsx)(n.Trigger,{"data-slot":"dialog-trigger",...t})}function c(e){let{...t}=e;return(0,a.jsx)(n.Portal,{"data-slot":"dialog-portal",...t})}function u(e){let{className:t,...s}=e;return(0,a.jsx)(n.Overlay,{"data-slot":"dialog-overlay",className:(0,i.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...s})}function x(e){let{className:t,children:s,showCloseButton:l=!0,...o}=e;return(0,a.jsxs)(c,{"data-slot":"dialog-portal",children:[(0,a.jsx)(u,{}),(0,a.jsxs)(n.Content,{"data-slot":"dialog-content",className:(0,i.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",t),...o,children:[s,l&&(0,a.jsxs)(n.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,a.jsx)(r.A,{}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function p(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"dialog-header",className:(0,i.cn)("flex flex-col gap-2 text-center sm:text-left",t),...s})}function m(e){let{className:t,showCloseButton:s=!1,children:r,...o}=e;return(0,a.jsxs)("div",{"data-slot":"dialog-footer",className:(0,i.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...o,children:[r,s&&(0,a.jsx)(n.Close,{asChild:!0,children:(0,a.jsx)(l.$,{variant:"outline",children:"Close"})})]})}function g(e){let{className:t,...s}=e;return(0,a.jsx)(n.Title,{"data-slot":"dialog-title",className:(0,i.cn)("text-lg leading-none font-semibold",t),...s})}function f(e){let{className:t,...s}=e;return(0,a.jsx)(n.Description,{"data-slot":"dialog-description",className:(0,i.cn)("text-muted-foreground text-sm",t),...s})}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[32190],{14554:(e,t,a)=>{a.d(t,{p:()=>n});var s=a(90508);a(1856);var r=a(24377);function n(e){let{className:t,type:a,...n}=e;return(0,s.jsx)("input",{type:a,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...n})}},15972:(e,t,a)=>{a.d(t,{T:()=>n});var s=a(90508);a(1856);var r=a(24377);function n(e){let{className:t,...a}=e;return(0,s.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...a})}},22922:(e,t,a)=>{a.d(t,{$:()=>d});var s=a(90508);a(1856);var r=a(49499),n=a(54154),i=a(24377);let o=(0,r.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium cursor-pointer transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function d(e){let{className:t,variant:a="default",size:r="default",asChild:d=!1,...l}=e,c=d?n.bL:"button";return(0,s.jsx)(c,{"data-slot":"button","data-variant":a,"data-size":r,className:(0,i.cn)(o({variant:a,size:r,className:t})),...l})}},24377:(e,t,a)=>{a.d(t,{cn:()=>n});var s=a(49251),r=a(58849);function n(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,r.QP)((0,s.$)(t))}},26965:(e,t,a)=>{a.d(t,{L:()=>j});var s=a(90508),r=a(1856),n=a(39268),i=a(14554),o=a(88064),d=a(15972),l=a(60532),c=a(98861),u=a(24377);function m(e){let{className:t,...a}=e;return(0,s.jsx)(c.Root,{"data-slot":"checkbox",className:(0,u.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:(0,s.jsx)(c.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:(0,s.jsx)(l.A,{className:"size-3.5"})})})}var p=a(91846),g=a(44775),x=a(93810);let f={admin_agent:"agent.permissions.presetAdmin",pm_agent:"agent.permissions.presetPm",developer_agent:"agent.permissions.presetDev",custom:"agent.permissions.presetCustom"},v={admin_agent:"agent.permissions.help.admin",pm_agent:"agent.permissions.help.pm",developer_agent:"agent.permissions.help.dev",custom:"agent.permissions.help.custom"},h=["admin_agent","pm_agent","developer_agent","custom"];function b(e){let{preset:t,permissions:a,onChange:r,readOnly:i=!1}=e,d=(0,n.c)(),l=null!=t?t:"custom",c=new Set("custom"===l?a:g.o[l]);return(0,s.jsxs)("div",{"data-testid":"agent-permission-picker",className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)(o.J,{className:"text-[13px] font-medium",children:d("agent.permissions.title")}),(0,s.jsx)("p",{className:"text-muted-foreground text-xs",children:d("agent.permissions.description")})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(o.J,{htmlFor:"agent-permission-preset",children:d("agent.permissions.presetLabel")}),(0,s.jsxs)(p.l6,{value:l,onValueChange:function(e){if("custom"===e)return void r({preset:"custom",roles:[],permissions:Array.from(c)});e in g.o&&r({preset:e,roles:[e],permissions:[]})},disabled:i,children:[(0,s.jsx)(p.bq,{id:"agent-permission-preset",className:"w-full","aria-label":d("agent.permissions.presetLabel"),children:(0,s.jsx)(p.yv,{placeholder:d(f[l]),children:d(f[l])})}),(0,s.jsx)(p.gC,{children:h.map(e=>(0,s.jsx)(p.eb,{value:e,textValue:d(f[e]),children:(0,s.jsxs)("div",{className:"flex flex-col gap-0.5 py-0.5",children:[(0,s.jsx)("span",{className:"text-sm font-semibold",children:d(f[e])}),(0,s.jsx)("span",{className:"text-muted-foreground text-xs",children:d(v[e])})]})},e))})]})]}),(0,s.jsxs)("div",{role:"grid","aria-label":d("agent.permissions.title"),className:"overflow-hidden rounded-md border",children:[(0,s.jsxs)("div",{role:"row",className:"bg-muted/50 text-muted-foreground grid grid-cols-[1.5fr_repeat(3,1fr)] items-center gap-2 px-4 py-2 text-xs font-medium",children:[(0,s.jsx)("div",{role:"columnheader",children:d("agent.permissions.resourceHeader")}),x.kl.map(e=>(0,s.jsx)("div",{role:"columnheader",className:"text-center",children:d("agent.permissions.actions.".concat(e))},e))]}),x.eZ.map(e=>(0,s.jsxs)("div",{role:"row",className:"border-t grid grid-cols-[1.5fr_repeat(3,1fr)] items-center gap-2 px-4 py-2 text-sm",children:[(0,s.jsx)("div",{role:"rowheader",className:"font-medium",children:d("agent.permissions.resources.".concat(e))}),x.kl.map(t=>{let a="".concat(e,":").concat(t),n="perm-".concat(e,"-").concat(t);return(0,s.jsx)("div",{role:"gridcell",className:"flex items-center justify-center",children:(0,s.jsx)(m,{id:n,checked:c.has(a),disabled:i,"aria-label":"".concat(d("agent.permissions.resources.".concat(e))," ").concat(d("agent.permissions.actions.".concat(t))),onCheckedChange:e=>{if(!i){let t=new Set(c);!0===e?t.add(a):t.delete(a),r({preset:"custom",roles:[],permissions:Array.from(t)})}}})},t)})]},e))]})]})]})}function j(e){let{name:t,onNameChange:a,preset:l,permissions:c,onPermissionsChange:u,persona:m,onPersonaChange:p,nameInputId:x="agent-form-name",personaInputId:f="agent-form-persona",readOnly:v=!1}=e,h=(0,n.c)(),j=(0,r.useMemo)(()=>"custom"===l?c:[...g.o[l]],[l,c]);return(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(o.J,{htmlFor:x,className:"text-[13px]",children:h("settings.name")}),(0,s.jsx)(i.p,{id:x,value:t,onChange:e=>a(e.target.value),placeholder:h("settings.namePlaceholder"),className:"border-[#E5E0D8]",required:!0,disabled:v})]}),(0,s.jsx)(b,{preset:l,permissions:j,onChange:u,readOnly:v}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(o.J,{htmlFor:f,className:"text-[13px]",children:h("settings.agentPersona")}),(0,s.jsx)(d.T,{id:f,value:m,onChange:e=>p(e.target.value),placeholder:h("settings.personaPlaceholder"),rows:4,disabled:v}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:h("settings.personaHint")})]})]})}},37750:(e,t,a)=>{a.d(t,{Y:()=>u});var s=a(90508),r=a(1856),n=a(39268),i=a(22922),o=a(60532),d=a(9160),l=a(67712),c=a(26965);function u(e){let{onAgentCreated:t,createAgentAndKey:a,onClose:u,embedded:m=!1,submitLabel:p,submittingLabel:g}=e,x=(0,n.c)(),[f,v]=(0,r.useState)(""),[h,b]=(0,r.useState)("admin_agent"),[j,y]=(0,r.useState)(["admin_agent"]),[w,N]=(0,r.useState)([]),[k,_]=(0,r.useState)(""),[z,C]=(0,r.useState)(!1),[A,S]=(0,r.useState)(null),[I,L]=(0,r.useState)(!1),P=async e=>{if((e.preventDefault(),f)&&("custom"!==h||0!==w.length)){C(!0);try{let e=await a({name:f,roles:j,permissions:"custom"===h?w:[],persona:k||null});e.success&&e.key?(m||S(e.key),t({uuid:e.agentUuid||"",name:f,roles:j,permissions:"custom"===h?w:[]},e.key)):l.q.error("Failed to create API key:",e.error)}catch(e){l.q.error("Failed to create API key:",e)}finally{C(!1)}}},T=async e=>{try{await navigator.clipboard.writeText(e),L(!0),setTimeout(()=>L(!1),2e3)}catch(e){l.q.error("Failed to copy to clipboard:",e)}},q=()=>{v(""),b("admin_agent"),y(["admin_agent"]),N([]),_(""),S(null),null==u||u()};return A&&!m?(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsxs)("div",{className:"mb-4 flex items-center gap-2 text-green-600",children:[(0,s.jsx)(o.A,{className:"h-5 w-5"}),(0,s.jsx)("span",{className:"font-medium",children:x("settings.apiKeyCreated")})]}),(0,s.jsx)("p",{className:"mb-4 text-sm text-muted-foreground",children:x("settings.apiKeyCreatedDesc")}),(0,s.jsxs)("div",{className:"mb-4 flex items-center gap-2",children:[(0,s.jsx)("code",{className:"flex-1 rounded bg-foreground px-3 py-2 font-mono text-sm text-background",children:A}),(0,s.jsx)(i.$,{variant:"outline",size:"sm",onClick:()=>T(A),children:x(I?"common.copied":"common.copy")})]}),(0,s.jsx)(i.$,{onClick:q,className:"w-full",children:x("common.done")})]}):(0,s.jsxs)("form",{onSubmit:P,children:[!m&&(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-6 py-5",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-foreground",children:x("settings.createApiKey")}),u&&(0,s.jsx)(i.$,{type:"button",variant:"ghost",size:"icon",onClick:q,className:"h-8 w-8",children:(0,s.jsx)(d.A,{className:"h-4 w-4"})})]}),(0,s.jsx)("div",{className:m?void 0:"p-6",children:(0,s.jsx)(c.L,{name:f,onNameChange:v,preset:h,permissions:w,onPermissionsChange:function(e){b(e.preset),y(e.roles),N(e.permissions)},persona:k,onPersonaChange:_,nameInputId:"keyName",personaInputId:"create-agent-persona"})}),(0,s.jsxs)("div",{className:m?"flex justify-end gap-3 pt-2":"flex justify-end gap-3 border-t border-border px-6 py-4",children:[!m&&u&&(0,s.jsx)(i.$,{type:"button",variant:"outline",onClick:q,children:x("common.cancel")}),(0,s.jsx)(i.$,{type:"submit",disabled:!f||"custom"===h&&0===w.length||z,className:m?"w-full":void 0,size:m?"lg":"default",children:z?null!=g?g:x("settings.creating"):null!=p?p:x("settings.createApiKey")})]})]})}},44775:(e,t,a)=>{a.d(t,{o:()=>s});let s={developer_agent:["idea:read","proposal:read","document:read","project:read","task:read","task:write"],pm_agent:["idea:read","idea:write","proposal:read","proposal:write","document:read","document:write","task:read","task:write","project:read","project:write"],admin_agent:["idea:read","idea:write","idea:admin","proposal:read","proposal:write","proposal:admin","document:read","document:write","document:admin","task:read","task:write","task:admin","project:read","project:write","project:admin"]}},48416:(e,t,a)=>{a.d(t,{BT:()=>d,Wu:()=>c,X9:()=>l,ZB:()=>o,Zp:()=>n,aR:()=>i,wL:()=>u});var s=a(90508);a(1856);var r=a(24377);function n(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card",className:(0,r.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...a})}function i(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...a})}function o(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("leading-none font-semibold",t),...a})}function d(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-description",className:(0,r.cn)("text-muted-foreground text-sm",t),...a})}function l(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-action",className:(0,r.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",t),...a})}function c(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-6",t),...a})}function u(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-footer",className:(0,r.cn)("flex items-center px-6 [.border-t]:pt-6",t),...a})}},65332:(e,t,a)=>{a.d(t,{I:()=>r});var s=a(52217);let r=(0,s.createServerReference)("401aadf96622ab0b2bf7cc5986f1b83425ac429ae8",s.callServer,void 0,s.findSourceMapURL,"createAgentAndKeyAction")},67712:(e,t,a)=>{a.d(t,{q:()=>o});var s=a(55036);let r={debug:0,info:1,warn:2,error:3},n=s.env.NEXT_PUBLIC_LOG_LEVEL||"warn";function i(e){return r[e]>=r[n]}let o={debug:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),s=1;s<t;s++)a[s-1]=arguments[s];i("debug")&&console.debug("[Chorus] ".concat(e),...a)},info:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),s=1;s<t;s++)a[s-1]=arguments[s];i("info")&&console.info("[Chorus] ".concat(e),...a)},warn:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),s=1;s<t;s++)a[s-1]=arguments[s];i("warn")&&console.warn("[Chorus] ".concat(e),...a)},error:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),s=1;s<t;s++)a[s-1]=arguments[s];i("error")&&console.error("[Chorus] ".concat(e),...a)}}},88064:(e,t,a)=>{a.d(t,{J:()=>i});var s=a(90508);a(1856);var r=a(58057),n=a(24377);function i(e){let{className:t,...a}=e;return(0,s.jsx)(r.Root,{"data-slot":"label",className:(0,n.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...a})}},91846:(e,t,a)=>{a.d(t,{bq:()=>u,eb:()=>p,gC:()=>m,l6:()=>l,yv:()=>c});var s=a(90508);a(1856);var r=a(17730),n=a(60532),i=a(89967),o=a(48218),d=a(24377);function l(e){let{...t}=e;return(0,s.jsx)(o.Root,{"data-slot":"select",...t})}function c(e){let{...t}=e;return(0,s.jsx)(o.Value,{"data-slot":"select-value",...t})}function u(e){let{className:t,size:a="default",children:n,...i}=e;return(0,s.jsxs)(o.Trigger,{"data-slot":"select-trigger","data-size":a,className:(0,d.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...i,children:[n,(0,s.jsx)(o.Icon,{asChild:!0,children:(0,s.jsx)(r.A,{className:"size-4 opacity-50"})})]})}function m(e){let{className:t,children:a,position:r="item-aligned",align:n="center",...i}=e;return(0,s.jsx)(o.Portal,{children:(0,s.jsxs)(o.Content,{"data-slot":"select-content",className:(0,d.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,align:n,...i,children:[(0,s.jsx)(g,{}),(0,s.jsx)(o.Viewport,{className:(0,d.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),(0,s.jsx)(x,{})]})})}function p(e){let{className:t,children:a,...r}=e;return(0,s.jsxs)(o.Item,{"data-slot":"select-item",className:(0,d.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...r,children:[(0,s.jsx)("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,s.jsx)(o.ItemIndicator,{children:(0,s.jsx)(n.A,{className:"size-4"})})}),(0,s.jsx)(o.ItemText,{children:a})]})}function g(e){let{className:t,...a}=e;return(0,s.jsx)(o.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:(0,d.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,s.jsx)(i.A,{className:"size-4"})})}function x(e){let{className:t,...a}=e;return(0,s.jsx)(o.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:(0,d.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,s.jsx)(r.A,{className:"size-4"})})}},93810:(e,t,a)=>{a.d(t,{eZ:()=>s,kl:()=>r,lp:()=>n});let s=["idea","proposal","document","task","project"],r=["read","write","admin"],n=s.flatMap(e=>r.map(t=>"".concat(e,":").concat(t)))}}]);
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[75444],{14554:(e,t,a)=>{a.d(t,{p:()=>n});var s=a(90508);a(1856);var r=a(24377);function n(e){let{className:t,type:a,...n}=e;return(0,s.jsx)("input",{type:a,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...n})}},15972:(e,t,a)=>{a.d(t,{T:()=>n});var s=a(90508);a(1856);var r=a(24377);function n(e){let{className:t,...a}=e;return(0,s.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...a})}},22922:(e,t,a)=>{a.d(t,{$:()=>d});var s=a(90508);a(1856);var r=a(49499),n=a(54154),i=a(24377);let o=(0,r.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium cursor-pointer transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function d(e){let{className:t,variant:a="default",size:r="default",asChild:d=!1,...l}=e,c=d?n.bL:"button";return(0,s.jsx)(c,{"data-slot":"button","data-variant":a,"data-size":r,className:(0,i.cn)(o({variant:a,size:r,className:t})),...l})}},24377:(e,t,a)=>{a.d(t,{cn:()=>n});var s=a(49251),r=a(58849);function n(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,r.QP)((0,s.$)(t))}},26965:(e,t,a)=>{a.d(t,{L:()=>j});var s=a(90508),r=a(1856),n=a(39268),i=a(14554),o=a(88064),d=a(15972),l=a(60532),c=a(98861),u=a(24377);function m(e){let{className:t,...a}=e;return(0,s.jsx)(c.Root,{"data-slot":"checkbox",className:(0,u.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:(0,s.jsx)(c.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:(0,s.jsx)(l.A,{className:"size-3.5"})})})}var p=a(91846),g=a(44775),x=a(93810);let f={admin_agent:"agent.permissions.presetAdmin",pm_agent:"agent.permissions.presetPm",developer_agent:"agent.permissions.presetDev",custom:"agent.permissions.presetCustom"},v={admin_agent:"agent.permissions.help.admin",pm_agent:"agent.permissions.help.pm",developer_agent:"agent.permissions.help.dev",custom:"agent.permissions.help.custom"},h=["admin_agent","pm_agent","developer_agent","custom"];function b(e){let{preset:t,permissions:a,onChange:r,readOnly:i=!1}=e,d=(0,n.c)(),l=null!=t?t:"custom",c=new Set("custom"===l?a:g.o[l]);return(0,s.jsxs)("div",{"data-testid":"agent-permission-picker",className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)(o.J,{className:"text-[13px] font-medium",children:d("agent.permissions.title")}),(0,s.jsx)("p",{className:"text-muted-foreground text-xs",children:d("agent.permissions.description")})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(o.J,{htmlFor:"agent-permission-preset",children:d("agent.permissions.presetLabel")}),(0,s.jsxs)(p.l6,{value:l,onValueChange:function(e){if("custom"===e)return void r({preset:"custom",roles:[],permissions:Array.from(c)});e in g.o&&r({preset:e,roles:[e],permissions:[]})},disabled:i,children:[(0,s.jsx)(p.bq,{id:"agent-permission-preset",className:"w-full","aria-label":d("agent.permissions.presetLabel"),children:(0,s.jsx)(p.yv,{placeholder:d(f[l]),children:d(f[l])})}),(0,s.jsx)(p.gC,{children:h.map(e=>(0,s.jsx)(p.eb,{value:e,textValue:d(f[e]),children:(0,s.jsxs)("div",{className:"flex flex-col gap-0.5 py-0.5",children:[(0,s.jsx)("span",{className:"text-sm font-semibold",children:d(f[e])}),(0,s.jsx)("span",{className:"text-muted-foreground text-xs",children:d(v[e])})]})},e))})]})]}),(0,s.jsxs)("div",{role:"grid","aria-label":d("agent.permissions.title"),className:"overflow-hidden rounded-md border",children:[(0,s.jsxs)("div",{role:"row",className:"bg-muted/50 text-muted-foreground grid grid-cols-[1.5fr_repeat(3,1fr)] items-center gap-2 px-4 py-2 text-xs font-medium",children:[(0,s.jsx)("div",{role:"columnheader",children:d("agent.permissions.resourceHeader")}),x.kl.map(e=>(0,s.jsx)("div",{role:"columnheader",className:"text-center",children:d("agent.permissions.actions.".concat(e))},e))]}),x.eZ.map(e=>(0,s.jsxs)("div",{role:"row",className:"border-t grid grid-cols-[1.5fr_repeat(3,1fr)] items-center gap-2 px-4 py-2 text-sm",children:[(0,s.jsx)("div",{role:"rowheader",className:"font-medium",children:d("agent.permissions.resources.".concat(e))}),x.kl.map(t=>{let a="".concat(e,":").concat(t),n="perm-".concat(e,"-").concat(t);return(0,s.jsx)("div",{role:"gridcell",className:"flex items-center justify-center",children:(0,s.jsx)(m,{id:n,checked:c.has(a),disabled:i,"aria-label":"".concat(d("agent.permissions.resources.".concat(e))," ").concat(d("agent.permissions.actions.".concat(t))),onCheckedChange:e=>{if(!i){let t=new Set(c);!0===e?t.add(a):t.delete(a),r({preset:"custom",roles:[],permissions:Array.from(t)})}}})},t)})]},e))]})]})]})}function j(e){let{name:t,onNameChange:a,preset:l,permissions:c,onPermissionsChange:u,persona:m,onPersonaChange:p,nameInputId:x="agent-form-name",personaInputId:f="agent-form-persona",readOnly:v=!1}=e,h=(0,n.c)(),j=(0,r.useMemo)(()=>"custom"===l?c:[...g.o[l]],[l,c]);return(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(o.J,{htmlFor:x,className:"text-[13px]",children:h("settings.name")}),(0,s.jsx)(i.p,{id:x,value:t,onChange:e=>a(e.target.value),placeholder:h("settings.namePlaceholder"),className:"border-[#E5E0D8]",required:!0,disabled:v})]}),(0,s.jsx)(b,{preset:l,permissions:j,onChange:u,readOnly:v}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(o.J,{htmlFor:f,className:"text-[13px]",children:h("settings.agentPersona")}),(0,s.jsx)(d.T,{id:f,value:m,onChange:e=>p(e.target.value),placeholder:h("settings.personaPlaceholder"),rows:4,disabled:v}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:h("settings.personaHint")})]})]})}},37750:(e,t,a)=>{a.d(t,{Y:()=>u});var s=a(90508),r=a(1856),n=a(39268),i=a(22922),o=a(60532),d=a(9160),l=a(67712),c=a(26965);function u(e){let{onAgentCreated:t,createAgentAndKey:a,onClose:u,embedded:m=!1,submitLabel:p,submittingLabel:g}=e,x=(0,n.c)(),[f,v]=(0,r.useState)(""),[h,b]=(0,r.useState)("admin_agent"),[j,y]=(0,r.useState)(["admin_agent"]),[w,N]=(0,r.useState)([]),[k,_]=(0,r.useState)(""),[z,C]=(0,r.useState)(!1),[A,S]=(0,r.useState)(null),[I,L]=(0,r.useState)(!1),P=async e=>{if((e.preventDefault(),f)&&("custom"!==h||0!==w.length)){C(!0);try{let e=await a({name:f,roles:j,permissions:"custom"===h?w:[],persona:k||null});e.success&&e.key?(m||S(e.key),t({uuid:e.agentUuid||"",name:f,roles:j,permissions:"custom"===h?w:[]},e.key)):l.q.error("Failed to create API key:",e.error)}catch(e){l.q.error("Failed to create API key:",e)}finally{C(!1)}}},T=async e=>{try{await navigator.clipboard.writeText(e),L(!0),setTimeout(()=>L(!1),2e3)}catch(e){l.q.error("Failed to copy to clipboard:",e)}},q=()=>{v(""),b("admin_agent"),y(["admin_agent"]),N([]),_(""),S(null),null==u||u()};return A&&!m?(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsxs)("div",{className:"mb-4 flex items-center gap-2 text-green-600",children:[(0,s.jsx)(o.A,{className:"h-5 w-5"}),(0,s.jsx)("span",{className:"font-medium",children:x("settings.apiKeyCreated")})]}),(0,s.jsx)("p",{className:"mb-4 text-sm text-muted-foreground",children:x("settings.apiKeyCreatedDesc")}),(0,s.jsxs)("div",{className:"mb-4 flex items-center gap-2",children:[(0,s.jsx)("code",{className:"flex-1 rounded bg-foreground px-3 py-2 font-mono text-sm text-background",children:A}),(0,s.jsx)(i.$,{variant:"outline",size:"sm",onClick:()=>T(A),children:x(I?"common.copied":"common.copy")})]}),(0,s.jsx)(i.$,{onClick:q,className:"w-full",children:x("common.done")})]}):(0,s.jsxs)("form",{onSubmit:P,children:[!m&&(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-6 py-5",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-foreground",children:x("settings.createApiKey")}),u&&(0,s.jsx)(i.$,{type:"button",variant:"ghost",size:"icon",onClick:q,className:"h-8 w-8",children:(0,s.jsx)(d.A,{className:"h-4 w-4"})})]}),(0,s.jsx)("div",{className:m?void 0:"p-6",children:(0,s.jsx)(c.L,{name:f,onNameChange:v,preset:h,permissions:w,onPermissionsChange:function(e){b(e.preset),y(e.roles),N(e.permissions)},persona:k,onPersonaChange:_,nameInputId:"keyName",personaInputId:"create-agent-persona"})}),(0,s.jsxs)("div",{className:m?"flex justify-end gap-3 pt-2":"flex justify-end gap-3 border-t border-border px-6 py-4",children:[!m&&u&&(0,s.jsx)(i.$,{type:"button",variant:"outline",onClick:q,children:x("common.cancel")}),(0,s.jsx)(i.$,{type:"submit",disabled:!f||"custom"===h&&0===w.length||z,className:m?"w-full":void 0,size:m?"lg":"default",children:z?null!=g?g:x("settings.creating"):null!=p?p:x("settings.createApiKey")})]})]})}},44775:(e,t,a)=>{a.d(t,{o:()=>s});let s={developer_agent:["idea:read","proposal:read","document:read","project:read","task:read","task:write"],pm_agent:["idea:read","idea:write","proposal:read","proposal:write","document:read","document:write","task:read","task:write","project:read","project:write"],admin_agent:["idea:read","idea:write","idea:admin","proposal:read","proposal:write","proposal:admin","document:read","document:write","document:admin","task:read","task:write","task:admin","project:read","project:write","project:admin"]}},48416:(e,t,a)=>{a.d(t,{BT:()=>d,Wu:()=>c,X9:()=>l,ZB:()=>o,Zp:()=>n,aR:()=>i,wL:()=>u});var s=a(90508);a(1856);var r=a(24377);function n(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card",className:(0,r.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...a})}function i(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...a})}function o(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("leading-none font-semibold",t),...a})}function d(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-description",className:(0,r.cn)("text-muted-foreground text-sm",t),...a})}function l(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-action",className:(0,r.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",t),...a})}function c(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-6",t),...a})}function u(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-footer",className:(0,r.cn)("flex items-center px-6 [.border-t]:pt-6",t),...a})}},67712:(e,t,a)=>{a.d(t,{q:()=>o});var s=a(55036);let r={debug:0,info:1,warn:2,error:3},n=s.env.NEXT_PUBLIC_LOG_LEVEL||"warn";function i(e){return r[e]>=r[n]}let o={debug:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),s=1;s<t;s++)a[s-1]=arguments[s];i("debug")&&console.debug("[Chorus] ".concat(e),...a)},info:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),s=1;s<t;s++)a[s-1]=arguments[s];i("info")&&console.info("[Chorus] ".concat(e),...a)},warn:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),s=1;s<t;s++)a[s-1]=arguments[s];i("warn")&&console.warn("[Chorus] ".concat(e),...a)},error:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),s=1;s<t;s++)a[s-1]=arguments[s];i("error")&&console.error("[Chorus] ".concat(e),...a)}}},88064:(e,t,a)=>{a.d(t,{J:()=>i});var s=a(90508);a(1856);var r=a(58057),n=a(24377);function i(e){let{className:t,...a}=e;return(0,s.jsx)(r.Root,{"data-slot":"label",className:(0,n.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...a})}},91846:(e,t,a)=>{a.d(t,{bq:()=>u,eb:()=>p,gC:()=>m,l6:()=>l,yv:()=>c});var s=a(90508);a(1856);var r=a(17730),n=a(60532),i=a(89967),o=a(48218),d=a(24377);function l(e){let{...t}=e;return(0,s.jsx)(o.Root,{"data-slot":"select",...t})}function c(e){let{...t}=e;return(0,s.jsx)(o.Value,{"data-slot":"select-value",...t})}function u(e){let{className:t,size:a="default",children:n,...i}=e;return(0,s.jsxs)(o.Trigger,{"data-slot":"select-trigger","data-size":a,className:(0,d.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...i,children:[n,(0,s.jsx)(o.Icon,{asChild:!0,children:(0,s.jsx)(r.A,{className:"size-4 opacity-50"})})]})}function m(e){let{className:t,children:a,position:r="item-aligned",align:n="center",...i}=e;return(0,s.jsx)(o.Portal,{children:(0,s.jsxs)(o.Content,{"data-slot":"select-content",className:(0,d.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,align:n,...i,children:[(0,s.jsx)(g,{}),(0,s.jsx)(o.Viewport,{className:(0,d.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),(0,s.jsx)(x,{})]})})}function p(e){let{className:t,children:a,...r}=e;return(0,s.jsxs)(o.Item,{"data-slot":"select-item",className:(0,d.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...r,children:[(0,s.jsx)("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,s.jsx)(o.ItemIndicator,{children:(0,s.jsx)(n.A,{className:"size-4"})})}),(0,s.jsx)(o.ItemText,{children:a})]})}function g(e){let{className:t,...a}=e;return(0,s.jsx)(o.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:(0,d.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,s.jsx)(i.A,{className:"size-4"})})}function x(e){let{className:t,...a}=e;return(0,s.jsx)(o.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:(0,d.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,s.jsx)(r.A,{className:"size-4"})})}},93810:(e,t,a)=>{a.d(t,{eZ:()=>s,kl:()=>r,lp:()=>n});let s=["idea","proposal","document","task","project"],r=["read","write","admin"],n=s.flatMap(e=>r.map(t=>"".concat(e,":").concat(t)))},97778:(e,t,a)=>{a.d(t,{I:()=>r});var s=a(52217);let r=(0,s.createServerReference)("409416a9a40d3f468437edaa5351370e8ab6f95386",s.callServer,void 0,s.findSourceMapURL,"createAgentAndKeyAction")}}]);