commandmate 0.45.0 → 0.45.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 +265 -264
- package/.next/app-path-routes-manifest.json +18 -18
- package/.next/build-manifest.json +5 -5
- package/.next/prerender-manifest.json +9 -9
- package/.next/react-loadable-manifest.json +4 -4
- package/.next/required-server-files.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_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.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]/direct-input/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.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.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.js +1 -1
- package/.next/server/app/api/worktrees/route_client-reference-manifest.js +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_client-reference-manifest.js +1 -1
- package/.next/server/app/offline/page_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +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 +4 -4
- 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_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +18 -18
- package/.next/server/chunks/2119.js +1 -1
- package/.next/server/chunks/2335.js +1 -0
- package/.next/server/chunks/2404.js +1 -1
- package/.next/server/chunks/2445.js +1 -1
- package/.next/server/chunks/2460.js +1 -1
- package/.next/server/chunks/{4802.js → 4243.js} +1 -1
- package/.next/server/chunks/4837.js +3 -3
- package/.next/server/chunks/5209.js +1 -1
- package/.next/server/chunks/5625.js +2 -2
- package/.next/server/chunks/6130.js +1 -1
- package/.next/server/chunks/6401.js +1 -1
- package/.next/server/chunks/6927.js +1 -1
- package/.next/server/chunks/8728.js +1 -1
- package/.next/server/chunks/9355.js +1 -0
- package/.next/server/chunks/9862.js +1 -0
- 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/{7485.8a2a9d7c5396aa26.js → 1111.5ab4f0ffb0d944e5.js} +2 -2
- package/.next/static/chunks/{1642-767aed8e7c61ef7f.js → 1642-0f1bf8fb8161e10a.js} +1 -1
- package/.next/static/chunks/{2407-dd4a0f04f1349221.js → 2407-86890b00eeecf391.js} +1 -1
- package/.next/static/chunks/3662-5a27ee39a3ecba49.js +1 -0
- package/.next/static/chunks/3922.0bc2e4e168d2b522.js +1 -0
- package/.next/static/chunks/4541-b0ce0bf829ae79b7.js +1 -0
- package/.next/static/chunks/4727-4c69d1aa4118cc09.js +1 -0
- package/.next/static/chunks/5371-af1c2b68e983da61.js +1 -0
- package/.next/static/chunks/6288-09feba367cc2c65e.js +1 -0
- package/.next/static/chunks/953.31c52a251deda22d.js +1 -0
- package/.next/static/chunks/app/{layout-07d040cb3d3ea657.js → layout-eaa6365f8f942e88.js} +1 -1
- package/.next/static/chunks/app/sessions/{page-2af68c63211c751f.js → page-ebfed2c80e916fb8.js} +1 -1
- package/.next/static/chunks/app/skills/[skillId]/page-e4b14031f946c007.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/files/[...path]/page-9cf1ecc59e36a004.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/page-3372b78fde232b1f.js +1 -0
- package/.next/static/chunks/{webpack-165d8df9acd1c5d4.js → webpack-ee3ccbe378c4aa06.js} +1 -1
- package/.next/static/css/{057f64a65726c439.css → 6faeb04a0b6819d4.css} +1 -1
- package/.next/trace +13 -13
- package/dist/server/locales/en/worktree.json +2 -1
- package/dist/server/locales/ja/worktree.json +2 -1
- package/dist/server/src/lib/auto-yes-poller.js +16 -163
- package/dist/server/src/lib/polling/auto-yes-enter-fallback-state.js +1 -1
- package/dist/server/src/lib/polling/auto-yes-poller-state.js +52 -0
- package/dist/server/src/lib/polling/auto-yes-prompt-suppression.js +125 -0
- package/dist/server/src/lib/polling/prompt-dedup.js +93 -2
- package/dist/server/src/lib/polling/response-checker.js +40 -2
- package/dist/server/src/lib/polling/response-dedup.js +62 -1
- package/package.json +1 -1
- package/release-notes/0.45.1.json +38 -0
- package/.next/server/chunks/364.js +0 -1
- package/.next/server/chunks/488.js +0 -1
- package/.next/server/chunks/5326.js +0 -1
- package/.next/static/chunks/2053-390e77fce43b555c.js +0 -1
- package/.next/static/chunks/3922.f45dcfc1e7da552a.js +0 -1
- package/.next/static/chunks/4727-5d695d71e3fdf97b.js +0 -1
- package/.next/static/chunks/8283-26ad31a4670ea52d.js +0 -1
- package/.next/static/chunks/8566-aeda747542072ace.js +0 -1
- package/.next/static/chunks/8811-29eaa24237f48558.js +0 -1
- package/.next/static/chunks/953.19e4c8178c9eac4c.js +0 -1
- package/.next/static/chunks/app/skills/[skillId]/page-9ee7a381636e60cb.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/files/[...path]/page-5445205c8dd80109.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/page-35f0e31a725d1c89.js +0 -1
- /package/.next/static/{TPWbZB3zBp3Zv_eFEOlmt → vYIpFRCU_Mt0wtG8F_3-6}/_buildManifest.js +0 -0
- /package/.next/static/{TPWbZB3zBp3Zv_eFEOlmt → vYIpFRCU_Mt0wtG8F_3-6}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5371],{9705:(e,t,n)=>{n.d(t,{Gw:()=>M,Wo:()=>w,Rb:()=>o,tz:()=>a,i4:()=>i,i5:()=>r,Zq:()=>l,Ad:()=>k,Gg:()=>z,aX:()=>D,fq:()=>q,HI:()=>L,eu:()=>B,p0:()=>O,po:()=>A});let l="data-search-skip",r="data-mermaid-source",i="data-mermaid-raw-start",a="data-mermaid-raw-end",o="commandmate:mermaid-block-settled";var u=n(14733),s=n(29833),f=n(99112);let d=/^( {0,3})(`{3,}|~{3,})(.*)$/,c=/^ {0,3}(?:[-*+]|\d{1,9}[.)]) {1,4}(?=`{3,}|~{3,})/;function h(e,t,n,l){let r=0;for(;r<l&&t+r<n&&" "===e[t+r];)r+=1;return r}let g=/^ {0,3}>[ \t]?/;function p(e,t,n){let l=0,r=t.start;for(;l<n;){let n=g.exec(e.slice(r,t.end));if(!n)break;r+=n[0].length,l+=1}return{depth:l,contentStart:r}}let m=null;function y(e){let t=e.filter(e=>e.end>e.start).sort((e,t)=>e.start-t.start),n=[];for(let e of t){let t=n[n.length-1];t&&e.start<=t.end?t.end=Math.max(t.end,e.end):n.push({...e})}return n}function v(e,t){let n=e.map(e=>({...e}));for(let e of t)n=n.flatMap(t=>{if(e.end<=t.start||e.start>=t.end)return[t];let n=[];return e.start>t.start&&n.push({start:t.start,end:e.start}),e.end<t.end&&n.push({start:e.end,end:t.end}),n});return n}function b(e,t,n){return e.map(e=>({start:Math.max(e.start,t),end:Math.min(e.end,n)})).filter(e=>e.end>e.start)}function x(e,t,n){return t.flatMap(t=>(function(e,t){let n=[];if(!t)return n;let l=0;for(;;){let r=e.indexOf(t,l);if(-1===r)return n;n.push(r),l=r+1}})(e.slice(t.start,t.end),n).filter(e=>t.start+e+n.length<=t.end).map(e=>t.start+e))}let E=(e,t)=>e.some(e=>t>=e.start&&t<e.end),S="data-search-section",w=e=>e,N=/^[ \t>]*$/;function k(e,t,n){if(e===t)return w;let l=[],r=0;for(let e of t.split("\n"))(!n||n.some(e=>r>=e.start&&r<e.end))&&l.push({start:r,text:e}),r+=e.length+1;let i=[],a=[],o=0,u=0;for(let t of e.split("\n")){let e=-1;for(let n=o;n<l.length;n++){let r=l[n].text;if(r.endsWith(t)&&N.test(r.slice(0,r.length-t.length))){e=n;break}}if(-1===e)return null;i.push(u),a.push(l[e].start+l[e].text.length-t.length),u+=t.length+1,o=e+1}return t=>{if(t<0||t>e.length)return null;let n=0,l=i.length-1;for(;n<l;){let e=n+l+1>>1;i[e]<=t?n=e:l=e-1}return a[n]+(t-i[n])}}let C="data-search-raw",T=e=>"number"==typeof(null==e?void 0:e.offset)?e.offset:null;function I(e,t){var n,l;let r=T(null==(n=e.position)?void 0:n.start),i=T(null==(l=e.position)?void 0:l.end);if(null===r||null===i)return null;let a=t(r),o=t(i);return null!==a&&null!==o&&o>=a?{start:a,end:o}:null}function O(e){let t=(null==e?void 0:e.toRaw)===void 0?w:e.toRaw;return e=>{t&&function e(t,n){if("root"===t.type||"element"===t.type){if("element"===t.type){let e=I(t,n);if(e){let l=["".concat(e.start,",").concat(e.end)];for(let e of t.children){if("text"!==e.type)continue;let t=I(e,n);l.push(t?"".concat(t.start,",").concat(t.end,",").concat(e.value.length):",,".concat(e.value.length))}t.properties={...t.properties,dataSearchRaw:l.join(";")}}}for(let l of t.children)e(l,n)}}(e,t)}}function A(e){let t=e[C];return"string"==typeof t?{[C]:t}:{}}function j(e,t,n,l){if(t.slice(n,n+e.length)===e)return Array.from({length:e.length},(e,t)=>n+t);let r=[],i=n;for(let n of e)for(let e=0;e<n.length;e++){let a=t.indexOf(n[e],i);if(-1===a||a>=l)return null;r.push(a),i=a+1}return r}let R=/^[ \t>]*(`{3,}|~{3,})/,_={highlightName:"terminal-search",currentHighlightName:"terminal-search-current",fallbackOverlayId:"terminal-search-fallback-overlay",fallbackOverlayBgColor:"rgba(255, 165, 0, 0.6)"},M={highlightName:"history-search",currentHighlightName:"history-search-current",fallbackOverlayId:"history-search-fallback-overlay",fallbackOverlayBgColor:"rgba(59, 130, 246, 0.6)"};function B(e){return{highlightName:"history-search-".concat(e),currentHighlightName:"history-search-current-".concat(e),fallbackOverlayId:"history-search-fallback-overlay-".concat(e),fallbackOverlayBgColor:M.fallbackOverlayBgColor}}function H(){return"undefined"!=typeof CSS&&null!==CSS&&"highlights"in CSS}function W(e){var t;H()&&(CSS.highlights.delete(e.highlightName),CSS.highlights.delete(e.currentHighlightName)),null==(t=document.getElementById(e.fallbackOverlayId))||t.remove()}function F(e,t,n,o,g){var w,N,k,T,I;if(0===t.length)return void W(o);let O=function(e){let t,n=[],r=0,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,{acceptNode:e=>e.nodeType===Node.TEXT_NODE?NodeFilter.FILTER_ACCEPT:e.hasAttribute(l)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP});for(;t=i.nextNode();){var a,o;let e=t,l=null!=(o=null==(a=e.nodeValue)?void 0:a.length)?o:0;n.push({node:e,start:r,end:r+l}),r+=l}return n}(e),A=(null!=(T=(null==g?void 0:g.sourceText)!==void 0?null!=(k=function(e,t,n,l,o){let g=Array.from(e.querySelectorAll("[".concat(r,"]")));if(0===g.length)return null;let w=null,N=t.map(e=>{var t;return null!=(t=e.node.nodeValue)?t:""}).join(""),k=new Set(o.map(e=>e.key)),C=t=>{var n;let l=null==(n=t.nodeType===Node.TEXT_NODE?t.parentElement:t)?void 0:n.closest("[".concat(S,"]")),r=l&&e.contains(l)?l.getAttribute(S):null;return null!==r&&k.has(r)?r:""},T=new Map(o.map(e=>[e.key,y(e.ranges)])),I=y(o.flatMap(e=>e.ranges)),O=["",...k].map(e=>{let l=""===e?v([{start:0,end:n.length}],I):T.get(e),r=y(t.filter(t=>C(t.node)===e).map(e=>{let{start:t,end:n}=e;return{start:t,end:n}})),o=[];for(let n of g){if(C(n)!==e)continue;let l=t.filter(e=>n.contains(e.node));if(0===l.length)continue;let r=l[0].start,i=l[l.length-1].end;o.push({domStart:r,domEnd:i,text:N.slice(r,i),element:n})}let x=function(e,t,n){if(0===n.length)return null;let l=[];for(let u of n){var r,o;let n=Number.parseInt(null!=(r=u.element.getAttribute(i))?r:"",10),s=Number.parseInt(null!=(o=u.element.getAttribute(a))?o:"",10);if(!Number.isInteger(n)||!Number.isInteger(s)||!E(t,n))return null;let f=function(e,t,n,l){var r;if(!(t>=0&&n<=e.length&&t<n))return null;let i=e.slice(t,n);if(!/^(?:`{3,}|~{3,})/.test(i))return null;let a=i.split("\n"),o=l.length>0?l.split("\n"):[],u=a.length-1;if(o.length>0&&u!==o.length&&u!==o.length+1)return null;let s=[],f=t+a[0].length+1,d=0;for(let e=0;e<o.length;e++){let t=a[e+1],n=o[e];if(!t.endsWith(n))return null;s.push({rawStart:f+t.length-n.length,length:n.length,bodyOffset:d}),d+=n.length+1,f+=t.length+1}let c=(null!=(r=e.slice(e.lastIndexOf("\n",t-1)+1,t).match(/>/g))?r:[]).length;return{fenceStart:t,bodyStart:s.length>0?t+a[0].length+1:t+a[0].length,bodyEnd:s.length>0?s[s.length-1].rawStart+s[s.length-1].length:t+a[0].length,fenceEnd:n,body:l,quoteDepth:c,lines:s}}(e,n,s,u.text),d=l[l.length-1];if(!f||d&&f.fenceStart<d.fenceEnd)return null;l.push(f)}return l}(n,l,o),S=null!=x?x:(null!=w?w:w=function(e){let t=[],n=function(e){null!=m||(m=(0,s.l)().use(u.A).use(f.eT));let t=new Set;for(let l of function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if("code"===t.type)"mermaid"===t.lang&&n.push(t);else if("children"in t)for(let l of t.children)e(l,n);return n}(m.parse(e))){var n;let e=null==(n=l.position)?void 0:n.start.offset;void 0!==e&&t.add(e)}return t}(e),l=[],r=0;for(;r<=e.length;){let t=e.indexOf("\n",r),n=-1===t?e.length:t;if(l.push({start:r,end:n}),-1===t)break;r=t+1}for(let r=0;r<l.length;r++){let{depth:i,contentStart:a}=p(e,l[r],1/0),o=c.exec(e.slice(a,l[r].end)),u=o?o[0].length:0,s=d.exec(e.slice(a+u,l[r].end));if(!s)continue;let f=a+u+s[1].length;if(!n.has(f))continue;let g=s[1].length,m=s[2],y=s[3].trim();if("`"===m[0]&&y.includes("`"))continue;let v=new RegExp("^ {0,3}".concat("`"===m[0]?"`":"~","{").concat(m.length,",}[ \\t]*$")),b=[],x=r;for(let t=r+1;t<l.length;t++){let n=p(e,l[t],i);if(n.depth<i)break;let r=n.contentStart,a=l[t].end;if(u>0){let t=h(e,r,a,u);if(0!==e.slice(r,a).trim().length&&t<u)break;r+=t}if(x=t,v.test(e.slice(r,a)))break;r+=h(e,r,a,g),b.push({rawStart:r,length:a-r,bodyOffset:0})}if("mermaid"===y.split(/[ \t]/)[0]){let n=0;for(let e of b)e.bodyOffset=n,n+=e.length+1;let a=b.length>0?l[r+1].start:l[r].end,o=b.length>0?b[b.length-1].rawStart+b[b.length-1].length:a;t.push({fenceStart:l[r].start,bodyStart:a,bodyEnd:o,fenceEnd:l[x].end,body:b.map(t=>e.slice(t.rawStart,t.rawStart+t.length)).join("\n"),quoteDepth:i,lines:b})}r=x}return t}(n)).filter(e=>E(l,e.fenceStart)),k=[];if(x)x.forEach((e,t)=>k.push({fence:e,source:o[t]}));else if(S.length===o.length&&S.every((e,t)=>e.body===o[t].text))S.forEach((e,t)=>k.push({fence:e,source:o[t]}));else{let e=0;for(let t of o)for(let n=e;n<S.length;n++)if(S[n].body===t.text){k.push({fence:S[n],source:t}),e=n+1;break}}let O=y(S.map(e=>({start:e.fenceStart,end:e.fenceEnd}))),A=y(o.map(e=>({start:e.domStart,end:e.domEnd}))),j=[],R=0,_=0;for(let e of[...k.map(e=>({rawStart:e.fence.fenceStart,rawEnd:e.fence.fenceEnd,domStart:e.source.domStart,domEnd:e.source.domEnd})),{rawStart:1/0,rawEnd:0,domStart:1/0,domEnd:0}])j.push({raw:v(b(l,R,e.rawStart),O),dom:v(b(r,_,e.domStart),A),rawFrom:R,rawTo:e.rawStart}),R=e.rawEnd,_=e.domEnd;return{raw:l,fences:S,pairs:k,gaps:j}}),A=n.toLowerCase(),j=N.toLowerCase();return l.map(e=>{let t=e.end-e.start,n=O.find(t=>E(t.raw,e.start));if(!n)return null;let l=n.fences.find(t=>e.start>=t.fenceStart&&e.start<t.fenceEnd);if(l){let r=n.pairs.find(e=>e.fence===l);if(!r)return null;let i=l.lines.find(t=>e.start>=t.rawStart&&e.start<t.rawStart+t.length);if(!i)return null;let a=r.source.domStart+i.bodyOffset+(e.start-i.rawStart);return{start:a,end:Math.min(a+t,r.source.domEnd)}}let r=n.gaps.find(t=>e.start>=t.rawFrom&&e.start<t.rawTo);if(!r)return null;let i=A.slice(e.start,e.end),a=x(A,r.raw,i).indexOf(e.start),o=x(j,r.dom,i);return -1===a||a>=o.length?null:{start:o[a],end:o[a]+t}})}(e,O,g.sourceText,t,null!=(N=g.sections)?N:[]))?k:null==(w=function(e,t,n,l){var r,i;if(!e.querySelector("[".concat(C,"]")))return null;let a=new Map;for(let n of t){let t=null==(r=n.node.parentElement)?void 0:r.closest("[".concat(C,"]"));if(!t||!e.contains(t))continue;let l=a.get(t);l?l.push(n):a.set(t,[n])}let o=new Int32Array(n.length).fill(-1);for(let[e,t]of a){let l=function(e){let[t,...n]=e.split(";"),[l,r]=t.split(",").map(e=>Number.parseInt(e,10));if(!Number.isInteger(l)||!Number.isInteger(r))return null;let i=[];for(let e of n){let[t,n,l]=e.split(","),r=Number.parseInt(l,10);if(!Number.isInteger(r)||r<0)return null;let a=""===t?null:Number.parseInt(t,10),o=""===n?null:Number.parseInt(n,10);if(null!==a&&!Number.isInteger(a)||null!==o&&!Number.isInteger(o))return null;i.push({start:a,end:o,length:r})}return{start:l,end:r,segments:i}}(null!=(i=e.getAttribute(C))?i:"");if(!l)continue;let r=t.map(e=>{var t;return null!=(t=e.node.nodeValue)?t:""}).join("");if(l.segments.reduce((e,t)=>e+t.length,0)!==r.length)continue;let a=[];for(let e of t)for(let t=e.start;t<e.end;t++)a.push(t);let u=l.start;if(R.exec(n.slice(l.start,l.end))){let e=n.indexOf("\n",l.start);u=-1===e?l.end:e+1}let s=0;for(let e of l.segments){let t=r.slice(s,s+e.length),i=null;null!==e.start&&null!==e.end?(i=j(t,n,e.start,e.end))&&(u=Math.max(u,e.end)):""!==t.trim()&&(i=j(t,n,u,l.end))&&i.length>0&&(u=i[i.length-1]+1),null==i||i.forEach((e,t)=>{e<o.length&&-1===o[e]&&(o[e]=a[s+t])}),s+=e.length}}return l.map(e=>{if(e.end<=e.start||e.end>o.length)return null;let t=o[e.start],n=o[e.end-1];return -1!==t&&-1!==n&&n>=t?{start:t,end:n+1}:null})}(e,O,g.sourceText,t))?void 0:w.map((e,n)=>null!=e?e:t[n]):null)?T:t).map(e=>e?function(e,t,n){let l=document.createRange(),r=!1;for(let{node:i,start:a,end:o}of e)if(!r&&t<o&&t>=a&&(l.setStart(i,t-a),r=!0),r&&n<=o)return l.setEnd(i,n-a),l;return r?l:null}(O,e.start,e.end):null);A.forEach(t=>{t&&function(e,t){let n=e.startContainer,l=n.nodeType===Node.TEXT_NODE?n.parentElement:n,i=null==l?void 0:l.closest("details");i instanceof HTMLDetailsElement&&!i.open&&t.contains(i)&&i.querySelector("[".concat(r,"]"))&&(i.open=!0)}(t,e)});let _=null!=(I=A[n])?I:null;if(H()){let e=[];A.forEach((t,l)=>{l!==n&&t&&e.push(t)}),CSS.highlights.set(o.highlightName,new Highlight(...e)),CSS.highlights.delete(o.currentHighlightName)}if(function(e,t,n){let l=document.getElementById(n.fallbackOverlayId);if(!t||"function"!=typeof t.getBoundingClientRect){null==l||l.remove();return}let r=t.getBoundingClientRect(),i=e.getBoundingClientRect();l?l.style.backgroundColor=n.fallbackOverlayBgColor:((l=document.createElement("div")).id=n.fallbackOverlayId,l.style.position="absolute",l.style.backgroundColor=n.fallbackOverlayBgColor,l.style.borderRadius="2px",l.style.pointerEvents="none",l.style.zIndex="5",e instanceof HTMLElement&&(e.style.position="relative"),e.appendChild(l)),l.style.top="".concat(r.top-i.top+e.scrollTop,"px"),l.style.left="".concat(r.left-i.left+e.scrollLeft,"px"),l.style.width="".concat(r.width,"px"),l.style.height="".concat(r.height,"px")}(e,_,o),_){let e=_.startContainer,t=e.nodeType===Node.TEXT_NODE?e.parentElement:e;t&&"function"==typeof t.scrollIntoView&&t.scrollIntoView({block:"center",behavior:"smooth"})}}function L(){W(_)}function D(e,t,n){F(e,t,n,_)}function q(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M;W(e)}function z(e,t,n){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:M,r=arguments.length>4?arguments[4]:void 0;F(e,t,n,l,r)}},11620:(e,t,n)=>{n.d(t,{D:()=>i,c:()=>r});var l=n(12115);function r(e){return!!e&&e.split(" ").includes("language-mermaid")}function i(e){let t=l.Children.toArray(e)[0];if(!l.isValidElement(t))return!1;let n=t.props.className;return r("string"==typeof n?n:void 0)}},32388:(e,t,n)=>{n.d(t,{AY:()=>p});var l=n(95155),r=n(12115),i=n(67909),a=n(18955),o=n(3005),u=n(9705),s=n(11620),f=n(63453);let d=(0,i.default)(()=>Promise.all([n.e(221),n.e(1111),n.e(953)]).then(n.bind(n,90953)).then(e=>({default:e.MermaidDiagram})),{loadableGenerated:{webpack:()=>[90953]},ssr:!1,loading:function(){let e=(0,a.c)("worktree");return(0,l.jsxs)("div",{className:"mermaid-loading flex items-center gap-2 text-muted-foreground p-4",children:[(0,l.jsx)(o.y,{size:"sm"}),(0,l.jsx)("span",{children:e("mermaid.loading")})]})}}),c={[u.Zq]:"true"},h={[u.i5]:"true"};function g(e){let{code:t,node:n}=e,i=(0,a.c)("worktree"),[o,s]=(0,r.useState)(!1),g=(0,r.useRef)(null),p=(0,r.useCallback)(e=>{var t;s("error"===e),null==(t=g.current)||t.dispatchEvent(new CustomEvent(u.Rb,{bubbles:!0}))},[]),m=t.endsWith("\n")?t.slice(0,-1):t,y=(0,r.useContext)(f.E),v=function(e){var t,n;let l=null==e?void 0:e.position,r=null==l||null==(t=l.start)?void 0:t.offset,i=null==l||null==(n=l.end)?void 0:n.offset;return"number"==typeof r&&"number"==typeof i?{start:r,end:i}:null}(n),b=v&&y?y(v.start):null,x=v&&y?y(v.end):null,E=null!==b&&null!==x&&x>b?{[u.i4]:String(b),[u.tz]:String(x)}:{};return(0,l.jsxs)("div",{ref:g,"data-testid":"mermaid-block-frame",className:"mermaid-block",children:[(0,l.jsx)("div",{...c,className:"mermaid-figure",children:(0,l.jsx)(d,{code:t,onRenderStateChange:p})}),(0,l.jsxs)("details",{"data-testid":"mermaid-source",className:"mermaid-source",open:o||void 0,children:[(0,l.jsx)("summary",{...c,children:i("mermaid.source")}),(0,l.jsx)("pre",{children:(0,l.jsx)("code",{...h,...E,children:m})})]})]})}function p(e){let{className:t,children:n,node:r}=e;if((0,s.c)(t)){let e=null==n?"":"string"==typeof n?n:Array.isArray(n)?n.map(e=>"string"==typeof e?e:"").join(""):String(n);return(0,l.jsx)(g,{code:e,node:r})}return(0,l.jsx)("code",{className:t,children:n})}},60322:(e,t,n)=>{n.d(t,{l:()=>r});let l=/\x1b\[[0-9;]*[a-zA-Z]|\x1b\][^\x07]*\x07|\[[0-9;]*m/g;async function r(e){var t;if(!e||0===e.trim().length)return;let n=e.replace(l,"");if(null==(t=navigator.clipboard)?void 0:t.writeText)try{await navigator.clipboard.writeText(n);return}catch(e){}let r=document.createElement("textarea");r.value=n,r.style.position="fixed",r.style.left="-9999px",r.style.top="-9999px",r.style.opacity="0",document.body.appendChild(r),r.focus(),r.select();try{document.execCommand("copy")}finally{document.body.removeChild(r)}}},63453:(e,t,n)=>{n.d(t,{E:()=>i});var l=n(12115),r=n(9705);let i=(0,l.createContext)(r.Wo)},99112:(e,t,n)=>{n.d(t,{eT:()=>s});var l=n(22133);let r=["**","__"],i=/^https?:\/\/./i;function a(e){return"object"==typeof e&&null!==e&&"string"==typeof e.type}function o(e,t){var n,l;let r=e.position;if(!r)return null;let i=null==(n=r.start)?void 0:n.offset,a=null==(l=r.end)?void 0:l.offset;return"number"!=typeof i||"number"!=typeof a||!Number.isInteger(i)||!Number.isInteger(a)||i<0||a<i||a>t.length?null:{start:i,end:a}}function u(e,t){var n;return{line:e.line,column:e.column+t,offset:(null!=(n=e.offset)?n:0)+t}}let s=Object.freeze([l.A,function(){return function(e,t){let n=function(e){if("string"==typeof e)return e;if("object"==typeof e&&null!==e){let t=e.value;if("string"==typeof t)return t}return null}(t);null!==n&&a(e)&&function e(t,n){let l=Array.isArray(t.children)?t:null;if(l)for(let t of(!function(e,t){let n=e.children;for(let e=0;e<n.length;e+=1){var l,s,f,d,c,h,g;let p=n[e];if(!a(p)||!function(e,t){if("link"!==e.type||null!==e.title&&void 0!==e.title)return!1;let n=e.url;if("string"!=typeof n||!i.test(n))return!1;let l=o(e,t);if(!l||t.slice(l.start,l.end)!==n)return!1;let r=e.children;if(!Array.isArray(r)||1!==r.length)return!1;let u=r[0];if(!a(u)||"text"!==u.type||u.value!==n)return!1;let s=o(u,t);return null!==s&&s.start===l.start&&s.end===l.end}(p,t))continue;let m=function(e){let t=function(e){for(let t=0;t<e.length;t+=1)if("()、。「」【】".includes(e[t]))return t;return -1}(e);if(t<=0)return null;let n=e.slice(0,t),l=r.find(e=>n.endsWith(e)),a=l?t-l.length:t;if(a<=0)return null;let o=e.slice(0,a);return i.test(o)?{keptUrl:o,tailText:e.slice(a),tailOffset:a,delimiter:null!=l?l:null}:null}(p.url);if(!m)continue;let y=o(p,t),v=null==(l=p.position)?void 0:l.start,b=null==(s=p.position)?void 0:s.end;if(!y||!v||!b)continue;let x=null!==m.delimiter&&function(e,t,n,l){if(!e||"text"!==e.type||"string"!=typeof e.value||!e.value.endsWith(t))return!1;let r=o(e,l);if(!r||r.end!==n)return!1;let i=l.slice(r.start,r.end);if(!i.endsWith(t))return!1;let a=i.length-t.length-1;return a<0||"\\"!==i[a]}(n[e-1],m.delimiter,y.start,t),E=x?m.tailText.slice(null!=(h=null==(f=m.delimiter)?void 0:f.length)?h:0):m.tailText,S=x?m.tailOffset+(null!=(g=null==(d=m.delimiter)?void 0:d.length)?g:0):m.tailOffset,w=u(v,m.keptUrl.length);p.url=m.keptUrl;let N=null==(c=p.children)?void 0:c[0];N&&(N.value=m.keptUrl,N.position={start:{...v},end:{...w}}),p.position={start:{...v},end:w};let k={type:"text",value:E,position:{start:u(v,S),end:{...b}}};if(x&&m.delimiter){let t=n[e-1],l=u(v,-m.delimiter.length),r={type:"strong",children:[p],position:{start:l,end:u(v,S)}},i=t.value.slice(0,-m.delimiter.length);0===i.length?(n.splice(e-1,1),e-=1):(t.value=i,t.position&&(t.position={...t.position,end:l})),n[e]=r}n.splice(e+1,0,k),e+=1}}(l,n),l.children))a(t)&&e(t,n)}(e,n)}}])}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6288],{5118:(e,t,s)=>{s.d(t,{G8:()=>N,OJ:()=>v,RF:()=>w,Uc:()=>R});var a=s(95155),l=s(12115),n=s(18955),r=s(36578),i=s(89451),d=s(10934),o=s(92254),c=s(5225);s(1226);var u=s(89715),x=s(57828),m=s(52056),p=s(65229),g=s(32388),h=s(11620),k=s(50666),f=s(38021),j=s(69352),b=s(76246),y=s(99112);let N=(0,l.memo)(function(e){let{content:t,onOpenFile:s,currentFilePath:n,worktreeId:u}=e,x=(0,l.useRef)(s);x.current=s;let m=(0,l.useRef)(n);m.current=n;let p=(0,l.useRef)(u);p.current=u;let N=(0,l.useCallback)((e,t)=>{let s=(0,j.d3)(t);if(s)switch((0,j.dj)(s)){case"anchor":break;case"external":e.preventDefault(),window.open(s,"_blank","noopener,noreferrer");break;case"relative":{e.preventDefault();let t=m.current,a=x.current;if(t&&a){let e=(0,j.WU)(t,s);e&&a(e)}}}},[]),w=(0,l.useMemo)(()=>({code:g.AY,pre:e=>{let{children:t}=e;return(0,h.D)(t)?(0,a.jsx)(a.Fragment,{children:t}):(0,a.jsx)(k.Ck,{children:(0,a.jsx)("pre",{className:"overflow-x-auto",children:t})})},img:e=>{var t,s,l,n;let{src:r,alt:i,width:d,height:o,...c}=e,u=null!=d?d:null==(s=c.node)||null==(t=s.properties)?void 0:t.width,x=null!=o?o:null==(n=c.node)||null==(l=n.properties)?void 0:l.height;if("string"==typeof r&&!r.startsWith("http://")&&!r.startsWith("https://")&&!r.startsWith("data:")){let e=m.current,t=p.current;if(e&&t){let s=(0,j.WU)(e,r);if(s){let e="/api/worktrees/".concat(t,"/files/").concat((0,b.o)(s));return(0,a.jsx)(f.n,{apiUrl:e,alt:null!=i?i:"",width:u,height:x})}}}return(0,a.jsx)("img",{src:r,alt:null!=i?i:"",width:u,height:x,style:{maxWidth:u||"100%"}})},a:e=>{let{href:t,children:s,...l}=e;return t?(0,a.jsx)("a",{...l,href:t,onClick:e=>N(e,t),children:s}):(0,a.jsx)("a",{...l,children:s})}}),[N]),v=(0,l.useMemo)(()=>[i.A,[d.A,j.uO],o.A,c.A],[]);return(0,a.jsx)(r.oz,{remarkPlugins:y.eT,rehypePlugins:v,components:w,children:t})}),w=(0,l.memo)(function(e){let{mobileTab:t,onTabChange:s}=e,l=(0,n.c)("worktree");return(0,a.jsxs)("div",{className:"flex border-b border-border",children:[(0,a.jsxs)("button",{"data-testid":"mobile-tab-editor",onClick:()=>s("editor"),className:"flex-1 py-2 text-sm font-medium ".concat("editor"===t?"text-accent-600 dark:text-accent-400 border-b-2 border-accent-600 dark:border-accent-400":"text-muted-foreground"),children:[(0,a.jsx)(u.A,{className:"h-4 w-4 inline-block mr-1"}),l("markdownPreview.editor")]}),(0,a.jsxs)("button",{"data-testid":"mobile-tab-preview",onClick:()=>s("preview"),className:"flex-1 py-2 text-sm font-medium ".concat("preview"===t?"text-accent-600 dark:text-accent-400 border-b-2 border-accent-600 dark:border-accent-400":"text-muted-foreground"),children:[(0,a.jsx)(x.A,{className:"h-4 w-4 inline-block mr-1"}),l("markdownPreview.preview")]})]})}),v=(0,l.memo)(function(e){let{isMobile:t}=e,s=(0,n.c)("worktree");return(0,a.jsxs)("div",{"data-testid":"maximize-hint",className:"flex items-center justify-center px-4 py-1 bg-muted text-muted-foreground text-xs",children:[s("markdownPreview.exitFullscreenHint")," ",t&&s("markdownPreview.exitFullscreenHintSwipe")]})}),R=(0,l.memo)(function(e){let{onDismiss:t}=e,s=(0,n.c)("worktree");return(0,a.jsxs)("div",{"data-testid":"large-file-warning",className:"flex items-center gap-2 px-4 py-2 bg-warning-subtle border-b border-warning-border text-warning-foreground text-sm",children:[(0,a.jsx)(m.A,{className:"h-4 w-4"}),s("markdownPreview.largeFileWarning"),(0,a.jsx)("button",{onClick:t,className:"ml-auto text-warning hover:text-warning",children:(0,a.jsx)(p.A,{className:"h-4 w-4"})})]})})},34380:(e,t,s)=>{s.d(t,{B:()=>T});var a=s(95155),l=s(12115),n=s(18955),r=s(48407),i=s(54014),d=s(74385),o=s(50825),c=s(37381);function u(e){var t,s,a,l,n;let r=e.agentInstances&&e.agentInstances.length>0?e.agentInstances.map(e=>e.alias||e.cliTool):null!=(s=e.selectedAgents)?s:e.cliToolId?[e.cliToolId]:[];return{id:e.id,name:e.name,repositoryName:null!=(a=e.repositoryDisplayName)?a:e.repositoryName,syncedBranch:null!=(l=e.branch)?l:null,liveBranch:null!=(n=null==(t=e.gitStatus)?void 0:t.currentBranch)?n:null,dirty:e.gitStatus&&!e.gitStatus.statusUnknown?e.gitStatus.isDirty:null,agents:[...new Set(r)],sessionRunning:!0===e.isSessionRunning}}let x={status:"loading",options:[]};async function m(e){let t=await fetch("/api/worktrees",{signal:e,headers:{Accept:"application/json"}});if(!t.ok)throw Error("HTTP ".concat(t.status));let s=await t.json(),a=null==s?void 0:s.worktrees;if(!Array.isArray(a))throw Error("Malformed worktree list");return a.map(u)}function p(e){let{selectedWorktreeId:t,onSelect:s,disabled:i=!1}=e,d=(0,n.c)("skills"),[o,u]=(0,l.useState)(x),[p,h]=(0,l.useState)(0);(0,l.useEffect)(()=>{let e=new AbortController;return u(x),m(e.signal).then(t=>{e.signal.aborted||u({status:"loaded",options:t})}).catch(()=>{e.signal.aborted||u({status:"error",options:[]})}),()=>e.abort()},[p]);let k=(0,l.useCallback)(()=>h(e=>e+1),[]);return"loading"===o.status?(0,a.jsxs)("div",{className:"space-y-2","data-testid":"skill-target-loading",children:[(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:d("target.loading")}),(0,a.jsx)(r.EA,{className:"h-24 w-full rounded-lg"})]}):"error"===o.status?(0,a.jsxs)(r.Zp,{className:"space-y-3","data-testid":"skill-target-error",children:[(0,a.jsx)(c.u,{tone:"danger",children:d("target.errorNotice")}),(0,a.jsx)(r.$n,{variant:"secondary",size:"sm",onClick:k,"data-testid":"skill-target-retry",children:d("target.retry")})]}):0===o.options.length?(0,a.jsx)(r.Zp,{"data-testid":"skill-target-empty",children:(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:d("target.empty")})}):(0,a.jsxs)("div",{className:"space-y-3","data-testid":"skill-target-selector",children:[(0,a.jsx)("div",{role:"radiogroup","aria-label":d("target.heading"),className:"space-y-2",children:o.options.map(e=>(0,a.jsx)(g,{option:e,selected:e.id===t,disabled:i,onSelect:s},e.id))}),(0,a.jsx)(c.u,{tone:"neutral","data-testid":"skill-target-branch-notice",children:d("target.branchFreshnessNotice")})]})}function g(e){var t;let{option:s,selected:l,disabled:i,onSelect:d}=e,o=(0,n.c)("skills"),c=null!=(t=s.liveBranch)?t:s.syncedBranch;return(0,a.jsxs)("button",{type:"button",role:"radio","aria-checked":l,disabled:i,onClick:()=>d(s.id),"data-testid":"skill-target-option-".concat(s.id),className:"w-full rounded-lg border px-3 py-2.5 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-60 ".concat(l?"border-accent-500 bg-accent-50 dark:bg-accent-950/40":"border-border bg-card hover:bg-muted"),children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-semibold text-foreground break-all",children:s.name}),l&&(0,a.jsx)(r.Ex,{variant:"info",children:o("target.selected")})]}),(0,a.jsxs)("dl",{className:"mt-1.5 grid grid-cols-1 gap-x-4 gap-y-1 sm:grid-cols-2",children:[(0,a.jsx)(h,{label:o("target.repository"),children:s.repositoryName}),(0,a.jsx)(h,{label:o("target.branch"),children:null!=c?c:o("target.branchUnknown")}),(0,a.jsx)(h,{label:o("target.agents"),children:s.agents.length>0?s.agents.join(", "):o("target.agentsNone")}),(0,a.jsx)(h,{label:o("target.workingTree"),children:o(null===s.dirty?"target.workingTreeUnknown":s.dirty?"target.workingTreeDirty":"target.workingTreeClean")})]}),s.sessionRunning&&(0,a.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground","data-testid":"skill-target-session-".concat(s.id),children:o("target.sessionRunning")})]})}function h(e){let{label:t,children:s}=e;return(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("dt",{className:"text-xs font-medium text-muted-foreground",children:t}),(0,a.jsx)("dd",{className:"text-xs text-foreground break-words",children:s})]})}var k=s(95584);function f(e){let{label:t,children:s}=e;return(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("dt",{className:"text-xs font-medium text-muted-foreground",children:t}),(0,a.jsx)("dd",{className:"mt-0.5 break-words text-sm text-foreground",children:s})]})}function j(e){let{level:t,kind:s,label:l}=e,i=(0,n.c)("skills");return(0,a.jsxs)(r.Ex,{variant:k.eK[t],"data-testid":"skill-plan-risk-".concat(s,"-").concat(t),children:[l,": ",i(k.pP[t])]})}function b(e){let{entry:t}=e,s=(0,n.c)("skills"),l=k.KL[t.reason];return(0,a.jsxs)("li",{className:"space-y-1.5 rounded-md border border-border px-3 py-2","data-testid":"skill-plan-file-".concat(t.path),children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)(r.Ex,{variant:k.tC[t.change],children:s(k.AS[t.change])}),(0,a.jsx)("span",{className:"break-all font-mono text-xs text-foreground",children:t.path}),t.generated&&(0,a.jsx)(r.Ex,{variant:"gray",children:s("plan.fileGenerated")})]}),l&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:s(l)}),t.gitIgnored&&(0,a.jsx)("p",{className:"text-xs text-warning-foreground",children:s("plan.gitIgnored")}),t.binary?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:s("plan.diffBinary")}):t.diff?(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{className:"cursor-pointer text-xs text-accent-600 dark:text-accent-400",children:s("plan.diffToggle",{additions:t.additions,deletions:t.deletions})}),(0,a.jsx)("pre",{className:"mt-1 overflow-x-auto rounded bg-muted p-2 font-mono text-[11px] leading-snug text-foreground",children:t.diff}),t.diffTruncated&&(0,a.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:s("plan.diffTruncated")})]}):null]})}function y(e){var t,s,l;let{plan:i}=e,d=(0,n.c)("skills"),{target:o,skill:u}=i,x=u.compatibility.commandmate;return(0,a.jsxs)(r.Zp,{className:"space-y-4","data-testid":"skill-install-plan",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:d("plan.heading")}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:d("plan.expiresAt",{timestamp:i.expiresAt})})]}),(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("plan.targetHeading")}),(0,a.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,a.jsx)(f,{label:d("target.repository"),children:o.repositoryName}),(0,a.jsx)(f,{label:d("target.heading"),children:o.worktreeName}),(0,a.jsx)(f,{label:d("target.branch"),children:null!=(t=o.branch)?t:d("target.branchUnknown")}),(0,a.jsx)(f,{label:d("plan.headStateLabel"),children:d(null!=(s=k.kF[o.headState])?s:"plan.headState.unknown")}),(0,a.jsx)(f,{label:d("target.workingTree"),children:o.workingTreeUnknown?d("target.workingTreeStatusUnknown"):o.workingTreeDirty?d("target.workingTreeDirty"):d("target.workingTreeClean")}),(0,a.jsx)(f,{label:d("plan.installRoot"),children:(0,a.jsx)("span",{className:"break-all font-mono text-xs",children:(o.installRoots&&o.installRoots.length>0?o.installRoots:[o.installRoot]).map(e=>(0,a.jsx)("span",{className:"block",children:e},e))})}),(0,a.jsx)(f,{label:d("plan.existingInstall"),children:o.existingInstall?d("plan.existingInstallVersion",{version:o.existingInstall.version}):d("plan.existingInstallNone")}),(0,a.jsx)(f,{label:d("detail.recommendedVersion"),children:(0,a.jsx)("span",{className:"font-mono text-xs",children:u.version})})]})]}),(0,a.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-risk-section",children:[(0,a.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("plan.riskHeading")}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,a.jsx)(j,{level:u.declaredRisk,kind:"declared",label:d("plan.riskDeclared")}),(0,a.jsx)(j,{level:u.computedRisk,kind:"computed",label:d("plan.riskComputed")}),(0,a.jsx)(j,{level:u.effectiveRisk,kind:"effective",label:d("plan.riskEffective")})]}),(0,a.jsx)("p",{className:"break-words text-sm text-foreground",children:u.riskRationale}),(0,a.jsx)(c.u,{tone:"neutral",children:d("plan.riskNotice")})]}),(0,a.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-permissions",children:[(0,a.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("permissions.heading")}),u.declaredPermissions.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:u.declaredPermissions.map(e=>(0,a.jsx)(r.Ex,{variant:"warning",children:k.z2[e]?d(k.z2[e]):e},e))}):(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:d("plan.permissionsNone")}),(0,a.jsx)(c.u,{tone:"warning",children:d("permissions.declarationOnlyNotice")})]}),(0,a.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-requirements",children:[(0,a.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("requirements.heading")}),0===u.requirements.commands.length&&0===u.requirements.networkHosts.length?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:d("plan.requirementsNone")}):(0,a.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[u.requirements.commands.length>0&&(0,a.jsx)(f,{label:d("plan.requirementsCommands"),children:u.requirements.commands.map(e=>{var t;return"".concat(e.name," ").concat(null!=(t=e.versionRange)?t:d("plan.commandAnyVersion"))}).join(", ")}),u.requirements.networkHosts.length>0&&(0,a.jsx)(f,{label:d("plan.requirementsHosts"),children:u.requirements.networkHosts.join(", ")})]})]}),(0,a.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-scripts",children:[(0,a.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("plan.scriptsHeading")}),0===u.executablePaths.length&&0===u.scriptPaths.length?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:d("plan.scriptsNone")}):(0,a.jsx)("ul",{className:"space-y-1",children:[...new Set([...u.scriptPaths,...u.executablePaths])].map(e=>(0,a.jsx)("li",{className:"break-all font-mono text-xs text-foreground",children:e},e))})]}),"compatible"!==x.status&&(0,a.jsx)(c.u,{tone:"warning","data-testid":"skill-plan-compatibility-notice",children:d((0,k.e5)(x.messageKey),{range:x.requiredRange,currentVersion:null!=(l=x.currentVersion)?l:""})}),i.warnings.length>0&&(0,a.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-warnings",children:[(0,a.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("plan.warningsHeading")}),(0,a.jsx)("ul",{className:"space-y-1",children:i.warnings.map(e=>(0,a.jsx)("li",{className:"text-xs text-warning-foreground",children:k.RO[e]?d(k.RO[e]):e},e))})]}),(0,a.jsxs)("section",{className:"space-y-2","data-testid":"skill-plan-files",children:[(0,a.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d("plan.filesHeading")}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-plan-stats",children:d("plan.stats",{added:i.stats.added,modified:i.stats.modified,unchanged:i.stats.unchanged,conflicted:i.stats.conflicted,unmanaged:i.stats.unmanaged})}),0===i.files.length?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:d("plan.filesEmpty")}):(0,a.jsx)("ul",{className:"space-y-2",children:i.files.map(e=>(0,a.jsx)(b,{entry:e},e.path))})]}),i.blockers.length>0&&(0,a.jsxs)("section",{className:"space-y-2","data-testid":"skill-install-blockers",children:[(0,a.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-danger-foreground",children:d("plan.blockersHeading")}),(0,a.jsx)("ul",{className:"space-y-1",children:i.blockers.map(e=>{var t,s;return(0,a.jsxs)("li",{className:"text-xs text-danger-foreground",children:[e.path&&(0,a.jsx)("span",{className:"mr-1 break-all font-mono",children:e.path}),e.code.startsWith("skills.")?d((0,k.e5)(e.code),{range:x.requiredRange,currentVersion:null!=(t=x.currentVersion)?t:""}):k.KL[e.code]?d(k.KL[e.code]):e.code]},"".concat(e.code,":").concat(null!=(s=e.path)?s:""))})}),(0,a.jsx)(c.u,{tone:"danger",children:d("plan.blockedNotice")})]})]})}function N(e){let{entry:t}=e,s=(0,n.c)("skills"),l=k.Mj[t.disposition],i=k.hJ[t.reason];return(0,a.jsxs)("li",{className:"flex flex-wrap items-center gap-2","data-testid":"skill-uninstall-file-".concat(t.path),children:[(0,a.jsx)(r.Ex,{variant:"remove"===t.disposition?"info":"warning",children:l?s(l):t.disposition}),(0,a.jsx)("span",{className:"break-all font-mono text-xs text-foreground",children:t.path}),i&&(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:s(i)})]})}function w(e){var t;let{plan:s}=e,l=(0,n.c)("skills"),{target:d,skill:o}=s;return(0,a.jsxs)(r.Zp,{className:"space-y-4","data-testid":"skill-uninstall-plan",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:l("uninstall.heading")}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:l("uninstall.expiresAt",{timestamp:s.expiresAt})})]}),(0,a.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,a.jsx)(f,{label:l("target.repository"),children:d.repositoryName}),(0,a.jsx)(f,{label:l("target.heading"),children:d.worktreeName}),(0,a.jsx)(f,{label:l("target.branch"),children:null!=(t=d.branch)?t:l("target.branchUnknown")}),(0,a.jsx)(f,{label:l("uninstall.installedVersion"),children:(0,a.jsx)("span",{className:"font-mono text-xs",children:o.version||l("uninstall.versionUnknown")})}),(0,a.jsx)(f,{label:l("plan.installRoot"),children:(0,a.jsx)("span",{className:"break-all font-mono text-xs",children:d.installRoot})}),(0,a.jsx)(f,{label:l("target.workingTree"),children:d.workingTreeUnknown?l("target.workingTreeStatusUnknown"):d.workingTreeDirty?l("target.workingTreeDirty"):l("target.workingTreeClean")})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-uninstall-stats",children:l("uninstall.stats",{removable:s.stats.removable,modified:s.stats.modified,missing:s.stats.missing,unknown:s.stats.unknown,irregular:s.stats.irregular})}),(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:l("uninstall.removalsHeading")}),0===s.removals.length?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:l("uninstall.removalsEmpty")}):(0,a.jsx)("ul",{className:"space-y-1.5",children:s.removals.map(e=>(0,a.jsx)(N,{entry:e},e.path))})]}),(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:l("uninstall.retainedHeading")}),0===s.retained.length?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:l("uninstall.retainedEmpty")}):(0,a.jsx)("ul",{className:"space-y-1.5",children:s.retained.map(e=>(0,a.jsx)(N,{entry:e},e.path))})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[s.skill.agents.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5","data-testid":"skill-uninstall-agents",children:s.skill.agents.map(e=>(0,a.jsx)(r.Ex,{variant:"gray",children:(0,i.f_)(e.agent)},e.agent))}),(0,a.jsx)(c.u,{tone:"neutral",children:l((0,k.e5)(s.nextActionKey))})]}),s.blockers.length>0&&(0,a.jsxs)("section",{className:"space-y-2","data-testid":"skill-uninstall-blockers",children:[(0,a.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-danger-foreground",children:l("uninstall.blockersHeading")}),(0,a.jsx)("ul",{className:"space-y-1",children:s.blockers.map(e=>{var t;return(0,a.jsxs)("li",{className:"text-xs text-danger-foreground",children:[e.path&&(0,a.jsx)("span",{className:"mr-1 break-all font-mono",children:e.path}),l((0,k.e5)(e.messageKey))]},"".concat(e.code,":").concat(null!=(t=e.path)?t:""))})})]})]})}var v=s(80130);let R={worktreeId:null,busy:null,installPlan:null,uninstallPlan:null,installResult:null,uninstallResult:null,riskAcknowledged:!1,failure:null};function C(e){return{...e,installPlan:null,uninstallPlan:null,installResult:null,uninstallResult:null,riskAcknowledged:!1,failure:null}}function A(e,t){return"".concat(e,"-").concat(t)}function I(e){let{failure:t}=e,s=(0,n.c)("skills");return(0,a.jsxs)("div",{className:"space-y-2","data-testid":"skill-operation-error",children:[(0,a.jsxs)(c.u,{tone:"danger",children:[(0,a.jsx)("p",{className:"font-medium",children:s("operation.errorHeading")}),(0,a.jsx)("p",{className:"mt-1",children:s((0,k.FW)(t.code))}),(0,a.jsx)("p",{className:"mt-1 break-words",children:s("state.errorCode",{code:t.code})})]}),t.nextActionKey&&(0,a.jsx)(c.u,{tone:"warning",children:s((0,k.e5)(t.nextActionKey))}),t.blockers&&t.blockers.length>0&&(0,a.jsx)("ul",{className:"space-y-1","data-testid":"skill-operation-error-blockers",children:t.blockers.map(e=>{var t;return(0,a.jsxs)("li",{className:"text-xs text-danger-foreground",children:[e.path&&(0,a.jsx)("span",{className:"mr-1 break-all font-mono",children:e.path}),s((0,k.e5)(e.messageKey))]},"".concat(e.code,":").concat(null!=(t=e.path)?t:""))})})]})}function P(e){let{agents:t,skillId:s,version:l}=e,r=(0,n.c)("skills");return 0===t.length?null:(0,a.jsxs)("div",{className:"space-y-1","data-testid":"skill-operation-reload",children:[(0,a.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:r("operation.reloadHeading")}),(0,a.jsx)("ul",{className:"space-y-1",children:t.map(e=>(0,a.jsx)("li",{className:"text-xs text-muted-foreground",children:r((0,k.e5)(e.messageKey),{agent:(0,i.f_)(e.agent),skillId:s,version:l})},e.agent))})]})}function T(e){var t;let{skillId:s,version:i,blockedReason:u,worktreeId:x,agents:m=[]}=e,g=(0,n.c)("skills"),[h,f]=(0,l.useState)(()=>x?{...R,worktreeId:x}:R),j=(0,l.useCallback)(e=>{f(t=>t.worktreeId===e?t:C({...t,worktreeId:e,busy:null}))},[]);(0,l.useEffect)(()=>{x&&j(x)},[x,j]);let b=(0,l.useCallback)(async()=>{let e=h.worktreeId;if(!e)return;f(e=>({...C(e),busy:"install-plan"}));let t=await (0,v.Q6)(e,s,{version:null!=i?i:void 0});f(e=>({...e,busy:null,installPlan:t.ok?t.data.plan:null,failure:t.ok?null:t.failure}))},[s,h.worktreeId,i]),N=(0,l.useCallback)(async()=>{let e=h.worktreeId,t=h.installPlan;if(!e||!t||t.requiresRiskAcknowledgement&&!h.riskAcknowledged)return;f(e=>({...e,busy:"install-apply",failure:null}));let a=await (0,v.Xi)(e,s,{planToken:t.token,version:t.skill.version,acknowledgeRisk:!!t.requiresRiskAcknowledgement||void 0,idempotencyKey:A("skill-install",t.token)});a.ok&&(0,d.k)(e),f(e=>({...e,busy:null,installPlan:a.ok?null:e.installPlan,installResult:a.ok?a.data:null,failure:a.ok?null:a.failure}))},[s,h.installPlan,h.riskAcknowledged,h.worktreeId]),T=(0,l.useCallback)(async()=>{let e=h.worktreeId;if(!e)return;f(e=>({...C(e),busy:"uninstall-plan"}));let t=await (0,v.hN)(e,s);f(e=>({...e,busy:null,uninstallPlan:t.ok?t.data.plan:null,failure:t.ok?null:t.failure}))},[s,h.worktreeId]),K=(0,l.useCallback)(async()=>{let e=h.worktreeId,t=h.uninstallPlan;if(!e||!t)return;f(e=>({...e,busy:"uninstall-apply",failure:null}));let a=await (0,v.E)(e,s,{planToken:t.token,idempotencyKey:A("skill-uninstall",t.token)});f(e=>({...e,busy:null,uninstallPlan:a.ok?null:e.uninstallPlan,uninstallResult:a.ok?a.data:null,failure:a.ok?null:a.failure}))},[s,h.uninstallPlan,h.worktreeId]),E=(0,l.useCallback)(()=>{f(e=>C(e))},[]),S=null!==h.busy,H=h.installPlan,q=h.uninstallPlan,D=null!=u?u:g(h.worktreeId?"plan.ready":"plan.chooseTarget"),U=null!==H&&H.requiresRiskAcknowledgement&&!h.riskAcknowledged;return(0,a.jsxs)("div",{className:"space-y-3","data-testid":"skill-install-panel",children:[!x&&(0,a.jsx)(p,{selectedWorktreeId:h.worktreeId,onSelect:j,disabled:S}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(r.$n,{variant:"primary",disabled:S||null!==u||!h.worktreeId,onClick:b,"data-testid":"skill-install-action","aria-describedby":"skill-install-reason",children:g("install-plan"===h.busy?"plan.building":"plan.build")}),(0,a.jsx)(r.$n,{variant:"secondary",disabled:S||!h.worktreeId,onClick:T,"data-testid":"skill-uninstall-action",children:g("uninstall-plan"===h.busy?"uninstall.building":"uninstall.build")})]}),(0,a.jsx)("p",{id:"skill-install-reason",className:"text-sm text-muted-foreground","data-testid":"skill-install-reason",children:D}),m.length>0&&(0,a.jsxs)("div",{className:"space-y-1","data-testid":"skill-install-reload-preview",children:[(0,a.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:g("operation.reloadHeading")}),(0,a.jsx)("ul",{className:"space-y-1",children:m.map(e=>(0,a.jsx)(o.m,{agent:e,variant:"reload"},e.agent))})]}),h.failure&&(0,a.jsx)(I,{failure:h.failure}),H&&(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(y,{plan:H}),H.requiresRiskAcknowledgement&&(0,a.jsxs)(r.Zp,{className:"space-y-3","data-testid":"skill-install-risk-acknowledgement",children:[(0,a.jsx)(c.u,{tone:"danger",children:g((0,k.e5)(null!=(t=H.riskAcknowledgementMessageKey)?t:"skills.plan.highRiskAcknowledgement"))}),(0,a.jsxs)("label",{className:"flex items-start gap-2 text-sm text-foreground",children:[(0,a.jsx)(r.Sc,{checked:h.riskAcknowledged,onCheckedChange:e=>f(t=>({...t,riskAcknowledged:!0===e})),disabled:S,"data-testid":"skill-install-risk-checkbox",className:"mt-0.5"}),(0,a.jsx)("span",{children:g("plan.acknowledgeLabel")})]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(r.$n,{variant:H.requiresRiskAcknowledgement?"danger":"primary",disabled:S||!H.installable||U,onClick:N,"data-testid":"skill-install-confirm",children:g("install-apply"===h.busy?"plan.confirming":"plan.confirm")}),(0,a.jsx)(r.$n,{variant:"ghost",disabled:S,onClick:E,"data-testid":"skill-install-discard",children:g("plan.discard")})]})]}),q&&(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(w,{plan:q}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(r.$n,{variant:"danger",disabled:S||!q.removable,onClick:K,"data-testid":"skill-uninstall-confirm",children:g("uninstall-apply"===h.busy?"uninstall.confirming":"uninstall.confirm")}),(0,a.jsx)(r.$n,{variant:"ghost",disabled:S,onClick:E,"data-testid":"skill-uninstall-discard",children:g("plan.discard")})]})]}),h.installResult&&(0,a.jsxs)(r.Zp,{className:"space-y-3","data-testid":"skill-install-result",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:g("operation.installedHeading")}),(0,a.jsx)(c.u,{tone:"info",children:g((0,k.e5)(h.installResult.operation.nextActionKey))}),h.installResult.operation.replayed&&(0,a.jsx)(c.u,{tone:"neutral","data-testid":"skill-operation-replayed",children:g("operation.replayNotice")}),h.installResult.install&&"files"in h.installResult.install&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:g("operation.filesWritten",{count:h.installResult.install.files.length})}),"reload"in h.installResult&&(0,a.jsx)(P,{agents:h.installResult.reload.agents,skillId:h.installResult.reload.skillId,version:h.installResult.reload.version}),(0,a.jsx)(r.$n,{variant:"secondary",size:"sm",onClick:E,"data-testid":"skill-operation-reset",children:g("operation.startOver")})]}),h.uninstallResult&&(0,a.jsxs)(r.Zp,{className:"space-y-3","data-testid":"skill-uninstall-result",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:g("operation.uninstalledHeading")}),(0,a.jsx)(c.u,{tone:"info",children:g((0,k.e5)(h.uninstallResult.operation.nextActionKey))}),h.uninstallResult.operation.replayed&&(0,a.jsx)(c.u,{tone:"neutral","data-testid":"skill-operation-replayed",children:g("operation.replayNotice")}),h.uninstallResult.uninstall&&"removedFiles"in h.uninstallResult.uninstall&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:g("operation.filesRemoved",{count:h.uninstallResult.uninstall.removedFiles.length})}),"reload"in h.uninstallResult&&(0,a.jsx)(P,{agents:h.uninstallResult.reload.agents,skillId:h.uninstallResult.reload.skillId,version:h.uninstallResult.reload.version}),(0,a.jsx)(r.$n,{variant:"secondary",size:"sm",onClick:E,"data-testid":"skill-operation-reset",children:g("operation.startOver")})]})]})}},50666:(e,t,s)=>{s.d(t,{Ck:()=>r});var a=s(95155),l=s(12115),n=s(53482);function r(e){let{children:t,as:s="div",className:r=""}=e,i=function e(t){return null==t||"boolean"==typeof t?"":"string"==typeof t?t:"number"==typeof t?String(t):Array.isArray(t)?t.map(e).join(""):l.isValidElement(t)?e(t.props.children):""}(t);if(!i||0===i.trim().length)return(0,a.jsx)(s,{className:r||void 0,children:t});let d="relative group ".concat("span"===s?"block ":"").concat(r).trim();return(0,a.jsxs)(s,{className:d,"data-testid":"code-block-with-copy",children:[t,(0,a.jsx)(n.i,{text:i,className:"absolute right-2 top-2 z-10 opacity-100 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100 focus:opacity-100"})]})}},50825:(e,t,s)=>{s.d(t,{m:()=>o});var a=s(95155);s(12115);var l=s(18955),n=s(54014),r=s(37381),i=s(95584);function d(e){let{axis:t,agentName:s}=e,n=(0,l.c)("skills");return(0,a.jsxs)("li",{className:"text-xs text-muted-foreground","data-testid":"skill-agent-axis-".concat(t.axis),children:[(0,a.jsx)("span",{className:"font-medium text-foreground",children:n((0,i.e5)(t.axisKey))}),": ",(0,a.jsx)("span",{"data-testid":"skill-agent-axis-".concat(t.axis,"-").concat(t.outcome),children:n((0,i.e5)(t.outcomeKey))})," — ",n((0,i.e5)(t.evidenceKindKey)),t.limitationKey&&(0,a.jsx)("span",{className:"mt-0.5 block","data-testid":"skill-agent-axis-".concat(t.axis,"-limitation"),children:n((0,i.e5)(t.limitationKey),{agent:s})})]})}function o(e){var t;let{agent:s,variant:o="full"}=e,c=(0,l.c)("skills"),u=(0,n.f_)(s.agent),x=s.measured;return"reload"===o?(0,a.jsx)("li",{className:"text-xs text-muted-foreground","data-testid":"skill-agent-reload-".concat(s.agent),children:c((0,i.e5)(s.reloadKey),{agent:u})}):(0,a.jsxs)("div",{className:"space-y-1","data-testid":"skill-agent-evidence-".concat(s.agent),children:[(0,a.jsx)("p",{className:"text-xs font-medium text-foreground",children:u}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground break-words",children:c("compatibility.declaredLabel",{support:c((0,i.e5)(s.declaredLabelKey))})}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground break-words",children:[c("compatibility.evidence"),": ",s.evidence]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground break-words","data-testid":"skill-agent-verification-".concat(s.agent),children:c((0,i.e5)(s.verificationKey))}),x?(0,a.jsxs)("div",{className:"space-y-0.5 border-l-2 border-border pl-2",children:[(0,a.jsx)("p",{className:"text-xs font-medium text-foreground",children:c("compatibility.measuredHeading")}),(0,a.jsxs)("ul",{className:"space-y-0.5",children:[(0,a.jsx)(d,{axis:x.discovery,agentName:u}),(0,a.jsx)(d,{axis:x.invocation,agentName:u})]}),x.testedVersion&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:c("compatibility.testedVersion",{agent:u,version:x.testedVersion})}),x.testedDate&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:c("compatibility.testedDate",{date:x.testedDate})}),x.discoveryRoots.length>0&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground break-all",children:c("compatibility.discoveryRoots",{roots:x.discoveryRoots.join(", ")})}),x.evidenceSource&&(0,a.jsxs)("p",{className:"text-xs text-muted-foreground break-all",children:[c("compatibility.evidenceSource"),": ",x.evidenceSource]}),x.stale&&(0,a.jsx)(r.u,{tone:"warning","data-testid":"skill-agent-evidence-stale-".concat(s.agent),children:c("compatibility.evidenceStale",{days:null!=(t=x.ageDays)?t:0})})]}):s.skipReasonKey&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground break-words","data-testid":"skill-agent-skip-reason-".concat(s.agent),children:c((0,i.e5)(s.skipReasonKey))}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground break-words",children:[(0,a.jsx)("span",{className:"font-medium text-foreground",children:c("compatibility.reloadHeading",{agent:u})}),": ",c((0,i.e5)(s.reloadKey),{agent:u})]})]})}},53482:(e,t,s)=>{s.d(t,{i:()=>o});var a=s(95155),l=s(12115),n=s(60322),r=s(9900);function i(){return(0,a.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}function d(){return(0,a.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function o(e){let{text:t,className:s="",label:o="Copy"}=e,[c,u]=(0,l.useState)(!1),x=(0,l.useRef)(null);(0,l.useEffect)(()=>()=>{x.current&&clearTimeout(x.current)},[]);let m=(0,l.useCallback)(async()=>{try{await (0,n.l)(t),u(!0),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>u(!1),r.s7)}catch(e){}},[t]);return(0,a.jsxs)("button",{type:"button",onClick:m,className:"inline-flex items-center gap-1 rounded border border-border bg-surface px-2 py-0.5 text-[11px] font-medium text-foreground transition-colors hover:bg-muted ".concat(s),"aria-label":c?"Copied":o,title:c?"Copied!":o,children:[c?(0,a.jsx)(d,{}):(0,a.jsx)(i,{}),(0,a.jsx)("span",{children:c?"Copied":o})]})}},75333:(e,t,s)=>{s.d(t,{Xz:()=>o,qW:()=>c,uE:()=>u});var a=s(95155);s(12115);var l=s(18955),n=s(77801),r=s(48407),i=s(54014),d=s(95584);function o(e){let{status:t,className:s}=e,n=(0,l.c)("skills");return(0,a.jsx)(r.Ex,{variant:d.H$[t],className:s,"data-testid":"skill-compatibility-".concat(t),children:n(d.OV[t])})}function c(e){let{risk:t,className:s}=e,i=(0,l.c)("skills");return(0,a.jsxs)(r.Ex,{variant:d.eK[t],className:s,"data-testid":"skill-declared-risk-".concat(t),children:["high"===t&&(0,a.jsx)(n.A,{size:12,"aria-hidden":"true",className:"mr-1 shrink-0"}),i("risk.declaredLabel",{level:i(d.pP[t])})]})}function u(e){let{agent:t}=e,s=(0,l.c)("skills");return(0,a.jsxs)(r.Ex,{variant:d.Et[t.support],"data-testid":"skill-agent-".concat(t.agent,"-").concat(t.support),children:[(0,i.f_)(t.agent),": ",s((0,d.e5)(t.labelKey))]})}},99648:(e,t,s)=>{s.d(t,{Co:()=>a,Ms:()=>n,td:()=>l});let a=".agents/skills",l=".claude/skills",n="skills.permissions.declarationOnlyNotice"}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[953],{90953:(e,r,t)=>{t.r(r),t.d(r,{MermaidDiagram:()=>y});var n=t(95155),a=t(12115),l=t(18955),s=t(5379),c=t(37485);let i={securityLevel:"strict",startOnLoad:!1,theme:"default",suppressErrorRendering:!0,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges","theme","themeVariables","themeCSS","darkMode"]};function u(e){return"dark"===e?"dark":"light"===e?"default":null}var d=t(3005);let o=null,m=Promise.resolve();class f extends Error{}let h=["href","xlink:href","aria-labelledby","aria-describedby"];function v(e){let r=new MutationObserver(e);return r.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()}function g(){return document.documentElement.classList.contains("dark")?"dark":"light"}function y(e){let{code:r,id:t,onRenderStateChange:y}=e,p=(0,l.c)("worktree"),b=function(){var e;let{resolvedTheme:r}=(0,s.D)(),t=(0,a.useSyncExternalStore)(v,g,()=>"");return null!=(e=u(r))?e:u(t)}(),[x,E]=(0,a.useState)(""),[w,S]=(0,a.useState)(null),[k,j]=(0,a.useState)(!0),L=(0,a.useRef)(null),A=(0,a.useRef)(p);A.current=p;let N=(0,a.useRef)(y);N.current=y;let R=(0,a.useId)(),_=t||"mermaid-".concat(R.replace(/[^A-Za-z0-9_-]/g,"-")),z=(0,a.useRef)(0);return((0,a.useEffect)(()=>{let e=!0,t=null;return(async()=>{var n,a,l;j(!0),S(null);let s=(null==r?void 0:r.trim())||"";if(!s){e&&(E(""),S(A.current("mermaid.emptyCode")),j(!1),null==(n=N.current)||n.call(N,"error"));return}if(null===b)return;let u=z.current++,d=0===u?_:"".concat(_,"-r").concat(u);try{t=function(e){let r,t=m,n=!1,a=new Promise(e=>{r=e});return m=t.then(()=>a),{promise:t.then(async()=>{if(n)throw new f;try{return await e()}finally{r()}}),cancel:()=>{n=!0,r()}}}(async()=>{if("strict"!==i.securityLevel)throw Error("[SECURITY] mermaid securityLevel must be 'strict', but got '".concat(i.securityLevel,"'. ")+"This is a security requirement to prevent XSS attacks.");o!==b&&(c.A.initialize({...i,theme:b,secure:[...i.secure]}),o=b);try{return await c.A.render(d,s)}catch(r){let e=document.getElementById("d".concat(d));throw e&&e.parentElement===document.body&&e.remove(),r}});let{svg:r}=await t.promise;e&&(E(r),j(!1),null==(a=N.current)||a.call(N,"rendered"))}catch(r){if(e&&!(r instanceof f)){let e=r instanceof Error?r.message:A.current("mermaid.renderError");E(""),S(e),j(!1),null==(l=N.current)||l.call(N,"error")}}})(),()=>{e=!1,null==t||t.cancel()}},[r,_,b]),(0,a.useLayoutEffect)(()=>{x&&L.current&&function(e){let r=e.querySelector("svg"),t=null==r?void 0:r.id;if(!r||!t)return;let n=new Map;if(r.querySelectorAll("[id]").forEach(e=>{if(e.id.startsWith(t))return;let r="".concat(t,"-").concat(e.id);n.set(e.id,r),e.id=r}),0===n.size)return;let a=e=>e.replace(/url\(\s*(['"]?)#([^'")\s]+)\1\s*\)/g,(e,r,t)=>{let a=n.get(t);return a?"url(".concat(r,"#").concat(a).concat(r,")"):e});r.querySelectorAll("*").forEach(e=>{for(let r of Array.from(e.attributes))if(r.value.includes("url(")){let t=a(r.value);t!==r.value&&e.setAttribute(r.name,t)}else if(h.includes(r.name)){let t=r.value.split(/\s+/).map(e=>{let r=e.startsWith("#"),t=r?e.slice(1):e,a=n.get(t);return a?"".concat(r?"#":"").concat(a):e}).join(" ");t!==r.value&&e.setAttribute(r.name,t)}})}(L.current)},[x]),k&&!x)?(0,n.jsx)("div",{"data-testid":"mermaid-loading",className:"flex items-center justify-center p-4 text-muted-foreground",children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(d.y,{size:"sm",variant:"accent"}),(0,n.jsx)("span",{children:p("mermaid.rendering")})]})}):w?(0,n.jsxs)("div",{"data-testid":"mermaid-error",className:"bg-danger-subtle border border-danger-border p-4 rounded",children:[(0,n.jsx)("p",{className:"text-danger font-medium",children:p("mermaid.errorTitle")}),(0,n.jsx)("pre",{className:"text-sm text-danger mt-2 whitespace-pre-wrap break-words bg-danger-subtle",children:w})]}):(0,n.jsx)("div",{ref:L,"data-testid":"mermaid-container","data-mermaid-theme":null!=b?b:void 0,className:"mermaid-container max-w-full overflow-x-auto",dangerouslySetInnerHTML:{__html:x}})}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{13673:()=>{},23252:(e,t,r)=>{"use strict";r.d(t,{AppProviders:()=>L});var n=r(95155),s=r(20063);r(95704);let a=["/login","/api/auth/login","/api/auth/logout","/api/auth/status","/api/remote/pair","/manifest.webmanifest","/sw.js","/offline"];var o=r(3809),i=r(5379),l=r(32916),c=r(65380),d=r(22592),u=r(92614),m=r(70628),f=r(66966),h=r(89275),x=r(60199),b=r(36402),p=r(63470),g=r(40823),v=r(58165),y=r(94442),w=r(72604),j=r(95275),N=r(79832),k=r(12115),C=r(18955),M=r(89559),S=r(59854),E=r(77016);function A(){let e=(0,C.c)("pwa"),[t,r]=(0,k.useState)(null),s=(0,k.useRef)(!1),a=(0,E.W)();return((0,k.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:S.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)(M.A,{className:"h-4 w-4"}),e("update.reload")]})]})})}function L(e){var t;let{children:r,locale:k,messages:C,timeZone:M,authEnabled:S=!1}=e,E=(t=(0,s.usePathname)(),!S||!a.includes(null!=t?t:""));return(0,n.jsx)(o.default,{locale:k,messages:C,timeZone:M,children:(0,n.jsx)(y.tE,{children:(0,n.jsx)(i.N,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:(0,n.jsx)(c.O,{authEnabled:S,children:(0,n.jsx)(d.W5,{children:(0,n.jsx)(l.GB,{children:(0,n.jsx)(x.tS,{enabled:E,children:(0,n.jsxs)(f.g7,{enabled:E,children:[(0,n.jsx)(w.rM,{}),(0,n.jsx)(N.o,{}),(0,n.jsx)(j.H,{}),(0,n.jsx)(u.E,{children:(0,n.jsx)(m.S,{children:(0,n.jsx)(b.aF,{children:(0,n.jsx)(p.y2,{enabled:E,children:(0,n.jsxs)(g.NS,{children:[(0,n.jsx)(h.Bo,{children:r}),(0,n.jsx)(A,{}),(0,n.jsx)(v.gZ,{})]})})})})})]})})})})})})})})}},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}},62295:(e,t,r)=>{"use strict";r.d(t,{AppShellGate:()=>to});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 h=(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 x=r(18955),b=r(85710),p=r(66685),g=r(61362),v=r(15870),y=r(17787),w=r(49027),j=r(27587),N=r(39649),k=r(47650),C=r(38606),M=r(76471);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,unclassified:l}=e,[c,d]=(0,a.useState)({top:-9999,left:-9999}),u=(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=u.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,c=window.innerWidth,m=window.innerHeight,f=n.right+8;if(f+i>c-8){let e=n.left-8-i;e>=8&&(f=e)}d({top:S(n.top,l,m),left:S(f,i,c)})},[s,o]),"undefined"==typeof document||!s)return null;let m=Math.min(384,Math.max(0,window.innerWidth-16));return k.createPortal((0,n.jsxs)("div",{ref:u,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:c.top,left:c.left,maxWidth:m},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: ",l?C.pu: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 A=0,L=(0,a.memo)(function(e){let{branch:t,isSelected:r,onClick:s,showRepositoryName:o=!0}=e,i=(0,x.c)("common"),l=(0,x.c)("worktree"),c="tooltip-".concat(t.id),d=(0,a.useRef)(null),[u,m]=(0,a.useState)(!1),f=(0,a.useRef)(null),h=(0,a.useCallback)(()=>{null!==f.current&&(clearTimeout(f.current),f.current=null)},[]);(0,a.useEffect)(()=>()=>h(),[h]);let b=(0,C.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=(0,a.useMemo)(()=>{var e;return new Set(null!=(e=t.unclassifiedInstanceIds)?e:[])},[t.unclassifiedInstanceIds]),j=(0,C.Pn)(t.cliStatus,t.unclassifiedInstanceIds),N=(p||g)&&null!==v,k=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:()=>{h(),A=Date.now()+400,m(!1),s()},onMouseEnter:()=>{h(),Date.now()>=A&&(f.current=setTimeout(()=>{m(!0)},150))},onMouseLeave:()=>{h(),m(!1)},onFocus:e=>{h(),e.target.matches(":focus-visible")&&(f.current=setTimeout(()=>{m(!0)},150))},onBlur:()=>{h(),m(!1)},"aria-current":r?"true":void 0,"aria-describedby":k?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.Ej,{status:b,label:(0,C.dw)(t.cliStatus,t.cliStatusLabels,y.size>0?e=>y.has(e)?i("branchItem.agentExited"):null:void 0,w),waitingKind:t.waitingKind,unclassified:j})}),(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}),N&&(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:k,anchorRef:d,nextActionLabel:v,unclassified:j})]})});var K=r(24033),T=r(41898);function I(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 R=(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:h,iconClassName:b="w-3 h-3"}=e,p=(0,x.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:I(r.left-j.current.x,r.width,window.innerWidth),y:I(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"),A=null==f||null==(r=f[s])?void 0:r[o],L=p("asc"===o?"sort.ascShort":"sort.descShort"),R=(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)(K.A,{className:"h-3 w-3 flex-shrink-0","aria-hidden":"true"})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(W,{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:[h?(0,n.jsx)(T.m_,{content:h,placement:"bottom",children:R}):R,(0,n.jsx)("button",{type:"button",onClick:S,"aria-label":null!=A?A:p("asc"===o?"sort.ascending":"sort.descending"),className:A?"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!=A?A:"asc"===o?(0,n.jsx)(z,{className:b}):(0,n.jsx)(P,{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:L})]},e.key)})})]})});function W(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 z(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 P(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 B=[{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,x.c)("common"),l=(0,a.useMemo)(()=>B.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)(R,{sortKey:e,sortDirection:t,onSortKeyChange:r,onSortDirectionChange:s,options:l,defaultDirections:D,showLabel:!0,directionLabels:c,iconClassName:"w-4 h-4"})});var F=r(48407),H=r(30061),V=r(45195),_=r(26020);function q(){let{currentLocale:e,switchLocale:t}=(0,V.g)(),r=(0,x.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:_.dI.map(e=>(0,n.jsx)("option",{value:e,children:_.vK[e]},e))})}var G=r(5379),J=r(59427),U=r(37494);function $(){let{theme:e,setTheme:t}=(0,G.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)(J.A,{className:"w-5 h-5","data-testid":"theme-icon-sun"}):(0,n.jsx)(U.A,{className:"w-5 h-5","data-testid":"theme-icon-moon"})})}var X=r(65380);function Y(){let e=(0,x.c)("auth"),t=(0,X.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 Z=r(94442),Q=r(44308),ee=r(24373),et=r(40823),er=r(80344),en=r(7636);function es(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,en.Xn)(i,r,n),[i,r,n]),groupedItems:(0,a.useMemo)(()=>"grouped"===s?(0,en._s)(i,r,n):[],[i,r,n,s])}}let ea="mcbd-sidebar-group-collapsed",eo="mcbd-sidebar-scroll-top",ei=0,el=(0,a.memo)(function(){var e,t,r;let i=(0,f.Hq)(),{worktrees:l,repositories:c,selectedWorktreeId:d,selectWorktree:u,refreshWorktrees:m,isLoading:h,error:v}=(0,N.$f)(),{closeMobileDrawer:j,sortKey:k,sortDirection:M,viewMode:S,setViewMode:E,repositoryOrder:A,setRepositoryOrder:K}=(0,o.VF)(),T=(0,x.c)("common"),I=null!=(e=(0,s.usePathname)())?e:"",{count:R}=(0,ee.Lv)(),[W,z]=(0,a.useState)(""),P=(0,a.useRef)(null),[B,D]=(0,a.useState)(()=>{try{let e=localStorage.getItem(ea);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(!eu.has(e)&&"boolean"==typeof s){if(++n>100)break;r[e]=s}return r}catch(e){return{}}}(e):{}}catch(e){return{}}}),H=(0,a.useRef)(!1);(0,a.useEffect)(()=>{H.current||(H.current=!0,fetch("/api/sidebar/group-order").then(e=>e.json()).then(e=>{e.success&&Array.isArray(e.order)&&K(e.order)}).catch(()=>{}))},[K]);let V=(0,a.useMemo)(()=>(0,en.UZ)(c),[c]),_=(0,a.useMemo)(()=>(0,en.s6)(l,V),[l,V]),G=(0,a.useMemo)(()=>_.map(C.XK),[_]),J=(0,a.useDeferredValue)(G),U=(0,a.useRef)(null),X=(0,a.useRef)(null),[Z,et]=(0,a.useState)(0);(0,a.useEffect)(()=>()=>{null!==X.current&&clearTimeout(X.current)},[]);let er=(0,a.useCallback)(()=>{null!==X.current&&(clearTimeout(X.current),X.current=null),U.current=null},[]),el=(0,a.useMemo)(()=>{let e=U.current;return!e||0===e.items.length||Date.now()>=e.expiresAt?J:e.items},[J,Z]),em=(0,a.useRef)(el);(0,a.useLayoutEffect)(()=>{em.current=el;let e=U.current;e&&0===e.items.length&&J.length>0&&er()});let eb=(0,a.useCallback)(()=>{if(0===em.current.length)return;null!==X.current&&(clearTimeout(X.current),X.current=null);let e=U.current;if(e&&Date.now()<e.expiresAt){U.current={...e,expiresAt:1/0};return}U.current={items:em.current,expiresAt:1/0}},[]),ep=(0,a.useCallback)(()=>{U.current&&(U.current={...U.current,expiresAt:Date.now()+1e3},null!==X.current&&clearTimeout(X.current),X.current=setTimeout(()=>{er(),et(e=>e+1)},1e3))},[er]),{sortedItems:eg,groupedItems:ew}=es({items:el,sortKey:k,sortDirection:M,viewMode:S,filterText:W}),ej=(0,a.useMemo)(()=>"grouped"===S&&ew?W.trim()?ew:(0,en.BN)(ew,A):null,[S,ew,A,W]),eN="grouped"===S?ej:null,ek=(0,a.useMemo)(()=>"sessions"===S?(0,en.EY)((0,en.UB)(eg),k,M):[],[S,eg,k,M]);(0,a.useEffect)(()=>{try{localStorage.setItem(ea,JSON.stringify(B))}catch(e){}},[B]);let eC=(0,a.useCallback)(e=>{D(t=>({...t,[e]:!t[e]}))},[]),eM=(0,a.useCallback)(()=>{var e,t,r=null!=(t=null==(e=P.current)?void 0:e.scrollTop)?t:0;let n=Number.isFinite(r)&&r>0?r:0;ei=n;try{localStorage.setItem(eo,String(n))}catch(e){}},[]),eS=eg.length>0||(null!=(t=null==eN?void 0:eN.length)?t:0)>0||ek.length>0;(0,a.useEffect)(()=>{let e=P.current;if(!e)return;let t=window.requestAnimationFrame(()=>{e.scrollTop=function(){try{let e=localStorage.getItem(eo);if(!e)return ei=0,0;let t=Number(e);Number.isFinite(t)&&t>=0&&(ei=t)}catch(e){}return ei}()});return()=>{window.cancelAnimationFrame(t)}},[eS,S]);let eE=(0,a.useCallback)(e=>{eM(),u(e),i.push("/worktrees/".concat(e)),j()},[eM,u,i,j]),eA=(0,a.useCallback)(e=>{eM(),u(e.worktreeId),i.push((0,en.Ii)(e)),j()},[eM,u,i,j]),eL=(0,y.FR)((0,y.MS)(y.AN,{activationConstraint:{distance:8}})),eK=(0,a.useCallback)(e=>{let{active:t,over:r}=e;if(!r||t.id===r.id||!eN)return;let n=eN.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,w.be)(n,s,a);K(o),fetch("/api/sidebar/group-order",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({order:o})}).catch(()=>{K(n)})},[eN,K]),eT="grouped"===S?(null!=(r=null==eN?void 0:eN.length)?r:0)===0:"sessions"===S?0===ek.length:0===eg.length,eI=h&&0===l.length,eR=!eI&&!!v&&0===l.length,eW=(0,a.useCallback)(()=>{m()},[m]);return(0,n.jsxs)("nav",{"data-testid":"sidebar","aria-label":T("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)(ef,{href:"/repositories",icon:b.A,label:T("nav.repositories"),testId:"sidebar-nav-repositories",isActive:I.startsWith("/repositories"),onNavigate:j}),(0,n.jsx)(ev,{refreshWorktrees:m})]}),(0,n.jsx)("li",{className:"flex min-w-0",children:(0,n.jsx)(ef,{href:"/sessions",icon:p.A,label:T("nav.sessions"),testId:"sidebar-nav-sessions",isActive:I.startsWith("/sessions"),onNavigate:j})}),(0,n.jsx)("li",{className:"flex min-w-0",children:(0,n.jsx)(ef,{href:R>0?Q.ks:"/review",icon:g.A,label:T("nav.review"),testId:"sidebar-nav-review",isActive:I.startsWith("/review"),onNavigate:j,trailing:R>0?(0,n.jsx)("span",{"data-testid":"sidebar-nav-review-count",role:"status","aria-label":T("attention.badgeLabel",{count:R}),className:"flex-shrink-0 rounded-full bg-warning-subtle px-1.5 text-xs font-semibold leading-5 tabular-nums text-warning-foreground",children:R>99?"99+":R}):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)(eh,{viewMode:S,onChange:E}),(0,n.jsx)("span",{className:"whitespace-nowrap text-xs text-sidebar-muted",children:T("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:T("sidebar.searchBranches"),value:W,onChange:e=>z(e.target.value),className:"bg-background shadow-none"})}),(0,n.jsx)("div",{ref:P,"data-testid":"branch-list",onScroll:eM,onMouseEnter:eb,onMouseLeave:ep,className:"flex-1 overflow-y-auto overflow-x-hidden",children:eI?(0,n.jsx)(ec,{label:T("sidebar.loadingBranches")}):eR?(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:T("sidebar.branchesLoadFailed")}),(0,n.jsx)(F.$n,{type:"button",variant:"secondary",size:"sm",className:"mt-3","data-testid":"branch-list-retry",onClick:eW,children:T("sidebar.retryLoadBranches")})]}):eT?(0,n.jsx)("div",{className:"px-4 py-8 text-center text-sidebar-muted",children:T(W?"sidebar.noBranchesFound":"sidebar.noBranchesAvailable")}):"sessions"===S?ek.map(e=>(0,n.jsx)(ex,{row:e,isSelected:e.worktreeId===d,onClick:eA},e.key)):"grouped"===S&&eN?(0,n.jsx)(y.Mp,{sensors:eL,collisionDetection:y.fp,onDragEnd:eK,children:(0,n.jsx)(w.gB,{items:eN.map(e=>e.repositoryName),strategy:w._G,children:eN.map(e=>{let t=!B[e.repositoryName]||!!W.trim();return(0,n.jsx)(ed,{group:e,isExpanded:t,selectedWorktreeId:d,onToggle:()=>eC(e.repositoryName),onBranchClick:eE,isDragDisabled:!!W.trim()},e.repositoryName)})})}):eg.map(e=>(0,n.jsx)(L,{branch:e,isSelected:e.id===d,onClick:()=>eE(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)(ey,{onNavigate:j}),(0,n.jsx)("div",{className:"flex-1 min-w-0",children:(0,n.jsx)(q,{})}),(0,n.jsx)($,{})]}),(0,n.jsx)(Y,{})]})]})}),ec=(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 ed(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:h}=(0,w.gl)({id:t.repositoryName,disabled:i}),x={transform:j.Ks.Transform.toString(m),transition:f,opacity:h?.5:1};return(0,n.jsxs)("div",{ref:d,style:x,className:"w-full min-w-0",children:[(0,n.jsx)(em,{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)(L,{branch:e,isSelected:e.id===s,onClick:()=>o(e.id),showRepositoryName:!1},e.id))]})}let eu=new Set(["__proto__","constructor","prototype"]);function em(e){let{repositoryName:t,branchCount:r,isExpanded:s,onClick:a,dragHandleRef:o,dragHandleListeners:i,dragHandleAttributes:l}=e,c=(0,x.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)(ep,{})}),(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)(eb,{isExpanded:s}),(0,n.jsx)(F.nF,{color:(0,en.LV)(t)}),(0,n.jsx)(H.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 ef(e){let{href:t,icon:r,label:s,testId:a,isActive:o,onNavigate:i,trailing:l}=e;return(0,n.jsxs)(h,{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 eh(e){let{viewMode:t,onChange:r}=e,s=(0,x.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,en.$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,x.c)("common"),o=(0,M.Mq)(t.status,t.unclassified),i=a(o?M.rH:"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(i," (").concat(a("branchItem.agentExited"),")"):i,className:o?M.Jd:void 0}),(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 eb(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 ep(){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 eg(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 ev=(0,a.memo)(function(e){let{refreshWorktrees:t}=e,[r,s]=(0,a.useState)(!1),o=(0,a.useRef)(!1),{showToast:i}=(0,Z.dj)(),l=(0,x.c)("common"),c=(0,a.useCallback)(async()=>{if(!o.current){o.current=!0,s(!0);try{let e=await er.Rx.sync();await t(),i(l("syncSuccess",{count:e.worktreeCount}),"success",3e3)}catch(e){e instanceof er.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)(T.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)(eg,{className:r?"animate-spin":""})})})})});function ey(e){let{onNavigate:t}=e,r=(0,x.c)("common"),s=(0,i.a)(),{open:o}=(0,et.V0)(),l=r("settings.title"),c=(0,a.useCallback)(e=>{t(),!s&&(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),o()))},[s,t,o]);return(0,n.jsx)(T.m_,{content:l,placement:"top",className:"flex-shrink-0",children:(0,n.jsx)(h,{href:"/more","data-testid":"sidebar-settings","aria-label":l,"aria-haspopup":s?void 0:"dialog",onClick:c,className:"p-1.5 rounded-md text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors",children:(0,n.jsx)(v.A,{size:20,"aria-hidden":"true"})})})}var ew=r(59847),ej=r(86651),eN=r(94684),ek=r(34681);function eC(){let e=(0,o.pT)(),t=(0,x.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,en.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:en.EN.map(e=>(0,n.jsx)("option",{value:e,children:t("repoTabBar.mode.".concat(e))},e))})]})}var eM=r(52407);function eS(){let{shouldSurface:e,isReconnecting:t}=(0,eM.Fx)(),r=(0,x.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 eE=r(72137),eA=r(79651),eL=r(92614);let eK=[{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"),opensSettings:!0}];function eT(e){let{title:t="CommandMate"}=e,r=(0,s.usePathname)(),o=(0,x.c)("commandPalette"),i=(0,x.c)("common"),{setOpen:l}=(0,eL.C)(),[c,d]=a.useState(null);a.useEffect(()=>{d("undefined"!=typeof navigator&&/Mac|iPhone|iPad|iPod/i.test(navigator.platform||"")?"⌘":"Ctrl")},[]);let{open:u}=(0,et.V0)(),m=a.useCallback(e=>{0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),u())},[u]);return(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)(h,{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)(ew.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:[eK.map(e=>{let t=e.isActive(r);return(0,n.jsx)(h,{href:e.href,"aria-current":t?"page":void 0,"aria-haspopup":e.opensSettings?"dialog":void 0,onClick:e.opensSettings?m: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)(ej.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)(eA.u,{children:c}),(0,n.jsx)(eA.u,{children:"K"})]})]}),(0,n.jsx)(eS,{}),(0,n.jsx)(ek.g,{}),(0,n.jsx)(eC,{}),(0,n.jsx)(eE.H,{}),(0,n.jsx)($,{}),(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)(eN.A,{size:20,strokeWidth:2,"aria-hidden":"true"}),(0,n.jsx)("span",{children:"GitHub"})]})]})]})})})}var eI=r(37772),eR=r(17848),eW=r(48481),ez=r(46892),eP=r(59854);let eB=/^\/worktrees\/([^/]+)/;function eD(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 eO(e){var t;null==e||null==(t=e.scrollIntoView)||t.call(e,{block:"nearest",inline:"nearest"})}let eF=(0,a.memo)(function(){var e;let t=(0,x.c)("common"),r=(0,s.usePathname)(),i=(0,f.Hq)(),{sortKey:l,sortDirection:c,repositoryOrder:u}=(0,o.VF)(),{worktrees:m,repositories:h,selectedWorktreeId:b,selectWorktree:p}=(0,N.$f)(),{factor:g}=(0,d.Ps)(),v=(0,a.useMemo)(()=>(0,en.UZ)(null!=h?h:[]),[h]),y=(0,a.useMemo)(()=>(0,en.s6)(null!=m?m:[],v),[m,v]),{groupedItems:w}=es({items:(0,a.useMemo)(()=>y.map(C.XK),[y]),sortKey:l,sortDirection:c,viewMode:"grouped"}),j=(0,a.useMemo)(()=>(0,en.BN)(w,u),[w,u]),k=function(e,t){let r=eB.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=j.find(e=>e.branches.some(e=>e.id===k)))?void 0:e.repositoryName)?t:null},[j,k]),[S,E]=(0,a.useState)(null),[A,L]=(0,a.useState)(null),[K,T]=(0,a.useState)(!1),I=(0,a.useRef)(null),R=(0,a.useRef)(null),W=(0,a.useRef)(new Map),z=(0,a.useCallback)((e,t)=>{t?W.current.set(e,t):W.current.delete(e)},[]),P=(0,a.useCallback)(()=>{E(null),L(null),T(!1)},[]),B=(0,a.useCallback)(e=>{let t=W.current.get(e);if(!t)return;let r=t.getBoundingClientRect();L({left:r.left,right:r.right,bottom:r.bottom}),E(e),T(!1)},[]),D=(0,a.useCallback)(e=>{if(S===e)return void P();B(e)},[S,P,B]),[O,F]=(0,a.useState)(!1),H=(0,a.useCallback)(()=>{let e=I.current;e&&F(e.scrollWidth>e.clientWidth+1)},[]);(0,a.useLayoutEffect)(()=>{H()},[H,j.length,g]),(0,a.useEffect)(()=>{window.addEventListener("resize",H);let e="undefined"!=typeof ResizeObserver?new ResizeObserver(()=>H()):null;return e&&I.current&&e.observe(I.current),()=>{window.removeEventListener("resize",H),null==e||e.disconnect()}},[H]);let V=null!==S||K;(0,a.useEffect)(()=>{if(!V)return;let e=e=>{var t,r,n;let s=e.target;!(!s||(null==(t=I.current)?void 0:t.contains(s))||(null==(r=R.current)?void 0:r.contains(s)))&&((null==(n=s.closest)?void 0:n.call(s,"[data-repository-tab-panel]"))||P())},t=e=>{if("Escape"!==e.key)return;let t=S?W.current.get(S):R.current;P(),null==t||t.focus()};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[V,S,P]),(0,a.useEffect)(()=>{P()},[r,P]),(0,a.useLayoutEffect)(()=>{M&&eO(W.current.get(M))},[M,r,O]);let _=(0,a.useCallback)(e=>{P(),p(e),i.push("/worktrees/".concat(e))},[P,p,i]),q=(0,a.useCallback)(e=>{let t=W.current.get(e);eO(t),B(e),null==t||t.focus()},[B]),G=(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===j.length)return null;let J=Math.round(32*g),U=null!=(e=j.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(J,"px")},children:[(0,n.jsx)("nav",{ref:I,"data-testid":"repository-tab-strip","aria-label":t("nav.repositories"),onWheel:G,className:"flex min-w-0 flex-1 flex-nowrap items-stretch overflow-x-auto overflow-y-hidden scrollbar-hide",children:j.map(e=>(0,n.jsx)(eH,{group:e,isActive:e.repositoryName===M,isOpen:e.repositoryName===S,registerTab:z,onToggle:D},e.repositoryName))}),O&&(0,n.jsx)("button",{ref:R,type:"button","data-testid":"repository-tab-overflow","aria-haspopup":"menu","aria-expanded":K,"aria-label":t("repoTabBar.overflow"),title:t("repoTabBar.overflow"),onClick:()=>{E(null),L(null),T(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)(eI.A,{size:16,strokeWidth:2,"aria-hidden":"true"})}),U&&A&&(0,n.jsx)(eV,{group:U,anchor:A,factor:g,activeWorktreeId:k,onBranchClick:_}),K&&(0,n.jsx)(e_,{groups:j,anchorRef:R,activeRepositoryName:M,onSelect:q})]})}),eH=(0,a.memo)(function(e){let{group:t,isActive:r,isOpen:s,registerTab:a,onToggle:o}=e,i=(0,x.c)("common"),l=(0,en.zD)(t.branches),c=(0,M.Mq)(l,(0,en.El)(t.branches)),d=(0,en.j)(t.branches),u=i(c?M.rH:ez.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(u),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,en.LV)(t.repositoryName)}),(0,n.jsx)("span",{className:"min-w-0 truncate",children:t.repositoryName}),(0,n.jsx)(eW.m,{status:l,size:"sm",label:u,className:c?M.Jd:void 0,"data-testid":"repository-tab-status"}),d>0&&(0,n.jsx)("span",{"data-testid":"repository-tab-attention-count","aria-label":i("attention.badgeLabel",{count:d}),className:"flex-shrink-0 rounded-full bg-warning-subtle px-1.5 text-[10px] font-semibold leading-4 tabular-nums text-warning-foreground",children:d})]})});function eV(e){let{group:t,anchor:r,factor:s,activeWorktreeId:o,onBranchClick:i}=e,l=(0,x.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 k.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:eD(r,d,u),width:d,zIndex:eP.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)(L,{branch:e,isSelected:e.id===o,onClick:()=>i(e.id),showRepositoryName:!1},e.id))})}),document.body)}function e_(e){var t;let{groups:r,anchorRef:s,activeRepositoryName:a,onSelect:o}=e,i=(0,x.c)("common"),l=null==(t=s.current)?void 0:t.getBoundingClientRect();if("undefined"==typeof document||!l)return null;let c=window.innerWidth;return k.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:eD({left:l.left,right:l.right,bottom:l.bottom},300,c),width:300,maxHeight:"".concat(520,"px"),zIndex:eP.M.POPOVER},children:(0,n.jsx)("div",{className:"overflow-y-auto py-1",style:{maxHeight:"inherit"},children:r.map(e=>{let t=(0,en.zD)(e.branches),r=(0,M.Mq)(t,(0,en.El)(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,en.LV)(e.repositoryName)}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.repositoryName}),(0,n.jsx)(eW.m,{status:t,size:"sm",label:i(r?M.rH:ez.PL[t].labelKey),className:r?M.Jd:void 0}),(0,n.jsx)("span",{className:"tabular-nums text-xs text-sidebar-muted",children:e.branches.length})]},e.repositoryName)})})}),document.body)}var eq=r(9540);function eG(e){let{count:t}=e,r=(0,x.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 eJ=[{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)(eI.A,{size:20,"aria-hidden":"true"})}];function eU(){let e=(0,s.usePathname)(),{setOpen:t}=(0,eL.C)(),r=(0,x.c)("commandPalette"),a=(0,x.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)(eq.A,{size:20,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"mt-1 whitespace-nowrap",children:a("sidebar.branches")})]}),eJ.map(t=>{let r=t.isActive(e),s=!0===t.showsAttentionBadge&&i>0;return(0,n.jsxs)(h,{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)(eG,{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)(ej.A,{size:20,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"mt-1 whitespace-nowrap",children:r("mobileLabel")})]})]})})}function e$(){let{shouldSurface:e,isReconnecting:t}=(0,eM.Fx)(),r=(0,x.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 eX=r(45573),eY=r(94465),eZ=r(70628);let eQ=["global","terminal","composer","editor"],e0=[{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 e1(){let{open:e,setOpen:t}=(0,eZ.K)(),{open:r}=(0,eL.C)(),s=(0,x.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,eX.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]:e0;return eQ.map(t=>({scope:t,shortcuts:e.filter(e=>e.scope===t)})).filter(e=>e.shortcuts.length>0)}();return(0,n.jsx)(eY.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)(eA.u,{children:"MOD"===e?o?"⌘":"Ctrl":e},t))})]},e.id))})]},t)})})})}var e2=r(77016),e5=r(36809),e4=r(31166);let e3=/^v?\d+\.\d+\.\d+$/;function e9(e){return e.replace(/^v/,"").split(".").map(Number)}let e6="commandmate.lastSeenAppVersion";function e8(e){try{window.localStorage.setItem(e6,e)}catch(e){}}let e7=[{key:"added",labelKey:"whatsNew.added"},{key:"improved",labelKey:"whatsNew.improved"},{key:"fixed",labelKey:"whatsNew.fixed"}];function te(){let e=(0,x.c)("common"),t=(0,e5.Ym)(),[r,s]=(0,a.useState)(null),[o,i]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e,t="0.45.0";try{e=window.localStorage.getItem(e6)}catch(e){return}let r=function(e,t){if(!e3.test(t))return{kind:"none"};if(null===e||!e3.test(e))return{kind:"remember"};let r=function(e,t){let r=e9(e),n=e9(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 e8(t);let n=!1;return er.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&&e8(r.to),i(!1)},[r]);if(!r)return null;let c="ja"===t?"ja":"en";return(0,n.jsx)(eY.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]})]}),e7.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)(e4.$,{type:"button",variant:"primary",size:"sm",onClick:l,"data-testid":"whats-new-close",children:e("whatsNew.close")})]})]})})}let tt="transform transition-transform duration-300 ease-out",tr=(0,a.memo)(function(e){let{children:t}=e,{isOpen:r,isMobileDrawerOpen:u,closeMobileDrawer:m,width:f,setWidth:h,repoTabBarMode:x}=(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,en.fs)(null!=x?x:en.PB,r),k=Math.round(32*v)+64*!!g,C=(0,a.useRef)(null),M=(0,a.useRef)(null),S=(0,a.useCallback)(e=>{h(Math.round(e/v))},[h,v]);return b?(0,n.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[(0,n.jsx)(e$,{}),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(tt,"\n ").concat(u?"translate-x-0":"-translate-x-full","\n "),role:"complementary",children:(0,n.jsx)(el,{})}),(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)(eU,{}),(0,n.jsx)(eX.xq,{}),(0,n.jsx)(e1,{}),(0,n.jsx)(e2.n,{}),(0,n.jsx)(te,{})]}):(0,n.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[N&&(0,n.jsx)(eF,{}),g&&(0,n.jsx)(eT,{}),(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(tt,"\n ").concat(r?"translate-x-0":"-translate-x-full","\n "),style:{width:"".concat(j,"px"),zIndex:eP.M.SIDEBAR,...N?{top:"".concat(k,"px"),height:"calc(100vh - ".concat(k,"px)")}:{}},role:"complementary","aria-hidden":!r,children:[(0,n.jsx)(el,{}),(0,n.jsx)(tn,{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)(eX.xq,{}),(0,n.jsx)(e1,{}),(0,n.jsx)(e2.n,{}),(0,n.jsx)(te,{})]})});function tn(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 ts=["/login","/offline","/proxy"],ta=/^\/worktrees\/[^/]+\/(terminal|files)(\/|$)/;function to(e){var t;let{children:r}=e,a=(0,s.usePathname)();return(t=null!=a?a:"",ts.some(e=>t===e||t.startsWith("".concat(e,"/")))||ta.test(t)||0)?(0,n.jsx)(n.Fragment,{children:r}):(0,n.jsx)(tr,{children:r})}},76471:(e,t,r)=>{"use strict";r.d(t,{Ej:()=>d,Jd:()=>i,Mq:()=>c,rH:()=>l});var n=r(95155),s=r(12115),a=r(18955),o=r(48481);let i="bg-transparent border-2 border-muted-foreground",l="status.unknown";function c(e,t){return!0===t&&"ready"===e}let d=(0,s.memo)(function(e){let{status:t,label:r,waitingKind:s,unclassified:d}=e,u=(0,a.c)("common"),m=c(t,d);return(0,n.jsx)(o.m,{"data-testid":"status-indicator",status:t,label:m?null!=r?r:u(l):r,waitingKind:s,size:"lg",className:m?i:void 0,"data-unclassified":m?"true":void 0})})},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 h(){for(let e of f)e()}function x(e){return f.add(e),()=>{f.delete(e)}}function b(){return m>0}function p(){return!1}function g(){return(0,s.useSyncExternalStore)(x,b,p)}function v(){let e=(0,a.c)("common"),[t,r]=(0,s.useState)(null),[f,x]=(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,h(),()=>{m-=1,h()}},[p]);let g=(0,s.useCallback)(()=>{window.location.reload()},[]),v=(0,s.useCallback)(()=>{r(e=>(e&&x(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,62295)),Promise.resolve().then(r.bind(r,23252))}},e=>{e.O(0,[5373,2978,6809,4909,2770,2619,6192,8318,8407,2407,344,6654,8606,4768,8165,9619,8441,1255,7358],()=>e(e.s=80903)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{13673:()=>{},23252:(e,t,r)=>{"use strict";r.d(t,{AppProviders:()=>L});var n=r(95155),s=r(20063);r(95704);let a=["/login","/api/auth/login","/api/auth/logout","/api/auth/status","/api/remote/pair","/manifest.webmanifest","/sw.js","/offline"];var o=r(3809),i=r(5379),l=r(32916),c=r(65380),d=r(22592),u=r(92614),m=r(70628),f=r(66966),h=r(89275),x=r(60199),b=r(36402),p=r(63470),g=r(40823),v=r(58165),y=r(94442),w=r(72604),j=r(95275),N=r(79832),k=r(12115),C=r(18955),M=r(89559),S=r(59854),E=r(77016);function A(){let e=(0,C.c)("pwa"),[t,r]=(0,k.useState)(null),s=(0,k.useRef)(!1),a=(0,E.W)();return((0,k.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:S.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)(M.A,{className:"h-4 w-4"}),e("update.reload")]})]})})}function L(e){var t;let{children:r,locale:k,messages:C,timeZone:M,authEnabled:S=!1}=e,E=(t=(0,s.usePathname)(),!S||!a.includes(null!=t?t:""));return(0,n.jsx)(o.default,{locale:k,messages:C,timeZone:M,children:(0,n.jsx)(y.tE,{children:(0,n.jsx)(i.N,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:(0,n.jsx)(c.O,{authEnabled:S,children:(0,n.jsx)(d.W5,{children:(0,n.jsx)(l.GB,{children:(0,n.jsx)(x.tS,{enabled:E,children:(0,n.jsxs)(f.g7,{enabled:E,children:[(0,n.jsx)(w.rM,{}),(0,n.jsx)(N.o,{}),(0,n.jsx)(j.H,{}),(0,n.jsx)(u.E,{children:(0,n.jsx)(m.S,{children:(0,n.jsx)(b.aF,{children:(0,n.jsx)(p.y2,{enabled:E,children:(0,n.jsxs)(g.NS,{children:[(0,n.jsx)(h.Bo,{children:r}),(0,n.jsx)(A,{}),(0,n.jsx)(v.gZ,{})]})})})})})]})})})})})})})})}},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}},62295:(e,t,r)=>{"use strict";r.d(t,{AppShellGate:()=>to});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 h=(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 x=r(18955),b=r(85710),p=r(66685),g=r(61362),v=r(15870),y=r(17787),w=r(49027),j=r(27587),N=r(39649),k=r(47650),C=r(38606),M=r(76471);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,unclassified:l}=e,[c,d]=(0,a.useState)({top:-9999,left:-9999}),u=(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=u.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,c=window.innerWidth,m=window.innerHeight,f=n.right+8;if(f+i>c-8){let e=n.left-8-i;e>=8&&(f=e)}d({top:S(n.top,l,m),left:S(f,i,c)})},[s,o]),"undefined"==typeof document||!s)return null;let m=Math.min(384,Math.max(0,window.innerWidth-16));return k.createPortal((0,n.jsxs)("div",{ref:u,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:c.top,left:c.left,maxWidth:m},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: ",l?C.pu: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 A=0,L=(0,a.memo)(function(e){let{branch:t,isSelected:r,onClick:s,showRepositoryName:o=!0}=e,i=(0,x.c)("common"),l=(0,x.c)("worktree"),c="tooltip-".concat(t.id),d=(0,a.useRef)(null),[u,m]=(0,a.useState)(!1),f=(0,a.useRef)(null),h=(0,a.useCallback)(()=>{null!==f.current&&(clearTimeout(f.current),f.current=null)},[]);(0,a.useEffect)(()=>()=>h(),[h]);let b=(0,C.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=(0,a.useMemo)(()=>{var e;return new Set(null!=(e=t.unclassifiedInstanceIds)?e:[])},[t.unclassifiedInstanceIds]),j=(0,C.Pn)(t.cliStatus,t.unclassifiedInstanceIds),N=(p||g)&&null!==v,k=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:()=>{h(),A=Date.now()+400,m(!1),s()},onMouseEnter:()=>{h(),Date.now()>=A&&(f.current=setTimeout(()=>{m(!0)},150))},onMouseLeave:()=>{h(),m(!1)},onFocus:e=>{h(),e.target.matches(":focus-visible")&&(f.current=setTimeout(()=>{m(!0)},150))},onBlur:()=>{h(),m(!1)},"aria-current":r?"true":void 0,"aria-describedby":k?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.Ej,{status:b,label:(0,C.dw)(t.cliStatus,t.cliStatusLabels,y.size>0?e=>y.has(e)?i("branchItem.agentExited"):null:void 0,w),waitingKind:t.waitingKind,unclassified:j})}),(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}),N&&(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:k,anchorRef:d,nextActionLabel:v,unclassified:j})]})});var K=r(24033),T=r(41898);function I(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 R=(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:h,iconClassName:b="w-3 h-3"}=e,p=(0,x.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:I(r.left-j.current.x,r.width,window.innerWidth),y:I(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"),A=null==f||null==(r=f[s])?void 0:r[o],L=p("asc"===o?"sort.ascShort":"sort.descShort"),R=(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)(K.A,{className:"h-3 w-3 flex-shrink-0","aria-hidden":"true"})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(W,{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:[h?(0,n.jsx)(T.m_,{content:h,placement:"bottom",children:R}):R,(0,n.jsx)("button",{type:"button",onClick:S,"aria-label":null!=A?A:p("asc"===o?"sort.ascending":"sort.descending"),className:A?"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!=A?A:"asc"===o?(0,n.jsx)(z,{className:b}):(0,n.jsx)(P,{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:L})]},e.key)})})]})});function W(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 z(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 P(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 B=[{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,x.c)("common"),l=(0,a.useMemo)(()=>B.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)(R,{sortKey:e,sortDirection:t,onSortKeyChange:r,onSortDirectionChange:s,options:l,defaultDirections:D,showLabel:!0,directionLabels:c,iconClassName:"w-4 h-4"})});var F=r(48407),H=r(30061),V=r(45195),_=r(26020);function q(){let{currentLocale:e,switchLocale:t}=(0,V.g)(),r=(0,x.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:_.dI.map(e=>(0,n.jsx)("option",{value:e,children:_.vK[e]},e))})}var G=r(5379),J=r(59427),U=r(37494);function $(){let{theme:e,setTheme:t}=(0,G.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)(J.A,{className:"w-5 h-5","data-testid":"theme-icon-sun"}):(0,n.jsx)(U.A,{className:"w-5 h-5","data-testid":"theme-icon-moon"})})}var X=r(65380);function Y(){let e=(0,x.c)("auth"),t=(0,X.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 Z=r(94442),Q=r(44308),ee=r(24373),et=r(40823),er=r(80344),en=r(7636);function es(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,en.Xn)(i,r,n),[i,r,n]),groupedItems:(0,a.useMemo)(()=>"grouped"===s?(0,en._s)(i,r,n):[],[i,r,n,s])}}let ea="mcbd-sidebar-group-collapsed",eo="mcbd-sidebar-scroll-top",ei=0,el=(0,a.memo)(function(){var e,t,r;let i=(0,f.Hq)(),{worktrees:l,repositories:c,selectedWorktreeId:d,selectWorktree:u,refreshWorktrees:m,isLoading:h,error:v}=(0,N.$f)(),{closeMobileDrawer:j,sortKey:k,sortDirection:M,viewMode:S,setViewMode:E,repositoryOrder:A,setRepositoryOrder:K}=(0,o.VF)(),T=(0,x.c)("common"),I=null!=(e=(0,s.usePathname)())?e:"",{count:R}=(0,ee.Lv)(),[W,z]=(0,a.useState)(""),P=(0,a.useRef)(null),[B,D]=(0,a.useState)(()=>{try{let e=localStorage.getItem(ea);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(!eu.has(e)&&"boolean"==typeof s){if(++n>100)break;r[e]=s}return r}catch(e){return{}}}(e):{}}catch(e){return{}}}),H=(0,a.useRef)(!1);(0,a.useEffect)(()=>{H.current||(H.current=!0,fetch("/api/sidebar/group-order").then(e=>e.json()).then(e=>{e.success&&Array.isArray(e.order)&&K(e.order)}).catch(()=>{}))},[K]);let V=(0,a.useMemo)(()=>(0,en.UZ)(c),[c]),_=(0,a.useMemo)(()=>(0,en.s6)(l,V),[l,V]),G=(0,a.useMemo)(()=>_.map(C.XK),[_]),J=(0,a.useDeferredValue)(G),U=(0,a.useRef)(null),X=(0,a.useRef)(null),[Z,et]=(0,a.useState)(0);(0,a.useEffect)(()=>()=>{null!==X.current&&clearTimeout(X.current)},[]);let er=(0,a.useCallback)(()=>{null!==X.current&&(clearTimeout(X.current),X.current=null),U.current=null},[]),el=(0,a.useMemo)(()=>{let e=U.current;return!e||0===e.items.length||Date.now()>=e.expiresAt?J:e.items},[J,Z]),em=(0,a.useRef)(el);(0,a.useLayoutEffect)(()=>{em.current=el;let e=U.current;e&&0===e.items.length&&J.length>0&&er()});let eb=(0,a.useCallback)(()=>{if(0===em.current.length)return;null!==X.current&&(clearTimeout(X.current),X.current=null);let e=U.current;if(e&&Date.now()<e.expiresAt){U.current={...e,expiresAt:1/0};return}U.current={items:em.current,expiresAt:1/0}},[]),ep=(0,a.useCallback)(()=>{U.current&&(U.current={...U.current,expiresAt:Date.now()+1e3},null!==X.current&&clearTimeout(X.current),X.current=setTimeout(()=>{er(),et(e=>e+1)},1e3))},[er]),{sortedItems:eg,groupedItems:ew}=es({items:el,sortKey:k,sortDirection:M,viewMode:S,filterText:W}),ej=(0,a.useMemo)(()=>"grouped"===S&&ew?W.trim()?ew:(0,en.BN)(ew,A):null,[S,ew,A,W]),eN="grouped"===S?ej:null,ek=(0,a.useMemo)(()=>"sessions"===S?(0,en.EY)((0,en.UB)(eg),k,M):[],[S,eg,k,M]);(0,a.useEffect)(()=>{try{localStorage.setItem(ea,JSON.stringify(B))}catch(e){}},[B]);let eC=(0,a.useCallback)(e=>{D(t=>({...t,[e]:!t[e]}))},[]),eM=(0,a.useCallback)(()=>{var e,t,r=null!=(t=null==(e=P.current)?void 0:e.scrollTop)?t:0;let n=Number.isFinite(r)&&r>0?r:0;ei=n;try{localStorage.setItem(eo,String(n))}catch(e){}},[]),eS=eg.length>0||(null!=(t=null==eN?void 0:eN.length)?t:0)>0||ek.length>0;(0,a.useEffect)(()=>{let e=P.current;if(!e)return;let t=window.requestAnimationFrame(()=>{e.scrollTop=function(){try{let e=localStorage.getItem(eo);if(!e)return ei=0,0;let t=Number(e);Number.isFinite(t)&&t>=0&&(ei=t)}catch(e){}return ei}()});return()=>{window.cancelAnimationFrame(t)}},[eS,S]);let eE=(0,a.useCallback)(e=>{eM(),u(e),i.push("/worktrees/".concat(e)),j()},[eM,u,i,j]),eA=(0,a.useCallback)(e=>{eM(),u(e.worktreeId),i.push((0,en.Ii)(e)),j()},[eM,u,i,j]),eL=(0,y.FR)((0,y.MS)(y.AN,{activationConstraint:{distance:8}})),eK=(0,a.useCallback)(e=>{let{active:t,over:r}=e;if(!r||t.id===r.id||!eN)return;let n=eN.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,w.be)(n,s,a);K(o),fetch("/api/sidebar/group-order",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({order:o})}).catch(()=>{K(n)})},[eN,K]),eT="grouped"===S?(null!=(r=null==eN?void 0:eN.length)?r:0)===0:"sessions"===S?0===ek.length:0===eg.length,eI=h&&0===l.length,eR=!eI&&!!v&&0===l.length,eW=(0,a.useCallback)(()=>{m()},[m]);return(0,n.jsxs)("nav",{"data-testid":"sidebar","aria-label":T("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)(ef,{href:"/repositories",icon:b.A,label:T("nav.repositories"),testId:"sidebar-nav-repositories",isActive:I.startsWith("/repositories"),onNavigate:j}),(0,n.jsx)(ev,{refreshWorktrees:m})]}),(0,n.jsx)("li",{className:"flex min-w-0",children:(0,n.jsx)(ef,{href:"/sessions",icon:p.A,label:T("nav.sessions"),testId:"sidebar-nav-sessions",isActive:I.startsWith("/sessions"),onNavigate:j})}),(0,n.jsx)("li",{className:"flex min-w-0",children:(0,n.jsx)(ef,{href:R>0?Q.ks:"/review",icon:g.A,label:T("nav.review"),testId:"sidebar-nav-review",isActive:I.startsWith("/review"),onNavigate:j,trailing:R>0?(0,n.jsx)("span",{"data-testid":"sidebar-nav-review-count",role:"status","aria-label":T("attention.badgeLabel",{count:R}),className:"flex-shrink-0 rounded-full bg-warning-subtle px-1.5 text-xs font-semibold leading-5 tabular-nums text-warning-foreground",children:R>99?"99+":R}):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)(eh,{viewMode:S,onChange:E}),(0,n.jsx)("span",{className:"whitespace-nowrap text-xs text-sidebar-muted",children:T("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:T("sidebar.searchBranches"),value:W,onChange:e=>z(e.target.value),className:"bg-background shadow-none"})}),(0,n.jsx)("div",{ref:P,"data-testid":"branch-list",onScroll:eM,onMouseEnter:eb,onMouseLeave:ep,className:"flex-1 overflow-y-auto overflow-x-hidden",children:eI?(0,n.jsx)(ec,{label:T("sidebar.loadingBranches")}):eR?(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:T("sidebar.branchesLoadFailed")}),(0,n.jsx)(F.$n,{type:"button",variant:"secondary",size:"sm",className:"mt-3","data-testid":"branch-list-retry",onClick:eW,children:T("sidebar.retryLoadBranches")})]}):eT?(0,n.jsx)("div",{className:"px-4 py-8 text-center text-sidebar-muted",children:T(W?"sidebar.noBranchesFound":"sidebar.noBranchesAvailable")}):"sessions"===S?ek.map(e=>(0,n.jsx)(ex,{row:e,isSelected:e.worktreeId===d,onClick:eA},e.key)):"grouped"===S&&eN?(0,n.jsx)(y.Mp,{sensors:eL,collisionDetection:y.fp,onDragEnd:eK,children:(0,n.jsx)(w.gB,{items:eN.map(e=>e.repositoryName),strategy:w._G,children:eN.map(e=>{let t=!B[e.repositoryName]||!!W.trim();return(0,n.jsx)(ed,{group:e,isExpanded:t,selectedWorktreeId:d,onToggle:()=>eC(e.repositoryName),onBranchClick:eE,isDragDisabled:!!W.trim()},e.repositoryName)})})}):eg.map(e=>(0,n.jsx)(L,{branch:e,isSelected:e.id===d,onClick:()=>eE(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)(ey,{onNavigate:j}),(0,n.jsx)("div",{className:"flex-1 min-w-0",children:(0,n.jsx)(q,{})}),(0,n.jsx)($,{})]}),(0,n.jsx)(Y,{})]})]})}),ec=(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 ed(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:h}=(0,w.gl)({id:t.repositoryName,disabled:i}),x={transform:j.Ks.Transform.toString(m),transition:f,opacity:h?.5:1};return(0,n.jsxs)("div",{ref:d,style:x,className:"w-full min-w-0",children:[(0,n.jsx)(em,{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)(L,{branch:e,isSelected:e.id===s,onClick:()=>o(e.id),showRepositoryName:!1},e.id))]})}let eu=new Set(["__proto__","constructor","prototype"]);function em(e){let{repositoryName:t,branchCount:r,isExpanded:s,onClick:a,dragHandleRef:o,dragHandleListeners:i,dragHandleAttributes:l}=e,c=(0,x.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)(ep,{})}),(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)(eb,{isExpanded:s}),(0,n.jsx)(F.nF,{color:(0,en.LV)(t)}),(0,n.jsx)(H.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 ef(e){let{href:t,icon:r,label:s,testId:a,isActive:o,onNavigate:i,trailing:l}=e;return(0,n.jsxs)(h,{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 eh(e){let{viewMode:t,onChange:r}=e,s=(0,x.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,en.$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,x.c)("common"),o=(0,M.Mq)(t.status,t.unclassified),i=a(o?M.rH:"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(i," (").concat(a("branchItem.agentExited"),")"):i,className:o?M.Jd:void 0}),(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 eb(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 ep(){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 eg(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 ev=(0,a.memo)(function(e){let{refreshWorktrees:t}=e,[r,s]=(0,a.useState)(!1),o=(0,a.useRef)(!1),{showToast:i}=(0,Z.dj)(),l=(0,x.c)("common"),c=(0,a.useCallback)(async()=>{if(!o.current){o.current=!0,s(!0);try{let e=await er.Rx.sync();await t(),i(l("syncSuccess",{count:e.worktreeCount}),"success",3e3)}catch(e){e instanceof er.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)(T.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)(eg,{className:r?"animate-spin":""})})})})});function ey(e){let{onNavigate:t}=e,r=(0,x.c)("common"),s=(0,i.a)(),{open:o}=(0,et.V0)(),l=r("settings.title"),c=(0,a.useCallback)(e=>{t(),!s&&(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),o()))},[s,t,o]);return(0,n.jsx)(T.m_,{content:l,placement:"top",className:"flex-shrink-0",children:(0,n.jsx)(h,{href:"/more","data-testid":"sidebar-settings","aria-label":l,"aria-haspopup":s?void 0:"dialog",onClick:c,className:"p-1.5 rounded-md text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors",children:(0,n.jsx)(v.A,{size:20,"aria-hidden":"true"})})})}var ew=r(59847),ej=r(86651),eN=r(94684),ek=r(34681);function eC(){let e=(0,o.pT)(),t=(0,x.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,en.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:en.EN.map(e=>(0,n.jsx)("option",{value:e,children:t("repoTabBar.mode.".concat(e))},e))})]})}var eM=r(52407);function eS(){let{shouldSurface:e,isReconnecting:t}=(0,eM.Fx)(),r=(0,x.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 eE=r(72137),eA=r(79651),eL=r(92614);let eK=[{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"),opensSettings:!0}];function eT(e){let{title:t="CommandMate"}=e,r=(0,s.usePathname)(),o=(0,x.c)("commandPalette"),i=(0,x.c)("common"),{setOpen:l}=(0,eL.C)(),[c,d]=a.useState(null);a.useEffect(()=>{d("undefined"!=typeof navigator&&/Mac|iPhone|iPad|iPod/i.test(navigator.platform||"")?"⌘":"Ctrl")},[]);let{open:u}=(0,et.V0)(),m=a.useCallback(e=>{0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),u())},[u]);return(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)(h,{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)(ew.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:[eK.map(e=>{let t=e.isActive(r);return(0,n.jsx)(h,{href:e.href,"aria-current":t?"page":void 0,"aria-haspopup":e.opensSettings?"dialog":void 0,onClick:e.opensSettings?m: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)(ej.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)(eA.u,{children:c}),(0,n.jsx)(eA.u,{children:"K"})]})]}),(0,n.jsx)(eS,{}),(0,n.jsx)(ek.g,{}),(0,n.jsx)(eC,{}),(0,n.jsx)(eE.H,{}),(0,n.jsx)($,{}),(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)(eN.A,{size:20,strokeWidth:2,"aria-hidden":"true"}),(0,n.jsx)("span",{children:"GitHub"})]})]})]})})})}var eI=r(37772),eR=r(17848),eW=r(48481),ez=r(46892),eP=r(59854);let eB=/^\/worktrees\/([^/]+)/;function eD(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 eO(e){var t;null==e||null==(t=e.scrollIntoView)||t.call(e,{block:"nearest",inline:"nearest"})}let eF=(0,a.memo)(function(){var e;let t=(0,x.c)("common"),r=(0,s.usePathname)(),i=(0,f.Hq)(),{sortKey:l,sortDirection:c,repositoryOrder:u}=(0,o.VF)(),{worktrees:m,repositories:h,selectedWorktreeId:b,selectWorktree:p}=(0,N.$f)(),{factor:g}=(0,d.Ps)(),v=(0,a.useMemo)(()=>(0,en.UZ)(null!=h?h:[]),[h]),y=(0,a.useMemo)(()=>(0,en.s6)(null!=m?m:[],v),[m,v]),{groupedItems:w}=es({items:(0,a.useMemo)(()=>y.map(C.XK),[y]),sortKey:l,sortDirection:c,viewMode:"grouped"}),j=(0,a.useMemo)(()=>(0,en.BN)(w,u),[w,u]),k=function(e,t){let r=eB.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=j.find(e=>e.branches.some(e=>e.id===k)))?void 0:e.repositoryName)?t:null},[j,k]),[S,E]=(0,a.useState)(null),[A,L]=(0,a.useState)(null),[K,T]=(0,a.useState)(!1),I=(0,a.useRef)(null),R=(0,a.useRef)(null),W=(0,a.useRef)(new Map),z=(0,a.useCallback)((e,t)=>{t?W.current.set(e,t):W.current.delete(e)},[]),P=(0,a.useCallback)(()=>{E(null),L(null),T(!1)},[]),B=(0,a.useCallback)(e=>{let t=W.current.get(e);if(!t)return;let r=t.getBoundingClientRect();L({left:r.left,right:r.right,bottom:r.bottom}),E(e),T(!1)},[]),D=(0,a.useCallback)(e=>{if(S===e)return void P();B(e)},[S,P,B]),[O,F]=(0,a.useState)(!1),H=(0,a.useCallback)(()=>{let e=I.current;e&&F(e.scrollWidth>e.clientWidth+1)},[]);(0,a.useLayoutEffect)(()=>{H()},[H,j.length,g]),(0,a.useEffect)(()=>{window.addEventListener("resize",H);let e="undefined"!=typeof ResizeObserver?new ResizeObserver(()=>H()):null;return e&&I.current&&e.observe(I.current),()=>{window.removeEventListener("resize",H),null==e||e.disconnect()}},[H]);let V=null!==S||K;(0,a.useEffect)(()=>{if(!V)return;let e=e=>{var t,r,n;let s=e.target;!(!s||(null==(t=I.current)?void 0:t.contains(s))||(null==(r=R.current)?void 0:r.contains(s)))&&((null==(n=s.closest)?void 0:n.call(s,"[data-repository-tab-panel]"))||P())},t=e=>{if("Escape"!==e.key)return;let t=S?W.current.get(S):R.current;P(),null==t||t.focus()};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[V,S,P]),(0,a.useEffect)(()=>{P()},[r,P]),(0,a.useLayoutEffect)(()=>{M&&eO(W.current.get(M))},[M,r,O]);let _=(0,a.useCallback)(e=>{P(),p(e),i.push("/worktrees/".concat(e))},[P,p,i]),q=(0,a.useCallback)(e=>{let t=W.current.get(e);eO(t),B(e),null==t||t.focus()},[B]),G=(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===j.length)return null;let J=Math.round(32*g),U=null!=(e=j.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(J,"px")},children:[(0,n.jsx)("nav",{ref:I,"data-testid":"repository-tab-strip","aria-label":t("nav.repositories"),onWheel:G,className:"flex min-w-0 flex-1 flex-nowrap items-stretch overflow-x-auto overflow-y-hidden scrollbar-hide",children:j.map(e=>(0,n.jsx)(eH,{group:e,isActive:e.repositoryName===M,isOpen:e.repositoryName===S,registerTab:z,onToggle:D},e.repositoryName))}),O&&(0,n.jsx)("button",{ref:R,type:"button","data-testid":"repository-tab-overflow","aria-haspopup":"menu","aria-expanded":K,"aria-label":t("repoTabBar.overflow"),title:t("repoTabBar.overflow"),onClick:()=>{E(null),L(null),T(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)(eI.A,{size:16,strokeWidth:2,"aria-hidden":"true"})}),U&&A&&(0,n.jsx)(eV,{group:U,anchor:A,factor:g,activeWorktreeId:k,onBranchClick:_}),K&&(0,n.jsx)(e_,{groups:j,anchorRef:R,activeRepositoryName:M,onSelect:q})]})}),eH=(0,a.memo)(function(e){let{group:t,isActive:r,isOpen:s,registerTab:a,onToggle:o}=e,i=(0,x.c)("common"),l=(0,en.zD)(t.branches),c=(0,M.Mq)(l,(0,en.El)(t.branches)),d=(0,en.j)(t.branches),u=i(c?M.rH:ez.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(u),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,en.LV)(t.repositoryName)}),(0,n.jsx)("span",{className:"min-w-0 truncate",children:t.repositoryName}),(0,n.jsx)(eW.m,{status:l,size:"sm",label:u,className:c?M.Jd:void 0,"data-testid":"repository-tab-status"}),d>0&&(0,n.jsx)("span",{"data-testid":"repository-tab-attention-count","aria-label":i("attention.badgeLabel",{count:d}),className:"flex-shrink-0 rounded-full bg-warning-subtle px-1.5 text-[10px] font-semibold leading-4 tabular-nums text-warning-foreground",children:d})]})});function eV(e){let{group:t,anchor:r,factor:s,activeWorktreeId:o,onBranchClick:i}=e,l=(0,x.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 k.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:eD(r,d,u),width:d,zIndex:eP.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)(L,{branch:e,isSelected:e.id===o,onClick:()=>i(e.id),showRepositoryName:!1},e.id))})}),document.body)}function e_(e){var t;let{groups:r,anchorRef:s,activeRepositoryName:a,onSelect:o}=e,i=(0,x.c)("common"),l=null==(t=s.current)?void 0:t.getBoundingClientRect();if("undefined"==typeof document||!l)return null;let c=window.innerWidth;return k.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:eD({left:l.left,right:l.right,bottom:l.bottom},300,c),width:300,maxHeight:"".concat(520,"px"),zIndex:eP.M.POPOVER},children:(0,n.jsx)("div",{className:"overflow-y-auto py-1",style:{maxHeight:"inherit"},children:r.map(e=>{let t=(0,en.zD)(e.branches),r=(0,M.Mq)(t,(0,en.El)(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,en.LV)(e.repositoryName)}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.repositoryName}),(0,n.jsx)(eW.m,{status:t,size:"sm",label:i(r?M.rH:ez.PL[t].labelKey),className:r?M.Jd:void 0}),(0,n.jsx)("span",{className:"tabular-nums text-xs text-sidebar-muted",children:e.branches.length})]},e.repositoryName)})})}),document.body)}var eq=r(9540);function eG(e){let{count:t}=e,r=(0,x.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 eJ=[{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)(eI.A,{size:20,"aria-hidden":"true"})}];function eU(){let e=(0,s.usePathname)(),{setOpen:t}=(0,eL.C)(),r=(0,x.c)("commandPalette"),a=(0,x.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)(eq.A,{size:20,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"mt-1 whitespace-nowrap",children:a("sidebar.branches")})]}),eJ.map(t=>{let r=t.isActive(e),s=!0===t.showsAttentionBadge&&i>0;return(0,n.jsxs)(h,{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)(eG,{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)(ej.A,{size:20,"aria-hidden":"true"}),(0,n.jsx)("span",{className:"mt-1 whitespace-nowrap",children:r("mobileLabel")})]})]})})}function e$(){let{shouldSurface:e,isReconnecting:t}=(0,eM.Fx)(),r=(0,x.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 eX=r(45573),eY=r(94465),eZ=r(70628);let eQ=["global","terminal","composer","editor"],e0=[{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 e1(){let{open:e,setOpen:t}=(0,eZ.K)(),{open:r}=(0,eL.C)(),s=(0,x.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,eX.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]:e0;return eQ.map(t=>({scope:t,shortcuts:e.filter(e=>e.scope===t)})).filter(e=>e.shortcuts.length>0)}();return(0,n.jsx)(eY.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)(eA.u,{children:"MOD"===e?o?"⌘":"Ctrl":e},t))})]},e.id))})]},t)})})})}var e2=r(77016),e5=r(36809),e4=r(31166);let e3=/^v?\d+\.\d+\.\d+$/;function e9(e){return e.replace(/^v/,"").split(".").map(Number)}let e6="commandmate.lastSeenAppVersion";function e8(e){try{window.localStorage.setItem(e6,e)}catch(e){}}let e7=[{key:"added",labelKey:"whatsNew.added"},{key:"improved",labelKey:"whatsNew.improved"},{key:"fixed",labelKey:"whatsNew.fixed"}];function te(){let e=(0,x.c)("common"),t=(0,e5.Ym)(),[r,s]=(0,a.useState)(null),[o,i]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e,t="0.45.1";try{e=window.localStorage.getItem(e6)}catch(e){return}let r=function(e,t){if(!e3.test(t))return{kind:"none"};if(null===e||!e3.test(e))return{kind:"remember"};let r=function(e,t){let r=e9(e),n=e9(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 e8(t);let n=!1;return er.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&&e8(r.to),i(!1)},[r]);if(!r)return null;let c="ja"===t?"ja":"en";return(0,n.jsx)(eY.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]})]}),e7.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)(e4.$,{type:"button",variant:"primary",size:"sm",onClick:l,"data-testid":"whats-new-close",children:e("whatsNew.close")})]})]})})}let tt="transform transition-transform duration-300 ease-out",tr=(0,a.memo)(function(e){let{children:t}=e,{isOpen:r,isMobileDrawerOpen:u,closeMobileDrawer:m,width:f,setWidth:h,repoTabBarMode:x}=(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,en.fs)(null!=x?x:en.PB,r),k=Math.round(32*v)+64*!!g,C=(0,a.useRef)(null),M=(0,a.useRef)(null),S=(0,a.useCallback)(e=>{h(Math.round(e/v))},[h,v]);return b?(0,n.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[(0,n.jsx)(e$,{}),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(tt,"\n ").concat(u?"translate-x-0":"-translate-x-full","\n "),role:"complementary",children:(0,n.jsx)(el,{})}),(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)(eU,{}),(0,n.jsx)(eX.xq,{}),(0,n.jsx)(e1,{}),(0,n.jsx)(e2.n,{}),(0,n.jsx)(te,{})]}):(0,n.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[N&&(0,n.jsx)(eF,{}),g&&(0,n.jsx)(eT,{}),(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(tt,"\n ").concat(r?"translate-x-0":"-translate-x-full","\n "),style:{width:"".concat(j,"px"),zIndex:eP.M.SIDEBAR,...N?{top:"".concat(k,"px"),height:"calc(100vh - ".concat(k,"px)")}:{}},role:"complementary","aria-hidden":!r,children:[(0,n.jsx)(el,{}),(0,n.jsx)(tn,{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)(eX.xq,{}),(0,n.jsx)(e1,{}),(0,n.jsx)(e2.n,{}),(0,n.jsx)(te,{})]})});function tn(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 ts=["/login","/offline","/proxy"],ta=/^\/worktrees\/[^/]+\/(terminal|files)(\/|$)/;function to(e){var t;let{children:r}=e,a=(0,s.usePathname)();return(t=null!=a?a:"",ts.some(e=>t===e||t.startsWith("".concat(e,"/")))||ta.test(t)||0)?(0,n.jsx)(n.Fragment,{children:r}):(0,n.jsx)(tr,{children:r})}},76471:(e,t,r)=>{"use strict";r.d(t,{Ej:()=>d,Jd:()=>i,Mq:()=>c,rH:()=>l});var n=r(95155),s=r(12115),a=r(18955),o=r(48481);let i="bg-transparent border-2 border-muted-foreground",l="status.unknown";function c(e,t){return!0===t&&"ready"===e}let d=(0,s.memo)(function(e){let{status:t,label:r,waitingKind:s,unclassified:d}=e,u=(0,a.c)("common"),m=c(t,d);return(0,n.jsx)(o.m,{"data-testid":"status-indicator",status:t,label:m?null!=r?r:u(l):r,waitingKind:s,size:"lg",className:m?i:void 0,"data-unclassified":m?"true":void 0})})},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 h(){for(let e of f)e()}function x(e){return f.add(e),()=>{f.delete(e)}}function b(){return m>0}function p(){return!1}function g(){return(0,s.useSyncExternalStore)(x,b,p)}function v(){let e=(0,a.c)("common"),[t,r]=(0,s.useState)(null),[f,x]=(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,h(),()=>{m-=1,h()}},[p]);let g=(0,s.useCallback)(()=>{window.location.reload()},[]),v=(0,s.useCallback)(()=>{r(e=>(e&&x(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,62295)),Promise.resolve().then(r.bind(r,23252))}},e=>{e.O(0,[5373,2978,6809,4909,2770,2619,6192,8318,8407,2407,344,6654,8606,4768,8165,9619,8441,1255,7358],()=>e(e.s=80903)),_N_E=e.O()}]);
|