@hienlh/ppm 0.23.0 → 0.23.2

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 (382) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/CLAUDE.md +1 -0
  3. package/assets/skills/ppm/SKILL.md +1 -1
  4. package/assets/skills/ppm/references/http-api.md +1 -1
  5. package/dist/web/assets/accounts-settings-section-Cs7BC5O1.js +1 -0
  6. package/dist/web/assets/accounts-settings-section-Cs7BC5O1.js.br +0 -0
  7. package/dist/web/assets/accounts-settings-section-Cs7BC5O1.js.gz +0 -0
  8. package/dist/web/assets/{ai-resource-editor-DoCiQDKY.js → ai-resource-editor-TCREp5Ml.js} +1 -1
  9. package/dist/web/assets/ai-resource-editor-TCREp5Ml.js.br +0 -0
  10. package/dist/web/assets/ai-resource-editor-TCREp5Ml.js.gz +0 -0
  11. package/dist/web/assets/{ai-settings-section-0x6GFJ56.js → ai-settings-section-B7Un4KiW.js} +1 -1
  12. package/dist/web/assets/ai-settings-section-B7Un4KiW.js.br +0 -0
  13. package/dist/web/assets/ai-settings-section-B7Un4KiW.js.gz +0 -0
  14. package/dist/web/assets/{ai-settings-section-Cp6jcnTn.js → ai-settings-section-BlKlcihJ.js} +1 -1
  15. package/dist/web/assets/{appearance-settings-section-mRiGj3_g.js → appearance-settings-section-DACtiDor.js} +1 -1
  16. package/dist/web/assets/appearance-settings-section-DACtiDor.js.br +0 -0
  17. package/dist/web/assets/appearance-settings-section-DACtiDor.js.gz +0 -0
  18. package/dist/web/assets/{audio-preview-CO7Ia2N5.js → audio-preview-DXtE1Lpz.js} +1 -1
  19. package/dist/web/assets/audio-preview-DXtE1Lpz.js.br +0 -0
  20. package/dist/web/assets/audio-preview-DXtE1Lpz.js.gz +0 -0
  21. package/dist/web/assets/{branch-review-tab-F3CALiEa.js → branch-review-tab-vHJuFXtB.js} +1 -1
  22. package/dist/web/assets/branch-review-tab-vHJuFXtB.js.br +0 -0
  23. package/dist/web/assets/branch-review-tab-vHJuFXtB.js.gz +0 -0
  24. package/dist/web/assets/chat-tab-Ba3NvUgt.js +1 -0
  25. package/dist/web/assets/chat-tab-Ba3NvUgt.js.br +0 -0
  26. package/dist/web/assets/chat-tab-Ba3NvUgt.js.gz +0 -0
  27. package/dist/web/assets/chat-tab-DeISufm0.js +15 -0
  28. package/dist/web/assets/chat-tab-DeISufm0.js.br +0 -0
  29. package/dist/web/assets/chat-tab-DeISufm0.js.gz +0 -0
  30. package/dist/web/assets/{code-editor-FsR6KpZa.js → code-editor-BCwiLVyc.js} +3 -3
  31. package/dist/web/assets/code-editor-BCwiLVyc.js.br +0 -0
  32. package/dist/web/assets/code-editor-BCwiLVyc.js.gz +0 -0
  33. package/dist/web/assets/codex-sign-in-again-dialog-DcIOYhAe.js +1 -0
  34. package/dist/web/assets/codex-sign-in-again-dialog-DcIOYhAe.js.br +0 -0
  35. package/dist/web/assets/codex-sign-in-again-dialog-DcIOYhAe.js.gz +0 -0
  36. package/dist/web/assets/{conflict-editor-GGqIz6tt.js → conflict-editor-0YEDQ--c.js} +1 -1
  37. package/dist/web/assets/conflict-editor-0YEDQ--c.js.br +0 -0
  38. package/dist/web/assets/conflict-editor-0YEDQ--c.js.gz +0 -0
  39. package/dist/web/assets/{context-menu-CVO3HtIt.js → context-menu-CjYTq8DI.js} +1 -1
  40. package/dist/web/assets/context-menu-CjYTq8DI.js.br +0 -0
  41. package/dist/web/assets/context-menu-CjYTq8DI.js.gz +0 -0
  42. package/dist/web/assets/{csv-preview-ycnxJ_6J.js → csv-preview-CYxznB1I.js} +1 -1
  43. package/dist/web/assets/csv-preview-CYxznB1I.js.br +0 -0
  44. package/dist/web/assets/csv-preview-CYxznB1I.js.gz +0 -0
  45. package/dist/web/assets/{database-viewer-y6URJv8N.js → database-viewer-eP3gCxGb.js} +1 -1
  46. package/dist/web/assets/database-viewer-eP3gCxGb.js.br +0 -0
  47. package/dist/web/assets/database-viewer-eP3gCxGb.js.gz +0 -0
  48. package/dist/web/assets/{design-responsive-dialog-D0QYfX7v.js → design-responsive-dialog-CcJETHO2.js} +1 -1
  49. package/dist/web/assets/design-responsive-dialog-CcJETHO2.js.br +0 -0
  50. package/dist/web/assets/design-responsive-dialog-CcJETHO2.js.gz +0 -0
  51. package/dist/web/assets/{design-tab-DgCTcwot.js → design-tab-B7aVMMfj.js} +1 -1
  52. package/dist/web/assets/design-tab-B7aVMMfj.js.br +0 -0
  53. package/dist/web/assets/design-tab-B7aVMMfj.js.gz +0 -0
  54. package/dist/web/assets/{designs-sidebar-panel-Dtuph5jh.js → designs-sidebar-panel-8KI79o1u.js} +1 -1
  55. package/dist/web/assets/designs-sidebar-panel-8KI79o1u.js.br +0 -0
  56. package/dist/web/assets/designs-sidebar-panel-8KI79o1u.js.gz +0 -0
  57. package/dist/web/assets/{dialog-CaShS4f5.js → dialog-tzBRkGeW.js} +1 -1
  58. package/dist/web/assets/dialog-tzBRkGeW.js.br +0 -0
  59. package/dist/web/assets/dialog-tzBRkGeW.js.gz +0 -0
  60. package/dist/web/assets/{diff-viewer-ciBkExM7.js → diff-viewer-B_K7VQup.js} +1 -1
  61. package/dist/web/assets/diff-viewer-B_K7VQup.js.br +0 -0
  62. package/dist/web/assets/diff-viewer-B_K7VQup.js.gz +0 -0
  63. package/dist/web/assets/{docx-preview-C8K6QzOW.js → docx-preview-C-UKGMXR.js} +1 -1
  64. package/dist/web/assets/docx-preview-C-UKGMXR.js.br +0 -0
  65. package/dist/web/assets/docx-preview-C-UKGMXR.js.gz +0 -0
  66. package/dist/web/assets/{editor-language-service-CkoaAHjF.js → editor-language-service-DYBxZX66.js} +1 -1
  67. package/dist/web/assets/editor-language-service-DYBxZX66.js.br +0 -0
  68. package/dist/web/assets/editor-language-service-DYBxZX66.js.gz +0 -0
  69. package/dist/web/assets/{explorer-body-C5gXPGOl.js → explorer-body-C0syNltJ.js} +1 -1
  70. package/dist/web/assets/explorer-body-C0syNltJ.js.br +0 -0
  71. package/dist/web/assets/explorer-body-C0syNltJ.js.gz +0 -0
  72. package/dist/web/assets/{explorer-window-content-8EBl9Vkx.js → explorer-window-content-CfIomwTq.js} +1 -1
  73. package/dist/web/assets/explorer-window-content-CfIomwTq.js.br +0 -0
  74. package/dist/web/assets/explorer-window-content-CfIomwTq.js.gz +0 -0
  75. package/dist/web/assets/{extension-manager-section-DOwZYx8O.js → extension-manager-section-CL7pl3re.js} +1 -1
  76. package/dist/web/assets/extension-manager-section-CL7pl3re.js.br +0 -0
  77. package/dist/web/assets/extension-manager-section-CL7pl3re.js.gz +0 -0
  78. package/dist/web/assets/{extension-webview-CdEva8pD.js → extension-webview-FHTB0jh1.js} +1 -1
  79. package/dist/web/assets/extension-webview-FHTB0jh1.js.br +0 -0
  80. package/dist/web/assets/extension-webview-FHTB0jh1.js.gz +0 -0
  81. package/dist/web/assets/{files-settings-section-DVemQIZ2.js → files-settings-section-C574RfCl.js} +1 -1
  82. package/dist/web/assets/files-settings-section-C574RfCl.js.br +0 -0
  83. package/dist/web/assets/files-settings-section-C574RfCl.js.gz +0 -0
  84. package/dist/web/assets/{general-settings-section-DiY_5C93.js → general-settings-section--DSUTrEP.js} +1 -1
  85. package/dist/web/assets/general-settings-section--DSUTrEP.js.br +0 -0
  86. package/dist/web/assets/general-settings-section--DSUTrEP.js.gz +0 -0
  87. package/dist/web/assets/{git-log-panel-Cq0WohOO.js → git-log-panel-BzwEbRwN.js} +1 -1
  88. package/dist/web/assets/git-log-panel-BzwEbRwN.js.br +0 -0
  89. package/dist/web/assets/git-log-panel-BzwEbRwN.js.gz +0 -0
  90. package/dist/web/assets/{glide-data-grid-DG9AnCmP.js → glide-data-grid-CUNWBFfN.js} +1 -1
  91. package/dist/web/assets/glide-data-grid-CUNWBFfN.js.br +0 -0
  92. package/dist/web/assets/glide-data-grid-CUNWBFfN.js.gz +0 -0
  93. package/dist/web/assets/{group-chat-tab-DxbDrFJl.js → group-chat-tab-Dp1p4Jdu.js} +1 -1
  94. package/dist/web/assets/group-chat-tab-Dp1p4Jdu.js.br +0 -0
  95. package/dist/web/assets/group-chat-tab-Dp1p4Jdu.js.gz +0 -0
  96. package/dist/web/assets/icons-CO_II6D-.js +1 -0
  97. package/dist/web/assets/icons-CO_II6D-.js.br +0 -0
  98. package/dist/web/assets/icons-CO_II6D-.js.gz +0 -0
  99. package/dist/web/assets/{image-preview-eAv91-an.js → image-preview-78Fguk1f.js} +1 -1
  100. package/dist/web/assets/{index-BVKT5UCu.js → index-CvUGUp7d.js} +6 -6
  101. package/dist/web/assets/index-CvUGUp7d.js.br +0 -0
  102. package/dist/web/assets/index-CvUGUp7d.js.gz +0 -0
  103. package/dist/web/assets/index-DMA-So69.css +1 -0
  104. package/dist/web/assets/index-DMA-So69.css.br +0 -0
  105. package/dist/web/assets/index-DMA-So69.css.gz +0 -0
  106. package/dist/web/assets/{jira-watcher-section-Cr8gSVGY.js → jira-watcher-section-DoXl0GAq.js} +1 -1
  107. package/dist/web/assets/jira-watcher-section-DoXl0GAq.js.br +0 -0
  108. package/dist/web/assets/jira-watcher-section-DoXl0GAq.js.gz +0 -0
  109. package/dist/web/assets/{keybindings-store-Ch1mWz0q.js → keybindings-store-BqGm9AgI.js} +1 -1
  110. package/dist/web/assets/{keyboard-shortcuts-section-BvC6m_C2.js → keyboard-shortcuts-section-BogwnAdr.js} +1 -1
  111. package/dist/web/assets/keyboard-shortcuts-section-BogwnAdr.js.br +0 -0
  112. package/dist/web/assets/keyboard-shortcuts-section-BogwnAdr.js.gz +0 -0
  113. package/dist/web/assets/{markdown-renderer-56wMzGkr.js → markdown-renderer-C33dsNJ_.js} +1 -1
  114. package/dist/web/assets/{markdown-renderer-8JlfrfnD.js → markdown-renderer-CZiECUJp.js} +1 -1
  115. package/dist/web/assets/markdown-renderer-CZiECUJp.js.br +0 -0
  116. package/dist/web/assets/markdown-renderer-CZiECUJp.js.gz +0 -0
  117. package/dist/web/assets/{mobile-explorer-sheet-cJfocgE7.js → mobile-explorer-sheet-BOgo9tbK.js} +1 -1
  118. package/dist/web/assets/mobile-explorer-sheet-BOgo9tbK.js.br +0 -0
  119. package/dist/web/assets/mobile-explorer-sheet-BOgo9tbK.js.gz +0 -0
  120. package/dist/web/assets/{new-design-dialog-BO_D3nex.js → new-design-dialog-DcoejI1s.js} +1 -1
  121. package/dist/web/assets/new-design-dialog-DcoejI1s.js.br +0 -0
  122. package/dist/web/assets/new-design-dialog-DcoejI1s.js.gz +0 -0
  123. package/dist/web/assets/{notification-store-DNWazI7j.js → notification-store-D88Y9kF_.js} +1 -1
  124. package/dist/web/assets/{notifications-settings-section-DaMh3khs.js → notifications-settings-section-Bfxqz65i.js} +1 -1
  125. package/dist/web/assets/notifications-settings-section-Bfxqz65i.js.br +0 -0
  126. package/dist/web/assets/notifications-settings-section-Bfxqz65i.js.gz +0 -0
  127. package/dist/web/assets/{onboarding-entry-CwkNJ69U.js → onboarding-entry-CcvySZ_l.js} +1 -1
  128. package/dist/web/assets/onboarding-entry-CcvySZ_l.js.br +0 -0
  129. package/dist/web/assets/onboarding-entry-CcvySZ_l.js.gz +0 -0
  130. package/dist/web/assets/{onboarding-quick-orientation-u7yM68d3.js → onboarding-quick-orientation-CT4PylG0.js} +1 -1
  131. package/dist/web/assets/onboarding-quick-orientation-CT4PylG0.js.br +0 -0
  132. package/dist/web/assets/onboarding-quick-orientation-CT4PylG0.js.gz +0 -0
  133. package/dist/web/assets/{pdf-preview-CaxTidh0.js → pdf-preview-BWim6mu1.js} +1 -1
  134. package/dist/web/assets/pdf-preview-BWim6mu1.js.br +0 -0
  135. package/dist/web/assets/pdf-preview-BWim6mu1.js.gz +0 -0
  136. package/dist/web/assets/{postgres-viewer-CJOOLdgO.js → postgres-viewer-HwlL1UTJ.js} +1 -1
  137. package/dist/web/assets/postgres-viewer-HwlL1UTJ.js.br +0 -0
  138. package/dist/web/assets/postgres-viewer-HwlL1UTJ.js.gz +0 -0
  139. package/dist/web/assets/{ppmbot-settings-section-rNBdWG7F.js → ppmbot-settings-section-DF0kqdyO.js} +1 -1
  140. package/dist/web/assets/ppmbot-settings-section-DF0kqdyO.js.br +0 -0
  141. package/dist/web/assets/ppmbot-settings-section-DF0kqdyO.js.gz +0 -0
  142. package/dist/web/assets/{problems-panel-BTmOGMcL.js → problems-panel-DRcq5ChN.js} +1 -1
  143. package/dist/web/assets/problems-panel-DRcq5ChN.js.br +0 -0
  144. package/dist/web/assets/problems-panel-DRcq5ChN.js.gz +0 -0
  145. package/dist/web/assets/{process-table-Bc9WEBsS.js → process-table-Ds0S_YK-.js} +1 -1
  146. package/dist/web/assets/process-table-Ds0S_YK-.js.br +0 -0
  147. package/dist/web/assets/process-table-Ds0S_YK-.js.gz +0 -0
  148. package/dist/web/assets/{proxy-settings-section-Bo-FPk6Y.js → proxy-settings-section-Q-ttqVOa.js} +1 -1
  149. package/dist/web/assets/proxy-settings-section-Q-ttqVOa.js.br +0 -0
  150. package/dist/web/assets/proxy-settings-section-Q-ttqVOa.js.gz +0 -0
  151. package/dist/web/assets/{query-audit-section-CQfzKAf9.js → query-audit-section-Cn11xqgz.js} +1 -1
  152. package/dist/web/assets/query-audit-section-Cn11xqgz.js.br +0 -0
  153. package/dist/web/assets/query-audit-section-Cn11xqgz.js.gz +0 -0
  154. package/dist/web/assets/{remote-desktop-clipboard-notice-DgeuoZ4n.js → remote-desktop-clipboard-notice-CvPPtrRq.js} +1 -1
  155. package/dist/web/assets/remote-desktop-clipboard-notice-CvPPtrRq.js.br +0 -0
  156. package/dist/web/assets/remote-desktop-clipboard-notice-CvPPtrRq.js.gz +0 -0
  157. package/dist/web/assets/{remote-desktop-mobile-sheet-BpP7jI0p.js → remote-desktop-mobile-sheet-B-TT9Fdt.js} +2 -2
  158. package/dist/web/assets/remote-desktop-mobile-sheet-B-TT9Fdt.js.br +0 -0
  159. package/dist/web/assets/remote-desktop-mobile-sheet-B-TT9Fdt.js.gz +0 -0
  160. package/dist/web/assets/{remote-desktop-mobile-view-Byn0lFCF.js → remote-desktop-mobile-view-hUnYxXDk.js} +1 -1
  161. package/dist/web/assets/remote-desktop-mobile-view-hUnYxXDk.js.br +0 -0
  162. package/dist/web/assets/remote-desktop-mobile-view-hUnYxXDk.js.gz +0 -0
  163. package/dist/web/assets/{remote-desktop-readiness-gate-B2mXZ9vo.js → remote-desktop-readiness-gate-CUmaeiX9.js} +1 -1
  164. package/dist/web/assets/remote-desktop-readiness-gate-CUmaeiX9.js.br +0 -0
  165. package/dist/web/assets/remote-desktop-readiness-gate-CUmaeiX9.js.gz +0 -0
  166. package/dist/web/assets/{remote-desktop-window-content-CWt3VVjm.js → remote-desktop-window-content-DEPUOOGw.js} +1 -1
  167. package/dist/web/assets/remote-desktop-window-content-DEPUOOGw.js.br +0 -0
  168. package/dist/web/assets/remote-desktop-window-content-DEPUOOGw.js.gz +0 -0
  169. package/dist/web/assets/{schedules-settings-section-Bx9Rm-NB.js → schedules-settings-section-Bv_wrzDp.js} +1 -1
  170. package/dist/web/assets/schedules-settings-section-Bv_wrzDp.js.br +0 -0
  171. package/dist/web/assets/schedules-settings-section-Bv_wrzDp.js.gz +0 -0
  172. package/dist/web/assets/{settings-body-DU3LZkOy.js → settings-body-C5_chEpq.js} +2 -2
  173. package/dist/web/assets/settings-body-C5_chEpq.js.br +0 -0
  174. package/dist/web/assets/settings-body-C5_chEpq.js.gz +0 -0
  175. package/dist/web/assets/{settings-tab-Q5Ai_XB7.js → settings-tab-CogpEbq5.js} +1 -1
  176. package/dist/web/assets/{settings-window-content-DNg-jjm4.js → settings-window-content-BNRirQDZ.js} +1 -1
  177. package/dist/web/assets/{sql-query-editor-BMNsmnfi.js → sql-query-editor-Bg3lOrmt.js} +1 -1
  178. package/dist/web/assets/sql-query-editor-Bg3lOrmt.js.br +0 -0
  179. package/dist/web/assets/sql-query-editor-Bg3lOrmt.js.gz +0 -0
  180. package/dist/web/assets/{sqlite-viewer-DBdxQgCD.js → sqlite-viewer-DMKtDkI6.js} +1 -1
  181. package/dist/web/assets/sqlite-viewer-DMKtDkI6.js.br +0 -0
  182. package/dist/web/assets/sqlite-viewer-DMKtDkI6.js.gz +0 -0
  183. package/dist/web/assets/{system-monitor-body-BEuqhoiF.js → system-monitor-body-Dst39LA7.js} +2 -2
  184. package/dist/web/assets/system-monitor-body-Dst39LA7.js.br +0 -0
  185. package/dist/web/assets/system-monitor-body-Dst39LA7.js.gz +0 -0
  186. package/dist/web/assets/system-monitor-tab-CEwME1_C.js +1 -0
  187. package/dist/web/assets/{system-monitor-window-content-Dr6EgqpJ.js → system-monitor-window-content-DQRBjn9z.js} +1 -1
  188. package/dist/web/assets/{tab-host-window-content-BhS39QWy.js → tab-host-window-content-Dlunzrfh.js} +1 -1
  189. package/dist/web/assets/tab-host-window-content-Dlunzrfh.js.br +0 -0
  190. package/dist/web/assets/tab-host-window-content-Dlunzrfh.js.gz +0 -0
  191. package/dist/web/assets/{team-member-sheet-C5-PeHDb.js → team-member-sheet-CPZGU9j5.js} +2 -2
  192. package/dist/web/assets/team-member-sheet-CPZGU9j5.js.br +0 -0
  193. package/dist/web/assets/team-member-sheet-CPZGU9j5.js.gz +0 -0
  194. package/dist/web/assets/{team-member-window-content-CZjHuvdw.js → team-member-window-content-CwI9JD_H.js} +1 -1
  195. package/dist/web/assets/{team-member-window-content-CZjHuvdw.js.br → team-member-window-content-CwI9JD_H.js.br} +0 -0
  196. package/dist/web/assets/team-member-window-content-CwI9JD_H.js.gz +0 -0
  197. package/dist/web/assets/{terminal-tab-B0w7Jsbs.js → terminal-tab-BcQXleSa.js} +1 -1
  198. package/dist/web/assets/terminal-tab-BcQXleSa.js.br +0 -0
  199. package/dist/web/assets/terminal-tab-BcQXleSa.js.gz +0 -0
  200. package/dist/web/assets/{tool-cards-CmdjXi2c.js → tool-cards-DsQdMorI.js} +2 -2
  201. package/dist/web/assets/tool-cards-DsQdMorI.js.br +0 -0
  202. package/dist/web/assets/tool-cards-DsQdMorI.js.gz +0 -0
  203. package/dist/web/assets/{use-inline-blame-BSb807l9.js → use-inline-blame--fS-pzzX.js} +1 -1
  204. package/dist/web/assets/use-inline-blame--fS-pzzX.js.br +0 -0
  205. package/dist/web/assets/use-inline-blame--fS-pzzX.js.gz +0 -0
  206. package/dist/web/assets/{use-lsp-DhBjkGWr.js → use-lsp-DK26Eter.js} +1 -1
  207. package/dist/web/assets/use-lsp-DK26Eter.js.br +0 -0
  208. package/dist/web/assets/use-lsp-DK26Eter.js.gz +0 -0
  209. package/dist/web/assets/{use-monaco-theme-CNEk66US.js → use-monaco-theme-BVatH9yZ.js} +1 -1
  210. package/dist/web/assets/{use-websocket-Bki-B4fj.js → use-websocket-C1mloX0R.js} +1 -1
  211. package/dist/web/assets/{video-preview-T1SMFp03.js → video-preview-C48Go7JZ.js} +1 -1
  212. package/dist/web/assets/video-preview-C48Go7JZ.js.br +0 -0
  213. package/dist/web/assets/video-preview-C48Go7JZ.js.gz +0 -0
  214. package/dist/web/index.html +6 -6
  215. package/dist/web/index.html.br +0 -0
  216. package/dist/web/index.html.gz +0 -0
  217. package/dist/web/sw.js +1 -1
  218. package/dist/web/sw.js.br +0 -0
  219. package/dist/web/sw.js.gz +0 -0
  220. package/package.json +1 -1
  221. package/src/providers/codex-app-server/codex-auth-failure.ts +51 -0
  222. package/src/providers/codex-app-server/codex-event-mapper.ts +8 -0
  223. package/src/providers/codex-app-server/codex-provider.ts +97 -19
  224. package/src/providers/codex-app-server/codex-usage-source.ts +14 -1
  225. package/src/server/routes/codex-accounts.ts +18 -6
  226. package/src/services/codex-account-auth-state.ts +58 -0
  227. package/src/services/codex-account-login.ts +42 -9
  228. package/src/services/codex-account.service.ts +42 -7
  229. package/src/services/proxy-agent-anthropic-bridge.ts +2 -2
  230. package/src/services/proxy-agent-bridge.ts +2 -2
  231. package/src/services/proxy-agent-turn.ts +80 -20
  232. package/src/services/proxy-image-bridge.ts +3 -3
  233. package/src/services/proxy.service.ts +1 -1
  234. package/src/web/components/chat/codex-usage-panel.tsx +13 -1
  235. package/src/web/components/chat/usage-badge.tsx +14 -0
  236. package/src/web/components/settings/accounts/account-add-dialog.tsx +10 -3
  237. package/src/web/components/settings/accounts/account-card.tsx +15 -4
  238. package/src/web/components/settings/accounts/account-hint.tsx +19 -2
  239. package/src/web/components/settings/accounts/claude-accounts-section.tsx +10 -2
  240. package/src/web/components/settings/accounts/codex-accounts-section.tsx +18 -2
  241. package/src/web/components/settings/accounts/codex-add-account-dialog.tsx +50 -33
  242. package/src/web/components/settings/accounts/codex-sign-in-again-dialog.tsx +47 -0
  243. package/src/web/components/settings/accounts/use-codex-accounts.ts +18 -4
  244. package/src/web/lib/fluent-icon.tsx +38 -2
  245. package/dist/web/assets/accounts-settings-section-CVJ7hQom.js +0 -1
  246. package/dist/web/assets/accounts-settings-section-CVJ7hQom.js.br +0 -0
  247. package/dist/web/assets/accounts-settings-section-CVJ7hQom.js.gz +0 -0
  248. package/dist/web/assets/ai-resource-editor-DoCiQDKY.js.br +0 -0
  249. package/dist/web/assets/ai-resource-editor-DoCiQDKY.js.gz +0 -0
  250. package/dist/web/assets/ai-settings-section-0x6GFJ56.js.br +0 -0
  251. package/dist/web/assets/ai-settings-section-0x6GFJ56.js.gz +0 -0
  252. package/dist/web/assets/appearance-settings-section-mRiGj3_g.js.br +0 -0
  253. package/dist/web/assets/appearance-settings-section-mRiGj3_g.js.gz +0 -0
  254. package/dist/web/assets/audio-preview-CO7Ia2N5.js.br +0 -0
  255. package/dist/web/assets/audio-preview-CO7Ia2N5.js.gz +0 -0
  256. package/dist/web/assets/branch-review-tab-F3CALiEa.js.br +0 -0
  257. package/dist/web/assets/branch-review-tab-F3CALiEa.js.gz +0 -0
  258. package/dist/web/assets/chat-tab-D6BFnkCj.js +0 -1
  259. package/dist/web/assets/chat-tab-D6BFnkCj.js.br +0 -0
  260. package/dist/web/assets/chat-tab-D6BFnkCj.js.gz +0 -0
  261. package/dist/web/assets/chat-tab-IXHMUKMW.js +0 -15
  262. package/dist/web/assets/chat-tab-IXHMUKMW.js.br +0 -0
  263. package/dist/web/assets/chat-tab-IXHMUKMW.js.gz +0 -0
  264. package/dist/web/assets/code-editor-FsR6KpZa.js.br +0 -0
  265. package/dist/web/assets/code-editor-FsR6KpZa.js.gz +0 -0
  266. package/dist/web/assets/codex-daily-guard-Bn8jfcei.js +0 -1
  267. package/dist/web/assets/codex-daily-guard-Bn8jfcei.js.br +0 -0
  268. package/dist/web/assets/codex-daily-guard-Bn8jfcei.js.gz +0 -0
  269. package/dist/web/assets/conflict-editor-GGqIz6tt.js.br +0 -0
  270. package/dist/web/assets/conflict-editor-GGqIz6tt.js.gz +0 -0
  271. package/dist/web/assets/context-menu-CVO3HtIt.js.br +0 -0
  272. package/dist/web/assets/context-menu-CVO3HtIt.js.gz +0 -0
  273. package/dist/web/assets/csv-preview-ycnxJ_6J.js.br +0 -0
  274. package/dist/web/assets/csv-preview-ycnxJ_6J.js.gz +0 -0
  275. package/dist/web/assets/database-viewer-y6URJv8N.js.br +0 -0
  276. package/dist/web/assets/database-viewer-y6URJv8N.js.gz +0 -0
  277. package/dist/web/assets/design-responsive-dialog-D0QYfX7v.js.br +0 -0
  278. package/dist/web/assets/design-responsive-dialog-D0QYfX7v.js.gz +0 -0
  279. package/dist/web/assets/design-tab-DgCTcwot.js.br +0 -0
  280. package/dist/web/assets/design-tab-DgCTcwot.js.gz +0 -0
  281. package/dist/web/assets/designs-sidebar-panel-Dtuph5jh.js.br +0 -0
  282. package/dist/web/assets/designs-sidebar-panel-Dtuph5jh.js.gz +0 -0
  283. package/dist/web/assets/dialog-CaShS4f5.js.br +0 -0
  284. package/dist/web/assets/dialog-CaShS4f5.js.gz +0 -0
  285. package/dist/web/assets/diff-viewer-ciBkExM7.js.br +0 -0
  286. package/dist/web/assets/diff-viewer-ciBkExM7.js.gz +0 -0
  287. package/dist/web/assets/docx-preview-C8K6QzOW.js.br +0 -0
  288. package/dist/web/assets/docx-preview-C8K6QzOW.js.gz +0 -0
  289. package/dist/web/assets/editor-language-service-CkoaAHjF.js.br +0 -0
  290. package/dist/web/assets/editor-language-service-CkoaAHjF.js.gz +0 -0
  291. package/dist/web/assets/explorer-body-C5gXPGOl.js.br +0 -0
  292. package/dist/web/assets/explorer-body-C5gXPGOl.js.gz +0 -0
  293. package/dist/web/assets/explorer-window-content-8EBl9Vkx.js.br +0 -0
  294. package/dist/web/assets/explorer-window-content-8EBl9Vkx.js.gz +0 -0
  295. package/dist/web/assets/extension-manager-section-DOwZYx8O.js.br +0 -0
  296. package/dist/web/assets/extension-manager-section-DOwZYx8O.js.gz +0 -0
  297. package/dist/web/assets/extension-webview-CdEva8pD.js.br +0 -0
  298. package/dist/web/assets/extension-webview-CdEva8pD.js.gz +0 -0
  299. package/dist/web/assets/files-settings-section-DVemQIZ2.js.br +0 -0
  300. package/dist/web/assets/files-settings-section-DVemQIZ2.js.gz +0 -0
  301. package/dist/web/assets/general-settings-section-DiY_5C93.js.br +0 -0
  302. package/dist/web/assets/general-settings-section-DiY_5C93.js.gz +0 -0
  303. package/dist/web/assets/git-log-panel-Cq0WohOO.js.br +0 -0
  304. package/dist/web/assets/git-log-panel-Cq0WohOO.js.gz +0 -0
  305. package/dist/web/assets/glide-data-grid-DG9AnCmP.js.br +0 -0
  306. package/dist/web/assets/glide-data-grid-DG9AnCmP.js.gz +0 -0
  307. package/dist/web/assets/group-chat-tab-DxbDrFJl.js.br +0 -0
  308. package/dist/web/assets/group-chat-tab-DxbDrFJl.js.gz +0 -0
  309. package/dist/web/assets/icons-C9ZwXgel.js +0 -1
  310. package/dist/web/assets/icons-C9ZwXgel.js.br +0 -0
  311. package/dist/web/assets/icons-C9ZwXgel.js.gz +0 -0
  312. package/dist/web/assets/index-BVKT5UCu.js.br +0 -0
  313. package/dist/web/assets/index-BVKT5UCu.js.gz +0 -0
  314. package/dist/web/assets/index-CzYrKDUF.css +0 -1
  315. package/dist/web/assets/index-CzYrKDUF.css.br +0 -0
  316. package/dist/web/assets/index-CzYrKDUF.css.gz +0 -0
  317. package/dist/web/assets/jira-watcher-section-Cr8gSVGY.js.br +0 -0
  318. package/dist/web/assets/jira-watcher-section-Cr8gSVGY.js.gz +0 -0
  319. package/dist/web/assets/keyboard-shortcuts-section-BvC6m_C2.js.br +0 -0
  320. package/dist/web/assets/keyboard-shortcuts-section-BvC6m_C2.js.gz +0 -0
  321. package/dist/web/assets/markdown-renderer-8JlfrfnD.js.br +0 -0
  322. package/dist/web/assets/markdown-renderer-8JlfrfnD.js.gz +0 -0
  323. package/dist/web/assets/mobile-explorer-sheet-cJfocgE7.js.br +0 -0
  324. package/dist/web/assets/mobile-explorer-sheet-cJfocgE7.js.gz +0 -0
  325. package/dist/web/assets/new-design-dialog-BO_D3nex.js.br +0 -0
  326. package/dist/web/assets/new-design-dialog-BO_D3nex.js.gz +0 -0
  327. package/dist/web/assets/notifications-settings-section-DaMh3khs.js.br +0 -0
  328. package/dist/web/assets/notifications-settings-section-DaMh3khs.js.gz +0 -0
  329. package/dist/web/assets/onboarding-entry-CwkNJ69U.js.br +0 -0
  330. package/dist/web/assets/onboarding-entry-CwkNJ69U.js.gz +0 -0
  331. package/dist/web/assets/onboarding-quick-orientation-u7yM68d3.js.br +0 -0
  332. package/dist/web/assets/onboarding-quick-orientation-u7yM68d3.js.gz +0 -0
  333. package/dist/web/assets/pdf-preview-CaxTidh0.js.br +0 -0
  334. package/dist/web/assets/pdf-preview-CaxTidh0.js.gz +0 -0
  335. package/dist/web/assets/postgres-viewer-CJOOLdgO.js.br +0 -0
  336. package/dist/web/assets/postgres-viewer-CJOOLdgO.js.gz +0 -0
  337. package/dist/web/assets/ppmbot-settings-section-rNBdWG7F.js.br +0 -0
  338. package/dist/web/assets/ppmbot-settings-section-rNBdWG7F.js.gz +0 -0
  339. package/dist/web/assets/problems-panel-BTmOGMcL.js.br +0 -0
  340. package/dist/web/assets/problems-panel-BTmOGMcL.js.gz +0 -0
  341. package/dist/web/assets/process-table-Bc9WEBsS.js.br +0 -0
  342. package/dist/web/assets/process-table-Bc9WEBsS.js.gz +0 -0
  343. package/dist/web/assets/proxy-settings-section-Bo-FPk6Y.js.br +0 -0
  344. package/dist/web/assets/proxy-settings-section-Bo-FPk6Y.js.gz +0 -0
  345. package/dist/web/assets/query-audit-section-CQfzKAf9.js.br +0 -0
  346. package/dist/web/assets/query-audit-section-CQfzKAf9.js.gz +0 -0
  347. package/dist/web/assets/remote-desktop-clipboard-notice-DgeuoZ4n.js.br +0 -0
  348. package/dist/web/assets/remote-desktop-clipboard-notice-DgeuoZ4n.js.gz +0 -0
  349. package/dist/web/assets/remote-desktop-mobile-sheet-BpP7jI0p.js.br +0 -0
  350. package/dist/web/assets/remote-desktop-mobile-sheet-BpP7jI0p.js.gz +0 -0
  351. package/dist/web/assets/remote-desktop-mobile-view-Byn0lFCF.js.br +0 -0
  352. package/dist/web/assets/remote-desktop-mobile-view-Byn0lFCF.js.gz +0 -0
  353. package/dist/web/assets/remote-desktop-readiness-gate-B2mXZ9vo.js.br +0 -0
  354. package/dist/web/assets/remote-desktop-readiness-gate-B2mXZ9vo.js.gz +0 -0
  355. package/dist/web/assets/remote-desktop-window-content-CWt3VVjm.js.br +0 -0
  356. package/dist/web/assets/remote-desktop-window-content-CWt3VVjm.js.gz +0 -0
  357. package/dist/web/assets/schedules-settings-section-Bx9Rm-NB.js.br +0 -0
  358. package/dist/web/assets/schedules-settings-section-Bx9Rm-NB.js.gz +0 -0
  359. package/dist/web/assets/settings-body-DU3LZkOy.js.br +0 -0
  360. package/dist/web/assets/settings-body-DU3LZkOy.js.gz +0 -0
  361. package/dist/web/assets/sql-query-editor-BMNsmnfi.js.br +0 -0
  362. package/dist/web/assets/sql-query-editor-BMNsmnfi.js.gz +0 -0
  363. package/dist/web/assets/sqlite-viewer-DBdxQgCD.js.br +0 -0
  364. package/dist/web/assets/sqlite-viewer-DBdxQgCD.js.gz +0 -0
  365. package/dist/web/assets/system-monitor-body-BEuqhoiF.js.br +0 -0
  366. package/dist/web/assets/system-monitor-body-BEuqhoiF.js.gz +0 -0
  367. package/dist/web/assets/system-monitor-tab-BAU1kzbY.js +0 -1
  368. package/dist/web/assets/tab-host-window-content-BhS39QWy.js.br +0 -0
  369. package/dist/web/assets/tab-host-window-content-BhS39QWy.js.gz +0 -0
  370. package/dist/web/assets/team-member-sheet-C5-PeHDb.js.br +0 -0
  371. package/dist/web/assets/team-member-sheet-C5-PeHDb.js.gz +0 -0
  372. package/dist/web/assets/team-member-window-content-CZjHuvdw.js.gz +0 -0
  373. package/dist/web/assets/terminal-tab-B0w7Jsbs.js.br +0 -0
  374. package/dist/web/assets/terminal-tab-B0w7Jsbs.js.gz +0 -0
  375. package/dist/web/assets/tool-cards-CmdjXi2c.js.br +0 -0
  376. package/dist/web/assets/tool-cards-CmdjXi2c.js.gz +0 -0
  377. package/dist/web/assets/use-inline-blame-BSb807l9.js.br +0 -0
  378. package/dist/web/assets/use-inline-blame-BSb807l9.js.gz +0 -0
  379. package/dist/web/assets/use-lsp-DhBjkGWr.js.br +0 -0
  380. package/dist/web/assets/use-lsp-DhBjkGWr.js.gz +0 -0
  381. package/dist/web/assets/video-preview-T1SMFp03.js.br +0 -0
  382. package/dist/web/assets/video-preview-T1SMFp03.js.gz +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.23.2] - 2026-09-26
4
+
5
+ ### Added
6
+ - "Sign in again" and "Expired" on an account card are now buttons (Claude and Codex, in Settings and the chat usage panels); a Codex account signs in again in place and keeps its settings and chats.
7
+
8
+ ### Fixed
9
+ - A Codex account whose login was revoked no longer takes PPM down: it is marked signed out and skipped, turns move to another account, and requests fail within milliseconds instead of hanging.
10
+ - Codex's own "Reconnecting..." retries are no longer reported as errors, so a turn that recovers is not cut short.
11
+ - The `/proxy/<provider>` endpoints run at most 4 requests at once and answer the rest with 429 + Retry-After instead of stalling the server.
12
+
13
+ ## [0.23.1] - 2026-09-25
14
+
15
+ ### Fixed
16
+ - Spinning icons no longer keep a browser core busy: a tool card's spinner cost about a fifth of a CPU core for as long as the tool ran, because the browser redraws an animated SVG on the main thread. The spin now runs on a wrapper the browser can animate on its own.
17
+
3
18
  ## [0.23.0] - 2026-09-25
4
19
 
5
20
  ### Added
package/CLAUDE.md CHANGED
@@ -86,6 +86,7 @@ Related: `configService.save()`/`set()` throw when `load()` has not run, because
86
86
  - **Transcript images live in two places**: the base64 payload sits at `message.content[].content[]` inside a tool result, but Claude Code also writes an image-shaped record at the top-level `toolUseResult` field carrying no payload. An assertion like "no `"type":"image"` remains" must be scoped to the former, or it fails against correct code.
87
87
  - **Plugin items are named by location, not frontmatter**: Claude Code registers a plugin's skills and commands as `<plugin>:<path>` (`ak-engineer:ak-debug`) and only honours the frontmatter `name` for agents. Kits that self-namespace instead — AgentKit ships `name: ak:debug` — publish a name nothing can resolve. `slash-discovery` mirrors that rule and keeps the declared name as an alias; `src/server/ws/chat.ts` rewrites the alias to the canonical name before the message reaches the SDK.
88
88
  - **Codex runs one turn per thread and swallows the second**: a `turn/start` issued while a turn is running does not error — it resolves with the **already-running** turn (same id, `status: "inProgress"`) and discards the new input, so a mid-turn follow-up vanished with nothing to log. `turn/interrupt` is the only way to cut a turn short, and it needs `{threadId, turnId}` (`threadId` alone is rejected); the turn id comes from the `turn/started` notification. `codex-provider.ts` queues follow-ups in `pendingTurns` and sends the next one on `turn/completed`, which is also what an interrupted turn reports.
89
+ - **A signed-out Codex account fails slowly, and its retry notices are not errors**: a revoked or expired ChatGPT login does not fail `initialize` or `thread/start` — codex opens the turn, then sends `error` notifications with **`willRetry: true`** ("Reconnecting... N/5", ten of them over ~24s) before a final `willRetry: false`. The cause is only in `error.additionalDetails` (`workspace routing discovery unauthorized (401)`), never the headline. Mapping every `error` to a fatal event made the proxy give up at the first reconnect, and a retrying client then kept a dozen app-servers starting at once until the server stopped answering its health check. `codex-event-mapper.ts` turns retry notices into `status_update`; `codex-auth-failure.ts` recognises the 401 on the first one; `codex-account-auth-state.ts` benches the account (hard exclusion, unlike a quota park) so the turn rotates or fails in milliseconds; and `proxy-agent-turn.ts` caps concurrent proxy turns with a 429. Selection also has to ignore the usage figure for such an account: the usage endpoint keeps serving its last good reading, which made a dead account look emptier than a working one.
89
90
  - **Nested subagents are never streamed**: the SDK stamps `parent_tool_use_id` only on agents the session itself spawned. An agent that spawns another agent (a reviewer running `Skill code-review`, a planner calling researchers) produces **zero** stream events for that grandchild, so the Agent card would freeze on the forking step for minutes. Its transcript still lands in `<session>/subagents/agent-<id>.jsonl`, with a meta carrying only `parentAgentId` (raw id, no `agent-` prefix) and no `toolUseId`. `src/services/nested-subagent-spy.ts` tails those during the turn and `subagent-transcript-merger.ts` folds them in flat, time-ordered, on reload — both via `groupSubagentsByCard`, which walks the `parentAgentId` chain to the root card.
90
91
  - **A codex subagent is a session file of its own**: codex writes every spawned agent as a full rollout in the same `$CODEX_HOME/sessions` tree, with the same `cwd` as the conversation that spawned it — so a cwd filter alone lists each spawn as a top-level session that opens mid-stream, because a subagent's task is handed over as encrypted scaffolding and never appears as a `UserMessage` in its own transcript. `session_meta.parent_thread_id` is what tells the two apart. The parent names each spawn twice (`SubAgentActivity` `started`/`completed`) under **different item ids** but one `agent_thread_id`, which is why `codex-subagent-thread.ts` keys the card on the thread; `codex-history.ts` then reads the child rollout and hangs it under that Agent card.
91
92
  - **Agent teams are implicit and mostly not in `~/.claude/teams/`**: there is no `TeamCreate` tool any more. A team appears as `~/.claude/teams/<sessionId>/inboxes/*.json` with **no `config.json`**, so anything that requires a config sees no team at all. The inboxes only hold what was sent *to* each handle — in practice just the lead's task assignments — so they can neither say who is working nor show a teammate's replies. Both live in the agent transcripts under `~/.claude/projects/<slug>/<sessionId>/subagents/`: `agent-<id>.meta.json` maps the teammate `name` to its transcript, a transcript being appended to means that teammate is running, and its replies are `SendMessage` tool calls inside it. See `src/services/team-member-activity/`. A single teammate transcript reaches several MB, so the member window follows one by byte offset (`?sinceBytes=` on the transcript route, `member-transcript-tail.ts`) instead of re-reading it — an idle poll then costs nothing.
@@ -71,4 +71,4 @@ This skill covers the `ppm` CLI, its HTTP API, and its config DB. It does **not*
71
71
  - Third-party extensions (inspect via `ppm ext list`).
72
72
  - The Claude Agent SDK internals (separate skill).
73
73
 
74
- <!-- Generated for PPM v0.23.0 at build time. Re-run `ppm export skill --install` to refresh. -->
74
+ <!-- Generated for PPM v0.23.2 at build time. Re-run `ppm export skill --install` to refresh. -->
@@ -359,4 +359,4 @@ _Base URL: `http://localhost:8080` (default; override via `ppm config set port <
359
359
  - `ws://<host>/ws/terminal` — PTY terminal multiplexer
360
360
  - `ws://<host>/ws/extensions` — extension host channel
361
361
 
362
- <!-- Generated from src/server/routes/ for PPM v0.23.0 -->
362
+ <!-- Generated from src/server/routes/ for PPM v0.23.2 -->
@@ -0,0 +1 @@
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t,S as n}from"./vendor-markdown-QKPNiWEd.js";import"./vendor-ui-BHh12_0v.js";import{Jr as r,Lr as i,Mr as a,St as o,V as s,Zn as c,Zt as l,fn as u,fr as d,nt as f,st as p,un as m}from"./icons-CO_II6D-.js";import{r as h}from"./api-client-c8YOpTlT.js";import{n as g}from"./utils-btZ8C8-R.js";import"./portal-container-context-NFSuymMu.js";import{n as _}from"./use-is-mobile-CkO33jqU.js";import{n as v,t as y}from"./button-CBehaXpV.js";import{a as b,i as x,n as S,o as C,r as w,t as T}from"./dialog-tzBRkGeW.js";import{t as E}from"./mobile-bottom-sheet-Cf4kV1hS.js";import"./use-visual-viewport-C307OVeV.js";import{t as D}from"./input-CP31LZnN.js";import{Ln as O,Qn as k,Xn as A,Zn as j,ct as M,dt as N,lt as P,ot as ee,st as te,ut as ne,xn as re,yt as F}from"./index-CvUGUp7d.js";import{_ as ie,a as ae,h as oe,m as I,o as se,p as ce,r as le,v as ue,x as L,y as de}from"./api-settings-0s1Rfgcu.js";import{_ as fe,a as pe,c as me,d as R,f as z,g as B,i as he,l as ge,m as _e,n as ve,o as V,p as H,s as ye,t as be,u as U,v as W}from"./codex-sign-in-again-dialog-DcIOYhAe.js";var G=e(t(),1),K=n(),q=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],J=Array.from({length:24},(e,t)=>t);function xe(e,t){let n=Array.from({length:7},()=>Array.from({length:24},()=>({sum:0,count:0,avg:0})));for(let r of e){let e=t===`5h`?r.five_hour_util:r.weekly_util;if(e==null)continue;let i=new Date(r.recorded_at+(r.recorded_at.endsWith(`Z`)?``:`Z`)),a=(i.getDay()+6)%7,o=i.getHours();n[a][o].sum+=e,n[a][o].count+=1}for(let e of n)for(let t of e)t.avg=t.count>0?t.sum/t.count:0;return n}function Se(e){return e.map(e=>{let t=e.reduce((e,t)=>e+t.sum,0),n=e.reduce((e,t)=>e+t.count,0);return n>0?t/n:0})}function Ce(e){return J.map(t=>{let n=0,r=0;for(let i of e)n+=i[t].sum,r+=i[t].count;return r>0?n/r:0})}function Y(e){return e===0?`bg-surface-elevated`:e<.3?`bg-success/30`:e<.5?`bg-success/60`:e<.7?`bg-warning/50`:e<.9?`bg-warning/80`:`bg-error/80`}function we(e){return e<.3?`bg-success`:e<.7?`bg-warning`:`bg-error`}function Te({accountId:e}){let[t,n]=(0,G.useState)(null),[r,i]=(0,G.useState)(!0),[a,o]=(0,G.useState)(`5h`);(0,G.useEffect)(()=>{i(!0),ce(e).then(n).catch(()=>n([])).finally(()=>i(!1))},[e]);let s=(0,G.useMemo)(()=>t?xe(t,a):null,[t,a]),c=(0,G.useMemo)(()=>s?Se(s):[],[s]),l=(0,G.useMemo)(()=>s?Ce(s):[],[s]),u=Math.max(...c,.01);if(Math.max(...l,.01),r)return(0,K.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,K.jsx)(m,{className:`size-3 animate-spin text-text-subtle`})});if(!t||t.length===0)return(0,K.jsx)(`div`,{className:`text-[10px] text-text-subtle py-2 text-center`,children:`No usage history yet`});let d=t.length,f=new Set(t.map(e=>new Date(e.recorded_at+(e.recorded_at.endsWith(`Z`)?``:`Z`)).toDateString())).size;return(0,K.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`span`,{className:`text-[10px] font-medium text-text-subtle`,children:`Usage Pattern (7d)`}),(0,K.jsxs)(`div`,{className:`flex gap-0.5 text-[9px]`,children:[(0,K.jsx)(`button`,{onClick:()=>o(`5h`),className:`px-1.5 py-0.5 rounded cursor-pointer transition-colors ${a===`5h`?`bg-primary/15 text-primary`:`text-text-subtle hover:text-text-secondary`}`,title:`5-hour rolling window limit — resets every 5 hours`,children:`5h`}),(0,K.jsx)(`button`,{onClick:()=>o(`weekly`),className:`px-1.5 py-0.5 rounded cursor-pointer transition-colors ${a===`weekly`?`bg-primary/15 text-primary`:`text-text-subtle hover:text-text-secondary`}`,title:`Weekly limit — resets every 7 days`,children:`Wk`})]})]}),(0,K.jsxs)(`p`,{className:`text-[9px] text-text-subtle leading-tight`,children:[`Avg `,a===`5h`?`5-hour`:`weekly`,` limit usage over `,f,`d (`,d,` samples). Higher % = closer to rate limit. Hover cells for details.`]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-[9px] text-text-subtle`,children:`Avg usage by day of week`}),(0,K.jsx)(`div`,{className:`flex flex-col gap-[2px] mt-0.5`,children:q.map((e,t)=>{let n=c[t]??0;return(0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(`span`,{className:`text-[8px] text-text-subtle w-5 shrink-0 text-right tabular-nums`,children:e}),(0,K.jsx)(`div`,{className:`flex-1 h-2.5 bg-surface-elevated rounded-sm overflow-hidden`,children:(0,K.jsx)(`div`,{className:`h-full rounded-sm transition-all ${we(n)}`,style:{width:`${Math.round(n/u*100)}%`}})}),(0,K.jsxs)(`span`,{className:`text-[8px] text-text-subtle w-6 shrink-0 text-right tabular-nums`,children:[Math.round(n*100),`%`]})]},e)})})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-[9px] text-text-subtle`,children:`Avg usage by hour (0h-23h)`}),(0,K.jsx)(`div`,{className:`flex gap-[1px] mt-0.5`,children:J.map(e=>{let t=l[e]??0;return(0,K.jsxs)(`div`,{className:`flex-1 flex flex-col items-center gap-[1px]`,children:[(0,K.jsx)(`div`,{className:`w-full aspect-square rounded-[2px] ${Y(t)}`,title:`${e}:00 — avg ${Math.round(t*100)}% usage`}),e%6==0&&(0,K.jsx)(`span`,{className:`text-[7px] text-text-subtle tabular-nums`,children:e})]},e)})})]}),s&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-[9px] text-text-subtle`,children:`Day x Hour heatmap`}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-[1px] mt-0.5`,children:[q.map((e,t)=>(0,K.jsxs)(`div`,{className:`flex items-center gap-[1px]`,children:[(0,K.jsx)(`span`,{className:`text-[7px] text-text-subtle w-4 shrink-0 text-right`,children:e.charAt(0)}),J.map(n=>{let r=s[t][n];return(0,K.jsx)(`div`,{className:`flex-1 aspect-square rounded-[1px] ${Y(r.avg)}`,title:`${e} ${n}:00 — ${r.count>0?`avg ${Math.round(r.avg*100)}% (${r.count} samples)`:`no data`}`},n)})]},e)),(0,K.jsxs)(`div`,{className:`flex items-center gap-[1px]`,children:[(0,K.jsx)(`span`,{className:`w-4 shrink-0`}),J.map(e=>(0,K.jsx)(`div`,{className:`flex-1 text-center`,children:e%6==0&&(0,K.jsx)(`span`,{className:`text-[7px] text-text-subtle tabular-nums`,children:e})},e))]})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[8px] text-text-subtle`,children:[(0,K.jsx)(`span`,{children:`Low`}),(0,K.jsxs)(`div`,{className:`flex gap-[2px]`,children:[(0,K.jsx)(`div`,{className:`size-2 rounded-[1px] bg-success/30`}),(0,K.jsx)(`div`,{className:`size-2 rounded-[1px] bg-success/60`}),(0,K.jsx)(`div`,{className:`size-2 rounded-[1px] bg-warning/50`}),(0,K.jsx)(`div`,{className:`size-2 rounded-[1px] bg-warning/80`}),(0,K.jsx)(`div`,{className:`size-2 rounded-[1px] bg-error/80`})]}),(0,K.jsx)(`span`,{children:`High`}),(0,K.jsx)(`span`,{className:`ml-1`,children:`|`}),(0,K.jsx)(`div`,{className:`size-2 rounded-[1px] bg-surface-elevated border border-border/30`}),(0,K.jsx)(`span`,{children:`No data`})]})]})}function Ee({profile:e,accountId:t,onClose:n}){let i=[[`Name`,e.account?.display_name],[`Email`,e.account?.email],[`Org`,e.organization?.name],[`Type`,e.organization?.organization_type],[`Tier`,e.organization?.rate_limit_tier],[`Status`,e.organization?.subscription_status]];return(0,K.jsxs)(`section`,{className:`space-y-2 border-t border-border pt-3`,"data-testid":`account-profile-panel`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-medium`,children:`Profile`}),(0,K.jsx)(`button`,{className:`p-2 text-muted-foreground hover:text-foreground cursor-pointer`,onClick:n,"aria-label":`Close profile`,children:(0,K.jsx)(r,{className:`size-4`})})]}),(0,K.jsx)(`div`,{className:`grid grid-cols-[80px_1fr] gap-x-3 gap-y-1 text-xs`,children:i.map(([e,t])=>t?(0,K.jsxs)(`span`,{className:`contents`,children:[(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:e}),(0,K.jsx)(`span`,{className:`break-all`,children:t})]},e):null)}),(0,K.jsx)(Te,{accountId:t})]})}function De({display:e,onConfirm:t,onCancel:n}){let r=_(),i=(0,K.jsxs)(`div`,{className:`space-y-4`,"data-testid":`account-delete-confirm`,children:[(0,K.jsxs)(`p`,{className:`text-sm`,children:[`Remove `,(0,K.jsx)(`span`,{className:`font-medium`,children:e}),`?`]}),(0,K.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`The stored token is deleted from this machine. Any export you already made keeps working.`}),(0,K.jsxs)(`div`,{className:`flex flex-col-reverse md:flex-row gap-2 md:justify-end pt-2`,children:[(0,K.jsx)(y,{variant:`outline`,onClick:n,className:`min-h-11`,children:`Cancel`}),(0,K.jsx)(y,{variant:`destructive`,autoFocus:!1,onClick:t,className:`min-h-11`,children:`Remove account`})]})]});return r?(0,K.jsx)(E,{open:!0,onClose:n,children:(0,K.jsxs)(`div`,{className:`px-4 pb-4`,children:[(0,K.jsx)(`h2`,{className:`text-base font-semibold mb-3`,children:`Remove account`}),i]})}):(0,K.jsx)(T,{open:!0,onOpenChange:e=>{e||n()},children:(0,K.jsxs)(S,{className:`sm:max-w-sm`,children:[(0,K.jsx)(b,{children:(0,K.jsx)(C,{className:`text-sm`,children:`Remove account`})}),i]})})}function Oe(e){let t=new Blob([e],{type:`application/json`}),n=document.createElement(`a`);n.href=URL.createObjectURL(t),n.download=`ppm-accounts-backup.json`,n.click(),URL.revokeObjectURL(n.href)}function ke({open:e,onOpenChange:t,accounts:n,preselectId:r,onMessage:i}){let a=n.filter(e=>e.hasRefreshToken),[o,s]=(0,G.useState)(new Set),[c,l]=(0,G.useState)(``),[d,g]=(0,G.useState)(!1),[_,v]=(0,G.useState)(!1),[E,O]=(0,G.useState)(!1),[k,A]=(0,G.useState)(!1);e&&!k&&(s(r?new Set([r]):new Set(a.map(e=>e.id))),A(!0)),!e&&k&&A(!1);function j(){t(!1),l(``),g(!1),v(!1)}async function M(e){if(o.size===0)return;O(!0);let t=c.trim()||`ppm-hienlh`;try{let n={"Content-Type":`application/json`},r=h();r&&(n.Authorization=`Bearer ${r}`);let a=await fetch(`/api/accounts/export`,{method:`POST`,headers:n,body:JSON.stringify({password:t,accountIds:[...o],includeRefreshToken:d,refreshBeforeExport:_})});if(!a.ok){let e=await a.json();throw Error(e.error??`Export failed: ${a.status}`)}let s=await a.text();e&&await re(s)?i?.(`Backup copied to clipboard!`):(Oe(s),i?.(`Backup downloaded.`)),j()}catch{}O(!1)}let N=o.size>0&&!E;return(0,K.jsx)(T,{open:e,onOpenChange:e=>{e||j()},children:(0,K.jsxs)(S,{className:`sm:max-w-md`,children:[(0,K.jsxs)(b,{children:[(0,K.jsxs)(C,{className:`text-sm flex items-center gap-1.5`,children:[(0,K.jsx)(u,{className:`size-3.5`}),` Export Accounts`]}),(0,K.jsx)(w,{className:`text-xs`,children:`Select accounts and set a password to protect the backup.`})]}),(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsxs)(`div`,{className:`space-y-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,K.jsx)(`p`,{className:`text-[11px] font-medium text-muted-foreground`,children:`Accounts to export`}),(0,K.jsx)(`button`,{className:`text-[10px] text-primary hover:underline cursor-pointer`,onClick:()=>s(o.size===a.length?new Set:new Set(a.map(e=>e.id))),children:o.size===a.length?`Deselect all`:`Select all`})]}),a.length===0?(0,K.jsx)(`p`,{className:`text-[10px] text-muted-foreground p-2 border rounded`,children:`No exportable accounts.`}):(0,K.jsx)(`div`,{className:`max-h-36 overflow-y-auto space-y-1 border rounded p-2`,children:a.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`input`,{type:`checkbox`,id:`exp-${e.id}`,checked:o.has(e.id),onChange:t=>{let n=new Set(o);t.target.checked?n.add(e.id):n.delete(e.id),s(n)},className:`size-3.5 accent-primary cursor-pointer`}),(0,K.jsx)(`label`,{htmlFor:`exp-${e.id}`,className:`text-xs cursor-pointer truncate`,children:e.label??e.email??e.id.slice(0,8)})]},e.id))})]}),(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsxs)(F,{className:`text-xs`,children:[`Password `,(0,K.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,K.jsx)(D,{type:`password`,placeholder:`Leave empty for default`,value:c,onChange:e=>l(e.target.value),className:`text-xs h-8`,autoComplete:`new-password`})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`input`,{type:`checkbox`,id:`exp-full`,checked:d,onChange:e=>g(e.target.checked),className:`size-3.5 accent-primary cursor-pointer`}),(0,K.jsx)(`label`,{htmlFor:`exp-full`,className:`text-[11px] cursor-pointer`,children:`Include refresh tokens (full transfer)`})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`input`,{type:`checkbox`,id:`exp-refresh`,checked:_,onChange:e=>v(e.target.checked),className:`size-3.5 accent-primary cursor-pointer`}),(0,K.jsx)(`label`,{htmlFor:`exp-refresh`,className:`text-[11px] cursor-pointer`,children:`Refresh tokens before export`})]}),d?(0,K.jsxs)(`div`,{className:`rounded-md border border-error/30 bg-error/5 p-2.5`,children:[(0,K.jsx)(`p`,{className:`text-[10px] font-medium text-error`,children:`Full transfer — source accounts will expire`}),(0,K.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Refresh tokens included. Source machine expires in ~1h after target refreshes.`})]}):_?(0,K.jsx)(`div`,{className:`rounded-md border border-warning/30 bg-warning/5 p-2.5`,children:(0,K.jsx)(`p`,{className:`text-[10px] font-medium text-warning`,children:`Refresh before export — invalidates previous shares`})}):(0,K.jsx)(`div`,{className:`rounded-md border border-success/30 bg-success/5 p-2.5`,children:(0,K.jsx)(`p`,{className:`text-[10px] font-medium text-success`,children:`Share current token (safe)`})}),(0,K.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Encrypted with AES-256-GCM + scrypt.`})]}),(0,K.jsxs)(x,{className:`gap-1.5 flex-col sm:flex-row`,children:[(0,K.jsx)(y,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,onClick:j,children:`Cancel`}),(0,K.jsxs)(y,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,disabled:!N,onClick:()=>M(!0),children:[(0,K.jsx)(f,{className:`size-3 mr-1`}),` Copy`]}),(0,K.jsx)(y,{size:`sm`,className:`text-xs h-7 cursor-pointer`,disabled:!N,onClick:()=>M(!1),children:E?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(m,{className:`size-3 animate-spin mr-1`}),` Exporting...`]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(p,{className:`size-3 mr-1`}),` Download`]})})]})]})})}function Ae({open:e,onOpenChange:t,onSuccess:n}){let[r,i]=(0,G.useState)(``),[a,o]=(0,G.useState)(``),[s,c]=(0,G.useState)(!1),[l,d]=(0,G.useState)(null);function f(){t(!1),i(``),o(``),d(null)}async function p(){if(r.trim()){c(!0),d(null);try{let e=await I({data:r.trim(),password:a.trim()||`ppm-hienlh`});f(),n(`Imported ${e.imported} account(s)`)}catch(e){d(e.message||`Import failed`)}c(!1)}}return(0,K.jsx)(T,{open:e,onOpenChange:e=>{e||f()},children:(0,K.jsxs)(S,{className:`sm:max-w-md`,children:[(0,K.jsxs)(b,{children:[(0,K.jsxs)(C,{className:`text-sm flex items-center gap-1.5`,children:[(0,K.jsx)(u,{className:`size-3.5`}),` Import Accounts`]}),(0,K.jsx)(w,{className:`text-xs`,children:`Paste backup data and enter the export password. Imported accounts are temporary (~1h).`})]}),(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(F,{className:`text-xs`,children:`Backup data`}),(0,K.jsx)(`textarea`,{value:r,onChange:e=>i(e.target.value),placeholder:`Paste backup JSON here...`,rows:4,className:`w-full text-xs p-2 rounded border border-border bg-background font-mono resize-none focus:outline-none focus:ring-1 focus:ring-primary`})]}),(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsxs)(F,{className:`text-xs`,children:[`Password `,(0,K.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,K.jsx)(D,{type:`password`,placeholder:`Leave empty for default`,value:a,onChange:e=>o(e.target.value),className:`text-xs h-8`,autoComplete:`current-password`})]})]}),l&&(0,K.jsx)(`div`,{className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:l}),(0,K.jsxs)(x,{children:[(0,K.jsx)(y,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,onClick:f,children:`Cancel`}),(0,K.jsx)(y,{size:`sm`,className:`text-xs h-7 cursor-pointer`,disabled:!r.trim()||s,onClick:p,children:s?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(m,{className:`size-3 animate-spin mr-1`}),` Importing...`]}):`Import`})]})]})})}var X=typeof window<`u`?window.matchMedia(`(min-width: 768px)`):null;function je(e){return X?.addEventListener(`change`,e),()=>X?.removeEventListener(`change`,e)}function Me(){return X?.matches??!0}function Z(){let[e,t]=(0,G.useState)(null),[n,r]=(0,G.useState)(!0);return(0,G.useEffect)(()=>{r(!0),se().then(t).finally(()=>r(!1))},[]),n?(0,K.jsx)(`p`,{className:`text-xs text-text-subtle py-4 text-center`,children:`Loading...`}):e?(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(`label`,{className:`text-xs font-medium text-text-primary`,children:`Rotation Strategy`}),(0,K.jsxs)(ee,{value:e.strategy,onValueChange:async e=>{t(await L({strategy:e}))},children:[(0,K.jsx)(P,{className:`w-full h-9 text-xs`,children:(0,K.jsx)(ne,{})}),(0,K.jsxs)(te,{children:[(0,K.jsx)(M,{value:`round-robin`,children:`Round-robin`}),(0,K.jsx)(M,{value:`fill-first`,children:`Fill-first`}),(0,K.jsx)(M,{value:`lowest-usage`,children:`Lowest usage`})]})]}),(0,K.jsxs)(`p`,{className:`text-[10px] text-text-subtle`,children:[e.strategy===`round-robin`&&`Cycles through accounts evenly`,e.strategy===`fill-first`&&`Uses one account until its limit, then moves on`,e.strategy===`lowest-usage`&&`Picks the account with the lowest current usage`]})]}),(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(`label`,{className:`text-xs font-medium text-text-primary`,children:`Max Retry`}),(0,K.jsx)(`input`,{type:`number`,min:0,value:e.maxRetry,className:`w-full h-9 text-xs border rounded-md px-3 bg-background`,onChange:async e=>{let n=parseInt(e.target.value,10);!isNaN(n)&&n>=0&&t(await L({maxRetry:n}))}}),(0,K.jsx)(`p`,{className:`text-[10px] text-text-subtle`,children:`How many accounts to try on failure. 0 = try all available accounts.`})]}),(0,K.jsxs)(`div`,{className:`space-y-1.5 border-t border-border pt-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`label`,{className:`text-xs font-medium text-text-primary`,children:`Cooldown parking`}),(0,K.jsx)(N,{checked:e.cooldownEnabled,onCheckedChange:async e=>{t(await L({cooldownEnabled:e}))}})]}),(0,K.jsx)(`p`,{className:`text-[10px] text-text-subtle`,children:`Park a failing account (rate limit / usage limit / auth error) until it recovers. Off: accounts stay selectable — rotation still skips accounts already ≥95% on the 5-hour limit.`})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between text-xs border-t border-border pt-3`,children:[(0,K.jsx)(`span`,{className:`text-text-subtle`,children:`Active accounts`}),(0,K.jsx)(`span`,{className:`font-medium text-text-primary`,children:e.activeCount})]})]}):(0,K.jsx)(`p`,{className:`text-xs text-text-subtle py-4 text-center`,children:`Failed to load settings`})}function Ne({open:e,onOpenChange:t}){let n=(0,G.useSyncExternalStore)(je,Me);return e?n?(0,K.jsx)(T,{open:e,onOpenChange:t,children:(0,K.jsxs)(S,{className:`sm:max-w-sm`,children:[(0,K.jsx)(b,{children:(0,K.jsxs)(C,{className:`text-sm flex items-center gap-2`,children:[(0,K.jsx)(d,{className:`size-4`}),` Rotation & Retry`]})}),(0,K.jsx)(Z,{})]})}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`fixed inset-0 z-50 transition-opacity duration-200 opacity-100`,onClick:()=>t(!1),style:{backgroundColor:`rgba(0,0,0,0.5)`}}),(0,K.jsxs)(`div`,{className:g(`fixed bottom-0 left-0 right-0 z-50 bg-background rounded-t-2xl border-t border-border shadow-2xl`,`transition-transform duration-300 ease-out max-h-[85vh] overflow-y-auto`,`translate-y-0`),children:[(0,K.jsx)(`div`,{className:`flex justify-center pt-3 pb-1`,children:(0,K.jsx)(`div`,{className:`w-10 h-1 rounded-full bg-border`})}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 border-b border-border`,children:[(0,K.jsxs)(`span`,{className:`text-sm font-semibold flex items-center gap-2`,children:[(0,K.jsx)(d,{className:`size-4`}),` Rotation & Retry`]}),(0,K.jsx)(`button`,{onClick:()=>t(!1),className:`flex items-center justify-center size-7 rounded-md hover:bg-surface-elevated transition-colors`,children:(0,K.jsx)(r,{className:`size-4`})})]}),(0,K.jsx)(`div`,{className:`px-4 py-4 pb-8`,children:(0,K.jsx)(Z,{})})]})]}):null}var Pe=v(`inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{variant:{default:`border-transparent bg-primary text-primary-foreground shadow`,secondary:`border-transparent bg-secondary text-secondary-foreground`,destructive:`border-transparent bg-destructive text-destructive-foreground shadow`,outline:`text-foreground`}},defaultVariants:{variant:`default`}});function Q({className:e,variant:t,...n}){return(0,K.jsx)(`div`,{className:g(Pe({variant:t}),e),...n})}function Fe(e){let t=Math.floor(Date.now()/1e3);return e>t?`${Math.floor((e-t)/60)}m`:`exp`}function Ie({accounts:e}){let[t,n]=(0,G.useState)([]),[r,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(!1),[s,c]=(0,G.useState)(new Map),l=e.filter(e=>e.hasRefreshToken);async function u(){if(l.length!==0){i(!0);try{let e=await ue(l.map(e=>e.id),a);n(t=>[...t,{round:t.length+1,time:new Date().toLocaleTimeString(),includeRefresh:a,items:e}])}catch{}i(!1)}}async function d(e,t){c(t=>new Map(t).set(e,{loading:!0}));try{let n=await de(t);c(t=>new Map(t).set(e,{loading:!1,...n}))}catch(t){c(n=>new Map(n).set(e,{loading:!1,status:`error`,error:t.message}))}}function f(e,t){return[{key:`r${e.round}-pre-${t.id}`,label:`Pre-export`,token:t.preExportTokenFull,preview:t.preExportToken,expires:t.preExportExpires},{key:`r${e.round}-exp-${t.id}`,label:`Exported`,token:t.exportedTokenFull,preview:t.exportedToken,expires:t.exportedExpires},{key:`r${e.round}-post-${t.id}`,label:`Post-export`,token:t.postExportTokenFull,preview:t.postExportToken,expires:t.postExportExpires}]}function p(){for(let e of t)for(let t of e.items)for(let n of f(e,t))n.token&&d(n.key,n.token)}return(0,K.jsxs)(`section`,{className:`border-t pt-4 space-y-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsx)(`p`,{className:`text-xs font-medium`,children:`Simulate export`}),t.length>0&&(0,K.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[t.length,` round(s)`]})]}),(0,K.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Every run appends a round. Earlier rounds are kept so tokens can be compared across runs.`}),l.length===0?(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No OAuth account with a refresh token to export.`}):(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(N,{id:`sim-include-refresh`,checked:a,onCheckedChange:o,className:`cursor-pointer`}),(0,K.jsx)(F,{htmlFor:`sim-include-refresh`,className:`text-[11px] cursor-pointer`,children:`Include refresh tokens`})]}),(0,K.jsx)(y,{size:`sm`,className:`h-7 text-xs cursor-pointer`,disabled:r,onClick:()=>void u(),children:r?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(m,{className:`size-3 animate-spin mr-1`}),` Exporting...`]}):`Run export #${t.length+1}`})]}),t.length>0&&(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsxs)(y,{size:`sm`,variant:`outline`,className:`w-full h-7 text-[11px] cursor-pointer`,onClick:p,children:[`Test all tokens (`,t.reduce((e,t)=>e+t.items.length*3,0),`)`]}),t.map(e=>(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsxs)(`p`,{className:`text-xs font-medium text-primary`,children:[`Round #`,e.round]}),(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.time}),(0,K.jsx)(Q,{variant:e.includeRefresh?`destructive`:`secondary`,className:`text-[9px] px-1 py-0`,children:e.includeRefresh?`with refresh`:`access only`})]}),e.items.map(t=>(0,K.jsxs)(`div`,{className:`p-2 rounded-lg border bg-card space-y-1.5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-[11px] font-medium`,children:t.label??t.email??t.id.slice(0,8)}),t.tokenChanged&&(0,K.jsx)(Q,{variant:`secondary`,className:`text-[9px] px-1 py-0`,children:`DB token changed`})]}),f(e,t).map(e=>{let t=s.get(e.key);return(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px]`,children:[(0,K.jsx)(`span`,{className:`w-20 shrink-0 text-muted-foreground text-[10px]`,children:e.label}),(0,K.jsx)(`code`,{className:`flex-1 truncate font-mono text-[10px] bg-muted px-1 rounded`,children:e.preview??`N/A`}),e.expires&&(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:Fe(e.expires)}),e.token?(0,K.jsx)(y,{size:`sm`,variant:`outline`,className:`h-6 text-[10px] px-1.5 cursor-pointer shrink-0`,disabled:t?.loading,onClick:()=>void d(e.key,e.token),children:t?.loading?(0,K.jsx)(m,{className:`size-3 animate-spin`}):`Test`}):(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`-`}),t&&!t.loading&&(0,K.jsx)(`span`,{className:`text-[10px] font-medium shrink-0 ${t.status?.startsWith(`valid`)?`text-success`:`text-error`}`,children:t.status})]},e.key)})]},`r${e.round}-${t.id}`))]},e.round))]})]})}function Le(e){let t=Math.floor(Date.now()/1e3),n=Math.floor(Math.abs(e-t)/60);return e>t?`${n}m left`:`expired ${n}m ago`}function Re({open:e,onOpenChange:t,accounts:n}){let[r,i]=(0,G.useState)(new Map),[a,s]=(0,G.useState)(!1);async function c(e){i(t=>new Map(t).set(e,{loading:!0}));try{let t=await ie(e,a);i(n=>new Map(n).set(e,{loading:!1,result:t}))}catch(t){i(n=>new Map(n).set(e,{loading:!1,error:t.message}))}}function l(){for(let e of n.filter(e=>e.expiresAt!==null))c(e.id)}return(0,K.jsx)(T,{open:e,onOpenChange:t,children:(0,K.jsxs)(S,{className:`sm:max-w-xl max-h-[85vh] flex flex-col`,children:[(0,K.jsxs)(b,{children:[(0,K.jsxs)(C,{className:`text-sm flex items-center gap-1.5`,children:[(0,K.jsx)(o,{className:`size-4`}),` Token Test`]}),(0,K.jsx)(w,{className:`text-xs`,children:`Probe stored tokens for validity. Nothing is modified.`})]}),(0,K.jsxs)(`div`,{className:`space-y-4 overflow-y-auto flex-1 pr-1`,children:[(0,K.jsxs)(`section`,{className:`space-y-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsx)(`p`,{className:`text-xs font-medium`,children:`Current tokens`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(N,{id:`token-test-refresh`,checked:a,onCheckedChange:s,className:`cursor-pointer`}),(0,K.jsx)(F,{htmlFor:`token-test-refresh`,className:`text-[11px] cursor-pointer`,children:`Also test refresh`})]}),(0,K.jsx)(y,{size:`sm`,variant:`outline`,className:`h-7 text-xs cursor-pointer`,onClick:l,children:`Test all`})]})]}),n.length===0&&(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No accounts to test.`}),(0,K.jsx)(`div`,{className:`space-y-1.5`,children:n.map(e=>{let t=r.get(e.id),n=t?.result?.accessToken.status;return(0,K.jsxs)(`div`,{className:`p-2 rounded border bg-card space-y-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`span`,{className:`text-xs font-medium truncate block`,children:e.label??e.email??e.id.slice(0,8)}),e.expiresAt&&(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:Le(e.expiresAt)})]}),(0,K.jsx)(y,{size:`sm`,variant:`outline`,className:`h-7 text-xs cursor-pointer shrink-0`,disabled:t?.loading,onClick:()=>void c(e.id),children:t?.loading?(0,K.jsx)(m,{className:`size-3 animate-spin`}):`Test`})]}),t&&!t.loading&&(0,K.jsxs)(`div`,{className:`text-[11px] pl-2 border-l-2 border-muted`,children:[t.error&&(0,K.jsx)(`p`,{className:`text-error`,children:t.error}),n&&(0,K.jsxs)(`span`,{className:n.startsWith(`valid`)?`text-success`:`text-error`,children:[n,t.result?.accessToken.code?` (${t.result.accessToken.code})`:``]})]})]},e.id)})})]}),(0,K.jsx)(Ie,{accounts:n})]}),(0,K.jsx)(x,{children:(0,K.jsx)(y,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Close`})})]})})}function ze(){let{usages:e,accounts:t,activeAccountId:n,initialLoading:r,refreshing:a,flashIds:s,reload:u}=me(),[f,h]=(0,G.useState)(null),[g,_]=(0,G.useState)(null),[v,b]=(0,G.useState)(null),[x,S]=(0,G.useState)(null),[C,w]=(0,G.useState)(null),[T,E]=(0,G.useState)(null),[D,O]=(0,G.useState)(void 0);function k(e){u(),e&&h(e)}async function A(e,t){_(e);try{await oe(e,{status:t===`disabled`?`active`:`disabled`})}catch(e){h(e.message)}_(null),u()}async function j(){if(v){try{await le(v.id),h(`Account "${v.display}" removed.`),u()}catch(e){h(`Failed to remove: ${e.message}`)}b(null)}}let M=new Map(t.map(e=>[e.id,e])),N=e[0]?.usage.lastFetchedAt;return(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsx)(z,{description:`Connect multiple Claude accounts. PPM rotates between them automatically to avoid rate limits.`,onRefresh:()=>void u(),refreshing:a,disabled:r,actions:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(y,{size:`sm`,className:`cursor-pointer gap-1.5`,onClick:()=>{O(void 0),E(`add`)},children:[(0,K.jsx)(c,{className:`size-4`}),` Add account`]}),(0,K.jsxs)(y,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>{w(null),E(`export`)},children:[(0,K.jsx)(p,{className:`size-4`}),` Export`]}),(0,K.jsxs)(y,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>E(`import`),children:[(0,K.jsx)(i,{className:`size-4`}),` Import`]}),(0,K.jsxs)(y,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>E(`rotation`),children:[(0,K.jsx)(d,{className:`size-4`}),` Rotation`]}),(0,K.jsxs)(y,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>E(`token-test`),children:[(0,K.jsx)(o,{className:`size-4`}),` Token test`]})]})}),(0,K.jsx)(H,{message:f,onDismiss:()=>h(null)}),(0,K.jsxs)(`section`,{className:`space-y-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-medium`,children:`Accounts`}),N&&(0,K.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[`usage `,fe(new Date(N).getTime())]})]}),r?(0,K.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-xs text-muted-foreground`,children:[(0,K.jsx)(m,{className:`size-4 animate-spin`}),` Loading accounts...`]}):e.length===0?(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-8 text-center`,children:[(0,K.jsx)(l,{className:`size-5 text-muted-foreground`}),(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No accounts connected yet.`}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Add one to start using PPM.`})]}):(0,K.jsx)(U,{children:e.map(e=>(0,K.jsx)(ge,{layout:`strip`,entry:e,isActive:e.accountId===n,accountInfo:M.get(e.accountId),onToggle:A,toggling:g===e.accountId,onDelete:(e,t)=>b({id:e,display:t}),onExport:e=>{w(e),E(`export`)},onViewProfile:(e,t)=>S({profile:e,accountId:t}),onReauth:()=>{O(e.accountLabel??e.accountId.slice(0,8)),E(`add`)},flash:s.has(e.accountId)},e.accountId))})]}),x&&(0,K.jsx)(Ee,{profile:x.profile,accountId:x.accountId,onClose:()=>S(null)}),v&&(0,K.jsx)(De,{display:v.display,onConfirm:()=>void j(),onCancel:()=>b(null)}),(0,K.jsx)(ye,{open:T===`add`,onOpenChange:e=>{E(e?`add`:null),e||O(void 0)},onSuccess:k,signInAgainFor:D}),(0,K.jsx)(ke,{open:T===`export`,onOpenChange:e=>{E(e?`export`:null),e||w(null)},accounts:t,preselectId:C,onMessage:h}),(0,K.jsx)(Ae,{open:T===`import`,onOpenChange:e=>E(e?`import`:null),onSuccess:k}),(0,K.jsx)(Ne,{open:T===`rotation`,onOpenChange:e=>E(e?`rotation`:null)}),(0,K.jsx)(Re,{open:T===`token-test`,onOpenChange:e=>E(e?`token-test`:null),accounts:t})]})}function Be({mode:e,onOpenChange:t,password:n,onPasswordChange:r,busy:a,onExport:o,onImport:s,error:c}){let l=(0,G.useRef)(null),d=e===`export`;return(0,K.jsx)(T,{open:e!==null,onOpenChange:t,children:(0,K.jsxs)(S,{className:`sm:max-w-md`,children:[(0,K.jsxs)(b,{children:[(0,K.jsxs)(C,{className:`text-sm flex items-center gap-1.5`,children:[(0,K.jsx)(u,{className:`size-4`}),` `,d?`Export Codex Accounts`:`Import Codex Accounts`]}),(0,K.jsx)(w,{className:`text-xs leading-relaxed`,children:d?`Writes a password-encrypted file containing each account's login.`:`Reads a backup file. The password must be the one it was exported with.`})]}),(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,K.jsx)(F,{htmlFor:`codex-backup-password`,className:`text-xs`,children:`Password`}),(0,K.jsx)(D,{id:`codex-backup-password`,type:`password`,placeholder:d?`Choose a password`:`Password used for the export`,value:n,onChange:e=>r(e.target.value),className:`text-xs`,autoComplete:d?`new-password`:`current-password`}),(0,K.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`A backup holds full logins — keep the file and its password together.`})]}),c&&(0,K.jsx)(`div`,{className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:c}),(0,K.jsx)(`input`,{ref:l,type:`file`,accept:`application/json,.json`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&s(t)}}),(0,K.jsxs)(x,{children:[(0,K.jsx)(y,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Cancel`}),(0,K.jsxs)(y,{size:`sm`,className:`text-xs cursor-pointer gap-1.5`,disabled:!n.trim()||a,onClick:()=>d?o():l.current?.click(),children:[a?(0,K.jsx)(m,{className:`size-3.5 animate-spin`}):d?(0,K.jsx)(p,{className:`size-3.5`}):(0,K.jsx)(i,{className:`size-3.5`}),d?`Download backup`:`Choose file`]})]})]})})}var Ve=[{value:`round-robin`,label:`Round-robin`,hint:`Take the next account each time.`},{value:`fill-first`,label:`Fill-first`,hint:`Stay on one account until it runs out.`},{value:`lowest-usage`,label:`Lowest usage`,hint:`Pick whichever has the most left.`}];function He({open:e,onOpenChange:t,strategy:n,onChange:r}){return(0,K.jsx)(T,{open:e,onOpenChange:t,children:(0,K.jsxs)(S,{className:`sm:max-w-md`,children:[(0,K.jsxs)(b,{children:[(0,K.jsx)(C,{className:`text-sm`,children:`Codex Rotation`}),(0,K.jsx)(w,{className:`text-xs leading-relaxed`,children:`How a new chat chooses among your Codex accounts.`})]}),(0,K.jsx)(`div`,{className:`space-y-2`,children:Ve.map(e=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),"aria-current":n===e.value?`true`:void 0,className:g(`w-full text-left rounded-md border px-3 py-2.5 min-h-11 cursor-pointer transition-colors`,n===e.value?`border-primary bg-primary/10`:`border-border hover:bg-accent/50 active:bg-accent`),children:[(0,K.jsx)(`p`,{className:`text-sm font-medium`,children:e.label}),(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.hint})]},e.value))}),(0,K.jsx)(x,{children:(0,K.jsx)(y,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Done`})})]})})}function $(e){return e==null?null:Math.round(e*100)}function Ue({usage:e}){let t=e.session==null&&e.weekly==null;return(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(t||e.session!=null)&&(0,K.jsx)(B,{label:`5-Hour Session`,pct:$(e.fiveHour),reset:W(e.session),resetsAt:e.session?.resetsAt}),(t||e.weekly!=null)&&(0,K.jsx)(B,{label:`Weekly`,pct:$(e.sevenDay),reset:W(e.weekly),resetsAt:e.weekly?.resetsAt})]})}function We(){let[e,t]=(0,G.useState)(null),n=he(()=>t(null)),[r,o]=(0,G.useState)(null);return(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsx)(z,{description:(0,K.jsxs)(K.Fragment,{children:[`Each Codex account keeps its own login (`,(0,K.jsx)(`code`,{children:`CODEX_HOME`}),`). One is picked per chat by the rotation setting.`]}),onRefresh:()=>void n.load(),refreshing:n.loading,actions:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(y,{size:`sm`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`add`),children:[(0,K.jsx)(c,{className:`size-4`}),` Add account`]}),(0,K.jsxs)(y,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`export`),children:[(0,K.jsx)(p,{className:`size-4`}),` Export`]}),(0,K.jsxs)(y,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`import`),children:[(0,K.jsx)(i,{className:`size-4`}),` Import`]}),(0,K.jsxs)(y,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`rotation`),children:[(0,K.jsx)(d,{className:`size-4`}),` Rotation`]})]})}),(0,K.jsx)(H,{message:n.msg??n.err,onDismiss:()=>{n.setMsg(null),n.setErr(null)}}),(0,K.jsxs)(`section`,{className:`space-y-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-medium`,children:`Codex Accounts`}),(0,K.jsx)(`span`,{className:`text-[10px] text-muted-foreground capitalize`,children:n.strategy.replace(`-`,` `)})]}),n.loading&&n.accounts.length===0?(0,K.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-xs text-muted-foreground`,children:[(0,K.jsx)(m,{className:`size-4 animate-spin`}),` Loading accounts...`]}):n.accounts.length===0?(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-8 text-center`,children:[(0,K.jsx)(l,{className:`size-5 text-muted-foreground`}),(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No Codex accounts yet.`}),(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Chats use your default `,(0,K.jsx)(`code`,{children:`~/.codex`}),` login until you add one.`]})]}):(0,K.jsx)(U,{children:n.accounts.map(e=>{let t=n.usages[e.id]??{};return(0,K.jsxs)(R,{dense:!0,className:`min-w-[300px] shrink-0 snap-start${e.signedOut?` opacity-60`:``}`,"data-testid":`account-card`,"data-account-id":e.id,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium truncate flex-1 min-w-0`,children:e.label}),e.signedOut&&(0,K.jsx)(_e,{className:`text-[10px] text-error shrink-0 font-medium`,hint:`Codex rejected this account's login (revoked or expired), so no turn can run on it and it is skipped. The usage shown is the last reading. Click to sign in again — the account keeps its settings and chats.`,onClick:e.type===`chatgpt`?()=>o(e):void 0,children:`Sign in again`}),(0,K.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide text-text-subtle border border-border rounded px-1 shrink-0`,children:e.type}),V(e.planType)&&(0,K.jsx)(`span`,{className:`text-[10px] text-text-subtle shrink-0`,children:V(e.planType)}),(0,K.jsx)(N,{checked:e.status!==`disabled`,onCheckedChange:()=>void n.toggle(e.id,e.status??`active`),disabled:n.toggling.has(e.id),"aria-label":e.status===`disabled`?`Enable account`:`Disable account`,className:`cursor-pointer shrink-0`}),(0,K.jsxs)(A,{children:[(0,K.jsx)(k,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,onClick:()=>void n.remove(e.id),"aria-label":`Remove account`,className:`p-2 rounded cursor-pointer text-text-subtle hover:text-error hover:bg-surface-elevated transition-colors shrink-0`,children:(0,K.jsx)(a,{className:`size-4`})})}),(0,K.jsx)(j,{side:`top`,children:`Remove account`})]})]}),(0,K.jsx)(Ue,{usage:t}),t.session==null&&(()=>{let r=pe(t.weekly);return r?(0,K.jsxs)(`div`,{className:`flex min-h-12 items-center justify-between gap-3 rounded-md border px-2.5 py-1.5 ${e.dailyGuardEnabled&&r.blocked?`border-error/40 bg-error/5`:`border-border/50 bg-surface/40`}`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium ${e.dailyGuardEnabled&&r.blocked?`text-error`:`text-text-secondary`}`,children:[(0,K.jsx)(`span`,{children:`Daily guard`}),(0,K.jsxs)(A,{children:[(0,K.jsx)(k,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,"aria-label":`About Daily guard`,className:`text-text-subtle hover:text-text-primary cursor-help`,children:(0,K.jsx)(s,{className:`size-3.5`})})}),(0,K.jsx)(j,{side:`top`,className:`max-w-64 text-xs leading-relaxed`,children:`Spreads the weekly quota across five weekdays, adding 20% per weekday. Weekend slots keep the previous cap; unused allowance carries forward. Daily slots start at the reset time and use UTC weekdays. Turn it off any time to use the remaining quota freely.`})]})]}),(0,K.jsx)(`p`,{className:`text-[10px] tabular-nums ${e.dailyGuardEnabled&&r.blocked?`text-error`:`text-text-subtle`}`,children:e.dailyGuardEnabled&&r.blocked?`${Math.round(r.used*100)}% used / ${Math.round(r.cap*100)}% daily cap. New turns paused.`:`Weekday ${r.day}/5, ${Math.round(r.cap*100)}% daily cap`})]}),(0,K.jsxs)(`span`,{className:`hidden`,title:`Weekday ${r.day}/5: hold weekly usage at or below ${Math.round(r.cap*100)}% to last until reset.`,children:[`Daily guard `,e.dailyGuardEnabled?`· Weekday ${r.day}/5 cap ${Math.round(r.cap*100)}%`:``]}),(0,K.jsx)(N,{checked:!!e.dailyGuardEnabled,onCheckedChange:()=>void n.toggleDailyGuard(e.id,!!e.dailyGuardEnabled),disabled:n.toggling.has(e.id),"aria-label":e.dailyGuardEnabled?`Disable Daily guard`:`Enable Daily guard`,className:`cursor-pointer shrink-0`})]}):null})()]},e.id)})})]}),(0,K.jsx)(ve,{open:e===`add`,onOpenChange:e=>{e||n.cancelLogin(),t(e?`add`:null)},label:n.label,onLabelChange:n.setLabel,apiKey:n.apiKey,onApiKeyChange:n.setApiKey,adding:n.adding,onAddApiKey:()=>void n.addApiKey(),deviceWaiting:n.deviceWaiting,onStartDevice:()=>void n.startDevice(),device:n.device,browser:n.browser,onStartBrowser:()=>void n.startBrowser(),loginStarting:n.loginStarting,callbackUrl:n.callbackUrl,onCallbackUrlChange:n.setCallbackUrl,submittingCallback:n.submittingCallback,onSubmitCallback:()=>void n.submitCallback(),error:n.err}),(0,K.jsx)(Be,{mode:e===`export`?`export`:e===`import`?`import`:null,onOpenChange:e=>{e||t(null)},password:n.backupPassword,onPasswordChange:n.setBackupPassword,busy:n.exporting||n.importing,onExport:()=>void n.doExport(),onImport:e=>void n.doImport(e),error:n.err}),r&&(0,K.jsx)(be,{account:r,onClose:()=>o(null),onDone:()=>void n.load()}),(0,K.jsx)(He,{open:e===`rotation`,onOpenChange:e=>t(e?`rotation`:null),strategy:n.strategy,onChange:e=>void n.changeStrategy(e)})]})}var Ge=[{id:`claude`,label:`Claude`},{id:`codex`,label:`Codex`}];function Ke(){let[e,t]=(0,G.useState)(null),[n,r]=(0,G.useState)(`claude`);(0,G.useEffect)(()=>{let e=!1;return ae().then(n=>{e||t(new Set(Object.keys(n.providers??{})))}).catch(()=>{e||t(new Set([`claude`]))}),()=>{e=!0}},[]);let i=Ge.filter(t=>t.id===`claude`||e?.has(t.id)),a=i.length>1;return(0,K.jsxs)(`div`,{className:`space-y-4`,"data-testid":`accounts-pane`,"data-provider":n,children:[a&&(0,K.jsx)(`div`,{className:`flex gap-1 border-b border-border/50`,children:i.map(e=>(0,K.jsxs)(`button`,{onClick:()=>r(e.id),"data-testid":`accounts-tab-${e.id}`,"aria-current":n===e.id?`page`:void 0,className:`flex items-center gap-1.5 px-3 py-2 text-xs rounded-t transition-colors cursor-pointer ${n===e.id?`text-primary border-b-2 border-primary font-medium`:`text-text-subtle hover:text-text-secondary`}`,children:[(0,K.jsx)(O,{providerId:e.id}),e.label]},e.id))}),e===null&&!a&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,K.jsx)(m,{className:`size-3 animate-spin`}),` Checking configured providers...`]}),n===`claude`?(0,K.jsx)(ze,{}):(0,K.jsx)(We,{})]})}export{Ke as AccountsSettingsSection};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t,S as n}from"./vendor-markdown-QKPNiWEd.js";import"./vendor-ui-BHh12_0v.js";import{Fr as r,fn as i,r as a,sr as o,un as s}from"./icons-C9ZwXgel.js";import{s as c}from"./api-client-c8YOpTlT.js";import"./settings-store-DXmQug0m.js";import"./vendor-mermaid-eg2XWIjK.js";import{n as l}from"./utils-btZ8C8-R.js";import{S as u,at as d,it as f,nt as p,rt as m,tt as h}from"./index-BVKT5UCu.js";import{t as g}from"./use-monaco-theme-CNEk66US.js";var _=e(t(),1),v=n();function y({metadata:e}){let t=e?.filePath,n=e?.name,l=e?.resourceType??`skill`,y=e?.scope??`user`,x=e?.readOnly===!0,S=e?.shadowed===!0,C=e?.shadowedBy,w=e?.project??``,[T,E]=(0,_.useState)(``),[D,O]=(0,_.useState)(``),[k,A]=(0,_.useState)(!0),[j,M]=(0,_.useState)(null),[N,P]=(0,_.useState)(!1),F=g(),I=(0,_.useRef)(``),L=T!==D;(0,_.useEffect)(()=>{let e=!1;return A(!0),M(null),f(t,w).then(t=>{e||(E(t.content),O(t.content),I.current=t.content)}).catch(t=>{e||M(t.message)}).finally(()=>{e||A(!1)}),()=>{e=!0}},[t,w]);let R=(0,_.useCallback)(async()=>{if(x||N)return;let e=I.current;if(e!==D){P(!0);try{await d(t,e,w),O(e),E(e),c.success(`Saved`),m.getState().reload()}catch(e){c.error(e.message)}finally{P(!1)}}},[t,w,D,x,N]);(0,_.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),R())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[R]);let z=p[l];return(0,v.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[(0,v.jsx)(z,{className:`size-4 text-text-subtle`}),(0,v.jsx)(`span`,{className:`text-sm font-semibold`,children:n}),(0,v.jsx)(h,{scope:y}),L&&!x&&(0,v.jsx)(`span`,{className:`size-1.5 rounded-full bg-primary`,title:`Unsaved changes`}),(0,v.jsx)(`div`,{className:`flex-1`}),(0,v.jsxs)(`span`,{className:`hidden sm:block text-[11px] text-text-subtle`,children:[l,` · markdown`]}),!x&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`button`,{onClick:()=>E(D),disabled:!L||N,className:`flex items-center gap-1 rounded px-2 py-1 text-xs text-text-secondary hover:bg-surface-elevated disabled:opacity-40`,children:[(0,v.jsx)(r,{className:`size-3.5`}),` Revert`]}),(0,v.jsxs)(`button`,{onClick:()=>void R(),disabled:!L||N,className:`flex items-center gap-1 rounded bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-40`,children:[N?(0,v.jsx)(s,{className:`size-3.5 animate-spin`}):(0,v.jsx)(o,{className:`size-3.5`}),` Save`]})]})]}),x&&(0,v.jsx)(b,{icon:i,tone:`muted`,children:`Bundled resource — read-only. Duplicate it (from the AI Resources panel) to make an editable copy.`}),S&&C&&(0,v.jsxs)(b,{icon:a,tone:`warn`,children:[`This `,l,` is overridden by another “`,C.name,`” from a higher-priority source (`,C.source,`). It is currently inactive.`]}),(0,v.jsx)(`div`,{className:`min-h-0 flex-1`,children:k?(0,v.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,v.jsx)(s,{className:`size-5 animate-spin text-primary`})}):j?(0,v.jsx)(`div`,{className:`p-6 text-center text-sm text-destructive`,children:j}):(0,v.jsx)(u,{height:`100%`,language:`markdown`,theme:F,value:T,onChange:e=>{let t=e??``;I.current=t,E(t)},options:{readOnly:x,minimap:{enabled:!1},fontSize:13,wordWrap:`on`,scrollBeyondLastLine:!1,lineNumbers:`on`}})})]})}function b({icon:e,tone:t,children:n}){return(0,v.jsxs)(`div`,{className:l(`flex items-start gap-2 px-3 py-2 text-[12px] shrink-0 border-b border-border`,t===`warn`?`bg-amber-500/10 text-amber-300`:`bg-surface-elevated text-text-secondary`),children:[(0,v.jsx)(e,{className:`mt-0.5 size-3.5 shrink-0`}),(0,v.jsx)(`span`,{children:n})]})}export{y as AiResourceEditor};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t,S as n}from"./vendor-markdown-QKPNiWEd.js";import"./vendor-ui-BHh12_0v.js";import{Fr as r,fn as i,r as a,sr as o,un as s}from"./icons-CO_II6D-.js";import{s as c}from"./api-client-c8YOpTlT.js";import"./settings-store-DXmQug0m.js";import"./vendor-mermaid-eg2XWIjK.js";import{n as l}from"./utils-btZ8C8-R.js";import{S as u,at as d,it as f,nt as p,rt as m,tt as h}from"./index-CvUGUp7d.js";import{t as g}from"./use-monaco-theme-BVatH9yZ.js";var _=e(t(),1),v=n();function y({metadata:e}){let t=e?.filePath,n=e?.name,l=e?.resourceType??`skill`,y=e?.scope??`user`,x=e?.readOnly===!0,S=e?.shadowed===!0,C=e?.shadowedBy,w=e?.project??``,[T,E]=(0,_.useState)(``),[D,O]=(0,_.useState)(``),[k,A]=(0,_.useState)(!0),[j,M]=(0,_.useState)(null),[N,P]=(0,_.useState)(!1),F=g(),I=(0,_.useRef)(``),L=T!==D;(0,_.useEffect)(()=>{let e=!1;return A(!0),M(null),f(t,w).then(t=>{e||(E(t.content),O(t.content),I.current=t.content)}).catch(t=>{e||M(t.message)}).finally(()=>{e||A(!1)}),()=>{e=!0}},[t,w]);let R=(0,_.useCallback)(async()=>{if(x||N)return;let e=I.current;if(e!==D){P(!0);try{await d(t,e,w),O(e),E(e),c.success(`Saved`),m.getState().reload()}catch(e){c.error(e.message)}finally{P(!1)}}},[t,w,D,x,N]);(0,_.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),R())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[R]);let z=p[l];return(0,v.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[(0,v.jsx)(z,{className:`size-4 text-text-subtle`}),(0,v.jsx)(`span`,{className:`text-sm font-semibold`,children:n}),(0,v.jsx)(h,{scope:y}),L&&!x&&(0,v.jsx)(`span`,{className:`size-1.5 rounded-full bg-primary`,title:`Unsaved changes`}),(0,v.jsx)(`div`,{className:`flex-1`}),(0,v.jsxs)(`span`,{className:`hidden sm:block text-[11px] text-text-subtle`,children:[l,` · markdown`]}),!x&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`button`,{onClick:()=>E(D),disabled:!L||N,className:`flex items-center gap-1 rounded px-2 py-1 text-xs text-text-secondary hover:bg-surface-elevated disabled:opacity-40`,children:[(0,v.jsx)(r,{className:`size-3.5`}),` Revert`]}),(0,v.jsxs)(`button`,{onClick:()=>void R(),disabled:!L||N,className:`flex items-center gap-1 rounded bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-40`,children:[N?(0,v.jsx)(s,{className:`size-3.5 animate-spin`}):(0,v.jsx)(o,{className:`size-3.5`}),` Save`]})]})]}),x&&(0,v.jsx)(b,{icon:i,tone:`muted`,children:`Bundled resource — read-only. Duplicate it (from the AI Resources panel) to make an editable copy.`}),S&&C&&(0,v.jsxs)(b,{icon:a,tone:`warn`,children:[`This `,l,` is overridden by another “`,C.name,`” from a higher-priority source (`,C.source,`). It is currently inactive.`]}),(0,v.jsx)(`div`,{className:`min-h-0 flex-1`,children:k?(0,v.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,v.jsx)(s,{className:`size-5 animate-spin text-primary`})}):j?(0,v.jsx)(`div`,{className:`p-6 text-center text-sm text-destructive`,children:j}):(0,v.jsx)(u,{height:`100%`,language:`markdown`,theme:F,value:T,onChange:e=>{let t=e??``;I.current=t,E(t)},options:{readOnly:x,minimap:{enabled:!1},fontSize:13,wordWrap:`on`,scrollBeyondLastLine:!1,lineNumbers:`on`}})})]})}function b({icon:e,tone:t,children:n}){return(0,v.jsxs)(`div`,{className:l(`flex items-start gap-2 px-3 py-2 text-[12px] shrink-0 border-b border-border`,t===`warn`?`bg-amber-500/10 text-amber-300`:`bg-surface-elevated text-text-secondary`),children:[(0,v.jsx)(e,{className:`mt-0.5 size-3.5 shrink-0`}),(0,v.jsx)(`span`,{children:n})]})}export{y as AiResourceEditor};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t,S as n}from"./vendor-markdown-QKPNiWEd.js";import{Mr as r,ct as i,ir as a}from"./icons-C9ZwXgel.js";import{n as o}from"./api-client-c8YOpTlT.js";import{t as s}from"./input-CP31LZnN.js";import{$ as c,Dn as l,Ln as u,ct as d,dt as f,lt as p,ot as m,st as h,ut as g,yt as _}from"./index-BVKT5UCu.js";import{a as v,b as y}from"./api-settings-0s1Rfgcu.js";var b=e(t(),1),x=n(),S=[128e3,272e3,4e5,512e3,872e3,1e6],C=[1e5,2e5,23e4,35e4,45e4,75e4,9e5];function w({id:e,label:t,value:n,presets:r,disabled:i,compact:a,onChange:o}){let[c,l]=(0,b.useState)(!!n&&!r.includes(Number(n))),u=a?`text-[11px]`:`text-sm`;return(0,x.jsxs)(`div`,{className:`space-y-1`,children:[(0,x.jsx)(_,{htmlFor:e,className:u,children:t}),(0,x.jsxs)(`select`,{id:e,value:c?`custom`:n||`default`,disabled:i,"aria-describedby":`codex-context-help`,className:`w-full min-h-11 sm:min-h-0 rounded-md border border-input bg-background px-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 ${a?`h-7`:`h-9`} ${u}`,onChange:e=>{let t=e.target.value;l(t===`custom`),t!==`custom`&&o(t===`default`?``:t)},children:[(0,x.jsx)(`option`,{value:`default`,children:`Codex default`}),r.map(e=>(0,x.jsxs)(`option`,{value:String(e),children:[e===1e6?`1M`:`${e/1e3}K`,` tokens`]},e)),(0,x.jsx)(`option`,{value:`custom`,children:`Custom...`})]}),c&&(0,x.jsx)(s,{id:`${e}-custom`,"aria-label":`Custom ${t.toLowerCase()}`,type:`number`,min:1,step:1,required:!0,value:n,disabled:i,placeholder:`Enter tokens`,"aria-describedby":`codex-context-help`,className:`min-h-11 sm:min-h-0 ${a?`h-7 text-[11px]`:``}`,onChange:e=>o(e.target.value)})]})}function T({config:e,compact:t,saving:n,onSave:r}){let[i,a]=(0,b.useState)(String(e?.model_context_window??``)),[o,s]=(0,b.useState)(String(e?.model_auto_compact_token_limit??``)),[c,l]=(0,b.useState)(null),u=t?`text-[11px]`:`text-sm`,d=t?`text-[9px]`:`text-[11px]`;async function f(e){e.preventDefault();let t=i.trim()?Number(i):null,n=o.trim()?Number(o):null;if([t,n].some(e=>e!==null&&(!Number.isSafeInteger(e)||e<=0))){l(`Enter positive whole numbers of tokens, or leave blank for Codex defaults.`);return}if(t!==null&&n!==null&&n>t){l(`Auto-compact threshold must not exceed the context window.`);return}l(null),await r({model_context_window:t,model_auto_compact_token_limit:n})}return(0,x.jsxs)(`form`,{onSubmit:f,className:`space-y-2 rounded-md border border-border p-3`,children:[(0,x.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[(0,x.jsx)(w,{id:`codex-context-window`,label:`Context window (tokens)`,value:i,presets:S,disabled:n,compact:t,onChange:e=>{a(e),l(null)}}),(0,x.jsx)(w,{id:`codex-compact-threshold`,label:`Auto-compact threshold (tokens)`,value:o,presets:C,disabled:n,compact:t,onChange:e=>{s(e),l(null)}})]}),(0,x.jsx)(`p`,{id:`codex-context-help`,className:`${d} text-muted-foreground`,children:`Choose Codex default to use Codex configuration and model defaults, or Custom to enter a value. Presets are shortcuts, not a list of limits supported by your model; increasing these values does not unlock a larger context window. Applies to new sessions and sessions resumed after a PPM restart.`}),c&&(0,x.jsx)(`p`,{role:`alert`,className:`${u} text-error`,children:c}),(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,x.jsx)(`a`,{href:`https://learn.chatgpt.com/docs/config-file/config-reference`,target:`_blank`,rel:`noreferrer`,className:`${d} text-primary underline`,children:`Codex context documentation`}),(0,x.jsx)(`button`,{type:`submit`,disabled:n,className:`min-h-11 sm:min-h-0 rounded-md border border-border px-3 py-1.5 hover:bg-surface-elevated disabled:opacity-50 ${u}`,children:n?`Saving...`:`Save context settings`})]})]})}var E=[{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`},{value:`xhigh`,label:`Extra`},{value:`max`,label:`Max`}],D=[{value:`bypassPermissions`,label:`Bypass permissions (default)`},{value:`default`,label:`Ask before edits`},{value:`acceptEdits`,label:`Edit automatically`},{value:`plan`,label:`Plan mode`}],O={claude:`Claude`,cursor:`Cursor`,codex:`Codex`,gemini:`Gemini`};function k({compact:e}={}){let[t,n]=(0,b.useState)(null),[r,a]=(0,b.useState)(``),[S,C]=(0,b.useState)([]),[w,k]=(0,b.useState)(!1),[j,M]=(0,b.useState)(!1),[N,P]=(0,b.useState)(null),[F,I]=(0,b.useState)(0);(0,b.useEffect)(()=>{v().then(e=>{n(e),a(e.default_provider??`claude`)}).catch(e=>P(e.message))},[]),(0,b.useEffect)(()=>{r&&(k(!0),o.get(`/api/settings/ai/providers/${r}/models`).then(C).catch(()=>C([])).finally(()=>k(!1)))},[r]);let L=t?Object.keys(t.providers).filter(e=>e!==`mock`).map(e=>({id:e,name:O[e]??e})):[],R=t?.providers[r],z=R?.type===`agent-sdk`||!R?.type&&r===`claude`,B=async e=>{if(!t)return!1;M(!0),P(null);try{return n(await y(e)),I(e=>e+1),!0}catch(e){return P(e.message),!1}finally{M(!1)}},V=(e,t)=>B({providers:{[r]:{[e]:t}}}),H=e?`text-[11px]`:`text-sm`,U=e?`text-xs`:`text-sm`,W=e?`space-y-2`:`space-y-4`,G=e?`space-y-1.5`:`space-y-3`,K=e?`space-y-1`:`space-y-1.5`;if(!t)return(0,x.jsxs)(`div`,{className:G,children:[(0,x.jsx)(`h3`,{className:`${U} font-medium text-text-secondary`,children:`AI Settings`}),(0,x.jsx)(`p`,{className:`${H} text-text-subtle`,children:N?`Error: ${N}`:`Loading...`})]});let q=z?S:[{value:`__default__`,label:`Auto (default)`},...S];return(0,x.jsxs)(`div`,{className:W,children:[(0,x.jsx)(`h3`,{className:`${U} font-medium text-text-secondary`,children:`AI Settings`}),(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-new-chat-provider`,className:e?H:void 0,children:`New chat provider`}),(0,x.jsxs)(m,{value:t.new_chat_provider_mode??`default`,disabled:j,onValueChange:e=>B({new_chat_provider_mode:e}),children:[(0,x.jsx)(p,{id:`ai-new-chat-provider`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,x.jsx)(g,{})}),(0,x.jsxs)(h,{children:[(0,x.jsx)(d,{value:`follow-focus`,children:`Follow last focused chat`}),(0,x.jsx)(d,{value:`default`,children:`Always use default provider`})]})]}),(0,x.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:t.new_chat_provider_mode===`follow-focus`?`New tabs follow the last chat you focused in this project, across panels. Existing tabs keep their provider.`:`New tabs always use the default provider. Existing tabs keep their provider.`})]}),(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-default-provider`,className:e?H:void 0,children:`Default provider`}),(0,x.jsxs)(m,{value:t.default_provider,disabled:j,onValueChange:e=>B({default_provider:e}),children:[(0,x.jsx)(p,{id:`ai-default-provider`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,x.jsx)(g,{})}),(0,x.jsx)(h,{children:L.map(e=>(0,x.jsx)(d,{value:e.id,children:e.name},e.id))})]}),t.new_chat_provider_mode===`follow-focus`&&(0,x.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Used when no chat has been focused in this project yet.`})]}),(0,x.jsxs)(`div`,{className:`flex items-start justify-between gap-3 rounded-md border border-border p-3`,children:[(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-share-provider-context`,className:e?H:void 0,children:`Share rules and memory between providers`}),(0,x.jsx)(`p`,{id:`ai-share-provider-context-description`,className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Share project rules and memory, plus global instruction files, across providers. Applies from the next project-chat message. Turning off keeps context already sent.`})]}),(0,x.jsx)(f,{id:`ai-share-provider-context`,"aria-describedby":`ai-share-provider-context-description`,checked:t.share_provider_context??!0,disabled:j,onCheckedChange:e=>B({share_provider_context:e})})]}),L.length>1&&(0,x.jsx)(`div`,{className:`flex gap-0.5 border-b border-border/50 -mx-1 px-1`,children:L.map(e=>(0,x.jsxs)(`button`,{onClick:()=>a(e.id),className:`flex items-center gap-1 px-2 py-1 text-[11px] rounded-t transition-colors ${r===e.id?`text-primary border-b-2 border-primary font-medium`:`text-text-subtle hover:text-text-secondary`}`,children:[(0,x.jsx)(u,{providerId:e.id}),(0,x.jsx)(`span`,{className:`capitalize`,children:e.name})]},e.id))}),(0,x.jsxs)(`div`,{className:G,children:[r===`codex`&&(0,x.jsxs)(`button`,{type:`button`,onClick:()=>l(`accounts`),className:`w-full flex items-center justify-between gap-2 rounded-md border border-border px-2.5 py-2 text-left cursor-pointer hover:bg-surface-elevated transition-colors`,children:[(0,x.jsx)(`span`,{className:`${H} text-text-secondary`,children:`Codex accounts & login`}),(0,x.jsx)(i,{className:`size-3.5 text-text-subtle shrink-0`})]}),S.length>0&&(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-model`,className:e?H:void 0,children:`Model`}),(0,x.jsxs)(m,{value:z?R?.model??S[0]?.value:R?.model||`__default__`,onValueChange:e=>V(`model`,e===`__default__`?void 0:e),disabled:w,children:[(0,x.jsx)(p,{id:`ai-model`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,x.jsx)(g,{placeholder:w?`Loading models...`:`Select model`})}),(0,x.jsx)(h,{className:`max-h-[300px]`,children:q.map(e=>(0,x.jsx)(d,{value:e.value,children:e.label},e.value))})]})]}),r===`codex`&&(0,x.jsx)(T,{config:R,compact:e,saving:j,onSave:e=>B({providers:{codex:e}})},JSON.stringify([R?.model_context_window,R?.model_auto_compact_token_limit])),z&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-base-url`,className:e?H:void 0,children:`Base URL`}),(0,x.jsx)(s,{id:`ai-base-url`,type:`url`,defaultValue:R?.base_url??``,placeholder:`https://api.anthropic.com (default)`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{V(`base_url`,e.target.value.trim()||void 0)}},`baseurl-${r}-${F}`)]}),(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-api-key`,className:e?H:void 0,children:`API Key / Token`}),(0,x.jsx)(s,{id:`ai-api-key`,type:`password`,defaultValue:R?.api_key??``,placeholder:`sk-ant-... (optional, overrides accounts)`,className:e?`h-7 text-[11px] font-mono`:`font-mono`,onBlur:e=>{let t=e.target.value.trim();t.startsWith(`••••`)||V(`api_key`,t||void 0)}},`apikey-${r}-${F}`),(0,x.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Direct API key or OAuth token. Leave empty to use connected accounts.`})]}),(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-effort`,className:e?H:void 0,children:`Effort`}),(0,x.jsxs)(m,{value:R?.effort??`high`,onValueChange:e=>V(`effort`,e),children:[(0,x.jsx)(p,{id:`ai-effort`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,x.jsx)(g,{})}),(0,x.jsx)(h,{children:E.map(e=>(0,x.jsx)(d,{value:e.value,children:e.label},e.value))})]})]}),(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-max-turns`,className:e?H:void 0,children:`Max Turns (1-500)`}),(0,x.jsx)(s,{id:`ai-max-turns`,type:`number`,min:1,max:500,defaultValue:R?.max_turns??100,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseInt(e.target.value);isNaN(t)||V(`max_turns`,t)}},`turns-${r}-${F}`)]}),(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-budget`,className:e?H:void 0,children:`Max Budget (USD)`}),(0,x.jsx)(s,{id:`ai-budget`,type:`number`,step:.1,min:.01,max:50,defaultValue:R?.max_budget_usd??``,placeholder:`No limit`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseFloat(e.target.value);V(`max_budget_usd`,isNaN(t)?void 0:t)}},`budget-${r}-${F}`)]}),(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-thinking`,className:e?H:void 0,children:`Thinking Budget (tokens)`}),(0,x.jsx)(s,{id:`ai-thinking`,type:`number`,min:0,defaultValue:R?.thinking_budget_tokens??``,placeholder:`Adaptive (model decides)`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseInt(e.target.value);V(`thinking_budget_tokens`,isNaN(t)?void 0:t)}},`thinking-${r}-${F}`)]}),(0,x.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(_,{htmlFor:`ai-agent-teams`,className:e?H:void 0,children:`Agent Teams`}),(0,x.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Experimental. Enables multi-agent collaboration with shared tasks and messaging. Uses ~7x more tokens.`})]}),(0,x.jsx)(f,{id:`ai-agent-teams`,checked:R?.agent_teams??!1,onCheckedChange:e=>V(`agent_teams`,e)})]}),R?.agent_teams&&(0,x.jsx)(A,{compact:e}),(0,x.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(_,{htmlFor:`ai-context-1m`,className:e?H:void 0,children:`1M Context Window`}),(0,x.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Requires an entitled account (Max/Team/Enterprise) and an Opus 4 / Sonnet 4 model. Other accounts will error.`})]}),(0,x.jsx)(f,{id:`ai-context-1m`,checked:R?.context_1m??!1,onCheckedChange:e=>V(`context_1m`,e)})]}),(0,x.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(_,{htmlFor:`ai-inherit-mcp`,className:e?H:void 0,children:`Inherit Claude Code MCP`}),(0,x.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Auto-load MCP servers from Claude Code's ~/.claude.json (global + per-project). Your own MCP servers override inherited ones.`})]}),(0,x.jsx)(f,{id:`ai-inherit-mcp`,checked:R?.inherit_claude_mcp??!0,onCheckedChange:e=>V(`inherit_claude_mcp`,e)})]}),(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{className:e?H:void 0,children:`MCP sign-in`}),(0,x.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Servers that use OAuth stay unavailable to Claude until someone signs in. Project-scoped servers are listed in the project's AI Resources panel.`}),(0,x.jsx)(`div`,{className:`-mx-2`,children:(0,x.jsx)(c,{showWhenEmpty:!0})})]})]}),(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-permission-mode`,className:e?H:void 0,children:`Default Permission Mode`}),(0,x.jsxs)(m,{value:R?.permission_mode??`bypassPermissions`,onValueChange:e=>V(`permission_mode`,e),children:[(0,x.jsx)(p,{id:`ai-permission-mode`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,x.jsx)(g,{})}),(0,x.jsx)(h,{children:D.map(e=>(0,x.jsx)(d,{value:e.value,children:e.label},e.value))})]})]}),(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-system-prompt`,className:e?H:void 0,children:`Additional Instructions`}),(0,x.jsx)(`textarea`,{id:`ai-system-prompt`,rows:e?3:4,defaultValue:R?.system_prompt??``,placeholder:`Enter additional instructions for ${r}...`,className:`w-full rounded-md border border-input bg-background px-3 py-2 ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${e?`text-[11px]`:`text-sm`}`,onBlur:e=>{V(`system_prompt`,e.target.value.trim()||void 0)}},`sysprompt-${r}-${F}`)]})]}),j&&(0,x.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`Saving...`}),N&&(0,x.jsx)(`p`,{className:`text-xs text-error`,children:N})]})}function A({compact:e}){let[t,n]=(0,b.useState)([]),[i,s]=(0,b.useState)(!1),[c,l]=(0,b.useState)(null),u=(0,b.useCallback)(async()=>{s(!0);try{n(await o.get(`/api/teams`)??[])}catch{}s(!1)},[]);(0,b.useEffect)(()=>{u()},[u]);let d=async e=>{try{await o.del(`/api/teams/${encodeURIComponent(e)}`),n(t=>t.filter(t=>t.name!==e)),l(null)}catch{}};return t.length===0&&!i?null:(0,x.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,x.jsxs)(_,{className:e?`text-[11px]`:void 0,children:[`Teams (`,t.length,`)`]}),(0,x.jsx)(`button`,{onClick:u,className:`text-text-subtle hover:text-foreground p-1`,"aria-label":`Refresh teams`,children:(0,x.jsx)(a,{className:`size-3 ${i?`animate-spin`:``}`})})]}),t.map(e=>(0,x.jsxs)(`div`,{className:`flex items-center justify-between p-2 rounded bg-surface-elevated text-xs`,children:[(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`div`,{className:`font-medium truncate`,children:e.name}),e.description&&(0,x.jsx)(`div`,{className:`text-text-subtle truncate`,children:e.description}),(0,x.jsxs)(`div`,{className:`text-text-subtle`,children:[e.members?.length??e.memberCount??0,` members`,e.createdAt?` · ${new Date(e.createdAt).toLocaleDateString()}`:``]})]}),c===e.name?(0,x.jsxs)(`div`,{className:`flex gap-1 shrink-0 ml-2`,children:[(0,x.jsx)(`button`,{onClick:()=>d(e.name),className:`px-2 py-1 bg-error text-white rounded text-[10px]`,children:`Delete`}),(0,x.jsx)(`button`,{onClick:()=>l(null),className:`px-2 py-1 bg-panel-2 text-text rounded text-[10px]`,children:`Cancel`})]}):(0,x.jsx)(`button`,{onClick:()=>l(e.name),className:`shrink-0 text-text-subtle hover:text-error p-1 ml-2`,"aria-label":`Delete team ${e.name}`,children:(0,x.jsx)(r,{className:`size-3.5`})})]},e.name))]})}export{k as t};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t,S as n}from"./vendor-markdown-QKPNiWEd.js";import{Mr as r,ct as i,ir as a}from"./icons-CO_II6D-.js";import{n as o}from"./api-client-c8YOpTlT.js";import{t as s}from"./input-CP31LZnN.js";import{$ as c,Dn as l,Ln as u,ct as d,dt as f,lt as p,ot as m,st as h,ut as g,yt as _}from"./index-CvUGUp7d.js";import{a as v,b as y}from"./api-settings-0s1Rfgcu.js";var b=e(t(),1),x=n(),S=[128e3,272e3,4e5,512e3,872e3,1e6],C=[1e5,2e5,23e4,35e4,45e4,75e4,9e5];function w({id:e,label:t,value:n,presets:r,disabled:i,compact:a,onChange:o}){let[c,l]=(0,b.useState)(!!n&&!r.includes(Number(n))),u=a?`text-[11px]`:`text-sm`;return(0,x.jsxs)(`div`,{className:`space-y-1`,children:[(0,x.jsx)(_,{htmlFor:e,className:u,children:t}),(0,x.jsxs)(`select`,{id:e,value:c?`custom`:n||`default`,disabled:i,"aria-describedby":`codex-context-help`,className:`w-full min-h-11 sm:min-h-0 rounded-md border border-input bg-background px-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 ${a?`h-7`:`h-9`} ${u}`,onChange:e=>{let t=e.target.value;l(t===`custom`),t!==`custom`&&o(t===`default`?``:t)},children:[(0,x.jsx)(`option`,{value:`default`,children:`Codex default`}),r.map(e=>(0,x.jsxs)(`option`,{value:String(e),children:[e===1e6?`1M`:`${e/1e3}K`,` tokens`]},e)),(0,x.jsx)(`option`,{value:`custom`,children:`Custom...`})]}),c&&(0,x.jsx)(s,{id:`${e}-custom`,"aria-label":`Custom ${t.toLowerCase()}`,type:`number`,min:1,step:1,required:!0,value:n,disabled:i,placeholder:`Enter tokens`,"aria-describedby":`codex-context-help`,className:`min-h-11 sm:min-h-0 ${a?`h-7 text-[11px]`:``}`,onChange:e=>o(e.target.value)})]})}function T({config:e,compact:t,saving:n,onSave:r}){let[i,a]=(0,b.useState)(String(e?.model_context_window??``)),[o,s]=(0,b.useState)(String(e?.model_auto_compact_token_limit??``)),[c,l]=(0,b.useState)(null),u=t?`text-[11px]`:`text-sm`,d=t?`text-[9px]`:`text-[11px]`;async function f(e){e.preventDefault();let t=i.trim()?Number(i):null,n=o.trim()?Number(o):null;if([t,n].some(e=>e!==null&&(!Number.isSafeInteger(e)||e<=0))){l(`Enter positive whole numbers of tokens, or leave blank for Codex defaults.`);return}if(t!==null&&n!==null&&n>t){l(`Auto-compact threshold must not exceed the context window.`);return}l(null),await r({model_context_window:t,model_auto_compact_token_limit:n})}return(0,x.jsxs)(`form`,{onSubmit:f,className:`space-y-2 rounded-md border border-border p-3`,children:[(0,x.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[(0,x.jsx)(w,{id:`codex-context-window`,label:`Context window (tokens)`,value:i,presets:S,disabled:n,compact:t,onChange:e=>{a(e),l(null)}}),(0,x.jsx)(w,{id:`codex-compact-threshold`,label:`Auto-compact threshold (tokens)`,value:o,presets:C,disabled:n,compact:t,onChange:e=>{s(e),l(null)}})]}),(0,x.jsx)(`p`,{id:`codex-context-help`,className:`${d} text-muted-foreground`,children:`Choose Codex default to use Codex configuration and model defaults, or Custom to enter a value. Presets are shortcuts, not a list of limits supported by your model; increasing these values does not unlock a larger context window. Applies to new sessions and sessions resumed after a PPM restart.`}),c&&(0,x.jsx)(`p`,{role:`alert`,className:`${u} text-error`,children:c}),(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,x.jsx)(`a`,{href:`https://learn.chatgpt.com/docs/config-file/config-reference`,target:`_blank`,rel:`noreferrer`,className:`${d} text-primary underline`,children:`Codex context documentation`}),(0,x.jsx)(`button`,{type:`submit`,disabled:n,className:`min-h-11 sm:min-h-0 rounded-md border border-border px-3 py-1.5 hover:bg-surface-elevated disabled:opacity-50 ${u}`,children:n?`Saving...`:`Save context settings`})]})]})}var E=[{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`},{value:`xhigh`,label:`Extra`},{value:`max`,label:`Max`}],D=[{value:`bypassPermissions`,label:`Bypass permissions (default)`},{value:`default`,label:`Ask before edits`},{value:`acceptEdits`,label:`Edit automatically`},{value:`plan`,label:`Plan mode`}],O={claude:`Claude`,cursor:`Cursor`,codex:`Codex`,gemini:`Gemini`};function k({compact:e}={}){let[t,n]=(0,b.useState)(null),[r,a]=(0,b.useState)(``),[S,C]=(0,b.useState)([]),[w,k]=(0,b.useState)(!1),[j,M]=(0,b.useState)(!1),[N,P]=(0,b.useState)(null),[F,I]=(0,b.useState)(0);(0,b.useEffect)(()=>{v().then(e=>{n(e),a(e.default_provider??`claude`)}).catch(e=>P(e.message))},[]),(0,b.useEffect)(()=>{r&&(k(!0),o.get(`/api/settings/ai/providers/${r}/models`).then(C).catch(()=>C([])).finally(()=>k(!1)))},[r]);let L=t?Object.keys(t.providers).filter(e=>e!==`mock`).map(e=>({id:e,name:O[e]??e})):[],R=t?.providers[r],z=R?.type===`agent-sdk`||!R?.type&&r===`claude`,B=async e=>{if(!t)return!1;M(!0),P(null);try{return n(await y(e)),I(e=>e+1),!0}catch(e){return P(e.message),!1}finally{M(!1)}},V=(e,t)=>B({providers:{[r]:{[e]:t}}}),H=e?`text-[11px]`:`text-sm`,U=e?`text-xs`:`text-sm`,W=e?`space-y-2`:`space-y-4`,G=e?`space-y-1.5`:`space-y-3`,K=e?`space-y-1`:`space-y-1.5`;if(!t)return(0,x.jsxs)(`div`,{className:G,children:[(0,x.jsx)(`h3`,{className:`${U} font-medium text-text-secondary`,children:`AI Settings`}),(0,x.jsx)(`p`,{className:`${H} text-text-subtle`,children:N?`Error: ${N}`:`Loading...`})]});let q=z?S:[{value:`__default__`,label:`Auto (default)`},...S];return(0,x.jsxs)(`div`,{className:W,children:[(0,x.jsx)(`h3`,{className:`${U} font-medium text-text-secondary`,children:`AI Settings`}),(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-new-chat-provider`,className:e?H:void 0,children:`New chat provider`}),(0,x.jsxs)(m,{value:t.new_chat_provider_mode??`default`,disabled:j,onValueChange:e=>B({new_chat_provider_mode:e}),children:[(0,x.jsx)(p,{id:`ai-new-chat-provider`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,x.jsx)(g,{})}),(0,x.jsxs)(h,{children:[(0,x.jsx)(d,{value:`follow-focus`,children:`Follow last focused chat`}),(0,x.jsx)(d,{value:`default`,children:`Always use default provider`})]})]}),(0,x.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:t.new_chat_provider_mode===`follow-focus`?`New tabs follow the last chat you focused in this project, across panels. Existing tabs keep their provider.`:`New tabs always use the default provider. Existing tabs keep their provider.`})]}),(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-default-provider`,className:e?H:void 0,children:`Default provider`}),(0,x.jsxs)(m,{value:t.default_provider,disabled:j,onValueChange:e=>B({default_provider:e}),children:[(0,x.jsx)(p,{id:`ai-default-provider`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,x.jsx)(g,{})}),(0,x.jsx)(h,{children:L.map(e=>(0,x.jsx)(d,{value:e.id,children:e.name},e.id))})]}),t.new_chat_provider_mode===`follow-focus`&&(0,x.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Used when no chat has been focused in this project yet.`})]}),(0,x.jsxs)(`div`,{className:`flex items-start justify-between gap-3 rounded-md border border-border p-3`,children:[(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-share-provider-context`,className:e?H:void 0,children:`Share rules and memory between providers`}),(0,x.jsx)(`p`,{id:`ai-share-provider-context-description`,className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Share project rules and memory, plus global instruction files, across providers. Applies from the next project-chat message. Turning off keeps context already sent.`})]}),(0,x.jsx)(f,{id:`ai-share-provider-context`,"aria-describedby":`ai-share-provider-context-description`,checked:t.share_provider_context??!0,disabled:j,onCheckedChange:e=>B({share_provider_context:e})})]}),L.length>1&&(0,x.jsx)(`div`,{className:`flex gap-0.5 border-b border-border/50 -mx-1 px-1`,children:L.map(e=>(0,x.jsxs)(`button`,{onClick:()=>a(e.id),className:`flex items-center gap-1 px-2 py-1 text-[11px] rounded-t transition-colors ${r===e.id?`text-primary border-b-2 border-primary font-medium`:`text-text-subtle hover:text-text-secondary`}`,children:[(0,x.jsx)(u,{providerId:e.id}),(0,x.jsx)(`span`,{className:`capitalize`,children:e.name})]},e.id))}),(0,x.jsxs)(`div`,{className:G,children:[r===`codex`&&(0,x.jsxs)(`button`,{type:`button`,onClick:()=>l(`accounts`),className:`w-full flex items-center justify-between gap-2 rounded-md border border-border px-2.5 py-2 text-left cursor-pointer hover:bg-surface-elevated transition-colors`,children:[(0,x.jsx)(`span`,{className:`${H} text-text-secondary`,children:`Codex accounts & login`}),(0,x.jsx)(i,{className:`size-3.5 text-text-subtle shrink-0`})]}),S.length>0&&(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-model`,className:e?H:void 0,children:`Model`}),(0,x.jsxs)(m,{value:z?R?.model??S[0]?.value:R?.model||`__default__`,onValueChange:e=>V(`model`,e===`__default__`?void 0:e),disabled:w,children:[(0,x.jsx)(p,{id:`ai-model`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,x.jsx)(g,{placeholder:w?`Loading models...`:`Select model`})}),(0,x.jsx)(h,{className:`max-h-[300px]`,children:q.map(e=>(0,x.jsx)(d,{value:e.value,children:e.label},e.value))})]})]}),r===`codex`&&(0,x.jsx)(T,{config:R,compact:e,saving:j,onSave:e=>B({providers:{codex:e}})},JSON.stringify([R?.model_context_window,R?.model_auto_compact_token_limit])),z&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-base-url`,className:e?H:void 0,children:`Base URL`}),(0,x.jsx)(s,{id:`ai-base-url`,type:`url`,defaultValue:R?.base_url??``,placeholder:`https://api.anthropic.com (default)`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{V(`base_url`,e.target.value.trim()||void 0)}},`baseurl-${r}-${F}`)]}),(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-api-key`,className:e?H:void 0,children:`API Key / Token`}),(0,x.jsx)(s,{id:`ai-api-key`,type:`password`,defaultValue:R?.api_key??``,placeholder:`sk-ant-... (optional, overrides accounts)`,className:e?`h-7 text-[11px] font-mono`:`font-mono`,onBlur:e=>{let t=e.target.value.trim();t.startsWith(`••••`)||V(`api_key`,t||void 0)}},`apikey-${r}-${F}`),(0,x.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Direct API key or OAuth token. Leave empty to use connected accounts.`})]}),(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-effort`,className:e?H:void 0,children:`Effort`}),(0,x.jsxs)(m,{value:R?.effort??`high`,onValueChange:e=>V(`effort`,e),children:[(0,x.jsx)(p,{id:`ai-effort`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,x.jsx)(g,{})}),(0,x.jsx)(h,{children:E.map(e=>(0,x.jsx)(d,{value:e.value,children:e.label},e.value))})]})]}),(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-max-turns`,className:e?H:void 0,children:`Max Turns (1-500)`}),(0,x.jsx)(s,{id:`ai-max-turns`,type:`number`,min:1,max:500,defaultValue:R?.max_turns??100,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseInt(e.target.value);isNaN(t)||V(`max_turns`,t)}},`turns-${r}-${F}`)]}),(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-budget`,className:e?H:void 0,children:`Max Budget (USD)`}),(0,x.jsx)(s,{id:`ai-budget`,type:`number`,step:.1,min:.01,max:50,defaultValue:R?.max_budget_usd??``,placeholder:`No limit`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseFloat(e.target.value);V(`max_budget_usd`,isNaN(t)?void 0:t)}},`budget-${r}-${F}`)]}),(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-thinking`,className:e?H:void 0,children:`Thinking Budget (tokens)`}),(0,x.jsx)(s,{id:`ai-thinking`,type:`number`,min:0,defaultValue:R?.thinking_budget_tokens??``,placeholder:`Adaptive (model decides)`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseInt(e.target.value);V(`thinking_budget_tokens`,isNaN(t)?void 0:t)}},`thinking-${r}-${F}`)]}),(0,x.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(_,{htmlFor:`ai-agent-teams`,className:e?H:void 0,children:`Agent Teams`}),(0,x.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Experimental. Enables multi-agent collaboration with shared tasks and messaging. Uses ~7x more tokens.`})]}),(0,x.jsx)(f,{id:`ai-agent-teams`,checked:R?.agent_teams??!1,onCheckedChange:e=>V(`agent_teams`,e)})]}),R?.agent_teams&&(0,x.jsx)(A,{compact:e}),(0,x.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(_,{htmlFor:`ai-context-1m`,className:e?H:void 0,children:`1M Context Window`}),(0,x.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Requires an entitled account (Max/Team/Enterprise) and an Opus 4 / Sonnet 4 model. Other accounts will error.`})]}),(0,x.jsx)(f,{id:`ai-context-1m`,checked:R?.context_1m??!1,onCheckedChange:e=>V(`context_1m`,e)})]}),(0,x.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(_,{htmlFor:`ai-inherit-mcp`,className:e?H:void 0,children:`Inherit Claude Code MCP`}),(0,x.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Auto-load MCP servers from Claude Code's ~/.claude.json (global + per-project). Your own MCP servers override inherited ones.`})]}),(0,x.jsx)(f,{id:`ai-inherit-mcp`,checked:R?.inherit_claude_mcp??!0,onCheckedChange:e=>V(`inherit_claude_mcp`,e)})]}),(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{className:e?H:void 0,children:`MCP sign-in`}),(0,x.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Servers that use OAuth stay unavailable to Claude until someone signs in. Project-scoped servers are listed in the project's AI Resources panel.`}),(0,x.jsx)(`div`,{className:`-mx-2`,children:(0,x.jsx)(c,{showWhenEmpty:!0})})]})]}),(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-permission-mode`,className:e?H:void 0,children:`Default Permission Mode`}),(0,x.jsxs)(m,{value:R?.permission_mode??`bypassPermissions`,onValueChange:e=>V(`permission_mode`,e),children:[(0,x.jsx)(p,{id:`ai-permission-mode`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,x.jsx)(g,{})}),(0,x.jsx)(h,{children:D.map(e=>(0,x.jsx)(d,{value:e.value,children:e.label},e.value))})]})]}),(0,x.jsxs)(`div`,{className:K,children:[(0,x.jsx)(_,{htmlFor:`ai-system-prompt`,className:e?H:void 0,children:`Additional Instructions`}),(0,x.jsx)(`textarea`,{id:`ai-system-prompt`,rows:e?3:4,defaultValue:R?.system_prompt??``,placeholder:`Enter additional instructions for ${r}...`,className:`w-full rounded-md border border-input bg-background px-3 py-2 ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${e?`text-[11px]`:`text-sm`}`,onBlur:e=>{V(`system_prompt`,e.target.value.trim()||void 0)}},`sysprompt-${r}-${F}`)]})]}),j&&(0,x.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`Saving...`}),N&&(0,x.jsx)(`p`,{className:`text-xs text-error`,children:N})]})}function A({compact:e}){let[t,n]=(0,b.useState)([]),[i,s]=(0,b.useState)(!1),[c,l]=(0,b.useState)(null),u=(0,b.useCallback)(async()=>{s(!0);try{n(await o.get(`/api/teams`)??[])}catch{}s(!1)},[]);(0,b.useEffect)(()=>{u()},[u]);let d=async e=>{try{await o.del(`/api/teams/${encodeURIComponent(e)}`),n(t=>t.filter(t=>t.name!==e)),l(null)}catch{}};return t.length===0&&!i?null:(0,x.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,x.jsxs)(_,{className:e?`text-[11px]`:void 0,children:[`Teams (`,t.length,`)`]}),(0,x.jsx)(`button`,{onClick:u,className:`text-text-subtle hover:text-foreground p-1`,"aria-label":`Refresh teams`,children:(0,x.jsx)(a,{className:`size-3 ${i?`animate-spin`:``}`})})]}),t.map(e=>(0,x.jsxs)(`div`,{className:`flex items-center justify-between p-2 rounded bg-surface-elevated text-xs`,children:[(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`div`,{className:`font-medium truncate`,children:e.name}),e.description&&(0,x.jsx)(`div`,{className:`text-text-subtle truncate`,children:e.description}),(0,x.jsxs)(`div`,{className:`text-text-subtle`,children:[e.members?.length??e.memberCount??0,` members`,e.createdAt?` · ${new Date(e.createdAt).toLocaleDateString()}`:``]})]}),c===e.name?(0,x.jsxs)(`div`,{className:`flex gap-1 shrink-0 ml-2`,children:[(0,x.jsx)(`button`,{onClick:()=>d(e.name),className:`px-2 py-1 bg-error text-white rounded text-[10px]`,children:`Delete`}),(0,x.jsx)(`button`,{onClick:()=>l(null),className:`px-2 py-1 bg-panel-2 text-text rounded text-[10px]`,children:`Cancel`})]}):(0,x.jsx)(`button`,{onClick:()=>l(e.name),className:`shrink-0 text-text-subtle hover:text-error p-1 ml-2`,"aria-label":`Delete team ${e.name}`,children:(0,x.jsx)(r,{className:`size-3.5`})})]},e.name))]})}export{k as t};
@@ -1 +1 @@
1
- import"./vendor-markdown-QKPNiWEd.js";import"./vendor-ui-BHh12_0v.js";import"./icons-C9ZwXgel.js";import"./api-client-c8YOpTlT.js";import"./settings-store-DXmQug0m.js";import"./vendor-mermaid-eg2XWIjK.js";import"./portal-container-context-NFSuymMu.js";import"./panel-store-BUQ-CPsd.js";import"./window-store-B4cbZ5rr.js";import"./tab-store-DqeaGhhE.js";import"./use-is-mobile-CkO33jqU.js";import"./button-CBehaXpV.js";import"./dialog-CaShS4f5.js";import"./mobile-bottom-sheet-Cf4kV1hS.js";import"./use-visual-viewport-C307OVeV.js";import"./input-CP31LZnN.js";import"./api-settings-0s1Rfgcu.js";import{t as e}from"./ai-settings-section-0x6GFJ56.js";export{e as AISettingsSection};
1
+ import"./vendor-markdown-QKPNiWEd.js";import"./vendor-ui-BHh12_0v.js";import"./icons-CO_II6D-.js";import"./api-client-c8YOpTlT.js";import"./settings-store-DXmQug0m.js";import"./vendor-mermaid-eg2XWIjK.js";import"./portal-container-context-NFSuymMu.js";import"./panel-store-BUQ-CPsd.js";import"./window-store-B4cbZ5rr.js";import"./tab-store-DqeaGhhE.js";import"./use-is-mobile-CkO33jqU.js";import"./button-CBehaXpV.js";import"./dialog-tzBRkGeW.js";import"./mobile-bottom-sheet-Cf4kV1hS.js";import"./use-visual-viewport-C307OVeV.js";import"./input-CP31LZnN.js";import"./api-settings-0s1Rfgcu.js";import{t as e}from"./ai-settings-section-B7Un4KiW.js";export{e as AISettingsSection};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t,S as n}from"./vendor-markdown-QKPNiWEd.js";import{c as r,l as i,s as a,u as o}from"./vendor-ui-BHh12_0v.js";import{Mr as s,Qr as c,Zn as l,qr as u,w as d}from"./icons-C9ZwXgel.js";import{s as f}from"./api-client-c8YOpTlT.js";import{t as p}from"./settings-store-DXmQug0m.js";import"./vendor-mermaid-eg2XWIjK.js";import{n as m}from"./utils-btZ8C8-R.js";import"./portal-container-context-NFSuymMu.js";import{n as h}from"./use-is-mobile-CkO33jqU.js";import{n as g,t as _}from"./button-CBehaXpV.js";import{a as v,i as y,n as b,o as x,r as S,t as C}from"./dialog-CaShS4f5.js";import{t as w}from"./input-CP31LZnN.js";import{n as T,r as E,t as D}from"./resolve-theme-B87m6l4i.js";import{dt as O,j as k,k as A,nn as j,v as M}from"./index-BVKT5UCu.js";import{t as N}from"./separator-D8SNZI6E.js";var P=n();function F(){let e=p(e=>e.themeStyle),t=p(e=>e.themeMode),n=p(e=>e.customThemeId),r=p(e=>e.customThemes),i=p(e=>e.setThemeStyle),a=p(e=>e.setThemeMode),o=D(e,t,r,n);return(0,P.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:T.map(e=>{let t=E[e];if(!t)return null;let n=o.id===e;return(0,P.jsxs)(`button`,{onClick:()=>{i(t.style),a(t.mode)},className:m(`relative flex items-center gap-2 rounded-lg border p-2 text-left transition-colors min-h-11`,n?`border-primary ring-[3px] ring-accent-wash`:`border-border hover:bg-accent/40`),children:[(0,P.jsx)(k,{swatch:t.swatch}),(0,P.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`span`,{className:`block truncate text-xs font-medium text-text`,children:t.name.replace(/ (Dark|Light)$/,``)}),(0,P.jsx)(`span`,{className:`block text-[10px] text-text-3 capitalize`,children:t.mode})]}),n&&(0,P.jsx)(d,{className:`absolute top-1 right-1 size-3.5 text-primary`})]},e)})})}var I=e(t(),1);function L({className:e,orientation:t=`horizontal`,...n}){return(0,P.jsx)(i,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:m(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var R=g(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function z({className:e,variant:t=`default`,...n}){return(0,P.jsx)(r,{"data-slot":`tabs-list`,"data-variant":t,className:m(R({variant:t}),e),...n})}function B({className:e,...t}){return(0,P.jsx)(o,{"data-slot":`tabs-trigger`,className:m(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function V({className:e,...t}){return(0,P.jsx)(a,{"data-slot":`tabs-content`,className:m(`flex-1 outline-none`,e),...t})}function H({open:e,onOpenChange:t}){let n=p(e=>e.importThemeFrom),r=p(e=>e.setCustomTheme),[i,a]=(0,I.useState)(`url`),[o,s]=(0,I.useState)(``),[c,l]=(0,I.useState)(``),[u,d]=(0,I.useState)(``),[m,h]=(0,I.useState)(!1),g=()=>{s(``),l(``),d(``),a(`url`)},T=async()=>{let e=i===`url`?o.trim():c.trim();if(!e){f.error(`Nothing to import`);return}h(!0);try{let a=await n({source:i===`url`?`url`:i===`upload`?`upload`:`json`,value:e,name:u.trim()||void 0});f.success(a.length>1?`Imported ${a.length} themes`:`Imported "${a[0]?.name}"`),a[0]&&r(a[0].id),g(),t(!1)}catch(e){f.error(e.message||`Import failed`)}finally{h(!1)}},E=async e=>{if(e)try{l(await e.text()),d(e.name.replace(/\.json$/i,``))}catch{f.error(`Could not read file`)}};return(0,P.jsx)(C,{open:e,onOpenChange:t,children:(0,P.jsxs)(b,{className:`max-w-md`,children:[(0,P.jsxs)(v,{children:[(0,P.jsx)(x,{children:`Import theme`}),(0,P.jsx)(S,{className:`text-text-3`,children:`Import a VSCode color theme. Single-mode themes apply to both dark and light.`})]}),(0,P.jsxs)(L,{value:i,onValueChange:e=>a(e),children:[(0,P.jsxs)(z,{className:`w-full`,children:[(0,P.jsx)(B,{value:`url`,className:`flex-1`,children:`URL`}),(0,P.jsx)(B,{value:`json`,className:`flex-1`,children:`Paste JSON`}),(0,P.jsx)(B,{value:`upload`,className:`flex-1`,children:`Upload`})]}),(0,P.jsxs)(V,{value:`url`,className:`space-y-2 pt-2`,children:[(0,P.jsx)(w,{placeholder:`https://…/theme.json or Marketplace .vsix URL`,value:o,onChange:e=>s(e.target.value)}),(0,P.jsx)(`p`,{className:`text-[11px] text-text-3`,children:`Only https URLs; private/internal addresses are blocked.`})]}),(0,P.jsx)(V,{value:`json`,className:`pt-2`,children:(0,P.jsx)(`textarea`,{className:`w-full h-40 rounded-md border border-border bg-surface p-2 text-xs font-mono text-text focus:outline-none focus:border-ring`,placeholder:`{ "name": "My Theme", "type": "dark", "colors": { … }, "tokenColors": [ … ] }`,value:c,onChange:e=>l(e.target.value)})}),(0,P.jsxs)(V,{value:`upload`,className:`space-y-2 pt-2`,children:[(0,P.jsx)(`input`,{type:`file`,accept:`.json,application/json`,onChange:e=>E(e.target.files?.[0]),className:`block w-full text-xs text-text-2 file:mr-3 file:rounded file:border file:border-border file:bg-panel-2 file:px-2 file:py-1 file:text-text`}),c&&(0,P.jsxs)(`p`,{className:`text-[11px] text-success`,children:[`File loaded (`,c.length,` chars)`]})]})]}),(0,P.jsx)(w,{placeholder:`Optional name`,value:u,onChange:e=>d(e.target.value)}),(0,P.jsxs)(y,{children:[(0,P.jsx)(_,{variant:`outline`,onClick:()=>t(!1),disabled:m,children:`Cancel`}),(0,P.jsx)(_,{onClick:T,disabled:m,children:m?`Importing…`:`Import`})]})]})})}function U(){let e=p(e=>e.customThemes),t=p(e=>e.themeStyle),n=p(e=>e.customThemeId),r=p(e=>e.setCustomTheme),i=p(e=>e.deleteCustomTheme),[a,o]=(0,I.useState)(!1);return(0,P.jsxs)(`section`,{className:`space-y-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Imported themes`}),(0,P.jsxs)(_,{size:`sm`,variant:`outline`,className:`h-7 gap-1 text-xs`,onClick:()=>o(!0),children:[(0,P.jsx)(l,{className:`size-3.5`}),` Import`]})]}),e.length===0?(0,P.jsx)(`p`,{className:`text-[11px] text-text-3`,children:`No imported themes yet. Import a VSCode theme from a URL, .vsix, or JSON.`}):(0,P.jsx)(`ul`,{className:`space-y-1`,children:e.map(e=>{let a=t===`custom`&&n===e.id;return(0,P.jsxs)(`li`,{className:m(`flex items-center gap-2 rounded-md border px-2 py-1.5`,a?`border-primary bg-primary/10`:`border-border`),children:[(0,P.jsx)(k,{swatch:e.swatch}),(0,P.jsxs)(`button`,{className:`flex-1 min-w-0 text-left`,onClick:()=>r(e.id),children:[(0,P.jsx)(`span`,{className:`block truncate text-xs text-text`,children:e.name}),(0,P.jsx)(`span`,{className:`block text-[10px] text-text-3`,children:e.mode})]}),a&&(0,P.jsx)(d,{className:`size-4 text-primary shrink-0`}),(0,P.jsx)(`button`,{className:`text-text-3 hover:text-error transition-colors shrink-0`,title:`Delete`,onClick:()=>void i(e.id),children:(0,P.jsx)(s,{className:`size-3.5`})})]},e.id)})}),(0,P.jsx)(H,{open:a,onOpenChange:o})]})}var W=[{value:`default`,label:`Default`},{value:`boxed`,label:`Boxed`},{value:`pill`,label:`Pill`}],G=[{value:`auto`,label:`Auto`},{value:`windows`,label:`Windows`},{value:`macos`,label:`macOS`}];function K({options:e,value:t,onChange:n}){return(0,P.jsx)(`div`,{className:`flex gap-2`,children:e.map(e=>(0,P.jsx)(_,{variant:t===e.value?`default`:`outline`,onClick:()=>n(e.value),className:m(`flex-1 cursor-pointer`,t===e.value&&`ring-2 ring-primary`),children:e.label},e.value))})}function q(){let{theme:e,setTheme:t,tabWrap:n,toggleTabWrap:r,editorTabStyle:i,setEditorTabStyle:a,explorerSkin:o,setExplorerSkin:s}=p(j(e=>({theme:e.themeMode,setTheme:e.setThemeMode,tabWrap:e.tabWrap,toggleTabWrap:e.toggleTabWrap,editorTabStyle:e.editorTabStyle,setEditorTabStyle:e.setEditorTabStyle,explorerSkin:e.explorerSkin,setExplorerSkin:e.setExplorerSkin}))),{wordWrap:l,toggleWordWrap:d,mobileWordWrap:f,toggleMobileWordWrap:g,lspEnabled:v,setLspEnabled:y}=p(j(e=>({wordWrap:e.wordWrap,toggleWordWrap:e.toggleWordWrap,mobileWordWrap:e.mobileWordWrap,toggleMobileWordWrap:e.toggleMobileWordWrap,lspEnabled:e.lspEnabled,setLspEnabled:e.setLspEnabled}))),b=h(),x=M();return(0,P.jsxs)(`div`,{className:`space-y-6`,children:[(0,P.jsxs)(`section`,{className:`space-y-3`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Theme`}),(0,P.jsx)(F,{}),(0,P.jsx)(`div`,{className:`flex gap-2`,children:A.map(n=>{let r=n.icon;return(0,P.jsxs)(_,{variant:e===n.value?`default`:`outline`,onClick:()=>t(n.value),className:m(`flex-1 gap-2 cursor-pointer`,e===n.value&&`ring-2 ring-primary`),children:[(0,P.jsx)(r,{className:`size-4`}),n.label]},n.value)})})]}),(0,P.jsx)(N,{}),(0,P.jsx)(U,{}),(0,P.jsx)(N,{}),(0,P.jsxs)(`section`,{className:`flex items-center justify-between gap-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,P.jsx)(u,{className:`size-4 text-muted-foreground shrink-0`}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium`,children:`Wrap Tabs`}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Stack tabs in rows instead of scrolling`})]})]}),(0,P.jsx)(O,{checked:n,onCheckedChange:r})]}),(0,P.jsxs)(`section`,{className:`flex items-center justify-between gap-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,P.jsx)(u,{className:`size-4 text-muted-foreground shrink-0`}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium`,children:`Word Wrap`}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:b?`Wrap long lines instead of scrolling sideways (this device)`:`Wrap long lines in the editor (Alt+Z)`})]})]}),(0,P.jsx)(O,{checked:b?f:l,onCheckedChange:()=>b?g():d()})]}),(0,P.jsxs)(`section`,{className:`flex items-center justify-between gap-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,P.jsx)(c,{className:`size-4 text-muted-foreground shrink-0`}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium`,children:`Language Server`}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:x?`Off on a touch device — it runs a server process per project`:`Completions, hover, F12, rename and quick fix (this device)`})]})]}),(0,P.jsx)(O,{checked:v&&!x,disabled:x,onCheckedChange:y})]}),(0,P.jsxs)(`section`,{className:`space-y-2`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Tab Style`}),(0,P.jsx)(K,{options:W,value:i,onChange:a})]}),(0,P.jsxs)(`section`,{className:`space-y-2`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Explorer Skin`}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Chrome the OS File Explorer window wears. Auto follows the host platform.`}),(0,P.jsx)(K,{options:G,value:o,onChange:s})]})]})}export{q as AppearanceSettingsSection};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t,S as n}from"./vendor-markdown-QKPNiWEd.js";import{c as r,l as i,s as a,u as o}from"./vendor-ui-BHh12_0v.js";import{Mr as s,Qr as c,Zn as l,qr as u,w as d}from"./icons-CO_II6D-.js";import{s as f}from"./api-client-c8YOpTlT.js";import{t as p}from"./settings-store-DXmQug0m.js";import"./vendor-mermaid-eg2XWIjK.js";import{n as m}from"./utils-btZ8C8-R.js";import"./portal-container-context-NFSuymMu.js";import{n as h}from"./use-is-mobile-CkO33jqU.js";import{n as g,t as _}from"./button-CBehaXpV.js";import{a as v,i as y,n as b,o as x,r as S,t as C}from"./dialog-tzBRkGeW.js";import{t as w}from"./input-CP31LZnN.js";import{n as T,r as E,t as D}from"./resolve-theme-B87m6l4i.js";import{dt as O,j as k,k as A,nn as j,v as M}from"./index-CvUGUp7d.js";import{t as N}from"./separator-D8SNZI6E.js";var P=n();function F(){let e=p(e=>e.themeStyle),t=p(e=>e.themeMode),n=p(e=>e.customThemeId),r=p(e=>e.customThemes),i=p(e=>e.setThemeStyle),a=p(e=>e.setThemeMode),o=D(e,t,r,n);return(0,P.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:T.map(e=>{let t=E[e];if(!t)return null;let n=o.id===e;return(0,P.jsxs)(`button`,{onClick:()=>{i(t.style),a(t.mode)},className:m(`relative flex items-center gap-2 rounded-lg border p-2 text-left transition-colors min-h-11`,n?`border-primary ring-[3px] ring-accent-wash`:`border-border hover:bg-accent/40`),children:[(0,P.jsx)(k,{swatch:t.swatch}),(0,P.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`span`,{className:`block truncate text-xs font-medium text-text`,children:t.name.replace(/ (Dark|Light)$/,``)}),(0,P.jsx)(`span`,{className:`block text-[10px] text-text-3 capitalize`,children:t.mode})]}),n&&(0,P.jsx)(d,{className:`absolute top-1 right-1 size-3.5 text-primary`})]},e)})})}var I=e(t(),1);function L({className:e,orientation:t=`horizontal`,...n}){return(0,P.jsx)(i,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:m(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var R=g(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function z({className:e,variant:t=`default`,...n}){return(0,P.jsx)(r,{"data-slot":`tabs-list`,"data-variant":t,className:m(R({variant:t}),e),...n})}function B({className:e,...t}){return(0,P.jsx)(o,{"data-slot":`tabs-trigger`,className:m(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function V({className:e,...t}){return(0,P.jsx)(a,{"data-slot":`tabs-content`,className:m(`flex-1 outline-none`,e),...t})}function H({open:e,onOpenChange:t}){let n=p(e=>e.importThemeFrom),r=p(e=>e.setCustomTheme),[i,a]=(0,I.useState)(`url`),[o,s]=(0,I.useState)(``),[c,l]=(0,I.useState)(``),[u,d]=(0,I.useState)(``),[m,h]=(0,I.useState)(!1),g=()=>{s(``),l(``),d(``),a(`url`)},T=async()=>{let e=i===`url`?o.trim():c.trim();if(!e){f.error(`Nothing to import`);return}h(!0);try{let a=await n({source:i===`url`?`url`:i===`upload`?`upload`:`json`,value:e,name:u.trim()||void 0});f.success(a.length>1?`Imported ${a.length} themes`:`Imported "${a[0]?.name}"`),a[0]&&r(a[0].id),g(),t(!1)}catch(e){f.error(e.message||`Import failed`)}finally{h(!1)}},E=async e=>{if(e)try{l(await e.text()),d(e.name.replace(/\.json$/i,``))}catch{f.error(`Could not read file`)}};return(0,P.jsx)(C,{open:e,onOpenChange:t,children:(0,P.jsxs)(b,{className:`max-w-md`,children:[(0,P.jsxs)(v,{children:[(0,P.jsx)(x,{children:`Import theme`}),(0,P.jsx)(S,{className:`text-text-3`,children:`Import a VSCode color theme. Single-mode themes apply to both dark and light.`})]}),(0,P.jsxs)(L,{value:i,onValueChange:e=>a(e),children:[(0,P.jsxs)(z,{className:`w-full`,children:[(0,P.jsx)(B,{value:`url`,className:`flex-1`,children:`URL`}),(0,P.jsx)(B,{value:`json`,className:`flex-1`,children:`Paste JSON`}),(0,P.jsx)(B,{value:`upload`,className:`flex-1`,children:`Upload`})]}),(0,P.jsxs)(V,{value:`url`,className:`space-y-2 pt-2`,children:[(0,P.jsx)(w,{placeholder:`https://…/theme.json or Marketplace .vsix URL`,value:o,onChange:e=>s(e.target.value)}),(0,P.jsx)(`p`,{className:`text-[11px] text-text-3`,children:`Only https URLs; private/internal addresses are blocked.`})]}),(0,P.jsx)(V,{value:`json`,className:`pt-2`,children:(0,P.jsx)(`textarea`,{className:`w-full h-40 rounded-md border border-border bg-surface p-2 text-xs font-mono text-text focus:outline-none focus:border-ring`,placeholder:`{ "name": "My Theme", "type": "dark", "colors": { … }, "tokenColors": [ … ] }`,value:c,onChange:e=>l(e.target.value)})}),(0,P.jsxs)(V,{value:`upload`,className:`space-y-2 pt-2`,children:[(0,P.jsx)(`input`,{type:`file`,accept:`.json,application/json`,onChange:e=>E(e.target.files?.[0]),className:`block w-full text-xs text-text-2 file:mr-3 file:rounded file:border file:border-border file:bg-panel-2 file:px-2 file:py-1 file:text-text`}),c&&(0,P.jsxs)(`p`,{className:`text-[11px] text-success`,children:[`File loaded (`,c.length,` chars)`]})]})]}),(0,P.jsx)(w,{placeholder:`Optional name`,value:u,onChange:e=>d(e.target.value)}),(0,P.jsxs)(y,{children:[(0,P.jsx)(_,{variant:`outline`,onClick:()=>t(!1),disabled:m,children:`Cancel`}),(0,P.jsx)(_,{onClick:T,disabled:m,children:m?`Importing…`:`Import`})]})]})})}function U(){let e=p(e=>e.customThemes),t=p(e=>e.themeStyle),n=p(e=>e.customThemeId),r=p(e=>e.setCustomTheme),i=p(e=>e.deleteCustomTheme),[a,o]=(0,I.useState)(!1);return(0,P.jsxs)(`section`,{className:`space-y-2`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:`Imported themes`}),(0,P.jsxs)(_,{size:`sm`,variant:`outline`,className:`h-7 gap-1 text-xs`,onClick:()=>o(!0),children:[(0,P.jsx)(l,{className:`size-3.5`}),` Import`]})]}),e.length===0?(0,P.jsx)(`p`,{className:`text-[11px] text-text-3`,children:`No imported themes yet. Import a VSCode theme from a URL, .vsix, or JSON.`}):(0,P.jsx)(`ul`,{className:`space-y-1`,children:e.map(e=>{let a=t===`custom`&&n===e.id;return(0,P.jsxs)(`li`,{className:m(`flex items-center gap-2 rounded-md border px-2 py-1.5`,a?`border-primary bg-primary/10`:`border-border`),children:[(0,P.jsx)(k,{swatch:e.swatch}),(0,P.jsxs)(`button`,{className:`flex-1 min-w-0 text-left`,onClick:()=>r(e.id),children:[(0,P.jsx)(`span`,{className:`block truncate text-xs text-text`,children:e.name}),(0,P.jsx)(`span`,{className:`block text-[10px] text-text-3`,children:e.mode})]}),a&&(0,P.jsx)(d,{className:`size-4 text-primary shrink-0`}),(0,P.jsx)(`button`,{className:`text-text-3 hover:text-error transition-colors shrink-0`,title:`Delete`,onClick:()=>void i(e.id),children:(0,P.jsx)(s,{className:`size-3.5`})})]},e.id)})}),(0,P.jsx)(H,{open:a,onOpenChange:o})]})}var W=[{value:`default`,label:`Default`},{value:`boxed`,label:`Boxed`},{value:`pill`,label:`Pill`}],G=[{value:`auto`,label:`Auto`},{value:`windows`,label:`Windows`},{value:`macos`,label:`macOS`}];function K({options:e,value:t,onChange:n}){return(0,P.jsx)(`div`,{className:`flex gap-2`,children:e.map(e=>(0,P.jsx)(_,{variant:t===e.value?`default`:`outline`,onClick:()=>n(e.value),className:m(`flex-1 cursor-pointer`,t===e.value&&`ring-2 ring-primary`),children:e.label},e.value))})}function q(){let{theme:e,setTheme:t,tabWrap:n,toggleTabWrap:r,editorTabStyle:i,setEditorTabStyle:a,explorerSkin:o,setExplorerSkin:s}=p(j(e=>({theme:e.themeMode,setTheme:e.setThemeMode,tabWrap:e.tabWrap,toggleTabWrap:e.toggleTabWrap,editorTabStyle:e.editorTabStyle,setEditorTabStyle:e.setEditorTabStyle,explorerSkin:e.explorerSkin,setExplorerSkin:e.setExplorerSkin}))),{wordWrap:l,toggleWordWrap:d,mobileWordWrap:f,toggleMobileWordWrap:g,lspEnabled:v,setLspEnabled:y}=p(j(e=>({wordWrap:e.wordWrap,toggleWordWrap:e.toggleWordWrap,mobileWordWrap:e.mobileWordWrap,toggleMobileWordWrap:e.toggleMobileWordWrap,lspEnabled:e.lspEnabled,setLspEnabled:e.setLspEnabled}))),b=h(),x=M();return(0,P.jsxs)(`div`,{className:`space-y-6`,children:[(0,P.jsxs)(`section`,{className:`space-y-3`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Theme`}),(0,P.jsx)(F,{}),(0,P.jsx)(`div`,{className:`flex gap-2`,children:A.map(n=>{let r=n.icon;return(0,P.jsxs)(_,{variant:e===n.value?`default`:`outline`,onClick:()=>t(n.value),className:m(`flex-1 gap-2 cursor-pointer`,e===n.value&&`ring-2 ring-primary`),children:[(0,P.jsx)(r,{className:`size-4`}),n.label]},n.value)})})]}),(0,P.jsx)(N,{}),(0,P.jsx)(U,{}),(0,P.jsx)(N,{}),(0,P.jsxs)(`section`,{className:`flex items-center justify-between gap-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,P.jsx)(u,{className:`size-4 text-muted-foreground shrink-0`}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium`,children:`Wrap Tabs`}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Stack tabs in rows instead of scrolling`})]})]}),(0,P.jsx)(O,{checked:n,onCheckedChange:r})]}),(0,P.jsxs)(`section`,{className:`flex items-center justify-between gap-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,P.jsx)(u,{className:`size-4 text-muted-foreground shrink-0`}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium`,children:`Word Wrap`}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:b?`Wrap long lines instead of scrolling sideways (this device)`:`Wrap long lines in the editor (Alt+Z)`})]})]}),(0,P.jsx)(O,{checked:b?f:l,onCheckedChange:()=>b?g():d()})]}),(0,P.jsxs)(`section`,{className:`flex items-center justify-between gap-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,P.jsx)(c,{className:`size-4 text-muted-foreground shrink-0`}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium`,children:`Language Server`}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:x?`Off on a touch device — it runs a server process per project`:`Completions, hover, F12, rename and quick fix (this device)`})]})]}),(0,P.jsx)(O,{checked:v&&!x,disabled:x,onCheckedChange:y})]}),(0,P.jsxs)(`section`,{className:`space-y-2`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Tab Style`}),(0,P.jsx)(K,{options:W,value:i,onChange:a})]}),(0,P.jsxs)(`section`,{className:`space-y-2`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Explorer Skin`}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Chrome the OS File Explorer window wears. Auto follows the host platform.`}),(0,P.jsx)(K,{options:G,value:o,onChange:s})]})]})}export{q as AppearanceSettingsSection};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t,S as n}from"./vendor-markdown-QKPNiWEd.js";import"./vendor-ui-BHh12_0v.js";import{Fn as r,bt as i}from"./icons-C9ZwXgel.js";import"./api-client-c8YOpTlT.js";import{t as a}from"./utils-btZ8C8-R.js";import{r as o}from"./media-url-GqzhazJS.js";var s=e(t(),1),c=n();function l({filePath:e,projectName:t}){let[n,l]=(0,s.useState)(!1);return n?(0,c.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-text-secondary`,children:[(0,c.jsx)(i,{className:`size-10 text-text-subtle`}),(0,c.jsx)(`p`,{className:`text-sm`,children:`Failed to load audio.`})]}):(0,c.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-4 p-4 bg-surface`,children:[(0,c.jsx)(r,{className:`size-16 text-text-subtle`}),(0,c.jsx)(`p`,{className:`text-sm text-text-secondary truncate max-w-xs`,children:a(e)}),(0,c.jsx)(`audio`,{src:o(e,t),controls:!0,preload:`metadata`,className:`w-full max-w-md`,onError:()=>l(!0)},e)]})}export{l as AudioPreview};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t,S as n}from"./vendor-markdown-QKPNiWEd.js";import"./vendor-ui-BHh12_0v.js";import{Fn as r,bt as i}from"./icons-CO_II6D-.js";import"./api-client-c8YOpTlT.js";import{t as a}from"./utils-btZ8C8-R.js";import{r as o}from"./media-url-GqzhazJS.js";var s=e(t(),1),c=n();function l({filePath:e,projectName:t}){let[n,l]=(0,s.useState)(!1);return n?(0,c.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-text-secondary`,children:[(0,c.jsx)(i,{className:`size-10 text-text-subtle`}),(0,c.jsx)(`p`,{className:`text-sm`,children:`Failed to load audio.`})]}):(0,c.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-4 p-4 bg-surface`,children:[(0,c.jsx)(r,{className:`size-16 text-text-subtle`}),(0,c.jsx)(`p`,{className:`text-sm text-text-secondary truncate max-w-xs`,children:a(e)}),(0,c.jsx)(`audio`,{src:o(e,t),controls:!0,preload:`metadata`,className:`w-full max-w-md`,onError:()=>l(!0)},e)]})}export{l as AudioPreview};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t,S as n}from"./vendor-markdown-QKPNiWEd.js";import"./vendor-ui-BHh12_0v.js";import{O as r,ir as i,j as a,on as o,u as s,un as c,vt as l,w as u}from"./icons-C9ZwXgel.js";import{n as d}from"./api-client-c8YOpTlT.js";import"./settings-store-DXmQug0m.js";import"./vendor-mermaid-eg2XWIjK.js";import"./portal-container-context-NFSuymMu.js";import"./project-store-C5gJXkvb.js";import"./project-framework-store-XxFXcUpb.js";import{n as f}from"./use-is-mobile-CkO33jqU.js";import"./git-repo-store-DFTJ5ngK.js";import{t as p}from"./button-CBehaXpV.js";import{t as m}from"./file-icons-BlOxPo3P.js";import{t as h}from"./mobile-bottom-sheet-Cf4kV1hS.js";import"./use-visual-viewport-C307OVeV.js";import{t as g}from"./scroll-area-xAtds1T-.js";import{Wt as ee,_t as te,gt as ne,ht as _,mt as re,vt as ie}from"./index-BVKT5UCu.js";import"./use-monaco-theme-CNEk66US.js";import"./use-inline-blame-BSb807l9.js";import{DiffViewer as ae}from"./diff-viewer-ciBkExM7.js";var v=e(t(),1),y=`ppm:branch-review`,b=`${y}:recent`,x=20;function oe(e,t,n){return`${y}:${e}:${t}:${n}`}function S(e,t){return e[t.path]===t.blob}function se(e,t){let n={...e};return S(e,t)?delete n[t.path]:n[t.path]=t.blob,n}function C(e,t,n){if(!n)return{};let r={...e};for(let e of t)r[e.path]=e.blob;return r}function w(e,t){return t.reduce((t,n)=>t+(S(e,n)?1:0),0)}function T(e,t){let n=new Set(t.map(e=>e.path)),r={};for(let[t,i]of Object.entries(e))n.has(t)&&(r[t]=i);return r}function E(e){return e.find(e=>!e.binary)??e[0]??null}function ce(e,t,n){if(t.length===0)return null;let r=n?t.findIndex(e=>e.path===n)+1:0;for(let n=0;n<t.length;n++){let i=t[(r+n)%t.length];if(i&&!S(e,i))return i}return null}function le(e){try{let t=localStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);if(!n||typeof n!=`object`||Array.isArray(n))return{};let r={};for(let[e,t]of Object.entries(n))typeof t==`string`&&(r[e]=t);return r}catch{return{}}}function D(e,t,n=x){let r=[t,...e.filter(e=>e!==t)];return{recent:r.slice(0,n),evicted:r.slice(n)}}function O(){try{let e=JSON.parse(localStorage.getItem(b)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}catch{return[]}}function k(e,t){try{if(Object.keys(t).length===0){localStorage.removeItem(e);let t=O().filter(t=>t!==e);localStorage.setItem(b,JSON.stringify(t));return}localStorage.setItem(e,JSON.stringify(t));let{recent:n,evicted:r}=D(O(),e);for(let e of r)localStorage.removeItem(e);localStorage.setItem(b,JSON.stringify(n))}catch{}}var A=n(),j={M:`text-warning`,A:`text-success`,D:`text-error`,R:`text-primary`,C:`text-accent-2`,T:`text-text-3`};function M({children:e}){return(0,A.jsx)(`span`,{dir:`rtl`,className:`truncate text-left min-w-0 flex-1`,children:(0,A.jsx)(`bdi`,{children:e})})}function N(e){let{node:t,depth:n,byPath:i,reviewed:o,selectedPath:s,collapsed:c,onToggleCollapse:l,onSelect:d,onToggleReviewed:f}=e,p=t.file?i.get(t.fullPath):void 0;if(!p){let i=c.has(t.fullPath);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`button`,{type:`button`,"data-testid":`branch-review-folder`,className:`w-full flex items-center gap-1 px-2 py-1 text-xs min-h-11 md:min-h-0 hover:bg-surface-hover text-left`,style:{paddingLeft:n*14+8},onClick:()=>l(t.fullPath),children:[i?(0,A.jsx)(a,{className:`size-3 shrink-0`}):(0,A.jsx)(r,{className:`size-3 shrink-0`}),(0,A.jsx)(`span`,{className:`truncate text-text-2`,children:t.name})]}),!i&&t.children.map(t=>(0,A.jsx)(N,{...e,node:t,depth:n+1},t.fullPath))]})}let h=S(o,p),g=s===p.path;return(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 pr-2 py-1 text-xs cursor-pointer border-l-2 min-h-11 md:min-h-0 hover:bg-surface-hover ${g?`bg-primary/10 border-primary`:`border-transparent`}`,style:{paddingLeft:n*14+6},onClick:()=>d(p.path),"aria-current":g?`true`:void 0,"data-testid":`branch-review-file`,"data-path":p.path,"data-selected":g?`true`:`false`,"data-reviewed":h?`true`:`false`,children:[(0,A.jsx)(`button`,{type:`button`,"aria-label":h?`Mark ${p.path} unreviewed`:`Mark ${p.path} reviewed`,"data-testid":`branch-review-check`,className:`size-11 md:size-4 shrink-0 flex items-center justify-center`,onClick:e=>{e.stopPropagation(),f(p)},children:(0,A.jsx)(`span`,{"data-testid":`branch-review-check-box`,className:`size-4 rounded border flex items-center justify-center ${h?`bg-primary border-primary text-primary-foreground`:`border-border`}`,children:h&&(0,A.jsx)(u,{className:`size-3`})})}),(0,A.jsx)(m,{name:t.name,className:`size-3.5 shrink-0`}),(0,A.jsx)(M,{children:t.name}),(0,A.jsx)(`span`,{className:`shrink-0 font-mono ${j[p.status]}`,children:p.status}),p.binary?(0,A.jsx)(`span`,{className:`shrink-0 text-text-3 italic`,children:`bin`}):(0,A.jsxs)(`span`,{className:`shrink-0 tabular-nums text-[10px]`,children:[(0,A.jsxs)(`span`,{className:`text-success`,children:[`+`,p.additions]}),` `,(0,A.jsxs)(`span`,{className:`text-error`,children:[`-`,p.deletions]})]})]})}function ue(e,t){let n=e.filter(e=>!e.remote&&e.name!==t);return n.find(e=>e.name===`main`)?.name??n.find(e=>e.name===`master`)?.name??n[0]?.name??``}function P({metadata:e}){let t=e?.projectName,n=ee(t),r=f(),[a,u]=(0,v.useState)([]),[m,y]=(0,v.useState)(``),[b,x]=(0,v.useState)(``),[S,D]=(0,v.useState)(null),[O,j]=(0,v.useState)(null),[P,F]=(0,v.useState)({}),[de,I]=(0,v.useState)(new Set),[L,R]=(0,v.useState)(!1),[z,B]=(0,v.useState)(null),[V,H]=(0,v.useState)(!1);(0,v.useEffect)(()=>{if(!t||!n.repo)return;let e=!1;return d.get(n.gitUrl(`/branches`)).then(t=>{if(e)return;u(t);let n=t.find(e=>e.current)?.name;x(e=>e||n||``),y(e=>e||ue(t,n))}).catch(t=>!e&&B(t instanceof Error?t.message:`Could not list branches`)),()=>{e=!0}},[t,n]);let U=(0,v.useRef)(null),W=(0,v.useCallback)(async()=>{if(!t||!n.repo||!m||!b)return;U.current?.abort();let e=new AbortController;U.current=e,R(!0),B(null);try{let t=new URLSearchParams({base:m,head:b}),r=await d.get(n.gitUrl(`/branch-diff?${t}`),{signal:e.signal});if(e.signal.aborted)return;D(r),j(e=>e&&r.files.some(t=>t.path===e)?e:E(r.files)?.path??null)}catch(t){if(e.signal.aborted)return;D(null),B(t instanceof Error?t.message:`Could not compare these branches`)}finally{e.signal.aborted||R(!1)}},[t,n,m,b]);(0,v.useEffect)(()=>(W(),()=>U.current?.abort()),[W]);let G=t&&m&&b?oe(t,m,b):null;(0,v.useEffect)(()=>{I(new Set)},[G]),(0,v.useEffect)(()=>{F(G?le(G):{})},[G]);let K=S&&S.base===m&&S.head===b?S:null;(0,v.useEffect)(()=>{!G||!K||F(e=>{let t=T(e,K.files);return Object.keys(t).length!==Object.keys(e).length&&k(G,t),t})},[G,K]);let q=(0,v.useCallback)(e=>{F(e),G&&k(G,e)},[G]),J=K?.files??[],Y=(0,v.useMemo)(()=>new Map(J.map(e=>[e.path,e])),[J]),X=(0,v.useMemo)(()=>w(P,J),[P,J]),fe=(0,v.useMemo)(()=>_(re(J.map(e=>({path:e.path,status:e.status===`T`?`M`:e.status})))),[J]),Z=O?Y.get(O)??null:null,Q=(0,v.useCallback)(()=>{let e=ce(P,J,O);e&&(j(e.path),H(!1))},[P,J,O]);if(n.noRepo)return(0,A.jsx)(ne,{onReload:n.reload});if(n.needsPick)return(0,A.jsx)(ie,{repos:n.repos,onChoose:n.choose});let $=(0,A.jsx)(g,{className:`h-full`,children:(0,A.jsxs)(`div`,{className:`py-1`,children:[J.length===0&&!L&&(0,A.jsx)(`div`,{className:`px-3 py-6 text-center text-xs text-text-3`,children:z?`—`:`These branches have identical trees.`}),fe.map(e=>(0,A.jsx)(N,{node:e,depth:0,byPath:Y,reviewed:P,selectedPath:O,collapsed:de,onToggleCollapse:e=>I(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),onSelect:e=>{j(e),H(!1)},onToggleReviewed:e=>q(se(P,e))},e.fullPath)),!!K?.omitted&&(0,A.jsxs)(`div`,{className:`px-3 py-3 text-center text-xs text-text-3`,children:[K.omitted.toLocaleString(),` more `,K.omitted===1?`file`:`files`,` not listed.`]})]})});return(0,A.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden bg-bg`,children:[n.isNested&&n.repo&&(0,A.jsx)(te,{repo:n.repo,repos:n.repos,onChoose:n.choose}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5 border-b border-border shrink-0 flex-wrap`,children:[(0,A.jsx)(`select`,{value:m,onChange:e=>y(e.target.value),"aria-label":`Base branch`,"data-testid":`branch-review-base`,className:`h-7 max-w-[38%] rounded-md border border-border bg-panel px-2 text-xs min-w-0`,children:a.map(e=>(0,A.jsx)(`option`,{value:e.name,children:e.name},e.name))}),(0,A.jsx)(s,{className:`size-3.5 text-text-3 shrink-0`}),(0,A.jsx)(`select`,{value:b,onChange:e=>x(e.target.value),"aria-label":`Branch to review`,"data-testid":`branch-review-head`,className:`h-7 max-w-[38%] rounded-md border border-border bg-panel px-2 text-xs min-w-0`,children:a.map(e=>(0,A.jsx)(`option`,{value:e.name,children:e.name},e.name))}),(0,A.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,A.jsxs)(`span`,{className:`text-xs text-text-2 tabular-nums`,"data-testid":`branch-review-progress`,children:[X,`/`,J.length,` reviewed`]}),(0,A.jsx)(p,{variant:`ghost`,size:`icon-xs`,title:X===J.length&&J.length>0?`Clear all`:`Mark all reviewed`,disabled:J.length===0,onClick:()=>q(C(P,J,X!==J.length)),children:(0,A.jsx)(o,{className:`size-3.5`})}),(0,A.jsx)(p,{variant:`ghost`,size:`icon-xs`,title:`Reload`,onClick:()=>void W(),children:(0,A.jsx)(i,{className:L?`animate-spin`:``})})]})]}),z&&(0,A.jsx)(`div`,{className:`px-3 py-1.5 text-xs text-destructive bg-destructive/10 shrink-0`,children:z}),(0,A.jsxs)(`div`,{className:`flex-1 flex min-h-0`,children:[!r&&(0,A.jsx)(`div`,{className:`w-72 shrink-0 border-r border-border flex flex-col min-h-0`,children:$}),(0,A.jsx)(`div`,{className:`flex-1 min-w-0 flex flex-col`,children:Z?(0,A.jsx)(ae,{metadata:{filePath:n.projectFile(Z.path),projectName:t,ref1:K?.mergeBase,ref2:K?.headCommit}},`${Z.path}:${K?.mergeBase}:${K?.headCommit}`):(0,A.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-xs text-text-3`,children:L?(0,A.jsx)(c,{className:`size-4 animate-spin`}):`Nothing to review.`})})]}),r&&(0,A.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border p-2 shrink-0`,children:[(0,A.jsxs)(p,{variant:`secondary`,size:`sm`,className:`flex-1 min-h-11`,onClick:()=>H(!0),children:[(0,A.jsx)(l,{className:`size-4`}),J.length,` files`]}),(0,A.jsx)(p,{variant:`secondary`,size:`sm`,className:`flex-1 min-h-11`,onClick:Q,children:`Next unreviewed`})]}),r&&(0,A.jsx)(h,{open:V,onClose:()=>H(!1),children:(0,A.jsx)(`div`,{className:`max-h-[70vh] overflow-hidden flex flex-col`,children:$})}),!r&&Z&&(0,A.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border px-2 py-1 shrink-0`,children:[(0,A.jsx)(M,{children:Z.path}),(0,A.jsx)(p,{variant:`ghost`,size:`xs`,onClick:Q,children:`Next unreviewed`})]})]})}export{P as BranchReviewTab};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{C as t,S as n}from"./vendor-markdown-QKPNiWEd.js";import"./vendor-ui-BHh12_0v.js";import{O as r,ir as i,j as a,on as o,u as s,un as c,vt as l,w as u}from"./icons-CO_II6D-.js";import{n as d}from"./api-client-c8YOpTlT.js";import"./settings-store-DXmQug0m.js";import"./vendor-mermaid-eg2XWIjK.js";import"./portal-container-context-NFSuymMu.js";import"./project-store-C5gJXkvb.js";import"./project-framework-store-XxFXcUpb.js";import{n as f}from"./use-is-mobile-CkO33jqU.js";import"./git-repo-store-DFTJ5ngK.js";import{t as p}from"./button-CBehaXpV.js";import{t as m}from"./file-icons-BlOxPo3P.js";import{t as h}from"./mobile-bottom-sheet-Cf4kV1hS.js";import"./use-visual-viewport-C307OVeV.js";import{t as g}from"./scroll-area-xAtds1T-.js";import{Wt as ee,_t as te,gt as ne,ht as _,mt as re,vt as ie}from"./index-CvUGUp7d.js";import"./use-monaco-theme-BVatH9yZ.js";import"./use-inline-blame--fS-pzzX.js";import{DiffViewer as ae}from"./diff-viewer-B_K7VQup.js";var v=e(t(),1),y=`ppm:branch-review`,b=`${y}:recent`,x=20;function oe(e,t,n){return`${y}:${e}:${t}:${n}`}function S(e,t){return e[t.path]===t.blob}function se(e,t){let n={...e};return S(e,t)?delete n[t.path]:n[t.path]=t.blob,n}function C(e,t,n){if(!n)return{};let r={...e};for(let e of t)r[e.path]=e.blob;return r}function w(e,t){return t.reduce((t,n)=>t+(S(e,n)?1:0),0)}function T(e,t){let n=new Set(t.map(e=>e.path)),r={};for(let[t,i]of Object.entries(e))n.has(t)&&(r[t]=i);return r}function E(e){return e.find(e=>!e.binary)??e[0]??null}function ce(e,t,n){if(t.length===0)return null;let r=n?t.findIndex(e=>e.path===n)+1:0;for(let n=0;n<t.length;n++){let i=t[(r+n)%t.length];if(i&&!S(e,i))return i}return null}function le(e){try{let t=localStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);if(!n||typeof n!=`object`||Array.isArray(n))return{};let r={};for(let[e,t]of Object.entries(n))typeof t==`string`&&(r[e]=t);return r}catch{return{}}}function D(e,t,n=x){let r=[t,...e.filter(e=>e!==t)];return{recent:r.slice(0,n),evicted:r.slice(n)}}function O(){try{let e=JSON.parse(localStorage.getItem(b)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}catch{return[]}}function k(e,t){try{if(Object.keys(t).length===0){localStorage.removeItem(e);let t=O().filter(t=>t!==e);localStorage.setItem(b,JSON.stringify(t));return}localStorage.setItem(e,JSON.stringify(t));let{recent:n,evicted:r}=D(O(),e);for(let e of r)localStorage.removeItem(e);localStorage.setItem(b,JSON.stringify(n))}catch{}}var A=n(),j={M:`text-warning`,A:`text-success`,D:`text-error`,R:`text-primary`,C:`text-accent-2`,T:`text-text-3`};function M({children:e}){return(0,A.jsx)(`span`,{dir:`rtl`,className:`truncate text-left min-w-0 flex-1`,children:(0,A.jsx)(`bdi`,{children:e})})}function N(e){let{node:t,depth:n,byPath:i,reviewed:o,selectedPath:s,collapsed:c,onToggleCollapse:l,onSelect:d,onToggleReviewed:f}=e,p=t.file?i.get(t.fullPath):void 0;if(!p){let i=c.has(t.fullPath);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`button`,{type:`button`,"data-testid":`branch-review-folder`,className:`w-full flex items-center gap-1 px-2 py-1 text-xs min-h-11 md:min-h-0 hover:bg-surface-hover text-left`,style:{paddingLeft:n*14+8},onClick:()=>l(t.fullPath),children:[i?(0,A.jsx)(a,{className:`size-3 shrink-0`}):(0,A.jsx)(r,{className:`size-3 shrink-0`}),(0,A.jsx)(`span`,{className:`truncate text-text-2`,children:t.name})]}),!i&&t.children.map(t=>(0,A.jsx)(N,{...e,node:t,depth:n+1},t.fullPath))]})}let h=S(o,p),g=s===p.path;return(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 pr-2 py-1 text-xs cursor-pointer border-l-2 min-h-11 md:min-h-0 hover:bg-surface-hover ${g?`bg-primary/10 border-primary`:`border-transparent`}`,style:{paddingLeft:n*14+6},onClick:()=>d(p.path),"aria-current":g?`true`:void 0,"data-testid":`branch-review-file`,"data-path":p.path,"data-selected":g?`true`:`false`,"data-reviewed":h?`true`:`false`,children:[(0,A.jsx)(`button`,{type:`button`,"aria-label":h?`Mark ${p.path} unreviewed`:`Mark ${p.path} reviewed`,"data-testid":`branch-review-check`,className:`size-11 md:size-4 shrink-0 flex items-center justify-center`,onClick:e=>{e.stopPropagation(),f(p)},children:(0,A.jsx)(`span`,{"data-testid":`branch-review-check-box`,className:`size-4 rounded border flex items-center justify-center ${h?`bg-primary border-primary text-primary-foreground`:`border-border`}`,children:h&&(0,A.jsx)(u,{className:`size-3`})})}),(0,A.jsx)(m,{name:t.name,className:`size-3.5 shrink-0`}),(0,A.jsx)(M,{children:t.name}),(0,A.jsx)(`span`,{className:`shrink-0 font-mono ${j[p.status]}`,children:p.status}),p.binary?(0,A.jsx)(`span`,{className:`shrink-0 text-text-3 italic`,children:`bin`}):(0,A.jsxs)(`span`,{className:`shrink-0 tabular-nums text-[10px]`,children:[(0,A.jsxs)(`span`,{className:`text-success`,children:[`+`,p.additions]}),` `,(0,A.jsxs)(`span`,{className:`text-error`,children:[`-`,p.deletions]})]})]})}function ue(e,t){let n=e.filter(e=>!e.remote&&e.name!==t);return n.find(e=>e.name===`main`)?.name??n.find(e=>e.name===`master`)?.name??n[0]?.name??``}function P({metadata:e}){let t=e?.projectName,n=ee(t),r=f(),[a,u]=(0,v.useState)([]),[m,y]=(0,v.useState)(``),[b,x]=(0,v.useState)(``),[S,D]=(0,v.useState)(null),[O,j]=(0,v.useState)(null),[P,F]=(0,v.useState)({}),[de,I]=(0,v.useState)(new Set),[L,R]=(0,v.useState)(!1),[z,B]=(0,v.useState)(null),[V,H]=(0,v.useState)(!1);(0,v.useEffect)(()=>{if(!t||!n.repo)return;let e=!1;return d.get(n.gitUrl(`/branches`)).then(t=>{if(e)return;u(t);let n=t.find(e=>e.current)?.name;x(e=>e||n||``),y(e=>e||ue(t,n))}).catch(t=>!e&&B(t instanceof Error?t.message:`Could not list branches`)),()=>{e=!0}},[t,n]);let U=(0,v.useRef)(null),W=(0,v.useCallback)(async()=>{if(!t||!n.repo||!m||!b)return;U.current?.abort();let e=new AbortController;U.current=e,R(!0),B(null);try{let t=new URLSearchParams({base:m,head:b}),r=await d.get(n.gitUrl(`/branch-diff?${t}`),{signal:e.signal});if(e.signal.aborted)return;D(r),j(e=>e&&r.files.some(t=>t.path===e)?e:E(r.files)?.path??null)}catch(t){if(e.signal.aborted)return;D(null),B(t instanceof Error?t.message:`Could not compare these branches`)}finally{e.signal.aborted||R(!1)}},[t,n,m,b]);(0,v.useEffect)(()=>(W(),()=>U.current?.abort()),[W]);let G=t&&m&&b?oe(t,m,b):null;(0,v.useEffect)(()=>{I(new Set)},[G]),(0,v.useEffect)(()=>{F(G?le(G):{})},[G]);let K=S&&S.base===m&&S.head===b?S:null;(0,v.useEffect)(()=>{!G||!K||F(e=>{let t=T(e,K.files);return Object.keys(t).length!==Object.keys(e).length&&k(G,t),t})},[G,K]);let q=(0,v.useCallback)(e=>{F(e),G&&k(G,e)},[G]),J=K?.files??[],Y=(0,v.useMemo)(()=>new Map(J.map(e=>[e.path,e])),[J]),X=(0,v.useMemo)(()=>w(P,J),[P,J]),fe=(0,v.useMemo)(()=>_(re(J.map(e=>({path:e.path,status:e.status===`T`?`M`:e.status})))),[J]),Z=O?Y.get(O)??null:null,Q=(0,v.useCallback)(()=>{let e=ce(P,J,O);e&&(j(e.path),H(!1))},[P,J,O]);if(n.noRepo)return(0,A.jsx)(ne,{onReload:n.reload});if(n.needsPick)return(0,A.jsx)(ie,{repos:n.repos,onChoose:n.choose});let $=(0,A.jsx)(g,{className:`h-full`,children:(0,A.jsxs)(`div`,{className:`py-1`,children:[J.length===0&&!L&&(0,A.jsx)(`div`,{className:`px-3 py-6 text-center text-xs text-text-3`,children:z?`—`:`These branches have identical trees.`}),fe.map(e=>(0,A.jsx)(N,{node:e,depth:0,byPath:Y,reviewed:P,selectedPath:O,collapsed:de,onToggleCollapse:e=>I(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),onSelect:e=>{j(e),H(!1)},onToggleReviewed:e=>q(se(P,e))},e.fullPath)),!!K?.omitted&&(0,A.jsxs)(`div`,{className:`px-3 py-3 text-center text-xs text-text-3`,children:[K.omitted.toLocaleString(),` more `,K.omitted===1?`file`:`files`,` not listed.`]})]})});return(0,A.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden bg-bg`,children:[n.isNested&&n.repo&&(0,A.jsx)(te,{repo:n.repo,repos:n.repos,onChoose:n.choose}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5 border-b border-border shrink-0 flex-wrap`,children:[(0,A.jsx)(`select`,{value:m,onChange:e=>y(e.target.value),"aria-label":`Base branch`,"data-testid":`branch-review-base`,className:`h-7 max-w-[38%] rounded-md border border-border bg-panel px-2 text-xs min-w-0`,children:a.map(e=>(0,A.jsx)(`option`,{value:e.name,children:e.name},e.name))}),(0,A.jsx)(s,{className:`size-3.5 text-text-3 shrink-0`}),(0,A.jsx)(`select`,{value:b,onChange:e=>x(e.target.value),"aria-label":`Branch to review`,"data-testid":`branch-review-head`,className:`h-7 max-w-[38%] rounded-md border border-border bg-panel px-2 text-xs min-w-0`,children:a.map(e=>(0,A.jsx)(`option`,{value:e.name,children:e.name},e.name))}),(0,A.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,A.jsxs)(`span`,{className:`text-xs text-text-2 tabular-nums`,"data-testid":`branch-review-progress`,children:[X,`/`,J.length,` reviewed`]}),(0,A.jsx)(p,{variant:`ghost`,size:`icon-xs`,title:X===J.length&&J.length>0?`Clear all`:`Mark all reviewed`,disabled:J.length===0,onClick:()=>q(C(P,J,X!==J.length)),children:(0,A.jsx)(o,{className:`size-3.5`})}),(0,A.jsx)(p,{variant:`ghost`,size:`icon-xs`,title:`Reload`,onClick:()=>void W(),children:(0,A.jsx)(i,{className:L?`animate-spin`:``})})]})]}),z&&(0,A.jsx)(`div`,{className:`px-3 py-1.5 text-xs text-destructive bg-destructive/10 shrink-0`,children:z}),(0,A.jsxs)(`div`,{className:`flex-1 flex min-h-0`,children:[!r&&(0,A.jsx)(`div`,{className:`w-72 shrink-0 border-r border-border flex flex-col min-h-0`,children:$}),(0,A.jsx)(`div`,{className:`flex-1 min-w-0 flex flex-col`,children:Z?(0,A.jsx)(ae,{metadata:{filePath:n.projectFile(Z.path),projectName:t,ref1:K?.mergeBase,ref2:K?.headCommit}},`${Z.path}:${K?.mergeBase}:${K?.headCommit}`):(0,A.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-xs text-text-3`,children:L?(0,A.jsx)(c,{className:`size-4 animate-spin`}):`Nothing to review.`})})]}),r&&(0,A.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border p-2 shrink-0`,children:[(0,A.jsxs)(p,{variant:`secondary`,size:`sm`,className:`flex-1 min-h-11`,onClick:()=>H(!0),children:[(0,A.jsx)(l,{className:`size-4`}),J.length,` files`]}),(0,A.jsx)(p,{variant:`secondary`,size:`sm`,className:`flex-1 min-h-11`,onClick:Q,children:`Next unreviewed`})]}),r&&(0,A.jsx)(h,{open:V,onClose:()=>H(!1),children:(0,A.jsx)(`div`,{className:`max-h-[70vh] overflow-hidden flex flex-col`,children:$})}),!r&&Z&&(0,A.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border px-2 py-1 shrink-0`,children:[(0,A.jsx)(M,{children:Z.path}),(0,A.jsx)(p,{variant:`ghost`,size:`xs`,onClick:Q,children:`Next unreviewed`})]})]})}export{P as BranchReviewTab};
@@ -0,0 +1 @@
1
+ import"./vendor-markdown-QKPNiWEd.js";import"./vendor-ui-BHh12_0v.js";import"./icons-CO_II6D-.js";import{t as e}from"./chat-tab-DeISufm0.js";import"./api-client-c8YOpTlT.js";import"./settings-store-DXmQug0m.js";import"./vendor-mermaid-eg2XWIjK.js";import"./portal-container-context-NFSuymMu.js";import"./panel-store-BUQ-CPsd.js";import"./window-store-B4cbZ5rr.js";import"./project-store-C5gJXkvb.js";import"./project-framework-store-XxFXcUpb.js";import"./tab-store-DqeaGhhE.js";import"./context-menu-CjYTq8DI.js";import"./file-store-CTlJqj2m.js";import"./use-is-mobile-CkO33jqU.js";import"./onboarding-quick-orientation-CT4PylG0.js";import"./button-CBehaXpV.js";import"./dialog-tzBRkGeW.js";import"./mobile-bottom-sheet-Cf4kV1hS.js";import"./use-visual-viewport-C307OVeV.js";import"./input-CP31LZnN.js";import"./ws-auth-B_y5rMfZ.js";import"./use-websocket-C1mloX0R.js";import"./api-settings-0s1Rfgcu.js";import"./tool-cards-DsQdMorI.js";import"./use-blob-url-mZfScQdx.js";import"./libesm-DMnQ3WlF.js";import"./onboarding-entry-CcvySZ_l.js";import"./use-open-team-member-DHzZiJZw.js";import"./send-to-chat-TSKk3fI9.js";import"./ai-settings-section-B7Un4KiW.js";import"./codex-sign-in-again-dialog-DcIOYhAe.js";export{e as ChatTab};