omniroute 2.3.2 → 2.3.4

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 (245) hide show
  1. package/app/.next/BUILD_ID +1 -1
  2. package/app/.next/app-path-routes-manifest.json +42 -42
  3. package/app/.next/build-manifest.json +2 -2
  4. package/app/.next/prerender-manifest.json +3 -3
  5. package/app/.next/server/app/(dashboard)/dashboard/a2a/page_client-reference-manifest.js +1 -1
  6. package/app/.next/server/app/(dashboard)/dashboard/agents/page_client-reference-manifest.js +1 -1
  7. package/app/.next/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
  8. package/app/.next/server/app/(dashboard)/dashboard/api-manager/page_client-reference-manifest.js +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/audit-log/page_client-reference-manifest.js +1 -1
  10. package/app/.next/server/app/(dashboard)/dashboard/auto-combo/page_client-reference-manifest.js +1 -1
  11. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  12. package/app/.next/server/app/(dashboard)/dashboard/combos/page.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.js +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  17. package/app/.next/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
  18. package/app/.next/server/app/(dashboard)/dashboard/limits/page_client-reference-manifest.js +1 -1
  19. package/app/.next/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
  20. package/app/.next/server/app/(dashboard)/dashboard/mcp/page_client-reference-manifest.js +1 -1
  21. package/app/.next/server/app/(dashboard)/dashboard/media/page_client-reference-manifest.js +1 -1
  22. package/app/.next/server/app/(dashboard)/dashboard/onboarding/page_client-reference-manifest.js +1 -1
  23. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  24. package/app/.next/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  26. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  27. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  29. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  30. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  31. package/app/.next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
  32. package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  33. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  34. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  35. package/app/.next/server/app/.well-known/agent.json/route_client-reference-manifest.js +1 -1
  36. package/app/.next/server/app/400/page_client-reference-manifest.js +1 -1
  37. package/app/.next/server/app/401/page_client-reference-manifest.js +1 -1
  38. package/app/.next/server/app/403/page_client-reference-manifest.js +1 -1
  39. package/app/.next/server/app/408/page_client-reference-manifest.js +1 -1
  40. package/app/.next/server/app/429/page_client-reference-manifest.js +1 -1
  41. package/app/.next/server/app/500/page_client-reference-manifest.js +1 -1
  42. package/app/.next/server/app/502/page_client-reference-manifest.js +1 -1
  43. package/app/.next/server/app/503/page_client-reference-manifest.js +1 -1
  44. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  45. package/app/.next/server/app/_global-error.html +2 -2
  46. package/app/.next/server/app/_global-error.rsc +1 -1
  47. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  48. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  49. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  50. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  51. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  52. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  53. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  54. package/app/.next/server/app/a2a/route_client-reference-manifest.js +1 -1
  55. package/app/.next/server/app/api/a2a/status/route_client-reference-manifest.js +1 -1
  56. package/app/.next/server/app/api/a2a/tasks/[id]/cancel/route_client-reference-manifest.js +1 -1
  57. package/app/.next/server/app/api/a2a/tasks/[id]/route_client-reference-manifest.js +1 -1
  58. package/app/.next/server/app/api/a2a/tasks/route_client-reference-manifest.js +1 -1
  59. package/app/.next/server/app/api/acp/agents/route_client-reference-manifest.js +1 -1
  60. package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  61. package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  62. package/app/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  63. package/app/.next/server/app/api/cache/route_client-reference-manifest.js +1 -1
  64. package/app/.next/server/app/api/cache/stats/route_client-reference-manifest.js +1 -1
  65. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  66. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
  67. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +2 -2
  68. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
  69. package/app/.next/server/app/api/cli-tools/backups/route.js +1 -1
  70. package/app/.next/server/app/api/cli-tools/backups/route_client-reference-manifest.js +1 -1
  71. package/app/.next/server/app/api/cli-tools/claude-settings/route.js +1 -1
  72. package/app/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
  73. package/app/.next/server/app/api/cli-tools/cline-settings/route.js +1 -1
  74. package/app/.next/server/app/api/cli-tools/cline-settings/route_client-reference-manifest.js +1 -1
  75. package/app/.next/server/app/api/cli-tools/codex-profiles/route.js +2 -2
  76. package/app/.next/server/app/api/cli-tools/codex-profiles/route_client-reference-manifest.js +1 -1
  77. package/app/.next/server/app/api/cli-tools/codex-settings/route.js +2 -2
  78. package/app/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
  79. package/app/.next/server/app/api/cli-tools/droid-settings/route.js +1 -1
  80. package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
  81. package/app/.next/server/app/api/cli-tools/guide-settings/[toolId]/route_client-reference-manifest.js +1 -1
  82. package/app/.next/server/app/api/cli-tools/kilo-settings/route.js +1 -1
  83. package/app/.next/server/app/api/cli-tools/kilo-settings/route_client-reference-manifest.js +1 -1
  84. package/app/.next/server/app/api/cli-tools/openclaw/auto-order/route_client-reference-manifest.js +1 -1
  85. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  86. package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
  87. package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route.js +2 -2
  88. package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route_client-reference-manifest.js +1 -1
  89. package/app/.next/server/app/api/cli-tools/status/route.js +1 -1
  90. package/app/.next/server/app/api/cli-tools/status/route_client-reference-manifest.js +1 -1
  91. package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
  92. package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
  93. package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
  94. package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
  95. package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
  96. package/app/.next/server/app/api/combos/auto/route_client-reference-manifest.js +1 -1
  97. package/app/.next/server/app/api/combos/metrics/route_client-reference-manifest.js +1 -1
  98. package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
  99. package/app/.next/server/app/api/combos/test/route_client-reference-manifest.js +1 -1
  100. package/app/.next/server/app/api/compliance/audit-log/route_client-reference-manifest.js +1 -1
  101. package/app/.next/server/app/api/db-backups/export/route_client-reference-manifest.js +1 -1
  102. package/app/.next/server/app/api/db-backups/exportAll/route_client-reference-manifest.js +1 -1
  103. package/app/.next/server/app/api/db-backups/import/route_client-reference-manifest.js +1 -1
  104. package/app/.next/server/app/api/db-backups/route_client-reference-manifest.js +1 -1
  105. package/app/.next/server/app/api/evals/[suiteId]/route_client-reference-manifest.js +1 -1
  106. package/app/.next/server/app/api/evals/route_client-reference-manifest.js +1 -1
  107. package/app/.next/server/app/api/fallback/chains/route_client-reference-manifest.js +1 -1
  108. package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  109. package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
  110. package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
  111. package/app/.next/server/app/api/logs/console/route_client-reference-manifest.js +1 -1
  112. package/app/.next/server/app/api/mcp/audit/route_client-reference-manifest.js +1 -1
  113. package/app/.next/server/app/api/mcp/audit/stats/route_client-reference-manifest.js +1 -1
  114. package/app/.next/server/app/api/mcp/sse/route_client-reference-manifest.js +1 -1
  115. package/app/.next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
  116. package/app/.next/server/app/api/mcp/stream/route_client-reference-manifest.js +1 -1
  117. package/app/.next/server/app/api/mcp/tools/route_client-reference-manifest.js +1 -1
  118. package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
  119. package/app/.next/server/app/api/models/availability/route_client-reference-manifest.js +1 -1
  120. package/app/.next/server/app/api/models/catalog/route_client-reference-manifest.js +1 -1
  121. package/app/.next/server/app/api/models/openrouter-catalog/route_client-reference-manifest.js +1 -1
  122. package/app/.next/server/app/api/models/route.js +1 -1
  123. package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
  124. package/app/.next/server/app/api/monitoring/health/route.js +1 -1
  125. package/app/.next/server/app/api/monitoring/health/route_client-reference-manifest.js +1 -1
  126. package/app/.next/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
  127. package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
  128. package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
  129. package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
  130. package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
  131. package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
  132. package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
  133. package/app/.next/server/app/api/policies/route_client-reference-manifest.js +1 -1
  134. package/app/.next/server/app/api/pricing/defaults/route_client-reference-manifest.js +1 -1
  135. package/app/.next/server/app/api/pricing/models/route_client-reference-manifest.js +1 -1
  136. package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
  137. package/app/.next/server/app/api/provider-metrics/route_client-reference-manifest.js +1 -1
  138. package/app/.next/server/app/api/provider-models/route_client-reference-manifest.js +1 -1
  139. package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
  140. package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
  141. package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
  142. package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
  143. package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
  144. package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
  145. package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
  146. package/app/.next/server/app/api/providers/route.js +1 -1
  147. package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
  148. package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
  149. package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
  150. package/app/.next/server/app/api/rate-limit/route_client-reference-manifest.js +1 -1
  151. package/app/.next/server/app/api/rate-limits/route_client-reference-manifest.js +1 -1
  152. package/app/.next/server/app/api/resilience/reset/route_client-reference-manifest.js +1 -1
  153. package/app/.next/server/app/api/resilience/route_client-reference-manifest.js +1 -1
  154. package/app/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
  155. package/app/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
  156. package/app/.next/server/app/api/settings/background-degradation/route_client-reference-manifest.js +1 -1
  157. package/app/.next/server/app/api/settings/combo-defaults/route_client-reference-manifest.js +1 -1
  158. package/app/.next/server/app/api/settings/ip-filter/route_client-reference-manifest.js +1 -1
  159. package/app/.next/server/app/api/settings/model-aliases/route_client-reference-manifest.js +1 -1
  160. package/app/.next/server/app/api/settings/proxy/route_client-reference-manifest.js +1 -1
  161. package/app/.next/server/app/api/settings/proxy/test/route_client-reference-manifest.js +1 -1
  162. package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
  163. package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  164. package/app/.next/server/app/api/settings/system-prompt/route_client-reference-manifest.js +1 -1
  165. package/app/.next/server/app/api/settings/thinking-budget/route_client-reference-manifest.js +1 -1
  166. package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  167. package/app/.next/server/app/api/storage/health/route_client-reference-manifest.js +1 -1
  168. package/app/.next/server/app/api/sync/cloud/route_client-reference-manifest.js +1 -1
  169. package/app/.next/server/app/api/sync/initialize/route_client-reference-manifest.js +1 -1
  170. package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
  171. package/app/.next/server/app/api/telemetry/summary/route_client-reference-manifest.js +1 -1
  172. package/app/.next/server/app/api/token-health/route_client-reference-manifest.js +1 -1
  173. package/app/.next/server/app/api/translator/detect/route_client-reference-manifest.js +1 -1
  174. package/app/.next/server/app/api/translator/history/route_client-reference-manifest.js +1 -1
  175. package/app/.next/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
  176. package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
  177. package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
  178. package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
  179. package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
  180. package/app/.next/server/app/api/usage/analytics/route_client-reference-manifest.js +1 -1
  181. package/app/.next/server/app/api/usage/budget/route_client-reference-manifest.js +1 -1
  182. package/app/.next/server/app/api/usage/call-logs/[id]/route_client-reference-manifest.js +1 -1
  183. package/app/.next/server/app/api/usage/call-logs/route_client-reference-manifest.js +1 -1
  184. package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
  185. package/app/.next/server/app/api/usage/logs/route_client-reference-manifest.js +1 -1
  186. package/app/.next/server/app/api/usage/proxy-logs/route_client-reference-manifest.js +1 -1
  187. package/app/.next/server/app/api/usage/quota/route_client-reference-manifest.js +1 -1
  188. package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
  189. package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
  190. package/app/.next/server/app/api/v1/audio/speech/route_client-reference-manifest.js +1 -1
  191. package/app/.next/server/app/api/v1/audio/transcriptions/route_client-reference-manifest.js +1 -1
  192. package/app/.next/server/app/api/v1/chat/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_client-reference-manifest.js +1 -1
  197. package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
  198. package/app/.next/server/app/api/v1/moderations/route_client-reference-manifest.js +1 -1
  199. package/app/.next/server/app/api/v1/music/generations/route_client-reference-manifest.js +1 -1
  200. package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route_client-reference-manifest.js +1 -1
  201. package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route_client-reference-manifest.js +1 -1
  202. package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route_client-reference-manifest.js +1 -1
  203. package/app/.next/server/app/api/v1/rerank/route_client-reference-manifest.js +1 -1
  204. package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
  205. package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
  206. package/app/.next/server/app/api/v1/videos/generations/route_client-reference-manifest.js +1 -1
  207. package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
  208. package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
  209. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  210. package/app/.next/server/app/docs/page.js +1 -1
  211. package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  212. package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -1
  213. package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -1
  214. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  215. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  216. package/app/.next/server/app/maintenance/page_client-reference-manifest.js +1 -1
  217. package/app/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  218. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  219. package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
  220. package/app/.next/server/app/status/page_client-reference-manifest.js +1 -1
  221. package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
  222. package/app/.next/server/app-paths-manifest.json +42 -42
  223. package/app/.next/server/chunks/1960.js +1 -1
  224. package/app/.next/server/chunks/7889.js +1 -1
  225. package/app/.next/server/pages/500.html +2 -2
  226. package/app/.next/server/server-reference-manifest.js +1 -1
  227. package/app/.next/server/server-reference-manifest.json +1 -1
  228. package/app/.next/static/chunks/{5846-84577ede994ae924.js → 5846-11f0da2526ea550c.js} +1 -1
  229. package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/{page-8d4d2f071d114b90.js → page-284b636e8d7e33f1.js} +1 -1
  230. package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-62c8c63ebebff9df.js +1 -0
  231. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-ee3b3c7b9ecbad30.js → page-4c046dfc5159d2ac.js} +1 -1
  232. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-5c7266984d89bd37.js +1 -0
  233. package/app/package.json +1 -1
  234. package/app/public/providers/assemblyai.svg +12 -0
  235. package/app/public/providers/elevenlabs.svg +6 -0
  236. package/app/public/providers/hyperbolic.svg +13 -0
  237. package/app/public/providers/inworld.svg +12 -0
  238. package/app/public/providers/nanobanana.svg +12 -0
  239. package/app/public/providers/ollama-cloud.png +375 -0
  240. package/app/public/providers/playht.svg +11 -0
  241. package/package.json +1 -1
  242. package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-7b1037d65eef97a8.js +0 -1
  243. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-a3b2395f513e893f.js +0 -1
  244. /package/app/.next/static/{7FD4jyAisteodGBKMWbqD → 9Djw7GIB7UXqJwJlVsoxB}/_buildManifest.js +0 -0
  245. /package/app/.next/static/{7FD4jyAisteodGBKMWbqD → 9Djw7GIB7UXqJwJlVsoxB}/_ssgManifest.js +0 -0
@@ -1,2 +1,2 @@
1
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:()=>l,zN:()=>s,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 l={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"}},s={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"},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://www.cerebras.ai"},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://developer.nvidia.com/nim"},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"}},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={...l,...s,...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(l,"FREE_PROVIDERS"),r(s,"OAUTH_PROVIDERS"),r(m,"APIKEY_PROVIDERS")},35144:(e,a,i)=>{i.d(a,{Xg:()=>r,vq:()=>n,KC:()=>l}),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":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"gl-node/22.17.0"},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"}]}},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 l(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.3.2"},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:()=>l});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}),s(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}),s(i)},initTheme:()=>{let{theme:e,colorTheme:i,customColor:t}=a();s(e),m(i,t)}}),{name:n.B2.storageKey})),l={coral:"#e54d5e",blue:"#3b82f6",red:"#ef4444",green:"#22c55e",violet:"#8b5cf6",orange:"#f97316",cyan:"#06b6d4"};function s(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,s,m=document.documentElement,c="custom"===e?d(a):l[e]||l.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))},s=e=>e.toString(16).padStart(2,"0"),`#${s(r(t))}${s(r(o))}${s(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})))}}]);
2
+ ${e}`),Error(`Provider validation failed for ${a}`)}}let l={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"}},s={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"},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://www.cerebras.ai"},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://developer.nvidia.com/nim"},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"}},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={...l,...s,...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(l,"FREE_PROVIDERS"),r(s,"OAUTH_PROVIDERS"),r(m,"APIKEY_PROVIDERS")},35144:(e,a,i)=>{i.d(a,{Xg:()=>r,vq:()=>n,KC:()=>l}),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":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"gl-node/22.17.0"},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"}]}},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 l(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.3.4"},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:()=>l});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}),s(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}),s(i)},initTheme:()=>{let{theme:e,colorTheme:i,customColor:t}=a();s(e),m(i,t)}}),{name:n.B2.storageKey})),l={coral:"#e54d5e",blue:"#3b82f6",red:"#ef4444",green:"#22c55e",violet:"#8b5cf6",orange:"#f97316",cyan:"#06b6d4"};function s(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,s,m=document.documentElement,c="custom"===e?d(a):l[e]||l.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))},s=e=>e.toString(16).padStart(2,"0"),`#${s(r(t))}${s(r(o))}${s(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 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{7762:(e,t,a)=>{Promise.resolve().then(a.bind(a,96191))},40993:(e,t,a)=>{"use strict";a.d(t,{Ex:()=>d.default,$n:()=>s.default,Zp:()=>i.default,Qv:()=>o.CardSkeleton,G9:()=>y.default,bQ:()=>N.default,pp:()=>j.default,Qn:()=>k.default,pd:()=>r.default,Mh:()=>f.default,uR:()=>p.default,aF:()=>n.default,rq:()=>x.default,LF:()=>m.default,KN:()=>b.default,Lo:()=>g.default,y7:()=>h.default,Iz:()=>v.default,l6:()=>l.default,lM:()=>c.default,cn:()=>u.default});var s=a(35806),r=a(34422),l=a(42994),i=a(81060),n=a(71361),o=a(92542);a(17705);var d=a(80927),c=a(19790);a(6261),a(55846),a(34243),a(89938),a(99023);var m=a(80178),x=a(85444),p=a(91961);a(25112);var u=a(45624),h=a(37415),b=a(48643),g=a(8287);a(1652);var f=a(92701);a(18150);var y=a(71689),v=a(33709);a(76332);var j=a(66200);a(61580);var k=a(51503);a(54128);var N=a(44638);a(21720),a(97050)},96191:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>N});var s=a(95155),r=a(12115),l=a(40993);function i({children:e,content:t,position:a="top",className:l="",delayMs:i=200}){let n,[o,d]=(0,r.useState)(!1),c=(0,r.useId)(),m=(0,r.useRef)(null),x=(0,r.useCallback)(()=>{clearTimeout(m.current),m.current=setTimeout(()=>d(!0),i)},[i]),p=(0,r.useCallback)(()=>{clearTimeout(m.current),d(!1)},[]);(0,r.useEffect)(()=>()=>{clearTimeout(m.current)},[]);let u={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"},h=t?c:void 0,b=(0,r.isValidElement)(e)?(n=[e.props["aria-describedby"],h].filter(Boolean).join(" "),(0,r.cloneElement)(e,{"aria-describedby":n||void 0})):(0,s.jsx)("span",{tabIndex:0,"aria-describedby":h,children:e});return(0,s.jsxs)("span",{className:`relative inline-flex ${l}`,onMouseEnter:x,onMouseLeave:p,onFocus:x,onBlur:p,onKeyDown:e=>{"Escape"===e.key&&p()},children:[b,o&&t&&(0,s.jsx)("span",{id:c,role:"tooltip",className:`absolute z-50 px-2.5 py-1.5 text-xs font-medium text-white bg-gray-900/95 rounded-md shadow-lg whitespace-nowrap pointer-events-none animate-in fade-in duration-150 motion-reduce:transition-none motion-reduce:animate-none border border-white/10 ${u[a]||u.top}`,children:t})]})}var n=a(30949),o=a(67671),d=a(50910);let c=/^[a-zA-Z0-9_/.-]+$/,m=[{value:"priority",labelKey:"priority",descKey:"priorityDesc",icon:"sort"},{value:"weighted",labelKey:"weighted",descKey:"weightedDesc",icon:"percent"},{value:"round-robin",labelKey:"roundRobin",descKey:"roundRobinDesc",icon:"autorenew"},{value:"random",labelKey:"random",descKey:"randomDesc",icon:"shuffle"},{value:"least-used",labelKey:"leastUsed",descKey:"leastUsedDesc",icon:"low_priority"},{value:"cost-optimized",labelKey:"costOpt",descKey:"costOptimizedDesc",icon:"savings"}],x={priority:{when:"Use when you have one preferred model and only want fallback on failure.",avoid:"Avoid when you need balanced load between models.",example:"Example: Primary coding model with cheaper backup for outages."},weighted:{when:"Use when you need controlled traffic split across models.",avoid:"Avoid when weights are not maintained or you need strict fairness.",example:"Example: 80% stable model and 20% canary model for safe rollout."},"round-robin":{when:"Use when you need predictable, even request distribution.",avoid:"Avoid when model latency/cost differs significantly.",example:"Example: Same model across multiple accounts to spread throughput."},random:{when:"Use when you want a simple spread with low configuration effort.",avoid:"Avoid when requests must be distributed with strict guarantees.",example:"Example: Prototyping with equivalent models and no traffic policy."},"least-used":{when:"Use when you want adaptive balancing based on recent demand.",avoid:"Avoid when your traffic is too low to benefit from usage balancing.",example:"Example: Mixed workloads where one model tends to get overloaded."},"cost-optimized":{when:"Use when minimizing cost is the top priority.",avoid:"Avoid when pricing data is missing or outdated.",example:"Example: Batch or background jobs where lower cost matters most."}},p={priority:{title:"Fail-safe baseline",description:"Use one primary model and keep fallback chain short and reliable.",tips:["Put your most reliable model first.","Keep 1-2 backup models with similar quality.","Use safe retries to absorb transient provider failures."]},weighted:{title:"Controlled traffic split",description:"Great for canary rollouts and gradual migration between models.",tips:["Start with conservative split like 90/10.","Keep the total at 100% and auto-balance after changes.","Monitor success and latency before increasing canary weight."]},"round-robin":{title:"Predictable load sharing",description:"Best when models are equivalent and you need smooth distribution.",tips:["Use at least 2 models.","Set concurrency limits to avoid burst overload.","Use queue timeout to fail fast under saturation."]},random:{title:"Quick spread with low setup",description:"Use when you need simple distribution without strict guarantees.",tips:["Use models with similar latency profiles.","Keep retries enabled to absorb random misses.","Prefer this for experimentation, not strict SLAs."]},"least-used":{title:"Adaptive balancing",description:"Routes to less-used models to reduce hotspots over time.",tips:["Works better under continuous traffic.","Combine with health checks for safer balancing.","Track per-model usage to validate distribution gains."]},"cost-optimized":{title:"Budget-first routing",description:"Routes to lower-cost models when pricing metadata is available.",tips:["Ensure pricing coverage for all selected models.","Keep a quality fallback for hard prompts.","Use for batch/background jobs where cost is the main KPI."]}},u="omniroute:combos:hide-usage-guide",h=[{id:"high-availability",icon:"shield",titleKey:"templateHighAvailability",descKey:"templateHighAvailabilityDesc",fallbackTitle:"High availability",fallbackDesc:"Priority routing with health checks and safe retries.",strategy:"priority",suggestedName:"high-availability",config:{maxRetries:2,retryDelayMs:1500,healthCheckEnabled:!0}},{id:"cost-saver",icon:"savings",titleKey:"templateCostSaver",descKey:"templateCostSaverDesc",fallbackTitle:"Cost saver",fallbackDesc:"Cost-optimized routing for budget-first workloads.",strategy:"cost-optimized",suggestedName:"cost-saver",config:{maxRetries:1,retryDelayMs:500,healthCheckEnabled:!0}},{id:"balanced",icon:"balance",titleKey:"templateBalanced",descKey:"templateBalancedDesc",fallbackTitle:"Balanced load",fallbackDesc:"Least-used routing to spread demand over time.",strategy:"least-used",suggestedName:"balanced-load",config:{maxRetries:1,retryDelayMs:1e3,healthCheckEnabled:!0}}];function b(e){return m.find(t=>t.value===e)||m[0]}function g(e,t){return e(b(t).labelKey)}function f(e,t){return e(b(t).descKey)}function y(e,t,a){return"function"==typeof e.has&&e.has(t)?e(t):a}function v(e,t,a){let s=x[t]||x.priority;return y(e,`strategyGuide.${t}.${a}`,s[a])}function j(e,t,a){let s=p[t]||p.priority;return"tips"===a?s.tips.map((a,s)=>y(e,`strategyRecommendations.${t}.tip${s+1}`,a)):y(e,`strategyRecommendations.${t}.${a}`,s[a])}function k(e){return"string"==typeof e?{model:e,weight:0}:{model:e.model,weight:e.weight||0}}function N(){let e=(0,d.c)("combos"),t=(0,d.c)("common"),[a,i]=(0,r.useState)([]),[c,m]=(0,r.useState)(!0),[x,p]=(0,r.useState)(!1),[h,b]=(0,r.useState)(null),[g,f]=(0,r.useState)([]),[v,j]=(0,r.useState)({}),[k,N]=(0,r.useState)(null),[C,$]=(0,r.useState)(null),{copied:S,copy:M}=(0,n.C)(),P=(0,o.i)(),[R,z]=(0,r.useState)(null),[A,K]=(0,r.useState)(null),[q,_]=(0,r.useState)([]),[O,U]=(0,r.useState)(!0),[H,B]=(0,r.useState)("");(0,r.useEffect)(()=>{F(),fetch("/api/settings/proxy").then(e=>e.ok?e.json():null).then(e=>K(e)).catch(()=>{})},[]),(0,r.useEffect)(()=>{try{globalThis.localStorage?.getItem(u)==="1"&&U(!1)}catch{}},[]);let F=async()=>{try{let[e,t,a,s]=await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/combos/metrics"),fetch("/api/provider-nodes")]),r=await e.json(),l=await t.json(),n=await a.json(),o=s.ok?await s.json():{nodes:[]};if(e.ok&&i(r.combos||[]),t.ok){let e=(l.connections||[]).filter(e=>"active"===e.testStatus||"success"===e.testStatus);f(e)}a.ok&&j(n.metrics||{}),_(o.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{m(!1)}},L=async t=>{try{let a=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(a.ok)await F(),p(!1),B(t.name?.trim()||""),P.success(e("comboCreated"));else{let t=await a.json();P.error(t.error?.message||t.error||e("failedCreate"))}}catch(t){P.error(e("errorCreating"))}},W=async(t,a)=>{try{let s=await fetch(`/api/combos/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(s.ok)await F(),b(null),P.success(e("comboUpdated"));else{let t=await s.json();P.error(t.error?.message||t.error||e("failedUpdate"))}}catch(t){P.error(e("errorUpdating"))}},G=async t=>{if(confirm(e("deleteConfirm")))try{(await fetch(`/api/combos/${t}`,{method:"DELETE"})).ok&&(i(a.filter(e=>e.id!==t)),P.success(e("comboDeleted")))}catch(t){P.error(e("errorDeleting"))}},I=async e=>{let t=e.name.replace(/-copy(-\d+)?$/,""),s=a.map(e=>e.name),r=`${t}-copy`,l=1;for(;s.includes(r);)l++,r=`${t}-copy-${l}`;let i={name:r,models:e.models,strategy:e.strategy||"priority",config:e.config||{}};await L(i)},Q=async t=>{$(t.name),N(null);try{let e=await fetch("/api/combos/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboName:t.name})}),a=await e.json();N(a)}catch(t){N({error:e("testFailed")}),P.error(e("testFailed"))}},J=async t=>{let a=!1===t.isActive;i(e=>e.map(e=>e.id===t.id?{...e,isActive:a}:e));try{await fetch(`/api/combos/${t.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:a})})}catch(s){i(e=>e.map(e=>e.id===t.id?{...e,isActive:!a}:e)),P.error(e("failedToggle"))}};return c?(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsx)(l.Qv,{}),(0,s.jsx)(l.Qv,{})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold",children:e("title")}),(0,s.jsx)("p",{className:"text-sm text-text-muted mt-1",children:e("description")})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[!O&&(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:()=>{U(!0);try{globalThis.localStorage?.removeItem(u)}catch{}},children:y(e,"usageGuideShow","Show guide")}),(0,s.jsx)(l.$n,{icon:"add",onClick:()=>p(!0),children:e("createCombo")})]})]}),O&&(0,s.jsx)(w,{onHide:()=>U(!1),onHideForever:()=>{U(!1);try{globalThis.localStorage?.setItem(u,"1")}catch{}}}),H&&(0,s.jsx)(l.Zp,{padding:"sm",className:"border border-emerald-500/20 bg-emerald-500/[0.04] dark:bg-emerald-500/[0.08]",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-emerald-700 dark:text-emerald-300",children:y(e,"quickTestTitle",`Combo "${H}" ready to validate`)}),(0,s.jsx)("code",{className:"inline-block text-[11px] mt-0.5 px-1.5 py-0.5 rounded bg-emerald-500/15 text-emerald-700 dark:text-emerald-300",children:H}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:y(e,"quickTestDescription","Run a test now to confirm fallback and latency behavior.")})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(l.$n,{size:"sm",variant:"secondary",icon:"play_arrow",onClick:()=>{Q({name:H}),B("")},children:y(e,"testNow","Test now")}),(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:()=>B(""),children:t("close")})]})]})}),0===a.length?(0,s.jsx)(l.pp,{icon:"\uD83E\uDDE9",title:e("noCombosYet"),description:e("description"),actionLabel:e("createCombo"),onAction:()=>p(!0)}):(0,s.jsx)("div",{className:"flex flex-col gap-4",children:a.map(e=>(0,s.jsx)(T,{combo:e,metrics:v[e.name],providerNodes:q,copied:S,onCopy:M,onEdit:()=>b(e),onDelete:()=>G(e.id),onDuplicate:()=>I(e),onTest:()=>Q(e),testing:C===e.name,onProxy:()=>z(e),hasProxy:!!A?.combos?.[e.id],onToggle:()=>J(e)},e.id))}),k&&(0,s.jsx)(l.aF,{isOpen:!!k,onClose:()=>{N(null),$(null)},title:e("testResults",{name:C}),children:(0,s.jsx)(D,{results:k})}),(0,s.jsx)(E,{isOpen:x,onClose:()=>p(!1),onSave:L,activeProviders:g,combo:null},"create"),(0,s.jsx)(E,{isOpen:!!h,combo:h,onClose:()=>b(null),onSave:e=>W(h.id,e),activeProviders:g},h?.id||"new"),R&&(0,s.jsx)(l.KN,{isOpen:!!R,onClose:()=>z(null),level:"combo",levelId:R.id,levelLabel:R.name})]})}function w({onHide:e,onHideForever:t}){let a=(0,d.c)("combos");return(0,s.jsxs)(l.Zp,{padding:"sm",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,s.jsx)("div",{className:"size-7 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-primary text-[16px]",children:"tips_and_updates"})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold",children:a("routingStrategy")}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:a("description")})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:e,className:"!h-6 px-2 text-[10px]",children:y(a,"usageGuideHide","Hide")}),(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:t,className:"!h-6 px-2 text-[10px]",children:y(a,"usageGuideDontShowAgain","Don't show again")})]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2 mt-3",children:["priority","cost-optimized","least-used"].map(e=>{let t=b(e);return(0,s.jsxs)("div",{className:"rounded-lg border border-black/10 dark:border-white/10 bg-black/[0.02] dark:bg-white/[0.02] p-2.5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] text-primary",children:t.icon}),(0,s.jsx)("span",{className:"text-xs font-medium",children:g(a,e)})]}),(0,s.jsx)("p",{className:"text-[11px] leading-4 text-text-muted mt-1.5",children:f(a,e)})]},e)})})]})}function C({strategy:e}){let t=(0,d.c)("combos");return(0,s.jsxs)("div",{className:"rounded-lg border border-black/10 dark:border-white/10 bg-black/[0.02] dark:bg-white/[0.02] p-2.5",children:[(0,s.jsx)("div",{className:"text-[11px] text-text-muted",children:y(t,"strategyGuideTitle","How to use this strategy")}),(0,s.jsxs)("div",{className:"mt-1.5 flex flex-col gap-1.5 text-[11px]",children:[(0,s.jsxs)("p",{className:"text-text-main",children:[(0,s.jsxs)("span",{className:"font-semibold",children:[y(t,"strategyGuideWhen","When to use"),":"]})," ",v(t,e,"when")]}),(0,s.jsxs)("p",{className:"text-text-main",children:[(0,s.jsxs)("span",{className:"font-semibold",children:[y(t,"strategyGuideAvoid","Avoid when"),":"]})," ",v(t,e,"avoid")]}),(0,s.jsxs)("p",{className:"text-text-main",children:[(0,s.jsxs)("span",{className:"font-semibold",children:[y(t,"strategyGuideExample","Example"),":"]})," ",v(t,e,"example")]})]})]})}function $({strategy:e,onApply:t,showNudge:a}){let r=(0,d.c)("combos"),i=g(r,e),n=j(r,e,"title"),o=j(r,e,"description"),c=j(r,e,"tips");return(0,s.jsxs)("div",{className:"rounded-lg border border-black/10 dark:border-white/10 bg-white/70 dark:bg-white/[0.02] p-2.5",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:y(r,"recommendationsLabel","Recommended setup")}),(0,s.jsxs)("p",{className:"text-xs font-semibold text-text-main mt-0.5",children:[n," \xb7 ",(0,s.jsx)("span",{className:"text-primary",children:i})]}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:o})]}),(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:t,className:"!h-6 px-2 text-[10px]",children:y(r,"applyRecommendations","Apply recommendations")})]}),(0,s.jsx)("div",{className:"mt-2 grid grid-cols-1 gap-1",children:c.map((t,a)=>(0,s.jsxs)("div",{className:"flex items-start gap-1 rounded-md bg-black/[0.02] dark:bg-white/[0.03] px-1.5 py-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px] text-primary mt-0.5",children:"check"}),(0,s.jsx)("p",{className:"text-[10px] text-text-main",children:t})]},`${e}-tip-${a+1}`))}),a&&(0,s.jsx)("div",{"data-testid":"strategy-change-nudge",className:"mt-2 rounded-md border border-primary/20 bg-primary/10 px-2 py-1 text-[10px] text-primary",children:y(r,"recommendationsUpdated","Recommendations updated for {strategy}.").replace("{strategy}",i)})]})}function S({label:e,help:t}){return(0,s.jsxs)("div",{className:"flex items-center gap-1 mb-0.5",children:[(0,s.jsx)("label",{className:"text-[10px] text-text-muted",children:e}),(0,s.jsx)(i,{content:t,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px] text-text-muted cursor-help",children:"help"})})]})}function M({checks:e,blockers:t}){let a=(0,d.c)("combos"),r=t.length>0;return(0,s.jsxs)("div",{"data-testid":"combo-readiness-panel",className:`rounded-lg border px-2.5 py-2 ${r?"border-amber-500/30 bg-amber-500/5":"border-emerald-500/20 bg-emerald-500/[0.04]"}`,children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px] ${r?"text-amber-600 dark:text-amber-400":"text-emerald-600 dark:text-emerald-400"}`,children:r?"rule":"check_circle"}),(0,s.jsx)("p",{className:"text-[11px] font-medium text-text-main",children:y(a,"readinessTitle","Ready to save?")})]}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:y(a,"readinessDescription","Review the checklist before creating or updating this combo.")}),(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-1 mt-2",children:e.map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-1 rounded-md px-1.5 py-1 bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[12px] ${e.ok?"text-emerald-500":"text-amber-500"}`,children:e.ok?"task_alt":"pending"}),(0,s.jsx)("span",{className:"text-[10px] text-text-main",children:e.label})]},e.id))}),r&&(0,s.jsxs)("div",{"data-testid":"combo-save-blockers",className:"mt-2 rounded-md border border-amber-500/30 bg-amber-500/10 px-2 py-1.5",children:[(0,s.jsx)("p",{className:"text-[10px] font-medium text-amber-700 dark:text-amber-300",children:y(a,"saveBlockedTitle","Save is blocked until the following items are fixed:")}),(0,s.jsx)("div",{className:"mt-1 flex flex-col gap-0.5",children:t.map((e,t)=>(0,s.jsxs)("p",{className:"text-[10px] text-amber-700 dark:text-amber-300",children:["• ",e]},`${e}-${t}`))})]})]})}function T({combo:e,metrics:t,copied:a,onCopy:r,onEdit:n,onDelete:o,onDuplicate:c,onTest:m,testing:x,onProxy:p,hasProxy:u,onToggle:h,providerNodes:b}){let y=e.strategy||"priority",v=e.models||[],j=!1===e.isActive,N=(0,d.c)("combos"),w=(0,d.c)("common"),C=f(N,y);return(0,s.jsx)(l.Zp,{padding:"sm",className:`group ${j?"opacity-50":""}`,children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,s.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("code",{className:"text-sm font-medium font-mono truncate",children:e.name}),(0,s.jsx)(i,{content:C,children:(0,s.jsx)("span",{className:`text-[9px] uppercase font-semibold px-1.5 py-0.5 rounded-full ${"weighted"===y?"bg-amber-500/15 text-amber-600 dark:text-amber-400":"round-robin"===y?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"random"===y?"bg-purple-500/15 text-purple-600 dark:text-purple-400":"least-used"===y?"bg-cyan-500/15 text-cyan-600 dark:text-cyan-400":"cost-optimized"===y?"bg-teal-500/15 text-teal-600 dark:text-teal-400":"bg-blue-500/15 text-blue-600 dark:text-blue-400"}`,children:g(N,y)})}),u&&(0,s.jsxs)("span",{className:"text-[9px] uppercase font-semibold px-1.5 py-0.5 rounded-full bg-primary/15 text-primary flex items-center gap-0.5",title:N("proxyConfigured"),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"vpn_lock"}),"proxy"]}),(0,s.jsx)("button",{onClick:t=>{t.stopPropagation(),r(e.name,`combo-${e.id}`)},className:"p-0.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors opacity-100 md:opacity-0 md:group-hover:opacity-100",title:N("copyComboName"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:a===`combo-${e.id}`?"check":"content_copy"})})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[0===v.length?(0,s.jsx)("span",{className:"text-xs text-text-muted italic",children:N("noModels")}):v.slice(0,3).map((e,t)=>{let{model:a,weight:r}=k(e);return(0,s.jsxs)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1.5 py-0.5 rounded text-text-muted",children:[(e=>{let t=e.split("/");if(2!==t.length)return e;let[a,s]=t,r=(b||[]).find(e=>e.id===a||e.prefix===a);return r?`${r.name}/${s}`:e})(a),"weighted"===y&&r>0?` (${r}%)`:""]},t)}),v.length>3&&(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:N("more",{count:v.length-3})})]}),t&&(0,s.jsxs)("div",{className:"flex items-center gap-3 mt-1",children:[(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:[(0,s.jsx)("span",{className:"text-emerald-500",children:t.totalSuccesses}),"/",t.totalRequests," ",N("reqs")]}),(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:[t.successRate,"% ",N("success")]}),(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:["~",t.avgLatencyMs,"ms"]}),t.fallbackRate>0&&(0,s.jsxs)("span",{className:"text-[10px] text-amber-500",children:[t.fallbackRate,"% fallback"]})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0 ml-2",children:[(0,s.jsx)(l.lM,{size:"sm",checked:!j,onChange:h,title:N(j?"enableCombo":"disableCombo")}),(0,s.jsxs)("div",{className:"flex items-center gap-1 opacity-100 md:opacity-0 md:group-hover:opacity-100 transition-opacity",children:[(0,s.jsx)("button",{onClick:m,disabled:x,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-emerald-500 transition-colors",title:N("testCombo"),children:(0,s.jsx)("span",{className:`material-symbols-outlined text-[16px] ${x?"animate-spin":""}`,children:x?"progress_activity":"play_arrow"})}),(0,s.jsx)("button",{onClick:c,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:N("duplicate"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"content_copy"})}),(0,s.jsx)("button",{onClick:p,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:N("proxyConfig"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"vpn_lock"})}),(0,s.jsx)("button",{onClick:n,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:w("edit"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})}),(0,s.jsx)("button",{onClick:o,className:"p-1.5 hover:bg-red-500/10 rounded text-red-500 transition-colors",title:w("delete"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]})]})})}function D({results:e}){return e.error?(0,s.jsxs)("div",{className:"flex items-center gap-2 text-red-500 text-sm",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"error"}),"string"==typeof e.error?e.error:JSON.stringify(e.error)]}):(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[e.resolvedBy&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-emerald-500 text-[18px]",children:"check_circle"}),(0,s.jsxs)("span",{children:["Resolved by:"," ",(0,s.jsx)("code",{className:"text-xs bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 px-1.5 py-0.5 rounded",children:e.resolvedBy})]})]}),e.results?.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs px-2 py-1.5 rounded bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px] ${"ok"===e.status?"text-emerald-500":"skipped"===e.status?"text-text-muted":"text-red-500"}`,children:"ok"===e.status?"check_circle":"skipped"===e.status?"skip_next":"error"}),(0,s.jsx)("code",{className:"font-mono flex-1",children:e.model}),void 0!==e.latencyMs&&(0,s.jsxs)("span",{className:"text-text-muted",children:[e.latencyMs,"ms"]}),(0,s.jsx)("span",{className:`text-[10px] uppercase font-medium ${"ok"===e.status?"text-emerald-500":"skipped"===e.status?"text-text-muted":"text-red-500"}`,children:e.status})]},t))]})}function E({isOpen:e,combo:t,onClose:a,onSave:n,activeProviders:x}){let p=(0,d.c)("combos"),u=(0,d.c)("common"),b=(0,o.i)(),[v,j]=(0,r.useState)(t?.name||""),[N,w]=(0,r.useState)(()=>(t?.models||[]).map(e=>k(e))),[T,D]=(0,r.useState)(t?.strategy||"priority"),[E,R]=(0,r.useState)(!1),[z,A]=(0,r.useState)(!1),[K,q]=(0,r.useState)(""),[_,O]=(0,r.useState)({}),[U,H]=(0,r.useState)({}),[B,F]=(0,r.useState)([]),[L,W]=(0,r.useState)(!1),[G,I]=(0,r.useState)(t?.config||{}),[Q,J]=(0,r.useState)(!1),Z=(0,r.useRef)(!1),Y=(0,r.useCallback)(e=>{let t=e.split("/");if(2!==t.length)return!1;let[a,s]=t,r=B.find(e=>e.id===a||e.prefix===a),l=[a];return r?.apiType&&l.push(r.apiType),r?.name&&l.push(String(r.name).toLowerCase()),l.some(e=>!!_?.[e]?.[s])},[_,B]),[V,X]=(0,r.useState)(null),[ee,et]=(0,r.useState)(null),ea=N.reduce((e,t)=>e+(t.weight||0),0),es=N.reduce((e,t)=>e+ +!!Y(t.model),0),er=N.length>0?Math.round(es/N.length*100):0,el=0===N.length,ei="round-robin"===T&&1===N.length,en="cost-optimized"===T&&N.length>0&&0===es,eo="cost-optimized"===T&&N.length>0&&es>0&&es<N.length,ed="weighted"===T&&N.length>0&&100!==ea,ec=!v.trim()||!!K||z||el||ed||en,em=[{id:"name",ok:!!v.trim()&&!K,label:y(p,"readinessCheckName","Combo name is valid")},{id:"models",ok:!el,label:y(p,"readinessCheckModels","At least one model is selected")},{id:"weights",ok:"weighted"!==T||!ed,label:"weighted"===T?y(p,"readinessCheckWeights","Weighted total is 100%"):y(p,"readinessCheckWeightsOptional","Weight rule not required")},{id:"pricing",ok:"cost-optimized"!==T||!en,label:"cost-optimized"===T?y(p,"readinessCheckPricing","Pricing data is available"):y(p,"readinessCheckPricingOptional","Pricing rule not required")}],ex=[];v.trim()?K&&ex.push(K):ex.push(y(p,"saveBlockName","Define a combo name.")),el&&ex.push(y(p,"saveBlockModels","Add at least one model.")),ed&&ex.push("function"==typeof p.has&&p.has("saveBlockWeighted")?p("saveBlockWeighted",{total:ea}):`Set weights to 100% (current: ${ea}%).`),en&&ex.push(y(p,"saveBlockPricing","Add pricing for at least one model or choose a different strategy."));let ep=async()=>{try{let[e,t,a]=await Promise.all([fetch("/api/models/alias"),fetch("/api/provider-nodes"),fetch("/api/pricing")]);if(!e.ok||!t.ok)throw Error(`Failed to fetch data: aliases=${e.status}, nodes=${t.status}`);let s=a.ok?await a.json():{},[r,l]=await Promise.all([e.json(),t.json()]);O(s&&"object"==typeof s&&!Array.isArray(s)?s:{}),H(r.aliases||{}),F(l.nodes||[])}catch(e){console.error("Error fetching modal data:",e)}};(0,r.useEffect)(()=>{e&&ep()},[e]),(0,r.useEffect)(()=>{if(!Z.current){Z.current=!0;return}J(!0);let e=setTimeout(()=>J(!1),2600);return()=>clearTimeout(e)},[T]);let eu=e=>e.trim()?c.test(e)?(q(""),!0):(q(p("nameInvalid")),!1):(q(p("nameRequired")),!1),eh=()=>{let e=N.length;if(0===e)return;let t=Math.floor(100/e),a=100-t*e;w(N.map((e,s)=>({...e,weight:t+(0===s?a:0)})))},eb=(0,r.useCallback)(e=>{let t=e.split("/");if(2!==t.length)return e;let[a,s]=t,r=B.find(e=>e.id===a||e.prefix===a);return r?`${r.name}/${s}`:e},[B]),eg=e=>{e.target&&(e.currentTarget.style.opacity="1"),X(null),et(null)},ef=async()=>{if(!eu(v)||el||ed||en)return;A(!0);let e={name:v.trim(),models:"weighted"===T?N:N.map(e=>e.model),strategy:T},t={...G};"round-robin"===T&&(void 0!==G.concurrencyPerModel&&(t.concurrencyPerModel=G.concurrencyPerModel),void 0!==G.queueTimeoutMs&&(t.queueTimeoutMs=G.queueTimeoutMs)),Object.keys(t).length>0&&(e.config=t),await n(e),A(!1)},ey=!!t;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.aF,{isOpen:e,onClose:a,title:ey?p("editCombo"):p("createCombo"),children:(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(l.pd,{label:p("comboName"),value:v,onChange:e=>{let t=e.target.value;j(t),t?eu(t):q("")},placeholder:p("comboNamePlaceholder"),error:K}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:p("nameHint")})]}),!ey&&(0,s.jsxs)("div",{className:"rounded-lg border border-black/10 dark:border-white/10 bg-black/[0.02] dark:bg-white/[0.02] p-2.5",children:[(0,s.jsxs)("div",{className:"mb-2",children:[(0,s.jsx)("p",{className:"text-xs font-medium",children:y(p,"templatesTitle","Quick templates")}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:y(p,"templatesDescription","Apply a starting profile, then adjust models and config.")})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-1.5",children:h.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>{D(e.strategy),I(t=>({...t,...e.config})),v.trim()||j(e.suggestedName)},className:"text-left rounded-md border border-black/10 dark:border-white/10 bg-white/70 dark:bg-white/[0.03] px-2 py-1.5 hover:border-primary/40 hover:bg-primary/5 transition-colors",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] text-primary",children:e.icon}),(0,s.jsx)("span",{className:"text-[11px] font-medium text-text-main",children:y(p,e.titleKey,e.fallbackTitle)})]}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-1 leading-4",children:y(p,e.descKey,e.fallbackDesc)}),(0,s.jsx)("p",{className:"text-[10px] text-primary mt-1",children:y(p,"templateApply","Apply template")})]},e.id))})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-1 mb-1.5",children:[(0,s.jsx)("label",{className:"text-sm font-medium",children:p("routingStrategy")}),(0,s.jsx)(i,{content:f(p,T),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px] text-text-muted cursor-help",children:"help"})})]}),(0,s.jsx)("div",{className:"grid grid-cols-3 gap-1 p-0.5 bg-black/5 dark:bg-white/5 rounded-lg",children:m.map(e=>(0,s.jsxs)("button",{onClick:()=>D(e.value),"data-testid":`strategy-option-${e.value}`,title:p(e.descKey),"aria-label":`${g(p,e.value)}. ${p(e.descKey)}`,className:`py-1.5 px-2 rounded-md text-xs font-medium transition-all ${T===e.value?"bg-white dark:bg-bg-main shadow-sm text-primary":"text-text-muted hover:text-text-main"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] align-middle mr-0.5",children:e.icon}),g(p,e.value)]},e.value))}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:f(p,T)}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(C,{strategy:T})}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)($,{strategy:T,onApply:()=>{let e={priority:{maxRetries:2,retryDelayMs:1500,healthCheckEnabled:!0},weighted:{maxRetries:1,retryDelayMs:1e3,healthCheckEnabled:!0},"round-robin":{maxRetries:1,retryDelayMs:750,healthCheckEnabled:!0,concurrencyPerModel:3,queueTimeoutMs:3e4},random:{maxRetries:1,retryDelayMs:1e3,healthCheckEnabled:!0},"least-used":{maxRetries:1,retryDelayMs:1e3,healthCheckEnabled:!0},"cost-optimized":{maxRetries:1,retryDelayMs:500,healthCheckEnabled:!0}},t=e[T]||e.priority;I(e=>{let a={...e};for(let[e,s]of Object.entries(t))(void 0===a[e]||null===a[e]||""===a[e])&&(a[e]=s);return a}),"weighted"===T&&N.length>1&&eh(),"round-robin"===T&&W(!0),b.success(y(p,"recommendationsApplied","Recommendations applied to this combo."))},showNudge:Q})})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,s.jsx)("label",{className:"text-sm font-medium",children:p("models")}),"weighted"===T&&N.length>1&&(0,s.jsx)("button",{onClick:eh,className:"text-[10px] text-primary hover:text-primary/80 transition-colors",children:p("autoBalance")})]}),0===N.length?(0,s.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:p("noModelsYet")})]}):(0,s.jsx)("div",{className:"flex flex-col gap-1 max-h-[240px] overflow-y-auto",children:N.map((e,t)=>(0,s.jsxs)("div",{draggable:!0,onDragStart:e=>{X(t),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",t.toString()),e.target&&setTimeout(()=>e.currentTarget.style.opacity="0.5",0)},onDragEnd:eg,onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="move",et(t)},onDrop:e=>((e,t)=>{if(e.preventDefault(),null===V||V===t)return;let a=[...N],[s]=a.splice(V,1);a.splice(t,0,s),w(a),X(null),et(null)})(e,t),className:`group/item flex items-center gap-1.5 px-2 py-1.5 rounded-md transition-all cursor-grab active:cursor-grabbing ${ee===t&&V!==t?"bg-primary/10 border border-primary/30":"bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] border border-transparent"} ${V===t?"opacity-50":""}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted/40 cursor-grab shrink-0",children:"drag_indicator"}),(0,s.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:t+1}),(0,s.jsx)("div",{className:"flex-1 min-w-0 px-1 text-xs text-text-main truncate",children:eb(e.model)}),"cost-optimized"===T&&(0,s.jsx)("span",{className:`text-[9px] px-1.5 py-0.5 rounded-full uppercase font-semibold ${Y(e.model)?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"bg-amber-500/15 text-amber-600 dark:text-amber-400"}`,title:Y(e.model)?y(p,"pricingAvailable","Pricing available"):y(p,"pricingMissing","No pricing"),children:Y(e.model)?y(p,"pricingAvailableShort","priced"):y(p,"pricingMissingShort","no-price")}),"weighted"===T&&(0,s.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0",children:[(0,s.jsx)("input",{type:"number",min:"0",max:"100",value:e.weight,onChange:e=>{var a;let s;return a=e.target.value,void((s=[...N])[t]={...s[t],weight:Math.max(0,Math.min(100,Number(a)||0))},w(s))},className:"w-10 text-[11px] text-center py-0.5 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"}),(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:"%"})]}),"priority"===T&&(0,s.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,s.jsx)("button",{onClick:()=>(e=>{if(0===e)return;let t=[...N];[t[e-1],t[e]]=[t[e],t[e-1]],w(t)})(t),disabled:0===t,className:`p-0.5 rounded ${0===t?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:p("moveUp"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,s.jsx)("button",{onClick:()=>(e=>{if(e===N.length-1)return;let t=[...N];[t[e],t[e+1]]=[t[e+1],t[e]],w(t)})(t),disabled:t===N.length-1,className:`p-0.5 rounded ${t===N.length-1?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:p("moveDown"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,s.jsx)("button",{onClick:()=>{w(N.filter((e,a)=>a!==t))},className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:p("removeModel"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},`${e.model}-${t}`))}),"weighted"===T&&N.length>0&&(0,s.jsx)(P,{models:N}),"cost-optimized"===T&&N.length>0&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-black/10 dark:border-white/10 bg-black/[0.02] dark:bg-white/[0.02] px-2 py-1.5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-[10px]",children:[(0,s.jsx)("span",{className:"text-text-muted",children:y(p,"pricingCoverage","Pricing coverage")}),(0,s.jsxs)("span",{className:"font-medium text-text-main",children:[es,"/",N.length," (",er,"%)"]})]}),(0,s.jsx)("div",{className:"h-1.5 mt-1 rounded-full bg-black/10 dark:bg-white/10 overflow-hidden",children:(0,s.jsx)("div",{className:`h-full transition-all duration-300 ${100===er?"bg-emerald-500":er>0?"bg-amber-500":"bg-red-500"}`,style:{width:`${er}%`}})}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-1",children:y(p,"pricingCoverageHint","Cost-optimized works best when all combo models have pricing.")})]}),el&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-amber-500/20 bg-amber-500/10 px-2 py-1.5 text-[10px] text-amber-700 dark:text-amber-300 flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"warning"}),(0,s.jsx)("span",{children:p("noModelsYet")})]}),ed&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-amber-500/20 bg-amber-500/10 px-2 py-1.5 text-[10px] text-amber-700 dark:text-amber-300 flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"warning"}),(0,s.jsxs)("span",{children:[p("weighted")," ",ea,"% ","≠"," 100%. ",p("autoBalance")]})]}),ei&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-blue-500/20 bg-blue-500/10 px-2 py-1.5 text-[10px] text-blue-700 dark:text-blue-300 flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"info"}),(0,s.jsx)("span",{children:y(p,"warningRoundRobinSingleModel","Round-robin is most useful with at least 2 models.")})]}),eo&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-amber-500/20 bg-amber-500/10 px-2 py-1.5 text-[10px] text-amber-700 dark:text-amber-300 flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"warning"}),(0,s.jsx)("span",{children:"function"==typeof p.has&&p.has("warningCostOptimizedPartialPricing")?p("warningCostOptimizedPartialPricing",{priced:es,total:N.length}):`Only ${es} of ${N.length} models have pricing. Routing may be partially cost-aware.`})]}),en&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-amber-500/20 bg-amber-500/10 px-2 py-1.5 text-[10px] text-amber-700 dark:text-amber-300 flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"warning"}),(0,s.jsx)("span",{children:y(p,"warningCostOptimizedNoPricing","No pricing data found for this combo. Cost-optimized may route unexpectedly.")})]}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(M,{checks:em,blockers:ex})}),(0,s.jsxs)("button",{onClick:()=>R(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-text-muted hover:text-primary hover:border-primary/30 transition-colors flex items-center justify-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),p("addModel")]})]}),(0,s.jsxs)("button",{onClick:()=>W(!L),className:"flex items-center gap-1 text-xs text-text-muted hover:text-text-main transition-colors self-start",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:L?"expand_less":"expand_more"}),p("advancedSettings")]}),L&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 p-3 bg-black/[0.02] dark:bg-white/[0.02] rounded-lg border border-black/5 dark:border-white/5",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(S,{label:p("maxRetries"),help:y(p,"advancedHelp.maxRetries","How many retries are attempted before failing the request.")}),(0,s.jsx)("input",{type:"number",min:"0",max:"10",value:G.maxRetries??"",placeholder:"1",onChange:e=>I({...G,maxRetries:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(S,{label:p("retryDelay"),help:y(p,"advancedHelp.retryDelay","Initial delay between retries. Higher values reduce burst pressure.")}),(0,s.jsx)("input",{type:"number",min:"0",max:"60000",step:"500",value:G.retryDelayMs??"",placeholder:"2000",onChange:e=>I({...G,retryDelayMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(S,{label:p("timeout"),help:y(p,"advancedHelp.timeout","Maximum request time before aborting. Set higher for long generations.")}),(0,s.jsx)("input",{type:"number",min:"1000",max:"600000",step:"1000",value:G.timeoutMs??"",placeholder:"120000",onChange:e=>I({...G,timeoutMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)(S,{label:p("healthcheck"),help:y(p,"advancedHelp.healthcheck","Skips unhealthy models/providers from routing decisions when enabled.")}),(0,s.jsx)("input",{type:"checkbox",checked:!1!==G.healthCheckEnabled,onChange:e=>I({...G,healthCheckEnabled:e.target.checked}),className:"accent-primary"})]})]}),"round-robin"===T&&(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2 pt-2 border-t border-black/5 dark:border-white/5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(S,{label:p("concurrencyPerModel"),help:y(p,"advancedHelp.concurrencyPerModel","Max simultaneous requests sent to each model in round-robin.")}),(0,s.jsx)("input",{type:"number",min:"1",max:"20",value:G.concurrencyPerModel??"",placeholder:"3",onChange:e=>I({...G,concurrencyPerModel:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(S,{label:p("queueTimeout"),help:y(p,"advancedHelp.queueTimeout","How long a request can wait in queue before timeout in round-robin.")}),(0,s.jsx)("input",{type:"number",min:"1000",max:"120000",step:"1000",value:G.queueTimeoutMs??"",placeholder:"30000",onChange:e=>I({...G,queueTimeoutMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]})]}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted",children:p("advancedHint")})]}),(0,s.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,s.jsx)(l.$n,{onClick:a,variant:"ghost",fullWidth:!0,size:"sm",children:u("cancel")}),(0,s.jsx)(l.$n,{onClick:ef,fullWidth:!0,size:"sm",disabled:ec,children:z?p("saving"):ey?u("save"):p("createCombo")})]})]})}),(0,s.jsx)(l.rq,{isOpen:E,onClose:()=>R(!1),onSelect:e=>{N.find(t=>t.model===e.value)||w([...N,{model:e.value,weight:0}])},activeProviders:x,modelAliases:U,title:p("addModelToCombo"),selectedModel:null})]})}function P({models:e}){let t=e.reduce((e,t)=>e+(t.weight||0),0),a=100===t,r=["bg-blue-500","bg-emerald-500","bg-amber-500","bg-purple-500","bg-rose-500","bg-cyan-500","bg-orange-500","bg-indigo-500"];return(0,s.jsxs)("div",{className:"mt-1.5",children:[(0,s.jsx)("div",{className:"h-1.5 rounded-full bg-black/5 dark:bg-white/5 overflow-hidden flex",children:e.map((e,t)=>e.weight?(0,s.jsx)("div",{className:`${r[t%r.length]} transition-all duration-300`,style:{width:`${Math.min(e.weight,100)}%`}},t):null)}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,s.jsx)("div",{className:"flex gap-1",children:e.map((e,t)=>e.weight>0&&(0,s.jsxs)("span",{className:"flex items-center gap-0.5 text-[9px] text-text-muted",children:[(0,s.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${r[t%r.length]}`}),e.weight,"%"]},t))}),(0,s.jsxs)("span",{className:`text-[10px] font-medium ${a?"text-emerald-500":t>100?"text-red-500":"text-amber-500"}`,children:[t,"%",!a&&t>0&&" ≠ 100%"]})]})]})}}},e=>{e.O(0,[8500,3418,9751,8055,1149,5846,647,8441,3794,7358],()=>e(e.s=7762)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{7762:(e,t,a)=>{Promise.resolve().then(a.bind(a,96191))},40993:(e,t,a)=>{"use strict";a.d(t,{Ex:()=>d.default,$n:()=>s.default,Zp:()=>i.default,Qv:()=>o.CardSkeleton,G9:()=>y.default,bQ:()=>N.default,pp:()=>j.default,Qn:()=>k.default,pd:()=>r.default,Mh:()=>f.default,uR:()=>p.default,aF:()=>n.default,rq:()=>x.default,LF:()=>m.default,KN:()=>b.default,Lo:()=>g.default,y7:()=>h.default,Iz:()=>v.default,l6:()=>l.default,lM:()=>c.default,cn:()=>u.default});var s=a(35806),r=a(34422),l=a(42994),i=a(81060),n=a(71361),o=a(92542);a(17705);var d=a(80927),c=a(19790);a(6261),a(55846),a(34243),a(89938),a(99023);var m=a(80178),x=a(85444),p=a(91961);a(25112);var u=a(45624),h=a(37415),b=a(48643),g=a(8287);a(1652);var f=a(92701);a(18150);var y=a(71689),v=a(33709);a(76332);var j=a(66200);a(61580);var k=a(51503);a(54128);var N=a(44638);a(21720),a(97050)},96191:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>N});var s=a(95155),r=a(12115),l=a(40993);function i({children:e,content:t,position:a="top",className:l="",delayMs:i=200}){let n,[o,d]=(0,r.useState)(!1),c=(0,r.useId)(),m=(0,r.useRef)(null),x=(0,r.useCallback)(()=>{clearTimeout(m.current),m.current=setTimeout(()=>d(!0),i)},[i]),p=(0,r.useCallback)(()=>{clearTimeout(m.current),d(!1)},[]);(0,r.useEffect)(()=>()=>{clearTimeout(m.current)},[]);let u={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"},h=t?c:void 0,b=(0,r.isValidElement)(e)?(n=[e.props["aria-describedby"],h].filter(Boolean).join(" "),(0,r.cloneElement)(e,{"aria-describedby":n||void 0})):(0,s.jsx)("span",{tabIndex:0,"aria-describedby":h,children:e});return(0,s.jsxs)("span",{className:`relative inline-flex ${l}`,onMouseEnter:x,onMouseLeave:p,onFocus:x,onBlur:p,onKeyDown:e=>{"Escape"===e.key&&p()},children:[b,o&&t&&(0,s.jsx)("span",{id:c,role:"tooltip",className:`absolute z-50 px-2.5 py-1.5 text-xs font-medium text-white bg-gray-900/95 rounded-md shadow-lg whitespace-nowrap pointer-events-none animate-in fade-in duration-150 motion-reduce:transition-none motion-reduce:animate-none border border-white/10 ${u[a]||u.top}`,children:t})]})}var n=a(30949),o=a(67671),d=a(50910);let c=/^[a-zA-Z0-9_/.-]+$/,m=[{value:"priority",labelKey:"priority",descKey:"priorityDesc",icon:"sort"},{value:"weighted",labelKey:"weighted",descKey:"weightedDesc",icon:"percent"},{value:"round-robin",labelKey:"roundRobin",descKey:"roundRobinDesc",icon:"autorenew"},{value:"random",labelKey:"random",descKey:"randomDesc",icon:"shuffle"},{value:"least-used",labelKey:"leastUsed",descKey:"leastUsedDesc",icon:"low_priority"},{value:"cost-optimized",labelKey:"costOpt",descKey:"costOptimizedDesc",icon:"savings"}],x={priority:{when:"Use when you have one preferred model and only want fallback on failure.",avoid:"Avoid when you need balanced load between models.",example:"Example: Primary coding model with cheaper backup for outages."},weighted:{when:"Use when you need controlled traffic split across models.",avoid:"Avoid when weights are not maintained or you need strict fairness.",example:"Example: 80% stable model and 20% canary model for safe rollout."},"round-robin":{when:"Use when you need predictable, even request distribution.",avoid:"Avoid when model latency/cost differs significantly.",example:"Example: Same model across multiple accounts to spread throughput."},random:{when:"Use when you want a simple spread with low configuration effort.",avoid:"Avoid when requests must be distributed with strict guarantees.",example:"Example: Prototyping with equivalent models and no traffic policy."},"least-used":{when:"Use when you want adaptive balancing based on recent demand.",avoid:"Avoid when your traffic is too low to benefit from usage balancing.",example:"Example: Mixed workloads where one model tends to get overloaded."},"cost-optimized":{when:"Use when minimizing cost is the top priority.",avoid:"Avoid when pricing data is missing or outdated.",example:"Example: Batch or background jobs where lower cost matters most."}},p={priority:{title:"Fail-safe baseline",description:"Use one primary model and keep fallback chain short and reliable.",tips:["Put your most reliable model first.","Keep 1-2 backup models with similar quality.","Use safe retries to absorb transient provider failures."]},weighted:{title:"Controlled traffic split",description:"Great for canary rollouts and gradual migration between models.",tips:["Start with conservative split like 90/10.","Keep the total at 100% and auto-balance after changes.","Monitor success and latency before increasing canary weight."]},"round-robin":{title:"Predictable load sharing",description:"Best when models are equivalent and you need smooth distribution.",tips:["Use at least 2 models.","Set concurrency limits to avoid burst overload.","Use queue timeout to fail fast under saturation."]},random:{title:"Quick spread with low setup",description:"Use when you need simple distribution without strict guarantees.",tips:["Use models with similar latency profiles.","Keep retries enabled to absorb random misses.","Prefer this for experimentation, not strict SLAs."]},"least-used":{title:"Adaptive balancing",description:"Routes to less-used models to reduce hotspots over time.",tips:["Works better under continuous traffic.","Combine with health checks for safer balancing.","Track per-model usage to validate distribution gains."]},"cost-optimized":{title:"Budget-first routing",description:"Routes to lower-cost models when pricing metadata is available.",tips:["Ensure pricing coverage for all selected models.","Keep a quality fallback for hard prompts.","Use for batch/background jobs where cost is the main KPI."]}},u="omniroute:combos:hide-usage-guide",h=[{id:"high-availability",icon:"shield",titleKey:"templateHighAvailability",descKey:"templateHighAvailabilityDesc",fallbackTitle:"High availability",fallbackDesc:"Priority routing with health checks and safe retries.",strategy:"priority",suggestedName:"high-availability",config:{maxRetries:2,retryDelayMs:1500,healthCheckEnabled:!0}},{id:"cost-saver",icon:"savings",titleKey:"templateCostSaver",descKey:"templateCostSaverDesc",fallbackTitle:"Cost saver",fallbackDesc:"Cost-optimized routing for budget-first workloads.",strategy:"cost-optimized",suggestedName:"cost-saver",config:{maxRetries:1,retryDelayMs:500,healthCheckEnabled:!0}},{id:"balanced",icon:"balance",titleKey:"templateBalanced",descKey:"templateBalancedDesc",fallbackTitle:"Balanced load",fallbackDesc:"Least-used routing to spread demand over time.",strategy:"least-used",suggestedName:"balanced-load",config:{maxRetries:1,retryDelayMs:1e3,healthCheckEnabled:!0}}];function b(e){return m.find(t=>t.value===e)||m[0]}function g(e,t){return e(b(t).labelKey)}function f(e,t){return e(b(t).descKey)}function y(e,t,a){return"function"==typeof e.has&&e.has(t)?e(t):a}function v(e,t,a){let s=x[t]||x.priority;return y(e,`strategyGuide.${t}.${a}`,s[a])}function j(e,t,a){let s=p[t]||p.priority;return"tips"===a?s.tips.map((a,s)=>y(e,`strategyRecommendations.${t}.tip${s+1}`,a)):y(e,`strategyRecommendations.${t}.${a}`,s[a])}function k(e){return"string"==typeof e?{model:e,weight:0}:{model:e.model,weight:e.weight||0}}function N(){let e=(0,d.c)("combos"),t=(0,d.c)("common"),[a,i]=(0,r.useState)([]),[c,m]=(0,r.useState)(!0),[x,p]=(0,r.useState)(!1),[h,b]=(0,r.useState)(null),[g,f]=(0,r.useState)([]),[v,j]=(0,r.useState)({}),[k,N]=(0,r.useState)(null),[C,$]=(0,r.useState)(null),{copied:S,copy:M}=(0,n.C)(),P=(0,o.i)(),[R,z]=(0,r.useState)(null),[A,K]=(0,r.useState)(null),[q,_]=(0,r.useState)([]),[O,U]=(0,r.useState)(!0),[H,B]=(0,r.useState)("");(0,r.useEffect)(()=>{F(),fetch("/api/settings/proxy").then(e=>e.ok?e.json():null).then(e=>K(e)).catch(()=>{})},[]),(0,r.useEffect)(()=>{try{globalThis.localStorage?.getItem(u)==="1"&&U(!1)}catch{}},[]);let F=async()=>{try{let[e,t,a,s]=await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/combos/metrics"),fetch("/api/provider-nodes")]),r=await e.json(),l=await t.json(),n=await a.json(),o=s.ok?await s.json():{nodes:[]};if(e.ok&&i(r.combos||[]),t.ok){let e=(l.connections||[]).filter(e=>"active"===e.testStatus||"success"===e.testStatus);f(e)}a.ok&&j(n.metrics||{}),_(o.nodes||[])}catch(e){console.log("Error fetching data:",e)}finally{m(!1)}},L=async t=>{try{let a=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(a.ok)await F(),p(!1),B(t.name?.trim()||""),P.success(e("comboCreated"));else{let t=await a.json();P.error(t.error?.message||t.error||e("failedCreate"))}}catch(t){P.error(e("errorCreating"))}},W=async(t,a)=>{try{let s=await fetch(`/api/combos/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(s.ok)await F(),b(null),P.success(e("comboUpdated"));else{let t=await s.json();P.error(t.error?.message||t.error||e("failedUpdate"))}}catch(t){P.error(e("errorUpdating"))}},G=async t=>{if(confirm(e("deleteConfirm")))try{(await fetch(`/api/combos/${t}`,{method:"DELETE"})).ok&&(i(a.filter(e=>e.id!==t)),P.success(e("comboDeleted")))}catch(t){P.error(e("errorDeleting"))}},I=async e=>{let t=e.name.replace(/-copy(-\d+)?$/,""),s=a.map(e=>e.name),r=`${t}-copy`,l=1;for(;s.includes(r);)l++,r=`${t}-copy-${l}`;let i={name:r,models:e.models,strategy:e.strategy||"priority",config:e.config||{}};await L(i)},Q=async t=>{$(t.name),N(null);try{let e=await fetch("/api/combos/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboName:t.name})}),a=await e.json();N(a)}catch(t){N({error:e("testFailed")}),P.error(e("testFailed"))}},J=async t=>{let a=!1===t.isActive;i(e=>e.map(e=>e.id===t.id?{...e,isActive:a}:e));try{await fetch(`/api/combos/${t.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:a})})}catch(s){i(e=>e.map(e=>e.id===t.id?{...e,isActive:!a}:e)),P.error(e("failedToggle"))}};return c?(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsx)(l.Qv,{}),(0,s.jsx)(l.Qv,{})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold",children:e("title")}),(0,s.jsx)("p",{className:"text-sm text-text-muted mt-1",children:e("description")})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[!O&&(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:()=>{U(!0);try{globalThis.localStorage?.removeItem(u)}catch{}},children:y(e,"usageGuideShow","Show guide")}),(0,s.jsx)(l.$n,{icon:"add",onClick:()=>p(!0),children:e("createCombo")})]})]}),O&&(0,s.jsx)(w,{onHide:()=>U(!1),onHideForever:()=>{U(!1);try{globalThis.localStorage?.setItem(u,"1")}catch{}}}),H&&(0,s.jsx)(l.Zp,{padding:"sm",className:"border border-emerald-500/20 bg-emerald-500/[0.04] dark:bg-emerald-500/[0.08]",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-emerald-700 dark:text-emerald-300",children:y(e,"quickTestTitle",`Combo "${H}" ready to validate`)}),(0,s.jsx)("code",{className:"inline-block text-[11px] mt-0.5 px-1.5 py-0.5 rounded bg-emerald-500/15 text-emerald-700 dark:text-emerald-300",children:H}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:y(e,"quickTestDescription","Run a test now to confirm fallback and latency behavior.")})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(l.$n,{size:"sm",variant:"secondary",icon:"play_arrow",onClick:()=>{Q({name:H}),B("")},children:y(e,"testNow","Test now")}),(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:()=>B(""),children:t("close")})]})]})}),0===a.length?(0,s.jsx)(l.pp,{icon:"\uD83E\uDDE9",title:e("noCombosYet"),description:e("description"),actionLabel:e("createCombo"),onAction:()=>p(!0)}):(0,s.jsx)("div",{className:"flex flex-col gap-4",children:a.map(e=>(0,s.jsx)(T,{combo:e,metrics:v[e.name],providerNodes:q,copied:S,onCopy:M,onEdit:()=>b(e),onDelete:()=>G(e.id),onDuplicate:()=>I(e),onTest:()=>Q(e),testing:C===e.name,onProxy:()=>z(e),hasProxy:!!A?.combos?.[e.id],onToggle:()=>J(e)},e.id))}),k&&(0,s.jsx)(l.aF,{isOpen:!!k,onClose:()=>{N(null),$(null)},title:e("testResults",{name:C}),children:(0,s.jsx)(D,{results:k})}),(0,s.jsx)(E,{isOpen:x,onClose:()=>p(!1),onSave:L,activeProviders:g,combo:null},"create"),(0,s.jsx)(E,{isOpen:!!h,combo:h,onClose:()=>b(null),onSave:e=>W(h.id,e),activeProviders:g},h?.id||"new"),R&&(0,s.jsx)(l.KN,{isOpen:!!R,onClose:()=>z(null),level:"combo",levelId:R.id,levelLabel:R.name})]})}function w({onHide:e,onHideForever:t}){let a=(0,d.c)("combos");return(0,s.jsxs)(l.Zp,{padding:"sm",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,s.jsx)("div",{className:"size-7 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-primary text-[16px]",children:"tips_and_updates"})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold",children:a("routingStrategy")}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:a("description")})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:e,className:"!h-6 px-2 text-[10px]",children:y(a,"usageGuideHide","Hide")}),(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:t,className:"!h-6 px-2 text-[10px]",children:y(a,"usageGuideDontShowAgain","Don't show again")})]})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2 mt-3",children:["priority","cost-optimized","least-used"].map(e=>{let t=b(e);return(0,s.jsxs)("div",{className:"rounded-lg border border-black/10 dark:border-white/10 bg-black/[0.02] dark:bg-white/[0.02] p-2.5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] text-primary",children:t.icon}),(0,s.jsx)("span",{className:"text-xs font-medium",children:g(a,e)})]}),(0,s.jsx)("p",{className:"text-[11px] leading-4 text-text-muted mt-1.5",children:f(a,e)})]},e)})})]})}function C({strategy:e}){let t=(0,d.c)("combos");return(0,s.jsxs)("div",{className:"rounded-lg border border-black/10 dark:border-white/10 bg-black/[0.02] dark:bg-white/[0.02] p-2.5",children:[(0,s.jsx)("div",{className:"text-[11px] text-text-muted",children:y(t,"strategyGuideTitle","How to use this strategy")}),(0,s.jsxs)("div",{className:"mt-1.5 flex flex-col gap-1.5 text-[11px]",children:[(0,s.jsxs)("p",{className:"text-text-main",children:[(0,s.jsxs)("span",{className:"font-semibold",children:[y(t,"strategyGuideWhen","When to use"),":"]})," ",v(t,e,"when")]}),(0,s.jsxs)("p",{className:"text-text-main",children:[(0,s.jsxs)("span",{className:"font-semibold",children:[y(t,"strategyGuideAvoid","Avoid when"),":"]})," ",v(t,e,"avoid")]}),(0,s.jsxs)("p",{className:"text-text-main",children:[(0,s.jsxs)("span",{className:"font-semibold",children:[y(t,"strategyGuideExample","Example"),":"]})," ",v(t,e,"example")]})]})]})}function $({strategy:e,onApply:t,showNudge:a}){let r=(0,d.c)("combos"),i=g(r,e),n=j(r,e,"title"),o=j(r,e,"description"),c=j(r,e,"tips");return(0,s.jsxs)("div",{className:"rounded-lg border border-black/10 dark:border-white/10 bg-white/70 dark:bg-white/[0.02] p-2.5",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:y(r,"recommendationsLabel","Recommended setup")}),(0,s.jsxs)("p",{className:"text-xs font-semibold text-text-main mt-0.5",children:[n," \xb7 ",(0,s.jsx)("span",{className:"text-primary",children:i})]}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:o})]}),(0,s.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:t,className:"!h-6 px-2 text-[10px]",children:y(r,"applyRecommendations","Apply recommendations")})]}),(0,s.jsx)("div",{className:"mt-2 grid grid-cols-1 gap-1",children:c.map((t,a)=>(0,s.jsxs)("div",{className:"flex items-start gap-1 rounded-md bg-black/[0.02] dark:bg-white/[0.03] px-1.5 py-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px] text-primary mt-0.5",children:"check"}),(0,s.jsx)("p",{className:"text-[10px] text-text-main",children:t})]},`${e}-tip-${a+1}`))}),a&&(0,s.jsx)("div",{"data-testid":"strategy-change-nudge",className:"mt-2 rounded-md border border-primary/20 bg-primary/10 px-2 py-1 text-[10px] text-primary",children:y(r,"recommendationsUpdated","Recommendations updated for {strategy}.").replace("{strategy}",i)})]})}function S({label:e,help:t}){return(0,s.jsxs)("div",{className:"flex items-center gap-1 mb-0.5",children:[(0,s.jsx)("label",{className:"text-[10px] text-text-muted",children:e}),(0,s.jsx)(i,{content:t,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px] text-text-muted cursor-help",children:"help"})})]})}function M({checks:e,blockers:t}){let a=(0,d.c)("combos"),r=t.length>0;return(0,s.jsxs)("div",{"data-testid":"combo-readiness-panel",className:`rounded-lg border px-2.5 py-2 ${r?"border-amber-500/30 bg-amber-500/5":"border-emerald-500/20 bg-emerald-500/[0.04]"}`,children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px] ${r?"text-amber-600 dark:text-amber-400":"text-emerald-600 dark:text-emerald-400"}`,children:r?"rule":"check_circle"}),(0,s.jsx)("p",{className:"text-[11px] font-medium text-text-main",children:y(a,"readinessTitle","Ready to save?")})]}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:y(a,"readinessDescription","Review the checklist before creating or updating this combo.")}),(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-1 mt-2",children:e.map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-1 rounded-md px-1.5 py-1 bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[12px] ${e.ok?"text-emerald-500":"text-amber-500"}`,children:e.ok?"task_alt":"pending"}),(0,s.jsx)("span",{className:"text-[10px] text-text-main",children:e.label})]},e.id))}),r&&(0,s.jsxs)("div",{"data-testid":"combo-save-blockers",className:"mt-2 rounded-md border border-amber-500/30 bg-amber-500/10 px-2 py-1.5",children:[(0,s.jsx)("p",{className:"text-[10px] font-medium text-amber-700 dark:text-amber-300",children:y(a,"saveBlockedTitle","Save is blocked until the following items are fixed:")}),(0,s.jsx)("div",{className:"mt-1 flex flex-col gap-0.5",children:t.map((e,t)=>(0,s.jsxs)("p",{className:"text-[10px] text-amber-700 dark:text-amber-300",children:["• ",e]},`${e}-${t}`))})]})]})}function T({combo:e,metrics:t,copied:a,onCopy:r,onEdit:n,onDelete:o,onDuplicate:c,onTest:m,testing:x,onProxy:p,hasProxy:u,onToggle:h,providerNodes:b}){let y=e.strategy||"priority",v=e.models||[],j=!1===e.isActive,N=(0,d.c)("combos"),w=(0,d.c)("common"),C=f(N,y);return(0,s.jsx)(l.Zp,{padding:"sm",className:`group ${j?"opacity-50":""}`,children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,s.jsx)("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("code",{className:"text-sm font-medium font-mono truncate",children:e.name}),(0,s.jsx)(i,{content:C,children:(0,s.jsx)("span",{className:`text-[9px] uppercase font-semibold px-1.5 py-0.5 rounded-full ${"weighted"===y?"bg-amber-500/15 text-amber-600 dark:text-amber-400":"round-robin"===y?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"random"===y?"bg-purple-500/15 text-purple-600 dark:text-purple-400":"least-used"===y?"bg-cyan-500/15 text-cyan-600 dark:text-cyan-400":"cost-optimized"===y?"bg-teal-500/15 text-teal-600 dark:text-teal-400":"bg-blue-500/15 text-blue-600 dark:text-blue-400"}`,children:g(N,y)})}),u&&(0,s.jsxs)("span",{className:"text-[9px] uppercase font-semibold px-1.5 py-0.5 rounded-full bg-primary/15 text-primary flex items-center gap-0.5",title:N("proxyConfigured"),children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"vpn_lock"}),"proxy"]}),(0,s.jsx)("button",{onClick:t=>{t.stopPropagation(),r(e.name,`combo-${e.id}`)},className:"p-0.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors opacity-100 md:opacity-0 md:group-hover:opacity-100",title:N("copyComboName"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:a===`combo-${e.id}`?"check":"content_copy"})})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[0===v.length?(0,s.jsx)("span",{className:"text-xs text-text-muted italic",children:N("noModels")}):v.slice(0,3).map((e,t)=>{let{model:a,weight:r}=k(e);return(0,s.jsxs)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1.5 py-0.5 rounded text-text-muted",children:[(e=>{let t=e.split("/");if(2!==t.length)return e;let[a,s]=t,r=(b||[]).find(e=>e.id===a||e.prefix===a);return r?`${r.name}/${s}`:e})(a),"weighted"===y&&r>0?` (${r}%)`:""]},t)}),v.length>3&&(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:N("more",{count:v.length-3})})]}),t&&(0,s.jsxs)("div",{className:"flex items-center gap-3 mt-1",children:[(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:[(0,s.jsx)("span",{className:"text-emerald-500",children:t.totalSuccesses}),"/",t.totalRequests," ",N("reqs")]}),(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:[t.successRate,"% ",N("success")]}),(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:["~",t.avgLatencyMs,"ms"]}),t.fallbackRate>0&&(0,s.jsxs)("span",{className:"text-[10px] text-amber-500",children:[t.fallbackRate,"% fallback"]})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0 ml-2",children:[(0,s.jsx)(l.lM,{size:"sm",checked:!j,onChange:h,title:N(j?"enableCombo":"disableCombo")}),(0,s.jsxs)("div",{className:"flex items-center gap-1 transition-opacity",children:[(0,s.jsx)("button",{onClick:m,disabled:x,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-emerald-500 transition-colors",title:N("testCombo"),children:(0,s.jsx)("span",{className:`material-symbols-outlined text-[16px] ${x?"animate-spin":""}`,children:x?"progress_activity":"play_arrow"})}),(0,s.jsx)("button",{onClick:c,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:N("duplicate"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"content_copy"})}),(0,s.jsx)("button",{onClick:p,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:N("proxyConfig"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"vpn_lock"})}),(0,s.jsx)("button",{onClick:n,className:"p-1.5 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors",title:w("edit"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"})}),(0,s.jsx)("button",{onClick:o,className:"p-1.5 hover:bg-red-500/10 rounded text-red-500 transition-colors",title:w("delete"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"})})]})]})]})})}function D({results:e}){return e.error?(0,s.jsxs)("div",{className:"flex items-center gap-2 text-red-500 text-sm",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"error"}),"string"==typeof e.error?e.error:JSON.stringify(e.error)]}):(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[e.resolvedBy&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-emerald-500 text-[18px]",children:"check_circle"}),(0,s.jsxs)("span",{children:["Resolved by:"," ",(0,s.jsx)("code",{className:"text-xs bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 px-1.5 py-0.5 rounded",children:e.resolvedBy})]})]}),e.results?.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs px-2 py-1.5 rounded bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,s.jsx)("span",{className:`material-symbols-outlined text-[14px] ${"ok"===e.status?"text-emerald-500":"skipped"===e.status?"text-text-muted":"text-red-500"}`,children:"ok"===e.status?"check_circle":"skipped"===e.status?"skip_next":"error"}),(0,s.jsx)("code",{className:"font-mono flex-1",children:e.model}),void 0!==e.latencyMs&&(0,s.jsxs)("span",{className:"text-text-muted",children:[e.latencyMs,"ms"]}),(0,s.jsx)("span",{className:`text-[10px] uppercase font-medium ${"ok"===e.status?"text-emerald-500":"skipped"===e.status?"text-text-muted":"text-red-500"}`,children:e.status})]},t))]})}function E({isOpen:e,combo:t,onClose:a,onSave:n,activeProviders:x}){let p=(0,d.c)("combos"),u=(0,d.c)("common"),b=(0,o.i)(),[v,j]=(0,r.useState)(t?.name||""),[N,w]=(0,r.useState)(()=>(t?.models||[]).map(e=>k(e))),[T,D]=(0,r.useState)(t?.strategy||"priority"),[E,R]=(0,r.useState)(!1),[z,A]=(0,r.useState)(!1),[K,q]=(0,r.useState)(""),[_,O]=(0,r.useState)({}),[U,H]=(0,r.useState)({}),[B,F]=(0,r.useState)([]),[L,W]=(0,r.useState)(!1),[G,I]=(0,r.useState)(t?.config||{}),[Q,J]=(0,r.useState)(!1),Z=(0,r.useRef)(!1),Y=(0,r.useCallback)(e=>{let t=e.split("/");if(2!==t.length)return!1;let[a,s]=t,r=B.find(e=>e.id===a||e.prefix===a),l=[a];return r?.apiType&&l.push(r.apiType),r?.name&&l.push(String(r.name).toLowerCase()),l.some(e=>!!_?.[e]?.[s])},[_,B]),[V,X]=(0,r.useState)(null),[ee,et]=(0,r.useState)(null),ea=N.reduce((e,t)=>e+(t.weight||0),0),es=N.reduce((e,t)=>e+ +!!Y(t.model),0),er=N.length>0?Math.round(es/N.length*100):0,el=0===N.length,ei="round-robin"===T&&1===N.length,en="cost-optimized"===T&&N.length>0&&0===es,eo="cost-optimized"===T&&N.length>0&&es>0&&es<N.length,ed="weighted"===T&&N.length>0&&100!==ea,ec=!v.trim()||!!K||z||el||ed||en,em=[{id:"name",ok:!!v.trim()&&!K,label:y(p,"readinessCheckName","Combo name is valid")},{id:"models",ok:!el,label:y(p,"readinessCheckModels","At least one model is selected")},{id:"weights",ok:"weighted"!==T||!ed,label:"weighted"===T?y(p,"readinessCheckWeights","Weighted total is 100%"):y(p,"readinessCheckWeightsOptional","Weight rule not required")},{id:"pricing",ok:"cost-optimized"!==T||!en,label:"cost-optimized"===T?y(p,"readinessCheckPricing","Pricing data is available"):y(p,"readinessCheckPricingOptional","Pricing rule not required")}],ex=[];v.trim()?K&&ex.push(K):ex.push(y(p,"saveBlockName","Define a combo name.")),el&&ex.push(y(p,"saveBlockModels","Add at least one model.")),ed&&ex.push("function"==typeof p.has&&p.has("saveBlockWeighted")?p("saveBlockWeighted",{total:ea}):`Set weights to 100% (current: ${ea}%).`),en&&ex.push(y(p,"saveBlockPricing","Add pricing for at least one model or choose a different strategy."));let ep=async()=>{try{let[e,t,a]=await Promise.all([fetch("/api/models/alias"),fetch("/api/provider-nodes"),fetch("/api/pricing")]);if(!e.ok||!t.ok)throw Error(`Failed to fetch data: aliases=${e.status}, nodes=${t.status}`);let s=a.ok?await a.json():{},[r,l]=await Promise.all([e.json(),t.json()]);O(s&&"object"==typeof s&&!Array.isArray(s)?s:{}),H(r.aliases||{}),F(l.nodes||[])}catch(e){console.error("Error fetching modal data:",e)}};(0,r.useEffect)(()=>{e&&ep()},[e]),(0,r.useEffect)(()=>{if(!Z.current){Z.current=!0;return}J(!0);let e=setTimeout(()=>J(!1),2600);return()=>clearTimeout(e)},[T]);let eu=e=>e.trim()?c.test(e)?(q(""),!0):(q(p("nameInvalid")),!1):(q(p("nameRequired")),!1),eh=()=>{let e=N.length;if(0===e)return;let t=Math.floor(100/e),a=100-t*e;w(N.map((e,s)=>({...e,weight:t+(0===s?a:0)})))},eb=(0,r.useCallback)(e=>{let t=e.split("/");if(2!==t.length)return e;let[a,s]=t,r=B.find(e=>e.id===a||e.prefix===a);return r?`${r.name}/${s}`:e},[B]),eg=e=>{e.target&&(e.currentTarget.style.opacity="1"),X(null),et(null)},ef=async()=>{if(!eu(v)||el||ed||en)return;A(!0);let e={name:v.trim(),models:"weighted"===T?N:N.map(e=>e.model),strategy:T},t={...G};"round-robin"===T&&(void 0!==G.concurrencyPerModel&&(t.concurrencyPerModel=G.concurrencyPerModel),void 0!==G.queueTimeoutMs&&(t.queueTimeoutMs=G.queueTimeoutMs)),Object.keys(t).length>0&&(e.config=t),await n(e),A(!1)},ey=!!t;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.aF,{isOpen:e,onClose:a,title:ey?p("editCombo"):p("createCombo"),children:(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(l.pd,{label:p("comboName"),value:v,onChange:e=>{let t=e.target.value;j(t),t?eu(t):q("")},placeholder:p("comboNamePlaceholder"),error:K}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:p("nameHint")})]}),!ey&&(0,s.jsxs)("div",{className:"rounded-lg border border-black/10 dark:border-white/10 bg-black/[0.02] dark:bg-white/[0.02] p-2.5",children:[(0,s.jsxs)("div",{className:"mb-2",children:[(0,s.jsx)("p",{className:"text-xs font-medium",children:y(p,"templatesTitle","Quick templates")}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:y(p,"templatesDescription","Apply a starting profile, then adjust models and config.")})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-1.5",children:h.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>{D(e.strategy),I(t=>({...t,...e.config})),v.trim()||j(e.suggestedName)},className:"text-left rounded-md border border-black/10 dark:border-white/10 bg-white/70 dark:bg-white/[0.03] px-2 py-1.5 hover:border-primary/40 hover:bg-primary/5 transition-colors",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] text-primary",children:e.icon}),(0,s.jsx)("span",{className:"text-[11px] font-medium text-text-main",children:y(p,e.titleKey,e.fallbackTitle)})]}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-1 leading-4",children:y(p,e.descKey,e.fallbackDesc)}),(0,s.jsx)("p",{className:"text-[10px] text-primary mt-1",children:y(p,"templateApply","Apply template")})]},e.id))})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-1 mb-1.5",children:[(0,s.jsx)("label",{className:"text-sm font-medium",children:p("routingStrategy")}),(0,s.jsx)(i,{content:f(p,T),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[13px] text-text-muted cursor-help",children:"help"})})]}),(0,s.jsx)("div",{className:"grid grid-cols-3 gap-1 p-0.5 bg-black/5 dark:bg-white/5 rounded-lg",children:m.map(e=>(0,s.jsxs)("button",{onClick:()=>D(e.value),"data-testid":`strategy-option-${e.value}`,title:p(e.descKey),"aria-label":`${g(p,e.value)}. ${p(e.descKey)}`,className:`py-1.5 px-2 rounded-md text-xs font-medium transition-all ${T===e.value?"bg-white dark:bg-bg-main shadow-sm text-primary":"text-text-muted hover:text-text-main"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] align-middle mr-0.5",children:e.icon}),g(p,e.value)]},e.value))}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:f(p,T)}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(C,{strategy:T})}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)($,{strategy:T,onApply:()=>{let e={priority:{maxRetries:2,retryDelayMs:1500,healthCheckEnabled:!0},weighted:{maxRetries:1,retryDelayMs:1e3,healthCheckEnabled:!0},"round-robin":{maxRetries:1,retryDelayMs:750,healthCheckEnabled:!0,concurrencyPerModel:3,queueTimeoutMs:3e4},random:{maxRetries:1,retryDelayMs:1e3,healthCheckEnabled:!0},"least-used":{maxRetries:1,retryDelayMs:1e3,healthCheckEnabled:!0},"cost-optimized":{maxRetries:1,retryDelayMs:500,healthCheckEnabled:!0}},t=e[T]||e.priority;I(e=>{let a={...e};for(let[e,s]of Object.entries(t))(void 0===a[e]||null===a[e]||""===a[e])&&(a[e]=s);return a}),"weighted"===T&&N.length>1&&eh(),"round-robin"===T&&W(!0),b.success(y(p,"recommendationsApplied","Recommendations applied to this combo."))},showNudge:Q})})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,s.jsx)("label",{className:"text-sm font-medium",children:p("models")}),"weighted"===T&&N.length>1&&(0,s.jsx)("button",{onClick:eh,className:"text-[10px] text-primary hover:text-primary/80 transition-colors",children:p("autoBalance")})]}),0===N.length?(0,s.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:p("noModelsYet")})]}):(0,s.jsx)("div",{className:"flex flex-col gap-1 max-h-[240px] overflow-y-auto",children:N.map((e,t)=>(0,s.jsxs)("div",{draggable:!0,onDragStart:e=>{X(t),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",t.toString()),e.target&&setTimeout(()=>e.currentTarget.style.opacity="0.5",0)},onDragEnd:eg,onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="move",et(t)},onDrop:e=>((e,t)=>{if(e.preventDefault(),null===V||V===t)return;let a=[...N],[s]=a.splice(V,1);a.splice(t,0,s),w(a),X(null),et(null)})(e,t),className:`group/item flex items-center gap-1.5 px-2 py-1.5 rounded-md transition-all cursor-grab active:cursor-grabbing ${ee===t&&V!==t?"bg-primary/10 border border-primary/30":"bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] border border-transparent"} ${V===t?"opacity-50":""}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted/40 cursor-grab shrink-0",children:"drag_indicator"}),(0,s.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:t+1}),(0,s.jsx)("div",{className:"flex-1 min-w-0 px-1 text-xs text-text-main truncate",children:eb(e.model)}),"cost-optimized"===T&&(0,s.jsx)("span",{className:`text-[9px] px-1.5 py-0.5 rounded-full uppercase font-semibold ${Y(e.model)?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"bg-amber-500/15 text-amber-600 dark:text-amber-400"}`,title:Y(e.model)?y(p,"pricingAvailable","Pricing available"):y(p,"pricingMissing","No pricing"),children:Y(e.model)?y(p,"pricingAvailableShort","priced"):y(p,"pricingMissingShort","no-price")}),"weighted"===T&&(0,s.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0",children:[(0,s.jsx)("input",{type:"number",min:"0",max:"100",value:e.weight,onChange:e=>{var a;let s;return a=e.target.value,void((s=[...N])[t]={...s[t],weight:Math.max(0,Math.min(100,Number(a)||0))},w(s))},className:"w-10 text-[11px] text-center py-0.5 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"}),(0,s.jsx)("span",{className:"text-[10px] text-text-muted",children:"%"})]}),"priority"===T&&(0,s.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,s.jsx)("button",{onClick:()=>(e=>{if(0===e)return;let t=[...N];[t[e-1],t[e]]=[t[e],t[e-1]],w(t)})(t),disabled:0===t,className:`p-0.5 rounded ${0===t?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:p("moveUp"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,s.jsx)("button",{onClick:()=>(e=>{if(e===N.length-1)return;let t=[...N];[t[e],t[e+1]]=[t[e+1],t[e]],w(t)})(t),disabled:t===N.length-1,className:`p-0.5 rounded ${t===N.length-1?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:p("moveDown"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,s.jsx)("button",{onClick:()=>{w(N.filter((e,a)=>a!==t))},className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:p("removeModel"),children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},`${e.model}-${t}`))}),"weighted"===T&&N.length>0&&(0,s.jsx)(P,{models:N}),"cost-optimized"===T&&N.length>0&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-black/10 dark:border-white/10 bg-black/[0.02] dark:bg-white/[0.02] px-2 py-1.5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-[10px]",children:[(0,s.jsx)("span",{className:"text-text-muted",children:y(p,"pricingCoverage","Pricing coverage")}),(0,s.jsxs)("span",{className:"font-medium text-text-main",children:[es,"/",N.length," (",er,"%)"]})]}),(0,s.jsx)("div",{className:"h-1.5 mt-1 rounded-full bg-black/10 dark:bg-white/10 overflow-hidden",children:(0,s.jsx)("div",{className:`h-full transition-all duration-300 ${100===er?"bg-emerald-500":er>0?"bg-amber-500":"bg-red-500"}`,style:{width:`${er}%`}})}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-1",children:y(p,"pricingCoverageHint","Cost-optimized works best when all combo models have pricing.")})]}),el&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-amber-500/20 bg-amber-500/10 px-2 py-1.5 text-[10px] text-amber-700 dark:text-amber-300 flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"warning"}),(0,s.jsx)("span",{children:p("noModelsYet")})]}),ed&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-amber-500/20 bg-amber-500/10 px-2 py-1.5 text-[10px] text-amber-700 dark:text-amber-300 flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"warning"}),(0,s.jsxs)("span",{children:[p("weighted")," ",ea,"% ","≠"," 100%. ",p("autoBalance")]})]}),ei&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-blue-500/20 bg-blue-500/10 px-2 py-1.5 text-[10px] text-blue-700 dark:text-blue-300 flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"info"}),(0,s.jsx)("span",{children:y(p,"warningRoundRobinSingleModel","Round-robin is most useful with at least 2 models.")})]}),eo&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-amber-500/20 bg-amber-500/10 px-2 py-1.5 text-[10px] text-amber-700 dark:text-amber-300 flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"warning"}),(0,s.jsx)("span",{children:"function"==typeof p.has&&p.has("warningCostOptimizedPartialPricing")?p("warningCostOptimizedPartialPricing",{priced:es,total:N.length}):`Only ${es} of ${N.length} models have pricing. Routing may be partially cost-aware.`})]}),en&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-amber-500/20 bg-amber-500/10 px-2 py-1.5 text-[10px] text-amber-700 dark:text-amber-300 flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"warning"}),(0,s.jsx)("span",{children:y(p,"warningCostOptimizedNoPricing","No pricing data found for this combo. Cost-optimized may route unexpectedly.")})]}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(M,{checks:em,blockers:ex})}),(0,s.jsxs)("button",{onClick:()=>R(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-text-muted hover:text-primary hover:border-primary/30 transition-colors flex items-center justify-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),p("addModel")]})]}),(0,s.jsxs)("button",{onClick:()=>W(!L),className:"flex items-center gap-1 text-xs text-text-muted hover:text-text-main transition-colors self-start",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:L?"expand_less":"expand_more"}),p("advancedSettings")]}),L&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 p-3 bg-black/[0.02] dark:bg-white/[0.02] rounded-lg border border-black/5 dark:border-white/5",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(S,{label:p("maxRetries"),help:y(p,"advancedHelp.maxRetries","How many retries are attempted before failing the request.")}),(0,s.jsx)("input",{type:"number",min:"0",max:"10",value:G.maxRetries??"",placeholder:"1",onChange:e=>I({...G,maxRetries:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(S,{label:p("retryDelay"),help:y(p,"advancedHelp.retryDelay","Initial delay between retries. Higher values reduce burst pressure.")}),(0,s.jsx)("input",{type:"number",min:"0",max:"60000",step:"500",value:G.retryDelayMs??"",placeholder:"2000",onChange:e=>I({...G,retryDelayMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(S,{label:p("timeout"),help:y(p,"advancedHelp.timeout","Maximum request time before aborting. Set higher for long generations.")}),(0,s.jsx)("input",{type:"number",min:"1000",max:"600000",step:"1000",value:G.timeoutMs??"",placeholder:"120000",onChange:e=>I({...G,timeoutMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)(S,{label:p("healthcheck"),help:y(p,"advancedHelp.healthcheck","Skips unhealthy models/providers from routing decisions when enabled.")}),(0,s.jsx)("input",{type:"checkbox",checked:!1!==G.healthCheckEnabled,onChange:e=>I({...G,healthCheckEnabled:e.target.checked}),className:"accent-primary"})]})]}),"round-robin"===T&&(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2 pt-2 border-t border-black/5 dark:border-white/5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(S,{label:p("concurrencyPerModel"),help:y(p,"advancedHelp.concurrencyPerModel","Max simultaneous requests sent to each model in round-robin.")}),(0,s.jsx)("input",{type:"number",min:"1",max:"20",value:G.concurrencyPerModel??"",placeholder:"3",onChange:e=>I({...G,concurrencyPerModel:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(S,{label:p("queueTimeout"),help:y(p,"advancedHelp.queueTimeout","How long a request can wait in queue before timeout in round-robin.")}),(0,s.jsx)("input",{type:"number",min:"1000",max:"120000",step:"1000",value:G.queueTimeoutMs??"",placeholder:"30000",onChange:e=>I({...G,queueTimeoutMs:e.target.value?Number(e.target.value):void 0}),className:"w-full text-xs py-1.5 px-2 rounded border border-black/10 dark:border-white/10 bg-transparent focus:border-primary focus:outline-none"})]})]}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted",children:p("advancedHint")})]}),(0,s.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,s.jsx)(l.$n,{onClick:a,variant:"ghost",fullWidth:!0,size:"sm",children:u("cancel")}),(0,s.jsx)(l.$n,{onClick:ef,fullWidth:!0,size:"sm",disabled:ec,children:z?p("saving"):ey?u("save"):p("createCombo")})]})]})}),(0,s.jsx)(l.rq,{isOpen:E,onClose:()=>R(!1),onSelect:e=>{N.find(t=>t.model===e.value)||w([...N,{model:e.value,weight:0}])},activeProviders:x,modelAliases:U,title:p("addModelToCombo"),selectedModel:null})]})}function P({models:e}){let t=e.reduce((e,t)=>e+(t.weight||0),0),a=100===t,r=["bg-blue-500","bg-emerald-500","bg-amber-500","bg-purple-500","bg-rose-500","bg-cyan-500","bg-orange-500","bg-indigo-500"];return(0,s.jsxs)("div",{className:"mt-1.5",children:[(0,s.jsx)("div",{className:"h-1.5 rounded-full bg-black/5 dark:bg-white/5 overflow-hidden flex",children:e.map((e,t)=>e.weight?(0,s.jsx)("div",{className:`${r[t%r.length]} transition-all duration-300`,style:{width:`${Math.min(e.weight,100)}%`}},t):null)}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,s.jsx)("div",{className:"flex gap-1",children:e.map((e,t)=>e.weight>0&&(0,s.jsxs)("span",{className:"flex items-center gap-0.5 text-[9px] text-text-muted",children:[(0,s.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${r[t%r.length]}`}),e.weight,"%"]},t))}),(0,s.jsxs)("span",{className:`text-[10px] font-medium ${a?"text-emerald-500":t>100?"text-red-500":"text-amber-500"}`,children:[t,"%",!a&&t>0&&" ≠ 100%"]})]})]})}}},e=>{e.O(0,[8500,3418,9751,8055,1149,5846,647,8441,3794,7358],()=>e(e.s=7762)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6099],{21583:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>k});var a=t(95155),l=t(12115),i=t(40993),r=t(14051),n=t.n(r),o=t(98500),c=t.n(o),d=t(30949),m=t(20909),x=t(50910);let p=t(41463).env.NEXT_PUBLIC_CLOUD_URL||null,u=15e3;function b({machineId:e}){let s=(0,x.c)("endpoint"),t=(0,x.c)("common"),[r,n]=(0,l.useState)(!0),[o,m]=(0,l.useState)([]),[b,f]=(0,l.useState)(null),[j,y]=(0,l.useState)(!1),[v,N]=(0,l.useState)(!1),[k,w]=(0,l.useState)(!1),[C,S]=(0,l.useState)(!1),[T,_]=(0,l.useState)(null),[A,P]=(0,l.useState)(""),[E,$]=(0,l.useState)(!1),[R,M]=(0,l.useState)(null),[D,O]=(0,l.useState)(p),[U,I]=(0,l.useState)("api"),[q,B]=(0,l.useState)(null),[Q,L]=(0,l.useState)(null),{copied:F,copy:z}=(0,d.C)();(0,l.useEffect)(()=>{Promise.allSettled([J(),W(),G()]).finally(()=>{n(!1)})},[]);let W=async()=>{try{let e=await fetch("/v1/models");if(e.ok){let s=await e.json();m(s.data||[])}}catch(e){console.log("Error fetching models:",e)}},G=async()=>{try{let[e,s]=await Promise.allSettled([fetch("/api/mcp/status"),fetch("/api/a2a/status")]);"fulfilled"===e.status&&e.value.ok&&B(await e.value.json()),"fulfilled"===s.status&&s.value.ok&&L(await s.value.json())}catch{}},Z=(0,l.useMemo)(()=>{let e=o.filter(e=>!e.type&&!e.parent),s=o.filter(e=>"embedding"===e.type&&!e.parent),t=o.filter(e=>"image"===e.type&&!e.parent),a=o.filter(e=>"rerank"===e.type&&!e.parent),l=o.filter(e=>"audio"===e.type&&"transcription"===e.subtype&&!e.parent),i=o.filter(e=>"audio"===e.type&&"speech"===e.subtype&&!e.parent);return{chat:e,embeddings:s,images:t,rerank:a,audioTranscription:l,audioSpeech:i,moderation:o.filter(e=>"moderation"===e.type&&!e.parent),music:o.filter(e=>"music"===e.type&&!e.parent)}},[o]),H=async(e,t=u)=>{let a=new AbortController,l=setTimeout(()=>a.abort(),t);try{let s=await fetch("/api/sync/cloud",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e}),signal:a.signal}),t=await s.json().catch(()=>({}));return{ok:s.ok,status:s.status,data:t}}catch(e){if(e?.name==="AbortError")return{ok:!1,status:408,data:{error:s("cloudRequestTimeout")}};return{ok:!1,status:500,data:{error:e.message||s("cloudRequestFailed")}}}finally{clearTimeout(l)}},J=async()=>{try{let e=await fetch("/api/settings");if(e.ok){let s=await e.json();y(s.cloudEnabled||!1)}}catch(e){console.log("Error loading cloud settings:",e)}},V=e=>{e?N(!0):w(!0)};(0,l.useEffect)(()=>{if(T){let e=setTimeout(()=>_(null),5e3);return()=>clearTimeout(e)}},[T]),(0,l.useEffect)(()=>{let e=setInterval(G,3e4);return()=>clearInterval(e)},[]);let X=()=>{globalThis.dispatchEvent(new Event("cloud-status-changed"))},Y=async()=>{S(!0),$(!1),P("syncing");try{let{ok:e,status:t,data:a}=await H("enable");if(e)P("verifying"),await new Promise(e=>setTimeout(e,600)),y(!0),P("done"),$(!0),S(!1),X(),await new Promise(e=>setTimeout(e,1200)),N(!1),$(!1),a.verified?_({type:"success",message:s("cloudConnectedVerified")}):_({type:"warning",message:a.verifyError?s("connectedVerificationPendingWithError",{error:a.verifyError}):s("connectedVerificationPending")}),a.cloudUrl&&O(a.cloudUrl),await J();else{let e=a.error||s("failedEnable");(502===t||408===t)&&(e=s("cloudWorkerUnreachable")),_({type:"error",message:e}),N(!1)}}catch(e){_({type:"error",message:e.message||s("connectionFailed")}),N(!1)}finally{S(!1),P("")}},K=async()=>{S(!0),P("syncing");try{await H("sync"),P("disabling");let{ok:e,data:t}=await H("disable");e?(y(!1),_({type:"success",message:s("cloudDisabledSuccess")}),w(!1),X(),await J()):_({type:"error",message:t.error||s("failedDisable")})}catch(e){console.log("Error disabling cloud:",e),_({type:"error",message:s("failedDisable")})}finally{S(!1),P("")}},[ee,es]=(0,l.useState)("/v1"),et=D?`${D}/v1`:null;if((0,l.useEffect)(()=>{es(`${window.location.origin}/v1`)},[]),r)return(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(i.Qv,{}),(0,a.jsx)(i.Qv,{})]});let ea=j&&et?et:ee,el=!!q?.online,ei=Q?.status==="ok",er=Number(q?.heartbeat?.toolCount||0),en=Number(Q?.tasks?.activeStreams||0);return(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsxs)(i.Zp,{className:"",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:s("title")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:j?s("usingCloudProxy"):s("usingLocalServer")}),e&&(0,a.jsx)("p",{className:"text-xs text-text-muted mt-1",children:s("machineId",{id:e.slice(0,8)})})]}),(0,a.jsx)("div",{className:"flex items-center gap-2",children:j?(0,a.jsx)(i.$n,{size:"sm",variant:"secondary",icon:"cloud_off",onClick:()=>V(!1),disabled:C,className:"bg-red-500/10! text-red-500! hover:bg-red-500/20! border-red-500/30!",children:s("disableCloud")}):(0,a.jsx)(i.$n,{variant:"primary",icon:"cloud_upload",onClick:()=>V(!0),disabled:C,className:"bg-linear-to-r from-primary to-blue-500 hover:from-primary-hover hover:to-blue-600",children:s("enableCloud")})})]}),T&&(0,a.jsxs)("div",{className:`flex items-center gap-2 px-4 py-2.5 rounded-lg mb-4 text-sm font-medium animate-in fade-in slide-in-from-top-2 duration-300 ${"success"===T.type?"bg-green-500/10 border border-green-500/30 text-green-400":"warning"===T.type?"bg-amber-500/10 border border-amber-500/30 text-amber-400":"bg-red-500/10 border border-red-500/30 text-red-400"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"success"===T.type?"check_circle":"warning"===T.type?"warning":"error"}),(0,a.jsx)("span",{className:"flex-1",children:T.message}),(0,a.jsx)("button",{onClick:()=>_(null),className:"p-0.5 hover:bg-white/10 rounded transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]}),(0,a.jsxs)("div",{className:"flex gap-2 mb-3",children:[(0,a.jsx)(i.pd,{value:ea,readOnly:!0,className:`flex-1 font-mono text-sm ${j?"animate-border-glow":""}`}),(0,a.jsx)(i.$n,{variant:"secondary",icon:"endpoint_url"===F?"check":"content_copy",onClick:()=>z(ea,"endpoint_url"),children:t("endpoint_url"===F?"copied":"copy")})]})]}),(0,a.jsx)(i.Zp,{children:(0,a.jsxs)("div",{className:"flex flex-wrap gap-3 items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:s("sectionTitle")||"Integration Surface"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:s("sectionDescription")||"OpenAI-compatible APIs and operational protocol endpoints"})]}),(0,a.jsx)(i.Iz,{options:[{value:"api",label:s("tabApis")||"OpenAI-compatible APIs",icon:"api"},{value:"protocols",label:s("tabProtocols")||"Protocols",icon:"hub"}],value:U,onChange:I,"aria-label":s("tabsAria")||"Endpoint sections"})]})}),"api"===U?(0,a.jsxs)(i.Zp,{children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:s("available")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:s("modelsAcrossEndpoints",{models:Object.values(Z).reduce((e,s)=>e+s.length,0),endpoints:[Z.chat,Z.embeddings,Z.images,Z.rerank,Z.audioTranscription,Z.audioSpeech,Z.moderation,Z.music].filter(e=>e.length>0).length+2})})]})}),(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm text-primary",children:"hub"}),(0,a.jsx)("h3",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:s("categoryCore")||"Core APIs"}),(0,a.jsx)("div",{className:"flex-1 h-px bg-border/50"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(g,{icon:"chat",iconColor:"text-blue-500",iconBg:"bg-blue-500/10",title:s("chatCompletions"),path:"/v1/chat/completions",description:s("chatDesc"),models:Z.chat,expanded:"chat"===b,onToggle:()=>f("chat"===b?null:"chat"),copy:z,copied:F,baseUrl:ea}),(0,a.jsx)(g,{icon:"code",iconColor:"text-indigo-500",iconBg:"bg-indigo-500/10",title:s("responses")||"Responses API",path:"/v1/responses",description:s("responsesDesc")||"OpenAI Responses API for Codex and advanced agentic workflows",models:Z.chat,expanded:"responses"===b,onToggle:()=>f("responses"===b?null:"responses"),copy:z,copied:F,baseUrl:ea})]})]}),(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm text-purple-400",children:"perm_media"}),(0,a.jsx)("h3",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:s("categoryMedia")||"Media & Multi-Modal"}),(0,a.jsx)("div",{className:"flex-1 h-px bg-border/50"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(g,{icon:"data_array",iconColor:"text-emerald-500",iconBg:"bg-emerald-500/10",title:s("embeddings"),path:"/v1/embeddings",description:s("embeddingsDesc"),models:Z.embeddings,expanded:"embeddings"===b,onToggle:()=>f("embeddings"===b?null:"embeddings"),copy:z,copied:F,baseUrl:ea}),(0,a.jsx)(g,{icon:"image",iconColor:"text-purple-500",iconBg:"bg-purple-500/10",title:s("imageGeneration"),path:"/v1/images/generations",description:s("imageDesc"),models:Z.images,expanded:"images"===b,onToggle:()=>f("images"===b?null:"images"),copy:z,copied:F,baseUrl:ea}),(0,a.jsx)(g,{icon:"mic",iconColor:"text-rose-500",iconBg:"bg-rose-500/10",title:s("audioTranscription"),path:"/v1/audio/transcriptions",description:s("audioTranscriptionDesc"),models:Z.audioTranscription,expanded:"audioTranscription"===b,onToggle:()=>f("audioTranscription"===b?null:"audioTranscription"),copy:z,copied:F,baseUrl:ea}),(0,a.jsx)(g,{icon:"record_voice_over",iconColor:"text-cyan-500",iconBg:"bg-cyan-500/10",title:s("textToSpeech"),path:"/v1/audio/speech",description:s("textToSpeechDesc"),models:Z.audioSpeech,expanded:"audioSpeech"===b,onToggle:()=>f("audioSpeech"===b?null:"audioSpeech"),copy:z,copied:F,baseUrl:ea}),(0,a.jsx)(g,{icon:"music_note",iconColor:"text-fuchsia-500",iconBg:"bg-fuchsia-500/10",title:s("musicGeneration")||"Music Generation",path:"/v1/music/generations",description:s("musicDesc")||"Generate music and audio tracks via ComfyUI (Stable Audio, MusicGen)",models:Z.music,expanded:"music"===b,onToggle:()=>f("music"===b?null:"music"),copy:z,copied:F,baseUrl:ea})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm text-amber-400",children:"build"}),(0,a.jsx)("h3",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:s("categoryUtility")||"Utility & Management"}),(0,a.jsx)("div",{className:"flex-1 h-px bg-border/50"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(g,{icon:"sort",iconColor:"text-amber-500",iconBg:"bg-amber-500/10",title:s("rerank"),path:"/v1/rerank",description:s("rerankDesc"),models:Z.rerank,expanded:"rerank"===b,onToggle:()=>f("rerank"===b?null:"rerank"),copy:z,copied:F,baseUrl:ea}),(0,a.jsx)(g,{icon:"shield",iconColor:"text-orange-500",iconBg:"bg-orange-500/10",title:s("moderations"),path:"/v1/moderations",description:s("moderationsDesc"),models:Z.moderation,expanded:"moderation"===b,onToggle:()=>f("moderation"===b?null:"moderation"),copy:z,copied:F,baseUrl:ea}),(0,a.jsx)(g,{icon:"list",iconColor:"text-teal-500",iconBg:"bg-teal-500/10",title:s("listModels")||"List Models",path:"/v1/models",description:s("listModelsDesc")||"List all available models across all connected providers",models:[],expanded:"models"===b,onToggle:()=>f("models"===b?null:"models"),copy:z,copied:F,baseUrl:ea})]})]})]}):(0,a.jsx)(i.Zp,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:s("protocolsTitle")||"Protocols"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mt-1",children:s("protocolsDescription")||"MCP and A2A are first-class endpoints with dedicated observability and controls."})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"rounded-xl border border-border p-4 bg-bg-subtle",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"hub"}),s("mcpCardTitle")||"MCP Server"]}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-1",children:s("mcpCardDescription")||"Model Context Protocol over stdio"})]}),(0,a.jsx)("span",{className:`text-xs px-2 py-1 rounded-full font-semibold ${el?"bg-green-500/15 text-green-500":"bg-red-500/15 text-red-500"}`,children:t(el?"active":"inactive")})]}),(0,a.jsxs)("div",{className:"mt-3 text-xs text-text-muted space-y-1",children:[(0,a.jsxs)("p",{children:[s("protocolToolsLabel")||"Tools",":"," ",(0,a.jsx)("span",{className:"text-text-main font-semibold",children:er||16})]}),(0,a.jsxs)("p",{children:[s("protocolLastActivity")||"Last activity",":"," ",(0,a.jsx)("span",{className:"text-text-main",children:q?.activity?.lastCallAt?new Date(q.activity.lastCallAt).toLocaleString():"—"})]})]}),(0,a.jsxs)("div",{className:"mt-3 rounded-lg bg-bg p-3 border border-border/70",children:[(0,a.jsx)("p",{className:"text-xs font-semibold mb-1",children:s("quickStart")||"Quick Start"}),(0,a.jsx)("code",{className:"text-xs font-mono break-all",children:"omniroute --mcp"})]}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsxs)(c(),{href:"/dashboard/mcp",className:"text-sm text-primary hover:text-primary-hover transition-colors",children:[s("openMcpDashboard")||"Open MCP management"," →"]})})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-border p-4 bg-bg-subtle",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"group_work"}),s("a2aCardTitle")||"A2A Server"]}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-1",children:s("a2aCardDescription")||"Agent2Agent JSON-RPC endpoint"})]}),(0,a.jsx)("span",{className:`text-xs px-2 py-1 rounded-full font-semibold ${ei?"bg-green-500/15 text-green-500":"bg-red-500/15 text-red-500"}`,children:t(ei?"active":"inactive")})]}),(0,a.jsxs)("div",{className:"mt-3 text-xs text-text-muted space-y-1",children:[(0,a.jsxs)("p",{children:[s("protocolTasksLabel")||"Tasks",":"," ",(0,a.jsx)("span",{className:"text-text-main font-semibold",children:Q?.tasks?.total||0})]}),(0,a.jsxs)("p",{children:[s("protocolActiveStreamsLabel")||"Active streams",":"," ",(0,a.jsx)("span",{className:"text-text-main font-semibold",children:en})]})]}),(0,a.jsxs)("div",{className:"mt-3 rounded-lg bg-bg p-3 border border-border/70",children:[(0,a.jsx)("p",{className:"text-xs font-semibold mb-1",children:s("quickStart")||"Quick Start"}),(0,a.jsxs)("code",{className:"text-xs font-mono break-all",children:[ee.replace(/\/v1$/,""),"/a2a"]})]}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsxs)(c(),{href:"/dashboard/a2a",className:"text-sm text-primary hover:text-primary-hover transition-colors",children:[s("openA2aDashboard")||"Open A2A management"," →"]})})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"rounded-xl border border-border p-4 bg-bg-subtle",children:[(0,a.jsx)("h4",{className:"font-semibold mb-2",children:s("mcpQuickStartTitle")||"MCP Quick Start"}),(0,a.jsxs)("ol",{className:"text-sm text-text-muted space-y-1 list-decimal list-inside",children:[(0,a.jsx)("li",{children:s("mcpQuickStartStep1")||"Run the MCP server via `omniroute --mcp`."}),(0,a.jsx)("li",{children:s("mcpQuickStartStep2")||"Configure your MCP client to connect over stdio transport."}),(0,a.jsx)("li",{children:s("mcpQuickStartStep3")||"Invoke tools such as `omniroute_get_health` and `omniroute_list_combos`."})]})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-border p-4 bg-bg-subtle",children:[(0,a.jsx)("h4",{className:"font-semibold mb-2",children:s("a2aQuickStartTitle")||"A2A Quick Start"}),(0,a.jsxs)("ol",{className:"text-sm text-text-muted space-y-1 list-decimal list-inside",children:[(0,a.jsx)("li",{children:s("a2aQuickStartStep1")||"Discover the agent card at `/.well-known/agent.json`."}),(0,a.jsx)("li",{children:s("a2aQuickStartStep2")||"Send JSON-RPC requests to `POST /a2a` using `message/send` or `message/stream`."}),(0,a.jsx)("li",{children:s("a2aQuickStartStep3")||"Track and control tasks using `tasks/get` and `tasks/cancel`."})]})]})]})]})}),(0,a.jsx)(i.aF,{isOpen:v,title:s("enableCloudTitle"),onClose:()=>N(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:[(0,a.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200 font-medium mb-2",children:s("whatYouGet")}),(0,a.jsxs)("ul",{className:"text-sm text-blue-700 dark:text-blue-300 space-y-1",children:[(0,a.jsxs)("li",{children:["• ",s("cloudBenefitAccess")]}),(0,a.jsxs)("li",{children:["• ",s("cloudBenefitShare")]}),(0,a.jsxs)("li",{children:["• ",s("cloudBenefitPorts")]}),(0,a.jsxs)("li",{children:["• ",s("cloudBenefitEdge")]})]})]}),(0,a.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,a.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-1",children:t("note")}),(0,a.jsxs)("ul",{className:"text-sm text-yellow-700 dark:text-yellow-300 space-y-1",children:[(0,a.jsxs)("li",{children:["• ",s("cloudSessionNote")]}),(0,a.jsxs)("li",{children:["• ",s("cloudUnstableNote")]})]})]}),(C||E)&&(0,a.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border transition-all duration-300 ${E?"bg-green-500/10 border-green-500/30":"bg-primary/10 border-primary/30"}`,children:[E?(0,a.jsx)("span",{className:"material-symbols-outlined text-green-500 text-xl",children:"check_circle"}):(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-primary",children:"progress_activity"}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsxs)("p",{className:`text-sm font-medium ${E?"text-green-500":"text-primary"}`,children:[E&&s("cloudConnected"),!E&&"syncing"===A&&s("connectingToCloud"),!E&&"verifying"===A&&s("verifyingConnection")]})})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:Y,fullWidth:!0,disabled:C||E,children:C?(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"syncing"===A?s("connecting"):s("verifying")]}):E?(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"check"}),s("connected")]}):s("enableCloud")}),(0,a.jsx)(i.$n,{onClick:()=>N(!1),variant:"ghost",fullWidth:!0,disabled:C||E,children:t("cancel")})]})]})}),(0,a.jsx)(i.aF,{isOpen:k,title:s("disableCloudTitle"),onClose:()=>!C&&w(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-red-600 dark:text-red-400",children:"warning"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-1",children:t("warning")}),(0,a.jsx)("p",{className:"text-sm text-red-700 dark:text-red-300",children:s("disableWarning")})]})]})}),C&&(0,a.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-primary/10 border border-primary/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-primary",children:"progress_activity"}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsxs)("p",{className:"text-sm font-medium text-primary",children:["syncing"===A&&s("syncingData"),"disabling"===A&&s("disablingCloud")]})})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:s("disableConfirm")}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:K,fullWidth:!0,disabled:C,className:"bg-red-500! hover:bg-red-600! text-white!",children:C?(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"syncing"===A?s("syncing"):s("disabling")]}):s("disableCloud")}),(0,a.jsx)(i.$n,{onClick:()=>w(!1),variant:"ghost",fullWidth:!0,disabled:C,children:t("cancel")})]})]})}),R&&(0,a.jsx)(h,{provider:R,models:o,copy:z,copied:F,onClose:()=>M(null)})]})}function h({provider:e,models:s,copy:t,copied:r,onClose:n}){let o=(0,x.c)("endpoint"),c=(0,x.c)("common"),d=e.provider.alias||e.id,m=(0,l.useMemo)(()=>s.filter(s=>!s.parent&&(s.owned_by===d||s.owned_by===e.id)),[s,d,e.id]),p=m.filter(e=>!e.type),u=m.filter(e=>"embedding"===e.type),b=m.filter(e=>"image"===e.type),h=(e,s,l)=>0===l.length?null:(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("h4",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-2 flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s}),e," (",l.length,")"]}),(0,a.jsx)("div",{className:"flex flex-col gap-1",children:l.map(e=>{let s=`modal-${e.id}`;return(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg hover:bg-surface/60 group",children:[(0,a.jsx)("code",{className:"text-sm font-mono flex-1 truncate",children:e.id}),e.custom&&(0,a.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-primary/10 text-primary",children:o("custom")}),(0,a.jsx)("button",{onClick:()=>t(e.id,s),className:"p-1 hover:bg-sidebar rounded text-text-muted hover:text-primary opacity-0 group-hover:opacity-100 transition-opacity",title:c("copy"),children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:r===s?"check":"content_copy"})})]},e.id)})})]});return(0,a.jsx)(i.aF,{isOpen:!0,onClose:n,title:o("providerModelsTitle",{provider:e.provider.name}),children:(0,a.jsx)("div",{className:"max-h-[60vh] overflow-y-auto",children:0===m.length?(0,a.jsx)("p",{className:"text-sm text-text-muted py-4 text-center",children:o("noModelsForProvider")}):(0,a.jsxs)(a.Fragment,{children:[h(o("chat"),"chat",p),h(o("embedding"),"data_array",u),h(o("image"),"image",b)]})})})}function g({icon:e,iconColor:s,iconBg:t,title:i,path:r,description:n,models:o,expanded:c,onToggle:d,copy:p,copied:u,baseUrl:b}){let h=(0,x.c)("endpoint"),g=(0,l.useMemo)(()=>{let e={};for(let s of o){let t=s.owned_by||"unknown";e[t]||(e[t]=[]),e[t].push(s)}return Object.entries(e).sort((e,s)=>s[1].length-e[1].length)},[o]),f=e=>m.Q2[e]||(0,m.zt)(e),j=`endpoint_${r}`;return(0,a.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,a.jsxs)("button",{onClick:d,className:"w-full flex items-center gap-3 p-4 hover:bg-surface/50 transition-colors text-left",children:[(0,a.jsx)("div",{className:`flex items-center justify-center size-10 rounded-lg ${t} shrink-0`,children:(0,a.jsx)("span",{className:`material-symbols-outlined text-xl ${s}`,children:e})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-semibold text-sm",children:i}),(0,a.jsx)("span",{className:"text-xs px-2 py-0.5 rounded-full bg-surface text-text-muted font-medium",children:h("modelsCount",{count:o.length})})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:n})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-lg transition-transform ${c?"rotate-180":""}`,children:"expand_more"})]}),c&&(0,a.jsxs)("div",{className:"border-t border-border px-4 pb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-3 mb-3",children:[(0,a.jsxs)("code",{className:"flex-1 text-xs font-mono text-text-muted bg-surface/80 px-3 py-1.5 rounded-lg truncate",children:[b.replace(/\/v1$/,""),r]}),(0,a.jsx)("button",{onClick:()=>p(`${b.replace(/\/v1$/,"")}${r}`,j),className:"p-1.5 hover:bg-surface rounded-lg text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:u===j?"check":"content_copy"})})]}),(0,a.jsx)("div",{className:"flex flex-col gap-2",children:g.map(([e,s])=>(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)("div",{className:"size-2.5 rounded-full shrink-0",style:{backgroundColor:f(e)?.color||"#888"}}),(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main",children:f(e)?.name||e}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["(",s.length,")"]})]}),(0,a.jsx)("div",{className:"ml-5 flex flex-wrap gap-1.5",children:s.map(e=>(0,a.jsx)("span",{className:"text-xs px-2 py-0.5 rounded-md bg-surface/80 text-text-muted font-mono",title:e.id,children:e.root||e.id.split("/").pop()},e.id))})]},e))})]})]})}b.propTypes={machineId:n().string.isRequired},h.propTypes={provider:n().object.isRequired,models:n().array.isRequired,copy:n().func.isRequired,copied:n().string,onClose:n().func.isRequired},g.propTypes={icon:n().string.isRequired,iconColor:n().string.isRequired,iconBg:n().string.isRequired,title:n().string.isRequired,path:n().string.isRequired,description:n().string.isRequired,models:n().array.isRequired,expanded:n().bool.isRequired,onToggle:n().func.isRequired,copy:n().func.isRequired,copied:n().string,baseUrl:n().string.isRequired};var f=t(24726),j=t(14816);function y(){let e=(0,x.c)("endpoints");return(0,a.jsxs)("div",{className:"p-6 max-w-5xl mx-auto space-y-6",children:[(0,a.jsxs)(i.Zp,{className:"p-8 text-center space-y-4",children:[(0,a.jsx)("div",{className:"flex items-center justify-center size-16 rounded-2xl bg-primary/10 text-primary mx-auto",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"code"})}),(0,a.jsx)("h2",{className:"text-xl font-semibold",children:e("apiEndpointsTitle")}),(0,a.jsx)("p",{className:"text-sm text-text-muted max-w-md mx-auto",children:e("apiEndpointsDescription")}),(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-amber-500/10 text-amber-500 text-sm font-medium",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"construction"}),e("comingSoon")]})]}),(0,a.jsxs)(i.Zp,{className:"p-5",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold mb-3",children:e("plannedFeatures")}),(0,a.jsxs)("ul",{className:"space-y-2 text-sm text-text-muted",children:[(0,a.jsxs)("li",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"check_circle"}),e("featureRestApi")]}),(0,a.jsxs)("li",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"check_circle"}),e("featureWebhooks")]}),(0,a.jsxs)("li",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"check_circle"}),e("featureSwagger")]}),(0,a.jsxs)("li",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"check_circle"}),e("featureAuth")]})]})]})]})}function v({label:e,status:s,enabled:t,onToggle:l,toggling:i}){return(0,a.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium border",style:{borderColor:s.loading?"var(--color-border)":s.online?"rgba(34,197,94,0.3)":"rgba(239,68,68,0.3)",background:s.loading?"transparent":s.online?"rgba(34,197,94,0.1)":"rgba(239,68,68,0.1)",color:s.loading?"var(--color-text-muted)":s.online?"rgb(34,197,94)":"rgb(239,68,68)"},children:[(0,a.jsx)("span",{className:"inline-block w-2 h-2 rounded-full",style:{background:s.loading?"var(--color-text-muted)":s.online?"rgb(34,197,94)":"rgb(239,68,68)",animation:s.online?"pulse 2s infinite":"none"}}),s.loading?"...":s.online?"Online":"Offline"]}),(0,a.jsx)("button",{onClick:l,disabled:i,className:"relative inline-flex items-center h-7 w-[52px] rounded-full transition-all duration-300 focus:outline-none border",style:{background:t?"rgb(34,197,94)":"var(--color-bg-tertiary)",borderColor:t?"rgba(34,197,94,0.5)":"var(--color-border)",opacity:i?.6:1,cursor:i?"wait":"pointer"},title:t?`Disable ${e}`:`Enable ${e}`,children:(0,a.jsx)("span",{className:"inline-block w-5 h-5 rounded-full shadow-md transition-all duration-300",style:{transform:t?"translateX(26px)":"translateX(3px)",background:t?"#fff":"var(--color-text-muted)"}})}),(0,a.jsx)("span",{className:"text-xs font-medium min-w-[24px]",style:{color:t?"rgb(34,197,94)":"var(--color-text-muted)"},children:i?"...":t?"ON":"OFF"})]})}function N({value:e,onChange:s,disabled:t,baseUrl:l}){let i={stdio:"omniroute --mcp",sse:`${l}/api/mcp/sse`,"streamable-http":`${l}/api/mcp/stream`};return(0,a.jsxs)("div",{className:"rounded-lg border p-4 mt-3",style:{borderColor:"var(--color-border)",background:"var(--color-bg-secondary)"},children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("span",{className:"material-symbols-rounded text-base",style:{color:"var(--color-primary)"},children:"swap_horiz"}),(0,a.jsx)("span",{className:"text-sm font-medium",style:{color:"var(--color-text)"},children:"Transport Mode"})]}),(0,a.jsx)("div",{className:"flex gap-2 flex-wrap",children:[{value:"stdio",label:"stdio",desc:"Local — IDE spawns process via omniroute --mcp"},{value:"sse",label:"SSE",desc:"Remote — Server-Sent Events over HTTP"},{value:"streamable-http",label:"Streamable HTTP",desc:"Remote — Modern bidirectional HTTP"}].map(l=>(0,a.jsxs)("button",{onClick:()=>s(l.value),disabled:t,className:"flex flex-col items-start px-4 py-2.5 rounded-lg border transition-all duration-200 text-left",style:{borderColor:e===l.value?"var(--color-primary)":"var(--color-border)",background:e===l.value?"rgba(var(--color-primary-rgb, 99,102,241), 0.1)":"transparent",opacity:t?.5:1,cursor:t?"wait":"pointer"},children:[(0,a.jsx)("span",{className:"text-sm font-semibold",style:{color:e===l.value?"var(--color-primary)":"var(--color-text)"},children:l.label}),(0,a.jsx)("span",{className:"text-xs mt-0.5",style:{color:"var(--color-text-muted)"},children:l.desc})]},l.value))}),(0,a.jsxs)("div",{className:"mt-3 rounded-md px-3 py-2 flex items-center gap-2",style:{background:"var(--color-bg-tertiary)"},children:[(0,a.jsx)("span",{className:"material-symbols-rounded text-sm",style:{color:"var(--color-text-muted)"},children:"stdio"===e?"terminal":"link"}),(0,a.jsx)("code",{className:"text-xs break-all",style:{color:"var(--color-text-muted)"},children:i[e]}),"stdio"!==e&&(0,a.jsx)("button",{className:"ml-auto text-xs px-2 py-0.5 rounded border hover:opacity-80 transition-opacity",style:{borderColor:"var(--color-border)",color:"var(--color-text-muted)"},onClick:()=>void navigator.clipboard.writeText(i[e]),title:"Copy URL",children:"Copy"})]})]})}function k(){let[e,s]=(0,l.useState)("endpoint-proxy"),t=(0,x.c)("endpoints"),[r,n]=(0,l.useState)({online:!1,loading:!0}),[o,c]=(0,l.useState)({online:!1,loading:!0}),[d,m]=(0,l.useState)(!1),[p,u]=(0,l.useState)(!1),[h,g]=(0,l.useState)(!1),[k,w]=(0,l.useState)(!1),[C,S]=(0,l.useState)("stdio"),[T,_]=(0,l.useState)(!1),[A,P]=(0,l.useState)("");(0,l.useEffect)(()=>{P(`${window.location.protocol}//${window.location.host}`)},[]),(0,l.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/settings");if(e.ok){let s=await e.json();m(!!s.mcpEnabled),u(!!s.a2aEnabled),S(s.mcpTransport||"stdio")}}catch{}})()},[]);let E=(0,l.useCallback)(async e=>fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),[]),$=(0,l.useCallback)(async e=>{let s="mcp"===e?g:w,t=!("mcp"===e?d:p);s(!0);try{(await E({["mcp"===e?"mcpEnabled":"a2aEnabled"]:t})).ok&&("mcp"===e?m:u)(t)}catch{}finally{s(!1)}},[d,p,E]),R=(0,l.useCallback)(async e=>{_(!0);try{(await E({mcpTransport:e})).ok&&S(e)}catch{}finally{_(!1)}},[E]),M=(0,l.useCallback)(async()=>{n(e=>({...e,loading:!0}));try{let e=await fetch("/api/mcp/status");if(e.ok){let s=await e.json();n({online:!!s.online,loading:!1})}else n({online:!1,loading:!1})}catch{n({online:!1,loading:!1})}},[]),D=(0,l.useCallback)(async()=>{c(e=>({...e,loading:!0}));try{let e=await fetch("/api/a2a/status");if(e.ok){let s=await e.json();c({online:"ok"===s.status,loading:!1})}else c({online:!1,loading:!1})}catch{c({online:!1,loading:!1})}},[]);return(0,l.useEffect)(()=>{let e=()=>{M(),D()};e();let s=setInterval(e,3e4);return()=>clearInterval(s)},[M,D]),(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsx)(i.Iz,{options:[{value:"endpoint-proxy",label:t("tabProxy"),icon:"api"},{value:"mcp",label:"MCP",icon:"hub"},{value:"a2a",label:"A2A",icon:"group_work"},{value:"api-endpoints",label:t("tabApiEndpoints"),icon:"code"}],value:e,onChange:s}),"mcp"===e&&(0,a.jsx)(v,{label:"MCP",status:r,enabled:d,onToggle:()=>void $("mcp"),toggling:h}),"a2a"===e&&(0,a.jsx)(v,{label:"A2A",status:o,enabled:p,onToggle:()=>void $("a2a"),toggling:k})]}),"mcp"===e&&d&&(0,a.jsx)(N,{value:C,onChange:e=>void R(e),disabled:T,baseUrl:A}),"endpoint-proxy"===e&&(0,a.jsx)(b,{machineId:""}),"mcp"===e&&(0,a.jsx)(f.default,{}),"a2a"===e&&(0,a.jsx)(j.default,{}),"api-endpoints"===e&&(0,a.jsx)(y,{})]})}},94388:(e,s,t)=>{Promise.resolve().then(t.bind(t,21583))}},e=>{e.O(0,[8500,3418,9751,8055,1149,5846,647,4726,4816,8441,3794,7358],()=>e(e.s=94388)),_N_E=e.O()}]);