commandmate 0.39.0 → 0.39.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +361 -363
- package/.next/app-path-routes-manifest.json +35 -35
- package/.next/build-manifest.json +5 -5
- package/.next/prerender-manifest.json +3 -3
- package/.next/react-loadable-manifest.json +3 -3
- package/.next/required-server-files.json +1 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/release-notes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/update-check/route.js +1 -1
- package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/capabilities/route.js +1 -1
- package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
- package/.next/server/app/login/page.js +2 -2
- package/.next/server/app/login/page.js.nft.json +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
- package/.next/server/app/more/page.js +2 -2
- package/.next/server/app/more/page.js.nft.json +1 -1
- package/.next/server/app/more/page_client-reference-manifest.js +1 -1
- package/.next/server/app/offline/page.js +1 -1
- package/.next/server/app/offline/page.js.nft.json +1 -1
- package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/repositories/page.js +2 -2
- package/.next/server/app/repositories/page.js.nft.json +1 -1
- package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
- package/.next/server/app/review/page.js +1 -1
- package/.next/server/app/review/page.js.nft.json +1 -1
- package/.next/server/app/review/page_client-reference-manifest.js +1 -1
- package/.next/server/app/sessions/page.js +1 -1
- package/.next/server/app/sessions/page.js.nft.json +1 -1
- package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/[skillId]/page.js +2 -2
- package/.next/server/app/skills/[skillId]/page.js.nft.json +1 -1
- package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/installed/page.js +2 -2
- package/.next/server/app/skills/installed/page.js.nft.json +1 -1
- package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/page.js +2 -2
- package/.next/server/app/skills/page.js.nft.json +1 -1
- package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/files/[...path]/page.js +1 -1
- package/.next/server/app/worktrees/[id]/files/[...path]/page.js.nft.json +1 -1
- package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/page.js +6 -6
- package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
- package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/terminal/page.js +1 -1
- package/.next/server/app/worktrees/[id]/terminal/page.js.nft.json +1 -1
- package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +35 -35
- package/.next/server/chunks/{7086.js → 1674.js} +4 -4
- package/.next/server/chunks/3543.js +1 -1
- package/.next/server/chunks/3945.js +1 -1
- package/.next/server/chunks/4802.js +1 -1
- package/.next/server/chunks/5742.js +1 -0
- package/.next/server/chunks/{1707.js → 6092.js} +2 -2
- package/.next/server/chunks/6130.js +1 -1
- package/.next/server/chunks/8581.js +11 -11
- package/.next/server/chunks/8728.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/1642-fb2e176aaadbd137.js +1 -0
- package/.next/static/chunks/{2053-ce3fe896ad45e50f.js → 2053-611dd27d42721b79.js} +1 -1
- package/.next/static/chunks/{2407-8fe4e4d0bab1931a.js → 2407-9ac8b6188ddbb119.js} +1 -1
- package/.next/static/chunks/{3922.9c1ec01fff819c88.js → 3922.8e79fc89f593280b.js} +1 -1
- package/.next/static/chunks/6192-a67df090838b9aad.js +1 -0
- package/.next/static/chunks/8165-d3b7c8a7aa776bc7.js +1 -0
- package/.next/static/chunks/8318-01e7d1e5ad0a15a3.js +1 -0
- package/.next/static/chunks/8407-9a72e6f07c5d5458.js +1 -0
- package/.next/static/chunks/9619-7bc0e9524f0773b5.js +1 -0
- package/.next/static/chunks/982-edf98d9d54c5ce9b.js +1 -0
- package/.next/static/chunks/app/layout-542d075e9d7cc541.js +1 -0
- package/.next/static/chunks/app/login/{page-269a9de3b91a45a2.js → page-38d401f553693b03.js} +1 -1
- package/.next/static/chunks/app/more/page-30057cf1e0762ad2.js +1 -0
- package/.next/static/chunks/app/{page-0c1a29ff3609bd8b.js → page-8483ba400af011f5.js} +1 -1
- package/.next/static/chunks/app/repositories/{page-e9ceeefacf87d470.js → page-6f7511f4ac8449e2.js} +1 -1
- package/.next/static/chunks/app/review/page-8ed49e2edcc7667b.js +1 -0
- package/.next/static/chunks/app/sessions/page-56f6a2466dd0479d.js +1 -0
- package/.next/static/chunks/app/skills/[skillId]/{page-6f62668eabb635f5.js → page-ab7e432b69fccb3b.js} +1 -1
- package/.next/static/chunks/app/skills/installed/{page-c6c4ac5e26c4e73e.js → page-e000102a01a42c98.js} +1 -1
- package/.next/static/chunks/app/skills/{page-bec1d4924004d4de.js → page-56b4fa11223e0cbd.js} +1 -1
- package/.next/static/chunks/app/worktrees/[id]/files/[...path]/{page-2e98f11956fe1aea.js → page-5445205c8dd80109.js} +1 -1
- package/.next/static/chunks/app/worktrees/[id]/page-760408096ad697b4.js +1 -0
- package/.next/static/chunks/{webpack-9f75198882fdaf08.js → webpack-7e5907979c182510.js} +1 -1
- package/.next/static/css/b4aaf81d10efdd00.css +1 -0
- package/.next/trace +13 -13
- package/package.json +3 -2
- package/public/sw.js +5 -5
- package/release-notes/0.39.1.json +29 -0
- package/.next/server/chunks/366.js +0 -1
- package/.next/server/chunks/8550.js +0 -1
- package/.next/static/chunks/1032-9e43405ac6bf6848.js +0 -1
- package/.next/static/chunks/3504-0100ab50762f591b.js +0 -1
- package/.next/static/chunks/4322-f54abdc5d16b7462.js +0 -1
- package/.next/static/chunks/4949-a13ace141c0183d6.js +0 -1
- package/.next/static/chunks/5529-83e705fc4134a503.js +0 -1
- package/.next/static/chunks/6022-d2d7bd9373ff3ae9.js +0 -1
- package/.next/static/chunks/8019-cc6ac1cc033fd5f0.js +0 -1
- package/.next/static/chunks/9619-c3c4c623b0a4f681.js +0 -1
- package/.next/static/chunks/998-292ebcd30f329eb1.js +0 -1
- package/.next/static/chunks/app/layout-f43045c9edbc4d1f.js +0 -1
- package/.next/static/chunks/app/more/page-3963a5e56e550442.js +0 -1
- package/.next/static/chunks/app/review/page-3028fe95de490236.js +0 -1
- package/.next/static/chunks/app/sessions/page-3f39f99b878fdda0.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/page-0305d80c8ebda4cb.js +0 -1
- package/.next/static/css/2c63c5531f77719e.css +0 -1
- /package/.next/static/{CqFH31RhKQbrRZXsMNosJ → 7Ge9-hsqlip_Z6bhEnVkd}/_buildManifest.js +0 -0
- /package/.next/static/{CqFH31RhKQbrRZXsMNosJ → 7Ge9-hsqlip_Z6bhEnVkd}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6022],{17683:(e,t,a)=>{a.d(t,{$2:()=>d,B1:()=>x,If:()=>u,NP:()=>i,TR:()=>c,wp:()=>l});var s=a(75676);let n="commandmate.worktree.surfaceMode-",r="commandmate.settings.defaultSurfaceMode",l="/api/settings/default-surface-mode";function d(e,t){return"".concat(n).concat(e,"-split-").concat(t)}function i(e){return"".concat(n).concat(e,"-mobile")}function o(e){try{let t=window.localStorage.getItem(e);return(0,s.jg)(t)?t:null}catch(e){return null}}function u(e,t){try{window.localStorage.setItem(e,t)}catch(e){}}function c(e,t){var a;let n=void 0===t?function(){try{var e=window.location.search;if(!e)return null;try{let t=new URLSearchParams(e).get("view");return(0,s.jg)(t)?t:null}catch(e){return null}}catch(e){return null}}():t;return n?(u(e,n),n):(v||(v=!0,j()),null!=(a=o(e))?a:m())}let f=s.wf,g=new Set;function m(){var e;return null!=(e=o(r))?e:f}function x(e){if(!(0,s.jg)(e))return!1;let t=m()!==e;if(f=e,u(r,e),t)for(let e of g)e();return t}let p=null,h=!1,v=!1;async function j(){return h?m():p||("function"!=typeof fetch?m():p=(async()=>{try{let e=await fetch(l);if(e.ok){let t=await e.json();x(null==t?void 0:t.defaultSurfaceMode),h=!0}}catch(e){}finally{p=null}return m()})())}},46022:(e,t,a)=>{a.d(t,{uN:()=>S,he:()=>x,$8:()=>j});var s=a(95155),n=a(12115),r=a(18955),l=a(5917),d=a(20562),i=a(8803),o=a(65229),u=a(6191),c=a(28019),f=a(54014),g=a(55449);function m(e){return!!e&&"object"==typeof e&&Array.isArray(e.defaultSelectedAgents)&&e.defaultSelectedAgents.length>0&&Array.isArray(e.available)&&e.available.length>0&&"number"==typeof e.minAgents&&"number"==typeof e.maxAgents}function x(){var e;let t=(0,r.c)("common"),[a,x]=(0,n.useState)(null),[p,h]=(0,n.useState)([]),[v,j]=(0,n.useState)(!0),[b,y]=(0,n.useState)("idle"),[N,w]=(0,n.useState)(null),S=(0,n.useCallback)(async()=>{try{let e=await fetch("".concat(g.zk,"?include=installed"));if(!e.ok)throw Error(String(e.status));let t=await e.json();if(!m(t))throw Error("unexpected body");x(t),h(t.defaultSelectedAgents),(0,g.IK)(t.defaultSelectedAgents)}catch(e){w(t("settings.defaultAgents.loadError"))}finally{j(!1)}},[t]);(0,n.useEffect)(()=>{S()},[S]);let A=(0,n.useCallback)(e=>{h(e),y("idle"),w(null)},[]),k=(0,n.useCallback)((e,t)=>{let a=e+t;if(a<0||a>=p.length)return;let s=[...p];[s[e],s[a]]=[s[a],s[e]],A(s)},[p,A]),E=(0,n.useCallback)(async e=>{y("saving"),w(null);try{let s=await fetch(g.zk,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:e})}),n=await s.json().catch(()=>null);if(!s.ok||!m(n)){var a;y("error"),w(null!=(a=null==n?void 0:n.error)?a:t("settings.defaultAgents.saveError"));return}x(e=>({...n,installed:null==e?void 0:e.installed})),h(n.defaultSelectedAgents),(0,g.IK)(n.defaultSelectedAgents),y("saved")}catch(e){y("error"),w(t("settings.defaultAgents.saveError"))}},[t]);if(v)return(0,s.jsx)(c.Zp,{children:(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,s.jsx)(c.y$,{size:"sm"}),t("loadingPage")]})});if(!a)return(0,s.jsx)(c.Zp,{children:(0,s.jsx)("div",{className:"text-sm text-danger-foreground","data-testid":"default-agents-load-error",children:null!=N?N:t("settings.defaultAgents.loadError")})});let C=null!=(e=a.installed)?e:[],M=a.available.filter(e=>!p.includes(e)),U=p.length<a.minAgents,T=p.length>a.maxAgents,I=!U&&!T&&"saving"!==b,P=e=>C.includes(e)?(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 rounded bg-success-subtle px-1.5 py-0.5 text-xs text-success-foreground","data-testid":"default-agents-installed-".concat(e),children:[(0,s.jsx)(l.A,{className:"h-3 w-3","aria-hidden":"true"}),t("settings.defaultAgents.installed")]}):(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:t("settings.defaultAgents.notInstalled")});return(0,s.jsx)(c.Zp,{children:(0,s.jsxs)("div",{className:"space-y-4","data-testid":"default-agents-settings",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium text-foreground",children:t("settings.defaultAgents.title")}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:t("settings.defaultAgents.description")}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:t("settings.defaultAgents.appliesToNew")})]}),(0,s.jsx)("ul",{className:"space-y-2","data-testid":"default-agents-selected",children:p.map((e,n)=>(0,s.jsxs)("li",{className:"flex items-center gap-2 rounded-md border border-border bg-surface px-3 py-2","data-testid":"default-agents-row-".concat(e),children:[(0,s.jsx)("span",{className:"w-6 text-xs text-muted-foreground",children:n+1}),(0,s.jsx)("span",{className:"text-sm text-foreground",children:(0,f.oo)(e)}),0===n&&(0,s.jsx)("span",{className:"rounded bg-info-subtle px-1.5 py-0.5 text-xs text-info-foreground","data-testid":"default-agents-primary-badge",children:t("settings.defaultAgents.primary")}),(0,s.jsx)("span",{className:"ml-auto",children:P(e)}),(0,s.jsx)("button",{type:"button",className:"rounded p-1 text-muted-foreground hover:bg-muted disabled:opacity-40",onClick:()=>k(n,-1),disabled:0===n,"aria-label":t("settings.defaultAgents.moveUp"),"data-testid":"default-agents-up-".concat(e),children:(0,s.jsx)(d.A,{className:"h-4 w-4","aria-hidden":"true"})}),(0,s.jsx)("button",{type:"button",className:"rounded p-1 text-muted-foreground hover:bg-muted disabled:opacity-40",onClick:()=>k(n,1),disabled:n===p.length-1,"aria-label":t("settings.defaultAgents.moveDown"),"data-testid":"default-agents-down-".concat(e),children:(0,s.jsx)(i.A,{className:"h-4 w-4","aria-hidden":"true"})}),(0,s.jsx)("button",{type:"button",className:"rounded p-1 text-muted-foreground hover:bg-muted disabled:opacity-40",onClick:()=>A(p.filter(t=>t!==e)),disabled:p.length<=a.minAgents,"aria-label":t("settings.defaultAgents.remove"),"data-testid":"default-agents-remove-".concat(e),children:(0,s.jsx)(o.A,{className:"h-4 w-4","aria-hidden":"true"})})]},e))}),M.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-2 text-xs text-muted-foreground",children:t("settings.defaultAgents.addLabel")}),(0,s.jsx)("ul",{className:"space-y-2","data-testid":"default-agents-available",children:M.map(e=>(0,s.jsxs)("li",{className:"flex items-center gap-2 rounded-md border border-border px-3 py-2",children:[(0,s.jsx)("span",{className:"text-sm text-foreground",children:(0,f.oo)(e)}),(0,s.jsx)("span",{className:"ml-auto",children:P(e)}),(0,s.jsx)("button",{type:"button",className:"rounded p-1 text-muted-foreground hover:bg-muted disabled:opacity-40",onClick:()=>A([...p,e]),disabled:p.length>=a.maxAgents,"aria-label":t("settings.defaultAgents.add"),"data-testid":"default-agents-add-".concat(e),children:(0,s.jsx)(u.A,{className:"h-4 w-4","aria-hidden":"true"})})]},e))})]}),(U||T)&&(0,s.jsx)("div",{className:"text-xs text-danger-foreground","data-testid":"default-agents-range-error",children:t("settings.defaultAgents.range",{min:a.minAgents,max:a.maxAgents})}),N&&(0,s.jsx)("div",{className:"text-xs text-danger-foreground","data-testid":"default-agents-error",children:N}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(c.$n,{size:"sm",onClick:()=>void E(p),disabled:!I,"data-testid":"default-agents-save",children:"saving"===b?t("settings.defaultAgents.saving"):t("settings.defaultAgents.save")}),(0,s.jsx)(c.$n,{size:"sm",variant:"ghost",onClick:()=>void E(null),disabled:!a.configured||"saving"===b,"data-testid":"default-agents-reset",children:t("settings.defaultAgents.reset")}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"default-agents-state",children:"saved"===b?t("settings.defaultAgents.saved"):a.configured?t("settings.defaultAgents.configured"):t("settings.defaultAgents.usingBuiltIn")})]}),a.configured&&(0,s.jsx)("div",{className:"text-xs text-muted-foreground","data-testid":"default-agents-builtin",children:t("settings.defaultAgents.builtIn",{agents:a.constantDefault.map(f.oo).join(", ")})})]})})}var p=a(17683),h=a(75676);function v(e){return!!e&&"object"==typeof e&&(0,h.jg)(e.defaultSurfaceMode)&&(0,h.jg)(e.constantDefault)&&Array.isArray(e.available)&&e.available.length>0&&e.available.every(h.jg)}function j(){var e;let t=(0,r.c)("common"),[a,l]=(0,n.useState)(null),[d,i]=(0,n.useState)(!0),[o,u]=(0,n.useState)("idle"),[f,g]=(0,n.useState)(null),m=(0,n.useCallback)(async()=>{try{let e=await fetch(p.wp);if(!e.ok)throw Error(String(e.status));let t=await e.json();if(!v(t))throw Error("unexpected body");l(t),(0,p.B1)(t.defaultSurfaceMode)}catch(e){g({kind:"load"})}finally{i(!1)}},[]);(0,n.useEffect)(()=>{m()},[m]);let x=(0,n.useCallback)(async e=>{u("saving"),g(null),l(t=>t?{...t,defaultSurfaceMode:e}:t);try{let t=await fetch(p.wp,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e})}),a=await t.json().catch(()=>null);if(!t.ok||!v(a)){u("error"),g({kind:"save",detail:null==a?void 0:a.error}),m();return}l(a),(0,p.B1)(a.defaultSurfaceMode),u("saved")}catch(e){u("error"),g({kind:"save"}),m()}},[m]),h=f?null!=(e=f.detail)?e:t("load"===f.kind?"settings.defaultSurfaceMode.loadError":"settings.defaultSurfaceMode.saveError"):null;return d?(0,s.jsx)(c.Zp,{children:(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,s.jsx)(c.y$,{size:"sm"}),t("loadingPage")]})}):a?(0,s.jsx)(c.Zp,{children:(0,s.jsxs)("div",{className:"space-y-4","data-testid":"default-surface-mode-settings",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium text-foreground",children:t("settings.defaultSurfaceMode.title")}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:t("settings.defaultSurfaceMode.description")}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:t("settings.defaultSurfaceMode.appliesToNew")})]}),(0,s.jsx)("div",{role:"radiogroup","aria-label":t("settings.defaultSurfaceMode.title"),className:"space-y-2","data-selected":a.defaultSurfaceMode,children:a.available.map(e=>(0,s.jsxs)("label",{className:"flex cursor-pointer items-start gap-2 rounded-md border border-border bg-surface px-3 py-2","data-testid":"default-surface-mode-option-".concat(e),children:[(0,s.jsx)("input",{type:"radio",name:"default-surface-mode",value:e,className:"mt-0.5",checked:a.defaultSurfaceMode===e,disabled:"saving"===o,onChange:()=>void x(e),"data-testid":"default-surface-mode-radio-".concat(e)}),(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"block text-sm text-foreground",children:t("settings.defaultSurfaceMode.mode.".concat(e))}),(0,s.jsx)("span",{className:"block text-xs text-muted-foreground",children:t("settings.defaultSurfaceMode.hint.".concat(e))})]})]},e))}),h&&(0,s.jsx)("div",{className:"text-xs text-danger-foreground","data-testid":"default-surface-mode-error",children:h}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground","data-testid":"default-surface-mode-state",children:"saving"===o?t("settings.defaultSurfaceMode.saving"):"saved"===o?t("settings.defaultSurfaceMode.saved"):a.configured?t("settings.defaultSurfaceMode.configured"):t("settings.defaultSurfaceMode.usingBuiltIn")})]})}):(0,s.jsx)(c.Zp,{children:(0,s.jsx)("div",{className:"text-sm text-danger-foreground","data-testid":"default-surface-mode-load-error",children:null!=h?h:t("settings.defaultSurfaceMode.loadError")})})}var b=a(68695),y=a(52056),N=a(48314);function w(e){let t=e.trim();if(!t)return null;try{let e=JSON.parse(t);if(!e||"object"!=typeof e)return null;let a=e.type;if("plan"!==a&&"output"!==a&&"done"!==a)return null;return e}catch(e){return null}}function S(e){var t,a,l;let{worktreeId:d,instances:i,variant:o="card"}=e,u=(0,r.c)("common"),{versions:g,isLoading:m,loadError:x,run:p,isUpdating:h,update:v}=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],[t,a]=(0,n.useState)(null),[s,r]=(0,n.useState)(!1),[l,d]=(0,n.useState)(e),[i,o]=(0,n.useState)(null),[u,c]=(0,n.useState)(!1),f=(0,n.useRef)(!0);(0,n.useEffect)(()=>(f.current=!0,()=>{f.current=!1}),[]);let g=(0,n.useCallback)(async function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e){d(!0);try{let e=await fetch("/api/agents/versions".concat(t?"?refresh=1":""));if(!e.ok)throw Error(String(e.status));let s=await e.json();if(!(s&&"object"==typeof s&&Array.isArray(s.tools)&&Array.isArray(s.updatable)))throw Error("unexpected body");if(!f.current)return;a(s.tools),r(!1)}catch(e){if(!f.current)return;r(!0)}finally{f.current&&d(!1)}}},[e]);(0,n.useEffect)(()=>{g(!1)},[g]);let m=(0,n.useCallback)(async e=>{if(u)return;c(!0),o({tool:e,command:null,output:"",ok:null,previousVersion:null,installed:null,error:null});let t=e=>{f.current&&o(t=>t?{...t,ok:!1,error:e}:t)};try{var a,s;let n=await fetch("/api/agents/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:e})});if(!n.ok||!n.body){let e=await n.json().catch(()=>null);t(null!=(a=null==e?void 0:e.error)?a:"Request failed (".concat(n.status,")"));return}let r=n.body.getReader(),l=new TextDecoder,d="",i=e=>{f.current&&o(t=>{var a;return t?"plan"===e.type?{...t,command:e.command}:"output"===e.type?{...t,output:t.output+e.text}:{...t,ok:e.ok,previousVersion:e.previousVersion,installed:e.installed,error:null!=(a=e.error)?a:null}:t})};for(;;){let{done:e,value:t}=await r.read();if(e)break;let a=(d+=l.decode(t,{stream:!0})).split("\n");for(let e of(d=null!=(s=a.pop())?s:"",a)){let t=w(e);t&&i(t)}}let u=w(d);u&&i(u)}catch(e){t(e instanceof Error?e.message:String(e))}finally{f.current&&c(!1),await g(!0)}},[u,g]);return{versions:t,isLoading:l,loadError:s,run:i,isUpdating:u,reload:g,update:m}}(!0),[j,S]=(0,n.useState)(0),A=function(e,t,a){let[s,r]=(0,n.useState)({});return(0,n.useEffect)(()=>{if(!e||!t||0===t.length)return void r({});let a=!1;return(async()=>{try{let t=await fetch("/api/worktrees/".concat(e));if(!t.ok)return;let s=await t.json();if(a)return;let n=s.sessionStatusByInstance,l={};for(let[e,t]of Object.entries(null!=n?n:{}))(null==t?void 0:t.isRunning)&&(l[e]=!0);r(l)}catch(e){}})(),()=>{a=!0}},[e,t,a]),s}(d,i,j),[k,E]=(0,n.useState)({}),[C,M]=(0,n.useState)(null),U=(0,n.useRef)(null);(0,n.useEffect)(()=>{U.current&&(U.current.scrollTop=U.current.scrollHeight)},[null==p?void 0:p.output]);let T=(null==p?void 0:p.ok)===!0;(0,n.useEffect)(()=>{T&&S(e=>e+1)},[T]);let I=(0,n.useCallback)(e=>(null!=i?i:[]).filter(t=>t.cliTool===e&&A[t.id]),[i,A]),P=(0,n.useCallback)(async e=>{if(d){M(null);try{let t=new URLSearchParams({cliTool:e.cliTool,instance:e.id}),a=await fetch("/api/worktrees/".concat(d,"/kill-session?").concat(t.toString()),{method:"POST"});if(!a.ok&&404!==a.status)throw Error(String(a.status));E(t=>({...t,[e.id]:!0})),S(e=>e+1)}catch(e){M(u("agentUpdates.restartError"))}}},[d,u]),z=m&&!g?(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,s.jsx)(c.y$,{size:"sm"}),u("loadingPage")]}):x&&!g?(0,s.jsx)("div",{className:"text-sm text-danger-foreground","data-testid":"agent-updates-load-error",children:u("agentUpdates.loadError")}):(0,s.jsxs)("div",{className:"space-y-3","data-testid":"agent-updates",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium text-foreground",children:u("agentUpdates.title")}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:u("agentUpdates.description")})]}),(0,s.jsx)("ul",{className:"space-y-2","data-testid":"agent-updates-rows",children:(null!=g?g:[]).map(e=>{var t,a;let n=I(e.tool),r=e.updatable&&null!==e.installed;return(0,s.jsxs)("li",{className:"rounded-md border border-border bg-surface px-3 py-2","data-testid":"agent-updates-row-".concat(e.tool),children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-sm text-foreground",children:(a=e.tool,(0,f.oo)(a)||a)}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"agent-updates-installed-".concat(e.tool),children:e.installed?u("agentUpdates.installed",{version:e.installed}):u("agentUpdates.notInstalled")}),e.updateAvailable&&(0,s.jsx)("span",{className:"rounded bg-info-subtle px-1.5 py-0.5 text-xs text-info-foreground","data-testid":"agent-updates-available-".concat(e.tool),children:u("agentUpdates.available",{version:null!=(t=e.latestVersion)?t:""})}),e.dismissedInCodex&&(0,s.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"agent-updates-dismissed-".concat(e.tool),children:u("agentUpdates.dismissed")}),r&&(0,s.jsxs)(c.$n,{size:"sm",className:"ml-auto",disabled:h,onClick:()=>void v(e.tool),"data-testid":"agent-updates-update-".concat(e.tool),children:[(0,s.jsx)(b.A,{className:"h-4 w-4","aria-hidden":"true"}),h&&(null==p?void 0:p.tool)===e.tool?u("agentUpdates.updating"):u("agentUpdates.update")]})]}),r&&n.length>0&&(0,s.jsxs)("div",{className:"mt-2 flex items-start gap-1 text-xs text-warning-foreground","data-testid":"agent-updates-restart-warning-".concat(e.tool),children:[(0,s.jsx)(y.A,{className:"mt-0.5 h-3 w-3 shrink-0","aria-hidden":"true"}),(0,s.jsx)("span",{children:u("agentUpdates.restartWarning",{sessions:n.map(e=>e.alias).join(", ")})})]}),r&&0===n.length&&void 0===d&&(0,s.jsx)("p",{className:"mt-2 text-xs text-muted-foreground","data-testid":"agent-updates-restart-notice-".concat(e.tool),children:u("agentUpdates.restartNotice")}),T&&(null==p?void 0:p.tool)===e.tool&&n.map(e=>(0,s.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,s.jsxs)(c.$n,{size:"sm",variant:"ghost",disabled:k[e.id],onClick:()=>void P(e),"data-testid":"agent-updates-restart-".concat(e.id),children:[(0,s.jsx)(N.A,{className:"h-4 w-4","aria-hidden":"true"}),u("agentUpdates.restart",{alias:e.alias})]}),k[e.id]&&(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:u("agentUpdates.restarted")})]},e.id))]},e.tool)})}),p&&(0,s.jsxs)("div",{className:"space-y-2","data-testid":"agent-updates-run",children:[p.command&&(0,s.jsx)("div",{className:"text-xs text-muted-foreground","data-testid":"agent-updates-command",children:u("agentUpdates.running",{command:p.command})}),p.output&&(0,s.jsx)("pre",{ref:U,"data-testid":"agent-updates-output",className:"max-h-48 overflow-auto whitespace-pre-wrap rounded-md bg-terminal-surface p-2 text-xs text-terminal-foreground",children:p.output}),!0===p.ok&&(0,s.jsx)("div",{className:"text-xs text-success-foreground","data-testid":"agent-updates-success",children:u("agentUpdates.succeeded",{from:null!=(t=p.previousVersion)?t:"?",to:null!=(a=p.installed)?a:"?"})}),!1===p.ok&&(0,s.jsx)("div",{className:"text-xs text-danger-foreground","data-testid":"agent-updates-failure",children:u("agentUpdates.failed",{error:null!=(l=p.error)?l:""})})]}),C&&(0,s.jsx)("div",{className:"text-xs text-danger-foreground","data-testid":"agent-updates-restart-error",children:C})]});return"plain"===o?z:(0,s.jsx)(c.Zp,{children:z})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8019],{3005:(e,t,a)=>{a.d(t,{y:()=>o});var r=a(95155);a(12115);var n=a(87531);let s={xs:"h-3 w-3",sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-8 w-8"},i={current:"",accent:"text-accent-600 dark:text-accent-400",muted:"text-muted-foreground"};function o(e){let{size:t="md",variant:a="current",className:o,...l}=e;return(0,r.jsxs)("svg",{className:(0,n.cn)("animate-spin",s[t],i[a],o),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",...l,children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}},5590:(e,t,a)=>{a.d(t,{j:()=>o,p:()=>l});var r=a(95155),n=a(12115),s=a(83101),i=a(87531);let o=(0,s.F)("flex w-full rounded-md border border-input bg-surface dark:bg-surface-2 text-surface-foreground shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:border-ring disabled:cursor-not-allowed disabled:opacity-50",{variants:{inputSize:{sm:"h-8 px-2.5 py-1 text-sm",md:"px-3 py-2 text-sm",lg:"px-4 py-2.5 text-base"}},defaultVariants:{inputSize:"md"}}),l=n.forwardRef((e,t)=>{let{className:a,inputSize:n,type:s="text",...l}=e;return(0,r.jsx)("input",{ref:t,type:s,className:(0,i.cn)(o({inputSize:n}),a),...l})});l.displayName="Input"},9286:(e,t,a)=>{a.d(t,{O:()=>n});var r=a(12115);function n(e,t){let[a,n]=(0,r.useState)(e?"open":"closed");return e&&"open"!==a?n("open"):e||"open"!==a||n("exiting"),(0,r.useEffect)(()=>{if(e||"exiting"!==a)return;let r=setTimeout(()=>{n("closed")},t);return()=>clearTimeout(r)},[e,a,t]),{shouldRender:e||"closed"!==a,isExiting:!e&&"exiting"===a}}},9900:(e,t,a)=>{a.d(t,{$B:()=>d,I2:()=>s,LK:()=>o,Ys:()=>l,pX:()=>r,s7:()=>n,tX:()=>i});let r=2e3,n=1500,s=2e3,i=150,o=100,l=200,d=100},17848:(e,t,a)=>{a.d(t,{n:()=>n});var r=a(95155);function n(e){let{className:t="w-3.5 h-3.5",color:a}=e;return(0,r.jsx)("svg",{className:"".concat(t," flex-shrink-0"),viewBox:"0 0 24 24",fill:null!=a?a:"none",stroke:a?"none":"currentColor",strokeWidth:2*!a,"aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})}},25840:(e,t,a)=>{a.d(t,{T:()=>i});var r=a(95155),n=a(12115),s=a(87531);let i=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)("textarea",{ref:t,className:(0,s.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-surface dark:bg-surface-2 px-3 py-2 text-sm text-surface-foreground shadow-sm","placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:border-ring","disabled:cursor-not-allowed disabled:opacity-50",a),...n})});i.displayName="Textarea"},26232:(e,t,a)=>{a.d(t,{Hr:()=>b,Ht:()=>x,SQ:()=>f,_2:()=>m,lp:()=>g,mB:()=>p,rI:()=>c,ty:()=>u});var r=a(95155),n=a(12115),s=a(47971),i=a(5917),o=a(99051),l=a(59854),d=a(87531);let c=s.bL,u=s.l9;s.YJ;let f=n.forwardRef((e,t)=>{let{className:a,sideOffset:n=4,...i}=e;return(0,r.jsx)(s.ZL,{children:(0,r.jsx)(s.UC,{ref:t,sideOffset:n,style:{zIndex:l.M.POPOVER},className:(0,d.cn)("min-w-[8rem] overflow-hidden rounded-md border border-border bg-surface p-1 text-surface-foreground shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...i})})});f.displayName="DropdownMenuContent";let m=n.forwardRef((e,t)=>{let{className:a,inset:n,...i}=e;return(0,r.jsx)(s.q7,{ref:t,className:(0,d.cn)("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none","focus:bg-muted focus:text-surface-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",a),...i})});m.displayName="DropdownMenuItem",n.forwardRef((e,t)=>{let{className:a,children:n,checked:o,...l}=e;return(0,r.jsxs)(s.H_,{ref:t,checked:o,className:(0,d.cn)("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-muted focus:text-surface-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...l,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(s.VF,{children:(0,r.jsx)(i.A,{size:16,"aria-hidden":"true"})})}),n]})}).displayName="DropdownMenuCheckboxItem";let x=n.forwardRef((e,t)=>{let{className:a,children:n,...i}=e;return(0,r.jsxs)(s.hN,{ref:t,className:(0,d.cn)("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-muted focus:text-surface-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...i,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(s.VF,{children:(0,r.jsx)(o.A,{size:8,className:"fill-current","aria-hidden":"true"})})}),n]})});x.displayName="DropdownMenuRadioItem";let b=s.z6,g=n.forwardRef((e,t)=>{let{className:a,inset:n,...i}=e;return(0,r.jsx)(s.JU,{ref:t,className:(0,d.cn)("px-2 py-1.5 text-xs font-semibold text-muted-foreground",n&&"pl-8",a),...i})});g.displayName="DropdownMenuLabel";let p=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.wv,{ref:t,className:(0,d.cn)("-mx-1 my-1 h-px bg-border",a),...n})});p.displayName="DropdownMenuSeparator"},28019:(e,t,a)=>{a.d(t,{Ex:()=>s.E,$n:()=>r.$,Zp:()=>n.Zp,Wu:()=>n.Wu,aR:()=>n.aR,ZB:()=>n.ZB,Sc:()=>b.S,TM:()=>d.TM,nF:()=>i.n,pd:()=>c.p,Jh:()=>l.a,z6:()=>y,CU:()=>j,l6:()=>O,gC:()=>P,eb:()=>V,bq:()=>I,yv:()=>D,EA:()=>f.E,y$:()=>m.y,md:()=>o.m,dO:()=>x.d,tU:()=>C,av:()=>z,j7:()=>R,Xi:()=>E,k_:()=>u.T,j1:()=>c.j,SC:()=>d.SC});var r=a(31166),n=a(47972),s=a(52799),i=a(17848),o=a(48481),l=a(94465),d=a(36402),c=a(5590),u=a(25840),f=a(40051),m=a(3005),x=a(91758),b=a(32209),g=a(95155),p=a(12115),h=a(24058),v=a(99051),w=a(87531);let y=p.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,g.jsx)(h.bL,{ref:t,className:(0,w.cn)("grid gap-2",a),...r})});y.displayName="RadioGroup";let j=p.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,g.jsx)(h.q7,{ref:t,className:(0,w.cn)("aspect-square h-4 w-4 shrink-0 cursor-pointer rounded-full border border-input bg-surface text-accent-600 shadow-sm","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:border-accent-600",a),...r,children:(0,g.jsx)(h.C1,{className:"flex items-center justify-center",children:(0,g.jsx)(v.A,{className:"h-2 w-2 fill-accent-600 text-accent-600","aria-hidden":"true"})})})});j.displayName="RadioGroupItem";var N=a(25667);let k=p.createContext("underline"),C=p.forwardRef((e,t)=>{let{variant:a="underline",...r}=e;return(0,g.jsx)(k.Provider,{value:a,children:(0,g.jsx)(N.bL,{ref:t,...r})})});C.displayName="Tabs";let R=p.forwardRef((e,t)=>{let{className:a,...r}=e,n=p.useContext(k);return(0,g.jsx)(N.B8,{ref:t,className:(0,w.cn)("inline-flex items-center","pill"===n?"gap-1 rounded-lg bg-muted p-1":"gap-4 border-b border-border",a),...r})});R.displayName="TabsList";let E=p.forwardRef((e,t)=>{let{className:a,...r}=e,n=p.useContext(k);return(0,g.jsx)(N.l9,{ref:t,className:(0,w.cn)("inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50","pill"===n?"rounded-md px-3 py-1.5 text-muted-foreground data-[state=active]:bg-surface data-[state=active]:text-surface-foreground data-[state=active]:shadow-sm":"-mb-px border-b-2 border-transparent px-1 py-2 text-muted-foreground hover:text-foreground data-[state=active]:border-accent-500 data-[state=active]:text-accent-600",a),...r})});E.displayName="TabsTrigger";let z=p.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,g.jsx)(N.UC,{ref:t,className:(0,w.cn)("mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",a),...r})});z.displayName="TabsContent";var L=a(55644),M=a(24033),T=a(12108),A=a(5917),S=a(59854);let O=L.bL;L.YJ;let D=L.WT,I=p.forwardRef((e,t)=>{let{className:a,children:r,...n}=e;return(0,g.jsxs)(L.l9,{ref:t,className:(0,w.cn)("flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-surface dark:bg-surface-2 px-3 py-2 text-sm text-surface-foreground shadow-sm","placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:border-ring","disabled:cursor-not-allowed disabled:opacity-50","[&>span]:line-clamp-1",a),...n,children:[r,(0,g.jsx)(L.In,{asChild:!0,children:(0,g.jsx)(M.A,{size:16,className:"opacity-60","aria-hidden":"true"})})]})});I.displayName="SelectTrigger";let P=p.forwardRef((e,t)=>{let{className:a,children:r,position:n="popper",...s}=e;return(0,g.jsx)(L.ZL,{children:(0,g.jsxs)(L.UC,{ref:t,position:n,style:{zIndex:S.M.POPOVER},className:(0,w.cn)("relative max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-hidden rounded-md border border-border bg-surface text-surface-foreground shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",a),...s,children:[(0,g.jsx)(L.PP,{className:"flex h-6 items-center justify-center",children:(0,g.jsx)(T.A,{size:16,"aria-hidden":"true"})}),(0,g.jsx)(L.LM,{className:(0,w.cn)("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,g.jsx)(L.wn,{className:"flex h-6 items-center justify-center",children:(0,g.jsx)(M.A,{size:16,"aria-hidden":"true"})})]})})});P.displayName="SelectContent",p.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,g.jsx)(L.JU,{ref:t,className:(0,w.cn)("px-2 py-1.5 text-xs font-semibold text-muted-foreground",a),...r})}).displayName="SelectLabel";let V=p.forwardRef((e,t)=>{let{className:a,children:r,...n}=e;return(0,g.jsxs)(L.q7,{ref:t,className:(0,w.cn)("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-muted focus:text-surface-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...n,children:[(0,g.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,g.jsx)(L.VF,{children:(0,g.jsx)(A.A,{size:16,"aria-hidden":"true"})})}),(0,g.jsx)(L.p4,{children:r})]})});V.displayName="SelectItem",p.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,g.jsx)(L.wv,{ref:t,className:(0,w.cn)("-mx-1 my-1 h-px bg-border",a),...r})}).displayName="SelectSeparator";var K=a(47520);K.Kq,K.bL,K.l9,p.forwardRef((e,t)=>{let{className:a,sideOffset:r=4,children:n,...s}=e;return(0,g.jsx)(K.ZL,{children:(0,g.jsxs)(K.UC,{ref:t,sideOffset:r,style:{zIndex:S.M.POPOVER},className:(0,w.cn)("overflow-hidden rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background shadow-md","animate-in fade-in-0 zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...s,children:[n,(0,g.jsx)(K.i3,{className:"fill-foreground"})]})})}).displayName="TooltipContent",a(26232),a(79651)},31166:(e,t,a)=>{a.d(t,{$:()=>l});var r=a(95155);a(12115);var n=a(83101),s=a(87531),i=a(3005);let o=(0,n.F)("inline-flex items-center justify-center px-4 py-2 rounded-md font-medium transition-all duration-200 touch-manipulation focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background",{variants:{variant:{primary:"bg-accent-600 dark:bg-accent-500 text-white hover:bg-accent-700 dark:hover:bg-accent-600",secondary:"bg-muted text-foreground hover:bg-muted/80",danger:"bg-danger text-white hover:bg-danger/90",ghost:"bg-transparent text-foreground hover:bg-muted"},size:{sm:"px-3 py-1.5 text-sm",md:"",lg:"px-6 py-3 text-lg"},fullWidth:{true:"w-full",false:""}},defaultVariants:{variant:"primary",size:"md",fullWidth:!1}});function l(e){let{variant:t="primary",size:a="md",fullWidth:n=!1,loading:l=!1,disabled:d,className:c="",children:u,...f}=e,m=d||l,x=(0,s.cn)(o({variant:t,size:a,fullWidth:n}),!m&&"motion-safe:hover:-translate-y-0.5 motion-safe:active:translate-y-0",m&&"opacity-50 cursor-not-allowed",c);return(0,r.jsxs)("button",{className:x,disabled:m,...f,children:[l&&(0,r.jsx)(i.y,{size:"sm",className:"-ml-1 mr-2"}),u]})}},32209:(e,t,a)=>{a.d(t,{S:()=>d});var r=a(95155),n=a(12115),s=a(38162),i=a(7125),o=a(5917),l=a(87531);let d=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.bL,{ref:t,className:(0,l.cn)("peer inline-flex h-4 w-4 shrink-0 cursor-pointer items-center justify-center rounded-sm border border-input bg-surface text-surface-foreground shadow-sm transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:border-accent-600 data-[state=checked]:bg-accent-600 data-[state=checked]:text-white","data-[state=indeterminate]:border-accent-600 data-[state=indeterminate]:bg-accent-600 data-[state=indeterminate]:text-white",a),...n,children:(0,r.jsx)(s.C1,{className:"flex items-center justify-center text-current",children:"indeterminate"===n.checked?(0,r.jsx)(i.A,{className:"h-3 w-3",strokeWidth:3,"aria-hidden":"true"}):(0,r.jsx)(o.A,{className:"h-3 w-3",strokeWidth:3,"aria-hidden":"true"})})})});d.displayName="Checkbox"},36402:(e,t,a)=>{a.d(t,{SC:()=>f,TM:()=>l,aF:()=>c});var r=a(95155),n=a(12115),s=a(18955),i=a(94465),o=a(31166);function l(e){let{isOpen:t,title:a,description:n,confirmLabel:l,cancelLabel:d,variant:c="default",onConfirm:u,onCancel:f}=e,m=(0,s.c)("common"),x="danger"===c;return(0,r.jsx)(i.a,{isOpen:t,onClose:f,title:null!=a?a:m("confirmDialog.title"),size:"sm",showCloseButton:!1,children:(0,r.jsxs)("div",{className:"space-y-4","data-testid":"confirm-dialog",children:[(0,r.jsx)("p",{className:"text-sm text-foreground whitespace-pre-line",children:n}),(0,r.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,r.jsx)(o.$,{type:"button",variant:"secondary",size:"sm",autoFocus:x,onClick:f,"data-testid":"confirm-dialog-cancel",children:null!=d?d:m("cancel")}),(0,r.jsx)(o.$,{type:"button",variant:x?"danger":"primary",size:"sm",autoFocus:!x,onClick:u,"data-testid":"confirm-dialog-confirm",children:null!=l?l:m("confirmDialog.confirm")})]})]})})}let d=(0,n.createContext)(null);function c(e){var t,a;let{children:s}=e,[i,o]=(0,n.useState)(null),c=(0,n.useRef)(null),u=(0,n.useRef)(null);(0,n.useEffect)(()=>{i&&(u.current=i.options)},[i]);let f=null!=(t=null==i?void 0:i.options)?t:u.current,m=(0,n.useCallback)(e=>new Promise(t=>{c.current=document.activeElement instanceof HTMLElement?document.activeElement:null,o(a=>(null==a||a.resolve(!1),{options:e,resolve:t}))}),[]),x=(0,n.useCallback)(e=>{var t;o(t=>(null==t||t.resolve(e),null)),null==(t=c.current)||t.focus(),c.current=null},[]);return(0,r.jsxs)(d.Provider,{value:m,children:[s,(0,r.jsx)(l,{isOpen:null!==i,title:null==f?void 0:f.title,description:null!=(a=null==f?void 0:f.description)?a:"",confirmLabel:null==f?void 0:f.confirmLabel,cancelLabel:null==f?void 0:f.cancelLabel,variant:null==f?void 0:f.variant,onConfirm:()=>x(!0),onCancel:()=>x(!1)})]})}let u=async()=>!1;function f(){var e;return null!=(e=(0,n.useContext)(d))?e:u}},40051:(e,t,a)=>{a.d(t,{E:()=>s});var r=a(95155);a(12115);var n=a(87531);function s(e){let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,n.cn)("animate-pulse rounded-md bg-muted",t),"aria-hidden":"true",...a})}},47972:(e,t,a)=>{a.d(t,{Wu:()=>c,ZB:()=>d,Zp:()=>o,aR:()=>l});var r=a(95155);a(12115);var n=a(83101),s=a(87531);let i=(0,n.F)("bg-surface text-surface-foreground rounded-lg border border-border shadow-sm",{variants:{variant:{default:"",elevated:"bg-gradient-to-b from-surface to-surface-2 shadow-md",interactive:"cursor-pointer transition-all duration-200 hover:border-accent-500 hover:shadow-md motion-safe:hover:-translate-y-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:border-accent-500 focus-visible:shadow-md motion-safe:focus-visible:-translate-y-0.5"},hover:{true:"transition-shadow duration-200 hover:shadow-md",false:""},interactive:{true:"cursor-pointer transition-all duration-200 hover:shadow-lg active:shadow-md motion-safe:hover:-translate-y-0.5 motion-safe:active:translate-y-0",false:""},padding:{none:"",sm:"p-3",md:"p-4",lg:"p-6"}},defaultVariants:{variant:"default",hover:!1,interactive:!1,padding:"md"}});function o(e){let{variant:t="default",hover:a=!1,interactive:n=!1,padding:o="md",className:l="",children:d,...c}=e;return(0,r.jsx)("div",{className:(0,s.cn)(i({variant:t,hover:a,interactive:n,padding:o}),l),...c,children:d})}function l(e){let{className:t="",children:a,...n}=e;return(0,r.jsx)("div",{className:(0,s.cn)("mb-3",t),...n,children:a})}function d(e){let{className:t="",children:a,...n}=e;return(0,r.jsx)("h3",{className:(0,s.cn)("text-lg font-semibold text-surface-foreground",t),...n,children:a})}function c(e){let{className:t="",children:a,...n}=e;return(0,r.jsx)("div",{className:(0,s.cn)(t),...n,children:a})}},48481:(e,t,a)=>{a.d(t,{m:()=>u});var r=a(95155);a(12115);var n=a(18955),s=a(87531);let i={idle:{colorClass:"bg-muted-foreground",labelKey:"status.idle"},ready:{colorClass:"bg-success",labelKey:"status.ready"},running:{colorClass:"bg-success text-success ring-2 ring-success/40",animationClass:"animate-status-glow",labelKey:"status.running"},generating:{colorClass:"bg-success text-success ring-2 ring-success/40",animationClass:"animate-status-glow",labelKey:"status.generating"},waiting:{colorClass:"bg-warning text-warning ring-4 ring-warning/50",animationClass:"animate-status-attention",labelKey:"status.waiting"},error:{colorClass:"bg-danger",labelKey:"status.error"}},o={colorClass:"bg-warning text-warning ring-2 ring-warning/40",animationClass:"animate-status-glow",labelKey:"status.waiting"},l=new Set(["menu","unclassified"]),d={colorClass:"bg-muted-foreground",labelKey:"status.unknown"},c={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"};function u(e){let{status:t,size:a="md",label:u,waitingKind:f,className:m,...x}=e,b=(0,n.c)("common"),g=function(e,t){var a;let r=null!=(a=i[e])?a:d;return"waiting"!==e?r:t&&l.has(t)?o:r}(t,f),p=null!=u?u:b(g.labelKey);return(0,r.jsx)("span",{className:(0,s.cn)("inline-block flex-shrink-0 rounded-full",c[a],g.colorClass,g.animationClass,m),title:p,"aria-label":p,...x})}},52799:(e,t,a)=>{a.d(t,{E:()=>l});var r=a(95155);a(12115);var n=a(83101),s=a(87531);let i=(0,n.F)("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",{variants:{variant:{success:"bg-success-subtle text-success-foreground",warning:"bg-warning-subtle text-warning-foreground",error:"bg-danger-subtle text-danger-foreground",info:"bg-accent-100 dark:bg-accent-900 text-accent-800 dark:text-accent-300",gray:"bg-muted text-muted-foreground"}},defaultVariants:{variant:"gray"}}),o={success:"bg-success",warning:"bg-warning",error:"bg-danger",info:"bg-info",gray:"bg-muted-foreground"};function l(e){let{variant:t="gray",dot:a=!1,className:n="",children:l,...d}=e;return(0,r.jsxs)("span",{className:(0,s.cn)(i({variant:t}),n),...d,children:[a&&(0,r.jsx)("span",{className:(0,s.cn)("mr-1.5 inline-block h-2 w-2 rounded-full",o[t]),"aria-hidden":"true"}),l]})}},59854:(e,t,a)=>{a.d(t,{M:()=>r});let r={DROPDOWN:10,SIDEBAR:30,MODAL:50,MAXIMIZED_EDITOR:55,TOAST:60,POPOVER:65,CONTEXT_MENU:70}},79651:(e,t,a)=>{a.d(t,{u:()=>s});var r=a(95155);a(12115);var n=a(87531);function s(e){let{className:t,children:a,...s}=e;return(0,r.jsx)("kbd",{className:(0,n.cn)("inline-flex h-5 min-w-[1.25rem] items-center justify-center rounded-sm border border-border bg-surface px-1","font-mono text-[10px] font-medium leading-none text-muted-foreground",t),...s,children:a})}},87531:(e,t,a)=>{a.d(t,{cn:()=>s});var r=a(2821),n=a(75889);function s(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,n.QP)((0,r.$)(t))}},91758:(e,t,a)=>{a.d(t,{d:()=>o});var r=a(95155),n=a(12115),s=a(27599),i=a(87531);let o=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.bL,{ref:t,className:(0,i.cn)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:bg-accent-600 data-[state=unchecked]:bg-muted",a),...n,children:(0,r.jsx)(s.zi,{className:(0,i.cn)("pointer-events-none block h-4 w-4 rounded-full bg-surface shadow-lg ring-0 transition-transform","data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})});o.displayName="Switch"},92539:(e,t,a)=>{a.d(t,{r:()=>n});var r=a(12115);function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{active:t=!0,initialFocus:a=!0,restoreFocus:n=!0}=e,s=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!t)return;let e=s.current;if(!e)return;let r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=null!==r&&e.contains(r);a&&!i&&(e.hasAttribute("tabindex")||e.setAttribute("tabindex","-1"),e.focus());let o=t=>{if("Tab"!==t.key)return;let a=Array.from(e.querySelectorAll('a[href],area[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),iframe,audio[controls],video[controls],[contenteditable]:not([contenteditable="false"]),[tabindex]:not([tabindex="-1"])')).filter(e=>!e.hasAttribute("hidden")&&"true"!==e.getAttribute("aria-hidden"));if(0===a.length){t.preventDefault(),e.focus();return}let r=a[0],n=a[a.length-1],s=document.activeElement instanceof HTMLElement?document.activeElement:null,i=s===e;if(!s||!e.contains(s)){t.preventDefault(),(t.shiftKey?n:r).focus();return}t.shiftKey?(s===r||i)&&(t.preventDefault(),n.focus()):(s===n||i)&&(t.preventDefault(),r.focus())};return document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o),n&&!i&&r&&document.contains(r)&&r.focus()}},[t,a,n]),s}},94465:(e,t,a)=>{a.d(t,{a:()=>x});var r=a(95155),n=a(12115),s=a(47650),i=a(18955),o=a(83101),l=a(59854),d=a(9900),c=a(9286),u=a(92539),f=a(87531);let m=(0,o.F)("",{variants:{size:{sm:"max-w-[calc(100vw-2rem)] sm:max-w-md",md:"max-w-[calc(100vw-2rem)] sm:max-w-2xl",lg:"max-w-[calc(100vw-2rem)] sm:max-w-4xl",xl:"max-w-[calc(100vw-2rem)] sm:max-w-6xl",full:"max-w-[calc(100vw-2rem)] sm:max-w-[95vw]"}},defaultVariants:{size:"lg"}});function x(e){let{isOpen:t,onClose:a,title:o,children:x,size:b="lg",showCloseButton:g=!0,disableClose:p=!1}=e,h=(0,i.c)("common"),v=(0,n.useId)(),w=(0,u.r)({active:t}),{shouldRender:y,isExiting:j}=(0,c.O)(t,d.Ys),N=j?"closed":"open";return((0,n.useEffect)(()=>{if(p)return;let e=e=>{"Escape"===e.key&&t&&a()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,a,p]),(0,n.useEffect)(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[t]),y)?(0,s.createPortal)((0,r.jsxs)("div",{className:"fixed inset-0 overflow-y-auto",style:{zIndex:l.M.MODAL},children:[(0,r.jsx)("div",{"data-state":N,className:"fixed inset-0 bg-black/50 transition-opacity data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:duration-200 data-[state=closed]:fill-mode-forwards",onClick:p||j?void 0:a}),(0,r.jsx)("div",{className:"relative flex min-h-full items-center justify-center p-2 sm:p-4",children:(0,r.jsxs)("div",{ref:w,"data-state":N,"data-testid":"modal-panel",role:"dialog","aria-modal":"true","aria-labelledby":o?v:void 0,tabIndex:-1,className:(0,f.cn)("relative w-full",m({size:b}),"max-h-[calc(100vh-1rem)] sm:max-h-[calc(100vh-2rem)] flex flex-col bg-surface rounded-lg shadow-xl transform transition-all","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:duration-200","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:duration-200 data-[state=closed]:fill-mode-forwards"),children:[(o||g)&&(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-border flex-shrink-0",children:[(0,r.jsx)("h3",{id:v,className:"text-base sm:text-lg font-semibold text-foreground truncate pr-2",children:o}),g&&(0,r.jsx)("button",{onClick:a,"aria-label":h("close"),className:"text-muted-foreground hover:text-foreground transition-colors flex-shrink-0 touch-manipulation",children:(0,r.jsx)("svg",{className:"w-5 h-5 sm:w-6 sm:h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"px-4 sm:px-6 py-3 sm:py-4 overflow-y-auto flex-1 min-h-0",children:x})]})})]}),document.body):null}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9619],{18848:(e,t,n)=>{n.d(t,{Bz:()=>o,kj:()=>a,wx:()=>r}),n(95704);let r=["send","wait","capture","respond"];function a(e){let{binary:t,worktreeId:n,instanceId:r,messagePlaceholder:a}=e,o=null!=e.portPrefix&&3e3!==e.portPrefix?"CM_PORT=".concat(e.portPrefix," "):"",i="--instance ".concat(r),s="".concat(o).concat(t);return{send:"".concat(s," send ").concat(n,' "').concat(a,'" ').concat(i),wait:"".concat(s," wait ").concat(n," ").concat(i," --on-prompt human"),capture:"".concat(s," capture ").concat(n," ").concat(i),respond:"".concat(s," respond ").concat(n,' "').concat("1",'" ').concat(i)}}function o(e){let{binary:t,worktreeId:n,instanceId:r,instanceLabel:a,toolLabel:o}=e,i=null!=e.portPrefix&&3e3!==e.portPrefix?"CM_PORT=".concat(e.portPrefix," "):"",s="".concat(i).concat(t),l="--instance ".concat(r),c="ja"===e.locale?"ja":"en",u="".concat(s," capture ").concat(n," ").concat(l," --pane --tail ").concat(60),d="".concat(s," ask ").concat(n," ").concat(l,' "<request>" --async');if("ja"===c){let e="".concat(s," ask ").concat(n," ").concat(l,' "<依頼文>" --timeout ').concat(1800);return["## 別セッション「".concat(a,"」への委任"),"- 宛先: worktree `".concat(n,"` / instance `").concat(r,"`(").concat(o,")"),"- 依頼: ".concat(e)," - exit 0: 標準出力が返答本文\n - exit 10: 相手が確認待ち。標準出力のprompt JSONを私に報告して止まる(自分で答えない)\n - exit 124: タイムアウト。captureで状況を見て報告","- 待たない依頼: ".concat(d)," - 即座に relay id を返して exit 0。完了時に `[from ...]` 付きで返答が私のコンポーザーに届く"," - 状況確認: ".concat(s," relays / 取り消し: ").concat(s," relays cancel <relay-id>"),"- 進捗確認: ".concat(u),"- 禁止: respondで相手のプロンプトに答える / auto-yesを有効化する"].join("\n")}let p="".concat(s," ask ").concat(n," ").concat(l,' "<request>" --timeout ').concat(1800);return['## Delegating to session "'.concat(a,'"'),"- Target: worktree `".concat(n,"` / instance `").concat(r,"` (").concat(o,")"),"- Ask: ".concat(p)," - exit 0: stdout is the reply body\n - exit 10: they are waiting on a confirmation. Report the prompt JSON on stdout back to me and stop (do not answer it yourself)\n - exit 124: timed out. Look with capture and report what you see","- Ask without waiting: ".concat(d)," - exits 0 with a relay id on stdout; the reply lands in my composer prefixed `[from ...]` when the turn ends"," - Outstanding: ".concat(s," relays / withdraw: ").concat(s," relays cancel <relay-id>"),"- Progress: ".concat(u),"- Do not: answer their prompt with respond / turn auto-yes on"].join("\n")}},22592:(e,t,n)=>{n.d(t,{Ps:()=>d,W5:()=>u});var r=n(95155),a=n(12115),o=n(38218),i=n(68704);let s="data-pc-size",l={size:i.r5,setSize:()=>{},isMobile:!1,factor:i.d8[i.r5].factor,isAvailable:!1},c=(0,a.createContext)(l);function u(e){let{children:t}=e,{size:n,setSize:l,isAvailable:u}=(0,i.of)(),d=(0,o.a)();(0,a.useEffect)(()=>{if("undefined"==typeof document)return;let e=document.documentElement;return d?void e.removeAttribute(s):(e.setAttribute(s,n),()=>{e.removeAttribute(s)})},[n,d]);let p=(0,a.useMemo)(()=>({size:n,setSize:l,isMobile:d,factor:i.d8[n].factor,isAvailable:u}),[n,l,d,u]);return(0,r.jsx)(c.Provider,{value:p,children:t})}function d(){return(0,a.useContext)(c)}},26020:(e,t,n)=>{n.d(t,{Xn:()=>a,d9:()=>s,dI:()=>r,gB:()=>o,vK:()=>i});let r=["en","ja"],a="en",o="locale",i={en:"English",ja:"日本語"};function s(e){return"string"==typeof e&&r.includes(e)}},30061:(e,t,n)=>{n.d(t,{nR:()=>i});var r=n(95155),a=n(12115),o=n(47650);function i(e){let{content:t,delay:n=200,className:i,children:s,metadata:l}=e,c=(0,a.useRef)(null),u=(0,a.useRef)(null),d=(0,a.useRef)(null),p=(0,a.useRef)(null),[m,f]=(0,a.useState)(!1),[x,h]=(0,a.useState)({top:-9999,left:-9999}),g=(0,a.useCallback)(()=>{null!==d.current&&(clearTimeout(d.current),d.current=null)},[]),b=(0,a.useCallback)(()=>{let e=c.current;e&&(e.scrollWidth>e.clientWidth||l)&&(g(),d.current=setTimeout(()=>{let t=e.getBoundingClientRect(),n=Math.max(4,window.innerWidth-384-4);p.current={top:t.top,bottom:t.bottom},h({top:t.bottom+4,left:Math.min(t.left,n)}),f(!0),d.current=null},n))},[g,n,l]);(0,a.useLayoutEffect)(()=>{if(!m)return;let e=u.current,t=p.current;if(!e||!t)return;let{height:n}=e.getBoundingClientRect();if(n<=0)return;let r=window.innerHeight;if(t.bottom+4+n+4<=r)return;let a=t.top-4-n,o=a>=4?a:Math.max(4,r-n-4);h(e=>e.top===o?e:{...e,top:o})},[m]);let y=(0,a.useCallback)(()=>{g(),f(!1)},[g]);return(0,a.useEffect)(()=>()=>g(),[g]),(0,r.jsxs)("span",{ref:c,className:i,onMouseEnter:b,onMouseLeave:y,children:[null!=s?s:t,m&&"undefined"!=typeof document&&(0,o.createPortal)((0,r.jsxs)("span",{ref:u,role:"tooltip","aria-hidden":"true",className:"fixed z-[9999] max-w-md px-2 py-1 text-xs font-medium rounded bg-foreground text-background shadow-lg pointer-events-none",style:{top:x.top,left:x.left},children:[(0,r.jsx)("span",{className:"block break-all",children:t}),l&&(0,r.jsx)("span",{className:"mt-0.5 block whitespace-pre-line font-normal text-background/70",children:l})]}),document.body)]})}},32916:(e,t,n)=>{n.d(t,{GB:()=>u,VF:()=>d,pT:()=>p});var r=n(95155),a=n(12115),o=n(7636);let i="updatedAt",s=(0,a.createContext)(null);function l(e,t,n,r){let o=(0,a.useRef)(!0);(0,a.useEffect)(()=>{try{let t=localStorage.getItem(e);t&&r(t)}catch(e){}},[]),(0,a.useEffect)(()=>{if(o.current){o.current=!1;return}try{localStorage.setItem(e,n())}catch(e){}},[t])}function c(e,t){switch(t.type){case"TOGGLE":return{...e,isOpen:!e.isOpen};case"SET_WIDTH":return{...e,width:t.width};case"OPEN_MOBILE_DRAWER":return{...e,isMobileDrawerOpen:!0};case"CLOSE_MOBILE_DRAWER":return{...e,isMobileDrawerOpen:!1};case"SET_SORT_KEY":return{...e,sortKey:t.sortKey};case"SET_SORT_DIRECTION":return{...e,sortDirection:t.sortDirection};case"LOAD_SORT_SETTINGS":return{...e,sortKey:t.sortKey,sortDirection:t.sortDirection};case"SET_VIEW_MODE":return{...e,viewMode:t.viewMode};case"SET_OPEN":return e.isOpen===t.isOpen?e:{...e,isOpen:t.isOpen};case"SET_REPOSITORY_ORDER":return{...e,repositoryOrder:t.repositoryOrder};case"SET_REPO_TAB_BAR_MODE":return{...e,repoTabBarMode:t.repoTabBarMode};default:return e}}function u(e){let{children:t,initialOpen:n=!0,initialWidth:u=224}=e,[d,p]=(0,a.useReducer)(c,{isOpen:n,width:u,isMobileDrawerOpen:!1,sortKey:i,sortDirection:"desc",viewMode:"grouped",repositoryOrder:(0,o.ZD)(),repoTabBarMode:o.PB});l("mcbd-sidebar-sort","".concat(d.sortKey,":").concat(d.sortDirection),()=>JSON.stringify({sortKey:d.sortKey,sortDirection:d.sortDirection}),e=>{try{let t=JSON.parse(e),n=t.sortDirection,r=(0,o.Si)(t.sortKey)?t.sortKey:i;r&&("asc"===n||"desc"===n)&&p({type:"LOAD_SORT_SETTINGS",sortKey:r,sortDirection:n})}catch(e){}}),l("mcbd-sidebar-view-mode",d.viewMode,()=>d.viewMode,e=>{(0,o.$m)(e)&&p({type:"SET_VIEW_MODE",viewMode:e})}),l("mcbd-sidebar-width",d.width,()=>String(d.width),e=>{let t=Number(e);!isNaN(t)&&t>0&&p({type:"SET_WIDTH",width:288===t?224:t})}),l("mcbd-sidebar-open",d.isOpen,()=>String(d.isOpen),e=>{("true"===e||"false"===e)&&p({type:"SET_OPEN",isOpen:"true"===e})}),l("mcbd-repo-tab-bar-mode",d.repoTabBarMode,()=>d.repoTabBarMode,e=>{(0,o.m3)(e)&&p({type:"SET_REPO_TAB_BAR_MODE",repoTabBarMode:e})});let m=(0,a.useCallback)(()=>{p({type:"TOGGLE"})},[]),f=(0,a.useCallback)(e=>{p({type:"SET_WIDTH",width:e})},[]),x=(0,a.useCallback)(()=>{p({type:"OPEN_MOBILE_DRAWER"})},[]),h=(0,a.useCallback)(()=>{p({type:"CLOSE_MOBILE_DRAWER"})},[]),g=(0,a.useCallback)(e=>{p({type:"SET_SORT_KEY",sortKey:e})},[]),b=(0,a.useCallback)(e=>{p({type:"SET_SORT_DIRECTION",sortDirection:e})},[]),y=(0,a.useCallback)(e=>{p({type:"SET_VIEW_MODE",viewMode:e})},[]),w=(0,a.useCallback)(e=>{p({type:"SET_REPOSITORY_ORDER",repositoryOrder:e}),(0,o.ZC)(e)},[]),v=(0,a.useCallback)(e=>{p({type:"SET_REPO_TAB_BAR_MODE",repoTabBarMode:e})},[]),k=(0,a.useMemo)(()=>({isOpen:d.isOpen,width:d.width,isMobileDrawerOpen:d.isMobileDrawerOpen,sortKey:d.sortKey,sortDirection:d.sortDirection,toggle:m,setWidth:f,openMobileDrawer:x,closeMobileDrawer:h,setSortKey:g,setSortDirection:b,viewMode:d.viewMode,setViewMode:y,repositoryOrder:d.repositoryOrder,setRepositoryOrder:w,repoTabBarMode:d.repoTabBarMode,setRepoTabBarMode:v}),[d.isOpen,d.width,d.isMobileDrawerOpen,d.sortKey,d.sortDirection,d.viewMode,d.repositoryOrder,d.repoTabBarMode,m,f,x,h,g,b,y,w,v]);return(0,r.jsx)(s.Provider,{value:k,children:t})}function d(){let e=(0,a.useContext)(s);if(!e)throw Error("useSidebarContext must be used within a SidebarProvider");return e}function p(){return(0,a.useContext)(s)}},34681:(e,t,n)=>{n.d(t,{g:()=>s});var r=n(95155);n(12115);var a=n(18955),o=n(22592),i=n(68704);function s(){let{size:e,setSize:t,isMobile:n}=(0,o.Ps)(),s=(0,a.c)("common");if(n)return null;let l=s("displaySize.ariaLabel");return(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("label",{htmlFor:"pc-display-size",className:"sr-only",children:l}),(0,r.jsx)("select",{id:"pc-display-size","data-testid":"pc-display-size-select","aria-label":l,value:e,onChange:e=>{let n=e.target.value;(0,i.fM)(n)&&t(n)},className:"text-sm bg-transparent text-foreground border border-input rounded-md px-2 py-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:i.Uf.map(e=>(0,r.jsx)("option",{value:e,children:s("displaySize.".concat(e))},e))})]})}},41898:(e,t,n)=>{n.d(t,{m_:()=>l});var r=n(95155),a=n(12115),o=n(47650);function i(e,t,n){return Math.min(Math.max(e,4),Math.max(4,n-t-4))}let s={top:-9999,left:-9999};function l(e){let{content:t,placement:n="right",delay:l=100,children:c,className:u}=e,[d,p]=(0,a.useState)(!1),[m,f]=(0,a.useState)(!1),x=d||m,[h,g]=(0,a.useState)(null),b=(0,a.useRef)(null),y=(0,a.useRef)(null),w=(0,a.useRef)(null),v=(0,a.useCallback)(()=>{null!==w.current&&(clearTimeout(w.current),w.current=null)},[]),k=(0,a.useCallback)(()=>{v(),w.current=setTimeout(()=>{p(!0),w.current=null},l)},[l,v]),j=(0,a.useCallback)(()=>{v(),p(!1)},[v]),N=(0,a.useCallback)(()=>{f(!0)},[]),C=(0,a.useCallback)(()=>{f(!1)},[]),S=(0,a.useCallback)(()=>{v(),p(!1),f(!1)},[v]),E=(0,a.useCallback)(()=>{let e=b.current,t=y.current;if(!e||!t)return;let r=e.getBoundingClientRect(),a=t.getBoundingClientRect();g(function(e,t,n,r){let a,o,s=t.left+t.width/2-n.width/2,l=t.top+t.height/2-n.height/2;switch(e){case"top":a=t.top-n.height-8,o=s;break;case"bottom":a=t.top+t.height+8,o=s;break;case"left":a=l,o=t.left-n.width-8;break;default:a=l,o=t.left+t.width+8}return{top:i(a,n.height,r.height),left:i(o,n.width,r.width)}}(n,{top:r.top,left:r.left,width:r.width,height:r.height},{width:a.width,height:a.height},{width:window.innerWidth,height:window.innerHeight}))},[n]);return(0,a.useLayoutEffect)(()=>x?(E(),window.addEventListener("resize",E),window.addEventListener("scroll",E,!0),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0)}):void g(null),[x,E]),(0,a.useEffect)(()=>{if(!x)return;let e=e=>{"Escape"===e.key&&S()};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[x,S]),(0,a.useEffect)(()=>()=>{v()},[v]),(0,r.jsxs)("span",{ref:b,"data-testid":"tooltip-wrapper",className:u?"relative inline-flex ".concat(u):"relative inline-flex",tabIndex:-1,onMouseEnter:k,onMouseLeave:j,onFocus:N,onBlur:C,children:[c,x&&"undefined"!=typeof document&&(0,o.createPortal)((0,r.jsx)("span",{ref:y,role:"tooltip","aria-hidden":"true","data-placement":n,className:"fixed z-40 whitespace-nowrap px-2 py-1 text-xs font-medium rounded bg-foreground text-background shadow-lg pointer-events-none",style:null!=h?h:s,children:t}),document.body)]})}},45195:(e,t,n)=>{n.d(t,{g:()=>o});var r=n(36809),a=n(26020);function o(){return{currentLocale:(0,r.Ym)(),switchLocale:e=>{if(a.dI.includes(e)){let t="https:"===window.location.protocol;document.cookie="".concat(a.gB,"=").concat(e,";path=/;max-age=").concat(31536e3,";SameSite=Lax").concat(t?";Secure":""),localStorage.setItem("locale",e),window.location.reload()}}}}},45573:(e,t,n)=>{n.d(t,{P0:()=>$,oQ:()=>Q,tJ:()=>V,xk:()=>J,xq:()=>Z,yW:()=>X});var r=n(95155),a=n(12115),o=n(47650),i=n(20063),s=n(89275),l=n(36809),c=n(18955),u=n(5379),d=n(79698),p=n(66685),m=n(24533),f=n(61362),x=n(95740),h=n(37772),g=n(59427),b=n(37494),y=n(79451),w=n(89559),v=n(97470),k=n(94684),j=n(76482),N=n(39332),C=n(86651),S=n(18085),E=n(87531),T=n(59854),O=n(92614),R=n(70628),M=n(22592),D=n(66966),_=n(68704),P=n(45195),A=n(80344),I=n(48481),z=n(79651),B=n(94442),L=n(18848),K=n(54014);let F=[{key:"sessions",href:"/sessions"},{key:"repositories",href:"/repositories"},{key:"review",href:"/review"},{key:"skills",href:"/skills"},{key:"more",href:"/more"}],W={sessions:p.A,repositories:m.A,review:f.A,skills:x.A,more:h.A},G="cm.palette.recents";function H(e){if(!e||"object"!=typeof e)return!1;let{kind:t,id:n}=e;return("nav"===t||"worktree"===t||"action"===t)&&"string"==typeof n}function U(e){return e.isWaitingForResponse?"waiting":e.isProcessing?"running":e.isSessionRunning?"ready":"idle"}function V(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return!!("INPUT"===t||"TEXTAREA"===t||"SELECT"===t||e.isContentEditable||e.closest('[role="log"]'))}let Y=(0,E.cn)("flex cursor-pointer items-center gap-2 rounded-md px-2 py-2 text-sm","text-foreground","data-[selected=true]:bg-accent-500/15 data-[selected=true]:text-accent-700","dark:data-[selected=true]:text-accent-300"),q="shrink-0 text-muted-foreground";function J(){var e;if("undefined"==typeof document)return null;let t=document.querySelector("[data-instance-id]");return(null==t||null==(e=t.getAttribute("data-instance-id"))?void 0:e.trim())||null}function Q(e){var t,n;if("undefined"==typeof document)return!1;let r=Array.from(document.querySelectorAll('[data-testid="message-input-textarea"]'));if(0===r.length)return!1;let a=document.activeElement,o=null!=(n=r.find(e=>e===a))?n:r[0],i=o.value,s=""===i.trim()?e:"".concat(i,"\n\n").concat(e),l=null==(t=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,"value"))?void 0:t.set;return l?l.call(o,s):o.value=s,o.dispatchEvent(new Event("input",{bubbles:!0})),o.focus(),o.setSelectionRange(s.length,s.length),!0}async function $(e,t,n){try{let[r,a]=await Promise.all([fetch("/api/worktrees/".concat(e,"/cli-reference")),fetch("/api/worktrees/".concat(e,"/resolve-target?instance=").concat(encodeURIComponent(t.id)))]);if(!r.ok||!a.ok)return null;let[o,i]=await Promise.all([r.json(),a.json()]);return(0,L.Bz)({binary:o.binary,worktreeId:o.worktreeId,instanceId:i.instanceId,instanceLabel:t.alias,toolLabel:(0,K.oo)(i.cliToolId),portPrefix:o.portPrefix,locale:n})}catch(e){return null}}let X={ja:{heading:"委任 (/delegate)",menuItem:"委任方法をコンポーザーに挿入",inserted:"委任方法をコンポーザーに挿入しました",self:"自分自身には委任できません",noComposer:"コンポーザーが見つかりません。worktree 画面を開いてから実行してください",failed:"委任方法を作成できませんでした"},en:{heading:"Delegate (/delegate)",menuItem:"Insert delegation brief into the composer",inserted:"Delegation brief inserted into the composer",self:"That is this session — nothing to delegate to",noComposer:"No composer on screen. Open a worktree screen and try again",failed:"Could not build the delegation brief"}};function Z(){var e,t,n;let{open:p,setOpen:m}=(0,O.C)(),{setOpen:f}=(0,R.K)(),x=(0,s.Hq)(),h=(0,i.usePathname)(),L=(0,l.Ym)(),Z=(0,c.c)("commandPalette"),ee=(0,c.c)("common"),{theme:et,setTheme:en}=(0,u.D)(),{setSize:er,isMobile:ea}=(0,M.Ps)(),{currentLocale:eo,switchLocale:ei}=(0,P.g)(),es=(0,D.rC)(),{showToast:el}=(0,B.dj)(),[ec,eu]=(0,a.useState)(!1),[ed,ep]=(0,a.useState)(""),[em,ef]=(0,a.useState)([]),ex=(0,a.useRef)(null),eh=(0,a.useRef)(null),eg=(0,a.useRef)(p);(0,a.useEffect)(()=>{eg.current=p},[p]),(0,a.useEffect)(()=>{eu(!0)},[]),(0,a.useEffect)(()=>{function e(e){if(("k"===e.key||"K"===e.key)&&(e.metaKey||e.ctrlKey)){if(eg.current){e.preventDefault(),e.stopPropagation(),m(!1);return}if(V(e.target))return;e.preventDefault(),m(!0);return}"Escape"===e.key&&eg.current&&(e.preventDefault(),e.stopPropagation(),m(!1))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[m]),(0,a.useEffect)(()=>{var e,t,n,r;p?(eh.current=null!=(t=document.activeElement)?t:null,null==(e=ex.current)||e.focus(),ep(""),ef(function(){try{let e=localStorage.getItem(G);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];return t.filter(H).slice(0,8)}catch(e){return[]}}())):eh.current&&(null==(n=(r=eh.current).focus)||n.call(r),eh.current=null)},[p]);let eb=(0,a.useCallback)((e,t)=>{t&&ef(e=>(function(e,t){let n=e.filter(e=>e.kind!==t.kind||e.id!==t.id),r=[t,...n].slice(0,8);try{localStorage.setItem(G,JSON.stringify(r))}catch(e){}return r})(e,t)),m(!1),e()},[m]),ey=(0,a.useCallback)(async e=>{let t=X["ja"===L?"ja":"en"];if(function(e){let t=/^\/worktrees\/([^/?#]+)/.exec(null!=e?e:"");return t?decodeURIComponent(t[1]):null}(h)===e.worktree.id&&J()===e.instance.id)return void el(t.self,"info");let n=await $(e.worktree.id,e.instance,L);if(null===n)return void el(t.failed,"error");let r=Q(n);el(r?t.inserted:t.noComposer,r?"success":"error")},[L,h,el]),ew=(0,a.useCallback)(async()=>{try{var e;await A.Rx.sync(),await (null==es||null==(e=es.refresh)?void 0:e.call(es)),el(Z("actions.syncSuccess"),"success")}catch(e){el(Z("actions.syncError"),"error")}},[es,el,Z]),ev="dark"===et,ek=""===ed.trim(),ej=null!=(e=null==es?void 0:es.error)?e:null,eN=null!=(t=null==es?void 0:es.isLoading)&&t,eC=ej?[]:null!=(n=null==es?void 0:es.worktrees)?n:[],eS=eC.length>0,eE=!ej&&eN&&0===eC.length,eT=!function(e){let t=e.trim().toLowerCase();return""!==t&&(t.startsWith("/")||t.includes("delegate"))}(ed)?[]:function(e){let t=[];for(let r of e){var n;for(let e of(null==(n=r.agentInstances)?void 0:n.length)?r.agentInstances:r.cliToolId?[{id:r.cliToolId,cliTool:r.cliToolId,alias:(0,K.oo)(r.cliToolId),order:0}]:[])t.push({worktree:r,instance:e})}return t}(eC),eO=X["ja"===L?"ja":"en"],eR=[...eC].sort((e,t)=>{let n=+!!e.isSessionRunning,r=+!!t.isSessionRunning;if(n!==r)return r-n;let a=e.updatedAt?new Date(e.updatedAt).getTime():0;return(t.updatedAt?new Date(t.updatedAt).getTime():0)-a}),eM=ek?eR.slice(0,8):eR,eD=[{id:"theme",label:ev?Z("actions.toLight"):Z("actions.toDark"),icon:ev?g.A:b.A,run:()=>en(ev?"light":"dark")},...ea?[]:_.Uf.map(e=>({id:"displaysize:".concat(e),label:"".concat(Z("actions.displaySizePrefix"),": ").concat(ee("displaySize.".concat(e))),icon:y.A,run:()=>er(e)})),{id:"sync",label:Z("actions.syncRepositories"),icon:w.A,run:()=>{ew()}},{id:"locale",label:Z("actions.switchLanguage"),icon:v.A,run:()=>ei("ja"===eo?"en":"ja")},{id:"github",label:Z("actions.openGitHub"),icon:k.A,run:()=>window.open("https://github.com/kewton/MyCodeBranchDesk","_blank","noopener,noreferrer")},{id:"keyboardShortcuts",label:Z("actions.keyboardShortcuts"),icon:j.A,run:()=>f(!0)}],e_=ek?em.map(e=>{if("nav"===e.kind){let t=F.find(t=>t.key===e.id);if(!t)return null;let n=W[t.key],a=ee("nav.".concat(t.key));return{id:"nav-".concat(t.key),value:"recent nav ".concat(t.key),node:(0,r.jsxs)(r.Fragment,{children:[n&&(0,r.jsx)(n,{size:16,className:q,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"truncate",children:a})]}),onSelect:()=>eb(()=>x.push(t.href),{kind:"nav",id:t.key})}}if("worktree"===e.kind){let t=eC.find(t=>t.id===e.id);if(!t)return null;let n=t.repositoryDisplayName||t.repositoryName||"",a=t.branch||t.name;return{id:"worktree-".concat(t.id),value:"recent worktree ".concat(t.id),node:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(N.A,{size:16,className:q,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"truncate",children:a}),n&&(0,r.jsx)("span",{className:"ml-auto truncate pl-2 text-xs text-muted-foreground",children:n}),(0,r.jsx)(I.m,{status:U(t),size:"sm",className:n?"ml-2":"ml-auto"})]}),onSelect:()=>eb(()=>x.push("/worktrees/".concat(t.id)),{kind:"worktree",id:t.id})}}let t=eD.find(t=>t.id===e.id);if(!t)return null;let n=t.icon;return{id:"action-".concat(t.id),value:"recent action ".concat(t.id),node:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n,{size:16,className:q,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"truncate",children:t.label})]}),onSelect:()=>eb(t.run,{kind:"action",id:t.id})}}).filter(e=>null!==e):[];return ec?(0,o.createPortal)((0,r.jsx)(r.Fragment,{children:p&&(0,r.jsxs)("div",{className:"fixed inset-0 overflow-y-auto",style:{zIndex:T.M.MODAL},"data-testid":"command-palette",children:[(0,r.jsx)("div",{"data-state":"open","aria-hidden":"true",className:"fixed inset-0 bg-black/40 backdrop-blur-sm transition-opacity data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:duration-200",onClick:()=>m(!1)}),(0,r.jsx)("div",{className:"relative flex min-h-full items-start justify-center p-4 pt-[15vh]",children:(0,r.jsx)("div",{"data-state":"open","data-testid":"command-palette-panel",className:(0,E.cn)("relative w-full max-w-lg overflow-hidden rounded-xl bg-surface/95 shadow-2xl ring-1 ring-border backdrop-blur-xl","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:duration-200"),children:(0,r.jsxs)(d.uB,{label:Z("title"),className:(0,E.cn)("flex flex-col","[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:pt-2","[&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3",children:[(0,r.jsx)(C.A,{size:16,strokeWidth:2,"aria-hidden":"true",className:"shrink-0 text-muted-foreground"}),(0,r.jsx)(d.uB.Input,{ref:ex,value:ed,onValueChange:ep,placeholder:Z("placeholder"),"data-testid":"command-palette-input",className:"flex-1 bg-transparent py-3 text-sm text-foreground outline-none placeholder:text-muted-foreground"})]}),(0,r.jsxs)(d.uB.List,{className:"max-h-[min(60vh,360px)] overflow-y-auto p-2",children:[(0,r.jsx)(d.uB.Empty,{"data-testid":"command-palette-empty",className:"py-6 text-center text-sm text-muted-foreground",children:Z("empty")}),eE&&(0,r.jsx)(d.uB.Loading,{"data-testid":"command-palette-loading",className:"py-6 text-center text-sm text-muted-foreground",children:Z("loading")}),e_.length>0&&(0,r.jsx)(d.uB.Group,{heading:Z("groups.recent"),children:e_.map(e=>(0,r.jsx)(d.uB.Item,{value:e.value,onSelect:e.onSelect,className:Y,children:e.node},e.id))}),(0,r.jsx)(d.uB.Group,{heading:Z("groups.navigation"),children:F.map(e=>{let t=ee("nav.".concat(e.key)),n=W[e.key];return(0,r.jsxs)(d.uB.Item,{value:"nav ".concat(t," ").concat(e.href),onSelect:()=>eb(()=>x.push(e.href),{kind:"nav",id:e.key}),className:Y,children:[n&&(0,r.jsx)(n,{size:16,className:q,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"truncate",children:t})]},e.key)})}),eS&&(function(e){let t=new Map;for(let n of e){let e=n.repositoryDisplayName||n.repositoryName||"",r=e||"\0unnamed",a=t.get(r);a?a.worktrees.push(n):t.set(r,{key:r,repository:e,worktrees:[n]})}return[...t.values()]})(eM).map(e=>(0,r.jsx)(d.uB.Group,{heading:e.repository||Z("groups.worktrees"),children:e.worktrees.map(t=>{let n=t.branch||t.name;return(0,r.jsxs)(d.uB.Item,{value:"worktree ".concat(e.repository," ").concat(n," ").concat(t.name," ").concat(t.id),onSelect:()=>eb(()=>x.push("/worktrees/".concat(t.id)),{kind:"worktree",id:t.id}),className:Y,children:[(0,r.jsx)(N.A,{size:16,className:q,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"truncate",children:n}),(0,r.jsx)(I.m,{status:U(t),size:"sm",className:"ml-auto"})]},t.id)})},e.key)),eT.length>0&&(0,r.jsx)(d.uB.Group,{heading:eO.heading,children:eT.map(e=>{let t=e.worktree.branch||e.worktree.name;return(0,r.jsxs)(d.uB.Item,{"data-testid":"palette-delegate-".concat(e.worktree.id,"-").concat(e.instance.id),value:"/delegate ".concat(e.worktree.id," ").concat(e.instance.id," ").concat(e.instance.alias," ").concat(t),onSelect:()=>eb(()=>{ey(e)}),className:Y,children:[(0,r.jsx)(S.A,{size:16,className:q,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"truncate",children:e.instance.alias}),(0,r.jsxs)("span",{className:"ml-auto truncate pl-2 text-xs text-muted-foreground",children:[t," / ",e.instance.id]})]},"".concat(e.worktree.id,":").concat(e.instance.id))})}),(0,r.jsx)(d.uB.Group,{heading:Z("groups.actions"),children:eD.map(e=>{let t=e.icon;return(0,r.jsxs)(d.uB.Item,{value:"action ".concat(e.id," ").concat(e.label),onSelect:()=>eb(e.run,{kind:"action",id:e.id}),className:Y,children:[(0,r.jsx)(t,{size:16,className:q,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"truncate",children:e.label})]},e.id)})})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 border-t border-border bg-surface-2 px-3 py-2 text-[11px] text-muted-foreground",children:[(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)(z.u,{children:"↑"}),(0,r.jsx)(z.u,{children:"↓"}),Z("footer.navigate")]}),(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)(z.u,{children:"↵"}),Z("footer.select")]}),(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)(z.u,{children:"esc"}),Z("footer.close")]})]})]})})})]})}),document.body):null}},46892:(e,t,n)=>{n.d(t,{PL:()=>a,sb:()=>o});let r={idle:"bg-muted-foreground",ready:"bg-success",spinner:"border-info",waiting:"bg-warning"},a={idle:{className:r.idle,labelKey:"status.idle",type:"dot"},ready:{className:r.ready,labelKey:"status.ready",type:"dot"},running:{className:r.spinner,labelKey:"status.running",type:"spinner"},waiting:{className:r.waiting,labelKey:"status.waiting",type:"dot"},generating:{className:r.spinner,labelKey:"status.generating",type:"spinner"}},o={idle:"detailStatus.idle",ready:"detailStatus.ready",running:"detailStatus.running",waiting:"detailStatus.waiting"}},63470:(e,t,n)=>{n.d(t,{Y:()=>d,y2:()=>u});var r=n(95155),a=n(12115),o=n(18955),i=n(80344),s=n(36402);let l=()=>{},c=(0,a.createContext)({updateInfo:null,checking:!1,hasUpdate:!1,canSelfUpdate:!1,state:"idle",logPath:null,errorKey:null,openConfirm:l,cancel:l,confirm:async()=>{}});function u(e){var t;let{children:n}=e,l=(0,o.c)("worktree"),[u,d]=(0,a.useState)(null),[p,m]=(0,a.useState)(!0),[f,x]=(0,a.useState)("idle"),[h,g]=(0,a.useState)(null),[b,y]=(0,a.useState)(null),w=(0,a.useRef)("idle");(0,a.useEffect)(()=>{w.current=f},[f]);let v=(0,a.useRef)(!1);(0,a.useEffect)(()=>{let e=!1,t=async()=>{if("idle"===w.current)try{let t=await i.GQ.checkForUpdate();if(e)return;d(e=>"degraded"===t.status&&null!==e?e:t)}catch(e){}finally{e||m(!1)}};t();let n=setInterval(()=>{t()},36e5);return()=>{e=!0,clearInterval(n)}},[]);let k=(null==u?void 0:u.hasUpdate)===!0,j=(null==u?void 0:u.installType)==="global"||(null==u?void 0:u.installType)==="npx",N=(0,a.useCallback)(()=>{k&&j&&x(e=>"idle"===e?"confirming":e)},[k,j]),C=(0,a.useCallback)(()=>{x(e=>"confirming"===e?"idle":e)},[]),S=(0,a.useCallback)(async()=>{if("confirming"===w.current){w.current="starting",x("starting");try{let e=await i.GQ.startUpdate();g(e.logPath),x(e.willRestart?"updating":"no-restart")}catch(e){e instanceof i.hD&&400===e.status?y("update.errorNotGlobal"):e instanceof i.hD&&409===e.status?y("update.errorInProgress"):y("update.errorGeneric"),x("error")}}},[]);(0,a.useEffect)(()=>{if("updating"!==f)return;let e=!1,t=Date.now();v.current=!1;let n=setInterval(async()=>{if(e)return;if(Date.now()-t>3e5)return void x("timeout");let n=await i.GQ.ping();if(!e){if(!n){v.current=!0;return}v.current&&window.location.reload()}},2e3);return()=>{e=!0,clearInterval(n)}},[f]);let E=(0,a.useMemo)(()=>({updateInfo:u,checking:p,hasUpdate:k,canSelfUpdate:j,state:f,logPath:h,errorKey:b,openConfirm:N,cancel:C,confirm:S}),[u,p,k,j,f,h,b,N,C,S]);return(0,r.jsxs)(c.Provider,{value:E,children:[n,(0,r.jsx)(s.TM,{isOpen:"confirming"===f,title:l("update.confirmTitle"),description:l("update.confirmDescription",{version:null!=(t=null==u?void 0:u.latestVersion)?t:""}),confirmLabel:l("update.confirmButton"),onConfirm:()=>{S()},onCancel:C})]})}function d(){return(0,a.useContext)(c)}},65380:(e,t,n)=>{n.d(t,{H:()=>s,O:()=>i});var r=n(95155),a=n(12115);let o=(0,a.createContext)(!1);function i(e){let{children:t,authEnabled:n}=e;return(0,r.jsx)(o.Provider,{value:n,children:t})}function s(){return(0,a.useContext)(o)}},68704:(e,t,n)=>{n.d(t,{Uf:()=>o,d8:()=>i,fM:()=>s,of:()=>c,r5:()=>a,rq:()=>l});var r=n(2317);let a="medium",o=["large","medium","small","xsmall"],i={large:{value:"large",rootFontSizePx:18,factor:1.125,terminalFontSize:16},medium:{value:"medium",rootFontSizePx:16,factor:1,terminalFontSize:14},small:{value:"small",rootFontSizePx:14,factor:.875,terminalFontSize:12},xsmall:{value:"xsmall",rootFontSizePx:12.5,factor:.78,terminalFontSize:11}};function s(e){return"string"==typeof e&&Object.prototype.hasOwnProperty.call(i,e)}function l(e){return i[e].terminalFontSize}function c(){let{value:e,setValue:t,isAvailable:n}=(0,r.V)({key:"mcbd-pc-display-size",defaultValue:a,validate:s});return{size:e,setSize:t,isAvailable:n}}},70628:(e,t,n)=>{n.d(t,{K:()=>s,S:()=>i});var r=n(95155),a=n(12115);let o=(0,a.createContext)({open:!1,setOpen:()=>{},toggle:()=>{}});function i(e){let{children:t}=e,[n,i]=(0,a.useState)(!1),s=(0,a.useCallback)(()=>i(e=>!e),[]),l=(0,a.useMemo)(()=>({open:n,setOpen:i,toggle:s}),[n,s]);return(0,r.jsx)(o.Provider,{value:l,children:t})}function s(){return(0,a.useContext)(o)}},72137:(e,t,n)=>{n.d(t,{H:()=>p});var r=n(95155),a=n(12115),o=n(18955),i=n(68695),s=n(31166),l=n(94465),c=n(79361),u=n(63470),d=n(38218);function p(){var e,t;let n=(0,o.c)("worktree"),p=(0,d.a)(),{updateInfo:m,hasUpdate:f,canSelfUpdate:x,state:h,openConfirm:g}=(0,u.Y)(),[b,y]=(0,a.useState)(!1),w=null!=(e=null==m?void 0:m.latestVersion)?e:null;if(p||!w||"idle"===h&&!f)return null;let v="starting"===h||"updating"===h,k="no-restart"===h||"timeout"===h||"error"===h,j=n("update.buttonLabel",{version:w});return x||v||k?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.$,{type:"button",variant:"primary",size:"sm",loading:v,onClick:k?()=>y(!0):g,className:"flex-shrink-0 gap-1.5 whitespace-nowrap","aria-label":v?n("update.buttonUpdating"):n("update.buttonAriaLabel",{version:w}),"aria-haspopup":"dialog","aria-busy":v,"data-testid":"app-update-button","data-state":h,children:[!v&&(0,r.jsx)(i.A,{size:16,"aria-hidden":"true"}),(0,r.jsx)("span",{children:v?n("update.buttonUpdating"):j})]}),k&&(0,r.jsx)(l.a,{isOpen:b,onClose:()=>y(!1),title:n("update.statusDialogTitle"),size:"sm",children:(0,r.jsx)(c.V,{})})]}):(0,r.jsxs)("a",{href:null!=(t=null==m?void 0:m.releaseUrl)?t:"https://github.com/Kewton/CommandMate/releases/latest",target:"_blank",rel:"noopener noreferrer",className:"inline-flex flex-shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium bg-accent-600 dark:bg-accent-500 text-white hover:bg-accent-700 dark:hover:bg-accent-600 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":n("update.buttonReleaseAriaLabel",{version:w}),"data-testid":"app-update-button",children:[(0,r.jsx)(i.A,{size:16,"aria-hidden":"true"}),(0,r.jsx)("span",{children:j})]})}},79361:(e,t,n)=>{n.d(t,{V:()=>l});var r=n(95155),a=n(18955),o=n(63470),i=n(31166),s=n(3005);function l(){let e=(0,a.c)("worktree"),{updateInfo:t,hasUpdate:n,canSelfUpdate:l,state:c,logPath:u,errorKey:d,openConfirm:p}=(0,o.Y)();if(!t||!n&&"idle"===c)return null;let{latestVersion:m,releaseUrl:f,updateCommand:x,installType:h}=t,g="npx"===h,b=g?"npx commandmate@latest":"commandmate update";return(0,r.jsxs)("div",{className:"bg-accent-50 border border-accent-200 rounded-lg p-3 mt-2",role:"status","aria-label":e("update.available"),"data-testid":"update-notification-banner",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-accent-800 mb-1",children:e("update.available")}),m&&(0,r.jsx)("p",{className:"text-sm text-accent-700 mb-2",children:e("update.latestVersion",{version:m})}),l&&"idle"===c&&(0,r.jsx)(i.$,{variant:"primary",size:"sm",className:"mb-2",onClick:p,"data-testid":"update-now-button",children:e("update.updateNow")}),g&&"idle"===c&&(0,r.jsx)("p",{className:"text-xs text-accent-600 mb-2","data-testid":"update-npx-notice",children:e("update.npxRestartNotice")}),("starting"===c||"updating"===c)&&(0,r.jsxs)("div",{className:"mb-2","data-testid":"update-progress",children:[(0,r.jsxs)("p",{className:"flex items-center text-sm text-accent-800",children:[(0,r.jsx)(s.y,{size:"sm",className:"mr-2"}),e("starting"===c?"update.starting":"update.updating")]}),"updating"===c&&(0,r.jsx)("p",{className:"text-xs text-accent-600 mt-1",children:e("update.updatingHint")})]}),"no-restart"===c&&(0,r.jsxs)("div",{className:"mb-2","data-testid":"update-no-restart",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-accent-800",children:e("update.noRestartTitle")}),(0,r.jsx)("p",{className:"text-xs text-accent-600 mt-1",children:e("update.noRestartDescription")})]}),"timeout"===c&&(0,r.jsxs)("div",{className:"mb-2","data-testid":"update-timeout",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-accent-800",children:e("update.timeoutTitle")}),(0,r.jsx)("p",{className:"text-xs text-accent-600 mt-1",children:e("update.timeoutDescription")}),(0,r.jsx)("code",{className:"block bg-accent-100 rounded px-2 py-1 mt-1 text-xs text-accent-900 font-mono",children:b})]}),"error"===c&&(0,r.jsxs)("div",{className:"mb-2","data-testid":"update-error",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-accent-800",children:e("update.errorTitle")}),(0,r.jsx)("p",{className:"text-xs text-accent-600 mt-1",children:d?e(d):null}),(0,r.jsx)("code",{className:"block bg-accent-100 rounded px-2 py-1 mt-1 text-xs text-accent-900 font-mono",children:b})]}),u&&("no-restart"===c||"timeout"===c)&&(0,r.jsx)("p",{className:"text-xs text-accent-500 mb-2","data-testid":"update-log-hint",children:e("update.logHint",{path:u})}),x&&"global"===h&&"idle"===c&&(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("p",{className:"text-xs text-accent-600 mb-1",children:e("update.updateCommand")}),(0,r.jsx)("code",{className:"block bg-accent-100 rounded px-2 py-1 text-xs text-accent-900 font-mono",children:x})]}),f&&(0,r.jsxs)("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-sm text-accent-600 hover:text-accent-800 underline",children:[e("update.viewRelease"),(0,r.jsx)("span",{className:"ml-1","aria-hidden":"true",children:"→"})]}),(0,r.jsx)("p",{className:"text-xs text-accent-500 mt-2",children:e("update.dataPreserved")})]})}},89275:(e,t,n)=>{n.d(t,{Bo:()=>u,Hq:()=>l});var r=n(95155),a=n(12115),o=n(20063);let i={startTransition:e=>e()},s=(0,a.createContext)(null);function l(){var e;let t=(0,o.useRouter)(),{startTransition:n}=null!=(e=(0,a.useContext)(s))?e:i;return(0,a.useMemo)(()=>({push:e=>n(()=>t.push(e)),replace:e=>n(()=>t.replace(e))}),[t,n])}function c(e){let{onCommit:t}=e,n=(0,o.usePathname)(),r=(0,a.useRef)(!1);return(0,a.useEffect)(()=>{if(!r.current){r.current=!0;return}t()},[n,t]),null}function u(e){let{children:t}=e,n=(0,a.useRef)(null),o=(0,a.useCallback)(()=>{var e;null==(e=n.current)||e.call(n)},[]),i=(0,a.useCallback)(e=>{var t;t=()=>new Promise(t=>{let r=!1,a=()=>{r||(r=!0,t())};n.current=a,e(),window.setTimeout(a,500)}),"undefined"==typeof document||"function"!=typeof document.startViewTransition||"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?t():document.startViewTransition(t)},[]),l=(0,a.useMemo)(()=>({startTransition:i}),[i]);return(0,r.jsxs)(s.Provider,{value:l,children:[(0,r.jsx)(c,{onCommit:o}),t]})}},92614:(e,t,n)=>{n.d(t,{C:()=>s,E:()=>i});var r=n(95155),a=n(12115);let o=(0,a.createContext)({open:!1,setOpen:()=>{},toggle:()=>{}});function i(e){let{children:t}=e,[n,i]=(0,a.useState)(!1),s=(0,a.useCallback)(()=>i(e=>!e),[]),l=(0,a.useMemo)(()=>({open:n,setOpen:i,toggle:s}),[n,s]);return(0,r.jsx)(o.Provider,{value:l,children:t})}function s(){return(0,a.useContext)(o)}},94442:(e,t,n)=>{n.d(t,{dj:()=>v,tE:()=>w});var r=n(95155),a=n(12115),o=n(47650),i=n(18955),s=n(42529),l=n(78874),c=n(52056),u=n(23327),d=n(65229),p=n(59854),m=n(9900),f=n(9286);function x(e){let{type:t,iconColor:n}=e,a="h-5 w-5 ".concat(n);switch(t){case"success":return(0,r.jsx)(s.A,{className:a,"data-testid":"toast-icon-success"});case"error":return(0,r.jsx)(l.A,{className:a,"data-testid":"toast-icon-error"});case"warning":return(0,r.jsx)(c.A,{className:a,"data-testid":"toast-icon-warning"});default:return(0,r.jsx)(u.A,{className:a,"data-testid":"toast-icon-info"})}}function h(e){let{id:t,message:n,type:o,onClose:s,duration:l=3e3,onClick:c}=e,u=(0,i.c)("common"),p=(0,a.useRef)(null),h=function(e){switch(e){case"success":return{bgColor:"bg-success-subtle",borderColor:"border-success-border",textColor:"text-success-foreground",iconColor:"text-success-foreground"};case"error":return{bgColor:"bg-danger-subtle",borderColor:"border-danger-border",textColor:"text-danger-foreground",iconColor:"text-danger-foreground"};case"warning":return{bgColor:"bg-warning-subtle",borderColor:"border-warning-border",textColor:"text-warning-foreground",iconColor:"text-warning-foreground"};default:return{bgColor:"bg-info-subtle",borderColor:"border-info-border",textColor:"text-info-foreground",iconColor:"text-info-foreground"}}}(o),[g,b]=(0,a.useState)(!0),{shouldRender:y,isExiting:w}=(0,f.O)(g,m.Ys),v=(0,a.useRef)(s);v.current=s,(0,a.useEffect)(()=>{y||v.current(t)},[y,t]),(0,a.useEffect)(()=>(l>0&&(p.current=setTimeout(()=>{b(!1)},l)),()=>{p.current&&clearTimeout(p.current)}),[l]);let k=(0,a.useCallback)(()=>{p.current&&clearTimeout(p.current),b(!1)},[]);return(0,r.jsxs)("div",{"data-testid":"toast-".concat(t),role:"alert",className:"\n ".concat(h.bgColor,"\n ").concat(h.borderColor,"\n ").concat(h.textColor,"\n border rounded-lg shadow-lg p-4 min-w-[300px] max-w-[400px]\n flex items-start gap-3\n ").concat(w?"animate-out fade-out-0 slide-out-to-right-full duration-200 fill-mode-forwards pointer-events-none":"animate-slide-in","\n "),children:[(0,r.jsx)(x,{type:o,iconColor:h.iconColor}),c?(0,r.jsx)("button",{type:"button","data-testid":"toast-action-button",onClick:()=>{c(),k()},className:"flex-1 text-left text-sm font-medium underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:n}):(0,r.jsx)("p",{className:"flex-1 text-sm font-medium",children:n}),(0,r.jsx)("button",{"data-testid":"toast-close-button",onClick:k,"aria-label":u("closeNotification"),className:"\n ".concat(h.textColor,"\n hover:opacity-70\n focus:outline-none focus:ring-2 focus:ring-offset-2\n transition-opacity\n "),children:(0,r.jsx)(d.A,{className:"h-4 w-4"})})]})}function g(e){let{toasts:t,onClose:n}=e,[i,s]=(0,a.useState)(!1);(0,a.useEffect)(()=>{s(!0)},[]);let l=(0,r.jsx)("div",{"data-testid":"toast-container","aria-live":"polite",className:"fixed bottom-4 right-4 flex flex-col gap-2",style:{zIndex:p.M.TOAST},children:t.map(e=>(0,r.jsx)(h,{id:e.id,message:e.message,type:e.type,onClose:n,duration:e.duration,onClick:e.onClick},e.id))});return i?(0,o.createPortal)(l,document.body):null}function b(){let[e,t]=(0,a.useState)([]),n=(0,a.useRef)(0),r=(0,a.useCallback)(function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3,o=arguments.length>3?arguments[3]:void 0,i="toast-".concat(++n.current,"-").concat(Date.now()),s={id:i,message:e,type:r,duration:a,...(null==o?void 0:o.onClick)?{onClick:o.onClick}:{}};return t(e=>[...e,s]),i},[]),o=(0,a.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]),i=(0,a.useCallback)(()=>{t([])},[]);return(0,a.useMemo)(()=>({toasts:e,showToast:r,removeToast:o,clearToasts:i}),[e,r,o,i])}let y=(0,a.createContext)(null);function w(e){let{children:t}=e,n=b();return(0,r.jsxs)(y.Provider,{value:n,children:[t,(0,r.jsx)(g,{toasts:n.toasts,onClose:n.removeToast})]})}function v(){let e=(0,a.useContext)(y),t=b();return null!=e?e:t}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[998],{3199:(e,t,n)=>{n.d(t,{Vt:()=>r,aN:()=>l,zK:()=>d,I_:()=>c,JY:()=>i,sd:()=>s,kj:()=>u});let o=/^[a-zA-Z0-9][a-zA-Z0-9\-._/:]*$/,a=/^[a-zA-Z0-9][a-zA-Z0-9\-._]*$/,r=new Set(["copilot","opencode"]),l=new Set(["opencode"]);function c(e){let t=e.trim();if(!t)return{cliToolId:"claude",model:void 0};let{tokens:n,error:o}=function(e){let t=[],n="",o=!1,a=null;for(let r of e){if(a){r===a?a=null:n+=r;continue}if('"'===r||"'"===r){a=r,o=!0;continue}if(/\s/.test(r)){o&&(t.push(n),n="",o=!1);continue}n+=r,o=!0}return a?{tokens:[],error:"CLI Tool column has an unterminated quote"}:(o&&t.push(n),{tokens:t})}(t);if(o)return{cliToolId:t.split(/\s+/)[0],error:o};let a=n[0];return 1===n.length?{cliToolId:a,model:void 0}:r.has(a)?l.has(a)?function(e,t){let n={cliToolId:e},o=new Set,a=(e,n)=>{let o=t[n+1];return void 0===o||o.startsWith("-")?null:o};for(let r=0;r<t.length;r++){let l=t[r];if(o.has(l))return{cliToolId:e,error:"".concat(e,' option "').concat(l,'" is repeated')};switch(l){case"--model":case"-m":{let t=a(l,r);if(null===t)return{cliToolId:e,error:"".concat(e,' option "').concat(l,'" needs a value')};o.add("--model"),o.add("-m"),n.model=t,r++;break}case"--agent":{let t=a(l,r);if(null===t)return{cliToolId:e,error:"".concat(e,' option "').concat(l,'" needs a value')};o.add(l),n.agent=t,r++;break}case"--variant":{let t=a(l,r);if(null===t)return{cliToolId:e,error:"".concat(e,' option "').concat(l,'" needs a value')};o.add(l),n.variant=t,r++;break}case"--title":{let t=a(l,r);if(null===t)return{cliToolId:e,error:"".concat(e,' option "').concat(l,'" needs a value')};o.add(l),n.title=t,r++;break}case"--continue":case"-c":o.add("--continue"),o.add("-c"),n.continueSession=!0;break;default:return{cliToolId:e,error:"".concat(e," only supports: ").concat("opencode [--model <provider/model>] [--agent <name>] [--variant <name>] [--continue] [--title <text>]")}}}return n}(a,n.slice(1)):3===n.length&&"--model"===n[1]?{cliToolId:a,model:n[2]}:{cliToolId:a,error:"".concat(a," only supports: ").concat(a," --model <modelName>")}:{cliToolId:a,error:'CLI Tool "'.concat(a,'" does not support additional options')}}function i(e){return/[\x00-\x1f\x7f]/.test(e)?{valid:!1,reason:"Model name contains control characters"}:""===e.trim()?{valid:!1,reason:"Model name must not be empty"}:o.test(e)?e.length>128?{valid:!1,reason:"Model name exceeds ".concat(128," characters")}:{valid:!0}:{valid:!1,reason:"Model name contains invalid characters"}}function s(e,t){return/[\x00-\x1f\x7f]/.test(e)?{valid:!1,reason:"opencode ".concat(t," contains control characters")}:""===e.trim()?{valid:!1,reason:"opencode ".concat(t," must not be empty")}:a.test(e)?e.length>64?{valid:!1,reason:"opencode ".concat(t," exceeds ").concat(64," characters")}:{valid:!0}:{valid:!1,reason:"opencode ".concat(t," contains invalid characters")}}function u(e){return/[\x00-\x1f\x7f]/.test(e)?{valid:!1,reason:"opencode title contains control characters"}:""===e.trim()?{valid:!1,reason:"opencode title must not be empty"}:e.startsWith("-")?{valid:!1,reason:'opencode title must not start with "-"'}:e.includes("|")?{valid:!1,reason:'opencode title must not contain "|"'}:e.length>200?{valid:!1,reason:"opencode title exceeds ".concat(200," characters")}:{valid:!0}}function d(e){let t=[],n=c(e);if(n.error&&t.push(n.error),n.model){let e=i(n.model);e.valid||t.push(e.reason)}if(n.agent){let e=s(n.agent,"agent");e.valid||t.push(e.reason)}if(n.variant){let e=s(n.variant,"variant");e.valid||t.push(e.reason)}if(n.title){let e=u(n.title);e.valid||t.push(e.reason)}return{result:n,errors:t}}},4138:(e,t,n)=>{n.d(t,{q:()=>r});var o=n(12115),a=n(9900);function r(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.pX,[t,n]=(0,o.useState)(!1),r=(0,o.useRef)(null);return(0,o.useEffect)(()=>()=>{null!==r.current&&(clearTimeout(r.current),r.current=null)},[]),{copied:t,markCopied:(0,o.useCallback)(()=>{n(!0),null!==r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,n(!1)},e)},[e]),reset:(0,o.useCallback)(()=>{null!==r.current&&(clearTimeout(r.current),r.current=null),n(!1)},[])}}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{13533:(e,t,r)=>{"use strict";r.d(t,{AppShellGate:()=>tn});var n=r(95155),s=r(20063),a=r(12115),o=r(32916),i=r(38218);let l={showSidebar:!0,showGlobalNav:!0,showLocalNav:!1,autoCollapseSidebar:!1},c=[{prefix:"/worktrees/",config:{showGlobalNav:!1,showLocalNav:!0}},{prefix:"/sessions",config:{autoCollapseSidebar:!0}}];var d=r(22592),u=r(52619),m=r.n(u),f=r(89275);let x=(0,a.forwardRef)(function(e,t){let{href:r,onClick:a,target:o,...i}=e,l=(0,s.usePathname)(),c=(0,f.Hq)();return(0,n.jsx)(m(),{ref:t,href:r,target:o,onClick:e=>{var t;null==a||a(e),e.defaultPrevented||0!==(t=e).button||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||void 0!==o&&"_self"!==o||/^([a-z][a-z0-9+.-]*:)?\/\//i.test(r)||/^(mailto:|tel:)/i.test(r)||(e.preventDefault(),r!==l&&c.push(r))},...i})});var h=r(18955),b=r(85710),p=r(66685),g=r(61362),v=r(17787),y=r(49027),w=r(27587),j=r(39649),N=r(47650),k=r(38606),C=r(48481);let M=(0,a.memo)(function(e){let{status:t,label:r,waitingKind:s}=e;return(0,n.jsx)(C.m,{"data-testid":"status-indicator",status:t,label:r,waitingKind:s,size:"lg"})});function S(e,t,r){let n=r-8-t;return n<=8?8:Math.min(Math.max(e,8),n)}function E(e){let{id:t,branch:r,isVisible:s,anchorRef:o,nextActionLabel:i}=e,[l,c]=(0,a.useState)({top:-9999,left:-9999}),d=(0,a.useRef)(null);if((0,a.useEffect)(()=>{var e,t,r;if(!s||!o.current)return;let n=o.current.getBoundingClientRect(),a=null==(e=d.current)?void 0:e.getBoundingClientRect(),i=null!=(t=null==a?void 0:a.width)?t:0,l=null!=(r=null==a?void 0:a.height)?r:0,u=window.innerWidth,m=window.innerHeight,f=n.right+8;if(f+i>u-8){let e=n.left-8-i;e>=8&&(f=e)}c({top:S(n.top,l,m),left:S(f,i,u)})},[s,o]),"undefined"==typeof document||!s)return null;let u=Math.min(384,Math.max(0,window.innerWidth-16));return N.createPortal((0,n.jsxs)("div",{ref:d,id:t,role:"tooltip",className:" fixed z-[9999] px-3 py-2 rounded-md shadow-lg bg-sidebar text-xs text-sidebar-foreground border border-sidebar-border pointer-events-none max-w-sm transition-opacity duration-150 ",style:{top:l.top,left:l.left,maxWidth:u},children:[(0,n.jsx)("p",{className:"font-medium text-sidebar-foreground whitespace-nowrap",children:r.name}),(0,n.jsx)("p",{className:"text-sidebar-muted whitespace-nowrap",children:r.repositoryName}),(0,n.jsxs)("p",{className:"text-sidebar-muted whitespace-nowrap",children:["Status: ",r.status]}),r.worktreePath&&(0,n.jsx)("p",{className:"text-sidebar-muted truncate",children:r.worktreePath}),i&&(0,n.jsxs)("p",{className:"text-sidebar-muted whitespace-nowrap",children:["Next: ",i]}),r.description&&(0,n.jsx)("p",{className:"text-sidebar-muted mt-1 border-t border-sidebar-border pt-1 whitespace-pre-wrap break-words",children:r.description})]}),document.body)}let L=0,A=(0,a.memo)(function(e){let{branch:t,isSelected:r,onClick:s,showRepositoryName:o=!0}=e,i=(0,h.c)("common"),l=(0,h.c)("worktree"),c="tooltip-".concat(t.id),d=(0,a.useRef)(null),[u,m]=(0,a.useState)(!1),f=(0,a.useRef)(null),x=(0,a.useCallback)(()=>{null!==f.current&&(clearTimeout(f.current),f.current=null)},[]);(0,a.useEffect)(()=>()=>x(),[x]);let b=(0,k.A7)(t.cliStatus),p="waiting"===b,g=!0===t.awaitingInstruction,v=t.nextActionKey?l(t.nextActionKey):null,y=(0,a.useMemo)(()=>{var e;return new Set(null!=(e=t.exitedInstanceIds)?e:[])},[t.exitedInstanceIds]),w=(p||g)&&null!==v,j=u&&!r;return(0,a.useEffect)(()=>{r&&m(!1)},[r]),(0,a.useEffect)(()=>{if(!u)return;let e=()=>m(!1);return document.addEventListener("click",e),()=>document.removeEventListener("click",e)},[u]),(0,n.jsxs)("button",{ref:d,"data-testid":"branch-list-item",onClick:()=>{x(),L=Date.now()+400,m(!1),s()},onMouseEnter:()=>{x(),Date.now()>=L&&(f.current=setTimeout(()=>{m(!0)},150))},onMouseLeave:()=>{x(),m(!1)},onFocus:e=>{x(),e.target.matches(":focus-visible")&&(f.current=setTimeout(()=>{m(!0)},150))},onBlur:()=>{x(),m(!1)},"aria-current":r?"true":void 0,"aria-describedby":j?c:void 0,"aria-label":o?void 0:"".concat(t.name," - ").concat(t.repositoryName),className:"\n group relative w-full px-4 py-3 flex flex-col gap-1\n hover:bg-sidebar-hover transition-colors\n focus:outline-none focus:ring-2 focus:ring-inset focus:ring-ring\n ".concat(r?"bg-sidebar-hover border-l-2 border-accent-500":"border-l-2 border-transparent","\n "),children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[t.cliStatus&&Object.keys(t.cliStatus).length>0&&(0,n.jsx)("div",{className:"flex items-center justify-center flex-shrink-0 w-4","aria-label":i("branchItem.cliToolStatus"),children:(0,n.jsx)(M,{status:b,label:(0,k.dw)(t.cliStatus,t.cliStatusLabels,y.size>0?e=>y.has(e)?i("branchItem.agentExited"):null:void 0),waitingKind:t.waitingKind})}),(0,n.jsxs)("div",{className:"flex-1 min-w-0 text-left",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-sidebar-foreground truncate",children:t.name}),o&&(0,n.jsx)("p",{className:"text-xs text-sidebar-muted truncate",children:t.repositoryName}),w&&(0,n.jsx)("p",{"data-testid":"branch-next-action",className:"text-xs font-medium truncate ".concat(p?"text-warning-foreground":"text-success-foreground"),children:v})]}),g&&(0,n.jsx)("span",{"data-testid":"awaiting-instruction-badge",className:"flex-shrink-0 rounded-full bg-success-subtle px-1.5 py-0.5 text-[10px] font-medium leading-4 text-success-foreground",title:l("awaitingInstruction.label"),children:l("awaitingInstruction.badge")}),t.hasUnread&&(0,n.jsx)("span",{"data-testid":"unread-indicator",className:"w-2 h-2 rounded-full bg-accent-500 flex-shrink-0","aria-label":i("branchItem.hasUnread")})]}),t.description&&(0,n.jsx)("div",{"data-testid":"branch-description",className:"pl-6 pr-2 mt-1 text-left",children:(0,n.jsx)("p",{className:"text-xs text-sidebar-muted line-clamp-2",children:t.description})}),(0,n.jsx)(E,{id:c,branch:t,isVisible:j,anchorRef:d,nextActionLabel:v})]})});var T=r(24033),R=r(41898);function W(e,t,r){if(t<=0||r<=0)return 0;let n=e+t+8-r;return n>0?-Math.min(n,Math.max(0,e-8)):e<8?8-e:0}let z=(0,a.memo)(function(e){var t,r;let{sortKey:s,sortDirection:o,onSortKeyChange:i,onSortDirectionChange:l,options:c,defaultDirections:d,compact:u,showLabel:m=!1,directionLabels:f,tooltip:x,iconClassName:b="w-3 h-3"}=e,p=(0,h.c)("common"),[g,v]=(0,a.useState)(!1),y=(0,a.useRef)(null),w=(0,a.useRef)(null),j=(0,a.useRef)({x:0,y:0}),[N,k]=(0,a.useState)({x:0,y:0});(0,a.useEffect)(()=>{function e(e){y.current&&!y.current.contains(e.target)&&v(!1)}if(g)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[g]),(0,a.useEffect)(()=>{function e(e){"Escape"===e.key&&v(!1)}if(g)return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[g]),(0,a.useLayoutEffect)(()=>{let e=e=>{j.current=e,k(t=>t.x===e.x&&t.y===e.y?t:e)};if(!g)return void e({x:0,y:0});let t=w.current;if(!t)return;let r=t.getBoundingClientRect();e({x:W(r.left-j.current.x,r.width,window.innerWidth),y:W(r.top-j.current.y,r.height,window.innerHeight)})},[g]);let C=(0,a.useCallback)(()=>{v(e=>!e)},[]),M=(0,a.useCallback)(e=>{if(e===s)l("asc"===o?"desc":"asc");else{var t;i(e),l(null!=(t=null==d?void 0:d[e])?t:"asc")}v(!1)},[s,o,i,l,d]),S=(0,a.useCallback)(()=>{l("asc"===o?"desc":"asc")},[o,l]),E=(null==(t=c.find(e=>e.key===s))?void 0:t.label)||p("sort.label"),L=null==f||null==(r=f[s])?void 0:r[o],A=p("asc"===o?"sort.ascShort":"sort.descShort"),z=(0,n.jsx)("button",{type:"button",onClick:C,"aria-expanded":g,"aria-haspopup":"listbox","aria-label":p("sort.sortBy",{label:E}),className:m?"flex min-w-0 max-w-full items-center gap-1 rounded border border-sidebar-border px-2 py-1 text-xs text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors":"flex items-center gap-1 px-2 py-1 rounded text-xs text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors",children:m?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"min-w-0 truncate",children:E}),(0,n.jsx)(T.A,{className:"h-3 w-3 flex-shrink-0","aria-hidden":"true"})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(I,{className:b}),(0,n.jsx)("span",{className:u?"hidden":"hidden sm:inline",children:E})]})});return(0,n.jsxs)("div",{ref:y,className:m?"relative min-w-0":"relative","data-testid":"sort-selector-base",children:[(0,n.jsxs)("div",{className:m?"flex min-w-0 flex-wrap items-center gap-1":"flex items-center gap-1",children:[x?(0,n.jsx)(R.m_,{content:x,placement:"bottom",children:z}):z,(0,n.jsx)("button",{type:"button",onClick:S,"aria-label":null!=L?L:p("asc"===o?"sort.ascending":"sort.descending"),className:L?"min-w-0 max-w-full truncate rounded px-2 py-1 text-xs text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors":"p-1 rounded text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors",children:null!=L?L:"asc"===o?(0,n.jsx)(K,{className:b}):(0,n.jsx)(B,{className:b})})]}),g&&(0,n.jsx)("div",{ref:w,role:"listbox","aria-label":p("sort.options"),className:" absolute right-0 top-full mt-1 z-50 min-w-[140px] py-1 rounded-md shadow-lg bg-sidebar border border-sidebar-border ",style:0!==N.x||0!==N.y?{transform:"translate(".concat(N.x,"px, ").concat(N.y,"px)")}:void 0,children:c.map(e=>{var t,r;return(0,n.jsxs)("button",{type:"button",role:"option","aria-selected":s===e.key,onClick:()=>M(e.key),className:"\n w-full px-3 py-2 text-left text-sm whitespace-nowrap\n flex items-center justify-between gap-3\n hover:bg-sidebar-hover transition-colors\n ".concat(s===e.key?"text-accent-700 dark:text-accent-400":"text-sidebar-muted","\n "),children:[(0,n.jsx)("span",{children:e.label}),s===e.key&&(0,n.jsx)("span",{className:"text-xs",children:null!=(r=null==f||null==(t=f[e.key])?void 0:t[o])?r:A})]},e.key)})})]})});function I(e){let{className:t}=e;return(0,n.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12"})})}function K(e){let{className:t}=e;return(0,n.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}function B(e){let{className:t}=e;return(0,n.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}let P=[{key:"updatedAt",labelKey:"sort.updatedAt"},{key:"repositoryName",labelKey:"sort.repositoryName"},{key:"branchName",labelKey:"sort.branchName"},{key:"status",labelKey:"sort.status"}],D={updatedAt:"desc"},O=(0,a.memo)(function(){let{sortKey:e,sortDirection:t,setSortKey:r,setSortDirection:s}=(0,o.VF)(),i=(0,h.c)("common"),l=(0,a.useMemo)(()=>P.map(e=>{let{key:t,labelKey:r}=e;return{key:t,label:i(r)}}),[i]),c=(0,a.useMemo)(()=>({updatedAt:{asc:i("sort.direction.oldestFirst"),desc:i("sort.direction.newestFirst")},repositoryName:{asc:i("sort.direction.aToZ"),desc:i("sort.direction.zToA")},branchName:{asc:i("sort.direction.aToZ"),desc:i("sort.direction.zToA")},status:{asc:i("sort.direction.attentionFirst"),desc:i("sort.direction.attentionLast")}}),[i]);return(0,n.jsx)(z,{sortKey:e,sortDirection:t,onSortKeyChange:r,onSortDirectionChange:s,options:l,defaultDirections:D,showLabel:!0,directionLabels:c,iconClassName:"w-4 h-4"})});var F=r(28019),_=r(30061),V=r(45195),H=r(26020);function G(){let{currentLocale:e,switchLocale:t}=(0,V.g)(),r=(0,h.c)("common");return(0,n.jsx)("select",{value:e,onChange:e=>t(e.target.value),"data-testid":"locale-switcher","aria-label":r("language"),className:" w-full px-3 py-2 rounded-md bg-sidebar text-sidebar-foreground border border-sidebar-border focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent text-sm ",children:H.dI.map(e=>(0,n.jsx)("option",{value:e,children:H.vK[e]},e))})}var q=r(5379),U=r(59427),$=r(37494);function X(){let{theme:e,setTheme:t}=(0,q.D)(),[r,s]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{s(!0)},[]),!r)return(0,n.jsx)("div",{"data-testid":"theme-toggle-placeholder",className:"w-8 h-8","aria-hidden":"true"});let o="dark"===e;return(0,n.jsx)("button",{"data-testid":"theme-toggle",onClick:()=>t(o?"light":"dark"),className:"p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors focus:outline-none focus:ring-2 focus:ring-ring","aria-label":o?"Switch to light mode":"Switch to dark mode",title:o?"Switch to light mode":"Switch to dark mode",children:o?(0,n.jsx)(U.A,{className:"w-5 h-5","data-testid":"theme-icon-sun"}):(0,n.jsx)($.A,{className:"w-5 h-5","data-testid":"theme-icon-moon"})})}var Y=r(65380);function Z(){let e=(0,h.c)("auth"),t=(0,Y.H)(),[r,s]=(0,a.useState)(!1);if(!t)return null;async function o(){s(!0);try{await fetch("/api/auth/logout",{method:"POST"}),window.location.href="/login"}catch(e){window.location.href="/login"}}return(0,n.jsx)("button",{type:"button",onClick:o,disabled:r,"data-testid":"logout-button",className:" w-full px-3 py-2 text-sm text-left rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50 transition-colors ",children:r?"...":e("logout.button")})}var J=r(94442),Q=r(44308),ee=r(24373),et=r(80344),er=r(7636);function en(e){let{items:t,sortKey:r,sortDirection:n,viewMode:s,filterText:o}=e,i=(0,a.useMemo)(()=>{if(!o)return t;let e=o.toLowerCase();return t.filter(t=>t.name.toLowerCase().includes(e)||t.repositoryName.toLowerCase().includes(e))},[t,o]);return{sortedItems:(0,a.useMemo)(()=>(0,er.Xn)(i,r,n),[i,r,n]),groupedItems:(0,a.useMemo)(()=>"grouped"===s?(0,er._s)(i,r,n):[],[i,r,n,s])}}let es="mcbd-sidebar-group-collapsed",ea="mcbd-sidebar-scroll-top",eo=0,ei=(0,a.memo)(function(){var e,t,r;let i=(0,f.Hq)(),{worktrees:l,repositories:c,selectedWorktreeId:d,selectWorktree:u,refreshWorktrees:m,isLoading:x,error:w}=(0,j.$f)(),{closeMobileDrawer:N,sortKey:C,sortDirection:M,viewMode:S,setViewMode:E,repositoryOrder:L,setRepositoryOrder:T}=(0,o.VF)(),R=(0,h.c)("common"),W=null!=(e=(0,s.usePathname)())?e:"",{count:z}=(0,ee.Lv)(),[I,K]=(0,a.useState)(""),B=(0,a.useRef)(null),[P,D]=(0,a.useState)(()=>{try{let e=localStorage.getItem(es);return e?function(e){try{let t=JSON.parse(e);if("object"!=typeof t||null===t||Array.isArray(t))return{};let r={},n=0;for(let[e,s]of Object.entries(t))if(!ed.has(e)&&"boolean"==typeof s){if(++n>100)break;r[e]=s}return r}catch(e){return{}}}(e):{}}catch(e){return{}}}),_=(0,a.useRef)(!1);(0,a.useEffect)(()=>{_.current||(_.current=!0,fetch("/api/sidebar/group-order").then(e=>e.json()).then(e=>{e.success&&Array.isArray(e.order)&&T(e.order)}).catch(()=>{}))},[T]);let V=(0,a.useMemo)(()=>(0,er.UZ)(c),[c]),H=(0,a.useMemo)(()=>(0,er.s6)(l,V),[l,V]),q=(0,a.useMemo)(()=>H.map(k.XK),[H]),U=(0,a.useDeferredValue)(q),$=(0,a.useRef)(null),Y=(0,a.useRef)(null),[J,et]=(0,a.useState)(0);(0,a.useEffect)(()=>()=>{null!==Y.current&&clearTimeout(Y.current)},[]);let ei=(0,a.useCallback)(()=>{null!==Y.current&&(clearTimeout(Y.current),Y.current=null),$.current=null},[]),eu=(0,a.useMemo)(()=>{let e=$.current;return!e||0===e.items.length||Date.now()>=e.expiresAt?U:e.items},[U,J]),eh=(0,a.useRef)(eu);(0,a.useLayoutEffect)(()=>{eh.current=eu;let e=$.current;e&&0===e.items.length&&U.length>0&&ei()});let eb=(0,a.useCallback)(()=>{if(0===eh.current.length)return;null!==Y.current&&(clearTimeout(Y.current),Y.current=null);let e=$.current;if(e&&Date.now()<e.expiresAt){$.current={...e,expiresAt:1/0};return}$.current={items:eh.current,expiresAt:1/0}},[]),ep=(0,a.useCallback)(()=>{$.current&&($.current={...$.current,expiresAt:Date.now()+1e3},null!==Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>{ei(),et(e=>e+1)},1e3))},[ei]),{sortedItems:ev,groupedItems:ey}=en({items:eu,sortKey:C,sortDirection:M,viewMode:S,filterText:I}),ew=(0,a.useMemo)(()=>"grouped"===S&&ey?I.trim()?ey:(0,er.BN)(ey,L):null,[S,ey,L,I]),ej="grouped"===S?ew:null,eN=(0,a.useMemo)(()=>"sessions"===S?(0,er.EY)((0,er.UB)(ev),C,M):[],[S,ev,C,M]);(0,a.useEffect)(()=>{try{localStorage.setItem(es,JSON.stringify(P))}catch(e){}},[P]);let ek=(0,a.useCallback)(e=>{D(t=>({...t,[e]:!t[e]}))},[]),eC=(0,a.useCallback)(()=>{var e,t,r=null!=(t=null==(e=B.current)?void 0:e.scrollTop)?t:0;let n=Number.isFinite(r)&&r>0?r:0;eo=n;try{localStorage.setItem(ea,String(n))}catch(e){}},[]),eM=ev.length>0||(null!=(t=null==ej?void 0:ej.length)?t:0)>0||eN.length>0;(0,a.useEffect)(()=>{let e=B.current;if(!e)return;let t=window.requestAnimationFrame(()=>{e.scrollTop=function(){try{let e=localStorage.getItem(ea);if(!e)return eo=0,0;let t=Number(e);Number.isFinite(t)&&t>=0&&(eo=t)}catch(e){}return eo}()});return()=>{window.cancelAnimationFrame(t)}},[eM,S]);let eS=(0,a.useCallback)(e=>{eC(),u(e),i.push("/worktrees/".concat(e)),N()},[eC,u,i,N]),eE=(0,a.useCallback)(e=>{eC(),u(e.worktreeId),i.push((0,er.Ii)(e)),N()},[eC,u,i,N]),eL=(0,v.FR)((0,v.MS)(v.AN,{activationConstraint:{distance:8}})),eA=(0,a.useCallback)(e=>{let{active:t,over:r}=e;if(!r||t.id===r.id||!ej)return;let n=ej.map(e=>e.repositoryName),s=n.indexOf(String(t.id)),a=n.indexOf(String(r.id));if(-1===s||-1===a)return;let o=(0,y.be)(n,s,a);T(o),fetch("/api/sidebar/group-order",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({order:o})}).catch(()=>{T(n)})},[ej,T]),eT="grouped"===S?(null!=(r=null==ej?void 0:ej.length)?r:0)===0:"sessions"===S?0===eN.length:0===ev.length,eR=x&&0===l.length,eW=!eR&&!!w&&0===l.length,ez=(0,a.useCallback)(()=>{m()},[m]);return(0,n.jsxs)("nav",{"data-testid":"sidebar","aria-label":R("sidebar.branchNavigation"),className:"h-full flex flex-col bg-sidebar text-sidebar-foreground",role:"navigation",children:[(0,n.jsxs)("div",{"data-testid":"sidebar-header",className:"flex-shrink-0 space-y-2 border-b border-sidebar-border px-2 py-2",children:[(0,n.jsxs)("ul",{"data-testid":"sidebar-nav",className:"space-y-0.5",children:[(0,n.jsxs)("li",{className:"flex min-w-0 items-center gap-1",children:[(0,n.jsx)(em,{href:"/repositories",icon:b.A,label:R("nav.repositories"),testId:"sidebar-nav-repositories",isActive:W.startsWith("/repositories"),onNavigate:N}),(0,n.jsx)(eg,{refreshWorktrees:m})]}),(0,n.jsx)("li",{className:"flex min-w-0",children:(0,n.jsx)(em,{href:"/sessions",icon:p.A,label:R("nav.sessions"),testId:"sidebar-nav-sessions",isActive:W.startsWith("/sessions"),onNavigate:N})}),(0,n.jsx)("li",{className:"flex min-w-0",children:(0,n.jsx)(em,{href:z>0?Q.ks:"/review",icon:g.A,label:R("nav.review"),testId:"sidebar-nav-review",isActive:W.startsWith("/review"),onNavigate:N,trailing:z>0?(0,n.jsx)("span",{"data-testid":"sidebar-nav-review-count",role:"status","aria-label":R("attention.badgeLabel",{count:z}),className:"flex-shrink-0 rounded-full bg-warning-subtle px-1.5 text-xs font-semibold leading-5 tabular-nums text-warning-foreground",children:z>99?"99+":z}):null})})]}),(0,n.jsxs)("div",{"data-testid":"sidebar-list-controls",className:"grid grid-cols-[auto_minmax(0,1fr)] items-center gap-x-2 gap-y-1.5 px-2",children:[(0,n.jsx)(ef,{viewMode:S,onChange:E}),(0,n.jsx)("span",{className:"whitespace-nowrap text-xs text-sidebar-muted",children:R("sort.label")}),(0,n.jsx)(O,{})]})]}),(0,n.jsx)("div",{className:"flex-shrink-0 px-4 py-3 border-b border-sidebar-border",children:(0,n.jsx)(F.pd,{type:"text",placeholder:R("sidebar.searchBranches"),value:I,onChange:e=>K(e.target.value),className:"bg-background shadow-none"})}),(0,n.jsx)("div",{ref:B,"data-testid":"branch-list",onScroll:eC,onMouseEnter:eb,onMouseLeave:ep,className:"flex-1 overflow-y-auto overflow-x-hidden",children:eR?(0,n.jsx)(el,{label:R("sidebar.loadingBranches")}):eW?(0,n.jsxs)("div",{"data-testid":"branch-list-error",role:"alert",className:"px-4 py-8 text-center text-sidebar-muted",children:[(0,n.jsx)("p",{className:"text-sm",children:R("sidebar.branchesLoadFailed")}),(0,n.jsx)(F.$n,{type:"button",variant:"secondary",size:"sm",className:"mt-3","data-testid":"branch-list-retry",onClick:ez,children:R("sidebar.retryLoadBranches")})]}):eT?(0,n.jsx)("div",{className:"px-4 py-8 text-center text-sidebar-muted",children:R(I?"sidebar.noBranchesFound":"sidebar.noBranchesAvailable")}):"sessions"===S?eN.map(e=>(0,n.jsx)(ex,{row:e,isSelected:e.worktreeId===d,onClick:eE},e.key)):"grouped"===S&&ej?(0,n.jsx)(v.Mp,{sensors:eL,collisionDetection:v.fp,onDragEnd:eA,children:(0,n.jsx)(y.gB,{items:ej.map(e=>e.repositoryName),strategy:y._G,children:ej.map(e=>{let t=!P[e.repositoryName]||!!I.trim();return(0,n.jsx)(ec,{group:e,isExpanded:t,selectedWorktreeId:d,onToggle:()=>ek(e.repositoryName),onBranchClick:eS,isDragDisabled:!!I.trim()},e.repositoryName)})})}):ev.map(e=>(0,n.jsx)(A,{branch:e,isSelected:e.id===d,onClick:()=>eS(e.id)},e.id))}),(0,n.jsxs)("div",{className:"flex-shrink-0 px-4 py-3 border-t border-sidebar-border space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("div",{className:"flex-1",children:(0,n.jsx)(G,{})}),(0,n.jsx)(X,{})]}),(0,n.jsx)(Z,{})]})]})}),el=(0,a.memo)(function(e){let{label:t}=e;return(0,n.jsxs)("div",{"data-testid":"branch-list-skeleton",role:"status","aria-live":"polite",className:"px-4 py-3 space-y-3",children:[(0,n.jsx)("span",{className:"sr-only",children:t}),[0,1,2,3,4].map(e=>(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(F.EA,{className:"h-2 w-2 rounded-full"}),(0,n.jsx)(F.EA,{className:"h-3 flex-1"})]},e))]})});function ec(e){let{group:t,isExpanded:r,selectedWorktreeId:s,onToggle:a,onBranchClick:o,isDragDisabled:i}=e,{attributes:l,listeners:c,setNodeRef:d,setActivatorNodeRef:u,transform:m,transition:f,isDragging:x}=(0,y.gl)({id:t.repositoryName,disabled:i}),h={transform:w.Ks.Transform.toString(m),transition:f,opacity:x?.5:1};return(0,n.jsxs)("div",{ref:d,style:h,className:"w-full min-w-0",children:[(0,n.jsx)(eu,{repositoryName:t.repositoryName,branchCount:t.branches.length,isExpanded:r,onClick:a,dragHandleRef:u,dragHandleListeners:i?void 0:c,dragHandleAttributes:i?void 0:l}),r&&t.branches.map(e=>(0,n.jsx)(A,{branch:e,isSelected:e.id===s,onClick:()=>o(e.id),showRepositoryName:!1},e.id))]})}let ed=new Set(["__proto__","constructor","prototype"]);function eu(e){let{repositoryName:t,branchCount:r,isExpanded:s,onClick:a,dragHandleRef:o,dragHandleListeners:i,dragHandleAttributes:l}=e,c=(0,h.c)("common");return(0,n.jsxs)("div",{className:"flex items-center w-full",children:[i&&(0,n.jsx)("div",{ref:o,...i,...l,"aria-label":c("sidebar.dragToReorderGroup"),className:" flex-shrink-0 flex items-center justify-center w-6 h-full pl-2 cursor-grab active:cursor-grabbing text-sidebar-muted hover:text-sidebar-foreground transition-colors ",children:(0,n.jsx)(eb,{})}),(0,n.jsxs)("button",{"data-testid":"group-header",type:"button",onClick:a,"aria-expanded":s,className:" flex-1 min-w-0 flex items-center gap-2 px-2 py-2 text-xs font-semibold text-sidebar-muted uppercase tracking-wider focus:outline-none focus:ring-2 focus:ring-inset focus:ring-ring transition-colors ",children:[(0,n.jsx)(eh,{isExpanded:s}),(0,n.jsx)(F.nF,{color:(0,er.LV)(t)}),(0,n.jsx)(_.nR,{content:t,className:"flex-1 min-w-0 text-left truncate",children:t}),(0,n.jsx)("span",{className:"text-sidebar-muted font-normal tabular-nums pr-2",children:r})]})]})}function em(e){let{href:t,icon:r,label:s,testId:a,isActive:o,onNavigate:i,trailing:l}=e;return(0,n.jsxs)(x,{href:t,"data-testid":a,"aria-current":o?"page":void 0,onClick:i,className:"flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ".concat(o?"bg-sidebar-hover font-medium text-sidebar-foreground":"text-sidebar-muted"),children:[(0,n.jsx)(r,{className:"h-4 w-4 flex-shrink-0","aria-hidden":"true"}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate",children:s}),l]})}function ef(e){let{viewMode:t,onChange:r}=e,s=(0,h.c)("common"),o=(0,a.useId)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("label",{htmlFor:o,className:"whitespace-nowrap text-xs text-sidebar-muted",children:s("sidebar.viewLabel")}),(0,n.jsxs)("select",{id:o,"data-testid":"view-mode-select",value:t,onChange:e=>{let t=e.target.value;(0,er.$m)(t)&&r(t)},className:"w-full min-w-0 truncate rounded border border-sidebar-border bg-sidebar px-1.5 py-1 text-xs text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring",children:[(0,n.jsx)("option",{value:"grouped",children:s("sidebar.viewMode.grouped")}),(0,n.jsx)("option",{value:"flat",children:s("sidebar.viewMode.flat")}),(0,n.jsx)("option",{value:"sessions",children:s("sidebar.viewMode.sessions")})]})]})}let ex=(0,a.memo)(function(e){let{row:t,isSelected:r,onClick:s}=e,a=(0,h.c)("common"),o=a("status.".concat(t.status));return(0,n.jsxs)("button",{type:"button","data-testid":"session-list-item","data-session-key":t.key,onClick:()=>s(t),"aria-current":r?"true":void 0,className:"w-full min-w-0 px-4 py-2 flex items-center gap-3 text-left hover:bg-sidebar-hover transition-colors focus:outline-none focus:ring-2 focus:ring-inset focus:ring-ring ".concat(r?"bg-sidebar-hover border-l-2 border-accent-500":"border-l-2 border-transparent"),children:[(0,n.jsx)(F.md,{status:t.status,size:"lg",label:t.exited?"".concat(o," (").concat(a("branchItem.agentExited"),")"):o}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block truncate text-sm font-semibold text-sidebar-foreground",children:t.label}),(0,n.jsxs)("span",{className:"block truncate text-xs text-sidebar-muted",children:[t.branchName," \xb7 ",t.repositoryName]})]})]})});function eh(e){let{isExpanded:t}=e;return(0,n.jsx)("svg",{className:"w-3 h-3 flex-shrink-0 transition-transform ".concat(t?"rotate-90":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})}function eb(){return(0,n.jsxs)("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,n.jsx)("circle",{cx:"9",cy:"5",r:"1.5"}),(0,n.jsx)("circle",{cx:"15",cy:"5",r:"1.5"}),(0,n.jsx)("circle",{cx:"9",cy:"12",r:"1.5"}),(0,n.jsx)("circle",{cx:"15",cy:"12",r:"1.5"}),(0,n.jsx)("circle",{cx:"9",cy:"19",r:"1.5"}),(0,n.jsx)("circle",{cx:"15",cy:"19",r:"1.5"})]})}function ep(e){let{className:t=""}=e;return(0,n.jsx)("svg",{className:"".concat("w-4 h-4"," ").concat(t),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h5M20 20v-5h-5M20.49 9A9 9 0 005.64 5.64L4 4m16 16l-1.64-1.64A9 9 0 014.51 15"})})}let eg=(0,a.memo)(function(e){let{refreshWorktrees:t}=e,[r,s]=(0,a.useState)(!1),o=(0,a.useRef)(!1),{showToast:i}=(0,J.dj)(),l=(0,h.c)("common"),c=(0,a.useCallback)(async()=>{if(!o.current){o.current=!0,s(!0);try{let e=await et.Rx.sync();await t(),i(l("syncSuccess",{count:e.worktreeCount}),"success",3e3)}catch(e){e instanceof et.hD&&401===e.status?i(l("syncAuthError"),"error",5e3):i(l("syncError"),"error",5e3)}finally{o.current=!1,s(!1)}}},[t,i,l]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(R.m_,{content:l("tooltips.sync"),placement:"bottom",children:(0,n.jsx)("button",{type:"button",onClick:c,disabled:r,"aria-label":l("syncButtonLabel"),className:"p-1 rounded-md text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:(0,n.jsx)(ep,{className:r?"animate-spin":""})})})})});var ev=r(59847),ey=r(86651),ew=r(94684),ej=r(34681);function eN(){let e=(0,o.pT)(),t=(0,h.c)("common");if(!e)return null;let{repoTabBarMode:r,setRepoTabBarMode:s}=e;return(0,n.jsxs)("div",{className:"hidden md:flex items-center",children:[(0,n.jsx)("label",{htmlFor:"repo-tab-bar-mode",className:"sr-only",children:t("repoTabBar.settingLabel")}),(0,n.jsx)("select",{id:"repo-tab-bar-mode","data-testid":"repo-tab-bar-mode-select","aria-label":t("repoTabBar.settingLabel"),title:t("repoTabBar.settingLabel"),value:r,onChange:e=>{let t=e.target.value;(0,er.m3)(t)&&s(t)},className:"rounded-md border border-border bg-surface px-2 py-1 text-sm text-muted-foreground transition-colors hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring",children:er.EN.map(e=>(0,n.jsx)("option",{value:e,children:t("repoTabBar.mode.".concat(e))},e))})]})}var ek=r(52407);function eC(){let{shouldSurface:e,isReconnecting:t}=(0,ek.Fx)(),r=(0,h.c)("common");if(!e)return null;let s=r(t?"connection.reconnecting":"connection.offline");return(0,n.jsxs)("span",{"data-testid":"connection-status-indicator","data-connection-state":t?"reconnecting":"offline",role:"status","aria-live":"polite",title:r(t?"connection.reconnectingTooltip":"connection.offlineTooltip"),className:"hidden sm:inline-flex items-center gap-1.5 rounded-full border border-border bg-surface px-2 py-0.5 text-xs text-muted-foreground",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:["w-1.5 h-1.5 rounded-full",t?"bg-warning motion-safe:animate-pulse":"bg-muted-foreground"].join(" ")}),s]})}var eM=r(72137),eS=r(79651),eE=r(92614);let eL=[{labelKey:"nav.sessions",href:"/sessions",isActive:e=>e.startsWith("/sessions")},{labelKey:"nav.repositoriesShort",href:"/repositories",isActive:e=>e.startsWith("/repositories")},{labelKey:"nav.reviewReport",href:"/review",isActive:e=>e.startsWith("/review")},{labelKey:"nav.more",href:"/more",isActive:e=>e.startsWith("/more")}];function eA(e){let{title:t="CommandMate"}=e,r=(0,s.usePathname)(),o=(0,h.c)("commandPalette"),i=(0,h.c)("common"),{setOpen:l}=(0,eE.C)(),[c,d]=a.useState(null);return a.useEffect(()=>{d("undefined"!=typeof navigator&&/Mac|iPhone|iPad|iPod/i.test(navigator.platform||"")?"⌘":"Ctrl")},[]),(0,n.jsx)("header",{className:"sticky top-0 z-50 border-b border-border bg-background supports-[backdrop-filter]:bg-background/80 backdrop-blur-md",children:(0,n.jsx)("div",{className:"container-custom",children:(0,n.jsxs)("div",{className:"flex items-center justify-between h-16",children:[(0,n.jsx)("div",{className:"flex items-center space-x-4",children:(0,n.jsxs)(x,{href:"/",className:"flex items-center space-x-2 hover:opacity-80 transition-opacity",children:[(0,n.jsx)("div",{className:"w-8 h-8 bg-accent-600 rounded-lg flex items-center justify-center",children:(0,n.jsx)(ev.A,{size:20,strokeWidth:2,className:"text-white","aria-hidden":"true"})}),(0,n.jsx)("h1",{className:"text-xl font-bold text-foreground",children:t})]})}),(0,n.jsxs)("nav",{className:"flex items-center space-x-6",role:"navigation",children:[eL.map(e=>{let t=e.isActive(r);return(0,n.jsx)(x,{href:e.href,"aria-current":t?"page":void 0,className:"relative py-1 text-sm font-medium transition-colors after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:rounded-full after:bg-accent-600 dark:after:bg-accent-400 after:origin-center motion-safe:after:transition-transform after:duration-200 after:ease-[var(--motion-ease-out)] ".concat(t?"text-accent-600 dark:text-accent-400 after:scale-x-100":"text-muted-foreground hover:text-foreground after:scale-x-0"),children:i(e.labelKey)},e.href)}),(0,n.jsxs)("button",{type:"button","data-testid":"header-command-palette-trigger",onClick:()=>l(!0),"aria-label":o("mobileTrigger"),className:"hidden md:inline-flex items-center gap-2 rounded-md border border-border bg-surface px-2.5 py-1.5 text-sm text-muted-foreground hover:bg-surface-2 transition-colors",children:[(0,n.jsx)(ey.A,{size:16,strokeWidth:2,"aria-hidden":"true",className:"shrink-0"}),(0,n.jsx)("span",{children:o("searchAction")}),c&&(0,n.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,n.jsx)(eS.u,{children:c}),(0,n.jsx)(eS.u,{children:"K"})]})]}),(0,n.jsx)(eC,{}),(0,n.jsx)(ej.g,{}),(0,n.jsx)(eN,{}),(0,n.jsx)(eM.H,{}),(0,n.jsx)(X,{}),(0,n.jsxs)("a",{href:"https://github.com/kewton/MyCodeBranchDesk",target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-muted-foreground hover:text-foreground transition-colors flex items-center space-x-1",children:[(0,n.jsx)(ew.A,{size:20,strokeWidth:2,"aria-hidden":"true"}),(0,n.jsx)("span",{children:"GitHub"})]})]})]})})})}var eT=r(37772),eR=r(17848),eW=r(46892),ez=r(59854);let eI=/^\/worktrees\/([^/]+)/;function eK(e,t,r){let n=r-8-t;return n<=8?8:Math.min(Math.max(e.left+t>r-8?e.right-t:e.left,8),n)}function eB(e){var t;null==e||null==(t=e.scrollIntoView)||t.call(e,{block:"nearest",inline:"nearest"})}let eP=(0,a.memo)(function(){var e;let t=(0,h.c)("common"),r=(0,s.usePathname)(),i=(0,f.Hq)(),{sortKey:l,sortDirection:c,repositoryOrder:u}=(0,o.VF)(),{worktrees:m,repositories:x,selectedWorktreeId:b,selectWorktree:p}=(0,j.$f)(),{factor:g}=(0,d.Ps)(),v=(0,a.useMemo)(()=>(0,er.UZ)(null!=x?x:[]),[x]),y=(0,a.useMemo)(()=>(0,er.s6)(null!=m?m:[],v),[m,v]),{groupedItems:w}=en({items:(0,a.useMemo)(()=>y.map(k.XK),[y]),sortKey:l,sortDirection:c,viewMode:"grouped"}),N=(0,a.useMemo)(()=>(0,er.BN)(w,u),[w,u]),C=function(e,t){let r=eI.exec(e);if(!r)return t;try{return decodeURIComponent(r[1])}catch(e){return r[1]}}(r,b),M=(0,a.useMemo)(()=>{var e,t;return null!=(t=null==(e=N.find(e=>e.branches.some(e=>e.id===C)))?void 0:e.repositoryName)?t:null},[N,C]),[S,E]=(0,a.useState)(null),[L,A]=(0,a.useState)(null),[T,R]=(0,a.useState)(!1),W=(0,a.useRef)(null),z=(0,a.useRef)(null),I=(0,a.useRef)(new Map),K=(0,a.useCallback)((e,t)=>{t?I.current.set(e,t):I.current.delete(e)},[]),B=(0,a.useCallback)(()=>{E(null),A(null),R(!1)},[]),P=(0,a.useCallback)(e=>{let t=I.current.get(e);if(!t)return;let r=t.getBoundingClientRect();A({left:r.left,right:r.right,bottom:r.bottom}),E(e),R(!1)},[]),D=(0,a.useCallback)(e=>{if(S===e)return void B();P(e)},[S,B,P]),[O,F]=(0,a.useState)(!1),_=(0,a.useCallback)(()=>{let e=W.current;e&&F(e.scrollWidth>e.clientWidth+1)},[]);(0,a.useLayoutEffect)(()=>{_()},[_,N.length,g]),(0,a.useEffect)(()=>{window.addEventListener("resize",_);let e="undefined"!=typeof ResizeObserver?new ResizeObserver(()=>_()):null;return e&&W.current&&e.observe(W.current),()=>{window.removeEventListener("resize",_),null==e||e.disconnect()}},[_]);let V=null!==S||T;(0,a.useEffect)(()=>{if(!V)return;let e=e=>{var t,r,n;let s=e.target;!(!s||(null==(t=W.current)?void 0:t.contains(s))||(null==(r=z.current)?void 0:r.contains(s)))&&((null==(n=s.closest)?void 0:n.call(s,"[data-repository-tab-panel]"))||B())},t=e=>{if("Escape"!==e.key)return;let t=S?I.current.get(S):z.current;B(),null==t||t.focus()};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[V,S,B]),(0,a.useEffect)(()=>{B()},[r,B]),(0,a.useLayoutEffect)(()=>{M&&eB(I.current.get(M))},[M,r,O]);let H=(0,a.useCallback)(e=>{B(),p(e),i.push("/worktrees/".concat(e))},[B,p,i]),G=(0,a.useCallback)(e=>{let t=I.current.get(e);eB(t),P(e),null==t||t.focus()},[P]),q=(0,a.useCallback)(e=>{var t;let r=e.currentTarget,n=(t=r.clientWidth,e.ctrlKey||e.shiftKey||Math.abs(e.deltaY)<=Math.abs(e.deltaX)?0:1===e.deltaMode?40*e.deltaY:2===e.deltaMode?e.deltaY*t:e.deltaY);0!==n&&(r.scrollLeft+=n)},[]);if(0===N.length)return null;let U=Math.round(32*g),$=null!=(e=N.find(e=>e.repositoryName===S))?e:null;return(0,n.jsxs)("div",{"data-testid":"repository-tab-bar",className:"relative flex-shrink-0 flex items-stretch border-b border-border bg-surface",style:{height:"".concat(U,"px")},children:[(0,n.jsx)("nav",{ref:W,"data-testid":"repository-tab-strip","aria-label":t("nav.repositories"),onWheel:q,className:"flex min-w-0 flex-1 flex-nowrap items-stretch overflow-x-auto overflow-y-hidden scrollbar-hide",children:N.map(e=>(0,n.jsx)(eD,{group:e,isActive:e.repositoryName===M,isOpen:e.repositoryName===S,registerTab:K,onToggle:D},e.repositoryName))}),O&&(0,n.jsx)("button",{ref:z,type:"button","data-testid":"repository-tab-overflow","aria-haspopup":"menu","aria-expanded":T,"aria-label":t("repoTabBar.overflow"),title:t("repoTabBar.overflow"),onClick:()=>{E(null),A(null),R(e=>!e)},className:"flex-shrink-0 flex items-center border-l border-border px-2 text-muted-foreground transition-colors hover:bg-surface-2 hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",children:(0,n.jsx)(eT.A,{size:16,strokeWidth:2,"aria-hidden":"true"})}),$&&L&&(0,n.jsx)(eO,{group:$,anchor:L,factor:g,activeWorktreeId:C,onBranchClick:H}),T&&(0,n.jsx)(eF,{groups:N,anchorRef:z,activeRepositoryName:M,onSelect:G})]})}),eD=(0,a.memo)(function(e){let{group:t,isActive:r,isOpen:s,registerTab:a,onToggle:o}=e,i=(0,h.c)("common"),l=(0,er.zD)(t.branches),c=(0,er.j)(t.branches),d=i(eW.PL[l].labelKey);return(0,n.jsxs)("button",{ref:e=>a(t.repositoryName,e),type:"button","data-testid":"repository-tab","data-repository":t.repositoryName,"aria-haspopup":"menu","aria-expanded":s,"aria-current":r?"true":void 0,title:"".concat(t.repositoryName," — ").concat(d),onClick:()=>o(t.repositoryName),onKeyDown:e=>{"ArrowDown"===e.key&&(e.preventDefault(),s||o(t.repositoryName))},className:"\n group/tab flex-shrink-0 flex max-w-[14rem] items-center gap-1.5 px-2.5\n border-b-2 text-xs font-medium transition-colors\n focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring\n ".concat(r?"border-accent-500 bg-surface-2 text-foreground":"border-transparent text-muted-foreground hover:bg-surface-2 hover:text-foreground","\n "),children:[(0,n.jsx)(eR.n,{className:"h-3.5 w-3.5",color:(0,er.LV)(t.repositoryName)}),(0,n.jsx)("span",{className:"min-w-0 truncate",children:t.repositoryName}),(0,n.jsx)(C.m,{status:l,size:"sm",label:d,"data-testid":"repository-tab-status"}),c>0&&(0,n.jsx)("span",{"data-testid":"repository-tab-attention-count","aria-label":i("attention.badgeLabel",{count:c}),className:"flex-shrink-0 rounded-full bg-warning-subtle px-1.5 text-[10px] font-semibold leading-4 tabular-nums text-warning-foreground",children:c})]})});function eO(e){let{group:t,anchor:r,factor:s,activeWorktreeId:o,onBranchClick:i}=e,l=(0,h.c)("common"),c=(0,a.useRef)(null);if((0,a.useEffect)(()=>{var e;let t=null==(e=c.current)?void 0:e.querySelector("button");null==t||t.focus()},[t.repositoryName]),"undefined"==typeof document)return null;let d=Math.round(300*s),u=window.innerWidth;return N.createPortal((0,n.jsx)("div",{ref:c,"data-repository-tab-panel":"","data-testid":"repository-tab-popover","data-repository":t.repositoryName,role:"menu","aria-label":l("sidebar.branchNavigation"),className:"fixed rounded-md border border-sidebar-border bg-sidebar text-sidebar-foreground shadow-lg",style:{top:r.bottom+4,left:eK(r,d,u),width:d,zIndex:ez.M.POPOVER},children:(0,n.jsx)("div",{"data-testid":"repository-tab-popover-list",className:"overflow-y-auto overflow-x-hidden py-1",style:{maxHeight:"".concat(Math.round(520*s),"px")},children:0===t.branches.length?(0,n.jsx)("p",{className:"px-4 py-6 text-center text-sm text-sidebar-muted",children:l("sidebar.noBranchesAvailable")}):t.branches.map(e=>(0,n.jsx)(A,{branch:e,isSelected:e.id===o,onClick:()=>i(e.id),showRepositoryName:!1},e.id))})}),document.body)}function eF(e){var t;let{groups:r,anchorRef:s,activeRepositoryName:a,onSelect:o}=e,i=(0,h.c)("common"),l=null==(t=s.current)?void 0:t.getBoundingClientRect();if("undefined"==typeof document||!l)return null;let c=window.innerWidth;return N.createPortal((0,n.jsx)("div",{"data-repository-tab-panel":"","data-testid":"repository-tab-overflow-menu",role:"menu","aria-label":i("nav.repositories"),className:"fixed rounded-md border border-sidebar-border bg-sidebar text-sidebar-foreground shadow-lg",style:{top:l.bottom+4,left:eK({left:l.left,right:l.right,bottom:l.bottom},300,c),width:300,maxHeight:"".concat(520,"px"),zIndex:ez.M.POPOVER},children:(0,n.jsx)("div",{className:"overflow-y-auto py-1",style:{maxHeight:"inherit"},children:r.map(e=>{let t=(0,er.zD)(e.branches);return(0,n.jsxs)("button",{type:"button",role:"menuitem","data-testid":"repository-tab-overflow-item","data-repository":e.repositoryName,"aria-current":e.repositoryName===a?"true":void 0,onClick:()=>o(e.repositoryName),className:"flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors hover:bg-sidebar-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",children:[(0,n.jsx)(eR.n,{className:"h-3.5 w-3.5",color:(0,er.LV)(e.repositoryName)}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.repositoryName}),(0,n.jsx)(C.m,{status:t,size:"sm",label:i(eW.PL[t].labelKey)}),(0,n.jsx)("span",{className:"tabular-nums text-xs text-sidebar-muted",children:e.branches.length})]},e.repositoryName)})})}),document.body)}var e_=r(9540);function eV(e){let{count:t}=e,r=(0,h.c)("common");return 0===t?null:(0,n.jsx)("span",{"data-testid":"attention-badge-bubble",role:"status","aria-label":r("attention.badgeLabel",{count:t}),className:"absolute -top-1.5 -right-2.5 min-w-[1.05rem] rounded-full bg-warning-foreground px-1 text-[0.625rem] font-bold leading-[1.05rem] text-warning-subtle tabular-nums text-center",children:t>99?"99+":t})}let eH=[{labelKey:"nav.sessions",href:"/sessions",isActive:e=>e.startsWith("/sessions"),icon:(0,n.jsx)(p.A,{size:20,"aria-hidden":"true"})},{labelKey:"nav.review",href:"/review",isActive:e=>e.startsWith("/review"),icon:(0,n.jsx)(g.A,{size:20,"aria-hidden":"true"}),showsAttentionBadge:!0},{labelKey:"nav.more",href:"/more",isActive:e=>e.startsWith("/more"),icon:(0,n.jsx)(eT.A,{size:20,"aria-hidden":"true"})}];function eG(){let e=(0,s.usePathname)(),{setOpen:t}=(0,eE.C)(),r=(0,h.c)("commandPalette"),a=(0,h.c)("common"),{count:i}=(0,ee.Lv)(),l=(0,o.pT)();return(null==l?void 0:l.isMobileDrawerOpen)?null:(0,n.jsx)("nav",{"data-testid":"global-mobile-nav",className:"fixed bottom-0 left-0 right-0 z-50 border-t border-border bg-background supports-[backdrop-filter]:bg-background/80 backdrop-blur-md pb-safe",children:(0,n.jsxs)("div",{className:"flex items-center justify-around h-14",children:[l&&(0,n.jsxs)("button",{type:"button","data-testid":"mobile-nav-open-sidebar",onClick:l.openMobileDrawer,className:"flex flex-col items-center justify-center flex-1 h-full text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,n.jsx)(e_.A,{size:20,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"mt-1 whitespace-nowrap",children:a("sidebar.branches")})]}),eH.map(t=>{let r=t.isActive(e),s=!0===t.showsAttentionBadge&&i>0;return(0,n.jsxs)(x,{href:s?Q.ks:t.href,className:"flex flex-col items-center justify-center flex-1 h-full text-xs transition-colors ".concat(r?"text-accent-600 dark:text-accent-400":"text-muted-foreground hover:text-foreground"),children:[(0,n.jsxs)("span",{className:"relative inline-flex",children:[t.icon,!0===t.showsAttentionBadge&&(0,n.jsx)(eV,{count:i})]}),(0,n.jsx)("span",{className:"mt-1 whitespace-nowrap",children:a(t.labelKey)})]},t.href)}),(0,n.jsxs)("button",{type:"button","data-testid":"mobile-command-palette-trigger",onClick:()=>t(!0),"aria-label":r("mobileTrigger"),className:"flex flex-col items-center justify-center flex-1 h-full text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,n.jsx)(ey.A,{size:20,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"mt-1 whitespace-nowrap",children:r("mobileLabel")})]})]})})}function eq(){let{shouldSurface:e,isReconnecting:t}=(0,ek.Fx)(),r=(0,h.c)("common");if(!e)return null;let s=r(t?"connection.reconnecting":"connection.offline"),a=r(t?"connection.reconnectingTooltip":"connection.offlineTooltip");return(0,n.jsx)("div",{"data-testid":"mobile-connection-banner","data-connection-state":t?"reconnecting":"offline",role:"status","aria-live":"polite",title:a,className:"shrink-0 pt-safe border-b ".concat(t?"bg-warning-subtle border-warning-border text-warning-foreground":"bg-danger-subtle border-danger-border text-danger-foreground"),children:(0,n.jsxs)("div",{className:"flex items-center justify-center gap-1.5 px-3 py-1 text-xs",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"w-1.5 h-1.5 rounded-full ".concat(t?"bg-warning motion-safe:animate-pulse":"bg-danger")}),s]})})}var eU=r(45573),e$=r(94465),eX=r(70628);let eY=["global","terminal","composer","editor"],eZ=[{id:"commandPalette",keys:["MOD","K"],scope:"global"},{id:"keyboardHelp",keys:["?"],scope:"global"},{id:"closeOverlay",keys:["Esc"],scope:"global"},{id:"navigateList",keys:["↑","↓"],scope:"global"},{id:"terminalSearch",keys:["MOD","F"],scope:"terminal"},{id:"toggleSurfaceMode",keys:["MOD","Shift","M"],scope:"terminal"},{id:"sendMessage",keys:["↵"],scope:"composer"},{id:"composerNewline",keys:["Shift","↵"],scope:"composer"},{id:"editorIndent",keys:["Tab"],scope:"editor"},{id:"editorOutdent",keys:["Shift","Tab"],scope:"editor"},{id:"editorTabFocus",keys:["Ctrl","M"],scope:"editor"},{id:"editorSave",keys:["MOD","S"],scope:"editor"},{id:"editorFullscreen",keys:["MOD","Shift","F"],scope:"editor"}];function eJ(){let{open:e,setOpen:t}=(0,eX.K)(),{open:r}=(0,eE.C)(),s=(0,h.c)("keyboardShortcuts"),[o,i]=(0,a.useState)(!1);(0,a.useEffect)(()=>i(function(){if("undefined"==typeof navigator)return!1;let e=navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/.test(e)}()),[]);let l=(0,a.useRef)(e);(0,a.useEffect)(()=>{l.current=e},[e]);let c=(0,a.useRef)(r);(0,a.useEffect)(()=>{c.current=r},[r]),(0,a.useEffect)(()=>{function e(e){"?"!==e.key||e.isComposing||229===e.keyCode||(0,eU.tJ)(e.target)||c.current||l.current||(e.preventDefault(),t(!0))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t]);let d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eZ;return eY.map(t=>({scope:t,shortcuts:e.filter(e=>e.scope===t)})).filter(e=>e.shortcuts.length>0)}();return(0,n.jsx)(e$.a,{isOpen:e,onClose:()=>t(!1),title:s("title"),size:"md",children:(0,n.jsx)("div",{"data-testid":"keyboard-shortcuts-overlay",className:"space-y-6",children:d.map(e=>{let{scope:t,shortcuts:r}=e;return(0,n.jsxs)("section",{"data-testid":"keyboard-shortcuts-scope-".concat(t),children:[(0,n.jsx)("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:s("scopes.".concat(t))}),(0,n.jsx)("ul",{className:"divide-y divide-border",children:r.map(e=>(0,n.jsxs)("li",{"data-testid":"keyboard-shortcut-".concat(e.id),className:"flex items-center justify-between gap-4 py-2",children:[(0,n.jsx)("span",{className:"text-sm text-foreground",children:s("shortcuts.".concat(e.id))}),(0,n.jsx)("span",{className:"flex flex-shrink-0 items-center gap-1",children:e.keys.map((e,t)=>(0,n.jsx)(eS.u,{children:"MOD"===e?o?"⌘":"Ctrl":e},t))})]},e.id))})]},t)})})})}var eQ=r(77016),e0=r(36809),e1=r(31166);let e2=/^v?\d+\.\d+\.\d+$/;function e5(e){return e.replace(/^v/,"").split(".").map(Number)}let e4="commandmate.lastSeenAppVersion";function e3(e){try{window.localStorage.setItem(e4,e)}catch(e){}}let e9=[{key:"added",labelKey:"whatsNew.added"},{key:"improved",labelKey:"whatsNew.improved"},{key:"fixed",labelKey:"whatsNew.fixed"}];function e6(){let e=(0,h.c)("common"),t=(0,e0.Ym)(),[r,s]=(0,a.useState)(null),[o,i]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e,t="0.39.0";try{e=window.localStorage.getItem(e4)}catch(e){return}let r=function(e,t){if(!e2.test(t))return{kind:"none"};if(null===e||!e2.test(e))return{kind:"remember"};let r=function(e,t){let r=e5(e),n=e5(t),s=Math.max(r.length,n.length);for(let e=0;e<s;e++){let t=r[e]||0,s=n[e]||0;if(t>s)return 1;if(t<s)return -1}return 0}(t,e);return 0===r?{kind:"none"}:r<0?{kind:"remember"}:{kind:"show",from:e}}(e,t);if("none"===r.kind)return;if("remember"===r.kind)return void e3(t);let n=!1;return et.GQ.getReleaseNotes(r.from,t).then(e=>{n||(s({from:r.from,to:t,notes:e.notes}),i(!0))},()=>{}),()=>{n=!0}},[]);let l=(0,a.useCallback)(()=>{r&&e3(r.to),i(!1)},[r]);if(!r)return null;let c="ja"===t?"ja":"en";return(0,n.jsx)(e$.a,{isOpen:o,onClose:l,title:e("whatsNew.title",{from:r.from,to:r.to}),size:"md",children:(0,n.jsxs)("div",{className:"space-y-4","data-testid":"whats-new-dialog",children:[0===r.notes.length?(0,n.jsx)("p",{className:"text-sm text-foreground","data-testid":"whats-new-empty",children:e("whatsNew.empty")}):r.notes.map(t=>(0,n.jsxs)("section",{className:"space-y-3","data-testid":"whats-new-version-".concat(t.version),children:[(0,n.jsxs)("h4",{className:"text-sm font-semibold text-foreground",children:["v",t.version,(0,n.jsx)("span",{className:"ml-2 text-xs font-normal text-muted-foreground",children:t.date})]}),t.highlight&&(0,n.jsxs)("div",{"data-testid":"whats-new-highlight",children:[(0,n.jsx)("h5",{className:"text-xs font-medium text-muted-foreground",children:e("whatsNew.highlight")}),(0,n.jsx)("p",{className:"mt-1 text-sm text-foreground",children:t.highlight[c]})]}),e9.map(r=>{let{key:s,labelKey:a}=r;return t[s].length>0?(0,n.jsxs)("div",{"data-testid":"whats-new-".concat(s),children:[(0,n.jsx)("h5",{className:"text-xs font-medium text-muted-foreground",children:e(a)}),(0,n.jsx)("ul",{className:"mt-1 list-disc space-y-1 pl-5 text-sm text-foreground",children:t[s].map((e,t)=>(0,n.jsx)("li",{children:e[c]},t))})]},s):null})]},t.version)),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-3 border-t border-border pt-3",children:[(0,n.jsx)("a",{href:"".concat("https://github.com/Kewton/CommandMate/releases/tag/v").concat(r.to),target:"_blank",rel:"noopener noreferrer",className:"text-sm text-accent-600 dark:text-accent-400 hover:underline","data-testid":"whats-new-release-link",children:e("whatsNew.releaseLink")}),(0,n.jsx)(e1.$,{type:"button",variant:"primary",size:"sm",onClick:l,"data-testid":"whats-new-close",children:e("whatsNew.close")})]})]})})}let e8="transform transition-transform duration-300 ease-out",e7=(0,a.memo)(function(e){let{children:t}=e,{isOpen:r,isMobileDrawerOpen:u,closeMobileDrawer:m,width:f,setWidth:x,repoTabBarMode:h}=(0,o.VF)(),b=(0,i.a)(),{showSidebar:p,showGlobalNav:g}=function(){var e=(0,s.usePathname)();for(let t of c)if(e.startsWith(t.prefix))return{...l,...t.config};return{...l}}(),{factor:v}=(0,d.Ps)(),y=Math.round(160*v),w=Math.round(480*v),j=Math.round(Math.min(w,Math.max(y,f*v))),N=(0,er.fs)(null!=h?h:er.PB,r),k=Math.round(32*v)+64*!!g,C=(0,a.useRef)(null),M=(0,a.useRef)(null),S=(0,a.useCallback)(e=>{x(Math.round(e/v))},[x,v]);return b?(0,n.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[(0,n.jsx)(eq,{}),u&&(0,n.jsx)("div",{"data-testid":"drawer-overlay",className:"fixed inset-0 bg-black/50 z-40",onClick:m,"aria-hidden":"true"}),p&&(0,n.jsx)("aside",{"data-testid":"sidebar-container",className:"\n fixed left-0 top-0 h-full w-72 z-50\n ".concat(e8,"\n ").concat(u?"translate-x-0":"-translate-x-full","\n "),role:"complementary",children:(0,n.jsx)(ei,{})}),(0,n.jsx)("main",{className:"flex-1 min-h-0 overflow-hidden ".concat(g?"pb-nav-safe":""),role:"main","data-view-transition":"content",children:t}),g&&(0,n.jsx)(eG,{}),(0,n.jsx)(eU.xq,{}),(0,n.jsx)(eJ,{}),(0,n.jsx)(eQ.n,{}),(0,n.jsx)(e6,{})]}):(0,n.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[N&&(0,n.jsx)(eP,{}),g&&(0,n.jsx)(eA,{}),(0,n.jsxs)("div",{className:"flex flex-1 min-h-0",children:[p&&(0,n.jsxs)("aside",{ref:C,"data-testid":"sidebar-container",className:"\n fixed left-0\n ".concat(g?"top-16 h-[calc(100vh-4rem)]":"top-0 h-full","\n border-r border-border\n ").concat(e8,"\n ").concat(r?"translate-x-0":"-translate-x-full","\n "),style:{width:"".concat(j,"px"),zIndex:ez.M.SIDEBAR,...N?{top:"".concat(k,"px"),height:"calc(100vh - ".concat(k,"px)")}:{}},role:"complementary","aria-hidden":!r,children:[(0,n.jsx)(ei,{}),(0,n.jsx)(te,{currentWidth:j,minWidth:y,maxWidth:w,sidebarRef:C,mainRef:M,onWidthChange:S})]}),(0,n.jsx)("main",{ref:M,className:"flex-1 min-w-0 h-full overflow-hidden transition-[padding] duration-300 ease-out",style:{paddingLeft:p&&r?"".concat(j,"px"):0},role:"main","data-view-transition":"content",children:t})]}),(0,n.jsx)(eU.xq,{}),(0,n.jsx)(eJ,{}),(0,n.jsx)(eQ.n,{}),(0,n.jsx)(e6,{})]})});function te(e){let{currentWidth:t,minWidth:r,maxWidth:s,sidebarRef:a,mainRef:o,onWidthChange:i}=e;return(0,n.jsx)("div",{"data-testid":"sidebar-resize-handle","aria-hidden":"true",onMouseDown:e=>{e.preventDefault();let n=e.clientX,l=t;o.current&&(o.current.style.transition="none");let c=e=>{l=Math.max(r,Math.min(s,t+(e.clientX-n))),a.current&&(a.current.style.width="".concat(l,"px")),o.current&&(o.current.style.paddingLeft="".concat(l,"px"))},d=()=>{document.body.style.cursor="",document.body.style.userSelect="",o.current&&(o.current.style.transition=""),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",d),i(l)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",c),document.addEventListener("mouseup",d)},className:"absolute top-0 right-0 w-1 h-full cursor-col-resize hover:bg-accent-500/40 transition-colors"})}let tt=["/login","/offline","/proxy"],tr=/^\/worktrees\/[^/]+\/(terminal|files)(\/|$)/;function tn(e){var t;let{children:r}=e,a=(0,s.usePathname)();return(t=null!=a?a:"",tt.some(e=>t===e||t.startsWith("".concat(e,"/")))||tr.test(t)||0)?(0,n.jsx)(n.Fragment,{children:r}):(0,n.jsx)(e7,{children:r})}},13673:()=>{},25772:(e,t,r)=>{"use strict";r.d(t,{AppProviders:()=>M});var n=r(95155),s=r(3809),a=r(5379),o=r(32916),i=r(65380),l=r(22592),c=r(92614),d=r(70628),u=r(66966),m=r(89275),f=r(60199),x=r(36402),h=r(63470),b=r(94442),p=r(72604),g=r(95275),v=r(79832),y=r(12115),w=r(18955),j=r(89559),N=r(59854),k=r(77016);function C(){let e=(0,w.c)("pwa"),[t,r]=(0,y.useState)(null),s=(0,y.useRef)(!1),a=(0,k.W)();return((0,y.useEffect)(()=>{if("undefined"==typeof navigator||!("serviceWorker"in navigator))return;let e=!1,t=t=>{e||r(t)};navigator.serviceWorker.register("/sw.js").then(e=>{e.waiting&&navigator.serviceWorker.controller&&t(e.waiting),e.addEventListener("updatefound",()=>{let r=e.installing;r&&r.addEventListener("statechange",()=>{"installed"===r.state&&navigator.serviceWorker.controller&&t(r)})})}).catch(()=>{});let n=()=>{s.current||(s.current=!0,window.location.reload())};return navigator.serviceWorker.addEventListener("controllerchange",n),()=>{e=!0,navigator.serviceWorker.removeEventListener("controllerchange",n)}},[]),!t||a)?null:(0,n.jsx)("div",{"data-testid":"pwa-update-toast",role:"status","aria-live":"polite",className:"pointer-events-none fixed bottom-0 right-0 flex max-w-full justify-end px-4 pb-safe",style:{zIndex:N.M.TOAST},children:(0,n.jsxs)("div",{"data-testid":"pwa-update-toast-card",className:"pointer-events-auto mb-4 flex items-center gap-3 rounded-lg border border-border bg-surface px-4 py-3 shadow-lg",children:[(0,n.jsx)("span",{className:"text-sm font-medium text-foreground",children:e("update.available")}),(0,n.jsxs)("button",{type:"button",onClick:()=>{t.postMessage({type:"SKIP_WAITING"})},className:"inline-flex items-center gap-1.5 rounded-md bg-accent-600 px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-accent-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background dark:bg-accent-500 dark:hover:bg-accent-600",children:[(0,n.jsx)(j.A,{className:"h-4 w-4"}),e("update.reload")]})]})})}function M(e){let{children:t,locale:r,messages:y,timeZone:w,authEnabled:j=!1}=e;return(0,n.jsx)(s.default,{locale:r,messages:y,timeZone:w,children:(0,n.jsx)(b.tE,{children:(0,n.jsx)(a.N,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:(0,n.jsx)(i.O,{authEnabled:j,children:(0,n.jsx)(l.W5,{children:(0,n.jsx)(o.GB,{children:(0,n.jsx)(f.tS,{children:(0,n.jsxs)(u.g7,{children:[(0,n.jsx)(p.rM,{}),(0,n.jsx)(v.o,{}),(0,n.jsx)(g.H,{}),(0,n.jsx)(c.E,{children:(0,n.jsx)(d.S,{children:(0,n.jsx)(x.aF,{children:(0,n.jsxs)(h.y2,{children:[(0,n.jsx)(m.Bo,{children:t}),(0,n.jsx)(C,{})]})})})})]})})})})})})})})}},38218:(e,t,r)=>{"use strict";r.d(t,{D:()=>a,a:()=>o});var n=r(12115);let s=n.useLayoutEffect,a=768;function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{breakpoint:t=a}=e,[r,o]=(0,n.useState)(!1);return s(()=>{let e=window.matchMedia("(max-width: ".concat(t-1,"px)"));o(e.matches);let r=e=>{o(e.matches)};return e.addEventListener("change",r),()=>{e.removeEventListener("change",r)}},[t]),r}},77016:(e,t,r)=>{"use strict";r.d(t,{W:()=>g,n:()=>v});var n=r(95155),s=r(12115),a=r(18955),o=r(52056),i=r(89559),l=r(65229),c=r(59854),d=r(60199),u=r(52703);let m=0,f=new Set;function x(){for(let e of f)e()}function h(e){return f.add(e),()=>{f.delete(e)}}function b(){return m>0}function p(){return!1}function g(){return(0,s.useSyncExternalStore)(h,b,p)}function v(){let e=(0,a.c)("common"),[t,r]=(0,s.useState)(null),[f,h]=(0,s.useState)(null),b=(0,s.useCallback)(e=>{if(e.type!==u.Oo)return;let{serverVersion:t,clientVersion:n}=e;"string"==typeof t&&"string"==typeof n&&t&&n&&t!==f&&r({serverVersion:t,clientVersion:n})},[f]);(0,d.T3)(b);let p=null!==t;(0,s.useEffect)(()=>{if(p)return m+=1,x(),()=>{m-=1,x()}},[p]);let g=(0,s.useCallback)(()=>{window.location.reload()},[]),v=(0,s.useCallback)(()=>{r(e=>(e&&h(e.serverVersion),null))},[]);return t?(0,n.jsxs)("div",{"data-testid":"version-mismatch-banner",role:"alert","aria-live":"assertive",className:"fixed top-3 left-1/2 -translate-x-1/2 flex items-start gap-3 max-w-[92vw] rounded-lg border border-warning-border bg-warning-subtle px-4 py-3 text-warning-foreground shadow-lg",style:{zIndex:c.M.TOAST},children:[(0,n.jsx)(o.A,{className:"h-5 w-5 shrink-0 mt-0.5","aria-hidden":"true"}),(0,n.jsxs)("div",{className:"flex flex-col gap-0.5 text-sm",children:[(0,n.jsx)("span",{className:"font-semibold",children:e("versionMismatch.title")}),(0,n.jsx)("span",{children:e("versionMismatch.description",{serverVersion:t.serverVersion,clientVersion:t.clientVersion})})]}),(0,n.jsxs)("button",{type:"button","data-testid":"version-mismatch-reload",onClick:g,className:"shrink-0 inline-flex items-center gap-1.5 rounded-md border border-warning-border px-3 py-1.5 text-sm font-medium hover:opacity-80 focus:outline-none focus:ring-2 focus:ring-offset-2",children:[(0,n.jsx)(i.A,{className:"h-4 w-4","aria-hidden":"true"}),e("versionMismatch.reload")]}),(0,n.jsx)("button",{type:"button","data-testid":"version-mismatch-dismiss",onClick:v,"aria-label":e("versionMismatch.dismiss"),className:"shrink-0 hover:opacity-70 focus:outline-none focus:ring-2 focus:ring-offset-2",children:(0,n.jsx)(l.A,{className:"h-4 w-4","aria-hidden":"true"})})]}):null}},80903:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,22311,23)),Promise.resolve().then(r.t.bind(r,7183,23)),Promise.resolve().then(r.t.bind(r,13673,23)),Promise.resolve().then(r.bind(r,13533)),Promise.resolve().then(r.bind(r,25772))}},e=>{e.O(0,[5373,2978,6809,4909,2770,2619,3504,1032,8019,2407,344,5449,6966,8606,4768,9619,4322,8441,1255,7358],()=>e(e.s=80903)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3310],{6191:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(71847).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},8803:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(71847).A)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},20063:(e,t,s)=>{"use strict";var a=s(47260);s.o(a,"useParams")&&s.d(t,{useParams:function(){return a.useParams}}),s.o(a,"usePathname")&&s.d(t,{usePathname:function(){return a.usePathname}}),s.o(a,"useRouter")&&s.d(t,{useRouter:function(){return a.useRouter}}),s.o(a,"useSearchParams")&&s.d(t,{useSearchParams:function(){return a.useSearchParams}})},20562:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(71847).A)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},23327:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(71847).A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},42529:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(71847).A)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},48314:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(71847).A)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},52056:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(71847).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},65229:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(71847).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},68695:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(71847).A)("circle-arrow-up",[["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"}]])},75676:(e,t,s)=>{"use strict";s.d(t,{jg:()=>n,kQ:()=>i,mR:()=>d,mS:()=>o,wf:()=>a});let a="terminal",r=new Set(["terminal","chat"]);function n(e){return"string"==typeof e&&r.has(e)}let i={data:null,messageId:null,visible:!1,answering:!1},l={mode:"split",mobileActivePane:"terminal",leftPaneTab:"history",splitRatio:.5,leftPaneCollapsed:!1,activityBar:{active:"files"},historyPane:{visible:!0,width:25,collapsed:!1}},o={type:null,message:null,retryable:!1,retryCount:0};function d(){return{phase:"idle",prompt:{...i},layout:{...l},error:{...o},messages:[],wsConnected:!1}}},78874:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(71847).A)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},80867:(e,t,s)=>{Promise.resolve().then(s.bind(s,95775))},94442:(e,t,s)=>{"use strict";s.d(t,{dj:()=>v,tE:()=>y});var a=s(95155),r=s(12115),n=s(47650),i=s(18955),l=s(42529),o=s(78874),d=s(52056),c=s(23327),u=s(65229),m=s(59854),x=s(9900),p=s(9286);function h(e){let{type:t,iconColor:s}=e,r="h-5 w-5 ".concat(s);switch(t){case"success":return(0,a.jsx)(l.A,{className:r,"data-testid":"toast-icon-success"});case"error":return(0,a.jsx)(o.A,{className:r,"data-testid":"toast-icon-error"});case"warning":return(0,a.jsx)(d.A,{className:r,"data-testid":"toast-icon-warning"});default:return(0,a.jsx)(c.A,{className:r,"data-testid":"toast-icon-info"})}}function f(e){let{id:t,message:s,type:n,onClose:l,duration:o=3e3,onClick:d}=e,c=(0,i.c)("common"),m=(0,r.useRef)(null),f=function(e){switch(e){case"success":return{bgColor:"bg-success-subtle",borderColor:"border-success-border",textColor:"text-success-foreground",iconColor:"text-success-foreground"};case"error":return{bgColor:"bg-danger-subtle",borderColor:"border-danger-border",textColor:"text-danger-foreground",iconColor:"text-danger-foreground"};case"warning":return{bgColor:"bg-warning-subtle",borderColor:"border-warning-border",textColor:"text-warning-foreground",iconColor:"text-warning-foreground"};default:return{bgColor:"bg-info-subtle",borderColor:"border-info-border",textColor:"text-info-foreground",iconColor:"text-info-foreground"}}}(n),[g,b]=(0,r.useState)(!0),{shouldRender:j,isExiting:y}=(0,p.O)(g,x.Ys),v=(0,r.useRef)(l);v.current=l,(0,r.useEffect)(()=>{j||v.current(t)},[j,t]),(0,r.useEffect)(()=>(o>0&&(m.current=setTimeout(()=>{b(!1)},o)),()=>{m.current&&clearTimeout(m.current)}),[o]);let N=(0,r.useCallback)(()=>{m.current&&clearTimeout(m.current),b(!1)},[]);return(0,a.jsxs)("div",{"data-testid":"toast-".concat(t),role:"alert",className:"\n ".concat(f.bgColor,"\n ").concat(f.borderColor,"\n ").concat(f.textColor,"\n border rounded-lg shadow-lg p-4 min-w-[300px] max-w-[400px]\n flex items-start gap-3\n ").concat(y?"animate-out fade-out-0 slide-out-to-right-full duration-200 fill-mode-forwards pointer-events-none":"animate-slide-in","\n "),children:[(0,a.jsx)(h,{type:n,iconColor:f.iconColor}),d?(0,a.jsx)("button",{type:"button","data-testid":"toast-action-button",onClick:()=>{d(),N()},className:"flex-1 text-left text-sm font-medium underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:s}):(0,a.jsx)("p",{className:"flex-1 text-sm font-medium",children:s}),(0,a.jsx)("button",{"data-testid":"toast-close-button",onClick:N,"aria-label":c("closeNotification"),className:"\n ".concat(f.textColor,"\n hover:opacity-70\n focus:outline-none focus:ring-2 focus:ring-offset-2\n transition-opacity\n "),children:(0,a.jsx)(u.A,{className:"h-4 w-4"})})]})}function g(e){let{toasts:t,onClose:s}=e,[i,l]=(0,r.useState)(!1);(0,r.useEffect)(()=>{l(!0)},[]);let o=(0,a.jsx)("div",{"data-testid":"toast-container","aria-live":"polite",className:"fixed bottom-4 right-4 flex flex-col gap-2",style:{zIndex:m.M.TOAST},children:t.map(e=>(0,a.jsx)(f,{id:e.id,message:e.message,type:e.type,onClose:s,duration:e.duration,onClick:e.onClick},e.id))});return i?(0,n.createPortal)(o,document.body):null}function b(){let[e,t]=(0,r.useState)([]),s=(0,r.useRef)(0),a=(0,r.useCallback)(function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3,n=arguments.length>3?arguments[3]:void 0,i="toast-".concat(++s.current,"-").concat(Date.now()),l={id:i,message:e,type:a,duration:r,...(null==n?void 0:n.onClick)?{onClick:n.onClick}:{}};return t(e=>[...e,l]),i},[]),n=(0,r.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]),i=(0,r.useCallback)(()=>{t([])},[]);return(0,r.useMemo)(()=>({toasts:e,showToast:a,removeToast:n,clearToasts:i}),[e,a,n,i])}let j=(0,r.createContext)(null);function y(e){let{children:t}=e,s=b();return(0,a.jsxs)(j.Provider,{value:s,children:[t,(0,a.jsx)(g,{toasts:s.toasts,onClose:s.removeToast})]})}function v(){let e=(0,r.useContext)(j),t=b();return null!=e?e:t}},95775:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>P});var a=s(95155),r=s(52619),n=s.n(r),i=s(18955),l=s(28019),o=s(12115);function d(e){var t;let{appId:s,pollInterval:r=3e4,showResponseTime:n=!1,compact:l=!1}=e,d=(0,i.c)("externalApps"),[c,u]=(0,o.useState)(null),[m,x]=(0,o.useState)(!0),p=(0,o.useCallback)(async()=>{try{let e=await fetch("/api/external-apps/".concat(s,"/health"));if(e.ok){let t=await e.json();u(t)}else u({id:s,healthy:!1,lastChecked:Date.now(),error:"Failed to check health"})}catch(e){u({id:s,healthy:!1,lastChecked:Date.now(),error:"Network error"})}finally{x(!1)}},[s]);if((0,o.useEffect)(()=>{p();let e=setInterval(p,r);return()=>clearInterval(e)},[p,r]),m)return(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-muted-foreground animate-pulse"}),!l&&(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:d("status.checking")})]});let h=null!=(t=null==c?void 0:c.healthy)&&t,f=h?"bg-success":"bg-muted-foreground",g=d(h?"status.running":"status.stopped");return l?(0,a.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-full ".concat(f),title:g}):(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-full ".concat(f)}),(0,a.jsx)("span",{className:"text-xs ".concat(h?"text-success-foreground":"text-muted-foreground"),children:g}),n&&(null==c?void 0:c.responseTime)!==void 0&&(0,a.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",c.responseTime,"ms)"]})]})}function c(e){var t;let{app:s,onEdit:r,onDelete:n}=e,c=(0,i.c)("externalApps"),u=(0,i.c)("common"),[m,x]=(0,o.useState)(!1),[p,h]=(0,o.useState)(!1),f=async()=>{h(!0);try{await n(s.id)}finally{h(!1),x(!1)}},g="/proxy/".concat(s.pathPrefix,"/");return(0,a.jsxs)(l.Zp,{padding:"md",className:"relative",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h4",{className:"text-base font-semibold text-foreground truncate",children:s.displayName}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 font-mono truncate",children:s.name})]}),(0,a.jsx)(l.Ex,{variant:{sveltekit:"warning",streamlit:"error",nextjs:"info",other:"gray"}[s.appType]||"gray",children:{sveltekit:"SvelteKit",streamlit:"Streamlit",nextjs:"Next.js",other:"Other"}[t=s.appType]||t})]}),(0,a.jsxs)("div",{className:"space-y-2 mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:c("card.status")}),(0,a.jsx)(d,{appId:s.id,pollInterval:3e4})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:c("card.port")}),(0,a.jsxs)("span",{className:"text-sm font-mono text-foreground",children:[":",s.targetPort]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:c("card.path")}),(0,a.jsxs)("span",{className:"text-sm font-mono text-foreground truncate max-w-[150px]",children:["/proxy/",s.pathPrefix,"/"]})]}),s.websocketEnabled&&(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:c("card.websocket")}),(0,a.jsx)(l.Ex,{variant:"info",children:c("card.enabled")})]}),!s.enabled&&(0,a.jsx)("div",{className:"mt-2 py-1 px-2 bg-warning-subtle border border-warning-border rounded text-xs text-warning-foreground",children:c("card.disabledNotice")})]}),m?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:c("card.deleteConfirm",{name:s.displayName})}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(l.$n,{variant:"danger",size:"sm",onClick:f,disabled:p,loading:p,children:c("card.delete")}),(0,a.jsx)(l.$n,{variant:"ghost",size:"sm",onClick:()=>x(!1),disabled:p,children:u("cancel")})]})]}):(0,a.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,a.jsx)(l.$n,{variant:"primary",size:"sm",onClick:()=>window.open(g,"_blank"),disabled:!s.enabled,children:c("card.open")}),(0,a.jsx)(l.$n,{variant:"secondary",size:"sm",onClick:()=>r(s),children:c("card.settings")}),(0,a.jsx)(l.$n,{variant:"ghost",size:"sm",onClick:()=>x(!0),className:"text-danger-foreground hover:bg-danger-subtle",children:c("card.delete")})]})]})}var u=s(87531);let m={MIN:1024,MAX:65535},x=/^[a-zA-Z0-9-]+$/,p={sveltekit:"SvelteKit",streamlit:"Streamlit",nextjs:"Next.js",other:"Other"},h=["sveltekit","streamlit","nextjs","other"].map(e=>({value:e,label:p[e]}));function f(e){let{isOpen:t,onClose:s,editApp:r,onSave:n}=e,d=(0,i.c)("externalApps"),c=(0,i.c)("common"),p=!!r,[f,g]=(0,o.useState)(""),[b,j]=(0,o.useState)(""),[y,v]=(0,o.useState)(""),[N,k]=(0,o.useState)(""),[w,C]=(0,o.useState)(""),[S,A]=(0,o.useState)(!1),[P,T]=(0,o.useState)(""),[E,M]=(0,o.useState)(!0),[O,I]=(0,o.useState)({}),[$,z]=(0,o.useState)(!1),[D,F]=(0,o.useState)(null);(0,o.useEffect)(()=>{t&&(r?(g(r.displayName),j(r.name),v(r.pathPrefix),k(r.targetPort),C(r.appType),A(r.websocketEnabled),T(r.description||""),M(r.enabled)):(g(""),j(""),v(""),k(""),C(""),A(!1),T(""),M(!0)),I({}),F(null))},[t,r]);let R=async e=>{e.preventDefault(),F(null);let t=function(e,t){var s,a,r,n;let i={};return((null==(s=e.displayName)?void 0:s.trim())||(i.displayName="Display name is required"),!t&&((null==(a=e.name)?void 0:a.trim())?x.test(e.name)||(i.name="Only alphanumeric characters and hyphens are allowed"):i.name="Identifier name is required",(null==(r=e.pathPrefix)?void 0:r.trim())?x.test(e.pathPrefix)||(i.pathPrefix="Only alphanumeric characters and hyphens are allowed"):i.pathPrefix="Path prefix is required"),e.targetPort)?"number"!=typeof e.targetPort||Number.isInteger(n=e.targetPort)&&n>=m.MIN&&n<=m.MAX||(i.targetPort="Port must be between ".concat(m.MIN," and ").concat(m.MAX)):i.targetPort="Port number is required",t||e.appType||(i.appType="App type is required"),i}({displayName:f,name:b,pathPrefix:y,targetPort:N,appType:w},p);if(Object.keys(t).length>0)return void I(t);I({}),z(!0);try{if(p&&r){let e=await fetch("/api/external-apps/".concat(r.id),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({displayName:f,description:P||void 0,targetPort:N||void 0,websocketEnabled:S,enabled:E})});if(!e.ok){let t=await e.json();throw Error(t.error||d("form.updateFailed"))}}else{let e=await fetch("/api/external-apps",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({displayName:f,name:b,pathPrefix:y,targetPort:N,appType:w,websocketEnabled:S,description:P||void 0})});if(!e.ok){let t=await e.json();throw Error(t.error||d("form.createFailed"))}}n(),s()}catch(e){F(e instanceof Error?e.message:d("form.genericError"))}finally{z(!1)}};return(0,a.jsx)(l.Jh,{isOpen:t,onClose:s,title:p?d("form.editTitle"):d("form.addTitle"),size:"md",children:(0,a.jsxs)("form",{onSubmit:R,className:"space-y-4",children:[(0,a.jsx)("div",{className:"rounded-md bg-warning-subtle p-3 mb-4 border border-warning-border",children:(0,a.jsx)("p",{className:"text-sm text-warning-foreground",children:d("form.securityWarning")})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:"displayName",className:"block text-sm font-medium text-foreground mb-1",children:[d("form.displayName")," ",(0,a.jsx)("span",{className:"text-danger",children:"*"})]}),(0,a.jsx)(l.pd,{id:"displayName",type:"text",value:f,onChange:e=>g(e.target.value),className:O.displayName?"border-danger":"",placeholder:d("form.displayNamePlaceholder"),disabled:$}),O.displayName&&(0,a.jsx)("p",{className:"mt-1 text-xs text-danger",children:O.displayName})]}),!p&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:"name",className:"block text-sm font-medium text-foreground mb-1",children:[d("form.identifierName")," ",(0,a.jsx)("span",{className:"text-danger",children:"*"})]}),(0,a.jsx)(l.pd,{id:"name",type:"text",value:b,onChange:e=>j(e.target.value),className:"font-mono ".concat(O.name?"border-danger":""),placeholder:d("form.identifierNamePlaceholder"),disabled:$}),(0,a.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:d("form.identifierNameHelp")}),O.name&&(0,a.jsx)("p",{className:"mt-1 text-xs text-danger",children:O.name})]}),!p&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:"pathPrefix",className:"block text-sm font-medium text-foreground mb-1",children:[d("form.pathPrefix")," ",(0,a.jsx)("span",{className:"text-danger",children:"*"})]}),(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("span",{className:"text-sm text-muted-foreground mr-1",children:"/proxy/"}),(0,a.jsx)(l.pd,{id:"pathPrefix",type:"text",value:y,onChange:e=>v(e.target.value),className:"w-auto flex-1 font-mono ".concat(O.pathPrefix?"border-danger":""),placeholder:d("form.pathPrefixPlaceholder"),disabled:$}),(0,a.jsx)("span",{className:"text-sm text-muted-foreground ml-1",children:"/"})]}),(0,a.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:d("form.pathPrefixHelp")}),O.pathPrefix&&(0,a.jsx)("p",{className:"mt-1 text-xs text-danger",children:O.pathPrefix})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:"targetPort",className:"block text-sm font-medium text-foreground mb-1",children:[d("form.portNumber")," ",(0,a.jsx)("span",{className:"text-danger",children:"*"})]}),(0,a.jsx)(l.pd,{id:"targetPort",type:"number",value:N,onChange:e=>k(e.target.value?parseInt(e.target.value,10):""),className:"font-mono ".concat(O.targetPort?"border-danger":""),placeholder:d("form.portNumberPlaceholder"),min:m.MIN,max:m.MAX,disabled:$}),(0,a.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:d("form.portNumberHelp",{min:m.MIN,max:m.MAX})}),O.targetPort&&(0,a.jsx)("p",{className:"mt-1 text-xs text-danger",children:O.targetPort})]}),!p&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:"appType",className:"block text-sm font-medium text-foreground mb-1",children:[d("form.appType")," ",(0,a.jsx)("span",{className:"text-danger",children:"*"})]}),(0,a.jsxs)("select",{id:"appType",value:w,onChange:e=>C(e.target.value),className:(0,u.cn)((0,l.j1)(),O.appType&&"border-danger"),disabled:$,children:[(0,a.jsx)("option",{value:"",children:d("form.appTypePlaceholder")}),h.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))]}),O.appType&&(0,a.jsx)("p",{className:"mt-1 text-xs text-danger",children:O.appType})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"description",className:"block text-sm font-medium text-foreground mb-1",children:d("form.description")}),(0,a.jsx)(l.k_,{id:"description",value:P,onChange:e=>T(e.target.value),placeholder:d("form.descriptionPlaceholder"),rows:2,disabled:$})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(l.dO,{id:"websocketEnabled",checked:S,onCheckedChange:A,disabled:$}),(0,a.jsx)("label",{htmlFor:"websocketEnabled",className:"text-sm text-foreground",children:d("form.websocketLabel")})]}),p&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(l.dO,{id:"enabled",checked:E,onCheckedChange:M,disabled:$}),(0,a.jsx)("label",{htmlFor:"enabled",className:"text-sm text-foreground",children:d("form.enabledLabel")})]}),D&&(0,a.jsx)("div",{className:"p-3 bg-danger-subtle border border-danger-border rounded text-sm text-danger-foreground",children:D}),(0,a.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t border-border",children:[(0,a.jsx)(l.$n,{type:"button",variant:"ghost",onClick:s,disabled:$,children:c("cancel")}),(0,a.jsx)(l.$n,{type:"submit",variant:"primary",loading:$,children:p?d("form.save"):d("form.add")})]})]})})}function g(){let e=(0,i.c)("externalApps"),t=(0,i.c)("common"),[s,r]=(0,o.useState)([]),[n,d]=(0,o.useState)(!0),[u,m]=(0,o.useState)(null),[x,p]=(0,o.useState)(!1),[h,g]=(0,o.useState)(null),b=(0,o.useCallback)(async()=>{try{m(null);let e=await fetch("/api/external-apps");if(!e.ok)throw Error("Failed to fetch external apps");let t=await e.json();r(t.apps||[])}catch(e){m(e instanceof Error?e.message:"An error occurred")}finally{d(!1)}},[]);(0,o.useEffect)(()=>{b();let e=setInterval(b,6e4);return()=>clearInterval(e)},[b]);let j=(0,o.useCallback)(e=>{g(e),p(!0)},[]),y=(0,o.useCallback)(()=>{g(null),p(!0)},[]),v=(0,o.useCallback)(async e=>{try{let t=await fetch("/api/external-apps/".concat(e),{method:"DELETE"});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to delete app")}b()}catch(e){console.error("Failed to delete app:",e)}},[b]),N=(0,o.useCallback)(()=>{b()},[b]),k=(0,o.useCallback)(()=>{p(!1),g(null)},[]);return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("div",{className:"flex items-center justify-end",children:(0,a.jsx)(l.$n,{variant:"primary",size:"sm",onClick:y,children:e("manager.addApp")})}),n?(0,a.jsx)(l.Zp,{padding:"lg",children:(0,a.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,a.jsx)(l.y$,{size:"xl",variant:"accent"}),(0,a.jsx)("span",{className:"ml-3 text-muted-foreground",children:e("manager.loading")})]})}):u?(0,a.jsx)(l.Zp,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-8",children:[(0,a.jsx)("p",{className:"text-danger-foreground mb-4",children:e("manager.loadError")}),(0,a.jsx)(l.$n,{variant:"secondary",size:"sm",onClick:b,children:t("retry")})]})}):0===s.length?(0,a.jsx)(l.Zp,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-8",children:[(0,a.jsx)("p",{className:"text-muted-foreground mb-4",children:e("manager.empty")}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:e("manager.emptyHelp")}),(0,a.jsx)(l.$n,{variant:"primary",size:"sm",onClick:y,children:e("manager.addFirst")})]})}):(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:s.map(e=>(0,a.jsx)(c,{app:e,onEdit:j,onDelete:v},e.id))}),(0,a.jsx)(f,{isOpen:x,onClose:k,editApp:h,onSave:N})]})}let b=(0,s(71847).A)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);var j=s(94442),y=s(81978);function v(){return"undefined"!=typeof navigator&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}let N={enabled:!0,thresholdMinutes:10},k=[5,10,30,60];function w(){let e=(0,i.c)("notifications"),{showToast:t}=(0,j.dj)(),[s,r]=(0,o.useState)(!0),[n,d]=(0,o.useState)(!1),[c,u]=(0,o.useState)(!0),[m,x]=(0,o.useState)(!1),[p,h]=(0,o.useState)(null),[f,g]=(0,o.useState)(null),[y,N]=(0,o.useState)(!1),[k,w]=(0,o.useState)(null),[A,P]=(0,o.useState)({prompt:!0,completion:!1}),[T,E]=(0,o.useState)(!1),[M,O]=(0,o.useState)(null),[I,$]=(0,o.useState)(null),z=null!==k&&!1!==I;(0,o.useEffect)(()=>{let e=!1;return(async()=>{let t=function(){var e,t;let s=v(),a="undefined"!=typeof navigator&&(!!/iPad|iPhone|iPod/.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!(null!=(e=(t=window).matchMedia)&&e.call(t,"(display-mode: standalone)").matches||!0===navigator.standalone);return{supported:s&&!a,iosNeedsInstall:a}}();e||(u(v()),x(t.iosNeedsInstall),"undefined"!=typeof Notification&&"denied"===Notification.permission&&N(!0));try{let t=await fetch("/api/push/vapid"),s=await t.json();e||(h(s.configured),g(s.publicKey))}catch(t){e||h(!1)}if(v())try{let t=await navigator.serviceWorker.getRegistration(),a=t?await t.pushManager.getSubscription():null;if(a&&!e){w(a.endpoint);let t=await fetch("/api/push/subscriptions?endpoint=".concat(encodeURIComponent(a.endpoint))),r=await t.json();if(!e){var s;$(!0===r.subscribed),O(null!=(s=r.delivery)?s:null)}r.subscribed&&r.subscription&&!e&&(P(r.subscription.preferences),E(!0===r.subscription.defaultsNoticePending))}}catch(e){}e||r(!1)})(),()=>{e=!0}},[]);let D=(0,o.useCallback)(async()=>{if(f){d(!0);try{var s,a;let r=await Notification.requestPermission();if("granted"!==r){N("denied"===r),t(e("toast.error"),"error");return}if(!await navigator.serviceWorker.getRegistration())return void t(e("toast.error"),"error");let n=await navigator.serviceWorker.ready,i=await n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:function(e){let t="=".repeat((4-e.length%4)%4),s=atob((e+t).replace(/-/g,"+").replace(/_/g,"/")),a=new Uint8Array(new ArrayBuffer(s.length));for(let e=0;e<s.length;e++)a[e]=s.charCodeAt(e);return a}(f)}),l=await fetch("/api/push/subscriptions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({subscription:i.toJSON(),deviceLabel:navigator.userAgent.slice(0,120)})});if(!l.ok)throw Error("subscribe request failed");let o=await l.json();w(i.endpoint),$(!0),O(null),(null==(s=o.subscription)?void 0:s.preferences)&&P(o.subscription.preferences),E((null==(a=o.subscription)?void 0:a.defaultsNoticePending)===!0),N(!1),t(e("toast.enabled"),"success")}catch(s){t(e("toast.error"),"error")}finally{d(!1)}}},[f,t,e]),F=(0,o.useCallback)(async()=>{d(!0);try{var s;let a=await navigator.serviceWorker.getRegistration(),r=a?await a.pushManager.getSubscription():null,n=null!=(s=null==r?void 0:r.endpoint)?s:k;r&&await r.unsubscribe(),n&&await fetch("/api/push/subscriptions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint:n})}),w(null),$(null),O(null),t(e("toast.disabled"),"info")}catch(s){t(e("toast.error"),"error")}finally{d(!1)}},[k,t,e]),R=(0,o.useCallback)(async(s,a)=>{if(!k)return;let r={...A,[s]:a};P(r);try{if(!(await fetch("/api/push/subscriptions",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint:k,preferences:r})})).ok)throw Error("update failed");t(e("toast.updated"),"success")}catch(s){P(A),t(e("toast.error"),"error")}},[k,A,t,e]),q=(0,o.useCallback)(async s=>{if(!k)return;let a=s?{...A,completion:!1}:A;E(!1),s&&P(a),d(!0);try{if(!(await fetch("/api/push/subscriptions",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint:k,...s?{preferences:a}:{},acknowledgeDefaultsNotice:!0})})).ok)throw Error("acknowledge failed");t(e(s?"defaultsNotice.adopted":"defaultsNotice.kept"),"success")}catch(s){P(A),E(!0),t(e("toast.error"),"error")}finally{d(!1)}},[k,A,t,e]);return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(l.Zp,{children:(0,a.jsx)(S,{})}),(0,a.jsx)(l.Zp,{children:s?(0,a.jsx)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:(0,a.jsx)(l.y$,{size:"sm"})}):c?m?(0,a.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"notifications-ios-guidance",children:e("ios.guidance")}):!1===p?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:e("notConfigured")}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:e("description")}),y&&(0,a.jsx)("p",{className:"text-sm text-danger-foreground","data-testid":"notifications-permission-denied",children:e("permission.denied")}),(()=>{if(null===M)return null;let t="removed"===M.state,s=M.statusCode,r=t?null===s?e("delivery.removedUnknownStatus"):e("delivery.removed",{status:String(s)}):null===s?e("delivery.failingUnknownStatus",{count:M.failureCount}):e("delivery.failing",{count:M.failureCount,status:String(s)});return(0,a.jsxs)("div",{className:t?"space-y-2 rounded-lg border border-danger-border bg-danger-subtle p-3":"space-y-2 rounded-lg border border-warning-border bg-warning-subtle p-3","data-testid":"notifications-delivery-health","data-delivery-state":M.state,children:[(0,a.jsx)("p",{className:t?"text-sm font-semibold text-danger-foreground":"text-sm font-semibold text-warning-foreground",children:e(t?"delivery.headingRemoved":"delivery.headingFailing")}),(0,a.jsx)("p",{className:"text-xs text-foreground",children:r}),403===s&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"notifications-delivery-apns-hint",children:e("delivery.apnsHint")}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:e("delivery.since",{timestamp:new Date(M.firstFailureAt).toLocaleString()})})]})})(),z?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-foreground",children:e("enabledOnThisDevice")}),T&&(0,a.jsxs)("div",{className:"space-y-3 rounded-lg border border-info-border bg-info-subtle p-3","data-testid":"notifications-defaults-notice",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-info-foreground",children:e("defaultsNotice.heading")}),(0,a.jsx)("p",{className:"text-xs text-foreground",children:e("defaultsNotice.completionChanged")}),(0,a.jsx)("p",{className:"text-xs text-foreground",children:e("defaultsNotice.failuresAdded")}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(l.$n,{variant:"primary",onClick:()=>q(!0),disabled:n,"data-testid":"notifications-defaults-notice-adopt",children:e("defaultsNotice.adopt")}),(0,a.jsx)(l.$n,{variant:"secondary",onClick:()=>q(!1),disabled:n,"data-testid":"notifications-defaults-notice-keep",children:e("defaultsNotice.keep")})]})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e("types.heading")}),(0,a.jsxs)("label",{className:"flex items-center justify-between gap-4",children:[(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"block text-sm font-medium text-foreground",children:e("types.promptWaiting")}),(0,a.jsx)("span",{className:"block text-xs text-muted-foreground",children:e("types.promptWaitingDesc")})]}),(0,a.jsx)(l.dO,{checked:A.prompt,onCheckedChange:e=>R("prompt",e),disabled:n,"aria-label":e("types.promptWaiting"),"data-testid":"notifications-toggle-prompt"})]}),(0,a.jsxs)("label",{className:"flex items-center justify-between gap-4",children:[(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"block text-sm font-medium text-foreground",children:e("types.completion")}),(0,a.jsx)("span",{className:"block text-xs text-muted-foreground",children:e("types.completionDesc")})]}),(0,a.jsx)(l.dO,{checked:A.completion,onCheckedChange:e=>R("completion",e),disabled:n,"aria-label":e("types.completion"),"data-testid":"notifications-toggle-completion"})]})]}),(0,a.jsx)(l.$n,{variant:"secondary",onClick:F,disabled:n,"data-testid":"notifications-unsubscribe",children:e("unsubscribe")})]}):(0,a.jsxs)(l.$n,{variant:"primary",onClick:D,disabled:n||y||!f,"data-testid":"notifications-enable",children:[(0,a.jsx)(b,{className:"h-4 w-4"}),n?e("enabling"):e("enable")]})]}):(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:e("unsupported")})}),(0,a.jsx)(l.Zp,{children:(0,a.jsx)(C,{})})]})}function C(){let e=(0,i.c)("notifications"),{showToast:t}=(0,j.dj)(),[s,r]=(0,o.useState)(!0),[n,d]=(0,o.useState)(!1),[c,u]=(0,o.useState)(N),[m,x]=(0,o.useState)([...k]);(0,o.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch("/api/push/escalation"),s=await t.json();!e&&(s.settings&&u(s.settings),Array.isArray(s.choices)&&s.choices.length>0&&x(s.choices))}catch(e){}finally{e||r(!1)}})(),()=>{e=!0}},[]);let p=(0,o.useCallback)(async s=>{u(s),d(!0);try{if(!(await fetch("/api/push/escalation",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:s})})).ok)throw Error("update failed");t(e("toast.updated"),"success")}catch(s){u(c),t(e("toast.error"),"error")}finally{d(!1)}},[c,t,e]);return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e("escalation.heading")}),(0,a.jsxs)("label",{className:"flex items-center justify-between gap-4",children:[(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"block text-sm font-medium text-foreground",children:e("escalation.toggle")}),(0,a.jsx)("span",{className:"block text-xs text-muted-foreground",children:e("escalation.toggleDesc")})]}),(0,a.jsx)(l.dO,{checked:c.enabled,onCheckedChange:e=>p({...c,enabled:e}),disabled:s||n,"aria-label":e("escalation.toggle"),"data-testid":"notifications-toggle-escalation"})]}),(0,a.jsxs)("label",{className:"flex items-center justify-between gap-4",children:[(0,a.jsx)("span",{className:"text-sm text-foreground",children:e("escalation.threshold")}),(0,a.jsx)("select",{className:"rounded-md border border-border bg-background px-2 py-1 text-sm text-foreground",value:String(c.thresholdMinutes),disabled:s||n||!c.enabled,"aria-label":e("escalation.threshold"),"data-testid":"notifications-escalation-threshold",onChange:e=>p({...c,thresholdMinutes:Number(e.target.value)}),children:m.map(t=>(0,a.jsx)("option",{value:String(t),children:e("escalation.minutes",{count:t})},t))})]})]})}function S(){let e=(0,i.c)("notifications"),{enabled:t,setEnabled:s}=(0,y.qG)(),{enabled:r,setEnabled:n}=(0,y.Ql)();return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e("inApp.heading")}),(0,a.jsxs)("label",{className:"flex items-center justify-between gap-4",children:[(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"block text-sm font-medium text-foreground",children:e("inApp.waitingToggle")}),(0,a.jsx)("span",{className:"block text-xs text-muted-foreground",children:e("inApp.waitingToggleDesc")})]}),(0,a.jsx)(l.dO,{checked:t,onCheckedChange:s,"aria-label":e("inApp.waitingToggle"),"data-testid":"notifications-toggle-inapp-waiting"})]}),(0,a.jsxs)("label",{className:"flex items-center justify-between gap-4",children:[(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"block text-sm font-medium text-foreground",children:e("inApp.soundToggle")}),(0,a.jsx)("span",{className:"block text-xs text-muted-foreground",children:e("inApp.soundToggleDesc")})]}),(0,a.jsx)(l.dO,{checked:r,onCheckedChange:n,"aria-label":e("inApp.soundToggle"),"data-testid":"notifications-toggle-inapp-sound"})]})]})}s(72604),s(95275),s(79832);var A=s(46022);function P(){let e=(0,i.c)("notifications"),t=(0,i.c)("common"),s=(0,i.c)("skills");return(0,a.jsxs)("div",{className:"container-custom py-8 overflow-auto h-full",children:[(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2",children:t("nav.more")}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:t("settings.pageDescription")})]}),(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-4 text-foreground",children:"Quick Links"}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,a.jsx)(n(),{href:"/repositories",className:"block","data-testid":"more-link-repositories",children:(0,a.jsxs)(l.Zp,{hover:!0,className:"transition-colors hover:border-accent-300 dark:hover:border-accent-700",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-foreground",children:"Repositories"}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground",children:"Manage repositories and worktrees"})]})}),(0,a.jsx)(n(),{href:"/skills",className:"block","data-testid":"more-link-skills",children:(0,a.jsxs)(l.Zp,{hover:!0,className:"transition-colors hover:border-accent-300 dark:hover:border-accent-700",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-foreground",children:t("nav.skills")}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground",children:s("page.description")})]})}),(0,a.jsx)(n(),{href:"/skills/installed",className:"block","data-testid":"more-link-skills-installed",children:(0,a.jsxs)(l.Zp,{hover:!0,className:"transition-colors hover:border-accent-300 dark:hover:border-accent-700",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-foreground",children:s("dashboard.title")}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground",children:s("dashboard.description")})]})})]})]}),(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-4 text-foreground",children:t("settings.title")}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(A.he,{}),(0,a.jsx)(A.$8,{}),(0,a.jsx)(A.uN,{})]})]}),(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-4 text-foreground",children:e("title")}),(0,a.jsx)(w,{})]}),(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-4 text-foreground",children:"External Apps"}),(0,a.jsx)(g,{})]}),(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-4 text-foreground",children:"About"}),(0,a.jsx)(l.Zp,{children:(0,a.jsx)("div",{className:"text-sm text-muted-foreground",children:"CommandMate - A local control plane for agent CLIs."})})]})]})}}},e=>{e.O(0,[6809,4909,2770,2619,8019,2407,344,5449,6966,6022,4322,8441,1255,7358],()=>e(e.s=80867)),_N_E=e.O()}]);
|