@chorus-aidlc/chorus 0.9.2 → 0.9.4
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.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-build-manifest.json +321 -302
- package/.next/standalone/.next/app-path-routes-manifest.json +31 -31
- package/.next/standalone/.next/build-manifest.json +5 -5
- package/.next/standalone/.next/prerender-manifest.json +24 -24
- package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/activity/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/[ideaUuid]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/ideas/[ideaUuid]/page.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/ideas/[ideaUuid]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/ideas/[ideaUuid]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/ideas/page.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/ideas/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/ideas/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page.js +2 -2
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page.js +2 -2
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/settings/page.js +3 -3
- package/.next/standalone/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
- package/.next/standalone/.next/server/app/admin/companies/[uuid]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/admin/companies/new/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/admin/companies/new.html +1 -1
- package/.next/standalone/.next/server/app/admin/companies/new.rsc +2 -2
- package/.next/standalone/.next/server/app/admin/companies/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/admin/companies.html +1 -1
- package/.next/standalone/.next/server/app/admin/companies.rsc +2 -2
- package/.next/standalone/.next/server/app/admin/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/admin.html +1 -1
- package/.next/standalone/.next/server/app/admin.rsc +2 -2
- package/.next/standalone/.next/server/app/api/admin/companies/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/admin/companies/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/admin/login/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/admin/session/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/agents/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/agents/[uuid]/sessions/route.js +1 -1
- package/.next/standalone/.next/server/app/api/agents/[uuid]/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agents/[uuid]/sessions/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/api-keys/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/api-keys/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/callback/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/check-default/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/company-oidc/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/default-login/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/identify/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/me/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/refresh/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/session/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/sync-token/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/comments/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/documents/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/events/notifications/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/events/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/claim/route.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/claim/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/claim/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/preview/route.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/preview/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/preview/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/route.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/release/route.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/release/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/release/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/mcp/route.js +3 -3
- package/.next/standalone/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/mcp/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/me/assignments/route.js +1 -1
- package/.next/standalone/.next/server/app/api/me/assignments/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/me/assignments/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/mentionables/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/notifications/[uuid]/archive/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/notifications/[uuid]/read/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/notifications/preferences/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/notifications/read-all/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/notifications/unread-count/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/project-groups/[uuid]/dashboard/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/project-groups/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/project-groups/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/activity/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/available/route.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/available/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/available/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/documents/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/group/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/route.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/tracker/route.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/tracker/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/tracker/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/[proposalUuid]/validate/route.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/[proposalUuid]/validate/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/route.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/summary/route.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/summary/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/stats/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/dependencies/route.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/dependencies/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/dependencies/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/route.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/proposals/[uuid]/approve/route.js +1 -1
- package/.next/standalone/.next/server/app/api/proposals/[uuid]/approve/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/proposals/[uuid]/close/route.js +1 -1
- package/.next/standalone/.next/server/app/api/proposals/[uuid]/close/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/proposals/[uuid]/reject/route.js +1 -1
- package/.next/standalone/.next/server/app/api/proposals/[uuid]/reject/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/proposals/[uuid]/revoke/route.js +1 -1
- package/.next/standalone/.next/server/app/api/proposals/[uuid]/revoke/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/proposals/[uuid]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/proposals/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/sessions/[uuid]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/sessions/[uuid]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/sessions/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/claim/route.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/claim/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/claim/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/[dependsOnUuid]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/[dependsOnUuid]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/[dependsOnUuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/route.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/release/route.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/release/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/release/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/sessions/route.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/sessions/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +2 -2
- package/.next/standalone/.next/server/app/login/admin/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/login/admin.html +1 -1
- package/.next/standalone/.next/server/app/login/admin.rsc +2 -2
- package/.next/standalone/.next/server/app/login/callback/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/login/callback.html +1 -1
- package/.next/standalone/.next/server/app/login/callback.rsc +2 -2
- package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/login/pick-workspace/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/login/pick-workspace.html +1 -1
- package/.next/standalone/.next/server/app/login/pick-workspace.rsc +2 -2
- package/.next/standalone/.next/server/app/login/silent-refresh/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/login/silent-refresh.html +1 -1
- package/.next/standalone/.next/server/app/login/silent-refresh.rsc +2 -2
- package/.next/standalone/.next/server/app/login.html +1 -1
- package/.next/standalone/.next/server/app/login.rsc +2 -2
- package/.next/standalone/.next/server/app/onboarding/page.js +2 -32
- package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/onboarding.html +1 -1
- package/.next/standalone/.next/server/app/onboarding.rsc +3 -3
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects.html +1 -1
- package/.next/standalone/.next/server/app/projects.rsc +3 -3
- package/.next/standalone/.next/server/app/settings.html +1 -1
- package/.next/standalone/.next/server/app/settings.rsc +4 -4
- package/.next/standalone/.next/server/app-paths-manifest.json +31 -31
- package/.next/standalone/.next/server/chunks/1165.js +1 -1
- package/.next/standalone/.next/server/chunks/1615.js +31 -0
- package/.next/standalone/.next/server/chunks/1871.js +1 -1
- package/.next/standalone/.next/server/chunks/2618.js +1 -1
- package/.next/standalone/.next/server/chunks/2961.js +1 -1
- package/.next/standalone/.next/server/chunks/2990.js +1 -1
- package/.next/standalone/.next/server/chunks/5491.js +1 -1
- package/.next/standalone/.next/server/chunks/5561.js +7 -0
- package/.next/standalone/.next/server/chunks/6113.js +1 -1
- package/.next/standalone/.next/server/chunks/{6320.js → 7063.js} +1 -1
- package/.next/standalone/.next/server/chunks/7228.js +2 -2
- package/.next/standalone/.next/server/chunks/7368.js +1 -1
- package/.next/standalone/.next/server/chunks/7578.js +2 -2
- package/.next/standalone/.next/server/chunks/896.js +1 -0
- package/.next/standalone/.next/server/chunks/920.js +1 -1
- package/.next/standalone/.next/server/chunks/937.js +1 -1
- package/.next/standalone/.next/server/chunks/9508.js +2 -2
- package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/.next/standalone/.next/server/middleware-manifest.json +1 -1
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/16984-8ab5580b8e63a200.js +1 -0
- package/.next/standalone/.next/static/chunks/19898-2a3d83a3996794cd.js +1 -0
- package/.next/standalone/.next/static/chunks/20051-d9233fd4578d66cc.js +1 -0
- package/.next/standalone/.next/static/chunks/35486-592daa5c9fdf701d.js +1 -0
- package/.next/standalone/.next/static/chunks/{4860.60152a625f2a714f.js → 4860.1bebb2a898b170f6.js} +1 -1
- package/.next/standalone/.next/static/chunks/52206-6048525f57a21502.js +1 -0
- package/.next/standalone/.next/static/chunks/55469-ed5ff019ff71ef59.js +1 -0
- package/.next/standalone/.next/static/chunks/59296-4fa84fe82e2c7789.js +1 -0
- package/.next/standalone/.next/static/chunks/66205-8d7eae6a0f0a032d.js +1 -0
- package/.next/standalone/.next/static/chunks/{86944-95f8c67fb7a51911.js → 70093-0ff6fd59445b5cb9.js} +1 -1
- package/.next/standalone/.next/static/chunks/94655-1c75e0590a66215e.js +1 -0
- package/.next/standalone/.next/static/chunks/95627-8d9f6d2d88f7a641.js +1 -0
- package/.next/standalone/.next/static/chunks/{99373.4d93aaaf56fe7819.js → 99373.13c8ac5da1ddabe9.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/{layout-dd7eb66bb4ffd252.js → layout-b55a8d6d9bd27276.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/dashboard/{page-6d92b9867caf0fe1.js → page-fd10bca891f0f73a.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/{page-f8f17f58cf779d37.js → page-2e000a7010d1e9ea.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/page-75e42d130404ca2b.js +1 -0
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/ideas/[ideaUuid]/page-6a38c21b164cdc07.js +1 -0
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/ideas/page-48c840cb3011bf97.js +1 -0
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page-7ec535fac7bbc75d.js +1 -0
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/page-8f91ed174c14d5f0.js +1 -0
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page-f6814f25bbacdbea.js +1 -0
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/page-92e8980da0d98d48.js +1 -0
- package/.next/standalone/.next/static/chunks/app/(dashboard)/settings/{page-db79d84fa8ca8cbf.js → page-ab87cbb18d0ee538.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/onboarding/page-922a196db6eb2385.js +1 -0
- package/.next/standalone/.next/static/chunks/{webpack-8e0df5e10bc6b98f.js → webpack-4a8c75a0d40c2106.js} +1 -1
- package/.next/standalone/.next/static/css/bfe962487ee66da7.css +1 -0
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/public/chorus-plugin/.claude-plugin/plugin.json +1 -1
- package/.next/standalone/public/chorus-plugin/skills/brainstorm/SKILL.md +7 -7
- package/.next/standalone/public/chorus-plugin/skills/chorus/SKILL.md +1 -1
- package/.next/standalone/public/chorus-plugin/skills/develop/SKILL.md +1 -1
- package/.next/standalone/public/chorus-plugin/skills/idea/SKILL.md +32 -33
- package/.next/standalone/public/chorus-plugin/skills/openspec-aware/SKILL.md +1 -1
- package/.next/standalone/public/chorus-plugin/skills/proposal/SKILL.md +13 -4
- package/.next/standalone/public/chorus-plugin/skills/quick-dev/SKILL.md +9 -4
- package/.next/standalone/public/chorus-plugin/skills/review/SKILL.md +1 -1
- package/.next/standalone/public/chorus-plugin/skills/yolo/SKILL.md +9 -6
- package/.next/standalone/public/install-codex.sh +200 -90
- package/.next/standalone/public/skill/brainstorm-chorus/SKILL.md +7 -7
- package/.next/standalone/public/skill/chorus/SKILL.md +55 -3
- package/.next/standalone/public/skill/develop-chorus/SKILL.md +2 -2
- package/.next/standalone/public/skill/idea-chorus/SKILL.md +32 -33
- package/.next/standalone/public/skill/package.json +21 -5
- package/.next/standalone/public/skill/proposal-chorus/SKILL.md +13 -4
- package/.next/standalone/public/skill/proposal-reviewer-chorus/SKILL.md +198 -0
- package/.next/standalone/public/skill/quick-dev-chorus/SKILL.md +9 -4
- package/.next/standalone/public/skill/review-chorus/SKILL.md +13 -3
- package/.next/standalone/public/skill/task-reviewer-chorus/SKILL.md +219 -0
- package/.next/standalone/public/skill/yolo-chorus/SKILL.md +531 -0
- package/.next/standalone/public/test-install-codex.sh +4 -0
- package/package.json +1 -1
- package/prisma/migrations/20260604130604_add_elaboration_round_is_appended/migration.sql +2 -0
- package/prisma/schema.prisma +2 -1
- package/.next/standalone/.next/server/chunks/1002.js +0 -1
- package/.next/standalone/.next/server/chunks/1854.js +0 -7
- package/.next/standalone/.next/server/chunks/6878.js +0 -1
- package/.next/standalone/.next/static/chunks/19898-7e07c69b635e3662.js +0 -1
- package/.next/standalone/.next/static/chunks/29660-edf78f7a4c65f416.js +0 -1
- package/.next/standalone/.next/static/chunks/34775-387b9a9967a35ccb.js +0 -1
- package/.next/standalone/.next/static/chunks/35486-1978488574385a45.js +0 -1
- package/.next/standalone/.next/static/chunks/4457-b86052b2e954e357.js +0 -1
- package/.next/standalone/.next/static/chunks/52206-51a89715ca643e44.js +0 -1
- package/.next/standalone/.next/static/chunks/53298-82b9c818cd70686d.js +0 -1
- package/.next/standalone/.next/static/chunks/65642-e75efce9967747bc.js +0 -1
- package/.next/standalone/.next/static/chunks/75444-976ac95fd66e7988.js +0 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/page-83e2e42b27132b41.js +0 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/ideas/[ideaUuid]/page-55148db4b28ee5f5.js +0 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/ideas/page-556c181809c9e4f6.js +0 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page-656797940b35b23c.js +0 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/page-af88aeaedc3f4ae5.js +0 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page-6524ab00e6cdf59a.js +0 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/page-7b0bb5f037cd320b.js +0 -1
- package/.next/standalone/.next/static/chunks/app/onboarding/page-7a00689ba561c111.js +0 -1
- package/.next/standalone/.next/static/css/ea3f196c7951f8d6.css +0 -1
- /package/.next/standalone/.next/static/{-kClYg0a7zvFcgkw_LnG7 → YJZurE1onX9K-RDNIplc5}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{-kClYg0a7zvFcgkw_LnG7 → YJZurE1onX9K-RDNIplc5}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[85e3],{5725:(e,t,s)=>{"use strict";s.d(t,{b:()=>d});var a=s(1856),n=s(93367),l=s(90508),i="horizontal",r=["horizontal","vertical"],c=a.forwardRef((e,t)=>{var s;let{decorative:a,orientation:c=i,...d}=e,o=(s=c,r.includes(s))?c:i;return(0,l.jsx)(n.sG.div,{"data-orientation":o,...a?{role:"none"}:{"aria-orientation":"vertical"===o?o:void 0,role:"separator"},...d,ref:t})});c.displayName="Separator";var d=c},13257:(e,t,s)=>{"use strict";s.d(t,{IdeaTracker:()=>eK});var a=s(90508),n=s(39268),l=s(1856),i=s(5616),r=s(22922),c=s(81531),d=s(36755),o=s(29767),x=s(57223),u=s(63964),p=s(17730),m=s(78948),h=s(81750),f=s(96213),g=s(38106);let j={open:"open",researching:"researching",answer_questions:"answerQuestions",planning:"planning",review_proposal:"reviewProposal",building:"building",verify_work:"verifyWork",done:"done",closed:"closed"},v={open:"text-[#888780]",researching:"text-[#7F77DD]",answer_questions:"text-[#C47A20]",planning:"text-[#7F77DD]",review_proposal:"text-[#C47A20]",building:"text-[#7F77DD]",verify_work:"text-[#C47A20]",done:"text-[#1D9E75]",closed:"text-[#888780]"};function b(e){let{idea:t,onClick:s}=e,l=(0,n.c)("ideaTracker"),i=t.badgeHint?j[t.badgeHint]:null,r=t.badgeHint&&v[t.badgeHint]||"text-[#888780]";return(0,a.jsxs)("div",{className:"flex items-center justify-between px-3.5 py-3 transition-colors ".concat(s?"cursor-pointer hover:bg-[#FAF8F4]":""),onClick:s?()=>s(t.uuid):void 0,children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2.5",children:[(0,a.jsx)("span",{className:"shrink-0 text-[11px] text-[#B4B2A9]",children:"IDEA"}),(0,a.jsx)("span",{className:"truncate text-[13px] text-[#2C2C2A]",children:t.title}),i&&(0,a.jsx)("span",{className:"shrink-0 rounded bg-[#F0EEEA] px-1.5 py-0.5 text-[11px] ".concat(r),children:l("badge.".concat(i))})]}),(0,a.jsx)("span",{className:"shrink-0 pl-4 text-[12px] text-[#888780]",children:(0,g.s)(t.createdAt)})]})}let N={human_conduct_required:{fill:"#7F77DD"},in_progress:{fill:"#378ADD"},todo:{stroke:"#888780"},done:{fill:"#1D9E75"}},A={todo:"todo",in_progress:"inProgress",human_conduct_required:"humanConductRequired",done:"done"};function y(e){let{status:t,ideas:s,defaultOpen:i=!0,onIdeaClick:r}=e,c=(0,n.c)("ideaTracker"),d=s.length>0,[o,x]=(0,l.useState)(!!d&&i),u=A[t]||"todo",g=N[t]||N.todo;return(0,a.jsxs)(h.Nt,{open:o,onOpenChange:x,children:[(0,a.jsxs)(h.R6,{className:"group flex w-full cursor-pointer items-center gap-2 px-0 pb-1.5 pt-0",children:[o?(0,a.jsx)(p.A,{className:"h-3.5 w-3.5 shrink-0 text-[#888780] transition-colors group-hover:text-[#2C2C2A]"}):(0,a.jsx)(m.A,{className:"h-3.5 w-3.5 shrink-0 text-[#888780] transition-colors group-hover:text-[#2C2C2A]"}),(0,a.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:g.fill,border:g.stroke?"1.5px solid ".concat(g.stroke):void 0}}),(0,a.jsx)("span",{className:"text-[13px] font-medium transition-colors group-hover:text-[#2C2C2A] ".concat(d?"text-[#5F5E5A]":"text-[#B4B2A9]"),children:c("status.".concat(u))}),(0,a.jsx)("span",{className:"text-[12px] text-[#888780] transition-colors group-hover:text-[#2C2C2A]",children:s.length})]}),d&&(0,a.jsx)(h.Ke,{children:(0,a.jsx)("div",{className:"overflow-hidden rounded-lg bg-white",children:s.map((e,t)=>(0,a.jsxs)("div",{children:[t>0&&(0,a.jsx)("div",{className:"mx-0 h-px bg-[#F0EEEA]"}),(0,a.jsx)(f.D,{entityType:"idea",entityUuid:e.uuid,badgeInside:!0,children:(0,a.jsx)(b,{idea:e,onClick:r})})]},e.uuid))})})]})}let C=["human_conduct_required","in_progress","todo","done"];function w(e){var t;let{projectUuid:s,initialData:c,onIdeaClick:p,onNewIdea:m,onEmptyChange:h}=e,f=(0,n.c)("ideaTracker"),[g,j]=(0,l.useState)(null!=(t=null==c?void 0:c.groups)?t:{}),[v,b]=(0,l.useState)(!c),[N,A]=(0,l.useState)(null),w=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/projects/".concat(s,"/ideas/tracker")),t=await e.json();t.success&&t.data?(j(t.data.groups),A(null)):A(t.error||f("error.loadFailed"))}catch(e){A(f("error.loadFailed"))}finally{b(!1)}},[s,f]);(0,u.eV)("idea",w),(0,u.eV)("proposal",w),(0,u.eV)("task",w),(0,l.useEffect)(()=>{c||w()},[w,c]);let k=C.reduce((e,t)=>e+(g[t]||[]).length,0);return((0,l.useEffect)(()=>{v||null==h||h(0===k)},[k,v,h]),v)?(0,a.jsx)("div",{className:"space-y-4",children:[1,2,3].map(e=>(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(x.E,{className:"h-5 w-32"}),(0,a.jsx)(x.E,{className:"h-12 w-full rounded-lg"}),(0,a.jsx)(x.E,{className:"h-12 w-full rounded-lg"})]},e))}):N&&0===Object.keys(g).length?(0,a.jsxs)("div",{className:"flex flex-col items-center gap-4 py-16",children:[(0,a.jsx)(d.A,{className:"h-10 w-10 text-[#E65100]"}),(0,a.jsx)("p",{className:"text-[13px] text-[#6B6B6B]",children:N}),(0,a.jsx)(r.$,{variant:"outline",size:"sm",onClick:()=>{b(!0),A(null),w()},className:"border-[#E5E0D8] text-[#2C2C2C]",children:f("actions.retry")})]}):0===k?(0,a.jsxs)("div",{className:"flex min-h-[60vh] flex-col items-center justify-center gap-3",children:[(0,a.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-[#F5F2EC]",children:(0,a.jsx)(o.A,{className:"h-5 w-5 text-[#B4B2A9]"})}),(0,a.jsx)("p",{className:"text-[13px] font-medium text-[#6B6B6B]",children:f("empty.noIdeas")}),(0,a.jsx)("p",{className:"max-w-[260px] text-center text-[12px] leading-relaxed text-[#9A9A9A]",children:f("empty.getStarted")}),m&&(0,a.jsxs)(r.$,{onClick:m,size:"sm",className:"mt-2 gap-1.5 rounded-md bg-[#C67A52] px-4 py-2 text-white hover:bg-[#B56A42]",children:[(0,a.jsx)(i.A,{className:"h-4 w-4"}),f("actions.newIdea")]})]}):(0,a.jsxs)("div",{className:"space-y-4",children:[N&&Object.keys(g).length>0&&(0,a.jsx)("div",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-[12px] text-destructive",children:N}),(0,a.jsx)("div",{className:"space-y-4",children:C.map(e=>{let t=g[e]||[];return 0===t.length?null:(0,a.jsx)(y,{status:e,ideas:t,defaultOpen:"done"!==e,onIdeaClick:p},e)})})]})}var k=s(12790),E=s.n(k),F=s(48416),B=s(90795),S=s(85226),D=s(18789),_=s(71921),T=s(56770);let U=[{key:"todo",bg:"#E65100"},{key:"inProgress",bg:"#5A9E6F"},{key:"toVerify",bg:"#7B1FA2"},{key:"done",bg:"#00796B"}],M={idea:"bg-[#C67A52]",task:"bg-[#5A9E6F]",proposal:"bg-[#1976D2]",document:"bg-[#9A9A9A]"};function R(e){let{projectUuid:t,initialData:s}=e,i=(0,n.c)(),r=(0,n.c)("ideaTracker"),[c,d]=(0,l.useState)(null!=s?s:null),[x,p]=(0,l.useState)(!s),m=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/projects/".concat(t,"/stats"));if(!e.ok)return;let s=await e.json();s.success&&d(s.data)}finally{p(!1)}},[t]);if((0,l.useEffect)(()=>{s||m()},[m,s]),(0,u.eV)(["idea","task","proposal","document"],m),x)return(0,a.jsx)("div",{className:"flex items-center justify-center py-20",children:(0,a.jsx)(S.A,{className:"h-6 w-6 animate-spin text-[#9A9A9A]"})});if(!c)return null;let{stats:h,recentActivities:f}=c,g=[{label:r("stats.totalIdeas"),value:h.ideas.total,badge:h.ideas.open>0?r("stats.openCount",{count:h.ideas.open}):null,badgeStyle:"bg-[#C67A5220] text-[#C67A52]",href:"/projects/".concat(t,"/ideas"),iconBg:"bg-[#FFF3E0]",icon:(0,a.jsx)(o.A,{className:"h-5 w-5 text-[#E65100]"})},{label:r("stats.totalTasks"),value:h.tasks.total,badge:h.tasks.inProgress>0?r("stats.activeCount",{count:h.tasks.inProgress}):null,badgeStyle:"bg-[#5A9E6F20] text-[#5A9E6F]",href:"/projects/".concat(t,"/tasks"),iconBg:"bg-[#E3F2FD]",icon:(0,a.jsx)(D.A,{className:"h-5 w-5 text-[#1976D2]"})},{label:r("stats.totalProposals"),value:h.proposals.total,badge:h.proposals.pending>0?r("stats.pendingCount",{count:h.proposals.pending}):null,badgeStyle:"bg-[#C67A5220] text-[#C67A52]",href:"/projects/".concat(t,"/proposals"),iconBg:"bg-[#F3E5F5]",icon:(0,a.jsx)(_.A,{className:"h-5 w-5 text-[#7B1FA2]"})},{label:r("stats.totalDocuments"),value:h.documents.total,badge:null,badgeStyle:"",href:"/projects/".concat(t,"/documents"),iconBg:"bg-[#E8F5E9]",icon:(0,a.jsx)(T.A,{className:"h-5 w-5 text-[#5A9E6F]"})}],j=[h.tasks.todo,h.tasks.inProgress,h.tasks.toVerify,h.tasks.done],v=h.tasks.total,b=[{label:r("stats.todoCount",{count:h.tasks.todo}),color:"#E65100"},{label:r("stats.inProgressCount",{count:h.tasks.inProgress}),color:"#5A9E6F"},{label:r("stats.toVerifyCount",{count:h.tasks.toVerify}),color:"#7B1FA2"},{label:r("stats.doneCount",{count:h.tasks.done}),color:"#00796B"}];return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3 md:gap-4 lg:grid-cols-4",children:g.map(e=>(0,a.jsx)(E(),{href:e.href,children:(0,a.jsxs)(F.Zp,{className:"cursor-pointer rounded-2xl border-0 bg-white p-3 shadow-none transition-all hover:shadow-md md:p-5",children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between md:mb-3.5",children:[(0,a.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg md:h-10 md:w-10 md:rounded-xl ".concat(e.iconBg),children:e.icon}),e.badge&&(0,a.jsx)("span",{className:"hidden rounded-lg px-2.5 py-1 text-[11px] font-medium sm:inline ".concat(e.badgeStyle),children:e.badge})]}),(0,a.jsx)("div",{className:"text-2xl font-semibold leading-none tracking-tight text-[#2C2C2C] md:text-[32px]",children:e.value}),(0,a.jsx)("div",{className:"mt-0.5 text-[12px] text-[#6B6B6B] md:text-[13px]",children:e.label})]})},e.label))}),(0,a.jsxs)("div",{className:"grid min-h-0 gap-5 lg:grid-cols-2",children:[(0,a.jsxs)(F.Zp,{className:"flex flex-col rounded-2xl border-0 bg-white p-6 shadow-none",children:[(0,a.jsxs)("div",{className:"mb-5 flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-[16px] font-semibold text-[#2C2C2C]",children:r("stats.taskPipeline")}),(0,a.jsx)("span",{className:"text-[12px] text-[#9A9A9A]",children:r("stats.totalCount",{count:v})})]}),v>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-5 flex h-3 w-full overflow-hidden rounded-md",children:j.map((e,t)=>e>0?(0,a.jsx)("div",{className:"h-full",style:{width:"".concat(e/v*100,"%"),backgroundColor:U[t].bg}},U[t].key):null)}),(0,a.jsx)("div",{className:"flex flex-wrap gap-5",children:b.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("div",{className:"h-2.5 w-2.5 rounded-sm",style:{backgroundColor:e.color}}),(0,a.jsx)("span",{className:"text-[12px] text-[#6B6B6B]",children:e.label})]},e.color))})]}):(0,a.jsx)("div",{className:"flex flex-1 items-center justify-center py-10 text-[13px] text-[#9A9A9A]",children:r("stats.noTasks")})]}),(0,a.jsxs)(F.Zp,{className:"flex flex-col rounded-2xl border-0 bg-white p-6 shadow-none",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-[16px] font-semibold text-[#2C2C2C]",children:r("stats.recentActivity")}),(0,a.jsx)(E(),{href:"/projects/".concat(t,"/activity"),className:"text-[12px] font-medium text-[#C67A52] hover:underline",children:r("stats.viewAll")})]}),f.length>0?(0,a.jsx)("div",{className:"flex flex-col",children:f.map((e,t)=>{let s=M[e.targetType]||"bg-[#9A9A9A]";return(0,a.jsxs)("div",{className:"flex items-start gap-3 py-3 ".concat(t<f.length-1?"border-b border-[#F5F2EC]":""),children:[(0,a.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full ".concat(s)}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"text-[13px] text-[#2C2C2C]",children:[e.actorName," ",e.action]}),(0,a.jsx)("span",{className:"text-[11px] text-[#9A9A9A]",children:(0,B.fw)(e.createdAt,i)})]})]},e.uuid)})}):(0,a.jsx)("div",{className:"flex flex-1 items-center justify-center py-10 text-[13px] text-[#9A9A9A]",children:r("stats.noActivity")})]})]})]})}var P=s(23675),z=s(95900),I=s(57893),L=s(9160),q=s(94903),$=s(97413),V=s(64993),O=s(57731),H=s(14554),J=s(15972),G=s(88064),K=s(51817),Z=s(5425),Q=s(84247),W=s(62929),X=s(27939),Y=s(97261),ee=s(16544),et=s(65626),es=s(73693);function ea(e){let{assignee:t}=e,s=(0,n.c)("common");return(0,a.jsxs)("div",{children:[(0,a.jsx)(G.J,{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:s("assignee")}),(0,a.jsx)("div",{className:"mt-2 flex items-center gap-2.5 rounded-lg bg-[#FAF8F4] p-3",children:t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(es.eu,{className:"h-7 w-7",children:(0,a.jsx)(es.q5,{className:"agent"===t.type?"bg-[#C67A52] text-white":"bg-[#E5E0D8] text-[#6B6B6B]",children:"agent"===t.type?(0,a.jsx)(Z.A,{className:"h-3.5 w-3.5"}):t.name.charAt(0).toUpperCase()})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm font-medium text-[#2C2C2C]",children:t.name}),(0,a.jsx)("div",{className:"text-xs text-[#6B6B6B]",children:s("agent"===t.type?"agent":"user")})]})]}):(0,a.jsx)("span",{className:"text-sm text-[#9A9A9A]",children:s("unassigned")})})]})}function en(e){let{idea:t,onRefresh:s}=e,i=(0,n.c)("ideaTracker"),r=(0,n.c)("common"),[c,d]=(0,l.useState)(null),[o,x]=(0,l.useState)(!0),p=(0,l.useCallback)(async()=>{let e=await (0,X.z)(t.uuid);e.success&&e.data&&d(e.data),x(!1)},[t.uuid]);(0,l.useEffect)(()=>{p()},[p]),(0,u.eV)("idea",p);let m=async()=>{await p(),await s()};return o?(0,a.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,a.jsx)(S.A,{className:"h-5 w-5 animate-spin text-[#C67A52]"})}):(0,a.jsxs)(ee.P.div,{variants:et.qG,initial:"initial",animate:"animate",children:[(0,a.jsx)(ea,{assignee:t.assignee}),(0,a.jsx)(Q.Separator,{className:"my-5 bg-[#F5F2EC]"}),c&&c.rounds.length>0?(0,a.jsx)("div",{children:(0,a.jsx)(W.R,{ideaUuid:t.uuid,elaboration:c,onRefresh:m})}):"open"===t.status?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-8 text-center",children:[(0,a.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#FFF3E0]",children:(0,a.jsx)(Z.A,{className:"h-5 w-5 text-[#E65100]"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-[#2C2C2C]",children:i("panel.elaborationNotStarted")}),(0,a.jsx)("p",{className:"mt-1 text-xs text-[#9A9A9A]",children:i("panel.elaborationNotStartedDesc")})]})]}):(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-8 text-center",children:[(0,a.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#E3F2FD]",children:(0,a.jsx)(Z.A,{className:"h-5 w-5 text-[#1976D2]"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-[#2C2C2C]",children:i("panel.elaborationWaiting")}),(0,a.jsx)("p",{className:"mt-1 text-xs text-[#9A9A9A]",children:i("panel.elaborationWaitingDesc")})]})]}),t.content&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Q.Separator,{className:"my-5 bg-[#F5F2EC]"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(G.J,{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:r("content")}),(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)(Y.MarkdownContent,{children:t.content})})})]})]})]})}var el=s(37915),ei=s(32470),er=s(47754),ec=s(92745);function ed(e){return e.replace(/\\n/g,"\n")}let eo={prd:"typePrd",tech_design:"typeTechDesign",adr:"typeAdr",spec:"typeSpec",guide:"typeGuide",design:"typeDesign",note:"typeNote",report:"typeReport",other:"typeOther"};var ex=s(52217);let eu=(0,ex.createServerReference)("60b39359b1beae82e742bfcfb453b7c6735582bcf3",ex.callServer,void 0,ex.findSourceMapURL,"getProposalsForIdeaAction"),ep=(0,ex.createServerReference)("60b2f7aadf5df20e5f9dc208c4ff5fb7a05a18afbe",ex.callServer,void 0,ex.findSourceMapURL,"getTasksForProposalAction");var em=s(67712);function eh(e){let{idea:t,projectUuid:s,onTaskClick:i,onDocClick:r,initialProposals:c}=e,d=(0,n.c)("ideaTracker"),[o,x]=(0,l.useState)(null!=c?c:[]),[p,m]=(0,l.useState)(!c),h=(0,l.useCallback)(async()=>{try{let e=await eu(s,t.uuid);if(e.success)return x(e.data),e.data}catch(e){em.q.error("Failed to fetch proposals:",e)}finally{m(!1)}return[]},[s,t.uuid]);(0,l.useEffect)(()=>{c||h()},[h,c]);let f=(0,l.useRef)(o);f.current=o;let{getPresence:g}=(0,er.xQ)();return((0,u.eV)("proposal",async()=>{let e=f.current;for(let l of(await h())){var t,s,a,n;let i=e.find(e=>e.uuid===l.uuid);if(!i)continue;let r=new Set((null!=(t=i.documentDrafts)?t:[]).map(e=>e.uuid)),c=new Set((null!=(s=i.taskDrafts)?s:[]).map(e=>e.uuid)),d=(null!=(a=l.documentDrafts)?a:[]).filter(e=>e.uuid&&!r.has(e.uuid)),o=(null!=(n=l.taskDrafts)?n:[]).filter(e=>e.uuid&&!c.has(e.uuid)),x=[...d.map(e=>e.uuid),...o.map(e=>e.uuid)];if(x.length>0){let e=g("proposal",l.uuid)[0];if(e)for(let t of x)(0,er.fv)({entityType:"proposal",entityUuid:l.uuid,subEntityType:"draft",subEntityUuid:t,agentUuid:e.agentUuid,agentName:e.agentName,action:"mutate"})}}}),p)?(0,a.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,a.jsx)(S.A,{className:"h-5 w-5 animate-spin text-[#C67A52]"})}):0===o.length?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[(0,a.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#F3E5F5]",children:(0,a.jsx)(_.A,{className:"h-5 w-5 text-[#7B1FA2]"})}),(0,a.jsx)("p",{className:"text-sm text-[#9A9A9A]",children:d("panel.noProposals")})]}):(0,a.jsx)("div",{className:"space-y-5",children:o.map(e=>(0,a.jsx)(eg,{proposal:e,projectUuid:s,onTaskClick:i,onDocClick:r},e.uuid))})}let ef={draft:"bg-[#F5F5F5] text-[#6B6B6B]",pending:"bg-[#FFF3E0] text-[#E65100]",approved:"bg-[#E8F5E9] text-[#5A9E6F]",rejected:"bg-[#FFEBEE] text-[#C4574C]",revised:"bg-[#E3F2FD] text-[#1976D2]",closed:"bg-[#F5F5F5] text-[#9A9A9A]"};function eg(e){let{proposal:t,projectUuid:s,onTaskClick:i,onDocClick:c}=e,d=(0,n.c)("ideaTracker"),o=(0,n.c)(),x=(0,n.c)("proposals"),u=(0,n.c)("tasks"),p=(0,n.c)("documents"),h=t.documentDrafts||[],g=t.taskDrafts||[],[j,v]=(0,l.useState)(new Set),[b,N]=(0,l.useState)("cards"),[A,y]=(0,l.useState)([]),C="approved"===t.status;(0,l.useEffect)(()=>{C&&ep(s,t.uuid).then(e=>{e.success&&y(e.data||[])}).catch(e=>em.q.error("Failed to fetch materialized tasks:",e))},[C,s,t.uuid]);let w=(0,l.useMemo)(()=>{let e=new Map;for(let t of A)e.set(t.title,t);return e},[A]),{dagTasks:k,dagEdges:F,dagHeight:B}=(0,l.useMemo)(()=>{let e=g.map(e=>{let t=w.get(e.title);return{uuid:(null==t?void 0:t.uuid)||e.uuid,title:e.title,status:(null==t?void 0:t.status)||"open",priority:e.priority||"medium"}}),t=[],s=new Map(g.map(e=>[e.uuid,e]));for(let e of g)if(e.dependsOnDraftUuids)for(let a of e.dependsOnDraftUuids){let n=w.get(e.title),l=s.get(a),i=l?w.get(l.title):void 0;t.push({from:(null==n?void 0:n.uuid)||e.uuid,to:(null==i?void 0:i.uuid)||a})}return{dagTasks:e,dagEdges:t,dagHeight:Math.max(350,90*e.length)}},[g,w]),S=C?A.filter(e=>"done"===e.status||"closed"===e.status).length:0;return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"text-[14px] font-semibold text-[#2C2C2C] truncate flex-1",children:t.title}),(0,a.jsx)(O.E,{className:"text-[11px] font-semibold border-0 shrink-0 ".concat(ef[t.status]||""),children:o("status.".concat(t.status))})]}),t.description&&(0,a.jsx)("div",{className:"max-h-[120px] overflow-y-auto text-[13px] leading-relaxed text-[#4A4A4A] prose prose-sm max-w-none [&_h1]:text-sm [&_h2]:text-[13px] [&_h3]:text-xs [&_p]:text-[13px] [&_p]:text-[#4A4A4A] [&_p]:my-1.5 [&_li]:text-[13px] [&_li]:text-[#4A4A4A] [&_ul]:my-1 [&_ol]:my-1 [&_strong]:text-[#2C2C2C]",children:(0,a.jsx)(Y.MarkdownContent,{children:ed(t.description)})}),(0,a.jsxs)(E(),{href:"/projects/".concat(s,"/proposals/").concat(t.uuid),className:"flex items-center gap-1 text-[13px] font-medium text-[#C67A52] hover:underline",children:[d("panel.viewProposal"),(0,a.jsx)(m.A,{className:"h-3.5 w-3.5"})]}),h.length>0&&(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-[#9A9A9A]",children:x(C?"documents":"documentDrafts")}),(0,a.jsx)("span",{className:"text-[11px] text-[#9A9A9A]",children:h.length})]}),(0,a.jsx)("div",{className:"space-y-0",children:h.map((e,s)=>(0,a.jsx)(f.D,{entityType:"proposal",entityUuid:t.uuid,subEntityType:"draft",subEntityUuid:e.uuid||"draft-".concat(s),badgeInside:!0,children:(0,a.jsxs)(r.$,{variant:"ghost",className:"w-full justify-start h-auto text-left flex items-center gap-2.5 py-3.5 hover:bg-[#FAF8F4] transition-colors cursor-pointer -mx-1 px-1 rounded-lg",onClick:()=>e.content&&(null==c?void 0:c({title:e.title,type:e.type,content:e.content})),children:[(0,a.jsx)(el.A,{className:"h-3.5 w-3.5 shrink-0 text-[#B4B2A9]"}),(0,a.jsx)(O.E,{variant:"outline",className:"shrink-0 text-[10px] font-medium border-[#E5E0D8] text-[#6B6B6B] bg-[#F5F2EC] px-2 py-0.5 font-mono",children:p(eo[e.type]||"typeOther")}),(0,a.jsx)("span",{className:"flex-1 min-w-0 text-left text-[13px] text-[#2C2C2A] truncate",children:e.title})]})},e.uuid||s))})]}),(g.length>0||A.length>0)&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between pb-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-[#9A9A9A]",children:x(C?"tasks":"taskDrafts")}),(0,a.jsx)("span",{className:"text-[11px] text-[#9A9A9A]",children:C&&A.length>0?A.length:g.length})]}),(0,a.jsxs)("span",{className:"text-[12px] text-[#9A9A9A]",children:[S,"/",C&&A.length>0?A.length:g.length]})]}),(0,a.jsx)("div",{className:"-mx-6 border-t border-[#E5E0D8]"}),F.length>0&&(0,a.jsxs)("div",{className:"flex gap-0.5 rounded-lg border border-[#E5E0D8] bg-[#F7F6F3] p-0.5 mt-3 w-fit",children:[(0,a.jsx)(r.$,{variant:"ghost",size:"sm",onClick:()=>N("cards"),className:"rounded-md px-2.5 py-1 h-auto text-[11px] font-medium transition-colors ".concat("cards"===b?"bg-white text-[#2C2C2C] shadow-sm":"text-[#9A9A9A] hover:text-[#6B6B6B]"),children:x("cardsView")}),(0,a.jsx)(r.$,{variant:"ghost",size:"sm",onClick:()=>N("dag"),className:"rounded-md px-2.5 py-1 h-auto text-[11px] font-medium transition-colors ".concat("dag"===b?"bg-white text-[#2C2C2C] shadow-sm":"text-[#9A9A9A] hover:text-[#6B6B6B]"),children:u("dagView")})]}),"cards"===b&&(0,a.jsx)("div",{className:"space-y-0",children:C&&A.length>0?A.map(e=>(0,a.jsx)(f.D,{entityType:"task",entityUuid:e.uuid,badgeInside:!0,children:(0,a.jsx)(eb,{task:{uuid:e.uuid,title:e.title},expanded:!1,onToggle:()=>{},onNavigate:i?()=>i(e.uuid):void 0,taskStatus:e.status})},e.uuid)):g.map((e,s)=>(0,a.jsx)(f.D,{entityType:"proposal",entityUuid:t.uuid,subEntityType:"draft",subEntityUuid:e.uuid,badgeInside:!0,children:(0,a.jsx)(eb,{task:e,expanded:j.has(s),onToggle:()=>{v(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t})}})},e.uuid))}),"dag"===b&&(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)(ec._u,{tasks:k,edges:F,readonly:!0,height:B,onNodeClick:i})})]}),0===h.length&&0===g.length&&0===A.length&&(0,a.jsx)("p",{className:"text-xs text-[#9A9A9A] italic",children:x("emptyContainer")})]})}let ej={open:"border-[#D9D9D9] bg-white",assigned:"border-[#1976D2] bg-[#1976D2]",in_progress:"border-[#5A9E6F] bg-[#5A9E6F]",to_verify:"border-[#7B1FA2] bg-[#7B1FA2]",done:"border-[#00796B] bg-[#00796B]",closed:"border-[#9A9A9A] bg-[#9A9A9A]"},ev={open:null,assigned:null,in_progress:{className:"bg-[#E8F5E9] text-[#5A9E6F]",key:"inProgress"},to_verify:{className:"bg-[#F3E5F5] text-[#7B1FA2]",key:"toVerify"},done:{className:"bg-[#E0F2F1] text-[#00796B]",key:"done"},closed:{className:"bg-[#F5F5F5] text-[#9A9A9A]",key:"done"}};function eb(e){let{task:t,expanded:s,onToggle:l,onNavigate:i,taskStatus:c}=e,d=(0,n.c)("proposals"),o=(0,n.c)("acceptanceCriteria"),x=(0,n.c)("status"),u=t.acceptanceCriteriaItems||[],h=!!(t.description||u.length>0),f=c?ej[c]||ej.open:"border-[#D9D9D9] bg-white",g=c?ev[c]:null,j=(0,a.jsx)("span",{className:"shrink-0 h-2 w-2 rounded-full border-[1.5px] ".concat(f," transition-colors")}),v=(0,a.jsx)("span",{className:"flex-1 min-w-0 text-[13px] leading-snug truncate text-[#6B6B6B]",children:t.title}),b=g?(0,a.jsx)("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium ".concat(g.className),children:x(g.key)}):null;return i?(0,a.jsxs)(r.$,{variant:"ghost",onClick:i,className:"w-full justify-start h-auto text-left flex items-center gap-2.5 py-4 cursor-pointer hover:bg-[#FAF8F4] -mx-1 px-1 rounded-lg transition-colors",children:[(0,a.jsx)(el.A,{className:"h-3.5 w-3.5 shrink-0 text-[#B4B2A9]"}),j,v,b]}):(0,a.jsxs)("div",{children:[(0,a.jsxs)(r.$,{variant:"ghost",onClick:h?l:void 0,className:"w-full justify-start h-auto text-left flex items-center gap-2.5 py-4 ".concat(h?"cursor-pointer hover:bg-[#FAF8F4] -mx-1 px-1 rounded-lg":""," transition-colors"),children:[s?(0,a.jsx)(p.A,{className:"h-3.5 w-3.5 shrink-0 text-[#B4B2A9]"}):(0,a.jsx)(m.A,{className:"h-3.5 w-3.5 shrink-0 text-[#B4B2A9]"}),j,v,b]}),s&&h&&(0,a.jsxs)("div",{className:"pb-3 pl-5 space-y-3",children:[t.description&&(0,a.jsx)("p",{className:"text-[11px] leading-relaxed text-[#6B6B6B]",children:t.description}),u.length>0&&(0,a.jsxs)("div",{className:"rounded-lg bg-[#FAF8F4] p-3 space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(ei.A,{className:"h-3.5 w-3.5 text-[#888780]"}),(0,a.jsx)("span",{className:"text-[11px] font-semibold text-[#2C2C2C]",children:d("taskAcceptanceCriteria")})]}),(0,a.jsx)("div",{className:"space-y-1.5",children:u.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsx)("p",{className:"text-[11px] leading-snug text-[#4A4A4A] flex-1",children:e.description}),!1!==e.required&&(0,a.jsx)("span",{className:"shrink-0 text-[10px] font-medium text-[#E65100]",children:o("required")})]},t))})]})]})]})}let eN=(0,s(66206).A)("message-square-text",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]);var eA=s(60532),ey=s(97964);let eC=(0,ex.createServerReference)("4082a8b6b8c78a86ea5c6b630e56b4b12d17d684f0",ex.callServer,void 0,ex.findSourceMapURL,"getElaborationAction");function ew(e){let{idea:t,proposals:s,tasks:i,onSelectTask:r}=e,c=(0,n.c)("ideaTracker"),d=(0,n.c)(),[x,u]=(0,l.useState)(null),[h,f]=(0,l.useState)(new Set);(0,l.useEffect)(()=>{"open"!==t.status&&eC(t.uuid).then(e=>{e.success&&e.data&&u(e.data)})},[t.uuid,t.status]);let g=(0,l.useMemo)(()=>"open"===t.status?"idea_created":"elaborating"===t.status||0===s.length?"elaboration":s.some(e=>"approved"===e.status)&&i.length>0?"tasks":"proposal",[t.status,s,i]),j=(0,l.useMemo)(()=>{let e=["idea_created","elaboration","proposal","tasks"],t=e.indexOf(g);return e.map((e,s)=>({id:e,labelKey:({idea_created:"panel.timeline.ideaCreated",elaboration:"panel.timeline.elaboration",proposal:"panel.timeline.proposal",tasks:"panel.timeline.tasksProgress"})[e],status:s<t?"completed":s===t?"active":"upcoming",icon:({idea_created:(0,a.jsx)(o.A,{className:"h-3.5 w-3.5"}),elaboration:(0,a.jsx)(eN,{className:"h-3.5 w-3.5"}),proposal:(0,a.jsx)(_.A,{className:"h-3.5 w-3.5"}),tasks:(0,a.jsx)(ei.A,{className:"h-3.5 w-3.5"})})[e]}))},[g]);(0,l.useEffect)(()=>{let e=j.find(e=>"active"===e.status);e&&f(new Set([e.id]))},[g]);let v=(0,l.useCallback)(e=>{f(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),b=(0,l.useMemo)(()=>"open"===t.status?c("panel.timeline.noElaboration"):"skipped"===t.elaborationStatus?c("panel.timeline.elaborationSkipped"):"resolved"===t.elaborationStatus&&x?c("panel.timeline.elaborationComplete",{count:x.summary.totalQuestions}):"elaborating"===t.status?c("panel.timeline.elaborationInProgress"):x&&x.summary.totalQuestions>0?c("panel.timeline.elaborationComplete",{count:x.summary.totalQuestions}):c("panel.timeline.noElaboration"),[t.status,t.elaborationStatus,x,c]),N=(0,l.useMemo)(()=>{if(0===s.length)return c("panel.timeline.noProposal");let e=s.filter(e=>"approved"===e.status).length,t=s.filter(e=>"pending"===e.status).length;if(e>0&&1===s.length)return c("panel.timeline.proposalApproved");if(e>0)return c("panel.timeline.proposalsApproved",{count:e,total:s.length});if(t>0)return c("panel.timeline.proposalPending");switch(s[0].status){case"draft":default:return c("panel.timeline.proposalDraft");case"rejected":return c("panel.timeline.proposalRejected")}},[s,c]),A=(0,l.useMemo)(()=>{let e=0,t=0;for(let r of s){var a,n,l,i;e+=null!=(l=null==(a=r.documentDrafts)?void 0:a.length)?l:0,t+=null!=(i=null==(n=r.taskDrafts)?void 0:n.length)?i:0}return{docCount:e,taskDraftCount:t}},[s]),y=(0,l.useMemo)(()=>{let e=i.filter(e=>"done"===e.status||"closed"===e.status).length,t=i.filter(e=>"in_progress"===e.status).length;return{done:e,inProgress:t,toVerify:i.filter(e=>"to_verify"===e.status).length,open:i.filter(e=>"open"===e.status||"assigned"===e.status).length,total:i.length}},[i]);return(0,a.jsx)("div",{className:"space-y-0",children:j.map((e,n)=>{let l=h.has(e.id),o=n===j.length-1;return(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center w-5 shrink-0",children:[(0,a.jsx)("div",{className:"mt-1",children:"completed"===e.status?(0,a.jsx)("div",{className:"h-5 w-5 rounded-full bg-[#E0F2F1] flex items-center justify-center",children:(0,a.jsx)(eA.A,{className:"h-3 w-3 text-[#00796B]"})}):"active"===e.status?(0,a.jsx)("div",{className:"h-5 w-5 rounded-full bg-[#C67A52] flex items-center justify-center",children:(0,a.jsx)(ey.A,{className:"h-2 w-2 fill-white text-white"})}):(0,a.jsx)("div",{className:"h-5 w-5 rounded-full border-2 border-dashed border-[#D9D9D9] flex items-center justify-center",children:(0,a.jsx)(ey.A,{className:"h-2 w-2 text-[#D9D9D9]"})})}),!o&&(0,a.jsx)("div",{className:"flex-1 w-px bg-[#E5E0D8] mt-1 min-h-[8px]"})]}),(0,a.jsxs)("div",{className:"flex-1 min-w-0 ".concat(o?"pb-0":"pb-4"),children:[(0,a.jsxs)("button",{onClick:()=>v(e.id),className:"flex items-center gap-1.5 w-full text-left group cursor-pointer",children:[l?(0,a.jsx)(p.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] shrink-0"}):(0,a.jsx)(m.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] shrink-0"}),(0,a.jsx)("span",{className:"text-[13px] font-medium ".concat("active"===e.status?"text-[#C67A52]":"completed"===e.status?"text-[#2C2C2C]":"text-[#9A9A9A]"),children:c(e.labelKey)}),!l&&(0,a.jsx)("span",{className:"text-[11px] text-[#9A9A9A] truncate ml-1",children:(e=>{switch(e.id){case"idea_created":return t.createdBy?t.createdBy.name:"";case"elaboration":return b;case"proposal":return N;case"tasks":return i.length>0?c("panel.timeline.tasksComplete",{done:y.done,total:y.total}):c("panel.timeline.noTasks");default:return""}})(e)})]}),(e=>{let n=h.has(e.id);switch(e.id){case"idea_created":return n?(0,a.jsxs)("div",{className:"mt-2 space-y-1.5",children:[t.createdBy&&(0,a.jsx)("p",{className:"text-[12px] text-[#6B6B6B]",children:c("panel.timeline.createdBy",{name:t.createdBy.name})}),(0,a.jsx)("p",{className:"text-[12px] text-[#9A9A9A]",children:(0,B.fw)(t.createdAt,d)}),t.content&&(0,a.jsxs)("p",{className:"text-[12px] text-[#6B6B6B] line-clamp-2",children:[t.content.slice(0,120),t.content.length>120?"...":""]})]}):null;case"elaboration":return n?(0,a.jsxs)("div",{className:"mt-2 space-y-1.5",children:[(0,a.jsx)("p",{className:"text-[12px] text-[#6B6B6B]",children:b}),x&&x.rounds.length>0&&(0,a.jsx)("p",{className:"text-[12px] text-[#9A9A9A]",children:c("panel.timeline.rounds",{count:x.rounds.length})})]}):null;case"proposal":return n?(0,a.jsxs)("div",{className:"mt-2 space-y-1.5",children:[(0,a.jsx)("p",{className:"text-[12px] text-[#6B6B6B]",children:N}),s.length>0&&(0,a.jsxs)("div",{className:"space-y-1",children:[A.docCount>0&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-[12px] text-[#9A9A9A]",children:[(0,a.jsx)(T.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:c("panel.timeline.documents",{count:A.docCount})})]}),A.taskDraftCount>0&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-[12px] text-[#9A9A9A]",children:[(0,a.jsx)(ei.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:c("panel.timeline.tasks",{count:A.taskDraftCount})})]})]})]}):null;case"tasks":return n?(0,a.jsx)("div",{className:"mt-2 space-y-2",children:0===i.length?(0,a.jsx)("p",{className:"text-[12px] text-[#9A9A9A]",children:c("panel.timeline.noTasks")}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("div",{className:"flex-1 h-1.5 rounded-full bg-[#F0EDE8] overflow-hidden flex",children:[y.done>0&&(0,a.jsx)("div",{className:"h-full bg-[#00796B]",style:{width:"".concat(y.done/y.total*100,"%")}}),y.inProgress>0&&(0,a.jsx)("div",{className:"h-full bg-[#1976D2]",style:{width:"".concat(y.inProgress/y.total*100,"%")}}),y.toVerify>0&&(0,a.jsx)("div",{className:"h-full bg-[#7B1FA2]",style:{width:"".concat(y.toVerify/y.total*100,"%")}})]}),(0,a.jsx)("span",{className:"text-[11px] text-[#9A9A9A] shrink-0",children:c("panel.timeline.tasksComplete",{done:y.done,total:y.total})})]}),(0,a.jsxs)("div",{className:"space-y-1",children:[i.slice(0,5).map(e=>(0,a.jsxs)("button",{onClick:()=>r(e.uuid),className:"flex items-center gap-2 w-full text-left rounded-md px-2 py-1.5 hover:bg-[#F5F2EC] transition-colors group cursor-pointer",children:[(0,a.jsx)(el.A,{className:"h-3 w-3 text-[#D9D9D9] shrink-0 group-hover:text-[#C67A52]"}),(0,a.jsx)("span",{className:"h-2 w-2 rounded-full shrink-0 ".concat((0,B.eT)(e.status))}),(0,a.jsx)("span",{className:"flex-1 text-[12px] text-[#2C2C2C] truncate group-hover:text-[#C67A52]",children:e.title})]},e.uuid)),i.length>5&&(0,a.jsx)("p",{className:"text-[11px] text-[#9A9A9A] px-2",children:c("panel.timeline.moreItems",{count:i.length-5})})]})]})}):null;default:return null}})(e)]})]},e.id)})})}let ek=(0,ex.createServerReference)("6095a6a65bb1f4cccd4da68147eff8347a828c133a",ex.callServer,void 0,ex.findSourceMapURL,"getReportsForIdeaAction");function eE(e){let{projectUuid:t,ideaUuid:s,proposals:i,onDocClick:c}=e,d=(0,n.c)("idea"),o=(0,n.c)("documents"),[x,p]=(0,l.useState)([]),[m,h]=(0,l.useState)(!0),f=i.some(e=>"approved"===e.status),g=(0,l.useCallback)(async()=>{if(!f){p([]),h(!1);return}try{let e=await ek(t,s);if(e.success){let t=[...e.data].sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime());p(t.map(e=>{var t;return{uuid:e.uuid,title:e.title,type:e.type,content:null!=(t=e.content)?t:null,createdAt:e.createdAt}}))}}catch(e){em.q.error("Failed to fetch reports for idea:",e)}finally{h(!1)}},[t,s,f]);return((0,l.useEffect)(()=>{h(!0),g()},[g]),(0,u.eV)("document",g),m)?f?(0,a.jsx)("div",{className:"flex items-center justify-center py-3",children:(0,a.jsx)(S.A,{className:"h-4 w-4 animate-spin text-[#C67A52]"})}):null:0===x.length?null:(0,a.jsxs)("div",{className:"mt-6 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,a.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-[#9A9A9A]",children:d("reportsList")}),(0,a.jsx)("span",{className:"text-[11px] text-[#9A9A9A]",children:x.length}),(0,a.jsxs)("span",{className:"text-[11px] text-[#B4B2A9]",children:["\xb7 ",d("reportsAcrossProposals")]})]}),(0,a.jsx)("div",{className:"space-y-0",children:x.map(e=>(0,a.jsxs)(r.$,{variant:"ghost",className:"w-full justify-start h-auto text-left flex items-center gap-2.5 py-3.5 hover:bg-[#FAF8F4] transition-colors cursor-pointer -mx-1 px-1 rounded-lg",onClick:()=>{var t;return c({title:e.title,type:"report",content:null!=(t=e.content)?t:""})},children:[(0,a.jsx)(el.A,{className:"h-3.5 w-3.5 shrink-0 text-[#B4B2A9]"}),(0,a.jsx)(O.E,{variant:"outline",className:"shrink-0 text-[10px] font-medium border-[#E5E0D8] text-[#6B6B6B] bg-[#F5F2EC] px-2 py-0.5 font-mono",children:o(eo[e.type]||"typeOther")}),(0,a.jsx)("span",{className:"flex-1 min-w-0 text-left text-[13px] text-[#2C2C2A] truncate",children:e.title})]},e.uuid))})]})}var eF=s(41111);let eB=["in_progress","to_verify","open","assigned","done","closed"];function eS(e){let{tasks:t,projectUuid:s,proposalUuids:i,onSelectTask:r}=e,c=(0,n.c)("ideaTracker"),[d,o]=(0,l.useState)({}),x=(0,l.useMemo)(()=>t.map(e=>e.uuid),[t]),h=(0,l.useCallback)(async()=>{if(0===x.length)return;let e=await (0,eF.h)(x);e.success&&e.data&&o(e.data)},[x]);(0,l.useEffect)(()=>{h()},[h]),(0,u.eV)("task",h);let g=(0,l.useMemo)(()=>{let e=[];for(let s of eB){let a=t.filter(e=>e.status===s);a.length>0&&e.push({status:s,tasks:a})}let s=new Set(eB),a=t.filter(e=>!s.has(e.status));return a.length>0&&e.push({status:"other",tasks:a}),e},[t]),[j,v]=(0,l.useState)(new Set),b=(0,l.useMemo)(()=>{let e=t.length,s=t.filter(e=>"done"===e.status||"closed"===e.status).length,a=0,n=0,l=0,i=0;for(let e of t)e.acceptanceSummary&&(a+=e.acceptanceSummary.total,n+=e.acceptanceSummary.passed,l+=e.acceptanceSummary.required,i+=e.acceptanceSummary.requiredPassed);return{total:e,done:s,acTotal:a,acPassed:n,acRequired:l,acRequiredPassed:i}},[t]);return 0===t.length?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[(0,a.jsx)(ei.A,{className:"h-8 w-8 text-[#D9D9D9]"}),(0,a.jsx)("p",{className:"text-sm text-[#9A9A9A]",children:c("panel.taskList.noTasks")})]}):(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg bg-[#FAFAF7] px-3 py-2",children:[(0,a.jsx)("span",{className:"text-[12px] text-[#6B6B6B]",children:c("panel.taskList.summary",{done:b.done,total:b.total})}),b.acTotal>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-[12px] text-[#D9D9D9]",children:"\xb7"}),(0,a.jsx)("span",{className:"text-[12px] text-[#6B6B6B]",children:c("panel.taskList.acSummary",{passed:b.acRequiredPassed,total:b.acRequired})})]}),i.length>0&&(0,a.jsxs)(E(),{href:"/projects/".concat(s,"/tasks?proposalUuids=").concat(i.join(",")),className:"ml-auto flex items-center gap-1 text-[13px] font-medium text-[#C67A52] shrink-0",children:[c("panel.taskList.viewKanban"),(0,a.jsx)(m.A,{className:"h-3.5 w-3.5"})]})]}),g.map(e=>{let t=j.has(e.status);return(0,a.jsxs)("div",{children:[(0,a.jsxs)("button",{onClick:()=>{var t;return t=e.status,void v(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"flex items-center gap-2 w-full text-left py-1.5 group cursor-pointer",children:[t?(0,a.jsx)(m.A,{className:"h-3.5 w-3.5 text-[#9A9A9A]"}):(0,a.jsx)(p.A,{className:"h-3.5 w-3.5 text-[#9A9A9A]"}),(0,a.jsx)("span",{className:"h-2 w-2 rounded-full shrink-0 ".concat((0,B.eT)(e.status))}),(0,a.jsx)("span",{className:"text-[13px] font-medium text-[#2C2C2C]",children:function(e,t){switch(e){case"in_progress":return t("panel.taskList.inProgress");case"to_verify":return t("panel.taskList.toVerify");case"open":return t("panel.taskList.open");case"assigned":return t("panel.taskList.assigned");case"done":return t("panel.taskList.done");case"closed":return t("panel.taskList.closed");default:return e}}(e.status,c)}),(0,a.jsx)("span",{className:"text-[11px] text-[#9A9A9A] ml-auto",children:e.tasks.length})]}),!t&&(0,a.jsx)("div",{className:"ml-3 space-y-0.5",children:e.tasks.map(e=>{let t=d[e.uuid]||0,s=e.acceptanceSummary;return(0,a.jsx)(f.D,{entityType:"task",entityUuid:e.uuid,badgeInside:!0,children:(0,a.jsxs)("button",{onClick:()=>r(e.uuid),className:"flex items-center gap-2 w-full text-left rounded-md px-2.5 py-2 hover:bg-[#F5F2EC] transition-colors group cursor-pointer",children:[(0,a.jsx)(el.A,{className:"h-3.5 w-3.5 text-[#D9D9D9] shrink-0 group-hover:text-[#C67A52]"}),(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full shrink-0 ".concat((0,B.eT)(e.status))}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[#2C2C2C] truncate group-hover:text-[#C67A52]",children:e.title}),s&&s.total>0&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-0.5 shrink-0 rounded-full bg-[#F0EDE8] px-1.5 py-0.5 text-[10px] text-[#6B6B6B]",children:[(0,a.jsx)(eA.A,{className:"h-2.5 w-2.5"}),s.requiredPassed,"/",s.required]}),e.assignee&&(0,a.jsxs)("span",{className:"shrink-0 inline-flex items-center gap-1 text-[10px] text-[#9A9A9A] max-w-[72px] truncate",title:e.assignee.name,children:[(0,a.jsx)(q.A,{className:"h-2.5 w-2.5 shrink-0"}),e.assignee.name.split(/[@\s]/)[0]]}),t>0&&(0,a.jsx)("span",{className:"inline-flex items-center justify-center h-4 min-w-[16px] rounded-full bg-[#E8F5E9] text-[#2E7D32] text-[9px] font-semibold shrink-0",title:c("panel.taskList.workersActive",{count:t}),children:t})]})},e.uuid)})})]},e.status)})]})}var eD=s(88179);function e_(e){let{ideaUuid:t}=e,s=(0,n.c)(),[i,r]=(0,l.useState)([]),[c,d]=(0,l.useState)(!0),o=(0,l.useCallback)(async()=>{d(!0),r((await (0,eD.x)(t)).activities),d(!1)},[t]);return(0,l.useEffect)(()=>{o()},[o]),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)(G.J,{className:"text-[11px] font-medium uppercase tracking-wider text-[#9A9A9A]",children:s("common.activity")}),(0,a.jsx)("div",{className:"mt-2",children:c?(0,a.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,a.jsx)(S.A,{className:"h-4 w-4 animate-spin text-[#9A9A9A]"})}):0===i.length?(0,a.jsx)("p",{className:"text-sm text-[#9A9A9A] italic",children:s("common.noActivity")}):i.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-stretch gap-2.5",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center w-2 shrink-0",children:[(0,a.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full border-[1.5px] border-[#D9D9D9] bg-white"}),t<i.length-1&&(0,a.jsx)("div",{className:"flex-1 w-px bg-[#E5E0D8] mt-1"})]}),(0,a.jsxs)("div",{className:"flex-1 pb-3",children:[(0,a.jsx)("p",{className:"text-[13px] text-[#2C2C2C]",children:function(e,t){let{action:s,actorName:a}=e;switch(s){case"created":case"idea_created":return t("activity.ideaCreated",{actor:a});case"assigned":case"idea_assigned":return t("activity.ideaAssigned",{actor:a});case"claimed":case"idea_claimed":return t("activity.ideaClaimed",{actor:a});case"released":case"idea_released":return t("activity.ideaReleased",{actor:a});case"status_changed":case"idea_status_changed":return t("activity.ideaStatusChanged",{actor:a});case"elaboration_started":return t("activity.elaborationStarted",{actor:a});case"elaboration_answered":return t("activity.elaborationAnswered",{actor:a});case"elaboration_skipped":return t("activity.elaborationSkipped",{actor:a});case"elaboration_resolved":return t("activity.elaborationResolved",{actor:a});case"elaboration_followup":return t("activity.elaborationFollowup",{actor:a});default:return t("activity.genericAction",{actor:a,action:s})}}(e,s)}),(0,a.jsx)("p",{className:"text-[11px] text-[#9A9A9A]",children:(0,B.fw)(e.createdAt,s)})]})]},e.uuid))})]})}var eT=s(5810);function eU(e){let{ideaUuid:t,currentUserUuid:s,commentCount:i,onCommentCountChange:r}=e,c=(0,n.c)("ideaTracker"),[d,o]=(0,l.useState)("comments");return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex gap-1 rounded-lg bg-[#F5F2EC] p-0.5",children:[(0,a.jsxs)("button",{onClick:()=>o("comments"),className:"flex-1 rounded-md px-3 py-1.5 text-[13px] font-medium transition-colors flex items-center justify-center gap-1.5 cursor-pointer ".concat("comments"===d?"bg-white text-[#2C2C2C] shadow-sm":"text-[#9A9A9A] hover:text-[#6B6B6B]"),children:[c("panel.activityTab.comments"),i>0&&(0,a.jsx)("span",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full bg-[#F5F2EC] text-[#6B6B6B] text-[10px] font-semibold leading-none",children:i})]}),(0,a.jsx)("button",{onClick:()=>o("activity"),className:"flex-1 rounded-md px-3 py-1.5 text-[13px] font-medium transition-colors cursor-pointer ".concat("activity"===d?"bg-white text-[#2C2C2C] shadow-sm":"text-[#9A9A9A] hover:text-[#6B6B6B]"),children:c("panel.activityTab.activity")})]}),(0,a.jsx)("div",{children:"activity"===d?(0,a.jsx)(e_,{ideaUuid:t}):(0,a.jsx)(eT.$,{targetType:"idea",targetUuid:t,currentUserUuid:s,onCountChange:r,compact:!0})})]})}var eM=s(17156),eR=s(70633);function eP(e){let{title:t,type:s,content:i,mode:c="overlay",onClose:d,onBack:o}=e,x=(0,n.c)("documents"),[u,p]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=setTimeout(()=>p(!0),300);return()=>clearTimeout(e)},[]),(0,l.useEffect)(()=>{let e=e=>{"Escape"!==e.key||e.defaultPrevented||(e.preventDefault(),d())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[d]);let m="sidebyside"===c;return(0,a.jsxs)(a.Fragment,{children:[!m&&(0,a.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:d}),(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(m?"z-40 ".concat(u?"":"animate-in slide-in-from-right duration-300"):"z-50 right-0 ".concat(u?"":"animate-in slide-in-from-right duration-300")),style:{width:"min(100%, ".concat(B.L8,"px)"),...m?{right:"".concat(B.L8,"px")}:{}},children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-[#F5F2EC] px-6 py-5",children:[o&&(0,a.jsx)(r.$,{variant:"ghost",size:"icon",className:"mr-2 h-8 w-8 shrink-0",onClick:o,children:(0,a.jsx)(eR.A,{className:"h-4 w-4 text-[#6B6B6B]"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h2",{className:"text-base font-semibold text-[#2C2C2C] truncate",children:t}),(0,a.jsx)("div",{className:"mt-1.5",children:(0,a.jsx)(O.E,{variant:"outline",className:"text-[10px] font-medium border-[#E5E0D8] text-[#6B6B6B] bg-[#F5F2EC] px-2 py-0.5 font-mono",children:x(eo[s]||"typeOther")})})]}),(0,a.jsx)(r.$,{variant:"outline",size:"icon",className:"ml-4 h-8 w-8 shrink-0 border-[#E5E0D8]",onClick:d,children:(0,a.jsx)(L.A,{className:"h-4 w-4 text-[#6B6B6B]"})})]}),(0,a.jsx)(V.F,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:(0,a.jsx)("div",{className:"px-6 py-5 text-[13px] leading-relaxed text-[#2C2C2A] prose prose-sm max-w-none [&_h1]:text-lg [&_h1]:font-semibold [&_h1]:mt-4 [&_h1]:mb-2 [&_h2]:text-base [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mb-1.5 [&_h3]:text-sm [&_h3]:font-medium [&_h3]:mt-2 [&_h3]:mb-1 [&_p]:text-[13px] [&_p]:text-[#4A4A4A] [&_p]:my-1.5 [&_li]:text-[13px] [&_li]:text-[#4A4A4A] [&_ul]:my-1 [&_ol]:my-1 [&_strong]:text-[#2C2C2C] [&_code]:text-[12px] [&_code]:bg-[#F5F2EC] [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_pre]:bg-[#FAF8F4] [&_pre]:p-3 [&_pre]:rounded-lg [&_pre]:my-2",children:(0,a.jsx)(Y.MarkdownContent,{children:ed(i)})})})]})]})}var ez=s(84103),eI=s(32260),eL=s(18347);let eq=(0,ex.createServerReference)("40f5f73a95848d5d294c8b99d3d03d1f8681dc85ba",ex.callServer,void 0,ex.findSourceMapURL,"getIdeaAction"),e$=(0,ex.createServerReference)("402d48989a661e892a10a3113d5f7056dcad295723",ex.callServer,void 0,ex.findSourceMapURL,"getTaskAction");var eV=s(92715);function eO(e){let{ideaUuid:t,projectUuid:s,currentUserUuid:i,onClose:c}=e,d=(0,n.c)(),o=(0,n.c)("ideaTracker"),x=(0,n.c)("status"),p=(0,P.useRouter)(),[m,h]=(0,l.useState)(null),[f,j]=(0,l.useState)(!0),[v,b]=(0,l.useState)(null),[N,A]=(0,l.useState)([]),[y,C]=(0,l.useState)([]),[w,k]=(0,l.useState)("overview"),[E,F]=(0,l.useState)(new Set(["overview"])),[D,_]=(0,l.useState)(!1),[T,U]=(0,l.useState)(0),[M,R]=(0,l.useState)(!1),[Z,Q]=(0,l.useState)(!1),[W,X]=(0,l.useState)(!1),[Y,ee]=(0,l.useState)(""),[et,es]=(0,l.useState)(""),[ea,el]=(0,l.useState)(!1),[ei,er]=(0,l.useState)(null),[ec,ed]=(0,l.useState)(!1),[eo,ex]=(0,l.useState)(null),[ef,eg]=(0,l.useState)(null),[ej,ev]=(0,l.useState)(null),eb=(0,l.useCallback)(e=>{ev(null),ex(e)},[]),eN=(0,l.useCallback)(e=>{ex(null),eg(null),ev(e)},[]),[eA,ey]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=window.matchMedia("(min-width: 960px)");ey(e.matches);let t=e=>ey(e.matches);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let[eC,ek]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=setTimeout(()=>ek(!0),300);return()=>clearTimeout(e)},[]);let eF=(0,l.useCallback)(e=>{let t=new URLSearchParams(window.location.search);t.set("tab",e),window.history.replaceState(null,"","".concat(window.location.pathname,"?").concat(t.toString()))},[]),eB=(0,l.useCallback)(async()=>{try{let e=await eq(t);e.success?(h(e.data),b(null)):b(o("Not found"===e.error?"panel.notFound":"panel.loadFailed"))}catch(e){b(o("panel.loadFailed"))}finally{j(!1)}},[t,o]);(0,l.useEffect)(()=>{j(!0),eB()},[eB]),(0,u.eV)("idea",eB),(0,u.eV)("proposal",eB),(0,u.eV)("task",eB);let eD=null==m?void 0:m.uuid,e_=null==m?void 0:m.status,eT=(0,l.useCallback)(async()=>{if(!eD||"open"===e_)return void A([]);try{let e=await eu(s,eD);e.success&&A(e.data)}catch(e){em.q.error("Failed to fetch proposals:",e)}},[s,eD,e_]);(0,l.useEffect)(()=>{eT()},[eT]),(0,u.eV)("proposal",eT);let eR=(0,l.useCallback)(async()=>{let e=N.filter(e=>"approved"===e.status);if(0===e.length)return void C([]);try{let t=(await Promise.all(e.map(e=>ep(s,e.uuid)))).flatMap(e=>e.success&&e.data?e.data.map(e=>{var t,s,a;return{uuid:e.uuid,title:e.title,status:e.status,commentCount:null!=(t=e.commentCount)?t:0,assignee:null!=(s=e.assignee)?s:null,acceptanceSummary:null!=(a=e.acceptanceSummary)?a:null}}):[]);C(t)}catch(e){em.q.error("Failed to fetch tasks:",e)}},[s,N]);(0,l.useEffect)(()=>{eR()},[eR]),(0,u.eV)("task",eR);let eO=(0,l.useMemo)(()=>m?function(e,t,s){let a=["overview"];return a.push("elaboration"),t.length>0&&a.push("proposal"),s.length>0&&a.push("tasks"),a.push("activity"),a}(0,N,y):["overview","activity"],[m,N,y]),eH=(0,l.useRef)(new URLSearchParams(window.location.search).get("tab")),eJ=m?function(e){switch(e){case"open":case"researching":case"answer_questions":return"elaboration";case"planning":case"review_proposal":return"proposal";case"building":case"verify_work":return"tasks";default:return"overview"}}(m.badgeHint):"overview";(0,l.useEffect)(()=>{let e;if(!m||D)return;let t=eH.current;if(t)if(!eO.includes(t))return;else e=t,eH.current=null,_(!0);else if(eO.includes(eJ))e=eJ;else{if("overview"!==eJ)return;e="overview"}k(e),F(t=>new Set([...t,e])),eF(e)},[null==m?void 0:m.uuid,eJ,eO]),(0,l.useEffect)(()=>{_(!1)},[t]),(0,l.useEffect)(()=>{eO.includes(w)||k("overview")},[eO,w]);let eG=(0,l.useMemo)(()=>y.filter(e=>"in_progress"===e.status||"assigned"===e.status||"to_verify"===e.status).length,[y]),eK=(0,l.useCallback)(()=>{if(!eo)return void eg(null);e$(eo).then(e=>{e.success&&eg(e.data)}).catch(e=>em.q.error("Failed to load task details:",e))},[eo]);(0,l.useEffect)(()=>{eK()},[eK]),(0,u.eV)("task",eK),(0,l.useEffect)(()=>{X(!1),ee((null==m?void 0:m.title)||""),es((null==m?void 0:m.content)||""),er(null)},[null==m?void 0:m.uuid,null==m?void 0:m.title,null==m?void 0:m.content]);let eZ=()=>{X(!1),ee((null==m?void 0:m.title)||""),es((null==m?void 0:m.content)||""),er(null)},eQ=async()=>{if(!m||!Y.trim())return void er(d("ideas.titleRequired"));el(!0),er(null);let e=await (0,eI.J)({ideaUuid:m.uuid,projectUuid:s,title:Y.trim(),content:et.trim()||null});el(!1),e.success?(X(!1),await eB(),p.refresh()):er(e.error||d("ideas.updateFailed"))},eW=async()=>{if(!m)return;Q(!0);let e=await (0,eL.Z)(m.uuid,s);Q(!1),e.success&&(c(),p.refresh())},eX=(null==m?void 0:m.derivedStatus)||"todo",eY=!!m&&"elaborated"!==m.status,e0=(null==m?void 0:m.elaborationStatus)==="resolved",e2=(null==m?void 0:m.status)==="elaborating"&&!e0;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:c}),(0,a.jsxs)("div",{className:"fixed right-0 top-14 md:top-0 z-50 flex h-[calc(100%-3.5rem)] md:h-full w-full md:w-[480px] flex-col bg-white shadow-xl border-l border-[#E5E0D8] ".concat(eC?"":"animate-in slide-in-from-right duration-300"),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-[#F5F2EC] px-6 py-5",children:[(0,a.jsx)("div",{className:"flex-1 min-w-0",children:f?(0,a.jsx)("div",{className:"h-5 w-40 animate-pulse rounded bg-[#F5F2EC]"}):m?W?(0,a.jsx)("h2",{className:"text-base font-semibold text-[#2C2C2C]",children:d("ideas.editIdea")}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{className:"text-base font-semibold text-[#2C2C2C] truncate",children:m.title}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center gap-2",children:[(0,a.jsx)(O.E,{className:B._5[eX]||B._5.todo,children:m.badgeHint?o("badge.".concat(B.Wl[m.badgeHint]||"open")):x(B.Bj[eX]||"todo")}),(0,a.jsx)("span",{className:"text-xs text-[#9A9A9A]",children:(0,g.r)(m.createdAt)})]})]}):(0,a.jsx)("h2",{className:"text-base font-semibold text-[#2C2C2C]",children:o("panel.notFound")})}),(0,a.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[m&&!W&&(0,a.jsx)(r.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-[#E5E0D8]",onClick:()=>ed(!0),title:d("ideas.actions.move"),"aria-label":d("ideas.actions.move"),children:(0,a.jsx)(z.A,{className:"h-4 w-4 text-[#6B6B6B]"})}),m&&"elaborated"!==m.status&&!W&&(0,a.jsx)(r.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-[#E5E0D8]",onClick:()=>{m&&(ee(m.title),es(m.content||""),er(null),X(!0))},title:d("ideas.editIdea"),children:(0,a.jsx)(I.A,{className:"h-4 w-4 text-[#6B6B6B]"})}),(0,a.jsx)(r.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-[#E5E0D8]",onClick:W?eZ:c,children:(0,a.jsx)(L.A,{className:"h-4 w-4 text-[#6B6B6B]"})})]})]}),m&&!f&&!W&&(0,a.jsx)("div",{className:"border-b border-[#F5F2EC] px-6",children:(0,a.jsx)("div",{className:"flex gap-0 -mb-px",children:eO.map(e=>(0,a.jsxs)("button",{onClick:()=>{k(e),_(!0),F(t=>new Set([...t,e])),eF(e)},className:"relative flex items-center gap-1.5 px-3 py-2.5 text-[13px] font-medium transition-colors cursor-pointer ".concat(w===e?"text-[#C67A52] border-b-2 border-[#C67A52]":"text-[#9A9A9A] hover:text-[#6B6B6B]"),children:[o("panel.tabs.".concat(e)),"tasks"===e&&eG>0&&(0,a.jsx)("span",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full bg-[#E3F2FD] text-[#1976D2] text-[10px] font-semibold leading-none",children:eG}),"activity"===e&&T>0&&(0,a.jsx)("span",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full bg-[#F5F2EC] text-[#6B6B6B] text-[10px] font-semibold leading-none",children:T})]},e))})}),(0,a.jsx)(V.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:f?(0,a.jsxs)("div",{className:"flex flex-1 items-center justify-center py-12",children:[(0,a.jsx)(S.A,{className:"h-6 w-6 animate-spin text-[#C67A52]"}),(0,a.jsx)("span",{className:"ml-2 text-sm text-[#9A9A9A]",children:o("loading")})]}):v?(0,a.jsx)("div",{className:"flex flex-1 items-center justify-center py-12",children:(0,a.jsx)("p",{className:"text-sm text-[#9A9A9A]",children:v})}):m?W?(0,a.jsxs)("div",{className:"space-y-5",children:[ei&&(0,a.jsx)("div",{className:"rounded-lg bg-destructive/10 p-3 text-sm text-destructive",children:ei}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(G.J,{htmlFor:"edit-title",className:"text-[13px] font-medium text-[#2C2C2C]",children:d("ideas.titleLabel")}),(0,a.jsx)(H.p,{id:"edit-title",value:Y,onChange:e=>ee(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)(G.J,{htmlFor:"edit-content",className:"text-[13px] font-medium text-[#2C2C2C]",children:d("common.content")}),(0,a.jsx)(J.T,{id:"edit-content",value:et,onChange:e=>es(e.target.value),rows:8,className:"border-[#E5E0D8] text-sm resize-none focus-visible:ring-[#C67A52]"})]})]}):(0,a.jsxs)(a.Fragment,{children:[E.has("overview")&&(0,a.jsxs)("div",{style:{display:"overview"===w?"block":"none"},children:[(0,a.jsx)(ew,{idea:m,proposals:N,tasks:y,onSelectTask:eb}),(0,a.jsx)(eE,{projectUuid:s,ideaUuid:m.uuid,proposals:N,onDocClick:eN})]}),eO.includes("elaboration")&&E.has("elaboration")&&(0,a.jsx)("div",{style:{display:"elaboration"===w?"block":"none"},children:(0,a.jsx)(en,{idea:m,onRefresh:eB})}),eO.includes("proposal")&&E.has("proposal")&&(0,a.jsx)("div",{style:{display:"proposal"===w?"block":"none"},children:(0,a.jsx)(eh,{idea:m,projectUuid:s,onTaskClick:eb,onDocClick:eN,initialProposals:N})}),eO.includes("tasks")&&E.has("tasks")&&(0,a.jsx)("div",{style:{display:"tasks"===w?"block":"none"},children:(0,a.jsx)(eS,{tasks:y,projectUuid:s,proposalUuids:N.filter(e=>"approved"===e.status).map(e=>e.uuid),onSelectTask:eb})}),E.has("activity")&&(0,a.jsx)("div",{style:{display:"activity"===w?"block":"none"},children:(0,a.jsx)(eU,{ideaUuid:m.uuid,currentUserUuid:i,commentCount:T,onCommentCountChange:U})})]}):null})}),m&&!f&&(0,a.jsx)("div",{className:"border-t border-[#F5F2EC] px-6 py-4",children:W?(0,a.jsxs)("div",{className:"flex items-center justify-end gap-3",children:[(0,a.jsx)(r.$,{variant:"outline",className:"border-[#E5E0D8]",onClick:eZ,disabled:ea,children:d("common.cancel")}),(0,a.jsx)(r.$,{className:"bg-[#C67A52] hover:bg-[#B56A42] text-white",onClick:eQ,disabled:ea||!Y.trim(),children:ea?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.A,{className:"mr-2 h-4 w-4 animate-spin"}),d("common.save")]}):d("common.save")})]}):(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[eY&&(0,a.jsxs)(r.$,{variant:"outline",className:"shrink-0 border-[#E5E0D8] rounded-md px-4 py-2 text-[13px] font-medium",onClick:()=>R(!0),children:[(0,a.jsx)(q.A,{className:"mr-2 h-4 w-4"}),m.assignee?d("common.reassign"):d("common.assign")]}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:e2&&(0,a.jsx)("span",{className:"text-[11px] text-[#9A9A9A]",children:d("elaboration.elaborationRequiredHint")})}),(0,a.jsxs)(K.Lt,{children:[(0,a.jsx)(K.tv,{asChild:!0,children:(0,a.jsx)(r.$,{variant:"outline",size:"icon",className:"shrink-0 h-8 w-8 border-[#E5E0D8] text-[#EF4444] hover:bg-[#FFEBEE] hover:text-[#EF4444] hover:border-[#EF4444]",children:(0,a.jsx)($.A,{className:"h-4 w-4"})})}),(0,a.jsxs)(K.EO,{children:[(0,a.jsxs)(K.wd,{children:[(0,a.jsx)(K.r7,{children:d("ideas.deleteIdea")}),(0,a.jsx)(K.$v,{children:d("ideas.deleteIdeaConfirm",{title:m.title})})]}),(0,a.jsxs)(K.ck,{children:[(0,a.jsx)(K.Zr,{children:d("common.cancel")}),(0,a.jsx)(K.Rx,{variant:"destructive",onClick:eW,disabled:Z,children:Z?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.A,{className:"mr-2 h-4 w-4 animate-spin"}),d("common.delete")]}):d("common.delete")})]})]})]})]})})]}),(0,a.jsx)(ez.h,{open:ec,onOpenChange:ed,ideaUuid:t,projectUuid:s,onMoved:()=>c()}),M&&m&&(0,a.jsx)(eV.i,{idea:{uuid:m.uuid,title:m.title,content:m.content,status:m.status,assignee:m.assignee?{type:m.assignee.type,uuid:m.assignee.uuid,name:m.assignee.name}:null},projectUuid:s,currentUserUuid:i,onClose:()=>{R(!1),eB()}}),eo&&ef&&(0,a.jsx)(eM.v,{task:ef,projectUuid:s,currentUserUuid:i,mode:eA?"sidebyside":"overlay",onClose:()=>{ex(null),eg(null)},onBack:()=>{ex(null),eg(null)}}),ej&&(0,a.jsx)(eP,{title:ej.title,type:ej.type,content:ej.content,mode:eA?"sidebyside":"overlay",onClose:()=>ev(null),onBack:()=>ev(null)})]})}var eH=s(97438),eJ=s(42305);function eG(e){let{open:t,onOpenChange:s,projectUuid:i,onCreated:c}=e,d=(0,n.c)("ideaTracker"),o=(0,n.c)("common"),[x,u]=(0,l.useState)(""),[p,m]=(0,l.useState)(""),[h,f]=(0,l.useState)(!1),[g,j]=(0,l.useState)(null),v=async()=>{let e=x.trim();if(e){f(!0),j(null);try{var t;let a=await fetch("/api/projects/".concat(i,"/ideas"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,content:p.trim()||void 0})}),n=await a.json();n.success&&(null==(t=n.data)?void 0:t.uuid)?(u(""),m(""),s(!1),null==c||c(n.data.uuid)):j(n.error||d("error.createFailed"))}catch(e){j(d("error.createFailed"))}finally{f(!1)}}};return(0,a.jsx)(eH.lG,{open:t,onOpenChange:s,children:(0,a.jsxs)(eH.Cf,{className:"sm:max-w-[480px]",children:[(0,a.jsx)(eH.c7,{children:(0,a.jsx)(eH.L3,{children:d("newIdea.title")})}),(0,a.jsxs)("div",{className:"space-y-4 py-2",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(G.J,{htmlFor:"idea-title",children:d("newIdea.ideaTitle")}),(0,a.jsx)(H.p,{id:"idea-title",value:x,onChange:e=>u(e.target.value),placeholder:d("newIdea.titlePlaceholder"),autoFocus:!0,onKeyDown:e=>{!(0,eJ.P)(e)&&"Enter"===e.key&&!e.shiftKey&&x.trim()&&(e.preventDefault(),v())}})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)(G.J,{htmlFor:"idea-content",children:[d("newIdea.description"),(0,a.jsxs)("span",{className:"ml-1 text-xs font-normal text-[#9A9A9A]",children:["(",o("optional"),")"]})]}),(0,a.jsx)(J.T,{id:"idea-content",value:p,onChange:e=>m(e.target.value),placeholder:d("newIdea.descriptionPlaceholder"),rows:4,className:"resize-none"})]}),g&&(0,a.jsx)("div",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-[12px] text-destructive",children:g})]}),(0,a.jsxs)(eH.Es,{children:[(0,a.jsx)(r.$,{variant:"outline",onClick:()=>s(!1),disabled:h,children:o("cancel")}),(0,a.jsxs)(r.$,{onClick:v,disabled:h||!x.trim(),className:"bg-[#C67A52] hover:bg-[#B56A42] text-white",children:[h?(0,a.jsx)(S.A,{className:"mr-2 h-4 w-4 animate-spin"}):null,o("create")]})]})]})})}function eK(e){let{projectUuid:t,currentUserUuid:s,initialTrackerData:d,initialStatsData:o,initialSelectedIdeaUuid:x}=e,u=(0,n.c)("ideaTracker"),[p,m]=(0,l.useState)("ideas"),[h,f]=(0,l.useState)(!1),[g,j]=(0,l.useState)(!1),v="/projects/".concat(t,"/dashboard"),{selectedId:b,openPanel:N,closePanel:A}=(0,c.T)(v,x);return(0,a.jsxs)("div",{className:"flex h-full flex-col",children:[!h&&(0,a.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex gap-0.5 rounded-lg border border-[#E5E0D8] p-0.5",children:[(0,a.jsx)(r.$,{variant:"ghost",size:"sm",onClick:()=>m("ideas"),className:"rounded-md px-3 py-1 h-auto text-[12px] font-medium transition-colors ".concat("ideas"===p?"bg-white text-[#2C2C2C] shadow-sm":"text-[#9A9A9A] hover:text-[#6B6B6B]"),children:u("tabs.ideas")}),(0,a.jsx)(r.$,{variant:"ghost",size:"sm",onClick:()=>m("stats"),className:"rounded-md px-3 py-1 h-auto text-[12px] font-medium transition-colors ".concat("stats"===p?"bg-white text-[#2C2C2C] shadow-sm":"text-[#9A9A9A] hover:text-[#6B6B6B]"),children:u("tabs.stats")})]}),"ideas"===p&&(0,a.jsxs)(r.$,{onClick:()=>j(!0),size:"sm",className:"gap-1.5 rounded-md bg-[#C67A52] px-3.5 py-2 text-white hover:bg-[#B56A42]",children:[(0,a.jsx)(i.A,{className:"h-4 w-4"}),u("actions.newIdea")]})]}),"ideas"===p?(0,a.jsx)(w,{projectUuid:t,initialData:d,onIdeaClick:N,onNewIdea:()=>j(!0),onEmptyChange:f}):(0,a.jsx)(R,{projectUuid:t,initialData:o}),(0,a.jsx)(eG,{open:g,onOpenChange:j,projectUuid:t,onCreated:e=>N(e)}),b&&(0,a.jsx)(eO,{ideaUuid:b,projectUuid:t,currentUserUuid:s,onClose:A})]})}},26049:(e,t,s)=>{"use strict";s.d(t,{ProjectSettingsModal:()=>v});var a=s(90508),n=s(1856),l=s(23675),i=s(39268),r=s(52309),c=s(85226),d=s(22922),o=s(14554),x=s(88064),u=s(15972),p=s(97438),m=s(84247),h=s(51817),f=s(52217);let g=(0,f.createServerReference)("60e7e554b32e453f3c930e14410f5077ad183f596f",f.callServer,void 0,f.findSourceMapURL,"updateProjectAction"),j=(0,f.createServerReference)("4006dd9f7d3437ab1478c6be32917a71073ed4fab0",f.callServer,void 0,f.findSourceMapURL,"deleteProjectAction");function v(e){let{projectUuid:t,projectName:s,projectDescription:f}=e,v=(0,i.c)(),b=(0,l.useRouter)(),[N,A]=(0,n.useState)(!1),[y,C]=(0,n.useState)(s),[w,k]=(0,n.useState)(f||""),[E,F]=(0,n.useState)(!1),[B,S]=(0,n.useState)(!1),D=async()=>{F(!0);let e=await g(t,{name:y,description:w||null});F(!1),e.success&&(A(!1),b.refresh())},_=async()=>{S(!0);let e=await j(t);e&&!e.success&&S(!1)};return(0,a.jsxs)(p.lG,{open:N,onOpenChange:A,children:[(0,a.jsx)(p.zM,{asChild:!0,children:(0,a.jsxs)(d.$,{variant:"outline",size:"sm",className:"gap-1.5 rounded-lg border-[#E5E2DC] bg-white text-[12px] font-normal text-[#2C2C2C] hover:border-[#C67A52] hover:bg-white",children:[(0,a.jsx)(r.A,{className:"h-3.5 w-3.5 text-[#6B6B6B]"}),v("dashboard.settings")]})}),(0,a.jsxs)(p.Cf,{className:"gap-0 overflow-hidden rounded-2xl border-0 p-0 sm:max-w-[520px]",children:[(0,a.jsx)(p.c7,{className:"px-7 py-6",children:(0,a.jsx)(p.L3,{className:"text-[20px] font-semibold tracking-tight text-[#2C2C2C]",children:v("projectSettings.title")})}),(0,a.jsx)(m.Separator,{className:"bg-[#E5E2DC]"}),(0,a.jsxs)("div",{className:"flex flex-col gap-7 p-7",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,a.jsx)("h3",{className:"text-[14px] font-semibold text-[#2C2C2C]",children:v("projectSettings.basicInfo")}),(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsx)(x.J,{className:"text-[12px] font-medium text-[#6B6B6B]",children:v("projectSettings.projectName")}),(0,a.jsx)(o.p,{value:y,onChange:e=>C(e.target.value),className:"h-11 rounded-[10px] border-[#E5E2DC] text-[14px] text-[#2C2C2C] focus-visible:ring-[#C67A52]"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsx)(x.J,{className:"text-[12px] font-medium text-[#6B6B6B]",children:v("projectSettings.description")}),(0,a.jsx)(u.T,{value:w,onChange:e=>k(e.target.value),rows:3,className:"resize-none rounded-[10px] border-[#E5E2DC] text-[14px] text-[#2C2C2C] focus-visible:ring-[#C67A52]"})]}),(0,a.jsx)(d.$,{onClick:D,disabled:E||!y.trim(),className:"w-fit rounded-[10px] bg-[#C67A52] px-6 text-[13px] font-semibold text-white hover:bg-[#B56A42]",children:E?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.A,{className:"mr-2 h-4 w-4 animate-spin"}),v("projectSettings.saving")]}):v("projectSettings.saveChanges")})]}),(0,a.jsx)(m.Separator,{className:"bg-[#E5E2DC]"}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("h3",{className:"text-[14px] font-semibold text-[#C4574C]",children:v("projectSettings.dangerZone")}),(0,a.jsx)("div",{className:"rounded-xl border border-[#C4574C40] bg-[#C4574C08] px-[18px] py-4",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("span",{className:"text-[13px] font-semibold text-[#2C2C2C]",children:v("projectSettings.deleteTitle")}),(0,a.jsx)("span",{className:"text-[12px] text-[#6B6B6B]",children:v("projectSettings.deleteDescription")})]}),(0,a.jsxs)(h.Lt,{children:[(0,a.jsx)(h.tv,{asChild:!0,children:(0,a.jsx)(d.$,{variant:"destructive",size:"sm",className:"ml-4 shrink-0 rounded-lg bg-[#C4574C] px-[18px] text-[12px] font-medium hover:bg-[#B3463B]",children:v("common.delete")})}),(0,a.jsxs)(h.EO,{children:[(0,a.jsxs)(h.wd,{children:[(0,a.jsx)(h.r7,{children:v("projectOverview.deleteProject")}),(0,a.jsx)(h.$v,{children:v("projectOverview.deleteProjectConfirm",{name:s})})]}),(0,a.jsxs)(h.ck,{children:[(0,a.jsx)(h.Zr,{children:v("common.cancel")}),(0,a.jsx)(h.Rx,{variant:"destructive",onClick:_,disabled:B,children:B?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.A,{className:"mr-2 h-4 w-4 animate-spin"}),v("common.delete")]}):v("common.delete")})]})]})]})]})})]})]})]})]})}},29767:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(66206).A)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]])},32470:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(66206).A)("list-checks",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]])},37915:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(66206).A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},38476:(e,t,s)=>{"use strict";s.r(t),s.d(t,{Collapsible:()=>j,CollapsibleContent:()=>A,CollapsibleTrigger:()=>b,Content:()=>E,Root:()=>w,Trigger:()=>k,createCollapsibleScope:()=>h});var a=s(1856),n=s(33328),l=s(21032),i=s(66249),r=s(99457),c=s(34124),d=s(93367),o=s(19900),x=s(40577),u=s(90508),p="Collapsible",[m,h]=(0,l.A)(p),[f,g]=m(p),j=a.forwardRef((e,t)=>{let{__scopeCollapsible:s,open:n,defaultOpen:l,disabled:r,onOpenChange:c,...o}=e,[m,h]=(0,i.i)({prop:n,defaultProp:null!=l&&l,onChange:c,caller:p});return(0,u.jsx)(f,{scope:s,disabled:r,contentId:(0,x.B)(),open:m,onOpenToggle:a.useCallback(()=>h(e=>!e),[h]),children:(0,u.jsx)(d.sG.div,{"data-state":C(m),"data-disabled":r?"":void 0,...o,ref:t})})});j.displayName=p;var v="CollapsibleTrigger",b=a.forwardRef((e,t)=>{let{__scopeCollapsible:s,...a}=e,l=g(v,s);return(0,u.jsx)(d.sG.button,{type:"button","aria-controls":l.contentId,"aria-expanded":l.open||!1,"data-state":C(l.open),"data-disabled":l.disabled?"":void 0,disabled:l.disabled,...a,ref:t,onClick:(0,n.mK)(e.onClick,l.onOpenToggle)})});b.displayName=v;var N="CollapsibleContent",A=a.forwardRef((e,t)=>{let{forceMount:s,...a}=e,n=g(N,e.__scopeCollapsible);return(0,u.jsx)(o.C,{present:s||n.open,children:e=>{let{present:s}=e;return(0,u.jsx)(y,{...a,ref:t,present:s})}})});A.displayName=N;var y=a.forwardRef((e,t)=>{let{__scopeCollapsible:s,present:n,children:l,...i}=e,o=g(N,s),[x,p]=a.useState(n),m=a.useRef(null),h=(0,c.s)(t,m),f=a.useRef(0),j=f.current,v=a.useRef(0),b=v.current,A=o.open||x,y=a.useRef(A),w=a.useRef(void 0);return a.useEffect(()=>{let e=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,r.N)(()=>{let e=m.current;if(e){w.current=w.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let t=e.getBoundingClientRect();f.current=t.height,v.current=t.width,y.current||(e.style.transitionDuration=w.current.transitionDuration,e.style.animationName=w.current.animationName),p(n)}},[o.open,n]),(0,u.jsx)(d.sG.div,{"data-state":C(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!A,...i,ref:h,style:{"--radix-collapsible-content-height":j?"".concat(j,"px"):void 0,"--radix-collapsible-content-width":b?"".concat(b,"px"):void 0,...e.style},children:A&&l})});function C(e){return e?"open":"closed"}var w=j,k=b,E=A},52309:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(66206).A)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},56669:(e,t,s)=>{Promise.resolve().then(s.bind(s,13257)),Promise.resolve().then(s.bind(s,26049))},57223:(e,t,s)=>{"use strict";s.d(t,{E:()=>l});var a=s(90508),n=s(24377);function l(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"skeleton",className:(0,n.cn)("bg-accent animate-pulse rounded-md",t),...s})}},71921:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(66206).A)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]])},78948:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(66206).A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},84247:(e,t,s)=>{"use strict";s.d(t,{Separator:()=>i});var a=s(90508);s(1856);var n=s(5725),l=s(24377);function i(e){let{className:t,orientation:s="horizontal",decorative:i=!0,...r}=e;return(0,a.jsx)(n.b,{"data-slot":"separator",decorative:i,orientation:s,className:(0,l.cn)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...r})}},95900:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(66206).A)("arrow-right-left",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]])}},e=>{e.O(0,[41282,93151,41752,30996,57084,59764,12079,18944,12790,26885,21932,16544,53298,30724,27201,16551,97784,14753,45532,70552,86944,11207,76803,29660,84541,23466,52206,35486,19898,74951,65496,77358],()=>e(e.s=56669)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[85e3],{5725:(e,t,s)=>{"use strict";s.d(t,{b:()=>d});var a=s(1856),n=s(93367),l=s(90508),i="horizontal",r=["horizontal","vertical"],c=a.forwardRef((e,t)=>{var s;let{decorative:a,orientation:c=i,...d}=e,o=(s=c,r.includes(s))?c:i;return(0,l.jsx)(n.sG.div,{"data-orientation":o,...a?{role:"none"}:{"aria-orientation":"vertical"===o?o:void 0,role:"separator"},...d,ref:t})});c.displayName="Separator";var d=c},13257:(e,t,s)=>{"use strict";s.d(t,{IdeaTracker:()=>eK});var a=s(90508),n=s(39268),l=s(1856),i=s(5616),r=s(22922),c=s(81531),d=s(36755),o=s(29767),x=s(57223),u=s(63964),p=s(17730),m=s(78948),h=s(81750),f=s(96213),g=s(38106);let j={open:"open",researching:"researching",answer_questions:"answerQuestions",planning:"planning",review_proposal:"reviewProposal",building:"building",verify_work:"verifyWork",done:"done",closed:"closed"},v={open:"text-[#888780]",researching:"text-[#7F77DD]",answer_questions:"text-[#C47A20]",planning:"text-[#7F77DD]",review_proposal:"text-[#C47A20]",building:"text-[#7F77DD]",verify_work:"text-[#C47A20]",done:"text-[#1D9E75]",closed:"text-[#888780]"};function b(e){let{idea:t,onClick:s}=e,l=(0,n.c)("ideaTracker"),i=t.badgeHint?j[t.badgeHint]:null,r=t.badgeHint&&v[t.badgeHint]||"text-[#888780]";return(0,a.jsxs)("div",{className:"flex items-center justify-between px-3.5 py-3 transition-colors ".concat(s?"cursor-pointer hover:bg-[#FAF8F4]":""),onClick:s?()=>s(t.uuid):void 0,children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2.5",children:[(0,a.jsx)("span",{className:"shrink-0 text-[11px] text-[#B4B2A9]",children:"IDEA"}),(0,a.jsx)("span",{className:"truncate text-[13px] text-[#2C2C2A]",children:t.title}),i&&(0,a.jsx)("span",{className:"shrink-0 rounded bg-[#F0EEEA] px-1.5 py-0.5 text-[11px] ".concat(r),children:l("badge.".concat(i))})]}),(0,a.jsx)("span",{className:"shrink-0 pl-4 text-[12px] text-[#888780]",children:(0,g.s)(t.createdAt)})]})}let N={human_conduct_required:{fill:"#7F77DD"},in_progress:{fill:"#378ADD"},todo:{stroke:"#888780"},done:{fill:"#1D9E75"}},A={todo:"todo",in_progress:"inProgress",human_conduct_required:"humanConductRequired",done:"done"};function y(e){let{status:t,ideas:s,defaultOpen:i=!0,onIdeaClick:r}=e,c=(0,n.c)("ideaTracker"),d=s.length>0,[o,x]=(0,l.useState)(!!d&&i),u=A[t]||"todo",g=N[t]||N.todo;return(0,a.jsxs)(h.Nt,{open:o,onOpenChange:x,children:[(0,a.jsxs)(h.R6,{className:"group flex w-full cursor-pointer items-center gap-2 px-0 pb-1.5 pt-0",children:[o?(0,a.jsx)(p.A,{className:"h-3.5 w-3.5 shrink-0 text-[#888780] transition-colors group-hover:text-[#2C2C2A]"}):(0,a.jsx)(m.A,{className:"h-3.5 w-3.5 shrink-0 text-[#888780] transition-colors group-hover:text-[#2C2C2A]"}),(0,a.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:g.fill,border:g.stroke?"1.5px solid ".concat(g.stroke):void 0}}),(0,a.jsx)("span",{className:"text-[13px] font-medium transition-colors group-hover:text-[#2C2C2A] ".concat(d?"text-[#5F5E5A]":"text-[#B4B2A9]"),children:c("status.".concat(u))}),(0,a.jsx)("span",{className:"text-[12px] text-[#888780] transition-colors group-hover:text-[#2C2C2A]",children:s.length})]}),d&&(0,a.jsx)(h.Ke,{children:(0,a.jsx)("div",{className:"overflow-hidden rounded-lg bg-white",children:s.map((e,t)=>(0,a.jsxs)("div",{children:[t>0&&(0,a.jsx)("div",{className:"mx-0 h-px bg-[#F0EEEA]"}),(0,a.jsx)(f.D,{entityType:"idea",entityUuid:e.uuid,badgeInside:!0,children:(0,a.jsx)(b,{idea:e,onClick:r})})]},e.uuid))})})]})}let C=["human_conduct_required","in_progress","todo","done"];function w(e){var t;let{projectUuid:s,initialData:c,onIdeaClick:p,onNewIdea:m,onEmptyChange:h}=e,f=(0,n.c)("ideaTracker"),[g,j]=(0,l.useState)(null!=(t=null==c?void 0:c.groups)?t:{}),[v,b]=(0,l.useState)(!c),[N,A]=(0,l.useState)(null),w=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/projects/".concat(s,"/ideas/tracker")),t=await e.json();t.success&&t.data?(j(t.data.groups),A(null)):A(t.error||f("error.loadFailed"))}catch(e){A(f("error.loadFailed"))}finally{b(!1)}},[s,f]);(0,u.eV)("idea",w),(0,u.eV)("proposal",w),(0,u.eV)("task",w),(0,l.useEffect)(()=>{c||w()},[w,c]);let k=C.reduce((e,t)=>e+(g[t]||[]).length,0);return((0,l.useEffect)(()=>{v||null==h||h(0===k)},[k,v,h]),v)?(0,a.jsx)("div",{className:"space-y-4",children:[1,2,3].map(e=>(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(x.E,{className:"h-5 w-32"}),(0,a.jsx)(x.E,{className:"h-12 w-full rounded-lg"}),(0,a.jsx)(x.E,{className:"h-12 w-full rounded-lg"})]},e))}):N&&0===Object.keys(g).length?(0,a.jsxs)("div",{className:"flex flex-col items-center gap-4 py-16",children:[(0,a.jsx)(d.A,{className:"h-10 w-10 text-[#E65100]"}),(0,a.jsx)("p",{className:"text-[13px] text-[#6B6B6B]",children:N}),(0,a.jsx)(r.$,{variant:"outline",size:"sm",onClick:()=>{b(!0),A(null),w()},className:"border-[#E5E0D8] text-[#2C2C2C]",children:f("actions.retry")})]}):0===k?(0,a.jsxs)("div",{className:"flex min-h-[60vh] flex-col items-center justify-center gap-3",children:[(0,a.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-[#F5F2EC]",children:(0,a.jsx)(o.A,{className:"h-5 w-5 text-[#B4B2A9]"})}),(0,a.jsx)("p",{className:"text-[13px] font-medium text-[#6B6B6B]",children:f("empty.noIdeas")}),(0,a.jsx)("p",{className:"max-w-[260px] text-center text-[12px] leading-relaxed text-[#9A9A9A]",children:f("empty.getStarted")}),m&&(0,a.jsxs)(r.$,{onClick:m,size:"sm",className:"mt-2 gap-1.5 rounded-md bg-[#C67A52] px-4 py-2 text-white hover:bg-[#B56A42]",children:[(0,a.jsx)(i.A,{className:"h-4 w-4"}),f("actions.newIdea")]})]}):(0,a.jsxs)("div",{className:"space-y-4",children:[N&&Object.keys(g).length>0&&(0,a.jsx)("div",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-[12px] text-destructive",children:N}),(0,a.jsx)("div",{className:"space-y-4",children:C.map(e=>{let t=g[e]||[];return 0===t.length?null:(0,a.jsx)(y,{status:e,ideas:t,defaultOpen:"done"!==e,onIdeaClick:p},e)})})]})}var k=s(12790),E=s.n(k),F=s(48416),B=s(90795),S=s(85226),D=s(18789),_=s(71921),T=s(56770);let U=[{key:"todo",bg:"#E65100"},{key:"inProgress",bg:"#5A9E6F"},{key:"toVerify",bg:"#7B1FA2"},{key:"done",bg:"#00796B"}],M={idea:"bg-[#C67A52]",task:"bg-[#5A9E6F]",proposal:"bg-[#1976D2]",document:"bg-[#9A9A9A]"};function R(e){let{projectUuid:t,initialData:s}=e,i=(0,n.c)(),r=(0,n.c)("ideaTracker"),[c,d]=(0,l.useState)(null!=s?s:null),[x,p]=(0,l.useState)(!s),m=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/projects/".concat(t,"/stats"));if(!e.ok)return;let s=await e.json();s.success&&d(s.data)}finally{p(!1)}},[t]);if((0,l.useEffect)(()=>{s||m()},[m,s]),(0,u.eV)(["idea","task","proposal","document"],m),x)return(0,a.jsx)("div",{className:"flex items-center justify-center py-20",children:(0,a.jsx)(S.A,{className:"h-6 w-6 animate-spin text-[#9A9A9A]"})});if(!c)return null;let{stats:h,recentActivities:f}=c,g=[{label:r("stats.totalIdeas"),value:h.ideas.total,badge:h.ideas.open>0?r("stats.openCount",{count:h.ideas.open}):null,badgeStyle:"bg-[#C67A5220] text-[#C67A52]",href:"/projects/".concat(t,"/ideas"),iconBg:"bg-[#FFF3E0]",icon:(0,a.jsx)(o.A,{className:"h-5 w-5 text-[#E65100]"})},{label:r("stats.totalTasks"),value:h.tasks.total,badge:h.tasks.inProgress>0?r("stats.activeCount",{count:h.tasks.inProgress}):null,badgeStyle:"bg-[#5A9E6F20] text-[#5A9E6F]",href:"/projects/".concat(t,"/tasks"),iconBg:"bg-[#E3F2FD]",icon:(0,a.jsx)(D.A,{className:"h-5 w-5 text-[#1976D2]"})},{label:r("stats.totalProposals"),value:h.proposals.total,badge:h.proposals.pending>0?r("stats.pendingCount",{count:h.proposals.pending}):null,badgeStyle:"bg-[#C67A5220] text-[#C67A52]",href:"/projects/".concat(t,"/proposals"),iconBg:"bg-[#F3E5F5]",icon:(0,a.jsx)(_.A,{className:"h-5 w-5 text-[#7B1FA2]"})},{label:r("stats.totalDocuments"),value:h.documents.total,badge:null,badgeStyle:"",href:"/projects/".concat(t,"/documents"),iconBg:"bg-[#E8F5E9]",icon:(0,a.jsx)(T.A,{className:"h-5 w-5 text-[#5A9E6F]"})}],j=[h.tasks.todo,h.tasks.inProgress,h.tasks.toVerify,h.tasks.done],v=h.tasks.total,b=[{label:r("stats.todoCount",{count:h.tasks.todo}),color:"#E65100"},{label:r("stats.inProgressCount",{count:h.tasks.inProgress}),color:"#5A9E6F"},{label:r("stats.toVerifyCount",{count:h.tasks.toVerify}),color:"#7B1FA2"},{label:r("stats.doneCount",{count:h.tasks.done}),color:"#00796B"}];return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3 md:gap-4 lg:grid-cols-4",children:g.map(e=>(0,a.jsx)(E(),{href:e.href,children:(0,a.jsxs)(F.Zp,{className:"cursor-pointer rounded-2xl border-0 bg-white p-3 shadow-none transition-all hover:shadow-md md:p-5",children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between md:mb-3.5",children:[(0,a.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg md:h-10 md:w-10 md:rounded-xl ".concat(e.iconBg),children:e.icon}),e.badge&&(0,a.jsx)("span",{className:"hidden rounded-lg px-2.5 py-1 text-[11px] font-medium sm:inline ".concat(e.badgeStyle),children:e.badge})]}),(0,a.jsx)("div",{className:"text-2xl font-semibold leading-none tracking-tight text-[#2C2C2C] md:text-[32px]",children:e.value}),(0,a.jsx)("div",{className:"mt-0.5 text-[12px] text-[#6B6B6B] md:text-[13px]",children:e.label})]})},e.label))}),(0,a.jsxs)("div",{className:"grid min-h-0 gap-5 lg:grid-cols-2",children:[(0,a.jsxs)(F.Zp,{className:"flex flex-col rounded-2xl border-0 bg-white p-6 shadow-none",children:[(0,a.jsxs)("div",{className:"mb-5 flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-[16px] font-semibold text-[#2C2C2C]",children:r("stats.taskPipeline")}),(0,a.jsx)("span",{className:"text-[12px] text-[#9A9A9A]",children:r("stats.totalCount",{count:v})})]}),v>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-5 flex h-3 w-full overflow-hidden rounded-md",children:j.map((e,t)=>e>0?(0,a.jsx)("div",{className:"h-full",style:{width:"".concat(e/v*100,"%"),backgroundColor:U[t].bg}},U[t].key):null)}),(0,a.jsx)("div",{className:"flex flex-wrap gap-5",children:b.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("div",{className:"h-2.5 w-2.5 rounded-sm",style:{backgroundColor:e.color}}),(0,a.jsx)("span",{className:"text-[12px] text-[#6B6B6B]",children:e.label})]},e.color))})]}):(0,a.jsx)("div",{className:"flex flex-1 items-center justify-center py-10 text-[13px] text-[#9A9A9A]",children:r("stats.noTasks")})]}),(0,a.jsxs)(F.Zp,{className:"flex flex-col rounded-2xl border-0 bg-white p-6 shadow-none",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-[16px] font-semibold text-[#2C2C2C]",children:r("stats.recentActivity")}),(0,a.jsx)(E(),{href:"/projects/".concat(t,"/activity"),className:"text-[12px] font-medium text-[#C67A52] hover:underline",children:r("stats.viewAll")})]}),f.length>0?(0,a.jsx)("div",{className:"flex flex-col",children:f.map((e,t)=>{let s=M[e.targetType]||"bg-[#9A9A9A]";return(0,a.jsxs)("div",{className:"flex items-start gap-3 py-3 ".concat(t<f.length-1?"border-b border-[#F5F2EC]":""),children:[(0,a.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full ".concat(s)}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"text-[13px] text-[#2C2C2C]",children:[e.actorName," ",e.action]}),(0,a.jsx)("span",{className:"text-[11px] text-[#9A9A9A]",children:(0,B.fw)(e.createdAt,i)})]})]},e.uuid)})}):(0,a.jsx)("div",{className:"flex flex-1 items-center justify-center py-10 text-[13px] text-[#9A9A9A]",children:r("stats.noActivity")})]})]})]})}var P=s(23675),z=s(95900),I=s(57893),L=s(9160),q=s(94903),$=s(97413),V=s(64993),O=s(57731),H=s(14554),J=s(15972),G=s(88064),K=s(51817),Z=s(5425),Q=s(84247),W=s(62929),X=s(27939),Y=s(97261),ee=s(16544),et=s(65626),es=s(73693);function ea(e){let{assignee:t}=e,s=(0,n.c)("common");return(0,a.jsxs)("div",{children:[(0,a.jsx)(G.J,{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:s("assignee")}),(0,a.jsx)("div",{className:"mt-2 flex items-center gap-2.5 rounded-lg bg-[#FAF8F4] p-3",children:t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(es.eu,{className:"h-7 w-7",children:(0,a.jsx)(es.q5,{className:"agent"===t.type?"bg-[#C67A52] text-white":"bg-[#E5E0D8] text-[#6B6B6B]",children:"agent"===t.type?(0,a.jsx)(Z.A,{className:"h-3.5 w-3.5"}):t.name.charAt(0).toUpperCase()})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm font-medium text-[#2C2C2C]",children:t.name}),(0,a.jsx)("div",{className:"text-xs text-[#6B6B6B]",children:s("agent"===t.type?"agent":"user")})]})]}):(0,a.jsx)("span",{className:"text-sm text-[#9A9A9A]",children:s("unassigned")})})]})}function en(e){let{idea:t,onRefresh:s}=e,i=(0,n.c)("ideaTracker"),r=(0,n.c)("common"),[c,d]=(0,l.useState)(null),[o,x]=(0,l.useState)(!0),p=(0,l.useCallback)(async()=>{let e=await (0,X.z)(t.uuid);e.success&&e.data&&d(e.data),x(!1)},[t.uuid]);(0,l.useEffect)(()=>{p()},[p]),(0,u.eV)("idea",p);let m=async()=>{await p(),await s()};return o?(0,a.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,a.jsx)(S.A,{className:"h-5 w-5 animate-spin text-[#C67A52]"})}):(0,a.jsxs)(ee.P.div,{variants:et.qG,initial:"initial",animate:"animate",children:[(0,a.jsx)(ea,{assignee:t.assignee}),(0,a.jsx)(Q.Separator,{className:"my-5 bg-[#F5F2EC]"}),c&&c.rounds.length>0?(0,a.jsx)("div",{children:(0,a.jsx)(W.R,{ideaUuid:t.uuid,elaboration:c,onRefresh:m})}):"open"===t.status?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-8 text-center",children:[(0,a.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#FFF3E0]",children:(0,a.jsx)(Z.A,{className:"h-5 w-5 text-[#E65100]"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-[#2C2C2C]",children:i("panel.elaborationNotStarted")}),(0,a.jsx)("p",{className:"mt-1 text-xs text-[#9A9A9A]",children:i("panel.elaborationNotStartedDesc")})]})]}):(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-8 text-center",children:[(0,a.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#E3F2FD]",children:(0,a.jsx)(Z.A,{className:"h-5 w-5 text-[#1976D2]"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-[#2C2C2C]",children:i("panel.elaborationWaiting")}),(0,a.jsx)("p",{className:"mt-1 text-xs text-[#9A9A9A]",children:i("panel.elaborationWaitingDesc")})]})]}),t.content&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Q.Separator,{className:"my-5 bg-[#F5F2EC]"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(G.J,{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:r("content")}),(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)(Y.MarkdownContent,{children:t.content})})})]})]})]})}var el=s(37915),ei=s(32470),er=s(47754),ec=s(92745);function ed(e){return e.replace(/\\n/g,"\n")}let eo={prd:"typePrd",tech_design:"typeTechDesign",adr:"typeAdr",spec:"typeSpec",guide:"typeGuide",design:"typeDesign",note:"typeNote",report:"typeReport",other:"typeOther"};var ex=s(52217);let eu=(0,ex.createServerReference)("60b39359b1beae82e742bfcfb453b7c6735582bcf3",ex.callServer,void 0,ex.findSourceMapURL,"getProposalsForIdeaAction"),ep=(0,ex.createServerReference)("60b2f7aadf5df20e5f9dc208c4ff5fb7a05a18afbe",ex.callServer,void 0,ex.findSourceMapURL,"getTasksForProposalAction");var em=s(67712);function eh(e){let{idea:t,projectUuid:s,onTaskClick:i,onDocClick:r,initialProposals:c}=e,d=(0,n.c)("ideaTracker"),[o,x]=(0,l.useState)(null!=c?c:[]),[p,m]=(0,l.useState)(!c),h=(0,l.useCallback)(async()=>{try{let e=await eu(s,t.uuid);if(e.success)return x(e.data),e.data}catch(e){em.q.error("Failed to fetch proposals:",e)}finally{m(!1)}return[]},[s,t.uuid]);(0,l.useEffect)(()=>{c||h()},[h,c]);let f=(0,l.useRef)(o);f.current=o;let{getPresence:g}=(0,er.xQ)();return((0,u.eV)("proposal",async()=>{let e=f.current;for(let l of(await h())){var t,s,a,n;let i=e.find(e=>e.uuid===l.uuid);if(!i)continue;let r=new Set((null!=(t=i.documentDrafts)?t:[]).map(e=>e.uuid)),c=new Set((null!=(s=i.taskDrafts)?s:[]).map(e=>e.uuid)),d=(null!=(a=l.documentDrafts)?a:[]).filter(e=>e.uuid&&!r.has(e.uuid)),o=(null!=(n=l.taskDrafts)?n:[]).filter(e=>e.uuid&&!c.has(e.uuid)),x=[...d.map(e=>e.uuid),...o.map(e=>e.uuid)];if(x.length>0){let e=g("proposal",l.uuid)[0];if(e)for(let t of x)(0,er.fv)({entityType:"proposal",entityUuid:l.uuid,subEntityType:"draft",subEntityUuid:t,agentUuid:e.agentUuid,agentName:e.agentName,action:"mutate"})}}}),p)?(0,a.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,a.jsx)(S.A,{className:"h-5 w-5 animate-spin text-[#C67A52]"})}):0===o.length?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[(0,a.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#F3E5F5]",children:(0,a.jsx)(_.A,{className:"h-5 w-5 text-[#7B1FA2]"})}),(0,a.jsx)("p",{className:"text-sm text-[#9A9A9A]",children:d("panel.noProposals")})]}):(0,a.jsx)("div",{className:"space-y-5",children:o.map(e=>(0,a.jsx)(eg,{proposal:e,projectUuid:s,onTaskClick:i,onDocClick:r},e.uuid))})}let ef={draft:"bg-[#F5F5F5] text-[#6B6B6B]",pending:"bg-[#FFF3E0] text-[#E65100]",approved:"bg-[#E8F5E9] text-[#5A9E6F]",rejected:"bg-[#FFEBEE] text-[#C4574C]",revised:"bg-[#E3F2FD] text-[#1976D2]",closed:"bg-[#F5F5F5] text-[#9A9A9A]"};function eg(e){let{proposal:t,projectUuid:s,onTaskClick:i,onDocClick:c}=e,d=(0,n.c)("ideaTracker"),o=(0,n.c)(),x=(0,n.c)("proposals"),u=(0,n.c)("tasks"),p=(0,n.c)("documents"),h=t.documentDrafts||[],g=t.taskDrafts||[],[j,v]=(0,l.useState)(new Set),[b,N]=(0,l.useState)("cards"),[A,y]=(0,l.useState)([]),C="approved"===t.status;(0,l.useEffect)(()=>{C&&ep(s,t.uuid).then(e=>{e.success&&y(e.data||[])}).catch(e=>em.q.error("Failed to fetch materialized tasks:",e))},[C,s,t.uuid]);let w=(0,l.useMemo)(()=>{let e=new Map;for(let t of A)e.set(t.title,t);return e},[A]),{dagTasks:k,dagEdges:F,dagHeight:B}=(0,l.useMemo)(()=>{let e=g.map(e=>{let t=w.get(e.title);return{uuid:(null==t?void 0:t.uuid)||e.uuid,title:e.title,status:(null==t?void 0:t.status)||"open",priority:e.priority||"medium"}}),t=[],s=new Map(g.map(e=>[e.uuid,e]));for(let e of g)if(e.dependsOnDraftUuids)for(let a of e.dependsOnDraftUuids){let n=w.get(e.title),l=s.get(a),i=l?w.get(l.title):void 0;t.push({from:(null==n?void 0:n.uuid)||e.uuid,to:(null==i?void 0:i.uuid)||a})}return{dagTasks:e,dagEdges:t,dagHeight:Math.max(350,90*e.length)}},[g,w]),S=C?A.filter(e=>"done"===e.status||"closed"===e.status).length:0;return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"text-[14px] font-semibold text-[#2C2C2C] truncate flex-1",children:t.title}),(0,a.jsx)(O.E,{className:"text-[11px] font-semibold border-0 shrink-0 ".concat(ef[t.status]||""),children:o("status.".concat(t.status))})]}),t.description&&(0,a.jsx)("div",{className:"max-h-[120px] overflow-y-auto text-[13px] leading-relaxed text-[#4A4A4A] prose prose-sm max-w-none [&_h1]:text-sm [&_h2]:text-[13px] [&_h3]:text-xs [&_p]:text-[13px] [&_p]:text-[#4A4A4A] [&_p]:my-1.5 [&_li]:text-[13px] [&_li]:text-[#4A4A4A] [&_ul]:my-1 [&_ol]:my-1 [&_strong]:text-[#2C2C2C]",children:(0,a.jsx)(Y.MarkdownContent,{children:ed(t.description)})}),(0,a.jsxs)(E(),{href:"/projects/".concat(s,"/proposals/").concat(t.uuid),className:"flex items-center gap-1 text-[13px] font-medium text-[#C67A52] hover:underline",children:[d("panel.viewProposal"),(0,a.jsx)(m.A,{className:"h-3.5 w-3.5"})]}),h.length>0&&(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-[#9A9A9A]",children:x(C?"documents":"documentDrafts")}),(0,a.jsx)("span",{className:"text-[11px] text-[#9A9A9A]",children:h.length})]}),(0,a.jsx)("div",{className:"space-y-0",children:h.map((e,s)=>(0,a.jsx)(f.D,{entityType:"proposal",entityUuid:t.uuid,subEntityType:"draft",subEntityUuid:e.uuid||"draft-".concat(s),badgeInside:!0,children:(0,a.jsxs)(r.$,{variant:"ghost",className:"w-full justify-start h-auto text-left flex items-center gap-2.5 py-3.5 hover:bg-[#FAF8F4] transition-colors cursor-pointer -mx-1 px-1 rounded-lg",onClick:()=>e.content&&(null==c?void 0:c({title:e.title,type:e.type,content:e.content})),children:[(0,a.jsx)(el.A,{className:"h-3.5 w-3.5 shrink-0 text-[#B4B2A9]"}),(0,a.jsx)(O.E,{variant:"outline",className:"shrink-0 text-[10px] font-medium border-[#E5E0D8] text-[#6B6B6B] bg-[#F5F2EC] px-2 py-0.5 font-mono",children:p(eo[e.type]||"typeOther")}),(0,a.jsx)("span",{className:"flex-1 min-w-0 text-left text-[13px] text-[#2C2C2A] truncate",children:e.title})]})},e.uuid||s))})]}),(g.length>0||A.length>0)&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between pb-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-[#9A9A9A]",children:x(C?"tasks":"taskDrafts")}),(0,a.jsx)("span",{className:"text-[11px] text-[#9A9A9A]",children:C&&A.length>0?A.length:g.length})]}),(0,a.jsxs)("span",{className:"text-[12px] text-[#9A9A9A]",children:[S,"/",C&&A.length>0?A.length:g.length]})]}),(0,a.jsx)("div",{className:"-mx-6 border-t border-[#E5E0D8]"}),F.length>0&&(0,a.jsxs)("div",{className:"flex gap-0.5 rounded-lg border border-[#E5E0D8] bg-[#F7F6F3] p-0.5 mt-3 w-fit",children:[(0,a.jsx)(r.$,{variant:"ghost",size:"sm",onClick:()=>N("cards"),className:"rounded-md px-2.5 py-1 h-auto text-[11px] font-medium transition-colors ".concat("cards"===b?"bg-white text-[#2C2C2C] shadow-sm":"text-[#9A9A9A] hover:text-[#6B6B6B]"),children:x("cardsView")}),(0,a.jsx)(r.$,{variant:"ghost",size:"sm",onClick:()=>N("dag"),className:"rounded-md px-2.5 py-1 h-auto text-[11px] font-medium transition-colors ".concat("dag"===b?"bg-white text-[#2C2C2C] shadow-sm":"text-[#9A9A9A] hover:text-[#6B6B6B]"),children:u("dagView")})]}),"cards"===b&&(0,a.jsx)("div",{className:"space-y-0",children:C&&A.length>0?A.map(e=>(0,a.jsx)(f.D,{entityType:"task",entityUuid:e.uuid,badgeInside:!0,children:(0,a.jsx)(eb,{task:{uuid:e.uuid,title:e.title},expanded:!1,onToggle:()=>{},onNavigate:i?()=>i(e.uuid):void 0,taskStatus:e.status})},e.uuid)):g.map((e,s)=>(0,a.jsx)(f.D,{entityType:"proposal",entityUuid:t.uuid,subEntityType:"draft",subEntityUuid:e.uuid,badgeInside:!0,children:(0,a.jsx)(eb,{task:e,expanded:j.has(s),onToggle:()=>{v(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t})}})},e.uuid))}),"dag"===b&&(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)(ec._u,{tasks:k,edges:F,readonly:!0,height:B,onNodeClick:i})})]}),0===h.length&&0===g.length&&0===A.length&&(0,a.jsx)("p",{className:"text-xs text-[#9A9A9A] italic",children:x("emptyContainer")})]})}let ej={open:"border-[#D9D9D9] bg-white",assigned:"border-[#1976D2] bg-[#1976D2]",in_progress:"border-[#5A9E6F] bg-[#5A9E6F]",to_verify:"border-[#7B1FA2] bg-[#7B1FA2]",done:"border-[#00796B] bg-[#00796B]",closed:"border-[#9A9A9A] bg-[#9A9A9A]"},ev={open:null,assigned:null,in_progress:{className:"bg-[#E8F5E9] text-[#5A9E6F]",key:"inProgress"},to_verify:{className:"bg-[#F3E5F5] text-[#7B1FA2]",key:"toVerify"},done:{className:"bg-[#E0F2F1] text-[#00796B]",key:"done"},closed:{className:"bg-[#F5F5F5] text-[#9A9A9A]",key:"done"}};function eb(e){let{task:t,expanded:s,onToggle:l,onNavigate:i,taskStatus:c}=e,d=(0,n.c)("proposals"),o=(0,n.c)("acceptanceCriteria"),x=(0,n.c)("status"),u=t.acceptanceCriteriaItems||[],h=!!(t.description||u.length>0),f=c?ej[c]||ej.open:"border-[#D9D9D9] bg-white",g=c?ev[c]:null,j=(0,a.jsx)("span",{className:"shrink-0 h-2 w-2 rounded-full border-[1.5px] ".concat(f," transition-colors")}),v=(0,a.jsx)("span",{className:"flex-1 min-w-0 text-[13px] leading-snug truncate text-[#6B6B6B]",children:t.title}),b=g?(0,a.jsx)("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium ".concat(g.className),children:x(g.key)}):null;return i?(0,a.jsxs)(r.$,{variant:"ghost",onClick:i,className:"w-full justify-start h-auto text-left flex items-center gap-2.5 py-4 cursor-pointer hover:bg-[#FAF8F4] -mx-1 px-1 rounded-lg transition-colors",children:[(0,a.jsx)(el.A,{className:"h-3.5 w-3.5 shrink-0 text-[#B4B2A9]"}),j,v,b]}):(0,a.jsxs)("div",{children:[(0,a.jsxs)(r.$,{variant:"ghost",onClick:h?l:void 0,className:"w-full justify-start h-auto text-left flex items-center gap-2.5 py-4 ".concat(h?"cursor-pointer hover:bg-[#FAF8F4] -mx-1 px-1 rounded-lg":""," transition-colors"),children:[s?(0,a.jsx)(p.A,{className:"h-3.5 w-3.5 shrink-0 text-[#B4B2A9]"}):(0,a.jsx)(m.A,{className:"h-3.5 w-3.5 shrink-0 text-[#B4B2A9]"}),j,v,b]}),s&&h&&(0,a.jsxs)("div",{className:"pb-3 pl-5 space-y-3",children:[t.description&&(0,a.jsx)("p",{className:"text-[11px] leading-relaxed text-[#6B6B6B]",children:t.description}),u.length>0&&(0,a.jsxs)("div",{className:"rounded-lg bg-[#FAF8F4] p-3 space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(ei.A,{className:"h-3.5 w-3.5 text-[#888780]"}),(0,a.jsx)("span",{className:"text-[11px] font-semibold text-[#2C2C2C]",children:d("taskAcceptanceCriteria")})]}),(0,a.jsx)("div",{className:"space-y-1.5",children:u.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsx)("p",{className:"text-[11px] leading-snug text-[#4A4A4A] flex-1",children:e.description}),!1!==e.required&&(0,a.jsx)("span",{className:"shrink-0 text-[10px] font-medium text-[#E65100]",children:o("required")})]},t))})]})]})]})}let eN=(0,s(66206).A)("message-square-text",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]);var eA=s(60532),ey=s(97964);let eC=(0,ex.createServerReference)("4082a8b6b8c78a86ea5c6b630e56b4b12d17d684f0",ex.callServer,void 0,ex.findSourceMapURL,"getElaborationAction");function ew(e){let{idea:t,proposals:s,tasks:i,onSelectTask:r}=e,c=(0,n.c)("ideaTracker"),d=(0,n.c)(),[x,u]=(0,l.useState)(null),[h,f]=(0,l.useState)(new Set);(0,l.useEffect)(()=>{"open"!==t.status&&eC(t.uuid).then(e=>{e.success&&e.data&&u(e.data)})},[t.uuid,t.status]);let g=(0,l.useMemo)(()=>"open"===t.status?"idea_created":"elaborating"===t.status||0===s.length?"elaboration":s.some(e=>"approved"===e.status)&&i.length>0?"tasks":"proposal",[t.status,s,i]),j=(0,l.useMemo)(()=>{let e=["idea_created","elaboration","proposal","tasks"],t=e.indexOf(g);return e.map((e,s)=>({id:e,labelKey:({idea_created:"panel.timeline.ideaCreated",elaboration:"panel.timeline.elaboration",proposal:"panel.timeline.proposal",tasks:"panel.timeline.tasksProgress"})[e],status:s<t?"completed":s===t?"active":"upcoming",icon:({idea_created:(0,a.jsx)(o.A,{className:"h-3.5 w-3.5"}),elaboration:(0,a.jsx)(eN,{className:"h-3.5 w-3.5"}),proposal:(0,a.jsx)(_.A,{className:"h-3.5 w-3.5"}),tasks:(0,a.jsx)(ei.A,{className:"h-3.5 w-3.5"})})[e]}))},[g]);(0,l.useEffect)(()=>{let e=j.find(e=>"active"===e.status);e&&f(new Set([e.id]))},[g]);let v=(0,l.useCallback)(e=>{f(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),b=(0,l.useMemo)(()=>"open"===t.status?c("panel.timeline.noElaboration"):"skipped"===t.elaborationStatus?c("panel.timeline.elaborationSkipped"):"resolved"===t.elaborationStatus&&x?c("panel.timeline.elaborationComplete",{count:x.summary.totalQuestions}):"elaborating"===t.status?c("panel.timeline.elaborationInProgress"):x&&x.summary.totalQuestions>0?c("panel.timeline.elaborationComplete",{count:x.summary.totalQuestions}):c("panel.timeline.noElaboration"),[t.status,t.elaborationStatus,x,c]),N=(0,l.useMemo)(()=>{if(0===s.length)return c("panel.timeline.noProposal");let e=s.filter(e=>"approved"===e.status).length,t=s.filter(e=>"pending"===e.status).length;if(e>0&&1===s.length)return c("panel.timeline.proposalApproved");if(e>0)return c("panel.timeline.proposalsApproved",{count:e,total:s.length});if(t>0)return c("panel.timeline.proposalPending");switch(s[0].status){case"draft":default:return c("panel.timeline.proposalDraft");case"rejected":return c("panel.timeline.proposalRejected")}},[s,c]),A=(0,l.useMemo)(()=>{let e=0,t=0;for(let r of s){var a,n,l,i;e+=null!=(l=null==(a=r.documentDrafts)?void 0:a.length)?l:0,t+=null!=(i=null==(n=r.taskDrafts)?void 0:n.length)?i:0}return{docCount:e,taskDraftCount:t}},[s]),y=(0,l.useMemo)(()=>{let e=i.filter(e=>"done"===e.status||"closed"===e.status).length,t=i.filter(e=>"in_progress"===e.status).length;return{done:e,inProgress:t,toVerify:i.filter(e=>"to_verify"===e.status).length,open:i.filter(e=>"open"===e.status||"assigned"===e.status).length,total:i.length}},[i]);return(0,a.jsx)("div",{className:"space-y-0",children:j.map((e,n)=>{let l=h.has(e.id),o=n===j.length-1;return(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center w-5 shrink-0",children:[(0,a.jsx)("div",{className:"mt-1",children:"completed"===e.status?(0,a.jsx)("div",{className:"h-5 w-5 rounded-full bg-[#E0F2F1] flex items-center justify-center",children:(0,a.jsx)(eA.A,{className:"h-3 w-3 text-[#00796B]"})}):"active"===e.status?(0,a.jsx)("div",{className:"h-5 w-5 rounded-full bg-[#C67A52] flex items-center justify-center",children:(0,a.jsx)(ey.A,{className:"h-2 w-2 fill-white text-white"})}):(0,a.jsx)("div",{className:"h-5 w-5 rounded-full border-2 border-dashed border-[#D9D9D9] flex items-center justify-center",children:(0,a.jsx)(ey.A,{className:"h-2 w-2 text-[#D9D9D9]"})})}),!o&&(0,a.jsx)("div",{className:"flex-1 w-px bg-[#E5E0D8] mt-1 min-h-[8px]"})]}),(0,a.jsxs)("div",{className:"flex-1 min-w-0 ".concat(o?"pb-0":"pb-4"),children:[(0,a.jsxs)("button",{onClick:()=>v(e.id),className:"flex items-center gap-1.5 w-full text-left group cursor-pointer",children:[l?(0,a.jsx)(p.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] shrink-0"}):(0,a.jsx)(m.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] shrink-0"}),(0,a.jsx)("span",{className:"text-[13px] font-medium ".concat("active"===e.status?"text-[#C67A52]":"completed"===e.status?"text-[#2C2C2C]":"text-[#9A9A9A]"),children:c(e.labelKey)}),!l&&(0,a.jsx)("span",{className:"text-[11px] text-[#9A9A9A] truncate ml-1",children:(e=>{switch(e.id){case"idea_created":return t.createdBy?t.createdBy.name:"";case"elaboration":return b;case"proposal":return N;case"tasks":return i.length>0?c("panel.timeline.tasksComplete",{done:y.done,total:y.total}):c("panel.timeline.noTasks");default:return""}})(e)})]}),(e=>{let n=h.has(e.id);switch(e.id){case"idea_created":return n?(0,a.jsxs)("div",{className:"mt-2 space-y-1.5",children:[t.createdBy&&(0,a.jsx)("p",{className:"text-[12px] text-[#6B6B6B]",children:c("panel.timeline.createdBy",{name:t.createdBy.name})}),(0,a.jsx)("p",{className:"text-[12px] text-[#9A9A9A]",children:(0,B.fw)(t.createdAt,d)}),t.content&&(0,a.jsxs)("p",{className:"text-[12px] text-[#6B6B6B] line-clamp-2",children:[t.content.slice(0,120),t.content.length>120?"...":""]})]}):null;case"elaboration":return n?(0,a.jsxs)("div",{className:"mt-2 space-y-1.5",children:[(0,a.jsx)("p",{className:"text-[12px] text-[#6B6B6B]",children:b}),x&&x.rounds.length>0&&(0,a.jsx)("p",{className:"text-[12px] text-[#9A9A9A]",children:c("panel.timeline.rounds",{count:x.rounds.length})})]}):null;case"proposal":return n?(0,a.jsxs)("div",{className:"mt-2 space-y-1.5",children:[(0,a.jsx)("p",{className:"text-[12px] text-[#6B6B6B]",children:N}),s.length>0&&(0,a.jsxs)("div",{className:"space-y-1",children:[A.docCount>0&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-[12px] text-[#9A9A9A]",children:[(0,a.jsx)(T.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:c("panel.timeline.documents",{count:A.docCount})})]}),A.taskDraftCount>0&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-[12px] text-[#9A9A9A]",children:[(0,a.jsx)(ei.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:c("panel.timeline.tasks",{count:A.taskDraftCount})})]})]})]}):null;case"tasks":return n?(0,a.jsx)("div",{className:"mt-2 space-y-2",children:0===i.length?(0,a.jsx)("p",{className:"text-[12px] text-[#9A9A9A]",children:c("panel.timeline.noTasks")}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("div",{className:"flex-1 h-1.5 rounded-full bg-[#F0EDE8] overflow-hidden flex",children:[y.done>0&&(0,a.jsx)("div",{className:"h-full bg-[#00796B]",style:{width:"".concat(y.done/y.total*100,"%")}}),y.inProgress>0&&(0,a.jsx)("div",{className:"h-full bg-[#1976D2]",style:{width:"".concat(y.inProgress/y.total*100,"%")}}),y.toVerify>0&&(0,a.jsx)("div",{className:"h-full bg-[#7B1FA2]",style:{width:"".concat(y.toVerify/y.total*100,"%")}})]}),(0,a.jsx)("span",{className:"text-[11px] text-[#9A9A9A] shrink-0",children:c("panel.timeline.tasksComplete",{done:y.done,total:y.total})})]}),(0,a.jsxs)("div",{className:"space-y-1",children:[i.slice(0,5).map(e=>(0,a.jsxs)("button",{onClick:()=>r(e.uuid),className:"flex items-center gap-2 w-full text-left rounded-md px-2 py-1.5 hover:bg-[#F5F2EC] transition-colors group cursor-pointer",children:[(0,a.jsx)(el.A,{className:"h-3 w-3 text-[#D9D9D9] shrink-0 group-hover:text-[#C67A52]"}),(0,a.jsx)("span",{className:"h-2 w-2 rounded-full shrink-0 ".concat((0,B.eT)(e.status))}),(0,a.jsx)("span",{className:"flex-1 text-[12px] text-[#2C2C2C] truncate group-hover:text-[#C67A52]",children:e.title})]},e.uuid)),i.length>5&&(0,a.jsx)("p",{className:"text-[11px] text-[#9A9A9A] px-2",children:c("panel.timeline.moreItems",{count:i.length-5})})]})]})}):null;default:return null}})(e)]})]},e.id)})})}let ek=(0,ex.createServerReference)("6095a6a65bb1f4cccd4da68147eff8347a828c133a",ex.callServer,void 0,ex.findSourceMapURL,"getReportsForIdeaAction");function eE(e){let{projectUuid:t,ideaUuid:s,proposals:i,onDocClick:c}=e,d=(0,n.c)("idea"),o=(0,n.c)("documents"),[x,p]=(0,l.useState)([]),[m,h]=(0,l.useState)(!0),f=i.some(e=>"approved"===e.status),g=(0,l.useCallback)(async()=>{if(!f){p([]),h(!1);return}try{let e=await ek(t,s);if(e.success){let t=[...e.data].sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime());p(t.map(e=>{var t;return{uuid:e.uuid,title:e.title,type:e.type,content:null!=(t=e.content)?t:null,createdAt:e.createdAt}}))}}catch(e){em.q.error("Failed to fetch reports for idea:",e)}finally{h(!1)}},[t,s,f]);return((0,l.useEffect)(()=>{h(!0),g()},[g]),(0,u.eV)("document",g),m)?f?(0,a.jsx)("div",{className:"flex items-center justify-center py-3",children:(0,a.jsx)(S.A,{className:"h-4 w-4 animate-spin text-[#C67A52]"})}):null:0===x.length?null:(0,a.jsxs)("div",{className:"mt-6 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,a.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-[#9A9A9A]",children:d("reportsList")}),(0,a.jsx)("span",{className:"text-[11px] text-[#9A9A9A]",children:x.length}),(0,a.jsxs)("span",{className:"text-[11px] text-[#B4B2A9]",children:["\xb7 ",d("reportsAcrossProposals")]})]}),(0,a.jsx)("div",{className:"space-y-0",children:x.map(e=>(0,a.jsxs)(r.$,{variant:"ghost",className:"w-full justify-start h-auto text-left flex items-center gap-2.5 py-3.5 hover:bg-[#FAF8F4] transition-colors cursor-pointer -mx-1 px-1 rounded-lg",onClick:()=>{var t;return c({title:e.title,type:"report",content:null!=(t=e.content)?t:""})},children:[(0,a.jsx)(el.A,{className:"h-3.5 w-3.5 shrink-0 text-[#B4B2A9]"}),(0,a.jsx)(O.E,{variant:"outline",className:"shrink-0 text-[10px] font-medium border-[#E5E0D8] text-[#6B6B6B] bg-[#F5F2EC] px-2 py-0.5 font-mono",children:o(eo[e.type]||"typeOther")}),(0,a.jsx)("span",{className:"flex-1 min-w-0 text-left text-[13px] text-[#2C2C2A] truncate",children:e.title})]},e.uuid))})]})}var eF=s(41111);let eB=["in_progress","to_verify","open","assigned","done","closed"];function eS(e){let{tasks:t,projectUuid:s,proposalUuids:i,onSelectTask:r}=e,c=(0,n.c)("ideaTracker"),[d,o]=(0,l.useState)({}),x=(0,l.useMemo)(()=>t.map(e=>e.uuid),[t]),h=(0,l.useCallback)(async()=>{if(0===x.length)return;let e=await (0,eF.h)(x);e.success&&e.data&&o(e.data)},[x]);(0,l.useEffect)(()=>{h()},[h]),(0,u.eV)("task",h);let g=(0,l.useMemo)(()=>{let e=[];for(let s of eB){let a=t.filter(e=>e.status===s);a.length>0&&e.push({status:s,tasks:a})}let s=new Set(eB),a=t.filter(e=>!s.has(e.status));return a.length>0&&e.push({status:"other",tasks:a}),e},[t]),[j,v]=(0,l.useState)(new Set),b=(0,l.useMemo)(()=>{let e=t.length,s=t.filter(e=>"done"===e.status||"closed"===e.status).length,a=0,n=0,l=0,i=0;for(let e of t)e.acceptanceSummary&&(a+=e.acceptanceSummary.total,n+=e.acceptanceSummary.passed,l+=e.acceptanceSummary.required,i+=e.acceptanceSummary.requiredPassed);return{total:e,done:s,acTotal:a,acPassed:n,acRequired:l,acRequiredPassed:i}},[t]);return 0===t.length?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[(0,a.jsx)(ei.A,{className:"h-8 w-8 text-[#D9D9D9]"}),(0,a.jsx)("p",{className:"text-sm text-[#9A9A9A]",children:c("panel.taskList.noTasks")})]}):(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg bg-[#FAFAF7] px-3 py-2",children:[(0,a.jsx)("span",{className:"text-[12px] text-[#6B6B6B]",children:c("panel.taskList.summary",{done:b.done,total:b.total})}),b.acTotal>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-[12px] text-[#D9D9D9]",children:"\xb7"}),(0,a.jsx)("span",{className:"text-[12px] text-[#6B6B6B]",children:c("panel.taskList.acSummary",{passed:b.acRequiredPassed,total:b.acRequired})})]}),i.length>0&&(0,a.jsxs)(E(),{href:"/projects/".concat(s,"/tasks?proposalUuids=").concat(i.join(",")),className:"ml-auto flex items-center gap-1 text-[13px] font-medium text-[#C67A52] shrink-0",children:[c("panel.taskList.viewKanban"),(0,a.jsx)(m.A,{className:"h-3.5 w-3.5"})]})]}),g.map(e=>{let t=j.has(e.status);return(0,a.jsxs)("div",{children:[(0,a.jsxs)("button",{onClick:()=>{var t;return t=e.status,void v(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"flex items-center gap-2 w-full text-left py-1.5 group cursor-pointer",children:[t?(0,a.jsx)(m.A,{className:"h-3.5 w-3.5 text-[#9A9A9A]"}):(0,a.jsx)(p.A,{className:"h-3.5 w-3.5 text-[#9A9A9A]"}),(0,a.jsx)("span",{className:"h-2 w-2 rounded-full shrink-0 ".concat((0,B.eT)(e.status))}),(0,a.jsx)("span",{className:"text-[13px] font-medium text-[#2C2C2C]",children:function(e,t){switch(e){case"in_progress":return t("panel.taskList.inProgress");case"to_verify":return t("panel.taskList.toVerify");case"open":return t("panel.taskList.open");case"assigned":return t("panel.taskList.assigned");case"done":return t("panel.taskList.done");case"closed":return t("panel.taskList.closed");default:return e}}(e.status,c)}),(0,a.jsx)("span",{className:"text-[11px] text-[#9A9A9A] ml-auto",children:e.tasks.length})]}),!t&&(0,a.jsx)("div",{className:"ml-3 space-y-0.5",children:e.tasks.map(e=>{let t=d[e.uuid]||0,s=e.acceptanceSummary;return(0,a.jsx)(f.D,{entityType:"task",entityUuid:e.uuid,badgeInside:!0,children:(0,a.jsxs)("button",{onClick:()=>r(e.uuid),className:"flex items-center gap-2 w-full text-left rounded-md px-2.5 py-2 hover:bg-[#F5F2EC] transition-colors group cursor-pointer",children:[(0,a.jsx)(el.A,{className:"h-3.5 w-3.5 text-[#D9D9D9] shrink-0 group-hover:text-[#C67A52]"}),(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full shrink-0 ".concat((0,B.eT)(e.status))}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[#2C2C2C] truncate group-hover:text-[#C67A52]",children:e.title}),s&&s.total>0&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-0.5 shrink-0 rounded-full bg-[#F0EDE8] px-1.5 py-0.5 text-[10px] text-[#6B6B6B]",children:[(0,a.jsx)(eA.A,{className:"h-2.5 w-2.5"}),s.requiredPassed,"/",s.required]}),e.assignee&&(0,a.jsxs)("span",{className:"shrink-0 inline-flex items-center gap-1 text-[10px] text-[#9A9A9A] max-w-[72px] truncate",title:e.assignee.name,children:[(0,a.jsx)(q.A,{className:"h-2.5 w-2.5 shrink-0"}),e.assignee.name.split(/[@\s]/)[0]]}),t>0&&(0,a.jsx)("span",{className:"inline-flex items-center justify-center h-4 min-w-[16px] rounded-full bg-[#E8F5E9] text-[#2E7D32] text-[9px] font-semibold shrink-0",title:c("panel.taskList.workersActive",{count:t}),children:t})]})},e.uuid)})})]},e.status)})]})}var eD=s(88179);function e_(e){let{ideaUuid:t}=e,s=(0,n.c)(),[i,r]=(0,l.useState)([]),[c,d]=(0,l.useState)(!0),o=(0,l.useCallback)(async()=>{d(!0),r((await (0,eD.x)(t)).activities),d(!1)},[t]);return(0,l.useEffect)(()=>{o()},[o]),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)(G.J,{className:"text-[11px] font-medium uppercase tracking-wider text-[#9A9A9A]",children:s("common.activity")}),(0,a.jsx)("div",{className:"mt-2",children:c?(0,a.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,a.jsx)(S.A,{className:"h-4 w-4 animate-spin text-[#9A9A9A]"})}):0===i.length?(0,a.jsx)("p",{className:"text-sm text-[#9A9A9A] italic",children:s("common.noActivity")}):i.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-stretch gap-2.5",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center w-2 shrink-0",children:[(0,a.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full border-[1.5px] border-[#D9D9D9] bg-white"}),t<i.length-1&&(0,a.jsx)("div",{className:"flex-1 w-px bg-[#E5E0D8] mt-1"})]}),(0,a.jsxs)("div",{className:"flex-1 pb-3",children:[(0,a.jsx)("p",{className:"text-[13px] text-[#2C2C2C]",children:function(e,t){let{action:s,actorName:a}=e;switch(s){case"created":case"idea_created":return t("activity.ideaCreated",{actor:a});case"assigned":case"idea_assigned":return t("activity.ideaAssigned",{actor:a});case"claimed":case"idea_claimed":return t("activity.ideaClaimed",{actor:a});case"released":case"idea_released":return t("activity.ideaReleased",{actor:a});case"status_changed":case"idea_status_changed":return t("activity.ideaStatusChanged",{actor:a});case"elaboration_started":return t("activity.elaborationStarted",{actor:a});case"elaboration_answered":return t("activity.elaborationAnswered",{actor:a});case"elaboration_skipped":return t("activity.elaborationSkipped",{actor:a});case"elaboration_resolved":return t("activity.elaborationResolved",{actor:a});case"elaboration_followup":return t("activity.elaborationFollowup",{actor:a});default:return t("activity.genericAction",{actor:a,action:s})}}(e,s)}),(0,a.jsx)("p",{className:"text-[11px] text-[#9A9A9A]",children:(0,B.fw)(e.createdAt,s)})]})]},e.uuid))})]})}var eT=s(5810);function eU(e){let{ideaUuid:t,currentUserUuid:s,commentCount:i,onCommentCountChange:r}=e,c=(0,n.c)("ideaTracker"),[d,o]=(0,l.useState)("comments");return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex gap-1 rounded-lg bg-[#F5F2EC] p-0.5",children:[(0,a.jsxs)("button",{onClick:()=>o("comments"),className:"flex-1 rounded-md px-3 py-1.5 text-[13px] font-medium transition-colors flex items-center justify-center gap-1.5 cursor-pointer ".concat("comments"===d?"bg-white text-[#2C2C2C] shadow-sm":"text-[#9A9A9A] hover:text-[#6B6B6B]"),children:[c("panel.activityTab.comments"),i>0&&(0,a.jsx)("span",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full bg-[#F5F2EC] text-[#6B6B6B] text-[10px] font-semibold leading-none",children:i})]}),(0,a.jsx)("button",{onClick:()=>o("activity"),className:"flex-1 rounded-md px-3 py-1.5 text-[13px] font-medium transition-colors cursor-pointer ".concat("activity"===d?"bg-white text-[#2C2C2C] shadow-sm":"text-[#9A9A9A] hover:text-[#6B6B6B]"),children:c("panel.activityTab.activity")})]}),(0,a.jsx)("div",{children:"activity"===d?(0,a.jsx)(e_,{ideaUuid:t}):(0,a.jsx)(eT.$,{targetType:"idea",targetUuid:t,currentUserUuid:s,onCountChange:r,compact:!0})})]})}var eM=s(17156),eR=s(70633);function eP(e){let{title:t,type:s,content:i,mode:c="overlay",onClose:d,onBack:o}=e,x=(0,n.c)("documents"),[u,p]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=setTimeout(()=>p(!0),300);return()=>clearTimeout(e)},[]),(0,l.useEffect)(()=>{let e=e=>{"Escape"!==e.key||e.defaultPrevented||(e.preventDefault(),d())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[d]);let m="sidebyside"===c;return(0,a.jsxs)(a.Fragment,{children:[!m&&(0,a.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:d}),(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(m?"z-40 ".concat(u?"":"animate-in slide-in-from-right duration-300"):"z-50 right-0 ".concat(u?"":"animate-in slide-in-from-right duration-300")),style:{width:"min(100%, ".concat(B.L8,"px)"),...m?{right:"".concat(B.L8,"px")}:{}},children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-[#F5F2EC] px-6 py-5",children:[o&&(0,a.jsx)(r.$,{variant:"ghost",size:"icon",className:"mr-2 h-8 w-8 shrink-0",onClick:o,children:(0,a.jsx)(eR.A,{className:"h-4 w-4 text-[#6B6B6B]"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h2",{className:"text-base font-semibold text-[#2C2C2C] truncate",children:t}),(0,a.jsx)("div",{className:"mt-1.5",children:(0,a.jsx)(O.E,{variant:"outline",className:"text-[10px] font-medium border-[#E5E0D8] text-[#6B6B6B] bg-[#F5F2EC] px-2 py-0.5 font-mono",children:x(eo[s]||"typeOther")})})]}),(0,a.jsx)(r.$,{variant:"outline",size:"icon",className:"ml-4 h-8 w-8 shrink-0 border-[#E5E0D8]",onClick:d,children:(0,a.jsx)(L.A,{className:"h-4 w-4 text-[#6B6B6B]"})})]}),(0,a.jsx)(V.F,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:(0,a.jsx)("div",{className:"px-6 py-5 text-[13px] leading-relaxed text-[#2C2C2A] prose prose-sm max-w-none [&_h1]:text-lg [&_h1]:font-semibold [&_h1]:mt-4 [&_h1]:mb-2 [&_h2]:text-base [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mb-1.5 [&_h3]:text-sm [&_h3]:font-medium [&_h3]:mt-2 [&_h3]:mb-1 [&_p]:text-[13px] [&_p]:text-[#4A4A4A] [&_p]:my-1.5 [&_li]:text-[13px] [&_li]:text-[#4A4A4A] [&_ul]:my-1 [&_ol]:my-1 [&_strong]:text-[#2C2C2C] [&_code]:text-[12px] [&_code]:bg-[#F5F2EC] [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_pre]:bg-[#FAF8F4] [&_pre]:p-3 [&_pre]:rounded-lg [&_pre]:my-2",children:(0,a.jsx)(Y.MarkdownContent,{children:ed(i)})})})]})]})}var ez=s(84103),eI=s(32260),eL=s(18347);let eq=(0,ex.createServerReference)("40f5f73a95848d5d294c8b99d3d03d1f8681dc85ba",ex.callServer,void 0,ex.findSourceMapURL,"getIdeaAction"),e$=(0,ex.createServerReference)("402d48989a661e892a10a3113d5f7056dcad295723",ex.callServer,void 0,ex.findSourceMapURL,"getTaskAction");var eV=s(92715);function eO(e){let{ideaUuid:t,projectUuid:s,currentUserUuid:i,onClose:c}=e,d=(0,n.c)(),o=(0,n.c)("ideaTracker"),x=(0,n.c)("status"),p=(0,P.useRouter)(),[m,h]=(0,l.useState)(null),[f,j]=(0,l.useState)(!0),[v,b]=(0,l.useState)(null),[N,A]=(0,l.useState)([]),[y,C]=(0,l.useState)([]),[w,k]=(0,l.useState)("overview"),[E,F]=(0,l.useState)(new Set(["overview"])),[D,_]=(0,l.useState)(!1),[T,U]=(0,l.useState)(0),[M,R]=(0,l.useState)(!1),[Z,Q]=(0,l.useState)(!1),[W,X]=(0,l.useState)(!1),[Y,ee]=(0,l.useState)(""),[et,es]=(0,l.useState)(""),[ea,el]=(0,l.useState)(!1),[ei,er]=(0,l.useState)(null),[ec,ed]=(0,l.useState)(!1),[eo,ex]=(0,l.useState)(null),[ef,eg]=(0,l.useState)(null),[ej,ev]=(0,l.useState)(null),eb=(0,l.useCallback)(e=>{ev(null),ex(e)},[]),eN=(0,l.useCallback)(e=>{ex(null),eg(null),ev(e)},[]),[eA,ey]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=window.matchMedia("(min-width: 960px)");ey(e.matches);let t=e=>ey(e.matches);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let[eC,ek]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=setTimeout(()=>ek(!0),300);return()=>clearTimeout(e)},[]);let eF=(0,l.useCallback)(e=>{let t=new URLSearchParams(window.location.search);t.set("tab",e),window.history.replaceState(null,"","".concat(window.location.pathname,"?").concat(t.toString()))},[]),eB=(0,l.useCallback)(async()=>{try{let e=await eq(t);e.success?(h(e.data),b(null)):b(o("Not found"===e.error?"panel.notFound":"panel.loadFailed"))}catch(e){b(o("panel.loadFailed"))}finally{j(!1)}},[t,o]);(0,l.useEffect)(()=>{j(!0),eB()},[eB]),(0,u.eV)("idea",eB),(0,u.eV)("proposal",eB),(0,u.eV)("task",eB);let eD=null==m?void 0:m.uuid,e_=null==m?void 0:m.status,eT=(0,l.useCallback)(async()=>{if(!eD||"open"===e_)return void A([]);try{let e=await eu(s,eD);e.success&&A(e.data)}catch(e){em.q.error("Failed to fetch proposals:",e)}},[s,eD,e_]);(0,l.useEffect)(()=>{eT()},[eT]),(0,u.eV)("proposal",eT);let eR=(0,l.useCallback)(async()=>{let e=N.filter(e=>"approved"===e.status);if(0===e.length)return void C([]);try{let t=(await Promise.all(e.map(e=>ep(s,e.uuid)))).flatMap(e=>e.success&&e.data?e.data.map(e=>{var t,s,a;return{uuid:e.uuid,title:e.title,status:e.status,commentCount:null!=(t=e.commentCount)?t:0,assignee:null!=(s=e.assignee)?s:null,acceptanceSummary:null!=(a=e.acceptanceSummary)?a:null}}):[]);C(t)}catch(e){em.q.error("Failed to fetch tasks:",e)}},[s,N]);(0,l.useEffect)(()=>{eR()},[eR]),(0,u.eV)("task",eR);let eO=(0,l.useMemo)(()=>m?function(e,t,s){let a=["overview"];return a.push("elaboration"),t.length>0&&a.push("proposal"),s.length>0&&a.push("tasks"),a.push("activity"),a}(0,N,y):["overview","activity"],[m,N,y]),eH=(0,l.useRef)(new URLSearchParams(window.location.search).get("tab")),eJ=m?function(e){switch(e){case"open":case"researching":case"answer_questions":return"elaboration";case"planning":case"review_proposal":return"proposal";case"building":case"verify_work":return"tasks";default:return"overview"}}(m.badgeHint):"overview";(0,l.useEffect)(()=>{let e;if(!m||D)return;let t=eH.current;if(t)if(!eO.includes(t))return;else e=t,eH.current=null,_(!0);else if(eO.includes(eJ))e=eJ;else{if("overview"!==eJ)return;e="overview"}k(e),F(t=>new Set([...t,e])),eF(e)},[null==m?void 0:m.uuid,eJ,eO]),(0,l.useEffect)(()=>{_(!1)},[t]),(0,l.useEffect)(()=>{eO.includes(w)||k("overview")},[eO,w]);let eG=(0,l.useMemo)(()=>y.filter(e=>"in_progress"===e.status||"assigned"===e.status||"to_verify"===e.status).length,[y]),eK=(0,l.useCallback)(()=>{if(!eo)return void eg(null);e$(eo).then(e=>{e.success&&eg(e.data)}).catch(e=>em.q.error("Failed to load task details:",e))},[eo]);(0,l.useEffect)(()=>{eK()},[eK]),(0,u.eV)("task",eK),(0,l.useEffect)(()=>{X(!1),ee((null==m?void 0:m.title)||""),es((null==m?void 0:m.content)||""),er(null)},[null==m?void 0:m.uuid,null==m?void 0:m.title,null==m?void 0:m.content]);let eZ=()=>{X(!1),ee((null==m?void 0:m.title)||""),es((null==m?void 0:m.content)||""),er(null)},eQ=async()=>{if(!m||!Y.trim())return void er(d("ideas.titleRequired"));el(!0),er(null);let e=await (0,eI.J)({ideaUuid:m.uuid,projectUuid:s,title:Y.trim(),content:et.trim()||null});el(!1),e.success?(X(!1),await eB(),p.refresh()):er(e.error||d("ideas.updateFailed"))},eW=async()=>{if(!m)return;Q(!0);let e=await (0,eL.Z)(m.uuid,s);Q(!1),e.success&&(c(),p.refresh())},eX=(null==m?void 0:m.derivedStatus)||"todo",eY=!!m&&"elaborated"!==m.status,e0=(null==m?void 0:m.elaborationStatus)==="resolved",e2=(null==m?void 0:m.status)==="elaborating"&&!e0;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:c}),(0,a.jsxs)("div",{className:"fixed right-0 top-14 md:top-0 z-50 flex h-[calc(100%-3.5rem)] md:h-full w-full md:w-[480px] flex-col bg-white shadow-xl border-l border-[#E5E0D8] ".concat(eC?"":"animate-in slide-in-from-right duration-300"),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-[#F5F2EC] px-6 py-5",children:[(0,a.jsx)("div",{className:"flex-1 min-w-0",children:f?(0,a.jsx)("div",{className:"h-5 w-40 animate-pulse rounded bg-[#F5F2EC]"}):m?W?(0,a.jsx)("h2",{className:"text-base font-semibold text-[#2C2C2C]",children:d("ideas.editIdea")}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{className:"text-base font-semibold text-[#2C2C2C] truncate",children:m.title}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center gap-2",children:[(0,a.jsx)(O.E,{className:B._5[eX]||B._5.todo,children:m.badgeHint?o("badge.".concat(B.Wl[m.badgeHint]||"open")):x(B.Bj[eX]||"todo")}),(0,a.jsx)("span",{className:"text-xs text-[#9A9A9A]",children:(0,g.r)(m.createdAt)})]})]}):(0,a.jsx)("h2",{className:"text-base font-semibold text-[#2C2C2C]",children:o("panel.notFound")})}),(0,a.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[m&&!W&&(0,a.jsx)(r.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-[#E5E0D8]",onClick:()=>ed(!0),title:d("ideas.actions.move"),"aria-label":d("ideas.actions.move"),children:(0,a.jsx)(z.A,{className:"h-4 w-4 text-[#6B6B6B]"})}),m&&"elaborated"!==m.status&&!W&&(0,a.jsx)(r.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-[#E5E0D8]",onClick:()=>{m&&(ee(m.title),es(m.content||""),er(null),X(!0))},title:d("ideas.editIdea"),children:(0,a.jsx)(I.A,{className:"h-4 w-4 text-[#6B6B6B]"})}),(0,a.jsx)(r.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-[#E5E0D8]",onClick:W?eZ:c,children:(0,a.jsx)(L.A,{className:"h-4 w-4 text-[#6B6B6B]"})})]})]}),m&&!f&&!W&&(0,a.jsx)("div",{className:"border-b border-[#F5F2EC] px-6",children:(0,a.jsx)("div",{className:"flex gap-0 -mb-px",children:eO.map(e=>(0,a.jsxs)("button",{onClick:()=>{k(e),_(!0),F(t=>new Set([...t,e])),eF(e)},className:"relative flex items-center gap-1.5 px-3 py-2.5 text-[13px] font-medium transition-colors cursor-pointer ".concat(w===e?"text-[#C67A52] border-b-2 border-[#C67A52]":"text-[#9A9A9A] hover:text-[#6B6B6B]"),children:[o("panel.tabs.".concat(e)),"tasks"===e&&eG>0&&(0,a.jsx)("span",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full bg-[#E3F2FD] text-[#1976D2] text-[10px] font-semibold leading-none",children:eG}),"activity"===e&&T>0&&(0,a.jsx)("span",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full bg-[#F5F2EC] text-[#6B6B6B] text-[10px] font-semibold leading-none",children:T})]},e))})}),(0,a.jsx)(V.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:f?(0,a.jsxs)("div",{className:"flex flex-1 items-center justify-center py-12",children:[(0,a.jsx)(S.A,{className:"h-6 w-6 animate-spin text-[#C67A52]"}),(0,a.jsx)("span",{className:"ml-2 text-sm text-[#9A9A9A]",children:o("loading")})]}):v?(0,a.jsx)("div",{className:"flex flex-1 items-center justify-center py-12",children:(0,a.jsx)("p",{className:"text-sm text-[#9A9A9A]",children:v})}):m?W?(0,a.jsxs)("div",{className:"space-y-5",children:[ei&&(0,a.jsx)("div",{className:"rounded-lg bg-destructive/10 p-3 text-sm text-destructive",children:ei}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(G.J,{htmlFor:"edit-title",className:"text-[13px] font-medium text-[#2C2C2C]",children:d("ideas.titleLabel")}),(0,a.jsx)(H.p,{id:"edit-title",value:Y,onChange:e=>ee(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)(G.J,{htmlFor:"edit-content",className:"text-[13px] font-medium text-[#2C2C2C]",children:d("common.content")}),(0,a.jsx)(J.T,{id:"edit-content",value:et,onChange:e=>es(e.target.value),rows:8,className:"border-[#E5E0D8] text-sm resize-none focus-visible:ring-[#C67A52]"})]})]}):(0,a.jsxs)(a.Fragment,{children:[E.has("overview")&&(0,a.jsxs)("div",{style:{display:"overview"===w?"block":"none"},children:[(0,a.jsx)(ew,{idea:m,proposals:N,tasks:y,onSelectTask:eb}),(0,a.jsx)(eE,{projectUuid:s,ideaUuid:m.uuid,proposals:N,onDocClick:eN})]}),eO.includes("elaboration")&&E.has("elaboration")&&(0,a.jsx)("div",{style:{display:"elaboration"===w?"block":"none"},children:(0,a.jsx)(en,{idea:m,onRefresh:eB})}),eO.includes("proposal")&&E.has("proposal")&&(0,a.jsx)("div",{style:{display:"proposal"===w?"block":"none"},children:(0,a.jsx)(eh,{idea:m,projectUuid:s,onTaskClick:eb,onDocClick:eN,initialProposals:N})}),eO.includes("tasks")&&E.has("tasks")&&(0,a.jsx)("div",{style:{display:"tasks"===w?"block":"none"},children:(0,a.jsx)(eS,{tasks:y,projectUuid:s,proposalUuids:N.filter(e=>"approved"===e.status).map(e=>e.uuid),onSelectTask:eb})}),E.has("activity")&&(0,a.jsx)("div",{style:{display:"activity"===w?"block":"none"},children:(0,a.jsx)(eU,{ideaUuid:m.uuid,currentUserUuid:i,commentCount:T,onCommentCountChange:U})})]}):null})}),m&&!f&&(0,a.jsx)("div",{className:"border-t border-[#F5F2EC] px-6 py-4",children:W?(0,a.jsxs)("div",{className:"flex items-center justify-end gap-3",children:[(0,a.jsx)(r.$,{variant:"outline",className:"border-[#E5E0D8]",onClick:eZ,disabled:ea,children:d("common.cancel")}),(0,a.jsx)(r.$,{className:"bg-[#C67A52] hover:bg-[#B56A42] text-white",onClick:eQ,disabled:ea||!Y.trim(),children:ea?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.A,{className:"mr-2 h-4 w-4 animate-spin"}),d("common.save")]}):d("common.save")})]}):(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[eY&&(0,a.jsxs)(r.$,{variant:"outline",className:"shrink-0 border-[#E5E0D8] rounded-md px-4 py-2 text-[13px] font-medium",onClick:()=>R(!0),children:[(0,a.jsx)(q.A,{className:"mr-2 h-4 w-4"}),m.assignee?d("common.reassign"):d("common.assign")]}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:e2&&(0,a.jsx)("span",{className:"text-[11px] text-[#9A9A9A]",children:d("elaboration.elaborationRequiredHint")})}),(0,a.jsxs)(K.Lt,{children:[(0,a.jsx)(K.tv,{asChild:!0,children:(0,a.jsx)(r.$,{variant:"outline",size:"icon",className:"shrink-0 h-8 w-8 border-[#E5E0D8] text-[#EF4444] hover:bg-[#FFEBEE] hover:text-[#EF4444] hover:border-[#EF4444]",children:(0,a.jsx)($.A,{className:"h-4 w-4"})})}),(0,a.jsxs)(K.EO,{children:[(0,a.jsxs)(K.wd,{children:[(0,a.jsx)(K.r7,{children:d("ideas.deleteIdea")}),(0,a.jsx)(K.$v,{children:d("ideas.deleteIdeaConfirm",{title:m.title})})]}),(0,a.jsxs)(K.ck,{children:[(0,a.jsx)(K.Zr,{children:d("common.cancel")}),(0,a.jsx)(K.Rx,{variant:"destructive",onClick:eW,disabled:Z,children:Z?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.A,{className:"mr-2 h-4 w-4 animate-spin"}),d("common.delete")]}):d("common.delete")})]})]})]})]})})]}),(0,a.jsx)(ez.h,{open:ec,onOpenChange:ed,ideaUuid:t,projectUuid:s,onMoved:()=>c()}),M&&m&&(0,a.jsx)(eV.i,{idea:{uuid:m.uuid,title:m.title,content:m.content,status:m.status,assignee:m.assignee?{type:m.assignee.type,uuid:m.assignee.uuid,name:m.assignee.name}:null},projectUuid:s,currentUserUuid:i,onClose:()=>{R(!1),eB()}}),eo&&ef&&(0,a.jsx)(eM.v,{task:ef,projectUuid:s,currentUserUuid:i,mode:eA?"sidebyside":"overlay",onClose:()=>{ex(null),eg(null)},onBack:()=>{ex(null),eg(null)}}),ej&&(0,a.jsx)(eP,{title:ej.title,type:ej.type,content:ej.content,mode:eA?"sidebyside":"overlay",onClose:()=>ev(null),onBack:()=>ev(null)})]})}var eH=s(97438),eJ=s(42305);function eG(e){let{open:t,onOpenChange:s,projectUuid:i,onCreated:c}=e,d=(0,n.c)("ideaTracker"),o=(0,n.c)("common"),[x,u]=(0,l.useState)(""),[p,m]=(0,l.useState)(""),[h,f]=(0,l.useState)(!1),[g,j]=(0,l.useState)(null),v=async()=>{let e=x.trim();if(e){f(!0),j(null);try{var t;let a=await fetch("/api/projects/".concat(i,"/ideas"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,content:p.trim()||void 0})}),n=await a.json();n.success&&(null==(t=n.data)?void 0:t.uuid)?(u(""),m(""),s(!1),null==c||c(n.data.uuid)):j(n.error||d("error.createFailed"))}catch(e){j(d("error.createFailed"))}finally{f(!1)}}};return(0,a.jsx)(eH.lG,{open:t,onOpenChange:s,children:(0,a.jsxs)(eH.Cf,{className:"sm:max-w-[480px]",children:[(0,a.jsx)(eH.c7,{children:(0,a.jsx)(eH.L3,{children:d("newIdea.title")})}),(0,a.jsxs)("div",{className:"space-y-4 py-2",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(G.J,{htmlFor:"idea-title",children:d("newIdea.ideaTitle")}),(0,a.jsx)(H.p,{id:"idea-title",value:x,onChange:e=>u(e.target.value),placeholder:d("newIdea.titlePlaceholder"),autoFocus:!0,onKeyDown:e=>{!(0,eJ.P)(e)&&"Enter"===e.key&&!e.shiftKey&&x.trim()&&(e.preventDefault(),v())}})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)(G.J,{htmlFor:"idea-content",children:[d("newIdea.description"),(0,a.jsxs)("span",{className:"ml-1 text-xs font-normal text-[#9A9A9A]",children:["(",o("optional"),")"]})]}),(0,a.jsx)(J.T,{id:"idea-content",value:p,onChange:e=>m(e.target.value),placeholder:d("newIdea.descriptionPlaceholder"),rows:4,className:"resize-none"})]}),g&&(0,a.jsx)("div",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-[12px] text-destructive",children:g})]}),(0,a.jsxs)(eH.Es,{children:[(0,a.jsx)(r.$,{variant:"outline",onClick:()=>s(!1),disabled:h,children:o("cancel")}),(0,a.jsxs)(r.$,{onClick:v,disabled:h||!x.trim(),className:"bg-[#C67A52] hover:bg-[#B56A42] text-white",children:[h?(0,a.jsx)(S.A,{className:"mr-2 h-4 w-4 animate-spin"}):null,o("create")]})]})]})})}function eK(e){let{projectUuid:t,currentUserUuid:s,initialTrackerData:d,initialStatsData:o,initialSelectedIdeaUuid:x}=e,u=(0,n.c)("ideaTracker"),[p,m]=(0,l.useState)("ideas"),[h,f]=(0,l.useState)(!1),[g,j]=(0,l.useState)(!1),v="/projects/".concat(t,"/dashboard"),{selectedId:b,openPanel:N,closePanel:A}=(0,c.T)(v,x);return(0,a.jsxs)("div",{className:"flex h-full flex-col",children:[!h&&(0,a.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex gap-0.5 rounded-lg border border-[#E5E0D8] p-0.5",children:[(0,a.jsx)(r.$,{variant:"ghost",size:"sm",onClick:()=>m("ideas"),className:"rounded-md px-3 py-1 h-auto text-[12px] font-medium transition-colors ".concat("ideas"===p?"bg-white text-[#2C2C2C] shadow-sm":"text-[#9A9A9A] hover:text-[#6B6B6B]"),children:u("tabs.ideas")}),(0,a.jsx)(r.$,{variant:"ghost",size:"sm",onClick:()=>m("stats"),className:"rounded-md px-3 py-1 h-auto text-[12px] font-medium transition-colors ".concat("stats"===p?"bg-white text-[#2C2C2C] shadow-sm":"text-[#9A9A9A] hover:text-[#6B6B6B]"),children:u("tabs.stats")})]}),"ideas"===p&&(0,a.jsxs)(r.$,{onClick:()=>j(!0),size:"sm",className:"gap-1.5 rounded-md bg-[#C67A52] px-3.5 py-2 text-white hover:bg-[#B56A42]",children:[(0,a.jsx)(i.A,{className:"h-4 w-4"}),u("actions.newIdea")]})]}),"ideas"===p?(0,a.jsx)(w,{projectUuid:t,initialData:d,onIdeaClick:N,onNewIdea:()=>j(!0),onEmptyChange:f}):(0,a.jsx)(R,{projectUuid:t,initialData:o}),(0,a.jsx)(eG,{open:g,onOpenChange:j,projectUuid:t,onCreated:e=>N(e)}),b&&(0,a.jsx)(eO,{ideaUuid:b,projectUuid:t,currentUserUuid:s,onClose:A})]})}},26049:(e,t,s)=>{"use strict";s.d(t,{ProjectSettingsModal:()=>v});var a=s(90508),n=s(1856),l=s(23675),i=s(39268),r=s(52309),c=s(85226),d=s(22922),o=s(14554),x=s(88064),u=s(15972),p=s(97438),m=s(84247),h=s(51817),f=s(52217);let g=(0,f.createServerReference)("60e7e554b32e453f3c930e14410f5077ad183f596f",f.callServer,void 0,f.findSourceMapURL,"updateProjectAction"),j=(0,f.createServerReference)("4006dd9f7d3437ab1478c6be32917a71073ed4fab0",f.callServer,void 0,f.findSourceMapURL,"deleteProjectAction");function v(e){let{projectUuid:t,projectName:s,projectDescription:f}=e,v=(0,i.c)(),b=(0,l.useRouter)(),[N,A]=(0,n.useState)(!1),[y,C]=(0,n.useState)(s),[w,k]=(0,n.useState)(f||""),[E,F]=(0,n.useState)(!1),[B,S]=(0,n.useState)(!1),D=async()=>{F(!0);let e=await g(t,{name:y,description:w||null});F(!1),e.success&&(A(!1),b.refresh())},_=async()=>{S(!0);let e=await j(t);e&&!e.success&&S(!1)};return(0,a.jsxs)(p.lG,{open:N,onOpenChange:A,children:[(0,a.jsx)(p.zM,{asChild:!0,children:(0,a.jsxs)(d.$,{variant:"outline",size:"sm",className:"gap-1.5 rounded-lg border-[#E5E2DC] bg-white text-[12px] font-normal text-[#2C2C2C] hover:border-[#C67A52] hover:bg-white",children:[(0,a.jsx)(r.A,{className:"h-3.5 w-3.5 text-[#6B6B6B]"}),v("dashboard.settings")]})}),(0,a.jsxs)(p.Cf,{className:"gap-0 overflow-hidden rounded-2xl border-0 p-0 sm:max-w-[520px]",children:[(0,a.jsx)(p.c7,{className:"px-7 py-6",children:(0,a.jsx)(p.L3,{className:"text-[20px] font-semibold tracking-tight text-[#2C2C2C]",children:v("projectSettings.title")})}),(0,a.jsx)(m.Separator,{className:"bg-[#E5E2DC]"}),(0,a.jsxs)("div",{className:"flex flex-col gap-7 p-7",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,a.jsx)("h3",{className:"text-[14px] font-semibold text-[#2C2C2C]",children:v("projectSettings.basicInfo")}),(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsx)(x.J,{className:"text-[12px] font-medium text-[#6B6B6B]",children:v("projectSettings.projectName")}),(0,a.jsx)(o.p,{value:y,onChange:e=>C(e.target.value),className:"h-11 rounded-[10px] border-[#E5E2DC] text-[14px] text-[#2C2C2C] focus-visible:ring-[#C67A52]"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsx)(x.J,{className:"text-[12px] font-medium text-[#6B6B6B]",children:v("projectSettings.description")}),(0,a.jsx)(u.T,{value:w,onChange:e=>k(e.target.value),rows:3,className:"resize-none rounded-[10px] border-[#E5E2DC] text-[14px] text-[#2C2C2C] focus-visible:ring-[#C67A52]"})]}),(0,a.jsx)(d.$,{onClick:D,disabled:E||!y.trim(),className:"w-fit rounded-[10px] bg-[#C67A52] px-6 text-[13px] font-semibold text-white hover:bg-[#B56A42]",children:E?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.A,{className:"mr-2 h-4 w-4 animate-spin"}),v("projectSettings.saving")]}):v("projectSettings.saveChanges")})]}),(0,a.jsx)(m.Separator,{className:"bg-[#E5E2DC]"}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("h3",{className:"text-[14px] font-semibold text-[#C4574C]",children:v("projectSettings.dangerZone")}),(0,a.jsx)("div",{className:"rounded-xl border border-[#C4574C40] bg-[#C4574C08] px-[18px] py-4",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsx)("span",{className:"text-[13px] font-semibold text-[#2C2C2C]",children:v("projectSettings.deleteTitle")}),(0,a.jsx)("span",{className:"text-[12px] text-[#6B6B6B]",children:v("projectSettings.deleteDescription")})]}),(0,a.jsxs)(h.Lt,{children:[(0,a.jsx)(h.tv,{asChild:!0,children:(0,a.jsx)(d.$,{variant:"destructive",size:"sm",className:"ml-4 shrink-0 rounded-lg bg-[#C4574C] px-[18px] text-[12px] font-medium hover:bg-[#B3463B]",children:v("common.delete")})}),(0,a.jsxs)(h.EO,{children:[(0,a.jsxs)(h.wd,{children:[(0,a.jsx)(h.r7,{children:v("projectOverview.deleteProject")}),(0,a.jsx)(h.$v,{children:v("projectOverview.deleteProjectConfirm",{name:s})})]}),(0,a.jsxs)(h.ck,{children:[(0,a.jsx)(h.Zr,{children:v("common.cancel")}),(0,a.jsx)(h.Rx,{variant:"destructive",onClick:_,disabled:B,children:B?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.A,{className:"mr-2 h-4 w-4 animate-spin"}),v("common.delete")]}):v("common.delete")})]})]})]})]})})]})]})]})]})}},29767:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(66206).A)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]])},32470:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(66206).A)("list-checks",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]])},37915:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(66206).A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},38476:(e,t,s)=>{"use strict";s.r(t),s.d(t,{Collapsible:()=>j,CollapsibleContent:()=>A,CollapsibleTrigger:()=>b,Content:()=>E,Root:()=>w,Trigger:()=>k,createCollapsibleScope:()=>h});var a=s(1856),n=s(33328),l=s(21032),i=s(66249),r=s(99457),c=s(34124),d=s(93367),o=s(19900),x=s(40577),u=s(90508),p="Collapsible",[m,h]=(0,l.A)(p),[f,g]=m(p),j=a.forwardRef((e,t)=>{let{__scopeCollapsible:s,open:n,defaultOpen:l,disabled:r,onOpenChange:c,...o}=e,[m,h]=(0,i.i)({prop:n,defaultProp:null!=l&&l,onChange:c,caller:p});return(0,u.jsx)(f,{scope:s,disabled:r,contentId:(0,x.B)(),open:m,onOpenToggle:a.useCallback(()=>h(e=>!e),[h]),children:(0,u.jsx)(d.sG.div,{"data-state":C(m),"data-disabled":r?"":void 0,...o,ref:t})})});j.displayName=p;var v="CollapsibleTrigger",b=a.forwardRef((e,t)=>{let{__scopeCollapsible:s,...a}=e,l=g(v,s);return(0,u.jsx)(d.sG.button,{type:"button","aria-controls":l.contentId,"aria-expanded":l.open||!1,"data-state":C(l.open),"data-disabled":l.disabled?"":void 0,disabled:l.disabled,...a,ref:t,onClick:(0,n.mK)(e.onClick,l.onOpenToggle)})});b.displayName=v;var N="CollapsibleContent",A=a.forwardRef((e,t)=>{let{forceMount:s,...a}=e,n=g(N,e.__scopeCollapsible);return(0,u.jsx)(o.C,{present:s||n.open,children:e=>{let{present:s}=e;return(0,u.jsx)(y,{...a,ref:t,present:s})}})});A.displayName=N;var y=a.forwardRef((e,t)=>{let{__scopeCollapsible:s,present:n,children:l,...i}=e,o=g(N,s),[x,p]=a.useState(n),m=a.useRef(null),h=(0,c.s)(t,m),f=a.useRef(0),j=f.current,v=a.useRef(0),b=v.current,A=o.open||x,y=a.useRef(A),w=a.useRef(void 0);return a.useEffect(()=>{let e=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,r.N)(()=>{let e=m.current;if(e){w.current=w.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let t=e.getBoundingClientRect();f.current=t.height,v.current=t.width,y.current||(e.style.transitionDuration=w.current.transitionDuration,e.style.animationName=w.current.animationName),p(n)}},[o.open,n]),(0,u.jsx)(d.sG.div,{"data-state":C(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!A,...i,ref:h,style:{"--radix-collapsible-content-height":j?"".concat(j,"px"):void 0,"--radix-collapsible-content-width":b?"".concat(b,"px"):void 0,...e.style},children:A&&l})});function C(e){return e?"open":"closed"}var w=j,k=b,E=A},52309:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(66206).A)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},56669:(e,t,s)=>{Promise.resolve().then(s.bind(s,13257)),Promise.resolve().then(s.bind(s,26049))},57223:(e,t,s)=>{"use strict";s.d(t,{E:()=>l});var a=s(90508),n=s(24377);function l(e){let{className:t,...s}=e;return(0,a.jsx)("div",{"data-slot":"skeleton",className:(0,n.cn)("bg-accent animate-pulse rounded-md",t),...s})}},71921:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(66206).A)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]])},78948:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(66206).A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},84247:(e,t,s)=>{"use strict";s.d(t,{Separator:()=>i});var a=s(90508);s(1856);var n=s(5725),l=s(24377);function i(e){let{className:t,orientation:s="horizontal",decorative:i=!0,...r}=e;return(0,a.jsx)(n.b,{"data-slot":"separator",decorative:i,orientation:s,className:(0,l.cn)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...r})}},95900:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(66206).A)("arrow-right-left",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]])}},e=>{e.O(0,[41282,93151,41752,30996,57084,59764,12079,18944,12790,26885,21932,16544,30724,94655,27201,16551,97784,14753,45532,70552,11207,70093,76803,55469,84541,23466,52206,35486,19898,74951,65496,77358],()=>e(e.s=56669)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[61461],{12294:(e,t,n)=>{Promise.resolve().then(n.bind(n,52053)),Promise.resolve().then(n.bind(n,90299)),Promise.resolve().then(n.bind(n,65514)),Promise.resolve().then(n.bind(n,98861)),Promise.resolve().then(n.bind(n,38476)),Promise.resolve().then(n.bind(n,74542)),Promise.resolve().then(n.bind(n,71350)),Promise.resolve().then(n.bind(n,39025)),Promise.resolve().then(n.bind(n,75368)),Promise.resolve().then(n.bind(n,89684)),Promise.resolve().then(n.bind(n,58057)),Promise.resolve().then(n.bind(n,6512)),Promise.resolve().then(n.bind(n,25051)),Promise.resolve().then(n.bind(n,4374)),Promise.resolve().then(n.bind(n,19345)),Promise.resolve().then(n.bind(n,79919)),Promise.resolve().then(n.bind(n,17533)),Promise.resolve().then(n.bind(n,99545)),Promise.resolve().then(n.bind(n,63197)),Promise.resolve().then(n.bind(n,65326)),Promise.resolve().then(n.bind(n,48218)),Promise.resolve().then(n.bind(n,56260)),Promise.resolve().then(n.bind(n,60322)),Promise.resolve().then(n.bind(n,79834)),Promise.resolve().then(n.bind(n,6947)),Promise.resolve().then(n.bind(n,88878)),Promise.resolve().then(n.bind(n,34857)),Promise.resolve().then(n.bind(n,97006)),Promise.resolve().then(n.bind(n,45841)),Promise.resolve().then(n.t.bind(n,12790,23)),Promise.resolve().then(n.bind(n,23504)),Promise.resolve().then(n.bind(n,89971)),Promise.resolve().then(n.bind(n,88578)),Promise.resolve().then(n.bind(n,76546))},23504:(e,t,n)=>{"use strict";n.d(t,{DocumentActions:()=>x});var r=n(90508),s=n(23603),o=n(1856),a=n(23675),i=n(39268),d=n(97413),l=n(85226),c=n(67587),m=n(22922),u=n(51817),h=n(52217);let p=(0,h.createServerReference)("40d8906f634dbcbc3c0b2ae23b135cae2100990f40",h.callServer,void 0,h.findSourceMapURL,"deleteDocumentAction");function v(e){let{documentUuid:t,documentTitle:n,projectUuid:s}=e,h=(0,i.c)("documents"),v=(0,i.c)("common"),x=(0,a.useRouter)(),[f,b]=o.useState(!1),[j,g]=o.useState(!1),[w,y]=o.useState(null),P=async()=>{g(!0),y(null);let e=await p(t);if(e.success){c.oR.success(h("deleteSuccess")),b(!1),g(!1),x.replace("/projects/".concat(e.projectUuid,"/documents")),x.refresh();return}let n="not_found"===e.error?h("deleteFailedNotFound"):h("deleteFailed");y(n),c.oR.error(n),g(!1)};return(0,r.jsxs)(u.Lt,{open:f,onOpenChange:e=>{!j&&(b(e),e||y(null))},children:[(0,r.jsx)(u.tv,{asChild:!0,children:(0,r.jsxs)(m.$,{variant:"destructive",size:"sm",children:[(0,r.jsx)(d.A,{className:"mr-2 h-4 w-4"}),v("delete")]})}),(0,r.jsxs)(u.EO,{children:[(0,r.jsxs)(u.wd,{children:[(0,r.jsx)(u.r7,{children:h("deleteDocument")}),(0,r.jsx)(u.$v,{children:h("deleteDocumentDescription",{title:n})})]}),w&&(0,r.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:w}),(0,r.jsxs)(u.ck,{children:[(0,r.jsx)(u.Zr,{disabled:j,children:v("cancel")}),(0,r.jsx)(m.$,{variant:"destructive",disabled:j,onClick:P,children:j?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.A,{className:"mr-2 h-4 w-4 animate-spin"}),v("delete")]}):v("delete")})]})]})]})}function x(e){let{documentUuid:t,projectUuid:n,documentTitle:o,canDelete:a,exportDoc:i}=e;return(0,r.jsxs)("div",{className:"flex gap-2",children:[i?(0,r.jsx)(s.E,{document:i}):(0,r.jsx)(s.E,{documentUuid:t}),a&&(0,r.jsx)(v,{documentUuid:t,documentTitle:o,projectUuid:n})]})}},23603:(e,t,n)=>{"use strict";n.d(t,{E:()=>x});var r=n(90508),s=n(1856),o=n(67587),a=n(56770),i=n(66206);let d=(0,i.A)("file-type",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]]),l=(0,i.A)("file-spreadsheet",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);var c=n(85226);let m=(0,i.A)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);var u=n(39268),h=n(66343),p=n(22922),v=n(67712);function x(e){let{document:t,documentUuid:i,variant:x="default"}=e,f=(0,u.c)(),{exportDocument:b,isExporting:j,exportError:g}=function(){let[e,t]=(0,s.useState)(!1),[r,o]=(0,s.useState)(null);return{exportDocument:(0,s.useCallback)(async(e,r)=>{t(!0),o(null);try{let t,o,i=function(e){let t=e.replace(/[\\/:*?"<>|]/g,"").replace(/\s+/g," ").trim().replace(/\s/g,"-");return t.length>0?t:"document"}(e.title);if("md"===r){let{exportAsMarkdownBlob:r}=await n.e(50681).then(n.bind(n,50681));t=r(e),o="md"}else if("pdf"===r){let{exportAsPdf:r}=await n.e(34966).then(n.bind(n,34966));t=await r(e),o="pdf"}else if("docx"===r){let{exportAsDocx:r}=await n.e(9634).then(n.bind(n,9634));t=await r(e),o="docx"}else throw Error("Unsupported export format: ".concat(String(r)));var s=t,a="".concat(i,".").concat(o);let d=URL.createObjectURL(s),l=document.createElement("a");l.href=d,l.download=a,l.rel="noopener",l.style.display="none",document.body.appendChild(l),l.click(),document.body.removeChild(l),setTimeout(()=>URL.revokeObjectURL(d),1e3)}catch(e){o(e instanceof Error?e.message:String(e)),v.q.error("useDocumentExport export failed",e)}finally{t(!1)}},[]),isExporting:e,exportError:r}}(),[w,y]=(0,s.useState)(null);async function P(e){y(e);try{let l=t;if(!l&&i){var n,r,s,a,d;let e=await fetch("/api/documents/".concat(i)),t=await e.json();if(!t.success||!t.data)return void o.oR.error(f("export.exportError"));let c=t.data;l={title:c.title,content:null!=(s=c.content)?s:"",type:c.type,version:c.version,createdAt:c.createdAt,updatedAt:c.updatedAt,createdByName:null!=(a=null==(n=c.createdBy)?void 0:n.name)?a:"",projectName:null!=(d=null==(r=c.project)?void 0:r.name)?d:""}}l&&await b(l,e)}finally{y(null),g&&o.oR.error(g)}}let k=[{format:"md",labelKey:"export.formatMd",icon:a.A},{format:"pdf",labelKey:"export.formatPdf",icon:d},{format:"docx",labelKey:"export.formatDocx",icon:l}],C="compact"===x;return(0,r.jsxs)(h.rI,{children:[(0,r.jsx)(h.ty,{asChild:!0,children:(0,r.jsxs)(p.$,{variant:"ghost"===x?"ghost":"outline",size:C?"sm":"default",className:C?"h-6 text-[11px] text-muted-foreground hover:text-foreground":"border-[#E5E0D8] text-[#6B6B6B] gap-1.5",disabled:j,children:[j?(0,r.jsx)(c.A,{className:"".concat(C?"h-3 w-3":"h-4 w-4"," animate-spin")}):(0,r.jsx)(m,{className:C?"h-3 w-3":"h-4 w-4"}),!C&&f("export.exportDocument")]})}),(0,r.jsx)(h.SQ,{align:"end",className:"w-48",children:k.map(e=>{let{format:t,labelKey:n,icon:s}=e;return(0,r.jsxs)(h._2,{onClick:e=>{e.stopPropagation(),e.preventDefault(),P(t)},disabled:j,children:[w===t?(0,r.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,r.jsx)(s,{className:"h-4 w-4"}),f(n)]},t)})})]})}},66343:(e,t,n)=>{"use strict";n.d(t,{SQ:()=>d,_2:()=>l,mB:()=>c,rI:()=>a,ty:()=>i});var r=n(90508);n(1856);var s=n(39025),o=n(24377);function a(e){let{...t}=e;return(0,r.jsx)(s.Root,{"data-slot":"dropdown-menu",...t})}function i(e){let{...t}=e;return(0,r.jsx)(s.Trigger,{"data-slot":"dropdown-menu-trigger",...t})}function d(e){let{className:t,sideOffset:n=4,...a}=e;return(0,r.jsx)(s.Portal,{children:(0,r.jsx)(s.Content,{"data-slot":"dropdown-menu-content",sideOffset:n,className:(0,o.cn)("bg-popover text-popover-foreground z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md","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",t),...a})})}function l(e){let{className:t,inset:n,variant:a="default",...i}=e;return(0,r.jsx)(s.Item,{"data-slot":"dropdown-menu-item","data-inset":n,"data-variant":a,className:(0,o.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive","data-[inset]:pl-8 [&_svg]:size-4",t),...i})}function c(e){let{className:t,...n}=e;return(0,r.jsx)(s.Separator,{"data-slot":"dropdown-menu-separator",className:(0,o.cn)("bg-border -mx-1 my-1 h-px",t),...n})}},76546:(e,t,n)=>{"use strict";n.d(t,{FormattedDateTime:()=>o});var r=n(90508),s=n(38106);function o(e){let{date:t}=e;return(0,r.jsx)(r.Fragment,{children:(0,s.r)(t)})}},88578:(e,t,n)=>{"use strict";n.d(t,{DocumentContent:()=>u});var r=n(90508),s=n(1856),o=n(23675),a=n(39268),i=n(97261),d=n(48416),l=n(22922),c=n(52217);let m=(0,c.createServerReference)("70b736a9808d5b1e6a7b1c310f41d94ddede28350a",c.callServer,void 0,c.findSourceMapURL,"updateDocumentAction");function u(e){let{documentUuid:t,projectUuid:n,initialContent:c}=e,u=(0,a.c)(),h=(0,o.useRouter)(),[p,v]=(0,s.useState)(!1),[x,f]=(0,s.useState)(c),[b,j]=(0,s.useTransition)();return(0,r.jsxs)(d.Zp,{className:"flex-1 overflow-auto border-[#E5E0D8] p-6",children:[(0,r.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-lg font-medium text-[#2C2C2C]",children:u("common.content")}),p?(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$,{variant:"outline",onClick:()=>{f(c),v(!1)},disabled:b,className:"border-[#E5E0D8] text-[#6B6B6B]",children:u("common.cancel")}),(0,r.jsx)(l.$,{onClick:()=>{j(async()=>{(await m(t,n,x)).success&&(v(!1),h.refresh())})},disabled:b,className:"bg-[#5A9E6F] hover:bg-[#4A8E5F] text-white",children:u(b?"common.processing":"documents.saveChanges")})]}):(0,r.jsxs)(l.$,{onClick:()=>v(!0),className:"bg-[#C67A52] hover:bg-[#B56A42] text-white",children:[(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-2 h-4 w-4",children:(0,r.jsx)("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"})}),u("common.edit")]})]}),p?(0,r.jsx)("textarea",{value:x,onChange:e=>f(e.target.value),className:"h-full w-full resize-none rounded-lg border border-[#E5E0D8] p-4 font-mono text-sm focus:border-[#C67A52] focus:outline-none focus:ring-1 focus:ring-[#C67A52]",placeholder:u("documents.documentContent")}):(0,r.jsx)("div",{className:"prose prose-sm max-w-none text-[#2C2C2C]",children:c?(0,r.jsx)(i.MarkdownContent,{children:c}):(0,r.jsx)("span",{className:"text-[#9A9A9A] italic",children:u("common.noContent")})})]})}},89971:(e,t,n)=>{"use strict";n.d(t,{DocumentComments:()=>o});var r=n(90508),s=n(5810);function o(e){let{documentUuid:t,currentUserUuid:n}=e;return(0,r.jsx)(s.$,{targetType:"document",targetUuid:t,currentUserUuid:n,compact:!0})}}},e=>{e.O(0,[93151,41752,30996,57084,12079,18944,12790,26885,21932,53298,30724,27201,16551,97784,14753,45532,70552,86944,11207,76803,29660,84541,65642,52206,74951,65496,77358],()=>e(e.s=12294)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[61461],{12294:(e,t,n)=>{Promise.resolve().then(n.bind(n,52053)),Promise.resolve().then(n.bind(n,90299)),Promise.resolve().then(n.bind(n,65514)),Promise.resolve().then(n.bind(n,98861)),Promise.resolve().then(n.bind(n,38476)),Promise.resolve().then(n.bind(n,74542)),Promise.resolve().then(n.bind(n,71350)),Promise.resolve().then(n.bind(n,39025)),Promise.resolve().then(n.bind(n,75368)),Promise.resolve().then(n.bind(n,89684)),Promise.resolve().then(n.bind(n,58057)),Promise.resolve().then(n.bind(n,6512)),Promise.resolve().then(n.bind(n,25051)),Promise.resolve().then(n.bind(n,4374)),Promise.resolve().then(n.bind(n,19345)),Promise.resolve().then(n.bind(n,79919)),Promise.resolve().then(n.bind(n,17533)),Promise.resolve().then(n.bind(n,99545)),Promise.resolve().then(n.bind(n,63197)),Promise.resolve().then(n.bind(n,65326)),Promise.resolve().then(n.bind(n,48218)),Promise.resolve().then(n.bind(n,56260)),Promise.resolve().then(n.bind(n,60322)),Promise.resolve().then(n.bind(n,79834)),Promise.resolve().then(n.bind(n,6947)),Promise.resolve().then(n.bind(n,88878)),Promise.resolve().then(n.bind(n,34857)),Promise.resolve().then(n.bind(n,97006)),Promise.resolve().then(n.bind(n,45841)),Promise.resolve().then(n.t.bind(n,12790,23)),Promise.resolve().then(n.bind(n,23504)),Promise.resolve().then(n.bind(n,89971)),Promise.resolve().then(n.bind(n,88578)),Promise.resolve().then(n.bind(n,76546))},23504:(e,t,n)=>{"use strict";n.d(t,{DocumentActions:()=>x});var r=n(90508),s=n(23603),o=n(1856),a=n(23675),i=n(39268),d=n(97413),l=n(85226),c=n(67587),m=n(22922),u=n(51817),h=n(52217);let p=(0,h.createServerReference)("40d8906f634dbcbc3c0b2ae23b135cae2100990f40",h.callServer,void 0,h.findSourceMapURL,"deleteDocumentAction");function v(e){let{documentUuid:t,documentTitle:n,projectUuid:s}=e,h=(0,i.c)("documents"),v=(0,i.c)("common"),x=(0,a.useRouter)(),[f,b]=o.useState(!1),[j,g]=o.useState(!1),[w,y]=o.useState(null),P=async()=>{g(!0),y(null);let e=await p(t);if(e.success){c.oR.success(h("deleteSuccess")),b(!1),g(!1),x.replace("/projects/".concat(e.projectUuid,"/documents")),x.refresh();return}let n="not_found"===e.error?h("deleteFailedNotFound"):h("deleteFailed");y(n),c.oR.error(n),g(!1)};return(0,r.jsxs)(u.Lt,{open:f,onOpenChange:e=>{!j&&(b(e),e||y(null))},children:[(0,r.jsx)(u.tv,{asChild:!0,children:(0,r.jsxs)(m.$,{variant:"destructive",size:"sm",children:[(0,r.jsx)(d.A,{className:"mr-2 h-4 w-4"}),v("delete")]})}),(0,r.jsxs)(u.EO,{children:[(0,r.jsxs)(u.wd,{children:[(0,r.jsx)(u.r7,{children:h("deleteDocument")}),(0,r.jsx)(u.$v,{children:h("deleteDocumentDescription",{title:n})})]}),w&&(0,r.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:w}),(0,r.jsxs)(u.ck,{children:[(0,r.jsx)(u.Zr,{disabled:j,children:v("cancel")}),(0,r.jsx)(m.$,{variant:"destructive",disabled:j,onClick:P,children:j?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.A,{className:"mr-2 h-4 w-4 animate-spin"}),v("delete")]}):v("delete")})]})]})]})}function x(e){let{documentUuid:t,projectUuid:n,documentTitle:o,canDelete:a,exportDoc:i}=e;return(0,r.jsxs)("div",{className:"flex gap-2",children:[i?(0,r.jsx)(s.E,{document:i}):(0,r.jsx)(s.E,{documentUuid:t}),a&&(0,r.jsx)(v,{documentUuid:t,documentTitle:o,projectUuid:n})]})}},23603:(e,t,n)=>{"use strict";n.d(t,{E:()=>x});var r=n(90508),s=n(1856),o=n(67587),a=n(56770),i=n(66206);let d=(0,i.A)("file-type",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]]),l=(0,i.A)("file-spreadsheet",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);var c=n(85226);let m=(0,i.A)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);var u=n(39268),h=n(66343),p=n(22922),v=n(67712);function x(e){let{document:t,documentUuid:i,variant:x="default"}=e,f=(0,u.c)(),{exportDocument:b,isExporting:j,exportError:g}=function(){let[e,t]=(0,s.useState)(!1),[r,o]=(0,s.useState)(null);return{exportDocument:(0,s.useCallback)(async(e,r)=>{t(!0),o(null);try{let t,o,i=function(e){let t=e.replace(/[\\/:*?"<>|]/g,"").replace(/\s+/g," ").trim().replace(/\s/g,"-");return t.length>0?t:"document"}(e.title);if("md"===r){let{exportAsMarkdownBlob:r}=await n.e(50681).then(n.bind(n,50681));t=r(e),o="md"}else if("pdf"===r){let{exportAsPdf:r}=await n.e(34966).then(n.bind(n,34966));t=await r(e),o="pdf"}else if("docx"===r){let{exportAsDocx:r}=await n.e(9634).then(n.bind(n,9634));t=await r(e),o="docx"}else throw Error("Unsupported export format: ".concat(String(r)));var s=t,a="".concat(i,".").concat(o);let d=URL.createObjectURL(s),l=document.createElement("a");l.href=d,l.download=a,l.rel="noopener",l.style.display="none",document.body.appendChild(l),l.click(),document.body.removeChild(l),setTimeout(()=>URL.revokeObjectURL(d),1e3)}catch(e){o(e instanceof Error?e.message:String(e)),v.q.error("useDocumentExport export failed",e)}finally{t(!1)}},[]),isExporting:e,exportError:r}}(),[w,y]=(0,s.useState)(null);async function P(e){y(e);try{let l=t;if(!l&&i){var n,r,s,a,d;let e=await fetch("/api/documents/".concat(i)),t=await e.json();if(!t.success||!t.data)return void o.oR.error(f("export.exportError"));let c=t.data;l={title:c.title,content:null!=(s=c.content)?s:"",type:c.type,version:c.version,createdAt:c.createdAt,updatedAt:c.updatedAt,createdByName:null!=(a=null==(n=c.createdBy)?void 0:n.name)?a:"",projectName:null!=(d=null==(r=c.project)?void 0:r.name)?d:""}}l&&await b(l,e)}finally{y(null),g&&o.oR.error(g)}}let k=[{format:"md",labelKey:"export.formatMd",icon:a.A},{format:"pdf",labelKey:"export.formatPdf",icon:d},{format:"docx",labelKey:"export.formatDocx",icon:l}],C="compact"===x;return(0,r.jsxs)(h.rI,{children:[(0,r.jsx)(h.ty,{asChild:!0,children:(0,r.jsxs)(p.$,{variant:"ghost"===x?"ghost":"outline",size:C?"sm":"default",className:C?"h-6 text-[11px] text-muted-foreground hover:text-foreground":"border-[#E5E0D8] text-[#6B6B6B] gap-1.5",disabled:j,children:[j?(0,r.jsx)(c.A,{className:"".concat(C?"h-3 w-3":"h-4 w-4"," animate-spin")}):(0,r.jsx)(m,{className:C?"h-3 w-3":"h-4 w-4"}),!C&&f("export.exportDocument")]})}),(0,r.jsx)(h.SQ,{align:"end",className:"w-48",children:k.map(e=>{let{format:t,labelKey:n,icon:s}=e;return(0,r.jsxs)(h._2,{onClick:e=>{e.stopPropagation(),e.preventDefault(),P(t)},disabled:j,children:[w===t?(0,r.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,r.jsx)(s,{className:"h-4 w-4"}),f(n)]},t)})})]})}},66343:(e,t,n)=>{"use strict";n.d(t,{SQ:()=>d,_2:()=>l,mB:()=>c,rI:()=>a,ty:()=>i});var r=n(90508);n(1856);var s=n(39025),o=n(24377);function a(e){let{...t}=e;return(0,r.jsx)(s.Root,{"data-slot":"dropdown-menu",...t})}function i(e){let{...t}=e;return(0,r.jsx)(s.Trigger,{"data-slot":"dropdown-menu-trigger",...t})}function d(e){let{className:t,sideOffset:n=4,...a}=e;return(0,r.jsx)(s.Portal,{children:(0,r.jsx)(s.Content,{"data-slot":"dropdown-menu-content",sideOffset:n,className:(0,o.cn)("bg-popover text-popover-foreground z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md","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",t),...a})})}function l(e){let{className:t,inset:n,variant:a="default",...i}=e;return(0,r.jsx)(s.Item,{"data-slot":"dropdown-menu-item","data-inset":n,"data-variant":a,className:(0,o.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive","data-[inset]:pl-8 [&_svg]:size-4",t),...i})}function c(e){let{className:t,...n}=e;return(0,r.jsx)(s.Separator,{"data-slot":"dropdown-menu-separator",className:(0,o.cn)("bg-border -mx-1 my-1 h-px",t),...n})}},76546:(e,t,n)=>{"use strict";n.d(t,{FormattedDateTime:()=>o});var r=n(90508),s=n(38106);function o(e){let{date:t}=e;return(0,r.jsx)(r.Fragment,{children:(0,s.r)(t)})}},88578:(e,t,n)=>{"use strict";n.d(t,{DocumentContent:()=>u});var r=n(90508),s=n(1856),o=n(23675),a=n(39268),i=n(97261),d=n(48416),l=n(22922),c=n(52217);let m=(0,c.createServerReference)("70b736a9808d5b1e6a7b1c310f41d94ddede28350a",c.callServer,void 0,c.findSourceMapURL,"updateDocumentAction");function u(e){let{documentUuid:t,projectUuid:n,initialContent:c}=e,u=(0,a.c)(),h=(0,o.useRouter)(),[p,v]=(0,s.useState)(!1),[x,f]=(0,s.useState)(c),[b,j]=(0,s.useTransition)();return(0,r.jsxs)(d.Zp,{className:"flex-1 overflow-auto border-[#E5E0D8] p-6",children:[(0,r.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-lg font-medium text-[#2C2C2C]",children:u("common.content")}),p?(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$,{variant:"outline",onClick:()=>{f(c),v(!1)},disabled:b,className:"border-[#E5E0D8] text-[#6B6B6B]",children:u("common.cancel")}),(0,r.jsx)(l.$,{onClick:()=>{j(async()=>{(await m(t,n,x)).success&&(v(!1),h.refresh())})},disabled:b,className:"bg-[#5A9E6F] hover:bg-[#4A8E5F] text-white",children:u(b?"common.processing":"documents.saveChanges")})]}):(0,r.jsxs)(l.$,{onClick:()=>v(!0),className:"bg-[#C67A52] hover:bg-[#B56A42] text-white",children:[(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"mr-2 h-4 w-4",children:(0,r.jsx)("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"})}),u("common.edit")]})]}),p?(0,r.jsx)("textarea",{value:x,onChange:e=>f(e.target.value),className:"h-full w-full resize-none rounded-lg border border-[#E5E0D8] p-4 font-mono text-sm focus:border-[#C67A52] focus:outline-none focus:ring-1 focus:ring-[#C67A52]",placeholder:u("documents.documentContent")}):(0,r.jsx)("div",{className:"prose prose-sm max-w-none text-[#2C2C2C]",children:c?(0,r.jsx)(i.MarkdownContent,{children:c}):(0,r.jsx)("span",{className:"text-[#9A9A9A] italic",children:u("common.noContent")})})]})}},89971:(e,t,n)=>{"use strict";n.d(t,{DocumentComments:()=>o});var r=n(90508),s=n(5810);function o(e){let{documentUuid:t,currentUserUuid:n}=e;return(0,r.jsx)(s.$,{targetType:"document",targetUuid:t,currentUserUuid:n,compact:!0})}}},e=>{e.O(0,[93151,41752,30996,57084,12079,18944,12790,26885,21932,30724,94655,27201,16551,97784,14753,45532,70552,11207,70093,76803,55469,84541,66205,16984,52206,74951,65496,77358],()=>e(e.s=12294)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[96538],{5071:(e,t,a)=>{"use strict";a.d(t,{CreateDocumentDialog:()=>f});var r=a(90508),s=a(1856),n=a(23675),o=a(39268),i=a(5616),l=a(56770);let d=(0,a(66206).A)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);var c=a(85226),u=a(22922),m=a(14554),h=a(88064),p=a(97438),x=a(91846),v=a(52217);let g=(0,v.createServerReference)("40115db7706f4df64e38faf186a2ca10ab78ecaea1",v.callServer,void 0,v.findSourceMapURL,"createDocumentAction");function f(e){let{projectUuid:t,trigger:a}=e,v=(0,o.c)(),f=(0,n.useRouter)(),b=(0,s.useRef)(null),[y,j]=(0,s.useState)(!1),[w,k]=(0,s.useState)(""),[N,A]=(0,s.useState)("prd"),[C,z]=(0,s.useState)(null),[P,E]=(0,s.useState)(""),[M,F]=(0,s.useState)(null),[D,S]=(0,s.useState)(!1),_=()=>{k(""),A("prd"),z(null),E(""),F(null),b.current&&(b.current.value="")},B=async()=>{if(!w.trim())return void F(v("documents.titleRequired"));S(!0),F(null);let e=await g({projectUuid:t,title:w.trim(),type:N,content:P});S(!1),e.success?(j(!1),_(),f.refresh(),e.documentUuid&&f.push("/projects/".concat(t,"/documents/").concat(e.documentUuid))):F(e.error||v("documents.createFailed"))};return(0,r.jsxs)(p.lG,{open:y,onOpenChange:e=>{j(e),e||_()},children:[(0,r.jsx)(p.zM,{asChild:!0,children:a||(0,r.jsxs)(u.$,{className:"bg-[#C67A52] hover:bg-[#B56A42] text-white",children:[(0,r.jsx)(i.A,{className:"mr-2 h-4 w-4"}),v("documents.newDocument")]})}),(0,r.jsxs)(p.Cf,{className:"sm:max-w-[480px]",children:[(0,r.jsx)(p.c7,{children:(0,r.jsx)(p.L3,{children:v("documents.createDocument")})}),(0,r.jsxs)("div",{className:"space-y-4 py-2",children:[M&&(0,r.jsx)("div",{className:"rounded-lg bg-destructive/10 p-3 text-sm text-destructive",children:M}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)(h.J,{htmlFor:"doc-title",className:"text-[13px] font-medium text-[#2C2C2C]",children:[v("documents.titleLabel")," *"]}),(0,r.jsx)(m.p,{id:"doc-title",value:w,onChange:e=>k(e.target.value),placeholder:v("documents.titlePlaceholder"),className:"border-[#E5E0D8] focus-visible:ring-[#C67A52]",autoFocus:!0})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(h.J,{htmlFor:"doc-type",className:"text-[13px] font-medium text-[#2C2C2C]",children:v("documents.typeLabel")}),(0,r.jsxs)(x.l6,{value:N,onValueChange:A,children:[(0,r.jsx)(x.bq,{className:"border-[#E5E0D8] focus:ring-[#C67A52]",children:(0,r.jsx)(x.yv,{})}),(0,r.jsxs)(x.gC,{children:[(0,r.jsx)(x.eb,{value:"prd",children:"PRD"}),(0,r.jsx)(x.eb,{value:"spec",children:"Spec"}),(0,r.jsx)(x.eb,{value:"design",children:"Design"}),(0,r.jsx)(x.eb,{value:"note",children:"Note"}),(0,r.jsx)(x.eb,{value:"other",children:"Other"})]})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(h.J,{className:"text-[13px] font-medium text-[#2C2C2C]",children:v("documents.uploadMarkdown")}),(0,r.jsx)("div",{className:"flex cursor-pointer items-center gap-3 rounded-lg border border-dashed border-[#E5E0D8] p-4 transition-colors hover:border-[#C67A52] hover:bg-[#FFFBF8]",onClick:()=>{var e;return null==(e=b.current)?void 0:e.click()},children:C?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.A,{className:"h-5 w-5 text-[#C67A52]"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-[#2C2C2C] truncate",children:C}),(0,r.jsxs)("p",{className:"text-xs text-[#9A9A9A]",children:[P.length.toLocaleString()," ",v("documents.characters")]})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d,{className:"h-5 w-5 text-[#9A9A9A]"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm text-[#6B6B6B]",children:v("documents.clickToUpload")}),(0,r.jsx)("p",{className:"text-xs text-[#9A9A9A]",children:".md, .txt, .markdown"})]})]})}),(0,r.jsx)("input",{ref:b,type:"file",accept:".md,.txt,.markdown",onChange:e=>{var t;let a=null==(t=e.target.files)?void 0:t[0];if(!a)return;z(a.name);let r=new FileReader;r.onload=e=>{var t;E(null==(t=e.target)?void 0:t.result)},r.readAsText(a)},className:"hidden"})]})]}),(0,r.jsxs)(p.Es,{children:[(0,r.jsx)(u.$,{variant:"outline",onClick:()=>j(!1),disabled:D,className:"border-[#E5E0D8]",children:v("common.cancel")}),(0,r.jsx)(u.$,{onClick:B,disabled:D||!w.trim(),className:"bg-[#C67A52] hover:bg-[#B56A42] text-white",children:D?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.A,{className:"mr-2 h-4 w-4 animate-spin"}),v("common.creating")]}):v("common.create")})]})]})]})}},5616:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(66206).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},8312:(e,t,a)=>{"use strict";a.d(t,{DocumentGrid:()=>b});var r=a(90508),s=a(12790),n=a.n(s),o=a(48416),i=a(57731),l=a(56770),d=a(39268),c=a(96213),u=a(23603),m=a(38106),h=a(71921),p=a(66206);let x=(0,p.A)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]),v=(0,p.A)("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);var g=a(75320);let f={prd:{labelKey:"documents.typePrd",color:"bg-[#E3F2FD] text-[#1976D2]",icon:h.A},spec:{labelKey:"documents.typeSpec",color:"bg-[#E8F5E9] text-[#5A9E6F]",icon:x},design:{labelKey:"documents.typeDesign",color:"bg-[#F3E5F5] text-[#7B1FA2]",icon:v},note:{labelKey:"documents.typeNote",color:"bg-[#FFF3E0] text-[#E65100]",icon:g.A},report:{labelKey:"documents.typeReport",color:"bg-[#FFF8E1] text-[#9A6B00]",icon:l.A},other:{labelKey:"documents.typeOther",color:"bg-[#F5F5F5] text-[#6B6B6B]",icon:l.A}};function b(e){let{documents:t,projectUuid:a}=e,s=(0,d.c)();return(0,r.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>{let t=f[e.type],d=(null==t?void 0:t.icon)||l.A;return(0,r.jsx)(c.D,{entityType:"document",entityUuid:e.uuid,children:(0,r.jsxs)(o.Zp,{className:"group relative flex flex-col border-[#E5E0D8] transition-all hover:border-[#C67A52] hover:shadow-md",children:[(0,r.jsx)(n(),{href:"/projects/".concat(a,"/documents/").concat(e.uuid),className:"flex flex-1 flex-col p-5 pb-0",children:(0,r.jsxs)("div",{className:"mb-3 flex items-start gap-3",children:[(0,r.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-[#F5F2EC]",children:(0,r.jsx)(d,{className:"h-5 w-5 text-[#6B6B6B]"})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("h3",{className:"font-medium text-[#2C2C2C] leading-snug group-hover:text-[#C67A52] line-clamp-2",children:e.title}),(0,r.jsxs)("div",{className:"mt-1 flex items-center gap-2 text-xs text-[#9A9A9A]",children:[(0,r.jsxs)("span",{children:["v",e.version]}),(0,r.jsx)("span",{children:"\xb7"}),(0,r.jsx)("span",{children:s("documents.updated",{date:(0,m.r)(e.updatedAt)})})]})]})]})}),(0,r.jsxs)("div",{className:"flex items-center justify-between border-t border-[#F5F2EC] px-5 py-2.5",children:[(0,r.jsx)(i.E,{className:"text-[11px] ".concat((null==t?void 0:t.color)||""),children:s((null==t?void 0:t.labelKey)||"documents.typeOther")}),(0,r.jsx)("div",{onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:(0,r.jsx)(u.E,{documentUuid:e.uuid,variant:"compact"})})]})]})},e.uuid)})})}},9160:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(66206).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},14554:(e,t,a)=>{"use strict";a.d(t,{p:()=>n});var r=a(90508);a(1856);var s=a(24377);function n(e){let{className:t,type:a,...n}=e;return(0,r.jsx)("input",{type:a,"data-slot":"input",className:(0,s.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})}},17730:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(66206).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},22922:(e,t,a)=>{"use strict";a.d(t,{$:()=>l});var r=a(90508);a(1856);var s=a(49499),n=a(54154),o=a(24377);let i=(0,s.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium cursor-pointer transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function l(e){let{className:t,variant:a="default",size:s="default",asChild:l=!1,...d}=e,c=l?n.bL:"button";return(0,r.jsx)(c,{"data-slot":"button","data-variant":a,"data-size":s,className:(0,o.cn)(i({variant:a,size:s,className:t})),...d})}},23603:(e,t,a)=>{"use strict";a.d(t,{E:()=>v});var r=a(90508),s=a(1856),n=a(67587),o=a(56770),i=a(66206);let l=(0,i.A)("file-type",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]]),d=(0,i.A)("file-spreadsheet",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);var c=a(85226);let u=(0,i.A)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);var m=a(39268),h=a(66343),p=a(22922),x=a(67712);function v(e){let{document:t,documentUuid:i,variant:v="default"}=e,g=(0,m.c)(),{exportDocument:f,isExporting:b,exportError:y}=function(){let[e,t]=(0,s.useState)(!1),[r,n]=(0,s.useState)(null);return{exportDocument:(0,s.useCallback)(async(e,r)=>{t(!0),n(null);try{let t,n,i=function(e){let t=e.replace(/[\\/:*?"<>|]/g,"").replace(/\s+/g," ").trim().replace(/\s/g,"-");return t.length>0?t:"document"}(e.title);if("md"===r){let{exportAsMarkdownBlob:r}=await a.e(50681).then(a.bind(a,50681));t=r(e),n="md"}else if("pdf"===r){let{exportAsPdf:r}=await a.e(34966).then(a.bind(a,34966));t=await r(e),n="pdf"}else if("docx"===r){let{exportAsDocx:r}=await a.e(9634).then(a.bind(a,9634));t=await r(e),n="docx"}else throw Error("Unsupported export format: ".concat(String(r)));var s=t,o="".concat(i,".").concat(n);let l=URL.createObjectURL(s),d=document.createElement("a");d.href=l,d.download=o,d.rel="noopener",d.style.display="none",document.body.appendChild(d),d.click(),document.body.removeChild(d),setTimeout(()=>URL.revokeObjectURL(l),1e3)}catch(e){n(e instanceof Error?e.message:String(e)),x.q.error("useDocumentExport export failed",e)}finally{t(!1)}},[]),isExporting:e,exportError:r}}(),[j,w]=(0,s.useState)(null);async function k(e){w(e);try{let d=t;if(!d&&i){var a,r,s,o,l;let e=await fetch("/api/documents/".concat(i)),t=await e.json();if(!t.success||!t.data)return void n.oR.error(g("export.exportError"));let c=t.data;d={title:c.title,content:null!=(s=c.content)?s:"",type:c.type,version:c.version,createdAt:c.createdAt,updatedAt:c.updatedAt,createdByName:null!=(o=null==(a=c.createdBy)?void 0:a.name)?o:"",projectName:null!=(l=null==(r=c.project)?void 0:r.name)?l:""}}d&&await f(d,e)}finally{w(null),y&&n.oR.error(y)}}let N=[{format:"md",labelKey:"export.formatMd",icon:o.A},{format:"pdf",labelKey:"export.formatPdf",icon:l},{format:"docx",labelKey:"export.formatDocx",icon:d}],A="compact"===v;return(0,r.jsxs)(h.rI,{children:[(0,r.jsx)(h.ty,{asChild:!0,children:(0,r.jsxs)(p.$,{variant:"ghost"===v?"ghost":"outline",size:A?"sm":"default",className:A?"h-6 text-[11px] text-muted-foreground hover:text-foreground":"border-[#E5E0D8] text-[#6B6B6B] gap-1.5",disabled:b,children:[b?(0,r.jsx)(c.A,{className:"".concat(A?"h-3 w-3":"h-4 w-4"," animate-spin")}):(0,r.jsx)(u,{className:A?"h-3 w-3":"h-4 w-4"}),!A&&g("export.exportDocument")]})}),(0,r.jsx)(h.SQ,{align:"end",className:"w-48",children:N.map(e=>{let{format:t,labelKey:a,icon:s}=e;return(0,r.jsxs)(h._2,{onClick:e=>{e.stopPropagation(),e.preventDefault(),k(t)},disabled:b,children:[j===t?(0,r.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,r.jsx)(s,{className:"h-4 w-4"}),g(a)]},t)})})]})}},38106:(e,t,a)=>{"use strict";function r(e){let t="string"==typeof e?new Date(e):e;if(isNaN(t.getTime()))return"";let a=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0"),n=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0");return"".concat(a,"-").concat(r,"-").concat(s," ").concat(n,":").concat(o)}function s(e,t){let a="string"==typeof e?new Date(e):e;return isNaN(a.getTime())?"":a.toLocaleDateString(t,{month:"short",day:"numeric"})}a.d(t,{r:()=>r,s:()=>s})},57731:(e,t,a)=>{"use strict";a.d(t,{E:()=>l});var r=a(90508);a(1856);var s=a(49499),n=a(54154),o=a(24377);let i=(0,s.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 l(e){let{className:t,variant:a="default",asChild:s=!1,...l}=e,d=s?n.bL:"span";return(0,r.jsx)(d,{"data-slot":"badge","data-variant":a,className:(0,o.cn)(i({variant:a}),t),...l})}},58057:(e,t,a)=>{"use strict";a.r(t),a.d(t,{Label:()=>o,Root:()=>i});var r=a(1856),s=a(93367),n=a(90508),o=r.forwardRef((e,t)=>(0,n.jsx)(s.sG.label,{...e,ref:t,onMouseDown:t=>{var a;t.target.closest("button, input, select, textarea")||(null==(a=e.onMouseDown)||a.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));o.displayName="Label";var i=o},58866:(e,t,a)=>{"use strict";a.d(t,{AnimatedEmptyState:()=>n});var r=a(90508),s=a(16544);function n(e){let{children:t}=e;return(0,r.jsx)(s.P.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},transition:{duration:.2,ease:[0,0,.2,1]},children:t})}},60532:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(66206).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},66343:(e,t,a)=>{"use strict";a.d(t,{SQ:()=>l,_2:()=>d,mB:()=>c,rI:()=>o,ty:()=>i});var r=a(90508);a(1856);var s=a(39025),n=a(24377);function o(e){let{...t}=e;return(0,r.jsx)(s.Root,{"data-slot":"dropdown-menu",...t})}function i(e){let{...t}=e;return(0,r.jsx)(s.Trigger,{"data-slot":"dropdown-menu-trigger",...t})}function l(e){let{className:t,sideOffset:a=4,...o}=e;return(0,r.jsx)(s.Portal,{children:(0,r.jsx)(s.Content,{"data-slot":"dropdown-menu-content",sideOffset:a,className:(0,n.cn)("bg-popover text-popover-foreground z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md","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",t),...o})})}function d(e){let{className:t,inset:a,variant:o="default",...i}=e;return(0,r.jsx)(s.Item,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":o,className:(0,n.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive","data-[inset]:pl-8 [&_svg]:size-4",t),...i})}function c(e){let{className:t,...a}=e;return(0,r.jsx)(s.Separator,{"data-slot":"dropdown-menu-separator",className:(0,n.cn)("bg-border -mx-1 my-1 h-px",t),...a})}},67712:(e,t,a)=>{"use strict";a.d(t,{q:()=>i});var r=a(55036);let s={debug:0,info:1,warn:2,error:3},n=r.env.NEXT_PUBLIC_LOG_LEVEL||"warn";function o(e){return s[e]>=s[n]}let i={debug:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),r=1;r<t;r++)a[r-1]=arguments[r];o("debug")&&console.debug("[Chorus] ".concat(e),...a)},info:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),r=1;r<t;r++)a[r-1]=arguments[r];o("info")&&console.info("[Chorus] ".concat(e),...a)},warn:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),r=1;r<t;r++)a[r-1]=arguments[r];o("warn")&&console.warn("[Chorus] ".concat(e),...a)},error:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),r=1;r<t;r++)a[r-1]=arguments[r];o("error")&&console.error("[Chorus] ".concat(e),...a)}}},71921:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(66206).A)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]])},75320:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(66206).A)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])},86108:(e,t,a)=>{Promise.resolve().then(a.bind(a,52053)),Promise.resolve().then(a.bind(a,90299)),Promise.resolve().then(a.bind(a,65514)),Promise.resolve().then(a.bind(a,98861)),Promise.resolve().then(a.bind(a,38476)),Promise.resolve().then(a.bind(a,74542)),Promise.resolve().then(a.bind(a,71350)),Promise.resolve().then(a.bind(a,39025)),Promise.resolve().then(a.bind(a,75368)),Promise.resolve().then(a.bind(a,89684)),Promise.resolve().then(a.bind(a,58057)),Promise.resolve().then(a.bind(a,6512)),Promise.resolve().then(a.bind(a,25051)),Promise.resolve().then(a.bind(a,4374)),Promise.resolve().then(a.bind(a,19345)),Promise.resolve().then(a.bind(a,79919)),Promise.resolve().then(a.bind(a,17533)),Promise.resolve().then(a.bind(a,99545)),Promise.resolve().then(a.bind(a,63197)),Promise.resolve().then(a.bind(a,65326)),Promise.resolve().then(a.bind(a,48218)),Promise.resolve().then(a.bind(a,56260)),Promise.resolve().then(a.bind(a,60322)),Promise.resolve().then(a.bind(a,79834)),Promise.resolve().then(a.bind(a,6947)),Promise.resolve().then(a.bind(a,88878)),Promise.resolve().then(a.bind(a,34857)),Promise.resolve().then(a.bind(a,97006)),Promise.resolve().then(a.bind(a,45841)),Promise.resolve().then(a.t.bind(a,12790,23)),Promise.resolve().then(a.bind(a,5071)),Promise.resolve().then(a.bind(a,8312)),Promise.resolve().then(a.bind(a,58866))},88064:(e,t,a)=>{"use strict";a.d(t,{J:()=>o});var r=a(90508);a(1856);var s=a(58057),n=a(24377);function o(e){let{className:t,...a}=e;return(0,r.jsx)(s.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})}},89967:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(66206).A)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},91846:(e,t,a)=>{"use strict";a.d(t,{bq:()=>u,eb:()=>h,gC:()=>m,l6:()=>d,yv:()=>c});var r=a(90508);a(1856);var s=a(17730),n=a(60532),o=a(89967),i=a(48218),l=a(24377);function d(e){let{...t}=e;return(0,r.jsx)(i.Root,{"data-slot":"select",...t})}function c(e){let{...t}=e;return(0,r.jsx)(i.Value,{"data-slot":"select-value",...t})}function u(e){let{className:t,size:a="default",children:n,...o}=e;return(0,r.jsxs)(i.Trigger,{"data-slot":"select-trigger","data-size":a,className:(0,l.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),...o,children:[n,(0,r.jsx)(i.Icon,{asChild:!0,children:(0,r.jsx)(s.A,{className:"size-4 opacity-50"})})]})}function m(e){let{className:t,children:a,position:s="item-aligned",align:n="center",...o}=e;return(0,r.jsx)(i.Portal,{children:(0,r.jsxs)(i.Content,{"data-slot":"select-content",className:(0,l.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"===s&&"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:s,align:n,...o,children:[(0,r.jsx)(p,{}),(0,r.jsx)(i.Viewport,{className:(0,l.cn)("p-1","popper"===s&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),(0,r.jsx)(x,{})]})})}function h(e){let{className:t,children:a,...s}=e;return(0,r.jsxs)(i.Item,{"data-slot":"select-item",className:(0,l.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),...s,children:[(0,r.jsx)("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,r.jsx)(i.ItemIndicator,{children:(0,r.jsx)(n.A,{className:"size-4"})})}),(0,r.jsx)(i.ItemText,{children:a})]})}function p(e){let{className:t,...a}=e;return(0,r.jsx)(i.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:(0,l.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,r.jsx)(o.A,{className:"size-4"})})}function x(e){let{className:t,...a}=e;return(0,r.jsx)(i.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:(0,l.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,r.jsx)(s.A,{className:"size-4"})})}},97438:(e,t,a)=>{"use strict";a.d(t,{Cf:()=>m,Es:()=>p,L3:()=>x,c7:()=>h,lG:()=>l,rr:()=>v,zM:()=>d});var r=a(90508);a(1856);var s=a(9160),n=a(71350),o=a(24377),i=a(22922);function l(e){let{...t}=e;return(0,r.jsx)(n.Root,{"data-slot":"dialog",...t})}function d(e){let{...t}=e;return(0,r.jsx)(n.Trigger,{"data-slot":"dialog-trigger",...t})}function c(e){let{...t}=e;return(0,r.jsx)(n.Portal,{"data-slot":"dialog-portal",...t})}function u(e){let{className:t,...a}=e;return(0,r.jsx)(n.Overlay,{"data-slot":"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),...a})}function m(e){let{className:t,children:a,showCloseButton:i=!0,...l}=e;return(0,r.jsxs)(c,{"data-slot":"dialog-portal",children:[(0,r.jsx)(u,{}),(0,r.jsxs)(n.Content,{"data-slot":"dialog-content",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 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),...l,children:[a,i&&(0,r.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,r.jsx)(s.A,{}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function h(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"dialog-header",className:(0,o.cn)("flex flex-col gap-2 text-center sm:text-left",t),...a})}function p(e){let{className:t,showCloseButton:a=!1,children:s,...l}=e;return(0,r.jsxs)("div",{"data-slot":"dialog-footer",className:(0,o.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...l,children:[s,a&&(0,r.jsx)(n.Close,{asChild:!0,children:(0,r.jsx)(i.$,{variant:"outline",children:"Close"})})]})}function x(e){let{className:t,...a}=e;return(0,r.jsx)(n.Title,{"data-slot":"dialog-title",className:(0,o.cn)("text-lg leading-none font-semibold",t),...a})}function v(e){let{className:t,...a}=e;return(0,r.jsx)(n.Description,{"data-slot":"dialog-description",className:(0,o.cn)("text-muted-foreground text-sm",t),...a})}}},e=>{e.O(0,[12079,18944,12790,21932,16544,94655,70093,76803,55469,66205,16984,59296,74951,65496,77358],()=>e(e.s=86108)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[10585],{},_=>{_.O(0,[93151,41752,30996,57084,12079,18944,12790,26885,21932,16544,30724,94655,27201,16551,97784,14753,45532,70552,11207,70093,76803,55469,84541,66205,16984,51841,52206,35486,19126,74951,65496,77358],()=>_(_.s=19126)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[31e3],{},_=>{_.O(0,[93151,41752,30996,57084,12079,18944,12790,26885,21932,16544,30724,94655,27201,16551,97784,14753,45532,70552,11207,70093,76803,55469,84541,66205,16984,51841,52206,35486,19126,74951,65496,77358],()=>_(_.s=19126)),_N_E=_.O()}]);
|