tower-studio 0.2.46 → 0.2.47

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.
Files changed (290) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  5. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_not-found/page/react-loadable-manifest.json +3 -3
  12. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +82 -70
  13. package/.next/standalone/.next/server/app/_not-found/page.js +2 -1
  14. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  15. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
  17. package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/harness/page/react-loadable-manifest.json +3 -3
  20. package/.next/standalone/.next/server/app/harness/page/server-reference-manifest.json +92 -80
  21. package/.next/standalone/.next/server/app/harness/page.js +2 -1
  22. package/.next/standalone/.next/server/app/harness/page.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/harness/page_client-reference-manifest.js +1 -1
  24. package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +3 -3
  25. package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +150 -138
  26. package/.next/standalone/.next/server/app/missions/page.js +5 -4
  27. package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  29. package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +3 -3
  30. package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +82 -70
  31. package/.next/standalone/.next/server/app/onboarding/page.js +2 -1
  32. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  34. package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +3 -3
  35. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +82 -70
  36. package/.next/standalone/.next/server/app/page.js +2 -1
  37. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  39. package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +3 -3
  40. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +128 -116
  41. package/.next/standalone/.next/server/app/settings/page.js +4 -3
  42. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  43. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  44. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +3 -3
  45. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +190 -178
  46. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js +3 -2
  47. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +3 -3
  50. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +166 -154
  51. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js +3 -2
  52. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  53. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  54. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page/react-loadable-manifest.json +3 -3
  55. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page/server-reference-manifest.json +86 -74
  56. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page.js +2 -1
  57. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page.js.nft.json +1 -1
  58. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page_client-reference-manifest.js +1 -1
  59. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +3 -3
  60. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +150 -138
  61. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js +3 -2
  62. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  63. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  64. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +3 -3
  65. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +162 -162
  66. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +4 -3
  67. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  68. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  69. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +3 -3
  70. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +82 -70
  71. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js +3 -2
  72. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  73. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +3 -3
  75. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +140 -140
  76. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js +3 -2
  77. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
  78. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
  79. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +4 -4
  80. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +182 -170
  81. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +6 -5
  82. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  83. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  84. package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +3 -3
  85. package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +108 -96
  86. package/.next/standalone/.next/server/app/workspaces/page.js +2 -1
  87. package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
  88. package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  89. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js +7 -7
  90. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0gr2wxq.js +1 -1
  91. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0esywxf._.js +1 -1
  92. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0kkrbn-._.js +1 -1
  93. package/.next/standalone/.next/server/chunks/_0_w835g._.js +1 -1
  94. package/.next/standalone/.next/server/chunks/src_05balzk._.js +1 -1
  95. package/.next/standalone/.next/server/chunks/src_0gif-f5._.js +1 -1
  96. package/.next/standalone/.next/server/chunks/src_0pg9w-x._.js +1 -1
  97. package/.next/standalone/.next/server/chunks/src_0vp6.co._.js +1 -1
  98. package/.next/standalone/.next/server/chunks/src_11k6i~l._.js +1 -1
  99. package/.next/standalone/.next/server/chunks/src_actions_agent-actions_ts_10q9r5b._.js +3 -3
  100. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  101. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__00qdvw7._.js +3 -0
  102. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__07rk6ic._.js → [root-of-the-server]__0282989._.js} +1 -1
  103. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0hzwoy5._.js → [root-of-the-server]__03jikql._.js} +1 -1
  104. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0trmndk._.js → [root-of-the-server]__04dod9d._.js} +1 -1
  105. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05tx27l._.js +3 -0
  106. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0m8m7vc._.js → [root-of-the-server]__07ha-7q._.js} +1 -1
  107. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07~giyb._.js +3 -0
  108. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0bx_h2u._.js → [root-of-the-server]__0872sqe._.js} +2 -2
  109. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__090y_.y._.js +1 -1
  110. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0b6hugs._.js → [root-of-the-server]__09qoc8v._.js} +1 -1
  111. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0.0m12b._.js → [root-of-the-server]__0bl842b._.js} +1 -1
  112. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0br5e7w._.js → [root-of-the-server]__0c81jqz._.js} +1 -1
  113. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dh0alq._.js +3 -0
  114. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0u3~-.g._.js → [root-of-the-server]__0fy8mj6._.js} +1 -1
  115. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0kqp70x._.js → [root-of-the-server]__0gsk~9d._.js} +1 -1
  116. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h4ltpn._.js +5 -0
  117. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0hx2p17._.js +3 -0
  118. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ie8~g5._.js +3 -0
  119. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0n02kfa._.js → [root-of-the-server]__0j1w7ro._.js} +1 -1
  120. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0esg88l._.js → [root-of-the-server]__0jxfeb6._.js} +1 -1
  121. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jymb~t._.js +1 -1
  122. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__00qzvly._.js → [root-of-the-server]__0mi.v4q._.js} +1 -1
  123. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__06sew6r._.js → [root-of-the-server]__0nell0t._.js} +1 -1
  124. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0odoa97._.js +30 -0
  125. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__12viys4._.js → [root-of-the-server]__0q8o5us._.js} +1 -1
  126. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0b6fbjv._.js → [root-of-the-server]__0qjjy1r._.js} +1 -1
  127. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rg73f.._.js +3 -0
  128. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0t3q30a._.js +3 -0
  129. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0tpho3f._.js +3 -0
  130. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0dhq_gl._.js → [root-of-the-server]__0tusyj0._.js} +1 -1
  131. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0~edc3d._.js → [root-of-the-server]__0x6eyvj._.js} +1 -1
  132. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0n3uc.v._.js → [root-of-the-server]__0xftcya._.js} +2 -2
  133. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xiiocg._.js +30 -0
  134. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0x7br99._.js → [root-of-the-server]__0znl9us._.js} +2 -2
  135. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zsnp~d._.js +1 -1
  136. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~fdua7._.js +3 -0
  137. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11fp64w._.js +1 -1
  138. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0vyl8to._.js → [root-of-the-server]__1290yo~._.js} +2 -2
  139. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12s3kky._.js +3 -0
  140. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0s_q09t._.js → [root-of-the-server]__136sh9u._.js} +1 -1
  141. package/.next/standalone/.next/server/chunks/ssr/_0-~9em3._.js +1 -1
  142. package/.next/standalone/.next/server/chunks/ssr/_0.-.0zk._.js +3 -0
  143. package/.next/standalone/.next/server/chunks/ssr/_0..h3hk._.js +1 -1
  144. package/.next/standalone/.next/server/chunks/ssr/{_0b660g4._.js → _0111pr2._.js} +1 -1
  145. package/.next/standalone/.next/server/chunks/ssr/{_0czsddm._.js → _029yl-g._.js} +1 -1
  146. package/.next/standalone/.next/server/chunks/ssr/{_0q2pep_._.js → _02mcoex._.js} +2 -2
  147. package/.next/standalone/.next/server/chunks/ssr/_02t7f2_._.js +3 -0
  148. package/.next/standalone/.next/server/chunks/ssr/{_0gomvsp._.js → _04brhyt._.js} +2 -2
  149. package/.next/standalone/.next/server/chunks/ssr/{_1118hto._.js → _08b3kyv._.js} +1 -1
  150. package/.next/standalone/.next/server/chunks/ssr/{_0-5.hgb._.js → _0a___34._.js} +2 -2
  151. package/.next/standalone/.next/server/chunks/ssr/{_0ami9yt._.js → _0b4v~ls._.js} +2 -2
  152. package/.next/standalone/.next/server/chunks/ssr/_0bdyusg._.js +6 -0
  153. package/.next/standalone/.next/server/chunks/ssr/{_0hsuip_._.js → _0c8-9m9._.js} +2 -2
  154. package/.next/standalone/.next/server/chunks/ssr/{_0j7m~u6._.js → _0gcox_6._.js} +1 -1
  155. package/.next/standalone/.next/server/chunks/ssr/{_0snv7nt._.js → _0gte_c4._.js} +1 -1
  156. package/.next/standalone/.next/server/chunks/ssr/{_0g~p9_x._.js → _0hyn4md._.js} +2 -2
  157. package/.next/standalone/.next/server/chunks/ssr/{_0l6byg1._.js → _0lqjtwo._.js} +1 -1
  158. package/.next/standalone/.next/server/chunks/ssr/_0noar.v._.js +3 -0
  159. package/.next/standalone/.next/server/chunks/ssr/_0os43sb._.js +1 -1
  160. package/.next/standalone/.next/server/chunks/ssr/{_0o_c3b2._.js → _0rilhs1._.js} +2 -2
  161. package/.next/standalone/.next/server/chunks/ssr/{_0ak77.u._.js → _0sbkase._.js} +1 -1
  162. package/.next/standalone/.next/server/chunks/ssr/{_00_h2nx._.js → _0t-0.1o._.js} +2 -2
  163. package/.next/standalone/.next/server/chunks/ssr/_0wbcp88._.js +1 -1
  164. package/.next/standalone/.next/server/chunks/ssr/{_0mmy~98._.js → _0w~~xn0._.js} +2 -2
  165. package/.next/standalone/.next/server/chunks/ssr/{_0awn2mm._.js → _0xexuoi._.js} +2 -2
  166. package/.next/standalone/.next/server/chunks/ssr/_0xu906p._.js +4 -0
  167. package/.next/standalone/.next/server/chunks/ssr/_0z-z415._.js +3 -0
  168. package/.next/standalone/.next/server/chunks/ssr/_0zx1ubq._.js +3 -0
  169. package/.next/standalone/.next/server/chunks/ssr/{_0ty4xe6._.js → _0~2k74h._.js} +1 -1
  170. package/.next/standalone/.next/server/chunks/ssr/{_0hx2o_8._.js → _0~rpgs_._.js} +2 -2
  171. package/.next/standalone/.next/server/chunks/ssr/_10a_vqn._.js +3 -0
  172. package/.next/standalone/.next/server/chunks/ssr/{_0p5ft59._.js → _10or.ne._.js} +1 -1
  173. package/.next/standalone/.next/server/chunks/ssr/_11.knhq._.js +1 -1
  174. package/.next/standalone/.next/server/chunks/ssr/{_12s8n8g._.js → _124j7aj._.js} +1 -1
  175. package/.next/standalone/.next/server/chunks/ssr/_13yv8at._.js +3 -0
  176. package/.next/standalone/.next/server/chunks/ssr/src_11j0qlp._.js +1 -1
  177. package/.next/standalone/.next/server/chunks/ssr/src_actions_07_wts6._.js +47 -0
  178. package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
  179. package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
  180. package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
  181. package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
  182. package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
  183. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
  184. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
  185. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_notes_notes-page-client_tsx_10gyo3v._.js +1 -1
  186. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
  187. package/.next/standalone/.next/server/chunks/ssr/src_components_0rowjw~._.js +1 -1
  188. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0cld9rt._.js → src_lib_0-3zx.v._.js} +1 -1
  189. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0_px2pz._.js → src_lib_00ial55._.js} +1 -1
  190. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0a.zy31._.js → src_lib_01-0ix1._.js} +1 -1
  191. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0b73q0a._.js → src_lib_01d~ml9._.js} +1 -1
  192. package/.next/standalone/.next/server/chunks/ssr/{src_lib_04nzvfd._.js → src_lib_0278czx._.js} +1 -1
  193. package/.next/standalone/.next/server/chunks/ssr/src_lib_07o.0r6._.js +3 -0
  194. package/.next/standalone/.next/server/chunks/ssr/src_lib_09jpiip._.js +3 -0
  195. package/.next/standalone/.next/server/chunks/ssr/src_lib_0bmg7ix._.js +3 -0
  196. package/.next/standalone/.next/server/chunks/ssr/src_lib_0cb~2g1._.js +3 -0
  197. package/.next/standalone/.next/server/chunks/ssr/src_lib_0fdsvpu._.js +3 -0
  198. package/.next/standalone/.next/server/chunks/ssr/src_lib_0fyrfen._.js +3 -0
  199. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0dbf2qa._.js → src_lib_0gqe-g3._.js} +1 -1
  200. package/.next/standalone/.next/server/chunks/ssr/src_lib_0ixnmd0._.js +3 -0
  201. package/.next/standalone/.next/server/chunks/ssr/src_lib_0lpxsj~._.js +1 -1
  202. package/.next/standalone/.next/server/chunks/ssr/src_lib_0pgz5n6._.js +3 -0
  203. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0h2u7a0._.js → src_lib_0tq69ek._.js} +1 -1
  204. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  205. package/.next/standalone/.next/server/pages/500.html +1 -1
  206. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  207. package/.next/standalone/.next/server/server-reference-manifest.json +1146 -1068
  208. package/.next/standalone/.next/static/chunks/{0oyskd~8~j.j7.js → 00agq5_c-.llc.js} +1 -1
  209. package/.next/standalone/.next/static/chunks/015i97g3voot2.js +2 -0
  210. package/.next/standalone/.next/static/chunks/{02v-9v~885t9c.js → 01wvj~s3skc-5.js} +1 -1
  211. package/.next/standalone/.next/static/chunks/{0.gedys.tq.~k.js → 031br6.h-zycv.js} +1 -1
  212. package/.next/standalone/.next/static/chunks/{07qijq9o5jccu.js → 054ztat09k8d8.js} +1 -1
  213. package/.next/standalone/.next/static/chunks/07f592yv~pptf.js +1 -0
  214. package/.next/standalone/.next/static/chunks/{06x7oq8_iu~9d.js → 08j4ettv1zbmn.js} +1 -1
  215. package/.next/standalone/.next/static/chunks/{03uix~1ru.ovv.js → 08kc0~d-bpqxd.js} +1 -1
  216. package/.next/standalone/.next/static/chunks/{0j5olwb~d3~3j.js → 08s_oyki61yjf.js} +1 -1
  217. package/.next/standalone/.next/static/chunks/09bc_~h466~tj.js +1 -0
  218. package/.next/standalone/.next/static/chunks/{0q1872yhybt55.js → 0_hj_1l73v-on.js} +1 -1
  219. package/.next/standalone/.next/static/chunks/{00o_eiv12t~.1.js → 0a54zbhpg7-ql.js} +1 -1
  220. package/.next/standalone/.next/static/chunks/0c2po53wqe-op.js +1 -0
  221. package/.next/standalone/.next/static/chunks/0clhvl~13pwv2.js +1 -0
  222. package/.next/standalone/.next/static/chunks/0fi1kdxrc9m~d.js +1 -0
  223. package/.next/standalone/.next/static/chunks/0j56_.0_wup.m.js +1 -0
  224. package/.next/standalone/.next/static/chunks/{17z9uivez~kp3.js → 0lokkque~1fox.js} +1 -1
  225. package/.next/standalone/.next/static/chunks/0m5k~sgt78d8a.js +1 -0
  226. package/.next/standalone/.next/static/chunks/{0d9u2xspag~4h.js → 0mzzaly9-cwhd.js} +1 -1
  227. package/.next/standalone/.next/static/chunks/0pg~fc3o64-u0.js +1 -0
  228. package/.next/standalone/.next/static/chunks/{0-kkc.ibted8y.js → 0pvc93qomwhkq.js} +1 -1
  229. package/.next/standalone/.next/static/chunks/0smoiulyzysrc.js +2 -0
  230. package/.next/standalone/.next/static/chunks/0ufatfbq87c84.js +1 -0
  231. package/.next/standalone/.next/static/chunks/{09om2gfwimh7k.js → 0ujznvfinjpzn.js} +1 -1
  232. package/.next/standalone/.next/static/chunks/{0cf7e1scao3zk.js → 0ux~8zee88x-j.js} +1 -1
  233. package/.next/standalone/.next/static/chunks/0vy01_a6xhhrr.js +1 -0
  234. package/.next/standalone/.next/static/chunks/0xd_tk4asn0qj.js +1 -0
  235. package/.next/standalone/.next/static/chunks/{12-mlz2vukuga.js → 0~l470bpaoz9f.js} +1 -1
  236. package/.next/standalone/.next/static/chunks/118j.0w2pbdea.js +1 -0
  237. package/.next/standalone/.next/static/chunks/13yfli6~6o4z~.js +1 -0
  238. package/.next/standalone/.next/static/chunks/{0t1awv68pnn-e.js → 15rlbf5rw1dd..js} +1 -1
  239. package/.next/standalone/package.json +1 -1
  240. package/dist/mcp-server.cjs +6 -0
  241. package/package.json +1 -1
  242. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0-geq20._.js +0 -3
  243. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02~hdzx._.js +0 -3
  244. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h_pt4a._.js +0 -3
  245. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0idkp76._.js +0 -3
  246. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0j4m.1s._.js +0 -3
  247. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0kmonje._.js +0 -3
  248. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lh3mlq._.js +0 -3
  249. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0muf4wq._.js +0 -49
  250. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0o5ohqy._.js +0 -47
  251. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ta_mpj._.js +0 -30
  252. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ws0_c1._.js +0 -3
  253. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~mhv4m._.js +0 -3
  254. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1013v_g._.js +0 -47
  255. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__123rmn-._.js +0 -30
  256. package/.next/standalone/.next/server/chunks/ssr/_05~lqg-._.js +0 -4
  257. package/.next/standalone/.next/server/chunks/ssr/_0771b4a._.js +0 -47
  258. package/.next/standalone/.next/server/chunks/ssr/_0fmko25._.js +0 -3
  259. package/.next/standalone/.next/server/chunks/ssr/_0hg~.4w._.js +0 -6
  260. package/.next/standalone/.next/server/chunks/ssr/_0nrxhfb._.js +0 -47
  261. package/.next/standalone/.next/server/chunks/ssr/_0vkl7.h._.js +0 -47
  262. package/.next/standalone/.next/server/chunks/ssr/_0x09t_o._.js +0 -47
  263. package/.next/standalone/.next/server/chunks/ssr/_0zn.4bi._.js +0 -47
  264. package/.next/standalone/.next/server/chunks/ssr/_1086w4p._.js +0 -47
  265. package/.next/standalone/.next/server/chunks/ssr/src_lib_0er7rzd._.js +0 -3
  266. package/.next/standalone/.next/server/chunks/ssr/src_lib_0f0v8_~._.js +0 -3
  267. package/.next/standalone/.next/server/chunks/ssr/src_lib_0fr6fzy._.js +0 -3
  268. package/.next/standalone/.next/server/chunks/ssr/src_lib_0k04rl3._.js +0 -3
  269. package/.next/standalone/.next/server/chunks/ssr/src_lib_0sq6aqm._.js +0 -3
  270. package/.next/standalone/.next/server/chunks/ssr/src_lib_0ui-~7g._.js +0 -3
  271. package/.next/standalone/.next/server/chunks/ssr/src_lib_0z-gn78._.js +0 -3
  272. package/.next/standalone/.next/server/chunks/ssr/src_lib_13c4a4g._.js +0 -3
  273. package/.next/standalone/.next/static/chunks/00g58.es_hxli.js +0 -1
  274. package/.next/standalone/.next/static/chunks/01qtgj0xv1fsm.js +0 -2
  275. package/.next/standalone/.next/static/chunks/024euw7po0d0w.js +0 -1
  276. package/.next/standalone/.next/static/chunks/03ct4d8znb7tp.js +0 -1
  277. package/.next/standalone/.next/static/chunks/0alhq.h4~iogi.js +0 -1
  278. package/.next/standalone/.next/static/chunks/0ck~sr0nkabl~.js +0 -1
  279. package/.next/standalone/.next/static/chunks/0d1ok-v-u-xe~.js +0 -1
  280. package/.next/standalone/.next/static/chunks/0ftptcpntzaux.js +0 -1
  281. package/.next/standalone/.next/static/chunks/0gk~m5bwgoafi.js +0 -1
  282. package/.next/standalone/.next/static/chunks/0in_7s8n4lmfr.js +0 -1
  283. package/.next/standalone/.next/static/chunks/0mtrtl-jl46in.js +0 -2
  284. package/.next/standalone/.next/static/chunks/0~2l3wz-gxs2j.js +0 -1
  285. package/.next/standalone/.next/static/chunks/0~7h_a_dofg-4.js +0 -1
  286. package/.next/standalone/.next/static/chunks/15gztq9f12uhe.js +0 -1
  287. package/.next/standalone/.next/static/chunks/15ue90qe1sh-9.js +0 -1
  288. /package/.next/standalone/.next/static/{Pf_z-PYy0CJhvcyPEi-LM → dFewkdixeBoRBY6Fvw11J}/_buildManifest.js +0 -0
  289. /package/.next/standalone/.next/static/{Pf_z-PYy0CJhvcyPEi-LM → dFewkdixeBoRBY6Fvw11J}/_clientMiddlewareManifest.js +0 -0
  290. /package/.next/standalone/.next/static/{Pf_z-PYy0CJhvcyPEi-LM → dFewkdixeBoRBY6Fvw11J}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,113399,e=>{"use strict";var t=e.i(289721),s=e.i(965652),a=e.i(538059),n=e.i(821957),i=e.i(533499),r=e.i(360112),l=e.i(519455),o=e.i(793479),c=e.i(624687),d=e.i(110204),m=e.i(487486),u=e.i(699375),x=e.i(776639),g=e.i(975157),h=e.i(591540),p=e.i(386343),f=e.i(572989);let b=(0,f.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 j=e.i(645378);let v=(0,f.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 N=e.i(125177),y=e.i(256753),w=e.i(245697),k=e.i(360325),C=e.i(657153),S=e.i(232545);let T=(0,f.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 D=e.i(998626);let M=(0,f.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"}]]);var B=e.i(867533);let R=(0,f.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 L=e.i(400355),P=e.i(882651),I=e.i(181209),U=e.i(453889),F=e.i(19671),E=e.i(368490),H=e.i(240095),V=e.i(206781),z=e.i(404122),A=e.i(514798);let $=(0,A.createServerReference)("00e0f4165c3e26131b17fe500b9750040c3067f2f6",A.callServer,void 0,A.findSourceMapURL,"getAvailableTerminalApps"),K=(0,A.createServerReference)("002440c9e28ab94cdd90b58bafb6f601dc41d8d108",A.callServer,void 0,A.findSourceMapURL,"getAvailableEditors");var O=e.i(779570);let W=(0,A.createServerReference)("40e19466379d9cfbf66fdbf7fcc53b5b163b8ff584",A.callServer,void 0,A.findSourceMapURL,"createPrompt"),q=(0,A.createServerReference)("609e6d93185ca81f068f317bfa22b1a7fe0845458e",A.callServer,void 0,A.findSourceMapURL,"updatePrompt"),_=(0,A.createServerReference)("40f8a1d8e3cecafa1c8b48ae6239f0bdcedae2a59f",A.callServer,void 0,A.findSourceMapURL,"deletePrompt"),G=(0,A.createServerReference)("00012b5880c4b1b33865bea388958a7000a857741d",A.callServer,void 0,A.findSourceMapURL,"getBuiltinPrompts"),X=(0,A.createServerReference)("403a4190ffbd80617b45fc61d8a8a67e4b4a3964f6",A.callServer,void 0,A.findSourceMapURL,"saveSystemDirective"),Y=(0,A.createServerReference)("008a8f1239f29f473c63c1473a711f5e37ebd37efc",A.callServer,void 0,A.findSourceMapURL,"resetSystemDirective"),Z=(0,A.createServerReference)("00f503ecee8173ce949d0761132e2a3a885d3bf37d",A.callServer,void 0,A.findSourceMapURL,"getAvailableProviders");var J=e.i(567860);let Q=(0,f.default)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);var ee=e.i(967489);let et=(0,A.createServerReference)("00a34ff6f66d445bf99f60140f51595ec919dea805",A.callServer,void 0,A.findSourceMapURL,"getAiCapabilityConfigs"),es=(0,A.createServerReference)("6093814f04e7639e043f113c26dad5ed3b42dcf4db",A.callServer,void 0,A.findSourceMapURL,"updateAiCapabilityConfig"),ea=(0,A.createServerReference)("009c9ba31d33414315e6ebce045ad942596592deeb",A.callServer,void 0,A.findSourceMapURL,"getConnectedProviders"),en=[{slot:"summary",key:"settings.capabilitySlots.summary"},{slot:"dreaming",key:"settings.capabilitySlots.dreaming"},{slot:"analysis",key:"settings.capabilitySlots.analysis"},{slot:"assistant",key:"settings.capabilitySlots.assistant"}];function ei(){let{t:e}=(0,i.useI18n)(),[a,n]=(0,s.useState)([]),[l,o]=(0,s.useState)([]),[c,d]=(0,s.useState)([]),[m,u]=(0,s.useState)(!0),[x,g]=(0,s.useTransition)();(0,s.useEffect)(()=>{let e=!0;return Promise.all([Z(),ea(),et()]).then(([t,s,a])=>{e&&(n(t),o(s),d(a))}).catch(t=>{e&&r.toast.error(t instanceof Error?t.message:String(t))}).finally(()=>{e&&u(!1)}),()=>{e=!1}},[]);let h=c.find(e=>"terminal"===e.slot),p=h?.provider??(l.includes("claude")?"claude":l[0]??"claude"),f=e=>a.find(t=>t.name===e)?.displayName??e;return m?(0,t.jsx)("div",{className:"h-32 rounded-xl bg-muted animate-pulse"}):(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-sm font-medium flex items-center gap-2",children:[(0,t.jsx)(J.Terminal,{className:"h-4 w-4"}),e("settings.capabilitySlots.title")]}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e("settings.capabilitySlots.desc")})]}),(0,t.jsxs)("div",{className:`flex items-center justify-between gap-4 ${x?"opacity-40 pointer-events-none":""}`,children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:e("settings.capabilitySlots.terminal")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:e("settings.capabilitySlots.terminalDesc")})]}),0===l.length?(0,t.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:e("settings.capabilitySlots.noConnected")}):(0,t.jsxs)(ee.Select,{value:p,onValueChange:function(t){t&&g(async()=>{try{await es("terminal",{provider:t,mode:"cli",model:null}),d(e=>{let s=e.filter(e=>"terminal"!==e.slot),a=h??{id:"",slot:"terminal",mode:"cli",model:null,createdAt:new Date,updatedAt:new Date};return[...s,{...a,slot:"terminal",provider:t,mode:"cli",model:null}]}),r.toast.success(e("settings.capabilitySlots.updated"))}catch(e){r.toast.error(e instanceof Error?e.message:String(e))}})},children:[(0,t.jsx)(ee.SelectTrigger,{className:"w-44 shrink-0",children:(0,t.jsx)("span",{className:"truncate",children:f(p)})}),(0,t.jsx)(ee.SelectContent,{children:l.map(e=>(0,t.jsx)(ee.SelectItem,{value:e,children:f(e)},e))})]})]}),(0,t.jsx)("div",{className:"space-y-2.5 border-t border-border/50 pt-3",children:en.map(s=>(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 opacity-60",children:[(0,t.jsxs)("div",{className:"text-sm font-medium flex items-center gap-1.5",children:[(0,t.jsx)(Q,{className:"h-3 w-3"}),e(s.key)]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:e("settings.capabilitySlots.claudeFixed")})]},s.slot))})]})}var er=e.i(746798),el=e.i(224277);let eo=(0,f.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 ec=e.i(631675);let ed=(0,f.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 em=e.i(922541),eu=e.i(759686),ex=e.i(487278);let eg=(0,A.createServerReference)("4091d1c52370bebd3e8d05e3278bd1ded41ec00821",A.callServer,void 0,A.findSourceMapURL,"createBackup"),eh=(0,A.createServerReference)("0095fe412d0e2677a5878a74f6a466ce8a44748d5d",A.callServer,void 0,A.findSourceMapURL,"listBackupFiles"),ep=(0,A.createServerReference)("406eb017fe97e1b8836c2d0ff73008ccb33b575bbd",A.callServer,void 0,A.findSourceMapURL,"deleteBackupFile"),ef=(0,A.createServerReference)("40833100ffb6bde731d9bc18b245a88d9bf2245ee4",A.callServer,void 0,A.findSourceMapURL,"restoreBackup"),eb=(0,A.createServerReference)("40373451bfef2452a397c143599c7c33dda0f69565",A.callServer,void 0,A.findSourceMapURL,"resetSystem"),ej=(0,A.createServerReference)("002b67095ad05477f1e9b1dc42e035b0013aa032cf",A.callServer,void 0,A.findSourceMapURL,"getBackupDir"),ev=(0,A.createServerReference)("40fb517cffb715373e30718ed55eba58e6c3a0f041",A.callServer,void 0,A.findSourceMapURL,"setBackupDir"),eN=(0,A.createServerReference)("00242e8c0e654809a46e6a5f57040da49ea7d1a25c",A.callServer,void 0,A.findSourceMapURL,"getStorageLocation"),ey=(0,A.createServerReference)("40f82f35215d57c64e195348a95941d90ac7e90cb1",A.callServer,void 0,A.findSourceMapURL,"setStorageLocation");function ew(){let{t:e,locale:n}=(0,i.useI18n)(),c=(0,a.useRouter)(),[d,m]=(0,s.useState)([]),[u,g]=(0,s.useState)(""),[h,p]=(0,s.useState)(!1),[f,b]=(0,s.useState)(null),[j,v]=(0,s.useState)(!1),[N,y]=(0,s.useState)(!0),[w,k]=(0,s.useState)(null),[C,S]=(0,s.useState)(!1),[T,M]=(0,s.useState)(""),B=(0,s.useRef)(null),[R,P]=(0,s.useState)(!1),[I,U]=(0,s.useState)(""),F=(0,s.useCallback)(async()=>{y(!0);try{let[e,t,s]=await Promise.all([eh(),ej(),eN()]);m(e),g(t),b(s)}finally{y(!1)}},[]);(0,s.useEffect)(()=>{F()},[F]);let E=async()=>{let t=T.trim()||void 0;S(!1),M(""),k("create");try{await eg(t),r.toast.success(e("settings.backup.createSuccess")),await F()}catch{r.toast.error(e("settings.backup.createError"))}finally{k(null)}},H=async t=>{if(confirm(e("settings.backup.restoreConfirm"))){k("restore");try{await ef(t),r.toast.success(e("settings.backup.restoreSuccess"),{action:{label:e("settings.backup.reload"),onClick:()=>window.location.reload()},duration:15e3}),await F()}catch{r.toast.error(e("settings.backup.restoreError"))}finally{k(null)}}},V=async t=>{if(confirm(e("settings.backup.deleteConfirm")))try{await ep(t),r.toast.success(e("settings.backup.deleteSuccess")),m(e=>e.filter(e=>e.filename!==t))}catch{r.toast.error(e("settings.backup.deleteError"))}},z=async t=>{p(!1);try{await ev(t),g(t),r.toast.success(e("settings.backup.dirSaved")),await F()}catch{r.toast.error(e("settings.backup.dirError"))}},A=async t=>{k("storage");try{let s=await ey({newPath:t});if(!s.ok)return void r.toast.error(s.error||e("settings.storage.moveError"));r.toast.success(e("settings.storage.moveSuccess",{count:String(s.moved??0)})),await F()}catch(t){r.toast.error(t instanceof Error?t.message:e("settings.storage.moveError"))}finally{k(null)}},$=async t=>{v(!1),confirm(e("settings.storage.moveConfirm"))&&await A(t)},K=async()=>{!f||f.isDefault||confirm(e("settings.storage.resetConfirm"))&&await A(f.default)},O=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();r.toast.error("Invalid backup archive"===t.error?e("settings.backup.importInvalid"):(t.error,e("settings.backup.importError")));return}r.toast.success(e("settings.backup.importSuccess")),await F()}catch{r.toast.error(e("settings.backup.importError"))}finally{k(null)}}},W=async()=>{if("RESET"===I){P(!1),U(""),k("reset");try{await eb("RESET"),r.toast.success(e("settings.backup.resetSuccess")),c.push("/")}catch{r.toast.error(e("settings.backup.resetError"))}finally{k(null)}}},q=null!==w;return(0,t.jsxs)("div",{className:"space-y-6",children:[("restore"===w||"reset"===w)&&(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)(L.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"restore"===w?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:f?.current??"…"}),f?.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)(l.Button,{variant:"ghost",onClick:()=>v(!0),disabled:"storage"===w,className:"text-xs text-muted-foreground",children:"storage"===w?(0,t.jsx)(L.Loader2,{className:"h-3 w-3 animate-spin"}):e("settings.storage.change")}),f&&!f.isDefault&&(0,t.jsx)(l.Button,{variant:"ghost",onClick:K,disabled:"storage"===w,className:"text-xs text-muted-foreground",children:e("settings.storage.reset")})]}),(0,t.jsx)(el.FolderBrowserDialog,{open:j,onOpenChange:v,onSelect:$})]}),(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:u}),(0,t.jsx)(l.Button,{variant:"ghost",onClick:()=>p(!0),className:"text-xs text-muted-foreground",children:e("settings.backup.dirChange")})]}),(0,t.jsx)(el.FolderBrowserDialog,{open:h,onOpenChange:p,onSelect:z})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Button,{onClick:()=>{M(""),S(!0)},disabled:q,className:"gap-2",children:"create"===w?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L.Loader2,{className:"h-4 w-4 animate-spin"})," ",e("settings.backup.creating")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eo,{className:"h-4 w-4"})," ",e("settings.backup.create")]})}),(0,t.jsxs)(er.Tooltip,{children:[(0,t.jsxs)(er.TooltipTrigger,{render:(0,t.jsx)(l.Button,{variant:"outline",disabled:q,onClick:()=>B.current?.click(),className:"gap-2"}),children:[(0,t.jsx)(ed,{className:"h-4 w-4"}),e("settings.backup.import")]}),(0,t.jsx)(er.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:O})]}),(0,t.jsx)(x.Dialog,{open:C,onOpenChange:S,children:(0,t.jsxs)(x.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(x.DialogHeader,{children:(0,t.jsx)(x.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)(o.Input,{value:T,onChange:e=>M(e.target.value),onKeyDown:e=>"Enter"===e.key&&E(),placeholder:e("settings.backup.createLabelPlaceholder"),className:"mt-1.5",autoFocus:!0})]}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>S(!1),children:e("common.cancel")}),(0,t.jsx)(l.Button,{onClick:E,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:e("settings.backup.create")})]})]})}),N?(0,t.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,t.jsx)(L.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):0===d.length?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 py-12 text-center",children:[(0,t.jsx)(ex.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:d.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)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-xs",onClick:()=>H(s.filename),disabled:q,className:"text-muted-foreground hover:text-foreground"}),children:(0,t.jsx)(ec.Upload,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(er.TooltipContent,{side:"bottom",sideOffset:4,children:e("settings.backup.restore")})]}),(0,t.jsxs)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-xs",onClick:()=>V(s.filename),disabled:q,className:"text-muted-foreground hover:text-rose-400"}),children:(0,t.jsx)(D.Trash2,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(er.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)(eu.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)(l.Button,{variant:"outline",onClick:()=>{U(""),P(!0)},disabled:q,className:"mt-3 border-rose-500/30 text-rose-400 hover:bg-rose-500/10 hover:text-rose-400",children:[(0,t.jsx)(em.RotateCcw,{className:"mr-2 h-3.5 w-3.5"}),e("settings.backup.reset")]})]}),(0,t.jsx)(x.Dialog,{open:R,onOpenChange:P,children:(0,t.jsxs)(x.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogTitle,{children:e("settings.backup.resetConfirmTitle")}),(0,t.jsx)(x.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)(o.Input,{value:I,onChange:e=>U(e.target.value),placeholder:"RESET",className:"mt-1.5 font-mono"})]}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>P(!1),children:e("common.cancel")}),(0,t.jsx)(l.Button,{disabled:"RESET"!==I,onClick:W,className:"border-rose-500/30 bg-rose-500/10 text-rose-400 hover:bg-rose-500/20",children:e("settings.backup.reset")})]})]})})]})}var ek=e.i(887911),eC=e.i(597746);let eS=(0,f.default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var eT=e.i(875840),eD=e.i(475958),eM=e.i(194358),eB=e.i(337822),eR=e.i(991838);let eL=[{os:"macOS",cmd:"brew install ripgrep"},{os:"Windows",cmd:"winget install BurntSushi.ripgrep"},{os:"Linux",cmd:"sudo apt install ripgrep"}];function eP({cmd:e}){let{t:a}=(0,i.useI18n)(),[n,o]=(0,s.useState)(!1),c=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)}o(!0),r.toast.success(a("common.copied")),setTimeout(()=>o(!1),1500)}catch{r.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)(l.Button,{variant:"ghost",size:"icon-xs",className:"shrink-0 text-muted-foreground","aria-label":a("common.copy"),onClick:c,children:n?(0,t.jsx)(eC.Check,{className:"h-3 w-3 text-emerald-400"}):(0,t.jsx)(eT.Copy,{className:"h-3 w-3"})})]})}function eI({extension:e}){let{t:a}=(0,i.useI18n)(),{status:n,loading:o,isInstalling:c,install:d,uninstall:m,refresh:u}=(0,eR.useExtension)(e.id),[x,g]=(0,s.useState)(!1),h=e.icon,p=n.installed,f=async()=>{let t=await d();t.success?r.toast.success(a("settings.extensions.installSuccess").replace("{name}",e.name)):r.toast.error(a("settings.extensions.installFailed").replace("{name}",e.name)+(t.error?`: ${t.error.slice(0,200)}`:""))},b=async()=>{let t=await m();t.success?r.toast.success(a("settings.extensions.uninstallSuccess").replace("{name}",e.name)):r.toast.error(a("settings.extensions.uninstallFailed").replace("{name}",e.name)+(t.error?`: ${t.error.slice(0,200)}`:""))},j=async()=>{g(!0);try{await u()}finally{g(!1)}},v=()=>{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)(h,{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:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L.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")})]}):p?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(P.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)(eS,{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:[p?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Button,{variant:"default",onClick:f,disabled:c,children:c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.reinstalling")]}):a("settings.extensions.reinstall")}),(0,t.jsx)(l.Button,{variant:"outline",onClick:b,disabled:c,children:c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.uninstalling")]}):a("settings.extensions.uninstall")})]}):e.manualInstall?(0,t.jsxs)(eB.Popover,{children:[(0,t.jsx)(eB.PopoverTrigger,{render:e=>(0,t.jsxs)(l.Button,{variant:"default",...e,children:[(0,t.jsx)(eo,{className:"h-3.5 w-3.5"}),a("settings.extensions.installViaHomepage")]})}),(0,t.jsxs)(eB.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:eL.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)(eP,{cmd:s})]},e))}),(0,t.jsx)("p",{className:"text-muted-foreground",children:a("settings.extensions.manualInstallHintAfter")}),(0,t.jsxs)("button",{type:"button",onClick:v,className:"flex items-center gap-1 self-start text-[11px] text-primary underline-offset-2 hover:underline",children:[(0,t.jsx)(eD.ExternalLink,{className:"h-3 w-3"}),a("settings.extensions.visitHomepage")]})]})]}):(0,t.jsx)(l.Button,{variant:"default",onClick:f,disabled:c,children:c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.installing")]}):a("settings.extensions.install")}),(0,t.jsxs)(l.Button,{variant:"ghost",onClick:j,disabled:x,children:[(0,t.jsx)(eM.RefreshCw,{className:`h-3.5 w-3.5 ${x?"animate-spin":""}`}),a("settings.extensions.recheck")]}),(0,t.jsxs)(l.Button,{variant:"ghost",onClick:v,children:[(0,t.jsx)(eD.ExternalLink,{className:"h-3.5 w-3.5"}),a("settings.extensions.visitHomepage")]})]})]})}function eU(){let{t:e}=(0,i.useI18n)(),s=(0,ek.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)(eI,{extension:e},e.id))})]})}e.i(508271);var eF=e.i(371385),eE=e.i(158956),eH=e.i(75566),eV=e.i(851289);let ez=["global","panels","missions"],eA=new Set(["missions.cycleBack"]);function e$({keys:e}){return(0,t.jsx)(eV.KeyCombo,{keys:e})}function eK(){let e,{t:a}=(0,i.useI18n)(),n=(0,eH.useKeymapStore)(e=>e.overrides),o=(0,eH.useKeymapStore)(e=>e.setBinding),c=(0,eH.useKeymapStore)(e=>e.resetBinding),d=(0,eH.useKeymapStore)(e=>e.resetAll),[u,g]=(0,s.useState)(null),[h,p]=(0,s.useState)(null),f=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(u){let e=requestAnimationFrame(()=>f.current?.focus());return()=>cancelAnimationFrame(e)}},[u]);let b=(0,s.useMemo)(()=>{let e=new Map;for(let t of eF.SHORTCUT_ACTIONS)for(let s of n[t.id]??[...t.defaultKeys])e.has(s)||e.set(s,t.id);return e},[n]),j=(0,s.useMemo)(()=>ez.map(e=>({group:e,actions:eF.SHORTCUT_ACTIONS.filter(t=>t.group===e&&!eA.has(t.id))})).filter(e=>e.actions.length>0),[]),v=u?(0,eF.getAction)(u):null,N=h&&u&&(e=b.get(h))&&e!==u?e:null;function y(){g(null),p(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)(l.Button,{variant:"outline",size:"sm",onClick:function(){d(),r.toast.success(a("settings.shortcuts.resetAllDone"))},children:[(0,t.jsx)(em.RotateCcw,{className:"h-3.5 w-3.5"}),a("settings.shortcuts.resetAll")]})]}),(0,t.jsx)("div",{className:"space-y-6",children:j.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)(e$,{keys:n[s=e.id]??[...(0,eF.getAction)(s).defaultKeys]}),e.configurable?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Button,{variant:"outline",size:"sm",onClick:()=>{var t;return t=e.id,void(p(null),g(t))},children:a("settings.shortcuts.rebind")}),i&&(0,t.jsxs)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>c(e.id),children:(0,t.jsx)(em.RotateCcw,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(er.TooltipContent,{children:a("settings.shortcuts.reset")})]})]}):(0,t.jsx)(m.Badge,{variant:"outline",className:"text-muted-foreground",children:a("settings.shortcuts.fixed")})]})]},e.id)})})]},e))}),(0,t.jsx)(x.Dialog,{open:null!==u,onOpenChange:e=>!e&&y(),children:(0,t.jsxs)(x.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogTitle,{children:v?a(v.descriptionKey):a("settings.shortcuts.rebind")}),(0,t.jsx)(x.DialogDescription,{children:a("settings.shortcuts.pressKey")})]}),(0,t.jsx)("textarea",{ref:f,readOnly:!0,tabIndex:0,"aria-label":a("settings.shortcuts.pressKey"),onKeyDown:e=>{e.preventDefault(),e.stopPropagation();let t=(0,eE.serializeKeyEvent)(e.nativeEvent);t&&p(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:h?(0,t.jsx)(e$,{keys:[h]}):(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:a("settings.shortcuts.pressKey")})}),N&&(0,t.jsx)("p",{className:"text-center text-xs text-amber-600 dark:text-amber-400",children:a("settings.shortcuts.conflict",{name:a((0,eF.getAction)(N).descriptionKey)})}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:y,children:a("settings.shortcuts.cancel")}),(0,t.jsx)(l.Button,{variant:"default",onClick:function(){u&&h&&(o(u,[h]),y(),r.toast.success(a("settings.shortcuts.saved")))},disabled:!h,children:a("settings.shortcuts.saveBtn")})]})]})})]})}var eO=e.i(464249),eW=e.i(579157),eq=e.i(205829),e_=e.i(59737),e_=e_,eG=e.i(960995),eG=eG;let eX=(0,f.default)("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]),eY=(0,A.createServerReference)("40dc9fc2c9c0b69d14fc779a0bb51b34232d5f18d5",A.callServer,void 0,A.findSourceMapURL,"testHarnessTarget"),eZ=["feishu","openclaw","hermes"],eJ={feishu:["feishu"],openclaw:["telegram","signal","whatsapp","discord","slack","imessage"],hermes:["telegram","discord","slack","whatsapp","signal","feishu","wechat","wecom","dingtalk","qq","matrix","email"]},eQ=[...new Set(Object.values(eJ).flat())],e0="__custom__",e1=e=>eJ[e]??[],e5={feishu:"https://open.feishu.cn/",openclaw:"https://docs.openclaw.ai/",hermes:"https://hermes-agent.nousresearch.com/docs/"};function e2(){let{t:e}=(0,i.useI18n)(),[a,n]=(0,s.useState)([]),[c,d]=(0,s.useState)(null),[m,u]=(0,s.useState)(new Set),[x,g]=(0,s.useState)(!0),[h,p]=(0,s.useTransition)(),[f,b]=(0,s.useState)(""),[j,v]=(0,s.useState)(!1),[N,y]=(0,s.useState)(null);(0,s.useEffect)(()=>{(0,H.getConfigValue)("harness.targets",[]).then(e=>{let t=(Array.isArray(e)?e:[]).map(e=>({id:e.id??crypto.randomUUID(),gateway:eZ.includes(e.gateway)?e.gateway:"feishu",downstream:e.downstream??"feishu",active:!!e.active}));t.length>0&&!t.some(e=>e.active)&&(t[0].active=!0),n(t),u(new Set(t.filter(e=>e.downstream&&!eQ.includes(e.downstream)).map(e=>e.id)))}).finally(()=>g(!1))},[]);let w=(e,t)=>n(s=>s.map(s=>s.id===e?{...s,...t}:s)),k=e=>{n(t=>{let s=t.find(t=>t.id===e)?.active,a=t.filter(t=>t.id!==e);return s&&a.length>0&&!a.some(e=>e.active)&&(a[0].active=!0),a}),c===e&&d(null)},C=(e,t)=>u(s=>{let a=new Set(s);return t?a.add(e):a.delete(e),a}),T=async()=>{try{await navigator.clipboard.writeText("你有 Playwright(浏览器自动化)能力。帮我在飞书创建一个自建应用(机器人),用于 Tower 的无人值守通知与飞书助理。请一步步来;遇到需要我登录/扫码/人工确认的地方,停下来让我操作,我弄好再继续。\n\n平台地址:公网飞书 https://open.feishu.cn/ (公司/私有化飞书换成你们自己的内网开放平台地址)。用 Playwright 打开它,让我登录(企业管理员或开发者账号)。控制台页面可能有 WAF,但你是真实浏览器,正常访问即可。\n\n步骤:\n1. 创建企业自建应用:名字填「Tower 助理」,随便传个图标。\n2. 开启机器人能力:应用内「添加应用能力」→ 启用「机器人」。(不开这个,机器人进不了群、发不了消息。)\n3. 开通权限(「权限管理」逐个搜索并勾选,名称各版本略有差异,按含义找):\n 必需:im:message(读写单聊/群消息)、im:message.group_msg(读群里全部消息,机器人收到 @ 靠它)、im:chat(获取群信息)、im:chat.members:read(读群成员、识别「谁 @ 我」)。\n 可选:task:task、wiki:wiki:readonly / wiki:node:read / wiki:node:retrieve、docx:document:readonly、drive:drive:readonly(要建飞书待办、读飞书文档/知识库才需要)。\n4. 发布版本:改完权限必须「创建版本 → 申请发布 / 上线」,否则权限不生效(最容易忘的一步)。等发布成功。\n5. 取凭据:到「凭证与基础信息」,复制 App ID(cli_ 开头)和 App Secret;并取机器人自己的 open_id(botOpenId,拿不到就标「待补」)。\n6. 建议新建一个唯一名称的专属群(如「Tower 通知」),把机器人加进去,记下群 id —— 避免同名群/人导致发错。\n7. 把 appId / appSecret / domain 配到飞书 MCP,并在 Tower「设置 → 通知 → 无人值守发送渠道」加一条渠道,点「测试」验证能收到消息。\n\n避坑:① 域名别搞反 —— 公司飞书和公网飞书是两套、凭据不通用;② 只「建了应用」不等于能用,必须开机器人能力 + 发布版本 + 拉进群三样齐;③ 别用 curl 直接抓控制台页面(有 WAF 会 403),用浏览器(Playwright)操作。\n\n(换 OpenClaw / Hermes 等其它网关:参考各自文档 https://docs.openclaw.ai/ · https://hermes-agent.nousresearch.com/docs/ ,拿到 token / webhook 后同样在 Tower 加渠道并测试。)"),r.toast.success(e("settings.harness.copied"))}catch{r.toast.error("复制失败")}},M=async e=>{if(f.trim()){v(!0),y(null);try{let t=await eY({gateway:e.gateway,downstream:e.downstream,dest:f.trim()});y(t)}catch(e){y({ok:!1,output:e instanceof Error?e.message:String(e)})}finally{v(!1)}}},B=t=>eQ.includes(t)?e(`settings.harness.ds.${t}`):t,R=({label:e,children:s})=>(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:e}),s]});return(0,t.jsxs)("div",{className:"rounded-xl border bg-card p-4 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:e("settings.harness.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e("settings.harness.desc")})]}),(0,t.jsxs)("div",{className:"space-y-2 rounded-lg bg-muted/30 px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[(0,t.jsx)(eW.Info,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("span",{children:e("settings.harness.notice")})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 pl-5 text-xs",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[e("settings.harness.docsLabel"),":"]}),eZ.map(s=>e5[s]?(0,t.jsxs)("a",{href:e5[s],target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 text-primary hover:underline",children:[e(`settings.harness.gateway.${s}`),(0,t.jsx)(eD.ExternalLink,{className:"h-3 w-3"})]},s):null),(0,t.jsxs)("button",{type:"button",onClick:T,className:"inline-flex items-center gap-1 text-primary hover:underline",children:[(0,t.jsx)(eT.Copy,{className:"h-3 w-3"}),e("settings.harness.copyPrompt")]})]})]}),x&&(0,t.jsx)(L.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"}),(0,t.jsx)("div",{className:"space-y-2",children:a.map(s=>{var a;let i,r=m.has(s.id);return c===s.id?(0,t.jsxs)("div",{className:"rounded-lg border bg-muted/30 p-3 space-y-3",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsx)(R,{label:e("settings.harness.gatewayLabel"),children:(0,t.jsxs)(ee.Select,{value:s.gateway,onValueChange:e=>{let t=e??"feishu",a=e1(t);w(s.id,{gateway:t,downstream:a.includes(s.downstream)?s.downstream:a[0]??""}),C(s.id,!1)},children:[(0,t.jsx)(ee.SelectTrigger,{className:"w-full",children:(0,t.jsx)("span",{className:"truncate",children:e(`settings.harness.gateway.${s.gateway}`)})}),(0,t.jsx)(ee.SelectContent,{children:eZ.map(s=>(0,t.jsx)(ee.SelectItem,{value:s,children:e(`settings.harness.gateway.${s}`)},s))})]})}),(0,t.jsx)(R,{label:e("settings.harness.downstreamLabel"),children:(0,t.jsxs)(ee.Select,{value:r?e0:s.downstream,onValueChange:e=>{e===e0?(C(s.id,!0),w(s.id,{downstream:""})):(C(s.id,!1),w(s.id,{downstream:e??""}))},children:[(0,t.jsx)(ee.SelectTrigger,{className:"w-full",children:(0,t.jsx)("span",{className:"truncate",children:r?e("settings.harness.ds.custom"):s.downstream?B(s.downstream):e("settings.harness.downstreamPlaceholder")})}),(0,t.jsxs)(ee.SelectContent,{children:[e1(s.gateway).map(s=>(0,t.jsx)(ee.SelectItem,{value:s,children:e(`settings.harness.ds.${s}`)},s)),"feishu"!==s.gateway&&(0,t.jsx)(ee.SelectItem,{value:e0,children:e("settings.harness.ds.custom")})]})]})})]}),r&&(0,t.jsx)(R,{label:e("settings.harness.customLabel"),children:(0,t.jsx)(o.Input,{value:s.downstream,onChange:e=>w(s.id,{downstream:e.target.value}),placeholder:e("settings.harness.customPlaceholder")})}),(0,t.jsx)(R,{label:e("settings.harness.test"),children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Input,{value:f,onChange:e=>b(e.target.value),placeholder:e("settings.harness.testDestPlaceholder"),className:"flex-1"}),(0,t.jsxs)(l.Button,{variant:"outline",onClick:()=>M(s),disabled:j||!f.trim(),children:[j?(0,t.jsx)(L.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(eq.Send,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:j?e("settings.harness.testing"):e("settings.harness.testSend")})]})]}),N&&(0,t.jsxs)("div",{className:`flex items-start gap-1.5 rounded bg-muted/40 px-2 py-1 text-xs ${N.ok?"text-emerald-500":"text-rose-400"}`,children:[N.ok?(0,t.jsx)(e_.default,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}):(0,t.jsx)(eG.default,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("span",{className:"whitespace-pre-wrap break-words",children:N.ok?e("settings.harness.testOk"):`${e("settings.harness.testFail")}:${N.output}`})]})]})}),(0,t.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,t.jsxs)(l.Button,{onClick:()=>{d(null),y(null)},children:[(0,t.jsx)(eC.Check,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:e("settings.harness.done")})]}),(0,t.jsxs)(l.Button,{variant:"ghost",className:"text-muted-foreground",onClick:()=>k(s.id),children:[(0,t.jsx)(D.Trash2,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:e("settings.harness.remove")})]})]})]},s.id):(0,t.jsxs)("div",{className:`flex items-center gap-2.5 rounded-lg border px-3 py-2 ${s.active?"border-primary/40 bg-primary/5":"bg-muted/20"}`,children:[(0,t.jsx)("button",{type:"button",onClick:()=>{let e;return e=s.id,n(t=>t.map(t=>({...t,active:t.id===e})))},title:e("settings.harness.setActive"),className:s.active?"text-primary":"text-muted-foreground hover:text-foreground",children:s.active?(0,t.jsx)(eX,{className:"h-4 w-4"}):(0,t.jsx)(eS,{className:"h-4 w-4"})}),(0,t.jsx)("span",{className:"truncate text-sm text-foreground",children:(a=s,i=e(`settings.harness.gateway.${a.gateway}`),a.downstream?`${i} \xb7 ${B(a.downstream)}`:i)}),s.active&&(0,t.jsx)("span",{className:"shrink-0 rounded-full bg-primary/15 px-2 py-0.5 text-[10px] font-medium text-primary ring-1 ring-primary/25",children:e("settings.harness.active")}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[(0,t.jsx)(l.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:()=>{d(s.id),y(null),b("")},title:e("settings.harness.edit"),children:(0,t.jsx)(eO.Pencil,{className:"h-4 w-4"})}),(0,t.jsx)(l.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:()=>k(s.id),title:e("settings.harness.remove"),children:(0,t.jsx)(D.Trash2,{className:"h-4 w-4"})})]})]},s.id)})}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(l.Button,{variant:"outline",onClick:()=>{let e=crypto.randomUUID();n(t=>[...t,{id:e,gateway:"feishu",downstream:"feishu",active:0===t.length}]),d(e),y(null)},className:"text-muted-foreground",children:[(0,t.jsx)(S.Plus,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:e("settings.harness.addTarget")})]}),(0,t.jsx)(l.Button,{onClick:()=>p(async()=>{await (0,V.setConfigValue)("harness.targets",a),d(null),r.toast.success(e("settings.harness.saved"))}),disabled:h,className:"rounded-lg",children:e("common.save")})]})]})}function e3({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,g.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 e4({label:e,description:s,children:a,className:n}){return(0,t.jsxs)("div",{className:(0,g.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 e8=[{id:"general",labelKey:"settings.general",descKey:"settings.generalDesc",icon:p.Settings,accent:"blue"},{id:"ai-tools",labelKey:"settings.aiTools.title",descKey:"settings.aiTools.cliVerificationDesc",icon:b,accent:"emerald"},{id:"prompts",labelKey:"settings.prompts",descKey:"settings.promptsDesc",icon:j.FileText,accent:"violet"},{id:"config",labelKey:"settings.config",descKey:"settings.configDesc",icon:v,accent:"amber"},{id:"extensions",labelKey:"settings.extensions.title",descKey:"settings.extensions.navDesc",icon:w.Package,accent:"indigo"},{id:"notifications",labelKey:"settings.notifications.title",descKey:"settings.notifications.navDesc",icon:N.Bell,accent:"rose"},{id:"backup",labelKey:"settings.backup.title",descKey:"settings.backup.navDesc",icon:y.HardDrive,accent:"cyan"},{id:"keyboard-shortcuts",labelKey:"settings.keyboardShortcuts",descKey:"settings.keyboardShortcutsDesc",icon:k.Keyboard,accent:"violet"}],e7={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"}},e6="ai-manager:default-cli-adapter",e9={host:"",ownerMatch:"*",localPathTemplate:"",priority:0},te=e=>e.replace(/\\/g,"/").replace(/\/+$/,"");function tt(){let e=(0,a.useRouter)(),{t:p}=(0,i.useI18n)(),{theme:f,setTheme:b}=(0,n.useTheme)(),{locale:j,setLocale:v}=(0,i.useI18n)(),[N,y]=(0,s.useState)("general"),w=(0,s.useRef)(null),[k,A]=(0,s.useState)({left:0,width:0}),[J,Q]=(0,s.useState)(!1),[ee,et]=(0,s.useState)("Terminal"),[es,ea]=(0,s.useState)([]),[en,eo]=(0,s.useState)(""),[ec,ed]=(0,s.useState)([]),[em,eu]=(0,s.useState)(13),[ex,eg]=(0,s.useState)("Menlo, Monaco, 'Courier New', monospace"),[eh,ep]=(0,s.useState)([]),[ef,eb]=(0,s.useState)("claude"),[ej,ev]=(0,s.useState)(null),[eN,ey]=(0,s.useState)({}),[ek,eC]=(0,s.useState)([]),[eS,eT]=(0,s.useState)(!1),[eD,eM]=(0,s.useState)(null),[eB,eR]=(0,s.useState)(null),[eL,eP]=(0,s.useState)(""),[eI,eF]=(0,s.useState)(""),[eE,eH]=(0,s.useState)(""),[eV,ez]=(0,s.useState)(null),[eA,e$]=(0,s.useState)(""),[eO,eW]=(0,s.useState)(!1),[eq,e_]=(0,s.useState)(!1),[eG,eX]=(0,s.useState)(!1),[eY,eZ]=(0,s.useState)([]),[eJ,eQ]=(0,s.useState)(null),[e0,e1]=(0,s.useState)({...e9}),[e5,tt]=(0,s.useState)(!1),[ts,ta]=(0,s.useState)({...e9}),[tn,ti]=(0,s.useState)(!1),[tr,tl]=(0,s.useState)(!1),[to,tc]=(0,s.useState)(0),[td,tm]=(0,s.useState)(null),[tu,tx]=(0,s.useState)(null),[tg,th]=(0,s.useState)({maxUploadMb:50,maxConcurrent:3,maxReadableMb:5,archiveDelayDays:7,taskDefaultUseWorktree:!0,taskDefaultAutoStart:!1}),[tp,tf]=(0,s.useState)({timeoutSec:30}),[tb,tj]=(0,s.useState)({resultLimit:20,allModeCap:5,debounceMs:250,snippetLength:80,codeTimeoutSec:30}),[tv,tN]=(0,s.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5}),[ty,tw]=(0,s.useState)(null),[tk,tC]=(0,s.useState)(!1),[tS,tT]=(0,s.useState)(""),[tD,tM]=(0,s.useState)(!0);(0,s.useEffect)(()=>Q(!0),[]),(0,s.useEffect)(()=>{(0,H.getConfigValue)("terminal.app","Terminal").then(et),$().then(ea),(0,H.getConfigValue)("editor.command","").then(eo),K().then(ed),(0,H.getConfigValue)("terminal.fontSize",13).then(eu),(0,H.getConfigValue)("terminal.fontFamily","Menlo, Monaco, 'Courier New', monospace").then(eg)},[]),(0,s.useEffect)(()=>{if(0===es.length||!ee||es.some(e=>e.value===ee))return;let e=es.find(e=>e.name===ee);e&&(et(e.value),(0,V.setConfigValue)("terminal.app",e.value))},[es,ee]),(0,s.useEffect)(()=>{if(0===ec.length||!en||ec.some(e=>e.command===en))return;let e=ec.find(e=>e.name===en);e&&(eo(e.command),(0,V.setConfigValue)("editor.command",e.command))},[ec,en]),(0,s.useEffect)(()=>{Z().then(ep);let e=localStorage.getItem(e6);e&&eb(e)},[]),(0,s.useEffect)(()=>{(0,O.getPrompts)().then(eC)},[]),(0,s.useEffect)(()=>{G().then(e=>{ez(e),e$(e.systemDirective)})},[]);let tB=async()=>{try{let e=await fetch("/api/internal/hooks/install");if(e.ok){let t=await e.json();tw(t)}}catch{}};async function tR(e){if(!ej){ev(e),ey(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();ey(t=>({...t,[e]:s}))}catch{ey(t=>({...t,[e]:{ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]}}))}finally{ev(null)}}}(0,s.useEffect)(()=>{(0,H.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,V.setConfigValue)("git.pathMappingRules",a)}),(0,H.getConfigValue)("hooks.autoUploadTypes",["png","jpg","jpeg","gif","webp","svg","pdf","md","txt","json"]).then(e=>{tT(e.join(", "))}),tB(),(0,z.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;th({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"]}),tf({timeoutSec:e["git.timeoutSec"]??30}),tj({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}),tN({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,H.getConfigValue)("notification.enabled",!0).then(tM)},[]);let tL=(0,s.useCallback)(()=>{eM(null),eP(""),eF(""),eH(""),eT(!0)},[]),tP=(0,s.useCallback)(e=>{eM(e),eP(e.name),eF(e.description??""),eH(e.content),eT(!0)},[]),tI=(0,s.useCallback)(async()=>{eL.trim()&&eE.trim()&&(eD?await q(eD.id,{name:eL.trim(),description:eI.trim()||void 0,content:eE.trim()}):await W({name:eL.trim(),description:eI.trim()||void 0,content:eE.trim()}),eT(!1),eC(await (0,O.getPrompts)()),e.refresh())},[eL,eI,eE,eD,e]),tU=(0,s.useCallback)(async()=>{eB&&(await _(eB),eR(null),eC(await (0,O.getPrompts)()),e.refresh())},[eB,e]),tF=(0,s.useCallback)(async()=>{eW(!0);try{await X(eA);let e=await G();ez(e),e$(e.systemDirective),e_(!1),r.toast.success(p("settings.prompts.builtin.saved"))}finally{eW(!1)}},[eA,p]),tE=(0,s.useCallback)(async()=>{eW(!0);try{let e=await Y(),t=await G();ez(t),e$(e),r.toast.info(p("settings.prompts.builtin.resetDone"))}finally{eW(!1)}},[p]),tH=async()=>{await (0,V.setConfigValue)("system.maxUploadBytes",1024*tg.maxUploadMb*1024),await (0,V.setConfigValue)("system.maxConcurrentExecutions",tg.maxConcurrent),await (0,V.setConfigValue)("system.maxReadableFileBytes",1024*tg.maxReadableMb*1024),await (0,V.setConfigValue)("board.archiveDelayDays",tg.archiveDelayDays)},tV=async()=>{await (0,V.setConfigValue)("task.defaultUseWorktree",tg.taskDefaultUseWorktree),await (0,V.setConfigValue)("task.defaultAutoStart",tg.taskDefaultAutoStart),await (0,V.setConfigValue)("task.mcpDefaultsConfigured",!0)},tz=async()=>{await (0,V.setConfigValue)("git.timeoutSec",tp.timeoutSec)},tA=async()=>{await (0,V.setConfigValue)("search.resultLimit",tb.resultLimit),await (0,V.setConfigValue)("search.allModeCap",tb.allModeCap),await (0,V.setConfigValue)("search.debounceMs",tb.debounceMs),await (0,V.setConfigValue)("search.snippetLength",tb.snippetLength),await (0,V.setConfigValue)("search.codeTimeoutSec",tb.codeTimeoutSec)},t$=async()=>{let e=Math.min(tv.minCols,tv.maxCols),t=Math.max(tv.minCols,tv.maxCols),s=Math.min(tv.minRows,tv.maxRows),a=Math.max(tv.minRows,tv.maxRows);tN({minCols:e,maxCols:t,minRows:s,maxRows:a}),await (0,V.setConfigValue)("missions.grid.minCols",e),await (0,V.setConfigValue)("missions.grid.maxCols",t),await (0,V.setConfigValue)("missions.grid.minRows",s),await (0,V.setConfigValue)("missions.grid.maxRows",a)},tK=async()=>{let e=tS.split(",").map(e=>e.trim()).filter(Boolean);await (0,V.setConfigValue)("hooks.autoUploadTypes",e)},tO=async()=>{if(ty){tC(!0);try{let e=ty.installed?"DELETE":"POST";await fetch("/api/internal/hooks/install",{method:e}),await tB()}finally{tC(!1)}}},tW=async()=>{if(!ts.host.trim()||!ts.localPathTemplate.trim())return;let e=te(ts.localPathTemplate.trim()),t=tn?`${e}/{path}`:e,s=[...eY,{id:crypto.randomUUID(),host:ts.host.trim(),ownerMatch:ts.ownerMatch.trim()||"*",localPathTemplate:t,priority:ts.priority}];await (0,V.setConfigValue)("git.pathMappingRules",s),eZ(s),ta({...e9}),ti(!1),tt(!1)},tq=async e=>{if(!e0.host.trim()||!e0.localPathTemplate.trim())return;let t=te(e0.localPathTemplate.trim()),s=tr?`${t}/{path}`:t,a=eY.map(t=>t.id===e?{...t,host:e0.host.trim(),ownerMatch:e0.ownerMatch.trim()||"*",localPathTemplate:s,priority:e0.priority}:t);await (0,V.setConfigValue)("git.pathMappingRules",a),eZ(a),eQ(null),tl(!1)},t_=async e=>{let t=eY.filter(t=>t.id!==e);await (0,V.setConfigValue)("git.pathMappingRules",t),eZ(t),tm(null)};async function tG(){let e=!tD;tM(e),await (0,V.setConfigValue)("notification.enabled",e)}let tX=(0,s.useCallback)(()=>{e.back()},[e]),tY=(0,s.useCallback)(e=>{let t=w.current;if(!t)return;let s=t.querySelector("[data-section]"),a=s?s.offsetWidth+4:140;t.scrollBy({left:"left"===e?-a:a,behavior:"smooth"})},[]);(0,s.useEffect)(()=>{let e=w.current;if(!e)return;let t=e.querySelector(`[data-section="${N}"]`);if(!t)return;let s=e.getBoundingClientRect(),a=t.getBoundingClientRect();A({left:a.left-s.left,width:a.width})},[N]);let{canScrollLeft:tZ,canScrollRight:tJ}=(0,h.useScrollOverflow)(w,[j]),tQ=e8.find(e=>e.id===N),t0=tQ?e7[tQ.accent]:e7.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:p("settings.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:p("settings.configDesc")})]}),(0,t.jsxs)(l.Button,{variant:"outline",onClick:tX,className:"gap-1.5 bg-card shadow-sm cursor-pointer",children:[(0,t.jsx)(C.X,{className:"h-3.5 w-3.5"}),"ESC"]})]}),(0,t.jsxs)("div",{className:"relative flex items-center gap-1",children:[tZ&&(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>tY("left"),className:"shrink-0","aria-label":"scroll tabs left",children:(0,t.jsx)(F.ChevronLeft,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{ref:w,className:"relative flex flex-1 gap-1 overflow-x-auto [&::-webkit-scrollbar]:hidden",children:[e8.map(e=>{let s=e.icon,a=N===e.id,n=e7[e.accent];return(0,t.jsxs)("button",{"data-section":e.id,onClick:()=>y(e.id),className:(0,g.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,g.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:p(e.labelKey)})]},e.id)}),(0,t.jsx)("div",{className:(0,g.cn)("absolute bottom-0 h-0.5 rounded-full","transition-all duration-250 ease-out",t0.indicator),style:{left:k.left,width:k.width}})]}),tJ&&(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>tY("right"),className:"shrink-0","aria-label":"scroll tabs right",children:(0,t.jsx)(E.ChevronRight,{className:"h-4 w-4"})})]})]})}),(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:[tQ&&(0,t.jsxs)("div",{className:"mb-6 flex items-start gap-4",children:[(0,t.jsx)("div",{className:(0,g.cn)("flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl","ring-1",t0.bg,t0.text,t0.ring),children:(0,t.jsx)(tQ.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:p(tQ.labelKey)}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:p(tQ.descKey)})]})]}),(0,t.jsx)("div",{className:"mb-6 border-t"}),function(){switch(N){case"general":let e;return e=[{value:"light",label:p("settings.themeLight")},{value:"dark",label:p("settings.themeDark")},{value:"system",label:p("settings.themeSystem")}],(0,t.jsxs)("div",{className:"divide-y divide-border/50",children:[(0,t.jsx)(e4,{label:p("settings.theme"),description:p("settings.themeDesc"),children:J?(0,t.jsx)(e3,{options:e,value:f??"system",onChange:e=>b(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)(e4,{label:p("settings.language"),description:p("settings.languageDesc"),children:(0,t.jsx)(e3,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}],value:j,onChange:e=>v(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:p("settings.terminal.label")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:p("settings.terminal.desc")})]}),es.length>0&&(0,t.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:es.map(e=>{let s=ee===e.value,a=(0,g.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&&(et(e.value),(0,V.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)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:n,className:a,children:e.name})}),(0,t.jsx)(er.TooltipContent,{side:"top",children:p("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:p("settings.terminalFont.label")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:p("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:[p("settings.terminalFont.size"),(0,t.jsx)("input",{type:"number",min:8,max:40,value:em,onChange:e=>{let t=Math.max(8,Math.min(40,Math.round(Number(e.target.value)||13)));eu(t),(0,V.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:[p("settings.terminalFont.family"),(0,t.jsx)("input",{type:"text",value:ex,placeholder:"Menlo, Monaco, 'Courier New', monospace",onChange:e=>eg(e.target.value),onBlur:e=>{let t=e.target.value.trim()||"Menlo, Monaco, 'Courier New', monospace";eg(t),(0,V.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:p("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:p("settings.editor.label")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:p("settings.editor.desc")})]}),ec.length>0&&(0,t.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:ec.map(e=>{let s=en===e.command,a=(0,g.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&&(eo(e.command),(0,V.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)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:n,className:a,children:e.name})}),(0,t.jsx)(er.TooltipContent,{side:"top",children:p("settings.app.notInstalled")})]},e.command)})})]})]});case"ai-tools":return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:eh.map(e=>{let s=ef===e.name,a=ej===e.name,n=eN[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)(m.Badge,{variant:"outline",children:p("label.builtin")}),s&&(0,t.jsxs)(m.Badge,{variant:"secondary",className:"shrink-0",children:[(0,t.jsx)(T,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),p("settings.prompts.default")]}),n&&(0,t.jsx)(m.Badge,{variant:n.ok?"secondary":"destructive",className:(0,g.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)(P.CheckCircle2,{className:"h-3 w-3 mr-1"}),p("settings.aiTools.testPassed")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(I.XCircle,{className:"h-3 w-3 mr-1"}),p("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)(l.Button,{variant:"outline",size:"sm",onClick:()=>{var t;eb(t=e.name),localStorage.setItem(e6,t)},children:[(0,t.jsx)(T,{className:"h-3.5 w-3.5 mr-1.5 text-muted-foreground"}),p("settings.prompts.setDefault")]}),(0,t.jsx)(l.Button,{variant:"outline",size:"sm",onClick:()=>tR(e.name),disabled:a,children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L.Loader2,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),p("settings.aiTools.testing")]}):p("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,g.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,g.cn)(s.passed?"text-foreground":"text-red-700 dark:text-red-300"),children:s.message})]},`${e.name}-${s.name}`))})})]})},e.name)})}),(0,t.jsx)(ei,{})]});case"prompts":return J?(0,t.jsxs)("div",{className:"space-y-4",children:[eV&&(0,t.jsxs)("div",{className:"space-y-4 rounded-xl border border-border/50 bg-card p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:p("settings.prompts.builtin.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("settings.prompts.builtin.desc")})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.Label,{className:"text-sm",children:p("settings.prompts.builtin.systemTitle")}),eV.systemDirectiveIsCustom&&(0,t.jsx)(m.Badge,{variant:"secondary",className:"rounded-full text-xs",children:p("settings.prompts.builtin.modified")})]}),(0,t.jsxs)(l.Button,{variant:"outline",onClick:()=>{e$(eV.systemDirective),e_(!0)},children:[(0,t.jsx)(M,{className:"h-4 w-4"}),p("settings.prompts.builtin.edit")]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.prompts.builtin.systemDesc")}),(0,t.jsx)("div",{className:"rounded-lg border border-border/50 bg-muted/30 p-3",children:(0,t.jsx)("p",{className:"line-clamp-3 whitespace-pre-wrap break-words font-mono text-xs text-muted-foreground",children:eV.systemDirective})})]}),(0,t.jsxs)("div",{className:"space-y-2 border-t border-border/50 pt-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.Label,{className:"text-sm",children:p("settings.prompts.builtin.childTitle")}),(0,t.jsx)(m.Badge,{variant:"outline",className:"rounded-full text-xs",children:p("settings.prompts.builtin.readonly")})]}),(0,t.jsxs)(l.Button,{variant:"outline",onClick:()=>eX(!0),children:[(0,t.jsx)(B.Eye,{className:"h-4 w-4"}),p("settings.prompts.builtin.view")]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.prompts.builtin.childDesc")}),(0,t.jsx)("div",{className:"rounded-lg border border-border/50 bg-muted/30 p-3",children:(0,t.jsx)("p",{className:"line-clamp-3 whitespace-pre-wrap break-words font-mono text-xs text-muted-foreground",children:eV.childReviewPrompt})})]})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border/50 bg-card p-4 space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:p("settings.prompts.custom.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("settings.prompts.custom.desc")})]}),(0,t.jsxs)(l.Button,{onClick:tL,variant:"default",className:"shrink-0",children:[(0,t.jsx)(S.Plus,{className:"h-4 w-4 mr-2"}),p("settings.prompts.newPrompt")]})]}),0===ek.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:p("settings.prompts.empty")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:p("settings.prompts.emptyHint")})]}):(0,t.jsx)("div",{className:"rounded-xl border border-border/50 divide-y divide-border/50",children:ek.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.jsx)("h4",{className:"text-sm font-medium truncate",children:e.name}),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)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>tP(e),title:p("settings.prompts.editPrompt"),children:(0,t.jsx)(M,{className:"h-4 w-4"})}),(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>eR(e.id),className:"text-destructive",title:p("settings.prompts.delete"),children:(0,t.jsx)(D.Trash2,{className:"h-4 w-4"})})]})]},e.id))})]}),(0,t.jsx)(x.Dialog,{open:eq,onOpenChange:e_,children:(0,t.jsxs)(x.DialogContent,{className:"sm:max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogTitle,{children:p("settings.prompts.builtin.systemTitle")}),(0,t.jsx)(x.DialogDescription,{children:p("settings.prompts.builtin.systemDesc")})]}),(0,t.jsx)(c.Textarea,{value:eA,onChange:e=>e$(e.target.value),className:"max-h-[60vh] min-h-[50vh] font-mono text-xs"}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:tE,disabled:eO||!eV?.systemDirectiveIsCustom,children:p("settings.prompts.builtin.resetDefault")}),(0,t.jsx)(l.Button,{variant:"default",onClick:tF,disabled:eO||eA===eV?.systemDirective,children:p("settings.prompts.save")})]})]})}),(0,t.jsx)(x.Dialog,{open:eG,onOpenChange:eX,children:(0,t.jsxs)(x.DialogContent,{className:"sm:max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogTitle,{children:p("settings.prompts.builtin.childTitle")}),(0,t.jsx)(x.DialogDescription,{children:p("settings.prompts.builtin.childDesc")})]}),(0,t.jsx)(c.Textarea,{value:eV?.childReviewPrompt??"",readOnly:!0,className:"max-h-[60vh] min-h-[50vh] font-mono text-xs bg-muted/40 cursor-default"}),(0,t.jsx)(x.DialogFooter,{children:(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>eX(!1),children:p("settings.prompts.close")})})]})}),(0,t.jsx)(x.Dialog,{open:eS,onOpenChange:eT,children:(0,t.jsxs)(x.DialogContent,{className:"sm:max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogTitle,{children:eD?p("settings.prompts.editPrompt"):p("settings.prompts.newPrompt")}),(0,t.jsx)(x.DialogDescription,{children:eD?p("settings.prompts.editPrompt"):p("settings.prompts.newPrompt")})]}),(0,t.jsxs)("div",{className:"space-y-4 py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Label,{htmlFor:"prompt-name",children:p("settings.prompts.promptName")}),(0,t.jsx)(o.Input,{id:"prompt-name",value:eL,onChange:e=>eP(e.target.value),placeholder:p("settings.prompts.promptNamePlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Label,{htmlFor:"prompt-description",children:p("settings.prompts.promptDescription")}),(0,t.jsx)(o.Input,{id:"prompt-description",value:eI,onChange:e=>eF(e.target.value),placeholder:p("settings.prompts.promptDescriptionPlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Label,{htmlFor:"prompt-content",children:p("settings.prompts.promptContent")}),(0,t.jsx)(c.Textarea,{id:"prompt-content",value:eE,onChange:e=>eH(e.target.value),placeholder:p("settings.prompts.promptContentPlaceholder"),className:"mt-1.5 max-h-[55vh] min-h-[40vh] font-mono text-sm"})]})]}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>eT(!1),children:p("settings.prompts.cancel")}),(0,t.jsx)(l.Button,{onClick:tI,disabled:!eL.trim()||!eE.trim(),children:p("settings.prompts.save")})]})]})}),(0,t.jsx)(x.Dialog,{open:!!eB,onOpenChange:e=>!e&&eR(null),children:(0,t.jsxs)(x.DialogContent,{children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogTitle,{children:p("settings.prompts.deleteConfirmTitle")}),(0,t.jsx)(x.DialogDescription,{children:p("settings.prompts.deleteConfirmMessage")})]}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>eR(null),children:p("settings.prompts.cancel")}),(0,t.jsx)(l.Button,{variant:"destructive",onClick:tU,children:p("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:p("settings.config.git.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("settings.config.git.desc")})]}),(0,t.jsxs)(l.Button,{onClick:()=>{ta({...e9}),tt(!0)},children:[(0,t.jsx)(S.Plus,{className:"mr-2 h-4 w-4"}),p("settings.config.git.addRule")]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[0!==eY.length||e5?(0,t.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:eY.map(e=>eJ===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:p("settings.config.git.host")}),(0,t.jsx)(o.Input,{value:e0.host,onChange:e=>e1(t=>({...t,host:e.target.value})),placeholder:p("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:p("settings.config.git.ownerMatch")}),(0,t.jsx)(o.Input,{value:e0.ownerMatch,onChange:e=>e1(t=>({...t,ownerMatch:e.target.value})),placeholder:p("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:p("settings.config.git.localPathTemplate")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Input,{value:e0.localPathTemplate,onChange:e=>e1(t=>({...t,localPathTemplate:e.target.value})),placeholder:p("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,t.jsxs)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:(0,t.jsx)(l.Button,{variant:tr?"default":"outline",size:"sm",type:"button",onClick:()=>tl(e=>!e),className:"shrink-0 font-mono",children:"{path}"})}),(0,t.jsx)(er.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:p("settings.config.git.pathTooltipTitle")}),(0,t.jsx)("div",{className:"opacity-80",children:p("settings.config.git.pathTooltipDetail")})]})})]}),(0,t.jsxs)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:(0,t.jsx)(l.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>tx("edit"),children:(0,t.jsx)(U.FolderOpen,{className:"h-4 w-4"})})}),(0,t.jsx)(er.TooltipContent,{children:p("settings.config.git.pickFolder")})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:tr?p("onboarding.step3.pathHintFull"):p("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:p("settings.config.git.priority")}),(0,t.jsx)(o.Input,{type:"number",value:e0.priority,onChange:e=>e1(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)(l.Button,{variant:"ghost",size:"sm",onClick:()=>{eQ(null),tl(!1)},children:p("settings.config.git.cancel")}),(0,t.jsx)(l.Button,{size:"sm",onClick:()=>tq(e.id),children:p("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)(m.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:[p("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)(l.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(eQ(e.id),e1({host:e.host,ownerMatch:e.ownerMatch,localPathTemplate:a,priority:e.priority}),tl(s))},title:p("settings.config.git.edit"),children:(0,t.jsx)(M,{className:"h-4 w-4"})}),(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>tm(e.id),className:"text-destructive",title:p("settings.config.git.delete"),children:(0,t.jsx)(D.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:p("settings.config.git.noRules")}),(0,t.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground/80",children:p("settings.config.git.noRulesFallback")})]}),e5&&(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:p("settings.config.git.host")}),(0,t.jsx)(o.Input,{value:ts.host,onChange:e=>ta(t=>({...t,host:e.target.value})),placeholder:p("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:p("settings.config.git.ownerMatch")}),(0,t.jsx)(o.Input,{value:ts.ownerMatch,onChange:e=>ta(t=>({...t,ownerMatch:e.target.value})),placeholder:p("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:p("settings.config.git.localPathTemplate")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Input,{value:ts.localPathTemplate,onChange:e=>ta(t=>({...t,localPathTemplate:e.target.value})),placeholder:p("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,t.jsxs)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:(0,t.jsx)(l.Button,{variant:tn?"default":"outline",size:"sm",type:"button",onClick:()=>ti(e=>!e),className:"shrink-0 font-mono",children:"{path}"})}),(0,t.jsx)(er.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:p("settings.config.git.pathTooltipTitle")}),(0,t.jsx)("div",{className:"opacity-80",children:p("settings.config.git.pathTooltipDetail")})]})})]}),(0,t.jsxs)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:(0,t.jsx)(l.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>tx("add"),children:(0,t.jsx)(U.FolderOpen,{className:"h-4 w-4"})})}),(0,t.jsx)(er.TooltipContent,{children:p("settings.config.git.pickFolder")})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:tn?p("onboarding.step3.pathHintFull"):p("onboarding.step3.pathHintRepo")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs font-medium",children:p("settings.config.git.priority")}),(0,t.jsx)(o.Input,{type:"number",value:ts.priority,onChange:e=>ta(t=>({...t,priority:Number(e.target.value)})),className:"text-sm w-24"})]}),ts.localPathTemplate&&(s=ts.localPathTemplate.trim().replace(/\/+$/,""),a=tn?`${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:p("onboarding.step3.previewLabel")}),(0,t.jsx)("div",{className:"flex gap-1",children:n.map((e,s)=>(0,t.jsx)("button",{type:"button",onClick:()=>tc(s),className:(0,g.cn)("rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors cursor-pointer",to===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[to].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[to].url)})]})]})]})),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(l.Button,{variant:"ghost",size:"sm",onClick:()=>tt(!1),children:p("settings.config.git.cancel")}),(0,t.jsxs)(l.Button,{size:"sm",onClick:tW,disabled:!ts.host.trim()||!ts.localPathTemplate.trim(),children:[(0,t.jsx)(R,{className:"h-3.5 w-3.5 mr-1.5"}),p("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:p("settings.config.system.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("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:p("settings.config.system.maxUpload")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.system.maxUploadHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Input,{type:"number",min:1,max:500,value:tg.maxUploadMb,onChange:e=>th(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:p("settings.config.system.maxConcurrent")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.system.maxConcurrentHint")})]}),(0,t.jsx)(o.Input,{type:"number",min:1,max:10,value:tg.maxConcurrent,onChange:e=>th(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:p("settings.config.system.maxReadable")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.system.maxReadableHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Input,{type:"number",min:1,max:50,value:tg.maxReadableMb,onChange:e=>th(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:p("settings.config.system.archiveDelay")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.system.archiveDelayHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Input,{type:"number",min:1,max:365,value:tg.archiveDelayDays,onChange:e=>th(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:p("settings.config.system.archiveDelayUnit")})]})]})]}),(0,t.jsx)(l.Button,{onClick:tH,className:"rounded-lg",children:p("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:p("settings.config.task.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("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:p("settings.config.system.taskDefaultWorktree")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.system.taskDefaultWorktreeHint")})]}),(0,t.jsx)("button",{type:"button",onClick:()=>th(e=>({...e,taskDefaultUseWorktree:!e.taskDefaultUseWorktree})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${tg.taskDefaultUseWorktree?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:tg.taskDefaultUseWorktree?p("task.worktreeYes"):p("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:p("settings.config.system.taskDefaultAutoStart")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.system.taskDefaultAutoStartHint")})]}),(0,t.jsx)("button",{type:"button",onClick:()=>th(e=>({...e,taskDefaultAutoStart:!e.taskDefaultAutoStart})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${tg.taskDefaultAutoStart?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:tg.taskDefaultAutoStart?p("task.autoStartYes"):p("task.autoStartNo")})]})]}),(0,t.jsx)(l.Button,{onClick:tV,className:"rounded-lg",children:p("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:p("settings.config.gitParams.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("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:p("settings.config.gitParams.timeout")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.gitParams.timeoutHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Input,{type:"number",min:5,max:300,value:tp.timeoutSec,onChange:e=>tf(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)(l.Button,{onClick:tz,className:"rounded-lg",children:p("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:p("settings.config.search.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("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:p("settings.config.search.resultLimit")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.search.resultLimitHint")})]}),(0,t.jsx)(o.Input,{type:"number",min:5,max:100,value:tb.resultLimit,onChange:e=>tj(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:p("settings.config.search.allModeCap")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.search.allModeCapHint")})]}),(0,t.jsx)(o.Input,{type:"number",min:1,max:20,value:tb.allModeCap,onChange:e=>tj(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:p("settings.config.search.debounceMs")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.search.debounceMsHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Input,{type:"number",min:50,max:1e3,value:tb.debounceMs,onChange:e=>tj(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:p("settings.config.search.snippetLength")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.search.snippetLengthHint")})]}),(0,t.jsx)(o.Input,{type:"number",min:20,max:500,value:tb.snippetLength,onChange:e=>tj(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:p("settings.config.search.codeTimeout")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.search.codeTimeoutHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Input,{type:"number",min:5,max:300,step:5,value:tb.codeTimeoutSec,onChange:e=>tj(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)(l.Button,{onClick:tA,className:"rounded-lg",children:p("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:p("settings.config.missions.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("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:p("settings.config.missions.minCols")}),(0,t.jsx)(o.Input,{type:"number",min:1,max:10,value:tv.minCols,onChange:e=>tN(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:p("settings.config.missions.maxCols")}),(0,t.jsx)(o.Input,{type:"number",min:1,max:10,value:tv.maxCols,onChange:e=>tN(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:p("settings.config.missions.minRows")}),(0,t.jsx)(o.Input,{type:"number",min:1,max:10,value:tv.minRows,onChange:e=>tN(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:p("settings.config.missions.maxRows")}),(0,t.jsx)(o.Input,{type:"number",min:1,max:10,value:tv.maxRows,onChange:e=>tN(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)(l.Button,{onClick:t$,className:"rounded-lg",children:p("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:p("settings.config.hooks.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("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:p("settings.config.hooks.autoUploadTypes")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.hooks.autoUploadTypesHint")})]}),(0,t.jsx)(o.Input,{value:tS,onChange:e=>tT(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)(l.Button,{onClick:tK,className:"rounded-lg",children:p("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:ty?.installed?p("settings.config.hooks.installed"):p("settings.config.hooks.notInstalled")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.hooks.installHint")})]}),(0,t.jsx)(l.Button,{variant:ty?.installed?"destructive":"default",onClick:tO,disabled:tk||!ty,className:"rounded-lg",children:ty?.installed?p("settings.config.hooks.uninstall"):p("settings.config.hooks.install")})]})]}),(0,t.jsx)(x.Dialog,{open:!!td,onOpenChange:e=>!e&&tm(null),children:(0,t.jsxs)(x.DialogContent,{children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogTitle,{children:p("settings.config.git.deleteConfirm")}),(0,t.jsx)(x.DialogDescription,{children:p("settings.config.git.deleteConfirmMessage")})]}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>tm(null),children:p("settings.config.git.cancel")}),(0,t.jsx)(l.Button,{variant:"destructive",onClick:()=>td&&t_(td),children:p("settings.config.git.delete")})]})]})})]});case"notifications":return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"rounded-xl border bg-card p-4 space-y-3",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:p("settings.notifications.systemCategory")}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:p("settings.notifications.enable")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:p("settings.notifications.enableDesc")})]}),(0,t.jsx)(u.Switch,{checked:tD,onCheckedChange:tG})]})]}),(0,t.jsx)(e2,{})]});case"backup":return(0,t.jsx)(ew,{});case"extensions":return(0,t.jsx)(eU,{});case"keyboard-shortcuts":return(0,t.jsx)(eK,{})}}()]})}),(0,t.jsx)(el.FolderBrowserDialog,{open:null!==tu,onOpenChange:e=>{e||tx(null)},onSelect:e=>{let t=te(e);"add"===tu?ta(e=>({...e,localPathTemplate:t})):"edit"===tu&&e1(e=>({...e,localPathTemplate:t})),tx(null)}})]})}e.s(["default",0,function(){return(0,t.jsx)(tt,{})}],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(360112),l=e.i(519455),o=e.i(793479),c=e.i(624687),d=e.i(110204),m=e.i(487486),u=e.i(699375),x=e.i(776639),g=e.i(975157),h=e.i(591540),p=e.i(386343),f=e.i(572989);let b=(0,f.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 j=e.i(645378);let v=(0,f.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 N=e.i(125177),y=e.i(256753),w=e.i(245697),k=e.i(360325),C=e.i(657153),S=e.i(232545);let T=(0,f.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 D=e.i(998626);let M=(0,f.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"}]]);var B=e.i(867533);let R=(0,f.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 L=e.i(400355),P=e.i(882651),I=e.i(181209),U=e.i(453889),F=e.i(19671),E=e.i(368490),H=e.i(972977),V=e.i(657535),z=e.i(912078),A=e.i(514798);let $=(0,A.createServerReference)("00778c274386fee10c6d07fa7208ebf73366110d21",A.callServer,void 0,A.findSourceMapURL,"getAvailableTerminalApps"),K=(0,A.createServerReference)("00aa596e8a642e9da3810152361d231b3773ba7ef1",A.callServer,void 0,A.findSourceMapURL,"getAvailableEditors");var O=e.i(574378);let W=(0,A.createServerReference)("4090c37dd20c2677b3504fe2b36ade239e1bed3a98",A.callServer,void 0,A.findSourceMapURL,"createPrompt"),q=(0,A.createServerReference)("60f2d33f3f63dff7c9c024b2dfa8449c54e7beeb7d",A.callServer,void 0,A.findSourceMapURL,"updatePrompt"),_=(0,A.createServerReference)("40201142c8434d2a9d8d0e9b1a740240cfb9586985",A.callServer,void 0,A.findSourceMapURL,"deletePrompt"),G=(0,A.createServerReference)("0017bb73a0a2aab62e73b999b48cf8ae58bebdade8",A.callServer,void 0,A.findSourceMapURL,"getBuiltinPrompts"),X=(0,A.createServerReference)("40400da8b2732c30eb841d6d056afb8d8f091348ff",A.callServer,void 0,A.findSourceMapURL,"saveSystemDirective"),Y=(0,A.createServerReference)("0005a8b52fd7ff55a3594b6dca6915bad94dc95210",A.callServer,void 0,A.findSourceMapURL,"resetSystemDirective"),Z=(0,A.createServerReference)("001f9294e9e0bb248e7878413b2cc8361234aeb91c",A.callServer,void 0,A.findSourceMapURL,"getAvailableProviders");var J=e.i(567860);let Q=(0,f.default)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);var ee=e.i(967489);let et=(0,A.createServerReference)("0028521a0b4fcf38aae6e0676543a7b380b2c86c14",A.callServer,void 0,A.findSourceMapURL,"getAiCapabilityConfigs"),es=(0,A.createServerReference)("6064a8a5437a018ac0f0cdedd125941869938d1ea6",A.callServer,void 0,A.findSourceMapURL,"updateAiCapabilityConfig"),ea=(0,A.createServerReference)("0055c22bfa591cefc244c9861540576efd52b47373",A.callServer,void 0,A.findSourceMapURL,"getConnectedProviders"),en=[{slot:"summary",key:"settings.capabilitySlots.summary"},{slot:"dreaming",key:"settings.capabilitySlots.dreaming"},{slot:"analysis",key:"settings.capabilitySlots.analysis"},{slot:"assistant",key:"settings.capabilitySlots.assistant"}];function ei(){let{t:e}=(0,i.useI18n)(),[a,n]=(0,s.useState)([]),[l,o]=(0,s.useState)([]),[c,d]=(0,s.useState)([]),[m,u]=(0,s.useState)(!0),[x,g]=(0,s.useTransition)();(0,s.useEffect)(()=>{let e=!0;return Promise.all([Z(),ea(),et()]).then(([t,s,a])=>{e&&(n(t),o(s),d(a))}).catch(t=>{e&&r.toast.error(t instanceof Error?t.message:String(t))}).finally(()=>{e&&u(!1)}),()=>{e=!1}},[]);let h=c.find(e=>"terminal"===e.slot),p=h?.provider??(l.includes("claude")?"claude":l[0]??"claude"),f=e=>a.find(t=>t.name===e)?.displayName??e;return m?(0,t.jsx)("div",{className:"h-32 rounded-xl bg-muted animate-pulse"}):(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"text-sm font-medium flex items-center gap-2",children:[(0,t.jsx)(J.Terminal,{className:"h-4 w-4"}),e("settings.capabilitySlots.title")]}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e("settings.capabilitySlots.desc")})]}),(0,t.jsxs)("div",{className:`flex items-center justify-between gap-4 ${x?"opacity-40 pointer-events-none":""}`,children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:e("settings.capabilitySlots.terminal")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:e("settings.capabilitySlots.terminalDesc")})]}),0===l.length?(0,t.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:e("settings.capabilitySlots.noConnected")}):(0,t.jsxs)(ee.Select,{value:p,onValueChange:function(t){t&&g(async()=>{try{await es("terminal",{provider:t,mode:"cli",model:null}),d(e=>{let s=e.filter(e=>"terminal"!==e.slot),a=h??{id:"",slot:"terminal",mode:"cli",model:null,createdAt:new Date,updatedAt:new Date};return[...s,{...a,slot:"terminal",provider:t,mode:"cli",model:null}]}),r.toast.success(e("settings.capabilitySlots.updated"))}catch(e){r.toast.error(e instanceof Error?e.message:String(e))}})},children:[(0,t.jsx)(ee.SelectTrigger,{className:"w-44 shrink-0",children:(0,t.jsx)("span",{className:"truncate",children:f(p)})}),(0,t.jsx)(ee.SelectContent,{children:l.map(e=>(0,t.jsx)(ee.SelectItem,{value:e,children:f(e)},e))})]})]}),(0,t.jsx)("div",{className:"space-y-2.5 border-t border-border/50 pt-3",children:en.map(s=>(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 opacity-60",children:[(0,t.jsxs)("div",{className:"text-sm font-medium flex items-center gap-1.5",children:[(0,t.jsx)(Q,{className:"h-3 w-3"}),e(s.key)]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:e("settings.capabilitySlots.claudeFixed")})]},s.slot))})]})}var er=e.i(746798),el=e.i(224277);let eo=(0,f.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 ec=e.i(631675);let ed=(0,f.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 em=e.i(922541),eu=e.i(759686),ex=e.i(487278);let eg=(0,A.createServerReference)("4081190646dfd19e5905cd07949d52c1db0b9cd492",A.callServer,void 0,A.findSourceMapURL,"createBackup"),eh=(0,A.createServerReference)("00fb83e94a084a727104d92f4030891ffe21394ea2",A.callServer,void 0,A.findSourceMapURL,"listBackupFiles"),ep=(0,A.createServerReference)("405b7ce520badaa31ddeeeb003d8c7ecaa75ff8ceb",A.callServer,void 0,A.findSourceMapURL,"deleteBackupFile"),ef=(0,A.createServerReference)("405fb31348735d530b2fbd1bfa3bd32338c9c00fca",A.callServer,void 0,A.findSourceMapURL,"restoreBackup"),eb=(0,A.createServerReference)("40b667c41c647e1a354912820b3477b34bfcc0ff05",A.callServer,void 0,A.findSourceMapURL,"resetSystem"),ej=(0,A.createServerReference)("00a5aad9940317624b10224648af03f34420f2f827",A.callServer,void 0,A.findSourceMapURL,"getBackupDir"),ev=(0,A.createServerReference)("4062e1805dec87d49081686a99971d70b7d081d1ba",A.callServer,void 0,A.findSourceMapURL,"setBackupDir"),eN=(0,A.createServerReference)("00f566bdb4d932daa40b6e7d5a8600739be31e9666",A.callServer,void 0,A.findSourceMapURL,"getStorageLocation"),ey=(0,A.createServerReference)("408ec1c9fc327f6f8c68102f3d511371bcc13100e7",A.callServer,void 0,A.findSourceMapURL,"setStorageLocation");function ew(){let{t:e,locale:n}=(0,i.useI18n)(),c=(0,a.useRouter)(),[d,m]=(0,s.useState)([]),[u,g]=(0,s.useState)(""),[h,p]=(0,s.useState)(!1),[f,b]=(0,s.useState)(null),[j,v]=(0,s.useState)(!1),[N,y]=(0,s.useState)(!0),[w,k]=(0,s.useState)(null),[C,S]=(0,s.useState)(!1),[T,M]=(0,s.useState)(""),B=(0,s.useRef)(null),[R,P]=(0,s.useState)(!1),[I,U]=(0,s.useState)(""),F=(0,s.useCallback)(async()=>{y(!0);try{let[e,t,s]=await Promise.all([eh(),ej(),eN()]);m(e),g(t),b(s)}finally{y(!1)}},[]);(0,s.useEffect)(()=>{F()},[F]);let E=async()=>{let t=T.trim()||void 0;S(!1),M(""),k("create");try{await eg(t),r.toast.success(e("settings.backup.createSuccess")),await F()}catch{r.toast.error(e("settings.backup.createError"))}finally{k(null)}},H=async t=>{if(confirm(e("settings.backup.restoreConfirm"))){k("restore");try{await ef(t),r.toast.success(e("settings.backup.restoreSuccess"),{action:{label:e("settings.backup.reload"),onClick:()=>window.location.reload()},duration:15e3}),await F()}catch{r.toast.error(e("settings.backup.restoreError"))}finally{k(null)}}},V=async t=>{if(confirm(e("settings.backup.deleteConfirm")))try{await ep(t),r.toast.success(e("settings.backup.deleteSuccess")),m(e=>e.filter(e=>e.filename!==t))}catch{r.toast.error(e("settings.backup.deleteError"))}},z=async t=>{p(!1);try{await ev(t),g(t),r.toast.success(e("settings.backup.dirSaved")),await F()}catch{r.toast.error(e("settings.backup.dirError"))}},A=async t=>{k("storage");try{let s=await ey({newPath:t});if(!s.ok)return void r.toast.error(s.error||e("settings.storage.moveError"));r.toast.success(e("settings.storage.moveSuccess",{count:String(s.moved??0)})),await F()}catch(t){r.toast.error(t instanceof Error?t.message:e("settings.storage.moveError"))}finally{k(null)}},$=async t=>{v(!1),confirm(e("settings.storage.moveConfirm"))&&await A(t)},K=async()=>{!f||f.isDefault||confirm(e("settings.storage.resetConfirm"))&&await A(f.default)},O=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();r.toast.error("Invalid backup archive"===t.error?e("settings.backup.importInvalid"):(t.error,e("settings.backup.importError")));return}r.toast.success(e("settings.backup.importSuccess")),await F()}catch{r.toast.error(e("settings.backup.importError"))}finally{k(null)}}},W=async()=>{if("RESET"===I){P(!1),U(""),k("reset");try{await eb("RESET"),r.toast.success(e("settings.backup.resetSuccess")),c.push("/")}catch{r.toast.error(e("settings.backup.resetError"))}finally{k(null)}}},q=null!==w;return(0,t.jsxs)("div",{className:"space-y-6",children:[("restore"===w||"reset"===w)&&(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)(L.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"restore"===w?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:f?.current??"…"}),f?.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)(l.Button,{variant:"ghost",onClick:()=>v(!0),disabled:"storage"===w,className:"text-xs text-muted-foreground",children:"storage"===w?(0,t.jsx)(L.Loader2,{className:"h-3 w-3 animate-spin"}):e("settings.storage.change")}),f&&!f.isDefault&&(0,t.jsx)(l.Button,{variant:"ghost",onClick:K,disabled:"storage"===w,className:"text-xs text-muted-foreground",children:e("settings.storage.reset")})]}),(0,t.jsx)(el.FolderBrowserDialog,{open:j,onOpenChange:v,onSelect:$})]}),(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:u}),(0,t.jsx)(l.Button,{variant:"ghost",onClick:()=>p(!0),className:"text-xs text-muted-foreground",children:e("settings.backup.dirChange")})]}),(0,t.jsx)(el.FolderBrowserDialog,{open:h,onOpenChange:p,onSelect:z})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Button,{onClick:()=>{M(""),S(!0)},disabled:q,className:"gap-2",children:"create"===w?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L.Loader2,{className:"h-4 w-4 animate-spin"})," ",e("settings.backup.creating")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eo,{className:"h-4 w-4"})," ",e("settings.backup.create")]})}),(0,t.jsxs)(er.Tooltip,{children:[(0,t.jsxs)(er.TooltipTrigger,{render:(0,t.jsx)(l.Button,{variant:"outline",disabled:q,onClick:()=>B.current?.click(),className:"gap-2"}),children:[(0,t.jsx)(ed,{className:"h-4 w-4"}),e("settings.backup.import")]}),(0,t.jsx)(er.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:O})]}),(0,t.jsx)(x.Dialog,{open:C,onOpenChange:S,children:(0,t.jsxs)(x.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(x.DialogHeader,{children:(0,t.jsx)(x.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)(o.Input,{value:T,onChange:e=>M(e.target.value),onKeyDown:e=>"Enter"===e.key&&E(),placeholder:e("settings.backup.createLabelPlaceholder"),className:"mt-1.5",autoFocus:!0})]}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>S(!1),children:e("common.cancel")}),(0,t.jsx)(l.Button,{onClick:E,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:e("settings.backup.create")})]})]})}),N?(0,t.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,t.jsx)(L.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):0===d.length?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 py-12 text-center",children:[(0,t.jsx)(ex.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:d.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)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-xs",onClick:()=>H(s.filename),disabled:q,className:"text-muted-foreground hover:text-foreground"}),children:(0,t.jsx)(ec.Upload,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(er.TooltipContent,{side:"bottom",sideOffset:4,children:e("settings.backup.restore")})]}),(0,t.jsxs)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-xs",onClick:()=>V(s.filename),disabled:q,className:"text-muted-foreground hover:text-rose-400"}),children:(0,t.jsx)(D.Trash2,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(er.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)(eu.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)(l.Button,{variant:"outline",onClick:()=>{U(""),P(!0)},disabled:q,className:"mt-3 border-rose-500/30 text-rose-400 hover:bg-rose-500/10 hover:text-rose-400",children:[(0,t.jsx)(em.RotateCcw,{className:"mr-2 h-3.5 w-3.5"}),e("settings.backup.reset")]})]}),(0,t.jsx)(x.Dialog,{open:R,onOpenChange:P,children:(0,t.jsxs)(x.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogTitle,{children:e("settings.backup.resetConfirmTitle")}),(0,t.jsx)(x.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)(o.Input,{value:I,onChange:e=>U(e.target.value),placeholder:"RESET",className:"mt-1.5 font-mono"})]}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>P(!1),children:e("common.cancel")}),(0,t.jsx)(l.Button,{disabled:"RESET"!==I,onClick:W,className:"border-rose-500/30 bg-rose-500/10 text-rose-400 hover:bg-rose-500/20",children:e("settings.backup.reset")})]})]})})]})}var ek=e.i(887911),eC=e.i(597746);let eS=(0,f.default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var eT=e.i(875840),eD=e.i(475958),eM=e.i(194358),eB=e.i(337822),eR=e.i(991838);let eL=[{os:"macOS",cmd:"brew install ripgrep"},{os:"Windows",cmd:"winget install BurntSushi.ripgrep"},{os:"Linux",cmd:"sudo apt install ripgrep"}];function eP({cmd:e}){let{t:a}=(0,i.useI18n)(),[n,o]=(0,s.useState)(!1),c=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)}o(!0),r.toast.success(a("common.copied")),setTimeout(()=>o(!1),1500)}catch{r.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)(l.Button,{variant:"ghost",size:"icon-xs",className:"shrink-0 text-muted-foreground","aria-label":a("common.copy"),onClick:c,children:n?(0,t.jsx)(eC.Check,{className:"h-3 w-3 text-emerald-400"}):(0,t.jsx)(eT.Copy,{className:"h-3 w-3"})})]})}function eI({extension:e}){let{t:a}=(0,i.useI18n)(),{status:n,loading:o,isInstalling:c,install:d,uninstall:m,refresh:u}=(0,eR.useExtension)(e.id),[x,g]=(0,s.useState)(!1),h=e.icon,p=n.installed,f=async()=>{let t=await d();t.success?r.toast.success(a("settings.extensions.installSuccess").replace("{name}",e.name)):r.toast.error(a("settings.extensions.installFailed").replace("{name}",e.name)+(t.error?`: ${t.error.slice(0,200)}`:""))},b=async()=>{let t=await m();t.success?r.toast.success(a("settings.extensions.uninstallSuccess").replace("{name}",e.name)):r.toast.error(a("settings.extensions.uninstallFailed").replace("{name}",e.name)+(t.error?`: ${t.error.slice(0,200)}`:""))},j=async()=>{g(!0);try{await u()}finally{g(!1)}},v=()=>{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)(h,{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:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L.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")})]}):p?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(P.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)(eS,{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:[p?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Button,{variant:"default",onClick:f,disabled:c,children:c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.reinstalling")]}):a("settings.extensions.reinstall")}),(0,t.jsx)(l.Button,{variant:"outline",onClick:b,disabled:c,children:c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.uninstalling")]}):a("settings.extensions.uninstall")})]}):e.manualInstall?(0,t.jsxs)(eB.Popover,{children:[(0,t.jsx)(eB.PopoverTrigger,{render:e=>(0,t.jsxs)(l.Button,{variant:"default",...e,children:[(0,t.jsx)(eo,{className:"h-3.5 w-3.5"}),a("settings.extensions.installViaHomepage")]})}),(0,t.jsxs)(eB.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:eL.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)(eP,{cmd:s})]},e))}),(0,t.jsx)("p",{className:"text-muted-foreground",children:a("settings.extensions.manualInstallHintAfter")}),(0,t.jsxs)("button",{type:"button",onClick:v,className:"flex items-center gap-1 self-start text-[11px] text-primary underline-offset-2 hover:underline",children:[(0,t.jsx)(eD.ExternalLink,{className:"h-3 w-3"}),a("settings.extensions.visitHomepage")]})]})]}):(0,t.jsx)(l.Button,{variant:"default",onClick:f,disabled:c,children:c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.installing")]}):a("settings.extensions.install")}),(0,t.jsxs)(l.Button,{variant:"ghost",onClick:j,disabled:x,children:[(0,t.jsx)(eM.RefreshCw,{className:`h-3.5 w-3.5 ${x?"animate-spin":""}`}),a("settings.extensions.recheck")]}),(0,t.jsxs)(l.Button,{variant:"ghost",onClick:v,children:[(0,t.jsx)(eD.ExternalLink,{className:"h-3.5 w-3.5"}),a("settings.extensions.visitHomepage")]})]})]})}function eU(){let{t:e}=(0,i.useI18n)(),s=(0,ek.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)(eI,{extension:e},e.id))})]})}e.i(508271);var eF=e.i(371385),eE=e.i(158956),eH=e.i(75566),eV=e.i(851289);let ez=["global","panels","missions"],eA=new Set(["missions.cycleBack"]);function e$({keys:e}){return(0,t.jsx)(eV.KeyCombo,{keys:e})}function eK(){let e,{t:a}=(0,i.useI18n)(),n=(0,eH.useKeymapStore)(e=>e.overrides),o=(0,eH.useKeymapStore)(e=>e.setBinding),c=(0,eH.useKeymapStore)(e=>e.resetBinding),d=(0,eH.useKeymapStore)(e=>e.resetAll),[u,g]=(0,s.useState)(null),[h,p]=(0,s.useState)(null),f=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(u){let e=requestAnimationFrame(()=>f.current?.focus());return()=>cancelAnimationFrame(e)}},[u]);let b=(0,s.useMemo)(()=>{let e=new Map;for(let t of eF.SHORTCUT_ACTIONS)for(let s of n[t.id]??[...t.defaultKeys])e.has(s)||e.set(s,t.id);return e},[n]),j=(0,s.useMemo)(()=>ez.map(e=>({group:e,actions:eF.SHORTCUT_ACTIONS.filter(t=>t.group===e&&!eA.has(t.id))})).filter(e=>e.actions.length>0),[]),v=u?(0,eF.getAction)(u):null,N=h&&u&&(e=b.get(h))&&e!==u?e:null;function y(){g(null),p(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)(l.Button,{variant:"outline",size:"sm",onClick:function(){d(),r.toast.success(a("settings.shortcuts.resetAllDone"))},children:[(0,t.jsx)(em.RotateCcw,{className:"h-3.5 w-3.5"}),a("settings.shortcuts.resetAll")]})]}),(0,t.jsx)("div",{className:"space-y-6",children:j.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)(e$,{keys:n[s=e.id]??[...(0,eF.getAction)(s).defaultKeys]}),e.configurable?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Button,{variant:"outline",size:"sm",onClick:()=>{var t;return t=e.id,void(p(null),g(t))},children:a("settings.shortcuts.rebind")}),i&&(0,t.jsxs)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>c(e.id),children:(0,t.jsx)(em.RotateCcw,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(er.TooltipContent,{children:a("settings.shortcuts.reset")})]})]}):(0,t.jsx)(m.Badge,{variant:"outline",className:"text-muted-foreground",children:a("settings.shortcuts.fixed")})]})]},e.id)})})]},e))}),(0,t.jsx)(x.Dialog,{open:null!==u,onOpenChange:e=>!e&&y(),children:(0,t.jsxs)(x.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogTitle,{children:v?a(v.descriptionKey):a("settings.shortcuts.rebind")}),(0,t.jsx)(x.DialogDescription,{children:a("settings.shortcuts.pressKey")})]}),(0,t.jsx)("textarea",{ref:f,readOnly:!0,tabIndex:0,"aria-label":a("settings.shortcuts.pressKey"),onKeyDown:e=>{e.preventDefault(),e.stopPropagation();let t=(0,eE.serializeKeyEvent)(e.nativeEvent);t&&p(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:h?(0,t.jsx)(e$,{keys:[h]}):(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:a("settings.shortcuts.pressKey")})}),N&&(0,t.jsx)("p",{className:"text-center text-xs text-amber-600 dark:text-amber-400",children:a("settings.shortcuts.conflict",{name:a((0,eF.getAction)(N).descriptionKey)})}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:y,children:a("settings.shortcuts.cancel")}),(0,t.jsx)(l.Button,{variant:"default",onClick:function(){u&&h&&(o(u,[h]),y(),r.toast.success(a("settings.shortcuts.saved")))},disabled:!h,children:a("settings.shortcuts.saveBtn")})]})]})})]})}var eO=e.i(464249),eW=e.i(579157),eq=e.i(205829),e_=e.i(59737),e_=e_,eG=e.i(960995),eG=eG;let eX=(0,f.default)("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]),eY=(0,A.createServerReference)("40ce353f7ed8ef76ed1e60f66cb5d4a20fa8e9b47d",A.callServer,void 0,A.findSourceMapURL,"testHarnessTarget"),eZ=["feishu","openclaw","hermes"],eJ={feishu:["feishu"],openclaw:["telegram","signal","whatsapp","discord","slack","imessage"],hermes:["telegram","discord","slack","whatsapp","signal","feishu","wechat","wecom","dingtalk","qq","matrix","email"]},eQ=[...new Set(Object.values(eJ).flat())],e0="__custom__",e1=e=>eJ[e]??[],e2={feishu:"https://open.feishu.cn/",openclaw:"https://docs.openclaw.ai/",hermes:"https://hermes-agent.nousresearch.com/docs/"};function e5(){let{t:e}=(0,i.useI18n)(),[a,n]=(0,s.useState)([]),[c,d]=(0,s.useState)(null),[m,u]=(0,s.useState)(new Set),[x,g]=(0,s.useState)(!0),[h,p]=(0,s.useTransition)(),[f,b]=(0,s.useState)(""),[j,v]=(0,s.useState)(!1),[N,y]=(0,s.useState)(null);(0,s.useEffect)(()=>{(0,H.getConfigValue)("harness.targets",[]).then(e=>{let t=(Array.isArray(e)?e:[]).map(e=>({id:e.id??crypto.randomUUID(),gateway:eZ.includes(e.gateway)?e.gateway:"feishu",downstream:e.downstream??"feishu",active:!!e.active}));t.length>0&&!t.some(e=>e.active)&&(t[0].active=!0),n(t),u(new Set(t.filter(e=>e.downstream&&!eQ.includes(e.downstream)).map(e=>e.id)))}).finally(()=>g(!1))},[]);let w=(e,t)=>n(s=>s.map(s=>s.id===e?{...s,...t}:s)),k=e=>{n(t=>{let s=t.find(t=>t.id===e)?.active,a=t.filter(t=>t.id!==e);return s&&a.length>0&&!a.some(e=>e.active)&&(a[0].active=!0),a}),c===e&&d(null)},C=(e,t)=>u(s=>{let a=new Set(s);return t?a.add(e):a.delete(e),a}),T=async()=>{try{await navigator.clipboard.writeText("你有 Playwright(浏览器自动化)能力。帮我在飞书创建一个自建应用(机器人),用于 Tower 的无人值守通知与飞书助理。请一步步来;遇到需要我登录/扫码/人工确认的地方,停下来让我操作,我弄好再继续。\n\n平台地址:公网飞书 https://open.feishu.cn/ (公司/私有化飞书换成你们自己的内网开放平台地址)。用 Playwright 打开它,让我登录(企业管理员或开发者账号)。控制台页面可能有 WAF,但你是真实浏览器,正常访问即可。\n\n步骤:\n1. 创建企业自建应用:名字填「Tower 助理」,随便传个图标。\n2. 开启机器人能力:应用内「添加应用能力」→ 启用「机器人」。(不开这个,机器人进不了群、发不了消息。)\n3. 开通权限(「权限管理」逐个搜索并勾选,名称各版本略有差异,按含义找):\n 必需:im:message(读写单聊/群消息)、im:message.group_msg(读群里全部消息,机器人收到 @ 靠它)、im:chat(获取群信息)、im:chat.members:read(读群成员、识别「谁 @ 我」)。\n 可选:task:task、wiki:wiki:readonly / wiki:node:read / wiki:node:retrieve、docx:document:readonly、drive:drive:readonly(要建飞书待办、读飞书文档/知识库才需要)。\n4. 发布版本:改完权限必须「创建版本 → 申请发布 / 上线」,否则权限不生效(最容易忘的一步)。等发布成功。\n5. 取凭据:到「凭证与基础信息」,复制 App ID(cli_ 开头)和 App Secret;并取机器人自己的 open_id(botOpenId,拿不到就标「待补」)。\n6. 建议新建一个唯一名称的专属群(如「Tower 通知」),把机器人加进去,记下群 id —— 避免同名群/人导致发错。\n7. 把 appId / appSecret / domain 配到飞书 MCP,并在 Tower「设置 → 通知 → 无人值守发送渠道」加一条渠道,点「测试」验证能收到消息。\n\n避坑:① 域名别搞反 —— 公司飞书和公网飞书是两套、凭据不通用;② 只「建了应用」不等于能用,必须开机器人能力 + 发布版本 + 拉进群三样齐;③ 别用 curl 直接抓控制台页面(有 WAF 会 403),用浏览器(Playwright)操作。\n\n(换 OpenClaw / Hermes 等其它网关:参考各自文档 https://docs.openclaw.ai/ · https://hermes-agent.nousresearch.com/docs/ ,拿到 token / webhook 后同样在 Tower 加渠道并测试。)"),r.toast.success(e("settings.harness.copied"))}catch{r.toast.error("复制失败")}},M=async e=>{if(f.trim()){v(!0),y(null);try{let t=await eY({gateway:e.gateway,downstream:e.downstream,dest:f.trim()});y(t)}catch(e){y({ok:!1,output:e instanceof Error?e.message:String(e)})}finally{v(!1)}}},B=t=>eQ.includes(t)?e(`settings.harness.ds.${t}`):t,R=({label:e,children:s})=>(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:e}),s]});return(0,t.jsxs)("div",{className:"rounded-xl border bg-card p-4 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:e("settings.harness.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e("settings.harness.desc")})]}),(0,t.jsxs)("div",{className:"space-y-2 rounded-lg bg-muted/30 px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[(0,t.jsx)(eW.Info,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("span",{children:e("settings.harness.notice")})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 pl-5 text-xs",children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[e("settings.harness.docsLabel"),":"]}),eZ.map(s=>e2[s]?(0,t.jsxs)("a",{href:e2[s],target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 text-primary hover:underline",children:[e(`settings.harness.gateway.${s}`),(0,t.jsx)(eD.ExternalLink,{className:"h-3 w-3"})]},s):null),(0,t.jsxs)("button",{type:"button",onClick:T,className:"inline-flex items-center gap-1 text-primary hover:underline",children:[(0,t.jsx)(eT.Copy,{className:"h-3 w-3"}),e("settings.harness.copyPrompt")]})]})]}),x&&(0,t.jsx)(L.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"}),(0,t.jsx)("div",{className:"space-y-2",children:a.map(s=>{var a;let i,r=m.has(s.id);return c===s.id?(0,t.jsxs)("div",{className:"rounded-lg border bg-muted/30 p-3 space-y-3",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsx)(R,{label:e("settings.harness.gatewayLabel"),children:(0,t.jsxs)(ee.Select,{value:s.gateway,onValueChange:e=>{let t=e??"feishu",a=e1(t);w(s.id,{gateway:t,downstream:a.includes(s.downstream)?s.downstream:a[0]??""}),C(s.id,!1)},children:[(0,t.jsx)(ee.SelectTrigger,{className:"w-full",children:(0,t.jsx)("span",{className:"truncate",children:e(`settings.harness.gateway.${s.gateway}`)})}),(0,t.jsx)(ee.SelectContent,{children:eZ.map(s=>(0,t.jsx)(ee.SelectItem,{value:s,children:e(`settings.harness.gateway.${s}`)},s))})]})}),(0,t.jsx)(R,{label:e("settings.harness.downstreamLabel"),children:(0,t.jsxs)(ee.Select,{value:r?e0:s.downstream,onValueChange:e=>{e===e0?(C(s.id,!0),w(s.id,{downstream:""})):(C(s.id,!1),w(s.id,{downstream:e??""}))},children:[(0,t.jsx)(ee.SelectTrigger,{className:"w-full",children:(0,t.jsx)("span",{className:"truncate",children:r?e("settings.harness.ds.custom"):s.downstream?B(s.downstream):e("settings.harness.downstreamPlaceholder")})}),(0,t.jsxs)(ee.SelectContent,{children:[e1(s.gateway).map(s=>(0,t.jsx)(ee.SelectItem,{value:s,children:e(`settings.harness.ds.${s}`)},s)),"feishu"!==s.gateway&&(0,t.jsx)(ee.SelectItem,{value:e0,children:e("settings.harness.ds.custom")})]})]})})]}),r&&(0,t.jsx)(R,{label:e("settings.harness.customLabel"),children:(0,t.jsx)(o.Input,{value:s.downstream,onChange:e=>w(s.id,{downstream:e.target.value}),placeholder:e("settings.harness.customPlaceholder")})}),(0,t.jsx)(R,{label:e("settings.harness.test"),children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Input,{value:f,onChange:e=>b(e.target.value),placeholder:e("settings.harness.testDestPlaceholder"),className:"flex-1"}),(0,t.jsxs)(l.Button,{variant:"outline",onClick:()=>M(s),disabled:j||!f.trim(),children:[j?(0,t.jsx)(L.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(eq.Send,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:j?e("settings.harness.testing"):e("settings.harness.testSend")})]})]}),N&&(0,t.jsxs)("div",{className:`flex items-start gap-1.5 rounded bg-muted/40 px-2 py-1 text-xs ${N.ok?"text-emerald-500":"text-rose-400"}`,children:[N.ok?(0,t.jsx)(e_.default,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}):(0,t.jsx)(eG.default,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("span",{className:"whitespace-pre-wrap break-words",children:N.ok?e("settings.harness.testOk"):`${e("settings.harness.testFail")}:${N.output}`})]})]})}),(0,t.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,t.jsxs)(l.Button,{onClick:()=>{d(null),y(null)},children:[(0,t.jsx)(eC.Check,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:e("settings.harness.done")})]}),(0,t.jsxs)(l.Button,{variant:"ghost",className:"text-muted-foreground",onClick:()=>k(s.id),children:[(0,t.jsx)(D.Trash2,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:e("settings.harness.remove")})]})]})]},s.id):(0,t.jsxs)("div",{className:`flex items-center gap-2.5 rounded-lg border px-3 py-2 ${s.active?"border-primary/40 bg-primary/5":"bg-muted/20"}`,children:[(0,t.jsx)("button",{type:"button",onClick:()=>{let e;return e=s.id,n(t=>t.map(t=>({...t,active:t.id===e})))},title:e("settings.harness.setActive"),className:s.active?"text-primary":"text-muted-foreground hover:text-foreground",children:s.active?(0,t.jsx)(eX,{className:"h-4 w-4"}):(0,t.jsx)(eS,{className:"h-4 w-4"})}),(0,t.jsx)("span",{className:"truncate text-sm text-foreground",children:(a=s,i=e(`settings.harness.gateway.${a.gateway}`),a.downstream?`${i} \xb7 ${B(a.downstream)}`:i)}),s.active&&(0,t.jsx)("span",{className:"shrink-0 rounded-full bg-primary/15 px-2 py-0.5 text-[10px] font-medium text-primary ring-1 ring-primary/25",children:e("settings.harness.active")}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[(0,t.jsx)(l.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:()=>{d(s.id),y(null),b("")},title:e("settings.harness.edit"),children:(0,t.jsx)(eO.Pencil,{className:"h-4 w-4"})}),(0,t.jsx)(l.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:()=>k(s.id),title:e("settings.harness.remove"),children:(0,t.jsx)(D.Trash2,{className:"h-4 w-4"})})]})]},s.id)})}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(l.Button,{variant:"outline",onClick:()=>{let e=crypto.randomUUID();n(t=>[...t,{id:e,gateway:"feishu",downstream:"feishu",active:0===t.length}]),d(e),y(null)},className:"text-muted-foreground",children:[(0,t.jsx)(S.Plus,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:e("settings.harness.addTarget")})]}),(0,t.jsx)(l.Button,{onClick:()=>p(async()=>{await (0,V.setConfigValue)("harness.targets",a),d(null),r.toast.success(e("settings.harness.saved"))}),disabled:h,className:"rounded-lg",children:e("common.save")})]})]})}function e3({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,g.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 e4({label:e,description:s,children:a,className:n}){return(0,t.jsxs)("div",{className:(0,g.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 e8=[{id:"general",labelKey:"settings.general",descKey:"settings.generalDesc",icon:p.Settings,accent:"blue"},{id:"ai-tools",labelKey:"settings.aiTools.title",descKey:"settings.aiTools.cliVerificationDesc",icon:b,accent:"emerald"},{id:"prompts",labelKey:"settings.prompts",descKey:"settings.promptsDesc",icon:j.FileText,accent:"violet"},{id:"config",labelKey:"settings.config",descKey:"settings.configDesc",icon:v,accent:"amber"},{id:"extensions",labelKey:"settings.extensions.title",descKey:"settings.extensions.navDesc",icon:w.Package,accent:"indigo"},{id:"notifications",labelKey:"settings.notifications.title",descKey:"settings.notifications.navDesc",icon:N.Bell,accent:"rose"},{id:"backup",labelKey:"settings.backup.title",descKey:"settings.backup.navDesc",icon:y.HardDrive,accent:"cyan"},{id:"keyboard-shortcuts",labelKey:"settings.keyboardShortcuts",descKey:"settings.keyboardShortcutsDesc",icon:k.Keyboard,accent:"violet"}],e7={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"}},e6="ai-manager:default-cli-adapter",e9={host:"",ownerMatch:"*",localPathTemplate:"",priority:0},te=e=>e.replace(/\\/g,"/").replace(/\/+$/,"");function tt(){let e=(0,a.useRouter)(),{t:p}=(0,i.useI18n)(),{theme:f,setTheme:b}=(0,n.useTheme)(),{locale:j,setLocale:v}=(0,i.useI18n)(),[N,y]=(0,s.useState)("general"),w=(0,s.useRef)(null),[k,A]=(0,s.useState)({left:0,width:0}),[J,Q]=(0,s.useState)(!1),[ee,et]=(0,s.useState)("Terminal"),[es,ea]=(0,s.useState)([]),[en,eo]=(0,s.useState)(""),[ec,ed]=(0,s.useState)([]),[em,eu]=(0,s.useState)(13),[ex,eg]=(0,s.useState)("Menlo, Monaco, 'Courier New', monospace"),[eh,ep]=(0,s.useState)([]),[ef,eb]=(0,s.useState)("claude"),[ej,ev]=(0,s.useState)(null),[eN,ey]=(0,s.useState)({}),[ek,eC]=(0,s.useState)([]),[eS,eT]=(0,s.useState)(!1),[eD,eM]=(0,s.useState)(null),[eB,eR]=(0,s.useState)(null),[eL,eP]=(0,s.useState)(""),[eI,eF]=(0,s.useState)(""),[eE,eH]=(0,s.useState)(""),[eV,ez]=(0,s.useState)(null),[eA,e$]=(0,s.useState)(""),[eO,eW]=(0,s.useState)(!1),[eq,e_]=(0,s.useState)(!1),[eG,eX]=(0,s.useState)(!1),[eY,eZ]=(0,s.useState)([]),[eJ,eQ]=(0,s.useState)(null),[e0,e1]=(0,s.useState)({...e9}),[e2,tt]=(0,s.useState)(!1),[ts,ta]=(0,s.useState)({...e9}),[tn,ti]=(0,s.useState)(!1),[tr,tl]=(0,s.useState)(!1),[to,tc]=(0,s.useState)(0),[td,tm]=(0,s.useState)(null),[tu,tx]=(0,s.useState)(null),[tg,th]=(0,s.useState)({maxUploadMb:50,maxConcurrent:3,maxReadableMb:5,archiveDelayDays:7,taskDefaultUseWorktree:!0,taskDefaultAutoStart:!1}),[tp,tf]=(0,s.useState)({timeoutSec:30}),[tb,tj]=(0,s.useState)({resultLimit:20,allModeCap:5,debounceMs:250,snippetLength:80,codeTimeoutSec:30}),[tv,tN]=(0,s.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5}),[ty,tw]=(0,s.useState)(null),[tk,tC]=(0,s.useState)(!1),[tS,tT]=(0,s.useState)(""),[tD,tM]=(0,s.useState)(!0);(0,s.useEffect)(()=>Q(!0),[]),(0,s.useEffect)(()=>{(0,H.getConfigValue)("terminal.app","Terminal").then(et),$().then(ea),(0,H.getConfigValue)("editor.command","").then(eo),K().then(ed),(0,H.getConfigValue)("terminal.fontSize",13).then(eu),(0,H.getConfigValue)("terminal.fontFamily","Menlo, Monaco, 'Courier New', monospace").then(eg)},[]),(0,s.useEffect)(()=>{if(0===es.length||!ee||es.some(e=>e.value===ee))return;let e=es.find(e=>e.name===ee);e&&(et(e.value),(0,V.setConfigValue)("terminal.app",e.value))},[es,ee]),(0,s.useEffect)(()=>{if(0===ec.length||!en||ec.some(e=>e.command===en))return;let e=ec.find(e=>e.name===en);e&&(eo(e.command),(0,V.setConfigValue)("editor.command",e.command))},[ec,en]),(0,s.useEffect)(()=>{Z().then(ep);let e=localStorage.getItem(e6);e&&eb(e)},[]),(0,s.useEffect)(()=>{(0,O.getPrompts)().then(eC)},[]),(0,s.useEffect)(()=>{G().then(e=>{ez(e),e$(e.systemDirective)})},[]);let tB=async()=>{try{let e=await fetch("/api/internal/hooks/install");if(e.ok){let t=await e.json();tw(t)}}catch{}};async function tR(e){if(!ej){ev(e),ey(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();ey(t=>({...t,[e]:s}))}catch{ey(t=>({...t,[e]:{ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]}}))}finally{ev(null)}}}(0,s.useEffect)(()=>{(0,H.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,V.setConfigValue)("git.pathMappingRules",a)}),(0,H.getConfigValue)("hooks.autoUploadTypes",["png","jpg","jpeg","gif","webp","svg","pdf","md","txt","json"]).then(e=>{tT(e.join(", "))}),tB(),(0,z.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;th({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"]}),tf({timeoutSec:e["git.timeoutSec"]??30}),tj({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}),tN({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,H.getConfigValue)("notification.enabled",!0).then(tM)},[]);let tL=(0,s.useCallback)(()=>{eM(null),eP(""),eF(""),eH(""),eT(!0)},[]),tP=(0,s.useCallback)(e=>{eM(e),eP(e.name),eF(e.description??""),eH(e.content),eT(!0)},[]),tI=(0,s.useCallback)(async()=>{eL.trim()&&eE.trim()&&(eD?await q(eD.id,{name:eL.trim(),description:eI.trim()||void 0,content:eE.trim()}):await W({name:eL.trim(),description:eI.trim()||void 0,content:eE.trim()}),eT(!1),eC(await (0,O.getPrompts)()),e.refresh())},[eL,eI,eE,eD,e]),tU=(0,s.useCallback)(async()=>{eB&&(await _(eB),eR(null),eC(await (0,O.getPrompts)()),e.refresh())},[eB,e]),tF=(0,s.useCallback)(async()=>{eW(!0);try{await X(eA);let e=await G();ez(e),e$(e.systemDirective),e_(!1),r.toast.success(p("settings.prompts.builtin.saved"))}finally{eW(!1)}},[eA,p]),tE=(0,s.useCallback)(async()=>{eW(!0);try{let e=await Y(),t=await G();ez(t),e$(e),r.toast.info(p("settings.prompts.builtin.resetDone"))}finally{eW(!1)}},[p]),tH=async()=>{await (0,V.setConfigValue)("system.maxUploadBytes",1024*tg.maxUploadMb*1024),await (0,V.setConfigValue)("system.maxConcurrentExecutions",tg.maxConcurrent),await (0,V.setConfigValue)("system.maxReadableFileBytes",1024*tg.maxReadableMb*1024),await (0,V.setConfigValue)("board.archiveDelayDays",tg.archiveDelayDays)},tV=async()=>{await (0,V.setConfigValue)("task.defaultUseWorktree",tg.taskDefaultUseWorktree),await (0,V.setConfigValue)("task.defaultAutoStart",tg.taskDefaultAutoStart),await (0,V.setConfigValue)("task.mcpDefaultsConfigured",!0)},tz=async()=>{await (0,V.setConfigValue)("git.timeoutSec",tp.timeoutSec)},tA=async()=>{await (0,V.setConfigValue)("search.resultLimit",tb.resultLimit),await (0,V.setConfigValue)("search.allModeCap",tb.allModeCap),await (0,V.setConfigValue)("search.debounceMs",tb.debounceMs),await (0,V.setConfigValue)("search.snippetLength",tb.snippetLength),await (0,V.setConfigValue)("search.codeTimeoutSec",tb.codeTimeoutSec)},t$=async()=>{let e=Math.min(tv.minCols,tv.maxCols),t=Math.max(tv.minCols,tv.maxCols),s=Math.min(tv.minRows,tv.maxRows),a=Math.max(tv.minRows,tv.maxRows);tN({minCols:e,maxCols:t,minRows:s,maxRows:a}),await (0,V.setConfigValue)("missions.grid.minCols",e),await (0,V.setConfigValue)("missions.grid.maxCols",t),await (0,V.setConfigValue)("missions.grid.minRows",s),await (0,V.setConfigValue)("missions.grid.maxRows",a)},tK=async()=>{let e=tS.split(",").map(e=>e.trim()).filter(Boolean);await (0,V.setConfigValue)("hooks.autoUploadTypes",e)},tO=async()=>{if(ty){tC(!0);try{let e=ty.installed?"DELETE":"POST";await fetch("/api/internal/hooks/install",{method:e}),await tB()}finally{tC(!1)}}},tW=async()=>{if(!ts.host.trim()||!ts.localPathTemplate.trim())return;let e=te(ts.localPathTemplate.trim()),t=tn?`${e}/{path}`:e,s=[...eY,{id:crypto.randomUUID(),host:ts.host.trim(),ownerMatch:ts.ownerMatch.trim()||"*",localPathTemplate:t,priority:ts.priority}];await (0,V.setConfigValue)("git.pathMappingRules",s),eZ(s),ta({...e9}),ti(!1),tt(!1)},tq=async e=>{if(!e0.host.trim()||!e0.localPathTemplate.trim())return;let t=te(e0.localPathTemplate.trim()),s=tr?`${t}/{path}`:t,a=eY.map(t=>t.id===e?{...t,host:e0.host.trim(),ownerMatch:e0.ownerMatch.trim()||"*",localPathTemplate:s,priority:e0.priority}:t);await (0,V.setConfigValue)("git.pathMappingRules",a),eZ(a),eQ(null),tl(!1)},t_=async e=>{let t=eY.filter(t=>t.id!==e);await (0,V.setConfigValue)("git.pathMappingRules",t),eZ(t),tm(null)};async function tG(){let e=!tD;tM(e),await (0,V.setConfigValue)("notification.enabled",e)}let tX=(0,s.useCallback)(()=>{e.back()},[e]),tY=(0,s.useCallback)(e=>{let t=w.current;if(!t)return;let s=t.querySelector("[data-section]"),a=s?s.offsetWidth+4:140;t.scrollBy({left:"left"===e?-a:a,behavior:"smooth"})},[]);(0,s.useEffect)(()=>{let e=w.current;if(!e)return;let t=e.querySelector(`[data-section="${N}"]`);if(!t)return;let s=e.getBoundingClientRect(),a=t.getBoundingClientRect();A({left:a.left-s.left,width:a.width})},[N]);let{canScrollLeft:tZ,canScrollRight:tJ}=(0,h.useScrollOverflow)(w,[j]),tQ=e8.find(e=>e.id===N),t0=tQ?e7[tQ.accent]:e7.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:p("settings.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:p("settings.configDesc")})]}),(0,t.jsxs)(l.Button,{variant:"outline",onClick:tX,className:"gap-1.5 bg-card shadow-sm cursor-pointer",children:[(0,t.jsx)(C.X,{className:"h-3.5 w-3.5"}),"ESC"]})]}),(0,t.jsxs)("div",{className:"relative flex items-center gap-1",children:[tZ&&(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>tY("left"),className:"shrink-0","aria-label":"scroll tabs left",children:(0,t.jsx)(F.ChevronLeft,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{ref:w,className:"relative flex flex-1 gap-1 overflow-x-auto [&::-webkit-scrollbar]:hidden",children:[e8.map(e=>{let s=e.icon,a=N===e.id,n=e7[e.accent];return(0,t.jsxs)("button",{"data-section":e.id,onClick:()=>y(e.id),className:(0,g.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,g.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:p(e.labelKey)})]},e.id)}),(0,t.jsx)("div",{className:(0,g.cn)("absolute bottom-0 h-0.5 rounded-full","transition-all duration-250 ease-out",t0.indicator),style:{left:k.left,width:k.width}})]}),tJ&&(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>tY("right"),className:"shrink-0","aria-label":"scroll tabs right",children:(0,t.jsx)(E.ChevronRight,{className:"h-4 w-4"})})]})]})}),(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:[tQ&&(0,t.jsxs)("div",{className:"mb-6 flex items-start gap-4",children:[(0,t.jsx)("div",{className:(0,g.cn)("flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl","ring-1",t0.bg,t0.text,t0.ring),children:(0,t.jsx)(tQ.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:p(tQ.labelKey)}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:p(tQ.descKey)})]})]}),(0,t.jsx)("div",{className:"mb-6 border-t"}),function(){switch(N){case"general":let e;return e=[{value:"light",label:p("settings.themeLight")},{value:"dark",label:p("settings.themeDark")},{value:"system",label:p("settings.themeSystem")}],(0,t.jsxs)("div",{className:"divide-y divide-border/50",children:[(0,t.jsx)(e4,{label:p("settings.theme"),description:p("settings.themeDesc"),children:J?(0,t.jsx)(e3,{options:e,value:f??"system",onChange:e=>b(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)(e4,{label:p("settings.language"),description:p("settings.languageDesc"),children:(0,t.jsx)(e3,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}],value:j,onChange:e=>v(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:p("settings.terminal.label")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:p("settings.terminal.desc")})]}),es.length>0&&(0,t.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:es.map(e=>{let s=ee===e.value,a=(0,g.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&&(et(e.value),(0,V.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)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:n,className:a,children:e.name})}),(0,t.jsx)(er.TooltipContent,{side:"top",children:p("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:p("settings.terminalFont.label")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:p("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:[p("settings.terminalFont.size"),(0,t.jsx)("input",{type:"number",min:8,max:40,value:em,onChange:e=>{let t=Math.max(8,Math.min(40,Math.round(Number(e.target.value)||13)));eu(t),(0,V.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:[p("settings.terminalFont.family"),(0,t.jsx)("input",{type:"text",value:ex,placeholder:"Menlo, Monaco, 'Courier New', monospace",onChange:e=>eg(e.target.value),onBlur:e=>{let t=e.target.value.trim()||"Menlo, Monaco, 'Courier New', monospace";eg(t),(0,V.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:p("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:p("settings.editor.label")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:p("settings.editor.desc")})]}),ec.length>0&&(0,t.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:ec.map(e=>{let s=en===e.command,a=(0,g.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&&(eo(e.command),(0,V.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)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:n,className:a,children:e.name})}),(0,t.jsx)(er.TooltipContent,{side:"top",children:p("settings.app.notInstalled")})]},e.command)})})]})]});case"ai-tools":return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:eh.map(e=>{let s=ef===e.name,a=ej===e.name,n=eN[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)(m.Badge,{variant:"outline",children:p("label.builtin")}),s&&(0,t.jsxs)(m.Badge,{variant:"secondary",className:"shrink-0",children:[(0,t.jsx)(T,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),p("settings.prompts.default")]}),n&&(0,t.jsx)(m.Badge,{variant:n.ok?"secondary":"destructive",className:(0,g.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)(P.CheckCircle2,{className:"h-3 w-3 mr-1"}),p("settings.aiTools.testPassed")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(I.XCircle,{className:"h-3 w-3 mr-1"}),p("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)(l.Button,{variant:"outline",size:"sm",onClick:()=>{var t;eb(t=e.name),localStorage.setItem(e6,t)},children:[(0,t.jsx)(T,{className:"h-3.5 w-3.5 mr-1.5 text-muted-foreground"}),p("settings.prompts.setDefault")]}),(0,t.jsx)(l.Button,{variant:"outline",size:"sm",onClick:()=>tR(e.name),disabled:a,children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L.Loader2,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),p("settings.aiTools.testing")]}):p("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,g.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,g.cn)(s.passed?"text-foreground":"text-red-700 dark:text-red-300"),children:s.message})]},`${e.name}-${s.name}`))})})]})},e.name)})}),(0,t.jsx)(ei,{})]});case"prompts":return J?(0,t.jsxs)("div",{className:"space-y-4",children:[eV&&(0,t.jsxs)("div",{className:"space-y-4 rounded-xl border border-border/50 bg-card p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:p("settings.prompts.builtin.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("settings.prompts.builtin.desc")})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.Label,{className:"text-sm",children:p("settings.prompts.builtin.systemTitle")}),eV.systemDirectiveIsCustom&&(0,t.jsx)(m.Badge,{variant:"secondary",className:"rounded-full text-xs",children:p("settings.prompts.builtin.modified")})]}),(0,t.jsxs)(l.Button,{variant:"outline",onClick:()=>{e$(eV.systemDirective),e_(!0)},children:[(0,t.jsx)(M,{className:"h-4 w-4"}),p("settings.prompts.builtin.edit")]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.prompts.builtin.systemDesc")}),(0,t.jsx)("div",{className:"rounded-lg border border-border/50 bg-muted/30 p-3",children:(0,t.jsx)("p",{className:"line-clamp-3 whitespace-pre-wrap break-words font-mono text-xs text-muted-foreground",children:eV.systemDirective})})]}),(0,t.jsxs)("div",{className:"space-y-2 border-t border-border/50 pt-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.Label,{className:"text-sm",children:p("settings.prompts.builtin.childTitle")}),(0,t.jsx)(m.Badge,{variant:"outline",className:"rounded-full text-xs",children:p("settings.prompts.builtin.readonly")})]}),(0,t.jsxs)(l.Button,{variant:"outline",onClick:()=>eX(!0),children:[(0,t.jsx)(B.Eye,{className:"h-4 w-4"}),p("settings.prompts.builtin.view")]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.prompts.builtin.childDesc")}),(0,t.jsx)("div",{className:"rounded-lg border border-border/50 bg-muted/30 p-3",children:(0,t.jsx)("p",{className:"line-clamp-3 whitespace-pre-wrap break-words font-mono text-xs text-muted-foreground",children:eV.childReviewPrompt})})]})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border/50 bg-card p-4 space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:p("settings.prompts.custom.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("settings.prompts.custom.desc")})]}),(0,t.jsxs)(l.Button,{onClick:tL,variant:"default",className:"shrink-0",children:[(0,t.jsx)(S.Plus,{className:"h-4 w-4 mr-2"}),p("settings.prompts.newPrompt")]})]}),0===ek.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:p("settings.prompts.empty")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:p("settings.prompts.emptyHint")})]}):(0,t.jsx)("div",{className:"rounded-xl border border-border/50 divide-y divide-border/50",children:ek.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.jsx)("h4",{className:"text-sm font-medium truncate",children:e.name}),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)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>tP(e),title:p("settings.prompts.editPrompt"),children:(0,t.jsx)(M,{className:"h-4 w-4"})}),(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>eR(e.id),className:"text-destructive",title:p("settings.prompts.delete"),children:(0,t.jsx)(D.Trash2,{className:"h-4 w-4"})})]})]},e.id))})]}),(0,t.jsx)(x.Dialog,{open:eq,onOpenChange:e_,children:(0,t.jsxs)(x.DialogContent,{className:"sm:max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogTitle,{children:p("settings.prompts.builtin.systemTitle")}),(0,t.jsx)(x.DialogDescription,{children:p("settings.prompts.builtin.systemDesc")})]}),(0,t.jsx)(c.Textarea,{value:eA,onChange:e=>e$(e.target.value),className:"max-h-[60vh] min-h-[50vh] font-mono text-xs"}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:tE,disabled:eO||!eV?.systemDirectiveIsCustom,children:p("settings.prompts.builtin.resetDefault")}),(0,t.jsx)(l.Button,{variant:"default",onClick:tF,disabled:eO||eA===eV?.systemDirective,children:p("settings.prompts.save")})]})]})}),(0,t.jsx)(x.Dialog,{open:eG,onOpenChange:eX,children:(0,t.jsxs)(x.DialogContent,{className:"sm:max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogTitle,{children:p("settings.prompts.builtin.childTitle")}),(0,t.jsx)(x.DialogDescription,{children:p("settings.prompts.builtin.childDesc")})]}),(0,t.jsx)(c.Textarea,{value:eV?.childReviewPrompt??"",readOnly:!0,className:"max-h-[60vh] min-h-[50vh] font-mono text-xs bg-muted/40 cursor-default"}),(0,t.jsx)(x.DialogFooter,{children:(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>eX(!1),children:p("settings.prompts.close")})})]})}),(0,t.jsx)(x.Dialog,{open:eS,onOpenChange:eT,children:(0,t.jsxs)(x.DialogContent,{className:"sm:max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogTitle,{children:eD?p("settings.prompts.editPrompt"):p("settings.prompts.newPrompt")}),(0,t.jsx)(x.DialogDescription,{children:eD?p("settings.prompts.editPrompt"):p("settings.prompts.newPrompt")})]}),(0,t.jsxs)("div",{className:"space-y-4 py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Label,{htmlFor:"prompt-name",children:p("settings.prompts.promptName")}),(0,t.jsx)(o.Input,{id:"prompt-name",value:eL,onChange:e=>eP(e.target.value),placeholder:p("settings.prompts.promptNamePlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Label,{htmlFor:"prompt-description",children:p("settings.prompts.promptDescription")}),(0,t.jsx)(o.Input,{id:"prompt-description",value:eI,onChange:e=>eF(e.target.value),placeholder:p("settings.prompts.promptDescriptionPlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.Label,{htmlFor:"prompt-content",children:p("settings.prompts.promptContent")}),(0,t.jsx)(c.Textarea,{id:"prompt-content",value:eE,onChange:e=>eH(e.target.value),placeholder:p("settings.prompts.promptContentPlaceholder"),className:"mt-1.5 max-h-[55vh] min-h-[40vh] font-mono text-sm"})]})]}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>eT(!1),children:p("settings.prompts.cancel")}),(0,t.jsx)(l.Button,{onClick:tI,disabled:!eL.trim()||!eE.trim(),children:p("settings.prompts.save")})]})]})}),(0,t.jsx)(x.Dialog,{open:!!eB,onOpenChange:e=>!e&&eR(null),children:(0,t.jsxs)(x.DialogContent,{children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogTitle,{children:p("settings.prompts.deleteConfirmTitle")}),(0,t.jsx)(x.DialogDescription,{children:p("settings.prompts.deleteConfirmMessage")})]}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>eR(null),children:p("settings.prompts.cancel")}),(0,t.jsx)(l.Button,{variant:"destructive",onClick:tU,children:p("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:p("settings.config.git.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("settings.config.git.desc")})]}),(0,t.jsxs)(l.Button,{onClick:()=>{ta({...e9}),tt(!0)},children:[(0,t.jsx)(S.Plus,{className:"mr-2 h-4 w-4"}),p("settings.config.git.addRule")]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[0!==eY.length||e2?(0,t.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:eY.map(e=>eJ===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:p("settings.config.git.host")}),(0,t.jsx)(o.Input,{value:e0.host,onChange:e=>e1(t=>({...t,host:e.target.value})),placeholder:p("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:p("settings.config.git.ownerMatch")}),(0,t.jsx)(o.Input,{value:e0.ownerMatch,onChange:e=>e1(t=>({...t,ownerMatch:e.target.value})),placeholder:p("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:p("settings.config.git.localPathTemplate")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Input,{value:e0.localPathTemplate,onChange:e=>e1(t=>({...t,localPathTemplate:e.target.value})),placeholder:p("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,t.jsxs)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:(0,t.jsx)(l.Button,{variant:tr?"default":"outline",size:"sm",type:"button",onClick:()=>tl(e=>!e),className:"shrink-0 font-mono",children:"{path}"})}),(0,t.jsx)(er.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:p("settings.config.git.pathTooltipTitle")}),(0,t.jsx)("div",{className:"opacity-80",children:p("settings.config.git.pathTooltipDetail")})]})})]}),(0,t.jsxs)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:(0,t.jsx)(l.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>tx("edit"),children:(0,t.jsx)(U.FolderOpen,{className:"h-4 w-4"})})}),(0,t.jsx)(er.TooltipContent,{children:p("settings.config.git.pickFolder")})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:tr?p("onboarding.step3.pathHintFull"):p("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:p("settings.config.git.priority")}),(0,t.jsx)(o.Input,{type:"number",value:e0.priority,onChange:e=>e1(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)(l.Button,{variant:"ghost",size:"sm",onClick:()=>{eQ(null),tl(!1)},children:p("settings.config.git.cancel")}),(0,t.jsx)(l.Button,{size:"sm",onClick:()=>tq(e.id),children:p("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)(m.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:[p("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)(l.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(eQ(e.id),e1({host:e.host,ownerMatch:e.ownerMatch,localPathTemplate:a,priority:e.priority}),tl(s))},title:p("settings.config.git.edit"),children:(0,t.jsx)(M,{className:"h-4 w-4"})}),(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>tm(e.id),className:"text-destructive",title:p("settings.config.git.delete"),children:(0,t.jsx)(D.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:p("settings.config.git.noRules")}),(0,t.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground/80",children:p("settings.config.git.noRulesFallback")})]}),e2&&(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:p("settings.config.git.host")}),(0,t.jsx)(o.Input,{value:ts.host,onChange:e=>ta(t=>({...t,host:e.target.value})),placeholder:p("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:p("settings.config.git.ownerMatch")}),(0,t.jsx)(o.Input,{value:ts.ownerMatch,onChange:e=>ta(t=>({...t,ownerMatch:e.target.value})),placeholder:p("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:p("settings.config.git.localPathTemplate")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Input,{value:ts.localPathTemplate,onChange:e=>ta(t=>({...t,localPathTemplate:e.target.value})),placeholder:p("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,t.jsxs)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:(0,t.jsx)(l.Button,{variant:tn?"default":"outline",size:"sm",type:"button",onClick:()=>ti(e=>!e),className:"shrink-0 font-mono",children:"{path}"})}),(0,t.jsx)(er.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:p("settings.config.git.pathTooltipTitle")}),(0,t.jsx)("div",{className:"opacity-80",children:p("settings.config.git.pathTooltipDetail")})]})})]}),(0,t.jsxs)(er.Tooltip,{children:[(0,t.jsx)(er.TooltipTrigger,{render:(0,t.jsx)(l.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>tx("add"),children:(0,t.jsx)(U.FolderOpen,{className:"h-4 w-4"})})}),(0,t.jsx)(er.TooltipContent,{children:p("settings.config.git.pickFolder")})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:tn?p("onboarding.step3.pathHintFull"):p("onboarding.step3.pathHintRepo")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs font-medium",children:p("settings.config.git.priority")}),(0,t.jsx)(o.Input,{type:"number",value:ts.priority,onChange:e=>ta(t=>({...t,priority:Number(e.target.value)})),className:"text-sm w-24"})]}),ts.localPathTemplate&&(s=ts.localPathTemplate.trim().replace(/\/+$/,""),a=tn?`${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:p("onboarding.step3.previewLabel")}),(0,t.jsx)("div",{className:"flex gap-1",children:n.map((e,s)=>(0,t.jsx)("button",{type:"button",onClick:()=>tc(s),className:(0,g.cn)("rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors cursor-pointer",to===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[to].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[to].url)})]})]})]})),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(l.Button,{variant:"ghost",size:"sm",onClick:()=>tt(!1),children:p("settings.config.git.cancel")}),(0,t.jsxs)(l.Button,{size:"sm",onClick:tW,disabled:!ts.host.trim()||!ts.localPathTemplate.trim(),children:[(0,t.jsx)(R,{className:"h-3.5 w-3.5 mr-1.5"}),p("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:p("settings.config.system.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("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:p("settings.config.system.maxUpload")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.system.maxUploadHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Input,{type:"number",min:1,max:500,value:tg.maxUploadMb,onChange:e=>th(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:p("settings.config.system.maxConcurrent")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.system.maxConcurrentHint")})]}),(0,t.jsx)(o.Input,{type:"number",min:1,max:10,value:tg.maxConcurrent,onChange:e=>th(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:p("settings.config.system.maxReadable")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.system.maxReadableHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Input,{type:"number",min:1,max:50,value:tg.maxReadableMb,onChange:e=>th(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:p("settings.config.system.archiveDelay")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.system.archiveDelayHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Input,{type:"number",min:1,max:365,value:tg.archiveDelayDays,onChange:e=>th(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:p("settings.config.system.archiveDelayUnit")})]})]})]}),(0,t.jsx)(l.Button,{onClick:tH,className:"rounded-lg",children:p("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:p("settings.config.task.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("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:p("settings.config.system.taskDefaultWorktree")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.system.taskDefaultWorktreeHint")})]}),(0,t.jsx)("button",{type:"button",onClick:()=>th(e=>({...e,taskDefaultUseWorktree:!e.taskDefaultUseWorktree})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${tg.taskDefaultUseWorktree?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:tg.taskDefaultUseWorktree?p("task.worktreeYes"):p("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:p("settings.config.system.taskDefaultAutoStart")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.system.taskDefaultAutoStartHint")})]}),(0,t.jsx)("button",{type:"button",onClick:()=>th(e=>({...e,taskDefaultAutoStart:!e.taskDefaultAutoStart})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${tg.taskDefaultAutoStart?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:tg.taskDefaultAutoStart?p("task.autoStartYes"):p("task.autoStartNo")})]})]}),(0,t.jsx)(l.Button,{onClick:tV,className:"rounded-lg",children:p("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:p("settings.config.gitParams.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("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:p("settings.config.gitParams.timeout")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.gitParams.timeoutHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Input,{type:"number",min:5,max:300,value:tp.timeoutSec,onChange:e=>tf(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)(l.Button,{onClick:tz,className:"rounded-lg",children:p("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:p("settings.config.search.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("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:p("settings.config.search.resultLimit")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.search.resultLimitHint")})]}),(0,t.jsx)(o.Input,{type:"number",min:5,max:100,value:tb.resultLimit,onChange:e=>tj(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:p("settings.config.search.allModeCap")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.search.allModeCapHint")})]}),(0,t.jsx)(o.Input,{type:"number",min:1,max:20,value:tb.allModeCap,onChange:e=>tj(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:p("settings.config.search.debounceMs")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.search.debounceMsHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Input,{type:"number",min:50,max:1e3,value:tb.debounceMs,onChange:e=>tj(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:p("settings.config.search.snippetLength")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.search.snippetLengthHint")})]}),(0,t.jsx)(o.Input,{type:"number",min:20,max:500,value:tb.snippetLength,onChange:e=>tj(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:p("settings.config.search.codeTimeout")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.search.codeTimeoutHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Input,{type:"number",min:5,max:300,step:5,value:tb.codeTimeoutSec,onChange:e=>tj(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)(l.Button,{onClick:tA,className:"rounded-lg",children:p("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:p("settings.config.missions.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("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:p("settings.config.missions.minCols")}),(0,t.jsx)(o.Input,{type:"number",min:1,max:10,value:tv.minCols,onChange:e=>tN(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:p("settings.config.missions.maxCols")}),(0,t.jsx)(o.Input,{type:"number",min:1,max:10,value:tv.maxCols,onChange:e=>tN(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:p("settings.config.missions.minRows")}),(0,t.jsx)(o.Input,{type:"number",min:1,max:10,value:tv.minRows,onChange:e=>tN(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:p("settings.config.missions.maxRows")}),(0,t.jsx)(o.Input,{type:"number",min:1,max:10,value:tv.maxRows,onChange:e=>tN(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)(l.Button,{onClick:t$,className:"rounded-lg",children:p("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:p("settings.config.hooks.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("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:p("settings.config.hooks.autoUploadTypes")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.hooks.autoUploadTypesHint")})]}),(0,t.jsx)(o.Input,{value:tS,onChange:e=>tT(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)(l.Button,{onClick:tK,className:"rounded-lg",children:p("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:ty?.installed?p("settings.config.hooks.installed"):p("settings.config.hooks.notInstalled")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.hooks.installHint")})]}),(0,t.jsx)(l.Button,{variant:ty?.installed?"destructive":"default",onClick:tO,disabled:tk||!ty,className:"rounded-lg",children:ty?.installed?p("settings.config.hooks.uninstall"):p("settings.config.hooks.install")})]})]}),(0,t.jsx)(x.Dialog,{open:!!td,onOpenChange:e=>!e&&tm(null),children:(0,t.jsxs)(x.DialogContent,{children:[(0,t.jsxs)(x.DialogHeader,{children:[(0,t.jsx)(x.DialogTitle,{children:p("settings.config.git.deleteConfirm")}),(0,t.jsx)(x.DialogDescription,{children:p("settings.config.git.deleteConfirmMessage")})]}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>tm(null),children:p("settings.config.git.cancel")}),(0,t.jsx)(l.Button,{variant:"destructive",onClick:()=>td&&t_(td),children:p("settings.config.git.delete")})]})]})})]});case"notifications":return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"rounded-xl border bg-card p-4 space-y-3",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:p("settings.notifications.systemCategory")}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:p("settings.notifications.enable")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:p("settings.notifications.enableDesc")})]}),(0,t.jsx)(u.Switch,{checked:tD,onCheckedChange:tG})]})]}),(0,t.jsx)(e5,{})]});case"backup":return(0,t.jsx)(ew,{});case"extensions":return(0,t.jsx)(eU,{});case"keyboard-shortcuts":return(0,t.jsx)(eK,{})}}()]})}),(0,t.jsx)(el.FolderBrowserDialog,{open:null!==tu,onOpenChange:e=>{e||tx(null)},onSelect:e=>{let t=te(e);"add"===tu?ta(e=>({...e,localPathTemplate:t})):"edit"===tu&&e1(e=>({...e,localPathTemplate:t})),tx(null)}})]})}e.s(["default",0,function(){return(0,t.jsx)(tt,{})}],113399)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,404122,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("4075ec4df24bd89711034f15cca9eb240df9f3f473",t.callServer,void 0,t.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,r])},487976,e=>{"use strict";var t=e.i(289721),r=e.i(965652),n=e.i(946822),i=e.i(40448),a=e.i(821957),l=e.i(729739),o=e.i(404122),c=e.i(461526);e.s(["PreviewLogTerminal",0,function({previewKey:e,taskId:u}){let{resolvedTheme:s}=(0,a.useTheme)(),f=(0,r.useRef)(null),d=(0,r.useRef)(null),m=(0,r.useRef)(null),g=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!f.current)return;let t="light"!==s,r=new n.Terminal({fontFamily:"Menlo, Monaco, 'Courier New', monospace",fontSize:12,scrollback:5e3,cursorBlink:!1,disableStdin:!0,allowTransparency:!1,convertEol:!0,theme:t?{background:"#0a0a0a",foreground:"#e5e5e5"}:{background:"#fafafa",foreground:"#171717"}}),a=new i.FitAddon;r.loadAddon(a),r.open(f.current);let y=f.current.querySelector(".xterm-helper-textarea");y&&(y.style.opacity="0"),d.current=r,g.current=a;try{a.fit()}catch{}let b=!1,p=null;(0,o.getConfigValues)(["terminal.fontSize","terminal.fontFamily"]).then(e=>{if(b)return;let t=Number(e["terminal.fontSize"]),n=e["terminal.fontFamily"];Number.isFinite(t)&&t>0&&(r.options.fontSize=t),"string"==typeof n&&n.trim()&&(r.options.fontFamily=n);try{a.fit()}catch{}}).catch(()=>{}),(async()=>{let t=await (0,l.getActualWsPort)();if(b)return;let n=new URLSearchParams({taskId:c.PREVIEW_TASK_ID,role:"terminal",previewKey:e,connectionId:crypto.randomUUID(),clientTaskId:u});(p=new WebSocket(`ws://localhost:${t}/?${n.toString()}`)).binaryType="arraybuffer",m.current=p,p.onmessage=e=>{let t="string"==typeof e.data?e.data:new TextDecoder().decode(e.data);r.write(t)}})();let w=()=>{try{g.current?.fit()}catch{}};return window.addEventListener("resize",w),()=>{b=!0,window.removeEventListener("resize",w),m.current?.close(),m.current=null,d.current&&(d.current.dispose(),d.current=null),g.current=null}},[e,u,s]),(0,t.jsx)("div",{ref:f,className:"size-full bg-black"})}])},461834,e=>{e.n(e.i(487976))}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,912078,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40d83973e43b58905a590e6e82361b1dd9c6de3fe9",t.callServer,void 0,t.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,r])},487976,e=>{"use strict";var t=e.i(289721),r=e.i(965652),n=e.i(946822),i=e.i(40448),a=e.i(821957),l=e.i(639709),o=e.i(912078),c=e.i(461526);e.s(["PreviewLogTerminal",0,function({previewKey:e,taskId:u}){let{resolvedTheme:s}=(0,a.useTheme)(),f=(0,r.useRef)(null),d=(0,r.useRef)(null),m=(0,r.useRef)(null),g=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!f.current)return;let t="light"!==s,r=new n.Terminal({fontFamily:"Menlo, Monaco, 'Courier New', monospace",fontSize:12,scrollback:5e3,cursorBlink:!1,disableStdin:!0,allowTransparency:!1,convertEol:!0,theme:t?{background:"#0a0a0a",foreground:"#e5e5e5"}:{background:"#fafafa",foreground:"#171717"}}),a=new i.FitAddon;r.loadAddon(a),r.open(f.current);let y=f.current.querySelector(".xterm-helper-textarea");y&&(y.style.opacity="0"),d.current=r,g.current=a;try{a.fit()}catch{}let b=!1,p=null;(0,o.getConfigValues)(["terminal.fontSize","terminal.fontFamily"]).then(e=>{if(b)return;let t=Number(e["terminal.fontSize"]),n=e["terminal.fontFamily"];Number.isFinite(t)&&t>0&&(r.options.fontSize=t),"string"==typeof n&&n.trim()&&(r.options.fontFamily=n);try{a.fit()}catch{}}).catch(()=>{}),(async()=>{let t=await (0,l.getActualWsPort)();if(b)return;let n=new URLSearchParams({taskId:c.PREVIEW_TASK_ID,role:"terminal",previewKey:e,connectionId:crypto.randomUUID(),clientTaskId:u});(p=new WebSocket(`ws://localhost:${t}/?${n.toString()}`)).binaryType="arraybuffer",m.current=p,p.onmessage=e=>{let t="string"==typeof e.data?e.data:new TextDecoder().decode(e.data);r.write(t)}})();let w=()=>{try{g.current?.fit()}catch{}};return window.addEventListener("resize",w),()=>{b=!0,window.removeEventListener("resize",w),m.current?.close(),m.current=null,d.current&&(d.current.dispose(),d.current=null),g.current=null}},[e,u,s]),(0,t.jsx)("div",{ref:f,className:"size-full bg-black"})}])},461834,e=>{e.n(e.i(487976))}]);