@rsalmn/extremerouter 0.6.4 → 0.6.5

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 (403) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +1 -1
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/prerender-manifest.json +3 -3
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/swarm/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  36. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  37. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  38. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  39. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  40. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  41. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  42. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  43. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  45. package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  46. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  47. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  48. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
  49. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  50. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  51. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  52. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  54. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  56. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  58. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +4 -4
  60. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  62. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  63. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +1 -1
  65. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
  66. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  67. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  68. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  69. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  70. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  71. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +2 -2
  72. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  74. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
  75. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +3 -3
  76. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  77. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  78. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  79. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  80. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  81. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  82. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  88. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  90. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  96. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  119. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  122. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  133. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  134. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  143. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  170. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  173. package/app/.next-cli-build/server/app/callback.html +1 -1
  174. package/app/.next-cli-build/server/app/callback.rsc +4 -4
  175. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  176. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  177. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +4 -4
  178. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  179. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  180. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  181. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  182. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
  183. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  184. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  185. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  186. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  187. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  188. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  189. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
  190. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  191. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  192. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
  193. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  194. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  195. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  196. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  197. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  198. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  199. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  200. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  201. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  202. package/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
  203. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  204. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  205. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  206. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  207. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  208. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  209. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  210. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  211. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  212. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
  213. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  214. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  215. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  216. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  217. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  218. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  219. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
  220. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  221. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  222. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
  223. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  224. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  225. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  226. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  227. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  228. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  229. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  230. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +4 -4
  231. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  232. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  233. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  234. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  235. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  236. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  237. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  238. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  239. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  240. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
  241. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  242. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  243. package/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
  244. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  245. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  246. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  247. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  248. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  249. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  250. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
  251. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  252. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  253. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
  254. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  255. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  256. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  257. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  258. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  259. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  260. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  261. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
  262. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  263. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  264. package/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
  265. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  266. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  267. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  268. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  269. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  270. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  271. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
  272. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  273. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  274. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  275. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  276. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  277. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  278. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  279. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  280. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  281. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
  282. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  283. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  284. package/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
  285. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  286. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  287. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  288. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  289. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  290. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  291. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
  292. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  293. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  294. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  295. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  296. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  297. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  298. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  299. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  300. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  301. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  302. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  303. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  304. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  305. package/app/.next-cli-build/server/app/dashboard/skills.rsc +6 -6
  306. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  307. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  308. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  309. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  310. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
  311. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  312. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +4 -4
  313. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  314. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  315. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
  316. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  317. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  318. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  319. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  320. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  321. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  322. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +4 -4
  323. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  324. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  325. package/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
  326. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  327. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  328. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  329. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  330. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  331. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  332. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  333. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  334. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  335. package/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  336. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  337. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  338. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  339. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  340. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  341. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  342. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  343. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  344. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  345. package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
  346. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  347. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  348. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  349. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
  350. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  351. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +4 -4
  352. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  353. package/app/.next-cli-build/server/app/index.html +1 -1
  354. package/app/.next-cli-build/server/app/index.rsc +4 -4
  355. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  356. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  357. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  358. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +4 -4
  359. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  360. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  361. package/app/.next-cli-build/server/app/landing.html +1 -1
  362. package/app/.next-cli-build/server/app/landing.rsc +4 -4
  363. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  364. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  365. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +4 -4
  366. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  367. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  368. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  369. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  370. package/app/.next-cli-build/server/app/login.html +1 -1
  371. package/app/.next-cli-build/server/app/login.rsc +5 -5
  372. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  373. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  374. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +4 -4
  375. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  376. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  377. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  378. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  379. package/app/.next-cli-build/server/app-paths-manifest.json +1 -1
  380. package/app/.next-cli-build/server/chunks/2231.js +1 -1
  381. package/app/.next-cli-build/server/chunks/318.js +5 -5
  382. package/app/.next-cli-build/server/chunks/4746.js +1 -1
  383. package/app/.next-cli-build/server/chunks/4827.js +1 -1
  384. package/app/.next-cli-build/server/chunks/5612.js +1 -1
  385. package/app/.next-cli-build/server/chunks/6316.js +1 -1
  386. package/app/.next-cli-build/server/chunks/8238.js +1 -1
  387. package/app/.next-cli-build/server/chunks/8895.js +2 -2
  388. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  389. package/app/.next-cli-build/server/middleware.js +3 -3
  390. package/app/.next-cli-build/server/pages/404.html +1 -1
  391. package/app/.next-cli-build/server/pages/500.html +1 -1
  392. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  393. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  394. package/app/.next-cli-build/static/chunks/{1321-063dbf2b0db9ec56.js → 1321-7ffd27543f9d1ff2.js} +1 -1
  395. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-81c19a6fe2231d96.js → page-ec258bc489c68411.js} +1 -1
  396. package/app/cli/.build-home/AppData/Local/npm-cache/_update-notifier-last-checked +0 -0
  397. package/app/cli/.build-home/AppData/Roaming/extremerouter/db/backups/upgrade-0.6.4-to-0.6.5-0.6.5-20260705-054523/data.sqlite +0 -0
  398. package/app/cli/.build-home/AppData/Roaming/extremerouter/db/data.sqlite-shm +0 -0
  399. package/app/cli/.build-home/AppData/Roaming/extremerouter/db/data.sqlite-wal +0 -0
  400. package/app/package.json +1 -1
  401. package/package.json +1 -1
  402. /package/app/.next-cli-build/static/{wmMfolDh46kO-VuBq1X-C → F815PtW6J4xESr-nfpTca}/_buildManifest.js +0 -0
  403. /package/app/.next-cli-build/static/{wmMfolDh46kO-VuBq1X-C → F815PtW6J4xESr-nfpTca}/_ssgManifest.js +0 -0
@@ -7,4 +7,4 @@ sk-key-only-auto-named`;function A({isOpen:e,provider:t,providerName:s,isCompati
7
7
  "idToken": "eyJhbGc...",
8
8
  "email": "user@example.com"
9
9
  }
10
- ]`;function P({isOpen:e,onClose:t,onSuccess:s}){let[l,r]=(0,i.useState)(""),[o,n]=(0,i.useState)(!1),[c,m]=(0,i.useState)(""),[p,x]=(0,i.useState)(null),h=()=>{o||(r(""),m(""),x(null),t())},f=async()=>{var e;let t;m(""),x(null);let a=l.trim();if(!a)return;try{t=JSON.parse(a)}catch(e){m(`${(0,u.Tl)("Invalid JSON")}: ${e.message}`);return}let i=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!i||0===i.length)return void m((0,u.Tl)("No accounts found in input"));n(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:i})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);x(t),t.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,u.Tl)("Request failed"))}finally{n(!1)}},g=p?.results?.filter(e=>!e.ok)||[];return(0,a.jsx)(d.aF,{isOpen:e,title:(0,u.Tl)("Bulk Add Codex Accounts"),onClose:h,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:(0,u.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:O,value:l,onChange:e=>r(e.target.value),disabled:o}),c&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:c}),p&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,u.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,u.Tl)("failed")}`:""]}),g.length>0&&(0,a.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:g.map(e=>(0,a.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:f,fullWidth:!0,disabled:o||!l.trim(),children:o?(0,u.Tl)("Importing..."):(0,u.Tl)("Import All")}),(0,a.jsx)(d.$n,{onClick:h,variant:"ghost",fullWidth:!0,disabled:o,children:(0,u.Tl)("Close")})]})]})})}P.propTypes={isOpen:b().bool.isRequired,onClose:b().func.isRequired,onSuccess:b().func};let E={claude:"claudeAutoPing",codex:"codexAutoPing"};function I(){let e,t,s,r=(0,l.useParams)(),h=(0,l.useRouter)(),y=r.id,{getCaps:b}=(0,x.y)(),[j,N]=(0,i.useState)([]),[k,S]=(0,i.useState)(!0),[O,I]=(0,i.useState)(null),[R,D]=(0,i.useState)([]),[U,_]=(0,i.useState)(!1),[z,q]=(0,i.useState)(!1),[M,K]=(0,i.useState)(!1),[L,F]=(0,i.useState)(""),[J,W]=(0,i.useState)(!1),[B,H]=(0,i.useState)(!1),[G,V]=(0,i.useState)(!1),[Q,Z]=(0,i.useState)(!1),[X,Y]=(0,i.useState)(null),[ee,et]=(0,i.useState)({}),[es,ea]=(0,i.useState)([]),[ei,el]=(0,i.useState)(!1),[er,eo]=(0,i.useState)({}),[en,ed]=(0,i.useState)(""),[ec,em]=(0,i.useState)(()=>new Set),[ep,ex]=(0,i.useState)(""),[eu,eh]=(0,i.useState)(!1),[ef,eg]=(0,i.useState)(!1),[ey,eb]=(0,i.useState)([]),[ev,ej]=(0,i.useState)("__none__"),[ew,eN]=(0,i.useState)(!1),[ek,eC]=(0,i.useState)(null),[eS,eA]=(0,i.useState)(""),[e$,eT]=(0,i.useState)("auto"),[eO,eP]=(0,i.useState)({enabled:!1,connections:{}}),[eE,eI]=(0,i.useState)([]),[eR,eD]=(0,i.useState)([]),[eU,e_]=(0,i.useState)([]),[ez,eq]=(0,i.useState)(null),[eM,eK]=(0,i.useState)(!1),[eL,eF]=(0,i.useState)(!1),[eJ,eW]=(0,i.useState)(!1),[eB,eH]=(0,i.useState)(null),[eG,eV]=(0,i.useState)({}),[eQ,eZ]=(0,i.useState)(null),eX=(0,i.useRef)(!1),[eY,e0]=(0,i.useState)(!1),{copied:e1,copy:e2}=(0,p.C)(),e5="ag_risk_confirmed",e3=()=>{_(!0)},e4=()=>{"antigravity"===y&&"true"!==window.localStorage.getItem(e5)?eK(!0):te?e3():(F(""),K(!0))},e7=()=>{F(""),K(!0)},e8=()=>{te?e4():e7()},e6=O?{id:O.id,name:O.name||("anthropic-compatible"===O.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===O.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===O.type?"AC":"OC",apiType:O.apiType,baseUrl:O.baseUrl,type:O.type}:c.zN[y]||c.fg[y]||c.IS[y]||c.nJ[y]||c.br[y],e9=e6?.authModes||[],te=!!c.zN[y]||!!c.IS[y]||e9.includes("oauth"),tt=!!c.fg[y]||e9.includes("apikey"),ts=!!c.IS[y]?.noAuth,ta=(0,m.KC)(y),ti=(0,c.wG)(y),tl=(0,c.mq)(y),tr=(0,c.gb)(y),to=tl||tr,tn=!to&&te&&tt,td="xai"===y?"Grok Build OAuth":"OAuth",tc="xai"===y?"xAI API Key":"API Key";c.Q2[y]?.thinkingConfig||c.s9.extended;let tm=to?y:ti,tp=to?O?.prefix||y:ti,tx=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tm)}`,{cache:"no-store"}),t=await e.json();e.ok&&e_(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tm]),tu=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tm,ids:[e]})})).ok&&await tx()}catch(e){console.log("Error disabling model:",e)}},th=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tm)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tx()}catch(e){console.log("Error enabling model:",e)}},tf=async e=>{e.length&&eq({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eq(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tm,ids:e})})).ok&&await tx()}catch(e){console.log("Error disabling all models:",e)}}})},tg=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tm)}`,{method:"DELETE"})).ok&&await tx()}catch(e){console.log("Error enabling all models:",e)}},ty=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&et(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tb=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&ea(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,i.useEffect)(()=>{"kilocode"===y&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eD(e.models)}).catch(()=>{})},[y]);let tv=(0,i.useCallback)(async()=>{try{let[e,t,s,a]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),i=await e.json(),l=await t.json(),r=await s.json(),o=a.ok?await a.json():{};if(e.ok){let e=(i.connections||[]).filter(e=>e.provider===y);N(e)}s.ok&&D(r.proxyPools||[]);let n=(o.providerStrategies||{})[y]||{};eC(n.fallbackStrategy||null),eA(null!=n.stickyRoundRobinLimit?String(n.stickyRoundRobinLimit):"1");let d=(o.providerThinking||{})[y]||{};eT(d.mode||"auto");let c=E[y],m=c&&o[c]||{};if(eP({enabled:!0===m.enabled,connections:m.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===y)||null;if(!e&&to)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===y)||null))break}I(e)}}catch(e){console.log("Error fetching connections:",e)}finally{S(!1)}},[y,to]),tj=async e=>{try{let t=await fetch(`/api/provider-nodes/${y}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(I(s.node),await tv(),V(!1))}catch(e){console.log("Error updating provider node:",e)}},tw=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},i={};e&&(i.fallbackStrategy=e),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let l={...a};0===Object.keys(i).length?delete l[y]:l[y]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},tN=async e=>{let t=E[y];if(t){eP(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){console.log("Error saving auto-ping config:",e)}}};(0,i.useEffect)(()=>{tv(),ty(),tb(),tx()},[tv,ty,tb,tx]),(0,i.useEffect)(()=>{let e=(c.zN[y]||c.fg[y]||c.IS[y]||c.nJ[y])?.modelsFetcher;e&&f(e).then(eI)},[y]);let tk=async(e,t,s=ti)=>{let a=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})});if(e.ok)await ty();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tC=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await ty()}catch(e){console.log("Error deleting alias:",e)}},tS=async(e,t="llm",s=tm)=>{try{let a=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t})});if(a.ok)await tb(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await a.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tA=async(e,t="llm",s=tm)=>{try{let a=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${a}`,{method:"DELETE"})).ok&&(await tb(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},t$=async()=>{if(eY)return;let e=j.find(e=>!1!==e.isActive);if(!e)return void alert((0,u.Tl)("Please add an active Qoder connection first"));e0(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,u.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert((0,u.Tl)("No models returned"));let i=0;for(let e of a){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^qoder\//,"");es.some(e=>e.providerAlias===tm&&e.id===s&&"llm"===(e.kind||e.type||"llm"))||Object.values(ee).includes(`${tm}/${s}`)||(await tS(s,"llm",tm),i+=1)}0===i?alert((0,u.Tl)("All models already exist, no new models added")):alert((0,u.Tl)("Successfully added")+` ${i} `+(0,u.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,u.Tl)("Error fetching models")+": "+e.message)}finally{e0(!1)}},tT=async()=>{if(eL||0===j.length)return;let e=Object.fromEntries(j.map(e=>[e.id,{state:"queued",error:null}]));eX.current=!1,eF(!0),eW(!1),eH(null),eV(e),eZ({total:j.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<j.length;e+=1){if(eX.current){eZ({total:j.length,completed:e,passed:t,failed:s,stopped:!0});break}let a=j[e];eH(a.id),eV(e=>({...e,[a.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${a.id}/test`,{method:"POST"}),i=await e.json(),l=!!i.valid;l?t+=1:s+=1,eV(e=>({...e,[a.id]:{state:l?"success":"failed",error:l?null:i.error||null}}))}catch(e){s+=1,eV(t=>({...t,[a.id]:{state:"failed",error:e.message||"Test failed"}}))}eZ({total:j.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<j.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{eH(null),eF(!1),eW(!1),eX.current=!1}},tO=async e=>{eq({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eq(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&N(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tP=()=>{tv(),_(!1)},tE=async e=>{F("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:y,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tv(),K(!1);return}F(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),F("Failed to save connection")}},tI=async e=>{try{(await fetch(`/api/providers/${X.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tv(),H(!1))}catch(e){console.log("Error updating connection:",e)}},tR=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&N(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},tD=async(e,t)=>{let s=[...j];[s[e],s[t]]=[s[t],s[e]],N(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tv()}},tU=j.filter(e=>ey.includes(e.id)),t_=j.length>0&&ey.length===j.length;(0,i.useEffect)(()=>{eb(e=>e.filter(e=>j.some(t=>t.id===e)))},[j]),(()=>{if(0===tU.length)return;let e=new Set(tU.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=R.find(e=>e.id===t);return s?.name}})();let tz=()=>{ew||Z(!1)},tq=async e=>{eN(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:a}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:a})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",s,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tv(),Z(!1)}finally{eN(!1)}},tM=e=>tq(j.map(t=>({connectionId:t.id,proxyPoolId:e}))),tK=(0,a.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-border-subtle",children:j.map((e,t)=>{let s;return(0,a.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,a.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,a.jsx)("input",{type:"checkbox",checked:(s=e.id,ey.includes(s)),onChange:()=>{var t;return t=e.id,void eb(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(C,{connection:e,proxyPools:R,isOAuth:te,isFirst:0===t,isLast:t===j.length-1,onMoveUp:()=>tD(t,t-1),onMoveDown:()=>tD(t,t+1),onToggleActive:t=>tR(e.id,t),autoPing:E[y]&&"oauth"===e.authType?{on:!0===eO.connections[e.id],onToggle:t=>{var s;return s=e.id,void tN({...eO,connections:{...eO.connections,[s]:t}})},provider:y}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&N(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{Y(e),H(!0)},onDelete:()=>tO(e.id),oneByOneStatus:eG[e.id]||null})})]},e.id)})}),tL=R.filter(e=>!0===e.isActive),tF=(0,a.jsx)(d.aF,{isOpen:Q,onClose:tz,title:`Apply Proxy (${j.length} connections)`,children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("button",{onClick:()=>{let e=R.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):tq(j.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:ew||0===tL.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,a.jsxs)("button",{onClick:()=>tM(null),disabled:ew,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),R.map(e=>(0,a.jsxs)("button",{onClick:()=>tM(e.id),disabled:ew||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,a.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),ew&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,a.jsx)(d.$n,{onClick:tz,variant:"ghost",fullWidth:!0,disabled:ew,children:"Cancel"})]})}),tJ=async e=>{if(!ec.has(e)){em(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${tm}/${e}`})}),s=await t.json();eo(t=>({...t,[e]:s.ok?"ok":"error"})),ed(s.ok?"":s.error||"Model not reachable")}catch{eo(t=>({...t,[e]:"error"})),ed("Network error")}finally{em(t=>{let s=new Set(t);return s.delete(e),s})}}},tW=async e=>{eu||0===e.length||(eh(!0),ed(""),await Promise.all(e.map(e=>tJ(e))),eh(!1))};return k?(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(d.Qv,{}),(0,a.jsx)(d.Qv,{})]}):e6?(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)(o(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${e6.color}15`},children:ei?(0,a.jsx)("span",{className:"text-sm font-bold",style:{color:e6.color},children:e6.textIcon||e6.id.slice(0,2).toUpperCase()}):(0,a.jsx)(n.default,{src:tl&&e6.apiType?"responses"===e6.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tr?"/providers/anthropic-m.png":`/providers/${e6.id}.png`,alt:e6.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>el(!0)})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,a.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:e6.name}),(e6.notice?.apiKeyUrl||e6.notice?.signupUrl||e6.website)&&(0,a.jsxs)("a",{href:e6.notice?.apiKeyUrl||e6.notice?.signupUrl||e6.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),e6.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[j.length," connection",1===j.length?"":"s"]})]})]})]}),e6.deprecated&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:e6.deprecationNotice})]}),e6.notice?.text&&!e6.deprecated&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-info/30 bg-info/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-info shrink-0",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-info",children:e6.notice.text}),e6.notice.apiKeyUrl&&(0,a.jsx)("a",{href:e6.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),to&&O&&(0,a.jsx)(d.Zp,{children:(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:tr?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tr?"Messages API":"responses"===O.apiType?"Responses API":"Chat Completions"," \xb7 ",(O.baseUrl||"").replace(/\/$/,""),"/",tr?"messages":"responses"===O.apiType?"responses":"chat/completions"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>{F(""),K(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>V(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eq({title:"Delete Compatible Node",message:`Delete this ${tr?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eq(null);try{(await fetch(`/api/provider-nodes/${y}`,{method:"DELETE"})).ok&&h.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),ts?(0,a.jsx)(d.gw,{providerId:y}):(0,a.jsxs)(d.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[j.length>0&&R.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>Z(!0),children:"Apply Proxy"}),j.length>0&&(0,a.jsxs)(a.Fragment,{children:[ey.length>0&&(0,a.jsxs)(d.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=ey.length;0!==e&&eq({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eq(null);let e=0,t=[...ey];for(let s of t)try{(await fetch(`/api/providers/${s}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}N(e=>e.filter(e=>!t.includes(e.id))),eb([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",ey.length,")"]}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:tT,disabled:eL,children:eL?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eL&&(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eL&&(eX.current=!0,eW(!0))},disabled:eJ,children:eJ?"Stopping...":"Stop"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,a.jsx)(d.lM,{checked:"round-robin"===ek,onChange:e=>{let t=e?"round-robin":null,s=e?eS||"1":eS;e&&!eS&&eA("1"),eC(t),tw(t,s)}}),"round-robin"===ek&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:eS,onChange:e=>{var t;eA(t=e.target.value),tw("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===j.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:te?"lock":"key"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tn&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",td," or ",tc,"."]})]})]}),(0,a.jsx)("div",{className:"flex gap-2",children:tn?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e4,children:td}),(0,a.jsx)(d.$n,{size:"sm",icon:"key",onClick:e7,children:tc})]}):(0,a.jsxs)(a.Fragment,{children:[!to&&"iflow"===y&&(0,a.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>q(!0),children:"Cookie"}),"codex"===y&&(0,a.jsx)(d.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>W(!0),children:(0,u.Tl)("Bulk Add")}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:e8,children:to?"Add API Key":"iflow"===y?"OAuth":"Add Connection"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[eQ&&(0,a.jsx)("div",{className:"mb-4 rounded-lg border border-border bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("span",{children:["Total: ",eQ.total]}),(0,a.jsxs)("span",{children:["Completed: ",eQ.completed]}),(0,a.jsxs)("span",{children:["Passed: ",eQ.passed]}),(0,a.jsxs)("span",{children:["Failed: ",eQ.failed]}),eQ.stopped&&(0,a.jsx)("span",{className:"text-warning",children:"Stopped"}),eL&&eB&&(0,a.jsxs)("span",{children:["Running: ",j.find(e=>e.id===eB)?.name||eB]})]})}),j.length>0&&(0,a.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,a.jsx)("input",{type:"checkbox",checked:t_,onChange:()=>{t_?eb([]):eb(j.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),tK,!to&&(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===y&&(0,a.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>q(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===y&&(0,a.jsx)(d.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>W(!0),title:(0,u.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,u.Tl)("Bulk Add")}),tn?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e4,className:"w-full sm:w-auto",children:td}),(0,a.jsx)(d.$n,{size:"sm",icon:"key",onClick:e7,className:"w-full sm:w-auto",children:tc})]}):(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:e8,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,a.jsxs)(d.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),!to&&(e=[...ta,...eR.filter(e=>!ta.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eU.includes(e)),t=ep.trim().toLowerCase(),s=e.filter(e=>!t||e.toLowerCase().includes(t)),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[eU.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tg,children:"Active All"}),e.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tf(e),children:"Disable All"}),(j.length>0||ts)&&s.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"primary",icon:eu?"progress_activity":"play_arrow",onClick:()=>tW(s),disabled:eu,children:eu?"Testing...":`Test All (${s.length})`})]}))]}),(0,a.jsx)("div",{className:"sm:max-w-xs",children:(0,a.jsx)(d.pd,{type:"search",placeholder:"Search models...",value:ep,onChange:e=>ex(e.target.value),className:"w-full"})})]}),!!en&&(0,a.jsx)("p",{className:"text-xs text-danger mb-3 break-words",children:en}),(()=>{let e,t,s;if(to)return(0,a.jsx)(w,{providerStorageAlias:tm,providerDisplayAlias:tp,modelAliases:ee,customModels:es,copied:e1,onCopy:e2,onSetAlias:tk,onDeleteAlias:tC,onAddCustomModel:e=>tS(e,"llm",tm),onDeleteCustomModel:e=>tA(e,"llm",tm),connections:j,isAnthropic:tr});let i=[...ta,...eR.filter(e=>!ta.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}),l=new Set(eU),r=i.filter(e=>!l.has(e.id)),o=i.filter(e=>l.has(e.id)),n=g({customModels:es,modelAliases:ee,providerAlias:tm,builtInModels:ta,type:"llm"}),d=ep.trim().toLowerCase(),c=(e,t="")=>!d||e.toLowerCase().includes(d)||String(t).toLowerCase().includes(d),p=r.filter(e=>c(e.id,e.name)),x=n.filter(e=>c(e.id,e.name));return(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[x.map(e=>(0,a.jsx)(v,{model:{id:e.id,name:e.name},fullModel:`${tp}/${e.id}`,alias:e.alias,copied:e1,onCopy:e2,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tA(e.id,"llm",tm):tC(e.alias)},testStatus:er[e.id],onTest:j.length>0||ts?()=>tJ(e.id):void 0,isTesting:ec.has(e.id),isCustom:!0,isFree:!1,caps:b(`${y}/${e.id}`)},`${e.source}-${e.fullModel}`)),p.map(e=>{let t=`${tm}/${e.id}`,s=`${y}/${e.id}`,i=Object.entries(ee).find(([,e])=>e===t||e===s)?.[0];return(0,a.jsx)(v,{model:e,fullModel:`${tp}/${e.id}`,alias:i,copied:e1,onCopy:e2,onSetAlias:t=>tk(e.id,t,tm),onDeleteAlias:()=>tC(i),testStatus:er[e.id],onTest:j.length>0||ts?()=>tJ(e.id):void 0,isTesting:ec.has(e.id),isFree:e.isFree,onDisable:()=>tu(e.id),caps:b(`${y}/${e.id}`)},e.id)}),ep.trim()&&0===p.length&&0===x.length&&(0,a.jsxs)("p",{className:"w-full text-center text-sm text-text-muted py-4",children:["No models match “",ep,"”"]}),(0,a.jsxs)("button",{onClick:()=>eg(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===y&&j.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:t$,disabled:eY,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-info transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:eY?{animation:"spin 1s linear infinite"}:void 0,children:eY?"progress_activity":"download"}),eY?(0,u.Tl)("Fetching..."):(0,u.Tl)("Fetch Qoder Models")]}),eE.length>0&&(e=new Set([...Object.values(ee),...n.map(e=>e.fullModel)]),t=new Set(ta.map(e=>e.id)),0===(s=eE.filter(s=>!e.has(`${tm}/${s.id}`)&&!t.has(s.id))).length?null:(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,a.jsxs)("button",{onClick:async()=>{await tS(e.id,"llm",tm)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-border text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),o.length>0&&(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",o.length,"):"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:o.map(e=>(0,a.jsxs)("button",{onClick:()=>th(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-border text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),tF,"kiro"===y?(0,a.jsx)(d.Mh,{isOpen:U,providerInfo:e6,onSuccess:tP,onClose:()=>_(!1)}):"cursor"===y?(0,a.jsx)(d.G9,{isOpen:U,onSuccess:tP,onClose:()=>_(!1)}):"gitlab"===y?(0,a.jsx)(d.vj,{isOpen:U,providerInfo:e6,onSuccess:tP,onClose:()=>_(!1)}):(0,a.jsx)(d.LF,{isOpen:U,provider:y,providerInfo:e6,onSuccess:tP,onClose:()=>_(!1)}),"iflow"===y&&(0,a.jsx)(d.vE,{isOpen:z,onSuccess:()=>{tv(),q(!1)},onClose:()=>q(!1)}),(0,a.jsx)(A,{isOpen:M,provider:y,providerName:e6.name,isCompatible:to,isAnthropic:tr,authType:e6?.authType,authHint:e6?.authHint,website:e6?.website,proxyPools:R,error:L,onSave:tE,onBulkDone:tv,onClose:()=>{F(""),K(!1)}}),(0,a.jsx)(d.wI,{isOpen:B,connection:X,proxyPools:R,onSave:tI,onClose:()=>H(!1)}),to&&(0,a.jsx)($,{isOpen:G,node:O,onSave:tj,onClose:()=>V(!1),isAnthropic:tr}),!to&&(0,a.jsx)(T,{isOpen:ef,providerAlias:tm,providerDisplayAlias:tp,onSave:async e=>{await tS(e,"llm",tm),eg(!1)},onClose:()=>eg(!1)}),"codex"===y&&(0,a.jsx)(P,{isOpen:J,onClose:()=>W(!1),onSuccess:tv}),(0,a.jsx)(d.uo,{isOpen:eM,onClose:()=>eK(!1),onConfirm:()=>{(window.localStorage.setItem(e5,"true"),eK(!1),te)?e3():e7()},title:"Risk Notice",message:e6?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,a.jsx)(d.uo,{isOpen:!!ez,onClose:()=>eq(null),onConfirm:ez?.onConfirm,title:ez?.title||"Confirm",message:ez?.message,variant:"danger"})]}):(0,a.jsxs)("div",{className:"text-center py-20",children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,a.jsx)(o(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}},88845:(e,t,s)=>{Promise.resolve().then(s.bind(s,78907))}},e=>{e.O(0,[27,5772,1321,705,5497,8441,3794,7358],()=>e(e.s=88845)),_N_E=e.O()}]);
10
+ ]`;function P({isOpen:e,onClose:t,onSuccess:s}){let[l,r]=(0,i.useState)(""),[o,n]=(0,i.useState)(!1),[c,m]=(0,i.useState)(""),[p,x]=(0,i.useState)(null),h=()=>{o||(r(""),m(""),x(null),t())},f=async()=>{var e;let t;m(""),x(null);let a=l.trim();if(!a)return;try{t=JSON.parse(a)}catch(e){m(`${(0,u.Tl)("Invalid JSON")}: ${e.message}`);return}let i=Array.isArray(e=t)?e:e&&"object"==typeof e?Array.isArray(e.accounts)?e.accounts:[e]:null;if(!i||0===i.length)return void m((0,u.Tl)("No accounts found in input"));n(!0);try{let e=await fetch("/api/oauth/codex/bulk-import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accounts:i})}),t=await e.json();if(!e.ok)return void m(t?.error||`Request failed: ${e.status}`);x(t),t.success>0&&"function"==typeof s&&s()}catch(e){m(e.message||(0,u.Tl)("Request failed"))}finally{n(!1)}},g=p?.results?.filter(e=>!e.ok)||[];return(0,a.jsx)(d.aF,{isOpen:e,title:(0,u.Tl)("Bulk Add Codex Accounts"),onClose:h,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:(0,u.Tl)("Paste an array of codex account JSON objects. Each must include accessToken (and ideally refreshToken, idToken).")}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[240px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:O,value:l,onChange:e=>r(e.target.value),disabled:o}),c&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:c}),p&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:`text-sm font-medium ${p.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",p.success," ",(0,u.Tl)("added"),p.failed>0?`, ✗ ${p.failed} ${(0,u.Tl)("failed")}`:""]}),g.length>0&&(0,a.jsx)("ul",{className:"rounded border border-accent/20 bg-sidebar/50 p-2 text-xs font-mono max-h-40 overflow-y-auto",children:g.map(e=>(0,a.jsxs)("li",{className:"text-red-400",children:["[",e.index,"] ",e.error]},e.index))})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:f,fullWidth:!0,disabled:o||!l.trim(),children:o?(0,u.Tl)("Importing..."):(0,u.Tl)("Import All")}),(0,a.jsx)(d.$n,{onClick:h,variant:"ghost",fullWidth:!0,disabled:o,children:(0,u.Tl)("Close")})]})]})})}P.propTypes={isOpen:b().bool.isRequired,onClose:b().func.isRequired,onSuccess:b().func};let E={claude:"claudeAutoPing",codex:"codexAutoPing"};function I(){let e,t,s,r=(0,l.useParams)(),h=(0,l.useRouter)(),y=r.id,{getCaps:b}=(0,x.y)(),[j,N]=(0,i.useState)([]),[k,S]=(0,i.useState)(!0),[O,I]=(0,i.useState)(null),[R,D]=(0,i.useState)([]),[U,_]=(0,i.useState)(!1),[z,q]=(0,i.useState)(!1),[M,K]=(0,i.useState)(!1),[L,F]=(0,i.useState)(""),[J,W]=(0,i.useState)(!1),[B,H]=(0,i.useState)(!1),[G,V]=(0,i.useState)(!1),[Q,Z]=(0,i.useState)(!1),[X,Y]=(0,i.useState)(null),[ee,et]=(0,i.useState)({}),[es,ea]=(0,i.useState)([]),[ei,el]=(0,i.useState)(!1),[er,eo]=(0,i.useState)({}),[en,ed]=(0,i.useState)(""),[ec,em]=(0,i.useState)(()=>new Set),[ep,ex]=(0,i.useState)(""),[eu,eh]=(0,i.useState)(!1),[ef,eg]=(0,i.useState)(!1),[ey,eb]=(0,i.useState)([]),[ev,ej]=(0,i.useState)("__none__"),[ew,eN]=(0,i.useState)(!1),[ek,eC]=(0,i.useState)(null),[eS,eA]=(0,i.useState)(""),[e$,eT]=(0,i.useState)("auto"),[eO,eP]=(0,i.useState)({enabled:!1,connections:{}}),[eE,eI]=(0,i.useState)([]),[eR,eD]=(0,i.useState)([]),[eU,e_]=(0,i.useState)([]),[ez,eq]=(0,i.useState)(null),[eM,eK]=(0,i.useState)(!1),[eL,eF]=(0,i.useState)(!1),[eJ,eW]=(0,i.useState)(!1),[eB,eH]=(0,i.useState)(null),[eG,eV]=(0,i.useState)({}),[eQ,eZ]=(0,i.useState)(null),eX=(0,i.useRef)(!1),[eY,e0]=(0,i.useState)(!1),{copied:e1,copy:e2}=(0,p.C)(),e5="ag_risk_confirmed",e3=()=>{_(!0)},e4=()=>{"antigravity"===y&&"true"!==window.localStorage.getItem(e5)?eK(!0):te?e3():(F(""),K(!0))},e7=()=>{F(""),K(!0)},e8=()=>{te?e4():e7()},e6=O?{id:O.id,name:O.name||("anthropic-compatible"===O.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===O.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===O.type?"AC":"OC",apiType:O.apiType,baseUrl:O.baseUrl,type:O.type}:c.zN[y]||c.fg[y]||c.IS[y]||c.nJ[y]||c.br[y],e9=e6?.authModes||[],te=(!!c.zN[y]||!!c.IS[y]||e9.includes("oauth"))&&e6?.hasOAuth!==!1,tt=!!c.fg[y]||e9.includes("apikey")||e6?.hasOAuth===!1,ts=!!c.IS[y]?.noAuth,ta=(0,m.KC)(y),ti=(0,c.wG)(y),tl=(0,c.mq)(y),tr=(0,c.gb)(y),to=tl||tr,tn=!to&&te&&tt,td="xai"===y?"Grok Build OAuth":"OAuth",tc="xai"===y?"xAI API Key":"API Key";c.Q2[y]?.thinkingConfig||c.s9.extended;let tm=to?y:ti,tp=to?O?.prefix||y:ti,tx=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tm)}`,{cache:"no-store"}),t=await e.json();e.ok&&e_(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tm]),tu=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tm,ids:[e]})})).ok&&await tx()}catch(e){console.log("Error disabling model:",e)}},th=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tm)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tx()}catch(e){console.log("Error enabling model:",e)}},tf=async e=>{e.length&&eq({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eq(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tm,ids:e})})).ok&&await tx()}catch(e){console.log("Error disabling all models:",e)}}})},tg=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tm)}`,{method:"DELETE"})).ok&&await tx()}catch(e){console.log("Error enabling all models:",e)}},ty=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&et(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]),tb=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/custom",{cache:"no-store"}),t=await e.json();e.ok&&ea(t.models||[])}catch(e){console.log("Error fetching custom models:",e)}},[]);(0,i.useEffect)(()=>{"kilocode"===y&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eD(e.models)}).catch(()=>{})},[y]);let tv=(0,i.useCallback)(async()=>{try{let[e,t,s,a]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),i=await e.json(),l=await t.json(),r=await s.json(),o=a.ok?await a.json():{};if(e.ok){let e=(i.connections||[]).filter(e=>e.provider===y);N(e)}s.ok&&D(r.proxyPools||[]);let n=(o.providerStrategies||{})[y]||{};eC(n.fallbackStrategy||null),eA(null!=n.stickyRoundRobinLimit?String(n.stickyRoundRobinLimit):"1");let d=(o.providerThinking||{})[y]||{};eT(d.mode||"auto");let c=E[y],m=c&&o[c]||{};if(eP({enabled:!0===m.enabled,connections:m.connections||{}}),t.ok){let e=(l.nodes||[]).find(e=>e.id===y)||null;if(!e&&to)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===y)||null))break}I(e)}}catch(e){console.log("Error fetching connections:",e)}finally{S(!1)}},[y,to]),tj=async e=>{try{let t=await fetch(`/api/provider-nodes/${y}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(I(s.node),await tv(),V(!1))}catch(e){console.log("Error updating provider node:",e)}},tw=async(e,t)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),a=(s.ok?await s.json():{}).providerStrategies||{},i={};e&&(i.fallbackStrategy=e),"round-robin"===e&&""!==t&&(i.stickyRoundRobinLimit=Number(t)||3);let l={...a};0===Object.keys(i).length?delete l[y]:l[y]=i,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("Error saving provider strategy:",e)}},tN=async e=>{let t=E[y];if(t){eP(e);try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})})}catch(e){console.log("Error saving auto-ping config:",e)}}};(0,i.useEffect)(()=>{tv(),ty(),tb(),tx()},[tv,ty,tb,tx]),(0,i.useEffect)(()=>{let e=(c.zN[y]||c.fg[y]||c.IS[y]||c.nJ[y])?.modelsFetcher;e&&f(e).then(eI)},[y]);let tk=async(e,t,s=ti)=>{let a=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})});if(e.ok)await ty();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tC=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await ty()}catch(e){console.log("Error deleting alias:",e)}},tS=async(e,t="llm",s=tm)=>{try{let a=await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:s,id:e,type:t})});if(a.ok)await tb(),window.dispatchEvent(new CustomEvent("customModelChanged"));else{let e=await a.json();alert(e.error||"Failed to add custom model")}}catch(e){console.log("Error adding custom model:",e)}},tA=async(e,t="llm",s=tm)=>{try{let a=new URLSearchParams({providerAlias:s,id:e,type:t});(await fetch(`/api/models/custom?${a}`,{method:"DELETE"})).ok&&(await tb(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("Error deleting custom model:",e)}},t$=async()=>{if(eY)return;let e=j.find(e=>!1!==e.isActive);if(!e)return void alert((0,u.Tl)("Please add an active Qoder connection first"));e0(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||(0,u.Tl)("Failed to fetch models"));let a=s.models||[];if(0===a.length)return void alert((0,u.Tl)("No models returned"));let i=0;for(let e of a){let t=e.id||e.name;if(!t)continue;let s=t.replace(/^qoder\//,"");es.some(e=>e.providerAlias===tm&&e.id===s&&"llm"===(e.kind||e.type||"llm"))||Object.values(ee).includes(`${tm}/${s}`)||(await tS(s,"llm",tm),i+=1)}0===i?alert((0,u.Tl)("All models already exist, no new models added")):alert((0,u.Tl)("Successfully added")+` ${i} `+(0,u.Tl)("models"))}catch(e){console.log("Error importing Qoder models:",e),alert((0,u.Tl)("Error fetching models")+": "+e.message)}finally{e0(!1)}},tT=async()=>{if(eL||0===j.length)return;let e=Object.fromEntries(j.map(e=>[e.id,{state:"queued",error:null}]));eX.current=!1,eF(!0),eW(!1),eH(null),eV(e),eZ({total:j.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<j.length;e+=1){if(eX.current){eZ({total:j.length,completed:e,passed:t,failed:s,stopped:!0});break}let a=j[e];eH(a.id),eV(e=>({...e,[a.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${a.id}/test`,{method:"POST"}),i=await e.json(),l=!!i.valid;l?t+=1:s+=1,eV(e=>({...e,[a.id]:{state:l?"success":"failed",error:l?null:i.error||null}}))}catch(e){s+=1,eV(t=>({...t,[a.id]:{state:"failed",error:e.message||"Test failed"}}))}eZ({total:j.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<j.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{eH(null),eF(!1),eW(!1),eX.current=!1}},tO=async e=>{eq({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eq(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&N(t=>t.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tP=()=>{tv(),_(!1)},tE=async e=>{F("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:y,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tv(),K(!1);return}F(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),F("Failed to save connection")}},tI=async e=>{try{(await fetch(`/api/providers/${X.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tv(),H(!1))}catch(e){console.log("Error updating connection:",e)}},tR=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&N(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},tD=async(e,t)=>{let s=[...j];[s[e],s[t]]=[s[t],s[e]],N(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tv()}},tU=j.filter(e=>ey.includes(e.id)),t_=j.length>0&&ey.length===j.length;(0,i.useEffect)(()=>{eb(e=>e.filter(e=>j.some(t=>t.id===e)))},[j]),(()=>{if(0===tU.length)return;let e=new Set(tU.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=R.find(e=>e.id===t);return s?.name}})();let tz=()=>{ew||Z(!1)},tq=async e=>{eN(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:a}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:a})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",s,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tv(),Z(!1)}finally{eN(!1)}},tM=e=>tq(j.map(t=>({connectionId:t.id,proxyPoolId:e}))),tK=(0,a.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-border-subtle",children:j.map((e,t)=>{let s;return(0,a.jsxs)("div",{className:"flex min-w-0 items-stretch",children:[(0,a.jsx)("div",{className:"flex shrink-0 items-center pl-1 sm:pl-2",children:(0,a.jsx)("input",{type:"checkbox",checked:(s=e.id,ey.includes(s)),onChange:()=>{var t;return t=e.id,void eb(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"})}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(C,{connection:e,proxyPools:R,isOAuth:te,isFirst:0===t,isLast:t===j.length-1,onMoveUp:()=>tD(t,t-1),onMoveDown:()=>tD(t,t+1),onToggleActive:t=>tR(e.id,t),autoPing:E[y]&&"oauth"===e.authType?{on:!0===eO.connections[e.id],onToggle:t=>{var s;return s=e.id,void tN({...eO,connections:{...eO.connections,[s]:t}})},provider:y}:null,onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&N(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{Y(e),H(!0)},onDelete:()=>tO(e.id),oneByOneStatus:eG[e.id]||null})})]},e.id)})}),tL=R.filter(e=>!0===e.isActive),tF=(0,a.jsx)(d.aF,{isOpen:Q,onClose:tz,title:`Apply Proxy (${j.length} connections)`,children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("button",{onClick:()=>{let e=R.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):tq(j.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:ew||0===tL.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,a.jsxs)("button",{onClick:()=>tM(null),disabled:ew,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),R.map(e=>(0,a.jsxs)("button",{onClick:()=>tM(e.id),disabled:ew||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-surface-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,a.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),ew&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,a.jsx)(d.$n,{onClick:tz,variant:"ghost",fullWidth:!0,disabled:ew,children:"Cancel"})]})}),tJ=async e=>{if(!ec.has(e)){em(t=>new Set(t).add(e));try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${tm}/${e}`})}),s=await t.json();eo(t=>({...t,[e]:s.ok?"ok":"error"})),ed(s.ok?"":s.error||"Model not reachable")}catch{eo(t=>({...t,[e]:"error"})),ed("Network error")}finally{em(t=>{let s=new Set(t);return s.delete(e),s})}}},tW=async e=>{eu||0===e.length||(eh(!0),ed(""),await Promise.all(e.map(e=>tJ(e))),eh(!1))};return k?(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(d.Qv,{}),(0,a.jsx)(d.Qv,{})]}):e6?(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)(o(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${e6.color}15`},children:ei?(0,a.jsx)("span",{className:"text-sm font-bold",style:{color:e6.color},children:e6.textIcon||e6.id.slice(0,2).toUpperCase()}):(0,a.jsx)(n.default,{src:tl&&e6.apiType?"responses"===e6.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tr?"/providers/anthropic-m.png":`/providers/${e6.id}.png`,alt:e6.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>el(!0)})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,a.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:e6.name}),(e6.notice?.apiKeyUrl||e6.notice?.signupUrl||e6.website)&&(0,a.jsxs)("a",{href:e6.notice?.apiKeyUrl||e6.notice?.signupUrl||e6.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),e6.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[j.length," connection",1===j.length?"":"s"]})]})]})]}),e6.deprecated&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:e6.deprecationNotice})]}),e6.notice?.text&&!e6.deprecated&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-info/30 bg-info/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-info shrink-0",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-info",children:e6.notice.text}),e6.notice.apiKeyUrl&&(0,a.jsx)("a",{href:e6.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),to&&O&&(0,a.jsx)(d.Zp,{children:(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:tr?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tr?"Messages API":"responses"===O.apiType?"Responses API":"Chat Completions"," \xb7 ",(O.baseUrl||"").replace(/\/$/,""),"/",tr?"messages":"responses"===O.apiType?"responses":"chat/completions"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>{F(""),K(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>V(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eq({title:"Delete Compatible Node",message:`Delete this ${tr?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eq(null);try{(await fetch(`/api/provider-nodes/${y}`,{method:"DELETE"})).ok&&h.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),ts?(0,a.jsx)(d.gw,{providerId:y}):(0,a.jsxs)(d.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[j.length>0&&R.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>Z(!0),children:"Apply Proxy"}),j.length>0&&(0,a.jsxs)(a.Fragment,{children:[ey.length>0&&(0,a.jsxs)(d.$n,{size:"sm",variant:"danger",icon:"delete",onClick:()=>{let e=ey.length;0!==e&&eq({title:`Delete ${e} Connection${e>1?"s":""}`,message:`Delete ${e} connection${e>1?"s":""}? This cannot be undone.`,onConfirm:async()=>{eq(null);let e=0,t=[...ey];for(let s of t)try{(await fetch(`/api/providers/${s}`,{method:"DELETE"})).ok||(e+=1)}catch(t){console.log("Error deleting connection:",t),e+=1}N(e=>e.filter(e=>!t.includes(e.id))),eb([]),e>0&&alert(`Deleted ${t.length-e} connection(s), ${e} failed.`)}})},children:["Delete Selected (",ey.length,")"]}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:tT,disabled:eL,children:eL?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eL&&(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eL&&(eX.current=!0,eW(!0))},disabled:eJ,children:eJ?"Stopping...":"Stop"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,a.jsx)(d.lM,{checked:"round-robin"===ek,onChange:e=>{let t=e?"round-robin":null,s=e?eS||"1":eS;e&&!eS&&eA("1"),eC(t),tw(t,s)}}),"round-robin"===ek&&(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:eS,onChange:e=>{var t;eA(t=e.target.value),tw("round-robin",t)},placeholder:"1",className:"w-14 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]})]}),0===j.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:te?"lock":"key"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),tn&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",td," or ",tc,"."]})]})]}),(0,a.jsx)("div",{className:"flex gap-2",children:tn?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e4,children:td}),(0,a.jsx)(d.$n,{size:"sm",icon:"key",onClick:e7,children:tc})]}):(0,a.jsxs)(a.Fragment,{children:[!to&&"iflow"===y&&(0,a.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>q(!0),children:"Cookie"}),"codex"===y&&(0,a.jsx)(d.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>W(!0),children:(0,u.Tl)("Bulk Add")}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:e8,children:to?"Add API Key":"iflow"===y?"OAuth":"Add Connection"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[eQ&&(0,a.jsx)("div",{className:"mb-4 rounded-lg border border-border bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("span",{children:["Total: ",eQ.total]}),(0,a.jsxs)("span",{children:["Completed: ",eQ.completed]}),(0,a.jsxs)("span",{children:["Passed: ",eQ.passed]}),(0,a.jsxs)("span",{children:["Failed: ",eQ.failed]}),eQ.stopped&&(0,a.jsx)("span",{className:"text-warning",children:"Stopped"}),eL&&eB&&(0,a.jsxs)("span",{children:["Running: ",j.find(e=>e.id===eB)?.name||eB]})]})}),j.length>0&&(0,a.jsx)("div",{className:"mb-3 flex items-center gap-2 border-b border-black/[0.03] pb-2 dark:border-white/[0.03]",children:(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,a.jsx)("input",{type:"checkbox",checked:t_,onChange:()=>{t_?eb([]):eb(j.map(e=>e.id))},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All"]})}),tK,!to&&(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===y&&(0,a.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>q(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),"codex"===y&&(0,a.jsx)(d.$n,{size:"sm",icon:"playlist_add",variant:"secondary",onClick:()=>W(!0),title:(0,u.Tl)("Bulk import codex accounts from JSON"),className:"w-full sm:w-auto",children:(0,u.Tl)("Bulk Add")}),tn?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e4,className:"w-full sm:w-auto",children:td}),(0,a.jsx)(d.$n,{size:"sm",icon:"key",onClick:e7,className:"w-full sm:w-auto",children:tc})]}):(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:e8,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,a.jsxs)(d.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),!to&&(e=[...ta,...eR.filter(e=>!ta.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}).map(e=>e.id).filter(e=>!eU.includes(e)),t=ep.trim().toLowerCase(),s=e.filter(e=>!t||e.toLowerCase().includes(t)),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[eU.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tg,children:"Active All"}),e.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tf(e),children:"Disable All"}),(j.length>0||ts)&&s.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"primary",icon:eu?"progress_activity":"play_arrow",onClick:()=>tW(s),disabled:eu,children:eu?"Testing...":`Test All (${s.length})`})]}))]}),(0,a.jsx)("div",{className:"sm:max-w-xs",children:(0,a.jsx)(d.pd,{type:"search",placeholder:"Search models...",value:ep,onChange:e=>ex(e.target.value),className:"w-full"})})]}),!!en&&(0,a.jsx)("p",{className:"text-xs text-danger mb-3 break-words",children:en}),(()=>{let e,t,s;if(to)return(0,a.jsx)(w,{providerStorageAlias:tm,providerDisplayAlias:tp,modelAliases:ee,customModels:es,copied:e1,onCopy:e2,onSetAlias:tk,onDeleteAlias:tC,onAddCustomModel:e=>tS(e,"llm",tm),onDeleteCustomModel:e=>tA(e,"llm",tm),connections:j,isAnthropic:tr});let i=[...ta,...eR.filter(e=>!ta.some(t=>t.id===e.id))].filter(e=>{let t=(0,m.CP)(e);return!t||"llm"===t}),l=new Set(eU),r=i.filter(e=>!l.has(e.id)),o=i.filter(e=>l.has(e.id)),n=g({customModels:es,modelAliases:ee,providerAlias:tm,builtInModels:ta,type:"llm"}),d=ep.trim().toLowerCase(),c=(e,t="")=>!d||e.toLowerCase().includes(d)||String(t).toLowerCase().includes(d),p=r.filter(e=>c(e.id,e.name)),x=n.filter(e=>c(e.id,e.name));return(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[x.map(e=>(0,a.jsx)(v,{model:{id:e.id,name:e.name},fullModel:`${tp}/${e.id}`,alias:e.alias,copied:e1,onCopy:e2,onSetAlias:()=>{},onDeleteAlias:()=>{"custom"===e.source?tA(e.id,"llm",tm):tC(e.alias)},testStatus:er[e.id],onTest:j.length>0||ts?()=>tJ(e.id):void 0,isTesting:ec.has(e.id),isCustom:!0,isFree:!1,caps:b(`${y}/${e.id}`)},`${e.source}-${e.fullModel}`)),p.map(e=>{let t=`${tm}/${e.id}`,s=`${y}/${e.id}`,i=Object.entries(ee).find(([,e])=>e===t||e===s)?.[0];return(0,a.jsx)(v,{model:e,fullModel:`${tp}/${e.id}`,alias:i,copied:e1,onCopy:e2,onSetAlias:t=>tk(e.id,t,tm),onDeleteAlias:()=>tC(i),testStatus:er[e.id],onTest:j.length>0||ts?()=>tJ(e.id):void 0,isTesting:ec.has(e.id),isFree:e.isFree,onDisable:()=>tu(e.id),caps:b(`${y}/${e.id}`)},e.id)}),ep.trim()&&0===p.length&&0===x.length&&(0,a.jsxs)("p",{className:"w-full text-center text-sm text-text-muted py-4",children:["No models match “",ep,"”"]}),(0,a.jsxs)("button",{onClick:()=>eg(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),"qoder"===y&&j.some(e=>!1!==e.isActive)&&(0,a.jsxs)("button",{onClick:t$,disabled:eY,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-blue-500/40 px-3 py-2 text-xs text-info transition-colors hover:border-blue-500 hover:bg-blue-500/5 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:eY?{animation:"spin 1s linear infinite"}:void 0,children:eY?"progress_activity":"download"}),eY?(0,u.Tl)("Fetching..."):(0,u.Tl)("Fetch Qoder Models")]}),eE.length>0&&(e=new Set([...Object.values(ee),...n.map(e=>e.fullModel)]),t=new Set(ta.map(e=>e.id)),0===(s=eE.filter(s=>!e.has(`${tm}/${s.id}`)&&!t.has(s.id))).length?null:(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,a.jsxs)("button",{onClick:async()=>{await tS(e.id,"llm",tm)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-border text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),o.length>0&&(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",o.length,"):"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:o.map(e=>(0,a.jsxs)("button",{onClick:()=>th(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-border text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),tF,"kiro"===y?(0,a.jsx)(d.Mh,{isOpen:U,providerInfo:e6,onSuccess:tP,onClose:()=>_(!1)}):"cursor"===y?(0,a.jsx)(d.G9,{isOpen:U,onSuccess:tP,onClose:()=>_(!1)}):"gitlab"===y?(0,a.jsx)(d.vj,{isOpen:U,providerInfo:e6,onSuccess:tP,onClose:()=>_(!1)}):(0,a.jsx)(d.LF,{isOpen:U,provider:y,providerInfo:e6,onSuccess:tP,onClose:()=>_(!1)}),"iflow"===y&&(0,a.jsx)(d.vE,{isOpen:z,onSuccess:()=>{tv(),q(!1)},onClose:()=>q(!1)}),(0,a.jsx)(A,{isOpen:M,provider:y,providerName:e6.name,isCompatible:to,isAnthropic:tr,authType:e6?.authType,authHint:e6?.authHint,website:e6?.website,proxyPools:R,error:L,onSave:tE,onBulkDone:tv,onClose:()=>{F(""),K(!1)}}),(0,a.jsx)(d.wI,{isOpen:B,connection:X,proxyPools:R,onSave:tI,onClose:()=>H(!1)}),to&&(0,a.jsx)($,{isOpen:G,node:O,onSave:tj,onClose:()=>V(!1),isAnthropic:tr}),!to&&(0,a.jsx)(T,{isOpen:ef,providerAlias:tm,providerDisplayAlias:tp,onSave:async e=>{await tS(e,"llm",tm),eg(!1)},onClose:()=>eg(!1)}),"codex"===y&&(0,a.jsx)(P,{isOpen:J,onClose:()=>W(!1),onSuccess:tv}),(0,a.jsx)(d.uo,{isOpen:eM,onClose:()=>eK(!1),onConfirm:()=>{(window.localStorage.setItem(e5,"true"),eK(!1),te)?e3():e7()},title:"Risk Notice",message:e6?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,a.jsx)(d.uo,{isOpen:!!ez,onClose:()=>eq(null),onConfirm:ez?.onConfirm,title:ez?.title||"Confirm",message:ez?.message,variant:"danger"})]}):(0,a.jsxs)("div",{className:"text-center py-20",children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,a.jsx)(o(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}},88845:(e,t,s)=>{Promise.resolve().then(s.bind(s,78907))}},e=>{e.O(0,[27,5772,1321,705,5497,8441,3794,7358],()=>e(e.s=88845)),_N_E=e.O()}]);
package/app/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsalmn/extremerouter-app",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "ExtremeRouter web dashboard",
5
5
  "private": true,
6
6
  "license": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsalmn/extremerouter",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "ExtremeRouter CLI - AI Gateway control plane",
5
5
  "bin": {
6
6
  "extremerouter": "./cli.js"