panoma 0.10.1 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/BUILD-INFO.json +2 -2
- package/app/apps/web/.next-bundle/BUILD_ID +1 -1
- package/app/apps/web/.next-bundle/app-build-manifest.json +336 -336
- package/app/apps/web/.next-bundle/app-path-routes-manifest.json +45 -45
- package/app/apps/web/.next-bundle/build-manifest.json +3 -3
- package/app/apps/web/.next-bundle/prerender-manifest.json +3 -3
- package/app/apps/web/.next-bundle/required-server-files.json +3 -3
- package/app/apps/web/.next-bundle/server/app/(app)/agents/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/agents/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/ai/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/ai/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/apps/[id]/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/apps/[id]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/apps/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/apps/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/bridge/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/bridge/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/copies/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/copies/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/credentials/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/credentials/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/disk/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/disk/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/handoff/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/handoff/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/hidden/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/hidden/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/p/[slug]/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/p/[slug]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/p/[slug]/video/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/p/[slug]/video/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/packages/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/packages/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/runs/[id]/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/runs/[id]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/runs/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/runs/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/search/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/search/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/spend/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/spend/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/twin/look/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/twin/look/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/twin/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/twin/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/unsaved/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/unsaved/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/_not-found/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/accounts/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/accounts/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/apps/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/apps/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/consult/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/consult/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/context/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/context/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/conversations/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/conversations/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/handoff/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/handoff/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/hello/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/hello/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/journal/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/journal/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/keys/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/keys/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/log/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/log/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/mcp/route.js +2 -2
- package/app/apps/web/.next-bundle/server/app/api/agent/mcp/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/notes/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/notes/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/tasks/[id]/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/tasks/[id]/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/tasks/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/tasks/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/video/cancel/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/video/cancel/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/video/jobs/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/video/jobs/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/video/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/video/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/ai/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/ai/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/[operation]/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/[operation]/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/credentials/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/credentials/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/jobs/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/jobs/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/legal/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/legal/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/settings/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/settings/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/jobs/[jobId]/artifact/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/jobs/[jobId]/artifact/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/jobs/[jobId]/cancel/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/jobs/[jobId]/cancel/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/jobs/[jobId]/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/jobs/[jobId]/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/assets/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/assets/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/assignments/launch/route.js +2 -2
- package/app/apps/web/.next-bundle/server/app/api/assignments/launch/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/assignments/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/assignments/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/catalog/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/catalog/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/check/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/check/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/consultations/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/consultations/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/describe/route.js +2 -2
- package/app/apps/web/.next-bundle/server/app/api/describe/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/disk/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/disk/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/enrich/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/enrich/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/environment/route.js +2 -2
- package/app/apps/web/.next-bundle/server/app/api/environment/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/handoff/[id]/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/handoff/[id]/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/handoff/digest/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/handoff/digest/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/handoff/launch/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/handoff/launch/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/handoff/record/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/handoff/record/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/handoff/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/handoff/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/hooks/route.js +2 -2
- package/app/apps/web/.next-bundle/server/app/api/hooks/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/ingest/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/ingest/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/md/apply/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/md/apply/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/md/context/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/md/context/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/md/inspect/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/md/inspect/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/md/repair/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/md/repair/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/md/review/route.js +2 -2
- package/app/apps/web/.next-bundle/server/app/api/md/review/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/memory/export/route.js +2 -2
- package/app/apps/web/.next-bundle/server/app/api/memory/export/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/north/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/north/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/notes/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/notes/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/open/all/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/open/all/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/open/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/open/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/project/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/project/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/rescan/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/rescan/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/roots/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/roots/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/runs/[id]/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/runs/[id]/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/runs/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/runs/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/scale/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/scale/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/search/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/search/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/secrets/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/secrets/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/spend/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/spend/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/tasks/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/tasks/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/today/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/today/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/assign/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/assign/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/classify/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/classify/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/critique/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/critique/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/design/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/design/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/distill/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/distill/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/episodes/learn/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/episodes/learn/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/episodes/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/episodes/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/look/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/look/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/mine/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/mine/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/rehearse/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/rehearse/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/score/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/score/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/shot/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/shot/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/sources/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/sources/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/synthesize/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/synthesize/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/taste/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/taste/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/verdicts/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/verdicts/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/watch/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/watch/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/apple-icon.png/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/icon/[id]/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/icon/[id]/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/icon.png/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app-paths-manifest.json +45 -45
- package/app/apps/web/.next-bundle/server/chunks/1454.js +2 -0
- package/app/apps/web/.next-bundle/server/chunks/1646.js +5 -5
- package/app/apps/web/.next-bundle/server/chunks/2791.js +1 -0
- package/app/apps/web/.next-bundle/server/chunks/3863.js +1 -1
- package/app/apps/web/.next-bundle/server/chunks/6131.js +1 -0
- package/app/apps/web/.next-bundle/server/chunks/6206.js +1 -1
- package/app/apps/web/.next-bundle/server/chunks/6384.js +1 -1
- package/app/apps/web/.next-bundle/server/chunks/7245.js +1 -1
- package/app/apps/web/.next-bundle/server/chunks/8463.js +1 -1
- package/app/apps/web/.next-bundle/server/chunks/9128.js +1 -1
- package/app/apps/web/.next-bundle/server/functions-config-manifest.json +11 -11
- package/app/apps/web/.next-bundle/server/middleware-build-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/middleware-manifest.json +5 -5
- package/app/apps/web/.next-bundle/server/middleware.js +2 -2
- package/app/apps/web/.next-bundle/server/next-font-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/next-font-manifest.json +1 -1
- package/app/apps/web/.next-bundle/server/pages/500.html +1 -1
- package/app/apps/web/.next-bundle/server/server-reference-manifest.json +1 -1
- package/app/apps/web/.next-bundle/static/chunks/{1369-fb920ad29be2918f.js → 1369-2c988debdc250f63.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/2575-61e3c59775a07058.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/2921-abf2bd91adbc76d4.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/2948-e207a4e3dee8fa26.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/7f092448-8ec90a5d5349d5de.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/agents/{page-3afe149292dee4cb.js → page-cae57c1555749574.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/ai/{page-4ecef849842c0215.js → page-f63553805baaea0c.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/apps/[id]/page-da64889cd7413e00.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/apps/{page-bd093636b54de647.js → page-3cf7accd30ae08c7.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/bridge/page-f1661f3e36e93d98.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/copies/page-44ebbc5d00245788.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/credentials/page-c1d8a21174d6bba2.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/disk/{page-d1b9aa25253546a0.js → page-79c4c0af255ea5db.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/{error-20d26934fcea6996.js → error-bc8b33871ce6ee62.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/handoff/{page-caeb1272bc905425.js → page-41198249f6480477.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/hidden/page-0eec0c39fae7b922.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/{layout-61ec32158b7b0386.js → layout-f4763a241faa2e25.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/p/[slug]/{page-4e66f8bbd733f4d8.js → page-bf90188e9460900b.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/p/[slug]/video/{page-ea393b5af74124b8.js → page-8ac2b429692e90c6.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/{page-c14bfd37ecf94790.js → page-a6579330ff0a1c45.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/runs/[id]/page-71e91e2f82fbcd0a.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/runs/page-44ebbc5d00245788.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/search/{page-7f5dd10dd14c3069.js → page-0788d039d155cdf2.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/spend/page-9b43a28c5537214d.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/twin/look/{page-0d3a90c3dcaaa271.js → page-47bc811a5a4bbed5.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/twin/{page-4040b9fbbbdb6c96.js → page-12d36b362fc4d2d2.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/unsaved/page-4bffe36641979e0c.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/global-not-found-44ebbc5d00245788.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/not-found-44ebbc5d00245788.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/main-app-ec5cb301dd9fc61e.js +1 -0
- package/app/apps/web/.next-bundle/static/css/b1d2cc9ccd4e30bf.css +1 -0
- package/app/apps/web/server.js +1 -1
- package/app/node_modules/drizzle-orm/node_modules/.bin/gel +3 -3
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/app/apps/web/.next-bundle/server/chunks/3904.js +0 -2
- package/app/apps/web/.next-bundle/server/chunks/6393.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/2575-99d85f1074e44653.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/2921-92c9a83559025278.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/2948-db3dde2d3c76f184.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/7f092448-875cfd730dc78b44.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/apps/[id]/page-17367d7f0718d9c3.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/bridge/page-6326cc50e994047a.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/copies/page-d88bc2305712e08e.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/credentials/page-c889987f707634f7.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/hidden/page-fdc07e400a6c28f2.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/runs/[id]/page-dad4f70f6abc8ead.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/runs/page-d88bc2305712e08e.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/spend/page-1e46fbb47677deaf.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/unsaved/page-998202d323b07695.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/global-not-found-d88bc2305712e08e.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/not-found-d88bc2305712e08e.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/main-app-c9667f88ce212af6.js +0 -1
- package/app/apps/web/.next-bundle/static/css/5fdcdf46b29ffe26.css +0 -1
- /package/app/apps/web/.next-bundle/static/{0vrfPmNlhBe8bulSyjKSh → w6oDX-SYfedAnhX2GThXZ}/_buildManifest.js +0 -0
- /package/app/apps/web/.next-bundle/static/{0vrfPmNlhBe8bulSyjKSh → w6oDX-SYfedAnhX2GThXZ}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[664],{12991:(e,t,n)=>{"use strict";n.d(t,{OpenFolder:()=>c});var s=n(38657),a=n(32165),l=n(3043),i=n(2575),r=n(91635);let o={folder:{idle:"open.folder",busy:"open.busy",done:"open.doneFolder"},editor:{idle:"open.editor",busy:"open.busy",done:"open.done"},terminal:{idle:"open.terminal",busy:"open.busy",done:"open.done"}};function c(e){let{projectId:t,path:n,tool:c="folder",appearance:d="inline",locale:u}=e,[m,p]=(0,a.useState)("ready"),[x,h]=(0,a.useState)(null);async function j(){p("opening"),h(null);let e=await (0,r.A)({id:t,tool:c},(0,i.t)(u,"open.unreachable"));e.ok?(p("open"),setTimeout(()=>p("ready"),2e3)):(p("ready"),h(e.message))}let f=o[c],g=(0,i.t)(u,f.idle),b="editor"===c?l.KQe:"terminal"===c?l.Jhl:l.mUU;return(0,s.jsxs)("span",{className:"open-project-action open-project-action--".concat(d),children:[(0,s.jsxs)("button",{type:"button",onClick:j,disabled:"opening"===m,title:"".concat(g," \xb7 ").concat(n),children:[(0,s.jsx)(b,{"aria-hidden":!0}),"opening"===m?(0,i.t)(u,f.busy):"open"===m?(0,i.t)(u,f.done):g]}),x&&(0,s.jsx)("span",{className:"open-project-action__error",children:x})]})}},14847:(e,t,n)=>{"use strict";n.d(t,{ProjectActionBar:()=>y});var s=n(38657),a=n(10354),l=n(32165),i=n(3043),r=n(3953),o=n.n(r),c=n(67112),d=n(97234),u=n(9144),m=n(52302);function p(e){let{slug:t,ready:n}=e,a=(0,u.kj)(),[r,c]=(0,l.useState)(!1);return n?(0,s.jsxs)(o(),{className:"create-video",href:(0,d.Ej)(t,!0),children:[(0,s.jsx)(i.UW0,{"aria-hidden":!0}),a("apps.createVideo")]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",className:"create-video",onClick:()=>c(!0),children:[(0,s.jsx)(i.UW0,{"aria-hidden":!0}),a("apps.createVideo")]}),r&&(0,s.jsx)(x,{slug:t,onClose:()=>c(!1)})]})}function x(e){let{slug:t,onClose:n}=e,a=(0,u.kj)(),i=(0,l.useRef)(null),r=(0,l.useRef)(!1);(0,m.r)(i,!0),(0,l.useEffect)(()=>{requestAnimationFrame(()=>{var e;return null==(e=i.current)?void 0:e.focus()})},[]);let p=(0,l.useRef)(n);return(0,l.useEffect)(()=>{p.current=n}),(0,l.useEffect)(()=>{let e=e=>{"Escape"===e.key&&p.current()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),(0,c.createPortal)((0,s.jsx)("div",{className:"palette-backdrop",role:"presentation",onPointerDown:e=>{r.current=e.target===e.currentTarget},onClick:e=>{r.current&&e.target===e.currentTarget&&n()},children:(0,s.jsxs)("div",{ref:i,className:"app-invite",role:"dialog","aria-modal":"true","aria-labelledby":"video-gate-title",tabIndex:-1,children:[(0,s.jsxs)("div",{className:"app-invite__head",children:[(0,s.jsx)("p",{className:"eyebrow",children:a("apps.official")}),(0,s.jsx)("h2",{id:"video-gate-title",children:a("apps.videoGateTitle")})]}),(0,s.jsx)("p",{children:a("apps.videoGateBody")}),(0,s.jsx)("p",{children:a("apps.needsSetup")}),(0,s.jsxs)("div",{className:"app-invite__actions",children:[(0,s.jsx)("button",{type:"button",onClick:n,children:a("apps.cancel")}),(0,s.jsx)(o(),{className:"is-primary",href:(0,d.Ej)(t,!1),children:a("apps.videoGateGo")})]})]})}),document.body)}var h=n(5483),j=n(65330);function f(e){let{projectId:t,name:n,hidden:r,redirectTo:o,appearance:c="inline"}=e,d=(0,u.kj)(),m=(0,a.useRouter)(),[p,x]=(0,l.useState)(!1),[h,j]=(0,l.useState)(!1),[f,b]=(0,l.useState)(null);async function y(e,n){x(!0),b(null);try{let a=await fetch("/api/project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,id:t,confirmation:n})}),l=await a.json();if(a.ok)m.refresh();else{var s;b(null!=(s=l.error)?s:d("project.actionFailed"))}}catch(e){b(d("project.unreachable"))}finally{x(!1)}}return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{className:"menu"===c?"project-menu-actions":"inline-flex flex-wrap items-baseline gap-2",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>y(r?"mostrar":"ocultar"),disabled:p,title:d(r?"project.showTitle":"project.hideTitle"),className:"menu"===c?"project-menu-item":"inline-flex items-center gap-1.5 rounded border border-edge px-2 py-0.5 font-mono text-[11px] text-smoke transition-colors hover:border-accent hover:text-accent disabled:opacity-50",children:[r?(0,s.jsx)(i.bZk,{className:"h-3.5 w-3.5","aria-hidden":!0}):(0,s.jsx)(i.EgV,{className:"h-3.5 w-3.5","aria-hidden":!0}),d(r?"project.show":"project.hide")]}),(0,s.jsxs)("button",{type:"button",onClick:()=>j(!0),disabled:p,title:d("project.removeTitle"),className:"menu"===c?"project-menu-item project-menu-item--danger":"inline-flex items-center gap-1.5 rounded border border-edge px-2 py-0.5 font-mono text-[11px] text-smoke transition-colors hover:border-fail hover:text-fail disabled:opacity-50",children:[(0,s.jsx)(i.yRo,{className:"h-3.5 w-3.5","aria-hidden":!0}),d("project.remove")]}),f&&(0,s.jsx)("span",{className:"menu"===c?"project-menu-error":"font-mono text-[11px] text-fail",children:f})]}),h&&(0,s.jsx)(g,{name:n,busy:p,onCancel:()=>j(!1),onConfirm:async e=>{x(!0),b(null);try{let s=await fetch("/api/project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"excluir",id:t,confirmation:e})}),a=await s.json();if(s.ok)j(!1),o?m.push(o):m.refresh();else{var n;b(null!=(n=a.error)?n:d("project.actionFailed")),j(!1)}}catch(e){b(d("project.unreachable")),j(!1)}finally{x(!1)}}})]})}function g(e){let{name:t,busy:n,onCancel:a,onConfirm:i}=e,r=(0,u.kj)(),[o,d]=(0,l.useState)(""),p=(0,l.useRef)(null),x=(0,l.useRef)(null),h=o.trim()===t;return(0,m.r)(x,!0),(0,l.useEffect)(()=>{requestAnimationFrame(()=>{var e;return null==(e=p.current)?void 0:e.focus()});let e=e=>{"Escape"===e.key&&a()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[a]),(0,c.createPortal)((0,s.jsx)("div",{className:"palette-backdrop",role:"presentation",onClick:e=>{e.target===e.currentTarget&&a()},children:(0,s.jsxs)("form",{ref:x,className:"confirm-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"confirm-title",onSubmit:e=>{e.preventDefault(),h&&!n&&i(o.trim())},children:[(0,s.jsx)("h2",{id:"confirm-title",children:r("project.removeHeading",{name:t})}),(0,s.jsx)("p",{children:r("project.removeBody")}),(0,s.jsxs)("p",{className:"confirm-dialog__safe",children:[(0,s.jsx)("strong",{children:r("project.removeSafeStrong")})," ",r("project.removeSafeBody")]}),(0,s.jsxs)("label",{children:[(0,s.jsxs)("span",{children:[r("project.removeTypeBefore")," ",(0,s.jsx)("code",{children:t})," ",r("project.removeTypeAfter")]}),(0,s.jsx)("input",{ref:p,value:o,onChange:e=>d(e.target.value),autoComplete:"off",spellCheck:!1,"aria-label":r("project.removeTypeAria",{name:t})})]}),(0,s.jsxs)("div",{className:"confirm-dialog__actions",children:[(0,s.jsx)("button",{type:"button",onClick:a,disabled:n,children:r("project.cancel")}),(0,s.jsx)("button",{type:"submit",disabled:!h||n,className:"is-danger",children:r(n?"project.removing":"project.removeConfirm")})]})]})}),document.body)}var b=n(1810);function y(e){let{projectId:t,projectName:n,slug:r,path:o,hidden:c,videoReady:d}=e,m=(0,u.kj)(),x=(0,u.Ym)(),g=(0,a.useRouter)(),y=(0,l.useRef)(null),[v,k]=(0,l.useState)(!1),[N,w]=(0,l.useState)(null),[S,C]=(0,l.useState)("ok"),[T,P]=(0,l.useState)(!1),[A,O]=(0,l.useState)(0);async function R(){try{await navigator.clipboard.writeText(o),C("ok"),w(m("project.pathCopied")),setTimeout(()=>w(null),1800)}catch(e){C("error"),w(m("project.pathCopyFailed"))}}async function E(){P(!0),w(null);try{let n=await fetch("/api/rescan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:t})}),s=await n.json();if(!n.ok||!s.ok){var e;throw Error(null!=(e=s.error)?e:m("project.rescanFailed"))}C("ok"),w(m("project.rescanned")),g.refresh()}catch(e){C("error"),w(e.message)}finally{P(!1)}}return(0,b.y)(y,v,()=>k(!1)),(0,s.jsxs)("div",{className:"project-action-bar",ref:y,children:[(0,s.jsxs)("div",{className:"project-action-bar__primary",children:[(0,s.jsx)(h.w,{projectId:t,projectName:n,configureSignal:A}),(0,s.jsx)(p,{slug:r,ready:d}),(0,s.jsx)(j.q,{projectId:t,path:o,locale:x,closed:v,onOpenChange:e=>e&&k(!1)}),(0,s.jsx)("button",{type:"button",className:"project-more-button","aria-label":m("project.moreActions"),"aria-expanded":v,"aria-haspopup":"menu",onClick:()=>k(e=>!e),children:(0,s.jsx)(i.zMq,{"aria-hidden":!0})})]}),v&&(0,s.jsxs)("div",{className:"project-overflow-menu",role:"menu",children:[(0,s.jsxs)("button",{type:"button",role:"menuitem",className:"project-menu-item",onClick:R,children:[(0,s.jsx)(i.hru,{"aria-hidden":!0}),m("project.copyPath")]}),(0,s.jsxs)("button",{type:"button",role:"menuitem",className:"project-menu-item",onClick:E,disabled:T,children:[(0,s.jsx)(i.efr,{"aria-hidden":!0,className:T?"is-spinning":void 0}),m(T?"project.rescanning":"project.rescan")]}),(0,s.jsxs)("button",{type:"button",role:"menuitem",className:"project-menu-item",onClick:()=>{k(!1),O(e=>e+1)},children:[(0,s.jsx)(i.x5m,{"aria-hidden":!0}),m("openAll.configure")]}),N&&(0,s.jsxs)("p",{className:"project-menu-notice project-menu-notice--".concat(S),role:"status",children:["ok"===S?(0,s.jsx)(i.mmf,{"aria-hidden":!0}):(0,s.jsx)(i.f9d,{"aria-hidden":!0}),N]}),(0,s.jsx)("div",{className:"project-menu-divider"}),(0,s.jsx)(f,{projectId:t,name:n,hidden:c,redirectTo:"/",appearance:"menu"})]})]})}},17023:(e,t,n)=>{"use strict";n.d(t,{CaptureTask:()=>m});var s=n(38657),a=n(32165),l=n(10354);let i=["open","in-progress"];var r=n(2575),o=n(52948);let c={open:"strong","in-progress":"accent",done:"live",discarded:"quiet"};function d(e){var t,n;let{status:a,locale:l}=e;return(0,s.jsx)(o.vw,{tone:null!=(t=c[a])?t:c.open,title:a,children:null!=(n=(0,r.t)(l,"taskState.".concat(a)))?n:a})}var u=n(9144);function m(e){let{slug:t,tasks:n}=e,r=(0,u.kj)(),c=(0,u.Ym)(),[m,p]=(0,a.useState)(""),[x,h]=(0,a.useState)(!1),[j,f]=(0,a.useState)(null),[g,b]=(0,a.useTransition)(),y=(0,l.useRouter)(),v=n.filter(e=>i.includes(e.status)),k=x||g;async function N(e){e.preventDefault();let n=m.trim();if(n&&!k){h(!0),f(null);try{let e=await fetch("/api/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t,title:n})}),a=await e.json().catch(()=>({}));if(e.ok)p(""),b(()=>y.refresh());else{var s;f(null!=(s=a.error)?s:r("task.saveFailed"))}}catch(e){f(r("task.unreachable"))}finally{h(!1)}}}return(0,s.jsxs)("section",{className:"rounded-lg border border-edge bg-surface p-4",children:[(0,s.jsxs)("div",{className:"mb-2.5 flex items-baseline justify-between gap-3",children:[(0,s.jsx)("h3",{className:"eyebrow",children:r("task.title")}),v.length>0&&(0,s.jsx)("span",{className:"font-mono text-[10px] text-faint",children:r(1===v.length?"task.openOne":"task.openMany",{n:v.length})})]}),(0,s.jsxs)("form",{onSubmit:N,className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)(o.D0,{label:r("task.fieldLabel"),hideLabel:!0,size:"sm",className:"min-w-0 flex-1",value:m,onChange:e=>p(e.target.value),maxLength:160,placeholder:r("task.placeholder")}),(0,s.jsx)(o.rA,{tone:"raised",type:"submit",busy:x,busyLabel:r("task.saving"),disabled:k||!m.trim(),children:r("task.save")})]}),(0,s.jsx)("p",{className:"mt-2 font-mono text-[11px] leading-relaxed text-faint",children:r("task.mcpNote")}),j&&(0,s.jsx)(o.lZ,{text:j,className:"mt-2"}),v.length>0&&(0,s.jsx)("ul",{className:"mt-3 space-y-1.5 border-t border-edge pt-3",children:v.map(e=>{var t;return(0,s.jsxs)("li",{className:"flex flex-wrap items-baseline gap-2 text-xs",children:[(0,s.jsx)(d,{status:e.status,locale:c}),(0,s.jsx)("span",{className:"min-w-0 flex-1 leading-relaxed text-smoke",children:e.title}),(0,s.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-faint",children:null!=(t=e.agentName)?t:"human"===e.createdBy?r("task.byHuman"):e.createdBy})]},e.id)})})]})}},20266:(e,t,n)=>{Promise.resolve().then(n.bind(n,69636)),Promise.resolve().then(n.bind(n,17023)),Promise.resolve().then(n.bind(n,14262)),Promise.resolve().then(n.bind(n,30153)),Promise.resolve().then(n.bind(n,65425)),Promise.resolve().then(n.bind(n,64106)),Promise.resolve().then(n.bind(n,20682)),Promise.resolve().then(n.bind(n,93489)),Promise.resolve().then(n.bind(n,40810)),Promise.resolve().then(n.bind(n,12991)),Promise.resolve().then(n.bind(n,79296)),Promise.resolve().then(n.bind(n,14847)),Promise.resolve().then(n.bind(n,62827)),Promise.resolve().then(n.bind(n,48481)),Promise.resolve().then(n.bind(n,53937)),Promise.resolve().then(n.bind(n,23397)),Promise.resolve().then(n.bind(n,41814)),Promise.resolve().then(n.bind(n,79135)),Promise.resolve().then(n.bind(n,90344)),Promise.resolve().then(n.bind(n,67890)),Promise.resolve().then(n.bind(n,84549)),Promise.resolve().then(n.t.bind(n,3953,23))},20682:(e,t,n)=>{"use strict";n.d(t,{MdInspect:()=>o});var s=n(38657),a=n(32165),l=n(9144),i=n(93489),r=n(52948);function o(e){let{slug:t,path:n}=e,o=(0,l.kj)(),[c,d]=(0,a.useState)("ready"),[u,m]=(0,a.useState)([]),[p,x]=(0,a.useState)(!1),[h,j]=(0,a.useState)(null);async function f(){d("working"),j(null);try{var e,s;let a=await fetch("/api/md/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t,path:n})}),l=await a.json();a.ok&&l.findings?(m(l.findings),x(null!=(e=l.truncated)&&e),d("done")):(j(null!=(s=l.error)?s:String(a.status)),d("ready"))}catch(e){j(o("project.unreachable")),d("ready")}}return"done"!==c?(0,s.jsxs)("span",{className:"project-md-inspect",children:[(0,s.jsx)(r.rA,{tone:"surface",size:"sm",type:"button",onClick:f,busy:"working"===c,busyLabel:o("project.mdInspectWorking"),children:o("project.mdInspectButton")}),h&&(0,s.jsx)(r.lZ,{as:"span",text:h,className:"ml-2"})]}):(0,s.jsxs)("div",{className:"project-md-inspect-result",children:[0===u.length?(0,s.jsx)("p",{className:"project-md-clean",children:o("project.mdClean")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"project-md-count",children:1===u.length?o("project.mdFindingOne"):o("project.mdFindings",{n:u.length})}),(0,s.jsx)("ul",{className:"project-md-findings",children:u.map(e=>(0,s.jsxs)("li",{children:[(0,s.jsx)("span",{className:"project-md-line",children:o("project.mdLine",{n:e.line})}),(0,s.jsx)("code",{children:e.claim}),(0,s.jsx)("span",{className:"project-md-reason",children:function(e){if("broken-block"===e.kind)return o("project.mdBlockBroken");if("wrong-version"===e.kind){var t;return o("project.mdVersionWrong",{v:null!=(t=e.hint)?t:"?"})}return"missing-env"===e.kind?e.hint?o("project.mdEnvNear",{names:e.hint}):o("project.mdEnvMissing"):"missing-path"===e.kind?e.hint?o("project.mdPathMovedTo",{path:e.hint}):o("project.mdPathMissing"):e.hint?o("project.mdScriptNear",{names:e.hint}):o("project.mdScriptMissing")}(e)})]},"".concat(e.line,":").concat(e.claim)))})]}),(()=>{let e=u.filter(e=>e.hint&&("missing-path"===e.kind||"wrong-version"===e.kind||"missing-script"===e.kind&&!e.hint.includes(","))).length;return e>0?(0,s.jsx)("div",{className:"project-md-actions",children:(0,s.jsx)(i.MdRepair,{slug:t,path:n,fixable:e,onDone:f})}):null})(),p&&(0,s.jsx)("p",{className:"project-md-hint",children:o("project.mdTruncated")})]})}},23397:(e,t,n)=>{"use strict";n.d(t,{ProjectDouble:()=>o});var s=n(38657),a=n(32165),l=n(10354),i=n(9144),r=n(52948);function o(e){let{slug:t,consultations:n}=e,o=(0,i.kj)(),[c,d]=(0,a.useState)(null),[u,m]=(0,a.useState)(null),[p,x]=(0,a.useTransition)(),h=(0,l.useRouter)();if(0===n.length)return null;let j=null!==c||p;async function f(e,n){if(!j){d(e),m(null);try{var s;let a=await fetch("/api/consultations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t,id:e,verdict:n})}),l=await a.json().catch(()=>({}));a.ok?x(()=>h.refresh()):m(null!=(s=l.error)?s:o("double.saveFailed"))}catch(e){m(o("double.saveFailed"))}finally{d(null)}}}return(0,s.jsxs)(r.Zp,{as:"section",children:[(0,s.jsxs)("div",{className:"mb-2.5 flex items-baseline justify-between gap-3",children:[(0,s.jsx)("h3",{className:"eyebrow",children:o("double.title")}),(0,s.jsx)("span",{className:"font-mono text-[10px] text-faint",children:o("double.shadowTag")})]}),(0,s.jsx)("p",{className:"mb-3 font-mono text-[11px] leading-relaxed text-faint",children:o("double.hint")}),u&&(0,s.jsx)(r.lZ,{text:u,className:"mb-2"}),(0,s.jsx)("ul",{className:"space-y-3",children:n.map(e=>(0,s.jsxs)("li",{className:"border-t border-edge pt-2.5 text-xs first:border-t-0 first:pt-0",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline gap-2",children:[(0,s.jsx)("span",{className:"min-w-0 flex-1 leading-relaxed text-chalk",children:e.question}),(0,s.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-faint",children:o("double.askedBy",{agent:e.agent})})]}),"drafting"===e.status&&(0,s.jsx)("p",{className:"mt-1 text-[11px] text-faint",children:o("double.drafting")}),"abstained"===e.status&&(0,s.jsx)("p",{className:"mt-1 text-[11px] text-faint",children:o("double.abstained")}),"drafted"===e.status&&e.cited.length>0&&(0,s.jsxs)("p",{className:"mt-1 font-mono text-[10px] leading-relaxed text-faint",children:[o("double.cites")," ",e.cited.join(" \xb7 ")]}),"drafted"===e.status&&(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-baseline gap-2",children:[(0,s.jsx)("span",{className:"min-w-0 flex-1 leading-relaxed text-smoke",children:e.answer}),null===e.verdict?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.rA,{tone:"raised",busy:c===e.id,disabled:j,onClick:()=>void f(e.id,"backed"),children:o("double.backed")}),(0,s.jsx)(r.rA,{tone:"plain",busy:c===e.id,disabled:j,onClick:()=>void f(e.id,"vetoed"),children:o("double.vetoed")})]}):(0,s.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-faint",children:"backed"===e.verdict?o("double.labeledBacked"):o("double.labeledVetoed")})]})]},e.id))})]})}},30153:(e,t,n)=>{"use strict";n.d(t,{Critiques:()=>o});var s=n(38657),a=n(32165),l=n(10354),i=n(9144),r=n(52948);function o(e){let{slug:t,findings:n,queued:o,discarded:c=[],review:d=null}=e,u=(0,i.kj)(),m=(0,l.useRouter)(),[,p]=(0,a.useTransition)(),[x,h]=(0,a.useState)(o),[j,f]=(0,a.useState)(()=>new Set(c)),g=JSON.stringify(Object.entries(o).sort()),b=JSON.stringify([...c].sort());(0,a.useEffect)(()=>{h(Object.fromEntries(JSON.parse(g)))},[g]),(0,a.useEffect)(()=>{f(new Set(JSON.parse(b)))},[b]);let[y,v]=(0,a.useState)(null),[k,N]=(0,a.useState)({}),[w,S]=(0,a.useState)(!1);if(0===n.length)return(0,s.jsx)("p",{className:"mt-4 font-mono text-[11px] leading-relaxed text-faint",children:null===d?u("critique.never"):"".concat(u("critique.clean",{n:d.sourcesRead})).concat(d.truncated?" ".concat(u("critique.partial")):"")});function C(e,t){N(n=>({...n,[e]:t}))}async function T(e,n){if(null===y){v(e.index);try{let a=await fetch("/api/twin/critique",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t,finding:e.index,key:e.key,decision:n})}),l=await a.json().catch(()=>({}));if(!a.ok){var s;l.id&&h(t=>({...t,[e.key]:l.id})),C(e.index,{text:null!=(s=l.error)?s:String(a.status),bad:409!==a.status||void 0===l.id});return}"discard"===n?(f(t=>new Set(t).add(e.key)),h(t=>{let n={...t};return delete n[e.key],n}),C(e.index,{text:u("critique.dismissed"),bad:!1})):(l.id&&h(t=>({...t,[e.key]:l.id})),f(t=>{let n=new Set(t);return n.delete(e.key),n}),C(e.index,{text:u("critique.queued"),bad:!1})),p(()=>m.refresh())}catch(t){C(e.index,{text:u("task.unreachable"),bad:!0})}finally{v(null)}}}return(0,s.jsxs)(r.Zp,{pad:"none",className:"mt-4 px-4 py-3",children:[(0,s.jsx)("button",{type:"button",onClick:()=>S(e=>!e),className:"font-mono text-xs text-smoke transition-colors hover:text-chalk",children:w?u("critique.hide"):1===n.length?u("critique.showOne"):u("critique.showMany",{findings:n.length})}),w&&(0,s.jsx)("ol",{className:"mt-3 flex flex-col gap-3",children:n.map(e=>{let t=x[e.key],n=j.has(e.key),a=k[e.index];return(0,s.jsxs)("li",{className:"flex flex-col gap-1",children:[(0,s.jsxs)("p",{className:"max-w-2xl text-sm leading-relaxed",children:[e.claim,e.hint?(0,s.jsxs)("span",{className:"text-smoke",children:[" \xb7 ",e.hint]}):null]}),e.file&&(0,s.jsxs)("p",{className:"max-w-2xl font-mono text-xs text-faint",children:[e.file,e.line?":".concat(e.line):""]}),(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,s.jsx)(r.rA,{tone:"plain",type:"button",onClick:()=>void T(e,"queue"),disabled:null!==y||void 0!==t,children:void 0!==t?u("look.assigned"):u("look.assignButton")}),!n&&(0,s.jsx)(r.rA,{tone:"quiet",type:"button",onClick:()=>void T(e,"discard"),disabled:null!==y,children:u("look.dismissButton")}),n&&(0,s.jsx)("span",{className:"font-mono text-xs text-faint",children:u("look.dismissed")})]}),a&&(0,s.jsx)("p",{className:"max-w-2xl font-mono text-xs ".concat(a.bad?"text-fail":"text-smoke"),children:a.text})]},e.key)})})]})}},31821:(e,t,n)=>{"use strict";let s;n.d(t,{q:()=>l});var a=n(32165);function l(){let[e,t]=(0,a.useState)({available:!1,agent:null});return(0,a.useEffect)(()=>{null!=s||(s=fetch("/api/assignments/launch").then(e=>e.json()).catch(()=>({available:!1,agent:null})));let e=!0;return s.then(n=>{e&&t(n)}),()=>{e=!1}},[]),e}},40810:(e,t,n)=>{"use strict";n.d(t,{MdReview:()=>c});var s=n(38657),a=n(32165),l=n(3043),i=n(9144),r=n(52948),o=n(60753);function c(e){var t;let{slug:n,initial:c,stale:d}=e,u=(0,i.kj)(),m=(0,i.Ym)(),[p,x]=(0,a.useState)("ready"),[h,j]=(0,a.useState)(c),[f,g]=(0,a.useState)(!1),[b,y]=(0,a.useState)(!1),[v,k]=(0,a.useState)(!1),[N,w]=(0,a.useState)(null);async function S(e){x("writing"),w(null);try{let s=await fetch("/api/md/review",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e?{slug:n,force:!0}:{slug:n})}),a=await s.json();if(s.ok){var t;j({text:a.text,model:a.model,at:null!=(t=a.at)?t:new Date().toISOString(),lang:m}),g(!0),y(!0===a.cached),k(!1===a.saved)}else w([a.error,a.hint].filter(Boolean).join(" \xb7 "))}catch(e){w(u("project.unreachable"))}finally{x("ready")}}return(0,s.jsxs)("div",{className:"rounded-lg border border-edge bg-surface p-4",children:[h?(0,s.jsxs)(s.Fragment,{children:[d&&!f&&(0,s.jsx)("p",{className:"mb-2 font-mono text-[11px] text-smoke",children:u("project.mdReviewStale")}),(0,s.jsx)("p",{className:"whitespace-pre-line text-sm leading-relaxed text-chalk",children:h.text}),(0,s.jsxs)("p",{className:"mt-3 flex flex-wrap items-center gap-x-3 gap-y-1 border-t border-edge pt-2.5 font-mono text-[11px] text-faint",children:[(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,s.jsx)(l.tZt,{className:"h-3.5 w-3.5","aria-hidden":!0}),u("project.aiWrittenBy",{model:null!=(t=h.model)?t:u("project.aiSomeModel")})]}),h.at&&(0,s.jsx)("span",{children:new Date(h.at).toLocaleDateString(m)}),(0,s.jsx)(o.b,{lang:h.lang}),(0,s.jsx)("button",{type:"button",onClick:()=>S(!0),disabled:"writing"===p,className:"ml-auto transition-colors hover:text-accent disabled:opacity-50",children:u("writing"===p?"project.mdReviewAsking":"project.mdReviewAgain")})]}),b&&(0,s.jsx)("p",{className:"mt-1 font-mono text-[11px] leading-relaxed text-faint",children:u("project.mdReviewCached")}),v&&(0,s.jsx)("p",{className:"mt-1 font-mono text-[11px] leading-relaxed text-faint",children:u("project.aiUnsaved")})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(r.rA,{tone:"surface",type:"button",onClick:()=>S(!1),busy:"writing"===p,children:[(0,s.jsx)(l.tZt,{className:"h-4 w-4","aria-hidden":!0}),u("writing"===p?"project.mdReviewAsking":"project.mdReviewAsk")]}),(0,s.jsxs)("p",{className:"mt-2 font-mono text-[11px] leading-relaxed text-faint",children:[u("project.mdReviewNote")," ",u("project.aiNoteBefore")," ",(0,s.jsx)("code",{children:"panoma ai use"}),"."]})]}),N&&(0,s.jsx)(r.lZ,{text:N,className:"mt-2"})]})}},41814:(e,t,n)=>{"use strict";n.d(t,{ProjectHooks:()=>o});var s=n(38657),a=n(32165),l=n(10354),i=n(9144),r=n(52948);function o(e){let{slug:t,installed:n}=e,o=(0,i.kj)(),c=(0,l.useRouter)(),[d,u]=(0,a.useState)(!1),[m,p]=(0,a.useState)(null),[,x]=(0,a.useTransition)();if(n)return(0,s.jsxs)("p",{className:"font-mono text-[11px] leading-relaxed text-faint",children:[(0,s.jsx)("span",{className:"text-accent",children:"✓"})," ",o("projectHooks.on")]});async function h(){if(!d){u(!0),p(null);try{var e,n;let s=await fetch("/api/hooks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t})}),a=await s.json().catch(()=>({}));s.ok&&(null!=(e=a.installed)?e:0)>0?x(()=>c.refresh()):p(null!=(n=a.error)?n:o("bridge.hooksNoCli"))}catch(e){p(o("bridge.hooksNoCli"))}finally{u(!1)}}}return(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("p",{className:"font-mono text-[11px] leading-relaxed text-faint",children:o("projectHooks.off")}),(0,s.jsx)(r.rA,{tone:"raised",busy:d,disabled:d,onClick:()=>void h(),children:o("projectHooks.install")})]}),m&&(0,s.jsx)(r.lZ,{text:m})]})}},48481:(e,t,n)=>{"use strict";n.d(t,{ProjectBuildCheck:()=>c});var s=n(38657),a=n(32165),l=n(10354),i=n(3043),r=n(9144),o=n(52948);function c(e){let{slug:t,initial:n}=e,c=(0,r.kj)(),d=(0,r.Ym)(),u=(0,l.useRouter)(),[m,p]=(0,a.useState)(n),[x,h]=(0,a.useState)(!1),[j,f]=(0,a.useState)(null);async function g(){h(!0),f(null);try{let n=await fetch("/api/check",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t})}),s=await n.json();if(n.ok&&s.ok&&s.verdict)p(s.verdict),u.refresh();else{var e;f(null!=(e=s.error)?e:String(n.status))}}catch(e){f(c("project.unreachable"))}finally{h(!1)}}let b=(0,s.jsxs)(o.rA,{tone:"raised",size:"sm",type:"button",onClick:g,disabled:x,children:[(0,s.jsx)(i.ax_,{className:"h-3.5 w-3.5","aria-hidden":!0}),c(m?"check.rerun":"check.run")]});if(x)return(0,s.jsx)("div",{className:"project-build-check",children:(0,s.jsx)("p",{className:"project-muted-message",children:c("check.running")})});if(!m)return(0,s.jsxs)("div",{className:"project-build-check",children:[(0,s.jsx)("p",{className:"project-muted-message",children:c("check.none")}),b,j&&(0,s.jsx)(o.lZ,{text:j,className:"mt-2"})]});let y="ok"===m.status||"failed"===m.status,v=new Date(m.at).toLocaleDateString(d,{day:"numeric",month:"short",year:"numeric"}),k=Math.max(1,Math.round(m.durationMs/1e3));return(0,s.jsxs)("div",{className:"project-build-check",children:[(0,s.jsxs)("p",{className:"flex items-center gap-1.5 text-sm",children:["ok"===m.status?(0,s.jsx)(i.CU3,{className:"h-4 w-4 shrink-0 text-live","aria-hidden":!0}):"failed"===m.status?(0,s.jsx)(i.oNX,{className:"h-4 w-4 shrink-0 text-fail","aria-hidden":!0}):null,(0,s.jsx)("strong",{children:c("ok"===m.status?"check.ok":"failed"===m.status?"check.broken":"check.inconclusive")}),y&&(0,s.jsx)("span",{className:"font-mono text-[11px] text-faint",children:c("check.checkedOn",{date:v,seconds:String(k)})})]}),(0,s.jsx)("p",{className:"mt-1 text-[13px] text-smoke",children:m.summary}),m.dirty&&(0,s.jsx)("p",{className:"mt-1 font-mono text-[11px] text-smoke",children:c("check.dirty")}),m.reason&&(0,s.jsx)("pre",{className:"project-build-check-reason",children:m.reason}),m.isolationNote&&(0,s.jsx)("p",{className:"mt-1 text-[11px] text-faint",children:m.isolationNote}),(0,s.jsx)("div",{className:"mt-2",children:b}),j&&(0,s.jsx)(o.lZ,{text:j,className:"mt-2"})]})}},53937:(e,t,n)=>{"use strict";n.d(t,{CommitActivityChart:()=>j,HealthScoreRing:()=>h});var s=n(38657),a=n(32165),l=n(17446),i=n(30926),r=n(23403),o=n(81466),c=n(22893),d=n(60917),u=n(57533),m=n(9144),p=n(8901);let x={es:["D","L","M","M","J","V","S"],en:["S","M","T","W","T","F","S"]};function h(e){let{score:t}=e,n=(0,m.kj)(),a=Math.max(0,Math.min(100,t)),r=a>=70?p.fN:a>=55?p.sV:p.kS;return(0,s.jsxs)("div",{className:"health-score-ring","aria-label":n("project.healthTitle",{n:a}),children:[(0,s.jsx)(l.D,{width:138,height:138,cx:69,cy:69,innerRadius:48,outerRadius:59,barSize:10,data:[{value:a,fill:r}],startAngle:90,endAngle:-270,children:(0,s.jsx)(i.ZB,{dataKey:"value",background:{fill:p.KG},cornerRadius:8})}),(0,s.jsx)("span",{className:"health-score-ring__value",children:a}),(0,s.jsx)("span",{className:"health-score-ring__total",children:n("project.outOf100")})]})}function j(e){let{week:t}=e,n=(0,m.kj)(),l=(0,m.Ym)(),i=(0,a.useMemo)(()=>t.map((e,n)=>({day:x[l][e.weekday],value:e.value,current:n===t.length-1})),[t,l]);return(0,s.jsx)("div",{className:"commit-activity-chart","aria-label":n("project.commitChartAria"),children:(0,s.jsx)(r.u,{width:"100%",height:"100%",children:(0,s.jsxs)(o.E,{data:i,margin:{top:4,right:0,left:0,bottom:0},children:[(0,s.jsx)(c.W,{dataKey:"day",axisLine:!1,tickLine:!1,tick:{fill:p.ux,fontSize:10}}),(0,s.jsx)(d.yP,{dataKey:"value",radius:[2,2,0,0],minPointSize:4,maxBarSize:17,children:i.map((e,t)=>(0,s.jsx)(u.f,{fill:e.current?p.Pg:p.KG},"".concat(e.day,"-").concat(t)))})]})})})}},60753:(e,t,n)=>{"use strict";n.d(t,{b:()=>i});var s=n(38657),a=n(9144);let l={es:"lang.es",en:"lang.en"};function i(e){let{lang:t}=e,n=(0,a.kj)(),i=(0,a.Ym)(),r="en"===t?"en":"es";return r===i?null:(0,s.jsx)("span",{children:n("project.aiWrittenIn",{lang:n(l[r])})})}},62827:(e,t,n)=>{"use strict";n.d(t,{ProjectBoard:()=>o});var s=n(38657),a=n(32165),l=n(9144);let i=[{id:"all",hashes:["","all"],label:"project.navAll"},{id:"resumen",hashes:["summary","resumen"],label:"project.navSummary"},{id:"actividad",hashes:["activity","actividad"],label:"project.navChanges"},{id:"retomar",hashes:["resume","retomar"],label:"project.navResume"},{id:"cuentas",hashes:["accounts","cuentas"],label:"project.navAccounts"},{id:"encargos",hashes:["assignments","encargos"],label:"project.navAssignments"},{id:"memoria",hashes:["memory"],label:"notes.title"},{id:"md",hashes:["md"],label:"project.navMd"},{id:"dependencias",hashes:["dependencies","dependencias","security","seguridad"],label:"project.navDeps"},{id:"agentes",hashes:["agents","agentes","log","bitacora"],label:"project.navAgents"},{id:"detalles",hashes:["details","detalles","stack","tecnologias"],label:"project.navDetails"}];function r(e){var t;null==(t=document.querySelector(".project-detail-page"))||t.setAttribute("data-view",e)}function o(e){let{sidebar:t,children:n}=e,o=(0,l.kj)(),[c,d]=(0,a.useState)("all");return(0,a.useEffect)(()=>{let e=()=>{let e=function(e){let t=e.replace(/^#/,"");if("unsaved"===t||"respaldo"===t)return"resumen";for(let e of i)if(e.hashes.includes(t))return e.id;return"all"}(window.location.hash);d(e),r(e)};return e(),window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("nav",{className:"project-subnav","aria-label":o("project.sections"),children:i.map(e=>{let t="all"===e.id?"#all":"#".concat(e.hashes[0]),n=c===e.id;return(0,s.jsx)("a",{href:t,className:n?"is-active":void 0,"aria-current":n?"page":void 0,onClick:n=>{n.preventDefault();let s=window.location.pathname+window.location.search;if("all"!==e.id&&c===e.id){window.history.replaceState(null,"",s),d("all"),r("all");return}window.history.replaceState(null,"","all"===e.id?s:"".concat(s).concat(t)),d(e.id),r(e.id)},children:o(e.label)},e.id)})}),(0,s.jsxs)("div",{className:"project-detail-layout",id:"summary",children:[(0,s.jsx)("div",{className:"project-primary-column",children:n}),(0,s.jsx)("aside",{className:"project-secondary-column",children:t})]})]})}},64106:(e,t,n)=>{"use strict";n.d(t,{MdApply:()=>c});var s=n(38657),a=n(32165),l=n(10354),i=n(35261),r=n(9144),o=n(52948);function c(e){let{slug:t,action:n,label:c}=e,d=(0,r.kj)(),u=(0,l.useRouter)(),[m,p]=(0,a.useState)("ready"),[x,h]=(0,a.useState)(null),[j,f]=(0,a.useState)(null);async function g(){p("working"),f(null),h(null);let e=await (0,i.B)("/api/md/apply",{slug:t,action:n},d("project.unreachable"));if(e.ok){var s;let t=null!=(s=e.data.file)?s:"AGENTS.md",a=e.data.created?d("project.mdInitDone",{file:t}):e.data.changed?"init"===n?d("project.mdBlockAdded",{file:t}):d("project.mdSyncDone",{file:t}):d("project.mdSyncSame");h(e.data.bridged?"".concat(a," ").concat(d("project.mdBridgeWritten")):a),setTimeout(()=>u.refresh(),2200)}else f(e.message);p("ready")}return(0,s.jsxs)("div",{className:"project-md-apply",children:[(0,s.jsx)(o.rA,{tone:"accent",type:"button",onClick:g,busy:"working"===m,busyLabel:d("project.mdApplyWorking"),children:c}),x&&(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-live",children:x}),j&&(0,s.jsx)(o.lZ,{text:j,className:"mt-2"})]})}},65425:(e,t,n)=>{"use strict";n.d(t,{Describe:()=>c});var s=n(38657),a=n(32165),l=n(3043),i=n(9144),r=n(52948),o=n(60753);function c(e){var t;let{slug:n,initial:c}=e,d=(0,i.kj)(),u=(0,i.Ym)(),[m,p]=(0,a.useState)("ready"),[x,h]=(0,a.useState)(c),[j,f]=(0,a.useState)(!1),[g,b]=(0,a.useState)(!1),[y,v]=(0,a.useState)(null);async function k(e){p("writing"),v(null);try{let s=await fetch("/api/describe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e?{slug:n,force:!0}:{slug:n})}),a=await s.json();if(s.ok){var t;h({text:a.text,model:a.model,at:null!=(t=a.at)?t:new Date().toISOString(),lang:u}),f(!0===a.cached),b(!1===a.saved)}else v([a.error,a.hint].filter(Boolean).join(" \xb7 "))}catch(e){v(d("project.unreachable"))}finally{p("ready")}}return(0,s.jsxs)("div",{className:"project-describe",children:[x?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-sm leading-relaxed text-chalk",children:x.text}),(0,s.jsxs)("p",{className:"mt-3 flex flex-wrap items-center gap-x-3 gap-y-1 border-t border-edge pt-2.5 font-mono text-[11px] text-faint",children:[(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,s.jsx)(l.tZt,{className:"h-3.5 w-3.5","aria-hidden":!0}),d("project.aiWrittenBy",{model:null!=(t=x.model)?t:d("project.aiSomeModel")})]}),x.at&&(0,s.jsx)("span",{children:new Date(x.at).toLocaleDateString(u)}),(0,s.jsx)(o.b,{lang:x.lang}),(0,s.jsx)("button",{type:"button",onClick:()=>k(!0),disabled:"writing"===m,className:"project-describe__rewrite ml-auto disabled:opacity-50",children:d("writing"===m?"project.aiWriting":"project.aiRewrite")})]}),j&&(0,s.jsx)("p",{className:"mt-1 font-mono text-[11px] leading-relaxed text-faint",children:d("project.aiCached")}),g&&(0,s.jsx)("p",{className:"mt-1 font-mono text-[11px] leading-relaxed text-faint",children:d("project.aiUnsaved")})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",onClick:()=>k(!1),disabled:"writing"===m,className:"project-describe__ask inline-flex items-center gap-2 px-3 py-1.5 font-mono text-xs disabled:opacity-50",children:[(0,s.jsx)(l.tZt,{className:"h-4 w-4","aria-hidden":!0}),d("writing"===m?"project.aiReading":"project.aiExplain")]}),(0,s.jsxs)("p",{className:"mt-2 font-mono text-[11px] leading-relaxed text-faint",children:[d("project.aiNoteBefore")," ",(0,s.jsx)("code",{children:"panoma ai use"}),"."," ",d("project.aiNoteAfter")]})]}),y&&(0,s.jsx)(r.lZ,{text:y,className:"mt-2"})]})}},67890:(e,t,n)=>{"use strict";n.d(t,{RunButton:()=>o});var s=n(38657),a=n(32165),l=n(10354),i=n(9144);let r={ok:"text-live",quiet:"text-faint",warn:"text-idle",bad:"text-fail"};function o(e){let t=(0,i.kj)(),[n,o]=(0,a.useTransition)(),[c,d]=(0,a.useState)(null),[u,m]=(0,a.useState)("quiet"),[p,x]=(0,a.useState)(!1),[h,j]=(0,a.useState)(!1),f=(0,l.useRouter)();async function g(){let n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];j(!0),d(null),x(!1);try{var s,a;let l=await fetch("/api/runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:e.slug,...e.security?{security:!0}:{packageName:e.packageName,targetVersion:e.targetVersion},...n?{force:!0}:{}})}),i=await l.json().catch(()=>null),r=function(e,t){var n;let s=t&&"object"==typeof t?t:{};return s.skipped&&s.knownFailure?{kind:"known-failure",summary:s.knownFailure.summary,runId:s.knownFailure.runId,hint:s.hint,forceable:!0,tone:"warn"}:!e.ok||s.error?{kind:"error",text:s.error,hint:s.hint,status:e.status,forceable:!1,tone:"bad"}:s.runId?{kind:"done",text:s.summary,tone:(n=s,"failed"===n.status?"bad":"no-changes"===n.status?"quiet":"proposed"===n.status?n.verified?"ok":"warn":"quiet")}:{kind:"unknown",status:e.status,tone:"bad"}}(l,i);m(r.tone),"known-failure"===r.kind?(x(r.forceable),d([t("project.alreadyFailed"),r.summary,r.hint].filter(Boolean).join(" "))):"error"===r.kind?d([null!=(s=r.text)?s:t("project.proposeRefused",{status:r.status}),r.hint].filter(Boolean).join(" ")):"unknown"===r.kind?d(t("project.proposeUnreadable",{status:r.status})):d(null!=(a=r.text)?a:t("project.proposeDone")),"known-failure"!==r.kind&&o(()=>f.refresh())}catch(e){m("bad"),d(t("project.runUnreachable"))}finally{j(!1)}}let b=h||n;return(0,s.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>void g(),disabled:b,className:"rounded border border-edge bg-raised px-2 py-0.5 font-mono text-[10px] text-smoke transition-colors hover:border-accent hover:text-accent disabled:opacity-50",children:t(b?"project.proposing":"project.propose")}),p&&!b&&(0,s.jsx)("button",{type:"button",onClick:()=>void g(!0),className:"rounded border border-idle/40 bg-raised px-2 py-0.5 font-mono text-[10px] text-idle transition-colors hover:border-idle hover:text-accent",children:t("project.tryAnyway")}),c&&(0,s.jsx)("span",{role:"status",className:"font-mono text-[10px] ".concat(r[u]),children:c})]})}},69636:(e,t,n)=>{"use strict";n.d(t,{Assignments:()=>m});var s=n(38657),a=n(32165),l=n(10354),i=n(3043),r=n(67890),o=n(9144),c=n(19014),d=n(31821),u=n(52948);function m(e){let{slug:t,assignments:n,queuedKinds:c,securityOpen:m,outdatedDeps:h}=e,j=(0,o.kj)(),f=(0,l.useRouter)(),[,g]=(0,a.useTransition)(),b=(0,d.q)(),[y,v]=(0,a.useState)(()=>new Set(c)),k=c.join(" ");(0,a.useEffect)(()=>{v(new Set(""===k?[]:k.split(" ")))},[k]);let[N,w]=(0,a.useState)(null),[S,C]=(0,a.useState)(null),[T,P]=(0,a.useState)(null),[A,O]=(0,a.useState)({});function R(e,t){O(n=>{let s={...n};return t?s[e]=t:delete s[e],s})}async function E(e){if(!N){w(e),R(e,null);try{var n,s;let a=await fetch("/api/assignments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t,kind:e})}),l=await a.json().catch(()=>({}));a.ok?(v(t=>new Set(t).add(e)),R(e,{text:j("assignment.queuedNote"),bad:!1}),g(()=>f.refresh())):409===a.status?(v(t=>new Set(t).add(e)),R(e,{text:null!=(n=l.error)?n:j("assignment.queuedNote"),bad:!1})):R(e,{text:[null!=(s=l.error)?s:j("assignment.failed"),l.hint].filter(Boolean).join(" "),bad:!0})}catch(t){R(e,{text:j("task.unreachable"),bad:!0})}finally{w(null)}}}async function B(e){if(!T){P(e),R(e,null);try{let s=await fetch("/api/assignments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t,kind:e,action:"withdraw"})}),a=await s.json().catch(()=>({}));if(s.ok)v(t=>{let n=new Set(t);return n.delete(e),n}),R(e,{text:j("assignment.withdrawn"),bad:!1}),g(()=>f.refresh());else{var n;409===s.status&&v(t=>{let n=new Set(t);return n.delete(e),n}),R(e,{text:[null!=(n=a.error)?n:j("assignment.withdrawFailed"),a.hint].filter(Boolean).join(" "),bad:409!==s.status})}}catch(t){R(e,{text:j("task.unreachable"),bad:!0})}finally{P(null)}}}async function F(e){if(!S){C(e),R(e,null);try{var n,s;let a=await fetch("/api/assignments/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t,kind:e})}),l=await a.json().catch(()=>({}));R(e,a.ok?{text:j("assignment.launched",{agent:null!=(n=l.agent)?n:""}),bad:!1}:{text:[null!=(s=l.error)?s:j("assignment.launchFailed"),l.hint].filter(Boolean).join(" "),bad:!0})}catch(t){R(e,{text:j("task.unreachable"),bad:!0})}finally{C(null)}}}return(0,s.jsxs)(u.Zp,{pad:"none",className:"px-4 py-1",children:[n.map(e=>(0,s.jsx)(p,{assignment:e,agent:b,enCola:y.has(e.kind),launching:S===e.kind,assigning:N===e.kind,withdrawing:T===e.kind,ocupado:null!==S||null!==N||null!==T,grade:A[e.kind],onLaunch:()=>F(e.kind),onAssign:()=>E(e.kind),onWithdraw:()=>B(e.kind)},e.kind)),m&&(0,s.jsx)(x,{title:j("assignment.securityTitle"),promise:j("assignment.securityPromise"),actions:(0,s.jsx)(r.RunButton,{slug:t,security:!0})}),h>0&&(0,s.jsx)(x,{title:j("assignment.depsTitle"),promise:j(1===h?"assignment.depsPromiseOne":"assignment.depsPromiseMany",{n:h}),actions:(0,s.jsxs)("a",{href:"#dependencies",className:"inline-flex items-center gap-1 rounded border border-edge bg-raised px-3 py-1.5 font-mono text-[11px] text-smoke transition-colors hover:border-accent hover:text-accent",children:[j("assignment.depsChoose")," ",(0,s.jsx)(i.r9I,{"aria-hidden":!0})]})})]})}function p(e){var t;let{assignment:n,agent:l,enCola:r,launching:c,assigning:d,withdrawing:m,ocupado:p,grade:j,onLaunch:f,onAssign:g,onWithdraw:b}=e,y=(0,o.kj)(),[v,k]=(0,a.useState)(!1);return(0,s.jsxs)(x,{title:n.title,promise:n.promise,actions:(0,s.jsxs)(s.Fragment,{children:[l.available&&(0,s.jsx)(u.rA,{tone:"accent",size:"sm",type:"button",onClick:f,busy:c,busyLabel:y("assignment.launching"),disabled:p,title:y("assignment.launchTitle",{agent:null!=(t=l.agent)?t:""}),children:y("assignment.launch")}),r?(0,s.jsxs)("span",{className:"inline-flex min-h-[26px] items-center gap-1 rounded border border-edge bg-raised px-2.5 py-1 font-mono text-[11px] text-faint",children:[(0,s.jsx)(i.mmf,{"aria-hidden":!0})," ",y("assignment.queued")]}):(0,s.jsx)(u.rA,{tone:"raised",size:"sm",type:"button",onClick:g,busy:d,busyLabel:y("assignment.sending"),disabled:p,title:y("assignment.sendTitle"),children:y("assignment.send")})]}),children:[(0,s.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 font-mono text-[11px]",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>k(!v),"aria-expanded":v,className:"inline-flex items-center gap-1 text-faint transition-colors hover:text-smoke",children:[(0,s.jsx)(i.ngD,{className:"h-3 w-3 transition-transform ".concat(v?"rotate-90":""),"aria-hidden":!0}),y("assignment.see")]}),(0,s.jsx)(h,{body:n.body}),r&&(0,s.jsx)("button",{type:"button",onClick:b,disabled:p,className:"text-faint transition-colors hover:text-smoke disabled:opacity-50",children:y(m?"assignment.withdrawing":"assignment.withdraw")})]}),v&&(0,s.jsx)("pre",{className:"mt-2 max-h-72 overflow-auto whitespace-pre-wrap rounded border border-edge bg-raised p-3 font-mono text-[11px] leading-relaxed text-smoke",children:n.body}),j&&(0,s.jsx)("p",{className:"mt-1.5 font-mono text-[11px] ".concat(j.bad?"text-fail":"text-faint"),children:j.text})]})}function x(e){let{title:t,promise:n,actions:a,children:l}=e;return(0,s.jsxs)("article",{className:"flex flex-wrap items-start gap-x-4 gap-y-2 border-t border-edge py-3.5 first:border-t-0",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-chalk",children:t}),(0,s.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-faint",children:n}),l]}),(0,s.jsx)("div",{className:"flex shrink-0 items-center gap-2 pt-0.5",children:a})]})}function h(e){let{body:t}=e,n=(0,o.kj)(),{copied:a,failed:l,copy:i}=(0,c.K)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{type:"button",onClick:()=>i(t),className:"text-faint transition-colors hover:text-smoke",children:n(a?"assignment.copied":"assignment.copy")}),l&&(0,s.jsx)("span",{role:"status",className:"text-fail",children:n("assignment.copyFailed")})]})}},79135:(e,t,n)=>{"use strict";n.d(t,{ProjectMemory:()=>o});var s=n(38657),a=n(32165),l=n(10354),i=n(9144),r=n(52948);function o(e){let{slug:t,notes:n,usage:o,extraction:c}=e,d=(0,i.kj)(),[u,m]=(0,a.useState)(""),[p,x]=(0,a.useState)(!1),[h,j]=(0,a.useState)(""),[f,g]=(0,a.useState)(!1),[b,y]=(0,a.useState)(null),[v,k]=(0,a.useState)(null),[N,w]=(0,a.useTransition)(),S=(0,l.useRouter)(),C=n.filter(e=>"approved"===e.status),T=n.filter(e=>"proposed"===e.status),P=n.filter(e=>"challenged"===e.status),A=f||null!==b||N;async function O(e,n){if(!A){g(void 0===n),y(null!=n?n:null),k(null);try{let n=await fetch("/api/notes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t,...e})}),a=await n.json().catch(()=>({}));if(n.ok)"add"===e.action&&(m(""),j("")),w(()=>S.refresh());else{var s;k(null!=(s=a.error)?s:d("notes.saveFailed"))}}catch(e){k(d("notes.saveFailed"))}finally{g(!1),y(null)}}}return(0,s.jsxs)("section",{id:"memory","aria-labelledby":"project-memory-title",children:[(0,s.jsx)("h2",{id:"project-memory-title",className:"eyebrow mb-2",children:d("notes.title")}),(0,s.jsx)("p",{className:"mb-3 text-xs leading-relaxed text-smoke",children:d("notes.hint")}),(0,s.jsxs)("div",{className:"mb-4 flex flex-wrap gap-x-4 gap-y-1 font-mono text-[11px] text-smoke",children:[(0,s.jsx)("span",{children:d("notes.awakeBudget",{used:o.used,budget:o.budget})}),(0,s.jsx)("span",{children:d("notes.scopedBudget",{used:o.sleeping,budget:o.sleepingMax})}),(0,s.jsx)("span",{children:d("notes.pendingBudget",{used:o.pending,budget:o.pendingMax})})]}),c.pending+c.running+c.deferred+c.failed+c.complete>0&&(0,s.jsxs)("details",{className:"mb-4 rounded border border-edge p-3 text-xs text-smoke",children:[(0,s.jsx)("summary",{className:"cursor-pointer",children:d("notes.extraction")}),(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap gap-x-4 gap-y-1",children:[(0,s.jsx)("span",{children:d("notes.jobsPending",{n:c.pending+c.running})}),(0,s.jsx)("span",{children:d("notes.jobsDeferred",{n:c.deferred})}),(0,s.jsx)("span",{children:d("notes.jobsFailed",{n:c.failed})})]}),(0,s.jsx)("p",{className:"mt-2 leading-relaxed",children:d("notes.jobsHint")}),c.coverage&&(0,s.jsx)("p",{className:"mt-2 leading-relaxed",children:d("notes.coverage",{selected:c.coverage.selected,total:c.coverage.total,omitted:c.coverage.omitted,clipped:c.coverage.clipped})})]}),(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault();let t=u.trim();t&&O({action:"add",body:t,...p?{where:h.trim()}:{}})},className:"space-y-2",children:[(0,s.jsx)(r.fs,{rows:3,size:"sm",disabled:A,value:u,onChange:e=>m(e.target.value),maxLength:500,placeholder:d("notes.addPlaceholder"),label:d("notes.title"),hideLabel:!0}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("label",{id:"memory-scope-label",htmlFor:"memory-scope",className:"text-xs text-smoke",children:d("notes.scope")}),(0,s.jsxs)("select",{id:"memory-scope","aria-labelledby":"memory-scope-label",disabled:A,value:p?"path":"all",onChange:e=>x("path"===e.target.value),className:"rounded border border-edge bg-raised px-2 py-1.5 text-xs text-chalk",children:[(0,s.jsx)("option",{value:"all",children:d("notes.scopeAll")}),(0,s.jsx)("option",{value:"path",children:d("notes.scopePath")})]}),(0,s.jsx)(r.rA,{tone:"raised",type:"submit",busy:f,disabled:A||!u.trim()||p&&!h.trim(),children:d("notes.add")})]}),p&&(0,s.jsxs)("div",{children:[(0,s.jsx)(r.D0,{disabled:A,value:h,onChange:e=>j(e.target.value),maxLength:120,label:d("notes.where"),hideLabel:!0,size:"sm","aria-describedby":"memory-path-hint",placeholder:"src/**",className:"font-mono"}),(0,s.jsx)("p",{id:"memory-path-hint",className:"mt-1 text-xs leading-relaxed text-smoke",children:d("notes.whereHint")})]})]}),v&&(0,s.jsx)(r.lZ,{text:v,className:"mt-2"}),0===C.length&&0===T.length&&0===P.length&&(0,s.jsx)("p",{className:"mt-3 text-xs text-faint",children:d("notes.empty")}),[!1,!0].map(e=>{let t=C.filter(t=>!!t.trigger===e);return 0===t.length?null:(0,s.jsxs)("div",{className:"mt-4 border-t border-edge pt-3",children:[(0,s.jsx)("h3",{className:"eyebrow mb-2",children:d(e?"notes.scoped":"notes.always")}),(0,s.jsx)("ul",{className:"space-y-3",children:t.map(e=>(0,s.jsxs)("li",{className:"text-xs",children:[(0,s.jsx)("p",{className:"break-words leading-relaxed text-chalk",children:e.body}),(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1",children:[e.trigger&&(0,s.jsx)("code",{className:"break-all text-smoke",children:e.trigger}),(0,s.jsx)("span",{className:"text-smoke",children:e.createdBy}),(0,s.jsx)("span",{className:"text-smoke",children:e.anchors?d("notes.anchors",{n:e.anchors}):d("notes.noAnchors")}),(0,s.jsx)(r.rA,{tone:"plain",busy:b===e.id,disabled:A,onClick:()=>void O({action:"discard",id:e.id},e.id),children:d("notes.discard")})]})]},e.id))})]},String(e))}),P.length>0&&(0,s.jsxs)("div",{className:"mt-3 border-t border-edge pt-3",children:[(0,s.jsx)("h3",{className:"eyebrow mb-2",children:d("notes.challengedTitle")}),(0,s.jsx)("p",{className:"mb-3 text-xs leading-relaxed text-smoke",children:d("notes.challengeHint")}),(0,s.jsx)("ul",{className:"space-y-1.5",children:P.map(e=>{var t,n,a,l,i;return(0,s.jsxs)("li",{className:"flex flex-wrap items-baseline gap-2 text-xs",children:[(0,s.jsx)("span",{className:"w-full break-words leading-relaxed text-chalk",children:e.body}),(0,s.jsx)("span",{className:"min-w-0 break-all font-mono text-[11px] text-smoke",children:d("notes.challengedEvidence",{target:null!=(l=null==(n=e.challenge)||null==(t=n.sentinel)?void 0:t.target)?l:"?",observed:null!=(i=null==(a=e.challenge)?void 0:a.observed)?i:"?"})}),(0,s.jsx)(r.rA,{tone:"raised",busy:b===e.id,disabled:A,onClick:()=>void O({action:"approve",id:e.id},e.id),children:d("notes.reapprove")}),(0,s.jsx)(r.rA,{tone:"plain",busy:b===e.id,disabled:A,onClick:()=>void O({action:"discard",id:e.id},e.id),children:d("notes.discard")})]},e.id)})})]}),T.length>0&&(0,s.jsxs)("div",{className:"mt-3 border-t border-edge pt-3",children:[(0,s.jsx)("h3",{className:"eyebrow mb-2",children:d("notes.pendingTitle")}),(0,s.jsx)("p",{className:"mb-3 text-xs text-smoke",children:d("notes.reviewFirst")}),(0,s.jsx)("ul",{className:"space-y-1.5",children:T.map(e=>(0,s.jsxs)("li",{className:"flex flex-wrap items-baseline gap-2 text-xs",children:[(0,s.jsx)("span",{className:"w-full break-words leading-relaxed text-chalk",children:e.body}),(0,s.jsxs)("span",{className:"min-w-0 break-all font-mono text-[11px] text-smoke",children:[e.trigger?"".concat(d("notes.sleepsAt",{trigger:e.trigger})," \xb7 "):"",d("notes.proposedBy",{agent:e.createdBy})]}),(0,s.jsx)(r.rA,{tone:"raised",busy:b===e.id,disabled:A,onClick:()=>void O({action:"approve",id:e.id},e.id),children:d("notes.approve")}),(0,s.jsx)(r.rA,{tone:"plain",busy:b===e.id,disabled:A,onClick:()=>void O({action:"discard",id:e.id},e.id),children:d("notes.discard")})]},e.id))})]})]})}},79296:(e,t,n)=>{"use strict";n.d(t,{ProjectAccounts:()=>g,ProjectAccountsQuick:()=>f});var s=n(38657),a=n(32165),l=n(10354),i=n(3043),r=n(54574);function o(e){return e.length>0?e:[{label:""}]}var c=n(35261),d=n(9144),u=n(19014),m=n(52948);let p="panoma:accounts",x={urls:[],labels:[]};function h(e){let{url:t,label:n}=e,[l,i]=(0,a.useState)(!1),r=(()=>{try{return t?new URL(t).origin:void 0}catch(e){return}})();if(!r||l){var o;return(0,s.jsx)("span",{className:"project-account-chip","aria-hidden":!0,children:(null!=(o=n.trim()[0])?o:"\xb7").toUpperCase()})}return(0,s.jsx)("img",{className:"project-account-favicon",src:"".concat(r,"/favicon.ico"),alt:"",width:16,height:16,loading:"lazy",onError:()=>i(!0)})}function j(e){let{entry:t}=e,n=(0,d.kj)(),{copied:a,copy:l}=(0,u.K)();return(0,s.jsxs)("li",{className:"project-account-row",children:[(0,s.jsx)(h,{url:t.url,label:t.label}),(0,s.jsxs)("div",{className:"project-account-body",children:[(0,s.jsx)("strong",{children:t.label}),t.url&&(0,s.jsxs)("span",{className:"project-account-line",children:[(0,s.jsx)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:function(e){try{return new URL(e).host}catch(t){return e}}(t.url)}),(0,s.jsx)("button",{type:"button",onClick:()=>l(t.url),title:t.url,children:a?n("accounts.copied"):"⧉"})]}),t.email&&(0,s.jsxs)("span",{className:"project-account-line",children:[(0,s.jsx)("code",{children:t.email}),(0,s.jsx)("button",{type:"button",onClick:()=>l(t.email),children:a?n("accounts.copied"):"⧉"})]}),t.note&&(0,s.jsx)("span",{className:"project-accounts-note",children:t.note})]})]})}function f(e){let{entries:t}=e,n=(0,d.kj)();return(0,s.jsxs)("div",{className:"project-accounts",children:[0===t.length?(0,s.jsx)("p",{className:"project-muted-message",children:n("accounts.empty")}):(0,s.jsx)("ul",{className:"project-accounts-list",children:t.slice(0,6).map((e,t)=>(0,s.jsx)(j,{entry:e},"".concat(e.label,":").concat(t)))}),(0,s.jsxs)("a",{className:"project-accounts-go",href:"#accounts",onClick:()=>window.dispatchEvent(new CustomEvent(p)),children:[(0,s.jsx)(i.YUE,{className:"h-3.5 w-3.5","aria-hidden":!0}),n(0===t.length?"accounts.addFirst":"accounts.editList")]})]})}function g(e){let{slug:t,initial:n}=e,u=(0,d.kj)(),h=(0,l.useRouter)(),[f,g]=(0,a.useState)(!1),[b,y]=(0,a.useState)(n),[v,k]=(0,a.useState)("ready"),[N,w]=(0,a.useState)(null),[S,C]=(0,a.useState)(x),T=(0,a.useRef)(null),P=(0,a.useCallback)(()=>{y(o),g(!0)},[]);function A(e,t,n){y(s=>s.map((s,a)=>a===e?{...s,[t]:n}:s)),C(n=>(function(e,t,n){if("label"!==n&&"url"!==n)return e;let s="label"===n?"labels":"urls";return e[s].includes(t)?{...e,[s]:e[s].filter(e=>e!==t)}:e})(n,e,t))}async function O(){let e=function(e){let t=[],n=[];return e.forEach((e,s)=>{"unusable"===(0,r.C)(e.url).kind&&t.push(s),[e.url,e.email,e.note].some(e=>null==e?void 0:e.trim())&&!e.label.trim()&&n.push(s)}),{urls:t,labels:n}}(b);if(C(e),e.urls.length>0||e.labels.length>0)return void w(null);k("saving"),w(null);let n=b.filter(e=>e.label.trim()).map(e=>{let t=(0,r.C)(e.url);return{...e,url:"url"===t.kind?t.url:void 0}}),s=await (0,c.B)("/api/accounts",{slug:t,accounts:n},u("project.unreachable"));s.ok?(y(n),g(!1),h.refresh()):w(s.message),k("ready")}return((0,a.useEffect)(()=>(window.addEventListener(p,P),()=>window.removeEventListener(p,P)),[P]),(0,a.useEffect)(()=>{if(!f)return;let e=setTimeout(()=>{var e;return null==(e=T.current)?void 0:e.focus()},0);return()=>clearTimeout(e)},[f]),f)?(0,s.jsx)("div",{className:"project-accounts project-accounts--full",children:(0,s.jsxs)("div",{className:"project-accounts-form",children:[b.map((e,t)=>{var n,a,l;return(0,s.jsxs)("div",{className:"project-accounts-row",children:[(0,s.jsx)("input",{ref:0===t?T:void 0,value:e.label,onChange:e=>A(t,"label",e.target.value),placeholder:u("accounts.label"),maxLength:80,"aria-invalid":S.labels.includes(t)||void 0}),(0,s.jsx)("input",{value:null!=(n=e.url)?n:"",onChange:e=>A(t,"url",e.target.value),placeholder:"vercel.com/… \xb7 localhost:3000",maxLength:300,"aria-invalid":S.urls.includes(t)||void 0}),(0,s.jsx)("input",{value:null!=(a=e.email)?a:"",onChange:e=>A(t,"email",e.target.value),placeholder:u("accounts.email"),maxLength:120}),(0,s.jsx)("input",{value:null!=(l=e.note)?l:"",onChange:e=>A(t,"note",e.target.value),placeholder:u("accounts.note"),maxLength:300}),(0,s.jsx)("button",{type:"button",onClick:()=>y(e=>e.filter((e,n)=>n!==t)),"aria-label":u("accounts.remove"),className:"text-faint transition-colors hover:text-fail",children:"\xd7"})]},t)}),(0,s.jsxs)("div",{className:"project-accounts-actions",children:[(0,s.jsx)(m.rA,{tone:"surface",size:"sm",type:"button",onClick:()=>y(e=>[...e,{label:""}]),disabled:b.length>=24,children:u("accounts.addRow")}),(0,s.jsx)(m.rA,{tone:"accent",size:"sm",type:"button",onClick:O,busy:"saving"===v,busyLabel:u("accounts.saving"),children:u("accounts.save")}),(0,s.jsx)(m.rA,{tone:"quiet",size:"sm",type:"button",onClick:()=>{y(n),C(x),w(null),g(!1)},children:u("accounts.cancel")})]}),(0,s.jsxs)("p",{className:"project-accounts-warning",children:[(0,s.jsx)(i.JPZ,{className:"h-3.5 w-3.5","aria-hidden":!0}),u("accounts.noSecrets")]}),S.urls.length>0&&(0,s.jsx)(m.lZ,{text:u("accounts.badUrl")}),S.labels.length>0&&(0,s.jsx)(m.lZ,{text:u("accounts.needsLabel")}),N&&(0,s.jsx)(m.lZ,{text:N})]})}):(0,s.jsxs)("div",{className:"project-accounts project-accounts--full",children:[0===b.length?(0,s.jsx)("p",{className:"project-muted-message",children:u("accounts.empty")}):(0,s.jsx)("ul",{className:"project-accounts-list",children:b.map((e,t)=>(0,s.jsx)(j,{entry:e},"".concat(e.label,":").concat(t)))}),(0,s.jsxs)(m.rA,{tone:"surface",size:"sm",type:"button",className:"mt-3",onClick:P,children:[(0,s.jsx)(i.YUE,{className:"h-3.5 w-3.5","aria-hidden":!0}),u(0===b.length?"accounts.addFirst":"accounts.edit")]})]})}},84549:(e,t,n)=>{"use strict";n.d(t,{UnusedAssets:()=>o});var s=n(38657),a=n(32165),l=n(9144),i=n(98194),r=n(52948);function o(e){let{projectId:t}=e,n=(0,l.kj)(),[o,c]=(0,a.useState)("ready"),[d,u]=(0,a.useState)(null),[m,p]=(0,a.useState)(null);async function x(){c("searching"),p(null);try{var e;let s=await fetch("/api/assets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:t})}),a=await s.json();s.ok?u(a):p(null!=(e=a.error)?e:n("project.assetsFailed"))}catch(e){p(n("project.unreachable"))}finally{c("ready")}}return d?(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-mono text-[11px] text-faint",children:n("project.assetsStats",{n:d.analyzed,platform:d.skippedPlatform,sources:d.sourcesRead})}),0===d.unused.length?(0,s.jsx)(r.pp,{className:"mt-3",title:n("project.assetsAllUsed")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"mt-3 font-display text-2xl font-semibold",children:[n("project.assetsUnused",{n:d.unused.length})," ",(0,s.jsx)("span",{className:"font-mono text-sm font-normal text-faint",children:(0,i.z)(d.unusedBytes)})]}),(0,s.jsx)("ul",{className:"mt-3 space-y-0.5",children:d.unused.map(e=>(0,s.jsxs)("li",{className:"flex items-baseline justify-between gap-3 border-b border-edge/50 py-1.5 font-mono text-xs",children:[(0,s.jsx)("span",{className:"truncate text-smoke",title:e.reason,children:e.path}),(0,s.jsx)("span",{className:"shrink-0 text-faint",children:(0,i.z)(e.bytes)})]},e.path))})]}),d.dynamicDirs.length>0&&(0,s.jsx)(r.Zp,{pad:"sm",className:"mt-4 font-mono text-[11px] text-smoke",children:n("project.assetsDynamic",{dirs:d.dynamicDirs.join(", ")})}),(0,s.jsx)("p",{className:"mt-3 font-mono text-[11px] text-faint",children:n("project.assetsCaveat")})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)(r.rA,{tone:"surface",type:"button",onClick:x,busy:"searching"===o,busyLabel:n("project.assetsReading"),children:n("project.assetsSearch")}),m&&(0,s.jsx)(r.lZ,{text:m,className:"mt-2"}),(0,s.jsx)("p",{className:"mt-2 font-mono text-[11px] text-faint",children:n("project.assetsSlow")})]})}},90344:(e,t,n)=>{"use strict";n.d(t,{Resume:()=>g});var s=n(38657),a=n(32165),l=n(14262),i=n(3953),r=n.n(i),o=n(3043),c=n(80914),d=n(50178),u=n(79126),m=n(9144),p=n(52948);function x(e){let{conversations:t,slug:n}=e,a=(0,m.kj)(),l=(0,m.Ym)(),i="/handoff?project=".concat(encodeURIComponent(n));return(0,s.jsxs)(p.Zp,{as:"section","aria-labelledby":"project-conversations-title",children:[(0,s.jsx)("h3",{id:"project-conversations-title",className:"eyebrow mb-1",children:a("project.conversations")}),(0,s.jsx)("p",{className:"mb-2.5 text-xs leading-relaxed text-smoke",children:a("project.conversationsLead")}),0===t.length?(0,s.jsx)(p.pp,{variant:"note",title:a("project.noConversations")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("ul",{className:"space-y-1.5",children:t.map(e=>{var t,n,m;let p=null!=(t=u.L[(0,c.$e)(e.agent,e.surface)])?t:o.tZt;return(0,s.jsxs)("li",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-0.5 text-xs",children:[(0,s.jsx)(p,{"aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 text-smoke"}),(0,s.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-faint",children:(0,c.en)(e.agent,e.surface)}),(0,s.jsx)(r(),{href:i,className:"min-w-0 max-w-full flex-1 basis-40 truncate text-chalk hover:underline",title:null!=(n=e.title)?n:e.handle,children:null!=(m=e.title)?m:e.handle}),(0,s.jsxs)("span",{className:"font-mono text-[10px] text-faint",children:[null===e.turnCount?a("handoff.size",{size:(0,c.lP)(e.bytes)}):a("handoff.turns",{n:e.turnCount})," \xb7 ",(0,d.P)(e.updatedAt,l)]})]},e.id)})}),(0,s.jsx)(r(),{href:i,className:"mt-2.5 inline-block font-mono text-[11px] text-accent hover:underline",children:a("handoff.projectMore")})]})]})}var h=n(20441);let j=["install","start","tests","build"],f={install:"purpose.install",start:"purpose.start",tests:"purpose.tests",build:"purpose.build"};function g(e){let{runbook:t,recentCommits:n,root:i,shell:r,conversations:o,slug:c}=e,d=(0,m.kj)(),u=(0,m.Ym)(),[g,y]=(0,a.useState)(null);(0,a.useEffect)(()=>{0!==t.runtimes.length&&fetch("/api/environment").then(e=>e.json()).then(e=>y(e.tools)).catch(()=>y({}))},[t.runtimes.length]);let v=[...t.commands].sort((e,t)=>j.indexOf(e.purpose)-j.indexOf(t.purpose)),k=function(e){let t=e[0];if(!t)return[];let n=new Date(t.at).getTime()-864e5,s=e.filter(e=>new Date(e.at).getTime()>=n);return(s.length>=3?s:e.slice(0,3)).slice(0,5)}(n);return(0,s.jsxs)("div",{className:"grid gap-5 md:grid-cols-2",children:[k.length>0&&(0,s.jsx)(b,{title:d("project.lastYouDid"),children:(0,s.jsx)("ul",{className:"space-y-1",children:k.map(e=>(0,s.jsxs)("li",{className:"flex gap-2.5 text-xs leading-relaxed",children:[(0,s.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-faint",children:e.sha.slice(0,7)}),(0,s.jsx)("span",{className:"min-w-0 flex-1 text-smoke",children:e.subject}),e.agent&&(0,s.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-accent",title:d("changes.signedBy",{agent:e.agent}),children:e.agent})]},e.sha))})}),v.length>0&&(0,s.jsx)(b,{title:d("project.howToStart"),children:(0,s.jsx)("ul",{className:"space-y-1.5",children:v.map(e=>(0,s.jsxs)("li",{className:"flex flex-wrap items-baseline gap-2",children:[(0,s.jsx)("span",{className:"w-16 shrink-0 font-mono text-[10px] text-faint",children:d(f[e.purpose])}),(0,s.jsx)(l.CopyCommand,{command:(0,h._z)(i,e.command,r),label:e.command,locale:u}),(0,s.jsx)("span",{className:"min-w-0 truncate font-mono text-[10px] text-faint",title:e.source,children:e.source})]},e.command))})}),t.runtimes.length>0&&(0,s.jsx)(b,{title:d("project.whatItNeeds"),children:(0,s.jsx)("ul",{className:"space-y-1.5",children:t.runtimes.map(e=>{var t,n;let a=null!=(n=null==g||null==(t=g[e.id])?void 0:t.version)?n:null;return(0,s.jsxs)("li",{className:"flex flex-wrap items-baseline gap-x-2.5 gap-y-1 font-mono text-[11px]",children:[(0,s.jsx)("span",{className:"text-chalk",children:e.name}),(0,s.jsx)("span",{className:"text-smoke",children:e.required}),null===g?(0,s.jsx)("span",{className:"text-faint",children:d("project.runtimeChecking")}):a?(0,s.jsx)("span",{className:"text-live",children:d("project.runtimeHave",{version:a})}):(0,s.jsx)("span",{className:"text-idle",children:d("project.runtimeMissing")}),(0,s.jsx)("span",{className:"text-faint",children:e.source})]},"".concat(e.id,"-").concat(e.required))})})}),null!==o&&(0,s.jsx)(x,{conversations:o,slug:c}),t.missingEnv.length>0&&(0,s.jsxs)(b,{title:d("project.missingEnv",{n:t.missingEnv.length}),children:[(0,s.jsxs)("p",{className:"mb-2 text-xs leading-relaxed text-smoke",children:[d("project.envDeclaredIn")," ",(0,s.jsx)("code",{className:"font-mono text-chalk",children:t.envExample})," ",d("project.envNoValue")," ",(0,s.jsx)("code",{className:"font-mono text-chalk",children:".env"}),". ",d("project.envWhy")]}),(0,s.jsx)("ul",{className:"flex flex-wrap gap-1.5",children:t.missingEnv.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(p.vw,{children:e})},e))})]})]})}function b(e){let{title:t,children:n}=e;return(0,s.jsxs)(p.Zp,{as:"section",children:[(0,s.jsx)("h3",{className:"eyebrow mb-2.5",children:t}),n]})}},93489:(e,t,n)=>{"use strict";n.d(t,{MdRepair:()=>c});var s=n(38657),a=n(32165),l=n(10354),i=n(35261),r=n(9144),o=n(52948);function c(e){let{slug:t,path:n,fixable:c,onDone:d}=e,u=(0,r.kj)(),m=(0,l.useRouter)(),[p,x]=(0,a.useState)("ready"),[h,j]=(0,a.useState)(null),[f,g]=(0,a.useState)(null);async function b(){x("working"),g(null);let e=await (0,i.B)("/api/md/repair",{slug:t,...n?{path:n}:{}},u("project.unreachable"));if(e.ok){var s,a;let t=null!=(s=e.data.applied)?s:0,n=null!=(a=e.data.remaining)?a:0;j(0===n?u("project.mdRepairDoneAll",{n:t}):u("project.mdRepairDone",{n:t,m:n})),d?setTimeout(d,1800):setTimeout(()=>m.refresh(),2200)}else g(e.message);x("ready")}return(0,s.jsxs)("span",{className:"project-md-repair",children:[(0,s.jsx)(o.rA,{tone:"accent",size:"sm",type:"button",onClick:b,busy:"working"===p,busyLabel:u("project.mdRepairWorking"),children:u("project.mdRepairButton",{n:c})}),h&&(0,s.jsx)("span",{className:"ml-2 text-xs text-live",children:h}),f&&(0,s.jsx)(o.lZ,{as:"span",text:f,className:"ml-2"})]})}}},e=>{e.O(0,[6587,3052,2583,3953,1774,2575,2948,1369,2202,4189,1305,6823,7358],()=>e(e.s=20266)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[664],{12991:(e,t,n)=>{"use strict";n.d(t,{OpenFolder:()=>c});var s=n(38657),a=n(32165),l=n(3043),i=n(2575),r=n(91635);let o={folder:{idle:"open.folder",busy:"open.busy",done:"open.doneFolder"},editor:{idle:"open.editor",busy:"open.busy",done:"open.done"},terminal:{idle:"open.terminal",busy:"open.busy",done:"open.done"}};function c(e){let{projectId:t,path:n,tool:c="folder",appearance:d="inline",locale:u}=e,[m,p]=(0,a.useState)("ready"),[x,h]=(0,a.useState)(null);async function j(){p("opening"),h(null);let e=await (0,r.A)({id:t,tool:c},(0,i.t)(u,"open.unreachable"));e.ok?(p("open"),setTimeout(()=>p("ready"),2e3)):(p("ready"),h(e.message))}let f=o[c],g=(0,i.t)(u,f.idle),b="editor"===c?l.KQe:"terminal"===c?l.Jhl:l.mUU;return(0,s.jsxs)("span",{className:"open-project-action open-project-action--".concat(d),children:[(0,s.jsxs)("button",{type:"button",onClick:j,disabled:"opening"===m,title:"".concat(g," \xb7 ").concat(n),children:[(0,s.jsx)(b,{"aria-hidden":!0}),"opening"===m?(0,i.t)(u,f.busy):"open"===m?(0,i.t)(u,f.done):g]}),x&&(0,s.jsx)("span",{className:"open-project-action__error",children:x})]})}},14847:(e,t,n)=>{"use strict";n.d(t,{ProjectActionBar:()=>y});var s=n(38657),a=n(10354),l=n(32165),i=n(3043),r=n(3953),o=n.n(r),c=n(67112),d=n(97234),u=n(9144),m=n(52302);function p(e){let{slug:t,ready:n}=e,a=(0,u.kj)(),[r,c]=(0,l.useState)(!1);return n?(0,s.jsxs)(o(),{className:"create-video",href:(0,d.Ej)(t,!0),children:[(0,s.jsx)(i.UW0,{"aria-hidden":!0}),a("apps.createVideo")]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",className:"create-video",onClick:()=>c(!0),children:[(0,s.jsx)(i.UW0,{"aria-hidden":!0}),a("apps.createVideo")]}),r&&(0,s.jsx)(x,{slug:t,onClose:()=>c(!1)})]})}function x(e){let{slug:t,onClose:n}=e,a=(0,u.kj)(),i=(0,l.useRef)(null),r=(0,l.useRef)(!1);(0,m.r)(i,!0),(0,l.useEffect)(()=>{requestAnimationFrame(()=>{var e;return null==(e=i.current)?void 0:e.focus()})},[]);let p=(0,l.useRef)(n);return(0,l.useEffect)(()=>{p.current=n}),(0,l.useEffect)(()=>{let e=e=>{"Escape"===e.key&&p.current()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),(0,c.createPortal)((0,s.jsx)("div",{className:"palette-backdrop",role:"presentation",onPointerDown:e=>{r.current=e.target===e.currentTarget},onClick:e=>{r.current&&e.target===e.currentTarget&&n()},children:(0,s.jsxs)("div",{ref:i,className:"app-invite",role:"dialog","aria-modal":"true","aria-labelledby":"video-gate-title",tabIndex:-1,children:[(0,s.jsxs)("div",{className:"app-invite__head",children:[(0,s.jsx)("p",{className:"eyebrow",children:a("apps.official")}),(0,s.jsx)("h2",{id:"video-gate-title",children:a("apps.videoGateTitle")})]}),(0,s.jsx)("p",{children:a("apps.videoGateBody")}),(0,s.jsx)("p",{children:a("apps.needsSetup")}),(0,s.jsxs)("div",{className:"app-invite__actions",children:[(0,s.jsx)("button",{type:"button",onClick:n,children:a("apps.cancel")}),(0,s.jsx)(o(),{className:"is-primary",href:(0,d.Ej)(t,!1),children:a("apps.videoGateGo")})]})]})}),document.body)}var h=n(5483),j=n(65330);function f(e){let{projectId:t,name:n,hidden:r,redirectTo:o,appearance:c="inline"}=e,d=(0,u.kj)(),m=(0,a.useRouter)(),[p,x]=(0,l.useState)(!1),[h,j]=(0,l.useState)(!1),[f,b]=(0,l.useState)(null);async function y(e,n){x(!0),b(null);try{let a=await fetch("/api/project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,id:t,confirmation:n})}),l=await a.json();if(a.ok)m.refresh();else{var s;b(null!=(s=l.error)?s:d("project.actionFailed"))}}catch(e){b(d("project.unreachable"))}finally{x(!1)}}return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{className:"menu"===c?"project-menu-actions":"inline-flex flex-wrap items-baseline gap-2",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>y(r?"mostrar":"ocultar"),disabled:p,title:d(r?"project.showTitle":"project.hideTitle"),className:"menu"===c?"project-menu-item":"inline-flex items-center gap-1.5 rounded border border-edge px-2 py-0.5 font-mono text-[11px] text-smoke transition-colors hover:border-accent hover:text-accent disabled:opacity-50",children:[r?(0,s.jsx)(i.bZk,{className:"h-3.5 w-3.5","aria-hidden":!0}):(0,s.jsx)(i.EgV,{className:"h-3.5 w-3.5","aria-hidden":!0}),d(r?"project.show":"project.hide")]}),(0,s.jsxs)("button",{type:"button",onClick:()=>j(!0),disabled:p,title:d("project.removeTitle"),className:"menu"===c?"project-menu-item project-menu-item--danger":"inline-flex items-center gap-1.5 rounded border border-edge px-2 py-0.5 font-mono text-[11px] text-smoke transition-colors hover:border-fail hover:text-fail disabled:opacity-50",children:[(0,s.jsx)(i.yRo,{className:"h-3.5 w-3.5","aria-hidden":!0}),d("project.remove")]}),f&&(0,s.jsx)("span",{className:"menu"===c?"project-menu-error":"font-mono text-[11px] text-fail",children:f})]}),h&&(0,s.jsx)(g,{name:n,busy:p,onCancel:()=>j(!1),onConfirm:async e=>{x(!0),b(null);try{let s=await fetch("/api/project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"excluir",id:t,confirmation:e})}),a=await s.json();if(s.ok)j(!1),o?m.push(o):m.refresh();else{var n;b(null!=(n=a.error)?n:d("project.actionFailed")),j(!1)}}catch(e){b(d("project.unreachable")),j(!1)}finally{x(!1)}}})]})}function g(e){let{name:t,busy:n,onCancel:a,onConfirm:i}=e,r=(0,u.kj)(),[o,d]=(0,l.useState)(""),p=(0,l.useRef)(null),x=(0,l.useRef)(null),h=o.trim()===t;return(0,m.r)(x,!0),(0,l.useEffect)(()=>{requestAnimationFrame(()=>{var e;return null==(e=p.current)?void 0:e.focus()});let e=e=>{"Escape"===e.key&&a()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[a]),(0,c.createPortal)((0,s.jsx)("div",{className:"palette-backdrop",role:"presentation",onClick:e=>{e.target===e.currentTarget&&a()},children:(0,s.jsxs)("form",{ref:x,className:"confirm-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"confirm-title",onSubmit:e=>{e.preventDefault(),h&&!n&&i(o.trim())},children:[(0,s.jsx)("h2",{id:"confirm-title",children:r("project.removeHeading",{name:t})}),(0,s.jsx)("p",{children:r("project.removeBody")}),(0,s.jsxs)("p",{className:"confirm-dialog__safe",children:[(0,s.jsx)("strong",{children:r("project.removeSafeStrong")})," ",r("project.removeSafeBody")]}),(0,s.jsxs)("label",{children:[(0,s.jsxs)("span",{children:[r("project.removeTypeBefore")," ",(0,s.jsx)("code",{children:t})," ",r("project.removeTypeAfter")]}),(0,s.jsx)("input",{ref:p,value:o,onChange:e=>d(e.target.value),autoComplete:"off",spellCheck:!1,"aria-label":r("project.removeTypeAria",{name:t})})]}),(0,s.jsxs)("div",{className:"confirm-dialog__actions",children:[(0,s.jsx)("button",{type:"button",onClick:a,disabled:n,children:r("project.cancel")}),(0,s.jsx)("button",{type:"submit",disabled:!h||n,className:"is-danger",children:r(n?"project.removing":"project.removeConfirm")})]})]})}),document.body)}var b=n(1810);function y(e){let{projectId:t,projectName:n,slug:r,path:o,hidden:c,videoReady:d}=e,m=(0,u.kj)(),x=(0,u.Ym)(),g=(0,a.useRouter)(),y=(0,l.useRef)(null),[v,k]=(0,l.useState)(!1),[N,w]=(0,l.useState)(null),[S,C]=(0,l.useState)("ok"),[T,P]=(0,l.useState)(!1),[A,O]=(0,l.useState)(0);async function R(){try{await navigator.clipboard.writeText(o),C("ok"),w(m("project.pathCopied")),setTimeout(()=>w(null),1800)}catch(e){C("error"),w(m("project.pathCopyFailed"))}}async function E(){P(!0),w(null);try{let n=await fetch("/api/rescan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:t})}),s=await n.json();if(!n.ok||!s.ok){var e;throw Error(null!=(e=s.error)?e:m("project.rescanFailed"))}C("ok"),w(m("project.rescanned")),g.refresh()}catch(e){C("error"),w(e.message)}finally{P(!1)}}return(0,b.y)(y,v,()=>k(!1)),(0,s.jsxs)("div",{className:"project-action-bar",ref:y,children:[(0,s.jsxs)("div",{className:"project-action-bar__primary",children:[(0,s.jsx)(h.w,{projectId:t,projectName:n,configureSignal:A}),(0,s.jsx)(p,{slug:r,ready:d}),(0,s.jsx)(j.q,{projectId:t,path:o,locale:x,closed:v,onOpenChange:e=>e&&k(!1)}),(0,s.jsx)("button",{type:"button",className:"project-more-button","aria-label":m("project.moreActions"),"aria-expanded":v,"aria-haspopup":"menu",onClick:()=>k(e=>!e),children:(0,s.jsx)(i.zMq,{"aria-hidden":!0})})]}),v&&(0,s.jsxs)("div",{className:"project-overflow-menu",role:"menu",children:[(0,s.jsxs)("button",{type:"button",role:"menuitem",className:"project-menu-item",onClick:R,children:[(0,s.jsx)(i.hru,{"aria-hidden":!0}),m("project.copyPath")]}),(0,s.jsxs)("button",{type:"button",role:"menuitem",className:"project-menu-item",onClick:E,disabled:T,children:[(0,s.jsx)(i.efr,{"aria-hidden":!0,className:T?"is-spinning":void 0}),m(T?"project.rescanning":"project.rescan")]}),(0,s.jsxs)("button",{type:"button",role:"menuitem",className:"project-menu-item",onClick:()=>{k(!1),O(e=>e+1)},children:[(0,s.jsx)(i.x5m,{"aria-hidden":!0}),m("openAll.configure")]}),N&&(0,s.jsxs)("p",{className:"project-menu-notice project-menu-notice--".concat(S),role:"status",children:["ok"===S?(0,s.jsx)(i.mmf,{"aria-hidden":!0}):(0,s.jsx)(i.f9d,{"aria-hidden":!0}),N]}),(0,s.jsx)("div",{className:"project-menu-divider"}),(0,s.jsx)(f,{projectId:t,name:n,hidden:c,redirectTo:"/",appearance:"menu"})]})]})}},17023:(e,t,n)=>{"use strict";n.d(t,{CaptureTask:()=>m});var s=n(38657),a=n(32165),l=n(10354);let i=["open","in-progress"];var r=n(2575),o=n(52948);let c={open:"strong","in-progress":"accent",done:"live",discarded:"quiet"};function d(e){var t,n;let{status:a,locale:l}=e;return(0,s.jsx)(o.vw,{tone:null!=(t=c[a])?t:c.open,title:a,children:null!=(n=(0,r.t)(l,"taskState.".concat(a)))?n:a})}var u=n(9144);function m(e){let{slug:t,tasks:n}=e,r=(0,u.kj)(),c=(0,u.Ym)(),[m,p]=(0,a.useState)(""),[x,h]=(0,a.useState)(!1),[j,f]=(0,a.useState)(null),[g,b]=(0,a.useTransition)(),y=(0,l.useRouter)(),v=n.filter(e=>i.includes(e.status)),k=x||g;async function N(e){e.preventDefault();let n=m.trim();if(n&&!k){h(!0),f(null);try{let e=await fetch("/api/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t,title:n})}),a=await e.json().catch(()=>({}));if(e.ok)p(""),b(()=>y.refresh());else{var s;f(null!=(s=a.error)?s:r("task.saveFailed"))}}catch(e){f(r("task.unreachable"))}finally{h(!1)}}}return(0,s.jsxs)("section",{className:"rounded-lg border border-edge bg-surface p-4",children:[(0,s.jsxs)("div",{className:"mb-2.5 flex items-baseline justify-between gap-3",children:[(0,s.jsx)("h3",{className:"eyebrow",children:r("task.title")}),v.length>0&&(0,s.jsx)("span",{className:"font-mono text-[10px] text-faint",children:r(1===v.length?"task.openOne":"task.openMany",{n:v.length})})]}),(0,s.jsxs)("form",{onSubmit:N,className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)(o.D0,{label:r("task.fieldLabel"),hideLabel:!0,size:"sm",className:"min-w-0 flex-1",value:m,onChange:e=>p(e.target.value),maxLength:160,placeholder:r("task.placeholder")}),(0,s.jsx)(o.rA,{tone:"raised",type:"submit",busy:x,busyLabel:r("task.saving"),disabled:k||!m.trim(),children:r("task.save")})]}),(0,s.jsx)("p",{className:"mt-2 font-mono text-[11px] leading-relaxed text-faint",children:r("task.mcpNote")}),j&&(0,s.jsx)(o.lZ,{text:j,className:"mt-2"}),v.length>0&&(0,s.jsx)("ul",{className:"mt-3 space-y-1.5 border-t border-edge pt-3",children:v.map(e=>{var t;return(0,s.jsxs)("li",{className:"flex flex-wrap items-baseline gap-2 text-xs",children:[(0,s.jsx)(d,{status:e.status,locale:c}),(0,s.jsx)("span",{className:"min-w-0 flex-1 leading-relaxed text-smoke",children:e.title}),(0,s.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-faint",children:null!=(t=e.agentName)?t:"human"===e.createdBy?r("task.byHuman"):e.createdBy})]},e.id)})})]})}},20682:(e,t,n)=>{"use strict";n.d(t,{MdInspect:()=>o});var s=n(38657),a=n(32165),l=n(9144),i=n(93489),r=n(52948);function o(e){let{slug:t,path:n}=e,o=(0,l.kj)(),[c,d]=(0,a.useState)("ready"),[u,m]=(0,a.useState)([]),[p,x]=(0,a.useState)(!1),[h,j]=(0,a.useState)(null);async function f(){d("working"),j(null);try{var e,s;let a=await fetch("/api/md/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t,path:n})}),l=await a.json();a.ok&&l.findings?(m(l.findings),x(null!=(e=l.truncated)&&e),d("done")):(j(null!=(s=l.error)?s:String(a.status)),d("ready"))}catch(e){j(o("project.unreachable")),d("ready")}}return"done"!==c?(0,s.jsxs)("span",{className:"project-md-inspect",children:[(0,s.jsx)(r.rA,{tone:"surface",size:"sm",type:"button",onClick:f,busy:"working"===c,busyLabel:o("project.mdInspectWorking"),children:o("project.mdInspectButton")}),h&&(0,s.jsx)(r.lZ,{as:"span",text:h,className:"ml-2"})]}):(0,s.jsxs)("div",{className:"project-md-inspect-result",children:[0===u.length?(0,s.jsx)("p",{className:"project-md-clean",children:o("project.mdClean")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"project-md-count",children:1===u.length?o("project.mdFindingOne"):o("project.mdFindings",{n:u.length})}),(0,s.jsx)("ul",{className:"project-md-findings",children:u.map(e=>(0,s.jsxs)("li",{children:[(0,s.jsx)("span",{className:"project-md-line",children:o("project.mdLine",{n:e.line})}),(0,s.jsx)("code",{children:e.claim}),(0,s.jsx)("span",{className:"project-md-reason",children:function(e){if("broken-block"===e.kind)return o("project.mdBlockBroken");if("wrong-version"===e.kind){var t;return o("project.mdVersionWrong",{v:null!=(t=e.hint)?t:"?"})}return"missing-env"===e.kind?e.hint?o("project.mdEnvNear",{names:e.hint}):o("project.mdEnvMissing"):"missing-path"===e.kind?e.hint?o("project.mdPathMovedTo",{path:e.hint}):o("project.mdPathMissing"):e.hint?o("project.mdScriptNear",{names:e.hint}):o("project.mdScriptMissing")}(e)})]},"".concat(e.line,":").concat(e.claim)))})]}),(()=>{let e=u.filter(e=>e.hint&&("missing-path"===e.kind||"wrong-version"===e.kind||"missing-script"===e.kind&&!e.hint.includes(","))).length;return e>0?(0,s.jsx)("div",{className:"project-md-actions",children:(0,s.jsx)(i.MdRepair,{slug:t,path:n,fixable:e,onDone:f})}):null})(),p&&(0,s.jsx)("p",{className:"project-md-hint",children:o("project.mdTruncated")})]})}},23397:(e,t,n)=>{"use strict";n.d(t,{ProjectDouble:()=>o});var s=n(38657),a=n(32165),l=n(10354),i=n(9144),r=n(52948);function o(e){let{slug:t,consultations:n}=e,o=(0,i.kj)(),[c,d]=(0,a.useState)(null),[u,m]=(0,a.useState)(null),[p,x]=(0,a.useTransition)(),h=(0,l.useRouter)();if(0===n.length)return null;let j=null!==c||p;async function f(e,n){if(!j){d(e),m(null);try{var s;let a=await fetch("/api/consultations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t,id:e,verdict:n})}),l=await a.json().catch(()=>({}));a.ok?x(()=>h.refresh()):m(null!=(s=l.error)?s:o("double.saveFailed"))}catch(e){m(o("double.saveFailed"))}finally{d(null)}}}return(0,s.jsxs)(r.Zp,{as:"section",children:[(0,s.jsxs)("div",{className:"mb-2.5 flex items-baseline justify-between gap-3",children:[(0,s.jsx)("h3",{className:"eyebrow",children:o("double.title")}),(0,s.jsx)("span",{className:"font-mono text-[10px] text-faint",children:o("double.shadowTag")})]}),(0,s.jsx)("p",{className:"mb-3 font-mono text-[11px] leading-relaxed text-faint",children:o("double.hint")}),u&&(0,s.jsx)(r.lZ,{text:u,className:"mb-2"}),(0,s.jsx)("ul",{className:"space-y-3",children:n.map(e=>(0,s.jsxs)("li",{className:"border-t border-edge pt-2.5 text-xs first:border-t-0 first:pt-0",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-baseline gap-2",children:[(0,s.jsx)("span",{className:"min-w-0 flex-1 leading-relaxed text-chalk",children:e.question}),(0,s.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-faint",children:o("double.askedBy",{agent:e.agent})})]}),"drafting"===e.status&&(0,s.jsx)("p",{className:"mt-1 text-[11px] text-faint",children:o("double.drafting")}),"abstained"===e.status&&(0,s.jsx)("p",{className:"mt-1 text-[11px] text-faint",children:o("double.abstained")}),"drafted"===e.status&&e.cited.length>0&&(0,s.jsxs)("p",{className:"mt-1 font-mono text-[10px] leading-relaxed text-faint",children:[o("double.cites")," ",e.cited.join(" \xb7 ")]}),"drafted"===e.status&&(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-baseline gap-2",children:[(0,s.jsx)("span",{className:"min-w-0 flex-1 leading-relaxed text-smoke",children:e.answer}),null===e.verdict?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.rA,{tone:"raised",busy:c===e.id,disabled:j,onClick:()=>void f(e.id,"backed"),children:o("double.backed")}),(0,s.jsx)(r.rA,{tone:"plain",busy:c===e.id,disabled:j,onClick:()=>void f(e.id,"vetoed"),children:o("double.vetoed")})]}):(0,s.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-faint",children:"backed"===e.verdict?o("double.labeledBacked"):o("double.labeledVetoed")})]})]},e.id))})]})}},30153:(e,t,n)=>{"use strict";n.d(t,{Critiques:()=>o});var s=n(38657),a=n(32165),l=n(10354),i=n(9144),r=n(52948);function o(e){let{slug:t,findings:n,queued:o,discarded:c=[],review:d=null}=e,u=(0,i.kj)(),m=(0,l.useRouter)(),[,p]=(0,a.useTransition)(),[x,h]=(0,a.useState)(o),[j,f]=(0,a.useState)(()=>new Set(c)),g=JSON.stringify(Object.entries(o).sort()),b=JSON.stringify([...c].sort());(0,a.useEffect)(()=>{h(Object.fromEntries(JSON.parse(g)))},[g]),(0,a.useEffect)(()=>{f(new Set(JSON.parse(b)))},[b]);let[y,v]=(0,a.useState)(null),[k,N]=(0,a.useState)({}),[w,S]=(0,a.useState)(!1);if(0===n.length)return(0,s.jsx)("p",{className:"mt-4 font-mono text-[11px] leading-relaxed text-faint",children:null===d?u("critique.never"):"".concat(u("critique.clean",{n:d.sourcesRead})).concat(d.truncated?" ".concat(u("critique.partial")):"")});function C(e,t){N(n=>({...n,[e]:t}))}async function T(e,n){if(null===y){v(e.index);try{let a=await fetch("/api/twin/critique",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t,finding:e.index,key:e.key,decision:n})}),l=await a.json().catch(()=>({}));if(!a.ok){var s;l.id&&h(t=>({...t,[e.key]:l.id})),C(e.index,{text:null!=(s=l.error)?s:String(a.status),bad:409!==a.status||void 0===l.id});return}"discard"===n?(f(t=>new Set(t).add(e.key)),h(t=>{let n={...t};return delete n[e.key],n}),C(e.index,{text:u("critique.dismissed"),bad:!1})):(l.id&&h(t=>({...t,[e.key]:l.id})),f(t=>{let n=new Set(t);return n.delete(e.key),n}),C(e.index,{text:u("critique.queued"),bad:!1})),p(()=>m.refresh())}catch(t){C(e.index,{text:u("task.unreachable"),bad:!0})}finally{v(null)}}}return(0,s.jsxs)(r.Zp,{pad:"none",className:"mt-4 px-4 py-3",children:[(0,s.jsx)("button",{type:"button",onClick:()=>S(e=>!e),className:"font-mono text-xs text-smoke transition-colors hover:text-chalk",children:w?u("critique.hide"):1===n.length?u("critique.showOne"):u("critique.showMany",{findings:n.length})}),w&&(0,s.jsx)("ol",{className:"mt-3 flex flex-col gap-3",children:n.map(e=>{let t=x[e.key],n=j.has(e.key),a=k[e.index];return(0,s.jsxs)("li",{className:"flex flex-col gap-1",children:[(0,s.jsxs)("p",{className:"max-w-2xl text-sm leading-relaxed",children:[e.claim,e.hint?(0,s.jsxs)("span",{className:"text-smoke",children:[" \xb7 ",e.hint]}):null]}),e.file&&(0,s.jsxs)("p",{className:"max-w-2xl font-mono text-xs text-faint",children:[e.file,e.line?":".concat(e.line):""]}),(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,s.jsx)(r.rA,{tone:"plain",type:"button",onClick:()=>void T(e,"queue"),disabled:null!==y||void 0!==t,children:void 0!==t?u("look.assigned"):u("look.assignButton")}),!n&&(0,s.jsx)(r.rA,{tone:"quiet",type:"button",onClick:()=>void T(e,"discard"),disabled:null!==y,children:u("look.dismissButton")}),n&&(0,s.jsx)("span",{className:"font-mono text-xs text-faint",children:u("look.dismissed")})]}),a&&(0,s.jsx)("p",{className:"max-w-2xl font-mono text-xs ".concat(a.bad?"text-fail":"text-smoke"),children:a.text})]},e.key)})})]})}},31821:(e,t,n)=>{"use strict";let s;n.d(t,{q:()=>l});var a=n(32165);function l(){let[e,t]=(0,a.useState)({available:!1,agent:null});return(0,a.useEffect)(()=>{null!=s||(s=fetch("/api/assignments/launch").then(e=>e.json()).catch(()=>({available:!1,agent:null})));let e=!0;return s.then(n=>{e&&t(n)}),()=>{e=!1}},[]),e}},40810:(e,t,n)=>{"use strict";n.d(t,{MdReview:()=>c});var s=n(38657),a=n(32165),l=n(3043),i=n(9144),r=n(52948),o=n(60753);function c(e){var t;let{slug:n,initial:c,stale:d}=e,u=(0,i.kj)(),m=(0,i.Ym)(),[p,x]=(0,a.useState)("ready"),[h,j]=(0,a.useState)(c),[f,g]=(0,a.useState)(!1),[b,y]=(0,a.useState)(!1),[v,k]=(0,a.useState)(!1),[N,w]=(0,a.useState)(null);async function S(e){x("writing"),w(null);try{let s=await fetch("/api/md/review",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e?{slug:n,force:!0}:{slug:n})}),a=await s.json();if(s.ok){var t;j({text:a.text,model:a.model,at:null!=(t=a.at)?t:new Date().toISOString(),lang:m}),g(!0),y(!0===a.cached),k(!1===a.saved)}else w([a.error,a.hint].filter(Boolean).join(" \xb7 "))}catch(e){w(u("project.unreachable"))}finally{x("ready")}}return(0,s.jsxs)("div",{className:"rounded-lg border border-edge bg-surface p-4",children:[h?(0,s.jsxs)(s.Fragment,{children:[d&&!f&&(0,s.jsx)("p",{className:"mb-2 font-mono text-[11px] text-smoke",children:u("project.mdReviewStale")}),(0,s.jsx)("p",{className:"whitespace-pre-line text-sm leading-relaxed text-chalk",children:h.text}),(0,s.jsxs)("p",{className:"mt-3 flex flex-wrap items-center gap-x-3 gap-y-1 border-t border-edge pt-2.5 font-mono text-[11px] text-faint",children:[(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,s.jsx)(l.tZt,{className:"h-3.5 w-3.5","aria-hidden":!0}),u("project.aiWrittenBy",{model:null!=(t=h.model)?t:u("project.aiSomeModel")})]}),h.at&&(0,s.jsx)("span",{children:new Date(h.at).toLocaleDateString(m)}),(0,s.jsx)(o.b,{lang:h.lang}),(0,s.jsx)("button",{type:"button",onClick:()=>S(!0),disabled:"writing"===p,className:"ml-auto transition-colors hover:text-accent disabled:opacity-50",children:u("writing"===p?"project.mdReviewAsking":"project.mdReviewAgain")})]}),b&&(0,s.jsx)("p",{className:"mt-1 font-mono text-[11px] leading-relaxed text-faint",children:u("project.mdReviewCached")}),v&&(0,s.jsx)("p",{className:"mt-1 font-mono text-[11px] leading-relaxed text-faint",children:u("project.aiUnsaved")})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(r.rA,{tone:"surface",type:"button",onClick:()=>S(!1),busy:"writing"===p,children:[(0,s.jsx)(l.tZt,{className:"h-4 w-4","aria-hidden":!0}),u("writing"===p?"project.mdReviewAsking":"project.mdReviewAsk")]}),(0,s.jsxs)("p",{className:"mt-2 font-mono text-[11px] leading-relaxed text-faint",children:[u("project.mdReviewNote")," ",u("project.aiNoteBefore")," ",(0,s.jsx)("code",{children:"panoma ai use"}),"."]})]}),N&&(0,s.jsx)(r.lZ,{text:N,className:"mt-2"})]})}},41814:(e,t,n)=>{"use strict";n.d(t,{ProjectHooks:()=>o});var s=n(38657),a=n(32165),l=n(10354),i=n(9144),r=n(52948);function o(e){let{slug:t,installed:n}=e,o=(0,i.kj)(),c=(0,l.useRouter)(),[d,u]=(0,a.useState)(!1),[m,p]=(0,a.useState)(null),[,x]=(0,a.useTransition)();if(n)return(0,s.jsxs)("p",{className:"font-mono text-[11px] leading-relaxed text-faint",children:[(0,s.jsx)("span",{className:"text-accent",children:"✓"})," ",o("projectHooks.on")]});async function h(){if(!d){u(!0),p(null);try{var e,n;let s=await fetch("/api/hooks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t})}),a=await s.json().catch(()=>({}));s.ok&&(null!=(e=a.installed)?e:0)>0?x(()=>c.refresh()):p(null!=(n=a.error)?n:o("bridge.hooksNoCli"))}catch(e){p(o("bridge.hooksNoCli"))}finally{u(!1)}}}return(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("p",{className:"font-mono text-[11px] leading-relaxed text-faint",children:o("projectHooks.off")}),(0,s.jsx)(r.rA,{tone:"raised",busy:d,disabled:d,onClick:()=>void h(),children:o("projectHooks.install")})]}),m&&(0,s.jsx)(r.lZ,{text:m})]})}},48481:(e,t,n)=>{"use strict";n.d(t,{ProjectBuildCheck:()=>c});var s=n(38657),a=n(32165),l=n(10354),i=n(3043),r=n(9144),o=n(52948);function c(e){let{slug:t,initial:n}=e,c=(0,r.kj)(),d=(0,r.Ym)(),u=(0,l.useRouter)(),[m,p]=(0,a.useState)(n),[x,h]=(0,a.useState)(!1),[j,f]=(0,a.useState)(null);async function g(){h(!0),f(null);try{let n=await fetch("/api/check",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t})}),s=await n.json();if(n.ok&&s.ok&&s.verdict)p(s.verdict),u.refresh();else{var e;f(null!=(e=s.error)?e:String(n.status))}}catch(e){f(c("project.unreachable"))}finally{h(!1)}}let b=(0,s.jsxs)(o.rA,{tone:"raised",size:"sm",type:"button",onClick:g,disabled:x,children:[(0,s.jsx)(i.ax_,{className:"h-3.5 w-3.5","aria-hidden":!0}),c(m?"check.rerun":"check.run")]});if(x)return(0,s.jsx)("div",{className:"project-build-check",children:(0,s.jsx)("p",{className:"project-muted-message",children:c("check.running")})});if(!m)return(0,s.jsxs)("div",{className:"project-build-check",children:[(0,s.jsx)("p",{className:"project-muted-message",children:c("check.none")}),b,j&&(0,s.jsx)(o.lZ,{text:j,className:"mt-2"})]});let y="ok"===m.status||"failed"===m.status,v=new Date(m.at).toLocaleDateString(d,{day:"numeric",month:"short",year:"numeric"}),k=Math.max(1,Math.round(m.durationMs/1e3));return(0,s.jsxs)("div",{className:"project-build-check",children:[(0,s.jsxs)("p",{className:"flex items-center gap-1.5 text-sm",children:["ok"===m.status?(0,s.jsx)(i.CU3,{className:"h-4 w-4 shrink-0 text-live","aria-hidden":!0}):"failed"===m.status?(0,s.jsx)(i.oNX,{className:"h-4 w-4 shrink-0 text-fail","aria-hidden":!0}):null,(0,s.jsx)("strong",{children:c("ok"===m.status?"check.ok":"failed"===m.status?"check.broken":"check.inconclusive")}),y&&(0,s.jsx)("span",{className:"font-mono text-[11px] text-faint",children:c("check.checkedOn",{date:v,seconds:String(k)})})]}),(0,s.jsx)("p",{className:"mt-1 text-[13px] text-smoke",children:m.summary}),m.dirty&&(0,s.jsx)("p",{className:"mt-1 font-mono text-[11px] text-smoke",children:c("check.dirty")}),m.reason&&(0,s.jsx)("pre",{className:"project-build-check-reason",children:m.reason}),m.isolationNote&&(0,s.jsx)("p",{className:"mt-1 text-[11px] text-faint",children:m.isolationNote}),(0,s.jsx)("div",{className:"mt-2",children:b}),j&&(0,s.jsx)(o.lZ,{text:j,className:"mt-2"})]})}},53937:(e,t,n)=>{"use strict";n.d(t,{CommitActivityChart:()=>j,HealthScoreRing:()=>h});var s=n(38657),a=n(32165),l=n(17446),i=n(30926),r=n(23403),o=n(81466),c=n(22893),d=n(60917),u=n(57533),m=n(9144),p=n(8901);let x={es:["D","L","M","M","J","V","S"],en:["S","M","T","W","T","F","S"]};function h(e){let{score:t}=e,n=(0,m.kj)(),a=Math.max(0,Math.min(100,t)),r=a>=70?p.fN:a>=55?p.sV:p.kS;return(0,s.jsxs)("div",{className:"health-score-ring","aria-label":n("project.healthTitle",{n:a}),children:[(0,s.jsx)(l.D,{width:138,height:138,cx:69,cy:69,innerRadius:48,outerRadius:59,barSize:10,data:[{value:a,fill:r}],startAngle:90,endAngle:-270,children:(0,s.jsx)(i.ZB,{dataKey:"value",background:{fill:p.KG},cornerRadius:8})}),(0,s.jsx)("span",{className:"health-score-ring__value",children:a}),(0,s.jsx)("span",{className:"health-score-ring__total",children:n("project.outOf100")})]})}function j(e){let{week:t}=e,n=(0,m.kj)(),l=(0,m.Ym)(),i=(0,a.useMemo)(()=>t.map((e,n)=>({day:x[l][e.weekday],value:e.value,current:n===t.length-1})),[t,l]);return(0,s.jsx)("div",{className:"commit-activity-chart","aria-label":n("project.commitChartAria"),children:(0,s.jsx)(r.u,{width:"100%",height:"100%",children:(0,s.jsxs)(o.E,{data:i,margin:{top:4,right:0,left:0,bottom:0},children:[(0,s.jsx)(c.W,{dataKey:"day",axisLine:!1,tickLine:!1,tick:{fill:p.ux,fontSize:10}}),(0,s.jsx)(d.yP,{dataKey:"value",radius:[2,2,0,0],minPointSize:4,maxBarSize:17,children:i.map((e,t)=>(0,s.jsx)(u.f,{fill:e.current?p.Pg:p.KG},"".concat(e.day,"-").concat(t)))})]})})})}},60753:(e,t,n)=>{"use strict";n.d(t,{b:()=>i});var s=n(38657),a=n(9144);let l={es:"lang.es",en:"lang.en"};function i(e){let{lang:t}=e,n=(0,a.kj)(),i=(0,a.Ym)(),r="en"===t?"en":"es";return r===i?null:(0,s.jsx)("span",{children:n("project.aiWrittenIn",{lang:n(l[r])})})}},62827:(e,t,n)=>{"use strict";n.d(t,{ProjectBoard:()=>o});var s=n(38657),a=n(32165),l=n(9144);let i=[{id:"all",hashes:["","all"],label:"project.navAll"},{id:"resumen",hashes:["summary","resumen"],label:"project.navSummary"},{id:"actividad",hashes:["activity","actividad"],label:"project.navChanges"},{id:"retomar",hashes:["resume","retomar"],label:"project.navResume"},{id:"cuentas",hashes:["accounts","cuentas"],label:"project.navAccounts"},{id:"encargos",hashes:["assignments","encargos"],label:"project.navAssignments"},{id:"memoria",hashes:["memory"],label:"notes.title"},{id:"md",hashes:["md"],label:"project.navMd"},{id:"dependencias",hashes:["dependencies","dependencias","security","seguridad"],label:"project.navDeps"},{id:"agentes",hashes:["agents","agentes","log","bitacora"],label:"project.navAgents"},{id:"detalles",hashes:["details","detalles","stack","tecnologias"],label:"project.navDetails"}];function r(e){var t;null==(t=document.querySelector(".project-detail-page"))||t.setAttribute("data-view",e)}function o(e){let{sidebar:t,children:n}=e,o=(0,l.kj)(),[c,d]=(0,a.useState)("all");return(0,a.useEffect)(()=>{let e=()=>{let e=function(e){let t=e.replace(/^#/,"");if("unsaved"===t||"respaldo"===t)return"resumen";for(let e of i)if(e.hashes.includes(t))return e.id;return"all"}(window.location.hash);d(e),r(e)};return e(),window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("nav",{className:"project-subnav","aria-label":o("project.sections"),children:i.map(e=>{let t="all"===e.id?"#all":"#".concat(e.hashes[0]),n=c===e.id;return(0,s.jsx)("a",{href:t,className:n?"is-active":void 0,"aria-current":n?"page":void 0,onClick:n=>{n.preventDefault();let s=window.location.pathname+window.location.search;if("all"!==e.id&&c===e.id){window.history.replaceState(null,"",s),d("all"),r("all");return}window.history.replaceState(null,"","all"===e.id?s:"".concat(s).concat(t)),d(e.id),r(e.id)},children:o(e.label)},e.id)})}),(0,s.jsxs)("div",{className:"project-detail-layout",id:"summary",children:[(0,s.jsx)("div",{className:"project-primary-column",children:n}),(0,s.jsx)("aside",{className:"project-secondary-column",children:t})]})]})}},64106:(e,t,n)=>{"use strict";n.d(t,{MdApply:()=>c});var s=n(38657),a=n(32165),l=n(10354),i=n(35261),r=n(9144),o=n(52948);function c(e){let{slug:t,action:n,label:c}=e,d=(0,r.kj)(),u=(0,l.useRouter)(),[m,p]=(0,a.useState)("ready"),[x,h]=(0,a.useState)(null),[j,f]=(0,a.useState)(null);async function g(){p("working"),f(null),h(null);let e=await (0,i.B)("/api/md/apply",{slug:t,action:n},d("project.unreachable"));if(e.ok){var s;let t=null!=(s=e.data.file)?s:"AGENTS.md",a=e.data.created?d("project.mdInitDone",{file:t}):e.data.changed?"init"===n?d("project.mdBlockAdded",{file:t}):d("project.mdSyncDone",{file:t}):d("project.mdSyncSame");h(e.data.bridged?"".concat(a," ").concat(d("project.mdBridgeWritten")):a),setTimeout(()=>u.refresh(),2200)}else f(e.message);p("ready")}return(0,s.jsxs)("div",{className:"project-md-apply",children:[(0,s.jsx)(o.rA,{tone:"accent",type:"button",onClick:g,busy:"working"===m,busyLabel:d("project.mdApplyWorking"),children:c}),x&&(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-live",children:x}),j&&(0,s.jsx)(o.lZ,{text:j,className:"mt-2"})]})}},65425:(e,t,n)=>{"use strict";n.d(t,{Describe:()=>c});var s=n(38657),a=n(32165),l=n(3043),i=n(9144),r=n(52948),o=n(60753);function c(e){var t;let{slug:n,initial:c}=e,d=(0,i.kj)(),u=(0,i.Ym)(),[m,p]=(0,a.useState)("ready"),[x,h]=(0,a.useState)(c),[j,f]=(0,a.useState)(!1),[g,b]=(0,a.useState)(!1),[y,v]=(0,a.useState)(null);async function k(e){p("writing"),v(null);try{let s=await fetch("/api/describe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e?{slug:n,force:!0}:{slug:n})}),a=await s.json();if(s.ok){var t;h({text:a.text,model:a.model,at:null!=(t=a.at)?t:new Date().toISOString(),lang:u}),f(!0===a.cached),b(!1===a.saved)}else v([a.error,a.hint].filter(Boolean).join(" \xb7 "))}catch(e){v(d("project.unreachable"))}finally{p("ready")}}return(0,s.jsxs)("div",{className:"project-describe",children:[x?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-sm leading-relaxed text-chalk",children:x.text}),(0,s.jsxs)("p",{className:"mt-3 flex flex-wrap items-center gap-x-3 gap-y-1 border-t border-edge pt-2.5 font-mono text-[11px] text-faint",children:[(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,s.jsx)(l.tZt,{className:"h-3.5 w-3.5","aria-hidden":!0}),d("project.aiWrittenBy",{model:null!=(t=x.model)?t:d("project.aiSomeModel")})]}),x.at&&(0,s.jsx)("span",{children:new Date(x.at).toLocaleDateString(u)}),(0,s.jsx)(o.b,{lang:x.lang}),(0,s.jsx)("button",{type:"button",onClick:()=>k(!0),disabled:"writing"===m,className:"project-describe__rewrite ml-auto disabled:opacity-50",children:d("writing"===m?"project.aiWriting":"project.aiRewrite")})]}),j&&(0,s.jsx)("p",{className:"mt-1 font-mono text-[11px] leading-relaxed text-faint",children:d("project.aiCached")}),g&&(0,s.jsx)("p",{className:"mt-1 font-mono text-[11px] leading-relaxed text-faint",children:d("project.aiUnsaved")})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",onClick:()=>k(!1),disabled:"writing"===m,className:"project-describe__ask inline-flex items-center gap-2 px-3 py-1.5 font-mono text-xs disabled:opacity-50",children:[(0,s.jsx)(l.tZt,{className:"h-4 w-4","aria-hidden":!0}),d("writing"===m?"project.aiReading":"project.aiExplain")]}),(0,s.jsxs)("p",{className:"mt-2 font-mono text-[11px] leading-relaxed text-faint",children:[d("project.aiNoteBefore")," ",(0,s.jsx)("code",{children:"panoma ai use"}),"."," ",d("project.aiNoteAfter")]})]}),y&&(0,s.jsx)(r.lZ,{text:y,className:"mt-2"})]})}},67890:(e,t,n)=>{"use strict";n.d(t,{RunButton:()=>o});var s=n(38657),a=n(32165),l=n(10354),i=n(9144);let r={ok:"text-live",quiet:"text-faint",warn:"text-idle",bad:"text-fail"};function o(e){let t=(0,i.kj)(),[n,o]=(0,a.useTransition)(),[c,d]=(0,a.useState)(null),[u,m]=(0,a.useState)("quiet"),[p,x]=(0,a.useState)(!1),[h,j]=(0,a.useState)(!1),f=(0,l.useRouter)();async function g(){let n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];j(!0),d(null),x(!1);try{var s,a;let l=await fetch("/api/runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:e.slug,...e.security?{security:!0}:{packageName:e.packageName,targetVersion:e.targetVersion},...n?{force:!0}:{}})}),i=await l.json().catch(()=>null),r=function(e,t){var n;let s=t&&"object"==typeof t?t:{};return s.skipped&&s.knownFailure?{kind:"known-failure",summary:s.knownFailure.summary,runId:s.knownFailure.runId,hint:s.hint,forceable:!0,tone:"warn"}:!e.ok||s.error?{kind:"error",text:s.error,hint:s.hint,status:e.status,forceable:!1,tone:"bad"}:s.runId?{kind:"done",text:s.summary,tone:(n=s,"failed"===n.status?"bad":"no-changes"===n.status?"quiet":"proposed"===n.status?n.verified?"ok":"warn":"quiet")}:{kind:"unknown",status:e.status,tone:"bad"}}(l,i);m(r.tone),"known-failure"===r.kind?(x(r.forceable),d([t("project.alreadyFailed"),r.summary,r.hint].filter(Boolean).join(" "))):"error"===r.kind?d([null!=(s=r.text)?s:t("project.proposeRefused",{status:r.status}),r.hint].filter(Boolean).join(" ")):"unknown"===r.kind?d(t("project.proposeUnreadable",{status:r.status})):d(null!=(a=r.text)?a:t("project.proposeDone")),"known-failure"!==r.kind&&o(()=>f.refresh())}catch(e){m("bad"),d(t("project.runUnreachable"))}finally{j(!1)}}let b=h||n;return(0,s.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>void g(),disabled:b,className:"rounded border border-edge bg-raised px-2 py-0.5 font-mono text-[10px] text-smoke transition-colors hover:border-accent hover:text-accent disabled:opacity-50",children:t(b?"project.proposing":"project.propose")}),p&&!b&&(0,s.jsx)("button",{type:"button",onClick:()=>void g(!0),className:"rounded border border-idle/40 bg-raised px-2 py-0.5 font-mono text-[10px] text-idle transition-colors hover:border-idle hover:text-accent",children:t("project.tryAnyway")}),c&&(0,s.jsx)("span",{role:"status",className:"font-mono text-[10px] ".concat(r[u]),children:c})]})}},69636:(e,t,n)=>{"use strict";n.d(t,{Assignments:()=>m});var s=n(38657),a=n(32165),l=n(10354),i=n(3043),r=n(67890),o=n(9144),c=n(19014),d=n(31821),u=n(52948);function m(e){let{slug:t,assignments:n,queuedKinds:c,securityOpen:m,outdatedDeps:h}=e,j=(0,o.kj)(),f=(0,l.useRouter)(),[,g]=(0,a.useTransition)(),b=(0,d.q)(),[y,v]=(0,a.useState)(()=>new Set(c)),k=c.join(" ");(0,a.useEffect)(()=>{v(new Set(""===k?[]:k.split(" ")))},[k]);let[N,w]=(0,a.useState)(null),[S,C]=(0,a.useState)(null),[T,P]=(0,a.useState)(null),[A,O]=(0,a.useState)({});function R(e,t){O(n=>{let s={...n};return t?s[e]=t:delete s[e],s})}async function E(e){if(!N){w(e),R(e,null);try{var n,s;let a=await fetch("/api/assignments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t,kind:e})}),l=await a.json().catch(()=>({}));a.ok?(v(t=>new Set(t).add(e)),R(e,{text:j("assignment.queuedNote"),bad:!1}),g(()=>f.refresh())):409===a.status?(v(t=>new Set(t).add(e)),R(e,{text:null!=(n=l.error)?n:j("assignment.queuedNote"),bad:!1})):R(e,{text:[null!=(s=l.error)?s:j("assignment.failed"),l.hint].filter(Boolean).join(" "),bad:!0})}catch(t){R(e,{text:j("task.unreachable"),bad:!0})}finally{w(null)}}}async function B(e){if(!T){P(e),R(e,null);try{let s=await fetch("/api/assignments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t,kind:e,action:"withdraw"})}),a=await s.json().catch(()=>({}));if(s.ok)v(t=>{let n=new Set(t);return n.delete(e),n}),R(e,{text:j("assignment.withdrawn"),bad:!1}),g(()=>f.refresh());else{var n;409===s.status&&v(t=>{let n=new Set(t);return n.delete(e),n}),R(e,{text:[null!=(n=a.error)?n:j("assignment.withdrawFailed"),a.hint].filter(Boolean).join(" "),bad:409!==s.status})}}catch(t){R(e,{text:j("task.unreachable"),bad:!0})}finally{P(null)}}}async function F(e){if(!S){C(e),R(e,null);try{var n,s;let a=await fetch("/api/assignments/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t,kind:e})}),l=await a.json().catch(()=>({}));R(e,a.ok?{text:j("assignment.launched",{agent:null!=(n=l.agent)?n:""}),bad:!1}:{text:[null!=(s=l.error)?s:j("assignment.launchFailed"),l.hint].filter(Boolean).join(" "),bad:!0})}catch(t){R(e,{text:j("task.unreachable"),bad:!0})}finally{C(null)}}}return(0,s.jsxs)(u.Zp,{pad:"none",className:"px-4 py-1",children:[n.map(e=>(0,s.jsx)(p,{assignment:e,agent:b,enCola:y.has(e.kind),launching:S===e.kind,assigning:N===e.kind,withdrawing:T===e.kind,ocupado:null!==S||null!==N||null!==T,grade:A[e.kind],onLaunch:()=>F(e.kind),onAssign:()=>E(e.kind),onWithdraw:()=>B(e.kind)},e.kind)),m&&(0,s.jsx)(x,{title:j("assignment.securityTitle"),promise:j("assignment.securityPromise"),actions:(0,s.jsx)(r.RunButton,{slug:t,security:!0})}),h>0&&(0,s.jsx)(x,{title:j("assignment.depsTitle"),promise:j(1===h?"assignment.depsPromiseOne":"assignment.depsPromiseMany",{n:h}),actions:(0,s.jsxs)("a",{href:"#dependencies",className:"inline-flex items-center gap-1 rounded border border-edge bg-raised px-3 py-1.5 font-mono text-[11px] text-smoke transition-colors hover:border-accent hover:text-accent",children:[j("assignment.depsChoose")," ",(0,s.jsx)(i.r9I,{"aria-hidden":!0})]})})]})}function p(e){var t;let{assignment:n,agent:l,enCola:r,launching:c,assigning:d,withdrawing:m,ocupado:p,grade:j,onLaunch:f,onAssign:g,onWithdraw:b}=e,y=(0,o.kj)(),[v,k]=(0,a.useState)(!1);return(0,s.jsxs)(x,{title:n.title,promise:n.promise,actions:(0,s.jsxs)(s.Fragment,{children:[l.available&&(0,s.jsx)(u.rA,{tone:"accent",size:"sm",type:"button",onClick:f,busy:c,busyLabel:y("assignment.launching"),disabled:p,title:y("assignment.launchTitle",{agent:null!=(t=l.agent)?t:""}),children:y("assignment.launch")}),r?(0,s.jsxs)("span",{className:"inline-flex min-h-[26px] items-center gap-1 rounded border border-edge bg-raised px-2.5 py-1 font-mono text-[11px] text-faint",children:[(0,s.jsx)(i.mmf,{"aria-hidden":!0})," ",y("assignment.queued")]}):(0,s.jsx)(u.rA,{tone:"raised",size:"sm",type:"button",onClick:g,busy:d,busyLabel:y("assignment.sending"),disabled:p,title:y("assignment.sendTitle"),children:y("assignment.send")})]}),children:[(0,s.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 font-mono text-[11px]",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>k(!v),"aria-expanded":v,className:"inline-flex items-center gap-1 text-faint transition-colors hover:text-smoke",children:[(0,s.jsx)(i.ngD,{className:"h-3 w-3 transition-transform ".concat(v?"rotate-90":""),"aria-hidden":!0}),y("assignment.see")]}),(0,s.jsx)(h,{body:n.body}),r&&(0,s.jsx)("button",{type:"button",onClick:b,disabled:p,className:"text-faint transition-colors hover:text-smoke disabled:opacity-50",children:y(m?"assignment.withdrawing":"assignment.withdraw")})]}),v&&(0,s.jsx)("pre",{className:"mt-2 max-h-72 overflow-auto whitespace-pre-wrap rounded border border-edge bg-raised p-3 font-mono text-[11px] leading-relaxed text-smoke",children:n.body}),j&&(0,s.jsx)("p",{className:"mt-1.5 font-mono text-[11px] ".concat(j.bad?"text-fail":"text-faint"),children:j.text})]})}function x(e){let{title:t,promise:n,actions:a,children:l}=e;return(0,s.jsxs)("article",{className:"flex flex-wrap items-start gap-x-4 gap-y-2 border-t border-edge py-3.5 first:border-t-0",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-chalk",children:t}),(0,s.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-faint",children:n}),l]}),(0,s.jsx)("div",{className:"flex shrink-0 items-center gap-2 pt-0.5",children:a})]})}function h(e){let{body:t}=e,n=(0,o.kj)(),{copied:a,failed:l,copy:i}=(0,c.K)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{type:"button",onClick:()=>i(t),className:"text-faint transition-colors hover:text-smoke",children:n(a?"assignment.copied":"assignment.copy")}),l&&(0,s.jsx)("span",{role:"status",className:"text-fail",children:n("assignment.copyFailed")})]})}},70428:(e,t,n)=>{Promise.resolve().then(n.bind(n,69636)),Promise.resolve().then(n.bind(n,17023)),Promise.resolve().then(n.bind(n,14262)),Promise.resolve().then(n.bind(n,30153)),Promise.resolve().then(n.bind(n,65425)),Promise.resolve().then(n.bind(n,64106)),Promise.resolve().then(n.bind(n,20682)),Promise.resolve().then(n.bind(n,93489)),Promise.resolve().then(n.bind(n,40810)),Promise.resolve().then(n.bind(n,12991)),Promise.resolve().then(n.bind(n,79296)),Promise.resolve().then(n.bind(n,14847)),Promise.resolve().then(n.bind(n,62827)),Promise.resolve().then(n.bind(n,48481)),Promise.resolve().then(n.bind(n,53937)),Promise.resolve().then(n.bind(n,23397)),Promise.resolve().then(n.bind(n,41814)),Promise.resolve().then(n.bind(n,79135)),Promise.resolve().then(n.bind(n,90344)),Promise.resolve().then(n.bind(n,67890)),Promise.resolve().then(n.bind(n,84549)),Promise.resolve().then(n.t.bind(n,3953,23))},79135:(e,t,n)=>{"use strict";n.d(t,{ProjectMemory:()=>o});var s=n(38657),a=n(32165),l=n(10354),i=n(9144),r=n(52948);function o(e){let{slug:t,notes:n,usage:o,extraction:c}=e,d=(0,i.kj)(),[u,m]=(0,a.useState)(""),[p,x]=(0,a.useState)(!1),[h,j]=(0,a.useState)(""),[f,g]=(0,a.useState)(!1),[b,y]=(0,a.useState)(null),[v,k]=(0,a.useState)(null),[N,w]=(0,a.useTransition)(),S=(0,l.useRouter)(),C=n.filter(e=>"approved"===e.status),T=n.filter(e=>"proposed"===e.status),P=n.filter(e=>"challenged"===e.status),A=f||null!==b||N;async function O(e,n){if(!A){g(void 0===n),y(null!=n?n:null),k(null);try{let n=await fetch("/api/notes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:t,...e})}),a=await n.json().catch(()=>({}));if(n.ok)"add"===e.action&&(m(""),j("")),w(()=>S.refresh());else{var s;k(null!=(s=a.error)?s:d("notes.saveFailed"))}}catch(e){k(d("notes.saveFailed"))}finally{g(!1),y(null)}}}return(0,s.jsxs)("section",{id:"memory","aria-labelledby":"project-memory-title",children:[(0,s.jsx)("h2",{id:"project-memory-title",className:"eyebrow mb-2",children:d("notes.title")}),(0,s.jsx)("p",{className:"mb-3 text-xs leading-relaxed text-smoke",children:d("notes.hint")}),(0,s.jsxs)("div",{className:"mb-4 flex flex-wrap gap-x-4 gap-y-1 font-mono text-[11px] text-smoke",children:[(0,s.jsx)("span",{children:d("notes.awakeBudget",{used:o.used,budget:o.budget})}),(0,s.jsx)("span",{children:d("notes.scopedBudget",{used:o.sleeping,budget:o.sleepingMax})}),(0,s.jsx)("span",{children:d("notes.pendingBudget",{used:o.pending,budget:o.pendingMax})})]}),c.pending+c.running+c.deferred+c.failed+c.complete>0&&(0,s.jsxs)("details",{className:"mb-4 rounded border border-edge p-3 text-xs text-smoke",children:[(0,s.jsx)("summary",{className:"cursor-pointer",children:d("notes.extraction")}),(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap gap-x-4 gap-y-1",children:[(0,s.jsx)("span",{children:d("notes.jobsPending",{n:c.pending+c.running})}),(0,s.jsx)("span",{children:d("notes.jobsDeferred",{n:c.deferred})}),(0,s.jsx)("span",{children:d("notes.jobsFailed",{n:c.failed})})]}),(0,s.jsx)("p",{className:"mt-2 leading-relaxed",children:d("notes.jobsHint")}),c.coverage&&(0,s.jsx)("p",{className:"mt-2 leading-relaxed",children:d("notes.coverage",{selected:c.coverage.selected,total:c.coverage.total,omitted:c.coverage.omitted,clipped:c.coverage.clipped})})]}),(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault();let t=u.trim();t&&O({action:"add",body:t,...p?{where:h.trim()}:{}})},className:"space-y-2",children:[(0,s.jsx)(r.fs,{rows:3,size:"sm",disabled:A,value:u,onChange:e=>m(e.target.value),maxLength:500,placeholder:d("notes.addPlaceholder"),label:d("notes.title"),hideLabel:!0}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("label",{id:"memory-scope-label",htmlFor:"memory-scope",className:"text-xs text-smoke",children:d("notes.scope")}),(0,s.jsxs)("select",{id:"memory-scope","aria-labelledby":"memory-scope-label",disabled:A,value:p?"path":"all",onChange:e=>x("path"===e.target.value),className:"rounded border border-edge bg-raised px-2 py-1.5 text-xs text-chalk",children:[(0,s.jsx)("option",{value:"all",children:d("notes.scopeAll")}),(0,s.jsx)("option",{value:"path",children:d("notes.scopePath")})]}),(0,s.jsx)(r.rA,{tone:"raised",type:"submit",busy:f,disabled:A||!u.trim()||p&&!h.trim(),children:d("notes.add")})]}),p&&(0,s.jsxs)("div",{children:[(0,s.jsx)(r.D0,{disabled:A,value:h,onChange:e=>j(e.target.value),maxLength:120,label:d("notes.where"),hideLabel:!0,size:"sm","aria-describedby":"memory-path-hint",placeholder:"src/**",className:"font-mono"}),(0,s.jsx)("p",{id:"memory-path-hint",className:"mt-1 text-xs leading-relaxed text-smoke",children:d("notes.whereHint")})]})]}),v&&(0,s.jsx)(r.lZ,{text:v,className:"mt-2"}),0===C.length&&0===T.length&&0===P.length&&(0,s.jsx)("p",{className:"mt-3 text-xs text-faint",children:d("notes.empty")}),[!1,!0].map(e=>{let t=C.filter(t=>!!t.trigger===e);return 0===t.length?null:(0,s.jsxs)("div",{className:"mt-4 border-t border-edge pt-3",children:[(0,s.jsx)("h3",{className:"eyebrow mb-2",children:d(e?"notes.scoped":"notes.always")}),(0,s.jsx)("ul",{className:"space-y-3",children:t.map(e=>(0,s.jsxs)("li",{className:"text-xs",children:[(0,s.jsx)("p",{className:"break-words leading-relaxed text-chalk",children:e.body}),(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1",children:[e.trigger&&(0,s.jsx)("code",{className:"break-all text-smoke",children:e.trigger}),(0,s.jsx)("span",{className:"text-smoke",children:e.createdBy}),(0,s.jsx)("span",{className:"text-smoke",children:e.anchors?d("notes.anchors",{n:e.anchors}):d("notes.noAnchors")}),(0,s.jsx)(r.rA,{tone:"plain",busy:b===e.id,disabled:A,onClick:()=>void O({action:"discard",id:e.id},e.id),children:d("notes.discard")})]})]},e.id))})]},String(e))}),P.length>0&&(0,s.jsxs)("div",{className:"mt-3 border-t border-edge pt-3",children:[(0,s.jsx)("h3",{className:"eyebrow mb-2",children:d("notes.challengedTitle")}),(0,s.jsx)("p",{className:"mb-3 text-xs leading-relaxed text-smoke",children:d("notes.challengeHint")}),(0,s.jsx)("ul",{className:"space-y-1.5",children:P.map(e=>{var t,n,a,l,i;return(0,s.jsxs)("li",{className:"flex flex-wrap items-baseline gap-2 text-xs",children:[(0,s.jsx)("span",{className:"w-full break-words leading-relaxed text-chalk",children:e.body}),(0,s.jsx)("span",{className:"min-w-0 break-all font-mono text-[11px] text-smoke",children:d("notes.challengedEvidence",{target:null!=(l=null==(n=e.challenge)||null==(t=n.sentinel)?void 0:t.target)?l:"?",observed:null!=(i=null==(a=e.challenge)?void 0:a.observed)?i:"?"})}),(0,s.jsx)(r.rA,{tone:"raised",busy:b===e.id,disabled:A,onClick:()=>void O({action:"approve",id:e.id},e.id),children:d("notes.reapprove")}),(0,s.jsx)(r.rA,{tone:"plain",busy:b===e.id,disabled:A,onClick:()=>void O({action:"discard",id:e.id},e.id),children:d("notes.discard")})]},e.id)})})]}),T.length>0&&(0,s.jsxs)("div",{className:"mt-3 border-t border-edge pt-3",children:[(0,s.jsx)("h3",{className:"eyebrow mb-2",children:d("notes.pendingTitle")}),(0,s.jsx)("p",{className:"mb-3 text-xs text-smoke",children:d("notes.reviewFirst")}),(0,s.jsx)("ul",{className:"space-y-1.5",children:T.map(e=>(0,s.jsxs)("li",{className:"flex flex-wrap items-baseline gap-2 text-xs",children:[(0,s.jsx)("span",{className:"w-full break-words leading-relaxed text-chalk",children:e.body}),(0,s.jsxs)("span",{className:"min-w-0 break-all font-mono text-[11px] text-smoke",children:[e.trigger?"".concat(d("notes.sleepsAt",{trigger:e.trigger})," \xb7 "):"",d("notes.proposedBy",{agent:e.createdBy})]}),(0,s.jsx)(r.rA,{tone:"raised",busy:b===e.id,disabled:A,onClick:()=>void O({action:"approve",id:e.id},e.id),children:d("notes.approve")}),(0,s.jsx)(r.rA,{tone:"plain",busy:b===e.id,disabled:A,onClick:()=>void O({action:"discard",id:e.id},e.id),children:d("notes.discard")})]},e.id))})]})]})}},79296:(e,t,n)=>{"use strict";n.d(t,{ProjectAccounts:()=>g,ProjectAccountsQuick:()=>f});var s=n(38657),a=n(32165),l=n(10354),i=n(3043),r=n(54574);function o(e){return e.length>0?e:[{label:""}]}var c=n(35261),d=n(9144),u=n(19014),m=n(52948);let p="panoma:accounts",x={urls:[],labels:[]};function h(e){let{url:t,label:n}=e,[l,i]=(0,a.useState)(!1),r=(()=>{try{return t?new URL(t).origin:void 0}catch(e){return}})();if(!r||l){var o;return(0,s.jsx)("span",{className:"project-account-chip","aria-hidden":!0,children:(null!=(o=n.trim()[0])?o:"\xb7").toUpperCase()})}return(0,s.jsx)("img",{className:"project-account-favicon",src:"".concat(r,"/favicon.ico"),alt:"",width:16,height:16,loading:"lazy",onError:()=>i(!0)})}function j(e){let{entry:t}=e,n=(0,d.kj)(),{copied:a,copy:l}=(0,u.K)();return(0,s.jsxs)("li",{className:"project-account-row",children:[(0,s.jsx)(h,{url:t.url,label:t.label}),(0,s.jsxs)("div",{className:"project-account-body",children:[(0,s.jsx)("strong",{children:t.label}),t.url&&(0,s.jsxs)("span",{className:"project-account-line",children:[(0,s.jsx)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:function(e){try{return new URL(e).host}catch(t){return e}}(t.url)}),(0,s.jsx)("button",{type:"button",onClick:()=>l(t.url),title:t.url,children:a?n("accounts.copied"):"⧉"})]}),t.email&&(0,s.jsxs)("span",{className:"project-account-line",children:[(0,s.jsx)("code",{children:t.email}),(0,s.jsx)("button",{type:"button",onClick:()=>l(t.email),children:a?n("accounts.copied"):"⧉"})]}),t.note&&(0,s.jsx)("span",{className:"project-accounts-note",children:t.note})]})]})}function f(e){let{entries:t}=e,n=(0,d.kj)();return(0,s.jsxs)("div",{className:"project-accounts",children:[0===t.length?(0,s.jsx)("p",{className:"project-muted-message",children:n("accounts.empty")}):(0,s.jsx)("ul",{className:"project-accounts-list",children:t.slice(0,6).map((e,t)=>(0,s.jsx)(j,{entry:e},"".concat(e.label,":").concat(t)))}),(0,s.jsxs)("a",{className:"project-accounts-go",href:"#accounts",onClick:()=>window.dispatchEvent(new CustomEvent(p)),children:[(0,s.jsx)(i.YUE,{className:"h-3.5 w-3.5","aria-hidden":!0}),n(0===t.length?"accounts.addFirst":"accounts.editList")]})]})}function g(e){let{slug:t,initial:n}=e,u=(0,d.kj)(),h=(0,l.useRouter)(),[f,g]=(0,a.useState)(!1),[b,y]=(0,a.useState)(n),[v,k]=(0,a.useState)("ready"),[N,w]=(0,a.useState)(null),[S,C]=(0,a.useState)(x),T=(0,a.useRef)(null),P=(0,a.useCallback)(()=>{y(o),g(!0)},[]);function A(e,t,n){y(s=>s.map((s,a)=>a===e?{...s,[t]:n}:s)),C(n=>(function(e,t,n){if("label"!==n&&"url"!==n)return e;let s="label"===n?"labels":"urls";return e[s].includes(t)?{...e,[s]:e[s].filter(e=>e!==t)}:e})(n,e,t))}async function O(){let e=function(e){let t=[],n=[];return e.forEach((e,s)=>{"unusable"===(0,r.C)(e.url).kind&&t.push(s),[e.url,e.email,e.note].some(e=>null==e?void 0:e.trim())&&!e.label.trim()&&n.push(s)}),{urls:t,labels:n}}(b);if(C(e),e.urls.length>0||e.labels.length>0)return void w(null);k("saving"),w(null);let n=b.filter(e=>e.label.trim()).map(e=>{let t=(0,r.C)(e.url);return{...e,url:"url"===t.kind?t.url:void 0}}),s=await (0,c.B)("/api/accounts",{slug:t,accounts:n},u("project.unreachable"));s.ok?(y(n),g(!1),h.refresh()):w(s.message),k("ready")}return((0,a.useEffect)(()=>(window.addEventListener(p,P),()=>window.removeEventListener(p,P)),[P]),(0,a.useEffect)(()=>{if(!f)return;let e=setTimeout(()=>{var e;return null==(e=T.current)?void 0:e.focus()},0);return()=>clearTimeout(e)},[f]),f)?(0,s.jsx)("div",{className:"project-accounts project-accounts--full",children:(0,s.jsxs)("div",{className:"project-accounts-form",children:[b.map((e,t)=>{var n,a,l;return(0,s.jsxs)("div",{className:"project-accounts-row",children:[(0,s.jsx)("input",{ref:0===t?T:void 0,value:e.label,onChange:e=>A(t,"label",e.target.value),placeholder:u("accounts.label"),maxLength:80,"aria-invalid":S.labels.includes(t)||void 0}),(0,s.jsx)("input",{value:null!=(n=e.url)?n:"",onChange:e=>A(t,"url",e.target.value),placeholder:"vercel.com/… \xb7 localhost:3000",maxLength:300,"aria-invalid":S.urls.includes(t)||void 0}),(0,s.jsx)("input",{value:null!=(a=e.email)?a:"",onChange:e=>A(t,"email",e.target.value),placeholder:u("accounts.email"),maxLength:120}),(0,s.jsx)("input",{value:null!=(l=e.note)?l:"",onChange:e=>A(t,"note",e.target.value),placeholder:u("accounts.note"),maxLength:300}),(0,s.jsx)("button",{type:"button",onClick:()=>y(e=>e.filter((e,n)=>n!==t)),"aria-label":u("accounts.remove"),className:"text-faint transition-colors hover:text-fail",children:"\xd7"})]},t)}),(0,s.jsxs)("div",{className:"project-accounts-actions",children:[(0,s.jsx)(m.rA,{tone:"surface",size:"sm",type:"button",onClick:()=>y(e=>[...e,{label:""}]),disabled:b.length>=24,children:u("accounts.addRow")}),(0,s.jsx)(m.rA,{tone:"accent",size:"sm",type:"button",onClick:O,busy:"saving"===v,busyLabel:u("accounts.saving"),children:u("accounts.save")}),(0,s.jsx)(m.rA,{tone:"quiet",size:"sm",type:"button",onClick:()=>{y(n),C(x),w(null),g(!1)},children:u("accounts.cancel")})]}),(0,s.jsxs)("p",{className:"project-accounts-warning",children:[(0,s.jsx)(i.JPZ,{className:"h-3.5 w-3.5","aria-hidden":!0}),u("accounts.noSecrets")]}),S.urls.length>0&&(0,s.jsx)(m.lZ,{text:u("accounts.badUrl")}),S.labels.length>0&&(0,s.jsx)(m.lZ,{text:u("accounts.needsLabel")}),N&&(0,s.jsx)(m.lZ,{text:N})]})}):(0,s.jsxs)("div",{className:"project-accounts project-accounts--full",children:[0===b.length?(0,s.jsx)("p",{className:"project-muted-message",children:u("accounts.empty")}):(0,s.jsx)("ul",{className:"project-accounts-list",children:b.map((e,t)=>(0,s.jsx)(j,{entry:e},"".concat(e.label,":").concat(t)))}),(0,s.jsxs)(m.rA,{tone:"surface",size:"sm",type:"button",className:"mt-3",onClick:P,children:[(0,s.jsx)(i.YUE,{className:"h-3.5 w-3.5","aria-hidden":!0}),u(0===b.length?"accounts.addFirst":"accounts.edit")]})]})}},84549:(e,t,n)=>{"use strict";n.d(t,{UnusedAssets:()=>o});var s=n(38657),a=n(32165),l=n(9144),i=n(98194),r=n(52948);function o(e){let{projectId:t}=e,n=(0,l.kj)(),[o,c]=(0,a.useState)("ready"),[d,u]=(0,a.useState)(null),[m,p]=(0,a.useState)(null);async function x(){c("searching"),p(null);try{var e;let s=await fetch("/api/assets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:t})}),a=await s.json();s.ok?u(a):p(null!=(e=a.error)?e:n("project.assetsFailed"))}catch(e){p(n("project.unreachable"))}finally{c("ready")}}return d?(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-mono text-[11px] text-faint",children:n("project.assetsStats",{n:d.analyzed,platform:d.skippedPlatform,sources:d.sourcesRead})}),0===d.unused.length?(0,s.jsx)(r.pp,{className:"mt-3",title:n("project.assetsAllUsed")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"mt-3 font-display text-2xl font-semibold",children:[n("project.assetsUnused",{n:d.unused.length})," ",(0,s.jsx)("span",{className:"font-mono text-sm font-normal text-faint",children:(0,i.z)(d.unusedBytes)})]}),(0,s.jsx)("ul",{className:"mt-3 space-y-0.5",children:d.unused.map(e=>(0,s.jsxs)("li",{className:"flex items-baseline justify-between gap-3 border-b border-edge/50 py-1.5 font-mono text-xs",children:[(0,s.jsx)("span",{className:"truncate text-smoke",title:e.reason,children:e.path}),(0,s.jsx)("span",{className:"shrink-0 text-faint",children:(0,i.z)(e.bytes)})]},e.path))})]}),d.dynamicDirs.length>0&&(0,s.jsx)(r.Zp,{pad:"sm",className:"mt-4 font-mono text-[11px] text-smoke",children:n("project.assetsDynamic",{dirs:d.dynamicDirs.join(", ")})}),(0,s.jsx)("p",{className:"mt-3 font-mono text-[11px] text-faint",children:n("project.assetsCaveat")})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)(r.rA,{tone:"surface",type:"button",onClick:x,busy:"searching"===o,busyLabel:n("project.assetsReading"),children:n("project.assetsSearch")}),m&&(0,s.jsx)(r.lZ,{text:m,className:"mt-2"}),(0,s.jsx)("p",{className:"mt-2 font-mono text-[11px] text-faint",children:n("project.assetsSlow")})]})}},90344:(e,t,n)=>{"use strict";n.d(t,{Resume:()=>g});var s=n(38657),a=n(32165),l=n(14262),i=n(3953),r=n.n(i),o=n(3043),c=n(80914),d=n(50178),u=n(79126),m=n(9144),p=n(52948);function x(e){let{conversations:t,slug:n}=e,a=(0,m.kj)(),l=(0,m.Ym)(),i="/handoff?project=".concat(encodeURIComponent(n));return(0,s.jsxs)(p.Zp,{as:"section","aria-labelledby":"project-conversations-title",children:[(0,s.jsx)("h3",{id:"project-conversations-title",className:"eyebrow mb-1",children:a("project.conversations")}),(0,s.jsx)("p",{className:"mb-2.5 text-xs leading-relaxed text-smoke",children:a("project.conversationsLead")}),0===t.length?(0,s.jsx)(p.pp,{variant:"note",title:a("project.noConversations")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("ul",{className:"space-y-1.5",children:t.map(e=>{var t,n,m;let p=null!=(t=u.L[(0,c.$e)(e.agent,e.surface)])?t:o.tZt;return(0,s.jsxs)("li",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-0.5 text-xs",children:[(0,s.jsx)(p,{"aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 text-smoke"}),(0,s.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-faint",children:(0,c.en)(e.agent,e.surface)}),(0,s.jsx)(r(),{href:i,className:"min-w-0 max-w-full flex-1 basis-40 truncate text-chalk hover:underline",title:null!=(n=e.title)?n:e.handle,children:null!=(m=e.title)?m:e.handle}),(0,s.jsxs)("span",{className:"font-mono text-[10px] text-faint",children:[null===e.turnCount?a("handoff.size",{size:(0,c.lP)(e.bytes)}):a("handoff.turns",{n:e.turnCount})," \xb7 ",(0,d.P)(e.updatedAt,l)]})]},e.id)})}),(0,s.jsx)(r(),{href:i,className:"mt-2.5 inline-block font-mono text-[11px] text-accent hover:underline",children:a("handoff.projectMore")})]})]})}var h=n(20441);let j=["install","start","tests","build"],f={install:"purpose.install",start:"purpose.start",tests:"purpose.tests",build:"purpose.build"};function g(e){let{runbook:t,recentCommits:n,root:i,shell:r,conversations:o,slug:c}=e,d=(0,m.kj)(),u=(0,m.Ym)(),[g,y]=(0,a.useState)(null);(0,a.useEffect)(()=>{0!==t.runtimes.length&&fetch("/api/environment").then(e=>e.json()).then(e=>y(e.tools)).catch(()=>y({}))},[t.runtimes.length]);let v=[...t.commands].sort((e,t)=>j.indexOf(e.purpose)-j.indexOf(t.purpose)),k=function(e){let t=e[0];if(!t)return[];let n=new Date(t.at).getTime()-864e5,s=e.filter(e=>new Date(e.at).getTime()>=n);return(s.length>=3?s:e.slice(0,3)).slice(0,5)}(n);return(0,s.jsxs)("div",{className:"grid gap-5 md:grid-cols-2",children:[k.length>0&&(0,s.jsx)(b,{title:d("project.lastYouDid"),children:(0,s.jsx)("ul",{className:"space-y-1",children:k.map(e=>(0,s.jsxs)("li",{className:"flex gap-2.5 text-xs leading-relaxed",children:[(0,s.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-faint",children:e.sha.slice(0,7)}),(0,s.jsx)("span",{className:"min-w-0 flex-1 text-smoke",children:e.subject}),e.agent&&(0,s.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-accent",title:d("changes.signedBy",{agent:e.agent}),children:e.agent})]},e.sha))})}),v.length>0&&(0,s.jsx)(b,{title:d("project.howToStart"),children:(0,s.jsx)("ul",{className:"space-y-1.5",children:v.map(e=>(0,s.jsxs)("li",{className:"flex flex-wrap items-baseline gap-2",children:[(0,s.jsx)("span",{className:"w-16 shrink-0 font-mono text-[10px] text-faint",children:d(f[e.purpose])}),(0,s.jsx)(l.CopyCommand,{command:(0,h._z)(i,e.command,r),label:e.command,locale:u}),(0,s.jsx)("span",{className:"min-w-0 truncate font-mono text-[10px] text-faint",title:e.source,children:e.source})]},e.command))})}),t.runtimes.length>0&&(0,s.jsx)(b,{title:d("project.whatItNeeds"),children:(0,s.jsx)("ul",{className:"space-y-1.5",children:t.runtimes.map(e=>{var t,n;let a=null!=(n=null==g||null==(t=g[e.id])?void 0:t.version)?n:null;return(0,s.jsxs)("li",{className:"flex flex-wrap items-baseline gap-x-2.5 gap-y-1 font-mono text-[11px]",children:[(0,s.jsx)("span",{className:"text-chalk",children:e.name}),(0,s.jsx)("span",{className:"text-smoke",children:e.required}),null===g?(0,s.jsx)("span",{className:"text-faint",children:d("project.runtimeChecking")}):a?(0,s.jsx)("span",{className:"text-live",children:d("project.runtimeHave",{version:a})}):(0,s.jsx)("span",{className:"text-idle",children:d("project.runtimeMissing")}),(0,s.jsx)("span",{className:"text-faint",children:e.source})]},"".concat(e.id,"-").concat(e.required))})})}),null!==o&&(0,s.jsx)(x,{conversations:o,slug:c}),t.missingEnv.length>0&&(0,s.jsxs)(b,{title:d("project.missingEnv",{n:t.missingEnv.length}),children:[(0,s.jsxs)("p",{className:"mb-2 text-xs leading-relaxed text-smoke",children:[d("project.envDeclaredIn")," ",(0,s.jsx)("code",{className:"font-mono text-chalk",children:t.envExample})," ",d("project.envNoValue")," ",(0,s.jsx)("code",{className:"font-mono text-chalk",children:".env"}),". ",d("project.envWhy")]}),(0,s.jsx)("ul",{className:"flex flex-wrap gap-1.5",children:t.missingEnv.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(p.vw,{children:e})},e))})]})]})}function b(e){let{title:t,children:n}=e;return(0,s.jsxs)(p.Zp,{as:"section",children:[(0,s.jsx)("h3",{className:"eyebrow mb-2.5",children:t}),n]})}},93489:(e,t,n)=>{"use strict";n.d(t,{MdRepair:()=>c});var s=n(38657),a=n(32165),l=n(10354),i=n(35261),r=n(9144),o=n(52948);function c(e){let{slug:t,path:n,fixable:c,onDone:d}=e,u=(0,r.kj)(),m=(0,l.useRouter)(),[p,x]=(0,a.useState)("ready"),[h,j]=(0,a.useState)(null),[f,g]=(0,a.useState)(null);async function b(){x("working"),g(null);let e=await (0,i.B)("/api/md/repair",{slug:t,...n?{path:n}:{}},u("project.unreachable"));if(e.ok){var s,a;let t=null!=(s=e.data.applied)?s:0,n=null!=(a=e.data.remaining)?a:0;j(0===n?u("project.mdRepairDoneAll",{n:t}):u("project.mdRepairDone",{n:t,m:n})),d?setTimeout(d,1800):setTimeout(()=>m.refresh(),2200)}else g(e.message);x("ready")}return(0,s.jsxs)("span",{className:"project-md-repair",children:[(0,s.jsx)(o.rA,{tone:"accent",size:"sm",type:"button",onClick:b,busy:"working"===p,busyLabel:u("project.mdRepairWorking"),children:u("project.mdRepairButton",{n:c})}),h&&(0,s.jsx)("span",{className:"ml-2 text-xs text-live",children:h}),f&&(0,s.jsx)(o.lZ,{as:"span",text:f,className:"ml-2"})]})}}},e=>{e.O(0,[6587,3052,2583,3953,1774,2575,2948,1369,2202,4189,1305,6823,7358],()=>e(e.s=70428)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1080],{4737:(e,s,t)=>{"use strict";t.d(s,{VideoProduction:()=>I});var a=t(38657),l=t(3953),n=t.n(l),o=t(32165),i=t(3043),r=t(9144),d=t(57776),c=t(76982),p=t(52948),m=t(97234);let u=Object.fromEntries(m.t3.map(e=>[e.value,e.ratio])),x={es:"Espa\xf1ol",en:"English"},b="mt-2 block w-full rounded border border-edge bg-surface p-2",j="rounded-xl border border-edge p-5";function h(e){let{width:s,height:t}=e,l=s>=t?22:Math.round(22*s/t),n=t>=s?22:Math.round(22*t/s);return(0,a.jsx)("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",className:"size-6 shrink-0",children:(0,a.jsx)("rect",{x:(24-l)/2,y:(24-n)/2,width:l,height:n,rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})})}function v(e){let{value:s,onChange:t,label:l,disabled:n=!1}=e,i=(0,r.kj)(),d=(0,o.useId)();return(0,a.jsxs)("fieldset",{className:"min-w-0 text-sm",disabled:n,children:[(0,a.jsx)("legend",{children:l}),(0,a.jsx)("div",{className:"mt-2 grid grid-cols-3 gap-2",children:m.t3.map(e=>{let l=s===e.value;return(0,a.jsxs)("label",{className:"flex cursor-pointer flex-col items-center gap-1 rounded border px-2 py-2 text-center has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-accent ".concat(l?"border-accent bg-raised text-chalk":"border-edge text-smoke hover:border-edge-bright"),title:i("apps.jobs.formatFor".concat(e.value.toUpperCase())),children:[(0,a.jsx)("input",{type:"radio",name:d,value:e.value,checked:l,onChange:()=>t(e.value),className:"sr-only"}),(0,a.jsx)(h,{width:e.width,height:e.height}),(0,a.jsx)("span",{className:"text-xs font-semibold",children:i(e.key)}),(0,a.jsx)("span",{className:"font-mono text-[10px] text-faint",children:e.ratio}),(0,a.jsx)("span",{className:"sr-only",children:i("apps.jobs.formatFor".concat(e.value.toUpperCase()))})]},e.value)})})]})}function f(e){var s,t,l,o,i;let{t:r,app:d,identity:u,slug:x,credential:b}=e,h=(0,m.CG)(d),v=e=>{let s=h.find(s=>s.id===e);return(null==s?void 0:s.present)===!0?{tone:"live",text:r("apps.present")}:(null==s?void 0:s.present)===!1?{tone:"idle",text:r("apps.missing")}:{tone:"neutral",text:r("apps.unchecked")}},f=null!=(o=null==(s=d.settings)?void 0:s.brain)?o:"none",g="none"===f?r("apps.none"):"auto"===f?r("apps.auto"):null!=(i=null==(t=c.n.find(e=>e.value===f))?void 0:t.label)?i:f,N=!!(null==(l=d.settings)?void 0:l.voice),k=N&&null!==b&&!b.configured,y=N?k?{tone:"idle",text:"".concat(r("apps.jobs.voiceOn")," \xb7 ").concat(r("apps.key.missing"))}:{tone:"live",text:(null==b?void 0:b.configured)?"".concat(r("apps.jobs.voiceOn")," \xb7 ").concat(r("apps.key.configured")):r("apps.jobs.voiceOn")}:{tone:"neutral",text:r("apps.jobs.voiceOff")},w=[{label:r("apps.jobs.beforeApp"),tone:d.version?"live":"idle",text:d.version?"panoma video ".concat(d.version):r("apps.status.absent")},{label:r("apps.browser"),...v("browser")},{label:r("apps.ffmpeg"),...v("ffmpeg")},{label:r("apps.jobs.beforeBrain"),tone:"none"===f?"neutral":"live",text:g},{label:r("apps.jobs.beforeVoice"),...y},{label:r("apps.jobs.beforeProject"),tone:u?"live":"idle",text:u?x:r("apps.jobs.noIdentity")}],C=!!(d.ready&&!1!==d.enabled&&u&&!k);return(0,a.jsxs)("section",{className:"mt-5 ".concat(j),"aria-labelledby":"video-preflight-title",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,a.jsx)("h2",{id:"video-preflight-title",className:"font-display text-xl font-semibold",children:r("apps.jobs.beforeTitle")}),(0,a.jsx)(p.vw,{size:"md",tone:C?"live":"idle",children:r(C?"apps.jobs.beforeReady":"apps.jobs.beforeNotReady")})]}),(0,a.jsx)("p",{className:"mt-2 text-sm text-smoke",children:r("apps.jobs.beforeIntro")}),(0,a.jsx)("dl",{className:"mt-4 grid gap-x-6 gap-y-2 text-sm sm:grid-cols-2",children:w.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 border-t border-edge pt-2",children:[(0,a.jsx)("dt",{className:"text-smoke",children:e.label}),(0,a.jsx)("dd",{children:(0,a.jsx)(p.vw,{size:"md",tone:e.tone,children:e.text})})]},e.label))}),(0,a.jsx)(n(),{className:"mt-4 inline-block text-sm underline underline-offset-4",href:"/apps/panoma-video?project=".concat(encodeURIComponent(x)),children:r("apps.jobs.changeInApp")})]})}function g(e){let{value:s,tracks:t,onChange:l,label:n}=e;return(0,a.jsxs)("label",{className:"text-sm",children:[n,(0,a.jsx)("select",{className:b,value:s,onChange:e=>l(e.target.value),children:t.map(e=>(0,a.jsx)("option",{value:e,children:x[e]},e))})]})}function N(e){let{t:s,locked:t,onStart:l}=e,n=(0,r.Ym)(),[i,d]=(0,o.useState)("promo"),[c,p]=(0,o.useState)("v"),[m,u]=(0,o.useState)(n),[x,h]=(0,o.useState)("");return(0,a.jsxs)("form",{className:"mt-7 ".concat(j),onSubmit:e=>{e.preventDefault(),l({goal:i,format:c,language:m,url:x})},children:[(0,a.jsxs)("div",{className:"grid gap-4 sm:grid-cols-[1fr_auto_1fr]",children:[(0,a.jsxs)("label",{className:"text-sm",children:[s("apps.jobs.goal"),(0,a.jsxs)("select",{className:b,value:i,onChange:e=>d(e.target.value),children:[(0,a.jsx)("option",{value:"promo",children:s("apps.jobs.promo")}),(0,a.jsx)("option",{value:"tutorial",children:s("apps.jobs.tutorial")}),(0,a.jsx)("option",{value:"spotlight",children:s("apps.jobs.spotlight")})]})]}),(0,a.jsx)(v,{value:c,onChange:p,label:s("apps.jobs.format")}),(0,a.jsx)(g,{value:m,tracks:["es","en"],onChange:u,label:s("apps.jobs.language")})]}),(0,a.jsxs)("label",{className:"mt-4 block text-sm",children:[s("apps.jobs.url"),(0,a.jsx)("input",{className:b,type:"url",inputMode:"url",placeholder:"http://127.0.0.1:4173",value:x,onChange:e=>h(e.target.value)}),(0,a.jsx)("span",{className:"mt-1 block text-xs text-faint",children:s("apps.jobs.urlHint")})]}),(0,a.jsx)("button",{className:"apps-button apps-button-primary mt-5",disabled:t,children:s("apps.jobs.start")})]})}function k(e){let{state:s}=e;return"done"===s?(0,a.jsx)(i.mmf,{"aria-hidden":!0,className:"size-4 shrink-0 text-live"}):"failed"===s?(0,a.jsx)(i.fZH,{"aria-hidden":!0,className:"size-4 shrink-0 text-fail"}):"skipped"===s?(0,a.jsx)(i.YJZ,{"aria-hidden":!0,className:"size-4 shrink-0 text-faint"}):(0,a.jsx)("span",{"aria-hidden":!0,className:"flex size-4 shrink-0 items-center justify-center",children:(0,a.jsx)("span",{className:"size-2 rounded-full ".concat("current"===s?"bg-accent animate-pulse":"border border-edge-bright")})})}function y(e){let{t:s,job:t}=e,{asked:l,others:n}=(0,m.hY)(t);if(!l.length&&!n.length)return null;let o="string"==typeof t.input.goal?t.input.goal:"all",i=e=>{let t=m.i9[e];return t?s(t):e},r=l.length?l:n,d=l.length?n:[];return(0,a.jsxs)("div",{className:"mt-4 rounded border border-edge bg-raised p-3 text-sm",children:[(0,a.jsx)("p",{className:"text-smoke",children:"all"!==o&&l.length?s("apps.jobs.notPlanned",{goal:i(o)}):s("apps.jobs.notPlannedAny")}),(0,a.jsx)("ul",{className:"mt-2 space-y-2",children:r.map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)("p",{className:"font-semibold",children:i(e.goal)}),(0,a.jsx)("blockquote",{className:"mt-1 break-words",children:e.why})]},e.goal))}),d.length>0&&(0,a.jsxs)("details",{className:"mt-3",children:[(0,a.jsx)("summary",{className:"text-smoke",children:s("apps.jobs.otherGoals")}),(0,a.jsx)("ul",{className:"mt-2 space-y-2",children:d.map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)("p",{className:"font-semibold",children:i(e.goal)}),(0,a.jsx)("blockquote",{className:"mt-1 break-words text-smoke",children:e.why})]},e.goal))})]})]})}function w(e){var s,t;let{t:l,job:n,locked:i,onCancel:r}=e,c=m.Cn.has(n.status),[u,x]=(0,o.useState)(()=>Date.now());(0,o.useEffect)(()=>{if(!c)return;let e=setInterval(()=>x(Date.now()),1e3);return()=>clearInterval(e)},[c]);let b=(0,m.X0)(n),h=(0,m.p_)(n,u),v=c&&!m.I.includes(null!=(t=null==(s=n.progress)?void 0:s.stage)?t:""),f=b.find(e=>"plan"===e.name&&"failed"===e.state),{asked:g,others:N}=(0,m.hY)(n),w=!!(f&&(g.length||N.length));return(0,a.jsxs)("section",{className:"mt-7 ".concat(j),"aria-labelledby":"video-stages-title","aria-live":c?"polite":void 0,children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,a.jsx)("h2",{id:"video-stages-title",className:"font-display text-xl font-semibold",children:l(c?"apps.jobs.stages":"apps.jobs.report")}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[!c&&(0,a.jsx)(p.vw,{size:"md",tone:"done"===n.status?"live":"failed"===n.status?"fail":"neutral",children:l("apps.jobs.".concat("done"===n.status?"done":"failed"===n.status?"failed":"cancelled"))}),c&&r&&(0,a.jsx)("button",{className:"apps-button",disabled:i&&"cancelling"===n.status,onClick:()=>r(n),children:l("apps.jobs.cancel")})]})]}),void 0!==h&&(0,a.jsxs)("p",{className:"mt-2 text-sm text-smoke",children:[l(c?"apps.jobs.elapsed":"apps.jobs.took",{time:h<60?l("apps.jobs.seconds",{s:h}):l("apps.jobs.minutes",{m:Math.floor(h/60),s:h%60})}),n.requestedBy&&(0,a.jsxs)(a.Fragment,{children:[" ",l("apps.jobs.requestedBy",{name:n.requestedBy})]})]}),v&&(0,a.jsx)("p",{className:"mt-2 text-sm text-smoke",children:l("apps.jobs.starting")}),(0,a.jsx)("ol",{className:"mt-4 grid gap-x-6 gap-y-1 sm:grid-cols-2",children:b.map(e=>(0,a.jsxs)("li",{className:"flex gap-2 py-1 text-sm ".concat("pending"===e.state||"skipped"===e.state?"text-faint":"text-chalk"),"aria-current":"current"===e.state?"step":void 0,children:[(0,a.jsx)("span",{className:"mt-0.5",children:(0,a.jsx)(k,{state:e.state})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("p",{className:"current"===e.state?"font-semibold":"",children:[l("apps.jobs.stage.".concat(e.name)),(0,a.jsxs)("span",{className:"sr-only",children:[" \xb7 ",l("apps.jobs.stageState.".concat(e.state))]})]}),e.summary&&!("plan"===e.name&&w)&&(0,a.jsx)("blockquote",{className:"mt-0.5 break-words text-xs text-smoke",children:e.summary})]})]},e.name))}),!c&&n.error&&(0,a.jsx)(d.uV,{error:n.error}),f&&(0,a.jsx)(y,{t:l,job:n}),!c&&"done"===n.status&&(0,a.jsx)("p",{className:"mt-3 text-sm text-smoke",children:l("apps.jobs.reportDone")})]})}function C(e){var s;let{t,job:l,locked:n,onEnqueue:o}=e,i=(0,m.Zp)(l),r=i.find(e=>"video"===e.kind),d=i.find(e=>"image"===e.kind),c=l.result,p=null!=(s=null==c?void 0:c.renders)?s:(null==c?void 0:c.render_id)?[{id:c.render_id,file:""}]:[];return(0,a.jsxs)("section",{className:"mt-7 ".concat(j),children:[(0,a.jsx)("h2",{className:"font-display text-xl font-semibold",children:t("apps.jobs.preview")}),r&&(0,a.jsx)("video",{controls:!0,preload:"metadata",className:"mt-4 max-h-[540px] w-full rounded bg-raised",src:(0,m.Wk)(l.id,r.path),"aria-label":t("apps.jobs.preview")}),d&&(0,a.jsx)("a",{href:(0,m.Wk)(l.id,d.path),target:"_blank",rel:"noreferrer",children:(0,a.jsx)("img",{className:"mt-4 max-h-80 w-full rounded object-contain",src:(0,m.Wk)(l.id,d.path),alt:t("apps.jobs.contacts")})}),(0,a.jsx)("h3",{className:"mt-4 text-sm font-semibold",children:t("apps.jobs.artifacts")}),(0,a.jsx)("ul",{className:"mt-2 space-y-1 text-sm",children:i.map(e=>(0,a.jsx)("li",{children:(0,a.jsx)("a",{className:"break-all underline",href:(0,m.Wk)(l.id,e.path),download:e.name,children:e.name})},e.path))}),(0,a.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",children:p.map(e=>(0,a.jsxs)("button",{className:"apps-button",disabled:n,onClick:()=>o("panoma_video_review",{render_id:e.id}),children:[t("apps.jobs.review"),p.length>1?" \xb7 ".concat(e.id):""]},e.id))})]})}function _(e){var s;let{t,production:l,brief:n,historical:o,current:i,languages:r,format:d,language:c,locked:p,onFormat:b,onLanguage:h,onEnqueue:f,onOpenCurrent:N}=e;if(o)return(0,a.jsxs)("section",{className:"mt-5 ".concat(j),children:[(0,a.jsx)("p",{className:"text-sm text-smoke",children:t("apps.jobs.historical")}),i&&(0,a.jsx)("button",{className:"apps-button mt-3",onClick:()=>N(i.id),children:t("apps.jobs.current")})]});let k=n?t("apps.jobs.exportVariant",{format:null!=(s=u[d])?s:d,language:x[c]}):t("apps.jobs.export");return(0,a.jsxs)("section",{className:"mt-5 ".concat(j),children:[(0,a.jsx)("p",{className:"text-sm text-smoke",children:t("apps.jobs.savedStory")}),n&&(0,a.jsxs)("div",{className:"mt-4 grid gap-4 sm:grid-cols-[auto_1fr]",children:[(0,a.jsx)(v,{value:d,onChange:b,label:t("apps.jobs.format"),disabled:p}),(0,a.jsx)(g,{value:c,tracks:r,onChange:h,label:t("apps.jobs.language")})]}),(0,a.jsxs)("div",{className:"mt-4 flex flex-wrap gap-3",children:[(0,a.jsx)("button",{className:"apps-button",disabled:p,onClick:()=>{let e=(0,m.KU)(l,{language:c,format:d});f(e.tool,e.input)},children:k}),n&&(0,a.jsx)("button",{className:"apps-button",disabled:p,onClick:()=>f("panoma_video_story",{brief_id:n}),children:t("apps.jobs.story")})]})]})}function S(e){let{t:s,story:t,brief:l,language:n,format:i,locked:d,onEnqueue:c}=e,p=(0,r.Ym)(),[m,u]=(0,o.useState)(""),[x,h]=(0,o.useState)("");return(0,o.useEffect)(()=>{u(""),h("")},[t.revision,n]),(0,a.jsxs)("section",{className:"mt-7 ".concat(j),children:[(0,a.jsx)("h2",{className:"font-display text-xl font-semibold",children:s("apps.jobs.revise")}),(0,a.jsx)("p",{className:"mt-2 text-sm text-smoke",children:s("apps.jobs.revisionHelp")}),(0,a.jsxs)("label",{className:"mt-4 block text-sm",children:[s("apps.jobs.scene"),(0,a.jsxs)("select",{className:b,value:m,onChange:e=>{var s;u(e.target.value);let a=t.scenes.find(s=>s.id===e.target.value);h(null!=(s=null==a?void 0:a.text[n])?s:"")},children:[(0,a.jsx)("option",{value:"",children:"—"}),t.scenes.filter(e=>e.editable).map(e=>(0,a.jsxs)("option",{value:e.id,children:[e.id," \xb7 ",e.text[n]]},e.id))]})]}),(0,a.jsxs)("label",{className:"mt-4 block text-sm",children:[s("apps.jobs.revision"),(0,a.jsx)("textarea",{className:"mt-2 block min-h-28 w-full rounded border border-edge bg-surface p-3",value:x,maxLength:1e3,onChange:e=>h(e.target.value)})]}),(0,a.jsx)("button",{className:"apps-button mt-4",disabled:d||!m||!x.trim(),onClick:()=>c("panoma_video_revise",{brief_id:l,expectedRevision:t.revision,edits:[{kind:"text",sceneId:m,lang:n,text:x}]}),children:s("apps.jobs.revise")}),l&&(0,a.jsx)("button",{className:"apps-button ml-3 mt-4",disabled:d,onClick:()=>c("panoma_video_render",{brief_id:l,lang:n,format:i}),children:s("apps.jobs.start")}),t.history&&(0,a.jsxs)("details",{className:"mt-5",children:[(0,a.jsx)("summary",{className:"text-sm",children:s("apps.jobs.history")}),(0,a.jsx)("ul",{className:"mt-3 space-y-3",children:t.history.map(e=>(0,a.jsxs)("li",{className:"rounded border border-edge p-3",children:[(0,a.jsxs)("p",{className:"text-xs text-smoke",children:[new Date(e.at).toLocaleString(p)," \xb7 ",e.number]}),(0,a.jsx)("blockquote",{className:"mt-1 text-sm",children:e.note}),e.revision!==t.revision&&(0,a.jsx)("button",{className:"apps-button mt-2",disabled:d,onClick:()=>c("panoma_video_revise",{brief_id:l,expectedRevision:t.revision,restoreRevision:e.revision}),children:s("apps.jobs.restore")})]},e.revision))})]})]})}function E(e){var s,t;let{t:l,job:n}=e,o=n.result,i=null!=(s=null==o?void 0:o.checks)?s:[];return(0,a.jsxs)("details",{className:"mt-4 rounded border border-edge p-4",children:[(0,a.jsx)("summary",{children:l("apps.jobs.reviewStatus",{status:null!=(t=null==o?void 0:o.status)?t:n.status})}),(0,a.jsx)("h3",{className:"mt-3 text-sm font-semibold",children:l("apps.jobs.reviewChecks")}),(0,a.jsx)("ul",{className:"mt-2 space-y-2 text-sm",children:i.map(e=>{var s;return(0,a.jsxs)("li",{className:"rounded border border-edge p-3",children:[(0,a.jsxs)("p",{className:"font-mono text-xs",children:[e.id," \xb7 ",e.status]}),(0,a.jsx)("blockquote",{className:"mt-1",children:e.summary}),e.threshold&&(0,a.jsx)("p",{className:"mt-1 text-xs text-smoke",children:e.threshold}),(null==(s=e.fix)?void 0:s.hint)&&(0,a.jsx)("blockquote",{className:"mt-1 text-xs text-smoke",children:e.fix.hint})]},e.id)})})]})}function q(e){let{t:s,jobs:t,locked:l,onCancel:n,onEnqueue:o}=e;return(0,a.jsxs)("section",{className:"mt-8",children:[(0,a.jsx)("h2",{className:"font-display text-xl font-semibold",children:s("apps.jobs.title")}),(0,a.jsx)(d.jY,{jobs:t,onCancel:n}),t.filter(e=>"failed"===e.status||"cancelled"===e.status).map(e=>(0,a.jsxs)("button",{className:"apps-button mr-2 mt-3",disabled:l,onClick:()=>o(e.tool,e.input),children:[s("apps.jobs.retry")," \xb7 ",e.tool]},e.id)),t.filter(e=>"panoma_video_review"===e.tool&&e.result).map(e=>(0,a.jsx)(E,{t:s,job:e},e.id))]})}function I(e){var s,t,l;let{projectId:i,identity:c,slug:p}=e,u=(0,r.kj)(),x=(0,r.Ym)(),[j,h]=(0,o.useState)(null),[v,g]=(0,o.useState)([]),[k,y]=(0,o.useState)(null),[E,I]=(0,o.useState)(!1),[z,O]=(0,o.useState)(""),[R,P]=(0,o.useState)(null),[T,Y]=(0,o.useState)(null),[A,D]=(0,o.useState)(null),F=(0,o.useCallback)(async()=>{try{let e=await (0,m.Tl)("/api/apps/panoma-video");if(h(e),c){let e="identity=".concat(encodeURIComponent(c)),s=await (0,m.Tl)("/api/apps/panoma-video/jobs?".concat(e));g(s.jobs)}y(null)}catch(e){y(e.message)}},[c]);(0,o.useEffect)(()=>{F()},[F]);let U=!!(null==j||null==(s=j.settings)?void 0:s.voice);(0,o.useEffect)(()=>{if(!U)return void D(null);let e=new AbortController;return(0,m.Tl)("/api/apps/panoma-video/credentials",void 0,"GET",e.signal).then(s=>{e.signal.aborted||D(s)}).catch(()=>{e.signal.aborted||D(null)}),()=>e.abort()},[U]);let B=v.find(e=>m.Cn.has(e.status)),L=null==B?void 0:B.id;(0,o.useEffect)(()=>{if(!L)return;let e=new AbortController;return(0,m.E4)(L,e.signal,e=>{g(s=>s.map(s=>s.id===e.id?e:s)),y(null),m.Cn.has(e.status)||F()},y),()=>e.abort()},[L,F]);let V=(0,o.useCallback)((e,s)=>{c&&(I(!0),y(null),(0,m.Tl)("/api/apps/panoma-video/jobs",{identity:c,projectId:i,tool:e,input:s}).then(F).catch(e=>y(e.message)).finally(()=>I(!1)))},[c,i,F]),W=v.filter(e=>e.result&&"panoma_video_auto"===e.tool&&"done"===e.status),H=null!=(t=W.find(e=>e.id===z))?t:W[0],M=v.find(e=>"panoma_video_auto"===e.tool),{brief:Z,job:G}=(0,m.Lu)(v,H),J=null==G?void 0:G.result,K=(0,m.nn)(v,H),Q=!!(H&&(null==K?void 0:K.id)!==H.id),X=(0,m.Ht)(H,G),$=R&&X.includes(R)?R:X[0],ee=null==H?void 0:H.input.format,es=null!=T?T:(0,m.Fv)(ee)?ee:"v";(0,o.useEffect)(()=>{P(null),Y(null)},[null==H?void 0:H.id]);let et=E||!!B||!(null==j?void 0:j.ready)||!1===j.enabled||!c,ea=v.filter(e=>"panoma_video_review"!==e.tool&&(0,m.Zp)(e).length>0&&(!Q||e.id===(null==H?void 0:H.id))&&("panoma_video_auto"!==e.tool||e.id===(null==H?void 0:H.id))),el=e=>{(0,m.Tl)("/api/apps/jobs/".concat(e.id,"/cancel"),{}).then(F).catch(e=>y(e.message))};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.uV,{error:k}),!c&&(0,a.jsx)("p",{className:"mt-5 rounded border border-edge p-4 text-sm",children:u("apps.jobs.noIdentity")}),j&&(!j.ready||!1===j.enabled)&&(0,a.jsxs)("div",{className:"mt-5 rounded border border-edge p-4",children:[(0,a.jsx)("p",{className:"text-sm",children:u("apps.needsSetup")}),(0,a.jsx)(n(),{className:"apps-button mt-3 inline-flex",href:"/apps/panoma-video?project=".concat(encodeURIComponent(p)),children:u("apps.open")})]}),j&&(0,a.jsx)(f,{t:u,app:j,identity:c,slug:p,credential:A}),(0,a.jsx)(N,{t:u,locked:et,onStart:e=>V("panoma_video_auto",(0,m.EQ)(e))}),B&&(0,a.jsx)(w,{t:u,job:B,locked:et,onCancel:el}),!B&&M&&"done"!==M.status&&(0,a.jsx)(w,{t:u,job:M,locked:et}),W.length>1&&(0,a.jsxs)("label",{className:"mt-6 block text-sm",children:[u("apps.jobs.chooseProduction"),(0,a.jsx)("select",{className:b,value:null!=(l=null==H?void 0:H.id)?l:"",onChange:e=>O(e.target.value),children:W.map(e=>{var s,t;let l=null==(s=e.result.briefs)?void 0:s.map(e=>e.id).join(", "),n=new Date(null!=(t=e.requestedAt)?t:"").toLocaleString(x);return(0,a.jsxs)("option",{value:e.id,children:[n," \xb7 ",null!=l?l:e.id]},e.id)})})]}),ea.map(e=>(0,a.jsx)(C,{t:u,job:e,locked:et,onEnqueue:V},e.id)),H&&(0,a.jsx)(_,{t:u,production:H,brief:Z,historical:Q,current:K,languages:X,format:es,language:$,locked:et,onFormat:Y,onLanguage:P,onEnqueue:V,onOpenCurrent:O}),!Q&&(null==J?void 0:J.scenes)&&J.revision&&(0,a.jsx)(S,{t:u,story:J,brief:Z,language:$,format:es,locked:et,onEnqueue:V}),(0,a.jsx)(q,{t:u,jobs:v,locked:et,onCancel:el,onEnqueue:V})]})}},13187:(e,s,t)=>{Promise.resolve().then(t.bind(t,4737)),Promise.resolve().then(t.t.bind(t,3953,23))}},e=>{e.O(0,[6587,3953,2575,2948,1369,2921,1305,6823,7358],()=>e(e.s=13187)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1080],{4737:(e,s,t)=>{"use strict";t.d(s,{VideoProduction:()=>I});var a=t(38657),l=t(3953),n=t.n(l),o=t(32165),i=t(3043),r=t(9144),d=t(57776),c=t(76982),p=t(52948),m=t(97234);let u=Object.fromEntries(m.t3.map(e=>[e.value,e.ratio])),x={es:"Espa\xf1ol",en:"English"},b="mt-2 block w-full rounded border border-edge bg-surface p-2",j="rounded-xl border border-edge p-5";function h(e){let{width:s,height:t}=e,l=s>=t?22:Math.round(22*s/t),n=t>=s?22:Math.round(22*t/s);return(0,a.jsx)("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",className:"size-6 shrink-0",children:(0,a.jsx)("rect",{x:(24-l)/2,y:(24-n)/2,width:l,height:n,rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})})}function v(e){let{value:s,onChange:t,label:l,disabled:n=!1}=e,i=(0,r.kj)(),d=(0,o.useId)();return(0,a.jsxs)("fieldset",{className:"min-w-0 text-sm",disabled:n,children:[(0,a.jsx)("legend",{children:l}),(0,a.jsx)("div",{className:"mt-2 grid grid-cols-3 gap-2",children:m.t3.map(e=>{let l=s===e.value;return(0,a.jsxs)("label",{className:"flex cursor-pointer flex-col items-center gap-1 rounded border px-2 py-2 text-center has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-accent ".concat(l?"border-accent bg-raised text-chalk":"border-edge text-smoke hover:border-edge-bright"),title:i("apps.jobs.formatFor".concat(e.value.toUpperCase())),children:[(0,a.jsx)("input",{type:"radio",name:d,value:e.value,checked:l,onChange:()=>t(e.value),className:"sr-only"}),(0,a.jsx)(h,{width:e.width,height:e.height}),(0,a.jsx)("span",{className:"text-xs font-semibold",children:i(e.key)}),(0,a.jsx)("span",{className:"font-mono text-[10px] text-faint",children:e.ratio}),(0,a.jsx)("span",{className:"sr-only",children:i("apps.jobs.formatFor".concat(e.value.toUpperCase()))})]},e.value)})})]})}function f(e){var s,t,l,o,i;let{t:r,app:d,identity:u,slug:x,credential:b}=e,h=(0,m.CG)(d),v=e=>{let s=h.find(s=>s.id===e);return(null==s?void 0:s.present)===!0?{tone:"live",text:r("apps.present")}:(null==s?void 0:s.present)===!1?{tone:"idle",text:r("apps.missing")}:{tone:"neutral",text:r("apps.unchecked")}},f=null!=(o=null==(s=d.settings)?void 0:s.brain)?o:"none",g="none"===f?r("apps.none"):"auto"===f?r("apps.auto"):null!=(i=null==(t=c.n.find(e=>e.value===f))?void 0:t.label)?i:f,N=!!(null==(l=d.settings)?void 0:l.voice),k=N&&null!==b&&!b.configured,y=N?k?{tone:"idle",text:"".concat(r("apps.jobs.voiceOn")," \xb7 ").concat(r("apps.key.missing"))}:{tone:"live",text:(null==b?void 0:b.configured)?"".concat(r("apps.jobs.voiceOn")," \xb7 ").concat(r("apps.key.configured")):r("apps.jobs.voiceOn")}:{tone:"neutral",text:r("apps.jobs.voiceOff")},w=[{label:r("apps.jobs.beforeApp"),tone:d.version?"live":"idle",text:d.version?"panoma video ".concat(d.version):r("apps.status.absent")},{label:r("apps.browser"),...v("browser")},{label:r("apps.ffmpeg"),...v("ffmpeg")},{label:r("apps.jobs.beforeBrain"),tone:"none"===f?"neutral":"live",text:g},{label:r("apps.jobs.beforeVoice"),...y},{label:r("apps.jobs.beforeProject"),tone:u?"live":"idle",text:u?x:r("apps.jobs.noIdentity")}],C=!!(d.ready&&!1!==d.enabled&&u&&!k);return(0,a.jsxs)("section",{className:"mt-5 ".concat(j),"aria-labelledby":"video-preflight-title",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,a.jsx)("h2",{id:"video-preflight-title",className:"font-display text-xl font-semibold",children:r("apps.jobs.beforeTitle")}),(0,a.jsx)(p.vw,{size:"md",tone:C?"live":"idle",children:r(C?"apps.jobs.beforeReady":"apps.jobs.beforeNotReady")})]}),(0,a.jsx)("p",{className:"mt-2 text-sm text-smoke",children:r("apps.jobs.beforeIntro")}),(0,a.jsx)("dl",{className:"mt-4 grid gap-x-6 gap-y-2 text-sm sm:grid-cols-2",children:w.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 border-t border-edge pt-2",children:[(0,a.jsx)("dt",{className:"text-smoke",children:e.label}),(0,a.jsx)("dd",{children:(0,a.jsx)(p.vw,{size:"md",tone:e.tone,children:e.text})})]},e.label))}),(0,a.jsx)(n(),{className:"mt-4 inline-block text-sm underline underline-offset-4",href:"/apps/panoma-video?project=".concat(encodeURIComponent(x)),children:r("apps.jobs.changeInApp")})]})}function g(e){let{value:s,tracks:t,onChange:l,label:n}=e;return(0,a.jsxs)("label",{className:"text-sm",children:[n,(0,a.jsx)("select",{className:b,value:s,onChange:e=>l(e.target.value),children:t.map(e=>(0,a.jsx)("option",{value:e,children:x[e]},e))})]})}function N(e){let{t:s,locked:t,onStart:l}=e,n=(0,r.Ym)(),[i,d]=(0,o.useState)("promo"),[c,p]=(0,o.useState)("v"),[m,u]=(0,o.useState)(n),[x,h]=(0,o.useState)("");return(0,a.jsxs)("form",{className:"mt-7 ".concat(j),onSubmit:e=>{e.preventDefault(),l({goal:i,format:c,language:m,url:x})},children:[(0,a.jsxs)("div",{className:"grid gap-4 sm:grid-cols-[1fr_auto_1fr]",children:[(0,a.jsxs)("label",{className:"text-sm",children:[s("apps.jobs.goal"),(0,a.jsxs)("select",{className:b,value:i,onChange:e=>d(e.target.value),children:[(0,a.jsx)("option",{value:"promo",children:s("apps.jobs.promo")}),(0,a.jsx)("option",{value:"tutorial",children:s("apps.jobs.tutorial")}),(0,a.jsx)("option",{value:"spotlight",children:s("apps.jobs.spotlight")})]})]}),(0,a.jsx)(v,{value:c,onChange:p,label:s("apps.jobs.format")}),(0,a.jsx)(g,{value:m,tracks:["es","en"],onChange:u,label:s("apps.jobs.language")})]}),(0,a.jsxs)("label",{className:"mt-4 block text-sm",children:[s("apps.jobs.url"),(0,a.jsx)("input",{className:b,type:"url",inputMode:"url",placeholder:"http://127.0.0.1:4173",value:x,onChange:e=>h(e.target.value)}),(0,a.jsx)("span",{className:"mt-1 block text-xs text-faint",children:s("apps.jobs.urlHint")})]}),(0,a.jsx)("button",{className:"apps-button apps-button-primary mt-5",disabled:t,children:s("apps.jobs.start")})]})}function k(e){let{state:s}=e;return"done"===s?(0,a.jsx)(i.mmf,{"aria-hidden":!0,className:"size-4 shrink-0 text-live"}):"failed"===s?(0,a.jsx)(i.fZH,{"aria-hidden":!0,className:"size-4 shrink-0 text-fail"}):"skipped"===s?(0,a.jsx)(i.YJZ,{"aria-hidden":!0,className:"size-4 shrink-0 text-faint"}):(0,a.jsx)("span",{"aria-hidden":!0,className:"flex size-4 shrink-0 items-center justify-center",children:(0,a.jsx)("span",{className:"size-2 rounded-full ".concat("current"===s?"bg-accent animate-pulse":"border border-edge-bright")})})}function y(e){let{t:s,job:t}=e,{asked:l,others:n}=(0,m.hY)(t);if(!l.length&&!n.length)return null;let o="string"==typeof t.input.goal?t.input.goal:"all",i=e=>{let t=m.i9[e];return t?s(t):e},r=l.length?l:n,d=l.length?n:[];return(0,a.jsxs)("div",{className:"mt-4 rounded border border-edge bg-raised p-3 text-sm",children:[(0,a.jsx)("p",{className:"text-smoke",children:"all"!==o&&l.length?s("apps.jobs.notPlanned",{goal:i(o)}):s("apps.jobs.notPlannedAny")}),(0,a.jsx)("ul",{className:"mt-2 space-y-2",children:r.map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)("p",{className:"font-semibold",children:i(e.goal)}),(0,a.jsx)("blockquote",{className:"mt-1 break-words",children:e.why})]},e.goal))}),d.length>0&&(0,a.jsxs)("details",{className:"mt-3",children:[(0,a.jsx)("summary",{className:"text-smoke",children:s("apps.jobs.otherGoals")}),(0,a.jsx)("ul",{className:"mt-2 space-y-2",children:d.map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)("p",{className:"font-semibold",children:i(e.goal)}),(0,a.jsx)("blockquote",{className:"mt-1 break-words text-smoke",children:e.why})]},e.goal))})]})]})}function w(e){var s,t;let{t:l,job:n,locked:i,onCancel:r}=e,c=m.Cn.has(n.status),[u,x]=(0,o.useState)(()=>Date.now());(0,o.useEffect)(()=>{if(!c)return;let e=setInterval(()=>x(Date.now()),1e3);return()=>clearInterval(e)},[c]);let b=(0,m.X0)(n),h=(0,m.p_)(n,u),v=c&&!m.I.includes(null!=(t=null==(s=n.progress)?void 0:s.stage)?t:""),f=b.find(e=>"plan"===e.name&&"failed"===e.state),{asked:g,others:N}=(0,m.hY)(n),w=!!(f&&(g.length||N.length));return(0,a.jsxs)("section",{className:"mt-7 ".concat(j),"aria-labelledby":"video-stages-title","aria-live":c?"polite":void 0,children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,a.jsx)("h2",{id:"video-stages-title",className:"font-display text-xl font-semibold",children:l(c?"apps.jobs.stages":"apps.jobs.report")}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[!c&&(0,a.jsx)(p.vw,{size:"md",tone:"done"===n.status?"live":"failed"===n.status?"fail":"neutral",children:l("apps.jobs.".concat("done"===n.status?"done":"failed"===n.status?"failed":"cancelled"))}),c&&r&&(0,a.jsx)("button",{className:"apps-button",disabled:i&&"cancelling"===n.status,onClick:()=>r(n),children:l("apps.jobs.cancel")})]})]}),void 0!==h&&(0,a.jsxs)("p",{className:"mt-2 text-sm text-smoke",children:[l(c?"apps.jobs.elapsed":"apps.jobs.took",{time:h<60?l("apps.jobs.seconds",{s:h}):l("apps.jobs.minutes",{m:Math.floor(h/60),s:h%60})}),n.requestedBy&&(0,a.jsxs)(a.Fragment,{children:[" ",l("apps.jobs.requestedBy",{name:n.requestedBy})]})]}),v&&(0,a.jsx)("p",{className:"mt-2 text-sm text-smoke",children:l("apps.jobs.starting")}),(0,a.jsx)("ol",{className:"mt-4 grid gap-x-6 gap-y-1 sm:grid-cols-2",children:b.map(e=>(0,a.jsxs)("li",{className:"flex gap-2 py-1 text-sm ".concat("pending"===e.state||"skipped"===e.state?"text-faint":"text-chalk"),"aria-current":"current"===e.state?"step":void 0,children:[(0,a.jsx)("span",{className:"mt-0.5",children:(0,a.jsx)(k,{state:e.state})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("p",{className:"current"===e.state?"font-semibold":"",children:[l("apps.jobs.stage.".concat(e.name)),(0,a.jsxs)("span",{className:"sr-only",children:[" \xb7 ",l("apps.jobs.stageState.".concat(e.state))]})]}),e.summary&&!("plan"===e.name&&w)&&(0,a.jsx)("blockquote",{className:"mt-0.5 break-words text-xs text-smoke",children:e.summary})]})]},e.name))}),!c&&n.error&&(0,a.jsx)(d.uV,{error:n.error}),f&&(0,a.jsx)(y,{t:l,job:n}),!c&&"done"===n.status&&(0,a.jsx)("p",{className:"mt-3 text-sm text-smoke",children:l("apps.jobs.reportDone")})]})}function C(e){var s;let{t,job:l,locked:n,onEnqueue:o}=e,i=(0,m.Zp)(l),r=i.find(e=>"video"===e.kind),d=i.find(e=>"image"===e.kind),c=l.result,p=null!=(s=null==c?void 0:c.renders)?s:(null==c?void 0:c.render_id)?[{id:c.render_id,file:""}]:[];return(0,a.jsxs)("section",{className:"mt-7 ".concat(j),children:[(0,a.jsx)("h2",{className:"font-display text-xl font-semibold",children:t("apps.jobs.preview")}),r&&(0,a.jsx)("video",{controls:!0,preload:"metadata",className:"mt-4 max-h-[540px] w-full rounded bg-raised",src:(0,m.Wk)(l.id,r.path),"aria-label":t("apps.jobs.preview")}),d&&(0,a.jsx)("a",{href:(0,m.Wk)(l.id,d.path),target:"_blank",rel:"noreferrer",children:(0,a.jsx)("img",{className:"mt-4 max-h-80 w-full rounded object-contain",src:(0,m.Wk)(l.id,d.path),alt:t("apps.jobs.contacts")})}),(0,a.jsx)("h3",{className:"mt-4 text-sm font-semibold",children:t("apps.jobs.artifacts")}),(0,a.jsx)("ul",{className:"mt-2 space-y-1 text-sm",children:i.map(e=>(0,a.jsx)("li",{children:(0,a.jsx)("a",{className:"break-all underline",href:(0,m.Wk)(l.id,e.path),download:e.name,children:e.name})},e.path))}),(0,a.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",children:p.map(e=>(0,a.jsxs)("button",{className:"apps-button",disabled:n,onClick:()=>o("panoma_video_review",{render_id:e.id}),children:[t("apps.jobs.review"),p.length>1?" \xb7 ".concat(e.id):""]},e.id))})]})}function _(e){var s;let{t,production:l,brief:n,historical:o,current:i,languages:r,format:d,language:c,locked:p,onFormat:b,onLanguage:h,onEnqueue:f,onOpenCurrent:N}=e;if(o)return(0,a.jsxs)("section",{className:"mt-5 ".concat(j),children:[(0,a.jsx)("p",{className:"text-sm text-smoke",children:t("apps.jobs.historical")}),i&&(0,a.jsx)("button",{className:"apps-button mt-3",onClick:()=>N(i.id),children:t("apps.jobs.current")})]});let k=n?t("apps.jobs.exportVariant",{format:null!=(s=u[d])?s:d,language:x[c]}):t("apps.jobs.export");return(0,a.jsxs)("section",{className:"mt-5 ".concat(j),children:[(0,a.jsx)("p",{className:"text-sm text-smoke",children:t("apps.jobs.savedStory")}),n&&(0,a.jsxs)("div",{className:"mt-4 grid gap-4 sm:grid-cols-[auto_1fr]",children:[(0,a.jsx)(v,{value:d,onChange:b,label:t("apps.jobs.format"),disabled:p}),(0,a.jsx)(g,{value:c,tracks:r,onChange:h,label:t("apps.jobs.language")})]}),(0,a.jsxs)("div",{className:"mt-4 flex flex-wrap gap-3",children:[(0,a.jsx)("button",{className:"apps-button",disabled:p,onClick:()=>{let e=(0,m.KU)(l,{language:c,format:d});f(e.tool,e.input)},children:k}),n&&(0,a.jsx)("button",{className:"apps-button",disabled:p,onClick:()=>f("panoma_video_story",{brief_id:n}),children:t("apps.jobs.story")})]})]})}function S(e){let{t:s,story:t,brief:l,language:n,format:i,locked:d,onEnqueue:c}=e,p=(0,r.Ym)(),[m,u]=(0,o.useState)(""),[x,h]=(0,o.useState)("");return(0,o.useEffect)(()=>{u(""),h("")},[t.revision,n]),(0,a.jsxs)("section",{className:"mt-7 ".concat(j),children:[(0,a.jsx)("h2",{className:"font-display text-xl font-semibold",children:s("apps.jobs.revise")}),(0,a.jsx)("p",{className:"mt-2 text-sm text-smoke",children:s("apps.jobs.revisionHelp")}),(0,a.jsxs)("label",{className:"mt-4 block text-sm",children:[s("apps.jobs.scene"),(0,a.jsxs)("select",{className:b,value:m,onChange:e=>{var s;u(e.target.value);let a=t.scenes.find(s=>s.id===e.target.value);h(null!=(s=null==a?void 0:a.text[n])?s:"")},children:[(0,a.jsx)("option",{value:"",children:"—"}),t.scenes.filter(e=>e.editable).map(e=>(0,a.jsxs)("option",{value:e.id,children:[e.id," \xb7 ",e.text[n]]},e.id))]})]}),(0,a.jsxs)("label",{className:"mt-4 block text-sm",children:[s("apps.jobs.revision"),(0,a.jsx)("textarea",{className:"mt-2 block min-h-28 w-full rounded border border-edge bg-surface p-3",value:x,maxLength:1e3,onChange:e=>h(e.target.value)})]}),(0,a.jsx)("button",{className:"apps-button mt-4",disabled:d||!m||!x.trim(),onClick:()=>c("panoma_video_revise",{brief_id:l,expectedRevision:t.revision,edits:[{kind:"text",sceneId:m,lang:n,text:x}]}),children:s("apps.jobs.revise")}),l&&(0,a.jsx)("button",{className:"apps-button ml-3 mt-4",disabled:d,onClick:()=>c("panoma_video_render",{brief_id:l,lang:n,format:i}),children:s("apps.jobs.start")}),t.history&&(0,a.jsxs)("details",{className:"mt-5",children:[(0,a.jsx)("summary",{className:"text-sm",children:s("apps.jobs.history")}),(0,a.jsx)("ul",{className:"mt-3 space-y-3",children:t.history.map(e=>(0,a.jsxs)("li",{className:"rounded border border-edge p-3",children:[(0,a.jsxs)("p",{className:"text-xs text-smoke",children:[new Date(e.at).toLocaleString(p)," \xb7 ",e.number]}),(0,a.jsx)("blockquote",{className:"mt-1 text-sm",children:e.note}),e.revision!==t.revision&&(0,a.jsx)("button",{className:"apps-button mt-2",disabled:d,onClick:()=>c("panoma_video_revise",{brief_id:l,expectedRevision:t.revision,restoreRevision:e.revision}),children:s("apps.jobs.restore")})]},e.revision))})]})]})}function E(e){var s,t;let{t:l,job:n}=e,o=n.result,i=null!=(s=null==o?void 0:o.checks)?s:[];return(0,a.jsxs)("details",{className:"mt-4 rounded border border-edge p-4",children:[(0,a.jsx)("summary",{children:l("apps.jobs.reviewStatus",{status:null!=(t=null==o?void 0:o.status)?t:n.status})}),(0,a.jsx)("h3",{className:"mt-3 text-sm font-semibold",children:l("apps.jobs.reviewChecks")}),(0,a.jsx)("ul",{className:"mt-2 space-y-2 text-sm",children:i.map(e=>{var s;return(0,a.jsxs)("li",{className:"rounded border border-edge p-3",children:[(0,a.jsxs)("p",{className:"font-mono text-xs",children:[e.id," \xb7 ",e.status]}),(0,a.jsx)("blockquote",{className:"mt-1",children:e.summary}),e.threshold&&(0,a.jsx)("p",{className:"mt-1 text-xs text-smoke",children:e.threshold}),(null==(s=e.fix)?void 0:s.hint)&&(0,a.jsx)("blockquote",{className:"mt-1 text-xs text-smoke",children:e.fix.hint})]},e.id)})})]})}function q(e){let{t:s,jobs:t,locked:l,onCancel:n,onEnqueue:o}=e;return(0,a.jsxs)("section",{className:"mt-8",children:[(0,a.jsx)("h2",{className:"font-display text-xl font-semibold",children:s("apps.jobs.title")}),(0,a.jsx)(d.jY,{jobs:t,onCancel:n}),t.filter(e=>"failed"===e.status||"cancelled"===e.status).map(e=>(0,a.jsxs)("button",{className:"apps-button mr-2 mt-3",disabled:l,onClick:()=>o(e.tool,e.input),children:[s("apps.jobs.retry")," \xb7 ",e.tool]},e.id)),t.filter(e=>"panoma_video_review"===e.tool&&e.result).map(e=>(0,a.jsx)(E,{t:s,job:e},e.id))]})}function I(e){var s,t,l;let{projectId:i,identity:c,slug:p}=e,u=(0,r.kj)(),x=(0,r.Ym)(),[j,h]=(0,o.useState)(null),[v,g]=(0,o.useState)([]),[k,y]=(0,o.useState)(null),[E,I]=(0,o.useState)(!1),[z,O]=(0,o.useState)(""),[R,P]=(0,o.useState)(null),[T,Y]=(0,o.useState)(null),[A,D]=(0,o.useState)(null),F=(0,o.useCallback)(async()=>{try{let e=await (0,m.Tl)("/api/apps/panoma-video");if(h(e),c){let e="identity=".concat(encodeURIComponent(c)),s=await (0,m.Tl)("/api/apps/panoma-video/jobs?".concat(e));g(s.jobs)}y(null)}catch(e){y(e.message)}},[c]);(0,o.useEffect)(()=>{F()},[F]);let U=!!(null==j||null==(s=j.settings)?void 0:s.voice);(0,o.useEffect)(()=>{if(!U)return void D(null);let e=new AbortController;return(0,m.Tl)("/api/apps/panoma-video/credentials",void 0,"GET",e.signal).then(s=>{e.signal.aborted||D(s)}).catch(()=>{e.signal.aborted||D(null)}),()=>e.abort()},[U]);let B=v.find(e=>m.Cn.has(e.status)),L=null==B?void 0:B.id;(0,o.useEffect)(()=>{if(!L)return;let e=new AbortController;return(0,m.E4)(L,e.signal,e=>{g(s=>s.map(s=>s.id===e.id?e:s)),y(null),m.Cn.has(e.status)||F()},y),()=>e.abort()},[L,F]);let V=(0,o.useCallback)((e,s)=>{c&&(I(!0),y(null),(0,m.Tl)("/api/apps/panoma-video/jobs",{identity:c,projectId:i,tool:e,input:s}).then(F).catch(e=>y(e.message)).finally(()=>I(!1)))},[c,i,F]),W=v.filter(e=>e.result&&"panoma_video_auto"===e.tool&&"done"===e.status),H=null!=(t=W.find(e=>e.id===z))?t:W[0],M=v.find(e=>"panoma_video_auto"===e.tool),{brief:Z,job:G}=(0,m.Lu)(v,H),J=null==G?void 0:G.result,K=(0,m.nn)(v,H),Q=!!(H&&(null==K?void 0:K.id)!==H.id),X=(0,m.Ht)(H,G),$=R&&X.includes(R)?R:X[0],ee=null==H?void 0:H.input.format,es=null!=T?T:(0,m.Fv)(ee)?ee:"v";(0,o.useEffect)(()=>{P(null),Y(null)},[null==H?void 0:H.id]);let et=E||!!B||!(null==j?void 0:j.ready)||!1===j.enabled||!c,ea=v.filter(e=>"panoma_video_review"!==e.tool&&(0,m.Zp)(e).length>0&&(!Q||e.id===(null==H?void 0:H.id))&&("panoma_video_auto"!==e.tool||e.id===(null==H?void 0:H.id))),el=e=>{(0,m.Tl)("/api/apps/jobs/".concat(e.id,"/cancel"),{}).then(F).catch(e=>y(e.message))};return(0,a.jsxs)(a.Fragment,{children:[!c&&(0,a.jsx)("p",{className:"mt-5 rounded border border-edge p-4 text-sm",children:u("apps.jobs.noIdentity")}),j&&(!j.ready||!1===j.enabled)&&(0,a.jsxs)("div",{className:"mt-5 rounded border border-edge p-4",children:[(0,a.jsx)("p",{className:"text-sm",children:u("apps.needsSetup")}),(0,a.jsx)(n(),{className:"apps-button mt-3 inline-flex",href:"/apps/panoma-video?project=".concat(encodeURIComponent(p)),children:u("apps.open")})]}),j&&(0,a.jsx)(f,{t:u,app:j,identity:c,slug:p,credential:A}),(0,a.jsx)(N,{t:u,locked:et,onStart:e=>V("panoma_video_auto",(0,m.EQ)(e))}),(0,a.jsx)(d.uV,{error:k}),B&&(0,a.jsx)(w,{t:u,job:B,locked:et,onCancel:el}),!B&&M&&"done"!==M.status&&(0,a.jsx)(w,{t:u,job:M,locked:et}),W.length>1&&(0,a.jsxs)("label",{className:"mt-6 block text-sm",children:[u("apps.jobs.chooseProduction"),(0,a.jsx)("select",{className:b,value:null!=(l=null==H?void 0:H.id)?l:"",onChange:e=>O(e.target.value),children:W.map(e=>{var s,t;let l=null==(s=e.result.briefs)?void 0:s.map(e=>e.id).join(", "),n=new Date(null!=(t=e.requestedAt)?t:"").toLocaleString(x);return(0,a.jsxs)("option",{value:e.id,children:[n," \xb7 ",null!=l?l:e.id]},e.id)})})]}),ea.map(e=>(0,a.jsx)(C,{t:u,job:e,locked:et,onEnqueue:V},e.id)),H&&(0,a.jsx)(_,{t:u,production:H,brief:Z,historical:Q,current:K,languages:X,format:es,language:$,locked:et,onFormat:Y,onLanguage:P,onEnqueue:V,onOpenCurrent:O}),!Q&&(null==J?void 0:J.scenes)&&J.revision&&(0,a.jsx)(S,{t:u,story:J,brief:Z,language:$,format:es,locked:et,onEnqueue:V}),(0,a.jsx)(q,{t:u,jobs:v,locked:et,onCancel:el,onEnqueue:V})]})}},40707:(e,s,t)=>{Promise.resolve().then(t.bind(t,4737)),Promise.resolve().then(t.t.bind(t,3953,23))}},e=>{e.O(0,[6587,3953,2575,2948,1369,2921,1305,6823,7358],()=>e(e.s=40707)),_N_E=e.O()}]);
|