claude-code-workflow 7.2.27 → 7.2.29
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/.ccw/specs/architecture-constraints.md +5 -0
- package/.claude/skills/_shared/SKILL-DESIGN-SPEC.md +140 -0
- package/.claude/skills/investigate/SKILL.md +110 -0
- package/.claude/skills/investigate/phases/01-root-cause-investigation.md +132 -0
- package/.claude/skills/investigate/phases/02-pattern-analysis.md +126 -0
- package/.claude/skills/investigate/phases/03-hypothesis-testing.md +177 -0
- package/.claude/skills/investigate/phases/04-implementation.md +139 -0
- package/.claude/skills/investigate/phases/05-verification-report.md +153 -0
- package/.claude/skills/investigate/specs/debug-report-format.md +226 -0
- package/.claude/skills/investigate/specs/iron-law.md +101 -0
- package/.claude/skills/security-audit/SKILL.md +125 -0
- package/.claude/skills/security-audit/phases/01-supply-chain-scan.md +139 -0
- package/.claude/skills/security-audit/phases/02-owasp-review.md +156 -0
- package/.claude/skills/security-audit/phases/03-threat-modeling.md +180 -0
- package/.claude/skills/security-audit/phases/04-report-tracking.md +177 -0
- package/.claude/skills/security-audit/specs/owasp-checklist.md +442 -0
- package/.claude/skills/security-audit/specs/scoring-gates.md +141 -0
- package/.claude/skills/ship/SKILL.md +105 -0
- package/.claude/skills/ship/phases/01-preflight-checks.md +121 -0
- package/.claude/skills/ship/phases/02-code-review.md +137 -0
- package/.claude/skills/ship/phases/03-version-bump.md +171 -0
- package/.claude/skills/ship/phases/04-changelog-commit.md +167 -0
- package/.claude/skills/ship/phases/05-pr-creation.md +163 -0
- package/.claude/skills/skill-generator/templates/sequential-phase.md +10 -0
- package/.claude/skills/skill-generator/templates/skill-md.md +4 -0
- package/.claude/skills/team-interactive-craft/SKILL.md +127 -0
- package/.claude/skills/team-interactive-craft/roles/a11y-tester/role.md +159 -0
- package/.claude/skills/team-interactive-craft/roles/builder/role.md +216 -0
- package/.claude/skills/team-interactive-craft/roles/coordinator/commands/analyze.md +71 -0
- package/.claude/skills/team-interactive-craft/roles/coordinator/commands/dispatch.md +192 -0
- package/.claude/skills/team-interactive-craft/roles/coordinator/commands/monitor.md +183 -0
- package/.claude/skills/team-interactive-craft/roles/coordinator/role.md +166 -0
- package/.claude/skills/team-interactive-craft/roles/interaction-designer/role.md +144 -0
- package/.claude/skills/team-interactive-craft/roles/researcher/role.md +131 -0
- package/.claude/skills/team-interactive-craft/specs/interaction-patterns.md +362 -0
- package/.claude/skills/team-interactive-craft/specs/pipelines.md +85 -0
- package/.claude/skills/team-interactive-craft/specs/team-config.json +105 -0
- package/.claude/skills/team-interactive-craft/specs/vanilla-constraints.md +83 -0
- package/.claude/skills/team-motion-design/SKILL.md +129 -0
- package/.claude/skills/team-motion-design/roles/animator/role.md +194 -0
- package/.claude/skills/team-motion-design/roles/choreographer/role.md +164 -0
- package/.claude/skills/team-motion-design/roles/coordinator/commands/analyze.md +64 -0
- package/.claude/skills/team-motion-design/roles/coordinator/commands/dispatch.md +203 -0
- package/.claude/skills/team-motion-design/roles/coordinator/commands/monitor.md +184 -0
- package/.claude/skills/team-motion-design/roles/coordinator/role.md +167 -0
- package/.claude/skills/team-motion-design/roles/motion-researcher/role.md +115 -0
- package/.claude/skills/team-motion-design/roles/motion-tester/role.md +175 -0
- package/.claude/skills/team-motion-design/specs/gpu-constraints.md +114 -0
- package/.claude/skills/team-motion-design/specs/motion-tokens.md +128 -0
- package/.claude/skills/team-motion-design/specs/pipelines.md +74 -0
- package/.claude/skills/team-motion-design/specs/reduced-motion.md +129 -0
- package/.claude/skills/team-motion-design/specs/team-config.json +99 -0
- package/.claude/skills/team-ui-polish/SKILL.md +127 -0
- package/.claude/skills/team-ui-polish/roles/coordinator/commands/analyze.md +77 -0
- package/.claude/skills/team-ui-polish/roles/coordinator/commands/dispatch.md +194 -0
- package/.claude/skills/team-ui-polish/roles/coordinator/commands/monitor.md +180 -0
- package/.claude/skills/team-ui-polish/roles/coordinator/role.md +170 -0
- package/.claude/skills/team-ui-polish/roles/diagnostician/role.md +160 -0
- package/.claude/skills/team-ui-polish/roles/optimizer/role.md +225 -0
- package/.claude/skills/team-ui-polish/roles/scanner/role.md +356 -0
- package/.claude/skills/team-ui-polish/roles/verifier/role.md +142 -0
- package/.claude/skills/team-ui-polish/specs/anti-patterns.md +141 -0
- package/.claude/skills/team-ui-polish/specs/design-standards.md +356 -0
- package/.claude/skills/team-ui-polish/specs/fix-strategies.md +235 -0
- package/.claude/skills/team-ui-polish/specs/pipelines.md +81 -0
- package/.claude/skills/team-ui-polish/specs/scoring-guide.md +162 -0
- package/.claude/skills/team-ui-polish/specs/team-config.json +73 -0
- package/.claude/skills/team-uidesign/SKILL.md +6 -1
- package/.claude/skills/team-uidesign/roles/designer/role.md +28 -4
- package/.claude/skills/team-uidesign/roles/implementer/role.md +25 -3
- package/.claude/skills/team-uidesign/roles/researcher/role.md +21 -2
- package/.claude/skills/team-uidesign/roles/reviewer/role.md +19 -17
- package/.claude/skills/team-uidesign/specs/anti-patterns.md +211 -0
- package/.claude/skills/team-uidesign/specs/design-standards.md +329 -0
- package/.claude/skills/team-uidesign/specs/scoring-guide.md +114 -0
- package/.claude/skills/team-uidesign/specs/team-config.json +1 -1
- package/.claude/skills/team-uidesign/specs/ux-writing.md +86 -0
- package/.claude/skills/team-ux-improve/SKILL.md +3 -0
- package/.claude/skills/team-ux-improve/roles/designer/role.md +30 -0
- package/.claude/skills/team-ux-improve/roles/diagnoser/role.md +16 -1
- package/.claude/skills/team-ux-improve/roles/scanner/role.md +43 -1
- package/.claude/skills/team-ux-improve/specs/anti-patterns.md +103 -0
- package/.claude/skills/team-ux-improve/specs/design-standards.md +54 -0
- package/.claude/skills/team-ux-improve/specs/heuristics.md +88 -0
- package/.claude/skills/team-ux-improve/wisdom/anti-patterns/common-ux-pitfalls.md +40 -8
- package/.claude/skills/team-ux-improve/wisdom/patterns/state-management.md +32 -12
- package/.claude/skills/team-ux-improve/wisdom/patterns/ui-feedback.md +35 -11
- package/.claude/skills/team-ux-improve/wisdom/principles/general-ux.md +36 -9
- package/.claude/skills/team-visual-a11y/SKILL.md +143 -0
- package/.claude/skills/team-visual-a11y/roles/color-auditor/role.md +178 -0
- package/.claude/skills/team-visual-a11y/roles/coordinator/commands/analyze.md +72 -0
- package/.claude/skills/team-visual-a11y/roles/coordinator/commands/dispatch.md +250 -0
- package/.claude/skills/team-visual-a11y/roles/coordinator/commands/monitor.md +204 -0
- package/.claude/skills/team-visual-a11y/roles/coordinator/role.md +169 -0
- package/.claude/skills/team-visual-a11y/roles/fix-implementer/role.md +246 -0
- package/.claude/skills/team-visual-a11y/roles/focus-auditor/role.md +222 -0
- package/.claude/skills/team-visual-a11y/roles/remediation-planner/role.md +206 -0
- package/.claude/skills/team-visual-a11y/roles/typo-auditor/role.md +185 -0
- package/.claude/skills/team-visual-a11y/specs/focus-patterns.md +325 -0
- package/.claude/skills/team-visual-a11y/specs/oklch-standards.md +130 -0
- package/.claude/skills/team-visual-a11y/specs/pipelines.md +98 -0
- package/.claude/skills/team-visual-a11y/specs/team-config.json +109 -0
- package/.claude/skills/team-visual-a11y/specs/typography-scale.md +165 -0
- package/.claude/skills/team-visual-a11y/specs/wcag-matrix.md +133 -0
- package/.codex/skills/brainstorm/SKILL.md +3 -3
- package/.codex/skills/clean/SKILL.md +3 -3
- package/.codex/skills/investigate/agents/investigator.md +392 -0
- package/.codex/skills/investigate/orchestrator.md +362 -0
- package/.codex/skills/investigate/phases/01-root-cause-investigation.md +212 -0
- package/.codex/skills/investigate/phases/02-pattern-analysis.md +181 -0
- package/.codex/skills/investigate/phases/03-hypothesis-testing.md +214 -0
- package/.codex/skills/investigate/phases/04-implementation.md +195 -0
- package/.codex/skills/investigate/phases/05-verification-report.md +240 -0
- package/.codex/skills/issue-discover/SKILL.md +13 -13
- package/.codex/skills/issue-discover/phases/02-discover.md +4 -4
- package/.codex/skills/issue-discover/phases/03-discover-by-prompt.md +3 -3
- package/.codex/skills/parallel-dev-cycle/SKILL.md +4 -4
- package/.codex/skills/parallel-dev-cycle/phases/02-agent-execution.md +6 -6
- package/.codex/skills/parallel-dev-cycle/phases/03-result-aggregation.md +10 -10
- package/.codex/skills/review-cycle/SKILL.md +10 -10
- package/.codex/skills/review-cycle/phases/02-parallel-review.md +6 -6
- package/.codex/skills/review-cycle/phases/04-iterative-deep-dive.md +4 -4
- package/.codex/skills/review-cycle/phases/07-fix-parallel-planning.md +4 -4
- package/.codex/skills/review-cycle/phases/08-fix-execution.md +2 -2
- package/.codex/skills/roadmap-with-file/SKILL.md +14 -14
- package/.codex/skills/security-audit/agents/security-auditor.md +341 -0
- package/.codex/skills/security-audit/orchestrator.md +384 -0
- package/.codex/skills/security-audit/phases/01-supply-chain-scan.md +226 -0
- package/.codex/skills/security-audit/phases/02-owasp-review.md +232 -0
- package/.codex/skills/security-audit/phases/03-threat-modeling.md +249 -0
- package/.codex/skills/security-audit/phases/04-report-tracking.md +300 -0
- package/.codex/skills/ship/agents/ship-operator.md +318 -0
- package/.codex/skills/ship/orchestrator.md +426 -0
- package/.codex/skills/ship/phases/01-preflight-checks.md +198 -0
- package/.codex/skills/ship/phases/02-code-review.md +228 -0
- package/.codex/skills/ship/phases/03-version-bump.md +259 -0
- package/.codex/skills/ship/phases/04-changelog-commit.md +263 -0
- package/.codex/skills/ship/phases/05-pr-creation.md +280 -0
- package/.codex/skills/spec-generator/README.md +1 -1
- package/.codex/skills/spec-generator/SKILL.md +184 -88
- package/.codex/skills/spec-generator/phases/01-5-requirement-clarification.md +4 -7
- package/.codex/skills/spec-generator/phases/01-discovery.md +30 -11
- package/.codex/skills/spec-generator/phases/02-product-brief.md +2 -5
- package/.codex/skills/spec-generator/phases/03-requirements.md +4 -6
- package/.codex/skills/spec-generator/phases/04-architecture.md +4 -6
- package/.codex/skills/spec-generator/phases/05-epics-stories.md +4 -6
- package/.codex/skills/spec-generator/phases/06-5-auto-fix.md +4 -5
- package/.codex/skills/spec-generator/phases/06-readiness-check.md +8 -8
- package/.codex/skills/spec-generator/phases/07-issue-export.md +2 -2
- package/.codex/skills/spec-setup/SKILL.md +4 -4
- package/.codex/skills/team-interactive-craft/SKILL.md +220 -0
- package/.codex/skills/team-interactive-craft/roles/a11y-tester/role.md +159 -0
- package/.codex/skills/team-interactive-craft/roles/builder/role.md +216 -0
- package/.codex/skills/team-interactive-craft/roles/coordinator/commands/analyze.md +71 -0
- package/.codex/skills/team-interactive-craft/roles/coordinator/commands/dispatch.md +162 -0
- package/.codex/skills/team-interactive-craft/roles/coordinator/commands/monitor.md +233 -0
- package/.codex/skills/team-interactive-craft/roles/coordinator/role.md +209 -0
- package/.codex/skills/team-interactive-craft/roles/interaction-designer/role.md +144 -0
- package/.codex/skills/team-interactive-craft/roles/researcher/role.md +131 -0
- package/.codex/skills/team-interactive-craft/specs/interaction-patterns.md +362 -0
- package/.codex/skills/team-interactive-craft/specs/pipelines.md +85 -0
- package/.codex/skills/team-interactive-craft/specs/team-config.json +105 -0
- package/.codex/skills/team-interactive-craft/specs/vanilla-constraints.md +83 -0
- package/.codex/skills/team-motion-design/SKILL.md +222 -0
- package/.codex/skills/team-motion-design/roles/animator/role.md +194 -0
- package/.codex/skills/team-motion-design/roles/choreographer/role.md +164 -0
- package/.codex/skills/team-motion-design/roles/coordinator/commands/analyze.md +64 -0
- package/.codex/skills/team-motion-design/roles/coordinator/commands/dispatch.md +168 -0
- package/.codex/skills/team-motion-design/roles/coordinator/commands/monitor.md +242 -0
- package/.codex/skills/team-motion-design/roles/coordinator/role.md +210 -0
- package/.codex/skills/team-motion-design/roles/motion-researcher/role.md +115 -0
- package/.codex/skills/team-motion-design/roles/motion-tester/role.md +175 -0
- package/.codex/skills/team-motion-design/specs/gpu-constraints.md +114 -0
- package/.codex/skills/team-motion-design/specs/motion-tokens.md +128 -0
- package/.codex/skills/team-motion-design/specs/pipelines.md +74 -0
- package/.codex/skills/team-motion-design/specs/reduced-motion.md +129 -0
- package/.codex/skills/team-motion-design/specs/team-config.json +99 -0
- package/.codex/skills/team-ui-polish/SKILL.md +218 -0
- package/.codex/skills/team-ui-polish/roles/coordinator/commands/analyze.md +77 -0
- package/.codex/skills/team-ui-polish/roles/coordinator/commands/dispatch.md +167 -0
- package/.codex/skills/team-ui-polish/roles/coordinator/commands/monitor.md +230 -0
- package/.codex/skills/team-ui-polish/roles/coordinator/role.md +213 -0
- package/.codex/skills/team-ui-polish/roles/diagnostician/role.md +164 -0
- package/.codex/skills/team-ui-polish/roles/optimizer/role.md +229 -0
- package/.codex/skills/team-ui-polish/roles/scanner/role.md +360 -0
- package/.codex/skills/team-ui-polish/roles/verifier/role.md +142 -0
- package/.codex/skills/team-ui-polish/specs/anti-patterns.md +141 -0
- package/.codex/skills/team-ui-polish/specs/design-standards.md +356 -0
- package/.codex/skills/team-ui-polish/specs/fix-strategies.md +235 -0
- package/.codex/skills/team-ui-polish/specs/pipelines.md +81 -0
- package/.codex/skills/team-ui-polish/specs/scoring-guide.md +162 -0
- package/.codex/skills/team-ui-polish/specs/team-config.json +73 -0
- package/.codex/skills/team-visual-a11y/SKILL.md +319 -0
- package/.codex/skills/team-visual-a11y/roles/color-auditor/role.md +178 -0
- package/.codex/skills/team-visual-a11y/roles/coordinator/commands/analyze.md +72 -0
- package/.codex/skills/team-visual-a11y/roles/coordinator/commands/dispatch.md +188 -0
- package/.codex/skills/team-visual-a11y/roles/coordinator/commands/monitor.md +281 -0
- package/.codex/skills/team-visual-a11y/roles/coordinator/role.md +213 -0
- package/.codex/skills/team-visual-a11y/roles/fix-implementer/role.md +246 -0
- package/.codex/skills/team-visual-a11y/roles/focus-auditor/role.md +222 -0
- package/.codex/skills/team-visual-a11y/roles/remediation-planner/role.md +206 -0
- package/.codex/skills/team-visual-a11y/roles/typo-auditor/role.md +185 -0
- package/.codex/skills/team-visual-a11y/specs/focus-patterns.md +325 -0
- package/.codex/skills/team-visual-a11y/specs/oklch-standards.md +130 -0
- package/.codex/skills/team-visual-a11y/specs/pipelines.md +98 -0
- package/.codex/skills/team-visual-a11y/specs/team-config.json +109 -0
- package/.codex/skills/team-visual-a11y/specs/typography-scale.md +165 -0
- package/.codex/skills/team-visual-a11y/specs/wcag-matrix.md +133 -0
- package/.codex/skills/workflow-plan/SKILL.md +6 -6
- package/.codex/skills/workflow-tdd-plan/SKILL.md +5 -5
- package/.codex/skills/workflow-test-fix-cycle/SKILL.md +19 -19
- package/.codex/skills/workflow-test-fix-cycle/phases/01-test-fix-gen.md +5 -5
- package/.codex/skills/workflow-test-fix-cycle/phases/02-test-cycle-execute.md +5 -5
- package/README.md +8 -0
- package/ccw/dist/core/hooks/hook-templates.d.ts.map +1 -1
- package/ccw/dist/core/hooks/hook-templates.js +114 -1
- package/ccw/dist/core/hooks/hook-templates.js.map +1 -1
- package/ccw/dist/core/routes/cli-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/cli-routes.js +34 -0
- package/ccw/dist/core/routes/cli-routes.js.map +1 -1
- package/ccw/dist/core/routes/system-routes.js +2 -2
- package/ccw/dist/core/routes/system-routes.js.map +1 -1
- package/ccw/frontend/dist/assets/{AlertDialog-Bf1jdqax.js → AlertDialog-exlTDW81.js} +3 -3
- package/ccw/frontend/dist/assets/{AlertDialog-Bf1jdqax.js.map → AlertDialog-exlTDW81.js.map} +1 -1
- package/ccw/frontend/dist/assets/{AnalysisPage-C8niKdp4.js → AnalysisPage-cgV9LfAI.js} +2 -2
- package/ccw/frontend/dist/assets/{AnalysisPage-C8niKdp4.js.map → AnalysisPage-cgV9LfAI.js.map} +1 -1
- package/ccw/frontend/dist/assets/{ApiSettingsPage-BL2c3UNS.js → ApiSettingsPage-Dk5jJdWt.js} +2 -2
- package/ccw/frontend/dist/assets/{ApiSettingsPage-BL2c3UNS.js.map → ApiSettingsPage-Dk5jJdWt.js.map} +1 -1
- package/ccw/frontend/dist/assets/{CliModeToggle-BePBFynD.js → CliModeToggle-Be9xsPiv.js} +2 -2
- package/ccw/frontend/dist/assets/{CliModeToggle-BePBFynD.js.map → CliModeToggle-Be9xsPiv.js.map} +1 -1
- package/ccw/frontend/dist/assets/{CliSessionSharePage-7cYtX6FT.js → CliSessionSharePage-Bh9jBtPI.js} +2 -2
- package/ccw/frontend/dist/assets/{CliSessionSharePage-7cYtX6FT.js.map → CliSessionSharePage-Bh9jBtPI.js.map} +1 -1
- package/ccw/frontend/dist/assets/{CliViewerPage-CBwg1mPL.js → CliViewerPage-BrE-oyEq.js} +2 -2
- package/ccw/frontend/dist/assets/{CliViewerPage-CBwg1mPL.js.map → CliViewerPage-BrE-oyEq.js.map} +1 -1
- package/ccw/frontend/dist/assets/{CodexLensPage-Bt74xORP.js → CodexLensPage-Cd3nrC93.js} +2 -2
- package/ccw/frontend/dist/assets/{CodexLensPage-Bt74xORP.js.map → CodexLensPage-Cd3nrC93.js.map} +1 -1
- package/ccw/frontend/dist/assets/{Collapsible-Wrs87QT7.js → Collapsible-DXFl3VKF.js} +2 -2
- package/ccw/frontend/dist/assets/{Collapsible-Wrs87QT7.js.map → Collapsible-DXFl3VKF.js.map} +1 -1
- package/ccw/frontend/dist/assets/{CommandsManagerPage-ChQjmPWZ.js → CommandsManagerPage-IV8zpjgX.js} +2 -2
- package/ccw/frontend/dist/assets/{CommandsManagerPage-ChQjmPWZ.js.map → CommandsManagerPage-IV8zpjgX.js.map} +1 -1
- package/ccw/frontend/dist/assets/{DeepWikiPage-dEO5wi6X.js → DeepWikiPage-CpDxtmRX.js} +2 -2
- package/ccw/frontend/dist/assets/{DeepWikiPage-dEO5wi6X.js.map → DeepWikiPage-CpDxtmRX.js.map} +1 -1
- package/ccw/frontend/dist/assets/{EndpointsPage-4zq269xY.js → EndpointsPage-BchjWe7s.js} +2 -2
- package/ccw/frontend/dist/assets/{EndpointsPage-4zq269xY.js.map → EndpointsPage-BchjWe7s.js.map} +1 -1
- package/ccw/frontend/dist/assets/{ExplorerPage-B0YTENhA.js → ExplorerPage-CbWvaJ0y.js} +2 -2
- package/ccw/frontend/dist/assets/{ExplorerPage-B0YTENhA.js.map → ExplorerPage-CbWvaJ0y.js.map} +1 -1
- package/ccw/frontend/dist/assets/{FixSessionPage-CwGs6dhz.js → FixSessionPage-YMjVRiCk.js} +2 -2
- package/ccw/frontend/dist/assets/{FixSessionPage-CwGs6dhz.js.map → FixSessionPage-YMjVRiCk.js.map} +1 -1
- package/ccw/frontend/dist/assets/{FloatingFileBrowser-COZRBslc.js → FloatingFileBrowser-JW2ehYY_.js} +2 -2
- package/ccw/frontend/dist/assets/{FloatingFileBrowser-COZRBslc.js.map → FloatingFileBrowser-JW2ehYY_.js.map} +1 -1
- package/ccw/frontend/dist/assets/{FloatingPanel-DYvgQZRD.js → FloatingPanel-BtqzqDVq.js} +2 -2
- package/ccw/frontend/dist/assets/{FloatingPanel-DYvgQZRD.js.map → FloatingPanel-BtqzqDVq.js.map} +1 -1
- package/ccw/frontend/dist/assets/{GraphExplorerPage-ewMHQGem.js → GraphExplorerPage-BsJL_W4d.js} +3 -3
- package/ccw/frontend/dist/assets/{GraphExplorerPage-ewMHQGem.js.map → GraphExplorerPage-BsJL_W4d.js.map} +1 -1
- package/ccw/frontend/dist/assets/{HistoryPage-BMeR0PrK.js → HistoryPage-BuWpQ7k5.js} +2 -2
- package/ccw/frontend/dist/assets/{HistoryPage-BMeR0PrK.js.map → HistoryPage-BuWpQ7k5.js.map} +1 -1
- package/ccw/frontend/dist/assets/{HookManagerPage-DBW2LnRm.js → HookManagerPage-D0BtMIWy.js} +2 -2
- package/ccw/frontend/dist/assets/{HookManagerPage-DBW2LnRm.js.map → HookManagerPage-D0BtMIWy.js.map} +1 -1
- package/ccw/frontend/dist/assets/{InstallationsPage--pMj0QEH.js → InstallationsPage-C7dwsAKG.js} +2 -2
- package/ccw/frontend/dist/assets/{InstallationsPage--pMj0QEH.js.map → InstallationsPage-C7dwsAKG.js.map} +1 -1
- package/ccw/frontend/dist/assets/{IssueHubPage-C_QMpQSR.js → IssueHubPage-D0nCNaeB.js} +2 -2
- package/ccw/frontend/dist/assets/{IssueHubPage-C_QMpQSR.js.map → IssueHubPage-D0nCNaeB.js.map} +1 -1
- package/ccw/frontend/dist/assets/{LiteTasksPage-CSWFdQ2-.js → LiteTasksPage-B5c2Kb9r.js} +3 -3
- package/ccw/frontend/dist/assets/{LiteTasksPage-CSWFdQ2-.js.map → LiteTasksPage-B5c2Kb9r.js.map} +1 -1
- package/ccw/frontend/dist/assets/{McpManagerPage-Dvv8NtGy.js → McpManagerPage-C-S5CehM.js} +2 -2
- package/ccw/frontend/dist/assets/{McpManagerPage-Dvv8NtGy.js.map → McpManagerPage-C-S5CehM.js.map} +1 -1
- package/ccw/frontend/dist/assets/{MemoryPage-YO8WZzZO.js → MemoryPage-P_B0JVUQ.js} +2 -2
- package/ccw/frontend/dist/assets/{MemoryPage-YO8WZzZO.js.map → MemoryPage-P_B0JVUQ.js.map} +1 -1
- package/ccw/frontend/dist/assets/{NotFoundPage-quUJw0CD.js → NotFoundPage-S4Jn9LUE.js} +2 -2
- package/ccw/frontend/dist/assets/{NotFoundPage-quUJw0CD.js.map → NotFoundPage-S4Jn9LUE.js.map} +1 -1
- package/ccw/frontend/dist/assets/{OrchestratorPage-tuThWPID.js → OrchestratorPage-C2Zlr7AC.js} +2 -2
- package/ccw/frontend/dist/assets/{OrchestratorPage-tuThWPID.js.map → OrchestratorPage-C2Zlr7AC.js.map} +1 -1
- package/ccw/frontend/dist/assets/{ProjectOverviewPage-shTilwiT.js → ProjectOverviewPage-CMVfz8s5.js} +2 -2
- package/ccw/frontend/dist/assets/{ProjectOverviewPage-shTilwiT.js.map → ProjectOverviewPage-CMVfz8s5.js.map} +1 -1
- package/ccw/frontend/dist/assets/{PromptHistoryPage-6rQnsI8l.js → PromptHistoryPage-YEMjFARX.js} +3 -3
- package/ccw/frontend/dist/assets/{PromptHistoryPage-6rQnsI8l.js.map → PromptHistoryPage-YEMjFARX.js.map} +1 -1
- package/ccw/frontend/dist/assets/{ReviewSessionPage-JOmzjVbT.js → ReviewSessionPage-DnTm55nG.js} +2 -2
- package/ccw/frontend/dist/assets/{ReviewSessionPage-JOmzjVbT.js.map → ReviewSessionPage-DnTm55nG.js.map} +1 -1
- package/ccw/frontend/dist/assets/{RulesManagerPage-Cayfywqi.js → RulesManagerPage-CUwebtO2.js} +2 -2
- package/ccw/frontend/dist/assets/{RulesManagerPage-Cayfywqi.js.map → RulesManagerPage-CUwebtO2.js.map} +1 -1
- package/ccw/frontend/dist/assets/{SessionDetailPage-iMn0k84i.js → SessionDetailPage-0qyH1Z5P.js} +2 -2
- package/ccw/frontend/dist/assets/{SessionDetailPage-iMn0k84i.js.map → SessionDetailPage-0qyH1Z5P.js.map} +1 -1
- package/ccw/frontend/dist/assets/{SessionsPage-Ciqjy9kz.js → SessionsPage-BpgP4087.js} +2 -2
- package/ccw/frontend/dist/assets/{SessionsPage-Ciqjy9kz.js.map → SessionsPage-BpgP4087.js.map} +1 -1
- package/ccw/frontend/dist/assets/SettingsPage-C3SJajeT.js +150 -0
- package/ccw/frontend/dist/assets/SettingsPage-C3SJajeT.js.map +1 -0
- package/ccw/frontend/dist/assets/SkillsManagerPage-vD9PTsmy.js +7 -0
- package/ccw/frontend/dist/assets/SkillsManagerPage-vD9PTsmy.js.map +1 -0
- package/ccw/frontend/dist/assets/{SpecsSettingsPage-BpkJctzo.js → SpecsSettingsPage-DT-yTVkD.js} +4 -4
- package/ccw/frontend/dist/assets/{SpecsSettingsPage-BpkJctzo.js.map → SpecsSettingsPage-DT-yTVkD.js.map} +1 -1
- package/ccw/frontend/dist/assets/{Switch-BpB9h__9.js → Switch-CYSPdqWk.js} +2 -2
- package/ccw/frontend/dist/assets/{Switch-BpB9h__9.js.map → Switch-CYSPdqWk.js.map} +1 -1
- package/ccw/frontend/dist/assets/{TabsNavigation-BGsKy7DO.js → TabsNavigation-CPh6Zor1.js} +2 -2
- package/ccw/frontend/dist/assets/{TabsNavigation-BGsKy7DO.js.map → TabsNavigation-CPh6Zor1.js.map} +1 -1
- package/ccw/frontend/dist/assets/{TaskDrawer-bYIlbM0Q.js → TaskDrawer-Ds-8830B.js} +2 -2
- package/ccw/frontend/dist/assets/{TaskDrawer-bYIlbM0Q.js.map → TaskDrawer-Ds-8830B.js.map} +1 -1
- package/ccw/frontend/dist/assets/{TeamPage-CihtQ6LQ.js → TeamPage-CJODUxBk.js} +2 -2
- package/ccw/frontend/dist/assets/{TeamPage-CihtQ6LQ.js.map → TeamPage-CJODUxBk.js.map} +1 -1
- package/ccw/frontend/dist/assets/{TerminalDashboardPage-BDnNF_ud.js → TerminalDashboardPage-Cn3fGUuO.js} +3 -3
- package/ccw/frontend/dist/assets/{TerminalDashboardPage-BDnNF_ud.js.map → TerminalDashboardPage-Cn3fGUuO.js.map} +1 -1
- package/ccw/frontend/dist/assets/{archive-CQJ86bQp.js → archive-CjwVpw6k.js} +2 -2
- package/ccw/frontend/dist/assets/{archive-CQJ86bQp.js.map → archive-CjwVpw6k.js.map} +1 -1
- package/ccw/frontend/dist/assets/{archive-restore-BhTfDbPU.js → archive-restore-2vZa9Ic3.js} +2 -2
- package/ccw/frontend/dist/assets/{archive-restore-BhTfDbPU.js.map → archive-restore-2vZa9Ic3.js.map} +1 -1
- package/ccw/frontend/dist/assets/{arrow-right-eUAZnT9C.js → arrow-right-CUU5XDgT.js} +2 -2
- package/ccw/frontend/dist/assets/{arrow-right-eUAZnT9C.js.map → arrow-right-CUU5XDgT.js.map} +1 -1
- package/ccw/frontend/dist/assets/{bookmark-plus-ilF5-V-k.js → bookmark-plus-Cc3nKRZ5.js} +2 -2
- package/ccw/frontend/dist/assets/{bookmark-plus-ilF5-V-k.js.map → bookmark-plus-Cc3nKRZ5.js.map} +1 -1
- package/ccw/frontend/dist/assets/{bot-BLkaQscs.js → bot-BwpSRDUa.js} +2 -2
- package/ccw/frontend/dist/assets/{bot-BLkaQscs.js.map → bot-BwpSRDUa.js.map} +1 -1
- package/ccw/frontend/dist/assets/{braces-D9HdgsO6.js → braces-DBzUW1XC.js} +2 -2
- package/ccw/frontend/dist/assets/{braces-D9HdgsO6.js.map → braces-DBzUW1XC.js.map} +1 -1
- package/ccw/frontend/dist/assets/{circle-stop-C3ZF1okQ.js → circle-stop-CGNNsjvE.js} +2 -2
- package/ccw/frontend/dist/assets/{circle-stop-C3ZF1okQ.js.map → circle-stop-CGNNsjvE.js.map} +1 -1
- package/ccw/frontend/dist/assets/{cpu-B-QjaSjm.js → cpu-D27G86Ul.js} +2 -2
- package/ccw/frontend/dist/assets/{cpu-B-QjaSjm.js.map → cpu-D27G86Ul.js.map} +1 -1
- package/ccw/frontend/dist/assets/{ellipsis-vertical-CbNlw2gS.js → ellipsis-vertical-C1Ij47Yz.js} +2 -2
- package/ccw/frontend/dist/assets/{ellipsis-vertical-CbNlw2gS.js.map → ellipsis-vertical-C1Ij47Yz.js.map} +1 -1
- package/ccw/frontend/dist/assets/{eye-yAy69Cnn.js → eye-C6MOB7Au.js} +2 -2
- package/ccw/frontend/dist/assets/{eye-yAy69Cnn.js.map → eye-C6MOB7Au.js.map} +1 -1
- package/ccw/frontend/dist/assets/{eye-off-D5uzLZyP.js → eye-off-BxfBlZ26.js} +2 -2
- package/ccw/frontend/dist/assets/{eye-off-D5uzLZyP.js.map → eye-off-BxfBlZ26.js.map} +1 -1
- package/ccw/frontend/dist/assets/{file-json-rwo1NowL.js → file-json-NI237wA-.js} +2 -2
- package/ccw/frontend/dist/assets/{file-json-rwo1NowL.js.map → file-json-NI237wA-.js.map} +1 -1
- package/ccw/frontend/dist/assets/{file-text-DRkrjie9.js → file-text-Byn2_2v6.js} +2 -2
- package/ccw/frontend/dist/assets/{file-text-DRkrjie9.js.map → file-text-Byn2_2v6.js.map} +1 -1
- package/ccw/frontend/dist/assets/{filter-BOe-OTu1.js → filter-D-7PhZjx.js} +2 -2
- package/ccw/frontend/dist/assets/{filter-BOe-OTu1.js.map → filter-D-7PhZjx.js.map} +1 -1
- package/ccw/frontend/dist/assets/{folder-BaWZWn_r.js → folder-BoAsK_FL.js} +2 -2
- package/ccw/frontend/dist/assets/{folder-BaWZWn_r.js.map → folder-BoAsK_FL.js.map} +1 -1
- package/ccw/frontend/dist/assets/{gauge-kazFexTr.js → gauge-DCSxJIS4.js} +2 -2
- package/ccw/frontend/dist/assets/{gauge-kazFexTr.js.map → gauge-DCSxJIS4.js.map} +1 -1
- package/ccw/frontend/dist/assets/{globe-BuHeEjxd.js → globe-CHS3prza.js} +2 -2
- package/ccw/frontend/dist/assets/{globe-BuHeEjxd.js.map → globe-CHS3prza.js.map} +1 -1
- package/ccw/frontend/dist/assets/{grid-3x3-DbhuUu4V.js → grid-3x3-D7K35U7S.js} +2 -2
- package/ccw/frontend/dist/assets/{grid-3x3-DbhuUu4V.js.map → grid-3x3-D7K35U7S.js.map} +1 -1
- package/ccw/frontend/dist/assets/{hard-drive-AoLGL0z4.js → hard-drive-eq9xE07G.js} +2 -2
- package/ccw/frontend/dist/assets/{hard-drive-AoLGL0z4.js.map → hard-drive-eq9xE07G.js.map} +1 -1
- package/ccw/frontend/dist/assets/{hash-Dpo1exMB.js → hash-C1DMpBua.js} +2 -2
- package/ccw/frontend/dist/assets/{hash-Dpo1exMB.js.map → hash-C1DMpBua.js.map} +1 -1
- package/ccw/frontend/dist/assets/{history-ujQnmMC9.js → history-Di5SBCY-.js} +2 -2
- package/ccw/frontend/dist/assets/{history-ujQnmMC9.js.map → history-Di5SBCY-.js.map} +1 -1
- package/ccw/frontend/dist/assets/{index-C_Yf5fZ4.js → index--_R7COnA.js} +2 -2
- package/ccw/frontend/dist/assets/{index-C_Yf5fZ4.js.map → index--_R7COnA.js.map} +1 -1
- package/ccw/frontend/dist/assets/{index-Dff4bg3u.js → index-BUol9HDD.js} +3 -3
- package/ccw/frontend/dist/assets/{index-Dff4bg3u.js.map → index-BUol9HDD.js.map} +1 -1
- package/ccw/frontend/dist/assets/{index-B76AGix5.js → index-CT9oykfw.js} +2 -2
- package/ccw/frontend/dist/assets/{index-B76AGix5.js.map → index-CT9oykfw.js.map} +1 -1
- package/ccw/frontend/dist/assets/{index-CxzXz6o1.js → index-Ddwvf87H.js} +2 -2
- package/ccw/frontend/dist/assets/{index-CxzXz6o1.js.map → index-Ddwvf87H.js.map} +1 -1
- package/ccw/frontend/dist/assets/{layout-grid-CBdE4K8h.js → layout-grid-LiX0qZbN.js} +2 -2
- package/ccw/frontend/dist/assets/{layout-grid-CBdE4K8h.js.map → layout-grid-LiX0qZbN.js.map} +1 -1
- package/ccw/frontend/dist/assets/{lightbulb-B9K6ZgRp.js → lightbulb-CL3DVEwb.js} +2 -2
- package/ccw/frontend/dist/assets/{lightbulb-B9K6ZgRp.js.map → lightbulb-CL3DVEwb.js.map} +1 -1
- package/ccw/frontend/dist/assets/{link-2-Oea4xHJl.js → link-2-CC5cFeq6.js} +2 -2
- package/ccw/frontend/dist/assets/{link-2-Oea4xHJl.js.map → link-2-CC5cFeq6.js.map} +1 -1
- package/ccw/frontend/dist/assets/{link-5yXdZBch.js → link-ngFQ9bs0.js} +2 -2
- package/ccw/frontend/dist/assets/{link-5yXdZBch.js.map → link-ngFQ9bs0.js.map} +1 -1
- package/ccw/frontend/dist/assets/{list-9lHhC_U_.js → list-BEU6I0KK.js} +2 -2
- package/ccw/frontend/dist/assets/{list-9lHhC_U_.js.map → list-BEU6I0KK.js.map} +1 -1
- package/ccw/frontend/dist/assets/{map-pin-B6Io5kmB.js → map-pin-BWZdLA6y.js} +2 -2
- package/ccw/frontend/dist/assets/{map-pin-B6Io5kmB.js.map → map-pin-BWZdLA6y.js.map} +1 -1
- package/ccw/frontend/dist/assets/{messages-square-BT000aD3.js → messages-square-K6_Chm7n.js} +2 -2
- package/ccw/frontend/dist/assets/{messages-square-BT000aD3.js.map → messages-square-K6_Chm7n.js.map} +1 -1
- package/ccw/frontend/dist/assets/{minimize-2-DO-zbT3a.js → minimize-2-CWkphauf.js} +2 -2
- package/ccw/frontend/dist/assets/{minimize-2-DO-zbT3a.js.map → minimize-2-CWkphauf.js.map} +1 -1
- package/ccw/frontend/dist/assets/{package-BjOw1ldU.js → package-DrNgkamn.js} +2 -2
- package/ccw/frontend/dist/assets/{package-BjOw1ldU.js.map → package-DrNgkamn.js.map} +1 -1
- package/ccw/frontend/dist/assets/{plug-9dAARpE1.js → plug-CMo3sw5_.js} +2 -2
- package/ccw/frontend/dist/assets/{plug-9dAARpE1.js.map → plug-CMo3sw5_.js.map} +1 -1
- package/ccw/frontend/dist/assets/{power-K2S39x7f.js → power-DppNTW5e.js} +2 -2
- package/ccw/frontend/dist/assets/{power-K2S39x7f.js.map → power-DppNTW5e.js.map} +1 -1
- package/ccw/frontend/dist/assets/{save-D9-CoT3x.js → save-CD8aPMbZ.js} +2 -2
- package/ccw/frontend/dist/assets/{save-D9-CoT3x.js.map → save-CD8aPMbZ.js.map} +1 -1
- package/ccw/frontend/dist/assets/{send-Bunw9NtC.js → send-B4z90fQD.js} +2 -2
- package/ccw/frontend/dist/assets/{send-Bunw9NtC.js.map → send-B4z90fQD.js.map} +1 -1
- package/ccw/frontend/dist/assets/{settings-2-osl4EXFf.js → settings-2-CAKRU_QC.js} +2 -2
- package/ccw/frontend/dist/assets/{settings-2-osl4EXFf.js.map → settings-2-CAKRU_QC.js.map} +1 -1
- package/ccw/frontend/dist/assets/{square-check-big-Dl5gYkjR.js → square-check-big-KhI3HrzX.js} +2 -2
- package/ccw/frontend/dist/assets/{square-check-big-Dl5gYkjR.js.map → square-check-big-KhI3HrzX.js.map} +1 -1
- package/ccw/frontend/dist/assets/{square-pen-Bue1chJR.js → square-pen-BtdGIpuq.js} +2 -2
- package/ccw/frontend/dist/assets/{square-pen-Bue1chJR.js.map → square-pen-BtdGIpuq.js.map} +1 -1
- package/ccw/frontend/dist/assets/{star-Bk7EC7FB.js → star-ZoBUkXoD.js} +2 -2
- package/ccw/frontend/dist/assets/{star-Bk7EC7FB.js.map → star-ZoBUkXoD.js.map} +1 -1
- package/ccw/frontend/dist/assets/{style-BbREPmRj.js → style-CltxQP-P.js} +2 -2
- package/ccw/frontend/dist/assets/{style-BbREPmRj.js.map → style-CltxQP-P.js.map} +1 -1
- package/ccw/frontend/dist/assets/{target-CElrCVhR.js → target-C32OUSGf.js} +2 -2
- package/ccw/frontend/dist/assets/{target-CElrCVhR.js.map → target-C32OUSGf.js.map} +1 -1
- package/ccw/frontend/dist/assets/{test-tube-wciJaoas.js → test-tube-0IxoyAVZ.js} +2 -2
- package/ccw/frontend/dist/assets/{test-tube-wciJaoas.js.map → test-tube-0IxoyAVZ.js.map} +1 -1
- package/ccw/frontend/dist/assets/{upload-BD1F07wG.js → upload-4eKCkyBn.js} +2 -2
- package/ccw/frontend/dist/assets/{upload-BD1F07wG.js.map → upload-4eKCkyBn.js.map} +1 -1
- package/ccw/frontend/dist/assets/{useApiSettings-D23HVEt8.js → useApiSettings-zLTUWqhi.js} +2 -2
- package/ccw/frontend/dist/assets/{useApiSettings-D23HVEt8.js.map → useApiSettings-zLTUWqhi.js.map} +1 -1
- package/ccw/frontend/dist/assets/{useCli-BGDd_lXD.js → useCli-BtN2vpOX.js} +2 -2
- package/ccw/frontend/dist/assets/{useCli-BGDd_lXD.js.map → useCli-BtN2vpOX.js.map} +1 -1
- package/ccw/frontend/dist/assets/{useCommands-B-m_HxPB.js → useCommands-_spj49qL.js} +2 -2
- package/ccw/frontend/dist/assets/{useCommands-B-m_HxPB.js.map → useCommands-_spj49qL.js.map} +1 -1
- package/ccw/frontend/dist/assets/{useDebounce-Z18-PHZr.js → useDebounce-Bm9KFZvd.js} +2 -2
- package/ccw/frontend/dist/assets/{useDebounce-Z18-PHZr.js.map → useDebounce-Bm9KFZvd.js.map} +1 -1
- package/ccw/frontend/dist/assets/{useFileExplorer-D4gPp-LB.js → useFileExplorer-DOmpm6v9.js} +2 -2
- package/ccw/frontend/dist/assets/{useFileExplorer-D4gPp-LB.js.map → useFileExplorer-DOmpm6v9.js.map} +1 -1
- package/ccw/frontend/dist/assets/{useLocale-DJ62jjFa.js → useLocale-D2rj4rea.js} +2 -2
- package/ccw/frontend/dist/assets/{useLocale-DJ62jjFa.js.map → useLocale-D2rj4rea.js.map} +1 -1
- package/ccw/frontend/dist/assets/{useSkills-B8NPs9__.js → useSkills-OskEpomF.js} +3 -3
- package/ccw/frontend/dist/assets/{useSkills-B8NPs9__.js.map → useSkills-OskEpomF.js.map} +1 -1
- package/ccw/frontend/dist/assets/{useSystemSettings-CVi7nKGJ.js → useSystemSettings-BjMgsNSF.js} +2 -2
- package/ccw/frontend/dist/assets/{useSystemSettings-CVi7nKGJ.js.map → useSystemSettings-BjMgsNSF.js.map} +1 -1
- package/ccw/frontend/dist/assets/{wand-sparkles-CLjPiU5w.js → wand-sparkles-CLhyYWa7.js} +2 -2
- package/ccw/frontend/dist/assets/{wand-sparkles-CLjPiU5w.js.map → wand-sparkles-CLhyYWa7.js.map} +1 -1
- package/ccw/frontend/dist/index.html +1 -1
- package/package.json +105 -105
- package/ccw/frontend/dist/assets/SettingsPage-BPDbXPSM.js +0 -150
- package/ccw/frontend/dist/assets/SettingsPage-BPDbXPSM.js.map +0 -1
- package/ccw/frontend/dist/assets/SkillsManagerPage-D3LzbpJY.js +0 -7
- package/ccw/frontend/dist/assets/SkillsManagerPage-D3LzbpJY.js.map +0 -1
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Dff4bg3u.js","assets/index-BoqylFO4.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{O as ge,r as i,ab as As,u as J,co as Re,j as e,al as Os,cp as Rs,cq as Se,cr as Ke,cs as Hs,ct as oe,cu as Bs,cv as $s,cw as zs,cx as _s,aq as Vs,ar as qs,as as Je,c as $,at as Ws,au as Gs,C as Y,B as Q,bq as ie,e as j,X as ae,cy as He,ap as Ee,cz as Ks,cA as Js,cB as Be,aV as ts,cC as Xs,I as P,_ as B,R as ue,a7 as Ne,cD as Ys,bu as Xe,U as Qs,l as Zs,cE as et,cF as st,cG as $e,ao as tt,cH as at,bf as Ie,cI as Te,cJ as nt,cK as rt,cL as it,S as lt,cM as ot,cN as Ye,aw as ze,cO as ct,aP as dt,an as mt,cP as ut,i as xt,F as ht,N as gt,aU as ft,bX as pt}from"./index-Dff4bg3u.js";import{A as bt,a as jt,b as Nt,c as vt,d as yt,e as wt,f as kt,g as Ct}from"./AlertDialog-Bf1jdqax.js";import{u as St,a as Tt,b as Mt,c as Et,d as Ft,e as Pt,f as Dt,g as Ut,h as Lt,i as It,j as At,k as Ot,l as Rt}from"./useSystemSettings-CVi7nKGJ.js";import{u as Ht}from"./useLocale-DJ62jjFa.js";import{T as Bt}from"./test-tube-wciJaoas.js";import{L as $t}from"./link-5yXdZBch.js";import{S as zt}from"./send-Bunw9NtC.js";import{E as fe}from"./eye-off-D5uzLZyP.js";import{E as pe}from"./eye-yAy69Cnn.js";import{S as Fe}from"./save-D9-CoT3x.js";import{B as _t}from"./bot-BLkaQscs.js";import{S as as}from"./settings-2-osl4EXFf.js";import{u as Vt}from"./useDebounce-Z18-PHZr.js";import{C as ns}from"./cpu-B-QjaSjm.js";import{U as qt}from"./upload-BD1F07wG.js";import{P as Wt}from"./package-BjOw1ldU.js";import{F as Gt}from"./folder-BaWZWn_r.js";/**
|
|
3
|
-
* @license lucide-react v0.460.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the ISC license.
|
|
6
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/const Kt=ge("BellOff",[["path",{d:"M8.7 3A6 6 0 0 1 18 8a21.3 21.3 0 0 0 .6 5",key:"o7mx20"}],["path",{d:"M17 17H3s3-2 3-9a4.67 4.67 0 0 1 .3-1.7",key:"16f1lm"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
8
|
-
* @license lucide-react v0.460.0 - ISC
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the ISC license.
|
|
11
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/const rs=ge("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
|
|
13
|
-
* @license lucide-react v0.460.0 - ISC
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the ISC license.
|
|
16
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/const is=ge("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/**
|
|
18
|
-
* @license lucide-react v0.460.0 - ISC
|
|
19
|
-
*
|
|
20
|
-
* This source code is licensed under the ISC license.
|
|
21
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
22
|
-
*/const Jt=ge("LayoutPanelLeft",[["rect",{width:"7",height:"18",x:"3",y:"3",rx:"1",key:"2obqm"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}]]);/**
|
|
23
|
-
* @license lucide-react v0.460.0 - ISC
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the ISC license.
|
|
26
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/const Xt=ge("MessageSquareText",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);/**
|
|
28
|
-
* @license lucide-react v0.460.0 - ISC
|
|
29
|
-
*
|
|
30
|
-
* This source code is licensed under the ISC license.
|
|
31
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/const Yt=ge("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);function ls(){const s=document.cookie.match(/XSRF-TOKEN=([^;]+)/);return s?decodeURIComponent(s[1]):null}async function Qt(s,t=1,n=20){const r=new URLSearchParams({query:s,page:String(t),per_page:String(n)}),c=await fetch(`/api/unsplash/search?${r}`,{credentials:"same-origin"});if(!c.ok){const d=await c.json().catch(()=>({}));throw new Error(d.error||`Unsplash search failed: ${c.status}`)}return c.json()}async function Zt(s){const t={"Content-Type":s.type,"X-Filename":encodeURIComponent(s.name)},n=ls();n&&(t["X-CSRF-Token"]=n);const r=await fetch("/api/background/upload",{method:"POST",headers:t,credentials:"same-origin",body:s});if(!r.ok){const c=await r.json().catch(()=>({}));throw new Error(c.error||`Upload failed: ${r.status}`)}return r.json()}async function ea(s){const t={"Content-Type":"application/json"},n=ls();n&&(t["X-CSRF-Token"]=n),await fetch("/api/unsplash/download",{method:"POST",headers:t,credentials:"same-origin",body:JSON.stringify({downloadLocation:s})})}function sa(s,t=1,n=20){const[r,c]=i.useState(s);return i.useEffect(()=>{const d=setTimeout(()=>{c(s)},500);return()=>clearTimeout(d)},[s]),As({queryKey:["unsplash-search",r,t,n],queryFn:()=>Qt(r,t,n),enabled:r.trim().length>0,staleTime:300*1e3,retry:1})}const ta=[{value:"gradient-only",labelId:"theme.background.mode.gradientOnly"},{value:"image-only",labelId:"theme.background.mode.imageOnly"},{value:"image-gradient",labelId:"theme.background.mode.imageGradient"}];function aa(){const{formatMessage:s}=J(),{backgroundConfig:t,setBackgroundMode:n,setBackgroundImage:r,updateBackgroundEffect:c}=Re(),[d,x]=i.useState(""),[p,N]=i.useState(1),[f,E]=i.useState(""),[w,F]=i.useState(!1),[u,v]=i.useState(null),k=i.useRef(null),{data:h,isLoading:H,isError:C,error:M}=sa(d,p),O=t.mode!=="gradient-only",W=i.useCallback(async l=>{r(l.regularUrl,{photographerName:l.photographer,photographerUrl:l.photographerUrl,photoUrl:l.photoUrl}),ea(l.downloadLocation).catch(()=>{})},[r]),A=i.useCallback(()=>{f.trim()&&(r(f.trim(),null),E(""))},[f,r]),b=i.useCallback(()=>{r(null,null)},[r]),y=i.useCallback(async l=>{var m;const g=(m=l.target.files)==null?void 0:m[0];if(g){if(l.target.value="",v(null),g.size>10*1024*1024){v(s({id:"theme.background.fileTooLarge"}));return}if(!g.type.startsWith("image/")||!["image/jpeg","image/png","image/webp","image/gif"].includes(g.type)){v(s({id:"theme.background.invalidType"}));return}F(!0);try{const D=await Zt(g);r(D.url,null)}catch(D){v(D.message||s({id:"theme.background.uploadError"}))}finally{F(!1)}}},[s,r]);return e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-medium text-text",children:s({id:"theme.background.title"})}),e.jsx("div",{className:"flex gap-2",role:"radiogroup","aria-label":s({id:"theme.background.title"}),children:ta.map(({value:l,labelId:g})=>e.jsx("button",{onClick:()=>n(l),role:"radio","aria-checked":t.mode===l,className:`
|
|
33
|
-
flex-1 px-3 py-2 rounded-lg text-xs font-medium
|
|
34
|
-
transition-all duration-200 border-2
|
|
35
|
-
${t.mode===l?"border-accent bg-surface shadow-md":"border-border bg-bg hover:bg-surface"}
|
|
36
|
-
focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2
|
|
37
|
-
`,children:s({id:g})},l))}),O&&e.jsxs("div",{className:"space-y-3",children:[t.imageUrl&&e.jsxs("div",{className:"relative rounded-lg overflow-hidden border border-border",children:[e.jsx("img",{src:t.imageUrl,alt:"Current background",className:"w-full h-32 object-cover"}),e.jsx("button",{onClick:b,className:"absolute top-2 right-2 px-2 py-1 text-xs bg-black/60 text-white rounded hover:bg-black/80 transition-colors",children:s({id:"theme.background.removeImage"})}),t.attribution&&e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 px-2 py-1 bg-black/50 text-white text-xs",children:["Photo by"," ",e.jsx("a",{href:`${t.attribution.photographerUrl}?utm_source=ccw&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"underline",children:t.attribution.photographerName})," ","on"," ",e.jsx("a",{href:"https://unsplash.com/?utm_source=ccw&utm_medium=referral",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Unsplash"})]})]}),e.jsx("input",{type:"text",value:d,onChange:l=>{x(l.target.value),N(1)},placeholder:s({id:"theme.background.searchPlaceholder"}),className:`w-full px-3 py-2 text-sm rounded-lg border border-border bg-bg text-text
|
|
38
|
-
focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1`}),H&&e.jsx("div",{className:"flex justify-center py-4",children:e.jsx("div",{className:"w-5 h-5 border-2 border-border border-t-accent rounded-full animate-spin"})}),C&&e.jsx("p",{className:"text-xs text-destructive py-2",children:(M==null?void 0:M.message)||s({id:"theme.background.searchError"})}),h&&h.photos.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-3 gap-2 max-h-60 overflow-y-auto",children:h.photos.map(l=>e.jsx("button",{onClick:()=>W(l),className:`
|
|
39
|
-
relative rounded overflow-hidden border-2 transition-all
|
|
40
|
-
hover:border-accent focus:outline-none focus:ring-2 focus:ring-accent
|
|
41
|
-
${t.imageUrl===l.regularUrl?"border-accent ring-2 ring-accent":"border-transparent"}
|
|
42
|
-
`,children:e.jsx("img",{src:l.thumbUrl,alt:`Photo by ${l.photographer}`,className:"w-full h-20 object-cover",loading:"lazy"})},l.id))}),h.totalPages>1&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("button",{onClick:()=>N(l=>Math.max(1,l-1)),disabled:p<=1,className:"px-2 py-1 text-xs rounded border border-border disabled:opacity-50 hover:bg-surface",children:s({id:"theme.background.prev"})}),e.jsxs("span",{className:"text-xs text-text-secondary",children:[p," / ",h.totalPages]}),e.jsx("button",{onClick:()=>N(l=>Math.min(h.totalPages,l+1)),disabled:p>=h.totalPages,className:"px-2 py-1 text-xs rounded border border-border disabled:opacity-50 hover:bg-surface",children:s({id:"theme.background.next"})})]})]}),h&&h.photos.length===0&&d.trim()&&e.jsx("p",{className:"text-xs text-text-secondary py-2 text-center",children:s({id:"theme.background.noResults"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"url",value:f,onChange:l=>E(l.target.value),placeholder:s({id:"theme.background.customUrlPlaceholder"}),className:`flex-1 px-3 py-2 text-xs rounded-lg border border-border bg-bg text-text
|
|
43
|
-
focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1`}),e.jsx("button",{onClick:A,disabled:!f.trim(),className:"px-3 py-2 text-xs rounded-lg bg-accent text-white disabled:opacity-50 hover:opacity-90 transition-opacity",children:s({id:"theme.background.apply"})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("input",{ref:k,type:"file",accept:"image/jpeg,image/png,image/webp,image/gif",onChange:y,className:"hidden"}),e.jsx("button",{onClick:()=>{var l;return(l=k.current)==null?void 0:l.click()},disabled:w,className:`w-full px-3 py-2 text-xs rounded-lg border border-dashed border-border
|
|
44
|
-
bg-bg text-text hover:bg-surface hover:border-accent
|
|
45
|
-
disabled:opacity-50 transition-all flex items-center justify-center gap-2`,children:w?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-3.5 h-3.5 border-2 border-border border-t-accent rounded-full animate-spin"}),s({id:"theme.background.uploading"})]}):s({id:"theme.background.upload"})}),u&&e.jsx("p",{className:"text-xs text-destructive",children:u})]})]}),O&&e.jsxs("div",{className:"space-y-3 pt-2 border-t border-border",children:[e.jsx("h4",{className:"text-xs font-medium text-text-secondary",children:s({id:"theme.background.effects"})}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("label",{className:"text-xs text-text",children:s({id:"theme.background.blur"})}),e.jsxs("span",{className:"text-xs text-text-secondary",children:[t.effects.blur,"px"]})]}),e.jsx("input",{type:"range",min:"0",max:"20",step:"1",value:t.effects.blur,onChange:l=>c("blur",Number(l.target.value)),className:"w-full accent-[hsl(var(--accent))]"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("label",{className:"text-xs text-text",children:s({id:"theme.background.darken"})}),e.jsxs("span",{className:"text-xs text-text-secondary",children:[t.effects.darkenOpacity,"%"]})]}),e.jsx("input",{type:"range",min:"0",max:"80",step:"1",value:t.effects.darkenOpacity,onChange:l=>c("darkenOpacity",Number(l.target.value)),className:"w-full accent-[hsl(var(--accent))]"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("label",{className:"text-xs text-text",children:s({id:"theme.background.saturation"})}),e.jsxs("span",{className:"text-xs text-text-secondary",children:[t.effects.saturation,"%"]})]}),e.jsx("input",{type:"range",min:"0",max:"200",step:"5",value:t.effects.saturation,onChange:l=>c("saturation",Number(l.target.value)),className:"w-full accent-[hsl(var(--accent))]"})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:t.effects.enableFrostedGlass,onChange:l=>c("enableFrostedGlass",l.target.checked),className:"w-4 h-4 rounded border-border text-accent focus:ring-2 focus:ring-accent focus:ring-offset-2"}),e.jsx("span",{className:"text-sm text-text",children:s({id:"theme.background.frostedGlass"})})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:t.effects.enableGrain,onChange:l=>c("enableGrain",l.target.checked),className:"w-4 h-4 rounded border-border text-accent focus:ring-2 focus:ring-accent focus:ring-offset-2"}),e.jsx("span",{className:"text-sm text-text",children:s({id:"theme.background.grain"})})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:t.effects.enableVignette,onChange:l=>c("enableVignette",l.target.checked),className:"w-4 h-4 rounded border-border text-accent focus:ring-2 focus:ring-accent focus:ring-offset-2"}),e.jsx("span",{className:"text-sm text-text",children:s({id:"theme.background.vignette"})})]})]})]})}function na(){const{formatMessage:s}=J(),{colorScheme:t,resolvedTheme:n,customHue:r,isCustomTheme:c,gradientLevel:d,enableHoverGlow:x,enableBackgroundAnimation:p,motionPreference:N,setColorScheme:f,setTheme:E,setCustomHue:w,setGradientLevel:F,setEnableHoverGlow:u,setEnableBackgroundAnimation:v,setMotionPreference:k,styleTier:h,setStyleTier:H,themeSlots:C,activeSlotId:M,canAddSlot:O,setActiveSlot:W,copySlot:A,renameSlot:b,deleteSlot:y,undoDeleteSlot:l,exportThemeCode:g,importThemeCode:m,setBackgroundConfig:D}=Re(),{addToast:_,removeToast:G}=Os(),[q,Z]=i.useState(r),[ce,se]=i.useState([]),[de,me]=i.useState({}),[X,ne]=i.useState(!1),[te,a]=i.useState(null),[S,I]=i.useState(""),[U,K]=i.useState(null),re=i.useRef(null),xe=i.useRef(null),[Pe,_e]=i.useState(!1),[gs,De]=i.useState(""),[L,ve]=i.useState(null),[fs,ye]=i.useState(null),[we,ke]=i.useState(null),[ps,Ve]=i.useState(!1);i.useEffect(()=>{Z(r)},[r]);const le=n,be=o=>{const T=Se(q??180,le)[o];return T?`hsl(${T})`:"#888"},bs=[{id:"soft",nameKey:"theme.styleTier.soft",descKey:"theme.styleTier.softDesc"},{id:"standard",nameKey:"theme.styleTier.standard",descKey:"theme.styleTier.standardDesc"},{id:"high-contrast",nameKey:"theme.styleTier.highContrast",descKey:"theme.styleTier.highContrastDesc"}],js=o=>{const z=Se(r??220,le),T=o==="standard"?z:Ke(z,o,le);return{bg:T["--bg"]?`hsl(${T["--bg"]})`:"#888",surface:T["--surface"]?`hsl(${T["--surface"]})`:"#888",accent:T["--accent"]?`hsl(${T["--accent"]})`:"#888"}},Ue=o=>{c&&w(null),f(o)},Ns=()=>{r===null&&w(180)},vs=()=>{if(q!==null){w(q);const R=Se(q,n),T=zs(R).filter(he=>!he.passed);if(T.length>0){se(T);const he={};for(const je of T){const Is=`${je.fgVar}|${je.bgVar}`;he[Is]=_s(je.fgVar,je.bgVar,R,je.required)}me(he),ne(!0)}else se([]),me({}),ne(!1)}},ys=()=>{w(null),Z(null)},ws=o=>{E(o)},ks=o=>{if(o.key==="ArrowRight"||o.key==="ArrowDown"){o.preventDefault();const z=(oe.findIndex(T=>T.id===t)+1)%oe.length;Ue(oe[z].id)}else if(o.key==="ArrowLeft"||o.key==="ArrowUp"){o.preventDefault();const z=(oe.findIndex(T=>T.id===t)-1+oe.length)%oe.length;Ue(oe[z].id)}},Cs=i.useCallback(o=>{o!==M&&W(o)},[M,W]),Ss=i.useCallback(()=>{O&&A()},[O,A]),qe=i.useCallback((o,R)=>{a(o),I(R),setTimeout(()=>{var z;return(z=re.current)==null?void 0:z.focus()},0)},[]),Le=i.useCallback(()=>{te&&S.trim()&&b(te,S.trim()),a(null),I("")},[te,S,b]),We=i.useCallback(()=>{a(null),I("")},[]),Ts=i.useCallback(o=>{o.key==="Enter"?(o.preventDefault(),Le()):o.key==="Escape"&&(o.preventDefault(),We())},[Le,We]),Ms=i.useCallback(()=>{if(!U)return;y(U),K(null),xe.current&&G(xe.current);const o=_("info",s({id:"theme.slot.undoDelete"}),void 0,{duration:1e4,dismissible:!0,action:{label:s({id:"theme.slot.undo"}),onClick:()=>{l(),G(o),xe.current=null}}});xe.current=o},[U,y,_,G,l,s]),Ge=i.useCallback(()=>{K(null)},[]),Es=i.useCallback(async()=>{try{const o=g();await navigator.clipboard.writeText(o),Ve(!0),setTimeout(()=>Ve(!1),2e3)}catch{_("error","Failed to copy to clipboard")}},[g,_]),Fs=i.useCallback(()=>{_e(!0),De(""),ve(null),ye(null),ke(null)},[]),Ce=i.useCallback(()=>{_e(!1),De(""),ve(null),ye(null),ke(null)},[]),Ps=i.useCallback(o=>{if(De(o),ke(null),ye(null),ve(null),!o.trim())return;const R=m(o);R.ok?(ve(R.payload),R.warning&&ye(R.warning)):ke(R.error)},[m]),Ds=i.useCallback(()=>{L&&(!O&&M==="default"?(L.customHue!==null?w(L.customHue):(w(null),f(L.colorScheme)),F(L.gradientLevel),u(L.enableHoverGlow),v(L.enableBackgroundAnimation),H(L.styleTier)):O?(A(),L.customHue!==null?w(L.customHue):(w(null),f(L.colorScheme)),F(L.gradientLevel),u(L.enableHoverGlow),v(L.enableBackgroundAnimation),H(L.styleTier)):(L.customHue!==null?w(L.customHue):(w(null),f(L.colorScheme)),F(L.gradientLevel),u(L.enableHoverGlow),v(L.enableBackgroundAnimation),H(L.styleTier)),D(L.backgroundConfig??Rs),_("success",s({id:"theme.share.importSuccess"})),Ce())},[L,O,M,A,w,f,F,u,v,H,D,_,s,Ce]),Us=i.useCallback(o=>{const R=o.customHue??220,z=Se(R,le),T=o.styleTier==="standard"?z:Ke(z,o.styleTier,le);return{bg:T["--bg"]?`hsl(${T["--bg"]})`:"#888",surface:T["--surface"]?`hsl(${T["--surface"]})`:"#888",accent:T["--accent"]?`hsl(${T["--accent"]})`:"#888",text:T["--text"]?`hsl(${T["--text"]})`:"#888"}},[le]),Ls=o=>{switch(o){case"incompatible_version":return"theme.share.incompatibleVersion";default:return"theme.share.invalidCode"}};return i.useEffect(()=>{te&&re.current&&(re.current.focus(),re.current.select())},[te]),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h3",{className:"text-sm font-medium text-text",children:s({id:"theme.slot.title"})}),e.jsxs("button",{onClick:Ss,disabled:!O,title:O?s({id:"theme.slot.copy"}):s({id:"theme.slot.limitReached"},{limit:Hs}),className:`
|
|
46
|
-
px-2 py-1 rounded text-xs font-medium
|
|
47
|
-
transition-all duration-200
|
|
48
|
-
${O?"bg-accent text-white hover:bg-accent-hover focus:ring-2 focus:ring-accent focus:ring-offset-1":"bg-muted text-muted-text cursor-not-allowed"}
|
|
49
|
-
focus:outline-none
|
|
50
|
-
`,children:["+ ",s({id:"theme.slot.copy"})]})]}),e.jsx("div",{className:"flex gap-2",role:"tablist","aria-label":s({id:"theme.slot.title"}),children:C.map(o=>{const R=o.id===M,z=o.id===te;return e.jsxs("div",{role:"tab","aria-selected":R,tabIndex:R?0:-1,onClick:()=>Cs(o.id),className:`
|
|
51
|
-
relative flex-1 min-w-0 p-2.5 rounded-lg cursor-pointer
|
|
52
|
-
transition-all duration-200 border-2 group
|
|
53
|
-
${R?"border-accent bg-surface shadow-md":"border-border bg-bg hover:bg-surface"}
|
|
54
|
-
focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1
|
|
55
|
-
`,children:[R&&e.jsx("span",{className:"absolute -top-1 -right-1 w-2.5 h-2.5 rounded-full bg-accent border-2 border-bg"}),e.jsx("div",{className:"flex items-center gap-1 min-w-0",children:z?e.jsx("input",{ref:re,type:"text",value:S,onChange:T=>I(T.target.value),onKeyDown:Ts,onBlur:Le,onClick:T=>T.stopPropagation(),className:`\r
|
|
56
|
-
w-full px-1 py-0.5 text-xs font-medium text-text\r
|
|
57
|
-
bg-bg border border-accent rounded\r
|
|
58
|
-
focus:outline-none focus:ring-1 focus:ring-accent\r
|
|
59
|
-
`,maxLength:20}):e.jsx("span",{className:"text-xs font-medium text-text truncate",title:o.name,onDoubleClick:T=>{T.stopPropagation(),o.isDefault||qe(o.id,o.name)},children:o.name})}),R&&!z&&e.jsx("span",{className:"text-[10px] text-accent font-medium mt-0.5 block",children:s({id:"theme.slot.active"})}),!o.isDefault&&!z&&e.jsxs("div",{className:`\r
|
|
60
|
-
absolute top-1 right-1 flex gap-0.5\r
|
|
61
|
-
opacity-0 group-hover:opacity-100 transition-opacity duration-150\r
|
|
62
|
-
`,children:[e.jsx("button",{onClick:T=>{T.stopPropagation(),qe(o.id,o.name)},title:s({id:"theme.slot.rename"}),className:`\r
|
|
63
|
-
p-0.5 rounded text-text-tertiary hover:text-text hover:bg-surface-hover\r
|
|
64
|
-
transition-colors duration-150 focus:outline-none\r
|
|
65
|
-
`,children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M11.5 1.5L14.5 4.5L5 14H2V11L11.5 1.5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("button",{onClick:T=>{T.stopPropagation(),K(o.id)},title:s({id:"theme.slot.delete"}),className:`\r
|
|
66
|
-
p-0.5 rounded text-text-tertiary hover:text-error hover:bg-error-light\r
|
|
67
|
-
transition-colors duration-150 focus:outline-none\r
|
|
68
|
-
`,children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),o.isDefault&&e.jsx("div",{className:`\r
|
|
69
|
-
absolute top-1 right-1 flex gap-0.5\r
|
|
70
|
-
opacity-0 group-hover:opacity-100 transition-opacity duration-150\r
|
|
71
|
-
`,children:e.jsx("button",{disabled:!0,title:s({id:"theme.slot.cannotDeleteDefault"}),className:"p-0.5 rounded text-muted-text cursor-not-allowed",children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})})]},o.id)})})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-3",children:s({id:"theme.title.colorScheme"})}),e.jsxs("div",{className:"grid grid-cols-5 gap-3",role:"group","aria-label":"Color scheme selection",onKeyDown:ks,children:[oe.map(o=>e.jsxs("button",{onClick:()=>Ue(o.id),"aria-label":s({id:"theme.select.colorScheme"},{name:s({id:`theme.colorScheme.${o.id}`})}),"aria-selected":t===o.id&&!c,role:"radio",className:`
|
|
72
|
-
flex flex-col items-center gap-2 p-3 rounded-lg
|
|
73
|
-
transition-all duration-200 border-2
|
|
74
|
-
${t===o.id&&!c?"border-accent bg-surface shadow-md":"border-border bg-bg hover:bg-surface"}
|
|
75
|
-
focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2
|
|
76
|
-
`,children:[e.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-border shadow-sm",style:{backgroundColor:o.accentColor},"aria-hidden":"true"}),e.jsx("span",{className:"text-xs font-medium text-text text-center",children:s({id:`theme.colorScheme.${o.id}`})})]},o.id)),e.jsxs("button",{onClick:Ns,"aria-label":s({id:"theme.select.colorScheme"},{name:s({id:"theme.colorScheme.custom"})}),"aria-selected":c,role:"radio",className:`
|
|
77
|
-
flex flex-col items-center gap-2 p-3 rounded-lg
|
|
78
|
-
transition-all duration-200 border-2
|
|
79
|
-
${c?"border-accent bg-surface shadow-md":"border-border bg-bg hover:bg-surface"}
|
|
80
|
-
focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2
|
|
81
|
-
`,children:[e.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-border shadow-sm",style:{background:`linear-gradient(135deg, ${be("--accent")}, ${be("--primary")})`},"aria-hidden":"true"}),e.jsx("span",{className:"text-xs font-medium text-text text-center",children:s({id:"theme.colorScheme.custom"})})]})]})]}),c&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-3",children:s({id:"theme.title.customHue"})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("label",{htmlFor:"hue-slider",className:"text-xs text-text-secondary",children:s({id:"theme.hueValue"},{value:q??180})})}),e.jsx("input",{id:"hue-slider",type:"range",min:"0",max:"360",step:"1",value:q??180,onChange:o=>Z(Number(o.target.value)),className:"w-full h-2 rounded-lg appearance-none cursor-pointer",style:{background:`linear-gradient(to right,
|
|
82
|
-
hsl(0, 70%, 60%), hsl(60, 70%, 60%), hsl(120, 70%, 60%),
|
|
83
|
-
hsl(180, 70%, 60%), hsl(240, 70%, 60%), hsl(300, 70%, 60%), hsl(360, 70%, 60%))`},"aria-label":s({id:"theme.title.customHue"})}),e.jsxs("div",{className:"flex gap-3 items-end",children:[e.jsxs("span",{className:"text-xs text-text-secondary pb-1",children:[s({id:"theme.preview"}),":"]}),e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:"w-10 h-10 rounded border-2 border-border shadow-sm",style:{backgroundColor:be("--bg")}}),e.jsx("span",{className:"text-[10px] text-text-tertiary",children:s({id:"theme.preview.background"})})]}),e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:"w-10 h-10 rounded border-2 border-border shadow-sm",style:{backgroundColor:be("--surface")}}),e.jsx("span",{className:"text-[10px] text-text-tertiary",children:s({id:"theme.preview.surface"})})]}),e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:"w-10 h-10 rounded border-2 border-border shadow-sm",style:{backgroundColor:be("--accent")}}),e.jsx("span",{className:"text-[10px] text-text-tertiary",children:s({id:"theme.preview.accent"})})]})]}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsx("button",{onClick:vs,disabled:q===r,className:`
|
|
84
|
-
flex-1 px-4 py-2 rounded-lg text-sm font-medium
|
|
85
|
-
transition-all duration-200
|
|
86
|
-
${q===r?"bg-muted text-muted-text cursor-not-allowed":"bg-accent text-white hover:bg-accent-hover focus:ring-2 focus:ring-accent focus:ring-offset-2"}
|
|
87
|
-
`,children:s({id:"theme.save"})}),e.jsx("button",{onClick:ys,className:`\r
|
|
88
|
-
px-4 py-2 rounded-lg text-sm font-medium\r
|
|
89
|
-
border-2 border-border bg-bg text-text\r
|
|
90
|
-
hover:bg-surface transition-all duration-200\r
|
|
91
|
-
focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2\r
|
|
92
|
-
`,children:s({id:"theme.reset"})})]})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-3",children:s({id:"theme.styleTier.label"})}),e.jsx("div",{className:"grid grid-cols-3 gap-3",role:"radiogroup","aria-label":s({id:"theme.styleTier.label"}),children:bs.map(o=>{const R=js(o.id),z=h===o.id;return e.jsxs("button",{onClick:()=>H(o.id),role:"radio","aria-checked":z,className:`
|
|
93
|
-
flex flex-col items-center gap-2 p-3 rounded-lg
|
|
94
|
-
transition-all duration-200 border-2
|
|
95
|
-
${z?"border-accent bg-surface shadow-md":"border-border bg-bg hover:bg-surface"}
|
|
96
|
-
focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2
|
|
97
|
-
`,children:[e.jsxs("div",{className:"flex gap-1","aria-hidden":"true",children:[e.jsx("div",{className:"w-5 h-5 rounded-sm border border-border",style:{backgroundColor:R.bg}}),e.jsx("div",{className:"w-5 h-5 rounded-sm border border-border",style:{backgroundColor:R.surface}}),e.jsx("div",{className:"w-5 h-5 rounded-sm border border-border",style:{backgroundColor:R.accent}})]}),e.jsx("span",{className:"text-xs font-medium text-text text-center",children:s({id:o.nameKey})}),e.jsx("span",{className:"text-[10px] text-text-tertiary text-center leading-tight",children:s({id:o.descKey})})]},o.id)})})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-3",children:s({id:"theme.gradient.title"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex gap-2",role:"radiogroup","aria-label":s({id:"theme.gradient.title"}),children:["off","standard","enhanced"].map(o=>e.jsx("button",{onClick:()=>F(o),role:"radio","aria-checked":d===o,className:`
|
|
98
|
-
flex-1 px-3 py-2 rounded-lg text-sm font-medium
|
|
99
|
-
transition-all duration-200 border-2
|
|
100
|
-
${d===o?"border-accent bg-surface shadow-md":"border-border bg-bg hover:bg-surface"}
|
|
101
|
-
focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2
|
|
102
|
-
`,children:s({id:`theme.gradient.${o}`})},o))}),e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:x,onChange:o=>u(o.target.checked),className:`\r
|
|
103
|
-
w-4 h-4 rounded border-border text-accent\r
|
|
104
|
-
focus:ring-2 focus:ring-accent focus:ring-offset-2\r
|
|
105
|
-
`}),e.jsx("span",{className:"text-sm text-text",children:s({id:"theme.gradient.hoverGlow"})})]}),e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:p,onChange:o=>v(o.target.checked),className:`\r
|
|
106
|
-
w-4 h-4 rounded border-border text-accent\r
|
|
107
|
-
focus:ring-2 focus:ring-accent focus:ring-offset-2\r
|
|
108
|
-
`}),e.jsx("span",{className:"text-sm text-text",children:s({id:"theme.gradient.bgAnimation"})})]})]})]}),e.jsx(aa,{}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-3",children:s({id:"theme.motion.label"})}),e.jsx("div",{className:"flex gap-2",role:"radiogroup","aria-label":s({id:"theme.motion.label"}),children:["system","reduce","enable"].map(o=>e.jsx("button",{onClick:()=>k(o),role:"radio","aria-checked":N===o,className:`
|
|
109
|
-
flex-1 px-3 py-2 rounded-lg text-sm font-medium
|
|
110
|
-
transition-all duration-200 border-2
|
|
111
|
-
${N===o?"border-accent bg-surface shadow-md":"border-border bg-bg hover:bg-surface"}
|
|
112
|
-
focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2
|
|
113
|
-
`,children:s({id:`theme.motion.${o}`})},o))})]}),X&&ce.length>0&&e.jsxs("div",{className:"p-3 rounded-lg bg-warning-light border border-warning text-warning-text space-y-2",children:[e.jsx("p",{className:"text-xs font-medium",children:s({id:"theme.accessibility.contrastWarning"})}),e.jsx("ul",{className:"text-xs space-y-1",children:ce.map(o=>{const R=`${o.fgVar}|${o.bgVar}`,z=de[R]||[];return e.jsxs("li",{className:"space-y-1",children:[e.jsxs("span",{children:[o.fgVar," / ",o.bgVar,": ",o.ratio,":1 (min ",o.required,":1)"]}),z.length>0&&e.jsx("div",{className:"ml-2 text-[10px]",children:z.slice(0,1).map((T,he)=>e.jsx("span",{className:"block",children:s({id:"theme.accessibility.fixSuggestion"},{target:T.target==="fg"?o.fgVar:o.bgVar,original:T.original,suggested:T.suggested,ratio:T.resultRatio})},he))})]},R)})}),e.jsx("button",{onClick:()=>ne(!1),className:"text-xs font-medium underline",children:s({id:"theme.accessibility.dismiss"})})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-3",children:s({id:"theme.title.themeMode"})}),e.jsx("div",{className:"grid grid-cols-2 gap-3",role:"group","aria-label":"Theme mode selection",children:Bs.map(o=>e.jsxs("button",{onClick:()=>ws(o.id),"aria-label":s({id:"theme.select.themeMode"},{name:s({id:`theme.themeMode.${o.id}`})}),"aria-selected":le===o.id,role:"radio",className:`
|
|
114
|
-
flex items-center justify-center gap-2 p-3 rounded-lg
|
|
115
|
-
transition-all duration-200 border-2
|
|
116
|
-
${le===o.id?"border-accent bg-surface shadow-md":"border-border bg-bg hover:bg-surface"}
|
|
117
|
-
focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2
|
|
118
|
-
`,children:[e.jsx("span",{className:"text-lg","aria-hidden":"true",children:o.id==="light"?"☀️":"🌙"}),e.jsx("span",{className:"text-sm font-medium text-text",children:s({id:`theme.themeMode.${o.id}`})})]},o.id))})]}),e.jsx("div",{className:"p-3 rounded-lg bg-surface border border-border",children:e.jsx("p",{className:"text-xs text-text-secondary",children:s({id:"theme.current"},{name:$s(t,le)})})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-3",children:s({id:"theme.share.label"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:Es,className:`\r
|
|
119
|
-
flex-1 px-3 py-2 rounded-lg text-sm font-medium\r
|
|
120
|
-
border-2 border-border bg-bg text-text\r
|
|
121
|
-
hover:bg-surface transition-all duration-200\r
|
|
122
|
-
focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2\r
|
|
123
|
-
`,children:s(ps?{id:"theme.share.copied"}:{id:"theme.share.copyCode"})}),e.jsx("button",{onClick:Pe?Ce:Fs,className:`
|
|
124
|
-
flex-1 px-3 py-2 rounded-lg text-sm font-medium
|
|
125
|
-
transition-all duration-200 border-2
|
|
126
|
-
${Pe?"border-accent bg-surface shadow-md":"border-border bg-bg text-text hover:bg-surface"}
|
|
127
|
-
focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2
|
|
128
|
-
`,children:s({id:"theme.share.import"})})]}),Pe&&e.jsxs("div",{className:"mt-3 space-y-3",children:[e.jsx("textarea",{value:gs,onChange:o=>Ps(o.target.value),placeholder:s({id:"theme.share.paste"}),rows:3,className:`\r
|
|
129
|
-
w-full px-3 py-2 rounded-lg text-sm font-mono\r
|
|
130
|
-
bg-bg border-2 border-border text-text\r
|
|
131
|
-
placeholder-text-tertiary resize-none\r
|
|
132
|
-
focus:outline-none focus:ring-2 focus:ring-accent focus:border-accent\r
|
|
133
|
-
`}),we&&e.jsx("div",{className:"p-2 rounded-lg bg-error-light border border-error text-error-text text-xs",children:s({id:Ls(we)})}),fs&&!we&&e.jsx("div",{className:"p-2 rounded-lg bg-warning-light border border-warning text-warning-text text-xs",children:s({id:"theme.share.versionWarning"})}),L&&!we&&e.jsxs("div",{className:"p-3 rounded-lg bg-surface border border-border space-y-3",children:[e.jsx("p",{className:"text-xs font-medium text-text",children:s({id:"theme.share.preview"})}),e.jsx("div",{className:"flex gap-3 items-end",children:(()=>{const o=Us(L);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:"w-10 h-10 rounded border-2 border-border shadow-sm",style:{backgroundColor:o.bg}}),e.jsx("span",{className:"text-[10px] text-text-tertiary",children:s({id:"theme.preview.background"})})]}),e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:"w-10 h-10 rounded border-2 border-border shadow-sm",style:{backgroundColor:o.surface}}),e.jsx("span",{className:"text-[10px] text-text-tertiary",children:s({id:"theme.preview.surface"})})]}),e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:"w-10 h-10 rounded border-2 border-border shadow-sm",style:{backgroundColor:o.accent}}),e.jsx("span",{className:"text-[10px] text-text-tertiary",children:s({id:"theme.preview.accent"})})]})]})})()}),e.jsxs("div",{className:"text-xs text-text-secondary space-y-1",children:[e.jsxs("p",{children:[s({id:"theme.styleTier.label"}),": ",s({id:`theme.styleTier.${L.styleTier==="high-contrast"?"highContrast":L.styleTier}`})]}),e.jsxs("p",{children:[s({id:"theme.gradient.title"}),": ",s({id:`theme.gradient.${L.gradientLevel}`})]}),L.customHue!==null&&e.jsx("p",{children:s({id:"theme.hueValue"},{value:L.customHue})}),L.customHue===null&&e.jsxs("p",{children:[s({id:"theme.title.colorScheme"}),": ",s({id:`theme.colorScheme.${L.colorScheme}`})]})]}),e.jsxs("div",{className:"flex gap-2 pt-1",children:[e.jsx("button",{onClick:Ds,className:`\r
|
|
134
|
-
flex-1 px-4 py-2 rounded-lg text-sm font-medium\r
|
|
135
|
-
bg-accent text-white hover:bg-accent-hover\r
|
|
136
|
-
transition-all duration-200\r
|
|
137
|
-
focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2\r
|
|
138
|
-
`,children:s({id:"theme.share.apply"})}),e.jsx("button",{onClick:Ce,className:`\r
|
|
139
|
-
px-4 py-2 rounded-lg text-sm font-medium\r
|
|
140
|
-
border-2 border-border bg-bg text-text\r
|
|
141
|
-
hover:bg-surface transition-all duration-200\r
|
|
142
|
-
focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2\r
|
|
143
|
-
`,children:s({id:"theme.share.cancel"})})]})]})]}),e.jsx(bt,{open:U!==null,onOpenChange:Ge,children:e.jsxs(jt,{children:[e.jsxs(Nt,{children:[e.jsx(vt,{children:"Delete Theme Slot?"}),e.jsx(yt,{children:"This action cannot be undone. The theme slot will be permanently deleted."})]}),e.jsxs(wt,{children:[e.jsx(kt,{onClick:Ge,children:"Cancel"}),e.jsx(Ct,{onClick:Ms,children:"Delete"})]})]})})]})]})}const ra=[{value:"en",label:"English",flag:"🇺🇸"},{value:"zh",label:"中文",flag:"🇨🇳"}];function ia({compact:s=!1,className:t}){const{locale:n,setLocale:r}=Ht();return e.jsxs(Vs,{value:n,onValueChange:r,children:[e.jsx(qs,{className:$(s?"w-[110px]":"w-[160px]","gap-2",t),"aria-label":"Select language",children:s?e.jsxs(e.Fragment,{children:[e.jsx(is,{className:"w-4 h-4"}),e.jsx(Je,{})]}):e.jsx(Je,{})}),e.jsx(Ws,{children:ra.map(c=>e.jsx(Gs,{value:c.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-base",children:c.flag}),e.jsx("span",{children:c.label})]})},c.value))})]})}const Ae={discord:{id:"discord",name:"Discord",icon:"message-circle",description:"Send notifications to Discord channels via webhook",requiredFields:["webhookUrl"]},telegram:{id:"telegram",name:"Telegram",icon:"send",description:"Send notifications to Telegram chats via bot",requiredFields:["botToken","chatId"]},feishu:{id:"feishu",name:"Feishu",icon:"message-square",description:"Send notifications to Feishu (Lark) via webhook with rich card support",requiredFields:["webhookUrl"]},dingtalk:{id:"dingtalk",name:"DingTalk",icon:"bell",description:"Send notifications to DingTalk via webhook",requiredFields:["webhookUrl"]},wecom:{id:"wecom",name:"WeCom",icon:"users",description:"Send notifications to WeCom (WeChat Work) via webhook",requiredFields:["webhookUrl"]},email:{id:"email",name:"Email",icon:"mail",description:"Send notifications via SMTP email",requiredFields:["host","username","password","from","to"]},webhook:{id:"webhook",name:"Custom Webhook",icon:"link",description:"Send notifications to a custom HTTP endpoint",requiredFields:["url"]}},la={"ask-user-question":{id:"ask-user-question",name:"Ask User Question",description:"Notification when Claude asks a question via AskUserQuestion",icon:"help-circle"},"session-start":{id:"session-start",name:"Session Start",description:"Notification when a CLI session starts",icon:"play"},"session-end":{id:"session-end",name:"Session End",description:"Notification when a CLI session ends",icon:"square"},"task-completed":{id:"task-completed",name:"Task Completed",description:"Notification when a task completes successfully",icon:"check-circle"},"task-failed":{id:"task-failed",name:"Task Failed",description:"Notification when a task fails",icon:"alert-circle"}};function Qe(){return{enabled:!1,platforms:{},events:[{event:"ask-user-question",platforms:["discord","telegram"],enabled:!0},{event:"session-start",platforms:[],enabled:!1},{event:"session-end",platforms:[],enabled:!1},{event:"task-completed",platforms:[],enabled:!1},{event:"task-failed",platforms:["discord","telegram"],enabled:!0}],timeout:1e4}}function oa({config:s,expandedPlatform:t,testing:n,onToggleExpand:r,onUpdateConfig:c,onTest:d,onSave:x,saving:p}){const{formatMessage:N}=J(),f=["discord","telegram","feishu","dingtalk","wecom","email","webhook"],E=u=>{switch(u){case"discord":return e.jsx(Xs,{className:"w-4 h-4"});case"telegram":return e.jsx(zt,{className:"w-4 h-4"});case"feishu":return e.jsx(ts,{className:"w-4 h-4"});case"dingtalk":return e.jsx(Be,{className:"w-4 h-4"});case"wecom":return e.jsx(Js,{className:"w-4 h-4"});case"email":return e.jsx(Ks,{className:"w-4 h-4"});case"webhook":return e.jsx($t,{className:"w-4 h-4"})}},w=u=>{switch(u){case"discord":return s.platforms.discord||{enabled:!1,webhookUrl:""};case"telegram":return s.platforms.telegram||{enabled:!1,botToken:"",chatId:""};case"feishu":return s.platforms.feishu||{enabled:!1,webhookUrl:""};case"dingtalk":return s.platforms.dingtalk||{enabled:!1,webhookUrl:""};case"wecom":return s.platforms.wecom||{enabled:!1,webhookUrl:""};case"email":return s.platforms.email||{enabled:!1,host:"",port:587,username:"",password:"",from:"",to:[]};case"webhook":return s.platforms.webhook||{enabled:!1,url:"",method:"POST"}}},F=u=>{var k;const v=w(u);switch(u){case"discord":return!!v.webhookUrl;case"telegram":return!!v.botToken&&!!v.chatId;case"feishu":return!!v.webhookUrl;case"dingtalk":return!!v.webhookUrl;case"wecom":return!!v.webhookUrl;case"email":const h=v;return!!(h.host&&h.username&&h.password&&h.from&&((k=h.to)==null?void 0:k.length)>0);case"webhook":return!!v.url}};return e.jsx("div",{className:"grid gap-3",children:f.map(u=>{const v=Ae[u],k=w(u),h=F(u),H=t===u;return e.jsxs(Y,{className:"overflow-hidden",children:[e.jsx("div",{className:"p-4 cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>r(H?null:u),children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:$("p-2 rounded-lg",k.enabled&&h?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:E(u)}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:v.name}),h&&e.jsxs(Q,{variant:"outline",className:"text-xs text-green-600 border-green-500/30",children:[e.jsx(ie,{className:"w-3 h-3 mr-1"}),N({id:"settings.remoteNotifications.configured"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:v.description})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{variant:k.enabled?"default":"outline",size:"sm",className:"h-7",onClick:C=>{C.stopPropagation(),c(u,{enabled:!k.enabled})},children:k.enabled?e.jsx(ie,{className:"w-3.5 h-3.5"}):e.jsx(ae,{className:"w-3.5 h-3.5"})}),H?e.jsx(He,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(Ee,{className:"w-4 h-4 text-muted-foreground"})]})]})}),H&&e.jsxs("div",{className:"border-t border-border p-4 space-y-4 bg-muted/30",children:[u==="discord"&&e.jsx(ca,{config:k,onUpdate:C=>c("discord",C)}),u==="telegram"&&e.jsx(da,{config:k,onUpdate:C=>c("telegram",C)}),u==="feishu"&&e.jsx(ua,{config:k,onUpdate:C=>c("feishu",C)}),u==="dingtalk"&&e.jsx(xa,{config:k,onUpdate:C=>c("dingtalk",C)}),u==="wecom"&&e.jsx(ha,{config:k,onUpdate:C=>c("wecom",C)}),u==="email"&&e.jsx(ga,{config:k,onUpdate:C=>c("email",C)}),u==="webhook"&&e.jsx(ma,{config:k,onUpdate:C=>c("webhook",C)}),e.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[e.jsxs(j,{variant:"outline",size:"sm",onClick:()=>d(u,k),disabled:n===u||!h,children:[e.jsx(Bt,{className:$("w-3.5 h-3.5 mr-1",n===u&&"animate-pulse")}),N({id:"settings.remoteNotifications.testConnection"})]}),e.jsx(j,{variant:"default",size:"sm",onClick:x,disabled:p,children:N({id:"settings.remoteNotifications.save"})})]})]})]},u)})})}function ca({config:s,onUpdate:t}){const{formatMessage:n}=J(),[r,c]=i.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.discord.webhookUrl"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(P,{type:r?"text":"password",value:s.webhookUrl||"",onChange:d=>t({webhookUrl:d.target.value}),placeholder:"https://discord.com/api/webhooks/...",className:"flex-1"}),e.jsx(j,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!r),children:r?e.jsx(fe,{className:"w-4 h-4"}):e.jsx(pe,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:n({id:"settings.remoteNotifications.discord.webhookUrlHint"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.discord.username"})}),e.jsx(P,{value:s.username||"",onChange:d=>t({username:d.target.value}),placeholder:"CCW Notification",className:"mt-1"})]})]})}function da({config:s,onUpdate:t}){const{formatMessage:n}=J(),[r,c]=i.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.telegram.botToken"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(P,{type:r?"text":"password",value:s.botToken||"",onChange:d=>t({botToken:d.target.value}),placeholder:"1234567890:ABCdefGHIjklMNOpqrsTUVwxyz",className:"flex-1"}),e.jsx(j,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!r),children:r?e.jsx(fe,{className:"w-4 h-4"}):e.jsx(pe,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:n({id:"settings.remoteNotifications.telegram.botTokenHint"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.telegram.chatId"})}),e.jsx(P,{value:s.chatId||"",onChange:d=>t({chatId:d.target.value}),placeholder:"-1001234567890",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:n({id:"settings.remoteNotifications.telegram.chatIdHint"})})]})]})}function ma({config:s,onUpdate:t}){const{formatMessage:n}=J();return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.webhook.url"})}),e.jsx(P,{value:s.url||"",onChange:r=>t({url:r.target.value}),placeholder:"https://your-server.com/webhook",className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.webhook.method"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(j,{variant:s.method==="POST"?"default":"outline",size:"sm",onClick:()=>t({method:"POST"}),children:"POST"}),e.jsx(j,{variant:s.method==="PUT"?"default":"outline",size:"sm",onClick:()=>t({method:"PUT"}),children:"PUT"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.webhook.headers"})}),e.jsx(P,{value:s.headers?JSON.stringify(s.headers):"",onChange:r=>{try{const c=r.target.value?JSON.parse(r.target.value):void 0;t({headers:c})}catch{}},placeholder:'{"Authorization": "Bearer token"}',className:"mt-1 font-mono text-xs"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:n({id:"settings.remoteNotifications.webhook.headersHint"})})]})]})}function ua({config:s,onUpdate:t}){const{formatMessage:n}=J(),[r,c]=i.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.feishu.webhookUrl"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(P,{type:r?"text":"password",value:s.webhookUrl||"",onChange:d=>t({webhookUrl:d.target.value}),placeholder:"https://open.feishu.cn/open-apis/bot/v2/hook/...",className:"flex-1"}),e.jsx(j,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!r),children:r?e.jsx(fe,{className:"w-4 h-4"}):e.jsx(pe,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:n({id:"settings.remoteNotifications.feishu.webhookUrlHint"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"feishu-useCard",checked:s.useCard||!1,onChange:d=>t({useCard:d.target.checked}),className:"rounded border-border"}),e.jsx("label",{htmlFor:"feishu-useCard",className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.feishu.useCard"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:n({id:"settings.remoteNotifications.feishu.useCardHint"})}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.feishu.title"})}),e.jsx(P,{value:s.title||"",onChange:d=>t({title:d.target.value}),placeholder:"CCW Notification",className:"mt-1"})]})]})}function xa({config:s,onUpdate:t}){var d;const{formatMessage:n}=J(),[r,c]=i.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.dingtalk.webhookUrl"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(P,{type:r?"text":"password",value:s.webhookUrl||"",onChange:x=>t({webhookUrl:x.target.value}),placeholder:"https://oapi.dingtalk.com/robot/send?access_token=...",className:"flex-1"}),e.jsx(j,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!r),children:r?e.jsx(fe,{className:"w-4 h-4"}):e.jsx(pe,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:n({id:"settings.remoteNotifications.dingtalk.webhookUrlHint"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.dingtalk.keywords"})}),e.jsx(P,{value:((d=s.keywords)==null?void 0:d.join(", "))||"",onChange:x=>t({keywords:x.target.value.split(",").map(p=>p.trim()).filter(Boolean)}),placeholder:"keyword1, keyword2",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:n({id:"settings.remoteNotifications.dingtalk.keywordsHint"})})]})]})}function ha({config:s,onUpdate:t}){var d;const{formatMessage:n}=J(),[r,c]=i.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.wecom.webhookUrl"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(P,{type:r?"text":"password",value:s.webhookUrl||"",onChange:x=>t({webhookUrl:x.target.value}),placeholder:"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=...",className:"flex-1"}),e.jsx(j,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!r),children:r?e.jsx(fe,{className:"w-4 h-4"}):e.jsx(pe,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:n({id:"settings.remoteNotifications.wecom.webhookUrlHint"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.wecom.mentionedList"})}),e.jsx(P,{value:((d=s.mentionedList)==null?void 0:d.join(", "))||"",onChange:x=>t({mentionedList:x.target.value.split(",").map(p=>p.trim()).filter(Boolean)}),placeholder:"userid1, userid2, @all",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:n({id:"settings.remoteNotifications.wecom.mentionedListHint"})})]})]})}function ga({config:s,onUpdate:t}){var d;const{formatMessage:n}=J(),[r,c]=i.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.email.host"})}),e.jsx(P,{value:s.host||"",onChange:x=>t({host:x.target.value}),placeholder:"smtp.gmail.com",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:n({id:"settings.remoteNotifications.email.hostHint"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.email.port"})}),e.jsx(P,{type:"number",value:s.port||587,onChange:x=>t({port:parseInt(x.target.value,10)||587}),placeholder:"587",className:"mt-1"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"email-secure",checked:s.secure||!1,onChange:x=>t({secure:x.target.checked}),className:"rounded border-border"}),e.jsx("label",{htmlFor:"email-secure",className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.email.secure"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.email.username"})}),e.jsx(P,{value:s.username||"",onChange:x=>t({username:x.target.value}),placeholder:"your-email@gmail.com",className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.email.password"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(P,{type:r?"text":"password",value:s.password||"",onChange:x=>t({password:x.target.value}),placeholder:"********",className:"flex-1"}),e.jsx(j,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!r),children:r?e.jsx(fe,{className:"w-4 h-4"}):e.jsx(pe,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.email.from"})}),e.jsx(P,{value:s.from||"",onChange:x=>t({from:x.target.value}),placeholder:"noreply@example.com",className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:n({id:"settings.remoteNotifications.email.to"})}),e.jsx(P,{value:((d=s.to)==null?void 0:d.join(", "))||"",onChange:x=>t({to:x.target.value.split(",").map(p=>p.trim()).filter(Boolean)}),placeholder:"user1@example.com, user2@example.com",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:n({id:"settings.remoteNotifications.email.toHint"})})]})]})}function fa({className:s}){const{formatMessage:t}=J(),[n,r]=i.useState(null),[c,d]=i.useState(!0),[x,p]=i.useState(!1),[N,f]=i.useState(null),[E,w]=i.useState(null),[F,u]=i.useState(null),v=i.useCallback(async()=>{d(!0);try{const b=await fetch("/api/notifications/remote/config");if(b.ok){const y=await b.json();r(y)}else r(Qe())}catch(b){console.error("Failed to load remote notification config:",b),r(Qe())}finally{d(!1)}},[]);i.useEffect(()=>{v()},[v]);const k=i.useCallback(async b=>{p(!0);try{const y=await fetch("/api/notifications/remote/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)});if(y.ok){const l=await y.json();r(l.config),B.success(t({id:"settings.remoteNotifications.saved"}))}else throw new Error(`HTTP ${y.status}`)}catch{B.error(t({id:"settings.remoteNotifications.saveError"}))}finally{p(!1)}},[t]),h=i.useCallback(async(b,y)=>{f(b);try{const g=await(await fetch("/api/notifications/remote/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({platform:b,config:y})})).json();g.success?B.success(t({id:"settings.remoteNotifications.testSuccess"}),{description:`${g.responseTime}ms`}):B.error(t({id:"settings.remoteNotifications.testFailed"}),{description:g.error})}catch{B.error(t({id:"settings.remoteNotifications.testError"}))}finally{f(null)}},[t]),H=()=>{n&&k({...n,enabled:!n.enabled})},C=(b,y)=>{if(!n)return;const l={...n,platforms:{...n.platforms,[b]:{...n.platforms[b],...y}}};r(l)},M=(b,y)=>{if(!n)return;const l=[...n.events];l[b]={...l[b],...y},r({...n,events:l})},O=(b,y)=>{if(!n)return;const l=n.events[b],g=l.platforms.includes(y)?l.platforms.filter(m=>m!==y):[...l.platforms,y];M(b,{platforms:g})},W=["discord","telegram","feishu","dingtalk","wecom","email","webhook"],A=async()=>{if(confirm(t({id:"settings.remoteNotifications.resetConfirm"})))try{const b=await fetch("/api/notifications/remote/reset",{method:"POST"});if(b.ok){const y=await b.json();r(y.config),B.success(t({id:"settings.remoteNotifications.resetSuccess"}))}}catch{B.error(t({id:"settings.remoteNotifications.resetError"}))}};return c?e.jsx(Y,{className:$("p-6",s),children:e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(ue,{className:"w-5 h-5 animate-spin text-muted-foreground"})})}):n?e.jsxs(Y,{className:$("p-6",s),children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[n.enabled?e.jsx(Be,{className:"w-5 h-5 text-primary"}):e.jsx(Kt,{className:"w-5 h-5 text-muted-foreground"}),t({id:"settings.remoteNotifications.title"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{variant:"outline",size:"sm",onClick:()=>v(),disabled:c,children:e.jsx(ue,{className:$("w-3.5 h-3.5",c&&"animate-spin")})}),e.jsx(j,{variant:n.enabled?"default":"outline",size:"sm",onClick:H,children:n.enabled?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-1"}),t({id:"settings.remoteNotifications.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"w-4 h-4 mr-1"}),t({id:"settings.remoteNotifications.disabled"})]})})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:t({id:"settings.remoteNotifications.description"})}),n.enabled&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4 mb-6",children:[e.jsx("h3",{className:"text-sm font-medium text-foreground",children:t({id:"settings.remoteNotifications.platforms"})}),e.jsx(oa,{config:n,expandedPlatform:E,testing:N,onToggleExpand:w,onUpdateConfig:C,onTest:h,onSave:()=>k(n),saving:x})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-medium text-foreground",children:t({id:"settings.remoteNotifications.events"})}),e.jsx("div",{className:"grid gap-3",children:n.events.map((b,y)=>{const l=la[b.event],g=F===y;return e.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between p-3 cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>u(g?null:y),children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:$("p-2 rounded-lg",b.enabled?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:e.jsx("span",{className:"text-sm",children:l.icon})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:l.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:l.description})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex gap-1 flex-wrap max-w-xs",children:[b.platforms.slice(0,3).map(m=>e.jsx(Q,{variant:"secondary",className:"text-xs",children:Ae[m].name},m)),b.platforms.length>3&&e.jsxs(Q,{variant:"secondary",className:"text-xs",children:["+",b.platforms.length-3]}),b.platforms.length===0&&e.jsx(Q,{variant:"outline",className:"text-xs text-muted-foreground",children:t({id:"settings.remoteNotifications.noPlatforms"})})]}),e.jsx(j,{variant:b.enabled?"default":"outline",size:"sm",className:"h-7",onClick:m=>{m.stopPropagation(),M(y,{enabled:!b.enabled})},children:b.enabled?e.jsx(ie,{className:"w-3.5 h-3.5"}):e.jsx(ae,{className:"w-3.5 h-3.5"})}),g?e.jsx(He,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(Ee,{className:"w-4 h-4 text-muted-foreground"})]})]}),g&&e.jsxs("div",{className:"border-t border-border p-4 space-y-3 bg-muted/20",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:t({id:"settings.remoteNotifications.selectPlatforms"})}),e.jsx("div",{className:"flex flex-wrap gap-2",children:W.map(m=>{const D=b.platforms.includes(m),_=Ae[m],G=n.platforms[m],q=G==null?void 0:G.enabled;return e.jsxs(j,{variant:D?"default":"outline",size:"sm",className:$("h-8",!q&&!D&&"opacity-50"),onClick:()=>O(y,m),children:[D&&e.jsx(ie,{className:"w-3 h-3 mr-1"}),_.name,!q&&!D&&e.jsx(Ne,{className:"w-3 h-3 ml-1 opacity-50"})]},m)})})]})]},b.event)})})]}),e.jsxs("div",{className:"flex items-center justify-between mt-6 pt-4 border-t border-border",children:[e.jsx(j,{variant:"outline",size:"sm",onClick:A,children:t({id:"settings.remoteNotifications.reset"})}),e.jsxs(j,{variant:"default",size:"sm",onClick:()=>k(n),disabled:x,children:[e.jsx(Fe,{className:"w-4 h-4 mr-1"}),t(x?{id:"settings.remoteNotifications.saving"}:{id:"settings.remoteNotifications.save"})]})]})]})]}):null}function pa({value:s,label:t,description:n,selected:r,onClick:c}){const d={modal:e.jsx("div",{className:"w-8 h-8 border-2 border-current rounded-lg flex items-center justify-center",children:e.jsx("div",{className:"w-4 h-3 border border-current rounded-sm"})}),drawer:e.jsx("div",{className:"w-8 h-8 border-2 border-current rounded-lg flex items-end justify-end p-0.5",children:e.jsx("div",{className:"w-2 h-6 border border-current rounded-sm"})}),sheet:e.jsx("div",{className:"w-8 h-8 border-2 border-current rounded-lg flex items-end justify-center p-0.5",children:e.jsx("div",{className:"w-6 h-2 border border-current rounded-sm"})}),fullscreen:e.jsx("div",{className:"w-8 h-8 border-2 border-current rounded-lg flex items-center justify-center",children:e.jsx("div",{className:"w-5 h-4 border border-current rounded-sm"})})};return e.jsxs("button",{type:"button",onClick:c,className:$("flex flex-col items-center gap-2 p-3 rounded-lg border-2 transition-all","hover:bg-accent/50",r?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground"),children:[d[s],e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:$("text-sm font-medium",r&&"text-primary"),children:t}),e.jsx("div",{className:"text-xs text-muted-foreground",children:n})]})]})}function ba({value:s,onChange:t,disabled:n}){const r=[10,20,30,45,60,90,120];return e.jsx("div",{className:"flex flex-wrap gap-2",children:r.map(c=>e.jsxs(j,{type:"button",variant:s===c?"default":"outline",size:"sm",disabled:n,onClick:()=>t(c),children:[c,"s"]},c))})}function ja(){const{formatMessage:s}=J(),{preferences:t,updatePreference:n,resetPreferences:r}=Ys(),c=[{value:"modal",label:s({id:"settings.a2ui.styleModal",defaultMessage:"Modal"}),description:s({id:"settings.a2ui.styleModalDesc",defaultMessage:"Centered"})},{value:"drawer",label:s({id:"settings.a2ui.styleDrawer",defaultMessage:"Drawer"}),description:s({id:"settings.a2ui.styleDrawerDesc",defaultMessage:"Side panel"})},{value:"sheet",label:s({id:"settings.a2ui.styleSheet",defaultMessage:"Sheet"}),description:s({id:"settings.a2ui.styleSheetDesc",defaultMessage:"Bottom"})},{value:"fullscreen",label:s({id:"settings.a2ui.styleFullscreen",defaultMessage:"Fullscreen"}),description:s({id:"settings.a2ui.styleFullscreenDesc",defaultMessage:"Full screen"})}];return e.jsxs(Y,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(ts,{className:"w-5 h-5"}),s({id:"settings.sections.a2ui",defaultMessage:"A2UI Preferences"})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs(Xe,{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(Jt,{className:"w-4 h-4"}),s({id:"settings.a2ui.dialogStyle",defaultMessage:"Dialog Style"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.dialogStyleDesc",defaultMessage:"Choose how A2UI dialogs are displayed"})}),e.jsx("div",{className:"grid grid-cols-4 gap-2",children:c.map(d=>e.jsx(pa,{value:d.value,label:d.label,description:d.description,selected:t.dialogStyle===d.value,onClick:()=>n("dialogStyle",d.value)},d.value))})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-t border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qs,{className:"w-4 h-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s({id:"settings.a2ui.smartMode",defaultMessage:"Smart Mode"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.smartModeDesc",defaultMessage:"Auto-select style based on question type"})})]})]}),e.jsx(j,{variant:t.smartModeEnabled?"default":"outline",size:"sm",onClick:()=>n("smartModeEnabled",!t.smartModeEnabled),children:t.smartModeEnabled?s({id:"common.enabled",defaultMessage:"Enabled"}):s({id:"common.disabled",defaultMessage:"Disabled"})})]}),e.jsxs("div",{className:"space-y-3 py-2 border-t border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Zs,{className:"w-4 h-4 text-muted-foreground"}),e.jsx(Xe,{className:"text-sm font-medium",children:s({id:"settings.a2ui.autoSelectionDuration",defaultMessage:"Auto-Selection Duration"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.autoSelectionDurationDesc",defaultMessage:"Countdown before auto-selecting default option"})}),e.jsx(ba,{value:t.autoSelectionDuration,onChange:d=>n("autoSelectionDuration",d)})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-t border-border",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s({id:"settings.a2ui.pauseOnInteraction",defaultMessage:"Pause on Interaction"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.pauseOnInteractionDesc",defaultMessage:"Pause countdown when you interact with the dialog"})})]}),e.jsx(j,{variant:t.pauseOnInteraction?"default":"outline",size:"sm",onClick:()=>n("pauseOnInteraction",!t.pauseOnInteraction),children:t.pauseOnInteraction?s({id:"common.enabled",defaultMessage:"Enabled"}):s({id:"common.disabled",defaultMessage:"Disabled"})})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-t border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Yt,{className:"w-4 h-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s({id:"settings.a2ui.soundNotification",defaultMessage:"Sound Notification"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.soundNotificationDesc",defaultMessage:"Play sound before auto-submit (3 seconds before)"})})]})]}),e.jsx(j,{variant:t.autoSelectionSoundEnabled?"default":"outline",size:"sm",onClick:()=>n("autoSelectionSoundEnabled",!t.autoSelectionSoundEnabled),children:t.autoSelectionSoundEnabled?s({id:"common.enabled",defaultMessage:"Enabled"}):s({id:"common.disabled",defaultMessage:"Disabled"})})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-t border-border",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s({id:"settings.a2ui.showToolbarButton",defaultMessage:"Show Toolbar Button"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.showToolbarButtonDesc",defaultMessage:"Show A2UI quick action button in the toolbar"})})]}),e.jsx(j,{variant:t.showA2UIButtonInToolbar?"default":"outline",size:"sm",onClick:()=>n("showA2UIButtonInToolbar",!t.showA2UIButtonInToolbar),children:t.showA2UIButtonInToolbar?s({id:"common.enabled",defaultMessage:"Enabled"}):s({id:"common.disabled",defaultMessage:"Disabled"})})]}),e.jsx("div",{className:"flex justify-end pt-4 border-t border-border",children:e.jsx(j,{variant:"outline",size:"sm",onClick:r,children:s({id:"common.resetToDefaults",defaultMessage:"Reset to Defaults"})})})]})]})}const os=["","low","medium","high"],cs=["","low","medium","high","max"],Me=["sonnet","opus","haiku","inherit"],ds=["","default","acceptEdits","dontAsk","bypassPermissions","plan"],ms=["","user","project","local"],us=["","worktree"],xs=["","purple","blue","yellow","green","red"],Oe=["PreToolUse","PostToolUse","Stop"],ee="h-7 text-xs rounded border border-input bg-background px-2",V="text-xs text-muted-foreground shrink-0";function Ze(s){if(!s)return[];const t=[],n=s.split(`
|
|
144
|
-
`);for(const r of n){const c=r.match(/^\s+-\s+(.+)$/);c&&t.push(c[1].trim())}return t}function Na(s){return s.length===0?"":`mcpServers:
|
|
145
|
-
${s.map(t=>` - ${t}`).join(`
|
|
146
|
-
`)}`}function es(s){const t={PreToolUse:[],PostToolUse:[],Stop:[]};if(!s)return t;let n=null,r=null;const c=s.split(`
|
|
147
|
-
`);for(const d of c){const x=d.match(/^\s{2,4}(\w+):$/);if(x&&x[1]in t){n=x[1],r=null;continue}const p=d.match(/^\s+-\s+matcher:\s*["']?([^"'\n]+)["']?$/);if(p&&n){r=p[1].trim();continue}const N=d.match(/^\s+command:\s*["']?([^"'\n]+)["']?$/);if(N&&n&&r!==null){t[n].push({matcher:r,command:N[1].trim()}),r=null;continue}}return t}function va(s){const t=[];for(const n of Oe){const r=s[n];if(r.length!==0){t.push(` ${n}:`);for(const c of r)t.push(` - matcher: "${c.matcher}"`),t.push(" hooks:"),t.push(" - type: command"),t.push(` command: "${c.command}"`)}}return t.length===0?"":`hooks:
|
|
148
|
-
${t.join(`
|
|
149
|
-
`)}`}function ya({agent:s,onSaved:t}){const[n,r]=i.useState(s.color),[c,d]=i.useState(s.permissionMode),[x,p]=i.useState(s.memory),[N,f]=i.useState(s.maxTurns),[E,w]=i.useState(s.background==="true"),[F,u]=i.useState(s.isolation),[v,k]=i.useState(s.tools),[h,H]=i.useState(s.disallowedTools),[C,M]=i.useState(s.skills),[O,W]=i.useState([]),[A,b]=i.useState(()=>Ze(s.mcpServers)),[y,l]=i.useState(!1),[g,m]=i.useState(""),[D,_]=i.useState(()=>es(s.hooks)),[G,q]=i.useState("PreToolUse"),[Z,ce]=i.useState(!1);i.useEffect(()=>{let a=!1;return l(!0),at().then(S=>{if(a)return;const I=new Set;S.userServers&&Object.keys(S.userServers).forEach(U=>I.add(U)),S.globalServers&&Object.keys(S.globalServers).forEach(U=>I.add(U)),S.projects&&Object.values(S.projects).forEach(U=>{U!=null&&U.mcpServers&&Object.keys(U.mcpServers).forEach(K=>I.add(K))}),W(Array.from(I).sort())}).catch(()=>{}).finally(()=>{a||l(!1)}),()=>{a=!0}},[]),i.useEffect(()=>{r(s.color),d(s.permissionMode),p(s.memory),f(s.maxTurns),w(s.background==="true"),u(s.isolation),k(s.tools),H(s.disallowedTools),M(s.skills),b(Ze(s.mcpServers)),_(es(s.hooks))},[s]);const se=i.useCallback(async()=>{ce(!0);try{const a={filePath:s.filePath};n!==s.color&&(a.color=n),c!==s.permissionMode&&(a.permissionMode=c),x!==s.memory&&(a.memory=x),N!==s.maxTurns&&(a.maxTurns=N);const S=E?"true":"";S!==s.background&&(a.background=S),F!==s.isolation&&(a.isolation=F),v!==s.tools&&(a.tools=v),h!==s.disallowedTools&&(a.disallowedTools=h),C!==s.skills&&(a.skills=C);const I=Na(A);I!==s.mcpServers&&(a.mcpServers=I);const U=va(D);if(U!==s.hooks&&(a.hooks=U),Object.keys(a).filter(re=>re!=="filePath").length===0){B.info("No changes to save");return}await $e(s.type,s.name,a),B.success(`Updated ${s.name} advanced settings`),t()}catch(a){B.error(`Failed: ${a.message}`)}finally{ce(!1)}},[s,n,c,x,N,E,F,v,h,C,A,D,t]),de=a=>{b(S=>S.includes(a)?S.filter(I=>I!==a):[...S,a])},me=()=>{const a=g.trim();a&&!A.includes(a)&&(b(S=>[...S,a]),m(""))},X=()=>{_(a=>({...a,[G]:[...a[G],{matcher:"",command:""}]}))},ne=(a,S)=>{_(I=>({...I,[a]:I[a].filter((U,K)=>K!==S)}))},te=(a,S,I,U)=>{_(K=>({...K,[a]:K[a].map((re,xe)=>xe===S?{...re,[I]:U}:re)}))};return e.jsxs("div",{className:"mt-2 ml-6 p-3 rounded-md border border-border bg-muted/20 space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:V,children:"Color:"}),e.jsx("select",{className:ee,value:n,onChange:a=>r(a.target.value),children:xs.map(a=>e.jsx("option",{value:a,children:a||"—"},a))})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:V,children:"Permission:"}),e.jsx("select",{className:ee,value:c,onChange:a=>d(a.target.value),children:ds.map(a=>e.jsx("option",{value:a,children:a||"—"},a))})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:V,children:"Memory:"}),e.jsx("select",{className:ee,value:x,onChange:a=>p(a.target.value),children:ms.map(a=>e.jsx("option",{value:a,children:a||"—"},a))})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:V,children:"MaxTurns:"}),e.jsx(P,{className:"h-7 text-xs w-[60px]",type:"number",value:N,onChange:a=>f(a.target.value),placeholder:"—"})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Ie,{checked:E,onCheckedChange:a=>w(a===!0)}),e.jsx("span",{className:V,children:"Background"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:V,children:"Isolation:"}),e.jsx("select",{className:ee,value:F,onChange:a=>u(a.target.value),children:us.map(a=>e.jsx("option",{value:a,children:a||"—"},a))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:V,children:"Tools:"}),e.jsx(P,{className:"h-7 text-xs flex-1",value:v,onChange:a=>k(a.target.value),placeholder:"Read, Write, Bash, Glob, Grep"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:V,children:"Disallowed:"}),e.jsx(P,{className:"h-7 text-xs flex-1",value:h,onChange:a=>H(a.target.value),placeholder:"e.g. Edit"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:V,children:"Skills:"}),e.jsx(P,{className:"h-7 text-xs flex-1",value:C,onChange:a=>M(a.target.value),placeholder:"e.g. api-conventions, error-handling"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"MCP Servers:"}),y?e.jsx("span",{className:"text-xs text-muted-foreground ml-2",children:"Loading..."}):e.jsxs("div",{className:"flex flex-wrap gap-3 ml-1",children:[O.map(a=>e.jsxs("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[e.jsx(Ie,{checked:A.includes(a),onCheckedChange:()=>de(a)}),e.jsx("span",{className:"text-foreground",children:a})]},a)),A.filter(a=>!O.includes(a)).map(a=>e.jsxs("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer",children:[e.jsx(Ie,{checked:!0,onCheckedChange:()=>de(a)}),e.jsx("span",{className:"text-foreground italic",children:a})]},a)),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(P,{className:"h-6 text-xs w-[120px]",value:g,onChange:a=>m(a.target.value),placeholder:"+ Custom",onKeyDown:a=>{a.key==="Enter"&&me()}}),e.jsx(j,{variant:"ghost",size:"sm",className:"h-6 px-1",onClick:me,disabled:!g.trim(),children:e.jsx(Ne,{className:"w-3 h-3"})})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Hooks:"}),Oe.map(a=>{const S=D[a];return S.length===0?null:e.jsxs("div",{className:"ml-1 space-y-1",children:[e.jsxs("span",{className:"text-xs text-muted-foreground font-medium",children:[a,":"]}),S.map((I,U)=>e.jsxs("div",{className:"flex items-center gap-2 ml-3",children:[e.jsx(P,{className:"h-6 text-xs w-[100px]",value:I.matcher,onChange:K=>te(a,U,"matcher",K.target.value),placeholder:"matcher (e.g. Bash)"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"→"}),e.jsx(P,{className:"h-6 text-xs flex-1",value:I.command,onChange:K=>te(a,U,"command",K.target.value),placeholder:"command"}),e.jsx("button",{type:"button",className:"text-muted-foreground hover:text-destructive transition-colors",onClick:()=>ne(a,U),children:e.jsx(ae,{className:"w-3 h-3"})})]},U))]},a)}),e.jsxs("div",{className:"flex items-center gap-2 ml-1",children:[e.jsx("select",{className:ee,value:G,onChange:a=>q(a.target.value),children:Oe.map(a=>e.jsx("option",{value:a,children:a},a))}),e.jsxs(j,{variant:"outline",size:"sm",className:"h-6 px-2 text-xs",onClick:X,children:[e.jsx(Ne,{className:"w-3 h-3 mr-1"}),"Add Hook"]})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(j,{variant:"default",size:"sm",className:"h-7",disabled:Z,onClick:se,children:[e.jsx(Fe,{className:"w-3 h-3 mr-1"}),Z?"Saving...":"Save Advanced"]})})]})}function wa({agent:s,onSaved:t}){const[n,r]=i.useState(s.model),[c,d]=i.useState(s.effort),[x,p]=i.useState(!1),[N,f]=i.useState(!1),E=n!==s.model||c!==s.effort,w=s.type==="codex"?os:cs,F=i.useCallback(async()=>{p(!0);try{const u={filePath:s.filePath};n!==s.model&&(u.model=n),c!==s.effort&&(u.effort=c),await $e(s.type,s.name,u),B.success(`Updated ${s.name}`),t()}catch(u){B.error(`Failed to update ${s.name}: ${u.message}`)}finally{p(!1)}},[s,n,c,t]);return i.useEffect(()=>{r(s.model),d(s.effort)},[s.model,s.effort]),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 py-2 px-3 rounded-md border border-border bg-card hover:bg-accent/30 transition-colors",children:[e.jsx(Q,{variant:s.type==="codex"?"default":"secondary",className:"text-xs shrink-0",children:s.type}),e.jsx("span",{className:"text-sm font-medium text-foreground min-w-[140px] truncate",title:s.name,children:s.name}),e.jsxs("div",{className:"flex items-center gap-1 flex-1 min-w-0",children:[e.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Model:"}),s.type==="claude"?e.jsxs("div",{className:"flex gap-1 flex-1 min-w-0",children:[e.jsxs("select",{className:"h-7 text-xs rounded border border-input bg-background px-2 shrink-0",value:Me.includes(n)?n:"__custom__",onChange:u=>{u.target.value!=="__custom__"&&r(u.target.value)},children:[Me.map(u=>e.jsx("option",{value:u,children:u||"(none)"},u)),!Me.includes(n)&&e.jsx("option",{value:"__custom__",children:"custom"})]}),!Me.includes(n)&&e.jsx(P,{className:"h-7 text-xs flex-1 min-w-[100px]",value:n,onChange:u=>r(u.target.value),placeholder:"model id"})]}):e.jsx(P,{className:"h-7 text-xs flex-1 min-w-[100px]",value:n,onChange:u=>r(u.target.value),placeholder:"model id"})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Effort:"}),e.jsx("select",{className:"h-7 text-xs rounded border border-input bg-background px-2",value:c,onChange:u=>d(u.target.value),children:w.map(u=>e.jsx("option",{value:u,children:u||"—"},u))})]}),e.jsxs(j,{variant:"outline",size:"sm",className:"h-7 px-2 shrink-0",disabled:!E||x,onClick:F,children:[e.jsx(Fe,{className:"w-3 h-3 mr-1"}),x?"...":"Save"]}),s.type==="claude"&&e.jsx("button",{type:"button",className:$("p-1 rounded hover:bg-accent transition-colors",N&&"text-primary"),onClick:()=>f(!N),title:"Advanced Settings",children:e.jsx(as,{className:"w-4 h-4"})})]}),N&&s.type==="claude"&&e.jsx(ya,{agent:s,onSaved:t})]})}function ka({installationPath:s,agents:t,onSaved:n}){const[r,c]=i.useState(!0);return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full text-left py-1 hover:text-primary transition-colors",onClick:()=>c(!r),children:[r?e.jsx(Ee,{className:"w-4 h-4"}):e.jsx(tt,{className:"w-4 h-4"}),e.jsx("span",{className:"text-sm font-medium text-foreground truncate",title:s,children:s}),e.jsxs(Q,{variant:"outline",className:"text-xs ml-auto shrink-0",children:[t.length," agents"]})]}),r&&e.jsx("div",{className:"space-y-1 ml-6",children:t.map(d=>e.jsx(wa,{agent:d,onSaved:n},d.filePath))})]})}function Ca(){const[s,t]=i.useState([]),[n,r]=i.useState(!0),[c,d]=i.useState(""),[x,p]=i.useState(""),[N,f]=i.useState("all"),[E,w]=i.useState(""),[F,u]=i.useState(""),[v,k]=i.useState(""),[h,H]=i.useState(""),[C,M]=i.useState(""),[O,W]=i.useState(""),[A,b]=i.useState(""),[y,l]=i.useState(""),[g,m]=i.useState(""),[D,_]=i.useState(!1),[G,q]=i.useState(!1),Z=i.useCallback(async()=>{try{r(!0);const a=await et();t(a.agents)}catch(a){B.error(`Failed to load agents: ${a.message}`)}finally{r(!1)}},[]);i.useEffect(()=>{Z()},[Z]);const ce=s.reduce((a,S)=>{const I=S.installationPath;return a[I]||(a[I]=[]),a[I].push(S),a},{}),se=s.filter(a=>N==="all"||a.type===N),de=se.some(a=>a.type==="claude"),me=N==="codex"?os:N==="claude"?cs:["","low","medium","high","max (claude only)"],X={};E&&(X.color=E),F&&(X.permissionMode=F),v&&(X.memory=v),h&&(X.maxTurns=h),C&&(X.background=C),O&&(X.isolation=O),A&&(X.tools=A),y&&(X.disallowedTools=y),g&&(X.skills=g);const ne=Object.keys(X).length>0,te=i.useCallback(async()=>{if(!(c||x||ne)){B.error("Set at least one value first");return}if(se.length===0){B.error("No agents match the selected type");return}q(!0);try{if(c||x){const S=se.map(U=>({filePath:U.filePath,type:U.type})),I=await st({targets:S,model:c||void 0,effort:x||void 0});B.success(`Updated model/effort: ${I.updated}/${I.total} agents`)}if(ne&&de){const S=se.filter(U=>U.type==="claude");let I=0;for(const U of S)try{const K={filePath:U.filePath,...X};await $e(U.type,U.name,K),I++}catch{}B.success(`Updated claude fields: ${I}/${S.length} agents`)}Z()}catch(S){B.error(`Batch update failed: ${S.message}`)}finally{q(!1)}},[se,de,c,x,ne,X,Z]);return e.jsxs(Y,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(_t,{className:"w-5 h-5"}),"Agent Definitions"]}),e.jsxs(j,{variant:"ghost",size:"sm",onClick:Z,disabled:n,children:[e.jsx(ue,{className:$("w-4 h-4 mr-1",n&&"animate-spin")}),"Refresh"]})]}),e.jsxs("div",{className:"p-3 mb-4 rounded-md border border-border bg-muted/30 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Batch:"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:V,children:"Target:"}),e.jsxs("select",{className:ee,value:N,onChange:a=>f(a.target.value),children:[e.jsxs("option",{value:"all",children:["All (",s.length,")"]}),e.jsxs("option",{value:"codex",children:["Codex (",s.filter(a=>a.type==="codex").length,")"]}),e.jsxs("option",{value:"claude",children:["Claude (",s.filter(a=>a.type==="claude").length,")"]})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:V,children:"Model:"}),e.jsx(P,{className:"h-7 text-xs w-[140px]",value:c,onChange:a=>d(a.target.value),placeholder:"model"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:V,children:"Effort:"}),e.jsx("select",{className:ee,value:x,onChange:a=>p(a.target.value),children:me.map(a=>{const S=a.startsWith("max")?"max":a;return e.jsx("option",{value:S,children:a||"—"},a)})})]}),N!=="codex"&&e.jsx("button",{type:"button",className:$("p-1 rounded hover:bg-accent transition-colors",D&&"text-primary"),onClick:()=>_(!D),title:"Claude Advanced Batch Settings",children:e.jsx(as,{className:"w-4 h-4"})}),e.jsx(j,{variant:"default",size:"sm",className:"h-7",disabled:G||!c&&!x&&!ne,onClick:te,children:G?"Applying...":`Apply to ${N==="all"?"All":N} (${se.length})`})]}),D&&N!=="codex"&&e.jsxs("div",{className:"pt-2 border-t border-border space-y-2",children:[e.jsxs("span",{className:"text-xs font-medium text-muted-foreground",children:["Claude-only fields ",N==="all"&&"(applied to claude agents only)",":"]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:V,children:"Color:"}),e.jsx("select",{className:ee,value:E,onChange:a=>w(a.target.value),children:xs.map(a=>e.jsx("option",{value:a,children:a||"—"},a))})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:V,children:"Permission:"}),e.jsx("select",{className:ee,value:F,onChange:a=>u(a.target.value),children:ds.map(a=>e.jsx("option",{value:a,children:a||"—"},a))})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:V,children:"Memory:"}),e.jsx("select",{className:ee,value:v,onChange:a=>k(a.target.value),children:ms.map(a=>e.jsx("option",{value:a,children:a||"—"},a))})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:V,children:"MaxTurns:"}),e.jsx(P,{className:"h-7 text-xs w-[60px]",type:"number",value:h,onChange:a=>H(a.target.value),placeholder:"—"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:V,children:"Background:"}),e.jsxs("select",{className:ee,value:C,onChange:a=>M(a.target.value),children:[e.jsx("option",{value:"",children:"—"}),e.jsx("option",{value:"true",children:"true"}),e.jsx("option",{value:"false",children:"false"})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:V,children:"Isolation:"}),e.jsx("select",{className:ee,value:O,onChange:a=>W(a.target.value),children:us.map(a=>e.jsx("option",{value:a,children:a||"—"},a))})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1 flex-1 min-w-[200px]",children:[e.jsx("span",{className:V,children:"Tools:"}),e.jsx(P,{className:"h-7 text-xs flex-1",value:A,onChange:a=>b(a.target.value),placeholder:"Read, Write, Bash, Glob, Grep"})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-1 min-w-[200px]",children:[e.jsx("span",{className:V,children:"Disallowed:"}),e.jsx(P,{className:"h-7 text-xs flex-1",value:y,onChange:a=>l(a.target.value),placeholder:"e.g. Edit"})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-1 min-w-[200px]",children:[e.jsx("span",{className:V,children:"Skills:"}),e.jsx(P,{className:"h-7 text-xs flex-1",value:g,onChange:a=>m(a.target.value),placeholder:"e.g. api-conventions"})]})]})]})]}),n?e.jsx("div",{className:"text-center text-sm text-muted-foreground py-8",children:"Loading agents..."}):s.length===0?e.jsx("div",{className:"text-center text-sm text-muted-foreground py-8",children:"No agent definitions found. Install CCW to a project first."}):e.jsx("div",{className:"space-y-4",children:Object.entries(ce).map(([a,S])=>e.jsx(ka,{installationPath:a,agents:S,onSaved:Z},a))})]})}function Sa(){const s=document.cookie.match(/XSRF-TOKEN=([^;]+)/);return s?decodeURIComponent(s[1]):null}function ss({value:s,onChange:t,placeholder:n}){const[r,c]=i.useState(!1),[d,x]=i.useState(null),p=Vt(s,500);i.useEffect(()=>{if(p){c(!0),x(null);const f=setTimeout(()=>{p.trim().length>0?x(null):x("Path cannot be empty."),c(!1)},1e3);return()=>clearTimeout(f)}else x(null),c(!1)},[p]);const N=async()=>{const{selectFile:f}=await pt(async()=>{const{selectFile:F}=await import("./index-Dff4bg3u.js").then(u=>u.gf);return{selectFile:F}},__vite__mapDeps([0,1])),E=s?s.replace(/[/\\][^/\\]*$/,""):void 0,w=await f(E);w.path&&!w.cancelled&&!w.error&&t(w.path)};return e.jsxs("div",{children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(P,{value:s,onChange:f=>t(f.target.value),placeholder:n,className:$("flex-1",d&&"border-destructive")}),r&&e.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3",children:e.jsx(gt,{className:"h-4 w-4 animate-spin text-muted-foreground"})})]}),e.jsx(j,{type:"button",variant:"outline",size:"sm",className:"shrink-0 h-9",onClick:N,title:"Browse",children:e.jsx(ft,{className:"w-4 h-4"})})]}),d&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:d})]})}const Ta=new Set(["gemini","qwen","opencode"]),Ma=new Set(["claude"]);function hs(s){return Ta.has(s)?"envFile":Ma.has(s)?"settingsFile":"none"}function Ea({toolId:s,config:t,isDefault:n,isExpanded:r,toolAvailable:c,isSaving:d,onToggleExpand:x,onToggleEnabled:p,onSetDefault:N,onUpdateModel:f,onUpdateTags:E,onUpdateAvailableModels:w,onUpdateEnvFile:F,onUpdateSettingsFile:u,onUpdateEffort:v,onSaveToBackend:k}){const{formatMessage:h}=J(),[H,C]=i.useState(""),[M,O]=i.useState(""),W=()=>{const m=H.trim();m&&!t.tags.includes(m)&&(E([...t.tags,m]),C(""))},A=m=>{E(t.tags.filter(D=>D!==m))},b=()=>{const m=M.trim(),D=t.availableModels||[];m&&!D.includes(m)&&(w([...D,m]),O(""))},y=m=>{const D=t.availableModels||[];w(D.filter(_=>_!==m))},l=["分析","Debug","implementation","refactoring","testing"],g=hs(s);return e.jsxs(Y,{className:$("overflow-hidden",!t.enabled&&"opacity-60"),children:[e.jsxs("div",{className:"p-4 cursor-pointer hover:bg-muted/50 transition-colors",onClick:x,children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:$("p-2 rounded-lg",t.enabled?"bg-primary/10":"bg-muted"),children:e.jsx(ns,{className:$("w-5 h-5",t.enabled?"text-primary":"text-muted-foreground")})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-foreground capitalize",children:s}),n&&e.jsx(Q,{variant:"default",className:"text-xs",children:h({id:"settings.cliTools.default"})}),e.jsx(Q,{variant:"outline",className:"text-xs",children:t.type}),c!==void 0&&e.jsx("span",{className:$("inline-block w-2 h-2 rounded-full",c?"bg-green-500":"bg-red-400"),title:c?"Available":"Unavailable"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:t.primaryModel})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{variant:t.enabled?"default":"outline",size:"sm",className:"h-8",onClick:m=>{m.stopPropagation(),p()},children:t.enabled?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-1"}),h({id:"settings.cliTools.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"w-4 h-4 mr-1"}),h({id:"settings.cliTools.disabled"})]})}),r?e.jsx(He,{className:"w-5 h-5 text-muted-foreground"}):e.jsx(Ee,{className:"w-5 h-5 text-muted-foreground"})]})]}),t.tags&&t.tags.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:t.tags.map(m=>e.jsx(Q,{variant:"secondary",className:"text-xs",children:m},m))})]}),r&&e.jsxs("div",{className:"border-t border-border p-4 space-y-4 bg-muted/30",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:h({id:"settings.cliTools.primaryModel"})}),e.jsx(P,{value:t.primaryModel,onChange:m=>f("primaryModel",m.target.value),className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:h({id:"settings.cliTools.secondaryModel"})}),e.jsx(P,{value:t.secondaryModel,onChange:m=>f("secondaryModel",m.target.value),className:"mt-1"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:h({id:"apiSettings.cliSettings.tags"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:h({id:"apiSettings.cliSettings.tagsDescription"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"flex-1 flex flex-wrap gap-1.5 p-2 border border-input bg-background rounded-md min-h-[38px] focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",children:[t.tags.map(m=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-primary/10 text-primary rounded text-xs h-6",children:[m,e.jsx("button",{type:"button",onClick:()=>A(m),className:"hover:text-destructive transition-colors","aria-label":h({id:"apiSettings.cliSettings.removeTag"}),children:e.jsx(ae,{className:"w-3 h-3"})})]},m)),e.jsx("input",{type:"text",value:H,onChange:m=>C(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),W())},placeholder:t.tags.length===0?h({id:"apiSettings.cliSettings.tagInputPlaceholder"}):"",className:"flex-1 min-w-[120px] bg-transparent border-0 outline-none text-sm placeholder:text-muted-foreground"})]}),e.jsx(j,{type:"button",size:"sm",onClick:W,variant:"outline",className:"shrink-0",children:e.jsx(Ne,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:[h({id:"apiSettings.cliSettings.predefinedTags"}),":"]}),l.map(m=>e.jsx("button",{type:"button",onClick:()=>{t.tags.includes(m)||E([...t.tags,m])},disabled:t.tags.includes(m),className:"text-xs px-2 py-0.5 rounded border border-border hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:m},m))]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:h({id:"apiSettings.cliSettings.availableModels"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"flex-1 flex flex-wrap gap-1.5 p-2 border border-input bg-background rounded-md min-h-[38px] focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",children:[(t.availableModels||[]).map(m=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-primary/10 text-primary rounded text-xs h-6",children:[m,e.jsx("button",{type:"button",onClick:()=>y(m),className:"hover:text-destructive transition-colors",children:e.jsx(ae,{className:"w-3 h-3"})})]},m)),e.jsx("input",{type:"text",value:M,onChange:m=>O(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),b())},placeholder:(t.availableModels||[]).length===0?h({id:"apiSettings.cliSettings.availableModelsPlaceholder"}):"",className:"flex-1 min-w-[120px] bg-transparent border-0 outline-none text-sm placeholder:text-muted-foreground"})]}),e.jsx(j,{type:"button",size:"sm",onClick:b,variant:"outline",className:"shrink-0",children:e.jsx(Ne,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:h({id:"apiSettings.cliSettings.availableModelsHint"})})]}),g==="envFile"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:h({id:"settings.cliTools.envFile"})}),e.jsx(ss,{value:t.envFile||"",onChange:m=>F(m||void 0),placeholder:h({id:"settings.cliTools.envFilePlaceholder"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:h({id:"settings.cliTools.envFileHint"})})]}),g==="settingsFile"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:h({id:"apiSettings.cliSettings.settingsFile"})}),e.jsx(ss,{value:t.settingsFile||"",onChange:m=>u(m||void 0),placeholder:h({id:"apiSettings.cliSettings.settingsFilePlaceholder"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:h({id:"apiSettings.cliSettings.settingsFileHint"})})]}),g==="settingsFile"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:h({id:"settings.cliTools.effort"})}),e.jsx("div",{className:"flex gap-2",children:["low","medium","high"].map(m=>{const D=t.effort||"high",_=`settings.cliTools.effort${m.charAt(0).toUpperCase()+m.slice(1)}`;return e.jsx("button",{type:"button",onClick:()=>v(m==="high"&&!t.effort?void 0:m),className:$("px-3 py-1.5 rounded-md text-sm border transition-colors",D===m?"bg-primary text-primary-foreground border-primary":"border-border hover:bg-muted"),children:h({id:_})},m)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:h({id:"settings.cliTools.effortHint"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!n&&t.enabled&&e.jsx(j,{variant:"outline",size:"sm",onClick:N,children:h({id:"settings.cliTools.setDefault"})}),e.jsxs(j,{variant:"default",size:"sm",onClick:k,disabled:d,children:[e.jsx(Fe,{className:"w-4 h-4 mr-1"}),h(d?{id:"settings.cliTools.saving"}:{id:"settings.cliTools.saveToConfig"})]})]})]})]})}function Fa(){const{formatMessage:s}=J(),{data:t,isLoading:n}=St(),{toggle:r,isPending:c}=Tt(),{data:d,isLoading:x}=Mt(),{toggle:p,isPending:N}=Et(),{data:f,isLoading:E}=Ft(),{toggle:w,isPending:F}=Pt(),{refresh:u,isPending:v}=Dt(),{exportSettings:k,isPending:h}=Ut(),{importSettings:H,isPending:C}=Lt(),M=i.useRef(null),O=i.useCallback(async()=>{try{const A=await k(),b=new Blob([JSON.stringify(A,null,2)],{type:"application/json"}),y=URL.createObjectURL(b),l=document.createElement("a"),g=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19);l.href=y,l.download=`ccw-settings-${g}.json`,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(y),B.success(s({id:"settings.responseLanguage.exportSuccess"}))}catch{B.error(s({id:"settings.responseLanguage.exportError"}))}},[k,s]),W=i.useCallback(async A=>{var y;const b=(y=A.target.files)==null?void 0:y[0];if(b){if(A.target.value="",!b.name.endsWith(".json")&&b.type!=="application/json"){B.error(s({id:"settings.responseLanguage.importInvalidFile"}));return}try{const l=await b.text(),g=JSON.parse(l);if(!g.version||!g.endpoints){B.error(s({id:"settings.responseLanguage.importInvalidStructure"}));return}const m=await H(g);m.success?B.success(s({id:"settings.responseLanguage.importSuccess"},{imported:m.imported,skipped:m.skipped})):B.error(s({id:"settings.responseLanguage.importError"}))}catch(l){l instanceof SyntaxError?B.error(s({id:"settings.responseLanguage.importInvalidJson"})):B.error(s({id:"settings.responseLanguage.importError"}))}}},[H,s]);return e.jsxs(Y,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Xt,{className:"w-5 h-5"}),s({id:"settings.sections.responseLanguage"})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.responseLanguage.chineseClaude"})}),e.jsx(Q,{variant:"default",className:"text-xs",children:"Claude"})]}),e.jsx(j,{variant:t!=null&&t.claudeEnabled?"default":"outline",size:"sm",className:"h-7",disabled:n||c,onClick:()=>r(!(t!=null&&t.claudeEnabled),"claude"),children:t!=null&&t.claudeEnabled?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.disabled"})]})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.responseLanguage.chineseClaudeDesc"})})]}),e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.responseLanguage.chineseCodex"})}),e.jsx(Q,{variant:"secondary",className:"text-xs",children:"Codex"})]}),e.jsx(j,{variant:t!=null&&t.codexEnabled?"default":"outline",size:"sm",className:"h-7",disabled:n||c,onClick:()=>r(!(t!=null&&t.codexEnabled),"codex"),children:t!=null&&t.codexEnabled?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.disabled"})]})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.responseLanguage.chineseCodexDesc"})}),(t==null?void 0:t.codexNeedsMigration)&&e.jsxs("p",{className:"text-xs text-yellow-500",children:[e.jsx(ze,{className:"w-3 h-3 inline mr-1"}),s({id:"settings.responseLanguage.migrationWarning"})]})]}),e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ct,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.responseLanguage.windowsPlatform"})})]}),e.jsx(j,{variant:d!=null&&d.enabled?"default":"outline",size:"sm",className:"h-7",disabled:x||N,onClick:()=>p(!(d!=null&&d.enabled)),children:d!=null&&d.enabled?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.disabled"})]})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.responseLanguage.windowsPlatformDesc"})})]}),e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(dt,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.responseLanguage.cliEnhancement"})}),e.jsx(Q,{variant:"secondary",className:"text-xs",children:"Codex"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[(f==null?void 0:f.enabled)&&e.jsx(j,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",disabled:E||v,onClick:()=>u(),title:s({id:"settings.responseLanguage.refreshConfig"}),children:e.jsx(ue,{className:$("w-3.5 h-3.5",v&&"animate-spin")})}),e.jsx(j,{variant:f!=null&&f.enabled?"default":"outline",size:"sm",className:"h-7",disabled:E||F,onClick:()=>w(!(f!=null&&f.enabled)),children:f!=null&&f.enabled?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.disabled"})]})})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.responseLanguage.cliEnhancementDesc"})}),(f==null?void 0:f.enabled)&&e.jsx("p",{className:"text-xs text-muted-foreground/70",children:s({id:"settings.responseLanguage.cliEnhancementHint"})})]})]}),e.jsx("div",{className:"mt-4 pt-4 border-t border-border",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.responseLanguage.exportImportHint"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{ref:M,type:"file",accept:".json,application/json",onChange:W,className:"hidden"}),e.jsx(j,{variant:"outline",size:"sm",className:"h-7",disabled:C,onClick:()=>{var A;return(A=M.current)==null?void 0:A.click()},children:C?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-3.5 h-3.5 border-2 border-border border-t-accent rounded-full animate-spin mr-1"}),s({id:"settings.responseLanguage.importing"})]}):e.jsxs(e.Fragment,{children:[e.jsx(qt,{className:"w-3.5 h-3.5 mr-1"}),s({id:"settings.responseLanguage.import"})]})}),e.jsx(j,{variant:"outline",size:"sm",className:"h-7",disabled:h,onClick:O,children:h?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-3.5 h-3.5 border-2 border-border border-t-accent rounded-full animate-spin mr-1"}),s({id:"settings.responseLanguage.exporting"})]}):e.jsxs(e.Fragment,{children:[e.jsx(mt,{className:"w-3.5 h-3.5 mr-1"}),s({id:"settings.responseLanguage.export"})]})})]})]})})]})}function Pa(){const{formatMessage:s}=J(),[t,n]=i.useState(null),[r,c]=i.useState(!1),[d,x]=i.useState(null),[p,N]=i.useState(null),[f,E]=i.useState(()=>{try{const u=localStorage.getItem("ccw.autoUpdate");return u===null?!0:JSON.parse(u)}catch{return!0}}),w=async(u=!1)=>{u||c(!0),x(null);try{const v=await fetch("/api/version-check");if(!v.ok)throw new Error(`HTTP ${v.status}`);const k=await v.json();if(!k.currentVersion)throw new Error("Invalid response");n(k),N(new Date)}catch(v){u||x(v instanceof Error?v.message:"Unknown error")}finally{c(!1)}};i.useEffect(()=>{if(w(!0),!f)return;const u=setInterval(()=>w(!0),3600*1e3);return()=>clearInterval(u)},[f]);const F=u=>{E(u),localStorage.setItem("ccw.autoUpdate",JSON.stringify(u))};return e.jsxs(Y,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(rs,{className:"w-5 h-5"}),s({id:"settings.versionCheck.title"})]}),e.jsxs(j,{variant:"outline",size:"sm",disabled:r,onClick:()=>w(),children:[e.jsx(ue,{className:$("w-3.5 h-3.5 mr-1.5",r&&"animate-spin")}),s(r?{id:"settings.versionCheck.checking"}:{id:"settings.versionCheck.checkNow"})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:s({id:"settings.versionCheck.currentVersion"})}),e.jsx(Q,{variant:"secondary",className:"font-mono text-xs",children:(t==null?void 0:t.currentVersion)??"..."})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:s({id:"settings.versionCheck.latestVersion"})}),e.jsx(Q,{variant:t!=null&&t.hasUpdate?"default":"secondary",className:"font-mono text-xs",children:(t==null?void 0:t.latestVersion)??"..."})]}),t&&e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border",children:[e.jsx("span",{className:"text-sm font-medium",children:t.hasUpdate?s({id:"settings.versionCheck.updateAvailable"}):s({id:"settings.versionCheck.upToDate"})}),e.jsx("span",{className:$("inline-block w-2.5 h-2.5 rounded-full",t.hasUpdate?"bg-orange-500":"bg-green-500")})]}),d&&e.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-border",children:[e.jsx(ze,{className:"w-4 h-4 text-destructive flex-shrink-0"}),e.jsxs("span",{className:"text-sm text-destructive",children:[s({id:"settings.versionCheck.checkFailed"}),": ",d]})]})]}),(t==null?void 0:t.hasUpdate)&&e.jsxs("div",{className:"rounded-lg border border-orange-500/30 bg-orange-500/5 p-4 space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground mb-1",children:s({id:"settings.versionCheck.updateCommand"})}),e.jsx("code",{className:"text-xs font-mono bg-muted px-3 py-1.5 rounded block",children:t.updateCommand})]}),e.jsx(j,{variant:"outline",size:"sm",asChild:!0,children:e.jsx("a",{href:"https://github.com/dyw0830/ccw/releases",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5",children:s({id:"settings.versionCheck.viewRelease"})})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:f,onChange:u=>F(u.target.checked),className:"rounded border-input"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.versionCheck.autoCheck"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.versionCheck.autoCheckDesc"})})]})]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s({id:"settings.versionCheck.lastChecked"}),":"," ",p?p.toLocaleTimeString():s({id:"settings.versionCheck.never"})]})]})]})]})}function Da(){const{formatMessage:s}=J(),{installations:t,isLoading:n,refetch:r}=It(),{upgrade:c,isPending:d}=At(),{data:x}=Ot();return e.jsxs(Y,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Wt,{className:"w-5 h-5"}),s({id:"settings.systemStatus.title"}),!n&&e.jsxs("span",{className:"text-sm font-normal text-muted-foreground",children:[t.length," ",s({id:"settings.systemStatus.installations"})]})]}),e.jsx("div",{className:"flex items-center gap-1",children:e.jsx(j,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>r(),title:s({id:"settings.systemStatus.refresh"}),children:e.jsx(ue,{className:$("w-3.5 h-3.5",n&&"animate-spin")})})})]}),n?e.jsx("div",{className:"text-sm text-muted-foreground py-4 text-center",children:s({id:"settings.systemStatus.checking"})}):t.length===0?e.jsxs("div",{className:"text-center py-6 space-y-2",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.systemStatus.noInstallations"})}),e.jsx("div",{className:"bg-muted/50 rounded-md p-3 inline-block",children:e.jsx("code",{className:"text-xs font-mono",children:"ccw install"})})]}):e.jsxs("div",{className:"space-y-3",children:[t.map(p=>{const N=p.installation_mode==="Global",f=new Date(p.installation_date).toLocaleDateString(),E=p.application_version!=="unknown"?p.application_version:p.installer_version;return e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:$("inline-flex items-center justify-center w-8 h-8 rounded-lg",N?"bg-primary/10 text-primary":"bg-orange-500/10 text-orange-500"),children:N?e.jsx(ut,{className:"w-4 h-4"}):e.jsx(Gt,{className:"w-4 h-4"})}),e.jsx("span",{className:"text-sm font-medium",children:s(N?{id:"settings.systemStatus.global"}:{id:"settings.systemStatus.path"})}),e.jsxs(Q,{variant:"secondary",className:"text-xs font-mono",children:["v",E]})]}),e.jsxs(j,{variant:"ghost",size:"sm",className:"h-7",disabled:d,onClick:()=>c(p.installation_path),children:[e.jsx(rs,{className:$("w-3.5 h-3.5 mr-1",d&&"animate-spin")}),s(d?{id:"settings.systemStatus.upgrading"}:{id:"settings.systemStatus.upgrade"})]})]}),e.jsx("div",{className:"text-xs text-muted-foreground bg-muted/50 rounded px-2 py-1 font-mono truncate",title:p.installation_path,children:p.installation_path}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(xt,{className:"w-3 h-3"}),f]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(ht,{className:"w-3 h-3"}),p.files_count," ",s({id:"settings.systemStatus.files"})]})]})]},p.manifest_id)}),x&&!x.installed&&x.missingFiles.length>0&&e.jsxs("div",{className:"rounded-lg border border-yellow-500/50 bg-yellow-500/5 p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-yellow-600 dark:text-yellow-500",children:[e.jsx(ze,{className:"w-4 h-4"}),s({id:"settings.systemStatus.incomplete"})," — ",x.missingFiles.length," ",s({id:"settings.systemStatus.missingFiles"}).toLowerCase()]}),e.jsxs("ul",{className:"text-xs text-muted-foreground list-disc list-inside",children:[x.missingFiles.slice(0,4).map(p=>e.jsx("li",{children:p},p)),x.missingFiles.length>4&&e.jsxs("li",{children:["+",x.missingFiles.length-4," more..."]})]}),e.jsxs("div",{className:"bg-muted/50 rounded-md p-2",children:[e.jsxs("p",{className:"text-xs font-medium mb-1",children:[s({id:"settings.systemStatus.runToFix"}),":"]}),e.jsx("code",{className:"text-xs font-mono bg-background px-2 py-1 rounded block",children:"ccw install"})]})]})]})]})}function Ua({cliTools:s,defaultCliTool:t,expandedTools:n,savingTools:r,onToggleExpand:c,onToggleEnabled:d,onSetDefault:x,onUpdateModel:p,onUpdateTags:N,onUpdateAvailableModels:f,onUpdateEnvFile:E,onUpdateSettingsFile:w,onUpdateEffort:F,onSaveToBackend:u,formatMessage:v}){const{data:k}=Rt();return e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:[v({id:"settings.cliTools.description"})," ",e.jsx("strong",{className:"text-foreground",children:t})]}),e.jsx("div",{className:"space-y-3",children:Object.entries(s).map(([h,H])=>{const C=k==null?void 0:k[h];return e.jsx(Ea,{toolId:h,config:H,isDefault:h===t,isExpanded:n.has(h),toolAvailable:C==null?void 0:C.available,isSaving:r.has(h),onToggleExpand:()=>c(h),onToggleEnabled:()=>d(h),onSetDefault:()=>x(h),onUpdateModel:(M,O)=>p(h,M,O),onUpdateTags:M=>N(h,M),onUpdateAvailableModels:M=>f(h,M),onUpdateEnvFile:M=>E(h,M),onUpdateSettingsFile:M=>w(h,M),onUpdateEffort:M=>F(h,M),onSaveToBackend:()=>u(h)},h)})})]})}function Ya(){const{formatMessage:s}=J(),{theme:t,setTheme:n}=Re(),r=Te(nt),c=Te(rt),d=Te(it),{updateCliTool:x,setDefaultCliTool:p,setUserPreferences:N,resetUserPreferences:f}=Te(),[E,w]=i.useState(new Set),[F,u]=i.useState(new Set),v=l=>{w(g=>{const m=new Set(g);return m.has(l)?m.delete(l):m.add(l),m})},k=l=>{x(l,{enabled:!r[l].enabled})},h=l=>{p(l)},H=(l,g,m)=>{x(l,{[g]:m})},C=(l,g)=>{x(l,{tags:g})},M=(l,g)=>{x(l,{availableModels:g})},O=(l,g)=>{x(l,{envFile:g})},W=(l,g)=>{x(l,{settingsFile:g})},A=(l,g)=>{x(l,{effort:g})},b=i.useCallback(async l=>{const g=r[l];if(g){u(m=>new Set(m).add(l));try{const m={enabled:g.enabled,primaryModel:g.primaryModel,secondaryModel:g.secondaryModel,tags:g.tags,availableModels:g.availableModels},D=hs(l);D==="envFile"?m.envFile=g.envFile||null:D==="settingsFile"&&(m.settingsFile=g.settingsFile||null,m.effort=g.effort||null);const _=Sa(),G={"Content-Type":"application/json"};_&&(G["X-CSRF-Token"]=_);const q=await fetch(`/api/cli/config/${l}`,{method:"PUT",headers:G,body:JSON.stringify(m),credentials:"same-origin"});if(!q.ok)throw new Error(`HTTP ${q.status}`);B.success(s({id:"settings.cliTools.configSaved"}),{description:l})}catch{B.error(s({id:"settings.cliTools.configSaveError"}),{description:l})}finally{u(m=>{const D=new Set(m);return D.delete(l),D})}}},[r,s]),y=(l,g)=>{N({[l]:g})};return e.jsxs("div",{className:"max-w-4xl mx-auto space-y-8",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold text-foreground flex items-center gap-2",children:[e.jsx(lt,{className:"w-6 h-6 text-primary"}),s({id:"settings.title"})]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:s({id:"settings.description"})})]}),e.jsxs(Y,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(ot,{className:"w-5 h-5"}),s({id:"settings.sections.appearance"})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground mb-1",children:s({id:"settings.appearance.theme"})}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s({id:"settings.appearance.description"})}),e.jsx(na,{})]}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-border",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.appearance.systemFollow"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.appearance.systemFollowDesc"})})]}),e.jsx(j,{variant:t==="system"?"default":"outline",size:"sm",onClick:()=>n("system"),children:s({id:"settings.appearance.themeOptions.system"})})]})]})]}),e.jsxs(Y,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(is,{className:"w-5 h-5"}),s({id:"settings.sections.language"})]}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.language.displayLanguage"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.language.chooseLanguage"})})]}),e.jsx(ia,{})]})})]}),e.jsx(Fa,{}),e.jsx(ja,{}),e.jsx(Da,{}),e.jsx(Pa,{}),e.jsxs(Y,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(ns,{className:"w-5 h-5"}),s({id:"settings.sections.cliTools"})]}),e.jsx(Ua,{cliTools:r,defaultCliTool:c,expandedTools:E,savingTools:F,onToggleExpand:v,onToggleEnabled:k,onSetDefault:h,onUpdateModel:H,onUpdateTags:C,onUpdateAvailableModels:M,onUpdateEnvFile:O,onUpdateSettingsFile:W,onUpdateEffort:A,onSaveToBackend:b,formatMessage:s})]}),e.jsx(Ca,{}),e.jsxs(Y,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(ue,{className:"w-5 h-5"}),s({id:"settings.dataRefresh.title"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.dataRefresh.autoRefresh"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.dataRefresh.autoRefreshDesc"})})]}),e.jsx(j,{variant:d.autoRefresh?"default":"outline",size:"sm",onClick:()=>y("autoRefresh",!d.autoRefresh),children:d.autoRefresh?s({id:"settings.dataRefresh.enabled"}):s({id:"settings.dataRefresh.disabled"})})]}),d.autoRefresh&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.dataRefresh.refreshInterval"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.dataRefresh.refreshIntervalDesc"})})]}),e.jsx("div",{className:"flex gap-2",children:[15e3,3e4,6e4,12e4].map(l=>e.jsxs(j,{variant:d.refreshInterval===l?"default":"outline",size:"sm",onClick:()=>y("refreshInterval",l),children:[l/1e3,"s"]},l))})]})]})]}),e.jsxs(Y,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Be,{className:"w-5 h-5"}),s({id:"settings.notifications.title"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.notifications.enableNotifications"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.notifications.enableNotificationsDesc"})})]}),e.jsx(j,{variant:d.notificationsEnabled?"default":"outline",size:"sm",onClick:()=>y("notificationsEnabled",!d.notificationsEnabled),children:d.notificationsEnabled?s({id:"settings.dataRefresh.enabled"}):s({id:"settings.dataRefresh.disabled"})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.notifications.soundEffects"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.notifications.soundEffectsDesc"})})]}),e.jsx(j,{variant:d.soundEnabled?"default":"outline",size:"sm",onClick:()=>y("soundEnabled",!d.soundEnabled),children:d.soundEnabled?s({id:"settings.notifications.on"}):s({id:"settings.notifications.off"})})]})]})]}),e.jsx(fa,{}),e.jsxs(Y,{className:"p-6 border-destructive/50",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Ye,{className:"w-5 h-5"}),s({id:"common.actions.reset"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s({id:"settings.reset.description"})}),e.jsxs(j,{variant:"destructive",onClick:()=>{confirm(s({id:"settings.reset.confirm"}))&&f()},children:[e.jsx(Ye,{className:"w-4 h-4 mr-2"}),s({id:"common.actions.resetToDefaults"})]})]})]})}export{Ya as SettingsPage,Ya as default};
|
|
150
|
-
//# sourceMappingURL=SettingsPage-BPDbXPSM.js.map
|