tower-studio 0.2.38 → 0.2.40
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/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +48 -36
- package/.next/standalone/.next/server/app/_not-found/page.js +3 -3
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/adapters/test/route.js +1 -1
- package/.next/standalone/.next/server/app/api/adapters/test/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/files/assets/[projectId]/[filename]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/files/assets/[projectId]/[filename]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assets/reveal/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js +2 -2
- package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/backup/import/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/backup/import/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/cache/[...segments]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/cache/[...segments]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/install/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/install/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/stop/route.js +2 -2
- package/.next/standalone/.next/server/app/api/internal/hooks/stop/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/monaco/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/buffer/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/buffer/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/input/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/input/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js +3 -3
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +83 -71
- package/.next/standalone/.next/server/app/missions/page.js +6 -6
- package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +48 -36
- package/.next/standalone/.next/server/app/onboarding/page.js +3 -3
- package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +48 -36
- package/.next/standalone/.next/server/app/page.js +3 -3
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +65 -53
- package/.next/standalone/.next/server/app/settings/page.js +5 -5
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +121 -109
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js +5 -5
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +106 -94
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +93 -81
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +96 -84
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +48 -36
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js +4 -4
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +88 -76
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js +5 -5
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +95 -83
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +6 -6
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +68 -56
- package/.next/standalone/.next/server/app/workspaces/page.js +3 -3
- package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js +5 -5
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0hrprmi.js +2 -2
- package/.next/standalone/.next/server/chunks/0zjb_server_app_api_internal_assets_[projectId]_[filename]_route_actions_08y.jen.js +1 -1
- package/.next/standalone/.next/server/chunks/[externals]__0izylsq._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0lioghc._.js → [root-of-the-server]__0-~q463._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0d2japj._.js → [root-of-the-server]__0.wld9h._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.z8.oi._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__02jy80j._.js +4 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0dy~osn._.js → [root-of-the-server]__032d9pl._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__08u6wg.._.js → [root-of-the-server]__037x-0a._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__08xus7y._.js → [root-of-the-server]__04jduyo._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__04u7b2g._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__05nz.tg._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ai09na._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__00mjz~7._.js → [root-of-the-server]__0az764e._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__12ohpl.._.js → [root-of-the-server]__0b3m.jm._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0_3ce_3._.js → [root-of-the-server]__0c7z.~a._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__00~-bvt._.js → [root-of-the-server]__0d1bhsb._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0j05vlm._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__01n7exm._.js → [root-of-the-server]__0kexk71._.js} +3 -3
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0qif839._.js → [root-of-the-server]__0kuo6q5._.js} +3 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0l1-djp._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0~foo~5._.js → [root-of-the-server]__0np.553._.js} +3 -3
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0q8.khe._.js → [root-of-the-server]__0r-6wmj._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t_yyy8._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0omyrab._.js → [root-of-the-server]__0u_-4~7._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xswbi9._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0tys9pv._.js → [root-of-the-server]__0z20rmt._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__11l3gud._.js +3 -0
- package/.next/standalone/.next/server/chunks/{_0lb0q5p._.js → _06.mxka._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{src_0bkvm8c._.js → src_02ruq-1._.js} +2 -2
- package/.next/standalone/.next/server/chunks/src_0weytpz._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_02llcit._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_0i2.v2d._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_12xey8u._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_ai_0xx6y51._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{0ws9_lucide-react_dist_esm_icons_0odx0ph._.js → 0ws9_lucide-react_dist_esm_icons_10_90yo._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0.-z9ts._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0f88ua~._.js → [root-of-the-server]__0.2h0ux._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__07_o.al._.js → [root-of-the-server]__0.infp2._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__04rp1ck._.js → [root-of-the-server]__0.u-t.1._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01kyzx1._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0k-mx8r._.js → [root-of-the-server]__02j1enz._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02mo_kb._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02~6htc._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0guqcva._.js → [root-of-the-server]__038u_kv._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__09s~cme._.js → [root-of-the-server]__0391jsv._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__02ur64h._.js → [root-of-the-server]__03fujv7._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04wbr9x._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0-tolks._.js → [root-of-the-server]__058rbx5._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05xg05r._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__077c1-u._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0lozqxc._.js → [root-of-the-server]__094t44p._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0_i7zpd._.js → [root-of-the-server]__09t~p.u._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0m7ydqb._.js → [root-of-the-server]__09z_ddd._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0p0te97._.js → [root-of-the-server]__0ce3fpq._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__062b.yt._.js → [root-of-the-server]__0da~mv~._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0qqbb31._.js → [root-of-the-server]__0dux7x.._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ea-1l0._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0th-t1a._.js → [root-of-the-server]__0h589~0._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jymb~t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__00~jawi._.js → [root-of-the-server]__0l6bt9t._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0m80~su._.js → [root-of-the-server]__0mmypbn._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0mpjat-._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0_1zewr._.js → [root-of-the-server]__0mq0f94._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ni-_7_._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0scj6ed._.js → [root-of-the-server]__0odeai5._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0siyg1p._.js → [root-of-the-server]__0oq-j16._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0na8eiv._.js → [root-of-the-server]__0pmjob9._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0lz4wdp._.js → [root-of-the-server]__0pvaj~l._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0wofia_._.js → [root-of-the-server]__0rckee~._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0y~ooou._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z7je5_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0t6f4lq._.js → [root-of-the-server]__10s67lq._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__04p5fnx._.js → [root-of-the-server]__10~3-.h._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__093tt4a._.js → [root-of-the-server]__12w35bx._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{_0e-zyn2._.js → _0-_yznx._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0-~9em3._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_00t6138._.js → _03lt1_x._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{_0l3l_d6._.js → _04bt0.3._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0ght75u._.js → _04jcctt._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0cxhub8._.js → _04~zqvy._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/_070t_mh._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_13glpna._.js → _07_8m~l._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0_z-t6g._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0a-.s7z._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0aqfqr5._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0qkt.3y._.js → _0be3783._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0g8mw1b._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0hh17jg._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_02encue._.js → _0mm~wxj._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0_hnt09._.js → _0n4bq0m._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0n54odq._.js → _0n5do.z._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0j84cn0._.js → _0o3rthp._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0n1l7yo._.js → _0p6p_68._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{_0clhm~f._.js → _0py1s-f._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0qrc1eu._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0mzwe90._.js → _0rrzd20._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0k9b94s._.js → _0t863nl._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_07fnvnm._.js → _0tvm5af._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0mpce0d._.js → _0u7c6bz._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{_0hu0tyg._.js → _0u_uywm._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0wbcp88._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0t53a7_._.js → _0zqwuq~._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0~cy-h1._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_11rjd4d._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0muaopo._.js → _12ca88g._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0hhlpw6._.js → node_modules__pnpm_06f0dao._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/src_0djxlqx._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_notes_notes-page-client_tsx_10gyo3v._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_components_ui_select_tsx_0d2ra01._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_06nbc41._.js → src_lib_02~3_5t._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_01xtio2._.js → src_lib_04d~c.c._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_03p6skw._.js → src_lib_08wv1le._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_05mu4f0._.js → src_lib_0_9avpk._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0a60u40._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0fu5szn._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0gve57o._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0koe0p0._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0qdh-v4._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0ramp4w._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0sms4xl._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0sn1z-s._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_110am8v._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_11w~.ge._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_worktree_ts_06cucy3._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +417 -333
- package/.next/standalone/.next/static/chunks/0.lqb7y9kz5z6.js +1 -0
- package/.next/standalone/.next/static/chunks/02zqmiej0opg7.js +1 -0
- package/.next/standalone/.next/static/chunks/{0a234qgxmvbfu.js → 03jo4masky_ji.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0wbzgoyu4~g4x.js → 03rl6s3rpptas.js} +1 -1
- package/.next/standalone/.next/static/chunks/{097rglx2_e2oo.js → 05n5tgexx2_92.js} +1 -1
- package/.next/standalone/.next/static/chunks/0651zmy-w~saj.js +1 -0
- package/.next/standalone/.next/static/chunks/{04t77qlr4-sw7.js → 09ossbd-6zx4g.js} +1 -1
- package/.next/standalone/.next/static/chunks/0_d-xz2x5qb_c.js +1 -0
- package/.next/standalone/.next/static/chunks/0bq80txkiwk0q.js +1 -0
- package/.next/standalone/.next/static/chunks/0bx6xpa7fgedh.js +1 -0
- package/.next/standalone/.next/static/chunks/{14man4i21otxe.js → 0dp-d685xgb68.js} +1 -1
- package/.next/standalone/.next/static/chunks/0kf6kwtt_mouu.js +1 -0
- package/.next/standalone/.next/static/chunks/0l2-qbv0tx44i.js +1 -0
- package/.next/standalone/.next/static/chunks/0l3n_2z5xfhor.js +1 -0
- package/.next/standalone/.next/static/chunks/0mu2posb9cg4b.js +1 -0
- package/.next/standalone/.next/static/chunks/0nc-n~ecfjozt.js +1 -0
- package/.next/standalone/.next/static/chunks/{0c0u4it7gyb1..js → 0roncmx7dp-47.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0jlzko424.5et.js → 0s6gcjv24hfkq.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0rbykdrqih-0t.js → 0t1nk8jlwgyb-.js} +1 -1
- package/.next/standalone/.next/static/chunks/{10q75vl~mg7vy.js → 0tb.0x~6y.21w.js} +1 -1
- package/.next/standalone/.next/static/chunks/{10mwqzqdpi9d5.js → 0v.l5.sqos562.js} +1 -1
- package/.next/standalone/.next/static/chunks/{151eqj4g7bidp.js → 0vm6adb7s2i4g.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0bsigqvr2-qcp.js → 0xxn47mtozln~.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0khxfvo-tgpbc.js → 0~33w7-91bik-.js} +1 -1
- package/.next/standalone/.next/static/chunks/0~qrkswofk7zn.css +1 -0
- package/.next/standalone/.next/static/chunks/{17ldo-bezxis..js → 11brr5_f60yx-.js} +1 -1
- package/.next/standalone/.next/static/chunks/120u45g91sx4q.js +5 -0
- package/.next/standalone/.next/static/chunks/13rq33eiffqaz.js +1 -0
- package/.next/standalone/.next/static/chunks/{13qts-1uv7-ee.js → 16e-u8e~pzz_-.js} +1 -1
- package/.next/standalone/.next/static/chunks/1821tyytk30ed.js +2 -0
- package/.next/standalone/.next/static/chunks/{0.nk_89kz3j6c.js → 183m8iouij_n8.js} +1 -1
- package/.next/standalone/package.json +3 -2
- package/bin/tower.mjs +10 -1
- package/dist/mcp-server.cjs +270 -146
- package/package.json +3 -2
- package/scripts/migrations/0003-backfill-systemconfig-from-legacy-db.ts +113 -0
- package/scripts/migrations/0004-relocate-misplaced-assets.ts +172 -0
- package/scripts/run-migrations.ts +12 -0
- package/.next/standalone/.next/server/chunks/[externals]__0k7u3dx._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.a1443._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__00llstz._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__01yu.gw._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0965p6t._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0c513um._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qijr4h._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0rc0ntp._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__046-2.-._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05sv58d._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dixwk_._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0gzafdq._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0i97rbw._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0mbvmq1._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qnzkj3._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qp5cw1._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rlar2j._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_00vn2qb._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_07_.oek._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_09ri_be._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0_q.4.i._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0nk7qd4._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0no6nrx._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0vqyl_~._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_06okbb2._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0741dos._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0cbuy0_._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0e27xy7._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0n5-vk5._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0rk2hla._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0t5xz2y._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0u5_gf2._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0v6s6se._.js +0 -3
- package/.next/standalone/.next/static/chunks/01.g0gvh6h11a.js +0 -2
- package/.next/standalone/.next/static/chunks/03zzmb3y7kpxl.js +0 -1
- package/.next/standalone/.next/static/chunks/0dt3ljzz2pz0r.css +0 -1
- package/.next/standalone/.next/static/chunks/0nfwp8f87wok1.js +0 -1
- package/.next/standalone/.next/static/chunks/0qonpqhvpg-tt.js +0 -1
- package/.next/standalone/.next/static/chunks/0qu5zm6k.e_de.js +0 -5
- package/.next/standalone/.next/static/chunks/0w7_~s93hxxkk.js +0 -1
- package/.next/standalone/.next/static/chunks/0yl2smjfz2bzk.js +0 -1
- package/.next/standalone/.next/static/chunks/0~uo_7-sxehxf.js +0 -1
- package/.next/standalone/.next/static/chunks/11pivwhywsmj9.js +0 -1
- package/.next/standalone/.next/static/chunks/13ipvyn1q8z4y.js +0 -1
- package/.next/standalone/.next/static/chunks/14bii1nj2yewi.js +0 -1
- package/.next/standalone/.next/static/chunks/15_ulpp1r-6ra.js +0 -1
- package/.next/standalone/.next/static/chunks/15~2jg4z8h54~.js +0 -1
- package/.next/standalone/.next/static/chunks/183k6undfylp5.js +0 -1
- /package/.next/standalone/.next/static/{08PQLn-tnfP4XX6HBzxZ7 → wtOlqKEl8oeuEeWLbCnuv}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{08PQLn-tnfP4XX6HBzxZ7 → wtOlqKEl8oeuEeWLbCnuv}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{08PQLn-tnfP4XX6HBzxZ7 → wtOlqKEl8oeuEeWLbCnuv}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,113399,e=>{"use strict";var t=e.i(289721),s=e.i(965652),a=e.i(538059),n=e.i(821957),i=e.i(533499),r=e.i(519455),l=e.i(793479),o=e.i(624687),c=e.i(110204),d=e.i(487486),m=e.i(699375),u=e.i(776639),x=e.i(975157),g=e.i(386343),h=e.i(572989);let p=(0,h.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);var f=e.i(645378);let b=(0,h.default)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);var j=e.i(125177),v=e.i(256753),N=e.i(245697),y=e.i(360325),k=e.i(657153),w=e.i(232545);let C=(0,h.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);var S=e.i(998626);let T=(0,h.default)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]),M=(0,h.default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var D=e.i(400355),B=e.i(882651),R=e.i(181209),P=e.i(453889),L=e.i(890515),F=e.i(882831),U=e.i(340760),I=e.i(514798);let E=(0,I.createServerReference)("0096dda894769b63f7db321229f2e29c5eb63910eb",I.callServer,void 0,I.findSourceMapURL,"getAvailableTerminalApps"),H=(0,I.createServerReference)("003a751a093cb8d33cb84837de53ed55bb831808f0",I.callServer,void 0,I.findSourceMapURL,"getAvailableEditors");var V=e.i(732700);let z=(0,I.createServerReference)("40ed593f878bdb40633ace1e213cdd4a46659ed794",I.callServer,void 0,I.findSourceMapURL,"createPrompt"),K=(0,I.createServerReference)("603b94f659983ece6c00b16fef05685ccb8ef6c65c",I.callServer,void 0,I.findSourceMapURL,"updatePrompt"),A=(0,I.createServerReference)("40c075d29e5bfede26a93e26cf145f2fccc603534f",I.callServer,void 0,I.findSourceMapURL,"deletePrompt"),$=(0,I.createServerReference)("60076279904b452893970a334bf7415e18d4f37849",I.callServer,void 0,I.findSourceMapURL,"setDefaultPrompt"),O=(0,I.createServerReference)("00266118c331beafed9891f843965ca9caa0782e03",I.callServer,void 0,I.findSourceMapURL,"getAvailableProviders");var W=e.i(746798),q=e.i(224277);let _=(0,h.default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);var G=e.i(631675);let X=(0,h.default)("folder-up",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);var Y=e.i(922541),Z=e.i(759686),J=e.i(487278),Q=e.i(360112);let ee=(0,I.createServerReference)("40e0df170298483d9bbeccecff738a693d99c5e55b",I.callServer,void 0,I.findSourceMapURL,"createBackup"),et=(0,I.createServerReference)("003a503d82c9fd68de5e7d9078ba314e57b29fcd32",I.callServer,void 0,I.findSourceMapURL,"listBackupFiles"),es=(0,I.createServerReference)("40fcc83ab91f82e0641bc7b7a89a8e92219b896d94",I.callServer,void 0,I.findSourceMapURL,"deleteBackupFile"),ea=(0,I.createServerReference)("4039e758a220806737d714f24e413810873766cfff",I.callServer,void 0,I.findSourceMapURL,"restoreBackup"),en=(0,I.createServerReference)("40b61b369ab366867e1f85f3bf76b20373203021c2",I.callServer,void 0,I.findSourceMapURL,"resetSystem"),ei=(0,I.createServerReference)("00001bcd96599679a4ade2257b7b32b836ddd7def3",I.callServer,void 0,I.findSourceMapURL,"getBackupDir"),er=(0,I.createServerReference)("40602cbe729aab9d0c1057cc6420ad6dc02495ad6d",I.callServer,void 0,I.findSourceMapURL,"setBackupDir"),el=(0,I.createServerReference)("00f13439475a3793f95344ce09e2f72d811159c82b",I.callServer,void 0,I.findSourceMapURL,"getStorageLocation"),eo=(0,I.createServerReference)("4058884cd86ceb238dd23849793327b3f2fa45167e",I.callServer,void 0,I.findSourceMapURL,"setStorageLocation");function ec(){let{t:e,locale:n}=(0,i.useI18n)(),o=(0,a.useRouter)(),[c,d]=(0,s.useState)([]),[m,x]=(0,s.useState)(""),[g,h]=(0,s.useState)(!1),[p,f]=(0,s.useState)(null),[b,j]=(0,s.useState)(!1),[v,N]=(0,s.useState)(!0),[y,k]=(0,s.useState)(null),[w,C]=(0,s.useState)(!1),[T,M]=(0,s.useState)(""),B=(0,s.useRef)(null),[R,P]=(0,s.useState)(!1),[L,F]=(0,s.useState)(""),U=(0,s.useCallback)(async()=>{N(!0);try{let[e,t,s]=await Promise.all([et(),ei(),el()]);d(e),x(t),f(s)}finally{N(!1)}},[]);(0,s.useEffect)(()=>{U()},[U]);let I=async()=>{let t=T.trim()||void 0;C(!1),M(""),k("create");try{await ee(t),Q.toast.success(e("settings.backup.createSuccess")),await U()}catch{Q.toast.error(e("settings.backup.createError"))}finally{k(null)}},E=async t=>{if(confirm(e("settings.backup.restoreConfirm"))){k("restore");try{await ea(t),Q.toast.success(e("settings.backup.restoreSuccess"),{action:{label:e("settings.backup.reload"),onClick:()=>window.location.reload()},duration:15e3}),await U()}catch{Q.toast.error(e("settings.backup.restoreError"))}finally{k(null)}}},H=async t=>{if(confirm(e("settings.backup.deleteConfirm")))try{await es(t),Q.toast.success(e("settings.backup.deleteSuccess")),d(e=>e.filter(e=>e.filename!==t))}catch{Q.toast.error(e("settings.backup.deleteError"))}},V=async t=>{h(!1);try{await er(t),x(t),Q.toast.success(e("settings.backup.dirSaved")),await U()}catch{Q.toast.error(e("settings.backup.dirError"))}},z=async t=>{k("storage");try{let s=await eo({newPath:t});if(!s.ok)return void Q.toast.error(s.error||e("settings.storage.moveError"));Q.toast.success(e("settings.storage.moveSuccess",{count:String(s.moved??0)})),await U()}catch(t){Q.toast.error(t instanceof Error?t.message:e("settings.storage.moveError"))}finally{k(null)}},K=async t=>{j(!1),confirm(e("settings.storage.moveConfirm"))&&await z(t)},A=async()=>{!p||p.isDefault||confirm(e("settings.storage.resetConfirm"))&&await z(p.default)},$=async t=>{let s=t.target.files?.[0];if(s){t.target.value="",k("import");try{let t=new FormData;t.append("file",s);let a=await fetch("/api/internal/backup/import",{method:"POST",body:t});if(!a.ok){let t=await a.json();Q.toast.error("Invalid backup archive"===t.error?e("settings.backup.importInvalid"):(t.error,e("settings.backup.importError")));return}Q.toast.success(e("settings.backup.importSuccess")),await U()}catch{Q.toast.error(e("settings.backup.importError"))}finally{k(null)}}},O=async()=>{if("RESET"===L){P(!1),F(""),k("reset");try{await en("RESET"),Q.toast.success(e("settings.backup.resetSuccess")),o.push("/")}catch{Q.toast.error(e("settings.backup.resetError"))}finally{k(null)}}},ec=null!==y;return(0,t.jsxs)("div",{className:"space-y-6",children:[("restore"===y||"reset"===y)&&(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,t.jsx)(D.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"restore"===y?e("settings.backup.restoring"):e("settings.backup.resetting")})]})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-base font-semibold",children:e("settings.storage.sectionTitle")}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("settings.storage.hint")}),(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{children:[e("settings.storage.current"),":"]}),(0,t.jsx)("code",{className:"rounded bg-muted px-2 py-0.5 text-xs",children:p?.current??"…"}),p?.isDefault&&(0,t.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:e("settings.storage.defaultBadge")}),(0,t.jsx)(r.Button,{variant:"ghost",onClick:()=>j(!0),disabled:"storage"===y,className:"text-xs text-muted-foreground",children:"storage"===y?(0,t.jsx)(D.Loader2,{className:"h-3 w-3 animate-spin"}):e("settings.storage.change")}),p&&!p.isDefault&&(0,t.jsx)(r.Button,{variant:"ghost",onClick:A,disabled:"storage"===y,className:"text-xs text-muted-foreground",children:e("settings.storage.reset")})]}),(0,t.jsx)(q.FolderBrowserDialog,{open:b,onOpenChange:j,onSelect:K})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-base font-semibold",children:e("settings.backup.sectionTitle")}),(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{children:[e("settings.backup.dir"),":"]}),(0,t.jsx)("code",{className:"rounded bg-muted px-2 py-0.5 text-xs",children:m}),(0,t.jsx)(r.Button,{variant:"ghost",onClick:()=>h(!0),className:"text-xs text-muted-foreground",children:e("settings.backup.dirChange")})]}),(0,t.jsx)(q.FolderBrowserDialog,{open:g,onOpenChange:h,onSelect:V})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Button,{onClick:()=>{M(""),C(!0)},disabled:ec,className:"gap-2",children:"create"===y?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.Loader2,{className:"h-4 w-4 animate-spin"})," ",e("settings.backup.creating")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(_,{className:"h-4 w-4"})," ",e("settings.backup.create")]})}),(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsxs)(W.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"outline",disabled:ec,onClick:()=>B.current?.click(),className:"gap-2"}),children:[(0,t.jsx)(X,{className:"h-4 w-4"}),e("settings.backup.import")]}),(0,t.jsx)(W.TooltipContent,{side:"bottom",sideOffset:4,children:e("settings.backup.importHint")})]}),(0,t.jsx)("input",{ref:B,type:"file",accept:".tar.gz,.gz",className:"hidden",onChange:$})]}),(0,t.jsx)(u.Dialog,{open:w,onOpenChange:C,children:(0,t.jsxs)(u.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(u.DialogHeader,{children:(0,t.jsx)(u.DialogTitle,{children:e("settings.backup.create")})}),(0,t.jsxs)("div",{className:"py-2",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:e("settings.backup.createLabel")}),(0,t.jsx)(l.Input,{value:T,onChange:e=>M(e.target.value),onKeyDown:e=>"Enter"===e.key&&I(),placeholder:e("settings.backup.createLabelPlaceholder"),className:"mt-1.5",autoFocus:!0})]}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>C(!1),children:e("common.cancel")}),(0,t.jsx)(r.Button,{onClick:I,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:e("settings.backup.create")})]})]})}),v?(0,t.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,t.jsx)(D.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):0===c.length?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 py-12 text-center",children:[(0,t.jsx)(J.Archive,{className:"h-10 w-10 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("settings.backup.empty")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:e("settings.backup.emptyDesc")})]}):(0,t.jsx)("div",{className:"space-y-3",children:c.map(s=>{var a,i;return(0,t.jsx)("div",{className:"group rounded-lg border border-border bg-card p-4 transition-colors hover:bg-accent/30",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[s.label?(0,t.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:s.label}):(0,t.jsx)("span",{className:"truncate text-sm font-medium font-mono text-foreground",children:s.filename}),s.autoBackup&&(0,t.jsx)("span",{className:"shrink-0 rounded-full bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-500 ring-1 ring-amber-500/20",children:e("settings.backup.autoLabel")})]}),s.label&&(0,t.jsx)("div",{className:"mt-0.5 text-[11px] font-mono text-muted-foreground/60",children:s.filename}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-muted-foreground",children:[(a=s.size)<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1048576).toFixed(1)} MB`," · ",(i=s.createdAt,new Date(i).toLocaleString("zh"===n?"zh-CN":"en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}))]}),s.preview.length>0&&(0,t.jsxs)("div",{className:"mt-1.5 text-xs text-muted-foreground",children:[s.preview.map((e,s)=>(0,t.jsxs)("span",{children:[s>0&&" ",e.workspace,"(",e.projects.join(", "),")"]},s)),s.stats.workspaces>s.preview.length&&(0,t.jsxs)("span",{children:[" ",e("settings.backup.workspaces",{count:String(s.stats.workspaces)})]})]}),(0,t.jsxs)("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[e("settings.backup.projects",{count:String(s.stats.projects)})," · ",e("settings.backup.tasks",{count:String(s.stats.tasks)})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsx)(W.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-xs",onClick:()=>E(s.filename),disabled:ec,className:"text-muted-foreground hover:text-foreground"}),children:(0,t.jsx)(G.Upload,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(W.TooltipContent,{side:"bottom",sideOffset:4,children:e("settings.backup.restore")})]}),(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsx)(W.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-xs",onClick:()=>H(s.filename),disabled:ec,className:"text-muted-foreground hover:text-rose-400"}),children:(0,t.jsx)(S.Trash2,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(W.TooltipContent,{side:"bottom",sideOffset:4,children:e("settings.backup.delete")})]})]})]})},s.filename)})}),(0,t.jsxs)("div",{className:"border-t border-border pt-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold text-rose-400",children:[(0,t.jsx)(Z.AlertTriangle,{className:"h-4 w-4"}),e("settings.backup.dangerZone")]}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground leading-relaxed",children:e("settings.backup.resetDesc")}),(0,t.jsxs)(r.Button,{variant:"outline",onClick:()=>{F(""),P(!0)},disabled:ec,className:"mt-3 border-rose-500/30 text-rose-400 hover:bg-rose-500/10 hover:text-rose-400",children:[(0,t.jsx)(Y.RotateCcw,{className:"mr-2 h-3.5 w-3.5"}),e("settings.backup.reset")]})]}),(0,t.jsx)(u.Dialog,{open:R,onOpenChange:P,children:(0,t.jsxs)(u.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsx)(u.DialogTitle,{children:e("settings.backup.resetConfirmTitle")}),(0,t.jsx)(u.DialogDescription,{children:e("settings.backup.resetConfirmDesc")})]}),(0,t.jsxs)("div",{className:"py-2",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:e("settings.backup.resetConfirmInput")}),(0,t.jsx)(l.Input,{value:L,onChange:e=>F(e.target.value),placeholder:"RESET",className:"mt-1.5 font-mono"})]}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>P(!1),children:e("common.cancel")}),(0,t.jsx)(r.Button,{disabled:"RESET"!==L,onClick:O,className:"border-rose-500/30 bg-rose-500/10 text-rose-400 hover:bg-rose-500/20",children:e("settings.backup.reset")})]})]})})]})}var ed=e.i(887911),em=e.i(597746);let eu=(0,h.default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var ex=e.i(875840),eg=e.i(475958),eh=e.i(194358),ep=e.i(337822),ef=e.i(991838);let eb=[{os:"macOS",cmd:"brew install ripgrep"},{os:"Windows",cmd:"winget install BurntSushi.ripgrep"},{os:"Linux",cmd:"sudo apt install ripgrep"}];function ej({cmd:e}){let{t:a}=(0,i.useI18n)(),[n,l]=(0,s.useState)(!1),o=async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(e);else{let t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}l(!0),Q.toast.success(a("common.copied")),setTimeout(()=>l(!1),1500)}catch{Q.toast.error(a("common.copyFailed"))}};return(0,t.jsxs)("div",{className:"flex items-start gap-1 rounded-md bg-background/60 pl-2 pr-1 py-1 ring-1 ring-border/60",children:[(0,t.jsx)("code",{className:"min-w-0 flex-1 break-all font-mono text-[11px] leading-relaxed",children:e}),(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-xs",className:"shrink-0 text-muted-foreground","aria-label":a("common.copy"),onClick:o,children:n?(0,t.jsx)(em.Check,{className:"h-3 w-3 text-emerald-400"}):(0,t.jsx)(ex.Copy,{className:"h-3 w-3"})})]})}function ev({extension:e}){let{t:a}=(0,i.useI18n)(),{status:n,loading:l,isInstalling:o,install:c,uninstall:d,refresh:m}=(0,ef.useExtension)(e.id),[u,x]=(0,s.useState)(!1),g=e.icon,h=n.installed,p=async()=>{let t=await c();t.success?Q.toast.success(a("settings.extensions.installSuccess").replace("{name}",e.name)):Q.toast.error(a("settings.extensions.installFailed").replace("{name}",e.name)+(t.error?`: ${t.error.slice(0,200)}`:""))},f=async()=>{let t=await d();t.success?Q.toast.success(a("settings.extensions.uninstallSuccess").replace("{name}",e.name)):Q.toast.error(a("settings.extensions.uninstallFailed").replace("{name}",e.name)+(t.error?`: ${t.error.slice(0,200)}`:""))},b=async()=>{x(!0);try{await m()}finally{x(!1)}},j=()=>{window.open(e.homepageUrl,"_blank","noopener,noreferrer")};return(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-background ring-1 ring-border",children:(0,t.jsx)(g,{className:"h-5 w-5 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:e.name}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.description})]})]}),(0,t.jsxs)("span",{className:"shrink-0 rounded-md bg-background px-2 py-0.5 text-xs text-muted-foreground ring-1 ring-border",children:["~",e.sizeMB," MB"]})]}),(0,t.jsx)("div",{className:"mt-4 flex items-center gap-2 text-xs",children:l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.Loader2,{className:"h-3.5 w-3.5 animate-spin text-muted-foreground"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:a("common.loading")})]}):h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.CheckCircle2,{className:"h-3.5 w-3.5 text-emerald-500"}),(0,t.jsxs)("span",{className:"text-foreground",children:[a("settings.extensions.installed"),n.version?` v${n.version}`:""]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eu,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:a("settings.extensions.notInstalledShort")})]})}),(0,t.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.Button,{variant:"default",onClick:p,disabled:o,children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.reinstalling")]}):a("settings.extensions.reinstall")}),(0,t.jsx)(r.Button,{variant:"outline",onClick:f,disabled:o,children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.uninstalling")]}):a("settings.extensions.uninstall")})]}):e.manualInstall?(0,t.jsxs)(ep.Popover,{children:[(0,t.jsx)(ep.PopoverTrigger,{render:e=>(0,t.jsxs)(r.Button,{variant:"default",...e,children:[(0,t.jsx)(_,{className:"h-3.5 w-3.5"}),a("settings.extensions.installViaHomepage")]})}),(0,t.jsxs)(ep.PopoverContent,{align:"start",className:"w-80 max-w-[90vw] gap-2 text-xs leading-relaxed",children:[(0,t.jsx)("p",{children:a("settings.extensions.manualInstallHintIntro")}),(0,t.jsx)("div",{className:"space-y-2",children:eb.map(({os:e,cmd:s})=>(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:e}),(0,t.jsx)(ej,{cmd:s})]},e))}),(0,t.jsx)("p",{className:"text-muted-foreground",children:a("settings.extensions.manualInstallHintAfter")}),(0,t.jsxs)("button",{type:"button",onClick:j,className:"flex items-center gap-1 self-start text-[11px] text-primary underline-offset-2 hover:underline",children:[(0,t.jsx)(eg.ExternalLink,{className:"h-3 w-3"}),a("settings.extensions.visitHomepage")]})]})]}):(0,t.jsx)(r.Button,{variant:"default",onClick:p,disabled:o,children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.installing")]}):a("settings.extensions.install")}),(0,t.jsxs)(r.Button,{variant:"ghost",onClick:b,disabled:u,children:[(0,t.jsx)(eh.RefreshCw,{className:`h-3.5 w-3.5 ${u?"animate-spin":""}`}),a("settings.extensions.recheck")]}),(0,t.jsxs)(r.Button,{variant:"ghost",onClick:j,children:[(0,t.jsx)(eg.ExternalLink,{className:"h-3.5 w-3.5"}),a("settings.extensions.visitHomepage")]})]})]})}function eN(){let{t:e}=(0,i.useI18n)(),s=(0,ed.listExtensionMetadata)();return(0,t.jsxs)("div",{className:"space-y-5",children:[(0,t.jsxs)("header",{children:[(0,t.jsx)("h2",{className:"text-base font-semibold",children:e("settings.extensions.title")}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("settings.extensions.desc")})]}),(0,t.jsx)("div",{className:"space-y-3",children:s.map(e=>(0,t.jsx)(ev,{extension:e},e.id))})]})}e.i(508271);var ey=e.i(371385),ek=e.i(158956),ew=e.i(75566),eC=e.i(851289);let eS=["global","panels","missions"],eT=new Set(["missions.cycleBack"]);function eM({keys:e}){return(0,t.jsx)(eC.KeyCombo,{keys:e})}function eD(){let e,{t:a}=(0,i.useI18n)(),n=(0,ew.useKeymapStore)(e=>e.overrides),l=(0,ew.useKeymapStore)(e=>e.setBinding),o=(0,ew.useKeymapStore)(e=>e.resetBinding),c=(0,ew.useKeymapStore)(e=>e.resetAll),[m,x]=(0,s.useState)(null),[g,h]=(0,s.useState)(null),p=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(m){let e=requestAnimationFrame(()=>p.current?.focus());return()=>cancelAnimationFrame(e)}},[m]);let f=(0,s.useMemo)(()=>{let e=new Map;for(let t of ey.SHORTCUT_ACTIONS)for(let s of n[t.id]??[...t.defaultKeys])e.has(s)||e.set(s,t.id);return e},[n]),b=(0,s.useMemo)(()=>eS.map(e=>({group:e,actions:ey.SHORTCUT_ACTIONS.filter(t=>t.group===e&&!eT.has(t.id))})).filter(e=>e.actions.length>0),[]),j=m?(0,ey.getAction)(m):null,v=g&&m&&(e=f.get(g))&&e!==m?e:null;function N(){x(null),h(null)}return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("header",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-base font-semibold",children:a("settings.keyboardShortcuts")}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("settings.keyboardShortcutsDesc")})]}),(0,t.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:function(){c(),Q.toast.success(a("settings.shortcuts.resetAllDone"))},children:[(0,t.jsx)(Y.RotateCcw,{className:"h-3.5 w-3.5"}),a("settings.shortcuts.resetAll")]})]}),(0,t.jsx)("div",{className:"space-y-6",children:b.map(({group:e,actions:s})=>(0,t.jsxs)("section",{children:[(0,t.jsx)("h3",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:a(`shortcuts.group.${e}`)}),(0,t.jsx)("ul",{className:"divide-y divide-border/50 rounded-xl border border-border bg-card",children:s.map(e=>{let s,i=e.id in n;return(0,t.jsxs)("li",{className:"flex items-center justify-between gap-4 px-5 py-3.5",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 text-sm",children:a(e.descriptionKey)}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,t.jsx)(eM,{keys:n[s=e.id]??[...(0,ey.getAction)(s).defaultKeys]}),e.configurable?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.Button,{variant:"outline",size:"sm",onClick:()=>{var t;return t=e.id,void(h(null),x(t))},children:a("settings.shortcuts.rebind")}),i&&(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsx)(W.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>o(e.id),children:(0,t.jsx)(Y.RotateCcw,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(W.TooltipContent,{children:a("settings.shortcuts.reset")})]})]}):(0,t.jsx)(d.Badge,{variant:"outline",className:"text-muted-foreground",children:a("settings.shortcuts.fixed")})]})]},e.id)})})]},e))}),(0,t.jsx)(u.Dialog,{open:null!==m,onOpenChange:e=>!e&&N(),children:(0,t.jsxs)(u.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsx)(u.DialogTitle,{children:j?a(j.descriptionKey):a("settings.shortcuts.rebind")}),(0,t.jsx)(u.DialogDescription,{children:a("settings.shortcuts.pressKey")})]}),(0,t.jsx)("textarea",{ref:p,readOnly:!0,tabIndex:0,"aria-label":a("settings.shortcuts.pressKey"),onKeyDown:e=>{e.preventDefault(),e.stopPropagation();let t=(0,ek.serializeKeyEvent)(e.nativeEvent);t&&h(t)},className:"flex h-20 w-full cursor-pointer resize-none items-center justify-center rounded-lg border border-dashed border-border bg-muted/30 text-center text-sm outline-none focus:border-ring focus:ring-1 focus:ring-ring"}),(0,t.jsx)("div",{className:"flex min-h-8 items-center justify-center",children:g?(0,t.jsx)(eM,{keys:[g]}):(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:a("settings.shortcuts.pressKey")})}),v&&(0,t.jsx)("p",{className:"text-center text-xs text-amber-600 dark:text-amber-400",children:a("settings.shortcuts.conflict",{name:a((0,ey.getAction)(v).descriptionKey)})}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:N,children:a("settings.shortcuts.cancel")}),(0,t.jsx)(r.Button,{variant:"default",onClick:function(){m&&g&&(l(m,[g]),N(),Q.toast.success(a("settings.shortcuts.saved")))},disabled:!g,children:a("settings.shortcuts.saveBtn")})]})]})})]})}function eB({options:e,value:s,onChange:a}){return(0,t.jsx)("div",{className:"inline-flex rounded-lg border border-border/50 bg-muted/30 p-1 gap-0.5",children:e.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>a(e.value),className:(0,x.cn)("rounded-md px-3.5 py-1.5 text-sm font-medium transition-all duration-200 cursor-pointer",s===e.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:e.label},e.value))})}function eR({label:e,description:s,children:a,className:n}){return(0,t.jsxs)("div",{className:(0,x.cn)("flex items-center justify-between py-4 border-b border-border/50 last:border-0",n),children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:e}),s&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:s})]}),(0,t.jsx)("div",{className:"shrink-0",children:a})]})}let eP=[{id:"general",labelKey:"settings.general",descKey:"settings.generalDesc",icon:g.Settings,accent:"blue"},{id:"ai-tools",labelKey:"settings.aiTools.title",descKey:"settings.aiTools.cliVerificationDesc",icon:p,accent:"emerald"},{id:"prompts",labelKey:"settings.prompts",descKey:"settings.promptsDesc",icon:f.FileText,accent:"violet"},{id:"config",labelKey:"settings.config",descKey:"settings.configDesc",icon:b,accent:"amber"},{id:"extensions",labelKey:"settings.extensions.title",descKey:"settings.extensions.navDesc",icon:N.Package,accent:"indigo"},{id:"notifications",labelKey:"settings.notifications.title",descKey:"settings.notifications.navDesc",icon:j.Bell,accent:"rose"},{id:"backup",labelKey:"settings.backup.title",descKey:"settings.backup.navDesc",icon:v.HardDrive,accent:"cyan"},{id:"keyboard-shortcuts",labelKey:"settings.keyboardShortcuts",descKey:"settings.keyboardShortcutsDesc",icon:y.Keyboard,accent:"violet"}],eL={blue:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},emerald:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},violet:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},amber:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},cyan:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},rose:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},indigo:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"}},eF="ai-manager:default-cli-adapter",eU={host:"",ownerMatch:"*",localPathTemplate:"",priority:0},eI=e=>e.replace(/\\/g,"/").replace(/\/+$/,"");function eE(){let e=(0,a.useRouter)(),{t:g}=(0,i.useI18n)(),{theme:h,setTheme:p}=(0,n.useTheme)(),{locale:f,setLocale:b}=(0,i.useI18n)(),[j,v]=(0,s.useState)("general"),N=(0,s.useRef)(null),[y,I]=(0,s.useState)({left:0,width:0}),[_,G]=(0,s.useState)(!1),[X,Y]=(0,s.useState)("Terminal"),[Z,J]=(0,s.useState)([]),[Q,ee]=(0,s.useState)(""),[et,es]=(0,s.useState)([]),[ea,en]=(0,s.useState)(13),[ei,er]=(0,s.useState)("Menlo, Monaco, 'Courier New', monospace"),[el,eo]=(0,s.useState)([]),[ed,em]=(0,s.useState)("claude"),[eu,ex]=(0,s.useState)(null),[eg,eh]=(0,s.useState)({}),[ep,ef]=(0,s.useState)([]),[eb,ej]=(0,s.useState)(!1),[ev,ey]=(0,s.useState)(null),[ek,ew]=(0,s.useState)(null),[eC,eS]=(0,s.useState)(""),[eT,eM]=(0,s.useState)(""),[eE,eH]=(0,s.useState)(""),[eV,ez]=(0,s.useState)([]),[eK,eA]=(0,s.useState)(null),[e$,eO]=(0,s.useState)({...eU}),[eW,eq]=(0,s.useState)(!1),[e_,eG]=(0,s.useState)({...eU}),[eX,eY]=(0,s.useState)(!1),[eZ,eJ]=(0,s.useState)(!1),[eQ,e0]=(0,s.useState)(0),[e1,e2]=(0,s.useState)(null),[e5,e3]=(0,s.useState)(null),[e4,e8]=(0,s.useState)({maxUploadMb:50,maxConcurrent:3,maxReadableMb:5,archiveDelayDays:7,taskDefaultUseWorktree:!0,taskDefaultAutoStart:!1}),[e7,e6]=(0,s.useState)({timeoutSec:30}),[e9,te]=(0,s.useState)({resultLimit:20,allModeCap:5,debounceMs:250,snippetLength:80,codeTimeoutSec:30}),[tt,ts]=(0,s.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5}),[ta,tn]=(0,s.useState)(null),[ti,tr]=(0,s.useState)(!1),[tl,to]=(0,s.useState)(""),[tc,td]=(0,s.useState)(!0);(0,s.useEffect)(()=>G(!0),[]),(0,s.useEffect)(()=>{(0,L.getConfigValue)("terminal.app","Terminal").then(Y),E().then(J),(0,L.getConfigValue)("editor.command","").then(ee),H().then(es),(0,L.getConfigValue)("terminal.fontSize",13).then(en),(0,L.getConfigValue)("terminal.fontFamily","Menlo, Monaco, 'Courier New', monospace").then(er)},[]),(0,s.useEffect)(()=>{if(0===Z.length||!X||Z.some(e=>e.value===X))return;let e=Z.find(e=>e.name===X);e&&(Y(e.value),(0,F.setConfigValue)("terminal.app",e.value))},[Z,X]),(0,s.useEffect)(()=>{if(0===et.length||!Q||et.some(e=>e.command===Q))return;let e=et.find(e=>e.name===Q);e&&(ee(e.command),(0,F.setConfigValue)("editor.command",e.command))},[et,Q]),(0,s.useEffect)(()=>{O().then(eo);let e=localStorage.getItem(eF);e&&em(e)},[]),(0,s.useEffect)(()=>{(0,V.getPrompts)().then(ef)},[]);let tm=async()=>{try{let e=await fetch("/api/internal/hooks/install");if(e.ok){let t=await e.json();tn(t)}}catch{}};async function tu(e){if(!eu){ex(e),eh(t=>{let s={...t};return delete s[e],s});try{let t=await fetch("/api/adapters/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e})}),s=await t.json();eh(t=>({...t,[e]:s}))}catch{eh(t=>({...t,[e]:{ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]}}))}finally{ex(null)}}}(0,s.useEffect)(()=>{(0,L.getConfigValue)("git.pathMappingRules",[]).then(e=>{let t=new Set,s=!1,a=e.map(e=>{if(!e.id||t.has(e.id)){s=!0;let a={...e,id:crypto.randomUUID()};return t.add(a.id),a}return t.add(e.id),e});ez(a),s&&(0,F.setConfigValue)("git.pathMappingRules",a)}),(0,L.getConfigValue)("hooks.autoUploadTypes",["png","jpg","jpeg","gif","webp","svg","pdf","md","txt","json"]).then(e=>{to(e.join(", "))}),tm(),(0,U.getConfigValues)(["system.maxUploadBytes","system.maxConcurrentExecutions","system.maxReadableFileBytes","board.archiveDelayDays","task.defaultUseWorktree","task.defaultAutoStart","git.timeoutSec","search.resultLimit","search.allModeCap","search.debounceMs","search.snippetLength","search.codeTimeoutSec","missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(e=>{let t=e["system.maxUploadBytes"]??0x3200000,s=e["system.maxReadableFileBytes"]??5242880;e8({maxUploadMb:Math.round(t/1024/1024),maxConcurrent:e["system.maxConcurrentExecutions"]??3,maxReadableMb:Math.round(s/1024/1024),archiveDelayDays:e["board.archiveDelayDays"]??7,taskDefaultUseWorktree:"boolean"!=typeof e["task.defaultUseWorktree"]||e["task.defaultUseWorktree"],taskDefaultAutoStart:"boolean"==typeof e["task.defaultAutoStart"]&&e["task.defaultAutoStart"]}),e6({timeoutSec:e["git.timeoutSec"]??30}),te({resultLimit:e["search.resultLimit"]??20,allModeCap:e["search.allModeCap"]??5,debounceMs:e["search.debounceMs"]??250,snippetLength:e["search.snippetLength"]??80,codeTimeoutSec:e["search.codeTimeoutSec"]??30}),ts({minCols:e["missions.grid.minCols"]??1,maxCols:e["missions.grid.maxCols"]??5,minRows:e["missions.grid.minRows"]??1,maxRows:e["missions.grid.maxRows"]??5})})},[]),(0,s.useEffect)(()=>{(0,L.getConfigValue)("notification.enabled",!0).then(td)},[]);let tx=(0,s.useCallback)(()=>{ey(null),eS(""),eM(""),eH(""),ej(!0)},[]),tg=(0,s.useCallback)(e=>{ey(e),eS(e.name),eM(e.description??""),eH(e.content),ej(!0)},[]),th=(0,s.useCallback)(async()=>{eC.trim()&&eE.trim()&&(ev?await K(ev.id,{name:eC.trim(),description:eT.trim()||void 0,content:eE.trim()}):await z({name:eC.trim(),description:eT.trim()||void 0,content:eE.trim()}),ej(!1),ef(await (0,V.getPrompts)()),e.refresh())},[eC,eT,eE,ev,e]),tp=(0,s.useCallback)(async()=>{ek&&(await A(ek),ew(null),ef(await (0,V.getPrompts)()),e.refresh())},[ek,e]),tf=(0,s.useCallback)(async t=>{await $(t),ef(await (0,V.getPrompts)()),e.refresh()},[e]),tb=async()=>{await (0,F.setConfigValue)("system.maxUploadBytes",1024*e4.maxUploadMb*1024),await (0,F.setConfigValue)("system.maxConcurrentExecutions",e4.maxConcurrent),await (0,F.setConfigValue)("system.maxReadableFileBytes",1024*e4.maxReadableMb*1024),await (0,F.setConfigValue)("board.archiveDelayDays",e4.archiveDelayDays)},tj=async()=>{await (0,F.setConfigValue)("task.defaultUseWorktree",e4.taskDefaultUseWorktree),await (0,F.setConfigValue)("task.defaultAutoStart",e4.taskDefaultAutoStart),await (0,F.setConfigValue)("task.mcpDefaultsConfigured",!0)},tv=async()=>{await (0,F.setConfigValue)("git.timeoutSec",e7.timeoutSec)},tN=async()=>{await (0,F.setConfigValue)("search.resultLimit",e9.resultLimit),await (0,F.setConfigValue)("search.allModeCap",e9.allModeCap),await (0,F.setConfigValue)("search.debounceMs",e9.debounceMs),await (0,F.setConfigValue)("search.snippetLength",e9.snippetLength),await (0,F.setConfigValue)("search.codeTimeoutSec",e9.codeTimeoutSec)},ty=async()=>{let e=Math.min(tt.minCols,tt.maxCols),t=Math.max(tt.minCols,tt.maxCols),s=Math.min(tt.minRows,tt.maxRows),a=Math.max(tt.minRows,tt.maxRows);ts({minCols:e,maxCols:t,minRows:s,maxRows:a}),await (0,F.setConfigValue)("missions.grid.minCols",e),await (0,F.setConfigValue)("missions.grid.maxCols",t),await (0,F.setConfigValue)("missions.grid.minRows",s),await (0,F.setConfigValue)("missions.grid.maxRows",a)},tk=async()=>{let e=tl.split(",").map(e=>e.trim()).filter(Boolean);await (0,F.setConfigValue)("hooks.autoUploadTypes",e)},tw=async()=>{if(ta){tr(!0);try{let e=ta.installed?"DELETE":"POST";await fetch("/api/internal/hooks/install",{method:e}),await tm()}finally{tr(!1)}}},tC=async()=>{if(!e_.host.trim()||!e_.localPathTemplate.trim())return;let e=eI(e_.localPathTemplate.trim()),t=eX?`${e}/{path}`:e,s=[...eV,{id:crypto.randomUUID(),host:e_.host.trim(),ownerMatch:e_.ownerMatch.trim()||"*",localPathTemplate:t,priority:e_.priority}];await (0,F.setConfigValue)("git.pathMappingRules",s),ez(s),eG({...eU}),eY(!1),eq(!1)},tS=async e=>{if(!e$.host.trim()||!e$.localPathTemplate.trim())return;let t=eI(e$.localPathTemplate.trim()),s=eZ?`${t}/{path}`:t,a=eV.map(t=>t.id===e?{...t,host:e$.host.trim(),ownerMatch:e$.ownerMatch.trim()||"*",localPathTemplate:s,priority:e$.priority}:t);await (0,F.setConfigValue)("git.pathMappingRules",a),ez(a),eA(null),eJ(!1)},tT=async e=>{let t=eV.filter(t=>t.id!==e);await (0,F.setConfigValue)("git.pathMappingRules",t),ez(t),e2(null)};async function tM(){let e=!tc;td(e),await (0,F.setConfigValue)("notification.enabled",e)}let tD=(0,s.useCallback)(()=>{e.back()},[e]);(0,s.useEffect)(()=>{let e=N.current;if(!e)return;let t=e.querySelector(`[data-section="${j}"]`);if(!t)return;let s=e.getBoundingClientRect(),a=t.getBoundingClientRect();I({left:a.left-s.left,width:a.width})},[j]);let tB=eP.find(e=>e.id===j),tR=tB?eL[tB.accent]:eL.blue;return(0,t.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,t.jsx)("div",{className:"flex-shrink-0 border-b bg-card/50 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"mx-auto max-w-5xl px-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between pb-3 pt-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:g("settings.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:g("settings.configDesc")})]}),(0,t.jsxs)(r.Button,{variant:"outline",onClick:tD,className:"gap-1.5 bg-card shadow-sm cursor-pointer",children:[(0,t.jsx)(k.X,{className:"h-3.5 w-3.5"}),"ESC"]})]}),(0,t.jsxs)("div",{ref:N,className:"relative flex gap-1 overflow-x-auto",children:[eP.map(e=>{let s=e.icon,a=j===e.id,n=eL[e.accent];return(0,t.jsxs)("button",{"data-section":e.id,onClick:()=>v(e.id),className:(0,x.cn)("relative flex items-center gap-2 rounded-t-lg px-4 py-2.5","text-sm font-medium whitespace-nowrap cursor-pointer","transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a?`${n.text} bg-background`:"text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:[(0,t.jsx)("span",{className:(0,x.cn)("flex h-6 w-6 items-center justify-center rounded-md","transition-colors duration-200",a?n.bg:"bg-transparent"),children:(0,t.jsx)(s,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("span",{children:g(e.labelKey)})]},e.id)}),(0,t.jsx)("div",{className:(0,x.cn)("absolute bottom-0 h-0.5 rounded-full","transition-all duration-250 ease-out",tR.indicator),style:{left:y.left,width:y.width}})]})]})}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsxs)("div",{className:"mx-auto max-w-4xl px-6 py-8",children:[tB&&(0,t.jsxs)("div",{className:"mb-6 flex items-start gap-4",children:[(0,t.jsx)("div",{className:(0,x.cn)("flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl","ring-1",tR.bg,tR.text,tR.ring),children:(0,t.jsx)(tB.icon,{className:"h-5 w-5"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:g(tB.labelKey)}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:g(tB.descKey)})]})]}),(0,t.jsx)("div",{className:"mb-6 border-t"}),function(){switch(j){case"general":let e;return e=[{value:"light",label:g("settings.themeLight")},{value:"dark",label:g("settings.themeDark")},{value:"system",label:g("settings.themeSystem")}],(0,t.jsxs)("div",{className:"divide-y divide-border/50",children:[(0,t.jsx)(eR,{label:g("settings.theme"),description:g("settings.themeDesc"),children:_?(0,t.jsx)(eB,{options:e,value:h??"system",onChange:e=>p(e)}):(0,t.jsx)("div",{className:"inline-flex h-9 rounded-lg border border-border/50 bg-muted/30 p-1 w-[200px]"})}),(0,t.jsx)(eR,{label:g("settings.language"),description:g("settings.languageDesc"),children:(0,t.jsx)(eB,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}],value:f,onChange:e=>b(e)})}),(0,t.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:g("settings.terminal.label")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:g("settings.terminal.desc")})]}),Z.length>0&&(0,t.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:Z.map(e=>{let s=X===e.value,a=(0,x.cn)("rounded-lg border px-3.5 py-1.5 text-xs font-medium transition-all duration-200",e.installed?s?"border-foreground bg-accent text-foreground font-medium cursor-pointer":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground cursor-pointer":"cursor-not-allowed border-dashed border-border/60 text-muted-foreground/40"),n=()=>{e.installed&&(Y(e.value),(0,F.setConfigValue)("terminal.app",e.value))};return e.installed?(0,t.jsx)("button",{type:"button",onClick:n,className:a,children:e.name},e.value):(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsx)(W.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:n,className:a,children:e.name})}),(0,t.jsx)(W.TooltipContent,{side:"top",children:g("settings.app.notInstalled")})]},e.value)})})]}),(0,t.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:g("settings.terminalFont.label")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:g("settings.terminalFont.desc")})]}),(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-4",children:[(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[g("settings.terminalFont.size"),(0,t.jsx)("input",{type:"number",min:8,max:40,value:ea,onChange:e=>{let t=Math.max(8,Math.min(40,Math.round(Number(e.target.value)||13)));en(t),(0,F.setConfigValue)("terminal.fontSize",t)},className:"h-8 w-20 rounded-md border border-border bg-background px-2 text-sm text-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"})]}),(0,t.jsxs)("label",{className:"flex min-w-0 flex-1 items-center gap-2 text-xs text-muted-foreground",children:[g("settings.terminalFont.family"),(0,t.jsx)("input",{type:"text",value:ei,placeholder:"Menlo, Monaco, 'Courier New', monospace",onChange:e=>er(e.target.value),onBlur:e=>{let t=e.target.value.trim()||"Menlo, Monaco, 'Courier New', monospace";er(t),(0,F.setConfigValue)("terminal.fontFamily",t)},className:"h-8 min-w-0 flex-1 rounded-md border border-border bg-background px-2 font-mono text-xs text-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"})]})]}),(0,t.jsx)("div",{className:"mt-1.5 text-[11px] text-muted-foreground/70",children:g("settings.terminalFont.hint")})]}),(0,t.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:g("settings.editor.label")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:g("settings.editor.desc")})]}),et.length>0&&(0,t.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:et.map(e=>{let s=Q===e.command,a=(0,x.cn)("rounded-lg border px-3.5 py-1.5 text-xs font-medium transition-all duration-200",e.installed?s?"border-foreground bg-accent text-foreground font-medium cursor-pointer":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground cursor-pointer":"cursor-not-allowed border-dashed border-border/60 text-muted-foreground/40"),n=()=>{e.installed&&(ee(e.command),(0,F.setConfigValue)("editor.command",e.command))};return e.installed?(0,t.jsx)("button",{type:"button",onClick:n,className:a,children:e.name},e.command):(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsx)(W.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:n,className:a,children:e.name})}),(0,t.jsx)(W.TooltipContent,{side:"top",children:g("settings.app.notInstalled")})]},e.command)})})]})]});case"ai-tools":return(0,t.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:el.map(e=>{let s=ed===e.name,a=eu===e.name,n=eg[e.name];return(0,t.jsx)("li",{children:(0,t.jsxs)("div",{className:"px-5 py-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:e.displayName}),(0,t.jsx)(d.Badge,{variant:"outline",children:g("label.builtin")}),s&&(0,t.jsxs)(d.Badge,{variant:"secondary",className:"shrink-0",children:[(0,t.jsx)(C,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),g("settings.prompts.default")]}),n&&(0,t.jsx)(d.Badge,{variant:n.ok?"secondary":"destructive",className:(0,x.cn)("shrink-0",n.ok&&"bg-green-600 text-white hover:bg-green-700"),children:n.ok?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.CheckCircle2,{className:"h-3 w-3 mr-1"}),g("settings.aiTools.testPassed")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R.XCircle,{className:"h-3 w-3 mr-1"}),g("settings.aiTools.testFailed")]})})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.cli.available&&e.cli.version?`${e.name} \xb7 ${e.cli.version}`:e.name})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[!s&&(0,t.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>{var t;em(t=e.name),localStorage.setItem(eF,t)},children:[(0,t.jsx)(C,{className:"h-3.5 w-3.5 mr-1.5 text-muted-foreground"}),g("settings.prompts.setDefault")]}),(0,t.jsx)(r.Button,{variant:"outline",size:"sm",onClick:()=>tu(e.name),disabled:a,children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.Loader2,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),g("settings.aiTools.testing")]}):g("settings.aiTools.testConnection")})]})]}),n&&(0,t.jsx)("div",{className:"mt-3 rounded-md border border-border bg-muted/30 px-4 py-3",children:(0,t.jsx)("div",{className:"space-y-1.5",children:n.checks.map(s=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:(0,x.cn)("w-1.5 h-1.5 rounded-full shrink-0",s.passed?"bg-green-500":"bg-red-500")}),(0,t.jsx)("span",{className:(0,x.cn)(s.passed?"text-foreground":"text-red-700 dark:text-red-300"),children:s.message})]},`${e.name}-${s.name}`))})})]})},e.name)})});case"prompts":return _?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(r.Button,{onClick:tx,variant:"default",children:[(0,t.jsx)(w.Plus,{className:"h-4 w-4 mr-2"}),g("settings.prompts.newPrompt")]})}),0===ep.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center rounded-lg border border-dashed border-border/50",children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:g("settings.prompts.empty")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:g("settings.prompts.emptyHint")})]}):(0,t.jsx)("div",{className:"rounded-xl border border-border/50 divide-y divide-border/50",children:ep.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h4",{className:"text-sm font-medium truncate",children:e.name}),e.isDefault&&(0,t.jsxs)(d.Badge,{variant:"secondary",className:"shrink-0 rounded-full text-xs",children:[(0,t.jsx)(C,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),g("settings.prompts.default")]})]}),e.description&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:e.description})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-4",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>tf(e.id),title:g("settings.prompts.setDefault"),children:(0,t.jsx)(C,{className:(0,x.cn)("h-4 w-4",e.isDefault?"fill-yellow-400 text-yellow-400":"text-muted-foreground")})}),(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>tg(e),title:g("settings.prompts.editPrompt"),children:(0,t.jsx)(T,{className:"h-4 w-4"})}),(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>ew(e.id),className:"text-destructive",title:g("settings.prompts.delete"),children:(0,t.jsx)(S.Trash2,{className:"h-4 w-4"})})]})]},e.id))}),(0,t.jsx)(u.Dialog,{open:eb,onOpenChange:ej,children:(0,t.jsxs)(u.DialogContent,{children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsx)(u.DialogTitle,{children:ev?g("settings.prompts.editPrompt"):g("settings.prompts.newPrompt")}),(0,t.jsx)(u.DialogDescription,{children:ev?g("settings.prompts.editPrompt"):g("settings.prompts.newPrompt")})]}),(0,t.jsxs)("div",{className:"space-y-4 py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-name",children:g("settings.prompts.promptName")}),(0,t.jsx)(l.Input,{id:"prompt-name",value:eC,onChange:e=>eS(e.target.value),placeholder:g("settings.prompts.promptNamePlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-description",children:g("settings.prompts.promptDescription")}),(0,t.jsx)(l.Input,{id:"prompt-description",value:eT,onChange:e=>eM(e.target.value),placeholder:g("settings.prompts.promptDescriptionPlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-content",children:g("settings.prompts.promptContent")}),(0,t.jsx)(o.Textarea,{id:"prompt-content",value:eE,onChange:e=>eH(e.target.value),placeholder:g("settings.prompts.promptContentPlaceholder"),rows:8,className:"mt-1.5 font-mono text-sm"})]})]}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>ej(!1),children:g("settings.prompts.cancel")}),(0,t.jsx)(r.Button,{onClick:th,disabled:!eC.trim()||!eE.trim(),children:g("settings.prompts.save")})]})]})}),(0,t.jsx)(u.Dialog,{open:!!ek,onOpenChange:e=>!e&&ew(null),children:(0,t.jsxs)(u.DialogContent,{children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsx)(u.DialogTitle,{children:g("settings.prompts.deleteConfirmTitle")}),(0,t.jsx)(u.DialogDescription,{children:g("settings.prompts.deleteConfirmMessage")})]}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>ew(null),children:g("settings.prompts.cancel")}),(0,t.jsx)(r.Button,{variant:"destructive",onClick:tp,children:g("settings.prompts.delete")})]})]})})]}):(0,t.jsx)("div",{className:"h-32 rounded-lg bg-muted animate-pulse"});case"config":let s,a,n;return(0,t.jsxs)("div",{className:"space-y-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.git.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.git.desc")})]}),(0,t.jsxs)(r.Button,{onClick:()=>{eG({...eU}),eq(!0)},children:[(0,t.jsx)(w.Plus,{className:"mr-2 h-4 w-4"}),g("settings.config.git.addRule")]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[0!==eV.length||eW?(0,t.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:eV.map(e=>eK===e.id?(0,t.jsxs)("li",{className:"px-5 py-4 bg-muted/20",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",children:g("settings.config.git.host")}),(0,t.jsx)(l.Input,{value:e$.host,onChange:e=>eO(t=>({...t,host:e.target.value})),placeholder:g("settings.config.git.hostPlaceholder"),className:"text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",children:g("settings.config.git.ownerMatch")}),(0,t.jsx)(l.Input,{value:e$.ownerMatch,onChange:e=>eO(t=>({...t,ownerMatch:e.target.value})),placeholder:g("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-1.5 col-span-2",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",children:g("settings.config.git.localPathTemplate")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{value:e$.localPathTemplate,onChange:e=>eO(t=>({...t,localPathTemplate:e.target.value})),placeholder:g("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsx)(W.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:eZ?"default":"outline",size:"sm",type:"button",onClick:()=>eJ(e=>!e),className:"shrink-0 font-mono",children:"{path}"})}),(0,t.jsx)(W.TooltipContent,{side:"top",className:"max-w-xs",children:(0,t.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,t.jsx)("div",{className:"font-medium",children:g("settings.config.git.pathTooltipTitle")}),(0,t.jsx)("div",{className:"opacity-80",children:g("settings.config.git.pathTooltipDetail")})]})})]}),(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsx)(W.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>e3("edit"),children:(0,t.jsx)(P.FolderOpen,{className:"h-4 w-4"})})}),(0,t.jsx)(W.TooltipContent,{children:g("settings.config.git.pickFolder")})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:eZ?g("onboarding.step3.pathHintFull"):g("onboarding.step3.pathHintRepo")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",children:g("settings.config.git.priority")}),(0,t.jsx)(l.Input,{type:"number",value:e$.priority,onChange:e=>eO(t=>({...t,priority:Number(e.target.value)})),className:"text-sm w-24"})]})]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 mt-3",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:()=>{eA(null),eJ(!1)},children:g("settings.config.git.cancel")}),(0,t.jsx)(r.Button,{size:"sm",onClick:()=>tS(e.id),children:g("settings.config.git.save")})]})]},e.id):(0,t.jsx)("li",{className:"group px-5 py-4 hover:bg-muted/20 transition-colors",children:(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium text-sm",children:e.host}),"*"!==e.ownerMatch&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["/ ",e.ownerMatch]}),(0,t.jsxs)(d.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:[g("settings.config.git.priority")," ",e.priority]})]}),(0,t.jsx)("p",{className:"mt-0.5 font-mono text-xs text-muted-foreground truncate",children:e.localPathTemplate})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{let t,s,a;return t=e.localPathTemplate,a=(s=/\/\{path\}\/?$/.test(t))?t.replace(/\/?\{path\}\/?$/,"").replace(/\/+$/,""):t,void(eA(e.id),eO({host:e.host,ownerMatch:e.ownerMatch,localPathTemplate:a,priority:e.priority}),eJ(s))},title:g("settings.config.git.edit"),children:(0,t.jsx)(T,{className:"h-4 w-4"})}),(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>e2(e.id),className:"text-destructive",title:g("settings.config.git.delete"),children:(0,t.jsx)(S.Trash2,{className:"h-4 w-4"})})]})]})},e.id))}):(0,t.jsx)("div",{className:"rounded-xl border border-dashed border-border p-8 text-center",children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:g("settings.config.git.noRules")})}),eW&&(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/20 p-5 space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:g("settings.config.git.host")}),(0,t.jsx)(l.Input,{value:e_.host,onChange:e=>eG(t=>({...t,host:e.target.value})),placeholder:g("settings.config.git.hostPlaceholder"),className:"text-sm",autoFocus:!0})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:g("settings.config.git.ownerMatch")}),(0,t.jsx)(l.Input,{value:e_.ownerMatch,onChange:e=>eG(t=>({...t,ownerMatch:e.target.value})),placeholder:g("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs font-medium",children:g("settings.config.git.localPathTemplate")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{value:e_.localPathTemplate,onChange:e=>eG(t=>({...t,localPathTemplate:e.target.value})),placeholder:g("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsx)(W.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:eX?"default":"outline",size:"sm",type:"button",onClick:()=>eY(e=>!e),className:"shrink-0 font-mono",children:"{path}"})}),(0,t.jsx)(W.TooltipContent,{side:"top",className:"max-w-xs",children:(0,t.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,t.jsx)("div",{className:"font-medium",children:g("settings.config.git.pathTooltipTitle")}),(0,t.jsx)("div",{className:"opacity-80",children:g("settings.config.git.pathTooltipDetail")})]})})]}),(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsx)(W.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>e3("add"),children:(0,t.jsx)(P.FolderOpen,{className:"h-4 w-4"})})}),(0,t.jsx)(W.TooltipContent,{children:g("settings.config.git.pickFolder")})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:eX?g("onboarding.step3.pathHintFull"):g("onboarding.step3.pathHintRepo")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs font-medium",children:g("settings.config.git.priority")}),(0,t.jsx)(l.Input,{type:"number",value:e_.priority,onChange:e=>eG(t=>({...t,priority:Number(e.target.value)})),className:"text-sm w-24"})]}),e_.localPathTemplate&&(s=e_.localPathTemplate.trim().replace(/\/+$/,""),a=eX?`${s}/{path}`:s,n=[{label:"GitHub SSH",url:"git@github.com:user/my-app.git"},{label:"GitHub HTTPS",url:"https://github.com/user/my-app.git"},{label:"GitLab Subgroup",url:"https://gitlab.com/org/team/sub/my-api.git"}],(0,t.jsxs)("div",{className:"rounded-lg bg-muted/40 border border-border px-4 py-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:g("onboarding.step3.previewLabel")}),(0,t.jsx)("div",{className:"flex gap-1",children:n.map((e,s)=>(0,t.jsx)("button",{type:"button",onClick:()=>e0(s),className:(0,x.cn)("rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors cursor-pointer",eQ===s?"bg-foreground text-background":"bg-muted text-muted-foreground hover:text-foreground"),children:e.label},s))})]}),(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground truncate",children:n[eQ].url}),(0,t.jsxs)("p",{className:"font-mono text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"→ "}),(0,t.jsx)("span",{className:"text-foreground font-medium",children:function(e,t){if(!e||!t)return"";let s=t.trim(),a=[],n=s.match(/^git@[^:]+:(.+)$/);if(n)a=n[1].replace(/\.git\/?$/,"").split("/").filter(Boolean);else try{let e=new URL(s);a=decodeURIComponent(e.pathname).replace(/\.git\/?$/,"").split("/").filter(Boolean)}catch{return""}if(!a.length)return"";let i=a[0],r=a[a.length-1],l=a.join("/");if(e.includes("{path}"))return e.replace("{path}",l).replace("{owner}",i).replace("{repo}",r).replace(/\/+$/,"");let o=e.replace("{owner}",i).replace("{repo}","").replace(/\/+$/,"");return`${o}/${r}`}(a,n[eQ].url)})]})]})]})),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:()=>eq(!1),children:g("settings.config.git.cancel")}),(0,t.jsxs)(r.Button,{size:"sm",onClick:tC,disabled:!e_.host.trim()||!e_.localPathTemplate.trim(),children:[(0,t.jsx)(M,{className:"h-3.5 w-3.5 mr-1.5"}),g("settings.config.git.save")]})]})]})]})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.system.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.system.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.system.maxUpload")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.system.maxUploadHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:1,max:500,value:e4.maxUploadMb,onChange:e=>e8(t=>({...t,maxUploadMb:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.system.maxConcurrent")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.system.maxConcurrentHint")})]}),(0,t.jsx)(l.Input,{type:"number",min:1,max:10,value:e4.maxConcurrent,onChange:e=>e8(t=>({...t,maxConcurrent:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.system.maxReadable")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.system.maxReadableHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:1,max:50,value:e4.maxReadableMb,onChange:e=>e8(t=>({...t,maxReadableMb:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.system.archiveDelay")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.system.archiveDelayHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:1,max:365,value:e4.archiveDelayDays,onChange:e=>e8(t=>({...t,archiveDelayDays:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:g("settings.config.system.archiveDelayUnit")})]})]})]}),(0,t.jsx)(r.Button,{onClick:tb,className:"rounded-lg",children:g("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.task.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.task.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.system.taskDefaultWorktree")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.system.taskDefaultWorktreeHint")})]}),(0,t.jsx)("button",{type:"button",onClick:()=>e8(e=>({...e,taskDefaultUseWorktree:!e.taskDefaultUseWorktree})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${e4.taskDefaultUseWorktree?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e4.taskDefaultUseWorktree?g("task.worktreeYes"):g("task.worktreeNo")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.system.taskDefaultAutoStart")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.system.taskDefaultAutoStartHint")})]}),(0,t.jsx)("button",{type:"button",onClick:()=>e8(e=>({...e,taskDefaultAutoStart:!e.taskDefaultAutoStart})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${e4.taskDefaultAutoStart?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e4.taskDefaultAutoStart?g("task.autoStartYes"):g("task.autoStartNo")})]})]}),(0,t.jsx)(r.Button,{onClick:tj,className:"rounded-lg",children:g("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.gitParams.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.gitParams.desc")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.gitParams.timeout")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.gitParams.timeoutHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:5,max:300,value:e7.timeoutSec,onChange:e=>e6(t=>({...t,timeoutSec:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]}),(0,t.jsx)(r.Button,{onClick:tv,className:"rounded-lg",children:g("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.search.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.search.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.search.resultLimit")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.search.resultLimitHint")})]}),(0,t.jsx)(l.Input,{type:"number",min:5,max:100,value:e9.resultLimit,onChange:e=>te(t=>({...t,resultLimit:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.search.allModeCap")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.search.allModeCapHint")})]}),(0,t.jsx)(l.Input,{type:"number",min:1,max:20,value:e9.allModeCap,onChange:e=>te(t=>({...t,allModeCap:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.search.debounceMs")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.search.debounceMsHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:50,max:1e3,value:e9.debounceMs,onChange:e=>te(t=>({...t,debounceMs:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"ms"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.search.snippetLength")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.search.snippetLengthHint")})]}),(0,t.jsx)(l.Input,{type:"number",min:20,max:500,value:e9.snippetLength,onChange:e=>te(t=>({...t,snippetLength:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.search.codeTimeout")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.search.codeTimeoutHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:5,max:300,step:5,value:e9.codeTimeoutSec,onChange:e=>te(t=>({...t,codeTimeoutSec:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]})]}),(0,t.jsx)(r.Button,{onClick:tN,className:"rounded-lg",children:g("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.missions.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.missions.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:g("settings.config.missions.minCols")}),(0,t.jsx)(l.Input,{type:"number",min:1,max:10,value:tt.minCols,onChange:e=>ts(t=>({...t,minCols:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:g("settings.config.missions.maxCols")}),(0,t.jsx)(l.Input,{type:"number",min:1,max:10,value:tt.maxCols,onChange:e=>ts(t=>({...t,maxCols:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:g("settings.config.missions.minRows")}),(0,t.jsx)(l.Input,{type:"number",min:1,max:10,value:tt.minRows,onChange:e=>ts(t=>({...t,minRows:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:g("settings.config.missions.maxRows")}),(0,t.jsx)(l.Input,{type:"number",min:1,max:10,value:tt.maxRows,onChange:e=>ts(t=>({...t,maxRows:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]})]}),(0,t.jsx)(r.Button,{onClick:ty,className:"rounded-lg",children:g("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.hooks.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.hooks.desc")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.hooks.autoUploadTypes")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.hooks.autoUploadTypesHint")})]}),(0,t.jsx)(l.Input,{value:tl,onChange:e=>to(e.target.value),placeholder:"png, jpg, jpeg, gif, webp, svg, pdf",className:"w-80 rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsx)(r.Button,{onClick:tk,className:"rounded-lg",children:g("common.save")}),(0,t.jsxs)("div",{className:"flex items-center gap-4 pt-4 border-t border-border/50",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:ta?.installed?g("settings.config.hooks.installed"):g("settings.config.hooks.notInstalled")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.hooks.installHint")})]}),(0,t.jsx)(r.Button,{variant:ta?.installed?"destructive":"default",onClick:tw,disabled:ti||!ta,className:"rounded-lg",children:ta?.installed?g("settings.config.hooks.uninstall"):g("settings.config.hooks.install")})]})]}),(0,t.jsx)(u.Dialog,{open:!!e1,onOpenChange:e=>!e&&e2(null),children:(0,t.jsxs)(u.DialogContent,{children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsx)(u.DialogTitle,{children:g("settings.config.git.deleteConfirm")}),(0,t.jsx)(u.DialogDescription,{children:g("settings.config.git.deleteConfirmMessage")})]}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>e2(null),children:g("settings.config.git.cancel")}),(0,t.jsx)(r.Button,{variant:"destructive",onClick:()=>e1&&tT(e1),children:g("settings.config.git.delete")})]})]})})]});case"notifications":return(0,t.jsx)("div",{className:"divide-y divide-border/50",children:(0,t.jsxs)("div",{className:"flex items-center justify-between py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:g("settings.notifications.enable")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:g("settings.notifications.enableDesc")})]}),(0,t.jsx)(m.Switch,{checked:tc,onCheckedChange:tM})]})});case"backup":return(0,t.jsx)(ec,{});case"extensions":return(0,t.jsx)(eN,{});case"keyboard-shortcuts":return(0,t.jsx)(eD,{})}}()]})}),(0,t.jsx)(q.FolderBrowserDialog,{open:null!==e5,onOpenChange:e=>{e||e3(null)},onSelect:e=>{let t=eI(e);"add"===e5?eG(e=>({...e,localPathTemplate:t})):"edit"===e5&&eO(e=>({...e,localPathTemplate:t})),e3(null)}})]})}e.s(["default",0,function(){return(0,t.jsx)(eE,{})}],113399)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,113399,e=>{"use strict";var t=e.i(289721),s=e.i(965652),a=e.i(538059),n=e.i(821957),i=e.i(533499),r=e.i(519455),l=e.i(793479),o=e.i(624687),c=e.i(110204),d=e.i(487486),m=e.i(699375),u=e.i(776639),x=e.i(975157),g=e.i(386343),h=e.i(572989);let p=(0,h.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);var f=e.i(645378);let b=(0,h.default)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);var j=e.i(125177),v=e.i(256753),N=e.i(245697),y=e.i(360325),k=e.i(657153),w=e.i(232545);let C=(0,h.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);var S=e.i(998626);let T=(0,h.default)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]),M=(0,h.default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var D=e.i(400355),B=e.i(882651),R=e.i(181209),P=e.i(453889),L=e.i(487922),F=e.i(534411),U=e.i(523746),I=e.i(514798);let E=(0,I.createServerReference)("00924fc2cc9852b422b0d6b3298e7aafbabf65a12a",I.callServer,void 0,I.findSourceMapURL,"getAvailableTerminalApps"),H=(0,I.createServerReference)("00e71dd9fe5ddd282886d9e6cd7c7a3335ba5c4f9d",I.callServer,void 0,I.findSourceMapURL,"getAvailableEditors");var V=e.i(900203);let z=(0,I.createServerReference)("4077642ce6331073550528f4abb250ee697b4c8f2c",I.callServer,void 0,I.findSourceMapURL,"createPrompt"),K=(0,I.createServerReference)("60591fa994d0f303141eeb4a57ec0dbc2249372e6b",I.callServer,void 0,I.findSourceMapURL,"updatePrompt"),A=(0,I.createServerReference)("40dc126146260b5e645a6784ab39ef3db156e1e888",I.callServer,void 0,I.findSourceMapURL,"deletePrompt"),$=(0,I.createServerReference)("605f44bd2cf8fb5f8dd3eb42a4c01d541dd219be04",I.callServer,void 0,I.findSourceMapURL,"setDefaultPrompt"),O=(0,I.createServerReference)("0079d68bf448fca0a0c24ae7a20da68dd94339e6f8",I.callServer,void 0,I.findSourceMapURL,"getAvailableProviders");var W=e.i(746798),q=e.i(224277);let _=(0,h.default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);var G=e.i(631675);let X=(0,h.default)("folder-up",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);var Y=e.i(922541),Z=e.i(759686),J=e.i(487278),Q=e.i(360112);let ee=(0,I.createServerReference)("40924e89be22ab5bbea2ef5e95791a26f98fca701e",I.callServer,void 0,I.findSourceMapURL,"createBackup"),et=(0,I.createServerReference)("00762fa1400f7df227ed1a4c77d1c42738f0242d0f",I.callServer,void 0,I.findSourceMapURL,"listBackupFiles"),es=(0,I.createServerReference)("40519d59c0b448c93ab281761171f6e61d9fc6777d",I.callServer,void 0,I.findSourceMapURL,"deleteBackupFile"),ea=(0,I.createServerReference)("404279a57fc4e8a22669863bae9c762343a6ff90f2",I.callServer,void 0,I.findSourceMapURL,"restoreBackup"),en=(0,I.createServerReference)("408f9e924fc040a52d98755303cac5ece5310c3f4c",I.callServer,void 0,I.findSourceMapURL,"resetSystem"),ei=(0,I.createServerReference)("004b45d9efeda5d281117b0f7045fb7a409766f78e",I.callServer,void 0,I.findSourceMapURL,"getBackupDir"),er=(0,I.createServerReference)("40b69b078544b4e4e50ca9ca7df3777ca9909258d5",I.callServer,void 0,I.findSourceMapURL,"setBackupDir"),el=(0,I.createServerReference)("00b2fbee793868a0cf10f6e27ecc0f16e89d2bc0bc",I.callServer,void 0,I.findSourceMapURL,"getStorageLocation"),eo=(0,I.createServerReference)("40a9b7978e3095e173d421f1b35762782b4a91b032",I.callServer,void 0,I.findSourceMapURL,"setStorageLocation");function ec(){let{t:e,locale:n}=(0,i.useI18n)(),o=(0,a.useRouter)(),[c,d]=(0,s.useState)([]),[m,x]=(0,s.useState)(""),[g,h]=(0,s.useState)(!1),[p,f]=(0,s.useState)(null),[b,j]=(0,s.useState)(!1),[v,N]=(0,s.useState)(!0),[y,k]=(0,s.useState)(null),[w,C]=(0,s.useState)(!1),[T,M]=(0,s.useState)(""),B=(0,s.useRef)(null),[R,P]=(0,s.useState)(!1),[L,F]=(0,s.useState)(""),U=(0,s.useCallback)(async()=>{N(!0);try{let[e,t,s]=await Promise.all([et(),ei(),el()]);d(e),x(t),f(s)}finally{N(!1)}},[]);(0,s.useEffect)(()=>{U()},[U]);let I=async()=>{let t=T.trim()||void 0;C(!1),M(""),k("create");try{await ee(t),Q.toast.success(e("settings.backup.createSuccess")),await U()}catch{Q.toast.error(e("settings.backup.createError"))}finally{k(null)}},E=async t=>{if(confirm(e("settings.backup.restoreConfirm"))){k("restore");try{await ea(t),Q.toast.success(e("settings.backup.restoreSuccess"),{action:{label:e("settings.backup.reload"),onClick:()=>window.location.reload()},duration:15e3}),await U()}catch{Q.toast.error(e("settings.backup.restoreError"))}finally{k(null)}}},H=async t=>{if(confirm(e("settings.backup.deleteConfirm")))try{await es(t),Q.toast.success(e("settings.backup.deleteSuccess")),d(e=>e.filter(e=>e.filename!==t))}catch{Q.toast.error(e("settings.backup.deleteError"))}},V=async t=>{h(!1);try{await er(t),x(t),Q.toast.success(e("settings.backup.dirSaved")),await U()}catch{Q.toast.error(e("settings.backup.dirError"))}},z=async t=>{k("storage");try{let s=await eo({newPath:t});if(!s.ok)return void Q.toast.error(s.error||e("settings.storage.moveError"));Q.toast.success(e("settings.storage.moveSuccess",{count:String(s.moved??0)})),await U()}catch(t){Q.toast.error(t instanceof Error?t.message:e("settings.storage.moveError"))}finally{k(null)}},K=async t=>{j(!1),confirm(e("settings.storage.moveConfirm"))&&await z(t)},A=async()=>{!p||p.isDefault||confirm(e("settings.storage.resetConfirm"))&&await z(p.default)},$=async t=>{let s=t.target.files?.[0];if(s){t.target.value="",k("import");try{let t=new FormData;t.append("file",s);let a=await fetch("/api/internal/backup/import",{method:"POST",body:t});if(!a.ok){let t=await a.json();Q.toast.error("Invalid backup archive"===t.error?e("settings.backup.importInvalid"):(t.error,e("settings.backup.importError")));return}Q.toast.success(e("settings.backup.importSuccess")),await U()}catch{Q.toast.error(e("settings.backup.importError"))}finally{k(null)}}},O=async()=>{if("RESET"===L){P(!1),F(""),k("reset");try{await en("RESET"),Q.toast.success(e("settings.backup.resetSuccess")),o.push("/")}catch{Q.toast.error(e("settings.backup.resetError"))}finally{k(null)}}},ec=null!==y;return(0,t.jsxs)("div",{className:"space-y-6",children:[("restore"===y||"reset"===y)&&(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,t.jsx)(D.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"restore"===y?e("settings.backup.restoring"):e("settings.backup.resetting")})]})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-base font-semibold",children:e("settings.storage.sectionTitle")}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("settings.storage.hint")}),(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{children:[e("settings.storage.current"),":"]}),(0,t.jsx)("code",{className:"rounded bg-muted px-2 py-0.5 text-xs",children:p?.current??"…"}),p?.isDefault&&(0,t.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:e("settings.storage.defaultBadge")}),(0,t.jsx)(r.Button,{variant:"ghost",onClick:()=>j(!0),disabled:"storage"===y,className:"text-xs text-muted-foreground",children:"storage"===y?(0,t.jsx)(D.Loader2,{className:"h-3 w-3 animate-spin"}):e("settings.storage.change")}),p&&!p.isDefault&&(0,t.jsx)(r.Button,{variant:"ghost",onClick:A,disabled:"storage"===y,className:"text-xs text-muted-foreground",children:e("settings.storage.reset")})]}),(0,t.jsx)(q.FolderBrowserDialog,{open:b,onOpenChange:j,onSelect:K})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-base font-semibold",children:e("settings.backup.sectionTitle")}),(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{children:[e("settings.backup.dir"),":"]}),(0,t.jsx)("code",{className:"rounded bg-muted px-2 py-0.5 text-xs",children:m}),(0,t.jsx)(r.Button,{variant:"ghost",onClick:()=>h(!0),className:"text-xs text-muted-foreground",children:e("settings.backup.dirChange")})]}),(0,t.jsx)(q.FolderBrowserDialog,{open:g,onOpenChange:h,onSelect:V})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Button,{onClick:()=>{M(""),C(!0)},disabled:ec,className:"gap-2",children:"create"===y?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.Loader2,{className:"h-4 w-4 animate-spin"})," ",e("settings.backup.creating")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(_,{className:"h-4 w-4"})," ",e("settings.backup.create")]})}),(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsxs)(W.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"outline",disabled:ec,onClick:()=>B.current?.click(),className:"gap-2"}),children:[(0,t.jsx)(X,{className:"h-4 w-4"}),e("settings.backup.import")]}),(0,t.jsx)(W.TooltipContent,{side:"bottom",sideOffset:4,children:e("settings.backup.importHint")})]}),(0,t.jsx)("input",{ref:B,type:"file",accept:".tar.gz,.gz",className:"hidden",onChange:$})]}),(0,t.jsx)(u.Dialog,{open:w,onOpenChange:C,children:(0,t.jsxs)(u.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(u.DialogHeader,{children:(0,t.jsx)(u.DialogTitle,{children:e("settings.backup.create")})}),(0,t.jsxs)("div",{className:"py-2",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:e("settings.backup.createLabel")}),(0,t.jsx)(l.Input,{value:T,onChange:e=>M(e.target.value),onKeyDown:e=>"Enter"===e.key&&I(),placeholder:e("settings.backup.createLabelPlaceholder"),className:"mt-1.5",autoFocus:!0})]}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>C(!1),children:e("common.cancel")}),(0,t.jsx)(r.Button,{onClick:I,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:e("settings.backup.create")})]})]})}),v?(0,t.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,t.jsx)(D.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):0===c.length?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 py-12 text-center",children:[(0,t.jsx)(J.Archive,{className:"h-10 w-10 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("settings.backup.empty")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:e("settings.backup.emptyDesc")})]}):(0,t.jsx)("div",{className:"space-y-3",children:c.map(s=>{var a,i;return(0,t.jsx)("div",{className:"group rounded-lg border border-border bg-card p-4 transition-colors hover:bg-accent/30",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[s.label?(0,t.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:s.label}):(0,t.jsx)("span",{className:"truncate text-sm font-medium font-mono text-foreground",children:s.filename}),s.autoBackup&&(0,t.jsx)("span",{className:"shrink-0 rounded-full bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-500 ring-1 ring-amber-500/20",children:e("settings.backup.autoLabel")})]}),s.label&&(0,t.jsx)("div",{className:"mt-0.5 text-[11px] font-mono text-muted-foreground/60",children:s.filename}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-muted-foreground",children:[(a=s.size)<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1048576).toFixed(1)} MB`," · ",(i=s.createdAt,new Date(i).toLocaleString("zh"===n?"zh-CN":"en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}))]}),s.preview.length>0&&(0,t.jsxs)("div",{className:"mt-1.5 text-xs text-muted-foreground",children:[s.preview.map((e,s)=>(0,t.jsxs)("span",{children:[s>0&&" ",e.workspace,"(",e.projects.join(", "),")"]},s)),s.stats.workspaces>s.preview.length&&(0,t.jsxs)("span",{children:[" ",e("settings.backup.workspaces",{count:String(s.stats.workspaces)})]})]}),(0,t.jsxs)("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[e("settings.backup.projects",{count:String(s.stats.projects)})," · ",e("settings.backup.tasks",{count:String(s.stats.tasks)})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsx)(W.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-xs",onClick:()=>E(s.filename),disabled:ec,className:"text-muted-foreground hover:text-foreground"}),children:(0,t.jsx)(G.Upload,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(W.TooltipContent,{side:"bottom",sideOffset:4,children:e("settings.backup.restore")})]}),(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsx)(W.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-xs",onClick:()=>H(s.filename),disabled:ec,className:"text-muted-foreground hover:text-rose-400"}),children:(0,t.jsx)(S.Trash2,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(W.TooltipContent,{side:"bottom",sideOffset:4,children:e("settings.backup.delete")})]})]})]})},s.filename)})}),(0,t.jsxs)("div",{className:"border-t border-border pt-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold text-rose-400",children:[(0,t.jsx)(Z.AlertTriangle,{className:"h-4 w-4"}),e("settings.backup.dangerZone")]}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground leading-relaxed",children:e("settings.backup.resetDesc")}),(0,t.jsxs)(r.Button,{variant:"outline",onClick:()=>{F(""),P(!0)},disabled:ec,className:"mt-3 border-rose-500/30 text-rose-400 hover:bg-rose-500/10 hover:text-rose-400",children:[(0,t.jsx)(Y.RotateCcw,{className:"mr-2 h-3.5 w-3.5"}),e("settings.backup.reset")]})]}),(0,t.jsx)(u.Dialog,{open:R,onOpenChange:P,children:(0,t.jsxs)(u.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsx)(u.DialogTitle,{children:e("settings.backup.resetConfirmTitle")}),(0,t.jsx)(u.DialogDescription,{children:e("settings.backup.resetConfirmDesc")})]}),(0,t.jsxs)("div",{className:"py-2",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:e("settings.backup.resetConfirmInput")}),(0,t.jsx)(l.Input,{value:L,onChange:e=>F(e.target.value),placeholder:"RESET",className:"mt-1.5 font-mono"})]}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>P(!1),children:e("common.cancel")}),(0,t.jsx)(r.Button,{disabled:"RESET"!==L,onClick:O,className:"border-rose-500/30 bg-rose-500/10 text-rose-400 hover:bg-rose-500/20",children:e("settings.backup.reset")})]})]})})]})}var ed=e.i(887911),em=e.i(597746);let eu=(0,h.default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var ex=e.i(875840),eg=e.i(475958),eh=e.i(194358),ep=e.i(337822),ef=e.i(991838);let eb=[{os:"macOS",cmd:"brew install ripgrep"},{os:"Windows",cmd:"winget install BurntSushi.ripgrep"},{os:"Linux",cmd:"sudo apt install ripgrep"}];function ej({cmd:e}){let{t:a}=(0,i.useI18n)(),[n,l]=(0,s.useState)(!1),o=async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(e);else{let t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}l(!0),Q.toast.success(a("common.copied")),setTimeout(()=>l(!1),1500)}catch{Q.toast.error(a("common.copyFailed"))}};return(0,t.jsxs)("div",{className:"flex items-start gap-1 rounded-md bg-background/60 pl-2 pr-1 py-1 ring-1 ring-border/60",children:[(0,t.jsx)("code",{className:"min-w-0 flex-1 break-all font-mono text-[11px] leading-relaxed",children:e}),(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-xs",className:"shrink-0 text-muted-foreground","aria-label":a("common.copy"),onClick:o,children:n?(0,t.jsx)(em.Check,{className:"h-3 w-3 text-emerald-400"}):(0,t.jsx)(ex.Copy,{className:"h-3 w-3"})})]})}function ev({extension:e}){let{t:a}=(0,i.useI18n)(),{status:n,loading:l,isInstalling:o,install:c,uninstall:d,refresh:m}=(0,ef.useExtension)(e.id),[u,x]=(0,s.useState)(!1),g=e.icon,h=n.installed,p=async()=>{let t=await c();t.success?Q.toast.success(a("settings.extensions.installSuccess").replace("{name}",e.name)):Q.toast.error(a("settings.extensions.installFailed").replace("{name}",e.name)+(t.error?`: ${t.error.slice(0,200)}`:""))},f=async()=>{let t=await d();t.success?Q.toast.success(a("settings.extensions.uninstallSuccess").replace("{name}",e.name)):Q.toast.error(a("settings.extensions.uninstallFailed").replace("{name}",e.name)+(t.error?`: ${t.error.slice(0,200)}`:""))},b=async()=>{x(!0);try{await m()}finally{x(!1)}},j=()=>{window.open(e.homepageUrl,"_blank","noopener,noreferrer")};return(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-background ring-1 ring-border",children:(0,t.jsx)(g,{className:"h-5 w-5 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:e.name}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.description})]})]}),(0,t.jsxs)("span",{className:"shrink-0 rounded-md bg-background px-2 py-0.5 text-xs text-muted-foreground ring-1 ring-border",children:["~",e.sizeMB," MB"]})]}),(0,t.jsx)("div",{className:"mt-4 flex items-center gap-2 text-xs",children:l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.Loader2,{className:"h-3.5 w-3.5 animate-spin text-muted-foreground"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:a("common.loading")})]}):h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.CheckCircle2,{className:"h-3.5 w-3.5 text-emerald-500"}),(0,t.jsxs)("span",{className:"text-foreground",children:[a("settings.extensions.installed"),n.version?` v${n.version}`:""]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eu,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:a("settings.extensions.notInstalledShort")})]})}),(0,t.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.Button,{variant:"default",onClick:p,disabled:o,children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.reinstalling")]}):a("settings.extensions.reinstall")}),(0,t.jsx)(r.Button,{variant:"outline",onClick:f,disabled:o,children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.uninstalling")]}):a("settings.extensions.uninstall")})]}):e.manualInstall?(0,t.jsxs)(ep.Popover,{children:[(0,t.jsx)(ep.PopoverTrigger,{render:e=>(0,t.jsxs)(r.Button,{variant:"default",...e,children:[(0,t.jsx)(_,{className:"h-3.5 w-3.5"}),a("settings.extensions.installViaHomepage")]})}),(0,t.jsxs)(ep.PopoverContent,{align:"start",className:"w-80 max-w-[90vw] gap-2 text-xs leading-relaxed",children:[(0,t.jsx)("p",{children:a("settings.extensions.manualInstallHintIntro")}),(0,t.jsx)("div",{className:"space-y-2",children:eb.map(({os:e,cmd:s})=>(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:e}),(0,t.jsx)(ej,{cmd:s})]},e))}),(0,t.jsx)("p",{className:"text-muted-foreground",children:a("settings.extensions.manualInstallHintAfter")}),(0,t.jsxs)("button",{type:"button",onClick:j,className:"flex items-center gap-1 self-start text-[11px] text-primary underline-offset-2 hover:underline",children:[(0,t.jsx)(eg.ExternalLink,{className:"h-3 w-3"}),a("settings.extensions.visitHomepage")]})]})]}):(0,t.jsx)(r.Button,{variant:"default",onClick:p,disabled:o,children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.installing")]}):a("settings.extensions.install")}),(0,t.jsxs)(r.Button,{variant:"ghost",onClick:b,disabled:u,children:[(0,t.jsx)(eh.RefreshCw,{className:`h-3.5 w-3.5 ${u?"animate-spin":""}`}),a("settings.extensions.recheck")]}),(0,t.jsxs)(r.Button,{variant:"ghost",onClick:j,children:[(0,t.jsx)(eg.ExternalLink,{className:"h-3.5 w-3.5"}),a("settings.extensions.visitHomepage")]})]})]})}function eN(){let{t:e}=(0,i.useI18n)(),s=(0,ed.listExtensionMetadata)();return(0,t.jsxs)("div",{className:"space-y-5",children:[(0,t.jsxs)("header",{children:[(0,t.jsx)("h2",{className:"text-base font-semibold",children:e("settings.extensions.title")}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("settings.extensions.desc")})]}),(0,t.jsx)("div",{className:"space-y-3",children:s.map(e=>(0,t.jsx)(ev,{extension:e},e.id))})]})}e.i(508271);var ey=e.i(371385),ek=e.i(158956),ew=e.i(75566),eC=e.i(851289);let eS=["global","panels","missions"],eT=new Set(["missions.cycleBack"]);function eM({keys:e}){return(0,t.jsx)(eC.KeyCombo,{keys:e})}function eD(){let e,{t:a}=(0,i.useI18n)(),n=(0,ew.useKeymapStore)(e=>e.overrides),l=(0,ew.useKeymapStore)(e=>e.setBinding),o=(0,ew.useKeymapStore)(e=>e.resetBinding),c=(0,ew.useKeymapStore)(e=>e.resetAll),[m,x]=(0,s.useState)(null),[g,h]=(0,s.useState)(null),p=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(m){let e=requestAnimationFrame(()=>p.current?.focus());return()=>cancelAnimationFrame(e)}},[m]);let f=(0,s.useMemo)(()=>{let e=new Map;for(let t of ey.SHORTCUT_ACTIONS)for(let s of n[t.id]??[...t.defaultKeys])e.has(s)||e.set(s,t.id);return e},[n]),b=(0,s.useMemo)(()=>eS.map(e=>({group:e,actions:ey.SHORTCUT_ACTIONS.filter(t=>t.group===e&&!eT.has(t.id))})).filter(e=>e.actions.length>0),[]),j=m?(0,ey.getAction)(m):null,v=g&&m&&(e=f.get(g))&&e!==m?e:null;function N(){x(null),h(null)}return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("header",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-base font-semibold",children:a("settings.keyboardShortcuts")}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("settings.keyboardShortcutsDesc")})]}),(0,t.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:function(){c(),Q.toast.success(a("settings.shortcuts.resetAllDone"))},children:[(0,t.jsx)(Y.RotateCcw,{className:"h-3.5 w-3.5"}),a("settings.shortcuts.resetAll")]})]}),(0,t.jsx)("div",{className:"space-y-6",children:b.map(({group:e,actions:s})=>(0,t.jsxs)("section",{children:[(0,t.jsx)("h3",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:a(`shortcuts.group.${e}`)}),(0,t.jsx)("ul",{className:"divide-y divide-border/50 rounded-xl border border-border bg-card",children:s.map(e=>{let s,i=e.id in n;return(0,t.jsxs)("li",{className:"flex items-center justify-between gap-4 px-5 py-3.5",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 text-sm",children:a(e.descriptionKey)}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,t.jsx)(eM,{keys:n[s=e.id]??[...(0,ey.getAction)(s).defaultKeys]}),e.configurable?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.Button,{variant:"outline",size:"sm",onClick:()=>{var t;return t=e.id,void(h(null),x(t))},children:a("settings.shortcuts.rebind")}),i&&(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsx)(W.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>o(e.id),children:(0,t.jsx)(Y.RotateCcw,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(W.TooltipContent,{children:a("settings.shortcuts.reset")})]})]}):(0,t.jsx)(d.Badge,{variant:"outline",className:"text-muted-foreground",children:a("settings.shortcuts.fixed")})]})]},e.id)})})]},e))}),(0,t.jsx)(u.Dialog,{open:null!==m,onOpenChange:e=>!e&&N(),children:(0,t.jsxs)(u.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsx)(u.DialogTitle,{children:j?a(j.descriptionKey):a("settings.shortcuts.rebind")}),(0,t.jsx)(u.DialogDescription,{children:a("settings.shortcuts.pressKey")})]}),(0,t.jsx)("textarea",{ref:p,readOnly:!0,tabIndex:0,"aria-label":a("settings.shortcuts.pressKey"),onKeyDown:e=>{e.preventDefault(),e.stopPropagation();let t=(0,ek.serializeKeyEvent)(e.nativeEvent);t&&h(t)},className:"flex h-20 w-full cursor-pointer resize-none items-center justify-center rounded-lg border border-dashed border-border bg-muted/30 text-center text-sm outline-none focus:border-ring focus:ring-1 focus:ring-ring"}),(0,t.jsx)("div",{className:"flex min-h-8 items-center justify-center",children:g?(0,t.jsx)(eM,{keys:[g]}):(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:a("settings.shortcuts.pressKey")})}),v&&(0,t.jsx)("p",{className:"text-center text-xs text-amber-600 dark:text-amber-400",children:a("settings.shortcuts.conflict",{name:a((0,ey.getAction)(v).descriptionKey)})}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:N,children:a("settings.shortcuts.cancel")}),(0,t.jsx)(r.Button,{variant:"default",onClick:function(){m&&g&&(l(m,[g]),N(),Q.toast.success(a("settings.shortcuts.saved")))},disabled:!g,children:a("settings.shortcuts.saveBtn")})]})]})})]})}function eB({options:e,value:s,onChange:a}){return(0,t.jsx)("div",{className:"inline-flex rounded-lg border border-border/50 bg-muted/30 p-1 gap-0.5",children:e.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>a(e.value),className:(0,x.cn)("rounded-md px-3.5 py-1.5 text-sm font-medium transition-all duration-200 cursor-pointer",s===e.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:e.label},e.value))})}function eR({label:e,description:s,children:a,className:n}){return(0,t.jsxs)("div",{className:(0,x.cn)("flex items-center justify-between py-4 border-b border-border/50 last:border-0",n),children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:e}),s&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:s})]}),(0,t.jsx)("div",{className:"shrink-0",children:a})]})}let eP=[{id:"general",labelKey:"settings.general",descKey:"settings.generalDesc",icon:g.Settings,accent:"blue"},{id:"ai-tools",labelKey:"settings.aiTools.title",descKey:"settings.aiTools.cliVerificationDesc",icon:p,accent:"emerald"},{id:"prompts",labelKey:"settings.prompts",descKey:"settings.promptsDesc",icon:f.FileText,accent:"violet"},{id:"config",labelKey:"settings.config",descKey:"settings.configDesc",icon:b,accent:"amber"},{id:"extensions",labelKey:"settings.extensions.title",descKey:"settings.extensions.navDesc",icon:N.Package,accent:"indigo"},{id:"notifications",labelKey:"settings.notifications.title",descKey:"settings.notifications.navDesc",icon:j.Bell,accent:"rose"},{id:"backup",labelKey:"settings.backup.title",descKey:"settings.backup.navDesc",icon:v.HardDrive,accent:"cyan"},{id:"keyboard-shortcuts",labelKey:"settings.keyboardShortcuts",descKey:"settings.keyboardShortcutsDesc",icon:y.Keyboard,accent:"violet"}],eL={blue:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},emerald:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},violet:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},amber:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},cyan:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},rose:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},indigo:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"}},eF="ai-manager:default-cli-adapter",eU={host:"",ownerMatch:"*",localPathTemplate:"",priority:0},eI=e=>e.replace(/\\/g,"/").replace(/\/+$/,"");function eE(){let e=(0,a.useRouter)(),{t:g}=(0,i.useI18n)(),{theme:h,setTheme:p}=(0,n.useTheme)(),{locale:f,setLocale:b}=(0,i.useI18n)(),[j,v]=(0,s.useState)("general"),N=(0,s.useRef)(null),[y,I]=(0,s.useState)({left:0,width:0}),[_,G]=(0,s.useState)(!1),[X,Y]=(0,s.useState)("Terminal"),[Z,J]=(0,s.useState)([]),[Q,ee]=(0,s.useState)(""),[et,es]=(0,s.useState)([]),[ea,en]=(0,s.useState)(13),[ei,er]=(0,s.useState)("Menlo, Monaco, 'Courier New', monospace"),[el,eo]=(0,s.useState)([]),[ed,em]=(0,s.useState)("claude"),[eu,ex]=(0,s.useState)(null),[eg,eh]=(0,s.useState)({}),[ep,ef]=(0,s.useState)([]),[eb,ej]=(0,s.useState)(!1),[ev,ey]=(0,s.useState)(null),[ek,ew]=(0,s.useState)(null),[eC,eS]=(0,s.useState)(""),[eT,eM]=(0,s.useState)(""),[eE,eH]=(0,s.useState)(""),[eV,ez]=(0,s.useState)([]),[eK,eA]=(0,s.useState)(null),[e$,eO]=(0,s.useState)({...eU}),[eW,eq]=(0,s.useState)(!1),[e_,eG]=(0,s.useState)({...eU}),[eX,eY]=(0,s.useState)(!1),[eZ,eJ]=(0,s.useState)(!1),[eQ,e0]=(0,s.useState)(0),[e1,e2]=(0,s.useState)(null),[e5,e3]=(0,s.useState)(null),[e4,e7]=(0,s.useState)({maxUploadMb:50,maxConcurrent:3,maxReadableMb:5,archiveDelayDays:7,taskDefaultUseWorktree:!0,taskDefaultAutoStart:!1}),[e8,e6]=(0,s.useState)({timeoutSec:30}),[e9,te]=(0,s.useState)({resultLimit:20,allModeCap:5,debounceMs:250,snippetLength:80,codeTimeoutSec:30}),[tt,ts]=(0,s.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5}),[ta,tn]=(0,s.useState)(null),[ti,tr]=(0,s.useState)(!1),[tl,to]=(0,s.useState)(""),[tc,td]=(0,s.useState)(!0);(0,s.useEffect)(()=>G(!0),[]),(0,s.useEffect)(()=>{(0,L.getConfigValue)("terminal.app","Terminal").then(Y),E().then(J),(0,L.getConfigValue)("editor.command","").then(ee),H().then(es),(0,L.getConfigValue)("terminal.fontSize",13).then(en),(0,L.getConfigValue)("terminal.fontFamily","Menlo, Monaco, 'Courier New', monospace").then(er)},[]),(0,s.useEffect)(()=>{if(0===Z.length||!X||Z.some(e=>e.value===X))return;let e=Z.find(e=>e.name===X);e&&(Y(e.value),(0,F.setConfigValue)("terminal.app",e.value))},[Z,X]),(0,s.useEffect)(()=>{if(0===et.length||!Q||et.some(e=>e.command===Q))return;let e=et.find(e=>e.name===Q);e&&(ee(e.command),(0,F.setConfigValue)("editor.command",e.command))},[et,Q]),(0,s.useEffect)(()=>{O().then(eo);let e=localStorage.getItem(eF);e&&em(e)},[]),(0,s.useEffect)(()=>{(0,V.getPrompts)().then(ef)},[]);let tm=async()=>{try{let e=await fetch("/api/internal/hooks/install");if(e.ok){let t=await e.json();tn(t)}}catch{}};async function tu(e){if(!eu){ex(e),eh(t=>{let s={...t};return delete s[e],s});try{let t=await fetch("/api/adapters/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e})}),s=await t.json();eh(t=>({...t,[e]:s}))}catch{eh(t=>({...t,[e]:{ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]}}))}finally{ex(null)}}}(0,s.useEffect)(()=>{(0,L.getConfigValue)("git.pathMappingRules",[]).then(e=>{let t=new Set,s=!1,a=e.map(e=>{if(!e.id||t.has(e.id)){s=!0;let a={...e,id:crypto.randomUUID()};return t.add(a.id),a}return t.add(e.id),e});ez(a),s&&(0,F.setConfigValue)("git.pathMappingRules",a)}),(0,L.getConfigValue)("hooks.autoUploadTypes",["png","jpg","jpeg","gif","webp","svg","pdf","md","txt","json"]).then(e=>{to(e.join(", "))}),tm(),(0,U.getConfigValues)(["system.maxUploadBytes","system.maxConcurrentExecutions","system.maxReadableFileBytes","board.archiveDelayDays","task.defaultUseWorktree","task.defaultAutoStart","git.timeoutSec","search.resultLimit","search.allModeCap","search.debounceMs","search.snippetLength","search.codeTimeoutSec","missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(e=>{let t=e["system.maxUploadBytes"]??0x3200000,s=e["system.maxReadableFileBytes"]??5242880;e7({maxUploadMb:Math.round(t/1024/1024),maxConcurrent:e["system.maxConcurrentExecutions"]??3,maxReadableMb:Math.round(s/1024/1024),archiveDelayDays:e["board.archiveDelayDays"]??7,taskDefaultUseWorktree:"boolean"!=typeof e["task.defaultUseWorktree"]||e["task.defaultUseWorktree"],taskDefaultAutoStart:"boolean"==typeof e["task.defaultAutoStart"]&&e["task.defaultAutoStart"]}),e6({timeoutSec:e["git.timeoutSec"]??30}),te({resultLimit:e["search.resultLimit"]??20,allModeCap:e["search.allModeCap"]??5,debounceMs:e["search.debounceMs"]??250,snippetLength:e["search.snippetLength"]??80,codeTimeoutSec:e["search.codeTimeoutSec"]??30}),ts({minCols:e["missions.grid.minCols"]??1,maxCols:e["missions.grid.maxCols"]??5,minRows:e["missions.grid.minRows"]??1,maxRows:e["missions.grid.maxRows"]??5})})},[]),(0,s.useEffect)(()=>{(0,L.getConfigValue)("notification.enabled",!0).then(td)},[]);let tx=(0,s.useCallback)(()=>{ey(null),eS(""),eM(""),eH(""),ej(!0)},[]),tg=(0,s.useCallback)(e=>{ey(e),eS(e.name),eM(e.description??""),eH(e.content),ej(!0)},[]),th=(0,s.useCallback)(async()=>{eC.trim()&&eE.trim()&&(ev?await K(ev.id,{name:eC.trim(),description:eT.trim()||void 0,content:eE.trim()}):await z({name:eC.trim(),description:eT.trim()||void 0,content:eE.trim()}),ej(!1),ef(await (0,V.getPrompts)()),e.refresh())},[eC,eT,eE,ev,e]),tp=(0,s.useCallback)(async()=>{ek&&(await A(ek),ew(null),ef(await (0,V.getPrompts)()),e.refresh())},[ek,e]),tf=(0,s.useCallback)(async t=>{await $(t),ef(await (0,V.getPrompts)()),e.refresh()},[e]),tb=async()=>{await (0,F.setConfigValue)("system.maxUploadBytes",1024*e4.maxUploadMb*1024),await (0,F.setConfigValue)("system.maxConcurrentExecutions",e4.maxConcurrent),await (0,F.setConfigValue)("system.maxReadableFileBytes",1024*e4.maxReadableMb*1024),await (0,F.setConfigValue)("board.archiveDelayDays",e4.archiveDelayDays)},tj=async()=>{await (0,F.setConfigValue)("task.defaultUseWorktree",e4.taskDefaultUseWorktree),await (0,F.setConfigValue)("task.defaultAutoStart",e4.taskDefaultAutoStart),await (0,F.setConfigValue)("task.mcpDefaultsConfigured",!0)},tv=async()=>{await (0,F.setConfigValue)("git.timeoutSec",e8.timeoutSec)},tN=async()=>{await (0,F.setConfigValue)("search.resultLimit",e9.resultLimit),await (0,F.setConfigValue)("search.allModeCap",e9.allModeCap),await (0,F.setConfigValue)("search.debounceMs",e9.debounceMs),await (0,F.setConfigValue)("search.snippetLength",e9.snippetLength),await (0,F.setConfigValue)("search.codeTimeoutSec",e9.codeTimeoutSec)},ty=async()=>{let e=Math.min(tt.minCols,tt.maxCols),t=Math.max(tt.minCols,tt.maxCols),s=Math.min(tt.minRows,tt.maxRows),a=Math.max(tt.minRows,tt.maxRows);ts({minCols:e,maxCols:t,minRows:s,maxRows:a}),await (0,F.setConfigValue)("missions.grid.minCols",e),await (0,F.setConfigValue)("missions.grid.maxCols",t),await (0,F.setConfigValue)("missions.grid.minRows",s),await (0,F.setConfigValue)("missions.grid.maxRows",a)},tk=async()=>{let e=tl.split(",").map(e=>e.trim()).filter(Boolean);await (0,F.setConfigValue)("hooks.autoUploadTypes",e)},tw=async()=>{if(ta){tr(!0);try{let e=ta.installed?"DELETE":"POST";await fetch("/api/internal/hooks/install",{method:e}),await tm()}finally{tr(!1)}}},tC=async()=>{if(!e_.host.trim()||!e_.localPathTemplate.trim())return;let e=eI(e_.localPathTemplate.trim()),t=eX?`${e}/{path}`:e,s=[...eV,{id:crypto.randomUUID(),host:e_.host.trim(),ownerMatch:e_.ownerMatch.trim()||"*",localPathTemplate:t,priority:e_.priority}];await (0,F.setConfigValue)("git.pathMappingRules",s),ez(s),eG({...eU}),eY(!1),eq(!1)},tS=async e=>{if(!e$.host.trim()||!e$.localPathTemplate.trim())return;let t=eI(e$.localPathTemplate.trim()),s=eZ?`${t}/{path}`:t,a=eV.map(t=>t.id===e?{...t,host:e$.host.trim(),ownerMatch:e$.ownerMatch.trim()||"*",localPathTemplate:s,priority:e$.priority}:t);await (0,F.setConfigValue)("git.pathMappingRules",a),ez(a),eA(null),eJ(!1)},tT=async e=>{let t=eV.filter(t=>t.id!==e);await (0,F.setConfigValue)("git.pathMappingRules",t),ez(t),e2(null)};async function tM(){let e=!tc;td(e),await (0,F.setConfigValue)("notification.enabled",e)}let tD=(0,s.useCallback)(()=>{e.back()},[e]);(0,s.useEffect)(()=>{let e=N.current;if(!e)return;let t=e.querySelector(`[data-section="${j}"]`);if(!t)return;let s=e.getBoundingClientRect(),a=t.getBoundingClientRect();I({left:a.left-s.left,width:a.width})},[j]);let tB=eP.find(e=>e.id===j),tR=tB?eL[tB.accent]:eL.blue;return(0,t.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,t.jsx)("div",{className:"flex-shrink-0 border-b bg-card/50 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"mx-auto max-w-5xl px-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between pb-3 pt-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:g("settings.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:g("settings.configDesc")})]}),(0,t.jsxs)(r.Button,{variant:"outline",onClick:tD,className:"gap-1.5 bg-card shadow-sm cursor-pointer",children:[(0,t.jsx)(k.X,{className:"h-3.5 w-3.5"}),"ESC"]})]}),(0,t.jsxs)("div",{ref:N,className:"relative flex gap-1 overflow-x-auto",children:[eP.map(e=>{let s=e.icon,a=j===e.id,n=eL[e.accent];return(0,t.jsxs)("button",{"data-section":e.id,onClick:()=>v(e.id),className:(0,x.cn)("relative flex items-center gap-2 rounded-t-lg px-4 py-2.5","text-sm font-medium whitespace-nowrap cursor-pointer","transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a?`${n.text} bg-background`:"text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:[(0,t.jsx)("span",{className:(0,x.cn)("flex h-6 w-6 items-center justify-center rounded-md","transition-colors duration-200",a?n.bg:"bg-transparent"),children:(0,t.jsx)(s,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("span",{children:g(e.labelKey)})]},e.id)}),(0,t.jsx)("div",{className:(0,x.cn)("absolute bottom-0 h-0.5 rounded-full","transition-all duration-250 ease-out",tR.indicator),style:{left:y.left,width:y.width}})]})]})}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsxs)("div",{className:"mx-auto max-w-4xl px-6 py-8",children:[tB&&(0,t.jsxs)("div",{className:"mb-6 flex items-start gap-4",children:[(0,t.jsx)("div",{className:(0,x.cn)("flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl","ring-1",tR.bg,tR.text,tR.ring),children:(0,t.jsx)(tB.icon,{className:"h-5 w-5"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:g(tB.labelKey)}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:g(tB.descKey)})]})]}),(0,t.jsx)("div",{className:"mb-6 border-t"}),function(){switch(j){case"general":let e;return e=[{value:"light",label:g("settings.themeLight")},{value:"dark",label:g("settings.themeDark")},{value:"system",label:g("settings.themeSystem")}],(0,t.jsxs)("div",{className:"divide-y divide-border/50",children:[(0,t.jsx)(eR,{label:g("settings.theme"),description:g("settings.themeDesc"),children:_?(0,t.jsx)(eB,{options:e,value:h??"system",onChange:e=>p(e)}):(0,t.jsx)("div",{className:"inline-flex h-9 rounded-lg border border-border/50 bg-muted/30 p-1 w-[200px]"})}),(0,t.jsx)(eR,{label:g("settings.language"),description:g("settings.languageDesc"),children:(0,t.jsx)(eB,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}],value:f,onChange:e=>b(e)})}),(0,t.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:g("settings.terminal.label")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:g("settings.terminal.desc")})]}),Z.length>0&&(0,t.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:Z.map(e=>{let s=X===e.value,a=(0,x.cn)("rounded-lg border px-3.5 py-1.5 text-xs font-medium transition-all duration-200",e.installed?s?"border-foreground bg-accent text-foreground font-medium cursor-pointer":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground cursor-pointer":"cursor-not-allowed border-dashed border-border/60 text-muted-foreground/40"),n=()=>{e.installed&&(Y(e.value),(0,F.setConfigValue)("terminal.app",e.value))};return e.installed?(0,t.jsx)("button",{type:"button",onClick:n,className:a,children:e.name},e.value):(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsx)(W.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:n,className:a,children:e.name})}),(0,t.jsx)(W.TooltipContent,{side:"top",children:g("settings.app.notInstalled")})]},e.value)})})]}),(0,t.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:g("settings.terminalFont.label")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:g("settings.terminalFont.desc")})]}),(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-4",children:[(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[g("settings.terminalFont.size"),(0,t.jsx)("input",{type:"number",min:8,max:40,value:ea,onChange:e=>{let t=Math.max(8,Math.min(40,Math.round(Number(e.target.value)||13)));en(t),(0,F.setConfigValue)("terminal.fontSize",t)},className:"h-8 w-20 rounded-md border border-border bg-background px-2 text-sm text-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"})]}),(0,t.jsxs)("label",{className:"flex min-w-0 flex-1 items-center gap-2 text-xs text-muted-foreground",children:[g("settings.terminalFont.family"),(0,t.jsx)("input",{type:"text",value:ei,placeholder:"Menlo, Monaco, 'Courier New', monospace",onChange:e=>er(e.target.value),onBlur:e=>{let t=e.target.value.trim()||"Menlo, Monaco, 'Courier New', monospace";er(t),(0,F.setConfigValue)("terminal.fontFamily",t)},className:"h-8 min-w-0 flex-1 rounded-md border border-border bg-background px-2 font-mono text-xs text-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"})]})]}),(0,t.jsx)("div",{className:"mt-1.5 text-[11px] text-muted-foreground/70",children:g("settings.terminalFont.hint")})]}),(0,t.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:g("settings.editor.label")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:g("settings.editor.desc")})]}),et.length>0&&(0,t.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:et.map(e=>{let s=Q===e.command,a=(0,x.cn)("rounded-lg border px-3.5 py-1.5 text-xs font-medium transition-all duration-200",e.installed?s?"border-foreground bg-accent text-foreground font-medium cursor-pointer":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground cursor-pointer":"cursor-not-allowed border-dashed border-border/60 text-muted-foreground/40"),n=()=>{e.installed&&(ee(e.command),(0,F.setConfigValue)("editor.command",e.command))};return e.installed?(0,t.jsx)("button",{type:"button",onClick:n,className:a,children:e.name},e.command):(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsx)(W.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:n,className:a,children:e.name})}),(0,t.jsx)(W.TooltipContent,{side:"top",children:g("settings.app.notInstalled")})]},e.command)})})]})]});case"ai-tools":return(0,t.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:el.map(e=>{let s=ed===e.name,a=eu===e.name,n=eg[e.name];return(0,t.jsx)("li",{children:(0,t.jsxs)("div",{className:"px-5 py-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:e.displayName}),(0,t.jsx)(d.Badge,{variant:"outline",children:g("label.builtin")}),s&&(0,t.jsxs)(d.Badge,{variant:"secondary",className:"shrink-0",children:[(0,t.jsx)(C,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),g("settings.prompts.default")]}),n&&(0,t.jsx)(d.Badge,{variant:n.ok?"secondary":"destructive",className:(0,x.cn)("shrink-0",n.ok&&"bg-green-600 text-white hover:bg-green-700"),children:n.ok?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.CheckCircle2,{className:"h-3 w-3 mr-1"}),g("settings.aiTools.testPassed")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R.XCircle,{className:"h-3 w-3 mr-1"}),g("settings.aiTools.testFailed")]})})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.cli.available&&e.cli.version?`${e.name} \xb7 ${e.cli.version}`:e.name})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[!s&&(0,t.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>{var t;em(t=e.name),localStorage.setItem(eF,t)},children:[(0,t.jsx)(C,{className:"h-3.5 w-3.5 mr-1.5 text-muted-foreground"}),g("settings.prompts.setDefault")]}),(0,t.jsx)(r.Button,{variant:"outline",size:"sm",onClick:()=>tu(e.name),disabled:a,children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.Loader2,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),g("settings.aiTools.testing")]}):g("settings.aiTools.testConnection")})]})]}),n&&(0,t.jsx)("div",{className:"mt-3 rounded-md border border-border bg-muted/30 px-4 py-3",children:(0,t.jsx)("div",{className:"space-y-1.5",children:n.checks.map(s=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:(0,x.cn)("w-1.5 h-1.5 rounded-full shrink-0",s.passed?"bg-green-500":"bg-red-500")}),(0,t.jsx)("span",{className:(0,x.cn)(s.passed?"text-foreground":"text-red-700 dark:text-red-300"),children:s.message})]},`${e.name}-${s.name}`))})})]})},e.name)})});case"prompts":return _?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(r.Button,{onClick:tx,variant:"default",children:[(0,t.jsx)(w.Plus,{className:"h-4 w-4 mr-2"}),g("settings.prompts.newPrompt")]})}),0===ep.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center rounded-lg border border-dashed border-border/50",children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:g("settings.prompts.empty")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:g("settings.prompts.emptyHint")})]}):(0,t.jsx)("div",{className:"rounded-xl border border-border/50 divide-y divide-border/50",children:ep.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h4",{className:"text-sm font-medium truncate",children:e.name}),e.isDefault&&(0,t.jsxs)(d.Badge,{variant:"secondary",className:"shrink-0 rounded-full text-xs",children:[(0,t.jsx)(C,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),g("settings.prompts.default")]})]}),e.description&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:e.description})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-4",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>tf(e.id),title:g("settings.prompts.setDefault"),children:(0,t.jsx)(C,{className:(0,x.cn)("h-4 w-4",e.isDefault?"fill-yellow-400 text-yellow-400":"text-muted-foreground")})}),(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>tg(e),title:g("settings.prompts.editPrompt"),children:(0,t.jsx)(T,{className:"h-4 w-4"})}),(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>ew(e.id),className:"text-destructive",title:g("settings.prompts.delete"),children:(0,t.jsx)(S.Trash2,{className:"h-4 w-4"})})]})]},e.id))}),(0,t.jsx)(u.Dialog,{open:eb,onOpenChange:ej,children:(0,t.jsxs)(u.DialogContent,{children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsx)(u.DialogTitle,{children:ev?g("settings.prompts.editPrompt"):g("settings.prompts.newPrompt")}),(0,t.jsx)(u.DialogDescription,{children:ev?g("settings.prompts.editPrompt"):g("settings.prompts.newPrompt")})]}),(0,t.jsxs)("div",{className:"space-y-4 py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-name",children:g("settings.prompts.promptName")}),(0,t.jsx)(l.Input,{id:"prompt-name",value:eC,onChange:e=>eS(e.target.value),placeholder:g("settings.prompts.promptNamePlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-description",children:g("settings.prompts.promptDescription")}),(0,t.jsx)(l.Input,{id:"prompt-description",value:eT,onChange:e=>eM(e.target.value),placeholder:g("settings.prompts.promptDescriptionPlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-content",children:g("settings.prompts.promptContent")}),(0,t.jsx)(o.Textarea,{id:"prompt-content",value:eE,onChange:e=>eH(e.target.value),placeholder:g("settings.prompts.promptContentPlaceholder"),rows:8,className:"mt-1.5 font-mono text-sm"})]})]}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>ej(!1),children:g("settings.prompts.cancel")}),(0,t.jsx)(r.Button,{onClick:th,disabled:!eC.trim()||!eE.trim(),children:g("settings.prompts.save")})]})]})}),(0,t.jsx)(u.Dialog,{open:!!ek,onOpenChange:e=>!e&&ew(null),children:(0,t.jsxs)(u.DialogContent,{children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsx)(u.DialogTitle,{children:g("settings.prompts.deleteConfirmTitle")}),(0,t.jsx)(u.DialogDescription,{children:g("settings.prompts.deleteConfirmMessage")})]}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>ew(null),children:g("settings.prompts.cancel")}),(0,t.jsx)(r.Button,{variant:"destructive",onClick:tp,children:g("settings.prompts.delete")})]})]})})]}):(0,t.jsx)("div",{className:"h-32 rounded-lg bg-muted animate-pulse"});case"config":let s,a,n;return(0,t.jsxs)("div",{className:"space-y-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.git.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.git.desc")})]}),(0,t.jsxs)(r.Button,{onClick:()=>{eG({...eU}),eq(!0)},children:[(0,t.jsx)(w.Plus,{className:"mr-2 h-4 w-4"}),g("settings.config.git.addRule")]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[0!==eV.length||eW?(0,t.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:eV.map(e=>eK===e.id?(0,t.jsxs)("li",{className:"px-5 py-4 bg-muted/20",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",children:g("settings.config.git.host")}),(0,t.jsx)(l.Input,{value:e$.host,onChange:e=>eO(t=>({...t,host:e.target.value})),placeholder:g("settings.config.git.hostPlaceholder"),className:"text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",children:g("settings.config.git.ownerMatch")}),(0,t.jsx)(l.Input,{value:e$.ownerMatch,onChange:e=>eO(t=>({...t,ownerMatch:e.target.value})),placeholder:g("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-1.5 col-span-2",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",children:g("settings.config.git.localPathTemplate")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{value:e$.localPathTemplate,onChange:e=>eO(t=>({...t,localPathTemplate:e.target.value})),placeholder:g("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsx)(W.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:eZ?"default":"outline",size:"sm",type:"button",onClick:()=>eJ(e=>!e),className:"shrink-0 font-mono",children:"{path}"})}),(0,t.jsx)(W.TooltipContent,{side:"top",className:"max-w-xs",children:(0,t.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,t.jsx)("div",{className:"font-medium",children:g("settings.config.git.pathTooltipTitle")}),(0,t.jsx)("div",{className:"opacity-80",children:g("settings.config.git.pathTooltipDetail")})]})})]}),(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsx)(W.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>e3("edit"),children:(0,t.jsx)(P.FolderOpen,{className:"h-4 w-4"})})}),(0,t.jsx)(W.TooltipContent,{children:g("settings.config.git.pickFolder")})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:eZ?g("onboarding.step3.pathHintFull"):g("onboarding.step3.pathHintRepo")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",children:g("settings.config.git.priority")}),(0,t.jsx)(l.Input,{type:"number",value:e$.priority,onChange:e=>eO(t=>({...t,priority:Number(e.target.value)})),className:"text-sm w-24"})]})]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 mt-3",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:()=>{eA(null),eJ(!1)},children:g("settings.config.git.cancel")}),(0,t.jsx)(r.Button,{size:"sm",onClick:()=>tS(e.id),children:g("settings.config.git.save")})]})]},e.id):(0,t.jsx)("li",{className:"group px-5 py-4 hover:bg-muted/20 transition-colors",children:(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium text-sm",children:e.host}),"*"!==e.ownerMatch&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["/ ",e.ownerMatch]}),(0,t.jsxs)(d.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:[g("settings.config.git.priority")," ",e.priority]})]}),(0,t.jsx)("p",{className:"mt-0.5 font-mono text-xs text-muted-foreground truncate",children:e.localPathTemplate})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{let t,s,a;return t=e.localPathTemplate,a=(s=/\/\{path\}\/?$/.test(t))?t.replace(/\/?\{path\}\/?$/,"").replace(/\/+$/,""):t,void(eA(e.id),eO({host:e.host,ownerMatch:e.ownerMatch,localPathTemplate:a,priority:e.priority}),eJ(s))},title:g("settings.config.git.edit"),children:(0,t.jsx)(T,{className:"h-4 w-4"})}),(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>e2(e.id),className:"text-destructive",title:g("settings.config.git.delete"),children:(0,t.jsx)(S.Trash2,{className:"h-4 w-4"})})]})]})},e.id))}):(0,t.jsxs)("div",{className:"rounded-xl border border-dashed border-border p-8 text-center",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:g("settings.config.git.noRules")}),(0,t.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground/80",children:g("settings.config.git.noRulesFallback")})]}),eW&&(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/20 p-5 space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:g("settings.config.git.host")}),(0,t.jsx)(l.Input,{value:e_.host,onChange:e=>eG(t=>({...t,host:e.target.value})),placeholder:g("settings.config.git.hostPlaceholder"),className:"text-sm",autoFocus:!0})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:g("settings.config.git.ownerMatch")}),(0,t.jsx)(l.Input,{value:e_.ownerMatch,onChange:e=>eG(t=>({...t,ownerMatch:e.target.value})),placeholder:g("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs font-medium",children:g("settings.config.git.localPathTemplate")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{value:e_.localPathTemplate,onChange:e=>eG(t=>({...t,localPathTemplate:e.target.value})),placeholder:g("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsx)(W.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:eX?"default":"outline",size:"sm",type:"button",onClick:()=>eY(e=>!e),className:"shrink-0 font-mono",children:"{path}"})}),(0,t.jsx)(W.TooltipContent,{side:"top",className:"max-w-xs",children:(0,t.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,t.jsx)("div",{className:"font-medium",children:g("settings.config.git.pathTooltipTitle")}),(0,t.jsx)("div",{className:"opacity-80",children:g("settings.config.git.pathTooltipDetail")})]})})]}),(0,t.jsxs)(W.Tooltip,{children:[(0,t.jsx)(W.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>e3("add"),children:(0,t.jsx)(P.FolderOpen,{className:"h-4 w-4"})})}),(0,t.jsx)(W.TooltipContent,{children:g("settings.config.git.pickFolder")})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:eX?g("onboarding.step3.pathHintFull"):g("onboarding.step3.pathHintRepo")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs font-medium",children:g("settings.config.git.priority")}),(0,t.jsx)(l.Input,{type:"number",value:e_.priority,onChange:e=>eG(t=>({...t,priority:Number(e.target.value)})),className:"text-sm w-24"})]}),e_.localPathTemplate&&(s=e_.localPathTemplate.trim().replace(/\/+$/,""),a=eX?`${s}/{path}`:s,n=[{label:"GitHub SSH",url:"git@github.com:user/my-app.git"},{label:"GitHub HTTPS",url:"https://github.com/user/my-app.git"},{label:"GitLab Subgroup",url:"https://gitlab.com/org/team/sub/my-api.git"}],(0,t.jsxs)("div",{className:"rounded-lg bg-muted/40 border border-border px-4 py-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:g("onboarding.step3.previewLabel")}),(0,t.jsx)("div",{className:"flex gap-1",children:n.map((e,s)=>(0,t.jsx)("button",{type:"button",onClick:()=>e0(s),className:(0,x.cn)("rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors cursor-pointer",eQ===s?"bg-foreground text-background":"bg-muted text-muted-foreground hover:text-foreground"),children:e.label},s))})]}),(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground truncate",children:n[eQ].url}),(0,t.jsxs)("p",{className:"font-mono text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"→ "}),(0,t.jsx)("span",{className:"text-foreground font-medium",children:function(e,t){if(!e||!t)return"";let s=t.trim(),a=[],n=s.match(/^git@[^:]+:(.+)$/);if(n)a=n[1].replace(/\.git\/?$/,"").split("/").filter(Boolean);else try{let e=new URL(s);a=decodeURIComponent(e.pathname).replace(/\.git\/?$/,"").split("/").filter(Boolean)}catch{return""}if(!a.length)return"";let i=a[0],r=a[a.length-1],l=a.join("/");if(e.includes("{path}"))return e.replace("{path}",l).replace("{owner}",i).replace("{repo}",r).replace(/\/+$/,"");let o=e.replace("{owner}",i).replace("{repo}","").replace(/\/+$/,"");return`${o}/${r}`}(a,n[eQ].url)})]})]})]})),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:()=>eq(!1),children:g("settings.config.git.cancel")}),(0,t.jsxs)(r.Button,{size:"sm",onClick:tC,disabled:!e_.host.trim()||!e_.localPathTemplate.trim(),children:[(0,t.jsx)(M,{className:"h-3.5 w-3.5 mr-1.5"}),g("settings.config.git.save")]})]})]})]})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.system.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.system.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.system.maxUpload")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.system.maxUploadHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:1,max:500,value:e4.maxUploadMb,onChange:e=>e7(t=>({...t,maxUploadMb:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.system.maxConcurrent")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.system.maxConcurrentHint")})]}),(0,t.jsx)(l.Input,{type:"number",min:1,max:10,value:e4.maxConcurrent,onChange:e=>e7(t=>({...t,maxConcurrent:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.system.maxReadable")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.system.maxReadableHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:1,max:50,value:e4.maxReadableMb,onChange:e=>e7(t=>({...t,maxReadableMb:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.system.archiveDelay")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.system.archiveDelayHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:1,max:365,value:e4.archiveDelayDays,onChange:e=>e7(t=>({...t,archiveDelayDays:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:g("settings.config.system.archiveDelayUnit")})]})]})]}),(0,t.jsx)(r.Button,{onClick:tb,className:"rounded-lg",children:g("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.task.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.task.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.system.taskDefaultWorktree")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.system.taskDefaultWorktreeHint")})]}),(0,t.jsx)("button",{type:"button",onClick:()=>e7(e=>({...e,taskDefaultUseWorktree:!e.taskDefaultUseWorktree})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${e4.taskDefaultUseWorktree?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e4.taskDefaultUseWorktree?g("task.worktreeYes"):g("task.worktreeNo")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.system.taskDefaultAutoStart")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.system.taskDefaultAutoStartHint")})]}),(0,t.jsx)("button",{type:"button",onClick:()=>e7(e=>({...e,taskDefaultAutoStart:!e.taskDefaultAutoStart})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${e4.taskDefaultAutoStart?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e4.taskDefaultAutoStart?g("task.autoStartYes"):g("task.autoStartNo")})]})]}),(0,t.jsx)(r.Button,{onClick:tj,className:"rounded-lg",children:g("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.gitParams.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.gitParams.desc")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.gitParams.timeout")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.gitParams.timeoutHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:5,max:300,value:e8.timeoutSec,onChange:e=>e6(t=>({...t,timeoutSec:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]}),(0,t.jsx)(r.Button,{onClick:tv,className:"rounded-lg",children:g("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.search.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.search.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.search.resultLimit")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.search.resultLimitHint")})]}),(0,t.jsx)(l.Input,{type:"number",min:5,max:100,value:e9.resultLimit,onChange:e=>te(t=>({...t,resultLimit:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.search.allModeCap")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.search.allModeCapHint")})]}),(0,t.jsx)(l.Input,{type:"number",min:1,max:20,value:e9.allModeCap,onChange:e=>te(t=>({...t,allModeCap:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.search.debounceMs")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.search.debounceMsHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:50,max:1e3,value:e9.debounceMs,onChange:e=>te(t=>({...t,debounceMs:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"ms"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.search.snippetLength")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.search.snippetLengthHint")})]}),(0,t.jsx)(l.Input,{type:"number",min:20,max:500,value:e9.snippetLength,onChange:e=>te(t=>({...t,snippetLength:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.search.codeTimeout")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.search.codeTimeoutHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:5,max:300,step:5,value:e9.codeTimeoutSec,onChange:e=>te(t=>({...t,codeTimeoutSec:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]})]}),(0,t.jsx)(r.Button,{onClick:tN,className:"rounded-lg",children:g("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.missions.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.missions.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:g("settings.config.missions.minCols")}),(0,t.jsx)(l.Input,{type:"number",min:1,max:10,value:tt.minCols,onChange:e=>ts(t=>({...t,minCols:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:g("settings.config.missions.maxCols")}),(0,t.jsx)(l.Input,{type:"number",min:1,max:10,value:tt.maxCols,onChange:e=>ts(t=>({...t,maxCols:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:g("settings.config.missions.minRows")}),(0,t.jsx)(l.Input,{type:"number",min:1,max:10,value:tt.minRows,onChange:e=>ts(t=>({...t,minRows:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:g("settings.config.missions.maxRows")}),(0,t.jsx)(l.Input,{type:"number",min:1,max:10,value:tt.maxRows,onChange:e=>ts(t=>({...t,maxRows:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]})]}),(0,t.jsx)(r.Button,{onClick:ty,className:"rounded-lg",children:g("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.hooks.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.hooks.desc")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.hooks.autoUploadTypes")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.hooks.autoUploadTypesHint")})]}),(0,t.jsx)(l.Input,{value:tl,onChange:e=>to(e.target.value),placeholder:"png, jpg, jpeg, gif, webp, svg, pdf",className:"w-80 rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsx)(r.Button,{onClick:tk,className:"rounded-lg",children:g("common.save")}),(0,t.jsxs)("div",{className:"flex items-center gap-4 pt-4 border-t border-border/50",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:ta?.installed?g("settings.config.hooks.installed"):g("settings.config.hooks.notInstalled")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.hooks.installHint")})]}),(0,t.jsx)(r.Button,{variant:ta?.installed?"destructive":"default",onClick:tw,disabled:ti||!ta,className:"rounded-lg",children:ta?.installed?g("settings.config.hooks.uninstall"):g("settings.config.hooks.install")})]})]}),(0,t.jsx)(u.Dialog,{open:!!e1,onOpenChange:e=>!e&&e2(null),children:(0,t.jsxs)(u.DialogContent,{children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsx)(u.DialogTitle,{children:g("settings.config.git.deleteConfirm")}),(0,t.jsx)(u.DialogDescription,{children:g("settings.config.git.deleteConfirmMessage")})]}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>e2(null),children:g("settings.config.git.cancel")}),(0,t.jsx)(r.Button,{variant:"destructive",onClick:()=>e1&&tT(e1),children:g("settings.config.git.delete")})]})]})})]});case"notifications":return(0,t.jsx)("div",{className:"divide-y divide-border/50",children:(0,t.jsxs)("div",{className:"flex items-center justify-between py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:g("settings.notifications.enable")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:g("settings.notifications.enableDesc")})]}),(0,t.jsx)(m.Switch,{checked:tc,onCheckedChange:tM})]})});case"backup":return(0,t.jsx)(ec,{});case"extensions":return(0,t.jsx)(eN,{});case"keyboard-shortcuts":return(0,t.jsx)(eD,{})}}()]})}),(0,t.jsx)(q.FolderBrowserDialog,{open:null!==e5,onOpenChange:e=>{e||e3(null)},onSelect:e=>{let t=eI(e);"add"===e5?eG(e=>({...e,localPathTemplate:t})):"edit"===e5&&eO(e=>({...e,localPathTemplate:t})),e3(null)}})]})}e.s(["default",0,function(){return(0,t.jsx)(eE,{})}],113399)}]);
|