maestro-flow 0.3.7 → 0.3.9
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/commands/learn-decompose.md +3 -3
- package/.claude/commands/learn-follow.md +5 -5
- package/.claude/commands/learn-investigate.md +3 -3
- package/.claude/commands/learn-retro.md +303 -0
- package/.claude/commands/learn-second-opinion.md +3 -3
- package/.claude/commands/maestro-analyze.md +123 -99
- package/.claude/commands/maestro-brainstorm.md +2 -2
- package/.claude/commands/maestro-execute.md +137 -96
- package/.claude/commands/maestro-fork.md +111 -0
- package/.claude/commands/maestro-init.md +6 -6
- package/.claude/commands/maestro-learn.md +74 -298
- package/.claude/commands/maestro-merge.md +77 -0
- package/.claude/commands/maestro-milestone-audit.md +72 -60
- package/.claude/commands/maestro-milestone-complete.md +67 -59
- package/.claude/commands/maestro-milestone-release.md +6 -6
- package/.claude/commands/maestro-plan.md +151 -130
- package/.claude/commands/maestro-quick.md +4 -4
- package/.claude/commands/maestro-roadmap.md +5 -5
- package/.claude/commands/maestro-spec-generate.md +5 -5
- package/.claude/commands/maestro-ui-design.md +3 -3
- package/.claude/commands/maestro-verify.md +106 -87
- package/.claude/commands/maestro.md +10 -4
- package/.claude/commands/manage-codebase-rebuild.md +4 -4
- package/.claude/commands/manage-codebase-refresh.md +1 -1
- package/.claude/commands/manage-harvest.md +5 -5
- package/.claude/commands/manage-issue-discover.md +1 -1
- package/.claude/commands/manage-issue-execute.md +6 -6
- package/.claude/commands/manage-issue.md +6 -6
- package/.claude/commands/manage-learn.md +23 -17
- package/.claude/commands/manage-memory-capture.md +15 -17
- package/.claude/commands/manage-memory.md +3 -3
- package/.claude/commands/manage-status.md +24 -24
- package/.claude/commands/quality-business-test.md +5 -5
- package/.claude/commands/quality-debug.md +4 -4
- package/.claude/commands/quality-integration-test.md +4 -4
- package/.claude/commands/quality-refactor.md +3 -3
- package/.claude/commands/quality-retrospective.md +7 -7
- package/.claude/commands/quality-review.md +4 -4
- package/.claude/commands/quality-sync.md +3 -3
- package/.claude/commands/quality-test-gen.md +4 -4
- package/.claude/commands/quality-test.md +9 -9
- package/.claude/commands/spec-add.md +2 -2
- package/.claude/commands/spec-load.md +8 -3
- package/.claude/commands/spec-setup.md +5 -5
- package/.claude/commands/wiki-connect.md +3 -3
- package/.claude/commands/wiki-digest.md +30 -5
- package/.codex/skills/maestro-analyze/SKILL.md +52 -14
- package/.codex/skills/maestro-execute/SKILL.md +27 -26
- package/.codex/skills/maestro-milestone-audit/SKILL.md +103 -209
- package/.codex/skills/maestro-milestone-complete/SKILL.md +149 -158
- package/.codex/skills/maestro-plan/SKILL.md +47 -17
- package/.codex/skills/maestro-roadmap/SKILL.md +3 -2
- package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +2 -2
- package/.codex/skills/team-executor/roles/executor/commands/monitor.md +1 -1
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +2 -2
- package/.codex/skills/team-lifecycle-v4/specs/knowledge-transfer.md +2 -2
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-review/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-testing/roles/coordinator/commands/monitor.md +1 -1
- package/README.md +115 -227
- package/README.zh-CN.md +169 -187
- package/bin/maestro-mcp.js +1 -1
- package/chains/_intent-map.json +21 -9
- package/chains/_router.json +30 -77
- package/chains/brainstorm-driven.json +17 -6
- package/chains/full-lifecycle.json +22 -23
- package/chains/milestone-close.json +20 -7
- package/chains/milestone-fork-merge.json +50 -0
- package/chains/roadmap-driven.json +17 -6
- package/chains/spec-driven.json +17 -6
- package/dashboard/dist/assets/{ArtifactsPage-A9yzYtpj.js → ArtifactsPage-DZNCi6tn.js} +12 -7
- package/dashboard/dist/assets/ChatInput-Bvr-FeEq.js +49 -0
- package/dashboard/dist/assets/ChatPage-D9zTkJZo.js +22 -0
- package/dashboard/dist/assets/CollabPage-B4NAHXS2.js +1 -0
- package/dashboard/dist/assets/ExecutionPanel-CFt4LJyq.js +1 -0
- package/dashboard/dist/assets/KanbanPage-C8USth6H.js +21 -0
- package/dashboard/dist/assets/{MarkdownRenderer-CCXHaut3.js → MarkdownRenderer-X4af_WNb.js} +1 -1
- package/dashboard/dist/assets/McpPage-BKfCVIyU.js +21 -0
- package/dashboard/dist/assets/OutputPanel-BlBQFJSW.js +1 -0
- package/dashboard/dist/assets/ProblemsPanel-De3DLvoI.js +1 -0
- package/dashboard/dist/assets/{RequirementBoardPage-CEOvppGn.js → RequirementBoardPage-Bf1trzqs.js} +2 -2
- package/dashboard/dist/assets/{RequirementPage-DpnbTEqY.js → RequirementPage-Bllxe2XI.js} +10 -5
- package/dashboard/dist/assets/{SpecsPage-CYqOfFkB.js → SpecsPage-9lwxKT27.js} +2 -2
- package/dashboard/dist/assets/{SupervisorPage-B2sZwkq8.js → SupervisorPage-SusdfHFq.js} +1 -1
- package/dashboard/dist/assets/{TeamsPage-CkZdCAVZ.js → TeamsPage-DsuM6OwC.js} +2 -2
- package/dashboard/dist/assets/TreeBrowser-Q12qobZs.js +6 -0
- package/dashboard/dist/assets/WorkflowPage-D_Fzdy3_.js +6 -0
- package/dashboard/dist/assets/{arrow-left-6fktHyjN.js → arrow-left-Bqtb2hle.js} +1 -1
- package/dashboard/dist/assets/{check-Cbxq2l1-.js → check-u6fGOwQO.js} +1 -1
- package/dashboard/dist/assets/{chevron-right-Yts3bi8p.js → chevron-right-Csu22t58.js} +1 -1
- package/dashboard/dist/assets/{circle-4Ci4Xolf.js → circle-CMrkbRNg.js} +1 -1
- package/dashboard/dist/assets/{circle-alert-B25g9BTL.js → circle-alert-c3tH1P4z.js} +1 -1
- package/dashboard/dist/assets/{circle-check-big-DzO2BlL7.js → circle-check-big-TDSeWstm.js} +1 -1
- package/dashboard/dist/assets/{circle-check-BA5_XqeV.js → circle-check-gYxxSYuH.js} +1 -1
- package/dashboard/dist/assets/{code-zxwuybO8.js → code-CFN2uX9V.js} +1 -1
- package/dashboard/dist/assets/{columns-3-DV4oeCfU.js → columns-3-38xIDlzy.js} +1 -1
- package/dashboard/dist/assets/{download-CXCyQw8M.js → download-DC7KkKyP.js} +1 -1
- package/dashboard/dist/assets/{folder-Bvjj8Vn9.js → folder-CWq_lAnf.js} +1 -1
- package/dashboard/dist/assets/index-DWG-WrzT.js +231 -0
- package/dashboard/dist/assets/{index-BvScJmJM.js → index-Do71weNR.js} +1 -1
- package/dashboard/dist/assets/index-GUNJodSR.css +1 -0
- package/dashboard/dist/assets/{list-Dj4i9N75.js → list-CgIP_2A-.js} +1 -1
- package/dashboard/dist/assets/{minus-DwlFabsT.js → minus-DYoN5UGk.js} +1 -1
- package/dashboard/dist/assets/{pen-line-D7UzECt6.js → pen-line-Bh_WKYHm.js} +1 -1
- package/dashboard/dist/assets/{proxy-B9XRqHD9.js → proxy-BKxDAKTj.js} +1 -1
- package/dashboard/dist/assets/{search-BQbBTIYl.js → search-SieXnOgr.js} +1 -1
- package/dashboard/dist/assets/{shallow-Clb1Lyd_.js → shallow-Bme1JY57.js} +1 -1
- package/dashboard/dist/assets/{table-BqxCXid2.js → table-llyEtj-7.js} +1 -1
- package/dashboard/dist/assets/terminal-BB3Xfuv5.js +6 -0
- package/dashboard/dist/assets/{trash-2-6rN9B-EQ.js → trash-2-C8f4vFFM.js} +1 -1
- package/dashboard/dist/assets/{zap-DxUhG-gk.js → zap-4uwlzVm0.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist-server/dashboard/src/server/agents/agent-sdk-adapter.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/agent-sdk-adapter.js +5 -4
- package/dashboard/dist-server/dashboard/src/server/agents/agent-sdk-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js +8 -4
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/entry-normalizer.d.ts +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/entry-normalizer.js +2 -1
- package/dashboard/dist-server/dashboard/src/server/agents/entry-normalizer.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js +20 -10
- package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.js +3 -4
- package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.test.js +4 -4
- package/dashboard/dist-server/dashboard/src/server/agents/tools/issue-mcp-server.test.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.js +4 -3
- package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.test.js +20 -7
- package/dashboard/dist-server/dashboard/src/server/commander/commander-agent.test.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/execution/wave-executor.d.ts +1 -1
- package/dashboard/dist-server/dashboard/src/server/execution/wave-executor.js +4 -4
- package/dashboard/dist-server/dashboard/src/server/execution/wave-executor.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/index.js +2 -1
- package/dashboard/dist-server/dashboard/src/server/index.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/git.d.ts +2 -0
- package/dashboard/dist-server/dashboard/src/server/routes/git.js +79 -0
- package/dashboard/dist-server/dashboard/src/server/routes/git.js.map +1 -0
- package/dashboard/dist-server/dashboard/src/server/routes/index.js +3 -0
- package/dashboard/dist-server/dashboard/src/server/routes/index.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/issues.js +14 -14
- package/dashboard/dist-server/dashboard/src/server/routes/issues.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/linear.js +7 -5
- package/dashboard/dist-server/dashboard/src/server/routes/linear.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/workspace.js +43 -0
- package/dashboard/dist-server/dashboard/src/server/routes/workspace.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/state/state-manager.js +186 -25
- package/dashboard/dist-server/dashboard/src/server/state/state-manager.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/utils/issue-store.d.ts +6 -0
- package/dashboard/dist-server/dashboard/src/server/utils/issue-store.js +24 -2
- package/dashboard/dist-server/dashboard/src/server/utils/issue-store.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/ws/handlers/execution-handler.js +4 -7
- package/dashboard/dist-server/dashboard/src/server/ws/handlers/execution-handler.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/constants.js +2 -1
- package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/constants.test.js +5 -5
- package/dashboard/dist-server/dashboard/src/shared/constants.test.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/shared/issue-types.test.js +4 -4
- package/dashboard/dist-server/dashboard/src/shared/issue-types.test.js.map +1 -1
- package/dashboard/dist-server/src/commands/delegate.js +7 -1
- package/dashboard/dist-server/src/commands/delegate.js.map +1 -1
- package/dashboard/package.json +59 -59
- package/dist/src/cli.js +3 -1
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/{team.d.ts → collab.d.ts} +2 -2
- package/dist/src/commands/collab.d.ts.map +1 -0
- package/dist/src/commands/{team.js → collab.js} +391 -24
- package/dist/src/commands/collab.js.map +1 -0
- package/dist/src/commands/delegate.d.ts.map +1 -1
- package/dist/src/commands/delegate.js +7 -1
- package/dist/src/commands/delegate.js.map +1 -1
- package/dist/src/commands/msg.d.ts.map +1 -1
- package/dist/src/commands/msg.js +4 -3
- package/dist/src/commands/msg.js.map +1 -1
- package/dist/src/hooks/team-monitor.d.ts.map +1 -1
- package/dist/src/hooks/team-monitor.js +16 -0
- package/dist/src/hooks/team-monitor.js.map +1 -1
- package/dist/src/tools/collab-adapter.d.ts +85 -0
- package/dist/src/tools/collab-adapter.d.ts.map +1 -0
- package/dist/src/tools/collab-adapter.js +320 -0
- package/dist/src/tools/collab-adapter.js.map +1 -0
- package/dist/src/tools/namespace-guard.d.ts +2 -0
- package/dist/src/tools/namespace-guard.d.ts.map +1 -1
- package/dist/src/tools/namespace-guard.js +12 -0
- package/dist/src/tools/namespace-guard.js.map +1 -1
- package/dist/src/tools/phase-gate-evaluator.d.ts +45 -0
- package/dist/src/tools/phase-gate-evaluator.d.ts.map +1 -0
- package/dist/src/tools/phase-gate-evaluator.js +42 -0
- package/dist/src/tools/phase-gate-evaluator.js.map +1 -0
- package/dist/src/tools/team-members.d.ts +18 -0
- package/dist/src/tools/team-members.d.ts.map +1 -1
- package/dist/src/tools/team-members.js +50 -0
- package/dist/src/tools/team-members.js.map +1 -1
- package/dist/src/tools/team-tasks.d.ts +120 -0
- package/dist/src/tools/team-tasks.d.ts.map +1 -0
- package/dist/src/tools/team-tasks.js +365 -0
- package/dist/src/tools/team-tasks.js.map +1 -0
- package/dist/src/tools/transition-recorder.d.ts +3 -0
- package/dist/src/tools/transition-recorder.d.ts.map +1 -1
- package/dist/src/tools/transition-recorder.js +52 -1
- package/dist/src/tools/transition-recorder.js.map +1 -1
- package/dist/src/utils/get-version.d.ts.map +1 -1
- package/dist/src/utils/get-version.js +15 -4
- package/dist/src/utils/get-version.js.map +1 -1
- package/package.json +1 -1
- package/templates/config.json +7 -0
- package/templates/worktree-scope.json +10 -0
- package/templates/worktrees.json +27 -0
- package/workflows/analyze.md +86 -36
- package/workflows/brainstorm.md +17 -37
- package/workflows/delegate-usage.md +39 -41
- package/workflows/execute.md +247 -61
- package/workflows/fork.md +309 -0
- package/workflows/init.md +11 -2
- package/workflows/issue.md +66 -7
- package/workflows/maestro-coordinate.codex.md +1 -1
- package/workflows/maestro-coordinate.md +24 -17
- package/workflows/maestro.md +54 -37
- package/workflows/memory.md +2 -1
- package/workflows/merge.md +285 -0
- package/workflows/milestone-audit.md +89 -70
- package/workflows/milestone-complete.md +89 -156
- package/workflows/plan.md +131 -19
- package/workflows/retrospective.md +5 -5
- package/workflows/roadmap.md +12 -4
- package/workflows/spec-generate.md +9 -0
- package/workflows/status.md +76 -27
- package/workflows/ui-design.md +14 -12
- package/workflows/verify.md +44 -8
- package/.claude/commands/learn-retro-decision.md +0 -198
- package/.claude/commands/learn-retro-git.md +0 -160
- package/.claude/commands/maestro-phase-add.md +0 -63
- package/.claude/commands/maestro-phase-transition.md +0 -75
- package/.codex/skills/maestro-phase-add/SKILL.md +0 -154
- package/.codex/skills/maestro-phase-transition/SKILL.md +0 -173
- package/chains/singles/phase-add.json +0 -31
- package/chains/singles/phase-transition.json +0 -23
- package/dashboard/dist/assets/ChatInput-PuCvZZ3y.js +0 -67
- package/dashboard/dist/assets/ChatPage-v19GURYH.js +0 -8
- package/dashboard/dist/assets/CollabPage-I5k_mCbG.js +0 -1
- package/dashboard/dist/assets/KanbanPage-PDDBv5-9.js +0 -16
- package/dashboard/dist/assets/McpPage-CiqXpCHg.js +0 -16
- package/dashboard/dist/assets/TreeBrowser-0VIMWclo.js +0 -11
- package/dashboard/dist/assets/WorkflowPage-Csm23wUS.js +0 -6
- package/dashboard/dist/assets/git-branch-DL8p9kVC.js +0 -6
- package/dashboard/dist/assets/index-11DuhKhc.js +0 -231
- package/dashboard/dist/assets/index-D2Mtyw7I.css +0 -1
- package/dashboard/dist/assets/wrench-BScEJFqC.js +0 -11
- package/dist/src/commands/team.d.ts.map +0 -1
- package/dist/src/commands/team.js.map +0 -1
- package/workflows/phase-add.md +0 -252
- package/workflows/phase-transition.md +0 -399
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: maestro-phase-transition
|
|
3
|
-
description: Mark current or specified phase as complete, extract learnings, advance to next phase
|
|
4
|
-
argument-hint: "[phase-number] [--force]"
|
|
5
|
-
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Maestro Phase Transition (Single Agent)
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
$maestro-phase-transition ""
|
|
14
|
-
$maestro-phase-transition "2"
|
|
15
|
-
$maestro-phase-transition "3 --force"
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
**Flags**:
|
|
19
|
-
- `[phase-number]`: Phase to transition from (defaults to current_phase from state.json)
|
|
20
|
-
- `--force`: Skip gap checks and force transition even with warnings
|
|
21
|
-
|
|
22
|
-
**Output**: Updated state.json, completed phase index.json, initialized next phase, learnings extracted
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## Overview
|
|
27
|
-
|
|
28
|
-
State-machine transition skill. Validates that the current phase meets completion criteria (tasks done, verification passed, no unresolved gaps), marks it complete, extracts learnings, and advances to the next phase. Creates next phase directory if needed.
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## Implementation
|
|
33
|
-
|
|
34
|
-
### Step 1: Parse Arguments
|
|
35
|
-
|
|
36
|
-
Extract:
|
|
37
|
-
- Phase number (optional, integer)
|
|
38
|
-
- `--force` flag
|
|
39
|
-
|
|
40
|
-
### Step 2: Load State
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
cat .workflow/state.json
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Determine phase number:
|
|
47
|
-
- If provided: use specified phase
|
|
48
|
-
- If omitted: use `current_phase` from state.json
|
|
49
|
-
- If neither: error E001
|
|
50
|
-
|
|
51
|
-
### Step 3: Resolve Phase Directory
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
ls -d .workflow/phases/*/ | grep "^.workflow/phases/0*{N}-"
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Read phase files:
|
|
58
|
-
- `.workflow/phases/{NN}-{slug}/index.json` — phase metadata, task statuses
|
|
59
|
-
- `.workflow/phases/{NN}-{slug}/verification.json` — verification results (if exists)
|
|
60
|
-
- `.workflow/phases/{NN}-{slug}/review.json` — code review results (if exists)
|
|
61
|
-
|
|
62
|
-
### Step 4: Validate Completion
|
|
63
|
-
|
|
64
|
-
Check the following (skip all if `--force`):
|
|
65
|
-
|
|
66
|
-
1. **Task completion**: All tasks in index.json have status "completed" or "skipped"
|
|
67
|
-
2. **Verification passed**: verification.json exists and verdict is not "FAIL" (E002 if failed)
|
|
68
|
-
3. **No critical gaps**: No unresolved critical gaps in verification results (E003)
|
|
69
|
-
4. **Review status**: Check review.json if exists
|
|
70
|
-
- BLOCK verdict → W003 (warning, suggest quality-review fix)
|
|
71
|
-
- No review.json → W004 (warning, suggest running quality-review)
|
|
72
|
-
5. **UAT status**: Check for test failures → W002
|
|
73
|
-
|
|
74
|
-
If warnings only (no errors) and not `--force`: display warnings and ask user to confirm.
|
|
75
|
-
|
|
76
|
-
### Step 5: Mark Phase Complete
|
|
77
|
-
|
|
78
|
-
Update `.workflow/phases/{NN}-{slug}/index.json`:
|
|
79
|
-
```json
|
|
80
|
-
{
|
|
81
|
-
"status": "complete",
|
|
82
|
-
"completed_at": "<ISO timestamp>"
|
|
83
|
-
}
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### Step 6: Extract Learnings
|
|
87
|
-
|
|
88
|
-
Analyze phase artifacts for learnings:
|
|
89
|
-
1. Read verification.json gaps and resolutions
|
|
90
|
-
2. Read review.json feedback patterns
|
|
91
|
-
3. Read task summaries for recurring themes
|
|
92
|
-
4. Identify patterns: what worked, what didn't, what to carry forward
|
|
93
|
-
|
|
94
|
-
Append to `.workflow/specs/learnings.md`:
|
|
95
|
-
```markdown
|
|
96
|
-
## Phase {N}: {slug}
|
|
97
|
-
**Completed**: {date}
|
|
98
|
-
|
|
99
|
-
### What Worked
|
|
100
|
-
- {items}
|
|
101
|
-
|
|
102
|
-
### Challenges
|
|
103
|
-
- {items}
|
|
104
|
-
|
|
105
|
-
### Carry Forward
|
|
106
|
-
- {items}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Step 7: Initialize Next Phase
|
|
110
|
-
|
|
111
|
-
Determine next phase number = N + 1.
|
|
112
|
-
|
|
113
|
-
Check if next phase directory exists:
|
|
114
|
-
- If exists: verify index.json has status "pending", update to "active"
|
|
115
|
-
- If not exists: create directory and initialize
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
mkdir -p .workflow/phases/{NN+1}-{next_slug}
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
Write `index.json` for next phase (read template from `~/.maestro/templates/index.json` if available):
|
|
122
|
-
```json
|
|
123
|
-
{
|
|
124
|
-
"phase": <N+1>,
|
|
125
|
-
"status": "active",
|
|
126
|
-
"created_at": "<ISO timestamp>"
|
|
127
|
-
}
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### Step 8: Update Project State
|
|
131
|
-
|
|
132
|
-
Update `.workflow/state.json`:
|
|
133
|
-
- `current_phase`: N + 1
|
|
134
|
-
- `phases_completed`: append phase N
|
|
135
|
-
|
|
136
|
-
### Step 9: Completion Report
|
|
137
|
-
|
|
138
|
-
```
|
|
139
|
-
=== PHASE TRANSITION ===
|
|
140
|
-
From: Phase {N} ({slug}) → COMPLETE
|
|
141
|
-
To: Phase {N+1} ({next_slug}) → ACTIVE
|
|
142
|
-
|
|
143
|
-
Learnings extracted: .workflow/specs/learnings.md
|
|
144
|
-
State updated: .workflow/state.json
|
|
145
|
-
|
|
146
|
-
Next steps:
|
|
147
|
-
$maestro-plan "" -- Plan tasks for Phase {N+1}
|
|
148
|
-
$manage-status -- View project dashboard
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
---
|
|
152
|
-
|
|
153
|
-
## Error Handling
|
|
154
|
-
|
|
155
|
-
| Code | Severity | Description | Recovery |
|
|
156
|
-
|------|----------|-------------|----------|
|
|
157
|
-
| E001 | error | Phase number required and could not determine | Specify phase number explicitly |
|
|
158
|
-
| E002 | error | Phase has not passed verification | Run maestro-verify first |
|
|
159
|
-
| E003 | error | Phase has unresolved critical gaps | Fix gaps, re-verify |
|
|
160
|
-
| W001 | warning | Phase has warnings but no blockers | Proceed with confirmation |
|
|
161
|
-
| W002 | warning | UAT test failures exist | Review recommended |
|
|
162
|
-
| W003 | warning | Code review verdict is BLOCK | Fix review findings first |
|
|
163
|
-
| W004 | warning | Code review not yet run | Run quality-review first |
|
|
164
|
-
|
|
165
|
-
---
|
|
166
|
-
|
|
167
|
-
## Core Rules
|
|
168
|
-
|
|
169
|
-
1. **Verify before transition** — refuse to transition without verification (unless --force)
|
|
170
|
-
2. **Learnings are mandatory** — always extract and persist learnings, even if minimal
|
|
171
|
-
3. **Next phase must be ready** — create directory and index.json before reporting success
|
|
172
|
-
4. **State consistency** — state.json and index.json must agree at all times
|
|
173
|
-
5. **Warnings need acknowledgment** — display warnings and require user confirmation (unless --force)
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../chain-graph.schema.json",
|
|
3
|
-
"id": "singles/phase-add",
|
|
4
|
-
"name": "Phase Add",
|
|
5
|
-
"description": "Add or insert a new phase into the project roadmap with automatic renumbering",
|
|
6
|
-
"version": "1.0.0",
|
|
7
|
-
"tags": [
|
|
8
|
-
"maestro",
|
|
9
|
-
"phase"
|
|
10
|
-
],
|
|
11
|
-
"entry": "phase_add",
|
|
12
|
-
"inputs": {
|
|
13
|
-
"description": {
|
|
14
|
-
"type": "string"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"nodes": {
|
|
18
|
-
"phase_add": {
|
|
19
|
-
"type": "command",
|
|
20
|
-
"cmd": "maestro-phase-add",
|
|
21
|
-
"next": "done",
|
|
22
|
-
"analyze": false,
|
|
23
|
-
"args": "\"{description}\"",
|
|
24
|
-
"description": "Add or insert a new phase into the project roadmap with automatic renumbering"
|
|
25
|
-
},
|
|
26
|
-
"done": {
|
|
27
|
-
"type": "terminal",
|
|
28
|
-
"status": "success"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../chain-graph.schema.json",
|
|
3
|
-
"id": "singles/phase-transition",
|
|
4
|
-
"name": "Phase Transition",
|
|
5
|
-
"description": "Mark current phase as complete, extract learnings, advance to next phase",
|
|
6
|
-
"version": "1.0.0",
|
|
7
|
-
"tags": ["lifecycle", "transition"],
|
|
8
|
-
"entry": "phase_transition",
|
|
9
|
-
"inputs": {},
|
|
10
|
-
"nodes": {
|
|
11
|
-
"phase_transition": {
|
|
12
|
-
"type": "command",
|
|
13
|
-
"cmd": "maestro-phase-transition",
|
|
14
|
-
"description": "Complete current phase, archive artifacts, extract learnings, advance state",
|
|
15
|
-
"next": "done",
|
|
16
|
-
"analyze": false
|
|
17
|
-
},
|
|
18
|
-
"done": {
|
|
19
|
-
"type": "terminal",
|
|
20
|
-
"status": "success"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import{E as M,j as s,r as N,x as gn,d as Se,y as vn,k as Pe,s as yt,p as bn,i as Le,c as yn,R as wn,P as Cn,O as kn,f as Tn,T as In,h as uo,v as Sn,t as zt}from"./index-11DuhKhc.js";import{Z as Dt}from"./zap-DxUhG-gk.js";import{M as jn}from"./MarkdownRenderer-CCXHaut3.js";import{W as Rn,T as Nn}from"./wrench-BScEJFqC.js";import{C as Mo}from"./chevron-right-Yts3bi8p.js";import{C as zn}from"./circle-alert-B25g9BTL.js";const It=0,Ae=1,qe=2,Lo=4;function po(e){return()=>e}function En(e){e()}function Oo(e,t){return o=>e(t(o))}function mo(e,t){return()=>e(t)}function Hn(e,t){return o=>e(t,o)}function Ut(e){return e!==void 0}function Bn(...e){return()=>{e.map(En)}}function Ze(){}function St(e,t){return t(e),e}function Mn(e,t){return t(e)}function oe(...e){return e}function Q(e,t){return e(Ae,t)}function $(e,t){e(It,t)}function Kt(e){e(qe)}function se(e){return e(Lo)}function L(e,t){return Q(e,Hn(t,It))}function je(e,t){const o=e(Ae,n=>{o(),t(n)});return o}function ho(e){let t,o;return n=>r=>{t=r,o&&clearTimeout(o),o=setTimeout(()=>{n(t)},e)}}function Ao(e,t){return e===t}function te(e=Ao){let t;return o=>n=>{e(t,n)||(t=n,o(n))}}function W(e){return t=>o=>{e(o)&&t(o)}}function z(e){return t=>Oo(t,e)}function ze(e){return t=>()=>{t(e)}}function C(e,...t){const o=Ln(...t);return((n,r)=>{switch(n){case qe:Kt(e);return;case Ae:return Q(e,o(r))}})}function Ee(e,t){return o=>n=>{o(t=e(t,n))}}function Ve(e){return t=>o=>{e>0?e--:t(o)}}function Be(e){let t=null,o;return n=>r=>{t=r,!o&&(o=setTimeout(()=>{o=void 0,n(t)},e))}}function G(...e){const t=new Array(e.length);let o=0,n=null;const r=2**e.length-1;return e.forEach((l,i)=>{const c=2**i;Q(l,a=>{const u=o;o|=c,t[i]=a,u!==r&&o===r&&n&&(n(),n=null)})}),l=>i=>{const c=()=>{l([i].concat(t))};o===r?c():n=c}}function Ln(...e){return t=>e.reduceRight(Mn,t)}function On(e){let t,o;const n=()=>t==null?void 0:t();return function(r,l){switch(r){case Ae:return l?o===l?void 0:(n(),o=l,t=Q(e,l),t):(n(),Ze);case qe:n(),o=null;return}}}function T(e){let t=e;const o=K();return((n,r)=>{switch(n){case It:t=r;break;case Ae:{r(t);break}case Lo:return t}return o(n,r)})}function ve(e,t){return St(T(t),o=>L(e,o))}function K(){const e=[];return((t,o)=>{switch(t){case It:e.slice().forEach(n=>{n(o)});return;case qe:e.splice(0,e.length);return;case Ae:return e.push(o),()=>{const n=e.indexOf(o);n>-1&&e.splice(n,1)}}})}function ke(e){return St(K(),t=>L(e,t))}function Y(e,t=[],{singleton:o}={singleton:!0}){return{constructor:e,dependencies:t,id:An(),singleton:o}}const An=()=>Symbol();function _n(e){const t=new Map,o=({constructor:n,dependencies:r,id:l,singleton:i})=>{if(i&&t.has(l))return t.get(l);const c=n(r.map(a=>o(a)));return i&&t.set(l,c),c};return o(e)}function ue(...e){const t=K(),o=new Array(e.length);let n=0;const r=2**e.length-1;return e.forEach((l,i)=>{const c=2**i;Q(l,a=>{o[i]=a,n|=c,n===r&&$(t,o)})}),function(l,i){switch(l){case qe:{Kt(t);return}case Ae:return n===r&&i(o),Q(t,i)}}}function D(e,t=Ao){return C(e,te(t))}function Wt(...e){return function(t,o){switch(t){case qe:return;case Ae:return Bn(...e.map(n=>Q(n,o)))}}}const he={DEBUG:0,INFO:1,WARN:2,ERROR:3},Dn={[he.DEBUG]:"debug",[he.ERROR]:"error",[he.INFO]:"log",[he.WARN]:"warn"},Wn=()=>typeof globalThis>"u"?window:globalThis,_e=Y(()=>{const e=T(he.ERROR);return{log:T((t,o,n=he.INFO)=>{const r=Wn().VIRTUOSO_LOG_LEVEL??se(e);n>=r&&console[Dn[n]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,o)}),logLevel:e}},[],{singleton:!0});function $e(e,t,o){return Yt(e,t,o).callbackRef}function Yt(e,t,o){const n=M.useRef(null);let r=i=>{};const l=M.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(i=>{const c=()=>{const a=i[0].target;a.offsetParent!==null&&e(a)};o?c():requestAnimationFrame(c)}):null,[e,o]);return r=i=>{i&&t?(l==null||l.observe(i),n.current=i):(n.current&&(l==null||l.unobserve(n.current)),n.current=null)},{callbackRef:r,ref:n}}function Fn(e,t,o,n,r,l,i,c,a){const u=M.useCallback(h=>{const v=Pn(h.children,t,c?"offsetWidth":"offsetHeight",r);let x=h.parentElement;for(;x.dataset.virtuosoScroller===void 0;)x=x.parentElement;const f=x.lastElementChild.dataset.viewportType==="window";let w;f&&(w=x.ownerDocument.defaultView);const b=i?c?i.scrollLeft:i.scrollTop:f?c?w.scrollX||w.document.documentElement.scrollLeft:w.scrollY||w.document.documentElement.scrollTop:c?x.scrollLeft:x.scrollTop,g=i?c?i.scrollWidth:i.scrollHeight:f?c?w.document.documentElement.scrollWidth:w.document.documentElement.scrollHeight:c?x.scrollWidth:x.scrollHeight,m=i?c?i.offsetWidth:i.offsetHeight:f?c?w.innerWidth:w.innerHeight:c?x.offsetWidth:x.offsetHeight;n({scrollHeight:g,scrollTop:Math.max(b,0),viewportHeight:m}),l==null||l(c?fo("column-gap",getComputedStyle(h).columnGap,r):fo("row-gap",getComputedStyle(h).rowGap,r)),v!==null&&e(v)},[e,t,r,l,i,n,c]);return Yt(u,o,a)}function Pn(e,t,o,n){const r=e.length;if(r===0)return null;const l=[];for(let i=0;i<r;i++){const c=e.item(i);if(c.dataset.index===void 0)continue;const a=parseInt(c.dataset.index),u=parseFloat(c.dataset.knownSize),h=t(c,o);if(h===0&&n("Zero-sized element, this should not happen",{child:c},he.ERROR),h===u)continue;const v=l[l.length-1];l.length===0||v.size!==h||v.endIndex!==a-1?l.push({endIndex:a,size:h,startIndex:a}):l[l.length-1].endIndex++}return l}function fo(e,t,o){return t!=="normal"&&(t==null?void 0:t.endsWith("px"))!==!0&&o(`${e} was not resolved to pixel value correctly`,t,he.WARN),t==="normal"?0:parseInt(t??"0",10)}function _o(e,t,o){const n=M.useRef(null),r=M.useCallback(a=>{if(!(a!=null&&a.offsetParent))return;const u=a.getBoundingClientRect(),h=u.width;let v,x;if(t){const f=t.getBoundingClientRect(),w=u.top-f.top;x=f.height-Math.max(0,w),v=w+t.scrollTop}else{const f=i.current.ownerDocument.defaultView;x=f.innerHeight-Math.max(0,u.top),v=u.top+f.scrollY}n.current={listHeight:u.height,offsetTop:v,visibleHeight:x,visibleWidth:h},e(n.current)},[e,t]),{callbackRef:l,ref:i}=Yt(r,!0,o),c=M.useCallback(()=>{r(i.current)},[r,i]);return M.useEffect(()=>{var u;if(t){t.addEventListener("scroll",c);const h=new ResizeObserver(()=>{requestAnimationFrame(c)});return h.observe(t),()=>{t.removeEventListener("scroll",c),h.unobserve(t)}}const a=(u=i.current)==null?void 0:u.ownerDocument.defaultView;return a==null||a.addEventListener("scroll",c),a==null||a.addEventListener("resize",c),()=>{a==null||a.removeEventListener("scroll",c),a==null||a.removeEventListener("resize",c)}},[c,t,i]),l}const ye=Y(()=>{const e=K(),t=K(),o=T(0),n=K(),r=T(0),l=K(),i=K(),c=T(0),a=T(0),u=T(0),h=T(0),v=K(),x=K(),f=T(!1),w=T(!1),b=T(!1);return L(C(e,z(({scrollTop:g})=>g)),t),L(C(e,z(({scrollHeight:g})=>g)),i),L(t,r),{deviation:o,fixedFooterHeight:u,fixedHeaderHeight:a,footerHeight:h,headerHeight:c,horizontalDirection:w,scrollBy:x,scrollContainerState:e,scrollHeight:i,scrollingInProgress:f,scrollTo:v,scrollTop:t,skipAnimationFrameInResizeObserver:b,smoothScrollTargetReached:n,statefulScrollTop:r,viewportHeight:l}},[],{singleton:!0}),rt={lvl:0};function Do(e,t){const o=e.length;if(o===0)return[];let{index:n,value:r}=t(e[0]);const l=[];for(let i=1;i<o;i++){const{index:c,value:a}=t(e[i]);l.push({end:c-1,start:n,value:r}),n=c,r=a}return l.push({end:1/0,start:n,value:r}),l}function q(e){return e===rt}function st(e,t){if(!q(e))return t===e.k?e.v:t<e.k?st(e.l,t):st(e.r,t)}function Re(e,t,o="k"){if(q(e))return[-1/0,void 0];if(Number(e[o])===t)return[e.k,e.v];if(Number(e[o])<t){const n=Re(e.r,t,o);return n[0]===-1/0?[e.k,e.v]:n}return Re(e.l,t,o)}function Ce(e,t,o){return q(e)?Po(t,o,1):t===e.k?me(e,{k:t,v:o}):t<e.k?xo(me(e,{l:Ce(e.l,t,o)})):xo(me(e,{r:Ce(e.r,t,o)}))}function Ye(){return rt}function Xe(e,t,o){if(q(e))return[];const n=Re(e,t)[0];return Vn(Pt(e,n,o))}function Ft(e,t){if(q(e))return rt;const{k:o,l:n,r}=e;if(t===o){if(q(n))return r;if(q(r))return n;const[l,i]=Fo(n);return wt(me(e,{k:l,l:Wo(n),v:i}))}return t<o?wt(me(e,{l:Ft(n,t)})):wt(me(e,{r:Ft(r,t)}))}function Fe(e){return q(e)?[]:[...Fe(e.l),{k:e.k,v:e.v},...Fe(e.r)]}function Pt(e,t,o){if(q(e))return[];const{k:n,l:r,r:l,v:i}=e;let c=[];return n>t&&(c=c.concat(Pt(r,t,o))),n>=t&&n<=o&&c.push({k:n,v:i}),n<=o&&(c=c.concat(Pt(l,t,o))),c}function wt(e){const{l:t,lvl:o,r:n}=e;if(n.lvl>=o-1&&t.lvl>=o-1)return e;if(o>n.lvl+1){if(Et(t))return Vo(me(e,{lvl:o-1}));if(!q(t)&&!q(t.r))return me(t.r,{l:me(t,{r:t.r.l}),lvl:o,r:me(e,{l:t.r.r,lvl:o-1})});throw new Error("Unexpected empty nodes")}if(Et(e))return Vt(me(e,{lvl:o-1}));if(!q(n)&&!q(n.l)){const r=n.l,l=Et(r)?n.lvl-1:n.lvl;return me(r,{l:me(e,{lvl:o-1,r:r.l}),lvl:r.lvl+1,r:Vt(me(n,{l:r.r,lvl:l}))})}throw new Error("Unexpected empty nodes")}function me(e,t){return Po(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function Wo(e){return q(e.r)?e.l:wt(me(e,{r:Wo(e.r)}))}function Et(e){return q(e)||e.lvl>e.r.lvl}function Fo(e){return q(e.r)?[e.k,e.v]:Fo(e.r)}function Po(e,t,o,n=rt,r=rt){return{k:e,l:n,lvl:o,r,v:t}}function xo(e){return Vt(Vo(e))}function Vo(e){const{l:t}=e;return!q(t)&&t.lvl===e.lvl?me(t,{r:me(e,{l:t.r})}):e}function Vt(e){const{lvl:t,r:o}=e;return!q(o)&&!q(o.r)&&o.lvl===t&&o.r.lvl===t?me(o,{l:me(e,{r:o.l}),lvl:t+1}):e}function Vn(e){return Do(e,({k:t,v:o})=>({index:t,value:o}))}function $o(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function lt(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}const Xt=Y(()=>({recalcInProgress:T(!1)}),[],{singleton:!0});function Go(e,t,o){return e[kt(e,t,o)]}function kt(e,t,o,n=0){let r=e.length-1;for(;n<=r;){const l=Math.floor((n+r)/2),i=e[l],c=o(i,t);if(c===0)return l;if(c===-1){if(r-n<2)return l-1;r=l-1}else{if(r===n)return l;n=l+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function $n(e,t,o,n){const r=kt(e,t,n),l=kt(e,o,n,r);return e.slice(r,l+1)}function Oe(e,t){return Math.round(e.getBoundingClientRect()[t])}function jt(e){return!q(e.groupOffsetTree)}function Qt({index:e},t){return t===e?0:t<e?-1:1}function Gn(){return{groupIndices:[],groupOffsetTree:Ye(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Ye()}}function Un(e,t){let o=q(e)?0:1/0;for(const n of t){const{endIndex:r,size:l,startIndex:i}=n;if(o=Math.min(o,i),q(e)){e=Ce(e,0,l);continue}const c=Xe(e,i-1,r+1);if(c.some(Jn(n)))continue;let a=!1,u=!1;for(const{end:h,start:v,value:x}of c)a?(r>=v||l===x)&&(e=Ft(e,v)):(u=x!==l,a=!0),h>r&&r>=v&&x!==l&&(e=Ce(e,r+1,x));u&&(e=Ce(e,i,l))}return[e,o]}function Kn(e){return typeof e.groupIndex<"u"}function Yn({offset:e},t){return t===e?0:t<e?-1:1}function it(e,t,o){if(t.length===0)return 0;const{index:n,offset:r,size:l}=Go(t,e,Qt),i=e-n,c=l*i+(i-1)*o+r;return c>0?c+o:c}function Uo(e,t){if(!jt(t))return e;let o=0;for(;t.groupIndices[o]<=e+o;)o++;return e+o}function Ko(e,t,o){if(Kn(e))return t.groupIndices[e.groupIndex]+1;const n=e.index==="LAST"?o:e.index;let r=Uo(n,t);return r=Math.max(0,r,Math.min(o,r)),r}function Xn(e,t,o,n=0){return n>0&&(t=Math.max(t,Go(e,n,Qt).offset)),Do($n(e,t,o,Yn),Zn)}function Qn(e,[t,o,n,r]){t.length>0&&n("received item sizes",t,he.DEBUG);const l=e.sizeTree;let i=l,c=0;if(o.length>0&&q(l)&&t.length===2){const x=t[0].size,f=t[1].size;i=o.reduce((w,b)=>Ce(Ce(w,b,x),b+1,f),i)}else[i,c]=Un(i,t);if(i===l)return e;const{lastIndex:a,lastOffset:u,lastSize:h,offsetTree:v}=$t(e.offsetTree,c,i,r);return{groupIndices:o,groupOffsetTree:o.reduce((x,f)=>Ce(x,f,it(f,v,r)),Ye()),lastIndex:a,lastOffset:u,lastSize:h,offsetTree:v,sizeTree:i}}function qn(e){return Fe(e).map(({k:t,v:o},n,r)=>{const l=r[n+1];return{endIndex:l!==void 0?l.k-1:1/0,size:o,startIndex:t}})}function go(e,t){let o=0,n=0;for(;o<e;)o+=t[n+1]-t[n]-1,n++;return n-(o===e?0:1)}function $t(e,t,o,n){let r=e,l=0,i=0,c=0,a=0;if(t!==0){a=kt(r,t-1,Qt),c=r[a].offset;const u=Re(o,t-1);l=u[0],i=u[1],r.length&&r[a].size===Re(o,t)[1]&&(a-=1),r=r.slice(0,a+1)}else r=[];for(const{start:u,value:h}of Xe(o,t,1/0)){const v=u-l,x=v*i+c+v*n;r.push({index:u,offset:x,size:h}),l=u,c=x,i=h}return{lastIndex:l,lastOffset:c,lastSize:i,offsetTree:r}}function Zn(e){return{index:e.index,value:e}}function Jn(e){const{endIndex:t,size:o,startIndex:n}=e;return r=>r.start===n&&(r.end===t||r.end===1/0)&&r.value===o}const er={offsetHeight:"height",offsetWidth:"width"},He=Y(([{log:e},{recalcInProgress:t}])=>{const o=K(),n=K(),r=ve(n,0),l=K(),i=K(),c=T(0),a=T([]),u=T(void 0),h=T(void 0),v=T(void 0),x=T(void 0),f=T((d,y)=>Oe(d,er[y])),w=T(void 0),b=T(0),g=Gn(),m=ve(C(o,G(a,e,b),Ee(Qn,g),te()),g),p=ve(C(a,te(),Ee((d,y)=>({current:y,prev:d.current}),{current:[],prev:[]}),z(({prev:d})=>d)),[]);L(C(a,W(d=>d.length>0),G(m,b),z(([d,y,S])=>{const B=d.reduce((H,P,V)=>Ce(H,P,it(P,y.offsetTree,S)||V),Ye());return{...y,groupIndices:d,groupOffsetTree:B}})),m),L(C(n,G(m),W(([d,{lastIndex:y}])=>d<y),z(([d,{lastIndex:y,lastSize:S}])=>[{endIndex:y,size:S,startIndex:d}])),o),L(u,h);const k=ve(C(u,z(d=>d===void 0)),!0);L(C(h,W(d=>d!==void 0&&q(se(m).sizeTree)),z(d=>{const y=se(v),S=se(a).length>0;return y!==void 0&&y!==0?S?[{endIndex:0,size:y,startIndex:0},{endIndex:1,size:d,startIndex:1}]:[]:[{endIndex:0,size:d,startIndex:0}]})),o),L(C(x,W(d=>d!==void 0&&d.length>0&&q(se(m).sizeTree)),z(d=>{const y=[];let S=d[0],B=0;for(let H=1;H<d.length;H++){const P=d[H];P!==S&&(y.push({endIndex:H-1,size:S,startIndex:B}),S=P,B=H)}return y.push({endIndex:d.length-1,size:S,startIndex:B}),y})),o),L(C(a,G(v,h),W(([,d,y])=>d!==void 0&&y!==void 0),z(([d,y,S])=>{const B=[];for(let H=0;H<d.length;H++){const P=d[H],V=d[H+1];B.push({startIndex:P,endIndex:P,size:y}),V!==void 0&&B.push({startIndex:P+1,endIndex:V-1,size:S})}return B})),o);const E=ke(C(o,G(m),Ee(({sizes:d},[y,S])=>({changed:S!==d,sizes:S}),{changed:!1,sizes:g}),z(d=>d.changed)));Q(C(c,Ee((d,y)=>({diff:d.prev-y,prev:y}),{diff:0,prev:0}),z(d=>d.diff)),d=>{const{groupIndices:y}=se(m);if(d>0)$(t,!0),$(l,d+go(d,y));else if(d<0){const S=se(p);S.length>0&&(d-=go(-d,S)),$(i,d)}}),Q(C(c,G(e)),([d,y])=>{d<0&&y("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:c},he.ERROR)});const j=ke(l);L(C(l,G(m),z(([d,y])=>{const S=y.groupIndices.length>0,B=[],H=y.lastSize;if(S){const P=st(y.sizeTree,0);let V=0,A=0;for(;V<d;){const I=y.groupIndices[A],_=y.groupIndices.length===A+1?1/0:y.groupIndices[A+1]-I-1;B.push({endIndex:I,size:P,startIndex:I}),B.push({endIndex:I+1+_-1,size:H,startIndex:I+1}),A++,V+=_+1}const U=Fe(y.sizeTree);return V!==d&&U.shift(),U.reduce((I,{k:_,v:J})=>{let fe=I.ranges;return I.prevSize!==0&&(fe=[...I.ranges,{endIndex:_+d-1,size:I.prevSize,startIndex:I.prevIndex}]),{prevIndex:_+d,prevSize:J,ranges:fe}},{prevIndex:d,prevSize:0,ranges:B}).ranges}return Fe(y.sizeTree).reduce((P,{k:V,v:A})=>({prevIndex:V+d,prevSize:A,ranges:[...P.ranges,{endIndex:V+d-1,size:P.prevSize,startIndex:P.prevIndex}]}),{prevIndex:0,prevSize:H,ranges:[]}).ranges})),o);const O=ke(C(i,G(m,b),z(([d,{offsetTree:y},S])=>{const B=-d;return it(B,y,S)})));return L(C(i,G(m,b),z(([d,y,S])=>{if(y.groupIndices.length>0){if(q(y.sizeTree))return y;let H=Ye();const P=se(p);let V=0,A=0,U=0;for(;V<-d;){U=P[A];const I=P[A+1]-U-1;A++,V+=I+1}if(H=Fe(y.sizeTree).reduce((I,{k:_,v:J})=>Ce(I,Math.max(0,_+d),J),H),V!==-d){const I=st(y.sizeTree,U);H=Ce(H,0,I);const _=Re(y.sizeTree,-d+1)[1];H=Ce(H,1,_)}return{...y,sizeTree:H,...$t(y.offsetTree,0,H,S)}}const B=Fe(y.sizeTree).reduce((H,{k:P,v:V})=>Ce(H,Math.max(0,P+d),V),Ye());return{...y,sizeTree:B,...$t(y.offsetTree,0,B,S)}})),m),{beforeUnshiftWith:j,data:w,defaultItemSize:h,firstItemIndex:c,fixedItemSize:u,fixedGroupSize:v,gap:b,groupIndices:a,heightEstimates:x,itemSize:f,listRefresh:E,shiftWith:i,shiftWithOffset:O,sizeRanges:o,sizes:m,statefulTotalCount:r,totalCount:n,trackItemSizes:k,unshiftWith:l}},oe(_e,Xt),{singleton:!0});function tr(e){return e.reduce((t,o)=>(t.groupIndices.push(t.totalCount),t.totalCount+=o+1,t),{groupIndices:[],totalCount:0})}const Yo=Y(([{groupIndices:e,sizes:t,totalCount:o},{headerHeight:n,scrollTop:r}])=>{const l=K(),i=K(),c=ke(C(l,z(tr)));return L(C(c,z(a=>a.totalCount)),o),L(C(c,z(a=>a.groupIndices)),e),L(C(ue(r,t,n),W(([a,u])=>jt(u)),z(([a,u,h])=>Re(u.groupOffsetTree,Math.max(a-h,0),"v")[0]),te(),z(a=>[a])),i),{groupCounts:l,topItemsIndexes:i}},oe(He,ye)),De=Y(([{log:e}])=>{const t=T(!1),o=ke(C(t,W(n=>n),te()));return Q(t,n=>{n&&se(e)("props updated",{},he.DEBUG)}),{didMount:o,propsReady:t}},oe(_e),{singleton:!0}),or=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Xo(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!or)&&(t.behavior="auto"),t.offset===void 0&&(t.offset=0),t}const dt=Y(([{gap:e,listRefresh:t,sizes:o,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:l,footerHeight:i,headerHeight:c,scrollingInProgress:a,scrollTo:u,smoothScrollTargetReached:h,viewportHeight:v},{log:x}])=>{const f=K(),w=K(),b=T(0);let g=null,m=null,p=null;function k(){g!==null&&(g(),g=null),p!==null&&(p(),p=null),m&&(clearTimeout(m),m=null),$(a,!1)}return L(C(f,G(o,v,n,b,c,i,x),G(e,l,r),z(([[E,j,O,d,y,S,B,H],P,V,A])=>{const U=Xo(E),{align:I,behavior:_,offset:J}=U,fe=d-1,ie=Ko(U,j,fe);let we=it(ie,j.offsetTree,P)+S;I==="end"?(we+=V+Re(j.sizeTree,ie)[1]-O+A,ie===fe&&(we+=B)):I==="center"?we+=(V+Re(j.sizeTree,ie)[1]-O+A)/2:we-=y,J!==void 0&&J!==0&&(we+=J);const Me=xe=>{k(),xe?(H("retrying to scroll to",{location:E},he.DEBUG),$(f,E)):($(w,!0),H("list did not change, scroll successful",{},he.DEBUG))};if(k(),_==="smooth"){let xe=!1;p=Q(t,Ue=>{xe=xe||Ue}),g=je(h,()=>{Me(xe)})}else g=je(C(t,nr(150)),Me);return m=setTimeout(()=>{k()},1200),$(a,!0),H("scrolling from index to",{behavior:_,index:ie,top:we},he.DEBUG),{behavior:_,top:we}})),u),{scrollTargetReached:w,scrollToIndex:f,topListHeight:b}},oe(He,ye,_e),{singleton:!0});function nr(e){return t=>{const o=setTimeout(()=>{t(!1)},e);return n=>{n&&(t(!0),clearTimeout(o))}}}function qt(e,t){e===0?t():requestAnimationFrame(()=>{qt(e-1,t)})}function Zt(e,t){const o=t-1;return typeof e=="number"?e:e.index==="LAST"?o:e.index}const pt=Y(([{defaultItemSize:e,listRefresh:t,sizes:o},{scrollTop:n},{scrollTargetReached:r,scrollToIndex:l},{didMount:i}])=>{const c=T(!0),a=T(0),u=T(!0);return L(C(i,G(a),W(([h,v])=>v!==0),ze(!1)),c),L(C(i,G(a),W(([h,v])=>v!==0),ze(!1)),u),Q(C(ue(t,i),G(c,o,e,u),W(([[,h],v,{sizeTree:x},f,w])=>h&&(!q(x)||Ut(f))&&!v&&!w),G(a)),([,h])=>{je(r,()=>{$(u,!0)}),qt(4,()=>{je(n,()=>{$(c,!0)}),$(l,h)})}),{initialItemFinalLocationReached:u,initialTopMostItemIndex:a,scrolledToInitialItem:c}},oe(He,ye,dt,De),{singleton:!0});function Qo(e,t){return Math.abs(e-t)<1.01}const at="up",ot="down",rr="none",sr={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},lr=0,mt=Y(([{footerHeight:e,headerHeight:t,scrollBy:o,scrollContainerState:n,scrollTop:r,viewportHeight:l}])=>{const i=T(!1),c=T(!0),a=K(),u=K(),h=T(4),v=T(lr),x=ve(C(Wt(C(D(r),Ve(1),ze(!0)),C(D(r),Ve(1),ze(!1),ho(100))),te()),!1),f=ve(C(Wt(C(o,ze(!0)),C(o,ze(!1),ho(200))),te()),!1);L(C(ue(D(r),D(v)),z(([p,k])=>p<=k),te()),c),L(C(c,Be(50)),u);const w=ke(C(ue(n,D(l),D(t),D(e),D(h)),Ee((p,[{scrollHeight:k,scrollTop:E},j,O,d,y])=>{const S=E+j-k>-y,B={scrollHeight:k,scrollTop:E,viewportHeight:j};if(S){let P,V;return E>p.state.scrollTop?(P="SCROLLED_DOWN",V=p.state.scrollTop-E):(P="SIZE_DECREASED",V=p.state.scrollTop-E||p.scrollTopDelta),{atBottom:!0,atBottomBecause:P,scrollTopDelta:V,state:B}}let H;return B.scrollHeight>p.state.scrollHeight?H="SIZE_INCREASED":j<p.state.viewportHeight?H="VIEWPORT_HEIGHT_DECREASING":E<p.state.scrollTop?H="SCROLLING_UPWARDS":H="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:H,state:B}},sr),te((p,k)=>p!==void 0&&p.atBottom===k.atBottom))),b=ve(C(n,Ee((p,{scrollHeight:k,scrollTop:E,viewportHeight:j})=>{if(!Qo(p.scrollHeight,k)){const O=k-(E+j)<1;return p.scrollTop!==E&&O?{changed:!0,jump:p.scrollTop-E,scrollHeight:k,scrollTop:E}:{changed:!0,jump:0,scrollHeight:k,scrollTop:E}}return{changed:!1,jump:0,scrollHeight:k,scrollTop:E}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),W(p=>p.changed),z(p=>p.jump)),0);L(C(w,z(p=>p.atBottom)),i),L(C(i,Be(50)),a);const g=T(ot);L(C(n,z(({scrollTop:p})=>p),te(),Ee((p,k)=>se(f)?{direction:p.direction,prevScrollTop:k}:{direction:k<p.prevScrollTop?at:ot,prevScrollTop:k},{direction:ot,prevScrollTop:0}),z(p=>p.direction)),g),L(C(n,Be(50),ze(rr)),g);const m=T(0);return L(C(x,W(p=>!p),ze(0)),m),L(C(r,Be(100),G(x),W(([p,k])=>k),Ee(([p,k],[E])=>[k,E],[0,0]),z(([p,k])=>k-p)),m),{atBottomState:w,atBottomStateChange:a,atBottomThreshold:h,atTopStateChange:u,atTopThreshold:v,isAtBottom:i,isAtTop:c,isScrolling:x,lastJumpDueToItemResize:b,scrollDirection:g,scrollVelocity:m}},oe(ye)),ct="top",ut="bottom",vo="none";function bo(e,t,o){return typeof e=="number"?o===at&&t===ct||o===ot&&t===ut?e:0:o===at?t===ct?e.main:e.reverse:t===ut?e.main:e.reverse}function yo(e,t){return typeof e=="number"?e:e[t]??0}const Jt=Y(([{deviation:e,fixedHeaderHeight:t,headerHeight:o,scrollTop:n,viewportHeight:r}])=>{const l=K(),i=T(0),c=T(0),a=T(0),u=ve(C(ue(D(n),D(r),D(o),D(l,lt),D(a),D(i),D(t),D(e),D(c)),z(([h,v,x,[f,w],b,g,m,p,k])=>{const E=h-p,j=g+m,O=Math.max(x-E,0);let d=vo;const y=yo(k,ct),S=yo(k,ut);return f-=p,f+=x+m,w+=x+m,w-=p,f>h+j-y&&(d=at),w<h-O+v+S&&(d=ot),d!==vo?[Math.max(E-x-bo(b,ct,d)-y,0),E-O-m+v+bo(b,ut,d)+S]:null}),W(h=>h!==null),te(lt)),[0,0]);return{increaseViewportBy:c,listBoundary:l,overscan:a,topListHeight:i,visibleRange:u}},oe(ye),{singleton:!0});function ir(e,t,o){if(jt(t)){const n=Uo(e,t);return[{index:Re(t.groupOffsetTree,n)[0],offset:0,size:0},{data:o==null?void 0:o[0],index:n,offset:0,size:0}]}return[{data:o==null?void 0:o[0],index:e,offset:0,size:0}]}const Ht={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Ct(e,t,o,n,r,l){const{lastIndex:i,lastOffset:c,lastSize:a}=r;let u=0,h=0;if(e.length>0){u=e[0].offset;const b=e[e.length-1];h=b.offset+b.size}const v=o-i,x=c+v*a+(v-1)*n,f=u,w=x-h;return{bottom:h,firstItemIndex:l,items:wo(e,r,l),offsetBottom:w,offsetTop:u,top:f,topItems:wo(t,r,l),topListHeight:t.reduce((b,g)=>g.size+b,0),totalCount:o}}function qo(e,t,o,n,r,l){let i=0;if(o.groupIndices.length>0)for(const h of o.groupIndices){if(h-i>=e)break;i++}const c=e+i,a=Zt(t,c),u=Array.from({length:c}).map((h,v)=>({data:l[v+a],index:v+a,offset:0,size:0}));return Ct(u,[],c,r,o,n)}function wo(e,t,o){if(e.length===0)return[];if(!jt(t))return e.map(u=>({...u,index:u.index+o,originalIndex:u.index}));const n=e[0].index,r=e[e.length-1].index,l=[],i=Xe(t.groupOffsetTree,n,r);let c,a=0;for(const u of e){(!c||c.end<u.index)&&(c=i.shift(),a=t.groupIndices.indexOf(c.start));let h;u.index===c.start?h={index:a,type:"group"}:h={groupIndex:a,index:u.index-(a+1)+o},l.push({...h,data:u.data,offset:u.offset,originalIndex:u.index,size:u.size})}return l}function Co(e,t){return e===void 0?0:typeof e=="number"?e:e[t]??0}const Ge=Y(([{data:e,firstItemIndex:t,gap:o,sizes:n,totalCount:r},l,{listBoundary:i,topListHeight:c,visibleRange:a},{initialTopMostItemIndex:u,scrolledToInitialItem:h},{topListHeight:v},x,{didMount:f},{recalcInProgress:w}])=>{const b=T([]),g=T(0),m=K(),p=T(0);L(l.topItemsIndexes,b);const k=ve(C(ue(f,w,D(a,lt),D(r),D(n),D(u),h,D(b),D(t),D(o),D(p),e),W(([d,y,,S,,,,,,,,B])=>{const H=B!==void 0&&B.length!==S;return d&&!y&&!H}),z(([,,[d,y],S,B,H,P,V,A,U,I,_])=>{var X,de;const J=B,{offsetTree:fe,sizeTree:ie}=J,we=se(g);if(S===0)return{...Ht,totalCount:S};if(d===0&&y===0)return we===0?{...Ht,totalCount:S}:qo(we,H,B,A,U,_||[]);if(q(ie))return we>0?null:Ct(ir(Zt(H,S),J,_),[],S,U,J,A);const Me=[];if(V.length>0){const ee=V[0],ne=V[V.length-1];let pe=0;for(const ae of Xe(ie,ee,ne)){const Z=ae.value,le=Math.max(ae.start,ee),be=Math.min(ae.end,ne);for(let ce=le;ce<=be;ce++)Me.push({data:_==null?void 0:_[ce],index:ce,offset:pe,size:Z}),pe+=Z}}if(!P)return Ct([],Me,S,U,J,A);const xe=V.length>0?V[V.length-1]+1:0,Ue=Xn(fe,d,y,xe);if(Ue.length===0)return null;const Je=S-1,Ne=St([],ee=>{for(const ne of Ue){const pe=ne.value;let ae=pe.offset,Z=ne.start;const le=pe.size;if(pe.offset<d){Z+=Math.floor((d-pe.offset+U)/(le+U));const ce=Z-ne.start;ae+=ce*le+ce*U}Z<xe&&(ae+=(xe-Z)*le,Z=xe);const be=Math.min(ne.end,Je);for(let ce=Z;ce<=be&&!(ae>=y);ce++)ee.push({data:_==null?void 0:_[ce],index:ce,offset:ae,size:le}),ae+=le+U}}),et=Co(I,ct),R=Co(I,ut);if(Ne.length>0&&(et>0||R>0)){const ee=Ne[0],ne=Ne[Ne.length-1];if(et>0&&ee.index>xe){const pe=Math.min(et,ee.index-xe),ae=[];let Z=ee.offset;for(let le=ee.index-1;le>=ee.index-pe;le--){const be=((X=Xe(ie,le,le)[0])==null?void 0:X.value)??ee.size;Z-=be+U,ae.unshift({data:_==null?void 0:_[le],index:le,offset:Z,size:be})}Ne.unshift(...ae)}if(R>0&&ne.index<Je){const pe=Math.min(R,Je-ne.index);let ae=ne.offset+ne.size+U;for(let Z=ne.index+1;Z<=ne.index+pe;Z++){const le=((de=Xe(ie,Z,Z)[0])==null?void 0:de.value)??ne.size;Ne.push({data:_==null?void 0:_[Z],index:Z,offset:ae,size:le}),ae+=le+U}}}return Ct(Ne,Me,S,U,J,A)}),W(d=>d!==null),te()),Ht);L(C(e,W(Ut),z(d=>d==null?void 0:d.length)),r),L(C(k,z(d=>d.topListHeight)),v),L(v,c),L(C(k,z(d=>[d.top,d.bottom])),i),L(C(k,z(d=>d.items)),m);const E=ke(C(k,W(({items:d})=>d.length>0),G(r,e),W(([{items:d},y])=>d[d.length-1].originalIndex===y-1),z(([,d,y])=>[d-1,y]),te(lt),z(([d])=>d))),j=ke(C(k,Be(200),W(({items:d,topItems:y})=>d.length>0&&d[0].originalIndex===y.length),z(({items:d})=>d[0].index),te())),O=ke(C(k,W(({items:d})=>d.length>0),z(({items:d})=>{let y=0,S=d.length-1;for(;d[y].type==="group"&&y<S;)y++;for(;d[S].type==="group"&&S>y;)S--;return{endIndex:d[S].index,startIndex:d[y].index}}),te($o)));return{endReached:E,initialItemCount:g,itemsRendered:m,listState:k,minOverscanItemCount:p,rangeChanged:O,startReached:j,topItemsIndexes:b,...x}},oe(He,Yo,Jt,pt,dt,mt,De,Xt),{singleton:!0}),Zo=Y(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:o,headerHeight:n},{listState:r}])=>{const l=K(),i=ve(C(ue(o,e,n,t,r),z(([c,a,u,h,v])=>c+a+u+h+v.offsetBottom+v.bottom)),0);return L(D(i),l),{totalListHeight:i,totalListHeightChanged:l}},oe(ye,Ge),{singleton:!0}),ar=Y(([{viewportHeight:e},{totalListHeight:t}])=>{const o=T(!1),n=ve(C(ue(o,e,t),W(([r])=>r),z(([,r,l])=>Math.max(0,r-l)),Be(0),te()),0);return{alignToBottom:o,paddingTopAddition:n}},oe(ye,Zo),{singleton:!0}),Jo=Y(()=>({context:T(null)})),cr=({itemBottom:e,itemTop:t,locationParams:{align:o,behavior:n,...r},viewportBottom:l,viewportTop:i})=>t<i?{...r,align:o??"start",...n!==void 0?{behavior:n}:{}}:e>l?{...r,align:o??"end",...n!==void 0?{behavior:n}:{}}:null,en=Y(([{gap:e,sizes:t,totalCount:o},{fixedFooterHeight:n,fixedHeaderHeight:r,headerHeight:l,scrollingInProgress:i,scrollTop:c,viewportHeight:a},{scrollToIndex:u}])=>{const h=K();return L(C(h,G(t,a,o,l,r,n,c),G(e),z(([[v,x,f,w,b,g,m,p],k])=>{const{calculateViewLocation:E=cr,done:j,...O}=v,d=Ko(v,x,w-1),y=it(d,x.offsetTree,k)+b+g,S=y+Re(x.sizeTree,d)[1],B=p+g,H=p+f-m,P=E({itemBottom:S,itemTop:y,locationParams:O,viewportBottom:H,viewportTop:B});return P!==null?j&&je(C(i,W(V=>!V),Ve(se(i)?1:2)),j):j==null||j(),P}),W(v=>v!==null)),u),{scrollIntoView:h}},oe(He,ye,dt,Ge,_e),{singleton:!0});function ko(e){return e===!1?!1:e==="smooth"?"smooth":"auto"}const ur=(e,t)=>typeof e=="function"?ko(e(t)):t&&ko(e),dr=Y(([{listRefresh:e,totalCount:t,fixedItemSize:o,data:n},{atBottomState:r,isAtBottom:l},{scrollToIndex:i},{scrolledToInitialItem:c},{didMount:a,propsReady:u},{log:h},{scrollingInProgress:v},{context:x},{scrollIntoView:f}])=>{const w=T(!1),b=K();let g=null;function m(j){$(i,{align:"end",behavior:j,index:"LAST"})}Q(C(ue(C(D(t),Ve(1)),a),G(D(w),l,c,v),z(([[j,O],d,y,S,B])=>{let H=O&&S,P="auto";return H&&(P=ur(d,y||B),H=H&&P!==!1),{followOutputBehavior:P,shouldFollow:H,totalCount:j}}),W(({shouldFollow:j})=>j)),({followOutputBehavior:j,totalCount:O})=>{g!==null&&(g(),g=null),se(o)!==void 0?requestAnimationFrame(()=>{se(h)("following output to ",{totalCount:O},he.DEBUG),m(j)}):g=je(e,()=>{se(h)("following output to ",{totalCount:O},he.DEBUG),m(j),g=null})});function p(j){const O=je(r,d=>{j&&!d.atBottom&&d.notAtBottomBecause==="SIZE_INCREASED"&&g===null&&(se(h)("scrolling to bottom due to increased size",{},he.DEBUG),m("auto"))});setTimeout(O,100)}Q(C(ue(D(w),t,u),W(([j,,O])=>j!==!1&&O),Ee(({value:j},[,O])=>({refreshed:j===O,value:O}),{refreshed:!1,value:0}),W(({refreshed:j})=>j),G(w,t)),([,j])=>{se(c)&&p(j!==!1)}),Q(b,()=>{p(se(w)!==!1)}),Q(ue(D(w),r),([j,O])=>{j!==!1&&!O.atBottom&&O.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&m("auto")});const k=T(null),E=K();return L(Wt(C(D(n),z(j=>(j==null?void 0:j.length)??0)),C(D(t))),E),Q(C(ue(C(E,Ve(1)),a),G(D(k),c,v,x),z(([[j,O],d,y,S,B])=>O&&y&&(d==null?void 0:d({context:B,totalCount:j,scrollingInProgress:S}))),W(j=>!!j),Be(0)),j=>{g!==null&&(g(),g=null),se(o)!==void 0?requestAnimationFrame(()=>{se(h)("scrolling into view",{}),$(f,j)}):g=je(e,()=>{se(h)("scrolling into view",{}),$(f,j),g=null})}),{autoscrollToBottom:b,followOutput:w,scrollIntoViewOnChange:k}},oe(He,mt,dt,pt,De,_e,ye,Jo,en)),pr=Y(([{data:e,firstItemIndex:t,gap:o,sizes:n},{initialTopMostItemIndex:r},{initialItemCount:l,listState:i},{didMount:c}])=>(L(C(c,G(l),W(([,a])=>a!==0),G(r,n,t,o,e),z(([[,a],u,h,v,x,f=[]])=>qo(a,u,h,v,x,f))),i),{}),oe(He,pt,Ge,De),{singleton:!0}),mr=Y(([{didMount:e},{scrollTo:t},{listState:o}])=>{const n=T(0);return Q(C(e,G(n),W(([,r])=>r!==0),z(([,r])=>({top:r}))),r=>{je(C(o,Ve(1),W(l=>l.items.length>1)),()=>{requestAnimationFrame(()=>{$(t,r)})})}),{initialScrollTop:n}},oe(De,ye,Ge),{singleton:!0}),tn=Y(([{scrollVelocity:e}])=>{const t=T(!1),o=K(),n=T(!1);return L(C(e,G(n,t,o),W(([r,l])=>l!==!1&&l!==void 0),z(([r,l,i,c])=>{const{enter:a,exit:u}=l;if(i){if(u(r,c))return!1}else if(a(r,c))return!0;return i}),te()),t),Q(C(ue(t,e,o),G(n)),([[r,l,i],c])=>{r&&c!==!1&&c!==void 0&&c.change&&c.change(l,i)}),{isSeeking:t,scrollSeekConfiguration:n,scrollSeekRangeChanged:o,scrollVelocity:e}},oe(mt),{singleton:!0}),eo=Y(([{scrollContainerState:e,scrollTo:t}])=>{const o=K(),n=K(),r=K(),l=T(!1),i=T(void 0);return L(C(ue(o,n),z(([{scrollTop:c,viewportHeight:a},{offsetTop:u,listHeight:h}])=>({scrollHeight:h,scrollTop:Math.max(0,c-u),viewportHeight:a}))),e),L(C(t,G(n),z(([c,{offsetTop:a}])=>({...c,top:c.top+a}))),r),{customScrollParent:i,useWindowScroll:l,windowScrollContainerState:o,windowScrollTo:r,windowViewportRect:n}},oe(ye)),hr=Y(([{sizeRanges:e,sizes:t},{headerHeight:o,scrollTop:n},{initialTopMostItemIndex:r},{didMount:l},{useWindowScroll:i,windowScrollContainerState:c,windowViewportRect:a}])=>{const u=K(),h=T(void 0),v=T(null),x=T(null);return L(c,v),L(a,x),Q(C(u,G(t,n,i,v,x,o)),([f,w,b,g,m,p,k])=>{const E=qn(w.sizeTree);g&&m!==null&&p!==null&&(b=m.scrollTop-p.offsetTop),b-=k,f({ranges:E,scrollTop:b})}),L(C(h,W(Ut),z(fr)),r),L(C(l,G(h),W(([,f])=>f!==void 0),te(),z(([,f])=>f.ranges)),e),{getState:u,restoreStateFrom:h}},oe(He,ye,pt,De,eo));function fr(e){return{align:"start",index:0,offset:e.scrollTop}}const xr=Y(([{topItemsIndexes:e}])=>{const t=T(0);return L(C(t,W(o=>o>=0),z(o=>Array.from({length:o}).map((n,r)=>r))),e),{topItemCount:t}},oe(Ge));function on(e){let t=!1,o;return(()=>(t||(t=!0,o=e()),o))}const gr=on(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),vr=Y(([{deviation:e,scrollBy:t,scrollingInProgress:o,scrollTop:n},{isAtBottom:r,isScrolling:l,lastJumpDueToItemResize:i,scrollDirection:c},{listState:a},{beforeUnshiftWith:u,gap:h,shiftWithOffset:v,sizes:x},{log:f},{recalcInProgress:w}])=>{const b=ke(C(a,G(i),Ee(([,m,p,k],[{bottom:E,items:j,offsetBottom:O,totalCount:d},y])=>{const S=E+O;let B=0;return p===d&&m.length>0&&j.length>0&&(j[0].originalIndex===0&&m[0].originalIndex===0||(B=S-k,B!==0&&(B+=y))),[B,j,d,S]},[0,[],0,0]),W(([m])=>m!==0),G(n,c,o,r,f,w),W(([,m,p,k,,,E])=>!E&&!k&&m!==0&&p===at),z(([[m],,,,,p])=>(p("Upward scrolling compensation",{amount:m},he.DEBUG),m))));function g(m){m>0?($(t,{behavior:"auto",top:-m}),$(e,0)):($(e,0),$(t,{behavior:"auto",top:-m}))}return Q(C(b,G(e,l)),([m,p,k])=>{k&&gr()?$(e,p-m):g(-m)}),Q(C(ue(ve(l,!1),e,w),W(([m,p,k])=>!m&&!k&&p!==0),z(([m,p])=>p),Be(1)),g),L(C(v,z(m=>({top:-m}))),t),Q(C(u,G(x,h),z(([m,{groupIndices:p,lastSize:k,sizeTree:E},j])=>{function O(H){return H*(k+j)}if(p.length===0)return O(m);let d=0;const y=st(E,0);let S=0,B=0;for(;S<m;){S++,d+=y;let H=p.length===B+1?1/0:p[B+1]-p[B]-1;S+H>m&&(d-=y,H=m-S+1),S+=H,d+=O(H),B++}return d})),m=>{$(e,m),requestAnimationFrame(()=>{$(t,{top:m}),requestAnimationFrame(()=>{$(e,0),$(w,!1)})})}),{deviation:e}},oe(ye,mt,Ge,He,_e,Xt)),br=Y(([e,t,o,n,r,l,i,c,a,u,h])=>({...e,...t,...o,...n,...r,...l,...i,...c,...a,...u,...h}),oe(Jt,pr,De,tn,Zo,mr,ar,eo,en,_e,Jo)),nn=Y(([{data:e,defaultItemSize:t,firstItemIndex:o,fixedItemSize:n,fixedGroupSize:r,gap:l,groupIndices:i,heightEstimates:c,itemSize:a,sizeRanges:u,sizes:h,statefulTotalCount:v,totalCount:x,trackItemSizes:f},{initialItemFinalLocationReached:w,initialTopMostItemIndex:b,scrolledToInitialItem:g},m,p,k,E,{scrollToIndex:j},O,{topItemCount:d},{groupCounts:y},S])=>{const{listState:B,minOverscanItemCount:H,topItemsIndexes:P,rangeChanged:V,...A}=E;return L(V,S.scrollSeekRangeChanged),L(C(S.windowViewportRect,z(U=>U.visibleHeight)),m.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:o,fixedItemHeight:n,fixedGroupHeight:r,gap:l,groupCounts:y,heightEstimates:c,initialItemFinalLocationReached:w,initialTopMostItemIndex:b,scrolledToInitialItem:g,sizeRanges:u,topItemCount:d,topItemsIndexes:P,totalCount:x,...k,groupIndices:i,itemSize:a,listState:B,minOverscanItemCount:H,scrollToIndex:j,statefulTotalCount:v,trackItemSizes:f,rangeChanged:V,...A,...S,...m,sizes:h,...p}},oe(He,pt,ye,hr,dr,Ge,dt,vr,xr,Yo,br));function yr(e,t){const o={},n={};let r=0;const l=e.length;for(;r<l;)n[e[r]]=1,r+=1;for(const i in t)Object.hasOwn(n,i)||(o[i]=t[i]);return o}const xt=typeof document<"u"?M.useLayoutEffect:M.useEffect;function rn(e,t,o){const n=Object.keys(t.required||{}),r=Object.keys(t.optional||{}),l=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),c=M.createContext({});function a(g,m){g.propsReady!==void 0&&$(g.propsReady,!1);for(const p of n){const k=g[t.required[p]];$(k,m[p])}for(const p of r)if(p in m){const k=g[t.optional[p]];$(k,m[p])}g.propsReady!==void 0&&$(g.propsReady,!0)}function u(g){return l.reduce((m,p)=>(m[p]=k=>{const E=g[t.methods[p]];$(E,k)},m),{})}function h(g){return i.reduce((m,p)=>(m[p]=On(g[t.events[p]]),m),{})}const v=M.forwardRef(function(g,m){const{children:p,...k}=g,[E]=M.useState(()=>St(_n(e),d=>{a(d,k)})),[j]=M.useState(mo(h,E));xt(()=>{for(const d of i)d in k&&Q(j[d],k[d]);return()=>{Object.values(j).map(Kt)}},[k,j,E]),xt(()=>{a(E,k)}),M.useImperativeHandle(m,po(u(E)));const O=o;return s.jsx(c.Provider,{value:E,children:o!==void 0?s.jsx(O,{...yr([...n,...r,...i],k),children:p}):p})}),x=g=>{const m=M.useContext(c);return M.useCallback(p=>{$(m[g],p)},[m,g])},f=g=>{const m=M.useContext(c)[g],p=M.useCallback(k=>Q(m,k),[m]);return M.useSyncExternalStore(p,()=>se(m),()=>se(m))},w=g=>{const m=M.useContext(c)[g],[p,k]=M.useState(mo(se,m));return xt(()=>Q(m,E=>{E!==p&&k(po(E))}),[m,p]),p},b=M.version.startsWith("18")?f:w;return{Component:v,useEmitter:(g,m)=>{const p=M.useContext(c)[g];xt(()=>Q(p,m),[m,p])},useEmitterValue:b,usePublisher:x}}const sn=M.createContext(void 0),ln=M.createContext(void 0),Bt="-webkit-sticky",To="sticky",to=on(()=>{if(typeof document>"u")return To;const e=document.createElement("div");return e.style.position=Bt,e.style.position===Bt?Bt:To}),an=typeof document<"u"?M.useLayoutEffect:M.useEffect;function Mt(e){return"self"in e}function wr(e){return"body"in e}function cn(e,t,o,n=Ze,r,l){const i=M.useRef(null),c=M.useRef(null),a=M.useRef(null),u=M.useCallback(x=>{let f,w,b;const g=x.target;if(wr(g)||Mt(g)){const p=Mt(g)?g:g.defaultView;b=l===!0?p.scrollX:p.scrollY,f=l===!0?p.document.documentElement.scrollWidth:p.document.documentElement.scrollHeight,w=l===!0?p.innerWidth:p.innerHeight}else b=l===!0?g.scrollLeft:g.scrollTop,f=l===!0?g.scrollWidth:g.scrollHeight,w=l===!0?g.offsetWidth:g.offsetHeight;const m=()=>{e({scrollHeight:f,scrollTop:Math.max(b,0),viewportHeight:w})};x.suppressFlushSync===!0?m():gn.flushSync(m),c.current!==null&&(b===c.current||b<=0||b===f-w)&&(c.current=null,t(!0),a.current&&(clearTimeout(a.current),a.current=null))},[e,t,l]);M.useEffect(()=>{const x=r||i.current;return n(r||i.current),u({suppressFlushSync:!0,target:x}),x.addEventListener("scroll",u,{passive:!0}),()=>{n(null),x.removeEventListener("scroll",u)}},[i,u,o,n,r]);function h(x){const f=i.current;if(!f||(l===!0?"offsetWidth"in f&&f.offsetWidth===0:"offsetHeight"in f&&f.offsetHeight===0))return;const w=x.behavior==="smooth";let b,g,m;Mt(f)?(g=Math.max(Oe(f.document.documentElement,l===!0?"width":"height"),l===!0?f.document.documentElement.scrollWidth:f.document.documentElement.scrollHeight),b=l===!0?f.innerWidth:f.innerHeight,m=l===!0?window.scrollX:window.scrollY):(g=f[l===!0?"scrollWidth":"scrollHeight"],b=Oe(f,l===!0?"width":"height"),m=f[l===!0?"scrollLeft":"scrollTop"]);const p=g-b;if(x.top=Math.ceil(Math.max(Math.min(p,x.top),0)),Qo(b,g)||x.top===m){e({scrollHeight:g,scrollTop:m,viewportHeight:b}),w&&t(!0);return}w?(c.current=x.top,a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,c.current=null,t(!0)},1e3)):c.current=null,l===!0&&(x={...x.behavior!==void 0?{behavior:x.behavior}:{},left:x.top}),f.scrollTo(x)}function v(x){l===!0&&(x={...x.behavior!==void 0?{behavior:x.behavior}:{},...x.top!==void 0?{left:x.top}:{}}),i.current.scrollBy(x)}return{scrollByCallback:v,scrollerRef:i,scrollToCallback:h}}function oo(e){return e}const Cr=Y(()=>{const e=T(c=>`Item ${c}`),t=T(c=>`Group ${c}`),o=T({}),n=T(oo),r=T("div"),l=T(Ze),i=(c,a=null)=>ve(C(o,z(u=>u[c]),te()),a);return{components:o,computeItemKey:n,EmptyPlaceholder:i("EmptyPlaceholder"),FooterComponent:i("Footer"),GroupComponent:i("Group","div"),groupContent:t,HeaderComponent:i("Header"),HeaderFooterTag:r,ItemComponent:i("Item","div"),itemContent:e,ListComponent:i("List","div"),ScrollerComponent:i("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:i("ScrollSeekPlaceholder"),TopItemListComponent:i("TopItemList")}}),kr=Y(([e,t])=>({...e,...t}),oe(nn,Cr)),Tr=({height:e})=>s.jsx("div",{style:{height:e}}),Ir={overflowAnchor:"none",position:to(),zIndex:1},un={overflowAnchor:"none"},Sr={...un,display:"inline-block",height:"100%"},Io=M.memo(function({showTopList:e=!1}){const t=F("listState"),o=Te("sizeRanges"),n=F("useWindowScroll"),r=F("customScrollParent"),l=Te("windowScrollContainerState"),i=Te("scrollContainerState"),c=r||n?l:i,a=F("itemContent"),u=F("context"),h=F("groupContent"),v=F("trackItemSizes"),x=F("itemSize"),f=F("log"),w=Te("gap"),b=F("horizontalDirection"),{callbackRef:g}=Fn(o,x,v,e?Ze:c,f,w,r,b,F("skipAnimationFrameInResizeObserver")),[m,p]=M.useState(0);no("deviation",A=>{m!==A&&p(A)});const k=F("EmptyPlaceholder"),E=F("ScrollSeekPlaceholder")??Tr,j=F("ListComponent"),O=F("ItemComponent"),d=F("GroupComponent"),y=F("computeItemKey"),S=F("isSeeking"),B=F("groupIndices").length>0,H=F("alignToBottom"),P=F("initialItemFinalLocationReached"),V=e?{}:{boxSizing:"border-box",...b?{display:"inline-block",height:"100%",marginLeft:m!==0?m:H?"auto":0,paddingLeft:t.offsetTop,paddingRight:t.offsetBottom,whiteSpace:"nowrap"}:{marginTop:m!==0?m:H?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...P?{}:{visibility:"hidden"}};return!e&&t.totalCount===0&&k!==null&&k!==void 0?s.jsx(k,{...ge(k,u)}):s.jsx(j,{...ge(j,u),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:g,style:V,children:(e?t.topItems:t.items).map(A=>{const U=A.originalIndex,I=y(U+t.firstItemIndex,A.data,u);return S?N.createElement(E,{...ge(E,u),height:A.size,index:A.index,key:I,type:A.type||"item",...A.type==="group"?{}:{groupIndex:A.groupIndex}}):A.type==="group"?N.createElement(d,{...ge(d,u),"data-index":U,"data-item-index":A.index,"data-known-size":A.size,key:I,style:Ir},h(A.index,u)):N.createElement(O,{...ge(O,u),...zr(O,A.data),"data-index":U,"data-item-group-index":A.groupIndex,"data-item-index":A.index,"data-known-size":A.size,key:I,style:b?Sr:un},B?a(A.index,A.groupIndex,A.data,u):a(A.index,A.data,u))})})}),jr={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},Rr={outline:"none",overflowX:"auto",position:"relative"},Rt=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:void 0}),Nr={position:to(),top:0,width:"100%",zIndex:1};function ge(e,t){if(typeof e!="string")return{context:t}}function zr(e,t){return{item:typeof e=="string"?void 0:t}}const Er=M.memo(function(){const e=F("HeaderComponent"),t=Te("headerHeight"),o=F("HeaderFooterTag"),n=$e(M.useMemo(()=>l=>{t(Oe(l,"height"))},[t]),!0,F("skipAnimationFrameInResizeObserver")),r=F("context");return e!=null?s.jsx(o,{ref:n,children:s.jsx(e,{...ge(e,r)})}):null}),Hr=M.memo(function(){const e=F("FooterComponent"),t=Te("footerHeight"),o=F("HeaderFooterTag"),n=$e(M.useMemo(()=>l=>{t(Oe(l,"height"))},[t]),!0,F("skipAnimationFrameInResizeObserver")),r=F("context");return e!=null?s.jsx(o,{ref:n,children:s.jsx(e,{...ge(e,r)})}):null});function dn({useEmitter:e,useEmitterValue:t,usePublisher:o}){return M.memo(function({children:n,style:r,context:l,...i}){const c=o("scrollContainerState"),a=t("ScrollerComponent"),u=o("smoothScrollTargetReached"),h=t("scrollerRef"),v=t("horizontalDirection")||!1,{scrollByCallback:x,scrollerRef:f,scrollToCallback:w}=cn(c,u,a,h,void 0,v);return e("scrollTo",w),e("scrollBy",x),s.jsx(a,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:f,style:{...v?Rr:jr,...r},tabIndex:0,...i,...ge(a,l),children:n})})}function pn({useEmitter:e,useEmitterValue:t,usePublisher:o}){return M.memo(function({children:n,style:r,context:l,...i}){const c=o("windowScrollContainerState"),a=t("ScrollerComponent"),u=o("smoothScrollTargetReached"),h=t("totalListHeight"),v=t("deviation"),x=t("customScrollParent"),f=M.useRef(null),w=t("scrollerRef"),{scrollByCallback:b,scrollerRef:g,scrollToCallback:m}=cn(c,u,a,w,x);return an(()=>{var p;return g.current=x||((p=f.current)==null?void 0:p.ownerDocument.defaultView),()=>{g.current=null}},[g,x]),e("windowScrollTo",m),e("scrollBy",b),s.jsx(a,{ref:f,"data-virtuoso-scroller":!0,style:{position:"relative",...r,...h!==0?{height:h+v}:void 0},...i,...ge(a,l),children:n})})}const Br=({children:e})=>{const t=M.useContext(sn),o=Te("viewportHeight"),n=Te("fixedItemHeight"),r=F("alignToBottom"),l=F("horizontalDirection"),i=M.useMemo(()=>Oo(o,a=>Oe(a,l?"width":"height")),[o,l]),c=$e(i,!0,F("skipAnimationFrameInResizeObserver"));return M.useEffect(()=>{t&&(o(t.viewportHeight),n(t.itemHeight))},[t,o,n]),s.jsx("div",{"data-viewport-type":"element",ref:c,style:Rt(r),children:e})},Mr=({children:e})=>{const t=M.useContext(sn),o=Te("windowViewportRect"),n=Te("fixedItemHeight"),r=F("customScrollParent"),l=_o(o,r,F("skipAnimationFrameInResizeObserver")),i=F("alignToBottom");return M.useEffect(()=>{t&&(n(t.itemHeight),o({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,o,n]),s.jsx("div",{"data-viewport-type":"window",ref:l,style:Rt(i),children:e})},Lr=({children:e})=>{const t=F("TopItemListComponent")??"div",o=F("headerHeight"),n={...Nr,marginTop:`${o}px`},r=F("context");return s.jsx(t,{style:n,...ge(t,r),children:e})},Or=M.memo(function(e){const t=F("useWindowScroll"),o=F("topItemsIndexes").length>0,n=F("customScrollParent"),r=F("context");return s.jsxs(n||t?Dr:_r,{...e,context:r,children:[o&&s.jsx(Lr,{children:s.jsx(Io,{showTopList:!0})}),s.jsxs(n||t?Mr:Br,{children:[s.jsx(Er,{}),s.jsx(Io,{}),s.jsx(Hr,{})]})]})}),{Component:Ar,useEmitter:no,useEmitterValue:F,usePublisher:Te}=rn(kr,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Or),_r=dn({useEmitter:no,useEmitterValue:F,usePublisher:Te}),Dr=pn({useEmitter:no,useEmitterValue:F,usePublisher:Te}),Wr=Ar,Fr=Y(()=>{const e=T(u=>s.jsxs("td",{children:["Item $",u]})),t=T(null),o=T(u=>s.jsxs("td",{colSpan:1e3,children:["Group ",u]})),n=T(null),r=T(null),l=T({}),i=T(oo),c=T(Ze),a=(u,h=null)=>ve(C(l,z(v=>v[u]),te()),h);return{components:l,computeItemKey:i,context:t,EmptyPlaceholder:a("EmptyPlaceholder"),FillerRow:a("FillerRow"),fixedFooterContent:r,fixedHeaderContent:n,itemContent:e,groupContent:o,ScrollerComponent:a("Scroller","div"),scrollerRef:c,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),TableBodyComponent:a("TableBody","tbody"),TableComponent:a("Table","table"),TableFooterComponent:a("TableFoot","tfoot"),TableHeadComponent:a("TableHead","thead"),TableRowComponent:a("TableRow","tr"),GroupComponent:a("Group","tr")}});oe(nn,Fr);to();const So={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},Pr={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:jo,floor:Tt,max:nt,min:Lt,round:Ro}=Math;function No(e,t,o){return Array.from({length:t-e+1}).map((n,r)=>({data:o===null?null:o[r+e],index:r+e}))}function Vr(e){return{...Pr,items:e}}function gt(e,t){return e!==void 0&&e.width===t.width&&e.height===t.height}function $r(e,t){return e!==void 0&&e.column===t.column&&e.row===t.row}const Gr=Y(([{increaseViewportBy:e,listBoundary:t,overscan:o,visibleRange:n},{footerHeight:r,headerHeight:l,scrollBy:i,scrollContainerState:c,scrollTo:a,scrollTop:u,smoothScrollTargetReached:h,viewportHeight:v},x,f,{didMount:w,propsReady:b},{customScrollParent:g,useWindowScroll:m,windowScrollContainerState:p,windowScrollTo:k,windowViewportRect:E},j])=>{const O=T(0),d=T(0),y=T(So),S=T({height:0,width:0}),B=T({height:0,width:0}),H=K(),P=K(),V=T(0),A=T(null),U=T({column:0,row:0}),I=K(),_=K(),J=T(!1),fe=T(0),ie=T(!0),we=T(!1),Me=T(!1);Q(C(w,G(fe),W(([R,X])=>X!==0)),()=>{$(ie,!1)}),Q(C(ue(w,ie,B,S,fe,we),W(([R,X,de,ee,,ne])=>R&&!X&&de.height!==0&&ee.height!==0&&!ne)),([,,,,R])=>{$(we,!0),qt(1,()=>{$(H,R)}),je(C(u),()=>{$(t,[0,0]),$(ie,!0)})}),L(C(_,W(R=>R!=null&&R.scrollTop>0),ze(0)),d),Q(C(w,G(_),W(([,R])=>R!=null)),([,R])=>{R&&($(S,R.viewport),$(B,R.item),$(U,R.gap),R.scrollTop>0&&($(J,!0),je(C(u,Ve(1)),X=>{$(J,!1)}),$(a,{top:R.scrollTop})))}),L(C(S,z(({height:R})=>R)),v),L(C(ue(D(S,gt),D(B,gt),D(U,(R,X)=>R!==void 0&&R.column===X.column&&R.row===X.row),D(u)),z(([R,X,de,ee])=>({gap:de,item:X,scrollTop:ee,viewport:R}))),I),L(C(ue(D(O),n,D(U,$r),D(B,gt),D(S,gt),D(A),D(d),D(J),D(ie),D(fe)),W(([,,,,,,,R])=>!R),z(([R,[X,de],ee,ne,pe,ae,Z,,le,be])=>{const{column:ce,row:tt}=ee,{height:ht,width:Nt}=ne,{width:ro}=pe;if(Z===0&&(R===0||ro===0))return So;if(Nt===0){const co=Zt(be,R),xn=co+Math.max(Z-1,0);return Vr(No(co,xn,ae))}const ft=mn(ro,Nt,ce);let Ke,We;le?X===0&&de===0&&Z>0?(Ke=0,We=Z-1):(Ke=ft*Tt((X+tt)/(ht+tt)),We=ft*jo((de+tt)/(ht+tt))-1,We=Lt(R-1,nt(We,ft-1)),Ke=Lt(We,nt(0,Ke))):(Ke=0,We=-1);const so=No(Ke,We,ae),{bottom:lo,top:io}=zo(pe,ee,ne,so),ao=jo(R/ft),fn=ao*ht+(ao-1)*tt-lo;return{bottom:lo,itemHeight:ht,items:so,itemWidth:Nt,offsetBottom:fn,offsetTop:io,top:io}})),y),L(C(A,W(R=>R!==null),z(R=>R.length)),O),L(C(ue(S,B,y,U),W(([R,X,{items:de}])=>de.length>0&&X.height!==0&&R.height!==0),z(([R,X,{items:de},ee])=>{const{bottom:ne,top:pe}=zo(R,ee,X,de);return[pe,ne]}),te(lt)),t);const xe=T(!1);L(C(u,G(xe),z(([R,X])=>X||R!==0)),xe);const Ue=ke(C(ue(y,O),W(([{items:R}])=>R.length>0),G(xe),W(([[R,X],de])=>{const ee=R.items[R.items.length-1].index===X-1;return(de||R.bottom>0&&R.itemHeight>0&&R.offsetBottom===0&&R.items.length===X)&&ee}),z(([[,R]])=>R-1),te())),Je=ke(C(D(y),W(({items:R})=>R.length>0&&R[0].index===0),ze(0),te())),Ne=ke(C(D(y),G(J),W(([{items:R},X])=>R.length>0&&!X),z(([{items:R}])=>({endIndex:R[R.length-1].index,startIndex:R[0].index})),te($o),Be(0)));L(Ne,f.scrollSeekRangeChanged),L(C(H,G(S,B,O,U),z(([R,X,de,ee,ne])=>{const pe=Xo(R),{align:ae,behavior:Z,offset:le}=pe;let be=pe.index;be==="LAST"&&(be=ee-1),be=nt(0,be,Lt(ee-1,be));let ce=Gt(X,ne,de,be);return ae==="end"?ce=Ro(ce-X.height+de.height):ae==="center"&&(ce=Ro(ce-X.height/2+de.height/2)),le!==void 0&&le!==0&&(ce+=le),{behavior:Z,top:ce}})),a);const et=ve(C(y,z(R=>R.offsetBottom+R.bottom)),0);return L(C(E,z(R=>({height:R.visibleHeight,width:R.visibleWidth}))),S),{customScrollParent:g,data:A,deviation:V,footerHeight:r,gap:U,headerHeight:l,increaseViewportBy:e,initialItemCount:d,itemDimensions:B,overscan:o,restoreStateFrom:_,scrollBy:i,scrollContainerState:c,scrollHeight:P,scrollTo:a,scrollToIndex:H,scrollTop:u,smoothScrollTargetReached:h,totalCount:O,useWindowScroll:m,viewportDimensions:S,windowScrollContainerState:p,windowScrollTo:k,windowViewportRect:E,...f,gridState:y,horizontalDirection:Me,initialTopMostItemIndex:fe,totalListHeight:et,...x,endReached:Ue,propsReady:b,rangeChanged:Ne,startReached:Je,stateChanged:I,stateRestoreInProgress:J,...j}},oe(Jt,ye,mt,tn,De,eo,_e));function mn(e,t,o){return nt(1,Tt((e+o)/(Tt(t)+o)))}function zo(e,t,o,n){const{height:r}=o;if(r===void 0||n.length===0)return{bottom:0,top:0};const l=Gt(e,t,o,n[0].index);return{bottom:Gt(e,t,o,n[n.length-1].index)+r,top:l}}function Gt(e,t,o,n){const r=mn(e.width,o.width,t.column),l=Tt(n/r),i=l*o.height+nt(0,l-1)*t.row;return i>0?i+t.row:i}const Ur=Y(()=>{const e=T(v=>`Item ${v}`),t=T({}),o=T(null),n=T("virtuoso-grid-item"),r=T("virtuoso-grid-list"),l=T(oo),i=T("div"),c=T(Ze),a=(v,x=null)=>ve(C(t,z(f=>f[v]),te()),x),u=T(!1),h=T(!1);return L(D(h),u),{components:t,computeItemKey:l,context:o,FooterComponent:a("Footer"),HeaderComponent:a("Header"),headerFooterTag:i,itemClassName:n,ItemComponent:a("Item","div"),itemContent:e,listClassName:r,ListComponent:a("List","div"),readyStateChanged:u,reportReadyState:h,ScrollerComponent:a("Scroller","div"),scrollerRef:c,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder","div")}}),Kr=Y(([e,t])=>({...e,...t}),oe(Gr,Ur)),Yr=M.memo(function(){const e=re("gridState"),t=re("listClassName"),o=re("itemClassName"),n=re("itemContent"),r=re("computeItemKey"),l=re("isSeeking"),i=Ie("scrollHeight"),c=re("ItemComponent"),a=re("ListComponent"),u=re("ScrollSeekPlaceholder"),h=re("context"),v=Ie("itemDimensions"),x=Ie("gap"),f=re("log"),w=re("stateRestoreInProgress"),b=Ie("reportReadyState"),g=$e(M.useMemo(()=>m=>{const p=m.parentElement.parentElement.scrollHeight;i(p);const k=m.firstChild;if(k!==null){const{height:E,width:j}=k.getBoundingClientRect();v({height:E,width:j})}x({column:Eo("column-gap",getComputedStyle(m).columnGap,f),row:Eo("row-gap",getComputedStyle(m).rowGap,f)})},[i,v,x,f]),!0,!1);return an(()=>{e.itemHeight>0&&e.itemWidth>0&&b(!0)},[e]),w?null:s.jsx(a,{className:t,ref:g,...ge(a,h),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(m=>{const p=r(m.index,m.data,h);return l?s.jsx(u,{...ge(u,h),height:e.itemHeight,index:m.index,width:e.itemWidth},p):N.createElement(c,{...ge(c,h),className:o,"data-index":m.index,key:p},n(m.index,m.data,h))})})}),Xr=M.memo(function(){const e=re("HeaderComponent"),t=Ie("headerHeight"),o=re("headerFooterTag"),n=$e(M.useMemo(()=>l=>{t(Oe(l,"height"))},[t]),!0,!1),r=re("context");return e!=null?s.jsx(o,{ref:n,children:s.jsx(e,{...ge(e,r)})}):null}),Qr=M.memo(function(){const e=re("FooterComponent"),t=Ie("footerHeight"),o=re("headerFooterTag"),n=$e(M.useMemo(()=>l=>{t(Oe(l,"height"))},[t]),!0,!1),r=re("context");return e!=null?s.jsx(o,{ref:n,children:s.jsx(e,{...ge(e,r)})}):null}),qr=({children:e})=>{const t=M.useContext(ln),o=Ie("itemDimensions"),n=Ie("viewportDimensions"),r=$e(M.useMemo(()=>l=>{n(l.getBoundingClientRect())},[n]),!0,!1);return M.useEffect(()=>{t&&(n({height:t.viewportHeight,width:t.viewportWidth}),o({height:t.itemHeight,width:t.itemWidth}))},[t,n,o]),s.jsx("div",{ref:r,style:Rt(!1),children:e})},Zr=({children:e})=>{const t=M.useContext(ln),o=Ie("windowViewportRect"),n=Ie("itemDimensions"),r=re("customScrollParent"),l=_o(o,r,!1);return M.useEffect(()=>{t&&(n({height:t.itemHeight,width:t.itemWidth}),o({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,o,n]),s.jsx("div",{ref:l,style:Rt(!1),children:e})},Jr=M.memo(function({...e}){const t=re("useWindowScroll"),o=re("customScrollParent"),n=o||t?ts:es,r=o||t?Zr:qr,l=re("context");return s.jsx(n,{...e,...ge(n,l),children:s.jsxs(r,{children:[s.jsx(Xr,{}),s.jsx(Yr,{}),s.jsx(Qr,{})]})})}),{useEmitter:hn,useEmitterValue:re,usePublisher:Ie}=rn(Kr,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},Jr),es=dn({useEmitter:hn,useEmitterValue:re,usePublisher:Ie}),ts=pn({useEmitter:hn,useEmitterValue:re,usePublisher:Ie});function Eo(e,t,o){return t!=="normal"&&(t==null?void 0:t.endsWith("px"))!==!0&&o(`${e} was not resolved to pixel value correctly`,t,he.WARN),t==="normal"?0:parseInt(t??"0",10)}const os=150;function ns({entries:e,itemCount:t}){const o=N.useRef(null),[n,r]=N.useState(!1),l=N.useRef(!1),i=N.useRef(0),c=N.useRef(e.length),a=N.useRef(0),u=N.useCallback((f="smooth")=>{o.current&&(a.current=Date.now(),o.current.scrollToIndex({index:t-1,behavior:f,align:"end"}))},[t]),h=N.useCallback(f=>l.current||!f?!1:"auto",[]),v=N.useCallback(f=>{r(!f),f&&(l.current=!1)},[]),x=N.useCallback(f=>{const b=f.target.scrollTop;if(Date.now()-a.current<os){i.current=b;return}b-i.current<-10&&(l.current=!0),i.current=b},[]);return N.useEffect(()=>{const f=e.length,w=c.current,b=f>w;if(c.current=f,!b)return;const g=e[e.length-1];(g==null?void 0:g.type)==="user_message"&&(l.current=!1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{o.current&&(a.current=Date.now(),o.current.scrollToIndex({index:"LAST",behavior:"auto",align:"end"}))})}))},[e]),{virtuosoRef:o,handleScroll:x,handleAtBottomStateChange:v,handleFollowOutput:h,showScrollButton:n,scrollToBottom:u}}/**
|
|
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 rs=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ss=Se("chevron-up",rs);/**
|
|
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 ls=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],is=Se("file-code",ls);/**
|
|
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 as=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]],cs=Se("file-plus",as);/**
|
|
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 us=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m14.5 12.5-5 5",key:"b62r18"}],["path",{d:"m9.5 12.5 5 5",key:"1rk7el"}]],ds=Se("file-x",us);/**
|
|
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 ps=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],ms=Se("file",ps);/**
|
|
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 hs=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],fs=Se("image",hs);/**
|
|
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 xs=[["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"}]],bl=Se("layout-dashboard",xs);/**
|
|
37
|
-
* @license lucide-react v0.577.0 - ISC
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the ISC license.
|
|
40
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const gs=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],vs=Se("paperclip",gs);/**
|
|
42
|
-
* @license lucide-react v0.577.0 - ISC
|
|
43
|
-
*
|
|
44
|
-
* This source code is licensed under the ISC license.
|
|
45
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const bs=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],ys=Se("send",bs);/**
|
|
47
|
-
* @license lucide-react v0.577.0 - ISC
|
|
48
|
-
*
|
|
49
|
-
* This source code is licensed under the ISC license.
|
|
50
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const ws=[["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"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Cs=Se("shield-check",ws);/**
|
|
52
|
-
* @license lucide-react v0.577.0 - ISC
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the ISC license.
|
|
55
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const ks=[["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"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ts=Se("shield-question-mark",ks);/**
|
|
57
|
-
* @license lucide-react v0.577.0 - ISC
|
|
58
|
-
*
|
|
59
|
-
* This source code is licensed under the ISC license.
|
|
60
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/const Is=[["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"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]],Ss=Se("shield-x",Is),js=/^(\/[a-zA-Z0-9_-]+)\s*/,Rs=/@([\w./\\-]+\.\w+)/g;function Ns(e){const t=[];let o=0,n;const r=new RegExp(Rs);for(;(n=r.exec(e))!==null;){n.index>o&&t.push(e.slice(o,n.index));const l=n[1];t.push(s.jsxs("span",{className:"inline-flex items-center gap-[3px] mx-[2px] px-[6px] py-[1px] rounded-[5px] text-[11px] font-mono align-middle",style:{backgroundColor:"rgba(255,255,255,0.1)",color:"#E8DFD5"},children:[s.jsx(ms,{size:10,strokeWidth:2}),l.split(/[\\/]/).pop()]},n.index)),o=r.lastIndex}return o<e.length&&t.push(e.slice(o)),t.length>0?t:e}function zs({entry:e}){const t=e.content.match(js),o=t==null?void 0:t[1],n=t?e.content.slice(t[0].length):e.content;return s.jsx("div",{className:"flex justify-end py-[var(--spacing-1-5)]",children:s.jsxs("div",{className:"max-w-[70%] px-[14px] py-[10px] text-[13px] leading-[1.6] whitespace-pre-wrap break-words",style:{backgroundColor:"#3D352D",color:"#F0EBE5",borderRadius:"16px 16px 4px 16px"},children:[o&&s.jsxs("span",{className:"inline-flex items-center gap-[4px] mr-[6px] px-[7px] py-[1px] rounded-[6px] text-[11px] font-semibold align-middle",style:{backgroundColor:"var(--color-tint-planning)",color:"var(--color-accent-purple)"},children:[s.jsx(Dt,{size:10,strokeWidth:2}),o]}),Ns(n)]})})}function Es({children:e,maxHeight:t=300,expandLabel:o="Show more",collapseLabel:n="Show less"}){var x;const r=N.useRef(null),[l,i]=N.useState(!1),[c,a]=N.useState(!1);N.useEffect(()=>{const f=r.current;if(!f)return;const w=()=>{const g=f.scrollHeight;i(g>t)};w();const b=new ResizeObserver(()=>{requestAnimationFrame(w)});return b.observe(f),()=>{b.disconnect()}},[t]);const u=N.useCallback(()=>a(f=>!f),[]),v=l&&!c?{maxHeight:`${t}px`,overflow:"hidden",maskImage:"linear-gradient(to bottom, black calc(100% - 60px), transparent)",WebkitMaskImage:"linear-gradient(to bottom, black calc(100% - 60px), transparent)",transition:"max-height 0.35s ease"}:{maxHeight:l?`${((x=r.current)==null?void 0:x.scrollHeight)??9999}px`:"none",overflow:"hidden",transition:"max-height 0.35s ease"};return s.jsxs("div",{children:[s.jsx("div",{ref:r,style:v,children:e}),l&&s.jsx("button",{type:"button",onClick:u,className:"flex items-center gap-1 mt-2 px-0 py-1 text-[12px] font-medium border-none bg-transparent cursor-pointer",style:{color:"color-mix(in srgb, var(--color-text-secondary) 80%, transparent)"},children:c?s.jsxs(s.Fragment,{children:[s.jsx(ss,{size:14}),n]}):s.jsxs(s.Fragment,{children:[s.jsx(vn,{size:14}),o]})})]})}const Qe={"claude-code":{label:"C",color:"var(--color-accent-purple)",className:"claude"},codex:{label:"Cx",color:"var(--color-accent-green)",className:"codex"},"codex-server":{label:"Cs",color:"var(--color-accent-green)",className:"codex"},gemini:{label:"G",color:"var(--color-accent-blue)",className:"gemini"},"gemini-a2a":{label:"Ga",color:"var(--color-accent-blue)",className:"gemini"},qwen:{label:"Q",color:"var(--color-accent-orange)",className:"qwen"},opencode:{label:"O",color:"var(--color-text-tertiary)",className:"opencode"},"agent-sdk":{label:"S",color:"var(--color-accent-purple)",className:"claude"}};function Hs({entry:e,isGroupContinuation:t}){const o=Pe(i=>i.processes[e.processId]),n=o==null?void 0:o.type,r=(o==null?void 0:o.status)==="running"||(o==null?void 0:o.status)==="spawning",l=Qe[n??"claude-code"]??Qe["claude-code"];return s.jsxs("div",{className:"flex gap-[10px]",style:{paddingTop:t?0:10,paddingBottom:10},children:[t?s.jsx("div",{className:"shrink-0 w-7"}):s.jsxs("div",{className:"relative shrink-0 w-7 h-7 rounded-[8px] flex items-center justify-center mt-[2px] text-[11px] font-bold text-white",style:{backgroundColor:l.color},children:[l.label,r&&s.jsx("span",{className:"absolute inset-[-3px] rounded-[10px] pointer-events-none",style:{border:"1.5px solid currentColor",color:l.color,opacity:.3,animation:"avatar-pulse 2.5s ease-in-out infinite"}})]}),s.jsx("div",{className:"flex-1 min-w-0 flex flex-col gap-2 contain-content",children:e.partial?s.jsxs("div",{className:"text-text-primary text-[13px] leading-[1.75] whitespace-pre-wrap break-words",children:[e.content,s.jsx("span",{className:"inline-block w-[2px] h-[1em] ml-[2px] align-text-bottom",style:{backgroundColor:"var(--color-accent-orange)",animation:"blink-cursor 1s step-end infinite"},"aria-label":"Typing"})]}):s.jsx(Es,{maxHeight:300,children:s.jsx(jn,{content:e.content})})})]})}function Bs({entry:e}){const[t,o]=N.useState(!1),n=Pe(i=>i.entries[e.processId]??[]),r=N.useMemo(()=>{const i=n.findIndex(a=>a.id===e.id);return i===-1||i===n.length-1||!n[i+1]},[n,e.id]),l=N.useMemo(()=>{if(r)return"Thinking...";const i=n.findIndex(v=>v.id===e.id),c=n[i+1];if(!c)return"Thinking...";const a=new Date(e.timestamp).getTime(),u=new Date(c.timestamp).getTime(),h=Math.round((u-a)/1e3);return h<1?"Thought for <1s":`Thought for ${h}s`},[n,e.id,e.timestamp,r]);return s.jsxs("div",{className:"contain-content",children:[s.jsxs("button",{type:"button",onClick:()=>o(i=>!i),className:"text-left text-[12px] leading-[1.6] italic py-[4px] cursor-pointer transition-colors",style:{color:"var(--color-text-tertiary)",transitionDuration:"var(--duration-fast)"},onMouseEnter:i=>{i.currentTarget.style.color="var(--color-text-secondary)"},onMouseLeave:i=>{i.currentTarget.style.color="var(--color-text-tertiary)"},children:[s.jsx("span",{className:"not-italic font-semibold text-[10px] uppercase tracking-[0.04em] mr-[6px]",style:{color:"var(--color-accent-purple)"},children:"Thinking"}),s.jsxs("span",{style:{color:"var(--color-accent-purple)"},children:[e.content.slice(0,60),e.content.length>60?"...":""]}),s.jsx("span",{className:"not-italic text-[10px] font-mono ml-[4px]",style:{color:"var(--color-text-placeholder)"},children:l.replace("Thought for ","").replace("Thinking...","...")})]}),t&&s.jsx("div",{className:"text-[12px] leading-[1.6] italic mt-[2px] pl-[2px] whitespace-pre-wrap break-words",style:{color:"var(--color-text-tertiary)"},children:e.content})]})}const Ms={pending:{bg:"var(--color-status-bg-pending)",color:"var(--color-status-pending)",label:"Pending"},running:{bg:"var(--color-status-bg-executing)",color:"var(--color-status-executing)",label:"Running"},completed:{bg:"var(--color-status-bg-completed)",color:"var(--color-status-completed)",label:"Completed"},failed:{bg:"var(--color-status-bg-blocked)",color:"var(--color-status-blocked)",label:"Failed"}};function Ls({entry:e}){const[t,o]=N.useState(!1),n=Ms[e.status];return s.jsxs("div",{className:"flex gap-[6px]",children:[s.jsxs("div",{className:"flex flex-col items-center shrink-0 pt-[12px]",style:{marginLeft:"2px"},children:[s.jsx("span",{className:"w-[8px] h-[8px] rounded-full shrink-0",style:{backgroundColor:e.status==="completed"?"var(--color-tint-completed)":e.status==="running"?"var(--color-tint-executing)":"var(--color-bg-card)",border:`2px solid ${e.status==="completed"?"var(--color-accent-green)":e.status==="running"?"var(--color-accent-yellow)":"var(--color-border)"}`}}),s.jsx("span",{className:"w-[2px] flex-1 mt-0",style:{backgroundColor:"var(--color-border)"}})]}),s.jsxs("div",{className:"flex-1 min-w-0 contain-content pl-[8px]",children:[s.jsxs("button",{type:"button",onClick:()=>o(r=>!r),className:"flex items-center gap-[6px] w-full py-[4px] text-left cursor-pointer transition-opacity hover:opacity-70",style:{transitionDuration:"var(--duration-fast)"},children:[s.jsx(Rn,{size:14,className:"shrink-0",strokeWidth:1.8,style:{color:"var(--color-text-tertiary)"}}),s.jsx("span",{className:"text-[12px] font-semibold text-text-primary truncate",children:e.name==="unknown"?"Tool Call":e.name}),e.input&&typeof e.input=="object"&&"file_path"in e.input&&s.jsx("span",{className:"text-[11px] font-mono",style:{color:"var(--color-text-tertiary)"},children:String(e.input.file_path).split("/").pop()}),s.jsx("span",{className:"ml-auto shrink-0 rounded-[var(--radius-full)] px-[var(--spacing-2)] py-[2px] text-[10px] font-semibold",style:{backgroundColor:n.bg,color:n.color},children:n.label})]}),t&&s.jsxs("div",{className:"mt-[4px] space-y-[4px]",children:[e.input&&Object.keys(e.input).length>0&&s.jsx("pre",{className:"text-[11px] font-mono rounded-[6px] p-[6px_8px] overflow-x-auto max-h-[120px] overflow-y-auto whitespace-pre-wrap break-words leading-[1.5]",style:{background:"var(--color-bg-primary)",color:"var(--color-text-secondary)",border:"1px solid var(--color-border-divider)"},children:JSON.stringify(e.input,null,2)}),e.result!=null&&e.result.length>0&&s.jsx("pre",{className:"text-[11px] font-mono rounded-[6px] p-[6px_8px] overflow-x-auto max-h-[120px] overflow-y-auto whitespace-pre-wrap break-words leading-[1.5]",style:{background:"var(--color-bg-primary)",color:"var(--color-text-secondary)",border:"1px solid var(--color-border-divider)"},children:e.result}),(!e.input||Object.keys(e.input).length===0)&&(!e.result||e.result.length===0)&&s.jsx("div",{className:"text-[11px] px-[8px] py-[4px]",style:{color:"var(--color-text-placeholder)"},children:"No details available"})]})]})]})}const Os={create:{icon:cs,color:"var(--color-accent-green)",bg:"var(--color-status-bg-completed)",label:"Create"},modify:{icon:is,color:"var(--color-accent-yellow)",bg:"var(--color-status-bg-executing)",label:"Modify"},delete:{icon:ds,color:"var(--color-accent-red)",bg:"var(--color-status-bg-blocked)",label:"Delete"}};function As({entry:e}){const[t,o]=N.useState(!1),n=Os[e.action],r=n.icon,l=e.diff!=null&&e.diff.length>0;return s.jsxs("div",{className:"rounded-[10px] border border-border overflow-hidden contain-content transition-shadow",style:{backgroundColor:"var(--color-bg-card)",transitionDuration:"var(--duration-slow)"},onMouseEnter:i=>{i.currentTarget.style.boxShadow="0 2px 12px rgba(45,42,38,0.06)"},onMouseLeave:i=>{i.currentTarget.style.boxShadow="none"},children:[s.jsxs("button",{type:"button",onClick:()=>l&&o(i=>!i),className:`flex items-center gap-[var(--spacing-2)] w-full px-[var(--spacing-3)] py-[var(--spacing-2)] text-left transition-colors ${l?"hover:bg-bg-hover cursor-pointer":"cursor-default"}`,style:{transitionDuration:"var(--duration-fast)"},children:[s.jsx(r,{size:14,className:"shrink-0",strokeWidth:1.8,style:{color:n.color}}),s.jsx("span",{className:"text-[11px] font-mono truncate",style:{color:"var(--color-text-secondary)"},children:e.path}),s.jsx("span",{className:"ml-auto shrink-0 rounded-[var(--radius-sm)] px-[7px] py-[2px] text-[10px] font-bold uppercase tracking-[0.03em]",style:{backgroundColor:n.bg,color:n.color},children:n.label}),l&&s.jsx(Mo,{size:14,className:"shrink-0 transition-transform text-text-tertiary",style:{transitionDuration:"var(--duration-fast)",transform:t?"rotate(90deg)":"rotate(0deg)"}})]}),t&&l&&s.jsx("div",{className:"border-t border-border-divider",children:s.jsx("pre",{className:"text-[length:var(--font-size-xs)] font-mono p-[var(--spacing-3)] overflow-x-auto max-h-[300px] overflow-y-auto",style:{background:"var(--code-bg)",color:"var(--code-t1)"},children:e.diff.split(`
|
|
62
|
-
`).map((i,c)=>{const a=i.startsWith("+"),u=i.startsWith("-");return s.jsx("div",{style:{background:a?"rgba(90, 158, 120, 0.1)":u?"rgba(196, 101, 85, 0.1)":void 0,color:a?"#5A9E78":u?"#C46555":void 0},children:i},c)})})})]})}function _s({entry:e}){const[t,o]=N.useState(!1),n=e.output!=null&&e.output.length>0,r=e.exitCode!=null&&e.exitCode!==0;return s.jsxs("div",{className:"rounded-[10px] border overflow-hidden contain-content font-mono",style:{backgroundColor:"var(--code-bg)",borderColor:r?"var(--color-accent-red)":"var(--code-border)"},children:[s.jsxs("button",{type:"button",onClick:()=>n&&o(l=>!l),className:`flex items-center gap-[var(--spacing-2)] w-full px-[var(--spacing-3)] py-[var(--spacing-2)] text-left transition-colors ${n?"cursor-pointer":"cursor-default"}`,style:{transitionDuration:"var(--duration-fast)"},onMouseEnter:l=>{n&&(l.currentTarget.style.backgroundColor="rgba(255,255,255,0.03)")},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="transparent"},children:[s.jsx(Nn,{size:14,className:"shrink-0",style:{color:"var(--code-t2)"}}),s.jsx("span",{className:"text-[12px] font-medium truncate",style:{color:"var(--code-t1)"},children:e.command}),e.exitCode!=null&&s.jsxs("span",{className:"ml-auto shrink-0 text-[10px] font-semibold px-[7px] py-[2px] rounded-[var(--radius-sm)]",style:{color:r?"#D4A07A":"#A3BE8C",backgroundColor:r?"rgba(196,101,85,0.15)":"rgba(90,158,120,0.15)"},children:["exit ",e.exitCode]}),n&&s.jsx(Mo,{size:14,className:"shrink-0 transition-transform",style:{color:"var(--code-t2)",transitionDuration:"var(--duration-fast)",transform:t?"rotate(90deg)":"rotate(0deg)"}})]}),t&&n&&s.jsx("div",{style:{borderTop:"1px solid var(--code-border)"},children:s.jsx("pre",{className:"text-[11px] leading-[1.5] p-[var(--spacing-3)] overflow-x-auto max-h-[300px] overflow-y-auto whitespace-pre-wrap break-words",style:{color:"var(--code-t2)"},children:e.output})})]})}function Ot({label:e,light:t}){return s.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:18,height:16,padding:"0 4px",borderRadius:3,fontSize:10,fontFamily:"monospace",fontWeight:600,lineHeight:1,backgroundColor:t?"rgba(255,255,255,0.2)":"var(--color-bg-hover)",color:t?"rgba(255,255,255,0.8)":"var(--color-text-tertiary)",border:t?"none":"1px solid var(--color-border-divider)"},children:e})}function Ds({entry:e}){function t(o){yt({action:"approve",processId:e.processId,requestId:e.requestId,allow:o})}return s.jsxs("div",{className:"rounded-[10px] overflow-hidden contain-content",style:{backgroundColor:"var(--color-tint-verifying)",border:"1.5px solid var(--color-accent-orange)"},children:[s.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3)] py-[9px]",style:{borderBottom:"1px solid rgba(200,134,58,0.15)"},children:[s.jsx(Ts,{size:15,className:"shrink-0",strokeWidth:1.8,style:{color:"var(--color-accent-orange)"}}),s.jsx("span",{className:"text-[12px] font-semibold text-text-primary",children:"Permission Required"}),s.jsx("span",{className:"ml-auto shrink-0 rounded-[var(--radius-full)] px-[var(--spacing-2)] py-[2px] text-[10px] font-semibold",style:{backgroundColor:"rgba(200,134,58,0.12)",color:"var(--color-accent-orange)"},children:e.toolName})]}),s.jsx("div",{className:"px-[var(--spacing-3)] py-[10px]",children:s.jsx("pre",{className:"text-[11px] font-mono rounded-[var(--radius-default)] p-[8px_10px] overflow-x-auto max-h-[100px] overflow-y-auto whitespace-pre-wrap break-words",style:{color:"var(--color-text-secondary)",backgroundColor:"var(--color-bg-card)",border:"1px solid var(--color-border-divider)"},children:JSON.stringify(e.toolInput,null,2)})}),s.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3)] py-[var(--spacing-2)]",style:{borderTop:"1px solid rgba(200,134,58,0.15)"},children:[s.jsxs("button",{type:"button",onClick:()=>t(!0),className:"rounded-[var(--radius-md)] px-[var(--spacing-4)] py-[5px] text-[12px] font-semibold transition-all hover:opacity-90 flex items-center gap-[6px]",style:{backgroundColor:"var(--color-accent-green)",color:"#fff"},children:["Allow",s.jsx(Ot,{label:"Y",light:!0})]}),s.jsxs("button",{type:"button",onClick:()=>t(!1),className:"rounded-[var(--radius-md)] px-[var(--spacing-4)] py-[5px] text-[12px] font-semibold border transition-all flex items-center gap-[6px]",style:{borderColor:"var(--color-border)",backgroundColor:"var(--color-bg-card)",color:"var(--color-accent-red)"},onMouseEnter:o=>{const n=o.currentTarget;n.style.borderColor="var(--color-accent-red)",n.style.backgroundColor="var(--color-tint-blocked)"},onMouseLeave:o=>{const n=o.currentTarget;n.style.borderColor="var(--color-border)",n.style.backgroundColor="var(--color-bg-card)"},children:["Deny",s.jsx(Ot,{label:"Esc"})]}),s.jsxs("span",{className:"ml-auto text-[10px]",style:{color:"var(--color-text-placeholder)"},children:[s.jsx(Ot,{label:"A"})," Always"]})]})]})}function Ws({entry:e}){const t=e.allowed?Cs:Ss,o=e.allowed?"var(--color-accent-green)":"var(--color-accent-red)",n=e.allowed?"var(--color-status-bg-completed)":"var(--color-status-bg-blocked)",r=e.allowed?"Allowed":"Denied";return s.jsx("div",{className:"flex items-center justify-center",children:s.jsxs("span",{className:"inline-flex items-center gap-[var(--spacing-1-5)] rounded-[var(--radius-full)] px-[var(--spacing-3)] py-[var(--spacing-1)] text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)]",style:{backgroundColor:n,color:o},children:[s.jsx(t,{size:12}),r]})})}function Fs({entry:e}){return s.jsxs("div",{className:"flex items-start gap-[6px] py-[4px]",role:"alert",style:{color:"var(--color-accent-red)"},children:[s.jsx(zn,{size:14,className:"shrink-0 mt-[2px]",strokeWidth:1.8}),s.jsxs("div",{className:"min-w-0 text-[12px] leading-[1.5]",children:[s.jsx("span",{className:"break-words",children:e.message}),e.code&&s.jsx("code",{className:"ml-[4px] font-mono text-[11px] px-[5px] py-[1px] rounded-[3px]",style:{backgroundColor:"rgba(196,101,85,0.06)"},children:e.code})]})]})}const Ps={spawning:"var(--color-status-exploring)",running:"var(--color-status-executing)",paused:"var(--color-status-pending)",stopping:"var(--color-accent-orange)",stopped:"var(--color-status-pending)",error:"var(--color-accent-red)"},Vs={spawning:"var(--color-status-bg-exploring)",running:"var(--color-status-bg-executing)",paused:"var(--color-status-bg-pending)",stopping:"var(--color-status-bg-verifying)",stopped:"var(--color-status-bg-pending)",error:"var(--color-status-bg-blocked)"};function $s({entry:e}){const t=Ps[e.status]??"var(--color-text-tertiary)",o=Vs[e.status]??"var(--color-bg-secondary)";return s.jsxs("div",{className:"flex items-center justify-center gap-[var(--spacing-2)] py-[var(--spacing-1-5)]",children:[s.jsx("span",{className:"flex-1 max-w-[80px] h-[1px]",style:{backgroundColor:"var(--color-border-divider)"}}),s.jsxs("span",{className:"inline-flex items-center gap-[5px] rounded-[var(--radius-full)] px-[10px] py-[2px] text-[10px] font-semibold",style:{backgroundColor:o,color:t},children:[s.jsx(bn,{size:10,strokeWidth:2}),e.status,e.reason&&s.jsxs("span",{className:"text-text-tertiary",children:["-- ",e.reason]})]}),s.jsx("span",{className:"flex-1 max-w-[80px] h-[1px]",style:{backgroundColor:"var(--color-border-divider)"}})]})}function Ho(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Gs({entry:e}){const t=e.inputTokens+e.outputTokens,n=Math.min(100,Math.round(t/2e5*100));return s.jsxs("div",{className:"flex items-center gap-[10px] px-3 py-[6px] rounded-[8px] border",style:{backgroundColor:"var(--color-bg-primary)",borderColor:"var(--color-border-divider)"},children:[s.jsx("span",{className:"text-[10px] font-medium",style:{color:"var(--color-text-tertiary)"},children:"Tokens"}),s.jsx("span",{className:"text-[11px] font-mono font-medium",style:{color:"var(--color-text-secondary)"},children:Ho(t)}),s.jsx("div",{className:"flex-1 max-w-[60px] h-1 rounded-[2px] overflow-hidden",style:{backgroundColor:"var(--color-bg-tertiary)"},children:s.jsx("div",{className:"h-full rounded-[2px]",style:{width:`${n}%`,backgroundColor:"var(--color-accent-orange)"}})}),s.jsx("span",{className:"w-px h-3",style:{backgroundColor:"var(--color-border-divider)"}}),e.cacheReadTokens!=null&&e.cacheReadTokens>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-[10px] font-medium",style:{color:"var(--color-text-tertiary)"},children:"Cache"}),s.jsx("span",{className:"text-[11px] font-mono font-medium",style:{color:"var(--color-text-secondary)"},children:Ho(e.cacheReadTokens)})]}),"cost"in e&&typeof e.cost=="number"&&s.jsxs("span",{className:"text-[10px] ml-auto",style:{color:"var(--color-text-tertiary)"},children:["$",e.cost.toFixed(3)]})]})}function Us({entry:e,isGroupContinuation:t}){switch(e.type){case"user_message":return s.jsx(zs,{entry:e});case"assistant_message":return s.jsx(Hs,{entry:e,isGroupContinuation:t});case"thinking":return s.jsx(Bs,{entry:e});case"tool_use":return s.jsx(Ls,{entry:e});case"file_change":return s.jsx(As,{entry:e});case"command_exec":return s.jsx(_s,{entry:e});case"approval_request":return s.jsx(Ds,{entry:e});case"approval_response":return s.jsx(Ws,{entry:e});case"error":return s.jsx(Fs,{entry:e});case"status_change":return s.jsx($s,{entry:e});case"token_usage":return s.jsx(Gs,{entry:e});default:return null}}const Ks=new Set(["assistant_message","error","command_exec","tool_use"]);function Ys(e){const t={source_entry_id:e.id,source_process_id:e.processId};switch(e.type){case"assistant_message":return{...t,title:"Issue from assistant message",description:e.content.slice(0,2e3)};case"error":return{...t,title:`Error: ${e.message.slice(0,100)}`,description:e.message+(e.code?`
|
|
63
|
-
Code: ${e.code}`:""),type:"bug",priority:"high"};case"command_exec":return{...t,title:`Issue from command: ${e.command.slice(0,80)}`,description:[`Command: ${e.command}`,e.exitCode!==void 0?`Exit code: ${e.exitCode}`:"",e.output?`Output:
|
|
64
|
-
${e.output.slice(0,1500)}`:""].filter(Boolean).join(`
|
|
65
|
-
`),type:e.exitCode!==0?"bug":"task"};case"tool_use":return{...t,title:`Issue from tool: ${e.name}`,description:[`Tool: ${e.name}`,`Status: ${e.status}`,`Input: ${JSON.stringify(e.input,null,2).slice(0,500)}`,e.result?`Result: ${e.result.slice(0,1e3)}`:""].filter(Boolean).join(`
|
|
66
|
-
`),type:e.status==="failed"?"bug":"task"};default:return t}}function Xs({entry:e,children:t,onCreateIssue:o}){const[n,r]=N.useState(null),l=N.useRef(null),i=Ks.has(e.type),c=N.useCallback(u=>{i&&(u.preventDefault(),r({x:u.clientX,y:u.clientY}))},[i]);N.useEffect(()=>{if(!n)return;function u(){r(null)}function h(v){v.key==="Escape"&&r(null)}return document.addEventListener("click",u),document.addEventListener("keydown",h),()=>{document.removeEventListener("click",u),document.removeEventListener("keydown",h)}},[n]);const a=N.useCallback(()=>{r(null),o(Ys(e))},[e,o]);return s.jsxs("div",{onContextMenu:c,className:"relative",children:[t,n&&s.jsx("div",{ref:l,className:Le("fixed z-[100] min-w-[160px] rounded-[var(--radius-default)]","border border-border bg-bg-primary shadow-lg","py-[var(--spacing-1)]","animate-in fade-in-0 zoom-in-95"),style:{left:n.x,top:n.y},role:"menu",children:s.jsxs("button",{type:"button",role:"menuitem",onClick:a,className:Le("flex items-center gap-[var(--spacing-2)] w-full px-[var(--spacing-3)] py-[var(--spacing-1-5)]","text-left text-[length:var(--font-size-sm)] text-text-secondary","hover:bg-bg-hover hover:text-text-primary","transition-colors duration-[var(--duration-fast)]"),children:[s.jsxs("svg",{className:"w-4 h-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"16"}),s.jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]}),"Create Issue"]})})]})}const Qs=[{value:"bug",label:"Bug"},{value:"feature",label:"Feature"},{value:"improvement",label:"Improvement"},{value:"task",label:"Task"}],qs=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"urgent",label:"Urgent"}],vt=Le("w-full px-[var(--spacing-3)] py-[var(--spacing-2)]","rounded-[var(--radius-default)] border border-border","bg-bg-secondary text-text-primary","text-[length:var(--font-size-sm)]","focus:outline-none focus:shadow-[var(--shadow-focus-ring)]","transition-shadow duration-[var(--duration-fast)]"),bt="block text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-secondary mb-[var(--spacing-1)]";function Zs({open:e,onOpenChange:t,prefill:o}){const n=yn(b=>b.createIssue),[r,l]=N.useState(""),[i,c]=N.useState(""),[a,u]=N.useState("task"),[h,v]=N.useState("medium"),[x,f]=N.useState(!1);N.useEffect(()=>{e&&o&&(l(o.title??""),c(o.description??""),u(o.type??"task"),v(o.priority??"medium")),e||(l(""),c(""),u("task"),v("medium"))},[e,o]);const w=N.useCallback(async()=>{if(!r.trim())return;f(!0);const b={title:r.trim(),description:i,type:a,priority:h};o!=null&&o.source_entry_id&&(b.source_entry_id=o.source_entry_id),o!=null&&o.source_process_id&&(b.source_process_id=o.source_process_id),await n(b),f(!1),t(!1)},[r,i,a,h,o,n,t]);return s.jsx(wn,{open:e,onOpenChange:t,children:s.jsxs(Cn,{children:[s.jsx(kn,{className:"fixed inset-0 z-50 bg-black/50 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"}),s.jsxs(Tn,{className:Le("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[560px] max-w-[95vw] max-h-[85vh]","rounded-[var(--radius-lg)] border border-border bg-bg-primary 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:[s.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-6)] py-[var(--spacing-4)] border-b border-border shrink-0",children:[s.jsx(In,{className:"text-[length:var(--font-size-lg)] font-[var(--font-weight-semibold)] text-text-primary",children:"Create Issue"}),s.jsx(uo,{className:Le("w-8 h-8 flex items-center justify-center rounded-[var(--radius-sm)]","text-text-secondary hover:text-text-primary hover:bg-bg-hover","transition-colors duration-[var(--duration-fast)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]"),"aria-label":"Close",children:s.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),s.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto p-[var(--spacing-6)] space-y-[var(--spacing-4)]",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"issue-title",className:bt,children:"Title"}),s.jsx("input",{id:"issue-title",type:"text",value:r,onChange:b=>l(b.target.value),placeholder:"Brief summary of the issue",className:vt,autoFocus:!0})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"issue-desc",className:bt,children:"Description"}),s.jsx("textarea",{id:"issue-desc",value:i,onChange:b=>c(b.target.value),placeholder:"Detailed description...",rows:6,className:Le(vt,"resize-y min-h-[120px]")})]}),s.jsxs("div",{className:"flex gap-[var(--spacing-4)]",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{htmlFor:"issue-type",className:bt,children:"Type"}),s.jsx("select",{id:"issue-type",value:a,onChange:b=>u(b.target.value),className:vt,children:Qs.map(b=>s.jsx("option",{value:b.value,children:b.label},b.value))})]}),s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{htmlFor:"issue-priority",className:bt,children:"Priority"}),s.jsx("select",{id:"issue-priority",value:h,onChange:b=>v(b.target.value),className:vt,children:qs.map(b=>s.jsx("option",{value:b.value,children:b.label},b.value))})]})]})]}),s.jsxs("div",{className:"flex items-center justify-end gap-[var(--spacing-3)] px-[var(--spacing-6)] py-[var(--spacing-4)] border-t border-border shrink-0",children:[s.jsx(uo,{className:Le("px-[var(--spacing-4)] py-[var(--spacing-2)]","rounded-[var(--radius-default)]","text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)]","text-text-secondary hover:text-text-primary hover:bg-bg-hover","transition-colors duration-[var(--duration-fast)]"),children:"Cancel"}),s.jsx("button",{type:"button",disabled:!r.trim()||x,onClick:w,className:Le("px-[var(--spacing-4)] py-[var(--spacing-2)]","rounded-[var(--radius-default)]","text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)]","bg-[var(--color-accent-blue)] text-white","hover:opacity-90","disabled:opacity-50 disabled:cursor-not-allowed","transition-opacity duration-[var(--duration-fast)]"),children:x?"Creating...":"Create Issue"})]})]})]})})}const Bo=[];function Js({agentType:e}){const t=Qe[e??"claude-code"]??Qe["claude-code"];return s.jsx("div",{className:"max-w-[780px] mx-auto px-6",children:s.jsxs("div",{className:"flex gap-[10px]",style:{paddingTop:10,paddingBottom:10},children:[s.jsxs("div",{className:"relative shrink-0 w-7 h-7 rounded-[8px] flex items-center justify-center mt-[2px] text-[11px] font-bold text-white",style:{backgroundColor:t.color},children:[t.label,s.jsx("span",{className:"absolute inset-[-3px] rounded-[10px] pointer-events-none",style:{border:"1.5px solid currentColor",color:t.color,opacity:.3,animation:"avatar-pulse 2.5s ease-in-out infinite"}})]}),s.jsxs("div",{className:"flex items-center gap-[3px] pt-[6px]",children:[s.jsx("span",{className:"w-[5px] h-[5px] rounded-full animate-bounce",style:{backgroundColor:t.color,animationDelay:"0ms",opacity:.7}}),s.jsx("span",{className:"w-[5px] h-[5px] rounded-full animate-bounce",style:{backgroundColor:t.color,animationDelay:"150ms",opacity:.7}}),s.jsx("span",{className:"w-[5px] h-[5px] rounded-full animate-bounce",style:{backgroundColor:t.color,animationDelay:"300ms",opacity:.7}})]})]})})}function yl({processId:e}){const t=Pe(p=>e?p.entries[e]??Bo:Bo),o=Pe(p=>e?p.processes[e]:void 0),{virtuosoRef:n,handleScroll:r,handleFollowOutput:l,handleAtBottomStateChange:i,showScrollButton:c,scrollToBottom:a}=ns({entries:t,itemCount:t.length}),[u,h]=N.useState(!1),[v,x]=N.useState(),f=N.useCallback(p=>{x(p),h(!0)},[]),w=o==null?void 0:o.status,g=!((e==null?void 0:e.startsWith("cli-history-"))??!1)&&(w==="running"||w==="spawning"),m=N.useMemo(()=>{if(!g||t.length===0)return!1;const p=t[t.length-1];return!(p.type==="assistant_message"&&p.partial)},[g,t]);if(!e)return s.jsx("div",{className:"flex-1 flex items-center justify-center text-text-tertiary text-[length:var(--font-size-sm)]",children:"Select a session or start a new conversation"});if(t.length===0){if(g){const p=Qe[(o==null?void 0:o.type)??"claude-code"]??Qe["claude-code"];return s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsxs("div",{className:"flex flex-col items-center gap-3",children:[s.jsxs("div",{className:"relative w-9 h-9 rounded-[10px] flex items-center justify-center text-[13px] font-bold text-white",style:{backgroundColor:p.color},children:[p.label,s.jsx("span",{className:"absolute inset-[-3px] rounded-[12px] pointer-events-none",style:{border:"1.5px solid currentColor",color:p.color,opacity:.3,animation:"avatar-pulse 2.5s ease-in-out infinite"}})]}),s.jsxs("div",{className:"flex gap-1",children:[s.jsx("span",{className:"w-[5px] h-[5px] rounded-full animate-bounce",style:{backgroundColor:p.color,animationDelay:"0ms",opacity:.7}}),s.jsx("span",{className:"w-[5px] h-[5px] rounded-full animate-bounce",style:{backgroundColor:p.color,animationDelay:"150ms",opacity:.7}}),s.jsx("span",{className:"w-[5px] h-[5px] rounded-full animate-bounce",style:{backgroundColor:p.color,animationDelay:"300ms",opacity:.7}})]}),s.jsx("span",{className:"text-[12px]",style:{color:"var(--color-text-tertiary)"},children:w==="spawning"?"Starting agent...":"Thinking..."})]})})}return s.jsx("div",{className:"flex-1 flex items-center justify-center text-text-tertiary text-[length:var(--font-size-sm)]",children:"No messages yet"})}return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex-1 relative",style:{minHeight:0},children:[s.jsx(Wr,{ref:n,data:t,followOutput:l,atBottomStateChange:i,onScroll:r,atBottomThreshold:60,className:"h-full",style:{height:"100%"},components:m?{Footer:()=>s.jsx(Js,{agentType:o==null?void 0:o.type})}:{},itemContent:(p,k)=>{let E=!1;if(k.type==="assistant_message"&&p>0)for(let j=p-1;j>=0;j--){const O=t[j];if(O.type==="assistant_message"){E=!0;break}if(O.type==="user_message")break}return s.jsx("div",{className:"max-w-[780px] mx-auto px-6",children:s.jsx(Xs,{entry:k,onCreateIssue:f,children:s.jsx(Us,{entry:k,isGroupContinuation:E})})})}}),c&&s.jsx("button",{type:"button",onClick:()=>a("smooth"),style:{position:"absolute",bottom:"16px",right:"16px",width:"36px",height:"36px",borderRadius:"50%",border:"1px solid var(--color-border)",background:"var(--color-bg-secondary)",color:"var(--color-text-secondary)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 2px 8px rgba(0,0,0,0.15)",transition:"opacity 150ms ease",zIndex:10},"aria-label":"Scroll to bottom",children:s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M8 3v10M4 9l4 4 4-4"})})})]}),s.jsx(Zs,{open:u,onOpenChange:h,prefill:v})]})}const el=()=>{const e=N.useRef(!1);return{isComposing:e,compositionHandlers:{onCompositionStartCapture:()=>{e.current=!0},onCompositionEndCapture:()=>{e.current=!1}},createKeyDownHandler:(n,r)=>l=>{e.current||r!=null&&r(l)||l.key==="Enter"&&!l.shiftKey&&(l.preventDefault(),n())}}},tl=/^\/([a-zA-Z0-9_-]*)$/;function ol(e){const t=e.match(tl);return t?t[1]:null}function nl(e){const{input:t,commands:o,onSelect:n}=e,r=N.useMemo(()=>ol(t),[t]),[l,i]=N.useState(0),[c,a]=N.useState(!1);N.useEffect(()=>{i(0),a(!1)},[r]);const u=N.useMemo(()=>{if(r===null)return[];const f=r.trim().toLowerCase();return f?o.filter(w=>w.name.toLowerCase().startsWith("/"+f)||w.name.toLowerCase().startsWith(f)):o},[o,r]),h=r!==null&&!c&&u.length>0,v=N.useCallback(f=>{const w=u[f];return w?(n(w.name),a(!0),!0):!1},[u,n]),x=N.useCallback(f=>h?f.key==="Escape"?(f.preventDefault(),a(!0),!0):f.key==="ArrowDown"?(f.preventDefault(),i(w=>(w+1)%u.length),!0):f.key==="ArrowUp"?(f.preventDefault(),i(w=>(w-1+u.length)%u.length),!0):f.key==="Enter"&&!f.shiftKey?(f.preventDefault(),v(l)):!1:!1,[l,v,u.length,h]);return{isOpen:h,activeIndex:l,filteredCommands:u,onKeyDown:x,onSelectByIndex:v,setDismissed:a,setActiveIndex:i}}const rl=30,sl=800;function ll(e,t){const[o,n]=N.useState(!1),r=N.useRef(null),l=N.useRef(!1);return N.useEffect(()=>{if(e.includes(`
|
|
67
|
-
`)){l.current=!0,n(!0);return}if(e.length>=sl){l.current=!0,n(!0);return}if(!e){l.current=!1,n(!1);return}const i=t.current;if(!i)return;const c=requestAnimationFrame(()=>{r.current||(r.current=document.createElement("canvas"));const a=r.current.getContext("2d");if(!a)return;const u=i.querySelector("textarea");if(!u)return;const h=getComputedStyle(u);a.font=`${h.fontWeight} ${h.fontSize} ${h.fontFamily}`;const v=a.measureText(e).width,x=parseFloat(h.paddingLeft)||0,f=parseFloat(h.paddingRight)||0,w=u.clientWidth-x-f,b=l.current;let g;b?g=v>w-rl:g=v>w,l.current=g,n(g)});return()=>cancelAnimationFrame(c)},[e,t]),{isMultiline:o}}const il=2e5;function At(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toString()}function al(e){return e>=80?"var(--color-accent-red)":e>=50?"var(--color-accent-orange)":"var(--color-accent-green)"}function cl({processId:e,contextWindow:t=il,size:o=24}){const n=Pe(x=>e?x.processTokenUsage[e]??null:null),[r,l]=N.useState(!1),{percentage:i,ringColor:c,strokeDashoffset:a,circumference:u}=N.useMemo(()=>{const x=n??{input:0,output:0},f=x.input+x.output,w=Math.min(f/t*100,100),g=(o-2.5)/2,m=2*Math.PI*g;return{percentage:w,ringColor:al(w),strokeDashoffset:m-w/100*m,circumference:m}},[n,t,o]);if(!n)return null;const h=2.5,v=(o-h)/2;return s.jsxs("div",{className:"relative flex items-center justify-center cursor-default",style:{width:o,height:o},onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[s.jsxs("svg",{width:o,height:o,viewBox:`0 0 ${o} ${o}`,style:{transform:"rotate(-90deg)"},children:[s.jsx("circle",{cx:o/2,cy:o/2,r:v,fill:"none",stroke:"var(--color-border-divider)",strokeWidth:h}),s.jsx("circle",{cx:o/2,cy:o/2,r:v,fill:"none",stroke:c,strokeWidth:h,strokeLinecap:"round",strokeDasharray:u,strokeDashoffset:a,style:{transition:"stroke-dashoffset 0.3s ease, stroke 0.3s ease"}})]}),r&&s.jsxs("div",{className:"absolute bottom-[calc(100%+8px)] left-1/2 -translate-x-1/2 px-[10px] py-[6px] rounded-[8px] text-[11px] font-medium whitespace-nowrap z-50 pointer-events-none",style:{backgroundColor:"var(--color-text-primary)",color:"#fff",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"},children:[s.jsxs("div",{style:{marginBottom:2},children:[i.toFixed(1),"% context used"]}),s.jsxs("div",{className:"flex flex-col gap-[2px] text-[10px]",style:{opacity:.85},children:[s.jsxs("span",{children:["Input: ",At(n.input)]}),s.jsxs("span",{children:["Output: ",At(n.output)]}),(n.cacheRead>0||n.cacheWrite>0)&&s.jsxs("span",{children:["Cache: ",At(n.cacheRead+n.cacheWrite)]})]})]})]})}const ul=["claude-code","codex","gemini","qwen","opencode","agent-sdk"],dl=[{name:"/maestro-plan",desc:"Create detailed phase plan",color:"var(--color-accent-purple)",bg:"var(--color-tint-planning)"},{name:"/quality-review",desc:"Tiered code review",color:"var(--color-accent-green)",bg:"var(--color-tint-completed)"},{name:"/maestro-execute",desc:"Execute phase with parallelization",color:"var(--color-accent-orange)",bg:"var(--color-tint-verifying)"},{name:"/quality-debug",desc:"Parallel hypothesis debugging",color:"var(--color-accent-blue)",bg:"var(--color-tint-exploring)"}],pl=new Set(["claude-code"]);function wl({processId:e,executor:t}={}){const[o,n]=N.useState(""),[r,l]=N.useState("claude-code"),[i,c]=N.useState("inject"),a=N.useRef(null),u=N.useRef(null),h=N.useRef(null),v=N.useRef(null),{isMultiline:x}=ll(o,u),f=Pe(I=>I.activeProcessId),w=Pe(I=>I.processes),b=e!==void 0?e:f,g=b?w[b]??null:null,m=!!(b&&b.startsWith("cli-history-")&&(g==null?void 0:g.interactive)===!0),p=g!=null?g.interactive===!1:t!=null&&!pl.has(t),k=e!==void 0&&!b||!m&&p,{compositionHandlers:E,createKeyDownHandler:j}=el(),O=N.useCallback(I=>{var _;n(I+" "),(_=a.current)==null||_.focus()},[]),d=nl({input:o,commands:dl,onSelect:O}),y=N.useCallback(()=>{const I=o.trim();I&&(b&&g?m?yt({action:"delegate:message",processId:b,content:I,delivery:i}):yt({action:"message",processId:b,content:I}):e===void 0&&yt({action:"spawn",config:{type:r,prompt:I,workDir:"."}}),n(""),d.setDismissed(!0),a.current&&(a.current.style.height="auto"))},[o,b,g,r,e,d,m,i]),S=j(y,d.onKeyDown),B=N.useCallback(()=>{const I=a.current;I&&(I.style.height="auto",I.style.height=`${Math.min(I.scrollHeight,200)}px`)},[]),H=N.useCallback(I=>{n(I.target.value)},[]),P=N.useCallback(I=>{var J,fe;const _=(J=I.target.files)==null?void 0:J[0];_&&(n(ie=>ie+(ie?" ":"")+`@${_.name}`),(fe=a.current)==null||fe.focus()),I.target.value=""},[]),V=N.useCallback(I=>{var J,fe;const _=(J=I.target.files)==null?void 0:J[0];_&&(n(ie=>ie+(ie?" ":"")+`@${_.name}`),(fe=a.current)==null||fe.focus()),I.target.value=""},[]),A=!b&&e===void 0,U=(g==null?void 0:g.type)??r;return s.jsxs("div",{className:"shrink-0 px-6 pb-[14px] pt-2",style:{backgroundColor:"var(--color-bg-primary)"},children:[s.jsx("input",{ref:h,type:"file",className:"hidden",onChange:P}),s.jsx("input",{ref:v,type:"file",accept:"image/*",className:"hidden",onChange:V}),s.jsxs("div",{className:"max-w-[780px] mx-auto relative",children:[d.isOpen&&s.jsx("div",{className:"absolute bottom-full left-0 right-0 mb-[6px] border rounded-[12px] p-[6px] max-h-[240px] overflow-y-auto z-50",style:{backgroundColor:"var(--color-bg-card)",borderColor:"var(--color-border)",boxShadow:"0 -4px 20px rgba(0,0,0,0.06)",backdropFilter:"blur(12px)"},children:d.filteredCommands.map((I,_)=>s.jsxs("button",{type:"button",onClick:()=>d.onSelectByIndex(_),onMouseEnter:()=>d.setActiveIndex(_),className:"flex items-center gap-[10px] w-full px-[10px] py-[7px] rounded-[8px] cursor-pointer transition-colors duration-100 text-left border-none",style:{backgroundColor:_===d.activeIndex?"var(--color-bg-hover)":"transparent"},children:[s.jsx("span",{className:"w-7 h-7 rounded-[6px] flex items-center justify-center shrink-0",style:{backgroundColor:I.bg},children:s.jsx(Dt,{size:14,strokeWidth:1.8,stroke:I.color})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-[12px] font-semibold text-text-primary",children:I.name}),s.jsx("div",{className:"text-[11px]",style:{color:"var(--color-text-tertiary)"},children:I.desc})]})]},I.name))}),s.jsxs("div",{ref:u,className:"border transition-[border-color,box-shadow]",style:{borderColor:"var(--color-border)",backgroundColor:"var(--color-bg-card)",borderRadius:"var(--style-composer-radius)",boxShadow:"var(--style-card-shadow)",transitionDuration:"var(--duration-normal)"},onFocusCapture:I=>{const _=I.currentTarget;_.style.borderColor="var(--color-accent-orange)",_.style.boxShadow="0 2px 12px rgba(0,0,0,0.06), 0 0 0 3px rgba(200, 134, 58, 0.08)"},onBlurCapture:I=>{if(!I.relatedTarget||!(I.relatedTarget instanceof Node)||!I.currentTarget.contains(I.relatedTarget)){const _=I.currentTarget;_.style.borderColor="var(--color-border)",_.style.boxShadow="0 2px 12px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.02)"}},children:[s.jsx("textarea",{ref:a,value:o,onChange:H,onInput:B,onKeyDown:S,...E,disabled:k,placeholder:m?"Queue a follow-up for this async delegate...":b?"Send a message...":"Send a message, / for commands...",rows:x?3:1,className:`w-full resize-none border-none leading-[1.5] bg-transparent outline-none disabled:opacity-40 disabled:cursor-not-allowed ${x?"min-h-[72px] max-h-[200px]":"min-h-[42px] max-h-[42px]"}`,style:{color:"var(--color-text-primary)",fontSize:"var(--style-composer-textarea-size)",padding:"var(--style-composer-padding)"}}),s.jsxs("div",{className:"flex items-center gap-[2px] px-[6px] py-1",style:{},children:[s.jsx(_t,{tooltip:"File",icon:s.jsx(vs,{size:15,strokeWidth:1.8}),onClick:()=>{var I;return(I=h.current)==null?void 0:I.click()}}),s.jsx(_t,{tooltip:"Image",icon:s.jsx(fs,{size:15,strokeWidth:1.8}),onClick:()=>{var I;return(I=v.current)==null?void 0:I.click()}}),s.jsx(_t,{tooltip:"Skills",icon:s.jsx(Dt,{size:15,strokeWidth:1.8}),onClick:()=>{var I;d.isOpen?d.setDismissed(!0):(n("/"),(I=a.current)==null||I.focus())}}),s.jsx("div",{className:"w-px h-[18px] mx-1",style:{backgroundColor:"var(--color-border-divider)"}}),s.jsx(cl,{processId:b}),m&&s.jsxs("div",{className:"flex items-center gap-[5px] px-[10px] py-[3px] text-[11px] font-medium",style:{border:"var(--style-btn-secondary-border)",backgroundColor:"var(--style-btn-secondary-bg)",borderRadius:"var(--style-btn-secondary-radius)",color:"var(--color-text-secondary)"},children:[s.jsx("span",{style:{color:"var(--color-text-tertiary)"},children:"Delivery"}),s.jsxs("select",{value:i,onChange:I=>c(I.target.value),className:"border-none bg-transparent cursor-pointer outline-none appearance-none text-[11px] font-medium",style:{color:"inherit"},children:[s.jsx("option",{value:"inject",children:"Inject"}),s.jsx("option",{value:"after_complete",children:"After Complete"})]})]}),s.jsxs("div",{className:"flex items-center gap-[5px] ml-auto px-[10px] py-[3px] cursor-pointer text-[11px] font-medium transition-colors duration-150",style:{border:"var(--style-btn-secondary-border)",backgroundColor:"var(--style-btn-secondary-bg)",borderRadius:"var(--style-btn-secondary-radius)",color:"var(--color-text-secondary)"},children:[s.jsx("span",{className:"w-[7px] h-[7px] rounded-full shrink-0",style:{backgroundColor:Sn[A?r:U]}}),A?s.jsx("select",{value:r,onChange:I=>l(I.target.value),className:"border-none bg-transparent cursor-pointer outline-none appearance-none text-[11px] font-medium",style:{color:"inherit"},children:ul.map(I=>s.jsx("option",{value:I,children:zt[I]},I))}):s.jsx("span",{children:zt[U]??U})]}),s.jsx("button",{type:"button",onClick:y,disabled:!o.trim()||k,className:"shrink-0 w-[34px] h-[30px] rounded-[8px] flex items-center justify-center transition-all duration-150 disabled:opacity-40 disabled:cursor-not-allowed hover:opacity-90 ml-1 border-none cursor-pointer",style:{backgroundColor:"var(--style-send-btn-bg)",color:"var(--style-send-btn-color)"},"aria-label":"Send message",children:s.jsx(ys,{size:15,strokeWidth:2})})]})]}),s.jsxs("div",{className:"flex gap-3 mt-[5px] px-[6px] text-[10px]",style:{color:"var(--color-text-placeholder)"},children:[s.jsxs("span",{children:[s.jsx("kbd",{className:"font-mono text-[10px] px-1 border rounded-[3px]",style:{borderColor:"var(--color-border-divider)",backgroundColor:"var(--color-bg-secondary)"},children:"Enter"})," ",m?"queue":"send"]}),s.jsxs("span",{children:[s.jsx("kbd",{className:"font-mono text-[10px] px-1 border rounded-[3px]",style:{borderColor:"var(--color-border-divider)",backgroundColor:"var(--color-bg-secondary)"},children:"/"})," skills"]}),s.jsxs("span",{className:"ml-auto",children:[zt[A?r:U]," · ",m?i==="after_complete"?"after complete":"inject":"opus-4.6"]})]})]})]})}function _t({tooltip:e,icon:t,onClick:o}){return s.jsxs("button",{type:"button",onClick:o,className:"group relative w-[30px] h-[30px] rounded-[8px] border-none bg-transparent flex items-center justify-center cursor-pointer transition-all duration-150",style:{color:"var(--color-text-tertiary)"},onMouseEnter:n=>{n.currentTarget.style.backgroundColor="var(--style-icon-btn-hover-bg)",n.currentTarget.style.color="var(--color-text-primary)"},onMouseLeave:n=>{n.currentTarget.style.backgroundColor="transparent",n.currentTarget.style.color="var(--color-text-tertiary)"},children:[t,s.jsx("span",{className:"absolute bottom-[calc(100%+6px)] left-1/2 -translate-x-1/2 px-[7px] py-[2px] rounded-[5px] text-[10px] font-medium text-white whitespace-nowrap opacity-0 pointer-events-none group-hover:opacity-100 transition-opacity duration-[120ms]",style:{backgroundColor:"var(--color-text-primary)"},children:e})]})}export{wl as C,bl as L,yl as M};
|