omniroute 2.5.0 → 2.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (580) hide show
  1. package/README.md +17 -0
  2. package/app/.next/BUILD_ID +1 -1
  3. package/app/.next/app-path-routes-manifest.json +50 -49
  4. package/app/.next/build-manifest.json +2 -2
  5. package/app/.next/routes-manifest.json +6 -0
  6. package/app/.next/server/app/(dashboard)/dashboard/a2a/page_client-reference-manifest.js +1 -1
  7. package/app/.next/server/app/(dashboard)/dashboard/agents/page_client-reference-manifest.js +1 -1
  8. package/app/.next/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/api-manager/page_client-reference-manifest.js +1 -1
  10. package/app/.next/server/app/(dashboard)/dashboard/audit-log/page_client-reference-manifest.js +1 -1
  11. package/app/.next/server/app/(dashboard)/dashboard/auto-combo/page_client-reference-manifest.js +1 -1
  12. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  14. package/app/.next/server/app/(dashboard)/dashboard/costs/page_client-reference-manifest.js +1 -1
  15. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
  17. package/app/.next/server/app/(dashboard)/dashboard/limits/page_client-reference-manifest.js +1 -1
  18. package/app/.next/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
  19. package/app/.next/server/app/(dashboard)/dashboard/mcp/page_client-reference-manifest.js +1 -1
  20. package/app/.next/server/app/(dashboard)/dashboard/media/page_client-reference-manifest.js +1 -1
  21. package/app/.next/server/app/(dashboard)/dashboard/onboarding/page_client-reference-manifest.js +1 -1
  22. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  23. package/app/.next/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  24. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  26. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  27. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  29. package/app/.next/server/app/(dashboard)/dashboard/settings/page.js +2 -2
  30. package/app/.next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
  31. package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  32. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  33. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  34. package/app/.next/server/app/.well-known/agent.json/route_client-reference-manifest.js +1 -1
  35. package/app/.next/server/app/400/page_client-reference-manifest.js +1 -1
  36. package/app/.next/server/app/401/page_client-reference-manifest.js +1 -1
  37. package/app/.next/server/app/403/page_client-reference-manifest.js +1 -1
  38. package/app/.next/server/app/408/page_client-reference-manifest.js +1 -1
  39. package/app/.next/server/app/429/page_client-reference-manifest.js +1 -1
  40. package/app/.next/server/app/500/page_client-reference-manifest.js +1 -1
  41. package/app/.next/server/app/502/page_client-reference-manifest.js +1 -1
  42. package/app/.next/server/app/503/page_client-reference-manifest.js +1 -1
  43. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  44. package/app/.next/server/app/_global-error.html +2 -2
  45. package/app/.next/server/app/_global-error.rsc +1 -1
  46. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  47. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  48. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  49. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  50. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  51. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  52. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  53. package/app/.next/server/app/a2a/route_client-reference-manifest.js +1 -1
  54. package/app/.next/server/app/api/a2a/status/route_client-reference-manifest.js +1 -1
  55. package/app/.next/server/app/api/a2a/tasks/[id]/cancel/route_client-reference-manifest.js +1 -1
  56. package/app/.next/server/app/api/a2a/tasks/[id]/route_client-reference-manifest.js +1 -1
  57. package/app/.next/server/app/api/a2a/tasks/route_client-reference-manifest.js +1 -1
  58. package/app/.next/server/app/api/acp/agents/route_client-reference-manifest.js +1 -1
  59. package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  60. package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  61. package/app/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  62. package/app/.next/server/app/api/cache/route_client-reference-manifest.js +1 -1
  63. package/app/.next/server/app/api/cache/stats/route_client-reference-manifest.js +1 -1
  64. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
  65. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
  66. package/app/.next/server/app/api/cli-tools/backups/route_client-reference-manifest.js +1 -1
  67. package/app/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
  68. package/app/.next/server/app/api/cli-tools/cline-settings/route_client-reference-manifest.js +1 -1
  69. package/app/.next/server/app/api/cli-tools/codex-profiles/route_client-reference-manifest.js +1 -1
  70. package/app/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
  71. package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
  72. package/app/.next/server/app/api/cli-tools/guide-settings/[toolId]/route_client-reference-manifest.js +1 -1
  73. package/app/.next/server/app/api/cli-tools/kilo-settings/route_client-reference-manifest.js +1 -1
  74. package/app/.next/server/app/api/cli-tools/openclaw/auto-order/route_client-reference-manifest.js +1 -1
  75. package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
  76. package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route_client-reference-manifest.js +1 -1
  77. package/app/.next/server/app/api/cli-tools/status/route_client-reference-manifest.js +1 -1
  78. package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
  79. package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
  80. package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
  81. package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
  82. package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
  83. package/app/.next/server/app/api/combos/auto/route_client-reference-manifest.js +1 -1
  84. package/app/.next/server/app/api/combos/metrics/route_client-reference-manifest.js +1 -1
  85. package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
  86. package/app/.next/server/app/api/combos/test/route_client-reference-manifest.js +1 -1
  87. package/app/.next/server/app/api/compliance/audit-log/route_client-reference-manifest.js +1 -1
  88. package/app/.next/server/app/api/db-backups/export/route_client-reference-manifest.js +1 -1
  89. package/app/.next/server/app/api/db-backups/exportAll/route_client-reference-manifest.js +1 -1
  90. package/app/.next/server/app/api/db-backups/import/route_client-reference-manifest.js +1 -1
  91. package/app/.next/server/app/api/db-backups/route_client-reference-manifest.js +1 -1
  92. package/app/.next/server/app/api/evals/[suiteId]/route_client-reference-manifest.js +1 -1
  93. package/app/.next/server/app/api/evals/route_client-reference-manifest.js +1 -1
  94. package/app/.next/server/app/api/fallback/chains/route_client-reference-manifest.js +1 -1
  95. package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  96. package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
  97. package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
  98. package/app/.next/server/app/api/logs/console/route_client-reference-manifest.js +1 -1
  99. package/app/.next/server/app/api/mcp/audit/route_client-reference-manifest.js +1 -1
  100. package/app/.next/server/app/api/mcp/audit/stats/route_client-reference-manifest.js +1 -1
  101. package/app/.next/server/app/api/mcp/sse/route_client-reference-manifest.js +1 -1
  102. package/app/.next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
  103. package/app/.next/server/app/api/mcp/stream/route_client-reference-manifest.js +1 -1
  104. package/app/.next/server/app/api/mcp/tools/route_client-reference-manifest.js +1 -1
  105. package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
  106. package/app/.next/server/app/api/models/availability/route_client-reference-manifest.js +1 -1
  107. package/app/.next/server/app/api/models/catalog/route_client-reference-manifest.js +1 -1
  108. package/app/.next/server/app/api/models/openrouter-catalog/route_client-reference-manifest.js +1 -1
  109. package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
  110. package/app/.next/server/app/api/monitoring/health/route_client-reference-manifest.js +1 -1
  111. package/app/.next/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
  112. package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
  113. package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
  114. package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
  115. package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
  116. package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
  117. package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
  118. package/app/.next/server/app/api/policies/route_client-reference-manifest.js +1 -1
  119. package/app/.next/server/app/api/pricing/defaults/route_client-reference-manifest.js +1 -1
  120. package/app/.next/server/app/api/pricing/models/route_client-reference-manifest.js +1 -1
  121. package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
  122. package/app/.next/server/app/api/pricing/sync/route_client-reference-manifest.js +1 -1
  123. package/app/.next/server/app/api/provider-metrics/route_client-reference-manifest.js +1 -1
  124. package/app/.next/server/app/api/provider-models/route_client-reference-manifest.js +1 -1
  125. package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
  126. package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
  127. package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
  128. package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
  129. package/app/.next/server/app/api/providers/[id]/refresh/route_client-reference-manifest.js +1 -1
  130. package/app/.next/server/app/api/providers/[id]/route.js +1 -1
  131. package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
  132. package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
  133. package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
  134. package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
  135. package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
  136. package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
  137. package/app/.next/server/app/api/rate-limit/route_client-reference-manifest.js +1 -1
  138. package/app/.next/server/app/api/rate-limits/route_client-reference-manifest.js +1 -1
  139. package/app/.next/server/app/api/resilience/reset/route_client-reference-manifest.js +1 -1
  140. package/app/.next/server/app/api/resilience/route_client-reference-manifest.js +1 -1
  141. package/app/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
  142. package/app/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
  143. package/app/.next/server/app/api/settings/background-degradation/route_client-reference-manifest.js +1 -1
  144. package/app/.next/server/app/api/settings/codex-service-tier/route.js +1 -0
  145. package/app/.next/server/app/api/settings/codex-service-tier/route.js.nft.json +1 -0
  146. package/app/.next/server/app/api/settings/codex-service-tier/route_client-reference-manifest.js +1 -0
  147. package/app/.next/server/app/api/settings/combo-defaults/route_client-reference-manifest.js +1 -1
  148. package/app/.next/server/app/api/settings/ip-filter/route_client-reference-manifest.js +1 -1
  149. package/app/.next/server/app/api/settings/model-aliases/route_client-reference-manifest.js +1 -1
  150. package/app/.next/server/app/api/settings/proxy/route_client-reference-manifest.js +1 -1
  151. package/app/.next/server/app/api/settings/proxy/test/route_client-reference-manifest.js +1 -1
  152. package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
  153. package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  154. package/app/.next/server/app/api/settings/system-prompt/route_client-reference-manifest.js +1 -1
  155. package/app/.next/server/app/api/settings/task-routing/route_client-reference-manifest.js +1 -1
  156. package/app/.next/server/app/api/settings/thinking-budget/route_client-reference-manifest.js +1 -1
  157. package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  158. package/app/.next/server/app/api/storage/health/route_client-reference-manifest.js +1 -1
  159. package/app/.next/server/app/api/sync/cloud/route_client-reference-manifest.js +1 -1
  160. package/app/.next/server/app/api/sync/initialize/route_client-reference-manifest.js +1 -1
  161. package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
  162. package/app/.next/server/app/api/telemetry/summary/route_client-reference-manifest.js +1 -1
  163. package/app/.next/server/app/api/token-health/route_client-reference-manifest.js +1 -1
  164. package/app/.next/server/app/api/translator/detect/route_client-reference-manifest.js +1 -1
  165. package/app/.next/server/app/api/translator/history/route_client-reference-manifest.js +1 -1
  166. package/app/.next/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
  167. package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
  168. package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
  169. package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
  170. package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  171. package/app/.next/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  172. package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
  173. package/app/.next/server/app/api/usage/analytics/route_client-reference-manifest.js +1 -1
  174. package/app/.next/server/app/api/usage/budget/route_client-reference-manifest.js +1 -1
  175. package/app/.next/server/app/api/usage/call-logs/[id]/route_client-reference-manifest.js +1 -1
  176. package/app/.next/server/app/api/usage/call-logs/route_client-reference-manifest.js +1 -1
  177. package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
  178. package/app/.next/server/app/api/usage/logs/route_client-reference-manifest.js +1 -1
  179. package/app/.next/server/app/api/usage/proxy-logs/route_client-reference-manifest.js +1 -1
  180. package/app/.next/server/app/api/usage/quota/route_client-reference-manifest.js +1 -1
  181. package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
  182. package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
  183. package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  184. package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
  185. package/app/.next/server/app/api/v1/audio/speech/route_client-reference-manifest.js +1 -1
  186. package/app/.next/server/app/api/v1/audio/transcriptions/route_client-reference-manifest.js +1 -1
  187. package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
  188. package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  189. package/app/.next/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
  190. package/app/.next/server/app/api/v1/completions/route.js +1 -1
  191. package/app/.next/server/app/api/v1/completions/route.js.nft.json +1 -1
  192. package/app/.next/server/app/api/v1/completions/route_client-reference-manifest.js +1 -1
  193. package/app/.next/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
  194. package/app/.next/server/app/api/v1/images/generations/route_client-reference-manifest.js +1 -1
  195. package/app/.next/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
  196. package/app/.next/server/app/api/v1/messages/route.js +1 -1
  197. package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
  198. package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
  199. package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
  200. package/app/.next/server/app/api/v1/moderations/route_client-reference-manifest.js +1 -1
  201. package/app/.next/server/app/api/v1/music/generations/route_client-reference-manifest.js +1 -1
  202. package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js +1 -1
  203. package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route.js.nft.json +1 -1
  204. package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route_client-reference-manifest.js +1 -1
  205. package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route_client-reference-manifest.js +1 -1
  206. package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route_client-reference-manifest.js +1 -1
  207. package/app/.next/server/app/api/v1/rerank/route_client-reference-manifest.js +1 -1
  208. package/app/.next/server/app/api/v1/responses/route.js +1 -1
  209. package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
  210. package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
  211. package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
  212. package/app/.next/server/app/api/v1/videos/generations/route_client-reference-manifest.js +1 -1
  213. package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
  214. package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  215. package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
  216. package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
  217. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  218. package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  219. package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -1
  220. package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -1
  221. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  222. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  223. package/app/.next/server/app/maintenance/page_client-reference-manifest.js +1 -1
  224. package/app/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  225. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  226. package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
  227. package/app/.next/server/app/status/page_client-reference-manifest.js +1 -1
  228. package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
  229. package/app/.next/server/app-paths-manifest.json +50 -49
  230. package/app/.next/server/chunks/1909.js +1 -1
  231. package/app/.next/server/chunks/{7535.js → 2433.js} +2 -2
  232. package/app/.next/server/chunks/3596.js +1 -1
  233. package/app/.next/server/chunks/3831.js +117 -0
  234. package/app/.next/server/chunks/4335.js +1 -0
  235. package/app/.next/server/chunks/4935.js +1 -1
  236. package/app/.next/server/chunks/5807.js +1 -0
  237. package/app/.next/server/chunks/5979.js +1 -1
  238. package/app/.next/server/chunks/6094.js +1 -1
  239. package/app/.next/server/chunks/7327.js +1 -1
  240. package/app/.next/server/chunks/7544.js +2 -118
  241. package/app/.next/server/chunks/8907.js +1 -1
  242. package/app/.next/server/chunks/9631.js +1 -1
  243. package/app/.next/server/instrumentation.js +1 -1
  244. package/app/.next/server/middleware.js +1 -1
  245. package/app/.next/server/pages/500.html +2 -2
  246. package/app/.next/server/server-reference-manifest.js +1 -1
  247. package/app/.next/server/server-reference-manifest.json +1 -1
  248. package/app/.next/static/3s5SDPHTqXdRuXH0NTawz/_buildManifest.js +1 -0
  249. package/app/.next/static/chunks/5846-5e09930da5f637df.js +2 -0
  250. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-ded42d031c158dd8.js +1 -0
  251. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-c311c2074730a9d4.js +1 -0
  252. package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/page-df62bcc49944269c.js +1 -0
  253. package/app/.next/static/chunks/app/.well-known/agent.json/route-ded42d031c158dd8.js +1 -0
  254. package/app/.next/static/chunks/app/400/layout-ded42d031c158dd8.js +1 -0
  255. package/app/.next/static/chunks/app/401/layout-ded42d031c158dd8.js +1 -0
  256. package/app/.next/static/chunks/app/403/layout-ded42d031c158dd8.js +1 -0
  257. package/app/.next/static/chunks/app/408/layout-ded42d031c158dd8.js +1 -0
  258. package/app/.next/static/chunks/app/429/layout-ded42d031c158dd8.js +1 -0
  259. package/app/.next/static/chunks/app/500/layout-ded42d031c158dd8.js +1 -0
  260. package/app/.next/static/chunks/app/502/layout-ded42d031c158dd8.js +1 -0
  261. package/app/.next/static/chunks/app/503/layout-ded42d031c158dd8.js +1 -0
  262. package/app/.next/static/chunks/app/_global-error/page-ded42d031c158dd8.js +1 -0
  263. package/app/.next/static/chunks/app/_not-found/page-ded42d031c158dd8.js +1 -0
  264. package/app/.next/static/chunks/app/a2a/route-ded42d031c158dd8.js +1 -0
  265. package/app/.next/static/chunks/app/api/a2a/status/route-ded42d031c158dd8.js +1 -0
  266. package/app/.next/static/chunks/app/api/a2a/tasks/[id]/cancel/route-ded42d031c158dd8.js +1 -0
  267. package/app/.next/static/chunks/app/api/a2a/tasks/[id]/route-ded42d031c158dd8.js +1 -0
  268. package/app/.next/static/chunks/app/api/a2a/tasks/route-ded42d031c158dd8.js +1 -0
  269. package/app/.next/static/chunks/app/api/acp/agents/route-ded42d031c158dd8.js +1 -0
  270. package/app/.next/static/chunks/app/api/auth/login/route-ded42d031c158dd8.js +1 -0
  271. package/app/.next/static/chunks/app/api/auth/logout/route-ded42d031c158dd8.js +1 -0
  272. package/app/.next/static/chunks/app/api/auth/status/route-ded42d031c158dd8.js +1 -0
  273. package/app/.next/static/chunks/app/api/cache/route-ded42d031c158dd8.js +1 -0
  274. package/app/.next/static/chunks/app/api/cache/stats/route-ded42d031c158dd8.js +1 -0
  275. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-ded42d031c158dd8.js +1 -0
  276. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-ded42d031c158dd8.js +1 -0
  277. package/app/.next/static/chunks/app/api/cli-tools/backups/route-ded42d031c158dd8.js +1 -0
  278. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-ded42d031c158dd8.js +1 -0
  279. package/app/.next/static/chunks/app/api/cli-tools/cline-settings/route-ded42d031c158dd8.js +1 -0
  280. package/app/.next/static/chunks/app/api/cli-tools/codex-profiles/route-ded42d031c158dd8.js +1 -0
  281. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-ded42d031c158dd8.js +1 -0
  282. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-ded42d031c158dd8.js +1 -0
  283. package/app/.next/static/chunks/app/api/cli-tools/guide-settings/[toolId]/route-ded42d031c158dd8.js +1 -0
  284. package/app/.next/static/chunks/app/api/cli-tools/kilo-settings/route-ded42d031c158dd8.js +1 -0
  285. package/app/.next/static/chunks/app/api/cli-tools/openclaw/auto-order/route-ded42d031c158dd8.js +1 -0
  286. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-ded42d031c158dd8.js +1 -0
  287. package/app/.next/static/chunks/app/api/cli-tools/runtime/[toolId]/route-ded42d031c158dd8.js +1 -0
  288. package/app/.next/static/chunks/app/api/cli-tools/status/route-ded42d031c158dd8.js +1 -0
  289. package/app/.next/static/chunks/app/api/cloud/auth/route-ded42d031c158dd8.js +1 -0
  290. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-ded42d031c158dd8.js +1 -0
  291. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-ded42d031c158dd8.js +1 -0
  292. package/app/.next/static/chunks/app/api/cloud/models/alias/route-ded42d031c158dd8.js +1 -0
  293. package/app/.next/static/chunks/app/api/combos/[id]/route-ded42d031c158dd8.js +1 -0
  294. package/app/.next/static/chunks/app/api/combos/auto/route-ded42d031c158dd8.js +1 -0
  295. package/app/.next/static/chunks/app/api/combos/metrics/route-ded42d031c158dd8.js +1 -0
  296. package/app/.next/static/chunks/app/api/combos/route-ded42d031c158dd8.js +1 -0
  297. package/app/.next/static/chunks/app/api/combos/test/route-ded42d031c158dd8.js +1 -0
  298. package/app/.next/static/chunks/app/api/compliance/audit-log/route-ded42d031c158dd8.js +1 -0
  299. package/app/.next/static/chunks/app/api/db-backups/export/route-ded42d031c158dd8.js +1 -0
  300. package/app/.next/static/chunks/app/api/db-backups/exportAll/route-ded42d031c158dd8.js +1 -0
  301. package/app/.next/static/chunks/app/api/db-backups/import/route-ded42d031c158dd8.js +1 -0
  302. package/app/.next/static/chunks/app/api/db-backups/route-ded42d031c158dd8.js +1 -0
  303. package/app/.next/static/chunks/app/api/evals/[suiteId]/route-ded42d031c158dd8.js +1 -0
  304. package/app/.next/static/chunks/app/api/evals/route-ded42d031c158dd8.js +1 -0
  305. package/app/.next/static/chunks/app/api/fallback/chains/route-ded42d031c158dd8.js +1 -0
  306. package/app/.next/static/chunks/app/api/init/route-ded42d031c158dd8.js +1 -0
  307. package/app/.next/static/chunks/app/api/keys/[id]/route-ded42d031c158dd8.js +1 -0
  308. package/app/.next/static/chunks/app/api/keys/route-ded42d031c158dd8.js +1 -0
  309. package/app/.next/static/chunks/app/api/logs/console/route-ded42d031c158dd8.js +1 -0
  310. package/app/.next/static/chunks/app/api/mcp/audit/route-ded42d031c158dd8.js +1 -0
  311. package/app/.next/static/chunks/app/api/mcp/audit/stats/route-ded42d031c158dd8.js +1 -0
  312. package/app/.next/static/chunks/app/api/mcp/sse/route-ded42d031c158dd8.js +1 -0
  313. package/app/.next/static/chunks/app/api/mcp/status/route-ded42d031c158dd8.js +1 -0
  314. package/app/.next/static/chunks/app/api/mcp/stream/route-ded42d031c158dd8.js +1 -0
  315. package/app/.next/static/chunks/app/api/mcp/tools/route-ded42d031c158dd8.js +1 -0
  316. package/app/.next/static/chunks/app/api/models/alias/route-ded42d031c158dd8.js +1 -0
  317. package/app/.next/static/chunks/app/api/models/availability/route-ded42d031c158dd8.js +1 -0
  318. package/app/.next/static/chunks/app/api/models/catalog/route-ded42d031c158dd8.js +1 -0
  319. package/app/.next/static/chunks/app/api/models/openrouter-catalog/route-ded42d031c158dd8.js +1 -0
  320. package/app/.next/static/chunks/app/api/models/route-ded42d031c158dd8.js +1 -0
  321. package/app/.next/static/chunks/app/api/monitoring/health/route-ded42d031c158dd8.js +1 -0
  322. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-ded42d031c158dd8.js +1 -0
  323. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-ded42d031c158dd8.js +1 -0
  324. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-ded42d031c158dd8.js +1 -0
  325. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-ded42d031c158dd8.js +1 -0
  326. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-ded42d031c158dd8.js +1 -0
  327. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-ded42d031c158dd8.js +1 -0
  328. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-ded42d031c158dd8.js +1 -0
  329. package/app/.next/static/chunks/app/api/policies/route-ded42d031c158dd8.js +1 -0
  330. package/app/.next/static/chunks/app/api/pricing/defaults/route-ded42d031c158dd8.js +1 -0
  331. package/app/.next/static/chunks/app/api/pricing/models/route-ded42d031c158dd8.js +1 -0
  332. package/app/.next/static/chunks/app/api/pricing/route-ded42d031c158dd8.js +1 -0
  333. package/app/.next/static/chunks/app/api/pricing/sync/route-ded42d031c158dd8.js +1 -0
  334. package/app/.next/static/chunks/app/api/provider-metrics/route-ded42d031c158dd8.js +1 -0
  335. package/app/.next/static/chunks/app/api/provider-models/route-ded42d031c158dd8.js +1 -0
  336. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-ded42d031c158dd8.js +1 -0
  337. package/app/.next/static/chunks/app/api/provider-nodes/route-ded42d031c158dd8.js +1 -0
  338. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-ded42d031c158dd8.js +1 -0
  339. package/app/.next/static/chunks/app/api/providers/[id]/models/route-ded42d031c158dd8.js +1 -0
  340. package/app/.next/static/chunks/app/api/providers/[id]/refresh/route-ded42d031c158dd8.js +1 -0
  341. package/app/.next/static/chunks/app/api/providers/[id]/route-ded42d031c158dd8.js +1 -0
  342. package/app/.next/static/chunks/app/api/providers/[id]/test/route-ded42d031c158dd8.js +1 -0
  343. package/app/.next/static/chunks/app/api/providers/client/route-ded42d031c158dd8.js +1 -0
  344. package/app/.next/static/chunks/app/api/providers/route-ded42d031c158dd8.js +1 -0
  345. package/app/.next/static/chunks/app/api/providers/test-batch/route-ded42d031c158dd8.js +1 -0
  346. package/app/.next/static/chunks/app/api/providers/validate/route-ded42d031c158dd8.js +1 -0
  347. package/app/.next/static/chunks/app/api/rate-limit/route-ded42d031c158dd8.js +1 -0
  348. package/app/.next/static/chunks/app/api/rate-limits/route-ded42d031c158dd8.js +1 -0
  349. package/app/.next/static/chunks/app/api/resilience/reset/route-ded42d031c158dd8.js +1 -0
  350. package/app/.next/static/chunks/app/api/resilience/route-ded42d031c158dd8.js +1 -0
  351. package/app/.next/static/chunks/app/api/restart/route-ded42d031c158dd8.js +1 -0
  352. package/app/.next/static/chunks/app/api/sessions/route-ded42d031c158dd8.js +1 -0
  353. package/app/.next/static/chunks/app/api/settings/background-degradation/route-ded42d031c158dd8.js +1 -0
  354. package/app/.next/static/chunks/app/api/settings/codex-service-tier/route-ded42d031c158dd8.js +1 -0
  355. package/app/.next/static/chunks/app/api/settings/combo-defaults/route-ded42d031c158dd8.js +1 -0
  356. package/app/.next/static/chunks/app/api/settings/ip-filter/route-ded42d031c158dd8.js +1 -0
  357. package/app/.next/static/chunks/app/api/settings/model-aliases/route-ded42d031c158dd8.js +1 -0
  358. package/app/.next/static/chunks/app/api/settings/proxy/route-ded42d031c158dd8.js +1 -0
  359. package/app/.next/static/chunks/app/api/settings/proxy/test/route-ded42d031c158dd8.js +1 -0
  360. package/app/.next/static/chunks/app/api/settings/require-login/route-ded42d031c158dd8.js +1 -0
  361. package/app/.next/static/chunks/app/api/settings/route-ded42d031c158dd8.js +1 -0
  362. package/app/.next/static/chunks/app/api/settings/system-prompt/route-ded42d031c158dd8.js +1 -0
  363. package/app/.next/static/chunks/app/api/settings/task-routing/route-ded42d031c158dd8.js +1 -0
  364. package/app/.next/static/chunks/app/api/settings/thinking-budget/route-ded42d031c158dd8.js +1 -0
  365. package/app/.next/static/chunks/app/api/shutdown/route-ded42d031c158dd8.js +1 -0
  366. package/app/.next/static/chunks/app/api/storage/health/route-ded42d031c158dd8.js +1 -0
  367. package/app/.next/static/chunks/app/api/sync/cloud/route-ded42d031c158dd8.js +1 -0
  368. package/app/.next/static/chunks/app/api/sync/initialize/route-ded42d031c158dd8.js +1 -0
  369. package/app/.next/static/chunks/app/api/tags/route-ded42d031c158dd8.js +1 -0
  370. package/app/.next/static/chunks/app/api/telemetry/summary/route-ded42d031c158dd8.js +1 -0
  371. package/app/.next/static/chunks/app/api/token-health/route-ded42d031c158dd8.js +1 -0
  372. package/app/.next/static/chunks/app/api/translator/detect/route-ded42d031c158dd8.js +1 -0
  373. package/app/.next/static/chunks/app/api/translator/history/route-ded42d031c158dd8.js +1 -0
  374. package/app/.next/static/chunks/app/api/translator/load/route-ded42d031c158dd8.js +1 -0
  375. package/app/.next/static/chunks/app/api/translator/save/route-ded42d031c158dd8.js +1 -0
  376. package/app/.next/static/chunks/app/api/translator/send/route-ded42d031c158dd8.js +1 -0
  377. package/app/.next/static/chunks/app/api/translator/translate/route-ded42d031c158dd8.js +1 -0
  378. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-ded42d031c158dd8.js +1 -0
  379. package/app/.next/static/chunks/app/api/usage/analytics/route-ded42d031c158dd8.js +1 -0
  380. package/app/.next/static/chunks/app/api/usage/budget/route-ded42d031c158dd8.js +1 -0
  381. package/app/.next/static/chunks/app/api/usage/call-logs/[id]/route-ded42d031c158dd8.js +1 -0
  382. package/app/.next/static/chunks/app/api/usage/call-logs/route-ded42d031c158dd8.js +1 -0
  383. package/app/.next/static/chunks/app/api/usage/history/route-ded42d031c158dd8.js +1 -0
  384. package/app/.next/static/chunks/app/api/usage/logs/route-ded42d031c158dd8.js +1 -0
  385. package/app/.next/static/chunks/app/api/usage/proxy-logs/route-ded42d031c158dd8.js +1 -0
  386. package/app/.next/static/chunks/app/api/usage/quota/route-ded42d031c158dd8.js +1 -0
  387. package/app/.next/static/chunks/app/api/usage/request-logs/route-ded42d031c158dd8.js +1 -0
  388. package/app/.next/static/chunks/app/api/v1/api/chat/route-ded42d031c158dd8.js +1 -0
  389. package/app/.next/static/chunks/app/api/v1/audio/speech/route-ded42d031c158dd8.js +1 -0
  390. package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-ded42d031c158dd8.js +1 -0
  391. package/app/.next/static/chunks/app/api/v1/chat/completions/route-ded42d031c158dd8.js +1 -0
  392. package/app/.next/static/chunks/app/api/v1/completions/route-ded42d031c158dd8.js +1 -0
  393. package/app/.next/static/chunks/app/api/v1/embeddings/route-ded42d031c158dd8.js +1 -0
  394. package/app/.next/static/chunks/app/api/v1/images/generations/route-ded42d031c158dd8.js +1 -0
  395. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-ded42d031c158dd8.js +1 -0
  396. package/app/.next/static/chunks/app/api/v1/messages/route-ded42d031c158dd8.js +1 -0
  397. package/app/.next/static/chunks/app/api/v1/models/route-ded42d031c158dd8.js +1 -0
  398. package/app/.next/static/chunks/app/api/v1/moderations/route-ded42d031c158dd8.js +1 -0
  399. package/app/.next/static/chunks/app/api/v1/music/generations/route-ded42d031c158dd8.js +1 -0
  400. package/app/.next/static/chunks/app/api/v1/providers/[provider]/chat/completions/route-ded42d031c158dd8.js +1 -0
  401. package/app/.next/static/chunks/app/api/v1/providers/[provider]/embeddings/route-ded42d031c158dd8.js +1 -0
  402. package/app/.next/static/chunks/app/api/v1/providers/[provider]/images/generations/route-ded42d031c158dd8.js +1 -0
  403. package/app/.next/static/chunks/app/api/v1/rerank/route-ded42d031c158dd8.js +1 -0
  404. package/app/.next/static/chunks/app/api/v1/responses/route-ded42d031c158dd8.js +1 -0
  405. package/app/.next/static/chunks/app/api/v1/route-ded42d031c158dd8.js +1 -0
  406. package/app/.next/static/chunks/app/api/v1/videos/generations/route-ded42d031c158dd8.js +1 -0
  407. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-ded42d031c158dd8.js +1 -0
  408. package/app/.next/static/chunks/app/api/v1beta/models/route-ded42d031c158dd8.js +1 -0
  409. package/app/.next/static/chunks/app/page-ded42d031c158dd8.js +1 -0
  410. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-ded42d031c158dd8.js +1 -0
  411. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-ded42d031c158dd8.js +1 -0
  412. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-ded42d031c158dd8.js +1 -0
  413. package/app/.next/static/css/{b02e1066800fe4d6.css → 14ede48bbc2cd561.css} +1 -1
  414. package/app/package.json +1 -1
  415. package/package.json +1 -1
  416. package/app/.next/static/M35Z_Bh-lQ1uO7hB_-bVc/_buildManifest.js +0 -1
  417. package/app/.next/static/chunks/5846-f92dd844022ac1b0.js +0 -2
  418. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-1787cfdb0a81cffb.js +0 -1
  419. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-f9cc44c947796a9e.js +0 -1
  420. package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/page-cbaa4b638a583fe9.js +0 -1
  421. package/app/.next/static/chunks/app/.well-known/agent.json/route-1787cfdb0a81cffb.js +0 -1
  422. package/app/.next/static/chunks/app/400/layout-1787cfdb0a81cffb.js +0 -1
  423. package/app/.next/static/chunks/app/401/layout-1787cfdb0a81cffb.js +0 -1
  424. package/app/.next/static/chunks/app/403/layout-1787cfdb0a81cffb.js +0 -1
  425. package/app/.next/static/chunks/app/408/layout-1787cfdb0a81cffb.js +0 -1
  426. package/app/.next/static/chunks/app/429/layout-1787cfdb0a81cffb.js +0 -1
  427. package/app/.next/static/chunks/app/500/layout-1787cfdb0a81cffb.js +0 -1
  428. package/app/.next/static/chunks/app/502/layout-1787cfdb0a81cffb.js +0 -1
  429. package/app/.next/static/chunks/app/503/layout-1787cfdb0a81cffb.js +0 -1
  430. package/app/.next/static/chunks/app/_global-error/page-1787cfdb0a81cffb.js +0 -1
  431. package/app/.next/static/chunks/app/_not-found/page-1787cfdb0a81cffb.js +0 -1
  432. package/app/.next/static/chunks/app/a2a/route-1787cfdb0a81cffb.js +0 -1
  433. package/app/.next/static/chunks/app/api/a2a/status/route-1787cfdb0a81cffb.js +0 -1
  434. package/app/.next/static/chunks/app/api/a2a/tasks/[id]/cancel/route-1787cfdb0a81cffb.js +0 -1
  435. package/app/.next/static/chunks/app/api/a2a/tasks/[id]/route-1787cfdb0a81cffb.js +0 -1
  436. package/app/.next/static/chunks/app/api/a2a/tasks/route-1787cfdb0a81cffb.js +0 -1
  437. package/app/.next/static/chunks/app/api/acp/agents/route-1787cfdb0a81cffb.js +0 -1
  438. package/app/.next/static/chunks/app/api/auth/login/route-1787cfdb0a81cffb.js +0 -1
  439. package/app/.next/static/chunks/app/api/auth/logout/route-1787cfdb0a81cffb.js +0 -1
  440. package/app/.next/static/chunks/app/api/auth/status/route-1787cfdb0a81cffb.js +0 -1
  441. package/app/.next/static/chunks/app/api/cache/route-1787cfdb0a81cffb.js +0 -1
  442. package/app/.next/static/chunks/app/api/cache/stats/route-1787cfdb0a81cffb.js +0 -1
  443. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-1787cfdb0a81cffb.js +0 -1
  444. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-1787cfdb0a81cffb.js +0 -1
  445. package/app/.next/static/chunks/app/api/cli-tools/backups/route-1787cfdb0a81cffb.js +0 -1
  446. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-1787cfdb0a81cffb.js +0 -1
  447. package/app/.next/static/chunks/app/api/cli-tools/cline-settings/route-1787cfdb0a81cffb.js +0 -1
  448. package/app/.next/static/chunks/app/api/cli-tools/codex-profiles/route-1787cfdb0a81cffb.js +0 -1
  449. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-1787cfdb0a81cffb.js +0 -1
  450. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-1787cfdb0a81cffb.js +0 -1
  451. package/app/.next/static/chunks/app/api/cli-tools/guide-settings/[toolId]/route-1787cfdb0a81cffb.js +0 -1
  452. package/app/.next/static/chunks/app/api/cli-tools/kilo-settings/route-1787cfdb0a81cffb.js +0 -1
  453. package/app/.next/static/chunks/app/api/cli-tools/openclaw/auto-order/route-1787cfdb0a81cffb.js +0 -1
  454. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-1787cfdb0a81cffb.js +0 -1
  455. package/app/.next/static/chunks/app/api/cli-tools/runtime/[toolId]/route-1787cfdb0a81cffb.js +0 -1
  456. package/app/.next/static/chunks/app/api/cli-tools/status/route-1787cfdb0a81cffb.js +0 -1
  457. package/app/.next/static/chunks/app/api/cloud/auth/route-1787cfdb0a81cffb.js +0 -1
  458. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-1787cfdb0a81cffb.js +0 -1
  459. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-1787cfdb0a81cffb.js +0 -1
  460. package/app/.next/static/chunks/app/api/cloud/models/alias/route-1787cfdb0a81cffb.js +0 -1
  461. package/app/.next/static/chunks/app/api/combos/[id]/route-1787cfdb0a81cffb.js +0 -1
  462. package/app/.next/static/chunks/app/api/combos/auto/route-1787cfdb0a81cffb.js +0 -1
  463. package/app/.next/static/chunks/app/api/combos/metrics/route-1787cfdb0a81cffb.js +0 -1
  464. package/app/.next/static/chunks/app/api/combos/route-1787cfdb0a81cffb.js +0 -1
  465. package/app/.next/static/chunks/app/api/combos/test/route-1787cfdb0a81cffb.js +0 -1
  466. package/app/.next/static/chunks/app/api/compliance/audit-log/route-1787cfdb0a81cffb.js +0 -1
  467. package/app/.next/static/chunks/app/api/db-backups/export/route-1787cfdb0a81cffb.js +0 -1
  468. package/app/.next/static/chunks/app/api/db-backups/exportAll/route-1787cfdb0a81cffb.js +0 -1
  469. package/app/.next/static/chunks/app/api/db-backups/import/route-1787cfdb0a81cffb.js +0 -1
  470. package/app/.next/static/chunks/app/api/db-backups/route-1787cfdb0a81cffb.js +0 -1
  471. package/app/.next/static/chunks/app/api/evals/[suiteId]/route-1787cfdb0a81cffb.js +0 -1
  472. package/app/.next/static/chunks/app/api/evals/route-1787cfdb0a81cffb.js +0 -1
  473. package/app/.next/static/chunks/app/api/fallback/chains/route-1787cfdb0a81cffb.js +0 -1
  474. package/app/.next/static/chunks/app/api/init/route-1787cfdb0a81cffb.js +0 -1
  475. package/app/.next/static/chunks/app/api/keys/[id]/route-1787cfdb0a81cffb.js +0 -1
  476. package/app/.next/static/chunks/app/api/keys/route-1787cfdb0a81cffb.js +0 -1
  477. package/app/.next/static/chunks/app/api/logs/console/route-1787cfdb0a81cffb.js +0 -1
  478. package/app/.next/static/chunks/app/api/mcp/audit/route-1787cfdb0a81cffb.js +0 -1
  479. package/app/.next/static/chunks/app/api/mcp/audit/stats/route-1787cfdb0a81cffb.js +0 -1
  480. package/app/.next/static/chunks/app/api/mcp/sse/route-1787cfdb0a81cffb.js +0 -1
  481. package/app/.next/static/chunks/app/api/mcp/status/route-1787cfdb0a81cffb.js +0 -1
  482. package/app/.next/static/chunks/app/api/mcp/stream/route-1787cfdb0a81cffb.js +0 -1
  483. package/app/.next/static/chunks/app/api/mcp/tools/route-1787cfdb0a81cffb.js +0 -1
  484. package/app/.next/static/chunks/app/api/models/alias/route-1787cfdb0a81cffb.js +0 -1
  485. package/app/.next/static/chunks/app/api/models/availability/route-1787cfdb0a81cffb.js +0 -1
  486. package/app/.next/static/chunks/app/api/models/catalog/route-1787cfdb0a81cffb.js +0 -1
  487. package/app/.next/static/chunks/app/api/models/openrouter-catalog/route-1787cfdb0a81cffb.js +0 -1
  488. package/app/.next/static/chunks/app/api/models/route-1787cfdb0a81cffb.js +0 -1
  489. package/app/.next/static/chunks/app/api/monitoring/health/route-1787cfdb0a81cffb.js +0 -1
  490. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-1787cfdb0a81cffb.js +0 -1
  491. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-1787cfdb0a81cffb.js +0 -1
  492. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-1787cfdb0a81cffb.js +0 -1
  493. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-1787cfdb0a81cffb.js +0 -1
  494. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-1787cfdb0a81cffb.js +0 -1
  495. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-1787cfdb0a81cffb.js +0 -1
  496. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-1787cfdb0a81cffb.js +0 -1
  497. package/app/.next/static/chunks/app/api/policies/route-1787cfdb0a81cffb.js +0 -1
  498. package/app/.next/static/chunks/app/api/pricing/defaults/route-1787cfdb0a81cffb.js +0 -1
  499. package/app/.next/static/chunks/app/api/pricing/models/route-1787cfdb0a81cffb.js +0 -1
  500. package/app/.next/static/chunks/app/api/pricing/route-1787cfdb0a81cffb.js +0 -1
  501. package/app/.next/static/chunks/app/api/pricing/sync/route-1787cfdb0a81cffb.js +0 -1
  502. package/app/.next/static/chunks/app/api/provider-metrics/route-1787cfdb0a81cffb.js +0 -1
  503. package/app/.next/static/chunks/app/api/provider-models/route-1787cfdb0a81cffb.js +0 -1
  504. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-1787cfdb0a81cffb.js +0 -1
  505. package/app/.next/static/chunks/app/api/provider-nodes/route-1787cfdb0a81cffb.js +0 -1
  506. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-1787cfdb0a81cffb.js +0 -1
  507. package/app/.next/static/chunks/app/api/providers/[id]/models/route-1787cfdb0a81cffb.js +0 -1
  508. package/app/.next/static/chunks/app/api/providers/[id]/refresh/route-1787cfdb0a81cffb.js +0 -1
  509. package/app/.next/static/chunks/app/api/providers/[id]/route-1787cfdb0a81cffb.js +0 -1
  510. package/app/.next/static/chunks/app/api/providers/[id]/test/route-1787cfdb0a81cffb.js +0 -1
  511. package/app/.next/static/chunks/app/api/providers/client/route-1787cfdb0a81cffb.js +0 -1
  512. package/app/.next/static/chunks/app/api/providers/route-1787cfdb0a81cffb.js +0 -1
  513. package/app/.next/static/chunks/app/api/providers/test-batch/route-1787cfdb0a81cffb.js +0 -1
  514. package/app/.next/static/chunks/app/api/providers/validate/route-1787cfdb0a81cffb.js +0 -1
  515. package/app/.next/static/chunks/app/api/rate-limit/route-1787cfdb0a81cffb.js +0 -1
  516. package/app/.next/static/chunks/app/api/rate-limits/route-1787cfdb0a81cffb.js +0 -1
  517. package/app/.next/static/chunks/app/api/resilience/reset/route-1787cfdb0a81cffb.js +0 -1
  518. package/app/.next/static/chunks/app/api/resilience/route-1787cfdb0a81cffb.js +0 -1
  519. package/app/.next/static/chunks/app/api/restart/route-1787cfdb0a81cffb.js +0 -1
  520. package/app/.next/static/chunks/app/api/sessions/route-1787cfdb0a81cffb.js +0 -1
  521. package/app/.next/static/chunks/app/api/settings/background-degradation/route-1787cfdb0a81cffb.js +0 -1
  522. package/app/.next/static/chunks/app/api/settings/combo-defaults/route-1787cfdb0a81cffb.js +0 -1
  523. package/app/.next/static/chunks/app/api/settings/ip-filter/route-1787cfdb0a81cffb.js +0 -1
  524. package/app/.next/static/chunks/app/api/settings/model-aliases/route-1787cfdb0a81cffb.js +0 -1
  525. package/app/.next/static/chunks/app/api/settings/proxy/route-1787cfdb0a81cffb.js +0 -1
  526. package/app/.next/static/chunks/app/api/settings/proxy/test/route-1787cfdb0a81cffb.js +0 -1
  527. package/app/.next/static/chunks/app/api/settings/require-login/route-1787cfdb0a81cffb.js +0 -1
  528. package/app/.next/static/chunks/app/api/settings/route-1787cfdb0a81cffb.js +0 -1
  529. package/app/.next/static/chunks/app/api/settings/system-prompt/route-1787cfdb0a81cffb.js +0 -1
  530. package/app/.next/static/chunks/app/api/settings/task-routing/route-1787cfdb0a81cffb.js +0 -1
  531. package/app/.next/static/chunks/app/api/settings/thinking-budget/route-1787cfdb0a81cffb.js +0 -1
  532. package/app/.next/static/chunks/app/api/shutdown/route-1787cfdb0a81cffb.js +0 -1
  533. package/app/.next/static/chunks/app/api/storage/health/route-1787cfdb0a81cffb.js +0 -1
  534. package/app/.next/static/chunks/app/api/sync/cloud/route-1787cfdb0a81cffb.js +0 -1
  535. package/app/.next/static/chunks/app/api/sync/initialize/route-1787cfdb0a81cffb.js +0 -1
  536. package/app/.next/static/chunks/app/api/tags/route-1787cfdb0a81cffb.js +0 -1
  537. package/app/.next/static/chunks/app/api/telemetry/summary/route-1787cfdb0a81cffb.js +0 -1
  538. package/app/.next/static/chunks/app/api/token-health/route-1787cfdb0a81cffb.js +0 -1
  539. package/app/.next/static/chunks/app/api/translator/detect/route-1787cfdb0a81cffb.js +0 -1
  540. package/app/.next/static/chunks/app/api/translator/history/route-1787cfdb0a81cffb.js +0 -1
  541. package/app/.next/static/chunks/app/api/translator/load/route-1787cfdb0a81cffb.js +0 -1
  542. package/app/.next/static/chunks/app/api/translator/save/route-1787cfdb0a81cffb.js +0 -1
  543. package/app/.next/static/chunks/app/api/translator/send/route-1787cfdb0a81cffb.js +0 -1
  544. package/app/.next/static/chunks/app/api/translator/translate/route-1787cfdb0a81cffb.js +0 -1
  545. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-1787cfdb0a81cffb.js +0 -1
  546. package/app/.next/static/chunks/app/api/usage/analytics/route-1787cfdb0a81cffb.js +0 -1
  547. package/app/.next/static/chunks/app/api/usage/budget/route-1787cfdb0a81cffb.js +0 -1
  548. package/app/.next/static/chunks/app/api/usage/call-logs/[id]/route-1787cfdb0a81cffb.js +0 -1
  549. package/app/.next/static/chunks/app/api/usage/call-logs/route-1787cfdb0a81cffb.js +0 -1
  550. package/app/.next/static/chunks/app/api/usage/history/route-1787cfdb0a81cffb.js +0 -1
  551. package/app/.next/static/chunks/app/api/usage/logs/route-1787cfdb0a81cffb.js +0 -1
  552. package/app/.next/static/chunks/app/api/usage/proxy-logs/route-1787cfdb0a81cffb.js +0 -1
  553. package/app/.next/static/chunks/app/api/usage/quota/route-1787cfdb0a81cffb.js +0 -1
  554. package/app/.next/static/chunks/app/api/usage/request-logs/route-1787cfdb0a81cffb.js +0 -1
  555. package/app/.next/static/chunks/app/api/v1/api/chat/route-1787cfdb0a81cffb.js +0 -1
  556. package/app/.next/static/chunks/app/api/v1/audio/speech/route-1787cfdb0a81cffb.js +0 -1
  557. package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-1787cfdb0a81cffb.js +0 -1
  558. package/app/.next/static/chunks/app/api/v1/chat/completions/route-1787cfdb0a81cffb.js +0 -1
  559. package/app/.next/static/chunks/app/api/v1/completions/route-1787cfdb0a81cffb.js +0 -1
  560. package/app/.next/static/chunks/app/api/v1/embeddings/route-1787cfdb0a81cffb.js +0 -1
  561. package/app/.next/static/chunks/app/api/v1/images/generations/route-1787cfdb0a81cffb.js +0 -1
  562. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-1787cfdb0a81cffb.js +0 -1
  563. package/app/.next/static/chunks/app/api/v1/messages/route-1787cfdb0a81cffb.js +0 -1
  564. package/app/.next/static/chunks/app/api/v1/models/route-1787cfdb0a81cffb.js +0 -1
  565. package/app/.next/static/chunks/app/api/v1/moderations/route-1787cfdb0a81cffb.js +0 -1
  566. package/app/.next/static/chunks/app/api/v1/music/generations/route-1787cfdb0a81cffb.js +0 -1
  567. package/app/.next/static/chunks/app/api/v1/providers/[provider]/chat/completions/route-1787cfdb0a81cffb.js +0 -1
  568. package/app/.next/static/chunks/app/api/v1/providers/[provider]/embeddings/route-1787cfdb0a81cffb.js +0 -1
  569. package/app/.next/static/chunks/app/api/v1/providers/[provider]/images/generations/route-1787cfdb0a81cffb.js +0 -1
  570. package/app/.next/static/chunks/app/api/v1/rerank/route-1787cfdb0a81cffb.js +0 -1
  571. package/app/.next/static/chunks/app/api/v1/responses/route-1787cfdb0a81cffb.js +0 -1
  572. package/app/.next/static/chunks/app/api/v1/route-1787cfdb0a81cffb.js +0 -1
  573. package/app/.next/static/chunks/app/api/v1/videos/generations/route-1787cfdb0a81cffb.js +0 -1
  574. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-1787cfdb0a81cffb.js +0 -1
  575. package/app/.next/static/chunks/app/api/v1beta/models/route-1787cfdb0a81cffb.js +0 -1
  576. package/app/.next/static/chunks/app/page-1787cfdb0a81cffb.js +0 -1
  577. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-1787cfdb0a81cffb.js +0 -1
  578. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-1787cfdb0a81cffb.js +0 -1
  579. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-1787cfdb0a81cffb.js +0 -1
  580. /package/app/.next/static/{M35Z_Bh-lQ1uO7hB_-bVc → 3s5SDPHTqXdRuXH0NTawz}/_ssgManifest.js +0 -0
package/app/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omniroute",
3
- "version": "2.5.0",
3
+ "version": "2.5.2",
4
4
  "description": "Smart AI Router with auto fallback — route to FREE & cheap models, zero downtime. Works with Cursor, Cline, Claude Desktop, Codex, and any OpenAI-compatible tool.",
5
5
  "type": "module",
6
6
  "bin": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omniroute",
3
- "version": "2.5.0",
3
+ "version": "2.5.2",
4
4
  "description": "Smart AI Router with auto fallback — route to FREE & cheap models, zero downtime. Works with Cursor, Cline, Claude Desktop, Codex, and any OpenAI-compatible tool.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1 +0,0 @@
1
- self.__BUILD_MANIFEST=function(e,s,t,a,i,o,r,n){return{__rewrites:{afterFiles:[{has:t,source:"/chat/completions",destination:"/api/v1/chat/completions"},{has:t,source:"/responses",destination:i},{has:t,source:"/models",destination:"/api/v1/models"},{has:t,source:"/v1/v1/:path*",destination:o},{has:t,source:"/v1/v1",destination:r},{has:t,source:"/codex/:path*",destination:i},{has:t,source:"/v1/:path*",destination:o},{has:t,source:"/v1",destination:r}],beforeFiles:[],fallback:[]},__routerFilterStatic:{numItems:173,errorRate:1e-4,numBits:3317,numHashes:14,bitArray:[0,1,0,0,0,0,0,1,0,1,1,1,0,0,0,1,1,1,1,1,0,1,1,0,1,0,1,1,0,0,0,0,0,1,0,1,1,1,0,1,0,1,1,0,1,0,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,0,1,0,0,1,1,1,0,0,0,1,1,0,1,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,1,1,0,0,0,0,1,1,0,1,0,1,1,0,0,0,0,1,0,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,1,1,0,1,1,0,0,1,1,1,0,0,0,1,1,0,1,1,1,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,1,1,0,0,0,0,0,1,1,0,1,0,1,1,1,1,1,0,0,0,1,0,0,1,1,1,0,0,0,1,0,0,1,1,1,0,1,1,1,0,0,1,0,1,0,1,1,1,0,1,0,0,0,1,0,1,0,1,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,0,0,1,0,1,0,0,1,1,1,1,0,1,0,1,0,0,0,0,1,0,0,0,1,1,1,0,1,0,0,1,0,1,0,0,0,0,1,1,0,0,1,1,0,0,1,1,0,1,0,0,1,0,0,0,1,1,1,0,1,1,1,1,1,1,1,0,0,0,0,0,1,1,0,1,1,1,0,1,0,1,0,0,1,0,1,0,0,0,0,0,1,0,1,1,0,1,0,1,1,1,1,0,1,1,0,0,1,1,0,1,1,0,1,0,0,0,1,1,1,1,1,0,0,1,0,1,1,1,1,1,0,1,1,1,0,1,0,1,0,0,0,0,0,1,0,0,1,0,0,1,1,0,0,0,1,0,0,1,1,1,1,0,1,1,0,1,0,1,0,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,1,1,0,1,0,1,0,0,1,1,0,0,1,0,1,1,1,1,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,1,1,1,0,1,1,0,0,1,0,0,1,0,0,1,1,1,0,0,0,0,0,0,1,1,0,0,1,1,1,1,1,0,1,1,0,1,0,1,1,0,0,1,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,1,1,0,1,0,1,1,1,1,1,1,1,1,1,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,1,0,0,0,0,1,0,0,1,1,1,1,1,1,1,1,1,1,0,1,0,0,1,1,0,1,0,1,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,1,0,0,1,0,0,1,0,1,0,0,0,1,0,0,1,1,1,0,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,0,1,1,0,0,0,0,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,1,0,0,0,1,0,0,0,0,0,1,0,1,1,0,0,0,1,1,1,0,1,0,0,1,1,1,0,0,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,1,1,1,0,0,1,1,1,0,0,1,1,0,0,0,0,0,0,1,0,1,0,1,0,1,1,1,0,0,1,1,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,0,0,1,0,1,0,1,0,1,1,1,1,0,1,1,0,0,0,0,1,0,1,1,1,1,0,0,1,1,1,1,1,0,1,0,0,0,0,0,1,1,0,1,1,0,0,0,1,1,1,0,1,1,0,1,0,1,0,0,0,1,1,1,1,1,1,1,0,1,0,1,1,1,0,1,1,1,0,0,1,0,1,1,1,1,1,0,1,1,0,1,0,1,1,1,1,1,0,0,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,0,0,1,1,0,1,0,0,0,1,1,0,1,1,1,1,1,0,0,0,1,1,1,1,1,0,0,1,0,1,0,1,0,1,1,1,0,0,0,1,0,1,0,1,0,0,1,0,0,1,0,0,0,0,1,0,1,0,1,0,1,1,0,1,1,1,1,0,1,1,0,1,1,1,1,1,1,0,1,0,0,0,1,0,1,1,1,1,0,0,1,0,0,1,1,0,0,1,0,1,1,1,0,1,0,1,1,0,0,1,1,0,0,1,0,1,0,1,1,1,1,1,0,0,0,1,0,0,0,0,0,1,1,0,0,0,1,1,0,1,0,1,1,0,0,1,1,1,0,0,0,1,1,0,1,1,0,1,0,1,1,1,1,0,1,0,1,0,0,0,0,1,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,1,0,1,1,0,1,0,0,0,0,1,1,0,0,1,0,0,1,1,0,0,0,1,0,1,0,0,1,0,1,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,0,1,1,1,0,1,0,0,0,1,0,0,1,1,0,0,1,1,0,0,0,1,1,1,0,0,1,1,0,0,1,0,0,0,0,1,0,0,0,0,0,1,1,0,1,1,1,0,0,1,1,1,1,1,1,0,1,1,0,1,1,1,0,1,0,1,0,0,1,1,0,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,0,1,1,0,1,0,1,1,1,0,1,0,0,1,1,1,1,0,1,0,1,1,0,1,1,1,1,0,1,0,0,0,1,1,0,1,1,1,0,0,1,0,1,0,1,0,1,1,0,0,1,1,1,0,0,1,1,0,1,0,0,0,0,0,0,1,1,1,0,0,1,1,1,0,1,0,1,1,0,1,0,0,0,0,1,1,1,1,0,1,0,1,1,0,1,0,0,1,0,0,1,1,0,0,0,1,0,1,0,1,0,1,1,0,0,1,0,1,1,1,1,0,1,0,1,0,1,0,0,1,1,0,1,1,1,0,0,0,1,1,0,0,1,0,0,1,1,0,1,0,1,1,0,1,0,1,1,1,1,0,0,0,0,0,0,1,0,0,0,1,1,0,1,1,1,1,1,0,1,1,0,0,0,1,0,0,0,1,0,0,1,0,1,0,1,1,1,1,0,0,0,0,0,1,0,1,1,1,0,1,1,1,0,0,1,0,1,1,1,0,0,1,1,0,1,0,1,0,1,1,0,0,1,1,1,1,1,0,0,1,1,0,0,1,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,0,1,1,1,0,0,0,1,0,1,1,0,1,0,0,0,1,1,1,0,1,1,1,0,0,1,1,1,0,1,0,0,0,0,0,1,1,0,1,0,1,0,1,1,1,1,0,1,0,1,1,1,0,1,0,0,1,1,0,0,1,0,1,0,0,1,1,0,1,1,0,1,0,1,0,1,1,1,1,0,1,0,0,0,1,1,0,0,1,0,0,0,1,1,0,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,0,0,1,1,1,0,1,1,0,1,0,0,0,0,0,1,0,1,1,1,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,1,1,0,1,0,1,1,0,1,1,1,0,0,0,1,0,1,1,1,0,1,0,1,1,0,0,0,1,0,0,0,1,1,1,1,1,0,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,1,1,1,1,1,0,1,1,0,1,1,1,0,0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,0,0,1,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,1,0,0,1,1,1,0,1,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,0,1,0,1,1,1,1,1,0,1,0,0,1,0,0,1,0,1,0,0,0,0,1,1,1,1,0,1,1,0,1,0,1,1,1,1,1,1,0,0,1,0,1,0,1,0,1,1,0,0,1,0,0,0,1,1,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,0,0,0,0,1,1,0,1,0,0,1,0,0,1,0,1,1,1,1,0,1,1,1,0,1,1,0,0,0,0,0,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,0,1,0,1,1,0,0,1,0,1,0,1,0,0,0,0,1,1,1,1,0,1,1,1,0,0,1,1,0,1,0,1,1,0,1,1,1,0,1,0,1,0,1,0,0,0,0,0,0,1,1,0,1,0,1,1,1,1,0,1,1,0,1,0,0,0,0,1,1,0,0,0,1,0,1,1,0,0,1,0,1,0,1,1,1,0,1,0,0,1,1,0,0,0,0,1,1,0,1,0,1,1,1,1,1,1,1,0,0,1,1,0,1,1,0,1,0,1,0,1,0,1,0,0,0,0,1,0,1,0,1,0,0,0,1,0,0,0,1,1,1,1,0,0,1,0,0,0,0,1,0,0,1,1,1,0,1,0,0,1,1,0,0,0,1,0,1,0,1,1,1,1,0,0,1,1,0,1,1,1,1,0,1,1,0,1,1,0,0,1,0,0,1,1,0,1,1,1,0,0,1,1,1,0,0,0,0,1,0,0,0,1,0,0,0,1,1,1,0,0,1,0,0,0,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,0,1,1,0,1,1,1,1,0,1,1,0,0,1,1,1,0,0,1,1,1,0,1,0,1,0,1,0,1,0,0,1,1,0,1,1,0,1,0,0,0,1,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1,0,0,0,0,0,1,1,1,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,0,0,1,1,0,0,0,1,0,1,0,0,1,0,1,0,1,0,1,1,0,1,0,0,1,1,0,0,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,0,1,1,1,1,1,1,1,0,1,0,1,1,1,0,1,1,0,1,0,1,0,0,1,0,0,0,0,1,0,0,1,1,1,1,1,1,1,0,0,0,1,0,0,0,1,1,1,1,0,1,0,0,1,1,1,1,0,0,1,0,1,0,0,1,0,1,1,1,1,1,0,1,1,0,0,0,0,1,1,0,1,1,0,1,0,1,1,1,1,1,0,0,0,1,0,0,1,0,0,0,0,1,1,0,1,1,0,0,1,0,1,0,1,1,0,1,1,1,0,0,1,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,1,0,0,1,1,1,1,1,0,1,1,0,0,0,0,0,1,0,1,1,1,0,1,1,1,0,0,1,1,1,0,1,0,1,1,1,0,0,1,1,1,1,1,1,1,0,0,1,1,0,1,1,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,1,0,1,1,1,0,1,0,0,0,1,0,0,1,1,0,0,0,1,1,0,1,1,0,1,1,0,0,0,1,0,0,0,0,1,1,1,0,0,1,0,0,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,0,1,0,1,0,0,1,0,1,0,1,0,0,1,1,0,1,0,0,1,1,1,1,0,1,1,1,0,1,1,1,0,0,1,0,1,0,1,1,0,0,0,1,0,1,1,0,1,1,1,0,1,0,1,1,1,0,0,1,1,0,0,0,1,0,0,1,1,0,1,1,0,1,0,0,0,0,0,0,1,1,0,1,0,1,1,0,0,0,0,1,0,1,1,0,0,1,0,1,1,1,1,0,1,1,0,0,1,0,1,0,0,0,1,0,0,0,0,1,1,1,0,1,0,0,1,0,1,0,0,0,1,1,1,0,0,1,1,0,0,1,0,1,1,1,0,1,0,1,0,0,1,0,1,1,1,1,1,1,1,1,1,0,0,1,0,0,0,0,0,0,1,0,1,0,1,0,1,0,1,1,1,1,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,1,0,1,0,1,1,1,0,0,1,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,1,0,1,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,1,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,0,1,0,0,0,1,1,0,0,1,0,0,1,1,0,1,1,1,0,0,1,0,1,0,0,0,0,1,1,0,1,1,1,1,0,1,1,0,1,0,0,1,1,1,0,1,0,1,0,1,0,0,0,1,0,1,0,0,1,1,1,0,1,1,1,1,0,1,1,1,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,1,1,1,0,1,0,1,0,1,0,0,1,0,0,1,0,1,1,0,0,0,0,0,0,1,1,0,1,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,0,0,1,1,1,0,1,0,0,1,1,1,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0,1,0,1,1,0,1,0,1,0,0,1,1,1,1,0,1,0,0,0,0,1,1,1,0,1,0,1,1,1,1,0,1,0,0,1,0,1,1,0,0,1,1,1,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1,1,0,0,1,0,1,0,1,1,0,1,1,0,1,0,1,0,0,0,1,1,0,0,0,0,1,1,1,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,0,1,1,1,0,0,0,1,0,1,0,0,1,0,1,0,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,0,1,1,1,1,1,0,1,0,1,1,0,0,1,0,1,0,1,1,0,1,1,1,0,1,1,0,1,1,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,0,1,0,1,1,1,1,1,1,0,1,1,0,1,1,0,1,0,0,0,1,1,1,1,0,1,0,0,1,1,0,1,1,0,0,0,1,1,0,1,0,0,0,1,0,1,1,0,1,0,0,0,1,1,1,0,0,0,1,0,1,1,0,0,0,0,0,0,1,1,0,1,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,1,1,0,1,0,1,0,1,1,1,1,0,1,0]},__routerFilterDynamic:{numItems:14,errorRate:1e-4,numBits:269,numHashes:14,bitArray:[1,0,0,0,0,1,0,1,1,0,0,0,1,0,0,0,1,1,0,0,1,1,0,0,0,1,0,0,1,0,1,1,0,1,0,1,0,1,1,0,0,0,0,0,0,1,1,0,1,0,1,0,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,1,0,0,1,1,1,1,1,1,0,1,0,1,0,1,0,0,1,1,0,0,1,0,1,0,1,0,1,0,1,1,1,0,0,0,0,0,1,1,1,1,1,0,1,0,1,0,1,0,1,1,0,0,1,0,1,0,0,1,1,1,0,1,0,0,0,1,0,0,0,0,1,1,1,0,1,1,0,1,0,1,1,0,1,1,0,1,1,1,1,0,0,1,0,1,0,1,0,1,1,1,1,1,1,0,1,0,0,0,0,0,1,1,1,0,0,0,0,1,1,0,1,0,0,0,0,0,1,1,0,0,1,0,1,0,0,1,0,1,0,0,0,0,1,1,1,0,1,1,0,0,1,0,1,1,0,1,0,1,0,0,1,1,1,1,1,1,1,0,1,0,0,0,1,1,1,0,0,0,0,0,1,1,0,1,0,0,0,0,1,1,1,0,0,1,1,1,1,0,1,0,1]},sortedPages:["/_app"]}}(0,0,void 0,0,"/api/v1/responses","/api/v1/:path*","/api/v1",0),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
@@ -1,2 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5846],{20909:(e,a,i)=>{i.d(a,{Q2:()=>h,DI:()=>c,fg:()=>m,MA:()=>g,IS:()=>s,zN:()=>l,JH:()=>d,wb:()=>f,wG:()=>k,zt:()=>b,gb:()=>u,mq:()=>p});var t=i(47173);let o=t.Ikc({id:t.YjP().min(1),alias:t.YjP().min(1),name:t.YjP().min(1),icon:t.YjP().min(1),color:t.YjP().regex(/^#[0-9A-Fa-f]{6}$/,"Must be a valid hex color (#RRGGBB)"),textIcon:t.YjP().optional(),website:t.YjP().url().optional(),passthroughModels:t.zMY().optional()}),n=t.g1P(t.YjP(),o);function r(e,a){let i=n.safeParse(e);if(!i.success){let e=i.error.issues.map(e=>` ${e.path.join(".")}: ${e.message}`).join("\n");throw console.error(`[PROVIDER VALIDATION] ${a} has invalid entries:
2
- ${e}`),Error(`Provider validation failed for ${a}`)}}let s={iflow:{id:"iflow",alias:"if",name:"iFlow AI",icon:"water_drop",color:"#6366F1"},qwen:{id:"qwen",alias:"qw",name:"Qwen Code",icon:"psychology",color:"#10B981"},"gemini-cli":{id:"gemini-cli",alias:"gc",name:"Gemini CLI",icon:"terminal",color:"#4285F4"},kiro:{id:"kiro",alias:"kr",name:"Kiro AI",icon:"psychology_alt",color:"#FF6B35"}},l={claude:{id:"claude",alias:"cc",name:"Claude Code",icon:"smart_toy",color:"#D97757"},antigravity:{id:"antigravity",alias:"ag",name:"Antigravity",icon:"rocket_launch",color:"#F59E0B"},codex:{id:"codex",alias:"cx",name:"OpenAI Codex",icon:"code",color:"#3B82F6"},github:{id:"github",alias:"gh",name:"GitHub Copilot",icon:"code",color:"#333333"},cursor:{id:"cursor",alias:"cu",name:"Cursor IDE",icon:"edit_note",color:"#00D4AA"},"kimi-coding":{id:"kimi-coding",alias:"kmc",name:"Kimi Coding",icon:"psychology",color:"#1E40AF",textIcon:"KC"},kilocode:{id:"kilocode",alias:"kc",name:"Kilo Code",icon:"code",color:"#FF6B35",textIcon:"KC"},cline:{id:"cline",alias:"cl",name:"Cline",icon:"smart_toy",color:"#5B9BD5",textIcon:"CL"}},m={openrouter:{id:"openrouter",alias:"openrouter",name:"OpenRouter",icon:"router",color:"#F97316",textIcon:"OR",passthroughModels:!0,website:"https://openrouter.ai"},glm:{id:"glm",alias:"glm",name:"GLM Coding",icon:"code",color:"#2563EB",textIcon:"GL",website:"https://open.bigmodel.cn"},kimi:{id:"kimi",alias:"kimi",name:"Kimi",icon:"psychology",color:"#1E3A8A",textIcon:"KM",website:"https://kimi.moonshot.cn"},minimax:{id:"minimax",alias:"minimax",name:"Minimax Coding",icon:"memory",color:"#7C3AED",textIcon:"MM",website:"https://www.minimaxi.com"},"minimax-cn":{id:"minimax-cn",alias:"minimax-cn",name:"Minimax (China)",icon:"memory",color:"#DC2626",textIcon:"MC",website:"https://www.minimaxi.com"},openai:{id:"openai",alias:"openai",name:"OpenAI",icon:"auto_awesome",color:"#10A37F",textIcon:"OA",website:"https://platform.openai.com"},anthropic:{id:"anthropic",alias:"anthropic",name:"Anthropic",icon:"smart_toy",color:"#D97757",textIcon:"AN",website:"https://console.anthropic.com"},gemini:{id:"gemini",alias:"gemini",name:"Gemini",icon:"diamond",color:"#4285F4",textIcon:"GE",website:"https://ai.google.dev"},deepseek:{id:"deepseek",alias:"ds",name:"DeepSeek",icon:"bolt",color:"#4D6BFE",textIcon:"DS",website:"https://deepseek.com"},groq:{id:"groq",alias:"groq",name:"Groq",icon:"speed",color:"#F55036",textIcon:"GQ",website:"https://groq.com",hasFree:!0,freeNote:"Free tier: 30 RPM / 14.4K RPD — no credit card"},blackbox:{id:"blackbox",alias:"bb",name:"Blackbox AI",icon:"view_in_ar",color:"#1A1A2E",textIcon:"BB",website:"https://blackbox.ai"},xai:{id:"xai",alias:"xai",name:"xAI (Grok)",icon:"auto_awesome",color:"#1DA1F2",textIcon:"XA",website:"https://x.ai"},mistral:{id:"mistral",alias:"mistral",name:"Mistral",icon:"air",color:"#FF7000",textIcon:"MI",website:"https://mistral.ai"},perplexity:{id:"perplexity",alias:"pplx",name:"Perplexity",icon:"search",color:"#20808D",textIcon:"PP",website:"https://www.perplexity.ai"},together:{id:"together",alias:"together",name:"Together AI",icon:"group_work",color:"#0F6FFF",textIcon:"TG",website:"https://www.together.ai"},fireworks:{id:"fireworks",alias:"fireworks",name:"Fireworks AI",icon:"local_fire_department",color:"#7B2EF2",textIcon:"FW",website:"https://fireworks.ai"},cerebras:{id:"cerebras",alias:"cerebras",name:"Cerebras",icon:"memory",color:"#FF4F00",textIcon:"CB",website:"https://inference.cerebras.ai",hasFree:!0,freeNote:"Free: 1M tokens/day, 60K TPM — world's fastest inference"},cohere:{id:"cohere",alias:"cohere",name:"Cohere",icon:"hub",color:"#39594D",textIcon:"CO",website:"https://cohere.com"},nvidia:{id:"nvidia",alias:"nvidia",name:"NVIDIA NIM",icon:"developer_board",color:"#76B900",textIcon:"NV",website:"https://build.nvidia.com",hasFree:!0,freeNote:"Free dev access: ~40 RPM, 70+ models (Kimi K2.5, GLM 4.7, DeepSeek V3.2...)"},nebius:{id:"nebius",alias:"nebius",name:"Nebius AI",icon:"cloud",color:"#6C5CE7",textIcon:"NB",website:"https://nebius.com"},siliconflow:{id:"siliconflow",alias:"siliconflow",name:"SiliconFlow",icon:"cloud_queue",color:"#5B6EF5",textIcon:"SF",website:"https://cloud.siliconflow.com"},hyperbolic:{id:"hyperbolic",alias:"hyp",name:"Hyperbolic",icon:"bolt",color:"#00D4FF",textIcon:"HY",website:"https://hyperbolic.xyz"},deepgram:{id:"deepgram",alias:"dg",name:"Deepgram",icon:"mic",color:"#13EF93",textIcon:"DG",website:"https://deepgram.com"},assemblyai:{id:"assemblyai",alias:"aai",name:"AssemblyAI",icon:"record_voice_over",color:"#0062FF",textIcon:"AA",website:"https://assemblyai.com"},nanobanana:{id:"nanobanana",alias:"nb",name:"NanoBanana",icon:"image",color:"#FFD700",textIcon:"NB",website:"https://nanobananaapi.ai"},"ollama-cloud":{id:"ollama-cloud",alias:"ollamacloud",name:"Ollama Cloud",icon:"cloud",color:"#58A6FF",textIcon:"OC",website:"https://ollama.com/settings/api-keys"},elevenlabs:{id:"elevenlabs",alias:"el",name:"ElevenLabs",icon:"record_voice_over",color:"#6C47FF",textIcon:"EL",website:"https://elevenlabs.io"},cartesia:{id:"cartesia",alias:"cartesia",name:"Cartesia",icon:"spatial_audio",color:"#FF4F8B",textIcon:"CA",website:"https://cartesia.ai"},playht:{id:"playht",alias:"playht",name:"PlayHT",icon:"play_circle",color:"#00B4D8",textIcon:"PH",website:"https://play.ht"},inworld:{id:"inworld",alias:"inworld",name:"Inworld",icon:"voice_chat",color:"#7B2EF2",textIcon:"IW",website:"https://inworld.ai"},sdwebui:{id:"sdwebui",alias:"sdwebui",name:"SD WebUI",icon:"brush",color:"#FF7043",textIcon:"SD",website:"https://github.com/AUTOMATIC1111/stable-diffusion-webui"},comfyui:{id:"comfyui",alias:"comfyui",name:"ComfyUI",icon:"account_tree",color:"#4CAF50",textIcon:"CF",website:"https://github.com/comfyanonymous/ComfyUI"},huggingface:{id:"huggingface",alias:"hf",name:"HuggingFace",icon:"face",color:"#FFD21E",textIcon:"HF",website:"https://huggingface.co",hasFree:!0,freeNote:"Free Inference API for thousands of models (Whisper, VITS, SDXL…)"},vertex:{id:"vertex",alias:"vertex",name:"Vertex AI",icon:"cloud",color:"#4285F4",textIcon:"VA",website:"https://cloud.google.com/vertex-ai",authHint:"Provide Service Account JSON or OAuth access_token"}},d="openai-compatible-",c="anthropic-compatible-";function p(e){return"string"==typeof e&&e.startsWith(d)}function u(e){return"string"==typeof e&&e.startsWith(c)}let h={...s,...l,...m},g={oauth:{id:"oauth",name:"OAuth",icon:"lock"},apikey:{id:"apikey",name:"API Key",icon:"key"}};function b(e){for(let a of Object.values(h))if(a.alias===e||a.id===e)return a;return null}function k(e){let a=h[e];return a?.alias||e}Object.values(h).reduce((e,a)=>(e[a.alias]=a.id,e),{}),Object.values(h).reduce((e,a)=>(e[a.id]=a.alias,e),{});let f=["antigravity","kiro","github","codex","claude","kimi-coding"];r(s,"FREE_PROVIDERS"),r(l,"OAUTH_PROVIDERS"),r(m,"APIKEY_PROVIDERS")},35144:(e,a,i)=>{i.d(a,{Xg:()=>r,vq:()=>n,KC:()=>s}),i(41463);let t={claude:{id:"claude",alias:"cc",format:"claude",executor:"default",baseUrl:"https://api.anthropic.com/v1/messages",urlSuffix:"?beta=true",authType:"oauth",authHeader:"x-api-key",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14,context-management-2025-06-27","Anthropic-Dangerous-Direct-Browser-Access":"true","User-Agent":"claude-cli/1.0.83 (external, cli)","X-App":"cli","X-Stainless-Helper-Method":"stream","X-Stainless-Retry-Count":"0","X-Stainless-Runtime-Version":"v24.3.0","X-Stainless-Package-Version":"0.55.1","X-Stainless-Runtime":"node","X-Stainless-Lang":"js","X-Stainless-Arch":"arm64","X-Stainless-Os":"MacOS","X-Stainless-Timeout":"60"},oauth:{clientIdEnv:"CLAUDE_OAUTH_CLIENT_ID",clientIdDefault:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",tokenUrl:"https://console.anthropic.com/v1/oauth/token"},models:[{id:"claude-opus-4-6",name:"Claude Opus 4.6"},{id:"claude-opus-4-5-20251101",name:"Claude 4.5 Opus"},{id:"claude-sonnet-4-5-20250929",name:"Claude 4.5 Sonnet"},{id:"claude-haiku-4-5-20251001",name:"Claude 4.5 Haiku"}]},gemini:{id:"gemini",alias:"gemini",format:"gemini",executor:"default",baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",urlBuilder:(e,a,i)=>`${e}/${a}:${i?"streamGenerateContent?alt=sse":"generateContent"}`,authType:"apikey",authHeader:"x-goog-api-key",oauth:{clientIdEnv:"GEMINI_OAUTH_CLIENT_ID",clientIdDefault:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecretEnv:"GEMINI_OAUTH_CLIENT_SECRET",clientSecretDefault:""},models:[{id:"gemini-3.1-pro",name:"Gemini 3.1 Pro"},{id:"gemini-3.1-flash",name:"Gemini 3.1 Flash"},{id:"gemini-3-pro-preview",name:"Gemini 3.0 Pro Preview"},{id:"gemini-3-flash-preview",name:"Gemini 3.0 Flash Preview"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash"},{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite"}]},"gemini-cli":{id:"gemini-cli",alias:"gc",format:"gemini-cli",executor:"gemini-cli",baseUrl:"https://cloudcode-pa.googleapis.com/v1internal",urlBuilder:(e,a,i)=>`${e}:${i?"streamGenerateContent?alt=sse":"generateContent"}`,authType:"oauth",authHeader:"bearer",oauth:{clientIdEnv:"GEMINI_CLI_OAUTH_CLIENT_ID",clientIdDefault:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecretEnv:"GEMINI_CLI_OAUTH_CLIENT_SECRET",clientSecretDefault:""},models:[{id:"gemini-3.1-pro",name:"Gemini 3.1 Pro"},{id:"gemini-3.1-flash",name:"Gemini 3.1 Flash"},{id:"gemini-3-flash-preview",name:"Gemini 3.0 Flash Preview"},{id:"gemini-3-pro-preview",name:"Gemini 3.0 Pro Preview"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash"},{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite"}]},codex:{id:"codex",alias:"cx",format:"openai-responses",executor:"codex",baseUrl:"https://chatgpt.com/backend-api/codex/responses",authType:"oauth",authHeader:"bearer",headers:{Version:"0.92.0","Openai-Beta":"responses=experimental","User-Agent":"codex-cli/0.92.0 (Windows 10.0.26100; x64)"},oauth:{clientIdEnv:"CODEX_OAUTH_CLIENT_ID",clientIdDefault:"app_EMoamEEZ73f0CkXaXp7hrann",clientSecretEnv:"CODEX_OAUTH_CLIENT_SECRET",clientSecretDefault:"",tokenUrl:"https://auth.openai.com/oauth/token"},models:[{id:"gpt-5.3-codex",name:"GPT 5.3 Codex"},{id:"gpt-5.3-codex-xhigh",name:"GPT 5.3 Codex (xHigh)"},{id:"gpt-5.3-codex-high",name:"GPT 5.3 Codex (High)"},{id:"gpt-5.3-codex-low",name:"GPT 5.3 Codex (Low)"},{id:"gpt-5.3-codex-none",name:"GPT 5.3 Codex (None)"},{id:"gpt-5.1-codex-mini",name:"GPT 5.1 Codex Mini"},{id:"gpt-5.1-codex-mini-high",name:"GPT 5.1 Codex Mini (High)"},{id:"gpt-5.2-codex",name:"GPT 5.2 Codex"},{id:"gpt-5.2",name:"GPT 5.2"},{id:"gpt-5.1-codex-max",name:"GPT 5.1 Codex Max"},{id:"gpt-5.1-codex",name:"GPT 5.1 Codex"},{id:"gpt-5.1",name:"GPT 5.1"},{id:"gpt-5-codex",name:"GPT 5 Codex"},{id:"gpt-5-codex-mini",name:"GPT 5 Codex Mini"}]},qwen:{id:"qwen",alias:"qw",format:"openai",executor:"default",baseUrl:"https://portal.qwen.ai/v1/chat/completions",authType:"oauth",authHeader:"bearer",headers:{"User-Agent":"QwenCode/0.12.3 (linux; x64)","X-Dashscope-AuthType":"qwen-oauth","X-Dashscope-CacheControl":"enable","X-Dashscope-UserAgent":"QwenCode/0.12.3 (linux; x64)","X-Stainless-Arch":"x64","X-Stainless-Lang":"js","X-Stainless-Os":"Linux","X-Stainless-Package-Version":"5.11.0","X-Stainless-Retry-Count":"1","X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":"v18.19.1",Connection:"keep-alive","Accept-Language":"*","Sec-Fetch-Mode":"cors"},oauth:{clientIdEnv:"QWEN_OAUTH_CLIENT_ID",clientIdDefault:"f0304373b74a44d2b584a3fb70ca9e56",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",authUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code"},models:[{id:"qwen3-coder-plus",name:"Qwen3 Coder Plus"},{id:"qwen3-coder-flash",name:"Qwen3 Coder Flash"},{id:"vision-model",name:"Qwen3 Vision Model"},{id:"coder-model",name:"Qwen3.5 (Coder Model)"}]},iflow:{id:"iflow",alias:"if",format:"openai",executor:"iflow",baseUrl:"https://apis.iflow.cn/v1/chat/completions",authType:"oauth",authHeader:"bearer",headers:{"User-Agent":"iFlow-Cli"},oauth:{clientIdEnv:"IFLOW_OAUTH_CLIENT_ID",clientIdDefault:"10009311001",clientSecretEnv:"IFLOW_OAUTH_CLIENT_SECRET",clientSecretDefault:"",tokenUrl:"https://iflow.cn/oauth/token",authUrl:"https://iflow.cn/oauth"},models:[{id:"iflow-rome-30ba3b",name:"iFlow ROME"},{id:"qwen3-coder-plus",name:"Qwen3 Coder Plus"},{id:"qwen3-max",name:"Qwen3 Max"},{id:"qwen3-vl-plus",name:"Qwen3 Vision Plus"},{id:"kimi-k2-0905",name:"Kimi K2 0905"},{id:"qwen3-max-preview",name:"Qwen3 Max Preview"},{id:"kimi-k2",name:"Kimi K2"},{id:"deepseek-v3.2",name:"DeepSeek-V3.2-Exp"},{id:"deepseek-r1",name:"DeepSeek R1"},{id:"deepseek-v3",name:"DeepSeek V3"},{id:"qwen3-32b",name:"Qwen3 32B"},{id:"qwen3-235b-a22b-thinking-2507",name:"Qwen3 235B A22B Thinking 2507"},{id:"qwen3-235b-a22b-instruct",name:"Qwen3 235B A22B Instruct"},{id:"qwen3-235b",name:"Qwen3 235B"}]},antigravity:{id:"antigravity",alias:"ag",format:"antigravity",executor:"antigravity",baseUrls:["https://daily-cloudcode-pa.googleapis.com","https://cloudcode-pa.googleapis.com"],urlBuilder:(e,a,i)=>`${e}${i?"/v1internal:streamGenerateContent?alt=sse":"/v1internal:generateContent"}`,authType:"oauth",authHeader:"bearer",headers:{"User-Agent":"antigravity/1.104.0 darwin/arm64"},oauth:{clientIdEnv:"ANTIGRAVITY_OAUTH_CLIENT_ID",clientIdDefault:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecretEnv:"ANTIGRAVITY_OAUTH_CLIENT_SECRET",clientSecretDefault:""},models:[{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 Thinking"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6"},{id:"gemini-3.1-pro-high",name:"Gemini 3.1 Pro High"},{id:"gemini-3.1-pro-low",name:"Gemini 3.1 Pro Low"},{id:"gemini-3.1-flash",name:"Gemini 3.1 Flash"},{id:"gemini-3-flash",name:"Gemini 3.0 Flash"},{id:"gpt-oss-120b-medium",name:"GPT OSS 120B Medium"}]},github:{id:"github",alias:"gh",format:"openai",executor:"github",baseUrl:"https://api.githubcopilot.com/chat/completions",responsesBaseUrl:"https://api.githubcopilot.com/responses",authType:"oauth",authHeader:"bearer",headers:{"copilot-integration-id":"vscode-chat","editor-version":"vscode/1.107.1","editor-plugin-version":"copilot-chat/0.26.7","user-agent":"GitHubCopilotChat/0.26.7","openai-intent":"conversation-panel","x-github-api-version":"2025-04-01","x-vscode-user-agent-library-version":"electron-fetch","X-Initiator":"user",Accept:"application/json","Content-Type":"application/json"},models:[{id:"gpt-4.1",name:"GPT-4.1"},{id:"gpt-4o",name:"GPT-4o"},{id:"gpt-4o-mini",name:"GPT-4o Mini"},{id:"gpt-4",name:"GPT-4"},{id:"gpt-3.5-turbo",name:"GPT-3.5 Turbo"},{id:"gpt-5",name:"GPT-5"},{id:"gpt-5-mini",name:"GPT-5 Mini"},{id:"gpt-5-codex",name:"GPT-5 Codex",targetFormat:"openai-responses"},{id:"gpt-5.1",name:"GPT-5.1"},{id:"gpt-5.1-codex",name:"GPT-5.1 Codex",targetFormat:"openai-responses"},{id:"gpt-5.1-codex-mini",name:"GPT-5.1 Codex Mini",targetFormat:"openai-responses"},{id:"gpt-5.1-codex-max",name:"GPT-5.1 Codex Max",targetFormat:"openai-responses"},{id:"gpt-5.2",name:"GPT-5.2"},{id:"gpt-5.2-codex",name:"GPT-5.2 Codex",targetFormat:"openai-responses"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5"},{id:"claude-opus-4.1",name:"Claude Opus 4.1"},{id:"claude-opus-4.6",name:"Claude Opus 4.6"},{id:"claude-opus-4-5-20251101",name:"Claude Opus 4.5 (Full ID)"},{id:"claude-sonnet-4",name:"Claude Sonnet 4"},{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"gemini-3-flash-preview",name:"Gemini 3 Flash Preview"},{id:"gemini-3-pro-preview",name:"Gemini 3 Pro Preview"},{id:"grok-code-fast-1",name:"Grok Code Fast 1"},{id:"oswe-vscode-prime",name:"Raptor Mini"}]},kiro:{id:"kiro",alias:"kr",format:"kiro",executor:"kiro",baseUrl:"https://codewhisperer.us-east-1.amazonaws.com/generateAssistantResponse",authType:"oauth",authHeader:"bearer",headers:{"Content-Type":"application/json",Accept:"application/vnd.amazon.eventstream","X-Amz-Target":"AmazonCodeWhispererStreamingService.GenerateAssistantResponse","User-Agent":"AWS-SDK-JS/3.0.0 kiro-ide/1.0.0","X-Amz-User-Agent":"aws-sdk-js/3.0.0 kiro-ide/1.0.0"},oauth:{tokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authUrl:"https://prod.us-east-1.auth.desktop.kiro.dev"},models:[{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5"}]},cursor:{id:"cursor",alias:"cu",format:"cursor",executor:"cursor",baseUrl:"https://api2.cursor.sh",chatPath:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",authType:"oauth",authHeader:"bearer",headers:{"connect-accept-encoding":"gzip","connect-protocol-version":"1","Content-Type":"application/connect+proto","User-Agent":"connect-es/1.6.1"},clientVersion:"1.1.3",models:[{id:"default",name:"Auto (Server Picks)"},{id:"claude-4.5-opus-high-thinking",name:"Claude 4.5 Opus High Thinking"},{id:"claude-4.5-opus-high",name:"Claude 4.5 Opus High"},{id:"claude-4.5-sonnet-thinking",name:"Claude 4.5 Sonnet Thinking"},{id:"claude-4.5-sonnet",name:"Claude 4.5 Sonnet"},{id:"claude-4.5-haiku",name:"Claude 4.5 Haiku"},{id:"claude-4.5-opus",name:"Claude 4.5 Opus"},{id:"gpt-5.2-codex",name:"GPT 5.2 Codex"}]},openai:{id:"openai",alias:"openai",format:"openai",executor:"default",baseUrl:"https://api.openai.com/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"gpt-4o",name:"GPT-4o"},{id:"gpt-4o-mini",name:"GPT-4o Mini"},{id:"gpt-4-turbo",name:"GPT-4 Turbo"},{id:"o1",name:"O1"},{id:"o1-mini",name:"O1 Mini"}]},anthropic:{id:"anthropic",alias:"anthropic",format:"claude",executor:"default",baseUrl:"https://api.anthropic.com/v1/messages",urlSuffix:"?beta=true",authType:"apikey",authHeader:"x-api-key",headers:{"Anthropic-Version":"2023-06-01"},models:[{id:"claude-sonnet-4-20250514",name:"Claude Sonnet 4"},{id:"claude-opus-4-20250514",name:"Claude Opus 4"},{id:"claude-3-5-sonnet-20241022",name:"Claude 3.5 Sonnet"}]},openrouter:{id:"openrouter",alias:"openrouter",format:"openai",executor:"default",baseUrl:"https://openrouter.ai/api/v1/chat/completions",authType:"apikey",authHeader:"bearer",headers:{"HTTP-Referer":"https://endpoint-proxy.local","X-Title":"Endpoint Proxy"},models:[{id:"auto",name:"Auto (Best Available)"}]},glm:{id:"glm",alias:"glm",format:"claude",executor:"default",baseUrl:"https://api.z.ai/api/anthropic/v1/messages",urlSuffix:"?beta=true",authType:"apikey",authHeader:"x-api-key",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"},models:[{id:"glm-4.7-flash",name:"GLM 4.7 Flash"},{id:"glm-4.7",name:"GLM 4.7"},{id:"glm-4.6v",name:"GLM 4.6V (Vision)"},{id:"glm-4.6",name:"GLM 4.6"},{id:"glm-4.5v",name:"GLM 4.5V (Vision)"},{id:"glm-4.5",name:"GLM 4.5"},{id:"glm-4.5-air",name:"GLM 4.5 Air"},{id:"glm-4-32b",name:"GLM 4 32B"}]},kimi:{id:"kimi",alias:"kimi",format:"openai",executor:"default",baseUrl:"https://api.moonshot.ai/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"kimi-k2.5",name:"Kimi K2.5"},{id:"kimi-k2.5-thinking",name:"Kimi K2.5 Thinking"},{id:"kimi-latest",name:"Kimi Latest"},{id:"kimi-for-coding",name:"Kimi For Coding"}]},"kimi-coding":{id:"kimi-coding",alias:"kmc",format:"claude",executor:"default",baseUrl:"https://api.kimi.com/coding/v1/messages",urlSuffix:"?beta=true",authType:"oauth",authHeader:"x-api-key",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"},oauth:{clientIdEnv:"KIMI_CODING_OAUTH_CLIENT_ID",clientIdDefault:"17e5f671-d194-4dfb-9706-5516cb48c098",tokenUrl:"https://auth.kimi.com/api/oauth/token",refreshUrl:"https://auth.kimi.com/api/oauth/token",authUrl:"https://auth.kimi.com/api/oauth/device_authorization"},models:[{id:"kimi-k2.5",name:"Kimi K2.5"},{id:"kimi-k2.5-thinking",name:"Kimi K2.5 Thinking"},{id:"kimi-latest",name:"Kimi Latest"}]},kilocode:{id:"kilocode",alias:"kc",format:"openrouter",executor:"openrouter",baseUrl:"https://api.kilo.ai/api/openrouter/chat/completions",modelsUrl:"https://api.kilo.ai/api/openrouter/models",authType:"oauth",authHeader:"Authorization",authPrefix:"Bearer ",oauth:{initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},models:[{id:"openrouter/free",name:"Free Models Router"},{id:"qwen/qwen3-vl-235b-a22b-thinking",name:"Qwen3 VL 235B A22B Thinking"},{id:"qwen/qwen3-235b-a22b-thinking-2507",name:"Qwen3 235B A22B Thinking 2507"},{id:"qwen/qwen3-vl-30b-a3b-thinking",name:"Qwen3 VL 30B A3B Thinking"},{id:"stepfun/step-3.5-flash:free",name:"StepFun Step 3.5 Flash"},{id:"arcee-ai/trinity-large-preview:free",name:"Arcee AI Trinity Large Preview"},{id:"openai/gpt-4o-mini",name:"GPT-4o Mini"},{id:"openai/gpt-4.1-nano",name:"GPT-4.1 Nano"},{id:"openai/gpt-5-nano",name:"GPT-5 Nano"},{id:"openai/gpt-5-mini",name:"GPT-5 Mini"},{id:"anthropic/claude-3-haiku",name:"Claude 3 Haiku"},{id:"google/gemini-2.0-flash",name:"Gemini 2.0 Flash"},{id:"google/gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite"},{id:"deepseek/deepseek-chat-v3.1",name:"DeepSeek V3.1"},{id:"deepseek/deepseek-v3.2",name:"DeepSeek V3.2"},{id:"meta-llama/llama-3.3-70b-instruct",name:"Llama 3.3 70B"},{id:"meta-llama/llama-4-scout",name:"Llama 4 Scout"},{id:"meta-llama/llama-4-maverick",name:"Llama 4 Maverick"},{id:"qwen/qwen3-8b",name:"Qwen3 8B"},{id:"qwen/qwen3-32b",name:"Qwen3 32B"},{id:"qwen/qwen3-coder",name:"Qwen3 Coder 480B"},{id:"qwen/qwq-32b",name:"QwQ 32B"},{id:"mistralai/mistral-small-24b-instruct-2501",name:"Mistral Small 3"},{id:"mistralai/mistral-7b-instruct",name:"Mistral 7B"},{id:"x-ai/grok-code-fast-1",name:"Grok Code Fast 1"},{id:"moonshotai/kimi-k2.5",name:"Kimi K2.5"}],passthroughModels:!0},cline:{id:"cline",alias:"cl",format:"openai",executor:"openai",baseUrl:"https://api.cline.bot/api/v1/chat/completions",authType:"oauth",authHeader:"Authorization",authPrefix:"Bearer ",oauth:{tokenUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh",authUrl:"https://api.cline.bot/api/v1/auth/authorize"},extraHeaders:{"HTTP-Referer":"https://cline.bot","X-Title":"Cline"},models:[{id:"anthropic/claude-sonnet-4-20250514",name:"Claude Sonnet 4"},{id:"anthropic/claude-opus-4-20250514",name:"Claude Opus 4"},{id:"google/gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"google/gemini-2.5-flash",name:"Gemini 2.5 Flash"},{id:"openai/gpt-4.1",name:"GPT-4.1"},{id:"openai/o3",name:"o3"},{id:"deepseek/deepseek-chat",name:"DeepSeek Chat"}],passthroughModels:!0},minimax:{id:"minimax",alias:"minimax",format:"claude",executor:"default",baseUrl:"https://api.minimax.io/anthropic/v1/messages",urlSuffix:"?beta=true",authType:"apikey",authHeader:"x-api-key",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"},models:[{id:"MiniMax-M2.1",name:"MiniMax M2.1"}]},"minimax-cn":{id:"minimax-cn",alias:"minimax-cn",format:"claude",executor:"default",baseUrl:"https://api.minimaxi.com/anthropic/v1/messages",urlSuffix:"?beta=true",authType:"apikey",authHeader:"x-api-key",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"},models:[{id:"MiniMax-M2.1",name:"MiniMax M2.1"}]},deepseek:{id:"deepseek",alias:"ds",format:"openai",executor:"default",baseUrl:"https://api.deepseek.com/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"deepseek-chat",name:"DeepSeek V3.2 Chat"},{id:"deepseek-reasoner",name:"DeepSeek V3.2 Reasoner"}]},groq:{id:"groq",alias:"groq",format:"openai",executor:"default",baseUrl:"https://api.groq.com/openai/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"llama-3.3-70b-versatile",name:"Llama 3.3 70B"},{id:"meta-llama/llama-4-maverick-17b-128e-instruct",name:"Llama 4 Maverick"},{id:"qwen/qwen3-32b",name:"Qwen3 32B"},{id:"openai/gpt-oss-120b",name:"GPT-OSS 120B"}]},blackbox:{id:"blackbox",alias:"bb",format:"openai",executor:"default",baseUrl:"https://api.blackbox.ai/v1/chat/completions",modelsUrl:"https://api.blackbox.ai/v1/models",authType:"apikey",authHeader:"bearer",models:[{id:"gpt-4o",name:"GPT-4o"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash"},{id:"claude-sonnet-4",name:"Claude Sonnet 4"},{id:"deepseek-v3",name:"DeepSeek V3"},{id:"blackboxai",name:"Blackbox AI"},{id:"blackboxai-pro",name:"Blackbox AI Pro"}]},xai:{id:"xai",alias:"xai",format:"openai",executor:"default",baseUrl:"https://api.x.ai/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"grok-4",name:"Grok 4"},{id:"grok-4-fast-reasoning",name:"Grok 4 Fast Reasoning"},{id:"grok-code-fast-1",name:"Grok Code Fast"},{id:"grok-3",name:"Grok 3"}]},mistral:{id:"mistral",alias:"mistral",format:"openai",executor:"default",baseUrl:"https://api.mistral.ai/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"mistral-large-latest",name:"Mistral Large 3"},{id:"codestral-latest",name:"Codestral"},{id:"mistral-medium-latest",name:"Mistral Medium 3"}]},perplexity:{id:"perplexity",alias:"pplx",format:"openai",executor:"default",baseUrl:"https://api.perplexity.ai/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"sonar-pro",name:"Sonar Pro"},{id:"sonar",name:"Sonar"}]},together:{id:"together",alias:"together",format:"openai",executor:"default",baseUrl:"https://api.together.xyz/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"meta-llama/Llama-3.3-70B-Instruct-Turbo",name:"Llama 3.3 70B Turbo"},{id:"deepseek-ai/DeepSeek-R1",name:"DeepSeek R1"},{id:"Qwen/Qwen3-235B-A22B",name:"Qwen3 235B"},{id:"meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8",name:"Llama 4 Maverick"}]},fireworks:{id:"fireworks",alias:"fireworks",format:"openai",executor:"default",baseUrl:"https://api.fireworks.ai/inference/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"accounts/fireworks/models/deepseek-v3p1",name:"DeepSeek V3.1"},{id:"accounts/fireworks/models/llama-v3p3-70b-instruct",name:"Llama 3.3 70B"},{id:"accounts/fireworks/models/qwen3-235b-a22b",name:"Qwen3 235B"}]},cerebras:{id:"cerebras",alias:"cerebras",format:"openai",executor:"default",baseUrl:"https://api.cerebras.ai/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"gpt-oss-120b",name:"GPT OSS 120B"},{id:"zai-glm-4.7",name:"ZAI GLM 4.7"},{id:"llama-3.3-70b",name:"Llama 3.3 70B"},{id:"llama-4-scout-17b-16e-instruct",name:"Llama 4 Scout"},{id:"qwen-3-235b-a22b-instruct-2507",name:"Qwen3 235B A22B"},{id:"qwen-3-32b",name:"Qwen3 32B"}]},"ollama-cloud":{id:"ollama-cloud",alias:"ollamacloud",format:"openai",executor:"default",baseUrl:"https://api.ollama.com/v1/chat/completions",modelsUrl:"https://api.ollama.com/v1/models",authType:"apikey",authHeader:"bearer",models:[{id:"gemma3:27b",name:"Gemma 3 27B"},{id:"llama3.3:70b",name:"Llama 3.3 70B"},{id:"qwen3:72b",name:"Qwen3 72B"},{id:"devstral:24b",name:"Devstral 24B"},{id:"deepseek-r2:671b",name:"DeepSeek R2 671B"},{id:"phi4:14b",name:"Phi 4 14B"},{id:"mistral-small3.2:24b",name:"Mistral Small 3.2 24B"}],passthroughModels:!0},cohere:{id:"cohere",alias:"cohere",format:"openai",executor:"default",baseUrl:"https://api.cohere.com/v2/chat",authType:"apikey",authHeader:"bearer",models:[{id:"command-r-plus-08-2024",name:"Command R+ (Aug 2024)"},{id:"command-r-08-2024",name:"Command R (Aug 2024)"},{id:"command-a-03-2025",name:"Command A (Mar 2025)"}]},nvidia:{id:"nvidia",alias:"nvidia",format:"openai",executor:"default",baseUrl:"https://integrate.api.nvidia.com/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"moonshotai/kimi-k2.5",name:"Kimi K2.5"},{id:"z-ai/glm4.7",name:"GLM 4.7"},{id:"deepseek-ai/deepseek-v3.2",name:"DeepSeek V3.2"},{id:"nvidia/llama-3.3-70b-instruct",name:"Llama 3.3 70B"},{id:"meta/llama-4-maverick-17b-128e-instruct",name:"Llama 4 Maverick"},{id:"deepseek/deepseek-r1",name:"DeepSeek R1"}]},nebius:{id:"nebius",alias:"nebius",format:"openai",executor:"default",baseUrl:"https://api.tokenfactory.nebius.com/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"meta-llama/Llama-3.3-70B-Instruct",name:"Llama 3.3 70B Instruct"}]},siliconflow:{id:"siliconflow",alias:"siliconflow",format:"openai",executor:"default",baseUrl:"https://api.siliconflow.com/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"deepseek-ai/DeepSeek-V3.2",name:"DeepSeek V3.2"},{id:"deepseek-ai/DeepSeek-V3.1",name:"DeepSeek V3.1"},{id:"deepseek-ai/DeepSeek-R1",name:"DeepSeek R1"},{id:"Qwen/Qwen3-235B-A22B-Instruct-2507",name:"Qwen3 235B"},{id:"Qwen/Qwen3-Coder-480B-A35B-Instruct",name:"Qwen3 Coder 480B"},{id:"Qwen/Qwen3-32B",name:"Qwen3 32B"},{id:"moonshotai/Kimi-K2.5",name:"Kimi K2.5"},{id:"zai-org/GLM-4.7",name:"GLM 4.7"},{id:"openai/gpt-oss-120b",name:"GPT OSS 120B"},{id:"baidu/ERNIE-4.5-300B-A47B",name:"ERNIE 4.5 300B"}]},hyperbolic:{id:"hyperbolic",alias:"hyp",format:"openai",executor:"default",baseUrl:"https://api.hyperbolic.xyz/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"Qwen/QwQ-32B",name:"QwQ 32B"},{id:"deepseek-ai/DeepSeek-R1",name:"DeepSeek R1"},{id:"deepseek-ai/DeepSeek-V3",name:"DeepSeek V3"},{id:"meta-llama/Llama-3.3-70B-Instruct",name:"Llama 3.3 70B"},{id:"meta-llama/Llama-3.2-3B-Instruct",name:"Llama 3.2 3B"},{id:"Qwen/Qwen2.5-72B-Instruct",name:"Qwen 2.5 72B"},{id:"Qwen/Qwen2.5-Coder-32B-Instruct",name:"Qwen 2.5 Coder 32B"},{id:"NousResearch/Hermes-3-Llama-3.1-70B",name:"Hermes 3 70B"}]},huggingface:{id:"huggingface",alias:"hf",format:"openai",executor:"default",baseUrl:"https://router.huggingface.co/hf-inference/models/meta-llama/Meta-Llama-3.1-70B-Instruct/v1/chat/completions",authType:"apikey",authHeader:"bearer",models:[{id:"meta-llama/Meta-Llama-3.1-70B-Instruct",name:"Llama 3.1 70B Instruct"},{id:"meta-llama/Meta-Llama-3.1-8B-Instruct",name:"Llama 3.1 8B Instruct"},{id:"Qwen/Qwen2.5-72B-Instruct",name:"Qwen 2.5 72B"},{id:"mistralai/Mistral-7B-Instruct-v0.3",name:"Mistral 7B v0.3"},{id:"microsoft/Phi-3.5-mini-instruct",name:"Phi-3.5 Mini"}]},vertex:{id:"vertex",alias:"vertex",format:"gemini",executor:"default",baseUrl:"https://us-central1-aiplatform.googleapis.com/v1/projects",urlBuilder:(e,a,i)=>`https://generativelanguage.googleapis.com/v1beta/models/${a}:${i?"streamGenerateContent?alt=sse":"generateContent"}`,authType:"apikey",authHeader:"bearer",models:[{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro (Vertex)"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash (Vertex)"},{id:"gemini-2.0-flash-thinking-exp",name:"Gemini 2.0 Flash Thinking Exp (Vertex)"},{id:"gemma-2-27b-it",name:"Gemma 2 27B (Vertex)"},{id:"claude-opus-4-5@20251101",name:"Claude Opus 4.5 (Vertex)"},{id:"claude-sonnet-4-5@20251101",name:"Claude Sonnet 4.5 (Vertex)"}]}},o=new Map;for(let e of Object.values(t))e.alias&&e.alias!==e.id&&o.set(e.alias,e);let n=function(){let e={};for(let a of Object.values(t))if(a.models&&a.models.length>0){let i=a.alias||a.id;e[i]||(e[i]=a.models)}return e}(),r=function(){let e={};for(let a of Object.values(t))e[a.id]=a.alias||a.id;return e}();function s(e){return n[r[e]||e]||[]}},52529:(e,a,i)=>{i.d(a,{Q2:()=>t.Q2,fg:()=>t.fg,vQ:()=>o,MA:()=>t.MA,zN:()=>t.zN,B2:()=>n});var t=i(20909);i(81135);let o={name:"OmniRoute",description:"AI Gateway for Multi-Provider LLMs",version:"2.5.0"},n={storageKey:"theme",defaultTheme:"system"}},55846:(e,a,i)=>{i.d(a,{ThemeProvider:()=>r});var t=i(95155),o=i(12115),n=i(76851);function r({children:e}){let{initTheme:a}=(0,n.A)();return(0,o.useEffect)(()=>{a()},[a]),(0,t.jsx)(t.Fragment,{children:e})}},76851:(e,a,i)=>{i.d(a,{A:()=>c,F:()=>s});var t=i(1934),o=i(31692),n=i(52529);let r=(0,t.v)()((0,o.Zr)((e,a)=>({theme:n.B2.defaultTheme,colorTheme:"coral",customColor:"#3b82f6",setTheme:a=>{e({theme:a}),l(a)},setColorTheme:i=>{e({colorTheme:i}),m(i,a().customColor)},setCustomColorTheme:a=>{let i=d(a);e({colorTheme:"custom",customColor:i}),m("custom",i)},toggleTheme:()=>{let i="dark"===a().theme?"light":"dark";e({theme:i}),l(i)},initTheme:()=>{let{theme:e,colorTheme:i,customColor:t}=a();l(e),m(i,t)}}),{name:n.B2.storageKey})),s={coral:"#e54d5e",blue:"#3b82f6",red:"#ef4444",green:"#22c55e",violet:"#8b5cf6",orange:"#f97316",cyan:"#06b6d4"};function l(e){let a=document.documentElement,i=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";"dark"===("system"===e?i:e)?a.classList.add("dark"):a.classList.remove("dark")}function m(e,a){let i,t,o,n,r,l,m=document.documentElement,c="custom"===e?d(a):s[e]||s.coral,p=(t=parseInt((i=d(c).slice(1)).slice(0,2),16),o=parseInt(i.slice(2,4),16),n=parseInt(i.slice(4,6),16),r=e=>{let a=Math.round((0-e)*Math.abs(-.14));return Math.max(0,Math.min(255,e-a))},l=e=>e.toString(16).padStart(2,"0"),`#${l(r(t))}${l(r(o))}${l(r(n))}`);m.style.setProperty("--color-primary",c),m.style.setProperty("--color-primary-hover",p)}function d(e){let a=(e||"").trim(),i=a.startsWith("#")?a:`#${a}`;return/^#([0-9a-fA-F]{6})$/.test(i)?i.toLowerCase():"#3b82f6"}let c=r},81135:(e,a,i)=>{i.d(a,{KC:()=>t.KC,Xg:()=>t.Xg});var t=i(35144);Object.entries(i(20909).Q2).filter(([,e])=>e.passthroughModels).map(([e])=>e),Object.entries(t.vq).flatMap(([e,a])=>a.map(a=>({provider:e,model:a.id,name:a.name})))}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[174,204,335,449,516,552,712,747,748,853,907,931,992,1070,1097,1110,1150,1288,1450,1451,1512,1566,1624,1625,1666,1701,1860,1873,1910,1949,2067,2121,2296,2310,2398,2410,2687,2708,2720,2797,2969,2970,3008,3015,3025,3038,3079,3102,3111,3246,3254,3394,3461,3471,3472,3499,3549,3585,3665,3857,3954,4062,4120,4286,4503,4554,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5266,5396,5466,5568,5616,5677,5693,5696,5730,5745,5867,5922,5982,6105,6162,6217,6268,6392,6442,6479,6529,6580,6671,6740,6819,6853,6988,6996,7176,7241,7249,7295,7346,7429,7442,7457,7473,7520,7545,7597,7607,7741,7758,7791,7855,7892,7899,7957,8167,8198,8199,8207,8246,8406,8453,8461,8489,8573,8592,8611,8648,8777,8809,8814,8870,8948,8974,8975,9027,9049,9069,9088,9097,9139,9141,9214,9321,9370,9389,9461,9492,9794,9998],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{3751:(e,t,r)=>{Promise.resolve().then(r.bind(r,88618))},40993:(e,t,r)=>{"use strict";r.d(t,{Ex:()=>d.default,$n:()=>s.default,Zp:()=>l.default,Qv:()=>n.CardSkeleton,G9:()=>y.default,bQ:()=>C.default,pp:()=>j.default,Qn:()=>N.default,pd:()=>a.default,Mh:()=>b.default,uR:()=>u.default,aF:()=>o.default,rq:()=>m.default,LF:()=>p.default,KN:()=>f.default,Lo:()=>g.default,y7:()=>h.default,Iz:()=>v.default,l6:()=>i.default,lM:()=>c.default,cn:()=>x.default});var s=r(35806),a=r(34422),i=r(42994),l=r(81060),o=r(71361),n=r(92542);r(17705);var d=r(80927),c=r(19790);r(6261),r(55846),r(34243),r(89938),r(99023);var p=r(80178),m=r(85444),u=r(91961);r(25112);var x=r(45624),h=r(37415),f=r(48643),g=r(8287);r(1652);var b=r(92701);r(18150);var y=r(71689),v=r(33709);r(76332);var j=r(66200);r(61580);var N=r(51503);r(54128);var C=r(44638);r(21720),r(97050)},88618:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>g});var s=r(95155),a=r(12115),i=r(67671),l=r(14051),o=r.n(l),n=r(73321),d=r(98500),c=r.n(d),p=r(5772),m=r(50910),u=r(40993),x=r(20909),h=r(81135),f=r(30949);function g(){let e=(0,n.useParams)(),t=(0,n.useRouter)(),r=e.id,[l,o]=(0,a.useState)([]),[d,g]=(0,a.useState)(!0),[v,C]=(0,a.useState)(null),[k,A]=(0,a.useState)(!1),[$,R]=(0,a.useState)(!1),[M,P]=(0,a.useState)(!1),[I,O]=(0,a.useState)(!1),[_,K]=(0,a.useState)(null),[F,q]=(0,a.useState)(null),[U,L]=(0,a.useState)({}),[D,z]=(0,a.useState)(!1),{copied:J,copy:B}=(0,f.C)(),W=(0,m.c)("providers"),V=(0,a.useRef)(!1),H=(0,a.useRef)(!1),[Q,G]=(0,a.useState)(null),[Z,Y]=(0,a.useState)(null),[X,ee]=(0,a.useState)(!1),[et,er]=(0,a.useState)(!1),[es,ea]=(0,a.useState)({current:0,total:0,phase:"idle",status:"",logs:[],error:"",importedCount:0}),ei=v?{id:v.id,name:v.name||("anthropic-compatible"===v.type?W("anthropicCompatibleName"):W("openaiCompatibleName")),color:"anthropic-compatible"===v.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===v.type?"AC":"OC",apiType:v.apiType,baseUrl:v.baseUrl,type:v.type}:x.IS[r]||x.zN[r]||x.fg[r],el=!!x.IS[r]||!!x.zN[r],eo=(0,h.KC)(r),en=(0,x.wG)(r),ed=(0,x.mq)(r),ec=(0,x.gb)(r),ep=ed||ec,em=ep?r:en,eu=ep?v?.prefix||r:en,ex=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&L(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),eh=(0,a.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"})]),s=await e.json(),a=await t.json();if(e.ok){let e=(s.connections||[]).filter(e=>e.provider===r);o(e)}if(t.ok){let e=(a.nodes||[]).find(e=>e.id===r)||null;if(!e&&ep)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===r)||null))break}C(e)}}catch(e){console.log("Error fetching connections:",e)}finally{g(!1)}},[r,ep]),ef=async e=>{try{let t=await fetch(`/api/provider-nodes/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(C(s.node),await eh(),O(!1))}catch(e){console.log("Error updating provider node:",e)}};(0,a.useEffect)(()=>{eh(),ex(),fetch("/api/settings/proxy").then(e=>e.ok?e.json():null).then(e=>Y(e)).catch(()=>{})},[eh,ex]),(0,a.useEffect)(()=>{d||0!==l.length||!ei||ep||V.current||H.current||(V.current=!0,el?A(!0):R(!0))},[d]);let eg=async(e,t,r=en)=>{let s=`${r}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:s,alias:t})});if(e.ok)await ex();else{let t=await e.json();alert(t.error||W("failedSetAlias"))}}catch(e){console.log("Error setting alias:",e)}},eb=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await ex()}catch(e){console.log("Error deleting alias:",e)}},ey=async e=>{if(confirm(W("deleteConnectionConfirm")))try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&o(l.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}},ev=(0,a.useCallback)(()=>{eh(),A(!1)},[eh]),ej=async e=>{try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,...e})});if(t.ok)return await eh(),R(!1),null;let s=await t.json().catch(()=>({}));return s.error?.message||s.error||W("failedSaveConnection")}catch(e){return console.log("Error saving connection:",e),W("failedSaveConnectionRetry")}},eN=async e=>{try{(await fetch(`/api/providers/${_.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eh(),P(!1))}catch(e){console.log("Error updating connection:",e)}},eC=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&o(r=>r.map(r=>r.id===e?{...r,isActive:t}:r))}catch(e){console.log("Error updating connection status:",e)}},ek=async(e,t)=>{try{(await fetch("/api/rate-limits",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,enabled:t})})).ok&&o(r=>r.map(r=>r.id===e?{...r,rateLimitProtection:t}:r))}catch(e){console.error("Error toggling rate limit:",e)}},ew=async e=>{if(e&&!F){q(e);try{let t=await fetch(`/api/providers/${e}/test`,{method:"POST"});if(!t.ok){let e=await t.json().catch(()=>({}));alert(e.error||W("failedRetestConnection"));return}await eh()}catch(e){console.error("Error retesting connection:",e)}finally{q(null)}}},[eS,eT]=(0,a.useState)(null),eE=(0,i.i)(),eA=async e=>{if(!eS){eT(e);try{let t=await fetch(`/api/providers/${e}/refresh`,{method:"POST"}),r=await t.json().catch(()=>({}));t.ok&&r.success?(eE.success(W("tokenRefreshed")),await eh()):eE.error(r.error||W("tokenRefreshFailed"))}catch(e){console.error("Error refreshing token:",e),eE.error(W("tokenRefreshFailed"))}finally{eT(null)}}},e$=async(e,t)=>{if(e&&t)try{let r=t.priority,s=e.priority;r===s&&(r=l.indexOf(e)>l.indexOf(t)?t.priority-.5:t.priority+.5),await Promise.all([fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:r})}),fetch(`/api/providers/${t.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:s})})]),await eh()}catch(e){console.log("Error swapping priority:",e)}},eR=async()=>{if(X)return;let e=l.find(e=>!1!==e.isActive);if(e){ee(!0),er(!0),ea({current:0,total:0,phase:"fetching",status:W("fetchingModels"),logs:[],error:"",importedCount:0});try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void ea(e=>({...e,phase:"error",status:W("failedFetchModels"),error:s.error||W("failedImportModels")}));let a=s.models||[];if(0===a.length)return void ea(e=>({...e,phase:"done",status:W("noModelsFound"),logs:[W("noModelsReturnedFromEndpoint")]}));ea(e=>({...e,phase:"importing",total:a.length,status:W("importingModelsProgress",{current:0,total:a.length}),logs:[W("foundModelsStartingImport",{count:a.length})]}));let i=0;for(let e=0;e<a.length;e++){let t=a[e],s=t.id||t.name||t.model;if(!s)continue;let l=s.split("/"),o=l[l.length-1];ea(t=>({...t,current:e+1,status:W("importingModelsProgress",{current:e+1,total:a.length}),logs:[...t.logs,W("importingModelById",{modelId:s})]})),await fetch("/api/provider-models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,modelId:s,modelName:t.name||s,source:"imported"})}),U[o]||await eg(s,o,em),i+=1}await ex(),ea(e=>({...e,phase:"done",current:a.length,status:i>0?W("importSuccessCount",{count:i}):W("noNewModelsAddedExisting"),logs:[...e.logs,i>0?W("importDoneCount",{count:i}):W("noNewModelsAdded")],importedCount:i})),i>0&&setTimeout(()=>{window.location.reload()},2e3)}catch(e){console.log("Error importing models:",e),ea(t=>({...t,phase:"error",status:W("importFailed"),error:e instanceof Error?e.message:W("unexpectedErrorOccurred")}))}finally{ee(!1)}}},eM=async(e,t)=>{er(!0),ea({current:0,total:0,phase:"fetching",status:W("fetchingModels"),logs:[],error:"",importedCount:0});try{let r=(await e()).models||[];if(0===r.length)return void ea(e=>({...e,phase:"done",status:W("noModelsFound"),logs:[W("noModelsReturnedFromEndpoint")]}));ea(e=>({...e,phase:"importing",total:r.length,status:W("importingModelsProgress",{current:0,total:r.length}),logs:[W("foundModelsStartingImport",{count:r.length})]}));let s=0;for(let e=0;e<r.length;e++){let a=r[e],i=a.id||a.name||a.model;i&&(ea(t=>({...t,current:e+1,status:W("importingModelsProgress",{current:e+1,total:r.length}),logs:[...t.logs,W("importingModelById",{modelId:i})]})),await t(a)&&(s+=1))}ea(e=>({...e,phase:"done",current:r.length,status:s>0?W("importSuccessCount",{count:s}):W("noNewModelsAdded"),logs:[...e.logs,s>0?W("importDoneCount",{count:s}):W("noNewModelsAdded")],importedCount:s})),s>0&&setTimeout(()=>{window.location.reload()},2e3)}catch(e){console.log("Error importing models:",e),ea(t=>({...t,phase:"error",status:W("importFailed"),error:e instanceof Error?e.message:W("unexpectedErrorOccurred")}))}},eP=l.some(e=>!1!==e.isActive);return d?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsx)(u.Qv,{}),(0,s.jsx)(u.Qv,{})]}):ei?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)(c(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),W("backToProviders")]}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)("div",{className:"rounded-lg flex items-center justify-center",style:{backgroundColor:`${ei.color}15`},children:D?(0,s.jsx)("span",{className:"text-sm font-bold",style:{color:ei.color},children:ei.textIcon||ei.id.slice(0,2).toUpperCase()}):(0,s.jsx)(p.default,{src:ed&&ei.apiType?"responses"===ei.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":ec?"/providers/anthropic-m.png":`/providers/${ei.id}.png`,alt:ei.name,width:48,height:48,className:"object-contain rounded-lg max-w-[48px] max-h-[48px]",sizes:"48px",onError:()=>z(!0)})}),(0,s.jsxs)("div",{children:[ei.website?(0,s.jsxs)("a",{href:ei.website,target:"_blank",rel:"noopener noreferrer",className:"text-3xl font-semibold tracking-tight hover:underline inline-flex items-center gap-2",style:{color:ei.color},children:[ei.name,(0,s.jsx)("span",{className:"material-symbols-outlined text-lg opacity-60",children:"open_in_new"})]}):(0,s.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:ei.name}),(0,s.jsx)("p",{className:"text-text-muted",children:W("connectionCountLabel",{count:l.length})})]})]})]}),ep&&v&&(0,s.jsxs)(u.Zp,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:ec?W("anthropicCompatibleDetails"):W("openaiCompatibleDetails")}),(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:[ec?W("messagesApi"):"responses"===v.apiType?W("responsesApi"):W("chatCompletions")," ","\xb7 ",(v.baseUrl||"").replace(/\/$/,""),"/",ec?W("messagesPath"):"responses"===v.apiType?W("responsesPath"):W("chatCompletionsPath")]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(u.$n,{size:"sm",icon:"add",onClick:()=>R(!0),disabled:l.length>0,children:W("add")}),(0,s.jsx)(u.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>O(!0),children:W("edit")}),(0,s.jsx)(u.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{if(confirm(W("deleteCompatibleNodeConfirm",{type:ec?W("anthropic"):W("openai")})))try{(await fetch(`/api/provider-nodes/${r}`,{method:"DELETE"})).ok&&t.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}},children:W("delete")})]})]}),l.length>0&&(0,s.jsx)("p",{className:"text-sm text-text-muted",children:W("singleConnectionPerCompatible")})]}),(0,s.jsxs)(u.Zp,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:W("connections")}),(0,s.jsxs)("button",{onClick:()=>G({level:"provider",id:r,label:ei?.name||r}),className:`inline-flex items-center gap-1 px-2 py-1 rounded text-xs font-medium transition-all ${Z?.providers?.[r]?"bg-amber-500/15 text-amber-500 hover:bg-amber-500/25":"bg-black/[0.03] dark:bg-white/[0.03] text-text-muted/50 hover:text-text-muted hover:bg-black/[0.06] dark:hover:bg-white/[0.06]"}`,title:Z?.providers?.[r]?W("providerProxyTitleConfigured",{host:Z.providers[r].host||W("configured")}):W("providerProxyConfigureHint"),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"vpn_lock"}),Z?.providers?.[r]&&Z.providers[r].host||W("providerProxy")]})]}),ep?0===l.length&&(0,s.jsx)(u.$n,{size:"sm",icon:"add",onClick:()=>R(!0),children:W("add")}):(0,s.jsx)(u.$n,{size:"sm",icon:"add",onClick:()=>el?A(!0):R(!0),children:W("add")})]}),0===l.length?(0,s.jsxs)("div",{className:"text-center py-12",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:el?"lock":"key"})}),(0,s.jsx)("p",{className:"text-text-main font-medium mb-1",children:W("noConnectionsYet")}),(0,s.jsx)("p",{className:"text-sm text-text-muted mb-4",children:W("addFirstConnectionHint")}),!ep&&(0,s.jsx)(u.$n,{icon:"add",onClick:()=>el?A(!0):R(!0),children:W("addConnection")})]}):(0,s.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:l.sort((e,t)=>(e.priority||0)-(t.priority||0)).map((e,t)=>(0,s.jsx)(w,{connection:e,isOAuth:el,isFirst:0===t,isLast:t===l.length-1,onMoveUp:()=>e$(e,l[t-1]),onMoveDown:()=>e$(e,l[t+1]),onToggleActive:t=>eC(e.id,t),onToggleRateLimit:t=>ek(e.id,t),onRetest:()=>ew(e.id),isRetesting:F===e.id,onEdit:()=>{K(e),P(!0)},onDelete:()=>ey(e.id),onReauth:el?()=>A(!0):void 0,onRefreshToken:el?()=>eA(e.id):void 0,isRefreshing:eS===e.id,onProxy:()=>G({level:"key",id:e.id,label:e.name||e.email||e.id}),hasProxy:!!(Z?.keys?.[e.id]||Z?.providers?.[r]||Z?.global),proxySource:Z?.keys?.[e.id]?"key":Z?.providers?.[r]?"provider":Z?.global?"global":null,proxyHost:(Z?.keys?.[e.id]||Z?.providers?.[r]||Z?.global)?.host||null},e.id))})]}),(0,s.jsxs)(u.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:W("availableModels")}),(()=>{if(ep)return(0,s.jsx)(N,{providerStorageAlias:em,providerDisplayAlias:eu,modelAliases:U,copied:J,onCopy:B,onSetAlias:eg,onDeleteAlias:eb,connections:l,isAnthropic:ec,onImportWithProgress:eM});if(ei.passthroughModels)return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,s.jsx)(u.$n,{size:"sm",variant:"secondary",icon:"download",onClick:eR,disabled:!eP||X,children:X?W("importingModels"):W("importFromModels")}),!eP&&(0,s.jsx)("span",{className:"text-xs text-text-muted",children:W("addConnectionToImport")})]}),(0,s.jsx)(y,{providerAlias:en,modelAliases:U,copied:J,onCopy:B,onSetAlias:eg,onDeleteAlias:eb})]});let e=(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,s.jsx)(u.$n,{size:"sm",variant:"secondary",icon:"download",onClick:eR,disabled:!eP||X,children:X?W("importingModels"):W("importFromModels")}),!eP&&(0,s.jsx)("span",{className:"text-xs text-text-muted",children:W("addConnectionToImport")})]});return 0===eo.length?(0,s.jsxs)("div",{children:[e,(0,s.jsx)("p",{className:"text-sm text-text-muted",children:W("noModelsConfigured")})]}):(0,s.jsxs)("div",{children:[e,(0,s.jsx)("div",{className:"flex flex-wrap gap-3",children:eo.map(e=>{let t=`${em}/${e.id}`,a=`${r}/${e.id}`,i=Object.entries(U).find(([,e])=>e===t||e===a)?.[0];return(0,s.jsx)(b,{model:e,fullModel:`${eu}/${e.id}`,alias:i,copied:J,onCopy:B,onSetAlias:t=>eg(e.id,t,em),onDeleteAlias:()=>eb(i)},e.id)})})]})})(),!ep&&(0,s.jsx)(j,{providerId:r,providerAlias:eu,copied:J,onCopy:B})]}),"kiro"===r?(0,s.jsx)(u.Mh,{isOpen:k,providerInfo:ei,onSuccess:ev,onClose:()=>{H.current=!0,A(!1)}}):"cursor"===r?(0,s.jsx)(u.G9,{isOpen:k,onSuccess:ev,onClose:()=>{H.current=!0,A(!1)}}):(0,s.jsx)(u.LF,{isOpen:k,provider:r,providerInfo:ei,onSuccess:ev,onClose:()=>{H.current=!0,A(!1)}}),(0,s.jsx)(S,{isOpen:$,provider:r,providerName:ei.name,isCompatible:ep,isAnthropic:ec,onSave:ej,onClose:()=>R(!1)}),(0,s.jsx)(T,{isOpen:M,connection:_,onSave:eN,onClose:()=>P(!1)}),ep&&(0,s.jsx)(E,{isOpen:I,node:v,onSave:ef,onClose:()=>O(!1),isAnthropic:ec}),Q&&(0,s.jsx)(u.KN,{isOpen:!!Q,onClose:()=>G(null),level:Q.level,levelId:Q.id,levelLabel:Q.label}),(0,s.jsx)(u.aF,{isOpen:et,onClose:()=>{("done"===es.phase||"error"===es.phase)&&er(!1)},title:W("importingModelsTitle"),size:"md",closeOnOverlay:!1,showCloseButton:"done"===es.phase||"error"===es.phase,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:["fetching"===es.phase&&(0,s.jsx)("span",{className:"material-symbols-outlined text-primary animate-spin",children:"progress_activity"}),"importing"===es.phase&&(0,s.jsx)("span",{className:"material-symbols-outlined text-primary animate-spin",children:"progress_activity"}),"done"===es.phase&&(0,s.jsx)("span",{className:"material-symbols-outlined text-green-500",children:"check_circle"}),"error"===es.phase&&(0,s.jsx)("span",{className:"material-symbols-outlined text-red-500",children:"error"}),(0,s.jsx)("span",{className:"text-sm font-medium text-text-main",children:es.status})]}),("importing"===es.phase||"done"===es.phase)&&es.total>0&&(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:[es.current," / ",es.total]}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:[Math.round(es.current/es.total*100),"%"]})]}),(0,s.jsx)("div",{className:"w-full h-2.5 bg-black/10 dark:bg-white/10 rounded-full overflow-hidden",children:(0,s.jsx)("div",{className:"h-full rounded-full transition-all duration-300 ease-out",style:{width:`${es.current/es.total*100}%`,background:"done"===es.phase?"linear-gradient(90deg, #22c55e, #16a34a)":"linear-gradient(90deg, var(--color-primary), var(--color-primary-hover, var(--color-primary)))"}})})]}),"fetching"===es.phase&&(0,s.jsx)("div",{className:"w-full h-2.5 bg-black/10 dark:bg-white/10 rounded-full overflow-hidden",children:(0,s.jsx)("div",{className:"h-full rounded-full animate-pulse",style:{width:"60%",background:"linear-gradient(90deg, var(--color-primary), var(--color-primary-hover, var(--color-primary)))"}})}),"error"===es.phase&&es.error&&(0,s.jsx)("div",{className:"p-3 rounded-lg bg-red-500/10 border border-red-500/20",children:(0,s.jsx)("p",{className:"text-sm text-red-400",children:es.error})}),es.logs.length>0&&(0,s.jsx)("div",{className:"max-h-48 overflow-y-auto rounded-lg bg-black/5 dark:bg-white/5 p-3 border border-black/5 dark:border-white/5",children:(0,s.jsx)("div",{className:"flex flex-col gap-1",children:es.logs.map((e,t)=>(0,s.jsx)("p",{className:`text-xs font-mono ${e.startsWith("✓")?"text-green-500 font-semibold":"text-text-muted"}`,children:e},t))})}),"done"===es.phase&&es.importedCount>0&&(0,s.jsx)("p",{className:"text-xs text-text-muted text-center animate-pulse",children:W("pageAutoRefresh")})]})})]}):(0,s.jsxs)("div",{className:"text-center py-20",children:[(0,s.jsx)("p",{className:"text-text-muted",children:W("providerNotFound")}),(0,s.jsx)(c(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:W("backToProviders")})]})}function b({model:e,fullModel:t,alias:r,copied:a,onCopy:i,onSetAlias:l,onDeleteAlias:o}){let n=(0,m.c)("providers");return(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg border border-border hover:bg-sidebar/50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:"smart_toy"}),(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,s.jsx)("button",{onClick:()=>i(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",title:n("copyModel"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})})]})}function y({providerAlias:e,modelAliases:t,copied:r,onCopy:i,onSetAlias:l,onDeleteAlias:o}){let n=(0,m.c)("providers"),[d,c]=(0,a.useState)(""),[p,x]=(0,a.useState)(!1),h=Object.entries(t).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,r])=>({modelId:r.replace(`${e}/`,""),fullModel:r,alias:t})),f=async()=>{let e;if(!d.trim()||p)return;let r=d.trim(),s=(e=r.split("/"))[e.length-1];if(t[s])return void alert(n("aliasExistsAlert",{alias:s}));x(!0);try{await l(r,s),c("")}catch(e){console.log("Error adding model:",e)}finally{x(!1)}};return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:n("openRouterAnyModelHint")}),(0,s.jsxs)("div",{className:"flex items-end gap-2",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{htmlFor:"new-model-input",className:"text-xs text-text-muted mb-1 block",children:n("modelIdFromOpenRouter")}),(0,s.jsx)("input",{id:"new-model-input",type:"text",value:d,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&f(),placeholder:n("openRouterModelPlaceholder"),className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,s.jsx)(u.$n,{size:"sm",icon:"add",onClick:f,disabled:!d.trim()||p,children:p?n("adding"):n("add")})]}),h.length>0&&(0,s.jsx)("div",{className:"flex flex-col gap-3",children:h.map(({modelId:e,fullModel:t,alias:a})=>(0,s.jsx)(v,{modelId:e,fullModel:t,copied:r,onCopy:i,onDeleteAlias:()=>o(a)},t))})]})}function v({modelId:e,fullModel:t,copied:r,onCopy:a,onDeleteAlias:i}){let l=(0,m.c)("providers");return(0,s.jsxs)("div",{className:"flex items-center gap-3 p-3 rounded-lg border border-border hover:bg-sidebar/50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:"smart_toy"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,s.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,s.jsx)("button",{onClick:()=>a(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",title:l("copyModel"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:r===`model-${e}`?"check":"content_copy"})})]})]}),(0,s.jsx)("button",{onClick:i,className:"p-1 hover:bg-red-50 rounded text-red-500",title:l("removeModel"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function j({providerId:e,providerAlias:t,copied:r,onCopy:l}){let o=(0,m.c)("providers"),n=(0,i.i)(),[d,c]=(0,a.useState)([]),[p,x]=(0,a.useState)(""),[h,f]=(0,a.useState)(""),[g,b]=(0,a.useState)("chat-completions"),[y,v]=(0,a.useState)(["chat"]),[j,N]=(0,a.useState)(!1),[C,k]=(0,a.useState)(!0),[w,S]=(0,a.useState)(null),[T,E]=(0,a.useState)("chat-completions"),[A,$]=(0,a.useState)(["chat"]),[R,M]=(0,a.useState)(null),P=(0,a.useCallback)(async()=>{try{let t=await fetch(`/api/provider-models?provider=${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();c(e.models||[])}}catch(e){console.error("Failed to fetch custom models:",e)}finally{k(!1)}},[e]);(0,a.useEffect)(()=>{P()},[P]);let I=async()=>{if(p.trim()&&!j){N(!0);try{(await fetch("/api/provider-models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,modelId:p.trim(),modelName:h.trim()||void 0,apiFormat:g,supportedEndpoints:y})})).ok&&(x(""),f(""),b("chat-completions"),v(["chat"]),await P())}catch(e){console.error("Failed to add custom model:",e)}finally{N(!1)}}},O=async t=>{try{await fetch(`/api/provider-models?provider=${encodeURIComponent(e)}&model=${encodeURIComponent(t)}`,{method:"DELETE"}),await P()}catch(e){console.error("Failed to remove custom model:",e)}},_=()=>{S(null),E("chat-completions"),$(["chat"]),M(null)},K=async t=>{if(w&&w===t){if(!A.length)return void n.error("Select at least one supported endpoint");M(t);try{let r=d.find(e=>e.id===t);if(!(await fetch("/api/provider-models",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,modelId:t,modelName:r?.name||t,source:r?.source||"manual",apiFormat:T,supportedEndpoints:A})})).ok)throw Error("Failed to save model endpoint settings");await P(),n.success("Saved model endpoint settings"),_()}catch(e){console.error("Failed to save custom model:",e),n.error("Failed to save model endpoint settings")}finally{M(null)}}};return(0,s.jsxs)("div",{className:"mt-6 pt-6 border-t border-border",children:[(0,s.jsxs)("h3",{className:"text-sm font-semibold mb-3 flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-primary",children:"tune"}),o("customModels")]}),(0,s.jsx)("p",{className:"text-xs text-text-muted mb-3",children:o("customModelsHint")}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 mb-3",children:[(0,s.jsxs)("div",{className:"flex items-end gap-2",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{htmlFor:"custom-model-id",className:"text-xs text-text-muted mb-1 block",children:o("modelId")}),(0,s.jsx)("input",{id:"custom-model-id",type:"text",value:p,onChange:e=>x(e.target.value),onKeyDown:e=>"Enter"===e.key&&I(),placeholder:o("customModelPlaceholder"),className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,s.jsxs)("div",{className:"w-40",children:[(0,s.jsx)("label",{htmlFor:"custom-model-name",className:"text-xs text-text-muted mb-1 block",children:o("displayName")}),(0,s.jsx)("input",{id:"custom-model-name",type:"text",value:h,onChange:e=>f(e.target.value),onKeyDown:e=>"Enter"===e.key&&I(),placeholder:o("optional"),className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,s.jsx)(u.$n,{size:"sm",icon:"add",onClick:I,disabled:!p.trim()||j,children:j?o("adding"):o("add")})]}),(0,s.jsxs)("div",{className:"flex items-end gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"w-48",children:[(0,s.jsx)("label",{htmlFor:"custom-api-format",className:"text-xs text-text-muted mb-1 block",children:"API Format"}),(0,s.jsxs)("select",{id:"custom-api-format",value:g,onChange:e=>b(e.target.value),className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"chat-completions",children:"Chat Completions"}),(0,s.jsx)("option",{value:"responses",children:"Responses API"})]})]}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted mb-1 block",children:"Supported Endpoints"}),(0,s.jsx)("div",{className:"flex items-center gap-3",children:["chat","embeddings","images","audio"].map(e=>(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-text-main cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",checked:y.includes(e),onChange:t=>{t.target.checked?v(t=>[...t,e]):v(t=>t.filter(t=>t!==e))},className:"rounded border-border"}),"chat"===e?"\uD83D\uDCAC Chat":"embeddings"===e?"\uD83D\uDCD0 Embeddings":"images"===e?"\uD83D\uDDBC️ Images":"\uD83D\uDD0A Audio"]},e))})]})]})]}),C?(0,s.jsx)("p",{className:"text-xs text-text-muted",children:o("loading")}):d.length>0?(0,s.jsx)("div",{className:"flex flex-col gap-2",children:d.map(e=>{let a=`${t}/${e.id}`,i=`custom-${e.id}`;return(0,s.jsxs)("div",{className:"flex items-center gap-3 p-3 rounded-lg border border-border hover:bg-sidebar/50",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-primary",children:"tune"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:e.name||e.id}),(0,s.jsxs)("div",{className:"flex items-center gap-1 mt-1 flex-wrap",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:a}),(0,s.jsx)("button",{onClick:()=>l(a,i),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",title:o("copyModel"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:r===i?"check":"content_copy"})}),"responses"===e.apiFormat&&(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-blue-500/15 text-blue-400 font-medium",children:"Responses"}),e.supportedEndpoints?.includes("embeddings")&&(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-purple-500/15 text-purple-400 font-medium",children:"\uD83D\uDCD0 Embed"}),e.supportedEndpoints?.includes("images")&&(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-amber-500/15 text-amber-400 font-medium",children:"\uD83D\uDDBC️ Images"}),e.supportedEndpoints?.includes("audio")&&(0,s.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-green-500/15 text-green-400 font-medium",children:"\uD83D\uDD0A Audio"})]}),w===e.id&&(0,s.jsxs)("div",{className:"mt-3 p-3 rounded-lg border border-border bg-sidebar/40",children:[(0,s.jsxs)("div",{className:"flex items-end gap-3 flex-wrap",children:[(0,s.jsxs)("div",{className:"w-44",children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"API Format"}),(0,s.jsxs)("select",{value:T,onChange:e=>E(e.target.value),className:"w-full px-2.5 py-2 text-xs border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"chat-completions",children:"Chat Completions"}),(0,s.jsx)("option",{value:"responses",children:"Responses API"})]})]}),(0,s.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted mb-1 block",children:"Supported Endpoints"}),(0,s.jsx)("div",{className:"flex items-center gap-3 flex-wrap",children:["chat","embeddings","images","audio"].map(e=>(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-text-main cursor-pointer",children:[(0,s.jsx)("input",{type:"checkbox",checked:A.includes(e),onChange:t=>{t.target.checked?$(t=>t.includes(e)?t:[...t,e]):$(t=>t.filter(t=>t!==e))},className:"rounded border-border"}),"chat"===e?"\uD83D\uDCAC Chat":"embeddings"===e?"\uD83D\uDCD0 Embeddings":"images"===e?"\uD83D\uDDBC️ Images":"\uD83D\uDD0A Audio"]},e))})]})]}),(0,s.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,s.jsx)(u.$n,{size:"sm",onClick:()=>K(e.id),disabled:R===e.id,children:R===e.id?o("saving"):o("save")}),(0,s.jsx)(u.$n,{size:"sm",variant:"ghost",onClick:_,children:o("cancel")})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("button",{onClick:()=>{S(e.id),E(e.apiFormat||"chat-completions"),$(Array.isArray(e.supportedEndpoints)&&e.supportedEndpoints.length?e.supportedEndpoints:["chat"])},className:"p-1 hover:bg-sidebar rounded text-text-muted hover:text-primary",title:o("edit"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"edit"})}),(0,s.jsx)("button",{onClick:()=>O(e.id),className:"p-1 hover:bg-red-50 rounded text-red-500",title:o("removeCustomModel"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})]},e.id)})}):(0,s.jsx)("p",{className:"text-xs text-text-muted",children:o("noCustomModels")})]})}function N({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:r,copied:l,onCopy:o,onSetAlias:n,onDeleteAlias:d,connections:c,isAnthropic:p,onImportWithProgress:x}){let h=(0,m.c)("providers"),[f,g]=(0,a.useState)(""),[b,y]=(0,a.useState)(!1),[j,N]=(0,a.useState)(!1),C=(0,i.i)(),k=Object.entries(r).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,r])=>({modelId:r.replace(`${e}/`,""),fullModel:r,alias:t})),w=e=>{let s,a=(s=e.split("/"))[s.length-1];if(!r[a])return a;let i=`${t}-${a}`;return r[i]?null:i},S=async()=>{if(!f.trim()||b)return;let t=f.trim(),r=w(t);if(!r)return void C.error(h("allSuggestedAliasesExist"));y(!0);try{let s=await fetch("/api/provider-models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,modelId:t,modelName:t,source:"manual"})});if(!s.ok){let e={};try{e=await s.json()}catch(e){console.error("Failed to parse error response from custom model API:",e)}throw Error(e.error?.message||h("failedSaveCustomModel"))}await n(t,r,e),g(""),C.success(h("modelAddedSuccess",{modelId:t}))}catch(e){console.error("Error adding model:",e),C.error(e instanceof Error?e.message:h("failedAddModelTryAgain"))}finally{y(!1)}},T=async()=>{if(j)return;let t=c.find(e=>!1!==e.isActive);if(t){N(!0);try{await x(async()=>{let e=await fetch(`/api/providers/${t.id}/models`),r=await e.json();if(!e.ok)throw Error(r.error||h("failedImportModels"));return r},async t=>{let r=t.id||t.name||t.model;if(!r)return!1;let s=w(r);return!!s&&((await fetch("/api/provider-models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,modelId:r,modelName:t.name||r,source:"imported"})})).ok?(await n(r,s,e),!0):(C.error(h("failedSaveImportedModel")),!1))})}catch(e){console.error("Error importing models:",e),C.error(h("failedImportModelsTryAgain"))}finally{N(!1)}}},E=c.some(e=>!1!==e.isActive),A=async(t,r)=>{try{if(!(await fetch(`/api/provider-models?provider=${encodeURIComponent(e)}&model=${encodeURIComponent(t)}`,{method:"DELETE"})).ok)throw Error(h("failedRemoveModelFromDatabase"));await d(r),C.success(h("modelRemovedSuccess"))}catch(e){console.error("Error deleting model:",e),C.error(e instanceof Error?e.message:h("failedDeleteModelTryAgain"))}};return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:h("compatibleModelsDescription",{type:p?h("anthropic"):h("openai")})}),(0,s.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,s.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:h("modelId")}),(0,s.jsx)("input",{id:"new-compatible-model-input",type:"text",value:f,onChange:e=>g(e.target.value),onKeyDown:e=>"Enter"===e.key&&S(),placeholder:p?h("anthropicCompatibleModelPlaceholder"):h("openaiCompatibleModelPlaceholder"),className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,s.jsx)(u.$n,{size:"sm",icon:"add",onClick:S,disabled:!f.trim()||b,children:b?h("adding"):h("add")}),(0,s.jsx)(u.$n,{size:"sm",variant:"secondary",icon:"download",onClick:T,disabled:!E||j,children:j?h("importingModels"):h("importFromModels")})]}),!E&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:h("addConnectionToImport")}),k.length>0&&(0,s.jsx)("div",{className:"flex flex-col gap-3",children:k.map(({modelId:e,fullModel:r,alias:a})=>(0,s.jsx)(v,{modelId:e,fullModel:`${t}/${e}`,copied:l,onCopy:o,onDeleteAlias:()=>A(e,a)},r))})]})}function C({until:e}){let[t,r]=(0,a.useState)("");return((0,a.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void r("");let s=Math.floor(t/1e3);if(s<60)r(`${s}s`);else if(s<3600)r(`${Math.floor(s/60)}m ${s%60}s`);else{let e=Math.floor(s/3600),t=Math.floor(s%3600/60);r(`${e}h ${t}m`)}};t();let s=setInterval(t,1e3);return()=>clearInterval(s)},[e]),t)?(0,s.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}b.propTypes={model:o().shape({id:o().string.isRequired}).isRequired,fullModel:o().string.isRequired,alias:o().string,copied:o().string,onCopy:o().func.isRequired},y.propTypes={providerAlias:o().string.isRequired,modelAliases:o().object.isRequired,copied:o().string,onCopy:o().func.isRequired,onSetAlias:o().func.isRequired,onDeleteAlias:o().func.isRequired},v.propTypes={modelId:o().string.isRequired,fullModel:o().string.isRequired,copied:o().string,onCopy:o().func.isRequired,onDeleteAlias:o().func.isRequired},j.propTypes={providerId:o().string.isRequired,providerAlias:o().string.isRequired,copied:o().string,onCopy:o().func.isRequired},N.propTypes={providerStorageAlias:o().string.isRequired,providerDisplayAlias:o().string.isRequired,modelAliases:o().object.isRequired,copied:o().string,onCopy:o().func.isRequired,onSetAlias:o().func.isRequired,onDeleteAlias:o().func.isRequired,connections:o().arrayOf(o().shape({id:o().string,isActive:o().bool})).isRequired,isAnthropic:o().bool,onImportWithProgress:o().func.isRequired},C.propTypes={until:o().string.isRequired};let k={runtime_error:{labelKey:"errorTypeRuntime",variant:"warning"},upstream_auth_error:{labelKey:"errorTypeUpstreamAuth",variant:"error"},auth_missing:{labelKey:"errorTypeMissingCredential",variant:"warning"},token_refresh_failed:{labelKey:"errorTypeRefreshFailed",variant:"warning"},token_expired:{labelKey:"errorTypeTokenExpired",variant:"warning"},upstream_rate_limited:{labelKey:"errorTypeRateLimited",variant:"warning"},upstream_unavailable:{labelKey:"errorTypeUpstreamUnavailable",variant:"error"},network_error:{labelKey:"errorTypeNetworkError",variant:"warning"},unsupported:{labelKey:"errorTypeTestUnsupported",variant:"default"},upstream_error:{labelKey:"errorTypeUpstreamError",variant:"error"}};function w({connection:e,isOAuth:t,isFirst:r,isLast:i,onMoveUp:l,onMoveDown:o,onToggleActive:n,onToggleRateLimit:d,onRetest:c,isRetesting:p,onEdit:x,onDelete:h,onReauth:f,onProxy:g,hasProxy:b,proxySource:y,proxyHost:v,onRefreshToken:j,isRefreshing:N}){let w,S=(0,m.c)("providers"),T=t?e.name||e.email||e.displayName||S("oauthAccount"):e.name,[E,A]=(0,a.useState)(!1),[$,R]=(0,a.useState)(()=>t&&e.expiresAt?Math.floor((new Date(e.expiresAt).getTime()-Date.now())/6e4):null);(0,a.useEffect)(()=>{if(!t||!e.expiresAt)return;let r=setInterval(()=>{R(Math.floor((new Date(e.expiresAt).getTime()-Date.now())/6e4))},3e4);return()=>clearInterval(r)},[t,e.expiresAt]),(0,a.useEffect)(()=>{let t=()=>{A(e.rateLimitedUntil&&new Date(e.rateLimitedUntil).getTime()>Date.now())};t();let r=e.rateLimitedUntil?setInterval(t,1e3):null;return()=>{r&&clearInterval(r)}},[e.rateLimitedUntil]);let M="unavailable"!==e.testStatus||E?e.testStatus:"active",P=function(e,t,r,s){if(!1===e.isActive)return{statusVariant:"default",statusLabel:s("statusDisabled"),errorType:null,errorBadge:null,errorTextClass:"text-text-muted"};if("active"===t||"success"===t)return{statusVariant:"success",statusLabel:s("statusConnected"),errorType:null,errorBadge:null,errorTextClass:"text-text-muted"};let a=function(e,t){if(t)return"upstream_rate_limited";if(e.lastErrorType)return e.lastErrorType;let r=Number(e.errorCode);if(401===r||403===r)return"upstream_auth_error";if(429===r)return"upstream_rate_limited";if(r>=500)return"upstream_unavailable";let s=(e.lastError||"").toLowerCase();return s?s.includes("runtime")||s.includes("not runnable")||s.includes("not installed")||s.includes("healthcheck")?"runtime_error":s.includes("refresh failed")?"token_refresh_failed":s.includes("token expired")||s.includes("expired")?"token_expired":s.includes("invalid api key")||s.includes("token invalid")||s.includes("revoked")||s.includes("access denied")||s.includes("unauthorized")?"upstream_auth_error":s.includes("rate limit")||s.includes("quota")||s.includes("too many requests")||s.includes("429")?"upstream_rate_limited":s.includes("fetch failed")||s.includes("network")||s.includes("timeout")||s.includes("econn")||s.includes("enotfound")?"network_error":s.includes("not supported")?"unsupported":"upstream_error":null}(e,r),i=a&&k[a]||null;return"runtime_error"===a?{statusVariant:"warning",statusLabel:s("statusRuntimeIssue"),errorType:a,errorBadge:i,errorTextClass:"text-yellow-600 dark:text-yellow-400"}:"upstream_auth_error"===a||"auth_missing"===a||"token_refresh_failed"===a||"token_expired"===a?{statusVariant:"error",statusLabel:s("statusAuthFailed"),errorType:a,errorBadge:i,errorTextClass:"text-red-500"}:"upstream_rate_limited"===a?{statusVariant:"warning",statusLabel:s("statusRateLimited"),errorType:a,errorBadge:i,errorTextClass:"text-yellow-600 dark:text-yellow-400"}:"network_error"===a?{statusVariant:"warning",statusLabel:s("statusNetworkIssue"),errorType:a,errorBadge:i,errorTextClass:"text-yellow-600 dark:text-yellow-400"}:"unsupported"===a?{statusVariant:"default",statusLabel:s("statusTestUnsupported"),errorType:a,errorBadge:i,errorTextClass:"text-text-muted"}:{statusVariant:"error",statusLabel:({unavailable:s("statusUnavailable"),failed:s("statusFailed"),error:s("statusError")})[t]||t||s("statusError"),errorType:a,errorBadge:i,errorTextClass:"text-red-500"}}(e,M,E,S),I=!!e.rateLimitProtection;return(0,s.jsxs)("div",{className:`group flex items-center justify-between p-3 rounded-lg hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${!1===e.isActive?"opacity-60":""}`,children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("button",{onClick:l,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,s.jsx)("button",{onClick:o,disabled:i,className:`p-0.5 rounded ${i?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:t?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:T}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[(0,s.jsx)(u.Ex,{variant:P.statusVariant,size:"sm",dot:!0,children:P.statusLabel}),null!==$&&($<0?(0,s.jsxs)("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-xs font-medium bg-red-500/15 text-red-500",title:`Token expired: ${e.expiresAt}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"error"}),"expired"]}):$<30?(0,s.jsxs)("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-xs font-medium bg-amber-500/15 text-amber-500",title:`Token expires in ${$}m`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"warning"}),`~${$}m`]}):null),E&&!1!==e.isActive&&(0,s.jsx)(C,{until:e.rateLimitedUntil}),P.errorBadge&&!1!==e.isActive&&(0,s.jsx)(u.Ex,{variant:P.errorBadge.variant,size:"sm",children:S(P.errorBadge.labelKey)}),e.lastError&&!1!==e.isActive&&(0,s.jsx)("span",{className:`text-xs truncate max-w-[300px] ${P.errorTextClass}`,title:e.lastError,children:e.lastError}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,s.jsx)("span",{className:"text-xs text-text-muted",children:S("autoPriority",{priority:e.globalPriority})}),(0,s.jsx)("span",{className:"text-text-muted/30 select-none",children:"|"}),(0,s.jsxs)("button",{onClick:()=>d(!I),className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium transition-all cursor-pointer ${I?"bg-emerald-500/15 text-emerald-500 hover:bg-emerald-500/25":"bg-black/[0.03] dark:bg-white/[0.03] text-text-muted/50 hover:text-text-muted hover:bg-black/[0.06] dark:hover:bg-white/[0.06]"}`,title:S(I?"disableRateLimitProtection":"enableRateLimitProtection"),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"shield"}),S(I?"rateLimitProtected":"rateLimitUnprotected")]}),b&&(w=S("global"===y?"proxySourceGlobal":"provider"===y?"proxySourceProvider":"proxySourceKey"),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-text-muted/30 select-none",children:"|"}),(0,s.jsxs)("span",{className:`inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-xs font-medium ${"global"===y?"bg-emerald-500/15 text-emerald-500":"provider"===y?"bg-amber-500/15 text-amber-500":"bg-blue-500/15 text-blue-500"}`,title:S("proxyConfiguredBySource",{source:w,host:v||S("configured")}),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"vpn_lock"}),v||S("proxy")]})]}))]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(u.$n,{size:"sm",variant:"ghost",icon:"refresh",loading:p,disabled:!1===e.isActive,onClick:c,className:"!h-7 !px-2 text-xs",title:S("retestAuthentication"),children:S("retest")}),j&&(0,s.jsx)(u.$n,{size:"sm",variant:"ghost",icon:"token",loading:N,disabled:!1===e.isActive||N,onClick:j,className:"!h-7 !px-2 text-xs text-amber-500 hover:text-amber-400",title:"Refresh OAuth token manually",children:"Token"}),(0,s.jsx)(u.lM,{size:"sm",checked:e.isActive??!0,onChange:n,title:S(e.isActive??!0?"disableConnection":"enableConnection")}),(0,s.jsxs)("div",{className:"flex gap-1 ml-1 transition-opacity",children:[f&&(0,s.jsx)("button",{onClick:f,className:"p-2 hover:bg-amber-500/10 rounded text-amber-600 hover:text-amber-500",title:S("reauthenticateConnection"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"passkey"})}),(0,s.jsx)("button",{onClick:x,className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary",title:S("edit"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})}),(0,s.jsx)("button",{onClick:g,className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary",title:S("proxyConfig"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"vpn_lock"})}),(0,s.jsx)("button",{onClick:h,className:"p-2 hover:bg-red-500/10 rounded text-red-500",title:S("deleteConnection"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]})]})}function S({isOpen:e,provider:t,providerName:r,isCompatible:i,isAnthropic:l,onSave:o,onClose:n}){let d=(0,m.c)("providers"),[c,p]=(0,a.useState)({name:"",apiKey:"",priority:1}),[x,h]=(0,a.useState)(!1),[f,g]=(0,a.useState)(null),[b,y]=(0,a.useState)(!1),[v,j]=(0,a.useState)(null),N=async()=>{h(!0),j(null);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})}),r=await e.json();g(r.valid?"success":"failed")}catch{g("failed")}finally{h(!1)}},C=async()=>{if(t&&c.apiKey){y(!0),j(null);try{let e=!1;try{h(!0),g(null);let r=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})});e=!!(await r.json()).valid,g(e?"success":"failed")}catch{g("failed")}finally{h(!1)}if(!e)return void j(d("apiKeyValidationFailed"));let r=await o({name:c.name,apiKey:c.apiKey,priority:c.priority,testStatus:"active"});r&&j("string"==typeof r?r:d("failedSaveConnection"))}finally{y(!1)}}};return t?(0,s.jsx)(u.aF,{isOpen:e,title:d("addProviderApiKeyTitle",{provider:r||t}),onClose:n,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(u.pd,{label:d("nameLabel"),value:c.name,onChange:e=>p({...c,name:e.target.value}),placeholder:d("productionKey")}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(u.pd,{label:d("apiKeyLabel"),type:"password",value:c.apiKey,onChange:e=>p({...c,apiKey:e.target.value}),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(u.$n,{onClick:N,disabled:!c.apiKey||x||b,variant:"secondary",children:x?d("checking"):d("check")})})]}),f&&(0,s.jsx)(u.Ex,{variant:"success"===f?"success":"error",children:"success"===f?d("valid"):d("invalid")}),v&&(0,s.jsx)("div",{className:"text-sm text-red-500 bg-red-500/10 border border-red-500/20 rounded-lg px-3 py-2",children:v}),i&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:l?d("validationChecksAnthropicCompatible",{provider:r||d("anthropicCompatibleName")}):d("validationChecksOpenAiCompatible",{provider:r||d("openaiCompatibleName")})}),(0,s.jsx)(u.pd,{label:d("priorityLabel"),type:"number",value:c.priority,onChange:e=>p({...c,priority:Number.parseInt(e.target.value)||1})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(u.$n,{onClick:C,fullWidth:!0,disabled:!c.name||!c.apiKey||b,children:b?d("saving"):d("save")}),(0,s.jsx)(u.$n,{onClick:n,variant:"ghost",fullWidth:!0,children:d("cancel")})]})]})}):null}function T({isOpen:e,connection:t,onSave:r,onClose:i}){let l=(0,m.c)("providers"),[o,n]=(0,a.useState)({name:"",priority:1,apiKey:"",healthCheckInterval:60}),[d,c]=(0,a.useState)(!1),[p,h]=(0,a.useState)(null),[f,g]=(0,a.useState)(!1),[b,y]=(0,a.useState)(null),[v,j]=(0,a.useState)(!1),[N,C]=(0,a.useState)([]),[w,S]=(0,a.useState)("");(0,a.useEffect)(()=>{if(t){n({name:t.name||"",priority:t.priority||1,apiKey:"",healthCheckInterval:t.healthCheckInterval??60});let e=t.providerSpecificData?.extraApiKeys;C(Array.isArray(e)?e:[]),S(""),h(null),y(null)}},[t]);let T=async()=>{if(t?.provider){c(!0),h(null);try{let e=await fetch(`/api/providers/${t.id}/test`,{method:"POST"}),r=await e.json();h({valid:!!r.valid,diagnosis:r.diagnosis||null,message:r.error||null})}catch{h({valid:!1,diagnosis:{type:"network_error"},message:l("failedTestConnection")})}finally{c(!1)}}},E=async()=>{if(t?.provider&&o.apiKey){g(!0),y(null);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:o.apiKey})}),r=await e.json();y(r.valid?"success":"failed")}catch{y("failed")}finally{g(!1)}}},A=async()=>{j(!0);try{let e={name:o.name,priority:o.priority,healthCheckInterval:o.healthCheckInterval};if(!$&&o.apiKey){e.apiKey=o.apiKey;let r="success"===b;if(!r)try{g(!0),y(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:o.apiKey})});r=!!(await e.json()).valid,y(r?"success":"failed")}catch{y("failed")}finally{g(!1)}r&&(e.testStatus="active",e.lastError=null,e.lastErrorAt=null,e.lastErrorType=null,e.lastErrorSource=null,e.errorCode=null,e.rateLimitedUntil=null)}$||(e.providerSpecificData={...t.providerSpecificData||{},extraApiKeys:N.filter(e=>e.trim().length>0)}),await r(e)}finally{j(!1)}};if(!t)return null;let $="oauth"===t.authType,R=(0,x.mq)(t.provider)||(0,x.gb)(t.provider),M=!p?.valid&&p?.diagnosis?.type&&k[p.diagnosis.type]||null;return(0,s.jsx)(u.aF,{isOpen:e,title:l("editConnection"),onClose:i,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(u.pd,{label:l("nameLabel"),value:o.name,onChange:e=>n({...o,name:e.target.value}),placeholder:$?l("accountName"):l("productionKey")}),$&&t.email&&(0,s.jsxs)("div",{className:"bg-sidebar/50 p-3 rounded-lg",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted mb-1",children:l("email")}),(0,s.jsx)("p",{className:"font-medium",children:t.email})]}),$&&(0,s.jsx)(u.pd,{label:l("healthCheckMinutes"),type:"number",value:o.healthCheckInterval,onChange:e=>n({...o,healthCheckInterval:Math.max(0,Number.parseInt(e.target.value)||0)}),hint:l("healthCheckHint")}),(0,s.jsx)(u.pd,{label:l("priorityLabel"),type:"number",value:o.priority,onChange:e=>n({...o,priority:Number.parseInt(e.target.value)||1})}),!$&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(u.pd,{label:l("apiKeyLabel"),type:"password",value:o.apiKey,onChange:e=>n({...o,apiKey:e.target.value}),placeholder:l("enterNewApiKey"),hint:l("leaveBlankKeepCurrentApiKey"),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(u.$n,{onClick:E,disabled:!o.apiKey||f||v,variant:"secondary",children:f?l("checking"):l("check")})})]}),b&&(0,s.jsx)(u.Ex,{variant:"success"===b?"success":"error",children:"success"===b?l("valid"):l("invalid")})]}),!$&&(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("label",{className:"text-sm font-medium text-text-main",children:["Extra API Keys",(0,s.jsx)("span",{className:"ml-2 text-[11px] font-normal text-text-muted",children:"(round-robin rotation — optional)"})]}),N.length>0&&(0,s.jsx)("div",{className:"flex flex-col gap-1.5",children:N.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"flex-1 font-mono text-xs bg-sidebar/50 px-3 py-2 rounded border border-border text-text-muted truncate",children:`Key #${t+2}: ${e.slice(0,6)}...${e.slice(-4)}`}),(0,s.jsx)("button",{onClick:()=>C(N.filter((e,r)=>r!==t)),className:"p-1.5 rounded hover:bg-red-500/10 text-red-400 hover:text-red-500",title:"Remove this key",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},t))}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{type:"password",value:w,onChange:e=>S(e.target.value),placeholder:"Add another API key...",className:"flex-1 text-sm bg-sidebar/50 border border-border rounded px-3 py-2 text-text-main placeholder:text-text-muted focus:ring-1 focus:ring-primary outline-none",onKeyDown:e=>{"Enter"===e.key&&w.trim()&&(C([...N,w.trim()]),S(""))}}),(0,s.jsx)("button",{onClick:()=>{w.trim()&&(C([...N,w.trim()]),S(""))},disabled:!w.trim(),className:"px-3 py-2 rounded bg-primary/10 text-primary hover:bg-primary/20 disabled:opacity-40 text-sm font-medium",children:"Add"})]}),N.length>0&&(0,s.jsxs)("p",{className:"text-[11px] text-text-muted",children:[N.length+1," keys total — rotating round-robin on each request."]})]}),!R&&(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(u.$n,{onClick:T,variant:"secondary",disabled:d,children:d?l("testing"):l("testConnection")}),p&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.Ex,{variant:p.valid?"success":"error",children:p.valid?l("valid"):l("failed")}),M&&(0,s.jsx)(u.Ex,{variant:M.variant,children:l(M.labelKey)})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(u.$n,{onClick:A,fullWidth:!0,disabled:v,children:v?l("saving"):l("save")}),(0,s.jsx)(u.$n,{onClick:i,variant:"ghost",fullWidth:!0,children:l("cancel")})]})]})})}function E({isOpen:e,node:t,onSave:r,onClose:i,isAnthropic:l}){let o=(0,m.c)("providers"),[n,d]=(0,a.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1"}),[c,p]=(0,a.useState)(!1),[x,h]=(0,a.useState)(""),[f,g]=(0,a.useState)(!1),[b,y]=(0,a.useState)(null);(0,a.useEffect)(()=>{t&&d({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(l?"https://api.anthropic.com/v1":"https://api.openai.com/v1")})},[t,l]);let v=[{value:"chat",label:o("chatCompletions")},{value:"responses",label:o("responsesApi")}],j=async()=>{if(n.name.trim()&&n.prefix.trim()&&n.baseUrl.trim()){p(!0);try{let e={name:n.name,prefix:n.prefix,baseUrl:n.baseUrl};l||(e.apiType=n.apiType),await r(e)}finally{p(!1)}}},N=async()=>{g(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:n.baseUrl,apiKey:x,type:l?"anthropic-compatible":"openai-compatible"})}),t=await e.json();y(t.valid?"success":"failed")}catch{y("failed")}finally{g(!1)}};return t?(0,s.jsx)(u.aF,{isOpen:e,title:o("editCompatibleTitle",{type:o(l?"anthropic":"openai")}),onClose:i,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(u.pd,{label:o("nameLabel"),value:n.name,onChange:e=>d({...n,name:e.target.value}),placeholder:o("compatibleProdPlaceholder",{type:o(l?"anthropic":"openai")}),hint:o("nameHint")}),(0,s.jsx)(u.pd,{label:o("prefixLabel"),value:n.prefix,onChange:e=>d({...n,prefix:e.target.value}),placeholder:o(l?"anthropicPrefixPlaceholder":"openaiPrefixPlaceholder"),hint:o("prefixHint")}),!l&&(0,s.jsx)(u.l6,{label:o("apiTypeLabel"),options:v,value:n.apiType,onChange:e=>d({...n,apiType:e.target.value})}),(0,s.jsx)(u.pd,{label:o("baseUrlLabel"),value:n.baseUrl,onChange:e=>d({...n,baseUrl:e.target.value}),placeholder:o(l?"anthropicBaseUrlPlaceholder":"openaiBaseUrlPlaceholder"),hint:o("compatibleBaseUrlHint",{type:o(l?"anthropic":"openai")})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(u.pd,{label:o("apiKeyForCheck"),type:"password",value:x,onChange:e=>h(e.target.value),className:"flex-1"}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(u.$n,{onClick:N,disabled:!x||f||!n.baseUrl.trim(),variant:"secondary",children:o(f?"checking":"check")})})]}),b&&(0,s.jsx)(u.Ex,{variant:"success"===b?"success":"error",children:o("success"===b?"valid":"invalid")}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(u.$n,{onClick:j,fullWidth:!0,disabled:!n.name.trim()||!n.prefix.trim()||!n.baseUrl.trim()||c,children:o(c?"saving":"save")}),(0,s.jsx)(u.$n,{onClick:i,variant:"ghost",fullWidth:!0,children:o("cancel")})]})]})}):null}w.propTypes={connection:o().shape({id:o().string,name:o().string,email:o().string,displayName:o().string,rateLimitedUntil:o().string,rateLimitProtection:o().bool,testStatus:o().string,isActive:o().bool,priority:o().number,lastError:o().string,lastErrorType:o().string,lastErrorSource:o().string,errorCode:o().oneOfType([o().string,o().number]),globalPriority:o().number}).isRequired,isOAuth:o().bool.isRequired,isFirst:o().bool.isRequired,isLast:o().bool.isRequired,onMoveUp:o().func.isRequired,onMoveDown:o().func.isRequired,onToggleActive:o().func.isRequired,onToggleRateLimit:o().func.isRequired,onRetest:o().func.isRequired,isRetesting:o().bool,onEdit:o().func.isRequired,onDelete:o().func.isRequired,onReauth:o().func},S.propTypes={isOpen:o().bool.isRequired,provider:o().string,providerName:o().string,isCompatible:o().bool,isAnthropic:o().bool,onSave:o().func.isRequired,onClose:o().func.isRequired},T.propTypes={isOpen:o().bool.isRequired,connection:o().shape({id:o().string,name:o().string,email:o().string,priority:o().number,authType:o().string,provider:o().string}),onSave:o().func.isRequired,onClose:o().func.isRequired},E.propTypes={isOpen:o().bool.isRequired,node:o().shape({id:o().string,name:o().string,prefix:o().string,apiType:o().string,baseUrl:o().string}),onSave:o().func.isRequired,onClose:o().func.isRequired,isAnthropic:o().bool}}},e=>{e.O(0,[8500,3418,9751,8055,1149,5846,647,8441,3794,7358],()=>e(e.s=3751)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2791],{3612:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>U});var a=s(95155),l=s(12115),r=s(73321),i=s(67040),n=s(52529),d=s(50910),c=s(40993),o=s(33418);function m(){let[e,t]=(0,l.useState)([]),[s,r]=(0,l.useState)(!1),[i,n]=(0,l.useState)(!1),[m,x]=(0,l.useState)({type:"",message:""}),[u,h]=(0,l.useState)(null),[p,b]=(0,l.useState)(null),[g,f]=(0,l.useState)(!1),[j,y]=(0,l.useState)({type:"",message:""}),[v,N]=(0,l.useState)(!1),[k,w]=(0,l.useState)(!1),[C,S]=(0,l.useState)({type:"",message:""}),[D,P]=(0,l.useState)(!1),[$,A]=(0,l.useState)(null),T=(0,l.useRef)(null),L=(0,o.Ym)(),M=(0,d.c)("settings"),E=(0,d.c)("common"),[O,K]=(0,l.useState)({driver:"sqlite",dbPath:"~/.omniroute/storage.sqlite",sizeBytes:0,retentionDays:90,lastBackupAt:null}),F=async()=>{r(!0);try{let e=await fetch("/api/db-backups"),s=await e.json();t(s.backups||[])}catch(e){console.error("Failed to fetch backups:",e)}finally{r(!1)}},_=async()=>{try{let e=await fetch("/api/storage/health");if(!e.ok)return;let t=await e.json();K(e=>({...e,...t}))}catch(e){console.error("Failed to fetch storage health:",e)}},B=async()=>{f(!0),y({type:"",message:""});try{let e=await fetch("/api/db-backups",{method:"PUT"}),t=await e.json();e.ok?(t.filename?y({type:"success",message:M("backupCreated",{file:t.filename})}):y({type:"info",message:t.message||M("noChangesSinceBackup")}),await _(),i&&await F()):y({type:"error",message:t.error||M("backupFailed")})}catch{y({type:"error",message:M("errorOccurred")})}finally{f(!1)}},z=async e=>{h(e),x({type:"",message:""});try{let t=await fetch("/api/db-backups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({backupId:e})}),s=await t.json();t.ok?(x({type:"success",message:M("restoreSuccess",{connections:s.connectionCount,nodes:s.nodeCount,combos:s.comboCount,apiKeys:s.apiKeyCount})}),await F(),await _()):x({type:"error",message:s.error||M("restoreFailed")})}catch{x({type:"error",message:M("errorDuringRestore")})}finally{h(null),b(null)}};(0,l.useEffect)(()=>{_()},[]);let R=async()=>{N(!0);try{let e=await fetch("/api/db-backups/export");if(!e.ok){let t=await e.json();throw Error(t.error||M("exportFailed"))}let t=await e.blob(),s=URL.createObjectURL(t),a=(e.headers.get("Content-Disposition")||"").match(/filename="(.+)"/),l=a?a[1]:`omniroute-backup-${new Date().toISOString().replace(/[:.]/g,"-")}.sqlite`,r=document.createElement("a");r.href=s,r.download=l,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(s)}catch(e){console.error("Export failed:",e),S({type:"error",message:M("exportFailedWithError",{error:e.message})})}finally{N(!1)}},I=async()=>{if($){w(!0),S({type:"",message:""}),P(!1);try{let e=new FormData;e.append("file",$);let t=await fetch("/api/db-backups/import",{method:"POST",body:e}),s=await t.json();t.ok?(S({type:"success",message:M("importSuccess",{connections:s.connectionCount,nodes:s.nodeCount,combos:s.comboCount,apiKeys:s.apiKeyCount})}),await _(),i&&await F()):S({type:"error",message:s.error||M("importFailed")})}catch{S({type:"error",message:M("errorDuringImport")})}finally{w(!1),A(null)}}},q=e=>e&&0!==e?e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`:"0 B";return(0,a.jsxs)(c.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-green-500/10 text-green-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"database"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:M("systemStorage")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:M("allDataLocal")})]}),(0,a.jsx)(c.Ex,{variant:"success",size:"sm",children:O.driver||"json"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-4",children:[(0,a.jsxs)("div",{className:"p-3 rounded-lg bg-bg border border-border",children:[(0,a.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wide mb-1",children:M("databasePath")}),(0,a.jsx)("p",{className:"text-sm font-mono text-text-main break-all",children:O.dbPath||"~/.omniroute/storage.sqlite"})]}),(0,a.jsxs)("div",{className:"p-3 rounded-lg bg-bg border border-border",children:[(0,a.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wide mb-1",children:M("databaseSize")}),(0,a.jsx)("p",{className:"text-sm font-mono text-text-main",children:q(O.sizeBytes)})]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-4",children:[(0,a.jsxs)(c.$n,{variant:"outline",size:"sm",onClick:R,loading:v,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"download"}),M("exportDatabase")]}),(0,a.jsxs)(c.$n,{variant:"outline",size:"sm",onClick:async()=>{N(!0);try{let e=await fetch("/api/db-backups/exportAll");if(!e.ok)throw Error(M("exportFailed"));let t=await e.blob(),s=(e.headers.get("Content-Disposition")||"").match(/filename="?([^"]+)"?/),a=s?.[1]||"omniroute-full-backup.tar.gz",l=URL.createObjectURL(t),r=document.createElement("a");r.href=l,r.download=a,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(l)}catch(e){S({type:"error",message:M("fullExportFailedWithError",{error:e.message})})}finally{N(!1)}},loading:v,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"folder_zip"}),M("exportAll")]}),(0,a.jsxs)(c.$n,{variant:"outline",size:"sm",onClick:()=>{T.current?.click()},loading:k,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"upload"}),M("importDatabase")]}),(0,a.jsx)("input",{ref:T,type:"file",accept:".sqlite",className:"hidden",onChange:e=>{let t=e.target.files?.[0];if(t){if(!t.name.endsWith(".sqlite"))return void S({type:"error",message:M("invalidFileType")});A(t),P(!0),T.current&&(T.current.value="")}}})]}),D&&$&&(0,a.jsx)("div",{className:"p-4 rounded-lg mb-4 bg-amber-500/10 border border-amber-500/30",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px] text-amber-500 mt-0.5","aria-hidden":"true",children:"warning"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-amber-500 mb-1",children:M("confirmDbImport")}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:M("confirmDbImportDesc",{file:$.name})}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(c.$n,{variant:"primary",size:"sm",onClick:I,className:"!bg-amber-500 hover:!bg-amber-600",children:M("yesImport")}),(0,a.jsx)(c.$n,{variant:"outline",size:"sm",onClick:()=>{P(!1),A(null)},children:E("cancel")})]})]})]})}),C.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-4 text-sm ${"success"===C.type?"bg-green-500/10 text-green-500 border border-green-500/20":"bg-red-500/10 text-red-500 border border-red-500/20"}`,role:"alert",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"success"===C.type?"check_circle":"error"}),C.message]})}),(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-bg border border-border mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-amber-500","aria-hidden":"true",children:"schedule"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:M("lastBackup")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:O.lastBackupAt?`${new Date(O.lastBackupAt).toLocaleString(L)} (${(e=>{if(!e)return null;let t=Math.floor((new Date-new Date(e))/6e4);if(t<1)return M("justNow");if(t<60)return M("minutesAgo",{count:t});let s=Math.floor(t/60);return s<24?M("hoursAgo",{count:s}):M("daysAgo",{count:Math.floor(s/24)})})(O.lastBackupAt)})`:M("noBackupYet")})]})]}),(0,a.jsxs)(c.$n,{variant:"outline",size:"sm",onClick:B,loading:g,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"backup"}),M("backupNow")]})]}),j.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-4 text-sm ${"success"===j.type?"bg-green-500/10 text-green-500 border border-green-500/20":"info"===j.type?"bg-blue-500/10 text-blue-500 border border-blue-500/20":"bg-red-500/10 text-red-500 border border-red-500/20"}`,role:"alert",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"success"===j.type?"check_circle":"info"===j.type?"info":"error"}),j.message]})}),(0,a.jsxs)("div",{className:"pt-3 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-amber-500","aria-hidden":"true",children:"restore"}),(0,a.jsx)("p",{className:"font-medium",children:M("backupRestore")})]}),(0,a.jsx)(c.$n,{variant:"outline",size:"sm",onClick:()=>{n(!i),i||0!==e.length||F()},children:i?M("hide"):M("viewBackups")})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:M("backupRetentionDesc")}),m.message&&(0,a.jsx)("div",{className:`p-3 rounded-lg mb-3 text-sm ${"success"===m.type?"bg-green-500/10 text-green-500 border border-green-500/20":"bg-red-500/10 text-red-500 border border-red-500/20"}`,role:"alert",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"success"===m.type?"check_circle":"error"}),m.message]})}),i&&(0,a.jsx)("div",{className:"flex flex-col gap-2",children:s?(0,a.jsxs)("div",{className:"flex items-center justify-center py-6 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px] mr-2","aria-hidden":"true",children:"progress_activity"}),M("loadingBackups")]}):0===e.length?(0,a.jsxs)("div",{className:"text-center py-6 text-text-muted text-sm",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px] mb-2 block opacity-40","aria-hidden":"true",children:"folder_off"}),M("noBackupsYet")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:M("backupsAvailable",{count:e.length})}),(0,a.jsxs)("button",{onClick:F,className:"text-xs text-primary hover:underline flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"refresh"}),M("refresh")]})]}),e.map(e=>{var t;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-black/[0.02] dark:bg-white/[0.02] border border-border/50 hover:border-border transition-colors",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-amber-500","aria-hidden":"true",children:"description"}),(0,a.jsx)("span",{className:"text-sm font-medium truncate",children:new Date(e.createdAt).toLocaleString(L)}),(0,a.jsx)(c.Ex,{variant:"pre-restore"===e.reason?"warning":"manual"===e.reason?"success":"default",size:"sm",children:"manual"===(t=e.reason)?M("backupReasonManual"):"pre-restore"===t?M("backupReasonPreRestore"):t})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted ml-6",children:[(0,a.jsx)("span",{children:M("connectionsCount",{count:e.connectionCount})}),(0,a.jsx)("span",{children:"•"}),(0,a.jsx)("span",{children:q(e.size)})]})]}),(0,a.jsx)("div",{className:"flex items-center gap-2 ml-3",children:p===e.id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-xs text-amber-500 font-medium",children:M("confirm")}),(0,a.jsx)(c.$n,{variant:"primary",size:"sm",onClick:()=>z(e.id),loading:u===e.id,className:"!bg-amber-500 hover:!bg-amber-600",children:M("yes")}),(0,a.jsx)(c.$n,{variant:"outline",size:"sm",onClick:()=>b(null),children:M("no")})]}):(0,a.jsxs)(c.$n,{variant:"outline",size:"sm",onClick:()=>b(e.id),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1","aria-hidden":"true",children:"restore"}),M("restore")]})})]},e.id)})]})})]})]})}var x=s(20909);let u=[{value:"disabled",labelKey:"ipModeDisabled",icon:"block"},{value:"blacklist",labelKey:"ipModeBlacklist",icon:"do_not_disturb"},{value:"whitelist",labelKey:"ipModeWhitelist",icon:"verified_user"},{value:"whitelist-priority",labelKey:"ipModeWhitelistPriority",icon:"priority_high"}];function h(){let[e,t]=(0,l.useState)({enabled:!1,mode:"blacklist",blacklist:[],whitelist:[],tempBans:[]}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(""),[o,m]=(0,l.useState)("blacklist"),x=(0,d.c)("settings");(0,l.useEffect)(()=>{h()},[]);let h=async()=>{try{let e=await fetch("/api/settings/ip-filter");e.ok&&t(await e.json())}catch{}finally{r(!1)}},p=async e=>{try{let s=await fetch("/api/settings/ip-filter",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});s.ok&&t(await s.json())}catch{}},b=()=>{i.trim()&&(p({["blacklist"===o?"addBlacklist":"addWhitelist"]:i.trim()}),n(""))},g=(e,t)=>{p({["blacklist"===t?"removeBlacklist":"removeWhitelist"]:e})},f=e.enabled?e.mode:"disabled";return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-red-500/10 text-red-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"security"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:x("ipAccessControl")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x("ipAccessControlDesc")})]})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-2 mb-5",children:u.map(e=>(0,a.jsxs)("button",{onClick:()=>{var t;"disabled"===(t=e.value)?p({enabled:!1}):p({enabled:!0,mode:t})},disabled:s,className:`flex flex-col items-center gap-1.5 p-3 rounded-lg border text-center transition-all ${f===e.value?"border-red-500/50 bg-red-500/5 ring-1 ring-red-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] ${f===e.value?"text-red-400":"text-text-muted"}`,children:e.icon}),(0,a.jsx)("span",{className:`text-xs font-medium ${f===e.value?"text-red-400":"text-text-muted"}`,children:x(e.labelKey)})]},e.value))}),e.enabled&&(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2 items-stretch sm:items-end",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(c.pd,{label:x("addIpAddress"),placeholder:x("ipAddressPlaceholder"),value:i,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&b()})}),(0,a.jsxs)("div",{className:"flex gap-1 pb-[2px]",children:[(0,a.jsx)(c.$n,{size:"sm",variant:"blacklist"===o?"danger":"secondary",onClick:()=>{m("blacklist"),i.trim()&&b()},children:x("block")}),(0,a.jsx)(c.$n,{size:"sm",variant:"whitelist"===o?"primary":"secondary",onClick:()=>{m("whitelist"),i.trim()&&b()},children:x("allow")})]})]}),e.blacklist.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:x("blocked",{count:e.blacklist.length})}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.blacklist.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-mono bg-red-500/10 text-red-400 border border-red-500/20",children:[e,(0,a.jsx)("button",{onClick:()=>g(e,"blacklist"),className:"hover:text-red-300",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e))})]}),e.whitelist.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:x("allowed",{count:e.whitelist.length})}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.whitelist.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-mono bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[e,(0,a.jsx)("button",{onClick:()=>g(e,"whitelist"),className:"hover:text-emerald-300",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]},e))})]}),e.tempBans.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2",children:x("temporaryBans",{count:e.tempBans.length})}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:e.tempBans.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 rounded-lg bg-orange-500/5 border border-orange-500/20 text-sm",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono text-xs text-orange-400 shrink-0",children:e.ip}),(0,a.jsxs)("span",{className:"text-xs text-text-muted truncate",children:["— ",e.reason]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted tabular-nums",children:x("minLeft",{min:Math.ceil(e.remainingMs/6e4)})}),(0,a.jsx)("button",{onClick:()=>p({removeBan:e.ip}),className:"text-text-muted hover:text-orange-400",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]},e.ip))})]})]})]})}function p(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!0),i=(0,d.c)("settings");(0,l.useEffect)(()=>{let e=!1;return async function(){let s=sessionStorage.getItem("omniroute_login_time"),a=Date.now(),l=i("unknown");if(s){let e=a-parseInt(s,10),t=Math.floor(e/36e5),r=Math.floor(e%36e5/6e4);l=t>0?`${t}h ${r}m`:`${r}m`}let n=!1;try{let e=await fetch("/api/auth/status",{method:"GET",cache:"no-store"});if(e.ok){let t=await e.json();n=!0===t.authenticated}}catch{}e||(t({authenticated:n,loginTime:s?new Date(parseInt(s,10)).toLocaleString():null,sessionAge:l,ipAddress:"—",userAgent:navigator.userAgent.split(" ").slice(-2).join(" ")||i("unknown")}),r(!1))}(),()=>{e=!0}},[]);let n=async()=>{try{await fetch("/api/auth/logout",{method:"POST"}),sessionStorage.removeItem("omniroute_login_time"),window.location.href="/"}catch{window.location.href="/"}};return s?(0,a.jsx)(c.Zp,{children:(0,a.jsx)("div",{className:"animate-pulse h-32 bg-black/5 dark:bg-white/5 rounded-lg"})}):(0,a.jsxs)(c.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]","aria-hidden":"true",children:"person"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:i("session")})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",role:"list","aria-label":i("sessionDetailsAria"),children:[(0,a.jsxs)("div",{className:"flex justify-between items-center text-sm",role:"listitem",children:[(0,a.jsx)("span",{className:"text-text-muted",children:i("status")}),(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:`w-2 h-2 rounded-full ${e?.authenticated?"bg-green-500":"bg-yellow-500"}`,"aria-hidden":"true"}),e?.authenticated?i("authenticated"):i("guest")]})]}),e?.loginTime&&(0,a.jsxs)("div",{className:"flex justify-between items-center text-sm",role:"listitem",children:[(0,a.jsx)("span",{className:"text-text-muted",children:i("loginTime")}),(0,a.jsx)("span",{className:"font-mono text-xs",children:e.loginTime})]}),(0,a.jsxs)("div",{className:"flex justify-between items-center text-sm",role:"listitem",children:[(0,a.jsx)("span",{className:"text-text-muted",children:i("sessionAge")}),(0,a.jsx)("span",{className:"font-mono text-xs",children:e?.sessionAge})]}),(0,a.jsxs)("div",{className:"flex justify-between items-center text-sm",role:"listitem",children:[(0,a.jsx)("span",{className:"text-text-muted",children:i("browser")}),(0,a.jsx)("span",{className:"font-mono text-xs truncate max-w-[200px]",children:e?.userAgent})]})]}),(0,a.jsxs)("div",{className:"flex gap-3 mt-4 pt-4 border-t border-border/50",children:[(0,a.jsx)(c.$n,{variant:"secondary",onClick:()=>{confirm(i("clearLocalDataConfirm"))&&(localStorage.clear(),sessionStorage.clear(),window.location.reload())},children:i("clearLocalData")}),e?.authenticated&&(0,a.jsx)(c.$n,{variant:"danger",onClick:n,children:i("logout")})]})]})}function b(){let[e,t]=(0,l.useState)({requireLogin:!1,hasPassword:!1}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)({current:"",new:"",confirm:""}),[o,m]=(0,l.useState)({type:"",message:""}),[u,b]=(0,l.useState)(!1),g=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let f=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:e})})).ok&&t(t=>({...t,requireLogin:e}))}catch(e){console.error("Failed to update require login:",e)}},j=async(e,s)=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[e]:s})})).ok&&t(t=>({...t,[e]:s}))}catch(t){console.error(`Failed to update ${e}:`,t)}},y=async e=>{if(e.preventDefault(),i.new!==i.confirm)return void m({type:"error",message:g("passwordsNoMatch")});b(!0),m({type:"",message:""});try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:i.current,newPassword:i.new})}),t=await e.json();e.ok?(m({type:"success",message:g("passwordUpdated")}),n({current:"",new:"",confirm:""})):m({type:"error",message:t.error||g("failedUpdatePassword")})}catch{m({type:"error",message:g("errorOccurred")})}finally{b(!1)}},v=e.blockedProviders||[];return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(c.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]","aria-hidden":"true",children:"shield"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:g("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:g("requireLogin")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:g("requireLoginDesc")})]}),(0,a.jsx)(c.lM,{checked:!0===e.requireLogin,onChange:()=>f(!e.requireLogin),disabled:s})]}),!0===e.requireLogin&&(0,a.jsxs)("form",{onSubmit:y,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[e.hasPassword&&(0,a.jsx)(c.pd,{label:g("currentPassword"),type:"password",placeholder:g("enterCurrentPassword"),value:i.current,onChange:e=>n({...i,current:e.target.value}),required:!0}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsx)(c.pd,{label:g("newPassword"),type:"password",placeholder:g("enterNewPassword"),value:i.new,onChange:e=>n({...i,new:e.target.value}),required:!0}),(0,a.jsx)(c.pd,{label:g("confirmPassword"),type:"password",placeholder:g("confirmPasswordPlaceholder"),value:i.confirm,onChange:e=>n({...i,confirm:e.target.value}),required:!0})]}),o.message&&(0,a.jsx)("p",{className:`text-sm ${"error"===o.type?"text-red-500":"text-green-500"}`,children:o.message}),(0,a.jsx)("div",{className:"pt-2",children:(0,a.jsx)(c.$n,{type:"submit",variant:"primary",loading:u,children:e.hasPassword?g("updatePassword"):g("setPassword")})})]})]})]}),(0,a.jsxs)(c.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-amber-500/10 text-amber-600 dark:text-amber-400",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"api"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:g("apiEndpointProtection")})]}),(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:g("requireAuthModels")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:g("requireAuthModelsDesc")})]}),(0,a.jsx)(c.lM,{checked:!0===e.requireAuthForModels,onChange:()=>j("requireAuthForModels",!e.requireAuthForModels),disabled:s})]}),(0,a.jsxs)("div",{className:"pt-4 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsx)("p",{className:"font-medium",children:g("blockedProviders")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:g("blockedProvidersDesc")})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.values(x.Q2).map(t=>{let l=v.includes(t.id);return(0,a.jsxs)("button",{onClick:()=>{var s;let a;return s=t.id,void j("blockedProviders",(a=e.blockedProviders||[]).includes(s)?a.filter(e=>e!==s):[...a,s])},disabled:s,className:`inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-all border ${l?"bg-red-500/10 border-red-500/30 text-red-600 dark:text-red-400":"bg-black/[0.02] dark:bg-white/[0.02] border-transparent text-text-muted hover:bg-black/[0.05] dark:hover:bg-white/[0.05]"}`,title:l?g("unblockProviderTitle",{provider:t.name}):g("blockProviderTitle",{provider:t.name}),children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:{color:l?void 0:t.color},children:l?"block":t.icon}),t.name,l&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px] text-red-500",children:"close"})]},t.id)})}),v.length>0&&(0,a.jsxs)("p",{className:"text-xs text-amber-600 dark:text-amber-400 mt-2 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),g("providersBlocked",{count:v.length})]})]})]})]}),(0,a.jsx)(p,{}),(0,a.jsx)(h,{})]})}var g=s(67671);let f=["#6366f1","#22c55e","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#ec4899","#14b8a6"];function j(){let[e,t]=(0,l.useState)({}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(""),[x,u]=(0,l.useState)(""),[h,p]=(0,l.useState)(!1),b=(0,g.i)(),j=(0,d.c)("settings"),y=(0,d.c)("common"),v=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/fallback/chains");if(e.ok){let s=await e.json();t(s.chains||s||{})}}catch{}finally{r(!1)}},[]);(0,l.useEffect)(()=>{v()},[v]);let N=async()=>{if(!o.trim()||!x.trim())return void b.warning(j("fillModelAndProviders"));let e=x.split(",").map(e=>e.trim()).filter(Boolean).map((e,t)=>({provider:e,priority:t+1,enabled:!0}));if(0===e.length)return void b.warning(j("addAtLeastOneProvider"));p(!0);try{(await fetch("/api/fallback/chains",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:o.trim(),chain:e})})).ok?(b.success(j("chainCreated",{model:o.trim()})),m(""),u(""),n(!1),await v()):b.error(j("failedCreateChain"))}catch{b.error(j("failedCreateChain"))}finally{p(!1)}},k=async e=>{if(confirm(j("deleteChainConfirm",{model:e})))try{(await fetch("/api/fallback/chains",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:e})})).ok?(b.success(j("chainDeleted",{model:e})),await v()):b.error(j("failedDeleteChain"))}catch{b.error(j("failedDeleteChain"))}};if(s)return(0,a.jsx)(c.Zp,{className:"p-6 mt-6",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted animate-pulse",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"timeline"}),j("loadingFallbackChains")]})});let w=Object.entries(e);return(0,a.jsxs)(c.Zp,{className:"mt-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4 p-6 pb-0",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-cyan-500/10 text-cyan-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"timeline"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:j("fallbackChainsTitle")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:j("fallbackChainsDesc")})]}),(0,a.jsx)(c.$n,{size:"sm",variant:"primary",onClick:()=>n(!i),children:i?y("cancel"):j("addChain")})]}),i&&(0,a.jsxs)("div",{className:"mx-6 p-4 rounded-lg border border-border/30 bg-surface/20 mb-4",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 mb-3",children:[(0,a.jsx)(c.pd,{label:j("modelName"),placeholder:j("modelNamePlaceholder"),value:o,onChange:e=>m(e.target.value)}),(0,a.jsx)(c.pd,{label:j("providersCommaSeparated"),placeholder:j("providersCommaSeparatedPlaceholder"),value:x,onChange:e=>u(e.target.value)})]}),(0,a.jsx)(c.$n,{variant:"primary",size:"sm",onClick:N,loading:h,children:j("createChain")})]}),(0,a.jsx)("div",{className:"px-6 pb-6",children:0===w.length?(0,a.jsx)(c.pp,{icon:"timeline",title:j("noFallbackChains"),description:j("noFallbackChainsDesc")}):(0,a.jsx)("div",{className:"flex flex-col gap-2",children:w.map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 rounded-lg border border-border/20 bg-surface/20 hover:bg-surface/40 transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,a.jsx)("span",{className:"font-mono text-sm text-text-main truncate max-w-[200px]",children:e}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("div",{className:"flex gap-1.5 flex-wrap",children:(Array.isArray(t)?t:[]).map((e,t)=>(0,a.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded-full font-medium",style:{backgroundColor:`${f[t%f.length]}20`,color:f[t%f.length],border:`1px solid ${f[t%f.length]}40`},children:[t+1,". ",e.provider]},`${e.provider}-${t}`))})]}),(0,a.jsx)("button",{onClick:()=>k(e),className:"text-text-muted hover:text-red-400 transition-colors ml-2",title:j("deleteChain"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},e))})})]})}let y=[{value:"fill-first",labelKey:"fillFirst",descKey:"fillFirstDesc",icon:"vertical_align_top"},{value:"round-robin",labelKey:"roundRobin",descKey:"roundRobinDesc",icon:"loop"},{value:"p2c",labelKey:"p2c",descKey:"p2cDesc",icon:"balance"},{value:"random",labelKey:"random",descKey:"randomDesc",icon:"shuffle"},{value:"least-used",labelKey:"leastUsed",descKey:"leastUsedDesc",icon:"low_priority"},{value:"cost-optimized",labelKey:"costOpt",descKey:"costOptDesc",icon:"savings"}];function v(){let[e,t]=(0,l.useState)({fallbackStrategy:"fill-first"}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)([]),[o,m]=(0,l.useState)(""),[x,u]=(0,l.useState)(""),h=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{t(e),n(e.wildcardAliases||[]),r(!1)}).catch(()=>r(!1))},[]);let p=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&t(t=>({...t,...e}))}catch(e){console.error("Failed to update settings:",e)}},b=async()=>{if(!o.trim()||!x.trim())return;let e=[...i,{pattern:o.trim(),target:x.trim()}];await p({wildcardAliases:e}),n(e),m(""),u("")},g=async e=>{let t=i.filter((t,s)=>s!==e);await p({wildcardAliases:t}),n(t)};return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(c.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]","aria-hidden":"true",children:"route"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:h("routingStrategy")})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-2 mb-4",style:{gridAutoRows:"1fr"},children:y.map(t=>(0,a.jsxs)("button",{onClick:()=>p({fallbackStrategy:t.value}),disabled:s,className:`flex flex-col items-center gap-2 p-4 rounded-lg border text-center transition-all ${e.fallbackStrategy===t.value?"border-blue-500/50 bg-blue-500/5 ring-1 ring-blue-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[24px] ${e.fallbackStrategy===t.value?"text-blue-400":"text-text-muted"}`,children:t.icon}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:`text-sm font-medium ${e.fallbackStrategy===t.value?"text-blue-400":""}`,children:h(t.labelKey)}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:h(t.descKey)})]})]},t.value))}),"round-robin"===e.fallbackStrategy&&(0,a.jsxs)("div",{className:"flex items-center justify-between pt-3 border-t border-border/30",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:h("stickyLimit")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:h("stickyLimitDesc")})]}),(0,a.jsx)(c.pd,{type:"number",min:"1",max:"10",value:e.stickyRoundRobinLimit||3,onChange:e=>p({stickyRoundRobinLimit:parseInt(e.target.value)}),disabled:s,className:"w-20 text-center"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted italic pt-3 border-t border-border/30 mt-3",children:h({"fill-first":"fillFirstDesc","round-robin":"roundRobinDesc",p2c:"p2cDesc",random:"randomDesc","least-used":"leastUsedDesc","cost-optimized":"costOptDesc"}[e.fallbackStrategy]||"fillFirstDesc")})]}),(0,a.jsxs)(c.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]","aria-hidden":"true",children:"alt_route"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:h("modelAliases")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:h("modelAliasesDesc")})]})]}),i.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-1.5 mb-4",children:i.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 rounded-lg bg-surface/30 border border-border/20",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2 text-sm",children:[(0,a.jsx)("span",{className:"font-mono text-purple-400 break-all",children:e.pattern}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("span",{className:"font-mono text-text-main break-all",children:e.target})]}),(0,a.jsx)("button",{onClick:()=>g(t),className:"shrink-0 text-text-muted hover:text-red-400 transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},t))}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2 items-stretch sm:items-end",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(c.pd,{label:h("pattern"),placeholder:h("aliasPatternPlaceholder"),value:o,onChange:e=>m(e.target.value)})}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(c.pd,{label:h("targetModel"),placeholder:h("aliasTargetPlaceholder"),value:x,onChange:e=>u(e.target.value)})}),(0,a.jsx)(c.$n,{size:"sm",variant:"primary",onClick:b,className:"mb-[2px] sm:w-auto w-full",children:h("add")})]})]}),(0,a.jsx)(j,{})]})}function N(){let[e,t]=(0,l.useState)({strategy:"priority",maxRetries:1,retryDelayMs:2e3,timeoutMs:12e4,healthCheckEnabled:!0,healthCheckTimeoutMs:3e3,maxComboDepth:3,trackMetrics:!0}),[s,r]=(0,l.useState)({}),[n,o]=(0,l.useState)(""),[m,x]=(0,l.useState)(!1),u=(0,d.c)("settings"),h=(0,d.c)("common"),p=[{value:"priority",label:u("priority"),icon:"sort"},{value:"weighted",label:u("weighted"),icon:"percent"},{value:"round-robin",label:u("roundRobin"),icon:"autorenew"},{value:"random",label:u("random"),icon:"shuffle"},{value:"least-used",label:u("leastUsed"),icon:"low_priority"},{value:"cost-optimized",label:u("costOpt"),icon:"savings"}],b=[{key:"maxRetries",label:u("maxRetriesLabel"),min:0,max:5},{key:"retryDelayMs",label:u("retryDelayLabel"),min:500,max:1e4,step:500},{key:"timeoutMs",label:u("timeoutLabel"),min:5e3,max:3e5,step:5e3},{key:"maxComboDepth",label:u("maxNestingDepth"),min:1,max:10}];(0,l.useEffect)(()=>{fetch("/api/settings/combo-defaults").then(e=>e.json()).then(e=>{e.comboDefaults&&t(e.comboDefaults),e.providerOverrides&&r(e.providerOverrides)}).catch(e=>console.error("Failed to fetch combo defaults:",e))},[]);let g=async()=>{x(!0);try{await fetch("/api/settings/combo-defaults",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboDefaults:e,providerOverrides:s})})}catch(e){console.error("Failed to save combo defaults:",e)}finally{x(!1)}},f=()=>{let e=n.trim().toLowerCase();e&&!s[e]&&(r(t=>({...t,[e]:{maxRetries:1,timeoutMs:12e4}})),o(""))};return(0,a.jsxs)(c.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-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"tune"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:u("comboDefaultsTitle")}),(0,a.jsx)("span",{className:"text-xs text-text-muted ml-auto",children:u("globalComboConfig")})]}),(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 text-sm",children:u("defaultStrategy")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("defaultStrategyDesc")})]}),(0,a.jsx)("div",{role:"tablist","aria-label":u("comboStrategyAria"),className:"grid grid-cols-3 gap-1 p-0.5 rounded-md bg-black/5 dark:bg-white/5",children:p.map(s=>(0,a.jsxs)("button",{role:"tab","aria-selected":e.strategy===s.value,onClick:()=>t(e=>({...e,strategy:s.value})),className:(0,i.cn)("px-2 py-1 rounded text-xs font-medium transition-all flex items-center justify-center gap-0.5",e.strategy===s.value?"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-[14px]",children:s.icon}),s.label]},s.value))})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3 pt-3 border-t border-border/50",children:b.map(({key:s,label:l,min:r,max:i,step:n})=>(0,a.jsx)(c.pd,{label:l,type:"number",min:r,max:i,step:n||1,value:e[s]??"",onChange:e=>t(t=>({...t,[s]:parseInt(e.target.value)||0})),className:"text-sm"},s))}),"round-robin"===e.strategy&&(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 pt-3 border-t border-border/50",children:[(0,a.jsx)(c.pd,{label:u("concurrencyPerModel"),type:"number",min:1,max:20,value:e.concurrencyPerModel??"",placeholder:"3",onChange:e=>t(t=>({...t,concurrencyPerModel:parseInt(e.target.value)||0})),className:"text-sm"}),(0,a.jsx)(c.pd,{label:u("queueTimeout"),type:"number",min:1e3,max:12e4,step:1e3,value:e.queueTimeoutMs??"",placeholder:"30000",onChange:e=>t(t=>({...t,queueTimeoutMs:parseInt(e.target.value)||0})),className:"text-sm"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 pt-3 border-t border-border/50",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:u("healthCheck")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("healthCheckDesc")})]}),(0,a.jsx)(c.lM,{checked:!1!==e.healthCheckEnabled,onChange:()=>t(e=>({...e,healthCheckEnabled:!e.healthCheckEnabled}))})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:u("trackMetrics")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("trackMetricsDesc")})]}),(0,a.jsx)(c.lM,{checked:!1!==e.trackMetrics,onChange:()=>t(e=>({...e,trackMetrics:!e.trackMetrics}))})]})]}),(0,a.jsxs)("div",{className:"pt-3 border-t border-border/50",children:[(0,a.jsx)("p",{className:"font-medium text-sm mb-2",children:u("providerOverrides")}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:u("providerOverridesDesc")}),Object.entries(s).map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2 p-2 rounded-lg bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,a.jsx)("span",{className:"text-xs font-mono font-medium min-w-[80px]",children:e}),(0,a.jsx)(c.pd,{type:"number",min:"0",max:"5",value:t.maxRetries??1,onChange:t=>r(s=>({...s,[e]:{...s[e],maxRetries:parseInt(t.target.value)||0}})),className:"text-xs w-16","aria-label":u("providerMaxRetriesAria",{provider:e})}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:u("retries")}),(0,a.jsx)(c.pd,{type:"number",min:"5000",max:"300000",step:"5000",value:t.timeoutMs??12e4,onChange:t=>r(s=>({...s,[e]:{...s[e],timeoutMs:parseInt(t.target.value)||12e4}})),className:"text-xs w-24","aria-label":u("providerTimeoutAria",{provider:e})}),(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:u("ms")}),(0,a.jsx)("button",{onClick:()=>{r(t=>{let s={...t};return delete s[e],s})},className:"ml-auto text-red-400 hover:text-red-500 transition-colors","aria-label":u("removeProviderOverrideAria",{provider:e}),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"close"})})]},e)),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,a.jsx)(c.pd,{type:"text",placeholder:u("newProviderNamePlaceholder"),value:n,onChange:e=>o(e.target.value),onKeyDown:e=>"Enter"===e.key&&f(),className:"text-xs flex-1","aria-label":u("newProviderNameAria")}),(0,a.jsx)(c.$n,{variant:"outline",size:"sm",onClick:f,disabled:!n.trim(),children:h("add")})]})]}),(0,a.jsx)("div",{className:"pt-3 border-t border-border/50",children:(0,a.jsx)(c.$n,{variant:"primary",size:"sm",onClick:g,loading:m,children:u("saveComboDefaults")})})]})]})}function k(){let[e,t]=(0,l.useState)(!1),[s,r]=(0,l.useState)(null),i=(0,l.useRef)(!0),n=(0,d.c)("settings"),o=(0,d.c)("common"),m=async()=>{try{let e=await fetch("/api/settings/proxy?level=global");if(e.ok){let t=await e.json();r(t.proxy||null)}}catch{}};return(0,l.useEffect)(()=>(i.current=!0,async function(){try{let e=await fetch("/api/settings/proxy?level=global");if(!i.current)return;if(e.ok){let t=await e.json();i.current&&r(t.proxy||null)}}catch{}}(),()=>{i.current=!1}),[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"vpn_lock"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:n("globalProxy")})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:n("globalProxyDesc")}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[s?(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)("span",{className:"px-2.5 py-1 rounded text-xs font-bold uppercase bg-emerald-500/15 text-emerald-400 border border-emerald-500/30",children:[s.type,"://",s.host,":",s.port]})}):(0,a.jsx)("span",{className:"text-sm text-text-muted",children:n("noGlobalProxy")}),(0,a.jsx)(c.$n,{size:"sm",variant:s?"secondary":"primary",icon:"settings",onClick:()=>{m(),t(!0)},children:s?o("edit"):n("configure")})]})]})}),(0,a.jsx)(c.KN,{isOpen:e,onClose:()=>t(!1),level:"global",levelLabel:n("globalLabel"),onSaved:m})]})}var w=s(97550),C=s(76851);function S(){let{theme:e,setTheme:t,isDark:s}=(0,w.D)(),{colorTheme:r,customColor:n,setColorTheme:o,setCustomColorTheme:m}=(0,C.A)(),x=(0,d.c)("settings"),[u,h]=(0,l.useState)({}),[p,b]=(0,l.useState)(!0),[g,f]=(0,l.useState)(n||"#3b82f6"),j=/^#([0-9a-fA-F]{6})$/.test(g.startsWith("#")?g:`#${g}`);(0,l.useEffect)(()=>C.A.subscribe(e=>{e.customColor&&e.customColor!==g&&f(e.customColor)}),[]);let y={light:x("themeLight"),dark:x("themeDark"),system:x("themeSystem")};(0,l.useEffect)(()=>{fetch("/api/settings").then(e=>{if(!e.ok)throw Error(`HTTP error ${e.status}`);return e.json()}).then(e=>{h(e),b(!1)}).catch(()=>b(!1))},[]);let v=async(e,t)=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[e]:t})})).ok&&h(s=>({...s,[e]:t}))}catch(t){console.error(`Failed to update ${e}:`,t)}},N=[{id:"coral",color:C.F.coral,label:x("themeCoral")},{id:"blue",color:C.F.blue,label:x("themeBlue")},{id:"red",color:C.F.red,label:x("themeRed")},{id:"green",color:C.F.green,label:x("themeGreen")},{id:"violet",color:C.F.violet,label:x("themeViolet")},{id:"orange",color:C.F.orange,label:x("themeOrange")},{id:"cyan",color:C.F.cyan,label:x("themeCyan")}];return(0,a.jsxs)(c.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]","aria-hidden":"true",children:"palette"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold",children:x("appearance")})]}),(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:x("darkMode")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x("switchThemes")})]}),(0,a.jsx)(c.lM,{checked:s,onChange:()=>t(s?"light":"dark")})]}),(0,a.jsx)("div",{className:"pt-4 border-t border-border",children:(0,a.jsx)("div",{role:"tablist","aria-label":x("themeSelectionAria"),className:"inline-flex p-1 rounded-lg bg-black/5 dark:bg-white/5",children:["light","dark","system"].map(s=>(0,a.jsxs)("button",{role:"tab","aria-selected":e===s,onClick:()=>t(s),className:(0,i.cn)("flex items-center gap-2 px-4 py-2 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-[20px]","aria-hidden":"true",children:"light"===s?"light_mode":"dark"===s?"dark_mode":"contrast"}),(0,a.jsx)("span",{children:y[s]||s})]},s))})}),(0,a.jsxs)("div",{className:"pt-4 border-t border-border",children:[(0,a.jsx)("p",{className:"font-medium mb-1",children:x("themeAccent")}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-3",children:x("themeAccentDesc")}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 mb-3",children:N.map(e=>{let t=r===e.id;return(0,a.jsx)("button",{onClick:()=>o(e.id),className:(0,i.cn)("flex items-center justify-between gap-2 p-2 rounded-lg border transition-colors",t?"border-primary bg-primary/10 text-primary":"border-border hover:bg-surface/50 text-text-main"),children:(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"size-4 rounded-full border border-black/10 dark:border-white/20",style:{backgroundColor:e.color}}),(0,a.jsx)("span",{className:"text-sm font-medium",children:e.label})]})},e.id)})}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"color",value:g,onChange:e=>f(e.target.value),className:"h-10 w-12 rounded border border-border bg-surface cursor-pointer","aria-label":x("themeCustom")}),(0,a.jsx)("input",{type:"text",value:g,onChange:e=>f(e.target.value),placeholder:"#3b82f6",maxLength:7,className:`flex-1 h-10 px-3 rounded-lg bg-surface border text-sm text-text-main focus:outline-none ${j?"border-border focus:border-primary":"border-red-400 focus:border-red-500"}`}),(0,a.jsx)(c.$n,{onClick:()=>m(g),disabled:!j,children:x("themeCreate")})]})]}),(0,a.jsx)("div",{className:"pt-4 border-t border-border",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:x("hideHealthLogs")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x("hideHealthLogsDesc")})]}),(0,a.jsx)(c.lM,{checked:!0===u.hideHealthCheckLogs,onChange:()=>v("hideHealthCheckLogs",!u.hideHealthCheckLogs),disabled:p})]})})]})]})}let D=[{value:"passthrough",labelKey:"passthrough",descKey:"passthroughDesc",icon:"arrow_forward"},{value:"auto",labelKey:"auto",descKey:"autoDesc",icon:"auto_awesome"},{value:"custom",labelKey:"custom",descKey:"customDesc",icon:"tune"},{value:"adaptive",labelKey:"adaptive",descKey:"adaptiveDesc",icon:"trending_up"}],P=[{value:"none",labelKey:"effortNone"},{value:"low",labelKey:"effortLow"},{value:"medium",labelKey:"effortMedium"},{value:"high",labelKey:"effortHigh"}];function $(){let[e,t]=(0,l.useState)({mode:"passthrough",customBudget:10240,effortLevel:"medium"}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(""),x=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings/thinking-budget").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let u=async s=>{let a={...e,...s};t(a),n(!0),m("");try{(await fetch("/api/settings/thinking-budget",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok?(m("saved"),setTimeout(()=>m(""),2e3)):m("error")}catch{m("error")}finally{n(!1)}};return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-violet-500/10 text-violet-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"psychology"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:x("thinkingBudgetTitle")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x("thinkingBudgetDesc")})]}),"saved"===o&&(0,a.jsxs)("span",{className:"ml-auto text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," ",x("saved")]})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2 mb-5",children:D.map(t=>(0,a.jsxs)("button",{onClick:()=>u({mode:t.value}),disabled:s||i,className:`flex items-start gap-3 p-3 rounded-lg border text-left transition-all ${e.mode===t.value?"border-violet-500/50 bg-violet-500/5 ring-1 ring-violet-500/20":"border-border/50 hover:border-border hover:bg-surface/30"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[20px] mt-0.5 ${e.mode===t.value?"text-violet-500":"text-text-muted"}`,children:t.icon}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:`text-sm font-medium ${e.mode===t.value?"text-violet-400":""}`,children:x(t.labelKey)}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5 leading-relaxed",children:x(t.descKey)})]})]},t.value))}),"custom"===e.mode&&(0,a.jsxs)("div",{className:"p-4 rounded-lg bg-surface/30 border border-border/30 mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:x("tokenBudget")}),(0,a.jsxs)("span",{className:"text-sm font-mono tabular-nums text-violet-400",children:[e.customBudget.toLocaleString()," ",x("tokens")]})]}),(0,a.jsx)("input",{type:"range",min:"0",max:"131072",step:"1024",value:e.customBudget,onChange:e=>u({customBudget:parseInt(e.target.value)}),className:"w-full accent-violet-500"}),(0,a.jsxs)("div",{className:"flex justify-between text-xs text-text-muted mt-1",children:[(0,a.jsx)("span",{children:x("off")}),(0,a.jsx)("span",{children:"1K"}),(0,a.jsx)("span",{children:"10K"}),(0,a.jsx)("span",{children:"64K"}),(0,a.jsx)("span",{children:"128K"})]})]}),"adaptive"===e.mode&&(0,a.jsxs)("div",{className:"p-4 rounded-lg bg-surface/30 border border-border/30",children:[(0,a.jsx)("p",{className:"text-sm font-medium mb-3",children:x("baseEffortLevel")}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:x("adaptiveHint")}),(0,a.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:P.map(t=>(0,a.jsx)("button",{onClick:()=>u({effortLevel:t.value}),disabled:s||i,className:`px-3 py-2 rounded-lg text-xs font-medium border transition-all ${e.effortLevel===t.value?"border-violet-500/50 bg-violet-500/10 text-violet-400":"border-border/50 text-text-muted hover:border-border"}`,children:x(t.labelKey)},t.value))})]})]})}function A(){let[e,t]=(0,l.useState)({enabled:!1,prompt:""}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(""),[o,m]=(0,l.useState)(null),x=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings/system-prompt").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let u=async s=>{let a={...e,...s};t(a),n("");try{(await fetch("/api/settings/system-prompt",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok&&(n("saved"),setTimeout(()=>n(""),2e3))}catch{n("error")}};return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"edit_note"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:x("globalSystemPrompt")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:x("systemPromptDesc")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:["saved"===i&&(0,a.jsxs)("span",{className:"text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," ",x("saved")]}),(0,a.jsx)(c.lM,{checked:e.enabled,onChange:()=>u({enabled:!e.enabled}),disabled:s})]})]}),e.enabled&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("textarea",{value:e.prompt,onChange:e=>{var s;return s=e.target.value,void(t(e=>({...e,prompt:s})),o&&clearTimeout(o),m(setTimeout(()=>{u({prompt:s})},800)))},placeholder:x("systemPromptPlaceholder"),rows:5,className:"w-full px-4 py-3 rounded-lg border border-border/50 bg-surface/30 text-sm placeholder:text-text-muted/50 resize-y min-h-[120px] focus:outline-none focus:ring-1 focus:ring-amber-500/30 focus:border-amber-500/50 transition-colors",disabled:s}),(0,a.jsx)("div",{className:"absolute bottom-2 right-3 text-xs text-text-muted/60 tabular-nums",children:x("chars",{count:e.prompt.length})})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted/70 flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"}),x("systemPromptHint")]})]})]})}function T(){let[e,t]=(0,l.useState)({}),[s,r]=(0,l.useState)({}),[i,n]=(0,l.useState)(!0),[o,m]=(0,l.useState)(!1),[x,u]=(0,l.useState)(""),[h,p]=(0,l.useState)(""),[b,g]=(0,l.useState)(""),f=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings/model-aliases").then(e=>e.json()).then(e=>{t(e.builtIn||{}),r(e.custom||{}),n(!1)}).catch(()=>n(!1))},[]);let j=async()=>{if(h.trim()&&b.trim()){m(!0);try{let e=await fetch("/api/settings/model-aliases",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:h.trim(),to:b.trim()})});if(e.ok){let t=await e.json();r(t.custom),p(""),g(""),u("saved"),setTimeout(()=>u(""),2e3)}}catch{u("error")}finally{m(!1)}}},y=async e=>{m(!0);try{let t=await fetch("/api/settings/model-aliases",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:e})});if(t.ok){let e=await t.json();r(e.custom),u("saved"),setTimeout(()=>u(""),2e3)}}catch{u("error")}finally{m(!1)}},v=Object.entries(e),N=Object.entries(s);return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-amber-500/10 text-amber-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"swap_horiz"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:f("modelAliasesTitle")||"Model Aliases"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:f("modelAliasesDesc")||"Auto-forward deprecated model IDs to their replacements"})]}),"saved"===x&&(0,a.jsxs)("span",{className:"ml-auto text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," ",f("saved")||"Saved"]})]}),(0,a.jsxs)("div",{className:"p-4 rounded-lg bg-surface/30 border border-border/30 mb-4",children:[(0,a.jsx)("p",{className:"text-sm font-medium mb-3",children:f("addCustomAlias")||"Add Custom Alias"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"text",placeholder:f("deprecatedModelId")||"Deprecated model ID",value:h,onChange:e=>p(e.target.value),className:"flex-1 px-3 py-2 rounded-lg text-sm bg-surface border border-border/50 focus:border-amber-500/50 focus:outline-none"}),(0,a.jsx)("span",{className:"text-text-muted text-lg",children:"→"}),(0,a.jsx)("input",{type:"text",placeholder:f("newModelId")||"New model ID",value:b,onChange:e=>g(e.target.value),className:"flex-1 px-3 py-2 rounded-lg text-sm bg-surface border border-border/50 focus:border-amber-500/50 focus:outline-none"}),(0,a.jsx)("button",{onClick:j,disabled:o||!h.trim()||!b.trim(),className:"px-4 py-2 rounded-lg text-sm font-medium bg-amber-500/10 text-amber-500 hover:bg-amber-500/20 disabled:opacity-50 transition-all",children:f("add")||"Add"})]})]}),N.length>0&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("p",{className:"text-xs font-medium text-text-muted uppercase tracking-wider mb-2",children:f("customAliases")||"Custom Aliases"}),(0,a.jsx)("div",{className:"rounded-lg border border-border/30 divide-y divide-border/20",children:N.map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[(0,a.jsx)("code",{className:"text-xs text-red-400/80 flex-1 truncate",children:e}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("code",{className:"text-xs text-emerald-400/80 flex-1 truncate",children:t}),(0,a.jsx)("button",{onClick:()=>y(e),disabled:o,className:"p-1 rounded hover:bg-red-500/10 text-text-muted hover:text-red-400 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},e))})]}),(0,a.jsxs)("details",{className:"group",children:[(0,a.jsxs)("summary",{className:"text-xs font-medium text-text-muted uppercase tracking-wider cursor-pointer flex items-center gap-1 mb-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] group-open:rotate-90 transition-transform",children:"chevron_right"}),f("builtInAliases")||"Built-in Aliases"," (",v.length,")"]}),(0,a.jsx)("div",{className:"rounded-lg border border-border/30 divide-y divide-border/20 max-h-60 overflow-y-auto",children:v.map(([e,t])=>(0,a.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2 opacity-60",children:[(0,a.jsx)("code",{className:"text-xs text-red-400/60 flex-1 truncate",children:e}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("code",{className:"text-xs text-emerald-400/60 flex-1 truncate",children:t}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"lock"})]},e))})]})]})}function L(){let[e,t]=(0,l.useState)({enabled:!1,degradationMap:{},detectionPatterns:[],stats:{detected:0,tokensSaved:0}}),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(""),[x,u]=(0,l.useState)(""),[h,p]=(0,l.useState)(""),[b,g]=(0,l.useState)(""),f=(0,d.c)("settings");(0,l.useEffect)(()=>{fetch("/api/settings/background-degradation").then(e=>e.json()).then(e=>{t(e),r(!1)}).catch(()=>r(!1))},[]);let j=async s=>{let a={...e,...s};t(a),n(!0),m("");try{let{stats:e,...s}=a,l=await fetch("/api/settings/background-degradation",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(l.ok){let e=await l.json();t(e),m("saved"),setTimeout(()=>m(""),2e3)}else m("error")}catch{m("error")}finally{n(!1)}},y=Object.entries(e.degradationMap||{});return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-sky-500/10 text-sky-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"speed"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:f("backgroundDegradationTitle")||"Background Task Degradation"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:f("backgroundDegradationDesc")||"Auto-redirect background requests (titles, summaries) to cheaper models"})]}),"saved"===o&&(0,a.jsxs)("span",{className:"text-xs font-medium text-emerald-500 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"})," ",f("saved")||"Saved"]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-lg bg-surface/30 border border-border/30 mb-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:f("enableDegradation")||"Enable Background Degradation"}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:f("enableDegradationHint")||"Automatically use cheaper models for background utility tasks"})]}),(0,a.jsx)("button",{onClick:()=>j({enabled:!e.enabled}),disabled:s||i,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${e.enabled?"bg-sky-500":"bg-white/10"}`,children:(0,a.jsx)("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform ${e.enabled?"translate-x-6":"translate-x-1"}`})})]}),e.stats&&e.stats.detected>0&&(0,a.jsx)("div",{className:"flex items-center gap-4 p-3 rounded-lg bg-sky-500/5 border border-sky-500/20 mb-4",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-sky-400",children:"analytics"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[f("tasksDetected")||"Tasks detected",":"]}),(0,a.jsx)("span",{className:"text-sm font-mono font-semibold text-sky-400",children:e.stats.detected})]})}),e.enabled&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("p",{className:"text-xs font-medium text-text-muted uppercase tracking-wider mb-2",children:f("degradationMap")||"Model Degradation Map"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("input",{type:"text",placeholder:f("premiumModel")||"Premium model",value:x,onChange:e=>u(e.target.value),className:"flex-1 px-3 py-2 rounded-lg text-sm bg-surface border border-border/50 focus:border-sky-500/50 focus:outline-none"}),(0,a.jsx)("span",{className:"text-text-muted text-lg",children:"→"}),(0,a.jsx)("input",{type:"text",placeholder:f("cheapModel")||"Cheap model",value:h,onChange:e=>p(e.target.value),className:"flex-1 px-3 py-2 rounded-lg text-sm bg-surface border border-border/50 focus:border-sky-500/50 focus:outline-none"}),(0,a.jsx)("button",{onClick:()=>{x.trim()&&h.trim()&&(j({degradationMap:{...e.degradationMap,[x.trim()]:h.trim()}}),u(""),p(""))},disabled:i||!x.trim()||!h.trim(),className:"px-3 py-2 rounded-lg text-sm font-medium bg-sky-500/10 text-sky-500 hover:bg-sky-500/20 disabled:opacity-50 transition-all",children:f("add")||"Add"})]}),y.length>0&&(0,a.jsx)("div",{className:"rounded-lg border border-border/30 divide-y divide-border/20 max-h-48 overflow-y-auto",children:y.map(([t,s])=>(0,a.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2",children:[(0,a.jsx)("code",{className:"text-xs text-orange-400/80 flex-1 truncate",children:t}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"arrow_forward"}),(0,a.jsx)("code",{className:"text-xs text-sky-400/80 flex-1 truncate",children:s}),(0,a.jsx)("button",{onClick:()=>{let s;return s={...e.degradationMap},void(delete s[t],j({degradationMap:s}))},disabled:i,className:"p-1 rounded hover:bg-red-500/10 text-text-muted hover:text-red-400 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},t))})]}),(0,a.jsxs)("details",{className:"group",children:[(0,a.jsxs)("summary",{className:"text-xs font-medium text-text-muted uppercase tracking-wider cursor-pointer flex items-center gap-1 mb-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] group-open:rotate-90 transition-transform",children:"chevron_right"}),f("detectionPatterns")||"Detection Patterns"," (",e.detectionPatterns?.length||0,")"]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("input",{type:"text",placeholder:f("newPattern")||'e.g. "generate a title"',value:b,onChange:e=>g(e.target.value),className:"flex-1 px-3 py-2 rounded-lg text-sm bg-surface border border-border/50 focus:border-sky-500/50 focus:outline-none"}),(0,a.jsx)("button",{onClick:()=>{b.trim()&&(j({detectionPatterns:[...e.detectionPatterns,b.trim()]}),g(""))},disabled:i||!b.trim(),className:"px-3 py-2 rounded-lg text-sm font-medium bg-sky-500/10 text-sky-500 hover:bg-sky-500/20 disabled:opacity-50 transition-all",children:f("add")||"Add"})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:(e.detectionPatterns||[]).map((t,s)=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-2.5 py-1 rounded-full text-xs bg-sky-500/10 text-sky-400 border border-sky-500/20",children:[t,(0,a.jsx)("button",{onClick:()=>{j({detectionPatterns:e.detectionPatterns.filter((e,t)=>t!==s)})},className:"hover:text-red-400 transition-colors",disabled:i,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},s))})]})]})]})}function M(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!1),i=(0,d.c)("settings"),n=()=>{fetch("/api/cache/stats").then(e=>e.json()).then(t).catch(()=>{})};(0,l.useEffect)(n,[]);let o=async()=>{r(!0);try{await fetch("/api/cache/stats",{method:"DELETE"}),n()}finally{r(!1)}};return(0,a.jsxs)(c.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h3",{className:"text-lg font-semibold text-text-main flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"cached"}),i("promptCache")]}),(0,a.jsx)("button",{onClick:o,disabled:s,className:"px-3 py-1.5 text-xs rounded-lg bg-red-500/10 text-red-400 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:i(s?"flushing":"flushCache")})]}),e?(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:i("size")}),(0,a.jsxs)("p",{className:"font-mono text-lg text-text-main",children:[e.size,"/",e.maxSize]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:i("hitRate")}),(0,a.jsxs)("p",{className:"font-mono text-lg text-text-main",children:[e.hitRate?.toFixed(1)??0,"%"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:i("hits")}),(0,a.jsx)("p",{className:"font-mono text-text-main",children:e.hits??0})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-text-muted",children:i("evictions")}),(0,a.jsx)("p",{className:"font-mono text-text-main",children:e.evictions??0})]})]}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:i("loadingCacheStats")})]})}let E={CLOSED:{bg:"bg-emerald-500/15",text:"text-emerald-400",border:"border-emerald-500/30",icon:"check_circle"},OPEN:{bg:"bg-red-500/15",text:"text-red-400",border:"border-red-500/30",icon:"error"},HALF_OPEN:{bg:"bg-amber-500/15",text:"text-amber-400",border:"border-amber-500/30",icon:"warning"}},O={closed:{icon:"check_circle",color:"#22c55e"},"half-open":{icon:"pending",color:"#f59e0b"},open:{icon:"error",color:"#ef4444"}};function K(e,t){let s=String(e||"closed").toLowerCase().replaceAll("_","-");return t("open"===s?"breakerStateOpen":"half-open"===s?"breakerStateHalfOpen":"breakerStateClosed")}function F(e){return!e||e<=0?"—":e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}function _(e,t){return e instanceof Error&&e.message?e.message:t}function B({profiles:e,onSave:t,saving:s}){let[r,i]=(0,l.useState)(!1),[n,o]=(0,l.useState)(e),m=(0,d.c)("settings"),x=(0,d.c)("common");(0,l.useEffect)(()=>{o(e)},[e]);let u=e=>null==e?"—":`${e}${m("ms")}`,h=[{key:"transientCooldown",label:m("transientCooldown"),format:u},{key:"rateLimitCooldown",label:m("rateLimitCooldown"),format:u},{key:"maxBackoffLevel",label:m("maxBackoffLevel")},{key:"circuitBreakerThreshold",label:m("cbThreshold"),format:e=>null==e?"—":m("failures",{count:e})},{key:"circuitBreakerReset",label:m("cbResetTime"),format:u}];return(0,a.jsx)(c.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"tune"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:m("providerProfiles")})]}),r?(0,a.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",onClick:()=>i(!1),children:x("cancel")}),(0,a.jsx)(c.$n,{size:"sm",variant:"primary",icon:"save",onClick:()=>{t(n),i(!1)},disabled:s,children:x("save")})]}):(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>i(!0),children:x("edit")})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:m("providerProfilesDesc")}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:["oauth","apikey"].map(t=>(0,a.jsxs)("div",{className:"rounded-lg bg-black/5 dark:bg-white/5 p-4",children:[(0,a.jsxs)("h3",{className:"text-sm font-bold uppercase tracking-wider mb-3 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base","aria-hidden":"true",children:"oauth"===t?"lock":"key"}),"oauth"===t?m("oauthProviders"):m("apiKeyProviders")]}),(0,a.jsx)("div",{className:"space-y-2",children:h.map(({key:s,label:l,format:i})=>(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:l}),r?(0,a.jsx)("input",{type:"number",min:"0",value:n?.[t]?.[s]??0,onChange:e=>o({...n,[t]:{...n[t],[s]:Number(e.target.value)}}),className:"w-24 px-2 py-1 text-xs rounded bg-white/10 border border-white/20 text-right"}):(0,a.jsx)("span",{className:"text-sm font-mono",children:i?i(e?.[t]?.[s]):e?.[t]?.[s]??"—"})]},s))})]},t))})]})})}function z({rateLimitStatus:e,defaults:t,onSaveDefaults:s,saving:r}){let[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(t||{}),x=(0,d.c)("settings"),u=(0,d.c)("common");return(0,l.useEffect)(()=>{t&&m(t)},[t]),(0,a.jsx)(c.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"speed"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:x("rateLimiting")})]}),i?(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",onClick:()=>n(!1),children:u("cancel")}),(0,a.jsx)(c.$n,{size:"sm",variant:"primary",icon:"save",onClick:()=>{s(o),n(!1)},disabled:r,children:u("save")})]}):(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>n(!0),children:u("edit")})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:x("rateLimitingDesc")}),(0,a.jsxs)("div",{className:"rounded-lg bg-black/5 dark:bg-white/5 p-4 mb-4",children:[(0,a.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider mb-3 text-text-muted",children:x("defaultSafetyNet")}),(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[{key:"requestsPerMinute",label:x("rpm")},{key:"minTimeBetweenRequests",label:x("minGap"),format:F},{key:"concurrentRequests",label:x("maxConcurrent")}].map(({key:e,label:s,format:l})=>(0,a.jsxs)("div",{children:[i?(0,a.jsx)("input",{type:"number",min:"1",value:o[e]??0,onChange:t=>m(s=>({...s,[e]:parseInt(t.target.value)||0})),className:"w-full px-2 py-1 text-lg font-bold rounded bg-white/10 border border-white/20"}):(0,a.jsx)("div",{className:"text-lg font-bold",children:l?l(t?.[e]):t?.[e]??"—"}),(0,a.jsx)("div",{className:"text-xs text-text-muted",children:s})]},e))})]}),e&&e.length>0?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider text-text-muted",children:x("activeLimiters")}),e.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg bg-black/5 dark:bg-white/5",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:e.provider||e.key}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-text-muted",children:[null!=e.reservoir&&(0,a.jsxs)("span",{children:[x("reservoir"),": ",e.reservoir]}),null!=e.running&&(0,a.jsxs)("span",{children:[x("running"),": ",e.running]}),null!=e.queued&&(0,a.jsxs)("span",{children:[x("queued"),": ",e.queued]})]})]},t))]}):(0,a.jsx)("p",{className:"text-xs text-text-muted",children:x("noActiveLimiters")})]})})}function R({breakers:e,onReset:t,loading:s}){let l=e.filter(e=>"CLOSED"!==e.state),r=e.length,i=(0,d.c)("settings");return(0,a.jsx)(c.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"electrical_services"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:i("circuitBreakers")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:l.length>0?i("tripped",{count:l.length}):i("healthy",{count:r})}),l.length>0&&(0,a.jsx)(c.$n,{size:"sm",variant:"danger",icon:"restart_alt",onClick:t,disabled:s,children:i("resetAll")})]})]}),0===e.length?(0,a.jsx)("p",{className:"text-sm text-text-muted",children:i("noCircuitBreakers")}):(0,a.jsx)("div",{className:"space-y-2",children:e.map(e=>{let t=E[e.state]||E.CLOSED;return(0,a.jsxs)("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg bg-black/5 dark:bg-white/5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-base ${t.text}`,"aria-hidden":"true",children:t.icon}),(0,a.jsx)("span",{className:"text-sm font-medium",children:e.name.replace("combo:","")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[e.failureCount>0&&(0,a.jsx)("span",{className:"text-xs text-text-muted",children:i("failures",{count:e.failureCount})}),(0,a.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-bold uppercase ${t.bg} ${t.text} border ${t.border}`,children:K(e.state,i)})]})]},e.name)})})]})})}function I(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(null),m=(0,g.i)(),x=(0,o.Ym)(),u=(0,d.c)("settings"),h=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/policies");if(e.ok){let s=await e.json();t(s)}}catch{}finally{r(!1)}},[]);(0,l.useEffect)(()=>{h();let e=setInterval(h,15e3);return()=>clearInterval(e)},[h]);let p=async e=>{n(e);try{(await fetch("/api/policies",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"unlock",identifier:e})})).ok?(m.success(u("unlockedIdentifier",{identifier:e})),await h()):m.error(u("failedUnlock"))}catch{m.error(u("failedUnlock"))}finally{n(null)}},b=e?.circuitBreakers||[],f=e?.lockedIdentifiers||[],j=b.some(e=>"closed"!==e.state)||f.length>0;return s?(0,a.jsx)(c.Zp,{className:"p-6",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-text-muted animate-pulse",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"policy"}),u("loadingPolicies")]})}):(0,a.jsx)(c.Zp,{className:"p-0 overflow-hidden",children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary","aria-hidden":"true",children:"policy"}),(0,a.jsx)("h2",{className:"text-lg font-bold",children:u("policiesLocked")})]}),j&&(0,a.jsx)(c.$n,{size:"sm",variant:"ghost",onClick:h,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"refresh"})})]}),j?(0,a.jsxs)(a.Fragment,{children:[b.filter(e=>"closed"!==e.state).length>0&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-muted mb-2",children:u("circuitBreakers")}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:b.filter(e=>"closed"!==e.state).map((e,t)=>{let s=O[e.state]||O.open;return(0,a.jsx)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-surface/30 border border-border/20",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",style:{color:s.color},children:s.icon}),(0,a.jsx)("span",{className:"text-sm text-text-main font-medium",children:e.name||e.provider||u("unknown")}),(0,a.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded-full",style:{backgroundColor:`${s.color}15`,color:s.color},children:K(e.state,u)}),e.failures>0&&(0,a.jsx)("span",{className:"text-xs text-text-muted",children:u("failures",{count:e.failures})})]})},e.name||t)})})]}),f.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-muted mb-2",children:u("lockedIdentifiers")}),(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:f.map((e,t)=>{let s="string"==typeof e?e:e.identifier||e.id;return(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-surface/30 border border-border/20",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-red-400",children:"lock"}),(0,a.jsx)("span",{className:"font-mono text-sm text-text-main",children:s}),"object"==typeof e&&e.lockedAt&&(0,a.jsx)("span",{className:"text-xs text-text-muted",children:u("sinceDate",{date:new Date(e.lockedAt).toLocaleString(x)})})]}),(0,a.jsx)(c.$n,{size:"sm",variant:"ghost",onClick:()=>p(s),disabled:i===s,className:"text-xs",children:i===s?u("unlocking"):u("forceUnlock")})]},s||t)})})]})]}):(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"p-2 rounded-lg bg-emerald-500/10 text-emerald-500",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"verified_user"})}),(0,a.jsx)("div",{children:(0,a.jsx)("p",{className:"text-sm text-text-muted",children:u("allOperational")})})]})]})})}function q(){let[e,t]=(0,l.useState)(null),[s,r]=(0,l.useState)(!0),[i,n]=(0,l.useState)(!1),[o,m]=(0,l.useState)(null),x=(0,d.c)("settings"),u=(0,l.useCallback)(async()=>{try{r(!0);let e=await fetch("/api/resilience");if(!e.ok)throw Error(x("failedLoadWithStatus",{status:e.status}));let s=await e.json();t(s),m(null)}catch(e){m(_(e,x("failedLoadResilience")))}finally{r(!1)}},[x]);(0,l.useEffect)(()=>{u();let e=setInterval(u,1e4);return()=>clearInterval(e)},[u]);let h=async()=>{try{if(r(!0),!(await fetch("/api/resilience/reset",{method:"POST"})).ok)throw Error(x("resetFailed"));await u()}catch(e){m(_(e,x("resetFailed")))}finally{r(!1)}},p=async e=>{try{if(n(!0),!(await fetch("/api/resilience",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({profiles:e})})).ok)throw Error(x("saveFailed"));await u()}catch(e){m(_(e,x("saveFailed")))}finally{n(!1)}},b=async e=>{try{if(n(!0),!(await fetch("/api/resilience",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaults:e})})).ok)throw Error(x("saveFailed"));await u()}catch(e){m(_(e,x("saveFailed")))}finally{n(!1)}};return s&&!e?(0,a.jsxs)("div",{className:"flex items-center justify-center py-12 text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin mr-2",children:"hourglass_empty"}),x("loadingResilience")]}):o&&!e?(0,a.jsxs)(c.Zp,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined",children:"error"}),(0,a.jsx)("span",{className:"text-sm",children:o})]}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"refresh",onClick:u,className:"mt-3",children:x("retry")})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(B,{profiles:e?.profiles||{},onSave:p,saving:i}),(0,a.jsx)(z,{rateLimitStatus:e?.rateLimitStatus||[],defaults:e?.defaults||{},onSaveDefaults:b,saving:i}),(0,a.jsx)(R,{breakers:e?.circuitBreakers||[],onReset:h,loading:s}),(0,a.jsx)(I,{})]})}let Z=[{id:"general",labelKey:"general",icon:"settings"},{id:"ai",labelKey:"ai",icon:"smart_toy"},{id:"security",labelKey:"security",icon:"shield"},{id:"routing",labelKey:"routing",icon:"route"},{id:"resilience",labelKey:"resilience",icon:"electrical_services"},{id:"advanced",labelKey:"advanced",icon:"tune"}];function U(){let e=(0,d.c)("settings"),t=(0,r.useSearchParams)().get("tab"),[s,c]=(0,l.useState)(null),o=s||Z.find(e=>e.id===t)?.id||"general";return(0,a.jsx)("div",{className:"max-w-2xl mx-auto min-w-0",children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)("div",{className:"w-full overflow-x-auto pb-1",children:(0,a.jsx)("div",{role:"tablist","aria-label":e("settingsSectionsAria"),className:"inline-flex items-center p-1 rounded-lg bg-black/5 dark:bg-white/5 min-w-max",children:Z.map(t=>(0,a.jsxs)("button",{role:"tab","aria-selected":o===t.id,tabIndex:o===t.id?0:-1,onClick:()=>c(t.id),className:(0,i.cn)("flex items-center gap-2 px-4 py-2 rounded-md font-medium transition-all text-sm",o===t.id?"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]","aria-hidden":"true",children:t.icon}),(0,a.jsx)("span",{className:"hidden sm:inline whitespace-nowrap",children:e(t.labelKey)})]},t.id))})}),(0,a.jsxs)("div",{role:"tabpanel","aria-label":e(Z.find(e=>e.id===o)?.labelKey||"general"),children:["general"===o&&(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(m,{}),(0,a.jsx)(S,{})]})}),"ai"===o&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)($,{}),(0,a.jsx)(A,{}),(0,a.jsx)(M,{})]}),"security"===o&&(0,a.jsx)(b,{}),"routing"===o&&(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsx)(v,{}),(0,a.jsx)(N,{}),(0,a.jsx)(T,{}),(0,a.jsx)(L,{})]}),"resilience"===o&&(0,a.jsx)(q,{}),"advanced"===o&&(0,a.jsx)(k,{})]}),(0,a.jsxs)("div",{className:"text-center text-sm text-text-muted py-4",children:[(0,a.jsxs)("p",{children:[n.vQ.name," v",n.vQ.version]}),(0,a.jsx)("p",{className:"mt-1",children:e("localMode")})]})]})})}},13908:(e,t,s)=>{Promise.resolve().then(s.bind(s,3612))},40993:(e,t,s)=>{"use strict";s.d(t,{Ex:()=>c.default,$n:()=>a.default,Zp:()=>i.default,Qv:()=>d.CardSkeleton,G9:()=>j.default,bQ:()=>k.default,pp:()=>v.default,Qn:()=>N.default,pd:()=>l.default,Mh:()=>f.default,uR:()=>u.default,aF:()=>n.default,rq:()=>x.default,LF:()=>m.default,KN:()=>b.default,Lo:()=>g.default,y7:()=>p.default,Iz:()=>y.default,l6:()=>r.default,lM:()=>o.default,cn:()=>h.default});var a=s(35806),l=s(34422),r=s(42994),i=s(81060),n=s(71361),d=s(92542);s(17705);var c=s(80927),o=s(19790);s(6261),s(55846),s(34243),s(89938),s(99023);var m=s(80178),x=s(85444),u=s(91961);s(25112);var h=s(45624),p=s(37415),b=s(48643),g=s(8287);s(1652);var f=s(92701);s(18150);var j=s(71689),y=s(33709);s(76332);var v=s(66200);s(61580);var N=s(51503);s(54128);var k=s(44638);s(21720),s(97050)}},e=>{e.O(0,[8500,3418,9751,8055,1149,5846,647,8441,3794,7358],()=>e(e.s=13908)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[174,204,335,449,516,552,712,747,748,853,907,931,992,1070,1097,1110,1150,1288,1450,1451,1512,1566,1624,1625,1666,1701,1860,1873,1910,1949,2067,2121,2296,2310,2398,2410,2687,2708,2720,2797,2969,2970,3008,3015,3025,3038,3079,3102,3111,3246,3254,3394,3461,3471,3472,3499,3549,3585,3665,3857,3954,4062,4120,4286,4503,4554,4612,4866,4890,4896,4901,5018,5045,5079,5107,5177,5211,5266,5396,5466,5568,5616,5677,5693,5696,5730,5745,5867,5922,5982,6105,6162,6217,6268,6392,6442,6479,6529,6580,6671,6740,6819,6853,6988,6996,7176,7241,7249,7295,7346,7429,7442,7457,7473,7520,7545,7597,7607,7741,7758,7791,7855,7892,7899,7957,8167,8198,8199,8207,8246,8406,8453,8461,8489,8573,8592,8611,8648,8777,8809,8814,8870,8948,8974,8975,9027,9049,9069,9088,9097,9139,9141,9214,9321,9370,9389,9461,9492,9794,9998],{84441:()=>{}},_=>{_.O(0,[8441,3794,7358],()=>_(_.s=84441)),_N_E=_.O()}]);