@hienlh/ppm 0.23.16 → 0.23.18

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 (448) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/assets/skills/ppm/SKILL.md +1 -1
  3. package/assets/skills/ppm/references/cli-reference.md +4 -4
  4. package/assets/skills/ppm/references/http-api.md +1 -1
  5. package/dist/web/assets/{accounts-settings-section-DhzuFkDO.js → accounts-settings-section-BES4EFGQ.js} +1 -1
  6. package/dist/web/assets/accounts-settings-section-BES4EFGQ.js.br +0 -0
  7. package/dist/web/assets/accounts-settings-section-BES4EFGQ.js.gz +0 -0
  8. package/dist/web/assets/{agent-session-sheet-CZAmOwSU.js → agent-session-sheet-BlZmcb40.js} +2 -2
  9. package/dist/web/assets/agent-session-sheet-BlZmcb40.js.br +0 -0
  10. package/dist/web/assets/agent-session-sheet-BlZmcb40.js.gz +0 -0
  11. package/dist/web/assets/{agent-session-window-content-CwokWtJq.js → agent-session-window-content-zCzFZ0XT.js} +1 -1
  12. package/dist/web/assets/agent-session-window-content-zCzFZ0XT.js.br +0 -0
  13. package/dist/web/assets/agent-session-window-content-zCzFZ0XT.js.gz +0 -0
  14. package/dist/web/assets/{ai-resource-editor-CT1JCaRQ.js → ai-resource-editor-Dh8sQhL2.js} +1 -1
  15. package/dist/web/assets/ai-resource-editor-Dh8sQhL2.js.br +0 -0
  16. package/dist/web/assets/ai-resource-editor-Dh8sQhL2.js.gz +0 -0
  17. package/dist/web/assets/{ai-settings-section-Ct9-lNqA.js → ai-settings-section-C6NKrktb.js} +1 -1
  18. package/dist/web/assets/ai-settings-section-C6NKrktb.js.br +0 -0
  19. package/dist/web/assets/ai-settings-section-C6NKrktb.js.gz +0 -0
  20. package/dist/web/assets/{ai-settings-section-CBlS1FZK.js → ai-settings-section-Ck_0ArV1.js} +1 -1
  21. package/dist/web/assets/{android-tab-CUPQN2M4.js → android-tab-BLxZKtMP.js} +1 -1
  22. package/dist/web/assets/android-tab-BLxZKtMP.js.br +0 -0
  23. package/dist/web/assets/android-tab-BLxZKtMP.js.gz +0 -0
  24. package/dist/web/assets/{appearance-settings-section-DpYcNqXH.js → appearance-settings-section-DFJdBUZ8.js} +1 -1
  25. package/dist/web/assets/appearance-settings-section-DFJdBUZ8.js.br +0 -0
  26. package/dist/web/assets/appearance-settings-section-DFJdBUZ8.js.gz +0 -0
  27. package/dist/web/assets/{apps-panel-BqF_CkKy.js → apps-panel-C2dyMFVy.js} +1 -1
  28. package/dist/web/assets/apps-panel-C2dyMFVy.js.br +0 -0
  29. package/dist/web/assets/apps-panel-C2dyMFVy.js.gz +0 -0
  30. package/dist/web/assets/{branch-review-tab-BEZqFSlw.js → branch-review-tab-BIpjOgOQ.js} +1 -1
  31. package/dist/web/assets/branch-review-tab-BIpjOgOQ.js.br +0 -0
  32. package/dist/web/assets/branch-review-tab-BIpjOgOQ.js.gz +0 -0
  33. package/dist/web/assets/{chat-tab-N1B-Yv0P.js → chat-tab-CADhIdsz.js} +1 -1
  34. package/dist/web/assets/chat-tab-CADhIdsz.js.br +2 -0
  35. package/dist/web/assets/chat-tab-CADhIdsz.js.gz +0 -0
  36. package/dist/web/assets/chat-tab-WbP7BIUp.js +19 -0
  37. package/dist/web/assets/chat-tab-WbP7BIUp.js.br +0 -0
  38. package/dist/web/assets/chat-tab-WbP7BIUp.js.gz +0 -0
  39. package/dist/web/assets/{code-editor-d1CXl2WL.js → code-editor-BEjBAz0q.js} +4 -4
  40. package/dist/web/assets/code-editor-BEjBAz0q.js.br +0 -0
  41. package/dist/web/assets/code-editor-BEjBAz0q.js.gz +0 -0
  42. package/dist/web/assets/{codex-reset-credit-button-CwSSBK6P.js → codex-reset-credit-button-Qths4oQl.js} +1 -1
  43. package/dist/web/assets/codex-reset-credit-button-Qths4oQl.js.br +0 -0
  44. package/dist/web/assets/codex-reset-credit-button-Qths4oQl.js.gz +0 -0
  45. package/dist/web/assets/{conflict-editor-BucKz-uE.js → conflict-editor-DwFgcGGr.js} +1 -1
  46. package/dist/web/assets/conflict-editor-DwFgcGGr.js.br +0 -0
  47. package/dist/web/assets/conflict-editor-DwFgcGGr.js.gz +0 -0
  48. package/dist/web/assets/{connection-form-tab-DIc25Bko.js → connection-form-tab-DJ3Lxpzd.js} +1 -1
  49. package/dist/web/assets/connection-form-tab-DJ3Lxpzd.js.br +0 -0
  50. package/dist/web/assets/connection-form-tab-DJ3Lxpzd.js.gz +0 -0
  51. package/dist/web/assets/{csv-preview-CqDaGV5N.js → csv-preview-BMF0HuuN.js} +1 -1
  52. package/dist/web/assets/csv-preview-BMF0HuuN.js.br +0 -0
  53. package/dist/web/assets/csv-preview-BMF0HuuN.js.gz +0 -0
  54. package/dist/web/assets/{db-tab-parts-lp8ROGQB.js → db-tab-parts-BbNfuvwC.js} +1 -1
  55. package/dist/web/assets/db-tab-parts-BbNfuvwC.js.br +0 -0
  56. package/dist/web/assets/db-tab-parts-BbNfuvwC.js.gz +0 -0
  57. package/dist/web/assets/{design-settings-section-DxWEBH1L.js → design-settings-section-BVcBTBdz.js} +1 -1
  58. package/dist/web/assets/design-settings-section-BVcBTBdz.js.br +0 -0
  59. package/dist/web/assets/design-settings-section-BVcBTBdz.js.gz +0 -0
  60. package/dist/web/assets/{design-tab-Cl0CMAUx.js → design-tab-msL92Mgr.js} +1 -1
  61. package/dist/web/assets/design-tab-msL92Mgr.js.br +0 -0
  62. package/dist/web/assets/design-tab-msL92Mgr.js.gz +0 -0
  63. package/dist/web/assets/{designs-sidebar-panel-aCr-EGfj.js → designs-sidebar-panel-hLIuDsDd.js} +1 -1
  64. package/dist/web/assets/designs-sidebar-panel-hLIuDsDd.js.br +0 -0
  65. package/dist/web/assets/designs-sidebar-panel-hLIuDsDd.js.gz +0 -0
  66. package/dist/web/assets/{diff-viewer-XyJgWKwe.js → diff-viewer-BLYGfIik.js} +1 -1
  67. package/dist/web/assets/diff-viewer-BLYGfIik.js.br +0 -0
  68. package/dist/web/assets/diff-viewer-BLYGfIik.js.gz +0 -0
  69. package/dist/web/assets/{docx-preview-KJaj2YGN.js → docx-preview-D0ORQkvI.js} +1 -1
  70. package/dist/web/assets/docx-preview-D0ORQkvI.js.br +0 -0
  71. package/dist/web/assets/docx-preview-D0ORQkvI.js.gz +0 -0
  72. package/dist/web/assets/{editor-dialog-9tW6c9mu.js → editor-dialog-BdkAgK-M.js} +1 -1
  73. package/dist/web/assets/editor-dialog-BdkAgK-M.js.br +0 -0
  74. package/dist/web/assets/editor-dialog-BdkAgK-M.js.gz +0 -0
  75. package/dist/web/assets/{editor-language-service-CkdO9ih8.js → editor-language-service-B2TYY2sw.js} +1 -1
  76. package/dist/web/assets/editor-language-service-B2TYY2sw.js.br +0 -0
  77. package/dist/web/assets/editor-language-service-B2TYY2sw.js.gz +0 -0
  78. package/dist/web/assets/{explorer-body-B8AkNO5o.js → explorer-body-B-67PDYd.js} +1 -1
  79. package/dist/web/assets/explorer-body-B-67PDYd.js.br +0 -0
  80. package/dist/web/assets/explorer-body-B-67PDYd.js.gz +0 -0
  81. package/dist/web/assets/{explorer-window-content-D174CXKz.js → explorer-window-content-ndGjHH-i.js} +1 -1
  82. package/dist/web/assets/explorer-window-content-ndGjHH-i.js.br +0 -0
  83. package/dist/web/assets/explorer-window-content-ndGjHH-i.js.gz +0 -0
  84. package/dist/web/assets/{extension-manager-section-CQsqXsPF.js → extension-manager-section-C3Z99hLd.js} +1 -1
  85. package/dist/web/assets/extension-manager-section-C3Z99hLd.js.br +0 -0
  86. package/dist/web/assets/extension-manager-section-C3Z99hLd.js.gz +0 -0
  87. package/dist/web/assets/{extension-webview-AfaxC7PL.js → extension-webview-oBN-quI3.js} +1 -1
  88. package/dist/web/assets/extension-webview-oBN-quI3.js.br +0 -0
  89. package/dist/web/assets/extension-webview-oBN-quI3.js.gz +0 -0
  90. package/dist/web/assets/{files-settings-section-CC0aJryq.js → files-settings-section-pzPZEYe2.js} +1 -1
  91. package/dist/web/assets/files-settings-section-pzPZEYe2.js.br +0 -0
  92. package/dist/web/assets/files-settings-section-pzPZEYe2.js.gz +0 -0
  93. package/dist/web/assets/{general-settings-section-DQTr20G_.js → general-settings-section-BxNNbh5b.js} +1 -1
  94. package/dist/web/assets/general-settings-section-BxNNbh5b.js.br +0 -0
  95. package/dist/web/assets/general-settings-section-BxNNbh5b.js.gz +0 -0
  96. package/dist/web/assets/{git-log-panel-CisEJPJz.js → git-log-panel-CEAF4ST-.js} +1 -1
  97. package/dist/web/assets/git-log-panel-CEAF4ST-.js.br +0 -0
  98. package/dist/web/assets/git-log-panel-CEAF4ST-.js.gz +0 -0
  99. package/dist/web/assets/{git-review-tab-DpWEy03w.js → git-review-tab-Cp5DYE5b.js} +1 -1
  100. package/dist/web/assets/git-review-tab-Cp5DYE5b.js.br +0 -0
  101. package/dist/web/assets/git-review-tab-Cp5DYE5b.js.gz +0 -0
  102. package/dist/web/assets/{glide-data-grid-hOML-uXP.js → glide-data-grid-BrwKKQhc.js} +1 -1
  103. package/dist/web/assets/glide-data-grid-BrwKKQhc.js.br +0 -0
  104. package/dist/web/assets/glide-data-grid-BrwKKQhc.js.gz +0 -0
  105. package/dist/web/assets/{grid-save-dialog-Bx61akzH.js → grid-save-dialog-inaY39lZ.js} +1 -1
  106. package/dist/web/assets/grid-save-dialog-inaY39lZ.js.br +0 -0
  107. package/dist/web/assets/grid-save-dialog-inaY39lZ.js.gz +0 -0
  108. package/dist/web/assets/{group-chat-tab-eQdJHa8d.js → group-chat-tab-DpvHkXCK.js} +1 -1
  109. package/dist/web/assets/group-chat-tab-DpvHkXCK.js.br +0 -0
  110. package/dist/web/assets/group-chat-tab-DpvHkXCK.js.gz +0 -0
  111. package/dist/web/assets/{impexp-tab-BjIDxYTj.js → impexp-tab-CDgODpaL.js} +1 -1
  112. package/dist/web/assets/impexp-tab-CDgODpaL.js.br +0 -0
  113. package/dist/web/assets/impexp-tab-CDgODpaL.js.gz +0 -0
  114. package/dist/web/assets/{index-COwBji1t.js → index-EznfgwH9.js} +5 -5
  115. package/dist/web/assets/index-EznfgwH9.js.br +0 -0
  116. package/dist/web/assets/index-EznfgwH9.js.gz +0 -0
  117. package/dist/web/assets/{jira-watcher-section-dzpmNZA2.js → jira-watcher-section-CvxfscZl.js} +1 -1
  118. package/dist/web/assets/{keybindings-store-DRjk8512.js → keybindings-store-BqXn-D3b.js} +1 -1
  119. package/dist/web/assets/{keyboard-shortcuts-section-BhyalK8A.js → keyboard-shortcuts-section-HaqDDilx.js} +1 -1
  120. package/dist/web/assets/keyboard-shortcuts-section-HaqDDilx.js.br +0 -0
  121. package/dist/web/assets/keyboard-shortcuts-section-HaqDDilx.js.gz +0 -0
  122. package/dist/web/assets/{language-servers-section-BXLaicUY.js → language-servers-section-B2mGPtGX.js} +2 -2
  123. package/dist/web/assets/language-servers-section-B2mGPtGX.js.br +0 -0
  124. package/dist/web/assets/language-servers-section-B2mGPtGX.js.gz +0 -0
  125. package/dist/web/assets/{logs-app-BnjU6CRy.js → logs-app-Cv2fsZxf.js} +1 -1
  126. package/dist/web/assets/logs-app-Cv2fsZxf.js.br +0 -0
  127. package/dist/web/assets/logs-app-Cv2fsZxf.js.gz +0 -0
  128. package/dist/web/assets/{logs-tab-7uyD7gKW.js → logs-tab-D9orkAwZ.js} +1 -1
  129. package/dist/web/assets/{logs-window-content-B78a6oM2.js → logs-window-content-DygG8-n0.js} +1 -1
  130. package/dist/web/assets/{lsp-client-DOHnxEUE.js → lsp-client-DpKk7qms.js} +1 -1
  131. package/dist/web/assets/lsp-client-DpKk7qms.js.br +0 -0
  132. package/dist/web/assets/lsp-client-DpKk7qms.js.gz +0 -0
  133. package/dist/web/assets/{markdown-renderer-B_hL6lRL.js → markdown-renderer-YDuDxTPt.js} +1 -1
  134. package/dist/web/assets/{markdown-renderer-Dz0ZcxNo.js → markdown-renderer-zuzkV4A5.js} +1 -1
  135. package/dist/web/assets/markdown-renderer-zuzkV4A5.js.br +0 -0
  136. package/dist/web/assets/markdown-renderer-zuzkV4A5.js.gz +0 -0
  137. package/dist/web/assets/{mobile-explorer-sheet-C_3dq99D.js → mobile-explorer-sheet-DrQaPEZo.js} +1 -1
  138. package/dist/web/assets/mobile-explorer-sheet-DrQaPEZo.js.br +0 -0
  139. package/dist/web/assets/mobile-explorer-sheet-DrQaPEZo.js.gz +0 -0
  140. package/dist/web/assets/{new-design-dialog-CaubNbMT.js → new-design-dialog-C00L2Ei1.js} +1 -1
  141. package/dist/web/assets/new-design-dialog-C00L2Ei1.js.br +0 -0
  142. package/dist/web/assets/new-design-dialog-C00L2Ei1.js.gz +0 -0
  143. package/dist/web/assets/{notification-store-BTk3PZAj.js → notification-store-BHQjJkNC.js} +1 -1
  144. package/dist/web/assets/{notifications-settings-section-CJJ1l5cL.js → notifications-settings-section-DHx7YbrU.js} +1 -1
  145. package/dist/web/assets/notifications-settings-section-DHx7YbrU.js.br +0 -0
  146. package/dist/web/assets/notifications-settings-section-DHx7YbrU.js.gz +0 -0
  147. package/dist/web/assets/{ppmbot-settings-section-BFniAm3D.js → ppmbot-settings-section-8OxZnTeE.js} +1 -1
  148. package/dist/web/assets/ppmbot-settings-section-8OxZnTeE.js.br +0 -0
  149. package/dist/web/assets/ppmbot-settings-section-8OxZnTeE.js.gz +0 -0
  150. package/dist/web/assets/{problems-panel-CIxaCYJw.js → problems-panel-uCMYh7nY.js} +1 -1
  151. package/dist/web/assets/problems-panel-uCMYh7nY.js.br +0 -0
  152. package/dist/web/assets/problems-panel-uCMYh7nY.js.gz +0 -0
  153. package/dist/web/assets/{process-table-l1fVcESX.js → process-table-D6fDra-t.js} +1 -1
  154. package/dist/web/assets/process-table-D6fDra-t.js.br +0 -0
  155. package/dist/web/assets/process-table-D6fDra-t.js.gz +0 -0
  156. package/dist/web/assets/{proxy-settings-section-Di5nBuy6.js → proxy-settings-section-B8vjc9n-.js} +1 -1
  157. package/dist/web/assets/proxy-settings-section-B8vjc9n-.js.br +0 -0
  158. package/dist/web/assets/proxy-settings-section-B8vjc9n-.js.gz +0 -0
  159. package/dist/web/assets/{query-tab-hyKnRZr3.js → query-tab-BaIWJrsN.js} +1 -1
  160. package/dist/web/assets/query-tab-BaIWJrsN.js.br +0 -0
  161. package/dist/web/assets/{query-tab-hyKnRZr3.js.gz → query-tab-BaIWJrsN.js.gz} +0 -0
  162. package/dist/web/assets/{remote-access-settings-section-HpZAP0Al.js → remote-access-settings-section-DIrFElKv.js} +1 -1
  163. package/dist/web/assets/remote-access-settings-section-DIrFElKv.js.br +0 -0
  164. package/dist/web/assets/remote-access-settings-section-DIrFElKv.js.gz +0 -0
  165. package/dist/web/assets/{remote-desktop-clipboard-notice-DY7tWgjf.js → remote-desktop-clipboard-notice-Cg2Z-66K.js} +1 -1
  166. package/dist/web/assets/remote-desktop-clipboard-notice-Cg2Z-66K.js.br +0 -0
  167. package/dist/web/assets/remote-desktop-clipboard-notice-Cg2Z-66K.js.gz +0 -0
  168. package/dist/web/assets/{remote-desktop-mobile-sheet-CX9mDRle.js → remote-desktop-mobile-sheet-CPkPaOeS.js} +2 -2
  169. package/dist/web/assets/remote-desktop-mobile-sheet-CPkPaOeS.js.br +0 -0
  170. package/dist/web/assets/remote-desktop-mobile-sheet-CPkPaOeS.js.gz +0 -0
  171. package/dist/web/assets/{remote-desktop-mobile-view-DNg0EpbV.js → remote-desktop-mobile-view-CFyOCkms.js} +1 -1
  172. package/dist/web/assets/remote-desktop-mobile-view-CFyOCkms.js.br +0 -0
  173. package/dist/web/assets/remote-desktop-mobile-view-CFyOCkms.js.gz +0 -0
  174. package/dist/web/assets/{remote-desktop-readiness-gate-BTTLlVDc.js → remote-desktop-readiness-gate-CBAZK0-B.js} +1 -1
  175. package/dist/web/assets/remote-desktop-readiness-gate-CBAZK0-B.js.br +0 -0
  176. package/dist/web/assets/remote-desktop-readiness-gate-CBAZK0-B.js.gz +0 -0
  177. package/dist/web/assets/{remote-desktop-window-content-CqxnhSu0.js → remote-desktop-window-content-CNk7SS-W.js} +1 -1
  178. package/dist/web/assets/remote-desktop-window-content-CNk7SS-W.js.br +0 -0
  179. package/dist/web/assets/remote-desktop-window-content-CNk7SS-W.js.gz +0 -0
  180. package/dist/web/assets/{rename-object-dialog-CnhMsNbT.js → rename-object-dialog-MhvD2boE.js} +1 -1
  181. package/dist/web/assets/rename-object-dialog-MhvD2boE.js.br +0 -0
  182. package/dist/web/assets/rename-object-dialog-MhvD2boE.js.gz +0 -0
  183. package/dist/web/assets/{review-code-CunYhmcC.js → review-code-B9zXrfyG.js} +1 -1
  184. package/dist/web/assets/review-code-B9zXrfyG.js.br +0 -0
  185. package/dist/web/assets/review-code-B9zXrfyG.js.gz +0 -0
  186. package/dist/web/assets/{save-as-dialog-BtGSwTKZ.js → save-as-dialog-5yBgewV3.js} +1 -1
  187. package/dist/web/assets/save-as-dialog-5yBgewV3.js.br +0 -0
  188. package/dist/web/assets/save-as-dialog-5yBgewV3.js.gz +0 -0
  189. package/dist/web/assets/{schedules-settings-section-CvlcMyEz.js → schedules-settings-section-BD3-tlU-.js} +1 -1
  190. package/dist/web/assets/schedules-settings-section-BD3-tlU-.js.br +0 -0
  191. package/dist/web/assets/schedules-settings-section-BD3-tlU-.js.gz +0 -0
  192. package/dist/web/assets/{session-review-tab-C3HuIPD2.js → session-review-tab-DYJFhsGk.js} +1 -1
  193. package/dist/web/assets/session-review-tab-DYJFhsGk.js.br +0 -0
  194. package/dist/web/assets/session-review-tab-DYJFhsGk.js.gz +0 -0
  195. package/dist/web/assets/{settings-body-DCHEAh2_.js → settings-body-CWBVeKKg.js} +1 -1
  196. package/dist/web/assets/settings-body-CWBVeKKg.js.br +4 -0
  197. package/dist/web/assets/settings-body-CWBVeKKg.js.gz +0 -0
  198. package/dist/web/assets/{settings-rows-D8Y9o1ZD.js → settings-rows-B7fyQuu_.js} +1 -1
  199. package/dist/web/assets/settings-rows-B7fyQuu_.js.br +0 -0
  200. package/dist/web/assets/settings-rows-B7fyQuu_.js.gz +0 -0
  201. package/dist/web/assets/settings-section-content-BPQN6KdN.js +1 -0
  202. package/dist/web/assets/{settings-section-content-Dluhkh-u.js → settings-section-content-CoJcm6JM.js} +2 -2
  203. package/dist/web/assets/settings-section-content-CoJcm6JM.js.br +0 -0
  204. package/dist/web/assets/settings-section-content-CoJcm6JM.js.gz +0 -0
  205. package/dist/web/assets/{settings-tab-Cj1GkYi3.js → settings-tab-DWzU1RkL.js} +1 -1
  206. package/dist/web/assets/{settings-window-content-1fweMynB.js → settings-window-content-CAThkpa8.js} +1 -1
  207. package/dist/web/assets/{slash-command-picker-BdKd_AiS.js → slash-command-picker-dDl9riKP.js} +1 -1
  208. package/dist/web/assets/slash-command-picker-dDl9riKP.js.br +0 -0
  209. package/dist/web/assets/slash-command-picker-dDl9riKP.js.gz +0 -0
  210. package/dist/web/assets/{sql-object-tab-DkdF_7Jz.js → sql-object-tab-DND9osIv.js} +1 -1
  211. package/dist/web/assets/sql-object-tab-DND9osIv.js.br +0 -0
  212. package/dist/web/assets/sql-object-tab-DND9osIv.js.gz +0 -0
  213. package/dist/web/assets/{sqlite-viewer-BoQMjJHj.js → sqlite-viewer-P7UpXmyZ.js} +1 -1
  214. package/dist/web/assets/sqlite-viewer-P7UpXmyZ.js.br +0 -0
  215. package/dist/web/assets/sqlite-viewer-P7UpXmyZ.js.gz +0 -0
  216. package/dist/web/assets/{structure-save-dialog-DGHxHJ4T.js → structure-save-dialog-DX1H1Qy2.js} +1 -1
  217. package/dist/web/assets/structure-save-dialog-DX1H1Qy2.js.br +0 -0
  218. package/dist/web/assets/structure-save-dialog-DX1H1Qy2.js.gz +0 -0
  219. package/dist/web/assets/{structure-tab-DuuX1e9c.js → structure-tab-1QhNP2ob.js} +1 -1
  220. package/dist/web/assets/structure-tab-1QhNP2ob.js.br +0 -0
  221. package/dist/web/assets/structure-tab-1QhNP2ob.js.gz +0 -0
  222. package/dist/web/assets/{system-monitor-body-CZVoh652.js → system-monitor-body-CPAAjIdT.js} +2 -2
  223. package/dist/web/assets/system-monitor-body-CPAAjIdT.js.br +0 -0
  224. package/dist/web/assets/system-monitor-body-CPAAjIdT.js.gz +0 -0
  225. package/dist/web/assets/{system-monitor-tab-eGta1jpw.js → system-monitor-tab-D_1PBGwv.js} +1 -1
  226. package/dist/web/assets/{system-monitor-window-content-BUG72ffC.js → system-monitor-window-content-dVxWFqHP.js} +1 -1
  227. package/dist/web/assets/{tab-host-window-content-BTYuY43x.js → tab-host-window-content-BBsg5_fz.js} +1 -1
  228. package/dist/web/assets/tab-host-window-content-BBsg5_fz.js.br +0 -0
  229. package/dist/web/assets/tab-host-window-content-BBsg5_fz.js.gz +0 -0
  230. package/dist/web/assets/{table-tab-BsfgtqFE.js → table-tab-BO-q-hSc.js} +1 -1
  231. package/dist/web/assets/table-tab-BO-q-hSc.js.br +0 -0
  232. package/dist/web/assets/table-tab-BO-q-hSc.js.gz +0 -0
  233. package/dist/web/assets/{telegram-bot-token-field-CA8DEKRL.js → telegram-bot-token-field-BVYWBpX_.js} +1 -1
  234. package/dist/web/assets/telegram-bot-token-field-BVYWBpX_.js.br +0 -0
  235. package/dist/web/assets/telegram-bot-token-field-BVYWBpX_.js.gz +0 -0
  236. package/dist/web/assets/{terminal-tab-CoT5KIfe.js → terminal-tab-DjPXnuO8.js} +1 -1
  237. package/dist/web/assets/terminal-tab-DjPXnuO8.js.br +0 -0
  238. package/dist/web/assets/terminal-tab-DjPXnuO8.js.gz +0 -0
  239. package/dist/web/assets/{tool-cards-oZ6cptRr.js → tool-cards-DXV9SEE8.js} +3 -3
  240. package/dist/web/assets/tool-cards-DXV9SEE8.js.br +0 -0
  241. package/dist/web/assets/tool-cards-DXV9SEE8.js.gz +0 -0
  242. package/dist/web/assets/{tools-settings-section-CtcD-iTk.js → tools-settings-section-Cc5YKOB6.js} +1 -1
  243. package/dist/web/assets/tools-settings-section-Cc5YKOB6.js.br +0 -0
  244. package/dist/web/assets/tools-settings-section-Cc5YKOB6.js.gz +0 -0
  245. package/dist/web/assets/{use-inline-blame-BUuJj1Ru.js → use-inline-blame-f6WMZkEv.js} +1 -1
  246. package/dist/web/assets/use-inline-blame-f6WMZkEv.js.br +0 -0
  247. package/dist/web/assets/use-inline-blame-f6WMZkEv.js.gz +0 -0
  248. package/dist/web/assets/{use-lsp-Bo4z4gLx.js → use-lsp-B_fmU9ja.js} +1 -1
  249. package/dist/web/assets/use-lsp-B_fmU9ja.js.br +0 -0
  250. package/dist/web/assets/use-lsp-B_fmU9ja.js.gz +0 -0
  251. package/dist/web/assets/{use-monaco-theme-1ANtPWqA.js → use-monaco-theme-nu5Fogu3.js} +1 -1
  252. package/dist/web/assets/{use-process-kill-CvlXPal4.js → use-process-kill-B8Mf4_Yy.js} +1 -1
  253. package/dist/web/assets/use-process-kill-B8Mf4_Yy.js.br +0 -0
  254. package/dist/web/assets/use-process-kill-B8Mf4_Yy.js.gz +0 -0
  255. package/dist/web/assets/{use-sql-schema-info-DQzUqb7q.js → use-sql-schema-info-Dp6TCir5.js} +1 -1
  256. package/dist/web/assets/use-sql-schema-info-Dp6TCir5.js.br +0 -0
  257. package/dist/web/assets/use-sql-schema-info-Dp6TCir5.js.gz +0 -0
  258. package/dist/web/assets/{use-websocket-QCAD3F5b.js → use-websocket-RuENPZ_x.js} +1 -1
  259. package/dist/web/assets/web-preview-tab-ClOiV3BO.js +1 -0
  260. package/dist/web/assets/web-preview-tab-ClOiV3BO.js.br +0 -0
  261. package/dist/web/assets/web-preview-tab-ClOiV3BO.js.gz +0 -0
  262. package/dist/web/index.html +1 -1
  263. package/dist/web/index.html.br +0 -0
  264. package/dist/web/index.html.gz +0 -0
  265. package/dist/web/sw.js +1 -1
  266. package/dist/web/sw.js.br +0 -0
  267. package/dist/web/sw.js.gz +0 -0
  268. package/docs/architecture/ai-chat-and-providers.md +22 -0
  269. package/docs/architecture/workspace-and-ui.md +11 -0
  270. package/package.json +1 -1
  271. package/src/providers/codex-app-server/codex-event-mapper.ts +3 -0
  272. package/src/providers/codex-app-server/codex-provider.ts +3 -21
  273. package/src/providers/codex-app-server/codex-rollout-items.ts +3 -0
  274. package/src/providers/codex-app-server/codex-thread-params.ts +1 -0
  275. package/src/providers/codex-app-server/codex-user-input.ts +41 -0
  276. package/src/services/port-forward/forward-hop.ts +20 -5
  277. package/src/services/port-forward/preview-navigation.ts +45 -0
  278. package/src/shared/chat-questions.ts +19 -0
  279. package/src/web/components/chat/async-question-card.tsx +24 -0
  280. package/src/web/components/chat/chat-tab.tsx +3 -2
  281. package/src/web/components/chat/message-events.tsx +6 -0
  282. package/src/web/components/chat/question-card.tsx +8 -10
  283. package/src/web/components/chat/tool-cards.tsx +4 -4
  284. package/src/web/components/web-preview/web-preview-tab.tsx +38 -5
  285. package/dist/web/assets/accounts-settings-section-DhzuFkDO.js.br +0 -0
  286. package/dist/web/assets/accounts-settings-section-DhzuFkDO.js.gz +0 -0
  287. package/dist/web/assets/agent-session-sheet-CZAmOwSU.js.br +0 -0
  288. package/dist/web/assets/agent-session-sheet-CZAmOwSU.js.gz +0 -0
  289. package/dist/web/assets/agent-session-window-content-CwokWtJq.js.br +0 -0
  290. package/dist/web/assets/agent-session-window-content-CwokWtJq.js.gz +0 -0
  291. package/dist/web/assets/ai-resource-editor-CT1JCaRQ.js.br +0 -0
  292. package/dist/web/assets/ai-resource-editor-CT1JCaRQ.js.gz +0 -0
  293. package/dist/web/assets/ai-settings-section-Ct9-lNqA.js.br +0 -0
  294. package/dist/web/assets/ai-settings-section-Ct9-lNqA.js.gz +0 -0
  295. package/dist/web/assets/android-tab-CUPQN2M4.js.br +0 -0
  296. package/dist/web/assets/android-tab-CUPQN2M4.js.gz +0 -0
  297. package/dist/web/assets/appearance-settings-section-DpYcNqXH.js.br +0 -0
  298. package/dist/web/assets/appearance-settings-section-DpYcNqXH.js.gz +0 -0
  299. package/dist/web/assets/apps-panel-BqF_CkKy.js.br +0 -0
  300. package/dist/web/assets/apps-panel-BqF_CkKy.js.gz +0 -0
  301. package/dist/web/assets/branch-review-tab-BEZqFSlw.js.br +0 -0
  302. package/dist/web/assets/branch-review-tab-BEZqFSlw.js.gz +0 -0
  303. package/dist/web/assets/chat-tab-N1B-Yv0P.js.br +0 -0
  304. package/dist/web/assets/chat-tab-N1B-Yv0P.js.gz +0 -0
  305. package/dist/web/assets/chat-tab-kk-mAF05.js +0 -16
  306. package/dist/web/assets/chat-tab-kk-mAF05.js.br +0 -0
  307. package/dist/web/assets/chat-tab-kk-mAF05.js.gz +0 -0
  308. package/dist/web/assets/code-editor-d1CXl2WL.js.br +0 -0
  309. package/dist/web/assets/code-editor-d1CXl2WL.js.gz +0 -0
  310. package/dist/web/assets/codex-reset-credit-button-CwSSBK6P.js.br +0 -0
  311. package/dist/web/assets/codex-reset-credit-button-CwSSBK6P.js.gz +0 -0
  312. package/dist/web/assets/conflict-editor-BucKz-uE.js.br +0 -0
  313. package/dist/web/assets/conflict-editor-BucKz-uE.js.gz +0 -0
  314. package/dist/web/assets/connection-form-tab-DIc25Bko.js.br +0 -0
  315. package/dist/web/assets/connection-form-tab-DIc25Bko.js.gz +0 -0
  316. package/dist/web/assets/csv-preview-CqDaGV5N.js.br +0 -0
  317. package/dist/web/assets/csv-preview-CqDaGV5N.js.gz +0 -0
  318. package/dist/web/assets/db-tab-parts-lp8ROGQB.js.br +0 -0
  319. package/dist/web/assets/db-tab-parts-lp8ROGQB.js.gz +0 -0
  320. package/dist/web/assets/design-settings-section-DxWEBH1L.js.br +0 -0
  321. package/dist/web/assets/design-settings-section-DxWEBH1L.js.gz +0 -0
  322. package/dist/web/assets/design-tab-Cl0CMAUx.js.br +0 -0
  323. package/dist/web/assets/design-tab-Cl0CMAUx.js.gz +0 -0
  324. package/dist/web/assets/designs-sidebar-panel-aCr-EGfj.js.br +0 -0
  325. package/dist/web/assets/designs-sidebar-panel-aCr-EGfj.js.gz +0 -0
  326. package/dist/web/assets/diff-viewer-XyJgWKwe.js.br +0 -0
  327. package/dist/web/assets/diff-viewer-XyJgWKwe.js.gz +0 -0
  328. package/dist/web/assets/docx-preview-KJaj2YGN.js.br +0 -0
  329. package/dist/web/assets/docx-preview-KJaj2YGN.js.gz +0 -0
  330. package/dist/web/assets/editor-dialog-9tW6c9mu.js.br +0 -0
  331. package/dist/web/assets/editor-dialog-9tW6c9mu.js.gz +0 -0
  332. package/dist/web/assets/editor-language-service-CkdO9ih8.js.br +0 -0
  333. package/dist/web/assets/editor-language-service-CkdO9ih8.js.gz +0 -0
  334. package/dist/web/assets/explorer-body-B8AkNO5o.js.br +0 -0
  335. package/dist/web/assets/explorer-body-B8AkNO5o.js.gz +0 -0
  336. package/dist/web/assets/explorer-window-content-D174CXKz.js.br +0 -0
  337. package/dist/web/assets/explorer-window-content-D174CXKz.js.gz +0 -0
  338. package/dist/web/assets/extension-manager-section-CQsqXsPF.js.br +0 -0
  339. package/dist/web/assets/extension-manager-section-CQsqXsPF.js.gz +0 -0
  340. package/dist/web/assets/extension-webview-AfaxC7PL.js.br +0 -0
  341. package/dist/web/assets/extension-webview-AfaxC7PL.js.gz +0 -0
  342. package/dist/web/assets/files-settings-section-CC0aJryq.js.br +0 -0
  343. package/dist/web/assets/files-settings-section-CC0aJryq.js.gz +0 -0
  344. package/dist/web/assets/general-settings-section-DQTr20G_.js.br +0 -0
  345. package/dist/web/assets/general-settings-section-DQTr20G_.js.gz +0 -0
  346. package/dist/web/assets/git-log-panel-CisEJPJz.js.br +0 -0
  347. package/dist/web/assets/git-log-panel-CisEJPJz.js.gz +0 -0
  348. package/dist/web/assets/git-review-tab-DpWEy03w.js.br +0 -0
  349. package/dist/web/assets/git-review-tab-DpWEy03w.js.gz +0 -0
  350. package/dist/web/assets/glide-data-grid-hOML-uXP.js.br +0 -0
  351. package/dist/web/assets/glide-data-grid-hOML-uXP.js.gz +0 -0
  352. package/dist/web/assets/grid-save-dialog-Bx61akzH.js.br +0 -0
  353. package/dist/web/assets/grid-save-dialog-Bx61akzH.js.gz +0 -0
  354. package/dist/web/assets/group-chat-tab-eQdJHa8d.js.br +0 -0
  355. package/dist/web/assets/group-chat-tab-eQdJHa8d.js.gz +0 -0
  356. package/dist/web/assets/impexp-tab-BjIDxYTj.js.br +0 -0
  357. package/dist/web/assets/impexp-tab-BjIDxYTj.js.gz +0 -0
  358. package/dist/web/assets/index-COwBji1t.js.br +0 -0
  359. package/dist/web/assets/index-COwBji1t.js.gz +0 -0
  360. package/dist/web/assets/keyboard-shortcuts-section-BhyalK8A.js.br +0 -0
  361. package/dist/web/assets/keyboard-shortcuts-section-BhyalK8A.js.gz +0 -0
  362. package/dist/web/assets/language-servers-section-BXLaicUY.js.br +0 -0
  363. package/dist/web/assets/language-servers-section-BXLaicUY.js.gz +0 -0
  364. package/dist/web/assets/logs-app-BnjU6CRy.js.br +0 -0
  365. package/dist/web/assets/logs-app-BnjU6CRy.js.gz +0 -0
  366. package/dist/web/assets/lsp-client-DOHnxEUE.js.br +0 -0
  367. package/dist/web/assets/lsp-client-DOHnxEUE.js.gz +0 -0
  368. package/dist/web/assets/markdown-renderer-Dz0ZcxNo.js.br +0 -0
  369. package/dist/web/assets/markdown-renderer-Dz0ZcxNo.js.gz +0 -0
  370. package/dist/web/assets/mobile-explorer-sheet-C_3dq99D.js.br +0 -0
  371. package/dist/web/assets/mobile-explorer-sheet-C_3dq99D.js.gz +0 -0
  372. package/dist/web/assets/new-design-dialog-CaubNbMT.js.br +0 -0
  373. package/dist/web/assets/new-design-dialog-CaubNbMT.js.gz +0 -0
  374. package/dist/web/assets/notifications-settings-section-CJJ1l5cL.js.br +0 -0
  375. package/dist/web/assets/notifications-settings-section-CJJ1l5cL.js.gz +0 -0
  376. package/dist/web/assets/ppmbot-settings-section-BFniAm3D.js.br +0 -0
  377. package/dist/web/assets/ppmbot-settings-section-BFniAm3D.js.gz +0 -0
  378. package/dist/web/assets/problems-panel-CIxaCYJw.js.br +0 -0
  379. package/dist/web/assets/problems-panel-CIxaCYJw.js.gz +0 -0
  380. package/dist/web/assets/process-table-l1fVcESX.js.br +0 -0
  381. package/dist/web/assets/process-table-l1fVcESX.js.gz +0 -0
  382. package/dist/web/assets/proxy-settings-section-Di5nBuy6.js.br +0 -0
  383. package/dist/web/assets/proxy-settings-section-Di5nBuy6.js.gz +0 -0
  384. package/dist/web/assets/query-tab-hyKnRZr3.js.br +0 -0
  385. package/dist/web/assets/remote-access-settings-section-HpZAP0Al.js.br +0 -0
  386. package/dist/web/assets/remote-access-settings-section-HpZAP0Al.js.gz +0 -0
  387. package/dist/web/assets/remote-desktop-clipboard-notice-DY7tWgjf.js.br +0 -0
  388. package/dist/web/assets/remote-desktop-clipboard-notice-DY7tWgjf.js.gz +0 -0
  389. package/dist/web/assets/remote-desktop-mobile-sheet-CX9mDRle.js.br +0 -0
  390. package/dist/web/assets/remote-desktop-mobile-sheet-CX9mDRle.js.gz +0 -0
  391. package/dist/web/assets/remote-desktop-mobile-view-DNg0EpbV.js.br +0 -0
  392. package/dist/web/assets/remote-desktop-mobile-view-DNg0EpbV.js.gz +0 -0
  393. package/dist/web/assets/remote-desktop-readiness-gate-BTTLlVDc.js.br +0 -0
  394. package/dist/web/assets/remote-desktop-readiness-gate-BTTLlVDc.js.gz +0 -0
  395. package/dist/web/assets/remote-desktop-window-content-CqxnhSu0.js.br +0 -0
  396. package/dist/web/assets/remote-desktop-window-content-CqxnhSu0.js.gz +0 -0
  397. package/dist/web/assets/rename-object-dialog-CnhMsNbT.js.br +0 -0
  398. package/dist/web/assets/rename-object-dialog-CnhMsNbT.js.gz +0 -0
  399. package/dist/web/assets/review-code-CunYhmcC.js.br +0 -0
  400. package/dist/web/assets/review-code-CunYhmcC.js.gz +0 -0
  401. package/dist/web/assets/save-as-dialog-BtGSwTKZ.js.br +0 -0
  402. package/dist/web/assets/save-as-dialog-BtGSwTKZ.js.gz +0 -0
  403. package/dist/web/assets/schedules-settings-section-CvlcMyEz.js.br +0 -0
  404. package/dist/web/assets/schedules-settings-section-CvlcMyEz.js.gz +0 -0
  405. package/dist/web/assets/session-review-tab-C3HuIPD2.js.br +0 -0
  406. package/dist/web/assets/session-review-tab-C3HuIPD2.js.gz +0 -0
  407. package/dist/web/assets/settings-body-DCHEAh2_.js.br +0 -0
  408. package/dist/web/assets/settings-body-DCHEAh2_.js.gz +0 -0
  409. package/dist/web/assets/settings-rows-D8Y9o1ZD.js.br +0 -0
  410. package/dist/web/assets/settings-rows-D8Y9o1ZD.js.gz +0 -0
  411. package/dist/web/assets/settings-section-content-BXPg2H0N.js +0 -1
  412. package/dist/web/assets/settings-section-content-Dluhkh-u.js.br +0 -0
  413. package/dist/web/assets/settings-section-content-Dluhkh-u.js.gz +0 -0
  414. package/dist/web/assets/slash-command-picker-BdKd_AiS.js.br +0 -0
  415. package/dist/web/assets/slash-command-picker-BdKd_AiS.js.gz +0 -0
  416. package/dist/web/assets/sql-object-tab-DkdF_7Jz.js.br +0 -0
  417. package/dist/web/assets/sql-object-tab-DkdF_7Jz.js.gz +0 -0
  418. package/dist/web/assets/sqlite-viewer-BoQMjJHj.js.br +0 -0
  419. package/dist/web/assets/sqlite-viewer-BoQMjJHj.js.gz +0 -0
  420. package/dist/web/assets/structure-save-dialog-DGHxHJ4T.js.br +0 -0
  421. package/dist/web/assets/structure-save-dialog-DGHxHJ4T.js.gz +0 -0
  422. package/dist/web/assets/structure-tab-DuuX1e9c.js.br +0 -0
  423. package/dist/web/assets/structure-tab-DuuX1e9c.js.gz +0 -0
  424. package/dist/web/assets/system-monitor-body-CZVoh652.js.br +0 -0
  425. package/dist/web/assets/system-monitor-body-CZVoh652.js.gz +0 -0
  426. package/dist/web/assets/tab-host-window-content-BTYuY43x.js.br +0 -0
  427. package/dist/web/assets/tab-host-window-content-BTYuY43x.js.gz +0 -0
  428. package/dist/web/assets/table-tab-BsfgtqFE.js.br +0 -0
  429. package/dist/web/assets/table-tab-BsfgtqFE.js.gz +0 -0
  430. package/dist/web/assets/telegram-bot-token-field-CA8DEKRL.js.br +0 -0
  431. package/dist/web/assets/telegram-bot-token-field-CA8DEKRL.js.gz +0 -0
  432. package/dist/web/assets/terminal-tab-CoT5KIfe.js.br +0 -0
  433. package/dist/web/assets/terminal-tab-CoT5KIfe.js.gz +0 -0
  434. package/dist/web/assets/tool-cards-oZ6cptRr.js.br +0 -0
  435. package/dist/web/assets/tool-cards-oZ6cptRr.js.gz +0 -0
  436. package/dist/web/assets/tools-settings-section-CtcD-iTk.js.br +0 -0
  437. package/dist/web/assets/tools-settings-section-CtcD-iTk.js.gz +0 -0
  438. package/dist/web/assets/use-inline-blame-BUuJj1Ru.js.br +0 -0
  439. package/dist/web/assets/use-inline-blame-BUuJj1Ru.js.gz +0 -0
  440. package/dist/web/assets/use-lsp-Bo4z4gLx.js.br +0 -0
  441. package/dist/web/assets/use-lsp-Bo4z4gLx.js.gz +0 -0
  442. package/dist/web/assets/use-process-kill-CvlXPal4.js.br +0 -0
  443. package/dist/web/assets/use-process-kill-CvlXPal4.js.gz +0 -0
  444. package/dist/web/assets/use-sql-schema-info-DQzUqb7q.js.br +0 -0
  445. package/dist/web/assets/use-sql-schema-info-DQzUqb7q.js.gz +0 -0
  446. package/dist/web/assets/web-preview-tab-Cp0LuL0T.js +0 -1
  447. package/dist/web/assets/web-preview-tab-Cp0LuL0T.js.br +0 -0
  448. package/dist/web/assets/web-preview-tab-Cp0LuL0T.js.gz +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.23.18] - 2026-10-24
4
+
5
+ ### Fixed
6
+
7
+ - **Web preview tabs follow navigation**, keeping Reload, Copy URL and Open in browser on the current page.
8
+
9
+ ## [0.23.17] - 2026-10-23
10
+
11
+ ### Fixed
12
+
13
+ - **Codex can ask and wait for your answer in Default mode**, then continue the same turn without switching to Plan.
14
+ - **Codex async questions now show selectable answers**, retain their answered state after reload, and send replies back to the conversation.
15
+
3
16
  ## [0.23.16] - 2026-10-22
4
17
 
5
18
  ### Fixed
@@ -73,4 +73,4 @@ This skill covers the `ppm` CLI, its HTTP API, and its config DB. It does **not*
73
73
  - Third-party extensions (inspect via `ppm ext list`).
74
74
  - The Claude Agent SDK internals (separate skill).
75
75
 
76
- <!-- Generated for PPM v0.23.16 at build time. Re-run `ppm export skill --install` to refresh. -->
76
+ <!-- Generated for PPM v0.23.18 at build time. Re-run `ppm export skill --install` to refresh. -->
@@ -807,7 +807,7 @@ Show recent runs for a schedule
807
807
  Manage and inspect discovered skills & commands
808
808
 
809
809
  **Options:**
810
- - `--project <path>` — Project path (default: `"C:\\Users\\PC\\ppm-release"`)
810
+ - `--project <path>` — Project path (default: `"C:\\Users\\PC\\ppm-wt-codex-questions-main"`)
811
811
 
812
812
  **Usage:** `ppm skills [options] [command]`
813
813
 
@@ -817,7 +817,7 @@ List all discovered skills and commands
817
817
 
818
818
  **Options:**
819
819
  - `--json` — JSON output
820
- - `--project <path>` — Project path (default: `"C:\\Users\\PC\\ppm-release"`)
820
+ - `--project <path>` — Project path (default: `"C:\\Users\\PC\\ppm-wt-codex-questions-main"`)
821
821
 
822
822
  ### `ppm skills search`
823
823
 
@@ -825,7 +825,7 @@ Fuzzy search skills and commands
825
825
 
826
826
  **Options:**
827
827
  - `--json` — JSON output
828
- - `--project <path>` — Project path (default: `"C:\\Users\\PC\\ppm-release"`)
828
+ - `--project <path>` — Project path (default: `"C:\\Users\\PC\\ppm-wt-codex-questions-main"`)
829
829
 
830
830
  **Usage:** `ppm skills search [options] <query>`
831
831
 
@@ -835,7 +835,7 @@ Show detailed info for a specific skill
835
835
 
836
836
  **Options:**
837
837
  - `--json` — JSON output
838
- - `--project <path>` — Project path (default: `"C:\\Users\\PC\\ppm-release"`)
838
+ - `--project <path>` — Project path (default: `"C:\\Users\\PC\\ppm-wt-codex-questions-main"`)
839
839
 
840
840
  **Usage:** `ppm skills info [options] <name>`
841
841
 
@@ -490,4 +490,4 @@ _Base URL: `http://localhost:8080` (default; override via `ppm config set port <
490
490
  - `ws://<host>/ws/terminal` — PTY terminal multiplexer
491
491
  - `ws://<host>/ws/extensions` — extension host channel
492
492
 
493
- <!-- Generated from src/server/routes/ for PPM v0.23.16 -->
493
+ <!-- Generated from src/server/routes/ for PPM v0.23.18 -->
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{At as r,Cn as i,Cr as a,J as o,Kr as s,Zr as c,cr as l,ht as u,li as d,ln as f,ut as p,xn as m}from"./icons-BwyIKaTT.js";import{a as h}from"./api-client-xQDlhUTu.js";import{n as g}from"./utils-Bslrbb-G.js";import"./portal-container-context-NBi-KGK0.js";import"./chat-preparation-cache-190LLyy7.js";import{n as _}from"./use-is-mobile-VRV9eZy1.js";import{r as v}from"./clipboard-D-VCry-F.js";import{r as y,t as b}from"./button-C9ZXWb3b.js";import{a as x,i as S,n as C,o as w,r as T,t as E}from"./dialog-Dn_2tuYa.js";import{t as D}from"./mobile-bottom-sheet-DArbIyrD.js";import"./use-visual-viewport-MmugpRg-.js";import{t as O}from"./input-C3oVNCMq.js";import{Ai as k,Er as A,Gi as j,Gn as M,Hn as N,Kn as P,Ui as F,Un as I,Vn as ee,Wi as L,Wn as te}from"./index-COwBji1t.js";import{_ as ne,a as re,h as ie,m as ae,o as oe,p as se,r as ce,v as le,x as R,y as ue}from"./api-settings-vmIRFNwZ.js";import{_ as de,a as fe,b as pe,c as me,d as he,g as z,h as B,l as ge,m as _e,n as ve,o as ye,p as V,r as be,s as H,t as xe,u as Se,x as U,y as W}from"./codex-reset-credit-button-CwSSBK6P.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 Ce(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 we(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 Te(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 Ee(e){return e<.3?`bg-success`:e<.7?`bg-warning`:`bg-error`}function De({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),se(e).then(n).catch(()=>n([])).finally(()=>i(!1))},[e]);let s=(0,G.useMemo)(()=>t?Ce(t,a):null,[t,a]),c=(0,G.useMemo)(()=>s?we(s):[],[s]),l=(0,G.useMemo)(()=>s?Te(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 ${Ee(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 Oe({profile:e,accountId:t,onClose:n}){let r=[[`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)(d,{className:`size-4`})})]}),(0,K.jsx)(`div`,{className:`grid grid-cols-[80px_1fr] gap-x-3 gap-y-1 text-xs`,children:r.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)(De,{accountId:t})]})}function ke({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)(b,{variant:`outline`,onClick:n,className:`min-h-11`,children:`Cancel`}),(0,K.jsx)(b,{variant:`destructive`,autoFocus:!1,onClick:t,className:`min-h-11`,children:`Remove account`})]})]});return r?(0,K.jsx)(D,{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)(E,{open:!0,onOpenChange:e=>{e||n()},children:(0,K.jsxs)(C,{className:`sm:max-w-sm`,children:[(0,K.jsx)(x,{children:(0,K.jsx)(w,{className:`text-sm`,children:`Remove account`})}),i]})})}function Ae(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 je({open:e,onOpenChange:t,accounts:n,preselectId:r,onMessage:a}){let o=n.filter(e=>e.hasRefreshToken),[s,c]=(0,G.useState)(new Set),[l,d]=(0,G.useState)(``),[f,g]=(0,G.useState)(!1),[_,y]=(0,G.useState)(!1),[D,k]=(0,G.useState)(!1),[j,M]=(0,G.useState)(!1);e&&!j&&(c(r?new Set([r]):new Set(o.map(e=>e.id))),M(!0)),!e&&j&&M(!1);function N(){t(!1),d(``),g(!1),y(!1)}async function P(e){if(s.size===0)return;k(!0);let t=l.trim()||`ppm-hienlh`;try{let n={"Content-Type":`application/json`},r=h();r&&(n.Authorization=`Bearer ${r}`);let i=await fetch(`/api/accounts/export`,{method:`POST`,headers:n,body:JSON.stringify({password:t,accountIds:[...s],includeRefreshToken:f,refreshBeforeExport:_})});if(!i.ok){let e=await i.json();throw Error(e.error??`Export failed: ${i.status}`)}let o=await i.text();e&&await v(o)?a?.(`Backup copied to clipboard!`):(Ae(o),a?.(`Backup downloaded.`)),N()}catch{}k(!1)}let F=s.size>0&&!D;return(0,K.jsx)(E,{open:e,onOpenChange:e=>{e||N()},children:(0,K.jsxs)(C,{className:`sm:max-w-md`,children:[(0,K.jsxs)(x,{children:[(0,K.jsxs)(w,{className:`text-sm flex items-center gap-1.5`,children:[(0,K.jsx)(i,{className:`size-3.5`}),` Export Accounts`]}),(0,K.jsx)(T,{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:()=>c(s.size===o.length?new Set:new Set(o.map(e=>e.id))),children:s.size===o.length?`Deselect all`:`Select all`})]}),o.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:o.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`input`,{type:`checkbox`,id:`exp-${e.id}`,checked:s.has(e.id),onChange:t=>{let n=new Set(s);t.target.checked?n.add(e.id):n.delete(e.id),c(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)(A,{className:`text-xs`,children:[`Password `,(0,K.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,K.jsx)(O,{type:`password`,placeholder:`Leave empty for default`,value:l,onChange:e=>d(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:f,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=>y(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`})]}),f?(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)(S,{className:`gap-1.5 flex-col sm:flex-row`,children:[(0,K.jsx)(b,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,onClick:N,children:`Cancel`}),(0,K.jsxs)(b,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,disabled:!F,onClick:()=>P(!0),children:[(0,K.jsx)(p,{className:`size-3 mr-1`}),` Copy`]}),(0,K.jsx)(b,{size:`sm`,className:`text-xs h-7 cursor-pointer`,disabled:!F,onClick:()=>P(!1),children:D?(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)(u,{className:`size-3 mr-1`}),` Download`]})})]})]})})}function Me({open:e,onOpenChange:t,onSuccess:n}){let[r,a]=(0,G.useState)(``),[o,s]=(0,G.useState)(``),[c,l]=(0,G.useState)(!1),[u,d]=(0,G.useState)(null);function f(){t(!1),a(``),s(``),d(null)}async function p(){if(r.trim()){l(!0),d(null);try{let e=await ae({data:r.trim(),password:o.trim()||`ppm-hienlh`});f(),n(`Imported ${e.imported} account(s)`)}catch(e){d(e.message||`Import failed`)}l(!1)}}return(0,K.jsx)(E,{open:e,onOpenChange:e=>{e||f()},children:(0,K.jsxs)(C,{className:`sm:max-w-md`,children:[(0,K.jsxs)(x,{children:[(0,K.jsxs)(w,{className:`text-sm flex items-center gap-1.5`,children:[(0,K.jsx)(i,{className:`size-3.5`}),` Import Accounts`]}),(0,K.jsx)(T,{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)(A,{className:`text-xs`,children:`Backup data`}),(0,K.jsx)(`textarea`,{value:r,onChange:e=>a(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)(A,{className:`text-xs`,children:[`Password `,(0,K.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,K.jsx)(O,{type:`password`,placeholder:`Leave empty for default`,value:o,onChange:e=>s(e.target.value),className:`text-xs h-8`,autoComplete:`current-password`})]})]}),u&&(0,K.jsx)(`div`,{className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:u}),(0,K.jsxs)(S,{children:[(0,K.jsx)(b,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,onClick:f,children:`Cancel`}),(0,K.jsx)(b,{size:`sm`,className:`text-xs h-7 cursor-pointer`,disabled:!r.trim()||c,onClick:p,children:c?(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 Ne(e){return X?.addEventListener(`change`,e),()=>X?.removeEventListener(`change`,e)}function Pe(){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),oe().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 R({strategy:e}))},children:[(0,K.jsx)(te,{className:`w-full h-9 text-xs`,children:(0,K.jsx)(M,{})}),(0,K.jsxs)(N,{children:[(0,K.jsx)(I,{value:`round-robin`,children:`Round-robin`}),(0,K.jsx)(I,{value:`fill-first`,children:`Fill-first`}),(0,K.jsx)(I,{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 R({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)(P,{checked:e.cooldownEnabled,onCheckedChange:async e=>{t(await R({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 Fe({open:e,onOpenChange:t}){let n=(0,G.useSyncExternalStore)(Ne,Pe);return e?n?(0,K.jsx)(E,{open:e,onOpenChange:t,children:(0,K.jsxs)(C,{className:`sm:max-w-sm`,children:[(0,K.jsx)(x,{children:(0,K.jsxs)(w,{className:`text-sm flex items-center gap-2`,children:[(0,K.jsx)(a,{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)(a,{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)(d,{className:`size-4`})})]}),(0,K.jsx)(`div`,{className:`px-4 py-4 pb-8`,children:(0,K.jsx)(Z,{})})]})]}):null}var Ie=y(`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(Ie({variant:t}),e),...n})}function Le(e){let t=Math.floor(Date.now()/1e3);return e>t?`${Math.floor((e-t)/60)}m`:`exp`}function Re({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 le(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 ue(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)(P,{id:`sim-include-refresh`,checked:a,onCheckedChange:o,className:`cursor-pointer`}),(0,K.jsx)(A,{htmlFor:`sim-include-refresh`,className:`text-[11px] cursor-pointer`,children:`Include refresh tokens`})]}),(0,K.jsx)(b,{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)(b,{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:Le(e.expires)}),e.token?(0,K.jsx)(b,{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 ze(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 Be({open:e,onOpenChange:t,accounts:n}){let[i,a]=(0,G.useState)(new Map),[o,s]=(0,G.useState)(!1);async function c(e){a(t=>new Map(t).set(e,{loading:!0}));try{let t=await ne(e,o);a(n=>new Map(n).set(e,{loading:!1,result:t}))}catch(t){a(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)(E,{open:e,onOpenChange:t,children:(0,K.jsxs)(C,{className:`sm:max-w-xl max-h-[85vh] flex flex-col`,children:[(0,K.jsxs)(x,{children:[(0,K.jsxs)(w,{className:`text-sm flex items-center gap-1.5`,children:[(0,K.jsx)(r,{className:`size-4`}),` Token Test`]}),(0,K.jsx)(T,{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)(P,{id:`token-test-refresh`,checked:o,onCheckedChange:s,className:`cursor-pointer`}),(0,K.jsx)(A,{htmlFor:`token-test-refresh`,className:`text-[11px] cursor-pointer`,children:`Also test refresh`})]}),(0,K.jsx)(b,{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=i.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:ze(e.expiresAt)})]}),(0,K.jsx)(b,{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)(Re,{accounts:n})]}),(0,K.jsx)(S,{children:(0,K.jsx)(b,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Close`})})]})})}function Ve(){let{usages:e,accounts:t,activeAccountId:n,initialLoading:i,refreshing:o,flashIds:s,reload:d}=ge(),[p,h]=(0,G.useState)(null),[g,_]=(0,G.useState)(null),[v,y]=(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){d(),e&&h(e)}async function A(e,t){_(e);try{await ie(e,{status:t===`disabled`?`active`:`disabled`})}catch(e){h(e.message)}_(null),d()}async function j(){if(v){try{await ce(v.id),h(`Account "${v.display}" removed.`),d()}catch(e){h(`Failed to remove: ${e.message}`)}y(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)(B,{description:`Connect multiple Claude accounts. PPM rotates between them automatically to avoid rate limits.`,onRefresh:()=>void d(),refreshing:o,disabled:i,actions:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(b,{size:`sm`,className:`cursor-pointer gap-1.5`,onClick:()=>{O(void 0),E(`add`)},children:[(0,K.jsx)(l,{className:`size-4`}),` Add account`]}),(0,K.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>{w(null),E(`export`)},children:[(0,K.jsx)(u,{className:`size-4`}),` Export`]}),(0,K.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>E(`import`),children:[(0,K.jsx)(c,{className:`size-4`}),` Import`]}),(0,K.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>E(`rotation`),children:[(0,K.jsx)(a,{className:`size-4`}),` Rotation`]}),(0,K.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>E(`token-test`),children:[(0,K.jsx)(r,{className:`size-4`}),` Token test`]})]})}),(0,K.jsx)(z,{message:p,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 `,pe(new Date(N).getTime())]})]}),i?(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)(f,{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)(V,{children:e.map(e=>(0,K.jsx)(Se,{layout:`strip`,entry:e,isActive:e.accountId===n,accountInfo:M.get(e.accountId),onToggle:A,toggling:g===e.accountId,onDelete:(e,t)=>y({id:e,display:t}),onExport:e=>{w(e),E(`export`)},onViewProfile:(e,t)=>S({profile:e,accountId:t}),onReauth:()=>{O({id:e.accountId,label:e.accountLabel??e.accountId.slice(0,8)}),E(`add`)},flash:s.has(e.accountId)},e.accountId))})]}),x&&(0,K.jsx)(Oe,{profile:x.profile,accountId:x.accountId,onClose:()=>S(null)}),v&&(0,K.jsx)(ke,{display:v.display,onConfirm:()=>void j(),onCancel:()=>y(null)}),(0,K.jsx)(me,{open:T===`add`,onOpenChange:e=>{E(e?`add`:null),e||O(void 0)},onSuccess:k,signInAgainFor:D}),(0,K.jsx)(je,{open:T===`export`,onOpenChange:e=>{E(e?`export`:null),e||w(null)},accounts:t,preselectId:C,onMessage:h}),(0,K.jsx)(Me,{open:T===`import`,onOpenChange:e=>E(e?`import`:null),onSuccess:k}),(0,K.jsx)(Fe,{open:T===`rotation`,onOpenChange:e=>E(e?`rotation`:null)}),(0,K.jsx)(Be,{open:T===`token-test`,onOpenChange:e=>E(e?`token-test`:null),accounts:t})]})}function He({mode:e,onOpenChange:t,password:n,onPasswordChange:r,busy:a,onExport:o,onImport:s,error:l}){let d=(0,G.useRef)(null),f=e===`export`;return(0,K.jsx)(E,{open:e!==null,onOpenChange:t,children:(0,K.jsxs)(C,{className:`sm:max-w-md`,children:[(0,K.jsxs)(x,{children:[(0,K.jsxs)(w,{className:`text-sm flex items-center gap-1.5`,children:[(0,K.jsx)(i,{className:`size-4`}),` `,f?`Export Codex Accounts`:`Import Codex Accounts`]}),(0,K.jsx)(T,{className:`text-xs leading-relaxed`,children:f?`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)(A,{htmlFor:`codex-backup-password`,className:`text-xs`,children:`Password`}),(0,K.jsx)(O,{id:`codex-backup-password`,type:`password`,placeholder:f?`Choose a password`:`Password used for the export`,value:n,onChange:e=>r(e.target.value),className:`text-xs`,autoComplete:f?`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.`})]}),l&&(0,K.jsx)(`div`,{className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:l}),(0,K.jsx)(`input`,{ref:d,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)(S,{children:[(0,K.jsx)(b,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Cancel`}),(0,K.jsxs)(b,{size:`sm`,className:`text-xs cursor-pointer gap-1.5`,disabled:!n.trim()||a,onClick:()=>f?o():d.current?.click(),children:[a?(0,K.jsx)(m,{className:`size-3.5 animate-spin`}):f?(0,K.jsx)(u,{className:`size-3.5`}):(0,K.jsx)(c,{className:`size-3.5`}),f?`Download backup`:`Choose file`]})]})]})})}var Ue=[{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 We({open:e,onOpenChange:t,strategy:n,onChange:r}){return(0,K.jsx)(E,{open:e,onOpenChange:t,children:(0,K.jsxs)(C,{className:`sm:max-w-md`,children:[(0,K.jsxs)(x,{children:[(0,K.jsx)(w,{className:`text-sm`,children:`Codex Rotation`}),(0,K.jsx)(T,{className:`text-xs leading-relaxed`,children:`How a new chat chooses among your Codex accounts.`})]}),(0,K.jsx)(`div`,{className:`space-y-2`,children:Ue.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)(S,{children:(0,K.jsx)(b,{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 Ge({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)(W,{label:`5-Hour Session`,pct:$(e.fiveHour),reset:U(e.session),resetsAt:e.session?.resetsAt}),(t||e.weekly!=null)&&(0,K.jsx)(W,{label:`Weekly`,pct:$(e.sevenDay),reset:U(e.weekly),resetsAt:e.weekly?.resetsAt})]})}function Ke(){let[e,t]=(0,G.useState)(null),n=fe(()=>t(null)),[r,i]=(0,G.useState)(null);return(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsx)(B,{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)(b,{size:`sm`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`add`),children:[(0,K.jsx)(l,{className:`size-4`}),` Add account`]}),(0,K.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`export`),children:[(0,K.jsx)(u,{className:`size-4`}),` Export`]}),(0,K.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`import`),children:[(0,K.jsx)(c,{className:`size-4`}),` Import`]}),(0,K.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`rotation`),children:[(0,K.jsx)(a,{className:`size-4`}),` Rotation`]})]})}),(0,K.jsx)(z,{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)(f,{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)(V,{children:n.accounts.map(e=>{let t=n.usages[e.id]??{};return(0,K.jsxs)(_e,{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)(de,{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`?()=>i(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}),H(e.planType)&&(0,K.jsx)(`span`,{className:`text-[10px] text-text-subtle shrink-0`,children:H(e.planType)}),(0,K.jsx)(P,{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)(F,{children:[(0,K.jsx)(j,{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)(s,{className:`size-4`})})}),(0,K.jsx)(L,{side:`top`,children:`Remove account`})]})]}),(0,K.jsx)(Ge,{usage:t}),t.resetCredits&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap text-[10px] text-text-subtle`,children:[(0,K.jsx)(he,{credits:t.resetCredits}),(0,K.jsx)(xe,{account:e,usage:t,onDone:e=>{n.setMsg(e),n.load()}})]}),t.session==null&&(()=>{let r=ye(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)(F,{children:[(0,K.jsx)(j,{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)(o,{className:`size-3.5`})})}),(0,K.jsx)(L,{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)(P,{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)(be,{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)(He,{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)(ve,{account:r,onClose:()=>i(null),onDone:()=>void n.load()}),(0,K.jsx)(We,{open:e===`rotation`,onOpenChange:e=>t(e?`rotation`:null),strategy:n.strategy,onChange:e=>void n.changeStrategy(e)})]})}var qe=[{id:`claude`,label:`Claude`},{id:`codex`,label:`Codex`}];function Je(){let[e,t]=(0,G.useState)(null),[n,r]=(0,G.useState)(`claude`);(0,G.useEffect)(()=>{let e=!1;return re().then(n=>{e||t(new Set(Object.keys(n.providers??{})))}).catch(()=>{e||t(new Set([`claude`]))}),()=>{e=!0}},[]);let i=qe.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)(k,{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)(Ve,{}):(0,K.jsx)(Ke,{})]})}export{Je as AccountsSettingsSection};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{At as r,Cn as i,Cr as a,J as o,Kr as s,Zr as c,cr as l,ht as u,li as d,ln as f,ut as p,xn as m}from"./icons-BwyIKaTT.js";import{a as h}from"./api-client-xQDlhUTu.js";import{n as g}from"./utils-Bslrbb-G.js";import"./portal-container-context-NBi-KGK0.js";import"./chat-preparation-cache-190LLyy7.js";import{n as _}from"./use-is-mobile-VRV9eZy1.js";import{r as v}from"./clipboard-D-VCry-F.js";import{r as y,t as b}from"./button-C9ZXWb3b.js";import{a as x,i as S,n as C,o as w,r as T,t as E}from"./dialog-Dn_2tuYa.js";import{t as D}from"./mobile-bottom-sheet-DArbIyrD.js";import"./use-visual-viewport-MmugpRg-.js";import{t as O}from"./input-C3oVNCMq.js";import{Ai as k,Er as A,Gi as j,Gn as M,Hn as N,Kn as P,Ui as F,Un as I,Vn as ee,Wi as L,Wn as te}from"./index-EznfgwH9.js";import{_ as ne,a as re,h as ie,m as ae,o as oe,p as se,r as ce,v as le,x as R,y as ue}from"./api-settings-vmIRFNwZ.js";import{_ as de,a as fe,b as pe,c as me,d as he,g as z,h as B,l as ge,m as _e,n as ve,o as ye,p as V,r as be,s as H,t as xe,u as Se,x as U,y as W}from"./codex-reset-credit-button-Qths4oQl.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 Ce(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 we(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 Te(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 Ee(e){return e<.3?`bg-success`:e<.7?`bg-warning`:`bg-error`}function De({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),se(e).then(n).catch(()=>n([])).finally(()=>i(!1))},[e]);let s=(0,G.useMemo)(()=>t?Ce(t,a):null,[t,a]),c=(0,G.useMemo)(()=>s?we(s):[],[s]),l=(0,G.useMemo)(()=>s?Te(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 ${Ee(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 Oe({profile:e,accountId:t,onClose:n}){let r=[[`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)(d,{className:`size-4`})})]}),(0,K.jsx)(`div`,{className:`grid grid-cols-[80px_1fr] gap-x-3 gap-y-1 text-xs`,children:r.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)(De,{accountId:t})]})}function ke({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)(b,{variant:`outline`,onClick:n,className:`min-h-11`,children:`Cancel`}),(0,K.jsx)(b,{variant:`destructive`,autoFocus:!1,onClick:t,className:`min-h-11`,children:`Remove account`})]})]});return r?(0,K.jsx)(D,{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)(E,{open:!0,onOpenChange:e=>{e||n()},children:(0,K.jsxs)(C,{className:`sm:max-w-sm`,children:[(0,K.jsx)(x,{children:(0,K.jsx)(w,{className:`text-sm`,children:`Remove account`})}),i]})})}function Ae(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 je({open:e,onOpenChange:t,accounts:n,preselectId:r,onMessage:a}){let o=n.filter(e=>e.hasRefreshToken),[s,c]=(0,G.useState)(new Set),[l,d]=(0,G.useState)(``),[f,g]=(0,G.useState)(!1),[_,y]=(0,G.useState)(!1),[D,k]=(0,G.useState)(!1),[j,M]=(0,G.useState)(!1);e&&!j&&(c(r?new Set([r]):new Set(o.map(e=>e.id))),M(!0)),!e&&j&&M(!1);function N(){t(!1),d(``),g(!1),y(!1)}async function P(e){if(s.size===0)return;k(!0);let t=l.trim()||`ppm-hienlh`;try{let n={"Content-Type":`application/json`},r=h();r&&(n.Authorization=`Bearer ${r}`);let i=await fetch(`/api/accounts/export`,{method:`POST`,headers:n,body:JSON.stringify({password:t,accountIds:[...s],includeRefreshToken:f,refreshBeforeExport:_})});if(!i.ok){let e=await i.json();throw Error(e.error??`Export failed: ${i.status}`)}let o=await i.text();e&&await v(o)?a?.(`Backup copied to clipboard!`):(Ae(o),a?.(`Backup downloaded.`)),N()}catch{}k(!1)}let F=s.size>0&&!D;return(0,K.jsx)(E,{open:e,onOpenChange:e=>{e||N()},children:(0,K.jsxs)(C,{className:`sm:max-w-md`,children:[(0,K.jsxs)(x,{children:[(0,K.jsxs)(w,{className:`text-sm flex items-center gap-1.5`,children:[(0,K.jsx)(i,{className:`size-3.5`}),` Export Accounts`]}),(0,K.jsx)(T,{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:()=>c(s.size===o.length?new Set:new Set(o.map(e=>e.id))),children:s.size===o.length?`Deselect all`:`Select all`})]}),o.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:o.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`input`,{type:`checkbox`,id:`exp-${e.id}`,checked:s.has(e.id),onChange:t=>{let n=new Set(s);t.target.checked?n.add(e.id):n.delete(e.id),c(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)(A,{className:`text-xs`,children:[`Password `,(0,K.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,K.jsx)(O,{type:`password`,placeholder:`Leave empty for default`,value:l,onChange:e=>d(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:f,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=>y(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`})]}),f?(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)(S,{className:`gap-1.5 flex-col sm:flex-row`,children:[(0,K.jsx)(b,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,onClick:N,children:`Cancel`}),(0,K.jsxs)(b,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,disabled:!F,onClick:()=>P(!0),children:[(0,K.jsx)(p,{className:`size-3 mr-1`}),` Copy`]}),(0,K.jsx)(b,{size:`sm`,className:`text-xs h-7 cursor-pointer`,disabled:!F,onClick:()=>P(!1),children:D?(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)(u,{className:`size-3 mr-1`}),` Download`]})})]})]})})}function Me({open:e,onOpenChange:t,onSuccess:n}){let[r,a]=(0,G.useState)(``),[o,s]=(0,G.useState)(``),[c,l]=(0,G.useState)(!1),[u,d]=(0,G.useState)(null);function f(){t(!1),a(``),s(``),d(null)}async function p(){if(r.trim()){l(!0),d(null);try{let e=await ae({data:r.trim(),password:o.trim()||`ppm-hienlh`});f(),n(`Imported ${e.imported} account(s)`)}catch(e){d(e.message||`Import failed`)}l(!1)}}return(0,K.jsx)(E,{open:e,onOpenChange:e=>{e||f()},children:(0,K.jsxs)(C,{className:`sm:max-w-md`,children:[(0,K.jsxs)(x,{children:[(0,K.jsxs)(w,{className:`text-sm flex items-center gap-1.5`,children:[(0,K.jsx)(i,{className:`size-3.5`}),` Import Accounts`]}),(0,K.jsx)(T,{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)(A,{className:`text-xs`,children:`Backup data`}),(0,K.jsx)(`textarea`,{value:r,onChange:e=>a(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)(A,{className:`text-xs`,children:[`Password `,(0,K.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,K.jsx)(O,{type:`password`,placeholder:`Leave empty for default`,value:o,onChange:e=>s(e.target.value),className:`text-xs h-8`,autoComplete:`current-password`})]})]}),u&&(0,K.jsx)(`div`,{className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:u}),(0,K.jsxs)(S,{children:[(0,K.jsx)(b,{size:`sm`,variant:`outline`,className:`text-xs h-7 cursor-pointer`,onClick:f,children:`Cancel`}),(0,K.jsx)(b,{size:`sm`,className:`text-xs h-7 cursor-pointer`,disabled:!r.trim()||c,onClick:p,children:c?(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 Ne(e){return X?.addEventListener(`change`,e),()=>X?.removeEventListener(`change`,e)}function Pe(){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),oe().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 R({strategy:e}))},children:[(0,K.jsx)(te,{className:`w-full h-9 text-xs`,children:(0,K.jsx)(M,{})}),(0,K.jsxs)(N,{children:[(0,K.jsx)(I,{value:`round-robin`,children:`Round-robin`}),(0,K.jsx)(I,{value:`fill-first`,children:`Fill-first`}),(0,K.jsx)(I,{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 R({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)(P,{checked:e.cooldownEnabled,onCheckedChange:async e=>{t(await R({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 Fe({open:e,onOpenChange:t}){let n=(0,G.useSyncExternalStore)(Ne,Pe);return e?n?(0,K.jsx)(E,{open:e,onOpenChange:t,children:(0,K.jsxs)(C,{className:`sm:max-w-sm`,children:[(0,K.jsx)(x,{children:(0,K.jsxs)(w,{className:`text-sm flex items-center gap-2`,children:[(0,K.jsx)(a,{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)(a,{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)(d,{className:`size-4`})})]}),(0,K.jsx)(`div`,{className:`px-4 py-4 pb-8`,children:(0,K.jsx)(Z,{})})]})]}):null}var Ie=y(`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(Ie({variant:t}),e),...n})}function Le(e){let t=Math.floor(Date.now()/1e3);return e>t?`${Math.floor((e-t)/60)}m`:`exp`}function Re({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 le(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 ue(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)(P,{id:`sim-include-refresh`,checked:a,onCheckedChange:o,className:`cursor-pointer`}),(0,K.jsx)(A,{htmlFor:`sim-include-refresh`,className:`text-[11px] cursor-pointer`,children:`Include refresh tokens`})]}),(0,K.jsx)(b,{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)(b,{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:Le(e.expires)}),e.token?(0,K.jsx)(b,{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 ze(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 Be({open:e,onOpenChange:t,accounts:n}){let[i,a]=(0,G.useState)(new Map),[o,s]=(0,G.useState)(!1);async function c(e){a(t=>new Map(t).set(e,{loading:!0}));try{let t=await ne(e,o);a(n=>new Map(n).set(e,{loading:!1,result:t}))}catch(t){a(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)(E,{open:e,onOpenChange:t,children:(0,K.jsxs)(C,{className:`sm:max-w-xl max-h-[85vh] flex flex-col`,children:[(0,K.jsxs)(x,{children:[(0,K.jsxs)(w,{className:`text-sm flex items-center gap-1.5`,children:[(0,K.jsx)(r,{className:`size-4`}),` Token Test`]}),(0,K.jsx)(T,{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)(P,{id:`token-test-refresh`,checked:o,onCheckedChange:s,className:`cursor-pointer`}),(0,K.jsx)(A,{htmlFor:`token-test-refresh`,className:`text-[11px] cursor-pointer`,children:`Also test refresh`})]}),(0,K.jsx)(b,{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=i.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:ze(e.expiresAt)})]}),(0,K.jsx)(b,{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)(Re,{accounts:n})]}),(0,K.jsx)(S,{children:(0,K.jsx)(b,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Close`})})]})})}function Ve(){let{usages:e,accounts:t,activeAccountId:n,initialLoading:i,refreshing:o,flashIds:s,reload:d}=ge(),[p,h]=(0,G.useState)(null),[g,_]=(0,G.useState)(null),[v,y]=(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){d(),e&&h(e)}async function A(e,t){_(e);try{await ie(e,{status:t===`disabled`?`active`:`disabled`})}catch(e){h(e.message)}_(null),d()}async function j(){if(v){try{await ce(v.id),h(`Account "${v.display}" removed.`),d()}catch(e){h(`Failed to remove: ${e.message}`)}y(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)(B,{description:`Connect multiple Claude accounts. PPM rotates between them automatically to avoid rate limits.`,onRefresh:()=>void d(),refreshing:o,disabled:i,actions:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(b,{size:`sm`,className:`cursor-pointer gap-1.5`,onClick:()=>{O(void 0),E(`add`)},children:[(0,K.jsx)(l,{className:`size-4`}),` Add account`]}),(0,K.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>{w(null),E(`export`)},children:[(0,K.jsx)(u,{className:`size-4`}),` Export`]}),(0,K.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>E(`import`),children:[(0,K.jsx)(c,{className:`size-4`}),` Import`]}),(0,K.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>E(`rotation`),children:[(0,K.jsx)(a,{className:`size-4`}),` Rotation`]}),(0,K.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>E(`token-test`),children:[(0,K.jsx)(r,{className:`size-4`}),` Token test`]})]})}),(0,K.jsx)(z,{message:p,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 `,pe(new Date(N).getTime())]})]}),i?(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)(f,{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)(V,{children:e.map(e=>(0,K.jsx)(Se,{layout:`strip`,entry:e,isActive:e.accountId===n,accountInfo:M.get(e.accountId),onToggle:A,toggling:g===e.accountId,onDelete:(e,t)=>y({id:e,display:t}),onExport:e=>{w(e),E(`export`)},onViewProfile:(e,t)=>S({profile:e,accountId:t}),onReauth:()=>{O({id:e.accountId,label:e.accountLabel??e.accountId.slice(0,8)}),E(`add`)},flash:s.has(e.accountId)},e.accountId))})]}),x&&(0,K.jsx)(Oe,{profile:x.profile,accountId:x.accountId,onClose:()=>S(null)}),v&&(0,K.jsx)(ke,{display:v.display,onConfirm:()=>void j(),onCancel:()=>y(null)}),(0,K.jsx)(me,{open:T===`add`,onOpenChange:e=>{E(e?`add`:null),e||O(void 0)},onSuccess:k,signInAgainFor:D}),(0,K.jsx)(je,{open:T===`export`,onOpenChange:e=>{E(e?`export`:null),e||w(null)},accounts:t,preselectId:C,onMessage:h}),(0,K.jsx)(Me,{open:T===`import`,onOpenChange:e=>E(e?`import`:null),onSuccess:k}),(0,K.jsx)(Fe,{open:T===`rotation`,onOpenChange:e=>E(e?`rotation`:null)}),(0,K.jsx)(Be,{open:T===`token-test`,onOpenChange:e=>E(e?`token-test`:null),accounts:t})]})}function He({mode:e,onOpenChange:t,password:n,onPasswordChange:r,busy:a,onExport:o,onImport:s,error:l}){let d=(0,G.useRef)(null),f=e===`export`;return(0,K.jsx)(E,{open:e!==null,onOpenChange:t,children:(0,K.jsxs)(C,{className:`sm:max-w-md`,children:[(0,K.jsxs)(x,{children:[(0,K.jsxs)(w,{className:`text-sm flex items-center gap-1.5`,children:[(0,K.jsx)(i,{className:`size-4`}),` `,f?`Export Codex Accounts`:`Import Codex Accounts`]}),(0,K.jsx)(T,{className:`text-xs leading-relaxed`,children:f?`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)(A,{htmlFor:`codex-backup-password`,className:`text-xs`,children:`Password`}),(0,K.jsx)(O,{id:`codex-backup-password`,type:`password`,placeholder:f?`Choose a password`:`Password used for the export`,value:n,onChange:e=>r(e.target.value),className:`text-xs`,autoComplete:f?`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.`})]}),l&&(0,K.jsx)(`div`,{className:`text-[11px] p-2 rounded bg-error/10 text-error`,children:l}),(0,K.jsx)(`input`,{ref:d,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)(S,{children:[(0,K.jsx)(b,{size:`sm`,variant:`outline`,className:`text-xs cursor-pointer`,onClick:()=>t(!1),children:`Cancel`}),(0,K.jsxs)(b,{size:`sm`,className:`text-xs cursor-pointer gap-1.5`,disabled:!n.trim()||a,onClick:()=>f?o():d.current?.click(),children:[a?(0,K.jsx)(m,{className:`size-3.5 animate-spin`}):f?(0,K.jsx)(u,{className:`size-3.5`}):(0,K.jsx)(c,{className:`size-3.5`}),f?`Download backup`:`Choose file`]})]})]})})}var Ue=[{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 We({open:e,onOpenChange:t,strategy:n,onChange:r}){return(0,K.jsx)(E,{open:e,onOpenChange:t,children:(0,K.jsxs)(C,{className:`sm:max-w-md`,children:[(0,K.jsxs)(x,{children:[(0,K.jsx)(w,{className:`text-sm`,children:`Codex Rotation`}),(0,K.jsx)(T,{className:`text-xs leading-relaxed`,children:`How a new chat chooses among your Codex accounts.`})]}),(0,K.jsx)(`div`,{className:`space-y-2`,children:Ue.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)(S,{children:(0,K.jsx)(b,{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 Ge({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)(W,{label:`5-Hour Session`,pct:$(e.fiveHour),reset:U(e.session),resetsAt:e.session?.resetsAt}),(t||e.weekly!=null)&&(0,K.jsx)(W,{label:`Weekly`,pct:$(e.sevenDay),reset:U(e.weekly),resetsAt:e.weekly?.resetsAt})]})}function Ke(){let[e,t]=(0,G.useState)(null),n=fe(()=>t(null)),[r,i]=(0,G.useState)(null);return(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsx)(B,{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)(b,{size:`sm`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`add`),children:[(0,K.jsx)(l,{className:`size-4`}),` Add account`]}),(0,K.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`export`),children:[(0,K.jsx)(u,{className:`size-4`}),` Export`]}),(0,K.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`import`),children:[(0,K.jsx)(c,{className:`size-4`}),` Import`]}),(0,K.jsxs)(b,{size:`sm`,variant:`outline`,className:`cursor-pointer gap-1.5`,onClick:()=>t(`rotation`),children:[(0,K.jsx)(a,{className:`size-4`}),` Rotation`]})]})}),(0,K.jsx)(z,{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)(f,{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)(V,{children:n.accounts.map(e=>{let t=n.usages[e.id]??{};return(0,K.jsxs)(_e,{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)(de,{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`?()=>i(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}),H(e.planType)&&(0,K.jsx)(`span`,{className:`text-[10px] text-text-subtle shrink-0`,children:H(e.planType)}),(0,K.jsx)(P,{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)(F,{children:[(0,K.jsx)(j,{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)(s,{className:`size-4`})})}),(0,K.jsx)(L,{side:`top`,children:`Remove account`})]})]}),(0,K.jsx)(Ge,{usage:t}),t.resetCredits&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap text-[10px] text-text-subtle`,children:[(0,K.jsx)(he,{credits:t.resetCredits}),(0,K.jsx)(xe,{account:e,usage:t,onDone:e=>{n.setMsg(e),n.load()}})]}),t.session==null&&(()=>{let r=ye(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)(F,{children:[(0,K.jsx)(j,{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)(o,{className:`size-3.5`})})}),(0,K.jsx)(L,{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)(P,{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)(be,{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)(He,{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)(ve,{account:r,onClose:()=>i(null),onDone:()=>void n.load()}),(0,K.jsx)(We,{open:e===`rotation`,onOpenChange:e=>t(e?`rotation`:null),strategy:n.strategy,onChange:e=>void n.changeStrategy(e)})]})}var qe=[{id:`claude`,label:`Claude`},{id:`codex`,label:`Codex`}];function Je(){let[e,t]=(0,G.useState)(null),[n,r]=(0,G.useState)(`claude`);(0,G.useEffect)(()=>{let e=!1;return re().then(n=>{e||t(new Set(Object.keys(n.providers??{})))}).catch(()=>{e||t(new Set([`claude`]))}),()=>{e=!0}},[]);let i=qe.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)(k,{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)(Ve,{}):(0,K.jsx)(Ke,{})]})}export{Je as AccountsSettingsSection};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-session-window-content-CwokWtJq.js","assets/rolldown-runtime-C5c2KzVm.js","assets/index-COwBji1t.js","assets/preload-helper-CM8YhcCa.js","assets/vendor-ui-BTSIXzhZ.js","assets/vendor-markdown-C-P1aR4p.js","assets/button-C9ZXWb3b.js","assets/utils-Bslrbb-G.js","assets/createLucideIcon-D9_fdOKS.js","assets/file-diff-CcDhJkXB.js","assets/git-commit-horizontal-BPdj2L1i.js","assets/api-client-xQDlhUTu.js","assets/react-BZ0kba1-.js","assets/open-db-tabs-CtWIWHOa.js","assets/window-store-DqX_qmkQ.js","assets/panel-store-BJhazigC.js","assets/session-list-sync-triggers-DtJI5KF0.js","assets/project-store-BLGl9IAO.js","assets/project-framework-store-DwLxaRan.js","assets/explorer-model-BtJN4MZ9.js","assets/db-sidebar-reveal-_qw0CliT.js","assets/settings-store-B4mLp19V.js","assets/use-is-mobile-VRV9eZy1.js","assets/db-types-CNhENouW.js","assets/tab-store-D5I52eLN.js","assets/use-db-driver-installed-anzWkGi5.js","assets/impexp-state-BWKOuRGj.js","assets/file-store-BQ41vIs5.js","assets/sql-identifiers-DDISwQor.js","assets/db-explorer-store-BmpvDHz6.js","assets/onboarding-quick-orientation-CTHtIRib.js","assets/dialog-Dn_2tuYa.js","assets/portal-container-context-NBi-KGK0.js","assets/icons-BwyIKaTT.js","assets/format-file-meta-DdYtk07C.js","assets/fs-api-CFtQzsIJ.js","assets/open-settings-EXR4zoZG.js","assets/settings-categories-Ajj4ui27.js","assets/adaptive-context-menu-C4jNSORA.js","assets/context-menu-BCuZYfWC.js","assets/mobile-bottom-sheet-DArbIyrD.js","assets/use-visual-viewport-MmugpRg-.js","assets/dropdown-menu-BQidk_OJ.js","assets/input-C3oVNCMq.js","assets/scroll-area-DOlQJGZp.js","assets/start-ellipsis-CU8GkxaV.js","assets/chat-preparation-cache-190LLyy7.js","assets/clipboard-D-VCry-F.js","assets/file-icons-JInFtBVl.js","assets/format-date-CSHaU2wN.js","assets/git-repo-store-CKB5fdNP.js","assets/patch-tab-metadata-C92YkrRX.js","assets/ws-auth-CbF6GqxP.js","assets/apply-theme-ORrEdHKT.js","assets/resolve-theme-BqoL27BW.js","assets/index-BACBJm4i.css","assets/libesm-B6LsX5wH.js","assets/tool-cards-oZ6cptRr.js","assets/db-ai-tools-CVbbW_MZ.js","assets/split-sql-statements-DcAeXbk_.js","assets/agent-session-sheet-store-BAfLnsLX.js","assets/image-preview-geometry-CCq8rio7.js","assets/use-blob-url-Clm7wbB_.js","assets/html-preview-loads-CMWBC-iv.js","assets/image-gallery-BuxSgBug.js","assets/design-canvas-check-BIHc2d_k.js"])))=>i.map(i=>d[i]);
2
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{li as r}from"./icons-BwyIKaTT.js";import{t as i}from"./preload-helper-CM8YhcCa.js";import"./portal-container-context-NBi-KGK0.js";import{t as a}from"./mobile-bottom-sheet-DArbIyrD.js";import"./use-visual-viewport-MmugpRg-.js";import{t as o}from"./agent-session-sheet-store-BAfLnsLX.js";var s=e(t(),1),c=n(),l=(0,s.lazy)(()=>i(()=>import(`./agent-session-window-content-CwokWtJq.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65])));function u(){let e=o(e=>e.payload),t=o(e=>e.close);return e?(0,c.jsxs)(a,{open:!0,onClose:t,zIndex:45,className:`flex h-[var(--sheet-vh)] flex-col p-0`,children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[(0,c.jsx)(`span`,{className:`truncate text-sm font-medium text-text-primary`,children:e.title??`Agent session`}),(0,c.jsx)(`button`,{type:`button`,onClick:t,className:`ml-auto flex size-11 items-center justify-center rounded text-text-secondary hover:text-text-primary`,"aria-label":`Close`,children:(0,c.jsx)(r,{className:`size-5`})})]}),(0,c.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,c.jsx)(s.Suspense,{fallback:(0,c.jsx)(`div`,{className:`p-4 text-sm text-text-2`,children:`Loading…`}),children:(0,c.jsx)(l,{id:`sheet-${e.sessionId}`,payload:e})})})]}):null}export{u as AgentSessionSheet};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-session-window-content-zCzFZ0XT.js","assets/rolldown-runtime-C5c2KzVm.js","assets/index-EznfgwH9.js","assets/preload-helper-CM8YhcCa.js","assets/vendor-ui-BTSIXzhZ.js","assets/vendor-markdown-C-P1aR4p.js","assets/button-C9ZXWb3b.js","assets/utils-Bslrbb-G.js","assets/createLucideIcon-D9_fdOKS.js","assets/file-diff-CcDhJkXB.js","assets/git-commit-horizontal-BPdj2L1i.js","assets/api-client-xQDlhUTu.js","assets/react-BZ0kba1-.js","assets/open-db-tabs-CtWIWHOa.js","assets/window-store-DqX_qmkQ.js","assets/panel-store-BJhazigC.js","assets/session-list-sync-triggers-DtJI5KF0.js","assets/project-store-BLGl9IAO.js","assets/project-framework-store-DwLxaRan.js","assets/explorer-model-BtJN4MZ9.js","assets/db-sidebar-reveal-_qw0CliT.js","assets/settings-store-B4mLp19V.js","assets/use-is-mobile-VRV9eZy1.js","assets/db-types-CNhENouW.js","assets/tab-store-D5I52eLN.js","assets/use-db-driver-installed-anzWkGi5.js","assets/impexp-state-BWKOuRGj.js","assets/file-store-BQ41vIs5.js","assets/sql-identifiers-DDISwQor.js","assets/db-explorer-store-BmpvDHz6.js","assets/onboarding-quick-orientation-CTHtIRib.js","assets/dialog-Dn_2tuYa.js","assets/portal-container-context-NBi-KGK0.js","assets/icons-BwyIKaTT.js","assets/format-file-meta-DdYtk07C.js","assets/fs-api-CFtQzsIJ.js","assets/open-settings-EXR4zoZG.js","assets/settings-categories-Ajj4ui27.js","assets/adaptive-context-menu-C4jNSORA.js","assets/context-menu-BCuZYfWC.js","assets/mobile-bottom-sheet-DArbIyrD.js","assets/use-visual-viewport-MmugpRg-.js","assets/dropdown-menu-BQidk_OJ.js","assets/input-C3oVNCMq.js","assets/scroll-area-DOlQJGZp.js","assets/start-ellipsis-CU8GkxaV.js","assets/chat-preparation-cache-190LLyy7.js","assets/clipboard-D-VCry-F.js","assets/file-icons-JInFtBVl.js","assets/format-date-CSHaU2wN.js","assets/git-repo-store-CKB5fdNP.js","assets/patch-tab-metadata-C92YkrRX.js","assets/ws-auth-CbF6GqxP.js","assets/apply-theme-ORrEdHKT.js","assets/resolve-theme-BqoL27BW.js","assets/index-BACBJm4i.css","assets/libesm-B6LsX5wH.js","assets/tool-cards-DXV9SEE8.js","assets/db-ai-tools-CVbbW_MZ.js","assets/split-sql-statements-DcAeXbk_.js","assets/agent-session-sheet-store-BAfLnsLX.js","assets/image-preview-geometry-CCq8rio7.js","assets/use-blob-url-Clm7wbB_.js","assets/html-preview-loads-CMWBC-iv.js","assets/image-gallery-BuxSgBug.js","assets/design-canvas-check-BIHc2d_k.js"])))=>i.map(i=>d[i]);
2
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{li as r}from"./icons-BwyIKaTT.js";import{t as i}from"./preload-helper-CM8YhcCa.js";import"./portal-container-context-NBi-KGK0.js";import{t as a}from"./mobile-bottom-sheet-DArbIyrD.js";import"./use-visual-viewport-MmugpRg-.js";import{t as o}from"./agent-session-sheet-store-BAfLnsLX.js";var s=e(t(),1),c=n(),l=(0,s.lazy)(()=>i(()=>import(`./agent-session-window-content-zCzFZ0XT.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65])));function u(){let e=o(e=>e.payload),t=o(e=>e.close);return e?(0,c.jsxs)(a,{open:!0,onClose:t,zIndex:45,className:`flex h-[var(--sheet-vh)] flex-col p-0`,children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[(0,c.jsx)(`span`,{className:`truncate text-sm font-medium text-text-primary`,children:e.title??`Agent session`}),(0,c.jsx)(`button`,{type:`button`,onClick:t,className:`ml-auto flex size-11 items-center justify-center rounded text-text-secondary hover:text-text-primary`,"aria-label":`Close`,children:(0,c.jsx)(r,{className:`size-5`})})]}),(0,c.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,c.jsx)(s.Suspense,{fallback:(0,c.jsx)(`div`,{className:`p-4 text-sm text-text-2`,children:`Loading…`}),children:(0,c.jsx)(l,{id:`sheet-${e.sessionId}`,payload:e})})})]}):null}export{u as AgentSessionSheet};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{L as r,P as i,xn as a}from"./icons-BwyIKaTT.js";import"./api-client-xQDlhUTu.js";import{n as o}from"./utils-Bslrbb-G.js";import"./window-store-DqX_qmkQ.js";import"./panel-store-BJhazigC.js";import"./project-store-BLGl9IAO.js";import"./project-framework-store-DwLxaRan.js";import"./session-list-sync-triggers-DtJI5KF0.js";import"./tab-store-D5I52eLN.js";import"./file-store-BQ41vIs5.js";import"./use-is-mobile-VRV9eZy1.js";import"./fs-api-CFtQzsIJ.js";import{F as s,I as c,Xr as l}from"./index-COwBji1t.js";import"./agent-session-sheet-store-BAfLnsLX.js";import"./libesm-B6LsX5wH.js";import{f as u,l as d,t as f,u as p}from"./tool-cards-oZ6cptRr.js";import"./use-blob-url-Clm7wbB_.js";import"./design-canvas-check-BIHc2d_k.js";import"./db-ai-tools-CVbbW_MZ.js";var m=e(t(),1),h=2e3;function g(e,t){let n=t.reset?[]:e.slice();for(let{ev:e,ts:r,k:i,replace:a}of t.events){let t=n.findIndex(e=>e.k===i);if(t!==-1){a&&(n[t]={k:i,ts:r,ev:e});continue}let o=n.length;for(;o>0&&n[o-1].ts>r;)o--;n.splice(o,0,{k:i,ts:r,ev:e})}return n.length>2e3?n.slice(n.length-h):n}function _(){return`ats-${Math.random().toString(36).slice(2,10)}`}function v(e){let{projectName:t,providerId:n,sessionId:r,source:i,fallbackEvents:a}=e,[o,l]=(0,m.useState)([]),[u,d]=(0,m.useState)(!1),[f,p]=(0,m.useState)(!1),[h,v]=(0,m.useState)(!0),[y,b]=(0,m.useState)(null);(0,m.useEffect)(()=>{let e=_(),a=[],o;l([]),d(!1),p(!1),v(!0),b(null);let u=()=>{c(JSON.stringify({type:`agent-transcript:subscribe`,subId:e,projectName:t,providerId:n,sessionId:r,source:i,...o?{cursor:o}:{}}))},f=t=>{let n=t.detail;n.subId===e&&(a=g(a,n),o=n.cursor,l(a),d(n.available),p(n.running),v(!1),b(null))},m=t=>{let n=t.detail;n.subId===e&&(d(!1),v(!1),b(n.code))};window.addEventListener(`agent-transcript:events`,f),window.addEventListener(`agent-transcript:error`,m);let h=s(u);return u(),()=>{window.removeEventListener(`agent-transcript:events`,f),window.removeEventListener(`agent-transcript:error`,m),h(),c(JSON.stringify({type:`agent-transcript:unsubscribe`,subId:e}))}},[JSON.stringify([t,n,r,i])]);let x=(0,m.useMemo)(()=>o.map(e=>e.ev),[o]);return{events:u?x:a??[],available:u,running:f,loading:h,error:y}}var y=n();function b(e){return e.filter(e=>e.type===`tool_use`).length}function x({status:e}){return e===`loading`?null:e===`running`?(0,y.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-primary shrink-0`,children:[(0,y.jsx)(a,{className:`size-2.5 animate-spin`}),` running`]}):e===`failed`?(0,y.jsx)(`span`,{className:`text-[10px] text-error shrink-0`,children:`failed`}):(0,y.jsx)(`span`,{className:`text-[10px] text-success shrink-0`,children:`done`})}function S({payload:e}){let t=e??{},n=t.sessionId?d(t.sessionId,t.source):``,s=p(e=>n?e.entries[n]:void 0),{events:c,available:h,running:g,loading:_,error:S}=v({projectName:t.projectName,providerId:t.providerId,sessionId:t.sessionId,source:t.source,fallbackEvents:s}),[C,w]=(0,m.useState)(!1),T=l(),E=(0,m.useMemo)(()=>b(c),[c]),D=c[c.length-1],O=!g&&!!D&&D.type===`tool_result`&&!!D.isError,k=_?`loading`:g?`running`:O?`failed`:`done`;return(0,y.jsxs)(`div`,{className:`flex flex-col h-full min-h-0 bg-surface @container`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b border-border/30 shrink-0`,children:[(0,y.jsx)(`span`,{className:`truncate text-xs font-medium`,children:t.title??`Agent session`}),c.length>0&&(0,y.jsx)(`span`,{className:`text-[10px] text-text-subtle shrink-0`,children:u(E)}),(0,y.jsx)(x,{status:k}),!h&&!_&&(0,y.jsx)(`span`,{className:`ml-auto text-[10px] text-text-subtle shrink-0`,title:`No live transcript for this session — showing steps already held in memory`,children:`offline`})]}),!!t.prompt&&(0,y.jsxs)(`div`,{className:`border-b border-border/30 shrink-0`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>w(e=>!e),className:o(`flex w-full items-center gap-1.5 px-3 py-1.5 text-[11px] text-text-subtle hover:text-foreground`,T?`min-h-[44px]`:`min-h-[28px]`),children:[C?(0,y.jsx)(i,{className:`size-3`}):(0,y.jsx)(r,{className:`size-3`}),`Prompt`]}),C&&(0,y.jsx)(`div`,{className:`px-3 pb-2 text-[11px] text-text-secondary whitespace-pre-wrap select-text`,children:t.prompt})]}),_&&c.length===0?(0,y.jsxs)(`div`,{className:`flex-1 flex items-center justify-center gap-2 text-xs text-text-subtle`,children:[(0,y.jsx)(a,{className:`size-3 animate-spin`}),`Loading session…`]}):c.length===0?(0,y.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-xs text-text-subtle px-4 text-center`,children:S?`Could not load this session`:`No recorded steps`}):(0,y.jsx)(f,{events:c,projectName:t.projectName,variant:`window`,className:`flex-1 min-h-0 overflow-y-auto px-3 py-2 space-y-1`})]})}export{S as default};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{L as r,P as i,xn as a}from"./icons-BwyIKaTT.js";import"./api-client-xQDlhUTu.js";import{n as o}from"./utils-Bslrbb-G.js";import"./window-store-DqX_qmkQ.js";import"./panel-store-BJhazigC.js";import"./project-store-BLGl9IAO.js";import"./project-framework-store-DwLxaRan.js";import"./session-list-sync-triggers-DtJI5KF0.js";import"./tab-store-D5I52eLN.js";import"./file-store-BQ41vIs5.js";import"./use-is-mobile-VRV9eZy1.js";import"./fs-api-CFtQzsIJ.js";import{F as s,I as c,Xr as l}from"./index-EznfgwH9.js";import"./agent-session-sheet-store-BAfLnsLX.js";import"./libesm-B6LsX5wH.js";import{f as u,l as d,t as f,u as p}from"./tool-cards-DXV9SEE8.js";import"./use-blob-url-Clm7wbB_.js";import"./design-canvas-check-BIHc2d_k.js";import"./db-ai-tools-CVbbW_MZ.js";var m=e(t(),1),h=2e3;function g(e,t){let n=t.reset?[]:e.slice();for(let{ev:e,ts:r,k:i,replace:a}of t.events){let t=n.findIndex(e=>e.k===i);if(t!==-1){a&&(n[t]={k:i,ts:r,ev:e});continue}let o=n.length;for(;o>0&&n[o-1].ts>r;)o--;n.splice(o,0,{k:i,ts:r,ev:e})}return n.length>2e3?n.slice(n.length-h):n}function _(){return`ats-${Math.random().toString(36).slice(2,10)}`}function v(e){let{projectName:t,providerId:n,sessionId:r,source:i,fallbackEvents:a}=e,[o,l]=(0,m.useState)([]),[u,d]=(0,m.useState)(!1),[f,p]=(0,m.useState)(!1),[h,v]=(0,m.useState)(!0),[y,b]=(0,m.useState)(null);(0,m.useEffect)(()=>{let e=_(),a=[],o;l([]),d(!1),p(!1),v(!0),b(null);let u=()=>{c(JSON.stringify({type:`agent-transcript:subscribe`,subId:e,projectName:t,providerId:n,sessionId:r,source:i,...o?{cursor:o}:{}}))},f=t=>{let n=t.detail;n.subId===e&&(a=g(a,n),o=n.cursor,l(a),d(n.available),p(n.running),v(!1),b(null))},m=t=>{let n=t.detail;n.subId===e&&(d(!1),v(!1),b(n.code))};window.addEventListener(`agent-transcript:events`,f),window.addEventListener(`agent-transcript:error`,m);let h=s(u);return u(),()=>{window.removeEventListener(`agent-transcript:events`,f),window.removeEventListener(`agent-transcript:error`,m),h(),c(JSON.stringify({type:`agent-transcript:unsubscribe`,subId:e}))}},[JSON.stringify([t,n,r,i])]);let x=(0,m.useMemo)(()=>o.map(e=>e.ev),[o]);return{events:u?x:a??[],available:u,running:f,loading:h,error:y}}var y=n();function b(e){return e.filter(e=>e.type===`tool_use`).length}function x({status:e}){return e===`loading`?null:e===`running`?(0,y.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-primary shrink-0`,children:[(0,y.jsx)(a,{className:`size-2.5 animate-spin`}),` running`]}):e===`failed`?(0,y.jsx)(`span`,{className:`text-[10px] text-error shrink-0`,children:`failed`}):(0,y.jsx)(`span`,{className:`text-[10px] text-success shrink-0`,children:`done`})}function S({payload:e}){let t=e??{},n=t.sessionId?d(t.sessionId,t.source):``,s=p(e=>n?e.entries[n]:void 0),{events:c,available:h,running:g,loading:_,error:S}=v({projectName:t.projectName,providerId:t.providerId,sessionId:t.sessionId,source:t.source,fallbackEvents:s}),[C,w]=(0,m.useState)(!1),T=l(),E=(0,m.useMemo)(()=>b(c),[c]),D=c[c.length-1],O=!g&&!!D&&D.type===`tool_result`&&!!D.isError,k=_?`loading`:g?`running`:O?`failed`:`done`;return(0,y.jsxs)(`div`,{className:`flex flex-col h-full min-h-0 bg-surface @container`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b border-border/30 shrink-0`,children:[(0,y.jsx)(`span`,{className:`truncate text-xs font-medium`,children:t.title??`Agent session`}),c.length>0&&(0,y.jsx)(`span`,{className:`text-[10px] text-text-subtle shrink-0`,children:u(E)}),(0,y.jsx)(x,{status:k}),!h&&!_&&(0,y.jsx)(`span`,{className:`ml-auto text-[10px] text-text-subtle shrink-0`,title:`No live transcript for this session — showing steps already held in memory`,children:`offline`})]}),!!t.prompt&&(0,y.jsxs)(`div`,{className:`border-b border-border/30 shrink-0`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>w(e=>!e),className:o(`flex w-full items-center gap-1.5 px-3 py-1.5 text-[11px] text-text-subtle hover:text-foreground`,T?`min-h-[44px]`:`min-h-[28px]`),children:[C?(0,y.jsx)(i,{className:`size-3`}):(0,y.jsx)(r,{className:`size-3`}),`Prompt`]}),C&&(0,y.jsx)(`div`,{className:`px-3 pb-2 text-[11px] text-text-secondary whitespace-pre-wrap select-text`,children:t.prompt})]}),_&&c.length===0?(0,y.jsxs)(`div`,{className:`flex-1 flex items-center justify-center gap-2 text-xs text-text-subtle`,children:[(0,y.jsx)(a,{className:`size-3 animate-spin`}),`Loading session…`]}):c.length===0?(0,y.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-xs text-text-subtle px-4 text-center`,children:S?`Could not load this session`:`No recorded steps`}):(0,y.jsx)(f,{events:c,projectName:t.projectName,variant:`window`,className:`flex-1 min-h-0 overflow-y-auto px-3 py-2 space-y-1`})]})}export{S as default};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{Cn as r,Yr as i,r as a,vr as o,xn as s}from"./icons-BwyIKaTT.js";import{k as c}from"./api-client-xQDlhUTu.js";import"./settings-store-B4mLp19V.js";import{n as l}from"./utils-Bslrbb-G.js";import{Bn as u,In as d,J as f,Ln as p,Rn as m,Y as h,zn as g}from"./index-COwBji1t.js";import{t as _}from"./use-monaco-theme-1ANtPWqA.js";var v=e(t(),1),y=n();function b({metadata:e}){let t=e?.filePath,n=e?.name,l=e?.resourceType??`skill`,b=e?.scope??`user`,S=e?.readOnly===!0,C=e?.shadowed===!0,w=e?.shadowedBy,T=e?.project??``,[E,D]=(0,v.useState)(``),[O,k]=(0,v.useState)(``),[A,j]=(0,v.useState)(!0),[M,N]=(0,v.useState)(null),[P,F]=(0,v.useState)(!1),I=_(),L=(0,v.useRef)(``),R=E!==O;(0,v.useEffect)(()=>{let e=!1;return j(!0),N(null),g(t,T).then(t=>{e||(D(t.content),k(t.content),L.current=t.content)}).catch(t=>{e||N(t.message)}).finally(()=>{e||j(!1)}),()=>{e=!0}},[t,T]);let z=(0,v.useCallback)(async()=>{if(S||P)return;let e=L.current;if(e!==O){F(!0);try{await u(t,e,T),k(e),D(e),c.success(`Saved`),m.getState().reload()}catch(e){c.error(e.message)}finally{F(!1)}}},[t,T,O,S,P]);(0,v.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),z())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[z]);let B=p[l];return(0,y.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[(0,y.jsx)(B,{className:`size-4 text-text-subtle`}),(0,y.jsx)(`span`,{className:`text-sm font-semibold`,children:n}),(0,y.jsx)(d,{scope:b}),R&&!S&&(0,y.jsx)(`span`,{className:`size-1.5 rounded-full bg-primary`,title:`Unsaved changes`}),(0,y.jsx)(`div`,{className:`flex-1`}),(0,y.jsxs)(`span`,{className:`hidden sm:block text-[11px] text-text-subtle`,children:[l,` · markdown`]}),!S&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`button`,{onClick:()=>D(O),disabled:!R||P,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,y.jsx)(i,{className:`size-3.5`}),` Revert`]}),(0,y.jsxs)(`button`,{onClick:()=>void z(),disabled:!R||P,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:[P?(0,y.jsx)(s,{className:`size-3.5 animate-spin`}):(0,y.jsx)(o,{className:`size-3.5`}),` Save`]})]})]}),S&&(0,y.jsx)(x,{icon:r,tone:`muted`,children:`Bundled resource — read-only. Duplicate it (from the AI Resources panel) to make an editable copy.`}),C&&w&&(0,y.jsxs)(x,{icon:a,tone:`warn`,children:[`This `,l,` is overridden by another “`,w.name,`” from a higher-priority source (`,w.source,`). It is currently inactive.`]}),(0,y.jsx)(`div`,{className:`min-h-0 flex-1`,children:A?(0,y.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,y.jsx)(s,{className:`size-5 animate-spin text-primary`})}):M?(0,y.jsx)(`div`,{className:`p-6 text-center text-sm text-destructive`,children:M}):(0,y.jsx)(h,{beforeMount:f,height:`100%`,language:`markdown`,theme:I,value:E,onChange:e=>{let t=e??``;L.current=t,D(t)},options:{readOnly:S,minimap:{enabled:!1},fontSize:13,wordWrap:`on`,scrollBeyondLastLine:!1,lineNumbers:`on`}})})]})}function x({icon:e,tone:t,children:n}){return(0,y.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,y.jsx)(e,{className:`mt-0.5 size-3.5 shrink-0`}),(0,y.jsx)(`span`,{children:n})]})}export{b as AiResourceEditor};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import{Cn as r,Yr as i,r as a,vr as o,xn as s}from"./icons-BwyIKaTT.js";import{k as c}from"./api-client-xQDlhUTu.js";import"./settings-store-B4mLp19V.js";import{n as l}from"./utils-Bslrbb-G.js";import{Bn as u,In as d,J as f,Ln as p,Rn as m,Y as h,zn as g}from"./index-EznfgwH9.js";import{t as _}from"./use-monaco-theme-nu5Fogu3.js";var v=e(t(),1),y=n();function b({metadata:e}){let t=e?.filePath,n=e?.name,l=e?.resourceType??`skill`,b=e?.scope??`user`,S=e?.readOnly===!0,C=e?.shadowed===!0,w=e?.shadowedBy,T=e?.project??``,[E,D]=(0,v.useState)(``),[O,k]=(0,v.useState)(``),[A,j]=(0,v.useState)(!0),[M,N]=(0,v.useState)(null),[P,F]=(0,v.useState)(!1),I=_(),L=(0,v.useRef)(``),R=E!==O;(0,v.useEffect)(()=>{let e=!1;return j(!0),N(null),g(t,T).then(t=>{e||(D(t.content),k(t.content),L.current=t.content)}).catch(t=>{e||N(t.message)}).finally(()=>{e||j(!1)}),()=>{e=!0}},[t,T]);let z=(0,v.useCallback)(async()=>{if(S||P)return;let e=L.current;if(e!==O){F(!0);try{await u(t,e,T),k(e),D(e),c.success(`Saved`),m.getState().reload()}catch(e){c.error(e.message)}finally{F(!1)}}},[t,T,O,S,P]);(0,v.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),z())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[z]);let B=p[l];return(0,y.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[(0,y.jsx)(B,{className:`size-4 text-text-subtle`}),(0,y.jsx)(`span`,{className:`text-sm font-semibold`,children:n}),(0,y.jsx)(d,{scope:b}),R&&!S&&(0,y.jsx)(`span`,{className:`size-1.5 rounded-full bg-primary`,title:`Unsaved changes`}),(0,y.jsx)(`div`,{className:`flex-1`}),(0,y.jsxs)(`span`,{className:`hidden sm:block text-[11px] text-text-subtle`,children:[l,` · markdown`]}),!S&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`button`,{onClick:()=>D(O),disabled:!R||P,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,y.jsx)(i,{className:`size-3.5`}),` Revert`]}),(0,y.jsxs)(`button`,{onClick:()=>void z(),disabled:!R||P,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:[P?(0,y.jsx)(s,{className:`size-3.5 animate-spin`}):(0,y.jsx)(o,{className:`size-3.5`}),` Save`]})]})]}),S&&(0,y.jsx)(x,{icon:r,tone:`muted`,children:`Bundled resource — read-only. Duplicate it (from the AI Resources panel) to make an editable copy.`}),C&&w&&(0,y.jsxs)(x,{icon:a,tone:`warn`,children:[`This `,l,` is overridden by another “`,w.name,`” from a higher-priority source (`,w.source,`). It is currently inactive.`]}),(0,y.jsx)(`div`,{className:`min-h-0 flex-1`,children:A?(0,y.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,y.jsx)(s,{className:`size-5 animate-spin text-primary`})}):M?(0,y.jsx)(`div`,{className:`p-6 text-center text-sm text-destructive`,children:M}):(0,y.jsx)(h,{beforeMount:f,height:`100%`,language:`markdown`,theme:I,value:E,onChange:e=>{let t=e??``;L.current=t,D(t)},options:{readOnly:S,minimap:{enabled:!1},fontSize:13,wordWrap:`on`,scrollBeyondLastLine:!1,lineNumbers:`on`}})})]})}function x({icon:e,tone:t,children:n}){return(0,y.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,y.jsx)(e,{className:`mt-0.5 size-3.5 shrink-0`}),(0,y.jsx)(`span`,{children:n})]})}export{b as AiResourceEditor};
@@ -1 +1 @@
1
- import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import{Kr as r,gt as i,hr as a,r as o}from"./icons-BwyIKaTT.js";import{r as s}from"./api-client-xQDlhUTu.js";import{t as c}from"./open-settings-EXR4zoZG.js";import{t as l}from"./button-C9ZXWb3b.js";import{t as u}from"./input-C3oVNCMq.js";import{Ai as d,Er as f,Gn as p,Hn as m,Kn as h,Pn as g,Un as _,Vn as v,Wn as y}from"./index-COwBji1t.js";import{a as b,b as x}from"./api-settings-vmIRFNwZ.js";var S=e(t(),1),C=n(),w=[128e3,272e3,4e5,512e3,872e3,1e6],T=[1e5,2e5,23e4,35e4,45e4,75e4,9e5];function E({id:e,label:t,value:n,presets:r,disabled:i,compact:a,onChange:o}){let[s,c]=(0,S.useState)(!!n&&!r.includes(Number(n))),l=a?`text-[11px]`:`text-sm`;return(0,C.jsxs)(`div`,{className:`space-y-1`,children:[(0,C.jsx)(f,{htmlFor:e,className:l,children:t}),(0,C.jsxs)(`select`,{id:e,value:s?`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`} ${l}`,onChange:e=>{let t=e.target.value;c(t===`custom`),t!==`custom`&&o(t===`default`?``:t)},children:[(0,C.jsx)(`option`,{value:`default`,children:`Codex default`}),r.map(e=>(0,C.jsxs)(`option`,{value:String(e),children:[e===1e6?`1M`:`${e/1e3}K`,` tokens`]},e)),(0,C.jsx)(`option`,{value:`custom`,children:`Custom...`})]}),s&&(0,C.jsx)(u,{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 D({config:e,compact:t,saving:n,onSave:r}){let[i,a]=(0,S.useState)(String(e?.model_context_window??``)),[o,s]=(0,S.useState)(String(e?.model_auto_compact_token_limit??``)),[c,l]=(0,S.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,C.jsxs)(`form`,{onSubmit:f,className:`space-y-2 rounded-md border border-border p-3`,children:[(0,C.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[(0,C.jsx)(E,{id:`codex-context-window`,label:`Context window (tokens)`,value:i,presets:w,disabled:n,compact:t,onChange:e=>{a(e),l(null)}}),(0,C.jsx)(E,{id:`codex-compact-threshold`,label:`Auto-compact threshold (tokens)`,value:o,presets:T,disabled:n,compact:t,onChange:e=>{s(e),l(null)}})]}),(0,C.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,C.jsx)(`p`,{role:`alert`,className:`${u} text-error`,children:c}),(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,C.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,C.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 O=[{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`},{value:`xhigh`,label:`Extra`},{value:`max`,label:`Max`}],k=[{value:`bypassPermissions`,label:`Bypass permissions (default)`},{value:`default`,label:`Ask before edits`},{value:`acceptEdits`,label:`Edit automatically`},{value:`plan`,label:`Plan mode`}],A={claude:`Claude`,cursor:`Cursor`,codex:`Codex`,gemini:`Gemini`};function j({compact:e}={}){let[t,n]=(0,S.useState)(null),[r,w]=(0,S.useState)(``),[T,E]=(0,S.useState)([]),[j,M]=(0,S.useState)(!1),[N,P]=(0,S.useState)(!1),[F,I]=(0,S.useState)(null),[L,R]=(0,S.useState)(0),[z,B]=(0,S.useState)([]),[V,H]=(0,S.useState)(!1);(0,S.useEffect)(()=>{b().then(e=>{n(e),w(e.default_provider??`claude`)}).catch(e=>I(e.message))},[]),(0,S.useEffect)(()=>{r&&s.get(`/api/settings/ai/providers/status`).then(B).catch(()=>B([]))},[r]);let U=z.find(e=>e.id===r&&!e.registered);(0,S.useEffect)(()=>{r&&(M(!0),s.get(`/api/settings/ai/providers/${r}/models`).then(E).catch(()=>E([])).finally(()=>M(!1)))},[r,!U]);let W=async()=>{H(!0);try{let e=await s.post(`/api/settings/ai/providers/${r}/probe`);B(t=>t.map(t=>t.id===e.id?e:t))}catch(e){I(e.message)}finally{H(!1)}},G=t?Object.keys(t.providers).filter(e=>e!==`mock`).map(e=>({id:e,name:A[e]??e})):[],K=t?.providers[r],q=K?.type===`agent-sdk`||!K?.type&&r===`claude`,J=async e=>{if(!t)return!1;P(!0),I(null);try{return n(await x(e)),R(e=>e+1),!0}catch(e){return I(e.message),!1}finally{P(!1)}},Y=(e,t)=>J({providers:{[r]:{[e]:t}}}),X=e?`text-[11px]`:`text-sm`,Z=e?`text-xs`:`text-sm`,te=e?`space-y-2`:`space-y-4`,Q=e?`space-y-1.5`:`space-y-3`,$=e?`space-y-1`:`space-y-1.5`;if(!t)return(0,C.jsxs)(`div`,{className:Q,children:[(0,C.jsx)(`h3`,{className:`${Z} font-medium text-text-secondary`,children:`AI Settings`}),(0,C.jsx)(`p`,{className:`${X} text-text-subtle`,children:F?`Error: ${F}`:`Loading...`})]});let ne=q?T:[{value:`__default__`,label:`Auto (default)`},...T];return(0,C.jsxs)(`div`,{className:te,children:[(0,C.jsx)(`h3`,{className:`${Z} font-medium text-text-secondary`,children:`AI Settings`}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-new-chat-provider`,className:e?X:void 0,children:`New chat provider`}),(0,C.jsxs)(v,{value:t.new_chat_provider_mode??`default`,disabled:N,onValueChange:e=>J({new_chat_provider_mode:e}),children:[(0,C.jsx)(y,{id:`ai-new-chat-provider`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(p,{})}),(0,C.jsxs)(m,{children:[(0,C.jsx)(_,{value:`follow-focus`,children:`Follow last focused chat`}),(0,C.jsx)(_,{value:`default`,children:`Always use default provider`})]})]}),(0,C.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,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-default-provider`,className:e?X:void 0,children:`Default provider`}),(0,C.jsxs)(v,{value:t.default_provider,disabled:N,onValueChange:e=>J({default_provider:e}),children:[(0,C.jsx)(y,{id:`ai-default-provider`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(p,{})}),(0,C.jsx)(m,{children:G.map(e=>(0,C.jsx)(_,{value:e.id,children:e.name},e.id))})]}),t.new_chat_provider_mode===`follow-focus`&&(0,C.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Used when no chat has been focused in this project yet.`})]}),(0,C.jsxs)(`div`,{className:`flex items-start justify-between gap-3 rounded-md border border-border p-3`,children:[(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-share-provider-context`,className:e?X:void 0,children:`Share rules and memory between providers`}),(0,C.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,C.jsx)(h,{id:`ai-share-provider-context`,"aria-describedby":`ai-share-provider-context-description`,checked:t.share_provider_context??!0,disabled:N,onCheckedChange:e=>J({share_provider_context:e})})]}),G.length>1&&(0,C.jsx)(`div`,{className:`flex gap-0.5 border-b border-border/50 -mx-1 px-1`,children:G.map(e=>(0,C.jsxs)(`button`,{onClick:()=>w(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,C.jsx)(d,{providerId:e.id}),(0,C.jsx)(`span`,{className:`capitalize`,children:e.name})]},e.id))}),(0,C.jsxs)(`div`,{className:Q,children:[U&&(0,C.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-warning/30 bg-warning/5 px-2.5 py-2`,children:[(0,C.jsx)(o,{className:`size-3.5 text-warning shrink-0 mt-0.5`}),(0,C.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1.5`,children:[(0,C.jsxs)(`p`,{className:`${X} text-text-secondary`,children:[A[r]??r,` is not available in chat — PPM could not start it.`]}),(0,C.jsx)(`p`,{className:`text-[11px] text-muted-foreground break-words`,children:U.reason}),U.nextProbeAt&&(0,C.jsxs)(`p`,{className:`text-[11px] text-text-subtle`,children:[`Checking again at `,new Date(U.nextProbeAt).toLocaleTimeString()]}),(0,C.jsxs)(l,{variant:`outline`,size:`sm`,onClick:W,disabled:V,className:`gap-1.5 cursor-pointer min-h-11 md:min-h-8`,children:[(0,C.jsx)(a,{className:`size-3.5 ${V?`animate-spin`:``}`}),V?`Checking...`:`Check again`]})]})]}),r===`codex`&&(0,C.jsxs)(`button`,{type:`button`,onClick:()=>c(`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,C.jsx)(`span`,{className:`${X} text-text-secondary`,children:`Codex accounts & login`}),(0,C.jsx)(i,{className:`size-3.5 text-text-subtle shrink-0`})]}),T.length>0&&(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-model`,className:e?X:void 0,children:`Model`}),(0,C.jsxs)(v,{value:q?K?.model??T[0]?.value:K?.model||`__default__`,onValueChange:e=>Y(`model`,e===`__default__`?void 0:e),disabled:j,children:[(0,C.jsx)(y,{id:`ai-model`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(p,{placeholder:j?`Loading models...`:`Select model`})}),(0,C.jsx)(m,{className:`max-h-[300px]`,children:ne.map(e=>(0,C.jsx)(_,{value:e.value,children:e.label},e.value))})]})]}),r===`codex`&&(0,C.jsx)(D,{config:K,compact:e,saving:N,onSave:e=>J({providers:{codex:e}})},JSON.stringify([K?.model_context_window,K?.model_auto_compact_token_limit])),q&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-base-url`,className:e?X:void 0,children:`Base URL`}),(0,C.jsx)(u,{id:`ai-base-url`,type:`url`,defaultValue:K?.base_url??``,placeholder:`https://api.anthropic.com (default)`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{Y(`base_url`,e.target.value.trim()||void 0)}},`baseurl-${r}-${L}`)]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-api-key`,className:e?X:void 0,children:`API Key / Token`}),(0,C.jsx)(u,{id:`ai-api-key`,type:`password`,defaultValue:K?.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(`••••`)||Y(`api_key`,t||void 0)}},`apikey-${r}-${L}`),(0,C.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,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-effort`,className:e?X:void 0,children:`Effort`}),(0,C.jsxs)(v,{value:K?.effort??`high`,onValueChange:e=>Y(`effort`,e),children:[(0,C.jsx)(y,{id:`ai-effort`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(p,{})}),(0,C.jsx)(m,{children:O.map(e=>(0,C.jsx)(_,{value:e.value,children:e.label},e.value))})]})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-max-turns`,className:e?X:void 0,children:`Max Turns (1-500)`}),(0,C.jsx)(u,{id:`ai-max-turns`,type:`number`,min:1,max:500,defaultValue:K?.max_turns??100,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseInt(e.target.value);isNaN(t)||Y(`max_turns`,t)}},`turns-${r}-${L}`)]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-budget`,className:e?X:void 0,children:`Max Budget (USD)`}),(0,C.jsx)(u,{id:`ai-budget`,type:`number`,step:.1,min:.01,max:50,defaultValue:K?.max_budget_usd??``,placeholder:`No limit`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseFloat(e.target.value);Y(`max_budget_usd`,isNaN(t)?void 0:t)}},`budget-${r}-${L}`)]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-thinking`,className:e?X:void 0,children:`Thinking Budget (tokens)`}),(0,C.jsx)(u,{id:`ai-thinking`,type:`number`,min:0,defaultValue:K?.thinking_budget_tokens??``,placeholder:`Adaptive (model decides)`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseInt(e.target.value);Y(`thinking_budget_tokens`,isNaN(t)?void 0:t)}},`thinking-${r}-${L}`)]}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(f,{htmlFor:`ai-agent-teams`,className:e?X:void 0,children:`Agent Teams`}),(0,C.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,C.jsx)(h,{id:`ai-agent-teams`,checked:K?.agent_teams??!1,onCheckedChange:e=>Y(`agent_teams`,e)})]}),K?.agent_teams&&(0,C.jsx)(ee,{compact:e}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(f,{htmlFor:`ai-context-1m`,className:e?X:void 0,children:`1M Context Window`}),(0,C.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,C.jsx)(h,{id:`ai-context-1m`,checked:K?.context_1m??!1,onCheckedChange:e=>Y(`context_1m`,e)})]}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(f,{htmlFor:`ai-inherit-mcp`,className:e?X:void 0,children:`Inherit Claude Code MCP`}),(0,C.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,C.jsx)(h,{id:`ai-inherit-mcp`,checked:K?.inherit_claude_mcp??!0,onCheckedChange:e=>Y(`inherit_claude_mcp`,e)})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{className:e?X:void 0,children:`MCP sign-in`}),(0,C.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,C.jsx)(`div`,{className:`-mx-2`,children:(0,C.jsx)(g,{showWhenEmpty:!0})})]})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-permission-mode`,className:e?X:void 0,children:`Default Permission Mode`}),(0,C.jsxs)(v,{value:K?.permission_mode??`bypassPermissions`,onValueChange:e=>Y(`permission_mode`,e),children:[(0,C.jsx)(y,{id:`ai-permission-mode`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(p,{})}),(0,C.jsx)(m,{children:k.map(e=>(0,C.jsx)(_,{value:e.value,children:e.label},e.value))})]})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-system-prompt`,className:e?X:void 0,children:`Additional Instructions`}),(0,C.jsx)(`textarea`,{id:`ai-system-prompt`,rows:e?3:4,defaultValue:K?.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=>{Y(`system_prompt`,e.target.value.trim()||void 0)}},`sysprompt-${r}-${L}`)]})]}),N&&(0,C.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`Saving...`}),F&&(0,C.jsx)(`p`,{className:`text-xs text-error`,children:F})]})}function ee({compact:e}){let[t,n]=(0,S.useState)([]),[i,o]=(0,S.useState)(!1),[c,l]=(0,S.useState)(null),u=(0,S.useCallback)(async()=>{o(!0);try{n(await s.get(`/api/teams`)??[])}catch{}o(!1)},[]);(0,S.useEffect)(()=>{u()},[u]);let d=async e=>{try{await s.del(`/api/teams/${encodeURIComponent(e)}`),n(t=>t.filter(t=>t.name!==e)),l(null)}catch{}};return t.length===0&&!i?null:(0,C.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,C.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,C.jsxs)(f,{className:e?`text-[11px]`:void 0,children:[`Teams (`,t.length,`)`]}),(0,C.jsx)(`button`,{onClick:u,className:`text-text-subtle hover:text-foreground p-1`,"aria-label":`Refresh teams`,children:(0,C.jsx)(a,{className:`size-3 ${i?`animate-spin`:``}`})})]}),t.map(e=>(0,C.jsxs)(`div`,{className:`flex items-center justify-between p-2 rounded bg-surface-elevated text-xs`,children:[(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`div`,{className:`font-medium truncate`,children:e.name}),e.description&&(0,C.jsx)(`div`,{className:`text-text-subtle truncate`,children:e.description}),(0,C.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,C.jsxs)(`div`,{className:`flex gap-1 shrink-0 ml-2`,children:[(0,C.jsx)(`button`,{onClick:()=>d(e.name),className:`px-2 py-1 bg-error text-white rounded text-[10px]`,children:`Delete`}),(0,C.jsx)(`button`,{onClick:()=>l(null),className:`px-2 py-1 bg-panel-2 text-text rounded text-[10px]`,children:`Cancel`})]}):(0,C.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,C.jsx)(r,{className:`size-3.5`})})]},e.name))]})}export{j as t};
1
+ import{s as e}from"./rolldown-runtime-C5c2KzVm.js";import{D as t,E as n}from"./vendor-markdown-C-P1aR4p.js";import{Kr as r,gt as i,hr as a,r as o}from"./icons-BwyIKaTT.js";import{r as s}from"./api-client-xQDlhUTu.js";import{t as c}from"./open-settings-EXR4zoZG.js";import{t as l}from"./button-C9ZXWb3b.js";import{t as u}from"./input-C3oVNCMq.js";import{Ai as d,Er as f,Gn as p,Hn as m,Kn as h,Pn as g,Un as _,Vn as v,Wn as y}from"./index-EznfgwH9.js";import{a as b,b as x}from"./api-settings-vmIRFNwZ.js";var S=e(t(),1),C=n(),w=[128e3,272e3,4e5,512e3,872e3,1e6],T=[1e5,2e5,23e4,35e4,45e4,75e4,9e5];function E({id:e,label:t,value:n,presets:r,disabled:i,compact:a,onChange:o}){let[s,c]=(0,S.useState)(!!n&&!r.includes(Number(n))),l=a?`text-[11px]`:`text-sm`;return(0,C.jsxs)(`div`,{className:`space-y-1`,children:[(0,C.jsx)(f,{htmlFor:e,className:l,children:t}),(0,C.jsxs)(`select`,{id:e,value:s?`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`} ${l}`,onChange:e=>{let t=e.target.value;c(t===`custom`),t!==`custom`&&o(t===`default`?``:t)},children:[(0,C.jsx)(`option`,{value:`default`,children:`Codex default`}),r.map(e=>(0,C.jsxs)(`option`,{value:String(e),children:[e===1e6?`1M`:`${e/1e3}K`,` tokens`]},e)),(0,C.jsx)(`option`,{value:`custom`,children:`Custom...`})]}),s&&(0,C.jsx)(u,{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 D({config:e,compact:t,saving:n,onSave:r}){let[i,a]=(0,S.useState)(String(e?.model_context_window??``)),[o,s]=(0,S.useState)(String(e?.model_auto_compact_token_limit??``)),[c,l]=(0,S.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,C.jsxs)(`form`,{onSubmit:f,className:`space-y-2 rounded-md border border-border p-3`,children:[(0,C.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[(0,C.jsx)(E,{id:`codex-context-window`,label:`Context window (tokens)`,value:i,presets:w,disabled:n,compact:t,onChange:e=>{a(e),l(null)}}),(0,C.jsx)(E,{id:`codex-compact-threshold`,label:`Auto-compact threshold (tokens)`,value:o,presets:T,disabled:n,compact:t,onChange:e=>{s(e),l(null)}})]}),(0,C.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,C.jsx)(`p`,{role:`alert`,className:`${u} text-error`,children:c}),(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,C.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,C.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 O=[{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`},{value:`xhigh`,label:`Extra`},{value:`max`,label:`Max`}],k=[{value:`bypassPermissions`,label:`Bypass permissions (default)`},{value:`default`,label:`Ask before edits`},{value:`acceptEdits`,label:`Edit automatically`},{value:`plan`,label:`Plan mode`}],A={claude:`Claude`,cursor:`Cursor`,codex:`Codex`,gemini:`Gemini`};function j({compact:e}={}){let[t,n]=(0,S.useState)(null),[r,w]=(0,S.useState)(``),[T,E]=(0,S.useState)([]),[j,M]=(0,S.useState)(!1),[N,P]=(0,S.useState)(!1),[F,I]=(0,S.useState)(null),[L,R]=(0,S.useState)(0),[z,B]=(0,S.useState)([]),[V,H]=(0,S.useState)(!1);(0,S.useEffect)(()=>{b().then(e=>{n(e),w(e.default_provider??`claude`)}).catch(e=>I(e.message))},[]),(0,S.useEffect)(()=>{r&&s.get(`/api/settings/ai/providers/status`).then(B).catch(()=>B([]))},[r]);let U=z.find(e=>e.id===r&&!e.registered);(0,S.useEffect)(()=>{r&&(M(!0),s.get(`/api/settings/ai/providers/${r}/models`).then(E).catch(()=>E([])).finally(()=>M(!1)))},[r,!U]);let W=async()=>{H(!0);try{let e=await s.post(`/api/settings/ai/providers/${r}/probe`);B(t=>t.map(t=>t.id===e.id?e:t))}catch(e){I(e.message)}finally{H(!1)}},G=t?Object.keys(t.providers).filter(e=>e!==`mock`).map(e=>({id:e,name:A[e]??e})):[],K=t?.providers[r],q=K?.type===`agent-sdk`||!K?.type&&r===`claude`,J=async e=>{if(!t)return!1;P(!0),I(null);try{return n(await x(e)),R(e=>e+1),!0}catch(e){return I(e.message),!1}finally{P(!1)}},Y=(e,t)=>J({providers:{[r]:{[e]:t}}}),X=e?`text-[11px]`:`text-sm`,Z=e?`text-xs`:`text-sm`,te=e?`space-y-2`:`space-y-4`,Q=e?`space-y-1.5`:`space-y-3`,$=e?`space-y-1`:`space-y-1.5`;if(!t)return(0,C.jsxs)(`div`,{className:Q,children:[(0,C.jsx)(`h3`,{className:`${Z} font-medium text-text-secondary`,children:`AI Settings`}),(0,C.jsx)(`p`,{className:`${X} text-text-subtle`,children:F?`Error: ${F}`:`Loading...`})]});let ne=q?T:[{value:`__default__`,label:`Auto (default)`},...T];return(0,C.jsxs)(`div`,{className:te,children:[(0,C.jsx)(`h3`,{className:`${Z} font-medium text-text-secondary`,children:`AI Settings`}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-new-chat-provider`,className:e?X:void 0,children:`New chat provider`}),(0,C.jsxs)(v,{value:t.new_chat_provider_mode??`default`,disabled:N,onValueChange:e=>J({new_chat_provider_mode:e}),children:[(0,C.jsx)(y,{id:`ai-new-chat-provider`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(p,{})}),(0,C.jsxs)(m,{children:[(0,C.jsx)(_,{value:`follow-focus`,children:`Follow last focused chat`}),(0,C.jsx)(_,{value:`default`,children:`Always use default provider`})]})]}),(0,C.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,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-default-provider`,className:e?X:void 0,children:`Default provider`}),(0,C.jsxs)(v,{value:t.default_provider,disabled:N,onValueChange:e=>J({default_provider:e}),children:[(0,C.jsx)(y,{id:`ai-default-provider`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(p,{})}),(0,C.jsx)(m,{children:G.map(e=>(0,C.jsx)(_,{value:e.id,children:e.name},e.id))})]}),t.new_chat_provider_mode===`follow-focus`&&(0,C.jsx)(`p`,{className:`${e?`text-[9px]`:`text-[11px]`} text-muted-foreground`,children:`Used when no chat has been focused in this project yet.`})]}),(0,C.jsxs)(`div`,{className:`flex items-start justify-between gap-3 rounded-md border border-border p-3`,children:[(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-share-provider-context`,className:e?X:void 0,children:`Share rules and memory between providers`}),(0,C.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,C.jsx)(h,{id:`ai-share-provider-context`,"aria-describedby":`ai-share-provider-context-description`,checked:t.share_provider_context??!0,disabled:N,onCheckedChange:e=>J({share_provider_context:e})})]}),G.length>1&&(0,C.jsx)(`div`,{className:`flex gap-0.5 border-b border-border/50 -mx-1 px-1`,children:G.map(e=>(0,C.jsxs)(`button`,{onClick:()=>w(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,C.jsx)(d,{providerId:e.id}),(0,C.jsx)(`span`,{className:`capitalize`,children:e.name})]},e.id))}),(0,C.jsxs)(`div`,{className:Q,children:[U&&(0,C.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-warning/30 bg-warning/5 px-2.5 py-2`,children:[(0,C.jsx)(o,{className:`size-3.5 text-warning shrink-0 mt-0.5`}),(0,C.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1.5`,children:[(0,C.jsxs)(`p`,{className:`${X} text-text-secondary`,children:[A[r]??r,` is not available in chat — PPM could not start it.`]}),(0,C.jsx)(`p`,{className:`text-[11px] text-muted-foreground break-words`,children:U.reason}),U.nextProbeAt&&(0,C.jsxs)(`p`,{className:`text-[11px] text-text-subtle`,children:[`Checking again at `,new Date(U.nextProbeAt).toLocaleTimeString()]}),(0,C.jsxs)(l,{variant:`outline`,size:`sm`,onClick:W,disabled:V,className:`gap-1.5 cursor-pointer min-h-11 md:min-h-8`,children:[(0,C.jsx)(a,{className:`size-3.5 ${V?`animate-spin`:``}`}),V?`Checking...`:`Check again`]})]})]}),r===`codex`&&(0,C.jsxs)(`button`,{type:`button`,onClick:()=>c(`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,C.jsx)(`span`,{className:`${X} text-text-secondary`,children:`Codex accounts & login`}),(0,C.jsx)(i,{className:`size-3.5 text-text-subtle shrink-0`})]}),T.length>0&&(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-model`,className:e?X:void 0,children:`Model`}),(0,C.jsxs)(v,{value:q?K?.model??T[0]?.value:K?.model||`__default__`,onValueChange:e=>Y(`model`,e===`__default__`?void 0:e),disabled:j,children:[(0,C.jsx)(y,{id:`ai-model`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(p,{placeholder:j?`Loading models...`:`Select model`})}),(0,C.jsx)(m,{className:`max-h-[300px]`,children:ne.map(e=>(0,C.jsx)(_,{value:e.value,children:e.label},e.value))})]})]}),r===`codex`&&(0,C.jsx)(D,{config:K,compact:e,saving:N,onSave:e=>J({providers:{codex:e}})},JSON.stringify([K?.model_context_window,K?.model_auto_compact_token_limit])),q&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-base-url`,className:e?X:void 0,children:`Base URL`}),(0,C.jsx)(u,{id:`ai-base-url`,type:`url`,defaultValue:K?.base_url??``,placeholder:`https://api.anthropic.com (default)`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{Y(`base_url`,e.target.value.trim()||void 0)}},`baseurl-${r}-${L}`)]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-api-key`,className:e?X:void 0,children:`API Key / Token`}),(0,C.jsx)(u,{id:`ai-api-key`,type:`password`,defaultValue:K?.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(`••••`)||Y(`api_key`,t||void 0)}},`apikey-${r}-${L}`),(0,C.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,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-effort`,className:e?X:void 0,children:`Effort`}),(0,C.jsxs)(v,{value:K?.effort??`high`,onValueChange:e=>Y(`effort`,e),children:[(0,C.jsx)(y,{id:`ai-effort`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(p,{})}),(0,C.jsx)(m,{children:O.map(e=>(0,C.jsx)(_,{value:e.value,children:e.label},e.value))})]})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-max-turns`,className:e?X:void 0,children:`Max Turns (1-500)`}),(0,C.jsx)(u,{id:`ai-max-turns`,type:`number`,min:1,max:500,defaultValue:K?.max_turns??100,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseInt(e.target.value);isNaN(t)||Y(`max_turns`,t)}},`turns-${r}-${L}`)]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-budget`,className:e?X:void 0,children:`Max Budget (USD)`}),(0,C.jsx)(u,{id:`ai-budget`,type:`number`,step:.1,min:.01,max:50,defaultValue:K?.max_budget_usd??``,placeholder:`No limit`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseFloat(e.target.value);Y(`max_budget_usd`,isNaN(t)?void 0:t)}},`budget-${r}-${L}`)]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-thinking`,className:e?X:void 0,children:`Thinking Budget (tokens)`}),(0,C.jsx)(u,{id:`ai-thinking`,type:`number`,min:0,defaultValue:K?.thinking_budget_tokens??``,placeholder:`Adaptive (model decides)`,className:e?`h-7 text-[11px]`:void 0,onBlur:e=>{let t=parseInt(e.target.value);Y(`thinking_budget_tokens`,isNaN(t)?void 0:t)}},`thinking-${r}-${L}`)]}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(f,{htmlFor:`ai-agent-teams`,className:e?X:void 0,children:`Agent Teams`}),(0,C.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,C.jsx)(h,{id:`ai-agent-teams`,checked:K?.agent_teams??!1,onCheckedChange:e=>Y(`agent_teams`,e)})]}),K?.agent_teams&&(0,C.jsx)(ee,{compact:e}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(f,{htmlFor:`ai-context-1m`,className:e?X:void 0,children:`1M Context Window`}),(0,C.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,C.jsx)(h,{id:`ai-context-1m`,checked:K?.context_1m??!1,onCheckedChange:e=>Y(`context_1m`,e)})]}),(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(f,{htmlFor:`ai-inherit-mcp`,className:e?X:void 0,children:`Inherit Claude Code MCP`}),(0,C.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,C.jsx)(h,{id:`ai-inherit-mcp`,checked:K?.inherit_claude_mcp??!0,onCheckedChange:e=>Y(`inherit_claude_mcp`,e)})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{className:e?X:void 0,children:`MCP sign-in`}),(0,C.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,C.jsx)(`div`,{className:`-mx-2`,children:(0,C.jsx)(g,{showWhenEmpty:!0})})]})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-permission-mode`,className:e?X:void 0,children:`Default Permission Mode`}),(0,C.jsxs)(v,{value:K?.permission_mode??`bypassPermissions`,onValueChange:e=>Y(`permission_mode`,e),children:[(0,C.jsx)(y,{id:`ai-permission-mode`,className:`w-full ${e?`h-7 text-[11px]`:``}`,children:(0,C.jsx)(p,{})}),(0,C.jsx)(m,{children:k.map(e=>(0,C.jsx)(_,{value:e.value,children:e.label},e.value))})]})]}),(0,C.jsxs)(`div`,{className:$,children:[(0,C.jsx)(f,{htmlFor:`ai-system-prompt`,className:e?X:void 0,children:`Additional Instructions`}),(0,C.jsx)(`textarea`,{id:`ai-system-prompt`,rows:e?3:4,defaultValue:K?.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=>{Y(`system_prompt`,e.target.value.trim()||void 0)}},`sysprompt-${r}-${L}`)]})]}),N&&(0,C.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`Saving...`}),F&&(0,C.jsx)(`p`,{className:`text-xs text-error`,children:F})]})}function ee({compact:e}){let[t,n]=(0,S.useState)([]),[i,o]=(0,S.useState)(!1),[c,l]=(0,S.useState)(null),u=(0,S.useCallback)(async()=>{o(!0);try{n(await s.get(`/api/teams`)??[])}catch{}o(!1)},[]);(0,S.useEffect)(()=>{u()},[u]);let d=async e=>{try{await s.del(`/api/teams/${encodeURIComponent(e)}`),n(t=>t.filter(t=>t.name!==e)),l(null)}catch{}};return t.length===0&&!i?null:(0,C.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,C.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,C.jsxs)(f,{className:e?`text-[11px]`:void 0,children:[`Teams (`,t.length,`)`]}),(0,C.jsx)(`button`,{onClick:u,className:`text-text-subtle hover:text-foreground p-1`,"aria-label":`Refresh teams`,children:(0,C.jsx)(a,{className:`size-3 ${i?`animate-spin`:``}`})})]}),t.map(e=>(0,C.jsxs)(`div`,{className:`flex items-center justify-between p-2 rounded bg-surface-elevated text-xs`,children:[(0,C.jsxs)(`div`,{className:`min-w-0`,children:[(0,C.jsx)(`div`,{className:`font-medium truncate`,children:e.name}),e.description&&(0,C.jsx)(`div`,{className:`text-text-subtle truncate`,children:e.description}),(0,C.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,C.jsxs)(`div`,{className:`flex gap-1 shrink-0 ml-2`,children:[(0,C.jsx)(`button`,{onClick:()=>d(e.name),className:`px-2 py-1 bg-error text-white rounded text-[10px]`,children:`Delete`}),(0,C.jsx)(`button`,{onClick:()=>l(null),className:`px-2 py-1 bg-panel-2 text-text rounded text-[10px]`,children:`Cancel`})]}):(0,C.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,C.jsx)(r,{className:`size-3.5`})})]},e.name))]})}export{j as t};
@@ -1 +1 @@
1
- import"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./icons-BwyIKaTT.js";import"./api-client-xQDlhUTu.js";import"./settings-store-B4mLp19V.js";import"./portal-container-context-NBi-KGK0.js";import"./window-store-DqX_qmkQ.js";import"./panel-store-BJhazigC.js";import"./project-store-BLGl9IAO.js";import"./project-framework-store-DwLxaRan.js";import"./session-list-sync-triggers-DtJI5KF0.js";import"./tab-store-D5I52eLN.js";import"./chat-preparation-cache-190LLyy7.js";import"./use-is-mobile-VRV9eZy1.js";import"./settings-categories-Ajj4ui27.js";import"./open-settings-EXR4zoZG.js";import"./button-C9ZXWb3b.js";import"./dialog-Dn_2tuYa.js";import"./mobile-bottom-sheet-DArbIyrD.js";import"./use-visual-viewport-MmugpRg-.js";import"./input-C3oVNCMq.js";import"./api-settings-vmIRFNwZ.js";import{t as e}from"./ai-settings-section-Ct9-lNqA.js";export{e as AISettingsSection};
1
+ import"./vendor-markdown-C-P1aR4p.js";import"./vendor-ui-BTSIXzhZ.js";import"./icons-BwyIKaTT.js";import"./api-client-xQDlhUTu.js";import"./settings-store-B4mLp19V.js";import"./portal-container-context-NBi-KGK0.js";import"./window-store-DqX_qmkQ.js";import"./panel-store-BJhazigC.js";import"./project-store-BLGl9IAO.js";import"./project-framework-store-DwLxaRan.js";import"./session-list-sync-triggers-DtJI5KF0.js";import"./tab-store-D5I52eLN.js";import"./chat-preparation-cache-190LLyy7.js";import"./use-is-mobile-VRV9eZy1.js";import"./settings-categories-Ajj4ui27.js";import"./open-settings-EXR4zoZG.js";import"./button-C9ZXWb3b.js";import"./dialog-Dn_2tuYa.js";import"./mobile-bottom-sheet-DArbIyrD.js";import"./use-visual-viewport-MmugpRg-.js";import"./input-C3oVNCMq.js";import"./api-settings-vmIRFNwZ.js";import{t as e}from"./ai-settings-section-C6NKrktb.js";export{e as AISettingsSection};