@bryanhu/codexly 0.37.1 → 0.38.0

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 (267) hide show
  1. package/CHANGELOG.md +30 -17
  2. package/README.md +6 -45
  3. package/README.zh-CN.md +6 -45
  4. package/dist/chunk-4RQ7HLCK.js +3 -0
  5. package/dist/chunk-GMNBWGMQ.js +5 -0
  6. package/dist/{chunk-PQPYP3AR.js → chunk-LGFUYNXR.js} +1 -1
  7. package/dist/{chunk-5AELLXXE.js → chunk-RWMSDM4X.js} +1 -1
  8. package/dist/{chunk-PFNMH4LN.js → chunk-SNN2J7BU.js} +187 -170
  9. package/dist/chunk-YCHIPWV2.js +40 -0
  10. package/dist/cli.js +5 -5
  11. package/dist/client/index.js +1 -1
  12. package/dist/{command-R5BTONU5.js → command-2D66UEBJ.js} +1 -1
  13. package/dist/core/index.js +1 -1
  14. package/dist/protocol/index.js +1 -1
  15. package/dist/providers/codex/index.js +1 -1
  16. package/dist/server/index.js +1 -1
  17. package/dist/sqlite-state-worker.js +22 -18
  18. package/dist/web/.vite/manifest.json +122 -129
  19. package/dist/web/.vite/manifest.json.br +0 -0
  20. package/dist/web/.vite/manifest.json.gz +0 -0
  21. package/dist/web/assets/{agent-settings-panel-CRNaBDDS.js → agent-settings-panel-C9S0LXqi.js} +1 -1
  22. package/dist/web/assets/agent-settings-panel-C9S0LXqi.js.br +0 -0
  23. package/dist/web/assets/agent-settings-panel-C9S0LXqi.js.gz +0 -0
  24. package/dist/web/assets/app-update-dialog-BsIh1VPg.js +1 -0
  25. package/dist/web/assets/app-update-dialog-BsIh1VPg.js.br +0 -0
  26. package/dist/web/assets/app-update-dialog-BsIh1VPg.js.gz +0 -0
  27. package/dist/web/assets/{background-image-picker-glORbeMR.js → background-image-picker-B1xDUft3.js} +1 -1
  28. package/dist/web/assets/background-image-picker-B1xDUft3.js.br +0 -0
  29. package/dist/web/assets/background-image-picker-B1xDUft3.js.gz +0 -0
  30. package/dist/web/assets/{code-highlighter-Cg1b4nzi.js → code-highlighter-kiC_chgH.js} +1 -1
  31. package/dist/web/assets/code-highlighter-kiC_chgH.js.br +0 -0
  32. package/dist/web/assets/code-highlighter-kiC_chgH.js.gz +0 -0
  33. package/dist/web/assets/{commit-settings-panel-C-ALJcjd.js → commit-settings-panel-Cdtyux2J.js} +1 -1
  34. package/dist/web/assets/commit-settings-panel-Cdtyux2J.js.br +0 -0
  35. package/dist/web/assets/commit-settings-panel-Cdtyux2J.js.gz +0 -0
  36. package/dist/web/assets/file-review-dialog-DaGgZASG.js +2 -0
  37. package/dist/web/assets/file-review-dialog-DaGgZASG.js.br +0 -0
  38. package/dist/web/assets/file-review-dialog-DaGgZASG.js.gz +0 -0
  39. package/dist/web/assets/git-commit-review-Bz8YDy59.js +2 -0
  40. package/dist/web/assets/git-commit-review-Bz8YDy59.js.br +0 -0
  41. package/dist/web/assets/git-commit-review-Bz8YDy59.js.gz +0 -0
  42. package/dist/web/assets/{git-history-panel-BvNkd60B.js → git-history-panel-QBsXgUT7.js} +1 -1
  43. package/dist/web/assets/git-history-panel-QBsXgUT7.js.br +0 -0
  44. package/dist/web/assets/git-history-panel-QBsXgUT7.js.gz +0 -0
  45. package/dist/web/assets/{global-search-dialog-CZnsxRQ7.js → global-search-dialog-DDaHRgce.js} +1 -1
  46. package/dist/web/assets/global-search-dialog-DDaHRgce.js.br +0 -0
  47. package/dist/web/assets/global-search-dialog-DDaHRgce.js.gz +0 -0
  48. package/dist/web/assets/global-settings-about-DpKyx3RM.js +1 -0
  49. package/dist/web/assets/global-settings-about-DpKyx3RM.js.br +0 -0
  50. package/dist/web/assets/global-settings-about-DpKyx3RM.js.gz +0 -0
  51. package/dist/web/assets/{global-settings-page-VbyWoa5s.js → global-settings-page-BEUBn7B5.js} +2 -2
  52. package/dist/web/assets/global-settings-page-BEUBn7B5.js.br +0 -0
  53. package/dist/web/assets/global-settings-page-BEUBn7B5.js.gz +0 -0
  54. package/dist/web/assets/{global-settings-pets-CAXRRfK_.js → global-settings-pets-DBYFpNQk.js} +1 -1
  55. package/dist/web/assets/global-settings-pets-DBYFpNQk.js.br +0 -0
  56. package/dist/web/assets/global-settings-pets-DBYFpNQk.js.gz +0 -0
  57. package/dist/web/assets/{highlighted-body-OFNGDK62-ClNmIb2W.js → highlighted-body-OFNGDK62-CeVKUhHG.js} +1 -1
  58. package/dist/web/assets/highlighted-body-OFNGDK62-CeVKUhHG.js.br +0 -0
  59. package/dist/web/assets/highlighted-body-OFNGDK62-CeVKUhHG.js.gz +0 -0
  60. package/dist/web/assets/{history-task-timeline-bx1YeO4E.js → history-task-timeline-Dl6to6Cp.js} +1 -1
  61. package/dist/web/assets/history-task-timeline-Dl6to6Cp.js.br +0 -0
  62. package/dist/web/assets/history-task-timeline-Dl6to6Cp.js.gz +0 -0
  63. package/dist/web/assets/{image-preview-Cufuk95q.js → image-preview-Bez628xh.js} +2 -2
  64. package/dist/web/assets/image-preview-Bez628xh.js.br +0 -0
  65. package/dist/web/assets/image-preview-Bez628xh.js.gz +0 -0
  66. package/dist/web/assets/{image-preview-content-C9_jCSeW.js → image-preview-content-TkopF2n1.js} +1 -1
  67. package/dist/web/assets/image-preview-content-TkopF2n1.js.br +0 -0
  68. package/dist/web/assets/image-preview-content-TkopF2n1.js.gz +0 -0
  69. package/dist/web/assets/index-CHJSDTYw.css +2 -0
  70. package/dist/web/assets/index-CHJSDTYw.css.br +0 -0
  71. package/dist/web/assets/index-CHJSDTYw.css.gz +0 -0
  72. package/dist/web/assets/index-DobF11m_.js +4 -0
  73. package/dist/web/assets/index-DobF11m_.js.br +0 -0
  74. package/dist/web/assets/index-DobF11m_.js.gz +0 -0
  75. package/dist/web/assets/initial-deps-C-3sxJvc.js +2 -0
  76. package/dist/web/assets/initial-deps-C-3sxJvc.js.br +0 -0
  77. package/dist/web/assets/initial-deps-C-3sxJvc.js.gz +0 -0
  78. package/dist/web/assets/{installed-skills-pane-B0a8IOZ0.js → installed-skills-pane-yCfl2E4Z.js} +1 -1
  79. package/dist/web/assets/installed-skills-pane-yCfl2E4Z.js.br +0 -0
  80. package/dist/web/assets/installed-skills-pane-yCfl2E4Z.js.gz +0 -0
  81. package/dist/web/assets/markdown-DVABVVc2.js +1 -0
  82. package/dist/web/assets/markdown-DVABVVc2.js.br +0 -0
  83. package/dist/web/assets/markdown-DVABVVc2.js.gz +0 -0
  84. package/dist/web/assets/{mcp-management-pane-BaRHPwX2.js → mcp-management-pane-D4fhknd1.js} +1 -1
  85. package/dist/web/assets/mcp-management-pane-D4fhknd1.js.br +0 -0
  86. package/dist/web/assets/mcp-management-pane-D4fhknd1.js.gz +0 -0
  87. package/dist/web/assets/mdx-BLuqtYwj.js +1 -0
  88. package/dist/web/assets/mdx-BLuqtYwj.js.br +0 -0
  89. package/dist/web/assets/mdx-BLuqtYwj.js.gz +0 -0
  90. package/dist/web/assets/mermaid-GHXKKRXX-BL0SiEsb.js +1 -0
  91. package/dist/web/assets/mermaid-GHXKKRXX-BL0SiEsb.js.br +1 -0
  92. package/dist/web/assets/mermaid-GHXKKRXX-BL0SiEsb.js.gz +0 -0
  93. package/dist/web/assets/{message-assistant-directive-CaNrh5lx.js → message-assistant-directive-r0UOX93m.js} +1 -1
  94. package/dist/web/assets/message-assistant-directive-r0UOX93m.js.br +0 -0
  95. package/dist/web/assets/message-assistant-directive-r0UOX93m.js.gz +0 -0
  96. package/dist/web/assets/{message-response-WYZfuphQ.js → message-response-DTlvlBMa.js} +5 -5
  97. package/dist/web/assets/message-response-DTlvlBMa.js.br +0 -0
  98. package/dist/web/assets/message-response-DTlvlBMa.js.gz +0 -0
  99. package/dist/web/assets/{official-plugins-pane-KGXjJvv3.js → official-plugins-pane-CRnpq0MJ.js} +1 -1
  100. package/dist/web/assets/official-plugins-pane-CRnpq0MJ.js.br +0 -0
  101. package/dist/web/assets/official-plugins-pane-CRnpq0MJ.js.gz +0 -0
  102. package/dist/web/assets/{patch-diff-viewer-D_Ts5rez.js → patch-diff-viewer-fv2hVYyb.js} +3 -3
  103. package/dist/web/assets/patch-diff-viewer-fv2hVYyb.js.br +0 -0
  104. package/dist/web/assets/patch-diff-viewer-fv2hVYyb.js.gz +0 -0
  105. package/dist/web/assets/{pdf-preview-D46KssiK.js → pdf-preview-CEvfJiZa.js} +3 -3
  106. package/dist/web/assets/pdf-preview-CEvfJiZa.js.br +0 -0
  107. package/dist/web/assets/pdf-preview-CEvfJiZa.js.gz +0 -0
  108. package/dist/web/assets/{personalization-settings-panel-CllzRqsG.js → personalization-settings-panel-CmNqDQg6.js} +1 -1
  109. package/dist/web/assets/personalization-settings-panel-CmNqDQg6.js.br +0 -0
  110. package/dist/web/assets/personalization-settings-panel-CmNqDQg6.js.gz +0 -0
  111. package/dist/web/assets/{project-file-popup-page-CVnfABUU.js → project-file-popup-page-rkdge4He.js} +1 -1
  112. package/dist/web/assets/project-file-popup-page-rkdge4He.js.br +0 -0
  113. package/dist/web/assets/project-file-popup-page-rkdge4He.js.gz +0 -0
  114. package/dist/web/assets/project-source-panel-Dfdd7hXf.js +2 -0
  115. package/dist/web/assets/project-source-panel-Dfdd7hXf.js.br +0 -0
  116. package/dist/web/assets/project-source-panel-Dfdd7hXf.js.gz +0 -0
  117. package/dist/web/assets/{prompt-input-Ceptl3B-.js → prompt-input-rTS8jFNM.js} +1 -1
  118. package/dist/web/assets/prompt-input-rTS8jFNM.js.br +0 -0
  119. package/dist/web/assets/prompt-input-rTS8jFNM.js.gz +0 -0
  120. package/dist/web/assets/resources-en-DiMZyInt.js +1 -0
  121. package/dist/web/assets/resources-en-DiMZyInt.js.br +0 -0
  122. package/dist/web/assets/resources-en-DiMZyInt.js.gz +0 -0
  123. package/dist/web/assets/{scheduled-task-date-time-picker-CpT4cTpn.js → scheduled-task-date-time-picker-8cWX1p1O.js} +1 -1
  124. package/dist/web/assets/scheduled-task-date-time-picker-8cWX1p1O.js.br +0 -0
  125. package/dist/web/assets/scheduled-task-date-time-picker-8cWX1p1O.js.gz +0 -0
  126. package/dist/web/assets/{scheduled-tasks-container-CRV2di5K.js → scheduled-tasks-container-BA7pSsmC.js} +2 -2
  127. package/dist/web/assets/scheduled-tasks-container-BA7pSsmC.js.br +0 -0
  128. package/dist/web/assets/scheduled-tasks-container-BA7pSsmC.js.gz +0 -0
  129. package/dist/web/assets/scheduled-tasks-container-DrOJ_UbG.css +1 -0
  130. package/dist/web/assets/scheduled-tasks-container-DrOJ_UbG.css.br +0 -0
  131. package/dist/web/assets/scheduled-tasks-container-DrOJ_UbG.css.gz +0 -0
  132. package/dist/web/assets/{shiki-bundle-C942xz2H.js → shiki-bundle-CHd-S0Yk.js} +1 -1
  133. package/dist/web/assets/shiki-bundle-CHd-S0Yk.js.br +2 -0
  134. package/dist/web/assets/shiki-bundle-CHd-S0Yk.js.gz +0 -0
  135. package/dist/web/assets/{skills-market-container--8qzUyrx.js → skills-market-container-BdTREXZb.js} +2 -2
  136. package/dist/web/assets/skills-market-container-BdTREXZb.js.br +0 -0
  137. package/dist/web/assets/skills-market-container-BdTREXZb.js.gz +0 -0
  138. package/dist/web/assets/{split-workspace-menu-content-CAL4JQt9.js → split-workspace-menu-content-DgbECHxu.js} +1 -1
  139. package/dist/web/assets/split-workspace-menu-content-DgbECHxu.js.br +0 -0
  140. package/dist/web/assets/split-workspace-menu-content-DgbECHxu.js.gz +0 -0
  141. package/dist/web/assets/{third-party-marketplace-pane-Can5ly44.js → third-party-marketplace-pane-BPN-3gk1.js} +1 -1
  142. package/dist/web/assets/third-party-marketplace-pane-BPN-3gk1.js.br +0 -0
  143. package/dist/web/assets/third-party-marketplace-pane-BPN-3gk1.js.gz +0 -0
  144. package/dist/web/assets/workbench-inspector-changes-D1rDsafv.js +1 -0
  145. package/dist/web/assets/workbench-inspector-changes-D1rDsafv.js.br +0 -0
  146. package/dist/web/assets/workbench-inspector-changes-D1rDsafv.js.gz +0 -0
  147. package/dist/web/assets/{workbench-pet-canvas-DuBL3mip.js → workbench-pet-canvas-B5jypDil.js} +1 -1
  148. package/dist/web/assets/workbench-pet-canvas-B5jypDil.js.br +0 -0
  149. package/dist/web/assets/workbench-pet-canvas-B5jypDil.js.gz +0 -0
  150. package/dist/web/assets/workbench-shell-B139izuR.js +16 -0
  151. package/dist/web/assets/workbench-shell-B139izuR.js.br +0 -0
  152. package/dist/web/assets/workbench-shell-B139izuR.js.gz +0 -0
  153. package/dist/web/index.html +3 -3
  154. package/dist/web/index.html.br +0 -0
  155. package/dist/web/index.html.gz +0 -0
  156. package/docs/local-catalog.md +51 -0
  157. package/docs/model-discovery.md +26 -0
  158. package/package.json +5 -4
  159. package/dist/chunk-3WW7LK46.js +0 -5
  160. package/dist/chunk-5ULADQG3.js +0 -40
  161. package/dist/chunk-63NQMTXZ.js +0 -3
  162. package/dist/web/assets/agent-settings-panel-CRNaBDDS.js.br +0 -0
  163. package/dist/web/assets/agent-settings-panel-CRNaBDDS.js.gz +0 -0
  164. package/dist/web/assets/background-image-picker-glORbeMR.js.br +0 -0
  165. package/dist/web/assets/background-image-picker-glORbeMR.js.gz +0 -0
  166. package/dist/web/assets/code-highlighter-Cg1b4nzi.js.br +0 -5
  167. package/dist/web/assets/code-highlighter-Cg1b4nzi.js.gz +0 -0
  168. package/dist/web/assets/commit-settings-panel-C-ALJcjd.js.br +0 -0
  169. package/dist/web/assets/commit-settings-panel-C-ALJcjd.js.gz +0 -0
  170. package/dist/web/assets/dockerfile-IyjqRm3v.js +0 -1
  171. package/dist/web/assets/dockerfile-IyjqRm3v.js.br +0 -0
  172. package/dist/web/assets/dockerfile-IyjqRm3v.js.gz +0 -0
  173. package/dist/web/assets/file-review-dialog-DNWufkfZ.js +0 -2
  174. package/dist/web/assets/file-review-dialog-DNWufkfZ.js.br +0 -0
  175. package/dist/web/assets/file-review-dialog-DNWufkfZ.js.gz +0 -0
  176. package/dist/web/assets/git-commit-review-B3GGQldl.js +0 -2
  177. package/dist/web/assets/git-commit-review-B3GGQldl.js.br +0 -0
  178. package/dist/web/assets/git-commit-review-B3GGQldl.js.gz +0 -0
  179. package/dist/web/assets/git-history-panel-BvNkd60B.js.br +0 -0
  180. package/dist/web/assets/git-history-panel-BvNkd60B.js.gz +0 -0
  181. package/dist/web/assets/global-search-dialog-CZnsxRQ7.js.br +0 -0
  182. package/dist/web/assets/global-search-dialog-CZnsxRQ7.js.gz +0 -0
  183. package/dist/web/assets/global-settings-about-CnBVv1BA.js +0 -1
  184. package/dist/web/assets/global-settings-about-CnBVv1BA.js.br +0 -0
  185. package/dist/web/assets/global-settings-about-CnBVv1BA.js.gz +0 -0
  186. package/dist/web/assets/global-settings-page-VbyWoa5s.js.br +0 -0
  187. package/dist/web/assets/global-settings-page-VbyWoa5s.js.gz +0 -0
  188. package/dist/web/assets/global-settings-pets-CAXRRfK_.js.br +0 -0
  189. package/dist/web/assets/global-settings-pets-CAXRRfK_.js.gz +0 -0
  190. package/dist/web/assets/highlighted-body-OFNGDK62-ClNmIb2W.js.br +0 -0
  191. package/dist/web/assets/highlighted-body-OFNGDK62-ClNmIb2W.js.gz +0 -0
  192. package/dist/web/assets/history-task-timeline-bx1YeO4E.js.br +0 -0
  193. package/dist/web/assets/history-task-timeline-bx1YeO4E.js.gz +0 -0
  194. package/dist/web/assets/image-preview-Cufuk95q.js.br +0 -0
  195. package/dist/web/assets/image-preview-Cufuk95q.js.gz +0 -0
  196. package/dist/web/assets/image-preview-content-C9_jCSeW.js.br +0 -0
  197. package/dist/web/assets/image-preview-content-C9_jCSeW.js.gz +0 -0
  198. package/dist/web/assets/index-BJqxQCE6.css +0 -2
  199. package/dist/web/assets/index-BJqxQCE6.css.br +0 -0
  200. package/dist/web/assets/index-BJqxQCE6.css.gz +0 -0
  201. package/dist/web/assets/index-DudvUciK.js +0 -4
  202. package/dist/web/assets/index-DudvUciK.js.br +0 -0
  203. package/dist/web/assets/index-DudvUciK.js.gz +0 -0
  204. package/dist/web/assets/initial-deps-B7SS8XxM.js +0 -2
  205. package/dist/web/assets/initial-deps-B7SS8XxM.js.br +0 -0
  206. package/dist/web/assets/initial-deps-B7SS8XxM.js.gz +0 -0
  207. package/dist/web/assets/installed-skills-pane-B0a8IOZ0.js.br +0 -0
  208. package/dist/web/assets/installed-skills-pane-B0a8IOZ0.js.gz +0 -0
  209. package/dist/web/assets/lazy-message-response-Q7-W7qvB.js +0 -2
  210. package/dist/web/assets/lazy-message-response-Q7-W7qvB.js.br +0 -0
  211. package/dist/web/assets/lazy-message-response-Q7-W7qvB.js.gz +0 -0
  212. package/dist/web/assets/markdown-BYOwaDjH.js +0 -1
  213. package/dist/web/assets/markdown-BYOwaDjH.js.br +0 -0
  214. package/dist/web/assets/markdown-BYOwaDjH.js.gz +0 -0
  215. package/dist/web/assets/mcp-management-pane-BaRHPwX2.js.br +0 -0
  216. package/dist/web/assets/mcp-management-pane-BaRHPwX2.js.gz +0 -0
  217. package/dist/web/assets/mdx-DQZ5AkYe.js +0 -1
  218. package/dist/web/assets/mdx-DQZ5AkYe.js.br +0 -0
  219. package/dist/web/assets/mdx-DQZ5AkYe.js.gz +0 -0
  220. package/dist/web/assets/mermaid-GHXKKRXX-DywTXJ81.js +0 -1
  221. package/dist/web/assets/mermaid-GHXKKRXX-DywTXJ81.js.br +0 -0
  222. package/dist/web/assets/mermaid-GHXKKRXX-DywTXJ81.js.gz +0 -0
  223. package/dist/web/assets/message-assistant-directive-CaNrh5lx.js.br +0 -0
  224. package/dist/web/assets/message-assistant-directive-CaNrh5lx.js.gz +0 -0
  225. package/dist/web/assets/message-response-WYZfuphQ.js.br +0 -0
  226. package/dist/web/assets/message-response-WYZfuphQ.js.gz +0 -0
  227. package/dist/web/assets/official-plugins-pane-KGXjJvv3.js.br +0 -0
  228. package/dist/web/assets/official-plugins-pane-KGXjJvv3.js.gz +0 -0
  229. package/dist/web/assets/patch-diff-viewer-D_Ts5rez.js.br +0 -0
  230. package/dist/web/assets/patch-diff-viewer-D_Ts5rez.js.gz +0 -0
  231. package/dist/web/assets/pdf-preview-D46KssiK.js.br +0 -0
  232. package/dist/web/assets/pdf-preview-D46KssiK.js.gz +0 -0
  233. package/dist/web/assets/personalization-settings-panel-CllzRqsG.js.br +0 -0
  234. package/dist/web/assets/personalization-settings-panel-CllzRqsG.js.gz +0 -0
  235. package/dist/web/assets/project-file-popup-page-CVnfABUU.js.br +0 -0
  236. package/dist/web/assets/project-file-popup-page-CVnfABUU.js.gz +0 -0
  237. package/dist/web/assets/project-source-panel-Dl6nuWfg.js +0 -2
  238. package/dist/web/assets/project-source-panel-Dl6nuWfg.js.br +0 -0
  239. package/dist/web/assets/project-source-panel-Dl6nuWfg.js.gz +0 -0
  240. package/dist/web/assets/prompt-input-Ceptl3B-.js.br +0 -0
  241. package/dist/web/assets/prompt-input-Ceptl3B-.js.gz +0 -0
  242. package/dist/web/assets/resources-en-CzuCDOU2.js +0 -1
  243. package/dist/web/assets/resources-en-CzuCDOU2.js.br +0 -0
  244. package/dist/web/assets/resources-en-CzuCDOU2.js.gz +0 -0
  245. package/dist/web/assets/scheduled-task-date-time-picker-CpT4cTpn.js.br +0 -0
  246. package/dist/web/assets/scheduled-task-date-time-picker-CpT4cTpn.js.gz +0 -0
  247. package/dist/web/assets/scheduled-tasks-container-CRV2di5K.js.br +0 -0
  248. package/dist/web/assets/scheduled-tasks-container-CRV2di5K.js.gz +0 -0
  249. package/dist/web/assets/scheduled-tasks-container-CVGTy7-W.css +0 -1
  250. package/dist/web/assets/scheduled-tasks-container-CVGTy7-W.css.br +0 -0
  251. package/dist/web/assets/scheduled-tasks-container-CVGTy7-W.css.gz +0 -0
  252. package/dist/web/assets/shiki-bundle-C942xz2H.js.br +0 -2
  253. package/dist/web/assets/shiki-bundle-C942xz2H.js.gz +0 -0
  254. package/dist/web/assets/skills-market-container--8qzUyrx.js.br +0 -0
  255. package/dist/web/assets/skills-market-container--8qzUyrx.js.gz +0 -0
  256. package/dist/web/assets/split-workspace-menu-content-CAL4JQt9.js.br +0 -5
  257. package/dist/web/assets/split-workspace-menu-content-CAL4JQt9.js.gz +0 -0
  258. package/dist/web/assets/third-party-marketplace-pane-Can5ly44.js.br +0 -0
  259. package/dist/web/assets/third-party-marketplace-pane-Can5ly44.js.gz +0 -0
  260. package/dist/web/assets/workbench-inspector-changes-D2ZiHtIT.js +0 -1
  261. package/dist/web/assets/workbench-inspector-changes-D2ZiHtIT.js.br +0 -0
  262. package/dist/web/assets/workbench-inspector-changes-D2ZiHtIT.js.gz +0 -0
  263. package/dist/web/assets/workbench-pet-canvas-DuBL3mip.js.br +0 -0
  264. package/dist/web/assets/workbench-pet-canvas-DuBL3mip.js.gz +0 -0
  265. package/dist/web/assets/workbench-shell-CfN-sr8U.js +0 -16
  266. package/dist/web/assets/workbench-shell-CfN-sr8U.js.br +0 -0
  267. package/dist/web/assets/workbench-shell-CfN-sr8U.js.gz +0 -0
Binary file
Binary file
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./react-runtime-CMZHB3u8.js";import{i as r,s as i,u as a}from"./initial-deps-CW5Jl6i2.js";import{B as o,Tt as s}from"./initial-deps-B7SS8XxM.js";import{at as c}from"./initial-deps-B8FrcWWN.js";import"./index-DudvUciK.js";import{c as l,d as u,f as d,g as f,l as p,m,p as h,s as g,u as _}from"./global-settings-page-VbyWoa5s.js";var v=e(t(),1),y=n();function b({client:e,labels:t}){let n=(0,v.useId)(),r=(0,v.useId)(),i=(0,v.useRef)(!1),[a,o]=(0,v.useState)(`idle`),c=async()=>{if(!i.current){i.current=!0,o(`pending`);try{await e.compressHistory(),o(`scheduled`)}catch{o(`failed`)}finally{i.current=!1}}};return(0,y.jsxs)(`section`,{"aria-labelledby":n,children:[(0,y.jsx)(`h2`,{id:n,className:`mb-2 text-body font-semibold`,children:t.title}),(0,y.jsxs)(`div`,{className:`rounded-surface border border-separator bg-panel px-4 py-3`,children:[(0,y.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-center`,children:[(0,y.jsxs)(`div`,{id:r,className:`min-w-0 flex-1 space-y-1 text-body-small text-muted-foreground`,children:[(0,y.jsx)(`p`,{children:t.description}),(0,y.jsx)(`p`,{children:t.compatibility})]}),(0,y.jsx)(s,{type:`button`,variant:`secondary`,className:`shrink-0 self-end`,"aria-describedby":r,disabled:a===`pending`,onClick:()=>{c()},children:a===`pending`?t.pending:t.action})]}),a===`scheduled`?(0,y.jsx)(`p`,{role:`status`,className:`mt-3 text-body-small text-muted-foreground`,children:t.scheduled}):null,a===`failed`?(0,y.jsx)(`p`,{role:`alert`,className:`mt-3 text-body-small text-danger`,children:t.failed}):null]})]})}var x=1e3;function S(e){let t=e.trim();if(t===``)return null;if(!/^\d+$/.test(t))return;let n=Number(t);return Number.isInteger(n)&&n>=272&&n<=1e3?n*1e3:void 0}function C(e){return e===null?``:String(e/1e3)}function w({value:e,onChange:t,labels:n}){let r=(0,v.useId)(),[i,a]=(0,v.useState)(()=>C(e)),[s,c]=(0,v.useState)(!1),l=(0,v.useRef)(!1);(0,v.useEffect)(()=>{l.current||a(C(e))},[e]);let u=n=>{if(!l.current)return;let r=n.validity.badInput?void 0:S(i);if(r===void 0){c(!0);return}l.current=!1,c(!1),a(C(r)),r!==e&&t(r)};return(0,y.jsxs)(`div`,{className:`w-40 min-w-0 max-w-full`,children:[(0,y.jsxs)(`div`,{className:`flex h-8 items-center rounded-control border border-separator-strong bg-control focus-within:shadow-focus`,children:[(0,y.jsx)(o,{variant:`embedded`,className:`h-full w-full px-2.5 text-body-small tabular-nums focus-visible:!outline-none`,type:`number`,inputMode:`numeric`,min:272,max:x,step:1,autoComplete:`off`,"aria-label":`${n.label} (k tokens)`,"aria-invalid":s,"aria-describedby":s?r:void 0,placeholder:n.automatic,value:i,onChange:e=>{l.current=!0,a(e.currentTarget.value),c(!1)},onBlur:e=>{u(e.currentTarget)},onKeyDown:t=>{t.nativeEvent.isComposing||(t.key===`Enter`?(t.preventDefault(),t.currentTarget.blur()):t.key===`Escape`&&(t.preventDefault(),l.current=!1,c(!1),a(C(e)),t.currentTarget.blur()))}}),(0,y.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 pr-2.5 text-label text-muted-foreground`,children:`k tokens`})]}),s?(0,y.jsx)(`p`,{id:r,role:`alert`,className:`mt-1 text-label text-danger`,children:n.invalid}):null]})}var T=[`personalization`,`agent`],E=[{key:`webSearch`,options:[`disabled`,`cached`,`live`]},{key:`modelVerbosity`,options:[``,`low`,`medium`,`high`]}];function D({client:e}){let{t}=c(`settings`),n=i({queryKey:T,queryFn:()=>e.getAgentPreferences()});return(0,y.jsxs)(y.Fragment,{children:[n.isError?(0,y.jsxs)(`div`,{role:`alert`,children:[t(`personalization.loadError`),(0,y.jsx)(s,{variant:`ghost`,onClick:()=>void n.refetch(),children:t(`common:actions.retry`)})]}):null,E.map(t=>(0,y.jsx)(O,{field:t,client:e,settings:n.data},t.key))]})}function O({field:{key:e,options:t},client:n,settings:i}){let{t:o}=c(`settings`),s=a(),l=r({scope:{id:`personalization-agent`},mutationFn:t=>{let r=s.getQueryData(T);if(!r)throw Error(`Agent preferences are not loaded`);return n.updateAgentPreferences({...r,[e]:t})},onSuccess:e=>s.setQueryData(T,e),meta:{actionNotification:{successMessage:!1}}}),u=l.isPending?l.variables:i?.[e];return(0,y.jsx)(h,{label:o(`agent.${e}.label`),description:o(`agent.${e}.description`),children:(0,y.jsx)(f,{"aria-label":o(`agent.${e}.label`),disabled:!i||l.isPending,value:u??``,onChange:e=>{l.mutate(e.currentTarget.value||null)},children:t.map(t=>(0,y.jsx)(`option`,{value:t,children:o(`agent.${e}.${t||`default`}`)},t))})})}function k({client:e,settings:t,models:n,fastModeAvailable:r,onChange:i}){let{t:a}=c(`settings`),o=n.find(e=>e.id===t.model);return(0,y.jsxs)(`section`,{id:`settings-panel-agent`,children:[(0,y.jsx)(`h1`,{className:`mb-6 text-xl font-semibold`,children:a(`sections.agent`)}),(0,y.jsxs)(`div`,{className:`space-y-6`,children:[(0,y.jsxs)(m,{title:a(`agent.defaults`),children:[(0,y.jsx)(h,{label:a(`fields.approvalPolicy`),description:a(`general.approvalDescription`),children:(0,y.jsxs)(f,{"aria-label":a(`fields.approvalPolicy`),value:l(t),onChange:e=>{i(g(t,e.currentTarget.value))},children:[(0,y.jsx)(`option`,{value:`on-request`,children:a(`approval.onRequest`)}),(0,y.jsx)(`option`,{value:`auto-review`,children:a(`approval.autoReview`)}),(0,y.jsx)(`option`,{value:`never`,children:a(`approval.never`)})]})}),(0,y.jsx)(h,{label:a(`fields.sandbox`),description:a(`general.sandboxDescription`),children:(0,y.jsxs)(f,{"aria-label":a(`fields.sandbox`),value:t.sandboxMode,onChange:e=>{i({...t,sandboxMode:e.currentTarget.value})},children:[(0,y.jsx)(`option`,{value:`read-only`,children:a(`sandbox.readOnly`)}),(0,y.jsx)(`option`,{value:`workspace-write`,children:a(`sandbox.workspaceWrite`)}),(0,y.jsx)(`option`,{value:`danger-full-access`,children:a(`sandbox.dangerFullAccess`)})]})}),(0,y.jsx)(D,{client:e})]}),(0,y.jsxs)(m,{title:a(`agent.model`),children:[r?(0,y.jsx)(_,{enabled:t.fastMode,onChange:e=>{i({...t,fastMode:e})}}):null,(0,y.jsx)(h,{label:a(`fields.model`),children:(0,y.jsx)(u,{ariaLabel:a(`fields.model`),models:n,value:t.model,onChange:e=>{i({...t,...p(n,e,t.reasoningEffort)})}})}),(0,y.jsx)(h,{label:a(`fields.reasoningEffort`),children:(0,y.jsx)(d,{ariaLabel:a(`fields.reasoningEffort`),disabled:o===void 0,model:o,value:t.reasoningEffort,onChange:e=>{i({...t,reasoningEffort:e})}})}),(0,y.jsx)(h,{label:a(`agent.contextWindow.label`),description:a(`agent.contextWindow.description`),children:(0,y.jsx)(w,{value:t.modelContextWindow,onChange:e=>{i({...t,modelContextWindow:e})},labels:{label:a(`agent.contextWindow.label`),automatic:a(`agent.contextWindow.automatic`),invalid:a(`agent.contextWindow.invalid`)}})})]}),(0,y.jsx)(b,{client:e,labels:{title:a(`agent.storage.title`),description:a(`agent.storage.description`),compatibility:a(`agent.storage.compatibility`),action:a(`agent.storage.action`),pending:a(`agent.storage.pending`),scheduled:a(`agent.storage.scheduled`),failed:a(`agent.storage.failed`)}})]})]})}export{k as AgentSettingsPanel};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./react-runtime-CMZHB3u8.js";import{i as r,s as i,u as a}from"./initial-deps-CW5Jl6i2.js";import{B as o,Tt as s}from"./initial-deps-C-3sxJvc.js";import{at as c}from"./initial-deps-B8FrcWWN.js";import"./index-DobF11m_.js";import{c as l,d as u,f as d,g as f,l as p,m,p as h,s as g,u as _}from"./global-settings-page-BEUBn7B5.js";var v=e(t(),1),y=n();function b({client:e,labels:t}){let n=(0,v.useId)(),r=(0,v.useId)(),i=(0,v.useRef)(!1),[a,o]=(0,v.useState)(`idle`),c=async()=>{if(!i.current){i.current=!0,o(`pending`);try{await e.compressHistory(),o(`scheduled`)}catch{o(`failed`)}finally{i.current=!1}}};return(0,y.jsxs)(`section`,{"aria-labelledby":n,children:[(0,y.jsx)(`h2`,{id:n,className:`mb-2 text-body font-semibold`,children:t.title}),(0,y.jsxs)(`div`,{className:`rounded-surface border border-separator bg-panel px-4 py-3`,children:[(0,y.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-center`,children:[(0,y.jsxs)(`div`,{id:r,className:`min-w-0 flex-1 space-y-1 text-body-small text-muted-foreground`,children:[(0,y.jsx)(`p`,{children:t.description}),(0,y.jsx)(`p`,{children:t.compatibility})]}),(0,y.jsx)(s,{type:`button`,variant:`secondary`,className:`shrink-0 self-end`,"aria-describedby":r,disabled:a===`pending`,onClick:()=>{c()},children:a===`pending`?t.pending:t.action})]}),a===`scheduled`?(0,y.jsx)(`p`,{role:`status`,className:`mt-3 text-body-small text-muted-foreground`,children:t.scheduled}):null,a===`failed`?(0,y.jsx)(`p`,{role:`alert`,className:`mt-3 text-body-small text-danger`,children:t.failed}):null]})]})}var x=1e3;function S(e){let t=e.trim();if(t===``)return null;if(!/^\d+$/.test(t))return;let n=Number(t);return Number.isInteger(n)&&n>=272&&n<=1e3?n*1e3:void 0}function C(e){return e===null?``:String(e/1e3)}function w({value:e,onChange:t,labels:n}){let r=(0,v.useId)(),[i,a]=(0,v.useState)(()=>C(e)),[s,c]=(0,v.useState)(!1),l=(0,v.useRef)(!1);(0,v.useEffect)(()=>{l.current||a(C(e))},[e]);let u=n=>{if(!l.current)return;let r=n.validity.badInput?void 0:S(i);if(r===void 0){c(!0);return}l.current=!1,c(!1),a(C(r)),r!==e&&t(r)};return(0,y.jsxs)(`div`,{className:`w-40 min-w-0 max-w-full`,children:[(0,y.jsxs)(`div`,{className:`flex h-8 items-center rounded-control border border-separator-strong bg-control focus-within:shadow-focus`,children:[(0,y.jsx)(o,{variant:`embedded`,className:`h-full w-full px-2.5 text-body-small tabular-nums focus-visible:!outline-none`,type:`number`,inputMode:`numeric`,min:272,max:x,step:1,autoComplete:`off`,"aria-label":`${n.label} (k tokens)`,"aria-invalid":s,"aria-describedby":s?r:void 0,placeholder:n.automatic,value:i,onChange:e=>{l.current=!0,a(e.currentTarget.value),c(!1)},onBlur:e=>{u(e.currentTarget)},onKeyDown:t=>{t.nativeEvent.isComposing||(t.key===`Enter`?(t.preventDefault(),t.currentTarget.blur()):t.key===`Escape`&&(t.preventDefault(),l.current=!1,c(!1),a(C(e)),t.currentTarget.blur()))}}),(0,y.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 pr-2.5 text-label text-muted-foreground`,children:`k tokens`})]}),s?(0,y.jsx)(`p`,{id:r,role:`alert`,className:`mt-1 text-label text-danger`,children:n.invalid}):null]})}var T=[`personalization`,`agent`],E=[{key:`webSearch`,options:[`disabled`,`cached`,`live`]},{key:`modelVerbosity`,options:[``,`low`,`medium`,`high`]}];function D({client:e}){let{t}=c(`settings`),n=i({queryKey:T,queryFn:()=>e.getAgentPreferences()});return(0,y.jsxs)(y.Fragment,{children:[n.isError?(0,y.jsxs)(`div`,{role:`alert`,children:[t(`personalization.loadError`),(0,y.jsx)(s,{variant:`ghost`,onClick:()=>void n.refetch(),children:t(`common:actions.retry`)})]}):null,E.map(t=>(0,y.jsx)(O,{field:t,client:e,settings:n.data},t.key))]})}function O({field:{key:e,options:t},client:n,settings:i}){let{t:o}=c(`settings`),s=a(),l=r({scope:{id:`personalization-agent`},mutationFn:t=>{let r=s.getQueryData(T);if(!r)throw Error(`Agent preferences are not loaded`);return n.updateAgentPreferences({...r,[e]:t})},onSuccess:e=>s.setQueryData(T,e),meta:{actionNotification:{successMessage:!1}}}),u=l.isPending?l.variables:i?.[e];return(0,y.jsx)(h,{label:o(`agent.${e}.label`),description:o(`agent.${e}.description`),children:(0,y.jsx)(f,{"aria-label":o(`agent.${e}.label`),disabled:!i||l.isPending,value:u??``,onChange:e=>{l.mutate(e.currentTarget.value||null)},children:t.map(t=>(0,y.jsx)(`option`,{value:t,children:o(`agent.${e}.${t||`default`}`)},t))})})}function k({client:e,settings:t,models:n,fastModeAvailable:r,onChange:i}){let{t:a}=c(`settings`),o=n.find(e=>e.id===t.model);return(0,y.jsxs)(`section`,{id:`settings-panel-agent`,children:[(0,y.jsx)(`h1`,{className:`mb-6 text-xl font-semibold`,children:a(`sections.agent`)}),(0,y.jsxs)(`div`,{className:`space-y-6`,children:[(0,y.jsxs)(m,{title:a(`agent.defaults`),children:[(0,y.jsx)(h,{label:a(`fields.approvalPolicy`),description:a(`general.approvalDescription`),children:(0,y.jsxs)(f,{"aria-label":a(`fields.approvalPolicy`),value:l(t),onChange:e=>{i(g(t,e.currentTarget.value))},children:[(0,y.jsx)(`option`,{value:`on-request`,children:a(`approval.onRequest`)}),(0,y.jsx)(`option`,{value:`auto-review`,children:a(`approval.autoReview`)}),(0,y.jsx)(`option`,{value:`never`,children:a(`approval.never`)})]})}),(0,y.jsx)(h,{label:a(`fields.sandbox`),description:a(`general.sandboxDescription`),children:(0,y.jsxs)(f,{"aria-label":a(`fields.sandbox`),value:t.sandboxMode,onChange:e=>{i({...t,sandboxMode:e.currentTarget.value})},children:[(0,y.jsx)(`option`,{value:`read-only`,children:a(`sandbox.readOnly`)}),(0,y.jsx)(`option`,{value:`workspace-write`,children:a(`sandbox.workspaceWrite`)}),(0,y.jsx)(`option`,{value:`danger-full-access`,children:a(`sandbox.dangerFullAccess`)})]})}),(0,y.jsx)(D,{client:e})]}),(0,y.jsxs)(m,{title:a(`agent.model`),children:[r?(0,y.jsx)(_,{enabled:t.fastMode,onChange:e=>{i({...t,fastMode:e})}}):null,(0,y.jsx)(h,{label:a(`fields.model`),children:(0,y.jsx)(u,{ariaLabel:a(`fields.model`),models:n,value:t.model,onChange:e=>{i({...t,...p(n,e,t.reasoningEffort)})}})}),(0,y.jsx)(h,{label:a(`fields.reasoningEffort`),children:(0,y.jsx)(d,{ariaLabel:a(`fields.reasoningEffort`),disabled:o===void 0,model:o,value:t.reasoningEffort,onChange:e=>{i({...t,reasoningEffort:e})}})}),(0,y.jsx)(h,{label:a(`agent.contextWindow.label`),description:a(`agent.contextWindow.description`),children:(0,y.jsx)(w,{value:t.modelContextWindow,onChange:e=>{i({...t,modelContextWindow:e})},labels:{label:a(`agent.contextWindow.label`),automatic:a(`agent.contextWindow.automatic`),invalid:a(`agent.contextWindow.invalid`)}})})]}),(0,y.jsx)(b,{client:e,labels:{title:a(`agent.storage.title`),description:a(`agent.storage.description`),compatibility:a(`agent.storage.compatibility`),action:a(`agent.storage.action`),pending:a(`agent.storage.pending`),scheduled:a(`agent.storage.scheduled`),failed:a(`agent.storage.failed`)}})]})]})}export{k as AgentSettingsPanel};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./react-runtime-CMZHB3u8.js";import{H as r,K as i,Tt as a,V as o}from"./initial-deps-C-3sxJvc.js";import{E as s,o as c}from"./initial-deps-B8FrcWWN.js";import{t as l}from"./download-05FmZQzE.js";var u=e(t(),1),d=n();function f({children:e,isPending:t=!1,labels:n,onClose:f,onUpdate:p,percentage:m}){let h=(0,u.useId)(),g=(0,u.useRef)(!1),[_,v]=(0,u.useState)(`idle`),[y,b]=(0,u.useState)(null),x=t||_===`pending`,S=m??y,C=()=>{!g.current&&!t&&f()},w=async()=>{if(!(g.current||t||_===`completed`)){g.current=!0,b(null),v(`pending`);try{await p(b),v(`completed`)}catch{v(`failed`)}finally{g.current=!1}}};return(0,d.jsx)(o,{open:!0,onOpenChange:e=>{e||C()},children:(0,d.jsxs)(r,{"aria-describedby":void 0,"aria-labelledby":h,className:`max-h-[min(80dvh,40rem)] max-w-2xl grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden p-0`,onCloseAutoFocus:e=>{e.preventDefault(),document.getElementById(`global-settings-about-trigger`)?.focus()},children:[(0,d.jsxs)(`header`,{className:`flex items-center gap-3 px-5 pt-5`,children:[(0,d.jsx)(i,{className:`min-w-0 flex-1`,id:h,children:n.title}),(0,d.jsx)(a,{"aria-label":n.close,disabled:x,onClick:C,size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,d.jsx)(c,{"aria-hidden":`true`,className:`size-4`})})]}),(0,d.jsx)(`div`,{className:`min-h-0 overflow-y-auto border-t border-separator px-5 py-4`,children:e}),(0,d.jsxs)(`footer`,{className:`flex flex-wrap items-center justify-end gap-3 border-t border-separator px-5 py-3`,children:[_===`failed`?(0,d.jsx)(`p`,{className:`min-w-0 flex-1 text-body-small text-danger`,role:`alert`,children:n.failed}):null,_===`completed`?(0,d.jsx)(`p`,{className:`min-w-0 flex-1 text-body-small text-muted-foreground`,role:`status`,children:n.completed}):null,x&&S!==null?(0,d.jsx)(`progress`,{"aria-label":n.progress,className:`h-1.5 min-w-20 flex-1`,max:100,value:S}):null,(0,d.jsxs)(a,{disabled:x||_===`completed`,onClick:()=>void w(),size:`sm`,type:`button`,children:[x?(0,d.jsx)(s,{"aria-hidden":`true`,className:`animate-spin`,"data-icon":`inline-start`}):(0,d.jsx)(l,{"aria-hidden":`true`,"data-icon":`inline-start`}),x?n.updating:n.update,x&&S!==null?` ${String(S)}%`:null]})]})]})})}export{f as AppUpdateDialog};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./react-runtime-CMZHB3u8.js";import{s as r}from"./initial-deps-CW5Jl6i2.js";import{H as i,K as a,Tt as o,U as s,V as c,W as l}from"./initial-deps-B7SS8XxM.js";import{E as u,at as d,g as f,l as p,o as m,q as h}from"./initial-deps-B8FrcWWN.js";import{t as g}from"./download-05FmZQzE.js";import{t as _}from"./maximize-2-CawekEKe.js";import{t as v}from"./upload-BQhbr7lC.js";import{at as y,v as b}from"./index-DudvUciK.js";import{a as x,i as S,n as C,o as w,r as T}from"./global-settings-page-VbyWoa5s.js";var E=e(t(),1),D=n();function O({image:e,selected:t,onSelect:n,onPreview:i,onDownload:a,downloading:o}){let{t:s}=d(`settings`),c=r(C(e.day,!0)),l=e.title||e.day;return(0,D.jsxs)(`article`,{className:`wallpaper-tile`,"data-selected":t,children:[(0,D.jsxs)(`button`,{className:`wallpaper-thumbnail`,type:`button`,"aria-label":s(`wallpaper.select`,{name:e.day}),"aria-pressed":t,onClick:n,children:[c.data?(0,D.jsx)(`img`,{src:c.data,alt:l,loading:`lazy`,decoding:`async`}):(0,D.jsx)(`span`,{className:`wallpaper-thumbnail-state`,children:c.isError?s(`wallpaper.imageError`):(0,D.jsx)(u,{"aria-hidden":`true`,className:`size-4 motion-safe:animate-spin`})}),t?(0,D.jsxs)(`span`,{className:`wallpaper-selected`,children:[(0,D.jsx)(h,{"aria-hidden":`true`,className:`size-3.5`}),s(`wallpaper.selected`)]}):null]}),(0,D.jsxs)(`div`,{className:`wallpaper-tile-footer`,children:[(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`p`,{title:l,children:l}),(0,D.jsx)(`time`,{dateTime:e.day,children:e.day})]}),(0,D.jsxs)(`div`,{className:`flex shrink-0`,children:[c.isError?(0,D.jsx)(S,{label:s(`wallpaper.retry`),onClick:()=>{c.refetch()},children:(0,D.jsx)(f,{"aria-hidden":`true`})}):null,(0,D.jsx)(S,{label:s(`wallpaper.view`,{name:e.day}),onClick:i,children:(0,D.jsx)(_,{"aria-hidden":`true`})}),(0,D.jsx)(S,{label:s(`wallpaper.downloadImage`,{name:e.day}),onClick:a,disabled:o,children:(0,D.jsx)(g,{"aria-hidden":`true`})})]})]})]})}function k({image:e,onClose:t,onDownload:n,downloading:i}){let{t:a}=d(`settings`),s=r(C(e.day,!1));return(0,D.jsx)(x,{source:s.data??null,title:e.title||e.day,onClose:t,error:s.isError,children:(0,D.jsxs)(`div`,{className:`wallpaper-dialog-footer`,children:[(0,D.jsxs)(`p`,{children:[e.day,(0,D.jsx)(`br`,{}),e.copyright]}),s.isError?(0,D.jsx)(o,{onClick:()=>{s.refetch()},variant:`outline`,children:a(`wallpaper.retry`)}):null,(0,D.jsxs)(o,{onClick:n,disabled:i,variant:`outline`,children:[(0,D.jsx)(g,{"aria-hidden":`true`}),a(i?`wallpaper.downloading`:`wallpaper.download`)]})]})})}function A({preference:e,onChange:t}){let{t:n}=d(`settings`),{client:i}=y(),a=r({queryKey:[`bing-wallpapers`],queryFn:()=>i.listWorkbenchBackgrounds(),staleTime:36e5,retry:1}),s=a.data?.slice(0,9)??[],c=e.selectedBingDay??s[0]?.day,[l,u]=(0,E.useState)(null),p=e=>{let t=document.createElement(`a`);t.href=T(e),t.download=`Bing-`+e+`.jpg`,t.click()};return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`section`,{children:[(0,D.jsxs)(`div`,{className:`wallpaper-section-heading`,children:[(0,D.jsxs)(`h2`,{children:[n(`wallpaper.collection`),(0,D.jsx)(`span`,{className:`wallpaper-heading-meta`,children:n(`wallpaper.recent`)})]}),(0,D.jsxs)(`label`,{className:`wallpaper-daily`,children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:e.selectedBingDay==null,disabled:s.length===0,onChange:n=>{t({...e,selectedBingDay:n.currentTarget.checked?null:c??null})}}),n(`wallpaper.daily`)]})]}),a.isError?(0,D.jsxs)(`div`,{className:`wallpaper-empty`,role:`alert`,children:[(0,D.jsx)(`p`,{children:n(`wallpaper.loadError`)}),(0,D.jsxs)(o,{variant:`outline`,onClick:()=>{a.refetch()},children:[(0,D.jsx)(f,{"aria-hidden":`true`}),n(`wallpaper.retry`)]})]}):(0,D.jsx)(`div`,{className:`wallpaper-gallery`,"aria-label":n(`wallpaper.collection`),children:s.map(n=>(0,D.jsx)(O,{image:n,selected:c===n.day,onSelect:()=>{t({...e,selectedBingDay:n.day})},onPreview:()=>{u(n)},onDownload:()=>{p(n.day)},downloading:!1},n.day))})]}),l===null?null:(0,D.jsx)(k,{image:l,onClose:()=>{u(null)},onDownload:()=>{p(l.day)},downloading:!1})]})}function j({image:e,selected:t,disabled:n,onSelect:r,onRemove:i,onPreview:a}){let{t:o}=d(`settings`),s=w(e);return(0,D.jsxs)(`article`,{className:`wallpaper-tile`,"data-selected":t,children:[(0,D.jsxs)(`button`,{className:`wallpaper-thumbnail`,"aria-label":o(`background.selectImage`,{name:e.name}),"aria-pressed":t,disabled:n,onClick:r,type:`button`,children:[s===null?null:(0,D.jsx)(`img`,{alt:e.name,src:s,loading:`lazy`,decoding:`async`}),t?(0,D.jsxs)(`span`,{className:`wallpaper-selected`,children:[(0,D.jsx)(h,{"aria-hidden":`true`,className:`size-3.5`}),o(`wallpaper.selected`)]}):null]}),(0,D.jsxs)(`div`,{className:`wallpaper-tile-footer`,children:[(0,D.jsx)(`p`,{title:e.name,children:e.name}),(0,D.jsxs)(`div`,{className:`flex shrink-0`,children:[(0,D.jsx)(S,{label:o(`wallpaper.view`,{name:e.name}),onClick:a,children:(0,D.jsx)(_,{"aria-hidden":`true`})}),(0,D.jsx)(S,{label:o(`background.deleteImage`,{name:e.name}),onClick:i,disabled:n,children:(0,D.jsx)(p,{"aria-hidden":`true`})})]})]})]})}function M({image:e,onClose:t}){let n=w(e);return(0,D.jsx)(x,{title:e.name,source:n,onClose:t})}function N({customImages:e,disabled:t,loadError:n=!1,onRetry:r,onCustomFilesAdd:i,onCustomImageRemove:a,onCustomImageSelect:s,preference:c}){let{t:l}=d(`settings`),u=(0,E.useRef)(null),[p,m]=(0,E.useState)(null),[h,g]=(0,E.useState)(null),_=()=>u.current?.click();return(0,D.jsxs)(`section`,{children:[(0,D.jsxs)(`div`,{className:`wallpaper-section-heading`,children:[(0,D.jsxs)(`h2`,{children:[l(`wallpaper.custom`),(0,D.jsx)(`span`,{className:`wallpaper-heading-meta`,children:e.length})]}),(0,D.jsxs)(o,{disabled:t,onClick:_,type:`button`,variant:`outline`,children:[(0,D.jsx)(v,{"aria-hidden":`true`}),l(`wallpaper.upload`)]})]}),n?(0,D.jsxs)(`div`,{className:`wallpaper-empty`,role:`alert`,children:[(0,D.jsx)(`p`,{children:l(`wallpaper.loadError`)}),(0,D.jsxs)(o,{onClick:r,variant:`outline`,children:[(0,D.jsx)(f,{"aria-hidden":`true`}),l(`wallpaper.retry`)]})]}):e.length===0?(0,D.jsxs)(`button`,{className:`wallpaper-upload-empty`,disabled:t,onClick:_,type:`button`,"aria-label":l(`background.uploadInput`),children:[(0,D.jsx)(v,{"aria-hidden":`true`,className:`size-5`}),(0,D.jsx)(`span`,{children:l(`wallpaper.empty`)}),(0,D.jsx)(`span`,{className:`text-brand`,children:l(`wallpaper.upload`)})]}):(0,D.jsx)(`div`,{className:`wallpaper-gallery`,"aria-label":l(`background.galleryLabel`),children:e.map(e=>(0,D.jsx)(j,{image:e,selected:c.selectedCustomImageId===e.id,disabled:t,onSelect:()=>{s(e.id)},onRemove:()=>{a(e.id)},onPreview:()=>{g(e)}},e.id))}),(0,D.jsx)(`input`,{accept:`image/gif,image/jpeg,image/png,image/webp`,"aria-label":l(`background.uploadInput`),className:`hidden`,multiple:!0,ref:u,type:`file`,onChange:e=>{let t=[...e.currentTarget.files??[]];if(e.currentTarget.value=``,t.length!==0){if(t.some(e=>!b(e))){m(l(`background.invalidImage`));return}m(null),i(t)}}}),p===null?null:(0,D.jsx)(`p`,{className:`mt-3 text-label text-danger`,role:`alert`,children:p}),h===null?null:(0,D.jsx)(M,{image:h,onClose:()=>{g(null)}})]})}function P({onClose:e,...t}){let{t:n}=d(`settings`);return(0,D.jsx)(c,{open:!0,onOpenChange:t=>{t||e()},children:(0,D.jsxs)(i,{className:`wallpaper-picker`,children:[(0,D.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(a,{children:n(`wallpaper.choose`)}),(0,D.jsx)(s,{className:`mt-1`,children:n(`wallpaper.pickerDescription`)})]}),(0,D.jsx)(o,{"aria-label":n(`wallpaper.closePicker`),size:`icon-sm`,variant:`ghost`,onClick:e,children:(0,D.jsx)(m,{"aria-hidden":`true`})})]}),(0,D.jsx)(`div`,{className:`wallpaper-picker-body`,children:t.preference.mode===`bing`?(0,D.jsx)(A,{preference:t.preference,onChange:t.onPreferenceChange}):(0,D.jsx)(N,{...t})}),(0,D.jsx)(l,{className:`border-t border-separator pt-4`,children:(0,D.jsx)(o,{variant:`outline`,onClick:e,children:n(`wallpaper.done`)})})]})})}export{P as BackgroundImagePicker};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./react-runtime-CMZHB3u8.js";import{s as r}from"./initial-deps-CW5Jl6i2.js";import{H as i,K as a,Tt as o,U as s,V as c,W as l}from"./initial-deps-C-3sxJvc.js";import{E as u,at as d,g as f,l as p,o as m,q as h}from"./initial-deps-B8FrcWWN.js";import{t as g}from"./download-05FmZQzE.js";import{t as _}from"./maximize-2-CawekEKe.js";import{t as v}from"./upload-BQhbr7lC.js";import{ot as y,v as b}from"./index-DobF11m_.js";import{a as x,i as S,n as C,o as w,r as T}from"./global-settings-page-BEUBn7B5.js";var E=e(t(),1),D=n();function O({image:e,selected:t,onSelect:n,onPreview:i,onDownload:a,downloading:o}){let{t:s}=d(`settings`),c=r(C(e.day,!0)),l=e.title||e.day;return(0,D.jsxs)(`article`,{className:`wallpaper-tile`,"data-selected":t,children:[(0,D.jsxs)(`button`,{className:`wallpaper-thumbnail`,type:`button`,"aria-label":s(`wallpaper.select`,{name:e.day}),"aria-pressed":t,onClick:n,children:[c.data?(0,D.jsx)(`img`,{src:c.data,alt:l,loading:`lazy`,decoding:`async`}):(0,D.jsx)(`span`,{className:`wallpaper-thumbnail-state`,children:c.isError?s(`wallpaper.imageError`):(0,D.jsx)(u,{"aria-hidden":`true`,className:`size-4 motion-safe:animate-spin`})}),t?(0,D.jsxs)(`span`,{className:`wallpaper-selected`,children:[(0,D.jsx)(h,{"aria-hidden":`true`,className:`size-3.5`}),s(`wallpaper.selected`)]}):null]}),(0,D.jsxs)(`div`,{className:`wallpaper-tile-footer`,children:[(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`p`,{title:l,children:l}),(0,D.jsx)(`time`,{dateTime:e.day,children:e.day})]}),(0,D.jsxs)(`div`,{className:`flex shrink-0`,children:[c.isError?(0,D.jsx)(S,{label:s(`wallpaper.retry`),onClick:()=>{c.refetch()},children:(0,D.jsx)(f,{"aria-hidden":`true`})}):null,(0,D.jsx)(S,{label:s(`wallpaper.view`,{name:e.day}),onClick:i,children:(0,D.jsx)(_,{"aria-hidden":`true`})}),(0,D.jsx)(S,{label:s(`wallpaper.downloadImage`,{name:e.day}),onClick:a,disabled:o,children:(0,D.jsx)(g,{"aria-hidden":`true`})})]})]})]})}function k({image:e,onClose:t,onDownload:n,downloading:i}){let{t:a}=d(`settings`),s=r(C(e.day,!1));return(0,D.jsx)(x,{source:s.data??null,title:e.title||e.day,onClose:t,error:s.isError,children:(0,D.jsxs)(`div`,{className:`wallpaper-dialog-footer`,children:[(0,D.jsxs)(`p`,{children:[e.day,(0,D.jsx)(`br`,{}),e.copyright]}),s.isError?(0,D.jsx)(o,{onClick:()=>{s.refetch()},variant:`outline`,children:a(`wallpaper.retry`)}):null,(0,D.jsxs)(o,{onClick:n,disabled:i,variant:`outline`,children:[(0,D.jsx)(g,{"aria-hidden":`true`}),a(i?`wallpaper.downloading`:`wallpaper.download`)]})]})})}function A({preference:e,onChange:t}){let{t:n}=d(`settings`),{client:i}=y(),a=r({queryKey:[`bing-wallpapers`],queryFn:()=>i.listWorkbenchBackgrounds(),staleTime:36e5,retry:1}),s=a.data?.slice(0,9)??[],c=e.selectedBingDay??s[0]?.day,[l,u]=(0,E.useState)(null),p=e=>{let t=document.createElement(`a`);t.href=T(e),t.download=`Bing-`+e+`.jpg`,t.click()};return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`section`,{children:[(0,D.jsxs)(`div`,{className:`wallpaper-section-heading`,children:[(0,D.jsxs)(`h2`,{children:[n(`wallpaper.collection`),(0,D.jsx)(`span`,{className:`wallpaper-heading-meta`,children:n(`wallpaper.recent`)})]}),(0,D.jsxs)(`label`,{className:`wallpaper-daily`,children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:e.selectedBingDay==null,disabled:s.length===0,onChange:n=>{t({...e,selectedBingDay:n.currentTarget.checked?null:c??null})}}),n(`wallpaper.daily`)]})]}),a.isError?(0,D.jsxs)(`div`,{className:`wallpaper-empty`,role:`alert`,children:[(0,D.jsx)(`p`,{children:n(`wallpaper.loadError`)}),(0,D.jsxs)(o,{variant:`outline`,onClick:()=>{a.refetch()},children:[(0,D.jsx)(f,{"aria-hidden":`true`}),n(`wallpaper.retry`)]})]}):(0,D.jsx)(`div`,{className:`wallpaper-gallery`,"aria-label":n(`wallpaper.collection`),children:s.map(n=>(0,D.jsx)(O,{image:n,selected:c===n.day,onSelect:()=>{t({...e,selectedBingDay:n.day})},onPreview:()=>{u(n)},onDownload:()=>{p(n.day)},downloading:!1},n.day))})]}),l===null?null:(0,D.jsx)(k,{image:l,onClose:()=>{u(null)},onDownload:()=>{p(l.day)},downloading:!1})]})}function j({image:e,selected:t,disabled:n,onSelect:r,onRemove:i,onPreview:a}){let{t:o}=d(`settings`),s=w(e);return(0,D.jsxs)(`article`,{className:`wallpaper-tile`,"data-selected":t,children:[(0,D.jsxs)(`button`,{className:`wallpaper-thumbnail`,"aria-label":o(`background.selectImage`,{name:e.name}),"aria-pressed":t,disabled:n,onClick:r,type:`button`,children:[s===null?null:(0,D.jsx)(`img`,{alt:e.name,src:s,loading:`lazy`,decoding:`async`}),t?(0,D.jsxs)(`span`,{className:`wallpaper-selected`,children:[(0,D.jsx)(h,{"aria-hidden":`true`,className:`size-3.5`}),o(`wallpaper.selected`)]}):null]}),(0,D.jsxs)(`div`,{className:`wallpaper-tile-footer`,children:[(0,D.jsx)(`p`,{title:e.name,children:e.name}),(0,D.jsxs)(`div`,{className:`flex shrink-0`,children:[(0,D.jsx)(S,{label:o(`wallpaper.view`,{name:e.name}),onClick:a,children:(0,D.jsx)(_,{"aria-hidden":`true`})}),(0,D.jsx)(S,{label:o(`background.deleteImage`,{name:e.name}),onClick:i,disabled:n,children:(0,D.jsx)(p,{"aria-hidden":`true`})})]})]})]})}function M({image:e,onClose:t}){let n=w(e);return(0,D.jsx)(x,{title:e.name,source:n,onClose:t})}function N({customImages:e,disabled:t,loadError:n=!1,onRetry:r,onCustomFilesAdd:i,onCustomImageRemove:a,onCustomImageSelect:s,preference:c}){let{t:l}=d(`settings`),u=(0,E.useRef)(null),[p,m]=(0,E.useState)(null),[h,g]=(0,E.useState)(null),_=()=>u.current?.click();return(0,D.jsxs)(`section`,{children:[(0,D.jsxs)(`div`,{className:`wallpaper-section-heading`,children:[(0,D.jsxs)(`h2`,{children:[l(`wallpaper.custom`),(0,D.jsx)(`span`,{className:`wallpaper-heading-meta`,children:e.length})]}),(0,D.jsxs)(o,{disabled:t,onClick:_,type:`button`,variant:`outline`,children:[(0,D.jsx)(v,{"aria-hidden":`true`}),l(`wallpaper.upload`)]})]}),n?(0,D.jsxs)(`div`,{className:`wallpaper-empty`,role:`alert`,children:[(0,D.jsx)(`p`,{children:l(`wallpaper.loadError`)}),(0,D.jsxs)(o,{onClick:r,variant:`outline`,children:[(0,D.jsx)(f,{"aria-hidden":`true`}),l(`wallpaper.retry`)]})]}):e.length===0?(0,D.jsxs)(`button`,{className:`wallpaper-upload-empty`,disabled:t,onClick:_,type:`button`,"aria-label":l(`background.uploadInput`),children:[(0,D.jsx)(v,{"aria-hidden":`true`,className:`size-5`}),(0,D.jsx)(`span`,{children:l(`wallpaper.empty`)}),(0,D.jsx)(`span`,{className:`text-brand`,children:l(`wallpaper.upload`)})]}):(0,D.jsx)(`div`,{className:`wallpaper-gallery`,"aria-label":l(`background.galleryLabel`),children:e.map(e=>(0,D.jsx)(j,{image:e,selected:c.selectedCustomImageId===e.id,disabled:t,onSelect:()=>{s(e.id)},onRemove:()=>{a(e.id)},onPreview:()=>{g(e)}},e.id))}),(0,D.jsx)(`input`,{accept:`image/gif,image/jpeg,image/png,image/webp`,"aria-label":l(`background.uploadInput`),className:`hidden`,multiple:!0,ref:u,type:`file`,onChange:e=>{let t=[...e.currentTarget.files??[]];if(e.currentTarget.value=``,t.length!==0){if(t.some(e=>!b(e))){m(l(`background.invalidImage`));return}m(null),i(t)}}}),p===null?null:(0,D.jsx)(`p`,{className:`mt-3 text-label text-danger`,role:`alert`,children:p}),h===null?null:(0,D.jsx)(M,{image:h,onClose:()=>{g(null)}})]})}function P({onClose:e,...t}){let{t:n}=d(`settings`);return(0,D.jsx)(c,{open:!0,onOpenChange:t=>{t||e()},children:(0,D.jsxs)(i,{className:`wallpaper-picker`,children:[(0,D.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(a,{children:n(`wallpaper.choose`)}),(0,D.jsx)(s,{className:`mt-1`,children:n(`wallpaper.pickerDescription`)})]}),(0,D.jsx)(o,{"aria-label":n(`wallpaper.closePicker`),size:`icon-sm`,variant:`ghost`,onClick:e,children:(0,D.jsx)(m,{"aria-hidden":`true`})})]}),(0,D.jsx)(`div`,{className:`wallpaper-picker-body`,children:t.preference.mode===`bing`?(0,D.jsx)(A,{preference:t.preference,onChange:t.onPreferenceChange}):(0,D.jsx)(N,{...t})}),(0,D.jsx)(l,{className:`border-t border-separator pt-4`,children:(0,D.jsx)(o,{variant:`outline`,onClick:e,children:n(`wallpaper.done`)})})]})})}export{P as BackgroundImagePicker};
@@ -1,3 +1,3 @@
1
- import{c as e,l as t,p as n}from"./pdf-preview-D46KssiK.js";import{i as r,t as i}from"./engine-compile-C-bb4peU.js";import a from"./github-dark-C-LZuMrd.js";import o from"./github-light-EUqPIrTm.js";var s=r({engine:i({forgiving:!0}),langs:[],themes:[o,a]}),c=new Map,l=32,u=4096,d=2048;async function f(){await new Promise(e=>setTimeout(e,0))}function p(e){let t=c.get(e);if(t!==void 0)return t;let r=Promise.all([s,n[e]()]).then(async([e,t])=>(await e.loadLanguage(t.default),e)).catch(t=>{throw c.delete(e),t});return c.set(e,r),r}async function m(n,r){if(!t(r,n))return e(n);let i=await p(r),a=n.split(`
1
+ import{c as e,l as t,p as n}from"./pdf-preview-CEvfJiZa.js";import{i as r,t as i}from"./engine-compile-C-bb4peU.js";import a from"./github-dark-C-LZuMrd.js";import o from"./github-light-EUqPIrTm.js";var s=r({engine:i({forgiving:!0}),langs:[],themes:[o,a]}),c=new Map,l=32,u=4096,d=2048;async function f(){await new Promise(e=>setTimeout(e,0))}function p(e){let t=c.get(e);if(t!==void 0)return t;let r=Promise.all([s,n[e]()]).then(async([e,t])=>(await e.loadLanguage(t.default),e)).catch(t=>{throw c.delete(e),t});return c.set(e,r),r}async function m(n,r){if(!t(r,n))return e(n);let i=await p(r),a=n.split(`
2
2
  `),o=[],s,c=0,m=`transparent`,h=`inherit`;for(let e=0;e<a.length;){let t=e,n=0;for(;t<a.length&&t-e<l;){let r=(a[t]?.length??0)+1;if(t>e&&n+r>u)break;n+=r,t+=1}await f();let p=a.slice(e,t).join(`
3
3
  `),g=t<a.length&&p.endsWith(`\r`)?p.slice(0,-1):p,_=i.codeToTokens(g,{lang:r,themes:{dark:`github-dark`,light:`github-light`},...s===void 0?{}:{grammarState:s},tokenizeMaxLineLength:d});s=_.grammarState;for(let e of _.tokens){for(let t of e)t.offset+=c;o.push(e)}m=_.bg??m,h=_.fg??h,c+=p.length+1,e=t}return{background:m,foreground:h,lines:o}}export{m as highlightCode};
@@ -1 +1 @@
1
- import{t as e}from"./react-runtime-CMZHB3u8.js";import{at as t}from"./initial-deps-B8FrcWWN.js";import"./index-DudvUciK.js";import{d as n,p as r}from"./global-settings-page-VbyWoa5s.js";var i=e();function a({settings:e,models:a,onChange:o,onFlush:s}){let{t:c}=t(`settings`);return(0,i.jsxs)(`section`,{id:`personalization-commit-settings`,"aria-labelledby":`personalization-commit-title`,className:`space-y-3`,children:[(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h2`,{id:`personalization-commit-title`,className:`text-body font-semibold`,children:c(`personalization.commitTitle`)}),(0,i.jsx)(`p`,{className:`mt-1 text-body-small text-muted-foreground`,children:c(`personalization.commitDescription`)})]}),(0,i.jsxs)(`div`,{className:`divide-y divide-separator rounded-surface border border-separator bg-panel px-4`,children:[(0,i.jsx)(r,{label:c(`personalization.commitModel`),description:c(`personalization.commitModelDescription`),children:(0,i.jsx)(n,{ariaLabel:c(`fields.commitModel`),models:a,onChange:e=>{o(t=>({...t,commitMessageModel:e}))},value:e.commitMessageModel})}),(0,i.jsxs)(`div`,{className:`space-y-2 py-3`,children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,i.jsx)(`label`,{htmlFor:`commit-message-prompt`,className:`text-body-small font-medium`,children:c(`personalization.commitRules`)}),(0,i.jsxs)(`span`,{className:`text-label tabular-nums text-subtle-foreground`,children:[e.commitMessagePrompt.length,` / 4000`]})]}),(0,i.jsx)(`p`,{id:`commit-message-prompt-description`,className:`text-label text-muted-foreground`,children:c(`personalization.commitRulesDescription`)}),(0,i.jsx)(`textarea`,{id:`commit-message-prompt`,"aria-label":c(`fields.commitMessagePrompt`),"aria-describedby":`commit-message-prompt-description`,className:`block min-h-36 w-full resize-y rounded-control border border-separator-strong bg-panel px-3 py-2 text-body-small text-foreground outline-none focus:border-brand focus:shadow-focus disabled:opacity-50`,placeholder:c(`personalization.commitPlaceholder`),maxLength:4e3,onBlur:s,onChange:e=>{let t=e.currentTarget.value;o(e=>({...e,commitMessagePrompt:t}),!0)},value:e.commitMessagePrompt})]})]})]})}export{a as CommitSettingsPanel};
1
+ import{t as e}from"./react-runtime-CMZHB3u8.js";import{at as t}from"./initial-deps-B8FrcWWN.js";import"./index-DobF11m_.js";import{d as n,p as r}from"./global-settings-page-BEUBn7B5.js";var i=e();function a({settings:e,models:a,onChange:o,onFlush:s}){let{t:c}=t(`settings`);return(0,i.jsxs)(`section`,{id:`personalization-commit-settings`,"aria-labelledby":`personalization-commit-title`,className:`space-y-3`,children:[(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h2`,{id:`personalization-commit-title`,className:`text-body font-semibold`,children:c(`personalization.commitTitle`)}),(0,i.jsx)(`p`,{className:`mt-1 text-body-small text-muted-foreground`,children:c(`personalization.commitDescription`)})]}),(0,i.jsxs)(`div`,{className:`divide-y divide-separator rounded-surface border border-separator bg-panel px-4`,children:[(0,i.jsx)(r,{label:c(`personalization.commitModel`),description:c(`personalization.commitModelDescription`),children:(0,i.jsx)(n,{ariaLabel:c(`fields.commitModel`),models:a,onChange:e=>{o(t=>({...t,commitMessageModel:e}))},value:e.commitMessageModel})}),(0,i.jsxs)(`div`,{className:`space-y-2 py-3`,children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,i.jsx)(`label`,{htmlFor:`commit-message-prompt`,className:`text-body-small font-medium`,children:c(`personalization.commitRules`)}),(0,i.jsxs)(`span`,{className:`text-label tabular-nums text-subtle-foreground`,children:[e.commitMessagePrompt.length,` / 4000`]})]}),(0,i.jsx)(`p`,{id:`commit-message-prompt-description`,className:`text-label text-muted-foreground`,children:c(`personalization.commitRulesDescription`)}),(0,i.jsx)(`textarea`,{id:`commit-message-prompt`,"aria-label":c(`fields.commitMessagePrompt`),"aria-describedby":`commit-message-prompt-description`,className:`block min-h-36 w-full resize-y rounded-control border border-separator-strong bg-panel px-3 py-2 text-body-small text-foreground outline-none focus:border-brand focus:shadow-focus disabled:opacity-50`,placeholder:c(`personalization.commitPlaceholder`),maxLength:4e3,onBlur:s,onChange:e=>{let t=e.currentTarget.value;o(e=>({...e,commitMessagePrompt:t}),!0)},value:e.commitMessagePrompt})]})]})]})}export{a as CommitSettingsPanel};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/patch-diff-viewer-fv2hVYyb.js","assets/rolldown-runtime-B0Z9INg1.js","assets/initial-deps-CqwWvUnY.js","assets/react-runtime-CMZHB3u8.js","assets/initial-deps-B8FrcWWN.js","assets/initial-deps-C0_XYRrC.js","assets/pdf-preview-CEvfJiZa.js","assets/initial-deps-CW5Jl6i2.js","assets/initial-deps-CG4ykI_P.js","assets/initial-deps-D0opk7c-.js","assets/initial-deps-DZ-sH4cr.js","assets/initial-deps-C-3sxJvc.js","assets/initial-deps-Cppvl2Gz.js","assets/scheduled-task-floating-ui~index~workbench-shell~workbench-inspector-changes~project-source~c6tt9j64-ClgveiMa.js","assets/initial-deps-DFOart6r.js","assets/clipboard-BxrWcnRh.js","assets/index-DobF11m_.js","assets/index-CHJSDTYw.css","assets/engine-compile-C-bb4peU.js","assets/lib-21LSAZ-l.js","assets/workbench-shell-B139izuR.js","assets/arrow-down-DoJlTckg.js","assets/prompt-input-rTS8jFNM.js","assets/download-05FmZQzE.js","assets/external-link-DQSTtNhw.js","assets/message-assistant-directive-r0UOX93m.js","assets/image-preview-Bez628xh.js","assets/git-fork-CElzN7bT.js","assets/history-location-C2XDYAuy.js","assets/maximize-2-CawekEKe.js","assets/scan-DyLrpouW.js","assets/workbench-pet-canvas-B5jypDil.js"])))=>i.map(i=>d[i]);
2
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./initial-deps-CqwWvUnY.js";import{i as n,t as r}from"./react-runtime-CMZHB3u8.js";import{M as i,P as a,Tt as o,j as s}from"./initial-deps-C-3sxJvc.js";import{K as c,U as l,at as u,o as d,tt as f}from"./initial-deps-B8FrcWWN.js";import{m as p}from"./pdf-preview-CEvfJiZa.js";import{n as m,r as h,t as g}from"./file-navigation-view-preference-BYYgwRsz.js";import{M as _,j as v,k as y}from"./index-DobF11m_.js";import{h as b,o as x,p as S,s as C}from"./workbench-shell-B139izuR.js";var w=f(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),T=e(n(),1),E=r();function D(e,t){return e.name.localeCompare(t.name,`en`)}function O(e){let t=[e.name],n=e;for(;n.files.length===0&&n.directories.size===1;){let e=n.directories.values().next().value;if(e===void 0)break;t.push(e.name),n=e}let r=[...n.directories.values()].sort(D).map(O),i=n.files.toSorted(D);return{children:[...r,...i],name:t.join(`/`),path:n.path,type:`folder`}}function k(e){let t={directories:new Map,files:[],name:``,path:``};return e.forEach((e,n)=>{let r=e.path.split(/[\\/]/),i=r.at(-1)??e.path,a=t,o=``;for(let e of r.slice(0,-1)){o=o.length===0?e:`${o}/${e}`;let t=a.directories.get(e);t===void 0&&(t={directories:new Map,files:[],name:e,path:o},a.directories.set(e,t)),a=t}let{additions:s,removals:c}=x(e);a.files.push({additions:s,changeIndex:n,name:i,path:r.join(`/`),removals:c,type:`file`})}),[...[...t.directories.values()].sort(D).map(O),...t.files.toSorted(D)]}function A(e,t=new Set){for(let n of e)n.type===`folder`&&(t.add(n.path),A(n.children,t));return t}function j(e,t=[]){for(let n of e)n.type===`folder`?j(n.children,t):t.push(n);return t}function M({fileLabel:e,nodes:t,showStats:n}){return t.map(t=>t.type===`folder`?(0,E.jsx)(_,{name:t.name,path:t.path,children:(0,E.jsx)(M,{fileLabel:e,nodes:t.children,showStats:n})},t.path):(0,E.jsx)(v,{"aria-label":e(t),icon:(0,E.jsx)(p,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),name:t.name,path:t.path,trailing:n?(0,E.jsxs)(`span`,{"aria-hidden":`true`,className:`ml-auto flex shrink-0 items-center gap-1 text-meta`,children:[(0,E.jsxs)(`span`,{className:`font-medium text-diff-added`,children:[`+`,t.additions]}),(0,E.jsxs)(`span`,{className:`font-medium text-diff-removed`,children:[`-`,t.removals]})]}):void 0},`${t.path}:${String(t.changeIndex)}`))}function N({nodes:e,onSelect:t,selectedPath:n,showStats:r=!0,viewMode:i=`tree`}){let{t:a}=u(`workbench`),o=(0,T.useMemo)(()=>A(e),[e]),s=(0,T.useMemo)(()=>j(e),[e]),c=e=>r?a(`diff.fileStats`,{additions:e.additions,path:e.path,removals:e.removals}):e.path;return i===`list`?(0,E.jsx)(`div`,{"aria-label":a(`diff.changedFilesNavigation`),className:`font-mono text-label`,"data-slot":`review-file-list`,role:`listbox`,children:s.map(e=>(0,E.jsxs)(`button`,{"aria-label":c(e),"aria-selected":e.path===n,className:`flex min-h-7 w-full min-w-0 items-center gap-1.5 rounded-control px-1.5 text-left outline-none transition-colors hover:bg-control-hover focus-visible:shadow-focus aria-selected:bg-control`,onClick:()=>{t(e.path)},role:`option`,type:`button`,children:[(0,E.jsx)(p,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,E.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.path,children:e.path}),r?(0,E.jsxs)(`span`,{"aria-hidden":`true`,className:`flex shrink-0 items-center gap-1 text-meta`,children:[(0,E.jsxs)(`span`,{className:`font-medium text-diff-added`,children:[`+`,e.additions]}),(0,E.jsxs)(`span`,{className:`font-medium text-diff-removed`,children:[`-`,e.removals]})]}):null]},`${e.path}:${String(e.changeIndex)}`))}):(0,E.jsx)(y,{"aria-label":a(`diff.changedFilesNavigation`),defaultExpanded:o,onSelect:t,selectedPath:n,children:(0,E.jsx)(M,{fileLabel:c,nodes:e,showStats:r})})}var P=(0,T.lazy)(()=>t(()=>import(`./patch-diff-viewer-fv2hVYyb.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]))),F=`(max-width: 760px)`;function I(){return typeof window>`u`||!window.matchMedia(F).matches}function L(e){return e===`ArrowUp`?`previous`:e===`ArrowDown`?`next`:null}function R(e,t,n){return n<=0?0:Math.min(Math.max(e+(t===`next`?1:-1),0),n-1)}function z({changes:e,compact:t=!1,currentIndex:n,navigationFooter:r,onClose:f,onCurrentIndexChange:_,renderContent:v,showStats:y=!0,titleId:x}){let{t:D}=u(`workbench`),[O,A]=g(`review`),j=(0,T.useRef)(null),[M,F]=(0,T.useState)(()=>!t&&I()),z=(0,T.useMemo)(()=>k(e),[e]),B=(0,T.useMemo)(()=>new Map(e.map((e,t)=>[e.path.replaceAll(`\\`,`/`),t])),[e]);if((0,T.useEffect)(()=>{F(!t&&I())},[e,t]),(0,T.useEffect)(()=>{let t=t=>{if(t.defaultPrevented)return;let r=L(t.key);r!==null&&(t.preventDefault(),_(R(n,r,e.length)))};return window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`keydown`,t)}},[e.length,n,_]),(0,T.useLayoutEffect)(()=>{j.current!==null&&(j.current.scrollTop=0)},[n]),e.length===0)return null;let V=e[0];if(V===void 0)return null;let H=e[n]??V,U=H.path.replaceAll(`\\`,`/`),W=C(H.path),G=D(M?`diff.collapseChangedFilesNavigation`:`diff.expandChangedFilesNavigation`),K=t=>{_(R(n,t,e.length))};return(0,E.jsxs)(`section`,{className:`grid h-full min-h-0 w-full min-w-0 grid-rows-[auto_minmax(0,1fr)] bg-raised`,children:[(0,E.jsxs)(`header`,{className:`flex min-h-toolbar min-w-0 items-center gap-2 px-3 shadow-toolbar sm:px-4`,children:[(0,E.jsx)(p,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,E.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,E.jsx)(`h2`,{className:`truncate text-body-small font-semibold`,id:x,title:H.path,children:W}),(0,E.jsx)(`p`,{className:`truncate text-caption text-muted-foreground`,title:H.path,children:H.path})]}),(0,E.jsxs)(`span`,{className:`shrink-0 text-label text-muted-foreground`,children:[n+1,` / `,e.length]}),(0,E.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,E.jsxs)(s,{children:[(0,E.jsx)(a,{asChild:!0,children:(0,E.jsx)(o,{"aria-label":D(`diff.previousFile`),disabled:n===0,onClick:()=>{K(`previous`)},size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,E.jsx)(l,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,E.jsx)(i,{children:D(`diff.previousFile`)})]}),(0,E.jsxs)(s,{children:[(0,E.jsx)(a,{asChild:!0,children:(0,E.jsx)(o,{"aria-label":D(`diff.nextFile`),disabled:n===e.length-1,onClick:()=>{K(`next`)},size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,E.jsx)(c,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,E.jsx)(i,{children:D(`diff.nextFile`)})]}),(0,E.jsxs)(s,{children:[(0,E.jsx)(a,{asChild:!0,children:(0,E.jsx)(o,{"aria-controls":`file-review-navigation`,"aria-expanded":M,"aria-label":G,onClick:()=>{F(e=>!e)},size:`icon-sm`,type:`button`,variant:`ghost`,children:M?(0,E.jsx)(S,{className:`size-3.5`,"aria-hidden":`true`}):(0,E.jsx)(w,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,E.jsx)(i,{children:G})]}),(0,E.jsxs)(s,{children:[(0,E.jsx)(a,{asChild:!0,children:(0,E.jsx)(o,{"aria-label":D(`diff.closeReview`),onClick:f,size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,E.jsx)(d,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,E.jsx)(i,{children:D(`diff.closeReview`)})]})]})]}),(0,E.jsxs)(`div`,{className:`relative grid min-h-0 min-w-0 grid-cols-[minmax(0,1fr)] bg-content ${M&&!t?`workbench:grid-cols-[minmax(0,1fr)_minmax(12rem,26%)]`:``}`,children:[(0,E.jsx)(`section`,{"aria-label":D(`diff.reviewContent`),className:`min-h-0 min-w-0 overflow-auto`,ref:j,children:v===void 0?(0,E.jsx)(T.Suspense,{fallback:(0,E.jsx)(`div`,{className:`grid min-h-48 place-items-center text-body-small text-muted-foreground`,role:`status`,children:D(`diff.loading`)}),children:(0,E.jsx)(P,{change:H})}):v(H)}),(0,E.jsxs)(`aside`,{"aria-label":D(`diff.changedFilesNavigation`),className:`absolute inset-y-0 right-0 z-10 grid min-h-0 w-[min(16rem,82%)] grid-rows-[auto_minmax(0,1fr)] border-l border-separator bg-panel shadow-panel ${t?``:`workbench:static workbench:z-auto workbench:w-auto workbench:shadow-none`}`,hidden:!M,id:`file-review-navigation`,children:[(0,E.jsxs)(`div`,{className:`flex min-h-toolbar items-center gap-2 border-b border-separator px-3`,children:[(0,E.jsx)(b,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),(0,E.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-label font-semibold`,children:D(`diff.changedFiles`)}),(0,E.jsx)(`span`,{className:`text-meta text-muted-foreground`,children:e.length}),(0,E.jsxs)(s,{children:[(0,E.jsx)(a,{asChild:!0,children:(0,E.jsx)(o,{"aria-label":D(O===`tree`?`diff.showFileList`:`diff.showFileTree`),onClick:()=>{A(O===`tree`?`list`:`tree`)},size:`icon-sm`,type:`button`,variant:`ghost`,children:O===`tree`?(0,E.jsx)(m,{"aria-hidden":`true`,className:`size-3.5`}):(0,E.jsx)(h,{"aria-hidden":`true`,className:`size-3.5`})})}),(0,E.jsx)(i,{children:D(O===`tree`?`diff.showFileList`:`diff.showFileTree`)})]})]}),(0,E.jsxs)(`div`,{className:`min-h-0 overflow-y-auto px-2 py-2`,children:[(0,E.jsx)(N,{nodes:z,onSelect:e=>{let t=B.get(e);t!==void 0&&_(t)},selectedPath:U,showStats:y,viewMode:O}),r]})]})]})]})}export{z as FileReviewWorkspace,L as getReviewNavigationDirection,R as resolveReviewIndex};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/patch-diff-viewer-fv2hVYyb.js","assets/rolldown-runtime-B0Z9INg1.js","assets/initial-deps-CqwWvUnY.js","assets/react-runtime-CMZHB3u8.js","assets/initial-deps-B8FrcWWN.js","assets/initial-deps-C0_XYRrC.js","assets/pdf-preview-CEvfJiZa.js","assets/initial-deps-CW5Jl6i2.js","assets/initial-deps-CG4ykI_P.js","assets/initial-deps-D0opk7c-.js","assets/initial-deps-DZ-sH4cr.js","assets/initial-deps-C-3sxJvc.js","assets/initial-deps-Cppvl2Gz.js","assets/scheduled-task-floating-ui~index~workbench-shell~workbench-inspector-changes~project-source~c6tt9j64-ClgveiMa.js","assets/initial-deps-DFOart6r.js","assets/clipboard-BxrWcnRh.js","assets/index-DobF11m_.js","assets/index-CHJSDTYw.css","assets/engine-compile-C-bb4peU.js","assets/lib-21LSAZ-l.js","assets/workbench-shell-B139izuR.js","assets/arrow-down-DoJlTckg.js","assets/prompt-input-rTS8jFNM.js","assets/download-05FmZQzE.js","assets/external-link-DQSTtNhw.js","assets/message-assistant-directive-r0UOX93m.js","assets/image-preview-Bez628xh.js","assets/git-fork-CElzN7bT.js","assets/history-location-C2XDYAuy.js","assets/maximize-2-CawekEKe.js","assets/scan-DyLrpouW.js","assets/workbench-pet-canvas-B5jypDil.js"])))=>i.map(i=>d[i]);
2
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./initial-deps-CqwWvUnY.js";import{i as n,t as r}from"./react-runtime-CMZHB3u8.js";import{n as i,s as a}from"./initial-deps-CW5Jl6i2.js";import{Tt as o}from"./initial-deps-C-3sxJvc.js";import{E as s,at as c,ct as l,o as u}from"./initial-deps-B8FrcWWN.js";import{bt as d,yt as f}from"./index-DobF11m_.js";import{FileReviewWorkspace as p}from"./file-review-dialog-DaGgZASG.js";var m=e(n(),1),h=r(),g=(0,m.lazy)(()=>t(()=>import(`./patch-diff-viewer-fv2hVYyb.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31])));function _({change:e,client:t,projectId:n,repository:r,rootPath:i,sha:s}){let c=a(f(n,i,r,s,e.path,!0,t));if(c.isPending)return(0,h.jsx)(`div`,{className:`grid min-h-48 place-items-center text-body-small text-muted-foreground`,role:`status`,children:l.t(`gitHistory.diffLoading`,{ns:`conversation`})});if(c.error!==null)return(0,h.jsxs)(`div`,{className:`flex min-h-48 flex-col items-center justify-center gap-3 px-5 text-center`,children:[(0,h.jsx)(`p`,{className:`text-body-small text-danger`,children:l.t(`gitHistory.diffLoadError`,{ns:`conversation`})}),(0,h.jsx)(o,{onClick:()=>void c.refetch(),type:`button`,variant:`outline`,children:l.t(`gitHistory.retry`,{ns:`conversation`})})]});let u={...e,diff:c.data.diff};return(0,h.jsxs)(`div`,{className:`min-h-full min-w-max`,children:[c.data.truncated?(0,h.jsx)(`p`,{className:`sticky left-0 top-0 z-10 border-b border-separator bg-warning px-3 py-2 text-caption text-warning-foreground`,role:`status`,children:l.t(`gitHistory.diffTruncated`,{ns:`conversation`})}):null,(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(`div`,{className:`grid min-h-48 place-items-center text-body-small text-muted-foreground`,role:`status`,children:l.t(`gitHistory.diffLoading`,{ns:`conversation`})}),children:(0,h.jsx)(g,{change:u})})]})}function v({client:e,commit:t,onClose:n,projectId:r,repository:a,rootPath:f}){c(`conversation`);let[g,v]=(0,m.useState)(0),y=i(d(r,f,a,t.sha,!0,e)),b=(0,m.useMemo)(()=>y.data?.pages.flatMap(e=>e.files)??[],[y.data?.pages]),x=(0,m.useMemo)(()=>b.map(e=>({...e,diff:``})),[b]);return(0,m.useEffect)(()=>{v(0)},[t.sha]),(0,h.jsx)(`div`,{className:`h-full min-h-0 overflow-hidden`,children:y.isPending||y.error!==null||x.length===0?(0,h.jsxs)(`section`,{className:`grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] bg-raised`,children:[(0,h.jsxs)(`header`,{className:`flex min-h-toolbar min-w-0 items-center gap-2 px-3 shadow-toolbar sm:px-4`,children:[(0,h.jsx)(`h2`,{className:`min-w-0 flex-1 truncate text-body-small font-semibold`,children:t.title}),(0,h.jsx)(o,{"aria-label":l.t(`diff.closeReview`,{ns:`workbench`}),onClick:n,size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,h.jsx)(u,{"aria-hidden":`true`,className:`size-3.5`})})]}),(0,h.jsx)(`div`,{className:`grid min-h-0 place-items-center px-5 text-center text-body-small`,children:y.isPending?(0,h.jsx)(`p`,{className:`text-muted-foreground`,role:`status`,children:l.t(`gitHistory.filesLoading`,{ns:`conversation`})}):y.error===null?(0,h.jsx)(`p`,{className:`text-muted-foreground`,children:l.t(`gitHistory.filesEmpty`,{ns:`conversation`})}):(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,h.jsx)(`p`,{className:`text-danger`,children:l.t(`gitHistory.filesLoadError`,{ns:`conversation`})}),(0,h.jsx)(o,{onClick:()=>void y.refetch(),type:`button`,variant:`outline`,children:l.t(`gitHistory.retry`,{ns:`conversation`})})]})})]}):(0,h.jsx)(p,{changes:x,compact:!0,currentIndex:g,navigationFooter:y.hasNextPage?(0,h.jsx)(`div`,{className:`flex min-h-12 items-center justify-center px-2 py-2`,children:(0,h.jsxs)(o,{disabled:y.isFetchingNextPage,onClick:()=>void y.fetchNextPage(),type:`button`,variant:`outline`,children:[y.isFetchingNextPage?(0,h.jsx)(s,{"aria-hidden":`true`,className:`animate-spin`,"data-icon":`inline-start`}):null,y.isFetchingNextPage?l.t(`gitHistory.loadingMoreFiles`,{ns:`conversation`}):l.t(`gitHistory.loadMoreFiles`,{ns:`conversation`})]})}):null,onClose:n,onCurrentIndexChange:v,renderContent:n=>(0,h.jsx)(_,{change:n,client:e,projectId:r,rootPath:f,...a===void 0?{}:{repository:a},sha:t.sha}),showStats:!1,titleId:`git-commit-review-file-title`})})}export{v as GitCommitReview};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./react-runtime-CMZHB3u8.js";import{n as r}from"./initial-deps-CW5Jl6i2.js";import{Et as i,Tt as a,_t as o,dt as s,lt as c,ut as l}from"./initial-deps-B7SS8XxM.js";import{E as u,at as d,ct as f}from"./initial-deps-B8FrcWWN.js";import{n as p,t as m}from"./clipboard-BxrWcnRh.js";import{It as h,f as g,xt as _}from"./index-DudvUciK.js";import{m as v}from"./workbench-shell-CfN-sr8U.js";var y=e(t(),1),b=n();function x({commit:e,compact:t,dateFormatter:n,unpushedLabel:r}){let a=n.format(new Date(e.authoredAt));return(0,b.jsxs)(`span`,{className:`block w-full min-w-0`,children:[(0,b.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,b.jsx)(`span`,{className:i(`min-w-0 flex-1 truncate font-medium text-foreground`,t?`text-label`:`text-body-small`),title:e.title,children:e.title}),e.unpushed===!0?(0,b.jsx)(`span`,{className:`shrink-0 rounded-sm bg-brand/10 px-1.5 py-0.5 text-meta font-medium text-brand`,"data-slot":`git-unpushed-badge`,children:r}):null]}),(0,b.jsxs)(`span`,{className:i(`flex min-w-0 items-center gap-1.5 text-muted-foreground`,t?`text-meta`:`mt-0.5 text-caption`),children:[(0,b.jsx)(`code`,{className:`shrink-0`,children:e.sha.slice(0,t?7:12)}),(0,b.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,b.jsx)(`span`,{className:`truncate`,title:e.authorEmail,children:e.authorName}),(0,b.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,b.jsx)(`time`,{className:i(t?`min-w-0 truncate`:`shrink-0`),dateTime:e.authoredAt,title:a,children:a})]})]})}function S(e,t){return{author:e.authorName,hash:e.sha,message:e.title}[t]}function C(e,t){m(S(e,t)).catch(()=>void 0)}function w({commit:e}){d(`conversation`);let t=[[`message`,f.t(`gitHistory.copyMessage`,{ns:`conversation`})],[`author`,f.t(`gitHistory.copyAuthor`,{ns:`conversation`})],[`hash`,f.t(`gitHistory.copyHash`,{ns:`conversation`})]];return(0,b.jsx)(l,{"aria-label":f.t(`gitHistory.copyMenuLabel`,{ns:`conversation`}),children:t.map(([t,n])=>(0,b.jsxs)(s,{onSelect:()=>{C(e,t)},children:[(0,b.jsx)(p,{"aria-hidden":`true`,className:`size-3.5`}),n]},t))})}function T({commit:e,compact:t,dateFormatter:n,isLast:r,onSelectCommit:i}){return(0,b.jsxs)(c,{modal:!1,children:[(0,b.jsx)(o,{asChild:!0,children:(0,b.jsxs)(`li`,{className:g(`relative grid min-w-0 grid-cols-[auto_minmax(0,1fr)]`,t?`gap-x-1.5 px-3 py-1.5`:`gap-x-2.5 px-4 py-2.5`),children:[(0,b.jsxs)(`div`,{className:`relative flex w-4 justify-center`,"aria-hidden":`true`,children:[r?null:(0,b.jsx)(`span`,{className:`absolute bottom-[-0.625rem] top-3 w-px bg-separator-strong`}),(0,b.jsx)(v,{className:`relative mt-0.5 size-3.5 text-brand`})]}),i===void 0?(0,b.jsx)(`div`,{className:`min-w-0`,children:(0,b.jsx)(x,{commit:e,compact:t,dateFormatter:n,unpushedLabel:f.t(`gitHistory.unpushed`,{ns:`conversation`})})}):(0,b.jsx)(a,{className:`h-auto min-w-0 justify-start rounded-none p-0 text-left`,contentAlign:`start`,onClick:()=>{i(e)},type:`button`,variant:`ghost`,children:(0,b.jsx)(x,{commit:e,compact:t,dateFormatter:n,unpushedLabel:f.t(`gitHistory.unpushed`,{ns:`conversation`})})})]})}),(0,b.jsx)(w,{commit:e})]})}function E({active:e,className:t,compact:n=!1,dateFormatter:r,panelId:i,onSelectCommit:o,query:s}){let c=(0,y.useMemo)(()=>s.data?.pages.flatMap(e=>e.commits)??[],[s.data?.pages]);return(0,b.jsx)(`div`,{"aria-label":f.t(`gitHistory.commits`,{ns:`conversation`}),className:g(`h-full min-h-0 overflow-y-auto`,!e&&`hidden`,t),"data-slot":`git-history-content`,hidden:!e,id:i,role:`tabpanel`,children:s.isPending?(0,b.jsx)(`p`,{className:`px-5 py-12 text-center text-body-small text-muted-foreground`,children:f.t(`gitHistory.loading`,{ns:`conversation`})}):s.error===null?c.length===0?(0,b.jsx)(`p`,{className:`px-5 py-12 text-center text-body-small text-muted-foreground`,children:f.t(`gitHistory.empty`,{ns:`conversation`})}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`ol`,{"aria-label":f.t(`gitHistory.commits`,{ns:`conversation`}),children:c.map((e,t)=>(0,b.jsx)(T,{commit:e,compact:n,dateFormatter:r,isLast:t===c.length-1,...o===void 0?{}:{onSelectCommit:o}},e.sha))}),(0,b.jsx)(`div`,{className:g(`flex items-center justify-center`,n?`min-h-8 px-3 py-1`:`min-h-12 px-4 py-3`),children:s.hasNextPage?(0,b.jsxs)(a,{className:n?`w-full`:``,disabled:s.isFetchingNextPage,onClick:()=>void s.fetchNextPage(),size:n?`sm`:`default`,type:`button`,variant:`outline`,children:[s.isFetchingNextPage?(0,b.jsx)(u,{"aria-hidden":`true`,className:`animate-spin`,"data-icon":`inline-start`}):null,s.isFetchingNextPage?f.t(`gitHistory.loadingMore`,{ns:`conversation`}):f.t(`gitHistory.loadMore`,{ns:`conversation`})]}):(0,b.jsx)(`p`,{className:`text-caption text-muted-foreground`,role:`status`,children:f.t(`gitHistory.end`,{ns:`conversation`})})})]}):(0,b.jsxs)(`div`,{className:`flex min-h-48 flex-col items-center justify-center gap-3 px-5 text-center`,children:[(0,b.jsx)(`p`,{className:`text-body-small text-danger`,children:f.t(`gitHistory.loadError`,{ns:`conversation`})}),(0,b.jsx)(a,{onClick:()=>void s.refetch(),type:`button`,variant:`outline`,children:f.t(`gitHistory.retry`,{ns:`conversation`})})]})})}function D({client:e=h,onOpenCommit:t=()=>void 0,projectId:n,rootPath:i}){d(`conversation`);let a=r(_(n,i,void 0,!0,e)),o=a.data?.pages[0]?.branch,s=o===void 0?null:o??`detached HEAD`,c=(0,y.useMemo)(()=>new Intl.DateTimeFormat(f.resolvedLanguage===`en`?`en`:`zh-CN`,{dateStyle:`medium`,timeStyle:`short`}),[]);return(0,b.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,"data-slot":`git-history-panel`,children:[(0,b.jsx)(`div`,{className:`shrink-0 px-3 pb-2 pt-1`,children:(0,b.jsx)(`p`,{className:`truncate text-caption text-muted-foreground`,title:s??void 0,children:s===null?f.t(`gitHistory.branchLoading`,{ns:`conversation`}):f.t(`gitHistory.branch`,{branch:s,ns:`conversation`})})}),(0,b.jsx)(`div`,{className:`min-h-0 flex-1`,"data-slot":`git-history-panels`,children:(0,b.jsx)(E,{active:!0,compact:!0,dateFormatter:c,panelId:`git-history-panel`,onSelectCommit:e=>{t(e)},query:a})})]})}export{D as GitHistoryPanel};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./react-runtime-CMZHB3u8.js";import{n as r}from"./initial-deps-CW5Jl6i2.js";import{Et as i,Tt as a,_t as o,dt as s,lt as c,ut as l}from"./initial-deps-C-3sxJvc.js";import{E as u,at as d,ct as f}from"./initial-deps-B8FrcWWN.js";import{n as p,t as m}from"./clipboard-BxrWcnRh.js";import{Lt as h,St as g,f as _}from"./index-DobF11m_.js";import{m as v}from"./workbench-shell-B139izuR.js";var y=e(t(),1),b=n();function x({commit:e,compact:t,dateFormatter:n,unpushedLabel:r}){let a=n.format(new Date(e.authoredAt));return(0,b.jsxs)(`span`,{className:`block w-full min-w-0`,children:[(0,b.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,b.jsx)(`span`,{className:i(`min-w-0 flex-1 truncate font-medium text-foreground`,t?`text-label`:`text-body-small`),title:e.title,children:e.title}),e.unpushed===!0?(0,b.jsx)(`span`,{className:`shrink-0 rounded-sm bg-brand/10 px-1.5 py-0.5 text-meta font-medium text-brand`,"data-slot":`git-unpushed-badge`,children:r}):null]}),(0,b.jsxs)(`span`,{className:i(`flex min-w-0 items-center gap-1.5 text-muted-foreground`,t?`text-meta`:`mt-0.5 text-caption`),children:[(0,b.jsx)(`code`,{className:`shrink-0`,children:e.sha.slice(0,t?7:12)}),(0,b.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,b.jsx)(`span`,{className:`truncate`,title:e.authorEmail,children:e.authorName}),(0,b.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,b.jsx)(`time`,{className:i(t?`min-w-0 truncate`:`shrink-0`),dateTime:e.authoredAt,title:a,children:a})]})]})}function S(e,t){return{author:e.authorName,hash:e.sha,message:e.title}[t]}function C(e,t){m(S(e,t)).catch(()=>void 0)}function w({commit:e}){d(`conversation`);let t=[[`message`,f.t(`gitHistory.copyMessage`,{ns:`conversation`})],[`author`,f.t(`gitHistory.copyAuthor`,{ns:`conversation`})],[`hash`,f.t(`gitHistory.copyHash`,{ns:`conversation`})]];return(0,b.jsx)(l,{"aria-label":f.t(`gitHistory.copyMenuLabel`,{ns:`conversation`}),children:t.map(([t,n])=>(0,b.jsxs)(s,{onSelect:()=>{C(e,t)},children:[(0,b.jsx)(p,{"aria-hidden":`true`,className:`size-3.5`}),n]},t))})}function T({commit:e,compact:t,dateFormatter:n,isLast:r,onSelectCommit:i}){return(0,b.jsxs)(c,{modal:!1,children:[(0,b.jsx)(o,{asChild:!0,children:(0,b.jsxs)(`li`,{className:_(`relative grid min-w-0 grid-cols-[auto_minmax(0,1fr)]`,t?`gap-x-1.5 px-3 py-1.5`:`gap-x-2.5 px-4 py-2.5`),children:[(0,b.jsxs)(`div`,{className:`relative flex w-4 justify-center`,"aria-hidden":`true`,children:[r?null:(0,b.jsx)(`span`,{className:`absolute bottom-[-0.625rem] top-3 w-px bg-separator-strong`}),(0,b.jsx)(v,{className:`relative mt-0.5 size-3.5 text-brand`})]}),i===void 0?(0,b.jsx)(`div`,{className:`min-w-0`,children:(0,b.jsx)(x,{commit:e,compact:t,dateFormatter:n,unpushedLabel:f.t(`gitHistory.unpushed`,{ns:`conversation`})})}):(0,b.jsx)(a,{className:`h-auto min-w-0 justify-start rounded-none p-0 text-left`,contentAlign:`start`,onClick:()=>{i(e)},type:`button`,variant:`ghost`,children:(0,b.jsx)(x,{commit:e,compact:t,dateFormatter:n,unpushedLabel:f.t(`gitHistory.unpushed`,{ns:`conversation`})})})]})}),(0,b.jsx)(w,{commit:e})]})}function E({active:e,className:t,compact:n=!1,dateFormatter:r,panelId:i,onSelectCommit:o,query:s}){let c=(0,y.useMemo)(()=>s.data?.pages.flatMap(e=>e.commits)??[],[s.data?.pages]);return(0,b.jsx)(`div`,{"aria-label":f.t(`gitHistory.commits`,{ns:`conversation`}),className:_(`h-full min-h-0 overflow-y-auto`,!e&&`hidden`,t),"data-slot":`git-history-content`,hidden:!e,id:i,role:`tabpanel`,children:s.isPending?(0,b.jsx)(`p`,{className:`px-5 py-12 text-center text-body-small text-muted-foreground`,children:f.t(`gitHistory.loading`,{ns:`conversation`})}):s.error===null?c.length===0?(0,b.jsx)(`p`,{className:`px-5 py-12 text-center text-body-small text-muted-foreground`,children:f.t(`gitHistory.empty`,{ns:`conversation`})}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`ol`,{"aria-label":f.t(`gitHistory.commits`,{ns:`conversation`}),children:c.map((e,t)=>(0,b.jsx)(T,{commit:e,compact:n,dateFormatter:r,isLast:t===c.length-1,...o===void 0?{}:{onSelectCommit:o}},e.sha))}),(0,b.jsx)(`div`,{className:_(`flex items-center justify-center`,n?`min-h-8 px-3 py-1`:`min-h-12 px-4 py-3`),children:s.hasNextPage?(0,b.jsxs)(a,{className:n?`w-full`:``,disabled:s.isFetchingNextPage,onClick:()=>void s.fetchNextPage(),size:n?`sm`:`default`,type:`button`,variant:`outline`,children:[s.isFetchingNextPage?(0,b.jsx)(u,{"aria-hidden":`true`,className:`animate-spin`,"data-icon":`inline-start`}):null,s.isFetchingNextPage?f.t(`gitHistory.loadingMore`,{ns:`conversation`}):f.t(`gitHistory.loadMore`,{ns:`conversation`})]}):(0,b.jsx)(`p`,{className:`text-caption text-muted-foreground`,role:`status`,children:f.t(`gitHistory.end`,{ns:`conversation`})})})]}):(0,b.jsxs)(`div`,{className:`flex min-h-48 flex-col items-center justify-center gap-3 px-5 text-center`,children:[(0,b.jsx)(`p`,{className:`text-body-small text-danger`,children:f.t(`gitHistory.loadError`,{ns:`conversation`})}),(0,b.jsx)(a,{onClick:()=>void s.refetch(),type:`button`,variant:`outline`,children:f.t(`gitHistory.retry`,{ns:`conversation`})})]})})}function D({client:e=h,onOpenCommit:t=()=>void 0,projectId:n,rootPath:i}){d(`conversation`);let a=r(g(n,i,void 0,!0,e)),o=a.data?.pages[0]?.branch,s=o===void 0?null:o??`detached HEAD`,c=(0,y.useMemo)(()=>new Intl.DateTimeFormat(f.resolvedLanguage===`en`?`en`:`zh-CN`,{dateStyle:`medium`,timeStyle:`short`}),[]);return(0,b.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,"data-slot":`git-history-panel`,children:[(0,b.jsx)(`div`,{className:`shrink-0 px-3 pb-2 pt-1`,children:(0,b.jsx)(`p`,{className:`truncate text-caption text-muted-foreground`,title:s??void 0,children:s===null?f.t(`gitHistory.branchLoading`,{ns:`conversation`}):f.t(`gitHistory.branch`,{branch:s,ns:`conversation`})})}),(0,b.jsx)(`div`,{className:`min-h-0 flex-1`,"data-slot":`git-history-panels`,children:(0,b.jsx)(E,{active:!0,compact:!0,dateFormatter:c,panelId:`git-history-panel`,onSelectCommit:e=>{t(e)},query:a})})]})}export{D as GitHistoryPanel};
@@ -1,2 +1,2 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./react-runtime-CMZHB3u8.js";import{T as r,s as i,u as a}from"./initial-deps-CW5Jl6i2.js";import{B as o,H as s,J as c,K as l,Tt as u,V as d,bt as f,i as p}from"./initial-deps-B7SS8XxM.js";import{E as m,G as h,M as g,Q as _,W as v,at as y,o as ee,p as b,tt as x,z as te}from"./initial-deps-B8FrcWWN.js";import{t as S}from"./external-link-DQSTtNhw.js";import{n as C,t as ne}from"./history-location-C2XDYAuy.js";import{q as re}from"./index-DudvUciK.js";import{t as w}from"./search-highlight-D1T4q4Lr.js";async function T(e,t,n,r){let i=e.flatMap(e=>e.roots.map(t=>({project:e,root:t}))),a=[],o=[],s=!1,c=0;return await Promise.all(Array.from({length:Math.min(2,i.length)},async()=>{for(;c<i.length&&a.length<50;){n.throwIfAborted();let e=i[c++];if(e===void 0)break;let{project:l,root:u}=e;try{let e=await r(l.id,u.path,t,crypto.randomUUID(),{signal:n});n.throwIfAborted();for(let t of e.data){if(a.length>=50){s=!0;break}a.push({...t,projectId:l.id,projectName:l.name})}s||=e.data.length>=50}catch{n.throwIfAborted(),o.push(`${l.name}: ${u.path}`)}}})),s||=a.length>=50&&c<i.length,a.sort((e,t)=>e.projectName.localeCompare(t.projectName)||e.path.localeCompare(t.path)),{failedRoots:o,files:a,truncated:s}}var E=x(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),D=x(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),ie=x(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),O=e(t(),1);async function ae(e,t,n,r){r?.throwIfAborted();let i=p(n.path);if(i===`image`||i===`pdf`)return i;if(i===`source`)try{return await t.fetchInfiniteQuery({gcTime:3e4,initialPageParam:void 0,queryFn:({pageParam:t,signal:r})=>e.readProjectSourceFile(n.projectId,n.rootPath,n.path,t,{signal:r}),queryKey:[`projects`,n.projectId,n.rootPath,`source-file`,n.path],retry:!1,staleTime:3e4}),r?.throwIfAborted(),i}catch{r?.throwIfAborted()}return await e.openProject(n.projectId,n.rootPath,{appId:`system-default`,path:n.path},r===void 0?{}:{signal:r}),null}var k=n();function oe({listRef:e,onBack:t,onOpenTask:n,onScroll:r,onSelect:i,query:a,search:o,task:s}){let{t:c}=y(`workbench`),{results:l}=o;return(0,k.jsxs)(`div`,{className:`max-h-[min(58vh,34rem)] min-h-72 overflow-auto p-3`,onScroll:r,ref:e,children:[(0,k.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3 border-b border-separator px-1 pb-3`,children:[(0,k.jsxs)(u,{onClick:t,size:`sm`,variant:`ghost`,children:[(0,k.jsx)(_,{}),c(`globalSearch.back`)]}),(0,k.jsxs)(u,{onClick:n,size:`sm`,variant:`ghost`,children:[c(`globalSearch.openTask`),(0,k.jsx)(S,{})]})]}),(0,k.jsxs)(`div`,{className:`px-3 pb-2 pt-1`,children:[(0,k.jsx)(`h3`,{className:`truncate text-body font-medium`,children:s.title}),(0,k.jsx)(`p`,{className:`mt-1 text-caption text-muted-foreground`,children:c(`globalSearch.occurrences`)})]}),l.isPending?(0,k.jsxs)(`p`,{className:`flex items-center justify-center gap-2 p-6 text-caption text-muted-foreground`,role:`status`,children:[(0,k.jsx)(m,{className:`size-3.5 animate-spin`}),c(`globalSearch.loading`)]}):null,l.isError?(0,k.jsxs)(`div`,{className:`p-3`,role:`alert`,children:[c(`globalSearch.error`),` `,(0,k.jsx)(u,{onClick:()=>void l.refetch(),size:`sm`,variant:`ghost`,children:c(`globalSearch.retry`)})]}):null,l.data?.data.length===0?(0,k.jsx)(`p`,{className:`p-3`,role:`status`,children:c(`globalSearch.unavailable`)}):null,l.data?.data.map((e,t)=>(0,k.jsxs)(`button`,{className:`group mb-1 flex w-full items-start gap-3 rounded-surface border border-transparent px-3 py-3 text-left text-body-small outline-none transition-[background-color,border-color] hover:border-separator hover:bg-control focus-visible:shadow-focus`,onClick:()=>{i(e)},type:`button`,children:[(0,k.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center rounded-control bg-control text-muted-foreground shadow-sm group-hover:bg-raised group-hover:text-brand`,children:(0,k.jsx)(C,{"aria-hidden":`true`,className:`size-3.5`})}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 leading-5 text-foreground`,children:(0,k.jsx)(w,{query:a,range:e.snippetMatchRange,text:e.snippet})})]},`${e.turnId}:${e.itemId}:${String(t)}`)),(0,k.jsxs)(`div`,{className:`mt-3 flex justify-between border-t border-separator pt-3`,children:[o.hasPrevious?(0,k.jsxs)(u,{onClick:o.previous,size:`sm`,variant:`ghost`,children:[(0,k.jsx)(h,{}),c(`globalSearch.previous`)]}):(0,k.jsx)(`span`,{}),l.data?.nextCursor?(0,k.jsxs)(u,{onClick:o.next,size:`sm`,variant:`ghost`,children:[c(`globalSearch.next`),(0,k.jsx)(v,{})]}):null]})]})}function A({cursors:e,kind:t,nextCursor:n,setCursors:r}){let{t:i}=y(`workbench`);return e.length===1&&!n?null:(0,k.jsxs)(`div`,{className:`mt-2 flex items-center gap-2 border-t border-separator px-3 pt-3 text-caption`,children:[(0,k.jsx)(`span`,{className:`mr-auto text-muted-foreground`,children:i(`globalSearch.${t}`)}),(0,k.jsxs)(u,{disabled:e.length===1,onClick:()=>{r(e=>e.slice(0,-1))},size:`sm`,variant:`ghost`,children:[(0,k.jsx)(h,{}),i(`globalSearch.previous`)]}),(0,k.jsxs)(u,{disabled:!n,onClick:()=>{n&&r(e=>[...e,n])},size:`sm`,variant:`ghost`,children:[i(`globalSearch.next`),(0,k.jsx)(v,{})]})]})}function se({busy:e,onActivate:t,onSelect:n,query:r,rows:i,selectedId:a}){let{t:o}=y(`workbench`);return(0,k.jsx)(`div`,{"aria-busy":e,"aria-label":o(`globalSearch.title`),id:`global-search-results`,role:`listbox`,children:[`tasks`,`history`,`files`].map(e=>{let s=i.filter(t=>t.kind===e);return s.length===0?null:(0,k.jsxs)(`div`,{"aria-label":o(`globalSearch.${e}`),className:`pb-1`,role:`group`,children:[(0,k.jsxs)(`p`,{className:`flex items-center gap-2 px-3 pb-1.5 pt-3 text-caption font-medium text-muted-foreground`,children:[(0,k.jsx)(`span`,{children:o(`globalSearch.${e}`)}),(0,k.jsx)(`span`,{className:`rounded-pill bg-control px-1.5 py-0.5 tabular-nums`,children:s.length})]}),s.map(o=>{let s=i.indexOf(o),c=e===`files`?g:e===`history`?C:D;return(0,k.jsxs)(`button`,{"aria-selected":a===o.id,className:`group flex w-full cursor-pointer items-start gap-3 rounded-surface border border-transparent px-3 py-2.5 text-left text-body-small outline-none transition-[background-color,border-color] hover:bg-control focus-visible:shadow-focus aria-selected:border-separator-strong aria-selected:bg-control`,id:`global-search-option-${String(s)}`,onClick:()=>{t(o)},onMouseEnter:()=>{n(o.id)},role:`option`,tabIndex:-1,type:`button`,children:[(0,k.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center rounded-control bg-control text-muted-foreground shadow-sm transition-colors group-aria-selected:bg-raised group-aria-selected:text-brand`,children:(0,k.jsx)(c,{"aria-hidden":`true`,className:`size-3.5`})}),(0,k.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:(0,k.jsx)(w,{query:r,text:o.title})}),(0,k.jsx)(`span`,{className:`block truncate text-caption text-muted-foreground`,children:o.subtitle}),o.snippet?(0,k.jsx)(`span`,{className:`mt-1 line-clamp-2 block text-muted-foreground`,children:(0,k.jsx)(w,{query:r,text:o.snippet})}):null]}),(0,k.jsx)(E,{"aria-hidden":`true`,className:`mt-1 size-3.5 shrink-0 text-muted-foreground opacity-0 transition-opacity group-aria-selected:opacity-100`})]},o.id)})]},e)})})}function j(e,t,n,r){return T(t,n,r,(...t)=>e.searchProjectFiles(...t))}function ce(e,t,n,r,a,o,s,c,l=!0){let[u,d]=(0,O.useState)(``);(0,O.useEffect)(()=>{let e=window.setTimeout(()=>{d(n)},180);return()=>{window.clearTimeout(e)}},[n]);let f=l&&n.length>0&&n===u&&!o,p={gcTime:3e4,refetchOnWindowFocus:!1,retry:!1,staleTime:1/0},m=i({...p,enabled:f&&(r===`all`||r===`tasks`),queryFn:({signal:t})=>e.searchTasks({archived:a,...s===void 0?{}:{cursor:s},kind:`tasks`,query:n},{signal:t}),queryKey:[`global-search`,`tasks`,n,a,s]}),h=i({...p,enabled:f&&(r===`all`||r===`history`),queryFn:({signal:t})=>e.searchTasks({archived:a,...c===void 0?{}:{cursor:c},kind:`history`,query:n},{signal:t}),queryKey:[`global-search`,`history`,n,a,c]});return{files:i({...p,enabled:f&&(r===`all`||r===`files`),queryFn:({signal:r})=>j(e,t,n,r),queryKey:[`global-search`,`files`,n,t.map(({id:e,roots:t})=>[e,t])]}),history:h,tasks:m,waiting:n.length>0&&!f}}function le(e,t,n,r){let[a,o]=(0,O.useState)({cursors:[void 0],key:``}),s=JSON.stringify([t?.projectId,t?.id,n]),c=a.key===s?a.cursors:[void 0],l=t,u=i({enabled:r&&t!==null&&n.length>0,gcTime:3e4,queryFn:({signal:t})=>{if(l===null)throw Error(`Search task is unavailable`);return e.searchTaskOccurrences(l.projectId,l.id,n,c.at(-1),{signal:t})},queryKey:[`global-search`,`occurrences`,t?.projectId,t?.id,n,c.at(-1)],refetchOnWindowFocus:!1,retry:!1,staleTime:1/0});return{hasPrevious:c.length>1,next:()=>{o({cursors:[...c,u.data?.nextCursor??void 0],key:s})},previous:()=>{o({cursors:c.slice(0,-1),key:s})},results:u}}function M(e){let t=e?.closest(`[data-split-pane]`);if(t==null||e?.isConnected&&t.getAttribute(`data-active`)===`true`)return!1;let n=document.querySelector(`[data-split-pane][data-active="true"]`);return n!==null&&(n.focus({preventScroll:!0}),!0)}function ue(e,t,n,r){let i=a(),o=(0,O.useRef)(null),s=(0,O.useRef)(0);return(0,O.useEffect)(()=>{e||(r.current?.abort(),i.cancelQueries({queryKey:[`global-search`]}))},[r,i,e]),(0,O.useEffect)(()=>()=>r.current?.abort(),[r]),{onCloseAutoFocus:e=>{e.preventDefault(),M(o.current)||o.current?.focus()},onOpenAutoFocus:e=>{e.preventDefault(),o.current=document.activeElement instanceof HTMLElement?document.activeElement:null,t.current?.focus(),t.current?.select(),n.current!==null&&(n.current.scrollTop=s.current)},onScroll:e=>{s.current=e.currentTarget.scrollTop},resetScroll:()=>{s.current=0}}}function N({client:e,onClose:t,onOpenFile:n,open:i,projects:p}){let{t:h}=y(`workbench`),g=r(),_=a(),[v,x]=(0,O.useState)(``),[S,C]=(0,O.useState)(`all`),[w,T]=(0,O.useState)(!1),[E,D]=(0,O.useState)(!1),[j,M]=(0,O.useState)(null),[N,P]=(0,O.useState)([void 0]),[F,I]=(0,O.useState)([void 0]),[L,R]=(0,O.useState)(null),[de,z]=(0,O.useState)(!1),B=(0,O.useRef)(!1),V=(0,O.useRef)(null),H=(0,O.useRef)(null),U=(0,O.useRef)(null),W=ue(i,H,U,V),G=v.trim(),fe=le(e,L,G,i),K=ce(e,p,L===null?G:``,S,w,E,N.at(-1),F.at(-1),i),pe=new Map(p.map(e=>[e.id,e.name])),q=[];for(let e of[`tasks`,`history`])if(S===`all`||S===e)for(let t of K[e].data?.data??[])q.push({id:`${e}:${t.task.id}`,kind:e,...t.occurrence===void 0?{}:{occurrence:t.occurrence},snippet:t.snippet,subtitle:pe.get(t.task.projectId)??h(`globalSearch.temporary`),task:t.task,title:t.task.title});if(S===`all`||S===`files`)for(let e of K.files.data?.files??[])q.push({file:e,id:`file:${e.projectId}:${e.rootPath}:${e.path}`,kind:`files`,snippet:``,subtitle:`${e.projectName} · ${e.path}`,title:e.name});let J=Math.max(0,q.findIndex(e=>e.id===j)),Y=q[J],X=S===`all`?[K.tasks,K.history,K.files]:[K[S]],Z=G.length>0&&(K.waiting||X.some(e=>e.isFetching)),me=X.some(e=>e.isError);(0,O.useEffect)(()=>{U.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`})},[Y?.id]);let Q=async(e,n)=>{if(ne.getState().setLocation(n===void 0?null:{...n,projectId:e.projectId,query:G,taskId:e.id}),f({projectId:e.projectId,taskId:e.id})){t();return}await(e.projectId===`temporary`?g({params:{taskId:e.id},to:`/temporary/t/$taskId`}):g({params:{projectId:e.projectId,taskId:e.id},to:`/p/$projectId/t/$taskId`})),t()},he=async r=>{if(B.current)return;B.current=!0;let i=new AbortController;V.current=i,z(!0);try{if(r.kind===`history`&&r.task!==void 0)r.occurrence===void 0?R(r.task):await Q(r.task,r.occurrence);else if(r.file!==void 0){let a=await ae(e,_,r.file,i.signal);a!==null&&(n(r.file,a),t())}else r.task!==void 0&&await Q(r.task)}catch(e){i.signal.aborted||re(e instanceof Error?e:Error(String(e)))}finally{B.current=!1,z(!1)}},$=()=>{W.resetScroll(),V.current?.abort(),M(null),P([void 0]),I([void 0]),R(null)};return(0,k.jsx)(k.Fragment,{children:(0,k.jsx)(d,{open:i,onOpenChange:e=>{e||t()},children:(0,k.jsxs)(s,{"aria-describedby":void 0,className:`top-[12%] max-w-[46rem] -translate-y-0 gap-0 overflow-hidden border border-separator-strong p-0 shadow-floating`,onCloseAutoFocus:W.onCloseAutoFocus,onOpenAutoFocus:W.onOpenAutoFocus,children:[(0,k.jsx)(l,{className:`sr-only`,children:h(`globalSearch.title`)}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-separator px-4 pb-3 pt-4`,children:[(0,k.jsxs)(`div`,{className:`flex h-10 min-w-0 flex-1 items-center gap-2.5 rounded-surface border border-separator-strong bg-control px-3 transition-[background-color,border-color,box-shadow] focus-within:border-brand focus-within:bg-panel focus-within:shadow-focus`,children:[(0,k.jsx)(b,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),(0,k.jsx)(o,{"aria-activedescendant":L===null&&Y!==void 0?`global-search-option-${String(J)}`:void 0,"aria-autocomplete":`list`,"aria-controls":`global-search-results`,"aria-expanded":L===null,"aria-label":h(`globalSearch.title`),autoComplete:`off`,className:`h-full rounded-control appearance-none border-0 bg-transparent p-0 text-body focus-visible:shadow-none`,"data-global-search-input":!0,maxLength:1024,onChange:e=>{x(e.currentTarget.value),$()},onCompositionEnd:()=>{D(!1)},onCompositionStart:()=>{D(!0)},onKeyDown:e=>{if(!(e.nativeEvent.isComposing||E)){if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`f`){e.preventDefault(),e.currentTarget.select();return}if(L===null&&q.length!==0){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:q.length-1,n=q[(J+t)%q.length];n!==void 0&&M(n.id)}else e.key===`Enter`&&Y!==void 0&&(e.preventDefault(),he(Y))}}},placeholder:h(`globalSearch.placeholder`),ref:H,role:`combobox`,spellCheck:!1,value:v,variant:`embedded`}),v.length>0?(0,k.jsx)(u,{"aria-label":h(`globalSearch.clear`),className:`text-muted-foreground`,onClick:()=>{x(``),$(),H.current?.focus()},size:`icon-sm`,variant:`ghost`,children:(0,k.jsx)(te,{className:`size-3.5`})}):null]}),(0,k.jsx)(u,{"aria-label":h(`globalSearch.close`),className:`size-10`,onClick:t,size:`icon-compact`,variant:`ghost`,children:(0,k.jsx)(ee,{className:`size-4`})})]}),(0,k.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-separator px-4 py-2.5`,children:[(0,k.jsx)(`div`,{"aria-label":h(`globalSearch.categories`),className:`grid grid-cols-4 rounded-control bg-control p-0.5`,role:`group`,children:[`all`,`tasks`,`history`,`files`].map(e=>(0,k.jsx)(u,{"aria-pressed":S===e,className:`h-7 px-3 ${S===e?`bg-raised text-foreground shadow-control`:`text-muted-foreground`}`,onClick:()=>{C(e),$()},size:`sm`,variant:`ghost`,children:h(`globalSearch.${e}`)},e))}),(0,k.jsxs)(`label`,{className:`ml-auto flex cursor-pointer items-center gap-2 rounded-control px-2 py-1.5 text-caption text-muted-foreground transition-colors hover:bg-control hover:text-foreground`,children:[(0,k.jsx)(c,{checked:w,onCheckedChange:e=>{T(e===!0),$()}}),h(`globalSearch.archived`)]})]}),L===null?(0,k.jsxs)(`div`,{className:`max-h-[min(58vh,34rem)] min-h-72 overflow-y-auto p-2`,onScroll:W.onScroll,ref:U,children:[G.length===0?(0,k.jsx)(`div`,{className:`grid min-h-64 place-items-center px-6 text-center text-muted-foreground`,children:(0,k.jsxs)(`div`,{children:[(0,k.jsx)(b,{className:`mx-auto mb-3 size-6 opacity-60`}),(0,k.jsx)(`p`,{className:`text-body-small`,children:h(`globalSearch.hint`)})]})}):null,(0,k.jsx)(se,{busy:Z||de,onActivate:e=>{he(e)},onSelect:M,query:G,rows:q,selectedId:Y?.id}),Z?(0,k.jsxs)(`p`,{className:`flex items-center justify-center gap-2 p-5 text-caption text-muted-foreground`,role:`status`,children:[(0,k.jsx)(m,{className:`size-3.5 animate-spin`}),h(`globalSearch.loading`)]}):null,me?(0,k.jsxs)(`div`,{className:`p-3 text-caption text-danger`,role:`alert`,children:[h(`globalSearch.error`),` `,(0,k.jsx)(u,{onClick:()=>{for(let e of X)e.isError&&e.refetch()},size:`sm`,variant:`ghost`,children:h(`globalSearch.retry`)})]}):null,!Z&&!me&&G&&q.length===0?(0,k.jsx)(`div`,{className:`grid min-h-56 place-items-center px-6 text-center text-muted-foreground`,role:`status`,children:(0,k.jsxs)(`div`,{children:[(0,k.jsx)(ie,{className:`mx-auto mb-3 size-6 opacity-60`}),(0,k.jsx)(`p`,{className:`text-body-small`,children:h(`globalSearch.empty`)})]})}):null,K.files.data?.failedRoots.length?(0,k.jsx)(`p`,{className:`p-3 text-caption text-warning`,role:`alert`,title:K.files.data.failedRoots.join(`
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./react-runtime-CMZHB3u8.js";import{T as r,s as i,u as a}from"./initial-deps-CW5Jl6i2.js";import{B as o,H as s,J as c,K as l,Tt as u,V as d,bt as f,i as p}from"./initial-deps-C-3sxJvc.js";import{E as m,G as h,M as g,Q as _,W as v,at as y,o as ee,p as b,tt as x,z as te}from"./initial-deps-B8FrcWWN.js";import{t as S}from"./external-link-DQSTtNhw.js";import{n as C,t as ne}from"./history-location-C2XDYAuy.js";import{J as re}from"./index-DobF11m_.js";import{t as w}from"./search-highlight-D1T4q4Lr.js";async function T(e,t,n,r){let i=e.flatMap(e=>e.roots.map(t=>({project:e,root:t}))),a=[],o=[],s=!1,c=0;return await Promise.all(Array.from({length:Math.min(2,i.length)},async()=>{for(;c<i.length&&a.length<50;){n.throwIfAborted();let e=i[c++];if(e===void 0)break;let{project:l,root:u}=e;try{let e=await r(l.id,u.path,t,crypto.randomUUID(),{signal:n});n.throwIfAborted();for(let t of e.data){if(a.length>=50){s=!0;break}a.push({...t,projectId:l.id,projectName:l.name})}s||=e.data.length>=50}catch{n.throwIfAborted(),o.push(`${l.name}: ${u.path}`)}}})),s||=a.length>=50&&c<i.length,a.sort((e,t)=>e.projectName.localeCompare(t.projectName)||e.path.localeCompare(t.path)),{failedRoots:o,files:a,truncated:s}}var E=x(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),D=x(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),ie=x(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),O=e(t(),1);async function ae(e,t,n,r){r?.throwIfAborted();let i=p(n.path);if(i===`image`||i===`pdf`)return i;if(i===`source`)try{return await t.fetchInfiniteQuery({gcTime:3e4,initialPageParam:void 0,queryFn:({pageParam:t,signal:r})=>e.readProjectSourceFile(n.projectId,n.rootPath,n.path,t,{signal:r}),queryKey:[`projects`,n.projectId,n.rootPath,`source-file`,n.path],retry:!1,staleTime:3e4}),r?.throwIfAborted(),i}catch{r?.throwIfAborted()}return await e.openProject(n.projectId,n.rootPath,{appId:`system-default`,path:n.path},r===void 0?{}:{signal:r}),null}var k=n();function oe({listRef:e,onBack:t,onOpenTask:n,onScroll:r,onSelect:i,query:a,search:o,task:s}){let{t:c}=y(`workbench`),{results:l}=o;return(0,k.jsxs)(`div`,{className:`max-h-[min(58vh,34rem)] min-h-72 overflow-auto p-3`,onScroll:r,ref:e,children:[(0,k.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3 border-b border-separator px-1 pb-3`,children:[(0,k.jsxs)(u,{onClick:t,size:`sm`,variant:`ghost`,children:[(0,k.jsx)(_,{}),c(`globalSearch.back`)]}),(0,k.jsxs)(u,{onClick:n,size:`sm`,variant:`ghost`,children:[c(`globalSearch.openTask`),(0,k.jsx)(S,{})]})]}),(0,k.jsxs)(`div`,{className:`px-3 pb-2 pt-1`,children:[(0,k.jsx)(`h3`,{className:`truncate text-body font-medium`,children:s.title}),(0,k.jsx)(`p`,{className:`mt-1 text-caption text-muted-foreground`,children:c(`globalSearch.occurrences`)})]}),l.isPending?(0,k.jsxs)(`p`,{className:`flex items-center justify-center gap-2 p-6 text-caption text-muted-foreground`,role:`status`,children:[(0,k.jsx)(m,{className:`size-3.5 animate-spin`}),c(`globalSearch.loading`)]}):null,l.isError?(0,k.jsxs)(`div`,{className:`p-3`,role:`alert`,children:[c(`globalSearch.error`),` `,(0,k.jsx)(u,{onClick:()=>void l.refetch(),size:`sm`,variant:`ghost`,children:c(`globalSearch.retry`)})]}):null,l.data?.data.length===0?(0,k.jsx)(`p`,{className:`p-3`,role:`status`,children:c(`globalSearch.unavailable`)}):null,l.data?.data.map((e,t)=>(0,k.jsxs)(`button`,{className:`group mb-1 flex w-full items-start gap-3 rounded-surface border border-transparent px-3 py-3 text-left text-body-small outline-none transition-[background-color,border-color] hover:border-separator hover:bg-control focus-visible:shadow-focus`,onClick:()=>{i(e)},type:`button`,children:[(0,k.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center rounded-control bg-control text-muted-foreground shadow-sm group-hover:bg-raised group-hover:text-brand`,children:(0,k.jsx)(C,{"aria-hidden":`true`,className:`size-3.5`})}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 leading-5 text-foreground`,children:(0,k.jsx)(w,{query:a,range:e.snippetMatchRange,text:e.snippet})})]},`${e.turnId}:${e.itemId}:${String(t)}`)),(0,k.jsxs)(`div`,{className:`mt-3 flex justify-between border-t border-separator pt-3`,children:[o.hasPrevious?(0,k.jsxs)(u,{onClick:o.previous,size:`sm`,variant:`ghost`,children:[(0,k.jsx)(h,{}),c(`globalSearch.previous`)]}):(0,k.jsx)(`span`,{}),l.data?.nextCursor?(0,k.jsxs)(u,{onClick:o.next,size:`sm`,variant:`ghost`,children:[c(`globalSearch.next`),(0,k.jsx)(v,{})]}):null]})]})}function A({cursors:e,kind:t,nextCursor:n,setCursors:r}){let{t:i}=y(`workbench`);return e.length===1&&!n?null:(0,k.jsxs)(`div`,{className:`mt-2 flex items-center gap-2 border-t border-separator px-3 pt-3 text-caption`,children:[(0,k.jsx)(`span`,{className:`mr-auto text-muted-foreground`,children:i(`globalSearch.${t}`)}),(0,k.jsxs)(u,{disabled:e.length===1,onClick:()=>{r(e=>e.slice(0,-1))},size:`sm`,variant:`ghost`,children:[(0,k.jsx)(h,{}),i(`globalSearch.previous`)]}),(0,k.jsxs)(u,{disabled:!n,onClick:()=>{n&&r(e=>[...e,n])},size:`sm`,variant:`ghost`,children:[i(`globalSearch.next`),(0,k.jsx)(v,{})]})]})}function se({busy:e,onActivate:t,onSelect:n,query:r,rows:i,selectedId:a}){let{t:o}=y(`workbench`);return(0,k.jsx)(`div`,{"aria-busy":e,"aria-label":o(`globalSearch.title`),id:`global-search-results`,role:`listbox`,children:[`tasks`,`history`,`files`].map(e=>{let s=i.filter(t=>t.kind===e);return s.length===0?null:(0,k.jsxs)(`div`,{"aria-label":o(`globalSearch.${e}`),className:`pb-1`,role:`group`,children:[(0,k.jsxs)(`p`,{className:`flex items-center gap-2 px-3 pb-1.5 pt-3 text-caption font-medium text-muted-foreground`,children:[(0,k.jsx)(`span`,{children:o(`globalSearch.${e}`)}),(0,k.jsx)(`span`,{className:`rounded-pill bg-control px-1.5 py-0.5 tabular-nums`,children:s.length})]}),s.map(o=>{let s=i.indexOf(o),c=e===`files`?g:e===`history`?C:D;return(0,k.jsxs)(`button`,{"aria-selected":a===o.id,className:`group flex w-full cursor-pointer items-start gap-3 rounded-surface border border-transparent px-3 py-2.5 text-left text-body-small outline-none transition-[background-color,border-color] hover:bg-control focus-visible:shadow-focus aria-selected:border-separator-strong aria-selected:bg-control`,id:`global-search-option-${String(s)}`,onClick:()=>{t(o)},onMouseEnter:()=>{n(o.id)},role:`option`,tabIndex:-1,type:`button`,children:[(0,k.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center rounded-control bg-control text-muted-foreground shadow-sm transition-colors group-aria-selected:bg-raised group-aria-selected:text-brand`,children:(0,k.jsx)(c,{"aria-hidden":`true`,className:`size-3.5`})}),(0,k.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(`span`,{className:`block truncate font-medium text-foreground`,children:(0,k.jsx)(w,{query:r,text:o.title})}),(0,k.jsx)(`span`,{className:`block truncate text-caption text-muted-foreground`,children:o.subtitle}),o.snippet?(0,k.jsx)(`span`,{className:`mt-1 line-clamp-2 block text-muted-foreground`,children:(0,k.jsx)(w,{query:r,text:o.snippet})}):null]}),(0,k.jsx)(E,{"aria-hidden":`true`,className:`mt-1 size-3.5 shrink-0 text-muted-foreground opacity-0 transition-opacity group-aria-selected:opacity-100`})]},o.id)})]},e)})})}function j(e,t,n,r){return T(t,n,r,(...t)=>e.searchProjectFiles(...t))}function ce(e,t,n,r,a,o,s,c,l=!0){let[u,d]=(0,O.useState)(``);(0,O.useEffect)(()=>{let e=window.setTimeout(()=>{d(n)},180);return()=>{window.clearTimeout(e)}},[n]);let f=l&&n.length>0&&n===u&&!o,p={gcTime:3e4,refetchOnWindowFocus:!1,retry:!1,staleTime:1/0},m=i({...p,enabled:f&&(r===`all`||r===`tasks`),queryFn:({signal:t})=>e.searchTasks({archived:a,...s===void 0?{}:{cursor:s},kind:`tasks`,query:n},{signal:t}),queryKey:[`global-search`,`tasks`,n,a,s]}),h=i({...p,enabled:f&&(r===`all`||r===`history`),queryFn:({signal:t})=>e.searchTasks({archived:a,...c===void 0?{}:{cursor:c},kind:`history`,query:n},{signal:t}),queryKey:[`global-search`,`history`,n,a,c]});return{files:i({...p,enabled:f&&(r===`all`||r===`files`),queryFn:({signal:r})=>j(e,t,n,r),queryKey:[`global-search`,`files`,n,t.map(({id:e,roots:t})=>[e,t])]}),history:h,tasks:m,waiting:n.length>0&&!f}}function le(e,t,n,r){let[a,o]=(0,O.useState)({cursors:[void 0],key:``}),s=JSON.stringify([t?.projectId,t?.id,n]),c=a.key===s?a.cursors:[void 0],l=t,u=i({enabled:r&&t!==null&&n.length>0,gcTime:3e4,queryFn:({signal:t})=>{if(l===null)throw Error(`Search task is unavailable`);return e.searchTaskOccurrences(l.projectId,l.id,n,c.at(-1),{signal:t})},queryKey:[`global-search`,`occurrences`,t?.projectId,t?.id,n,c.at(-1)],refetchOnWindowFocus:!1,retry:!1,staleTime:1/0});return{hasPrevious:c.length>1,next:()=>{o({cursors:[...c,u.data?.nextCursor??void 0],key:s})},previous:()=>{o({cursors:c.slice(0,-1),key:s})},results:u}}function M(e){let t=e?.closest(`[data-split-pane]`);if(t==null||e?.isConnected&&t.getAttribute(`data-active`)===`true`)return!1;let n=document.querySelector(`[data-split-pane][data-active="true"]`);return n!==null&&(n.focus({preventScroll:!0}),!0)}function ue(e,t,n,r){let i=a(),o=(0,O.useRef)(null),s=(0,O.useRef)(0);return(0,O.useEffect)(()=>{e||(r.current?.abort(),i.cancelQueries({queryKey:[`global-search`]}))},[r,i,e]),(0,O.useEffect)(()=>()=>r.current?.abort(),[r]),{onCloseAutoFocus:e=>{e.preventDefault(),M(o.current)||o.current?.focus()},onOpenAutoFocus:e=>{e.preventDefault(),o.current=document.activeElement instanceof HTMLElement?document.activeElement:null,t.current?.focus(),t.current?.select(),n.current!==null&&(n.current.scrollTop=s.current)},onScroll:e=>{s.current=e.currentTarget.scrollTop},resetScroll:()=>{s.current=0}}}function N({client:e,onClose:t,onOpenFile:n,open:i,projects:p}){let{t:h}=y(`workbench`),g=r(),_=a(),[v,x]=(0,O.useState)(``),[S,C]=(0,O.useState)(`all`),[w,T]=(0,O.useState)(!1),[E,D]=(0,O.useState)(!1),[j,M]=(0,O.useState)(null),[N,P]=(0,O.useState)([void 0]),[F,I]=(0,O.useState)([void 0]),[L,R]=(0,O.useState)(null),[de,z]=(0,O.useState)(!1),B=(0,O.useRef)(!1),V=(0,O.useRef)(null),H=(0,O.useRef)(null),U=(0,O.useRef)(null),W=ue(i,H,U,V),G=v.trim(),fe=le(e,L,G,i),K=ce(e,p,L===null?G:``,S,w,E,N.at(-1),F.at(-1),i),pe=new Map(p.map(e=>[e.id,e.name])),q=[];for(let e of[`tasks`,`history`])if(S===`all`||S===e)for(let t of K[e].data?.data??[])q.push({id:`${e}:${t.task.id}`,kind:e,...t.occurrence===void 0?{}:{occurrence:t.occurrence},snippet:t.snippet,subtitle:pe.get(t.task.projectId)??h(`globalSearch.temporary`),task:t.task,title:t.task.title});if(S===`all`||S===`files`)for(let e of K.files.data?.files??[])q.push({file:e,id:`file:${e.projectId}:${e.rootPath}:${e.path}`,kind:`files`,snippet:``,subtitle:`${e.projectName} · ${e.path}`,title:e.name});let J=Math.max(0,q.findIndex(e=>e.id===j)),Y=q[J],X=S===`all`?[K.tasks,K.history,K.files]:[K[S]],Z=G.length>0&&(K.waiting||X.some(e=>e.isFetching)),me=X.some(e=>e.isError);(0,O.useEffect)(()=>{U.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`})},[Y?.id]);let Q=async(e,n)=>{if(ne.getState().setLocation(n===void 0?null:{...n,projectId:e.projectId,query:G,taskId:e.id}),f({projectId:e.projectId,taskId:e.id})){t();return}await(e.projectId===`temporary`?g({params:{taskId:e.id},to:`/temporary/t/$taskId`}):g({params:{projectId:e.projectId,taskId:e.id},to:`/p/$projectId/t/$taskId`})),t()},he=async r=>{if(B.current)return;B.current=!0;let i=new AbortController;V.current=i,z(!0);try{if(r.kind===`history`&&r.task!==void 0)r.occurrence===void 0?R(r.task):await Q(r.task,r.occurrence);else if(r.file!==void 0){let a=await ae(e,_,r.file,i.signal);a!==null&&(n(r.file,a),t())}else r.task!==void 0&&await Q(r.task)}catch(e){i.signal.aborted||re(e instanceof Error?e:Error(String(e)))}finally{B.current=!1,z(!1)}},$=()=>{W.resetScroll(),V.current?.abort(),M(null),P([void 0]),I([void 0]),R(null)};return(0,k.jsx)(k.Fragment,{children:(0,k.jsx)(d,{open:i,onOpenChange:e=>{e||t()},children:(0,k.jsxs)(s,{"aria-describedby":void 0,className:`top-[12%] max-w-[46rem] -translate-y-0 gap-0 overflow-hidden border border-separator-strong p-0 shadow-floating`,onCloseAutoFocus:W.onCloseAutoFocus,onOpenAutoFocus:W.onOpenAutoFocus,children:[(0,k.jsx)(l,{className:`sr-only`,children:h(`globalSearch.title`)}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-separator px-4 pb-3 pt-4`,children:[(0,k.jsxs)(`div`,{className:`flex h-10 min-w-0 flex-1 items-center gap-2.5 rounded-surface border border-separator-strong bg-control px-3 transition-[background-color,border-color,box-shadow] focus-within:border-brand focus-within:bg-panel focus-within:shadow-focus`,children:[(0,k.jsx)(b,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),(0,k.jsx)(o,{"aria-activedescendant":L===null&&Y!==void 0?`global-search-option-${String(J)}`:void 0,"aria-autocomplete":`list`,"aria-controls":`global-search-results`,"aria-expanded":L===null,"aria-label":h(`globalSearch.title`),autoComplete:`off`,className:`h-full rounded-control appearance-none border-0 bg-transparent p-0 text-body focus-visible:shadow-none`,"data-global-search-input":!0,maxLength:1024,onChange:e=>{x(e.currentTarget.value),$()},onCompositionEnd:()=>{D(!1)},onCompositionStart:()=>{D(!0)},onKeyDown:e=>{if(!(e.nativeEvent.isComposing||E)){if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`f`){e.preventDefault(),e.currentTarget.select();return}if(L===null&&q.length!==0){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:q.length-1,n=q[(J+t)%q.length];n!==void 0&&M(n.id)}else e.key===`Enter`&&Y!==void 0&&(e.preventDefault(),he(Y))}}},placeholder:h(`globalSearch.placeholder`),ref:H,role:`combobox`,spellCheck:!1,value:v,variant:`embedded`}),v.length>0?(0,k.jsx)(u,{"aria-label":h(`globalSearch.clear`),className:`text-muted-foreground`,onClick:()=>{x(``),$(),H.current?.focus()},size:`icon-sm`,variant:`ghost`,children:(0,k.jsx)(te,{className:`size-3.5`})}):null]}),(0,k.jsx)(u,{"aria-label":h(`globalSearch.close`),className:`size-10`,onClick:t,size:`icon-compact`,variant:`ghost`,children:(0,k.jsx)(ee,{className:`size-4`})})]}),(0,k.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-separator px-4 py-2.5`,children:[(0,k.jsx)(`div`,{"aria-label":h(`globalSearch.categories`),className:`grid grid-cols-4 rounded-control bg-control p-0.5`,role:`group`,children:[`all`,`tasks`,`history`,`files`].map(e=>(0,k.jsx)(u,{"aria-pressed":S===e,className:`h-7 px-3 ${S===e?`bg-raised text-foreground shadow-control`:`text-muted-foreground`}`,onClick:()=>{C(e),$()},size:`sm`,variant:`ghost`,children:h(`globalSearch.${e}`)},e))}),(0,k.jsxs)(`label`,{className:`ml-auto flex cursor-pointer items-center gap-2 rounded-control px-2 py-1.5 text-caption text-muted-foreground transition-colors hover:bg-control hover:text-foreground`,children:[(0,k.jsx)(c,{checked:w,onCheckedChange:e=>{T(e===!0),$()}}),h(`globalSearch.archived`)]})]}),L===null?(0,k.jsxs)(`div`,{className:`max-h-[min(58vh,34rem)] min-h-72 overflow-y-auto p-2`,onScroll:W.onScroll,ref:U,children:[G.length===0?(0,k.jsx)(`div`,{className:`grid min-h-64 place-items-center px-6 text-center text-muted-foreground`,children:(0,k.jsxs)(`div`,{children:[(0,k.jsx)(b,{className:`mx-auto mb-3 size-6 opacity-60`}),(0,k.jsx)(`p`,{className:`text-body-small`,children:h(`globalSearch.hint`)})]})}):null,(0,k.jsx)(se,{busy:Z||de,onActivate:e=>{he(e)},onSelect:M,query:G,rows:q,selectedId:Y?.id}),Z?(0,k.jsxs)(`p`,{className:`flex items-center justify-center gap-2 p-5 text-caption text-muted-foreground`,role:`status`,children:[(0,k.jsx)(m,{className:`size-3.5 animate-spin`}),h(`globalSearch.loading`)]}):null,me?(0,k.jsxs)(`div`,{className:`p-3 text-caption text-danger`,role:`alert`,children:[h(`globalSearch.error`),` `,(0,k.jsx)(u,{onClick:()=>{for(let e of X)e.isError&&e.refetch()},size:`sm`,variant:`ghost`,children:h(`globalSearch.retry`)})]}):null,!Z&&!me&&G&&q.length===0?(0,k.jsx)(`div`,{className:`grid min-h-56 place-items-center px-6 text-center text-muted-foreground`,role:`status`,children:(0,k.jsxs)(`div`,{children:[(0,k.jsx)(ie,{className:`mx-auto mb-3 size-6 opacity-60`}),(0,k.jsx)(`p`,{className:`text-body-small`,children:h(`globalSearch.empty`)})]})}):null,K.files.data?.failedRoots.length?(0,k.jsx)(`p`,{className:`p-3 text-caption text-warning`,role:`alert`,title:K.files.data.failedRoots.join(`
2
2
  `),children:h(`globalSearch.partial`)}):null,K.files.data?.truncated?(0,k.jsx)(`p`,{className:`p-3 text-caption text-muted-foreground`,children:h(`globalSearch.fileLimit`)}):null,S===`all`||S===`tasks`?(0,k.jsx)(A,{cursors:N,kind:`tasks`,nextCursor:K.tasks.data?.nextCursor,setCursors:P}):null,S===`all`||S===`history`?(0,k.jsx)(A,{cursors:F,kind:`history`,nextCursor:K.history.data?.nextCursor,setCursors:I}):null]}):(0,k.jsx)(oe,{listRef:U,onBack:()=>{R(null)},onOpenTask:()=>{Q(L)},onScroll:W.onScroll,onSelect:e=>{Q(L,e)},query:G,search:fe,task:L}),L===null?(0,k.jsxs)(`div`,{className:`flex min-h-11 items-center justify-between border-t border-separator bg-control/40 px-4 py-2 text-caption text-muted-foreground`,children:[(0,k.jsx)(`p`,{children:h(`globalSearch.resultCount`,{count:q.length})}),(0,k.jsx)(`span`,{className:`ml-auto mr-3`,children:h(`globalSearch.keyboard`)}),Y?.kind===`history`&&Y.task!==void 0?(0,k.jsx)(u,{onClick:()=>{Y.task!==void 0&&R(Y.task)},size:`sm`,variant:`ghost`,children:h(`globalSearch.occurrences`)}):null]}):null]})})})}export{N as GlobalSearchDialog};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./react-runtime-CMZHB3u8.js";import{H as r,K as i,Tt as a,V as o}from"./initial-deps-C-3sxJvc.js";import{E as s,at as c,g as l,o as u,tt as d}from"./initial-deps-B8FrcWWN.js";import{t as f}from"./download-05FmZQzE.js";import{t as p}from"./git-fork-CElzN7bT.js";import{T as m,et as h,f as g}from"./index-DobF11m_.js";import{h as _,p as v}from"./global-settings-page-BEUBn7B5.js";var y=d(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),b=e(t(),1),x=n();function S({notes:e,onClose:t,open:n,version:s}){let{t:l}=c(`settings`);return(0,x.jsx)(o,{onOpenChange:e=>{e||t()},open:n,children:(0,x.jsxs)(r,{"aria-labelledby":`app-release-notes-title`,className:`max-h-[min(80dvh,40rem)] max-w-2xl grid-rows-[auto_minmax(0,1fr)] overflow-hidden p-0`,children:[(0,x.jsxs)(`header`,{className:`flex items-center gap-3 px-5 pt-5`,children:[(0,x.jsx)(i,{className:`min-w-0 flex-1`,id:`app-release-notes-title`,children:l(`about.releaseNotesTitle`,{version:s})}),(0,x.jsx)(a,{"aria-label":l(`actions.closeReleaseNotes`),onClick:t,size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,x.jsx)(u,{"aria-hidden":`true`,className:`size-4`})})]}),(0,x.jsx)(`div`,{className:`min-h-0 overflow-y-auto border-t border-separator px-5 py-4`,children:e===null?(0,x.jsx)(`p`,{className:`text-body-small text-muted-foreground`,children:l(`about.releaseNotesUnavailable`)}):(0,x.jsx)(m,{className:`text-body-small`,mode:`static`,children:e})})]})})}var C={"backing-up":`about.progress.backingUp`,checking:`about.progress.checking`,completed:`about.progress.completed`,downloading:`about.progress.downloading`,installing:`about.progress.installing`,"rolling-back":`about.progress.rollingBack`};function w({activeSection:e,appInfo:t,error:n,isPending:r,isUpdatePending:i,onRetry:o,onUpdate:u,updateProgress:d}){let{t:m}=c(`settings`),w=(0,b.useRef)(h()),T=(0,b.useRef)(h()),[E,D]=(0,b.useState)(!1),[O,k]=(0,b.useState)(!1),[A,j]=(0,b.useState)(!1),M=A||i===!0,N=(0,b.useEffectEvent)(o);(0,b.useEffect)(()=>{e===`about`&&N()},[e]);let P=()=>T.current.run(async()=>{D(!0);try{await o()}finally{D(!1)}});return(0,x.jsx)(_,{activeSection:e,id:`about`,title:m(`sections.about`),children:r?(0,x.jsx)(`p`,{className:`py-5 text-body-small text-muted-foreground`,role:`status`,children:m(`about.loading`)}):n!==null||t===void 0?(0,x.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-4`,role:`alert`,children:[(0,x.jsx)(`p`,{className:`text-body-small text-danger`,children:m(`errors.appInfo`)}),(0,x.jsxs)(a,{onClick:()=>void o(),size:`sm`,type:`button`,variant:`ghost`,children:[(0,x.jsx)(l,{"aria-hidden":`true`,"data-icon":`inline-start`}),m(`about.retry`)]})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(v,{label:m(`about.codexlyVersion`),children:(0,x.jsx)(`span`,{className:`font-mono text-body-small text-foreground`,children:t.appVersion})}),(0,x.jsx)(v,{label:m(`about.codexVersion`),children:(0,x.jsx)(`span`,{className:`font-mono text-body-small text-foreground`,children:t.codexVersion})}),(0,x.jsx)(v,{label:m(`about.github`),children:(0,x.jsx)(a,{asChild:!0,className:`justify-self-start`,size:`sm`,variant:`link`,children:(0,x.jsxs)(`a`,{href:`https://github.com/BryanHoo/Codexly`,rel:`noopener noreferrer`,target:`_blank`,children:[(0,x.jsx)(p,{"aria-hidden":`true`,"data-icon":`inline-start`}),`BryanHoo/Codexly`]})})}),(0,x.jsx)(v,{alignStart:!0,expandControl:!0,label:m(`about.update`),children:(0,x.jsxs)(`div`,{className:`min-w-0 max-w-full py-2`,children:[(0,x.jsxs)(`div`,{className:`flex min-w-0 flex-nowrap items-center gap-2 overflow-x-auto whitespace-nowrap`,children:[(0,x.jsx)(`p`,{className:g(`shrink-0 text-body-small`,t.status===`available`?`text-warning`:t.status===`check-failed`?`text-danger`:`text-muted-foreground`),role:t.status===`check-failed`?`alert`:`status`,children:t.status===`available`&&t.latestVersion!==null?m(`about.available`,{version:t.latestVersion}):t.status===`restart-required`?m(`about.restartRequired`):t.status===`check-failed`?m(`errors.updateCheck`):m(`about.current`)}),(0,x.jsxs)(a,{disabled:E,onClick:()=>void P(),size:`sm`,type:`button`,variant:`ghost`,children:[E?(0,x.jsx)(s,{"aria-hidden":`true`,className:`animate-spin`,"data-icon":`inline-start`}):(0,x.jsx)(l,{"aria-hidden":`true`,"data-icon":`inline-start`}),m(E?`about.checking`:`about.check`)]}),t.status===`available`&&t.latestVersion!==null?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(a,{onClick:()=>{k(!0)},size:`sm`,type:`button`,variant:`outline`,children:[(0,x.jsx)(y,{"aria-hidden":`true`,"data-icon":`inline-start`}),m(`about.releaseNotes`)]}),(0,x.jsxs)(a,{disabled:M,onClick:()=>{let e=t.latestVersion;e!==null&&w.current.run(async()=>{j(!0);try{await u(e)}catch{}finally{j(!1)}})},size:`sm`,type:`button`,children:[M?(0,x.jsx)(s,{"aria-hidden":`true`,className:`animate-spin`,"data-icon":`inline-start`}):(0,x.jsx)(f,{"aria-hidden":`true`,"data-icon":`inline-start`}),M?m(`about.updating`):m(`about.updateTo`,{version:t.latestVersion})]})]}):null]}),!M||d===void 0?null:(0,x.jsxs)(`div`,{"aria-live":`polite`,className:`mt-3 grid w-full min-w-0 gap-1.5`,children:[(0,x.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3 text-caption text-muted-foreground`,children:[(0,x.jsx)(`span`,{className:`min-w-0 truncate`,children:m(C[d.phase])}),(0,x.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[d.percent,`%`]})]}),(0,x.jsx)(`div`,{"aria-label":m(`about.progress.label`),"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":d.percent,className:`h-1.5 w-full overflow-hidden rounded-sm bg-control`,role:`progressbar`,children:(0,x.jsx)(`div`,{className:`h-full bg-brand transition-[width] duration-200 motion-reduce:transition-none`,style:{width:`${String(d.percent)}%`}})})]})]})}),t.latestVersion===null?null:(0,x.jsx)(S,{notes:t.releaseNotes,onClose:()=>{k(!1)},open:O,version:t.latestVersion})]})})}export{w as GlobalSettingsAbout};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/background-image-picker-glORbeMR.js","assets/rolldown-runtime-B0Z9INg1.js","assets/react-runtime-CMZHB3u8.js","assets/initial-deps-CW5Jl6i2.js","assets/initial-deps-CG4ykI_P.js","assets/initial-deps-D0opk7c-.js","assets/initial-deps-C0_XYRrC.js","assets/initial-deps-DZ-sH4cr.js","assets/initial-deps-B7SS8XxM.js","assets/initial-deps-CqwWvUnY.js","assets/initial-deps-B8FrcWWN.js","assets/initial-deps-Cppvl2Gz.js","assets/scheduled-task-floating-ui~index~workbench-shell~workbench-inspector-changes~project-source~c6tt9j64-ClgveiMa.js","assets/initial-deps-DFOart6r.js","assets/download-05FmZQzE.js","assets/maximize-2-CawekEKe.js","assets/upload-BQhbr7lC.js","assets/index-DudvUciK.js","assets/index-BJqxQCE6.css","assets/agent-settings-panel-CRNaBDDS.js","assets/personalization-settings-panel-CllzRqsG.js","assets/commit-settings-panel-C-ALJcjd.js","assets/global-settings-pets-CAXRRfK_.js","assets/workbench-pet-canvas-DuBL3mip.js","assets/global-settings-pets-8bzx8OFf.css","assets/global-settings-about-CnBVv1BA.js","assets/git-fork-CElzN7bT.js","assets/lazy-message-response-Q7-W7qvB.js"])))=>i.map(i=>d[i]);
2
- import{a as e,r as t}from"./rolldown-runtime-B0Z9INg1.js";import{t as n}from"./initial-deps-CqwWvUnY.js";import{i as r,t as i}from"./react-runtime-CMZHB3u8.js";import{o as a,s as o}from"./initial-deps-CW5Jl6i2.js";import{H as s,J as c,K as l,M as u,P as d,Tt as f,V as p,j as m,wn as h}from"./initial-deps-B7SS8XxM.js";import{E as g,K as _,Q as v,at as y,ct as b,h as x,o as S,p as C,tt as w,u as T,w as E}from"./initial-deps-B8FrcWWN.js";import{C as D,E as O,b as k,f as A,w as j,y as M}from"./prompt-input-Ceptl3B-.js";import{t as N}from"./sliders-horizontal-C6QQuWdW.js";import{At as ee,S as P,_ as F,b as I,g as L,h as R,i as te,kt as ne,n as re,r as ie,t as ae,x as z,y as B}from"./index-DudvUciK.js";import{t as oe}from"./image-preview-Cufuk95q.js";var se=w(`image-off`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]),ce=w(`monitor-cog`,[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m14.305 7.53.923-.382`,key:`1mlnsw`}],[`path`,{d:`m15.228 4.852-.923-.383`,key:`82mpwg`}],[`path`,{d:`m16.852 3.228-.383-.924`,key:`ln4sir`}],[`path`,{d:`m16.852 8.772-.383.923`,key:`1dejw0`}],[`path`,{d:`m19.148 3.228.383-.924`,key:`192kgf`}],[`path`,{d:`m19.53 9.696-.382-.924`,key:`fiavlr`}],[`path`,{d:`m20.772 4.852.924-.383`,key:`1j8mgp`}],[`path`,{d:`m20.772 7.148.924.383`,key:`zix9be`}],[`path`,{d:`M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7`,key:`1tnzv8`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}]]),le=w(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),ue=w(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),V=w(`paw-print`,[[`circle`,{cx:`11`,cy:`4`,r:`2`,key:`vol9p0`}],[`circle`,{cx:`18`,cy:`8`,r:`2`,key:`17gozi`}],[`circle`,{cx:`20`,cy:`16`,r:`2`,key:`1v9bxh`}],[`path`,{d:`M9 10a5 5 0 0 1 5 5v3.5a3.5 3.5 0 0 1-6.84 1.045Q6.52 17.48 4.46 16.84A3.5 3.5 0 0 1 5.5 10Z`,key:`1ydw1z`}]]),de=w(`server-cog`,[[`path`,{d:`m10.852 14.772-.383.923`,key:`11vil6`}],[`path`,{d:`M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923`,key:`1v3clb`}],[`path`,{d:`m13.148 9.228.383-.923`,key:`t2zzyc`}],[`path`,{d:`m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544`,key:`1bxfiv`}],[`path`,{d:`m14.772 10.852.923-.383`,key:`k9m8cz`}],[`path`,{d:`m14.772 13.148.923.383`,key:`1xvhww`}],[`path`,{d:`M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5`,key:`tn8das`}],[`path`,{d:`M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5`,key:`1g2pve`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`M6 6h.01`,key:`1utrut`}],[`path`,{d:`m9.228 10.852-.923-.383`,key:`1wtb30`}],[`path`,{d:`m9.228 13.148-.923.383`,key:`1a830x`}]]),fe=w(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),H=e(r(),1),U=i(),pe=[{icon:T,id:`appearance`},{icon:V,id:`pets`},{icon:de,id:`provider`},{icon:O,id:`agent`},{icon:N,id:`personalization`},{icon:ue,id:`access`},{icon:D,id:`about`}];function W({activeSection:e,children:t,id:n,title:r}){return e===n?(0,U.jsxs)(`section`,{id:`settings-panel-${n}`,children:[(0,U.jsx)(`h1`,{className:`mb-6 text-xl font-semibold`,children:r}),(0,U.jsx)(K,{children:t})]}):null}function G({children:e,title:t,description:n}){let r=(0,H.useId)();return(0,U.jsxs)(`section`,{"aria-labelledby":r,children:[(0,U.jsx)(`h2`,{className:`${n===void 0?`mb-2`:`mb-1`} text-body font-semibold`,id:r,children:t}),n===void 0?null:(0,U.jsx)(`p`,{className:`mb-3 text-body-small text-muted-foreground`,children:n}),(0,U.jsx)(K,{children:e})]})}function K({children:e}){return(0,U.jsx)(`div`,{className:`divide-y divide-separator rounded-surface border border-separator bg-panel px-4`,children:e})}function q({alignStart:e=!1,children:t,description:n,expandControl:r=!1,label:i}){return(0,U.jsxs)(`div`,{className:`grid min-h-14 ${r?`sm:grid-cols-[auto_minmax(0,1fr)]`:n===void 0?`sm:grid-cols-[minmax(9rem,1fr)_minmax(0,22rem)]`:`sm:grid-cols-[minmax(0,1fr)_minmax(10rem,16rem)]`} gap-4 py-3 ${e?`items-start`:`items-center`}`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 ${e?`pt-2`:``}`,children:[(0,U.jsx)(`span`,{className:`block text-body-small font-medium text-foreground`,children:i}),n===void 0?null:(0,U.jsx)(`p`,{className:`mt-0.5 text-label text-muted-foreground`,children:n})]}),(0,U.jsx)(`div`,{className:`flex min-w-0 justify-end`,children:t})]})}function me({disabled:e=!1,enabled:t,onChange:n}){let{t:r}=y(`settings`),i=r(`fields.fastMode`);return(0,U.jsx)(q,{label:i,children:(0,U.jsx)(c,{"aria-label":i,checked:t,disabled:e,onCheckedChange:e=>{n(e===!0)}})})}function he({ariaLabel:e,disabled:t=!1,models:n,onChange:r,value:i}){return(0,U.jsx)(J,{"aria-label":e,disabled:t,onChange:e=>{r(e.currentTarget.value)},value:i,children:n.map(e=>(0,U.jsx)(`option`,{value:e.id,children:e.displayName},e.id))})}function ge({ariaLabel:e,disabled:t,model:n,onChange:r,value:i}){let{t:a}=y(`settings`);return(0,U.jsx)(J,{"aria-label":e,disabled:t,onChange:e=>{r(e.currentTarget.value)},value:i,children:n?.supportedReasoningEfforts.map(e=>(0,U.jsx)(`option`,{value:e.id,children:a(`effort.${e.id}`,{defaultValue:e.id})},e.id))})}function J(e){return(0,U.jsxs)(`div`,{className:`relative w-40 max-w-full`,children:[(0,U.jsx)(A,{className:`h-8 w-full max-w-none !border !border-separator-strong !bg-control px-2.5 pr-8 text-body-small text-foreground`,...e}),(0,U.jsx)(_,{"aria-hidden":`true`,className:`pointer-events-none absolute right-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`})]})}b.addResourceBundle(`en`,`settings`,{general:{permissions:`Permissions`,preferences:`Preferences`,editor:`Editor`,approvalDescription:`Choose how requests for additional permissions are approved.`,sandboxDescription:`Limit file access. Full access allows changes outside the workspace.`,openAppDescription:`The preferred application for opening project files and folders.`,languageDescription:`The language used in the Codexly interface.`,themeDescription:`Choose a light or dark appearance, or follow your system.`,followUpDescription:`Queue new messages while a task runs, or steer the current task immediately.`,taskNotifications:`Task notifications`,notificationsDescription:`Send system notifications when a task completes, fails, or needs attention.`},agent:{contextWindow:{label:`Context window`,description:`Enter 272–1000, or leave blank for auto.`,automatic:`Auto`,invalid:`Enter a whole number from 272 to 1000, or leave blank.`},storage:{title:`History storage`,description:`Codex compresses server history files untouched for over 7 days in the background to free server disk space.`,compatibility:`Other Codex clients sharing this history directory must also support compressed history files.`,action:`Compress history files`,pending:`Submitting…`,scheduled:`Background compression requested. This does not confirm completion; there may be no eligible files.`,failed:`Could not request compression. Check the Codex connection and retry.`},defaults:`Agent defaults`,model:`Model defaults`,webSearch:{label:`Web search`,description:`Choose how new tasks search the web.`,disabled:`Disabled`,cached:`Cached`,live:`Live`},modelVerbosity:{label:`Output verbosity`,description:`Choose the level of detail in new task replies. Support varies by model.`,default:`Model default`,low:`Low`,medium:`Medium`,high:`High`}}},!0),b.addResourceBundle(`zh-CN`,`settings`,{general:{permissions:`权限`,preferences:`通用`,editor:`编辑器`,approvalDescription:`选择任务请求额外权限时的审批方式。`,sandboxDescription:`限制任务对文件的访问范围;完全访问允许操作工作区之外的文件。`,openAppDescription:`打开项目文件和文件夹时优先使用的应用。`,languageDescription:`Codexly 的界面语言。`,themeDescription:`选择浅色、深色或跟随系统外观。`,followUpDescription:`任务运行时,将新消息加入队列,或立即引导当前任务。`,taskNotifications:`任务通知`,notificationsDescription:`任务完成、失败或需要处理时发送系统通知。`},agent:{contextWindow:{label:`上下文窗口`,description:`填写 272–1000,留空自动。`,automatic:`自动`,invalid:`请输入 272–1000 的整数,或留空。`},storage:{title:`历史文件存储`,description:`由 Codex 在后台压缩服务端超过 7 天未写入的历史文件,释放服务端磁盘空间。`,compatibility:`共用此历史目录的其他 Codex 客户端也需支持压缩历史文件。`,action:`压缩历史文件`,pending:`正在提交…`,scheduled:`已提交后台压缩请求;不表示压缩已完成,也可能没有符合条件的文件。`,failed:`压缩请求提交失败,请检查 Codex 连接后重试。`},defaults:`智能体默认设置`,model:`模型默认设置`,webSearch:{label:`网页搜索`,description:`选择新任务搜索网页的方式。`,disabled:`关闭`,cached:`缓存`,live:`实时`},modelVerbosity:{label:`输出详细程度`,description:`选择新任务回复包含细节的详细程度,支持情况因模型而异。`,default:`模型默认`,low:`简洁`,medium:`适中`,high:`详细`}}},!0);function _e(e,t,n){let r=e.find(e=>e.id===t);if(r===void 0)return{model:t,reasoningEffort:n};let i=r.supportedReasoningEfforts.some(e=>e.id===n)?n:r.defaultReasoningEffort;return{model:r.id,reasoningEffort:i}}function ve(e){return k(e)}function ye(e,t){return M(e,t)}function be(e){let t=e.find(e=>e.isDefault)??e[0];return{approvalPolicy:`on-request`,approvalsReviewer:`user`,commitMessageModel:h,commitMessagePrompt:``,defaultOpenAppId:null,fastMode:!1,modelContextWindow:null,followUpBehavior:`queue`,model:t?.id??``,pet:{enabled:!1,selectedPetId:null},reasoningEffort:t?.defaultReasoningEffort??``,sandboxMode:`workspace-write`}}function xe(){return ae(P())}function Y({label:e,children:t,onClick:n,disabled:r=!1}){return(0,U.jsxs)(m,{children:[(0,U.jsx)(d,{asChild:!0,children:(0,U.jsx)(f,{"aria-label":e,disabled:r,onClick:n,size:`icon-sm`,type:`button`,variant:`ghost`,children:t})}),(0,U.jsx)(u,{children:e})]})}function X(e){let[t,n]=(0,H.useState)(null),r=e?.blob;return(0,H.useEffect)(()=>{if(r===void 0)return;let e=URL.createObjectURL(r);return n({blob:r,url:e}),()=>{URL.revokeObjectURL(e)}},[r]),r&&t?.blob===r?t.url:null}function Se({preference:e,onChange:t}){let{t:n}=y(`settings`);return e.mode===`none`?null:(0,U.jsxs)(`section`,{className:`wallpaper-adjustments`,children:[(0,U.jsxs)(`div`,{className:`wallpaper-section-heading`,children:[(0,U.jsx)(`h2`,{children:n(`wallpaper.adjustments`)}),(0,U.jsx)(Y,{label:n(`wallpaper.reset`),onClick:()=>{t({...e,blurPercentage:R.blurPercentage,overlayOpacity:R.overlayOpacity})},children:(0,U.jsx)(x,{"aria-hidden":`true`})})]}),(0,U.jsx)(`div`,{className:`wallpaper-sliders`,children:[{key:`overlayOpacity`,label:`background.overlayOpacityLabel`,aria:`background.overlayOpacity`},{key:`blurPercentage`,label:`background.blurLabel`,aria:`background.blur`}].map(({key:r,label:i,aria:a})=>(0,U.jsxs)(`label`,{className:`wallpaper-slider`,children:[(0,U.jsxs)(`span`,{children:[n(i),(0,U.jsxs)(`output`,{children:[e[r],`%`]})]}),(0,U.jsx)(`input`,{"aria-label":n(a),type:`range`,min:0,max:95,step:1,value:e[r],onChange:n=>{t({...e,[r]:Number(n.currentTarget.value)})}})]},r))})]})}function Ce({source:e,title:t,onClose:n,children:r,error:i=!1}){let{t:a}=y(`settings`);return(0,U.jsx)(p,{open:!0,onOpenChange:e=>{e||n()},children:(0,U.jsxs)(s,{className:`wallpaper-dialog`,"aria-describedby":void 0,children:[(0,U.jsxs)(`div`,{className:`wallpaper-section-heading`,children:[(0,U.jsx)(l,{children:t}),(0,U.jsx)(Y,{label:a(`wallpaper.close`),onClick:n,children:(0,U.jsx)(S,{"aria-hidden":`true`})})]}),(0,U.jsx)(`div`,{className:`wallpaper-original`,children:i?(0,U.jsx)(`span`,{role:`alert`,children:a(`wallpaper.imageError`)}):e===null?(0,U.jsx)(g,{"aria-label":a(`wallpaper.loading`),className:`size-5 motion-safe:animate-spin`}):(0,U.jsx)(oe,{alt:t,src:e})}),r]})})}function Z(e,t=!1){return e===null?`/v1/workbench-background/bing?day=${new Date().toLocaleDateString(`en-CA`)}`:`/v1/workbench-background/bing/image?day=${encodeURIComponent(e)}&thumbnail=${String(t)}`}function Q(e,t){return a({queryKey:[`bing-wallpaper`,e,t],queryFn:()=>Promise.resolve(Z(e??null,t)),enabled:e!==void 0,staleTime:e===null?36e5:1/0})}b.addResourceBundle(`zh-CN`,`settings`,{personalization:{instructions:`Codex 说明`,commitTitle:`提交消息`,commitDescription:`设置 Git 提交消息的生成偏好,修改后自动保存。`,commitModel:`生成模型`,commitModelDescription:`选择用于生成提交消息的模型。`,commitRules:`生成规则`,commitRulesDescription:`指定语言、格式和内容要求,仅用于生成提交消息。`,commitPlaceholder:`例如:使用简体中文,遵循 Conventional Commits,简要说明变更目的。`,fileLocation:`文件位置:{{path}}`,description:`为在此电脑上运行的任务提供说明和上下文。项目中的说明也会适用。保存后对新会话生效。`,save:`保存`,saving:`正在保存`,saved:`已保存`,reload:`重新读取`,loadError:`读取失败,请重试。`,saveError:`保存失败,草稿已保留。`,conflict:`文件已在其他位置修改。请复制保留草稿,再重新读取后编辑。`,override:`检测到 AGENTS.override.md,Codex 会优先使用其中的说明。`,memories:`记忆`,memoryDescription:`设置 Codex 如何收集、保留和使用本地记忆。设置应用于后续会话。`,enabled:`启用本地记忆`,enabledDescription:`根据此电脑上的聊天生成记忆,并用于后续聊天。`,external:`允许基于工具辅助聊天生成本地记忆`,externalDescription:`允许从使用过 MCP 工具或网页搜索的聊天生成记忆。`,remove:`删除本地记忆`,removeDescription:`清除本地记忆文件和记忆处理数据,保留聊天记录。`,confirm:`确认删除`,confirmDescription:`此操作无法撤销。启用记忆时,后续会话仍可能生成新记忆。`,cancel:`取消`,deleting:`正在删除`,deleted:`本地记忆已删除`,memoryError:`记忆操作失败,请重试。`}},!0),b.addResourceBundle(`en`,`settings`,{personalization:{instructions:`Codex instructions`,commitTitle:`Commit messages`,commitDescription:`Set preferences for generated Git commit messages. Changes are saved automatically.`,commitModel:`Generation model`,commitModelDescription:`Choose the model used to generate commit messages.`,commitRules:`Generation rules`,commitRulesDescription:`Specify language, format, and content requirements for commit messages only.`,commitPlaceholder:`For example: follow Conventional Commits and briefly explain the purpose of the changes.`,fileLocation:`File location: {{path}}`,description:`Provide instructions and context for tasks on this computer. Project instructions also apply. Saved changes apply to new sessions.`,save:`Save`,saving:`Saving`,saved:`Saved`,reload:`Reload`,loadError:`Could not load. Please retry.`,saveError:`Could not save. Your draft is preserved.`,conflict:`The file changed elsewhere. Copy your draft before reloading and editing again.`,override:`AGENTS.override.md is present. Codex prioritizes its instructions.`,memories:`Memory`,memoryDescription:`Choose how Codex collects, retains, and uses local memory. Changes apply to subsequent sessions.`,enabled:`Enable local memory`,enabledDescription:`Generate memory from chats on this computer and use it in future chats.`,external:`Allow memory from tool-assisted chats`,externalDescription:`Allow memory from chats that used MCP tools or web search.`,remove:`Delete local memory`,removeDescription:`Clear local memory files and processing data while keeping chat history.`,confirm:`Confirm deletion`,confirmDescription:`This cannot be undone. Future sessions may generate new memory while memory is enabled.`,cancel:`Cancel`,deleting:`Deleting`,deleted:`Local memory deleted`,memoryError:`Memory operation failed. Please retry.`}},!0);function we(e){let t=``,n,r,i,a,o=()=>{i!==void 0&&clearTimeout(i),i=void 0},s=()=>(a===void 0&&(a=(async()=>{for(;n!==void 0;){let r=n;n=void 0;let i=JSON.stringify(r);if(i!==t)try{await e(r),t=i}catch{}}})().finally(()=>{a=void 0,n!==void 0&&s()})),a);return{async flush(e){for(o(),n=e??r??n,r=void 0;n!==void 0||a!==void 0;)await s()},reset(e){t=JSON.stringify(e)},save:e=>{o(),r=void 0,n=e,s()},schedule(e,t){o(),r=e,i=setTimeout(()=>{i=void 0,n=r,r=void 0,s()},t)}}}var Te=[{id:`personal`,sections:[`appearance`,`pets`]},{id:`coding`,sections:[`provider`,`agent`,`personalization`]},{id:`app`,sections:[`access`,`about`]}],Ee={access:[`access.logout`],personalization:[`personalization.instructions`,`personalization.memories`,`personalization.enabled`,`personalization.external`,`fields.commitModel`,`fields.commitMessagePrompt`,`fields.prompt`],appearance:[`appearance.colorMode`,`appearance.language`,`appearance.notifications`,`fields.defaultOpenWith`,`fields.followUpMessages`,`general.editor`,`general.taskNotifications`,`background.label`,`background.bing`,`background.custom`,`background.blurLabel`,`background.overlayOpacityLabel`],pets:[`pets.enabled`,`pets.selectionLabel`],provider:[`provider.apiKey`,`provider.baseUrl`,`provider.models`,`provider.official`,`provider.custom`],agent:[`fields.fastMode`,`fields.model`,`fields.reasoningEffort`,`fields.approvalPolicy`,`fields.sandbox`,`agent.webSearch.label`,`agent.modelVerbosity.label`],about:[`about.codexlyVersion`,`about.codexVersion`,`about.update`,`about.releaseNotes`]};function De({activeSection:e,accessMode:t=`local`,children:n,onBack:r,onSectionChange:i}){let{t:a}=y(`settings`),[o,s]=(0,H.useState)(``),c=(0,H.useRef)(null),l=(0,H.useRef)(null),p=(0,H.useRef)(null),h=o.trim().toLocaleLowerCase(),g=pe.filter(({id:e})=>e!==`access`||t===`lan`).filter(({id:e})=>[a(`sections.${e}`),a(`sectionKeywords.${e}`),...Ee[e].map(e=>a(e))].some(e=>e.toLocaleLowerCase().includes(h)));(0,H.useEffect)(()=>{c.current?.focus({preventScroll:!0})},[]);let _=(0,H.useEffectEvent)(e=>{e.key!==`Escape`||e.defaultPrevented||e.isComposing||[...document.querySelectorAll(`[role="dialog"], [role="alertdialog"], dialog[open]`)].some(e=>e.getClientRects().length>0)||(e.preventDefault(),o===``?r():s(``))});return(0,H.useEffect)(()=>(document.addEventListener(`keydown`,_),()=>{document.removeEventListener(`keydown`,_)}),[]),(0,U.jsxs)(`div`,{role:`region`,"aria-label":a(`title`),className:`settings-page grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] sm:grid-cols-[var(--ui-layout-settings-sidebar-width)_minmax(0,1fr)] sm:grid-rows-1 overflow-hidden bg-window text-foreground`,children:[(0,U.jsxs)(`aside`,{className:`flex min-h-0 min-w-0 flex-col bg-control px-3 py-3 sm:pb-5 sm:pt-6`,children:[(0,U.jsxs)(f,{contentAlign:`start`,className:`mb-5 h-9 w-full justify-start gap-2 px-2.5 text-body`,onClick:r,ref:c,type:`button`,variant:`ghost`,children:[(0,U.jsx)(v,{"aria-hidden":`true`}),a(`actions.backToApp`)]}),(0,U.jsxs)(`div`,{className:`mb-6 flex h-9 shrink-0 items-center gap-2 rounded-control bg-control px-2.5 focus-within:shadow-focus`,children:[(0,U.jsx)(C,{"aria-hidden":`true`,className:`text-subtle-foreground`}),(0,U.jsx)(`input`,{"aria-label":a(`search.label`),className:`min-w-0 flex-1 bg-transparent text-body-small !outline-none placeholder:text-subtle-foreground [&::-webkit-search-cancel-button]:appearance-none`,onChange:e=>{s(e.currentTarget.value)},placeholder:a(`search.placeholder`),ref:l,type:`search`,value:o}),o===``?null:(0,U.jsxs)(m,{children:[(0,U.jsx)(d,{asChild:!0,children:(0,U.jsx)(f,{"aria-label":a(`search.clear`),className:`size-6 shrink-0`,onClick:()=>{s(``),l.current?.focus()},size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,U.jsx)(S,{"aria-hidden":`true`})})}),(0,U.jsx)(u,{children:a(`search.clear`)})]})]}),(0,U.jsxs)(`nav`,{"aria-label":a(`navigationLabel`),className:`flex min-h-0 gap-4 overflow-x-auto sm:block sm:space-y-6 sm:overflow-y-auto`,children:[Te.map(t=>{let n=g.filter(({id:e})=>t.sections.some(t=>t===e));return n.length===0?null:(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`mb-2 px-2.5 text-label text-subtle-foreground`,children:a(`groups.${t.id}`)}),(0,U.jsx)(`div`,{className:`flex gap-1 sm:block sm:space-y-1`,children:n.map(({icon:t,id:n})=>(0,U.jsxs)(f,{"aria-current":e===n?`page`:void 0,contentAlign:`start`,className:`h-9 sm:w-full justify-start gap-2.5 px-2.5 text-body-small ${e===n?`bg-control-hover text-foreground`:`text-muted-foreground`}`,onClick:()=>{i(n),p.current?.scrollTo({top:0})},type:`button`,variant:`ghost`,children:[(0,U.jsx)(t,{"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`min-w-0 truncate`,children:a(`sections.${n}`)})]},n))})]},t.id)}),g.length===0?(0,U.jsx)(`p`,{className:`px-2.5 text-body-small text-muted-foreground`,role:`status`,children:a(`search.empty`)}):null]})]}),(0,U.jsx)(`main`,{"aria-label":a(`title`),className:`min-h-0 min-w-0 overflow-y-auto px-5 py-6 sm:px-10 sm:py-12`,ref:p,children:(0,U.jsx)(`div`,{className:`mx-auto w-full max-w-content`,children:n})})]})}function Oe(){return I(P())}function ke(){let[e,t]=(0,H.useState)(Oe),[n,r]=(0,H.useState)([]),[i,a]=(0,H.useState)(()=>new Set),[o,s]=(0,H.useState)(()=>new Set),[c,l]=(0,H.useState)(!1),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(0);(0,H.useEffect)(()=>{if(e.mode!==`custom`||c)return;let t=!1;return d(!1),B().then(e=>{t||(r(e),a(new Set(e.map(e=>e.id))),l(!0))}).catch(()=>{t||d(!0)}),()=>{t=!0}},[e.mode,c,f]);let m=(0,H.useMemo)(()=>({deletedImageIds:[...o],imagesToSave:n.filter(e=>!i.has(e.id))}),[n,o,i]);return{isLoading:e.mode===`custom`&&!c&&!u,loadError:u,retryLoad:()=>{p(e=>e+1)},addCustomBackgroundFiles:e=>{let n=e.map(e=>F(e));n.length!==0&&(r(e=>[...e,...n]),t(e=>({...e,mode:`custom`,selectedCustomImageId:n.at(-1)?.id??e.selectedCustomImageId})))},background:e,backgroundMutation:m,customBackgroundMissing:e.mode===`custom`&&(e.selectedCustomImageId===null||!n.some(t=>t.id===e.selectedCustomImageId)),customImages:n,removeCustomBackgroundImage:a=>{let o=z(n,a,e.selectedCustomImageId);r(o.images),t(e=>({...e,mode:o.images.length===0?`none`:e.mode,selectedCustomImageId:e.selectedCustomImageId===a?o.selectedCustomImageId:e.selectedCustomImageId})),i.has(a)&&s(e=>new Set(e).add(a))},selectCustomBackgroundImage:e=>{t(t=>({...t,mode:`custom`,selectedCustomImageId:e}))},setBackground:t}}b.addResourceBundle(`zh-CN`,`settings`,{wallpaper:{source:`壁纸来源`,close:`关闭预览`,description:`使用每日风景或自己的图片装点工作台。`,bingMode:`Bing`,choose:`选择图片`,pickerDescription:`选择喜欢的图片,即时应用到工作台。`,closePicker:`关闭图片选择`,done:`完成`,addFavorite:`添加喜欢的图片`,customSelected:`自定义背景`,customFormats:`支持 JPG、PNG、WebP 和 GIF`,collection:`Bing 每日壁纸`,recent:`近期壁纸`,daily:`每日自动更新`,selected:`当前使用`,download:`下载原图`,downloading:`正在下载`,downloaded:`已保存 {{name}}`,loading:`正在加载壁纸`,loadError:`壁纸加载失败`,retry:`重新加载`,custom:`我的壁纸`,empty:`还没有添加壁纸`,upload:`添加图片`,adjustments:`显示效果`,reset:`重置显示效果`,imageError:`图片无法预览`,select:`使用 {{name}}`,view:`预览 {{name}}`,downloadImage:`下载 {{name}}`}},!0),b.addResourceBundle(`en`,`settings`,{wallpaper:{source:`Wallpaper source`,close:`Close preview`,description:`Personalize your workspace with daily scenery or your own images.`,bingMode:`Bing`,choose:`Choose image`,pickerDescription:`Choose an image to apply it to your workspace.`,closePicker:`Close image picker`,done:`Done`,addFavorite:`Add a favorite image`,customSelected:`Custom background`,customFormats:`Supports JPG, PNG, WebP and GIF`,collection:`Bing daily wallpapers`,recent:`Recent wallpapers`,daily:`Update daily`,selected:`In use`,download:`Download original`,downloading:`Downloading`,downloaded:`Saved {{name}}`,loading:`Loading wallpapers`,loadError:`Unable to load wallpapers`,retry:`Reload`,custom:`My wallpapers`,empty:`No wallpapers yet`,upload:`Add images`,adjustments:`Appearance`,reset:`Reset appearance`,imageError:`Unable to preview image`,select:`Use {{name}}`,view:`Preview {{name}}`,downloadImage:`Download {{name}}`}},!0);function $({source:e,loading:t=!1}){let[n,r]=(0,H.useState)(null);return(0,U.jsx)(`div`,{className:`background-summary-image`,"aria-hidden":`true`,children:e!==null&&e!==n?(0,U.jsx)(`img`,{alt:``,src:e,decoding:`async`,onError:()=>{r(e)}}):t?(0,U.jsx)(g,{className:`size-4 motion-safe:animate-spin`}):e?(0,U.jsx)(se,{className:`size-5`}):(0,U.jsx)(j,{className:`size-5`})})}function Ae({image:e}){let{t}=y(`settings`),n=X(e);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)($,{source:n}),(0,U.jsxs)(`div`,{className:`background-summary-text`,children:[(0,U.jsx)(`p`,{title:e?.name,children:e?.name??t(`wallpaper.addFavorite`)}),(0,U.jsx)(`span`,{children:t(e?`wallpaper.customSelected`:`wallpaper.customFormats`)})]})]})}function je({preference:e}){let{t}=y(`settings`),n=o(Q(e.selectedBingDay??null,!0));return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)($,{source:n.data??null,loading:n.isPending}),(0,U.jsxs)(`div`,{className:`background-summary-text`,children:[(0,U.jsx)(`p`,{children:t(`background.bingAria`)}),(0,U.jsx)(`span`,{children:n.isError?t(`wallpaper.imageError`):e.selectedBingDay??t(`wallpaper.daily`)})]})]})}var Me=(0,H.lazy)(()=>n(()=>import(`./background-image-picker-glORbeMR.js`).then(e=>({default:e.BackgroundImagePicker})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]))),Ne=[{ariaKey:`background.noneAria`,labelKey:`background.none`,value:`none`},{ariaKey:`background.bingAria`,labelKey:`wallpaper.bingMode`,value:`bing`},{ariaKey:`background.customAria`,labelKey:`background.custom`,value:`custom`}];function Pe(e){let{preference:t,customImages:n,onPreferenceChange:r}=e,{t:i}=y(`settings`),[a,o]=(0,H.useState)(!1);return(0,U.jsxs)(`div`,{className:`wallpaper-settings`,children:[(0,U.jsx)(q,{label:i(`background.label`),description:i(`wallpaper.description`),children:(0,U.jsx)(`div`,{className:`background-mode-control`,role:`group`,"aria-label":i(`wallpaper.source`),children:Ne.map(({ariaKey:e,labelKey:n,value:a})=>(0,U.jsx)(f,{"aria-label":i(e),"aria-pressed":t.mode===a,className:t.mode===a?`bg-raised text-foreground shadow-control`:`text-muted-foreground`,onClick:()=>{r({...t,mode:a})},type:`button`,variant:`ghost`,children:i(n)},a))})}),t.mode===`none`?null:(0,U.jsxs)(`div`,{className:`background-details`,children:[(0,U.jsxs)(`div`,{className:`background-summary`,children:[t.mode===`bing`?(0,U.jsx)(je,{preference:t}):(0,U.jsx)(Ae,{image:n.find(e=>e.id===t.selectedCustomImageId)}),(0,U.jsx)(f,{variant:`outline`,type:`button`,onClick:()=>{o(!0)},children:i(`wallpaper.choose`)})]}),(0,U.jsx)(Se,{preference:t,onChange:r})]}),a?(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(`span`,{role:`status`,className:`px-4 text-label text-muted-foreground`,children:i(`wallpaper.loading`)}),children:(0,U.jsx)(Me,{...e,onClose:()=>{o(!1)}})}):null]})}function Fe(){let{t:e}=y(`settings`),t=ke(),[n,r]=(0,H.useState)(!1),[i,a]=(0,H.useState)(0),o=(0,H.useRef)(!1),s=(0,H.useRef)(Promise.resolve()),{background:c,backgroundMutation:l,customBackgroundMissing:u}=t;return(0,H.useEffect)(()=>{o.current&&!u&&(s.current=s.current.catch(()=>void 0).then(()=>L(c,l)).then(()=>{r(!1)},()=>{r(!0)}))},[c,l,u,i]),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(Pe,{customImages:t.customImages,disabled:t.isLoading||t.loadError,loadError:t.loadError,onRetry:t.retryLoad,preference:c,onCustomFilesAdd:e=>{o.current=!0,t.addCustomBackgroundFiles(e)},onCustomImageRemove:e=>{o.current=!0,t.removeCustomBackgroundImage(e)},onCustomImageSelect:e=>{o.current=!0,t.selectCustomBackgroundImage(e)},onPreferenceChange:e=>{o.current=!0,t.setBackground(e)}}),n?(0,U.jsxs)(`div`,{role:`alert`,className:`text-body-small text-danger`,children:[e(`personalization.saveError`),(0,U.jsx)(f,{variant:`ghost`,onClick:()=>{a(e=>e+1)},children:e(`common:actions.retry`)})]}):null]})}var Ie=[{value:`system`,icon:ce,label:`automatic`,aria:`automaticMode`},{value:`light`,icon:fe,label:`light`,aria:`lightMode`},{value:`dark`,icon:le,label:`dark`,aria:`darkMode`}];function Le({activeSection:e,apps:t,settings:n,language:r,notificationsEnabled:i,theme:a,onFollowUpChange:o,onDefaultOpenAppChange:s,onLanguageChange:c,onNotificationsChange:l,onThemeChange:p}){let{t:h}=y(`settings`);return e===`appearance`?(0,U.jsxs)(`section`,{id:`settings-panel-appearance`,children:[(0,U.jsx)(`h1`,{className:`mb-6 text-xl font-semibold`,children:h(`sections.appearance`)}),(0,U.jsxs)(`div`,{className:`space-y-6`,children:[(0,U.jsxs)(G,{title:h(`general.preferences`),children:[t.some(e=>e.kind!==`system-default`)?(0,U.jsx)(q,{label:h(`fields.defaultOpenWith`),description:h(`general.openAppDescription`),children:(0,U.jsxs)(J,{"aria-label":h(`fields.defaultOpenWith`),value:n.defaultOpenAppId??``,onChange:e=>{s(e.currentTarget.value||null)},children:[(0,U.jsx)(`option`,{value:``,children:h(`integration.automatic`)}),t.filter(e=>e.kind!==`system-default`).map(e=>(0,U.jsx)(`option`,{value:e.id,children:e.name},e.id))]})}):null,(0,U.jsx)(q,{label:h(`appearance.language`),description:h(`general.languageDescription`),children:(0,U.jsxs)(J,{"aria-label":h(`appearance.language`),value:r,onChange:e=>{c(e.currentTarget.value)},children:[(0,U.jsx)(`option`,{value:`zh-CN`,children:h(`languages.zhCN`)}),(0,U.jsx)(`option`,{value:`en`,children:h(`languages.en`)})]})}),(0,U.jsx)(q,{label:h(`appearance.colorMode`),description:h(`general.themeDescription`),children:(0,U.jsx)(`div`,{className:`grid w-40 grid-cols-3 rounded-control bg-control p-0.5`,role:`group`,"aria-label":h(`appearance.colorMode`),children:Ie.map(({value:e,icon:t,label:n,aria:r})=>(0,U.jsxs)(m,{children:[(0,U.jsx)(d,{asChild:!0,children:(0,U.jsx)(f,{"aria-label":h(`appearance.${r}`),"aria-pressed":a===e,className:`h-7 min-w-0 px-2 ${a===e?`bg-raised text-foreground shadow-control`:`text-muted-foreground`}`,variant:`ghost`,type:`button`,onClick:()=>{p(e)},children:(0,U.jsx)(t,{"aria-hidden":`true`})})}),(0,U.jsx)(u,{children:h(`appearance.${n}`)})]},e))})}),(0,U.jsx)(Fe,{})]}),(0,U.jsx)(G,{title:h(`general.editor`),children:(0,U.jsx)(q,{label:h(`fields.followUpMessages`),description:h(`general.followUpDescription`),children:(0,U.jsx)(`div`,{className:`grid w-40 grid-cols-2 rounded-control bg-control p-0.5`,role:`group`,"aria-label":h(`fields.followUpMessages`),children:[`queue`,`steer`].map(e=>(0,U.jsx)(f,{"aria-pressed":n.followUpBehavior===e,className:`h-7 px-3 text-body-small ${n.followUpBehavior===e?`bg-raised text-foreground shadow-control`:`text-muted-foreground`}`,variant:`ghost`,type:`button`,onClick:()=>{o(e)},children:h(`followUp.${e}`)},e))})})}),(0,U.jsx)(G,{title:h(`appearance.notifications`),children:(0,U.jsx)(q,{label:h(`general.taskNotifications`),description:h(`general.notificationsDescription`),children:(0,U.jsx)(f,{role:`switch`,"aria-label":h(`general.taskNotifications`),"aria-checked":i,className:`h-6 w-10 rounded-pill p-0.5 ${i?`bg-brand hover:bg-brand`:`bg-control-hover`}`,variant:`ghost`,type:`button`,onClick:()=>{l(!i)},children:(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`block size-5 rounded-pill bg-brand-contrast shadow-control transition-transform motion-reduce:transition-none ${i?`translate-x-2`:`-translate-x-2`}`})})})})]})]}):null}function Re({activeSection:e,onLogout:t}){let{t:n}=y(`settings`),[r,i]=(0,H.useState)(!1);return(0,U.jsx)(W,{activeSection:e,id:`access`,title:n(`sections.access`),children:(0,U.jsx)(q,{label:n(`access.currentSession`),children:(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-col items-start gap-2 py-1`,children:[(0,U.jsx)(`p`,{className:`text-body-small text-muted-foreground`,children:n(`access.sessionDescription`)}),(0,U.jsxs)(f,{className:`inline-flex h-8 items-center gap-2 rounded-control bg-control px-3 text-body-small font-medium text-danger hover:bg-control-hover focus-visible:shadow-focus disabled:opacity-50`,disabled:r||t===void 0,onClick:()=>{t!==void 0&&(i(!0),t().catch(()=>void 0).finally(()=>{i(!1)}))},type:`button`,variant:`ghost`,children:[(0,U.jsx)(E,{"aria-hidden":`true`,"data-icon":`inline-start`}),n(r?`access.loggingOut`:`access.logout`)]})]})})})}var ze=t({GlobalSettingsPage:()=>Ke}),Be=(0,H.lazy)(()=>n(()=>import(`./agent-settings-panel-CRNaBDDS.js`).then(e=>({default:e.AgentSettingsPanel})),__vite__mapDeps([19,1,2,3,4,5,6,7,8,9,10,11,12,13,17,18]))),Ve=(0,H.lazy)(()=>n(()=>import(`./personalization-settings-panel-CllzRqsG.js`).then(e=>({default:e.PersonalizationSettingsPanel})),__vite__mapDeps([20,1,2,3,4,5,6,7,8,9,10,11,12,13,17,18]))),He=(0,H.lazy)(()=>n(()=>import(`./commit-settings-panel-C-ALJcjd.js`).then(e=>({default:e.CommitSettingsPanel})),__vite__mapDeps([21,2,1,10,6,17,9,3,4,5,7,8,11,12,13,18]))),Ue=(0,H.lazy)(()=>n(()=>import(`./index-DudvUciK.js`).then(e=>e.d).then(e=>({default:e.ProviderConnectionPanel})),__vite__mapDeps([17,1,9,2,3,4,5,6,7,8,10,11,12,13,18]))),We=(0,H.lazy)(()=>n(()=>import(`./global-settings-pets-CAXRRfK_.js`).then(e=>({default:e.GlobalSettingsPets})),__vite__mapDeps([22,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17,18,23,24]))),Ge=(0,H.lazy)(()=>n(()=>import(`./global-settings-about-CnBVv1BA.js`).then(e=>({default:e.GlobalSettingsAbout})),__vite__mapDeps([25,1,2,8,9,3,4,5,6,7,10,11,12,13,14,26,17,18,27])));function Ke({client:e,accessMode:t=`local`,initialSection:n=`appearance`,settings:r,models:i,onSave:a,onClose:o,error:s,isPending:c,apps:l,fastModeAvailable:u=!1,onRetry:d,...p}){let{t:m}=y(`settings`),[h,g]=(0,H.useState)(n),[_,v]=(0,H.useState)(()=>r??be(i)),[b,x]=(0,H.useState)(xe),[S,C]=(0,H.useState)(ee),[w,T]=(0,H.useState)(ie),[E,D]=(0,H.useState)(!1),[O,k]=(0,H.useState)(!1),A=(0,H.useRef)(_),j=(0,H.useRef)(!1),M=(0,H.useRef)(!1),N=(0,H.useRef)(!1),P=(0,H.useRef)(!0),F=(0,H.useRef)(a);F.current=a;let[I]=(0,H.useState)(()=>we(async e=>{P.current&&k(!0);try{await F.current(e),M.current=!1,P.current&&D(!1)}catch(e){throw M.current=!0,P.current&&D(!0),e}finally{P.current&&k(!1)}}));(0,H.useEffect)(()=>{r&&!j.current&&(A.current=r,v(r),I.reset(r))},[r,I]),(0,H.useEffect)(()=>(P.current=!0,()=>{P.current=!1,j.current&&I.flush(A.current)}),[I]);let L=(e,t=!1)=>{let n=e(A.current);j.current=!0,A.current=n,v(n),t?I.schedule(n,400):I.save(n)},R=(0,U.jsx)(`p`,{role:`status`,className:`text-body-small text-muted-foreground`,children:m(`loading`)}),ae=()=>{if(!N.current){if(!j.current){o();return}N.current=!0,I.flush(A.current).then(()=>{N.current=!1,M.current||o()})}},z=(0,U.jsxs)(`div`,{role:`alert`,children:[(0,U.jsx)(`p`,{className:`text-danger`,children:m(`errors.load`)}),(0,U.jsx)(f,{variant:`ghost`,onClick:()=>void d(),children:m(`common:actions.retry`)})]}),B=s===null&&!c&&r!==void 0;return(0,U.jsxs)(De,{activeSection:h,accessMode:t,onBack:ae,onSectionChange:g,children:[O&&!E?(0,U.jsx)(`p`,{role:`status`,"data-floating-surface":!0,className:`pointer-events-none fixed bottom-5 right-5 z-50 rounded-control border border-separator bg-panel px-3 py-2 text-body-small text-muted-foreground shadow-control`,children:m(`actions.saving`)}):null,E?(0,U.jsxs)(`div`,{role:`alert`,"data-floating-surface":!0,className:`fixed bottom-5 right-5 z-50 max-w-[calc(100vw-2.5rem)] rounded-control border border-separator bg-panel px-3 py-2 text-body-small text-danger shadow-control`,children:[m(`personalization.saveError`),(0,U.jsx)(f,{variant:`ghost`,onClick:()=>{I.save(A.current)},children:m(`common:actions.retry`)})]}):null,(0,U.jsx)(H.Suspense,{fallback:R,children:h===`about`?(0,U.jsx)(Ge,{activeSection:`about`,...p.appInfo===void 0?{}:{appInfo:p.appInfo},error:p.appInfoError??null,isPending:p.isAppInfoPending??!1,isUpdatePending:p.isAppUpdatePending??!1,onRetry:p.onRetryAppInfo??(()=>void 0),onUpdate:p.onUpdate??(()=>Promise.resolve()),...p.appUpdateProgress===void 0?{}:{updateProgress:p.appUpdateProgress}}):h===`provider`?(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h1`,{className:`mb-6 text-xl font-semibold`,children:m(`sections.provider`)}),(0,U.jsx)(Ue,{})]}):h===`access`&&t===`lan`?(0,U.jsx)(Re,{activeSection:`access`,...p.onLogoutAccess===void 0?{}:{onLogout:p.onLogoutAccess}}):h===`personalization`?(0,U.jsx)(Ve,{client:e,commitSettings:B?(0,U.jsx)(He,{settings:_,models:i,onChange:L,onFlush:()=>{I.save(A.current)}}):s?z:R}):B?h===`appearance`?(0,U.jsx)(Le,{activeSection:`appearance`,apps:l,settings:_,theme:b,language:S,notificationsEnabled:w,onDefaultOpenAppChange:e=>{L(t=>({...t,defaultOpenAppId:e}))},onFollowUpChange:e=>{L(t=>({...t,followUpBehavior:e}))},onThemeChange:e=>{x(e),re(e)},onLanguageChange:e=>{C(e),ne(e)},onNotificationsChange:e=>{T(e),te(e)}}):h===`pets`?(0,U.jsx)(We,{settings:_.pet,onChange:e=>{L(t=>({...t,pet:e}))}}):h===`agent`?(0,U.jsx)(Be,{client:e,settings:_,models:i,fastModeAvailable:u,onChange:e=>{L(()=>e)}}):null:s?z:R})]})}export{Ke as GlobalSettingsPage,V as _,Ce as a,ve as c,he as d,ge as f,J as g,W as h,Y as i,_e as l,G as m,Q as n,X as o,q as p,Z as r,ye as s,ze as t,me as u};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/background-image-picker-B1xDUft3.js","assets/rolldown-runtime-B0Z9INg1.js","assets/react-runtime-CMZHB3u8.js","assets/initial-deps-CW5Jl6i2.js","assets/initial-deps-CG4ykI_P.js","assets/initial-deps-D0opk7c-.js","assets/initial-deps-C0_XYRrC.js","assets/initial-deps-DZ-sH4cr.js","assets/initial-deps-C-3sxJvc.js","assets/initial-deps-CqwWvUnY.js","assets/initial-deps-B8FrcWWN.js","assets/initial-deps-Cppvl2Gz.js","assets/scheduled-task-floating-ui~index~workbench-shell~workbench-inspector-changes~project-source~c6tt9j64-ClgveiMa.js","assets/initial-deps-DFOart6r.js","assets/download-05FmZQzE.js","assets/maximize-2-CawekEKe.js","assets/upload-BQhbr7lC.js","assets/index-DobF11m_.js","assets/index-CHJSDTYw.css","assets/agent-settings-panel-C9S0LXqi.js","assets/personalization-settings-panel-CmNqDQg6.js","assets/commit-settings-panel-Cdtyux2J.js","assets/global-settings-pets-DBYFpNQk.js","assets/workbench-pet-canvas-B5jypDil.js","assets/global-settings-pets-8bzx8OFf.css","assets/global-settings-about-DpKyx3RM.js","assets/git-fork-CElzN7bT.js"])))=>i.map(i=>d[i]);
2
+ import{a as e,r as t}from"./rolldown-runtime-B0Z9INg1.js";import{t as n}from"./initial-deps-CqwWvUnY.js";import{i as r,t as i}from"./react-runtime-CMZHB3u8.js";import{o as a,s as o}from"./initial-deps-CW5Jl6i2.js";import{H as s,J as c,K as l,M as u,P as d,Tn as f,Tt as p,V as m,j as h}from"./initial-deps-C-3sxJvc.js";import{E as g,K as _,Q as v,at as y,ct as b,h as x,o as S,p as C,tt as w,u as T,w as E}from"./initial-deps-B8FrcWWN.js";import{C as D,E as O,b as k,f as A,w as j,y as M}from"./prompt-input-rTS8jFNM.js";import{t as N}from"./sliders-horizontal-C6QQuWdW.js";import{At as ee,S as P,_ as F,b as I,g as L,h as R,i as te,jt as ne,n as re,r as ie,t as ae,x as z,y as B}from"./index-DobF11m_.js";import{t as oe}from"./image-preview-Bez628xh.js";var se=w(`image-off`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]),ce=w(`monitor-cog`,[[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`m14.305 7.53.923-.382`,key:`1mlnsw`}],[`path`,{d:`m15.228 4.852-.923-.383`,key:`82mpwg`}],[`path`,{d:`m16.852 3.228-.383-.924`,key:`ln4sir`}],[`path`,{d:`m16.852 8.772-.383.923`,key:`1dejw0`}],[`path`,{d:`m19.148 3.228.383-.924`,key:`192kgf`}],[`path`,{d:`m19.53 9.696-.382-.924`,key:`fiavlr`}],[`path`,{d:`m20.772 4.852.924-.383`,key:`1j8mgp`}],[`path`,{d:`m20.772 7.148.924.383`,key:`zix9be`}],[`path`,{d:`M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7`,key:`1tnzv8`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}]]),le=w(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),ue=w(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),V=w(`paw-print`,[[`circle`,{cx:`11`,cy:`4`,r:`2`,key:`vol9p0`}],[`circle`,{cx:`18`,cy:`8`,r:`2`,key:`17gozi`}],[`circle`,{cx:`20`,cy:`16`,r:`2`,key:`1v9bxh`}],[`path`,{d:`M9 10a5 5 0 0 1 5 5v3.5a3.5 3.5 0 0 1-6.84 1.045Q6.52 17.48 4.46 16.84A3.5 3.5 0 0 1 5.5 10Z`,key:`1ydw1z`}]]),de=w(`server-cog`,[[`path`,{d:`m10.852 14.772-.383.923`,key:`11vil6`}],[`path`,{d:`M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923`,key:`1v3clb`}],[`path`,{d:`m13.148 9.228.383-.923`,key:`t2zzyc`}],[`path`,{d:`m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544`,key:`1bxfiv`}],[`path`,{d:`m14.772 10.852.923-.383`,key:`k9m8cz`}],[`path`,{d:`m14.772 13.148.923.383`,key:`1xvhww`}],[`path`,{d:`M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5`,key:`tn8das`}],[`path`,{d:`M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5`,key:`1g2pve`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`M6 6h.01`,key:`1utrut`}],[`path`,{d:`m9.228 10.852-.923-.383`,key:`1wtb30`}],[`path`,{d:`m9.228 13.148-.923.383`,key:`1a830x`}]]),fe=w(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),H=e(r(),1),U=i(),pe=[{icon:T,id:`appearance`},{icon:V,id:`pets`},{icon:de,id:`provider`},{icon:O,id:`agent`},{icon:N,id:`personalization`},{icon:ue,id:`access`},{icon:D,id:`about`}];function W({activeSection:e,children:t,id:n,title:r}){return e===n?(0,U.jsxs)(`section`,{id:`settings-panel-${n}`,children:[(0,U.jsx)(`h1`,{className:`mb-6 text-xl font-semibold`,children:r}),(0,U.jsx)(K,{children:t})]}):null}function G({children:e,title:t,description:n}){let r=(0,H.useId)();return(0,U.jsxs)(`section`,{"aria-labelledby":r,children:[(0,U.jsx)(`h2`,{className:`${n===void 0?`mb-2`:`mb-1`} text-body font-semibold`,id:r,children:t}),n===void 0?null:(0,U.jsx)(`p`,{className:`mb-3 text-body-small text-muted-foreground`,children:n}),(0,U.jsx)(K,{children:e})]})}function K({children:e}){return(0,U.jsx)(`div`,{className:`divide-y divide-separator rounded-surface border border-separator bg-panel px-4`,children:e})}function q({alignStart:e=!1,children:t,description:n,expandControl:r=!1,label:i}){return(0,U.jsxs)(`div`,{className:`grid min-h-14 ${r?`sm:grid-cols-[auto_minmax(0,1fr)]`:n===void 0?`sm:grid-cols-[minmax(9rem,1fr)_minmax(0,22rem)]`:`sm:grid-cols-[minmax(0,1fr)_minmax(10rem,16rem)]`} gap-4 py-3 ${e?`items-start`:`items-center`}`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 ${e?`pt-2`:``}`,children:[(0,U.jsx)(`span`,{className:`block text-body-small font-medium text-foreground`,children:i}),n===void 0?null:(0,U.jsx)(`p`,{className:`mt-0.5 text-label text-muted-foreground`,children:n})]}),(0,U.jsx)(`div`,{className:`flex min-w-0 justify-end`,children:t})]})}function me({disabled:e=!1,enabled:t,onChange:n}){let{t:r}=y(`settings`),i=r(`fields.fastMode`);return(0,U.jsx)(q,{label:i,children:(0,U.jsx)(c,{"aria-label":i,checked:t,disabled:e,onCheckedChange:e=>{n(e===!0)}})})}function he({ariaLabel:e,disabled:t=!1,models:n,onChange:r,value:i}){return(0,U.jsx)(J,{"aria-label":e,disabled:t,onChange:e=>{r(e.currentTarget.value)},value:i,children:n.map(e=>(0,U.jsx)(`option`,{value:e.id,children:e.displayName},e.id))})}function ge({ariaLabel:e,disabled:t,model:n,onChange:r,value:i}){let{t:a}=y(`settings`);return(0,U.jsx)(J,{"aria-label":e,disabled:t,onChange:e=>{r(e.currentTarget.value)},value:i,children:n?.supportedReasoningEfforts.map(e=>(0,U.jsx)(`option`,{value:e.id,children:a(`effort.${e.id}`,{defaultValue:e.id})},e.id))})}function J(e){return(0,U.jsxs)(`div`,{className:`relative w-40 max-w-full`,children:[(0,U.jsx)(A,{className:`h-8 w-full max-w-none !border !border-separator-strong !bg-control px-2.5 pr-8 text-body-small text-foreground`,...e}),(0,U.jsx)(_,{"aria-hidden":`true`,className:`pointer-events-none absolute right-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`})]})}b.addResourceBundle(`en`,`settings`,{general:{permissions:`Permissions`,preferences:`Preferences`,editor:`Editor`,approvalDescription:`Choose how requests for additional permissions are approved.`,sandboxDescription:`Limit file access. Full access allows changes outside the workspace.`,openAppDescription:`The preferred application for opening project files and folders.`,languageDescription:`The language used in the Codexly interface.`,themeDescription:`Choose a light or dark appearance, or follow your system.`,followUpDescription:`Queue new messages while a task runs, or steer the current task immediately.`,taskNotifications:`Task notifications`,notificationsDescription:`Send system notifications when a task completes, fails, or needs attention.`},agent:{contextWindow:{label:`Context window`,description:`Enter 272–1000, or leave blank for auto.`,automatic:`Auto`,invalid:`Enter a whole number from 272 to 1000, or leave blank.`},storage:{title:`History storage`,description:`Codex compresses server history files untouched for over 7 days in the background to free server disk space.`,compatibility:`Other Codex clients sharing this history directory must also support compressed history files.`,action:`Compress history files`,pending:`Submitting…`,scheduled:`Background compression requested. This does not confirm completion; there may be no eligible files.`,failed:`Could not request compression. Check the Codex connection and retry.`},defaults:`Agent defaults`,model:`Model defaults`,webSearch:{label:`Web search`,description:`Choose how new tasks search the web.`,disabled:`Disabled`,cached:`Cached`,live:`Live`},modelVerbosity:{label:`Output verbosity`,description:`Choose the level of detail in new task replies. Support varies by model.`,default:`Model default`,low:`Low`,medium:`Medium`,high:`High`}}},!0),b.addResourceBundle(`zh-CN`,`settings`,{general:{permissions:`权限`,preferences:`通用`,editor:`编辑器`,approvalDescription:`选择任务请求额外权限时的审批方式。`,sandboxDescription:`限制任务对文件的访问范围;完全访问允许操作工作区之外的文件。`,openAppDescription:`打开项目文件和文件夹时优先使用的应用。`,languageDescription:`Codexly 的界面语言。`,themeDescription:`选择浅色、深色或跟随系统外观。`,followUpDescription:`任务运行时,将新消息加入队列,或立即引导当前任务。`,taskNotifications:`任务通知`,notificationsDescription:`任务完成、失败或需要处理时发送系统通知。`},agent:{contextWindow:{label:`上下文窗口`,description:`填写 272–1000,留空自动。`,automatic:`自动`,invalid:`请输入 272–1000 的整数,或留空。`},storage:{title:`历史文件存储`,description:`由 Codex 在后台压缩服务端超过 7 天未写入的历史文件,释放服务端磁盘空间。`,compatibility:`共用此历史目录的其他 Codex 客户端也需支持压缩历史文件。`,action:`压缩历史文件`,pending:`正在提交…`,scheduled:`已提交后台压缩请求;不表示压缩已完成,也可能没有符合条件的文件。`,failed:`压缩请求提交失败,请检查 Codex 连接后重试。`},defaults:`智能体默认设置`,model:`模型默认设置`,webSearch:{label:`网页搜索`,description:`选择新任务搜索网页的方式。`,disabled:`关闭`,cached:`缓存`,live:`实时`},modelVerbosity:{label:`输出详细程度`,description:`选择新任务回复包含细节的详细程度,支持情况因模型而异。`,default:`模型默认`,low:`简洁`,medium:`适中`,high:`详细`}}},!0);function _e(e,t,n){let r=e.find(e=>e.id===t);if(r===void 0)return{model:t,reasoningEffort:n};let i=r.supportedReasoningEfforts.some(e=>e.id===n)?n:r.defaultReasoningEffort;return{model:r.id,reasoningEffort:i}}function ve(e){return k(e)}function ye(e,t){return M(e,t)}function be(e){let t=e.find(e=>e.isDefault)??e[0];return{approvalPolicy:`on-request`,approvalsReviewer:`user`,commitMessageModel:f,commitMessagePrompt:``,defaultOpenAppId:null,fastMode:!1,modelContextWindow:null,followUpBehavior:`queue`,model:t?.id??``,pet:{enabled:!1,selectedPetId:null},reasoningEffort:t?.defaultReasoningEffort??``,sandboxMode:`workspace-write`}}function xe(){return ae(P())}function Y({label:e,children:t,onClick:n,disabled:r=!1}){return(0,U.jsxs)(h,{children:[(0,U.jsx)(d,{asChild:!0,children:(0,U.jsx)(p,{"aria-label":e,disabled:r,onClick:n,size:`icon-sm`,type:`button`,variant:`ghost`,children:t})}),(0,U.jsx)(u,{children:e})]})}function X(e){let[t,n]=(0,H.useState)(null),r=e?.blob;return(0,H.useEffect)(()=>{if(r===void 0)return;let e=URL.createObjectURL(r);return n({blob:r,url:e}),()=>{URL.revokeObjectURL(e)}},[r]),r&&t?.blob===r?t.url:null}function Se({preference:e,onChange:t}){let{t:n}=y(`settings`);return e.mode===`none`?null:(0,U.jsxs)(`section`,{className:`wallpaper-adjustments`,children:[(0,U.jsxs)(`div`,{className:`wallpaper-section-heading`,children:[(0,U.jsx)(`h2`,{children:n(`wallpaper.adjustments`)}),(0,U.jsx)(Y,{label:n(`wallpaper.reset`),onClick:()=>{t({...e,blurPercentage:R.blurPercentage,overlayOpacity:R.overlayOpacity})},children:(0,U.jsx)(x,{"aria-hidden":`true`})})]}),(0,U.jsx)(`div`,{className:`wallpaper-sliders`,children:[{key:`overlayOpacity`,label:`background.overlayOpacityLabel`,aria:`background.overlayOpacity`},{key:`blurPercentage`,label:`background.blurLabel`,aria:`background.blur`}].map(({key:r,label:i,aria:a})=>(0,U.jsxs)(`label`,{className:`wallpaper-slider`,children:[(0,U.jsxs)(`span`,{children:[n(i),(0,U.jsxs)(`output`,{children:[e[r],`%`]})]}),(0,U.jsx)(`input`,{"aria-label":n(a),type:`range`,min:0,max:95,step:1,value:e[r],onChange:n=>{t({...e,[r]:Number(n.currentTarget.value)})}})]},r))})]})}function Ce({source:e,title:t,onClose:n,children:r,error:i=!1}){let{t:a}=y(`settings`);return(0,U.jsx)(m,{open:!0,onOpenChange:e=>{e||n()},children:(0,U.jsxs)(s,{className:`wallpaper-dialog`,"aria-describedby":void 0,children:[(0,U.jsxs)(`div`,{className:`wallpaper-section-heading`,children:[(0,U.jsx)(l,{children:t}),(0,U.jsx)(Y,{label:a(`wallpaper.close`),onClick:n,children:(0,U.jsx)(S,{"aria-hidden":`true`})})]}),(0,U.jsx)(`div`,{className:`wallpaper-original`,children:i?(0,U.jsx)(`span`,{role:`alert`,children:a(`wallpaper.imageError`)}):e===null?(0,U.jsx)(g,{"aria-label":a(`wallpaper.loading`),className:`size-5 motion-safe:animate-spin`}):(0,U.jsx)(oe,{alt:t,src:e})}),r]})})}function Z(e,t=!1){return e===null?`/v1/workbench-background/bing?day=${new Date().toLocaleDateString(`en-CA`)}`:`/v1/workbench-background/bing/image?day=${encodeURIComponent(e)}&thumbnail=${String(t)}`}function Q(e,t){return a({queryKey:[`bing-wallpaper`,e,t],queryFn:()=>Promise.resolve(Z(e??null,t)),enabled:e!==void 0,staleTime:e===null?36e5:1/0})}b.addResourceBundle(`zh-CN`,`settings`,{personalization:{instructions:`Codex 说明`,commitTitle:`提交消息`,commitDescription:`设置 Git 提交消息的生成偏好,修改后自动保存。`,commitModel:`生成模型`,commitModelDescription:`选择用于生成提交消息的模型。`,commitRules:`生成规则`,commitRulesDescription:`指定语言、格式和内容要求,仅用于生成提交消息。`,commitPlaceholder:`例如:使用简体中文,遵循 Conventional Commits,简要说明变更目的。`,fileLocation:`文件位置:{{path}}`,description:`为在此电脑上运行的任务提供说明和上下文。项目中的说明也会适用。保存后对新会话生效。`,save:`保存`,saving:`正在保存`,saved:`已保存`,reload:`重新读取`,loadError:`读取失败,请重试。`,saveError:`保存失败,草稿已保留。`,conflict:`文件已在其他位置修改。请复制保留草稿,再重新读取后编辑。`,override:`检测到 AGENTS.override.md,Codex 会优先使用其中的说明。`,memories:`记忆`,memoryDescription:`设置 Codex 如何收集、保留和使用本地记忆。设置应用于后续会话。`,enabled:`启用本地记忆`,enabledDescription:`根据此电脑上的聊天生成记忆,并用于后续聊天。`,external:`允许基于工具辅助聊天生成本地记忆`,externalDescription:`允许从使用过 MCP 工具或网页搜索的聊天生成记忆。`,remove:`删除本地记忆`,removeDescription:`清除本地记忆文件和记忆处理数据,保留聊天记录。`,confirm:`确认删除`,confirmDescription:`此操作无法撤销。启用记忆时,后续会话仍可能生成新记忆。`,cancel:`取消`,deleting:`正在删除`,deleted:`本地记忆已删除`,memoryError:`记忆操作失败,请重试。`}},!0),b.addResourceBundle(`en`,`settings`,{personalization:{instructions:`Codex instructions`,commitTitle:`Commit messages`,commitDescription:`Set preferences for generated Git commit messages. Changes are saved automatically.`,commitModel:`Generation model`,commitModelDescription:`Choose the model used to generate commit messages.`,commitRules:`Generation rules`,commitRulesDescription:`Specify language, format, and content requirements for commit messages only.`,commitPlaceholder:`For example: follow Conventional Commits and briefly explain the purpose of the changes.`,fileLocation:`File location: {{path}}`,description:`Provide instructions and context for tasks on this computer. Project instructions also apply. Saved changes apply to new sessions.`,save:`Save`,saving:`Saving`,saved:`Saved`,reload:`Reload`,loadError:`Could not load. Please retry.`,saveError:`Could not save. Your draft is preserved.`,conflict:`The file changed elsewhere. Copy your draft before reloading and editing again.`,override:`AGENTS.override.md is present. Codex prioritizes its instructions.`,memories:`Memory`,memoryDescription:`Choose how Codex collects, retains, and uses local memory. Changes apply to subsequent sessions.`,enabled:`Enable local memory`,enabledDescription:`Generate memory from chats on this computer and use it in future chats.`,external:`Allow memory from tool-assisted chats`,externalDescription:`Allow memory from chats that used MCP tools or web search.`,remove:`Delete local memory`,removeDescription:`Clear local memory files and processing data while keeping chat history.`,confirm:`Confirm deletion`,confirmDescription:`This cannot be undone. Future sessions may generate new memory while memory is enabled.`,cancel:`Cancel`,deleting:`Deleting`,deleted:`Local memory deleted`,memoryError:`Memory operation failed. Please retry.`}},!0);function we(e){let t=``,n,r,i,a,o=()=>{i!==void 0&&clearTimeout(i),i=void 0},s=()=>(a===void 0&&(a=(async()=>{for(;n!==void 0;){let r=n;n=void 0;let i=JSON.stringify(r);if(i!==t)try{await e(r),t=i}catch{}}})().finally(()=>{a=void 0,n!==void 0&&s()})),a);return{async flush(e){for(o(),n=e??r??n,r=void 0;n!==void 0||a!==void 0;)await s()},reset(e){t=JSON.stringify(e)},save:e=>{o(),r=void 0,n=e,s()},schedule(e,t){o(),r=e,i=setTimeout(()=>{i=void 0,n=r,r=void 0,s()},t)}}}var Te=[{id:`personal`,sections:[`appearance`,`pets`]},{id:`coding`,sections:[`provider`,`agent`,`personalization`]},{id:`app`,sections:[`access`,`about`]}],Ee={access:[`access.logout`],personalization:[`personalization.instructions`,`personalization.memories`,`personalization.enabled`,`personalization.external`,`fields.commitModel`,`fields.commitMessagePrompt`,`fields.prompt`],appearance:[`appearance.colorMode`,`appearance.language`,`appearance.notifications`,`fields.defaultOpenWith`,`fields.followUpMessages`,`general.editor`,`general.taskNotifications`,`background.label`,`background.bing`,`background.custom`,`background.blurLabel`,`background.overlayOpacityLabel`],pets:[`pets.enabled`,`pets.selectionLabel`],provider:[`provider.apiKey`,`provider.baseUrl`,`provider.models`,`provider.official`,`provider.custom`],agent:[`fields.fastMode`,`fields.model`,`fields.reasoningEffort`,`fields.approvalPolicy`,`fields.sandbox`,`agent.webSearch.label`,`agent.modelVerbosity.label`],about:[`about.codexlyVersion`,`about.codexVersion`,`about.update`,`about.releaseNotes`]};function De({activeSection:e,accessMode:t=`local`,children:n,onBack:r,onSectionChange:i}){let{t:a}=y(`settings`),[o,s]=(0,H.useState)(``),c=(0,H.useRef)(null),l=(0,H.useRef)(null),f=(0,H.useRef)(null),m=o.trim().toLocaleLowerCase(),g=pe.filter(({id:e})=>e!==`access`||t===`lan`).filter(({id:e})=>[a(`sections.${e}`),a(`sectionKeywords.${e}`),...Ee[e].map(e=>a(e))].some(e=>e.toLocaleLowerCase().includes(m)));(0,H.useEffect)(()=>{c.current?.focus({preventScroll:!0})},[]);let _=(0,H.useEffectEvent)(e=>{e.key!==`Escape`||e.defaultPrevented||e.isComposing||[...document.querySelectorAll(`[role="dialog"], [role="alertdialog"], dialog[open]`)].some(e=>e.getClientRects().length>0)||(e.preventDefault(),o===``?r():s(``))});return(0,H.useEffect)(()=>(document.addEventListener(`keydown`,_),()=>{document.removeEventListener(`keydown`,_)}),[]),(0,U.jsxs)(`div`,{role:`region`,"aria-label":a(`title`),className:`settings-page grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] sm:grid-cols-[var(--ui-layout-settings-sidebar-width)_minmax(0,1fr)] sm:grid-rows-1 overflow-hidden bg-window text-foreground`,children:[(0,U.jsxs)(`aside`,{className:`flex min-h-0 min-w-0 flex-col bg-control px-3 py-3 sm:pb-5 sm:pt-6`,children:[(0,U.jsxs)(p,{contentAlign:`start`,className:`mb-5 h-9 w-full justify-start gap-2 px-2.5 text-body`,onClick:r,ref:c,type:`button`,variant:`ghost`,children:[(0,U.jsx)(v,{"aria-hidden":`true`}),a(`actions.backToApp`)]}),(0,U.jsxs)(`div`,{className:`mb-6 flex h-9 shrink-0 items-center gap-2 rounded-control bg-control px-2.5 focus-within:shadow-focus`,children:[(0,U.jsx)(C,{"aria-hidden":`true`,className:`text-subtle-foreground`}),(0,U.jsx)(`input`,{"aria-label":a(`search.label`),className:`min-w-0 flex-1 bg-transparent text-body-small !outline-none placeholder:text-subtle-foreground [&::-webkit-search-cancel-button]:appearance-none`,onChange:e=>{s(e.currentTarget.value)},placeholder:a(`search.placeholder`),ref:l,type:`search`,value:o}),o===``?null:(0,U.jsxs)(h,{children:[(0,U.jsx)(d,{asChild:!0,children:(0,U.jsx)(p,{"aria-label":a(`search.clear`),className:`size-6 shrink-0`,onClick:()=>{s(``),l.current?.focus()},size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,U.jsx)(S,{"aria-hidden":`true`})})}),(0,U.jsx)(u,{children:a(`search.clear`)})]})]}),(0,U.jsxs)(`nav`,{"aria-label":a(`navigationLabel`),className:`flex min-h-0 gap-4 overflow-x-auto sm:block sm:space-y-6 sm:overflow-y-auto`,children:[Te.map(t=>{let n=g.filter(({id:e})=>t.sections.some(t=>t===e));return n.length===0?null:(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`mb-2 px-2.5 text-label text-subtle-foreground`,children:a(`groups.${t.id}`)}),(0,U.jsx)(`div`,{className:`flex gap-1 sm:block sm:space-y-1`,children:n.map(({icon:t,id:n})=>(0,U.jsxs)(p,{"aria-current":e===n?`page`:void 0,contentAlign:`start`,className:`h-9 sm:w-full justify-start gap-2.5 px-2.5 text-body-small ${e===n?`bg-control-hover text-foreground`:`text-muted-foreground`}`,onClick:()=>{i(n),f.current?.scrollTo({top:0})},type:`button`,variant:`ghost`,children:[(0,U.jsx)(t,{"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`min-w-0 truncate`,children:a(`sections.${n}`)})]},n))})]},t.id)}),g.length===0?(0,U.jsx)(`p`,{className:`px-2.5 text-body-small text-muted-foreground`,role:`status`,children:a(`search.empty`)}):null]})]}),(0,U.jsx)(`main`,{"aria-label":a(`title`),className:`min-h-0 min-w-0 overflow-y-auto px-5 py-6 sm:px-10 sm:py-12`,ref:f,children:(0,U.jsx)(`div`,{className:`mx-auto w-full max-w-content`,children:n})})]})}function Oe(){return I(P())}function ke(){let[e,t]=(0,H.useState)(Oe),[n,r]=(0,H.useState)([]),[i,a]=(0,H.useState)(()=>new Set),[o,s]=(0,H.useState)(()=>new Set),[c,l]=(0,H.useState)(!1),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(0);(0,H.useEffect)(()=>{if(e.mode!==`custom`||c)return;let t=!1;return d(!1),B().then(e=>{t||(r(e),a(new Set(e.map(e=>e.id))),l(!0))}).catch(()=>{t||d(!0)}),()=>{t=!0}},[e.mode,c,f]);let m=(0,H.useMemo)(()=>({deletedImageIds:[...o],imagesToSave:n.filter(e=>!i.has(e.id))}),[n,o,i]);return{isLoading:e.mode===`custom`&&!c&&!u,loadError:u,retryLoad:()=>{p(e=>e+1)},addCustomBackgroundFiles:e=>{let n=e.map(e=>F(e));n.length!==0&&(r(e=>[...e,...n]),t(e=>({...e,mode:`custom`,selectedCustomImageId:n.at(-1)?.id??e.selectedCustomImageId})))},background:e,backgroundMutation:m,customBackgroundMissing:e.mode===`custom`&&(e.selectedCustomImageId===null||!n.some(t=>t.id===e.selectedCustomImageId)),customImages:n,removeCustomBackgroundImage:a=>{let o=z(n,a,e.selectedCustomImageId);r(o.images),t(e=>({...e,mode:o.images.length===0?`none`:e.mode,selectedCustomImageId:e.selectedCustomImageId===a?o.selectedCustomImageId:e.selectedCustomImageId})),i.has(a)&&s(e=>new Set(e).add(a))},selectCustomBackgroundImage:e=>{t(t=>({...t,mode:`custom`,selectedCustomImageId:e}))},setBackground:t}}b.addResourceBundle(`zh-CN`,`settings`,{wallpaper:{source:`壁纸来源`,close:`关闭预览`,description:`使用每日风景或自己的图片装点工作台。`,bingMode:`Bing`,choose:`选择图片`,pickerDescription:`选择喜欢的图片,即时应用到工作台。`,closePicker:`关闭图片选择`,done:`完成`,addFavorite:`添加喜欢的图片`,customSelected:`自定义背景`,customFormats:`支持 JPG、PNG、WebP 和 GIF`,collection:`Bing 每日壁纸`,recent:`近期壁纸`,daily:`每日自动更新`,selected:`当前使用`,download:`下载原图`,downloading:`正在下载`,downloaded:`已保存 {{name}}`,loading:`正在加载壁纸`,loadError:`壁纸加载失败`,retry:`重新加载`,custom:`我的壁纸`,empty:`还没有添加壁纸`,upload:`添加图片`,adjustments:`显示效果`,reset:`重置显示效果`,imageError:`图片无法预览`,select:`使用 {{name}}`,view:`预览 {{name}}`,downloadImage:`下载 {{name}}`}},!0),b.addResourceBundle(`en`,`settings`,{wallpaper:{source:`Wallpaper source`,close:`Close preview`,description:`Personalize your workspace with daily scenery or your own images.`,bingMode:`Bing`,choose:`Choose image`,pickerDescription:`Choose an image to apply it to your workspace.`,closePicker:`Close image picker`,done:`Done`,addFavorite:`Add a favorite image`,customSelected:`Custom background`,customFormats:`Supports JPG, PNG, WebP and GIF`,collection:`Bing daily wallpapers`,recent:`Recent wallpapers`,daily:`Update daily`,selected:`In use`,download:`Download original`,downloading:`Downloading`,downloaded:`Saved {{name}}`,loading:`Loading wallpapers`,loadError:`Unable to load wallpapers`,retry:`Reload`,custom:`My wallpapers`,empty:`No wallpapers yet`,upload:`Add images`,adjustments:`Appearance`,reset:`Reset appearance`,imageError:`Unable to preview image`,select:`Use {{name}}`,view:`Preview {{name}}`,downloadImage:`Download {{name}}`}},!0);function $({source:e,loading:t=!1}){let[n,r]=(0,H.useState)(null);return(0,U.jsx)(`div`,{className:`background-summary-image`,"aria-hidden":`true`,children:e!==null&&e!==n?(0,U.jsx)(`img`,{alt:``,src:e,decoding:`async`,onError:()=>{r(e)}}):t?(0,U.jsx)(g,{className:`size-4 motion-safe:animate-spin`}):e?(0,U.jsx)(se,{className:`size-5`}):(0,U.jsx)(j,{className:`size-5`})})}function Ae({image:e}){let{t}=y(`settings`),n=X(e);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)($,{source:n}),(0,U.jsxs)(`div`,{className:`background-summary-text`,children:[(0,U.jsx)(`p`,{title:e?.name,children:e?.name??t(`wallpaper.addFavorite`)}),(0,U.jsx)(`span`,{children:t(e?`wallpaper.customSelected`:`wallpaper.customFormats`)})]})]})}function je({preference:e}){let{t}=y(`settings`),n=o(Q(e.selectedBingDay??null,!0));return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)($,{source:n.data??null,loading:n.isPending}),(0,U.jsxs)(`div`,{className:`background-summary-text`,children:[(0,U.jsx)(`p`,{children:t(`background.bingAria`)}),(0,U.jsx)(`span`,{children:n.isError?t(`wallpaper.imageError`):e.selectedBingDay??t(`wallpaper.daily`)})]})]})}var Me=(0,H.lazy)(()=>n(()=>import(`./background-image-picker-B1xDUft3.js`).then(e=>({default:e.BackgroundImagePicker})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]))),Ne=[{ariaKey:`background.noneAria`,labelKey:`background.none`,value:`none`},{ariaKey:`background.bingAria`,labelKey:`wallpaper.bingMode`,value:`bing`},{ariaKey:`background.customAria`,labelKey:`background.custom`,value:`custom`}];function Pe(e){let{preference:t,customImages:n,onPreferenceChange:r}=e,{t:i}=y(`settings`),[a,o]=(0,H.useState)(!1);return(0,U.jsxs)(`div`,{className:`wallpaper-settings`,children:[(0,U.jsx)(q,{label:i(`background.label`),description:i(`wallpaper.description`),children:(0,U.jsx)(`div`,{className:`background-mode-control`,role:`group`,"aria-label":i(`wallpaper.source`),children:Ne.map(({ariaKey:e,labelKey:n,value:a})=>(0,U.jsx)(p,{"aria-label":i(e),"aria-pressed":t.mode===a,className:t.mode===a?`bg-raised text-foreground shadow-control`:`text-muted-foreground`,onClick:()=>{r({...t,mode:a})},type:`button`,variant:`ghost`,children:i(n)},a))})}),t.mode===`none`?null:(0,U.jsxs)(`div`,{className:`background-details`,children:[(0,U.jsxs)(`div`,{className:`background-summary`,children:[t.mode===`bing`?(0,U.jsx)(je,{preference:t}):(0,U.jsx)(Ae,{image:n.find(e=>e.id===t.selectedCustomImageId)}),(0,U.jsx)(p,{variant:`outline`,type:`button`,onClick:()=>{o(!0)},children:i(`wallpaper.choose`)})]}),(0,U.jsx)(Se,{preference:t,onChange:r})]}),a?(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(`span`,{role:`status`,className:`px-4 text-label text-muted-foreground`,children:i(`wallpaper.loading`)}),children:(0,U.jsx)(Me,{...e,onClose:()=>{o(!1)}})}):null]})}function Fe(){let{t:e}=y(`settings`),t=ke(),[n,r]=(0,H.useState)(!1),[i,a]=(0,H.useState)(0),o=(0,H.useRef)(!1),s=(0,H.useRef)(Promise.resolve()),{background:c,backgroundMutation:l,customBackgroundMissing:u}=t;return(0,H.useEffect)(()=>{o.current&&!u&&(s.current=s.current.catch(()=>void 0).then(()=>L(c,l)).then(()=>{r(!1)},()=>{r(!0)}))},[c,l,u,i]),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(Pe,{customImages:t.customImages,disabled:t.isLoading||t.loadError,loadError:t.loadError,onRetry:t.retryLoad,preference:c,onCustomFilesAdd:e=>{o.current=!0,t.addCustomBackgroundFiles(e)},onCustomImageRemove:e=>{o.current=!0,t.removeCustomBackgroundImage(e)},onCustomImageSelect:e=>{o.current=!0,t.selectCustomBackgroundImage(e)},onPreferenceChange:e=>{o.current=!0,t.setBackground(e)}}),n?(0,U.jsxs)(`div`,{role:`alert`,className:`text-body-small text-danger`,children:[e(`personalization.saveError`),(0,U.jsx)(p,{variant:`ghost`,onClick:()=>{a(e=>e+1)},children:e(`common:actions.retry`)})]}):null]})}var Ie=[{value:`system`,icon:ce,label:`automatic`,aria:`automaticMode`},{value:`light`,icon:fe,label:`light`,aria:`lightMode`},{value:`dark`,icon:le,label:`dark`,aria:`darkMode`}];function Le({activeSection:e,apps:t,settings:n,language:r,notificationsEnabled:i,theme:a,onFollowUpChange:o,onDefaultOpenAppChange:s,onLanguageChange:c,onNotificationsChange:l,onThemeChange:f}){let{t:m}=y(`settings`);return e===`appearance`?(0,U.jsxs)(`section`,{id:`settings-panel-appearance`,children:[(0,U.jsx)(`h1`,{className:`mb-6 text-xl font-semibold`,children:m(`sections.appearance`)}),(0,U.jsxs)(`div`,{className:`space-y-6`,children:[(0,U.jsxs)(G,{title:m(`general.preferences`),children:[t.some(e=>e.kind!==`system-default`)?(0,U.jsx)(q,{label:m(`fields.defaultOpenWith`),description:m(`general.openAppDescription`),children:(0,U.jsxs)(J,{"aria-label":m(`fields.defaultOpenWith`),value:n.defaultOpenAppId??``,onChange:e=>{s(e.currentTarget.value||null)},children:[(0,U.jsx)(`option`,{value:``,children:m(`integration.automatic`)}),t.filter(e=>e.kind!==`system-default`).map(e=>(0,U.jsx)(`option`,{value:e.id,children:e.name},e.id))]})}):null,(0,U.jsx)(q,{label:m(`appearance.language`),description:m(`general.languageDescription`),children:(0,U.jsxs)(J,{"aria-label":m(`appearance.language`),value:r,onChange:e=>{c(e.currentTarget.value)},children:[(0,U.jsx)(`option`,{value:`zh-CN`,children:m(`languages.zhCN`)}),(0,U.jsx)(`option`,{value:`en`,children:m(`languages.en`)})]})}),(0,U.jsx)(q,{label:m(`appearance.colorMode`),description:m(`general.themeDescription`),children:(0,U.jsx)(`div`,{className:`grid w-40 grid-cols-3 rounded-control bg-control p-0.5`,role:`group`,"aria-label":m(`appearance.colorMode`),children:Ie.map(({value:e,icon:t,label:n,aria:r})=>(0,U.jsxs)(h,{children:[(0,U.jsx)(d,{asChild:!0,children:(0,U.jsx)(p,{"aria-label":m(`appearance.${r}`),"aria-pressed":a===e,className:`h-7 min-w-0 px-2 ${a===e?`bg-raised text-foreground shadow-control`:`text-muted-foreground`}`,variant:`ghost`,type:`button`,onClick:()=>{f(e)},children:(0,U.jsx)(t,{"aria-hidden":`true`})})}),(0,U.jsx)(u,{children:m(`appearance.${n}`)})]},e))})}),(0,U.jsx)(Fe,{})]}),(0,U.jsx)(G,{title:m(`general.editor`),children:(0,U.jsx)(q,{label:m(`fields.followUpMessages`),description:m(`general.followUpDescription`),children:(0,U.jsx)(`div`,{className:`grid w-40 grid-cols-2 rounded-control bg-control p-0.5`,role:`group`,"aria-label":m(`fields.followUpMessages`),children:[`queue`,`steer`].map(e=>(0,U.jsx)(p,{"aria-pressed":n.followUpBehavior===e,className:`h-7 px-3 text-body-small ${n.followUpBehavior===e?`bg-raised text-foreground shadow-control`:`text-muted-foreground`}`,variant:`ghost`,type:`button`,onClick:()=>{o(e)},children:m(`followUp.${e}`)},e))})})}),(0,U.jsx)(G,{title:m(`appearance.notifications`),children:(0,U.jsx)(q,{label:m(`general.taskNotifications`),description:m(`general.notificationsDescription`),children:(0,U.jsx)(p,{role:`switch`,"aria-label":m(`general.taskNotifications`),"aria-checked":i,className:`h-6 w-10 rounded-pill p-0.5 ${i?`bg-brand hover:bg-brand`:`bg-control-hover`}`,variant:`ghost`,type:`button`,onClick:()=>{l(!i)},children:(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`block size-5 rounded-pill bg-brand-contrast shadow-control transition-transform motion-reduce:transition-none ${i?`translate-x-2`:`-translate-x-2`}`})})})})]})]}):null}function Re({activeSection:e,onLogout:t}){let{t:n}=y(`settings`),[r,i]=(0,H.useState)(!1);return(0,U.jsx)(W,{activeSection:e,id:`access`,title:n(`sections.access`),children:(0,U.jsx)(q,{label:n(`access.currentSession`),children:(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-col items-start gap-2 py-1`,children:[(0,U.jsx)(`p`,{className:`text-body-small text-muted-foreground`,children:n(`access.sessionDescription`)}),(0,U.jsxs)(p,{className:`inline-flex h-8 items-center gap-2 rounded-control bg-control px-3 text-body-small font-medium text-danger hover:bg-control-hover focus-visible:shadow-focus disabled:opacity-50`,disabled:r||t===void 0,onClick:()=>{t!==void 0&&(i(!0),t().catch(()=>void 0).finally(()=>{i(!1)}))},type:`button`,variant:`ghost`,children:[(0,U.jsx)(E,{"aria-hidden":`true`,"data-icon":`inline-start`}),n(r?`access.loggingOut`:`access.logout`)]})]})})})}var ze=t({GlobalSettingsPage:()=>Ke}),Be=(0,H.lazy)(()=>n(()=>import(`./agent-settings-panel-C9S0LXqi.js`).then(e=>({default:e.AgentSettingsPanel})),__vite__mapDeps([19,1,2,3,4,5,6,7,8,9,10,11,12,13,17,18]))),Ve=(0,H.lazy)(()=>n(()=>import(`./personalization-settings-panel-CmNqDQg6.js`).then(e=>({default:e.PersonalizationSettingsPanel})),__vite__mapDeps([20,1,2,3,4,5,6,7,8,9,10,11,12,13,17,18]))),He=(0,H.lazy)(()=>n(()=>import(`./commit-settings-panel-Cdtyux2J.js`).then(e=>({default:e.CommitSettingsPanel})),__vite__mapDeps([21,2,1,10,6,17,9,3,4,5,7,8,11,12,13,18]))),Ue=(0,H.lazy)(()=>n(()=>import(`./index-DobF11m_.js`).then(e=>e.d).then(e=>({default:e.ProviderConnectionPanel})),__vite__mapDeps([17,1,9,2,3,4,5,6,7,8,10,11,12,13,18]))),We=(0,H.lazy)(()=>n(()=>import(`./global-settings-pets-DBYFpNQk.js`).then(e=>({default:e.GlobalSettingsPets})),__vite__mapDeps([22,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17,18,23,24]))),Ge=(0,H.lazy)(()=>n(()=>import(`./global-settings-about-DpKyx3RM.js`).then(e=>({default:e.GlobalSettingsAbout})),__vite__mapDeps([25,1,2,8,9,3,4,5,6,7,10,11,12,13,14,26,17,18])));function Ke({client:e,accessMode:t=`local`,initialSection:n=`appearance`,settings:r,models:i,onSave:a,onClose:o,error:s,isPending:c,apps:l,fastModeAvailable:u=!1,onRetry:d,...f}){let{t:m}=y(`settings`),[h,g]=(0,H.useState)(n),[_,v]=(0,H.useState)(()=>r??be(i)),[b,x]=(0,H.useState)(xe),[S,C]=(0,H.useState)(ne),[w,T]=(0,H.useState)(ie),[E,D]=(0,H.useState)(!1),[O,k]=(0,H.useState)(!1),A=(0,H.useRef)(_),j=(0,H.useRef)(!1),M=(0,H.useRef)(!1),N=(0,H.useRef)(!1),P=(0,H.useRef)(!0),F=(0,H.useRef)(a);F.current=a;let[I]=(0,H.useState)(()=>we(async e=>{P.current&&k(!0);try{await F.current(e),M.current=!1,P.current&&D(!1)}catch(e){throw M.current=!0,P.current&&D(!0),e}finally{P.current&&k(!1)}}));(0,H.useEffect)(()=>{r&&!j.current&&(A.current=r,v(r),I.reset(r))},[r,I]),(0,H.useEffect)(()=>(P.current=!0,()=>{P.current=!1,j.current&&I.flush(A.current)}),[I]);let L=(e,t=!1)=>{let n=e(A.current);j.current=!0,A.current=n,v(n),t?I.schedule(n,400):I.save(n)},R=(0,U.jsx)(`p`,{role:`status`,className:`text-body-small text-muted-foreground`,children:m(`loading`)}),ae=()=>{if(!N.current){if(!j.current){o();return}N.current=!0,I.flush(A.current).then(()=>{N.current=!1,M.current||o()})}},z=(0,U.jsxs)(`div`,{role:`alert`,children:[(0,U.jsx)(`p`,{className:`text-danger`,children:m(`errors.load`)}),(0,U.jsx)(p,{variant:`ghost`,onClick:()=>void d(),children:m(`common:actions.retry`)})]}),B=s===null&&!c&&r!==void 0;return(0,U.jsxs)(De,{activeSection:h,accessMode:t,onBack:ae,onSectionChange:g,children:[O&&!E?(0,U.jsx)(`p`,{role:`status`,"data-floating-surface":!0,className:`pointer-events-none fixed bottom-5 right-5 z-50 rounded-control border border-separator bg-panel px-3 py-2 text-body-small text-muted-foreground shadow-control`,children:m(`actions.saving`)}):null,E?(0,U.jsxs)(`div`,{role:`alert`,"data-floating-surface":!0,className:`fixed bottom-5 right-5 z-50 max-w-[calc(100vw-2.5rem)] rounded-control border border-separator bg-panel px-3 py-2 text-body-small text-danger shadow-control`,children:[m(`personalization.saveError`),(0,U.jsx)(p,{variant:`ghost`,onClick:()=>{I.save(A.current)},children:m(`common:actions.retry`)})]}):null,(0,U.jsx)(H.Suspense,{fallback:R,children:h===`about`?(0,U.jsx)(Ge,{activeSection:`about`,...f.appInfo===void 0?{}:{appInfo:f.appInfo},error:f.appInfoError??null,isPending:f.isAppInfoPending??!1,isUpdatePending:f.isAppUpdatePending??!1,onRetry:f.onRetryAppInfo??(()=>void 0),onUpdate:f.onUpdate??(()=>Promise.resolve()),...f.appUpdateProgress===void 0?{}:{updateProgress:f.appUpdateProgress}}):h===`provider`?(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h1`,{className:`mb-6 text-xl font-semibold`,children:m(`sections.provider`)}),(0,U.jsx)(Ue,{})]}):h===`access`&&t===`lan`?(0,U.jsx)(Re,{activeSection:`access`,...f.onLogoutAccess===void 0?{}:{onLogout:f.onLogoutAccess}}):h===`personalization`?(0,U.jsx)(Ve,{client:e,commitSettings:B?(0,U.jsx)(He,{settings:_,models:i,onChange:L,onFlush:()=>{I.save(A.current)}}):s?z:R}):B?h===`appearance`?(0,U.jsx)(Le,{activeSection:`appearance`,apps:l,settings:_,theme:b,language:S,notificationsEnabled:w,onDefaultOpenAppChange:e=>{L(t=>({...t,defaultOpenAppId:e}))},onFollowUpChange:e=>{L(t=>({...t,followUpBehavior:e}))},onThemeChange:e=>{x(e),re(e)},onLanguageChange:e=>{C(e),ee(e)},onNotificationsChange:e=>{T(e),te(e)}}):h===`pets`?(0,U.jsx)(We,{settings:_.pet,onChange:e=>{L(t=>({...t,pet:e}))}}):h===`agent`?(0,U.jsx)(Be,{client:e,settings:_,models:i,fastModeAvailable:u,onChange:e=>{L(()=>e)}}):null:s?z:R})]})}export{Ke as GlobalSettingsPage,V as _,Ce as a,ve as c,he as d,ge as f,J as g,W as h,Y as i,_e as l,G as m,Q as n,X as o,q as p,Z as r,ye as s,ze as t,me as u};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./react-runtime-CMZHB3u8.js";import{i as r,s as i,u as a}from"./initial-deps-CW5Jl6i2.js";import{Tt as o}from"./initial-deps-B7SS8XxM.js";import{at as s,ct as c,g as l,q as u}from"./initial-deps-B8FrcWWN.js";import{t as d}from"./download-05FmZQzE.js";import"./index-DudvUciK.js";import{n as f,r as p,t as m}from"./workbench-pet-canvas-DuBL3mip.js";import{_ as h}from"./global-settings-page-VbyWoa5s.js";var g=e(t(),1);c.addResourceBundle(`zh-CN`,`settings`,{petPage:{on:`已开启`,off:`已关闭`,onHint:`在桌面显示宠物与任务动态`,offHint:`宠物已隐藏,保留当前选择`,selectionHint:`选择后自动保存`,selected:`已选择`,empty:`暂无可用宠物,请刷新列表。`}},!0),c.addResourceBundle(`en`,`settings`,{petPage:{on:`On`,off:`Off`,onHint:`Show your pet and task activity on the desktop`,offHint:`Pet hidden. Your selection is kept.`,selectionHint:`Selection saves automatically`,selected:`Selected`,empty:`No pets available. Refresh the list to try again.`}},!0);var _=n(),v=[];function y(e,t){let n=t.find(t=>t.id===e.selectedPetId)?.id??t.find(e=>e.id===`codex`)?.id??t[0]?.id;return n===void 0?{enabled:!1,selectedPetId:e.selectedPetId}:{enabled:!0,selectedPetId:n}}function b({pet:e}){return e.availability===`ready`?(0,_.jsx)(`span`,{className:`pet-settings-preview`,"aria-hidden":`true`,children:(0,_.jsx)(m,{animationName:`idle`,pet:e})}):(0,_.jsx)(`span`,{className:`pet-settings-preview`,"aria-hidden":`true`,children:(0,_.jsx)(h,{"aria-hidden":`true`,className:`size-5`})})}function x({error:e,isLoading:t,onEnabledChange:n,onPetSelect:r,onRefresh:i,pets:a,settings:c}){let{t:f}=s(`settings`);return(0,_.jsxs)(`section`,{id:`settings-panel-pets`,children:[(0,_.jsxs)(`div`,{className:`mb-6 flex min-w-0 items-center justify-between gap-3`,children:[(0,_.jsx)(`h1`,{className:`text-xl font-semibold`,children:f(`sections.pets`)}),(0,_.jsxs)(o,{onClick:i,size:`sm`,type:`button`,variant:`ghost`,children:[(0,_.jsx)(l,{"aria-hidden":`true`,"data-icon":`inline-start`}),f(`pets.refresh`)]})]}),(0,_.jsxs)(`div`,{className:`pet-settings-power`,"data-enabled":c.enabled,children:[(0,_.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,_.jsx)(`h2`,{className:`text-body-small font-medium`,children:f(`pets.enabled`)}),(0,_.jsx)(`p`,{className:`mt-1 text-label text-muted-foreground`,id:`pet-power-description`,children:f(c.enabled?`petPage.onHint`:`petPage.offHint`)})]}),(0,_.jsxs)(`button`,{className:`pet-settings-toggle`,type:`button`,role:`switch`,"aria-label":f(`pets.enabled`),"aria-describedby":`pet-power-description`,"aria-checked":c.enabled,disabled:!c.enabled&&(t||a.length===0),onClick:()=>{n(!c.enabled)},children:[(0,_.jsx)(`span`,{children:f(c.enabled?`petPage.on`:`petPage.off`)}),(0,_.jsx)(`span`,{className:`pet-settings-track`,"aria-hidden":`true`,children:(0,_.jsx)(`span`,{})})]})]}),t?(0,_.jsx)(`p`,{className:`grid min-h-36 place-items-center text-body-small text-muted-foreground`,role:`status`,children:f(`pets.loading`)}):e!==null&&a.length===0?(0,_.jsxs)(`div`,{className:`grid min-h-36 place-items-center gap-3 py-5 text-center`,role:`alert`,children:[(0,_.jsx)(`p`,{className:`text-body-small text-danger`,children:f(`pets.errors.load`)}),(0,_.jsxs)(o,{onClick:i,size:`sm`,type:`button`,variant:`outline`,children:[(0,_.jsx)(l,{"aria-hidden":`true`,"data-icon":`inline-start`}),f(`common:actions.retry`)]})]}):(0,_.jsxs)(_.Fragment,{children:[e===null?null:(0,_.jsx)(`p`,{className:`mt-3 text-body-small text-danger`,role:`alert`,children:f(`pets.errors.load`)}),(0,_.jsxs)(`div`,{className:`pet-settings-collection-heading`,children:[(0,_.jsx)(`h2`,{children:f(`pets.selectionLabel`)}),(0,_.jsx)(`span`,{children:f(`petPage.selectionHint`)})]}),a.length===0?(0,_.jsx)(`p`,{className:`py-8 text-body-small text-muted-foreground`,children:f(`petPage.empty`)}):null,(0,_.jsx)(`div`,{"aria-label":f(`pets.selectionLabel`),className:`pet-settings-gallery`,role:`radiogroup`,children:a.map(e=>{let t=c.selectedPetId===e.id;return(0,_.jsxs)(o,{"aria-checked":t,className:`pet-settings-card`,contentAlign:`start`,onClick:()=>{r(e.id)},role:`radio`,type:`button`,variant:`ghost`,children:[(0,_.jsx)(b,{pet:e}),(0,_.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,_.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,_.jsx)(`span`,{className:`truncate font-medium`,children:e.displayName}),t?(0,_.jsxs)(`span`,{className:`pet-settings-selected`,children:[(0,_.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),f(`petPage.selected`)]}):null]}),(0,_.jsx)(`span`,{className:`mt-0.5 line-clamp-2 block text-label text-muted-foreground`,children:e.description}),(0,_.jsxs)(`span`,{className:`mt-1 inline-flex items-center gap-1 text-label text-muted-foreground`,children:[e.availability===`ready`?null:(0,_.jsx)(d,{"aria-hidden":`true`,className:`size-3`}),f(`pets.availability.${e.availability}`)]})]})]},e.id)})})]})]})}function S({onChange:e,settings:t}){let n=a(),o=i(p()),s=r(f(n)),c=o.data?.data??v,l=(0,g.useRef)(new Set),u=s.mutate,d=(0,g.useCallback)(e=>{l.current.has(e)||(l.current.add(e),u(e,{onError:()=>{l.current.delete(e)}}))},[u]);(0,g.useEffect)(()=>{for(let e of c)e.availability===`downloadable`&&d(e.id)},[d,c]);let m=(n,r=t.enabled)=>{let i=c.find(e=>e.id===n);e(r?{enabled:!0,selectedPetId:n}:{enabled:!1,selectedPetId:n}),i?.availability===`downloadable`&&d(n)};return(0,_.jsx)(x,{error:o.error??s.error,isLoading:o.isPending,onEnabledChange:n=>{if(!n){e({enabled:!1,selectedPetId:t.selectedPetId});return}let r=y(t,c);r.enabled&&m(r.selectedPetId,!0)},onPetSelect:m,onRefresh:()=>{o.refetch()},pets:c,settings:t})}export{S as GlobalSettingsPets};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,t as n}from"./react-runtime-CMZHB3u8.js";import{i as r,s as i,u as a}from"./initial-deps-CW5Jl6i2.js";import{Tt as o}from"./initial-deps-C-3sxJvc.js";import{at as s,ct as c,g as l,q as u}from"./initial-deps-B8FrcWWN.js";import{t as d}from"./download-05FmZQzE.js";import"./index-DobF11m_.js";import{n as f,r as p,t as m}from"./workbench-pet-canvas-B5jypDil.js";import{_ as h}from"./global-settings-page-BEUBn7B5.js";var g=e(t(),1);c.addResourceBundle(`zh-CN`,`settings`,{petPage:{on:`已开启`,off:`已关闭`,onHint:`在桌面显示宠物与任务动态`,offHint:`宠物已隐藏,保留当前选择`,selectionHint:`选择后自动保存`,selected:`已选择`,empty:`暂无可用宠物,请刷新列表。`}},!0),c.addResourceBundle(`en`,`settings`,{petPage:{on:`On`,off:`Off`,onHint:`Show your pet and task activity on the desktop`,offHint:`Pet hidden. Your selection is kept.`,selectionHint:`Selection saves automatically`,selected:`Selected`,empty:`No pets available. Refresh the list to try again.`}},!0);var _=n(),v=[];function y(e,t){let n=t.find(t=>t.id===e.selectedPetId)?.id??t.find(e=>e.id===`codex`)?.id??t[0]?.id;return n===void 0?{enabled:!1,selectedPetId:e.selectedPetId}:{enabled:!0,selectedPetId:n}}function b({pet:e}){return e.availability===`ready`?(0,_.jsx)(`span`,{className:`pet-settings-preview`,"aria-hidden":`true`,children:(0,_.jsx)(m,{animationName:`idle`,pet:e})}):(0,_.jsx)(`span`,{className:`pet-settings-preview`,"aria-hidden":`true`,children:(0,_.jsx)(h,{"aria-hidden":`true`,className:`size-5`})})}function x({error:e,isLoading:t,onEnabledChange:n,onPetSelect:r,onRefresh:i,pets:a,settings:c}){let{t:f}=s(`settings`);return(0,_.jsxs)(`section`,{id:`settings-panel-pets`,children:[(0,_.jsxs)(`div`,{className:`mb-6 flex min-w-0 items-center justify-between gap-3`,children:[(0,_.jsx)(`h1`,{className:`text-xl font-semibold`,children:f(`sections.pets`)}),(0,_.jsxs)(o,{onClick:i,size:`sm`,type:`button`,variant:`ghost`,children:[(0,_.jsx)(l,{"aria-hidden":`true`,"data-icon":`inline-start`}),f(`pets.refresh`)]})]}),(0,_.jsxs)(`div`,{className:`pet-settings-power`,"data-enabled":c.enabled,children:[(0,_.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,_.jsx)(`h2`,{className:`text-body-small font-medium`,children:f(`pets.enabled`)}),(0,_.jsx)(`p`,{className:`mt-1 text-label text-muted-foreground`,id:`pet-power-description`,children:f(c.enabled?`petPage.onHint`:`petPage.offHint`)})]}),(0,_.jsxs)(`button`,{className:`pet-settings-toggle`,type:`button`,role:`switch`,"aria-label":f(`pets.enabled`),"aria-describedby":`pet-power-description`,"aria-checked":c.enabled,disabled:!c.enabled&&(t||a.length===0),onClick:()=>{n(!c.enabled)},children:[(0,_.jsx)(`span`,{children:f(c.enabled?`petPage.on`:`petPage.off`)}),(0,_.jsx)(`span`,{className:`pet-settings-track`,"aria-hidden":`true`,children:(0,_.jsx)(`span`,{})})]})]}),t?(0,_.jsx)(`p`,{className:`grid min-h-36 place-items-center text-body-small text-muted-foreground`,role:`status`,children:f(`pets.loading`)}):e!==null&&a.length===0?(0,_.jsxs)(`div`,{className:`grid min-h-36 place-items-center gap-3 py-5 text-center`,role:`alert`,children:[(0,_.jsx)(`p`,{className:`text-body-small text-danger`,children:f(`pets.errors.load`)}),(0,_.jsxs)(o,{onClick:i,size:`sm`,type:`button`,variant:`outline`,children:[(0,_.jsx)(l,{"aria-hidden":`true`,"data-icon":`inline-start`}),f(`common:actions.retry`)]})]}):(0,_.jsxs)(_.Fragment,{children:[e===null?null:(0,_.jsx)(`p`,{className:`mt-3 text-body-small text-danger`,role:`alert`,children:f(`pets.errors.load`)}),(0,_.jsxs)(`div`,{className:`pet-settings-collection-heading`,children:[(0,_.jsx)(`h2`,{children:f(`pets.selectionLabel`)}),(0,_.jsx)(`span`,{children:f(`petPage.selectionHint`)})]}),a.length===0?(0,_.jsx)(`p`,{className:`py-8 text-body-small text-muted-foreground`,children:f(`petPage.empty`)}):null,(0,_.jsx)(`div`,{"aria-label":f(`pets.selectionLabel`),className:`pet-settings-gallery`,role:`radiogroup`,children:a.map(e=>{let t=c.selectedPetId===e.id;return(0,_.jsxs)(o,{"aria-checked":t,className:`pet-settings-card`,contentAlign:`start`,onClick:()=>{r(e.id)},role:`radio`,type:`button`,variant:`ghost`,children:[(0,_.jsx)(b,{pet:e}),(0,_.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,_.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,_.jsx)(`span`,{className:`truncate font-medium`,children:e.displayName}),t?(0,_.jsxs)(`span`,{className:`pet-settings-selected`,children:[(0,_.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),f(`petPage.selected`)]}):null]}),(0,_.jsx)(`span`,{className:`mt-0.5 line-clamp-2 block text-label text-muted-foreground`,children:e.description}),(0,_.jsxs)(`span`,{className:`mt-1 inline-flex items-center gap-1 text-label text-muted-foreground`,children:[e.availability===`ready`?null:(0,_.jsx)(d,{"aria-hidden":`true`,className:`size-3`}),f(`pets.availability.${e.availability}`)]})]})]},e.id)})})]})]})}function S({onChange:e,settings:t}){let n=a(),o=i(p()),s=r(f(n)),c=o.data?.data??v,l=(0,g.useRef)(new Set),u=s.mutate,d=(0,g.useCallback)(e=>{l.current.has(e)||(l.current.add(e),u(e,{onError:()=>{l.current.delete(e)}}))},[u]);(0,g.useEffect)(()=>{for(let e of c)e.availability===`downloadable`&&d(e.id)},[d,c]);let m=(n,r=t.enabled)=>{let i=c.find(e=>e.id===n);e(r?{enabled:!0,selectedPetId:n}:{enabled:!1,selectedPetId:n}),i?.availability===`downloadable`&&d(n)};return(0,_.jsx)(x,{error:o.error??s.error,isLoading:o.isPending,onEnabledChange:n=>{if(!n){e({enabled:!1,selectedPetId:t.selectedPetId});return}let r=y(t,c);r.enabled&&m(r.selectedPetId,!0)},onPetSelect:m,onRefresh:()=>{o.refetch()},pets:c,settings:t})}export{S as GlobalSettingsPets};