tower-studio 0.2.40 → 0.2.41
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 +3 -3
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +31 -31
- 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.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.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.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.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js +1 -1
- 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.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.nft.json +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.nft.json +1 -1
- 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.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.nft.json +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.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 +2 -2
- package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +66 -66
- 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 +3 -3
- package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +31 -31
- 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 +3 -3
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +31 -31
- 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 +3 -3
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +48 -48
- 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 +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +110 -110
- 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 +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +85 -85
- 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 +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +72 -72
- 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 +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +79 -79
- 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 +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +31 -31
- 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 +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +73 -73
- 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 +4 -4
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +78 -78
- 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 +3 -3
- package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +49 -49
- 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/07-d_@anthropic-ai_claude-agent-sdk_sdk_mjs_0.721uk._.js +16 -9
- 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 +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.z8.oi._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__02jy80j._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fp8qv9._.js +28 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0.wld9h._.js → [root-of-the-server]__0giry~0._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0kexk71._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0kuo6q5._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0np.553._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_02ruq-1._.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/[root-of-the-server]__0.-z9ts._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__038u_kv._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04wbr9x._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__058rbx5._.js +3 -3
- 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]__08w4.zf._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ce3fpq._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0da~mv~._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dn90me._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0gtqd5o._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h589~0._.js +3 -3
- 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]__0nwisa8._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0oq-j16._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__077c1-u._.js → [root-of-the-server]__0w--i~y._.js} +2 -2
- 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]__10~3-.h._.js → [root-of-the-server]__0zkpwjj._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__10s67lq._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12w35bx._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0-~9em3._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_03lt1_x._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_03v~rg0._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0o3rthp._.js → _04mn9go._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_04~zqvy._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_070t_mh._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0be3783._.js → _0_6ss3p._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0_9i_x2._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0_z-t6g._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0b.qjaj._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0zqwuq~._.js → _0dzx554._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0mdqhxi._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0p6p_68._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0r-flc_._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0rkdyad._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_07_8m~l._.js → _0tsu0gq._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0u7c6bz._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0wbcp88._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_04jcctt._.js → _0z6ji0d._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_12ca88g._.js +3 -3
- 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/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 +275 -275
- package/.next/standalone/.next/static/chunks/0-x5eie9u3i_2.js +1 -0
- package/.next/standalone/.next/static/chunks/{09ossbd-6zx4g.js → 00w9dd4fooyic.js} +1 -1
- package/.next/standalone/.next/static/chunks/{11brr5_f60yx-.js → 02o~o8tgt860j.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0roncmx7dp-47.js → 03sdutmq6~3v-.js} +1 -1
- package/.next/standalone/.next/static/chunks/{03rl6s3rpptas.js → 04zy.uc7eru64.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0vm6adb7s2i4g.js → 05zm_-7x0fubq.js} +1 -1
- package/.next/standalone/.next/static/chunks/05~2gwcex7hv0.js +1 -0
- package/.next/standalone/.next/static/chunks/{05n5tgexx2_92.js → 062.w.nsp3886.js} +1 -1
- package/.next/standalone/.next/static/chunks/06lla3jtd~xb4.js +1 -0
- package/.next/standalone/.next/static/chunks/{0~33w7-91bik-.js → 06s-d8my6b9t7.js} +1 -1
- package/.next/standalone/.next/static/chunks/{03jo4masky_ji.js → 0ad0ou7l2.r6e.js} +1 -1
- package/.next/standalone/.next/static/chunks/0babmd83h6ejs.js +1 -0
- package/.next/standalone/.next/static/chunks/0c8c6pcmlzgmi.js +1 -0
- package/.next/standalone/.next/static/chunks/{0t1nk8jlwgyb-.js → 0c~~56wny5m2u.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0dp-d685xgb68.js → 0ev98toavtr6..js} +1 -1
- package/.next/standalone/.next/static/chunks/{0s6gcjv24hfkq.js → 0fz47g1x5o2xj.js} +1 -1
- package/.next/standalone/.next/static/chunks/0i2soupf1735z.js +1 -0
- package/.next/standalone/.next/static/chunks/{050agjgyp545k.js → 0l25d0nc5ygyd.js} +1 -1
- package/.next/standalone/.next/static/chunks/{183m8iouij_n8.js → 0lnsj7fwkprxe.js} +1 -1
- package/.next/standalone/.next/static/chunks/0oz8sw6j078vm.js +2 -0
- package/.next/standalone/.next/static/chunks/{0bq80txkiwk0q.js → 0tfmi08mzcieh.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0l2-qbv0tx44i.js → 0umi7ddtiv8sw.js} +1 -1
- package/.next/standalone/.next/static/chunks/0w33dj~dfamnr.css +1 -0
- package/.next/standalone/.next/static/chunks/{0_d-xz2x5qb_c.js → 0y3a2-c-i9t~t.js} +1 -1
- package/.next/standalone/.next/static/chunks/{16e-u8e~pzz_-.js → 10qltt-r5q91p.js} +1 -1
- package/.next/standalone/.next/static/chunks/{120u45g91sx4q.js → 1195ux3t_r-rb.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0xxn47mtozln~.js → 11sqt~58g35be.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0tb.0x~6y.21w.js → 12rj7-g8lxjew.js} +1 -1
- package/.next/standalone/package.json +1 -1
- package/package.json +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0d1bhsb._.js +0 -28
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01kyzx1._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02mo_kb._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02~6htc._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ea-1l0._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0a-.s7z._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0aqfqr5._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0g8mw1b._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0qrc1eu._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0~cy-h1._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_11rjd4d._.js +0 -3
- package/.next/standalone/.next/static/chunks/02zqmiej0opg7.js +0 -1
- package/.next/standalone/.next/static/chunks/0bx6xpa7fgedh.js +0 -1
- package/.next/standalone/.next/static/chunks/0kf6kwtt_mouu.js +0 -1
- package/.next/standalone/.next/static/chunks/0l3n_2z5xfhor.js +0 -1
- package/.next/standalone/.next/static/chunks/0mu2posb9cg4b.js +0 -1
- package/.next/standalone/.next/static/chunks/0nc-n~ecfjozt.js +0 -1
- package/.next/standalone/.next/static/chunks/0~qrkswofk7zn.css +0 -1
- package/.next/standalone/.next/static/chunks/1821tyytk30ed.js +0 -2
- /package/.next/standalone/.next/static/{wtOlqKEl8oeuEeWLbCnuv → zSKVtiYaR_yWxx7AopTMR}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{wtOlqKEl8oeuEeWLbCnuv → zSKVtiYaR_yWxx7AopTMR}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{wtOlqKEl8oeuEeWLbCnuv → zSKVtiYaR_yWxx7AopTMR}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,882651,181209,e=>{"use strict";var s=e.i(59737);e.s(["CheckCircle2",()=>s.default],882651);let t=(0,e.i(572989).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,t],181209)},236967,e=>{"use strict";var s=e.i(289721),t=e.i(210702),
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,882651,181209,e=>{"use strict";var s=e.i(59737);e.s(["CheckCircle2",()=>s.default],882651);let t=(0,e.i(572989).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,t],181209)},236967,e=>{"use strict";var s=e.i(289721),t=e.i(210702),r=e.i(538059),a=e.i(259846),n=e.i(645378),l=e.i(453889),i=e.i(487278),c=e.i(533499);let o=[{key:"notes",icon:n.FileText},{key:"assets",icon:l.FolderOpen},{key:"archive",icon:i.Archive}];e.s(["SubPageNav",0,function({workspaceId:e}){let{t:n}=(0,c.useI18n)(),l=(0,r.usePathname)(),i=o.find(e=>l.includes(`/${e.key}`))?.key;return(0,s.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4",children:[(0,s.jsxs)(t.default,{href:`/workspaces/${e}`,className:"mr-2 inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,s.jsx)(a.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{children:n("archive.backToBoard")})]}),(0,s.jsx)("span",{className:"mr-2 h-4 w-px bg-border"}),o.map(r=>{let a=r.icon,l=i===r.key;return(0,s.jsxs)(t.default,{href:`/workspaces/${e}/${r.key}`,className:`inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs font-medium transition-colors ${l?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:[(0,s.jsx)(a,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{children:n(`sidebar.${r.key}`)})]},r.key)})]})}])},107830,e=>{"use strict";var s=e.i(289721),t=e.i(965652),r=e.i(487278),a=e.i(882651),n=e.i(181209),l=e.i(400355),i=e.i(738690),c=e.i(967489),o=e.i(533499),d=e.i(236967),u=e.i(514798);let m=(0,u.createServerReference)("4031ca4137d701df21f0af5f91ddce1be1d2ef7756",u.callServer,void 0,u.findSourceMapURL,"getArchivedTasks");var x=e.i(605005),h=e.i(35967);function p(e){return new Date(e).toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function f({priority:e}){return(0,s.jsx)("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${{LOW:"bg-slate-400",MEDIUM:"bg-amber-400",HIGH:"bg-orange-500",CRITICAL:"bg-rose-500"}[e]??"bg-slate-400"}`})}e.s(["ArchivePageClient",0,function({allWorkspaces:e,initialWorkspaceId:u,initialProjectId:g,initialTasks:v}){let j,{t:b}=(0,o.useI18n)(),[N,k]=(0,t.useTransition)(),[y,w]=(0,t.useState)(u),[C,S]=(0,t.useState)(g),[T,A]=(0,t.useState)(v),[$,I]=(0,t.useState)(null),[D,L]=(0,t.useState)(""),P=e.find(e=>e.id===y),E=P?.projects??[],O=D.trim().toLowerCase(),z=O?T.filter(e=>e.title.toLowerCase().includes(O)):T,R=(0,t.useCallback)(e=>{e?k(async()=>{A(await m(e))}):A([])},[k]);return(0,s.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,s.jsx)(d.SubPageNav,{workspaceId:y}),(0,s.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,s.jsxs)(c.Select,{value:y,onValueChange:s=>s&&(s=>{if(s===y)return;w(s);let t=e.find(e=>e.id===s),r=t?.projects[0]??null;S(r?.id??null),R(r?.id??null)})(s),children:[(0,s.jsx)(c.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,s.jsx)("span",{className:"truncate",children:P?.name??y})}),(0,s.jsx)(c.SelectContent,{children:e.map(e=>(0,s.jsx)(c.SelectItem,{value:e.id,children:e.name},e.id))})]}),E.length>0&&(0,s.jsxs)(c.Select,{value:C??"",onValueChange:e=>e&&void(e!==C&&(S(e),R(e))),children:[(0,s.jsx)(c.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,s.jsx)("span",{className:"truncate",children:(j=E.find(e=>e.id===C))?j.alias?`${j.name} (${j.alias})`:j.name:""})}),(0,s.jsx)(c.SelectContent,{children:E.map(e=>(0,s.jsxs)(c.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]}),(0,s.jsxs)("div",{className:"relative ml-auto",children:[(0,s.jsx)(i.Search,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,s.jsx)("input",{type:"text",value:D,onChange:e=>L(e.target.value),placeholder:b("archive.searchPlaceholder"),className:"h-8 w-48 rounded-md border border-border bg-background pl-8 pr-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),(0,s.jsxs)("span",{className:"rounded-full bg-muted px-2.5 py-0.5 text-[11px] text-muted-foreground",children:[z.length," ",b("archive.tasksCount")]})]}),(0,s.jsx)("div",{className:"flex-1 overflow-auto px-6 py-4",children:(0,s.jsxs)("div",{className:`relative ${N?"opacity-40 pointer-events-none":""} transition-opacity`,children:[N&&(0,s.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,s.jsx)(l.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===z.length?(0,s.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,s.jsx)(r.Archive,{className:"h-10 w-10 text-muted-foreground/30"}),(0,s.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:O?b("archive.noSearchResults"):b("archive.noTasks")}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground/60",children:O?b("archive.noSearchResultsDesc"):b("archive.noTasksDesc")})]}):(0,s.jsx)("div",{className:"space-y-2",children:z.map(e=>{let t="DONE"===e.status,r=e.executions[0];return(0,s.jsx)("div",{role:"button",tabIndex:0,onClick:()=>I(e.id),onKeyDown:s=>{("Enter"===s.key||" "===s.key)&&(s.preventDefault(),I(e.id))},className:"group cursor-pointer rounded-lg border border-border bg-card px-4 py-3 transition-colors hover:border-border/80 hover:bg-accent/30 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("div",{className:"mt-0.5 shrink-0",children:t?(0,s.jsx)(a.CheckCircle2,{className:"h-4 w-4 text-emerald-500"}):(0,s.jsx)(n.XCircle,{className:"h-4 w-4 text-rose-500"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(f,{priority:e.priority}),(0,s.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:e.title}),(0,s.jsx)("span",{className:`ml-1 shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium ${t?"bg-emerald-500/10 text-emerald-400 ring-1 ring-emerald-500/20":"bg-rose-500/10 text-rose-400 ring-1 ring-rose-500/20"}`,children:t?b("archive.status.done"):b("archive.status.cancelled")}),e.version&&(0,s.jsx)(h.TaskVersionTag,{number:e.version.number,name:e.version.name,showName:!0,className:"shrink-0"})]}),e.labels.length>0&&(0,s.jsx)("div",{className:"mt-1.5 flex flex-wrap gap-1",children:e.labels.map(e=>(0,s.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`${e.label.color}20`,color:e.label.color,outline:`1px solid ${e.label.color}40`},children:e.label.name},e.label.id))}),(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-3 text-[11px] text-muted-foreground",children:[(0,s.jsxs)("span",{children:[b("archive.createdAt"),": ",p(e.createdAt)]}),(0,s.jsxs)("span",{children:[t?b("archive.completedAt"):b("archive.cancelledAt"),": ",p(e.updatedAt)]}),r&&(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[b("archive.lastExecution"),":"," ",(0,s.jsx)("span",{className:`rounded px-1 py-0.5 font-mono text-[10px] ${"COMPLETED"===r.status?"bg-emerald-500/10 text-emerald-400":"FAILED"===r.status?"bg-rose-500/10 text-rose-400":"bg-amber-500/10 text-amber-400"}`,children:r.status})]})]})]})]})},e.id)})})]})}),(0,s.jsx)(x.TaskOverviewDrawer,{open:!!$,onOpenChange:e=>{e||I(null)},taskId:$,hideEnvActions:!0})]})}],107830)},244455,e=>{e.v(s=>Promise.all(["static/chunks/075e-zs_kgc_g.js"].map(s=>e.l(s))).then(()=>s(629495)))},800307,e=>{e.v(s=>Promise.all(["static/chunks/0zm4fvu.lntrp.js"].map(s=>e.l(s))).then(()=>s(267483)))}]);
|
|
@@ -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(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)}]);
|
|
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(532871),F=e.i(964146),U=e.i(841244),I=e.i(514798);let E=(0,I.createServerReference)("0074966922f5735a14f769bd5ec9503c4dc4f902b1",I.callServer,void 0,I.findSourceMapURL,"getAvailableTerminalApps"),H=(0,I.createServerReference)("004b5b491e1d59548b9bb8acb799c5aa8f56d9f9e5",I.callServer,void 0,I.findSourceMapURL,"getAvailableEditors");var V=e.i(443344);let z=(0,I.createServerReference)("40022e797260d204636e45e591a4c4bd133dc98577",I.callServer,void 0,I.findSourceMapURL,"createPrompt"),K=(0,I.createServerReference)("604815e5fa389b486b4b2065146bdada9d19f9166b",I.callServer,void 0,I.findSourceMapURL,"updatePrompt"),A=(0,I.createServerReference)("4062018f469d9e917f83563a00175a0ba1cc1fa73a",I.callServer,void 0,I.findSourceMapURL,"deletePrompt"),$=(0,I.createServerReference)("60eeb0597f28aa03e3c04cdd93edd3ee192c760e14",I.callServer,void 0,I.findSourceMapURL,"setDefaultPrompt"),O=(0,I.createServerReference)("009e9c73dabe27469607224136537934b9407417e3",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)("40501bc0f7613a041df931b7601190931438b1a063",I.callServer,void 0,I.findSourceMapURL,"createBackup"),et=(0,I.createServerReference)("008a55c3b021b17e6325b8db949963ec9e9f229b46",I.callServer,void 0,I.findSourceMapURL,"listBackupFiles"),es=(0,I.createServerReference)("40442119c954ba8e67fc955c12f67b6514bbbb4b88",I.callServer,void 0,I.findSourceMapURL,"deleteBackupFile"),ea=(0,I.createServerReference)("40cd6bc441849d21df476eb497a1adcc3cf491add7",I.callServer,void 0,I.findSourceMapURL,"restoreBackup"),en=(0,I.createServerReference)("401cc0300a68629f255adaef6d06933e5a6262bd54",I.callServer,void 0,I.findSourceMapURL,"resetSystem"),ei=(0,I.createServerReference)("004740c06b2473e940f19bd6b9b9d5f781d9cb07ba",I.callServer,void 0,I.findSourceMapURL,"getBackupDir"),er=(0,I.createServerReference)("40915d89df15a6bd7436ef2259b14617467be0223e",I.callServer,void 0,I.findSourceMapURL,"setBackupDir"),el=(0,I.createServerReference)("002737acb9aa39918272fe24a0b4f0042a3d3cfdeb",I.callServer,void 0,I.findSourceMapURL,"getStorageLocation"),eo=(0,I.createServerReference)("40a69d46fce4f06c0059080309772b2ee3f530dffc",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,e6]=(0,s.useState)({maxUploadMb:50,maxConcurrent:3,maxReadableMb:5,archiveDelayDays:7,taskDefaultUseWorktree:!0,taskDefaultAutoStart:!1}),[e9,e7]=(0,s.useState)({timeoutSec:30}),[e8,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;e6({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"]}),e7({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",e9.timeoutSec)},tN=async()=>{await (0,F.setConfigValue)("search.resultLimit",e8.resultLimit),await (0,F.setConfigValue)("search.allModeCap",e8.allModeCap),await (0,F.setConfigValue)("search.debounceMs",e8.debounceMs),await (0,F.setConfigValue)("search.snippetLength",e8.snippetLength),await (0,F.setConfigValue)("search.codeTimeoutSec",e8.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=>e6(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=>e6(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=>e6(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=>e6(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:()=>e6(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:()=>e6(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:e9.timeoutSec,onChange:e=>e7(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:e8.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:e8.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:e8.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:e8.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:e8.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)}]);
|
package/package.json
CHANGED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
module.exports=[324725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},918622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},556704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},832319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},270406,(e,t,r)=>{t.exports=e.x("next/dist/compiled/@opentelemetry/api",()=>require("next/dist/compiled/@opentelemetry/api"))},814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},874533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},750227,(e,t,r)=>{t.exports=e.x("node:path",()=>require("node:path"))},902157,(e,t,r)=>{t.exports=e.x("node:fs",()=>require("node:fs"))},660526,(e,t,r)=>{t.exports=e.x("node:os",()=>require("node:os"))},522734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},193695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},198840,e=>{"use strict";var t=e.i(855104);let r=["localhost","127.0.0.1","[::1]"],n=new Set(["127.0.0.1","::1","::ffff:127.0.0.1"]),s=/^c[a-z0-9]{20,30}$/;e.s(["requireLocalhost",0,function(e){let s=e.headers.get("x-forwarded-for");if(s&&!s.split(",").map(e=>e.trim()).every(e=>n.has(e)))return t.NextResponse.json({error:"Forbidden"},{status:403});let a=e.headers.get("host")??"";return r.some(e=>a.startsWith(e))?null:t.NextResponse.json({error:"Forbidden"},{status:403})},"validateProjectId",0,function(e){return s.test(e)?null:t.NextResponse.json({error:"Invalid projectId format"},{status:400})},"validateTaskId",0,function(e){return s.test(e)?null:t.NextResponse.json({error:"Invalid taskId format"},{status:400})}])},192520,e=>{"use strict";let t;var r=e.i(750227),n=e.i(660526),s=e.i(902157);function a(){return t||(t=process.env.TOWER_DATA_DIR||(0,r.join)((0,n.homedir)(),".tower"),(0,s.existsSync)(t)||(0,s.mkdirSync)(t,{recursive:!0})),t}e.s(["getAssistantDir",0,function(){let e=(0,r.join)(a(),"assistant");return(0,s.existsSync)(e)||(0,s.mkdirSync)(e,{recursive:!0}),e},"getBackupsDir",0,function(){let e=(0,r.join)(a(),"backups");return(0,s.existsSync)(e)||(0,s.mkdirSync)(e,{recursive:!0}),e},"getExtensionsDir",0,function(){let e=(0,r.join)(a(),"extensions");return(0,s.existsSync)(e)||(0,s.mkdirSync)(e,{recursive:!0}),e},"getStorageDir",0,function(){let e=process.env.TOWER_STORAGE_DIR||function(){try{let e=(0,s.readFileSync)((0,r.join)(a(),"storage-location"),"utf-8").trim();return e.length>0?e:null}catch{return null}}(),t=e&&e.length>0?e:(0,r.join)(a(),"storage");return(0,s.existsSync)(t)||(0,s.mkdirSync)(t,{recursive:!0}),t},"getTowerDbPath",0,function(){let e;return(0,r.join)((e=(0,r.join)(a(),"database"),(0,s.existsSync)(e)||(0,s.mkdirSync)(e,{recursive:!0}),e),"tower.db")},"getTowerDir",0,a])},471552,e=>{"use strict";var t=e.i(522734),r=e.i(814747),n=e.i(192520),s=e.i(173215),a=e.i(53674);let o=`# Tower Assistant
|
|
2
|
-
|
|
3
|
-
你是 Tower Assistant — Tower 任务管理平台的内置 AI 操作员。
|
|
4
|
-
|
|
5
|
-
## 身份
|
|
6
|
-
|
|
7
|
-
- 你是一个**任务管理操作员**,不是编程助手
|
|
8
|
-
- 你通过 Tower MCP 工具帮助用户管理工作区、项目、任务
|
|
9
|
-
- 你**不能**读写文件、运行命令、编辑代码、搜索网页
|
|
10
|
-
- 如果用户请求你无法完成的操作,告诉他们需要通过开发 MCP 扩展来支持
|
|
11
|
-
|
|
12
|
-
## 回复风格
|
|
13
|
-
|
|
14
|
-
- 使用用户的语言回复(中文问中文答,英文问英文答)
|
|
15
|
-
- 简洁明了,不要冗长的解释
|
|
16
|
-
- 主动使用工具查询信息,而不是猜测
|
|
17
|
-
- 当用户问"你能做什么"时,只列出 Tower MCP 工具提供的能力
|
|
18
|
-
|
|
19
|
-
## 行动准则(最重要)
|
|
20
|
-
|
|
21
|
-
- **说到就做,绝不只announce不action**:一旦信息足够,就在**同一轮回复里直接调用对应的 MCP 工具**完成操作。
|
|
22
|
-
- **严禁**只回复「我现在立即创建」「好的,立即创建」「马上为你处理」这类话却不实际发出工具调用。这种回复等于没做事,会让用户反复追问。
|
|
23
|
-
- 信息不足时(例如缺项目、缺必填项),**直接提出具体问题**问用户,而不是含糊地说「我来创建」。
|
|
24
|
-
- 创建任务时如果工具返回 \`needsDefaultsSetup: true\`,**立刻**向用户询问两件事(是否默认用 Git worktree 隔离、是否创建后自动开始执行),拿到答复就调用 \`set_task_defaults\` 保存,然后**再次调用** \`create_task\`——不要停在「我来创建」这句话上。
|
|
25
|
-
- 用户催你(如「创建了吗?」「快创建」)时,说明上一轮你没真正调用工具——这一轮必须立即发出工具调用,而不是再次口头答应。
|
|
26
|
-
`;function i(e){try{return(0,t.readFileSync)(e,"utf-8")}catch{return null}}e.s(["ensureTowerDir",0,function(){let e=(0,n.getAssistantDir)(),l=(0,r.join)(e,"CLAUDE.md"),c=(0,a.getPackageRoot)(),u=(0,r.join)(c,"skills","tower","SKILL.md"),d=(0,r.join)(e,".claude","skills","tower"),p=(0,r.join)(d,"SKILL.md");if((0,t.existsSync)(l)&&i(l)===o||((0,t.writeFileSync)(l,o,"utf-8"),console.error(`[init-tower] Wrote ${l}`)),(0,t.existsSync)(u)){let e=i(u);null===e||(0,t.existsSync)(p)&&i(p)===e||((0,t.mkdirSync)(d,{recursive:!0}),(0,t.copyFileSync)(u,p),console.error(`[init-tower] Copied SKILL.md → ${d}`))}return function(e){let n=(0,r.join)(e,".claude","settings.json");if((0,t.existsSync)(n))try{let e=JSON.parse((0,t.readFileSync)(n,"utf-8"));e&&"mcpServers"in e&&(delete e.mcpServers,(0,t.writeFileSync)(n,JSON.stringify(e,null,2)+"\n","utf-8"),console.error(`[init-tower] Removed legacy mcpServers from ${n}`))}catch{}let a=(0,r.join)(e,".mcp.json");if((0,t.existsSync)(a))try{let e=(0,s.getTowerMcpName)(),r=JSON.parse((0,t.readFileSync)(a,"utf-8")),n=r.mcpServers??{};e in n&&(delete n[e],0===Object.keys(n).length?delete r.mcpServers:r.mcpServers=n,(0,t.writeFileSync)(a,JSON.stringify(r,null,2)+"\n","utf-8"),console.error(`[init-tower] Removed legacy tower entry from ${a}`))}catch{}}(e),e}])},137382,e=>{"use strict";var t=e.i(765876),r=e.i(675896),n=e.i(959160),s=e.i(97944),a=e.i(86757),o=e.i(204144),i=e.i(273436),l=e.i(743641),c=e.i(813766),u=e.i(840884),d=e.i(498814),p=e.i(780006),h=e.i(544432),m=e.i(772005),x=e.i(450223),f=e.i(193695);e.i(628400);var v=e.i(800071),y=e.i(855104),g=e.i(198840),w=e.i(471552);function R(){return"u">typeof crypto&&crypto.randomUUID?crypto.randomUUID():`msg-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}async function S(t){let r=(0,g.requireLocalhost)(t);if(r)return r;let n=t.nextUrl.searchParams.get("sessionId");if(!n)return y.NextResponse.json({error:"sessionId required"},{status:400});let s=(0,w.ensureTowerDir)();try{let{getSessionMessages:t}=await e.A(145135),r=await t(n,{dir:s}),a=function(e){let t=[];for(let n of e)switch(n.type){case"user":{var r;let e=n.message,s="string"==typeof e?.content?e.content:"";s.startsWith("/tower ")&&(s=s.slice(7));let a=s.match(/<command-args>([\s\S]*?)<\/command-args>/);a&&(s=a[1].trim()),s=s.replace(/\n---\nThe user has attached the following file\(s\)[\s\S]*$/,"").replace(/\n---\nThe user has attached the following image\(s\)[\s\S]*$/,"").trim();let o=void(Array.isArray(r=e?.content)&&r.filter(e=>"image"===e.type&&e.source?.data).length);s&&t.push({id:R(),role:"user",content:s,attachmentFilenames:o});break}case"assistant":{let e=n.message,r=Array.isArray(e?.content)?e.content:[],s=r.filter(e=>"text"===e.type&&e.text).map(e=>e.text);for(let e of(s.length>0&&t.push({id:R(),role:"assistant",content:s.join("")}),r))"tool_use"===e.type&&e.name&&t.push({id:R(),role:"tool",content:JSON.stringify(e.input??{},null,2),toolName:e.name});break}case"system":{let e=n.message;e?.subtype==="tool_result"&&e.content&&t.push({id:R(),role:"tool",content:e.content,toolName:`${e.tool_name??"tool"} (result)`})}}return t}(r);return y.NextResponse.json({messages:a})}catch(t){let e=t instanceof Error?t.message:String(t);return console.error("[assistant-sessions] Error:",e),y.NextResponse.json({error:e},{status:500})}}e.s(["GET",0,S,"dynamic",0,"force-dynamic","runtime",0,"nodejs"],866197);var _=e.i(866197);let j=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/internal/assistant/sessions/route",pathname:"/api/internal/assistant/sessions",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/internal/assistant/sessions/route.ts",nextConfigOutput:"standalone",userland:_}),{workAsyncStorage:k,workUnitAsyncStorage:E,serverHooks:A}=j;async function C(e,t,n){n.requestMeta&&(0,s.setRequestMeta)(e,n.requestMeta),j.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let y="/api/internal/assistant/sessions/route";y=y.replace(/\/index$/,"")||"/";let g=await j.prepare(e,t,{srcPage:y,multiZoneDraftMode:!1});if(!g)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:w,params:R,nextConfig:S,parsedUrl:_,isDraftMode:k,prerenderManifest:E,routerServerContext:A,isOnDemandRevalidate:C,revalidateOnlyGenerated:T,resolvedPathname:N,clientReferenceManifest:b,serverActionsManifest:P}=g,q=(0,i.normalizeAppPath)(y),I=!!(E.dynamicRoutes[q]||E.routes[N]),D=async()=>((null==A?void 0:A.render404)?await A.render404(e,t,_,!1):t.end("This page could not be found"),null);if(I&&!k){let e=!!E.routes[N],t=E.dynamicRoutes[q];if(t&&!1===t.fallback&&!e){if(S.adapterPath)return await D();throw new f.NoFallbackError}}let O=null;!I||j.isDev||k||(O="/index"===(O=N)?"/":O);let U=!0===j.isDev||!I,M=I&&!U;P&&b&&(0,o.setManifestsSingleton)({page:y,clientReferenceManifest:b,serverActionsManifest:P});let $=e.method||"GET",F=(0,a.getTracer)(),H=F.getActiveScopeSpan(),L=!!(null==A?void 0:A.isWrappedByNextServer),K=!!(0,s.getRequestMeta)(e,"minimalMode"),W=(0,s.getRequestMeta)(e,"incrementalCache")||await j.getIncrementalCache(e,S,E,K);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let B={params:R,previewProps:E.preview,renderOpts:{experimental:{authInterrupts:!!S.experimental.authInterrupts},cacheComponents:!!S.cacheComponents,supportsDynamicResponse:U,incrementalCache:W,cacheLifeProfiles:S.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,s)=>j.onRequestError(e,t,n,s,A)},sharedContext:{buildId:w}},G=new l.NodeNextRequest(e),J=new l.NodeNextResponse(t),V=c.NextRequestAdapter.fromNodeNextRequest(G,(0,c.signalFromNodeResponse)(t));try{let s,o=async e=>j.handle(V,B).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${$} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t),s&&s!==e&&(s.setAttribute("http.route",n),s.updateName(t))}else e.updateName(`${$} ${y}`)}),i=async s=>{var a,i;let l=async({previousCacheEntry:r})=>{try{if(!K&&C&&T&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await o(s);e.fetchMetrics=B.renderOpts.fetchMetrics;let i=B.renderOpts.pendingWaitUntil;i&&n.waitUntil&&(n.waitUntil(i),i=void 0);let l=B.renderOpts.collectedTags;if(!I)return await (0,p.sendResponse)(G,J,a,B.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(a.headers);l&&(t[x.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==B.renderOpts.collectedRevalidate&&!(B.renderOpts.collectedRevalidate>=x.INFINITE_CACHE)&&B.renderOpts.collectedRevalidate,n=void 0===B.renderOpts.collectedExpire||B.renderOpts.collectedExpire>=x.INFINITE_CACHE?void 0:B.renderOpts.collectedExpire;return{value:{kind:v.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await j.onRequestError(e,t,{routerKind:"App Router",routePath:y,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,A),t}},c=await j.handleResponse({req:e,nextConfig:S,cacheKey:O,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:E,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:T,responseGenerator:l,waitUntil:n.waitUntil,isMinimalMode:K});if(!I)return null;if((null==c||null==(a=c.value)?void 0:a.kind)!==v.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==c||null==(i=c.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});K||t.setHeader("x-nextjs-cache",C?"REVALIDATED":c.isMiss?"MISS":c.isStale?"STALE":"HIT"),k&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let u=(0,h.fromNodeOutgoingHttpHeaders)(c.value.headers);return K&&I||u.delete(x.NEXT_CACHE_TAGS_HEADER),!c.cacheControl||t.getHeader("Cache-Control")||u.get("Cache-Control")||u.set("Cache-Control",(0,m.getCacheControlHeader)(c.cacheControl)),await (0,p.sendResponse)(G,J,new Response(c.value.body,{headers:u,status:c.value.status||200})),null};L&&H?await i(H):(s=F.getActiveScopeSpan(),await F.withPropagatedContext(e.headers,()=>F.trace(u.BaseServerSpan.handleRequest,{spanName:`${$} ${y}`,kind:a.SpanKind.SERVER,attributes:{"http.method":$,"http.target":e.url}},i),void 0,!L))}catch(t){if(t instanceof f.NoFallbackError||await j.onRequestError(e,t,{routerKind:"App Router",routePath:q,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,A),I)throw t;return await (0,p.sendResponse)(G,J,new Response(null,{status:500})),null}}e.s(["handler",0,C,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:k,workUnitAsyncStorage:E})},"routeModule",0,j,"serverHooks",0,A,"workAsyncStorage",0,k,"workUnitAsyncStorage",0,E],137382)},482848,e=>{e.v(e=>Promise.resolve().then(()=>e(874533)))},268548,e=>{e.v(t=>Promise.all(["server/chunks/[externals]_node_util_0xr.y7p._.js"].map(t=>e.l(t))).then(()=>t(812057)))},144264,e=>{e.v(t=>Promise.all(["server/chunks/[externals]_child_process_0pwkpv9._.js"].map(t=>e.l(t))).then(()=>t(233405)))},534777,e=>{e.v(t=>Promise.all(["server/chunks/[externals]_util_0wtvqkc._.js"].map(t=>e.l(t))).then(()=>t(224361)))},200628,e=>{e.v(e=>Promise.resolve().then(()=>e(769310)))},145135,e=>{e.v(t=>Promise.all(["server/chunks/[externals]__00yf3l2._.js","server/chunks/07-d_@anthropic-ai_claude-agent-sdk_sdk_mjs_0.721uk._.js"].map(t=>e.l(t))).then(()=>t(217040)))}];
|
|
27
|
-
|
|
28
|
-
//# sourceMappingURL=%5Broot-of-the-server%5D__0d1bhsb._.js.map
|