maestro-flow 0.3.10 → 0.3.12
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/.claude/agents/conceptual-planning-agent.md +1 -0
- package/.claude/agents/workflow-analyzer.md +114 -114
- package/.claude/agents/workflow-collab-planner.md +144 -144
- package/.claude/agents/workflow-debugger.md +102 -103
- package/.claude/agents/workflow-executor.md +127 -128
- package/.claude/agents/workflow-integration-checker.md +82 -82
- package/.claude/agents/workflow-nyquist-auditor.md +85 -84
- package/.claude/agents/workflow-phase-researcher.md +85 -85
- package/.claude/agents/workflow-plan-checker.md +90 -90
- package/.claude/agents/workflow-planner.md +178 -178
- package/.claude/agents/workflow-roadmapper.md +81 -83
- package/.claude/agents/workflow-verifier.md +119 -119
- package/.claude/commands/learn-decompose.md +176 -176
- package/.claude/commands/learn-follow.md +167 -167
- package/.claude/commands/learn-retro.md +3 -3
- package/.claude/commands/learn-second-opinion.md +2 -2
- package/.claude/commands/maestro-brainstorm.md +1 -0
- package/.claude/commands/maestro-coordinate.md +1 -3
- package/.claude/commands/maestro-fork.md +133 -111
- package/.claude/commands/maestro-merge.md +85 -77
- package/.claude/commands/maestro-plan.md +88 -2
- package/.claude/commands/maestro-roadmap.md +113 -2
- package/.claude/commands/maestro.md +1 -0
- package/.claude/commands/manage-harvest.md +131 -131
- package/.claude/commands/manage-issue.md +2 -2
- package/.claude/commands/quality-business-test.md +5 -5
- package/.claude/commands/quality-debug.md +3 -2
- package/.claude/commands/quality-retrospective.md +6 -4
- package/.claude/commands/quality-review.md +1 -1
- package/.claude/commands/quality-test-gen.md +5 -4
- package/.claude/commands/spec-add.md +67 -56
- package/.claude/commands/spec-load.md +66 -64
- package/.claude/commands/spec-setup.md +5 -9
- package/.codex/skills/learn-decompose/SKILL.md +119 -0
- package/.codex/skills/learn-follow/SKILL.md +83 -0
- package/.codex/skills/learn-investigate/SKILL.md +83 -0
- package/.codex/skills/learn-retro/SKILL.md +83 -0
- package/.codex/skills/learn-second-opinion/SKILL.md +86 -0
- package/.codex/skills/maestro/SKILL.md +151 -279
- package/.codex/skills/maestro-analyze/SKILL.md +59 -71
- package/.codex/skills/maestro-brainstorm/SKILL.md +452 -463
- package/.codex/skills/maestro-chain/SKILL.md +95 -110
- package/.codex/skills/maestro-coordinate/SKILL.md +68 -234
- package/.codex/skills/maestro-execute/SKILL.md +435 -446
- package/.codex/skills/maestro-fork/SKILL.md +98 -0
- package/.codex/skills/maestro-init/SKILL.md +172 -167
- package/.codex/skills/maestro-learn/SKILL.md +80 -0
- package/.codex/skills/maestro-link-coordinate/SKILL.md +224 -220
- package/.codex/skills/maestro-merge/SKILL.md +69 -0
- package/.codex/skills/maestro-milestone-audit/SKILL.md +108 -103
- package/.codex/skills/maestro-milestone-complete/SKILL.md +155 -149
- package/.codex/skills/maestro-milestone-release/SKILL.md +70 -0
- package/.codex/skills/maestro-overlay/SKILL.md +188 -185
- package/.codex/skills/maestro-plan/SKILL.md +58 -69
- package/.codex/skills/maestro-quick/SKILL.md +26 -23
- package/.codex/skills/maestro-roadmap/SKILL.md +65 -73
- package/.codex/skills/maestro-spec-generate/SKILL.md +66 -74
- package/.codex/skills/maestro-ui-design/SKILL.md +35 -32
- package/.codex/skills/maestro-verify/SKILL.md +556 -566
- package/.codex/skills/manage-codebase-rebuild/SKILL.md +397 -405
- package/.codex/skills/manage-codebase-refresh/SKILL.md +93 -82
- package/.codex/skills/manage-harvest/SKILL.md +82 -0
- package/.codex/skills/manage-issue/SKILL.md +80 -65
- package/.codex/skills/manage-issue-discover/SKILL.md +491 -503
- package/.codex/skills/manage-learn/SKILL.md +190 -186
- package/.codex/skills/manage-memory/SKILL.md +95 -72
- package/.codex/skills/manage-memory-capture/SKILL.md +99 -86
- package/.codex/skills/manage-status/SKILL.md +102 -89
- package/.codex/skills/quality-business-test/SKILL.md +228 -223
- package/.codex/skills/quality-debug/SKILL.md +54 -66
- package/.codex/skills/quality-integration-test/SKILL.md +532 -544
- package/.codex/skills/quality-refactor/SKILL.md +197 -191
- package/.codex/skills/quality-retrospective/SKILL.md +512 -505
- package/.codex/skills/quality-review/SKILL.md +95 -107
- package/.codex/skills/quality-sync/SKILL.md +101 -89
- package/.codex/skills/quality-test/SKILL.md +202 -198
- package/.codex/skills/quality-test-gen/SKILL.md +94 -105
- package/.codex/skills/spec-add/SKILL.md +58 -39
- package/.codex/skills/spec-load/SKILL.md +45 -40
- package/.codex/skills/spec-map/SKILL.md +180 -182
- package/.codex/skills/spec-setup/SKILL.md +94 -76
- package/.codex/skills/team-coordinate/SKILL.md +346 -357
- package/.codex/skills/team-executor/SKILL.md +70 -112
- package/.codex/skills/team-lifecycle-v4/SKILL.md +311 -299
- package/.codex/skills/team-quality-assurance/SKILL.md +234 -227
- package/.codex/skills/team-review/SKILL.md +232 -225
- package/.codex/skills/team-tech-debt/SKILL.md +78 -100
- package/.codex/skills/team-testing/SKILL.md +242 -235
- package/.codex/skills/wiki-connect/SKILL.md +75 -0
- package/.codex/skills/wiki-digest/SKILL.md +87 -0
- package/README.md +9 -4
- package/README.zh-CN.md +9 -4
- package/dashboard/dist/assets/{ArtifactsPage-DZNCi6tn.js → ArtifactsPage-CUrrDGgN.js} +1 -1
- package/dashboard/dist/assets/ChatInput-pUOLJIKE.js +49 -0
- package/dashboard/dist/assets/ChatPage-B8Xqkt0v.js +27 -0
- package/dashboard/dist/assets/{CollabPage-B4NAHXS2.js → CollabPage-DIUXeazv.js} +1 -1
- package/dashboard/dist/assets/{ExecutionPanel-CFt4LJyq.js → ExecutionPanel-VmYeADFj.js} +1 -1
- package/dashboard/dist/assets/KanbanPage-DLq8v7hg.js +21 -0
- package/dashboard/dist/assets/{MarkdownRenderer-X4af_WNb.js → MarkdownRenderer-D7AehrnR.js} +1 -1
- package/dashboard/dist/assets/{McpPage-BKfCVIyU.js → McpPage-BY0SjTgw.js} +2 -2
- package/dashboard/dist/assets/{OutputPanel-BlBQFJSW.js → OutputPanel-B-Rjwgmv.js} +1 -1
- package/dashboard/dist/assets/{ProblemsPanel-De3DLvoI.js → ProblemsPanel-GEpF-oi4.js} +1 -1
- package/dashboard/dist/assets/RequirementBoardPage-xs8uDM7I.js +6 -0
- package/dashboard/dist/assets/{RequirementPage-Bllxe2XI.js → RequirementPage-BKDSFwjA.js} +5 -10
- package/dashboard/dist/assets/SpecsPage-DLFb9ZH0.js +36 -0
- package/dashboard/dist/assets/SupervisorPage-SOki_kgz.js +6 -0
- package/dashboard/dist/assets/TeamsPage-BO2kP70F.js +11 -0
- package/dashboard/dist/assets/{TreeBrowser-Q12qobZs.js → TreeBrowser-B9DHdULE.js} +1 -1
- package/dashboard/dist/assets/{WorkflowPage-D_Fzdy3_.js → WorkflowPage-C8hWbYim.js} +1 -1
- package/dashboard/dist/assets/{check-u6fGOwQO.js → check-DJDk3A2a.js} +1 -1
- package/dashboard/dist/assets/{chevron-right-Csu22t58.js → chevron-right-C7bVDreZ.js} +1 -1
- package/dashboard/dist/assets/{circle-CMrkbRNg.js → circle-Qfgy4LB_.js} +1 -1
- package/dashboard/dist/assets/{circle-alert-c3tH1P4z.js → circle-alert-Na1vf6qQ.js} +1 -1
- package/dashboard/dist/assets/{circle-check-gYxxSYuH.js → circle-check-CEGgy3NV.js} +1 -1
- package/dashboard/dist/assets/{circle-check-big-TDSeWstm.js → circle-check-big-3JB8zRYj.js} +1 -1
- package/dashboard/dist/assets/{code-CFN2uX9V.js → code-Ble63Idz.js} +1 -1
- package/dashboard/dist/assets/{columns-3-38xIDlzy.js → columns-3-BUcKlxve.js} +1 -1
- package/dashboard/dist/assets/{download-DC7KkKyP.js → download-CMqkfn8x.js} +1 -1
- package/dashboard/dist/assets/{folder-CWq_lAnf.js → folder-B9ewx9LL.js} +1 -1
- package/dashboard/dist/assets/index-C2Mcb4TJ.js +231 -0
- package/dashboard/dist/assets/index-DyBbPc18.css +1 -0
- package/dashboard/dist/assets/{index-Do71weNR.js → index-JTmGteaT.js} +1 -1
- package/dashboard/dist/assets/{list-CgIP_2A-.js → list-DI8Wn2aT.js} +1 -1
- package/dashboard/dist/assets/loader-B5F6PzFT.js +11 -0
- package/dashboard/dist/assets/{minus-DYoN5UGk.js → minus-Lp_BfctG.js} +1 -1
- package/dashboard/dist/assets/{pen-line-Bh_WKYHm.js → pen-line-Ch7sphzZ.js} +1 -1
- package/dashboard/dist/assets/pencil-_yRMHmGT.js +6 -0
- package/dashboard/dist/assets/{proxy-BKxDAKTj.js → proxy-D72Y8a4Y.js} +1 -1
- package/dashboard/dist/assets/{search-SieXnOgr.js → search-BS6fI6Bg.js} +1 -1
- package/dashboard/dist/assets/{shallow-Bme1JY57.js → shallow-BXasQBvr.js} +1 -1
- package/dashboard/dist/assets/table-CeGlFjlP.js +6 -0
- package/dashboard/dist/assets/{terminal-BB3Xfuv5.js → terminal-BJic2yW-.js} +1 -1
- package/dashboard/dist/assets/{trash-2-C8f4vFFM.js → trash-2-Czz4X8Fb.js} +1 -1
- package/dashboard/dist/assets/{zap-4uwlzVm0.js → zap-C3H0jVFA.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist-server/dashboard/src/server/agents/agent-manager.js +16 -1
- package/dashboard/dist-server/dashboard/src/server/agents/agent-manager.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/delegate-broker-monitor.js +1 -2
- package/dashboard/dist-server/dashboard/src/server/agents/delegate-broker-monitor.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/commander/commander-prompts.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/server/commander/commander-prompts.js +2 -1
- package/dashboard/dist-server/dashboard/src/server/commander/commander-prompts.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/index.js +3 -0
- package/dashboard/dist-server/dashboard/src/server/index.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/collab.js +124 -0
- package/dashboard/dist-server/dashboard/src/server/routes/collab.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/specs.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/specs.js +75 -30
- package/dashboard/dist-server/dashboard/src/server/routes/specs.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/state/event-bus.d.ts +5 -0
- package/dashboard/dist-server/dashboard/src/server/state/event-bus.js +5 -0
- package/dashboard/dist-server/dashboard/src/server/state/event-bus.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/ws/handlers/team-handler.d.ts +10 -0
- package/dashboard/dist-server/dashboard/src/server/ws/handlers/team-handler.js +73 -0
- package/dashboard/dist-server/dashboard/src/server/ws/handlers/team-handler.js.map +1 -0
- package/dashboard/dist-server/dashboard/src/shared/collab-types.d.ts +31 -0
- package/dashboard/dist-server/dashboard/src/shared/collab-types.js +28 -0
- package/dashboard/dist-server/dashboard/src/shared/collab-types.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/constants.js +10 -0
- package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/coordinate-types.d.ts +22 -0
- package/dashboard/dist-server/dashboard/src/shared/issue-types.d.ts +12 -0
- package/dashboard/dist-server/dashboard/src/shared/issue-types.js +12 -0
- package/dashboard/dist-server/dashboard/src/shared/issue-types.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/team-types.d.ts +22 -0
- package/dashboard/dist-server/dashboard/src/shared/team-types.js +7 -0
- package/dashboard/dist-server/dashboard/src/shared/team-types.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/types.d.ts +3 -2
- package/dashboard/dist-server/dashboard/src/shared/ws-protocol.d.ts +28 -2
- package/dashboard/dist-server/dashboard/src/shared/ws-protocol.js.map +1 -1
- package/dashboard/dist-server/shared/agent-types.d.ts +4 -0
- package/dashboard/dist-server/src/hooks/constants.d.ts +3 -1
- package/dashboard/dist-server/src/hooks/constants.js +4 -2
- package/dashboard/dist-server/src/hooks/constants.js.map +1 -1
- package/dist/shared/agent-types.d.ts +4 -0
- package/dist/shared/agent-types.d.ts.map +1 -1
- package/dist/src/commands/collab.js +4 -4
- package/dist/src/commands/collab.js.map +1 -1
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +66 -1
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/install-backend.d.ts.map +1 -1
- package/dist/src/commands/install-backend.js +29 -18
- package/dist/src/commands/install-backend.js.map +1 -1
- package/dist/src/commands/spec.d.ts.map +1 -1
- package/dist/src/commands/spec.js +7 -2
- package/dist/src/commands/spec.js.map +1 -1
- package/dist/src/hooks/__tests__/statusline-visual-test.js +23 -1
- package/dist/src/hooks/__tests__/statusline-visual-test.js.map +1 -1
- package/dist/src/hooks/constants.d.ts +3 -1
- package/dist/src/hooks/constants.d.ts.map +1 -1
- package/dist/src/hooks/constants.js +4 -2
- package/dist/src/hooks/constants.js.map +1 -1
- package/dist/src/hooks/guards/index.d.ts +1 -0
- package/dist/src/hooks/guards/index.d.ts.map +1 -1
- package/dist/src/hooks/guards/index.js +1 -0
- package/dist/src/hooks/guards/index.js.map +1 -1
- package/dist/src/hooks/guards/spec-validator.d.ts +25 -0
- package/dist/src/hooks/guards/spec-validator.d.ts.map +1 -0
- package/dist/src/hooks/guards/spec-validator.js +66 -0
- package/dist/src/hooks/guards/spec-validator.js.map +1 -0
- package/dist/src/hooks/keyword-spec-injector.d.ts +21 -0
- package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -0
- package/dist/src/hooks/keyword-spec-injector.js +96 -0
- package/dist/src/hooks/keyword-spec-injector.js.map +1 -0
- package/dist/src/hooks/plugins/spec-injection-plugin.d.ts +2 -1
- package/dist/src/hooks/plugins/spec-injection-plugin.d.ts.map +1 -1
- package/dist/src/hooks/plugins/spec-injection-plugin.js +21 -12
- package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
- package/dist/src/hooks/skill-context.d.ts +3 -0
- package/dist/src/hooks/skill-context.d.ts.map +1 -1
- package/dist/src/hooks/skill-context.js +95 -9
- package/dist/src/hooks/skill-context.js.map +1 -1
- package/dist/src/hooks/spec-bridge.d.ts +40 -0
- package/dist/src/hooks/spec-bridge.d.ts.map +1 -0
- package/dist/src/hooks/spec-bridge.js +97 -0
- package/dist/src/hooks/spec-bridge.js.map +1 -0
- package/dist/src/hooks/spec-injector.d.ts.map +1 -1
- package/dist/src/hooks/spec-injector.js +18 -12
- package/dist/src/hooks/spec-injector.js.map +1 -1
- package/dist/src/hooks/statusline.d.ts.map +1 -1
- package/dist/src/hooks/statusline.js +6 -3
- package/dist/src/hooks/statusline.js.map +1 -1
- package/dist/src/team/phase-orchestrator.d.ts +52 -0
- package/dist/src/team/phase-orchestrator.d.ts.map +1 -0
- package/dist/src/team/phase-orchestrator.js +165 -0
- package/dist/src/team/phase-orchestrator.js.map +1 -0
- package/dist/src/team/phase-types.d.ts +51 -0
- package/dist/src/team/phase-types.d.ts.map +1 -0
- package/dist/src/team/phase-types.js +41 -0
- package/dist/src/team/phase-types.js.map +1 -0
- package/dist/src/tools/index.d.ts.map +1 -1
- package/dist/src/tools/index.js +6 -0
- package/dist/src/tools/index.js.map +1 -1
- package/dist/src/tools/merge-validator.d.ts.map +1 -1
- package/dist/src/tools/merge-validator.js +114 -16
- package/dist/src/tools/merge-validator.js.map +1 -1
- package/dist/src/tools/spec-entry-parser.d.ts +56 -0
- package/dist/src/tools/spec-entry-parser.d.ts.map +1 -0
- package/dist/src/tools/spec-entry-parser.js +196 -0
- package/dist/src/tools/spec-entry-parser.js.map +1 -0
- package/dist/src/tools/spec-init.d.ts.map +1 -1
- package/dist/src/tools/spec-init.js +66 -92
- package/dist/src/tools/spec-init.js.map +1 -1
- package/dist/src/tools/spec-keyword-index.d.ts +30 -0
- package/dist/src/tools/spec-keyword-index.d.ts.map +1 -0
- package/dist/src/tools/spec-keyword-index.js +101 -0
- package/dist/src/tools/spec-keyword-index.js.map +1 -0
- package/dist/src/tools/spec-loader.d.ts +3 -3
- package/dist/src/tools/spec-loader.d.ts.map +1 -1
- package/dist/src/tools/spec-loader.js +49 -23
- package/dist/src/tools/spec-loader.js.map +1 -1
- package/dist/src/tools/team-agents.d.ts +27 -0
- package/dist/src/tools/team-agents.d.ts.map +1 -0
- package/dist/src/tools/team-agents.js +362 -0
- package/dist/src/tools/team-agents.js.map +1 -0
- package/dist/src/tools/team-mailbox.d.ts +40 -0
- package/dist/src/tools/team-mailbox.d.ts.map +1 -0
- package/dist/src/tools/team-mailbox.js +384 -0
- package/dist/src/tools/team-mailbox.js.map +1 -0
- package/dist/src/tools/team-msg.d.ts +17 -8
- package/dist/src/tools/team-msg.d.ts.map +1 -1
- package/dist/src/tools/team-msg.js +110 -13
- package/dist/src/tools/team-msg.js.map +1 -1
- package/dist/src/tools/team-tasks-mcp.d.ts +27 -0
- package/dist/src/tools/team-tasks-mcp.d.ts.map +1 -0
- package/dist/src/tools/team-tasks-mcp.js +408 -0
- package/dist/src/tools/team-tasks-mcp.js.map +1 -0
- package/package.json +2 -1
- package/shared/agent-types.ts +4 -0
- package/templates/worktree-scope.json +9 -10
- package/templates/worktrees.json +26 -27
- package/workflows/analyze.md +816 -816
- package/workflows/brainstorm.md +480 -471
- package/workflows/codebase-rebuild.md +332 -332
- package/workflows/codebase-refresh.md +240 -240
- package/workflows/debug.md +16 -6
- package/workflows/execute.md +1 -1
- package/workflows/fork.md +100 -36
- package/workflows/harvest.md +420 -420
- package/workflows/integration-test.md +355 -343
- package/workflows/issue-discover.md +414 -414
- package/workflows/issue.md +14 -4
- package/workflows/learn.md +19 -5
- package/workflows/maestro.md +1 -0
- package/workflows/map.md +111 -111
- package/workflows/merge.md +113 -55
- package/workflows/milestone-complete.md +176 -176
- package/workflows/plan.md +1 -1
- package/workflows/quick.md +497 -497
- package/workflows/refactor.md +300 -300
- package/workflows/retrospective.md +61 -22
- package/workflows/review.md +17 -4
- package/workflows/roadmap.md +335 -335
- package/workflows/spec-generate.md +640 -640
- package/workflows/specs-add.md +46 -81
- package/workflows/specs-load.md +15 -17
- package/workflows/specs-setup.md +40 -161
- package/workflows/test.md +12 -2
- package/workflows/ui-style.md +9 -2
- package/dashboard/dist/assets/ChatInput-Bvr-FeEq.js +0 -49
- package/dashboard/dist/assets/ChatPage-D9zTkJZo.js +0 -22
- package/dashboard/dist/assets/KanbanPage-C8USth6H.js +0 -21
- package/dashboard/dist/assets/RequirementBoardPage-Bf1trzqs.js +0 -11
- package/dashboard/dist/assets/SpecsPage-9lwxKT27.js +0 -36
- package/dashboard/dist/assets/SupervisorPage-SusdfHFq.js +0 -6
- package/dashboard/dist/assets/TeamsPage-DsuM6OwC.js +0 -6
- package/dashboard/dist/assets/arrow-left-Bqtb2hle.js +0 -6
- package/dashboard/dist/assets/index-DWG-WrzT.js +0 -231
- package/dashboard/dist/assets/index-GUNJodSR.css +0 -1
- package/dashboard/dist/assets/table-llyEtj-7.js +0 -6
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{j as e,u as ee,a as ce,S as L,r as p,b as D,c as O,s as R,L as Pe,g as P,I as $,C as te,d as F,e as K,R as fe,P as be,O as ye,f as je,T as Ne,h as we,i as ke,k as Oe,l as $e,m as de,V as Re,n as Ie}from"./index-DWG-WrzT.js";import{u as G}from"./shallow-Bme1JY57.js";import{S as Me,P as Ke,L as Ue,a as U,T as Fe,D as He,K as We}from"./table-llyEtj-7.js";import{C as Ve}from"./circle-check-big-TDSeWstm.js";import{M as Ye,C as qe}from"./ChatInput-Bvr-FeEq.js";import{D as Ge}from"./download-DC7KkKyP.js";import"./zap-4uwlzVm0.js";import"./MarkdownRenderer-X4af_WNb.js";import"./chevron-right-Csu22t58.js";import"./terminal-BB3Xfuv5.js";import"./circle-alert-c3tH1P4z.js";function Xe({chips:t,active:a,onSelect:r}){return e.jsx("div",{className:"flex items-center gap-[var(--spacing-1-5)] overflow-x-auto shrink-0",children:t.map(n=>{const o=n===a;return e.jsx("button",{type:"button",onClick:()=>r(n),className:["px-[var(--spacing-3)] py-[var(--spacing-1)]","text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] whitespace-nowrap","transition-all duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",o?"":"hover:text-text-primary"].join(" "),style:o?{borderRadius:"var(--style-chip-radius)",border:"var(--style-chip-border)",backgroundColor:"var(--style-chip-active-bg)",color:"var(--style-chip-active-color)"}:{borderRadius:"var(--style-chip-radius)",border:"var(--style-chip-border)",backgroundColor:"var(--color-bg-card)",color:"var(--color-text-secondary)"},children:n},n)})})}const Qe={pending:"var(--color-tint-pending)",exploring:"var(--color-tint-exploring)",planning:"var(--color-tint-planning)",executing:"var(--color-tint-executing)",verifying:"var(--color-tint-verifying)",testing:"var(--color-tint-testing)",completed:"var(--color-tint-completed)",blocked:"var(--color-tint-blocked)"};function Je({phase:t}){const{t:a}=ee(),r=ce(g=>g.setSelectedPhase),o=ce(g=>g.selectedPhase)===t.phase;function d(){r(o?null:t.phase)}function c(g){(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),d())}const{tasks_completed:i,tasks_total:l,current_wave:x}=t.execution,h=a("kanban.wave");return e.jsx("article",{role:"listitem",children:e.jsxs("div",{role:"button",tabIndex:0,"aria-label":a("kanban.phase_aria",{phase:t.phase,title:t.title,status:t.status,completed:i,total:l}),"aria-pressed":o,onClick:d,onKeyDown:c,className:["rounded-[10px] px-[var(--spacing-4)] py-[var(--spacing-3)] space-y-[var(--spacing-2)] cursor-pointer","transition-all duration-[var(--duration-normal)] ease-[var(--ease-spring)]","hover:shadow-[0_4px_12px_rgba(0,0,0,0.08)] hover:-translate-y-0.5","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]","active:scale-[0.98] active:shadow-sm active:duration-[var(--duration-fast)]",o?"shadow-[inset_0_0_0_2px_var(--color-accent-blue)]":""].join(" "),style:{backgroundColor:Qe[t.status]??"var(--color-tint-pending)"},children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Me,{status:t.status,cardVariant:!0}),e.jsxs("span",{className:"text-[length:var(--font-size-xs)] font-mono text-text-tertiary",children:["P-",String(t.phase).padStart(2,"0")]})]}),e.jsx("h4",{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)] text-text-primary leading-[var(--line-height-tight)]",children:t.title}),t.goal&&e.jsx("p",{className:"text-[length:var(--font-size-sm)] text-text-secondary leading-[var(--line-height-normal)] line-clamp-2",children:t.goal}),l>0&&e.jsx(Ke,{completed:i,total:l,color:L[t.status]}),t.status==="executing"&&x>0&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] text-status-executing",children:[e.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-status-executing animate-pulse motion-reduce:animate-none"}),e.jsxs("span",{children:[h," ",x]})]})]})})}function Ze({issue:t,selected:a,onSelect:r}){const n=Ue[t.priority];function o(d){(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r())}return e.jsx("article",{role:"listitem",children:e.jsxs("div",{role:"button",tabIndex:0,"aria-label":`${t.identifier}: ${t.title}. Priority: ${U[t.priority]}`,"aria-pressed":a,onClick:r,onKeyDown:o,className:["rounded-[10px] px-[var(--spacing-4)] py-[var(--spacing-3)] space-y-[var(--spacing-2)] cursor-pointer","transition-all duration-[var(--duration-normal)] ease-[var(--ease-spring)]","hover:shadow-[0_4px_12px_rgba(0,0,0,0.08)] hover:-translate-y-0.5","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]","active:scale-[0.98] active:shadow-sm active:duration-[var(--duration-fast)]","bg-bg-card",a?"shadow-[inset_0_0_0_2px_var(--color-accent-blue)]":""].join(" "),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)]",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:`#${t.state.color}`},"aria-hidden":"true"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-mono font-[var(--font-weight-medium)] text-text-tertiary",children:t.identifier})]}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-2 py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:`${n}20`,color:n},children:U[t.priority]})]}),e.jsx("h4",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary leading-snug line-clamp-2",children:t.title}),e.jsxs("div",{className:"flex items-center justify-between gap-[var(--spacing-2)]",children:[e.jsx("div",{className:"flex gap-[var(--spacing-1)] flex-wrap min-w-0",children:t.labels.slice(0,3).map(d=>e.jsx("span",{className:"text-[length:10px] px-1.5 py-0.5 rounded-full truncate max-w-[80px]",style:{backgroundColor:`#${d.color}20`,color:`#${d.color}`},title:d.name,children:d.name},d.id))}),t.assignee&&e.jsx("span",{className:"w-5 h-5 rounded-full bg-bg-hover shrink-0 flex items-center justify-center text-[length:10px] font-[var(--font-weight-semibold)] text-text-secondary",title:t.assignee.displayName,children:t.assignee.displayName.charAt(0).toUpperCase()})]})]})})}const et={bug:"#C46555",feature:"#5B8DB8",improvement:"#9178B5",task:"#A09D97"},tt={urgent:"#C46555",high:"#B89540",medium:"#5B8DB8",low:"#A09D97"},rt=[{value:"claude-code",label:"Claude"},{value:"codex",label:"Codex"},{value:"gemini",label:"Gemini"},{value:"agent-sdk",label:"Agent SDK"}],at={running:{icon:"●",color:"#B89540",animate:!0},queued:{icon:"◷",color:"#5B8DB8"},completed:{icon:"✓",color:"#5A9E78"},failed:{icon:"✕",color:"#C46555"},retrying:{icon:"↻",color:"#B89540",animate:!0}};function st({issue:t,selected:a,onSelect:r,batchMode:n,isChecked:o,onToggleCheck:d}){var z;const c=et[t.type]??"#A09D97",i=tt[t.priority]??"#A09D97",[l,x]=p.useState(!1),[h,g]=p.useState(t.executor??"claude-code"),m=D(j=>j.isIssueRunning(t.id)),y=D(j=>j.openCliPanel),k=O(j=>j.updateIssue),N=(z=t.execution)==null?void 0:z.status,u=N?at[N]:null,b=p.useCallback(j=>{j.stopPropagation(),R({action:"execute:issue",issueId:t.id,executor:h})},[t.id,h]),C=p.useCallback(j=>{j.stopPropagation();const B=j.target.value;g(B),k(t.id,{executor:B})},[t.id,k]),v=p.useCallback(j=>{j.stopPropagation(),d==null||d(t.id)},[t.id,d]),s=p.useCallback(j=>{j.stopPropagation(),y(t.id)},[t.id,y]);function S(j){(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),r())}return e.jsx("article",{role:"listitem",children:e.jsxs("div",{role:"button",tabIndex:0,"aria-label":`${t.title}. Type: ${t.type}. Priority: ${t.priority}`,"aria-pressed":a,onClick:r,onKeyDown:S,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),className:["group/card relative rounded-[10px] px-[var(--spacing-4)] py-[var(--spacing-3)] space-y-[var(--spacing-2)] cursor-pointer","transition-all duration-[var(--duration-normal)] ease-[var(--ease-spring)]","hover:shadow-[0_4px_12px_rgba(0,0,0,0.08)] hover:-translate-y-0.5","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]","active:scale-[0.98] active:shadow-sm active:duration-[var(--duration-fast)]","bg-bg-card motion-safe:animate-[card-enter_200ms_ease-out_both]",a?"shadow-[inset_0_0_0_2px_var(--color-accent-blue)]":"shadow-[var(--shadow-sm)]"].join(" "),children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)]",children:[(n||l)&&e.jsx("div",{onClick:v,className:["shrink-0 w-4 h-4 rounded border-[1.5px] flex items-center justify-center text-[9px] transition-all duration-100 cursor-pointer",o?"bg-accent-blue border-accent-blue text-white scale-100":"border-border hover:border-text-secondary"].join(" "),style:o?{backgroundColor:"var(--color-accent-blue)",borderColor:"var(--color-accent-blue)"}:{},children:o&&"✓"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-2 py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:`${c}20`,color:c},children:t.type}),t.path&&e.jsx("span",{className:"text-[10px] font-medium px-1.5 py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:"var(--color-bg-secondary)",color:"var(--color-text-tertiary)",border:"1px solid var(--color-border)"},children:t.path}),t.solution&&e.jsxs("span",{className:"text-[10px] font-medium px-1.5 py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:"#9178B520",color:"#9178B5"},children:[t.solution.steps.length," steps"]}),t.phase_id!=null&&e.jsxs(Pe,{to:`/workflow?phase=${t.phase_id}`,onClick:j=>j.stopPropagation(),className:"text-[10px] font-medium px-1.5 py-[var(--spacing-0-5)] rounded-full no-underline transition-colors",style:{backgroundColor:"rgba(91, 141, 184, 0.1)",color:"#5B8DB8"},title:`Go to Phase ${t.phase_id}`,children:["P-",String(t.phase_id).padStart(2,"0")]}),u&&e.jsx("span",{className:["text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)]",u.animate?"animate-pulse":""].join(" "),style:{color:u.color},title:`Execution: ${N}`,onClick:m?s:void 0,children:u.icon}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-2 py-[var(--spacing-0-5)] rounded-full ml-auto",style:{backgroundColor:`${i}20`,color:i},children:t.priority})]}),e.jsx("h4",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary leading-snug line-clamp-2",children:t.title}),e.jsxs("div",{className:"flex items-center justify-between",children:[(()=>{const j=P(t),B=$[j];return e.jsx("span",{className:"text-[length:10px]",style:{color:B},children:j.replace("_"," ")})})(),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)]",children:[e.jsx("select",{value:h,onChange:C,onClick:j=>j.stopPropagation(),className:["text-[length:10px] bg-transparent border border-border rounded px-1 py-0.5 text-text-secondary cursor-pointer","transition-opacity",l||a?"opacity-100":"opacity-0"].join(" "),"aria-label":"Select executor",children:rt.map(j=>e.jsx("option",{value:j.value,children:j.label},j.value))}),!m&&t.status!=="resolved"&&t.status!=="closed"&&e.jsx("button",{type:"button",onClick:b,className:["w-5 h-5 flex items-center justify-center rounded-[var(--radius-sm)] text-text-tertiary hover:text-accent-blue hover:bg-bg-hover transition-all",l||a?"opacity-100":"opacity-0"].join(" "),"aria-label":"Execute issue",title:"Execute issue",children:e.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("polygon",{points:"5,3 19,12 5,21"})})}),m&&e.jsx("button",{type:"button",onClick:s,className:"w-5 h-5 flex items-center justify-center rounded-[var(--radius-sm)] text-[#B89540] hover:bg-bg-hover transition-all","aria-label":"View execution output",title:"View execution output",children:e.jsx("svg",{className:"w-3 h-3 animate-spin",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",strokeLinecap:"round"})})})]})]})]})})}const ot=[{value:"task",label:"Task",color:"#A09D97"},{value:"bug",label:"Bug",color:"#C46555"},{value:"feature",label:"Feature",color:"#5B8DB8"},{value:"improvement",label:"Improve",color:"#9178B5"}],nt=[{value:"urgent",label:"Urgent",color:"#C46555"},{value:"high",label:"High",color:"#B89540"},{value:"medium",label:"Medium",color:"#5B8DB8"},{value:"low",label:"Low",color:"#A09D97"}];function lt({columnId:t,onClose:a,onCreated:r}){const[n,o]=p.useState(""),[d,c]=p.useState("task"),[i,l]=p.useState("medium"),[x,h]=p.useState(!1),g=p.useRef(null),m=p.useRef(null),y=O(u=>u.createIssue);p.useEffect(()=>{requestAnimationFrame(()=>{var u;return(u=g.current)==null?void 0:u.focus()})},[]),p.useEffect(()=>{function u(b){m.current&&!m.current.contains(b.target)&&a()}return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[a]);async function k(){const u=n.trim();!u||x||(h(!0),await y({title:u,description:"",type:d,priority:i}),h(!1),o(""),r==null||r(),a())}function N(u){u.key==="Enter"&&!u.shiftKey?(u.preventDefault(),k()):u.key==="Escape"&&(u.preventDefault(),a())}return e.jsxs("div",{ref:m,className:"rounded-[10px] border-2 border-dashed border-accent-blue/40 bg-bg-card px-[var(--spacing-3)] py-[var(--spacing-2-5)] space-y-[var(--spacing-2)] motion-safe:animate-[fade-in_100ms_ease-out]",children:[e.jsx("input",{ref:g,type:"text",value:n,onChange:u=>o(u.target.value),onKeyDown:N,placeholder:"Issue title...",disabled:x,className:"w-full bg-transparent text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary placeholder:text-text-tertiary outline-none"}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx("div",{className:"flex gap-[var(--spacing-0-5)]",children:ot.map(u=>e.jsx("button",{type:"button",onClick:()=>c(u.value),className:["text-[length:10px] font-[var(--font-weight-medium)] px-[var(--spacing-1-5)] py-[1px] rounded-full transition-all duration-[var(--duration-fast)]",d===u.value?"ring-1 ring-current":"opacity-50 hover:opacity-80"].join(" "),style:{backgroundColor:`${u.color}20`,color:u.color},children:u.label},u.value))}),e.jsx("div",{className:"w-px h-3 bg-border-divider"}),e.jsx("div",{className:"flex gap-[var(--spacing-0-5)]",children:nt.map(u=>e.jsx("button",{type:"button",onClick:()=>l(u.value),className:["text-[length:10px] font-[var(--font-weight-medium)] px-[var(--spacing-1-5)] py-[1px] rounded-full transition-all duration-[var(--duration-fast)]",i===u.value?"ring-1 ring-current":"opacity-50 hover:opacity-80"].join(" "),style:{backgroundColor:`${u.color}20`,color:u.color},children:u.label},u.value))})]}),e.jsxs("div",{className:"flex items-center justify-between text-[length:10px] text-text-tertiary",children:[e.jsxs("span",{children:[e.jsx("kbd",{className:"px-1 py-[1px] rounded bg-bg-hover font-mono text-[9px]",children:"Enter"})," create"," ",e.jsx("kbd",{className:"px-1 py-[1px] rounded bg-bg-hover font-mono text-[9px]",children:"Esc"})," cancel"]}),x&&e.jsx("span",{children:"Creating..."})]})]})}function it({columnId:t,title:a,phases:r,color:n,animationDelay:o=0,onSelectPhase:d,linearIssues:c,localIssues:i,selectedItem:l,onSelectItem:x,composingColumnId:h,onStartCompose:g,onStopCompose:m,onIssueCreated:y,batchMode:k,selectedIssueIds:N,onToggleIssueCheck:u}){const{t:b}=ee(),C=b("kanban.no_phases"),v=r.length===0&&(!i||i.length===0)&&(!c||c.length===0);return e.jsxs("section",{className:"group/col flex flex-col min-w-[var(--size-card-min-width)] flex-1 bg-bg-secondary rounded-[var(--radius-lg)] overflow-hidden motion-safe:animate-[column-enter_200ms_ease-out_both]",style:{animationDelay:`${o}ms`},"aria-label":`${a} column, ${r.length} phases`,children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3)] py-[var(--spacing-2-5)]",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:n},"aria-hidden":"true"}),e.jsx("h3",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-semibold)] text-text-primary",children:a}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary bg-bg-card rounded-full px-[var(--spacing-1-5)] tabular-nums",children:r.length+((i==null?void 0:i.length)??0)+((c==null?void 0:c.length)??0)}),e.jsx("button",{type:"button",onClick:()=>g==null?void 0:g(t),className:"ml-auto w-5 h-5 flex items-center justify-center rounded-[var(--radius-sm)] text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors opacity-0 group-hover/col:opacity-100 focus-visible:opacity-100","aria-label":"Create issue in this column",children:e.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]}),e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-2)] px-[var(--spacing-2)] pb-[var(--spacing-2)] overflow-y-auto flex-1",role:"list",children:[h===t&&m&&e.jsx(lt,{columnId:t,onClose:m,onCreated:y}),v?e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-secondary text-center py-[var(--spacing-6)] italic",children:C}):e.jsxs(e.Fragment,{children:[r.map(s=>e.jsx(Je,{phase:s},s.phase)),i&&i.length>0&&e.jsxs(e.Fragment,{children:[r.length>0&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] py-[var(--spacing-1)]",children:[e.jsx("div",{className:"flex-1 h-px bg-border-divider"}),e.jsx("span",{className:"text-[length:10px] text-text-tertiary font-[var(--font-weight-medium)] uppercase tracking-wider",children:"Issues"}),e.jsx("div",{className:"flex-1 h-px bg-border-divider"})]}),i.map(s=>e.jsx(st,{issue:s,selected:(l==null?void 0:l.type)==="issue"&&l.issue.id===s.id,onSelect:()=>x==null?void 0:x({type:"issue",issue:s}),batchMode:k,isChecked:N==null?void 0:N.has(s.id),onToggleCheck:u},s.id))]}),c&&c.length>0&&e.jsxs(e.Fragment,{children:[(r.length>0||i&&i.length>0)&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] py-[var(--spacing-1)]",children:[e.jsx("div",{className:"flex-1 h-px bg-border-divider"}),e.jsx("span",{className:"text-[length:10px] text-text-tertiary font-[var(--font-weight-medium)] uppercase tracking-wider",children:"Linear"}),e.jsx("div",{className:"flex-1 h-px bg-border-divider"})]}),c.map(s=>e.jsx(Ze,{issue:s,selected:(l==null?void 0:l.type)==="linearIssue"&&l.issue.id===s.id,onSelect:()=>x==null?void 0:x({type:"linearIssue",issue:s})},s.id))]})]})]})]})}const ct={backlog:L.pending,triage:"#C8863A","in-progress":L.executing,review:L.verifying,done:L.completed,deferred:"#8B8685"},dt={backlog:"columns.backlog",triage:"columns.triage","in-progress":"columns.in_progress",review:"columns.review",done:"columns.done",deferred:"columns.deferred"},xt={backlog:"backlog",unstarted:"backlog",started:"in-progress",completed:"done"},pt={open:"backlog",registered:"triage",in_progress:"in-progress",resolved:"review",closed:"done",deferred:"deferred"};function ut(t){var r;const a=new Map;for(const n of te)a.set(n.id,[]);for(const n of t){const o=pt[n.status]??"backlog";(r=a.get(o))==null||r.push(n)}return a}function ht(t){var r;const a=new Map;for(const n of te)a.set(n.id,[]);for(const n of t){const o=xt[n.state.type]??"backlog";(r=a.get(o))==null||r.push(n)}return a}function vt({linearIssues:t,localIssues:a,selectedItem:r,onSelectItem:n,composingColumnId:o,onStartCompose:d,onStopCompose:c,onIssueCreated:i,showDone:l=!0,batchMode:x,selectedIssueIds:h,onToggleIssueCheck:g}){const{t:m}=ee(),y=p.useRef(null),k=p.useCallback(b=>{const C=y.current;if(!C)return;const v=Array.from(C.querySelectorAll('[role="button"][tabindex="0"]')),s=document.activeElement,S=s?v.indexOf(s):-1;let z=-1;b.key==="ArrowDown"||b.key==="ArrowRight"?(b.preventDefault(),z=S<v.length-1?S+1:0):b.key==="ArrowUp"||b.key==="ArrowLeft"?(b.preventDefault(),z=S>0?S-1:v.length-1):b.key==="Home"?(b.preventDefault(),z=0):b.key==="End"&&(b.preventDefault(),z=v.length-1),z>=0&&v[z]&&v[z].focus()},[]);p.useEffect(()=>{const b=y.current;if(b)return b.addEventListener("keydown",k),()=>b.removeEventListener("keydown",k)},[k]);const N=p.useMemo(()=>ht(t??[]),[t]),u=p.useMemo(()=>ut(a??[]),[a]);return e.jsx("div",{ref:y,className:"flex gap-[var(--spacing-3)] h-full overflow-x-auto p-[var(--spacing-3)] scroll-smooth",children:te.filter(b=>l||b.id!=="done").map((b,C)=>e.jsx(it,{columnId:b.id,title:m(dt[b.id]),phases:[],color:ct[b.id]??L.pending,animationDelay:C*50,onSelectPhase:()=>{},linearIssues:N.get(b.id),localIssues:u.get(b.id),selectedItem:r,onSelectItem:n,composingColumnId:o,onStartCompose:d,onStopCompose:c,onIssueCreated:i,batchMode:x,selectedIssueIds:h,onToggleIssueCheck:g},b.id))})}const mt={bug:"#C46555",feature:"#5B8DB8",improvement:"#9178B5",task:"#A09D97"},gt={urgent:"#C46555",high:"#B89540",medium:"#5B8DB8",low:"#A09D97"},ft={open:"Open",registered:"Registered",in_progress:"In Progress",resolved:"Resolved",closed:"Closed",deferred:"Deferred"},T="text-left px-[var(--spacing-3)] py-[var(--spacing-2)] text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-tertiary uppercase tracking-wide";function bt({localIssues:t,linearIssues:a,selectedItem:r,onSelectItem:n}){const o=((t==null?void 0:t.length)??0)>0,d=((a==null?void 0:a.length)??0)>0;return!o&&!d?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"No data available"}):e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-4)] h-full overflow-auto p-[var(--spacing-3)]",children:[o&&e.jsxs("section",{children:[e.jsx(pe,{label:"Issues",count:t.length}),e.jsx("div",{className:"rounded-[var(--radius-lg)] overflow-hidden border border-border-divider",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-bg-secondary",children:[e.jsx("th",{className:`${T} w-[80px]`,children:"Type"}),e.jsx("th",{className:T,children:"Title"}),e.jsx("th",{className:`${T} w-[90px]`,children:"Priority"}),e.jsx("th",{className:`${T} w-[100px]`,children:"Status"})]})}),e.jsx("tbody",{children:t.map((c,i)=>{const l=mt[c.type]??"#A09D97",x=gt[c.priority]??"#A09D97",h=(r==null?void 0:r.type)==="issue"&&r.issue.id===c.id;return e.jsxs("tr",{onClick:()=>n==null?void 0:n({type:"issue",issue:c}),className:xe(i,h),children:[e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)]",children:e.jsx(ue,{label:c.type,color:l})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary",children:c.title}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)]",children:e.jsx(ue,{label:c.priority,color:x})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-xs)] text-text-secondary whitespace-nowrap",children:ft[c.status]??c.status})]},c.id)})})]})})]}),d&&e.jsxs("section",{children:[e.jsx(pe,{label:"Linear",count:a.length}),e.jsx("div",{className:"rounded-[var(--radius-lg)] overflow-hidden border border-border-divider",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-bg-secondary",children:[e.jsx("th",{className:`${T} w-[80px]`,children:"ID"}),e.jsx("th",{className:T,children:"Title"}),e.jsx("th",{className:`${T} w-[110px]`,children:"State"}),e.jsx("th",{className:`${T} w-[90px]`,children:"Priority"})]})}),e.jsx("tbody",{children:a.map((c,i)=>{const l=(r==null?void 0:r.type)==="linearIssue"&&r.issue.id===c.id;return e.jsxs("tr",{onClick:()=>n==null?void 0:n({type:"linearIssue",issue:c}),className:xe(i,l),children:[e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-xs)] font-mono text-text-tertiary",children:c.identifier}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary",children:c.title}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-xs)] text-text-secondary",children:c.state.name}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-xs)] text-text-secondary",children:U[c.priority]})]},c.id)})})]})})]})]})}function xe(t,a){return["cursor-pointer transition-colors border-t border-border-divider",a?"bg-[rgba(90,130,200,0.08)]":t%2===0?"bg-bg-primary hover:bg-bg-hover":"bg-[rgba(0,0,0,0.015)] hover:bg-bg-hover"].join(" ")}function pe({label:t,count:a}){return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] mb-[var(--spacing-2)]",children:[e.jsx("h3",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wider text-text-tertiary",children:t}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary bg-bg-secondary rounded-full px-[var(--spacing-1-5)] tabular-nums",children:a})]})}function ue({label:t,color:a}){return e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-2 py-[var(--spacing-0-5)] rounded-full whitespace-nowrap",style:{backgroundColor:`${a}20`,color:a},children:t})}/**
|
|
2
|
-
* @license lucide-react v0.577.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const yt=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],jt=F("inbox",yt),Nt={bug:"#C46555",feature:"#5B8DB8",improvement:"#9178B5",task:"#A09D97"},wt={urgent:"#C46555",high:"#B89540",medium:"#5B8DB8",low:"#A09D97"};function kt({localIssues:t,linearIssues:a,selectedItem:r,onSelectItem:n}){const o=p.useMemo(()=>(t??[]).filter(i=>i.status==="open"||i.status==="registered"||i.status==="in_progress"),[t]),d=p.useMemo(()=>(t??[]).filter(i=>i.status==="resolved"||i.status==="closed"||i.status==="deferred"),[t]),c=((t==null?void 0:t.length)??0)+((a==null?void 0:a.length)??0);return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-4)] px-[var(--spacing-4)] py-[var(--spacing-2-5)] border-b border-border-divider shrink-0 bg-bg-secondary",children:[e.jsx(X,{label:"Issues",value:c,sub:`${o.length} open`,color:L.pending}),e.jsx("div",{className:"w-px h-6 bg-border-divider"}),e.jsx(X,{label:"In Progress",value:(t??[]).filter(i=>i.status==="in_progress").length,sub:"active",color:L.executing}),e.jsx("div",{className:"w-px h-6 bg-border-divider"}),e.jsx(X,{label:"Resolved",value:d.length,sub:"done",color:L.completed})]}),e.jsxs("div",{className:"flex-1 grid grid-cols-[1fr_280px] overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col overflow-hidden border-r border-border-divider",children:[e.jsx(he,{icon:e.jsx(jt,{size:14,strokeWidth:2}),label:"Issue Queue",children:e.jsxs("span",{className:"ml-auto text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] px-[var(--spacing-1-5)] py-px rounded-full bg-border-subtle text-text-secondary",children:[o.length," open"]})}),e.jsx("div",{className:"flex-1 overflow-y-auto py-[var(--spacing-1)]",children:o.length===0?e.jsx(Ct,{message:"No open issues"}):o.map(i=>{const l=Nt[i.type]??"#A09D97",x=wt[i.priority]??"#A09D97",h=(r==null?void 0:r.type)==="issue"&&r.issue.id===i.id;return e.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n({type:"issue",issue:i}),className:["flex items-center gap-[var(--spacing-2)] px-[var(--spacing-4)] py-[var(--spacing-2)] w-full text-left transition-colors",h?"bg-[rgba(90,130,200,0.08)]":"hover:bg-bg-hover"].join(" "),children:[e.jsx("span",{className:"text-[length:9px] font-[var(--font-weight-semibold)] px-[6px] py-[2px] rounded-full shrink-0",style:{backgroundColor:`${l}20`,color:l},children:i.type}),e.jsx("span",{className:"flex-1 text-[length:var(--font-size-xs)] text-text-primary line-clamp-1",children:i.title}),e.jsx("span",{className:"text-[length:9px] font-[var(--font-weight-semibold)] px-[6px] py-[2px] rounded-full shrink-0",style:{backgroundColor:`${x}20`,color:x},children:i.priority})]},i.id)})})]}),e.jsxs("div",{className:"flex flex-col overflow-hidden",children:[e.jsx(he,{icon:e.jsx(Ve,{size:14,strokeWidth:2}),label:"Summary"}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-[var(--spacing-4)] py-[var(--spacing-3)] flex flex-col gap-[var(--spacing-4)]",children:[((t==null?void 0:t.length)??0)>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[length:10px] text-text-tertiary uppercase tracking-wider font-[var(--font-weight-semibold)]",children:"Issues"}),e.jsxs("div",{className:"mt-[var(--spacing-2)] flex flex-col gap-[var(--spacing-1-5)]",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:"Open"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-primary tabular-nums",children:o.length})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:"In Progress"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-primary tabular-nums",children:(t??[]).filter(i=>i.status==="in_progress").length})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:"Resolved"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-primary tabular-nums",children:d.length})]})]})]}),((a==null?void 0:a.length)??0)>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[length:10px] text-text-tertiary uppercase tracking-wider font-[var(--font-weight-semibold)]",children:"Linear"}),e.jsx("div",{className:"mt-[var(--spacing-2)]",children:e.jsxs("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:[a.length," issues"]})})]})]})]})]})]})}function X({label:t,value:a,sub:r,color:n}){return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary",children:t}),e.jsxs("div",{className:"flex items-baseline gap-[var(--spacing-1-5)]",children:[e.jsx("span",{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)]",style:{color:n},children:a}),e.jsx("span",{className:"text-[length:10px] text-text-tertiary",children:r})]})]})}function he({icon:t,label:a,children:r}){return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-4)] py-[var(--spacing-2-5)] border-b border-border-divider shrink-0",children:[e.jsx("span",{className:"text-text-tertiary",children:t}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wider text-text-tertiary",children:a}),r]})}function Ct({message:t}){return e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary text-center py-[var(--spacing-6)] italic",children:t})}function St({issues:t,onClose:a}){const[r,n]=p.useState(new Set),[o,d]=p.useState(!1),[c,i]=p.useState(null),l=K(m=>m.importIssues);function x(){r.size===t.length?n(new Set):n(new Set(t.map(m=>m.id)))}function h(m){const y=new Set(r);y.has(m)?y.delete(m):y.add(m),n(y)}async function g(){const m=t.filter(y=>r.has(y.id));if(m.length!==0){d(!0);try{const y=await l(m);i(y)}catch(y){i({imported:0,errors:[String(y)]})}finally{d(!1)}}}return e.jsx(fe,{open:!0,onOpenChange:m=>!m&&a(),children:e.jsxs(be,{children:[e.jsx(ye,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm"}),e.jsxs(je,{className:ke("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[600px] max-w-[95vw] max-h-[80vh]","rounded-[var(--radius-lg)] border border-border bg-bg-primary shadow-lg","flex flex-col overflow-hidden focus:outline-none"),children:[e.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-4)] py-[var(--spacing-3)] border-b border-border",children:[e.jsx(Ne,{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)] text-text-primary",children:"Import from Linear"}),e.jsx(we,{className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-sm)] text-text-secondary hover:text-text-primary hover:bg-bg-hover",children:e.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),c?e.jsxs("div",{className:"p-[var(--spacing-4)] space-y-[var(--spacing-3)]",children:[e.jsxs("p",{className:"text-[length:var(--font-size-sm)] text-text-primary",children:["Imported ",c.imported," issue(s)."]}),c.errors.length>0&&e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-status-blocked",children:c.errors.map((m,y)=>e.jsx("div",{children:m},y))}),e.jsx("button",{type:"button",onClick:a,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] bg-accent-blue text-white text-[length:var(--font-size-sm)] hover:opacity-90",children:"Done"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-[var(--spacing-4)] py-[var(--spacing-2)] bg-bg-secondary border-b border-border",children:e.jsxs("p",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:["Linear issues will be mapped: ",e.jsx("span",{className:"font-mono",children:"identifier"})," → title prefix, ",e.jsx("span",{className:"font-mono",children:"priority"})," → local priority, ",e.jsx("span",{className:"font-mono",children:"state.type"})," → local status"]})}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:t.length===0?e.jsx("div",{className:"p-[var(--spacing-4)] text-[length:var(--font-size-sm)] text-text-secondary text-center",children:"No Linear issues available"}):e.jsxs("table",{className:"w-full text-[length:var(--font-size-xs)]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-text-tertiary",children:[e.jsx("th",{className:"w-8 p-[var(--spacing-2)]",children:e.jsx("input",{type:"checkbox",checked:r.size===t.length,onChange:x})}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Issue"}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Status"}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Priority"})]})}),e.jsx("tbody",{children:t.map(m=>e.jsxs("tr",{className:"border-b border-border-divider hover:bg-bg-hover cursor-pointer",onClick:()=>h(m.id),children:[e.jsx("td",{className:"p-[var(--spacing-2)]",children:e.jsx("input",{type:"checkbox",checked:r.has(m.id),onChange:()=>h(m.id)})}),e.jsxs("td",{className:"p-[var(--spacing-2)]",children:[e.jsx("span",{className:"font-mono text-text-tertiary",children:m.identifier})," ",e.jsx("span",{className:"text-text-primary",children:m.title})]}),e.jsx("td",{className:"p-[var(--spacing-2)] text-text-secondary",children:m.state.name}),e.jsx("td",{className:"p-[var(--spacing-2)] text-text-secondary",children:U[m.priority]})]},m.id))})]})}),e.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-4)] py-[var(--spacing-3)] border-t border-border",children:[e.jsxs("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:[r.size," of ",t.length," selected"]}),e.jsxs("div",{className:"flex gap-[var(--spacing-2)]",children:[e.jsx("button",{type:"button",onClick:a,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] border border-border text-text-secondary text-[length:var(--font-size-sm)] hover:bg-bg-hover",children:"Cancel"}),e.jsx("button",{type:"button",onClick:()=>void g(),disabled:r.size===0||o,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] bg-accent-blue text-white text-[length:var(--font-size-sm)] hover:opacity-90 disabled:opacity-50",children:o?"Importing...":`Import ${r.size} issue(s)`})]})]})]})]})]})})}function zt({teams:t,selectedTeamId:a,onClose:r}){var C;const[n,o]=p.useState(a??((C=t[0])==null?void 0:C.id)??""),[d,c]=p.useState(new Set),[i,l]=p.useState(!1),[x,h]=p.useState(null),g=O(v=>v.issues),m=O(v=>v.fetchIssues),y=K(v=>v.exportIssues),k=K(v=>v.refresh);p.useEffect(()=>{m()},[m]);function N(){d.size===g.length?c(new Set):c(new Set(g.map(v=>v.id)))}function u(v){const s=new Set(d);s.has(v)?s.delete(v):s.add(v),c(s)}async function b(){const v=g.filter(s=>d.has(s.id));if(!(v.length===0||!n)){l(!0);try{const s=await y(v,n);h(s),await k()}catch(s){h({exported:0,errors:[String(s)]})}finally{l(!1)}}}return e.jsx(fe,{open:!0,onOpenChange:v=>!v&&r(),children:e.jsxs(be,{children:[e.jsx(ye,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm"}),e.jsxs(je,{className:ke("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[600px] max-w-[95vw] max-h-[80vh]","rounded-[var(--radius-lg)] border border-border bg-bg-primary shadow-lg","flex flex-col overflow-hidden focus:outline-none"),children:[e.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-4)] py-[var(--spacing-3)] border-b border-border",children:[e.jsx(Ne,{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)] text-text-primary",children:"Export to Linear"}),e.jsx(we,{className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-sm)] text-text-secondary hover:text-text-primary hover:bg-bg-hover",children:e.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),x?e.jsxs("div",{className:"p-[var(--spacing-4)] space-y-[var(--spacing-3)]",children:[e.jsxs("p",{className:"text-[length:var(--font-size-sm)] text-text-primary",children:["Exported ",x.exported," issue(s) to Linear."]}),x.errors.length>0&&e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-status-blocked",children:x.errors.map((v,s)=>e.jsx("div",{children:v},s))}),e.jsx("button",{type:"button",onClick:r,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] bg-accent-blue text-white text-[length:var(--font-size-sm)] hover:opacity-90",children:"Done"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"px-[var(--spacing-4)] py-[var(--spacing-2)] bg-bg-secondary border-b border-border space-y-[var(--spacing-2)]",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx("label",{className:"text-[length:var(--font-size-xs)] text-text-secondary shrink-0",children:"Target team:"}),e.jsx("select",{value:n,onChange:v=>o(v.target.value),className:"px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] border border-border bg-bg-primary text-text-primary text-[length:var(--font-size-xs)]",children:t.map(v=>e.jsxs("option",{value:v.id,children:[v.key," — ",v.name]},v.id))})]}),e.jsxs("p",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:["Local issues will be created in Linear: ",e.jsx("span",{className:"font-mono",children:"title"})," → title, ",e.jsx("span",{className:"font-mono",children:"priority"})," → Linear priority, ",e.jsx("span",{className:"font-mono",children:"description"})," → description"]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:g.length===0?e.jsx("div",{className:"p-[var(--spacing-4)] text-[length:var(--font-size-sm)] text-text-secondary text-center",children:"No local issues available"}):e.jsxs("table",{className:"w-full text-[length:var(--font-size-xs)]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-text-tertiary",children:[e.jsx("th",{className:"w-8 p-[var(--spacing-2)]",children:e.jsx("input",{type:"checkbox",checked:d.size===g.length&&g.length>0,onChange:N})}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Title"}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Status"}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Priority"})]})}),e.jsx("tbody",{children:g.map(v=>e.jsxs("tr",{className:"border-b border-border-divider hover:bg-bg-hover cursor-pointer",onClick:()=>u(v.id),children:[e.jsx("td",{className:"p-[var(--spacing-2)]",children:e.jsx("input",{type:"checkbox",checked:d.has(v.id),onChange:()=>u(v.id)})}),e.jsx("td",{className:"p-[var(--spacing-2)] text-text-primary",children:v.title}),e.jsx("td",{className:"p-[var(--spacing-2)] text-text-secondary",children:v.status}),e.jsx("td",{className:"p-[var(--spacing-2)] text-text-secondary",children:v.priority})]},v.id))})]})}),e.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-4)] py-[var(--spacing-3)] border-t border-border",children:[e.jsxs("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:[d.size," of ",g.length," selected"]}),e.jsxs("div",{className:"flex gap-[var(--spacing-2)]",children:[e.jsx("button",{type:"button",onClick:r,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] border border-border text-text-secondary text-[length:var(--font-size-sm)] hover:bg-bg-hover",children:"Cancel"}),e.jsx("button",{type:"button",onClick:()=>void b(),disabled:d.size===0||!n||i,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] bg-accent-blue text-white text-[length:var(--font-size-sm)] hover:opacity-90 disabled:opacity-50",children:i?"Exporting...":`Export ${d.size} issue(s)`})]})]})]})]})]})})}/**
|
|
7
|
-
* @license lucide-react v0.577.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const _t=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Et=F("layout-dashboard",_t);/**
|
|
12
|
-
* @license lucide-react v0.577.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const Lt=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Dt=F("refresh-cw",Lt);/**
|
|
17
|
-
* @license lucide-react v0.577.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const Bt=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],At=F("upload",Bt),Tt={"claude-code":"Claude Code",codex:"Codex",gemini:"Gemini",qwen:"Qwen",opencode:"OpenCode"};function Pt(){var k,N;const t=D(u=>u.cliPanelIssueId),a=D(u=>u.closeCliPanel),r=D(u=>u.getSlotForIssue),o=O(u=>u.issues).find(u=>u.id===t),d=t?r(t):void 0,c=(d==null?void 0:d.processId)??((k=o==null?void 0:o.execution)==null?void 0:k.processId)??null,i=Oe(u=>u.processes),l=c?i[c]:void 0,x=p.useCallback(()=>{c&&R({action:"stop",processId:c})},[c]);if(!t||!o)return null;const h=(l==null?void 0:l.status)==="running"||(l==null?void 0:l.status)==="spawning",g=((N=o.execution)==null?void 0:N.status)??"idle",m=(d==null?void 0:d.executor)??o.executor??"claude-code",y=Tt[m]??"Agent";return e.jsxs("div",{className:"flex flex-col h-full border-l border-border-divider bg-bg-primary w-[480px] shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3)] py-[var(--spacing-2)] border-b border-border-divider shrink-0",children:[e.jsx("h3",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-semibold)] text-text-primary truncate flex-1",children:o.title}),e.jsx("span",{className:"text-[length:10px] font-[var(--font-weight-medium)] px-2 py-[2px] rounded-full bg-bg-hover text-text-secondary shrink-0",children:y}),e.jsx("span",{className:["text-[length:10px] font-[var(--font-weight-medium)] px-2 py-[2px] rounded-full shrink-0",g==="running"?"bg-[#B8954020] text-[#B89540]":g==="completed"?"bg-[#5A9E7820] text-[#5A9E78]":g==="failed"?"bg-[#C4655520] text-[#C46555]":"bg-bg-hover text-text-secondary"].join(" "),children:g}),h&&e.jsx("button",{type:"button",onClick:x,className:"text-[length:var(--font-size-xs)] px-2 py-1 rounded-[var(--radius-sm)] border border-[#C46555] text-[#C46555] hover:bg-[#C4655510] transition-colors shrink-0",children:"Stop"}),e.jsx("button",{type:"button",onClick:a,className:"w-6 h-6 flex items-center justify-center rounded-[var(--radius-sm)] text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors shrink-0","aria-label":"Close panel",children:e.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:e.jsx(Ye,{processId:c})}),e.jsx(qe,{processId:c,executor:m})]})}const Ot=[{value:"claude-code",label:"Claude Code"},{value:"codex",label:"Codex"},{value:"gemini",label:"Gemini"}];function $t(){const t=D(c=>c.selectedIssueIds),a=D(c=>c.clearSelection),[r,n]=p.useState("claude-code"),o=t.size,d=p.useCallback(()=>{o!==0&&(R({action:"execute:batch",issueIds:Array.from(t),executor:r}),a())},[t,r,o,a]);return o===0?null:e.jsxs("div",{className:"fixed bottom-6 left-1/2 -translate-x-1/2 z-50 flex items-center gap-[var(--spacing-2)] px-[var(--spacing-4)] py-[var(--spacing-2)] rounded-full bg-bg-card border border-border shadow-[0_8px_32px_rgba(0,0,0,0.12)] backdrop-blur-sm",children:[e.jsxs("span",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-semibold)] text-text-primary",children:[o," selected"]}),e.jsx("div",{className:"w-px h-5 bg-border-divider"}),e.jsx("select",{value:r,onChange:c=>n(c.target.value),className:"px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] border border-border bg-bg-primary text-text-primary text-[length:var(--font-size-xs)] cursor-pointer",children:Ot.map(c=>e.jsx("option",{value:c.value,children:c.label},c.value))}),e.jsxs("button",{type:"button",onClick:d,className:"flex items-center gap-[var(--spacing-1)] px-[var(--spacing-3)] py-[var(--spacing-1)] rounded-full bg-accent-blue text-white text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] hover:opacity-90 transition-opacity",children:[e.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("polygon",{points:"5,3 19,12 5,21"})}),"Execute"]}),e.jsx("button",{type:"button",onClick:a,className:"w-6 h-6 flex items-center justify-center rounded-full text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors","aria-label":"Clear selection",children:e.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}const Rt={create_issue:{bg:"rgba(91, 141, 184, 0.1)",text:"#5B8DB8"},execute_issue:{bg:"rgba(90, 158, 120, 0.1)",text:"#5A9E78"},analyze_issue:{bg:"rgba(145, 120, 181, 0.1)",text:"#9178B5"},plan_issue:{bg:"rgba(145, 120, 181, 0.1)",text:"#9178B5"},advance_phase:{bg:"rgba(184, 149, 64, 0.1)",text:"#B89540"},flag_blocker:{bg:"rgba(196, 101, 85, 0.1)",text:"#C46555"}};function It(){const t=D(l=>l.recentDecisions),[a,r]=p.useState(new Set),[n,o]=p.useState(!1),d=p.useMemo(()=>{const l=[];for(const x of t)for(const h of x.deferred){const g=`${x.id}-${h.type}-${h.target}`;a.has(g)||l.push({decisionId:x.id,action:h,timestamp:x.timestamp})}return l.slice(-5)},[t,a]),c=p.useCallback(l=>{l.action.type==="execute_issue"&&R({action:"execute:issue",issueId:l.action.target,executor:l.action.executor??"claude-code"}),r(x=>{const h=new Set(x);return h.add(`${l.decisionId}-${l.action.type}-${l.action.target}`),h})},[]),i=p.useCallback(l=>{r(x=>{const h=new Set(x);return h.add(`${l.decisionId}-${l.action.type}-${l.action.target}`),h})},[]);return d.length===0?null:e.jsxs("div",{className:"border-b border-border-divider bg-bg-secondary",children:[e.jsx("div",{className:"flex items-center justify-between px-[var(--spacing-4)] py-[var(--spacing-1-5)]",children:e.jsxs("button",{type:"button",onClick:()=>o(!n),className:"flex items-center gap-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] text-text-secondary hover:text-text-primary transition-colors",children:[e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full bg-accent-blue animate-pulse"}),"Commander Recommendations (",d.length,")",e.jsx("svg",{className:`w-3 h-3 transition-transform duration-150 ${n?"":"rotate-180"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})]})}),!n&&e.jsx("div",{className:"flex flex-wrap gap-[var(--spacing-2)] px-[var(--spacing-4)] pb-[var(--spacing-2)]",children:d.map(l=>{const x=Rt[l.action.type]??{bg:"var(--color-bg-secondary)",text:"var(--color-text-secondary)"};return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-md)] text-[length:var(--font-size-xs)]",style:{backgroundColor:x.bg},children:[e.jsx("span",{className:"font-[var(--font-weight-medium)]",style:{color:x.text},children:l.action.type.replace("_"," ")}),e.jsx("span",{className:"text-text-secondary truncate max-w-[200px]",title:l.action.target,children:l.action.target}),l.action.reason&&e.jsxs("span",{className:"text-text-tertiary truncate max-w-[150px]",title:l.action.reason,children:["— ",l.action.reason]}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)] ml-auto",children:[l.action.type==="execute_issue"&&e.jsx("button",{type:"button",onClick:()=>c(l),className:"text-[10px] font-[var(--font-weight-medium)] px-[var(--spacing-2)] py-[var(--spacing-0-5)] rounded-full transition-colors",style:{backgroundColor:"rgba(90, 158, 120, 0.15)",color:"#5A9E78"},children:"Approve"}),e.jsx("button",{type:"button",onClick:()=>i(l),className:"text-[10px] text-text-tertiary hover:text-text-secondary transition-colors px-1",children:"x"})]})]},`${l.decisionId}-${l.action.type}-${l.action.target}`)})})]})}const Ce=[{value:"bug",label:"Bug",color:"#C46555"},{value:"feature",label:"Feature",color:"#5B8DB8"},{value:"improvement",label:"Improve",color:"#9178B5"},{value:"task",label:"Task",color:"#A09D97"}],Se=[{value:"urgent",label:"Urgent",color:"#C46555"},{value:"high",label:"High",color:"#B89540"},{value:"medium",label:"Medium",color:"#5B8DB8"},{value:"low",label:"Low",color:"#A09D97"}];function ve({type:t,setType:a,priority:r,setPriority:n,dark:o}){const d=o?"20":"18",c=o?"35":"28";return e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[Ce.map(i=>e.jsx("button",{type:"button",onClick:()=>a(i.value),className:"text-[10px] font-medium px-2 py-[2px] rounded-full transition-all duration-100",style:{background:`${i.color}${t===i.value?c:d}`,color:i.color,outline:t===i.value?`1.5px solid ${i.color}70`:"none"},children:i.label},i.value)),e.jsx("div",{className:"w-px h-3",style:{backgroundColor:o?"rgba(255,255,255,0.12)":"var(--color-border-divider)"}}),Se.map(i=>e.jsx("button",{type:"button",onClick:()=>n(i.value),className:"text-[10px] font-medium px-2 py-[2px] rounded-full transition-all duration-100",style:{background:`${i.color}${r===i.value?c:d}`,color:i.color,outline:r===i.value?`1.5px solid ${i.color}70`:"none"},children:i.label},i.value))]})}function Mt({open:t,columnId:a,style:r,onClose:n,onCreated:o}){const[d,c]=p.useState(""),[i,l]=p.useState(""),[x,h]=p.useState("task"),[g,m]=p.useState("medium"),[y,k]=p.useState(!1),N=p.useRef(null),u=p.useRef(null),b=O(s=>s.createIssue);p.useEffect(()=>{t&&(c(""),l(""),h("task"),m("medium"),requestAnimationFrame(()=>{var s;return(s=N.current)==null?void 0:s.focus()}))},[t]),p.useEffect(()=>{function s(S){S.key==="Escape"&&n()}return t&&window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[t,n]);const C=p.useCallback(async()=>{const s=d.trim();!s||y||(k(!0),await b({title:s,description:i.trim(),type:x,priority:g}),k(!1),o==null||o(),n())},[d,i,x,g,y,b,o,n]);function v(s){s.key==="Enter"&&(s.metaKey||s.ctrlKey)&&C()}return t?r===1?e.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[13vh]",style:{backgroundColor:"rgba(0,0,0,0.75)",backdropFilter:"blur(3px)"},onClick:n,children:e.jsxs("div",{className:"w-full max-w-[540px] mx-4 rounded-[14px] overflow-hidden motion-safe:animate-[modal-enter_150ms_ease-out_both]",style:{backgroundColor:"#1D1B18",boxShadow:"0 28px 90px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.07)",borderTop:"2.5px solid var(--color-accent-orange)"},onClick:s=>s.stopPropagation(),children:[e.jsx("div",{className:"px-5 pt-5 pb-3",children:e.jsx("input",{ref:N,value:d,onChange:s=>c(s.target.value),onKeyDown:s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),C()),v(s)},placeholder:"What needs to be done?",className:"w-full bg-transparent text-[length:var(--font-size-base)] font-medium outline-none",style:{color:"rgba(255,255,255,0.88)",caretColor:"var(--color-accent-orange)"}})}),e.jsx("div",{className:"px-5 pb-4 pt-3 border-t",style:{borderColor:"rgba(255,255,255,0.07)"},children:e.jsx(ve,{type:x,setType:h,priority:g,setPriority:m,dark:!0})}),e.jsxs("div",{className:"flex items-center justify-between px-5 py-2.5 border-t text-[10px]",style:{borderColor:"rgba(255,255,255,0.07)",color:"rgba(255,255,255,0.3)"},children:[e.jsxs("span",{children:[e.jsx("kbd",{className:"px-1 py-0.5 rounded font-mono text-[9px]",style:{backgroundColor:"rgba(255,255,255,0.08)"},children:"↵"})," ","create · "," ",e.jsx("kbd",{className:"px-1 py-0.5 rounded font-mono text-[9px]",style:{backgroundColor:"rgba(255,255,255,0.08)"},children:"Esc"})," ","cancel"]}),e.jsx("span",{className:"opacity-60",children:a})]})]})}):r===2?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:"rgba(0,0,0,0.44)"},onClick:n,children:e.jsxs("div",{className:"w-full max-w-[540px] rounded-[var(--radius-xl)] border overflow-hidden motion-safe:animate-[modal-enter_160ms_ease-out_both]",style:{backgroundColor:"var(--color-bg-card)",borderColor:"var(--color-border)",boxShadow:"var(--shadow-lg)"},onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-b",style:{borderColor:"var(--color-border-divider)"},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-[length:var(--font-size-sm)] font-semibold text-text-primary",children:"New Issue"}),e.jsx("span",{className:"text-[10px] font-medium px-2 py-0.5 rounded-full capitalize",style:{backgroundColor:"var(--color-bg-secondary)",color:"var(--color-text-tertiary)"},children:a.replace("-"," ")})]}),e.jsx("button",{type:"button",onClick:n,className:"w-6 h-6 flex items-center justify-center rounded text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",children:e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsxs("div",{className:"px-5 py-4 space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[10px] font-semibold uppercase tracking-wider mb-1.5",style:{color:"var(--color-text-tertiary)"},children:["Title ",e.jsx("span",{style:{color:"var(--color-accent-red)"},children:"*"})]}),e.jsx("input",{ref:N,value:d,onChange:s=>c(s.target.value),onKeyDown:v,placeholder:"Issue title...",className:"w-full px-3 py-2 rounded-[var(--radius-default)] border text-[length:var(--font-size-sm)] text-text-primary placeholder:text-text-placeholder bg-transparent outline-none transition-colors",style:{borderColor:"var(--color-border)"},onFocus:s=>{s.target.style.borderColor="var(--color-accent-blue)"},onBlur:s=>{s.target.style.borderColor="var(--color-border)"}})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-wider mb-1.5",style:{color:"var(--color-text-tertiary)"},children:"Description"}),e.jsx("textarea",{ref:u,value:i,onChange:s=>l(s.target.value),onKeyDown:v,placeholder:"Optional description...",rows:3,className:"w-full px-3 py-2 rounded-[var(--radius-default)] border text-[length:var(--font-size-sm)] text-text-primary placeholder:text-text-placeholder bg-transparent outline-none resize-none transition-colors",style:{borderColor:"var(--color-border)"},onFocus:s=>{s.target.style.borderColor="var(--color-accent-blue)"},onBlur:s=>{s.target.style.borderColor="var(--color-border)"}})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-wider mb-2",style:{color:"var(--color-text-tertiary)"},children:"Type"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Ce.map(s=>e.jsx("button",{type:"button",onClick:()=>h(s.value),className:"text-[11px] font-medium px-3 py-1 rounded-[var(--radius-default)] transition-all",style:{background:x===s.value?`${s.color}25`:"var(--color-bg-secondary)",color:x===s.value?s.color:"var(--color-text-secondary)",outline:x===s.value?`1.5px solid ${s.color}55`:"none"},children:s.label},s.value))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-wider mb-2",style:{color:"var(--color-text-tertiary)"},children:"Priority"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Se.map(s=>e.jsx("button",{type:"button",onClick:()=>m(s.value),className:"text-[11px] font-medium px-3 py-1 rounded-[var(--radius-default)] transition-all",style:{background:g===s.value?`${s.color}25`:"var(--color-bg-secondary)",color:g===s.value?s.color:"var(--color-text-secondary)",outline:g===s.value?`1.5px solid ${s.color}55`:"none"},children:s.label},s.value))})]})]}),e.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-t",style:{borderColor:"var(--color-border-divider)"},children:[e.jsxs("span",{className:"text-[10px]",style:{color:"var(--color-text-tertiary)"},children:[e.jsx("kbd",{className:"px-1 py-0.5 rounded font-mono text-[9px]",style:{backgroundColor:"var(--color-bg-secondary)"},children:"⌘↵"})," ","to create"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:n,className:"px-4 py-1.5 rounded-[var(--radius-default)] text-[length:var(--font-size-xs)] border transition-colors hover:bg-bg-hover",style:{borderColor:"var(--color-border)",color:"var(--color-text-secondary)"},children:"Cancel"}),e.jsx("button",{type:"button",onClick:()=>void C(),disabled:!d.trim()||y,className:"px-4 py-1.5 rounded-[var(--radius-default)] text-[length:var(--font-size-xs)] text-white font-medium transition-all disabled:opacity-40",style:{backgroundColor:"var(--color-accent-orange)"},children:y?"Creating…":"Create Issue"})]})]})]})}):e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--color-bg-primary)"},onClick:n,children:[e.jsxs("div",{className:"absolute top-5 right-6 flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>void C(),disabled:!d.trim()||y,className:"px-4 py-1.5 rounded-[var(--radius-default)] text-[length:var(--font-size-xs)] text-white font-medium transition-all disabled:opacity-40",style:{backgroundColor:"var(--color-accent-orange)"},children:y?"Creating…":"Create"}),e.jsx("button",{type:"button",onClick:n,className:"w-8 h-8 flex items-center justify-center rounded text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsxs("div",{className:"w-full max-w-[720px] px-8 motion-safe:animate-[modal-enter_180ms_ease-out_both]",onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"text-[10px] font-semibold uppercase tracking-widest mb-4",style:{color:"var(--color-text-tertiary)"},children:["New Issue · ",a.replace("-"," ")]}),e.jsx("input",{ref:N,value:d,onChange:s=>c(s.target.value),onKeyDown:s=>{var S;s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),(S=u.current)==null||S.focus()),v(s)},placeholder:"Untitled issue",className:"w-full bg-transparent outline-none mb-5 leading-tight",style:{fontSize:"var(--font-size-2xl)",fontWeight:700,color:"var(--color-text-primary)",caretColor:"var(--color-accent-orange)"}}),e.jsx("textarea",{ref:u,value:i,onChange:s=>l(s.target.value),onKeyDown:v,placeholder:"Add a description… (optional)",rows:7,className:"w-full bg-transparent outline-none resize-none leading-relaxed mb-8",style:{fontSize:"var(--font-size-base)",color:"var(--color-text-secondary)",caretColor:"var(--color-accent-orange)"}}),e.jsxs("div",{className:"flex items-center gap-4 pt-4 border-t flex-wrap",style:{borderColor:"var(--color-border-divider)"},children:[e.jsx(ve,{type:x,setType:h,priority:g,setPriority:m}),e.jsxs("div",{className:"ml-auto text-[10px]",style:{color:"var(--color-text-tertiary)"},children:[e.jsx("kbd",{className:"px-1 py-0.5 rounded font-mono text-[9px]",style:{backgroundColor:"var(--color-bg-secondary)"},children:"⌘↵"})," ","to create"]})]})]})]}):null}const me={high:{color:"#5A9E78",bg:"#5A9E7820"},medium:{color:"#B89540",bg:"#B8954020"},low:{color:"#C46555",bg:"#C4655520"}};function Kt(t){return t>=.7?"high":t>=.4?"medium":"low"}function Ut({analysis:t}){const a=Kt(t.confidence),r=me[a]??me.low;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--color-text-tertiary)"},children:"Root Cause"}),e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.root_cause})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--color-text-tertiary)"},children:"Impact"}),e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.impact})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--color-text-tertiary)"},children:"Confidence"}),e.jsxs("span",{className:"text-[10px] font-medium px-2 py-0.5 rounded-full",style:{backgroundColor:r.bg,color:r.color},children:[a," (",Math.round(t.confidence*100),"%)"]})]}),t.related_files.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--color-text-tertiary)"},children:"Related Files"}),e.jsx("ul",{className:"space-y-0.5",children:t.related_files.map((n,o)=>e.jsx("li",{className:"font-mono text-[11px] truncate",style:{color:"var(--color-text-secondary)"},children:n},o))})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--color-text-tertiary)"},children:"Suggested Approach"}),e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.suggested_approach})]}),e.jsxs("div",{className:"text-[10px] pt-1",style:{color:"var(--color-text-tertiary)"},children:["Analyzed by ",t.analyzed_by," at ",new Date(t.analyzed_at).toLocaleString()]})]})}function Ft({solution:t}){return e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left",style:{fontSize:"var(--font-size-xs)"},children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--color-text-tertiary)"},children:[e.jsx("th",{className:"py-1 pr-2 w-6",children:"#"}),e.jsx("th",{className:"py-1 pr-2",children:"Target"}),e.jsx("th",{className:"py-1 pr-2",children:"Description"}),e.jsx("th",{className:"py-1",children:"Verification"})]})}),e.jsx("tbody",{children:t.steps.map((a,r)=>e.jsxs("tr",{className:"border-t",style:{borderColor:"var(--color-border-divider)"},children:[e.jsx("td",{className:"py-1.5 pr-2 font-mono",style:{color:"var(--color-text-tertiary)"},children:r+1}),e.jsx("td",{className:"py-1.5 pr-2 font-mono truncate max-w-[120px]",style:{color:"var(--color-text-secondary)"},title:a.target,children:a.target??"-"}),e.jsx("td",{className:"py-1.5 pr-2",style:{color:"var(--color-text-secondary)"},children:a.description}),e.jsx("td",{className:"py-1.5",style:{color:"var(--color-text-tertiary)"},children:a.verification??"-"})]},r))})]})}),t.context&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--color-text-tertiary)"},children:"Context"}),e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.context})]}),t.planned_by&&e.jsxs("div",{className:"text-[10px] pt-1",style:{color:"var(--color-text-tertiary)"},children:["Planned by ",t.planned_by,t.planned_at&&` at ${new Date(t.planned_at).toLocaleString()}`]})]})}const Ht={idle:"#A09D97",queued:"#5B8DB8",running:"#B89540",completed:"#5A9E78",failed:"#C46555",retrying:"#B89540"};function Wt({execution:t}){const a=Ht[t.status]??"#A09D97",r=t.result;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:a}}),e.jsx("span",{className:"text-[11px] font-medium capitalize",style:{color:"var(--color-text-primary)"},children:t.status})]}),r&&e.jsxs(e.Fragment,{children:[r.summary&&e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:r.summary}),e.jsxs("div",{className:"flex flex-wrap gap-3",style:{fontSize:"var(--font-size-xs)"},children:[r.commitHash&&e.jsxs("div",{style:{color:"var(--color-text-secondary)"},children:[e.jsx("span",{style:{color:"var(--color-text-tertiary)"},children:"Commit: "}),e.jsx("span",{className:"font-mono",children:r.commitHash.slice(0,8)})]}),r.prUrl&&e.jsxs("div",{children:[e.jsx("span",{style:{color:"var(--color-text-tertiary)"},children:"PR: "}),e.jsx("a",{href:r.prUrl,target:"_blank",rel:"noopener noreferrer",className:"underline",style:{color:"var(--color-accent-blue)"},children:r.prUrl.replace(/^https?:\/\/[^/]+/,"")})]}),r.filesChanged!=null&&e.jsxs("div",{style:{color:"var(--color-text-secondary)"},children:[e.jsx("span",{style:{color:"var(--color-text-tertiary)"},children:"Files: "}),r.filesChanged]})]})]})]})}const Vt={bug:"#C46555",feature:"#5B8DB8",improvement:"#9178B5",task:"#A09D97"},Yt={urgent:"#C46555",high:"#B89540",medium:"#5B8DB8",low:"#A09D97"},qt={idle:"#A09D97",queued:"#5B8DB8",running:"#B89540",completed:"#5A9E78",failed:"#C46555",retrying:"#B89540"};function Q(){return e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function _({label:t,color:a,bg:r}){return e.jsx("span",{className:"text-[10px] font-medium px-2 py-0.5 rounded-full",style:{backgroundColor:r,color:a},children:t})}function w({label:t,children:a}){return e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1.5",style:{color:"var(--color-text-tertiary)"},children:t}),a]})}const Gt=[{value:"gemini",label:"Gemini"},{value:"qwen",label:"Qwen"}],Xt=[{value:"standard",label:"Standard"},{value:"deep",label:"Deep"}];function Qt({issue:t}){var r;const a=[{label:"Analyze",done:!!t.analysis},{label:"Plan",done:!!t.solution&&t.solution.steps.length>0},{label:"Execute",done:!!((r=t.execution)!=null&&r.result)}];return e.jsx("div",{className:"flex items-center gap-1 mb-2.5",children:a.map((n,o)=>e.jsxs("div",{className:"flex items-center gap-1",children:[o>0&&e.jsx("div",{className:"w-6 h-px",style:{backgroundColor:n.done||a[o-1].done?"var(--color-accent-blue)":"var(--color-border)"}}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full flex items-center justify-center text-[7px]",style:{backgroundColor:n.done?"var(--color-accent-blue)":"transparent",border:n.done?"none":"1.5px solid var(--color-border)",color:n.done?"white":"var(--color-text-tertiary)"},children:n.done?"✓":""}),e.jsx("span",{className:"text-[9px]",style:{color:n.done?"var(--color-text-primary)":"var(--color-text-tertiary)"},children:n.label})]})]},n.label))})}function J({issue:t}){const a=$e(),[r,n]=p.useState("gemini"),[o,d]=p.useState("standard"),c=P(t);if(c!=="open"&&c!=="analyzing"&&c!=="planned")return null;const i=h=>{R(h),a("/chat")},l=t.solution&&t.solution.steps.length>0?"Execute":t.analysis?"Continue":"Run Pipeline",x=t.analysis?t.solution?{label:"Execute",onClick:()=>i({action:"execute:issue",issueId:t.id})}:{label:"Plan",onClick:()=>i({action:"issue:plan",issueId:t.id,tool:r})}:{label:"Analyze",onClick:()=>i({action:"issue:analyze",issueId:t.id,tool:r,depth:o})};return e.jsxs("div",{children:[e.jsx(Qt,{issue:t}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("select",{value:r,onChange:h=>n(h.target.value),className:"text-[10px] px-1.5 py-1 rounded border cursor-pointer",style:{borderColor:"var(--color-border)",backgroundColor:"var(--color-bg-primary)",color:"var(--color-text-tertiary)"},children:Gt.map(h=>e.jsx("option",{value:h.value,children:h.label},h.value))}),e.jsx("select",{value:o,onChange:h=>d(h.target.value),className:"text-[10px] px-1.5 py-1 rounded border cursor-pointer",style:{borderColor:"var(--color-border)",backgroundColor:"var(--color-bg-primary)",color:"var(--color-text-tertiary)"},children:Xt.map(h=>e.jsx("option",{value:h.value,children:h.label},h.value))}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{type:"button",onClick:x.onClick,className:"text-[11px] font-medium px-3.5 py-1.5 rounded-md transition-colors hover:opacity-90 border",style:{borderColor:"var(--color-border)",color:"var(--color-text-secondary)",backgroundColor:"transparent"},children:x.label}),e.jsx("button",{type:"button",onClick:()=>i({action:"issue:pipeline",issueId:t.id,tool:r}),className:"text-[11px] font-medium px-3.5 py-1.5 rounded-md transition-colors hover:opacity-90",style:{backgroundColor:"var(--color-accent-blue)",color:"white"},children:l})]})]})}function Z({issue:t}){return e.jsxs(e.Fragment,{children:[t.analysis&&e.jsx(w,{label:"Analysis",children:e.jsx(Ut,{analysis:t.analysis})}),t.solution&&e.jsx(w,{label:"Solution",children:e.jsx(Ft,{solution:t.solution})}),t.execution&&t.execution.result&&e.jsx(w,{label:"Execution Result",children:e.jsx(Wt,{execution:t.execution})})]})}function Jt({issue:t,style:a,onClose:r}){var c,i;const n=Vt[t.type]??"#A09D97",o=Yt[t.priority]??"#A09D97",d=t.execution?qt[t.execution.status]??"#A09D97":"#A09D97";return p.useEffect(()=>{function l(x){x.key==="Escape"&&r()}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[r]),a===1?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-[60]",style:{backgroundColor:"rgba(0,0,0,0.22)"},onClick:r}),e.jsxs("div",{className:"fixed right-0 top-0 bottom-0 z-[70] w-[400px] flex flex-col overflow-hidden motion-safe:animate-[slide-in-right_180ms_ease-out_both]",style:{backgroundColor:"var(--color-bg-card)",borderLeft:"1px solid var(--color-border)",boxShadow:"var(--shadow-lg)"},children:[e.jsxs("div",{className:"shrink-0 flex items-center justify-between px-5 py-3 border-b",style:{borderColor:"var(--color-border-divider)"},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] font-mono",style:{color:"var(--color-text-tertiary)"},children:t.id.slice(0,14)}),e.jsx(_,{label:t.type,color:n,bg:`${n}20`}),e.jsx(_,{label:t.priority,color:o,bg:`${o}20`})]}),e.jsx("button",{type:"button",onClick:r,className:"w-7 h-7 flex items-center justify-center rounded text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",children:e.jsx(Q,{})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-5 space-y-5",children:[e.jsx("h2",{className:"font-bold leading-snug",style:{fontSize:"var(--font-size-lg)",color:"var(--color-text-primary)"},children:t.title}),e.jsx(w,{label:"Status",children:(()=>{const l=P(t),x=$[l];return e.jsx("span",{className:"text-[11px] font-medium px-2.5 py-1 rounded-full",style:{backgroundColor:`${x}20`,color:x},children:l.replace("_"," ")})})()}),t.executor&&e.jsx(w,{label:"Executor",children:e.jsx("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.executor})}),t.description&&e.jsx(w,{label:"Description",children:e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.description})}),e.jsx(Z,{issue:t}),t.execution&&t.execution.status!=="idle"&&e.jsx(w,{label:"Execution",children:e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:d}}),e.jsx("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-primary)"},children:t.execution.status}),t.execution.retryCount>0&&e.jsxs("span",{style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-tertiary)"},children:["(x",t.execution.retryCount,")"]})]}),t.execution.lastError&&e.jsx("div",{className:"rounded px-2.5 py-2",style:{fontSize:"var(--font-size-xs)",color:"#C46555",backgroundColor:"#C4655510",border:"1px solid #C4655530"},children:t.execution.lastError})]})}),e.jsx(w,{label:"Activity",children:e.jsxs("div",{className:"space-y-1",style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-secondary)"},children:[e.jsxs("div",{children:["Created ",E(t.created_at)]}),e.jsxs("div",{children:["Updated ",E(t.updated_at)]})]})})]}),e.jsx("div",{className:"shrink-0 px-5 py-3",style:{borderTop:"1px solid var(--color-border-divider)"},children:e.jsx(J,{issue:t})})]})]}):a===2?e.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-6",style:{backgroundColor:"rgba(0,0,0,0.52)"},onClick:r,children:e.jsxs("div",{className:"w-full max-w-[880px] rounded-[var(--radius-xl)] border overflow-hidden flex max-h-[86vh] motion-safe:animate-[modal-enter_180ms_ease-out_both]",style:{backgroundColor:"var(--color-bg-card)",borderColor:"var(--color-border)",boxShadow:"var(--shadow-lg)"},onClick:l=>l.stopPropagation(),children:[e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden border-r",style:{borderColor:"var(--color-border-divider)"},children:[e.jsxs("div",{className:"shrink-0 flex items-center justify-between px-6 py-3.5 border-b",style:{borderColor:"var(--color-border-divider)"},children:[e.jsx("span",{className:"text-[10px] font-mono",style:{color:"var(--color-text-tertiary)"},children:t.id}),e.jsx("button",{type:"button",onClick:r,className:"w-7 h-7 flex items-center justify-center rounded text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",children:e.jsx(Q,{})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(_,{label:t.type,color:n,bg:`${n}20`}),e.jsx(_,{label:t.priority,color:o,bg:`${o}20`}),(()=>{const l=P(t),x=$[l];return e.jsx(_,{label:l.replace("_"," "),color:x,bg:`${x}20`})})()]}),e.jsx("h2",{className:"font-bold leading-snug mb-5",style:{fontSize:"var(--font-size-xl)",color:"var(--color-text-primary)"},children:t.title}),t.description?e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.description}):e.jsx("p",{className:"italic",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-placeholder)"},children:"No description provided."}),((c=t.execution)==null?void 0:c.lastError)&&e.jsxs("div",{className:"mt-5 rounded-[var(--radius-md)] p-3",style:{backgroundColor:"#C4655510",border:"1px solid #C4655330"},children:[e.jsx("div",{className:"font-semibold mb-1",style:{fontSize:"var(--font-size-xs)",color:"#C46555"},children:"Execution Error"}),e.jsx("div",{className:"whitespace-pre-wrap",style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-secondary)"},children:t.execution.lastError})]}),e.jsx("div",{className:"mt-5 space-y-5",children:e.jsx(Z,{issue:t})})]})]}),e.jsx("div",{className:"shrink-0 px-6 py-3",style:{borderTop:"1px solid var(--color-border-divider)"},children:e.jsx(J,{issue:t})}),e.jsxs("div",{className:"w-[270px] shrink-0 overflow-y-auto px-5 py-5 space-y-5",style:{backgroundColor:"var(--color-bg-secondary)"},children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--color-text-tertiary)"},children:"Properties"}),e.jsx(w,{label:"Type",children:e.jsx(_,{label:t.type,color:n,bg:`${n}25`})}),e.jsx(w,{label:"Priority",children:e.jsx(_,{label:t.priority,color:o,bg:`${o}25`})}),e.jsx(w,{label:"Status",children:(()=>{const l=P(t),x=$[l];return e.jsx("span",{className:"text-[11px] font-medium px-2.5 py-1 rounded-full",style:{backgroundColor:`${x}20`,color:x},children:l.replace("_"," ")})})()}),t.executor&&e.jsx(w,{label:"Executor",children:e.jsx("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.executor})}),t.execution&&t.execution.status!=="idle"&&e.jsxs(w,{label:"Execution",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:d}}),e.jsxs("span",{style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-secondary)"},children:[t.execution.status,t.execution.retryCount>0&&` (x${t.execution.retryCount})`]})]}),t.execution.startedAt&&e.jsxs("div",{style:{fontSize:"10px",color:"var(--color-text-tertiary)"},children:["Started ",E(t.execution.startedAt)]})]}),e.jsxs("div",{className:"pt-3 border-t space-y-3",style:{borderColor:"var(--color-border-divider)"},children:[e.jsx(w,{label:"Created",children:e.jsx("span",{style:{fontSize:"11px",color:"var(--color-text-secondary)"},children:E(t.created_at)})}),e.jsx(w,{label:"Updated",children:e.jsx("span",{style:{fontSize:"11px",color:"var(--color-text-secondary)"},children:E(t.updated_at)})})]})]})]})}):e.jsxs("div",{className:"fixed inset-0 z-[60] flex flex-col motion-safe:animate-[slide-up_220ms_ease-out_both]",style:{backgroundColor:"var(--color-bg-primary)"},children:[e.jsxs("div",{className:"shrink-0 flex items-center justify-between px-6 py-2.5 border-b",style:{borderColor:"var(--color-border-divider)",backgroundColor:"var(--color-bg-card)"},children:[e.jsxs("nav",{className:"flex items-center gap-1.5",style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-tertiary)"},children:[e.jsx("span",{children:"Kanban"}),e.jsx("span",{children:"›"}),e.jsx("span",{children:"Issues"}),e.jsx("span",{children:"›"}),e.jsx("span",{className:"font-medium truncate max-w-[360px]",style:{color:"var(--color-text-primary)"},children:t.title})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{label:t.type,color:n,bg:`${n}20`}),e.jsx(_,{label:t.priority,color:o,bg:`${o}20`}),(()=>{const l=P(t),x=$[l];return e.jsx(_,{label:l.replace("_"," "),color:x,bg:`${x}20`})})(),e.jsxs("button",{type:"button",onClick:r,className:"ml-2 flex items-center gap-1.5 px-3 py-1.5 rounded-[var(--radius-default)] border text-text-secondary hover:text-text-primary hover:bg-bg-hover transition-colors",style:{borderColor:"var(--color-border)",fontSize:"var(--font-size-xs)"},children:[e.jsx(Q,{}),"Close"]})]})]}),e.jsxs("div",{className:"flex-1 overflow-hidden flex",children:[e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx("div",{className:"flex-1 overflow-y-auto px-12 py-10",children:e.jsxs("div",{className:"max-w-[740px] mx-auto",children:[e.jsx("div",{className:"font-mono mb-4",style:{fontSize:"10px",color:"var(--color-text-tertiary)"},children:t.id}),e.jsx("h1",{className:"font-bold leading-tight mb-6",style:{fontSize:"var(--font-size-2xl)",color:"var(--color-text-primary)"},children:t.title}),t.description?e.jsx("div",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-base)",color:"var(--color-text-secondary)"},children:t.description}):e.jsx("div",{className:"italic",style:{fontSize:"var(--font-size-base)",color:"var(--color-text-placeholder)"},children:"No description provided."}),((i=t.execution)==null?void 0:i.lastError)&&e.jsxs("div",{className:"mt-8 rounded-[var(--radius-md)] p-5",style:{backgroundColor:"#C4655510",border:"1px solid #C4655330"},children:[e.jsx("div",{className:"font-semibold mb-2",style:{fontSize:"var(--font-size-sm)",color:"#C46555"},children:"Execution Error"}),e.jsx("pre",{className:"whitespace-pre-wrap leading-relaxed",style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-secondary)",fontFamily:"var(--font-mono)"},children:t.execution.lastError})]}),e.jsx("div",{className:"mt-8 space-y-6",children:e.jsx(Z,{issue:t})})]})}),e.jsx("div",{className:"shrink-0 px-12 py-3",style:{borderTop:"1px solid var(--color-border-divider)"},children:e.jsx("div",{className:"max-w-[740px] mx-auto",children:e.jsx(J,{issue:t})})})]}),e.jsxs("div",{className:"w-[280px] shrink-0 border-l overflow-y-auto px-6 py-8 space-y-6",style:{borderColor:"var(--color-border)",backgroundColor:"var(--color-bg-secondary)"},children:[e.jsx(w,{label:"Type",children:e.jsx(_,{label:t.type,color:n,bg:`${n}20`})}),e.jsx(w,{label:"Priority",children:e.jsx(_,{label:t.priority,color:o,bg:`${o}20`})}),e.jsx(w,{label:"Status",children:(()=>{const l=P(t),x=$[l];return e.jsx("span",{className:"text-[11px] font-medium px-2.5 py-1 rounded-full",style:{backgroundColor:`${x}20`,color:x},children:l.replace("_"," ")})})()}),t.executor&&e.jsx(w,{label:"Executor",children:e.jsx("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-primary)"},children:t.executor})}),t.execution&&t.execution.status!=="idle"&&e.jsx(w,{label:"Execution",children:e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:d}}),e.jsx("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-primary)"},children:t.execution.status})]}),t.execution.retryCount>0&&e.jsxs("div",{style:{fontSize:"10px",color:"var(--color-text-tertiary)"},children:[t.execution.retryCount," retry attempt",t.execution.retryCount>1?"s":""]}),t.execution.startedAt&&e.jsxs("div",{style:{fontSize:"10px",color:"var(--color-text-tertiary)"},children:["Started ",E(t.execution.startedAt)]}),t.execution.completedAt&&e.jsxs("div",{style:{fontSize:"10px",color:"var(--color-text-tertiary)"},children:["Completed ",E(t.execution.completedAt)]})]})}),e.jsxs("div",{className:"pt-4 border-t space-y-4",style:{borderColor:"var(--color-border-divider)"},children:[e.jsx(w,{label:"Created",children:e.jsx("span",{style:{fontSize:"11px",color:"var(--color-text-secondary)"},children:E(t.created_at)})}),e.jsx(w,{label:"Updated",children:e.jsx("span",{style:{fontSize:"11px",color:"var(--color-text-secondary)"},children:E(t.updated_at)})})]})]})]})]})}function E(t){const a=Date.now(),r=new Date(t).getTime(),n=a-r;if(n<0)return"just now";const o=Math.floor(n/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const d=Math.floor(o/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}const Zt=["All","Open","Registered","In Progress","Resolved","Deferred"],ge=["kanban","table","center"];function pr(){const[t,a]=p.useState("kanban"),[r,n]=p.useState("All"),[o,d]=p.useState(null),[c,i]=p.useState(!1),[l,x]=p.useState(!1),[h,g]=p.useState(!1),[m,y]=p.useState(null),[k,N]=p.useState(!1),[u,b]=p.useState("backlog"),[C,v]=p.useState(null),s=de(f=>f.createModalStyle),S=de(f=>f.detailModalStyle),{register:z,unregister:j}=p.useContext(Re),{issues:B,fetchIssues:H}=O(G(f=>({issues:f.issues,fetchIssues:f.fetchIssues}))),{selectedIssueIds:re,toggleSelect:ze,cliPanelIssueId:I,supervisorStatus:er}=D(G(f=>({selectedIssueIds:f.selectedIssueIds,toggleSelect:f.toggleSelect,cliPanelIssueId:f.cliPanelIssueId,supervisorStatus:f.supervisorStatus}))),_e=re.size>0,{configured:W,board:V,teams:Y,selectedTeamId:ae,loading:se,checkStatus:oe,fetchTeams:ne,selectTeam:Ee,refresh:Le}=K(G(f=>({configured:f.configured,board:f.board,teams:f.teams,selectedTeamId:f.selectedTeamId,loading:f.loading,checkStatus:f.checkStatus,fetchTeams:f.fetchTeams,selectTeam:f.selectTeam,refresh:f.refresh})));p.useEffect(()=>{H()},[H]),p.useEffect(()=>{oe()},[oe]),p.useEffect(()=>{W&&ne()},[W,ne]);const M=p.useMemo(()=>V?V.columns.flatMap(f=>f.issues):[],[V]),De=o!==null&&!I,le=p.useCallback(f=>{a(ge[f]??"kanban")},[]);p.useEffect(()=>{z({items:[{label:"Kanban",icon:e.jsx(Ie,{size:14}),shortcut:"K"},{label:"Table",icon:e.jsx(Fe,{size:14}),shortcut:"L"},{label:"Center",icon:e.jsx(Et,{size:14}),shortcut:"C"}],activeIndex:ge.indexOf(t),onSwitch:le})},[z,t,le]),p.useEffect(()=>()=>j(),[j]),p.useEffect(()=>{function f(A){A.target instanceof HTMLInputElement||A.target instanceof HTMLTextAreaElement||A.target instanceof HTMLSelectElement||A.key==="c"&&!A.metaKey&&!A.ctrlKey&&(b("backlog"),N(!0))}return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[]);function q(f){if(f.type==="issue"){v(f.issue),d(null);return}const A=(o==null?void 0:o.type)===f.type&&f.type==="linearIssue"&&o.issue.id===f.issue.id;d(A?null:f)}function Be(f){b(f),N(!0)}function Ae(){d(null)}function ie(){H()}const Te=(o==null?void 0:o.type)==="linearIssue"?"Linear Issue":"Issue Detail";return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsx(It,{}),e.jsx("div",{className:"px-[var(--spacing-4)] py-[var(--spacing-2)] border-b border-border-divider shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between gap-[var(--spacing-3)]",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx(Xe,{chips:[...Zt],active:r,onSelect:n}),e.jsxs("button",{type:"button",onClick:()=>g(!h),className:["flex items-center gap-[var(--spacing-1)] px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] text-[length:var(--font-size-xs)] transition-colors",h?"border-accent-blue text-accent-blue bg-[var(--color-accent-blue-10,rgba(90,130,200,0.1))]":"text-text-secondary hover:text-text-primary"].join(" "),style:h?void 0:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},title:h?"Hide Done column":"Show Done column",children:[e.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Done"]})]}),W&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] shrink-0",children:[Y.length>0&&e.jsx("select",{value:ae??"",onChange:f=>Ee(f.target.value),className:"px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] text-text-primary text-[length:var(--font-size-xs)]",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},children:Y.map(f=>e.jsxs("option",{value:f.id,children:[f.key," — ",f.name]},f.id))}),e.jsxs("button",{type:"button",onClick:()=>i(!0),className:"flex items-center gap-[var(--spacing-1)] px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] text-text-secondary hover:text-text-primary text-[length:var(--font-size-xs)] transition-colors",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},title:"Import from Linear",children:[e.jsx(Ge,{size:12}),e.jsx("span",{children:"Import"})]}),e.jsxs("button",{type:"button",onClick:()=>x(!0),className:"flex items-center gap-[var(--spacing-1)] px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] text-text-secondary hover:text-text-primary text-[length:var(--font-size-xs)] transition-colors",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},title:"Export to Linear",children:[e.jsx(At,{size:12}),e.jsx("span",{children:"Export"})]}),e.jsx("button",{type:"button",onClick:()=>void Le(),disabled:se,className:"flex items-center justify-center w-7 h-7 rounded-[var(--radius-sm)] text-text-secondary hover:text-text-primary transition-colors disabled:opacity-50",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},title:"Refresh Linear board",children:e.jsx(Dt,{size:12,className:se?"animate-spin":""})})]})]})}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex-1 overflow-auto min-w-0",children:[t==="kanban"&&e.jsx(vt,{linearIssues:M,localIssues:B,selectedItem:o,onSelectItem:q,composingColumnId:m,onStartCompose:Be,onStopCompose:()=>y(null),onIssueCreated:ie,showDone:h,batchMode:_e,selectedIssueIds:re,onToggleIssueCheck:ze}),t==="table"&&e.jsx(bt,{localIssues:B,linearIssues:M,selectedItem:o,onSelectItem:q}),t==="center"&&e.jsx(kt,{localIssues:B,linearIssues:M,selectedItem:o,onSelectItem:q})]}),I&&e.jsx(Pt,{}),!I&&e.jsx(He,{open:De,onClose:Ae,title:Te,children:o&&e.jsx(We,{selectedItem:o})})]}),e.jsx($t,{}),c&&e.jsx(St,{issues:M,onClose:()=>i(!1)}),l&&e.jsx(zt,{teams:Y,selectedTeamId:ae,onClose:()=>x(!1)}),e.jsx(Mt,{open:k,columnId:u,style:s,onClose:()=>N(!1),onCreated:ie}),C&&!I&&e.jsx(Jt,{issue:C,style:S,onClose:()=>v(null)})]})}export{pr as KanbanPage};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{d as g,Z as z,Y as y,j as e,_ as S,c as k,r as d,$ as u}from"./index-DWG-WrzT.js";import{C as f}from"./circle-CMrkbRNg.js";import{M as h}from"./minus-DYoN5UGk.js";import{A as w}from"./arrow-left-Bqtb2hle.js";import{C as j}from"./circle-check-big-TDSeWstm.js";/**
|
|
2
|
-
* @license lucide-react v0.577.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const I=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],C=g("circle-x",I);/**
|
|
7
|
-
* @license lucide-react v0.577.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const q=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],N=g("loader",q),p={open:"var(--color-text-tertiary)",registered:"var(--color-accent-blue)",in_progress:"var(--color-accent-blue)",resolved:"var(--color-accent-green)",closed:"var(--color-accent-green)",deferred:"var(--color-text-tertiary)"};function M({status:s}){switch(s){case"resolved":case"closed":return e.jsx(j,{size:14,style:{color:p[s]}});case"in_progress":return e.jsx(N,{size:14,className:"animate-spin",style:{color:p[s]}});case"open":case"registered":return e.jsx(f,{size:14,style:{color:p[s]}});case"deferred":default:return e.jsx(h,{size:14,style:{color:"var(--color-text-tertiary)"}})}}function R({issue:s}){const t={low:"bg-green-500/15 text-green-400",medium:"bg-yellow-500/15 text-yellow-400",high:"bg-orange-500/15 text-orange-400",urgent:"bg-red-500/15 text-red-400"};return e.jsxs("div",{className:"p-[var(--spacing-3)] rounded-[var(--radius-sm)] flex flex-col gap-[var(--spacing-2)]",style:{background:"var(--color-bg-secondary)",border:"1px solid var(--color-border)"},children:[e.jsxs("div",{className:"flex items-start gap-[var(--spacing-2)]",children:[e.jsx(M,{status:s.status}),e.jsx("span",{className:"flex-1 text-[length:var(--font-size-sm)] font-medium",style:{color:"var(--color-text-primary)"},children:s.title}),e.jsx("span",{className:"shrink-0 text-[length:var(--font-size-xs)] text-text-tertiary",children:s.type})]}),s.description&&e.jsx("p",{className:"text-[length:var(--font-size-xs)] line-clamp-2",style:{color:"var(--color-text-secondary)"},children:s.description}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx("span",{className:`px-2 py-0.5 rounded text-[length:var(--font-size-xs)] ${t[s.priority]??""}`,children:s.priority}),e.jsx("span",{className:"text-[length:var(--font-size-xs)]",style:{color:"var(--color-text-secondary)"},children:s.status})]})]})}function b({status:s}){switch(s){case"running":return e.jsx(N,{size:14,className:"animate-spin",style:{color:"var(--color-accent-blue)"}});case"completed":return e.jsx(j,{size:14,style:{color:"var(--color-accent-green)"}});case"failed":return e.jsx(C,{size:14,style:{color:"var(--color-accent-red)"}});case"skipped":return e.jsx(h,{size:14,style:{color:"var(--color-text-tertiary)"}});case"pending":default:return e.jsx(f,{size:14,style:{color:"var(--color-text-tertiary)"}})}}function _({step:s,isSelected:t,onSelect:l}){return e.jsxs("button",{type:"button",onClick:l,className:"w-full flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3)] py-[var(--spacing-2)] rounded-[var(--radius-sm)] text-left transition-colors",style:{background:t?"var(--color-bg-tertiary)":"transparent"},children:[e.jsx(b,{status:s.status}),e.jsxs("span",{className:"flex-1 text-[length:var(--font-size-sm)] truncate",style:{color:"var(--color-text-primary)"},children:[s.cmd,s.args?` ${s.args}`:""]}),s.summary&&e.jsx("span",{className:"text-[length:var(--font-size-xs)] shrink-0",style:{color:"var(--color-text-secondary)"},children:s.summary})]})}function $({issueIds:s}){const{issues:t,fetchIssues:l,loading:n}=k();d.useEffect(()=>{l()},[l]);const c=d.useMemo(()=>t.filter(a=>s.includes(a.id)),[t,s]),i=d.useMemo(()=>{const a={};for(const o of c)a[o.status]=(a[o.status]??0)+1;return a},[c]);return n&&c.length===0?e.jsx("div",{className:"flex items-center justify-center py-[var(--spacing-8)]",style:{color:"var(--color-text-tertiary)"},children:"Loading issues..."}):e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-4)] p-[var(--spacing-4)]",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-4)]",children:[e.jsxs("span",{className:"text-[length:var(--font-size-sm)] font-medium",style:{color:"var(--color-text-primary)"},children:[c.length," Issues"]}),Object.entries(i).map(([a,o])=>e.jsxs("span",{className:"text-[length:var(--font-size-xs)]",style:{color:"var(--color-text-secondary)"},children:[a,": ",o]},a))]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-[var(--spacing-3)]",children:c.map(a=>e.jsx(R,{issue:a},a.id))}),c.length===0&&e.jsx("div",{className:"text-[length:var(--font-size-sm)] text-center py-[var(--spacing-8)]",style:{color:"var(--color-text-tertiary)"},children:"No issues found for this requirement."})]})}function B({sessionId:s}){const t=u(r=>r.session),l=u(r=>r.selectStep);u(r=>r.selectedStepIndex);const[n,c]=d.useState(null),i=(t==null?void 0:t.sessionId)===s,a=i?t.steps:[],o=d.useMemo(()=>n!=null?a.find(r=>r.index===n)??null:null,[a,n]),v=d.useCallback(r=>{c(m=>m===r?null:r),i&&l(r)},[i,l]),x=d.useMemo(()=>{const r={completed:0,running:0,failed:0,pending:0,skipped:0};for(const m of a)r[m.status]=(r[m.status]??0)+1;return r},[a]);return i?e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("div",{className:"w-[280px] shrink-0 flex flex-col overflow-y-auto",style:{borderRight:"1px solid var(--color-border)"},children:[e.jsxs("div",{className:"px-[var(--spacing-4)] py-[var(--spacing-3)] shrink-0",style:{borderBottom:"1px solid var(--color-border)"},children:[e.jsx("div",{className:"text-[length:var(--font-size-sm)] font-medium",style:{color:"var(--color-text-primary)"},children:t.chainName??"Session Steps"}),e.jsxs("div",{className:"text-[length:var(--font-size-xs)] mt-[var(--spacing-1)]",style:{color:"var(--color-text-secondary)"},children:["Step ",t.currentStep+1," / ",a.length||"?"," | ",x.completed," done",x.failed>0&&`, ${x.failed} failed`,t.avgQuality!=null&&` | Quality: ${t.avgQuality}`]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-[var(--spacing-2)]",children:a.map(r=>e.jsx(_,{step:r,isSelected:n===r.index,onSelect:()=>v(r.index)},r.index))})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-[var(--spacing-4)]",children:o?e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-3)]",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx(b,{status:o.status}),e.jsx("span",{className:"text-[length:var(--font-size-base)] font-medium",style:{color:"var(--color-text-primary)"},children:o.cmd}),o.args&&e.jsx("span",{className:"text-[length:var(--font-size-sm)]",style:{color:"var(--color-text-secondary)"},children:o.args})]}),o.summary&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[length:var(--font-size-xs)] font-medium mb-[var(--spacing-1)]",style:{color:"var(--color-text-secondary)"},children:"Summary"}),e.jsx("div",{className:"text-[length:var(--font-size-sm)] rounded-[var(--radius-sm)] p-[var(--spacing-3)]",style:{color:"var(--color-text-primary)",background:"var(--color-bg-secondary)"},children:o.summary})]}),o.analysis&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[length:var(--font-size-xs)] font-medium mb-[var(--spacing-1)]",style:{color:"var(--color-text-secondary)"},children:"Analysis"}),e.jsx("pre",{className:"text-[length:var(--font-size-xs)] rounded-[var(--radius-sm)] p-[var(--spacing-3)] overflow-x-auto whitespace-pre-wrap",style:{color:"var(--color-text-primary)",background:"var(--color-bg-secondary)"},children:o.analysis})]})]}):e.jsx("div",{className:"text-[length:var(--font-size-sm)] text-center py-[var(--spacing-6)]",style:{color:"var(--color-text-tertiary)"},children:"Select a step to view details"})})]}):e.jsx("div",{className:"flex items-center justify-center py-[var(--spacing-8)]",style:{color:"var(--color-text-tertiary)"},children:e.jsxs("span",{className:"text-[length:var(--font-size-sm)]",children:["Coordinate session not active. Session: ",s]})})}function P(){const{id:s}=z(),t=y(r=>r.currentRequirement),l=y(r=>r.committedResult),n=l!=null&&l.requirementId===s,c=n?l.mode:null,i=n?l.issueIds??[]:[],a=n?l.coordinateSessionId??"":"",o=t!=null&&t.id===s,v=o?t.title:`Requirement ${s??""}`,x=o?t.summary:null;return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"shrink-0 flex items-center gap-[var(--spacing-3)] px-[var(--spacing-4)] py-[var(--spacing-3)]",style:{borderBottom:"1px solid var(--color-border)"},children:[e.jsx("a",{href:"/requirement",className:"flex items-center justify-center w-7 h-7 rounded-[var(--radius-sm)] transition-colors",style:{color:"var(--color-text-secondary)"},title:"Back to Requirements",children:e.jsx(w,{size:16})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h1",{className:"text-[length:var(--font-size-base)] font-semibold truncate",style:{color:"var(--color-text-primary)"},children:v}),x&&e.jsx("p",{className:"text-[length:var(--font-size-xs)] truncate mt-[var(--spacing-0-5)]",style:{color:"var(--color-text-secondary)"},children:x})]}),c&&e.jsx("span",{className:"shrink-0 px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] text-[length:var(--font-size-xs)] font-medium",style:{background:c==="issues"?"var(--color-accent-blue)":"var(--color-accent-green)",color:"#fff"},children:c==="issues"?"Issues":"Coordinate"})]}),e.jsxs("div",{className:"flex-1 overflow-hidden",children:[!c&&e.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--color-text-tertiary)"},children:e.jsx("span",{className:"text-[length:var(--font-size-sm)]",children:"No board data available for this requirement."})}),c==="issues"&&e.jsx($,{issueIds:i}),c==="coordinate"&&e.jsx(B,{sessionId:a})]}),e.jsx(S,{})]})}export{P as RequirementBoardPage};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import{d as A,o as ie,K as F,r as p,j as e,D as Y,N as le,F as U,Q as ce,X as de,R as xe,P as pe,O as be,f as ue,T as me,h as O,i as B,V as ge}from"./index-DWG-WrzT.js";import{u as fe}from"./shallow-Bme1JY57.js";import{C as ye}from"./columns-3-38xIDlzy.js";import{L as he}from"./list-CgIP_2A-.js";import{S as ve}from"./search-SieXnOgr.js";import{C as J}from"./circle-CMrkbRNg.js";import{m as L}from"./proxy-BKxDAKTj.js";import{C as we}from"./circle-alert-c3tH1P4z.js";import{T as Q}from"./trash-2-C8f4vFFM.js";import{P as X}from"./pen-line-Bh_WKYHm.js";import{C as je}from"./check-u6fGOwQO.js";/**
|
|
2
|
-
* @license lucide-react v0.577.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const ke=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Z=A("arrow-down",ke);/**
|
|
7
|
-
* @license lucide-react v0.577.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const Ne=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]],Ce=A("compass",Ne);/**
|
|
12
|
-
* @license lucide-react v0.577.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const Ee=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Se=A("eye-off",Ee);/**
|
|
17
|
-
* @license lucide-react v0.577.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const Be=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ae=A("eye",Be);/**
|
|
22
|
-
* @license lucide-react v0.577.0 - ISC
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the ISC license.
|
|
25
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const De=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Te=A("settings",De);/**
|
|
27
|
-
* @license lucide-react v0.577.0 - ISC
|
|
28
|
-
*
|
|
29
|
-
* This source code is licensed under the ISC license.
|
|
30
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const Fe=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],R=A("shield",Fe);/**
|
|
32
|
-
* @license lucide-react v0.577.0 - ISC
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the ISC license.
|
|
35
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const _e=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],ee=A("tag",_e),f=ie((r,c)=>({entries:[],files:[],loading:!1,error:null,activeView:"kanban",typeFilter:"all",categoryFilter:"all",keywordFilter:"all",search:"",selectedEntry:null,hiddenColumns:new Set,setActiveView:o=>r({activeView:o}),setTypeFilter:o=>r({typeFilter:o}),setCategoryFilter:o=>r({categoryFilter:o}),setKeywordFilter:o=>r({keywordFilter:o}),setSearch:o=>r({search:o}),setSelectedEntry:o=>r({selectedEntry:o}),toggleColumn:o=>r(a=>{const n=new Set(a.hiddenColumns);return n.has(o)?n.delete(o):n.add(o),{hiddenColumns:n}}),fetchEntries:async()=>{r({loading:!0,error:null});try{const o=await fetch(F.SPECS);if(!o.ok)throw new Error(`Failed: ${o.status}`);const a=await o.json();r({entries:a.entries??[],loading:!1})}catch(o){r({loading:!1,error:String(o)})}},fetchFiles:async()=>{try{const o=await fetch(F.SPECS_FILES);if(!o.ok)return;const a=await o.json();r({files:a.files??[]})}catch{}},addEntry:async(o,a,n)=>{r({error:null});try{const d=await fetch(F.SPECS,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:o,content:a,file:n})});if(!d.ok){const g=await d.json().catch(()=>({error:`HTTP ${d.status}`}));throw new Error(g.error)}return c().fetchEntries(),null}catch(d){return r({error:String(d)}),null}},deleteEntry:async o=>{r({error:null});const a=c().entries;r(n=>({entries:n.entries.filter(d=>d.id!==o)}));try{(await fetch(`${F.SPECS}/${o}`,{method:"DELETE"})).ok||r({entries:a})}catch{r({entries:a})}},filteredEntries:()=>{const{entries:o,typeFilter:a,categoryFilter:n,keywordFilter:d,search:g}=c();let y=o;if(a!=="all"&&(y=y.filter(u=>u.type===a)),n!=="all"&&(y=y.filter(u=>u.category===n)),d!=="all"&&(y=y.filter(u=>u.keywords.includes(d))),g){const u=g.toLowerCase();y=y.filter(h=>h.title.toLowerCase().includes(u)||h.content.toLowerCase().includes(u)||h.id.toLowerCase().includes(u)||h.keywords.some(v=>v.toLowerCase().includes(u)))}return y},entriesByType:()=>{const o=c().filteredEntries(),a={bug:[],pattern:[],decision:[],rule:[],debug:[],test:[],review:[],validation:[],general:[]};for(const n of o)(a[n.type]??a.general).push(n);return a},typeCounts:()=>{const{entries:o}=c(),a={all:o.length,bug:0,pattern:0,decision:0,rule:0,debug:0,test:0,review:0,validation:0,general:0};for(const n of o)a[n.type]=(a[n.type]??0)+1;return a},allCategories:()=>{const{entries:o}=c(),a=new Set;for(const n of o)n.category&&a.add(n.category);return Array.from(a).sort()},allKeywords:()=>{const{entries:o}=c(),a=new Set;for(const n of o)for(const d of n.keywords)a.add(d);return Array.from(a).sort()}})),ze={general:{label:"General",icon:e.jsx(J,{size:14,strokeWidth:1.8}),tintBg:"var(--color-tint-pending)",color:"#A09D97"},planning:{label:"Planning",icon:e.jsx(Ce,{size:14,strokeWidth:1.8}),tintBg:"var(--color-tint-planning)",color:"#9178B5"},execution:{label:"Execution",icon:e.jsx(Te,{size:14,strokeWidth:1.8}),tintBg:"var(--color-tint-exploring)",color:"#5B8DB8"},debug:{label:"Debug",icon:e.jsx(we,{size:14,strokeWidth:1.8}),tintBg:"var(--color-tint-blocked)",color:"#C46555"},test:{label:"Test",icon:e.jsx(R,{size:14,strokeWidth:1.8}),tintBg:"var(--color-tint-completed)",color:"#5A9E78"},review:{label:"Review",icon:e.jsx(ce,{size:14,strokeWidth:1.8}),tintBg:"rgba(219,176,108,0.12)",color:"#C4A055"},validation:{label:"Validation",icon:e.jsx(R,{size:14,strokeWidth:1.8}),tintBg:"rgba(90,158,120,0.10)",color:"#3D8B5F"}},Le=["general","planning","execution","debug","test","review","validation"],Me={label:"",icon:e.jsx(J,{size:14,strokeWidth:1.8}),tintBg:"var(--color-tint-pending)",color:"#A09D97"};function I(r){return ze[r]??{...Me,label:r.charAt(0).toUpperCase()+r.slice(1)}}const We={bug:{bg:"var(--color-tint-blocked)",text:"#C46555"},pattern:{bg:"var(--color-tint-exploring)",text:"#5B8DB8"},decision:{bg:"var(--color-tint-planning)",text:"#9178B5"},rule:{bg:"var(--color-tint-completed)",text:"#5A9E78"},debug:{bg:"rgba(196,101,85,0.10)",text:"#B85B4A"},test:{bg:"rgba(90,158,120,0.10)",text:"#3D8B5F"},review:{bg:"rgba(219,176,108,0.12)",text:"#C4A055"},validation:{bg:"rgba(91,141,184,0.10)",text:"#4A7DA8"},general:{bg:"var(--color-tint-pending)",text:"#A09D97"}};function $e(r){if(!r)return"--";const c=new Date(r);if(isNaN(c.getTime()))return"--";const a=Date.now()-c.getTime(),n=Math.floor(a/6e4);if(n<1)return"now";if(n<60)return`${n}m ago`;const d=Math.floor(n/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}function Ve({onAddEntry:r}){const c=f(s=>s.entries),o=f(s=>s.typeFilter),a=f(s=>s.keywordFilter),n=f(s=>s.search),d=f(s=>s.selectedEntry),g=f(s=>s.setSelectedEntry),y=f(s=>s.setKeywordFilter),u=f(s=>s.hiddenColumns),h=f(s=>s.toggleColumn),v=p.useMemo(()=>{const s=new Set;for(const x of c)x.category&&s.add(x.category);const i=[];for(const x of Le)s.has(x)&&(i.push(x),s.delete(x));for(const x of Array.from(s).sort())i.push(x);return i},[c]),N=p.useMemo(()=>{const s=new Set;for(const i of c)for(const x of i.keywords)s.add(x);return Array.from(s).sort()},[c]),w=p.useMemo(()=>{let s=c;if(o!=="all"&&(s=s.filter(i=>i.type===o)),a!=="all"&&(s=s.filter(i=>i.keywords.includes(a))),n){const i=n.toLowerCase();s=s.filter(x=>x.title.toLowerCase().includes(i)||x.content.toLowerCase().includes(i)||x.id.toLowerCase().includes(i)||x.keywords.some(C=>C.toLowerCase().includes(i)))}return s},[c,o,a,n]),m=p.useMemo(()=>{const s={};for(const i of v)s[i]=[];for(const i of w){const x=i.category||"general";s[x]||(s[x]=[]),s[x].push(i)}return s},[w,v]),k=p.useMemo(()=>{const s={};for(const i of c){const x=i.category||"general";s[x]=(s[x]??0)+1}return s},[c]),S=p.useMemo(()=>v.filter(s=>!u.has(s)),[v,u]);return e.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-[6px] px-5 py-2 border-b border-border-divider bg-bg-primary shrink-0",children:[v.map(s=>{const i=I(s),x=!u.has(s),C=k[s]??0;return e.jsxs("button",{type:"button",onClick:()=>h(s),className:["text-[11px] font-medium px-[10px] py-[4px] rounded-full border cursor-pointer transition-all","flex items-center gap-[5px]",x?"bg-bg-card text-text-primary border-border hover:shadow-sm":"bg-bg-secondary text-text-quaternary border-border-divider opacity-60"].join(" "),style:x?{borderColor:i.color,boxShadow:`0 0 0 1px ${i.color}22`}:void 0,children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0 transition-opacity",style:{background:i.color,opacity:x?1:.35}}),i.label,e.jsx("span",{className:"text-[10px] font-mono opacity-60",children:C})]},s)}),N.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-[18px] bg-border-divider mx-1"}),e.jsx(ee,{size:11,strokeWidth:2,className:"text-text-quaternary shrink-0"}),N.map(s=>{const i=a===s;return e.jsx("button",{type:"button",onClick:()=>y(i?"all":s),className:["text-[10px] font-medium px-2 py-[2px] rounded-[4px] border cursor-pointer transition-all",i?"bg-text-primary text-white border-text-primary":"bg-bg-card text-text-tertiary border-border-divider hover:border-text-tertiary hover:text-text-primary"].join(" "),children:s},s)})]})]}),e.jsxs("div",{className:"flex gap-3 flex-1 overflow-x-auto p-3",children:[S.map((s,i)=>{const x=I(s),C=m[s]??[];return e.jsxs("div",{className:"flex flex-col min-w-[260px] flex-1 bg-bg-secondary rounded-[12px] overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-[14px] py-3 border-b border-black/[0.04]",children:[e.jsx("div",{className:"w-7 h-7 rounded-[8px] flex items-center justify-center shrink-0",style:{background:x.tintBg,color:x.color},children:x.icon}),e.jsx("span",{className:"text-[13px] font-bold text-text-primary",children:x.label}),e.jsx("span",{className:"text-[10px] text-text-tertiary bg-bg-card px-[6px] rounded-full font-mono",children:C.length}),e.jsx("button",{type:"button",onClick:r,className:"ml-auto w-6 h-6 rounded-[6px] border border-dashed border-border bg-transparent cursor-pointer flex items-center justify-center text-text-quaternary hover:border-text-tertiary hover:text-text-primary hover:bg-bg-card transition-all",children:e.jsx(Y,{size:12,strokeWidth:2})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-2 flex flex-col gap-2",children:[C.map((E,D)=>e.jsx(qe,{entry:E,selected:d===E.id,onClick:()=>g(E.id),index:i*100+D},E.id)),C.length===0&&e.jsx("div",{className:"flex items-center justify-center py-8 text-[11px] text-text-quaternary",children:"No entries"})]})]},s)}),S.length===0&&e.jsx("div",{className:"flex items-center justify-center flex-1 text-[13px] text-text-tertiary",children:"All columns hidden — click a category tag above to show it."})]})]})}function qe({entry:r,selected:c,onClick:o,index:a}){const n=We[r.type];return e.jsxs(L.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,delay:Math.min(a*.03,.3)},onClick:o,className:["bg-bg-card rounded-[10px] px-[14px] py-3 border cursor-pointer","transition-all duration-[180ms]","hover:-translate-y-[2px] hover:shadow-[0_4px_16px_rgba(0,0,0,0.06)] hover:border-border",c?"border-[#9178B5] shadow-[0_0_0_2px_rgba(145,120,181,0.2)]":"border-border-divider"].join(" "),children:[e.jsxs("div",{className:"flex items-center gap-[6px] mb-2",children:[e.jsx("span",{className:"text-[9px] font-bold px-[7px] py-[2px] rounded-[4px] uppercase font-mono tracking-[0.04em]",style:{background:n.bg,color:n.text},children:r.type}),e.jsx("span",{className:"text-[10px] font-mono text-text-quaternary ml-auto",children:r.id})]}),e.jsx("div",{className:"text-[13px] text-text-primary font-medium leading-[1.5] mb-2 line-clamp-3",children:r.content||r.title}),r.keywords.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[r.keywords.slice(0,4).map(d=>e.jsx("span",{className:"text-[9px] px-[5px] py-[1px] rounded-[3px] bg-bg-secondary text-text-tertiary font-mono",children:d},d)),r.keywords.length>4&&e.jsxs("span",{className:"text-[9px] text-text-quaternary font-mono",children:["+",r.keywords.length-4]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-[10px] text-text-quaternary font-mono flex items-center gap-[3px]",children:[e.jsx(le,{size:10,strokeWidth:2}),$e(r.timestamp)]}),r.file&&e.jsxs("span",{className:"text-[10px] text-text-tertiary flex items-center gap-[3px] ml-auto",children:[e.jsx(U,{size:10,strokeWidth:2}),r.file.split("/").pop()]})]})]})}const Pe={bug:{bg:"var(--color-tint-blocked)",text:"#C46555"},pattern:{bg:"var(--color-tint-exploring)",text:"#5B8DB8"},decision:{bg:"var(--color-tint-planning)",text:"#9178B5"},rule:{bg:"var(--color-tint-completed)",text:"#5A9E78"},debug:{bg:"rgba(196,101,85,0.10)",text:"#B85B4A"},test:{bg:"rgba(90,158,120,0.10)",text:"#3D8B5F"},review:{bg:"rgba(219,176,108,0.12)",text:"#C4A055"},validation:{bg:"rgba(91,141,184,0.10)",text:"#4A7DA8"},general:{bg:"var(--color-tint-pending)",text:"#A09D97"}},Oe={bug:"#C46555",pattern:"#5B8DB8",decision:"#9178B5",rule:"#5A9E78",debug:"#B85B4A",test:"#3D8B5F",review:"#C4A055",validation:"#4A7DA8",general:"#A09D97"},te={general:"#A09D97",planning:"#9178B5",execution:"#5B8DB8",debug:"#C46555",test:"#5A9E78",review:"#C4A055",validation:"#3D8B5F"},Re=[{value:"all",label:"All"},{value:"bug",label:"Bug"},{value:"pattern",label:"Pattern"},{value:"decision",label:"Decision"},{value:"rule",label:"Rule"},{value:"debug",label:"Debug"},{value:"test",label:"Test"},{value:"review",label:"Review"},{value:"validation",label:"Validation"},{value:"general",label:"General"}],K=[{key:"id",label:"ID",width:60},{key:"type",label:"Type",width:80},{key:"category",label:"Category",width:100},{key:"content",label:"Content",alwaysVisible:!0},{key:"keywords",label:"Keywords",width:180},{key:"file",label:"File",width:140},{key:"added",label:"Added",width:90},{key:"actions",label:"",width:80,alwaysVisible:!0}];function Ie(r){if(!r)return"--";const c=new Date(r);if(isNaN(c.getTime()))return"--";const a=Date.now()-c.getTime(),n=Math.floor(a/6e4);if(n<1)return"now";if(n<60)return`${n}m ago`;const d=Math.floor(n/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}function Ke(){const r=f(t=>t.entries),c=f(t=>t.typeFilter),o=f(t=>t.setTypeFilter),a=f(t=>t.categoryFilter),n=f(t=>t.setCategoryFilter),d=f(t=>t.keywordFilter),g=f(t=>t.setKeywordFilter),y=f(t=>t.search),u=f(t=>t.selectedEntry),h=f(t=>t.setSelectedEntry),v=f(t=>t.deleteEntry),N=f(t=>t.addEntry),[w,m]=p.useState("timestamp"),[k,S]=p.useState("desc"),[s,i]=p.useState(!1),[x,C]=p.useState("bug"),[E,D]=p.useState(""),[z,re]=p.useState(new Set),oe=p.useCallback(t=>{re(l=>{const b=new Set(l);return b.has(t)?b.delete(t):b.add(t),b})},[]),T=p.useMemo(()=>K.filter(t=>t.alwaysVisible||!z.has(t.key)),[z]),M=p.useMemo(()=>{const t=new Set;for(const l of r)l.category&&t.add(l.category);return Array.from(t).sort()},[r]),W=p.useMemo(()=>{const t=new Set;for(const l of r)for(const b of l.keywords)t.add(b);return Array.from(t).sort()},[r]),se=p.useMemo(()=>{const t={all:r.length,bug:0,pattern:0,decision:0,rule:0,general:0};for(const l of r)t[l.type]=(t[l.type]??0)+1;return t},[r]),ae=p.useMemo(()=>{const t={};for(const l of r){const b=l.category||"general";t[b]=(t[b]??0)+1}return t},[r]),$=p.useMemo(()=>{let t=r;if(c!=="all"&&(t=t.filter(l=>l.type===c)),a!=="all"&&(t=t.filter(l=>l.category===a)),d!=="all"&&(t=t.filter(l=>l.keywords.includes(d))),y){const l=y.toLowerCase();t=t.filter(b=>b.title.toLowerCase().includes(l)||b.content.toLowerCase().includes(l)||b.id.toLowerCase().includes(l)||b.keywords.some(j=>j.toLowerCase().includes(l)))}return t},[r,c,a,d,y]),V=p.useMemo(()=>{const t=[...$];return t.sort((l,b)=>{let j=0;return w==="timestamp"?j=new Date(l.timestamp).getTime()-new Date(b.timestamp).getTime():w==="id"?j=l.id.localeCompare(b.id):w==="type"?j=l.type.localeCompare(b.type):w==="category"&&(j=(l.category||"").localeCompare(b.category||"")),k==="desc"?-j:j}),t},[$,w,k]),q=p.useCallback(t=>{m(l=>l===t?(S(b=>b==="desc"?"asc":"desc"),l):(S("desc"),t))},[]),P=p.useCallback(async()=>{E.trim()&&(await N(x,E.trim(),"learnings.md"),D(""),i(!1))},[x,E,N]),ne=p.useCallback((t,l)=>{t.stopPropagation(),v(l)},[v]);return e.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-5 py-2 border-b border-border-divider bg-bg-primary shrink-0",children:[e.jsx("span",{className:"text-[10px] font-semibold text-text-quaternary uppercase tracking-[0.06em]",children:"Type"}),Re.map(t=>{const l=c===t.value;return e.jsxs("button",{type:"button",onClick:()=>o(t.value),className:["text-[11px] font-medium px-3 py-1 rounded-full border cursor-pointer transition-all","flex items-center gap-[5px]",l?"bg-text-primary text-white border-text-primary":"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary"].join(" "),children:[t.value!=="all"&&e.jsx("span",{className:"w-[6px] h-[6px] rounded-full",style:{background:l?"#fff":Oe[t.value]}}),t.label,e.jsx("span",{className:"text-[10px] font-mono opacity-70",children:se[t.value]??0})]},t.value)}),M.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-[18px] bg-border-divider mx-1"}),e.jsx("span",{className:"text-[10px] font-semibold text-text-quaternary uppercase tracking-[0.06em]",children:"Category"}),e.jsx("button",{type:"button",onClick:()=>n("all"),className:["text-[11px] font-medium px-2 py-[3px] rounded-full border cursor-pointer transition-all",a==="all"?"bg-text-primary text-white border-text-primary":"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary"].join(" "),children:"All"}),M.map(t=>{const l=a===t,b=te[t]??"#A09D97";return e.jsxs("button",{type:"button",onClick:()=>n(l?"all":t),className:["text-[11px] font-medium px-[10px] py-[3px] rounded-full border cursor-pointer transition-all","flex items-center gap-[5px]",l?"border-transparent text-white":"bg-bg-card text-text-secondary border-border hover:border-text-tertiary hover:text-text-primary"].join(" "),style:l?{background:b}:void 0,children:[e.jsx("span",{className:"w-[6px] h-[6px] rounded-full",style:{background:l?"#fff":b}}),t.charAt(0).toUpperCase()+t.slice(1),e.jsx("span",{className:"text-[10px] font-mono opacity-70",children:ae[t]??0})]},t)})]}),W.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-[18px] bg-border-divider mx-1"}),e.jsx("span",{className:"text-[10px] font-semibold text-text-quaternary uppercase tracking-[0.06em]",children:e.jsx(ee,{size:10,strokeWidth:2,className:"inline-block mr-[2px] align-middle"})}),W.map(t=>{const l=d===t;return e.jsx("button",{type:"button",onClick:()=>g(l?"all":t),className:["text-[10px] font-medium px-2 py-[2px] rounded-[4px] border cursor-pointer transition-all",l?"bg-text-primary text-white border-text-primary":"bg-bg-card text-text-tertiary border-border-divider hover:border-text-tertiary hover:text-text-primary"].join(" "),children:t},t)})]}),e.jsx("div",{className:"flex-1"}),e.jsx("div",{className:"flex items-center gap-1",children:K.filter(t=>!t.alwaysVisible).map(t=>{const l=z.has(t.key);return e.jsxs("button",{type:"button",onClick:()=>oe(t.key),className:["text-[10px] font-medium px-[6px] py-[3px] rounded-[4px] border cursor-pointer transition-all","flex items-center gap-[3px]",l?"bg-bg-secondary text-text-quaternary border-border-divider opacity-50":"bg-bg-card text-text-tertiary border-border hover:text-text-primary"].join(" "),title:`${l?"Show":"Hide"} ${t.label} column`,children:[l?e.jsx(Se,{size:9,strokeWidth:2}):e.jsx(Ae,{size:9,strokeWidth:2}),t.label]},t.key)})}),e.jsx("div",{className:"w-px h-[18px] bg-border-divider"}),e.jsxs("button",{type:"button",onClick:()=>q("timestamp"),className:"text-[11px] font-medium px-[10px] py-1 rounded-[6px] border border-border bg-bg-card text-text-tertiary cursor-pointer font-sans transition-all hover:border-text-tertiary hover:text-text-primary flex items-center gap-1",children:[e.jsx(Z,{size:12,strokeWidth:2,className:k==="asc"?"rotate-180 transition-transform":"transition-transform"}),k==="desc"?"Newest":"Oldest"]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsx("tr",{children:T.map(t=>{const b={id:"id",type:"type",category:"category",added:"timestamp"}[t.key];return e.jsx(Ge,{width:t.width,active:b?w===b:!1,onClick:b?()=>q(b):void 0,children:t.label},t.key)})})}),e.jsxs("tbody",{children:[s&&e.jsx("tr",{children:T.map(t=>{const l="var(--color-tint-planning)",b="rgba(145,120,181,0.3)";return t.key==="id"?e.jsx("td",{className:"px-3 py-[10px] border-b-2 align-top",style:{background:l,borderBottomColor:b},children:e.jsx("span",{className:"font-mono text-[11px] font-semibold",style:{color:"#9178B5"},children:"NEW"})},t.key):t.key==="type"?e.jsx("td",{className:"px-3 py-[10px] border-b-2 align-top",style:{background:l,borderBottomColor:b},children:e.jsxs("select",{value:x,onChange:j=>C(j.target.value),className:"px-2 py-1 rounded-[6px] border border-border bg-bg-card text-[11px] text-text-primary font-sans outline-none cursor-pointer",children:[e.jsx("option",{value:"bug",children:"bug"}),e.jsx("option",{value:"pattern",children:"pattern"}),e.jsx("option",{value:"decision",children:"decision"}),e.jsx("option",{value:"rule",children:"rule"}),e.jsx("option",{value:"debug",children:"debug"}),e.jsx("option",{value:"test",children:"test"}),e.jsx("option",{value:"review",children:"review"}),e.jsx("option",{value:"validation",children:"validation"}),e.jsx("option",{value:"general",children:"general"})]})},t.key):t.key==="content"?e.jsx("td",{className:"px-3 py-[10px] border-b-2 align-top",style:{background:l,borderBottomColor:b},children:e.jsx("input",{type:"text",value:E,onChange:j=>D(j.target.value),placeholder:"Describe the entry...",autoFocus:!0,onKeyDown:j=>{j.key==="Enter"&&P(),j.key==="Escape"&&i(!1)},className:"w-full px-[10px] py-[6px] rounded-[6px] border border-border bg-bg-card text-[13px] text-text-primary font-sans outline-none focus:border-[#9178B5] transition-colors"})},t.key):t.key==="actions"?e.jsx("td",{className:"px-3 py-[10px] border-b-2 align-top",style:{background:l,borderBottomColor:b},children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{type:"button",onClick:()=>void P(),className:"px-3 py-[5px] rounded-[6px] border-none bg-text-primary text-white text-[11px] font-semibold cursor-pointer font-sans hover:bg-[#1A1816] transition-all",children:"Save"}),e.jsx("button",{type:"button",onClick:()=>i(!1),className:"px-3 py-[5px] rounded-[6px] border-none bg-bg-secondary text-text-secondary text-[11px] font-semibold cursor-pointer font-sans hover:bg-bg-tertiary transition-all",children:"Cancel"})]})},t.key):e.jsx("td",{className:"px-3 py-[10px] border-b-2 align-top font-mono text-[11px] text-text-tertiary",style:{background:l,borderBottomColor:b},children:"—"},t.key)})}),V.map((t,l)=>e.jsx(He,{entry:t,selected:u===t.id,onClick:()=>h(t.id),onDelete:ne,index:l,visibleColumns:T},t.id)),V.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:T.length,className:"text-center py-12 text-[13px] text-text-tertiary",children:"No entries found"})})]})]})})]})}function Ge({children:r,width:c,active:o,onClick:a}){return e.jsxs("th",{style:{width:c?`${c}px`:void 0},onClick:a,className:["sticky top-0 z-10 text-left text-[10px] font-semibold uppercase tracking-[0.06em] px-3 py-2","bg-bg-secondary border-b border-border select-none whitespace-nowrap",a?"cursor-pointer":"",o?"text-text-primary":"text-text-tertiary hover:text-text-primary"].join(" "),children:[r,o&&e.jsx(Z,{size:10,strokeWidth:2,className:"inline-block align-middle ml-[3px]"})]})}function He({entry:r,selected:c,onClick:o,onDelete:a,index:n,visibleColumns:d}){const g=Pe[r.type],y=te[r.category]??"#A09D97",u={id:e.jsx("span",{className:"font-mono text-[11px] text-text-tertiary whitespace-nowrap",children:r.id}),type:e.jsx("span",{className:"text-[9px] font-bold px-[7px] py-[2px] rounded-[4px] uppercase font-mono tracking-[0.04em] whitespace-nowrap inline-block",style:{background:g.bg,color:g.text},children:r.type}),category:e.jsx("span",{className:"text-[10px] font-semibold px-[7px] py-[2px] rounded-[4px] uppercase font-mono tracking-[0.04em] whitespace-nowrap inline-block",style:{background:`${y}15`,color:y},children:r.category||"general"}),content:e.jsx("span",{className:"text-[13px] text-text-primary font-medium leading-[1.5] max-w-[500px] block",children:r.content||r.title}),keywords:e.jsxs("div",{className:"flex flex-wrap gap-[3px]",children:[r.keywords.slice(0,3).map(h=>e.jsx("span",{className:"text-[9px] px-[5px] py-[1px] rounded-[3px] bg-bg-secondary text-text-tertiary font-mono whitespace-nowrap",children:h},h)),r.keywords.length>3&&e.jsxs("span",{className:"text-[9px] text-text-quaternary font-mono",children:["+",r.keywords.length-3]})]}),file:e.jsx("span",{className:"font-mono text-[11px] text-text-tertiary whitespace-nowrap",children:r.file?r.file.split("/").pop():""}),added:e.jsx("span",{className:"font-mono text-[11px] text-text-quaternary whitespace-nowrap",children:Ie(r.timestamp)}),actions:e.jsxs("div",{className:"flex gap-[2px] whitespace-nowrap",children:[e.jsx("button",{type:"button",onClick:h=>{h.stopPropagation(),o()},className:"w-7 h-7 rounded-[6px] border-none bg-transparent cursor-pointer text-text-quaternary flex items-center justify-center transition-all opacity-0 group-hover:opacity-100 hover:bg-bg-hover hover:text-text-primary",children:e.jsx(X,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",onClick:h=>a(h,r.id),className:"w-7 h-7 rounded-[6px] border-none bg-transparent cursor-pointer text-text-quaternary flex items-center justify-center transition-all opacity-0 group-hover:opacity-100 hover:bg-[rgba(196,101,85,0.08)] hover:text-[#C46555]",children:e.jsx(Q,{size:14,strokeWidth:1.8})})]})};return e.jsx(L.tr,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.15,delay:Math.min(n*.02,.3)},onClick:o,className:["cursor-pointer transition-colors group",c?"[&>td]:bg-tint-planning":"hover:[&>td]:bg-bg-hover"].join(" "),children:d.map(h=>e.jsx("td",{className:"px-3 py-[10px] border-b border-border-divider align-top",children:u[h.key]},h.key))})}const G={bug:{bg:"var(--color-tint-blocked)",text:"#C46555"},pattern:{bg:"var(--color-tint-exploring)",text:"#5B8DB8"},decision:{bg:"var(--color-tint-planning)",text:"#9178B5"},rule:{bg:"var(--color-tint-completed)",text:"#5A9E78"},debug:{bg:"rgba(196,101,85,0.10)",text:"#B85B4A"},test:{bg:"rgba(90,158,120,0.10)",text:"#3D8B5F"},review:{bg:"rgba(219,176,108,0.12)",text:"#C4A055"},validation:{bg:"rgba(91,141,184,0.10)",text:"#4A7DA8"},general:{bg:"var(--color-tint-pending)",text:"#A09D97"}};function Ye(r){if(!r)return"--";const c=new Date(r);if(isNaN(c.getTime()))return"--";const a=Date.now()-c.getTime(),n=Math.floor(a/6e4);if(n<1)return"now";if(n<60)return`${n}m ago`;const d=Math.floor(n/60);if(d<24)return`${d}h ago`;const g=Math.floor(d/24);return g<7?`${g}d ago`:c.toLocaleDateString()}function Ue({entry:r,onClose:c}){const o=f(g=>g.deleteEntry),a=p.useMemo(()=>G[r.type]??G.general,[r.type]),n=p.useMemo(()=>r.file?r.file.split("/").pop():"",[r.file]);function d(){o(r.id),c()}return e.jsxs(L.aside,{initial:{width:0,opacity:0},animate:{width:380,opacity:1},exit:{width:0,opacity:0},transition:{type:"spring",stiffness:400,damping:30},className:"shrink-0 border-l border-border bg-bg-primary overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border-divider shrink-0 min-h-[48px]",children:[e.jsx("span",{className:"text-[12px] font-semibold text-text-primary",children:"Entry Detail"}),e.jsx("button",{type:"button",onClick:c,"aria-label":"Close detail panel",className:"w-7 h-7 rounded-[8px] border-none bg-transparent cursor-pointer text-text-tertiary flex items-center justify-center hover:bg-bg-hover hover:text-text-primary transition-colors",children:e.jsx(de,{size:14,strokeWidth:2})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-4",style:{width:380},children:[e.jsx("span",{className:"inline-flex items-center gap-[5px] text-[10px] font-bold px-[10px] py-[3px] rounded-[6px] mb-3 uppercase tracking-[0.04em]",style:{background:a.bg,color:a.text},children:r.type}),e.jsx("div",{className:"text-[16px] font-bold text-text-primary leading-[1.5] mb-4",children:r.title||r.content}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-4",children:[e.jsx(_,{label:"ID",value:r.id,mono:!0}),e.jsx(_,{label:"Added",value:Ye(r.timestamp),mono:!0}),e.jsx(_,{label:"File",value:n||"--",mono:!0}),e.jsx(_,{label:"Type",value:r.type})]}),r.content&&r.title&&r.content!==r.title&&e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-[0.06em] text-text-quaternary mb-[6px]",children:"Description"}),e.jsx("div",{className:"text-[13px] text-text-secondary leading-[1.6] whitespace-pre-wrap",children:r.content})]}),e.jsxs("div",{className:"flex gap-2 pt-3 border-t border-border-divider",children:[e.jsxs("button",{type:"button",className:"flex-1 py-2 rounded-[8px] border border-text-primary bg-text-primary text-[12px] font-semibold text-white cursor-pointer font-sans flex items-center justify-center gap-[6px] hover:bg-[#1A1816] transition-all",children:[e.jsx(X,{size:13,strokeWidth:2}),"Edit"]}),e.jsxs("button",{type:"button",onClick:d,className:"flex-1 py-2 rounded-[8px] border border-border bg-bg-card text-[12px] font-semibold text-text-secondary cursor-pointer font-sans flex items-center justify-center gap-[6px] hover:border-[#C46555] hover:text-[#C46555] hover:bg-[rgba(196,101,85,0.08)] transition-all",children:[e.jsx(Q,{size:13,strokeWidth:2}),"Delete"]})]})]})]})}function _({label:r,value:c,mono:o}){return e.jsxs("div",{className:"px-3 py-2 bg-bg-secondary rounded-[8px]",children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-[0.04em] text-text-quaternary mb-[2px]",children:r}),e.jsx("div",{className:["text-[13px] font-semibold text-text-primary",o?"font-mono text-[12px]":""].join(" "),children:c})]})}const Je=[{value:"bug",label:"Bug",activeBg:"var(--color-tint-blocked)",activeText:"#C46555",activeBorder:"#C46555"},{value:"pattern",label:"Pattern",activeBg:"var(--color-tint-exploring)",activeText:"#5B8DB8",activeBorder:"#5B8DB8"},{value:"decision",label:"Decision",activeBg:"var(--color-tint-planning)",activeText:"#9178B5",activeBorder:"#9178B5"},{value:"rule",label:"Rule",activeBg:"var(--color-tint-completed)",activeText:"#5A9E78",activeBorder:"#5A9E78"},{value:"debug",label:"Debug",activeBg:"rgba(196,101,85,0.10)",activeText:"#B85B4A",activeBorder:"#B85B4A"},{value:"test",label:"Test",activeBg:"rgba(90,158,120,0.10)",activeText:"#3D8B5F",activeBorder:"#3D8B5F"},{value:"review",label:"Review",activeBg:"rgba(219,176,108,0.12)",activeText:"#C4A055",activeBorder:"#C4A055"},{value:"validation",label:"Validation",activeBg:"rgba(91,141,184,0.10)",activeText:"#4A7DA8",activeBorder:"#4A7DA8"}];function Qe({open:r,onOpenChange:c}){const o=f(m=>m.addEntry),a=f(m=>m.files),[n,d]=p.useState("bug"),[g,y]=p.useState(""),[u,h]=p.useState(""),[v,N]=p.useState(!1);p.useEffect(()=>{r||(d("bug"),y(""),h(""))},[r]),p.useEffect(()=>{a.length>0&&!u&&h(a[0].path)},[a,u]);const w=p.useCallback(async()=>{g.trim()&&(N(!0),await o(n,g.trim(),u),N(!1),c(!1))},[n,g,u,o,c]);return e.jsx(xe,{open:r,onOpenChange:c,children:e.jsxs(pe,{children:[e.jsx(be,{className:"fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),e.jsxs(ue,{className:B("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[480px] max-w-[95vw] max-h-[80vh]","rounded-[16px] border border-border bg-bg-card shadow-lg","flex flex-col overflow-hidden","focus:outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"),children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border-divider shrink-0",children:[e.jsx(me,{className:"text-[16px] font-bold text-text-primary",children:"New Spec Entry"}),e.jsx(O,{className:B("w-7 h-7 flex items-center justify-center rounded-[8px]","text-text-tertiary hover:text-text-primary hover:bg-bg-hover","transition-colors border-none bg-transparent cursor-pointer"),"aria-label":"Close",children:e.jsxs("svg",{className:"w-[14px] h-[14px]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-5",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-[11px] font-semibold text-text-tertiary uppercase tracking-[0.04em] mb-[6px]",children:"Type"}),e.jsx("div",{className:"grid grid-cols-4 gap-2",children:Je.map(m=>{const k=n===m.value;return e.jsx("button",{type:"button",onClick:()=>d(m.value),className:B("py-[10px] rounded-[10px] border-[1.5px] bg-bg-card cursor-pointer","text-center text-[11px] font-semibold font-sans transition-all"),style:k?{borderColor:m.activeBorder,color:m.activeText,background:m.activeBg,fontWeight:700}:{borderColor:"var(--color-border, #E8E5DE)",color:"var(--color-text-tertiary, #A09D97)"},children:m.label},m.value)})})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-[11px] font-semibold text-text-tertiary uppercase tracking-[0.04em] mb-[6px]",children:"Content"}),e.jsx("textarea",{value:g,onChange:m=>y(m.target.value),placeholder:"Describe the bug, pattern, decision, or rule...",rows:5,className:B("w-full min-h-[120px] px-[14px] py-[10px] rounded-[8px]","border border-border bg-bg-primary text-[13px] text-text-primary","font-sans leading-[1.6] resize-y outline-none","focus:border-[#9178B5] transition-colors","placeholder:text-text-quaternary")}),e.jsx("div",{className:"text-[11px] text-text-quaternary mt-1",children:"Supports markdown. Will be timestamped automatically."})]}),a.length>0&&e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-[11px] font-semibold text-text-tertiary uppercase tracking-[0.04em] mb-[6px]",children:"Target File"}),e.jsx("select",{value:u,onChange:m=>h(m.target.value),className:B("w-full px-3 py-2 rounded-[8px] border border-border","bg-bg-primary text-[12px] text-text-primary font-sans","outline-none cursor-pointer","focus:border-[#9178B5] transition-colors"),children:a.map(m=>e.jsxs("option",{value:m.path,children:[m.name," (",m.category,")"]},m.path))})]}),u&&e.jsxs("div",{className:"bg-bg-primary rounded-[10px] px-4 py-[14px] border border-border-divider",children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-[0.06em] text-text-quaternary mb-2",children:"Will write to"}),e.jsxs("div",{className:"flex items-center gap-[6px] px-[10px] py-[6px] rounded-[6px] bg-bg-card border border-border-divider text-[11px] font-mono text-text-secondary",children:[e.jsx(U,{size:12,strokeWidth:1.8,className:"text-text-tertiary"}),e.jsx("span",{className:"text-text-primary font-semibold",children:u})]})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 py-4 border-t border-border-divider shrink-0",children:[e.jsx(O,{className:B("px-4 py-2 rounded-[8px] border border-border bg-bg-card","text-[12px] font-semibold text-text-secondary cursor-pointer font-sans","hover:border-text-tertiary hover:text-text-primary transition-all"),children:"Cancel"}),e.jsxs("button",{type:"button",disabled:!g.trim()||v,onClick:()=>void w(),className:B("flex items-center gap-[6px] px-[14px] py-2 rounded-[8px] border-none","bg-text-primary text-white text-[12px] font-semibold cursor-pointer font-sans","hover:bg-[#1A1816] hover:-translate-y-px hover:shadow-md transition-all","disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:translate-y-0 disabled:hover:shadow-none"),children:[e.jsx(je,{size:14,strokeWidth:2}),v?"Adding...":"Add Entry"]})]})]})]})})}const Xe=[{label:"Kanban",icon:e.jsx(ye,{size:14,strokeWidth:1.8}),shortcut:"1"},{label:"Table",icon:e.jsx(he,{size:14,strokeWidth:1.8}),shortcut:"2"}],H=["kanban","table"];function dt(){const{activeView:r,setActiveView:c,fetchEntries:o,fetchFiles:a,entries:n,search:d,setSearch:g,selectedEntry:y,setSelectedEntry:u,loading:h,error:v}=f(fe(i=>({activeView:i.activeView,setActiveView:i.setActiveView,fetchEntries:i.fetchEntries,fetchFiles:i.fetchFiles,entries:i.entries,search:i.search,setSearch:i.setSearch,selectedEntry:i.selectedEntry,setSelectedEntry:i.setSelectedEntry,loading:i.loading,error:i.error}))),[N,w]=p.useState(!1),{register:m,unregister:k}=p.useContext(ge),S=p.useCallback(i=>c(H[i]),[c]);p.useEffect(()=>{m({items:Xe.map(i=>({label:i.label,icon:i.icon,shortcut:i.shortcut})),activeIndex:H.indexOf(r),onSwitch:S})},[r,m,S]),p.useEffect(()=>()=>k(),[k]),p.useEffect(()=>{function i(x){x.target instanceof HTMLInputElement||x.target instanceof HTMLTextAreaElement||(x.key==="1"?c("kanban"):x.key==="2"&&c("table"))}return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[c]),p.useEffect(()=>{o(),a()},[o,a]);const s=y?n.find(i=>i.id===y)??null:null;return h&&n.length===0?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading specs..."}):v&&n.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[e.jsx("span",{className:"text-status-failed text-[length:var(--font-size-sm)]",children:"Failed to load specs"}),e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-xs)]",children:v}),e.jsx("button",{type:"button",onClick:()=>void o(),className:"px-3 py-1 rounded-[var(--radius-md)] border border-border bg-bg-card text-[11px] font-semibold text-text-secondary hover:text-text-primary transition-all",children:"Retry"})]}):e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-[10px] px-5 py-[10px] border-b border-border-divider shrink-0",children:[e.jsx("span",{className:"text-[16px] font-bold text-text-primary",children:"Specs"}),e.jsxs("span",{className:"text-[11px] text-text-tertiary font-mono tabular-nums",children:[n.length," entries"]}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"flex items-center gap-[6px] px-3 py-[5px] rounded-[8px] bg-bg-card w-[240px] focus-within:border-[#9178B5] transition-colors",style:{border:"var(--style-btn-secondary-border)"},children:[e.jsx(ve,{size:13,strokeWidth:2,className:"text-text-quaternary shrink-0"}),e.jsx("input",{type:"text",placeholder:"Search specs...",value:d,onChange:i=>g(i.target.value),className:"border-none bg-transparent outline-none text-[12px] text-text-primary font-sans w-full placeholder:text-text-quaternary"})]}),e.jsxs("button",{type:"button",onClick:()=>w(!0),className:"flex items-center gap-[6px] px-[14px] py-[6px] rounded-[8px] border-none bg-text-primary text-white text-[12px] font-semibold cursor-pointer font-sans hover:bg-[#1A1816] hover:[transform:var(--style-card-hover-transform)] hover:[box-shadow:var(--style-card-hover-shadow)] transition-all",children:[e.jsx(Y,{size:14,strokeWidth:2}),"New Entry"]})]}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden min-w-0",children:[r==="kanban"&&e.jsx("div",{className:"flex-1 flex flex-col overflow-hidden motion-safe:animate-[view-fade-in_250ms_ease-out_both]",children:e.jsx(Ve,{onAddEntry:()=>w(!0)})}),r==="table"&&e.jsx("div",{className:"flex-1 flex flex-col overflow-hidden motion-safe:animate-[view-fade-in_250ms_ease-out_both]",children:e.jsx(Ke,{})})]}),s&&e.jsx(Ue,{entry:s,onClose:()=>u(null)})]}),e.jsx(Qe,{open:N,onOpenChange:w})]})}export{dt as SpecsPage};
|