9router 0.3.27 → 0.3.28

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 (473) hide show
  1. package/app/.next/BUILD_ID +1 -1
  2. package/app/.next/app-path-routes-manifest.json +39 -36
  3. package/app/.next/build-manifest.json +2 -2
  4. package/app/.next/prerender-manifest.json +24 -0
  5. package/app/.next/routes-manifest.json +18 -0
  6. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +4 -4
  7. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  8. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  10. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  11. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  12. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  14. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  15. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js +2 -0
  17. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -0
  18. package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -0
  19. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  20. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  21. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  22. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  23. package/app/.next/server/app/_global-error.html +2 -2
  24. package/app/.next/server/app/_global-error.rsc +1 -1
  25. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  26. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  27. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  28. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  29. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  30. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  31. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  32. package/app/.next/server/app/_not-found.html +1 -1
  33. package/app/.next/server/app/_not-found.rsc +3 -3
  34. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  35. package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  36. package/app/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  37. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  38. package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  39. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  40. package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  41. package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  42. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
  43. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
  44. package/app/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
  45. package/app/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
  46. package/app/.next/server/app/api/cli-tools/copilot-settings/route.js +2 -0
  47. package/app/.next/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -0
  48. package/app/.next/server/app/api/cli-tools/copilot-settings/route_client-reference-manifest.js +1 -0
  49. package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
  50. package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
  51. package/app/.next/server/app/api/cli-tools/opencode-settings/route.js +2 -0
  52. package/app/.next/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -0
  53. package/app/.next/server/app/api/cli-tools/opencode-settings/route_client-reference-manifest.js +1 -0
  54. package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
  55. package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
  56. package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
  57. package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
  58. package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
  59. package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
  60. package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  61. package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
  62. package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
  63. package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
  64. package/app/.next/server/app/api/models/route.js +1 -1
  65. package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
  66. package/app/.next/server/app/api/models/test/route_client-reference-manifest.js +1 -1
  67. package/app/.next/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
  68. package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
  69. package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
  70. package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
  71. package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
  72. package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
  73. package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
  74. package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
  75. package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
  76. package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
  77. package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
  78. package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
  79. package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
  80. package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
  81. package/app/.next/server/app/api/providers/[id]/test-models/route_client-reference-manifest.js +1 -1
  82. package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
  83. package/app/.next/server/app/api/providers/route.js +1 -1
  84. package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
  85. package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
  86. package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
  87. package/app/.next/server/app/api/settings/database/route_client-reference-manifest.js +1 -1
  88. package/app/.next/server/app/api/settings/proxy-test/route_client-reference-manifest.js +1 -1
  89. package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
  90. package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  91. package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  92. package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
  93. package/app/.next/server/app/api/translator/console-logs/route.js +1 -1
  94. package/app/.next/server/app/api/translator/console-logs/route_client-reference-manifest.js +1 -1
  95. package/app/.next/server/app/api/translator/console-logs/stream/route.js +1 -1
  96. package/app/.next/server/app/api/translator/console-logs/stream/route_client-reference-manifest.js +1 -1
  97. package/app/.next/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
  98. package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
  99. package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
  100. package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
  101. package/app/.next/server/app/api/tunnel/disable/route_client-reference-manifest.js +1 -1
  102. package/app/.next/server/app/api/tunnel/enable/route_client-reference-manifest.js +1 -1
  103. package/app/.next/server/app/api/tunnel/status/route_client-reference-manifest.js +1 -1
  104. package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
  105. package/app/.next/server/app/api/usage/chart/route_client-reference-manifest.js +1 -1
  106. package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
  107. package/app/.next/server/app/api/usage/providers/route_client-reference-manifest.js +1 -1
  108. package/app/.next/server/app/api/usage/request-details/route_client-reference-manifest.js +1 -1
  109. package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
  110. package/app/.next/server/app/api/usage/stream/route_client-reference-manifest.js +1 -1
  111. package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
  112. package/app/.next/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
  113. package/app/.next/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
  114. package/app/.next/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
  115. package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
  116. package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
  117. package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
  118. package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
  119. package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
  120. package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
  121. package/app/.next/server/app/api/version/route.js +1 -1
  122. package/app/.next/server/app/api/version/route_client-reference-manifest.js +1 -1
  123. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  124. package/app/.next/server/app/callback.html +1 -1
  125. package/app/.next/server/app/callback.rsc +3 -3
  126. package/app/.next/server/app/callback.segments/_full.segment.rsc +3 -3
  127. package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
  128. package/app/.next/server/app/callback.segments/_index.segment.rsc +3 -3
  129. package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
  130. package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  131. package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
  132. package/app/.next/server/app/dashboard/cli-tools.html +1 -1
  133. package/app/.next/server/app/dashboard/cli-tools.rsc +5 -5
  134. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  135. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  136. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  137. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  138. package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  139. package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  140. package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
  141. package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  142. package/app/.next/server/app/dashboard/combos.html +1 -1
  143. package/app/.next/server/app/dashboard/combos.rsc +5 -5
  144. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  145. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  146. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  147. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  148. package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  149. package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  150. package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
  151. package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  152. package/app/.next/server/app/dashboard/endpoint.html +1 -1
  153. package/app/.next/server/app/dashboard/endpoint.rsc +5 -5
  154. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  155. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  156. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  157. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  158. package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  159. package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  160. package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
  161. package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  162. package/app/.next/server/app/dashboard/profile.html +1 -1
  163. package/app/.next/server/app/dashboard/profile.rsc +5 -5
  164. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  165. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  166. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  167. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  168. package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  169. package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  170. package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
  171. package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  172. package/app/.next/server/app/dashboard/providers/new.html +1 -1
  173. package/app/.next/server/app/dashboard/providers/new.rsc +5 -5
  174. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  175. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  176. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  177. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  178. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  179. package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  180. package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  181. package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
  182. package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  183. package/app/.next/server/app/dashboard/providers.html +1 -1
  184. package/app/.next/server/app/dashboard/providers.rsc +5 -5
  185. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  186. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  187. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  188. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  189. package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  190. package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  191. package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
  192. package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  193. package/app/.next/server/app/dashboard/quota.html +1 -0
  194. package/app/.next/server/app/dashboard/quota.meta +17 -0
  195. package/app/.next/server/app/dashboard/quota.rsc +21 -0
  196. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +7 -0
  197. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +4 -0
  198. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +4 -0
  199. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +6 -0
  200. package/app/.next/server/app/dashboard/quota.segments/_full.segment.rsc +21 -0
  201. package/app/.next/server/app/dashboard/quota.segments/_head.segment.rsc +6 -0
  202. package/app/.next/server/app/dashboard/quota.segments/_index.segment.rsc +7 -0
  203. package/app/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +5 -0
  204. package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  205. package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
  206. package/app/.next/server/app/dashboard/settings/pricing.rsc +3 -3
  207. package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  208. package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  209. package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
  210. package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  211. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  212. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  213. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  214. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  215. package/app/.next/server/app/dashboard/translator.html +1 -1
  216. package/app/.next/server/app/dashboard/translator.rsc +5 -5
  217. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  218. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  219. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  220. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  221. package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  222. package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  223. package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
  224. package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  225. package/app/.next/server/app/dashboard/usage.html +1 -1
  226. package/app/.next/server/app/dashboard/usage.rsc +5 -5
  227. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  228. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  229. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  230. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  231. package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  232. package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  233. package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
  234. package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  235. package/app/.next/server/app/dashboard.html +1 -1
  236. package/app/.next/server/app/dashboard.rsc +5 -5
  237. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  238. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  239. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  240. package/app/.next/server/app/dashboard.segments/_full.segment.rsc +5 -5
  241. package/app/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
  242. package/app/.next/server/app/dashboard.segments/_index.segment.rsc +3 -3
  243. package/app/.next/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  244. package/app/.next/server/app/index.html +1 -1
  245. package/app/.next/server/app/index.rsc +3 -3
  246. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  247. package/app/.next/server/app/index.segments/_full.segment.rsc +3 -3
  248. package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
  249. package/app/.next/server/app/index.segments/_index.segment.rsc +3 -3
  250. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  251. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  252. package/app/.next/server/app/landing.html +1 -1
  253. package/app/.next/server/app/landing.rsc +4 -4
  254. package/app/.next/server/app/landing.segments/_full.segment.rsc +4 -4
  255. package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
  256. package/app/.next/server/app/landing.segments/_index.segment.rsc +3 -3
  257. package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
  258. package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  259. package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
  260. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  261. package/app/.next/server/app/login.html +1 -1
  262. package/app/.next/server/app/login.rsc +4 -4
  263. package/app/.next/server/app/login.segments/_full.segment.rsc +4 -4
  264. package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
  265. package/app/.next/server/app/login.segments/_index.segment.rsc +3 -3
  266. package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  267. package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  268. package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
  269. package/app/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  270. package/app/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  271. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  272. package/app/.next/server/app-paths-manifest.json +39 -36
  273. package/app/.next/server/chunks/2280.js +1 -1
  274. package/app/.next/server/chunks/412.js +2 -2
  275. package/app/.next/server/pages/404.html +1 -1
  276. package/app/.next/server/pages/500.html +2 -2
  277. package/app/.next/server/server-reference-manifest.js +1 -1
  278. package/app/.next/server/server-reference-manifest.json +1 -1
  279. package/app/.next/static/7sCSr7yWSqEyoyOGqrYLA/_buildManifest.js +1 -0
  280. package/app/.next/static/chunks/{1672-d590b9c20d6fa792.js → 2032-23c81bb73667ca23.js} +1 -1
  281. package/app/.next/static/chunks/{8729-cbaa00bf4b5e675b.js → 4495-bc9f104bf7b22419.js} +1 -1
  282. package/app/.next/static/chunks/5497-9aeee36152b1d579.js +7 -0
  283. package/app/.next/static/chunks/5772-d1f2c78fe8fef39a.js +3 -0
  284. package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-4cc436d49f7e7638.js +15 -0
  285. package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/{page-17a31c3b02d1d2b8.js → page-fe9fbc3964d7ce5c.js} +1 -1
  286. package/app/.next/static/chunks/app/(dashboard)/dashboard/console-log/{page-f901161d567d6bc7.js → page-a04e6ebb4d3ba375.js} +1 -1
  287. package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-927ca3fa58839a9a.js +1 -0
  288. package/app/.next/static/chunks/app/(dashboard)/dashboard/page-b8734cbeddac6811.js +1 -0
  289. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/{page-0b44731dc56d8ebd.js → page-8fae3004fdf32664.js} +1 -1
  290. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-b86c09c039fe051f.js → page-96232c1eaa074aae.js} +1 -1
  291. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/new/{page-133c3e673c6fd026.js → page-49cf1fc0e94e26bc.js} +1 -1
  292. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/{page-8bde1753972175fd.js → page-a304dab86115ff4c.js} +1 -1
  293. package/app/.next/static/chunks/app/(dashboard)/dashboard/quota/page-37b6d77460fca8e7.js +1 -0
  294. package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/{page-ae0ac756433907e6.js → page-8b678c522493c335.js} +1 -1
  295. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-2bfbb471da9d16d1.js +1 -0
  296. package/app/.next/static/chunks/app/(dashboard)/{layout-66d69a4ba6e79bd5.js → layout-626a5cf4ccea1e63.js} +1 -1
  297. package/app/.next/static/chunks/app/_global-error/page-dc114b2367afe467.js +1 -0
  298. package/app/.next/static/chunks/app/api/auth/login/route-dc114b2367afe467.js +1 -0
  299. package/app/.next/static/chunks/app/api/auth/logout/route-dc114b2367afe467.js +1 -0
  300. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-dc114b2367afe467.js +1 -0
  301. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-dc114b2367afe467.js +1 -0
  302. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-dc114b2367afe467.js +1 -0
  303. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-dc114b2367afe467.js +1 -0
  304. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-dc114b2367afe467.js +1 -0
  305. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-dc114b2367afe467.js +1 -0
  306. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-dc114b2367afe467.js +1 -0
  307. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-dc114b2367afe467.js +1 -0
  308. package/app/.next/static/chunks/app/api/cloud/auth/route-dc114b2367afe467.js +1 -0
  309. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-dc114b2367afe467.js +1 -0
  310. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-dc114b2367afe467.js +1 -0
  311. package/app/.next/static/chunks/app/api/cloud/models/alias/route-dc114b2367afe467.js +1 -0
  312. package/app/.next/static/chunks/app/api/combos/[id]/route-dc114b2367afe467.js +1 -0
  313. package/app/.next/static/chunks/app/api/combos/route-dc114b2367afe467.js +1 -0
  314. package/app/.next/static/chunks/app/api/init/route-dc114b2367afe467.js +1 -0
  315. package/app/.next/static/chunks/app/api/keys/[id]/route-dc114b2367afe467.js +1 -0
  316. package/app/.next/static/chunks/app/api/keys/route-dc114b2367afe467.js +1 -0
  317. package/app/.next/static/chunks/app/api/models/alias/route-dc114b2367afe467.js +1 -0
  318. package/app/.next/static/chunks/app/api/models/route-dc114b2367afe467.js +1 -0
  319. package/app/.next/static/chunks/app/api/models/test/route-dc114b2367afe467.js +1 -0
  320. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-dc114b2367afe467.js +1 -0
  321. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-dc114b2367afe467.js +1 -0
  322. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-dc114b2367afe467.js +1 -0
  323. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-dc114b2367afe467.js +1 -0
  324. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-dc114b2367afe467.js +1 -0
  325. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-dc114b2367afe467.js +1 -0
  326. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-dc114b2367afe467.js +1 -0
  327. package/app/.next/static/chunks/app/api/pricing/route-dc114b2367afe467.js +1 -0
  328. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-dc114b2367afe467.js +1 -0
  329. package/app/.next/static/chunks/app/api/provider-nodes/route-dc114b2367afe467.js +1 -0
  330. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-dc114b2367afe467.js +1 -0
  331. package/app/.next/static/chunks/app/api/providers/[id]/models/route-dc114b2367afe467.js +1 -0
  332. package/app/.next/static/chunks/app/api/providers/[id]/route-dc114b2367afe467.js +1 -0
  333. package/app/.next/static/chunks/app/api/providers/[id]/test/route-dc114b2367afe467.js +1 -0
  334. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-dc114b2367afe467.js +1 -0
  335. package/app/.next/static/chunks/app/api/providers/client/route-dc114b2367afe467.js +1 -0
  336. package/app/.next/static/chunks/app/api/providers/route-dc114b2367afe467.js +1 -0
  337. package/app/.next/static/chunks/app/api/providers/test-batch/route-dc114b2367afe467.js +1 -0
  338. package/app/.next/static/chunks/app/api/providers/validate/route-dc114b2367afe467.js +1 -0
  339. package/app/.next/static/chunks/app/api/settings/database/route-dc114b2367afe467.js +1 -0
  340. package/app/.next/static/chunks/app/api/settings/proxy-test/route-dc114b2367afe467.js +1 -0
  341. package/app/.next/static/chunks/app/api/settings/require-login/route-dc114b2367afe467.js +1 -0
  342. package/app/.next/static/chunks/app/api/settings/route-dc114b2367afe467.js +1 -0
  343. package/app/.next/static/chunks/app/api/shutdown/route-dc114b2367afe467.js +1 -0
  344. package/app/.next/static/chunks/app/api/tags/route-dc114b2367afe467.js +1 -0
  345. package/app/.next/static/chunks/app/api/translator/console-logs/route-dc114b2367afe467.js +1 -0
  346. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-dc114b2367afe467.js +1 -0
  347. package/app/.next/static/chunks/app/api/translator/load/route-dc114b2367afe467.js +1 -0
  348. package/app/.next/static/chunks/app/api/translator/save/route-dc114b2367afe467.js +1 -0
  349. package/app/.next/static/chunks/app/api/translator/send/route-dc114b2367afe467.js +1 -0
  350. package/app/.next/static/chunks/app/api/translator/translate/route-dc114b2367afe467.js +1 -0
  351. package/app/.next/static/chunks/app/api/tunnel/disable/route-dc114b2367afe467.js +1 -0
  352. package/app/.next/static/chunks/app/api/tunnel/enable/route-dc114b2367afe467.js +1 -0
  353. package/app/.next/static/chunks/app/api/tunnel/status/route-dc114b2367afe467.js +1 -0
  354. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-dc114b2367afe467.js +1 -0
  355. package/app/.next/static/chunks/app/api/usage/chart/route-dc114b2367afe467.js +1 -0
  356. package/app/.next/static/chunks/app/api/usage/history/route-dc114b2367afe467.js +1 -0
  357. package/app/.next/static/chunks/app/api/usage/providers/route-dc114b2367afe467.js +1 -0
  358. package/app/.next/static/chunks/app/api/usage/request-details/route-dc114b2367afe467.js +1 -0
  359. package/app/.next/static/chunks/app/api/usage/request-logs/route-dc114b2367afe467.js +1 -0
  360. package/app/.next/static/chunks/app/api/usage/stream/route-dc114b2367afe467.js +1 -0
  361. package/app/.next/static/chunks/app/api/v1/api/chat/route-dc114b2367afe467.js +1 -0
  362. package/app/.next/static/chunks/app/api/v1/chat/completions/route-dc114b2367afe467.js +1 -0
  363. package/app/.next/static/chunks/app/api/v1/embeddings/route-dc114b2367afe467.js +1 -0
  364. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-dc114b2367afe467.js +1 -0
  365. package/app/.next/static/chunks/app/api/v1/messages/route-dc114b2367afe467.js +1 -0
  366. package/app/.next/static/chunks/app/api/v1/models/route-dc114b2367afe467.js +1 -0
  367. package/app/.next/static/chunks/app/api/v1/responses/route-dc114b2367afe467.js +1 -0
  368. package/app/.next/static/chunks/app/api/v1/route-dc114b2367afe467.js +1 -0
  369. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-dc114b2367afe467.js +1 -0
  370. package/app/.next/static/chunks/app/api/v1beta/models/route-dc114b2367afe467.js +1 -0
  371. package/app/.next/static/chunks/app/api/version/route-dc114b2367afe467.js +1 -0
  372. package/app/.next/static/chunks/app/landing/page-106f74afc6f71a31.js +1 -0
  373. package/app/.next/static/chunks/app/layout-cbe799ec784651ca.js +1 -0
  374. package/app/.next/static/chunks/app/login/{page-62fed427ad312406.js → page-1168c63e7fe72ee5.js} +1 -1
  375. package/app/.next/static/chunks/app/manifest.webmanifest/route-dc114b2367afe467.js +1 -0
  376. package/app/.next/static/chunks/app/page-dc114b2367afe467.js +1 -0
  377. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-dc114b2367afe467.js +1 -0
  378. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-dc114b2367afe467.js +1 -0
  379. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-dc114b2367afe467.js +1 -0
  380. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-dc114b2367afe467.js +1 -0
  381. package/app/.next/static/css/{3995d76bba6fb14a.css → 544a28fc50711a49.css} +1 -1
  382. package/app/package.json +1 -1
  383. package/app/public/providers/opencode.png +0 -0
  384. package/package.json +1 -1
  385. package/app/.next/static/WVNl0xvRB6AUPlWoux5nO/_buildManifest.js +0 -1
  386. package/app/.next/static/chunks/5497-ddcd9a9fbd35c26e.js +0 -7
  387. package/app/.next/static/chunks/600-3e3d52de0d15664e.js +0 -3
  388. package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-68a6201a9432adf0.js +0 -15
  389. package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-970e1ec0511819ea.js +0 -1
  390. package/app/.next/static/chunks/app/(dashboard)/dashboard/page-16377aded5ab54f4.js +0 -1
  391. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-f5e1cd9e9487e911.js +0 -1
  392. package/app/.next/static/chunks/app/_global-error/page-ea22cc6d0e23ff6d.js +0 -1
  393. package/app/.next/static/chunks/app/api/auth/login/route-ea22cc6d0e23ff6d.js +0 -1
  394. package/app/.next/static/chunks/app/api/auth/logout/route-ea22cc6d0e23ff6d.js +0 -1
  395. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-ea22cc6d0e23ff6d.js +0 -1
  396. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-ea22cc6d0e23ff6d.js +0 -1
  397. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-ea22cc6d0e23ff6d.js +0 -1
  398. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-ea22cc6d0e23ff6d.js +0 -1
  399. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-ea22cc6d0e23ff6d.js +0 -1
  400. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-ea22cc6d0e23ff6d.js +0 -1
  401. package/app/.next/static/chunks/app/api/cloud/auth/route-ea22cc6d0e23ff6d.js +0 -1
  402. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-ea22cc6d0e23ff6d.js +0 -1
  403. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-ea22cc6d0e23ff6d.js +0 -1
  404. package/app/.next/static/chunks/app/api/cloud/models/alias/route-ea22cc6d0e23ff6d.js +0 -1
  405. package/app/.next/static/chunks/app/api/combos/[id]/route-ea22cc6d0e23ff6d.js +0 -1
  406. package/app/.next/static/chunks/app/api/combos/route-ea22cc6d0e23ff6d.js +0 -1
  407. package/app/.next/static/chunks/app/api/init/route-ea22cc6d0e23ff6d.js +0 -1
  408. package/app/.next/static/chunks/app/api/keys/[id]/route-ea22cc6d0e23ff6d.js +0 -1
  409. package/app/.next/static/chunks/app/api/keys/route-ea22cc6d0e23ff6d.js +0 -1
  410. package/app/.next/static/chunks/app/api/models/alias/route-ea22cc6d0e23ff6d.js +0 -1
  411. package/app/.next/static/chunks/app/api/models/route-ea22cc6d0e23ff6d.js +0 -1
  412. package/app/.next/static/chunks/app/api/models/test/route-ea22cc6d0e23ff6d.js +0 -1
  413. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-ea22cc6d0e23ff6d.js +0 -1
  414. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-ea22cc6d0e23ff6d.js +0 -1
  415. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-ea22cc6d0e23ff6d.js +0 -1
  416. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-ea22cc6d0e23ff6d.js +0 -1
  417. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-ea22cc6d0e23ff6d.js +0 -1
  418. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-ea22cc6d0e23ff6d.js +0 -1
  419. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-ea22cc6d0e23ff6d.js +0 -1
  420. package/app/.next/static/chunks/app/api/pricing/route-ea22cc6d0e23ff6d.js +0 -1
  421. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-ea22cc6d0e23ff6d.js +0 -1
  422. package/app/.next/static/chunks/app/api/provider-nodes/route-ea22cc6d0e23ff6d.js +0 -1
  423. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-ea22cc6d0e23ff6d.js +0 -1
  424. package/app/.next/static/chunks/app/api/providers/[id]/models/route-ea22cc6d0e23ff6d.js +0 -1
  425. package/app/.next/static/chunks/app/api/providers/[id]/route-ea22cc6d0e23ff6d.js +0 -1
  426. package/app/.next/static/chunks/app/api/providers/[id]/test/route-ea22cc6d0e23ff6d.js +0 -1
  427. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-ea22cc6d0e23ff6d.js +0 -1
  428. package/app/.next/static/chunks/app/api/providers/client/route-ea22cc6d0e23ff6d.js +0 -1
  429. package/app/.next/static/chunks/app/api/providers/route-ea22cc6d0e23ff6d.js +0 -1
  430. package/app/.next/static/chunks/app/api/providers/test-batch/route-ea22cc6d0e23ff6d.js +0 -1
  431. package/app/.next/static/chunks/app/api/providers/validate/route-ea22cc6d0e23ff6d.js +0 -1
  432. package/app/.next/static/chunks/app/api/settings/database/route-ea22cc6d0e23ff6d.js +0 -1
  433. package/app/.next/static/chunks/app/api/settings/proxy-test/route-ea22cc6d0e23ff6d.js +0 -1
  434. package/app/.next/static/chunks/app/api/settings/require-login/route-ea22cc6d0e23ff6d.js +0 -1
  435. package/app/.next/static/chunks/app/api/settings/route-ea22cc6d0e23ff6d.js +0 -1
  436. package/app/.next/static/chunks/app/api/shutdown/route-ea22cc6d0e23ff6d.js +0 -1
  437. package/app/.next/static/chunks/app/api/tags/route-ea22cc6d0e23ff6d.js +0 -1
  438. package/app/.next/static/chunks/app/api/translator/console-logs/route-ea22cc6d0e23ff6d.js +0 -1
  439. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-ea22cc6d0e23ff6d.js +0 -1
  440. package/app/.next/static/chunks/app/api/translator/load/route-ea22cc6d0e23ff6d.js +0 -1
  441. package/app/.next/static/chunks/app/api/translator/save/route-ea22cc6d0e23ff6d.js +0 -1
  442. package/app/.next/static/chunks/app/api/translator/send/route-ea22cc6d0e23ff6d.js +0 -1
  443. package/app/.next/static/chunks/app/api/translator/translate/route-ea22cc6d0e23ff6d.js +0 -1
  444. package/app/.next/static/chunks/app/api/tunnel/disable/route-ea22cc6d0e23ff6d.js +0 -1
  445. package/app/.next/static/chunks/app/api/tunnel/enable/route-ea22cc6d0e23ff6d.js +0 -1
  446. package/app/.next/static/chunks/app/api/tunnel/status/route-ea22cc6d0e23ff6d.js +0 -1
  447. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-ea22cc6d0e23ff6d.js +0 -1
  448. package/app/.next/static/chunks/app/api/usage/chart/route-ea22cc6d0e23ff6d.js +0 -1
  449. package/app/.next/static/chunks/app/api/usage/history/route-ea22cc6d0e23ff6d.js +0 -1
  450. package/app/.next/static/chunks/app/api/usage/providers/route-ea22cc6d0e23ff6d.js +0 -1
  451. package/app/.next/static/chunks/app/api/usage/request-details/route-ea22cc6d0e23ff6d.js +0 -1
  452. package/app/.next/static/chunks/app/api/usage/request-logs/route-ea22cc6d0e23ff6d.js +0 -1
  453. package/app/.next/static/chunks/app/api/usage/stream/route-ea22cc6d0e23ff6d.js +0 -1
  454. package/app/.next/static/chunks/app/api/v1/api/chat/route-ea22cc6d0e23ff6d.js +0 -1
  455. package/app/.next/static/chunks/app/api/v1/chat/completions/route-ea22cc6d0e23ff6d.js +0 -1
  456. package/app/.next/static/chunks/app/api/v1/embeddings/route-ea22cc6d0e23ff6d.js +0 -1
  457. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-ea22cc6d0e23ff6d.js +0 -1
  458. package/app/.next/static/chunks/app/api/v1/messages/route-ea22cc6d0e23ff6d.js +0 -1
  459. package/app/.next/static/chunks/app/api/v1/models/route-ea22cc6d0e23ff6d.js +0 -1
  460. package/app/.next/static/chunks/app/api/v1/responses/route-ea22cc6d0e23ff6d.js +0 -1
  461. package/app/.next/static/chunks/app/api/v1/route-ea22cc6d0e23ff6d.js +0 -1
  462. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-ea22cc6d0e23ff6d.js +0 -1
  463. package/app/.next/static/chunks/app/api/v1beta/models/route-ea22cc6d0e23ff6d.js +0 -1
  464. package/app/.next/static/chunks/app/api/version/route-ea22cc6d0e23ff6d.js +0 -1
  465. package/app/.next/static/chunks/app/landing/page-9988533823669cfc.js +0 -1
  466. package/app/.next/static/chunks/app/layout-a9ae8d014d5d7102.js +0 -1
  467. package/app/.next/static/chunks/app/manifest.webmanifest/route-ea22cc6d0e23ff6d.js +0 -1
  468. package/app/.next/static/chunks/app/page-ea22cc6d0e23ff6d.js +0 -1
  469. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-ea22cc6d0e23ff6d.js +0 -1
  470. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-ea22cc6d0e23ff6d.js +0 -1
  471. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-ea22cc6d0e23ff6d.js +0 -1
  472. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-ea22cc6d0e23ff6d.js +0 -1
  473. /package/app/.next/static/{WVNl0xvRB6AUPlWoux5nO → 7sCSr7yWSqEyoyOGqrYLA}/_ssgManifest.js +0 -0
@@ -0,0 +1,15 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2326],{22016:(e,t,s)=>{Promise.resolve().then(s.bind(s,82915))},82915:(e,t,s)=>{"use strict";s.d(t,{default:()=>v});var l=s(95155),a=s(12115),r=s(35497);let n={claude:{id:"claude",name:"Claude Code",icon:"terminal",color:"#D97757",description:"Anthropic Claude Code CLI",configType:"env",envVars:{baseUrl:"ANTHROPIC_BASE_URL",model:"ANTHROPIC_MODEL",opusModel:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnetModel:"ANTHROPIC_DEFAULT_SONNET_MODEL",haikuModel:"ANTHROPIC_DEFAULT_HAIKU_MODEL"},modelAliases:["default","sonnet","opus","haiku","opusplan"],settingsFile:"~/.claude/settings.json",defaultModels:[{id:"opus",name:"Claude Opus",alias:"opus",envKey:"ANTHROPIC_DEFAULT_OPUS_MODEL",defaultValue:"cc/claude-opus-4-6"},{id:"sonnet",name:"Claude Sonnet",alias:"sonnet",envKey:"ANTHROPIC_DEFAULT_SONNET_MODEL",defaultValue:"cc/claude-sonnet-4-6"},{id:"haiku",name:"Claude Haiku",alias:"haiku",envKey:"ANTHROPIC_DEFAULT_HAIKU_MODEL",defaultValue:"cc/claude-haiku-4-5-20251001"}]},openclaw:{id:"openclaw",name:"Open Claw",image:"/providers/openclaw.png",color:"#FF6B35",description:"Open Claw AI Assistant",configType:"custom"},codex:{id:"codex",name:"OpenAI Codex CLI",image:"/providers/codex.png",color:"#10A37F",description:"OpenAI Codex CLI",configType:"custom"},opencode:{id:"opencode",name:"OpenCode",image:"/providers/opencode.png",color:"#E87040",description:"OpenCode AI Terminal Assistant",configType:"custom"},antigravity:{id:"antigravity",name:"Antigravity",image:"/providers/antigravity.png",color:"#4285F4",description:"Google Antigravity IDE with MITM",configType:"mitm",modelAliases:["claude-opus-4-6-thinking","claude-sonnet-4-6","gemini-3-flash","gpt-oss-120b-medium","gemini-3-pro-high","gemini-3-pro-low"],defaultModels:[{id:"gemini-3.1-pro-high",name:"Gemini 3.1 Pro High",alias:"gemini-3.1-pro-high"},{id:"gemini-3.1-pro-low",name:"Gemini 3.1 Pro Low",alias:"gemini-3.1-pro-low"},{id:"gemini-3-flash",name:"Gemini 3 Flash",alias:"gemini-3-flash"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",alias:"claude-sonnet-4-6"},{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 Thinking",alias:"claude-opus-4-6-thinking"},{id:"gpt-oss-120b-medium",name:"GPT OSS 120B Medium",alias:"gpt-oss-120b-medium"}]},droid:{id:"droid",name:"Factory Droid",image:"/providers/droid.png",color:"#00D4FF",description:"Factory Droid AI Assistant",configType:"custom"},cursor:{id:"cursor",name:"Cursor",image:"/providers/cursor.png",color:"#000000",description:"Cursor AI Code Editor",configType:"guide",requiresExternalUrl:!0,notes:[{type:"warning",text:"Requires Cursor Pro account to use this feature."},{type:"cloudCheck",text:"Cursor routes requests through its own server, so local endpoint is not supported. Please enable Tunnel or Cloud Endpoint in Settings."}],guideSteps:[{step:1,title:"Open Settings",desc:"Go to Settings → Models"},{step:2,title:"Enable OpenAI API",desc:'Enable "OpenAI API key" option'},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Add Custom Model",desc:'Click "View All Model" → "Add Custom Model"'},{step:6,title:"Select Model",type:"modelSelector"}]},cline:{id:"cline",name:"Cline",image:"/providers/cline.png",color:"#00D1B2",description:"Cline AI Coding Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Settings",desc:"Go to Cline Settings panel"},{step:2,title:"Select Provider",desc:"Choose API Provider → OpenAI Compatible"},{step:3,title:"Base URL",value:"{{baseUrl}}/v1",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Select Model",type:"modelSelector"}]},kilo:{id:"kilo",name:"Kilo Code",image:"/providers/kilocode.png",color:"#FF6B6B",description:"Kilo Code AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Settings",desc:"Go to Kilo Code Settings panel"},{step:2,title:"Select Provider",desc:"Choose API Provider → OpenAI Compatible"},{step:3,title:"Base URL",value:"{{baseUrl}}/v1",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Select Model",type:"modelSelector"}]},roo:{id:"roo",name:"Roo",image:"/providers/roo.png",color:"#FF6B6B",description:"Roo AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Settings",desc:"Go to Roo Settings panel"},{step:2,title:"Select Provider",desc:"Choose API Provider → Ollama"},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Select Model",type:"modelSelector"}]},continue:{id:"continue",name:"Continue",image:"/providers/continue.png",color:"#7C3AED",description:"Continue AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Config",desc:"Open Continue configuration file"},{step:2,title:"API Key",type:"apiKeySelector"},{step:3,title:"Select Model",type:"modelSelector"},{step:4,title:"Add Model Config",desc:"Add the following configuration to your models array:"}],codeBlock:{language:"json",code:`{
2
+ "apiBase": "{{baseUrl}}",
3
+ "title": "{{model}}",
4
+ "model": "{{model}}",
5
+ "provider": "openai",
6
+ "apiKey": "{{apiKey}}"
7
+ }`}}};var i=s(28777),o=s(5772);let d=s(41463).env.NEXT_PUBLIC_CLOUD_URL;function c({tool:e,isExpanded:t,onToggle:s,activeProviders:n,modelMappings:i,onModelMappingChange:c,baseUrl:x,hasActiveProviders:m,apiKeys:p,cloudEnabled:u,initialStatus:h}){let g,f,y,[b,j]=(0,a.useState)(h||null),[v,N]=(0,a.useState)(!1),[w,k]=(0,a.useState)(!1),[C,S]=(0,a.useState)(!1),[_,E]=(0,a.useState)(null),[A,O]=(0,a.useState)(!1),[I,P]=(0,a.useState)(!1),[R,M]=(0,a.useState)(null),[T,$]=(0,a.useState)(""),[L,K]=(0,a.useState)({}),[U,F]=(0,a.useState)(!1),[z,D]=(0,a.useState)(""),B=(0,a.useRef)(!1),H=(()=>{if(!b?.installed)return null;let e=b.settings?.env?.ANTHROPIC_BASE_URL;if(!e)return"not_configured";let t=e.includes("localhost")||e.includes("127.0.0.1"),s=u&&d&&e.startsWith(d),l=x&&e.startsWith(x);return t||s||l?"configured":"other"})();(0,a.useEffect)(()=>{p?.length>0&&!T&&$(p[0].key)},[p,T]),(0,a.useEffect)(()=>{h&&j(h)},[h]),(0,a.useEffect)(()=>{t&&!b&&(q(),W()),t&&W()},[t]);let W=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&K(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(b?.installed&&!B.current){B.current=!0;let t=b.settings?.env||{};e.defaultModels.forEach(e=>{if(e.envKey){let s=t[e.envKey]||e.defaultValue||"";s&&c(e.alias,s)}});let s=t.ANTHROPIC_AUTH_TOKEN;s&&p?.some(e=>e.key===s)&&$(s)}},[b,p,e.defaultModels,c]);let q=async()=>{N(!0);try{let e=await fetch("/api/cli-tools/claude-settings"),t=await e.json();j(t)}catch(e){j({installed:!1,error:e.message})}finally{N(!1)}},G=()=>{let e=z||x;return e.endsWith("/v1")?e:`${e}/v1`},J=async()=>{k(!0),E(null);try{let t={ANTHROPIC_BASE_URL:G()},s=T?.trim()||(p?.length>0?p[0].key:null)||(u?null:"sk_9router");s&&(t.ANTHROPIC_AUTH_TOKEN=s),e.defaultModels.forEach(e=>{let s=i[e.alias];s&&e.envKey&&(t[e.envKey]=s)});let l=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:t})}),a=await l.json();l.ok?(E({type:"success",text:"Settings applied successfully!"}),j(e=>({...e,hasBackup:!0,settings:{...e?.settings,env:t}}))):E({type:"error",text:a.error||"Failed to apply settings"})}catch(e){E({type:"error",text:e.message})}finally{k(!1)}},Z=async()=>{S(!0),E(null);try{let t=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),s=await t.json();t.ok?(E({type:"success",text:"Settings reset successfully!"}),e.defaultModels.forEach(e=>c(e.alias,e.defaultValue||"")),$("")):E({type:"error",text:s.error||"Failed to reset settings"})}catch(e){E({type:"error",text:e.message})}finally{S(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(o.default,{src:"/providers/claude.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===H&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===H&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===H&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[v&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking Claude CLI..."})]}),!v&&b&&!b.installed&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Claude CLI not installed"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Please install Claude CLI to use this feature."})]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>O(!A),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:A?"expand_less":"help"}),A?"Hide":"How to Install"]})]}),A&&(0,l.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,l.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @anthropic-ai/claude-code"})]}),(0,l.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," to verify."]})]})]})]}),!v&&b?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[b?.settings?.env?.ANTHROPIC_BASE_URL&&(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:b.settings.env.ANTHROPIC_BASE_URL})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:(g=z||x).endsWith("/v1")?g:`${g}/v1`,onChange:e=>D(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),z&&z!==x&&(0,l.jsx)("button",{onClick:()=>D(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),p.length>0?(0,l.jsx)("select",{value:T,onChange:e=>$(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:p.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,l.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:u?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),e.defaultModels.map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:e.name}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:i[e.alias]||"",onChange:t=>c(e.alias,t.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>{M(e.alias),P(!0)},disabled:!m,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${m?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),i[e.alias]&&(0,l.jsx)("button",{onClick:()=>c(e.alias,""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e.alias))]}),_&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===_.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===_.type?"check_circle":"error"}),(0,l.jsx)("span",{children:_.text})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:J,disabled:!m,loading:w,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:Z,disabled:!b?.has9Router,loading:C,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>F(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.rq,{isOpen:I,onClose:()=>P(!1),onSelect:e=>{R&&c(R,e.value)},selectedModel:R?i[R]:null,activeProviders:n,modelAliases:L,title:`Select model for ${R}`}),(0,l.jsx)(r.uR,{isOpen:U,onClose:()=>F(!1),title:"Claude CLI - Manual Configuration",configs:(f=T&&T.trim()?T:u?"<API_KEY_FROM_DASHBOARD>":"sk_9router",y={ANTHROPIC_BASE_URL:G(),ANTHROPIC_AUTH_TOKEN:f},e.defaultModels.forEach(e=>{let t=i[e.alias];t&&e.envKey&&(y[e.envKey]=t)}),[{filename:"~/.claude/settings.json",content:JSON.stringify({env:y},null,2)}])})]})}function x({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:i,activeProviders:d,cloudEnabled:c,initialStatus:x}){let m,p,u,[h,g]=(0,a.useState)(x||null),[f,y]=(0,a.useState)(!1),[b,j]=(0,a.useState)(!1),[v,N]=(0,a.useState)(!1),[w,k]=(0,a.useState)(null),[C,S]=(0,a.useState)(!1),[_,E]=(0,a.useState)(""),[A,O]=(0,a.useState)(""),[I,P]=(0,a.useState)(!1),[R,M]=(0,a.useState)({}),[T,$]=(0,a.useState)(!1),[L,K]=(0,a.useState)("");(0,a.useEffect)(()=>{i?.length>0&&!_&&E(i[0].key)},[i,_]),(0,a.useEffect)(()=>{x&&g(x)},[x]),(0,a.useEffect)(()=>{t&&!h&&(D(),U()),t&&U()},[t]);let U=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&M(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(h?.config){let e=h.config.match(/^model\s*=\s*"([^"]+)"/m);e&&O(e[1])}},[h]);let F=h?.installed?h.config?h.config.includes(n)||h.config.includes("localhost")||h.config.includes("127.0.0.1")?"configured":"other":"not_configured":null,z=()=>{let e=L||`${n}/v1`;return e.endsWith("/v1")?e:`${e}/v1`},D=async()=>{y(!0);try{let e=await fetch("/api/cli-tools/codex-settings"),t=await e.json();g(t)}catch(e){g({installed:!1,error:e.message})}finally{y(!1)}},B=async()=>{j(!0),k(null);try{let e=_&&_.trim()||c?_:"sk_9router",t=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:z(),apiKey:e,model:A})}),s=await t.json();t.ok?(k({type:"success",text:"Settings applied successfully!"}),D()):k({type:"error",text:s.error||"Failed to apply settings"})}catch(e){k({type:"error",text:e.message})}finally{j(!1)}},H=async()=>{N(!0),k(null);try{let e=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),t=await e.json();e.ok?(k({type:"success",text:"Settings reset successfully!"}),O(""),D()):k({type:"error",text:t.error||"Failed to reset settings"})}catch(e){k({type:"error",text:e.message})}finally{N(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(o.default,{src:"/providers/codex.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===F&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===F&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===F&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[f&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking Codex CLI..."})]}),!f&&h&&!h.installed&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Codex CLI not installed"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Please install Codex CLI to use auto-apply feature."})]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>S(!C),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:C?"expand_less":"help"}),C?"Hide":"How to Install"]})]}),C&&(0,l.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,l.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @openai/codex"})]}),(0,l.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"codex"})," to verify."]}),(0,l.jsx)("div",{className:"pt-2 border-t border-border",children:(0,l.jsxs)("p",{className:"text-text-muted text-xs",children:["Codex uses ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/auth.json"})," with ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"OPENAI_API_KEY"}),'. Click "Apply" to auto-configure.']})})]})]})]}),!f&&h?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[h?.config&&((p=(m=h.config.match(/base_url\s*=\s*"([^"]+)"/))?m[1]:null)?(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:p})]}):null),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:L||`${n}/v1`,onChange:e=>K(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),L&&L!==`${n}/v1`&&(0,l.jsx)("button",{onClick:()=>K(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),i.length>0?(0,l.jsx)("select",{value:_,onChange:e=>E(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:i.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,l.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:c?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:A,onChange:e=>O(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>P(!0),disabled:!d?.length,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),A&&(0,l.jsx)("button",{onClick:()=>O(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),w&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===w.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===w.type?"check_circle":"error"}),(0,l.jsx)("span",{children:w.text})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:B,disabled:!_||!A,loading:b,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:H,disabled:!h.has9Router,loading:v,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>$(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.rq,{isOpen:I,onClose:()=>P(!1),onSelect:e=>{O(e.value),P(!1)},selectedModel:A,activeProviders:d,modelAliases:R,title:"Select Model for Codex"}),(0,l.jsx)(r.uR,{isOpen:T,onClose:()=>$(!1),title:"Codex CLI - Manual Configuration",configs:(u=_&&_.trim()?_:c?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.codex/config.toml",content:`# 9Router Configuration for Codex CLI
8
+ model = "${A}"
9
+ model_provider = "9router"
10
+
11
+ [model_providers.9router]
12
+ name = "9Router"
13
+ base_url = "${z()}"
14
+ wire_api = "responses"
15
+ `},{filename:"~/.codex/auth.json",content:JSON.stringify({OPENAI_API_KEY:u},null,2)}])})]})}let m=s(41463).env.NEXT_PUBLIC_CLOUD_URL;function p({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:i,apiKeys:d,activeProviders:c,cloudEnabled:x,initialStatus:p}){let u,h,g,f,[y,b]=(0,a.useState)(p||null),[j,v]=(0,a.useState)(!1),[N,w]=(0,a.useState)(!1),[k,C]=(0,a.useState)(!1),[S,_]=(0,a.useState)(null),[E,A]=(0,a.useState)(""),[O,I]=(0,a.useState)(""),[P,R]=(0,a.useState)(!1),[M,T]=(0,a.useState)({}),[$,L]=(0,a.useState)(!1),[K,U]=(0,a.useState)(""),F=(0,a.useRef)(!1),z=(()=>{if(!y?.installed)return null;let e=y.settings?.customModels?.find(e=>"custom:9Router-0"===e.id);if(!e)return"not_configured";let t=e.baseUrl?.includes("localhost")||e.baseUrl?.includes("127.0.0.1"),s=x&&m&&e.baseUrl?.startsWith(m),l=n&&e.baseUrl?.startsWith(n);return t||s||l?"configured":"other"})();(0,a.useEffect)(()=>{d?.length>0&&!E&&A(d[0].key)},[d,E]),(0,a.useEffect)(()=>{p&&b(p)},[p]),(0,a.useEffect)(()=>{t&&!y&&(B(),D()),t&&D()},[t]);let D=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&T(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(y?.installed&&!F.current){F.current=!0;let e=y.settings?.customModels?.find(e=>"custom:9Router-0"===e.id);e&&(e.model&&I(e.model),e.apiKey&&d?.some(t=>t.key===e.apiKey)&&A(e.apiKey))}},[y,d]);let B=async()=>{v(!0);try{let e=await fetch("/api/cli-tools/droid-settings"),t=await e.json();b(t)}catch(e){b({installed:!1,error:e.message})}finally{v(!1)}},H=()=>{let e=K||n;return e.endsWith("/v1")?e:`${e}/v1`},W=async()=>{w(!0),_(null);try{let e=E?.trim()||(d?.length>0?d[0].key:null)||(x?null:"sk_9router"),t=await fetch("/api/cli-tools/droid-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:H(),apiKey:e,model:O})}),s=await t.json();t.ok?(_({type:"success",text:"Settings applied successfully!"}),B()):_({type:"error",text:s.error||"Failed to apply settings"})}catch(e){_({type:"error",text:e.message})}finally{w(!1)}},q=async()=>{C(!0),_(null);try{let e=await fetch("/api/cli-tools/droid-settings",{method:"DELETE"}),t=await e.json();e.ok?(_({type:"success",text:"Settings reset successfully!"}),I(""),A(""),B()):_({type:"error",text:t.error||"Failed to reset settings"})}catch(e){_({type:"error",text:e.message})}finally{C(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(o.default,{src:"/providers/droid.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===z&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===z&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===z&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[j&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking Factory Droid CLI..."})]}),!j&&y&&!y.installed&&(0,l.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Factory Droid CLI not installed"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Please install Factory Droid CLI to use this feature."})]})]}),!j&&y?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[y?.settings?.customModels?.find(e=>"custom:9Router-0"===e.id)?.baseUrl&&(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:y.settings.customModels.find(e=>"custom:9Router-0"===e.id).baseUrl})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:(u=K||n).endsWith("/v1")?u:`${u}/v1`,onChange:e=>U(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),K&&K!==n&&(0,l.jsx)("button",{onClick:()=>U(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),d.length>0?(0,l.jsx)("select",{value:E,onChange:e=>A(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,l.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:x?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:O,onChange:e=>I(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>R(!0),disabled:!i,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${i?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),O&&(0,l.jsx)("button",{onClick:()=>I(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),S&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===S.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===S.type?"check_circle":"error"}),(0,l.jsx)("span",{children:S.text})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:W,disabled:!O,loading:N,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:q,disabled:!y?.has9Router,loading:k,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>L(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.rq,{isOpen:P,onClose:()=>R(!1),onSelect:e=>{I(e.value),R(!1)},selectedModel:O,activeProviders:c,modelAliases:M,title:"Select Model for Factory Droid"}),(0,l.jsx)(r.uR,{isOpen:$,onClose:()=>L(!1),title:"Factory Droid - Manual Configuration",configs:(h=E&&E.trim()?E:x?"<API_KEY_FROM_DASHBOARD>":"sk_9router",g={customModels:[{model:O||"provider/model-id",id:"custom:9Router-0",index:0,baseUrl:H(),apiKey:h,displayName:O||"provider/model-id",maxOutputTokens:131072,noImageSupport:!1,provider:"openai"}]},f="u">typeof navigator&&navigator.platform,[{filename:f?.toLowerCase().includes("win")?"%USERPROFILE%\\.factory\\settings.json":"~/.factory/settings.json",content:JSON.stringify(g,null,2)}])})]})}function u({tool:e,isExpanded:t,onToggle:s,baseUrl:n,hasActiveProviders:i,apiKeys:d,activeProviders:c,cloudEnabled:x,initialStatus:m}){let p,u,[h,g]=(0,a.useState)(m||null),[f,y]=(0,a.useState)(!1),[b,j]=(0,a.useState)(!1),[v,N]=(0,a.useState)(!1),[w,k]=(0,a.useState)(null),[C,S]=(0,a.useState)(""),[_,E]=(0,a.useState)(""),[A,O]=(0,a.useState)(!1),[I,P]=(0,a.useState)({}),[R,M]=(0,a.useState)(!1),[T,$]=(0,a.useState)(""),L=(0,a.useRef)(!1),K=(()=>{if(!h?.installed)return null;let e=h.settings?.models?.providers?.["9router"];if(!e)return"not_configured";let t=e.baseUrl?.includes("localhost")||e.baseUrl?.includes("127.0.0.1")||e.baseUrl?.includes("0.0.0.0"),s=n&&e.baseUrl?.startsWith(n);return t||s?"configured":"other"})();(0,a.useEffect)(()=>{d?.length>0&&!C&&S(d[0].key)},[d,C]),(0,a.useEffect)(()=>{m&&g(m)},[m]),(0,a.useEffect)(()=>{t&&!h&&(F(),U()),t&&U()},[t]);let U=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&P(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(h?.installed&&!L.current){L.current=!0;let e=h.settings?.models?.providers?.["9router"];if(e){let t=h.settings?.agents?.defaults?.model?.primary;t&&E(t.replace("9router/","")),e.apiKey&&d?.some(t=>t.key===e.apiKey)&&S(e.apiKey)}}},[h,d]);let F=async()=>{y(!0);try{let e=await fetch("/api/cli-tools/openclaw-settings"),t=await e.json();g(t)}catch(e){g({installed:!1,error:e.message})}finally{y(!1)}},z=()=>window.location.origin.replace("://localhost","://127.0.0.1"),D=()=>{let e=T||z();return e.endsWith("/v1")?e:`${e}/v1`},B=async()=>{j(!0),k(null);try{let e=C?.trim()||(d?.length>0?d[0].key:null)||(x?null:"sk_9router"),t=await fetch("/api/cli-tools/openclaw-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:D(),apiKey:e,model:_})}),s=await t.json();t.ok?(k({type:"success",text:"Settings applied successfully!"}),F()):k({type:"error",text:s.error||"Failed to apply settings"})}catch(e){k({type:"error",text:e.message})}finally{j(!1)}},H=async()=>{N(!0),k(null);try{let e=await fetch("/api/cli-tools/openclaw-settings",{method:"DELETE"}),t=await e.json();e.ok?(k({type:"success",text:"Settings reset successfully!"}),E(""),S(""),F()):k({type:"error",text:t.error||"Failed to reset settings"})}catch(e){k({type:"error",text:e.message})}finally{N(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(o.default,{src:"/providers/openclaw.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===K&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===K&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===K&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[f&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking Open Claw CLI..."})]}),!f&&h&&!h.installed&&(0,l.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Open Claw CLI not installed"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Please install Open Claw CLI to use this feature."})]})]}),!f&&h?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[h?.settings?.models?.providers?.["9router"]?.baseUrl&&(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:h.settings.models.providers["9router"].baseUrl})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:(p=T||z()).endsWith("/v1")?p:`${p}/v1`,onChange:e=>$(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),T&&T!==n&&(0,l.jsx)("button",{onClick:()=>$(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),d.length>0?(0,l.jsx)("select",{value:C,onChange:e=>S(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,l.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:x?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:_,onChange:e=>E(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>O(!0),disabled:!i,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${i?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),_&&(0,l.jsx)("button",{onClick:()=>E(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),w&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===w.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===w.type?"check_circle":"error"}),(0,l.jsx)("span",{children:w.text})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:B,disabled:!_,loading:b,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:H,disabled:!h?.has9Router,loading:v,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>M(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.rq,{isOpen:A,onClose:()=>O(!1),onSelect:e=>{E(e.value),O(!1)},selectedModel:_,activeProviders:c,modelAliases:I,title:"Select Model for Open Claw"}),(0,l.jsx)(r.uR,{isOpen:R,onClose:()=>M(!1),title:"Open Claw - Manual Configuration",configs:(u=C&&C.trim()?C:x?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.openclaw/openclaw.json",content:JSON.stringify({agents:{defaults:{model:{primary:`9router/${_||"provider/model-id"}`}}},models:{providers:{"9router":{baseUrl:D(),apiKey:u,api:"openai-completions",models:[{id:_||"provider/model-id",name:(_||"provider/model-id").split("/").pop()}]}}}},null,2)}])})]})}function h({toolId:e,tool:t,isExpanded:s,onToggle:n,baseUrl:i,apiKeys:d,activeProviders:c=[],cloudEnabled:x=!1,tunnelEnabled:m=!1}){let[p,u]=(0,a.useState)(null),[h,g]=(0,a.useState)(!1),[f,y]=(0,a.useState)(""),[b,j]=(0,a.useState)(()=>d?.length>0?d[0].key:""),v=e=>{let t=b&&b.trim()?b:x?"your-api-key":"sk_9router",s=i||"http://localhost:20128",l=s.endsWith("/v1")?s:`${s}/v1`;return e.replace(/\{\{baseUrl\}\}/g,l).replace(/\{\{apiKey\}\}/g,t).replace(/\{\{model\}\}/g,f||"provider/model-id")},N=async(e,t)=>{await navigator.clipboard.writeText(v(e)),u(t),setTimeout(()=>u(null),2e3)},w=c.length>0,k=()=>(!t.requiresExternalUrl||!!x||!!m)&&(!t.requiresCloud||!!x);return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:n,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:t.image?(0,l.jsx)(o.default,{src:t.image,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}}):t.icon?(0,l.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:t.color},children:t.icon}):(0,l.jsx)(o.default,{src:`/providers/${e}.png`,alt:t.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:t.name}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:t.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${s?"rotate-180":""}`,children:"expand_more"})]}),s&&(0,l.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:t.guideSteps?(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[t.notes&&0!==t.notes.length?(0,l.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:t.notes.map((e,t)=>{if("cloudCheck"===e.type&&(x||m))return null;let s="warning"===e.type,a="cloudCheck"===e.type&&!x&&!m,r="bg-blue-500/10 border-blue-500/30",n="text-blue-600 dark:text-blue-400",i="text-blue-500",o="info";return s?(r="bg-yellow-500/10 border-yellow-500/30",n="text-yellow-600 dark:text-yellow-400",i="text-yellow-500",o="warning"):a&&(r="bg-red-500/10 border-red-500/30",n="text-red-600 dark:text-red-400",i="text-red-500",o="error"),(0,l.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${r}`,children:[(0,l.jsx)("span",{className:`material-symbols-outlined text-lg ${i}`,children:o}),(0,l.jsx)("p",{className:`text-sm ${n}`,children:e.text})]},t)})}):null,k()&&t.guideSteps.map(e=>(0,l.jsxs)("div",{className:"flex items-start gap-4",children:[(0,l.jsx)("div",{className:"size-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold text-white",style:{backgroundColor:t.color},children:e.step}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("p",{className:"font-medium text-text",children:e.title}),e.desc&&(0,l.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:e.desc}),"apiKeySelector"===e.type&&(0,l.jsx)("div",{className:"mt-2 flex items-center gap-2",children:d&&d.length>0?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("select",{value:b,onChange:e=>j(e.target.value),className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:d.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}),(0,l.jsx)("button",{onClick:()=>N(b,"apiKey"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-lg",children:"apiKey"===p?"check":"content_copy"})})]}):(0,l.jsx)("span",{className:"text-sm text-text-muted",children:x?"No API keys - Create one in Keys page":"sk_9router"})}),"modelSelector"===e.type&&(0,l.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,l.jsx)("input",{type:"text",value:f,onChange:e=>y(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>g(!0),disabled:!w,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${w?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),f&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{onClick:()=>N(f,"model"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-lg",children:"model"===p?"check":"content_copy"})}),(0,l.jsx)("button",{onClick:()=>y(""),className:"p-2 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]})]}),e.value&&(0,l.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,l.jsx)("code",{className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm font-mono border border-border truncate",children:v(e.value)}),e.copyable&&(0,l.jsx)("button",{onClick:()=>N(e.value,`${e.step}-${e.title}`),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-lg",children:p===`${e.step}-${e.title}`?"check":"content_copy"})})]})]})]},e.step)),k()&&t.codeBlock&&(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,l.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wide",children:t.codeBlock.language}),(0,l.jsxs)("button",{onClick:()=>N(t.codeBlock.code,"codeblock"),className:"flex items-center gap-1 px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-sm",children:"codeblock"===p?"check":"content_copy"}),"codeblock"===p?"Copied!":"Copy"]})]}),(0,l.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto",children:(0,l.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:v(t.codeBlock.code)})})]})]}):(0,l.jsx)("p",{className:"text-text-muted text-sm",children:"Coming soon..."})}),(0,l.jsx)(r.rq,{isOpen:h,onClose:()=>g(!1),onSelect:e=>{y(e.value)},selectedModel:f,activeProviders:c,title:"Select Model"})]})}function g({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:i,activeProviders:d,hasActiveProviders:c,cloudEnabled:x,initialStatus:m}){let[p,u]=(0,a.useState)(m||null),[h,g]=(0,a.useState)(!1),[f,y]=(0,a.useState)(!1),[b,j]=(0,a.useState)(""),[v,N]=(0,a.useState)(""),[w,k]=(0,a.useState)(null),[C,S]=(0,a.useState)({}),[_,E]=(0,a.useState)(!1),[A,O]=(0,a.useState)(null);(0,a.useEffect)(()=>{i?.length>0&&!v&&N(i[0].key)},[i,v]),(0,a.useEffect)(()=>{m&&u(m)},[m]),(0,a.useEffect)(()=>{t&&!p&&(P(),I()),t&&I()},[t]);let I=async()=>{try{let e=await fetch("/api/cli-tools/antigravity-mitm/alias?tool=antigravity");if(e.ok){let t=(await e.json()).aliases||{};Object.keys(t).length>0&&S(t)}}catch(e){console.log("Error loading saved mappings:",e)}},P=async()=>{try{let e=await fetch("/api/cli-tools/antigravity-mitm");if(e.ok){let t=await e.json();u(t)}}catch(e){console.log("Error fetching status:",e),u({running:!1})}},R="u">typeof navigator&&navigator.userAgent?.includes("Windows"),M=async e=>{g(!0),k(null);try{let t=v?.trim()||(i?.length>0?i[0].key:null)||(x?null:"sk_9router"),s=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t,sudoPassword:e})}),l=await s.json();s.ok?(k({type:"success",text:"MITM started"}),y(!1),j(""),P()):k({type:"error",text:l.error||"Failed to start"})}catch(e){k({type:"error",text:e.message})}finally{g(!1)}},T=async e=>{g(!0),k(null);try{let t=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:e})}),s=await t.json();t.ok?(k({type:"success",text:"MITM stopped"}),y(!1),j(""),P()):k({type:"error",text:s.error||"Failed to stop"})}catch(e){k({type:"error",text:e.message})}finally{g(!1)}},$=()=>{b.trim()?p?.running?T(b):M(b):k({type:"error",text:"Sudo password is required"})},L=(e,t)=>{S(s=>({...s,[e]:t}))},K=async()=>{g(!0),k(null);try{let e=await fetch("/api/cli-tools/antigravity-mitm/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:"antigravity",mappings:C})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to save mappings")}k({type:"success",text:"Mappings saved!"})}catch(e){k({type:"error",text:e.message})}finally{g(!1)}},U=p?.running;return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(o.default,{src:"/providers/antigravity.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),U?(0,l.jsx)(r.Ex,{variant:"success",size:"sm",children:"Active"}):(0,l.jsx)(r.Ex,{variant:"default",size:"sm",children:"Inactive"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[(0,l.jsx)("div",{className:"flex items-center gap-3",children:[{label:"DNS",ok:p?.dnsConfigured},{label:"Cert",ok:p?.certExists},{label:"Server",ok:p?.running}].map(({label:e,ok:t})=>(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[(0,l.jsx)("span",{className:`material-symbols-outlined text-[14px] ${t?"text-green-500":"text-text-muted"}`,children:t?"check_circle":"radio_button_unchecked"}),(0,l.jsx)("span",{className:`text-xs ${t?"text-green-500":"text-text-muted"}`,children:e})]},e))}),(0,l.jsx)("div",{className:"flex items-center gap-2",children:U?(0,l.jsxs)("button",{onClick:()=>{R||p?.hasCachedPassword?T(""):(y(!0),k(null))},disabled:h,className:"px-4 py-2 rounded-lg bg-red-500/10 border border-red-500/30 text-red-500 font-medium text-sm flex items-center gap-2 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"stop_circle"}),"Stop MITM"]}):(0,l.jsxs)("button",{onClick:()=>{R||p?.hasCachedPassword?M(""):(y(!0),k(null))},disabled:h||!c,className:"px-4 py-2 rounded-lg bg-primary/10 border border-primary/30 text-primary font-medium text-sm flex items-center gap-2 hover:bg-primary/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"play_circle"}),"Start MITM"]})}),w?.type==="error"&&(0,l.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,l.jsx)("span",{children:w.text})]}),U&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),i.length>0?(0,l.jsx)("select",{value:v,onChange:e=>N(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:i.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,l.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:x?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),e.defaultModels.map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:e.name}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:C[e.alias]||"",onChange:t=>L(e.alias,t.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>{O(e.alias),E(!0)},disabled:!c,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${c?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"}),C[e.alias]&&(0,l.jsx)("button",{onClick:()=>L(e.alias,""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e.alias)),(0,l.jsx)("div",{className:"flex items-center gap-2",children:(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:K,disabled:h||0===Object.keys(C).length,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Save Mappings"]})})]}),!U&&R&&(0,l.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-yellow-500/10 text-yellow-600 border border-yellow-500/20",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),(0,l.jsx)("span",{children:"Windows: Run terminal (9Router) as Administrator to enable MITM"})]}),!U&&(0,l.jsxs)("div",{className:"flex flex-col gap-1.5 px-1",children:[(0,l.jsxs)("p",{className:"text-xs text-text-muted",children:[(0,l.jsx)("span",{className:"font-medium text-text-main",children:"How it works:"})," Intercepts Antigravity traffic via DNS redirect, letting you reroute models through 9Router."]}),(0,l.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted",children:[(0,l.jsx)("span",{children:"1. Generates SSL cert & adds to system keychain"}),(0,l.jsxs)("span",{children:["2. Redirects ",(0,l.jsx)("code",{className:"text-[10px] bg-surface px-1 rounded",children:"daily-cloudcode-pa.googleapis.com"})," → localhost"]}),(0,l.jsx)("span",{children:"3. Maps Antigravity models to any provider via 9Router"})]})]})]}),(0,l.jsx)(r.aF,{isOpen:f,onClose:()=>{y(!1),j(""),k(null)},title:"Sudo Password Required",size:"sm",children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"Required for SSL certificate and DNS configuration"})]}),(0,l.jsx)(r.pd,{type:"password",placeholder:"Enter sudo password",value:b,onChange:e=>j(e.target.value),onKeyDown:e=>{"Enter"!==e.key||h||$()}}),w&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===w.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===w.type?"check_circle":"error"}),(0,l.jsx)("span",{children:w.text})]}),(0,l.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,l.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>{y(!1),j(""),k(null)},disabled:h,children:"Cancel"}),(0,l.jsx)(r.$n,{variant:"primary",size:"sm",onClick:$,loading:h,children:"Confirm"})]})]})}),(0,l.jsx)(r.rq,{isOpen:_,onClose:()=>E(!1),onSelect:e=>{A&&S(t=>({...t,[A]:e.value}))},selectedModel:A?C[A]:null,activeProviders:d,title:`Select model for ${A}`})]})}function f({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:i,activeProviders:d,cloudEnabled:c,initialStatus:x}){let m,[p,u]=(0,a.useState)(x||null),[h,g]=(0,a.useState)(!1),[f,y]=(0,a.useState)(!1),[b,j]=(0,a.useState)(!1),[v,N]=(0,a.useState)(null),[w,k]=(0,a.useState)(!1),[C,S]=(0,a.useState)(""),[_,E]=(0,a.useState)(""),[A,O]=(0,a.useState)(!1),[I,P]=(0,a.useState)({}),[R,M]=(0,a.useState)(!1),[T,$]=(0,a.useState)("");(0,a.useEffect)(()=>{i?.length>0&&!C&&S(i[0].key)},[i,C]),(0,a.useEffect)(()=>{x&&u(x)},[x]),(0,a.useEffect)(()=>{t&&!p&&(F(),L()),t&&L()},[t]),(0,a.useEffect)(()=>{p?.config?.model?.startsWith("9router/")&&E(p.config.model.replace("9router/",""))},[p]);let L=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&P(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},K=(()=>{if(!p?.installed)return null;if(!p.config)return"not_configured";let e=p.config?.provider?.["9router"]?.options?.baseURL||"",t=e.includes("localhost")||e.includes("127.0.0.1");return p.has9Router&&(t||e.includes(n))?"configured":p.has9Router?"other":"not_configured"})(),U=()=>{let e=T||n;return e.endsWith("/v1")?e:`${e}/v1`},F=async()=>{g(!0);try{let e=await fetch("/api/cli-tools/opencode-settings"),t=await e.json();u(t)}catch(e){u({installed:!1,error:e.message})}finally{g(!1)}},z=async()=>{y(!0),N(null);try{let e=C&&C.trim()||c?C:"sk_9router",t=await fetch("/api/cli-tools/opencode-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:U(),apiKey:e,model:_})}),s=await t.json();t.ok?(N({type:"success",text:"Settings applied successfully!"}),F()):N({type:"error",text:s.error||"Failed to apply settings"})}catch(e){N({type:"error",text:e.message})}finally{y(!1)}},D=async()=>{j(!0),N(null);try{let e=await fetch("/api/cli-tools/opencode-settings",{method:"DELETE"}),t=await e.json();e.ok?(N({type:"success",text:"Settings reset successfully!"}),E(""),F()):N({type:"error",text:t.error||"Failed to reset settings"})}catch(e){N({type:"error",text:e.message})}finally{j(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(o.default,{src:"/providers/opencode.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===K&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===K&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===K&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[h&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking OpenCode CLI..."})]}),!h&&p&&!p.installed&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"OpenCode CLI not installed"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Please install OpenCode CLI to use auto-apply feature."})]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>k(!w),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:w?"expand_less":"help"}),w?"Hide":"How to Install"]})]}),w&&(0,l.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,l.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux:"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g opencode-ai"})]}),(0,l.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"opencode"})," to verify."]})]})]})]}),!h&&p?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[p?.config?.provider?.["9router"]?.options?.baseURL&&(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("span",{className:"flex-1 px-2 py-1.5 text-xs text-text-muted truncate",children:p.config.provider["9router"].options.baseURL})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Base URL"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:T||`${n}/v1`,onChange:e=>$(e.target.value),placeholder:"https://.../v1",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),T&&T!==`${n}/v1`&&(0,l.jsx)("button",{onClick:()=>$(""),className:"p-1 text-text-muted hover:text-primary rounded transition-colors",title:"Reset to default",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"restart_alt"})})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),i.length>0?(0,l.jsx)("select",{value:C,onChange:e=>S(e.target.value),className:"flex-1 px-2 py-1.5 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:i.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,l.jsx)("span",{className:"flex-1 text-xs text-text-muted px-2 py-1.5",children:c?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right",children:"Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,l.jsx)("input",{type:"text",value:_,onChange:e=>E(e.target.value),placeholder:"provider/model-id",className:"flex-1 px-2 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>O(!0),disabled:!d?.length,className:`px-2 py-1.5 rounded border text-xs transition-colors shrink-0 whitespace-nowrap ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),_&&(0,l.jsx)("button",{onClick:()=>E(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),v&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===v.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===v.type?"check_circle":"error"}),(0,l.jsx)("span",{children:v.text})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:z,disabled:!_,loading:f,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:D,disabled:!p.has9Router,loading:b,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>M(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.rq,{isOpen:A,onClose:()=>O(!1),onSelect:e=>{E(e.value),O(!1)},selectedModel:_,activeProviders:d,modelAliases:I,title:"Select Model for OpenCode"}),(0,l.jsx)(r.uR,{isOpen:R,onClose:()=>M(!1),title:"OpenCode - Manual Configuration",configs:(m=C&&C.trim()?C:c?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.config/opencode/opencode.json",content:JSON.stringify({provider:{"9router":{npm:"@ai-sdk/openai-compatible",options:{baseURL:U(),apiKey:m},models:{[_||"provider/model-id"]:{name:_||"provider/model-id"}}}},model:`9router/${_||"provider/model-id"}`},null,2)}])})]})}function y({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:i,activeProviders:d,cloudEnabled:c,initialStatus:x}){let m,p,[u,h]=(0,a.useState)(x||null),[g,f]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),[j,v]=(0,a.useState)(!1),[N,w]=(0,a.useState)(null),[k,C]=(0,a.useState)(""),[S,_]=(0,a.useState)({}),[E,A]=(0,a.useState)(!1),[O,I]=(0,a.useState)(""),[P,R]=(0,a.useState)([]),[M,T]=(0,a.useState)(!1);(0,a.useEffect)(()=>{i?.length>0&&!k&&C(i[0].key)},[i,k]),(0,a.useEffect)(()=>{x&&h(x)},[x]),(0,a.useEffect)(()=>{t&&!u&&(F(),$()),t&&$()},[t]),(0,a.useEffect)(()=>{if(u?.config&&Array.isArray(u.config)&&0===P.length){let e=u.config.find(e=>"9Router"===e.name);e?.models?.length>0&&R(e.models.map(e=>e.id))}},[u]);let $=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&_(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},L=(()=>{if(!u)return null;if(!u.has9Router)return"not_configured";let e=u.currentUrl||"";return e.includes("localhost")||e.includes("127.0.0.1")||e.includes(n)?"configured":"other"})(),K=()=>n.endsWith("/v1")?n:`${n}/v1`,U=()=>{let e=O.trim();!e||P.includes(e)||(R(t=>[...t,e]),I(""))},F=async()=>{f(!0);try{let e=await fetch("/api/cli-tools/copilot-settings"),t=await e.json();h(t)}catch(e){h({error:e.message})}finally{f(!1)}},z=async()=>{b(!0),w(null);try{let e=k&&k.trim()||c?k:"sk_9router",t=await fetch("/api/cli-tools/copilot-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:K(),apiKey:e,models:P})}),s=await t.json();t.ok?(w({type:"success",text:s.message||"Settings applied successfully!"}),F()):w({type:"error",text:s.error||"Failed to apply settings"})}catch(e){w({type:"error",text:e.message})}finally{b(!1)}},D=async()=>{v(!0),w(null);try{let e=await fetch("/api/cli-tools/copilot-settings",{method:"DELETE"}),t=await e.json();e.ok?(w({type:"success",text:"Settings reset successfully!"}),R([]),F()):w({type:"error",text:t.error||"Failed to reset settings"})}catch(e){w({type:"error",text:e.message})}finally{v(!1)}};return(0,l.jsxs)(r.Zp,{padding:"sm",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:s,children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(o.default,{src:"/providers/copilot.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===L&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===L&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===L&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[g&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking Copilot config..."})]}),!g&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-lg",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-blue-500 text-lg",children:"info"}),(0,l.jsxs)("div",{className:"text-xs text-blue-700 dark:text-blue-300",children:[(0,l.jsxs)("p",{className:"font-medium",children:["Writes to ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/10 rounded",children:"chatLanguageModels.json"})]}),(0,l.jsx)("p",{className:"mt-0.5 opacity-80",children:"Reload VS Code after applying for changes to take effect."})]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("label",{className:"text-xs font-medium text-text-muted",children:"API Key"}),i.length>0?(0,l.jsx)("select",{value:k,onChange:e=>C(e.target.value),className:"px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:i.map(e=>(0,l.jsx)("option",{value:e.key,children:e.key},e.id))}):(0,l.jsx)("span",{className:"text-sm text-text-muted",children:c?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsxs)("label",{className:"text-xs font-medium text-text-muted",children:["Models ",P.length>0&&(0,l.jsxs)("span",{className:"text-primary",children:["(",P.length," added)"]})]}),P.length>0&&(0,l.jsx)("div",{className:"flex flex-col gap-1 mb-1",children:P.map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-bg-secondary rounded-lg border border-border",children:[(0,l.jsx)("span",{className:"flex-1 text-sm font-mono truncate",children:e}),(0,l.jsx)("button",{onClick:()=>R(t=>t.filter(t=>t!==e)),className:"text-text-muted hover:text-red-500 transition-colors",title:"Remove",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e))}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("input",{type:"text",value:O,onChange:e=>I(e.target.value),onKeyDown:e=>"Enter"===e.key&&U(),placeholder:"provider/model-id",className:"flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,l.jsx)("button",{onClick:()=>T(!0),disabled:!d?.length,className:`px-3 py-2 rounded-lg border text-sm transition-colors shrink-0 ${d?.length?"bg-bg-secondary border-border hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"}),(0,l.jsx)("button",{onClick:U,disabled:!O.trim(),className:"px-3 py-2 rounded-lg border text-sm bg-bg-secondary border-border hover:border-primary transition-colors shrink-0 disabled:opacity-50",title:"Add model",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"})})]})]})]}),N&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===N.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===N.type?"check_circle":"error"}),(0,l.jsx)("span",{children:N.text})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:z,disabled:0===P.length,loading:y,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:D,disabled:!u?.has9Router,loading:j,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>A(!0),disabled:0===P.length,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,l.jsx)(r.rq,{isOpen:M,onClose:()=>T(!1),onSelect:e=>{I(e.value),T(!1)},selectedModel:O,activeProviders:d,modelAliases:S,title:"Select Model for GitHub Copilot"}),(0,l.jsx)(r.uR,{isOpen:E,onClose:()=>A(!1),title:"GitHub Copilot - Manual Configuration",configs:(m=k&&k.trim()?k:c?"<API_KEY_FROM_DASHBOARD>":"sk_9router",p=K(),[{filename:"~/Library/Application Support/Code/User/chatLanguageModels.json",content:JSON.stringify([{name:"9Router",vendor:"azure",apiKey:m,models:P.map(e=>({id:e,name:e,url:`${p}/chat/completions#models.ai.azure.com`,toolCalling:!0,vision:!1,maxInputTokens:128e3,maxOutputTokens:16e3}))}],null,2)}])})]})}let b=s(41463).env.NEXT_PUBLIC_CLOUD_URL,j={claude:"/api/cli-tools/claude-settings",codex:"/api/cli-tools/codex-settings",opencode:"/api/cli-tools/opencode-settings",copilot:"/api/cli-tools/copilot-settings",droid:"/api/cli-tools/droid-settings",openclaw:"/api/cli-tools/openclaw-settings",antigravity:"/api/cli-tools/antigravity-mitm"};function v({machineId:e}){let t,s,o,[d,m]=(0,a.useState)([]),[v,N]=(0,a.useState)(!0),[w,k]=(0,a.useState)(null),[C,S]=(0,a.useState)({}),[_,E]=(0,a.useState)(!1),[A,O]=(0,a.useState)(!1),[I,P]=(0,a.useState)(""),[R,M]=(0,a.useState)([]),[T,$]=(0,a.useState)({});(0,a.useEffect)(()=>{F(),K(),U(),L()},[]);let L=async()=>{try{let e=await Promise.all(Object.entries(j).map(async([e,t])=>{try{let s=await fetch(t),l=await s.json();return[e,l]}catch{return[e,null]}}));$(Object.fromEntries(e))}catch(e){console.log("Error fetching tool statuses:",e)}},K=async()=>{try{let[e,t]=await Promise.all([fetch("/api/settings"),fetch("/api/tunnel/status")]);if(e.ok){let t=await e.json();E(t.cloudEnabled||!1)}if(t.ok){let e=await t.json();O(e.enabled||!1),P(e.tunnelUrl||"")}}catch(e){console.log("Error loading settings:",e)}},U=async()=>{try{let e=await fetch("/api/keys");if(e.ok){let t=await e.json();M(t.keys||[])}}catch(e){console.log("Error fetching API keys:",e)}},F=async()=>{try{let e=await fetch("/api/providers"),t=await e.json();e.ok&&m(t.connections||[])}catch(e){console.log("Error fetching connections:",e)}finally{N(!1)}},z=()=>d.filter(e=>!1!==e.isActive),D=(0,a.useCallback)((e,t,s)=>{S(l=>l[e]?.[t]===s?l:{...l,[e]:{...l[e],[t]:s}})},[]);if(v)return(0,l.jsx)("div",{className:"flex flex-col gap-6",children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)(r.Qv,{}),(0,l.jsx)(r.Qv,{}),(0,l.jsx)(r.Qv,{})]})});let B=(t=z(),s=[],o=new Set,t.forEach(e=>{let t=i.Xg[e.provider]||e.provider;(0,i.KC)(e.provider).forEach(l=>{let a=`${t}/${l.id}`;o.has(a)||(o.add(a),s.push({value:a,label:`${t}/${l.id}`,provider:e.provider,alias:t,connectionName:e.name,modelId:l.id}))})}),s).length>0;return(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[!B&&(0,l.jsx)(r.Zp,{className:"border-yellow-500/50 bg-yellow-500/5",children:(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"No active providers"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Please add and connect providers first to configure CLI tools."})]})]})}),(0,l.jsx)("div",{className:"flex flex-col gap-4",children:Object.entries(n).map(([e,t])=>((e,t)=>{let s={tool:t,isExpanded:w===e,onToggle:()=>k(w===e?null:e),baseUrl:A&&I?I:_&&b?b:window.location.origin,apiKeys:R};switch(e){case"claude":return(0,l.jsx)(c,{...s,activeProviders:z(),modelMappings:C[e]||{},onModelMappingChange:(t,s)=>D(e,t,s),hasActiveProviders:B,cloudEnabled:_,initialStatus:T.claude},e);case"codex":return(0,l.jsx)(x,{...s,activeProviders:z(),cloudEnabled:_,initialStatus:T.codex},e);case"opencode":return(0,l.jsx)(f,{...s,activeProviders:z(),cloudEnabled:_,initialStatus:T.opencode},e);case"copilot":return(0,l.jsx)(y,{...s,activeProviders:z(),cloudEnabled:_,initialStatus:T.copilot},e);case"droid":return(0,l.jsx)(p,{...s,activeProviders:z(),hasActiveProviders:B,cloudEnabled:_,initialStatus:T.droid},e);case"openclaw":return(0,l.jsx)(u,{...s,activeProviders:z(),hasActiveProviders:B,cloudEnabled:_,initialStatus:T.openclaw},e);case"antigravity":return(0,l.jsx)(g,{...s,activeProviders:z(),hasActiveProviders:B,cloudEnabled:_,initialStatus:T.antigravity},e);default:return(0,l.jsx)(h,{toolId:e,...s,activeProviders:z(),cloudEnabled:_,tunnelEnabled:A},e)}})(e,t))})]})}}},e=>{e.O(0,[5370,4335,5772,2032,4495,5497,8441,3794,7358],()=>e(e.s=22016)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{47295:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>n});var a=s(95155),l=s(12115),o=s(35497),r=s(11059);s(52679);let i=/^[a-zA-Z0-9_-]+$/;function n(){let[e,t]=(0,l.useState)([]),[s,i]=(0,l.useState)(!0),[n,c]=(0,l.useState)(!1),[x,h]=(0,l.useState)(null),[p,u]=(0,l.useState)([]),{copied:b,copy:j}=(0,r.C)();(0,l.useEffect)(()=>{f()},[]);let f=async()=>{try{let[e,s]=await Promise.all([fetch("/api/combos"),fetch("/api/providers")]),a=await e.json(),l=await s.json();e.ok&&t(a.combos||[]),s.ok&&u(l.connections||[])}catch(e){console.log("Error fetching data:",e)}finally{i(!1)}},v=async e=>{try{let t=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)await f(),c(!1);else{let e=await t.json();alert(e.error||"Failed to create combo")}}catch(e){console.log("Error creating combo:",e)}},g=async(e,t)=>{try{let s=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(s.ok)await f(),h(null);else{let e=await s.json();alert(e.error||"Failed to update combo")}}catch(e){console.log("Error updating combo:",e)}},y=async s=>{if(confirm("Delete this combo?"))try{(await fetch(`/api/combos/${s}`,{method:"DELETE"})).ok&&t(e.filter(e=>e.id!==s))}catch(e){console.log("Error deleting combo:",e)}};return s?(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(o.Qv,{}),(0,a.jsx)(o.Qv,{})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-semibold",children:"Combos"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Create model combos with fallback support"})]}),(0,a.jsx)(o.$n,{icon:"add",onClick:()=>c(!0),children:"Create Combo"})]}),0===e.length?(0,a.jsx)(o.Zp,{children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"layers"})}),(0,a.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No combos yet"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create model combos with fallback support"}),(0,a.jsx)(o.$n,{icon:"add",onClick:()=>c(!0),children:"Create Combo"})]})}):(0,a.jsx)("div",{className:"flex flex-col gap-4",children:e.map(e=>(0,a.jsx)(d,{combo:e,copied:b,onCopy:j,onEdit:()=>h(e),onDelete:()=>y(e.id)},e.id))}),(0,a.jsx)(m,{isOpen:n,onClose:()=>c(!1),onSave:v,activeProviders:p},"create"),(0,a.jsx)(m,{isOpen:!!x,combo:x,onClose:()=>h(null),onSave:e=>g(x.id,e),activeProviders:p},x?.id||"new")]})}function d({combo:e,copied:t,onCopy:s,onEdit:l,onDelete:r}){return(0,a.jsx)(o.Zp,{padding:"sm",className:"group",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("code",{className:"text-sm font-medium font-mono truncate",children:e.name}),(0,a.jsx)("button",{onClick:t=>{t.stopPropagation(),s(e.name,`combo-${e.id}`)},className:"p-0.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors opacity-0 group-hover:opacity-100",title:"Copy combo name",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:t===`combo-${e.id}`?"check":"content_copy"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[0===e.models.length?(0,a.jsx)("span",{className:"text-xs text-text-muted italic",children:"No models"}):e.models.slice(0,3).map((e,t)=>(0,a.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1.5 py-0.5 rounded text-text-muted",children:e},t)),e.models.length>3&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",e.models.length-3," more"]})]})]})]}),(0,a.jsxs)("div",{className:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[(0,a.jsx)("button",{onClick:l,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:"Edit",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})}),(0,a.jsx)("button",{onClick:r,className:"p-1.5 hover:bg-red-500/10 rounded text-red-500 transition-colors",title:"Delete",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]})})}function c({index:e,model:t,isFirst:s,isLast:o,onEdit:r,onMoveUp:i,onMoveDown:n,onRemove:d}){let[c,m]=(0,l.useState)(!1),[x,h]=(0,l.useState)(t),p=()=>{let e=x.trim();e&&e!==t?r(e):h(t),m(!1)};return(0,a.jsxs)("div",{className:"group flex items-center gap-1.5 px-2 py-1 rounded-md bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] transition-colors",children:[(0,a.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:e+1}),c?(0,a.jsx)("input",{autoFocus:!0,value:x,onChange:e=>h(e.target.value),onBlur:p,onKeyDown:e=>{"Enter"===e.key&&p(),"Escape"===e.key&&(h(t),m(!1))},className:"flex-1 min-w-0 px-1.5 py-0.5 text-xs font-mono bg-white dark:bg-black/20 border border-primary/40 rounded outline-none text-text-main"}):(0,a.jsx)("div",{className:"flex-1 min-w-0 px-1.5 py-0.5 text-xs font-mono text-text-main truncate cursor-text hover:bg-black/5 dark:hover:bg-white/5 rounded",onClick:()=>m(!0),title:"Click to edit",children:t}),(0,a.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,a.jsx)("button",{onClick:i,disabled:s,className:`p-0.5 rounded ${s?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move up",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,a.jsx)("button",{onClick:n,disabled:o,className:`p-0.5 rounded ${o?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move down",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,a.jsx)("button",{onClick:d,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:"Remove",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]})}function m({isOpen:e,combo:t,onClose:s,onSave:r,activeProviders:n}){let[d,m]=(0,l.useState)(t?.name||""),[x,h]=(0,l.useState)(t?.models||[]),[p,u]=(0,l.useState)(!1),[b,j]=(0,l.useState)(!1),[f,v]=(0,l.useState)(""),[g,y]=(0,l.useState)({}),N=async()=>{try{let e=await fetch("/api/models/alias");if(!e.ok)return;let t=await e.json();y(t.aliases||{})}catch(e){console.error("Error fetching modal data:",e)}};(0,l.useEffect)(()=>{e&&N()},[e]);let k=e=>e.trim()?i.test(e)?(v(""),!0):(v("Only letters, numbers, - and _ allowed"),!1):(v("Name is required"),!1),w=async()=>{k(d)&&(j(!0),await r({name:d.trim(),models:x}),j(!1))},C=!!t;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.aF,{isOpen:e,onClose:s,title:C?"Edit Combo":"Create Combo",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(o.pd,{label:"Combo Name",value:d,onChange:e=>{let t=e.target.value;m(t),t?k(t):v("")},placeholder:"my-combo",error:f}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:"Only letters, numbers, - and _ allowed"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Models"}),0===x.length?(0,a.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No models added yet"})]}):(0,a.jsx)("div",{className:"flex flex-col gap-1 max-h-[200px] overflow-y-auto",children:x.map((e,t)=>(0,a.jsx)(c,{index:t,model:e,isFirst:0===t,isLast:t===x.length-1,onEdit:e=>{let s=[...x];s[t]=e,h(s)},onMoveUp:()=>(e=>{if(0===e)return;let t=[...x];[t[e-1],t[e]]=[t[e],t[e-1]],h(t)})(t),onMoveDown:()=>(e=>{if(e===x.length-1)return;let t=[...x];[t[e],t[e+1]]=[t[e+1],t[e]],h(t)})(t),onRemove:()=>{h(x.filter((e,s)=>s!==t))}},t))}),(0,a.jsxs)("button",{onClick:()=>u(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-text-muted hover:text-primary hover:border-primary/30 transition-colors flex items-center justify-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]}),(0,a.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,a.jsx)(o.$n,{onClick:s,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,a.jsx)(o.$n,{onClick:w,fullWidth:!0,size:"sm",disabled:!d.trim()||!!f||b,children:b?"Saving...":C?"Save":"Create"})]})]})}),(0,a.jsx)(o.rq,{isOpen:p,onClose:()=>u(!1),onSelect:e=>{x.includes(e.value)||h([...x,e.value])},activeProviders:n,modelAliases:g,title:"Add Model to Combo"})]})}},73822:(e,t,s)=>{Promise.resolve().then(s.bind(s,47295))}},e=>{e.O(0,[5370,4335,600,1672,8729,5497,8441,3794,7358],()=>e(e.s=73822)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{47295:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>n});var a=s(95155),l=s(12115),o=s(35497),r=s(11059);s(52679);let i=/^[a-zA-Z0-9_-]+$/;function n(){let[e,t]=(0,l.useState)([]),[s,i]=(0,l.useState)(!0),[n,c]=(0,l.useState)(!1),[x,h]=(0,l.useState)(null),[p,u]=(0,l.useState)([]),{copied:b,copy:j}=(0,r.C)();(0,l.useEffect)(()=>{f()},[]);let f=async()=>{try{let[e,s]=await Promise.all([fetch("/api/combos"),fetch("/api/providers")]),a=await e.json(),l=await s.json();e.ok&&t(a.combos||[]),s.ok&&u(l.connections||[])}catch(e){console.log("Error fetching data:",e)}finally{i(!1)}},v=async e=>{try{let t=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)await f(),c(!1);else{let e=await t.json();alert(e.error||"Failed to create combo")}}catch(e){console.log("Error creating combo:",e)}},g=async(e,t)=>{try{let s=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(s.ok)await f(),h(null);else{let e=await s.json();alert(e.error||"Failed to update combo")}}catch(e){console.log("Error updating combo:",e)}},y=async s=>{if(confirm("Delete this combo?"))try{(await fetch(`/api/combos/${s}`,{method:"DELETE"})).ok&&t(e.filter(e=>e.id!==s))}catch(e){console.log("Error deleting combo:",e)}};return s?(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(o.Qv,{}),(0,a.jsx)(o.Qv,{})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-semibold",children:"Combos"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Create model combos with fallback support"})]}),(0,a.jsx)(o.$n,{icon:"add",onClick:()=>c(!0),children:"Create Combo"})]}),0===e.length?(0,a.jsx)(o.Zp,{children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"layers"})}),(0,a.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No combos yet"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create model combos with fallback support"}),(0,a.jsx)(o.$n,{icon:"add",onClick:()=>c(!0),children:"Create Combo"})]})}):(0,a.jsx)("div",{className:"flex flex-col gap-4",children:e.map(e=>(0,a.jsx)(d,{combo:e,copied:b,onCopy:j,onEdit:()=>h(e),onDelete:()=>y(e.id)},e.id))}),(0,a.jsx)(m,{isOpen:n,onClose:()=>c(!1),onSave:v,activeProviders:p},"create"),(0,a.jsx)(m,{isOpen:!!x,combo:x,onClose:()=>h(null),onSave:e=>g(x.id,e),activeProviders:p},x?.id||"new")]})}function d({combo:e,copied:t,onCopy:s,onEdit:l,onDelete:r}){return(0,a.jsx)(o.Zp,{padding:"sm",className:"group",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("code",{className:"text-sm font-medium font-mono truncate",children:e.name}),(0,a.jsx)("button",{onClick:t=>{t.stopPropagation(),s(e.name,`combo-${e.id}`)},className:"p-0.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors opacity-0 group-hover:opacity-100",title:"Copy combo name",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:t===`combo-${e.id}`?"check":"content_copy"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[0===e.models.length?(0,a.jsx)("span",{className:"text-xs text-text-muted italic",children:"No models"}):e.models.slice(0,3).map((e,t)=>(0,a.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1.5 py-0.5 rounded text-text-muted",children:e},t)),e.models.length>3&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted",children:["+",e.models.length-3," more"]})]})]})]}),(0,a.jsxs)("div",{className:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[(0,a.jsx)("button",{onClick:l,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:"Edit",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})}),(0,a.jsx)("button",{onClick:r,className:"p-1.5 hover:bg-red-500/10 rounded text-red-500 transition-colors",title:"Delete",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]})})}function c({index:e,model:t,isFirst:s,isLast:o,onEdit:r,onMoveUp:i,onMoveDown:n,onRemove:d}){let[c,m]=(0,l.useState)(!1),[x,h]=(0,l.useState)(t),p=()=>{let e=x.trim();e&&e!==t?r(e):h(t),m(!1)};return(0,a.jsxs)("div",{className:"group flex items-center gap-1.5 px-2 py-1 rounded-md bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] transition-colors",children:[(0,a.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:e+1}),c?(0,a.jsx)("input",{autoFocus:!0,value:x,onChange:e=>h(e.target.value),onBlur:p,onKeyDown:e=>{"Enter"===e.key&&p(),"Escape"===e.key&&(h(t),m(!1))},className:"flex-1 min-w-0 px-1.5 py-0.5 text-xs font-mono bg-white dark:bg-black/20 border border-primary/40 rounded outline-none text-text-main"}):(0,a.jsx)("div",{className:"flex-1 min-w-0 px-1.5 py-0.5 text-xs font-mono text-text-main truncate cursor-text hover:bg-black/5 dark:hover:bg-white/5 rounded",onClick:()=>m(!0),title:"Click to edit",children:t}),(0,a.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,a.jsx)("button",{onClick:i,disabled:s,className:`p-0.5 rounded ${s?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move up",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,a.jsx)("button",{onClick:n,disabled:o,className:`p-0.5 rounded ${o?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move down",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,a.jsx)("button",{onClick:d,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:"Remove",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]})}function m({isOpen:e,combo:t,onClose:s,onSave:r,activeProviders:n}){let[d,m]=(0,l.useState)(t?.name||""),[x,h]=(0,l.useState)(t?.models||[]),[p,u]=(0,l.useState)(!1),[b,j]=(0,l.useState)(!1),[f,v]=(0,l.useState)(""),[g,y]=(0,l.useState)({}),N=async()=>{try{let e=await fetch("/api/models/alias");if(!e.ok)return;let t=await e.json();y(t.aliases||{})}catch(e){console.error("Error fetching modal data:",e)}};(0,l.useEffect)(()=>{e&&N()},[e]);let k=e=>e.trim()?i.test(e)?(v(""),!0):(v("Only letters, numbers, - and _ allowed"),!1):(v("Name is required"),!1),w=async()=>{k(d)&&(j(!0),await r({name:d.trim(),models:x}),j(!1))},C=!!t;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.aF,{isOpen:e,onClose:s,title:C?"Edit Combo":"Create Combo",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(o.pd,{label:"Combo Name",value:d,onChange:e=>{let t=e.target.value;m(t),t?k(t):v("")},placeholder:"my-combo",error:f}),(0,a.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:"Only letters, numbers, - and _ allowed"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Models"}),0===x.length?(0,a.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No models added yet"})]}):(0,a.jsx)("div",{className:"flex flex-col gap-1 max-h-[200px] overflow-y-auto",children:x.map((e,t)=>(0,a.jsx)(c,{index:t,model:e,isFirst:0===t,isLast:t===x.length-1,onEdit:e=>{let s=[...x];s[t]=e,h(s)},onMoveUp:()=>(e=>{if(0===e)return;let t=[...x];[t[e-1],t[e]]=[t[e],t[e-1]],h(t)})(t),onMoveDown:()=>(e=>{if(e===x.length-1)return;let t=[...x];[t[e],t[e+1]]=[t[e+1],t[e]],h(t)})(t),onRemove:()=>{h(x.filter((e,s)=>s!==t))}},t))}),(0,a.jsxs)("button",{onClick:()=>u(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-text-muted hover:text-primary hover:border-primary/30 transition-colors flex items-center justify-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]}),(0,a.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,a.jsx)(o.$n,{onClick:s,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,a.jsx)(o.$n,{onClick:w,fullWidth:!0,size:"sm",disabled:!d.trim()||!!f||b,children:b?"Saving...":C?"Save":"Create"})]})]})}),(0,a.jsx)(o.rq,{isOpen:p,onClose:()=>u(!1),onSelect:e=>{x.includes(e.value)||h([...x,e.value])},activeProviders:n,modelAliases:g,title:"Add Model to Combo"})]})}},73822:(e,t,s)=>{Promise.resolve().then(s.bind(s,47295))}},e=>{e.O(0,[5370,4335,5772,2032,4495,5497,8441,3794,7358],()=>e(e.s=73822)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[712],{44493:(e,t,l)=>{"use strict";l.d(t,{default:()=>o});var s=l(95155),n=l(12115),r=l(35497),a=l(90620);let c={LOG:"text-green-400",INFO:"text-blue-400",WARN:"text-yellow-400",ERROR:"text-red-400",DEBUG:"text-purple-400"};function o(){let[e,t]=(0,n.useState)([]),[l,o]=(0,n.useState)(!1),i=(0,n.useRef)(null),u=async()=>{try{await fetch("/api/translator/console-logs",{method:"DELETE"})}catch(e){console.error("Failed to clear console logs:",e)}};return(0,n.useEffect)(()=>{let e=new EventSource("/api/translator/console-logs/stream");return e.onopen=()=>o(!0),e.onmessage=e=>{let l=JSON.parse(e.data);"init"===l.type?t(l.logs.slice(-a.UY.maxLines)):"line"===l.type?t(e=>{let t=[...e,l.line];return t.length>a.UY.maxLines?t.slice(-a.UY.maxLines):t}):"clear"===l.type&&t([])},e.onerror=()=>o(!1),()=>e.close()},[]),(0,n.useEffect)(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e]),(0,s.jsx)("div",{className:"",children:(0,s.jsxs)(r.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-end px-4 pt-3 pb-2",children:(0,s.jsx)(r.$n,{size:"sm",variant:"outline",icon:"delete",onClick:u,children:"Clear"})}),(0,s.jsx)("div",{ref:i,className:"bg-black rounded-b-lg p-4 text-xs font-mono h-[calc(100vh-220px)] overflow-y-auto",children:0===e.length?(0,s.jsx)("span",{className:"text-text-muted",children:"No console logs yet."}):(0,s.jsx)("div",{className:"space-y-0.5",children:e.map((e,t)=>{let l,n;return(0,s.jsx)("div",{children:(n=c[(l=e.match(/\[(\w+)\]/g))?l[1]?.replace(/\[|\]/g,""):null]||"text-green-400",(0,s.jsx)("span",{className:n,children:e}))},t)})})})]})})}},89129:(e,t,l)=>{Promise.resolve().then(l.bind(l,44493))}},e=>{e.O(0,[5370,4335,600,1672,8729,5497,8441,3794,7358],()=>e(e.s=89129)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[712],{44493:(e,t,l)=>{"use strict";l.d(t,{default:()=>o});var s=l(95155),n=l(12115),r=l(35497),a=l(90620);let c={LOG:"text-green-400",INFO:"text-blue-400",WARN:"text-yellow-400",ERROR:"text-red-400",DEBUG:"text-purple-400"};function o(){let[e,t]=(0,n.useState)([]),[l,o]=(0,n.useState)(!1),i=(0,n.useRef)(null),u=async()=>{try{await fetch("/api/translator/console-logs",{method:"DELETE"})}catch(e){console.error("Failed to clear console logs:",e)}};return(0,n.useEffect)(()=>{let e=new EventSource("/api/translator/console-logs/stream");return e.onopen=()=>o(!0),e.onmessage=e=>{let l=JSON.parse(e.data);"init"===l.type?t(l.logs.slice(-a.UY.maxLines)):"line"===l.type?t(e=>{let t=[...e,l.line];return t.length>a.UY.maxLines?t.slice(-a.UY.maxLines):t}):"clear"===l.type&&t([])},e.onerror=()=>o(!1),()=>e.close()},[]),(0,n.useEffect)(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e]),(0,s.jsx)("div",{className:"",children:(0,s.jsxs)(r.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-end px-4 pt-3 pb-2",children:(0,s.jsx)(r.$n,{size:"sm",variant:"outline",icon:"delete",onClick:u,children:"Clear"})}),(0,s.jsx)("div",{ref:i,className:"bg-black rounded-b-lg p-4 text-xs font-mono h-[calc(100vh-220px)] overflow-y-auto",children:0===e.length?(0,s.jsx)("span",{className:"text-text-muted",children:"No console logs yet."}):(0,s.jsx)("div",{className:"space-y-0.5",children:e.map((e,t)=>{let l,n;return(0,s.jsx)("div",{children:(n=c[(l=e.match(/\[(\w+)\]/g))?l[1]?.replace(/\[|\]/g,""):null]||"text-green-400",(0,s.jsx)("span",{className:n,children:e}))},t)})})})]})})}},89129:(e,t,l)=>{Promise.resolve().then(l.bind(l,44493))}},e=>{e.O(0,[5370,4335,5772,2032,4495,5497,8441,3794,7358],()=>e(e.s=89129)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6099],{},_=>{_.O(0,[5370,4335,5772,2032,4495,5497,1393,8441,3794,7358],()=>_(_.s=51393)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6337],{},_=>{_.O(0,[5370,4335,5772,2032,4495,5497,1393,8441,3794,7358],()=>_(_.s=51393)),_N_E=_.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3471],{64561:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var a=s(95155),r=s(12115),i=s(35497),l=s(1620),n=s(31474),o=s(90620);function d(){let{theme:e,setTheme:t,isDark:s}=(0,l.D)(),[d,c]=(0,r.useState)({fallbackStrategy:"fill-first"}),[x,m]=(0,r.useState)(!0),[u,p]=(0,r.useState)({current:"",new:"",confirm:""}),[b,h]=(0,r.useState)({type:"",message:""}),[y,g]=(0,r.useState)(!1),[f,j]=(0,r.useState)(!1),[N,v]=(0,r.useState)({type:"",message:""}),w=(0,r.useRef)(null),[P,k]=(0,r.useState)({outboundProxyEnabled:!1,outboundProxyUrl:"",outboundNoProxy:""}),[C,S]=(0,r.useState)({type:"",message:""}),[O,E]=(0,r.useState)(!1),[R,T]=(0,r.useState)(!1);(0,r.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{c(e),k({outboundProxyEnabled:e?.outboundProxyEnabled===!0,outboundProxyUrl:e?.outboundProxyUrl||"",outboundNoProxy:e?.outboundNoProxy||""}),m(!1)}).catch(e=>{console.error("Failed to fetch settings:",e),m(!1)})},[]);let F=async e=>{if(e.preventDefault(),!0===d.outboundProxyEnabled){E(!0),S({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyUrl:P.outboundProxyUrl,outboundNoProxy:P.outboundNoProxy})}),t=await e.json();e.ok?(c(e=>({...e,...t})),S({type:"success",message:"Proxy settings applied"})):S({type:"error",message:t.error||"Failed to update proxy settings"})}catch(e){S({type:"error",message:"An error occurred"})}finally{E(!1)}}},M=async()=>{if(!0!==d.outboundProxyEnabled)return;let e=(P.outboundProxyUrl||"").trim();if(!e)return void S({type:"error",message:"Please enter a Proxy URL to test"});T(!0),S({type:"",message:""});try{let t=await fetch("/api/settings/proxy-test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyUrl:e})}),s=await t.json();t.ok&&s?.ok?S({type:"success",message:`Proxy test OK (${s.status}) in ${s.elapsedMs}ms`}):S({type:"error",message:s?.error||"Proxy test failed"})}catch(e){S({type:"error",message:"An error occurred"})}finally{T(!1)}},L=async e=>{E(!0),S({type:"",message:""});try{let t=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyEnabled:e})}),s=await t.json();t.ok?(c(e=>({...e,...s})),k(e=>({...e,outboundProxyEnabled:s?.outboundProxyEnabled===!0})),S({type:"success",message:e?"Proxy enabled":"Proxy disabled"})):S({type:"error",message:s.error||"Failed to update proxy settings"})}catch(e){S({type:"error",message:"An error occurred"})}finally{E(!1)}},J=async e=>{if(e.preventDefault(),u.new!==u.confirm)return void h({type:"error",message:"Passwords do not match"});g(!0),h({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:u.current,newPassword:u.new})}),t=await e.json();e.ok?(h({type:"success",message:"Password updated successfully"}),p({current:"",new:"",confirm:""})):h({type:"error",message:t.error||"Failed to update password"})}catch(e){h({type:"error",message:"An error occurred"})}finally{g(!1)}},U=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({fallbackStrategy:e})})).ok&&c(t=>({...t,fallbackStrategy:e}))}catch(e){console.error("Failed to update settings:",e)}},q=async e=>{let t=parseInt(e);if(!isNaN(t)&&!(t<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({stickyRoundRobinLimit:t})})).ok&&c(e=>({...e,stickyRoundRobinLimit:t}))}catch(e){console.error("Failed to update sticky limit:",e)}},A=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:e})})).ok&&c(t=>({...t,requireLogin:e}))}catch(e){console.error("Failed to update require login:",e)}},$=async(e,t)=>{let s=parseInt(t);if(!isNaN(s)&&!(s<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[e]:s})})).ok&&c(t=>({...t,[e]:s}))}catch(t){console.error(`Failed to update ${e}:`,t)}},I=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({observabilityEnabled:e})})).ok&&c(t=>({...t,observabilityEnabled:e}))}catch(e){console.error("Failed to update observabilityEnabled:",e)}},z=async()=>{try{let e=await fetch("/api/settings");if(!e.ok)return;let t=await e.json();c(t)}catch(e){console.error("Failed to reload settings:",e)}},B=async()=>{j(!0),v({type:"",message:""});try{let e=await fetch("/api/settings/database");if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||"Failed to export database")}let t=await e.json(),s=JSON.stringify(t,null,2),a=new Blob([s],{type:"application/json"}),r=URL.createObjectURL(a),i=document.createElement("a"),l=new Date().toISOString().replace(/[.:]/g,"-");i.href=r,i.download=`9router-backup-${l}.json`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r),v({type:"success",message:"Database backup downloaded"})}catch(e){v({type:"error",message:e.message||"Failed to export database"})}finally{j(!1)}},D=async e=>{let t=e.target.files?.[0];if(t){j(!0),v({type:"",message:""});try{let e=await t.text(),s=JSON.parse(e),a=await fetch("/api/settings/database",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),r=await a.json().catch(()=>({}));if(!a.ok)throw Error(r.error||"Failed to import database");await z(),v({type:"success",message:"Database imported successfully"})}catch(e){v({type:"error",message:e.message||"Invalid backup file"})}finally{w.current&&(w.current.value=""),j(!1)}}},H=!1!==d.observabilityEnabled;return(0,a.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("div",{className:"size-12 rounded-lg bg-green-500/10 text-green-500 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-2xl",children:"computer"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold",children:"Local Mode"}),(0,a.jsx)("p",{className:"text-text-muted",children:"Running on your machine"})]})]}),(0,a.jsx)("div",{className:"inline-flex p-1 rounded-lg bg-black/5 dark:bg-white/5",children:["light","dark","system"].map(s=>(0,a.jsxs)("button",{type:"button",onClick:()=>t(s),className:(0,n.cn)("flex items-center gap-1.5 px-3 py-1.5 rounded-md font-medium transition-all",e===s?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"light"===s?"light_mode":"dark"===s?"dark_mode":"contrast"}),(0,a.jsx)("span",{className:"capitalize text-sm",children:s})]},s))})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 pt-4 border-t border-border",children:[(0,a.jsx)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-bg border border-border",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Database Location"}),(0,a.jsx)("p",{className:"text-sm text-text-muted font-mono",children:"~/.9router/db.json"})]})}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(i.$n,{variant:"secondary",icon:"download",onClick:B,loading:f,children:"Download Backup"}),(0,a.jsx)(i.$n,{variant:"outline",icon:"upload",onClick:()=>w.current?.click(),disabled:f,children:"Import Backup"}),(0,a.jsx)("input",{ref:w,type:"file",accept:"application/json,.json",className:"hidden",onChange:D})]}),N.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===N.type?"text-red-500":"text-green-600 dark:text-green-400"}`,children:N.message})]})]}),(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-primary/10 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"shield"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Security"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Require login"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"When ON, dashboard requires password. When OFF, access without login."})]}),(0,a.jsx)(i.lM,{checked:!0===d.requireLogin,onChange:()=>A(!d.requireLogin),disabled:x})]}),!0===d.requireLogin&&(0,a.jsxs)("form",{onSubmit:J,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[d.hasPassword&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Current Password"}),(0,a.jsx)(i.pd,{type:"password",placeholder:"Enter current password",value:u.current,onChange:e=>p({...u,current:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"New Password"}),(0,a.jsx)(i.pd,{type:"password",placeholder:"Enter new password",value:u.new,onChange:e=>p({...u,new:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Confirm New Password"}),(0,a.jsx)(i.pd,{type:"password",placeholder:"Confirm new password",value:u.confirm,onChange:e=>p({...u,confirm:e.target.value}),required:!0})]})]}),b.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===b.type?"text-red-500":"text-green-500"}`,children:b.message}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(i.$n,{type:"submit",variant:"primary",loading:y,children:d.hasPassword?"Update Password":"Set Password"})})]})]})]}),(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-blue-500/10 text-blue-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"route"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Routing Strategy"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Round Robin"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Cycle through accounts to distribute load"})]}),(0,a.jsx)(i.lM,{checked:"round-robin"===d.fallbackStrategy,onChange:()=>U("round-robin"===d.fallbackStrategy?"fill-first":"round-robin"),disabled:x})]}),"round-robin"===d.fallbackStrategy&&(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Sticky Limit"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Calls per account before switching"})]}),(0,a.jsx)(i.pd,{type:"number",min:"1",max:"10",value:d.stickyRoundRobinLimit||3,onChange:e=>q(e.target.value),disabled:x,className:"w-20 text-center"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted italic pt-2 border-t border-border/50",children:"round-robin"===d.fallbackStrategy?`Currently distributing requests across all available accounts with ${d.stickyRoundRobinLimit||3} calls per account.`:"Currently using accounts in priority order (Fill First)."})]})]}),(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"wifi"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Network"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Outbound Proxy"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Enable proxy for OAuth + provider outbound requests."})]}),(0,a.jsx)(i.lM,{checked:!0===d.outboundProxyEnabled,onChange:()=>L(!0!==d.outboundProxyEnabled),disabled:x||O})]}),!0===d.outboundProxyEnabled&&(0,a.jsxs)("form",{onSubmit:F,className:"flex flex-col gap-4 pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium",children:"Proxy URL"}),(0,a.jsx)(i.pd,{placeholder:"http://127.0.0.1:7897",value:P.outboundProxyUrl,onChange:e=>k(t=>({...t,outboundProxyUrl:e.target.value})),disabled:x||O}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Leave empty to inherit existing env proxy (if any)."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 pt-2 border-t border-border/50",children:[(0,a.jsx)("label",{className:"font-medium",children:"No Proxy"}),(0,a.jsx)(i.pd,{placeholder:"localhost,127.0.0.1",value:P.outboundNoProxy,onChange:e=>k(t=>({...t,outboundNoProxy:e.target.value})),disabled:x||O}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Comma-separated hostnames/domains to bypass the proxy."})]}),(0,a.jsxs)("div",{className:"pt-2 border-t border-border/50 flex items-center gap-2",children:[(0,a.jsx)(i.$n,{type:"button",variant:"secondary",loading:R,disabled:x||O,onClick:M,children:"Test proxy URL"}),(0,a.jsx)(i.$n,{type:"submit",variant:"primary",loading:O,children:"Apply"})]})]}),C.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===C.type?"text-red-500":"text-green-500"} pt-2 border-t border-border/50`,children:C.message})]})]}),(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-orange-500/10 text-orange-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"monitoring"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Observability"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Enable Observability"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Turn request detail recording on/off globally"})]}),(0,a.jsx)(i.lM,{checked:H,onChange:I,disabled:x})]}),(0,a.jsxs)("div",{className:(0,n.cn)("flex flex-col gap-4",!H&&"opacity-60"),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Max Records"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Maximum request detail records to keep (older records are auto-deleted)"})]}),(0,a.jsx)(i.pd,{type:"number",min:"100",max:"10000",step:"100",value:d.observabilityMaxRecords||1e3,onChange:e=>$("observabilityMaxRecords",parseInt(e.target.value)),disabled:x||!H,className:"w-28 text-center"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Batch Size"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Number of items to accumulate before writing to database (higher = better performance)"})]}),(0,a.jsx)(i.pd,{type:"number",min:"5",max:"100",step:"5",value:d.observabilityBatchSize||20,onChange:e=>$("observabilityBatchSize",parseInt(e.target.value)),disabled:x||!H,className:"w-28 text-center"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Flush Interval (ms)"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Maximum time to wait before flushing buffer (prevents data loss during low traffic)"})]}),(0,a.jsx)(i.pd,{type:"number",min:"1000",max:"30000",step:"1000",value:d.observabilityFlushIntervalMs||5e3,onChange:e=>$("observabilityFlushIntervalMs",parseInt(e.target.value)),disabled:x||!H,className:"w-28 text-center"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Max JSON Size (KB)"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Maximum size for each JSON field (request/response) before truncation"})]}),(0,a.jsx)(i.pd,{type:"number",min:"100",max:"10240",step:"100",value:d.observabilityMaxJsonSize||1024,onChange:e=>$("observabilityMaxJsonSize",parseInt(e.target.value)),disabled:x||!H,className:"w-28 text-center"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted italic pt-2 border-t border-border/50",children:["Current: Keeps ",d.observabilityMaxRecords||1e3," records, batches every ",d.observabilityBatchSize||20," requests, max ",d.observabilityMaxJsonSize||1024,"KB per field"]})]})]})]}),(0,a.jsxs)("div",{className:"text-center text-sm text-text-muted py-4",children:[(0,a.jsxs)("p",{children:[o.vQ.name," v",o.vQ.version]}),(0,a.jsx)("p",{className:"mt-1",children:"Local Mode - All data stored on your machine"})]})]})})}},76086:(e,t,s)=>{Promise.resolve().then(s.bind(s,64561))}},e=>{e.O(0,[5370,4335,600,1672,8729,5497,8441,3794,7358],()=>e(e.s=76086)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3471],{64561:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var a=s(95155),r=s(12115),i=s(35497),l=s(1620),n=s(31474),o=s(90620);function d(){let{theme:e,setTheme:t,isDark:s}=(0,l.D)(),[d,c]=(0,r.useState)({fallbackStrategy:"fill-first"}),[x,m]=(0,r.useState)(!0),[u,p]=(0,r.useState)({current:"",new:"",confirm:""}),[b,h]=(0,r.useState)({type:"",message:""}),[y,g]=(0,r.useState)(!1),[f,j]=(0,r.useState)(!1),[N,v]=(0,r.useState)({type:"",message:""}),w=(0,r.useRef)(null),[P,k]=(0,r.useState)({outboundProxyEnabled:!1,outboundProxyUrl:"",outboundNoProxy:""}),[C,S]=(0,r.useState)({type:"",message:""}),[O,E]=(0,r.useState)(!1),[R,T]=(0,r.useState)(!1);(0,r.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{c(e),k({outboundProxyEnabled:e?.outboundProxyEnabled===!0,outboundProxyUrl:e?.outboundProxyUrl||"",outboundNoProxy:e?.outboundNoProxy||""}),m(!1)}).catch(e=>{console.error("Failed to fetch settings:",e),m(!1)})},[]);let F=async e=>{if(e.preventDefault(),!0===d.outboundProxyEnabled){E(!0),S({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyUrl:P.outboundProxyUrl,outboundNoProxy:P.outboundNoProxy})}),t=await e.json();e.ok?(c(e=>({...e,...t})),S({type:"success",message:"Proxy settings applied"})):S({type:"error",message:t.error||"Failed to update proxy settings"})}catch(e){S({type:"error",message:"An error occurred"})}finally{E(!1)}}},M=async()=>{if(!0!==d.outboundProxyEnabled)return;let e=(P.outboundProxyUrl||"").trim();if(!e)return void S({type:"error",message:"Please enter a Proxy URL to test"});T(!0),S({type:"",message:""});try{let t=await fetch("/api/settings/proxy-test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyUrl:e})}),s=await t.json();t.ok&&s?.ok?S({type:"success",message:`Proxy test OK (${s.status}) in ${s.elapsedMs}ms`}):S({type:"error",message:s?.error||"Proxy test failed"})}catch(e){S({type:"error",message:"An error occurred"})}finally{T(!1)}},L=async e=>{E(!0),S({type:"",message:""});try{let t=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyEnabled:e})}),s=await t.json();t.ok?(c(e=>({...e,...s})),k(e=>({...e,outboundProxyEnabled:s?.outboundProxyEnabled===!0})),S({type:"success",message:e?"Proxy enabled":"Proxy disabled"})):S({type:"error",message:s.error||"Failed to update proxy settings"})}catch(e){S({type:"error",message:"An error occurred"})}finally{E(!1)}},J=async e=>{if(e.preventDefault(),u.new!==u.confirm)return void h({type:"error",message:"Passwords do not match"});g(!0),h({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:u.current,newPassword:u.new})}),t=await e.json();e.ok?(h({type:"success",message:"Password updated successfully"}),p({current:"",new:"",confirm:""})):h({type:"error",message:t.error||"Failed to update password"})}catch(e){h({type:"error",message:"An error occurred"})}finally{g(!1)}},U=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({fallbackStrategy:e})})).ok&&c(t=>({...t,fallbackStrategy:e}))}catch(e){console.error("Failed to update settings:",e)}},q=async e=>{let t=parseInt(e);if(!isNaN(t)&&!(t<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({stickyRoundRobinLimit:t})})).ok&&c(e=>({...e,stickyRoundRobinLimit:t}))}catch(e){console.error("Failed to update sticky limit:",e)}},A=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:e})})).ok&&c(t=>({...t,requireLogin:e}))}catch(e){console.error("Failed to update require login:",e)}},$=async(e,t)=>{let s=parseInt(t);if(!isNaN(s)&&!(s<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[e]:s})})).ok&&c(t=>({...t,[e]:s}))}catch(t){console.error(`Failed to update ${e}:`,t)}},I=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({observabilityEnabled:e})})).ok&&c(t=>({...t,observabilityEnabled:e}))}catch(e){console.error("Failed to update observabilityEnabled:",e)}},z=async()=>{try{let e=await fetch("/api/settings");if(!e.ok)return;let t=await e.json();c(t)}catch(e){console.error("Failed to reload settings:",e)}},B=async()=>{j(!0),v({type:"",message:""});try{let e=await fetch("/api/settings/database");if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error||"Failed to export database")}let t=await e.json(),s=JSON.stringify(t,null,2),a=new Blob([s],{type:"application/json"}),r=URL.createObjectURL(a),i=document.createElement("a"),l=new Date().toISOString().replace(/[.:]/g,"-");i.href=r,i.download=`9router-backup-${l}.json`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r),v({type:"success",message:"Database backup downloaded"})}catch(e){v({type:"error",message:e.message||"Failed to export database"})}finally{j(!1)}},D=async e=>{let t=e.target.files?.[0];if(t){j(!0),v({type:"",message:""});try{let e=await t.text(),s=JSON.parse(e),a=await fetch("/api/settings/database",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),r=await a.json().catch(()=>({}));if(!a.ok)throw Error(r.error||"Failed to import database");await z(),v({type:"success",message:"Database imported successfully"})}catch(e){v({type:"error",message:e.message||"Invalid backup file"})}finally{w.current&&(w.current.value=""),j(!1)}}},H=!1!==d.observabilityEnabled;return(0,a.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("div",{className:"size-12 rounded-lg bg-green-500/10 text-green-500 flex items-center justify-center",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-2xl",children:"computer"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold",children:"Local Mode"}),(0,a.jsx)("p",{className:"text-text-muted",children:"Running on your machine"})]})]}),(0,a.jsx)("div",{className:"inline-flex p-1 rounded-lg bg-black/5 dark:bg-white/5",children:["light","dark","system"].map(s=>(0,a.jsxs)("button",{type:"button",onClick:()=>t(s),className:(0,n.cn)("flex items-center gap-1.5 px-3 py-1.5 rounded-md font-medium transition-all",e===s?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"light"===s?"light_mode":"dark"===s?"dark_mode":"contrast"}),(0,a.jsx)("span",{className:"capitalize text-sm",children:s})]},s))})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 pt-4 border-t border-border",children:[(0,a.jsx)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-bg border border-border",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Database Location"}),(0,a.jsx)("p",{className:"text-sm text-text-muted font-mono",children:"~/.9router/db.json"})]})}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(i.$n,{variant:"secondary",icon:"download",onClick:B,loading:f,children:"Download Backup"}),(0,a.jsx)(i.$n,{variant:"outline",icon:"upload",onClick:()=>w.current?.click(),disabled:f,children:"Import Backup"}),(0,a.jsx)("input",{ref:w,type:"file",accept:"application/json,.json",className:"hidden",onChange:D})]}),N.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===N.type?"text-red-500":"text-green-600 dark:text-green-400"}`,children:N.message})]})]}),(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-primary/10 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"shield"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Security"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Require login"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"When ON, dashboard requires password. When OFF, access without login."})]}),(0,a.jsx)(i.lM,{checked:!0===d.requireLogin,onChange:()=>A(!d.requireLogin),disabled:x})]}),!0===d.requireLogin&&(0,a.jsxs)("form",{onSubmit:J,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[d.hasPassword&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Current Password"}),(0,a.jsx)(i.pd,{type:"password",placeholder:"Enter current password",value:u.current,onChange:e=>p({...u,current:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"New Password"}),(0,a.jsx)(i.pd,{type:"password",placeholder:"Enter new password",value:u.new,onChange:e=>p({...u,new:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:"Confirm New Password"}),(0,a.jsx)(i.pd,{type:"password",placeholder:"Confirm new password",value:u.confirm,onChange:e=>p({...u,confirm:e.target.value}),required:!0})]})]}),b.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===b.type?"text-red-500":"text-green-500"}`,children:b.message}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(i.$n,{type:"submit",variant:"primary",loading:y,children:d.hasPassword?"Update Password":"Set Password"})})]})]})]}),(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-blue-500/10 text-blue-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"route"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Routing Strategy"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Round Robin"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Cycle through accounts to distribute load"})]}),(0,a.jsx)(i.lM,{checked:"round-robin"===d.fallbackStrategy,onChange:()=>U("round-robin"===d.fallbackStrategy?"fill-first":"round-robin"),disabled:x})]}),"round-robin"===d.fallbackStrategy&&(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Sticky Limit"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Calls per account before switching"})]}),(0,a.jsx)(i.pd,{type:"number",min:"1",max:"10",value:d.stickyRoundRobinLimit||3,onChange:e=>q(e.target.value),disabled:x,className:"w-20 text-center"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted italic pt-2 border-t border-border/50",children:"round-robin"===d.fallbackStrategy?`Currently distributing requests across all available accounts with ${d.stickyRoundRobinLimit||3} calls per account.`:"Currently using accounts in priority order (Fill First)."})]})]}),(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/10 text-purple-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"wifi"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Network"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Outbound Proxy"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Enable proxy for OAuth + provider outbound requests."})]}),(0,a.jsx)(i.lM,{checked:!0===d.outboundProxyEnabled,onChange:()=>L(!0!==d.outboundProxyEnabled),disabled:x||O})]}),!0===d.outboundProxyEnabled&&(0,a.jsxs)("form",{onSubmit:F,className:"flex flex-col gap-4 pt-2 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"font-medium",children:"Proxy URL"}),(0,a.jsx)(i.pd,{placeholder:"http://127.0.0.1:7897",value:P.outboundProxyUrl,onChange:e=>k(t=>({...t,outboundProxyUrl:e.target.value})),disabled:x||O}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Leave empty to inherit existing env proxy (if any)."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 pt-2 border-t border-border/50",children:[(0,a.jsx)("label",{className:"font-medium",children:"No Proxy"}),(0,a.jsx)(i.pd,{placeholder:"localhost,127.0.0.1",value:P.outboundNoProxy,onChange:e=>k(t=>({...t,outboundNoProxy:e.target.value})),disabled:x||O}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Comma-separated hostnames/domains to bypass the proxy."})]}),(0,a.jsxs)("div",{className:"pt-2 border-t border-border/50 flex items-center gap-2",children:[(0,a.jsx)(i.$n,{type:"button",variant:"secondary",loading:R,disabled:x||O,onClick:M,children:"Test proxy URL"}),(0,a.jsx)(i.$n,{type:"submit",variant:"primary",loading:O,children:"Apply"})]})]}),C.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===C.type?"text-red-500":"text-green-500"} pt-2 border-t border-border/50`,children:C.message})]})]}),(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-orange-500/10 text-orange-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"monitoring"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Observability"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Enable Observability"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Turn request detail recording on/off globally"})]}),(0,a.jsx)(i.lM,{checked:H,onChange:I,disabled:x})]}),(0,a.jsxs)("div",{className:(0,n.cn)("flex flex-col gap-4",!H&&"opacity-60"),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Max Records"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Maximum request detail records to keep (older records are auto-deleted)"})]}),(0,a.jsx)(i.pd,{type:"number",min:"100",max:"10000",step:"100",value:d.observabilityMaxRecords||1e3,onChange:e=>$("observabilityMaxRecords",parseInt(e.target.value)),disabled:x||!H,className:"w-28 text-center"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Batch Size"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Number of items to accumulate before writing to database (higher = better performance)"})]}),(0,a.jsx)(i.pd,{type:"number",min:"5",max:"100",step:"5",value:d.observabilityBatchSize||20,onChange:e=>$("observabilityBatchSize",parseInt(e.target.value)),disabled:x||!H,className:"w-28 text-center"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Flush Interval (ms)"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Maximum time to wait before flushing buffer (prevents data loss during low traffic)"})]}),(0,a.jsx)(i.pd,{type:"number",min:"1000",max:"30000",step:"1000",value:d.observabilityFlushIntervalMs||5e3,onChange:e=>$("observabilityFlushIntervalMs",parseInt(e.target.value)),disabled:x||!H,className:"w-28 text-center"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Max JSON Size (KB)"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Maximum size for each JSON field (request/response) before truncation"})]}),(0,a.jsx)(i.pd,{type:"number",min:"100",max:"10240",step:"100",value:d.observabilityMaxJsonSize||1024,onChange:e=>$("observabilityMaxJsonSize",parseInt(e.target.value)),disabled:x||!H,className:"w-28 text-center"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted italic pt-2 border-t border-border/50",children:["Current: Keeps ",d.observabilityMaxRecords||1e3," records, batches every ",d.observabilityBatchSize||20," requests, max ",d.observabilityMaxJsonSize||1024,"KB per field"]})]})]})]}),(0,a.jsxs)("div",{className:"text-center text-sm text-text-muted py-4",children:[(0,a.jsxs)("p",{children:[o.vQ.name," v",o.vQ.version]}),(0,a.jsx)("p",{className:"mt-1",children:"Local Mode - All data stored on your machine"})]})]})})}},76086:(e,t,s)=>{Promise.resolve().then(s.bind(s,64561))}},e=>{e.O(0,[5370,4335,5772,2032,4495,5497,8441,3794,7358],()=>e(e.s=76086)),_N_E=e.O()}]);